@inf-monkeys-tech/monkeys 1.1.57 → 1.1.59
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/lib/contracts/artifact-platform.d.ts +0 -2
- package/lib/contracts/artifact-platform.d.ts.map +1 -1
- package/lib/contracts/artifact-platform.js +1 -11
- package/lib/contracts/artifact-platform.js.map +1 -1
- package/lib/contracts/declarative-control-http.d.ts +47 -47
- package/lib/contracts/declarative-control.d.ts +3 -3
- package/lib/contracts/declarative-diagnostic.d.ts +2 -2
- package/lib/contracts/declarative-document-import.d.ts +2 -2
- package/lib/contracts/declarative-publication-job.d.ts +19 -19
- package/lib/contracts/declarative-publication-verification.d.ts +1 -1
- package/lib/contracts/index.d.ts +0 -1
- package/lib/contracts/index.d.ts.map +1 -1
- package/lib/contracts/index.js +0 -1
- package/lib/contracts/index.js.map +1 -1
- package/lib/contracts/menu.d.ts +10 -10
- package/lib/contracts/page-expression.d.ts +1 -1
- package/lib/contracts/tenant.d.ts +5 -5
- package/lib/contracts/workflow-definition.d.ts +503 -0
- package/lib/contracts/workflow-definition.d.ts.map +1 -1
- package/lib/contracts/workflow-definition.js +189 -3
- package/lib/contracts/workflow-definition.js.map +1 -1
- package/lib/esm/{chunk-5ZGNWCL4.mjs → chunk-2TZMP3VI.mjs} +307 -466
- package/lib/esm/chunk-2TZMP3VI.mjs.map +1 -0
- package/lib/esm/{chunk-USWQ4YP5.mjs → chunk-6AX5KAJM.mjs} +2 -2
- package/lib/esm/{chunk-FIZWECL6.mjs → chunk-J6ZVASVX.mjs} +169 -15
- package/lib/esm/chunk-J6ZVASVX.mjs.map +1 -0
- package/lib/esm/{chunk-HJNQDSLC.mjs → chunk-MEIIFDVZ.mjs} +2 -2
- package/lib/esm/{chunk-VYC47WKJ.mjs → chunk-VX54ES4K.mjs} +34 -444
- package/lib/esm/chunk-VX54ES4K.mjs.map +1 -0
- package/lib/esm/{chunk-C3X5SSRD.mjs → chunk-WYIVUDQH.mjs} +3 -3
- package/lib/esm/chunk-WYIVUDQH.mjs.map +1 -0
- package/lib/esm/contracts/index.mjs +22 -30
- package/lib/esm/index.mjs +26 -46
- package/lib/esm/index.mjs.map +1 -1
- package/lib/esm/runtime/index.mjs +5 -17
- package/lib/esm/schemas/index.mjs +21 -27
- package/lib/json-schema/workflow-definition.schema.json +584 -0
- package/lib/runtime/artifact-session.d.ts +19 -7
- package/lib/runtime/artifact-session.d.ts.map +1 -1
- package/lib/runtime/artifact-session.js +38 -436
- package/lib/runtime/artifact-session.js.map +1 -1
- package/lib/runtime/runtime-definition-wire.d.ts +6 -6
- package/lib/schemas/index.d.ts +112 -12
- package/lib/schemas/index.d.ts.map +1 -1
- package/lib/schemas/index.js +17 -21
- package/lib/schemas/index.js.map +1 -1
- package/package.json +2 -2
- package/lib/contracts/engineering-artifacts.d.ts +0 -359
- package/lib/contracts/engineering-artifacts.d.ts.map +0 -1
- package/lib/contracts/engineering-artifacts.js +0 -191
- package/lib/contracts/engineering-artifacts.js.map +0 -1
- package/lib/esm/chunk-5ZGNWCL4.mjs.map +0 -1
- package/lib/esm/chunk-C3X5SSRD.mjs.map +0 -1
- package/lib/esm/chunk-FIZWECL6.mjs.map +0 -1
- package/lib/esm/chunk-VYC47WKJ.mjs.map +0 -1
- /package/lib/esm/{chunk-USWQ4YP5.mjs.map → chunk-6AX5KAJM.mjs.map} +0 -0
- /package/lib/esm/{chunk-HJNQDSLC.mjs.map → chunk-MEIIFDVZ.mjs.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/contracts/artifact.ts","../../src/contracts/aggregate-commit.ts","../../src/contracts/context.ts","../../src/contracts/continuity.ts","../../src/contracts/declarative-publication-verification.ts","../../src/contracts/declarative-document-import.ts","../../src/contracts/trend.ts","../../src/contracts/workflow-runtime.ts"],"sourcesContent":["import { z } from 'zod';\nimport {\n ContractIdentifierSchema,\n EntityRefSchema,\n IsoDateTimeSchema,\n JsonValueSchema,\n Sha256Schema,\n} from './common';\n\nexport const StorageLocatorSchema = z\n .object({\n provider: ContractIdentifierSchema,\n bucket: ContractIdentifierSchema.optional(),\n key: ContractIdentifierSchema,\n region: ContractIdentifierSchema.optional(),\n url: z.string().url().optional(),\n expiresAt: IsoDateTimeSchema.optional(),\n })\n .strict();\n\nexport const ArtifactAccessSchema = z\n .object({\n tenantId: ContractIdentifierSchema.optional(),\n teamId: ContractIdentifierSchema.optional(),\n ownerRef: EntityRefSchema.optional(),\n visibility: z.enum(['private', 'team', 'tenant', 'public']),\n })\n .strict();\n\nexport const ArtifactManifestSchema = z\n .object({\n contract: z.literal('ArtifactManifest'),\n artifactId: ContractIdentifierSchema,\n kind: ContractIdentifierSchema,\n mimeType: z.string().trim().min(1),\n byteSize: z.number().int().nonnegative().optional(),\n sha256: Sha256Schema,\n storage: StorageLocatorSchema,\n sourceRef: EntityRefSchema.optional(),\n runRef: EntityRefSchema,\n outputRef: EntityRefSchema,\n producer: z\n .object({\n service: ContractIdentifierSchema,\n version: ContractIdentifierSchema,\n capabilityRef: EntityRefSchema.optional(),\n })\n .strict(),\n access: ArtifactAccessSchema,\n metadata: z.record(z.string(), JsonValueSchema).default({}),\n createdAt: IsoDateTimeSchema,\n })\n .strict();\n\nexport const OutputRecordSchema = z\n .object({\n contract: z.literal('OutputRecord'),\n outputId: ContractIdentifierSchema,\n runRef: EntityRefSchema,\n outputPort: ContractIdentifierSchema,\n value: JsonValueSchema.optional(),\n artifactRefs: z.array(EntityRefSchema).default([]),\n schemaRef: ContractIdentifierSchema.optional(),\n createdAt: IsoDateTimeSchema,\n })\n .strict();\n\nexport type StorageLocator = z.infer<typeof StorageLocatorSchema>;\nexport type ArtifactAccess = z.infer<typeof ArtifactAccessSchema>;\nexport type ArtifactManifest = z.infer<typeof ArtifactManifestSchema>;\nexport type OutputRecord = z.infer<typeof OutputRecordSchema>;\n","import { z } from 'zod';\nimport { JsonObjectSchema } from './common';\n\nconst AggregateIdentifierSchema = z.string().trim().min(1).max(128);\nconst AggregateRequestIdentifierSchema = z.string().trim().min(1).max(256);\nconst AggregateMutationsLimit = 500;\n\nexport const AggregateAssetSchema = z\n .object({\n id: AggregateIdentifierSchema,\n name: z.string().trim().min(1).max(500),\n asset_type: AggregateIdentifierSchema,\n primary_content: JsonObjectSchema,\n status: z.string().trim().min(1).max(64).optional(),\n creator_user_id: AggregateIdentifierSchema.optional(),\n properties: JsonObjectSchema.optional(),\n files: z.array(JsonObjectSchema).max(100).optional(),\n media: z.string().max(4096).optional(),\n thumbnail: z.string().max(4096).optional(),\n media_ref: JsonObjectSchema.optional(),\n keywords: z.string().max(2000).optional(),\n extra: JsonObjectSchema.optional(),\n sort: z.number().int().nonnegative().optional(),\n })\n .strict();\n\nexport const AggregateAssetUpsertSchema = z\n .object({\n ontology_id: AggregateIdentifierSchema,\n asset: AggregateAssetSchema,\n tag_ids: z.array(AggregateIdentifierSchema).max(200).optional(),\n })\n .strict();\n\nexport const AggregateAssetDeleteSchema = z\n .object({\n ontology_id: AggregateIdentifierSchema,\n asset_id: AggregateIdentifierSchema,\n })\n .strict();\n\nexport const AggregateFeatureValueWriteSchema = z\n .object({\n ontology_id: AggregateIdentifierSchema,\n asset_id: AggregateIdentifierSchema,\n column_id: AggregateIdentifierSchema,\n value_text: z.string().max(1_000_000).nullable(),\n })\n .strict();\n\nexport const AggregateFeatureRelationTargetSchema = z\n .object({\n ontology_id: AggregateIdentifierSchema,\n asset_id: AggregateIdentifierSchema,\n })\n .strict();\n\nexport const AggregateFeatureRelationReplaceSchema = z\n .object({\n ontology_id: AggregateIdentifierSchema,\n asset_id: AggregateIdentifierSchema,\n column_id: AggregateIdentifierSchema,\n targets: z.array(AggregateFeatureRelationTargetSchema).max(AggregateMutationsLimit),\n })\n .strict();\n\nexport const AggregateAssetRelationObjectSchema = z\n .object({\n object_kind: z.string().trim().min(1).max(64),\n object_id: z.string().trim().min(1).max(256),\n properties: JsonObjectSchema.optional(),\n })\n .strict();\n\nexport const AggregateAssetRelationReplaceSchema = z\n .object({\n ontology_id: AggregateIdentifierSchema,\n asset_id: AggregateIdentifierSchema,\n relation_kind: z.string().trim().min(1).max(64),\n objects: z.array(AggregateAssetRelationObjectSchema).max(AggregateMutationsLimit),\n })\n .strict();\n\nexport const AggregateContainerMembershipWriteSchema = z\n .object({\n ontology_id: AggregateIdentifierSchema,\n container_view_id: AggregateIdentifierSchema,\n asset_id: AggregateIdentifierSchema,\n present: z.boolean(),\n })\n .strict();\n\nexport const AggregateCommitRequestSchema = z\n .object({\n contract: z.literal('AggregateCommitRequest'),\n aggregate_id: AggregateIdentifierSchema,\n request_id: AggregateRequestIdentifierSchema,\n idempotency_key: AggregateIdentifierSchema,\n expected_head_commit_id: AggregateIdentifierSchema.optional(),\n message: z.string().trim().max(500).optional(),\n assets: z.array(AggregateAssetUpsertSchema).max(AggregateMutationsLimit).optional(),\n asset_deletes: z.array(AggregateAssetDeleteSchema).max(AggregateMutationsLimit).optional(),\n feature_values: z.array(AggregateFeatureValueWriteSchema).max(AggregateMutationsLimit).optional(),\n feature_relations: z.array(AggregateFeatureRelationReplaceSchema).max(AggregateMutationsLimit).optional(),\n asset_relations: z.array(AggregateAssetRelationReplaceSchema).max(AggregateMutationsLimit).optional(),\n container_memberships: z.array(AggregateContainerMembershipWriteSchema).max(AggregateMutationsLimit).optional(),\n })\n .strict()\n .superRefine((request, context) => {\n const mutationCount =\n (request.assets?.length ?? 0) +\n (request.asset_deletes?.length ?? 0) +\n (request.feature_values?.length ?? 0) +\n (request.feature_relations?.length ?? 0) +\n (request.asset_relations?.length ?? 0) +\n (request.container_memberships?.length ?? 0);\n if (mutationCount === 0) {\n context.addIssue({ code: 'custom', message: 'at least one aggregate mutation is required' });\n }\n });\n\nexport type AggregateAsset = z.infer<typeof AggregateAssetSchema>;\nexport type AggregateAssetUpsert = z.infer<typeof AggregateAssetUpsertSchema>;\nexport type AggregateAssetDelete = z.infer<typeof AggregateAssetDeleteSchema>;\nexport type AggregateFeatureValueWrite = z.infer<typeof AggregateFeatureValueWriteSchema>;\nexport type AggregateFeatureRelationTarget = z.infer<typeof AggregateFeatureRelationTargetSchema>;\nexport type AggregateFeatureRelationReplace = z.infer<typeof AggregateFeatureRelationReplaceSchema>;\nexport type AggregateAssetRelationObject = z.infer<typeof AggregateAssetRelationObjectSchema>;\nexport type AggregateAssetRelationReplace = z.infer<typeof AggregateAssetRelationReplaceSchema>;\nexport type AggregateContainerMembershipWrite = z.infer<typeof AggregateContainerMembershipWriteSchema>;\nexport type AggregateCommitRequest = z.infer<typeof AggregateCommitRequestSchema>;\n","import { z } from 'zod';\nimport {\n ContractIdentifierSchema,\n EntityRefSchema,\n IsoDateTimeSchema,\n JsonValueSchema,\n} from './common';\n\nexport const ActorRefSchema = z\n .object({\n kind: z.enum(['human', 'agent', 'service', 'tenant', 'public']),\n id: ContractIdentifierSchema.optional(),\n userId: ContractIdentifierSchema.optional(),\n agentId: ContractIdentifierSchema.optional(),\n serviceId: ContractIdentifierSchema.optional(),\n })\n .strict();\n\nexport const AuthorityScopeSchema = z\n .object({\n resource: ContractIdentifierSchema,\n actions: z.array(ContractIdentifierSchema).min(1),\n constraints: z.record(z.string(), JsonValueSchema).optional(),\n })\n .strict();\n\nexport const RequestScopeSchema = z\n .object({\n contract: z.literal('RequestScope'),\n requestId: ContractIdentifierSchema,\n traceId: ContractIdentifierSchema.optional(),\n appId: ContractIdentifierSchema,\n tenantId: ContractIdentifierSchema.optional(),\n teamId: ContractIdentifierSchema.optional(),\n actor: ActorRefSchema,\n session: z\n .object({\n authType: ContractIdentifierSchema,\n authenticated: z.boolean(),\n membershipVerified: z.boolean(),\n })\n .strict(),\n permissionCodes: z.array(ContractIdentifierSchema).default([]),\n authority: z.array(AuthorityScopeSchema).default([]),\n issuedAt: IsoDateTimeSchema,\n })\n .strict();\n\nexport const ExecutionLinkSchema = z\n .object({\n contract: z.literal('ExecutionLink'),\n requestId: ContractIdentifierSchema,\n traceId: ContractIdentifierSchema.optional(),\n correlationId: ContractIdentifierSchema.optional(),\n causationId: ContractIdentifierSchema.optional(),\n workflowRef: EntityRefSchema.optional(),\n runRef: EntityRefSchema,\n taskRef: EntityRefSchema.optional(),\n parentRunRef: EntityRefSchema.optional(),\n })\n .strict();\n\nexport const CompletionHeaderSchema = z\n .object({\n contract: z.literal('CompletionHeader'),\n eventId: ContractIdentifierSchema,\n runtimeEventId: ContractIdentifierSchema,\n idempotencyKey: ContractIdentifierSchema,\n sequence: z.number().int().nonnegative(),\n execution: ExecutionLinkSchema,\n producer: z\n .object({\n service: ContractIdentifierSchema,\n runtime: ContractIdentifierSchema,\n version: ContractIdentifierSchema,\n })\n .strict(),\n status: z.enum(['SUCCEEDED', 'FAILED', 'CANCELLED', 'TIMED_OUT']),\n occurredAt: IsoDateTimeSchema,\n payloadSchemaRef: ContractIdentifierSchema.optional(),\n })\n .strict();\n\nexport const CompletionEventSchema = z\n .object({\n header: CompletionHeaderSchema,\n payload: JsonValueSchema.optional(),\n })\n .strict();\n\nexport const AgentRuntimeEventSchema = z\n .object({\n contract: z.literal('AgentRuntimeEvent'),\n runtimeEventId: ContractIdentifierSchema,\n streamId: ContractIdentifierSchema,\n sequence: z.number().int().nonnegative(),\n requestId: ContractIdentifierSchema,\n teamId: ContractIdentifierSchema,\n threadId: ContractIdentifierSchema.optional(),\n eventType: z.enum(['messages:append', 'messages:update', 'thread:update', 'tool-call:upsert', 'session:event']),\n payload: JsonValueSchema,\n occurredAt: IsoDateTimeSchema,\n })\n .strict();\n\nexport type ActorRef = z.infer<typeof ActorRefSchema>;\nexport type AuthorityScope = z.infer<typeof AuthorityScopeSchema>;\nexport type RequestScope = z.infer<typeof RequestScopeSchema>;\nexport type ExecutionLink = z.infer<typeof ExecutionLinkSchema>;\nexport type CompletionHeader = z.infer<typeof CompletionHeaderSchema>;\nexport type CompletionEvent = z.infer<typeof CompletionEventSchema>;\nexport type AgentRuntimeEvent = z.infer<typeof AgentRuntimeEventSchema>;\n","import { z } from 'zod';\nimport {\n ContractIdentifierSchema,\n ContractVersionSchema,\n EntityRefSchema,\n IsoDateTimeSchema,\n JsonObjectSchema,\n} from './common';\n\nexport const DataContinuityEnvelopeSchema = z\n .object({\n contract: z.literal('DataContinuityEnvelope'),\n tenantId: ContractIdentifierSchema,\n teamId: ContractIdentifierSchema,\n sourceRef: EntityRefSchema.optional(),\n bodyRef: EntityRefSchema.optional(),\n runRef: EntityRefSchema.optional(),\n outputRef: EntityRefSchema.optional(),\n artifactRef: EntityRefSchema.optional(),\n requestId: ContractIdentifierSchema,\n actorRef: EntityRefSchema,\n schemaVersion: ContractVersionSchema,\n })\n .strict()\n .refine(\n value => Boolean(value.sourceRef || value.bodyRef || value.runRef || value.outputRef || value.artifactRef),\n 'At least one continuity ref is required.',\n );\n\nexport const BodyRelationRecordSchema = z\n .object({\n contract: z.literal('BodyRelationRecord'),\n relationId: ContractIdentifierSchema,\n relationKind: ContractIdentifierSchema,\n subjectRef: EntityRefSchema,\n objectRef: EntityRefSchema,\n ownerRepo: ContractIdentifierSchema,\n authorityScope: z.enum(['tenant', 'team', 'global']),\n properties: JsonObjectSchema.default({}),\n createdAt: IsoDateTimeSchema,\n updatedAt: IsoDateTimeSchema,\n })\n .strict();\n\nexport const ApplicationRunSchema = z\n .object({\n contract: z.literal('ApplicationRun'),\n runId: ContractIdentifierSchema,\n definitionRef: EntityRefSchema,\n runtimeLedgerRef: EntityRefSchema.optional(),\n requestId: ContractIdentifierSchema,\n actorRef: EntityRefSchema,\n status: z.enum(['PENDING', 'RUNNING', 'COMPLETED', 'FAILED', 'CANCELLED', 'EXPIRED']),\n inputRefs: z.array(EntityRefSchema).default([]),\n outputRefs: z.array(EntityRefSchema).default([]),\n startedAt: IsoDateTimeSchema.optional(),\n completedAt: IsoDateTimeSchema.optional(),\n expiresAt: IsoDateTimeSchema.optional(),\n metadata: JsonObjectSchema.default({}),\n })\n .strict()\n .superRefine((run, context) => {\n if (run.definitionRef.kind !== 'workflow-definition') {\n context.addIssue({\n code: 'custom',\n path: ['definitionRef', 'kind'],\n message: 'definitionRef must reference a workflow-definition.',\n });\n }\n if (run.runtimeLedgerRef && run.runtimeLedgerRef.kind !== 'workflow-run') {\n context.addIssue({\n code: 'custom',\n path: ['runtimeLedgerRef', 'kind'],\n message: 'runtimeLedgerRef must reference a workflow-run.',\n });\n }\n if ((run.status === 'RUNNING' || run.status === 'COMPLETED' || run.status === 'CANCELLED') && !run.runtimeLedgerRef) {\n context.addIssue({\n code: 'custom',\n path: ['runtimeLedgerRef'],\n message: `${run.status} ApplicationRun requires runtimeLedgerRef.`,\n });\n }\n if (run.status === 'RUNNING' && !run.startedAt) {\n context.addIssue({\n code: 'custom',\n path: ['startedAt'],\n message: 'RUNNING ApplicationRun requires startedAt.',\n });\n }\n if (['COMPLETED', 'FAILED', 'CANCELLED', 'EXPIRED'].includes(run.status) && !run.completedAt) {\n context.addIssue({\n code: 'custom',\n path: ['completedAt'],\n message: `Terminal ApplicationRun status ${run.status} requires completedAt.`,\n });\n }\n });\n\nexport const ExpiringAccessGrantSchema = z\n .object({\n contract: z.literal('ExpiringAccessGrant'),\n grantId: ContractIdentifierSchema,\n subjectRef: EntityRefSchema,\n resourceRef: EntityRefSchema,\n permissions: z.array(ContractIdentifierSchema).min(1),\n issuedAt: IsoDateTimeSchema,\n expiresAt: IsoDateTimeSchema,\n revokedAt: IsoDateTimeSchema.optional(),\n })\n .strict()\n .refine(value => Date.parse(value.expiresAt) > Date.parse(value.issuedAt), 'expiresAt must be after issuedAt');\n\nexport type DataContinuityEnvelope = z.infer<typeof DataContinuityEnvelopeSchema>;\nexport type BodyRelationRecord = z.infer<typeof BodyRelationRecordSchema>;\nexport type ApplicationRun = z.infer<typeof ApplicationRunSchema>;\nexport type ExpiringAccessGrant = z.infer<typeof ExpiringAccessGrantSchema>;\n","import { z } from \"zod\";\nimport { ContractIdentifierSchema } from \"./common\";\nimport { RevisionRefSchema } from \"./declarative-control\";\nimport { DeclarativeDiagnosticSchema } from \"./declarative-diagnostic\";\n\n/** Authoring target selection is independent of the authenticated business Team. */\nexport const DECLARATIVE_PUBLICATION_SCOPE_HEADER = \"x-monkeys-declarative-scope\";\nexport const DECLARATIVE_PUBLICATION_SURFACE_HEADER = \"x-monkeys-declarative-surface\";\nexport const DeclarativePublicationScopeSchema = z.discriminatedUnion(\"kind\", [\n z.object({ kind: z.literal(\"global\") }).strict(),\n z.object({\n kind: z.literal(\"team\"),\n teamId: ContractIdentifierSchema.refine((value) => value !== \"0\", \"Use global scope for the reserved namespace.\"),\n }).strict(),\n]);\nexport type DeclarativePublicationScope = z.infer<typeof DeclarativePublicationScopeSchema>;\n\nexport const DeclarativePublicationVerificationRequestSchema = z.object({\n resourceKind: z.enum([\"page\", \"navigation\", \"workbench\"]),\n resourceId: ContractIdentifierSchema,\n releaseSlotId: ContractIdentifierSchema,\n releaseVersion: z.number().int().positive().optional(),\n expectedReleaseRevisionRef: RevisionRefSchema.optional(),\n expectedDefinitionRevisionRef: RevisionRefSchema.optional(),\n idempotencyKey: z.string().trim().min(1).max(256).optional(),\n audience: z.object({\n teamId: ContractIdentifierSchema.optional(),\n path: z.string().trim().min(1).max(4096).optional(),\n }).strict().optional(),\n}).strict();\nexport type DeclarativePublicationVerificationRequest = z.infer<typeof DeclarativePublicationVerificationRequestSchema>;\n\nexport const DeclarativePublicationVerificationSchema = z.object({\n contract: z.literal(\"DeclarativePublicationVerification\"),\n schemaVersion: z.literal(1),\n resourceKind: z.enum([\"page\", \"navigation\", \"workbench\"]),\n resourceId: ContractIdentifierSchema,\n scope: DeclarativePublicationScopeSchema,\n publication: z.enum([\"committed\", \"unknown\"]),\n activation: z.enum([\"active\", \"superseded\", \"deactivated\", \"unavailable\"]),\n integrity: z.enum([\"verified\", \"unverified\", \"failed\"]),\n runtime: z.enum([\"not-requested\", \"verified\", \"context-required\", \"forbidden\", \"failed\"]),\n retryable: z.boolean().default(false),\n releaseRevisionRef: RevisionRefSchema.optional(),\n definitionRevisionRef: RevisionRefSchema.optional(),\n runtimeContentHash: z.string().regex(/^[a-f0-9]{64}$/).optional(),\n requestId: z.string().max(256).optional(),\n diagnostics: z.array(DeclarativeDiagnosticSchema).max(32),\n}).strict().superRefine((value, context) => {\n if ((value.integrity === \"verified\" || value.runtime === \"verified\") &&\n (value.publication !== \"committed\" || value.activation !== \"active\" || !value.releaseRevisionRef || !value.definitionRevisionRef)) {\n context.addIssue({ code: \"custom\", path: [\"integrity\"], message: \"Verification requires an exact committed active Release and definition.\" });\n }\n if (value.runtime === \"verified\" && value.integrity !== \"verified\") {\n context.addIssue({ code: \"custom\", path: [\"runtime\"], message: \"Audience verification requires publication integrity.\" });\n }\n});\nexport type DeclarativePublicationVerification = z.infer<typeof DeclarativePublicationVerificationSchema>;\n","import { z } from \"zod\";\nimport { ContractIdentifierSchema, Sha256Schema } from \"./common\";\nimport { DeclarativeDiagnosticSchema } from \"./declarative-diagnostic\";\nimport {\n NavigationSchema,\n PageSchema,\n ProductSurfaceSchema,\n RevisionRefSchema,\n TenantScopeSchema,\n} from \"./declarative-control\";\n\nconst sameScope = (\n left: z.infer<typeof TenantScopeSchema>,\n right: z.infer<typeof TenantScopeSchema>,\n): boolean =>\n ([\"tenantRef\", \"dataSpaceRef\", \"teamRef\"] as const).every(\n (key) =>\n left[key]?.kind === right[key]?.kind &&\n left[key]?.id === right[key]?.id &&\n left[key]?.ownerRepo === right[key]?.ownerRepo,\n );\n\nexport const DeclarativeImportDocumentSchema = z.union([\n PageSchema,\n NavigationSchema,\n]);\n\nconst requestShape = {\n document: DeclarativeImportDocumentSchema,\n surface: ProductSurfaceSchema,\n environmentId: ContractIdentifierSchema.optional(),\n};\n\nfunction supportsSurface(value: {\n document: z.infer<typeof DeclarativeImportDocumentSchema>;\n surface: \"kernel\" | \"studio\";\n}): boolean {\n return value.document.contract === \"Page\"\n ? value.document.surface === value.surface\n : value.document.supportedSurfaces.includes(value.surface);\n}\n\nexport const DeclarativeDocumentImportRequestSchema = z\n .object(requestShape)\n .strict()\n .refine(supportsSurface, {\n path: [\"surface\"],\n message: \"The document does not support the selected surface.\",\n });\n\nexport const DeclarativeDocumentImportIntentSchema = z\n .object({\n ...requestShape,\n expectedVersion: z.number().int().nonnegative(),\n expectedPlanHash: Sha256Schema,\n idempotencyKey: z.string().trim().min(1).max(256),\n })\n .strict()\n .refine(supportsSurface, {\n path: [\"surface\"],\n message: \"The document does not support the selected surface.\",\n });\n\n/**\n * The authored boundary carries less than a persisted declaration: the target\n * fills schemaVersion, lifecycle, surface, tenantScope and managementAccess, and\n * the Server validates the document against the contract once it has done so.\n */\nexport const DeclarativeAuthoringEnvelopeSchema = z\n .object({\n document: z.record(z.string(), z.unknown()),\n surface: ProductSurfaceSchema.optional(),\n environmentId: ContractIdentifierSchema.optional(),\n })\n .strict();\n\nexport const DeclarativeAuthoringImportIntentSchema =\n DeclarativeAuthoringEnvelopeSchema.extend({\n expectedPlanHash: Sha256Schema,\n expectedVersion: z.number().int().nonnegative(),\n idempotencyKey: z.string().trim().min(1).max(256),\n }).strict();\n\n/** One request that saves the authored document and publishes it. */\nexport const DeclarativeAuthoringPublishEnvelopeSchema =\n DeclarativeAuthoringEnvelopeSchema.extend({\n placement: ContractIdentifierSchema.optional(),\n routeClaimIndex: z.number().int().nonnegative().optional(),\n }).strict();\n\nexport const DeclarativeDocumentImportPlanSchema = z\n .object({\n contract: z.literal(\"DeclarativeDocumentImportPlan\"),\n schemaVersion: z.literal(1),\n resourceKind: z.enum([\"page\", \"navigation\"]),\n resourceId: ContractIdentifierSchema,\n surface: ProductSurfaceSchema,\n sourceContentHash: Sha256Schema,\n environmentRevisionRef: RevisionRefSchema,\n document: DeclarativeImportDocumentSchema,\n tenantScope: TenantScopeSchema.nullable(),\n requiresInitialization: z.boolean(),\n expectedVersion: z.number().int().nonnegative(),\n currentContentHash: Sha256Schema.nullable(),\n changed: z.boolean(),\n diagnostics: z.array(DeclarativeDiagnosticSchema),\n dependencyContentHash: Sha256Schema,\n planHash: Sha256Schema,\n })\n .strict()\n .superRefine((value, context) => {\n const kind = value.document.contract === \"Page\" ? \"page\" : \"navigation\";\n const id =\n value.document.contract === \"Page\"\n ? value.document.pageId\n : value.document.navigationId;\n if (\n kind !== value.resourceKind ||\n id !== value.resourceId ||\n !supportsSurface(value)\n )\n context.addIssue({\n code: \"custom\",\n path: [\"document\"],\n message: \"The plan must identify its document and supported surface.\",\n });\n if (value.requiresInitialization !== (value.tenantScope === null))\n context.addIssue({\n code: \"custom\",\n path: [\"requiresInitialization\"],\n message: \"Only an uninitialized target may omit tenantScope.\",\n });\n if (value.environmentRevisionRef.kind !== \"environment\")\n context.addIssue({\n code: \"custom\",\n path: [\"environmentRevisionRef\"],\n message: \"The import plan must pin an environment revision.\",\n });\n if (\n value.tenantScope &&\n !sameScope(value.tenantScope, value.document.tenantScope)\n )\n context.addIssue({\n code: \"custom\",\n path: [\"tenantScope\"],\n message: \"The plan and bound document must belong to the same scope.\",\n });\n });\n\nexport const DeclarativeDocumentImportResultSchema = z\n .object({\n action: z.literal(\"import\"),\n changed: z.boolean(),\n plan: DeclarativeDocumentImportPlanSchema,\n revisionRef: RevisionRefSchema,\n })\n .strict()\n .superRefine((value, context) => {\n if (\n value.changed !== value.plan.changed ||\n value.revisionRef.kind !== value.plan.resourceKind ||\n value.revisionRef.id !== value.plan.resourceId ||\n value.revisionRef.revision !==\n value.plan.expectedVersion + Number(value.changed) ||\n !value.revisionRef.tenantScope ||\n !sameScope(value.revisionRef.tenantScope, value.plan.document.tenantScope)\n ) {\n context.addIssue({\n code: \"custom\",\n path: [\"revisionRef\"],\n message:\n \"The import result must identify the exact saved or unchanged draft revision.\",\n });\n }\n });\n\nexport type DeclarativeImportDocument = z.infer<\n typeof DeclarativeImportDocumentSchema\n>;\nexport type DeclarativeDocumentImportRequest = z.infer<\n typeof DeclarativeDocumentImportRequestSchema\n>;\nexport type DeclarativeDocumentImportIntent = z.infer<\n typeof DeclarativeDocumentImportIntentSchema\n>;\nexport type DeclarativeAuthoringEnvelope = z.infer<\n typeof DeclarativeAuthoringEnvelopeSchema\n>;\nexport type DeclarativeAuthoringImportIntent = z.infer<\n typeof DeclarativeAuthoringImportIntentSchema\n>;\nexport type DeclarativeAuthoringPublishEnvelope = z.infer<\n typeof DeclarativeAuthoringPublishEnvelopeSchema\n>;\nexport type DeclarativeDocumentImportPlan = z.infer<\n typeof DeclarativeDocumentImportPlanSchema\n>;\nexport type DeclarativeDocumentImportResult = z.infer<\n typeof DeclarativeDocumentImportResultSchema\n>;\n","import { z } from 'zod';\nimport {\n ContractIdentifierSchema,\n EntityRefSchema,\n IsoDateTimeSchema,\n JsonObjectSchema,\n JsonValueSchema,\n Sha256Schema,\n} from './common';\nimport { LineageRecordSchema } from './data';\nimport { OutputRecordSchema } from './artifact';\n\nexport const RadarDecisionMetricsSchema = z\n .object({\n currentSales: z.number().finite(),\n forecastSales: z.number().finite(),\n searchHeat: z.number().finite(),\n socialHeat: z.number().finite(),\n confidence: z.number().min(0).max(1),\n })\n .strict();\n\nexport const TrendSourceSchema = z\n .object({\n sourceId: ContractIdentifierSchema,\n provider: ContractIdentifierSchema,\n channel: z.enum(['trend', 'ecommerce', 'social', 'search', 'internal']),\n collectedAt: IsoDateTimeSchema,\n sourceUrl: z.string().url().optional(),\n evidenceRefs: z.array(EntityRefSchema).default([]),\n })\n .strict();\n\nexport const TrendIngestRunSchema = z\n .object({\n contract: z.literal('TrendIngestRun'),\n ingestRunId: ContractIdentifierSchema,\n sourceId: ContractIdentifierSchema,\n requestId: ContractIdentifierSchema,\n idempotencyKey: ContractIdentifierSchema,\n status: z.enum(['RUNNING', 'SUCCEEDED', 'FAILED', 'PARTIAL']),\n recordCount: z.number().int().nonnegative(),\n errorCount: z.number().int().nonnegative(),\n startedAt: IsoDateTimeSchema,\n completedAt: IsoDateTimeSchema.optional(),\n })\n .strict();\n\nexport const TrendSourceRecordSchema = z\n .object({\n contract: z.literal('TrendSourceRecord'),\n sourceRecordId: ContractIdentifierSchema,\n source: TrendSourceSchema,\n ingestRunRef: EntityRefSchema,\n recordVersion: z.number().int().positive(),\n contentHash: Sha256Schema,\n payload: JsonValueSchema,\n idempotencyKey: ContractIdentifierSchema,\n collectedAt: IsoDateTimeSchema,\n })\n .strict();\n\nexport const HotwordBodySchema = z\n .object({\n contract: z.literal('HotwordBody'),\n hotwordId: ContractIdentifierSchema,\n label: z.string().trim().min(1),\n normalizedLabel: z.string().trim().min(1),\n categories: z.array(ContractIdentifierSchema).default([]),\n sourceRefs: z.array(TrendSourceSchema).min(1),\n relationRefs: z.array(EntityRefSchema).default([]),\n createdAt: IsoDateTimeSchema,\n updatedAt: IsoDateTimeSchema,\n })\n .strict();\n\nconst CommerceBodyFieldsSchema = {\n displayName: z.string().trim().min(1),\n normalizedName: z.string().trim().min(1),\n categories: z.array(ContractIdentifierSchema).default([]),\n sourceRefs: z.array(EntityRefSchema).min(1),\n relationRefs: z.array(EntityRefSchema).default([]),\n createdAt: IsoDateTimeSchema,\n updatedAt: IsoDateTimeSchema,\n};\n\nexport const BrandBodySchema = z\n .object({\n contract: z.literal('BrandBody'),\n brandId: ContractIdentifierSchema,\n ...CommerceBodyFieldsSchema,\n })\n .strict();\n\nexport const ProductBodySchema = z\n .object({\n contract: z.literal('ProductBody'),\n productId: ContractIdentifierSchema,\n brandRef: EntityRefSchema.optional(),\n ...CommerceBodyFieldsSchema,\n })\n .strict();\n\nexport const TrendMetricSnapshotSchema = z\n .object({\n contract: z.literal('TrendMetricSnapshot'),\n snapshotId: ContractIdentifierSchema,\n subjectRef: EntityRefSchema,\n observedAt: IsoDateTimeSchema,\n metrics: z.record(z.string(), z.number().finite()),\n confidence: z.number().min(0).max(1),\n evidenceRefs: z.array(EntityRefSchema).min(1),\n })\n .strict();\n\nexport const RadarScoreModelBodySchema = z\n .object({\n contract: z.literal('RadarScoreModelBody'),\n modelId: ContractIdentifierSchema,\n version: z.number().int().positive(),\n weights: RadarDecisionMetricsSchema,\n thresholds: z.record(z.string(), z.number().finite()).default({}),\n explanationRules: z.record(z.string(), z.string().trim().min(1)).default({}),\n createdAt: IsoDateTimeSchema,\n })\n .strict();\n\nexport const RadarScoreProjectionSchema = z\n .object({\n contract: z.literal('RadarScoreProjection'),\n projectionId: ContractIdentifierSchema,\n subjectRef: EntityRefSchema,\n modelRef: EntityRefSchema,\n totalScore: z.number().finite(),\n dimensions: RadarDecisionMetricsSchema,\n evidenceRefs: z.array(EntityRefSchema).min(1),\n freshnessAt: IsoDateTimeSchema,\n })\n .strict();\n\nexport const RadarPanoramaNodeSchema = z\n .object({\n ref: EntityRefSchema,\n label: z.string().trim().min(1),\n categories: z.array(ContractIdentifierSchema).default([]),\n score: z.number().finite().optional(),\n freshnessAt: IsoDateTimeSchema.optional(),\n })\n .strict();\n\nexport const RadarPanoramaEdgeSchema = z\n .object({\n sourceRef: EntityRefSchema,\n targetRef: EntityRefSchema,\n relation: ContractIdentifierSchema,\n evidenceRefs: z.array(EntityRefSchema).default([]),\n })\n .strict();\n\nexport const RadarPanoramaSchema = z\n .object({\n contract: z.literal('RadarPanorama'),\n nodes: z.array(RadarPanoramaNodeSchema),\n edges: z.array(RadarPanoramaEdgeSchema),\n generatedAt: IsoDateTimeSchema,\n })\n .strict();\n\nexport const BrandGeneticsProfileSchema = z\n .object({\n contract: z.literal('BrandGeneticsProfile'),\n brandRef: EntityRefSchema,\n categories: z.array(ContractIdentifierSchema).default([]),\n signature: z.record(ContractIdentifierSchema, z.number().finite()),\n relatedRefs: z.array(EntityRefSchema).default([]),\n evidenceRefs: z.array(EntityRefSchema).default([]),\n computedAt: IsoDateTimeSchema,\n })\n .strict();\n\nexport const RadarOpportunityMatrixPointSchema = z\n .object({\n subjectRef: EntityRefSchema,\n label: z.string().trim().min(1),\n x: z.number().finite(),\n y: z.number().finite(),\n score: z.number().finite(),\n evidenceRefs: z.array(EntityRefSchema).default([]),\n })\n .strict();\n\nexport const RadarOpportunityMatrixSchema = z\n .object({\n contract: z.literal('RadarOpportunityMatrix'),\n xMetric: z.enum(['currentSales', 'forecastSales', 'searchHeat', 'socialHeat', 'confidence']),\n yMetric: z.enum(['currentSales', 'forecastSales', 'searchHeat', 'socialHeat', 'confidence']),\n points: z.array(RadarOpportunityMatrixPointSchema),\n computedAt: IsoDateTimeSchema,\n })\n .strict();\n\nexport const RadarQueryBodySchema = z\n .object({\n contract: z.literal('RadarQueryBody'),\n queryId: ContractIdentifierSchema,\n filters: z.record(z.string(), JsonValueSchema).default({}),\n sort: z\n .object({\n field: ContractIdentifierSchema,\n direction: z.enum(['asc', 'desc']),\n })\n .strict(),\n pageSize: z.number().int().min(1).max(200),\n updatedAt: IsoDateTimeSchema,\n })\n .strict();\n\nexport const SavedRadarQuerySchema = z\n .object({\n contract: z.literal('SavedRadarQuery'),\n savedQueryId: ContractIdentifierSchema,\n teamId: ContractIdentifierSchema,\n ownerRef: EntityRefSchema,\n name: z.string().trim().min(1),\n queryRef: EntityRefSchema,\n expectedVersion: z.number().int().nonnegative(),\n updatedAt: IsoDateTimeSchema,\n })\n .strict();\n\nexport const RadarSelectionSchema = z\n .object({\n contract: z.literal('RadarSelection'),\n selectionId: ContractIdentifierSchema,\n teamId: ContractIdentifierSchema,\n ownerRef: EntityRefSchema,\n subjectRefs: z.array(EntityRefSchema),\n status: z.enum(['stashed', 'selected', 'rejected', 'archived']),\n note: z.string().optional(),\n expectedVersion: z.number().int().nonnegative(),\n updatedAt: IsoDateTimeSchema,\n })\n .strict();\n\nconst versionedRefFields = {\n id: ContractIdentifierSchema,\n version: z.union([z.number().int().positive(), z.string().trim().min(1)]).optional(),\n ownerRepo: ContractIdentifierSchema.optional(),\n};\n\nexport const TrendRadarCollectionAssetRefSchema = z\n .object({\n kind: z.literal('asset'),\n ...versionedRefFields,\n })\n .strict();\n\nexport const TrendRadarCollectionSelectionRefSchema = z\n .object({\n kind: z.literal('radar-selection'),\n ...versionedRefFields,\n })\n .strict();\n\nexport const TrendRadarCollectionRunRefSchema = z\n .object({\n kind: z.literal('radar-analysis-run'),\n ...versionedRefFields,\n })\n .strict();\n\nexport const TrendRadarCollectionSubjectRefSchema = z\n .object({\n kind: z.literal('hotword'),\n ...versionedRefFields,\n })\n .strict();\n\nexport const TrendRadarCollectionArtifactRefSchema = z\n .object({\n kind: z.literal('artifact'),\n ...versionedRefFields,\n })\n .strict();\n\nexport const TrendRadarCollectionRecipeEntrySchema = z\n .object({\n subjectRef: TrendRadarCollectionSubjectRefSchema,\n label: z.string().trim().min(1).max(200),\n })\n .strict();\n\nexport const TrendRadarCollectionRecipeSchema = z\n .object({\n category: z.array(TrendRadarCollectionRecipeEntrySchema),\n design: z.array(TrendRadarCollectionRecipeEntrySchema),\n audience: z.array(TrendRadarCollectionRecipeEntrySchema),\n })\n .strict()\n .refine(\n recipe => recipe.category.length + recipe.design.length + recipe.audience.length > 0,\n 'A Trend Radar collection recipe must contain at least one subject.',\n );\n\nexport const TrendRadarCollectionDecisionAxisSchema = z\n .object({\n key: ContractIdentifierSchema,\n label: z.string().trim().min(1).max(200).optional(),\n value: z.number().finite(),\n })\n .strict();\n\nexport const TrendRadarCollectionDecisionProjectionSchema = z\n .object({\n axes: z.array(TrendRadarCollectionDecisionAxisSchema).max(32).optional(),\n overallScore: z.number().finite().optional(),\n itemRank: z.number().finite().optional(),\n sourceRefs: z.array(EntityRefSchema).optional(),\n outputRefs: z.array(EntityRefSchema).optional(),\n })\n .strict()\n .superRefine((projection, context) => {\n const hasProjection = Boolean(\n projection.axes?.length\n || projection.overallScore !== undefined\n || projection.itemRank !== undefined\n || projection.sourceRefs?.length\n || projection.outputRefs?.length,\n );\n if (!hasProjection) {\n context.addIssue({\n code: 'custom',\n message: 'A decision projection must contain canonical decision data or references.',\n });\n }\n\n const seenAxisKeys = new Set<string>();\n projection.axes?.forEach((axis, index) => {\n if (seenAxisKeys.has(axis.key)) {\n context.addIssue({\n code: 'custom',\n path: ['axes', index, 'key'],\n message: `Duplicate decision axis key: ${axis.key}`,\n });\n }\n seenAxisKeys.add(axis.key);\n });\n });\n\nexport const TrendRadarCollectionArtifactProjectionSchema = z\n .object({\n artifactRef: TrendRadarCollectionArtifactRefSchema,\n url: z.string().url().optional(),\n thumbnailUrl: z.string().url().optional(),\n mimeType: z.string().trim().min(1).optional(),\n metadata: JsonObjectSchema.optional(),\n })\n .strict();\n\nexport const TrendRadarCollectionProjectionWritebackSchema = z\n .object({\n status: z.enum(['PENDING', 'APPLIED', 'FAILED']),\n updatedAt: IsoDateTimeSchema,\n error: z\n .object({\n code: ContractIdentifierSchema,\n message: z.string().trim().min(1),\n retryable: z.boolean(),\n })\n .strict()\n .optional(),\n })\n .strict()\n .superRefine((writeback, context) => {\n if (writeback.status === 'FAILED' && !writeback.error) {\n context.addIssue({\n code: 'custom',\n path: ['error'],\n message: 'A failed collection projection writeback must include an error.',\n });\n }\n if (writeback.status !== 'FAILED' && writeback.error) {\n context.addIssue({\n code: 'custom',\n path: ['error'],\n message: 'Only a failed collection projection writeback may include an error.',\n });\n }\n });\n\nexport const TrendRadarCollectionItemSchema = z\n .object({\n contract: z.literal('TrendRadarCollectionItem'),\n schemaVersion: z.literal(1),\n selectionRef: TrendRadarCollectionSelectionRefSchema,\n recipe: TrendRadarCollectionRecipeSchema,\n status: z.enum(['SAVED', 'QUEUED', 'RUNNING', 'SUCCEEDED', 'FAILED', 'CANCELLED', 'PARTIAL']),\n latestRunRef: TrendRadarCollectionRunRefSchema.optional(),\n decisionProjection: TrendRadarCollectionDecisionProjectionSchema.optional(),\n artifactProjection: TrendRadarCollectionArtifactProjectionSchema.optional(),\n createdAt: IsoDateTimeSchema,\n updatedAt: IsoDateTimeSchema,\n generatedAt: IsoDateTimeSchema.optional(),\n })\n .strict();\n\nexport const RadarAnalysisRunSchema = z\n .object({\n contract: z.literal('RadarAnalysisRun'),\n runId: ContractIdentifierSchema,\n teamId: ContractIdentifierSchema,\n selectionRef: EntityRefSchema,\n workflowRef: EntityRefSchema,\n executionRef: EntityRefSchema.optional(),\n designProjectRef: EntityRefSchema.optional(),\n replayedFromRef: EntityRefSchema.optional(),\n collectionAssetRef: TrendRadarCollectionAssetRefSchema.optional(),\n collectionProjectionWriteback: TrendRadarCollectionProjectionWritebackSchema.optional(),\n workflowDefinitionTeamId: ContractIdentifierSchema.optional(),\n workflowInput: z.record(z.string(), JsonValueSchema).default({}),\n createDesignProject: z.boolean().default(true),\n designProjectName: z.string().trim().min(1).max(200).optional(),\n modelRef: EntityRefSchema,\n requestId: ContractIdentifierSchema,\n idempotencyKey: ContractIdentifierSchema,\n status: z.enum(['QUEUED', 'RUNNING', 'SUCCEEDED', 'FAILED', 'CANCELLED', 'PARTIAL']),\n outputRefs: z.array(EntityRefSchema).default([]),\n error: z\n .object({\n code: ContractIdentifierSchema,\n message: z.string().trim().min(1),\n retryable: z.boolean(),\n })\n .strict()\n .optional(),\n startedAt: IsoDateTimeSchema.optional(),\n completedAt: IsoDateTimeSchema.optional(),\n createdAt: IsoDateTimeSchema,\n })\n .strict();\n\nexport const RadarAnalysisAssetSchema = z\n .object({\n artifactRef: EntityRefSchema,\n kind: ContractIdentifierSchema,\n mimeType: z.string().trim().min(1).optional(),\n url: z.string().url(),\n metadata: z.record(z.string(), JsonValueSchema).default({}),\n createdAt: IsoDateTimeSchema,\n })\n .strict();\n\nexport const RadarAnalysisDetailSchema = z\n .object({\n contract: z.literal('RadarAnalysisDetail'),\n run: RadarAnalysisRunSchema,\n runVersion: z.number().int().positive(),\n selection: RadarSelectionSchema,\n outputs: z.array(OutputRecordSchema),\n assets: z.array(RadarAnalysisAssetSchema),\n lineage: z.array(LineageRecordSchema),\n })\n .strict();\n\nexport const RadarActionRecordSchema = z\n .object({\n contract: z.literal('RadarActionRecord'),\n actionId: ContractIdentifierSchema,\n teamId: ContractIdentifierSchema,\n actorRef: EntityRefSchema,\n action: z.enum(['stash', 'select', 'reject', 'archive', 'launch', 'retry', 'replay', 'rollback']),\n targetRef: EntityRefSchema,\n requestId: ContractIdentifierSchema,\n idempotencyKey: ContractIdentifierSchema,\n expectedVersion: z.number().int().nonnegative(),\n occurredAt: IsoDateTimeSchema,\n })\n .strict();\n\nexport const RadarWritebackRecordSchema = z\n .object({\n contract: z.literal('RadarWritebackRecord'),\n writebackId: ContractIdentifierSchema,\n actionRef: EntityRefSchema,\n targetRef: EntityRefSchema,\n status: z.enum(['PENDING', 'APPLIED', 'FAILED']),\n resultingVersion: z.number().int().nonnegative().optional(),\n error: z.string().trim().min(1).optional(),\n recordedAt: IsoDateTimeSchema,\n })\n .strict();\n\nexport type TrendSource = z.infer<typeof TrendSourceSchema>;\nexport type TrendIngestRun = z.infer<typeof TrendIngestRunSchema>;\nexport type TrendSourceRecord = z.infer<typeof TrendSourceRecordSchema>;\nexport type HotwordBody = z.infer<typeof HotwordBodySchema>;\nexport type BrandBody = z.infer<typeof BrandBodySchema>;\nexport type ProductBody = z.infer<typeof ProductBodySchema>;\nexport type TrendMetricSnapshot = z.infer<typeof TrendMetricSnapshotSchema>;\nexport type RadarDecisionMetrics = z.infer<typeof RadarDecisionMetricsSchema>;\nexport type RadarScoreModelBody = z.infer<typeof RadarScoreModelBodySchema>;\nexport type RadarScoreProjection = z.infer<typeof RadarScoreProjectionSchema>;\nexport type RadarPanorama = z.infer<typeof RadarPanoramaSchema>;\nexport type BrandGeneticsProfile = z.infer<typeof BrandGeneticsProfileSchema>;\nexport type RadarOpportunityMatrix = z.infer<typeof RadarOpportunityMatrixSchema>;\nexport type RadarQueryBody = z.infer<typeof RadarQueryBodySchema>;\nexport type SavedRadarQuery = z.infer<typeof SavedRadarQuerySchema>;\nexport type RadarSelection = z.infer<typeof RadarSelectionSchema>;\nexport type TrendRadarCollectionAssetRef = z.infer<typeof TrendRadarCollectionAssetRefSchema>;\nexport type TrendRadarCollectionSelectionRef = z.infer<typeof TrendRadarCollectionSelectionRefSchema>;\nexport type TrendRadarCollectionRunRef = z.infer<typeof TrendRadarCollectionRunRefSchema>;\nexport type TrendRadarCollectionSubjectRef = z.infer<typeof TrendRadarCollectionSubjectRefSchema>;\nexport type TrendRadarCollectionArtifactRef = z.infer<typeof TrendRadarCollectionArtifactRefSchema>;\nexport type TrendRadarCollectionRecipeEntry = z.infer<typeof TrendRadarCollectionRecipeEntrySchema>;\nexport type TrendRadarCollectionRecipe = z.infer<typeof TrendRadarCollectionRecipeSchema>;\nexport type TrendRadarCollectionDecisionAxis = z.infer<typeof TrendRadarCollectionDecisionAxisSchema>;\nexport type TrendRadarCollectionDecisionProjection = z.infer<typeof TrendRadarCollectionDecisionProjectionSchema>;\nexport type TrendRadarCollectionArtifactProjection = z.infer<typeof TrendRadarCollectionArtifactProjectionSchema>;\nexport type TrendRadarCollectionProjectionWriteback = z.infer<typeof TrendRadarCollectionProjectionWritebackSchema>;\nexport type TrendRadarCollectionItem = z.infer<typeof TrendRadarCollectionItemSchema>;\nexport type RadarAnalysisRun = z.infer<typeof RadarAnalysisRunSchema>;\nexport type RadarAnalysisAsset = z.infer<typeof RadarAnalysisAssetSchema>;\nexport type RadarAnalysisDetail = z.infer<typeof RadarAnalysisDetailSchema>;\nexport type RadarActionRecord = z.infer<typeof RadarActionRecordSchema>;\nexport type RadarWritebackRecord = z.infer<typeof RadarWritebackRecordSchema>;\n","import { z } from 'zod';\nimport { ArtifactManifestSchema, OutputRecordSchema } from './artifact';\nimport {\n ContractIdentifierSchema,\n EntityRefSchema,\n IsoDateTimeSchema,\n JsonObjectSchema,\n Sha256Schema,\n} from './common';\nimport { ApplicationRunSchema } from './continuity';\nimport { LineageRecordSchema } from './data';\n\nexport const WorkflowCatalogEntrySchema = z\n .object({\n contract: z.literal('WorkflowCatalogEntry'),\n workflowId: ContractIdentifierSchema,\n teamId: ContractIdentifierSchema,\n creatorRef: EntityRefSchema,\n currentDefinitionRef: EntityRefSchema,\n lifecycle: z.enum(['ACTIVE', 'DELETED']),\n asset: z\n .object({\n preset: z.boolean(),\n marketplacePublished: z.boolean(),\n publishConfig: JsonObjectSchema.optional(),\n sort: z.number().int(),\n forkFromRef: EntityRefSchema.optional(),\n notAuthorized: z.boolean(),\n })\n .strict(),\n createdAt: IsoDateTimeSchema,\n updatedAt: IsoDateTimeSchema,\n deletedAt: IsoDateTimeSchema.optional(),\n })\n .strict()\n .superRefine((entry, context) => {\n if (\n entry.creatorRef.kind !== 'user' &&\n entry.creatorRef.kind !== 'service'\n ) {\n context.addIssue({\n code: 'custom',\n path: ['creatorRef', 'kind'],\n message: 'creatorRef must reference a user or service.',\n });\n }\n if (entry.currentDefinitionRef.kind !== 'workflow-definition') {\n context.addIssue({\n code: 'custom',\n path: ['currentDefinitionRef', 'kind'],\n message: 'currentDefinitionRef must reference a workflow-definition.',\n });\n }\n if (entry.lifecycle === 'DELETED' && !entry.deletedAt) {\n context.addIssue({\n code: 'custom',\n path: ['deletedAt'],\n message: 'Deleted workflow catalog entries require deletedAt.',\n });\n }\n if (entry.lifecycle === 'ACTIVE' && entry.deletedAt) {\n context.addIssue({\n code: 'custom',\n path: ['deletedAt'],\n message: 'Active workflow catalog entries cannot declare deletedAt.',\n });\n }\n });\n\nexport const WorkflowPublicationSchema = z\n .object({\n contract: z.literal('WorkflowPublication'),\n publicationId: ContractIdentifierSchema,\n definitionRef: EntityRefSchema,\n runtimeDefinitionRef: EntityRefSchema,\n sourceHash: Sha256Schema,\n compiledHash: Sha256Schema,\n status: z.enum(['PENDING', 'PUBLISHED', 'FAILED', 'RETIRED']),\n publisherRef: EntityRefSchema,\n publishedAt: IsoDateTimeSchema.optional(),\n failureReason: z.string().trim().min(1).optional(),\n })\n .strict()\n .superRefine((publication, context) => {\n if (publication.definitionRef.kind !== 'workflow-definition') {\n context.addIssue({\n code: 'custom',\n path: ['definitionRef', 'kind'],\n message: 'definitionRef must reference a workflow-definition.',\n });\n }\n if (publication.runtimeDefinitionRef.kind !== 'conductor-workflow-definition') {\n context.addIssue({\n code: 'custom',\n path: ['runtimeDefinitionRef', 'kind'],\n message: 'runtimeDefinitionRef must reference a conductor-workflow-definition.',\n });\n }\n if (publication.status === 'PUBLISHED' && !publication.publishedAt) {\n context.addIssue({\n code: 'custom',\n path: ['publishedAt'],\n message: 'Published workflow publications require publishedAt.',\n });\n }\n if (publication.status === 'FAILED' && !publication.failureReason) {\n context.addIssue({\n code: 'custom',\n path: ['failureReason'],\n message: 'Failed workflow publications require failureReason.',\n });\n }\n });\n\nexport const WorkflowCompletionCommitSchema = z\n .object({\n contract: z.literal('WorkflowCompletionCommit'),\n commitId: ContractIdentifierSchema,\n run: ApplicationRunSchema,\n outputs: z.array(OutputRecordSchema),\n artifacts: z.array(ArtifactManifestSchema),\n lineage: LineageRecordSchema,\n completedAt: IsoDateTimeSchema,\n })\n .strict()\n .superRefine((commit, context) => {\n const expectedRunId = commit.run.runId;\n const referencesRun = (value: { runRef: { kind: string; id: string } }) =>\n value.runRef.kind === 'application-run' && value.runRef.id === expectedRunId;\n\n commit.outputs.forEach((output, index) => {\n if (!referencesRun(output)) {\n context.addIssue({\n code: 'custom',\n path: ['outputs', index, 'runRef'],\n message: 'Every output must reference the committed ApplicationRun.',\n });\n }\n });\n commit.artifacts.forEach((artifact, index) => {\n if (!referencesRun(artifact)) {\n context.addIssue({\n code: 'custom',\n path: ['artifacts', index, 'runRef'],\n message: 'Every artifact must reference the committed ApplicationRun.',\n });\n }\n });\n if (\n commit.lineage.subjectRef.kind !== 'application-run' ||\n commit.lineage.subjectRef.id !== expectedRunId\n ) {\n context.addIssue({\n code: 'custom',\n path: ['lineage', 'subjectRef'],\n message: 'Completion lineage must use the committed ApplicationRun as its subject.',\n });\n }\n const outputIds = new Set(commit.outputs.map(output => output.outputId));\n commit.artifacts.forEach((artifact, index) => {\n if (\n artifact.outputRef.kind !== 'workflow-output' ||\n !outputIds.has(artifact.outputRef.id)\n ) {\n context.addIssue({\n code: 'custom',\n path: ['artifacts', index, 'outputRef'],\n message: 'Artifact outputRef must reference an output in the same commit.',\n });\n }\n });\n });\n\nexport const WorkflowCompletionReceiptSchema = z\n .object({\n contract: z.literal('WorkflowCompletionReceipt'),\n commitId: ContractIdentifierSchema,\n runRef: EntityRefSchema,\n outputRefs: z.array(EntityRefSchema),\n artifactRefs: z.array(EntityRefSchema),\n contentHash: Sha256Schema,\n committedAt: IsoDateTimeSchema,\n idempotentReplay: z.boolean(),\n })\n .strict()\n .superRefine((receipt, context) => {\n if (receipt.runRef.kind !== 'application-run') {\n context.addIssue({\n code: 'custom',\n path: ['runRef', 'kind'],\n message: 'runRef must reference an application-run.',\n });\n }\n receipt.outputRefs.forEach((ref, index) => {\n if (ref.kind !== 'workflow-output') {\n context.addIssue({\n code: 'custom',\n path: ['outputRefs', index, 'kind'],\n message: 'outputRefs must reference workflow-output records.',\n });\n }\n });\n receipt.artifactRefs.forEach((ref, index) => {\n if (ref.kind !== 'artifact') {\n context.addIssue({\n code: 'custom',\n path: ['artifactRefs', index, 'kind'],\n message: 'artifactRefs must reference artifacts.',\n });\n }\n });\n });\n\nexport type WorkflowPublication = z.infer<typeof WorkflowPublicationSchema>;\nexport type WorkflowCatalogEntry = z.infer<typeof WorkflowCatalogEntrySchema>;\nexport type WorkflowCompletionCommit = z.infer<typeof WorkflowCompletionCommitSchema>;\nexport type WorkflowCompletionReceipt = z.infer<typeof WorkflowCompletionReceiptSchema>;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,SAAS,SAAS;AASX,IAAM,uBAAuB,EACjC,OAAO;AAAA,EACN,UAAU;AAAA,EACV,QAAQ,yBAAyB,SAAS;AAAA,EAC1C,KAAK;AAAA,EACL,QAAQ,yBAAyB,SAAS;AAAA,EAC1C,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,EAC/B,WAAW,kBAAkB,SAAS;AACxC,CAAC,EACA,OAAO;AAEH,IAAM,uBAAuB,EACjC,OAAO;AAAA,EACN,UAAU,yBAAyB,SAAS;AAAA,EAC5C,QAAQ,yBAAyB,SAAS;AAAA,EAC1C,UAAU,gBAAgB,SAAS;AAAA,EACnC,YAAY,EAAE,KAAK,CAAC,WAAW,QAAQ,UAAU,QAAQ,CAAC;AAC5D,CAAC,EACA,OAAO;AAEH,IAAM,yBAAyB,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,OAAO,WAAW;AAAA,QACtC,SAAS;AAAA,MACX,CAAC;AAAA,IACH;AAAA,EACF,CAAC;AACH,CAAC;AAEI,IAAM,kCAAkCA,GAC5C,OAAO;AAAA,EACN,UAAUA,GAAE,QAAQ,2BAA2B;AAAA,EAC/C,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,YAAYA,GAAE,MAAM,eAAe;AAAA,EACnC,cAAcA,GAAE,MAAM,eAAe;AAAA,EACrC,aAAa;AAAA,EACb,aAAa;AAAA,EACb,kBAAkBA,GAAE,QAAQ;AAC9B,CAAC,EACA,OAAO,EACP,YAAY,CAAC,SAAS,YAAY;AACjC,MAAI,QAAQ,OAAO,SAAS,mBAAmB;AAC7C,YAAQ,SAAS;AAAA,MACf,MAAM;AAAA,MACN,MAAM,CAAC,UAAU,MAAM;AAAA,MACvB,SAAS;AAAA,IACX,CAAC;AAAA,EACH;AACA,UAAQ,WAAW,QAAQ,CAAC,KAAK,UAAU;AACzC,QAAI,IAAI,SAAS,mBAAmB;AAClC,cAAQ,SAAS;AAAA,QACf,MAAM;AAAA,QACN,MAAM,CAAC,cAAc,OAAO,MAAM;AAAA,QAClC,SAAS;AAAA,MACX,CAAC;AAAA,IACH;AAAA,EACF,CAAC;AACD,UAAQ,aAAa,QAAQ,CAAC,KAAK,UAAU;AAC3C,QAAI,IAAI,SAAS,YAAY;AAC3B,cAAQ,SAAS;AAAA,QACf,MAAM;AAAA,QACN,MAAM,CAAC,gBAAgB,OAAO,MAAM;AAAA,QACpC,SAAS;AAAA,MACX,CAAC;AAAA,IACH;AAAA,EACF,CAAC;AACH,CAAC;","names":["z","z","z","z","z","z","z","z","z","z","z","z","z","z"]}
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
ManagedFileUriSchema,
|
|
15
15
|
RevisionRefSchema,
|
|
16
16
|
Sha256Schema
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-J6ZVASVX.mjs";
|
|
18
18
|
|
|
19
19
|
// src/contracts/agent-data.ts
|
|
20
20
|
import { z } from "zod";
|
|
@@ -573,4 +573,4 @@ export {
|
|
|
573
573
|
PlatformNotificationSnapshotSchema,
|
|
574
574
|
platformNotificationRoutes
|
|
575
575
|
};
|
|
576
|
-
//# sourceMappingURL=chunk-
|
|
576
|
+
//# sourceMappingURL=chunk-6AX5KAJM.mjs.map
|
|
@@ -6644,16 +6644,6 @@ var ProductAccessDeclarationSchema = z2.object({
|
|
|
6644
6644
|
|
|
6645
6645
|
// src/contracts/artifact-platform.ts
|
|
6646
6646
|
import { z as z3 } from "zod";
|
|
6647
|
-
var BUILTIN_ARTIFACT_KINDS = [
|
|
6648
|
-
"board",
|
|
6649
|
-
"workflow",
|
|
6650
|
-
"document",
|
|
6651
|
-
"cad.part",
|
|
6652
|
-
"cad.assembly",
|
|
6653
|
-
"eda.schematic",
|
|
6654
|
-
"eda.pcb",
|
|
6655
|
-
"eda.circuit"
|
|
6656
|
-
];
|
|
6657
6647
|
var ArtifactKindSchema = ContractIdentifierSchema;
|
|
6658
6648
|
var ArtifactStorageModeSchema = z3.enum(["aggregate", "loro-aggregate"]);
|
|
6659
6649
|
var ArtifactCrdtCodecSchema = z3.enum(["none", "loro-v1"]);
|
|
@@ -20230,6 +20220,26 @@ var ComfyWorkflowPortBindingSchema = z22.object({
|
|
|
20230
20220
|
node: z22.union([z22.string(), z22.number()]),
|
|
20231
20221
|
key: z22.string().optional()
|
|
20232
20222
|
}).strict();
|
|
20223
|
+
var WorkflowOntologyOptionSourceSchema = z22.object({
|
|
20224
|
+
ontologyId: ContractIdentifierSchema,
|
|
20225
|
+
viewId: ContractIdentifierSchema.optional(),
|
|
20226
|
+
categoryField: ContractIdentifierSchema.optional(),
|
|
20227
|
+
fieldMap: z22.object({
|
|
20228
|
+
value: ContractIdentifierSchema,
|
|
20229
|
+
label: ContractIdentifierSchema,
|
|
20230
|
+
description: ContractIdentifierSchema.optional(),
|
|
20231
|
+
image: ContractIdentifierSchema.optional(),
|
|
20232
|
+
prompt: ContractIdentifierSchema.optional(),
|
|
20233
|
+
hiddenPrompt: ContractIdentifierSchema.optional(),
|
|
20234
|
+
colorHex: ContractIdentifierSchema.optional()
|
|
20235
|
+
}).strict()
|
|
20236
|
+
}).strict();
|
|
20237
|
+
var WorkflowChoicePresentationSchema = z22.enum([
|
|
20238
|
+
"dropdown",
|
|
20239
|
+
"chips",
|
|
20240
|
+
"thumbnail-grid",
|
|
20241
|
+
"swatches"
|
|
20242
|
+
]);
|
|
20233
20243
|
var WorkflowParameterTypeOptionsSchema = z22.object({
|
|
20234
20244
|
editor: z22.enum(["code", "codeNodeEditor", "htmlEditor", "sqlEditor", "json"]).optional(),
|
|
20235
20245
|
editorLanguage: z22.enum(["javaScript", "json", "python", "sql"]).optional(),
|
|
@@ -20337,7 +20347,15 @@ var WorkflowParameterTypeOptionsSchema = z22.object({
|
|
|
20337
20347
|
designAnalysisFillStrategy: z22.string().optional(),
|
|
20338
20348
|
designAnalysisMaxFields: z22.number().int().nonnegative().optional(),
|
|
20339
20349
|
designAnalysisType: z22.string().optional(),
|
|
20340
|
-
designAnalysisFieldPrefix: z22.string().optional()
|
|
20350
|
+
designAnalysisFieldPrefix: z22.string().optional(),
|
|
20351
|
+
groupId: ContractIdentifierSchema.optional(),
|
|
20352
|
+
showWhen: WorkflowConditionalStateSchema.optional(),
|
|
20353
|
+
ontologySource: WorkflowOntologyOptionSourceSchema.optional(),
|
|
20354
|
+
choicePresentation: WorkflowChoicePresentationSchema.optional(),
|
|
20355
|
+
enableSlotSwap: z22.boolean().optional(),
|
|
20356
|
+
enableSortableStrip: z22.boolean().optional(),
|
|
20357
|
+
slotPromptField: ContractIdentifierSchema.optional(),
|
|
20358
|
+
modeSwitchConfirmClearFields: z22.array(ContractIdentifierSchema).max(32).optional()
|
|
20341
20359
|
}).strict();
|
|
20342
20360
|
var WorkflowParameterSchema = z22.lazy(
|
|
20343
20361
|
() => z22.object({
|
|
@@ -20422,6 +20440,96 @@ var WorkflowValidationIssueSchema = z22.object({
|
|
|
20422
20440
|
detailReason: z22.object({ type: ContractIdentifierSchema, name: ContractIdentifierSchema, detailInformation: JsonValueSchema.optional() }).strict(),
|
|
20423
20441
|
humanMessage: z22.object({ en: z22.string(), zh: z22.string() }).strict()
|
|
20424
20442
|
}).strict();
|
|
20443
|
+
var WorkflowFieldGroupSchema = z22.object({
|
|
20444
|
+
id: ContractIdentifierSchema,
|
|
20445
|
+
title: LocalizedTextSchema.optional(),
|
|
20446
|
+
titleHidden: z22.boolean().optional(),
|
|
20447
|
+
description: LocalizedTextSchema.optional(),
|
|
20448
|
+
icon: ContractIdentifierSchema.optional(),
|
|
20449
|
+
headerFieldIds: z22.array(ContractIdentifierSchema).max(4).optional(),
|
|
20450
|
+
fieldIds: z22.array(ContractIdentifierSchema).min(1).max(64),
|
|
20451
|
+
columns: z22.union([z22.literal(1), z22.literal(2), z22.literal(3)]).optional(),
|
|
20452
|
+
columnWeights: z22.array(z22.number().int().min(1).max(12)).min(1).max(4).optional(),
|
|
20453
|
+
collapsible: z22.boolean().optional(),
|
|
20454
|
+
defaultOpen: z22.boolean().optional(),
|
|
20455
|
+
surface: z22.enum(["plain", "panel"]).optional(),
|
|
20456
|
+
showWhen: WorkflowConditionalStateSchema.optional()
|
|
20457
|
+
}).strict();
|
|
20458
|
+
var WorkflowBatchControlSchema = z22.object({
|
|
20459
|
+
enabled: z22.boolean(),
|
|
20460
|
+
min: z22.number().int().min(1).max(32).optional(),
|
|
20461
|
+
max: z22.number().int().min(1).max(32).optional(),
|
|
20462
|
+
defaultCount: z22.number().int().min(1).max(32).optional(),
|
|
20463
|
+
mode: z22.enum(["serial", "parallel"]).optional()
|
|
20464
|
+
}).strict().superRefine((batch, ctx) => {
|
|
20465
|
+
if (batch.min !== void 0 && batch.max !== void 0 && batch.min > batch.max) {
|
|
20466
|
+
ctx.addIssue({ code: "custom", path: ["min"], message: "batchControl.min cannot exceed batchControl.max." });
|
|
20467
|
+
}
|
|
20468
|
+
if (batch.defaultCount !== void 0 && (batch.min !== void 0 && batch.defaultCount < batch.min || batch.max !== void 0 && batch.defaultCount > batch.max)) {
|
|
20469
|
+
ctx.addIssue({
|
|
20470
|
+
code: "custom",
|
|
20471
|
+
path: ["defaultCount"],
|
|
20472
|
+
message: "batchControl.defaultCount must fall within [min, max]."
|
|
20473
|
+
});
|
|
20474
|
+
}
|
|
20475
|
+
});
|
|
20476
|
+
var WorkflowResultViewPresentationSchema = z22.object({
|
|
20477
|
+
defaultStage: z22.enum(["waterfall", "artifact-workspace"]).optional(),
|
|
20478
|
+
artifactKind: ArtifactKindSchema.optional(),
|
|
20479
|
+
detailMode: z22.enum(["standard", "interactive-versions"]).optional(),
|
|
20480
|
+
splitDefaultLeftWidth: z22.number().int().min(240).max(720).optional()
|
|
20481
|
+
}).strict();
|
|
20482
|
+
var WorkflowOutputArtifactModalitySchema = z22.enum([
|
|
20483
|
+
"image",
|
|
20484
|
+
"video",
|
|
20485
|
+
"svg",
|
|
20486
|
+
"pdf",
|
|
20487
|
+
"spreadsheet",
|
|
20488
|
+
"markdown",
|
|
20489
|
+
"html",
|
|
20490
|
+
"3d-model",
|
|
20491
|
+
"file"
|
|
20492
|
+
]);
|
|
20493
|
+
var WorkflowOutputFieldBindingSchema = z22.discriminatedUnion("from", [
|
|
20494
|
+
z22.object({
|
|
20495
|
+
from: z22.literal("input"),
|
|
20496
|
+
key: ContractIdentifierSchema
|
|
20497
|
+
}).strict(),
|
|
20498
|
+
z22.object({
|
|
20499
|
+
from: z22.literal("output"),
|
|
20500
|
+
port: ContractIdentifierSchema
|
|
20501
|
+
}).strict(),
|
|
20502
|
+
z22.object({
|
|
20503
|
+
from: z22.literal("constant"),
|
|
20504
|
+
value: JsonValueSchema
|
|
20505
|
+
}).strict()
|
|
20506
|
+
]);
|
|
20507
|
+
var WorkflowOutputRelationBindingSchema = z22.object({
|
|
20508
|
+
relationFieldKey: ContractIdentifierSchema,
|
|
20509
|
+
fromInputKey: ContractIdentifierSchema
|
|
20510
|
+
}).strict();
|
|
20511
|
+
var WorkflowOutputStrategySchema = z22.discriminatedUnion("mode", [
|
|
20512
|
+
z22.object({
|
|
20513
|
+
mode: z22.literal("default-result-ontology"),
|
|
20514
|
+
artifactKind: ArtifactKindSchema.optional(),
|
|
20515
|
+
includeModalities: z22.array(WorkflowOutputArtifactModalitySchema).min(1).max(16).optional()
|
|
20516
|
+
}).strict(),
|
|
20517
|
+
z22.object({
|
|
20518
|
+
mode: z22.literal("domain-ontology"),
|
|
20519
|
+
trigger: z22.enum(["auto-promote", "manual-promote"]),
|
|
20520
|
+
targetOntologyId: ContractIdentifierSchema,
|
|
20521
|
+
containerViewId: ContractIdentifierSchema.optional(),
|
|
20522
|
+
artifactKind: ArtifactKindSchema.optional(),
|
|
20523
|
+
fieldBindings: z22.record(ContractIdentifierSchema, WorkflowOutputFieldBindingSchema).optional(),
|
|
20524
|
+
relationBindings: z22.array(WorkflowOutputRelationBindingSchema).max(32).optional()
|
|
20525
|
+
}).strict(),
|
|
20526
|
+
z22.object({
|
|
20527
|
+
mode: z22.literal("ledger-only")
|
|
20528
|
+
}).strict(),
|
|
20529
|
+
z22.object({
|
|
20530
|
+
mode: z22.literal("column-writeback")
|
|
20531
|
+
}).strict()
|
|
20532
|
+
]);
|
|
20425
20533
|
var WorkflowDefinitionSchema = z22.object({
|
|
20426
20534
|
contract: z22.literal("WorkflowDefinition"),
|
|
20427
20535
|
metadata: ContractMetadataSchema.omit({ name: true, description: true, labels: true }).extend({
|
|
@@ -20439,7 +20547,14 @@ var WorkflowDefinitionSchema = z22.object({
|
|
|
20439
20547
|
}).strict().superRefine((revision, context) => {
|
|
20440
20548
|
if (revision.kind === "backup" && revision.sourceVersion === void 0) context.addIssue({ code: "custom", path: ["sourceVersion"], message: "Backup revisions require a sourceVersion." });
|
|
20441
20549
|
}),
|
|
20442
|
-
presentation: z22.object({
|
|
20550
|
+
presentation: z22.object({
|
|
20551
|
+
iconUrl: z22.string().optional(),
|
|
20552
|
+
thumbnail: z22.string().optional(),
|
|
20553
|
+
canvas: WorkflowCanvasSchema.optional(),
|
|
20554
|
+
fieldGroups: z22.array(WorkflowFieldGroupSchema).max(64).optional(),
|
|
20555
|
+
batchControl: WorkflowBatchControlSchema.optional(),
|
|
20556
|
+
resultView: WorkflowResultViewPresentationSchema.optional()
|
|
20557
|
+
}).strict(),
|
|
20443
20558
|
ports: z22.object({ inputs: z22.array(ContractPortSchema).default([]), outputs: z22.array(ContractPortSchema).default([]) }).strict(),
|
|
20444
20559
|
parameters: z22.object({ variables: z22.array(WorkflowParameterSchema).default([]), outputs: z22.array(WorkflowOutputBindingSchema).default([]) }).strict(),
|
|
20445
20560
|
graph: z22.object({ nodes: z22.array(WorkflowNodeSchema), edges: z22.array(WorkflowEdgeSchema).default([]) }).strict(),
|
|
@@ -20469,7 +20584,12 @@ var WorkflowDefinitionSchema = z22.object({
|
|
|
20469
20584
|
}).strict(),
|
|
20470
20585
|
triggers: z22.array(WorkflowTriggerSchema).default([]),
|
|
20471
20586
|
views: z22.array(z22.object({ pageRef: ContractIdentifierSchema, placement: ContractIdentifierSchema.optional() }).strict()).default([]),
|
|
20472
|
-
dataContracts: z22.object({
|
|
20587
|
+
dataContracts: z22.object({
|
|
20588
|
+
reads: z22.array(ContractIdentifierSchema).default([]),
|
|
20589
|
+
writes: z22.array(ContractIdentifierSchema).default([]),
|
|
20590
|
+
emits: z22.array(ContractIdentifierSchema).default([]),
|
|
20591
|
+
outputStrategy: WorkflowOutputStrategySchema.optional()
|
|
20592
|
+
}).strict(),
|
|
20473
20593
|
governance: z22.object({ activated: z22.boolean(), validated: z22.boolean(), validationIssues: z22.array(WorkflowValidationIssueSchema).default([]), hidden: z22.boolean().optional() }).strict(),
|
|
20474
20594
|
interfaces: z22.object({
|
|
20475
20595
|
openai: z22.object({ enabled: z22.boolean(), modelName: z22.string().trim().min(1).optional() }).strict(),
|
|
@@ -20488,6 +20608,32 @@ var WorkflowDefinitionSchema = z22.object({
|
|
|
20488
20608
|
if (!nodeIds.has(edge.from) || !nodeIds.has(edge.to)) context.addIssue({ code: "custom", path: ["graph", "edges", index], message: "Workflow edges must reference existing node ids." });
|
|
20489
20609
|
});
|
|
20490
20610
|
if (definition.revision.kind === "release" && definition.metadata.version !== definition.revision.recordVersion) context.addIssue({ code: "custom", path: ["revision", "recordVersion"], message: "Release recordVersion must equal metadata.version." });
|
|
20611
|
+
const variableNames = new Set(definition.parameters.variables.map((variable) => variable.name));
|
|
20612
|
+
const seenGroupIds = /* @__PURE__ */ new Set();
|
|
20613
|
+
(definition.presentation.fieldGroups ?? []).forEach((group, groupIndex) => {
|
|
20614
|
+
if (seenGroupIds.has(group.id)) {
|
|
20615
|
+
context.addIssue({ code: "custom", path: ["presentation", "fieldGroups", groupIndex, "id"], message: `Duplicate fieldGroup id "${group.id}".` });
|
|
20616
|
+
}
|
|
20617
|
+
seenGroupIds.add(group.id);
|
|
20618
|
+
group.fieldIds.forEach((fieldId, fieldIndex) => {
|
|
20619
|
+
if (!variableNames.has(fieldId)) {
|
|
20620
|
+
context.addIssue({
|
|
20621
|
+
code: "custom",
|
|
20622
|
+
path: ["presentation", "fieldGroups", groupIndex, "fieldIds", fieldIndex],
|
|
20623
|
+
message: `fieldGroup "${group.id}" references undeclared variable "${fieldId}".`
|
|
20624
|
+
});
|
|
20625
|
+
}
|
|
20626
|
+
});
|
|
20627
|
+
(group.headerFieldIds ?? []).forEach((fieldId, fieldIndex) => {
|
|
20628
|
+
if (!variableNames.has(fieldId)) {
|
|
20629
|
+
context.addIssue({
|
|
20630
|
+
code: "custom",
|
|
20631
|
+
path: ["presentation", "fieldGroups", groupIndex, "headerFieldIds", fieldIndex],
|
|
20632
|
+
message: `fieldGroup "${group.id}" headerFieldIds references undeclared variable "${fieldId}".`
|
|
20633
|
+
});
|
|
20634
|
+
}
|
|
20635
|
+
});
|
|
20636
|
+
});
|
|
20491
20637
|
});
|
|
20492
20638
|
var WorkflowEditorCommandSchema = z22.object({
|
|
20493
20639
|
expectedRecordVersion: z22.number().int().positive(),
|
|
@@ -20658,7 +20804,6 @@ export {
|
|
|
20658
20804
|
PermissionBundleSchema,
|
|
20659
20805
|
SystemGroupDefinitionSchema,
|
|
20660
20806
|
ProductAccessDeclarationSchema,
|
|
20661
|
-
BUILTIN_ARTIFACT_KINDS,
|
|
20662
20807
|
ArtifactKindSchema,
|
|
20663
20808
|
ArtifactStorageModeSchema,
|
|
20664
20809
|
ArtifactCrdtCodecSchema,
|
|
@@ -21183,12 +21328,21 @@ export {
|
|
|
21183
21328
|
ConductorTaskDefinitionSchema,
|
|
21184
21329
|
ConductorWorkflowDefinitionSchema,
|
|
21185
21330
|
WorkflowParameterTypeSchema,
|
|
21331
|
+
WorkflowOntologyOptionSourceSchema,
|
|
21332
|
+
WorkflowChoicePresentationSchema,
|
|
21186
21333
|
WorkflowParameterSchema,
|
|
21187
21334
|
WorkflowOutputBindingSchema,
|
|
21188
21335
|
WorkflowNodeSchema,
|
|
21189
21336
|
WorkflowEdgeSchema,
|
|
21190
21337
|
WorkflowTriggerSchema,
|
|
21191
21338
|
WorkflowValidationIssueSchema,
|
|
21339
|
+
WorkflowFieldGroupSchema,
|
|
21340
|
+
WorkflowBatchControlSchema,
|
|
21341
|
+
WorkflowResultViewPresentationSchema,
|
|
21342
|
+
WorkflowOutputArtifactModalitySchema,
|
|
21343
|
+
WorkflowOutputFieldBindingSchema,
|
|
21344
|
+
WorkflowOutputRelationBindingSchema,
|
|
21345
|
+
WorkflowOutputStrategySchema,
|
|
21192
21346
|
WorkflowDefinitionSchema,
|
|
21193
21347
|
WorkflowEditorCommandSchema,
|
|
21194
21348
|
WorkflowEditorDocumentSchema,
|
|
@@ -21210,4 +21364,4 @@ export {
|
|
|
21210
21364
|
RecordEditorValidationDetailsSchema,
|
|
21211
21365
|
RecordEditorSubmissionSnapshotSchema
|
|
21212
21366
|
};
|
|
21213
|
-
//# sourceMappingURL=chunk-
|
|
21367
|
+
//# sourceMappingURL=chunk-J6ZVASVX.mjs.map
|