@fabricorg/platform 1.10.0 → 1.10.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 (209) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +31 -2
  3. package/dist/actions/index.cjs +45 -26
  4. package/dist/actions/index.cjs.map +1 -1
  5. package/dist/actions/index.d.cts +225 -226
  6. package/dist/actions/index.d.ts +225 -226
  7. package/dist/actions/index.js +41 -2
  8. package/dist/actions/index.js.map +1 -1
  9. package/dist/adapters/index.cjs +696 -66
  10. package/dist/adapters/index.cjs.map +1 -1
  11. package/dist/adapters/index.d.cts +367 -365
  12. package/dist/adapters/index.d.ts +367 -365
  13. package/dist/adapters/index.js +682 -2
  14. package/dist/adapters/index.js.map +1 -1
  15. package/dist/agent-hitl/index.cjs +21 -10
  16. package/dist/agent-hitl/index.cjs.map +1 -1
  17. package/dist/agent-hitl/index.d.cts +30 -30
  18. package/dist/agent-hitl/index.d.ts +30 -30
  19. package/dist/agent-hitl/index.js +21 -2
  20. package/dist/agent-hitl/index.js.map +1 -1
  21. package/dist/certification/index.cjs +109 -24
  22. package/dist/certification/index.cjs.map +1 -1
  23. package/dist/certification/index.d.cts +33 -39
  24. package/dist/certification/index.d.ts +33 -39
  25. package/dist/certification/index.js +107 -8
  26. package/dist/certification/index.js.map +1 -1
  27. package/dist/discovery/index.cjs +12 -10
  28. package/dist/discovery/index.cjs.map +1 -1
  29. package/dist/discovery/index.d.cts +2 -10
  30. package/dist/discovery/index.d.ts +2 -10
  31. package/dist/discovery/index.js +12 -2
  32. package/dist/discovery/index.js.map +1 -1
  33. package/dist/engine-B4csEOEc.js +223 -0
  34. package/dist/engine-B4csEOEc.js.map +1 -0
  35. package/dist/engine-BqScuhrT.cjs +246 -0
  36. package/dist/engine-BqScuhrT.cjs.map +1 -0
  37. package/dist/events/index.cjs +39 -10
  38. package/dist/events/index.cjs.map +1 -1
  39. package/dist/events/index.d.cts +43 -43
  40. package/dist/events/index.d.ts +43 -43
  41. package/dist/events/index.js +39 -2
  42. package/dist/events/index.js.map +1 -1
  43. package/dist/evidence/index.cjs +12 -50
  44. package/dist/evidence/index.d.cts +2 -229
  45. package/dist/evidence/index.d.ts +2 -229
  46. package/dist/evidence/index.js +1 -5
  47. package/dist/evidence-BuCICb0c.js +516 -0
  48. package/dist/evidence-BuCICb0c.js.map +1 -0
  49. package/dist/evidence-Cq48eDvA.cjs +575 -0
  50. package/dist/evidence-Cq48eDvA.cjs.map +1 -0
  51. package/dist/governance/index.cjs +24 -18
  52. package/dist/governance/index.cjs.map +1 -1
  53. package/dist/governance/index.d.cts +80 -83
  54. package/dist/governance/index.d.ts +80 -83
  55. package/dist/governance/index.js +22 -2
  56. package/dist/governance/index.js.map +1 -1
  57. package/dist/ids/index.cjs +52 -22
  58. package/dist/ids/index.cjs.map +1 -1
  59. package/dist/ids/index.d.cts +17 -17
  60. package/dist/ids/index.d.ts +17 -17
  61. package/dist/ids/index.js +49 -2
  62. package/dist/ids/index.js.map +1 -1
  63. package/dist/index-9jasmw76.d.cts +124 -0
  64. package/dist/index-BXpeFdk2.d.cts +190 -0
  65. package/dist/index-BXpeFdk2.d.ts +190 -0
  66. package/dist/index-BnbsKZsT.d.cts +231 -0
  67. package/dist/index-CIl1rYRv.d.cts +11 -0
  68. package/dist/index-CIl1rYRv.d.ts +11 -0
  69. package/dist/index-CVHA1ypT.d.cts +262 -0
  70. package/dist/index-DZ4mnNb7.d.cts +78 -0
  71. package/dist/index-DZ4mnNb7.d.ts +78 -0
  72. package/dist/index-IqcDvl69.d.ts +124 -0
  73. package/dist/index-fmUiRBXu.d.cts +57 -0
  74. package/dist/index-fmUiRBXu.d.ts +57 -0
  75. package/dist/index-sPUPs8pr.d.ts +262 -0
  76. package/dist/index-z9-CYOIo.d.ts +231 -0
  77. package/dist/index.cjs +111 -393
  78. package/dist/index.d.cts +18 -17
  79. package/dist/index.d.ts +18 -17
  80. package/dist/index.js +19 -20
  81. package/dist/manifest/index.cjs +224 -35
  82. package/dist/manifest/index.cjs.map +1 -1
  83. package/dist/manifest/index.d.cts +130 -131
  84. package/dist/manifest/index.d.ts +130 -131
  85. package/dist/manifest/index.js +219 -7
  86. package/dist/manifest/index.js.map +1 -1
  87. package/dist/modules/index.cjs +281 -42
  88. package/dist/modules/index.cjs.map +1 -1
  89. package/dist/modules/index.d.cts +157 -159
  90. package/dist/modules/index.d.ts +157 -159
  91. package/dist/modules/index.js +274 -6
  92. package/dist/modules/index.js.map +1 -1
  93. package/dist/objects/index.cjs +355 -22
  94. package/dist/objects/index.cjs.map +1 -1
  95. package/dist/objects/index.d.cts +2 -77
  96. package/dist/objects/index.d.ts +2 -77
  97. package/dist/objects/index.js +352 -2
  98. package/dist/objects/index.js.map +1 -1
  99. package/dist/policies/index.cjs +14 -56
  100. package/dist/policies/index.d.cts +2 -261
  101. package/dist/policies/index.d.ts +2 -261
  102. package/dist/policies/index.js +1 -3
  103. package/dist/policies-DH_GCXQ-.js +627 -0
  104. package/dist/policies-DH_GCXQ-.js.map +1 -0
  105. package/dist/policies-Nxbp1CH8.cjs +698 -0
  106. package/dist/policies-Nxbp1CH8.cjs.map +1 -0
  107. package/dist/privacy/index.cjs +26 -43
  108. package/dist/privacy/index.cjs.map +1 -1
  109. package/dist/privacy/index.d.cts +2 -189
  110. package/dist/privacy/index.d.ts +2 -189
  111. package/dist/privacy/index.js +18 -3
  112. package/dist/privacy/index.js.map +1 -1
  113. package/dist/projections/index.cjs +241 -23
  114. package/dist/projections/index.cjs.map +1 -1
  115. package/dist/projections/index.d.cts +2 -125
  116. package/dist/projections/index.d.ts +2 -125
  117. package/dist/projections/index.js +238 -3
  118. package/dist/projections/index.js.map +1 -1
  119. package/dist/state-machines/index.cjs +76 -18
  120. package/dist/state-machines/index.cjs.map +1 -1
  121. package/dist/state-machines/index.d.cts +2 -55
  122. package/dist/state-machines/index.d.ts +2 -55
  123. package/dist/state-machines/index.js +74 -2
  124. package/dist/state-machines/index.js.map +1 -1
  125. package/dist/testing/index.cjs +27 -19
  126. package/dist/testing/index.cjs.map +1 -1
  127. package/dist/testing/index.d.cts +17 -19
  128. package/dist/testing/index.d.ts +17 -19
  129. package/dist/testing/index.js +25 -3
  130. package/dist/testing/index.js.map +1 -1
  131. package/package.json +6 -5
  132. package/dist/chunk-2AE6TMAX.cjs +0 -44
  133. package/dist/chunk-2AE6TMAX.cjs.map +0 -1
  134. package/dist/chunk-6HY35TKB.cjs +0 -491
  135. package/dist/chunk-6HY35TKB.cjs.map +0 -1
  136. package/dist/chunk-6UGEIDLC.cjs +0 -26
  137. package/dist/chunk-6UGEIDLC.cjs.map +0 -1
  138. package/dist/chunk-7GAWSUOG.js +0 -64
  139. package/dist/chunk-7GAWSUOG.js.map +0 -1
  140. package/dist/chunk-A42JJIPL.cjs +0 -699
  141. package/dist/chunk-A42JJIPL.cjs.map +0 -1
  142. package/dist/chunk-AFXKSIVI.cjs +0 -540
  143. package/dist/chunk-AFXKSIVI.cjs.map +0 -1
  144. package/dist/chunk-B5DOGDPG.js +0 -42
  145. package/dist/chunk-B5DOGDPG.js.map +0 -1
  146. package/dist/chunk-BJGZE3GE.js +0 -20
  147. package/dist/chunk-BJGZE3GE.js.map +0 -1
  148. package/dist/chunk-CRZXTZ36.cjs +0 -258
  149. package/dist/chunk-CRZXTZ36.cjs.map +0 -1
  150. package/dist/chunk-D4SWRBUH.cjs +0 -22
  151. package/dist/chunk-D4SWRBUH.cjs.map +0 -1
  152. package/dist/chunk-DBTAUI6C.cjs +0 -395
  153. package/dist/chunk-DBTAUI6C.cjs.map +0 -1
  154. package/dist/chunk-EMSAFNPX.js +0 -98
  155. package/dist/chunk-EMSAFNPX.js.map +0 -1
  156. package/dist/chunk-F3E5SXPN.cjs +0 -28
  157. package/dist/chunk-F3E5SXPN.cjs.map +0 -1
  158. package/dist/chunk-HEYMMVDP.js +0 -480
  159. package/dist/chunk-HEYMMVDP.js.map +0 -1
  160. package/dist/chunk-IFW43ELT.cjs +0 -331
  161. package/dist/chunk-IFW43ELT.cjs.map +0 -1
  162. package/dist/chunk-LFE74IJX.js +0 -20
  163. package/dist/chunk-LFE74IJX.js.map +0 -1
  164. package/dist/chunk-LZSE6QGQ.cjs +0 -60
  165. package/dist/chunk-LZSE6QGQ.cjs.map +0 -1
  166. package/dist/chunk-MCWSUGB3.cjs +0 -102
  167. package/dist/chunk-MCWSUGB3.cjs.map +0 -1
  168. package/dist/chunk-MLBALEUR.js +0 -290
  169. package/dist/chunk-MLBALEUR.js.map +0 -1
  170. package/dist/chunk-NNXQZPB3.cjs +0 -31
  171. package/dist/chunk-NNXQZPB3.cjs.map +0 -1
  172. package/dist/chunk-OFCCZ27Z.js +0 -26
  173. package/dist/chunk-OFCCZ27Z.js.map +0 -1
  174. package/dist/chunk-PDN5DOLQ.js +0 -242
  175. package/dist/chunk-PDN5DOLQ.js.map +0 -1
  176. package/dist/chunk-PIDZQAEL.js +0 -50
  177. package/dist/chunk-PIDZQAEL.js.map +0 -1
  178. package/dist/chunk-PXD7NG6X.js +0 -686
  179. package/dist/chunk-PXD7NG6X.js.map +0 -1
  180. package/dist/chunk-Q4Q4JPR3.js +0 -524
  181. package/dist/chunk-Q4Q4JPR3.js.map +0 -1
  182. package/dist/chunk-RALMUSOX.js +0 -55
  183. package/dist/chunk-RALMUSOX.js.map +0 -1
  184. package/dist/chunk-SNTV45LH.cjs +0 -295
  185. package/dist/chunk-SNTV45LH.cjs.map +0 -1
  186. package/dist/chunk-TBS2S5AX.cjs +0 -40
  187. package/dist/chunk-TBS2S5AX.cjs.map +0 -1
  188. package/dist/chunk-TYNIFC7J.js +0 -253
  189. package/dist/chunk-TYNIFC7J.js.map +0 -1
  190. package/dist/chunk-UGWGHTNC.cjs +0 -56
  191. package/dist/chunk-UGWGHTNC.cjs.map +0 -1
  192. package/dist/chunk-WI7CWNYI.cjs +0 -68
  193. package/dist/chunk-WI7CWNYI.cjs.map +0 -1
  194. package/dist/chunk-WNZP53GI.js +0 -386
  195. package/dist/chunk-WNZP53GI.js.map +0 -1
  196. package/dist/chunk-WQ3BYI7T.cjs +0 -249
  197. package/dist/chunk-WQ3BYI7T.cjs.map +0 -1
  198. package/dist/chunk-Y2PJLRIY.js +0 -36
  199. package/dist/chunk-Y2PJLRIY.js.map +0 -1
  200. package/dist/chunk-ZAEVQSB5.js +0 -326
  201. package/dist/chunk-ZAEVQSB5.js.map +0 -1
  202. package/dist/chunk-ZMQTV5OJ.js +0 -27
  203. package/dist/chunk-ZMQTV5OJ.js.map +0 -1
  204. package/dist/evidence/index.cjs.map +0 -1
  205. package/dist/evidence/index.js.map +0 -1
  206. package/dist/index.cjs.map +0 -1
  207. package/dist/index.js.map +0 -1
  208. package/dist/policies/index.cjs.map +0 -1
  209. package/dist/policies/index.js.map +0 -1
@@ -1,249 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkDBTAUI6C_cjs = require('./chunk-DBTAUI6C.cjs');
4
- var chunkD4SWRBUH_cjs = require('./chunk-D4SWRBUH.cjs');
5
-
6
- // manifest/index.ts
7
- var MODULE_MANIFEST_VERSION = 2;
8
- function normalizeModuleManifest(manifest) {
9
- const version = manifest.manifestVersion;
10
- if (version !== 1 && version !== MODULE_MANIFEST_VERSION) {
11
- throw new Error(`Unsupported module manifest version: ${String(version)}`);
12
- }
13
- const views = "views" in manifest && Array.isArray(manifest.views) ? manifest.views : [];
14
- if (Array.isArray(manifest.actions))
15
- for (const [index, action] of manifest.actions.entries())
16
- chunkD4SWRBUH_cjs.assertSurfaceDeclaration(action, `Module "${manifest.namespace}" action[${index}] "${action?.actionId ?? "unknown"}"`);
17
- for (const [index, view] of views.entries())
18
- chunkD4SWRBUH_cjs.assertSurfaceDeclaration(view, `Module "${manifest.namespace}" view[${index}] "${view?.name ?? "unknown"}"`);
19
- return {
20
- ...manifest,
21
- manifestVersion: MODULE_MANIFEST_VERSION,
22
- views
23
- };
24
- }
25
- function normalizeModuleManifestBundle(bundle) {
26
- const version = bundle.manifestVersion;
27
- if (version !== 1 && version !== MODULE_MANIFEST_VERSION) {
28
- throw new Error(`Unsupported module manifest bundle version: ${String(version)}`);
29
- }
30
- return {
31
- manifestVersion: MODULE_MANIFEST_VERSION,
32
- modules: bundle.modules.map((manifest) => normalizeModuleManifest(manifest))
33
- };
34
- }
35
- function isJsonSchemaExportableValidator(schema) {
36
- return typeof schema.toJSONSchema === "function";
37
- }
38
- function isRecord(value) {
39
- return value !== null && typeof value === "object" && !Array.isArray(value);
40
- }
41
- function exportDependency(dependency) {
42
- const namespace = chunkDBTAUI6C_cjs.getModuleDependencyNamespace(dependency);
43
- if (typeof dependency === "string") {
44
- return { namespace };
45
- }
46
- const normalized = { namespace };
47
- if (dependency.version !== void 0) normalized.version = dependency.version;
48
- if (dependency.optional !== void 0) normalized.optional = dependency.optional;
49
- return normalized;
50
- }
51
- function exportObjectType(objectType) {
52
- if (typeof objectType === "string") {
53
- return { type: objectType };
54
- }
55
- const normalized = { type: chunkDBTAUI6C_cjs.getObjectTypeName(objectType) };
56
- if (objectType.displayName !== void 0) normalized.displayName = objectType.displayName;
57
- if (objectType.idPrefix !== void 0) normalized.idPrefix = objectType.idPrefix;
58
- if (objectType.schema !== void 0) normalized.schema = cloneJson(objectType.schema);
59
- if (objectType.semantics !== void 0) normalized.semantics = cloneJson(objectType.semantics);
60
- if (objectType.relations !== void 0) {
61
- normalized.relations = objectType.relations.map((relation) => ({ ...relation }));
62
- }
63
- if (objectType.invariants !== void 0) {
64
- normalized.invariants = objectType.invariants.map((invariant) => ({ ...invariant }));
65
- }
66
- return normalized;
67
- }
68
- function cloneJson(value) {
69
- if (Array.isArray(value)) return value.map((item) => cloneJson(item));
70
- if (value !== null && typeof value === "object") {
71
- return Object.fromEntries(
72
- Object.entries(value).map(([key, child]) => [key, cloneJson(child)])
73
- );
74
- }
75
- return value;
76
- }
77
- function exportEventType(eventType) {
78
- if (typeof eventType === "string") {
79
- return { eventType, schemaVersion: 1 };
80
- }
81
- const normalized = {
82
- eventType: chunkDBTAUI6C_cjs.getEventTypeName(eventType),
83
- schemaVersion: eventType.schemaVersion
84
- };
85
- if (eventType.description !== void 0) normalized.description = eventType.description;
86
- if (eventType.schema !== void 0) normalized.schema = cloneJson(eventType.schema);
87
- return normalized;
88
- }
89
- function exportAction(action) {
90
- chunkD4SWRBUH_cjs.assertSurfaceDeclaration(action, `Action "${action?.actionId ?? "unknown"}"`);
91
- const manifest = {
92
- actionId: action.actionId,
93
- version: action.version,
94
- kind: action.kind ?? "atomic",
95
- idempotent: action.idempotent,
96
- mutatesDomain: action.mutatesDomain,
97
- emitsEvents: [...action.emitsEvents]
98
- };
99
- if (action.surface !== void 0) manifest.surface = action.surface;
100
- if (action.surfaceReason !== void 0) manifest.surfaceReason = action.surfaceReason;
101
- if (action.policies !== void 0) manifest.policies = [...action.policies];
102
- if (action.requiredRoles !== void 0) manifest.requiredRoles = [...action.requiredRoles];
103
- if (action.requiredPermissions !== void 0) {
104
- manifest.requiredPermissions = [...action.requiredPermissions];
105
- }
106
- if (action.eventPhase !== void 0) manifest.eventPhase = action.eventPhase;
107
- if (action.execution !== void 0) manifest.execution = cloneJson(action.execution);
108
- if (isJsonSchemaExportableValidator(action.schema)) {
109
- try {
110
- manifest.parameterSchema = action.schema.toJSONSchema();
111
- manifest.parameterSchemaFormat = "json-schema";
112
- } catch {
113
- }
114
- }
115
- if (action.resultSchema && isJsonSchemaExportableValidator(action.resultSchema)) {
116
- try {
117
- manifest.resultSchema = action.resultSchema.toJSONSchema();
118
- manifest.resultSchemaFormat = "json-schema";
119
- } catch {
120
- }
121
- }
122
- if (action.stateMachine !== void 0) {
123
- const binding = {
124
- entityType: action.stateMachine.entityType
125
- };
126
- if (typeof action.stateMachine.targetState === "string") {
127
- binding.targetState = action.stateMachine.targetState;
128
- }
129
- manifest.stateMachine = binding;
130
- }
131
- if (action.adapterSteps !== void 0) {
132
- manifest.adapterSteps = action.adapterSteps.map((step) => {
133
- const exported = {
134
- adapterType: step.adapterType,
135
- operation: step.operation
136
- };
137
- if (step.retryPolicy !== void 0) exported.retryPolicy = { ...step.retryPolicy };
138
- return exported;
139
- });
140
- }
141
- return manifest;
142
- }
143
- function exportPolicy(policy) {
144
- if (!isRecord(policy) || typeof policy.policyId !== "string") {
145
- return void 0;
146
- }
147
- if (typeof policy.evaluate === "function") {
148
- const exported = {
149
- type: "code",
150
- policyId: policy.policyId,
151
- version: typeof policy.version === "number" ? policy.version : 1
152
- };
153
- if (typeof policy.previewSafe === "boolean") exported.previewSafe = policy.previewSafe;
154
- return exported;
155
- }
156
- if (typeof policy.kind === "string" && typeof policy.policyVersion === "number") {
157
- const exported = {
158
- type: "data",
159
- policyId: policy.policyId,
160
- policyVersion: policy.policyVersion,
161
- kind: policy.kind
162
- };
163
- if (isRecord(policy.dataDefinition)) {
164
- exported.dataDefinition = policy.dataDefinition;
165
- }
166
- if (typeof policy.codeEvaluatorPolicyId === "string") {
167
- exported.codeEvaluatorPolicyId = policy.codeEvaluatorPolicyId;
168
- }
169
- if (isRecord(policy.fallback)) {
170
- exported.fallback = policy.fallback;
171
- }
172
- return exported;
173
- }
174
- return void 0;
175
- }
176
- function exportStateMachine(machine) {
177
- if (!isRecord(machine) || typeof machine.entityType !== "string" || !isRecord(machine.states) || !Array.isArray(machine.transitions)) {
178
- return void 0;
179
- }
180
- const definition = machine;
181
- return {
182
- entityType: definition.entityType,
183
- states: Object.values(definition.states),
184
- transitions: definition.transitions.map((transition) => ({
185
- from: transition.from,
186
- to: transition.to,
187
- causedByAction: transition.causedByAction,
188
- hasGuard: typeof transition.guard === "function"
189
- }))
190
- };
191
- }
192
- function exportView(view) {
193
- chunkD4SWRBUH_cjs.assertSurfaceDeclaration(view, `View "${view?.name ?? "unknown"}"`);
194
- const output = {
195
- name: view.name,
196
- version: view.version,
197
- shape: cloneJson(view.shape),
198
- consumes: view.consumes.map((consumption) => ({
199
- eventType: consumption.eventType,
200
- schemaVersions: [...consumption.schemaVersions]
201
- })),
202
- scope: view.scope,
203
- snapshotVersion: view.snapshotVersion
204
- };
205
- if (view.surface !== void 0) output.surface = view.surface;
206
- if (view.surfaceReason !== void 0) output.surfaceReason = view.surfaceReason;
207
- if (view.parameterSchema !== void 0) output.parameterSchema = cloneJson(view.parameterSchema);
208
- if (view.compatibleSnapshotVersions) output.compatibleSnapshotVersions = [...view.compatibleSnapshotVersions];
209
- if (view.usage) output.usage = cloneJson(view.usage);
210
- return output;
211
- }
212
- function exportModuleManifest(module) {
213
- const manifest = {
214
- manifestVersion: MODULE_MANIFEST_VERSION,
215
- namespace: module.namespace,
216
- dependencies: (module.dependencies ?? []).map(exportDependency),
217
- objectTypes: (module.objectTypes ?? []).map(exportObjectType),
218
- subjectTypes: [...module.subjectTypes ?? []],
219
- idPrefixes: (module.idPrefixes ?? []).map((registration) => ({
220
- prefix: registration.prefix,
221
- name: registration.name
222
- })),
223
- eventTypes: (module.eventTypes ?? []).map(exportEventType),
224
- actions: (module.actions ?? []).map(exportAction),
225
- policies: (module.policies ?? []).map(exportPolicy).filter((policy) => policy !== void 0),
226
- stateMachines: (module.stateMachines ?? []).map(exportStateMachine).filter((machine) => machine !== void 0),
227
- views: (module.views ?? []).map(exportView)
228
- };
229
- if (module.version !== void 0) manifest.version = module.version;
230
- if (module.displayName !== void 0) manifest.displayName = module.displayName;
231
- if (module.description !== void 0) manifest.description = module.description;
232
- if (module.capability !== void 0) manifest.capability = cloneJson(module.capability);
233
- return manifest;
234
- }
235
- function exportModuleManifestBundle(modules) {
236
- return {
237
- manifestVersion: MODULE_MANIFEST_VERSION,
238
- modules: modules.map(exportModuleManifest)
239
- };
240
- }
241
-
242
- exports.MODULE_MANIFEST_VERSION = MODULE_MANIFEST_VERSION;
243
- exports.exportModuleManifest = exportModuleManifest;
244
- exports.exportModuleManifestBundle = exportModuleManifestBundle;
245
- exports.isJsonSchemaExportableValidator = isJsonSchemaExportableValidator;
246
- exports.normalizeModuleManifest = normalizeModuleManifest;
247
- exports.normalizeModuleManifestBundle = normalizeModuleManifestBundle;
248
- //# sourceMappingURL=chunk-WQ3BYI7T.cjs.map
249
- //# sourceMappingURL=chunk-WQ3BYI7T.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../manifest/index.ts"],"names":["assertSurfaceDeclaration","getModuleDependencyNamespace","getObjectTypeName","getEventTypeName"],"mappings":";;;;;;AA+BO,IAAM,uBAAA,GAA0B;AAkKhC,SAAS,wBACf,QAAA,EACiB;AACjB,EAAA,MAAM,UAAkB,QAAA,CAAS,eAAA;AACjC,EAAA,IAAI,OAAA,KAAY,CAAA,IAAK,OAAA,KAAY,uBAAA,EAAyB;AACzD,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,qCAAA,EAAwC,MAAA,CAAO,OAAO,CAAC,CAAA,CAAE,CAAA;AAAA,EAC1E;AACA,EAAA,MAAM,KAAA,GAAQ,OAAA,IAAW,QAAA,IAAY,KAAA,CAAM,OAAA,CAAQ,SAAS,KAAK,CAAA,GAAI,QAAA,CAAS,KAAA,GAAQ,EAAC;AAEvF,EAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,QAAA,CAAS,OAAO,CAAA;AACjC,IAAA,KAAA,MAAW,CAAC,KAAA,EAAO,MAAM,CAAA,IAAK,QAAA,CAAS,QAAQ,OAAA,EAAQ;AACtD,MAAAA,0CAAA,CAAyB,MAAA,EAAQ,CAAA,QAAA,EAAW,QAAA,CAAS,SAAS,CAAA,SAAA,EAAY,KAAK,CAAA,GAAA,EAAM,MAAA,EAAQ,QAAA,IAAY,SAAS,CAAA,CAAA,CAAG,CAAA;AACvH,EAAA,KAAA,MAAW,CAAC,KAAA,EAAO,IAAI,CAAA,IAAK,MAAM,OAAA,EAAQ;AACzC,IAAAA,0CAAA,CAAyB,IAAA,EAAM,CAAA,QAAA,EAAW,QAAA,CAAS,SAAS,CAAA,OAAA,EAAU,KAAK,CAAA,GAAA,EAAM,IAAA,EAAM,IAAA,IAAQ,SAAS,CAAA,CAAA,CAAG,CAAA;AAC5G,EAAA,OAAO;AAAA,IACN,GAAG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,WAAA;AACpE,EAAA,IAAI,OAAO,UAAA,KAAe,MAAA,WAAoB,UAAA,GAAa,SAAA,CAAU,OAAO,UAAU,CAAA;AAEtF,EAAA,OAAO,QAAA;AACR;AAMO,SAAS,2BACf,OAAA,EACuB;AACvB,EAAA,OAAO;AAAA,IACN,eAAA,EAAiB,uBAAA;AAAA,IACjB,OAAA,EAAS,OAAA,CAAQ,GAAA,CAAI,oBAAoB;AAAA,GAC1C;AACD","file":"chunk-WQ3BYI7T.cjs","sourcesContent":["import { assertSurfaceDeclaration, type SurfaceDeclaration } from \"../discovery\";\nimport type {\n\tActionExecutionContract,\n\tActionDefinition,\n\tAdapterStepRetryPolicy,\n\tSchemaValidator,\n} from \"../actions\";\nimport {\n\tgetEventTypeName,\n\tgetModuleDependencyNamespace,\n\tgetObjectTypeName,\n\ttype FabricModule,\n\ttype CapabilityMetadata,\n\ttype DeclarativeInvariant,\n\ttype ModuleDependency,\n\ttype ModuleDependencyInput,\n\ttype ObjectRelationDefinition,\n} from \"../modules\";\nimport type { JsonValue, PortableJsonSchema } from \"../objects\";\nimport type {\n\tDataPolicyDefinition,\n\tPolicyFallbackDefinition,\n\tPolicyKind,\n} from \"../policies\";\nimport type { StateDefinition, StateMachineDefinition } from \"../state-machines\";\nimport type { ViewContract } from \"../projections\";\n\n/**\n * Version of the module manifest contract. Bump when the serialized shape\n * changes in a way consumers must detect.\n */\nexport const MODULE_MANIFEST_VERSION = 2 as const;\n\nexport interface ModuleManifestObjectType {\n\ttype: string;\n\tdisplayName?: string;\n\tidPrefix?: string;\n\tschema?: PortableJsonSchema;\n\tsemantics?: Record<string, JsonValue>;\n\trelations?: ObjectRelationDefinition[];\n\tinvariants?: DeclarativeInvariant[];\n}\n\nexport interface ModuleManifestIdPrefix {\n\tprefix: string;\n\tname: string;\n}\n\nexport interface ModuleManifestEventType {\n\teventType: string;\n\tschemaVersion: number;\n\tdescription?: string;\n\tschema?: PortableJsonSchema;\n}\n\nexport interface ModuleManifestActionStateMachine {\n\tentityType: string;\n\t/** Present only when the binding declares a static target state. */\n\ttargetState?: string;\n}\n\nexport interface ModuleManifestAdapterStep {\n\tadapterType: string;\n\toperation: string;\n\tretryPolicy?: AdapterStepRetryPolicy;\n}\n\nexport interface ModuleManifestAction extends SurfaceDeclaration {\n\tactionId: string;\n\tversion: number;\n\tkind: \"atomic\" | \"saga\";\n\tidempotent: boolean;\n\tmutatesDomain: boolean;\n\temitsEvents: string[];\n\tpolicies?: string[];\n\trequiredRoles?: string[];\n\trequiredPermissions?: string[];\n\teventPhase?: \"before_adapters\" | \"after_adapters\";\n\texecution?: ActionExecutionContract;\n\t/**\n\t * JSON Schema for the action parameters, present only when the action's\n\t * `schema` validator implements {@link JsonSchemaExportableValidator}.\n\t */\n\tparameterSchema?: unknown;\n\tparameterSchemaFormat?: \"json-schema\";\n\tresultSchema?: unknown;\n\tresultSchemaFormat?: \"json-schema\";\n\tstateMachine?: ModuleManifestActionStateMachine;\n\tadapterSteps?: ModuleManifestAdapterStep[];\n}\n\nexport interface ModuleManifestCodePolicy {\n\ttype: \"code\";\n\tpolicyId: string;\n\tversion: number;\n\tpreviewSafe?: boolean;\n}\n\nexport interface ModuleManifestDataPolicy {\n\ttype: \"data\";\n\tpolicyId: string;\n\tpolicyVersion: number;\n\tkind: PolicyKind;\n\tdataDefinition?: DataPolicyDefinition;\n\tcodeEvaluatorPolicyId?: string;\n\tfallback?: PolicyFallbackDefinition;\n}\n\nexport type ModuleManifestPolicy = ModuleManifestCodePolicy | ModuleManifestDataPolicy;\n\nexport interface ModuleManifestStateMachineTransition {\n\tfrom: string;\n\tto: string;\n\tcausedByAction: string;\n\t/** `true` when the transition declares a guard function. The guard itself is never serialized. */\n\thasGuard: boolean;\n}\n\nexport interface ModuleManifestStateMachine {\n\tentityType: string;\n\t/** States in declaration order (`Object.values` order of the definition record). */\n\tstates: StateDefinition[];\n\ttransitions: ModuleManifestStateMachineTransition[];\n}\n\nexport interface ModuleManifestView extends SurfaceDeclaration {\n\tname: string;\n\tversion: string;\n\tshape: PortableJsonSchema;\n\tparameterSchema?: PortableJsonSchema;\n\tconsumes: Array<{ eventType: string; schemaVersions: number[] }>;\n\tscope: \"tenant-space\";\n\tsnapshotVersion: number;\n\tcompatibleSnapshotVersions?: number[];\n\tusage?: ViewContract[\"usage\"];\n}\n\n/**\n * Stable, JSON-serializable description of a {@link FabricModule}'s ontology:\n * object types, subject types, id prefixes, event types, actions, policies,\n * and state machines. Intended for downstream tooling (semantics exporters,\n * docs generators, tool generators) that cannot consume live module code.\n *\n * The manifest contains definitions only — never raw parameter values,\n * secrets, or runtime data. Function fields (`handler`, `evaluate`, `guard`,\n * dynamic `targetState`, adapter `getInput`) are never serialized.\n */\nexport interface ModuleManifest {\n\tmanifestVersion: typeof MODULE_MANIFEST_VERSION;\n\tnamespace: string;\n\tversion?: string;\n\tdisplayName?: string;\n\tdescription?: string;\n\tcapability?: CapabilityMetadata;\n\tdependencies: ModuleDependency[];\n\tobjectTypes: ModuleManifestObjectType[];\n\tsubjectTypes: string[];\n\tidPrefixes: ModuleManifestIdPrefix[];\n\teventTypes: ModuleManifestEventType[];\n\tactions: ModuleManifestAction[];\n\tpolicies: ModuleManifestPolicy[];\n\tstateMachines: ModuleManifestStateMachine[];\n\tviews: ModuleManifestView[];\n}\n\nexport interface ModuleManifestBundle {\n\tmanifestVersion: typeof MODULE_MANIFEST_VERSION;\n\t/** Manifests in the input module order. */\n\tmodules: ModuleManifest[];\n}\n\n/** Manifest v1 remains accepted by v2 readers; missing v2 fields normalize to absence. */\nexport type ModuleManifestObjectTypeV1 = Omit<\n\tModuleManifestObjectType,\n\t\"schema\" | \"semantics\" | \"relations\" | \"invariants\"\n>;\nexport type ModuleManifestActionV1 = Omit<\n\tModuleManifestAction,\n\t\"resultSchema\" | \"resultSchemaFormat\"\n>;\nexport type ModuleManifestV1 = Omit<\n\tModuleManifest,\n\t\"manifestVersion\" | \"objectTypes\" | \"actions\" | \"views\"\n> & {\n\tmanifestVersion: 1;\n\tobjectTypes: ModuleManifestObjectTypeV1[];\n\tactions: ModuleManifestActionV1[];\n};\nexport type ModuleManifestBundleV1 = Omit<ModuleManifestBundle, \"manifestVersion\" | \"modules\"> & {\n\tmanifestVersion: 1;\n\tmodules: ModuleManifestV1[];\n};\n\nexport function normalizeModuleManifest(\n\tmanifest: ModuleManifest | ModuleManifestV1,\n): ModuleManifest {\n\tconst version: number = manifest.manifestVersion;\n\tif (version !== 1 && version !== MODULE_MANIFEST_VERSION) {\n\t\tthrow new Error(`Unsupported module manifest version: ${String(version)}`);\n\t}\n\tconst views = \"views\" in manifest && Array.isArray(manifest.views) ? manifest.views : [];\n\t// Preserve the normalizer's legacy tolerance for absent/non-array fields.\n\tif (Array.isArray(manifest.actions))\n\t\tfor (const [index, action] of manifest.actions.entries())\n\t\t\tassertSurfaceDeclaration(action, `Module \"${manifest.namespace}\" action[${index}] \"${action?.actionId ?? \"unknown\"}\"`);\n\tfor (const [index, view] of views.entries())\n\t\tassertSurfaceDeclaration(view, `Module \"${manifest.namespace}\" view[${index}] \"${view?.name ?? \"unknown\"}\"`);\n\treturn {\n\t\t...manifest,\n\t\tmanifestVersion: MODULE_MANIFEST_VERSION,\n\t\tviews,\n\t};\n}\n\nexport function normalizeModuleManifestBundle(\n\tbundle: ModuleManifestBundle | ModuleManifestBundleV1,\n): ModuleManifestBundle {\n\tconst version: number = bundle.manifestVersion;\n\tif (version !== 1 && version !== MODULE_MANIFEST_VERSION) {\n\t\tthrow new Error(`Unsupported module manifest bundle version: ${String(version)}`);\n\t}\n\treturn {\n\t\tmanifestVersion: MODULE_MANIFEST_VERSION,\n\t\tmodules: bundle.modules.map((manifest) => normalizeModuleManifest(manifest)),\n\t};\n}\n\n/**\n * A {@link SchemaValidator} that can also export its parameter schema as JSON\n * Schema (for example a Zod 4 schema via `z.toJSONSchema`). Keeps the platform\n * zero-dependency while letting schema-bearing actions flow into manifests.\n */\nexport interface JsonSchemaExportableValidator extends SchemaValidator {\n\ttoJSONSchema(): Record<string, unknown>;\n}\n\nexport function isJsonSchemaExportableValidator(\n\tschema: SchemaValidator,\n): schema is JsonSchemaExportableValidator {\n\treturn (\n\t\ttypeof (schema as Partial<JsonSchemaExportableValidator>).toJSONSchema === \"function\"\n\t);\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n\treturn value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\n\nfunction exportDependency(dependency: ModuleDependencyInput): ModuleDependency {\n\tconst namespace = getModuleDependencyNamespace(dependency);\n\tif (typeof dependency === \"string\") {\n\t\treturn { namespace };\n\t}\n\tconst normalized: ModuleDependency = { namespace };\n\tif (dependency.version !== undefined) normalized.version = dependency.version;\n\tif (dependency.optional !== undefined) normalized.optional = dependency.optional;\n\treturn normalized;\n}\n\nfunction exportObjectType(\n\tobjectType: NonNullable<FabricModule[\"objectTypes\"]>[number],\n): ModuleManifestObjectType {\n\tif (typeof objectType === \"string\") {\n\t\treturn { type: objectType };\n\t}\n\tconst normalized: ModuleManifestObjectType = { type: getObjectTypeName(objectType) };\n\tif (objectType.displayName !== undefined) normalized.displayName = objectType.displayName;\n\tif (objectType.idPrefix !== undefined) normalized.idPrefix = objectType.idPrefix;\n\tif (objectType.schema !== undefined) normalized.schema = cloneJson(objectType.schema);\n\tif (objectType.semantics !== undefined) normalized.semantics = cloneJson(objectType.semantics);\n\tif (objectType.relations !== undefined) {\n\t\tnormalized.relations = objectType.relations.map((relation) => ({ ...relation }));\n\t}\n\tif (objectType.invariants !== undefined) {\n\t\tnormalized.invariants = objectType.invariants.map((invariant) => ({ ...invariant }));\n\t}\n\treturn normalized;\n}\n\nfunction cloneJson<T>(value: T): T {\n\tif (Array.isArray(value)) return value.map((item) => cloneJson(item)) as T;\n\tif (value !== null && typeof value === \"object\") {\n\t\treturn Object.fromEntries(\n\t\t\tObject.entries(value as Record<string, unknown>).map(([key, child]) => [key, cloneJson(child)]),\n\t\t) as T;\n\t}\n\treturn value;\n}\n\nfunction exportEventType(\n\teventType: NonNullable<FabricModule[\"eventTypes\"]>[number],\n): ModuleManifestEventType {\n\tif (typeof eventType === \"string\") {\n\t\t// String registrations carry no explicit schema version; the events\n\t\t// registry treats the bare name as the initial version of the type.\n\t\treturn { eventType, schemaVersion: 1 };\n\t}\n\tconst normalized: ModuleManifestEventType = {\n\t\teventType: getEventTypeName(eventType),\n\t\tschemaVersion: eventType.schemaVersion,\n\t};\n\tif (eventType.description !== undefined) normalized.description = eventType.description;\n\tif (eventType.schema !== undefined) normalized.schema = cloneJson(eventType.schema);\n\treturn normalized;\n}\n\nfunction exportAction(action: ActionDefinition): ModuleManifestAction {\n\tassertSurfaceDeclaration(action, `Action \"${action?.actionId ?? \"unknown\"}\"`);\n\tconst manifest: ModuleManifestAction = {\n\t\tactionId: action.actionId,\n\t\tversion: action.version,\n\t\tkind: action.kind ?? \"atomic\",\n\t\tidempotent: action.idempotent,\n\t\tmutatesDomain: action.mutatesDomain,\n\t\temitsEvents: [...action.emitsEvents],\n\t};\n\n\tif (action.surface !== undefined) manifest.surface = action.surface;\n\tif (action.surfaceReason !== undefined) manifest.surfaceReason = action.surfaceReason;\n\tif (action.policies !== undefined) manifest.policies = [...action.policies];\n\tif (action.requiredRoles !== undefined) manifest.requiredRoles = [...action.requiredRoles];\n\tif (action.requiredPermissions !== undefined) {\n\t\tmanifest.requiredPermissions = [...action.requiredPermissions];\n\t}\n\tif (action.eventPhase !== undefined) manifest.eventPhase = action.eventPhase;\n\tif (action.execution !== undefined) manifest.execution = cloneJson(action.execution);\n\n\tif (isJsonSchemaExportableValidator(action.schema)) {\n\t\ttry {\n\t\t\tmanifest.parameterSchema = action.schema.toJSONSchema();\n\t\t\tmanifest.parameterSchemaFormat = \"json-schema\";\n\t\t} catch {\n\t\t\t// Runtime-valid schemas that cannot be represented portably remain executable;\n\t\t\t// build-time consumers see the schema as unavailable rather than crashing export.\n\t\t}\n\t}\n\tif (action.resultSchema && isJsonSchemaExportableValidator(action.resultSchema)) {\n\t\ttry {\n\t\t\tmanifest.resultSchema = action.resultSchema.toJSONSchema();\n\t\t\tmanifest.resultSchemaFormat = \"json-schema\";\n\t\t} catch {\n\t\t\t// See parameter-schema behavior above.\n\t\t}\n\t}\n\n\tif (action.stateMachine !== undefined) {\n\t\tconst binding: ModuleManifestActionStateMachine = {\n\t\t\tentityType: action.stateMachine.entityType,\n\t\t};\n\t\tif (typeof action.stateMachine.targetState === \"string\") {\n\t\t\tbinding.targetState = action.stateMachine.targetState;\n\t\t}\n\t\tmanifest.stateMachine = binding;\n\t}\n\n\tif (action.adapterSteps !== undefined) {\n\t\tmanifest.adapterSteps = action.adapterSteps.map((step) => {\n\t\t\tconst exported: ModuleManifestAdapterStep = {\n\t\t\t\tadapterType: step.adapterType,\n\t\t\t\toperation: step.operation,\n\t\t\t};\n\t\t\tif (step.retryPolicy !== undefined) exported.retryPolicy = { ...step.retryPolicy };\n\t\t\treturn exported;\n\t\t});\n\t}\n\n\treturn manifest;\n}\n\nfunction exportPolicy(policy: unknown): ModuleManifestPolicy | undefined {\n\tif (!isRecord(policy) || typeof policy.policyId !== \"string\") {\n\t\treturn undefined;\n\t}\n\n\t// Code evaluator: identified by its `evaluate` function (never serialized).\n\tif (typeof policy.evaluate === \"function\") {\n\t\tconst exported: ModuleManifestCodePolicy = {\n\t\t\ttype: \"code\",\n\t\t\tpolicyId: policy.policyId,\n\t\t\tversion: typeof policy.version === \"number\" ? policy.version : 1,\n\t\t};\n\t\tif (typeof policy.previewSafe === \"boolean\") exported.previewSafe = policy.previewSafe;\n\t\treturn exported;\n\t}\n\n\t// Declarative runtime policy definition: pure data, serialized as-is.\n\tif (typeof policy.kind === \"string\" && typeof policy.policyVersion === \"number\") {\n\t\tconst exported: ModuleManifestDataPolicy = {\n\t\t\ttype: \"data\",\n\t\t\tpolicyId: policy.policyId,\n\t\t\tpolicyVersion: policy.policyVersion,\n\t\t\tkind: policy.kind as PolicyKind,\n\t\t};\n\t\tif (isRecord(policy.dataDefinition)) {\n\t\t\texported.dataDefinition = policy.dataDefinition as unknown as DataPolicyDefinition;\n\t\t}\n\t\tif (typeof policy.codeEvaluatorPolicyId === \"string\") {\n\t\t\texported.codeEvaluatorPolicyId = policy.codeEvaluatorPolicyId;\n\t\t}\n\t\tif (isRecord(policy.fallback)) {\n\t\t\texported.fallback = policy.fallback as unknown as PolicyFallbackDefinition;\n\t\t}\n\t\treturn exported;\n\t}\n\n\t// Unknown policy shape: omit rather than guess.\n\treturn undefined;\n}\n\nfunction exportStateMachine(machine: unknown): ModuleManifestStateMachine | undefined {\n\tif (\n\t\t!isRecord(machine) ||\n\t\ttypeof machine.entityType !== \"string\" ||\n\t\t!isRecord(machine.states) ||\n\t\t!Array.isArray(machine.transitions)\n\t) {\n\t\treturn undefined;\n\t}\n\n\tconst definition = machine as unknown as StateMachineDefinition;\n\treturn {\n\t\tentityType: definition.entityType,\n\t\tstates: Object.values(definition.states),\n\t\ttransitions: definition.transitions.map((transition) => ({\n\t\t\tfrom: transition.from,\n\t\t\tto: transition.to,\n\t\t\tcausedByAction: transition.causedByAction,\n\t\t\thasGuard: typeof transition.guard === \"function\",\n\t\t})),\n\t};\n}\n\nfunction exportView(view: ViewContract): ModuleManifestView {\n\tassertSurfaceDeclaration(view, `View \"${view?.name ?? \"unknown\"}\"`);\n\tconst output: ModuleManifestView = {\n\t\tname: view.name,\n\t\tversion: view.version,\n\t\tshape: cloneJson(view.shape),\n\t\tconsumes: view.consumes.map((consumption) => ({\n\t\t\teventType: consumption.eventType,\n\t\t\tschemaVersions: [...consumption.schemaVersions],\n\t\t})),\n\t\tscope: view.scope,\n\t\tsnapshotVersion: view.snapshotVersion,\n\t};\n\tif (view.surface !== undefined) output.surface = view.surface;\n\tif (view.surfaceReason !== undefined) output.surfaceReason = view.surfaceReason;\n\tif (view.parameterSchema !== undefined) output.parameterSchema = cloneJson(view.parameterSchema);\n\tif (view.compatibleSnapshotVersions) output.compatibleSnapshotVersions = [...view.compatibleSnapshotVersions];\n\tif (view.usage) output.usage = cloneJson(view.usage);\n\treturn output;\n}\n\n/**\n * Export a stable, JSON-serializable manifest of a module's ontology.\n *\n * This is a pure function of the module object: it does not read or mutate the\n * global module/action/policy/state-machine registries, and the module does\n * not need to be registered first. Declaration order is preserved everywhere\n * (nothing is sorted), so the same module object always produces a\n * byte-identical `JSON.stringify` result.\n *\n * The manifest contains definitions only — never raw parameter values,\n * secrets, or runtime data. Function fields are elided (`handler`,\n * policy `evaluate`, transition `guard` → `hasGuard`, dynamic `targetState`,\n * adapter `getInput`).\n */\nexport function exportModuleManifest(module: FabricModule<unknown>): ModuleManifest {\n\tconst manifest: ModuleManifest = {\n\t\tmanifestVersion: MODULE_MANIFEST_VERSION,\n\t\tnamespace: module.namespace,\n\t\tdependencies: (module.dependencies ?? []).map(exportDependency),\n\t\tobjectTypes: (module.objectTypes ?? []).map(exportObjectType),\n\t\tsubjectTypes: [...(module.subjectTypes ?? [])],\n\t\tidPrefixes: (module.idPrefixes ?? []).map((registration) => ({\n\t\t\tprefix: registration.prefix,\n\t\t\tname: registration.name,\n\t\t})),\n\t\teventTypes: (module.eventTypes ?? []).map(exportEventType),\n\t\tactions: (module.actions ?? []).map(exportAction),\n\t\tpolicies: (module.policies ?? [])\n\t\t\t.map(exportPolicy)\n\t\t\t.filter((policy): policy is ModuleManifestPolicy => policy !== undefined),\n\t\tstateMachines: (module.stateMachines ?? [])\n\t\t\t.map(exportStateMachine)\n\t\t\t.filter((machine): machine is ModuleManifestStateMachine => machine !== undefined),\n\t\tviews: (module.views ?? []).map(exportView),\n\t};\n\n\tif (module.version !== undefined) manifest.version = module.version;\n\tif (module.displayName !== undefined) manifest.displayName = module.displayName;\n\tif (module.description !== undefined) manifest.description = module.description;\n\tif (module.capability !== undefined) manifest.capability = cloneJson(module.capability);\n\n\treturn manifest;\n}\n\n/**\n * Export manifests for a set of modules, preserving the input order.\n * Like {@link exportModuleManifest}, this is pure and registry-free.\n */\nexport function exportModuleManifestBundle(\n\tmodules: FabricModule<unknown>[],\n): ModuleManifestBundle {\n\treturn {\n\t\tmanifestVersion: MODULE_MANIFEST_VERSION,\n\t\tmodules: modules.map(exportModuleManifest),\n\t};\n}\n"]}
@@ -1,36 +0,0 @@
1
- // governance/index.ts
2
- var FABRIC_GOVERNANCE_CONTRACT_VERSION = 1;
3
- function assertMutationGovernanceContext(value) {
4
- if (!Number.isInteger(value.footprint.version) || value.footprint.version < 1) {
5
- throw new Error("Mutation footprint version must be a positive integer");
6
- }
7
- for (const entry of value.footprint.resources) {
8
- if (!entry.resource.provider.trim()) throw new Error("Resource provider is required");
9
- if (!entry.resource.resourceType.trim()) throw new Error("Resource type is required");
10
- if (!entry.resource.resourceId.trim()) throw new Error("Resource id is required");
11
- }
12
- if (!value.executionPrincipal.principalId.trim()) {
13
- throw new Error("Execution principal id is required");
14
- }
15
- }
16
- function assertGovernanceRuntimeEvidence(value) {
17
- if (!Number.isInteger(value.governanceContractVersion) || value.governanceContractVersion < 1) {
18
- throw new Error("Governance contract version must be a positive integer");
19
- }
20
- if (!Number.isInteger(value.hostContractVersion) || value.hostContractVersion < 1) {
21
- throw new Error("Host contract version must be a positive integer");
22
- }
23
- if (value.providerBridge && (!value.providerBridge.name.trim() || !value.providerBridge.version.trim())) {
24
- throw new Error("Provider bridge name and version are required");
25
- }
26
- if (value.assemblyDigest !== void 0 && !/^[0-9a-f]{64}$/.test(value.assemblyDigest)) {
27
- throw new Error("Assembly digest must be a lowercase SHA-256 digest");
28
- }
29
- if (value.initiatingReleaseDigest !== void 0 && !/^[0-9a-f]{64}$/.test(value.initiatingReleaseDigest)) {
30
- throw new Error("Initiating release digest must be a lowercase SHA-256 digest");
31
- }
32
- }
33
-
34
- export { FABRIC_GOVERNANCE_CONTRACT_VERSION, assertGovernanceRuntimeEvidence, assertMutationGovernanceContext };
35
- //# sourceMappingURL=chunk-Y2PJLRIY.js.map
36
- //# sourceMappingURL=chunk-Y2PJLRIY.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../governance/index.ts"],"names":[],"mappings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,IAAA,EAAK,IAAK,CAAC,KAAA,CAAM,cAAA,CAAe,OAAA,CAAQ,MAAK,CAAA,EAAI;AACxG,IAAA,MAAM,IAAI,MAAM,+CAA+C,CAAA;AAAA,EAChE;AACA,EAAA,IAAI,KAAA,CAAM,mBAAmB,MAAA,IAAa,CAAC,iBAAiB,IAAA,CAAK,KAAA,CAAM,cAAc,CAAA,EAAG;AACvF,IAAA,MAAM,IAAI,MAAM,oDAAoD,CAAA;AAAA,EACrE;AACA,EAAA,IAAI,KAAA,CAAM,4BAA4B,MAAA,IAAa,CAAC,iBAAiB,IAAA,CAAK,KAAA,CAAM,uBAAuB,CAAA,EAAG;AACzG,IAAA,MAAM,IAAI,MAAM,8DAA8D,CAAA;AAAA,EAC/E;AACD","file":"chunk-Y2PJLRIY.js","sourcesContent":["import type { ActorType } from \"../actions\";\nimport type { EvidencePacketReference } from \"../evidence\";\n\n/** Language-neutral governance contract version shared by TypeScript and .NET. */\nexport const FABRIC_GOVERNANCE_CONTRACT_VERSION = 1 as const;\n\nexport type ExternalResourceOperation =\n\t| \"read\"\n\t| \"create\"\n\t| \"update\"\n\t| \"delete\"\n\t| \"execute\"\n\t| \"publish\";\n\n/** Provider-neutral identity for infrastructure touched by a governed mutation. */\nexport interface ExternalResourceRef {\n\tprovider: string;\n\tresourceType: string;\n\tresourceId: string;\n\tdisplayName?: string;\n\tmetadata?: Record<string, unknown>;\n}\n\nexport interface MutationFootprintEntry {\n\tresource: ExternalResourceRef;\n\toperation: ExternalResourceOperation;\n\tdataClassifications?: string[];\n}\n\n/** Durable declaration of the external effects an invocation is allowed to produce. */\nexport interface MutationFootprint {\n\tversion: number;\n\tresources: MutationFootprintEntry[];\n}\n\n/** Effective execution identity, including the delegation chain that produced it. */\nexport interface ExecutionPrincipal {\n\tprincipalId: string;\n\tprincipalType: ActorType | string;\n\tprovider?: string;\n\tdelegatedBy?: ExecutionPrincipal;\n\tmetadata?: Record<string, unknown>;\n}\n\nexport type PolicyObligationStatus = \"pending\" | \"satisfied\" | \"waived\" | \"failed\";\n\nexport interface PolicyObligation {\n\tid: string;\n\ttype: string;\n\tstatus: PolicyObligationStatus;\n\trequired?: boolean;\n\tdescription?: string;\n\tevidenceReferences?: EvidencePacketReference[];\n\tmetadata?: Record<string, unknown>;\n}\n\n/** Audit-safe proof returned by an external execution provider. */\nexport interface ExecutionAttestation {\n\tprovider: string;\n\toperation: string;\n\texternalOperationId?: string;\n\tresource?: ExternalResourceRef;\n\tevidenceReferences: EvidencePacketReference[];\n\tsatisfiesObligations?: string[];\n\tstartedAt: Date | string;\n\tcompletedAt?: Date | string;\n\tmetadata?: Record<string, unknown>;\n}\n\nexport type ReconciliationStatus = \"not_required\" | \"pending\" | \"reconciled\" | \"failed\";\n\nexport interface ExternalReconciliation {\n\tstatus: ReconciliationStatus;\n\tprovider: string;\n\texternalOperationId?: string;\n\tattempt: number;\n\treason?: string;\n\tevidenceReferences?: EvidencePacketReference[];\n\tobservedAt: Date | string;\n}\n\nexport interface MutationGovernanceContext {\n\tfootprint: MutationFootprint;\n\texecutionPrincipal: ExecutionPrincipal;\n}\n\n/** Runtime generations durably attached to every new hosted invocation. */\nexport interface GovernanceRuntimeEvidence {\n\tgovernanceContractVersion: number;\n\thostContractVersion: number;\n\thostPackageVersion?: string;\n\tproviderBridge?: {\n\t\tname: string;\n\t\tversion: string;\n\t};\n\tpolicyRulesetVersion?: string;\n\t/** Digest of the verified application assembly loaded by this runtime. */\n\tassemblyDigest?: string;\n\t/** Digest of the promoted experience release that initiated this invocation. */\n\tinitiatingReleaseDigest?: string;\n}\n\nexport interface MutationGovernanceResolutionInput {\n\tactionInvocationId: string;\n\tactionId: string;\n\ttenantId: string;\n\tspaceId: string;\n\tactorId: string;\n\tactorType: ActorType;\n\tparameters: unknown;\n}\n\nexport type MutationGovernanceResolver = (\n\tinput: MutationGovernanceResolutionInput,\n) => Promise<MutationGovernanceContext> | MutationGovernanceContext;\n\nexport function assertMutationGovernanceContext(\n\tvalue: MutationGovernanceContext,\n): void {\n\tif (!Number.isInteger(value.footprint.version) || value.footprint.version < 1) {\n\t\tthrow new Error(\"Mutation footprint version must be a positive integer\");\n\t}\n\tfor (const entry of value.footprint.resources) {\n\t\tif (!entry.resource.provider.trim()) throw new Error(\"Resource provider is required\");\n\t\tif (!entry.resource.resourceType.trim()) throw new Error(\"Resource type is required\");\n\t\tif (!entry.resource.resourceId.trim()) throw new Error(\"Resource id is required\");\n\t}\n\tif (!value.executionPrincipal.principalId.trim()) {\n\t\tthrow new Error(\"Execution principal id is required\");\n\t}\n}\n\nexport function assertGovernanceRuntimeEvidence(value: GovernanceRuntimeEvidence): void {\n\tif (!Number.isInteger(value.governanceContractVersion) || value.governanceContractVersion < 1) {\n\t\tthrow new Error(\"Governance contract version must be a positive integer\");\n\t}\n\tif (!Number.isInteger(value.hostContractVersion) || value.hostContractVersion < 1) {\n\t\tthrow new Error(\"Host contract version must be a positive integer\");\n\t}\n\tif (value.providerBridge && (!value.providerBridge.name.trim() || !value.providerBridge.version.trim())) {\n\t\tthrow new Error(\"Provider bridge name and version are required\");\n\t}\n\tif (value.assemblyDigest !== undefined && !/^[0-9a-f]{64}$/.test(value.assemblyDigest)) {\n\t\tthrow new Error(\"Assembly digest must be a lowercase SHA-256 digest\");\n\t}\n\tif (value.initiatingReleaseDigest !== undefined && !/^[0-9a-f]{64}$/.test(value.initiatingReleaseDigest)) {\n\t\tthrow new Error(\"Initiating release digest must be a lowercase SHA-256 digest\");\n\t}\n}\n"]}