@openfairygui/backend 0.4.0 → 0.5.0-alpha.2
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 +1 -0
- package/dist/docs.cjs +4776 -845
- package/dist/docs.d.cts +14 -1
- package/dist/docs.d.mts +14 -1
- package/dist/docs.mjs +4776 -845
- package/dist/index.cjs +137 -10
- package/dist/index.d.cts +100 -5
- package/dist/index.d.mts +100 -5
- package/dist/index.mjs +137 -11
- package/dist/node.cjs +135 -9
- package/dist/node.d.cts +67 -4
- package/dist/node.d.mts +67 -4
- package/dist/node.mjs +135 -9
- package/docs/workflow.md +10 -0
- package/package.json +3 -3
- package/src/contracts.ts +1 -1
- package/src/diagnostics.ts +8 -0
- package/src/generated/contracts.ts +8588 -1733
- package/src/generated/docs.ts +3 -3
- package/src/index.ts +10 -0
- package/src/runtime/capabilities.ts +5 -1
- package/src/runtime/contracts.ts +54 -0
- package/src/runtime.ts +14 -0
- package/src/services/read-service.ts +80 -8
package/dist/index.cjs
CHANGED
|
@@ -5,7 +5,7 @@ let _openfairygui_core_project_io = require("@openfairygui/core/project-io");
|
|
|
5
5
|
let _openfairygui_functions = require("@openfairygui/functions");
|
|
6
6
|
//#region src/contracts.ts
|
|
7
7
|
const BACKEND_CONTRACT_VERSION = "2.0.0-p2";
|
|
8
|
-
const BACKEND_CAPABILITY_SCHEMA_VERSION =
|
|
8
|
+
const BACKEND_CAPABILITY_SCHEMA_VERSION = 11;
|
|
9
9
|
const BACKEND_COMPATIBILITY_POLICY = {
|
|
10
10
|
incompatibleChange: "requires contractVersion bump",
|
|
11
11
|
capabilitySchemaChange: "requires capabilitySchemaVersion bump",
|
|
@@ -67,6 +67,22 @@ const job = {
|
|
|
67
67
|
};
|
|
68
68
|
/** Exhaustiveness and exact ownership are checked against the canonical unions. */
|
|
69
69
|
const BACKEND_DIAGNOSTIC_GUIDES = [
|
|
70
|
+
{
|
|
71
|
+
code: "stale_read",
|
|
72
|
+
owners: ["backend"],
|
|
73
|
+
remediation: {
|
|
74
|
+
kind: "refresh-and-replan",
|
|
75
|
+
message: "Discard the incomplete model/bytes read and restart with readSessionState. Use its revision for every readResourceBytes call. No historical state is retained or reserved; do not combine resources from different edit revisions."
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
code: "session_read_failed",
|
|
80
|
+
owners: ["backend"],
|
|
81
|
+
remediation: {
|
|
82
|
+
kind: "host-action",
|
|
83
|
+
message: "Inspect error.reason: invalid_query requires valid inputs; not_found/ambiguous requires exact current resource identifiers; unsupported_resource/bytes_unavailable means primary bytes cannot be read from this session. Budget or non-JSON failures require host inspection. Preserve unsaved work; do not save, reopen, repair or mutate the model merely to obtain a read."
|
|
84
|
+
}
|
|
85
|
+
},
|
|
70
86
|
{
|
|
71
87
|
code: "transaction_preview_failed",
|
|
72
88
|
owners: ["backend"],
|
|
@@ -728,7 +744,7 @@ function createMeta(stage, startedAt, options) {
|
|
|
728
744
|
diagnostics: (options?.diagnostics ?? []).map((entry) => enrichBackendDiagnostic(entry, options?.sessionId)),
|
|
729
745
|
stage,
|
|
730
746
|
contractVersion: BACKEND_CONTRACT_VERSION,
|
|
731
|
-
capabilitySchemaVersion:
|
|
747
|
+
capabilitySchemaVersion: 11
|
|
732
748
|
};
|
|
733
749
|
}
|
|
734
750
|
function success(stage, startedAt, data, options) {
|
|
@@ -850,6 +866,14 @@ const BACKEND_ENTITY_QUERY_LIMITS = {
|
|
|
850
866
|
maxDepth: 32,
|
|
851
867
|
maxNodes: 1e5
|
|
852
868
|
};
|
|
869
|
+
const BACKEND_SESSION_READ_LIMITS = {
|
|
870
|
+
model: {
|
|
871
|
+
maxBytes: 4194304,
|
|
872
|
+
maxDepth: 64,
|
|
873
|
+
maxNodes: 5e5
|
|
874
|
+
},
|
|
875
|
+
resourceBytes: 1048576
|
|
876
|
+
};
|
|
853
877
|
const BACKEND_TRANSACTION_PREVIEW_LIMITS = {
|
|
854
878
|
maxBytes: 262144,
|
|
855
879
|
maxEntries: 2e3
|
|
@@ -1996,7 +2020,7 @@ var JobService = class {
|
|
|
1996
2020
|
//#endregion
|
|
1997
2021
|
//#region src/services/read-service.ts
|
|
1998
2022
|
/** Bound traversal before serialization or cloning, including non-JSON values on a malformed native input. */
|
|
1999
|
-
function queryResponseProblem(value) {
|
|
2023
|
+
function queryResponseProblem(value, limits = BACKEND_ENTITY_QUERY_LIMITS) {
|
|
2000
2024
|
const pending = [{
|
|
2001
2025
|
value,
|
|
2002
2026
|
depth: 0
|
|
@@ -2005,26 +2029,37 @@ function queryResponseProblem(value) {
|
|
|
2005
2029
|
let stringUnits = 0;
|
|
2006
2030
|
while (pending.length) {
|
|
2007
2031
|
const { value, depth } = pending.pop();
|
|
2008
|
-
if (++nodes >
|
|
2009
|
-
if (typeof value === "string" && (stringUnits += value.length) >
|
|
2032
|
+
if (++nodes > limits.maxNodes || depth > limits.maxDepth) return "response_budget_exceeded";
|
|
2033
|
+
if (typeof value === "string" && (stringUnits += value.length) > limits.maxBytes) return "response_budget_exceeded";
|
|
2010
2034
|
if (value === void 0 || value === null || typeof value === "string" || typeof value === "boolean") continue;
|
|
2011
2035
|
if (typeof value === "number") {
|
|
2012
2036
|
if (!Number.isFinite(value)) return "non_json_value";
|
|
2013
2037
|
continue;
|
|
2014
2038
|
}
|
|
2015
2039
|
if (typeof value !== "object" || !Array.isArray(value) && Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null) return "non_json_value";
|
|
2016
|
-
if (Array.isArray(value) && value.length + pending.length + nodes >
|
|
2040
|
+
if (Array.isArray(value) && value.length + pending.length + nodes > limits.maxNodes) return "response_budget_exceeded";
|
|
2017
2041
|
const entries = Object.entries(value);
|
|
2018
|
-
if (entries.length + pending.length + nodes >
|
|
2042
|
+
if (entries.length + pending.length + nodes > limits.maxNodes) return "response_budget_exceeded";
|
|
2019
2043
|
for (const [key, child] of entries) {
|
|
2020
|
-
if (!Array.isArray(value) && (stringUnits += key.length) >
|
|
2044
|
+
if (!Array.isArray(value) && (stringUnits += key.length) > limits.maxBytes) return "response_budget_exceeded";
|
|
2021
2045
|
pending.push({
|
|
2022
2046
|
value: child,
|
|
2023
2047
|
depth: depth + 1
|
|
2024
2048
|
});
|
|
2025
2049
|
}
|
|
2026
2050
|
}
|
|
2027
|
-
if (new TextEncoder().encode(JSON.stringify(value)).byteLength >
|
|
2051
|
+
if (new TextEncoder().encode(JSON.stringify(value)).byteLength > limits.maxBytes) return "response_budget_exceeded";
|
|
2052
|
+
}
|
|
2053
|
+
function readFailure(startedAt, sessionId, reason, revision) {
|
|
2054
|
+
return failure("read", startedAt, {
|
|
2055
|
+
code: "session_read_failed",
|
|
2056
|
+
sessionId,
|
|
2057
|
+
reason,
|
|
2058
|
+
message: `Session read failed: ${reason}.`
|
|
2059
|
+
}, void 0, {
|
|
2060
|
+
sessionId,
|
|
2061
|
+
revision
|
|
2062
|
+
});
|
|
2028
2063
|
}
|
|
2029
2064
|
function toProjectOutline(session) {
|
|
2030
2065
|
const project = session.project;
|
|
@@ -2208,6 +2243,80 @@ var ReadService = class {
|
|
|
2208
2243
|
}
|
|
2209
2244
|
return respond(entity);
|
|
2210
2245
|
}
|
|
2246
|
+
resolveReadSession(input, startedAt) {
|
|
2247
|
+
if (!input || typeof input.sessionId !== "string" || !input.sessionId.length || input.sessionId.length > 256 || input.expectedRevision !== void 0 && (!Number.isSafeInteger(input.expectedRevision) || input.expectedRevision < 0)) return readFailure(startedAt, typeof input?.sessionId === "string" ? input.sessionId : "", "invalid_query");
|
|
2248
|
+
const session = this.context.sessions.get(input.sessionId);
|
|
2249
|
+
if (!session || session.closed) return failure("read", startedAt, createSessionNotFoundError(input.sessionId));
|
|
2250
|
+
const meta = {
|
|
2251
|
+
sessionId: session.sessionId,
|
|
2252
|
+
revision: session.revision
|
|
2253
|
+
};
|
|
2254
|
+
if (input.expectedRevision !== void 0 && input.expectedRevision !== session.revision) return failure("read", startedAt, {
|
|
2255
|
+
code: "stale_read",
|
|
2256
|
+
sessionId: session.sessionId,
|
|
2257
|
+
expectedRevision: input.expectedRevision,
|
|
2258
|
+
actualRevision: session.revision,
|
|
2259
|
+
message: "The session edit revision changed. Restart the model and resource read."
|
|
2260
|
+
}, void 0, meta);
|
|
2261
|
+
return success("read", startedAt, session, meta);
|
|
2262
|
+
}
|
|
2263
|
+
readSessionState(input) {
|
|
2264
|
+
const startedAt = Date.now();
|
|
2265
|
+
const resolved = this.resolveReadSession(input, startedAt);
|
|
2266
|
+
if (!resolved.ok) return resolved;
|
|
2267
|
+
const session = resolved.data;
|
|
2268
|
+
const meta = {
|
|
2269
|
+
sessionId: session.sessionId,
|
|
2270
|
+
revision: session.revision
|
|
2271
|
+
};
|
|
2272
|
+
const data = {
|
|
2273
|
+
...meta,
|
|
2274
|
+
dirty: session.dirty,
|
|
2275
|
+
lastSavedRevision: session.lastSavedRevision,
|
|
2276
|
+
uamFidelity: session.uamFidelity,
|
|
2277
|
+
readComplete: session.readComplete,
|
|
2278
|
+
readDiagnostics: session.readDiagnostics,
|
|
2279
|
+
project: {
|
|
2280
|
+
...session.project,
|
|
2281
|
+
packages: session.project.packages.map((pkg) => ({
|
|
2282
|
+
...pkg,
|
|
2283
|
+
resources: pkg.resources.map((resource) => {
|
|
2284
|
+
if (resource.kind === "component") return resource;
|
|
2285
|
+
const { sourceBytes: _sourceBytes, ...model } = resource;
|
|
2286
|
+
return model;
|
|
2287
|
+
})
|
|
2288
|
+
}))
|
|
2289
|
+
}
|
|
2290
|
+
};
|
|
2291
|
+
const problem = queryResponseProblem(data, BACKEND_SESSION_READ_LIMITS.model);
|
|
2292
|
+
return problem ? readFailure(startedAt, session.sessionId, problem, session.revision) : success("read", startedAt, structuredClone(data), meta);
|
|
2293
|
+
}
|
|
2294
|
+
readResourceBytes(input) {
|
|
2295
|
+
const startedAt = Date.now();
|
|
2296
|
+
const resolved = this.resolveReadSession(input, startedAt);
|
|
2297
|
+
if (!resolved.ok) return resolved;
|
|
2298
|
+
const session = resolved.data;
|
|
2299
|
+
const reject = (reason) => readFailure(startedAt, session.sessionId, reason, session.revision);
|
|
2300
|
+
const selector = input.selector;
|
|
2301
|
+
if (input.expectedRevision === void 0 || !selector || typeof selector !== "object" || Array.isArray(selector) || Object.keys(selector).length !== 2 || ["packageId", "resourceId"].some((key) => !Object.hasOwn(selector, key)) || [selector.packageId, selector.resourceId].some((value) => typeof value !== "string" || !value.length || value.length > 256)) return reject("invalid_query");
|
|
2302
|
+
const packages = session.project.packages.filter((pkg) => pkg.id === selector.packageId);
|
|
2303
|
+
if (packages.length !== 1) return reject(packages.length ? "ambiguous" : "not_found");
|
|
2304
|
+
const resources = packages[0].resources.filter((resource) => resource.id === selector.resourceId);
|
|
2305
|
+
if (resources.length !== 1) return reject(resources.length ? "ambiguous" : "not_found");
|
|
2306
|
+
const resource = resources[0];
|
|
2307
|
+
if (resource.kind === "component") return reject("unsupported_resource");
|
|
2308
|
+
if (!(resource.sourceBytes instanceof Uint8Array)) return reject("bytes_unavailable");
|
|
2309
|
+
if (resource.sourceBytes.byteLength > BACKEND_SESSION_READ_LIMITS.resourceBytes) return reject("response_budget_exceeded");
|
|
2310
|
+
const meta = {
|
|
2311
|
+
sessionId: session.sessionId,
|
|
2312
|
+
revision: session.revision
|
|
2313
|
+
};
|
|
2314
|
+
return success("read", startedAt, {
|
|
2315
|
+
...meta,
|
|
2316
|
+
selector: { ...selector },
|
|
2317
|
+
sourceBytes: new Uint8Array(resource.sourceBytes)
|
|
2318
|
+
}, meta);
|
|
2319
|
+
}
|
|
2211
2320
|
validateSession(input) {
|
|
2212
2321
|
const startedAt = Date.now();
|
|
2213
2322
|
const session = this.context.sessions.get(input.sessionId);
|
|
@@ -2518,6 +2627,8 @@ const BACKEND_METHODS = [
|
|
|
2518
2627
|
"getSession",
|
|
2519
2628
|
"getProjectOutline",
|
|
2520
2629
|
"queryEntity",
|
|
2630
|
+
"readSessionState",
|
|
2631
|
+
"readResourceBytes",
|
|
2521
2632
|
"validateSession",
|
|
2522
2633
|
"preflightTransaction",
|
|
2523
2634
|
"applyTransaction",
|
|
@@ -2541,7 +2652,7 @@ const ARTIFACT_BRIDGE_CAPABILITY = {
|
|
|
2541
2652
|
function createCapabilities(atomicSave = false) {
|
|
2542
2653
|
return {
|
|
2543
2654
|
contractVersion: BACKEND_CONTRACT_VERSION,
|
|
2544
|
-
capabilitySchemaVersion:
|
|
2655
|
+
capabilitySchemaVersion: 11,
|
|
2545
2656
|
transactionKernelOwner: "@openfairygui/core",
|
|
2546
2657
|
appSeamOwner: "@openfairygui/functions",
|
|
2547
2658
|
runtimeOwner: "@openfairygui/backend",
|
|
@@ -2564,6 +2675,15 @@ function createCapabilities(atomicSave = false) {
|
|
|
2564
2675
|
sourceBytes: false,
|
|
2565
2676
|
limits: BACKEND_ENTITY_QUERY_LIMITS
|
|
2566
2677
|
},
|
|
2678
|
+
sessionState: {
|
|
2679
|
+
sourceBytes: false,
|
|
2680
|
+
limits: BACKEND_SESSION_READ_LIMITS.model
|
|
2681
|
+
},
|
|
2682
|
+
resourceBytes: {
|
|
2683
|
+
expectedRevisionRequired: true,
|
|
2684
|
+
hydration: false,
|
|
2685
|
+
maxBytes: BACKEND_SESSION_READ_LIMITS.resourceBytes
|
|
2686
|
+
},
|
|
2567
2687
|
projectValidation: true
|
|
2568
2688
|
},
|
|
2569
2689
|
authoring: {
|
|
@@ -2728,6 +2848,12 @@ var BackendRuntime = class {
|
|
|
2728
2848
|
queryEntity(input) {
|
|
2729
2849
|
return this.readService.queryEntity(input);
|
|
2730
2850
|
}
|
|
2851
|
+
readSessionState(input) {
|
|
2852
|
+
return this.readService.readSessionState(input);
|
|
2853
|
+
}
|
|
2854
|
+
readResourceBytes(input) {
|
|
2855
|
+
return this.readService.readResourceBytes(input);
|
|
2856
|
+
}
|
|
2731
2857
|
validateSession(input) {
|
|
2732
2858
|
return this.readService.validateSession(input);
|
|
2733
2859
|
}
|
|
@@ -2942,6 +3068,7 @@ exports.BACKEND_CONTRACT_VERSION = BACKEND_CONTRACT_VERSION;
|
|
|
2942
3068
|
exports.BACKEND_DIAGNOSTICS_URI = BACKEND_DIAGNOSTICS_URI;
|
|
2943
3069
|
exports.BACKEND_DIAGNOSTIC_TEMPLATE = BACKEND_DIAGNOSTIC_TEMPLATE;
|
|
2944
3070
|
exports.BACKEND_ENTITY_QUERY_LIMITS = BACKEND_ENTITY_QUERY_LIMITS;
|
|
3071
|
+
exports.BACKEND_SESSION_READ_LIMITS = BACKEND_SESSION_READ_LIMITS;
|
|
2945
3072
|
exports.BACKEND_TRANSACTION_PREVIEW_LIMITS = BACKEND_TRANSACTION_PREVIEW_LIMITS;
|
|
2946
3073
|
exports.BackendRuntime = BackendRuntime;
|
|
2947
3074
|
exports.createBackendStorageFileSystem = createBackendStorageFileSystem;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import * as _$_openfairygui_core0 from "@openfairygui/core";
|
|
1
2
|
import { ProjectDiagnosticCode, ProjectValidationReport } from "@openfairygui/core";
|
|
2
|
-
import { UamComponentModel, UamComponentResource, UamComponentSelector, UamControllerModel, UamControllerSelector, UamDisplayNode, UamDisplayNodeKind, UamDisplayNodeSelector, UamGenericAssetResource, UamImageResource, UamMovieClipResource, UamPackageSelector, UamPackageSettings, UamProject, UamResource, UamResourceSelector, UamTransactionOperation, UamTransactionSupportIssueCode, UamTransitionModel, UamTransitionSelector } from "@openfairygui/core/uam";
|
|
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";
|
|
3
4
|
import { ApplyUamTransactionAppError } from "@openfairygui/functions/uam";
|
|
4
5
|
import { FileSystem } from "@openfairygui/core/project-io";
|
|
5
6
|
|
|
@@ -13,7 +14,7 @@ interface PathPolicyViolationError {
|
|
|
13
14
|
}
|
|
14
15
|
//#endregion
|
|
15
16
|
//#region src/runtime/capabilities.d.ts
|
|
16
|
-
declare const BACKEND_METHODS: readonly ["getCapabilities", "openSession", "openProjectSession", "getSession", "getProjectOutline", "queryEntity", "validateSession", "preflightTransaction", "applyTransaction", "saveSession", "materializeSession", "closeSession", "getEvents", "getJob", "listJobs", "cancelJob", "getCacheSnapshot", "refreshCache"];
|
|
17
|
+
declare const BACKEND_METHODS: readonly ["getCapabilities", "openSession", "openProjectSession", "getSession", "getProjectOutline", "queryEntity", "readSessionState", "readResourceBytes", "validateSession", "preflightTransaction", "applyTransaction", "saveSession", "materializeSession", "closeSession", "getEvents", "getJob", "listJobs", "cancelJob", "getCacheSnapshot", "refreshCache"];
|
|
17
18
|
//#endregion
|
|
18
19
|
//#region src/runtime/contracts.d.ts
|
|
19
20
|
type BackendMethodName = keyof BackendRuntime;
|
|
@@ -22,6 +23,57 @@ declare const BACKEND_ENTITY_QUERY_LIMITS: {
|
|
|
22
23
|
readonly maxDepth: 32;
|
|
23
24
|
readonly maxNodes: 100000;
|
|
24
25
|
};
|
|
26
|
+
declare const BACKEND_SESSION_READ_LIMITS: {
|
|
27
|
+
readonly model: {
|
|
28
|
+
readonly maxBytes: 4194304;
|
|
29
|
+
readonly maxDepth: 64;
|
|
30
|
+
readonly maxNodes: 500000;
|
|
31
|
+
};
|
|
32
|
+
readonly resourceBytes: 1048576;
|
|
33
|
+
};
|
|
34
|
+
/** The public UAM model, excluding only each asset resource's primary sourceBytes. */
|
|
35
|
+
type BackendSessionResourceModel = UamComponentResource | Omit<UamImageResource, 'sourceBytes'> | Omit<UamMovieClipResource, 'sourceBytes'> | Omit<UamGenericAssetResource, 'sourceBytes'>;
|
|
36
|
+
interface BackendSessionPackageModel extends Omit<UamPackage, 'resources'> {
|
|
37
|
+
resources: BackendSessionResourceModel[];
|
|
38
|
+
}
|
|
39
|
+
interface BackendSessionProjectModel extends Omit<UamProject, 'packages'> {
|
|
40
|
+
packages: BackendSessionPackageModel[];
|
|
41
|
+
}
|
|
42
|
+
interface ReadSessionStateInput {
|
|
43
|
+
sessionId: string;
|
|
44
|
+
expectedRevision?: number;
|
|
45
|
+
}
|
|
46
|
+
interface ReadResourceBytesInput {
|
|
47
|
+
sessionId: string;
|
|
48
|
+
expectedRevision: number;
|
|
49
|
+
selector: UamResourceSelector;
|
|
50
|
+
}
|
|
51
|
+
interface BackendSessionStateSnapshot extends Pick<BackendSessionSnapshot, 'sessionId' | 'revision' | 'lastSavedRevision' | 'dirty' | 'uamFidelity'> {
|
|
52
|
+
project: BackendSessionProjectModel;
|
|
53
|
+
readDiagnostics: _$_openfairygui_core0.ProjectDiagnostic[];
|
|
54
|
+
/** Source-read completeness, not a guarantee of resource bytes or downstream usability. */
|
|
55
|
+
readComplete: boolean;
|
|
56
|
+
}
|
|
57
|
+
interface BackendResourceBytesSnapshot {
|
|
58
|
+
sessionId: string;
|
|
59
|
+
revision: number;
|
|
60
|
+
selector: UamResourceSelector;
|
|
61
|
+
/** Only primary bytes already held in this session; no filesystem hydration. */
|
|
62
|
+
sourceBytes: Uint8Array;
|
|
63
|
+
}
|
|
64
|
+
interface SessionReadError {
|
|
65
|
+
code: 'session_read_failed';
|
|
66
|
+
message: string;
|
|
67
|
+
sessionId: string;
|
|
68
|
+
reason: 'invalid_query' | 'not_found' | 'ambiguous' | 'unsupported_resource' | 'bytes_unavailable' | 'response_budget_exceeded' | 'non_json_value';
|
|
69
|
+
}
|
|
70
|
+
interface SessionStaleReadError {
|
|
71
|
+
code: 'stale_read';
|
|
72
|
+
message: string;
|
|
73
|
+
sessionId: string;
|
|
74
|
+
expectedRevision: number;
|
|
75
|
+
actualRevision: number;
|
|
76
|
+
}
|
|
25
77
|
declare const BACKEND_TRANSACTION_PREVIEW_LIMITS: {
|
|
26
78
|
readonly maxBytes: 262144;
|
|
27
79
|
readonly maxEntries: 2000;
|
|
@@ -194,6 +246,15 @@ interface BackendCapabilities {
|
|
|
194
246
|
sourceBytes: false;
|
|
195
247
|
limits: typeof BACKEND_ENTITY_QUERY_LIMITS;
|
|
196
248
|
};
|
|
249
|
+
sessionState: {
|
|
250
|
+
sourceBytes: false;
|
|
251
|
+
limits: typeof BACKEND_SESSION_READ_LIMITS.model;
|
|
252
|
+
};
|
|
253
|
+
resourceBytes: {
|
|
254
|
+
expectedRevisionRequired: true;
|
|
255
|
+
hydration: false;
|
|
256
|
+
maxBytes: typeof BACKEND_SESSION_READ_LIMITS.resourceBytes;
|
|
257
|
+
};
|
|
197
258
|
projectValidation: true;
|
|
198
259
|
};
|
|
199
260
|
authoring: {
|
|
@@ -536,7 +597,7 @@ interface RefreshCacheInput {
|
|
|
536
597
|
sessionId: string;
|
|
537
598
|
reason?: 'manual' | 'session_open' | 'after_save';
|
|
538
599
|
}
|
|
539
|
-
type BackendError = SessionNotFoundError | TransactionPreviewError | EntityQueryError | SessionIdConflictError | SessionStaleWriteError | InProcessLockConflictError | AdvisoryLockConflictError | SavePartialFailureError | UamFidelityUnsupportedError | MaterializeValidationFailedError | MaterializeWriteFailedError | PathPolicyViolationError | EventCursorInvalidError | BackendJobNotFoundError | BackendJobNotCancellableError | BackendJobCancelledError | CacheRefreshFailedError | BackendCapabilityUnavailableError | ProjectRootNotAllowedError | ProjectOpenFailedError | ApplyUamTransactionAppError;
|
|
600
|
+
type BackendError = SessionNotFoundError | TransactionPreviewError | EntityQueryError | SessionReadError | SessionStaleReadError | SessionIdConflictError | SessionStaleWriteError | InProcessLockConflictError | AdvisoryLockConflictError | SavePartialFailureError | UamFidelityUnsupportedError | MaterializeValidationFailedError | MaterializeWriteFailedError | PathPolicyViolationError | EventCursorInvalidError | BackendJobNotFoundError | BackendJobNotCancellableError | BackendJobCancelledError | CacheRefreshFailedError | BackendCapabilityUnavailableError | ProjectRootNotAllowedError | ProjectOpenFailedError | ApplyUamTransactionAppError;
|
|
540
601
|
interface ProjectRootNotAllowedError {
|
|
541
602
|
code: 'project_root_not_allowed';
|
|
542
603
|
message: string;
|
|
@@ -662,6 +723,8 @@ declare class BackendRuntime {
|
|
|
662
723
|
}): BackendResult<BackendSessionSnapshot, SessionNotFoundError>;
|
|
663
724
|
getProjectOutline(input: GetProjectOutlineInput): BackendResult<BackendProjectOutline, SessionNotFoundError>;
|
|
664
725
|
queryEntity(input: QueryEntityInput): BackendResult<BackendEntitySnapshot, SessionNotFoundError | EntityQueryError>;
|
|
726
|
+
readSessionState(input: ReadSessionStateInput): BackendResult<BackendSessionStateSnapshot, SessionNotFoundError | SessionReadError | SessionStaleReadError>;
|
|
727
|
+
readResourceBytes(input: ReadResourceBytesInput): BackendResult<BackendResourceBytesSnapshot, SessionNotFoundError | SessionReadError | SessionStaleReadError>;
|
|
665
728
|
validateSession(input: ValidateSessionInput): BackendResult<ProjectValidationReport, SessionNotFoundError>;
|
|
666
729
|
preflightTransaction(input: ApplySessionTransactionInput): Promise<BackendResult<BackendTransactionPreview, SessionNotFoundError | SessionStaleWriteError | ApplyUamTransactionAppError | TransactionPreviewError>>;
|
|
667
730
|
applyTransaction(input: ApplySessionTransactionInput): Promise<BackendResult<BackendSessionSnapshot, SessionNotFoundError | SessionStaleWriteError | ApplyUamTransactionAppError>>;
|
|
@@ -683,7 +746,7 @@ declare class BackendRuntime {
|
|
|
683
746
|
//#endregion
|
|
684
747
|
//#region src/contracts.d.ts
|
|
685
748
|
declare const BACKEND_CONTRACT_VERSION: "2.0.0-p2";
|
|
686
|
-
declare const BACKEND_CAPABILITY_SCHEMA_VERSION:
|
|
749
|
+
declare const BACKEND_CAPABILITY_SCHEMA_VERSION: 11;
|
|
687
750
|
declare const BACKEND_COMPATIBILITY_POLICY: {
|
|
688
751
|
readonly incompatibleChange: "requires contractVersion bump";
|
|
689
752
|
readonly capabilitySchemaChange: "requires capabilitySchemaVersion bump";
|
|
@@ -746,6 +809,22 @@ interface BackendDiagnosticGuide {
|
|
|
746
809
|
declare const BACKEND_DIAGNOSTICS_URI = "openfairygui://docs/diagnostics";
|
|
747
810
|
declare const BACKEND_DIAGNOSTIC_TEMPLATE = "openfairygui://docs/diagnostics/{code}";
|
|
748
811
|
declare function getBackendDiagnosticCatalog(): ({
|
|
812
|
+
docsUri: string;
|
|
813
|
+
code: "stale_read";
|
|
814
|
+
owners: readonly ["backend"];
|
|
815
|
+
remediation: {
|
|
816
|
+
readonly kind: "refresh-and-replan";
|
|
817
|
+
readonly message: "Discard the incomplete model/bytes read and restart with readSessionState. Use its revision for every readResourceBytes call. No historical state is retained or reserved; do not combine resources from different edit revisions.";
|
|
818
|
+
};
|
|
819
|
+
} | {
|
|
820
|
+
docsUri: string;
|
|
821
|
+
code: "session_read_failed";
|
|
822
|
+
owners: readonly ["backend"];
|
|
823
|
+
remediation: {
|
|
824
|
+
readonly kind: "host-action";
|
|
825
|
+
readonly message: "Inspect error.reason: invalid_query requires valid inputs; not_found/ambiguous requires exact current resource identifiers; unsupported_resource/bytes_unavailable means primary bytes cannot be read from this session. Budget or non-JSON failures require host inspection. Preserve unsaved work; do not save, reopen, repair or mutate the model merely to obtain a read.";
|
|
826
|
+
};
|
|
827
|
+
} | {
|
|
749
828
|
docsUri: string;
|
|
750
829
|
code: "transaction_preview_failed";
|
|
751
830
|
owners: readonly ["backend"];
|
|
@@ -1563,6 +1642,22 @@ declare function getBackendDiagnosticCatalog(): ({
|
|
|
1563
1642
|
};
|
|
1564
1643
|
})[];
|
|
1565
1644
|
declare function getBackendDiagnosticGuide(code: string): {
|
|
1645
|
+
docsUri: string;
|
|
1646
|
+
code: "stale_read";
|
|
1647
|
+
owners: readonly ["backend"];
|
|
1648
|
+
remediation: {
|
|
1649
|
+
readonly kind: "refresh-and-replan";
|
|
1650
|
+
readonly message: "Discard the incomplete model/bytes read and restart with readSessionState. Use its revision for every readResourceBytes call. No historical state is retained or reserved; do not combine resources from different edit revisions.";
|
|
1651
|
+
};
|
|
1652
|
+
} | {
|
|
1653
|
+
docsUri: string;
|
|
1654
|
+
code: "session_read_failed";
|
|
1655
|
+
owners: readonly ["backend"];
|
|
1656
|
+
remediation: {
|
|
1657
|
+
readonly kind: "host-action";
|
|
1658
|
+
readonly message: "Inspect error.reason: invalid_query requires valid inputs; not_found/ambiguous requires exact current resource identifiers; unsupported_resource/bytes_unavailable means primary bytes cannot be read from this session. Budget or non-JSON failures require host inspection. Preserve unsaved work; do not save, reopen, repair or mutate the model merely to obtain a read.";
|
|
1659
|
+
};
|
|
1660
|
+
} | {
|
|
1566
1661
|
docsUri: string;
|
|
1567
1662
|
code: "transaction_preview_failed";
|
|
1568
1663
|
owners: readonly ["backend"];
|
|
@@ -2415,4 +2510,4 @@ interface BackendAsyncStorageAdapter {
|
|
|
2415
2510
|
type BackendStorageFileSystem = BackendFileSystem & FileSystem;
|
|
2416
2511
|
declare function createBackendStorageFileSystem(storage: BackendAsyncStorageAdapter): BackendStorageFileSystem;
|
|
2417
2512
|
//#endregion
|
|
2418
|
-
export { type AdvisoryLockConflictError, type ApplySessionTransactionInput, BACKEND_CAPABILITY_SCHEMA_VERSION, BACKEND_COMPATIBILITY_POLICY, BACKEND_CONTRACT_VERSION, BACKEND_DIAGNOSTICS_URI, BACKEND_DIAGNOSTIC_TEMPLATE, BACKEND_ENTITY_QUERY_LIMITS, BACKEND_TRANSACTION_PREVIEW_LIMITS, type BackendArtifactBridgeCapability, type BackendAsyncStorageAdapter, type BackendCacheEntry, type BackendCacheSnapshot, type BackendCapabilities, type BackendCapabilityManifest, type BackendCapabilityUnavailableError, type BackendComponentSnapshot, type BackendDiagnostic, type BackendDiagnosticCode, type BackendDiagnosticGuide, type BackendDiagnosticOwner, type BackendDiagnosticRemediation, type BackendEntitySnapshot, type BackendEntityTarget, type BackendError, type BackendEvent, type BackendEventKind, type BackendFailure, type BackendFileStat, type BackendFileSystem, type BackendHostAdapter, type BackendJobErrors, type BackendJobKind, type BackendJobListSnapshot, type BackendJobListStatusFilter, type BackendJobNotCancellableError, type BackendJobNotFoundError, type BackendJobProgress, type BackendJobSnapshot, type BackendJobStatus, type BackendMessage, type BackendMethodName, type BackendPackageSnapshot, type BackendProjectOutline, type BackendProjectOutlinePackage, type BackendProjectOutlineResource, type BackendProjectSessionStorage, type BackendProjectSnapshot, type BackendResourceSnapshot, type BackendResponseMeta, type BackendResult, BackendRuntime, type BackendRuntimeOptions, type BackendSessionLock, type BackendSessionSnapshot, type BackendStage, type BackendStorageFileSystem, type BackendStorageStatLike, type BackendSuccess, type BackendTransactionEntityChange, type BackendTransactionPreview, type CacheRefreshFailedError, type CancelJobInput, type EntityQueryError, type EventCursorInvalidError, type GetCacheSnapshotInput, type GetEventsInput, type GetEventsSnapshot, type GetJobInput, type GetProjectOutlineInput, type InProcessLockConflictError, type ListJobsInput, type MaterializeSessionInput, type MaterializeSessionSnapshot, type MaterializeValidationFailedError, type MaterializeWriteFailedError, type OpenProjectSessionInput, type ProjectOpenFailedError, type ProjectRootNotAllowedError, type QueryEntityInput, type RefreshCacheInput, type SavePartialFailureError, type SaveSessionInput, type SessionIdConflictError, type SessionNotFoundError, type SessionStaleWriteError, type TransactionPreviewError, type UamFidelityUnsupportedError, type ValidateSessionInput, createBackendStorageFileSystem, getBackendDiagnosticCatalog, getBackendDiagnosticGuide };
|
|
2513
|
+
export { type AdvisoryLockConflictError, type ApplySessionTransactionInput, BACKEND_CAPABILITY_SCHEMA_VERSION, BACKEND_COMPATIBILITY_POLICY, BACKEND_CONTRACT_VERSION, BACKEND_DIAGNOSTICS_URI, BACKEND_DIAGNOSTIC_TEMPLATE, BACKEND_ENTITY_QUERY_LIMITS, BACKEND_SESSION_READ_LIMITS, BACKEND_TRANSACTION_PREVIEW_LIMITS, type BackendArtifactBridgeCapability, type BackendAsyncStorageAdapter, type BackendCacheEntry, type BackendCacheSnapshot, type BackendCapabilities, type BackendCapabilityManifest, type BackendCapabilityUnavailableError, type BackendComponentSnapshot, type BackendDiagnostic, type BackendDiagnosticCode, type BackendDiagnosticGuide, type BackendDiagnosticOwner, type BackendDiagnosticRemediation, type BackendEntitySnapshot, type BackendEntityTarget, type BackendError, type BackendEvent, type BackendEventKind, type BackendFailure, type BackendFileStat, type BackendFileSystem, type BackendHostAdapter, type BackendJobErrors, type BackendJobKind, type BackendJobListSnapshot, type BackendJobListStatusFilter, type BackendJobNotCancellableError, type BackendJobNotFoundError, type BackendJobProgress, type BackendJobSnapshot, type BackendJobStatus, type BackendMessage, type BackendMethodName, type BackendPackageSnapshot, type BackendProjectOutline, type BackendProjectOutlinePackage, type BackendProjectOutlineResource, type BackendProjectSessionStorage, type BackendProjectSnapshot, type BackendResourceBytesSnapshot, type BackendResourceSnapshot, type BackendResponseMeta, type BackendResult, BackendRuntime, type BackendRuntimeOptions, type BackendSessionLock, type BackendSessionPackageModel, type BackendSessionProjectModel, type BackendSessionResourceModel, type BackendSessionSnapshot, type BackendSessionStateSnapshot, type BackendStage, type BackendStorageFileSystem, type BackendStorageStatLike, type BackendSuccess, type BackendTransactionEntityChange, type BackendTransactionPreview, type CacheRefreshFailedError, type CancelJobInput, type EntityQueryError, type EventCursorInvalidError, type GetCacheSnapshotInput, type GetEventsInput, type GetEventsSnapshot, type GetJobInput, type GetProjectOutlineInput, type InProcessLockConflictError, type ListJobsInput, type MaterializeSessionInput, type MaterializeSessionSnapshot, type MaterializeValidationFailedError, type MaterializeWriteFailedError, type OpenProjectSessionInput, type ProjectOpenFailedError, type ProjectRootNotAllowedError, type QueryEntityInput, type ReadResourceBytesInput, type ReadSessionStateInput, type RefreshCacheInput, type SavePartialFailureError, type SaveSessionInput, type SessionIdConflictError, type SessionNotFoundError, type SessionReadError, type SessionStaleReadError, type SessionStaleWriteError, type TransactionPreviewError, type UamFidelityUnsupportedError, type ValidateSessionInput, createBackendStorageFileSystem, getBackendDiagnosticCatalog, getBackendDiagnosticGuide };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { UamComponentModel, UamComponentResource, UamComponentSelector, UamControllerModel, UamControllerSelector, UamDisplayNode, UamDisplayNodeKind, UamDisplayNodeSelector, UamGenericAssetResource, UamImageResource, UamMovieClipResource, UamPackageSelector, UamPackageSettings, UamProject, UamResource, UamResourceSelector, UamTransactionOperation, UamTransactionSupportIssueCode, UamTransitionModel, UamTransitionSelector } from "@openfairygui/core/uam";
|
|
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
2
|
import { ApplyUamTransactionAppError } from "@openfairygui/functions/uam";
|
|
3
3
|
import { FileSystem } from "@openfairygui/core/project-io";
|
|
4
|
+
import * as _$_openfairygui_core0 from "@openfairygui/core";
|
|
4
5
|
import { ProjectDiagnosticCode, ProjectValidationReport } from "@openfairygui/core";
|
|
5
6
|
|
|
6
7
|
//#region src/path-policy.d.ts
|
|
@@ -13,7 +14,7 @@ interface PathPolicyViolationError {
|
|
|
13
14
|
}
|
|
14
15
|
//#endregion
|
|
15
16
|
//#region src/runtime/capabilities.d.ts
|
|
16
|
-
declare const BACKEND_METHODS: readonly ["getCapabilities", "openSession", "openProjectSession", "getSession", "getProjectOutline", "queryEntity", "validateSession", "preflightTransaction", "applyTransaction", "saveSession", "materializeSession", "closeSession", "getEvents", "getJob", "listJobs", "cancelJob", "getCacheSnapshot", "refreshCache"];
|
|
17
|
+
declare const BACKEND_METHODS: readonly ["getCapabilities", "openSession", "openProjectSession", "getSession", "getProjectOutline", "queryEntity", "readSessionState", "readResourceBytes", "validateSession", "preflightTransaction", "applyTransaction", "saveSession", "materializeSession", "closeSession", "getEvents", "getJob", "listJobs", "cancelJob", "getCacheSnapshot", "refreshCache"];
|
|
17
18
|
//#endregion
|
|
18
19
|
//#region src/runtime/contracts.d.ts
|
|
19
20
|
type BackendMethodName = keyof BackendRuntime;
|
|
@@ -22,6 +23,57 @@ declare const BACKEND_ENTITY_QUERY_LIMITS: {
|
|
|
22
23
|
readonly maxDepth: 32;
|
|
23
24
|
readonly maxNodes: 100000;
|
|
24
25
|
};
|
|
26
|
+
declare const BACKEND_SESSION_READ_LIMITS: {
|
|
27
|
+
readonly model: {
|
|
28
|
+
readonly maxBytes: 4194304;
|
|
29
|
+
readonly maxDepth: 64;
|
|
30
|
+
readonly maxNodes: 500000;
|
|
31
|
+
};
|
|
32
|
+
readonly resourceBytes: 1048576;
|
|
33
|
+
};
|
|
34
|
+
/** The public UAM model, excluding only each asset resource's primary sourceBytes. */
|
|
35
|
+
type BackendSessionResourceModel = UamComponentResource | Omit<UamImageResource, 'sourceBytes'> | Omit<UamMovieClipResource, 'sourceBytes'> | Omit<UamGenericAssetResource, 'sourceBytes'>;
|
|
36
|
+
interface BackendSessionPackageModel extends Omit<UamPackage, 'resources'> {
|
|
37
|
+
resources: BackendSessionResourceModel[];
|
|
38
|
+
}
|
|
39
|
+
interface BackendSessionProjectModel extends Omit<UamProject, 'packages'> {
|
|
40
|
+
packages: BackendSessionPackageModel[];
|
|
41
|
+
}
|
|
42
|
+
interface ReadSessionStateInput {
|
|
43
|
+
sessionId: string;
|
|
44
|
+
expectedRevision?: number;
|
|
45
|
+
}
|
|
46
|
+
interface ReadResourceBytesInput {
|
|
47
|
+
sessionId: string;
|
|
48
|
+
expectedRevision: number;
|
|
49
|
+
selector: UamResourceSelector;
|
|
50
|
+
}
|
|
51
|
+
interface BackendSessionStateSnapshot extends Pick<BackendSessionSnapshot, 'sessionId' | 'revision' | 'lastSavedRevision' | 'dirty' | 'uamFidelity'> {
|
|
52
|
+
project: BackendSessionProjectModel;
|
|
53
|
+
readDiagnostics: _$_openfairygui_core0.ProjectDiagnostic[];
|
|
54
|
+
/** Source-read completeness, not a guarantee of resource bytes or downstream usability. */
|
|
55
|
+
readComplete: boolean;
|
|
56
|
+
}
|
|
57
|
+
interface BackendResourceBytesSnapshot {
|
|
58
|
+
sessionId: string;
|
|
59
|
+
revision: number;
|
|
60
|
+
selector: UamResourceSelector;
|
|
61
|
+
/** Only primary bytes already held in this session; no filesystem hydration. */
|
|
62
|
+
sourceBytes: Uint8Array;
|
|
63
|
+
}
|
|
64
|
+
interface SessionReadError {
|
|
65
|
+
code: 'session_read_failed';
|
|
66
|
+
message: string;
|
|
67
|
+
sessionId: string;
|
|
68
|
+
reason: 'invalid_query' | 'not_found' | 'ambiguous' | 'unsupported_resource' | 'bytes_unavailable' | 'response_budget_exceeded' | 'non_json_value';
|
|
69
|
+
}
|
|
70
|
+
interface SessionStaleReadError {
|
|
71
|
+
code: 'stale_read';
|
|
72
|
+
message: string;
|
|
73
|
+
sessionId: string;
|
|
74
|
+
expectedRevision: number;
|
|
75
|
+
actualRevision: number;
|
|
76
|
+
}
|
|
25
77
|
declare const BACKEND_TRANSACTION_PREVIEW_LIMITS: {
|
|
26
78
|
readonly maxBytes: 262144;
|
|
27
79
|
readonly maxEntries: 2000;
|
|
@@ -194,6 +246,15 @@ interface BackendCapabilities {
|
|
|
194
246
|
sourceBytes: false;
|
|
195
247
|
limits: typeof BACKEND_ENTITY_QUERY_LIMITS;
|
|
196
248
|
};
|
|
249
|
+
sessionState: {
|
|
250
|
+
sourceBytes: false;
|
|
251
|
+
limits: typeof BACKEND_SESSION_READ_LIMITS.model;
|
|
252
|
+
};
|
|
253
|
+
resourceBytes: {
|
|
254
|
+
expectedRevisionRequired: true;
|
|
255
|
+
hydration: false;
|
|
256
|
+
maxBytes: typeof BACKEND_SESSION_READ_LIMITS.resourceBytes;
|
|
257
|
+
};
|
|
197
258
|
projectValidation: true;
|
|
198
259
|
};
|
|
199
260
|
authoring: {
|
|
@@ -536,7 +597,7 @@ interface RefreshCacheInput {
|
|
|
536
597
|
sessionId: string;
|
|
537
598
|
reason?: 'manual' | 'session_open' | 'after_save';
|
|
538
599
|
}
|
|
539
|
-
type BackendError = SessionNotFoundError | TransactionPreviewError | EntityQueryError | SessionIdConflictError | SessionStaleWriteError | InProcessLockConflictError | AdvisoryLockConflictError | SavePartialFailureError | UamFidelityUnsupportedError | MaterializeValidationFailedError | MaterializeWriteFailedError | PathPolicyViolationError | EventCursorInvalidError | BackendJobNotFoundError | BackendJobNotCancellableError | BackendJobCancelledError | CacheRefreshFailedError | BackendCapabilityUnavailableError | ProjectRootNotAllowedError | ProjectOpenFailedError | ApplyUamTransactionAppError;
|
|
600
|
+
type BackendError = SessionNotFoundError | TransactionPreviewError | EntityQueryError | SessionReadError | SessionStaleReadError | SessionIdConflictError | SessionStaleWriteError | InProcessLockConflictError | AdvisoryLockConflictError | SavePartialFailureError | UamFidelityUnsupportedError | MaterializeValidationFailedError | MaterializeWriteFailedError | PathPolicyViolationError | EventCursorInvalidError | BackendJobNotFoundError | BackendJobNotCancellableError | BackendJobCancelledError | CacheRefreshFailedError | BackendCapabilityUnavailableError | ProjectRootNotAllowedError | ProjectOpenFailedError | ApplyUamTransactionAppError;
|
|
540
601
|
interface ProjectRootNotAllowedError {
|
|
541
602
|
code: 'project_root_not_allowed';
|
|
542
603
|
message: string;
|
|
@@ -662,6 +723,8 @@ declare class BackendRuntime {
|
|
|
662
723
|
}): BackendResult<BackendSessionSnapshot, SessionNotFoundError>;
|
|
663
724
|
getProjectOutline(input: GetProjectOutlineInput): BackendResult<BackendProjectOutline, SessionNotFoundError>;
|
|
664
725
|
queryEntity(input: QueryEntityInput): BackendResult<BackendEntitySnapshot, SessionNotFoundError | EntityQueryError>;
|
|
726
|
+
readSessionState(input: ReadSessionStateInput): BackendResult<BackendSessionStateSnapshot, SessionNotFoundError | SessionReadError | SessionStaleReadError>;
|
|
727
|
+
readResourceBytes(input: ReadResourceBytesInput): BackendResult<BackendResourceBytesSnapshot, SessionNotFoundError | SessionReadError | SessionStaleReadError>;
|
|
665
728
|
validateSession(input: ValidateSessionInput): BackendResult<ProjectValidationReport, SessionNotFoundError>;
|
|
666
729
|
preflightTransaction(input: ApplySessionTransactionInput): Promise<BackendResult<BackendTransactionPreview, SessionNotFoundError | SessionStaleWriteError | ApplyUamTransactionAppError | TransactionPreviewError>>;
|
|
667
730
|
applyTransaction(input: ApplySessionTransactionInput): Promise<BackendResult<BackendSessionSnapshot, SessionNotFoundError | SessionStaleWriteError | ApplyUamTransactionAppError>>;
|
|
@@ -683,7 +746,7 @@ declare class BackendRuntime {
|
|
|
683
746
|
//#endregion
|
|
684
747
|
//#region src/contracts.d.ts
|
|
685
748
|
declare const BACKEND_CONTRACT_VERSION: "2.0.0-p2";
|
|
686
|
-
declare const BACKEND_CAPABILITY_SCHEMA_VERSION:
|
|
749
|
+
declare const BACKEND_CAPABILITY_SCHEMA_VERSION: 11;
|
|
687
750
|
declare const BACKEND_COMPATIBILITY_POLICY: {
|
|
688
751
|
readonly incompatibleChange: "requires contractVersion bump";
|
|
689
752
|
readonly capabilitySchemaChange: "requires capabilitySchemaVersion bump";
|
|
@@ -746,6 +809,22 @@ interface BackendDiagnosticGuide {
|
|
|
746
809
|
declare const BACKEND_DIAGNOSTICS_URI = "openfairygui://docs/diagnostics";
|
|
747
810
|
declare const BACKEND_DIAGNOSTIC_TEMPLATE = "openfairygui://docs/diagnostics/{code}";
|
|
748
811
|
declare function getBackendDiagnosticCatalog(): ({
|
|
812
|
+
docsUri: string;
|
|
813
|
+
code: "stale_read";
|
|
814
|
+
owners: readonly ["backend"];
|
|
815
|
+
remediation: {
|
|
816
|
+
readonly kind: "refresh-and-replan";
|
|
817
|
+
readonly message: "Discard the incomplete model/bytes read and restart with readSessionState. Use its revision for every readResourceBytes call. No historical state is retained or reserved; do not combine resources from different edit revisions.";
|
|
818
|
+
};
|
|
819
|
+
} | {
|
|
820
|
+
docsUri: string;
|
|
821
|
+
code: "session_read_failed";
|
|
822
|
+
owners: readonly ["backend"];
|
|
823
|
+
remediation: {
|
|
824
|
+
readonly kind: "host-action";
|
|
825
|
+
readonly message: "Inspect error.reason: invalid_query requires valid inputs; not_found/ambiguous requires exact current resource identifiers; unsupported_resource/bytes_unavailable means primary bytes cannot be read from this session. Budget or non-JSON failures require host inspection. Preserve unsaved work; do not save, reopen, repair or mutate the model merely to obtain a read.";
|
|
826
|
+
};
|
|
827
|
+
} | {
|
|
749
828
|
docsUri: string;
|
|
750
829
|
code: "transaction_preview_failed";
|
|
751
830
|
owners: readonly ["backend"];
|
|
@@ -1563,6 +1642,22 @@ declare function getBackendDiagnosticCatalog(): ({
|
|
|
1563
1642
|
};
|
|
1564
1643
|
})[];
|
|
1565
1644
|
declare function getBackendDiagnosticGuide(code: string): {
|
|
1645
|
+
docsUri: string;
|
|
1646
|
+
code: "stale_read";
|
|
1647
|
+
owners: readonly ["backend"];
|
|
1648
|
+
remediation: {
|
|
1649
|
+
readonly kind: "refresh-and-replan";
|
|
1650
|
+
readonly message: "Discard the incomplete model/bytes read and restart with readSessionState. Use its revision for every readResourceBytes call. No historical state is retained or reserved; do not combine resources from different edit revisions.";
|
|
1651
|
+
};
|
|
1652
|
+
} | {
|
|
1653
|
+
docsUri: string;
|
|
1654
|
+
code: "session_read_failed";
|
|
1655
|
+
owners: readonly ["backend"];
|
|
1656
|
+
remediation: {
|
|
1657
|
+
readonly kind: "host-action";
|
|
1658
|
+
readonly message: "Inspect error.reason: invalid_query requires valid inputs; not_found/ambiguous requires exact current resource identifiers; unsupported_resource/bytes_unavailable means primary bytes cannot be read from this session. Budget or non-JSON failures require host inspection. Preserve unsaved work; do not save, reopen, repair or mutate the model merely to obtain a read.";
|
|
1659
|
+
};
|
|
1660
|
+
} | {
|
|
1566
1661
|
docsUri: string;
|
|
1567
1662
|
code: "transaction_preview_failed";
|
|
1568
1663
|
owners: readonly ["backend"];
|
|
@@ -2415,4 +2510,4 @@ interface BackendAsyncStorageAdapter {
|
|
|
2415
2510
|
type BackendStorageFileSystem = BackendFileSystem & FileSystem;
|
|
2416
2511
|
declare function createBackendStorageFileSystem(storage: BackendAsyncStorageAdapter): BackendStorageFileSystem;
|
|
2417
2512
|
//#endregion
|
|
2418
|
-
export { type AdvisoryLockConflictError, type ApplySessionTransactionInput, BACKEND_CAPABILITY_SCHEMA_VERSION, BACKEND_COMPATIBILITY_POLICY, BACKEND_CONTRACT_VERSION, BACKEND_DIAGNOSTICS_URI, BACKEND_DIAGNOSTIC_TEMPLATE, BACKEND_ENTITY_QUERY_LIMITS, BACKEND_TRANSACTION_PREVIEW_LIMITS, type BackendArtifactBridgeCapability, type BackendAsyncStorageAdapter, type BackendCacheEntry, type BackendCacheSnapshot, type BackendCapabilities, type BackendCapabilityManifest, type BackendCapabilityUnavailableError, type BackendComponentSnapshot, type BackendDiagnostic, type BackendDiagnosticCode, type BackendDiagnosticGuide, type BackendDiagnosticOwner, type BackendDiagnosticRemediation, type BackendEntitySnapshot, type BackendEntityTarget, type BackendError, type BackendEvent, type BackendEventKind, type BackendFailure, type BackendFileStat, type BackendFileSystem, type BackendHostAdapter, type BackendJobErrors, type BackendJobKind, type BackendJobListSnapshot, type BackendJobListStatusFilter, type BackendJobNotCancellableError, type BackendJobNotFoundError, type BackendJobProgress, type BackendJobSnapshot, type BackendJobStatus, type BackendMessage, type BackendMethodName, type BackendPackageSnapshot, type BackendProjectOutline, type BackendProjectOutlinePackage, type BackendProjectOutlineResource, type BackendProjectSessionStorage, type BackendProjectSnapshot, type BackendResourceSnapshot, type BackendResponseMeta, type BackendResult, BackendRuntime, type BackendRuntimeOptions, type BackendSessionLock, type BackendSessionSnapshot, type BackendStage, type BackendStorageFileSystem, type BackendStorageStatLike, type BackendSuccess, type BackendTransactionEntityChange, type BackendTransactionPreview, type CacheRefreshFailedError, type CancelJobInput, type EntityQueryError, type EventCursorInvalidError, type GetCacheSnapshotInput, type GetEventsInput, type GetEventsSnapshot, type GetJobInput, type GetProjectOutlineInput, type InProcessLockConflictError, type ListJobsInput, type MaterializeSessionInput, type MaterializeSessionSnapshot, type MaterializeValidationFailedError, type MaterializeWriteFailedError, type OpenProjectSessionInput, type ProjectOpenFailedError, type ProjectRootNotAllowedError, type QueryEntityInput, type RefreshCacheInput, type SavePartialFailureError, type SaveSessionInput, type SessionIdConflictError, type SessionNotFoundError, type SessionStaleWriteError, type TransactionPreviewError, type UamFidelityUnsupportedError, type ValidateSessionInput, createBackendStorageFileSystem, getBackendDiagnosticCatalog, getBackendDiagnosticGuide };
|
|
2513
|
+
export { type AdvisoryLockConflictError, type ApplySessionTransactionInput, BACKEND_CAPABILITY_SCHEMA_VERSION, BACKEND_COMPATIBILITY_POLICY, BACKEND_CONTRACT_VERSION, BACKEND_DIAGNOSTICS_URI, BACKEND_DIAGNOSTIC_TEMPLATE, BACKEND_ENTITY_QUERY_LIMITS, BACKEND_SESSION_READ_LIMITS, BACKEND_TRANSACTION_PREVIEW_LIMITS, type BackendArtifactBridgeCapability, type BackendAsyncStorageAdapter, type BackendCacheEntry, type BackendCacheSnapshot, type BackendCapabilities, type BackendCapabilityManifest, type BackendCapabilityUnavailableError, type BackendComponentSnapshot, type BackendDiagnostic, type BackendDiagnosticCode, type BackendDiagnosticGuide, type BackendDiagnosticOwner, type BackendDiagnosticRemediation, type BackendEntitySnapshot, type BackendEntityTarget, type BackendError, type BackendEvent, type BackendEventKind, type BackendFailure, type BackendFileStat, type BackendFileSystem, type BackendHostAdapter, type BackendJobErrors, type BackendJobKind, type BackendJobListSnapshot, type BackendJobListStatusFilter, type BackendJobNotCancellableError, type BackendJobNotFoundError, type BackendJobProgress, type BackendJobSnapshot, type BackendJobStatus, type BackendMessage, type BackendMethodName, type BackendPackageSnapshot, type BackendProjectOutline, type BackendProjectOutlinePackage, type BackendProjectOutlineResource, type BackendProjectSessionStorage, type BackendProjectSnapshot, type BackendResourceBytesSnapshot, type BackendResourceSnapshot, type BackendResponseMeta, type BackendResult, BackendRuntime, type BackendRuntimeOptions, type BackendSessionLock, type BackendSessionPackageModel, type BackendSessionProjectModel, type BackendSessionResourceModel, type BackendSessionSnapshot, type BackendSessionStateSnapshot, type BackendStage, type BackendStorageFileSystem, type BackendStorageStatLike, type BackendSuccess, type BackendTransactionEntityChange, type BackendTransactionPreview, type CacheRefreshFailedError, type CancelJobInput, type EntityQueryError, type EventCursorInvalidError, type GetCacheSnapshotInput, type GetEventsInput, type GetEventsSnapshot, type GetJobInput, type GetProjectOutlineInput, type InProcessLockConflictError, type ListJobsInput, type MaterializeSessionInput, type MaterializeSessionSnapshot, type MaterializeValidationFailedError, type MaterializeWriteFailedError, type OpenProjectSessionInput, type ProjectOpenFailedError, type ProjectRootNotAllowedError, type QueryEntityInput, type ReadResourceBytesInput, type ReadSessionStateInput, type RefreshCacheInput, type SavePartialFailureError, type SaveSessionInput, type SessionIdConflictError, type SessionNotFoundError, type SessionReadError, type SessionStaleReadError, type SessionStaleWriteError, type TransactionPreviewError, type UamFidelityUnsupportedError, type ValidateSessionInput, createBackendStorageFileSystem, getBackendDiagnosticCatalog, getBackendDiagnosticGuide };
|