@treeseed/sdk 0.13.0-rc.121 → 0.13.0-rc.122
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/.treeseed-build-complete.json +1 -1
- package/dist/agent-capacity/contracts/capacity/assignments/agent-execution.d.ts +1594 -922
- package/dist/agent-capacity/contracts/capacity/assignments/agent-execution.js +22 -1
- package/dist/agent-capacity/contracts/capacity/assignments/assignment-context-pack.d.ts +40 -40
- package/dist/agent-capacity/contracts/capacity/assignments/assignment-records.d.ts +1 -59
- package/dist/agent-capacity/contracts/capacity/workdays/assignment-allocation.d.ts +1 -1
- package/dist/agent-capacity/contracts/capacity/workdays/assignment-allocation.js +1 -1
- package/dist/agent-capacity/contracts/capacity/workdays/workday-allocation.d.ts +18 -20
- package/dist/agent-capacity/contracts/capacity/workdays/workday-allocation.js +1 -1
- package/dist/agent-capacity/contracts/capacity/workdays/workday-records.d.ts +0 -67
- package/dist/agent-capacity/contracts/configuration/configuration.d.ts +1 -1
- package/dist/agent-capacity/contracts/configuration/configuration.js +0 -2
- package/dist/agent-capacity/contracts/operations/agent-team-clone.d.ts +8 -8
- package/dist/agent-capacity/contracts/projects/agents/project-agent-class.d.ts +0 -23
- package/dist/agent-capacity/contracts/runtime/runtime-observability.d.ts +2 -154
- package/dist/agent-capacity/contracts/support/agent-atlas.d.ts +0 -13
- package/dist/agent-capacity/contracts/support/execution-graph.d.ts +176 -176
- package/dist/agent-capacity/contracts/support/execution-graph.js +1 -1
- package/dist/agent-capacity/contracts/support/financial-records.d.ts +1 -6
- package/dist/agent-capacity/contracts/support/planning-records.d.ts +1 -87
- package/dist/agent-capacity/grant.d.ts +34 -0
- package/dist/agent-capacity/grant.js +4 -0
- package/dist/agent-capacity/validation/agent-definition-schema.d.ts +1042 -1042
- package/dist/agent-capacity/validation/agent-lab-forensics-schema.d.ts +11 -11
- package/dist/agent-capacity/validation/agent-lab-forensics-schema.js +0 -1
- package/dist/agent-capacity/validation/assignment-records.d.ts +1 -6
- package/dist/agent-capacity/validation/assignment-records.js +4 -35
- package/dist/agent-capacity/validation/configuration.d.ts +1 -1
- package/dist/agent-capacity/validation/configuration.js +2 -6
- package/dist/agent-capacity/validation/grant.d.ts +11 -0
- package/dist/agent-capacity/validation/grant.js +31 -0
- package/dist/capacity/agents/agent-capacity.d.ts +2 -4
- package/dist/capacity/agents/agent-capacity.js +1 -3
- package/dist/capacity-provider/capability-ontology.d.ts +138 -138
- package/dist/capacity-provider/client.d.ts +1 -2
- package/dist/capacity-provider/client.js +0 -6
- package/dist/capacity-provider/contracts/environment-profiles.d.ts +8 -8
- package/dist/capacity-provider/core-capability-catalog.d.ts +4 -4
- package/dist/capacity-provider/environment-catalog.d.ts +166 -166
- package/dist/capacity-provider/install-configuration.d.ts +2 -2
- package/dist/capacity-provider/sandbox-contracts.d.ts +52 -52
- package/dist/capacity-provider/source-workspace.d.ts +102 -4
- package/dist/capacity-provider/source-workspace.js +5 -1
- package/dist/content/validation/agent-operational-content-schemas.d.ts +108 -108
- package/dist/content/validation/auxiliary-content-schemas.d.ts +108 -108
- package/dist/content/validation/content-model-schemas.d.ts +9473 -6284
- package/dist/content/validation/content-model-schemas.js +116 -48
- package/dist/content/validation/portable-content-data.d.ts +351 -181
- package/dist/content/validation/portable-content-data.js +6 -1
- package/dist/deployment/ai/storage.d.ts +14 -14
- package/dist/deployment/ai-hosting.d.ts +10 -10
- package/dist/deployment/ai-instance.d.ts +14 -14
- package/dist/deployment/ai-mode.d.ts +82 -82
- package/dist/deployment/hosted-topology-template.d.ts +24 -24
- package/dist/deployment/hosted-topology.d.ts +219 -219
- package/dist/deployment/postgres/contracts.d.ts +52 -52
- package/dist/deployment/postgres/transfer.d.ts +4 -4
- package/dist/deployment/schemas.d.ts +780 -780
- package/dist/development/schemas.d.ts +439 -439
- package/dist/knowledge/contracts.d.ts +9 -2
- package/dist/knowledge/contracts.js +2 -2
- package/dist/model-registry/discussion-models.js +0 -1
- package/dist/operator-contracts/canonical-command-tree.js +3 -1
- package/dist/operator-contracts/catalog/agents/agent-team-clone-operations.d.ts +2 -2
- package/dist/operator-contracts/catalog/capability-ontology-operations.d.ts +17 -17
- package/dist/operator-contracts/catalog/commands/command-tree-builders.d.ts +4 -4
- package/dist/operator-contracts/catalog/communication-operations.d.ts +100 -100
- package/dist/operator-contracts/catalog/hosted-topology-operations.d.ts +40 -40
- package/dist/operator-contracts/catalog/inbox-operations.d.ts +54 -54
- package/dist/operator-contracts/catalog/infrastructure/ai-instance-operations.d.ts +5 -5
- package/dist/operator-contracts/catalog/knowledge-share-operations.d.ts +10 -10
- package/dist/operator-contracts/catalog/services/secret-operations.d.ts +8 -8
- package/dist/operator-contracts/communication/contracts.d.ts +273 -273
- package/dist/operator-contracts/control-plane-operations.d.ts +236 -242
- package/dist/operator-contracts/control-plane-operations.js +0 -2
- package/dist/operator-contracts/inbox/contracts.d.ts +204 -204
- package/dist/operator-contracts/knowledge/contracts.d.ts +16 -16
- package/dist/platform/agent-schema-verification.d.ts +3 -0
- package/dist/platform/agent-schema-verification.js +94 -0
- package/dist/platform/verification.js +6 -0
- package/dist/sdk-types/support/planning-policy.d.ts +1 -1
- package/dist/secrets-capability/shared-access.d.ts +2 -2
- package/dist/secrets-capability/shared-resources.d.ts +46 -46
- package/dist/secrets-capability/vault-contracts.d.ts +2 -2
- package/dist/security/encrypted-envelope.d.ts +8 -8
- package/package.json +3 -2
- package/dist/agent-capacity/allocation.d.ts +0 -183
- package/dist/agent-capacity/allocation.js +0 -5
- package/dist/agent-capacity/artifact-mutation-receipt.d.ts +0 -49
- package/dist/agent-capacity/artifact-mutation-receipt.js +0 -36
- package/dist/agent-capacity/artifacts.d.ts +0 -123
- package/dist/agent-capacity/artifacts.js +0 -39
- package/dist/agent-capacity/contracts/support/decision-work.d.ts +0 -227
- package/dist/agent-capacity/contracts/support/decision-work.js +0 -0
- package/dist/agent-capacity/validation/allocation.d.ts +0 -12
- package/dist/agent-capacity/validation/allocation.js +0 -115
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
function validateCapacityGrantV2(grant) {
|
|
2
|
-
const diagnostics = [];
|
|
3
|
-
const add = (code, path, message) => diagnostics.push({ code, path, message });
|
|
4
|
-
for (const [path, value] of [["id", grant.id], ["membershipId", grant.membershipId], ["teamId", grant.teamId], ["providerId", grant.providerId], ["projectId", grant.projectId], ["environment", grant.environment]]) {
|
|
5
|
-
if (!value?.trim()) add("capacity_grant_field_required", path, `${path} is required.`);
|
|
6
|
-
}
|
|
7
|
-
if (grant.schemaVersion !== 2) add("capacity_grant_schema_invalid", "schemaVersion", "Grant schemaVersion must be 2.");
|
|
8
|
-
if (!Array.isArray(grant.allowedModes) || grant.allowedModes.length === 0 || grant.allowedModes.some((mode) => !["planning", "acting"].includes(mode))) add("capacity_grant_modes_invalid", "allowedModes", "Grant allowedModes must contain planning and/or acting.");
|
|
9
|
-
for (const [path, values] of [["executionProviderIds", grant.executionProviderIds], ["laneIds", grant.laneIds], ["capabilities", grant.capabilities]]) {
|
|
10
|
-
if (!Array.isArray(values) || values.some((value) => !value?.trim()) || new Set(values).size !== values.length) add("capacity_grant_list_invalid", path, `${path} must contain unique non-empty strings.`);
|
|
11
|
-
}
|
|
12
|
-
for (const [path, value] of [["dailyAgentSecondsLimit", grant.dailyAgentSecondsLimit], ["monthlyAgentSecondsLimit", grant.monthlyAgentSecondsLimit]]) {
|
|
13
|
-
if (value != null && (!Number.isFinite(value) || value < 0)) add("capacity_grant_limit_invalid", path, `${path} must be zero or greater when configured.`);
|
|
14
|
-
}
|
|
15
|
-
if (grant.maxConcurrentAssignments != null && (!Number.isInteger(grant.maxConcurrentAssignments) || grant.maxConcurrentAssignments < 0)) add("capacity_grant_concurrency_invalid", "maxConcurrentAssignments", "maxConcurrentAssignments must be a non-negative integer when configured.");
|
|
16
|
-
if (grant.budgetLimits?.tokens != null && (!Number.isFinite(grant.budgetLimits.tokens) || grant.budgetLimits.tokens < 0)) add("capacity_grant_token_limit_invalid", "budgetLimits.tokens", "Token limit must be finite and non-negative.");
|
|
17
|
-
if (grant.budgetLimits?.cost && (!Number.isFinite(grant.budgetLimits.cost.amount) || grant.budgetLimits.cost.amount < 0 || !grant.budgetLimits.cost.currency.trim())) add("capacity_grant_cost_limit_invalid", "budgetLimits.cost", "Cost limit requires a non-negative amount and currency.");
|
|
18
|
-
if (grant.budgetLimits?.native?.some((entry) => !entry.unit.trim() || !Number.isFinite(entry.amount) || entry.amount < 0)) add("capacity_grant_native_limit_invalid", "budgetLimits.native", "Native limits require a unit and non-negative amount.");
|
|
19
|
-
if (!Array.isArray(grant.executionProviderIds) || grant.executionProviderIds.length === 0) add("capacity_grant_execution_provider_required", "executionProviderIds", "At least one execution provider is required.");
|
|
20
|
-
if (!grant.unmetered && grant.dailyAgentSecondsLimit == null && grant.monthlyAgentSecondsLimit == null) add("capacity_grant_budget_required", "unmetered", "A metered grant requires a daily or monthly agent-time limit.");
|
|
21
|
-
if (grant.unmetered && (grant.dailyAgentSecondsLimit != null || grant.monthlyAgentSecondsLimit != null)) add("capacity_grant_budget_ambiguous", "unmetered", "An unmetered grant must not also declare agent-time limits.");
|
|
22
|
-
if (grant.expiresAt && timestamp(grant.expiresAt) === null) add("capacity_grant_expiry_invalid", "expiresAt", "expiresAt must be an ISO timestamp.");
|
|
23
|
-
return { ok: diagnostics.length === 0, diagnostics };
|
|
24
|
-
}
|
|
25
|
-
function finitePercent(value) {
|
|
26
|
-
return Number.isFinite(value) && value >= 0 && value <= 100;
|
|
27
|
-
}
|
|
28
|
-
function timestamp(value) {
|
|
29
|
-
const parsed = value ? Date.parse(value) : Number.NaN;
|
|
30
|
-
return Number.isFinite(parsed) ? parsed : null;
|
|
31
|
-
}
|
|
32
|
-
function validateCapacityAllocationSetV2(set) {
|
|
33
|
-
const diagnostics = [];
|
|
34
|
-
const add = (code, path, message) => diagnostics.push({ code, path, message });
|
|
35
|
-
if (set.schemaVersion !== 2) add("allocation_schema_invalid", "schemaVersion", "Allocation schemaVersion must be 2.");
|
|
36
|
-
if (!["draft", "validated", "active", "superseded", "archived"].includes(set.status)) add("allocation_status_invalid", "status", "Allocation status is invalid.");
|
|
37
|
-
if (!set.id?.trim()) add("allocation_id_required", "id", "Allocation id is required.");
|
|
38
|
-
if (!set.teamId?.trim()) add("allocation_team_required", "teamId", "Allocation teamId is required.");
|
|
39
|
-
if (!Number.isInteger(set.version) || set.version < 1) add("allocation_version_invalid", "version", "Allocation version must be a positive integer.");
|
|
40
|
-
if (timestamp(set.effectiveFrom) === null) add("allocation_effective_from_invalid", "effectiveFrom", "effectiveFrom must be an ISO timestamp.");
|
|
41
|
-
if (set.effectiveUntil && timestamp(set.effectiveUntil) === null) add("allocation_effective_until_invalid", "effectiveUntil", "effectiveUntil must be an ISO timestamp.");
|
|
42
|
-
if (set.effectiveUntil && timestamp(set.effectiveFrom) !== null && (timestamp(set.effectiveUntil) ?? 0) <= (timestamp(set.effectiveFrom) ?? 0)) add("allocation_effective_interval_invalid", "effectiveUntil", "effectiveUntil must be later than effectiveFrom.");
|
|
43
|
-
if (!finitePercent(set.reservePolicy?.percent)) add("allocation_reserve_invalid", "reservePolicy.percent", "Reserve percent must be between 0 and 100.");
|
|
44
|
-
if (!["deny", "approval-required", "borrow"].includes(set.reservePolicy?.overflow)) add("allocation_reserve_overflow_invalid", "reservePolicy.overflow", "Reserve overflow must be deny, approval-required, or borrow.");
|
|
45
|
-
const slices = Array.isArray(set.slices) ? set.slices : [];
|
|
46
|
-
const borrowingRules = Array.isArray(set.borrowingRules) ? set.borrowingRules : [];
|
|
47
|
-
if (slices.length === 0) add("allocation_slices_required", "slices", "At least one project allocation slice is required.");
|
|
48
|
-
const ids = /* @__PURE__ */ new Set();
|
|
49
|
-
for (const [index, slice] of slices.entries()) {
|
|
50
|
-
const path = `slices[${index}]`;
|
|
51
|
-
if (!slice || typeof slice !== "object") {
|
|
52
|
-
add("allocation_slice_invalid", path, "Allocation slice must be an object.");
|
|
53
|
-
continue;
|
|
54
|
-
}
|
|
55
|
-
if (!slice.id?.trim() || ids.has(slice.id)) add("allocation_slice_id_invalid", `${path}.id`, "Slice id must be non-empty and unique.");
|
|
56
|
-
ids.add(slice.id);
|
|
57
|
-
if (!["project", "agent-class", "mode"].includes(slice.scope)) add("allocation_slice_scope_invalid", `${path}.scope`, "Slice scope must be project, agent-class, or mode.");
|
|
58
|
-
if (!slice.targetId?.trim()) add("allocation_slice_target_required", `${path}.targetId`, "Slice targetId is required.");
|
|
59
|
-
if (!slice.policy || typeof slice.policy !== "object") {
|
|
60
|
-
add("allocation_slice_policy_invalid", `${path}.policy`, "Slice policy must be an object.");
|
|
61
|
-
continue;
|
|
62
|
-
}
|
|
63
|
-
const { minPercent, targetPercent, maxPercent, hardCapPercent } = slice.policy;
|
|
64
|
-
if (![minPercent, targetPercent, maxPercent, hardCapPercent].every(finitePercent) || !(minPercent <= targetPercent && targetPercent <= maxPercent && maxPercent <= hardCapPercent)) {
|
|
65
|
-
add("allocation_slice_bounds_invalid", `${path}.policy`, "Slice bounds must satisfy 0 <= min <= target <= max <= hardCap <= 100.");
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
for (const [index, slice] of slices.entries()) {
|
|
69
|
-
if (!slice || typeof slice !== "object") continue;
|
|
70
|
-
if (slice.parentSliceId && !ids.has(slice.parentSliceId)) add("allocation_parent_missing", `slices[${index}].parentSliceId`, "Parent slice must exist in the allocation set.");
|
|
71
|
-
const parent = slice.parentSliceId ? slices.find((candidate) => candidate && typeof candidate === "object" && candidate.id === slice.parentSliceId) : null;
|
|
72
|
-
if (!slice.parentSliceId && slice.scope !== "project") add("allocation_root_scope_invalid", `slices[${index}].scope`, "Only project slices may exist at the allocation root.");
|
|
73
|
-
if (parent && (slice.scope === "agent-class" && parent.scope !== "project" || slice.scope === "mode" && parent.scope !== "agent-class" || slice.scope === "project")) add("allocation_scope_hierarchy_invalid", `slices[${index}].scope`, "Allocation hierarchy must be project, then agent-class, then mode.");
|
|
74
|
-
const ancestors = /* @__PURE__ */ new Set();
|
|
75
|
-
let current = slice;
|
|
76
|
-
while (current.parentSliceId) {
|
|
77
|
-
if (ancestors.has(current.parentSliceId) || current.parentSliceId === slice.id) {
|
|
78
|
-
add("allocation_cycle_invalid", `slices[${index}].parentSliceId`, "Allocation slice hierarchy must not contain cycles.");
|
|
79
|
-
break;
|
|
80
|
-
}
|
|
81
|
-
ancestors.add(current.parentSliceId);
|
|
82
|
-
const next = slices.find((candidate) => candidate && typeof candidate === "object" && candidate.id === current.parentSliceId);
|
|
83
|
-
if (!next) break;
|
|
84
|
-
current = next;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
const validSlices = slices.filter((slice) => slice && typeof slice === "object");
|
|
88
|
-
const parentKeys = new Set(validSlices.map((slice) => slice.parentSliceId ?? "root"));
|
|
89
|
-
for (const parentKey of parentKeys) {
|
|
90
|
-
const siblings = validSlices.filter((slice) => (slice.parentSliceId ?? "root") === parentKey);
|
|
91
|
-
const targetTotal = siblings.reduce((total, slice) => total + Number(slice.policy?.targetPercent ?? Number.NaN), 0);
|
|
92
|
-
const expected = parentKey === "root" ? 100 - set.reservePolicy.percent : 100;
|
|
93
|
-
if (Math.abs(targetTotal - expected) > 1e-6) add("allocation_target_total_invalid", `slices(parent=${parentKey})`, `Sibling target percentages must total ${expected}.`);
|
|
94
|
-
}
|
|
95
|
-
const ruleIds = /* @__PURE__ */ new Set();
|
|
96
|
-
for (const [index, rule] of borrowingRules.entries()) {
|
|
97
|
-
if (!rule || typeof rule !== "object") {
|
|
98
|
-
add("allocation_borrowing_rule_invalid", `borrowingRules[${index}]`, "Borrowing rule must be an object.");
|
|
99
|
-
continue;
|
|
100
|
-
}
|
|
101
|
-
if (!rule.id?.trim() || ruleIds.has(rule.id)) add("allocation_borrowing_id_invalid", `borrowingRules[${index}].id`, "Borrowing rule id must be non-empty and unique.");
|
|
102
|
-
ruleIds.add(rule.id);
|
|
103
|
-
if (!ids.has(rule.fromSliceId) || !ids.has(rule.toSliceId)) add("allocation_borrowing_slice_missing", `borrowingRules[${index}]`, "Borrowing rule slices must exist.");
|
|
104
|
-
if (rule.fromSliceId === rule.toSliceId) add("allocation_borrowing_self_invalid", `borrowingRules[${index}]`, "A slice cannot borrow from itself.");
|
|
105
|
-
const from = validSlices.find((slice) => slice.id === rule.fromSliceId);
|
|
106
|
-
const to = validSlices.find((slice) => slice.id === rule.toSliceId);
|
|
107
|
-
if (from && to && (from.scope !== to.scope || (from.parentSliceId ?? null) !== (to.parentSliceId ?? null))) add("allocation_borrowing_scope_invalid", `borrowingRules[${index}]`, "Borrowing is allowed only between sibling slices at the same scope.");
|
|
108
|
-
if (!finitePercent(rule.maxPercent) || rule.maxPercent === 0) add("allocation_borrowing_percent_invalid", `borrowingRules[${index}].maxPercent`, "Borrowing maxPercent must be greater than zero and no more than 100.");
|
|
109
|
-
}
|
|
110
|
-
return { ok: diagnostics.length === 0, diagnostics };
|
|
111
|
-
}
|
|
112
|
-
export {
|
|
113
|
-
validateCapacityAllocationSetV2,
|
|
114
|
-
validateCapacityGrantV2
|
|
115
|
-
};
|