@treeseed/sdk 0.13.0-rc.57 → 0.13.0-rc.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.treeseed-build-complete.json +1 -0
- package/dist/agent-capacity/contracts/configuration/configuration.js +1 -1
- package/dist/agent-capacity/contracts/projects/agents/project-agent-class.d.ts +0 -1
- package/dist/agent-capacity/contracts/support/decision-work.d.ts +0 -1
- package/dist/agent-capacity/validation/activity-profile.js +7 -3
- package/dist/agent-capacity/validation/agent-definition-schema.d.ts +222 -222
- package/dist/agent-capacity/validation/agent-definition-schema.js +1 -1
- package/dist/agent-capacity/validation/configuration.d.ts +1 -1
- package/dist/agent-capacity/validation/configuration.js +1 -2
- package/dist/capacity-provider/capability-ontology.d.ts +0 -5
- package/dist/capacity-provider/capability-ontology.js +0 -1
- package/dist/capacity-provider/contracts/governance.d.ts +46 -64
- package/dist/capacity-provider/core-capability-catalog.d.ts +2 -2
- package/dist/capacity-provider/core-capability-catalog.js +7 -21
- package/dist/capacity-provider/environment-catalog.d.ts +72 -72
- package/dist/capacity-provider/sandbox-contracts.d.ts +5 -0
- package/dist/capacity-provider/sandbox-contracts.js +1 -1
- package/dist/capacity-provider/sandbox.d.ts +1 -0
- package/dist/capacity-provider/sandbox.js +1 -0
- package/dist/capacity-provider/validation.d.ts +1 -3
- package/dist/capacity-provider/validation.js +6 -36
- package/dist/content/validation/content-model-schemas.d.ts +408 -408
- package/dist/content/validation/portable-content-data.d.ts +37 -37
- package/dist/operator-contracts/canonical-command-tree.js +11 -0
- package/dist/operator-contracts/catalog/capability-ontology-operations.d.ts +0 -1
- package/dist/operator-contracts/control-plane-operations.d.ts +0 -1
- package/dist/types/agents/agent-activity-profile.d.ts +3 -3
- package/dist/types/agents/agent-trigger-kinds.d.ts +3 -4
- package/dist/types/agents/agent-trigger-kinds.js +1 -13
- package/package.json +5 -1
|
@@ -55,9 +55,9 @@ function validateProviderSupplyOffer(offer, path = "offer") {
|
|
|
55
55
|
if (!Array.isArray(offer.capabilities) || offer.capabilities.some((entry) => !nonEmpty(entry))) add(diagnostics, "provider_offer_capabilities_invalid", `${path}.capabilities`, "Offer capabilities must be non-empty strings.");
|
|
56
56
|
return result(diagnostics);
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function validateCapacityProviderManifestV5(manifest) {
|
|
59
59
|
const diagnostics = [];
|
|
60
|
-
if (manifest?.schemaVersion !==
|
|
60
|
+
if (manifest?.schemaVersion !== 5) add(diagnostics, "provider_manifest_schema_invalid", "schemaVersion", "Capacity provider manifest schemaVersion must be 5.");
|
|
61
61
|
if ("providerClass" in manifest) add(diagnostics, "provider_manifest_legacy_class_forbidden", "providerClass", "Provider classes are not part of the unified battery contract.");
|
|
62
62
|
if (!["team", "external"].includes(manifest?.ownership?.type)) add(diagnostics, "provider_manifest_ownership_invalid", "ownership.type", "ownership.type must be team or external.");
|
|
63
63
|
if (manifest?.ownership?.type === "team" && !nonEmpty(manifest.ownership.teamId)) add(diagnostics, "provider_manifest_owner_team_required", "ownership.teamId", "Team-owned providers require ownership.teamId.");
|
|
@@ -83,9 +83,8 @@ function validateCapacityProviderManifestV3(manifest) {
|
|
|
83
83
|
const path = `credentialProfiles[${index}]`;
|
|
84
84
|
if (!nonEmpty(binding.id) || bindingIds.has(binding.id)) add(diagnostics, "provider_manifest_credential_binding_id_invalid", `${path}.id`, "Credential binding IDs must be non-empty and unique.");
|
|
85
85
|
bindingIds.add(binding.id);
|
|
86
|
-
if (
|
|
86
|
+
if (binding.source !== "service-vault") add(diagnostics, "provider_manifest_credential_binding_source_invalid", `${path}.source`, "Credential bindings must use the service vault.");
|
|
87
87
|
if (!nonEmpty(binding.reference)) add(diagnostics, "provider_manifest_credential_binding_reference_required", `${path}.reference`, "Credential binding reference is required.");
|
|
88
|
-
if (binding.source === "process-environment" && !/^TREESEED_[A-Z0-9_]+$/u.test(binding.reference)) add(diagnostics, "provider_manifest_credential_environment_invalid", `${path}.reference`, "Process-environment bindings must name a TREESEED_* variable.");
|
|
89
88
|
}
|
|
90
89
|
if (!Array.isArray(manifest?.lanes) || manifest.lanes.length === 0) add(diagnostics, "provider_manifest_lanes_required", "lanes", "At least one provider lane is required.");
|
|
91
90
|
const laneIds = /* @__PURE__ */ new Set();
|
|
@@ -134,12 +133,11 @@ function validateCapacityProviderManifestV3(manifest) {
|
|
|
134
133
|
if (!nonEmpty(adapter.id) || adapterIds.has(adapter.id)) add(diagnostics, "provider_adapter_id_invalid", `${path}.id`, "Adapter id must be non-empty and unique.");
|
|
135
134
|
adapterIds.add(adapter.id);
|
|
136
135
|
if (!nonEmpty(adapter.adapter)) add(diagnostics, "provider_adapter_required", `${path}.adapter`, "Adapter implementation is required.");
|
|
137
|
-
if (
|
|
136
|
+
if (adapter.isolation !== "microvm") add(diagnostics, "provider_adapter_isolation_invalid", `${path}.isolation`, "Adapters must use microVM isolation.");
|
|
138
137
|
if (!Number.isInteger(adapter.maxConcurrentWorkers) || adapter.maxConcurrentWorkers < 1 || adapter.maxConcurrentWorkers > manifest.capacity.maxConcurrentWorkers) add(diagnostics, "provider_adapter_concurrency_invalid", `${path}.maxConcurrentWorkers`, "Adapter concurrency must be positive and no greater than provider capacity.");
|
|
139
138
|
if (!Array.isArray(adapter.laneIds) || adapter.laneIds.length === 0) add(diagnostics, "provider_adapter_lanes_required", `${path}.laneIds`, "Every adapter must serve at least one lane.");
|
|
140
139
|
for (const laneId of adapter.laneIds ?? []) if (!laneIds.has(laneId)) add(diagnostics, "provider_adapter_lane_unknown", `${path}.laneIds`, `Adapter references unknown lane ${laneId}.`);
|
|
141
140
|
for (const bindingId of adapter.credentialProfiles ?? []) if (!bindingIds.has(bindingId)) add(diagnostics, "provider_adapter_credential_unknown", `${path}.credentialProfiles`, `Adapter references unknown credential profile ${bindingId}.`);
|
|
142
|
-
if ((adapter.laneIds ?? []).some((laneId) => (manifest.lanes ?? []).find((lane) => lane.id === laneId)?.purpose === "platform") && adapter.isolation !== "process") add(diagnostics, "provider_platform_adapter_isolation_required", `${path}.isolation`, "Platform adapters require process isolation.");
|
|
143
141
|
if (!adapter.nativeLimits || typeof adapter.nativeLimits !== "object" || Array.isArray(adapter.nativeLimits)) add(diagnostics, "provider_adapter_limits_invalid", `${path}.nativeLimits`, "Adapter nativeLimits must be an object.");
|
|
144
142
|
for (const entry of validateExecutionProviderRuntimeConfiguration(adapter, path).diagnostics) add(diagnostics, entry.code, entry.path, entry.message);
|
|
145
143
|
if (adapter.researchSourcePolicy !== void 0) for (const diagnostic of validateResearchSourcePolicy(adapter.researchSourcePolicy).diagnostics) add(diagnostics, diagnostic.code, `${path}.researchSourcePolicy.${diagnostic.path}`, diagnostic.message);
|
|
@@ -173,17 +171,7 @@ function validateCapacityProviderManifestV3(manifest) {
|
|
|
173
171
|
}
|
|
174
172
|
if (providerIds.size > 1) add(diagnostics, "provider_connection_identity_mismatch", "connections", "Every connection in one provider manifest must reference the same global provider identity.");
|
|
175
173
|
if (explicitShare > 100) add(diagnostics, "provider_connection_share_exceeded", "connections", "Explicit connection shares may not exceed 100 percent.");
|
|
176
|
-
|
|
177
|
-
}
|
|
178
|
-
function validateCapacityProviderManifestV4(manifest) {
|
|
179
|
-
const compatible = {
|
|
180
|
-
...manifest,
|
|
181
|
-
schemaVersion: 3,
|
|
182
|
-
adapters: manifest.adapters.map((adapter) => ({ ...adapter, isolation: adapter.isolation === "microvm" ? "process" : adapter.isolation }))
|
|
183
|
-
};
|
|
184
|
-
const diagnostics = validateCapacityProviderManifestV3(compatible).diagnostics;
|
|
185
|
-
if (manifest.schemaVersion !== 4) add(diagnostics, "provider_manifest_schema_invalid", "schemaVersion", "Capacity provider manifest schemaVersion must be 4.");
|
|
186
|
-
if (manifest.sandbox?.required !== true || manifest.sandbox?.runtime !== "kata-runtime-rs-qemu") add(diagnostics, "provider_sandbox_required", "sandbox", "Manifest v4 requires the Kata runtime-rs QEMU sandbox.");
|
|
174
|
+
if (manifest.sandbox?.required !== true || manifest.sandbox?.runtime !== "kata-runtime-rs-qemu") add(diagnostics, "provider_sandbox_required", "sandbox", "Capacity providers require the Kata runtime-rs QEMU sandbox.");
|
|
187
175
|
if (!manifest.sandbox?.brokerSocket?.startsWith("/run/treeseed/")) add(diagnostics, "provider_sandbox_socket_invalid", "sandbox.brokerSocket", "Sandbox broker socket must remain under /run/treeseed.");
|
|
188
176
|
const profiles = new Set((manifest.sandbox?.profiles ?? []).map((profile) => profile.id));
|
|
189
177
|
for (const [index, profile] of (manifest.sandbox?.profiles ?? []).entries()) {
|
|
@@ -195,24 +183,8 @@ function validateCapacityProviderManifestV4(manifest) {
|
|
|
195
183
|
if (!/^sha256:[a-f0-9]{64}$/u.test(profile.guestImageDigest)) add(diagnostics, "provider_sandbox_image_digest_invalid", `sandbox.profiles[${index}].guestImageDigest`, "Guest images require an immutable SHA-256 digest.");
|
|
196
184
|
if (profile.defaultDenyNetwork !== true) add(diagnostics, "provider_sandbox_network_policy_invalid", `sandbox.profiles[${index}].defaultDenyNetwork`, "Sandbox networking must default deny.");
|
|
197
185
|
}
|
|
198
|
-
for (const [index, adapter] of manifest.adapters.entries()) {
|
|
199
|
-
if (adapter.isolation !== "microvm") add(diagnostics, "provider_v4_microvm_required", `adapters[${index}].isolation`, "Manifest v4 adapters must use microvm isolation.");
|
|
200
|
-
for (const profile of adapter.sandboxProfileIds ?? []) if (!profiles.has(profile)) add(diagnostics, "provider_sandbox_profile_unknown", `adapters[${index}].sandboxProfileIds`, `Unknown sandbox profile ${profile}.`);
|
|
201
|
-
for (const [purpose, profile] of Object.entries(adapter.defaultSandboxProfiles ?? {})) if (!profiles.has(profile)) add(diagnostics, "provider_sandbox_default_unknown", `adapters[${index}].defaultSandboxProfiles.${purpose}`, `Unknown default sandbox profile ${profile}.`);
|
|
202
|
-
}
|
|
203
|
-
return result(diagnostics);
|
|
204
|
-
}
|
|
205
|
-
function validateCapacityProviderManifestV5(manifest) {
|
|
206
|
-
const compatible = { ...manifest, schemaVersion: 4, adapters: manifest.adapters.map((adapter) => ({
|
|
207
|
-
...adapter,
|
|
208
|
-
capabilities: [...new Set(adapter.offers.flatMap(({ offer }) => offer.capabilities.map(({ id }) => id)))],
|
|
209
|
-
sandboxProfileIds: [...new Set(adapter.offers.map(({ sandboxProfileId }) => sandboxProfileId))],
|
|
210
|
-
defaultSandboxProfiles: void 0
|
|
211
|
-
})) };
|
|
212
|
-
const diagnostics = validateCapacityProviderManifestV4(compatible).diagnostics.filter((entry) => entry.code !== "provider_sandbox_default_unknown");
|
|
213
|
-
if (manifest.schemaVersion !== 5) add(diagnostics, "provider_manifest_schema_invalid", "schemaVersion", "Capacity provider manifest schemaVersion must be 5.");
|
|
214
186
|
if (!Number.isInteger(manifest.ontology?.generation) || manifest.ontology.generation < 1 || !/^sha256:[a-f0-9]{64}$/u.test(manifest.ontology?.digest ?? "")) add(diagnostics, "provider_ontology_binding_invalid", "ontology", "Manifest v5 requires an exact ontology generation and digest.");
|
|
215
|
-
const
|
|
187
|
+
const offerIds = /* @__PURE__ */ new Set();
|
|
216
188
|
for (const [profileIndex, profile] of manifest.sandbox.profiles.entries()) {
|
|
217
189
|
if (!profile.lineage || !/^sha256:[a-f0-9]{64}$/u.test(profile.lineage.baseImageDigest) || !/^sha256:[a-f0-9]{64}$/u.test(profile.lineage.provenanceDigest) || !profile.lineage.architectures.length || !profile.lineage.signature.value) add(diagnostics, "provider_sandbox_lineage_required", `sandbox.profiles[${profileIndex}].lineage`, "Manifest v5 sandbox images require signed exact sandbox-base lineage and architectures.");
|
|
218
190
|
}
|
|
@@ -241,8 +213,6 @@ export {
|
|
|
241
213
|
capacityProviderSecurityDefaults,
|
|
242
214
|
nonEmpty,
|
|
243
215
|
result,
|
|
244
|
-
validateCapacityProviderManifestV3,
|
|
245
|
-
validateCapacityProviderManifestV4,
|
|
246
216
|
validateCapacityProviderManifestV5,
|
|
247
217
|
validateCapacityProviderProofPayload,
|
|
248
218
|
validateCapacityProviderPublicJwk,
|