@tangle-network/agent-interface 0.40.0 → 0.41.0
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/README.md +36 -0
- package/dist/agent-candidate-code-schema.d.ts +2 -0
- package/dist/agent-candidate-execution-plan-schema.d.ts +10 -6
- package/dist/agent-candidate-profile-schema.d.ts +2 -0
- package/dist/agent-candidate-promotion-schema.d.ts +54 -20
- package/dist/agent-candidate-receipt-schema.d.ts +6 -4
- package/dist/agent-candidate-schema.d.ts +4 -0
- package/dist/agent-execution-preparation.d.ts +2 -0
- package/dist/environment-provider.d.ts +119 -1
- package/dist/environment-provider.js +102 -1
- package/dist/harness.d.ts +5 -1
- package/dist/harness.js +2 -0
- package/dist/index.d.ts +13 -3
- package/dist/index.js +4 -0
- package/dist/interaction.d.ts +173 -51
- package/dist/interaction.js +377 -36
- package/dist/portable-context.d.ts +716 -0
- package/dist/portable-context.js +741 -0
- package/dist/profile-schema.d.ts +2 -0
- package/dist/runtime-control.d.ts +38 -0
- package/dist/runtime-control.js +161 -0
- package/dist/workspace-branching.d.ts +251 -0
- package/dist/workspace-branching.js +400 -0
- package/package.json +1 -1
package/dist/profile-schema.d.ts
CHANGED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { StreamEvent } from "./index.js";
|
|
3
|
+
/** Provider-neutral coordinates sufficient to recreate control of one run. */
|
|
4
|
+
export interface AgentRunControlRef {
|
|
5
|
+
runId: string;
|
|
6
|
+
provider: string;
|
|
7
|
+
environmentId: string;
|
|
8
|
+
sessionId?: string;
|
|
9
|
+
executionId?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const AgentRunControlRefSchema: z.ZodObject<{
|
|
12
|
+
runId: z.ZodString;
|
|
13
|
+
provider: z.ZodString;
|
|
14
|
+
environmentId: z.ZodString;
|
|
15
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
16
|
+
executionId: z.ZodOptional<z.ZodString>;
|
|
17
|
+
}, z.core.$strict>;
|
|
18
|
+
/** Runtime validator for every member of the existing canonical event union. */
|
|
19
|
+
export declare const CanonicalStreamEventSchema: z.ZodType<StreamEvent>;
|
|
20
|
+
/** Ordered, replayable envelope around the existing canonical event union. */
|
|
21
|
+
export interface RuntimeEventEnvelope {
|
|
22
|
+
runId: string;
|
|
23
|
+
eventId: string;
|
|
24
|
+
sequence: number;
|
|
25
|
+
cursor?: string;
|
|
26
|
+
occurredAt?: string;
|
|
27
|
+
receivedAt: string;
|
|
28
|
+
event: StreamEvent;
|
|
29
|
+
}
|
|
30
|
+
export declare const RuntimeEventEnvelopeSchema: z.ZodObject<{
|
|
31
|
+
runId: z.ZodString;
|
|
32
|
+
eventId: z.ZodString;
|
|
33
|
+
sequence: z.ZodNumber;
|
|
34
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
35
|
+
occurredAt: z.ZodOptional<z.ZodISODateTime>;
|
|
36
|
+
receivedAt: z.ZodISODateTime;
|
|
37
|
+
event: z.ZodType<StreamEvent, unknown, z.core.$ZodTypeInternals<StreamEvent, unknown>>;
|
|
38
|
+
}, z.core.$strict>;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { InteractionRequestSchema } from "./interaction.js";
|
|
3
|
+
import { DurablePlanSchema } from "./plan.js";
|
|
4
|
+
const stableIdSchema = z
|
|
5
|
+
.string()
|
|
6
|
+
.min(1)
|
|
7
|
+
.max(512)
|
|
8
|
+
.refine((value) => value.trim() === value, "identifier cannot have outer whitespace");
|
|
9
|
+
export const AgentRunControlRefSchema = z.strictObject({
|
|
10
|
+
runId: stableIdSchema,
|
|
11
|
+
provider: stableIdSchema,
|
|
12
|
+
environmentId: stableIdSchema,
|
|
13
|
+
sessionId: stableIdSchema.optional(),
|
|
14
|
+
executionId: stableIdSchema.optional(),
|
|
15
|
+
});
|
|
16
|
+
const unknownRecordSchema = z.record(z.string(), z.unknown());
|
|
17
|
+
const partBase = {
|
|
18
|
+
id: stableIdSchema,
|
|
19
|
+
sessionID: stableIdSchema,
|
|
20
|
+
messageID: stableIdSchema,
|
|
21
|
+
};
|
|
22
|
+
const toolTimeSchema = z.strictObject({
|
|
23
|
+
start: z.number().finite(),
|
|
24
|
+
end: z.number().finite().optional(),
|
|
25
|
+
});
|
|
26
|
+
const toolStateSchema = z.discriminatedUnion("status", [
|
|
27
|
+
z.strictObject({
|
|
28
|
+
status: z.literal("pending"),
|
|
29
|
+
input: unknownRecordSchema,
|
|
30
|
+
raw: z.string().optional(),
|
|
31
|
+
}),
|
|
32
|
+
z.strictObject({
|
|
33
|
+
status: z.literal("running"),
|
|
34
|
+
input: unknownRecordSchema,
|
|
35
|
+
title: z.string().optional(),
|
|
36
|
+
metadata: unknownRecordSchema.optional(),
|
|
37
|
+
time: z.strictObject({ start: z.number().finite() }).optional(),
|
|
38
|
+
}),
|
|
39
|
+
z.strictObject({
|
|
40
|
+
status: z.literal("completed"),
|
|
41
|
+
input: unknownRecordSchema,
|
|
42
|
+
output: z.unknown(),
|
|
43
|
+
title: z.string().optional(),
|
|
44
|
+
metadata: unknownRecordSchema.optional(),
|
|
45
|
+
time: z.strictObject({
|
|
46
|
+
start: z.number().finite(),
|
|
47
|
+
end: z.number().finite(),
|
|
48
|
+
}).optional(),
|
|
49
|
+
}),
|
|
50
|
+
z.strictObject({
|
|
51
|
+
status: z.enum(["error", "failed"]),
|
|
52
|
+
input: unknownRecordSchema,
|
|
53
|
+
error: z.string().optional(),
|
|
54
|
+
output: z.unknown().optional(),
|
|
55
|
+
metadata: unknownRecordSchema.optional(),
|
|
56
|
+
time: toolTimeSchema.optional(),
|
|
57
|
+
}),
|
|
58
|
+
]);
|
|
59
|
+
const partSchema = z.discriminatedUnion("type", [
|
|
60
|
+
z.strictObject({ ...partBase, type: z.literal("text"), text: z.string() }),
|
|
61
|
+
z.strictObject({
|
|
62
|
+
...partBase,
|
|
63
|
+
type: z.literal("tool"),
|
|
64
|
+
callID: stableIdSchema.optional(),
|
|
65
|
+
tool: stableIdSchema,
|
|
66
|
+
state: toolStateSchema,
|
|
67
|
+
metadata: unknownRecordSchema.optional(),
|
|
68
|
+
}),
|
|
69
|
+
z.strictObject({
|
|
70
|
+
...partBase,
|
|
71
|
+
type: z.literal("reasoning"),
|
|
72
|
+
text: z.string(),
|
|
73
|
+
}),
|
|
74
|
+
z.strictObject({
|
|
75
|
+
...partBase,
|
|
76
|
+
type: z.literal("file"),
|
|
77
|
+
filename: z.string().optional(),
|
|
78
|
+
mediaType: z.string().optional(),
|
|
79
|
+
url: z.string().optional(),
|
|
80
|
+
}),
|
|
81
|
+
z.strictObject({
|
|
82
|
+
...partBase,
|
|
83
|
+
type: z.literal("subtask"),
|
|
84
|
+
prompt: z.string(),
|
|
85
|
+
description: z.string(),
|
|
86
|
+
agent: stableIdSchema,
|
|
87
|
+
}),
|
|
88
|
+
]);
|
|
89
|
+
/** Runtime validator for every member of the existing canonical event union. */
|
|
90
|
+
export const CanonicalStreamEventSchema = z.discriminatedUnion("type", [
|
|
91
|
+
z.strictObject({
|
|
92
|
+
type: z.literal("message.part.updated"),
|
|
93
|
+
part: partSchema,
|
|
94
|
+
delta: z.string().optional(),
|
|
95
|
+
}),
|
|
96
|
+
z.strictObject({
|
|
97
|
+
type: z.literal("tool-heartbeat"),
|
|
98
|
+
toolName: stableIdSchema,
|
|
99
|
+
partId: stableIdSchema,
|
|
100
|
+
elapsedMs: z.number().finite().nonnegative(),
|
|
101
|
+
}),
|
|
102
|
+
z.strictObject({
|
|
103
|
+
type: z.literal("tool-slow"),
|
|
104
|
+
toolName: stableIdSchema,
|
|
105
|
+
partId: stableIdSchema,
|
|
106
|
+
elapsedMs: z.number().finite().nonnegative(),
|
|
107
|
+
thresholdMs: z.number().finite().nonnegative(),
|
|
108
|
+
}),
|
|
109
|
+
z.strictObject({
|
|
110
|
+
type: z.literal("model-processing"),
|
|
111
|
+
phase: z.enum(["tool-result", "generating", "thinking"]),
|
|
112
|
+
toolName: stableIdSchema.optional(),
|
|
113
|
+
elapsedMs: z.number().finite().nonnegative().optional(),
|
|
114
|
+
}),
|
|
115
|
+
z.strictObject({
|
|
116
|
+
type: z.literal("status"),
|
|
117
|
+
status: z.enum(["started", "processing", "completed", "failed"]),
|
|
118
|
+
detail: z.string().optional(),
|
|
119
|
+
}),
|
|
120
|
+
z.strictObject({
|
|
121
|
+
type: z.literal("warning"),
|
|
122
|
+
code: stableIdSchema,
|
|
123
|
+
message: z.string(),
|
|
124
|
+
}),
|
|
125
|
+
z.strictObject({
|
|
126
|
+
type: z.literal("raw"),
|
|
127
|
+
backend: stableIdSchema,
|
|
128
|
+
event: z.unknown(),
|
|
129
|
+
}),
|
|
130
|
+
z.strictObject({
|
|
131
|
+
type: z.literal("session.updated"),
|
|
132
|
+
sessionId: stableIdSchema,
|
|
133
|
+
title: z.string().optional(),
|
|
134
|
+
time: z.strictObject({
|
|
135
|
+
created: z.number().finite().optional(),
|
|
136
|
+
updated: z.number().finite().optional(),
|
|
137
|
+
}).optional(),
|
|
138
|
+
}),
|
|
139
|
+
z.strictObject({
|
|
140
|
+
type: z.literal("interaction"),
|
|
141
|
+
request: InteractionRequestSchema,
|
|
142
|
+
}),
|
|
143
|
+
z.strictObject({
|
|
144
|
+
type: z.literal("interaction.cancel"),
|
|
145
|
+
id: stableIdSchema,
|
|
146
|
+
reason: z.string().optional(),
|
|
147
|
+
}),
|
|
148
|
+
z.strictObject({
|
|
149
|
+
type: z.literal("plan.submitted"),
|
|
150
|
+
plan: DurablePlanSchema,
|
|
151
|
+
}),
|
|
152
|
+
]);
|
|
153
|
+
export const RuntimeEventEnvelopeSchema = z.strictObject({
|
|
154
|
+
runId: stableIdSchema,
|
|
155
|
+
eventId: stableIdSchema,
|
|
156
|
+
sequence: z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
|
|
157
|
+
cursor: stableIdSchema.optional(),
|
|
158
|
+
occurredAt: z.iso.datetime().optional(),
|
|
159
|
+
receivedAt: z.iso.datetime(),
|
|
160
|
+
event: CanonicalStreamEventSchema,
|
|
161
|
+
});
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { Sha256Digest } from "./agent-candidate.js";
|
|
3
|
+
import type { PlacementInfo } from "./environment-provider.js";
|
|
4
|
+
import { type AgentRunControlRef } from "./runtime-control.js";
|
|
5
|
+
export interface WorkspaceCheckpointMaterial {
|
|
6
|
+
source: AgentRunControlRef;
|
|
7
|
+
name?: string;
|
|
8
|
+
metadata?: Record<string, unknown>;
|
|
9
|
+
}
|
|
10
|
+
export interface WorkspaceCheckpointRequest extends WorkspaceCheckpointMaterial {
|
|
11
|
+
idempotencyKey: string;
|
|
12
|
+
requestDigest: Sha256Digest;
|
|
13
|
+
}
|
|
14
|
+
export declare function workspaceCheckpointRequestDigest(material: WorkspaceCheckpointMaterial): Sha256Digest;
|
|
15
|
+
export declare const WorkspaceCheckpointRequestSchema: z.ZodObject<{
|
|
16
|
+
source: z.ZodObject<{
|
|
17
|
+
runId: z.ZodString;
|
|
18
|
+
provider: z.ZodString;
|
|
19
|
+
environmentId: z.ZodString;
|
|
20
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
21
|
+
executionId: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}, z.core.$strict>;
|
|
23
|
+
name: z.ZodOptional<z.ZodString>;
|
|
24
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
25
|
+
idempotencyKey: z.ZodString;
|
|
26
|
+
requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
27
|
+
}, z.core.$strict>;
|
|
28
|
+
export interface WorkspaceCheckpointRef {
|
|
29
|
+
checkpointId: string;
|
|
30
|
+
provider: string;
|
|
31
|
+
source: AgentRunControlRef;
|
|
32
|
+
idempotencyKey: string;
|
|
33
|
+
requestDigest: Sha256Digest;
|
|
34
|
+
createdAt: string;
|
|
35
|
+
metadata?: Record<string, unknown>;
|
|
36
|
+
}
|
|
37
|
+
export declare const WorkspaceCheckpointRefSchema: z.ZodObject<{
|
|
38
|
+
checkpointId: z.ZodString;
|
|
39
|
+
provider: z.ZodString;
|
|
40
|
+
source: z.ZodObject<{
|
|
41
|
+
runId: z.ZodString;
|
|
42
|
+
provider: z.ZodString;
|
|
43
|
+
environmentId: z.ZodString;
|
|
44
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
45
|
+
executionId: z.ZodOptional<z.ZodString>;
|
|
46
|
+
}, z.core.$strict>;
|
|
47
|
+
idempotencyKey: z.ZodString;
|
|
48
|
+
requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
49
|
+
createdAt: z.ZodISODateTime;
|
|
50
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
51
|
+
}, z.core.$strict>;
|
|
52
|
+
export type WorkspaceCheckpointResult = {
|
|
53
|
+
status: "created" | "replayed";
|
|
54
|
+
idempotencyKey: string;
|
|
55
|
+
requestDigest: Sha256Digest;
|
|
56
|
+
checkpoint: WorkspaceCheckpointRef;
|
|
57
|
+
} | {
|
|
58
|
+
status: "conflict";
|
|
59
|
+
idempotencyKey: string;
|
|
60
|
+
requestDigest: Sha256Digest;
|
|
61
|
+
existingRequestDigest: Sha256Digest;
|
|
62
|
+
} | {
|
|
63
|
+
status: "unknown";
|
|
64
|
+
idempotencyKey: string;
|
|
65
|
+
requestDigest: Sha256Digest;
|
|
66
|
+
message: string;
|
|
67
|
+
retryable: boolean;
|
|
68
|
+
};
|
|
69
|
+
export declare const WorkspaceCheckpointResultSchema: z.ZodType<WorkspaceCheckpointResult>;
|
|
70
|
+
export declare const WorkspaceOperationLookupRequestSchema: z.ZodObject<{
|
|
71
|
+
idempotencyKey: z.ZodString;
|
|
72
|
+
requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
73
|
+
}, z.core.$strict>;
|
|
74
|
+
export type WorkspaceOperationLookupRequest = z.infer<typeof WorkspaceOperationLookupRequestSchema>;
|
|
75
|
+
export type WorkspaceCheckpointLookupResult = {
|
|
76
|
+
status: "found";
|
|
77
|
+
idempotencyKey: string;
|
|
78
|
+
requestDigest: Sha256Digest;
|
|
79
|
+
checkpoint: WorkspaceCheckpointRef;
|
|
80
|
+
} | {
|
|
81
|
+
status: "not_found";
|
|
82
|
+
idempotencyKey: string;
|
|
83
|
+
requestDigest: Sha256Digest;
|
|
84
|
+
} | {
|
|
85
|
+
status: "conflict";
|
|
86
|
+
idempotencyKey: string;
|
|
87
|
+
requestDigest: Sha256Digest;
|
|
88
|
+
existingRequestDigest: Sha256Digest;
|
|
89
|
+
} | {
|
|
90
|
+
status: "unknown";
|
|
91
|
+
idempotencyKey: string;
|
|
92
|
+
requestDigest: Sha256Digest;
|
|
93
|
+
message: string;
|
|
94
|
+
retryable: boolean;
|
|
95
|
+
};
|
|
96
|
+
export declare const WorkspaceCheckpointLookupResultSchema: z.ZodType<WorkspaceCheckpointLookupResult>;
|
|
97
|
+
export interface WorkspaceForkMaterial {
|
|
98
|
+
checkpoint: WorkspaceCheckpointRef;
|
|
99
|
+
name?: string;
|
|
100
|
+
metadata?: Record<string, unknown>;
|
|
101
|
+
}
|
|
102
|
+
export interface WorkspaceForkRequest extends WorkspaceForkMaterial {
|
|
103
|
+
idempotencyKey: string;
|
|
104
|
+
requestDigest: Sha256Digest;
|
|
105
|
+
}
|
|
106
|
+
export declare function workspaceForkRequestDigest(material: WorkspaceForkMaterial): Sha256Digest;
|
|
107
|
+
export declare const WorkspaceForkRequestSchema: z.ZodObject<{
|
|
108
|
+
checkpoint: z.ZodObject<{
|
|
109
|
+
checkpointId: z.ZodString;
|
|
110
|
+
provider: z.ZodString;
|
|
111
|
+
source: z.ZodObject<{
|
|
112
|
+
runId: z.ZodString;
|
|
113
|
+
provider: z.ZodString;
|
|
114
|
+
environmentId: z.ZodString;
|
|
115
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
116
|
+
executionId: z.ZodOptional<z.ZodString>;
|
|
117
|
+
}, z.core.$strict>;
|
|
118
|
+
idempotencyKey: z.ZodString;
|
|
119
|
+
requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
120
|
+
createdAt: z.ZodISODateTime;
|
|
121
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
122
|
+
}, z.core.$strict>;
|
|
123
|
+
name: z.ZodOptional<z.ZodString>;
|
|
124
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
125
|
+
idempotencyKey: z.ZodString;
|
|
126
|
+
requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
127
|
+
}, z.core.$strict>;
|
|
128
|
+
export interface ForkedEnvironmentRef {
|
|
129
|
+
provider: string;
|
|
130
|
+
environmentId: string;
|
|
131
|
+
sourceCheckpointId: string;
|
|
132
|
+
idempotencyKey: string;
|
|
133
|
+
requestDigest: Sha256Digest;
|
|
134
|
+
createdAt: string;
|
|
135
|
+
placement?: PlacementInfo;
|
|
136
|
+
confidential: boolean;
|
|
137
|
+
metadata?: Record<string, unknown>;
|
|
138
|
+
}
|
|
139
|
+
export declare const ForkedEnvironmentRefSchema: z.ZodObject<{
|
|
140
|
+
provider: z.ZodString;
|
|
141
|
+
environmentId: z.ZodString;
|
|
142
|
+
sourceCheckpointId: z.ZodString;
|
|
143
|
+
idempotencyKey: z.ZodString;
|
|
144
|
+
requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
145
|
+
createdAt: z.ZodISODateTime;
|
|
146
|
+
placement: z.ZodOptional<z.ZodObject<{
|
|
147
|
+
kind: z.ZodEnum<{
|
|
148
|
+
provider: "provider";
|
|
149
|
+
local: "local";
|
|
150
|
+
sandbox: "sandbox";
|
|
151
|
+
fleet: "fleet";
|
|
152
|
+
}>;
|
|
153
|
+
sandboxId: z.ZodOptional<z.ZodString>;
|
|
154
|
+
fleetId: z.ZodOptional<z.ZodString>;
|
|
155
|
+
machineId: z.ZodOptional<z.ZodString>;
|
|
156
|
+
region: z.ZodOptional<z.ZodString>;
|
|
157
|
+
providerMetadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
158
|
+
}, z.core.$strict>>;
|
|
159
|
+
confidential: z.ZodBoolean;
|
|
160
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
161
|
+
}, z.core.$strict>;
|
|
162
|
+
export type WorkspaceForkResult = {
|
|
163
|
+
status: "created" | "replayed";
|
|
164
|
+
idempotencyKey: string;
|
|
165
|
+
requestDigest: Sha256Digest;
|
|
166
|
+
environment: ForkedEnvironmentRef;
|
|
167
|
+
} | {
|
|
168
|
+
status: "conflict";
|
|
169
|
+
idempotencyKey: string;
|
|
170
|
+
requestDigest: Sha256Digest;
|
|
171
|
+
existingRequestDigest: Sha256Digest;
|
|
172
|
+
} | {
|
|
173
|
+
status: "unknown";
|
|
174
|
+
idempotencyKey: string;
|
|
175
|
+
requestDigest: Sha256Digest;
|
|
176
|
+
message: string;
|
|
177
|
+
retryable: boolean;
|
|
178
|
+
};
|
|
179
|
+
export declare const WorkspaceForkResultSchema: z.ZodType<WorkspaceForkResult>;
|
|
180
|
+
export type WorkspaceForkLookupResult = {
|
|
181
|
+
status: "found";
|
|
182
|
+
idempotencyKey: string;
|
|
183
|
+
requestDigest: Sha256Digest;
|
|
184
|
+
environment: ForkedEnvironmentRef;
|
|
185
|
+
} | {
|
|
186
|
+
status: "not_found";
|
|
187
|
+
idempotencyKey: string;
|
|
188
|
+
requestDigest: Sha256Digest;
|
|
189
|
+
} | {
|
|
190
|
+
status: "conflict";
|
|
191
|
+
idempotencyKey: string;
|
|
192
|
+
requestDigest: Sha256Digest;
|
|
193
|
+
existingRequestDigest: Sha256Digest;
|
|
194
|
+
} | {
|
|
195
|
+
status: "unknown";
|
|
196
|
+
idempotencyKey: string;
|
|
197
|
+
requestDigest: Sha256Digest;
|
|
198
|
+
message: string;
|
|
199
|
+
retryable: boolean;
|
|
200
|
+
};
|
|
201
|
+
export declare const WorkspaceForkLookupResultSchema: z.ZodType<WorkspaceForkLookupResult>;
|
|
202
|
+
export declare const WorkspaceCleanupRequestSchema: z.ZodObject<{
|
|
203
|
+
operationId: z.ZodString;
|
|
204
|
+
targetId: z.ZodString;
|
|
205
|
+
provider: z.ZodString;
|
|
206
|
+
}, z.core.$strict>;
|
|
207
|
+
export type WorkspaceCleanupRequest = z.infer<typeof WorkspaceCleanupRequestSchema>;
|
|
208
|
+
export declare const WorkspaceCleanupAcknowledgementSchema: z.ZodObject<{
|
|
209
|
+
operationId: z.ZodString;
|
|
210
|
+
targetId: z.ZodString;
|
|
211
|
+
provider: z.ZodString;
|
|
212
|
+
status: z.ZodEnum<{
|
|
213
|
+
unknown: "unknown";
|
|
214
|
+
conflict: "conflict";
|
|
215
|
+
transport_failure: "transport_failure";
|
|
216
|
+
deleted: "deleted";
|
|
217
|
+
already_absent: "already_absent";
|
|
218
|
+
in_use: "in_use";
|
|
219
|
+
}>;
|
|
220
|
+
message: z.ZodOptional<z.ZodString>;
|
|
221
|
+
retryable: z.ZodOptional<z.ZodBoolean>;
|
|
222
|
+
blockingTargetIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
223
|
+
}, z.core.$strict>;
|
|
224
|
+
export type WorkspaceCleanupAcknowledgement = z.infer<typeof WorkspaceCleanupAcknowledgementSchema>;
|
|
225
|
+
/** Optional durable workspace branch operations implemented by capable providers. */
|
|
226
|
+
export interface AgentWorkspaceBranching {
|
|
227
|
+
checkpoint(request: WorkspaceCheckpointRequest, options?: {
|
|
228
|
+
signal?: AbortSignal;
|
|
229
|
+
}): Promise<WorkspaceCheckpointResult>;
|
|
230
|
+
lookupCheckpoint(request: WorkspaceOperationLookupRequest, options?: {
|
|
231
|
+
signal?: AbortSignal;
|
|
232
|
+
}): Promise<WorkspaceCheckpointLookupResult>;
|
|
233
|
+
deleteCheckpoint(request: WorkspaceCleanupRequest, options?: {
|
|
234
|
+
signal?: AbortSignal;
|
|
235
|
+
}): Promise<WorkspaceCleanupAcknowledgement>;
|
|
236
|
+
fork(request: WorkspaceForkRequest, options?: {
|
|
237
|
+
signal?: AbortSignal;
|
|
238
|
+
}): Promise<WorkspaceForkResult>;
|
|
239
|
+
lookupFork(request: WorkspaceOperationLookupRequest, options?: {
|
|
240
|
+
signal?: AbortSignal;
|
|
241
|
+
}): Promise<WorkspaceForkLookupResult>;
|
|
242
|
+
destroyFork(request: WorkspaceCleanupRequest, options?: {
|
|
243
|
+
signal?: AbortSignal;
|
|
244
|
+
}): Promise<WorkspaceCleanupAcknowledgement>;
|
|
245
|
+
}
|
|
246
|
+
/** Bind a checkpoint result to the exact request before using the resource. */
|
|
247
|
+
export declare function workspaceCheckpointResultMatchesRequest(request: WorkspaceCheckpointRequest, result: WorkspaceCheckpointResult | WorkspaceCheckpointLookupResult): boolean;
|
|
248
|
+
/** Bind a fork result to the exact checkpoint request before using it. */
|
|
249
|
+
export declare function workspaceForkResultMatchesRequest(request: WorkspaceForkRequest, result: WorkspaceForkResult | WorkspaceForkLookupResult): boolean;
|
|
250
|
+
/** Bind cleanup confirmation to the exact provider resource and operation. */
|
|
251
|
+
export declare function workspaceCleanupAcknowledgementMatches(request: WorkspaceCleanupRequest, acknowledgement: WorkspaceCleanupAcknowledgement): boolean;
|