@mitralab.io/sdk-core 0.2.14 → 0.3.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/CHANGELOG.md +194 -1
- package/README.md +9 -2
- package/contracts/README.md +12 -1
- package/contracts/manifest.json +14 -4
- package/contracts/{v0.2.14 → v0.3.0}/sdk-parity.json +1 -1
- package/contracts/v0.3.0-beta.1/sdk-parity.json +2902 -0
- package/contracts/v0.3.0-beta.2/sdk-parity.json +2902 -0
- package/dist/index.cjs +1036 -194
- package/dist/index.d.cts +314 -10
- package/dist/index.d.ts +314 -10
- package/dist/index.js +1036 -194
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -529,6 +529,14 @@ interface PageOptions {
|
|
|
529
529
|
/** Spring sort expression, for example `createdAt,desc`. */
|
|
530
530
|
sort?: string;
|
|
531
531
|
}
|
|
532
|
+
interface AgentMessageListOptions extends PageOptions {
|
|
533
|
+
/**
|
|
534
|
+
* `all` asks for every row the Copilot recorded from the box, one per piece: also `REASONING`,
|
|
535
|
+
* `SUBAGENT_TEXT`, `APPROVAL`, `USER_INPUT_REQUEST` and a subagent's tools. Without it the Copilot answers only `TEXT`, `ERROR`
|
|
536
|
+
* and `TOOL_USE` rows of the chat itself, as before.
|
|
537
|
+
*/
|
|
538
|
+
kinds?: "all";
|
|
539
|
+
}
|
|
532
540
|
type AppColor = {
|
|
533
541
|
type: "SOLID";
|
|
534
542
|
hex: string;
|
|
@@ -1089,11 +1097,58 @@ type AgentTaskInput = {
|
|
|
1089
1097
|
content: string;
|
|
1090
1098
|
agentType?: string;
|
|
1091
1099
|
reasoningEffort?: string;
|
|
1100
|
+
/**
|
|
1101
|
+
* With a turn running, as T3's composer: `queue` puts the message in T3's queue behind it and
|
|
1102
|
+
* `steer` takes it into the running turn. A box given none lets T3 decide. The Copilot does
|
|
1103
|
+
* not take the field.
|
|
1104
|
+
*/
|
|
1105
|
+
mode?: "queue" | "steer";
|
|
1106
|
+
/**
|
|
1107
|
+
* The id the box echoes on the frames that take the message (`stepStart`, `steer`,
|
|
1108
|
+
* `messageQueued`) and the history item of the question carries. The session sends the one
|
|
1109
|
+
* `send` returned, to the box and to the Copilot, which keeps it and hands it to the box.
|
|
1110
|
+
*/
|
|
1111
|
+
clientMessageId?: string;
|
|
1092
1112
|
} | {
|
|
1093
1113
|
type: "interrupt";
|
|
1094
1114
|
} | {
|
|
1095
1115
|
type: "approval_response";
|
|
1096
1116
|
approved: boolean;
|
|
1117
|
+
}
|
|
1118
|
+
/**
|
|
1119
|
+
* The answer to a `user_input_request` the box forwards from T3 mid-turn (a `raw` event whose
|
|
1120
|
+
* payload is T3's item). Same shape as T3's own command; only the box's direct channel takes it.
|
|
1121
|
+
*/
|
|
1122
|
+
| {
|
|
1123
|
+
type: "runtime-request.respond";
|
|
1124
|
+
requestId: string;
|
|
1125
|
+
answers: Record<string, unknown>;
|
|
1126
|
+
attachmentsByQuestionId?: Record<string, unknown>;
|
|
1127
|
+
}
|
|
1128
|
+
/** Stops one subagent, as T3's own `subagent.stop`; only the box channel takes it. */
|
|
1129
|
+
| {
|
|
1130
|
+
type: "subagent.stop";
|
|
1131
|
+
subagentId: string;
|
|
1132
|
+
}
|
|
1133
|
+
/** Takes a message out of T3's queue, named by its `clientMessageId`; only the box takes it. */
|
|
1134
|
+
| {
|
|
1135
|
+
type: "queued-run.cancel";
|
|
1136
|
+
clientMessageId: string;
|
|
1137
|
+
}
|
|
1138
|
+
/** Changes the text of a message in T3's queue; only the box channel takes it. */
|
|
1139
|
+
| {
|
|
1140
|
+
type: "queued-run.edit";
|
|
1141
|
+
clientMessageId: string;
|
|
1142
|
+
text: string;
|
|
1143
|
+
}
|
|
1144
|
+
/** Moves a message from T3's queue into the running turn, as T3's own Steer on a queued message. */
|
|
1145
|
+
| {
|
|
1146
|
+
type: "queued-message.promote-to-steer";
|
|
1147
|
+
clientMessageId: string;
|
|
1148
|
+
}
|
|
1149
|
+
/** Lets T3's queue go on after a Stop held it, as T3's own `queue.resume`. */
|
|
1150
|
+
| {
|
|
1151
|
+
type: "queue.resume";
|
|
1097
1152
|
};
|
|
1098
1153
|
interface AgentTaskEvent {
|
|
1099
1154
|
/** Event names are open and can grow without a client release. */
|
|
@@ -1109,6 +1164,11 @@ interface AgentTaskChannel {
|
|
|
1109
1164
|
wsUrl: string;
|
|
1110
1165
|
/** Last sequence in the box log, 0 when the box reported none. */
|
|
1111
1166
|
lastSequence: number;
|
|
1167
|
+
/**
|
|
1168
|
+
* Which box log the chat is on now, counted by the Copilot: a box that comes up without the
|
|
1169
|
+
* log starts a new one. The `boxLog` of the history items. Absent from an older Copilot.
|
|
1170
|
+
*/
|
|
1171
|
+
boxLog?: number;
|
|
1112
1172
|
}
|
|
1113
1173
|
/** One call to the provider inside a turn, or one model's total when the source gives only that. */
|
|
1114
1174
|
interface AgentTurnUsageRequest {
|
|
@@ -1168,11 +1228,49 @@ interface AgentTurnUsage {
|
|
|
1168
1228
|
interface AgentMessage {
|
|
1169
1229
|
id: string;
|
|
1170
1230
|
sender: string;
|
|
1231
|
+
/**
|
|
1232
|
+
* `TEXT`, `ERROR`, `TOOL_USE`; asked with `kinds: "all"`, also `REASONING`, `SUBAGENT_TEXT`,
|
|
1233
|
+
* `APPROVAL` and `USER_INPUT_REQUEST`.
|
|
1234
|
+
*/
|
|
1171
1235
|
type: string;
|
|
1172
1236
|
content: string;
|
|
1173
1237
|
createdAt: string;
|
|
1174
1238
|
/** Present on the Agent message that closed a turn, when the Copilot recorded its usage. */
|
|
1175
1239
|
usage?: AgentTurnUsage;
|
|
1240
|
+
/**
|
|
1241
|
+
* The box log's sequence of the row's first chunk, the same as its live event; absent on older
|
|
1242
|
+
* rows.
|
|
1243
|
+
*/
|
|
1244
|
+
sequence?: number;
|
|
1245
|
+
/** The box log's sequence of the row's last chunk, only when the row came in more than one. */
|
|
1246
|
+
lastSequence?: number;
|
|
1247
|
+
/** Which box log `sequence` counts in; absent on older rows. */
|
|
1248
|
+
boxLog?: number;
|
|
1249
|
+
/** T3's id of the item the row holds. */
|
|
1250
|
+
itemId?: string;
|
|
1251
|
+
/** On a subagent's own reasoning, text or tool: the tool call that spawned the subagent. */
|
|
1252
|
+
parentToolId?: string;
|
|
1253
|
+
/** On the person's message: the `clientMessageId` it went out with. */
|
|
1254
|
+
clientMessageId?: string;
|
|
1255
|
+
/** On a tool call that spawned a subagent: its last state, as the box sent it. */
|
|
1256
|
+
subagent?: Partial<AgentSubagentFrame>;
|
|
1257
|
+
/** On the row that closed a turn: the reason the box ended it with. */
|
|
1258
|
+
reason?: string;
|
|
1259
|
+
}
|
|
1260
|
+
/**
|
|
1261
|
+
* A subagent's state as the box sends it in a `subagentUpdate` frame. The Copilot keeps the last
|
|
1262
|
+
* one on the rows of the tool call that spawned the subagent.
|
|
1263
|
+
*/
|
|
1264
|
+
interface AgentSubagentFrame {
|
|
1265
|
+
/** The tool call that spawned the subagent. */
|
|
1266
|
+
toolId: string;
|
|
1267
|
+
subagentId: string;
|
|
1268
|
+
status: string;
|
|
1269
|
+
progress?: string;
|
|
1270
|
+
/** As the box sent it: epoch milliseconds or an ISO string. */
|
|
1271
|
+
startedAt?: number | string;
|
|
1272
|
+
endedAt?: number | string;
|
|
1273
|
+
childThreadId?: string;
|
|
1176
1274
|
}
|
|
1177
1275
|
interface AgentModel {
|
|
1178
1276
|
model: string;
|
|
@@ -1432,7 +1530,7 @@ interface AgentTasksModule {
|
|
|
1432
1530
|
*/
|
|
1433
1531
|
sendInput(id: string, input: AgentTaskInput): Promise<void>;
|
|
1434
1532
|
/** Lists persisted messages. Defaults: page 0, size 50, sort createdAt. */
|
|
1435
|
-
listMessages(id: string, options?:
|
|
1533
|
+
listMessages(id: string, options?: AgentMessageListOptions): Promise<Page<AgentMessage>>;
|
|
1436
1534
|
/**
|
|
1437
1535
|
* Asks the Copilot where the chat is served. It holds the request while the box boots and
|
|
1438
1536
|
* answers with the box socket, or null (202) when it offers none. Optional so hand-written
|
|
@@ -1985,7 +2083,16 @@ interface AgentTaskEventConnection {
|
|
|
1985
2083
|
* its box offers no direct channel. The direct channel itself is Core's.
|
|
1986
2084
|
*/
|
|
1987
2085
|
interface AgentTaskEventSource {
|
|
1988
|
-
open(taskId: string, observer: AgentTaskEventObserver, signal?: AbortSignal, transport?: AgentSessionTransport): Promise<AgentTaskEventConnection>;
|
|
2086
|
+
open(taskId: string, observer: AgentTaskEventObserver, signal?: AbortSignal, transport?: AgentSessionTransport, historyCursor?: AgentHistoryCursor): Promise<AgentTaskEventConnection>;
|
|
2087
|
+
}
|
|
2088
|
+
/**
|
|
2089
|
+
* How far the history the session loaded goes in the box log: the highest `sequence` of the
|
|
2090
|
+
* newest box log it holds. A chat opened with it gets the box's replay from there, so what the
|
|
2091
|
+
* history has not recorded yet still reaches the session.
|
|
2092
|
+
*/
|
|
2093
|
+
interface AgentHistoryCursor {
|
|
2094
|
+
sequence: number;
|
|
2095
|
+
boxLog?: number;
|
|
1989
2096
|
}
|
|
1990
2097
|
type AgentSessionTransport = "auto" | "websocket" | "http";
|
|
1991
2098
|
interface NewAgentTaskSessionOptions {
|
|
@@ -2014,44 +2121,155 @@ type AgentTaskSessionOptions = NewAgentTaskSessionOptions | ExistingAgentTaskSes
|
|
|
2014
2121
|
interface AgentSendOptions {
|
|
2015
2122
|
agentType?: string;
|
|
2016
2123
|
reasoningEffort?: string;
|
|
2124
|
+
/**
|
|
2125
|
+
* With a turn running: with none, T3 decides as its composer does (into the running turn when the
|
|
2126
|
+
* provider takes a steer, in its queue otherwise); `steer` asks for the running turn, which T3
|
|
2127
|
+
* refuses while the turn is not running yet; `queue` waits in T3's queue, held by a Stop until
|
|
2128
|
+
* `resumeQueue`. With no turn running the message starts one.
|
|
2129
|
+
*/
|
|
2130
|
+
mode?: "queue" | "steer";
|
|
2017
2131
|
}
|
|
2018
2132
|
interface AgentSendAndWaitOptions extends AgentSendOptions {
|
|
2019
2133
|
signal?: AbortSignal;
|
|
2020
2134
|
timeoutMs?: number;
|
|
2021
2135
|
}
|
|
2022
2136
|
type AgentTaskSessionStatus = "opening" | "idle" | "streaming" | "cancelled" | "error" | "closed";
|
|
2137
|
+
/**
|
|
2138
|
+
* A message in T3's queue of the chat, as the box reports it: not taken into a turn yet. Any
|
|
2139
|
+
* client's message, not only this session's.
|
|
2140
|
+
*/
|
|
2141
|
+
/** One piece of work the provider keeps going in the background, as T3's roster names it. */
|
|
2142
|
+
interface AgentBackgroundTask {
|
|
2143
|
+
taskId: string;
|
|
2144
|
+
/** `command`, `monitor`, `subagent` or `background_task`, as T3 names it. */
|
|
2145
|
+
kind: string;
|
|
2146
|
+
description?: string;
|
|
2147
|
+
/** The subagent's own thread, when it has one. */
|
|
2148
|
+
childThreadId?: string;
|
|
2149
|
+
}
|
|
2023
2150
|
interface AgentQueueItem extends AgentSendOptions {
|
|
2151
|
+
/** The `clientMessageId` the message went out with: what `send` returned for it. */
|
|
2024
2152
|
id: string;
|
|
2025
2153
|
text: string;
|
|
2154
|
+
/** Epoch milliseconds of the box frame that first reported it in the queue. */
|
|
2026
2155
|
createdAt: number;
|
|
2156
|
+
/** Its place in T3's queue, as the box sent it. */
|
|
2157
|
+
position?: number;
|
|
2158
|
+
/** T3 holds the queue: nothing in it runs until the hold is lifted. */
|
|
2159
|
+
queueHeld?: boolean;
|
|
2160
|
+
/** The `sequence` of the last box frame that reported it. */
|
|
2161
|
+
sequence?: number;
|
|
2162
|
+
/** The message's own turn id: the `id` of its history item. */
|
|
2163
|
+
turnId?: string;
|
|
2164
|
+
}
|
|
2165
|
+
/** T3's subagent statuses; a status this version does not know comes through as it was sent. */
|
|
2166
|
+
type AgentSubagentStatus = "idle" | "pending" | "running" | "waiting" | "completed" | "failed" | "cancelled" | "interrupted";
|
|
2167
|
+
/** The last state the box reported for a subagent of the chat. */
|
|
2168
|
+
interface AgentSubagent {
|
|
2169
|
+
subagentId: string;
|
|
2170
|
+
/** The tool call that spawned it: the `toolId` of its `tool` event. */
|
|
2171
|
+
toolId: string;
|
|
2172
|
+
status: AgentSubagentStatus | (string & {});
|
|
2173
|
+
progress?: string;
|
|
2174
|
+
/** Epoch milliseconds. */
|
|
2175
|
+
startedAt?: number;
|
|
2176
|
+
/** Epoch milliseconds, once it settled. */
|
|
2177
|
+
endedAt?: number;
|
|
2178
|
+
/** T3's thread for the subagent's own conversation, when the provider exposes one. */
|
|
2179
|
+
childThreadId?: string;
|
|
2180
|
+
}
|
|
2181
|
+
/**
|
|
2182
|
+
* Where a piece of the conversation goes, as the box sent it on the frame: the same `sequence` and
|
|
2183
|
+
* `itemId` the history item of that piece carries. Absent when the frame did not carry it.
|
|
2184
|
+
*/
|
|
2185
|
+
interface AgentPieceIdentity {
|
|
2186
|
+
/** The box log's sequence of the frame: the order of the conversation. */
|
|
2187
|
+
sequence?: number;
|
|
2188
|
+
/** T3's id of the item the frame belongs to (one stretch of text, one tool, one subagent). */
|
|
2189
|
+
itemId?: string;
|
|
2190
|
+
/** The `lifecycle.turnId` of the frame. */
|
|
2191
|
+
turnId?: string;
|
|
2027
2192
|
}
|
|
2028
|
-
interface AgentToolEvent {
|
|
2193
|
+
interface AgentToolEvent extends AgentPieceIdentity {
|
|
2029
2194
|
tool: string;
|
|
2030
2195
|
toolId?: string;
|
|
2196
|
+
/** On a tool a subagent called: the `toolId` of the tool call that spawned the subagent. */
|
|
2197
|
+
parentToolId?: string;
|
|
2031
2198
|
phase: "call" | "result";
|
|
2032
2199
|
input?: unknown;
|
|
2033
2200
|
content?: unknown;
|
|
2034
2201
|
timestamp?: number;
|
|
2035
2202
|
}
|
|
2036
|
-
|
|
2203
|
+
/**
|
|
2204
|
+
* What the Copilot recorded from the box for a history item, read as it came. Absent on items
|
|
2205
|
+
* written before the Copilot recorded them, or from a box that did not send them.
|
|
2206
|
+
*/
|
|
2207
|
+
interface AgentTimelineItemIdentity {
|
|
2208
|
+
/** The box log's sequence of the item: the same number its live frame carried. */
|
|
2209
|
+
sequence?: number;
|
|
2210
|
+
/** The box log's sequence of the item's last chunk, only when it came in more than one. */
|
|
2211
|
+
lastSequence?: number;
|
|
2212
|
+
/** Which box log the sequence counts in: a box that came up without the log starts again. */
|
|
2213
|
+
boxLog?: number;
|
|
2214
|
+
/** T3's id of the item: the `itemId` of its live frames. */
|
|
2215
|
+
itemId?: string;
|
|
2216
|
+
/** Only on the item that closed a turn: the reason the box ended it with. */
|
|
2217
|
+
reason?: string;
|
|
2218
|
+
}
|
|
2219
|
+
type AgentTimelineItem = ({
|
|
2037
2220
|
id: string;
|
|
2038
2221
|
kind: "user" | "agent";
|
|
2039
2222
|
text: string;
|
|
2040
2223
|
at: string;
|
|
2041
2224
|
/** Only on the `agent` item that closed a turn, when the Copilot recorded its usage. */
|
|
2042
2225
|
usage?: AgentTurnUsage;
|
|
2043
|
-
|
|
2226
|
+
/** On a `user` item: the id `send` returned for that message. */
|
|
2227
|
+
clientMessageId?: string;
|
|
2228
|
+
/** On a subagent's own text (a `SUBAGENT_TEXT` row): the tool call that spawned it. */
|
|
2229
|
+
parentToolId?: string;
|
|
2230
|
+
} & AgentTimelineItemIdentity) | ({
|
|
2231
|
+
id: string;
|
|
2232
|
+
/** A stretch of the agent's reasoning, as the box sent it: the `thinking` pieces of one item. */
|
|
2233
|
+
kind: "reasoning";
|
|
2234
|
+
text: string;
|
|
2235
|
+
at: string;
|
|
2236
|
+
/** On a subagent's own reasoning: the tool call that spawned the subagent. */
|
|
2237
|
+
parentToolId?: string;
|
|
2238
|
+
} & AgentTimelineItemIdentity) | ({
|
|
2239
|
+
id: string;
|
|
2240
|
+
/**
|
|
2241
|
+
* An approval T3 asked for (`APPROVAL` row) or a question it asked the person mid-turn
|
|
2242
|
+
* (`USER_INPUT_REQUEST` row): the payload of the box's `approval` or `user_input_request`
|
|
2243
|
+
* frame, as it came, the same that reached the session live as a `raw` event.
|
|
2244
|
+
*/
|
|
2245
|
+
kind: "approval";
|
|
2246
|
+
payload: Record<string, unknown>;
|
|
2247
|
+
at: string;
|
|
2248
|
+
parentToolId?: string;
|
|
2249
|
+
} & AgentTimelineItemIdentity) | ({
|
|
2250
|
+
id: string;
|
|
2251
|
+
kind: "userInputRequest";
|
|
2252
|
+
payload: Record<string, unknown>;
|
|
2253
|
+
at: string;
|
|
2254
|
+
parentToolId?: string;
|
|
2255
|
+
} & AgentTimelineItemIdentity) | ({
|
|
2044
2256
|
id: string;
|
|
2045
2257
|
kind: "tool";
|
|
2046
2258
|
tool: AgentToolEvent;
|
|
2047
2259
|
at: string;
|
|
2048
|
-
|
|
2260
|
+
/** On the tool call that spawned a subagent: its last state, as the box's `subagentUpdate`. */
|
|
2261
|
+
subagent?: Partial<AgentSubagentFrame>;
|
|
2262
|
+
} & AgentTimelineItemIdentity);
|
|
2049
2263
|
interface AgentTurnResult {
|
|
2050
2264
|
task: AgentTask;
|
|
2051
2265
|
content: string;
|
|
2052
2266
|
reason: string;
|
|
2053
2267
|
/** What the turn consumed, from the box's `stepFinish`; absent when the turn reported none. */
|
|
2054
2268
|
usage?: AgentTurnUsage;
|
|
2269
|
+
/** The `sequence` of the box's `stepFinish` that ended the turn, when it carried one. */
|
|
2270
|
+
sequence?: number;
|
|
2271
|
+
/** The `lifecycle.turnId` of that `stepFinish`. */
|
|
2272
|
+
turnId?: string;
|
|
2055
2273
|
}
|
|
2056
2274
|
interface AgentTaskSessionEventMap {
|
|
2057
2275
|
statusChange: {
|
|
@@ -2063,15 +2281,31 @@ interface AgentTaskSessionEventMap {
|
|
|
2063
2281
|
taskCreated: {
|
|
2064
2282
|
task: AgentTask;
|
|
2065
2283
|
};
|
|
2066
|
-
|
|
2284
|
+
/**
|
|
2285
|
+
* A turn started. When the box's `stepStart` opened it, the fields it carried: the `text` and
|
|
2286
|
+
* `clientMessageId` of the message whose turn it is, and the frame's `sequence`, `itemId` and
|
|
2287
|
+
* `turnId`. The place to show that question, also when the history does not have it yet.
|
|
2288
|
+
*/
|
|
2289
|
+
turnStart: {
|
|
2290
|
+
text?: string;
|
|
2291
|
+
clientMessageId?: string;
|
|
2292
|
+
} & AgentPieceIdentity;
|
|
2293
|
+
/**
|
|
2294
|
+
* On a subagent's own text, `parentToolId` is the tool call that spawned it. `itemDelta` is the
|
|
2295
|
+
* box frame's piece of its item: the same as `delta` except on the first piece of a text item
|
|
2296
|
+
* that follows another, where `delta` starts with the `"\n\n"` that 0.2.13 joined them with.
|
|
2297
|
+
*/
|
|
2067
2298
|
delta: {
|
|
2068
2299
|
delta: string;
|
|
2069
2300
|
kind: "text" | "thinking";
|
|
2070
|
-
|
|
2301
|
+
parentToolId?: string;
|
|
2302
|
+
itemDelta?: string;
|
|
2303
|
+
} & AgentPieceIdentity;
|
|
2071
2304
|
tool: AgentToolEvent;
|
|
2072
2305
|
workspace: {
|
|
2073
2306
|
payload: unknown;
|
|
2074
2307
|
timestamp: number;
|
|
2308
|
+
sequence?: number;
|
|
2075
2309
|
};
|
|
2076
2310
|
turnEnd: AgentTurnResult;
|
|
2077
2311
|
/**
|
|
@@ -2081,12 +2315,49 @@ interface AgentTaskSessionEventMap {
|
|
|
2081
2315
|
*/
|
|
2082
2316
|
accepted: Record<string, never>;
|
|
2083
2317
|
cancelled: Record<string, never>;
|
|
2318
|
+
/** T3's queue of the chat changed: a message entered it, moved, or left it. */
|
|
2084
2319
|
queueChange: {
|
|
2085
2320
|
queue: readonly AgentQueueItem[];
|
|
2086
2321
|
};
|
|
2322
|
+
/** The provider's background work changed: the roster as T3 shows it waiting. */
|
|
2323
|
+
backgroundTasks: {
|
|
2324
|
+
tasks: readonly AgentBackgroundTask[];
|
|
2325
|
+
};
|
|
2326
|
+
/**
|
|
2327
|
+
* The box took a message into the running turn at this point, with no turn of its own: the
|
|
2328
|
+
* place the app shows it in that turn. The turn's `turnEnd` answers it.
|
|
2329
|
+
*/
|
|
2330
|
+
steered: {
|
|
2331
|
+
text: string;
|
|
2332
|
+
messageId: string;
|
|
2333
|
+
/** The steered message's own turn id: the `id` of its history item. */
|
|
2334
|
+
turnId?: string;
|
|
2335
|
+
sequence?: number;
|
|
2336
|
+
/** The id `send` returned for that message. */
|
|
2337
|
+
clientMessageId?: string;
|
|
2338
|
+
};
|
|
2339
|
+
/** A subagent's status, progress or child thread changed. */
|
|
2340
|
+
subagent: AgentSubagent & {
|
|
2341
|
+
sequence?: number;
|
|
2342
|
+
};
|
|
2343
|
+
/**
|
|
2344
|
+
* Text of a subagent's own thread. It also reaches `delta` and `content`, as in 0.2.13; this
|
|
2345
|
+
* event tells it apart from the parent's.
|
|
2346
|
+
*/
|
|
2347
|
+
subagentDelta: {
|
|
2348
|
+
parentToolId: string;
|
|
2349
|
+
delta: string;
|
|
2350
|
+
kind: "text" | "thinking";
|
|
2351
|
+
itemDelta?: string;
|
|
2352
|
+
} & AgentPieceIdentity;
|
|
2353
|
+
/** A tool a subagent called, in its own thread. It also comes as `tool`, as in 0.2.13. */
|
|
2354
|
+
subagentTool: AgentToolEvent & {
|
|
2355
|
+
parentToolId: string;
|
|
2356
|
+
};
|
|
2087
2357
|
error: {
|
|
2088
2358
|
code?: string;
|
|
2089
2359
|
error: string;
|
|
2360
|
+
sequence?: number;
|
|
2090
2361
|
};
|
|
2091
2362
|
/**
|
|
2092
2363
|
* The subscription window the chat's harness reported during a turn. It comes only on the
|
|
@@ -2106,17 +2377,50 @@ interface AgentTaskSession {
|
|
|
2106
2377
|
readonly status: AgentTaskSessionStatus;
|
|
2107
2378
|
readonly history: readonly AgentTimelineItem[];
|
|
2108
2379
|
readonly content: string;
|
|
2380
|
+
/**
|
|
2381
|
+
* T3's queue of the chat as the box reports it, in the order it reported the messages. A
|
|
2382
|
+
* message leaves when it is taken into a turn, or when it ends before running.
|
|
2383
|
+
*/
|
|
2109
2384
|
readonly queue: readonly AgentQueueItem[];
|
|
2110
|
-
|
|
2385
|
+
/** Every subagent the box reported on this session, in the order first seen. */
|
|
2386
|
+
readonly subagents: readonly AgentSubagent[];
|
|
2387
|
+
/**
|
|
2388
|
+
* Sends the message at once and returns the id it goes out with: the `clientMessageId` the box
|
|
2389
|
+
* echoes when it takes the message (in `steered`, in `queue` and in the history item of the
|
|
2390
|
+
* question). Undefined for a blank prompt, which is not sent.
|
|
2391
|
+
*/
|
|
2392
|
+
send(prompt: string, options?: AgentSendOptions): string | undefined;
|
|
2111
2393
|
sendAndWait(prompt: string, options?: AgentSendAndWaitOptions): Promise<AgentTurnResult>;
|
|
2112
2394
|
cancel(): Promise<void>;
|
|
2113
2395
|
respondApproval(approved: boolean): void;
|
|
2396
|
+
/** Answers T3's `user_input_request` (a `raw` event) on the box's direct channel. */
|
|
2397
|
+
respondUserInput(requestId: string, answers: Record<string, unknown>, attachmentsByQuestionId?: Record<string, unknown>): void;
|
|
2114
2398
|
loadHistory(options?: {
|
|
2115
2399
|
limit?: number;
|
|
2116
2400
|
}): Promise<readonly AgentTimelineItem[]>;
|
|
2401
|
+
/** Changes the text of a queued message (T3's `queued-run.edit`); only the box channel takes it. */
|
|
2117
2402
|
editQueueItem(id: string, text: string): void;
|
|
2403
|
+
/** Takes a message out of the queue (T3's `queued-run.cancel`); only the box channel takes it. */
|
|
2118
2404
|
removeQueueItem(id: string): void;
|
|
2405
|
+
/** Takes every message in `queue` out, one `queued-run.cancel` each. */
|
|
2119
2406
|
clearQueue(): void;
|
|
2407
|
+
/**
|
|
2408
|
+
* Moves a queued message into the running turn (T3's `queued-message.promote-to-steer`); only the
|
|
2409
|
+
* box channel takes it. It leaves `queue` and enters the history where the turn takes it.
|
|
2410
|
+
*/
|
|
2411
|
+
steerQueueItem(id: string): void;
|
|
2412
|
+
/**
|
|
2413
|
+
* Lets the queue go on after a Stop held it (T3's `queue.resume`): T3's Stop ends the running
|
|
2414
|
+
* turn and holds what waits, each item with `queueHeld`. Only the box channel takes it.
|
|
2415
|
+
*/
|
|
2416
|
+
resumeQueue(): void;
|
|
2417
|
+
/**
|
|
2418
|
+
* The work the provider keeps going in the background as T3 shows it waiting (a background
|
|
2419
|
+
* command, a Monitor, a subagent), as the box last reported it. State, not history.
|
|
2420
|
+
*/
|
|
2421
|
+
readonly backgroundTasks: readonly AgentBackgroundTask[];
|
|
2422
|
+
/** Stops one subagent and leaves the turn running (T3's `subagent.stop`). */
|
|
2423
|
+
stopSubagent(subagentId: string): void;
|
|
2120
2424
|
on<K extends keyof AgentTaskSessionEventMap>(event: K, handler: (payload: AgentTaskSessionEventMap[K]) => void): () => void;
|
|
2121
2425
|
close(): void;
|
|
2122
2426
|
}
|
|
@@ -2188,4 +2492,4 @@ declare function expectPage<T extends object>(value: unknown, context: string, e
|
|
|
2188
2492
|
declare function expectLegacyPage<T extends object>(value: unknown, context: string, errors?: SdkCoreErrorFactory, validateItem?: (value: unknown, context: string, errors: SdkCoreErrorFactory) => T): LegacyPage<T>;
|
|
2189
2493
|
declare function expectEmpty(value: unknown, context: string, errors?: SdkCoreErrorFactory): void;
|
|
2190
2494
|
|
|
2191
|
-
export { API_KEY_EXCHANGE_PATH, type AgentBulkDeleteResult, type AgentConnection, type AgentConnectionCreateInput, type AgentConnectionCustomProvider, type AgentConnectionCustomProviderInput, type AgentConnectionsModule, type AgentCredentialOptions, type AgentCredentialScope, type AgentCredentialsModule, type AgentDefinition, type AgentDirectChannelOptions, type AgentFetch, type AgentFetchResponse, type AgentInput, type AgentMessage, type AgentModel, type AgentProviderUsage, type AgentQueueItem, type AgentSendAndWaitOptions, type AgentSendOptions, type AgentSessionTransport, type AgentTask, type AgentTaskChannel, type AgentTaskCreateInput, type AgentTaskEvent, type AgentTaskEventConnection, type AgentTaskEventObserver, type AgentTaskEventSource, type AgentTaskInput, type AgentTaskListOptions, type AgentTaskRuntime, type AgentTaskSession, type AgentTaskSessionEventMap, type AgentTaskSessionManager, type AgentTaskSessionManagerOptions, type AgentTaskSessionOptions, type AgentTaskSessionStatus, AgentTaskTurnError, type AgentTasksModule, type AgentTasksWithSessions, type AgentTimelineItem, type AgentToolEvent, type AgentTurnResult, type AgentTurnUsage, type AgentTurnUsageRequest, type AgentUpdateItem, type AgentWebSocket, type AgentWebSocketConstructor, type AgentsModule, type ApiKeyExchangeCaller, type AppColor, type AppContext, type AppCreateInput, type AppDefinition, type AppDeploy, type AppDomain, type AppFiles, type AppGetOptions, type AppListOptions, type AppMember, type AppPublishOptions, type AppSummary, type AppUpdateInput, type AppVersion, type AppVersionStatus, type AppsModule, type AuthModule, type AuthenticationResult, type BatchExecution, type BatchStatementResult, type BulkUnsubscribeResult, type ColumnInput, type ConnectionConfig, type ConnectionConfigResponse, type ConnectionTestResult, type ContextModule, type ContextModuleDependencies, type CopilotProvider, type CredentialStatus, type CredentialUsage, type CredentialUsageWindow, type CustomQueriesModule, type CustomQueryDefinition, type CustomQueryInput, type CustomQuerySummary, type CustomQueryUpdateInput, type DataSourceBulkItemResult, type DataSourceBulkResult, type DataSourceCreateInput, type DataSourceDbType, type DataSourceDefinition, type DataSourceInstanceType, type DataSourceUpdateInput, type DataSourcesModule, type DdlStatement, type DeviceAuthorization, type DmlStatement, type EmptyFunctionInput, type EntitiesModule, type EntitiesProxy, type EntityListOptions, type EntityListResponse, type EntityTable, type ExistingAgentTaskSessionOptions, type FunctionBulkCreateInput, type FunctionBulkDeleteInput, type FunctionBulkDeleteResult, type FunctionBulkPatchInput, type FunctionBulkPatchItem, type FunctionBulkUpdateItem, type FunctionCreateInput, type FunctionDefinition, type FunctionExecution, type FunctionListOptions, type FunctionPatchInput, type FunctionRuntime, type FunctionSecrets, type FunctionSummary, type FunctionUpdateInput, type FunctionVersion, type FunctionVersionListOptions, type FunctionVisibility, type FunctionsAdminModule, type FunctionsModule, type FunctionsModuleOptions, type HttpMethod, type ImportColumnMapping, type ImportDefinition, type ImportExecution, type ImportExecutionListOptions, type ImportInput, type ImportProcessing, type ImportSchedule, type ImportSource, type ImportSourceResponse, type ImportTarget, type ImportsModule, type IntegrationAdminModule, type IntegrationConnectionStatus, type IntegrationCredentialRule, type IntegrationExecution, type IntegrationFieldSchema, type IntegrationFieldSchemaInput, type IntegrationLoginConfig, type IntegrationModule, type IntegrationProxyMode, type IntegrationRequestConfig, type IntegrationResource, type IntegrationResourceInput, type IntegrationResourceParam, type IntegrationResourceSummary, type IntegrationResourceUpdateInput, type IntegrationResourcesModule, type IntegrationTemplate, type IntegrationTemplateSummary, type IntegrationTemplateType, type IntegrationTemplatesModule, type IntegrationTokenExtraction, type InviteAppUserInput, type InvocationType, type JsonValue, type LegacyPage, type ListTablesOptions, type ListTemplateConfigsOptions, type MembersModule, type MessageAccepted, type MessengerModule, type NewAgentTaskSessionOptions, type OAuthExchangeInput, type OAuthStartResult, type Page, type PageOptions, type PlanPrice, type ProviderCredentialStatus, type ProxyInput, type ProxyResult, type PublicFunctionAsyncResult, type PublicFunctionResult, type PublicFunctionsModule, type QueriesModule, type QueryParamPrimitive, type QueryParamValue, type QueryResult, type SchemaModule, type SchemaScope, type SchemaTables, type SdkCore, SdkCoreConfigurationError, type SdkCoreErrorFactory, type SdkCoreOptions, SdkCoreResponseError, type SdkCoreTransports, type SendEmailInput, type SqlModule, type TableColumn, type TableDefinition, type TableForeignKey, type TemplateConfig, type TemplateConfigBulkItemResult, type TemplateConfigBulkResult, type TemplateConfigCreateInput, type TemplateConfigPage, type TemplateConfigSummary, type TemplateConfigUpdateInput, type Tenant, type TestCredentialsInput, type Transport, type TransportRequestOptions, type User, type UserPlan, type WorkflowDefinition, type WorkflowExecution, type WorkflowInput, type WorkflowSummary, type WorkflowsModule, appAccessTokenPath, createAgentConnectionsModule, createAgentCredentialsModule, createAgentTaskSessionManager, createAgentTasksModule, createAgentsModule, createAppsModule, createAuthModule, createContextModule, createCustomQueriesModule, createDataSourcesModule, createEntitiesModule, createFunctionsAdminModule, createFunctionsModule, createImportsModule, createIntegrationAdminModule, createIntegrationModule, createIntegrationResourcesModule, createIntegrationTemplatesModule, createMembersModule, createMessengerModule, createPublicFunctionsModule, createQueriesModule, createSchemaModule, createSdkCore, createSqlModule, createWorkflowsModule, defaultSdkCoreErrorFactory, encodePathSegment, expectEmpty, expectLegacyPage, expectNullableObject, expectObject, expectObjectArray, expectPage, expectStringArray, isWorkspaceSession, readTokenAppId, readTokenExpiry, resolveApiKeyToken, toAgentTimelineItem, tokenAuthorizesApp, withAgentTaskSessions };
|
|
2495
|
+
export { API_KEY_EXCHANGE_PATH, type AgentBackgroundTask, type AgentBulkDeleteResult, type AgentConnection, type AgentConnectionCreateInput, type AgentConnectionCustomProvider, type AgentConnectionCustomProviderInput, type AgentConnectionsModule, type AgentCredentialOptions, type AgentCredentialScope, type AgentCredentialsModule, type AgentDefinition, type AgentDirectChannelOptions, type AgentFetch, type AgentFetchResponse, type AgentHistoryCursor, type AgentInput, type AgentMessage, type AgentMessageListOptions, type AgentModel, type AgentPieceIdentity, type AgentProviderUsage, type AgentQueueItem, type AgentSendAndWaitOptions, type AgentSendOptions, type AgentSessionTransport, type AgentSubagent, type AgentSubagentFrame, type AgentSubagentStatus, type AgentTask, type AgentTaskChannel, type AgentTaskCreateInput, type AgentTaskEvent, type AgentTaskEventConnection, type AgentTaskEventObserver, type AgentTaskEventSource, type AgentTaskInput, type AgentTaskListOptions, type AgentTaskRuntime, type AgentTaskSession, type AgentTaskSessionEventMap, type AgentTaskSessionManager, type AgentTaskSessionManagerOptions, type AgentTaskSessionOptions, type AgentTaskSessionStatus, AgentTaskTurnError, type AgentTasksModule, type AgentTasksWithSessions, type AgentTimelineItem, type AgentTimelineItemIdentity, type AgentToolEvent, type AgentTurnResult, type AgentTurnUsage, type AgentTurnUsageRequest, type AgentUpdateItem, type AgentWebSocket, type AgentWebSocketConstructor, type AgentsModule, type ApiKeyExchangeCaller, type AppColor, type AppContext, type AppCreateInput, type AppDefinition, type AppDeploy, type AppDomain, type AppFiles, type AppGetOptions, type AppListOptions, type AppMember, type AppPublishOptions, type AppSummary, type AppUpdateInput, type AppVersion, type AppVersionStatus, type AppsModule, type AuthModule, type AuthenticationResult, type BatchExecution, type BatchStatementResult, type BulkUnsubscribeResult, type ColumnInput, type ConnectionConfig, type ConnectionConfigResponse, type ConnectionTestResult, type ContextModule, type ContextModuleDependencies, type CopilotProvider, type CredentialStatus, type CredentialUsage, type CredentialUsageWindow, type CustomQueriesModule, type CustomQueryDefinition, type CustomQueryInput, type CustomQuerySummary, type CustomQueryUpdateInput, type DataSourceBulkItemResult, type DataSourceBulkResult, type DataSourceCreateInput, type DataSourceDbType, type DataSourceDefinition, type DataSourceInstanceType, type DataSourceUpdateInput, type DataSourcesModule, type DdlStatement, type DeviceAuthorization, type DmlStatement, type EmptyFunctionInput, type EntitiesModule, type EntitiesProxy, type EntityListOptions, type EntityListResponse, type EntityTable, type ExistingAgentTaskSessionOptions, type FunctionBulkCreateInput, type FunctionBulkDeleteInput, type FunctionBulkDeleteResult, type FunctionBulkPatchInput, type FunctionBulkPatchItem, type FunctionBulkUpdateItem, type FunctionCreateInput, type FunctionDefinition, type FunctionExecution, type FunctionListOptions, type FunctionPatchInput, type FunctionRuntime, type FunctionSecrets, type FunctionSummary, type FunctionUpdateInput, type FunctionVersion, type FunctionVersionListOptions, type FunctionVisibility, type FunctionsAdminModule, type FunctionsModule, type FunctionsModuleOptions, type HttpMethod, type ImportColumnMapping, type ImportDefinition, type ImportExecution, type ImportExecutionListOptions, type ImportInput, type ImportProcessing, type ImportSchedule, type ImportSource, type ImportSourceResponse, type ImportTarget, type ImportsModule, type IntegrationAdminModule, type IntegrationConnectionStatus, type IntegrationCredentialRule, type IntegrationExecution, type IntegrationFieldSchema, type IntegrationFieldSchemaInput, type IntegrationLoginConfig, type IntegrationModule, type IntegrationProxyMode, type IntegrationRequestConfig, type IntegrationResource, type IntegrationResourceInput, type IntegrationResourceParam, type IntegrationResourceSummary, type IntegrationResourceUpdateInput, type IntegrationResourcesModule, type IntegrationTemplate, type IntegrationTemplateSummary, type IntegrationTemplateType, type IntegrationTemplatesModule, type IntegrationTokenExtraction, type InviteAppUserInput, type InvocationType, type JsonValue, type LegacyPage, type ListTablesOptions, type ListTemplateConfigsOptions, type MembersModule, type MessageAccepted, type MessengerModule, type NewAgentTaskSessionOptions, type OAuthExchangeInput, type OAuthStartResult, type Page, type PageOptions, type PlanPrice, type ProviderCredentialStatus, type ProxyInput, type ProxyResult, type PublicFunctionAsyncResult, type PublicFunctionResult, type PublicFunctionsModule, type QueriesModule, type QueryParamPrimitive, type QueryParamValue, type QueryResult, type SchemaModule, type SchemaScope, type SchemaTables, type SdkCore, SdkCoreConfigurationError, type SdkCoreErrorFactory, type SdkCoreOptions, SdkCoreResponseError, type SdkCoreTransports, type SendEmailInput, type SqlModule, type TableColumn, type TableDefinition, type TableForeignKey, type TemplateConfig, type TemplateConfigBulkItemResult, type TemplateConfigBulkResult, type TemplateConfigCreateInput, type TemplateConfigPage, type TemplateConfigSummary, type TemplateConfigUpdateInput, type Tenant, type TestCredentialsInput, type Transport, type TransportRequestOptions, type User, type UserPlan, type WorkflowDefinition, type WorkflowExecution, type WorkflowInput, type WorkflowSummary, type WorkflowsModule, appAccessTokenPath, createAgentConnectionsModule, createAgentCredentialsModule, createAgentTaskSessionManager, createAgentTasksModule, createAgentsModule, createAppsModule, createAuthModule, createContextModule, createCustomQueriesModule, createDataSourcesModule, createEntitiesModule, createFunctionsAdminModule, createFunctionsModule, createImportsModule, createIntegrationAdminModule, createIntegrationModule, createIntegrationResourcesModule, createIntegrationTemplatesModule, createMembersModule, createMessengerModule, createPublicFunctionsModule, createQueriesModule, createSchemaModule, createSdkCore, createSqlModule, createWorkflowsModule, defaultSdkCoreErrorFactory, encodePathSegment, expectEmpty, expectLegacyPage, expectNullableObject, expectObject, expectObjectArray, expectPage, expectStringArray, isWorkspaceSession, readTokenAppId, readTokenExpiry, resolveApiKeyToken, toAgentTimelineItem, tokenAuthorizesApp, withAgentTaskSessions };
|