@treeseed/sdk 0.13.0-rc.91 → 0.13.0-rc.92
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/capacity-provider/index.d.ts +1 -0
- package/dist/capacity-provider/index.js +1 -0
- package/dist/capacity-provider/install-configuration.d.ts +39 -0
- package/dist/capacity-provider/install-configuration.js +18 -0
- package/dist/configuration/secrets-capability.d.ts +3 -0
- package/dist/configuration/secrets-capability.js +3 -0
- package/dist/content/validation/agent-operational-content-schemas.d.ts +12 -12
- package/dist/content/validation/content-model-schemas.d.ts +13 -13
- package/dist/content/validation/portable-content-data.d.ts +1 -1
- package/dist/deployment/ai-hosting.d.ts +297 -0
- package/dist/deployment/ai-hosting.js +63 -0
- package/dist/deployment/ai-instance.d.ts +48 -0
- package/dist/deployment/ai-instance.js +23 -0
- package/dist/deployment/index.d.ts +2 -0
- package/dist/deployment/index.js +2 -0
- package/dist/operator-contracts/canonical-command-tree.js +3 -10
- package/dist/operator-contracts/catalog/communication-operations.d.ts +2 -2
- package/dist/operator-contracts/catalog/infrastructure/ai-instance-operations.d.ts +29 -0
- package/dist/operator-contracts/catalog/infrastructure/ai-instance-operations.js +18 -0
- package/dist/operator-contracts/catalog/infrastructure/command-tree-paths.d.ts +3 -0
- package/dist/operator-contracts/catalog/infrastructure/command-tree-paths.js +15 -0
- package/dist/operator-contracts/communication/contracts.d.ts +18 -18
- package/dist/operator-contracts/control-plane-operations.d.ts +31 -2
- package/dist/operator-contracts/control-plane-operations.js +3 -17
- package/dist/operator-contracts/operation-builder.d.ts +1 -0
- package/dist/operator-contracts/operation-builder.js +17 -0
- package/dist/secrets-capability/github-actions-encryption.js +1 -1
- package/dist/secrets-capability/provider-operation-contracts.d.ts +14 -0
- package/dist/secrets-capability/service-provider-contracts.d.ts +4 -2
- package/dist/secrets-capability/service-provider-contracts.js +41 -27
- package/dist/secrets-capability/shared-access.d.ts +51 -0
- package/dist/secrets-capability/shared-access.js +36 -0
- package/dist/secrets-capability/shared-resources.d.ts +376 -0
- package/dist/secrets-capability/shared-resources.js +91 -0
- package/dist/secrets-capability/vault-contracts.d.ts +132 -0
- package/dist/secrets-capability/vault-contracts.js +56 -0
- package/package.json +1 -1
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const id = z.string().regex(/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/u);
|
|
3
|
+
const version = z.number().int().nonnegative().safe();
|
|
4
|
+
const environment = z.enum(["staging", "production", "shared"]);
|
|
5
|
+
const timestamp = z.string().datetime();
|
|
6
|
+
const organizationSchema = z.object({
|
|
7
|
+
id,
|
|
8
|
+
name: z.string().trim().min(1).max(160),
|
|
9
|
+
version
|
|
10
|
+
}).strict();
|
|
11
|
+
const organizationMemberSchema = z.object({
|
|
12
|
+
organizationId: id,
|
|
13
|
+
userId: id,
|
|
14
|
+
role: z.enum(["owner", "admin", "member"]),
|
|
15
|
+
version
|
|
16
|
+
}).strict();
|
|
17
|
+
const organizationTeamSchema = z.object({
|
|
18
|
+
teamId: id,
|
|
19
|
+
organizationId: id.nullable(),
|
|
20
|
+
version
|
|
21
|
+
}).strict();
|
|
22
|
+
const organizationTeamInvitationSchema = z.object({
|
|
23
|
+
id,
|
|
24
|
+
organizationId: id,
|
|
25
|
+
teamId: id,
|
|
26
|
+
organizationAuthorizedBy: id,
|
|
27
|
+
teamAuthorizedBy: id.nullable(),
|
|
28
|
+
expiresAt: timestamp,
|
|
29
|
+
status: z.enum(["pending", "accepted", "rejected", "revoked", "expired"]),
|
|
30
|
+
version
|
|
31
|
+
}).strict();
|
|
32
|
+
const sharedResourceSchema = z.discriminatedUnion("kind", [
|
|
33
|
+
z.object({ kind: z.literal("connection"), id, ownerTeamId: id }).strict(),
|
|
34
|
+
z.object({ kind: z.literal("vault"), id, ownerTeamId: id.nullable() }).strict()
|
|
35
|
+
]);
|
|
36
|
+
const sharedResourceGrantSchema = z.object({
|
|
37
|
+
id,
|
|
38
|
+
resource: sharedResourceSchema,
|
|
39
|
+
recipientTeamId: id,
|
|
40
|
+
authority: z.discriminatedUnion("kind", [
|
|
41
|
+
z.object({ kind: z.literal("organization"), organizationId: id }).strict(),
|
|
42
|
+
z.object({ kind: z.literal("deployment"), audiencePolicyId: id }).strict()
|
|
43
|
+
]),
|
|
44
|
+
origin: z.enum(["explicit", "default-policy"]),
|
|
45
|
+
defaultPolicyId: id.nullable(),
|
|
46
|
+
permissions: z.array(id).min(1),
|
|
47
|
+
scope: z.object({
|
|
48
|
+
environment,
|
|
49
|
+
resourceIds: z.array(z.string().min(1).max(512)).min(1),
|
|
50
|
+
projectIds: z.array(id),
|
|
51
|
+
assignmentIds: z.array(id)
|
|
52
|
+
}).strict(),
|
|
53
|
+
limits: z.object({
|
|
54
|
+
maxConcurrentOperations: z.number().int().positive().safe(),
|
|
55
|
+
maxOperationsPerWindow: z.number().int().positive().safe(),
|
|
56
|
+
windowSeconds: z.number().int().positive().safe()
|
|
57
|
+
}).strict(),
|
|
58
|
+
status: z.enum(["active", "revoked"]),
|
|
59
|
+
version,
|
|
60
|
+
expiresAt: timestamp.nullable()
|
|
61
|
+
}).strict().superRefine((grant, context) => {
|
|
62
|
+
if (grant.origin === "default-policy" !== (grant.defaultPolicyId !== null))
|
|
63
|
+
context.addIssue({ code: "custom", path: ["defaultPolicyId"], message: "Default grants require exactly one policy reference." });
|
|
64
|
+
if (grant.authority.kind === "organization" && grant.resource.ownerTeamId === null)
|
|
65
|
+
context.addIssue({ code: "custom", path: ["resource", "ownerTeamId"], message: "Organization resources require an owning team." });
|
|
66
|
+
if (grant.scope.resourceIds.includes("*"))
|
|
67
|
+
context.addIssue({ code: "custom", path: ["scope", "resourceIds"], message: "Unbounded resource grants are prohibited." });
|
|
68
|
+
});
|
|
69
|
+
const serviceBindingSchema = z.object({
|
|
70
|
+
id,
|
|
71
|
+
teamId: id,
|
|
72
|
+
projectId: id,
|
|
73
|
+
capability: id,
|
|
74
|
+
environment,
|
|
75
|
+
connectionId: id,
|
|
76
|
+
ownerTeamId: id,
|
|
77
|
+
grantId: id.nullable(),
|
|
78
|
+
version
|
|
79
|
+
}).strict().superRefine((binding, context) => {
|
|
80
|
+
if (binding.teamId !== binding.ownerTeamId && binding.grantId === null)
|
|
81
|
+
context.addIssue({ code: "custom", path: ["grantId"], message: "Shared bindings require a grant." });
|
|
82
|
+
});
|
|
83
|
+
export {
|
|
84
|
+
organizationMemberSchema,
|
|
85
|
+
organizationSchema,
|
|
86
|
+
organizationTeamInvitationSchema,
|
|
87
|
+
organizationTeamSchema,
|
|
88
|
+
serviceBindingSchema,
|
|
89
|
+
sharedResourceGrantSchema,
|
|
90
|
+
sharedResourceSchema
|
|
91
|
+
};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Configuration validation is not DNS/routing authorization; Deployment enforces transport policy. */
|
|
3
|
+
export declare const vaultDescriptorSchema: z.ZodObject<{
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
ownerTeamId: z.ZodNullable<z.ZodString>;
|
|
6
|
+
displayName: z.ZodString;
|
|
7
|
+
backend: z.ZodEnum<["managed-openbao", "external-openbao", "hashicorp-vault"]>;
|
|
8
|
+
endpoint: z.ZodEffects<z.ZodString, string, string>;
|
|
9
|
+
secretsMount: z.ZodEffects<z.ZodString, string, string>;
|
|
10
|
+
namespace: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
|
|
11
|
+
networkRouteId: z.ZodString;
|
|
12
|
+
tlsTrustId: z.ZodString;
|
|
13
|
+
authentication: z.ZodObject<{
|
|
14
|
+
method: z.ZodLiteral<"approle">;
|
|
15
|
+
mount: z.ZodEffects<z.ZodString, string, string>;
|
|
16
|
+
roleId: z.ZodString;
|
|
17
|
+
bootstrapCredentialRef: z.ZodString;
|
|
18
|
+
}, "strict", z.ZodTypeAny, {
|
|
19
|
+
method: "approle";
|
|
20
|
+
mount: string;
|
|
21
|
+
roleId: string;
|
|
22
|
+
bootstrapCredentialRef: string;
|
|
23
|
+
}, {
|
|
24
|
+
method: "approle";
|
|
25
|
+
mount: string;
|
|
26
|
+
roleId: string;
|
|
27
|
+
bootstrapCredentialRef: string;
|
|
28
|
+
}>;
|
|
29
|
+
status: z.ZodEnum<["unverified", "ready", "unavailable", "revoked"]>;
|
|
30
|
+
version: z.ZodNumber;
|
|
31
|
+
}, "strict", z.ZodTypeAny, {
|
|
32
|
+
status: "revoked" | "ready" | "unavailable" | "unverified";
|
|
33
|
+
id: string;
|
|
34
|
+
version: number;
|
|
35
|
+
authentication: {
|
|
36
|
+
method: "approle";
|
|
37
|
+
mount: string;
|
|
38
|
+
roleId: string;
|
|
39
|
+
bootstrapCredentialRef: string;
|
|
40
|
+
};
|
|
41
|
+
displayName: string;
|
|
42
|
+
endpoint: string;
|
|
43
|
+
namespace: string | null;
|
|
44
|
+
backend: "managed-openbao" | "external-openbao" | "hashicorp-vault";
|
|
45
|
+
ownerTeamId: string | null;
|
|
46
|
+
secretsMount: string;
|
|
47
|
+
networkRouteId: string;
|
|
48
|
+
tlsTrustId: string;
|
|
49
|
+
}, {
|
|
50
|
+
status: "revoked" | "ready" | "unavailable" | "unverified";
|
|
51
|
+
id: string;
|
|
52
|
+
version: number;
|
|
53
|
+
authentication: {
|
|
54
|
+
method: "approle";
|
|
55
|
+
mount: string;
|
|
56
|
+
roleId: string;
|
|
57
|
+
bootstrapCredentialRef: string;
|
|
58
|
+
};
|
|
59
|
+
displayName: string;
|
|
60
|
+
endpoint: string;
|
|
61
|
+
namespace: string | null;
|
|
62
|
+
backend: "managed-openbao" | "external-openbao" | "hashicorp-vault";
|
|
63
|
+
ownerTeamId: string | null;
|
|
64
|
+
secretsMount: string;
|
|
65
|
+
networkRouteId: string;
|
|
66
|
+
tlsTrustId: string;
|
|
67
|
+
}>;
|
|
68
|
+
export type VaultDescriptor = z.infer<typeof vaultDescriptorSchema>;
|
|
69
|
+
export declare const vaultAllocationSchema: z.ZodObject<{
|
|
70
|
+
id: z.ZodString;
|
|
71
|
+
vaultId: z.ZodString;
|
|
72
|
+
teamId: z.ZodString;
|
|
73
|
+
grantId: z.ZodNullable<z.ZodString>;
|
|
74
|
+
pathPrefix: z.ZodEffects<z.ZodString, string, string>;
|
|
75
|
+
permissions: z.ZodArray<z.ZodEnum<["read", "write", "delete"]>, "many">;
|
|
76
|
+
version: z.ZodNumber;
|
|
77
|
+
}, "strict", z.ZodTypeAny, {
|
|
78
|
+
id: string;
|
|
79
|
+
version: number;
|
|
80
|
+
teamId: string;
|
|
81
|
+
grantId: string | null;
|
|
82
|
+
permissions: ("read" | "write" | "delete")[];
|
|
83
|
+
vaultId: string;
|
|
84
|
+
pathPrefix: string;
|
|
85
|
+
}, {
|
|
86
|
+
id: string;
|
|
87
|
+
version: number;
|
|
88
|
+
teamId: string;
|
|
89
|
+
grantId: string | null;
|
|
90
|
+
permissions: ("read" | "write" | "delete")[];
|
|
91
|
+
vaultId: string;
|
|
92
|
+
pathPrefix: string;
|
|
93
|
+
}>;
|
|
94
|
+
export declare const vaultCredentialReferenceSchema: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
|
|
95
|
+
mode: z.ZodLiteral<"managed">;
|
|
96
|
+
vaultId: z.ZodString;
|
|
97
|
+
allocationId: z.ZodString;
|
|
98
|
+
recordPath: z.ZodEffects<z.ZodString, string, string>;
|
|
99
|
+
}, "strict", z.ZodTypeAny, {
|
|
100
|
+
mode: "managed";
|
|
101
|
+
vaultId: string;
|
|
102
|
+
allocationId: string;
|
|
103
|
+
recordPath: string;
|
|
104
|
+
}, {
|
|
105
|
+
mode: "managed";
|
|
106
|
+
vaultId: string;
|
|
107
|
+
allocationId: string;
|
|
108
|
+
recordPath: string;
|
|
109
|
+
}>, z.ZodObject<{
|
|
110
|
+
mode: z.ZodLiteral<"existing">;
|
|
111
|
+
vaultId: z.ZodString;
|
|
112
|
+
allocationId: z.ZodString;
|
|
113
|
+
recordPath: z.ZodEffects<z.ZodString, string, string>;
|
|
114
|
+
fieldMapping: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodString>, Record<string, string>, Record<string, string>>;
|
|
115
|
+
pinnedVersion: z.ZodNullable<z.ZodNumber>;
|
|
116
|
+
}, "strict", z.ZodTypeAny, {
|
|
117
|
+
mode: "existing";
|
|
118
|
+
vaultId: string;
|
|
119
|
+
allocationId: string;
|
|
120
|
+
recordPath: string;
|
|
121
|
+
fieldMapping: Record<string, string>;
|
|
122
|
+
pinnedVersion: number | null;
|
|
123
|
+
}, {
|
|
124
|
+
mode: "existing";
|
|
125
|
+
vaultId: string;
|
|
126
|
+
allocationId: string;
|
|
127
|
+
recordPath: string;
|
|
128
|
+
fieldMapping: Record<string, string>;
|
|
129
|
+
pinnedVersion: number | null;
|
|
130
|
+
}>]>;
|
|
131
|
+
export type VaultCredentialReference = z.infer<typeof vaultCredentialReferenceSchema>;
|
|
132
|
+
export declare function assertCredentialRecordMutation(reference: VaultCredentialReference): void;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const id = z.string().regex(/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/u);
|
|
3
|
+
const path = z.string().min(1).max(512).refine((value) => value.split("/").every((segment) => /^[A-Za-z0-9][A-Za-z0-9_.-]*$/u.test(segment)), "Canonical relative vault path required.");
|
|
4
|
+
const endpoint = z.string().url().refine((value) => {
|
|
5
|
+
const url = new URL(value);
|
|
6
|
+
return url.protocol === "https:" && !url.username && !url.password && !url.search && !url.hash && url.pathname === "/";
|
|
7
|
+
}, "HTTPS origin without credentials, query or fragment required.");
|
|
8
|
+
const vaultDescriptorSchema = z.object({
|
|
9
|
+
id,
|
|
10
|
+
ownerTeamId: id.nullable(),
|
|
11
|
+
displayName: z.string().trim().min(1).max(160),
|
|
12
|
+
backend: z.enum(["managed-openbao", "external-openbao", "hashicorp-vault"]),
|
|
13
|
+
endpoint,
|
|
14
|
+
secretsMount: path,
|
|
15
|
+
namespace: path.nullable(),
|
|
16
|
+
networkRouteId: id,
|
|
17
|
+
tlsTrustId: id,
|
|
18
|
+
authentication: z.object({
|
|
19
|
+
method: z.literal("approle"),
|
|
20
|
+
mount: path,
|
|
21
|
+
roleId: z.string().min(1).max(256),
|
|
22
|
+
bootstrapCredentialRef: id
|
|
23
|
+
}).strict(),
|
|
24
|
+
status: z.enum(["unverified", "ready", "unavailable", "revoked"]),
|
|
25
|
+
version: z.number().int().nonnegative().safe()
|
|
26
|
+
}).strict();
|
|
27
|
+
const vaultAllocationSchema = z.object({
|
|
28
|
+
id,
|
|
29
|
+
vaultId: id,
|
|
30
|
+
teamId: id,
|
|
31
|
+
grantId: id.nullable(),
|
|
32
|
+
pathPrefix: path,
|
|
33
|
+
permissions: z.array(z.enum(["read", "write", "delete"])).min(1),
|
|
34
|
+
version: z.number().int().nonnegative().safe()
|
|
35
|
+
}).strict();
|
|
36
|
+
const vaultCredentialReferenceSchema = z.discriminatedUnion("mode", [
|
|
37
|
+
z.object({ mode: z.literal("managed"), vaultId: id, allocationId: id, recordPath: path }).strict(),
|
|
38
|
+
z.object({
|
|
39
|
+
mode: z.literal("existing"),
|
|
40
|
+
vaultId: id,
|
|
41
|
+
allocationId: id,
|
|
42
|
+
recordPath: path,
|
|
43
|
+
fieldMapping: z.record(id, id).refine((value) => Object.keys(value).length > 0, "At least one field mapping is required."),
|
|
44
|
+
pinnedVersion: z.number().int().positive().safe().nullable()
|
|
45
|
+
}).strict()
|
|
46
|
+
]);
|
|
47
|
+
function assertCredentialRecordMutation(reference) {
|
|
48
|
+
vaultCredentialReferenceSchema.parse(reference);
|
|
49
|
+
if (reference.mode === "existing") throw new Error("existing_secret_read_only");
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
assertCredentialRecordMutation,
|
|
53
|
+
vaultAllocationSchema,
|
|
54
|
+
vaultCredentialReferenceSchema,
|
|
55
|
+
vaultDescriptorSchema
|
|
56
|
+
};
|