@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
@@ -1,131 +0,0 @@
1
- import {
2
- UAM_SUPPORTED_MATERIALIZATION_SCOPE,
3
- UAM_SUPPORTED_TRANSACTION_SCOPE,
4
- } from '@openfairygui/core/uam';
5
- import {
6
- BACKEND_CAPABILITY_SCHEMA_VERSION,
7
- BACKEND_COMPATIBILITY_POLICY,
8
- BACKEND_CONTRACT_VERSION,
9
- } from '../contracts.js';
10
- import { createRuntimePathPolicy } from '../path-policy.js';
11
- import { createArtifactCapabilities } from '../services/artifact-service.js';
12
- import type { BackendArtifactBridgeCapability, BackendCapabilities, BackendMethodName } from './contracts.js';
13
- import { BACKEND_ENTITY_QUERY_LIMITS, BACKEND_SESSION_READ_LIMITS, BACKEND_TRANSACTION_PREVIEW_LIMITS } from './contracts.js';
14
-
15
- export const BACKEND_METHODS = [
16
- 'getCapabilities',
17
- 'openSession',
18
- 'openProjectSession',
19
- 'getSession',
20
- 'getProjectOutline',
21
- 'queryEntity',
22
- 'readSessionState',
23
- 'readResourceBytes',
24
- 'validateSession',
25
- 'preflightTransaction',
26
- 'applyTransaction',
27
- 'saveSession',
28
- 'materializeSession',
29
- 'closeSession',
30
- 'getEvents',
31
- 'getCacheSnapshot',
32
- 'refreshCache',
33
- ] as const satisfies readonly BackendMethodName[];
34
-
35
- const ARTIFACT_BRIDGE_CAPABILITY = {
36
- available: false,
37
- requiredHost: 'node',
38
- executionBoundary: 'external-bridge',
39
- bridgeEntrypoint: '@openfairygui/backend/node',
40
- reason: 'publish/restore require explicit Node-hosted filesystem and artifact execution.',
41
- } as const satisfies BackendArtifactBridgeCapability;
42
-
43
- export function createCapabilities(atomicSave = false): BackendCapabilities {
44
- return {
45
- contractVersion: BACKEND_CONTRACT_VERSION,
46
- capabilitySchemaVersion: BACKEND_CAPABILITY_SCHEMA_VERSION,
47
- transactionKernelOwner: '@openfairygui/core',
48
- appSeamOwner: '@openfairygui/functions',
49
- runtimeOwner: '@openfairygui/backend',
50
- methods: BACKEND_METHODS,
51
- read: {
52
- capabilitySnapshot: true,
53
- sessionSnapshot: true,
54
- projectOutline: true,
55
- entityQuery: { kinds: ['project', 'package', 'resource', 'component', 'displayNode', 'controller', 'transition'], projection: 'properties', sourceBytes: false, limits: BACKEND_ENTITY_QUERY_LIMITS },
56
- sessionState: { sourceBytes: false, limits: BACKEND_SESSION_READ_LIMITS.model },
57
- resourceBytes: { expectedRevisionRequired: true, hydration: false, maxBytes: BACKEND_SESSION_READ_LIMITS.resourceBytes },
58
- projectValidation: true,
59
- },
60
- authoring: {
61
- preflightTransaction: { mode: 'execute-and-discard', reservesRevision: false, impact: 'model-diff', limits: BACKEND_TRANSACTION_PREVIEW_LIMITS },
62
- applyTransaction: true,
63
- saveSession: true,
64
- resourceKinds: [...UAM_SUPPORTED_MATERIALIZATION_SCOPE.resourceKinds],
65
- nodeKinds: [...UAM_SUPPORTED_MATERIALIZATION_SCOPE.nodeKinds],
66
- gearKinds: [...UAM_SUPPORTED_MATERIALIZATION_SCOPE.gearKinds],
67
- transactionScope: {
68
- resourceKinds: [...UAM_SUPPORTED_TRANSACTION_SCOPE.resourceKinds],
69
- nodeKinds: [...UAM_SUPPORTED_TRANSACTION_SCOPE.nodeKinds],
70
- gearKinds: [...UAM_SUPPORTED_TRANSACTION_SCOPE.gearKinds],
71
- },
72
- unsupported: ['artifact.publish', 'artifact.restore'],
73
- },
74
- artifact: createArtifactCapabilities(),
75
- manifest: {
76
- browserSafe: true,
77
- rootEntrypoint: '@openfairygui/backend',
78
- nodeEntrypoint: '@openfairygui/backend/node',
79
- adapters: {
80
- fileSystem: {
81
- injected: true,
82
- requiredFor: ['openSession', 'saveSession', 'materializeSession'],
83
- },
84
- projectStorage: {
85
- injected: true,
86
- browserSafe: true,
87
- requiredFor: ['openProjectSession.writeback', 'saveSession', 'materializeSession'],
88
- adapterFactory: 'createBackendStorageFileSystem',
89
- },
90
- host: {
91
- injected: true,
92
- requiredFor: ['advisoryLockMetadata'],
93
- },
94
- },
95
- executionBoundaries: {
96
- projectSession: 'in-process-browser-safe',
97
- fileBackedSession: 'adapter-backed',
98
- artifactPublish: ARTIFACT_BRIDGE_CAPABILITY,
99
- artifactRestore: ARTIFACT_BRIDGE_CAPABILITY,
100
- },
101
- diagnostics: {
102
- stableCodes: true,
103
- errorDiagnosticMirror: true,
104
- recoveryGuides: 'all-formal-codes',
105
- automaticRepair: false,
106
- },
107
- },
108
- compatibilityPolicy: BACKEND_COMPATIBILITY_POLICY,
109
- runtime: {
110
- sessionRuntime: true,
111
- advisoryLocking: true,
112
- coordinatedSave: true,
113
- atomicSave,
114
- staleRevisionProtection: true,
115
- pathPolicy: createRuntimePathPolicy(),
116
- events: {
117
- polling: true,
118
- subscriptions: false,
119
- retentionLimit: 1000,
120
- sequenceScope: 'runtime',
121
- },
122
- cache: {
123
- derivedReadOnly: true,
124
- keyedBy: 'sessionId',
125
- refreshMode: 'synchronous',
126
- sourceOfTruth: false,
127
- refreshMethod: 'refreshCache',
128
- },
129
- },
130
- };
131
- }