@treeseed/sdk 0.13.0-rc.122 → 0.13.0-rc.124
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-capacity/contracts/capacity/assignments/agent-execution.d.ts +1392 -974
- package/dist/agent-capacity/contracts/capacity/assignments/agent-execution.js +72 -27
- package/dist/agent-capacity/contracts/capacity/assignments/assignment-context-pack.d.ts +34 -34
- package/dist/agent-capacity/contracts/capacity/assignments/assignment-path.d.ts +2 -0
- package/dist/agent-capacity/contracts/capacity/assignments/assignment-path.js +13 -0
- package/dist/agent-capacity/contracts/capacity/assignments/assignment-records.d.ts +1 -0
- package/dist/agent-capacity/contracts/capacity/providers/supply-policy.d.ts +126 -1
- package/dist/agent-capacity/contracts/capacity/providers/supply-policy.js +35 -1
- package/dist/agent-capacity/contracts/capacity/workdays/assignment-allocation.d.ts +1 -3
- package/dist/agent-capacity/contracts/capacity/workdays/assignment-allocation.js +21 -15
- package/dist/agent-capacity/contracts/capacity/workdays/capability-accounting.d.ts +3 -42
- package/dist/agent-capacity/contracts/capacity/workdays/capability-accounting.js +8 -8
- package/dist/agent-capacity/contracts/capacity/workdays/workday-allocation.d.ts +227 -66
- package/dist/agent-capacity/contracts/capacity/workdays/workday-allocation.js +54 -19
- package/dist/agent-capacity/contracts/capacity/workdays/workday-records.d.ts +214 -5
- package/dist/agent-capacity/contracts/capacity/workdays/workday-records.js +19 -0
- package/dist/agent-capacity/contracts/operations/agent-team-clone.d.ts +47 -47
- package/dist/agent-capacity/contracts/projects/agents/project-agent-class.d.ts +119 -0
- package/dist/agent-capacity/contracts/projects/agents/project-agent-class.js +16 -0
- package/dist/agent-capacity/contracts/support/execution-graph.d.ts +434 -230
- package/dist/agent-capacity/contracts/support/execution-graph.js +20 -18
- package/dist/agent-capacity/contracts/support/financial-records.d.ts +2 -0
- package/dist/agent-capacity/validation/agent-definition-schema.d.ts +286 -254
- package/dist/agent-capacity/validation/agent-definition-schema.js +22 -28
- package/dist/agent-capacity/validation/agent-lab-forensics-schema.d.ts +1 -1
- package/dist/agent-capacity/validation/assignment-records.js +45 -0
- package/dist/capacity/agents/agent-capacity.d.ts +1 -0
- package/dist/capacity/agents/agent-capacity.js +1 -0
- package/dist/capacity-provider/capability-ontology.d.ts +102 -102
- package/dist/capacity-provider/client.d.ts +14 -7
- package/dist/capacity-provider/client.js +1 -4
- package/dist/capacity-provider/contracts/capacity-facts.d.ts +0 -1
- package/dist/capacity-provider/contracts/environment-profiles.d.ts +40 -40
- package/dist/capacity-provider/contracts/governance.d.ts +2 -17
- package/dist/capacity-provider/contracts/index.d.ts +2 -0
- package/dist/capacity-provider/contracts/index.js +2 -0
- package/dist/capacity-provider/core-capability-catalog.d.ts +7 -7
- package/dist/capacity-provider/environment-catalog.d.ts +22 -22
- package/dist/capacity-provider/environment-catalog.js +1 -1
- package/dist/capacity-provider/install-configuration.d.ts +4 -4
- package/dist/capacity-provider/sandbox-contracts.d.ts +54 -54
- package/dist/capacity-provider/source-workspace.d.ts +76 -76
- package/dist/capacity-provider/validation.d.ts +10 -2
- package/dist/capacity-provider/validation.js +52 -22
- package/dist/content/validation/agent-operational-content-schemas.d.ts +120 -118
- package/dist/content/validation/agent-operational-content-schemas.js +2 -0
- package/dist/content/validation/auxiliary-content-schemas.d.ts +92 -92
- package/dist/content/validation/content-model-schemas.d.ts +3155 -2512
- package/dist/content/validation/content-model-schemas.js +97 -87
- package/dist/content/validation/portable-content-data.d.ts +173 -168
- package/dist/content/validation/schema-constraints.d.ts +78 -0
- package/dist/content/validation/schema-constraints.js +149 -0
- package/dist/deployment/ai/storage.d.ts +20 -20
- package/dist/deployment/ai-hosting.d.ts +12 -12
- package/dist/deployment/ai-instance.d.ts +12 -12
- package/dist/deployment/ai-mode.d.ts +34 -34
- package/dist/deployment/hosted-topology-template.d.ts +25 -25
- package/dist/deployment/hosted-topology.d.ts +146 -146
- package/dist/deployment/postgres/transfer.d.ts +2 -2
- package/dist/deployment/schemas.d.ts +504 -504
- package/dist/development/schemas.d.ts +325 -325
- package/dist/graph/context-query-contracts.js +1 -1
- package/dist/guarantees/index.d.ts +26 -2
- package/dist/identity/contracts.js +6 -1
- package/dist/operator-contracts/canonical-command-tree.js +22 -8
- package/dist/operator-contracts/catalog/agents/agent-team-clone-operations.d.ts +27 -27
- package/dist/operator-contracts/catalog/capability-ontology-operations.d.ts +25 -25
- package/dist/operator-contracts/catalog/commands/command-tree-builders.d.ts +11 -9
- package/dist/operator-contracts/catalog/communication-operations.d.ts +108 -90
- package/dist/operator-contracts/catalog/hosted-topology-operations.d.ts +33 -33
- package/dist/operator-contracts/catalog/inbox-operations.d.ts +27 -27
- package/dist/operator-contracts/catalog/infrastructure/ai-instance-operations.d.ts +4 -4
- package/dist/operator-contracts/catalog/infrastructure/ai-instance-operations.js +2 -1
- package/dist/operator-contracts/catalog/knowledge-share-operations.d.ts +5 -5
- package/dist/operator-contracts/catalog/provider-environment-operations.d.ts +3 -3
- package/dist/operator-contracts/catalog/services/secret-operations.d.ts +16 -8
- package/dist/operator-contracts/catalog/services/secret-operations.js +2 -1
- package/dist/operator-contracts/catalog/workdays/profile-operations.d.ts +11 -11
- package/dist/operator-contracts/catalog/workdays/selection-commands.js +7 -6
- package/dist/operator-contracts/communication/contracts.d.ts +340 -198
- package/dist/operator-contracts/communication/contracts.js +6 -1
- package/dist/operator-contracts/control-plane-operation.d.ts +7 -0
- package/dist/operator-contracts/control-plane-operation.js +6 -0
- package/dist/operator-contracts/control-plane-operations.d.ts +469 -442
- package/dist/operator-contracts/control-plane-operations.js +26 -10
- package/dist/operator-contracts/inbox/contracts.d.ts +100 -100
- package/dist/operator-contracts/knowledge/contracts.d.ts +6 -6
- package/dist/operator-contracts/mcp.js +4 -3
- package/dist/operator-contracts/workday-lifecycle.d.ts +192 -2
- package/dist/operator-contracts/workday-lifecycle.js +108 -45
- package/dist/platform/agent-schema-verification.js +316 -33
- package/dist/platform/contracts.d.ts +72 -72
- package/dist/platform/schemas.d.ts +144 -36
- package/dist/platform/schemas.js +26 -0
- package/dist/platform/verification.js +4 -0
- package/dist/sdk-types/support/sdk-search-request.d.ts +2 -2
- package/dist/secrets-capability/secret-contracts.d.ts +2 -2
- package/dist/secrets-capability/shared-access.d.ts +1 -1
- package/dist/secrets-capability/shared-resources.d.ts +30 -30
- package/dist/security/encrypted-envelope.d.ts +6 -6
- package/dist/treedx/client.d.ts +4 -4
- package/dist/treedx/index.d.ts +1 -1
- package/dist/treedx/index.js +1 -0
- package/dist/treedx/types.d.ts +286 -0
- package/dist/treedx/types.js +44 -0
- package/dist/types/agents/agent-activity-profile.d.ts +1 -0
- package/guarantees/agent/golden/component-boundaries.guarantee.yaml +12 -0
- package/guarantees/agent/golden/product-custody.guarantee.yaml +12 -0
- package/guarantees/agent/golden/product.guarantee.yaml +12 -0
- package/guarantees/agent/golden/scenes/component-boundaries.scene.yaml +837 -0
- package/guarantees/agent/golden/scenes/product-custody.scene.yaml +53 -0
- package/guarantees/agent/golden/scenes/product.scene.yaml +8 -0
- package/guarantees/verifiers/golden.verifiers.yaml +1429 -0
- package/package.json +10 -5
- package/tests/acceptance/golden-product.test.ts +205 -0
- package/tests/acceptance/golden-product.ts +404 -0
- package/tests/acceptance/product/base-red.ts +73 -0
- package/tests/acceptance/product/documentation-examples.ts +68 -0
- package/tests/acceptance/product/intent-runtime.ts +145 -0
- package/tests/acceptance/product/release-output.ts +160 -0
- package/tests/acceptance/product/research-artifact.ts +87 -0
- package/tests/acceptance/product/research-revision.ts +82 -0
- package/tests/acceptance/product/research-source.ts +91 -0
- package/tests/acceptance/product/test-chain.ts +192 -0
- package/treeseed.package.yaml +147 -0
- package/dist/.treeseed-build-complete.json +0 -1
|
@@ -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
|
+
};
|
|
@@ -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" | "list" | "write" | "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" | "list" | "write" | "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" | "list" | "write" | "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" | "list" | "write" | "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,44 +84,44 @@ 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" | "list" | "write" | "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" | "list" | "write" | "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" | "list" | "write" | "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" | "list" | "write" | "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;
|
|
@@ -132,11 +132,11 @@ export declare const aiStorageRequestSchema: z.ZodObject<{
|
|
|
132
132
|
nonce: string;
|
|
133
133
|
schemaVersion: "treeseed.ai-storage-proof/v1";
|
|
134
134
|
key: string;
|
|
135
|
-
action: "read" | "list" | "write" | "delete";
|
|
136
|
-
projectId: string;
|
|
137
135
|
teamId: string;
|
|
136
|
+
projectId: string;
|
|
138
137
|
issuedAt: number;
|
|
139
138
|
nodeId: string;
|
|
139
|
+
action: "read" | "list" | "write" | "delete";
|
|
140
140
|
storeId: "managed-inference" | "managed-training" | "managed-lab";
|
|
141
141
|
};
|
|
142
142
|
}, {
|
|
@@ -146,11 +146,11 @@ export declare const aiStorageRequestSchema: z.ZodObject<{
|
|
|
146
146
|
nonce: string;
|
|
147
147
|
schemaVersion: "treeseed.ai-storage-proof/v1";
|
|
148
148
|
key: string;
|
|
149
|
-
action: "read" | "list" | "write" | "delete";
|
|
150
|
-
projectId: string;
|
|
151
149
|
teamId: string;
|
|
150
|
+
projectId: string;
|
|
152
151
|
issuedAt: number;
|
|
153
152
|
nodeId: string;
|
|
153
|
+
action: "read" | "list" | "write" | "delete";
|
|
154
154
|
storeId: "managed-inference" | "managed-training" | "managed-lab";
|
|
155
155
|
};
|
|
156
156
|
}>;
|
|
@@ -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: "staging" | "production";
|
|
149
149
|
deploymentId: string;
|
|
150
150
|
hostingBindingId: string;
|
|
151
151
|
machine: {
|
|
@@ -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: "staging" | "production";
|
|
184
184
|
deploymentId: string;
|
|
185
185
|
hostingBindingId: string;
|
|
186
186
|
machine: {
|
|
@@ -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: "staging" | "production";
|
|
219
219
|
deploymentId: string;
|
|
220
220
|
hostingBindingId: string;
|
|
221
221
|
machine: {
|
|
@@ -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: "staging" | "production";
|
|
254
254
|
deploymentId: string;
|
|
255
255
|
hostingBindingId: string;
|
|
256
256
|
machine: {
|
|
@@ -10,37 +10,37 @@ 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
|
-
projectId: string;
|
|
14
13
|
schedule: "always" | "weekdays";
|
|
15
|
-
purpose: "
|
|
14
|
+
purpose: "inference" | "both" | "training";
|
|
16
15
|
model: string;
|
|
16
|
+
projectId: string;
|
|
17
17
|
timeZone: string;
|
|
18
18
|
hostingConnectionId: string;
|
|
19
19
|
storageConnectionId: string | null;
|
|
20
20
|
}, {
|
|
21
21
|
name: string;
|
|
22
|
-
projectId: string;
|
|
23
22
|
schedule: "always" | "weekdays";
|
|
24
|
-
purpose: "
|
|
23
|
+
purpose: "inference" | "both" | "training";
|
|
25
24
|
model: string;
|
|
25
|
+
projectId: string;
|
|
26
26
|
timeZone: string;
|
|
27
27
|
hostingConnectionId: string;
|
|
28
28
|
storageConnectionId: string | null;
|
|
29
29
|
}>, {
|
|
30
30
|
name: string;
|
|
31
|
-
projectId: string;
|
|
32
31
|
schedule: "always" | "weekdays";
|
|
33
|
-
purpose: "
|
|
32
|
+
purpose: "inference" | "both" | "training";
|
|
34
33
|
model: string;
|
|
34
|
+
projectId: string;
|
|
35
35
|
timeZone: string;
|
|
36
36
|
hostingConnectionId: string;
|
|
37
37
|
storageConnectionId: string | null;
|
|
38
38
|
}, {
|
|
39
39
|
name: string;
|
|
40
|
-
projectId: string;
|
|
41
40
|
schedule: "always" | "weekdays";
|
|
42
|
-
purpose: "
|
|
41
|
+
purpose: "inference" | "both" | "training";
|
|
43
42
|
model: string;
|
|
43
|
+
projectId: string;
|
|
44
44
|
timeZone: string;
|
|
45
45
|
hostingConnectionId: string;
|
|
46
46
|
storageConnectionId: string | null;
|
|
@@ -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
|
-
|
|
58
|
-
purpose: "both" | "inference" | "training";
|
|
57
|
+
purpose: "inference" | "both" | "training";
|
|
59
58
|
model: string;
|
|
59
|
+
projectId: string;
|
|
60
60
|
}, {
|
|
61
61
|
name: string;
|
|
62
|
-
|
|
63
|
-
purpose: "both" | "inference" | "training";
|
|
62
|
+
purpose: "inference" | "both" | "training";
|
|
64
63
|
model: string;
|
|
64
|
+
projectId: string;
|
|
65
65
|
}>;
|