You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(adapter,inspector): single-item collections + accurate capability report (WS-3)
Adapter:
- extractCollectionField honors foundry_item_single → returns the first matching
item's name (or first projected value) as a plain string, for "exactly one X
item" fields like a hero's class/ancestry/kit/subclass.
Capability Inspector:
- Stop mislabeling collection-mapped fields (abilities_json, class, …) as
"declared-unmapped" — they're mapped via a collection, so classify them
collection-mapped and count them separately (Status panel + Copy Report).
- Surface one sample item schema PER item type in the collections section (was:
only the first item overall). The Copy Report now lists the projectable fields
for ability/feature/class/ancestry/kit/… — exactly what's needed to finish the
remaining item-field mappings (feature split, immunities/weaknesses).
Tests: 568 node tests green (+3). New coverage for single-item extraction
(name, projection, empty), collection-mapped classification, and per-type
sample schemas in the report.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LaDDiXB5GTVurEzJwYYopf
@@ -233,8 +258,9 @@ export function buildCapabilityReport(snapshot, fieldDefs) {
233
258
source: 'actor.items',
234
259
count: snapshot.items.count,
235
260
types: snapshot.items.types,
236
-
note: 'Embedded items (abilities/inventory) — not pullable by the dot-path adapter yet (WS-3).',
261
+
note: 'Embedded items. Pullable via a collection mapping (foundry_collection + foundry_item_type[, foundry_item_single]); per-type schemas below show the projectable fields.',
237
262
sample: snapshot.items.sample,
263
+
samples: snapshot.items.samples||[],
238
264
});
239
265
}
240
266
if(snapshot.effects&&snapshot.effects.available){
@@ -267,6 +293,7 @@ function _summarize(rows, collections) {
267
293
synced: 0,
268
294
mappedMissing: 0,
269
295
declaredUnmapped: 0,
296
+
collectionMapped: 0,
270
297
availableUnmapped: 0,
271
298
collectionsAvailable: collections.length,
272
299
totalDeclared: 0,
@@ -275,9 +302,10 @@ function _summarize(rows, collections) {
<divclass="system-info-row"><spanclass="system-label">Mapped, missing on actor:</span><spanclass="system-value">{{capability.summary.mappedMissing}}</span></div>
1102
1103
<divclass="system-info-row"><spanclass="system-label">Available, not mapped:</span><spanclass="system-value">{{capability.summary.availableUnmapped}}</span></div>
0 commit comments