@fabricorg/platform 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/dist/{chunk-T5ESIJ4K.js → chunk-53YJK3LK.js} +54 -3
- package/dist/chunk-53YJK3LK.js.map +1 -0
- package/dist/{chunk-35LADVKK.cjs → chunk-6T6F3TNQ.cjs} +55 -4
- package/dist/chunk-6T6F3TNQ.cjs.map +1 -0
- package/dist/{chunk-JFMNLJLY.cjs → chunk-A2VTSATF.cjs} +6 -6
- package/dist/{chunk-JFMNLJLY.cjs.map → chunk-A2VTSATF.cjs.map} +1 -1
- package/dist/{chunk-CRAGTJ3B.js → chunk-ETONSTUW.js} +3 -3
- package/dist/{chunk-CRAGTJ3B.js.map → chunk-ETONSTUW.js.map} +1 -1
- package/dist/{chunk-53VEUYCS.cjs → chunk-LDPBQ72C.cjs} +2 -2
- package/dist/chunk-LDPBQ72C.cjs.map +1 -0
- package/dist/{chunk-CQSA3BII.js → chunk-NHGBTPPE.js} +2 -2
- package/dist/chunk-NHGBTPPE.js.map +1 -0
- package/dist/events/index.cjs +2 -2
- package/dist/events/index.d.cts +7 -0
- package/dist/events/index.d.ts +7 -0
- package/dist/events/index.js +1 -1
- package/dist/index.cjs +18 -18
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/manifest/index.cjs +9 -9
- package/dist/manifest/index.js +3 -3
- package/dist/modules/index.cjs +10 -10
- package/dist/modules/index.d.cts +31 -1
- package/dist/modules/index.d.ts +31 -1
- package/dist/modules/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-35LADVKK.cjs.map +0 -1
- package/dist/chunk-53VEUYCS.cjs.map +0 -1
- package/dist/chunk-CQSA3BII.js.map +0 -1
- package/dist/chunk-T5ESIJ4K.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../manifest/index.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A,CAAI,oBAAoB;AAAA,GAC1C;AACD","file":"chunk-CRAGTJ3B.js","sourcesContent":["import 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 {\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 {\n\tname: string;\n\tversion: string;\n\tshape: 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\treturn {\n\t\t...manifest,\n\t\tmanifestVersion: MODULE_MANIFEST_VERSION,\n\t\tviews: \"views\" in manifest && Array.isArray(manifest.views) ? manifest.views : [],\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\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.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\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.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
|
+
{"version":3,"sources":["../manifest/index.ts"],"names":[],"mappings":";;;AA8BO,IAAM,uBAAA,GAA0B;AAiKhC,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,OAAO;AAAA,IACN,GAAG,QAAA;AAAA,IACH,eAAA,EAAiB,uBAAA;AAAA,IACjB,KAAA,EAAO,OAAA,IAAW,QAAA,IAAY,KAAA,CAAM,OAAA,CAAQ,SAAS,KAAK,CAAA,GAAI,QAAA,CAAS,KAAA,GAAQ;AAAC,GACjF;AACD;AAEO,SAAS,8BACf,MAAA,EACuB;AACvB,EAAA,MAAM,UAAkB,MAAA,CAAO,eAAA;AAC/B,EAAA,IAAI,OAAA,KAAY,CAAA,IAAK,OAAA,KAAY,uBAAA,EAAyB;AACzD,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,4CAAA,EAA+C,MAAA,CAAO,OAAO,CAAC,CAAA,CAAE,CAAA;AAAA,EACjF;AACA,EAAA,OAAO;AAAA,IACN,eAAA,EAAiB,uBAAA;AAAA,IACjB,O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A,CAAO,WAAA,KAAgB,MAAA,EAAW,QAAA,CAAS,cAAc,MAAA,CAAO,WAAA;AACpE,EAAA,IAAI,MAAA,CAAO,WAAA,KAAgB,MAAA,EAAW,QAAA,CAAS,cAAc,MAAA,CAAO,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-ETONSTUW.js","sourcesContent":["import 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 {\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 {\n\tname: string;\n\tversion: string;\n\tshape: 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\treturn {\n\t\t...manifest,\n\t\tmanifestVersion: MODULE_MANIFEST_VERSION,\n\t\tviews: \"views\" in manifest && Array.isArray(manifest.views) ? manifest.views : [],\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\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.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\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.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"]}
|
|
@@ -36,5 +36,5 @@ function createEventContractRegistry(input = {}) {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
exports.createEventContractRegistry = createEventContractRegistry;
|
|
39
|
-
//# sourceMappingURL=chunk-
|
|
40
|
-
//# sourceMappingURL=chunk-
|
|
39
|
+
//# sourceMappingURL=chunk-LDPBQ72C.cjs.map
|
|
40
|
+
//# sourceMappingURL=chunk-LDPBQ72C.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../events/index.ts"],"names":[],"mappings":";;;AAgCA,IAAM,sBAAA,GAAyB,OAAO,MAAA,CAAO;AAAA,EAC5C,kBAAA;AAAA,EACA,kBAAA;AAAA,EACA;AACD,CAAC,CAAA;A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n\teventType: string;\n\teventSchemaVersion: number;\n\tsubjectType: string;\n\tsubjectId: string;\n\tactorId: string;\n\tactorType: string;\n\tactionInvocationId?: string;\n\tpayload: TPayload;\n\tsequence: number;\n\toccurredAt: Date;\n\trecordedAt: Date;\n\tcorrelationId: string;\n\tcausationId?: string;\n\tprovenance?: EventProvenance;\n\t/**\n\t * Mirrors the emitting action's declared consistency. Present only when the\n\t * action declares `provisional-until-reconciled`, so a consumer can tell a\n\t * settled fact from one still awaiting reconciliation without a lookup.\n\t * Additive and optional: tolerant consumers that ignore it stay correct.\n\t */\n\tconsistency?: \"authoritative-now\" | \"provisional-until-reconciled\";\n}\n\nexport interface EventProvenance {\n\tsource: \"ui\" | \"api\" | \"agent\" | \"worker\" | \"system\" | (string & {});\n\tauditAttributes?: Record<string, string>;\n}\n\nconst BUILT_IN_SUBJECT_TYPES = Object.freeze([\n\t\"ActionInvocation\",\n\t\"PolicyEvaluation\",\n\t\"AdapterInvocation\",\n]);\n\nconst BUILT_IN_EVENT_TYPES = Object.freeze([\n\t\"ComplianceBlocked\",\n\t\"StateTransitioned\",\n\t\"AdapterInvocationStarted\",\n\t\"AdapterInvocationSucceeded\",\n\t\"AdapterInvocationFailed\",\n\t\"WebhookReceived\",\n]);\n\nexport type AssetEventSubjectType = string;\nexport type AssetEventType = string;\nexport type AssetEventActorType = \"natural_person\" | \"agent\" | \"adapter\" | \"system\" | \"service_account\" | \"external_system\" | \"integration\";\n\nexport interface EventContractRegistry {\n\tregisterEventType(eventType: string): void;\n\tregisterSubjectType(subjectType: string): void;\n\thasEventType(eventType: string): boolean;\n\thasSubjectType(subjectType: string): boolean;\n\teventTypes(): string[];\n\tsubjectTypes(): string[];\n}\n\nexport function createEventContractRegistry(input: { eventTypes?: readonly string[]; subjectTypes?: readonly string[] } = {}): EventContractRegistry {\n\tconst eventTypes = new Set([...BUILT_IN_EVENT_TYPES, ...(input.eventTypes ?? [])]);\n\tconst subjectTypes = new Set([...BUILT_IN_SUBJECT_TYPES, ...(input.subjectTypes ?? [])]);\n\treturn {\n\t\tregisterEventType(eventType) {\n\t\t\tif (!eventType) {\n\t\t\t\tthrow new Error(\"Event type cannot be empty\");\n\t\t\t}\n\t\t\teventTypes.add(eventType);\n\t\t},\n\t\tregisterSubjectType(subjectType) {\n\t\t\tif (!subjectType) throw new Error(\"Subject type cannot be empty\");\n\t\t\tsubjectTypes.add(subjectType);\n\t\t},\n\t\thasEventType: (eventType) => eventTypes.has(eventType),\n\t\thasSubjectType: (subjectType) => subjectTypes.has(subjectType),\n\t\teventTypes: () => Array.from(eventTypes).sort(),\n\t\tsubjectTypes: () => Array.from(subjectTypes).sort(),\n\t};\n}\n"]}
|
|
@@ -34,5 +34,5 @@ function createEventContractRegistry(input = {}) {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
export { createEventContractRegistry };
|
|
37
|
-
//# sourceMappingURL=chunk-
|
|
38
|
-
//# sourceMappingURL=chunk-
|
|
37
|
+
//# sourceMappingURL=chunk-NHGBTPPE.js.map
|
|
38
|
+
//# sourceMappingURL=chunk-NHGBTPPE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../events/index.ts"],"names":[],"mappings":";AAgCA,IAAM,sBAAA,GAAyB,OAAO,MAAA,CAAO;AAAA,EAC5C,kBAAA;AAAA,EACA,kBAAA;AAAA,EACA;AACD,CAAC,CAAA;AAED,IAAM,oBAAA,GAAuB,OAAO,MAAA,CAAO;AAAA,EAC1C,mBAAA;AAAA,EACA,mBAAA;AAAA,EACA,0BAAA;AAAA,EACA,4BAAA;AAAA,EACA,yBAAA;AAAA,EACA;AACD,CAAC,CAAA;AAeM,SAAS,2BAAA,CAA4B,KAAA,GAA8E,EAAC,EAA0B;AACpJ,EAAA,MAAM,UAAA,mBAAa,IAAI,GAAA,CAAI,CAAC,GAAG,oBAAA,EAAsB,GAAI,KAAA,CAAM,UAAA,IAAc,EAAG,CAAC,CAAA;AACjF,EAAA,MAAM,YAAA,mBAAe,IAAI,GAAA,CAAI,CAAC,GAAG,sBAAA,EAAwB,GAAI,KAAA,CAAM,YAAA,IAAgB,EAAG,CAAC,CAAA;AACvF,EAAA,OAAO;AAAA,IACN,kBAAkB,SAAA,EAAW;AAC5B,MAAA,IAAI,CAAC,SAAA,EAAW;AACf,QAAA,MAAM,IAAI,MAAM,4BAA4B,CAAA;AAAA,MAC7C;AACA,MAAA,UAAA,CAAW,IAAI,SAAS,CAAA;AAAA,IACzB,CAAA;AAAA,IACA,oBAAoB,WAAA,EAAa;AAChC,MAAA,IAAI,CAAC,WAAA,EAAa,MAAM,IAAI,MAAM,8BAA8B,CAAA;AAChE,MAAA,YAAA,CAAa,IAAI,WAAW,CAAA;AAAA,IAC7B,CAAA;AAAA,IACA,YAAA,EAAc,CAAC,SAAA,KAAc,UAAA,CAAW,IAAI,SAAS,CAAA;AAAA,IACrD,cAAA,EAAgB,CAAC,WAAA,KAAgB,YAAA,CAAa,IAAI,WAAW,CAAA;AAAA,IAC7D,YAAY,MAAM,KAAA,CAAM,IAAA,CAAK,UAAU,EAAE,IAAA,EAAK;AAAA,IAC9C,cAAc,MAAM,KAAA,CAAM,IAAA,CAAK,YAAY,EAAE,IAAA;AAAK,GACnD;AACD","file":"chunk-NHGBTPPE.js","sourcesContent":["export interface AssetEventEnvelope<TPayload = unknown> {\n\tid: string;\n\ttenantId: string;\n\tspaceId: string;\n\teventType: string;\n\teventSchemaVersion: number;\n\tsubjectType: string;\n\tsubjectId: string;\n\tactorId: string;\n\tactorType: string;\n\tactionInvocationId?: string;\n\tpayload: TPayload;\n\tsequence: number;\n\toccurredAt: Date;\n\trecordedAt: Date;\n\tcorrelationId: string;\n\tcausationId?: string;\n\tprovenance?: EventProvenance;\n\t/**\n\t * Mirrors the emitting action's declared consistency. Present only when the\n\t * action declares `provisional-until-reconciled`, so a consumer can tell a\n\t * settled fact from one still awaiting reconciliation without a lookup.\n\t * Additive and optional: tolerant consumers that ignore it stay correct.\n\t */\n\tconsistency?: \"authoritative-now\" | \"provisional-until-reconciled\";\n}\n\nexport interface EventProvenance {\n\tsource: \"ui\" | \"api\" | \"agent\" | \"worker\" | \"system\" | (string & {});\n\tauditAttributes?: Record<string, string>;\n}\n\nconst BUILT_IN_SUBJECT_TYPES = Object.freeze([\n\t\"ActionInvocation\",\n\t\"PolicyEvaluation\",\n\t\"AdapterInvocation\",\n]);\n\nconst BUILT_IN_EVENT_TYPES = Object.freeze([\n\t\"ComplianceBlocked\",\n\t\"StateTransitioned\",\n\t\"AdapterInvocationStarted\",\n\t\"AdapterInvocationSucceeded\",\n\t\"AdapterInvocationFailed\",\n\t\"WebhookReceived\",\n]);\n\nexport type AssetEventSubjectType = string;\nexport type AssetEventType = string;\nexport type AssetEventActorType = \"natural_person\" | \"agent\" | \"adapter\" | \"system\" | \"service_account\" | \"external_system\" | \"integration\";\n\nexport interface EventContractRegistry {\n\tregisterEventType(eventType: string): void;\n\tregisterSubjectType(subjectType: string): void;\n\thasEventType(eventType: string): boolean;\n\thasSubjectType(subjectType: string): boolean;\n\teventTypes(): string[];\n\tsubjectTypes(): string[];\n}\n\nexport function createEventContractRegistry(input: { eventTypes?: readonly string[]; subjectTypes?: readonly string[] } = {}): EventContractRegistry {\n\tconst eventTypes = new Set([...BUILT_IN_EVENT_TYPES, ...(input.eventTypes ?? [])]);\n\tconst subjectTypes = new Set([...BUILT_IN_SUBJECT_TYPES, ...(input.subjectTypes ?? [])]);\n\treturn {\n\t\tregisterEventType(eventType) {\n\t\t\tif (!eventType) {\n\t\t\t\tthrow new Error(\"Event type cannot be empty\");\n\t\t\t}\n\t\t\teventTypes.add(eventType);\n\t\t},\n\t\tregisterSubjectType(subjectType) {\n\t\t\tif (!subjectType) throw new Error(\"Subject type cannot be empty\");\n\t\t\tsubjectTypes.add(subjectType);\n\t\t},\n\t\thasEventType: (eventType) => eventTypes.has(eventType),\n\t\thasSubjectType: (subjectType) => subjectTypes.has(subjectType),\n\t\teventTypes: () => Array.from(eventTypes).sort(),\n\t\tsubjectTypes: () => Array.from(subjectTypes).sort(),\n\t};\n}\n"]}
|
package/dist/events/index.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkLDPBQ72C_cjs = require('../chunk-LDPBQ72C.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "createEventContractRegistry", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkLDPBQ72C_cjs.createEventContractRegistry; }
|
|
10
10
|
});
|
|
11
11
|
//# sourceMappingURL=index.cjs.map
|
|
12
12
|
//# sourceMappingURL=index.cjs.map
|
package/dist/events/index.d.cts
CHANGED
|
@@ -16,6 +16,13 @@ interface AssetEventEnvelope<TPayload = unknown> {
|
|
|
16
16
|
correlationId: string;
|
|
17
17
|
causationId?: string;
|
|
18
18
|
provenance?: EventProvenance;
|
|
19
|
+
/**
|
|
20
|
+
* Mirrors the emitting action's declared consistency. Present only when the
|
|
21
|
+
* action declares `provisional-until-reconciled`, so a consumer can tell a
|
|
22
|
+
* settled fact from one still awaiting reconciliation without a lookup.
|
|
23
|
+
* Additive and optional: tolerant consumers that ignore it stay correct.
|
|
24
|
+
*/
|
|
25
|
+
consistency?: "authoritative-now" | "provisional-until-reconciled";
|
|
19
26
|
}
|
|
20
27
|
interface EventProvenance {
|
|
21
28
|
source: "ui" | "api" | "agent" | "worker" | "system" | (string & {});
|
package/dist/events/index.d.ts
CHANGED
|
@@ -16,6 +16,13 @@ interface AssetEventEnvelope<TPayload = unknown> {
|
|
|
16
16
|
correlationId: string;
|
|
17
17
|
causationId?: string;
|
|
18
18
|
provenance?: EventProvenance;
|
|
19
|
+
/**
|
|
20
|
+
* Mirrors the emitting action's declared consistency. Present only when the
|
|
21
|
+
* action declares `provisional-until-reconciled`, so a consumer can tell a
|
|
22
|
+
* settled fact from one still awaiting reconciliation without a lookup.
|
|
23
|
+
* Additive and optional: tolerant consumers that ignore it stay correct.
|
|
24
|
+
*/
|
|
25
|
+
consistency?: "authoritative-now" | "provisional-until-reconciled";
|
|
19
26
|
}
|
|
20
27
|
interface EventProvenance {
|
|
21
28
|
source: "ui" | "api" | "agent" | "worker" | "system" | (string & {});
|
package/dist/events/index.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkA2VTSATF_cjs = require('./chunk-A2VTSATF.cjs');
|
|
4
|
+
var chunk6T6F3TNQ_cjs = require('./chunk-6T6F3TNQ.cjs');
|
|
5
5
|
var chunkCBY6GRJP_cjs = require('./chunk-CBY6GRJP.cjs');
|
|
6
6
|
var chunkVZ6C4LXC_cjs = require('./chunk-VZ6C4LXC.cjs');
|
|
7
7
|
var chunkX3GHYMAJ_cjs = require('./chunk-X3GHYMAJ.cjs');
|
|
@@ -11,7 +11,7 @@ var chunkYZKUEC2J_cjs = require('./chunk-YZKUEC2J.cjs');
|
|
|
11
11
|
var chunkBFQNKQJE_cjs = require('./chunk-BFQNKQJE.cjs');
|
|
12
12
|
var chunkNPVIFZQV_cjs = require('./chunk-NPVIFZQV.cjs');
|
|
13
13
|
var chunkF3E5SXPN_cjs = require('./chunk-F3E5SXPN.cjs');
|
|
14
|
-
var
|
|
14
|
+
var chunkLDPBQ72C_cjs = require('./chunk-LDPBQ72C.cjs');
|
|
15
15
|
require('./chunk-PG5LYTUX.cjs');
|
|
16
16
|
var chunkANPJYXBK_cjs = require('./chunk-ANPJYXBK.cjs');
|
|
17
17
|
var chunkLZSE6QGQ_cjs = require('./chunk-LZSE6QGQ.cjs');
|
|
@@ -20,59 +20,59 @@ var chunkLZSE6QGQ_cjs = require('./chunk-LZSE6QGQ.cjs');
|
|
|
20
20
|
|
|
21
21
|
Object.defineProperty(exports, "MODULE_MANIFEST_VERSION", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunkA2VTSATF_cjs.MODULE_MANIFEST_VERSION; }
|
|
24
24
|
});
|
|
25
25
|
Object.defineProperty(exports, "exportModuleManifest", {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
27
|
+
get: function () { return chunkA2VTSATF_cjs.exportModuleManifest; }
|
|
28
28
|
});
|
|
29
29
|
Object.defineProperty(exports, "exportModuleManifestBundle", {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunkA2VTSATF_cjs.exportModuleManifestBundle; }
|
|
32
32
|
});
|
|
33
33
|
Object.defineProperty(exports, "isJsonSchemaExportableValidator", {
|
|
34
34
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
35
|
+
get: function () { return chunkA2VTSATF_cjs.isJsonSchemaExportableValidator; }
|
|
36
36
|
});
|
|
37
37
|
Object.defineProperty(exports, "normalizeModuleManifest", {
|
|
38
38
|
enumerable: true,
|
|
39
|
-
get: function () { return
|
|
39
|
+
get: function () { return chunkA2VTSATF_cjs.normalizeModuleManifest; }
|
|
40
40
|
});
|
|
41
41
|
Object.defineProperty(exports, "normalizeModuleManifestBundle", {
|
|
42
42
|
enumerable: true,
|
|
43
|
-
get: function () { return
|
|
43
|
+
get: function () { return chunkA2VTSATF_cjs.normalizeModuleManifestBundle; }
|
|
44
44
|
});
|
|
45
45
|
Object.defineProperty(exports, "createModuleRegistry", {
|
|
46
46
|
enumerable: true,
|
|
47
|
-
get: function () { return
|
|
47
|
+
get: function () { return chunk6T6F3TNQ_cjs.createModuleRegistry; }
|
|
48
48
|
});
|
|
49
49
|
Object.defineProperty(exports, "getEventTypeName", {
|
|
50
50
|
enumerable: true,
|
|
51
|
-
get: function () { return
|
|
51
|
+
get: function () { return chunk6T6F3TNQ_cjs.getEventTypeName; }
|
|
52
52
|
});
|
|
53
53
|
Object.defineProperty(exports, "getModuleDependencyNamespace", {
|
|
54
54
|
enumerable: true,
|
|
55
|
-
get: function () { return
|
|
55
|
+
get: function () { return chunk6T6F3TNQ_cjs.getModuleDependencyNamespace; }
|
|
56
56
|
});
|
|
57
57
|
Object.defineProperty(exports, "getObjectTypeName", {
|
|
58
58
|
enumerable: true,
|
|
59
|
-
get: function () { return
|
|
59
|
+
get: function () { return chunk6T6F3TNQ_cjs.getObjectTypeName; }
|
|
60
60
|
});
|
|
61
61
|
Object.defineProperty(exports, "registerFabricModule", {
|
|
62
62
|
enumerable: true,
|
|
63
|
-
get: function () { return
|
|
63
|
+
get: function () { return chunk6T6F3TNQ_cjs.registerFabricModule; }
|
|
64
64
|
});
|
|
65
65
|
Object.defineProperty(exports, "registerFabricModules", {
|
|
66
66
|
enumerable: true,
|
|
67
|
-
get: function () { return
|
|
67
|
+
get: function () { return chunk6T6F3TNQ_cjs.registerFabricModules; }
|
|
68
68
|
});
|
|
69
69
|
Object.defineProperty(exports, "validateAndOrderFabricModules", {
|
|
70
70
|
enumerable: true,
|
|
71
|
-
get: function () { return
|
|
71
|
+
get: function () { return chunk6T6F3TNQ_cjs.validateAndOrderFabricModules; }
|
|
72
72
|
});
|
|
73
73
|
Object.defineProperty(exports, "validateModuleNamespace", {
|
|
74
74
|
enumerable: true,
|
|
75
|
-
get: function () { return
|
|
75
|
+
get: function () { return chunk6T6F3TNQ_cjs.validateModuleNamespace; }
|
|
76
76
|
});
|
|
77
77
|
Object.defineProperty(exports, "assertObjectType", {
|
|
78
78
|
enumerable: true,
|
|
@@ -236,7 +236,7 @@ Object.defineProperty(exports, "AgentActionPolicyRegistry", {
|
|
|
236
236
|
});
|
|
237
237
|
Object.defineProperty(exports, "createEventContractRegistry", {
|
|
238
238
|
enumerable: true,
|
|
239
|
-
get: function () { return
|
|
239
|
+
get: function () { return chunkLDPBQ72C_cjs.createEventContractRegistry; }
|
|
240
240
|
});
|
|
241
241
|
Object.defineProperty(exports, "FABRIC_GOVERNANCE_CONTRACT_VERSION", {
|
|
242
242
|
enumerable: true,
|
package/dist/index.d.cts
CHANGED
|
@@ -3,7 +3,7 @@ export { AdapterAttempt, AdapterCircuitBreakerConfig, AdapterExecutionContext, A
|
|
|
3
3
|
export { AssetEventActorType, AssetEventEnvelope, AssetEventSubjectType, AssetEventType, EventContractRegistry, EventProvenance, createEventContractRegistry } from './events/index.cjs';
|
|
4
4
|
export { FABRIC_ID_PREFIXES, FabricIdPrefix, createFabricId, isFabricId, parseFabricId } from './ids/index.cjs';
|
|
5
5
|
export { JsonSchemaExportableValidator, MODULE_MANIFEST_VERSION, ModuleManifest, ModuleManifestAction, ModuleManifestActionStateMachine, ModuleManifestActionV1, ModuleManifestAdapterStep, ModuleManifestBundle, ModuleManifestBundleV1, ModuleManifestCodePolicy, ModuleManifestDataPolicy, ModuleManifestEventType, ModuleManifestIdPrefix, ModuleManifestObjectType, ModuleManifestObjectTypeV1, ModuleManifestPolicy, ModuleManifestStateMachine, ModuleManifestStateMachineTransition, ModuleManifestV1, ModuleManifestView, exportModuleManifest, exportModuleManifestBundle, isJsonSchemaExportableValidator, normalizeModuleManifest, normalizeModuleManifestBundle } from './manifest/index.cjs';
|
|
6
|
-
export { CapabilityMetadata, CapabilityPortRequirement, CapabilityRequirements, DeclarativeInvariant, EventTypeRegistration, EventTypeRegistrationInput, FabricModule, IdPrefixRegistration, InvariantEnforcement, ModuleDependency, ModuleDependencyInput, ModuleRegistry, ObjectRelationCardinality, ObjectRelationDefinition, ObjectRelationDeleteBehavior, ObjectRelationSemantics, ObjectTypeRegistration, ObjectTypeRegistrationInput, PolicyRegistration, StateMachineRegistration, createModuleRegistry, getEventTypeName, getModuleDependencyNamespace, getObjectTypeName, registerFabricModule, registerFabricModules, validateAndOrderFabricModules, validateModuleNamespace } from './modules/index.cjs';
|
|
6
|
+
export { CapabilityMetadata, CapabilityPortRequirement, CapabilityRequirements, CapabilityWorkflowCompensation, CapabilityWorkflowDeclaration, CapabilityWorkflowTimer, DeclarativeInvariant, EventTypeRegistration, EventTypeRegistrationInput, FabricModule, IdPrefixRegistration, InvariantEnforcement, ModuleDependency, ModuleDependencyInput, ModuleRegistry, ObjectRelationCardinality, ObjectRelationDefinition, ObjectRelationDeleteBehavior, ObjectRelationSemantics, ObjectTypeRegistration, ObjectTypeRegistrationInput, PolicyRegistration, StateMachineRegistration, createModuleRegistry, getEventTypeName, getModuleDependencyNamespace, getObjectTypeName, registerFabricModule, registerFabricModules, validateAndOrderFabricModules, validateModuleNamespace } from './modules/index.cjs';
|
|
7
7
|
export { FabricObjectType, JsonPrimitive, JsonValue, ObjectTypeRegistry, PortableJsonSchema, assertObjectType, assertPortableJsonSchema, createObjectTypeRegistry } from './objects/index.cjs';
|
|
8
8
|
export { DataPolicyComparisonOperator, DataPolicyCondition, DataPolicyConditionResult, DataPolicyDefinition, DataPolicyLiteral, DataPolicySource, DataPolicySourceReference, DataPolicyValidationResult, PolicyContext, PolicyCorrectiveAction, PolicyCorrectiveActionBase, PolicyCorrectiveActionKind, PolicyDispatchEvidence, PolicyEvaluationMode, PolicyEvaluationResult, PolicyEvaluator, PolicyFact, PolicyFallbackDefinition, PolicyFallbackTrigger, PolicyGuidance, PolicyGuidanceValidationResult, PolicyId, PolicyInvokeActionCorrectiveAction, PolicyKind, PolicyManualCorrectiveAction, PolicyNavigateCorrectiveAction, PolicyOutcome, PolicyRegistry, RuntimePolicyDefinition, aggregatePolicyOutcomes, assertPolicyId, createPolicyRegistry, evaluatePolicyDefinition, evaluatePolicyDefinitions, evaluateRegisteredPolicies, validateDataPolicyDefinition, validatePolicyGuidance } from './policies/index.cjs';
|
|
9
9
|
export { StateClass, StateDefinition, StateMachineDatabaseClient, StateMachineDefinition, StateMachineRegistry, TransitionContext, createStateMachineRegistry, validateStateMachineTransition } from './state-machines/index.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { AdapterAttempt, AdapterCircuitBreakerConfig, AdapterExecutionContext, A
|
|
|
3
3
|
export { AssetEventActorType, AssetEventEnvelope, AssetEventSubjectType, AssetEventType, EventContractRegistry, EventProvenance, createEventContractRegistry } from './events/index.js';
|
|
4
4
|
export { FABRIC_ID_PREFIXES, FabricIdPrefix, createFabricId, isFabricId, parseFabricId } from './ids/index.js';
|
|
5
5
|
export { JsonSchemaExportableValidator, MODULE_MANIFEST_VERSION, ModuleManifest, ModuleManifestAction, ModuleManifestActionStateMachine, ModuleManifestActionV1, ModuleManifestAdapterStep, ModuleManifestBundle, ModuleManifestBundleV1, ModuleManifestCodePolicy, ModuleManifestDataPolicy, ModuleManifestEventType, ModuleManifestIdPrefix, ModuleManifestObjectType, ModuleManifestObjectTypeV1, ModuleManifestPolicy, ModuleManifestStateMachine, ModuleManifestStateMachineTransition, ModuleManifestV1, ModuleManifestView, exportModuleManifest, exportModuleManifestBundle, isJsonSchemaExportableValidator, normalizeModuleManifest, normalizeModuleManifestBundle } from './manifest/index.js';
|
|
6
|
-
export { CapabilityMetadata, CapabilityPortRequirement, CapabilityRequirements, DeclarativeInvariant, EventTypeRegistration, EventTypeRegistrationInput, FabricModule, IdPrefixRegistration, InvariantEnforcement, ModuleDependency, ModuleDependencyInput, ModuleRegistry, ObjectRelationCardinality, ObjectRelationDefinition, ObjectRelationDeleteBehavior, ObjectRelationSemantics, ObjectTypeRegistration, ObjectTypeRegistrationInput, PolicyRegistration, StateMachineRegistration, createModuleRegistry, getEventTypeName, getModuleDependencyNamespace, getObjectTypeName, registerFabricModule, registerFabricModules, validateAndOrderFabricModules, validateModuleNamespace } from './modules/index.js';
|
|
6
|
+
export { CapabilityMetadata, CapabilityPortRequirement, CapabilityRequirements, CapabilityWorkflowCompensation, CapabilityWorkflowDeclaration, CapabilityWorkflowTimer, DeclarativeInvariant, EventTypeRegistration, EventTypeRegistrationInput, FabricModule, IdPrefixRegistration, InvariantEnforcement, ModuleDependency, ModuleDependencyInput, ModuleRegistry, ObjectRelationCardinality, ObjectRelationDefinition, ObjectRelationDeleteBehavior, ObjectRelationSemantics, ObjectTypeRegistration, ObjectTypeRegistrationInput, PolicyRegistration, StateMachineRegistration, createModuleRegistry, getEventTypeName, getModuleDependencyNamespace, getObjectTypeName, registerFabricModule, registerFabricModules, validateAndOrderFabricModules, validateModuleNamespace } from './modules/index.js';
|
|
7
7
|
export { FabricObjectType, JsonPrimitive, JsonValue, ObjectTypeRegistry, PortableJsonSchema, assertObjectType, assertPortableJsonSchema, createObjectTypeRegistry } from './objects/index.js';
|
|
8
8
|
export { DataPolicyComparisonOperator, DataPolicyCondition, DataPolicyConditionResult, DataPolicyDefinition, DataPolicyLiteral, DataPolicySource, DataPolicySourceReference, DataPolicyValidationResult, PolicyContext, PolicyCorrectiveAction, PolicyCorrectiveActionBase, PolicyCorrectiveActionKind, PolicyDispatchEvidence, PolicyEvaluationMode, PolicyEvaluationResult, PolicyEvaluator, PolicyFact, PolicyFallbackDefinition, PolicyFallbackTrigger, PolicyGuidance, PolicyGuidanceValidationResult, PolicyId, PolicyInvokeActionCorrectiveAction, PolicyKind, PolicyManualCorrectiveAction, PolicyNavigateCorrectiveAction, PolicyOutcome, PolicyRegistry, RuntimePolicyDefinition, aggregatePolicyOutcomes, assertPolicyId, createPolicyRegistry, evaluatePolicyDefinition, evaluatePolicyDefinitions, evaluateRegisteredPolicies, validateDataPolicyDefinition, validatePolicyGuidance } from './policies/index.js';
|
|
9
9
|
export { StateClass, StateDefinition, StateMachineDatabaseClient, StateMachineDefinition, StateMachineRegistry, TransitionContext, createStateMachineRegistry, validateStateMachineTransition } from './state-machines/index.js';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { MODULE_MANIFEST_VERSION, exportModuleManifest, exportModuleManifestBundle, isJsonSchemaExportableValidator, normalizeModuleManifest, normalizeModuleManifestBundle } from './chunk-
|
|
2
|
-
export { createModuleRegistry, getEventTypeName, getModuleDependencyNamespace, getObjectTypeName, registerFabricModule, registerFabricModules, validateAndOrderFabricModules, validateModuleNamespace } from './chunk-
|
|
1
|
+
export { MODULE_MANIFEST_VERSION, exportModuleManifest, exportModuleManifestBundle, isJsonSchemaExportableValidator, normalizeModuleManifest, normalizeModuleManifestBundle } from './chunk-ETONSTUW.js';
|
|
2
|
+
export { createModuleRegistry, getEventTypeName, getModuleDependencyNamespace, getObjectTypeName, registerFabricModule, registerFabricModules, validateAndOrderFabricModules, validateModuleNamespace } from './chunk-53YJK3LK.js';
|
|
3
3
|
export { assertObjectType, assertPortableJsonSchema, createObjectTypeRegistry } from './chunk-NETLRKDS.js';
|
|
4
4
|
export { aggregatePolicyOutcomes, assertPolicyId, createPolicyRegistry, evaluatePolicyDefinition, evaluatePolicyDefinitions, evaluateRegisteredPolicies, validateDataPolicyDefinition, validatePolicyGuidance } from './chunk-JFVEPAED.js';
|
|
5
5
|
export { ANONYMIZATION_POLICY_VERSION, AnonymizationEngine, FieldRedactor, PLATFORM_PRIVACY_POLICY_VERSION, anonymizeAssetEventPayload, anonymizeEvidencePacket, anonymizeJsonValue, buildAnonymizationLifecycleEvidence, stableChecksum } from './chunk-ATWWZTRC.js';
|
|
@@ -9,7 +9,7 @@ export { createDeterministicIdFactory, createFakeActionContext, createInMemoryAd
|
|
|
9
9
|
export { ACTOR_TYPES, assertActionId, assertActorType, createActionRegistry, isActorType } from './chunk-4QOA3VU5.js';
|
|
10
10
|
export { AdapterRegistry, MissingAdapterRegistrationError, executeWithAdapterRetry, getRetryDelayMs, resolveAdapterRetryPolicy } from './chunk-3ZW5USXF.js';
|
|
11
11
|
export { AgentActionPolicyRegistry } from './chunk-OFCCZ27Z.js';
|
|
12
|
-
export { createEventContractRegistry } from './chunk-
|
|
12
|
+
export { createEventContractRegistry } from './chunk-NHGBTPPE.js';
|
|
13
13
|
import './chunk-OZLZHISS.js';
|
|
14
14
|
export { FABRIC_GOVERNANCE_CONTRACT_VERSION, assertGovernanceRuntimeEvidence, assertMutationGovernanceContext } from './chunk-3OWMPDBD.js';
|
|
15
15
|
export { FABRIC_ID_PREFIXES, createFabricId, isFabricId, parseFabricId } from './chunk-RALMUSOX.js';
|
package/dist/manifest/index.cjs
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var chunkA2VTSATF_cjs = require('../chunk-A2VTSATF.cjs');
|
|
4
|
+
require('../chunk-6T6F3TNQ.cjs');
|
|
5
5
|
require('../chunk-CBY6GRJP.cjs');
|
|
6
6
|
require('../chunk-M5FGWXT3.cjs');
|
|
7
|
-
require('../chunk-
|
|
7
|
+
require('../chunk-LDPBQ72C.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
Object.defineProperty(exports, "MODULE_MANIFEST_VERSION", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkA2VTSATF_cjs.MODULE_MANIFEST_VERSION; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "exportModuleManifest", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkA2VTSATF_cjs.exportModuleManifest; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "exportModuleManifestBundle", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkA2VTSATF_cjs.exportModuleManifestBundle; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "isJsonSchemaExportableValidator", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkA2VTSATF_cjs.isJsonSchemaExportableValidator; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "normalizeModuleManifest", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkA2VTSATF_cjs.normalizeModuleManifest; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "normalizeModuleManifestBundle", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunkA2VTSATF_cjs.normalizeModuleManifestBundle; }
|
|
34
34
|
});
|
|
35
35
|
//# sourceMappingURL=index.cjs.map
|
|
36
36
|
//# sourceMappingURL=index.cjs.map
|
package/dist/manifest/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { MODULE_MANIFEST_VERSION, exportModuleManifest, exportModuleManifestBundle, isJsonSchemaExportableValidator, normalizeModuleManifest, normalizeModuleManifestBundle } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { MODULE_MANIFEST_VERSION, exportModuleManifest, exportModuleManifestBundle, isJsonSchemaExportableValidator, normalizeModuleManifest, normalizeModuleManifestBundle } from '../chunk-ETONSTUW.js';
|
|
2
|
+
import '../chunk-53YJK3LK.js';
|
|
3
3
|
import '../chunk-NETLRKDS.js';
|
|
4
4
|
import '../chunk-J5LS5BSI.js';
|
|
5
|
-
import '../chunk-
|
|
5
|
+
import '../chunk-NHGBTPPE.js';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
package/dist/modules/index.cjs
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk6T6F3TNQ_cjs = require('../chunk-6T6F3TNQ.cjs');
|
|
4
4
|
require('../chunk-CBY6GRJP.cjs');
|
|
5
5
|
require('../chunk-M5FGWXT3.cjs');
|
|
6
|
-
require('../chunk-
|
|
6
|
+
require('../chunk-LDPBQ72C.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
Object.defineProperty(exports, "createModuleRegistry", {
|
|
11
11
|
enumerable: true,
|
|
12
|
-
get: function () { return
|
|
12
|
+
get: function () { return chunk6T6F3TNQ_cjs.createModuleRegistry; }
|
|
13
13
|
});
|
|
14
14
|
Object.defineProperty(exports, "getEventTypeName", {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunk6T6F3TNQ_cjs.getEventTypeName; }
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "getModuleDependencyNamespace", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function () { return
|
|
20
|
+
get: function () { return chunk6T6F3TNQ_cjs.getModuleDependencyNamespace; }
|
|
21
21
|
});
|
|
22
22
|
Object.defineProperty(exports, "getObjectTypeName", {
|
|
23
23
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
24
|
+
get: function () { return chunk6T6F3TNQ_cjs.getObjectTypeName; }
|
|
25
25
|
});
|
|
26
26
|
Object.defineProperty(exports, "registerFabricModule", {
|
|
27
27
|
enumerable: true,
|
|
28
|
-
get: function () { return
|
|
28
|
+
get: function () { return chunk6T6F3TNQ_cjs.registerFabricModule; }
|
|
29
29
|
});
|
|
30
30
|
Object.defineProperty(exports, "registerFabricModules", {
|
|
31
31
|
enumerable: true,
|
|
32
|
-
get: function () { return
|
|
32
|
+
get: function () { return chunk6T6F3TNQ_cjs.registerFabricModules; }
|
|
33
33
|
});
|
|
34
34
|
Object.defineProperty(exports, "validateAndOrderFabricModules", {
|
|
35
35
|
enumerable: true,
|
|
36
|
-
get: function () { return
|
|
36
|
+
get: function () { return chunk6T6F3TNQ_cjs.validateAndOrderFabricModules; }
|
|
37
37
|
});
|
|
38
38
|
Object.defineProperty(exports, "validateModuleNamespace", {
|
|
39
39
|
enumerable: true,
|
|
40
|
-
get: function () { return
|
|
40
|
+
get: function () { return chunk6T6F3TNQ_cjs.validateModuleNamespace; }
|
|
41
41
|
});
|
|
42
42
|
//# sourceMappingURL=index.cjs.map
|
|
43
43
|
//# sourceMappingURL=index.cjs.map
|
package/dist/modules/index.d.cts
CHANGED
|
@@ -75,6 +75,34 @@ interface CapabilityRequirements {
|
|
|
75
75
|
entitlements?: string[];
|
|
76
76
|
featureFlags?: string[];
|
|
77
77
|
}
|
|
78
|
+
interface CapabilityWorkflowTimer {
|
|
79
|
+
/** Workflow-local identity of the deadline, for example "right-to-cure". */
|
|
80
|
+
name: string;
|
|
81
|
+
/** Configuration key the duration is resolved from when the workflow starts. */
|
|
82
|
+
configKey: string;
|
|
83
|
+
description?: string;
|
|
84
|
+
}
|
|
85
|
+
interface CapabilityWorkflowCompensation {
|
|
86
|
+
/** Workflow step whose effect this reverses. */
|
|
87
|
+
step: string;
|
|
88
|
+
/** Governed action that performs the reversal. Must belong to the declaring module. */
|
|
89
|
+
actionId: `${string}.${string}`;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* A durable workflow this capability owns. Declaring it makes durability a
|
|
93
|
+
* reviewable fact of the contract rather than a property of worker deployment:
|
|
94
|
+
* the queue it runs on, the deadlines it carries, and what reverses each step
|
|
95
|
+
* are all diffable.
|
|
96
|
+
*/
|
|
97
|
+
interface CapabilityWorkflowDeclaration {
|
|
98
|
+
name: string;
|
|
99
|
+
/** Routing identity, conventionally `capability.vertical`. */
|
|
100
|
+
taskQueue: string;
|
|
101
|
+
/** Event type whose arrival starts this workflow by choreography. */
|
|
102
|
+
startedBy?: string;
|
|
103
|
+
timers?: CapabilityWorkflowTimer[];
|
|
104
|
+
compensations?: CapabilityWorkflowCompensation[];
|
|
105
|
+
}
|
|
78
106
|
interface CapabilityMetadata {
|
|
79
107
|
displayName: string;
|
|
80
108
|
description: string;
|
|
@@ -89,6 +117,8 @@ interface CapabilityMetadata {
|
|
|
89
117
|
profile: string;
|
|
90
118
|
required: boolean;
|
|
91
119
|
};
|
|
120
|
+
/** Durable workflows this capability owns, with their queues, deadlines and reversals. */
|
|
121
|
+
workflows?: CapabilityWorkflowDeclaration[];
|
|
92
122
|
/** Namespaced declared data preserved by Platform and interpreted only by its owning package. */
|
|
93
123
|
extensions?: Record<string, JsonValue>;
|
|
94
124
|
}
|
|
@@ -134,4 +164,4 @@ declare function registerFabricModules<TDb = unknown>(modules: FabricModule<TDb>
|
|
|
134
164
|
/** @deprecated Use createModuleRegistry([module]); registration is now explicit and instance-scoped. */
|
|
135
165
|
declare function registerFabricModule<TDb = unknown>(module: FabricModule<TDb>): void;
|
|
136
166
|
|
|
137
|
-
export { type CapabilityMetadata, type CapabilityPortRequirement, type CapabilityRequirements, type DeclarativeInvariant, type EventTypeRegistration, type EventTypeRegistrationInput, type FabricModule, type IdPrefixRegistration, type InvariantEnforcement, type ModuleDependency, type ModuleDependencyInput, type ModuleRegistry, type ObjectRelationCardinality, type ObjectRelationDefinition, type ObjectRelationDeleteBehavior, type ObjectRelationSemantics, type ObjectTypeRegistration, type ObjectTypeRegistrationInput, type PolicyRegistration, type StateMachineRegistration, createModuleRegistry, getEventTypeName, getModuleDependencyNamespace, getObjectTypeName, registerFabricModule, registerFabricModules, validateAndOrderFabricModules, validateModuleNamespace };
|
|
167
|
+
export { type CapabilityMetadata, type CapabilityPortRequirement, type CapabilityRequirements, type CapabilityWorkflowCompensation, type CapabilityWorkflowDeclaration, type CapabilityWorkflowTimer, type DeclarativeInvariant, type EventTypeRegistration, type EventTypeRegistrationInput, type FabricModule, type IdPrefixRegistration, type InvariantEnforcement, type ModuleDependency, type ModuleDependencyInput, type ModuleRegistry, type ObjectRelationCardinality, type ObjectRelationDefinition, type ObjectRelationDeleteBehavior, type ObjectRelationSemantics, type ObjectTypeRegistration, type ObjectTypeRegistrationInput, type PolicyRegistration, type StateMachineRegistration, createModuleRegistry, getEventTypeName, getModuleDependencyNamespace, getObjectTypeName, registerFabricModule, registerFabricModules, validateAndOrderFabricModules, validateModuleNamespace };
|
package/dist/modules/index.d.ts
CHANGED
|
@@ -75,6 +75,34 @@ interface CapabilityRequirements {
|
|
|
75
75
|
entitlements?: string[];
|
|
76
76
|
featureFlags?: string[];
|
|
77
77
|
}
|
|
78
|
+
interface CapabilityWorkflowTimer {
|
|
79
|
+
/** Workflow-local identity of the deadline, for example "right-to-cure". */
|
|
80
|
+
name: string;
|
|
81
|
+
/** Configuration key the duration is resolved from when the workflow starts. */
|
|
82
|
+
configKey: string;
|
|
83
|
+
description?: string;
|
|
84
|
+
}
|
|
85
|
+
interface CapabilityWorkflowCompensation {
|
|
86
|
+
/** Workflow step whose effect this reverses. */
|
|
87
|
+
step: string;
|
|
88
|
+
/** Governed action that performs the reversal. Must belong to the declaring module. */
|
|
89
|
+
actionId: `${string}.${string}`;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* A durable workflow this capability owns. Declaring it makes durability a
|
|
93
|
+
* reviewable fact of the contract rather than a property of worker deployment:
|
|
94
|
+
* the queue it runs on, the deadlines it carries, and what reverses each step
|
|
95
|
+
* are all diffable.
|
|
96
|
+
*/
|
|
97
|
+
interface CapabilityWorkflowDeclaration {
|
|
98
|
+
name: string;
|
|
99
|
+
/** Routing identity, conventionally `capability.vertical`. */
|
|
100
|
+
taskQueue: string;
|
|
101
|
+
/** Event type whose arrival starts this workflow by choreography. */
|
|
102
|
+
startedBy?: string;
|
|
103
|
+
timers?: CapabilityWorkflowTimer[];
|
|
104
|
+
compensations?: CapabilityWorkflowCompensation[];
|
|
105
|
+
}
|
|
78
106
|
interface CapabilityMetadata {
|
|
79
107
|
displayName: string;
|
|
80
108
|
description: string;
|
|
@@ -89,6 +117,8 @@ interface CapabilityMetadata {
|
|
|
89
117
|
profile: string;
|
|
90
118
|
required: boolean;
|
|
91
119
|
};
|
|
120
|
+
/** Durable workflows this capability owns, with their queues, deadlines and reversals. */
|
|
121
|
+
workflows?: CapabilityWorkflowDeclaration[];
|
|
92
122
|
/** Namespaced declared data preserved by Platform and interpreted only by its owning package. */
|
|
93
123
|
extensions?: Record<string, JsonValue>;
|
|
94
124
|
}
|
|
@@ -134,4 +164,4 @@ declare function registerFabricModules<TDb = unknown>(modules: FabricModule<TDb>
|
|
|
134
164
|
/** @deprecated Use createModuleRegistry([module]); registration is now explicit and instance-scoped. */
|
|
135
165
|
declare function registerFabricModule<TDb = unknown>(module: FabricModule<TDb>): void;
|
|
136
166
|
|
|
137
|
-
export { type CapabilityMetadata, type CapabilityPortRequirement, type CapabilityRequirements, type DeclarativeInvariant, type EventTypeRegistration, type EventTypeRegistrationInput, type FabricModule, type IdPrefixRegistration, type InvariantEnforcement, type ModuleDependency, type ModuleDependencyInput, type ModuleRegistry, type ObjectRelationCardinality, type ObjectRelationDefinition, type ObjectRelationDeleteBehavior, type ObjectRelationSemantics, type ObjectTypeRegistration, type ObjectTypeRegistrationInput, type PolicyRegistration, type StateMachineRegistration, createModuleRegistry, getEventTypeName, getModuleDependencyNamespace, getObjectTypeName, registerFabricModule, registerFabricModules, validateAndOrderFabricModules, validateModuleNamespace };
|
|
167
|
+
export { type CapabilityMetadata, type CapabilityPortRequirement, type CapabilityRequirements, type CapabilityWorkflowCompensation, type CapabilityWorkflowDeclaration, type CapabilityWorkflowTimer, type DeclarativeInvariant, type EventTypeRegistration, type EventTypeRegistrationInput, type FabricModule, type IdPrefixRegistration, type InvariantEnforcement, type ModuleDependency, type ModuleDependencyInput, type ModuleRegistry, type ObjectRelationCardinality, type ObjectRelationDefinition, type ObjectRelationDeleteBehavior, type ObjectRelationSemantics, type ObjectTypeRegistration, type ObjectTypeRegistrationInput, type PolicyRegistration, type StateMachineRegistration, createModuleRegistry, getEventTypeName, getModuleDependencyNamespace, getObjectTypeName, registerFabricModule, registerFabricModules, validateAndOrderFabricModules, validateModuleNamespace };
|
package/dist/modules/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { createModuleRegistry, getEventTypeName, getModuleDependencyNamespace, getObjectTypeName, registerFabricModule, registerFabricModules, validateAndOrderFabricModules, validateModuleNamespace } from '../chunk-
|
|
1
|
+
export { createModuleRegistry, getEventTypeName, getModuleDependencyNamespace, getObjectTypeName, registerFabricModule, registerFabricModules, validateAndOrderFabricModules, validateModuleNamespace } from '../chunk-53YJK3LK.js';
|
|
2
2
|
import '../chunk-NETLRKDS.js';
|
|
3
3
|
import '../chunk-J5LS5BSI.js';
|
|
4
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-NHGBTPPE.js';
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fabricorg/platform",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Generic, vertical-agnostic runtime for ontology-based business applications. Provides actions, modules, events, policies, state machines, adapters, displays, projections, privacy, and evidence contracts. Zero runtime dependencies; portable across any database client and any vertical (lending, insurance, healthcare, legal, etc.).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fabric",
|