@openfairygui/backend 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -29,6 +29,7 @@ It also provides:
29
29
  - synchronous cache refresh returning a detached revision-bound snapshot
30
30
  - revision-bound derived read-only cache snapshots
31
31
  - revision-bound project identity outlines for transaction planning
32
+ - revision-bound in-component display-node filtering with explicit candidate limits and byte budgets
32
33
  - bounded, detached public UAM model and primary resource-byte reads with edit-revision checks
33
34
  - revision-bound read-only project validation reports
34
35
  - explicit Node bridge boundaries for publish/restore
@@ -49,8 +50,9 @@ Adapter-backed `openSession` hydrates primary resource bytes so browser-safe tra
49
50
  assets or add/replace/remove binary resources. `saveSession` writes replacement bytes before it removes
50
51
  stale source files, preserving the prior file when a write fails.
51
52
  It also compares the source project with a UAM round trip through `ProjectWriter`; sessions with
52
- unrepresented persisted properties expose `uamFidelity: 'unsupported'`, and write attempts fail with
53
- `uam_fidelity_unsupported`. Existing projects in browser storage must be opened through this path by
53
+ unrepresented persisted properties expose `uamFidelity: 'unsupported'` together with a bounded
54
+ `uamFidelityReport`, and write attempts fail with `uam_fidelity_unsupported` carrying `error.fidelityReport`
55
+ and matching `meta.diagnostics`. Existing projects in browser storage must be opened through this path by
54
56
  injecting `createBackendStorageFileSystem(storage)` into `BackendRuntime`; `openProjectSession` is only
55
57
  for sessions whose supplied UAM project is authoritative. Transactions, saves, and materialization are
56
58
  serialized per session together with close. Opening and storage rebinding reserve the canonical target before asynchronous I/O; failed rebinding retains the original session binding.
@@ -1,7 +1,7 @@
1
- import * as _$_openfairygui_core0 from "@openfairygui/core";
2
- import { ProjectDiagnosticCode, ProjectValidationReport } from "@openfairygui/core";
3
1
  import { UamComponentModel, UamComponentResource, UamComponentSelector, UamControllerModel, UamControllerSelector, UamDisplayNode, UamDisplayNodeKind, UamDisplayNodeSelector, UamGenericAssetResource, UamImageResource, UamMovieClipResource, UamPackage, UamPackageSelector, UamPackageSettings, UamProject, UamResource, UamResourceSelector, UamTransactionOperation, UamTransactionSupportIssueCode, UamTransitionModel, UamTransitionSelector } from "@openfairygui/core/uam";
4
2
  import { ApplyUamTransactionAppError } from "@openfairygui/functions/uam";
3
+ import * as _$_openfairygui_core0 from "@openfairygui/core";
4
+ import { ProjectDiagnosticCode, ProjectValidationReport } from "@openfairygui/core";
5
5
 
6
6
  //#region src/path-policy.d.ts
7
7
  interface PathPolicyViolationError {
@@ -13,7 +13,7 @@ interface PathPolicyViolationError {
13
13
  }
14
14
  //#endregion
15
15
  //#region src/runtime/capabilities.d.ts
16
- declare const BACKEND_METHODS: readonly ["getCapabilities", "openSession", "openProjectSession", "getSession", "getProjectOutline", "queryEntity", "readSessionState", "readResourceBytes", "validateSession", "preflightTransaction", "applyTransaction", "saveSession", "materializeSession", "closeSession", "getEvents", "getCacheSnapshot", "refreshCache"];
16
+ declare const BACKEND_METHODS: readonly ["getCapabilities", "openSession", "openProjectSession", "getSession", "getProjectOutline", "queryEntity", "queryDisplayNodes", "readSessionState", "readResourceBytes", "validateSession", "preflightTransaction", "applyTransaction", "saveSession", "materializeSession", "closeSession", "getEvents", "getCacheSnapshot", "refreshCache"];
17
17
  //#endregion
18
18
  //#region src/runtime/contracts.d.ts
19
19
  type BackendMethodName = keyof BackendRuntime;
@@ -22,6 +22,14 @@ declare const BACKEND_ENTITY_QUERY_LIMITS: {
22
22
  readonly maxDepth: 32;
23
23
  readonly maxNodes: 100000;
24
24
  };
25
+ declare const BACKEND_DISPLAY_NODE_QUERY_LIMITS: {
26
+ readonly maxBytes: 262144;
27
+ readonly maxDepth: 32;
28
+ readonly maxNodes: 100000;
29
+ readonly defaultLimit: 50;
30
+ readonly maxLimit: 200;
31
+ };
32
+ declare const BACKEND_DISPLAY_NODE_FILTER_FIELDS: readonly ["kind", "name", "nameContains", "text", "textContains", "title", "titleContains", "group", "resourceId", "url", "visible", "locked", "touchable", "hasGears", "hasRelations"];
25
33
  declare const BACKEND_SESSION_READ_LIMITS: {
26
34
  readonly model: {
27
35
  readonly maxBytes: 4194304;
@@ -47,7 +55,7 @@ interface ReadResourceBytesInput {
47
55
  expectedRevision: number;
48
56
  selector: UamResourceSelector;
49
57
  }
50
- interface BackendSessionStateSnapshot extends Pick<BackendSessionSnapshot, 'sessionId' | 'revision' | 'lastSavedRevision' | 'dirty' | 'uamFidelity'> {
58
+ interface BackendSessionStateSnapshot extends Pick<BackendSessionSnapshot, 'sessionId' | 'revision' | 'lastSavedRevision' | 'dirty' | 'uamFidelity' | 'uamFidelityReport'> {
51
59
  project: BackendSessionProjectModel;
52
60
  readDiagnostics: _$_openfairygui_core0.ProjectDiagnostic[];
53
61
  /** Source-read completeness, not a guarantee of resource bytes or downstream usability. */
@@ -146,6 +154,67 @@ interface EntityQueryError {
146
154
  sessionId: string;
147
155
  reason: 'invalid_query' | 'not_found' | 'ambiguous' | 'response_budget_exceeded' | 'non_json_value';
148
156
  }
157
+ interface DisplayNodeFilter {
158
+ kind?: UamDisplayNodeKind;
159
+ name?: string;
160
+ nameContains?: string;
161
+ text?: string;
162
+ textContains?: string;
163
+ title?: string;
164
+ titleContains?: string;
165
+ group?: string;
166
+ resourceId?: string;
167
+ url?: string;
168
+ visible?: boolean;
169
+ locked?: boolean;
170
+ touchable?: boolean;
171
+ hasGears?: boolean;
172
+ hasRelations?: boolean;
173
+ }
174
+ interface QueryDisplayNodesInput {
175
+ sessionId: string;
176
+ selector: UamComponentSelector;
177
+ filter?: DisplayNodeFilter;
178
+ /** Maximum candidate entries to return (default 50, max 200). */
179
+ limit?: number;
180
+ }
181
+ interface BackendDisplayNodeCandidate {
182
+ /** Exact display node ID to pass to queryEntity or mutation selectors. */
183
+ id: string;
184
+ name: string;
185
+ kind: UamDisplayNodeKind;
186
+ /** Zero-based index in the component's displayList. */
187
+ index: number;
188
+ position: {
189
+ x: number;
190
+ y: number;
191
+ };
192
+ size: {
193
+ width: number;
194
+ height: number;
195
+ };
196
+ visible: boolean;
197
+ locked: boolean;
198
+ touchable: boolean;
199
+ group?: string;
200
+ text?: string;
201
+ title?: string;
202
+ resource?: {
203
+ packageId?: string;
204
+ resourceId: string;
205
+ };
206
+ url?: string;
207
+ gearCount: number;
208
+ relationCount: number;
209
+ }
210
+ interface BackendDisplayNodeQueryResult {
211
+ sessionId: string;
212
+ revision: number;
213
+ selector: UamComponentSelector;
214
+ totalMatched: number;
215
+ truncated: boolean;
216
+ nodes: BackendDisplayNodeCandidate[];
217
+ }
149
218
  /** An exclusive lock owned for the lifetime of one backend session. */
150
219
  interface BackendSessionLock {
151
220
  /** Persist optional host metadata without changing lock ownership. */
@@ -261,6 +330,13 @@ interface BackendCapabilities {
261
330
  sourceBytes: false;
262
331
  limits: typeof BACKEND_ENTITY_QUERY_LIMITS;
263
332
  };
333
+ displayNodeQuery: {
334
+ scope: 'component';
335
+ filterFields: readonly (keyof DisplayNodeFilter)[];
336
+ projection: 'summary';
337
+ sourceBytes: false;
338
+ limits: typeof BACKEND_DISPLAY_NODE_QUERY_LIMITS;
339
+ };
264
340
  sessionState: {
265
341
  sourceBytes: false;
266
342
  limits: typeof BACKEND_SESSION_READ_LIMITS.model;
@@ -330,6 +406,30 @@ interface BackendCapabilities {
330
406
  };
331
407
  };
332
408
  }
409
+ type UamFidelityFailureReason = 'incomplete_read' | 'materialize_failed' | 'round_trip_mismatch';
410
+ interface UamFidelityDiffEntry {
411
+ /** Project-relative path of the differing file or directory. */
412
+ path: string;
413
+ kind: 'file' | 'directory';
414
+ change: 'missing' | 'extra' | 'modified' | 'type_mismatch';
415
+ /** First differing 1-based line number for text files. */
416
+ line?: number;
417
+ /** Bounded excerpt of the source writer line at `line`. */
418
+ sourceExcerpt?: string;
419
+ /** Bounded excerpt of the materialized writer line at `line`. */
420
+ materializedExcerpt?: string;
421
+ }
422
+ interface UamFidelityReport {
423
+ reason: UamFidelityFailureReason;
424
+ /** Bounded message when read failed completeness or materialization threw. */
425
+ errorMessage?: string;
426
+ /** Total number of differing files and directories detected before truncation. */
427
+ totalDiffCount: number;
428
+ /** Bounded list of detected differences, sorted deterministically by path and kind. */
429
+ diffs: UamFidelityDiffEntry[];
430
+ /** True when `diffs` was capped to stay within response bounds. */
431
+ truncated: boolean;
432
+ }
333
433
  interface BackendSessionSnapshot {
334
434
  sessionId: string;
335
435
  canonicalProjectPath: string;
@@ -337,6 +437,8 @@ interface BackendSessionSnapshot {
337
437
  lastSavedRevision: number;
338
438
  dirty: boolean;
339
439
  uamFidelity: 'full' | 'unsupported';
440
+ /** Present when `uamFidelity` is `unsupported` and a bounded failure report was captured. */
441
+ uamFidelityReport?: UamFidelityReport;
340
442
  lockHeld: boolean;
341
443
  capabilities: BackendCapabilities;
342
444
  }
@@ -466,6 +568,8 @@ interface UamFidelityUnsupportedError {
466
568
  message: string;
467
569
  sessionId: string;
468
570
  canonicalPathKey: string;
571
+ /** Bounded structured summary of why UAM fidelity is unsupported. */
572
+ fidelityReport?: UamFidelityReport;
469
573
  }
470
574
  interface MaterializeValidationFailedError {
471
575
  code: 'materialize_validation_failed';
@@ -680,6 +784,7 @@ declare class BackendRuntime {
680
784
  }): BackendResult<BackendSessionSnapshot, SessionNotFoundError>;
681
785
  getProjectOutline(input: GetProjectOutlineInput): BackendResult<BackendProjectOutline, SessionNotFoundError>;
682
786
  queryEntity(input: QueryEntityInput): BackendResult<BackendEntitySnapshot, SessionNotFoundError | EntityQueryError>;
787
+ queryDisplayNodes(input: QueryDisplayNodesInput): BackendResult<BackendDisplayNodeQueryResult, SessionNotFoundError | EntityQueryError>;
683
788
  readSessionState(input: ReadSessionStateInput): BackendResult<BackendSessionStateSnapshot, SessionNotFoundError | SessionReadError | SessionStaleReadError>;
684
789
  readResourceBytes(input: ReadResourceBytesInput): BackendResult<BackendResourceBytesSnapshot, SessionNotFoundError | SessionReadError | SessionStaleReadError>;
685
790
  validateSession(input: ValidateSessionInput): BackendResult<ProjectValidationReport, SessionNotFoundError>;
@@ -700,7 +805,7 @@ declare class BackendRuntime {
700
805
  //#endregion
701
806
  //#region src/contracts.d.ts
702
807
  declare const BACKEND_CONTRACT_VERSION: "3.0.0";
703
- declare const BACKEND_CAPABILITY_SCHEMA_VERSION: 15;
808
+ declare const BACKEND_CAPABILITY_SCHEMA_VERSION: 16;
704
809
  declare const BACKEND_COMPATIBILITY_POLICY: {
705
810
  readonly incompatibleChange: "requires contractVersion bump";
706
811
  readonly capabilitySchemaChange: "requires capabilitySchemaVersion bump";
@@ -753,4 +858,4 @@ interface BackendResponseMeta {
753
858
  capabilitySchemaVersion: typeof BACKEND_CAPABILITY_SCHEMA_VERSION;
754
859
  }
755
860
  //#endregion
756
- export { EntityQueryError as $, BackendFileStat as A, UamFidelityUnsupportedError as At, BackendResourceBytesSnapshot as B, BackendComponentSnapshot as C, SessionIdConflictError as Ct, BackendEvent as D, SessionStaleReadError as Dt, BackendError as E, SessionReadError as Et, BackendProjectOutline as F, BackendSessionPackageModel as G, BackendResult as H, BackendProjectOutlinePackage as I, BackendSessionSnapshot as J, BackendSessionProjectModel as K, BackendProjectOutlineResource as L, BackendHostAdapter as M, BackendMethodName as N, BackendEventKind as O, SessionStaleWriteError as Ot, BackendPackageSnapshot as P, BackendTransactionPreview as Q, BackendProjectSessionStorage as R, BackendCapabilityUnavailableError as S, SessionCloseFailedError as St, BackendEntityTarget as T, SessionNotFoundError as Tt, BackendRuntimeOptions as U, BackendResourceSnapshot as V, BackendSessionLock as W, BackendSuccess as X, BackendSessionStateSnapshot as Y, BackendTransactionEntityChange as Z, BackendArtifactBridgeCapability as _, ReadResourceBytesInput as _t, BackendDiagnosticCode as a, InProcessLockConflictError as at, BackendCapabilities as b, SavePartialFailureError as bt, BackendMessage as c, MaterializeValidationFailedError as ct, BackendRuntime as d, ProjectOpenFailedError as dt, EventCursorInvalidError as et, AdvisoryLockConflictError as f, ProjectOpenFailureReason as ft, BACKEND_TRANSACTION_PREVIEW_LIMITS as g, QueryEntityInput as gt, BACKEND_SESSION_READ_LIMITS as h, ProjectWriteTransactionResult as ht, BackendDiagnostic as i, GetProjectOutlineInput as it, BackendFileSystem as j, ValidateSessionInput as jt, BackendFailure as k, TransactionPreviewError as kt, BackendResponseMeta as l, MaterializeWriteFailedError as lt, BACKEND_ENTITY_QUERY_LIMITS as m, ProjectWriteTransactionError as mt, BACKEND_COMPATIBILITY_POLICY as n, GetEventsInput as nt, BackendDiagnosticOwner as o, MaterializeSessionInput as ot, ApplySessionTransactionInput as p, ProjectRootNotAllowedError as pt, BackendSessionResourceModel as q, BACKEND_CONTRACT_VERSION as r, GetEventsSnapshot as rt, BackendDiagnosticRemediation as s, MaterializeSessionSnapshot as st, BACKEND_CAPABILITY_SCHEMA_VERSION as t, GetCacheSnapshotInput as tt, BackendStage as u, OpenProjectSessionInput as ut, BackendCacheEntry as v, ReadSessionStateInput as vt, BackendEntitySnapshot as w, SessionLimitExceededError as wt, BackendCapabilityManifest as x, SaveSessionInput as xt, BackendCacheSnapshot as y, RefreshCacheInput as yt, BackendProjectSnapshot as z };
861
+ export { BackendSessionStateSnapshot as $, BackendError as A, SessionLimitExceededError as At, BackendProjectOutlinePackage as B, ValidateSessionInput as Bt, BackendCapabilityManifest as C, ReadResourceBytesInput as Ct, BackendDisplayNodeQueryResult as D, SaveSessionInput as Dt, BackendDisplayNodeCandidate as E, SavePartialFailureError as Et, BackendFileSystem as F, TransactionPreviewError as Ft, BackendResourceSnapshot as G, BackendProjectSessionStorage as H, BackendHostAdapter as I, UamFidelityDiffEntry as It, BackendSessionLock as J, BackendResult as K, BackendMethodName as L, UamFidelityFailureReason as Lt, BackendEventKind as M, SessionReadError as Mt, BackendFailure as N, SessionStaleReadError as Nt, BackendEntitySnapshot as O, SessionCloseFailedError as Ot, BackendFileStat as P, SessionStaleWriteError as Pt, BackendSessionSnapshot as Q, BackendPackageSnapshot as R, UamFidelityReport as Rt, BackendCapabilities as S, QueryEntityInput as St, BackendComponentSnapshot as T, RefreshCacheInput as Tt, BackendProjectSnapshot as U, BackendProjectOutlineResource as V, BackendResourceBytesSnapshot as W, BackendSessionProjectModel as X, BackendSessionPackageModel as Y, BackendSessionResourceModel as Z, BACKEND_SESSION_READ_LIMITS as _, ProjectOpenFailureReason as _t, BackendDiagnosticCode as a, EventCursorInvalidError as at, BackendCacheEntry as b, ProjectWriteTransactionResult as bt, BackendMessage as c, GetEventsSnapshot as ct, BackendRuntime as d, MaterializeSessionInput as dt, BackendSuccess as et, AdvisoryLockConflictError as f, MaterializeSessionSnapshot as ft, BACKEND_ENTITY_QUERY_LIMITS as g, ProjectOpenFailedError as gt, BACKEND_DISPLAY_NODE_QUERY_LIMITS as h, OpenProjectSessionInput as ht, BackendDiagnostic as i, EntityQueryError as it, BackendEvent as j, SessionNotFoundError as jt, BackendEntityTarget as k, SessionIdConflictError as kt, BackendResponseMeta as l, GetProjectOutlineInput as lt, BACKEND_DISPLAY_NODE_FILTER_FIELDS as m, MaterializeWriteFailedError as mt, BACKEND_COMPATIBILITY_POLICY as n, BackendTransactionPreview as nt, BackendDiagnosticOwner as o, GetCacheSnapshotInput as ot, ApplySessionTransactionInput as p, MaterializeValidationFailedError as pt, BackendRuntimeOptions as q, BACKEND_CONTRACT_VERSION as r, DisplayNodeFilter as rt, BackendDiagnosticRemediation as s, GetEventsInput as st, BACKEND_CAPABILITY_SCHEMA_VERSION as t, BackendTransactionEntityChange as tt, BackendStage as u, InProcessLockConflictError as ut, BACKEND_TRANSACTION_PREVIEW_LIMITS as v, ProjectRootNotAllowedError as vt, BackendCapabilityUnavailableError as w, ReadSessionStateInput as wt, BackendCacheSnapshot as x, QueryDisplayNodesInput as xt, BackendArtifactBridgeCapability as y, ProjectWriteTransactionError as yt, BackendProjectOutline as z, UamFidelityUnsupportedError as zt };
@@ -1,7 +1,7 @@
1
- import { UamComponentModel, UamComponentResource, UamComponentSelector, UamControllerModel, UamControllerSelector, UamDisplayNode, UamDisplayNodeKind, UamDisplayNodeSelector, UamGenericAssetResource, UamImageResource, UamMovieClipResource, UamPackage, UamPackageSelector, UamPackageSettings, UamProject, UamResource, UamResourceSelector, UamTransactionOperation, UamTransactionSupportIssueCode, UamTransitionModel, UamTransitionSelector } from "@openfairygui/core/uam";
2
- import { ApplyUamTransactionAppError } from "@openfairygui/functions/uam";
3
1
  import * as _$_openfairygui_core0 from "@openfairygui/core";
4
2
  import { ProjectDiagnosticCode, ProjectValidationReport } from "@openfairygui/core";
3
+ import { UamComponentModel, UamComponentResource, UamComponentSelector, UamControllerModel, UamControllerSelector, UamDisplayNode, UamDisplayNodeKind, UamDisplayNodeSelector, UamGenericAssetResource, UamImageResource, UamMovieClipResource, UamPackage, UamPackageSelector, UamPackageSettings, UamProject, UamResource, UamResourceSelector, UamTransactionOperation, UamTransactionSupportIssueCode, UamTransitionModel, UamTransitionSelector } from "@openfairygui/core/uam";
4
+ import { ApplyUamTransactionAppError } from "@openfairygui/functions/uam";
5
5
 
6
6
  //#region src/path-policy.d.ts
7
7
  interface PathPolicyViolationError {
@@ -13,7 +13,7 @@ interface PathPolicyViolationError {
13
13
  }
14
14
  //#endregion
15
15
  //#region src/runtime/capabilities.d.ts
16
- declare const BACKEND_METHODS: readonly ["getCapabilities", "openSession", "openProjectSession", "getSession", "getProjectOutline", "queryEntity", "readSessionState", "readResourceBytes", "validateSession", "preflightTransaction", "applyTransaction", "saveSession", "materializeSession", "closeSession", "getEvents", "getCacheSnapshot", "refreshCache"];
16
+ declare const BACKEND_METHODS: readonly ["getCapabilities", "openSession", "openProjectSession", "getSession", "getProjectOutline", "queryEntity", "queryDisplayNodes", "readSessionState", "readResourceBytes", "validateSession", "preflightTransaction", "applyTransaction", "saveSession", "materializeSession", "closeSession", "getEvents", "getCacheSnapshot", "refreshCache"];
17
17
  //#endregion
18
18
  //#region src/runtime/contracts.d.ts
19
19
  type BackendMethodName = keyof BackendRuntime;
@@ -22,6 +22,14 @@ declare const BACKEND_ENTITY_QUERY_LIMITS: {
22
22
  readonly maxDepth: 32;
23
23
  readonly maxNodes: 100000;
24
24
  };
25
+ declare const BACKEND_DISPLAY_NODE_QUERY_LIMITS: {
26
+ readonly maxBytes: 262144;
27
+ readonly maxDepth: 32;
28
+ readonly maxNodes: 100000;
29
+ readonly defaultLimit: 50;
30
+ readonly maxLimit: 200;
31
+ };
32
+ declare const BACKEND_DISPLAY_NODE_FILTER_FIELDS: readonly ["kind", "name", "nameContains", "text", "textContains", "title", "titleContains", "group", "resourceId", "url", "visible", "locked", "touchable", "hasGears", "hasRelations"];
25
33
  declare const BACKEND_SESSION_READ_LIMITS: {
26
34
  readonly model: {
27
35
  readonly maxBytes: 4194304;
@@ -47,7 +55,7 @@ interface ReadResourceBytesInput {
47
55
  expectedRevision: number;
48
56
  selector: UamResourceSelector;
49
57
  }
50
- interface BackendSessionStateSnapshot extends Pick<BackendSessionSnapshot, 'sessionId' | 'revision' | 'lastSavedRevision' | 'dirty' | 'uamFidelity'> {
58
+ interface BackendSessionStateSnapshot extends Pick<BackendSessionSnapshot, 'sessionId' | 'revision' | 'lastSavedRevision' | 'dirty' | 'uamFidelity' | 'uamFidelityReport'> {
51
59
  project: BackendSessionProjectModel;
52
60
  readDiagnostics: _$_openfairygui_core0.ProjectDiagnostic[];
53
61
  /** Source-read completeness, not a guarantee of resource bytes or downstream usability. */
@@ -146,6 +154,67 @@ interface EntityQueryError {
146
154
  sessionId: string;
147
155
  reason: 'invalid_query' | 'not_found' | 'ambiguous' | 'response_budget_exceeded' | 'non_json_value';
148
156
  }
157
+ interface DisplayNodeFilter {
158
+ kind?: UamDisplayNodeKind;
159
+ name?: string;
160
+ nameContains?: string;
161
+ text?: string;
162
+ textContains?: string;
163
+ title?: string;
164
+ titleContains?: string;
165
+ group?: string;
166
+ resourceId?: string;
167
+ url?: string;
168
+ visible?: boolean;
169
+ locked?: boolean;
170
+ touchable?: boolean;
171
+ hasGears?: boolean;
172
+ hasRelations?: boolean;
173
+ }
174
+ interface QueryDisplayNodesInput {
175
+ sessionId: string;
176
+ selector: UamComponentSelector;
177
+ filter?: DisplayNodeFilter;
178
+ /** Maximum candidate entries to return (default 50, max 200). */
179
+ limit?: number;
180
+ }
181
+ interface BackendDisplayNodeCandidate {
182
+ /** Exact display node ID to pass to queryEntity or mutation selectors. */
183
+ id: string;
184
+ name: string;
185
+ kind: UamDisplayNodeKind;
186
+ /** Zero-based index in the component's displayList. */
187
+ index: number;
188
+ position: {
189
+ x: number;
190
+ y: number;
191
+ };
192
+ size: {
193
+ width: number;
194
+ height: number;
195
+ };
196
+ visible: boolean;
197
+ locked: boolean;
198
+ touchable: boolean;
199
+ group?: string;
200
+ text?: string;
201
+ title?: string;
202
+ resource?: {
203
+ packageId?: string;
204
+ resourceId: string;
205
+ };
206
+ url?: string;
207
+ gearCount: number;
208
+ relationCount: number;
209
+ }
210
+ interface BackendDisplayNodeQueryResult {
211
+ sessionId: string;
212
+ revision: number;
213
+ selector: UamComponentSelector;
214
+ totalMatched: number;
215
+ truncated: boolean;
216
+ nodes: BackendDisplayNodeCandidate[];
217
+ }
149
218
  /** An exclusive lock owned for the lifetime of one backend session. */
150
219
  interface BackendSessionLock {
151
220
  /** Persist optional host metadata without changing lock ownership. */
@@ -261,6 +330,13 @@ interface BackendCapabilities {
261
330
  sourceBytes: false;
262
331
  limits: typeof BACKEND_ENTITY_QUERY_LIMITS;
263
332
  };
333
+ displayNodeQuery: {
334
+ scope: 'component';
335
+ filterFields: readonly (keyof DisplayNodeFilter)[];
336
+ projection: 'summary';
337
+ sourceBytes: false;
338
+ limits: typeof BACKEND_DISPLAY_NODE_QUERY_LIMITS;
339
+ };
264
340
  sessionState: {
265
341
  sourceBytes: false;
266
342
  limits: typeof BACKEND_SESSION_READ_LIMITS.model;
@@ -330,6 +406,30 @@ interface BackendCapabilities {
330
406
  };
331
407
  };
332
408
  }
409
+ type UamFidelityFailureReason = 'incomplete_read' | 'materialize_failed' | 'round_trip_mismatch';
410
+ interface UamFidelityDiffEntry {
411
+ /** Project-relative path of the differing file or directory. */
412
+ path: string;
413
+ kind: 'file' | 'directory';
414
+ change: 'missing' | 'extra' | 'modified' | 'type_mismatch';
415
+ /** First differing 1-based line number for text files. */
416
+ line?: number;
417
+ /** Bounded excerpt of the source writer line at `line`. */
418
+ sourceExcerpt?: string;
419
+ /** Bounded excerpt of the materialized writer line at `line`. */
420
+ materializedExcerpt?: string;
421
+ }
422
+ interface UamFidelityReport {
423
+ reason: UamFidelityFailureReason;
424
+ /** Bounded message when read failed completeness or materialization threw. */
425
+ errorMessage?: string;
426
+ /** Total number of differing files and directories detected before truncation. */
427
+ totalDiffCount: number;
428
+ /** Bounded list of detected differences, sorted deterministically by path and kind. */
429
+ diffs: UamFidelityDiffEntry[];
430
+ /** True when `diffs` was capped to stay within response bounds. */
431
+ truncated: boolean;
432
+ }
333
433
  interface BackendSessionSnapshot {
334
434
  sessionId: string;
335
435
  canonicalProjectPath: string;
@@ -337,6 +437,8 @@ interface BackendSessionSnapshot {
337
437
  lastSavedRevision: number;
338
438
  dirty: boolean;
339
439
  uamFidelity: 'full' | 'unsupported';
440
+ /** Present when `uamFidelity` is `unsupported` and a bounded failure report was captured. */
441
+ uamFidelityReport?: UamFidelityReport;
340
442
  lockHeld: boolean;
341
443
  capabilities: BackendCapabilities;
342
444
  }
@@ -466,6 +568,8 @@ interface UamFidelityUnsupportedError {
466
568
  message: string;
467
569
  sessionId: string;
468
570
  canonicalPathKey: string;
571
+ /** Bounded structured summary of why UAM fidelity is unsupported. */
572
+ fidelityReport?: UamFidelityReport;
469
573
  }
470
574
  interface MaterializeValidationFailedError {
471
575
  code: 'materialize_validation_failed';
@@ -680,6 +784,7 @@ declare class BackendRuntime {
680
784
  }): BackendResult<BackendSessionSnapshot, SessionNotFoundError>;
681
785
  getProjectOutline(input: GetProjectOutlineInput): BackendResult<BackendProjectOutline, SessionNotFoundError>;
682
786
  queryEntity(input: QueryEntityInput): BackendResult<BackendEntitySnapshot, SessionNotFoundError | EntityQueryError>;
787
+ queryDisplayNodes(input: QueryDisplayNodesInput): BackendResult<BackendDisplayNodeQueryResult, SessionNotFoundError | EntityQueryError>;
683
788
  readSessionState(input: ReadSessionStateInput): BackendResult<BackendSessionStateSnapshot, SessionNotFoundError | SessionReadError | SessionStaleReadError>;
684
789
  readResourceBytes(input: ReadResourceBytesInput): BackendResult<BackendResourceBytesSnapshot, SessionNotFoundError | SessionReadError | SessionStaleReadError>;
685
790
  validateSession(input: ValidateSessionInput): BackendResult<ProjectValidationReport, SessionNotFoundError>;
@@ -700,7 +805,7 @@ declare class BackendRuntime {
700
805
  //#endregion
701
806
  //#region src/contracts.d.ts
702
807
  declare const BACKEND_CONTRACT_VERSION: "3.0.0";
703
- declare const BACKEND_CAPABILITY_SCHEMA_VERSION: 15;
808
+ declare const BACKEND_CAPABILITY_SCHEMA_VERSION: 16;
704
809
  declare const BACKEND_COMPATIBILITY_POLICY: {
705
810
  readonly incompatibleChange: "requires contractVersion bump";
706
811
  readonly capabilitySchemaChange: "requires capabilitySchemaVersion bump";
@@ -753,4 +858,4 @@ interface BackendResponseMeta {
753
858
  capabilitySchemaVersion: typeof BACKEND_CAPABILITY_SCHEMA_VERSION;
754
859
  }
755
860
  //#endregion
756
- export { EntityQueryError as $, BackendFileStat as A, UamFidelityUnsupportedError as At, BackendResourceBytesSnapshot as B, BackendComponentSnapshot as C, SessionIdConflictError as Ct, BackendEvent as D, SessionStaleReadError as Dt, BackendError as E, SessionReadError as Et, BackendProjectOutline as F, BackendSessionPackageModel as G, BackendResult as H, BackendProjectOutlinePackage as I, BackendSessionSnapshot as J, BackendSessionProjectModel as K, BackendProjectOutlineResource as L, BackendHostAdapter as M, BackendMethodName as N, BackendEventKind as O, SessionStaleWriteError as Ot, BackendPackageSnapshot as P, BackendTransactionPreview as Q, BackendProjectSessionStorage as R, BackendCapabilityUnavailableError as S, SessionCloseFailedError as St, BackendEntityTarget as T, SessionNotFoundError as Tt, BackendRuntimeOptions as U, BackendResourceSnapshot as V, BackendSessionLock as W, BackendSuccess as X, BackendSessionStateSnapshot as Y, BackendTransactionEntityChange as Z, BackendArtifactBridgeCapability as _, ReadResourceBytesInput as _t, BackendDiagnosticCode as a, InProcessLockConflictError as at, BackendCapabilities as b, SavePartialFailureError as bt, BackendMessage as c, MaterializeValidationFailedError as ct, BackendRuntime as d, ProjectOpenFailedError as dt, EventCursorInvalidError as et, AdvisoryLockConflictError as f, ProjectOpenFailureReason as ft, BACKEND_TRANSACTION_PREVIEW_LIMITS as g, QueryEntityInput as gt, BACKEND_SESSION_READ_LIMITS as h, ProjectWriteTransactionResult as ht, BackendDiagnostic as i, GetProjectOutlineInput as it, BackendFileSystem as j, ValidateSessionInput as jt, BackendFailure as k, TransactionPreviewError as kt, BackendResponseMeta as l, MaterializeWriteFailedError as lt, BACKEND_ENTITY_QUERY_LIMITS as m, ProjectWriteTransactionError as mt, BACKEND_COMPATIBILITY_POLICY as n, GetEventsInput as nt, BackendDiagnosticOwner as o, MaterializeSessionInput as ot, ApplySessionTransactionInput as p, ProjectRootNotAllowedError as pt, BackendSessionResourceModel as q, BACKEND_CONTRACT_VERSION as r, GetEventsSnapshot as rt, BackendDiagnosticRemediation as s, MaterializeSessionSnapshot as st, BACKEND_CAPABILITY_SCHEMA_VERSION as t, GetCacheSnapshotInput as tt, BackendStage as u, OpenProjectSessionInput as ut, BackendCacheEntry as v, ReadSessionStateInput as vt, BackendEntitySnapshot as w, SessionLimitExceededError as wt, BackendCapabilityManifest as x, SaveSessionInput as xt, BackendCacheSnapshot as y, RefreshCacheInput as yt, BackendProjectSnapshot as z };
861
+ export { BackendSessionStateSnapshot as $, BackendError as A, SessionLimitExceededError as At, BackendProjectOutlinePackage as B, ValidateSessionInput as Bt, BackendCapabilityManifest as C, ReadResourceBytesInput as Ct, BackendDisplayNodeQueryResult as D, SaveSessionInput as Dt, BackendDisplayNodeCandidate as E, SavePartialFailureError as Et, BackendFileSystem as F, TransactionPreviewError as Ft, BackendResourceSnapshot as G, BackendProjectSessionStorage as H, BackendHostAdapter as I, UamFidelityDiffEntry as It, BackendSessionLock as J, BackendResult as K, BackendMethodName as L, UamFidelityFailureReason as Lt, BackendEventKind as M, SessionReadError as Mt, BackendFailure as N, SessionStaleReadError as Nt, BackendEntitySnapshot as O, SessionCloseFailedError as Ot, BackendFileStat as P, SessionStaleWriteError as Pt, BackendSessionSnapshot as Q, BackendPackageSnapshot as R, UamFidelityReport as Rt, BackendCapabilities as S, QueryEntityInput as St, BackendComponentSnapshot as T, RefreshCacheInput as Tt, BackendProjectSnapshot as U, BackendProjectOutlineResource as V, BackendResourceBytesSnapshot as W, BackendSessionProjectModel as X, BackendSessionPackageModel as Y, BackendSessionResourceModel as Z, BACKEND_SESSION_READ_LIMITS as _, ProjectOpenFailureReason as _t, BackendDiagnosticCode as a, EventCursorInvalidError as at, BackendCacheEntry as b, ProjectWriteTransactionResult as bt, BackendMessage as c, GetEventsSnapshot as ct, BackendRuntime as d, MaterializeSessionInput as dt, BackendSuccess as et, AdvisoryLockConflictError as f, MaterializeSessionSnapshot as ft, BACKEND_ENTITY_QUERY_LIMITS as g, ProjectOpenFailedError as gt, BACKEND_DISPLAY_NODE_QUERY_LIMITS as h, OpenProjectSessionInput as ht, BackendDiagnostic as i, EntityQueryError as it, BackendEvent as j, SessionNotFoundError as jt, BackendEntityTarget as k, SessionIdConflictError as kt, BackendResponseMeta as l, GetProjectOutlineInput as lt, BACKEND_DISPLAY_NODE_FILTER_FIELDS as m, MaterializeWriteFailedError as mt, BACKEND_COMPATIBILITY_POLICY as n, BackendTransactionPreview as nt, BackendDiagnosticOwner as o, GetCacheSnapshotInput as ot, ApplySessionTransactionInput as p, MaterializeValidationFailedError as pt, BackendRuntimeOptions as q, BACKEND_CONTRACT_VERSION as r, DisplayNodeFilter as rt, BackendDiagnosticRemediation as s, GetEventsInput as st, BACKEND_CAPABILITY_SCHEMA_VERSION as t, BackendTransactionEntityChange as tt, BackendStage as u, InProcessLockConflictError as ut, BACKEND_TRANSACTION_PREVIEW_LIMITS as v, ProjectRootNotAllowedError as vt, BackendCapabilityUnavailableError as w, ReadSessionStateInput as wt, BackendCacheSnapshot as x, QueryDisplayNodesInput as xt, BackendArtifactBridgeCapability as y, ProjectWriteTransactionError as yt, BackendProjectOutline as z, UamFidelityUnsupportedError as zt };
@@ -1,4 +1,4 @@
1
- import { a as BackendDiagnosticCode, o as BackendDiagnosticOwner, s as BackendDiagnosticRemediation } from "./contracts-Bx8HUr7I.cjs";
1
+ import { a as BackendDiagnosticCode, o as BackendDiagnosticOwner, s as BackendDiagnosticRemediation } from "./contracts-DqyJSFJe.cjs";
2
2
 
3
3
  //#region src/diagnostics.d.ts
4
4
  /** Shared codes list all canonical owners; responses preserve the actual reporting owner. */
@@ -799,7 +799,7 @@ declare function getBackendDiagnosticCatalog(): ({
799
799
  owners: readonly ["backend"];
800
800
  remediation: {
801
801
  readonly kind: "host-action";
802
- readonly message: "Read capability/error details. Ask the host to provide the required filesystem, decoder or complete UAM adapter. Preserve the session and unsaved work; do not substitute a lossy path or bypass checks.";
802
+ readonly message: "Inspect uamFidelityReport on the session snapshot or error.fidelityReport and meta.diagnostics for the failure reason and differing project paths. Preserve the session and unsaved work; do not substitute a lossy save path or bypass fidelity checks.";
803
803
  };
804
804
  } | {
805
805
  docsUri: string;
@@ -1632,7 +1632,7 @@ declare function getBackendDiagnosticGuide(code: string): {
1632
1632
  owners: readonly ["backend"];
1633
1633
  remediation: {
1634
1634
  readonly kind: "host-action";
1635
- readonly message: "Read capability/error details. Ask the host to provide the required filesystem, decoder or complete UAM adapter. Preserve the session and unsaved work; do not substitute a lossy path or bypass checks.";
1635
+ readonly message: "Inspect uamFidelityReport on the session snapshot or error.fidelityReport and meta.diagnostics for the failure reason and differing project paths. Preserve the session and unsaved work; do not substitute a lossy save path or bypass fidelity checks.";
1636
1636
  };
1637
1637
  } | {
1638
1638
  docsUri: string;
@@ -577,7 +577,10 @@ const BACKEND_DIAGNOSTIC_GUIDES = [
577
577
  {
578
578
  code: "uam_fidelity_unsupported",
579
579
  owners: ["backend"],
580
- remediation: capability
580
+ remediation: {
581
+ kind: "host-action",
582
+ message: "Inspect uamFidelityReport on the session snapshot or error.fidelityReport and meta.diagnostics for the failure reason and differing project paths. Preserve the session and unsaved work; do not substitute a lossy save path or bypass fidelity checks."
583
+ }
581
584
  },
582
585
  {
583
586
  code: "save_partial_failure",
@@ -577,7 +577,10 @@ const BACKEND_DIAGNOSTIC_GUIDES = [
577
577
  {
578
578
  code: "uam_fidelity_unsupported",
579
579
  owners: ["backend"],
580
- remediation: capability
580
+ remediation: {
581
+ kind: "host-action",
582
+ message: "Inspect uamFidelityReport on the session snapshot or error.fidelityReport and meta.diagnostics for the failure reason and differing project paths. Preserve the session and unsaved work; do not substitute a lossy save path or bypass fidelity checks."
583
+ }
581
584
  },
582
585
  {
583
586
  code: "save_partial_failure",
@@ -1,4 +1,4 @@
1
- import { a as BackendDiagnosticCode, o as BackendDiagnosticOwner, s as BackendDiagnosticRemediation } from "./contracts-CMQiPEyz.mjs";
1
+ import { a as BackendDiagnosticCode, o as BackendDiagnosticOwner, s as BackendDiagnosticRemediation } from "./contracts-C5wBGvC6.mjs";
2
2
 
3
3
  //#region src/diagnostics.d.ts
4
4
  /** Shared codes list all canonical owners; responses preserve the actual reporting owner. */
@@ -799,7 +799,7 @@ declare function getBackendDiagnosticCatalog(): ({
799
799
  owners: readonly ["backend"];
800
800
  remediation: {
801
801
  readonly kind: "host-action";
802
- readonly message: "Read capability/error details. Ask the host to provide the required filesystem, decoder or complete UAM adapter. Preserve the session and unsaved work; do not substitute a lossy path or bypass checks.";
802
+ readonly message: "Inspect uamFidelityReport on the session snapshot or error.fidelityReport and meta.diagnostics for the failure reason and differing project paths. Preserve the session and unsaved work; do not substitute a lossy save path or bypass fidelity checks.";
803
803
  };
804
804
  } | {
805
805
  docsUri: string;
@@ -1632,7 +1632,7 @@ declare function getBackendDiagnosticGuide(code: string): {
1632
1632
  owners: readonly ["backend"];
1633
1633
  remediation: {
1634
1634
  readonly kind: "host-action";
1635
- readonly message: "Read capability/error details. Ask the host to provide the required filesystem, decoder or complete UAM adapter. Preserve the session and unsaved work; do not substitute a lossy path or bypass checks.";
1635
+ readonly message: "Inspect uamFidelityReport on the session snapshot or error.fidelityReport and meta.diagnostics for the failure reason and differing project paths. Preserve the session and unsaved work; do not substitute a lossy save path or bypass fidelity checks.";
1636
1636
  };
1637
1637
  } | {
1638
1638
  docsUri: string;