@treeseed/sdk 0.13.0-rc.114 → 0.13.0-rc.116
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/client.d.ts +42 -0
- package/dist/capacity-provider/client.js +22 -1
- package/dist/capacity-provider/sandbox.d.ts +1 -0
- package/dist/capacity-provider/sandbox.js +1 -0
- package/dist/capacity-provider/source/candidate.d.ts +1275 -0
- package/dist/capacity-provider/source/candidate.js +72 -0
- package/dist/capacity-provider/source-workspace.d.ts +41 -0
- package/dist/capacity-provider/source-workspace.js +10 -0
- package/dist/content/validation/content-model-schemas.d.ts +5 -5
- package/dist/content/validation/portable-content-data.d.ts +1 -1
- package/dist/operator-contracts/canonical-command-tree.js +3 -1
- package/dist/operator-contracts/catalog/workdays/profile-commands.d.ts +4 -0
- package/dist/operator-contracts/catalog/workdays/profile-commands.js +20 -0
- package/dist/operator-contracts/catalog/workdays/profile-operations.d.ts +16 -0
- package/dist/operator-contracts/catalog/workdays/profile-operations.js +48 -0
- package/dist/operator-contracts/control-plane-operations.d.ts +17 -0
- package/dist/operator-contracts/control-plane-operations.js +4 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"completedAt":"2026-09-
|
|
1
|
+
{"completedAt":"2026-09-11T06:25:55.931Z"}
|
|
@@ -3,6 +3,7 @@ import type { ProviderRuntimeEventInput } from '../agent-capacity/contracts/capa
|
|
|
3
3
|
import type { CapacityProviderIdentity, CapacityProviderIdentityRotationRequest, CapacityProviderSignedProof, ProviderAccessTokenIssue, ProviderAvailabilitySession, ProviderCredentialIssuanceAuthorization, ProviderRegistrationRequest, ProviderRegistrationSubmission, ProviderTeamCredentialIssue } from './contracts/index.js';
|
|
4
4
|
import type { ProviderDiscussionResponseRequest } from '../operator-contracts/communication/contracts.js';
|
|
5
5
|
import { type SourceWorkspaceRequest } from './source-workspace.js';
|
|
6
|
+
import { type SourceCandidateRequest, type SourceChunkRequest } from './source/candidate.js';
|
|
6
7
|
export interface ProviderProtocolClientOptions {
|
|
7
8
|
controlPlaneUrl: string;
|
|
8
9
|
accessToken?: string;
|
|
@@ -86,6 +87,47 @@ export declare class ProviderProtocolClient {
|
|
|
86
87
|
authorizationId: string;
|
|
87
88
|
ephemeralPublicKey: string;
|
|
88
89
|
};
|
|
90
|
+
sourceBundle?: {
|
|
91
|
+
digest: string;
|
|
92
|
+
bytes: number;
|
|
93
|
+
artifactId: string;
|
|
94
|
+
chunks: string[];
|
|
95
|
+
} | undefined;
|
|
96
|
+
}>;
|
|
97
|
+
/** Bounded host-only transfer. The API verifies registered-provider signatures and live publication authority. */
|
|
98
|
+
publishAssignmentSourceCandidate(assignmentId: string, request: SourceCandidateRequest): Promise<Record<string, unknown> | {
|
|
99
|
+
id: string;
|
|
100
|
+
schemaVersion: "treeseed.source-candidate-receipt/v1";
|
|
101
|
+
commit: string;
|
|
102
|
+
source: {
|
|
103
|
+
commit: string;
|
|
104
|
+
projectId: string;
|
|
105
|
+
teamId: string;
|
|
106
|
+
profile: "source-only";
|
|
107
|
+
repositoryId: string;
|
|
108
|
+
controlPlaneId: string;
|
|
109
|
+
formatVersion: 1;
|
|
110
|
+
};
|
|
111
|
+
verification: {
|
|
112
|
+
authority: true;
|
|
113
|
+
objectClosure: true;
|
|
114
|
+
ancestry: true;
|
|
115
|
+
};
|
|
116
|
+
bundle: {
|
|
117
|
+
digest: string;
|
|
118
|
+
bytes: number;
|
|
119
|
+
artifactId: string;
|
|
120
|
+
};
|
|
121
|
+
leaseId: string;
|
|
122
|
+
parentCandidateId: string | null;
|
|
123
|
+
persistedAt: string;
|
|
124
|
+
}>;
|
|
125
|
+
/** Source artifacts are accessible only through a current assignment, never ambient team access. */
|
|
126
|
+
readAssignmentSourceChunk(assignmentId: string, request: SourceChunkRequest): Promise<{
|
|
127
|
+
content: string;
|
|
128
|
+
digest: string;
|
|
129
|
+
index: number;
|
|
130
|
+
artifactId: string;
|
|
89
131
|
}>;
|
|
90
132
|
respondToAssignmentDiscussion(assignmentId: string, request: ProviderDiscussionResponseRequest, idempotencyKey: string): Promise<{
|
|
91
133
|
status: "responded" | "abstained";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ControlPlaneClient, ControlPlaneClientError } from "../entrypoints/clients/control-plane-client.js";
|
|
2
2
|
import { CONTROL_PLANE_OPERATIONS } from "../operator-contracts/index.js";
|
|
3
|
-
import { sourceWorkspaceRequestSchema, sourceWorkspaceResponseSchema } from "./source-workspace.js";
|
|
3
|
+
import { sourceWorkspaceRequestSchema, sourceWorkspaceResponseSchema, sourceCandidateReceiptSchema } from "./source-workspace.js";
|
|
4
|
+
import { sourceCandidateRequestSchema, sourceChunkRequestSchema, sourceChunkResponseSchema } from "./source/candidate.js";
|
|
4
5
|
class CapacityProviderApiError extends Error {
|
|
5
6
|
constructor(message, status, payload) {
|
|
6
7
|
super(message);
|
|
@@ -137,6 +138,26 @@ class ProviderProtocolClient {
|
|
|
137
138
|
if (response.authorization.assignmentId !== assignmentId) throw new CapacityProviderApiError("Source authority assignment correlation failed.", 502, { code: "source_authority_mismatch" });
|
|
138
139
|
return response;
|
|
139
140
|
}
|
|
141
|
+
/** Bounded host-only transfer. The API verifies registered-provider signatures and live publication authority. */
|
|
142
|
+
async publishAssignmentSourceCandidate(assignmentId, request) {
|
|
143
|
+
const body = sourceCandidateRequestSchema.parse(request);
|
|
144
|
+
if (body.candidate.attestation.assignmentId !== assignmentId) throw new CapacityProviderApiError("Candidate assignment correlation failed.", 400, { code: "source_candidate_mismatch" });
|
|
145
|
+
const response = await this.invoke(CONTROL_PLANE_OPERATIONS.providers.sourceCandidate, { path: { assignmentId }, body });
|
|
146
|
+
if (body.action === "commit") {
|
|
147
|
+
const receipt = sourceCandidateReceiptSchema.parse(response);
|
|
148
|
+
if (receipt.leaseId !== body.candidate.attestation.leaseId || receipt.commit !== body.candidate.attestation.commit || receipt.bundle.digest !== body.candidate.attestation.bundle.digest || JSON.stringify(receipt.source) !== JSON.stringify(body.candidate.attestation.source)) throw new CapacityProviderApiError("Candidate receipt correlation failed.", 502, { code: "source_candidate_receipt_mismatch" });
|
|
149
|
+
return receipt;
|
|
150
|
+
}
|
|
151
|
+
if (response.accepted !== true || response.index !== body.index || response.digest !== body.candidate.attestation.bundle.chunks[body.index]) throw new CapacityProviderApiError("Candidate chunk receipt correlation failed.", 502, { code: "source_candidate_chunk_mismatch" });
|
|
152
|
+
return response;
|
|
153
|
+
}
|
|
154
|
+
/** Source artifacts are accessible only through a current assignment, never ambient team access. */
|
|
155
|
+
async readAssignmentSourceChunk(assignmentId, request) {
|
|
156
|
+
const body = sourceChunkRequestSchema.parse(request);
|
|
157
|
+
const response = sourceChunkResponseSchema.parse(await this.invoke(CONTROL_PLANE_OPERATIONS.providers.sourceChunk, { path: { assignmentId }, body }));
|
|
158
|
+
if (response.artifactId !== body.artifactId || response.index !== body.index) throw new CapacityProviderApiError("Source chunk correlation failed.", 502, { code: "source_chunk_mismatch" });
|
|
159
|
+
return response;
|
|
160
|
+
}
|
|
140
161
|
respondToAssignmentDiscussion(assignmentId, request, idempotencyKey) {
|
|
141
162
|
return this.invoke(CONTROL_PLANE_OPERATIONS.providers.discussionResponse, { path: { assignmentId }, body: request }, { idempotencyKey });
|
|
142
163
|
}
|