@treeseed/sdk 0.13.0-rc.121 → 0.13.0-rc.123

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 (157) hide show
  1. package/dist/agent-capacity/contracts/capacity/assignments/agent-execution.d.ts +2365 -1275
  2. package/dist/agent-capacity/contracts/capacity/assignments/agent-execution.js +94 -28
  3. package/dist/agent-capacity/contracts/capacity/assignments/assignment-context-pack.d.ts +38 -38
  4. package/dist/agent-capacity/contracts/capacity/assignments/assignment-path.d.ts +2 -0
  5. package/dist/agent-capacity/contracts/capacity/assignments/assignment-path.js +13 -0
  6. package/dist/agent-capacity/contracts/capacity/assignments/assignment-records.d.ts +2 -59
  7. package/dist/agent-capacity/contracts/capacity/providers/supply-policy.d.ts +126 -1
  8. package/dist/agent-capacity/contracts/capacity/providers/supply-policy.js +35 -1
  9. package/dist/agent-capacity/contracts/capacity/workdays/assignment-allocation.d.ts +2 -4
  10. package/dist/agent-capacity/contracts/capacity/workdays/assignment-allocation.js +22 -16
  11. package/dist/agent-capacity/contracts/capacity/workdays/capability-accounting.d.ts +3 -42
  12. package/dist/agent-capacity/contracts/capacity/workdays/capability-accounting.js +8 -8
  13. package/dist/agent-capacity/contracts/capacity/workdays/workday-allocation.d.ts +244 -85
  14. package/dist/agent-capacity/contracts/capacity/workdays/workday-allocation.js +54 -19
  15. package/dist/agent-capacity/contracts/capacity/workdays/workday-records.d.ts +216 -70
  16. package/dist/agent-capacity/contracts/capacity/workdays/workday-records.js +19 -0
  17. package/dist/agent-capacity/contracts/configuration/configuration.d.ts +1 -1
  18. package/dist/agent-capacity/contracts/configuration/configuration.js +0 -2
  19. package/dist/agent-capacity/contracts/operations/agent-team-clone.d.ts +55 -55
  20. package/dist/agent-capacity/contracts/projects/agents/project-agent-class.d.ts +119 -23
  21. package/dist/agent-capacity/contracts/projects/agents/project-agent-class.js +16 -0
  22. package/dist/agent-capacity/contracts/runtime/runtime-observability.d.ts +2 -154
  23. package/dist/agent-capacity/contracts/support/agent-atlas.d.ts +0 -13
  24. package/dist/agent-capacity/contracts/support/execution-graph.d.ts +496 -292
  25. package/dist/agent-capacity/contracts/support/execution-graph.js +21 -19
  26. package/dist/agent-capacity/contracts/support/financial-records.d.ts +3 -6
  27. package/dist/agent-capacity/contracts/support/planning-records.d.ts +1 -87
  28. package/dist/agent-capacity/grant.d.ts +34 -0
  29. package/dist/agent-capacity/grant.js +4 -0
  30. package/dist/agent-capacity/validation/agent-definition-schema.d.ts +1178 -1152
  31. package/dist/agent-capacity/validation/agent-definition-schema.js +21 -28
  32. package/dist/agent-capacity/validation/agent-lab-forensics-schema.d.ts +10 -10
  33. package/dist/agent-capacity/validation/agent-lab-forensics-schema.js +0 -1
  34. package/dist/agent-capacity/validation/assignment-records.d.ts +1 -6
  35. package/dist/agent-capacity/validation/assignment-records.js +49 -35
  36. package/dist/agent-capacity/validation/configuration.d.ts +1 -1
  37. package/dist/agent-capacity/validation/configuration.js +2 -6
  38. package/dist/agent-capacity/validation/grant.d.ts +11 -0
  39. package/dist/agent-capacity/validation/grant.js +31 -0
  40. package/dist/capacity/agents/agent-capacity.d.ts +3 -4
  41. package/dist/capacity/agents/agent-capacity.js +2 -3
  42. package/dist/capacity-provider/capability-ontology.d.ts +150 -150
  43. package/dist/capacity-provider/client.d.ts +15 -9
  44. package/dist/capacity-provider/client.js +1 -10
  45. package/dist/capacity-provider/contracts/capacity-facts.d.ts +0 -1
  46. package/dist/capacity-provider/contracts/environment-profiles.d.ts +44 -44
  47. package/dist/capacity-provider/contracts/governance.d.ts +2 -17
  48. package/dist/capacity-provider/contracts/index.d.ts +2 -0
  49. package/dist/capacity-provider/contracts/index.js +2 -0
  50. package/dist/capacity-provider/core-capability-catalog.d.ts +7 -7
  51. package/dist/capacity-provider/environment-catalog.d.ts +188 -188
  52. package/dist/capacity-provider/environment-catalog.js +1 -1
  53. package/dist/capacity-provider/install-configuration.d.ts +2 -2
  54. package/dist/capacity-provider/sandbox-contracts.d.ts +92 -92
  55. package/dist/capacity-provider/source-workspace.d.ts +166 -68
  56. package/dist/capacity-provider/source-workspace.js +5 -1
  57. package/dist/capacity-provider/validation.d.ts +10 -2
  58. package/dist/capacity-provider/validation.js +52 -22
  59. package/dist/content/validation/agent-operational-content-schemas.d.ts +144 -142
  60. package/dist/content/validation/agent-operational-content-schemas.js +2 -0
  61. package/dist/content/validation/auxiliary-content-schemas.d.ts +158 -158
  62. package/dist/content/validation/content-model-schemas.d.ts +9105 -5295
  63. package/dist/content/validation/content-model-schemas.js +192 -115
  64. package/dist/content/validation/portable-content-data.d.ts +411 -238
  65. package/dist/content/validation/portable-content-data.js +6 -1
  66. package/dist/content/validation/schema-constraints.d.ts +78 -0
  67. package/dist/content/validation/schema-constraints.js +149 -0
  68. package/dist/deployment/ai/storage.d.ts +24 -24
  69. package/dist/deployment/ai-hosting.d.ts +18 -18
  70. package/dist/deployment/ai-instance.d.ts +16 -16
  71. package/dist/deployment/ai-mode.d.ts +92 -92
  72. package/dist/deployment/hosted-topology-template.d.ts +44 -44
  73. package/dist/deployment/hosted-topology.d.ts +335 -335
  74. package/dist/deployment/postgres/contracts.d.ts +52 -52
  75. package/dist/deployment/postgres/transfer.d.ts +6 -6
  76. package/dist/deployment/schemas.d.ts +1114 -1114
  77. package/dist/development/schemas.d.ts +633 -633
  78. package/dist/graph/context-query-contracts.js +1 -1
  79. package/dist/guarantees/index.d.ts +26 -2
  80. package/dist/identity/contracts.js +6 -1
  81. package/dist/knowledge/contracts.d.ts +9 -2
  82. package/dist/knowledge/contracts.js +2 -2
  83. package/dist/model-registry/discussion-models.js +0 -1
  84. package/dist/operator-contracts/canonical-command-tree.js +25 -9
  85. package/dist/operator-contracts/catalog/agents/agent-team-clone-operations.d.ts +29 -29
  86. package/dist/operator-contracts/catalog/capability-ontology-operations.d.ts +30 -30
  87. package/dist/operator-contracts/catalog/commands/command-tree-builders.d.ts +15 -13
  88. package/dist/operator-contracts/catalog/communication-operations.d.ts +176 -158
  89. package/dist/operator-contracts/catalog/hosted-topology-operations.d.ts +67 -67
  90. package/dist/operator-contracts/catalog/inbox-operations.d.ts +65 -65
  91. package/dist/operator-contracts/catalog/infrastructure/ai-instance-operations.d.ts +6 -6
  92. package/dist/operator-contracts/catalog/infrastructure/ai-instance-operations.js +2 -1
  93. package/dist/operator-contracts/catalog/knowledge-share-operations.d.ts +10 -10
  94. package/dist/operator-contracts/catalog/provider-environment-operations.d.ts +3 -3
  95. package/dist/operator-contracts/catalog/services/secret-operations.d.ts +16 -8
  96. package/dist/operator-contracts/catalog/services/secret-operations.js +2 -1
  97. package/dist/operator-contracts/catalog/workdays/profile-operations.d.ts +11 -11
  98. package/dist/operator-contracts/catalog/workdays/selection-commands.js +3 -0
  99. package/dist/operator-contracts/communication/contracts.d.ts +537 -395
  100. package/dist/operator-contracts/communication/contracts.js +6 -1
  101. package/dist/operator-contracts/control-plane-operation.d.ts +7 -0
  102. package/dist/operator-contracts/control-plane-operation.js +6 -0
  103. package/dist/operator-contracts/control-plane-operations.d.ts +631 -610
  104. package/dist/operator-contracts/control-plane-operations.js +26 -12
  105. package/dist/operator-contracts/inbox/contracts.d.ts +229 -229
  106. package/dist/operator-contracts/knowledge/contracts.d.ts +16 -16
  107. package/dist/operator-contracts/mcp.js +4 -3
  108. package/dist/operator-contracts/workday-lifecycle.d.ts +192 -0
  109. package/dist/operator-contracts/workday-lifecycle.js +109 -45
  110. package/dist/platform/agent-schema-verification.d.ts +3 -0
  111. package/dist/platform/agent-schema-verification.js +377 -0
  112. package/dist/platform/contracts.d.ts +72 -72
  113. package/dist/platform/schemas.d.ts +144 -36
  114. package/dist/platform/schemas.js +26 -0
  115. package/dist/platform/verification.js +10 -0
  116. package/dist/sdk-types/support/planning-policy.d.ts +1 -1
  117. package/dist/sdk-types/support/sdk-search-request.d.ts +2 -2
  118. package/dist/secrets-capability/secret-contracts.d.ts +2 -2
  119. package/dist/secrets-capability/shared-access.d.ts +3 -3
  120. package/dist/secrets-capability/shared-resources.d.ts +50 -50
  121. package/dist/secrets-capability/vault-contracts.d.ts +2 -2
  122. package/dist/security/encrypted-envelope.d.ts +14 -14
  123. package/dist/treedx/client.d.ts +4 -4
  124. package/dist/treedx/index.d.ts +1 -1
  125. package/dist/treedx/index.js +1 -0
  126. package/dist/treedx/types.d.ts +286 -0
  127. package/dist/treedx/types.js +44 -0
  128. package/guarantees/agent/golden/component-boundaries.guarantee.yaml +12 -0
  129. package/guarantees/agent/golden/product-custody.guarantee.yaml +12 -0
  130. package/guarantees/agent/golden/product.guarantee.yaml +12 -0
  131. package/guarantees/agent/golden/scenes/component-boundaries.scene.yaml +837 -0
  132. package/guarantees/agent/golden/scenes/product-custody.scene.yaml +53 -0
  133. package/guarantees/agent/golden/scenes/product.scene.yaml +8 -0
  134. package/guarantees/verifiers/golden.verifiers.yaml +1429 -0
  135. package/package.json +9 -3
  136. package/tests/acceptance/golden-product.test.ts +205 -0
  137. package/tests/acceptance/golden-product.ts +404 -0
  138. package/tests/acceptance/product/base-red.ts +73 -0
  139. package/tests/acceptance/product/documentation-examples.ts +68 -0
  140. package/tests/acceptance/product/intent-runtime.ts +145 -0
  141. package/tests/acceptance/product/release-output.ts +160 -0
  142. package/tests/acceptance/product/research-artifact.ts +87 -0
  143. package/tests/acceptance/product/research-revision.ts +82 -0
  144. package/tests/acceptance/product/research-source.ts +91 -0
  145. package/tests/acceptance/product/test-chain.ts +192 -0
  146. package/treeseed.package.yaml +147 -0
  147. package/dist/.treeseed-build-complete.json +0 -1
  148. package/dist/agent-capacity/allocation.d.ts +0 -183
  149. package/dist/agent-capacity/allocation.js +0 -5
  150. package/dist/agent-capacity/artifact-mutation-receipt.d.ts +0 -49
  151. package/dist/agent-capacity/artifact-mutation-receipt.js +0 -36
  152. package/dist/agent-capacity/artifacts.d.ts +0 -123
  153. package/dist/agent-capacity/artifacts.js +0 -39
  154. package/dist/agent-capacity/contracts/support/decision-work.d.ts +0 -227
  155. package/dist/agent-capacity/contracts/support/decision-work.js +0 -0
  156. package/dist/agent-capacity/validation/allocation.d.ts +0 -12
  157. package/dist/agent-capacity/validation/allocation.js +0 -115
@@ -13,7 +13,12 @@ const registryIndependentModels = /* @__PURE__ */ new Set([
13
13
  "proposal",
14
14
  "decision",
15
15
  "question",
16
- "note"
16
+ "note",
17
+ "book",
18
+ "knowledge",
19
+ "objective",
20
+ "discussion",
21
+ "discussion_message"
17
22
  ]);
18
23
  class PortableContentValidationError extends Error {
19
24
  constructor(details) {
@@ -0,0 +1,78 @@
1
+ import { z } from 'zod';
2
+ import { type PostProcessCallback } from 'zod-to-json-schema';
3
+ /** Preserve inherited validation while requiring represented properties. */
4
+ export declare function requiredProperties<T extends z.AnyZodObject>(object: T, fields: readonly string[], message: string): z.ZodEffects<T, {
5
+ [x: string]: any;
6
+ }, {
7
+ [x: string]: any;
8
+ }>;
9
+ export declare function uniqueArray<T extends z.ZodTypeAny>(array: z.ZodArray<T>): z.ZodEffects<z.ZodArray<T, "many">, T["_output"][], T["_input"][]>;
10
+ /** Count represented properties once for both validation and schema export. */
11
+ export declare function minimumProperties<T extends z.ZodTypeAny>(object: T, minimum: number, message: string): z.ZodEffects<T, z.output<T>, z.input<T>>;
12
+ /** A represented selector, not a mode-only object, is required. */
13
+ export declare function alternativeProperties<T extends z.AnyZodObject>(object: T, fields: readonly string[]): z.ZodEffects<T, {
14
+ [x: string]: any;
15
+ }, {
16
+ [x: string]: any;
17
+ }>;
18
+ export declare function exclusiveProperties<T extends z.ZodTypeAny>(object: T, fields: readonly string[]): z.ZodEffects<T, any, any>;
19
+ /** Exactly one actual branch must accept; retain overlap denial in the export. */
20
+ export declare function exclusiveUnion<T extends z.ZodUnion<[z.ZodTypeAny, ...z.ZodTypeAny[]]>>(union: T): z.ZodEffects<T, any, any>;
21
+ type ForbiddenFields<Field extends string> = {
22
+ fields: readonly Field[];
23
+ conditions?: readonly {
24
+ field: Field;
25
+ equals: unknown;
26
+ }[];
27
+ };
28
+ type ConditionalRequirement<Field extends string> = {
29
+ field: Field;
30
+ equals?: unknown;
31
+ notEquals?: unknown;
32
+ in?: readonly unknown[];
33
+ message: string;
34
+ path?: readonly (string | number)[];
35
+ } & ({
36
+ alternatives: readonly (readonly Field[])[];
37
+ forbidden?: ForbiddenFields<Field>;
38
+ allowed?: never;
39
+ contains?: never;
40
+ items?: {
41
+ field: Field;
42
+ key: string;
43
+ required: readonly string[];
44
+ conditional?: {
45
+ field: string;
46
+ equals: unknown;
47
+ required: readonly string[];
48
+ };
49
+ };
50
+ } | {
51
+ alternatives?: never;
52
+ forbidden: {
53
+ field: Field;
54
+ key: string;
55
+ } | ForbiddenFields<Field>;
56
+ allowed?: never;
57
+ contains?: never;
58
+ } | {
59
+ alternatives?: never;
60
+ forbidden?: never;
61
+ allowed: {
62
+ field: Field;
63
+ values: readonly unknown[];
64
+ };
65
+ contains?: never;
66
+ } | {
67
+ alternatives?: never;
68
+ forbidden?: never;
69
+ allowed?: never;
70
+ contains: {
71
+ field: Field;
72
+ properties: Readonly<Record<string, unknown>>;
73
+ };
74
+ });
75
+ /** The same owning field rules drive runtime validation and schema export. */
76
+ export declare function conditionalFields<T extends z.AnyZodObject>(object: T, rules: readonly ConditionalRequirement<keyof z.infer<NoInfer<T>> & string>[]): z.ZodEffects<T, z.output<T>, z.input<T>>;
77
+ export declare const exportSchemaConstraints: PostProcessCallback;
78
+ export {};
@@ -0,0 +1,149 @@
1
+ import { z } from "zod";
2
+ import { zodToJsonSchema } from "zod-to-json-schema";
3
+ const exporters = /* @__PURE__ */ new WeakMap();
4
+ function requiredProperties(object, fields, message) {
5
+ const schema = object.superRefine((value, context) => {
6
+ for (const field of fields) if (Object.getOwnPropertyDescriptor(value, field)?.value === void 0)
7
+ context.addIssue({ code: z.ZodIssueCode.custom, path: [field], message });
8
+ });
9
+ exporters.set(schema._def, (exported) => {
10
+ if (!("type" in exported) || exported.type !== "object") throw new Error("Required properties must export an object schema.");
11
+ const required = "required" in exported && Array.isArray(exported.required) ? exported.required : [];
12
+ return { ...exported, required: [.../* @__PURE__ */ new Set([...fields, ...required])] };
13
+ });
14
+ return schema;
15
+ }
16
+ function uniqueArray(array) {
17
+ const schema = array.superRefine((values, context) => {
18
+ if (new Set(values.map((value) => JSON.stringify(value))).size !== values.length) {
19
+ context.addIssue({ code: z.ZodIssueCode.custom, message: "Values must be unique." });
20
+ }
21
+ });
22
+ exporters.set(schema._def, (exported) => {
23
+ if (!("type" in exported) || exported.type !== "array") throw new Error("The unique-array validator must export an array schema.");
24
+ return { ...exported, uniqueItems: true };
25
+ });
26
+ return schema;
27
+ }
28
+ function minimumProperties(object, minimum, message) {
29
+ const schema = object.superRefine((value, context) => {
30
+ if (Object.values(value).filter((entry) => entry !== void 0).length < minimum) {
31
+ context.addIssue({ code: z.ZodIssueCode.custom, message });
32
+ }
33
+ });
34
+ exporters.set(schema._def, (exported) => {
35
+ if (!("type" in exported) || exported.type !== "object") throw new Error("Property bounds must export an object schema.");
36
+ return { ...exported, minProperties: minimum };
37
+ });
38
+ return schema;
39
+ }
40
+ function alternativeProperties(object, fields) {
41
+ const schema = object.superRefine((value, context) => {
42
+ if (!fields.some((field) => Object.getOwnPropertyDescriptor(value, field)?.value !== void 0))
43
+ context.addIssue({ code: z.ZodIssueCode.custom, message: "At least one selector is required." });
44
+ });
45
+ exporters.set(schema._def, (exported) => ({ ...exported, anyOf: fields.map((field) => ({ required: [field] })) }));
46
+ return schema;
47
+ }
48
+ function exclusiveProperties(object, fields) {
49
+ const schema = object.superRefine((value, context) => {
50
+ if (fields.every((field) => Object.getOwnPropertyDescriptor(value, field)?.value !== void 0))
51
+ context.addIssue({ code: z.ZodIssueCode.custom, path: [fields[0]], message: "Specify only one alternative." });
52
+ });
53
+ exporters.set(schema._def, (exported) => ({ ...exported, not: { required: [...fields] } }));
54
+ return schema;
55
+ }
56
+ function exclusiveUnion(union) {
57
+ const schema = union.superRefine((value, context) => {
58
+ if (union.options.filter((branch) => branch.safeParse(value).success).length !== 1)
59
+ context.addIssue({ code: z.ZodIssueCode.custom, message: "Exactly one union branch must accept." });
60
+ });
61
+ exporters.set(schema._def, (exported) => {
62
+ if (!("anyOf" in exported)) throw new Error("Exclusive union must export its actual branches.");
63
+ const { anyOf, ...rest } = exported;
64
+ return { ...rest, oneOf: anyOf };
65
+ });
66
+ return schema;
67
+ }
68
+ function conditionalFields(object, rules) {
69
+ const schema = object.superRefine((value, context) => {
70
+ for (const rule of rules) {
71
+ const selected = Object.getOwnPropertyDescriptor(value, rule.field)?.value;
72
+ if (selected === void 0 || Object.hasOwn(rule, "equals") && selected !== rule.equals) continue;
73
+ if (Object.hasOwn(rule, "notEquals") && selected === rule.notEquals) continue;
74
+ if (rule.in && !rule.in.includes(selected)) continue;
75
+ const nested = rule.forbidden && "field" in rule.forbidden ? Object.getOwnPropertyDescriptor(value, rule.forbidden.field)?.value : void 0;
76
+ const entries = rule.contains ? Object.getOwnPropertyDescriptor(value, rule.contains.field)?.value : void 0;
77
+ const forbidden = rule.forbidden ? "fields" in rule.forbidden ? rule.forbidden.fields.some((field) => Object.getOwnPropertyDescriptor(value, field)?.value !== void 0) || Boolean(rule.forbidden.conditions?.some((condition) => Object.getOwnPropertyDescriptor(value, condition.field)?.value === condition.equals)) : nested && typeof nested === "object" && Object.getOwnPropertyDescriptor(nested, rule.forbidden.key)?.value !== void 0 : false;
78
+ const invalid = forbidden || (rule.alternatives ? !rule.alternatives.some((fields) => fields.every((field) => Object.getOwnPropertyDescriptor(value, field)?.value !== void 0)) : rule.allowed ? !rule.allowed.values.includes(Object.getOwnPropertyDescriptor(value, rule.allowed.field)?.value) : rule.contains ? !Array.isArray(entries) || !entries.some((entry) => entry && typeof entry === "object" && Object.entries(rule.contains.properties).every(([key, expected]) => Object.getOwnPropertyDescriptor(entry, key)?.value === expected)) : false);
79
+ if (invalid) {
80
+ context.addIssue({ code: z.ZodIssueCode.custom, path: [...rule.path ?? []], message: rule.message });
81
+ }
82
+ const requirement = "items" in rule ? rule.items : void 0;
83
+ if (requirement) {
84
+ const parent = Object.getOwnPropertyDescriptor(value, requirement.field)?.value;
85
+ const children = parent && typeof parent === "object" ? Object.getOwnPropertyDescriptor(parent, requirement.key)?.value : void 0;
86
+ if (Array.isArray(children)) for (const [index, child] of children.entries()) {
87
+ if (!child || typeof child !== "object") continue;
88
+ const conditional = requirement.conditional;
89
+ const fields = [...requirement.required, ...conditional && Object.getOwnPropertyDescriptor(child, conditional.field)?.value === conditional.equals ? conditional.required : []];
90
+ for (const field of fields) if (Object.getOwnPropertyDescriptor(child, field)?.value === void 0)
91
+ context.addIssue({ code: z.ZodIssueCode.custom, path: [requirement.field, requirement.key, index, field], message: rule.message });
92
+ }
93
+ }
94
+ }
95
+ });
96
+ exporters.set(schema._def, (exported) => {
97
+ if (!("type" in exported) || exported.type !== "object") throw new Error("Conditional fields must export an object schema.");
98
+ const required = (fields) => ({ type: "object", required: [...fields] });
99
+ const forbidden = (fields) => ({ type: "object", anyOf: [
100
+ ...fields.fields.map((field) => required([field])),
101
+ ...(fields.conditions ?? []).map((condition) => ({ ...required([condition.field]), properties: { [condition.field]: { const: condition.equals } } }))
102
+ ] });
103
+ return { ...exported, allOf: rules.map((rule) => ({
104
+ if: { ...required([rule.field]), ...Object.hasOwn(rule, "equals") ? { properties: { [rule.field]: { const: rule.equals } } } : Object.hasOwn(rule, "notEquals") ? { properties: { [rule.field]: { not: { const: rule.notEquals } } } } : rule.in ? { properties: { [rule.field]: { enum: [...rule.in] } } } : {} },
105
+ then: rule.alternatives && rule.forbidden ? {
106
+ ...rule.alternatives.length === 1 ? required(rule.alternatives[0]) : { type: "object", anyOf: rule.alternatives.map(required) },
107
+ not: forbidden(rule.forbidden)
108
+ } : rule.forbidden ? "fields" in rule.forbidden ? { type: "object", not: forbidden(rule.forbidden) } : { type: "object", properties: { [rule.forbidden.field]: { not: required([rule.forbidden.key]) } } } : rule.allowed ? { type: "object", properties: { [rule.allowed.field]: { enum: [...rule.allowed.values] } } } : rule.contains ? { type: "object", properties: { [rule.contains.field]: { type: "array", contains: {
109
+ ...required(Object.keys(rule.contains.properties)),
110
+ properties: Object.fromEntries(Object.entries(rule.contains.properties).map(([key, value]) => [key, { const: value }]))
111
+ } } } } : rule.alternatives.length === 1 ? { ...required(rule.alternatives[0]), ...rule.items ? { properties: {
112
+ [rule.items.field]: { type: "object", properties: { [rule.items.key]: { type: "array", items: {
113
+ ...required(rule.items.required),
114
+ ...rule.items.conditional ? { allOf: [{
115
+ if: { properties: { [rule.items.conditional.field]: { const: rule.items.conditional.equals } }, required: [rule.items.conditional.field] },
116
+ then: { required: [...rule.items.conditional.required] }
117
+ }] } : {}
118
+ } } } }
119
+ } } : {} } : { type: "object", anyOf: rule.alternatives.map(required) }
120
+ })) };
121
+ });
122
+ return schema;
123
+ }
124
+ const exportSchemaConstraints = (schema, definition) => {
125
+ if ("typeName" in definition && definition.typeName === z.ZodFirstPartyTypeKind.ZodIntersection && "left" in definition && "right" in definition && definition.left instanceof z.ZodType && definition.right instanceof z.ZodType) {
126
+ return { allOf: [definition.left, definition.right].map((part) => {
127
+ const { $schema: _dialect, ...branch } = zodToJsonSchema(part, { $refStrategy: "none", postProcess: exportSchemaConstraints });
128
+ return branch;
129
+ }) };
130
+ }
131
+ const exportConstraint = exporters.get(definition);
132
+ if (!exportConstraint) {
133
+ if (schema && "pattern" in schema && typeof schema.pattern === "string")
134
+ return { ...schema, pattern: schema.pattern.replace(/\\\//gu, "/") };
135
+ return schema;
136
+ }
137
+ if (!schema) throw new Error("An owning constraint has no exported schema.");
138
+ return exportConstraint(schema);
139
+ };
140
+ export {
141
+ alternativeProperties,
142
+ conditionalFields,
143
+ exclusiveProperties,
144
+ exclusiveUnion,
145
+ exportSchemaConstraints,
146
+ minimumProperties,
147
+ requiredProperties,
148
+ uniqueArray
149
+ };
@@ -4,11 +4,11 @@ export declare const aiStorageBindingSchema: z.ZodObject<{
4
4
  connectionId: z.ZodString;
5
5
  bucket: z.ZodString;
6
6
  }, "strict", z.ZodTypeAny, {
7
- connectionId: string;
8
7
  bucket: string;
9
- }, {
10
8
  connectionId: string;
9
+ }, {
11
10
  bucket: string;
11
+ connectionId: string;
12
12
  }>;
13
13
  export declare const aiStorageProofSchema: z.ZodEffects<z.ZodObject<{
14
14
  schemaVersion: z.ZodLiteral<"treeseed.ai-storage-proof/v1">;
@@ -26,44 +26,44 @@ export declare const aiStorageProofSchema: z.ZodEffects<z.ZodObject<{
26
26
  nonce: string;
27
27
  schemaVersion: "treeseed.ai-storage-proof/v1";
28
28
  key: string;
29
- action: "read" | "write" | "list" | "delete";
30
- projectId: string;
31
29
  teamId: string;
30
+ projectId: string;
32
31
  issuedAt: number;
33
32
  nodeId: string;
33
+ action: "read" | "list" | "write" | "delete";
34
34
  storeId: "managed-inference" | "managed-training" | "managed-lab";
35
35
  }, {
36
36
  service: "inference" | "training" | "lab";
37
37
  nonce: string;
38
38
  schemaVersion: "treeseed.ai-storage-proof/v1";
39
39
  key: string;
40
- action: "read" | "write" | "list" | "delete";
41
- projectId: string;
42
40
  teamId: string;
41
+ projectId: string;
43
42
  issuedAt: number;
44
43
  nodeId: string;
44
+ action: "read" | "list" | "write" | "delete";
45
45
  storeId: "managed-inference" | "managed-training" | "managed-lab";
46
46
  }>, {
47
47
  service: "inference" | "training" | "lab";
48
48
  nonce: string;
49
49
  schemaVersion: "treeseed.ai-storage-proof/v1";
50
50
  key: string;
51
- action: "read" | "write" | "list" | "delete";
52
- projectId: string;
53
51
  teamId: string;
52
+ projectId: string;
54
53
  issuedAt: number;
55
54
  nodeId: string;
55
+ action: "read" | "list" | "write" | "delete";
56
56
  storeId: "managed-inference" | "managed-training" | "managed-lab";
57
57
  }, {
58
58
  service: "inference" | "training" | "lab";
59
59
  nonce: string;
60
60
  schemaVersion: "treeseed.ai-storage-proof/v1";
61
61
  key: string;
62
- action: "read" | "write" | "list" | "delete";
63
- projectId: string;
64
62
  teamId: string;
63
+ projectId: string;
65
64
  issuedAt: number;
66
65
  nodeId: string;
66
+ action: "read" | "list" | "write" | "delete";
67
67
  storeId: "managed-inference" | "managed-training" | "managed-lab";
68
68
  }>;
69
69
  export type AiStorageProof = z.infer<typeof aiStorageProofSchema>;
@@ -84,75 +84,75 @@ export declare const aiStorageRequestSchema: z.ZodObject<{
84
84
  nonce: string;
85
85
  schemaVersion: "treeseed.ai-storage-proof/v1";
86
86
  key: string;
87
- action: "read" | "write" | "list" | "delete";
88
- projectId: string;
89
87
  teamId: string;
88
+ projectId: string;
90
89
  issuedAt: number;
91
90
  nodeId: string;
91
+ action: "read" | "list" | "write" | "delete";
92
92
  storeId: "managed-inference" | "managed-training" | "managed-lab";
93
93
  }, {
94
94
  service: "inference" | "training" | "lab";
95
95
  nonce: string;
96
96
  schemaVersion: "treeseed.ai-storage-proof/v1";
97
97
  key: string;
98
- action: "read" | "write" | "list" | "delete";
99
- projectId: string;
100
98
  teamId: string;
99
+ projectId: string;
101
100
  issuedAt: number;
102
101
  nodeId: string;
102
+ action: "read" | "list" | "write" | "delete";
103
103
  storeId: "managed-inference" | "managed-training" | "managed-lab";
104
104
  }>, {
105
105
  service: "inference" | "training" | "lab";
106
106
  nonce: string;
107
107
  schemaVersion: "treeseed.ai-storage-proof/v1";
108
108
  key: string;
109
- action: "read" | "write" | "list" | "delete";
110
- projectId: string;
111
109
  teamId: string;
110
+ projectId: string;
112
111
  issuedAt: number;
113
112
  nodeId: string;
113
+ action: "read" | "list" | "write" | "delete";
114
114
  storeId: "managed-inference" | "managed-training" | "managed-lab";
115
115
  }, {
116
116
  service: "inference" | "training" | "lab";
117
117
  nonce: string;
118
118
  schemaVersion: "treeseed.ai-storage-proof/v1";
119
119
  key: string;
120
- action: "read" | "write" | "list" | "delete";
121
- projectId: string;
122
120
  teamId: string;
121
+ projectId: string;
123
122
  issuedAt: number;
124
123
  nodeId: string;
124
+ action: "read" | "list" | "write" | "delete";
125
125
  storeId: "managed-inference" | "managed-training" | "managed-lab";
126
126
  }>;
127
127
  signature: z.ZodString;
128
128
  }, "strict", z.ZodTypeAny, {
129
+ signature: string;
129
130
  proof: {
130
131
  service: "inference" | "training" | "lab";
131
132
  nonce: string;
132
133
  schemaVersion: "treeseed.ai-storage-proof/v1";
133
134
  key: string;
134
- action: "read" | "write" | "list" | "delete";
135
- projectId: string;
136
135
  teamId: string;
136
+ projectId: string;
137
137
  issuedAt: number;
138
138
  nodeId: string;
139
+ action: "read" | "list" | "write" | "delete";
139
140
  storeId: "managed-inference" | "managed-training" | "managed-lab";
140
141
  };
141
- signature: string;
142
142
  }, {
143
+ signature: string;
143
144
  proof: {
144
145
  service: "inference" | "training" | "lab";
145
146
  nonce: string;
146
147
  schemaVersion: "treeseed.ai-storage-proof/v1";
147
148
  key: string;
148
- action: "read" | "write" | "list" | "delete";
149
- projectId: string;
150
149
  teamId: string;
150
+ projectId: string;
151
151
  issuedAt: number;
152
152
  nodeId: string;
153
+ action: "read" | "list" | "write" | "delete";
153
154
  storeId: "managed-inference" | "managed-training" | "managed-lab";
154
155
  };
155
- signature: string;
156
156
  }>;
157
157
  /** Domain-separated, deterministic bytes signed by a Deployment-owned Ed25519 identity. */
158
158
  export declare function aiStorageProofMessage(input: AiStorageProof): string;
@@ -87,11 +87,11 @@ export declare const aiHostingDeploymentSchema: z.ZodEffects<z.ZodObject<{
87
87
  purpose: z.ZodEnum<["datasets", "models", "checkpoints", "artifacts"]>;
88
88
  access: z.ZodEnum<["read", "write"]>;
89
89
  }, "strict", z.ZodTypeAny, {
90
- purpose: "artifacts" | "datasets" | "models" | "checkpoints";
90
+ purpose: "models" | "artifacts" | "datasets" | "checkpoints";
91
91
  bindingId: string;
92
92
  access: "read" | "write";
93
93
  }, {
94
- purpose: "artifacts" | "datasets" | "models" | "checkpoints";
94
+ purpose: "models" | "artifacts" | "datasets" | "checkpoints";
95
95
  bindingId: string;
96
96
  access: "read" | "write";
97
97
  }>, "many">;
@@ -139,13 +139,13 @@ export declare const aiHostingDeploymentSchema: z.ZodEffects<z.ZodObject<{
139
139
  }, "strict", z.ZodTypeAny, {
140
140
  provider: "hyperstack";
141
141
  schemaVersion: "treeseed.ai-hosting-deployment/v1";
142
+ teamId: string;
143
+ projectId: string;
144
+ environment: "staging" | "production";
142
145
  components: {
143
146
  componentId: "ai-inference" | "ai-training";
144
147
  releaseDigest: string;
145
148
  }[];
146
- projectId: string;
147
- teamId: string;
148
- environment: "production" | "staging";
149
149
  deploymentId: string;
150
150
  hostingBindingId: string;
151
151
  machine: {
@@ -158,7 +158,7 @@ export declare const aiHostingDeploymentSchema: z.ZodEffects<z.ZodObject<{
158
158
  };
159
159
  gpuAdmission: "exclusive-engine";
160
160
  storage: {
161
- purpose: "artifacts" | "datasets" | "models" | "checkpoints";
161
+ purpose: "models" | "artifacts" | "datasets" | "checkpoints";
162
162
  bindingId: string;
163
163
  access: "read" | "write";
164
164
  }[];
@@ -174,13 +174,13 @@ export declare const aiHostingDeploymentSchema: z.ZodEffects<z.ZodObject<{
174
174
  }, {
175
175
  provider: "hyperstack";
176
176
  schemaVersion: "treeseed.ai-hosting-deployment/v1";
177
+ teamId: string;
178
+ projectId: string;
179
+ environment: "staging" | "production";
177
180
  components: {
178
181
  componentId: "ai-inference" | "ai-training";
179
182
  releaseDigest: string;
180
183
  }[];
181
- projectId: string;
182
- teamId: string;
183
- environment: "production" | "staging";
184
184
  deploymentId: string;
185
185
  hostingBindingId: string;
186
186
  machine: {
@@ -193,7 +193,7 @@ export declare const aiHostingDeploymentSchema: z.ZodEffects<z.ZodObject<{
193
193
  };
194
194
  gpuAdmission: "exclusive-engine";
195
195
  storage: {
196
- purpose: "artifacts" | "datasets" | "models" | "checkpoints";
196
+ purpose: "models" | "artifacts" | "datasets" | "checkpoints";
197
197
  bindingId: string;
198
198
  access: "read" | "write";
199
199
  }[];
@@ -209,13 +209,13 @@ export declare const aiHostingDeploymentSchema: z.ZodEffects<z.ZodObject<{
209
209
  }>, {
210
210
  provider: "hyperstack";
211
211
  schemaVersion: "treeseed.ai-hosting-deployment/v1";
212
+ teamId: string;
213
+ projectId: string;
214
+ environment: "staging" | "production";
212
215
  components: {
213
216
  componentId: "ai-inference" | "ai-training";
214
217
  releaseDigest: string;
215
218
  }[];
216
- projectId: string;
217
- teamId: string;
218
- environment: "production" | "staging";
219
219
  deploymentId: string;
220
220
  hostingBindingId: string;
221
221
  machine: {
@@ -228,7 +228,7 @@ export declare const aiHostingDeploymentSchema: z.ZodEffects<z.ZodObject<{
228
228
  };
229
229
  gpuAdmission: "exclusive-engine";
230
230
  storage: {
231
- purpose: "artifacts" | "datasets" | "models" | "checkpoints";
231
+ purpose: "models" | "artifacts" | "datasets" | "checkpoints";
232
232
  bindingId: string;
233
233
  access: "read" | "write";
234
234
  }[];
@@ -244,13 +244,13 @@ export declare const aiHostingDeploymentSchema: z.ZodEffects<z.ZodObject<{
244
244
  }, {
245
245
  provider: "hyperstack";
246
246
  schemaVersion: "treeseed.ai-hosting-deployment/v1";
247
+ teamId: string;
248
+ projectId: string;
249
+ environment: "staging" | "production";
247
250
  components: {
248
251
  componentId: "ai-inference" | "ai-training";
249
252
  releaseDigest: string;
250
253
  }[];
251
- projectId: string;
252
- teamId: string;
253
- environment: "production" | "staging";
254
254
  deploymentId: string;
255
255
  hostingBindingId: string;
256
256
  machine: {
@@ -263,7 +263,7 @@ export declare const aiHostingDeploymentSchema: z.ZodEffects<z.ZodObject<{
263
263
  };
264
264
  gpuAdmission: "exclusive-engine";
265
265
  storage: {
266
- purpose: "artifacts" | "datasets" | "models" | "checkpoints";
266
+ purpose: "models" | "artifacts" | "datasets" | "checkpoints";
267
267
  bindingId: string;
268
268
  access: "read" | "write";
269
269
  }[];
@@ -10,40 +10,40 @@ export declare const aiInstanceDraftSchema: z.ZodEffects<z.ZodObject<{
10
10
  timeZone: z.ZodEffects<z.ZodString, string, string>;
11
11
  }, "strict", z.ZodTypeAny, {
12
12
  name: string;
13
+ schedule: "always" | "weekdays";
14
+ purpose: "inference" | "both" | "training";
15
+ model: string;
13
16
  projectId: string;
14
- purpose: "inference" | "training" | "both";
15
17
  timeZone: string;
16
- schedule: "weekdays" | "always";
17
18
  hostingConnectionId: string;
18
19
  storageConnectionId: string | null;
19
- model: string;
20
20
  }, {
21
21
  name: string;
22
+ schedule: "always" | "weekdays";
23
+ purpose: "inference" | "both" | "training";
24
+ model: string;
22
25
  projectId: string;
23
- purpose: "inference" | "training" | "both";
24
26
  timeZone: string;
25
- schedule: "weekdays" | "always";
26
27
  hostingConnectionId: string;
27
28
  storageConnectionId: string | null;
28
- model: string;
29
29
  }>, {
30
30
  name: string;
31
+ schedule: "always" | "weekdays";
32
+ purpose: "inference" | "both" | "training";
33
+ model: string;
31
34
  projectId: string;
32
- purpose: "inference" | "training" | "both";
33
35
  timeZone: string;
34
- schedule: "weekdays" | "always";
35
36
  hostingConnectionId: string;
36
37
  storageConnectionId: string | null;
37
- model: string;
38
38
  }, {
39
39
  name: string;
40
+ schedule: "always" | "weekdays";
41
+ purpose: "inference" | "both" | "training";
42
+ model: string;
40
43
  projectId: string;
41
- purpose: "inference" | "training" | "both";
42
44
  timeZone: string;
43
- schedule: "weekdays" | "always";
44
45
  hostingConnectionId: string;
45
46
  storageConnectionId: string | null;
46
- model: string;
47
47
  }>;
48
48
  export type AiInstanceDraft = z.infer<typeof aiInstanceDraftSchema>;
49
49
  /** Registration adopts an already managed local runtime; it never provisions a cloud machine. */
@@ -54,12 +54,12 @@ export declare const aiNodeRegistrationSchema: z.ZodObject<{
54
54
  model: z.ZodString;
55
55
  }, "strict", z.ZodTypeAny, {
56
56
  name: string;
57
- projectId: string;
58
- purpose: "inference" | "training" | "both";
57
+ purpose: "inference" | "both" | "training";
59
58
  model: string;
59
+ projectId: string;
60
60
  }, {
61
61
  name: string;
62
- projectId: string;
63
- purpose: "inference" | "training" | "both";
62
+ purpose: "inference" | "both" | "training";
64
63
  model: string;
64
+ projectId: string;
65
65
  }>;