@treeseed/sdk 0.13.0-rc.85 → 0.13.0-rc.87
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/configuration/secrets-capability.d.ts +2 -2
- package/dist/configuration/secrets-capability.js +2 -2
- package/dist/content/validation/content-model-schemas.d.ts +1 -1
- package/dist/deployment/hosted-topology-template.d.ts +6 -6
- package/dist/deployment/hosted-topology-template.js +1 -1
- package/dist/deployment/hosted-topology.d.ts +73 -214
- package/dist/deployment/hosted-topology.js +30 -64
- package/dist/operator-contracts/canonical-command-tree.js +2 -2
- package/dist/operator-contracts/catalog/hosted-topology-operations.d.ts +4 -31
- package/dist/operator-contracts/catalog/hosted-topology-operations.js +7 -12
- package/dist/operator-contracts/catalog/services/secret-operations.d.ts +62 -0
- package/dist/operator-contracts/catalog/services/secret-operations.js +51 -0
- package/dist/operator-contracts/control-plane-operations.d.ts +61 -48
- package/dist/operator-contracts/control-plane-operations.js +3 -4
- package/dist/secrets-capability/github-actions-encryption.d.ts +2 -0
- package/dist/secrets-capability/github-actions-encryption.js +11 -0
- package/dist/secrets-capability/provider-operation-contracts.d.ts +1 -1
- package/dist/secrets-capability/secret-contracts.d.ts +33 -0
- package/dist/secrets-capability/secret-contracts.js +49 -0
- package/dist/secrets-capability/service-provider-contracts.d.ts +2 -2
- package/dist/secrets-capability/service-provider-contracts.js +15 -31
- package/package.json +1 -1
- package/dist/operator-contracts/catalog/services/service-vault-operations.d.ts +0 -17
- package/dist/operator-contracts/catalog/services/service-vault-operations.js +0 -158
- package/dist/secrets-capability/service-vault-contracts.d.ts +0 -108
- package/dist/secrets-capability/service-vault-contracts.js +0 -74
- package/dist/secrets-capability/service-vault-crypto.d.ts +0 -20
- package/dist/secrets-capability/service-vault-crypto.js +0 -210
|
@@ -91,7 +91,7 @@ const hostedTopologyDeclarationSchema = z.object({
|
|
|
91
91
|
deploymentId: custodyIdentifier,
|
|
92
92
|
stackId: custodyIdentifier,
|
|
93
93
|
environment: hostedEnvironmentSchema,
|
|
94
|
-
mutation: z.literal("
|
|
94
|
+
mutation: z.literal("agent-authorized"),
|
|
95
95
|
platform: z.object({ repository: z.literal("treeseed-ai/platform"), commit: gitCommit }).strict(),
|
|
96
96
|
stateBackend: z.object({ connectionRef: identifier }).strict(),
|
|
97
97
|
providerConnections: z.record(hostedProviderSchema, z.object({ connectionRef: identifier }).strict()),
|
|
@@ -146,7 +146,7 @@ const hostedTopologyPlanShape = {
|
|
|
146
146
|
providerResourceId: z.string().min(1).max(512).nullable()
|
|
147
147
|
}).strict()),
|
|
148
148
|
blockers: z.array(z.object({ code: z.enum(["connection-unavailable", "state-backend-unavailable", "dependency-cycle", "observation-unhealthy", "adoption-drift"]), resourceId: identifier.optional(), message: z.string().min(1) }).strict()),
|
|
149
|
-
|
|
149
|
+
authorization: z.literal("authenticated-agent"),
|
|
150
150
|
executable: z.literal(false)
|
|
151
151
|
};
|
|
152
152
|
function verifyPlanBinding(plan, context) {
|
|
@@ -173,30 +173,18 @@ function verifyPlanBinding(plan, context) {
|
|
|
173
173
|
artifacts: plan.artifacts,
|
|
174
174
|
providerConnections: plan.providerConnections,
|
|
175
175
|
actions: plan.actions,
|
|
176
|
-
blockers: plan.blockers
|
|
176
|
+
blockers: plan.blockers,
|
|
177
|
+
authorization: plan.authorization
|
|
177
178
|
};
|
|
178
179
|
const expected = deploymentDigest(core);
|
|
179
180
|
if (expected !== plan.planDigest || plan.planId !== `topology-plan-${expected.slice(7, 23)}`)
|
|
180
181
|
context.addIssue({ code: z.ZodIssueCode.custom, path: ["planDigest"], message: "Hosted topology plan identity must bind the exact canonical plan." });
|
|
181
182
|
}
|
|
182
183
|
const hostedTopologyPlanSchema = z.object(hostedTopologyPlanShape).strict().superRefine(verifyPlanBinding);
|
|
183
|
-
const hostedTopologyApprovalSchema = z.object({
|
|
184
|
-
schemaVersion: z.literal("treeseed.hosted-topology-approval/v1"),
|
|
185
|
-
planDigest: digest,
|
|
186
|
-
teamId: custodyIdentifier,
|
|
187
|
-
deploymentId: custodyIdentifier,
|
|
188
|
-
stackId: custodyIdentifier,
|
|
189
|
-
environment: hostedEnvironmentSchema,
|
|
190
|
-
backendBindingDigest: digest,
|
|
191
|
-
decision: z.literal("approved"),
|
|
192
|
-
approvedBy: z.string().min(1).max(256),
|
|
193
|
-
approvedAt: timestamp
|
|
194
|
-
}).strict();
|
|
195
184
|
const authorizedHostedTopologyPlanSchema = z.object({
|
|
196
185
|
...hostedTopologyPlanShape,
|
|
197
|
-
executable: z.literal(true)
|
|
198
|
-
|
|
199
|
-
}).strict().omit({ approvalRequired: true }).superRefine(verifyPlanBinding);
|
|
186
|
+
executable: z.literal(true)
|
|
187
|
+
}).strict().superRefine(verifyPlanBinding);
|
|
200
188
|
const hostedTopologyReceiptSchema = z.object({
|
|
201
189
|
schemaVersion: z.literal("treeseed.hosted-topology-receipt/v1"),
|
|
202
190
|
receiptId: z.string().regex(/^topology-receipt-[a-f0-9]{16}$/u),
|
|
@@ -230,19 +218,19 @@ const hostedTopologyRollbackSchema = z.object({
|
|
|
230
218
|
targetDigest: digest.nullable()
|
|
231
219
|
}).strict()),
|
|
232
220
|
rollbackDigest: digest
|
|
233
|
-
}).strict()
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
})
|
|
221
|
+
}).strict().superRefine((rollback, context) => {
|
|
222
|
+
const core = {
|
|
223
|
+
sourceReceiptId: rollback.sourceReceiptId,
|
|
224
|
+
teamId: rollback.teamId,
|
|
225
|
+
deploymentId: rollback.deploymentId,
|
|
226
|
+
stackId: rollback.stackId,
|
|
227
|
+
environment: rollback.environment,
|
|
228
|
+
backendBindingDigest: rollback.backendBindingDigest,
|
|
229
|
+
operations: rollback.operations
|
|
230
|
+
};
|
|
231
|
+
if (deploymentDigest(core) !== rollback.rollbackDigest || rollback.rollbackId !== `topology-rollback-${rollback.rollbackDigest.slice(7, 23)}`)
|
|
232
|
+
context.addIssue({ code: z.ZodIssueCode.custom, path: ["rollbackDigest"], message: "Hosted topology rollback identity must bind the exact rollback custody and operations." });
|
|
233
|
+
});
|
|
246
234
|
const hostedTopologyRollbackExecutionSchema = z.object({
|
|
247
235
|
schemaVersion: z.literal("treeseed.hosted-topology-rollback-execution/v1"),
|
|
248
236
|
rollback: hostedTopologyRollbackSchema,
|
|
@@ -271,18 +259,6 @@ const hostedTopologyRollbackExecutionSchema = z.object({
|
|
|
271
259
|
};
|
|
272
260
|
if (deploymentDigest(core) !== execution.executionDigest) context.addIssue({ code: z.ZodIssueCode.custom, path: ["executionDigest"], message: "Hosted rollback execution digest does not bind its complete source and target closure." });
|
|
273
261
|
});
|
|
274
|
-
const hostedTopologyRollbackExecutionApprovalSchema = z.object({
|
|
275
|
-
schemaVersion: z.literal("treeseed.hosted-topology-rollback-execution-approval/v1"),
|
|
276
|
-
executionDigest: digest,
|
|
277
|
-
teamId: custodyIdentifier,
|
|
278
|
-
deploymentId: custodyIdentifier,
|
|
279
|
-
stackId: custodyIdentifier,
|
|
280
|
-
environment: hostedEnvironmentSchema,
|
|
281
|
-
backendBindingDigest: digest,
|
|
282
|
-
decision: z.literal("approved"),
|
|
283
|
-
approvedBy: z.string().min(1).max(256),
|
|
284
|
-
approvedAt: timestamp
|
|
285
|
-
}).strict();
|
|
286
262
|
function observationMap(items, declaration) {
|
|
287
263
|
const resources = new Map(declaration.resources.map((resource) => [resource.id, resource]));
|
|
288
264
|
const observations = /* @__PURE__ */ new Map();
|
|
@@ -372,20 +348,17 @@ function planHostedTopology(input) {
|
|
|
372
348
|
artifacts: normalizedDeclaration.artifacts,
|
|
373
349
|
providerConnections,
|
|
374
350
|
actions,
|
|
375
|
-
blockers
|
|
351
|
+
blockers,
|
|
352
|
+
authorization: "authenticated-agent"
|
|
376
353
|
};
|
|
377
354
|
const planDigest = deploymentDigest(core);
|
|
378
|
-
return hostedTopologyPlanSchema.parse({ schemaVersion: "treeseed.hosted-topology-plan/v1", planId: `topology-plan-${planDigest.slice(7, 23)}`, planDigest, ...core,
|
|
355
|
+
return hostedTopologyPlanSchema.parse({ schemaVersion: "treeseed.hosted-topology-plan/v1", planId: `topology-plan-${planDigest.slice(7, 23)}`, planDigest, ...core, executable: false });
|
|
379
356
|
}
|
|
380
|
-
function authorizeHostedTopologyPlan(planInput
|
|
357
|
+
function authorizeHostedTopologyPlan(planInput) {
|
|
381
358
|
const plan = hostedTopologyPlanSchema.parse(planInput);
|
|
382
359
|
if (plan.blockers.length) throw new Error("Hosted topology plan has unresolved blockers.");
|
|
383
360
|
if (!plan.stateBackend) throw new Error("Hosted topology plan has no state backend authority.");
|
|
384
|
-
|
|
385
|
-
if (plan.approvalRequired && !approval) throw new Error("Hosted topology mutation requires environment approval.");
|
|
386
|
-
if (approval && (approval.planDigest !== plan.planDigest || approval.teamId !== plan.teamId || approval.deploymentId !== plan.deploymentId || approval.stackId !== plan.stackId || approval.environment !== plan.environment || approval.backendBindingDigest !== plan.stateBackend.bindingDigest)) throw new Error("Hosted topology approval does not bind the exact plan custody and backend.");
|
|
387
|
-
const { approvalRequired: _approvalRequired, ...approvedPlan } = plan;
|
|
388
|
-
return authorizedHostedTopologyPlanSchema.parse({ ...approvedPlan, executable: true, approval });
|
|
361
|
+
return authorizedHostedTopologyPlanSchema.parse({ ...plan, executable: true });
|
|
389
362
|
}
|
|
390
363
|
function verifyHostedTopologyReadback(input) {
|
|
391
364
|
const plan = authorizedHostedTopologyPlanSchema.parse(input.plan);
|
|
@@ -428,14 +401,12 @@ function planHostedTopologyRollback(receiptInput) {
|
|
|
428
401
|
const rollbackDigest = deploymentDigest({ sourceReceiptId: receipt.receiptId, ...custody, operations });
|
|
429
402
|
return hostedTopologyRollbackSchema.parse({ schemaVersion: "treeseed.hosted-topology-rollback/v1", rollbackId: `topology-rollback-${rollbackDigest.slice(7, 23)}`, sourceReceiptId: receipt.receiptId, ...custody, operations, rollbackDigest });
|
|
430
403
|
}
|
|
431
|
-
function authorizeHostedTopologyRollback(rollbackInput
|
|
432
|
-
|
|
433
|
-
if (approval.rollbackDigest !== rollback.rollbackDigest || approval.teamId !== rollback.teamId || approval.deploymentId !== rollback.deploymentId || approval.stackId !== rollback.stackId || approval.environment !== rollback.environment || approval.backendBindingDigest !== rollback.backendBindingDigest) throw new Error("Hosted topology rollback approval does not bind the exact rollback custody and backend.");
|
|
434
|
-
return { rollback, approval };
|
|
404
|
+
function authorizeHostedTopologyRollback(rollbackInput) {
|
|
405
|
+
return { rollback: hostedTopologyRollbackSchema.parse(rollbackInput) };
|
|
435
406
|
}
|
|
436
407
|
function planHostedTopologyRollbackExecution(input) {
|
|
437
408
|
const rollback = hostedTopologyRollbackSchema.parse(input.rollback), sourceReceipt = hostedTopologyReceiptSchema.parse(input.sourceReceipt);
|
|
438
|
-
const sourcePlan = input.sourcePlan && typeof input.sourcePlan === "object" &&
|
|
409
|
+
const sourcePlan = input.sourcePlan && typeof input.sourcePlan === "object" && input.sourcePlan.executable === true ? authorizedHostedTopologyPlanSchema.parse(input.sourcePlan) : hostedTopologyPlanSchema.parse(input.sourcePlan);
|
|
439
410
|
const targetPlan = hostedTopologyPlanSchema.parse(input.targetPlan);
|
|
440
411
|
if (sourceReceipt.receiptId !== rollback.sourceReceiptId || sourceReceipt.planDigest !== sourcePlan.planDigest) throw new Error("Hosted rollback execution source receipt is stale.");
|
|
441
412
|
const custody = { teamId: rollback.teamId, deploymentId: rollback.deploymentId, stackId: rollback.stackId, environment: rollback.environment, backendBindingDigest: rollback.backendBindingDigest };
|
|
@@ -458,7 +429,7 @@ function planHostedTopologyRollbackExecution(input) {
|
|
|
458
429
|
throw new Error(`Hosted rollback execution target specification mismatch for ${operation.resourceId}.`);
|
|
459
430
|
}
|
|
460
431
|
}
|
|
461
|
-
if ([...targetActions.keys()].some((resourceId) => !sourceActions.has(resourceId))) throw new Error("Hosted rollback execution target introduces an
|
|
432
|
+
if ([...targetActions.keys()].some((resourceId) => !sourceActions.has(resourceId))) throw new Error("Hosted rollback execution target introduces an unauthorized resource.");
|
|
462
433
|
const core = {
|
|
463
434
|
rollback,
|
|
464
435
|
sourceReceiptId: sourceReceipt.receiptId,
|
|
@@ -469,10 +440,8 @@ function planHostedTopologyRollbackExecution(input) {
|
|
|
469
440
|
};
|
|
470
441
|
return hostedTopologyRollbackExecutionSchema.parse({ schemaVersion: "treeseed.hosted-topology-rollback-execution/v1", ...core, executionDigest: deploymentDigest(core) });
|
|
471
442
|
}
|
|
472
|
-
function authorizeHostedTopologyRollbackExecution(executionInput
|
|
473
|
-
|
|
474
|
-
if (approval.executionDigest !== execution.executionDigest || approval.teamId !== execution.teamId || approval.deploymentId !== execution.deploymentId || approval.stackId !== execution.stackId || approval.environment !== execution.environment || approval.backendBindingDigest !== execution.backendBindingDigest) throw new Error("Hosted rollback execution approval does not bind the exact source target custody and backend.");
|
|
475
|
-
return { execution, approval };
|
|
443
|
+
function authorizeHostedTopologyRollbackExecution(executionInput) {
|
|
444
|
+
return { execution: hostedTopologyRollbackExecutionSchema.parse(executionInput) };
|
|
476
445
|
}
|
|
477
446
|
export {
|
|
478
447
|
authorizeHostedTopologyPlan,
|
|
@@ -486,12 +455,9 @@ export {
|
|
|
486
455
|
hostedResourceKindSchema,
|
|
487
456
|
hostedResourceObservationSchema,
|
|
488
457
|
hostedStateBackendSchema,
|
|
489
|
-
hostedTopologyApprovalSchema,
|
|
490
458
|
hostedTopologyDeclarationSchema,
|
|
491
459
|
hostedTopologyPlanSchema,
|
|
492
460
|
hostedTopologyReceiptSchema,
|
|
493
|
-
hostedTopologyRollbackApprovalSchema,
|
|
494
|
-
hostedTopologyRollbackExecutionApprovalSchema,
|
|
495
461
|
hostedTopologyRollbackExecutionSchema,
|
|
496
462
|
hostedTopologyRollbackSchema,
|
|
497
463
|
hostedTopologyStateKey,
|
|
@@ -365,9 +365,9 @@ const commandTree = {
|
|
|
365
365
|
]),
|
|
366
366
|
branch("topology", [
|
|
367
367
|
{ nodeType: "leaf", segment: "plan", description: "Plan Cloudflare and Railway reconciliation from a portable hosted-topology declaration or template.", kind: "read", arguments: [{ name: "file", description: "Hosted topology YAML or JSON declaration or template.", required: true }], options: [{ name: "--artifacts", description: "Exact runtime artifact-input YAML or JSON required by a portable template.", type: "string" }], resultSchemaId: "treeseed.hosted-topology-plan/v1", execution: local("local.platform.topology.plan") },
|
|
368
|
-
{ nodeType: "leaf", segment: "apply", description: "Apply an exact
|
|
368
|
+
{ nodeType: "leaf", segment: "apply", description: "Apply an exact agent-authorized hosted-topology plan through the operations runner.", kind: "mutation", arguments: [{ name: "plan", description: "Exact plan JSON file.", required: true }], options: [planOption, { name: "--yes", description: "Confirm the authority-bearing mutation.", type: "boolean" }], authorization: { capability: "infrastructure.write", confirmation: "authority" }, resultSchemaId: "treeseed.platform-operation/v1", execution: local("local.platform.topology.apply") },
|
|
369
369
|
{ nodeType: "leaf", segment: "status", description: "Read the latest hosted-topology operation and known-good receipt.", kind: "read", resultSchemaId: "treeseed.infrastructure.topology.status.output/v1", execution: local("local.platform.topology.status") },
|
|
370
|
-
{ nodeType: "leaf", segment: "rollback", description: "Restore exact prior hosted-topology state from a known-good receipt.", kind: "mutation", arguments: [{ name: "rollback", description: "Exact rollback JSON file.", required: true }], options: [planOption, { name: "--
|
|
370
|
+
{ nodeType: "leaf", segment: "rollback", description: "Restore exact prior hosted-topology state from a known-good receipt.", kind: "mutation", arguments: [{ name: "rollback", description: "Exact rollback JSON file.", required: true }], options: [planOption, { name: "--yes", description: "Confirm the destructive rollback.", type: "boolean" }], authorization: { capability: "infrastructure.write", confirmation: "destructive" }, resultSchemaId: "treeseed.platform-operation/v1", execution: local("local.platform.topology.rollback") }
|
|
371
371
|
])
|
|
372
372
|
]),
|
|
373
373
|
branch("dev", [
|
|
@@ -33,7 +33,7 @@ export declare const HOSTED_TOPOLOGY_OPERATIONS: {
|
|
|
33
33
|
repository: "treeseed-ai/platform";
|
|
34
34
|
commit: string;
|
|
35
35
|
};
|
|
36
|
-
mutation: "
|
|
36
|
+
mutation: "agent-authorized";
|
|
37
37
|
environment: "production" | "staging";
|
|
38
38
|
artifacts: Record<string, {
|
|
39
39
|
digest: string;
|
|
@@ -59,23 +59,10 @@ export declare const HOSTED_TOPOLOGY_OPERATIONS: {
|
|
|
59
59
|
connectionRef: string;
|
|
60
60
|
}>>;
|
|
61
61
|
};
|
|
62
|
-
credentialLeaseIds?: string[] | undefined;
|
|
63
62
|
}, Record<string, unknown>>;
|
|
64
63
|
readonly apply: import("../control-plane-operation.js").ControlPlaneOperationBinding<{
|
|
65
64
|
teamId: string;
|
|
66
65
|
}, {}, {
|
|
67
|
-
approval: {
|
|
68
|
-
schemaVersion: "treeseed.hosted-topology-approval/v1";
|
|
69
|
-
planDigest: string;
|
|
70
|
-
teamId: string;
|
|
71
|
-
environment: "production" | "staging";
|
|
72
|
-
deploymentId: string;
|
|
73
|
-
stackId: string;
|
|
74
|
-
backendBindingDigest: string;
|
|
75
|
-
decision: "approved";
|
|
76
|
-
approvedBy: string;
|
|
77
|
-
approvedAt: string;
|
|
78
|
-
};
|
|
79
66
|
plan: {
|
|
80
67
|
schemaVersion: "treeseed.hosted-topology-plan/v1";
|
|
81
68
|
blockers: {
|
|
@@ -160,9 +147,8 @@ export declare const HOSTED_TOPOLOGY_OPERATIONS: {
|
|
|
160
147
|
declarationDigest: string;
|
|
161
148
|
topologyId: string;
|
|
162
149
|
platformCommit: string;
|
|
163
|
-
|
|
150
|
+
authorization: "authenticated-agent";
|
|
164
151
|
};
|
|
165
|
-
credentialLeaseIds?: string[] | undefined;
|
|
166
152
|
}, Record<string, unknown>>;
|
|
167
153
|
readonly status: import("../control-plane-operation.js").ControlPlaneOperationBinding<{
|
|
168
154
|
teamId: string;
|
|
@@ -207,18 +193,6 @@ export declare const HOSTED_TOPOLOGY_OPERATIONS: {
|
|
|
207
193
|
readonly rollback: import("../control-plane-operation.js").ControlPlaneOperationBinding<{
|
|
208
194
|
teamId: string;
|
|
209
195
|
}, {}, {
|
|
210
|
-
approval: {
|
|
211
|
-
schemaVersion: "treeseed.hosted-topology-rollback-execution-approval/v1";
|
|
212
|
-
teamId: string;
|
|
213
|
-
environment: "production" | "staging";
|
|
214
|
-
deploymentId: string;
|
|
215
|
-
stackId: string;
|
|
216
|
-
backendBindingDigest: string;
|
|
217
|
-
decision: "approved";
|
|
218
|
-
approvedBy: string;
|
|
219
|
-
approvedAt: string;
|
|
220
|
-
executionDigest: string;
|
|
221
|
-
};
|
|
222
196
|
execution: {
|
|
223
197
|
schemaVersion: "treeseed.hosted-topology-rollback-execution/v1";
|
|
224
198
|
teamId: string;
|
|
@@ -333,7 +307,7 @@ export declare const HOSTED_TOPOLOGY_OPERATIONS: {
|
|
|
333
307
|
declarationDigest: string;
|
|
334
308
|
topologyId: string;
|
|
335
309
|
platformCommit: string;
|
|
336
|
-
|
|
310
|
+
authorization: "authenticated-agent";
|
|
337
311
|
};
|
|
338
312
|
targetPlan: {
|
|
339
313
|
schemaVersion: "treeseed.hosted-topology-plan/v1";
|
|
@@ -419,8 +393,7 @@ export declare const HOSTED_TOPOLOGY_OPERATIONS: {
|
|
|
419
393
|
declarationDigest: string;
|
|
420
394
|
topologyId: string;
|
|
421
395
|
platformCommit: string;
|
|
422
|
-
|
|
396
|
+
authorization: "authenticated-agent";
|
|
423
397
|
};
|
|
424
|
-
credentialLeaseIds?: string[] | undefined;
|
|
425
398
|
}, Record<string, unknown>>;
|
|
426
399
|
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { hostedTopologyDeclarationSchema, hostedTopologyPlanSchema, hostedTopologyReceiptSchema, hostedTopologyRollbackExecutionSchema } from "../../deployment/hosted-topology.js";
|
|
3
3
|
import { defineOperation } from "../operation-builder.js";
|
|
4
4
|
const teamPath = z.object({ teamId: z.string().min(1) }).strict();
|
|
5
5
|
const empty = z.object({}).strict();
|
|
6
6
|
const none = z.undefined();
|
|
7
7
|
const operationReceipt = z.record(z.unknown());
|
|
8
|
-
const credentialLeaseIds = z.array(z.string().min(1)).min(1).optional();
|
|
9
8
|
const HOSTED_TOPOLOGY_OPERATIONS = {
|
|
10
9
|
plan: defineOperation({
|
|
11
10
|
operationId: "infrastructure.topology.plan",
|
|
@@ -22,10 +21,10 @@ const HOSTED_TOPOLOGY_OPERATIONS = {
|
|
|
22
21
|
cacheScope: "none",
|
|
23
22
|
pagination: "none",
|
|
24
23
|
idempotencyRequired: false
|
|
25
|
-
}, { path: teamPath, query: empty, body: z.object({ declaration: hostedTopologyDeclarationSchema
|
|
24
|
+
}, { path: teamPath, query: empty, body: z.object({ declaration: hostedTopologyDeclarationSchema }).strict(), output: operationReceipt }),
|
|
26
25
|
apply: defineOperation({
|
|
27
26
|
operationId: "infrastructure.topology.apply",
|
|
28
|
-
description: "Apply an exact
|
|
27
|
+
description: "Apply an exact agent-authorized hosted topology plan through the operations runner.",
|
|
29
28
|
rest: { method: "POST", path: "/v1/teams/{teamId}/infrastructure/topology/apply" },
|
|
30
29
|
parameters: "treeseed.infrastructure.topology.apply.parameters/v1",
|
|
31
30
|
capability: "infrastructure.write",
|
|
@@ -37,9 +36,8 @@ const HOSTED_TOPOLOGY_OPERATIONS = {
|
|
|
37
36
|
surfaces: ["rest", "cli"],
|
|
38
37
|
cacheScope: "none",
|
|
39
38
|
pagination: "none",
|
|
40
|
-
concurrencyRequired: true
|
|
41
|
-
|
|
42
|
-
}, { path: teamPath, query: empty, body: z.object({ plan: hostedTopologyPlanSchema, approval: hostedTopologyApprovalSchema, credentialLeaseIds }).strict(), output: operationReceipt }),
|
|
39
|
+
concurrencyRequired: true
|
|
40
|
+
}, { path: teamPath, query: empty, body: z.object({ plan: hostedTopologyPlanSchema }).strict(), output: operationReceipt }),
|
|
43
41
|
status: defineOperation({
|
|
44
42
|
operationId: "infrastructure.topology.status",
|
|
45
43
|
description: "Read the latest authoritative hosted topology receipt and operation state.",
|
|
@@ -69,14 +67,11 @@ const HOSTED_TOPOLOGY_OPERATIONS = {
|
|
|
69
67
|
surfaces: ["rest", "cli"],
|
|
70
68
|
cacheScope: "none",
|
|
71
69
|
pagination: "none",
|
|
72
|
-
concurrencyRequired: true
|
|
73
|
-
redactedPaths: ["body.approval.approvedBy"]
|
|
70
|
+
concurrencyRequired: true
|
|
74
71
|
}, { path: teamPath, query: empty, body: z.object({
|
|
75
72
|
execution: hostedTopologyRollbackExecutionSchema,
|
|
76
|
-
approval: hostedTopologyRollbackExecutionApprovalSchema,
|
|
77
73
|
sourcePlan: hostedTopologyPlanSchema,
|
|
78
|
-
targetPlan: hostedTopologyPlanSchema
|
|
79
|
-
credentialLeaseIds
|
|
74
|
+
targetPlan: hostedTopologyPlanSchema
|
|
80
75
|
}).strict(), output: operationReceipt })
|
|
81
76
|
};
|
|
82
77
|
export {
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export declare const SECRET_OPERATIONS: {
|
|
2
|
+
readonly credentialStatus: import("../../control-plane-operation.js").ControlPlaneOperationBinding<{
|
|
3
|
+
teamId: string;
|
|
4
|
+
profileId: string;
|
|
5
|
+
connectionId: string;
|
|
6
|
+
}, {}, {
|
|
7
|
+
expectedVersion: number;
|
|
8
|
+
} | undefined, {
|
|
9
|
+
version: number;
|
|
10
|
+
teamId: string;
|
|
11
|
+
profileId: string;
|
|
12
|
+
connectionId: string;
|
|
13
|
+
configured: boolean;
|
|
14
|
+
custody: "openbao";
|
|
15
|
+
fields: string[];
|
|
16
|
+
}>;
|
|
17
|
+
readonly putCredentials: import("../../control-plane-operation.js").ControlPlaneOperationBinding<{
|
|
18
|
+
teamId: string;
|
|
19
|
+
profileId: string;
|
|
20
|
+
connectionId: string;
|
|
21
|
+
}, {}, {
|
|
22
|
+
expectedVersion: number;
|
|
23
|
+
} | undefined, {
|
|
24
|
+
version: number;
|
|
25
|
+
teamId: string;
|
|
26
|
+
profileId: string;
|
|
27
|
+
connectionId: string;
|
|
28
|
+
configured: boolean;
|
|
29
|
+
custody: "openbao";
|
|
30
|
+
fields: string[];
|
|
31
|
+
}>;
|
|
32
|
+
readonly deleteCredentials: import("../../control-plane-operation.js").ControlPlaneOperationBinding<{
|
|
33
|
+
teamId: string;
|
|
34
|
+
profileId: string;
|
|
35
|
+
connectionId: string;
|
|
36
|
+
}, {}, {
|
|
37
|
+
expectedVersion: number;
|
|
38
|
+
} | undefined, {
|
|
39
|
+
version: number;
|
|
40
|
+
teamId: string;
|
|
41
|
+
profileId: string;
|
|
42
|
+
connectionId: string;
|
|
43
|
+
configured: boolean;
|
|
44
|
+
custody: "openbao";
|
|
45
|
+
fields: string[];
|
|
46
|
+
}>;
|
|
47
|
+
readonly validateCredentials: import("../../control-plane-operation.js").ControlPlaneOperationBinding<{
|
|
48
|
+
teamId: string;
|
|
49
|
+
profileId: string;
|
|
50
|
+
connectionId: string;
|
|
51
|
+
}, {}, {
|
|
52
|
+
expectedVersion: number;
|
|
53
|
+
} | undefined, {
|
|
54
|
+
version: number;
|
|
55
|
+
teamId: string;
|
|
56
|
+
profileId: string;
|
|
57
|
+
connectionId: string;
|
|
58
|
+
configured: boolean;
|
|
59
|
+
custody: "openbao";
|
|
60
|
+
fields: string[];
|
|
61
|
+
}>;
|
|
62
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { defineOperation } from "../../operation-builder.js";
|
|
3
|
+
const id = z.string().regex(/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/u);
|
|
4
|
+
const path = z.object({ teamId: id, connectionId: id, profileId: id }).strict();
|
|
5
|
+
const version = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER - 1);
|
|
6
|
+
const descriptor = z.object({
|
|
7
|
+
teamId: id,
|
|
8
|
+
connectionId: id,
|
|
9
|
+
profileId: id,
|
|
10
|
+
custody: z.literal("openbao"),
|
|
11
|
+
version,
|
|
12
|
+
configured: z.boolean(),
|
|
13
|
+
fields: z.array(id)
|
|
14
|
+
}).strict();
|
|
15
|
+
const put = z.object({
|
|
16
|
+
expectedVersion: version,
|
|
17
|
+
values: z.record(z.string().max(1024 * 1024)).refine((v) => Object.keys(v).length > 0 && Object.keys(v).length <= 128)
|
|
18
|
+
}).strict();
|
|
19
|
+
function operation(name, method) {
|
|
20
|
+
const read = method === "GET";
|
|
21
|
+
return defineOperation({
|
|
22
|
+
operationId: `services.credentials.${name}`,
|
|
23
|
+
description: `${name} managed service credentials.`,
|
|
24
|
+
rest: { method, path: `/v1/teams/{teamId}/services/{connectionId}/credentials/{profileId}${name === "validate" ? "/validate" : ""}` },
|
|
25
|
+
parameters: `treeseed.services.credentials.${name}.parameters/v1`,
|
|
26
|
+
capability: read ? "secrets.read" : "secrets.write",
|
|
27
|
+
authentication: "oauth",
|
|
28
|
+
oauthScopes: read ? ["treeseed:read"] : ["treeseed:projects:write"],
|
|
29
|
+
kind: read ? "read" : "mutation",
|
|
30
|
+
riskClass: read ? "ordinary" : "credential",
|
|
31
|
+
confirmation: read ? "never" : "input_required",
|
|
32
|
+
surfaces: ["rest"],
|
|
33
|
+
cacheScope: "none",
|
|
34
|
+
pagination: "none",
|
|
35
|
+
redactedPaths: ["body.values"]
|
|
36
|
+
}, {
|
|
37
|
+
path,
|
|
38
|
+
query: z.object({}).strict(),
|
|
39
|
+
body: read ? z.undefined() : name === "put" ? put : z.object({ expectedVersion: version }).strict(),
|
|
40
|
+
output: name === "validate" ? z.object({ ok: z.boolean() }).strict() : descriptor
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
const SECRET_OPERATIONS = {
|
|
44
|
+
credentialStatus: operation("show", "GET"),
|
|
45
|
+
putCredentials: operation("put", "PUT"),
|
|
46
|
+
deleteCredentials: operation("delete", "DELETE"),
|
|
47
|
+
validateCredentials: operation("validate", "POST")
|
|
48
|
+
};
|
|
49
|
+
export {
|
|
50
|
+
SECRET_OPERATIONS
|
|
51
|
+
};
|
|
@@ -36,7 +36,7 @@ export declare const CONTROL_PLANE_OPERATIONS: {
|
|
|
36
36
|
repository: "treeseed-ai/platform";
|
|
37
37
|
commit: string;
|
|
38
38
|
};
|
|
39
|
-
mutation: "
|
|
39
|
+
mutation: "agent-authorized";
|
|
40
40
|
environment: "production" | "staging";
|
|
41
41
|
artifacts: Record<string, {
|
|
42
42
|
digest: string;
|
|
@@ -62,23 +62,10 @@ export declare const CONTROL_PLANE_OPERATIONS: {
|
|
|
62
62
|
connectionRef: string;
|
|
63
63
|
}>>;
|
|
64
64
|
};
|
|
65
|
-
credentialLeaseIds?: string[] | undefined;
|
|
66
65
|
}, Record<string, unknown>>;
|
|
67
66
|
readonly apply: import("./control-plane-operation.js").ControlPlaneOperationBinding<{
|
|
68
67
|
teamId: string;
|
|
69
68
|
}, {}, {
|
|
70
|
-
approval: {
|
|
71
|
-
schemaVersion: "treeseed.hosted-topology-approval/v1";
|
|
72
|
-
planDigest: string;
|
|
73
|
-
teamId: string;
|
|
74
|
-
environment: "production" | "staging";
|
|
75
|
-
deploymentId: string;
|
|
76
|
-
stackId: string;
|
|
77
|
-
backendBindingDigest: string;
|
|
78
|
-
decision: "approved";
|
|
79
|
-
approvedBy: string;
|
|
80
|
-
approvedAt: string;
|
|
81
|
-
};
|
|
82
69
|
plan: {
|
|
83
70
|
schemaVersion: "treeseed.hosted-topology-plan/v1";
|
|
84
71
|
blockers: {
|
|
@@ -163,9 +150,8 @@ export declare const CONTROL_PLANE_OPERATIONS: {
|
|
|
163
150
|
declarationDigest: string;
|
|
164
151
|
topologyId: string;
|
|
165
152
|
platformCommit: string;
|
|
166
|
-
|
|
153
|
+
authorization: "authenticated-agent";
|
|
167
154
|
};
|
|
168
|
-
credentialLeaseIds?: string[] | undefined;
|
|
169
155
|
}, Record<string, unknown>>;
|
|
170
156
|
readonly status: import("./control-plane-operation.js").ControlPlaneOperationBinding<{
|
|
171
157
|
teamId: string;
|
|
@@ -210,18 +196,6 @@ export declare const CONTROL_PLANE_OPERATIONS: {
|
|
|
210
196
|
readonly rollback: import("./control-plane-operation.js").ControlPlaneOperationBinding<{
|
|
211
197
|
teamId: string;
|
|
212
198
|
}, {}, {
|
|
213
|
-
approval: {
|
|
214
|
-
schemaVersion: "treeseed.hosted-topology-rollback-execution-approval/v1";
|
|
215
|
-
teamId: string;
|
|
216
|
-
environment: "production" | "staging";
|
|
217
|
-
deploymentId: string;
|
|
218
|
-
stackId: string;
|
|
219
|
-
backendBindingDigest: string;
|
|
220
|
-
decision: "approved";
|
|
221
|
-
approvedBy: string;
|
|
222
|
-
approvedAt: string;
|
|
223
|
-
executionDigest: string;
|
|
224
|
-
};
|
|
225
199
|
execution: {
|
|
226
200
|
schemaVersion: "treeseed.hosted-topology-rollback-execution/v1";
|
|
227
201
|
teamId: string;
|
|
@@ -336,7 +310,7 @@ export declare const CONTROL_PLANE_OPERATIONS: {
|
|
|
336
310
|
declarationDigest: string;
|
|
337
311
|
topologyId: string;
|
|
338
312
|
platformCommit: string;
|
|
339
|
-
|
|
313
|
+
authorization: "authenticated-agent";
|
|
340
314
|
};
|
|
341
315
|
targetPlan: {
|
|
342
316
|
schemaVersion: "treeseed.hosted-topology-plan/v1";
|
|
@@ -422,9 +396,8 @@ export declare const CONTROL_PLANE_OPERATIONS: {
|
|
|
422
396
|
declarationDigest: string;
|
|
423
397
|
topologyId: string;
|
|
424
398
|
platformCommit: string;
|
|
425
|
-
|
|
399
|
+
authorization: "authenticated-agent";
|
|
426
400
|
};
|
|
427
|
-
credentialLeaseIds?: string[] | undefined;
|
|
428
401
|
}, Record<string, unknown>>;
|
|
429
402
|
};
|
|
430
403
|
};
|
|
@@ -1421,26 +1394,66 @@ export declare const CONTROL_PLANE_OPERATIONS: {
|
|
|
1421
1394
|
teamId: string;
|
|
1422
1395
|
connectionId: string;
|
|
1423
1396
|
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
1424
|
-
readonly
|
|
1397
|
+
readonly credentialStatus: import("./control-plane-operation.js").ControlPlaneOperationBinding<{
|
|
1425
1398
|
teamId: string;
|
|
1426
1399
|
profileId: string;
|
|
1427
1400
|
connectionId: string;
|
|
1428
|
-
}, {},
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
readonly
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1401
|
+
}, {}, {
|
|
1402
|
+
expectedVersion: number;
|
|
1403
|
+
} | undefined, {
|
|
1404
|
+
version: number;
|
|
1405
|
+
teamId: string;
|
|
1406
|
+
profileId: string;
|
|
1407
|
+
connectionId: string;
|
|
1408
|
+
configured: boolean;
|
|
1409
|
+
custody: "openbao";
|
|
1410
|
+
fields: string[];
|
|
1411
|
+
}>;
|
|
1412
|
+
readonly putCredentials: import("./control-plane-operation.js").ControlPlaneOperationBinding<{
|
|
1413
|
+
teamId: string;
|
|
1414
|
+
profileId: string;
|
|
1415
|
+
connectionId: string;
|
|
1416
|
+
}, {}, {
|
|
1417
|
+
expectedVersion: number;
|
|
1418
|
+
} | undefined, {
|
|
1419
|
+
version: number;
|
|
1420
|
+
teamId: string;
|
|
1421
|
+
profileId: string;
|
|
1422
|
+
connectionId: string;
|
|
1423
|
+
configured: boolean;
|
|
1424
|
+
custody: "openbao";
|
|
1425
|
+
fields: string[];
|
|
1426
|
+
}>;
|
|
1427
|
+
readonly deleteCredentials: import("./control-plane-operation.js").ControlPlaneOperationBinding<{
|
|
1428
|
+
teamId: string;
|
|
1429
|
+
profileId: string;
|
|
1430
|
+
connectionId: string;
|
|
1431
|
+
}, {}, {
|
|
1432
|
+
expectedVersion: number;
|
|
1433
|
+
} | undefined, {
|
|
1434
|
+
version: number;
|
|
1435
|
+
teamId: string;
|
|
1436
|
+
profileId: string;
|
|
1437
|
+
connectionId: string;
|
|
1438
|
+
configured: boolean;
|
|
1439
|
+
custody: "openbao";
|
|
1440
|
+
fields: string[];
|
|
1441
|
+
}>;
|
|
1442
|
+
readonly validateCredentials: import("./control-plane-operation.js").ControlPlaneOperationBinding<{
|
|
1443
|
+
teamId: string;
|
|
1444
|
+
profileId: string;
|
|
1445
|
+
connectionId: string;
|
|
1446
|
+
}, {}, {
|
|
1447
|
+
expectedVersion: number;
|
|
1448
|
+
} | undefined, {
|
|
1449
|
+
version: number;
|
|
1450
|
+
teamId: string;
|
|
1451
|
+
profileId: string;
|
|
1452
|
+
connectionId: string;
|
|
1453
|
+
configured: boolean;
|
|
1454
|
+
custody: "openbao";
|
|
1455
|
+
fields: string[];
|
|
1456
|
+
}>;
|
|
1444
1457
|
};
|
|
1445
1458
|
readonly agents: {
|
|
1446
1459
|
readonly list: import("./control-plane-operation.js").ControlPlaneOperationBinding<{
|
|
@@ -8,7 +8,7 @@ import { capabilityOntologyOperations } from "./catalog/capability-ontology-oper
|
|
|
8
8
|
import { knowledgeShareOperations } from "./catalog/knowledge-share-operations.js";
|
|
9
9
|
import { PROVIDER_ENVIRONMENT_OPERATIONS } from "./catalog/provider-environment-operations.js";
|
|
10
10
|
import { HOSTED_TOPOLOGY_OPERATIONS } from "./catalog/hosted-topology-operations.js";
|
|
11
|
-
import {
|
|
11
|
+
import { SECRET_OPERATIONS } from "./catalog/services/secret-operations.js";
|
|
12
12
|
import { buildControlPlaneCatalog, flattenControlPlaneOperations } from "./catalog/control-plane-catalog.js";
|
|
13
13
|
const empty = z.object({}).strict(), none = z.undefined(), record = z.record(z.unknown()), payload = record;
|
|
14
14
|
function read(operationId, path, capability, surfaces = ["rest"]) {
|
|
@@ -278,15 +278,14 @@ const CONTROL_PLANE_OPERATIONS = {
|
|
|
278
278
|
deleteWorkflowVariable: resource("repositories.workflow.variables.delete", "DELETE", "/v1/projects/{projectId}/workflow-configuration/variables/{name}", { projectId: z.string().min(1), name: z.string().min(1) }, { capability: "workflows.write", risk: "destructive", concurrency: true })
|
|
279
279
|
},
|
|
280
280
|
services: {
|
|
281
|
-
...
|
|
281
|
+
...SECRET_OPERATIONS,
|
|
282
282
|
providers: resource("services.providers.list", "GET", "/v1/service-providers", {}, { capability: "services.read", surfaces: ["rest", "cli", "mcp_tool"] }),
|
|
283
283
|
connections: resource("services.connections.list", "GET", "/v1/teams/{teamId}/services", { teamId: z.string().min(1) }, { capability: "services.read", surfaces: ["rest", "cli", "mcp_tool"], pagination: "cursor" }),
|
|
284
284
|
connection: resource("services.connections.show", "GET", "/v1/teams/{teamId}/services/{connectionId}", { teamId: z.string().min(1), connectionId: z.string().min(1) }, { capability: "services.read", surfaces: ["rest", "cli", "mcp_resource"] }),
|
|
285
285
|
createConnection: resource("services.connections.create", "POST", "/v1/teams/{teamId}/services", { teamId: z.string().min(1) }, { capability: "services.write", surfaces: ["rest", "cli", "mcp_tool"], risk: "credential" }),
|
|
286
286
|
updateConnection: resource("services.connections.update", "PUT", "/v1/teams/{teamId}/services/{connectionId}", { teamId: z.string().min(1), connectionId: z.string().min(1) }, { capability: "services.write", surfaces: ["rest", "cli", "mcp_tool"], concurrency: true }),
|
|
287
287
|
disconnect: resource("services.connections.disconnect", "DELETE", "/v1/teams/{teamId}/services/{connectionId}", { teamId: z.string().min(1), connectionId: z.string().min(1) }, { capability: "services.write", surfaces: ["rest", "cli", "mcp_tool"], risk: "destructive", concurrency: true }),
|
|
288
|
-
authorities: resource("services.credential.authorities.list", "GET", "/v1/teams/{teamId}/services/{connectionId}/credential-authorities", { teamId: z.string().min(1), connectionId: z.string().min(1) }, { capability: "secrets.read", surfaces: ["rest", "cli"], pagination: "cursor" })
|
|
289
|
-
putAuthority: resource("services.credential.authorities.put", "PUT", "/v1/teams/{teamId}/services/{connectionId}/credential-authorities/{profileId}", { teamId: z.string().min(1), connectionId: z.string().min(1), profileId: z.string().min(1) }, { capability: "secrets.write", surfaces: ["rest", "cli"], risk: "credential", concurrency: true, redactedPaths: ["body"] })
|
|
288
|
+
authorities: resource("services.credential.authorities.list", "GET", "/v1/teams/{teamId}/services/{connectionId}/credential-authorities", { teamId: z.string().min(1), connectionId: z.string().min(1) }, { capability: "secrets.read", surfaces: ["rest", "cli"], pagination: "cursor" })
|
|
290
289
|
},
|
|
291
290
|
agents: {
|
|
292
291
|
list: resource("agents.list", "GET", "/v1/projects/{projectId}/agents", { projectId: z.string().min(1) }, { capability: "agents.read", surfaces: ["rest", "cli", "mcp_tool"], pagination: "cursor" }),
|