@treeseed/sdk 0.13.0-rc.20 → 0.13.0-rc.22
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/validation/agent-definition-schema.d.ts +108 -108
- package/dist/content/validation/content-model-schemas.d.ts +198 -198
- package/dist/content/validation/portable-content-data.d.ts +18 -18
- package/dist/operator-contracts/control-plane-operations.d.ts +4 -0
- package/dist/operator-contracts/control-plane-operations.js +1 -0
- package/dist/operator-contracts/operation-builder.js +3 -2
- package/dist/operator-contracts/seed/seed-bundle.d.ts +2 -2
- package/dist/operator-contracts/seed/seed-bundle.js +5 -1
- package/dist/treedx/client.d.ts +8 -0
- package/dist/treedx/contract.d.ts +5 -5
- package/package.json +2 -2
|
@@ -256,14 +256,14 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
256
256
|
operations: string[];
|
|
257
257
|
filters?: Record<string, unknown> | undefined;
|
|
258
258
|
}> | undefined;
|
|
259
|
-
commit?: {
|
|
260
|
-
allowed: boolean;
|
|
261
|
-
} | undefined;
|
|
262
259
|
repository?: {
|
|
263
260
|
allowCodeMutation?: boolean | undefined;
|
|
264
261
|
readPaths?: string[] | undefined;
|
|
265
262
|
writePaths?: string[] | undefined;
|
|
266
263
|
} | undefined;
|
|
264
|
+
commit?: {
|
|
265
|
+
allowed: boolean;
|
|
266
|
+
} | undefined;
|
|
267
267
|
network?: {
|
|
268
268
|
allowWeb?: boolean | undefined;
|
|
269
269
|
allowedDomains?: string[] | undefined;
|
|
@@ -278,14 +278,14 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
278
278
|
operations: string[];
|
|
279
279
|
filters?: Record<string, unknown> | undefined;
|
|
280
280
|
}> | undefined;
|
|
281
|
-
commit?: {
|
|
282
|
-
allowed: boolean;
|
|
283
|
-
} | undefined;
|
|
284
281
|
repository?: {
|
|
285
282
|
allowCodeMutation?: boolean | undefined;
|
|
286
283
|
readPaths?: string[] | undefined;
|
|
287
284
|
writePaths?: string[] | undefined;
|
|
288
285
|
} | undefined;
|
|
286
|
+
commit?: {
|
|
287
|
+
allowed: boolean;
|
|
288
|
+
} | undefined;
|
|
289
289
|
network?: {
|
|
290
290
|
allowWeb?: boolean | undefined;
|
|
291
291
|
allowedDomains?: string[] | undefined;
|
|
@@ -915,14 +915,14 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
915
915
|
operations: string[];
|
|
916
916
|
filters?: Record<string, unknown> | undefined;
|
|
917
917
|
}> | undefined;
|
|
918
|
-
commit?: {
|
|
919
|
-
allowed: boolean;
|
|
920
|
-
} | undefined;
|
|
921
918
|
repository?: {
|
|
922
919
|
allowCodeMutation?: boolean | undefined;
|
|
923
920
|
readPaths?: string[] | undefined;
|
|
924
921
|
writePaths?: string[] | undefined;
|
|
925
922
|
} | undefined;
|
|
923
|
+
commit?: {
|
|
924
|
+
allowed: boolean;
|
|
925
|
+
} | undefined;
|
|
926
926
|
network?: {
|
|
927
927
|
allowWeb?: boolean | undefined;
|
|
928
928
|
allowedDomains?: string[] | undefined;
|
|
@@ -1088,14 +1088,14 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
1088
1088
|
operations: string[];
|
|
1089
1089
|
filters?: Record<string, unknown> | undefined;
|
|
1090
1090
|
}> | undefined;
|
|
1091
|
-
commit?: {
|
|
1092
|
-
allowed: boolean;
|
|
1093
|
-
} | undefined;
|
|
1094
1091
|
repository?: {
|
|
1095
1092
|
allowCodeMutation?: boolean | undefined;
|
|
1096
1093
|
readPaths?: string[] | undefined;
|
|
1097
1094
|
writePaths?: string[] | undefined;
|
|
1098
1095
|
} | undefined;
|
|
1096
|
+
commit?: {
|
|
1097
|
+
allowed: boolean;
|
|
1098
|
+
} | undefined;
|
|
1099
1099
|
network?: {
|
|
1100
1100
|
allowWeb?: boolean | undefined;
|
|
1101
1101
|
allowedDomains?: string[] | undefined;
|
|
@@ -1261,14 +1261,14 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
1261
1261
|
operations: string[];
|
|
1262
1262
|
filters?: Record<string, unknown> | undefined;
|
|
1263
1263
|
}> | undefined;
|
|
1264
|
-
commit?: {
|
|
1265
|
-
allowed: boolean;
|
|
1266
|
-
} | undefined;
|
|
1267
1264
|
repository?: {
|
|
1268
1265
|
allowCodeMutation?: boolean | undefined;
|
|
1269
1266
|
readPaths?: string[] | undefined;
|
|
1270
1267
|
writePaths?: string[] | undefined;
|
|
1271
1268
|
} | undefined;
|
|
1269
|
+
commit?: {
|
|
1270
|
+
allowed: boolean;
|
|
1271
|
+
} | undefined;
|
|
1272
1272
|
network?: {
|
|
1273
1273
|
allowWeb?: boolean | undefined;
|
|
1274
1274
|
allowedDomains?: string[] | undefined;
|
|
@@ -1434,14 +1434,14 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
1434
1434
|
operations: string[];
|
|
1435
1435
|
filters?: Record<string, unknown> | undefined;
|
|
1436
1436
|
}> | undefined;
|
|
1437
|
-
commit?: {
|
|
1438
|
-
allowed: boolean;
|
|
1439
|
-
} | undefined;
|
|
1440
1437
|
repository?: {
|
|
1441
1438
|
allowCodeMutation?: boolean | undefined;
|
|
1442
1439
|
readPaths?: string[] | undefined;
|
|
1443
1440
|
writePaths?: string[] | undefined;
|
|
1444
1441
|
} | undefined;
|
|
1442
|
+
commit?: {
|
|
1443
|
+
allowed: boolean;
|
|
1444
|
+
} | undefined;
|
|
1445
1445
|
network?: {
|
|
1446
1446
|
allowWeb?: boolean | undefined;
|
|
1447
1447
|
allowedDomains?: string[] | undefined;
|
|
@@ -646,6 +646,10 @@ export declare const CONTROL_PLANE_OPERATIONS: {
|
|
|
646
646
|
projectId: string;
|
|
647
647
|
repoId: string;
|
|
648
648
|
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
649
|
+
readonly retire: ControlPlaneOperationBinding<{
|
|
650
|
+
projectId: string;
|
|
651
|
+
repoId: string;
|
|
652
|
+
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
649
653
|
readonly status: ControlPlaneOperationBinding<{
|
|
650
654
|
projectId: string;
|
|
651
655
|
repoId: string;
|
|
@@ -365,6 +365,7 @@ const CONTROL_PLANE_OPERATIONS = {
|
|
|
365
365
|
list: treedxProxy("treedx.repositories.list", "listRepositories", "GET", "/v1/dx/projects/{projectId}/repos", { projectId: z.string().min(1) }, { pagination: "cursor" }),
|
|
366
366
|
create: treedxProxy("treedx.repositories.create", "createRepository", "POST", "/v1/dx/projects/{projectId}/repos", { projectId: z.string().min(1) }),
|
|
367
367
|
show: treedxProxy("treedx.repositories.show", "getRepository", "GET", "/v1/dx/projects/{projectId}/repos/{repoId}", { projectId: z.string().min(1), repoId: z.string().min(1) }),
|
|
368
|
+
retire: treedxProxy("treedx.repositories.retire", "retireRepository", "DELETE", "/v1/dx/projects/{projectId}/repos/{repoId}", { projectId: z.string().min(1), repoId: z.string().min(1) }, { risk: "destructive", surfaces: ["internal"] }),
|
|
368
369
|
status: treedxProxy("treedx.repositories.status", "getRepositoryStatus", "GET", "/v1/dx/projects/{projectId}/repos/{repoId}/status", { projectId: z.string().min(1), repoId: z.string().min(1) }),
|
|
369
370
|
refs: treedxProxy("treedx.repositories.refs", "listRepositoryRefs", "GET", "/v1/dx/projects/{projectId}/repos/{repoId}/refs", { projectId: z.string().min(1), repoId: z.string().min(1) }),
|
|
370
371
|
sync: treedxProxy("treedx.repositories.sync", "syncRepository", "POST", "/v1/dx/projects/{projectId}/repos/{repoId}/sync", { projectId: z.string().min(1), repoId: z.string().min(1) }),
|
|
@@ -32,10 +32,11 @@ const record = z.record(z.unknown());
|
|
|
32
32
|
function defineTreeDxProxyOperation(operationId, upstreamOperationId, method, path, pathShape, options = {}) {
|
|
33
33
|
const kind = options.read ?? method === "GET" ? "read" : "mutation";
|
|
34
34
|
const riskClass = options.risk ?? "ordinary";
|
|
35
|
+
const surfaces = options.surfaces ?? ["rest", "mcp_tool", ...method === "GET" ? ["mcp_resource"] : []];
|
|
35
36
|
return defineOperation({
|
|
36
37
|
operationId,
|
|
37
38
|
description: `${kind === "read" ? "Read" : "Apply"} ${operationId} through the project-scoped TreeDX proxy.`,
|
|
38
|
-
rest: { method, path },
|
|
39
|
+
...surfaces.includes("rest") ? { rest: { method, path } } : {},
|
|
39
40
|
...Object.keys(pathShape).length ? { parameters: `treeseed.${operationId}.parameters/v1` } : {},
|
|
40
41
|
capability: kind === "read" ? "treedx.read" : "treedx.write",
|
|
41
42
|
authentication: "oauth_or_provider",
|
|
@@ -43,7 +44,7 @@ function defineTreeDxProxyOperation(operationId, upstreamOperationId, method, pa
|
|
|
43
44
|
kind,
|
|
44
45
|
riskClass,
|
|
45
46
|
confirmation: riskClass === "ordinary" ? "never" : "input_required",
|
|
46
|
-
surfaces
|
|
47
|
+
surfaces,
|
|
47
48
|
cacheScope: kind === "read" ? "project" : "none",
|
|
48
49
|
pagination: options.pagination ?? "none",
|
|
49
50
|
...upstreamOperationId ? { upstream: { service: "treedx", operationId: upstreamOperationId, contractVersion: TREEDX_OPENAPI_CONTRACT.openapiVersion, contractDigest: TREEDX_OPENAPI_CONTRACT.openapiSha256 } } : {}
|
|
@@ -43,7 +43,7 @@ export interface SeedRepositoryPolicy {
|
|
|
43
43
|
export interface SeedRepositoryResource {
|
|
44
44
|
key: string;
|
|
45
45
|
project: string;
|
|
46
|
-
role: 'primary' | '
|
|
46
|
+
role: 'primary' | 'fixture' | 'support' | 'template';
|
|
47
47
|
provider: 'github';
|
|
48
48
|
owner: string;
|
|
49
49
|
name: string;
|
|
@@ -61,7 +61,7 @@ export interface SeedProjectResource {
|
|
|
61
61
|
name: string;
|
|
62
62
|
description: string;
|
|
63
63
|
kind: string;
|
|
64
|
-
primaryRepository
|
|
64
|
+
primaryRepository?: string;
|
|
65
65
|
metadata?: Record<string, unknown>;
|
|
66
66
|
}
|
|
67
67
|
export interface SeedCapacityProviderPrerequisite {
|
|
@@ -33,7 +33,11 @@ function validateSeedBundle(bundle) {
|
|
|
33
33
|
}
|
|
34
34
|
for (const [index, project] of (bundle?.resources?.projects ?? []).entries()) {
|
|
35
35
|
if (!teams.has(project.team)) add("seed_bundle_project_team_unknown", `resources.projects[${index}].team`, "Project references an unknown team.");
|
|
36
|
-
if (!
|
|
36
|
+
if (!project.primaryRepository && project.kind !== "content") add("seed_bundle_primary_repository_required", `resources.projects[${index}].primaryRepository`, "Non-content projects require a primary source repository.");
|
|
37
|
+
if (project.primaryRepository && !repositories.has(project.primaryRepository)) add("seed_bundle_primary_repository_unknown", `resources.projects[${index}].primaryRepository`, "Project primary repository is missing.");
|
|
38
|
+
}
|
|
39
|
+
for (const [index, repository] of (bundle?.resources?.repositories ?? []).entries()) {
|
|
40
|
+
if (repository.role === "content") add("seed_bundle_content_repository_forbidden", `resources.repositories[${index}].role`, "Virtual knowledge repositories are derived by TreeDX and must not be declared as Git repositories.");
|
|
37
41
|
}
|
|
38
42
|
for (const [index, provider] of (bundle?.runtime?.capacityProviders ?? []).entries()) {
|
|
39
43
|
if (!teams.has(provider.team)) add("seed_bundle_provider_team_unknown", `runtime.capacityProviders[${index}].team`, "Provider references an unknown team.");
|
package/dist/treedx/client.d.ts
CHANGED
|
@@ -36,6 +36,10 @@ export declare const TREESEED_TREEDX_OPERATIONS: {
|
|
|
36
36
|
projectId: string;
|
|
37
37
|
repoId: string;
|
|
38
38
|
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
39
|
+
readonly retire: ControlPlaneOperationBinding<{
|
|
40
|
+
projectId: string;
|
|
41
|
+
repoId: string;
|
|
42
|
+
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
39
43
|
readonly status: ControlPlaneOperationBinding<{
|
|
40
44
|
projectId: string;
|
|
41
45
|
repoId: string;
|
|
@@ -330,6 +334,10 @@ export declare class TreeSeedTreeDxClient {
|
|
|
330
334
|
projectId: string;
|
|
331
335
|
repoId: string;
|
|
332
336
|
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
337
|
+
readonly retire: ControlPlaneOperationBinding<{
|
|
338
|
+
projectId: string;
|
|
339
|
+
repoId: string;
|
|
340
|
+
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
333
341
|
readonly status: ControlPlaneOperationBinding<{
|
|
334
342
|
projectId: string;
|
|
335
343
|
repoId: string;
|
|
@@ -13,11 +13,11 @@ export declare function treeDxProxyOperationMapping(): {
|
|
|
13
13
|
export declare function validateTreeDxProxyOperationMapping(): string[];
|
|
14
14
|
export declare function createTreeDxServiceContractReceipt(controlPlaneCatalogDigest: `sha256:${string}`, evidence: TreeDxAdoptionEvidence): Promise<{
|
|
15
15
|
readonly schema: "treeseed.treedx-service-contract/v1";
|
|
16
|
-
readonly treedxPackageVersion: "0.3.0-rc.
|
|
17
|
-
readonly treedxOpenapiVersion: "0.11.
|
|
18
|
-
readonly treedxOpenapiDigest: "sha256:
|
|
19
|
-
readonly treedxOperationInventoryDigest: "sha256:
|
|
20
|
-
readonly treedxGeneratedTypesDigest: "sha256:
|
|
16
|
+
readonly treedxPackageVersion: "0.3.0-rc.4";
|
|
17
|
+
readonly treedxOpenapiVersion: "0.11.1";
|
|
18
|
+
readonly treedxOpenapiDigest: "sha256:7c045a99cb0e5ddfb750f060206db374fce86f94dbefecd377bf3e8a5e182ff4";
|
|
19
|
+
readonly treedxOperationInventoryDigest: "sha256:a9a36b3def243d1fb58f149dd1f93fc6c56e4193eecc1bb4184c0c20b36e54f0";
|
|
20
|
+
readonly treedxGeneratedTypesDigest: "sha256:ff51298be834c3931e725fe017e0def59a23c80998740b2ba1ddbd5ac5e5eca5";
|
|
21
21
|
readonly treedxSourceCommit: string;
|
|
22
22
|
readonly treedxPackageArtifactDigest: `sha256:${string}`;
|
|
23
23
|
readonly controlPlaneCatalogDigest: `sha256:${string}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@treeseed/sdk",
|
|
3
|
-
"version": "0.13.0-rc.
|
|
3
|
+
"version": "0.13.0-rc.22",
|
|
4
4
|
"description": "Portable TreeSeed contracts, standards, and typed remote control-plane clients.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"standards:release-evidence": "node --import tsx ./scripts/standards/create-release-evidence.ts"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@treeseed/treedx": "0.3.0-rc.
|
|
52
|
+
"@treeseed/treedx": "0.3.0-rc.4",
|
|
53
53
|
"esbuild": "^0.28.0",
|
|
54
54
|
"typescript": "^5.9.3",
|
|
55
55
|
"yaml": "^2.8.1",
|