@openfairygui/backend 0.6.3 → 0.7.1

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.
Files changed (48) hide show
  1. package/dist/contracts-Bx8HUr7I.d.cts +756 -0
  2. package/dist/contracts-CMQiPEyz.d.mts +756 -0
  3. package/dist/diagnostics-CIe7S-RW.cjs +670 -0
  4. package/dist/diagnostics-CZ12H1Mx.d.cts +1679 -0
  5. package/dist/diagnostics-CpJ8cAP6.d.mts +1679 -0
  6. package/dist/diagnostics-DTnLXQGs.mjs +641 -0
  7. package/dist/docs.cjs +11530 -5940
  8. package/dist/docs.d.cts +5 -185
  9. package/dist/docs.d.mts +5 -185
  10. package/dist/docs.mjs +11528 -5939
  11. package/dist/index.cjs +16 -2703
  12. package/dist/index.d.cts +5 -2362
  13. package/dist/index.d.mts +5 -2362
  14. package/dist/index.mjs +4 -2691
  15. package/dist/node.cjs +367 -2779
  16. package/dist/node.d.cts +4 -724
  17. package/dist/node.d.mts +4 -724
  18. package/dist/node.mjs +359 -2751
  19. package/dist/rolldown-runtime-BJqNVkSG.cjs +28 -0
  20. package/dist/runtime-DYqG77ak.cjs +2249 -0
  21. package/dist/runtime-gStewf1p.mjs +2189 -0
  22. package/package.json +4 -5
  23. package/src/contracts.ts +0 -58
  24. package/src/diagnostics.ts +0 -188
  25. package/src/docs.ts +0 -109
  26. package/src/generated/contracts.ts +0 -24207
  27. package/src/generated/docs.ts +0 -12
  28. package/src/index.ts +0 -99
  29. package/src/node.ts +0 -317
  30. package/src/path-policy.ts +0 -123
  31. package/src/runtime/capabilities.ts +0 -131
  32. package/src/runtime/contracts.ts +0 -672
  33. package/src/runtime.ts +0 -231
  34. package/src/services/artifact-service.ts +0 -19
  35. package/src/services/authoring-service.ts +0 -229
  36. package/src/services/cache-service.ts +0 -81
  37. package/src/services/capture-project.ts +0 -75
  38. package/src/services/context.ts +0 -150
  39. package/src/services/event-service.ts +0 -86
  40. package/src/services/persistence-service.ts +0 -550
  41. package/src/services/read-service.ts +0 -274
  42. package/src/services/runtime-service.ts +0 -342
  43. package/src/services/session-operation-queue.ts +0 -21
  44. package/src/services/session-project-writer.ts +0 -89
  45. package/src/services/session-registry.ts +0 -70
  46. package/src/services/session-utils.ts +0 -45
  47. package/src/services/transaction-preview.ts +0 -116
  48. package/src/storage.ts +0 -232
package/dist/docs.d.cts CHANGED
@@ -1,188 +1,5 @@
1
- import { ProjectDiagnosticCode } from "@openfairygui/core";
2
- import { UamTransactionSupportIssueCode } from "@openfairygui/core/uam";
3
- import { ApplyUamTransactionAppError } from "@openfairygui/functions/uam";
1
+ import { r as BackendDiagnosticGuide } from "./diagnostics-CZ12H1Mx.cjs";
4
2
 
5
- //#region src/path-policy.d.ts
6
- interface PathPolicyViolationError {
7
- code: 'path_policy_violation';
8
- message: string;
9
- policy: 'save_target';
10
- attemptedPath: string;
11
- allowedPath: string;
12
- }
13
- //#endregion
14
- //#region src/runtime/contracts.d.ts
15
- interface SessionReadError {
16
- code: 'session_read_failed';
17
- message: string;
18
- sessionId: string;
19
- reason: 'invalid_query' | 'not_found' | 'ambiguous' | 'unsupported_resource' | 'bytes_unavailable' | 'response_budget_exceeded' | 'non_json_value';
20
- }
21
- interface SessionStaleReadError {
22
- code: 'stale_read';
23
- message: string;
24
- sessionId: string;
25
- expectedRevision: number;
26
- actualRevision: number;
27
- }
28
- interface EntityQueryError {
29
- code: 'entity_query_failed';
30
- message: string;
31
- sessionId: string;
32
- reason: 'invalid_query' | 'not_found' | 'ambiguous' | 'response_budget_exceeded' | 'non_json_value';
33
- }
34
- interface SessionNotFoundError {
35
- code: 'session_not_found';
36
- message: string;
37
- sessionId: string;
38
- }
39
- interface SessionCloseFailedError {
40
- code: 'session_close_failed';
41
- message: string;
42
- sessionId: string;
43
- lockFilePath: string;
44
- }
45
- interface SessionStaleWriteError {
46
- code: 'stale_write';
47
- message: string;
48
- sessionId: string;
49
- canonicalPathKey: string;
50
- expectedRevision: number;
51
- actualRevision: number;
52
- }
53
- interface InProcessLockConflictError {
54
- code: 'lock_conflict';
55
- kind: 'in_process_session_exists';
56
- message: string;
57
- canonicalPathKey: string;
58
- holderSessionId: string;
59
- lockFilePath?: string;
60
- }
61
- interface AdvisoryLockConflictError {
62
- code: 'lock_conflict';
63
- kind: 'advisory_lock_conflict';
64
- message: string;
65
- canonicalPathKey: string;
66
- holderSessionId?: string;
67
- lockFilePath: string;
68
- }
69
- interface SessionIdConflictError {
70
- code: 'session_id_conflict';
71
- message: string;
72
- sessionId: string;
73
- }
74
- interface SavePartialFailureError {
75
- code: 'save_partial_failure';
76
- message: string;
77
- sessionId: string;
78
- canonicalPathKey: string;
79
- attemptedRevision: number;
80
- lastSavedRevision: number;
81
- committedPaths: string[];
82
- failedPaths: string[];
83
- diskMayBePartiallyUpdated: boolean;
84
- recoveryPaths?: string[];
85
- }
86
- interface UamFidelityUnsupportedError {
87
- code: 'uam_fidelity_unsupported';
88
- message: string;
89
- sessionId: string;
90
- canonicalPathKey: string;
91
- }
92
- interface MaterializeValidationFailedError {
93
- code: 'materialize_validation_failed';
94
- message: string;
95
- sessionId: string;
96
- canonicalPathKey: string;
97
- issueCount: number;
98
- diagnostics: BackendDiagnostic[];
99
- }
100
- interface MaterializeWriteFailedError {
101
- code: 'write_failed';
102
- message: string;
103
- sessionId: string;
104
- canonicalPathKey: string;
105
- attemptedRevision: number;
106
- lastSavedRevision: number;
107
- writtenPaths: string[];
108
- failedPaths: string[];
109
- skippedPaths: string[];
110
- diagnostics: BackendDiagnostic[];
111
- diskMayBePartiallyUpdated: boolean;
112
- recoveryPaths?: string[];
113
- }
114
- interface EventCursorInvalidError {
115
- code: 'event_cursor_invalid';
116
- message: string;
117
- sessionId: string;
118
- after: string;
119
- }
120
- interface BackendCapabilityUnavailableError {
121
- code: 'capability_unavailable';
122
- message: string;
123
- capability: 'fileSystem' | 'artifact.publish' | 'artifact.restore';
124
- requiredAdapter?: 'BackendFileSystem';
125
- requiredHost?: 'node';
126
- bridgeBoundary?: 'external-bridge';
127
- }
128
- type BackendError = SessionNotFoundError | SessionCloseFailedError | TransactionPreviewError | EntityQueryError | SessionReadError | SessionStaleReadError | SessionIdConflictError | SessionStaleWriteError | InProcessLockConflictError | AdvisoryLockConflictError | SavePartialFailureError | UamFidelityUnsupportedError | MaterializeValidationFailedError | MaterializeWriteFailedError | PathPolicyViolationError | EventCursorInvalidError | BackendCapabilityUnavailableError | ProjectRootNotAllowedError | ProjectOpenFailedError | ApplyUamTransactionAppError;
129
- interface ProjectRootNotAllowedError {
130
- code: 'project_root_not_allowed';
131
- message: string;
132
- projectPath: string;
133
- }
134
- interface ProjectOpenFailedError {
135
- code: 'project_open_failed';
136
- message: string;
137
- projectPath: string;
138
- }
139
- interface TransactionPreviewError {
140
- code: 'transaction_preview_failed';
141
- message: string;
142
- sessionId: string;
143
- reason: 'response_budget_exceeded' | 'projection_failed';
144
- }
145
- //#endregion
146
- //#region src/contracts.d.ts
147
- type BackendDiagnosticCode = BackendError['code'] | UamTransactionSupportIssueCode | ProjectDiagnosticCode;
148
- type BackendDiagnosticOwner = 'backend' | 'core.transaction' | 'core.validation';
149
- interface BackendDiagnostic {
150
- code: BackendDiagnosticCode;
151
- message: string;
152
- severity: 'info' | 'warning' | 'error';
153
- path?: string;
154
- nodeKind?: string;
155
- resourceKind?: string;
156
- gearKind?: string;
157
- field?: string;
158
- operationKind?: string;
159
- opIndex?: number;
160
- opId?: string;
161
- /** Present for catalogued diagnostics only; original codes and classification are preserved. */
162
- owner?: BackendDiagnosticOwner;
163
- docsUri?: string;
164
- remediation?: BackendDiagnosticRemediation;
165
- }
166
- interface BackendDiagnosticRemediation {
167
- kind: 'refresh-and-replan' | 'revise-selector' | 'revise-operation' | 'host-action';
168
- message: string;
169
- /** A read-only starting point, never permission to retry or mutate. */
170
- read?: {
171
- method: 'getProjectOutline';
172
- input: {
173
- sessionId: string;
174
- };
175
- };
176
- }
177
- //#endregion
178
- //#region src/diagnostics.d.ts
179
- /** Shared codes list all canonical owners; responses preserve the actual reporting owner. */
180
- interface BackendDiagnosticGuide {
181
- code: BackendDiagnosticCode;
182
- owners: readonly BackendDiagnosticOwner[];
183
- remediation: Omit<BackendDiagnosticRemediation, 'read'>;
184
- }
185
- //#endregion
186
3
  //#region src/docs.d.ts
187
4
  /** JSON Schema data, not another validator or operation grammar. */
188
5
  interface ContractSchema {
@@ -201,6 +18,7 @@ interface ContractSnapshot {
201
18
  input: ContractSchema;
202
19
  output: ContractSchema;
203
20
  bytePaths: string[][];
21
+ outputBytePaths: string[][];
204
22
  [metadata: string]: unknown;
205
23
  }>;
206
24
  cli: Record<string, ContractSchema>;
@@ -208,6 +26,8 @@ interface ContractSnapshot {
208
26
  diagnostics: BackendDiagnosticGuide[];
209
27
  }
210
28
  declare const OPENFAIRYGUI_DOCS_INDEX_URI = "openfairygui://docs/index";
29
+ /** Decode only generated native-byte paths in JSON transport inputs, preserving extension JSON. */
30
+ declare function decodeContractBytes(input: Record<string, unknown>, paths: string[][]): Record<string, unknown>;
211
31
  declare const OPENFAIRYGUI_OPERATION_CATALOG_URI = "openfairygui://contracts/operations";
212
32
  declare const OPENFAIRYGUI_OPERATION_SCHEMA_TEMPLATE = "openfairygui://contracts/operations/{kind}";
213
33
  /** Detached copy for wire adapters; documentation and adapters share one generated snapshot. */
@@ -276,4 +96,4 @@ declare function findInstalledDocumentation(query: string): {
276
96
  documentationDigest: string;
277
97
  };
278
98
  //#endregion
279
- export { ContractSchema, ContractSnapshot, OPENFAIRYGUI_DOCS_INDEX_URI, OPENFAIRYGUI_OPERATION_CATALOG_URI, OPENFAIRYGUI_OPERATION_SCHEMA_TEMPLATE, findInstalledDocumentation, getInstalledContractSnapshot, getInstalledDocumentationIndex, getInstalledDocumentationVersion, getOpenFairyGuiOperationCatalog, getOpenFairyGuiOperationSchema, readInstalledDocumentation };
99
+ export { ContractSchema, ContractSnapshot, OPENFAIRYGUI_DOCS_INDEX_URI, OPENFAIRYGUI_OPERATION_CATALOG_URI, OPENFAIRYGUI_OPERATION_SCHEMA_TEMPLATE, decodeContractBytes, findInstalledDocumentation, getInstalledContractSnapshot, getInstalledDocumentationIndex, getInstalledDocumentationVersion, getOpenFairyGuiOperationCatalog, getOpenFairyGuiOperationSchema, readInstalledDocumentation };
package/dist/docs.d.mts CHANGED
@@ -1,188 +1,5 @@
1
- import { ProjectDiagnosticCode } from "@openfairygui/core";
2
- import { UamTransactionSupportIssueCode } from "@openfairygui/core/uam";
3
- import { ApplyUamTransactionAppError } from "@openfairygui/functions/uam";
1
+ import { r as BackendDiagnosticGuide } from "./diagnostics-CpJ8cAP6.mjs";
4
2
 
5
- //#region src/path-policy.d.ts
6
- interface PathPolicyViolationError {
7
- code: 'path_policy_violation';
8
- message: string;
9
- policy: 'save_target';
10
- attemptedPath: string;
11
- allowedPath: string;
12
- }
13
- //#endregion
14
- //#region src/runtime/contracts.d.ts
15
- interface SessionReadError {
16
- code: 'session_read_failed';
17
- message: string;
18
- sessionId: string;
19
- reason: 'invalid_query' | 'not_found' | 'ambiguous' | 'unsupported_resource' | 'bytes_unavailable' | 'response_budget_exceeded' | 'non_json_value';
20
- }
21
- interface SessionStaleReadError {
22
- code: 'stale_read';
23
- message: string;
24
- sessionId: string;
25
- expectedRevision: number;
26
- actualRevision: number;
27
- }
28
- interface EntityQueryError {
29
- code: 'entity_query_failed';
30
- message: string;
31
- sessionId: string;
32
- reason: 'invalid_query' | 'not_found' | 'ambiguous' | 'response_budget_exceeded' | 'non_json_value';
33
- }
34
- interface SessionNotFoundError {
35
- code: 'session_not_found';
36
- message: string;
37
- sessionId: string;
38
- }
39
- interface SessionCloseFailedError {
40
- code: 'session_close_failed';
41
- message: string;
42
- sessionId: string;
43
- lockFilePath: string;
44
- }
45
- interface SessionStaleWriteError {
46
- code: 'stale_write';
47
- message: string;
48
- sessionId: string;
49
- canonicalPathKey: string;
50
- expectedRevision: number;
51
- actualRevision: number;
52
- }
53
- interface InProcessLockConflictError {
54
- code: 'lock_conflict';
55
- kind: 'in_process_session_exists';
56
- message: string;
57
- canonicalPathKey: string;
58
- holderSessionId: string;
59
- lockFilePath?: string;
60
- }
61
- interface AdvisoryLockConflictError {
62
- code: 'lock_conflict';
63
- kind: 'advisory_lock_conflict';
64
- message: string;
65
- canonicalPathKey: string;
66
- holderSessionId?: string;
67
- lockFilePath: string;
68
- }
69
- interface SessionIdConflictError {
70
- code: 'session_id_conflict';
71
- message: string;
72
- sessionId: string;
73
- }
74
- interface SavePartialFailureError {
75
- code: 'save_partial_failure';
76
- message: string;
77
- sessionId: string;
78
- canonicalPathKey: string;
79
- attemptedRevision: number;
80
- lastSavedRevision: number;
81
- committedPaths: string[];
82
- failedPaths: string[];
83
- diskMayBePartiallyUpdated: boolean;
84
- recoveryPaths?: string[];
85
- }
86
- interface UamFidelityUnsupportedError {
87
- code: 'uam_fidelity_unsupported';
88
- message: string;
89
- sessionId: string;
90
- canonicalPathKey: string;
91
- }
92
- interface MaterializeValidationFailedError {
93
- code: 'materialize_validation_failed';
94
- message: string;
95
- sessionId: string;
96
- canonicalPathKey: string;
97
- issueCount: number;
98
- diagnostics: BackendDiagnostic[];
99
- }
100
- interface MaterializeWriteFailedError {
101
- code: 'write_failed';
102
- message: string;
103
- sessionId: string;
104
- canonicalPathKey: string;
105
- attemptedRevision: number;
106
- lastSavedRevision: number;
107
- writtenPaths: string[];
108
- failedPaths: string[];
109
- skippedPaths: string[];
110
- diagnostics: BackendDiagnostic[];
111
- diskMayBePartiallyUpdated: boolean;
112
- recoveryPaths?: string[];
113
- }
114
- interface EventCursorInvalidError {
115
- code: 'event_cursor_invalid';
116
- message: string;
117
- sessionId: string;
118
- after: string;
119
- }
120
- interface BackendCapabilityUnavailableError {
121
- code: 'capability_unavailable';
122
- message: string;
123
- capability: 'fileSystem' | 'artifact.publish' | 'artifact.restore';
124
- requiredAdapter?: 'BackendFileSystem';
125
- requiredHost?: 'node';
126
- bridgeBoundary?: 'external-bridge';
127
- }
128
- type BackendError = SessionNotFoundError | SessionCloseFailedError | TransactionPreviewError | EntityQueryError | SessionReadError | SessionStaleReadError | SessionIdConflictError | SessionStaleWriteError | InProcessLockConflictError | AdvisoryLockConflictError | SavePartialFailureError | UamFidelityUnsupportedError | MaterializeValidationFailedError | MaterializeWriteFailedError | PathPolicyViolationError | EventCursorInvalidError | BackendCapabilityUnavailableError | ProjectRootNotAllowedError | ProjectOpenFailedError | ApplyUamTransactionAppError;
129
- interface ProjectRootNotAllowedError {
130
- code: 'project_root_not_allowed';
131
- message: string;
132
- projectPath: string;
133
- }
134
- interface ProjectOpenFailedError {
135
- code: 'project_open_failed';
136
- message: string;
137
- projectPath: string;
138
- }
139
- interface TransactionPreviewError {
140
- code: 'transaction_preview_failed';
141
- message: string;
142
- sessionId: string;
143
- reason: 'response_budget_exceeded' | 'projection_failed';
144
- }
145
- //#endregion
146
- //#region src/contracts.d.ts
147
- type BackendDiagnosticCode = BackendError['code'] | UamTransactionSupportIssueCode | ProjectDiagnosticCode;
148
- type BackendDiagnosticOwner = 'backend' | 'core.transaction' | 'core.validation';
149
- interface BackendDiagnostic {
150
- code: BackendDiagnosticCode;
151
- message: string;
152
- severity: 'info' | 'warning' | 'error';
153
- path?: string;
154
- nodeKind?: string;
155
- resourceKind?: string;
156
- gearKind?: string;
157
- field?: string;
158
- operationKind?: string;
159
- opIndex?: number;
160
- opId?: string;
161
- /** Present for catalogued diagnostics only; original codes and classification are preserved. */
162
- owner?: BackendDiagnosticOwner;
163
- docsUri?: string;
164
- remediation?: BackendDiagnosticRemediation;
165
- }
166
- interface BackendDiagnosticRemediation {
167
- kind: 'refresh-and-replan' | 'revise-selector' | 'revise-operation' | 'host-action';
168
- message: string;
169
- /** A read-only starting point, never permission to retry or mutate. */
170
- read?: {
171
- method: 'getProjectOutline';
172
- input: {
173
- sessionId: string;
174
- };
175
- };
176
- }
177
- //#endregion
178
- //#region src/diagnostics.d.ts
179
- /** Shared codes list all canonical owners; responses preserve the actual reporting owner. */
180
- interface BackendDiagnosticGuide {
181
- code: BackendDiagnosticCode;
182
- owners: readonly BackendDiagnosticOwner[];
183
- remediation: Omit<BackendDiagnosticRemediation, 'read'>;
184
- }
185
- //#endregion
186
3
  //#region src/docs.d.ts
187
4
  /** JSON Schema data, not another validator or operation grammar. */
188
5
  interface ContractSchema {
@@ -201,6 +18,7 @@ interface ContractSnapshot {
201
18
  input: ContractSchema;
202
19
  output: ContractSchema;
203
20
  bytePaths: string[][];
21
+ outputBytePaths: string[][];
204
22
  [metadata: string]: unknown;
205
23
  }>;
206
24
  cli: Record<string, ContractSchema>;
@@ -208,6 +26,8 @@ interface ContractSnapshot {
208
26
  diagnostics: BackendDiagnosticGuide[];
209
27
  }
210
28
  declare const OPENFAIRYGUI_DOCS_INDEX_URI = "openfairygui://docs/index";
29
+ /** Decode only generated native-byte paths in JSON transport inputs, preserving extension JSON. */
30
+ declare function decodeContractBytes(input: Record<string, unknown>, paths: string[][]): Record<string, unknown>;
211
31
  declare const OPENFAIRYGUI_OPERATION_CATALOG_URI = "openfairygui://contracts/operations";
212
32
  declare const OPENFAIRYGUI_OPERATION_SCHEMA_TEMPLATE = "openfairygui://contracts/operations/{kind}";
213
33
  /** Detached copy for wire adapters; documentation and adapters share one generated snapshot. */
@@ -276,4 +96,4 @@ declare function findInstalledDocumentation(query: string): {
276
96
  documentationDigest: string;
277
97
  };
278
98
  //#endregion
279
- export { ContractSchema, ContractSnapshot, OPENFAIRYGUI_DOCS_INDEX_URI, OPENFAIRYGUI_OPERATION_CATALOG_URI, OPENFAIRYGUI_OPERATION_SCHEMA_TEMPLATE, findInstalledDocumentation, getInstalledContractSnapshot, getInstalledDocumentationIndex, getInstalledDocumentationVersion, getOpenFairyGuiOperationCatalog, getOpenFairyGuiOperationSchema, readInstalledDocumentation };
99
+ export { ContractSchema, ContractSnapshot, OPENFAIRYGUI_DOCS_INDEX_URI, OPENFAIRYGUI_OPERATION_CATALOG_URI, OPENFAIRYGUI_OPERATION_SCHEMA_TEMPLATE, decodeContractBytes, findInstalledDocumentation, getInstalledContractSnapshot, getInstalledDocumentationIndex, getInstalledDocumentationVersion, getOpenFairyGuiOperationCatalog, getOpenFairyGuiOperationSchema, readInstalledDocumentation };