@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 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../modules/index.ts"],"sourcesContent":["import { assertSurfaceDeclaration } from \"../discovery\";\nimport type { ActionDefinition } from \"../actions\";\nimport { createEventContractRegistry } from \"../events\";\nimport {\n\tassertPortableJsonSchema,\n\ttype JsonValue,\n\ttype PortableJsonSchema,\n} from \"../objects\";\nimport type { PolicyEvaluator, PolicyId } from \"../policies\";\nimport type { StateMachineDefinition } from \"../state-machines\";\nimport { viewContractKey, type ViewContract } from \"../projections\";\n\nexport interface ModuleDependency {\n\tnamespace: string;\n\tversion?: string;\n\toptional?: boolean;\n}\n\nexport type ModuleDependencyInput = string | ModuleDependency;\n\nexport interface IdPrefixRegistration {\n\tprefix: string;\n\tname: string;\n\tmodule: string;\n}\n\nexport interface EventTypeRegistration {\n\teventType: string;\n\tschemaVersion: number;\n\tdescription?: string;\n\tschema?: PortableJsonSchema;\n}\n\nexport type EventTypeRegistrationInput = string | EventTypeRegistration;\n\nexport interface ObjectTypeRegistration {\n\ttype: string;\n\tdisplayName?: string;\n\tidPrefix?: string;\n\tisCoreModuleType?: boolean;\n\tschema?: PortableJsonSchema;\n\tsemantics?: Record<string, JsonValue>;\n\trelations?: ObjectRelationDefinition[];\n\tinvariants?: DeclarativeInvariant[];\n}\n\nexport type ObjectRelationCardinality = \"one\" | \"many\";\nexport type ObjectRelationSemantics = \"reference\" | \"owned\";\nexport type ObjectRelationDeleteBehavior = \"restrict\" | \"cascade\" | \"set-null\";\n\nexport interface ObjectRelationDefinition {\n\tname: string;\n\ttarget: `${string}.${string}`;\n\tcardinality: ObjectRelationCardinality;\n\trequired?: boolean;\n\tsemantics: ObjectRelationSemantics;\n\tonTargetDelete: ObjectRelationDeleteBehavior;\n}\n\nexport type InvariantEnforcement =\n\t| \"json-schema\"\n\t| \"state-machine\"\n\t| \"policy\"\n\t| \"host-adapter\"\n\t| \"application\";\n\nexport interface DeclarativeInvariant {\n\tid: string;\n\tdescription: string;\n\trequired?: boolean;\n\tenforcement: InvariantEnforcement;\n\tenforcementRef?: string;\n}\n\nexport type ObjectTypeRegistrationInput = string | ObjectTypeRegistration;\n\nexport interface PolicyRegistration {\n\tid: string;\n\tversion?: string;\n\tdescription?: string;\n}\n\nexport interface StateMachineRegistration {\n\tentityType: string;\n\tstates: string[];\n}\n\nexport interface CapabilityPortRequirement {\n\tname: string;\n\tversion?: string;\n\tstandard?: { name: string; version?: string };\n}\n\nexport interface CapabilityRequirements {\n\tports?: CapabilityPortRequirement[];\n\tpermissions?: string[];\n\tentitlements?: string[];\n\tfeatureFlags?: string[];\n}\n\nexport interface CapabilityWorkflowTimer {\n\t/** Workflow-local identity of the deadline, for example \"right-to-cure\". */\n\tname: string;\n\t/** Configuration key the duration is resolved from when the workflow starts. */\n\tconfigKey: string;\n\tdescription?: string;\n}\n\nexport interface CapabilityWorkflowCompensation {\n\t/** Workflow step whose effect this reverses. */\n\tstep: string;\n\t/** Governed action that performs the reversal. Must belong to the declaring module. */\n\tactionId: `${string}.${string}`;\n}\n\n/**\n * A durable workflow this capability owns. Declaring it makes durability a\n * reviewable fact of the contract rather than a property of worker deployment:\n * the queue it runs on, the deadlines it carries, and what reverses each step\n * are all diffable.\n */\nexport interface CapabilityWorkflowDeclaration {\n\tname: string;\n\t/** Routing identity, conventionally `capability.vertical`. */\n\ttaskQueue: string;\n\t/** Event type whose arrival starts this workflow by choreography. */\n\tstartedBy?: string;\n\ttimers?: CapabilityWorkflowTimer[];\n\tcompensations?: CapabilityWorkflowCompensation[];\n}\n\nexport interface CapabilityMetadata {\n\tdisplayName: string;\n\tdescription: string;\n\tstability: \"experimental\" | \"beta\" | \"stable\" | \"deprecated\";\n\tdeprecated?: { since: string; replacement?: string; message: string };\n\trequirements?: CapabilityRequirements;\n\tcertification?: { profile: string; required: boolean };\n\t/** Durable workflows this capability owns, with their queues, deadlines and reversals. */\n\tworkflows?: CapabilityWorkflowDeclaration[];\n\t/** Namespaced declared data preserved by Platform and interpreted only by its owning package. */\n\textensions?: Record<string, JsonValue>;\n}\n\nexport interface FabricModule<TDb = unknown> {\n\tnamespace: string;\n\tversion?: string;\n\t/** Compiler manifest digest for exact runtime assembly verification. */\n\tmanifestDigest?: string;\n\tdisplayName?: string;\n\tdescription?: string;\n\tcapability?: CapabilityMetadata;\n\tdependencies?: ModuleDependencyInput[];\n\tobjectTypes?: ObjectTypeRegistrationInput[];\n\tsubjectTypes?: string[];\n\tidPrefixes?: IdPrefixRegistration[];\n\teventTypes?: EventTypeRegistrationInput[];\n\tactions?: ActionDefinition<TDb>[];\n\tpolicies?: unknown[];\n\tstateMachines?: unknown[];\n\tadapterDefinitions?: unknown[];\n\tpermissions?: unknown[];\n\troles?: unknown[];\n\tredactionRules?: unknown[];\n\tdataClassifications?: unknown[];\n\tretentionRules?: unknown[];\n\tevidenceRenderers?: unknown[];\n\tviews?: ViewContract[];\n}\n\nexport interface ModuleRegistry<TDb = unknown> {\n\tmodules: ReadonlyMap<string, FabricModule<TDb>>;\n\torderedModules: readonly FabricModule<TDb>[];\n\tresolveAction(actionId: `${string}.${string}`): ActionDefinition<TDb> | undefined;\n\tresolvePolicy(policyId: PolicyId): PolicyEvaluator | undefined;\n\tresolveStateMachine(entityType: string): StateMachineDefinition | undefined;\n\tresolveView(name: string, version: string): ViewContract | undefined;\n}\n\ninterface ModuleValidationContext {\n\tavailableNamespaces?: Set<string>;\n\tplannedEventTypes?: Set<string>;\n\tavailableObjectTypes?: Set<string>;\n}\n\nexport function getModuleDependencyNamespace(dependency: ModuleDependencyInput): string {\n\treturn typeof dependency === \"string\" ? dependency : dependency.namespace;\n}\n\nexport function getObjectTypeName(objectType: ObjectTypeRegistrationInput): string {\n\treturn typeof objectType === \"string\" ? objectType : objectType.type;\n}\n\nexport function getEventTypeName(eventType: EventTypeRegistrationInput): string {\n\treturn typeof eventType === \"string\" ? eventType : eventType.eventType;\n}\n\nexport function validateModuleNamespace(namespace: string): void {\n\tif (!namespace) {\n\t\tthrow new Error(\"Module namespace cannot be empty\");\n\t}\n\tif (!/^[a-z][a-z0-9-]*$/.test(namespace)) {\n\t\tthrow new Error(\n\t\t\t`Invalid module namespace: \"${namespace}\". Must be lowercase letters, numbers, and hyphens only.`,\n\t\t);\n\t}\n}\n\nexport function createModuleRegistry<TDb = unknown>(\n\tmodules: FabricModule<TDb>[] = [],\n): ModuleRegistry<TDb> {\n\tconst orderedModules = validateAndOrderFabricModules(modules);\n\tconst registered = new Map(orderedModules.map((module) => [module.namespace, module]));\n\tconst actions = new Map(orderedModules.flatMap((module) => (module.actions ?? []).map((action) => [action.actionId, action] as const)));\n\tconst policies = new Map(orderedModules.flatMap((module) => (module.policies ?? []).map((policy) => {\n\t\tconst evaluator = policy as PolicyEvaluator;\n\t\treturn [evaluator.policyId, evaluator] as const;\n\t})));\n\tconst machines = new Map(orderedModules.flatMap((module) => (module.stateMachines ?? []).map((machine) => {\n\t\tconst definition = machine as StateMachineDefinition;\n\t\treturn [definition.entityType, definition] as const;\n\t})));\n\tconst views = new Map(orderedModules.flatMap((module) => (module.views ?? []).map((view) => [viewContractKey(view), view] as const)));\n\treturn {\n\t\tmodules: registered,\n\t\torderedModules,\n\t\tresolveAction: (actionId) => actions.get(actionId),\n\t\tresolvePolicy: (policyId) => policies.get(policyId),\n\t\tresolveStateMachine: (entityType) => machines.get(entityType),\n\t\tresolveView: (name, version) => views.get(`${name}@${version}`),\n\t};\n}\n\nfunction validateIdentifierList(\n\tvalues: string[] | undefined,\n\tlabel: string,\n\tnamespace: string,\n): void {\n\tfor (const value of values ?? []) {\n\t\tif (!value) {\n\t\t\tthrow new Error(`Module \"${namespace}\" has an empty ${label} entry.`);\n\t\t}\n\t}\n}\n\nfunction assertJsonValue(value: unknown, path: string): asserts value is JsonValue {\n\tif (value === null || typeof value === \"string\" || typeof value === \"boolean\") return;\n\tif (typeof value === \"number\" && Number.isFinite(value)) return;\n\tif (Array.isArray(value)) {\n\t\tvalue.forEach((item, index) => assertJsonValue(item, `${path}[${index}]`));\n\t\treturn;\n\t}\n\tif (typeof value === \"object\") {\n\t\tfor (const [key, child] of Object.entries(value as Record<string, unknown>)) {\n\t\t\tassertJsonValue(child, `${path}.${key}`);\n\t\t}\n\t\treturn;\n\t}\n\tthrow new Error(`${path} must contain JSON-serializable values.`);\n}\n\nfunction qualifiedObjectType(namespace: string, type: string): string {\n\treturn `${namespace}.${type}`;\n}\n\nfunction validateObjectDefinition(\n\tobjectType: ObjectTypeRegistrationInput,\n\tnamespace: string,\n\tcontext: ModuleValidationContext,\n): void {\n\tif (typeof objectType === \"string\") return;\n\tif (objectType.schema !== undefined) {\n\t\tassertPortableJsonSchema(objectType.schema, `Module \"${namespace}\" object \"${objectType.type}\" schema`);\n\t}\n\tif (objectType.semantics !== undefined) {\n\t\tassertJsonValue(objectType.semantics, `Module \"${namespace}\" object \"${objectType.type}\" semantics`);\n\t}\n\tconst relationNames = new Set<string>();\n\tfor (const relation of objectType.relations ?? []) {\n\t\tif (!/^[a-z][a-zA-Z0-9]*$/.test(relation.name)) {\n\t\t\tthrow new Error(`Module \"${namespace}\" object \"${objectType.type}\" has invalid relation name \"${relation.name}\".`);\n\t\t}\n\t\tif (relationNames.has(relation.name)) {\n\t\t\tthrow new Error(`Module \"${namespace}\" object \"${objectType.type}\" has duplicate relation \"${relation.name}\".`);\n\t\t}\n\t\trelationNames.add(relation.name);\n\t\tif (!/^[a-z][a-z0-9-]*\\.[A-Z][a-zA-Z0-9]*$/.test(relation.target)) {\n\t\t\tthrow new Error(`Relation \"${relation.name}\" target \"${relation.target}\" must be module-qualified.`);\n\t\t}\n\t\tif (context.availableObjectTypes && !context.availableObjectTypes.has(relation.target)) {\n\t\t\tthrow new Error(`Relation \"${relation.name}\" targets missing object type \"${relation.target}\".`);\n\t\t}\n\t\tif (relation.required && relation.onTargetDelete === \"set-null\") {\n\t\t\tthrow new Error(`Required relation \"${relation.name}\" cannot use onTargetDelete \"set-null\".`);\n\t\t}\n\t}\n\tconst invariantIds = new Set<string>();\n\tfor (const invariant of objectType.invariants ?? []) {\n\t\tif (!invariant.id.trim() || !invariant.description.trim()) {\n\t\t\tthrow new Error(`Module \"${namespace}\" object \"${objectType.type}\" has an invariant without an id or description.`);\n\t\t}\n\t\tif (invariantIds.has(invariant.id)) {\n\t\t\tthrow new Error(`Module \"${namespace}\" object \"${objectType.type}\" has duplicate invariant \"${invariant.id}\".`);\n\t\t}\n\t\tinvariantIds.add(invariant.id);\n\t\tif (invariant.required && !invariant.enforcementRef?.trim()) {\n\t\t\tthrow new Error(`Required invariant \"${invariant.id}\" must declare enforcementRef.`);\n\t\t}\n\t}\n}\n\nfunction validateCapabilityWorkflows(module: FabricModule<unknown>, context: ModuleValidationContext): void {\n\tconst workflows = module.capability?.workflows ?? [];\n\tconst actionsById = new Map((module.actions ?? []).map((action) => [action.actionId, action]));\n\tconst names = new Set<string>();\n\tfor (const workflow of workflows) {\n\t\tif (!/^[A-Za-z][A-Za-z0-9_-]*$/.test(workflow.name)) {\n\t\t\tthrow new Error(`Module \"${module.namespace}\" declares invalid workflow name \"${workflow.name}\".`);\n\t\t}\n\t\tif (names.has(workflow.name)) {\n\t\t\tthrow new Error(`Module \"${module.namespace}\" declares duplicate workflow \"${workflow.name}\".`);\n\t\t}\n\t\tnames.add(workflow.name);\n\t\tif (!/^[a-z][a-z0-9-]*(\\.[a-z][a-z0-9-]*)*$/.test(workflow.taskQueue)) {\n\t\t\tthrow new Error(`Module \"${module.namespace}\" workflow \"${workflow.name}\" declares invalid task queue \"${workflow.taskQueue}\".`);\n\t\t}\n\t\tif (workflow.startedBy !== undefined) {\n\t\t\tconst known = context.plannedEventTypes?.has(workflow.startedBy)\n\t\t\t\t?? (module.eventTypes ?? []).some((eventType) => getEventTypeName(eventType) === workflow.startedBy);\n\t\t\tif (!known) {\n\t\t\t\tthrow new Error(`Module \"${module.namespace}\" workflow \"${workflow.name}\" is started by unknown event type \"${workflow.startedBy}\".`);\n\t\t\t}\n\t\t}\n\t\tconst timerNames = new Set<string>();\n\t\tfor (const timer of workflow.timers ?? []) {\n\t\t\tif (!timer.name.trim() || !timer.configKey.trim()) {\n\t\t\t\tthrow new Error(`Module \"${module.namespace}\" workflow \"${workflow.name}\" has a timer without a name or configKey.`);\n\t\t\t}\n\t\t\tif (timerNames.has(timer.name)) {\n\t\t\t\tthrow new Error(`Module \"${module.namespace}\" workflow \"${workflow.name}\" declares duplicate timer \"${timer.name}\".`);\n\t\t\t}\n\t\t\ttimerNames.add(timer.name);\n\t\t}\n\t\tconst steps = new Set<string>();\n\t\tfor (const compensation of workflow.compensations ?? []) {\n\t\t\tif (!compensation.step.trim()) {\n\t\t\t\tthrow new Error(`Module \"${module.namespace}\" workflow \"${workflow.name}\" has a compensation without a step.`);\n\t\t\t}\n\t\t\tif (steps.has(compensation.step)) {\n\t\t\t\tthrow new Error(`Module \"${module.namespace}\" workflow \"${workflow.name}\" declares duplicate compensation for step \"${compensation.step}\".`);\n\t\t\t}\n\t\t\tsteps.add(compensation.step);\n\t\t\tconst compensatingAction = actionsById.get(compensation.actionId);\n\t\t\tif (!compensatingAction) {\n\t\t\t\tthrow new Error(`Module \"${module.namespace}\" workflow \"${workflow.name}\" compensates step \"${compensation.step}\" with unknown action \"${compensation.actionId}\".`);\n\t\t\t}\n\t\t\t// An unwind is retried like any other durable step, so a reversal that cannot be\n\t\t\t// safely repeated would turn one failure into a different kind of corruption.\n\t\t\tif (!compensatingAction.idempotent || compensatingAction.execution?.idempotency === \"prohibited\") {\n\t\t\t\tthrow new Error(`Module \"${module.namespace}\" workflow \"${workflow.name}\" compensates step \"${compensation.step}\" with non-idempotent action \"${compensation.actionId}\"; a reversal must be safely repeatable.`);\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction validateManifest(module: FabricModule<unknown>, context: ModuleValidationContext = {}): void {\n\tvalidateModuleNamespace(module.namespace);\n\n\tconst dependencies = (module.dependencies ?? []).map(getModuleDependencyNamespace);\n\tconst objectTypes = (module.objectTypes ?? []).map(getObjectTypeName);\n\tconst eventTypes = (module.eventTypes ?? []).map(getEventTypeName);\n\tif (module.capability) {\n\t\tif (!module.capability.displayName.trim() || !module.capability.description.trim()) {\n\t\t\tthrow new Error(`Module \"${module.namespace}\" capability requires displayName and description.`);\n\t\t}\n\t\tfor (const namespace of Object.keys(module.capability.extensions ?? {})) {\n\t\t\tif (!/^[a-z][a-z0-9.-]*\\.[a-z0-9.-]+\\/v[1-9][0-9]*$/.test(namespace)) {\n\t\t\t\tthrow new Error(`Module \"${module.namespace}\" capability has invalid extension namespace \"${namespace}\".`);\n\t\t\t}\n\t\t}\n\t\tfor (const port of module.capability.requirements?.ports ?? []) {\n\t\t\t// Dotted segments are permitted so a capability can require a port\n\t\t\t// defined outside this repository: an enterprise integrates hundreds\n\t\t\t// of external systems, and namespacing is what keeps two of them from\n\t\t\t// colliding on a name. Widening only, so existing names still parse.\n\t\t\tif (!/^[a-z][a-z0-9-]*(?:\\.[a-z0-9-]+)*$/.test(port.name)) throw new Error(`Module \"${module.namespace}\" capability has invalid port requirement \"${port.name}\".`);\n\t\t}\n\t\tvalidateCapabilityWorkflows(module, context);\n\t}\n\tfor (const eventType of module.eventTypes ?? []) if (typeof eventType !== \"string\" && eventType.schema) assertPortableJsonSchema(eventType.schema, `Event \"${eventType.eventType}\" schema`);\n\tfor (const action of module.actions ?? []) {\n\t\tif (action.execution?.idempotency === \"required\" && !action.idempotent) throw new Error(`Action \"${action.actionId}\" requires idempotency but is not declared idempotent.`);\n\t\tif (action.execution?.connectivity === \"offline-capturable\" && action.execution.idempotency === \"prohibited\") throw new Error(`Offline action \"${action.actionId}\" cannot prohibit idempotency.`);\n\t\tif (action.execution?.completionDeadlineMs !== undefined && !(typeof action.execution.completionDeadlineMs === \"number\" && action.execution.completionDeadlineMs > 0)) throw new Error(`Action \"${action.actionId}\" completionDeadlineMs must be a positive number of milliseconds.`);\n\t\tif (action.execution?.completion === \"immediate\" && action.execution.completionDeadlineMs !== undefined) throw new Error(`Immediate action \"${action.actionId}\" cannot declare a completion deadline; nothing external completes it.`);\n\t}\n\tfor (const view of module.views ?? []) if (view.usage?.collection?.filterSchema) assertPortableJsonSchema(view.usage.collection.filterSchema, `View \"${view.name}\" filter schema`);\n\n\tfor (const dependency of dependencies) {\n\t\tvalidateModuleNamespace(dependency);\n\t\tif (dependency === module.namespace) {\n\t\t\tthrow new Error(`Module \"${module.namespace}\" cannot depend on itself.`);\n\t\t}\n\t\tif (context.availableNamespaces && !context.availableNamespaces.has(dependency)) {\n\t\t\tthrow new Error(`Module \"${module.namespace}\" depends on missing module \"${dependency}\".`);\n\t\t}\n\t}\n\n\tvalidateIdentifierList(objectTypes, \"objectTypes\", module.namespace);\n\tvalidateIdentifierList(module.subjectTypes, \"subjectTypes\", module.namespace);\n\tvalidateIdentifierList(eventTypes, \"eventTypes\", module.namespace);\n\n\tfor (const objectType of objectTypes) {\n\t\tif (!/^[A-Z][a-zA-Z0-9]*$/.test(objectType)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid object type: \"${objectType}\". Object types must be PascalCase alphanumeric.`,\n\t\t\t);\n\t\t}\n\t}\n\tfor (const objectType of module.objectTypes ?? []) {\n\t\tif (typeof objectType !== \"string\") {\n\t\t\tfor (const relation of objectType.relations ?? []) {\n\t\t\t\tconst targetNamespace = relation.target.slice(0, relation.target.indexOf(\".\"));\n\t\t\t\tif (targetNamespace !== module.namespace && !dependencies.includes(targetNamespace)) {\n\t\t\t\t\tthrow new Error(`Module \"${module.namespace}\" relation \"${relation.name}\" targets module \"${targetNamespace}\" without declaring it as a dependency.`);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tvalidateObjectDefinition(objectType, module.namespace, context);\n\t}\n\n\tfor (const action of module.actions ?? []) {\n\t\tassertSurfaceDeclaration(action, `Action \"${action?.actionId ?? \"unknown\"}\"`);\n\t\tlet parameterSchema: unknown;\n\t\ttry { parameterSchema = (action.schema as { toJSONSchema?: () => unknown }).toJSONSchema?.(); } catch { parameterSchema = undefined; }\n\t\tif (parameterSchema !== undefined) assertPortableJsonSchema(parameterSchema, `Action \"${action.actionId}\" parameters`);\n\t\tlet resultSchema: unknown;\n\t\ttry { resultSchema = (action.resultSchema as { toJSONSchema?: () => unknown } | undefined)?.toJSONSchema?.(); } catch { resultSchema = undefined; }\n\t\tif (resultSchema !== undefined) assertPortableJsonSchema(resultSchema, `Action \"${action.actionId}\" result`);\n\t\tif (!/^[a-z][a-z0-9-]*\\.[a-z][a-z0-9_]*$/.test(action.actionId)) {\n\t\t\tthrow new Error(`Invalid action ID: ${action.actionId}`);\n\t\t}\n\n\t\tif (action.namespace !== module.namespace) {\n\t\t\tthrow new Error(\n\t\t\t\t`Action \"${action.actionId}\" declares namespace \"${action.namespace}\" ` +\n\t\t\t\t\t`but is registered by module \"${module.namespace}\".`,\n\t\t\t);\n\t\t}\n\n\t\tif (!action.actionId.startsWith(`${module.namespace}.`)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Action \"${action.actionId}\" must start with module namespace \"${module.namespace}.\"`,\n\t\t\t);\n\t\t}\n\n\t\tif (action.mutatesDomain && action.emitsEvents.length === 0) {\n\t\t\tthrow new Error(\n\t\t\t\t`Action \"${action.actionId}\" mutates domain but emits no events. ` +\n\t\t\t\t\t`Every mutating action must emit at least one AssetEvent.`,\n\t\t\t);\n\t\t}\n\n\t\tif (action.admitSubmission !== undefined && typeof action.admitSubmission !== \"function\") {\n\t\t\tthrow new Error(`Action \"${action.actionId}\" declares admitSubmission that is not a function.`);\n\t\t}\n\t}\n\n\tconst viewKeys = new Set<string>();\n\tfor (const view of module.views ?? []) {\n\t\tassertSurfaceDeclaration(view, `View \"${view?.name ?? \"unknown\"}\"`);\n\t\tif (!view.name.startsWith(`${module.namespace}/`) || !/^[a-z][a-z0-9-]*\\/[a-z][a-z0-9/_-]*$/.test(view.name)) {\n\t\t\tthrow new Error(`View \"${view.name}\" must start with module namespace \"${module.namespace}/\" and use lowercase path segments.`);\n\t\t}\n\t\tif (!view.version.trim()) throw new Error(`View \"${view.name}\" must declare a version.`);\n\t\tconst key = `${view.name}@${view.version}`;\n\t\tif (viewKeys.has(key)) throw new Error(`Module \"${module.namespace}\" has duplicate view contract \"${key}\".`);\n\t\tviewKeys.add(key);\n\t\tassertPortableJsonSchema(view.shape, `View \"${key}\" shape`);\n\t\tif (view.parameterSchema !== undefined) assertPortableJsonSchema(view.parameterSchema, `View \"${key}\" parameters`);\n\t\tif (!Number.isInteger(view.snapshotVersion) || view.snapshotVersion < 1) {\n\t\t\tthrow new Error(`View \"${key}\" snapshotVersion must be a positive integer.`);\n\t\t}\n\t\tif ((view.compatibleSnapshotVersions?.some((version) => version !== view.snapshotVersion) ?? false) && !view.upgradeSnapshot) {\n\t\t\tthrow new Error(`View \"${key}\" declares older compatible snapshots but no upgradeSnapshot function.`);\n\t\t}\n\t\tfor (const consumption of view.consumes) {\n\t\t\tconst isPlanned = context.plannedEventTypes?.has(consumption.eventType) ?? false;\n\t\t\tconst isModuleEvent = eventTypes.includes(consumption.eventType);\n\t\t\tif (!isPlanned && !isModuleEvent) {\n\t\t\t\tthrow new Error(`View \"${key}\" consumes unknown event type \"${consumption.eventType}\".`);\n\t\t\t}\n\t\t\tif (consumption.schemaVersions.length === 0 || consumption.schemaVersions.some((version) => !Number.isInteger(version) || version < 1)) {\n\t\t\t\tthrow new Error(`View \"${key}\" must declare positive consumed schema versions for \"${consumption.eventType}\".`);\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction sortModulesByDependency(\n\tmodules: FabricModule<unknown>[],\n\tregisteredNamespaces: ReadonlySet<string> = new Set(),\n): FabricModule<unknown>[] {\n\tconst modulesByNamespace = new Map<string, FabricModule<unknown>>();\n\n\tfor (const module of modules) {\n\t\tvalidateModuleNamespace(module.namespace);\n\t\tif (modulesByNamespace.has(module.namespace)) {\n\t\t\tthrow new Error(`Duplicate FabricModule namespace \"${module.namespace}\".`);\n\t\t}\n\t\tmodulesByNamespace.set(module.namespace, module);\n\t}\n\n\tconst sorted: FabricModule<unknown>[] = [];\n\tconst visiting = new Set<string>();\n\tconst visited = new Set<string>();\n\n\tfunction visit(module: FabricModule<unknown>, path: string[]): void {\n\t\tif (visited.has(module.namespace)) {\n\t\t\treturn;\n\t\t}\n\t\tif (visiting.has(module.namespace)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Cyclic Fabric module dependency detected: ${[...path, module.namespace].join(\" -> \")}`,\n\t\t\t);\n\t\t}\n\n\t\tvisiting.add(module.namespace);\n\t\tfor (const dependency of (module.dependencies ?? []).map(getModuleDependencyNamespace)) {\n\t\t\tconst dependencyModule = modulesByNamespace.get(dependency);\n\t\t\tif (!dependencyModule) {\n\t\t\t\tif (registeredNamespaces.has(dependency)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tthrow new Error(`Module \"${module.namespace}\" depends on missing module \"${dependency}\".`);\n\t\t\t}\n\t\t\tvisit(dependencyModule, [...path, module.namespace]);\n\t\t}\n\t\tvisiting.delete(module.namespace);\n\t\tvisited.add(module.namespace);\n\t\tsorted.push(module);\n\t}\n\n\tfor (const module of modules) {\n\t\tvisit(module, []);\n\t}\n\n\treturn sorted;\n}\n\nfunction assertAcyclicRelations(modules: FabricModule<unknown>[]): void {\n\tconst relationKinds = [\n\t\t{ label: \"owned containment\", include: (relation: ObjectRelationDefinition) => relation.semantics === \"owned\" },\n\t\t{ label: \"cascade-delete\", include: (relation: ObjectRelationDefinition) => relation.onTargetDelete === \"cascade\" },\n\t\t{ label: \"required-construction\", include: (relation: ObjectRelationDefinition) => relation.required === true },\n\t];\n\tfor (const kind of relationKinds) {\n\t\tconst edges = new Map<string, string[]>();\n\t\tfor (const module of modules) {\n\t\t\tfor (const objectType of module.objectTypes ?? []) {\n\t\t\t\tif (typeof objectType === \"string\") continue;\n\t\t\t\tconst source = qualifiedObjectType(module.namespace, objectType.type);\n\t\t\t\tedges.set(source, (objectType.relations ?? []).filter(kind.include).map((relation) => relation.target));\n\t\t\t}\n\t\t}\n\t\tconst visiting = new Set<string>();\n\t\tconst visited = new Set<string>();\n\t\tconst visit = (node: string, path: string[]): void => {\n\t\t\tif (visiting.has(node)) {\n\t\t\t\tthrow new Error(`${kind.label} relation cycle detected: ${[...path, node].join(\" -> \")}`);\n\t\t\t}\n\t\t\tif (visited.has(node)) return;\n\t\t\tvisiting.add(node);\n\t\t\tfor (const target of edges.get(node) ?? []) visit(target, [...path, node]);\n\t\t\tvisiting.delete(node);\n\t\t\tvisited.add(node);\n\t\t};\n\t\tfor (const node of edges.keys()) visit(node, []);\n\t}\n}\n\nexport function validateAndOrderFabricModules<TDb = unknown>(modules: FabricModule<TDb>[]): FabricModule<TDb>[] {\n\tconst availableNamespaces = new Set(modules.map((module) => module.namespace));\n\tconst plannedEventTypes = new Set(\n\t\tmodules.flatMap((module) => (module.eventTypes ?? []).map(getEventTypeName)),\n\t);\n\tfor (const eventType of createEventContractRegistry().eventTypes()) plannedEventTypes.add(eventType);\n\tconst availableObjectTypes = new Set([\n\t\t...modules.flatMap((module) =>\n\t\t\t(module.objectTypes ?? []).map((objectType) => qualifiedObjectType(module.namespace, getObjectTypeName(objectType))),\n\t\t),\n\t]);\n\n\tfor (const module of modules) {\n\t\tvalidateManifest(module as FabricModule<unknown>, { availableNamespaces, plannedEventTypes, availableObjectTypes });\n\t}\n\tassertAcyclicRelations(modules as FabricModule<unknown>[]);\n\treturn sortModulesByDependency(modules as FabricModule<unknown>[]) as FabricModule<TDb>[];\n}\n\n/** @deprecated Use createModuleRegistry(); registration is now explicit and instance-scoped. */\nexport function registerFabricModules<TDb = unknown>(modules: FabricModule<TDb>[]): FabricModule<TDb>[] {\n\treturn validateAndOrderFabricModules(modules);\n}\n\n/** @deprecated Use createModuleRegistry([module]); registration is now explicit and instance-scoped. */\nexport function registerFabricModule<TDb = unknown>(module: FabricModule<TDb>): void {\n\tvalidateAndOrderFabricModules([module]);\n}\n"],"mappings":";;;;;AAyLA,SAAgB,6BAA6B,YAA2C;CACvF,OAAO,OAAO,eAAe,WAAW,aAAa,WAAW;AACjE;AAEA,SAAgB,kBAAkB,YAAiD;CAClF,OAAO,OAAO,eAAe,WAAW,aAAa,WAAW;AACjE;AAEA,SAAgB,iBAAiB,WAA+C;CAC/E,OAAO,OAAO,cAAc,WAAW,YAAY,UAAU;AAC9D;AAEA,SAAgB,wBAAwB,WAAyB;CAChE,IAAI,CAAC,WACJ,MAAM,IAAI,MAAM,kCAAkC;CAEnD,IAAI,CAAC,oBAAoB,KAAK,SAAS,GACtC,MAAM,IAAI,MACT,8BAA8B,UAAU,yDACzC;AAEF;AAEA,SAAgB,qBACf,UAA+B,CAAC,GACV;CACtB,MAAM,iBAAiB,8BAA8B,OAAO;CAC5D,MAAM,aAAa,IAAI,IAAI,eAAe,KAAK,WAAW,CAAC,OAAO,WAAW,MAAM,CAAC,CAAC;CACrF,MAAM,UAAU,IAAI,IAAI,eAAe,SAAS,YAAY,OAAO,WAAW,CAAC,EAAA,CAAG,KAAK,WAAW,CAAC,OAAO,UAAU,MAAM,CAAU,CAAC,CAAC;CACtI,MAAM,WAAW,IAAI,IAAI,eAAe,SAAS,YAAY,OAAO,YAAY,CAAC,EAAA,CAAG,KAAK,WAAW;EACnG,M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AO,8BAA8B,OAAO;AAC7C;;AAGA,SAAgB,qBAAoC,QAAiC;CACpF,8BAA8B,CAAC,MAAM,CAAC;AACvC"}
@@ -1,24 +1,357 @@
1
- 'use strict';
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region objects/index.ts
3
+ const BUILT_IN_OBJECT_TYPES = Object.freeze([
4
+ "AssetEvent",
5
+ "ActionInvocation",
6
+ "PolicyEvaluation",
7
+ "ApprovalRequest",
8
+ "ConsentRecord",
9
+ "AgentRun"
10
+ ]);
11
+ const supportedSchemaKeywords = Object.freeze([
12
+ "$schema",
13
+ "$id",
14
+ "$ref",
15
+ "$defs",
16
+ "title",
17
+ "description",
18
+ "type",
19
+ "enum",
20
+ "const",
21
+ "properties",
22
+ "required",
23
+ "additionalProperties",
24
+ "items",
25
+ "prefixItems",
26
+ "propertyNames",
27
+ "patternProperties",
28
+ "dependentRequired",
29
+ "allOf",
30
+ "anyOf",
31
+ "oneOf",
32
+ "not",
33
+ "minimum",
34
+ "maximum",
35
+ "exclusiveMinimum",
36
+ "exclusiveMaximum",
37
+ "minLength",
38
+ "maxLength",
39
+ "pattern",
40
+ "format",
41
+ "minItems",
42
+ "maxItems",
43
+ "uniqueItems",
44
+ "default",
45
+ "readOnly",
46
+ "writeOnly",
47
+ "deprecated",
48
+ "contentEncoding",
49
+ "contentMediaType",
50
+ "multipleOf",
51
+ "if",
52
+ "then",
53
+ "else",
54
+ "examples",
55
+ "$comment"
56
+ ]);
57
+ function assertPortableJsonSchema(schema, path = "schema") {
58
+ if (!schema || typeof schema !== "object" || Array.isArray(schema)) throw new Error(`${path} must be a JSON Schema object.`);
59
+ const value = schema;
60
+ for (const keyword of Object.keys(value)) if (!supportedSchemaKeywords.includes(keyword) && !keyword.startsWith("x-")) throw new Error(`${path} uses unsupported JSON Schema keyword "${keyword}".`);
61
+ if (value.properties !== void 0) {
62
+ if (!value.properties || typeof value.properties !== "object" || Array.isArray(value.properties)) throw new Error(`${path}.properties must be an object.`);
63
+ for (const [name, child] of Object.entries(value.properties)) assertPortableJsonSchema(child, `${path}.properties.${name}`);
64
+ }
65
+ if (value.$defs !== void 0) {
66
+ if (!value.$defs || typeof value.$defs !== "object" || Array.isArray(value.$defs)) throw new Error(`${path}.$defs must be an object.`);
67
+ for (const [name, child] of Object.entries(value.$defs)) assertPortableJsonSchema(child, `${path}.$defs.${name}`);
68
+ }
69
+ if (value.patternProperties !== void 0) {
70
+ if (!value.patternProperties || typeof value.patternProperties !== "object" || Array.isArray(value.patternProperties)) throw new Error(`${path}.patternProperties must be an object.`);
71
+ for (const [name, child] of Object.entries(value.patternProperties)) assertPortableJsonSchema(child, `${path}.patternProperties.${name}`);
72
+ }
73
+ for (const keyword of [
74
+ "allOf",
75
+ "anyOf",
76
+ "oneOf"
77
+ ]) if (value[keyword] !== void 0) {
78
+ if (!Array.isArray(value[keyword])) throw new Error(`${path}.${keyword} must be an array.`);
79
+ value[keyword].forEach((child, index) => assertPortableJsonSchema(child, `${path}.${keyword}[${index}]`));
80
+ }
81
+ if (value.not !== void 0) assertPortableJsonSchema(value.not, `${path}.not`);
82
+ for (const keyword of [
83
+ "propertyNames",
84
+ "if",
85
+ "then",
86
+ "else"
87
+ ]) if (value[keyword] !== void 0) assertPortableJsonSchema(value[keyword], `${path}.${keyword}`);
88
+ if (value.additionalProperties !== void 0 && typeof value.additionalProperties !== "boolean") assertPortableJsonSchema(value.additionalProperties, `${path}.additionalProperties`);
89
+ if (value.items !== void 0) {
90
+ if (Array.isArray(value.items)) value.items.forEach((child, index) => assertPortableJsonSchema(child, `${path}.items[${index}]`));
91
+ else assertPortableJsonSchema(value.items, `${path}.items`);
92
+ }
93
+ if (value.prefixItems !== void 0) {
94
+ if (!Array.isArray(value.prefixItems)) throw new Error(`${path}.prefixItems must be an array.`);
95
+ value.prefixItems.forEach((child, index) => assertPortableJsonSchema(child, `${path}.prefixItems[${index}]`));
96
+ }
97
+ if (value.dependentRequired !== void 0) {
98
+ if (!value.dependentRequired || typeof value.dependentRequired !== "object" || Array.isArray(value.dependentRequired) || Object.values(value.dependentRequired).some((items) => !Array.isArray(items) || items.some((item) => typeof item !== "string"))) throw new Error(`${path}.dependentRequired must map property names to arrays of property names.`);
99
+ }
100
+ if (value.required !== void 0 && (!Array.isArray(value.required) || value.required.some((item) => typeof item !== "string"))) throw new Error(`${path}.required must be an array of property names.`);
101
+ }
102
+ /**
103
+ * Validate JSON data against the dependency-free JSON Schema profile used by
104
+ * portable contracts. This intentionally returns issues instead of throwing so
105
+ * hosts can expose a stable, typed validation failure without leaking values.
106
+ */
107
+ function validatePortableJson(schema, value) {
108
+ const issues = [];
109
+ validateSchema(schema, value, [], schema, issues, /* @__PURE__ */ new Set());
110
+ return issues;
111
+ }
112
+ function validateSchema(schema, value, path, root, issues, refStack) {
113
+ if (!isJsonValue(value)) {
114
+ issues.push({
115
+ path,
116
+ message: "Value must contain JSON-serializable data."
117
+ });
118
+ return;
119
+ }
120
+ if (schema.$ref) {
121
+ if (!schema.$ref.startsWith("#/$defs/")) {
122
+ issues.push({
123
+ path,
124
+ message: `Unsupported JSON Schema reference "${schema.$ref}".`
125
+ });
126
+ return;
127
+ }
128
+ const name = schema.$ref.slice(8);
129
+ const referenced = root.$defs?.[name];
130
+ if (!referenced) {
131
+ issues.push({
132
+ path,
133
+ message: `JSON Schema reference "${schema.$ref}" was not found.`
134
+ });
135
+ return;
136
+ }
137
+ if (refStack.has(schema.$ref)) {
138
+ issues.push({
139
+ path,
140
+ message: `Circular JSON Schema reference "${schema.$ref}" is not supported.`
141
+ });
142
+ return;
143
+ }
144
+ const nextRefs = new Set(refStack);
145
+ nextRefs.add(schema.$ref);
146
+ validateSchema(referenced, value, path, root, issues, nextRefs);
147
+ }
148
+ if (schema.allOf) for (const child of schema.allOf) validateSchema(child, value, path, root, issues, refStack);
149
+ if (schema.anyOf && !schema.anyOf.some((child) => validateWithoutIssues(child, value, root, refStack))) issues.push({
150
+ path,
151
+ message: "Value must satisfy at least one JSON Schema alternative."
152
+ });
153
+ if (schema.oneOf && schema.oneOf.filter((child) => validateWithoutIssues(child, value, root, refStack)).length !== 1) issues.push({
154
+ path,
155
+ message: "Value must satisfy exactly one JSON Schema alternative."
156
+ });
157
+ if (schema.not && validateWithoutIssues(schema.not, value, root, refStack)) issues.push({
158
+ path,
159
+ message: "Value must not satisfy the JSON Schema exclusion."
160
+ });
161
+ if (schema.if) {
162
+ const condition = validateWithoutIssues(schema.if, value, root, refStack);
163
+ if (condition && schema.then) validateSchema(schema.then, value, path, root, issues, refStack);
164
+ if (!condition && schema.else) validateSchema(schema.else, value, path, root, issues, refStack);
165
+ }
166
+ if (schema.const !== void 0 && !jsonValuesEqual(value, schema.const)) issues.push({
167
+ path,
168
+ message: "Value does not match the JSON Schema const."
169
+ });
170
+ if (schema.enum && !schema.enum.some((item) => jsonValuesEqual(value, item))) issues.push({
171
+ path,
172
+ message: "Value is not one of the allowed JSON Schema enum values."
173
+ });
174
+ if (schema.type !== void 0) {
175
+ const types = Array.isArray(schema.type) ? schema.type : [schema.type];
176
+ if (!types.some((type) => matchesJsonType(type, value))) {
177
+ issues.push({
178
+ path,
179
+ message: `Value must have JSON Schema type ${types.join(" or ")}.`
180
+ });
181
+ return;
182
+ }
183
+ }
184
+ if (typeof value === "string") {
185
+ if (schema.minLength !== void 0 && [...value].length < schema.minLength) issues.push({
186
+ path,
187
+ message: `String must contain at least ${schema.minLength} characters.`
188
+ });
189
+ if (schema.maxLength !== void 0 && [...value].length > schema.maxLength) issues.push({
190
+ path,
191
+ message: `String must contain at most ${schema.maxLength} characters.`
192
+ });
193
+ if (schema.pattern !== void 0) try {
194
+ if (!new RegExp(schema.pattern).test(value)) issues.push({
195
+ path,
196
+ message: "String does not match the JSON Schema pattern."
197
+ });
198
+ } catch {
199
+ issues.push({
200
+ path,
201
+ message: "JSON Schema pattern is invalid."
202
+ });
203
+ }
204
+ }
205
+ if (typeof value === "number") {
206
+ if (schema.minimum !== void 0 && value < schema.minimum) issues.push({
207
+ path,
208
+ message: `Number must be greater than or equal to ${schema.minimum}.`
209
+ });
210
+ if (schema.maximum !== void 0 && value > schema.maximum) issues.push({
211
+ path,
212
+ message: `Number must be less than or equal to ${schema.maximum}.`
213
+ });
214
+ if (schema.exclusiveMinimum !== void 0 && value <= schema.exclusiveMinimum) issues.push({
215
+ path,
216
+ message: `Number must be greater than ${schema.exclusiveMinimum}.`
217
+ });
218
+ if (schema.exclusiveMaximum !== void 0 && value >= schema.exclusiveMaximum) issues.push({
219
+ path,
220
+ message: `Number must be less than ${schema.exclusiveMaximum}.`
221
+ });
222
+ if (schema.multipleOf !== void 0 && !isMultipleOf(value, schema.multipleOf)) issues.push({
223
+ path,
224
+ message: `Number must be a multiple of ${schema.multipleOf}.`
225
+ });
226
+ }
227
+ if (Array.isArray(value)) {
228
+ if (schema.minItems !== void 0 && value.length < schema.minItems) issues.push({
229
+ path,
230
+ message: `Array must contain at least ${schema.minItems} items.`
231
+ });
232
+ if (schema.maxItems !== void 0 && value.length > schema.maxItems) issues.push({
233
+ path,
234
+ message: `Array must contain at most ${schema.maxItems} items.`
235
+ });
236
+ if (schema.uniqueItems && value.some((item, index) => value.findIndex((other) => jsonValuesEqual(item, other)) !== index)) issues.push({
237
+ path,
238
+ message: "Array items must be unique."
239
+ });
240
+ if (schema.prefixItems) {
241
+ for (const [index, child] of schema.prefixItems.entries()) if (index < value.length) validateSchema(child, value[index], [...path, index], root, issues, refStack);
242
+ }
243
+ if (schema.items && !Array.isArray(schema.items)) for (const [index, item] of value.entries()) validateSchema(schema.items, item, [...path, index], root, issues, refStack);
244
+ }
245
+ if (value && typeof value === "object" && !Array.isArray(value)) {
246
+ const object = value;
247
+ for (const required of schema.required ?? []) if (!(required in object)) issues.push({
248
+ path: [...path, required],
249
+ message: "Required property is missing."
250
+ });
251
+ for (const [name, child] of Object.entries(schema.properties ?? {})) if (name in object) validateSchema(child, object[name], [...path, name], root, issues, refStack);
252
+ for (const [name, child] of Object.entries(schema.patternProperties ?? {})) {
253
+ let matcher;
254
+ try {
255
+ matcher = new RegExp(name);
256
+ } catch {
257
+ issues.push({
258
+ path,
259
+ message: "JSON Schema patternProperties pattern is invalid."
260
+ });
261
+ continue;
262
+ }
263
+ for (const property of Object.keys(object)) if (matcher.test(property)) validateSchema(child, object[property], [...path, property], root, issues, refStack);
264
+ }
265
+ if (schema.propertyNames) for (const property of Object.keys(object)) validateSchema(schema.propertyNames, property, [...path, property], root, issues, refStack);
266
+ if (schema.additionalProperties === false) {
267
+ const declared = new Set(Object.keys(schema.properties ?? {}));
268
+ for (const property of Object.keys(schema.patternProperties ?? {})) declared.add(property);
269
+ for (const property of Object.keys(object)) {
270
+ const matchesPattern = Object.keys(schema.patternProperties ?? {}).some((pattern) => {
271
+ try {
272
+ return new RegExp(pattern).test(property);
273
+ } catch {
274
+ return false;
275
+ }
276
+ });
277
+ if (!declared.has(property) && !matchesPattern) issues.push({
278
+ path: [...path, property],
279
+ message: "Additional properties are not permitted."
280
+ });
281
+ }
282
+ } else if (schema.additionalProperties && typeof schema.additionalProperties === "object") {
283
+ const declared = new Set(Object.keys(schema.properties ?? {}));
284
+ for (const property of Object.keys(object)) if (!declared.has(property)) validateSchema(schema.additionalProperties, object[property], [...path, property], root, issues, refStack);
285
+ }
286
+ for (const [property, dependencies] of Object.entries(schema.dependentRequired ?? {})) if (property in object) {
287
+ for (const dependency of dependencies) if (!(dependency in object)) issues.push({
288
+ path: [...path, dependency],
289
+ message: `Property is required when "${property}" is present.`
290
+ });
291
+ }
292
+ }
293
+ }
294
+ function validateWithoutIssues(schema, value, root, refStack) {
295
+ const issues = [];
296
+ validateSchema(schema, value, [], root, issues, refStack);
297
+ return issues.length === 0;
298
+ }
299
+ function matchesJsonType(type, value) {
300
+ switch (type) {
301
+ case "null": return value === null;
302
+ case "boolean": return typeof value === "boolean";
303
+ case "object": return Boolean(value) && typeof value === "object" && !Array.isArray(value);
304
+ case "array": return Array.isArray(value);
305
+ case "number": return typeof value === "number" && Number.isFinite(value);
306
+ case "integer": return typeof value === "number" && Number.isSafeInteger(value);
307
+ case "string": return typeof value === "string";
308
+ }
309
+ }
310
+ function isMultipleOf(value, divisor) {
311
+ if (!Number.isFinite(divisor) || divisor <= 0) return false;
312
+ const quotient = value / divisor;
313
+ return Math.abs(quotient - Math.round(quotient)) < Number.EPSILON * Math.max(1, Math.abs(quotient));
314
+ }
315
+ function jsonValuesEqual(left, right) {
316
+ if (Object.is(left, right)) return true;
317
+ if (typeof left !== typeof right || left === null || right === null) return false;
318
+ if (Array.isArray(left) && Array.isArray(right)) return left.length === right.length && left.every((item, index) => jsonValuesEqual(item, right[index]));
319
+ if (typeof left === "object" && typeof right === "object") {
320
+ const leftObject = left;
321
+ const rightObject = right;
322
+ const keys = Object.keys(leftObject);
323
+ return keys.length === Object.keys(rightObject).length && keys.every((key) => key in rightObject && jsonValuesEqual(leftObject[key], rightObject[key]));
324
+ }
325
+ return false;
326
+ }
327
+ function isJsonValue(value) {
328
+ if (value === null || typeof value === "string" || typeof value === "boolean") return true;
329
+ if (typeof value === "number") return Number.isFinite(value);
330
+ if (Array.isArray(value)) return value.every(isJsonValue);
331
+ if (value && typeof value === "object") {
332
+ const prototype = Object.getPrototypeOf(value);
333
+ return (prototype === Object.prototype || prototype === null) && Object.values(value).every(isJsonValue);
334
+ }
335
+ return false;
336
+ }
337
+ function assertObjectType(type) {
338
+ if (!/^[A-Z][a-zA-Z0-9]*$/.test(type)) throw new Error(`Invalid object type: "${type}". Object types must be PascalCase alphanumeric.`);
339
+ }
340
+ function createObjectTypeRegistry(initialTypes = []) {
341
+ const objectTypes = /* @__PURE__ */ new Set([...BUILT_IN_OBJECT_TYPES, ...initialTypes]);
342
+ return {
343
+ register(type) {
344
+ assertObjectType(type);
345
+ objectTypes.add(type);
346
+ },
347
+ has: (type) => objectTypes.has(type),
348
+ list: () => Array.from(objectTypes).sort()
349
+ };
350
+ }
351
+ //#endregion
352
+ exports.assertObjectType = assertObjectType;
353
+ exports.assertPortableJsonSchema = assertPortableJsonSchema;
354
+ exports.createObjectTypeRegistry = createObjectTypeRegistry;
355
+ exports.validatePortableJson = validatePortableJson;
2
356
 
3
- var chunkIFW43ELT_cjs = require('../chunk-IFW43ELT.cjs');
4
-
5
-
6
-
7
- Object.defineProperty(exports, "assertObjectType", {
8
- enumerable: true,
9
- get: function () { return chunkIFW43ELT_cjs.assertObjectType; }
10
- });
11
- Object.defineProperty(exports, "assertPortableJsonSchema", {
12
- enumerable: true,
13
- get: function () { return chunkIFW43ELT_cjs.assertPortableJsonSchema; }
14
- });
15
- Object.defineProperty(exports, "createObjectTypeRegistry", {
16
- enumerable: true,
17
- get: function () { return chunkIFW43ELT_cjs.createObjectTypeRegistry; }
18
- });
19
- Object.defineProperty(exports, "validatePortableJson", {
20
- enumerable: true,
21
- get: function () { return chunkIFW43ELT_cjs.validatePortableJson; }
22
- });
23
- //# sourceMappingURL=index.cjs.map
24
357
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../objects/index.ts"],"sourcesContent":["const BUILT_IN_OBJECT_TYPES = Object.freeze([\n\t\"AssetEvent\",\n\t\"ActionInvocation\",\n\t\"PolicyEvaluation\",\n\t\"ApprovalRequest\",\n\t\"ConsentRecord\",\n\t\"AgentRun\",\n]);\n\nexport type FabricObjectType = string;\n\nexport type JsonPrimitive = string | number | boolean | null;\nexport type JsonValue = JsonPrimitive | JsonValue[] | { [key: string]: JsonValue };\n\n/**\n * Dependency-free JSON Schema profile accepted in portable module manifests.\n * Unknown extension keywords must use an `x-` prefix. Runtime validators may\n * support more vocabulary, but exported entity contracts stay in this profile.\n */\nexport interface PortableJsonSchema {\n\t$schema?: string;\n\t$id?: string;\n\t$ref?: string;\n\t$defs?: Record<string, PortableJsonSchema>;\n\ttitle?: string;\n\tdescription?: string;\n\ttype?: \"null\" | \"boolean\" | \"object\" | \"array\" | \"number\" | \"integer\" | \"string\" | Array<\"null\" | \"boolean\" | \"object\" | \"array\" | \"number\" | \"integer\" | \"string\">;\n\tenum?: JsonValue[];\n\tconst?: JsonValue;\n\tproperties?: Record<string, PortableJsonSchema>;\n\trequired?: string[];\n\tadditionalProperties?: boolean | PortableJsonSchema;\n\titems?: PortableJsonSchema | PortableJsonSchema[];\n\tprefixItems?: PortableJsonSchema[];\n\tpropertyNames?: PortableJsonSchema;\n\tpatternProperties?: Record<string, PortableJsonSchema>;\n\tdependentRequired?: Record<string, string[]>;\n\tallOf?: PortableJsonSchema[];\n\tanyOf?: PortableJsonSchema[];\n\toneOf?: PortableJsonSchema[];\n\tnot?: PortableJsonSchema;\n\tif?: PortableJsonSchema;\n\tthen?: PortableJsonSchema;\n\telse?: PortableJsonSchema;\n\tminimum?: number;\n\tmaximum?: number;\n\texclusiveMinimum?: number;\n\texclusiveMaximum?: number;\n\tmultipleOf?: number;\n\tminLength?: number;\n\tmaxLength?: number;\n\tpattern?: string;\n\tformat?: string;\n\tminItems?: number;\n\tmaxItems?: number;\n\tuniqueItems?: boolean;\n\tdefault?: JsonValue;\n\treadOnly?: boolean;\n\twriteOnly?: boolean;\n\tdeprecated?: boolean;\n\tcontentEncoding?: string;\n\tcontentMediaType?: string;\n\texamples?: JsonValue[];\n\t$comment?: string;\n\t[key: `x-${string}`]: JsonValue | undefined;\n}\n\nconst supportedSchemaKeywords = Object.freeze([\n\t\"$schema\", \"$id\", \"$ref\", \"$defs\", \"title\", \"description\", \"type\", \"enum\", \"const\",\n\t\"properties\", \"required\", \"additionalProperties\", \"items\", \"prefixItems\", \"propertyNames\", \"patternProperties\", \"dependentRequired\", \"allOf\", \"anyOf\", \"oneOf\",\n\t\"not\", \"minimum\", \"maximum\", \"exclusiveMinimum\", \"exclusiveMaximum\", \"minLength\",\n\t\"maxLength\", \"pattern\", \"format\", \"minItems\", \"maxItems\", \"uniqueItems\", \"default\",\n\t\"readOnly\", \"writeOnly\", \"deprecated\", \"contentEncoding\", \"contentMediaType\", \"multipleOf\", \"if\", \"then\", \"else\", \"examples\", \"$comment\",\n]);\n\nexport function assertPortableJsonSchema(\n\tschema: unknown,\n\tpath = \"schema\",\n): asserts schema is PortableJsonSchema {\n\tif (!schema || typeof schema !== \"object\" || Array.isArray(schema)) {\n\t\tthrow new Error(`${path} must be a JSON Schema object.`);\n\t}\n\tconst value = schema as Record<string, unknown>;\n\tfor (const keyword of Object.keys(value)) {\n\t\tif (!supportedSchemaKeywords.includes(keyword) && !keyword.startsWith(\"x-\")) {\n\t\t\tthrow new Error(`${path} uses unsupported JSON Schema keyword \"${keyword}\".`);\n\t\t}\n\t}\n\tif (value.properties !== undefined) {\n\t\tif (!value.properties || typeof value.properties !== \"object\" || Array.isArray(value.properties)) {\n\t\t\tthrow new Error(`${path}.properties must be an object.`);\n\t\t}\n\t\tfor (const [name, child] of Object.entries(value.properties)) {\n\t\t\tassertPortableJsonSchema(child, `${path}.properties.${name}`);\n\t\t}\n\t}\n\tif (value.$defs !== undefined) {\n\t\tif (!value.$defs || typeof value.$defs !== \"object\" || Array.isArray(value.$defs)) {\n\t\t\tthrow new Error(`${path}.$defs must be an object.`);\n\t\t}\n\t\tfor (const [name, child] of Object.entries(value.$defs)) {\n\t\t\tassertPortableJsonSchema(child, `${path}.$defs.${name}`);\n\t\t}\n\t}\n\tif (value.patternProperties !== undefined) {\n\t\tif (!value.patternProperties || typeof value.patternProperties !== \"object\" || Array.isArray(value.patternProperties)) throw new Error(`${path}.patternProperties must be an object.`);\n\t\tfor (const [name, child] of Object.entries(value.patternProperties)) assertPortableJsonSchema(child, `${path}.patternProperties.${name}`);\n\t}\n\tfor (const keyword of [\"allOf\", \"anyOf\", \"oneOf\"] as const) {\n\t\tif (value[keyword] !== undefined) {\n\t\t\tif (!Array.isArray(value[keyword])) throw new Error(`${path}.${keyword} must be an array.`);\n\t\t\tvalue[keyword].forEach((child, index) => assertPortableJsonSchema(child, `${path}.${keyword}[${index}]`));\n\t\t}\n\t}\n\tif (value.not !== undefined) assertPortableJsonSchema(value.not, `${path}.not`);\n\tfor (const keyword of [\"propertyNames\", \"if\", \"then\", \"else\"] as const) if (value[keyword] !== undefined) assertPortableJsonSchema(value[keyword], `${path}.${keyword}`);\n\tif (value.additionalProperties !== undefined && typeof value.additionalProperties !== \"boolean\") {\n\t\tassertPortableJsonSchema(value.additionalProperties, `${path}.additionalProperties`);\n\t}\n\tif (value.items !== undefined) {\n\t\tif (Array.isArray(value.items)) {\n\t\t\tvalue.items.forEach((child, index) => assertPortableJsonSchema(child, `${path}.items[${index}]`));\n\t\t} else {\n\t\t\tassertPortableJsonSchema(value.items, `${path}.items`);\n\t\t}\n\t}\n\tif (value.prefixItems !== undefined) {\n\t\tif (!Array.isArray(value.prefixItems)) throw new Error(`${path}.prefixItems must be an array.`);\n\t\tvalue.prefixItems.forEach((child, index) => assertPortableJsonSchema(child, `${path}.prefixItems[${index}]`));\n\t}\n\tif (value.dependentRequired !== undefined) {\n\t\tif (!value.dependentRequired || typeof value.dependentRequired !== \"object\" || Array.isArray(value.dependentRequired) || Object.values(value.dependentRequired).some((items) => !Array.isArray(items) || items.some((item) => typeof item !== \"string\"))) throw new Error(`${path}.dependentRequired must map property names to arrays of property names.`);\n\t}\n\tif (value.required !== undefined && (!Array.isArray(value.required) || value.required.some((item) => typeof item !== \"string\"))) {\n\t\tthrow new Error(`${path}.required must be an array of property names.`);\n\t}\n}\n\nexport interface JsonSchemaValidationIssue {\n\tpath: Array<string | number>;\n\tmessage: string;\n}\n\n/**\n * Validate JSON data against the dependency-free JSON Schema profile used by\n * portable contracts. This intentionally returns issues instead of throwing so\n * hosts can expose a stable, typed validation failure without leaking values.\n */\nexport function validatePortableJson(\n\tschema: PortableJsonSchema,\n\tvalue: unknown,\n): JsonSchemaValidationIssue[] {\n\tconst issues: JsonSchemaValidationIssue[] = [];\n\tvalidateSchema(schema, value, [], schema, issues, new Set());\n\treturn issues;\n}\n\nfunction validateSchema(\n\tschema: PortableJsonSchema,\n\tvalue: unknown,\n\tpath: Array<string | number>,\n\troot: PortableJsonSchema,\n\tissues: JsonSchemaValidationIssue[],\n\trefStack: Set<string>,\n): void {\n\tif (!isJsonValue(value)) {\n\t\tissues.push({ path, message: \"Value must contain JSON-serializable data.\" });\n\t\treturn;\n\t}\n\tif (schema.$ref) {\n\t\tconst prefix = \"#/$defs/\";\n\t\tif (!schema.$ref.startsWith(prefix)) {\n\t\t\tissues.push({ path, message: `Unsupported JSON Schema reference \"${schema.$ref}\".` });\n\t\t\treturn;\n\t\t}\n\t\tconst name = schema.$ref.slice(prefix.length);\n\t\tconst referenced = root.$defs?.[name];\n\t\tif (!referenced) {\n\t\t\tissues.push({ path, message: `JSON Schema reference \"${schema.$ref}\" was not found.` });\n\t\t\treturn;\n\t\t}\n\t\tif (refStack.has(schema.$ref)) {\n\t\t\tissues.push({ path, message: `Circular JSON Schema reference \"${schema.$ref}\" is not supported.` });\n\t\t\treturn;\n\t\t}\n\t\tconst nextRefs = new Set(refStack);\n\t\tnextRefs.add(schema.$ref);\n\t\tvalidateSchema(referenced, value, path, root, issues, nextRefs);\n\t}\n\n\tif (schema.allOf) {\n\t\tfor (const child of schema.allOf) validateSchema(child, value, path, root, issues, refStack);\n\t}\n\tif (schema.anyOf && !schema.anyOf.some((child) => validateWithoutIssues(child, value, root, refStack))) {\n\t\tissues.push({ path, message: \"Value must satisfy at least one JSON Schema alternative.\" });\n\t}\n\tif (schema.oneOf && schema.oneOf.filter((child) => validateWithoutIssues(child, value, root, refStack)).length !== 1) {\n\t\tissues.push({ path, message: \"Value must satisfy exactly one JSON Schema alternative.\" });\n\t}\n\tif (schema.not && validateWithoutIssues(schema.not, value, root, refStack)) {\n\t\tissues.push({ path, message: \"Value must not satisfy the JSON Schema exclusion.\" });\n\t}\n\n\tif (schema.if) {\n\t\tconst condition = validateWithoutIssues(schema.if, value, root, refStack);\n\t\tif (condition && schema.then) validateSchema(schema.then, value, path, root, issues, refStack);\n\t\tif (!condition && schema.else) validateSchema(schema.else, value, path, root, issues, refStack);\n\t}\n\n\tif (schema.const !== undefined && !jsonValuesEqual(value, schema.const)) {\n\t\tissues.push({ path, message: \"Value does not match the JSON Schema const.\" });\n\t}\n\tif (schema.enum && !schema.enum.some((item) => jsonValuesEqual(value, item))) {\n\t\tissues.push({ path, message: \"Value is not one of the allowed JSON Schema enum values.\" });\n\t}\n\n\tif (schema.type !== undefined) {\n\t\tconst types = Array.isArray(schema.type) ? schema.type : [schema.type];\n\t\tif (!types.some((type) => matchesJsonType(type, value))) {\n\t\t\tissues.push({ path, message: `Value must have JSON Schema type ${types.join(\" or \")}.` });\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif (typeof value === \"string\") {\n\t\tif (schema.minLength !== undefined && [...value].length < schema.minLength) issues.push({ path, message: `String must contain at least ${schema.minLength} characters.` });\n\t\tif (schema.maxLength !== undefined && [...value].length > schema.maxLength) issues.push({ path, message: `String must contain at most ${schema.maxLength} characters.` });\n\t\tif (schema.pattern !== undefined) {\n\t\t\ttry {\n\t\t\t\tif (!new RegExp(schema.pattern).test(value)) issues.push({ path, message: \"String does not match the JSON Schema pattern.\" });\n\t\t\t} catch {\n\t\t\t\tissues.push({ path, message: \"JSON Schema pattern is invalid.\" });\n\t\t\t}\n\t\t}\n\t}\n\n\tif (typeof value === \"number\") {\n\t\tif (schema.minimum !== undefined && value < schema.minimum) issues.push({ path, message: `Number must be greater than or equal to ${schema.minimum}.` });\n\t\tif (schema.maximum !== undefined && value > schema.maximum) issues.push({ path, message: `Number must be less than or equal to ${schema.maximum}.` });\n\t\tif (schema.exclusiveMinimum !== undefined && value <= schema.exclusiveMinimum) issues.push({ path, message: `Number must be greater than ${schema.exclusiveMinimum}.` });\n\t\tif (schema.exclusiveMaximum !== undefined && value >= schema.exclusiveMaximum) issues.push({ path, message: `Number must be less than ${schema.exclusiveMaximum}.` });\n\t\tif (schema.multipleOf !== undefined && !isMultipleOf(value, schema.multipleOf)) issues.push({ path, message: `Number must be a multiple of ${schema.multipleOf}.` });\n\t}\n\n\tif (Array.isArray(value)) {\n\t\tif (schema.minItems !== undefined && value.length < schema.minItems) issues.push({ path, message: `Array must contain at least ${schema.minItems} items.` });\n\t\tif (schema.maxItems !== undefined && value.length > schema.maxItems) issues.push({ path, message: `Array must contain at most ${schema.maxItems} items.` });\n\t\tif (schema.uniqueItems && value.some((item, index) => value.findIndex((other) => jsonValuesEqual(item, other)) !== index)) issues.push({ path, message: \"Array items must be unique.\" });\n\t\tif (schema.prefixItems) {\n\t\t\tfor (const [index, child] of schema.prefixItems.entries()) {\n\t\t\t\tif (index < value.length) validateSchema(child, value[index], [...path, index], root, issues, refStack);\n\t\t\t}\n\t\t}\n\t\tif (schema.items && !Array.isArray(schema.items)) {\n\t\t\tfor (const [index, item] of value.entries()) validateSchema(schema.items, item, [...path, index], root, issues, refStack);\n\t\t}\n\t}\n\n\tif (value && typeof value === \"object\" && !Array.isArray(value)) {\n\t\tconst object = value as Record<string, unknown>;\n\t\tfor (const required of schema.required ?? []) {\n\t\t\tif (!(required in object)) issues.push({ path: [...path, required], message: \"Required property is missing.\" });\n\t\t}\n\t\tfor (const [name, child] of Object.entries(schema.properties ?? {})) {\n\t\t\tif (name in object) validateSchema(child, object[name], [...path, name], root, issues, refStack);\n\t\t}\n\t\tfor (const [name, child] of Object.entries(schema.patternProperties ?? {})) {\n\t\t\tlet matcher: RegExp;\n\t\t\ttry {\n\t\t\t\tmatcher = new RegExp(name);\n\t\t\t} catch {\n\t\t\t\tissues.push({ path, message: \"JSON Schema patternProperties pattern is invalid.\" });\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfor (const property of Object.keys(object)) {\n\t\t\t\tif (matcher.test(property)) validateSchema(child, object[property], [...path, property], root, issues, refStack);\n\t\t\t}\n\t\t}\n\t\tif (schema.propertyNames) {\n\t\t\tfor (const property of Object.keys(object)) validateSchema(schema.propertyNames, property, [...path, property], root, issues, refStack);\n\t\t}\n\t\tif (schema.additionalProperties === false) {\n\t\t\tconst declared = new Set(Object.keys(schema.properties ?? {}));\n\t\t\tfor (const property of Object.keys(schema.patternProperties ?? {})) declared.add(property);\n\t\t\tfor (const property of Object.keys(object)) {\n\t\t\t\tconst matchesPattern = Object.keys(schema.patternProperties ?? {}).some((pattern) => {\n\t\t\t\t\ttry { return new RegExp(pattern).test(property); } catch { return false; }\n\t\t\t\t});\n\t\t\t\tif (!declared.has(property) && !matchesPattern) issues.push({ path: [...path, property], message: \"Additional properties are not permitted.\" });\n\t\t\t}\n\t\t} else if (schema.additionalProperties && typeof schema.additionalProperties === \"object\") {\n\t\t\tconst declared = new Set(Object.keys(schema.properties ?? {}));\n\t\t\tfor (const property of Object.keys(object)) {\n\t\t\t\tif (!declared.has(property)) validateSchema(schema.additionalProperties, object[property], [...path, property], root, issues, refStack);\n\t\t\t}\n\t\t}\n\t\tfor (const [property, dependencies] of Object.entries(schema.dependentRequired ?? {})) {\n\t\t\tif (property in object) {\n\t\t\t\tfor (const dependency of dependencies) if (!(dependency in object)) issues.push({ path: [...path, dependency], message: `Property is required when \"${property}\" is present.` });\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction validateWithoutIssues(\n\tschema: PortableJsonSchema,\n\tvalue: unknown,\n\troot: PortableJsonSchema,\n\trefStack: Set<string>,\n): boolean {\n\tconst issues: JsonSchemaValidationIssue[] = [];\n\tvalidateSchema(schema, value, [], root, issues, refStack);\n\treturn issues.length === 0;\n}\n\ntype PortableJsonType = \"null\" | \"boolean\" | \"object\" | \"array\" | \"number\" | \"integer\" | \"string\";\n\nfunction matchesJsonType(type: PortableJsonType, value: unknown): boolean {\n\tswitch (type) {\n\t\tcase \"null\": return value === null;\n\t\tcase \"boolean\": return typeof value === \"boolean\";\n\t\tcase \"object\": return Boolean(value) && typeof value === \"object\" && !Array.isArray(value);\n\t\tcase \"array\": return Array.isArray(value);\n\t\tcase \"number\": return typeof value === \"number\" && Number.isFinite(value);\n\t\tcase \"integer\": return typeof value === \"number\" && Number.isSafeInteger(value);\n\t\tcase \"string\": return typeof value === \"string\";\n\t}\n}\n\nfunction isMultipleOf(value: number, divisor: number): boolean {\n\tif (!Number.isFinite(divisor) || divisor <= 0) return false;\n\tconst quotient = value / divisor;\n\treturn Math.abs(quotient - Math.round(quotient)) < Number.EPSILON * Math.max(1, Math.abs(quotient));\n}\n\nfunction jsonValuesEqual(left: unknown, right: unknown): boolean {\n\tif (Object.is(left, right)) return true;\n\tif (typeof left !== typeof right || left === null || right === null) return false;\n\tif (Array.isArray(left) && Array.isArray(right)) return left.length === right.length && left.every((item, index) => jsonValuesEqual(item, right[index]));\n\tif (typeof left === \"object\" && typeof right === \"object\") {\n\t\tconst leftObject = left as Record<string, unknown>;\n\t\tconst rightObject = right as Record<string, unknown>;\n\t\tconst keys = Object.keys(leftObject);\n\t\treturn keys.length === Object.keys(rightObject).length && keys.every((key) => key in rightObject && jsonValuesEqual(leftObject[key], rightObject[key]));\n\t}\n\treturn false;\n}\n\nfunction isJsonValue(value: unknown): value is JsonValue {\n\tif (value === null || typeof value === \"string\" || typeof value === \"boolean\") return true;\n\tif (typeof value === \"number\") return Number.isFinite(value);\n\tif (Array.isArray(value)) return value.every(isJsonValue);\n\tif (value && typeof value === \"object\") {\n\t\tconst prototype = Object.getPrototypeOf(value);\n\t\treturn (prototype === Object.prototype || prototype === null) &&\n\t\t\tObject.values(value as Record<string, unknown>).every(isJsonValue);\n\t}\n\treturn false;\n}\n\nexport function assertObjectType(type: string): asserts type is FabricObjectType {\n\tif (!/^[A-Z][a-zA-Z0-9]*$/.test(type)) {\n\t\tthrow new Error(\n\t\t\t`Invalid object type: \"${type}\". Object types must be PascalCase alphanumeric.`,\n\t\t);\n\t}\n}\n\nexport interface ObjectTypeRegistry {\n\tregister(type: string): void;\n\thas(type: string): boolean;\n\tlist(): string[];\n}\n\nexport function createObjectTypeRegistry(initialTypes: readonly string[] = []): ObjectTypeRegistry {\n\tconst objectTypes = new Set([...BUILT_IN_OBJECT_TYPES, ...initialTypes]);\n\treturn {\n\t\tregister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OAAO,MAAM,MAAM,WAAW;CACxD,IAAI,SAAS,OAAO,UAAU,UAAU;EACvC,MAAM,YAAY,OAAO,eAAe,KAAK;EAC7C,QAAQ,cAAc,OAAO,aAAa,cAAc,SACvD,OAAO,OAAO,KAAgC,CAAC,CAAC,MAAM,WAAW;CACnE;CACA,OAAO;AACR;AAEA,SAAgB,iBAAiB,MAAgD;CAChF,IAAI,CAAC,sBAAsB,KAAK,IAAI,GACnC,MAAM,IAAI,MACT,yBAAyB,KAAK,iDAC/B;AAEF;AAQA,SAAgB,yBAAyB,eAAkC,CAAC,GAAuB;CAClG,MAAM,8BAAc,IAAI,IAAI,CAAC,GAAG,uBAAuB,GAAG,YAAY,CAAC;CACvE,OAAO;EACN,SAAS,MAAM;GACd,iBAAiB,IAAI;GACrB,YAAY,IAAI,IAAI;EACrB;EACA,MAAM,SAAS,YAAY,IAAI,IAAI;EACnC,YAAY,MAAM,KAAK,WAAW,CAAC,CAAC,KAAK;CAC1C;AACD"}
@@ -1,77 +1,2 @@
1
- type FabricObjectType = string;
2
- type JsonPrimitive = string | number | boolean | null;
3
- type JsonValue = JsonPrimitive | JsonValue[] | {
4
- [key: string]: JsonValue;
5
- };
6
- /**
7
- * Dependency-free JSON Schema profile accepted in portable module manifests.
8
- * Unknown extension keywords must use an `x-` prefix. Runtime validators may
9
- * support more vocabulary, but exported entity contracts stay in this profile.
10
- */
11
- interface PortableJsonSchema {
12
- $schema?: string;
13
- $id?: string;
14
- $ref?: string;
15
- $defs?: Record<string, PortableJsonSchema>;
16
- title?: string;
17
- description?: string;
18
- type?: "null" | "boolean" | "object" | "array" | "number" | "integer" | "string" | Array<"null" | "boolean" | "object" | "array" | "number" | "integer" | "string">;
19
- enum?: JsonValue[];
20
- const?: JsonValue;
21
- properties?: Record<string, PortableJsonSchema>;
22
- required?: string[];
23
- additionalProperties?: boolean | PortableJsonSchema;
24
- items?: PortableJsonSchema | PortableJsonSchema[];
25
- prefixItems?: PortableJsonSchema[];
26
- propertyNames?: PortableJsonSchema;
27
- patternProperties?: Record<string, PortableJsonSchema>;
28
- dependentRequired?: Record<string, string[]>;
29
- allOf?: PortableJsonSchema[];
30
- anyOf?: PortableJsonSchema[];
31
- oneOf?: PortableJsonSchema[];
32
- not?: PortableJsonSchema;
33
- if?: PortableJsonSchema;
34
- then?: PortableJsonSchema;
35
- else?: PortableJsonSchema;
36
- minimum?: number;
37
- maximum?: number;
38
- exclusiveMinimum?: number;
39
- exclusiveMaximum?: number;
40
- multipleOf?: number;
41
- minLength?: number;
42
- maxLength?: number;
43
- pattern?: string;
44
- format?: string;
45
- minItems?: number;
46
- maxItems?: number;
47
- uniqueItems?: boolean;
48
- default?: JsonValue;
49
- readOnly?: boolean;
50
- writeOnly?: boolean;
51
- deprecated?: boolean;
52
- contentEncoding?: string;
53
- contentMediaType?: string;
54
- examples?: JsonValue[];
55
- $comment?: string;
56
- [key: `x-${string}`]: JsonValue | undefined;
57
- }
58
- declare function assertPortableJsonSchema(schema: unknown, path?: string): asserts schema is PortableJsonSchema;
59
- interface JsonSchemaValidationIssue {
60
- path: Array<string | number>;
61
- message: string;
62
- }
63
- /**
64
- * Validate JSON data against the dependency-free JSON Schema profile used by
65
- * portable contracts. This intentionally returns issues instead of throwing so
66
- * hosts can expose a stable, typed validation failure without leaking values.
67
- */
68
- declare function validatePortableJson(schema: PortableJsonSchema, value: unknown): JsonSchemaValidationIssue[];
69
- declare function assertObjectType(type: string): asserts type is FabricObjectType;
70
- interface ObjectTypeRegistry {
71
- register(type: string): void;
72
- has(type: string): boolean;
73
- list(): string[];
74
- }
75
- declare function createObjectTypeRegistry(initialTypes?: readonly string[]): ObjectTypeRegistry;
76
-
77
- export { type FabricObjectType, type JsonPrimitive, type JsonSchemaValidationIssue, type JsonValue, type ObjectTypeRegistry, type PortableJsonSchema, assertObjectType, assertPortableJsonSchema, createObjectTypeRegistry, validatePortableJson };
1
+ import { a as ObjectTypeRegistry, c as assertPortableJsonSchema, i as JsonValue, l as createObjectTypeRegistry, n as JsonPrimitive, o as PortableJsonSchema, r as JsonSchemaValidationIssue, s as assertObjectType, t as FabricObjectType, u as validatePortableJson } from "../index-DZ4mnNb7.cjs";
2
+ export { FabricObjectType, JsonPrimitive, JsonSchemaValidationIssue, JsonValue, ObjectTypeRegistry, PortableJsonSchema, assertObjectType, assertPortableJsonSchema, createObjectTypeRegistry, validatePortableJson };