@inf-monkeys-tech/monkeys 1.1.41 → 1.1.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/lib/contracts/agent-work.d.ts +50 -0
  2. package/lib/contracts/agent-work.d.ts.map +1 -1
  3. package/lib/contracts/agent-work.js +14 -1
  4. package/lib/contracts/agent-work.js.map +1 -1
  5. package/lib/contracts/declarative-control-http.d.ts +26 -18
  6. package/lib/contracts/declarative-control-http.d.ts.map +1 -1
  7. package/lib/contracts/declarative-control.d.ts +4 -0
  8. package/lib/contracts/declarative-control.d.ts.map +1 -1
  9. package/lib/contracts/declarative-publication-job.d.ts +8 -8
  10. package/lib/contracts/file.d.ts +137 -4
  11. package/lib/contracts/file.d.ts.map +1 -1
  12. package/lib/contracts/file.js +62 -6
  13. package/lib/contracts/file.js.map +1 -1
  14. package/lib/esm/{chunk-ZSSYNYLX.mjs → chunk-33OQXBRM.mjs} +53 -4
  15. package/lib/esm/chunk-33OQXBRM.mjs.map +1 -0
  16. package/lib/esm/{chunk-CWB4ZZ52.mjs → chunk-3YISMAL3.mjs} +3 -3
  17. package/lib/esm/{chunk-DR3BUHQG.mjs → chunk-NTHT6LZF.mjs} +17 -2
  18. package/lib/esm/chunk-NTHT6LZF.mjs.map +1 -0
  19. package/lib/esm/{chunk-6REXMVTC.mjs → chunk-UUUHWSYL.mjs} +2 -2
  20. package/lib/esm/{chunk-22EMXUOT.mjs → chunk-WRSX2N7O.mjs} +2 -2
  21. package/lib/esm/{chunk-QCNO3BPY.mjs → chunk-XUWZH2H3.mjs} +548 -490
  22. package/lib/esm/chunk-XUWZH2H3.mjs.map +1 -0
  23. package/lib/esm/contracts/index.mjs +16 -4
  24. package/lib/esm/index.mjs +24 -6
  25. package/lib/esm/index.mjs.map +1 -1
  26. package/lib/esm/runtime/index.mjs +9 -3
  27. package/lib/esm/schemas/index.mjs +3 -3
  28. package/lib/json-schema/page-runtime-bundle.schema.json +1 -0
  29. package/lib/json-schema/page.schema.json +1 -0
  30. package/lib/runtime/file-reference.d.ts +10 -0
  31. package/lib/runtime/file-reference.d.ts.map +1 -0
  32. package/lib/runtime/file-reference.js +66 -0
  33. package/lib/runtime/file-reference.js.map +1 -0
  34. package/lib/runtime/index.d.ts +1 -0
  35. package/lib/runtime/index.d.ts.map +1 -1
  36. package/lib/runtime/index.js +1 -0
  37. package/lib/runtime/index.js.map +1 -1
  38. package/lib/runtime/runtime-definition-wire.d.ts +2 -2
  39. package/lib/schemas/index.d.ts +1 -0
  40. package/lib/schemas/index.d.ts.map +1 -1
  41. package/package.json +1 -1
  42. package/lib/esm/chunk-DR3BUHQG.mjs.map +0 -1
  43. package/lib/esm/chunk-QCNO3BPY.mjs.map +0 -1
  44. package/lib/esm/chunk-ZSSYNYLX.mjs.map +0 -1
  45. /package/lib/esm/{chunk-CWB4ZZ52.mjs.map → chunk-3YISMAL3.mjs.map} +0 -0
  46. /package/lib/esm/{chunk-6REXMVTC.mjs.map → chunk-UUUHWSYL.mjs.map} +0 -0
  47. /package/lib/esm/{chunk-22EMXUOT.mjs.map → chunk-WRSX2N7O.mjs.map} +0 -0
@@ -7714,15 +7714,282 @@ function normalizeStudioAgentMode(value) {
7714
7714
  var normalizeAgentMode = normalizeStudioAgentMode;
7715
7715
  var normalizeAgentExecutionMode = normalizeStudioAgentMode;
7716
7716
 
7717
- // src/contracts/page-expression.ts
7717
+ // src/contracts/file.ts
7718
7718
  import { z as z4 } from "zod";
7719
- var PageMemberSchema = z4.string().min(1).max(256).refine(
7719
+ var FILE_PURPOSES = [
7720
+ "uploads",
7721
+ "agent-attachments",
7722
+ "agent-artifacts",
7723
+ "agent-edited-images",
7724
+ "agent-workbench",
7725
+ "agent-skill-archives",
7726
+ "asset-screenshots",
7727
+ "data-exports",
7728
+ "data-feature-media",
7729
+ "design-assets",
7730
+ "design-board-thumbnails",
7731
+ "design-images",
7732
+ "dev-agent-reference-images",
7733
+ "dev-agent-review-artifacts",
7734
+ "external-delivery-techpacks",
7735
+ "llm-generated-images",
7736
+ "media-generated",
7737
+ "media-uploads",
7738
+ "model-training-files",
7739
+ "models",
7740
+ "models-checkpoints",
7741
+ "models-clip",
7742
+ "models-controlnet",
7743
+ "models-diffusion-models",
7744
+ "models-loras-test",
7745
+ "models-vae",
7746
+ "output-images",
7747
+ "plugin-data-imports",
7748
+ "plugin-runtime",
7749
+ "plugin-runtime-outputs",
7750
+ "step-thumbnails",
7751
+ "techpack-design-intent",
7752
+ "user-files-base",
7753
+ "user-files-design-board-background",
7754
+ "user-files-design-project-cover",
7755
+ "user-files-designs",
7756
+ "user-files-icons",
7757
+ "user-files-import-comfyui-image",
7758
+ "user-files-import-comfyui-json",
7759
+ "user-files-import-comfyui-json-url",
7760
+ "user-files-instruction-input",
7761
+ "user-files-linesheet",
7762
+ "user-files-media",
7763
+ "user-files-other",
7764
+ "user-files-prompt-assistant",
7765
+ "user-files-table-data",
7766
+ "user-files-techpack-attachments",
7767
+ "user-files-text-data-file",
7768
+ "user-files-workflow-input",
7769
+ "workflow-image-mask",
7770
+ "workflow-image-overlay",
7771
+ "workflow-import"
7772
+ ];
7773
+ var FilePurposeSchema = z4.enum(FILE_PURPOSES);
7774
+ var FileStatusSchema = z4.enum(["pending", "ready", "failed", "deleted"]);
7775
+ var FileVariantStatusSchema = z4.enum(["queued", "processing", "ready", "failed"]);
7776
+ var FILE_USAGE_OWNER_TYPES = [
7777
+ "file-resource",
7778
+ "agent-record",
7779
+ "agent-message",
7780
+ "agent-skill-archive",
7781
+ "data-asset",
7782
+ "data-export",
7783
+ "design-board",
7784
+ "external-delivery",
7785
+ "kernel-runtime",
7786
+ "llm-generated-media",
7787
+ "model-training-media",
7788
+ "plugin-run"
7789
+ ];
7790
+ var FileUsageOwnerTypeSchema = z4.enum(FILE_USAGE_OWNER_TYPES);
7791
+ var FileUsageSchema = z4.object({
7792
+ ownerType: FileUsageOwnerTypeSchema,
7793
+ ownerId: ContractIdentifierSchema,
7794
+ field: ContractIdentifierSchema.optional()
7795
+ }).strict();
7796
+ var ManagedFileUriSchema = z4.string().regex(/^file:\/\/[A-Za-z0-9][A-Za-z0-9_-]{0,127}(?:#[A-Za-z0-9_-]+)?$/);
7797
+ var TransferUrlSchema = z4.string().min(1).max(16384).refine((value) => {
7798
+ if (/^\/(?!\/)/.test(value)) return !/[\u0000-\u0020\\]/.test(value);
7799
+ try {
7800
+ const url = new URL(value);
7801
+ return ["http:", "https:"].includes(url.protocol) && !url.username && !url.password;
7802
+ } catch {
7803
+ return false;
7804
+ }
7805
+ }, "Expected an HTTP(S) URL or absolute same-origin path");
7806
+ var TransferHeadersSchema = z4.record(
7807
+ z4.string().regex(/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/),
7808
+ z4.string().refine((value) => !/[\u0000\r\n]/.test(value), "Invalid header value")
7809
+ );
7810
+ var FileReadInstructionSchema = z4.object({
7811
+ mode: z4.enum(["direct", "proxy"]),
7812
+ url: TransferUrlSchema,
7813
+ method: z4.literal("GET"),
7814
+ headers: TransferHeadersSchema,
7815
+ expiresAt: IsoDateTimeSchema.nullable()
7816
+ }).strict().superRefine((value, context) => {
7817
+ if (value.mode === "proxy" && !/^\/(?!\/)/.test(value.url))
7818
+ context.addIssue({ code: "custom", path: ["url"], message: "A browser proxy must use a same-origin path" });
7819
+ });
7820
+ var FileResourcePathSchema = z4.string().min(1).max(1024).refine((path2) => {
7821
+ if (/^[\/\\]|[\\\u0000-\u001f:?#]/.test(path2)) return false;
7822
+ try {
7823
+ const decoded = decodeURIComponent(path2);
7824
+ return !/^[\/\\]|[\\\u0000-\u001f:?#]/.test(decoded) && decoded.split("/").every((part) => part && part !== "." && part !== "..");
7825
+ } catch {
7826
+ return false;
7827
+ }
7828
+ }, "Expected a safe relative resource path");
7829
+ var FileResourceManifestSchema = z4.object({
7830
+ version: z4.literal(1),
7831
+ entryPath: FileResourcePathSchema.optional(),
7832
+ resources: z4.array(z4.object({ path: FileResourcePathSchema, uri: ManagedFileUriSchema }).strict()).max(1e3)
7833
+ }).strict().superRefine((value, context) => {
7834
+ if (new Set(value.resources.map((resource) => resource.path)).size !== value.resources.length)
7835
+ context.addIssue({ code: "custom", path: ["resources"], message: "Resource paths must be unique" });
7836
+ });
7837
+ var FileReferenceSchema = z4.object({
7838
+ id: ContractIdentifierSchema.optional(),
7839
+ uri: z4.string().trim().min(1).optional(),
7840
+ thumbnailUri: z4.string().trim().min(1).optional(),
7841
+ mimeType: z4.string().trim().min(1).max(128).optional(),
7842
+ byteSize: z4.number().int().nonnegative().optional(),
7843
+ sha256: Sha256Schema.optional()
7844
+ }).strict().refine((value) => Boolean(value.id || value.uri), {
7845
+ message: "File reference requires id or uri"
7846
+ });
7847
+ var FileVariantSchema = z4.object({
7848
+ variantId: ContractIdentifierSchema,
7849
+ kind: z4.literal("thumbnail-512"),
7850
+ status: FileVariantStatusSchema,
7851
+ mimeType: z4.literal("image/webp"),
7852
+ byteSize: z4.number().int().nonnegative().optional(),
7853
+ width: z4.number().int().positive().optional(),
7854
+ height: z4.number().int().positive().optional(),
7855
+ uri: z4.string().trim().min(1).optional(),
7856
+ errorCode: ContractIdentifierSchema.optional()
7857
+ }).strict();
7858
+ var FileRecordSchema = z4.object({
7859
+ contract: z4.literal("FileRecord"),
7860
+ contractVersion: z4.literal(1),
7861
+ version: z4.number().int().positive(),
7862
+ fileId: ContractIdentifierSchema,
7863
+ teamId: ContractIdentifierSchema,
7864
+ purpose: FilePurposeSchema,
7865
+ originalName: z4.string().trim().min(1).max(255),
7866
+ mimeType: z4.string().trim().min(1).max(128),
7867
+ byteSize: z4.number().int().nonnegative().optional(),
7868
+ sha256: Sha256Schema.optional(),
7869
+ status: FileStatusSchema,
7870
+ storage: z4.object({
7871
+ bucketId: ContractIdentifierSchema,
7872
+ objectKey: z4.string().trim().min(1).max(1024),
7873
+ canonicalUri: z4.string().trim().min(1),
7874
+ etag: z4.string().trim().min(1).optional()
7875
+ }).strict(),
7876
+ variants: z4.array(FileVariantSchema).default([]),
7877
+ resourceManifest: FileResourceManifestSchema.optional(),
7878
+ createdAt: IsoDateTimeSchema,
7879
+ updatedAt: IsoDateTimeSchema
7880
+ }).strict().superRefine((value, context) => {
7881
+ if (value.storage.canonicalUri !== `file://${value.fileId}`) {
7882
+ context.addIssue({
7883
+ code: "custom",
7884
+ path: ["storage", "canonicalUri"],
7885
+ message: "Canonical file URI must match fileId"
7886
+ });
7887
+ }
7888
+ });
7889
+ var FileUploadCreateRequestSchema = z4.object({
7890
+ purpose: FilePurposeSchema,
7891
+ filename: z4.string().trim().min(1).max(255),
7892
+ mimeType: z4.string().trim().min(1).max(128),
7893
+ byteSize: z4.number().int().nonnegative().optional(),
7894
+ sha256: Sha256Schema.optional(),
7895
+ usage: FileUsageSchema.optional(),
7896
+ requestId: ContractIdentifierSchema.optional(),
7897
+ forceProxy: z4.boolean().optional()
7898
+ }).strict();
7899
+ var FileUploadInstructionSchema = z4.object({
7900
+ url: TransferUrlSchema,
7901
+ method: z4.string().trim().min(1),
7902
+ headers: TransferHeadersSchema,
7903
+ expiresAt: IsoDateTimeSchema,
7904
+ mode: z4.enum(["direct", "proxy"]).optional()
7905
+ }).strict();
7906
+ var FileUploadCreateResponseSchema = z4.object({
7907
+ file: FileRecordSchema,
7908
+ upload: FileUploadInstructionSchema
7909
+ }).strict();
7910
+ var FileUploadCompleteRequestSchema = z4.object({
7911
+ byteSize: z4.number().int().nonnegative().optional(),
7912
+ sha256: Sha256Schema.optional(),
7913
+ etag: z4.string().trim().min(1).max(512).optional(),
7914
+ resourceManifest: FileResourceManifestSchema.optional()
7915
+ }).strict();
7916
+ var ResolvedFileSchema = z4.object({
7917
+ fileId: ContractIdentifierSchema.optional(),
7918
+ status: FileStatusSchema.optional(),
7919
+ originalUri: z4.string().trim().min(1).optional(),
7920
+ thumbnailUri: z4.string().trim().min(1).optional(),
7921
+ version: z4.number().int().positive().optional(),
7922
+ resourceManifest: FileResourceManifestSchema.optional(),
7923
+ originalAccess: FileReadInstructionSchema.optional(),
7924
+ thumbnailAccess: FileReadInstructionSchema.optional(),
7925
+ mimeType: z4.string().trim().min(1).max(128).optional(),
7926
+ byteSize: z4.number().int().nonnegative().optional(),
7927
+ sha256: Sha256Schema.optional(),
7928
+ unresolved: z4.boolean().optional()
7929
+ }).strict();
7930
+ var FileResolveBatchRequestSchema = z4.object({
7931
+ references: z4.array(FileReferenceSchema).min(1).max(1e3),
7932
+ includeOriginal: z4.boolean().default(false),
7933
+ includeThumbnail: z4.boolean().default(true),
7934
+ includeAccessInstructions: z4.boolean().default(false),
7935
+ forceProxy: z4.boolean().default(false)
7936
+ }).strict();
7937
+ var FileResolveBatchResponseSchema = z4.object({
7938
+ items: z4.array(ResolvedFileSchema)
7939
+ }).strict();
7940
+ var ManagedFileCommandTypeSchema = z4.enum([
7941
+ "create-file",
7942
+ "attach-usage",
7943
+ "detach-usage",
7944
+ "record-upload",
7945
+ "verify-upload",
7946
+ "delete-file"
7947
+ ]);
7948
+ var ManagedFileCommandSchema = z4.object({
7949
+ contract: z4.literal("ManagedFileCommand"),
7950
+ contractVersion: z4.literal(1),
7951
+ commandId: ContractIdentifierSchema,
7952
+ commandType: ManagedFileCommandTypeSchema,
7953
+ fileId: ContractIdentifierSchema,
7954
+ teamId: ContractIdentifierSchema,
7955
+ expectedVersion: z4.number().int().nonnegative().optional(),
7956
+ actorId: ContractIdentifierSchema.optional(),
7957
+ payload: JsonObjectSchema.default({}),
7958
+ issuedAt: IsoDateTimeSchema
7959
+ }).strict();
7960
+ var ManagedFileEventTypeSchema = z4.enum([
7961
+ "file-created",
7962
+ "file-usage-attached",
7963
+ "file-usage-detached",
7964
+ "storage-operation-queued",
7965
+ "storage-operation-completed",
7966
+ "storage-operation-failed",
7967
+ "file-ready",
7968
+ "file-deleted"
7969
+ ]);
7970
+ var ManagedFileEventSchema = z4.object({
7971
+ contract: z4.literal("ManagedFileEvent"),
7972
+ contractVersion: z4.literal(1),
7973
+ eventId: ContractIdentifierSchema,
7974
+ eventType: ManagedFileEventTypeSchema,
7975
+ fileId: ContractIdentifierSchema,
7976
+ teamId: ContractIdentifierSchema,
7977
+ aggregateVersion: z4.number().int().positive(),
7978
+ commandId: ContractIdentifierSchema,
7979
+ actorId: ContractIdentifierSchema.optional(),
7980
+ payload: JsonObjectSchema.default({}),
7981
+ occurredAt: IsoDateTimeSchema
7982
+ }).strict();
7983
+
7984
+ // src/contracts/page-expression.ts
7985
+ import { z as z5 } from "zod";
7986
+ var PageMemberSchema = z5.string().min(1).max(256).refine(
7720
7987
  (value) => !["__proto__", "prototype", "constructor"].includes(value),
7721
7988
  "Unsafe Page member."
7722
7989
  );
7723
- var PageValuePathSchema = z4.array(PageMemberSchema).max(16);
7724
- var PageExpressionRootSchema = z4.enum(["state", "model", "bindings", "queries", "scope", "intent", "result", "actions"]);
7725
- var PageOperatorSchema = z4.enum([
7990
+ var PageValuePathSchema = z5.array(PageMemberSchema).max(16);
7991
+ var PageExpressionRootSchema = z5.enum(["state", "model", "bindings", "queries", "scope", "intent", "result", "actions"]);
7992
+ var PageOperatorSchema = z5.enum([
7726
7993
  "add",
7727
7994
  "subtract",
7728
7995
  "multiply",
@@ -7757,14 +8024,14 @@ var PageOperatorSchema = z4.enum([
7757
8024
  "number-format",
7758
8025
  "encode-uri-component"
7759
8026
  ]);
7760
- var RecursivePageExpressionSchema = z4.lazy(() => z4.discriminatedUnion("kind", [
7761
- z4.object({ kind: z4.literal("literal"), value: JsonValueSchema }).strict(),
7762
- z4.object({ kind: z4.literal("read"), root: PageExpressionRootSchema, path: PageValuePathSchema }).strict(),
7763
- z4.object({ kind: z4.literal("operator"), operator: PageOperatorSchema, arguments: z4.array(RecursivePageExpressionSchema).min(1).max(32) }).strict(),
7764
- z4.object({ kind: z4.literal("conditional"), condition: RecursivePageExpressionSchema, then: RecursivePageExpressionSchema, else: RecursivePageExpressionSchema }).strict(),
7765
- z4.object({ kind: z4.literal("object"), fields: z4.record(PageMemberSchema, RecursivePageExpressionSchema) }).strict(),
7766
- z4.object({ kind: z4.literal("array"), items: z4.array(RecursivePageExpressionSchema).max(1e3) }).strict(),
7767
- ...["map", "filter", "sum"].map((kind) => z4.object({ kind: z4.literal(kind), source: RecursivePageExpressionSchema, value: RecursivePageExpressionSchema }).strict())
8027
+ var RecursivePageExpressionSchema = z5.lazy(() => z5.discriminatedUnion("kind", [
8028
+ z5.object({ kind: z5.literal("literal"), value: JsonValueSchema }).strict(),
8029
+ z5.object({ kind: z5.literal("read"), root: PageExpressionRootSchema, path: PageValuePathSchema }).strict(),
8030
+ z5.object({ kind: z5.literal("operator"), operator: PageOperatorSchema, arguments: z5.array(RecursivePageExpressionSchema).min(1).max(32) }).strict(),
8031
+ z5.object({ kind: z5.literal("conditional"), condition: RecursivePageExpressionSchema, then: RecursivePageExpressionSchema, else: RecursivePageExpressionSchema }).strict(),
8032
+ z5.object({ kind: z5.literal("object"), fields: z5.record(PageMemberSchema, RecursivePageExpressionSchema) }).strict(),
8033
+ z5.object({ kind: z5.literal("array"), items: z5.array(RecursivePageExpressionSchema).max(1e3) }).strict(),
8034
+ ...["map", "filter", "sum"].map((kind) => z5.object({ kind: z5.literal(kind), source: RecursivePageExpressionSchema, value: RecursivePageExpressionSchema }).strict())
7768
8035
  ]));
7769
8036
  var PAGE_EXPRESSION_LIMITS = Object.freeze({ depth: 32, nodes: 4096, operations: 2e4, collection: 1e3, bytes: 1048576 });
7770
8037
  var PAGE_EXPRESSION_VALUE_LIMITS = Object.freeze({ depth: 32, nodes: 262144, collection: 1e3, bytes: 16777216 });
@@ -7794,17 +8061,17 @@ var assertValueBudget = (value, limits) => {
7794
8061
  };
7795
8062
  var assertPageValueBudget = (value) => assertValueBudget(value, PAGE_EXPRESSION_LIMITS);
7796
8063
  var assertPageExpressionValueBudget = (value) => assertValueBudget(value, PAGE_EXPRESSION_VALUE_LIMITS);
7797
- var PageExpressionSchema = z4.unknown().superRefine((value, context) => {
8064
+ var PageExpressionSchema = z5.unknown().superRefine((value, context) => {
7798
8065
  try {
7799
8066
  assertPageValueBudget(value);
7800
8067
  } catch (error) {
7801
8068
  context.addIssue({ code: "custom", message: error instanceof Error ? error.message : "PAGE_EXPRESSION_BUDGET" });
7802
8069
  }
7803
8070
  }).pipe(RecursivePageExpressionSchema);
7804
- var PagePropertyBindingSchema = z4.object({
8071
+ var PagePropertyBindingSchema = z5.object({
7805
8072
  targetPath: PageValuePathSchema.min(1),
7806
8073
  expression: PageExpressionSchema,
7807
- valueType: z4.enum(["string", "number", "boolean", "object", "array", "null"]).optional()
8074
+ valueType: z5.enum(["string", "number", "boolean", "object", "array", "null"]).optional()
7808
8075
  }).strict();
7809
8076
  var visitPageExpression = (expression, visit) => {
7810
8077
  visit(expression);
@@ -7876,9 +8143,9 @@ var collectExternalPageExpressionReads = (expression) => {
7876
8143
  };
7877
8144
 
7878
8145
  // src/contracts/render.ts
7879
- import { z as z5 } from "zod";
7880
- var ProductContextSchema = z5.enum(["studio", "kernel"]);
7881
- var RenderNodeStateSchema = z5.enum([
8146
+ import { z as z6 } from "zod";
8147
+ var ProductContextSchema = z6.enum(["studio", "kernel"]);
8148
+ var RenderNodeStateSchema = z6.enum([
7882
8149
  "idle",
7883
8150
  "loading",
7884
8151
  "empty",
@@ -7887,7 +8154,7 @@ var RenderNodeStateSchema = z5.enum([
7887
8154
  "disabled",
7888
8155
  "selected"
7889
8156
  ]);
7890
- var RenderNodeKindSchema = z5.enum([
8157
+ var RenderNodeKindSchema = z6.enum([
7891
8158
  "shell",
7892
8159
  "page",
7893
8160
  "navigation",
@@ -7899,16 +8166,16 @@ var RenderNodeKindSchema = z5.enum([
7899
8166
  "overlay",
7900
8167
  "professional-provider"
7901
8168
  ]);
7902
- var RenderSurfaceSchema = z5.object({
7903
- frameOwner: z5.enum(["host", "provider", "none"]),
8169
+ var RenderSurfaceSchema = z6.object({
8170
+ frameOwner: z6.enum(["host", "provider", "none"]),
7904
8171
  tone: ContractIdentifierSchema.optional(),
7905
- density: z5.enum(["compact", "default", "comfortable"])
8172
+ density: z6.enum(["compact", "default", "comfortable"])
7906
8173
  }).strict();
7907
- var RenderScrollSchema = z5.object({
7908
- owner: z5.enum(["page", "surface", "provider"]),
7909
- axis: z5.enum(["x", "y", "both", "none"]),
8174
+ var RenderScrollSchema = z6.object({
8175
+ owner: z6.enum(["page", "surface", "provider"]),
8176
+ axis: z6.enum(["x", "y", "both", "none"]),
7910
8177
  restoreKey: ContractIdentifierSchema.optional(),
7911
- virtualizationBoundary: z5.boolean()
8178
+ virtualizationBoundary: z6.boolean()
7912
8179
  }).strict().superRefine((scroll, context) => {
7913
8180
  if (scroll.owner === "provider" && scroll.restoreKey) {
7914
8181
  context.addIssue({
@@ -7925,9 +8192,9 @@ var RenderScrollSchema = z5.object({
7925
8192
  });
7926
8193
  }
7927
8194
  });
7928
- var RenderActivationSchema = z5.object({
8195
+ var RenderActivationSchema = z6.object({
7929
8196
  activationId: ContractIdentifierSchema,
7930
- mode: z5.enum([
8197
+ mode: z6.enum([
7931
8198
  "navigate",
7932
8199
  "select",
7933
8200
  "drawer",
@@ -7935,8 +8202,8 @@ var RenderActivationSchema = z5.object({
7935
8202
  "fullscreen",
7936
8203
  "inline"
7937
8204
  ]),
7938
- targetPath: z5.string().trim().regex(/^\/(?!\/)/, "Expected an application-relative path.").optional(),
7939
- history: z5.enum(["push", "replace"]).optional()
8205
+ targetPath: z6.string().trim().regex(/^\/(?!\/)/, "Expected an application-relative path.").optional(),
8206
+ history: z6.enum(["push", "replace"]).optional()
7940
8207
  }).strict().superRefine((activation, context) => {
7941
8208
  if (activation.mode === "navigate" && !activation.targetPath) {
7942
8209
  context.addIssue({
@@ -7953,19 +8220,19 @@ var RenderActivationSchema = z5.object({
7953
8220
  });
7954
8221
  }
7955
8222
  });
7956
- var RenderLifecycleSchema = z5.object({
7957
- mountPolicy: z5.enum(["always", "when-visible", "when-active"]),
7958
- queryPolicy: z5.enum(["always", "when-visible", "when-active", "manual"]),
7959
- retainOnDeactivate: z5.boolean(),
7960
- deepLink: z5.boolean(),
7961
- focusReturn: z5.boolean()
7962
- }).strict();
7963
- var RenderLayoutSchema = z5.object({
7964
- mode: z5.enum(["contents", "block", "flex", "grid", "absolute"]),
7965
- direction: z5.enum(["row", "column"]).optional(),
7966
- columns: z5.number().int().positive().optional(),
7967
- align: z5.enum(["start", "center", "end", "stretch"]).optional(),
7968
- justify: z5.enum(["start", "center", "end", "between", "around"]).optional(),
8223
+ var RenderLifecycleSchema = z6.object({
8224
+ mountPolicy: z6.enum(["always", "when-visible", "when-active"]),
8225
+ queryPolicy: z6.enum(["always", "when-visible", "when-active", "manual"]),
8226
+ retainOnDeactivate: z6.boolean(),
8227
+ deepLink: z6.boolean(),
8228
+ focusReturn: z6.boolean()
8229
+ }).strict();
8230
+ var RenderLayoutSchema = z6.object({
8231
+ mode: z6.enum(["contents", "block", "flex", "grid", "absolute"]),
8232
+ direction: z6.enum(["row", "column"]).optional(),
8233
+ columns: z6.number().int().positive().optional(),
8234
+ align: z6.enum(["start", "center", "end", "stretch"]).optional(),
8235
+ justify: z6.enum(["start", "center", "end", "between", "around"]).optional(),
7969
8236
  gapTokenRef: EntityRefSchema.optional()
7970
8237
  }).strict().superRefine((layout, context) => {
7971
8238
  if (layout.direction && layout.mode !== "flex") {
@@ -7990,11 +8257,11 @@ var RenderLayoutSchema = z5.object({
7990
8257
  });
7991
8258
  }
7992
8259
  });
7993
- var RenderResponsiveRuleSchema = z5.object({
7994
- minWidthPx: z5.number().nonnegative().optional(),
7995
- maxWidthPx: z5.number().positive().optional(),
8260
+ var RenderResponsiveRuleSchema = z6.object({
8261
+ minWidthPx: z6.number().nonnegative().optional(),
8262
+ maxWidthPx: z6.number().positive().optional(),
7996
8263
  layout: RenderLayoutSchema,
7997
- style: z5.lazy(() => RenderStyleSchema).optional()
8264
+ style: z6.lazy(() => RenderStyleSchema).optional()
7998
8265
  }).strict().superRefine((rule, context) => {
7999
8266
  if (rule.minWidthPx === void 0 && rule.maxWidthPx === void 0) {
8000
8267
  context.addIssue({
@@ -8011,9 +8278,9 @@ var RenderResponsiveRuleSchema = z5.object({
8011
8278
  });
8012
8279
  }
8013
8280
  });
8014
- var RenderStyleValueSchema = z5.union([
8015
- z5.number().finite(),
8016
- z5.string().trim().min(1).max(256).superRefine((value, context) => {
8281
+ var RenderStyleValueSchema = z6.union([
8282
+ z6.number().finite(),
8283
+ z6.string().trim().min(1).max(256).superRefine((value, context) => {
8017
8284
  if (/[;{}]/.test(value) || /(?:url|expression|javascript|var)\s*\(/i.test(value)) {
8018
8285
  context.addIssue({
8019
8286
  code: "custom",
@@ -8022,7 +8289,7 @@ var RenderStyleValueSchema = z5.union([
8022
8289
  }
8023
8290
  })
8024
8291
  ]);
8025
- var RenderStyleSchema = z5.object({
8292
+ var RenderStyleSchema = z6.object({
8026
8293
  width: RenderStyleValueSchema.optional(),
8027
8294
  height: RenderStyleValueSchema.optional(),
8028
8295
  minWidth: RenderStyleValueSchema.optional(),
@@ -8037,7 +8304,7 @@ var RenderStyleSchema = z5.object({
8037
8304
  marginBlockEnd: RenderStyleValueSchema.optional(),
8038
8305
  marginInlineStart: RenderStyleValueSchema.optional(),
8039
8306
  marginInlineEnd: RenderStyleValueSchema.optional(),
8040
- display: z5.enum([
8307
+ display: z6.enum([
8041
8308
  "none",
8042
8309
  "block",
8043
8310
  "inline",
@@ -8054,19 +8321,19 @@ var RenderStyleSchema = z5.object({
8054
8321
  color: RenderStyleValueSchema.optional(),
8055
8322
  borderColor: RenderStyleValueSchema.optional(),
8056
8323
  borderWidth: RenderStyleValueSchema.optional(),
8057
- borderStyle: z5.enum(["none", "solid", "dashed", "dotted"]).optional(),
8324
+ borderStyle: z6.enum(["none", "solid", "dashed", "dotted"]).optional(),
8058
8325
  borderRadius: RenderStyleValueSchema.optional(),
8059
8326
  boxShadow: RenderStyleValueSchema.optional(),
8060
8327
  fontSize: RenderStyleValueSchema.optional(),
8061
8328
  fontFamily: RenderStyleValueSchema.optional(),
8062
8329
  fontWeight: RenderStyleValueSchema.optional(),
8063
8330
  lineHeight: RenderStyleValueSchema.optional(),
8064
- textAlign: z5.enum(["start", "center", "end", "left", "right"]).optional(),
8065
- whiteSpace: z5.enum(["normal", "nowrap", "pre", "pre-wrap", "pre-line", "break-spaces"]).optional(),
8066
- overflow: z5.enum(["visible", "hidden", "auto", "scroll", "clip"]).optional(),
8067
- overflowX: z5.enum(["visible", "hidden", "auto", "scroll", "clip"]).optional(),
8068
- overflowY: z5.enum(["visible", "hidden", "auto", "scroll", "clip"]).optional(),
8069
- position: z5.enum(["static", "relative", "absolute", "sticky", "fixed"]).optional(),
8331
+ textAlign: z6.enum(["start", "center", "end", "left", "right"]).optional(),
8332
+ whiteSpace: z6.enum(["normal", "nowrap", "pre", "pre-wrap", "pre-line", "break-spaces"]).optional(),
8333
+ overflow: z6.enum(["visible", "hidden", "auto", "scroll", "clip"]).optional(),
8334
+ overflowX: z6.enum(["visible", "hidden", "auto", "scroll", "clip"]).optional(),
8335
+ overflowY: z6.enum(["visible", "hidden", "auto", "scroll", "clip"]).optional(),
8336
+ position: z6.enum(["static", "relative", "absolute", "sticky", "fixed"]).optional(),
8070
8337
  inset: RenderStyleValueSchema.optional(),
8071
8338
  top: RenderStyleValueSchema.optional(),
8072
8339
  right: RenderStyleValueSchema.optional(),
@@ -8076,10 +8343,10 @@ var RenderStyleSchema = z5.object({
8076
8343
  gridColumn: RenderStyleValueSchema.optional(),
8077
8344
  gridRow: RenderStyleValueSchema.optional(),
8078
8345
  flex: RenderStyleValueSchema.optional(),
8079
- flexDirection: z5.enum(["row", "row-reverse", "column", "column-reverse"]).optional(),
8080
- flexWrap: z5.enum(["nowrap", "wrap", "wrap-reverse"]).optional(),
8081
- alignItems: z5.enum(["start", "center", "end", "stretch", "baseline"]).optional(),
8082
- justifyContent: z5.enum([
8346
+ flexDirection: z6.enum(["row", "row-reverse", "column", "column-reverse"]).optional(),
8347
+ flexWrap: z6.enum(["nowrap", "wrap", "wrap-reverse"]).optional(),
8348
+ alignItems: z6.enum(["start", "center", "end", "stretch", "baseline"]).optional(),
8349
+ justifyContent: z6.enum([
8083
8350
  "start",
8084
8351
  "center",
8085
8352
  "end",
@@ -8087,12 +8354,12 @@ var RenderStyleSchema = z5.object({
8087
8354
  "space-around",
8088
8355
  "space-evenly"
8089
8356
  ]).optional(),
8090
- flexGrow: z5.number().finite().nonnegative().optional(),
8091
- flexShrink: z5.number().finite().nonnegative().optional(),
8092
- alignSelf: z5.enum(["auto", "start", "center", "end", "stretch"]).optional(),
8093
- justifySelf: z5.enum(["auto", "start", "center", "end", "stretch"]).optional(),
8094
- objectFit: z5.enum(["contain", "cover", "fill", "none", "scale-down"]).optional(),
8095
- opacity: z5.number().finite().min(0).max(1).optional()
8357
+ flexGrow: z6.number().finite().nonnegative().optional(),
8358
+ flexShrink: z6.number().finite().nonnegative().optional(),
8359
+ alignSelf: z6.enum(["auto", "start", "center", "end", "stretch"]).optional(),
8360
+ justifySelf: z6.enum(["auto", "start", "center", "end", "stretch"]).optional(),
8361
+ objectFit: z6.enum(["contain", "cover", "fill", "none", "scale-down"]).optional(),
8362
+ opacity: z6.number().finite().min(0).max(1).optional()
8096
8363
  }).strict();
8097
8364
  var requireRef = (reference, expectedKind, path2, context) => {
8098
8365
  if (!reference) return;
@@ -8122,14 +8389,14 @@ var requirePinnedOwnedRef = (reference, expectedKind, path2, context) => {
8122
8389
  });
8123
8390
  }
8124
8391
  };
8125
- var RenderNodeSchema = z5.object({
8126
- contract: z5.literal("RenderNode"),
8392
+ var RenderNodeSchema = z6.object({
8393
+ contract: z6.literal("RenderNode"),
8127
8394
  nodeId: ContractIdentifierSchema,
8128
8395
  kind: RenderNodeKindSchema,
8129
8396
  version: ContractVersionSchema,
8130
8397
  ownerRepo: ContractIdentifierSchema,
8131
8398
  parentNodeId: ContractIdentifierSchema.optional(),
8132
- children: z5.array(ContractIdentifierSchema),
8399
+ children: z6.array(ContractIdentifierSchema),
8133
8400
  slot: ContractIdentifierSchema.optional(),
8134
8401
  pageRef: EntityRefSchema,
8135
8402
  semanticRef: EntityRefSchema.optional(),
@@ -8144,15 +8411,15 @@ var RenderNodeSchema = z5.object({
8144
8411
  lifecycle: RenderLifecycleSchema,
8145
8412
  layout: RenderLayoutSchema,
8146
8413
  style: RenderStyleSchema.optional(),
8147
- responsive: z5.array(RenderResponsiveRuleSchema),
8414
+ responsive: z6.array(RenderResponsiveRuleSchema),
8148
8415
  accessRef: EntityRefSchema.optional(),
8149
8416
  evidenceRef: EntityRefSchema.optional(),
8150
8417
  state: RenderNodeStateSchema,
8151
8418
  renderModel: JsonObjectSchema,
8152
- repeat: z5.object({
8419
+ repeat: z6.object({
8153
8420
  source: PageExpressionSchema,
8154
8421
  keyPath: PageValuePathSchema.min(1),
8155
- limit: z5.number().int().min(1).max(1e3).default(200)
8422
+ limit: z6.number().int().min(1).max(1e3).default(200)
8156
8423
  }).strict().optional()
8157
8424
  }).strict().superRefine((node, context) => {
8158
8425
  requireRef(node.pageRef, "page", ["pageRef"], context);
@@ -8199,39 +8466,39 @@ var RenderNodeSchema = z5.object({
8199
8466
  });
8200
8467
  }
8201
8468
  });
8202
- var RenderTreeSchema = z5.object({
8203
- contract: z5.literal("RenderTree"),
8469
+ var RenderTreeSchema = z6.object({
8470
+ contract: z6.literal("RenderTree"),
8204
8471
  treeId: ContractIdentifierSchema,
8205
8472
  product: ProductContextSchema,
8206
8473
  rootNodeId: ContractIdentifierSchema,
8207
- nodes: z5.array(RenderNodeSchema).min(1)
8474
+ nodes: z6.array(RenderNodeSchema).min(1)
8208
8475
  }).strict();
8209
- var OverlayZIndexLaneSchema = z5.enum([
8476
+ var OverlayZIndexLaneSchema = z6.enum([
8210
8477
  "popover",
8211
8478
  "drawer",
8212
8479
  "modal",
8213
8480
  "fullscreen",
8214
8481
  "system"
8215
8482
  ]);
8216
- var OverlayNodeSchema = z5.object({
8217
- contract: z5.literal("OverlayNode"),
8483
+ var OverlayNodeSchema = z6.object({
8484
+ contract: z6.literal("OverlayNode"),
8218
8485
  overlayId: ContractIdentifierSchema,
8219
8486
  renderNode: RenderNodeSchema,
8220
- presentation: z5.enum(["drawer", "modal", "fullscreen"]),
8487
+ presentation: z6.enum(["drawer", "modal", "fullscreen"]),
8221
8488
  zIndexLane: OverlayZIndexLaneSchema,
8222
- url: z5.object({
8489
+ url: z6.object({
8223
8490
  parameter: ContractIdentifierSchema,
8224
8491
  value: ContractIdentifierSchema,
8225
- openMode: z5.enum(["push", "replace"]),
8226
- closeMode: z5.enum(["back", "replace"])
8492
+ openMode: z6.enum(["push", "replace"]),
8493
+ closeMode: z6.enum(["back", "replace"])
8227
8494
  }).strict(),
8228
- focus: z5.object({
8229
- initial: z5.enum(["first-interactive", "container", "explicit"]),
8230
- trap: z5.boolean()
8495
+ focus: z6.object({
8496
+ initial: z6.enum(["first-interactive", "container", "explicit"]),
8497
+ trap: z6.boolean()
8231
8498
  }).strict(),
8232
- close: z5.object({
8233
- escape: z5.boolean(),
8234
- backdrop: z5.boolean()
8499
+ close: z6.object({
8500
+ escape: z6.boolean(),
8501
+ backdrop: z6.boolean()
8235
8502
  }).strict()
8236
8503
  }).strict().superRefine((value, context) => {
8237
8504
  if (value.renderNode.kind !== "overlay") {
@@ -8270,8 +8537,8 @@ var OverlayNodeSchema = z5.object({
8270
8537
  });
8271
8538
  }
8272
8539
  });
8273
- var ProductPathSchema = z5.string().trim().regex(/^\/(?!\/)/, "Expected an application-relative path.");
8274
- var ApplicationHandoffEndpointSchema = z5.object({
8540
+ var ProductPathSchema = z6.string().trim().regex(/^\/(?!\/)/, "Expected an application-relative path.");
8541
+ var ApplicationHandoffEndpointSchema = z6.object({
8275
8542
  product: ProductContextSchema,
8276
8543
  pageId: ContractIdentifierSchema,
8277
8544
  viewId: ContractIdentifierSchema.optional(),
@@ -8280,8 +8547,8 @@ var ApplicationHandoffEndpointSchema = z5.object({
8280
8547
  activationId: ContractIdentifierSchema.optional(),
8281
8548
  path: ProductPathSchema
8282
8549
  }).strict();
8283
- var ApplicationHandoffSchema = z5.object({
8284
- contract: z5.literal("ApplicationHandoff"),
8550
+ var ApplicationHandoffSchema = z6.object({
8551
+ contract: z6.literal("ApplicationHandoff"),
8285
8552
  handoffId: ContractIdentifierSchema,
8286
8553
  source: ApplicationHandoffEndpointSchema,
8287
8554
  target: ApplicationHandoffEndpointSchema,
@@ -8297,8 +8564,8 @@ var ApplicationHandoffSchema = z5.object({
8297
8564
  });
8298
8565
  }
8299
8566
  });
8300
- var ViewProviderDescriptorSchema = z5.object({
8301
- contract: z5.literal("ViewProviderDescriptor"),
8567
+ var ViewProviderDescriptorSchema = z6.object({
8568
+ contract: z6.literal("ViewProviderDescriptor"),
8302
8569
  providerId: ContractIdentifierSchema,
8303
8570
  providerVersion: ContractIdentifierSchema,
8304
8571
  runtimeContractVersion: ContractIdentifierSchema.optional(),
@@ -8307,11 +8574,11 @@ var ViewProviderDescriptorSchema = z5.object({
8307
8574
  rendererKey: ContractIdentifierSchema,
8308
8575
  renderModelSchemaRef: ContractIdentifierSchema,
8309
8576
  intentSchemaRef: ContractIdentifierSchema.optional(),
8310
- loading: z5.enum(["eager", "lazy", "viewport", "on-activation"]),
8311
- stateOwner: z5.enum(["host", "provider", "external"]),
8312
- supportedPageTypes: z5.array(ContractIdentifierSchema).min(1),
8313
- supportedSurfaces: z5.array(
8314
- z5.enum([
8577
+ loading: z6.enum(["eager", "lazy", "viewport", "on-activation"]),
8578
+ stateOwner: z6.enum(["host", "provider", "external"]),
8579
+ supportedPageTypes: z6.array(ContractIdentifierSchema).min(1),
8580
+ supportedSurfaces: z6.array(
8581
+ z6.enum([
8315
8582
  "page",
8316
8583
  "workspace",
8317
8584
  "view",
@@ -8321,9 +8588,9 @@ var ViewProviderDescriptorSchema = z5.object({
8321
8588
  "agent"
8322
8589
  ])
8323
8590
  ).min(1),
8324
- frameOwner: z5.enum(["host", "provider", "none"]),
8325
- sideEffects: z5.array(
8326
- z5.enum([
8591
+ frameOwner: z6.enum(["host", "provider", "none"]),
8592
+ sideEffects: z6.array(
8593
+ z6.enum([
8327
8594
  "network",
8328
8595
  "storage",
8329
8596
  "navigation",
@@ -8333,15 +8600,15 @@ var ViewProviderDescriptorSchema = z5.object({
8333
8600
  ])
8334
8601
  ),
8335
8602
  sideEffectAdapterRef: EntityRefSchema.optional(),
8336
- lifecycle: z5.object({
8337
- preserveMount: z5.boolean(),
8338
- preserveScroll: z5.boolean(),
8603
+ lifecycle: z6.object({
8604
+ preserveMount: z6.boolean(),
8605
+ preserveScroll: z6.boolean(),
8339
8606
  focusModel: ContractIdentifierSchema
8340
8607
  }).strict(),
8341
- performance: z5.object({
8342
- lazy: z5.boolean(),
8343
- virtualized: z5.boolean(),
8344
- budgetMs: z5.number().positive().optional()
8608
+ performance: z6.object({
8609
+ lazy: z6.boolean(),
8610
+ virtualized: z6.boolean(),
8611
+ budgetMs: z6.number().positive().optional()
8345
8612
  }).strict(),
8346
8613
  accessRef: EntityRefSchema.optional(),
8347
8614
  evidenceRef: EntityRefSchema.optional()
@@ -8391,55 +8658,55 @@ var ViewProviderDescriptorSchema = z5.object({
8391
8658
  });
8392
8659
 
8393
8660
  // src/contracts/capability.ts
8394
- import { z as z6 } from "zod";
8395
- var ContractPortSchema = z6.object({
8661
+ import { z as z7 } from "zod";
8662
+ var ContractPortSchema = z7.object({
8396
8663
  name: ContractIdentifierSchema,
8397
8664
  schemaRef: ContractIdentifierSchema,
8398
- required: z6.boolean().default(false),
8399
- multiple: z6.boolean().default(false),
8400
- description: z6.string().optional()
8665
+ required: z7.boolean().default(false),
8666
+ multiple: z7.boolean().default(false),
8667
+ description: z7.string().optional()
8401
8668
  }).strict();
8402
- var CapabilityProviderBindingSchema = z6.object({
8669
+ var CapabilityProviderBindingSchema = z7.object({
8403
8670
  providerRef: EntityRefSchema,
8404
- productContexts: z6.array(ProductContextSchema).default([]),
8405
- priority: z6.number().int().default(0)
8671
+ productContexts: z7.array(ProductContextSchema).default([]),
8672
+ priority: z7.number().int().default(0)
8406
8673
  }).strict();
8407
- var CapabilityManifestSchema = z6.object({
8408
- contract: z6.literal("CapabilityManifest"),
8674
+ var CapabilityManifestSchema = z7.object({
8675
+ contract: z7.literal("CapabilityManifest"),
8409
8676
  id: ContractIdentifierSchema,
8410
8677
  capabilityVersion: ContractIdentifierSchema,
8411
8678
  ownerRepo: ContractIdentifierSchema,
8412
- kind: z6.enum(["primitive", "composite", "view", "professional-provider", "tool", "workflow"]),
8413
- displayName: z6.string().trim().min(1),
8414
- description: z6.string().optional(),
8415
- ports: z6.object({
8416
- inputs: z6.array(ContractPortSchema).default([]),
8417
- outputs: z6.array(ContractPortSchema).default([])
8679
+ kind: z7.enum(["primitive", "composite", "view", "professional-provider", "tool", "workflow"]),
8680
+ displayName: z7.string().trim().min(1),
8681
+ description: z7.string().optional(),
8682
+ ports: z7.object({
8683
+ inputs: z7.array(ContractPortSchema).default([]),
8684
+ outputs: z7.array(ContractPortSchema).default([])
8418
8685
  }).strict(),
8419
- runtime: z6.object({
8420
- providerBindings: z6.array(CapabilityProviderBindingSchema).min(1),
8421
- loading: z6.enum(["eager", "lazy", "viewport", "on-activation"]),
8686
+ runtime: z7.object({
8687
+ providerBindings: z7.array(CapabilityProviderBindingSchema).min(1),
8688
+ loading: z7.enum(["eager", "lazy", "viewport", "on-activation"]),
8422
8689
  fallbackCapabilityRef: EntityRefSchema.optional(),
8423
- stateOwner: z6.enum(["host", "provider", "external"]),
8690
+ stateOwner: z7.enum(["host", "provider", "external"]),
8424
8691
  stateSchemaRef: ContractIdentifierSchema.optional(),
8425
- sideEffects: z6.array(z6.enum(["network", "storage", "navigation", "clipboard", "worker", "websocket"])).default([])
8692
+ sideEffects: z7.array(z7.enum(["network", "storage", "navigation", "clipboard", "worker", "websocket"])).default([])
8426
8693
  }).strict(),
8427
- placement: z6.object({
8428
- surfaces: z6.array(ContractIdentifierSchema).min(1),
8429
- slots: z6.array(ContractIdentifierSchema).default([]),
8430
- variants: z6.array(ContractIdentifierSchema).default([]),
8431
- tokenRefs: z6.array(ContractIdentifierSchema).default([])
8694
+ placement: z7.object({
8695
+ surfaces: z7.array(ContractIdentifierSchema).min(1),
8696
+ slots: z7.array(ContractIdentifierSchema).default([]),
8697
+ variants: z7.array(ContractIdentifierSchema).default([]),
8698
+ tokenRefs: z7.array(ContractIdentifierSchema).default([])
8432
8699
  }).strict(),
8433
- accessibility: z6.object({
8700
+ accessibility: z7.object({
8434
8701
  keyboardModel: ContractIdentifierSchema,
8435
8702
  focusModel: ContractIdentifierSchema,
8436
8703
  labelContract: ContractIdentifierSchema
8437
8704
  }).strict(),
8438
- observability: z6.object({
8705
+ observability: z7.object({
8439
8706
  eventNamespace: ContractIdentifierSchema,
8440
- metrics: z6.array(ContractIdentifierSchema).default([]),
8441
- evidenceRefs: z6.array(ContractIdentifierSchema).default([]),
8442
- performanceBudgetMs: z6.number().positive().optional()
8707
+ metrics: z7.array(ContractIdentifierSchema).default([]),
8708
+ evidenceRefs: z7.array(ContractIdentifierSchema).default([]),
8709
+ performanceBudgetMs: z7.number().positive().optional()
8443
8710
  }).strict()
8444
8711
  }).strict().superRefine((manifest, context) => {
8445
8712
  const providerIds = /* @__PURE__ */ new Set();
@@ -8461,7 +8728,7 @@ var CapabilityManifestSchema = z6.object({
8461
8728
  }
8462
8729
  });
8463
8730
  });
8464
- var CapabilitySourceTypeSchema = z6.enum([
8731
+ var CapabilitySourceTypeSchema = z7.enum([
8465
8732
  "tool-manifest",
8466
8733
  "plugin-manifest",
8467
8734
  "openapi",
@@ -8469,18 +8736,18 @@ var CapabilitySourceTypeSchema = z6.enum([
8469
8736
  "comfyui",
8470
8737
  "design-view-provider"
8471
8738
  ]);
8472
- var CapabilityRegistrySourceSchema = z6.object({
8739
+ var CapabilityRegistrySourceSchema = z7.object({
8473
8740
  sourceType: CapabilitySourceTypeSchema,
8474
8741
  sourceId: ContractIdentifierSchema,
8475
8742
  ownerRepo: ContractIdentifierSchema
8476
8743
  }).strict();
8477
- var CapabilityRegistryEntrySchema = z6.object({
8744
+ var CapabilityRegistryEntrySchema = z7.object({
8478
8745
  manifest: CapabilityManifestSchema,
8479
- sources: z6.array(CapabilityRegistrySourceSchema).min(1)
8746
+ sources: z7.array(CapabilityRegistrySourceSchema).min(1)
8480
8747
  }).strict();
8481
- var CapabilityRegistryDocumentSchema = z6.object({
8482
- contract: z6.literal("CapabilityRegistry"),
8483
- entries: z6.array(CapabilityRegistryEntrySchema)
8748
+ var CapabilityRegistryDocumentSchema = z7.object({
8749
+ contract: z7.literal("CapabilityRegistry"),
8750
+ entries: z7.array(CapabilityRegistryEntrySchema)
8484
8751
  }).strict().superRefine((registry, context) => {
8485
8752
  const ids = /* @__PURE__ */ new Set();
8486
8753
  registry.entries.forEach((entry, index) => {
@@ -8496,65 +8763,65 @@ var CapabilityRegistryDocumentSchema = z6.object({
8496
8763
  });
8497
8764
 
8498
8765
  // src/contracts/data.ts
8499
- import { z as z7 } from "zod";
8500
- var SourceRecordRefSchema = z7.object({
8766
+ import { z as z8 } from "zod";
8767
+ var SourceRecordRefSchema = z8.object({
8501
8768
  sourceId: ContractIdentifierSchema,
8502
8769
  recordId: ContractIdentifierSchema,
8503
- recordVersion: z7.union([z7.number().int().nonnegative(), ContractIdentifierSchema]),
8770
+ recordVersion: z8.union([z8.number().int().nonnegative(), ContractIdentifierSchema]),
8504
8771
  hash: Sha256Schema
8505
8772
  }).strict();
8506
- var OntologyDefinitionSchema = z7.object({
8507
- contract: z7.literal("OntologyDefinition"),
8773
+ var OntologyDefinitionSchema = z8.object({
8774
+ contract: z8.literal("OntologyDefinition"),
8508
8775
  ontologyId: ContractIdentifierSchema,
8509
8776
  dataSpaceId: ContractIdentifierSchema,
8510
8777
  ownerRepo: ContractIdentifierSchema,
8511
8778
  bodySchemaRef: ContractIdentifierSchema,
8512
- authority: z7.object({
8779
+ authority: z8.object({
8513
8780
  service: ContractIdentifierSchema,
8514
8781
  storage: ContractIdentifierSchema,
8515
- scope: z7.enum(["tenant", "team", "user", "global"])
8782
+ scope: z8.enum(["tenant", "team", "user", "global"])
8516
8783
  }).strict(),
8517
- relationKinds: z7.array(ContractIdentifierSchema).default([]),
8518
- metricKinds: z7.array(ContractIdentifierSchema).default([])
8784
+ relationKinds: z8.array(ContractIdentifierSchema).default([]),
8785
+ metricKinds: z8.array(ContractIdentifierSchema).default([])
8519
8786
  }).strict();
8520
- var ProjectionSpecSchema = z7.object({
8521
- contract: z7.literal("ProjectionSpec"),
8787
+ var ProjectionSpecSchema = z8.object({
8788
+ contract: z8.literal("ProjectionSpec"),
8522
8789
  projectionId: ContractIdentifierSchema,
8523
- ontologyIds: z7.array(ContractIdentifierSchema).min(1),
8790
+ ontologyIds: z8.array(ContractIdentifierSchema).min(1),
8524
8791
  outputSchemaRef: ContractIdentifierSchema,
8525
- operator: z7.object({
8526
- kind: z7.enum(["query", "aggregate", "relationship", "search", "custom"]),
8527
- configuration: z7.record(z7.string(), JsonValueSchema).default({})
8792
+ operator: z8.object({
8793
+ kind: z8.enum(["query", "aggregate", "relationship", "search", "custom"]),
8794
+ configuration: z8.record(z8.string(), JsonValueSchema).default({})
8528
8795
  }).strict(),
8529
- materialization: z7.enum(["on-demand", "event-driven", "scheduled"]),
8530
- invalidationEvents: z7.array(ContractIdentifierSchema).default([]),
8531
- rebuildable: z7.literal(true),
8532
- lineagePolicy: z7.object({
8533
- sourceRecords: z7.boolean(),
8534
- bodyVersions: z7.boolean(),
8535
- runRefs: z7.boolean(),
8536
- actorRefs: z7.boolean()
8796
+ materialization: z8.enum(["on-demand", "event-driven", "scheduled"]),
8797
+ invalidationEvents: z8.array(ContractIdentifierSchema).default([]),
8798
+ rebuildable: z8.literal(true),
8799
+ lineagePolicy: z8.object({
8800
+ sourceRecords: z8.boolean(),
8801
+ bodyVersions: z8.boolean(),
8802
+ runRefs: z8.boolean(),
8803
+ actorRefs: z8.boolean()
8537
8804
  }).strict()
8538
8805
  }).strict();
8539
- var LineageRecordSchema = z7.object({
8540
- contract: z7.literal("LineageRecord"),
8806
+ var LineageRecordSchema = z8.object({
8807
+ contract: z8.literal("LineageRecord"),
8541
8808
  lineageId: ContractIdentifierSchema,
8542
8809
  subjectRef: EntityRefSchema,
8543
- sourceRecords: z7.array(SourceRecordRefSchema).default([]),
8544
- bodyRefs: z7.array(EntityRefSchema).default([]),
8545
- runRefs: z7.array(EntityRefSchema).default([]),
8546
- outputRefs: z7.array(EntityRefSchema).default([]),
8547
- artifactRefs: z7.array(EntityRefSchema).default([]),
8548
- actorRefs: z7.array(EntityRefSchema).default([]),
8549
- evidenceRefs: z7.array(EntityRefSchema).default([]),
8810
+ sourceRecords: z8.array(SourceRecordRefSchema).default([]),
8811
+ bodyRefs: z8.array(EntityRefSchema).default([]),
8812
+ runRefs: z8.array(EntityRefSchema).default([]),
8813
+ outputRefs: z8.array(EntityRefSchema).default([]),
8814
+ artifactRefs: z8.array(EntityRefSchema).default([]),
8815
+ actorRefs: z8.array(EntityRefSchema).default([]),
8816
+ evidenceRefs: z8.array(EntityRefSchema).default([]),
8550
8817
  recordedAt: IsoDateTimeSchema
8551
8818
  }).strict();
8552
- var DomainEventSchema = z7.object({
8553
- contract: z7.literal("DomainEvent"),
8819
+ var DomainEventSchema = z8.object({
8820
+ contract: z8.literal("DomainEvent"),
8554
8821
  eventId: ContractIdentifierSchema,
8555
8822
  eventType: ContractIdentifierSchema,
8556
8823
  aggregateRef: EntityRefSchema,
8557
- aggregateVersion: z7.number().int().nonnegative(),
8824
+ aggregateVersion: z8.number().int().nonnegative(),
8558
8825
  requestId: ContractIdentifierSchema,
8559
8826
  actorRef: EntityRefSchema,
8560
8827
  payload: JsonValueSchema,
@@ -8562,63 +8829,63 @@ var DomainEventSchema = z7.object({
8562
8829
  }).strict();
8563
8830
 
8564
8831
  // src/contracts/design-board.ts
8565
- import { z as z8 } from "zod";
8566
- var Id = z8.string().min(1).max(256);
8567
- var DesignBoardNodeKindSchema = z8.enum(["workflow", "instruction", "output", "live-image", "live-image-workflow", "linesheet-slot", "linesheet-table", "note", "other"]);
8568
- var DesignBoardNodeSchema = z8.object({
8832
+ import { z as z9 } from "zod";
8833
+ var Id = z9.string().min(1).max(256);
8834
+ var DesignBoardNodeKindSchema = z9.enum(["workflow", "instruction", "output", "live-image", "live-image-workflow", "linesheet-slot", "linesheet-table", "note", "other"]);
8835
+ var DesignBoardNodeSchema = z9.object({
8569
8836
  id: Id,
8570
8837
  pageId: Id,
8571
8838
  kind: DesignBoardNodeKindSchema,
8572
- title: z8.string().max(2e3),
8573
- x: z8.number().finite(),
8574
- y: z8.number().finite(),
8575
- width: z8.number().finite().positive(),
8576
- height: z8.number().finite().positive(),
8839
+ title: z9.string().max(2e3),
8840
+ x: z9.number().finite(),
8841
+ y: z9.number().finite(),
8842
+ width: z9.number().finite().positive(),
8843
+ height: z9.number().finite().positive(),
8577
8844
  props: JsonObjectSchema,
8578
8845
  meta: JsonObjectSchema,
8579
- deleted: z8.boolean().optional()
8846
+ deleted: z9.boolean().optional()
8580
8847
  }).strict();
8581
- var DesignBoardPageSchema = z8.object({ id: Id, name: z8.string().min(1).max(2e3), order: z8.number().int().nonnegative(), backgroundColor: z8.string().max(128).optional(), backgroundFileRef: z8.string().regex(/^file:\/\/[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/).optional() }).strict();
8582
- var DesignBoardConnectionSchema = z8.object({
8848
+ var DesignBoardPageSchema = z9.object({ id: Id, name: z9.string().min(1).max(2e3), order: z9.number().int().nonnegative(), backgroundColor: z9.string().max(128).optional(), backgroundFileRef: z9.string().regex(/^file:\/\/[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/).optional() }).strict();
8849
+ var DesignBoardConnectionSchema = z9.object({
8583
8850
  id: Id,
8584
8851
  pageId: Id,
8585
8852
  from: Id,
8586
8853
  to: Id,
8587
- label: z8.string().max(2e3).optional(),
8854
+ label: z9.string().max(2e3).optional(),
8588
8855
  kind: Id,
8589
8856
  props: JsonObjectSchema,
8590
- deleted: z8.boolean().optional()
8857
+ deleted: z9.boolean().optional()
8591
8858
  }).strict();
8592
- var DesignBoardFileSchema = z8.object({
8593
- canonicalUri: z8.string().regex(/^file:\/\/[A-Za-z0-9][A-Za-z0-9_-]{0,127}(?:#[A-Za-z0-9_-]+)?$/),
8859
+ var DesignBoardFileSchema = z9.object({
8860
+ canonicalUri: z9.string().regex(/^file:\/\/[A-Za-z0-9][A-Za-z0-9_-]{0,127}(?:#[A-Za-z0-9_-]+)?$/),
8594
8861
  fileId: Id.optional(),
8595
- mimeType: z8.string().min(1).max(128),
8596
- byteSize: z8.number().int().nonnegative().optional(),
8597
- contentHash: z8.string().optional(),
8862
+ mimeType: z9.string().min(1).max(128),
8863
+ byteSize: z9.number().int().nonnegative().optional(),
8864
+ contentHash: z9.string().optional(),
8598
8865
  role: Id
8599
8866
  }).strict();
8600
- var DesignBoardSceneElementSchema = z8.object({
8867
+ var DesignBoardSceneElementSchema = z9.object({
8601
8868
  id: Id,
8602
- type: z8.string().min(1),
8603
- x: z8.number().finite(),
8604
- y: z8.number().finite(),
8605
- width: z8.number().finite().nonnegative(),
8606
- height: z8.number().finite().nonnegative()
8869
+ type: z9.string().min(1),
8870
+ x: z9.number().finite(),
8871
+ y: z9.number().finite(),
8872
+ width: z9.number().finite().nonnegative(),
8873
+ height: z9.number().finite().nonnegative()
8607
8874
  }).catchall(JsonValueSchema);
8608
- var DesignBoardDomainSchema = z8.object({
8609
- schemaVersion: z8.literal(1),
8875
+ var DesignBoardDomainSchema = z9.object({
8876
+ schemaVersion: z9.literal(1),
8610
8877
  boardId: Id,
8611
8878
  projectId: Id.optional(),
8612
- revision: z8.number().int().nonnegative().optional(),
8613
- pages: z8.array(DesignBoardPageSchema).min(1).max(200),
8614
- nodes: z8.array(DesignBoardNodeSchema).max(1e4),
8615
- connections: z8.array(DesignBoardConnectionSchema).max(2e4),
8616
- files: z8.array(DesignBoardFileSchema).max(1e4)
8617
- }).strict();
8618
- var DesignBoardDocumentSchema = z8.object({
8619
- engine: z8.literal("excalidraw"),
8620
- schemaVersion: z8.literal(1),
8621
- document: z8.object({ elements: z8.array(DesignBoardSceneElementSchema).max(2e4), appState: JsonObjectSchema.optional(), files: z8.object({}).strict().optional() }).strict(),
8879
+ revision: z9.number().int().nonnegative().optional(),
8880
+ pages: z9.array(DesignBoardPageSchema).min(1).max(200),
8881
+ nodes: z9.array(DesignBoardNodeSchema).max(1e4),
8882
+ connections: z9.array(DesignBoardConnectionSchema).max(2e4),
8883
+ files: z9.array(DesignBoardFileSchema).max(1e4)
8884
+ }).strict();
8885
+ var DesignBoardDocumentSchema = z9.object({
8886
+ engine: z9.literal("excalidraw"),
8887
+ schemaVersion: z9.literal(1),
8888
+ document: z9.object({ elements: z9.array(DesignBoardSceneElementSchema).max(2e4), appState: JsonObjectSchema.optional(), files: z9.object({}).strict().optional() }).strict(),
8622
8889
  domain: DesignBoardDomainSchema
8623
8890
  }).strict().superRefine((document, context) => {
8624
8891
  const unique = (values, path2) => {
@@ -8645,279 +8912,66 @@ var DesignBoardDocumentSchema = z8.object({
8645
8912
  context.addIssue({ code: "custom", path: ["domain", "connections", index], message: "Connections cannot cross pages." });
8646
8913
  });
8647
8914
  });
8648
- var DesignBoardChangesSchema = z8.object({
8649
- pages: z8.array(DesignBoardPageSchema).max(200).optional(),
8915
+ var DesignBoardChangesSchema = z9.object({
8916
+ pages: z9.array(DesignBoardPageSchema).max(200).optional(),
8650
8917
  appState: JsonObjectSchema.optional(),
8651
- scenes: z8.array(z8.object({ pageId: Id, elements: z8.array(DesignBoardSceneElementSchema).max(2e4) }).strict()).max(200),
8652
- nodes: z8.array(DesignBoardNodeSchema).max(1e4),
8653
- removedNodeIds: z8.array(Id).max(1e4),
8654
- connections: z8.array(DesignBoardConnectionSchema).max(2e4),
8655
- removedConnectionIds: z8.array(Id).max(2e4),
8656
- files: z8.array(DesignBoardFileSchema).max(1e4),
8657
- removedFileUris: z8.array(z8.string()).max(1e4)
8658
- }).strict();
8659
- var DesignBoardCommitCommandSchema = z8.object({
8660
- contract: z8.literal("DesignBoardCommitCommand"),
8661
- schemaVersion: z8.literal(1),
8918
+ scenes: z9.array(z9.object({ pageId: Id, elements: z9.array(DesignBoardSceneElementSchema).max(2e4) }).strict()).max(200),
8919
+ nodes: z9.array(DesignBoardNodeSchema).max(1e4),
8920
+ removedNodeIds: z9.array(Id).max(1e4),
8921
+ connections: z9.array(DesignBoardConnectionSchema).max(2e4),
8922
+ removedConnectionIds: z9.array(Id).max(2e4),
8923
+ files: z9.array(DesignBoardFileSchema).max(1e4),
8924
+ removedFileUris: z9.array(z9.string()).max(1e4)
8925
+ }).strict();
8926
+ var DesignBoardCommitCommandSchema = z9.object({
8927
+ contract: z9.literal("DesignBoardCommitCommand"),
8928
+ schemaVersion: z9.literal(1),
8662
8929
  boardId: Id,
8663
- expectedRevision: z8.number().int().nonnegative(),
8930
+ expectedRevision: z9.number().int().nonnegative(),
8664
8931
  requestId: Id,
8665
8932
  changes: DesignBoardChangesSchema
8666
8933
  }).strict();
8667
8934
 
8668
8935
  // src/contracts/materialized-model.ts
8669
- import { z as z9 } from "zod";
8670
- var MaterializedModelBudgetSchema = z9.object({
8671
- maxRows: z9.number().int().min(1).max(1e4).default(1e3),
8672
- maxItems: z9.number().int().min(1).max(5e4).default(1e4),
8673
- maxNodes: z9.number().int().min(1).max(1e6).default(2e5),
8674
- maxBytes: z9.number().int().min(1024).max(16777216).default(8388608)
8936
+ import { z as z10 } from "zod";
8937
+ var MaterializedModelBudgetSchema = z10.object({
8938
+ maxRows: z10.number().int().min(1).max(1e4).default(1e3),
8939
+ maxItems: z10.number().int().min(1).max(5e4).default(1e4),
8940
+ maxNodes: z10.number().int().min(1).max(1e6).default(2e5),
8941
+ maxBytes: z10.number().int().min(1024).max(16777216).default(8388608)
8675
8942
  }).strict();
8676
8943
  var path = PageValuePathSchema;
8677
- var MaterializedModelProjectionSchema = z9.discriminatedUnion("kind", [
8678
- z9.object({
8679
- kind: z9.literal("value"),
8944
+ var MaterializedModelProjectionSchema = z10.discriminatedUnion("kind", [
8945
+ z10.object({
8946
+ kind: z10.literal("value"),
8680
8947
  path,
8681
8948
  budget: MaterializedModelBudgetSchema.prefault({})
8682
8949
  }).strict(),
8683
- z9.object({
8684
- kind: z9.literal("chunks"),
8950
+ z10.object({
8951
+ kind: z10.literal("chunks"),
8685
8952
  rowsPath: path.min(1),
8686
8953
  valuePath: path,
8687
8954
  modelPath: path,
8688
8955
  batchPath: path.min(1),
8689
8956
  indexPath: path.min(1),
8690
8957
  countPath: path.min(1),
8691
- collections: z9.array(z9.object({
8958
+ collections: z10.array(z10.object({
8692
8959
  path: path.min(1),
8693
8960
  totalPath: path.min(1),
8694
8961
  keyPath: path.min(1).optional()
8695
8962
  }).strict()).min(1).max(16),
8696
- pagination: z9.object({ maxPages: z9.number().int().min(1).max(100).default(32) }).strict().optional(),
8963
+ pagination: z10.object({ maxPages: z10.number().int().min(1).max(100).default(32) }).strict().optional(),
8697
8964
  budget: MaterializedModelBudgetSchema.prefault({})
8698
8965
  }).strict()
8699
8966
  ]);
8700
8967
 
8701
8968
  // src/contracts/legacy-route.ts
8702
- import { z as z10 } from "zod";
8703
- var LegacyRoutePolicySchema = z10.object({
8704
- contract: z10.literal("LegacyRoutePolicy"),
8705
- schemaVersion: z10.literal(1),
8706
- fallback: z10.enum(["allowed", "forbidden"]),
8707
- restoration: z10.enum(["allowed", "forbidden"])
8708
- }).strict();
8709
-
8710
- // src/contracts/file.ts
8711
8969
  import { z as z11 } from "zod";
8712
- var FILE_PURPOSES = [
8713
- "uploads",
8714
- "agent-attachments",
8715
- "agent-artifacts",
8716
- "agent-edited-images",
8717
- "agent-workbench",
8718
- "asset-screenshots",
8719
- "data-exports",
8720
- "data-feature-media",
8721
- "design-assets",
8722
- "design-board-thumbnails",
8723
- "design-images",
8724
- "dev-agent-reference-images",
8725
- "dev-agent-review-artifacts",
8726
- "external-delivery-techpacks",
8727
- "llm-generated-images",
8728
- "media-generated",
8729
- "media-uploads",
8730
- "model-training-files",
8731
- "models",
8732
- "models-checkpoints",
8733
- "models-clip",
8734
- "models-controlnet",
8735
- "models-diffusion-models",
8736
- "models-loras-test",
8737
- "models-vae",
8738
- "output-images",
8739
- "plugin-data-imports",
8740
- "plugin-runtime",
8741
- "plugin-runtime-outputs",
8742
- "step-thumbnails",
8743
- "techpack-design-intent",
8744
- "user-files-base",
8745
- "user-files-design-board-background",
8746
- "user-files-design-project-cover",
8747
- "user-files-designs",
8748
- "user-files-icons",
8749
- "user-files-import-comfyui-image",
8750
- "user-files-import-comfyui-json",
8751
- "user-files-import-comfyui-json-url",
8752
- "user-files-instruction-input",
8753
- "user-files-linesheet",
8754
- "user-files-media",
8755
- "user-files-other",
8756
- "user-files-prompt-assistant",
8757
- "user-files-table-data",
8758
- "user-files-techpack-attachments",
8759
- "user-files-text-data-file",
8760
- "user-files-workflow-input",
8761
- "workflow-image-mask",
8762
- "workflow-image-overlay",
8763
- "workflow-import"
8764
- ];
8765
- var FilePurposeSchema = z11.enum(FILE_PURPOSES);
8766
- var FileStatusSchema = z11.enum(["pending", "ready", "failed", "deleted"]);
8767
- var FileVariantStatusSchema = z11.enum(["queued", "processing", "ready", "failed"]);
8768
- var FILE_USAGE_OWNER_TYPES = [
8769
- "data-asset",
8770
- "data-export",
8771
- "design-board",
8772
- "external-delivery",
8773
- "kernel-runtime",
8774
- "llm-generated-media",
8775
- "model-training-media",
8776
- "plugin-run"
8777
- ];
8778
- var FileUsageOwnerTypeSchema = z11.enum(FILE_USAGE_OWNER_TYPES);
8779
- var FileUsageSchema = z11.object({
8780
- ownerType: FileUsageOwnerTypeSchema,
8781
- ownerId: ContractIdentifierSchema,
8782
- field: ContractIdentifierSchema.optional()
8783
- }).strict();
8784
- var FileReferenceSchema = z11.object({
8785
- id: ContractIdentifierSchema.optional(),
8786
- uri: z11.string().trim().min(1).optional(),
8787
- thumbnailUri: z11.string().trim().min(1).optional(),
8788
- mimeType: z11.string().trim().min(1).max(128).optional(),
8789
- byteSize: z11.number().int().nonnegative().optional(),
8790
- sha256: Sha256Schema.optional()
8791
- }).strict().refine((value) => Boolean(value.id || value.uri), {
8792
- message: "File reference requires id or uri"
8793
- });
8794
- var FileVariantSchema = z11.object({
8795
- variantId: ContractIdentifierSchema,
8796
- kind: z11.literal("thumbnail-512"),
8797
- status: FileVariantStatusSchema,
8798
- mimeType: z11.literal("image/webp"),
8799
- byteSize: z11.number().int().nonnegative().optional(),
8800
- width: z11.number().int().positive().optional(),
8801
- height: z11.number().int().positive().optional(),
8802
- uri: z11.string().trim().min(1).optional(),
8803
- errorCode: ContractIdentifierSchema.optional()
8804
- }).strict();
8805
- var FileRecordSchema = z11.object({
8806
- contract: z11.literal("FileRecord"),
8807
- contractVersion: z11.literal(1),
8808
- version: z11.number().int().positive(),
8809
- fileId: ContractIdentifierSchema,
8810
- teamId: ContractIdentifierSchema,
8811
- purpose: FilePurposeSchema,
8812
- originalName: z11.string().trim().min(1).max(255),
8813
- mimeType: z11.string().trim().min(1).max(128),
8814
- byteSize: z11.number().int().nonnegative().optional(),
8815
- sha256: Sha256Schema.optional(),
8816
- status: FileStatusSchema,
8817
- storage: z11.object({
8818
- bucketId: ContractIdentifierSchema,
8819
- objectKey: z11.string().trim().min(1).max(1024),
8820
- canonicalUri: z11.string().trim().min(1),
8821
- etag: z11.string().trim().min(1).optional()
8822
- }).strict(),
8823
- variants: z11.array(FileVariantSchema).default([]),
8824
- createdAt: IsoDateTimeSchema,
8825
- updatedAt: IsoDateTimeSchema
8826
- }).strict().superRefine((value, context) => {
8827
- if (value.storage.canonicalUri !== `file://${value.fileId}`) {
8828
- context.addIssue({
8829
- code: "custom",
8830
- path: ["storage", "canonicalUri"],
8831
- message: "Canonical file URI must match fileId"
8832
- });
8833
- }
8834
- });
8835
- var FileUploadCreateRequestSchema = z11.object({
8836
- purpose: FilePurposeSchema,
8837
- filename: z11.string().trim().min(1).max(255),
8838
- mimeType: z11.string().trim().min(1).max(128),
8839
- byteSize: z11.number().int().nonnegative().optional(),
8840
- sha256: Sha256Schema.optional(),
8841
- usage: FileUsageSchema.optional()
8842
- }).strict();
8843
- var FileUploadInstructionSchema = z11.object({
8844
- url: z11.union([
8845
- z11.string().url(),
8846
- z11.string().trim().regex(/^\/(?!\/)/, "Expected an absolute same-origin path")
8847
- ]),
8848
- method: z11.string().trim().min(1),
8849
- headers: z11.record(z11.string(), z11.string()),
8850
- expiresAt: IsoDateTimeSchema
8851
- }).strict();
8852
- var FileUploadCreateResponseSchema = z11.object({
8853
- file: FileRecordSchema,
8854
- upload: FileUploadInstructionSchema
8855
- }).strict();
8856
- var FileUploadCompleteRequestSchema = z11.object({
8857
- byteSize: z11.number().int().nonnegative().optional(),
8858
- sha256: Sha256Schema.optional(),
8859
- etag: z11.string().trim().min(1).max(512).optional()
8860
- }).strict();
8861
- var ResolvedFileSchema = z11.object({
8862
- fileId: ContractIdentifierSchema.optional(),
8863
- status: FileStatusSchema.optional(),
8864
- originalUri: z11.string().trim().min(1).optional(),
8865
- thumbnailUri: z11.string().trim().min(1).optional(),
8866
- mimeType: z11.string().trim().min(1).max(128).optional(),
8867
- byteSize: z11.number().int().nonnegative().optional(),
8868
- sha256: Sha256Schema.optional(),
8869
- unresolved: z11.boolean().optional()
8870
- }).strict();
8871
- var FileResolveBatchRequestSchema = z11.object({
8872
- references: z11.array(FileReferenceSchema).min(1).max(1e3),
8873
- includeOriginal: z11.boolean().default(false),
8874
- includeThumbnail: z11.boolean().default(true)
8875
- }).strict();
8876
- var FileResolveBatchResponseSchema = z11.object({
8877
- items: z11.array(ResolvedFileSchema)
8878
- }).strict();
8879
- var ManagedFileCommandTypeSchema = z11.enum([
8880
- "create-file",
8881
- "attach-usage",
8882
- "detach-usage",
8883
- "record-upload",
8884
- "verify-upload",
8885
- "delete-file"
8886
- ]);
8887
- var ManagedFileCommandSchema = z11.object({
8888
- contract: z11.literal("ManagedFileCommand"),
8889
- contractVersion: z11.literal(1),
8890
- commandId: ContractIdentifierSchema,
8891
- commandType: ManagedFileCommandTypeSchema,
8892
- fileId: ContractIdentifierSchema,
8893
- teamId: ContractIdentifierSchema,
8894
- expectedVersion: z11.number().int().nonnegative().optional(),
8895
- actorId: ContractIdentifierSchema.optional(),
8896
- payload: JsonObjectSchema.default({}),
8897
- issuedAt: IsoDateTimeSchema
8898
- }).strict();
8899
- var ManagedFileEventTypeSchema = z11.enum([
8900
- "file-created",
8901
- "file-usage-attached",
8902
- "file-usage-detached",
8903
- "storage-operation-queued",
8904
- "storage-operation-completed",
8905
- "storage-operation-failed",
8906
- "file-ready",
8907
- "file-deleted"
8908
- ]);
8909
- var ManagedFileEventSchema = z11.object({
8910
- contract: z11.literal("ManagedFileEvent"),
8911
- contractVersion: z11.literal(1),
8912
- eventId: ContractIdentifierSchema,
8913
- eventType: ManagedFileEventTypeSchema,
8914
- fileId: ContractIdentifierSchema,
8915
- teamId: ContractIdentifierSchema,
8916
- aggregateVersion: z11.number().int().positive(),
8917
- commandId: ContractIdentifierSchema,
8918
- actorId: ContractIdentifierSchema.optional(),
8919
- payload: JsonObjectSchema.default({}),
8920
- occurredAt: IsoDateTimeSchema
8970
+ var LegacyRoutePolicySchema = z11.object({
8971
+ contract: z11.literal("LegacyRoutePolicy"),
8972
+ schemaVersion: z11.literal(1),
8973
+ fallback: z11.enum(["allowed", "forbidden"]),
8974
+ restoration: z11.enum(["allowed", "forbidden"])
8921
8975
  }).strict();
8922
8976
 
8923
8977
  // src/contracts/page-binding-dependencies.ts
@@ -20172,6 +20226,31 @@ export {
20172
20226
  normalizeStudioAgentMode,
20173
20227
  normalizeAgentMode,
20174
20228
  normalizeAgentExecutionMode,
20229
+ FILE_PURPOSES,
20230
+ FilePurposeSchema,
20231
+ FileStatusSchema,
20232
+ FileVariantStatusSchema,
20233
+ FILE_USAGE_OWNER_TYPES,
20234
+ FileUsageOwnerTypeSchema,
20235
+ FileUsageSchema,
20236
+ ManagedFileUriSchema,
20237
+ FileReadInstructionSchema,
20238
+ FileResourcePathSchema,
20239
+ FileResourceManifestSchema,
20240
+ FileReferenceSchema,
20241
+ FileVariantSchema,
20242
+ FileRecordSchema,
20243
+ FileUploadCreateRequestSchema,
20244
+ FileUploadInstructionSchema,
20245
+ FileUploadCreateResponseSchema,
20246
+ FileUploadCompleteRequestSchema,
20247
+ ResolvedFileSchema,
20248
+ FileResolveBatchRequestSchema,
20249
+ FileResolveBatchResponseSchema,
20250
+ ManagedFileCommandTypeSchema,
20251
+ ManagedFileCommandSchema,
20252
+ ManagedFileEventTypeSchema,
20253
+ ManagedFileEventSchema,
20175
20254
  PageMemberSchema,
20176
20255
  PageValuePathSchema,
20177
20256
  PageExpressionRootSchema,
@@ -20228,27 +20307,6 @@ export {
20228
20307
  MaterializedModelBudgetSchema,
20229
20308
  MaterializedModelProjectionSchema,
20230
20309
  LegacyRoutePolicySchema,
20231
- FILE_PURPOSES,
20232
- FilePurposeSchema,
20233
- FileStatusSchema,
20234
- FileVariantStatusSchema,
20235
- FILE_USAGE_OWNER_TYPES,
20236
- FileUsageOwnerTypeSchema,
20237
- FileUsageSchema,
20238
- FileReferenceSchema,
20239
- FileVariantSchema,
20240
- FileRecordSchema,
20241
- FileUploadCreateRequestSchema,
20242
- FileUploadInstructionSchema,
20243
- FileUploadCreateResponseSchema,
20244
- FileUploadCompleteRequestSchema,
20245
- ResolvedFileSchema,
20246
- FileResolveBatchRequestSchema,
20247
- FileResolveBatchResponseSchema,
20248
- ManagedFileCommandTypeSchema,
20249
- ManagedFileCommandSchema,
20250
- ManagedFileEventTypeSchema,
20251
- ManagedFileEventSchema,
20252
20310
  analyzePageBindingDependencies,
20253
20311
  DeclarativeDiagnosticStageSchema,
20254
20312
  DeclarativeDiagnosticSchema,
@@ -20608,4 +20666,4 @@ export {
20608
20666
  RecordEditorValidationDetailsSchema,
20609
20667
  RecordEditorSubmissionSnapshotSchema
20610
20668
  };
20611
- //# sourceMappingURL=chunk-QCNO3BPY.mjs.map
20669
+ //# sourceMappingURL=chunk-XUWZH2H3.mjs.map