@treeseed/sdk 0.13.0-rc.113 → 0.13.0-rc.114
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"completedAt":"2026-09-
|
|
1
|
+
{"completedAt":"2026-09-11T00:17:39.136Z"}
|
|
@@ -2,6 +2,7 @@ import type { ProviderAssignmentLifecycleRequest, ProviderAssignmentLifecycleRes
|
|
|
2
2
|
import type { ProviderRuntimeEventInput } from '../agent-capacity/contracts/capacity/workdays/workday-records.js';
|
|
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
|
+
import { type SourceWorkspaceRequest } from './source-workspace.js';
|
|
5
6
|
export interface ProviderProtocolClientOptions {
|
|
6
7
|
controlPlaneUrl: string;
|
|
7
8
|
accessToken?: string;
|
|
@@ -44,6 +45,48 @@ export declare class ProviderProtocolClient {
|
|
|
44
45
|
startAssignmentExecution(assignmentId: string, request: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
45
46
|
startAssignmentCloseout(assignmentId: string, request: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
46
47
|
preflightAssignmentCompletion(assignmentId: string, request: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
48
|
+
/** Host provider transport only; the recipient key belongs to the trusted source fetch worker. */
|
|
49
|
+
authorizeAssignmentSource(assignmentId: string, request: SourceWorkspaceRequest): Promise<{
|
|
50
|
+
repository: {
|
|
51
|
+
provider: "github";
|
|
52
|
+
name: string;
|
|
53
|
+
owner: string;
|
|
54
|
+
ref: string;
|
|
55
|
+
cloneUrl: string;
|
|
56
|
+
};
|
|
57
|
+
authorization: {
|
|
58
|
+
id: string;
|
|
59
|
+
expiresAt: string;
|
|
60
|
+
schemaVersion: "treeseed.source-workspace-authorization/v1";
|
|
61
|
+
providerId: string;
|
|
62
|
+
issuedAt: string;
|
|
63
|
+
assignmentId: string;
|
|
64
|
+
source: {
|
|
65
|
+
commit: string;
|
|
66
|
+
projectId: string;
|
|
67
|
+
teamId: string;
|
|
68
|
+
profile: "source-only";
|
|
69
|
+
repositoryId: string;
|
|
70
|
+
controlPlaneId: string;
|
|
71
|
+
formatVersion: 1;
|
|
72
|
+
};
|
|
73
|
+
mode: "analysis" | "work";
|
|
74
|
+
attempt: number;
|
|
75
|
+
publication: "denied" | "candidate-only";
|
|
76
|
+
credentialBindingId: string;
|
|
77
|
+
};
|
|
78
|
+
credential: {
|
|
79
|
+
id: string;
|
|
80
|
+
nonce: string;
|
|
81
|
+
expiresAt: string;
|
|
82
|
+
schemaVersion: "treeseed.source-credential-delivery/v1";
|
|
83
|
+
algorithm: "x25519-hkdf-sha256-chacha20-poly1305";
|
|
84
|
+
ciphertext: string;
|
|
85
|
+
tag: string;
|
|
86
|
+
authorizationId: string;
|
|
87
|
+
ephemeralPublicKey: string;
|
|
88
|
+
};
|
|
89
|
+
}>;
|
|
47
90
|
respondToAssignmentDiscussion(assignmentId: string, request: ProviderDiscussionResponseRequest, idempotencyKey: string): Promise<{
|
|
48
91
|
status: "responded" | "abstained";
|
|
49
92
|
schemaVersion: "treeseed.provider-discussion-response-receipt/v1";
|
|
@@ -1,5 +1,6 @@
|
|
|
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
4
|
class CapacityProviderApiError extends Error {
|
|
4
5
|
constructor(message, status, payload) {
|
|
5
6
|
super(message);
|
|
@@ -126,6 +127,16 @@ class ProviderProtocolClient {
|
|
|
126
127
|
preflightAssignmentCompletion(assignmentId, request) {
|
|
127
128
|
return this.invoke(CONTROL_PLANE_OPERATIONS.providers.completionPreflight, { path: { assignmentId }, body: request });
|
|
128
129
|
}
|
|
130
|
+
/** Host provider transport only; the recipient key belongs to the trusted source fetch worker. */
|
|
131
|
+
async authorizeAssignmentSource(assignmentId, request) {
|
|
132
|
+
const body = sourceWorkspaceRequestSchema.parse(request);
|
|
133
|
+
const response = sourceWorkspaceResponseSchema.parse(await this.invoke(
|
|
134
|
+
CONTROL_PLANE_OPERATIONS.providers.sourceWorkspace,
|
|
135
|
+
{ path: { assignmentId }, body }
|
|
136
|
+
));
|
|
137
|
+
if (response.authorization.assignmentId !== assignmentId) throw new CapacityProviderApiError("Source authority assignment correlation failed.", 502, { code: "source_authority_mismatch" });
|
|
138
|
+
return response;
|
|
139
|
+
}
|
|
129
140
|
respondToAssignmentDiscussion(assignmentId, request, idempotencyKey) {
|
|
130
141
|
return this.invoke(CONTROL_PLANE_OPERATIONS.providers.discussionResponse, { path: { assignmentId }, body: request }, { idempotencyKey });
|
|
131
142
|
}
|
|
@@ -823,7 +823,7 @@ export declare const providerSandboxEnvironmentAvailabilitySchema: z.ZodObject<{
|
|
|
823
823
|
checkedAt: z.ZodString;
|
|
824
824
|
reason: z.ZodNullable<z.ZodString>;
|
|
825
825
|
}, "strict", z.ZodTypeAny, {
|
|
826
|
-
status: "ready" | "failed" | "
|
|
826
|
+
status: "ready" | "failed" | "quarantined" | "pulling";
|
|
827
827
|
version: string;
|
|
828
828
|
reason: string | null;
|
|
829
829
|
contractDigest: string;
|
|
@@ -831,7 +831,7 @@ export declare const providerSandboxEnvironmentAvailabilitySchema: z.ZodObject<{
|
|
|
831
831
|
entryId: string;
|
|
832
832
|
checkedAt: string;
|
|
833
833
|
}, {
|
|
834
|
-
status: "ready" | "failed" | "
|
|
834
|
+
status: "ready" | "failed" | "quarantined" | "pulling";
|
|
835
835
|
version: string;
|
|
836
836
|
reason: string | null;
|
|
837
837
|
contractDigest: string;
|
|
@@ -841,7 +841,7 @@ export declare const providerSandboxEnvironmentAvailabilitySchema: z.ZodObject<{
|
|
|
841
841
|
}>, "many">;
|
|
842
842
|
}, "strict", z.ZodTypeAny, {
|
|
843
843
|
entries: {
|
|
844
|
-
status: "ready" | "failed" | "
|
|
844
|
+
status: "ready" | "failed" | "quarantined" | "pulling";
|
|
845
845
|
version: string;
|
|
846
846
|
reason: string | null;
|
|
847
847
|
contractDigest: string;
|
|
@@ -855,7 +855,7 @@ export declare const providerSandboxEnvironmentAvailabilitySchema: z.ZodObject<{
|
|
|
855
855
|
catalogGeneration: number;
|
|
856
856
|
}, {
|
|
857
857
|
entries: {
|
|
858
|
-
status: "ready" | "failed" | "
|
|
858
|
+
status: "ready" | "failed" | "quarantined" | "pulling";
|
|
859
859
|
version: string;
|
|
860
860
|
reason: string | null;
|
|
861
861
|
contractDigest: string;
|
|
@@ -183,7 +183,7 @@ export declare const sourceWorkspaceLeaseSchema: z.ZodObject<{
|
|
|
183
183
|
expiresAt: z.ZodString;
|
|
184
184
|
}, "strict", z.ZodTypeAny, {
|
|
185
185
|
id: string;
|
|
186
|
-
state: "active" | "released" | "
|
|
186
|
+
state: "active" | "released" | "exporting" | "quarantined";
|
|
187
187
|
expiresAt: string;
|
|
188
188
|
schemaVersion: "treeseed.source-workspace-lease/v1";
|
|
189
189
|
createdAt: string;
|
|
@@ -205,7 +205,7 @@ export declare const sourceWorkspaceLeaseSchema: z.ZodObject<{
|
|
|
205
205
|
workspaceDigest: string;
|
|
206
206
|
}, {
|
|
207
207
|
id: string;
|
|
208
|
-
state: "active" | "released" | "
|
|
208
|
+
state: "active" | "released" | "exporting" | "quarantined";
|
|
209
209
|
expiresAt: string;
|
|
210
210
|
schemaVersion: "treeseed.source-workspace-lease/v1";
|
|
211
211
|
createdAt: string;
|