@openfairygui/backend 0.5.0 → 0.6.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.
- package/README.md +3 -3
- package/dist/docs.cjs +190 -611
- package/dist/docs.d.cts +9 -27
- package/dist/docs.d.mts +9 -27
- package/dist/docs.mjs +190 -611
- package/dist/index.cjs +445 -635
- package/dist/index.d.cts +46 -160
- package/dist/index.d.mts +46 -160
- package/dist/index.mjs +445 -636
- package/dist/node.cjs +476 -664
- package/dist/node.d.cts +20 -94
- package/dist/node.d.mts +20 -94
- package/dist/node.mjs +476 -664
- package/package.json +3 -3
- package/src/contracts.ts +2 -2
- package/src/diagnostics.ts +4 -5
- package/src/generated/contracts.ts +208 -837
- package/src/generated/docs.ts +3 -3
- package/src/index.ts +2 -13
- package/src/node.ts +36 -30
- package/src/runtime/capabilities.ts +2 -12
- package/src/runtime/contracts.ts +33 -107
- package/src/runtime.ts +22 -57
- package/src/services/authoring-service.ts +9 -572
- package/src/services/cache-service.ts +32 -10
- package/src/services/context.ts +27 -14
- package/src/services/event-service.ts +10 -8
- package/src/services/persistence-service.ts +550 -0
- package/src/services/read-service.ts +18 -18
- package/src/services/runtime-service.ts +27 -36
- package/src/services/session-operation-queue.ts +21 -0
- package/src/services/session-project-writer.ts +3 -1
- package/src/services/session-registry.ts +70 -0
- package/src/services/session-utils.ts +4 -4
- package/src/services/job-service.ts +0 -238
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfairygui/backend",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "FairyGUI Headless Authoring SDK — stateful backend runtime and session services.",
|
|
5
5
|
"author": "OpenFairyGUI Contributors",
|
|
6
6
|
"license": "MIT",
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"runtime"
|
|
67
67
|
],
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@openfairygui/core": "0.
|
|
70
|
-
"@openfairygui/functions": "0.
|
|
69
|
+
"@openfairygui/core": "0.6.1",
|
|
70
|
+
"@openfairygui/functions": "0.6.1"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"ava": "^7.0.0",
|
package/src/contracts.ts
CHANGED
|
@@ -2,8 +2,8 @@ import type { ProjectDiagnosticCode } from '@openfairygui/core';
|
|
|
2
2
|
import type { UamTransactionSupportIssueCode } from '@openfairygui/core/uam';
|
|
3
3
|
import type { BackendError } from './runtime.js';
|
|
4
4
|
|
|
5
|
-
export const BACKEND_CONTRACT_VERSION = '
|
|
6
|
-
export const BACKEND_CAPABILITY_SCHEMA_VERSION =
|
|
5
|
+
export const BACKEND_CONTRACT_VERSION = '3.0.0' as const;
|
|
6
|
+
export const BACKEND_CAPABILITY_SCHEMA_VERSION = 12 as const;
|
|
7
7
|
export const BACKEND_COMPATIBILITY_POLICY = {
|
|
8
8
|
incompatibleChange: 'requires contractVersion bump',
|
|
9
9
|
capabilitySchemaChange: 'requires capabilitySchemaVersion bump',
|
package/src/diagnostics.ts
CHANGED
|
@@ -29,7 +29,6 @@ const project = { kind: 'host-action', message: "Inspect the project path and va
|
|
|
29
29
|
const capability = { kind: 'host-action', 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." } as const;
|
|
30
30
|
const write = { kind: 'host-action', message: "Preserve the dirty session and inspect the error, actual target files and permissions with the host. Partial writes may have changed files: verify or recover them before a newly authorized save. Do not clear dirty state, discard memory or blindly retry." } as const;
|
|
31
31
|
const execution = { kind: 'host-action', message: "Inspect the execution/cache failure and current session/revision. Preserve sources and unsaved work and report the cause to the host. Replan after resolution; failed execution or cache work is not a completed edit." } as const;
|
|
32
|
-
const job = { kind: 'host-action', message: "Inspect the job ID and status with getJob/listJobs. Do not fabricate, restart or force-cancel a missing, terminal or non-cancellable job. Ask the host before scheduling new work; cancellation is not success." } as const;
|
|
33
32
|
|
|
34
33
|
/** Exhaustiveness and exact ownership are checked against the canonical unions. */
|
|
35
34
|
export const BACKEND_DIAGNOSTIC_GUIDES = [
|
|
@@ -57,6 +56,10 @@ export const BACKEND_DIAGNOSTIC_GUIDES = [
|
|
|
57
56
|
kind: 'host-action',
|
|
58
57
|
message: 'Ask the host to confirm the runtime and project, recover any unsaved state, then explicitly open a new session if appropriate. Session IDs are runtime-local. Read its new revision and replan; never reuse an expired session or assume disk contains unsaved changes.',
|
|
59
58
|
} },
|
|
59
|
+
{ code: 'session_close_failed', owners: ['backend'], remediation: {
|
|
60
|
+
kind: 'host-action',
|
|
61
|
+
message: 'The session and lock ownership remain registered. Inspect the reported lock release failure, correct the storage problem, then retry closeSession with the same session ID. Do not remove the lock file or open a replacement session to bypass the owner.',
|
|
62
|
+
} },
|
|
60
63
|
{ code: 'path_policy_violation', owners: ['backend'], remediation: path },
|
|
61
64
|
{ code: 'project_root_not_allowed', owners: ['backend'], remediation: path },
|
|
62
65
|
{ code: 'invalid_package_selector', owners: ['core.transaction'], remediation: selector },
|
|
@@ -154,10 +157,6 @@ export const BACKEND_DIAGNOSTIC_GUIDES = [
|
|
|
154
157
|
{ code: 'project_open_failed', owners: ["backend"], remediation: project },
|
|
155
158
|
{ code: 'materialize_validation_failed', owners: ["backend"], remediation: project },
|
|
156
159
|
{ code: 'execution_failure', owners: ["core.transaction"], remediation: execution },
|
|
157
|
-
{ code: 'cache_refresh_failed', owners: ["backend"], remediation: execution },
|
|
158
|
-
{ code: 'job_not_found', owners: ["backend"], remediation: job },
|
|
159
|
-
{ code: 'job_not_cancellable', owners: ["backend"], remediation: job },
|
|
160
|
-
{ code: 'job_cancelled', owners: ["backend"], remediation: job },
|
|
161
160
|
] as const satisfies readonly BackendDiagnosticGuide[];
|
|
162
161
|
|
|
163
162
|
export const BACKEND_DIAGNOSTICS_URI = 'openfairygui://docs/diagnostics';
|