@tangle-network/agent-interface 0.45.0 → 0.46.1
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 +1 -1
- package/dist/agent-candidate-profile-schema.d.ts +2 -2
- package/dist/agent-candidate-promotion-schema.d.ts +22 -22
- package/dist/agent-candidate-schema-common.js +1 -1
- package/dist/agent-candidate-schema.d.ts +2 -2
- package/dist/agent-execution-preparation.d.ts +26 -26
- package/dist/agent-profile.d.ts +10 -3
- package/dist/agent-profile.js +45 -22
- package/dist/backend-message.d.ts +14 -0
- package/dist/backend-message.js +1 -0
- package/dist/contract-limits.d.ts +26 -0
- package/dist/contract-limits.js +175 -0
- package/dist/environment-exact-process.d.ts +161 -0
- package/dist/environment-exact-process.js +1 -0
- package/dist/environment-profile-capabilities.d.ts +26 -0
- package/dist/environment-profile-capabilities.js +34 -0
- package/dist/environment-provider.d.ts +3 -730
- package/dist/environment-provider.js +3 -245
- package/dist/environment-requests.d.ts +70 -0
- package/dist/environment-requests.js +1 -0
- package/dist/environment-runtime.d.ts +834 -0
- package/dist/environment-runtime.js +228 -0
- package/dist/execution-types.d.ts +50 -0
- package/dist/execution-types.js +1 -0
- package/dist/host-services.d.ts +91 -0
- package/dist/host-services.js +1 -0
- package/dist/index.d.ts +10 -617
- package/dist/index.js +10 -125
- package/dist/interaction-answer-validation.d.ts +13 -0
- package/dist/interaction-answer-validation.js +149 -0
- package/dist/interaction-data.d.ts +22 -0
- package/dist/interaction-data.js +46 -0
- package/dist/interaction-envelope.d.ts +267 -0
- package/dist/interaction-envelope.js +247 -0
- package/dist/interaction-fields.d.ts +130 -0
- package/dist/interaction-fields.js +227 -0
- package/dist/interaction-permissions.d.ts +28 -0
- package/dist/interaction-permissions.js +57 -0
- package/dist/interaction-resolution-validation.d.ts +9 -0
- package/dist/interaction-resolution-validation.js +50 -0
- package/dist/interaction-response-validation.d.ts +17 -0
- package/dist/interaction-response-validation.js +102 -0
- package/dist/interaction.d.ts +6 -397
- package/dist/interaction.js +6 -603
- package/dist/mcp.d.ts +38 -0
- package/dist/mcp.js +1 -0
- package/dist/parts.d.ts +104 -0
- package/dist/parts.js +55 -0
- package/dist/portable-context-base.d.ts +82 -0
- package/dist/portable-context-base.js +63 -0
- package/dist/portable-context-continuation.d.ts +168 -0
- package/dist/portable-context-continuation.js +194 -0
- package/dist/portable-context-plan-request.d.ts +86 -0
- package/dist/portable-context-plan-request.js +102 -0
- package/dist/portable-context-plan.d.ts +229 -0
- package/dist/portable-context-plan.js +241 -0
- package/dist/portable-context-shared.d.ts +36 -0
- package/dist/portable-context-shared.js +46 -0
- package/dist/portable-context-transfer.d.ts +319 -0
- package/dist/portable-context-transfer.js +206 -0
- package/dist/portable-context.d.ts +5 -753
- package/dist/portable-context.js +5 -754
- package/dist/profile-diff.js +56 -47
- package/dist/provider-adapter.d.ts +45 -0
- package/dist/provider-adapter.js +1 -0
- package/dist/provider-config.d.ts +58 -0
- package/dist/provider-config.js +42 -0
- package/dist/runtime-control.d.ts +87 -10
- package/dist/runtime-control.js +159 -38
- package/dist/stream-events.d.ts +55 -0
- package/dist/stream-events.js +1 -0
- package/dist/workspace-branching-shared.d.ts +7 -0
- package/dist/workspace-branching-shared.js +20 -0
- package/dist/workspace-branching.d.ts +4 -254
- package/dist/workspace-branching.js +4 -400
- package/dist/workspace-checkpoint.d.ts +99 -0
- package/dist/workspace-checkpoint.js +169 -0
- package/dist/workspace-cleanup.d.ts +85 -0
- package/dist/workspace-cleanup.js +156 -0
- package/dist/workspace-confidentiality.d.ts +59 -0
- package/dist/workspace-confidentiality.js +123 -0
- package/dist/workspace-fork.d.ts +182 -0
- package/dist/workspace-fork.js +267 -0
- package/package.json +1 -1
package/dist/profile-diff.js
CHANGED
|
@@ -179,24 +179,24 @@ function removeResources(resources, removal) {
|
|
|
179
179
|
const next = { ...resources };
|
|
180
180
|
if (removal.files !== undefined) {
|
|
181
181
|
if (removal.files === true) {
|
|
182
|
-
next.files
|
|
182
|
+
delete next.files;
|
|
183
183
|
}
|
|
184
184
|
else {
|
|
185
185
|
const removeSet = new Set(removal.files);
|
|
186
|
-
next
|
|
186
|
+
setOrDelete(next, "files", next.files?.filter((file) => {
|
|
187
187
|
const name = resourceName(file.resource);
|
|
188
188
|
return !removeSet.has(file.path) && !(name && removeSet.has(name));
|
|
189
|
-
});
|
|
189
|
+
}));
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
|
-
next
|
|
193
|
-
next
|
|
194
|
-
next
|
|
195
|
-
next
|
|
192
|
+
setOrDelete(next, "tools", removeResourceRefs(next.tools, removal.tools));
|
|
193
|
+
setOrDelete(next, "skills", removeResourceRefs(next.skills, removal.skills));
|
|
194
|
+
setOrDelete(next, "agents", removeResourceRefs(next.agents, removal.agents));
|
|
195
|
+
setOrDelete(next, "commands", removeResourceRefs(next.commands, removal.commands));
|
|
196
196
|
if (removal.instructions)
|
|
197
|
-
next.instructions
|
|
197
|
+
delete next.instructions;
|
|
198
198
|
if (removal.failOnError)
|
|
199
|
-
next.failOnError
|
|
199
|
+
delete next.failOnError;
|
|
200
200
|
for (const key of [
|
|
201
201
|
"files",
|
|
202
202
|
"tools",
|
|
@@ -205,81 +205,91 @@ function removeResources(resources, removal) {
|
|
|
205
205
|
"commands",
|
|
206
206
|
]) {
|
|
207
207
|
if (next[key]?.length === 0)
|
|
208
|
-
next[key]
|
|
208
|
+
delete next[key];
|
|
209
209
|
}
|
|
210
|
-
return Object.
|
|
211
|
-
|
|
212
|
-
|
|
210
|
+
return Object.keys(next).length > 0 ? next : undefined;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Write a resolved optional value, or drop the key when the value is gone.
|
|
214
|
+
*
|
|
215
|
+
* Removal deletes the key instead of blanking it: profile identity is an RFC
|
|
216
|
+
* 8785 digest over own keys, so a key left behind holding `undefined` either
|
|
217
|
+
* changes that digest or is refused by the canonical JSON domain.
|
|
218
|
+
*/
|
|
219
|
+
function setOrDelete(target, key, value) {
|
|
220
|
+
if (value === undefined) {
|
|
221
|
+
delete target[key];
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
target[key] = value;
|
|
213
225
|
}
|
|
214
226
|
function applyRemoval(profile, remove) {
|
|
215
227
|
if (!remove)
|
|
216
228
|
return profile;
|
|
217
229
|
const next = { ...profile };
|
|
218
230
|
if (remove.identity) {
|
|
219
|
-
next.name
|
|
220
|
-
next.description
|
|
221
|
-
next.version
|
|
231
|
+
delete next.name;
|
|
232
|
+
delete next.description;
|
|
233
|
+
delete next.version;
|
|
222
234
|
}
|
|
223
235
|
if (remove.tags !== undefined) {
|
|
224
|
-
next
|
|
236
|
+
setOrDelete(next, "tags", removeValues(asMutable(next.tags), remove.tags));
|
|
225
237
|
}
|
|
226
238
|
if (remove.prompt === true) {
|
|
227
|
-
next.prompt
|
|
239
|
+
delete next.prompt;
|
|
228
240
|
}
|
|
229
241
|
else if (remove.prompt && next.prompt) {
|
|
230
242
|
const prompt = { ...next.prompt };
|
|
231
243
|
if (remove.prompt.systemPrompt)
|
|
232
|
-
prompt.systemPrompt
|
|
244
|
+
delete prompt.systemPrompt;
|
|
233
245
|
if (remove.prompt.appendSystemPrompt)
|
|
234
|
-
prompt.appendSystemPrompt
|
|
235
|
-
prompt
|
|
236
|
-
next
|
|
237
|
-
? prompt
|
|
238
|
-
: undefined;
|
|
246
|
+
delete prompt.appendSystemPrompt;
|
|
247
|
+
setOrDelete(prompt, "instructions", removeValues(prompt.instructions, remove.prompt.instructions));
|
|
248
|
+
setOrDelete(next, "prompt", Object.keys(prompt).length > 0 ? prompt : undefined);
|
|
239
249
|
}
|
|
240
250
|
if (remove.model !== undefined) {
|
|
241
|
-
next
|
|
251
|
+
setOrDelete(next, "model", removeKeys(next.model, remove.model));
|
|
242
252
|
}
|
|
243
253
|
if (remove.harness !== undefined)
|
|
244
|
-
next.harness
|
|
254
|
+
delete next.harness;
|
|
245
255
|
if (remove.permissions !== undefined) {
|
|
246
|
-
next
|
|
256
|
+
setOrDelete(next, "permissions", removeKeys(next.permissions, remove.permissions));
|
|
247
257
|
}
|
|
248
258
|
if (remove.tools !== undefined) {
|
|
249
|
-
next
|
|
259
|
+
setOrDelete(next, "tools", removeKeys(next.tools, remove.tools));
|
|
250
260
|
}
|
|
251
261
|
if (remove.mcp !== undefined) {
|
|
252
|
-
next
|
|
262
|
+
setOrDelete(next, "mcp", removeKeys(next.mcp, remove.mcp));
|
|
253
263
|
}
|
|
254
264
|
if (remove.subagents !== undefined) {
|
|
255
|
-
next
|
|
265
|
+
setOrDelete(next, "subagents", removeKeys(next.subagents, remove.subagents));
|
|
256
266
|
}
|
|
257
267
|
if (remove.resources !== undefined) {
|
|
258
|
-
next
|
|
268
|
+
setOrDelete(next, "resources", removeResources(next.resources, remove.resources));
|
|
259
269
|
}
|
|
260
270
|
if (remove.hooks !== undefined) {
|
|
261
|
-
next
|
|
271
|
+
setOrDelete(next, "hooks", removeKeys(next.hooks, remove.hooks));
|
|
262
272
|
}
|
|
263
273
|
if (remove.modes !== undefined) {
|
|
264
|
-
next
|
|
274
|
+
setOrDelete(next, "modes", removeKeys(next.modes, remove.modes));
|
|
265
275
|
}
|
|
266
276
|
if (remove.confidential)
|
|
267
|
-
next.confidential
|
|
277
|
+
delete next.confidential;
|
|
268
278
|
if (remove.metadata !== undefined) {
|
|
269
|
-
next
|
|
279
|
+
setOrDelete(next, "metadata", removeKeys(next.metadata, remove.metadata));
|
|
270
280
|
}
|
|
271
281
|
if (remove.extensions !== undefined) {
|
|
272
|
-
next
|
|
282
|
+
setOrDelete(next, "extensions", removeKeys(next.extensions, remove.extensions));
|
|
273
283
|
}
|
|
274
284
|
if (next.connections && remove.connections !== undefined) {
|
|
275
285
|
if (remove.connections === true) {
|
|
276
|
-
next.connections
|
|
286
|
+
delete next.connections;
|
|
277
287
|
}
|
|
278
288
|
else {
|
|
279
289
|
const removeSet = new Set(remove.connections);
|
|
280
290
|
const filtered = next.connections.filter((connection) => !removeSet.has(connection.connectionId) &&
|
|
281
291
|
!(connection.alias && removeSet.has(connection.alias)));
|
|
282
|
-
next
|
|
292
|
+
setOrDelete(next, "connections", filtered.length > 0 ? filtered : undefined);
|
|
283
293
|
}
|
|
284
294
|
}
|
|
285
295
|
return next;
|
|
@@ -347,13 +357,12 @@ export function pruneAgentProfileDiff(diff, axesToRemove) {
|
|
|
347
357
|
if (remove)
|
|
348
358
|
delete remove[axis];
|
|
349
359
|
}
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
};
|
|
360
|
+
const pruned = { ...diff };
|
|
361
|
+
setOrDelete(pruned, "set", set && Object.values(set).some((value) => value !== undefined)
|
|
362
|
+
? set
|
|
363
|
+
: undefined);
|
|
364
|
+
setOrDelete(pruned, "remove", remove && Object.values(remove).some((value) => value !== undefined)
|
|
365
|
+
? remove
|
|
366
|
+
: undefined);
|
|
367
|
+
return pruned;
|
|
359
368
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { InteractionAcknowledgement, InteractionResponse, InteractionResponseCommand } from "./interaction.js";
|
|
2
|
+
import type { AgentExecutionInput, AgentExecutionResult } from "./execution-types.js";
|
|
3
|
+
import type { BackendMessage, GetMessagesOptions } from "./backend-message.js";
|
|
4
|
+
import type { SdkHostServices } from "./host-services.js";
|
|
5
|
+
import type { BackendCapabilities, ProviderConfig } from "./provider-config.js";
|
|
6
|
+
import type { BackendArtifact, BackendListOptions, McpConfig, McpStatusResponse } from "./mcp.js";
|
|
7
|
+
import type { StreamEvent } from "./stream-events.js";
|
|
8
|
+
export interface SdkProviderAdapter {
|
|
9
|
+
readonly provider: string;
|
|
10
|
+
getCapabilities(): BackendCapabilities;
|
|
11
|
+
initialize(config: ProviderConfig): Promise<void>;
|
|
12
|
+
createSession?(options?: {
|
|
13
|
+
workspaceRoot?: string;
|
|
14
|
+
}): Promise<string>;
|
|
15
|
+
forkSession?(options: {
|
|
16
|
+
sessionId: string;
|
|
17
|
+
messageId?: string;
|
|
18
|
+
workspaceRoot?: string;
|
|
19
|
+
}): Promise<string>;
|
|
20
|
+
execute(input: AgentExecutionInput, services: SdkHostServices, onEvent?: (event: StreamEvent) => void): Promise<AgentExecutionResult>;
|
|
21
|
+
shutdown(): Promise<void>;
|
|
22
|
+
healthCheck(): Promise<boolean>;
|
|
23
|
+
getMessages?(options: GetMessagesOptions): Promise<BackendMessage[]>;
|
|
24
|
+
addMcp?(name: string, config: McpConfig): Promise<void>;
|
|
25
|
+
getMcpStatus?(): Promise<McpStatusResponse>;
|
|
26
|
+
ensureMcps?(required: Record<string, McpConfig>): Promise<void>;
|
|
27
|
+
updateConfig?(config: unknown): Promise<unknown>;
|
|
28
|
+
getAccount?(): Promise<unknown>;
|
|
29
|
+
listModels?(): Promise<unknown>;
|
|
30
|
+
listRepositories?(): Promise<unknown>;
|
|
31
|
+
listAgents?(options?: BackendListOptions): Promise<unknown>;
|
|
32
|
+
getAgent?(agentId: string): Promise<unknown>;
|
|
33
|
+
archiveAgent?(agentId: string): Promise<void>;
|
|
34
|
+
unarchiveAgent?(agentId: string): Promise<void>;
|
|
35
|
+
deleteAgent?(agentId: string): Promise<void>;
|
|
36
|
+
listRuns?(agentId: string, options?: BackendListOptions): Promise<unknown>;
|
|
37
|
+
getRun?(runId: string, agentId?: string): Promise<unknown>;
|
|
38
|
+
listAgentMessages?(agentId: string, options?: BackendListOptions): Promise<unknown>;
|
|
39
|
+
listArtifacts?(sessionId: string): Promise<BackendArtifact[]>;
|
|
40
|
+
downloadArtifact?(sessionId: string, path: string): Promise<Uint8Array>;
|
|
41
|
+
respondToInteraction?(response: InteractionResponse): Promise<void>;
|
|
42
|
+
respondToInteractionCommand?(command: InteractionResponseCommand, options?: {
|
|
43
|
+
signal?: AbortSignal;
|
|
44
|
+
}): Promise<InteractionAcknowledgement>;
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export type BackendCapabilities = {
|
|
2
|
+
streaming: boolean;
|
|
3
|
+
toolUse: boolean;
|
|
4
|
+
reasoning: boolean;
|
|
5
|
+
multimodal: boolean;
|
|
6
|
+
contextWindow: number;
|
|
7
|
+
interactions?: string[];
|
|
8
|
+
};
|
|
9
|
+
export type ProviderCapabilities = {
|
|
10
|
+
supportsVision: boolean;
|
|
11
|
+
supportsLogprobs: boolean;
|
|
12
|
+
supportsToolCalls: boolean;
|
|
13
|
+
supportsComputerUse: boolean;
|
|
14
|
+
};
|
|
15
|
+
export type CliAuthFile = {
|
|
16
|
+
path: string;
|
|
17
|
+
content: string;
|
|
18
|
+
mode?: number;
|
|
19
|
+
};
|
|
20
|
+
export type ProviderConfig = {
|
|
21
|
+
model: {
|
|
22
|
+
provider?: string;
|
|
23
|
+
model?: string;
|
|
24
|
+
apiKey?: string;
|
|
25
|
+
baseUrl?: string;
|
|
26
|
+
maxThinkingTokens?: number;
|
|
27
|
+
mode?: "api" | "cli";
|
|
28
|
+
authMode?: "api-key" | "oauth";
|
|
29
|
+
authFiles?: CliAuthFile[];
|
|
30
|
+
};
|
|
31
|
+
server?: {
|
|
32
|
+
port?: number;
|
|
33
|
+
hostname?: string;
|
|
34
|
+
};
|
|
35
|
+
workspace?: {
|
|
36
|
+
rootPath: string;
|
|
37
|
+
};
|
|
38
|
+
metadata?: Record<string, unknown>;
|
|
39
|
+
profile?: Record<string, unknown>;
|
|
40
|
+
};
|
|
41
|
+
export type ModelGatewayDefaults = {
|
|
42
|
+
provider: string;
|
|
43
|
+
name: string;
|
|
44
|
+
rootUrl: string;
|
|
45
|
+
baseUrl: string;
|
|
46
|
+
model: string;
|
|
47
|
+
apiKeyEnvVar: string;
|
|
48
|
+
};
|
|
49
|
+
export declare const TANGLE_ROUTER_DEFAULT_ROOT_URL = "https://router.tangle.tools";
|
|
50
|
+
export declare const TANGLE_ROUTER_DEFAULT_MODEL = "zai/glm-4.7";
|
|
51
|
+
export declare function normalizeOpenAiCompatibleBaseUrl(baseUrl: string): string;
|
|
52
|
+
export declare function resolveTangleRouterDefaults(env?: Record<string, string | undefined>): ModelGatewayDefaults;
|
|
53
|
+
export declare function withModelGatewayDefaults<T extends ProviderConfig["model"]>(model: T, defaults?: ModelGatewayDefaults): T;
|
|
54
|
+
export type NativeWebToolPosture = {
|
|
55
|
+
search?: boolean;
|
|
56
|
+
fetch?: boolean;
|
|
57
|
+
};
|
|
58
|
+
export declare function resolveNativeWebTools(tools: Record<string, boolean> | undefined): NativeWebToolPosture;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export const TANGLE_ROUTER_DEFAULT_ROOT_URL = "https://router.tangle.tools";
|
|
2
|
+
export const TANGLE_ROUTER_DEFAULT_MODEL = "zai/glm-4.7";
|
|
3
|
+
export function normalizeOpenAiCompatibleBaseUrl(baseUrl) {
|
|
4
|
+
const trimmed = baseUrl.replace(/\/+$/, "");
|
|
5
|
+
return /\/v\d+$/.test(trimmed) ? trimmed : `${trimmed}/v1`;
|
|
6
|
+
}
|
|
7
|
+
export function resolveTangleRouterDefaults(env = process.env) {
|
|
8
|
+
const rootUrl = env.TANGLE_ROUTER_URL || TANGLE_ROUTER_DEFAULT_ROOT_URL;
|
|
9
|
+
return {
|
|
10
|
+
provider: "openai-compat",
|
|
11
|
+
name: env.TANGLE_ROUTER_PROVIDER_NAME || "Tangle Router",
|
|
12
|
+
rootUrl,
|
|
13
|
+
baseUrl: normalizeOpenAiCompatibleBaseUrl(env.TANGLE_ROUTER_BASE_URL || rootUrl),
|
|
14
|
+
model: env.TANGLE_ROUTER_MODEL || TANGLE_ROUTER_DEFAULT_MODEL,
|
|
15
|
+
apiKeyEnvVar: env.TANGLE_ROUTER_API_KEY_ENV || "OPENCODE_MODEL_API_KEY",
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export function withModelGatewayDefaults(model, defaults = resolveTangleRouterDefaults()) {
|
|
19
|
+
return {
|
|
20
|
+
...model,
|
|
21
|
+
provider: model.provider || defaults.provider,
|
|
22
|
+
model: model.model || defaults.model,
|
|
23
|
+
baseUrl: model.baseUrl || defaults.baseUrl,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
const nativeWebSearchKeys = new Set(["websearch"]);
|
|
27
|
+
const nativeWebFetchKeys = new Set(["webfetch", "fetch"]);
|
|
28
|
+
export function resolveNativeWebTools(tools) {
|
|
29
|
+
if (!tools)
|
|
30
|
+
return {};
|
|
31
|
+
const posture = {};
|
|
32
|
+
for (const [key, value] of Object.entries(tools)) {
|
|
33
|
+
if (typeof value !== "boolean")
|
|
34
|
+
continue;
|
|
35
|
+
const normalized = key.replace(/[^a-z0-9]/gi, "").toLowerCase();
|
|
36
|
+
if (nativeWebSearchKeys.has(normalized))
|
|
37
|
+
posture.search = value;
|
|
38
|
+
else if (nativeWebFetchKeys.has(normalized))
|
|
39
|
+
posture.fetch = value;
|
|
40
|
+
}
|
|
41
|
+
return posture;
|
|
42
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import type { StreamEvent } from "./
|
|
2
|
+
import type { StreamEvent } from "./stream-events.js";
|
|
3
3
|
import type { Sha256Digest } from "./agent-candidate.js";
|
|
4
4
|
/** Provider-neutral coordinates sufficient to recreate control of one run. */
|
|
5
5
|
export interface AgentRunControlRef {
|
|
@@ -19,10 +19,24 @@ export declare const AgentRunControlRefSchema: z.ZodObject<{
|
|
|
19
19
|
executionId: z.ZodOptional<z.ZodString>;
|
|
20
20
|
requestDigest: z.ZodOptional<z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>>;
|
|
21
21
|
}, z.core.$strict>;
|
|
22
|
+
/** Coordinates that are complete enough for a retryable state-changing action. */
|
|
23
|
+
export interface AgentExactRunControlRef extends AgentRunControlRef {
|
|
24
|
+
sessionId: string;
|
|
25
|
+
executionId: string;
|
|
26
|
+
requestDigest: Sha256Digest;
|
|
27
|
+
}
|
|
28
|
+
export declare const AgentExactRunControlRefSchema: z.ZodObject<{
|
|
29
|
+
runId: z.ZodString;
|
|
30
|
+
provider: z.ZodString;
|
|
31
|
+
environmentId: z.ZodString;
|
|
32
|
+
sessionId: z.ZodString;
|
|
33
|
+
executionId: z.ZodString;
|
|
34
|
+
requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
35
|
+
}, z.core.$strict>;
|
|
22
36
|
export type AgentRunCancellationEffect = "cancel_requested" | "cancelled" | "not_live" | "unknown";
|
|
23
37
|
export interface AgentRunCancellationRequestMaterial {
|
|
24
38
|
operationId: string;
|
|
25
|
-
run:
|
|
39
|
+
run: AgentExactRunControlRef;
|
|
26
40
|
reason?: string;
|
|
27
41
|
}
|
|
28
42
|
export interface AgentRunCancellationRequest extends AgentRunCancellationRequestMaterial {
|
|
@@ -30,26 +44,27 @@ export interface AgentRunCancellationRequest extends AgentRunCancellationRequest
|
|
|
30
44
|
}
|
|
31
45
|
export declare function agentRunCancellationRequestDigest(request: AgentRunCancellationRequestMaterial): Sha256Digest;
|
|
32
46
|
export declare const AgentRunCancellationRequestSchema: z.ZodObject<{
|
|
33
|
-
operationId: z.ZodString;
|
|
34
47
|
requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
48
|
+
operationId: z.ZodString;
|
|
35
49
|
run: z.ZodObject<{
|
|
36
50
|
runId: z.ZodString;
|
|
37
51
|
provider: z.ZodString;
|
|
38
52
|
environmentId: z.ZodString;
|
|
39
|
-
sessionId: z.
|
|
40
|
-
executionId: z.
|
|
41
|
-
requestDigest: z.
|
|
53
|
+
sessionId: z.ZodString;
|
|
54
|
+
executionId: z.ZodString;
|
|
55
|
+
requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
42
56
|
}, z.core.$strict>;
|
|
43
57
|
reason: z.ZodOptional<z.ZodString>;
|
|
44
58
|
}, z.core.$strict>;
|
|
45
59
|
export interface AgentRunCancellationAcknowledgement {
|
|
46
60
|
operationId: string;
|
|
47
61
|
requestDigest: Sha256Digest;
|
|
48
|
-
run:
|
|
62
|
+
run: AgentExactRunControlRef;
|
|
49
63
|
status: "accepted" | "replayed" | "conflict" | "unknown";
|
|
50
64
|
effect: AgentRunCancellationEffect;
|
|
51
65
|
message?: string;
|
|
52
66
|
retryable?: boolean;
|
|
67
|
+
existingRequestDigest?: Sha256Digest;
|
|
53
68
|
}
|
|
54
69
|
export declare const AgentRunCancellationAcknowledgementSchema: z.ZodObject<{
|
|
55
70
|
operationId: z.ZodString;
|
|
@@ -58,9 +73,9 @@ export declare const AgentRunCancellationAcknowledgementSchema: z.ZodObject<{
|
|
|
58
73
|
runId: z.ZodString;
|
|
59
74
|
provider: z.ZodString;
|
|
60
75
|
environmentId: z.ZodString;
|
|
61
|
-
sessionId: z.
|
|
62
|
-
executionId: z.
|
|
63
|
-
requestDigest: z.
|
|
76
|
+
sessionId: z.ZodString;
|
|
77
|
+
executionId: z.ZodString;
|
|
78
|
+
requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
64
79
|
}, z.core.$strict>;
|
|
65
80
|
status: z.ZodEnum<{
|
|
66
81
|
unknown: "unknown";
|
|
@@ -76,8 +91,70 @@ export declare const AgentRunCancellationAcknowledgementSchema: z.ZodObject<{
|
|
|
76
91
|
}>;
|
|
77
92
|
message: z.ZodOptional<z.ZodString>;
|
|
78
93
|
retryable: z.ZodOptional<z.ZodBoolean>;
|
|
94
|
+
existingRequestDigest: z.ZodOptional<z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>>;
|
|
79
95
|
}, z.core.$strict>;
|
|
80
96
|
export declare function agentRunCancellationAcknowledgementMatchesRequest(request: AgentRunCancellationRequest, acknowledgement: AgentRunCancellationAcknowledgement): boolean;
|
|
97
|
+
export type AgentRunControlAction = "steer" | "cancel" | "status" | "reconnect";
|
|
98
|
+
export interface AgentRunControlRequestMaterial {
|
|
99
|
+
operationId: string;
|
|
100
|
+
action: AgentRunControlAction;
|
|
101
|
+
run: AgentExactRunControlRef;
|
|
102
|
+
payload?: Record<string, unknown>;
|
|
103
|
+
}
|
|
104
|
+
export interface AgentRunControlRequest extends AgentRunControlRequestMaterial {
|
|
105
|
+
requestDigest: Sha256Digest;
|
|
106
|
+
}
|
|
107
|
+
export declare function agentRunControlRequestDigest(request: AgentRunControlRequestMaterial): Sha256Digest;
|
|
108
|
+
export declare const AgentRunControlRequestSchema: z.ZodObject<{
|
|
109
|
+
requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
110
|
+
operationId: z.ZodString;
|
|
111
|
+
action: z.ZodEnum<{
|
|
112
|
+
status: "status";
|
|
113
|
+
steer: "steer";
|
|
114
|
+
cancel: "cancel";
|
|
115
|
+
reconnect: "reconnect";
|
|
116
|
+
}>;
|
|
117
|
+
run: z.ZodObject<{
|
|
118
|
+
runId: z.ZodString;
|
|
119
|
+
provider: z.ZodString;
|
|
120
|
+
environmentId: z.ZodString;
|
|
121
|
+
sessionId: z.ZodString;
|
|
122
|
+
executionId: z.ZodString;
|
|
123
|
+
requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
124
|
+
}, z.core.$strict>;
|
|
125
|
+
payload: z.ZodOptional<z.ZodCustom<Record<string, unknown>, Record<string, unknown>>>;
|
|
126
|
+
}, z.core.$strict>;
|
|
127
|
+
export interface AgentRunControlAcknowledgement {
|
|
128
|
+
operationId: string;
|
|
129
|
+
requestDigest: Sha256Digest;
|
|
130
|
+
run: AgentExactRunControlRef;
|
|
131
|
+
status: "accepted" | "replayed" | "conflict" | "unknown";
|
|
132
|
+
message?: string;
|
|
133
|
+
retryable?: boolean;
|
|
134
|
+
existingRequestDigest?: Sha256Digest;
|
|
135
|
+
}
|
|
136
|
+
export declare const AgentRunControlAcknowledgementSchema: z.ZodObject<{
|
|
137
|
+
operationId: z.ZodString;
|
|
138
|
+
requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
139
|
+
run: z.ZodObject<{
|
|
140
|
+
runId: z.ZodString;
|
|
141
|
+
provider: z.ZodString;
|
|
142
|
+
environmentId: z.ZodString;
|
|
143
|
+
sessionId: z.ZodString;
|
|
144
|
+
executionId: z.ZodString;
|
|
145
|
+
requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
146
|
+
}, z.core.$strict>;
|
|
147
|
+
status: z.ZodEnum<{
|
|
148
|
+
unknown: "unknown";
|
|
149
|
+
conflict: "conflict";
|
|
150
|
+
accepted: "accepted";
|
|
151
|
+
replayed: "replayed";
|
|
152
|
+
}>;
|
|
153
|
+
message: z.ZodOptional<z.ZodString>;
|
|
154
|
+
retryable: z.ZodOptional<z.ZodBoolean>;
|
|
155
|
+
existingRequestDigest: z.ZodOptional<z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>>;
|
|
156
|
+
}, z.core.$strict>;
|
|
157
|
+
export declare function agentRunControlAcknowledgementMatchesRequest(request: AgentRunControlRequest, acknowledgement: AgentRunControlAcknowledgement): boolean;
|
|
81
158
|
/** Runtime validator for every member of the existing canonical event union. */
|
|
82
159
|
export declare const CanonicalStreamEventSchema: z.ZodType<StreamEvent>;
|
|
83
160
|
/** Ordered, replayable envelope around the existing canonical event union. */
|