@lightspeed-ai/sdk 0.4.0 → 0.5.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/dist/generated/methods.d.ts +198 -127
- package/dist/generated/methods.d.ts.map +1 -1
- package/dist/generated/methods.js +130 -85
- package/dist/generated/methods.js.map +1 -1
- package/dist/generated/types.d.ts +641 -217
- package/dist/generated/types.d.ts.map +1 -1
- package/dist/generated/workflow-manifest.d.ts +127 -1
- package/dist/generated/workflow-manifest.d.ts.map +1 -1
- package/dist/generated/workflow-manifest.js +139 -1
- package/dist/generated/workflow-manifest.js.map +1 -1
- package/dist/generated/workflow-types.d.ts +322 -23
- package/dist/generated/workflow-types.d.ts.map +1 -1
- package/dist/workflow.d.ts +104 -0
- package/dist/workflow.d.ts.map +1 -1
- package/package.json +1 -1
- package/release.json +2 -2
- package/schema/api.schema.json +1172 -518
- package/schema/workflow.json +139 -1
- package/schema/workflow.schema.json +594 -1
- package/src/generated/methods.ts +199 -127
- package/src/generated/types.ts +658 -231
- package/src/generated/workflow-manifest.ts +139 -1
- package/src/generated/workflow-types.ts +346 -26
|
@@ -22,6 +22,22 @@ export const WORKFLOW_CONTRACT_MANIFEST =
|
|
|
22
22
|
"stateQuery": "chat_state",
|
|
23
23
|
"workflowKind": "ChannelConversationWorkflow"
|
|
24
24
|
},
|
|
25
|
+
"codeExecution": {
|
|
26
|
+
"activities": {
|
|
27
|
+
"finalize": "WorkflowActivities::code_finalize",
|
|
28
|
+
"prepare": "WorkflowActivities::code_prepare",
|
|
29
|
+
"run": "WorkflowActivities::code_run"
|
|
30
|
+
},
|
|
31
|
+
"runMaximumAttempts": 1,
|
|
32
|
+
"snapshotQuery": "snapshot",
|
|
33
|
+
"workflowType": "CodeExecutionWorkflow"
|
|
34
|
+
},
|
|
35
|
+
"codeTools": {
|
|
36
|
+
"identity": "execution_id + request_id; identical retries join or return the same result, conflicting reuse is rejected",
|
|
37
|
+
"invocationResult": "Result<CodeToolCallOutcome, CodeToolRejection>",
|
|
38
|
+
"report": "Fresh snapshot query; cancellation of a client waiter does not cancel admitted work",
|
|
39
|
+
"scopeResult": "Result<CodeToolScopeReport, CodeToolRejection>"
|
|
40
|
+
},
|
|
25
41
|
"contractVersion": 2,
|
|
26
42
|
"emissionIds": {
|
|
27
43
|
"framing": "sha256 over the hash domain, then the kind, then each part in order; every piece is prefixed by its byte length as an unsigned 64-bit big-endian integer. Universe ids are hashed as hyphenated lowercase UUID strings; run ids as 8-byte big-endian unsigned integers.",
|
|
@@ -59,6 +75,7 @@ export const WORKFLOW_CONTRACT_MANIFEST =
|
|
|
59
75
|
"prefix": "emission:sha256:"
|
|
60
76
|
},
|
|
61
77
|
"queries": {
|
|
78
|
+
"codeToolScopeReport": "code_tool_scope_report",
|
|
62
79
|
"workflowToolRecovery": "workflow_tool_recovery"
|
|
63
80
|
},
|
|
64
81
|
"roots": [
|
|
@@ -73,11 +90,26 @@ export const WORKFLOW_CONTRACT_MANIFEST =
|
|
|
73
90
|
"PrepareChannelMediaResult",
|
|
74
91
|
"TranscriptionWorkflowArgs",
|
|
75
92
|
"TranscriptionSnapshot",
|
|
76
|
-
"TranscriptionActivityResult"
|
|
93
|
+
"TranscriptionActivityResult",
|
|
94
|
+
"OpenCodeToolScopeRequest",
|
|
95
|
+
"InvokeCodeToolRequest",
|
|
96
|
+
"CloseCodeToolScopeRequest",
|
|
97
|
+
"CodeToolScopeReportRequest",
|
|
98
|
+
"CodeToolScopeReport",
|
|
99
|
+
"CodeToolCallOutcome",
|
|
100
|
+
"CodeToolRejection",
|
|
101
|
+
"CodeExecutionDescriptor",
|
|
102
|
+
"CodeExecutionSnapshot",
|
|
103
|
+
"CodeRunActivityResult"
|
|
77
104
|
],
|
|
78
105
|
"signals": {
|
|
79
106
|
"deliverEmission": "deliver_emission"
|
|
80
107
|
},
|
|
108
|
+
"updates": {
|
|
109
|
+
"closeCodeToolScope": "close_code_tool_scope",
|
|
110
|
+
"invokeCodeTool": "invoke_code_tool",
|
|
111
|
+
"openCodeToolScope": "open_code_tool_scope"
|
|
112
|
+
},
|
|
81
113
|
"vectors": {
|
|
82
114
|
"channels": {
|
|
83
115
|
"connectorTaskQueue": "lightspeed-connector-telegram-9b32a282ab8d90f892b5916c",
|
|
@@ -91,6 +123,112 @@ export const WORKFLOW_CONTRACT_MANIFEST =
|
|
|
91
123
|
"universeId": "6f3a1a52-58c1-4f0e-9c2d-1a2b3c4d5e6f"
|
|
92
124
|
}
|
|
93
125
|
},
|
|
126
|
+
"codeExecution": {
|
|
127
|
+
"descriptor": {
|
|
128
|
+
"catalog_ref": "sha256:37205a7f23ed067993395414b26457d7eb603bf78e181254ac6d2a74ea2918d9",
|
|
129
|
+
"execution_id": "wte:code-vector",
|
|
130
|
+
"limits": {
|
|
131
|
+
"max_catalog_bytes": 262144,
|
|
132
|
+
"max_memory_bytes": 16777216,
|
|
133
|
+
"max_output_bytes": 65536,
|
|
134
|
+
"max_outstanding_tool_calls": 8,
|
|
135
|
+
"max_request_bytes": 65536,
|
|
136
|
+
"max_result_bytes": 262144,
|
|
137
|
+
"max_source_bytes": 65536,
|
|
138
|
+
"max_stack_bytes": 262144,
|
|
139
|
+
"max_tool_calls": 100,
|
|
140
|
+
"timeout_ms": 30000
|
|
141
|
+
},
|
|
142
|
+
"session_workflow_id": "6f3a1a52-58c1-4f0e-9c2d-1a2b3c4d5e6f/bot:v1:triage",
|
|
143
|
+
"source_ref": "sha256:6a98d35093f15c84a9ccc34b0265e824ea49910551c181a250b362448204a253"
|
|
144
|
+
},
|
|
145
|
+
"result": {
|
|
146
|
+
"report_ref": "sha256:825bada798e50a4ea4f128bfcd6ff0371f292bcf43e7ef700eac8ba1a54a3db8",
|
|
147
|
+
"succeeded": true
|
|
148
|
+
},
|
|
149
|
+
"snapshot": {
|
|
150
|
+
"descriptor": {
|
|
151
|
+
"catalog_ref": "sha256:37205a7f23ed067993395414b26457d7eb603bf78e181254ac6d2a74ea2918d9",
|
|
152
|
+
"execution_id": "wte:code-vector",
|
|
153
|
+
"limits": {
|
|
154
|
+
"max_catalog_bytes": 262144,
|
|
155
|
+
"max_memory_bytes": 16777216,
|
|
156
|
+
"max_output_bytes": 65536,
|
|
157
|
+
"max_outstanding_tool_calls": 8,
|
|
158
|
+
"max_request_bytes": 65536,
|
|
159
|
+
"max_result_bytes": 262144,
|
|
160
|
+
"max_source_bytes": 65536,
|
|
161
|
+
"max_stack_bytes": 262144,
|
|
162
|
+
"max_tool_calls": 100,
|
|
163
|
+
"timeout_ms": 30000
|
|
164
|
+
},
|
|
165
|
+
"session_workflow_id": "6f3a1a52-58c1-4f0e-9c2d-1a2b3c4d5e6f/bot:v1:triage",
|
|
166
|
+
"source_ref": "sha256:6a98d35093f15c84a9ccc34b0265e824ea49910551c181a250b362448204a253"
|
|
167
|
+
},
|
|
168
|
+
"phase": "resolved",
|
|
169
|
+
"resolution": {
|
|
170
|
+
"kind": "resolved",
|
|
171
|
+
"payload_ref": "sha256:f03a9de709e439c62f5d0c0eed41f9972197ac5af6bd88b60add479443245f7f"
|
|
172
|
+
},
|
|
173
|
+
"terminal": {
|
|
174
|
+
"kind": "completed",
|
|
175
|
+
"result": {
|
|
176
|
+
"report_ref": "sha256:825bada798e50a4ea4f128bfcd6ff0371f292bcf43e7ef700eac8ba1a54a3db8",
|
|
177
|
+
"succeeded": true
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
"codeTools": {
|
|
183
|
+
"closeRequest": {
|
|
184
|
+
"cancel_pending": true,
|
|
185
|
+
"execution_id": "execution:vector"
|
|
186
|
+
},
|
|
187
|
+
"invokeRequest": {
|
|
188
|
+
"arguments_ref": "sha256:76cd2a0d9aa2ce03442a30b892eda947093dd0fdf8ee727690fa464ad6850ac8",
|
|
189
|
+
"binding_id": "binding:vector",
|
|
190
|
+
"execution_id": "execution:vector",
|
|
191
|
+
"request_id": "request:vector"
|
|
192
|
+
},
|
|
193
|
+
"openRequest": {
|
|
194
|
+
"allowed_tools": [
|
|
195
|
+
"vfs.read_file"
|
|
196
|
+
],
|
|
197
|
+
"execution_id": "execution:vector",
|
|
198
|
+
"max_calls": 8,
|
|
199
|
+
"max_in_flight": 2,
|
|
200
|
+
"parent_invocation_id": "wti:sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
201
|
+
},
|
|
202
|
+
"outcome": {
|
|
203
|
+
"call_id": "code-tool:vector",
|
|
204
|
+
"output_ref": "sha256:23fb5c3482a5315f33eba760b84f175d7fb0ad91a527e5578baa1038a06482dd",
|
|
205
|
+
"request_id": "request:vector",
|
|
206
|
+
"status": "succeeded"
|
|
207
|
+
},
|
|
208
|
+
"rejection": {
|
|
209
|
+
"kind": "scope_closed",
|
|
210
|
+
"message": "scope is closed"
|
|
211
|
+
},
|
|
212
|
+
"report": {
|
|
213
|
+
"bindings": {
|
|
214
|
+
"binding:vector": "read_file"
|
|
215
|
+
},
|
|
216
|
+
"calls": {
|
|
217
|
+
"request:vector": {
|
|
218
|
+
"call_id": "code-tool:vector",
|
|
219
|
+
"output_ref": "sha256:23fb5c3482a5315f33eba760b84f175d7fb0ad91a527e5578baa1038a06482dd",
|
|
220
|
+
"request_id": "request:vector",
|
|
221
|
+
"status": "succeeded"
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
"cancel_requested": true,
|
|
225
|
+
"closed": true,
|
|
226
|
+
"execution_id": "execution:vector"
|
|
227
|
+
},
|
|
228
|
+
"reportRequest": {
|
|
229
|
+
"execution_id": "execution:vector"
|
|
230
|
+
}
|
|
231
|
+
},
|
|
94
232
|
"emissionIds": {
|
|
95
233
|
"invocationCancellation": "emission:sha256:6b88bd2ef714193fc9274b5f212cc415da4dd25733e1717fa89c7fdddc3eca4e",
|
|
96
234
|
"runTerminal": "emission:sha256:a477a56dbeb4f3937959dc5ece1cf363c7030bec130415e4019b507e48098240",
|
|
@@ -3,6 +3,26 @@
|
|
|
3
3
|
* Do not edit by hand.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* This interface was referenced by `LightspeedWorkflowContract`'s JSON-Schema
|
|
8
|
+
* via the `definition` "Attachment".
|
|
9
|
+
*/
|
|
10
|
+
export type Attachment =
|
|
11
|
+
| {
|
|
12
|
+
data: MediaDescriptor;
|
|
13
|
+
kind: "media";
|
|
14
|
+
}
|
|
15
|
+
| {
|
|
16
|
+
data: FileAttachment;
|
|
17
|
+
kind: "file";
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* What a media entry is to the providers: an image block or a document block.
|
|
21
|
+
*
|
|
22
|
+
* This interface was referenced by `LightspeedWorkflowContract`'s JSON-Schema
|
|
23
|
+
* via the `definition` "MediaKind".
|
|
24
|
+
*/
|
|
25
|
+
export type MediaKind = "image" | "document";
|
|
6
26
|
/**
|
|
7
27
|
* Who created a resource or authored bytes. An actor is whatever a key
|
|
8
28
|
* allowed to assert one said; core compares it and never resolves it.
|
|
@@ -94,6 +114,90 @@ export type ChatGroupActivation = "mention" | "always";
|
|
|
94
114
|
* via the `definition` "ChatScope".
|
|
95
115
|
*/
|
|
96
116
|
export type ChatScope = "direct" | "group";
|
|
117
|
+
/**
|
|
118
|
+
* This interface was referenced by `LightspeedWorkflowContract`'s JSON-Schema
|
|
119
|
+
* via the `definition` "CodeExecutionInterruption".
|
|
120
|
+
*/
|
|
121
|
+
export type CodeExecutionInterruption =
|
|
122
|
+
| "holder_cancelled"
|
|
123
|
+
| "workflow_cancelled"
|
|
124
|
+
| "preparation_failed"
|
|
125
|
+
| "activity_failed"
|
|
126
|
+
| "activity_timed_out";
|
|
127
|
+
/**
|
|
128
|
+
* This interface was referenced by `LightspeedWorkflowContract`'s JSON-Schema
|
|
129
|
+
* via the `definition` "CodeExecutionPhase".
|
|
130
|
+
*/
|
|
131
|
+
export type CodeExecutionPhase =
|
|
132
|
+
"starting" | "preparing" | "running" | "finalizing" | "resolved" | "cancelled";
|
|
133
|
+
/**
|
|
134
|
+
* How a promise reached a terminal state. Used by `ResolvePromise`
|
|
135
|
+
* admission; all transports (push notifications, poll results, timers,
|
|
136
|
+
* cancellation) converge on this one funnel.
|
|
137
|
+
*
|
|
138
|
+
* This interface was referenced by `LightspeedWorkflowContract`'s JSON-Schema
|
|
139
|
+
* via the `definition` "PromiseResolution".
|
|
140
|
+
*/
|
|
141
|
+
export type PromiseResolution =
|
|
142
|
+
| {
|
|
143
|
+
kind: "resolved";
|
|
144
|
+
payload_ref?: string | null;
|
|
145
|
+
}
|
|
146
|
+
| {
|
|
147
|
+
error_ref?: string | null;
|
|
148
|
+
kind: "failed";
|
|
149
|
+
}
|
|
150
|
+
| {
|
|
151
|
+
kind: "cancelled";
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* This interface was referenced by `LightspeedWorkflowContract`'s JSON-Schema
|
|
155
|
+
* via the `definition` "CodeExecutionTerminal".
|
|
156
|
+
*/
|
|
157
|
+
export type CodeExecutionTerminal =
|
|
158
|
+
| {
|
|
159
|
+
kind: "completed";
|
|
160
|
+
result: CodeRunActivityResult;
|
|
161
|
+
}
|
|
162
|
+
| {
|
|
163
|
+
error_ref: string;
|
|
164
|
+
kind: "rejected";
|
|
165
|
+
}
|
|
166
|
+
| {
|
|
167
|
+
kind: "interrupted";
|
|
168
|
+
reason: CodeExecutionInterruption;
|
|
169
|
+
result?: CodeRunActivityResult | null;
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* This interface was referenced by `LightspeedWorkflowContract`'s JSON-Schema
|
|
173
|
+
* via the `definition` "ToolCallId".
|
|
174
|
+
*/
|
|
175
|
+
export type ToolCallId = string;
|
|
176
|
+
/**
|
|
177
|
+
* This interface was referenced by `LightspeedWorkflowContract`'s JSON-Schema
|
|
178
|
+
* via the `definition` "CodeToolCallStatus".
|
|
179
|
+
*/
|
|
180
|
+
export type CodeToolCallStatus =
|
|
181
|
+
"pending" | "waiting" | "succeeded" | "failed" | "cancelled" | "unavailable";
|
|
182
|
+
/**
|
|
183
|
+
* This interface was referenced by `LightspeedWorkflowContract`'s JSON-Schema
|
|
184
|
+
* via the `definition` "CodeToolRejectionKind".
|
|
185
|
+
*/
|
|
186
|
+
export type CodeToolRejectionKind =
|
|
187
|
+
| "invalid_request"
|
|
188
|
+
| "unknown_scope"
|
|
189
|
+
| "scope_closed"
|
|
190
|
+
| "conflict"
|
|
191
|
+
| "unavailable"
|
|
192
|
+
| "permission_denied"
|
|
193
|
+
| "limit_exceeded"
|
|
194
|
+
| "session_not_ready"
|
|
195
|
+
| "internal";
|
|
196
|
+
/**
|
|
197
|
+
* This interface was referenced by `LightspeedWorkflowContract`'s JSON-Schema
|
|
198
|
+
* via the `definition` "ToolName".
|
|
199
|
+
*/
|
|
200
|
+
export type ToolName = string;
|
|
97
201
|
/**
|
|
98
202
|
* Closed internal vocabulary carried by the shared delivery signal.
|
|
99
203
|
*
|
|
@@ -152,26 +256,6 @@ export type RunStatus = "active" | "parked" | "cancelling" | "completed" | "fail
|
|
|
152
256
|
* via the `definition` "PromiseId".
|
|
153
257
|
*/
|
|
154
258
|
export type PromiseId = string;
|
|
155
|
-
/**
|
|
156
|
-
* How a promise reached a terminal state. Used by `ResolvePromise`
|
|
157
|
-
* admission; all transports (push notifications, poll results, timers,
|
|
158
|
-
* cancellation) converge on this one funnel.
|
|
159
|
-
*
|
|
160
|
-
* This interface was referenced by `LightspeedWorkflowContract`'s JSON-Schema
|
|
161
|
-
* via the `definition` "PromiseResolution".
|
|
162
|
-
*/
|
|
163
|
-
export type PromiseResolution =
|
|
164
|
-
| {
|
|
165
|
-
kind: "resolved";
|
|
166
|
-
payload_ref?: string | null;
|
|
167
|
-
}
|
|
168
|
-
| {
|
|
169
|
-
error_ref?: string | null;
|
|
170
|
-
kind: "failed";
|
|
171
|
-
}
|
|
172
|
-
| {
|
|
173
|
-
kind: "cancelled";
|
|
174
|
-
};
|
|
175
259
|
/**
|
|
176
260
|
* This interface was referenced by `LightspeedWorkflowContract`'s JSON-Schema
|
|
177
261
|
* via the `definition` "WorkflowToolInvocationId".
|
|
@@ -182,11 +266,6 @@ export type WorkflowToolInvocationId = string;
|
|
|
182
266
|
* via the `definition` "SessionId".
|
|
183
267
|
*/
|
|
184
268
|
export type SessionId = string;
|
|
185
|
-
/**
|
|
186
|
-
* This interface was referenced by `LightspeedWorkflowContract`'s JSON-Schema
|
|
187
|
-
* via the `definition` "ToolCallId".
|
|
188
|
-
*/
|
|
189
|
-
export type ToolCallId = string;
|
|
190
269
|
/**
|
|
191
270
|
* This interface was referenced by `LightspeedWorkflowContract`'s JSON-Schema
|
|
192
271
|
* via the `definition` "WorkflowToolId".
|
|
@@ -248,11 +327,51 @@ export type TranscriptionStatus =
|
|
|
248
327
|
"pending" | "running" | "succeeded" | "failed" | "cancelled" | "expired";
|
|
249
328
|
|
|
250
329
|
/**
|
|
251
|
-
*
|
|
330
|
+
* Session emission, workflow-tool, and code tool invocation protocol types.
|
|
252
331
|
*/
|
|
253
332
|
export interface LightspeedWorkflowContract {
|
|
254
333
|
[k: string]: unknown;
|
|
255
334
|
}
|
|
335
|
+
/**
|
|
336
|
+
* A media asset named for a consumer that did not see it enter context: the
|
|
337
|
+
* parent of a sub-agent, an awaited promise's holder. Carries everything
|
|
338
|
+
* needed to append a media entry without reading the bytes.
|
|
339
|
+
*
|
|
340
|
+
* This interface was referenced by `LightspeedWorkflowContract`'s JSON-Schema
|
|
341
|
+
* via the `definition` "MediaDescriptor".
|
|
342
|
+
*/
|
|
343
|
+
export interface MediaDescriptor {
|
|
344
|
+
content_ref: string;
|
|
345
|
+
/**
|
|
346
|
+
* `media:` plus the first twelve hex characters of `content_ref`.
|
|
347
|
+
*/
|
|
348
|
+
handle: string;
|
|
349
|
+
kind: MediaKind;
|
|
350
|
+
media_type: string;
|
|
351
|
+
name?: string | null;
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* This interface was referenced by `LightspeedWorkflowContract`'s JSON-Schema
|
|
355
|
+
* via the `definition` "FileAttachment".
|
|
356
|
+
*/
|
|
357
|
+
export interface FileAttachment {
|
|
358
|
+
content_ref: string;
|
|
359
|
+
handle: string;
|
|
360
|
+
media_type?: string | null;
|
|
361
|
+
name: string;
|
|
362
|
+
source?: AttachmentSource | null;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Descriptive origin only; never an authority for resolving attachment bytes.
|
|
366
|
+
*
|
|
367
|
+
* This interface was referenced by `LightspeedWorkflowContract`'s JSON-Schema
|
|
368
|
+
* via the `definition` "AttachmentSource".
|
|
369
|
+
*/
|
|
370
|
+
export interface AttachmentSource {
|
|
371
|
+
id: string;
|
|
372
|
+
kind: string;
|
|
373
|
+
path: string;
|
|
374
|
+
}
|
|
256
375
|
/**
|
|
257
376
|
* One connector activity call. `idempotency_key` is the invocation id, or
|
|
258
377
|
* `{invocation}:chunk:{i}/{n}` for a chunk of a split send.
|
|
@@ -350,6 +469,174 @@ export interface ChatActivation {
|
|
|
350
469
|
mentionNames?: string[];
|
|
351
470
|
triggerPrefixes?: string[];
|
|
352
471
|
}
|
|
472
|
+
/**
|
|
473
|
+
* Close admission immediately. Cancellation additionally requests cleanup of
|
|
474
|
+
* admitted work; closing a scope does not roll back any completed effects.
|
|
475
|
+
*
|
|
476
|
+
* This interface was referenced by `LightspeedWorkflowContract`'s JSON-Schema
|
|
477
|
+
* via the `definition` "CloseCodeToolScopeRequest".
|
|
478
|
+
*/
|
|
479
|
+
export interface CloseCodeToolScopeRequest {
|
|
480
|
+
cancel_pending: boolean;
|
|
481
|
+
execution_id: string;
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* Small, immutable input shared by code-execution orchestration and its runner.
|
|
485
|
+
*
|
|
486
|
+
* The parent session owns the execution scope and its bindings. Possessing this
|
|
487
|
+
* descriptor does not authorize tool calls. Validate it before loading artifacts
|
|
488
|
+
* or admitting an execution; deserialization alone is not validation.
|
|
489
|
+
*
|
|
490
|
+
* This interface was referenced by `LightspeedWorkflowContract`'s JSON-Schema
|
|
491
|
+
* via the `definition` "CodeExecutionDescriptor".
|
|
492
|
+
*/
|
|
493
|
+
export interface CodeExecutionDescriptor {
|
|
494
|
+
/**
|
|
495
|
+
* Immutable matched callable specifications and bindings in the same CAS.
|
|
496
|
+
* This catalog is metadata, not an independent authorization database.
|
|
497
|
+
*/
|
|
498
|
+
catalog_ref: string;
|
|
499
|
+
/**
|
|
500
|
+
* Stable identity of the session-owned execution scope.
|
|
501
|
+
*/
|
|
502
|
+
execution_id: string;
|
|
503
|
+
limits: CodeExecutionLimits;
|
|
504
|
+
/**
|
|
505
|
+
* Parent session's composed workflow id, without a Temporal run id so the
|
|
506
|
+
* identity remains stable across the parent's Continue-as-New transitions.
|
|
507
|
+
*/
|
|
508
|
+
session_workflow_id: string;
|
|
509
|
+
/**
|
|
510
|
+
* UTF-8 JavaScript source in the parent session's universe-scoped CAS.
|
|
511
|
+
*/
|
|
512
|
+
source_ref: string;
|
|
513
|
+
}
|
|
514
|
+
/**
|
|
515
|
+
* Explicit, positive budgets admitted for a single execution attempt.
|
|
516
|
+
*
|
|
517
|
+
* No deployment defaults are implied. User-requested options may only narrow
|
|
518
|
+
* these budgets. Engine limits must be enforced by the runner; call and payload
|
|
519
|
+
* limits must also be enforced at the trusted session/bridge boundary. These
|
|
520
|
+
* bounds are not containment of native interpreter memory faults.
|
|
521
|
+
*
|
|
522
|
+
* This interface was referenced by `LightspeedWorkflowContract`'s JSON-Schema
|
|
523
|
+
* via the `definition` "CodeExecutionLimits".
|
|
524
|
+
*/
|
|
525
|
+
export interface CodeExecutionLimits {
|
|
526
|
+
max_catalog_bytes: number;
|
|
527
|
+
/**
|
|
528
|
+
* Interpreter-managed heap allocation budget.
|
|
529
|
+
*/
|
|
530
|
+
max_memory_bytes: number;
|
|
531
|
+
/**
|
|
532
|
+
* Total serialized output bytes retained for the final script report.
|
|
533
|
+
*/
|
|
534
|
+
max_output_bytes: number;
|
|
535
|
+
/**
|
|
536
|
+
* Outstanding bridge requests, including durable-promise waits. This does
|
|
537
|
+
* not change the ordinary tool's own scheduling or concurrency policies.
|
|
538
|
+
*/
|
|
539
|
+
max_outstanding_tool_calls: number;
|
|
540
|
+
/**
|
|
541
|
+
* Serialized JSON bytes in one guest tool request, before dispatch.
|
|
542
|
+
*/
|
|
543
|
+
max_request_bytes: number;
|
|
544
|
+
/**
|
|
545
|
+
* Serialized JSON bytes in one host completion, before entering the guest.
|
|
546
|
+
* Larger tool outputs require authorized artifact handles.
|
|
547
|
+
*/
|
|
548
|
+
max_result_bytes: number;
|
|
549
|
+
max_source_bytes: number;
|
|
550
|
+
/**
|
|
551
|
+
* Interpreter-managed native stack budget, separate from its heap budget.
|
|
552
|
+
*/
|
|
553
|
+
max_stack_bytes: number;
|
|
554
|
+
max_tool_calls: number;
|
|
555
|
+
/**
|
|
556
|
+
* Total attempt time, including input loading, interpreter capacity waits,
|
|
557
|
+
* JavaScript evaluation, and time awaiting host calls.
|
|
558
|
+
*/
|
|
559
|
+
timeout_ms: number;
|
|
560
|
+
}
|
|
561
|
+
/**
|
|
562
|
+
* Queryable durable orchestration state; no JavaScript heap or raw outputs.
|
|
563
|
+
*
|
|
564
|
+
* This interface was referenced by `LightspeedWorkflowContract`'s JSON-Schema
|
|
565
|
+
* via the `definition` "CodeExecutionSnapshot".
|
|
566
|
+
*/
|
|
567
|
+
export interface CodeExecutionSnapshot {
|
|
568
|
+
descriptor?: CodeExecutionDescriptor | null;
|
|
569
|
+
phase: CodeExecutionPhase;
|
|
570
|
+
resolution?: PromiseResolution | null;
|
|
571
|
+
terminal?: CodeExecutionTerminal | null;
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* Only the reference crosses the activity boundary. Script output and the
|
|
575
|
+
* complete code tool call report remain in the parent universe's CAS.
|
|
576
|
+
*
|
|
577
|
+
* This interface was referenced by `LightspeedWorkflowContract`'s JSON-Schema
|
|
578
|
+
* via the `definition` "CodeRunActivityResult".
|
|
579
|
+
*/
|
|
580
|
+
export interface CodeRunActivityResult {
|
|
581
|
+
report_ref: string;
|
|
582
|
+
succeeded: boolean;
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
* Script-facing completion metadata. Session effects, model context, and
|
|
586
|
+
* activity configuration remain private to the owning session.
|
|
587
|
+
*
|
|
588
|
+
* This interface was referenced by `LightspeedWorkflowContract`'s JSON-Schema
|
|
589
|
+
* via the `definition` "CodeToolCallOutcome".
|
|
590
|
+
*/
|
|
591
|
+
export interface CodeToolCallOutcome {
|
|
592
|
+
attachments?: Attachment[];
|
|
593
|
+
call_id: ToolCallId;
|
|
594
|
+
error_ref?: string | null;
|
|
595
|
+
output_ref?: string | null;
|
|
596
|
+
request_id: string;
|
|
597
|
+
status: CodeToolCallStatus;
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* Admission failures are successful protocol replies, distinct from transport
|
|
601
|
+
* failures and the tool's own failed result. They never imply tool execution.
|
|
602
|
+
*
|
|
603
|
+
* This interface was referenced by `LightspeedWorkflowContract`'s JSON-Schema
|
|
604
|
+
* via the `definition` "CodeToolRejection".
|
|
605
|
+
*/
|
|
606
|
+
export interface CodeToolRejection {
|
|
607
|
+
kind: CodeToolRejectionKind;
|
|
608
|
+
message: string;
|
|
609
|
+
}
|
|
610
|
+
/**
|
|
611
|
+
* This interface was referenced by `LightspeedWorkflowContract`'s JSON-Schema
|
|
612
|
+
* via the `definition` "CodeToolScopeReport".
|
|
613
|
+
*/
|
|
614
|
+
export interface CodeToolScopeReport {
|
|
615
|
+
/**
|
|
616
|
+
* Exposed names keyed by the opaque handles accepted by invoke requests.
|
|
617
|
+
*/
|
|
618
|
+
bindings: {
|
|
619
|
+
[k: string]: ToolName;
|
|
620
|
+
};
|
|
621
|
+
/**
|
|
622
|
+
* Requests are keyed by execution-local request id, never arrival order.
|
|
623
|
+
*/
|
|
624
|
+
calls: {
|
|
625
|
+
[k: string]: CodeToolCallOutcome;
|
|
626
|
+
};
|
|
627
|
+
cancel_requested: boolean;
|
|
628
|
+
closed: boolean;
|
|
629
|
+
execution_id: string;
|
|
630
|
+
}
|
|
631
|
+
/**
|
|
632
|
+
* Read an authoritative snapshot, including after a runner loses its waiters.
|
|
633
|
+
*
|
|
634
|
+
* This interface was referenced by `LightspeedWorkflowContract`'s JSON-Schema
|
|
635
|
+
* via the `definition` "CodeToolScopeReportRequest".
|
|
636
|
+
*/
|
|
637
|
+
export interface CodeToolScopeReportRequest {
|
|
638
|
+
execution_id: string;
|
|
639
|
+
}
|
|
353
640
|
/**
|
|
354
641
|
* Durable content identity and encoding. The payload stays in CAS; consumers
|
|
355
642
|
* project it outside the harness rather than assuming every output is text.
|
|
@@ -452,6 +739,20 @@ export interface EmissionEnvelope {
|
|
|
452
739
|
emission_id: EmissionId;
|
|
453
740
|
producer: EmissionProducer;
|
|
454
741
|
}
|
|
742
|
+
/**
|
|
743
|
+
* Small request forwarded by a trusted host after serializing guest arguments.
|
|
744
|
+
* Identity is execution-local. Reusing it with different arguments or a
|
|
745
|
+
* different binding is rejected by the session, including across RPC retries.
|
|
746
|
+
*
|
|
747
|
+
* This interface was referenced by `LightspeedWorkflowContract`'s JSON-Schema
|
|
748
|
+
* via the `definition` "InvokeCodeToolRequest".
|
|
749
|
+
*/
|
|
750
|
+
export interface InvokeCodeToolRequest {
|
|
751
|
+
arguments_ref: string;
|
|
752
|
+
binding_id: string;
|
|
753
|
+
execution_id: string;
|
|
754
|
+
request_id: string;
|
|
755
|
+
}
|
|
455
756
|
/**
|
|
456
757
|
* `maintain_channel_typing`: keep the provider's typing indicator up for
|
|
457
758
|
* the conversation until the activity is cancelled.
|
|
@@ -471,6 +772,25 @@ export interface ModelConfig {
|
|
|
471
772
|
model: string;
|
|
472
773
|
providerId: string;
|
|
473
774
|
}
|
|
775
|
+
/**
|
|
776
|
+
* Trusted host request to open a scope beneath an admitted joined invocation.
|
|
777
|
+
* The session resolves bindings itself; this allowlist can only narrow grants.
|
|
778
|
+
*
|
|
779
|
+
* This interface was referenced by `LightspeedWorkflowContract`'s JSON-Schema
|
|
780
|
+
* via the `definition` "OpenCodeToolScopeRequest".
|
|
781
|
+
*/
|
|
782
|
+
export interface OpenCodeToolScopeRequest {
|
|
783
|
+
/**
|
|
784
|
+
* A supplied set narrows logical tool identities; an empty set grants no
|
|
785
|
+
* tools. None selects all currently host-callable tools except the parent
|
|
786
|
+
* operation. Reopening an existing scope retains its original bindings.
|
|
787
|
+
*/
|
|
788
|
+
allowed_tools?: ToolName[] | null;
|
|
789
|
+
execution_id: string;
|
|
790
|
+
max_calls: number;
|
|
791
|
+
max_in_flight: number;
|
|
792
|
+
parent_invocation_id: WorkflowToolInvocationId;
|
|
793
|
+
}
|
|
474
794
|
/**
|
|
475
795
|
* `prepare_channel_media`: the connector downloads the provider file and
|
|
476
796
|
* stores it in the universe's CAS.
|