@tangle-network/agent-interface 0.40.0 → 0.42.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 +40 -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 +392 -1
- package/dist/environment-provider.js +214 -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 +752 -0
- package/dist/portable-context.js +754 -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/harness.d.ts
CHANGED
|
@@ -14,8 +14,10 @@ import { z } from "zod";
|
|
|
14
14
|
* a one-shot) with no full coding-agent harness. The rest are full agentic harnesses run in a
|
|
15
15
|
* sandbox or locally via the CLI bridge.
|
|
16
16
|
*
|
|
17
|
+
* `forge` (tailcallhq/forgecode) and `cursor` (cursor-agent) are multi-provider CLI harnesses with
|
|
18
|
+
* no vendor lock, so they carry no entry in the capability tables and resolve as router-backed.
|
|
17
19
|
*/
|
|
18
|
-
export type HarnessType = "claude-code" | "nanoclaw" | "codex" | "opencode" | "kimi-code" | "pi" | "gemini" | "hermes" | "openclaw" | "amp" | "factory-droids" | "acp" | "cli-base";
|
|
20
|
+
export type HarnessType = "claude-code" | "nanoclaw" | "codex" | "opencode" | "kimi-code" | "pi" | "gemini" | "hermes" | "openclaw" | "amp" | "factory-droids" | "forge" | "cursor" | "acp" | "cli-base";
|
|
19
21
|
/** Runtime validator for {@link HarnessType}. Kept in lockstep with the type by the drift guard below. */
|
|
20
22
|
export declare const harnessTypeSchema: z.ZodEnum<{
|
|
21
23
|
"claude-code": "claude-code";
|
|
@@ -29,6 +31,8 @@ export declare const harnessTypeSchema: z.ZodEnum<{
|
|
|
29
31
|
openclaw: "openclaw";
|
|
30
32
|
amp: "amp";
|
|
31
33
|
"factory-droids": "factory-droids";
|
|
34
|
+
forge: "forge";
|
|
35
|
+
cursor: "cursor";
|
|
32
36
|
acp: "acp";
|
|
33
37
|
"cli-base": "cli-base";
|
|
34
38
|
}>;
|
package/dist/harness.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -4,10 +4,14 @@
|
|
|
4
4
|
* Shared types and interfaces for SDK provider adapters.
|
|
5
5
|
* This package defines the contract between the sidecar and provider implementations.
|
|
6
6
|
*/
|
|
7
|
-
import type { InteractionRequest, InteractionResponse } from "./interaction.js";
|
|
7
|
+
import type { InteractionAcknowledgement, InteractionRequest, InteractionResponse, InteractionResponseCommand } from "./interaction.js";
|
|
8
8
|
import type { AgentExecutionOutcome, DurablePlan, PlanContinuation, SdkPlanHost } from "./plan.js";
|
|
9
9
|
export type * from "./environment-provider.js";
|
|
10
|
+
export { AgentEnvironmentCapabilitiesSchema, AgentNativeContextContinuationResultSchema, AgentTurnResultSchema, agentNativeContextContinuationResultMatchesRequest, } from "./environment-provider.js";
|
|
10
11
|
export * from "./plan.js";
|
|
12
|
+
export * from "./runtime-control.js";
|
|
13
|
+
export * from "./portable-context.js";
|
|
14
|
+
export * from "./workspace-branching.js";
|
|
11
15
|
export type BackendCapabilities = {
|
|
12
16
|
streaming: boolean;
|
|
13
17
|
toolUse: boolean;
|
|
@@ -605,10 +609,16 @@ export interface SdkProviderAdapter {
|
|
|
605
609
|
downloadArtifact?(sessionId: string, path: string): Promise<Uint8Array>;
|
|
606
610
|
/**
|
|
607
611
|
* Respond to an outstanding interaction (question, permission, …). The
|
|
608
|
-
*
|
|
609
|
-
*
|
|
612
|
+
* original best-effort inbound channel. Kept source-compatible for existing
|
|
613
|
+
* adapters; durable callers should use `respondToInteractionCommand`.
|
|
610
614
|
*/
|
|
611
615
|
respondToInteraction?(response: InteractionResponse): Promise<void>;
|
|
616
|
+
/**
|
|
617
|
+
* Retry-safe interaction response bound to an exact run and caller operation.
|
|
618
|
+
*/
|
|
619
|
+
respondToInteractionCommand?(command: InteractionResponseCommand, options?: {
|
|
620
|
+
signal?: AbortSignal;
|
|
621
|
+
}): Promise<InteractionAcknowledgement>;
|
|
612
622
|
}
|
|
613
623
|
export * from "./interaction.js";
|
|
614
624
|
export * from "./agent-candidate.js";
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
* Shared types and interfaces for SDK provider adapters.
|
|
5
5
|
* This package defines the contract between the sidecar and provider implementations.
|
|
6
6
|
*/
|
|
7
|
+
export { AgentEnvironmentCapabilitiesSchema, AgentNativeContextContinuationResultSchema, AgentTurnResultSchema, agentNativeContextContinuationResultMatchesRequest, } from "./environment-provider.js";
|
|
7
8
|
export * from "./plan.js";
|
|
9
|
+
export * from "./runtime-control.js";
|
|
10
|
+
export * from "./portable-context.js";
|
|
11
|
+
export * from "./workspace-branching.js";
|
|
8
12
|
/** Helper to check part type */
|
|
9
13
|
export function isTextPart(part) {
|
|
10
14
|
return part.type === "text";
|
package/dist/interaction.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export declare const InteractionFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
|
|
|
27
27
|
name: z.ZodString;
|
|
28
28
|
label: z.ZodString;
|
|
29
29
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
30
|
-
}, z.core.$
|
|
30
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
31
31
|
type: z.ZodLiteral<"number">;
|
|
32
32
|
min: z.ZodOptional<z.ZodNumber>;
|
|
33
33
|
max: z.ZodOptional<z.ZodNumber>;
|
|
@@ -35,32 +35,32 @@ export declare const InteractionFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
|
|
|
35
35
|
name: z.ZodString;
|
|
36
36
|
label: z.ZodString;
|
|
37
37
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
-
}, z.core.$
|
|
38
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
39
39
|
type: z.ZodLiteral<"boolean">;
|
|
40
40
|
default: z.ZodOptional<z.ZodBoolean>;
|
|
41
41
|
name: z.ZodString;
|
|
42
42
|
label: z.ZodString;
|
|
43
43
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
44
|
-
}, z.core.$
|
|
44
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
45
45
|
type: z.ZodLiteral<"select">;
|
|
46
46
|
options: z.ZodArray<z.ZodObject<{
|
|
47
47
|
value: z.ZodString;
|
|
48
48
|
label: z.ZodString;
|
|
49
49
|
description: z.ZodOptional<z.ZodString>;
|
|
50
|
-
}, z.core.$
|
|
50
|
+
}, z.core.$strict>>;
|
|
51
51
|
multi: z.ZodOptional<z.ZodBoolean>;
|
|
52
52
|
allowCustom: z.ZodOptional<z.ZodBoolean>;
|
|
53
53
|
default: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
54
54
|
name: z.ZodString;
|
|
55
55
|
label: z.ZodString;
|
|
56
56
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
57
|
-
}, z.core.$
|
|
57
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
58
58
|
type: z.ZodLiteral<"secret">;
|
|
59
59
|
placeholder: z.ZodOptional<z.ZodString>;
|
|
60
60
|
name: z.ZodString;
|
|
61
61
|
label: z.ZodString;
|
|
62
62
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
63
|
-
}, z.core.$
|
|
63
|
+
}, z.core.$strict>], "type">;
|
|
64
64
|
export type InteractionField = z.infer<typeof InteractionFieldSchema>;
|
|
65
65
|
export declare const InteractionAnswerSpecSchema: z.ZodObject<{
|
|
66
66
|
fields: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -71,7 +71,7 @@ export declare const InteractionAnswerSpecSchema: z.ZodObject<{
|
|
|
71
71
|
name: z.ZodString;
|
|
72
72
|
label: z.ZodString;
|
|
73
73
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
74
|
-
}, z.core.$
|
|
74
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
75
75
|
type: z.ZodLiteral<"number">;
|
|
76
76
|
min: z.ZodOptional<z.ZodNumber>;
|
|
77
77
|
max: z.ZodOptional<z.ZodNumber>;
|
|
@@ -79,49 +79,85 @@ export declare const InteractionAnswerSpecSchema: z.ZodObject<{
|
|
|
79
79
|
name: z.ZodString;
|
|
80
80
|
label: z.ZodString;
|
|
81
81
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
82
|
-
}, z.core.$
|
|
82
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
83
83
|
type: z.ZodLiteral<"boolean">;
|
|
84
84
|
default: z.ZodOptional<z.ZodBoolean>;
|
|
85
85
|
name: z.ZodString;
|
|
86
86
|
label: z.ZodString;
|
|
87
87
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
88
|
-
}, z.core.$
|
|
88
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
89
89
|
type: z.ZodLiteral<"select">;
|
|
90
90
|
options: z.ZodArray<z.ZodObject<{
|
|
91
91
|
value: z.ZodString;
|
|
92
92
|
label: z.ZodString;
|
|
93
93
|
description: z.ZodOptional<z.ZodString>;
|
|
94
|
-
}, z.core.$
|
|
94
|
+
}, z.core.$strict>>;
|
|
95
95
|
multi: z.ZodOptional<z.ZodBoolean>;
|
|
96
96
|
allowCustom: z.ZodOptional<z.ZodBoolean>;
|
|
97
97
|
default: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
98
98
|
name: z.ZodString;
|
|
99
99
|
label: z.ZodString;
|
|
100
100
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
101
|
-
}, z.core.$
|
|
101
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
102
102
|
type: z.ZodLiteral<"secret">;
|
|
103
103
|
placeholder: z.ZodOptional<z.ZodString>;
|
|
104
104
|
name: z.ZodString;
|
|
105
105
|
label: z.ZodString;
|
|
106
106
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
107
|
-
}, z.core.$
|
|
108
|
-
}, z.core.$
|
|
107
|
+
}, z.core.$strict>], "type">>;
|
|
108
|
+
}, z.core.$strict>;
|
|
109
109
|
export type InteractionAnswerSpec = z.infer<typeof InteractionAnswerSpecSchema>;
|
|
110
|
+
export declare const InteractionFieldTypeSchema: z.ZodEnum<{
|
|
111
|
+
number: "number";
|
|
112
|
+
boolean: "boolean";
|
|
113
|
+
text: "text";
|
|
114
|
+
select: "select";
|
|
115
|
+
secret: "secret";
|
|
116
|
+
}>;
|
|
117
|
+
export type InteractionFieldType = z.infer<typeof InteractionFieldTypeSchema>;
|
|
118
|
+
/** Scope at which an accepted answer may be reused by an explicit policy. */
|
|
119
|
+
export declare const InteractionResponseScopeSchema: z.ZodEnum<{
|
|
120
|
+
interaction: "interaction";
|
|
121
|
+
session: "session";
|
|
122
|
+
persistent: "persistent";
|
|
123
|
+
}>;
|
|
124
|
+
export type InteractionResponseScope = z.infer<typeof InteractionResponseScopeSchema>;
|
|
125
|
+
/** Negotiated interaction behavior. Absence means interactions are unsupported. */
|
|
126
|
+
export declare const InteractionCapabilitiesSchema: z.ZodObject<{
|
|
127
|
+
kinds: z.ZodArray<z.ZodString>;
|
|
128
|
+
answerFieldTypes: z.ZodArray<z.ZodEnum<{
|
|
129
|
+
number: "number";
|
|
130
|
+
boolean: "boolean";
|
|
131
|
+
text: "text";
|
|
132
|
+
select: "select";
|
|
133
|
+
secret: "secret";
|
|
134
|
+
}>>;
|
|
135
|
+
responseScopes: z.ZodArray<z.ZodEnum<{
|
|
136
|
+
interaction: "interaction";
|
|
137
|
+
session: "session";
|
|
138
|
+
persistent: "persistent";
|
|
139
|
+
}>>;
|
|
140
|
+
secretAnswers: z.ZodBoolean;
|
|
141
|
+
concurrentRequests: z.ZodBoolean;
|
|
142
|
+
replay: z.ZodBoolean;
|
|
143
|
+
responseIdempotency: z.ZodBoolean;
|
|
144
|
+
}, z.core.$strict>;
|
|
145
|
+
export type InteractionCapabilities = z.infer<typeof InteractionCapabilitiesSchema>;
|
|
110
146
|
export declare const InteractionSubjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
111
147
|
type: z.ZodLiteral<"tool">;
|
|
112
148
|
toolName: z.ZodString;
|
|
113
149
|
input: z.ZodOptional<z.ZodUnknown>;
|
|
114
|
-
}, z.core.$
|
|
150
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
115
151
|
type: z.ZodLiteral<"command">;
|
|
116
152
|
command: z.ZodString;
|
|
117
|
-
}, z.core.$
|
|
153
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
118
154
|
type: z.ZodLiteral<"file">;
|
|
119
155
|
path: z.ZodString;
|
|
120
156
|
preview: z.ZodOptional<z.ZodString>;
|
|
121
|
-
}, z.core.$
|
|
157
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
122
158
|
type: z.ZodLiteral<"resource">;
|
|
123
159
|
uri: z.ZodString;
|
|
124
|
-
}, z.core.$
|
|
160
|
+
}, z.core.$strict>], "type">;
|
|
125
161
|
export type InteractionSubject = z.infer<typeof InteractionSubjectSchema>;
|
|
126
162
|
export declare const InteractionOutcomeSchema: z.ZodEnum<{
|
|
127
163
|
cancelled: "cancelled";
|
|
@@ -132,14 +168,16 @@ export type InteractionOutcome = z.infer<typeof InteractionOutcomeSchema>;
|
|
|
132
168
|
/** Field values keyed by `InteractionField.name`. Validated against `answerSpec`. */
|
|
133
169
|
export declare const InteractionDataSchema: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>;
|
|
134
170
|
export type InteractionData = z.infer<typeof InteractionDataSchema>;
|
|
135
|
-
export declare const InteractionResolutionSchema: z.ZodObject<{
|
|
136
|
-
outcome: z.
|
|
137
|
-
cancelled: "cancelled";
|
|
138
|
-
accepted: "accepted";
|
|
139
|
-
declined: "declined";
|
|
140
|
-
}>;
|
|
171
|
+
export declare const InteractionResolutionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
172
|
+
outcome: z.ZodLiteral<"accepted">;
|
|
141
173
|
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>>;
|
|
142
|
-
}, z.core.$
|
|
174
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
175
|
+
outcome: z.ZodLiteral<"declined">;
|
|
176
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>>;
|
|
177
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
178
|
+
outcome: z.ZodLiteral<"cancelled">;
|
|
179
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>>;
|
|
180
|
+
}, z.core.$strict>], "outcome">;
|
|
143
181
|
export type InteractionResolution = z.infer<typeof InteractionResolutionSchema>;
|
|
144
182
|
export declare const InteractionRequestSchema: z.ZodObject<{
|
|
145
183
|
id: z.ZodString;
|
|
@@ -150,17 +188,17 @@ export declare const InteractionRequestSchema: z.ZodObject<{
|
|
|
150
188
|
type: z.ZodLiteral<"tool">;
|
|
151
189
|
toolName: z.ZodString;
|
|
152
190
|
input: z.ZodOptional<z.ZodUnknown>;
|
|
153
|
-
}, z.core.$
|
|
191
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
154
192
|
type: z.ZodLiteral<"command">;
|
|
155
193
|
command: z.ZodString;
|
|
156
|
-
}, z.core.$
|
|
194
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
157
195
|
type: z.ZodLiteral<"file">;
|
|
158
196
|
path: z.ZodString;
|
|
159
197
|
preview: z.ZodOptional<z.ZodString>;
|
|
160
|
-
}, z.core.$
|
|
198
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
161
199
|
type: z.ZodLiteral<"resource">;
|
|
162
200
|
uri: z.ZodString;
|
|
163
|
-
}, z.core.$
|
|
201
|
+
}, z.core.$strict>], "type">>;
|
|
164
202
|
answerSpec: z.ZodObject<{
|
|
165
203
|
fields: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
166
204
|
type: z.ZodLiteral<"text">;
|
|
@@ -170,7 +208,7 @@ export declare const InteractionRequestSchema: z.ZodObject<{
|
|
|
170
208
|
name: z.ZodString;
|
|
171
209
|
label: z.ZodString;
|
|
172
210
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
173
|
-
}, z.core.$
|
|
211
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
174
212
|
type: z.ZodLiteral<"number">;
|
|
175
213
|
min: z.ZodOptional<z.ZodNumber>;
|
|
176
214
|
max: z.ZodOptional<z.ZodNumber>;
|
|
@@ -178,59 +216,140 @@ export declare const InteractionRequestSchema: z.ZodObject<{
|
|
|
178
216
|
name: z.ZodString;
|
|
179
217
|
label: z.ZodString;
|
|
180
218
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
181
|
-
}, z.core.$
|
|
219
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
182
220
|
type: z.ZodLiteral<"boolean">;
|
|
183
221
|
default: z.ZodOptional<z.ZodBoolean>;
|
|
184
222
|
name: z.ZodString;
|
|
185
223
|
label: z.ZodString;
|
|
186
224
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
187
|
-
}, z.core.$
|
|
225
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
188
226
|
type: z.ZodLiteral<"select">;
|
|
189
227
|
options: z.ZodArray<z.ZodObject<{
|
|
190
228
|
value: z.ZodString;
|
|
191
229
|
label: z.ZodString;
|
|
192
230
|
description: z.ZodOptional<z.ZodString>;
|
|
193
|
-
}, z.core.$
|
|
231
|
+
}, z.core.$strict>>;
|
|
194
232
|
multi: z.ZodOptional<z.ZodBoolean>;
|
|
195
233
|
allowCustom: z.ZodOptional<z.ZodBoolean>;
|
|
196
234
|
default: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
197
235
|
name: z.ZodString;
|
|
198
236
|
label: z.ZodString;
|
|
199
237
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
200
|
-
}, z.core.$
|
|
238
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
201
239
|
type: z.ZodLiteral<"secret">;
|
|
202
240
|
placeholder: z.ZodOptional<z.ZodString>;
|
|
203
241
|
name: z.ZodString;
|
|
204
242
|
label: z.ZodString;
|
|
205
243
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
206
|
-
}, z.core.$
|
|
207
|
-
}, z.core.$
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
244
|
+
}, z.core.$strict>], "type">>;
|
|
245
|
+
}, z.core.$strict>;
|
|
246
|
+
responseScopes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
247
|
+
interaction: "interaction";
|
|
248
|
+
session: "session";
|
|
249
|
+
persistent: "persistent";
|
|
250
|
+
}>>>;
|
|
251
|
+
default: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
252
|
+
outcome: z.ZodLiteral<"accepted">;
|
|
253
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>>;
|
|
254
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
255
|
+
outcome: z.ZodLiteral<"declined">;
|
|
256
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>>;
|
|
257
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
258
|
+
outcome: z.ZodLiteral<"cancelled">;
|
|
214
259
|
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>>;
|
|
215
|
-
}, z.core.$
|
|
260
|
+
}, z.core.$strict>], "outcome">>;
|
|
216
261
|
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
217
262
|
onTimeout: z.ZodOptional<z.ZodEnum<{
|
|
218
263
|
default: "default";
|
|
219
264
|
fail: "fail";
|
|
220
265
|
wait: "wait";
|
|
221
266
|
}>>;
|
|
222
|
-
}, z.core.$
|
|
267
|
+
}, z.core.$strict>;
|
|
223
268
|
export type InteractionRequest = z.infer<typeof InteractionRequestSchema>;
|
|
224
|
-
export declare const InteractionResponseSchema: z.ZodObject<{
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
269
|
+
export declare const InteractionResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
270
|
+
id: z.ZodString;
|
|
271
|
+
outcome: z.ZodLiteral<"accepted">;
|
|
272
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>>;
|
|
273
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
274
|
+
id: z.ZodString;
|
|
275
|
+
outcome: z.ZodLiteral<"declined">;
|
|
230
276
|
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>>;
|
|
277
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
231
278
|
id: z.ZodString;
|
|
232
|
-
|
|
279
|
+
outcome: z.ZodLiteral<"cancelled">;
|
|
280
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>>;
|
|
281
|
+
}, z.core.$strict>], "outcome">;
|
|
233
282
|
export type InteractionResponse = z.infer<typeof InteractionResponseSchema>;
|
|
283
|
+
/** A request is unique only within this run and optional provider session. */
|
|
284
|
+
export declare const InteractionBindingSchema: z.ZodObject<{
|
|
285
|
+
runId: z.ZodString;
|
|
286
|
+
environmentId: z.ZodString;
|
|
287
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
288
|
+
interactionId: z.ZodString;
|
|
289
|
+
}, z.core.$strict>;
|
|
290
|
+
export type InteractionBinding = z.infer<typeof InteractionBindingSchema>;
|
|
291
|
+
/** Retryable command sent to an environment or retained session. */
|
|
292
|
+
export declare const InteractionResponseCommandSchema: z.ZodObject<{
|
|
293
|
+
operationId: z.ZodString;
|
|
294
|
+
binding: z.ZodObject<{
|
|
295
|
+
runId: z.ZodString;
|
|
296
|
+
environmentId: z.ZodString;
|
|
297
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
298
|
+
interactionId: z.ZodString;
|
|
299
|
+
}, z.core.$strict>;
|
|
300
|
+
response: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
301
|
+
id: z.ZodString;
|
|
302
|
+
outcome: z.ZodLiteral<"accepted">;
|
|
303
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>>;
|
|
304
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
305
|
+
id: z.ZodString;
|
|
306
|
+
outcome: z.ZodLiteral<"declined">;
|
|
307
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>>;
|
|
308
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
309
|
+
id: z.ZodString;
|
|
310
|
+
outcome: z.ZodLiteral<"cancelled">;
|
|
311
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>>;
|
|
312
|
+
}, z.core.$strict>], "outcome">;
|
|
313
|
+
}, z.core.$strict>;
|
|
314
|
+
export type InteractionResponseCommand = z.infer<typeof InteractionResponseCommandSchema>;
|
|
315
|
+
export declare const InteractionAcknowledgementStatusSchema: z.ZodEnum<{
|
|
316
|
+
cancelled: "cancelled";
|
|
317
|
+
expired: "expired";
|
|
318
|
+
accepted: "accepted";
|
|
319
|
+
already_resolved_same: "already_resolved_same";
|
|
320
|
+
already_resolved_different: "already_resolved_different";
|
|
321
|
+
unknown_interaction: "unknown_interaction";
|
|
322
|
+
unknown_run: "unknown_run";
|
|
323
|
+
binding_mismatch: "binding_mismatch";
|
|
324
|
+
invalid_response: "invalid_response";
|
|
325
|
+
transport_failure: "transport_failure";
|
|
326
|
+
}>;
|
|
327
|
+
export type InteractionAcknowledgementStatus = z.infer<typeof InteractionAcknowledgementStatusSchema>;
|
|
328
|
+
/** Durable result of one interaction response operation. */
|
|
329
|
+
export declare const InteractionAcknowledgementSchema: z.ZodObject<{
|
|
330
|
+
operationId: z.ZodString;
|
|
331
|
+
binding: z.ZodObject<{
|
|
332
|
+
runId: z.ZodString;
|
|
333
|
+
environmentId: z.ZodString;
|
|
334
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
335
|
+
interactionId: z.ZodString;
|
|
336
|
+
}, z.core.$strict>;
|
|
337
|
+
status: z.ZodEnum<{
|
|
338
|
+
cancelled: "cancelled";
|
|
339
|
+
expired: "expired";
|
|
340
|
+
accepted: "accepted";
|
|
341
|
+
already_resolved_same: "already_resolved_same";
|
|
342
|
+
already_resolved_different: "already_resolved_different";
|
|
343
|
+
unknown_interaction: "unknown_interaction";
|
|
344
|
+
unknown_run: "unknown_run";
|
|
345
|
+
binding_mismatch: "binding_mismatch";
|
|
346
|
+
invalid_response: "invalid_response";
|
|
347
|
+
transport_failure: "transport_failure";
|
|
348
|
+
}>;
|
|
349
|
+
message: z.ZodOptional<z.ZodString>;
|
|
350
|
+
retryable: z.ZodOptional<z.ZodBoolean>;
|
|
351
|
+
}, z.core.$strict>;
|
|
352
|
+
export type InteractionAcknowledgement = z.infer<typeof InteractionAcknowledgementSchema>;
|
|
234
353
|
export declare const InteractionKind: {
|
|
235
354
|
/** Agent asks the user to answer/choose. Answer = the chosen field values. */
|
|
236
355
|
readonly Question: "question";
|
|
@@ -252,9 +371,10 @@ export declare const PermissionGrantSchema: z.ZodEnum<{
|
|
|
252
371
|
allow_always: "allow_always";
|
|
253
372
|
}>;
|
|
254
373
|
export type PermissionGrant = z.infer<typeof PermissionGrantSchema>;
|
|
255
|
-
/** Build
|
|
374
|
+
/** Build a permission answer spec that cannot offer a broader reusable grant. */
|
|
256
375
|
export declare function permissionAnswerSpec(opts?: {
|
|
257
376
|
allowFeedback?: boolean;
|
|
377
|
+
responseScopes?: readonly InteractionResponseScope[];
|
|
258
378
|
}): InteractionAnswerSpec;
|
|
259
379
|
export type InteractionValidation = {
|
|
260
380
|
ok: true;
|
|
@@ -267,3 +387,5 @@ export type InteractionValidation = {
|
|
|
267
387
|
* response reaches the adapter, so malformed answers are rejected centrally.
|
|
268
388
|
*/
|
|
269
389
|
export declare function validateInteractionAnswer(spec: InteractionAnswerSpec, data: InteractionData | undefined): InteractionValidation;
|
|
390
|
+
/** Validate one response against the exact outstanding request. */
|
|
391
|
+
export declare function validateInteractionResponse(request: InteractionRequest, response: InteractionResponse): InteractionValidation;
|