@treeseed/sdk 0.13.0-rc.91 → 0.13.0-rc.93

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.
Files changed (40) hide show
  1. package/dist/.treeseed-build-complete.json +1 -1
  2. package/dist/capacity-provider/index.d.ts +1 -0
  3. package/dist/capacity-provider/index.js +1 -0
  4. package/dist/capacity-provider/install-configuration.d.ts +39 -0
  5. package/dist/capacity-provider/install-configuration.js +18 -0
  6. package/dist/configuration/secrets-capability.d.ts +3 -0
  7. package/dist/configuration/secrets-capability.js +3 -0
  8. package/dist/content/validation/agent-operational-content-schemas.d.ts +12 -12
  9. package/dist/content/validation/content-model-schemas.d.ts +13 -13
  10. package/dist/content/validation/portable-content-data.d.ts +1 -1
  11. package/dist/deployment/ai-hosting.d.ts +297 -0
  12. package/dist/deployment/ai-hosting.js +63 -0
  13. package/dist/deployment/ai-instance.d.ts +48 -0
  14. package/dist/deployment/ai-instance.js +23 -0
  15. package/dist/deployment/index.d.ts +2 -0
  16. package/dist/deployment/index.js +2 -0
  17. package/dist/operator-contracts/canonical-command-tree.js +3 -10
  18. package/dist/operator-contracts/catalog/communication-operations.d.ts +2 -2
  19. package/dist/operator-contracts/catalog/infrastructure/ai-instance-operations.d.ts +29 -0
  20. package/dist/operator-contracts/catalog/infrastructure/ai-instance-operations.js +18 -0
  21. package/dist/operator-contracts/catalog/infrastructure/command-tree-paths.d.ts +3 -0
  22. package/dist/operator-contracts/catalog/infrastructure/command-tree-paths.js +15 -0
  23. package/dist/operator-contracts/communication/contracts.d.ts +18 -18
  24. package/dist/operator-contracts/control-plane-operations.d.ts +35 -2
  25. package/dist/operator-contracts/control-plane-operations.js +5 -18
  26. package/dist/operator-contracts/operation-builder.d.ts +1 -0
  27. package/dist/operator-contracts/operation-builder.js +17 -0
  28. package/dist/secrets-capability/github-actions-encryption.js +1 -1
  29. package/dist/secrets-capability/provider-operation-contracts.d.ts +14 -0
  30. package/dist/secrets-capability/service-provider-contracts.d.ts +4 -2
  31. package/dist/secrets-capability/service-provider-contracts.js +41 -27
  32. package/dist/secrets-capability/shared-access.d.ts +51 -0
  33. package/dist/secrets-capability/shared-access.js +36 -0
  34. package/dist/secrets-capability/shared-resources.d.ts +376 -0
  35. package/dist/secrets-capability/shared-resources.js +91 -0
  36. package/dist/secrets-capability/vault-contracts.d.ts +132 -0
  37. package/dist/secrets-capability/vault-contracts.js +56 -0
  38. package/dist/treedx/client.d.ts +8 -0
  39. package/dist/treedx/contract.d.ts +4 -4
  40. package/package.json +2 -2
@@ -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
+ };
@@ -290,6 +290,10 @@ export declare const TREESEED_TREEDX_OPERATIONS: {
290
290
  projectId: string;
291
291
  repoId: string;
292
292
  }, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
293
+ readonly refresh: ControlPlaneOperationBinding<{
294
+ projectId: string;
295
+ repoId: string;
296
+ }, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
293
297
  };
294
298
  };
295
299
  type TreeDxProxyMethod<TOperation extends ControlPlaneOperationBinding<any, any, any, any>> = (input: ControlPlaneInvocation<ControlPlaneOperationPath<TOperation>, ControlPlaneOperationQuery<TOperation>, ControlPlaneOperationBody<TOperation>>, options?: ControlPlaneOperationCallOptions) => Promise<ControlPlaneResponseEnvelope<ControlPlaneOperationOutput<TOperation>>>;
@@ -588,6 +592,10 @@ export declare class TreeSeedTreeDxClient {
588
592
  projectId: string;
589
593
  repoId: string;
590
594
  }, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
595
+ readonly refresh: ControlPlaneOperationBinding<{
596
+ projectId: string;
597
+ repoId: string;
598
+ }, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
591
599
  };
592
600
  };
593
601
  readonly proxy: TreeDxProxyGroups<typeof TREESEED_TREEDX_OPERATIONS>;
@@ -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.4";
16
+ readonly treedxPackageVersion: "0.3.0-rc.17";
17
17
  readonly treedxOpenapiVersion: "0.11.1";
18
- readonly treedxOpenapiDigest: "sha256:7c045a99cb0e5ddfb750f060206db374fce86f94dbefecd377bf3e8a5e182ff4";
19
- readonly treedxOperationInventoryDigest: "sha256:a9a36b3def243d1fb58f149dd1f93fc6c56e4193eecc1bb4184c0c20b36e54f0";
20
- readonly treedxGeneratedTypesDigest: "sha256:ff51298be834c3931e725fe017e0def59a23c80998740b2ba1ddbd5ac5e5eca5";
18
+ readonly treedxOpenapiDigest: "sha256:90b040cc8372e1359e77c1a4e7c23c930365202c5eb0a9d4ca865d2f11eb48e1";
19
+ readonly treedxOperationInventoryDigest: "sha256:4f481063ad858cbade4d5fa19c529aca4f108c3e70f12c55ed645c8b412bb17b";
20
+ readonly treedxGeneratedTypesDigest: "sha256:b920eba21f37637c5907d2377a5c55ea5084f5c92100dceeb10b03f7749a74b2";
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.91",
3
+ "version": "0.13.0-rc.93",
4
4
  "description": "Portable TreeSeed contracts, standards, and typed remote control-plane clients.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -51,7 +51,7 @@
51
51
  "standards:release-evidence": "node --import tsx ./scripts/standards/create-release-evidence.ts"
52
52
  },
53
53
  "dependencies": {
54
- "@treeseed/treedx": "0.3.0-rc.4",
54
+ "@treeseed/treedx": "0.3.0-rc.17",
55
55
  "esbuild": "^0.28.0",
56
56
  "libsodium-wrappers-sumo": "0.8.4",
57
57
  "typescript": "^5.9.3",