@frumu/tandem-client 0.3.22
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 +161 -0
- package/dist/index.cjs +1270 -0
- package/dist/index.d.cts +1185 -0
- package/dist/index.d.ts +1185 -0
- package/dist/index.js +1239 -0
- package/package.json +46 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1185 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
4
|
+
[key: string]: JsonValue;
|
|
5
|
+
};
|
|
6
|
+
type JsonObject = {
|
|
7
|
+
[key: string]: JsonValue;
|
|
8
|
+
};
|
|
9
|
+
type RunStatus = "queued" | "running" | "succeeded" | "failed" | "canceled" | "unknown";
|
|
10
|
+
type RoutineStatus = "enabled" | "disabled" | "paused" | "unknown";
|
|
11
|
+
type ApprovalStatus = "pending" | "approved" | "rejected" | "unknown";
|
|
12
|
+
type ChannelName = "telegram" | "discord" | "slack";
|
|
13
|
+
interface TandemClientOptions {
|
|
14
|
+
baseUrl: string;
|
|
15
|
+
token: string;
|
|
16
|
+
timeoutMs?: number;
|
|
17
|
+
}
|
|
18
|
+
interface SystemHealth {
|
|
19
|
+
ready?: boolean;
|
|
20
|
+
phase?: string;
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
}
|
|
23
|
+
interface CreateSessionOptions {
|
|
24
|
+
title?: string;
|
|
25
|
+
directory?: string;
|
|
26
|
+
permissions?: PermissionRule[];
|
|
27
|
+
provider?: string;
|
|
28
|
+
model?: string;
|
|
29
|
+
}
|
|
30
|
+
interface UpdateSessionOptions {
|
|
31
|
+
title?: string;
|
|
32
|
+
archived?: boolean;
|
|
33
|
+
}
|
|
34
|
+
interface SessionRecord {
|
|
35
|
+
id: string;
|
|
36
|
+
title: string;
|
|
37
|
+
createdAtMs: number;
|
|
38
|
+
directory?: string;
|
|
39
|
+
workspaceRoot?: string;
|
|
40
|
+
archived?: boolean;
|
|
41
|
+
[key: string]: unknown;
|
|
42
|
+
}
|
|
43
|
+
interface SessionListResponse {
|
|
44
|
+
sessions: SessionRecord[];
|
|
45
|
+
count: number;
|
|
46
|
+
}
|
|
47
|
+
interface ListSessionsOptions {
|
|
48
|
+
q?: string;
|
|
49
|
+
page?: number;
|
|
50
|
+
pageSize?: number;
|
|
51
|
+
archived?: boolean;
|
|
52
|
+
scope?: "workspace" | "global";
|
|
53
|
+
workspace?: string;
|
|
54
|
+
}
|
|
55
|
+
interface SessionRunStateResponse {
|
|
56
|
+
active?: {
|
|
57
|
+
runId?: string;
|
|
58
|
+
attachEventStream?: string;
|
|
59
|
+
[key: string]: unknown;
|
|
60
|
+
} | null;
|
|
61
|
+
}
|
|
62
|
+
interface PromptAsyncResult {
|
|
63
|
+
runId: string;
|
|
64
|
+
}
|
|
65
|
+
interface SessionDiff {
|
|
66
|
+
diff?: string;
|
|
67
|
+
files?: string[];
|
|
68
|
+
[key: string]: unknown;
|
|
69
|
+
}
|
|
70
|
+
interface SessionTodo {
|
|
71
|
+
id?: string;
|
|
72
|
+
content: string;
|
|
73
|
+
status?: string;
|
|
74
|
+
[key: string]: unknown;
|
|
75
|
+
}
|
|
76
|
+
interface MessagePart {
|
|
77
|
+
type?: string;
|
|
78
|
+
text?: string;
|
|
79
|
+
}
|
|
80
|
+
interface EngineMessage {
|
|
81
|
+
info?: {
|
|
82
|
+
role?: string;
|
|
83
|
+
};
|
|
84
|
+
parts?: MessagePart[];
|
|
85
|
+
}
|
|
86
|
+
interface PermissionRule {
|
|
87
|
+
permission: string;
|
|
88
|
+
pattern: string;
|
|
89
|
+
action: "allow" | "deny" | "ask";
|
|
90
|
+
}
|
|
91
|
+
interface PermissionRequestRecord {
|
|
92
|
+
id: string;
|
|
93
|
+
permission?: string;
|
|
94
|
+
pattern?: string;
|
|
95
|
+
tool?: string;
|
|
96
|
+
status?: ApprovalStatus | string;
|
|
97
|
+
sessionId?: string;
|
|
98
|
+
[key: string]: unknown;
|
|
99
|
+
}
|
|
100
|
+
interface PermissionRuleRecord {
|
|
101
|
+
id: string;
|
|
102
|
+
permission: string;
|
|
103
|
+
pattern: string;
|
|
104
|
+
action: string;
|
|
105
|
+
[key: string]: unknown;
|
|
106
|
+
}
|
|
107
|
+
interface PermissionSnapshotResponse {
|
|
108
|
+
requests?: PermissionRequestRecord[];
|
|
109
|
+
rules?: PermissionRuleRecord[];
|
|
110
|
+
}
|
|
111
|
+
type PermissionReply = "allow" | "always" | "deny" | "reject" | "once";
|
|
112
|
+
interface QuestionRecord {
|
|
113
|
+
id: string;
|
|
114
|
+
text?: string;
|
|
115
|
+
choices?: string[];
|
|
116
|
+
status?: ApprovalStatus | string;
|
|
117
|
+
sessionId?: string;
|
|
118
|
+
[key: string]: unknown;
|
|
119
|
+
}
|
|
120
|
+
interface QuestionsListResponse {
|
|
121
|
+
questions: QuestionRecord[];
|
|
122
|
+
[key: string]: unknown;
|
|
123
|
+
}
|
|
124
|
+
interface ProviderModelEntry {
|
|
125
|
+
name?: string;
|
|
126
|
+
}
|
|
127
|
+
interface ProviderEntry {
|
|
128
|
+
id: string;
|
|
129
|
+
name?: string;
|
|
130
|
+
models?: Record<string, ProviderModelEntry>;
|
|
131
|
+
}
|
|
132
|
+
interface ProviderCatalog {
|
|
133
|
+
all: ProviderEntry[];
|
|
134
|
+
connected?: string[];
|
|
135
|
+
default?: string | null;
|
|
136
|
+
}
|
|
137
|
+
interface ProviderConfigEntry {
|
|
138
|
+
defaultModel?: string;
|
|
139
|
+
}
|
|
140
|
+
interface ProvidersConfigResponse {
|
|
141
|
+
default?: string | null;
|
|
142
|
+
providers: Record<string, ProviderConfigEntry>;
|
|
143
|
+
}
|
|
144
|
+
interface ChannelConfigEntry {
|
|
145
|
+
hasToken?: boolean;
|
|
146
|
+
allowedUsers?: string[];
|
|
147
|
+
mentionOnly?: boolean;
|
|
148
|
+
guildId?: string;
|
|
149
|
+
channelId?: string;
|
|
150
|
+
}
|
|
151
|
+
interface ChannelsConfigResponse {
|
|
152
|
+
telegram: ChannelConfigEntry;
|
|
153
|
+
discord: ChannelConfigEntry;
|
|
154
|
+
slack: ChannelConfigEntry;
|
|
155
|
+
}
|
|
156
|
+
interface ChannelStatusEntry {
|
|
157
|
+
enabled: boolean;
|
|
158
|
+
connected: boolean;
|
|
159
|
+
lastError?: string | null;
|
|
160
|
+
activeSessions: number;
|
|
161
|
+
meta?: JsonObject;
|
|
162
|
+
}
|
|
163
|
+
interface ChannelsStatusResponse {
|
|
164
|
+
telegram: ChannelStatusEntry;
|
|
165
|
+
discord: ChannelStatusEntry;
|
|
166
|
+
slack: ChannelStatusEntry;
|
|
167
|
+
}
|
|
168
|
+
interface AddMcpServerOptions {
|
|
169
|
+
name: string;
|
|
170
|
+
transport: string;
|
|
171
|
+
headers?: Record<string, string>;
|
|
172
|
+
enabled?: boolean;
|
|
173
|
+
}
|
|
174
|
+
interface MemoryItem {
|
|
175
|
+
id?: string;
|
|
176
|
+
text: string;
|
|
177
|
+
tags?: string[];
|
|
178
|
+
source?: string;
|
|
179
|
+
sessionId?: string;
|
|
180
|
+
runId?: string;
|
|
181
|
+
[key: string]: unknown;
|
|
182
|
+
}
|
|
183
|
+
interface MemoryPutOptions {
|
|
184
|
+
text: string;
|
|
185
|
+
tags?: string[];
|
|
186
|
+
source?: string;
|
|
187
|
+
sessionId?: string;
|
|
188
|
+
runId?: string;
|
|
189
|
+
capability?: string;
|
|
190
|
+
}
|
|
191
|
+
interface MemoryPutResponse {
|
|
192
|
+
id: string;
|
|
193
|
+
ok: boolean;
|
|
194
|
+
[key: string]: unknown;
|
|
195
|
+
}
|
|
196
|
+
interface MemorySearchOptions {
|
|
197
|
+
query: string;
|
|
198
|
+
limit?: number;
|
|
199
|
+
tags?: string[];
|
|
200
|
+
sessionId?: string;
|
|
201
|
+
capability?: string;
|
|
202
|
+
}
|
|
203
|
+
interface MemorySearchResult {
|
|
204
|
+
id: string;
|
|
205
|
+
text: string;
|
|
206
|
+
score?: number;
|
|
207
|
+
tags?: string[];
|
|
208
|
+
[key: string]: unknown;
|
|
209
|
+
}
|
|
210
|
+
interface MemorySearchResponse {
|
|
211
|
+
results: MemorySearchResult[];
|
|
212
|
+
count: number;
|
|
213
|
+
}
|
|
214
|
+
interface MemoryListResponse {
|
|
215
|
+
items: MemoryItem[];
|
|
216
|
+
count: number;
|
|
217
|
+
}
|
|
218
|
+
interface MemoryPromoteOptions {
|
|
219
|
+
id: string;
|
|
220
|
+
capability?: string;
|
|
221
|
+
}
|
|
222
|
+
interface MemoryPromoteResponse {
|
|
223
|
+
ok: boolean;
|
|
224
|
+
id: string;
|
|
225
|
+
[key: string]: unknown;
|
|
226
|
+
}
|
|
227
|
+
interface MemoryAuditEntry {
|
|
228
|
+
id?: string;
|
|
229
|
+
tsMs?: number;
|
|
230
|
+
action?: string;
|
|
231
|
+
runId?: string;
|
|
232
|
+
[key: string]: unknown;
|
|
233
|
+
}
|
|
234
|
+
interface MemoryAuditResponse {
|
|
235
|
+
entries: MemoryAuditEntry[];
|
|
236
|
+
count: number;
|
|
237
|
+
}
|
|
238
|
+
type SkillLocation = "user" | "workspace" | "builtin";
|
|
239
|
+
interface SkillRecord {
|
|
240
|
+
name: string;
|
|
241
|
+
location?: SkillLocation;
|
|
242
|
+
description?: string;
|
|
243
|
+
version?: string;
|
|
244
|
+
[key: string]: unknown;
|
|
245
|
+
}
|
|
246
|
+
interface SkillsListResponse {
|
|
247
|
+
skills: SkillRecord[];
|
|
248
|
+
count: number;
|
|
249
|
+
}
|
|
250
|
+
interface SkillImportOptions {
|
|
251
|
+
content?: string;
|
|
252
|
+
fileOrPath?: string;
|
|
253
|
+
location: SkillLocation;
|
|
254
|
+
namespace?: string;
|
|
255
|
+
conflictPolicy?: "skip" | "overwrite" | "error";
|
|
256
|
+
}
|
|
257
|
+
interface SkillImportResponse {
|
|
258
|
+
ok: boolean;
|
|
259
|
+
imported?: number;
|
|
260
|
+
[key: string]: unknown;
|
|
261
|
+
}
|
|
262
|
+
interface SkillTemplate {
|
|
263
|
+
name: string;
|
|
264
|
+
description?: string;
|
|
265
|
+
[key: string]: unknown;
|
|
266
|
+
}
|
|
267
|
+
interface SkillTemplatesResponse {
|
|
268
|
+
templates: SkillTemplate[];
|
|
269
|
+
count: number;
|
|
270
|
+
}
|
|
271
|
+
interface ResourceRecord {
|
|
272
|
+
key: string;
|
|
273
|
+
value: unknown;
|
|
274
|
+
rev?: number;
|
|
275
|
+
updatedAtMs?: number;
|
|
276
|
+
updatedBy?: string;
|
|
277
|
+
[key: string]: unknown;
|
|
278
|
+
}
|
|
279
|
+
interface ResourceListResponse {
|
|
280
|
+
items: ResourceRecord[];
|
|
281
|
+
count: number;
|
|
282
|
+
}
|
|
283
|
+
interface ResourceWriteOptions {
|
|
284
|
+
key: string;
|
|
285
|
+
value: unknown;
|
|
286
|
+
ifMatchRev?: number;
|
|
287
|
+
updatedBy?: string;
|
|
288
|
+
ttlMs?: number;
|
|
289
|
+
}
|
|
290
|
+
interface ResourceWriteResponse {
|
|
291
|
+
ok: boolean;
|
|
292
|
+
rev?: number;
|
|
293
|
+
[key: string]: unknown;
|
|
294
|
+
}
|
|
295
|
+
type RoutineFamily = "routines" | "automations";
|
|
296
|
+
type RoutineSchedule = {
|
|
297
|
+
type: "cron";
|
|
298
|
+
cron: string;
|
|
299
|
+
} | {
|
|
300
|
+
type: "interval";
|
|
301
|
+
intervalMs: number;
|
|
302
|
+
} | {
|
|
303
|
+
type: "manual";
|
|
304
|
+
} | string;
|
|
305
|
+
interface RoutineRecord {
|
|
306
|
+
id: string;
|
|
307
|
+
name?: string;
|
|
308
|
+
schedule?: RoutineSchedule;
|
|
309
|
+
entrypoint?: string;
|
|
310
|
+
prompt?: string;
|
|
311
|
+
status?: RoutineStatus | string;
|
|
312
|
+
lastRun?: string;
|
|
313
|
+
lastRunAt?: string;
|
|
314
|
+
requiresApproval?: boolean;
|
|
315
|
+
externalIntegrationsAllowed?: boolean;
|
|
316
|
+
[key: string]: unknown;
|
|
317
|
+
}
|
|
318
|
+
interface DefinitionListResponse {
|
|
319
|
+
routines?: RoutineRecord[];
|
|
320
|
+
automations?: RoutineRecord[];
|
|
321
|
+
count: number;
|
|
322
|
+
}
|
|
323
|
+
interface DefinitionCreateResponse {
|
|
324
|
+
routine?: RoutineRecord;
|
|
325
|
+
automation?: RoutineRecord;
|
|
326
|
+
}
|
|
327
|
+
interface CreateRoutineOptions {
|
|
328
|
+
name: string;
|
|
329
|
+
schedule?: RoutineSchedule;
|
|
330
|
+
timezone?: string;
|
|
331
|
+
misfirePolicy?: "skip" | "run_late" | "run_now";
|
|
332
|
+
entrypoint?: string;
|
|
333
|
+
args?: JsonObject;
|
|
334
|
+
allowedTools?: string[];
|
|
335
|
+
outputTargets?: string[];
|
|
336
|
+
requiresApproval?: boolean;
|
|
337
|
+
externalIntegrationsAllowed?: boolean;
|
|
338
|
+
nextFireAtMs?: number;
|
|
339
|
+
[key: string]: unknown;
|
|
340
|
+
}
|
|
341
|
+
interface PatchRoutineOptions {
|
|
342
|
+
name?: string;
|
|
343
|
+
status?: RoutineStatus | string;
|
|
344
|
+
schedule?: RoutineSchedule;
|
|
345
|
+
timezone?: string;
|
|
346
|
+
misfirePolicy?: string;
|
|
347
|
+
entrypoint?: string;
|
|
348
|
+
args?: JsonObject;
|
|
349
|
+
allowedTools?: string[];
|
|
350
|
+
outputTargets?: string[];
|
|
351
|
+
requiresApproval?: boolean;
|
|
352
|
+
externalIntegrationsAllowed?: boolean;
|
|
353
|
+
nextFireAtMs?: number;
|
|
354
|
+
}
|
|
355
|
+
interface AutomationMissionOptions {
|
|
356
|
+
objective: string;
|
|
357
|
+
successCriteria?: string[];
|
|
358
|
+
briefing?: string;
|
|
359
|
+
}
|
|
360
|
+
interface CreateAutomationOptions {
|
|
361
|
+
name: string;
|
|
362
|
+
schedule: RoutineSchedule;
|
|
363
|
+
timezone?: string;
|
|
364
|
+
misfirePolicy?: string;
|
|
365
|
+
mission: AutomationMissionOptions;
|
|
366
|
+
mode?: string;
|
|
367
|
+
policy?: {
|
|
368
|
+
tool?: {
|
|
369
|
+
runAllowlist?: string[];
|
|
370
|
+
externalIntegrationsAllowed?: boolean;
|
|
371
|
+
};
|
|
372
|
+
approval?: {
|
|
373
|
+
requiresApproval?: boolean;
|
|
374
|
+
};
|
|
375
|
+
};
|
|
376
|
+
outputTargets?: string[];
|
|
377
|
+
modelPolicy?: JsonObject;
|
|
378
|
+
nextFireAtMs?: number;
|
|
379
|
+
}
|
|
380
|
+
interface PatchAutomationOptions {
|
|
381
|
+
name?: string;
|
|
382
|
+
status?: RoutineStatus | string;
|
|
383
|
+
schedule?: RoutineSchedule;
|
|
384
|
+
mission?: Partial<AutomationMissionOptions>;
|
|
385
|
+
mode?: string;
|
|
386
|
+
policy?: JsonObject;
|
|
387
|
+
outputTargets?: string[];
|
|
388
|
+
modelPolicy?: JsonObject;
|
|
389
|
+
nextFireAtMs?: number;
|
|
390
|
+
}
|
|
391
|
+
interface RunNowResponse {
|
|
392
|
+
ok?: boolean;
|
|
393
|
+
runId?: string;
|
|
394
|
+
status?: RunStatus | string;
|
|
395
|
+
}
|
|
396
|
+
interface RunsListResponse {
|
|
397
|
+
runs: RunRecord[];
|
|
398
|
+
count: number;
|
|
399
|
+
}
|
|
400
|
+
interface RunRecord {
|
|
401
|
+
id?: string;
|
|
402
|
+
runId?: string;
|
|
403
|
+
routineId?: string;
|
|
404
|
+
automationId?: string;
|
|
405
|
+
status?: RunStatus | string;
|
|
406
|
+
startedAtMs?: number;
|
|
407
|
+
finishedAtMs?: number;
|
|
408
|
+
[key: string]: unknown;
|
|
409
|
+
}
|
|
410
|
+
interface ArtifactRecord {
|
|
411
|
+
artifactId?: string;
|
|
412
|
+
uri: string;
|
|
413
|
+
kind: string;
|
|
414
|
+
label?: string;
|
|
415
|
+
metadata?: JsonObject;
|
|
416
|
+
createdAtMs?: number;
|
|
417
|
+
}
|
|
418
|
+
interface RunArtifactsResponse {
|
|
419
|
+
runId?: string;
|
|
420
|
+
artifacts: ArtifactRecord[];
|
|
421
|
+
count: number;
|
|
422
|
+
}
|
|
423
|
+
interface RoutineHistoryEntry {
|
|
424
|
+
event?: string;
|
|
425
|
+
tsMs?: number;
|
|
426
|
+
status?: RoutineStatus | string;
|
|
427
|
+
[key: string]: unknown;
|
|
428
|
+
}
|
|
429
|
+
interface RoutineHistoryResponse {
|
|
430
|
+
history: RoutineHistoryEntry[];
|
|
431
|
+
count: number;
|
|
432
|
+
}
|
|
433
|
+
interface AgentTeamSpawnInput {
|
|
434
|
+
missionId?: string;
|
|
435
|
+
parentInstanceId?: string;
|
|
436
|
+
templateId?: string;
|
|
437
|
+
role: string;
|
|
438
|
+
source?: string;
|
|
439
|
+
justification: string;
|
|
440
|
+
budgetOverride?: JsonObject;
|
|
441
|
+
}
|
|
442
|
+
interface AgentTeamSpawnResponse {
|
|
443
|
+
ok?: boolean;
|
|
444
|
+
missionId?: string;
|
|
445
|
+
instanceId?: string;
|
|
446
|
+
sessionId?: string;
|
|
447
|
+
runId?: string | null;
|
|
448
|
+
status?: string;
|
|
449
|
+
code?: string;
|
|
450
|
+
error?: string;
|
|
451
|
+
}
|
|
452
|
+
interface AgentTeamTemplate {
|
|
453
|
+
id: string;
|
|
454
|
+
name?: string;
|
|
455
|
+
role?: string;
|
|
456
|
+
[key: string]: unknown;
|
|
457
|
+
}
|
|
458
|
+
interface AgentTeamTemplatesResponse {
|
|
459
|
+
templates: AgentTeamTemplate[];
|
|
460
|
+
count: number;
|
|
461
|
+
}
|
|
462
|
+
interface AgentTeamInstance {
|
|
463
|
+
instanceId?: string;
|
|
464
|
+
missionId?: string;
|
|
465
|
+
role?: string;
|
|
466
|
+
status?: string;
|
|
467
|
+
sessionId?: string;
|
|
468
|
+
[key: string]: unknown;
|
|
469
|
+
}
|
|
470
|
+
interface AgentTeamInstancesResponse {
|
|
471
|
+
instances: AgentTeamInstance[];
|
|
472
|
+
count: number;
|
|
473
|
+
}
|
|
474
|
+
interface AgentTeamMissionsResponse {
|
|
475
|
+
missions: JsonObject[];
|
|
476
|
+
count: number;
|
|
477
|
+
}
|
|
478
|
+
interface AgentTeamSpawnApproval {
|
|
479
|
+
approvalId?: string;
|
|
480
|
+
status?: ApprovalStatus | string;
|
|
481
|
+
[key: string]: unknown;
|
|
482
|
+
}
|
|
483
|
+
interface AgentTeamApprovalsResponse {
|
|
484
|
+
spawnApprovals: AgentTeamSpawnApproval[];
|
|
485
|
+
toolApprovals: JsonObject[];
|
|
486
|
+
count: number;
|
|
487
|
+
}
|
|
488
|
+
interface MissionWorkItem {
|
|
489
|
+
title: string;
|
|
490
|
+
detail?: string;
|
|
491
|
+
assignedAgent?: string;
|
|
492
|
+
}
|
|
493
|
+
interface MissionCreateInput {
|
|
494
|
+
title: string;
|
|
495
|
+
goal: string;
|
|
496
|
+
workItems: MissionWorkItem[];
|
|
497
|
+
}
|
|
498
|
+
interface MissionRecord {
|
|
499
|
+
id?: string;
|
|
500
|
+
title?: string;
|
|
501
|
+
goal?: string;
|
|
502
|
+
status?: string;
|
|
503
|
+
[key: string]: unknown;
|
|
504
|
+
}
|
|
505
|
+
interface MissionCreateResponse {
|
|
506
|
+
mission?: MissionRecord;
|
|
507
|
+
}
|
|
508
|
+
interface MissionListResponse {
|
|
509
|
+
missions: MissionRecord[];
|
|
510
|
+
count: number;
|
|
511
|
+
}
|
|
512
|
+
interface MissionGetResponse {
|
|
513
|
+
mission: MissionRecord;
|
|
514
|
+
}
|
|
515
|
+
interface MissionEventResponse {
|
|
516
|
+
mission?: MissionRecord;
|
|
517
|
+
commands?: unknown[];
|
|
518
|
+
[key: string]: unknown;
|
|
519
|
+
}
|
|
520
|
+
interface ToolSchema {
|
|
521
|
+
name: string;
|
|
522
|
+
description?: string;
|
|
523
|
+
inputSchema?: JsonObject;
|
|
524
|
+
[key: string]: unknown;
|
|
525
|
+
}
|
|
526
|
+
interface ToolExecuteResult {
|
|
527
|
+
output?: string;
|
|
528
|
+
metadata?: JsonObject;
|
|
529
|
+
[key: string]: unknown;
|
|
530
|
+
}
|
|
531
|
+
interface EngineEventBase {
|
|
532
|
+
type: string;
|
|
533
|
+
properties: Record<string, unknown>;
|
|
534
|
+
sessionId?: string;
|
|
535
|
+
runId?: string;
|
|
536
|
+
timestamp?: string;
|
|
537
|
+
[key: string]: unknown;
|
|
538
|
+
}
|
|
539
|
+
interface RunStartedEvent extends EngineEventBase {
|
|
540
|
+
type: "run.started";
|
|
541
|
+
}
|
|
542
|
+
interface RunProgressEvent extends EngineEventBase {
|
|
543
|
+
type: "run.progress";
|
|
544
|
+
}
|
|
545
|
+
interface RunCompletedEvent extends EngineEventBase {
|
|
546
|
+
type: "run.completed";
|
|
547
|
+
}
|
|
548
|
+
interface RunFailedEvent extends EngineEventBase {
|
|
549
|
+
type: "run.failed";
|
|
550
|
+
}
|
|
551
|
+
interface ToolCalledEvent extends EngineEventBase {
|
|
552
|
+
type: "tool.called";
|
|
553
|
+
}
|
|
554
|
+
interface ToolResultEvent extends EngineEventBase {
|
|
555
|
+
type: "tool.result";
|
|
556
|
+
}
|
|
557
|
+
interface ApprovalRequestedEvent extends EngineEventBase {
|
|
558
|
+
type: "approval.requested";
|
|
559
|
+
}
|
|
560
|
+
interface ApprovalResolvedEvent extends EngineEventBase {
|
|
561
|
+
type: "approval.resolved";
|
|
562
|
+
}
|
|
563
|
+
interface RoutineTriggeredEvent extends EngineEventBase {
|
|
564
|
+
type: "routine.triggered";
|
|
565
|
+
}
|
|
566
|
+
interface RoutineCompletedEvent extends EngineEventBase {
|
|
567
|
+
type: "routine.completed";
|
|
568
|
+
}
|
|
569
|
+
interface SessionResponseEvent extends EngineEventBase {
|
|
570
|
+
type: "session.response";
|
|
571
|
+
}
|
|
572
|
+
interface UnknownEvent extends EngineEventBase {
|
|
573
|
+
type: string;
|
|
574
|
+
}
|
|
575
|
+
type KnownEventType = "run.started" | "run.progress" | "run.completed" | "run.failed" | "tool.called" | "tool.result" | "approval.requested" | "approval.resolved" | "routine.triggered" | "routine.completed" | "session.response";
|
|
576
|
+
type EngineEvent = RunStartedEvent | RunProgressEvent | RunCompletedEvent | RunFailedEvent | ToolCalledEvent | ToolResultEvent | ApprovalRequestedEvent | ApprovalResolvedEvent | RoutineTriggeredEvent | RoutineCompletedEvent | SessionResponseEvent | UnknownEvent;
|
|
577
|
+
|
|
578
|
+
/**
|
|
579
|
+
* HTTP client for the Tandem autonomous agent engine.
|
|
580
|
+
*
|
|
581
|
+
* Provides full coverage of the Tandem engine HTTP + SSE API.
|
|
582
|
+
*
|
|
583
|
+
* @example
|
|
584
|
+
* ```typescript
|
|
585
|
+
* import { TandemClient } from "@frumu/tandem-client";
|
|
586
|
+
*
|
|
587
|
+
* const client = new TandemClient({
|
|
588
|
+
* baseUrl: "http://localhost:39731",
|
|
589
|
+
* token: "your-token",
|
|
590
|
+
* });
|
|
591
|
+
*
|
|
592
|
+
* const sessionId = await client.sessions.create({ title: "My agent" });
|
|
593
|
+
* const { runId } = await client.sessions.promptAsync(sessionId, "Summarize README.md");
|
|
594
|
+
*
|
|
595
|
+
* for await (const event of client.stream(sessionId, runId)) {
|
|
596
|
+
* if (event.type === "session.response") {
|
|
597
|
+
* process.stdout.write(String(event.properties.delta ?? ""));
|
|
598
|
+
* }
|
|
599
|
+
* if (event.type === "run.complete" || event.type === "run.failed") break;
|
|
600
|
+
* }
|
|
601
|
+
* ```
|
|
602
|
+
*/
|
|
603
|
+
declare class TandemClient {
|
|
604
|
+
private baseUrl;
|
|
605
|
+
private token;
|
|
606
|
+
private timeoutMs;
|
|
607
|
+
/** Session management */
|
|
608
|
+
readonly sessions: Sessions;
|
|
609
|
+
/** Permission approval flow */
|
|
610
|
+
readonly permissions: Permissions;
|
|
611
|
+
/** AI-generated question approval */
|
|
612
|
+
readonly questions: Questions;
|
|
613
|
+
/** Provider catalog and configuration */
|
|
614
|
+
readonly providers: Providers;
|
|
615
|
+
/** Messaging platform channel integrations */
|
|
616
|
+
readonly channels: Channels;
|
|
617
|
+
/** MCP (Model Context Protocol) server management */
|
|
618
|
+
readonly mcp: Mcp;
|
|
619
|
+
/** Scheduled routines */
|
|
620
|
+
readonly routines: Routines;
|
|
621
|
+
/** Mission-scoped automations */
|
|
622
|
+
readonly automations: Automations;
|
|
623
|
+
/** Semantic memory / vector store */
|
|
624
|
+
readonly memory: Memory;
|
|
625
|
+
/** Agent skill packs */
|
|
626
|
+
readonly skills: Skills;
|
|
627
|
+
/** Key-value resource store */
|
|
628
|
+
readonly resources: Resources;
|
|
629
|
+
/** Agent team orchestration */
|
|
630
|
+
readonly agentTeams: AgentTeams;
|
|
631
|
+
/** Multi-agent mission management */
|
|
632
|
+
readonly missions: Missions;
|
|
633
|
+
constructor(options: TandemClientOptions);
|
|
634
|
+
/** Check engine health. Returns `{ ready: true }` when the engine is ready. */
|
|
635
|
+
health(): Promise<SystemHealth>;
|
|
636
|
+
/** List all tool IDs registered in the engine. */
|
|
637
|
+
listToolIds(): Promise<string[]>;
|
|
638
|
+
/** List all tools with their schemas. */
|
|
639
|
+
listTools(): Promise<ToolSchema[]>;
|
|
640
|
+
/**
|
|
641
|
+
* Execute a built-in tool directly (without a session).
|
|
642
|
+
*
|
|
643
|
+
* @example
|
|
644
|
+
* ```typescript
|
|
645
|
+
* const result = await client.executeTool("workspace_list_files", { path: "." });
|
|
646
|
+
* console.log(result.output);
|
|
647
|
+
* ```
|
|
648
|
+
*/
|
|
649
|
+
executeTool(tool: string, args?: JsonObject): Promise<ToolExecuteResult>;
|
|
650
|
+
/**
|
|
651
|
+
* Stream events from an active run as an async generator.
|
|
652
|
+
*
|
|
653
|
+
* @example
|
|
654
|
+
* ```typescript
|
|
655
|
+
* for await (const event of client.stream(sessionId, runId)) {
|
|
656
|
+
* if (event.type === "session.response") {
|
|
657
|
+
* process.stdout.write(String(event.properties.delta ?? ""));
|
|
658
|
+
* }
|
|
659
|
+
* if (event.type === "run.complete" || event.type === "run.failed") break;
|
|
660
|
+
* }
|
|
661
|
+
* ```
|
|
662
|
+
*/
|
|
663
|
+
stream(sessionId: string, runId?: string, options?: {
|
|
664
|
+
signal?: AbortSignal;
|
|
665
|
+
}): AsyncGenerator<EngineEvent>;
|
|
666
|
+
/**
|
|
667
|
+
* Stream the global event feed (all sessions).
|
|
668
|
+
*/
|
|
669
|
+
globalStream(options?: {
|
|
670
|
+
signal?: AbortSignal;
|
|
671
|
+
}): AsyncGenerator<EngineEvent>;
|
|
672
|
+
/**
|
|
673
|
+
* Pull stored events for a specific run (paginated, not SSE).
|
|
674
|
+
*/
|
|
675
|
+
runEvents(runId: string, options?: {
|
|
676
|
+
sinceSeq?: number;
|
|
677
|
+
tail?: number;
|
|
678
|
+
}): Promise<EngineEvent[]>;
|
|
679
|
+
_request<T>(path: string, init?: RequestInit): Promise<T>;
|
|
680
|
+
}
|
|
681
|
+
declare class Sessions {
|
|
682
|
+
private baseUrl;
|
|
683
|
+
private token;
|
|
684
|
+
private timeoutMs;
|
|
685
|
+
private req;
|
|
686
|
+
constructor(baseUrl: string, token: string, timeoutMs: number, req: TandemClient["_request"]);
|
|
687
|
+
/** Create a new session. Returns the session ID. */
|
|
688
|
+
create(options?: CreateSessionOptions): Promise<string>;
|
|
689
|
+
/** List sessions with optional filtering. */
|
|
690
|
+
list(options?: ListSessionsOptions): Promise<SessionListResponse>;
|
|
691
|
+
/** Get a session by ID. */
|
|
692
|
+
get(sessionId: string): Promise<SessionRecord>;
|
|
693
|
+
/** Update session metadata (title, archive status). */
|
|
694
|
+
update(sessionId: string, options: UpdateSessionOptions): Promise<SessionRecord>;
|
|
695
|
+
/** Archive a session (shorthand for `update(id, { archived: true })`). */
|
|
696
|
+
archive(sessionId: string): Promise<SessionRecord>;
|
|
697
|
+
/** Delete a session permanently. */
|
|
698
|
+
delete(sessionId: string): Promise<void>;
|
|
699
|
+
/** Get all messages in a session. */
|
|
700
|
+
messages(sessionId: string): Promise<EngineMessage[]>;
|
|
701
|
+
/** Get pending TODOs associated with a session. */
|
|
702
|
+
todos(sessionId: string): Promise<SessionTodo[]>;
|
|
703
|
+
/** Get the currently active run for a session (if any). */
|
|
704
|
+
activeRun(sessionId: string): Promise<SessionRunStateResponse>;
|
|
705
|
+
/**
|
|
706
|
+
* Start an async run and return the run ID.
|
|
707
|
+
* Use `client.stream(sessionId, runId)` to receive events.
|
|
708
|
+
*
|
|
709
|
+
* Handles 409 SESSION_RUN_CONFLICT by returning the existing run ID.
|
|
710
|
+
*/
|
|
711
|
+
promptAsync(sessionId: string, prompt: string): Promise<PromptAsyncResult>;
|
|
712
|
+
/**
|
|
713
|
+
* Run a prompt synchronously and return the text reply (blocking).
|
|
714
|
+
* For long tasks prefer `promptAsync` + `stream()`.
|
|
715
|
+
*/
|
|
716
|
+
promptSync(sessionId: string, prompt: string): Promise<string>;
|
|
717
|
+
/**
|
|
718
|
+
* Abort the active run for a session.
|
|
719
|
+
*/
|
|
720
|
+
abort(sessionId: string): Promise<{
|
|
721
|
+
ok: boolean;
|
|
722
|
+
}>;
|
|
723
|
+
/**
|
|
724
|
+
* Cancel the session's active run (alias of abort on some engine versions).
|
|
725
|
+
*/
|
|
726
|
+
cancel(sessionId: string): Promise<{
|
|
727
|
+
ok: boolean;
|
|
728
|
+
}>;
|
|
729
|
+
/**
|
|
730
|
+
* Cancel a specific run within a session.
|
|
731
|
+
*/
|
|
732
|
+
cancelRun(sessionId: string, runId: string): Promise<{
|
|
733
|
+
ok: boolean;
|
|
734
|
+
}>;
|
|
735
|
+
/**
|
|
736
|
+
* Fork a session into a child session (divergent conversation branch).
|
|
737
|
+
*/
|
|
738
|
+
fork(sessionId: string): Promise<SessionRecord>;
|
|
739
|
+
/**
|
|
740
|
+
* Get the workspace diff produced by the session's last run.
|
|
741
|
+
*/
|
|
742
|
+
diff(sessionId: string): Promise<SessionDiff>;
|
|
743
|
+
/**
|
|
744
|
+
* Revert uncommitted workspace changes made by the session.
|
|
745
|
+
*/
|
|
746
|
+
revert(sessionId: string): Promise<{
|
|
747
|
+
ok: boolean;
|
|
748
|
+
}>;
|
|
749
|
+
/**
|
|
750
|
+
* Undo a previous revert (restore session changes).
|
|
751
|
+
*/
|
|
752
|
+
unrevert(sessionId: string): Promise<{
|
|
753
|
+
ok: boolean;
|
|
754
|
+
}>;
|
|
755
|
+
/**
|
|
756
|
+
* Get child sessions forked from this session.
|
|
757
|
+
*/
|
|
758
|
+
children(sessionId: string): Promise<SessionRecord[]>;
|
|
759
|
+
/**
|
|
760
|
+
* Trigger an engine-side summarization of the session's conversation history.
|
|
761
|
+
*/
|
|
762
|
+
summarize(sessionId: string): Promise<{
|
|
763
|
+
ok: boolean;
|
|
764
|
+
summary?: string;
|
|
765
|
+
}>;
|
|
766
|
+
/**
|
|
767
|
+
* Attach a session to a different workspace directory.
|
|
768
|
+
*/
|
|
769
|
+
attach(sessionId: string, targetWorkspace: string): Promise<{
|
|
770
|
+
ok: boolean;
|
|
771
|
+
}>;
|
|
772
|
+
}
|
|
773
|
+
declare class Permissions {
|
|
774
|
+
private req;
|
|
775
|
+
constructor(req: TandemClient["_request"]);
|
|
776
|
+
/** List all pending permission requests and existing rules. */
|
|
777
|
+
list(): Promise<PermissionSnapshotResponse>;
|
|
778
|
+
/** Reply to a permission request. Use "always" to auto-approve future requests. */
|
|
779
|
+
reply(requestId: string, reply: PermissionReply): Promise<{
|
|
780
|
+
ok: boolean;
|
|
781
|
+
}>;
|
|
782
|
+
}
|
|
783
|
+
declare class Questions {
|
|
784
|
+
private req;
|
|
785
|
+
constructor(req: TandemClient["_request"]);
|
|
786
|
+
/** List pending AI-generated questions awaiting user confirmation. */
|
|
787
|
+
list(): Promise<QuestionsListResponse>;
|
|
788
|
+
/** Answer a pending question. */
|
|
789
|
+
reply(questionId: string, answer: string): Promise<{
|
|
790
|
+
ok: boolean;
|
|
791
|
+
}>;
|
|
792
|
+
/** Reject/dismiss a pending question. */
|
|
793
|
+
reject(questionId: string): Promise<{
|
|
794
|
+
ok: boolean;
|
|
795
|
+
}>;
|
|
796
|
+
}
|
|
797
|
+
declare class Providers {
|
|
798
|
+
private req;
|
|
799
|
+
constructor(req: TandemClient["_request"]);
|
|
800
|
+
/** List all available providers and their models. */
|
|
801
|
+
catalog(): Promise<ProviderCatalog>;
|
|
802
|
+
/** Get the current provider/model configuration. */
|
|
803
|
+
config(): Promise<ProvidersConfigResponse>;
|
|
804
|
+
/** Set the default provider and model. */
|
|
805
|
+
setDefaults(providerId: string, modelId: string): Promise<void>;
|
|
806
|
+
/** Store an API key for a provider. */
|
|
807
|
+
setApiKey(providerId: string, apiKey: string): Promise<void>;
|
|
808
|
+
/** Get authentication status for a provider. */
|
|
809
|
+
authStatus(): Promise<JsonObject>;
|
|
810
|
+
}
|
|
811
|
+
declare class Channels {
|
|
812
|
+
private req;
|
|
813
|
+
constructor(req: TandemClient["_request"]);
|
|
814
|
+
/** Get channel configuration (Telegram / Discord / Slack). */
|
|
815
|
+
config(): Promise<ChannelsConfigResponse>;
|
|
816
|
+
/** Get live channel connection status. */
|
|
817
|
+
status(): Promise<ChannelsStatusResponse>;
|
|
818
|
+
/** Configure a channel (bot token, allowed users, etc.). */
|
|
819
|
+
put(channel: ChannelName, payload: JsonObject): Promise<{
|
|
820
|
+
ok: boolean;
|
|
821
|
+
}>;
|
|
822
|
+
/** Remove a channel configuration. */
|
|
823
|
+
delete(channel: ChannelName): Promise<{
|
|
824
|
+
ok: boolean;
|
|
825
|
+
}>;
|
|
826
|
+
}
|
|
827
|
+
declare class Mcp {
|
|
828
|
+
private req;
|
|
829
|
+
constructor(req: TandemClient["_request"]);
|
|
830
|
+
/** List registered MCP servers. */
|
|
831
|
+
list(): Promise<Record<string, unknown>>;
|
|
832
|
+
/** List all discovered MCP tools. */
|
|
833
|
+
listTools(): Promise<unknown[]>;
|
|
834
|
+
/** List all discovered MCP resources. */
|
|
835
|
+
listResources(): Promise<unknown[]>;
|
|
836
|
+
/**
|
|
837
|
+
* Register a new MCP server.
|
|
838
|
+
*
|
|
839
|
+
* @example
|
|
840
|
+
* ```typescript
|
|
841
|
+
* await client.mcp.add({ name: "arcade", transport: "https://mcp.arcade.ai/mcp" });
|
|
842
|
+
* await client.mcp.connect("arcade");
|
|
843
|
+
* ```
|
|
844
|
+
*/
|
|
845
|
+
add(options: AddMcpServerOptions): Promise<{
|
|
846
|
+
ok: boolean;
|
|
847
|
+
}>;
|
|
848
|
+
/** Connect to an MCP server and discover its tools. */
|
|
849
|
+
connect(name: string): Promise<{
|
|
850
|
+
ok: boolean;
|
|
851
|
+
}>;
|
|
852
|
+
/** Disconnect from an MCP server. */
|
|
853
|
+
disconnect(name: string): Promise<{
|
|
854
|
+
ok: boolean;
|
|
855
|
+
}>;
|
|
856
|
+
/** Re-discover tools from a connected MCP server. */
|
|
857
|
+
refresh(name: string): Promise<{
|
|
858
|
+
ok: boolean;
|
|
859
|
+
count?: number;
|
|
860
|
+
}>;
|
|
861
|
+
/** Enable or disable an MCP server. */
|
|
862
|
+
setEnabled(name: string, enabled: boolean): Promise<{
|
|
863
|
+
ok: boolean;
|
|
864
|
+
}>;
|
|
865
|
+
}
|
|
866
|
+
declare class Memory {
|
|
867
|
+
private req;
|
|
868
|
+
constructor(req: TandemClient["_request"]);
|
|
869
|
+
/**
|
|
870
|
+
* Store a memory item.
|
|
871
|
+
*
|
|
872
|
+
* @example
|
|
873
|
+
* ```typescript
|
|
874
|
+
* await client.memory.put({
|
|
875
|
+
* text: "The team uses Rust for backend services.",
|
|
876
|
+
* tags: ["team", "architecture"],
|
|
877
|
+
* });
|
|
878
|
+
* ```
|
|
879
|
+
*/
|
|
880
|
+
put(options: MemoryPutOptions): Promise<MemoryPutResponse>;
|
|
881
|
+
/**
|
|
882
|
+
* Semantic search over stored memories.
|
|
883
|
+
*
|
|
884
|
+
* @example
|
|
885
|
+
* ```typescript
|
|
886
|
+
* const { results } = await client.memory.search({
|
|
887
|
+
* query: "backend technology choices",
|
|
888
|
+
* limit: 5,
|
|
889
|
+
* });
|
|
890
|
+
* ```
|
|
891
|
+
*/
|
|
892
|
+
search(options: MemorySearchOptions): Promise<MemorySearchResponse>;
|
|
893
|
+
/** List stored memory items with optional text filter. */
|
|
894
|
+
list(options?: {
|
|
895
|
+
q?: string;
|
|
896
|
+
limit?: number;
|
|
897
|
+
offset?: number;
|
|
898
|
+
}): Promise<MemoryListResponse>;
|
|
899
|
+
/** Delete a memory item by ID. */
|
|
900
|
+
delete(memoryId: string): Promise<{
|
|
901
|
+
ok: boolean;
|
|
902
|
+
}>;
|
|
903
|
+
/** Promote a transient memory item to persistent storage. */
|
|
904
|
+
promote(options: MemoryPromoteOptions): Promise<MemoryPromoteResponse>;
|
|
905
|
+
/** Retrieve the memory audit log for a run. */
|
|
906
|
+
audit(options?: {
|
|
907
|
+
run_id?: string;
|
|
908
|
+
limit?: number;
|
|
909
|
+
}): Promise<MemoryAuditResponse>;
|
|
910
|
+
}
|
|
911
|
+
declare class Skills {
|
|
912
|
+
private req;
|
|
913
|
+
constructor(req: TandemClient["_request"]);
|
|
914
|
+
/** List installed agent skills. */
|
|
915
|
+
list(location?: SkillLocation): Promise<SkillsListResponse>;
|
|
916
|
+
/** Get details of a specific skill by name. */
|
|
917
|
+
get(name: string): Promise<SkillRecord>;
|
|
918
|
+
/** Import a skill from YAML content or a file path. */
|
|
919
|
+
import(options: SkillImportOptions): Promise<SkillImportResponse>;
|
|
920
|
+
/** Preview a skill import (dry run). */
|
|
921
|
+
preview(options: SkillImportOptions): Promise<SkillImportResponse>;
|
|
922
|
+
/** List available skill templates shipped with the engine. */
|
|
923
|
+
templates(): Promise<SkillTemplatesResponse>;
|
|
924
|
+
}
|
|
925
|
+
declare class Resources {
|
|
926
|
+
private req;
|
|
927
|
+
constructor(req: TandemClient["_request"]);
|
|
928
|
+
/** List stored resource records. */
|
|
929
|
+
list(options?: {
|
|
930
|
+
prefix?: string;
|
|
931
|
+
limit?: number;
|
|
932
|
+
}): Promise<ResourceListResponse>;
|
|
933
|
+
/**
|
|
934
|
+
* Write a resource key-value entry.
|
|
935
|
+
*
|
|
936
|
+
* @example
|
|
937
|
+
* ```typescript
|
|
938
|
+
* await client.resources.write({
|
|
939
|
+
* key: "agent-config/alert-threshold",
|
|
940
|
+
* value: { threshold: 0.95 },
|
|
941
|
+
* });
|
|
942
|
+
* ```
|
|
943
|
+
*/
|
|
944
|
+
write(options: ResourceWriteOptions): Promise<ResourceWriteResponse>;
|
|
945
|
+
/** Delete a resource entry. */
|
|
946
|
+
delete(key: string, options?: {
|
|
947
|
+
if_match_rev?: number;
|
|
948
|
+
}): Promise<{
|
|
949
|
+
ok: boolean;
|
|
950
|
+
}>;
|
|
951
|
+
}
|
|
952
|
+
declare class Routines {
|
|
953
|
+
private req;
|
|
954
|
+
constructor(req: TandemClient["_request"]);
|
|
955
|
+
/** List all scheduled routines. */
|
|
956
|
+
list(): Promise<DefinitionListResponse>;
|
|
957
|
+
/**
|
|
958
|
+
* Create a scheduled routine.
|
|
959
|
+
*
|
|
960
|
+
* @example
|
|
961
|
+
* ```typescript
|
|
962
|
+
* await client.routines.create({
|
|
963
|
+
* name: "Daily digest",
|
|
964
|
+
* schedule: "0 8 * * *",
|
|
965
|
+
* entrypoint: "Summarize activity from the last 24 hours",
|
|
966
|
+
* });
|
|
967
|
+
* ```
|
|
968
|
+
*/
|
|
969
|
+
create(options: CreateRoutineOptions): Promise<DefinitionCreateResponse>;
|
|
970
|
+
/** Update a routine (partial patch). */
|
|
971
|
+
update(id: string, patch: PatchRoutineOptions): Promise<RoutineRecord>;
|
|
972
|
+
/** Delete a routine by ID. */
|
|
973
|
+
delete(id: string): Promise<void>;
|
|
974
|
+
/** Trigger a routine immediately (run now). */
|
|
975
|
+
runNow(id: string): Promise<RunNowResponse>;
|
|
976
|
+
/** List recent runs across all routines. */
|
|
977
|
+
listRuns(options?: {
|
|
978
|
+
routine_id?: string;
|
|
979
|
+
limit?: number;
|
|
980
|
+
}): Promise<RunsListResponse>;
|
|
981
|
+
/** List runs for a specific routine. */
|
|
982
|
+
getRunsForRoutine(id: string, limit?: number): Promise<RunsListResponse>;
|
|
983
|
+
/** Get a specific run record. */
|
|
984
|
+
getRun(runId: string): Promise<RunRecord>;
|
|
985
|
+
/** List artifacts produced by a run. */
|
|
986
|
+
listArtifacts(runId: string): Promise<RunArtifactsResponse>;
|
|
987
|
+
/** Approve a run that requires human approval. */
|
|
988
|
+
approveRun(runId: string, reason?: string): Promise<{
|
|
989
|
+
ok: boolean;
|
|
990
|
+
}>;
|
|
991
|
+
/** Deny a run that requires human approval. */
|
|
992
|
+
denyRun(runId: string, reason?: string): Promise<{
|
|
993
|
+
ok: boolean;
|
|
994
|
+
}>;
|
|
995
|
+
/** Pause an active run. */
|
|
996
|
+
pauseRun(runId: string, reason?: string): Promise<{
|
|
997
|
+
ok: boolean;
|
|
998
|
+
}>;
|
|
999
|
+
/** Resume a paused run. */
|
|
1000
|
+
resumeRun(runId: string, reason?: string): Promise<{
|
|
1001
|
+
ok: boolean;
|
|
1002
|
+
}>;
|
|
1003
|
+
/** Get execution history for a routine. */
|
|
1004
|
+
history(id: string, limit?: number): Promise<RoutineHistoryResponse>;
|
|
1005
|
+
}
|
|
1006
|
+
declare class Automations {
|
|
1007
|
+
private req;
|
|
1008
|
+
constructor(req: TandemClient["_request"]);
|
|
1009
|
+
/** List all automations. */
|
|
1010
|
+
list(): Promise<DefinitionListResponse>;
|
|
1011
|
+
/**
|
|
1012
|
+
* Create a mission-scoped automation.
|
|
1013
|
+
*
|
|
1014
|
+
* @example
|
|
1015
|
+
* ```typescript
|
|
1016
|
+
* await client.automations.create({
|
|
1017
|
+
* name: "Weekly security scan",
|
|
1018
|
+
* schedule: "0 9 * * 1", // every Monday 9am
|
|
1019
|
+
* mission: {
|
|
1020
|
+
* objective: "Run a security audit of the API surface",
|
|
1021
|
+
* success_criteria: ["No critical vulnerabilities", "Report written to reports/security.md"],
|
|
1022
|
+
* },
|
|
1023
|
+
* policy: {
|
|
1024
|
+
* tool: { external_integrations_allowed: false },
|
|
1025
|
+
* approval: { requires_approval: true },
|
|
1026
|
+
* },
|
|
1027
|
+
* });
|
|
1028
|
+
* ```
|
|
1029
|
+
*/
|
|
1030
|
+
create(options: CreateAutomationOptions): Promise<DefinitionCreateResponse>;
|
|
1031
|
+
/** Update an automation (partial patch). */
|
|
1032
|
+
update(id: string, patch: PatchAutomationOptions): Promise<JsonObject>;
|
|
1033
|
+
/** Delete an automation. */
|
|
1034
|
+
delete(id: string): Promise<void>;
|
|
1035
|
+
/** Trigger an automation immediately. */
|
|
1036
|
+
runNow(id: string): Promise<RunNowResponse>;
|
|
1037
|
+
/** List recent runs across all automations. */
|
|
1038
|
+
listRuns(options?: {
|
|
1039
|
+
automation_id?: string;
|
|
1040
|
+
limit?: number;
|
|
1041
|
+
}): Promise<RunsListResponse>;
|
|
1042
|
+
/** List runs for a specific automation. */
|
|
1043
|
+
getRunsForAutomation(id: string, limit?: number): Promise<RunsListResponse>;
|
|
1044
|
+
/** Get a specific automation run record. */
|
|
1045
|
+
getRun(runId: string): Promise<RunRecord>;
|
|
1046
|
+
/** List artifacts from an automation run. */
|
|
1047
|
+
listArtifacts(runId: string): Promise<RunArtifactsResponse>;
|
|
1048
|
+
/** Approve an automation run pending human review. */
|
|
1049
|
+
approveRun(runId: string, reason?: string): Promise<{
|
|
1050
|
+
ok: boolean;
|
|
1051
|
+
}>;
|
|
1052
|
+
/** Deny an automation run pending human review. */
|
|
1053
|
+
denyRun(runId: string, reason?: string): Promise<{
|
|
1054
|
+
ok: boolean;
|
|
1055
|
+
}>;
|
|
1056
|
+
/** Pause an active automation run. */
|
|
1057
|
+
pauseRun(runId: string, reason?: string): Promise<{
|
|
1058
|
+
ok: boolean;
|
|
1059
|
+
}>;
|
|
1060
|
+
/** Resume a paused automation run. */
|
|
1061
|
+
resumeRun(runId: string, reason?: string): Promise<{
|
|
1062
|
+
ok: boolean;
|
|
1063
|
+
}>;
|
|
1064
|
+
/** Get execution history for an automation. */
|
|
1065
|
+
history(id: string, limit?: number): Promise<RoutineHistoryResponse>;
|
|
1066
|
+
}
|
|
1067
|
+
declare class AgentTeams {
|
|
1068
|
+
private req;
|
|
1069
|
+
constructor(req: TandemClient["_request"]);
|
|
1070
|
+
/** List available agent team templates. */
|
|
1071
|
+
listTemplates(): Promise<AgentTeamTemplatesResponse>;
|
|
1072
|
+
/** List agent team instances. */
|
|
1073
|
+
listInstances(options?: {
|
|
1074
|
+
missionID?: string;
|
|
1075
|
+
parentInstanceID?: string;
|
|
1076
|
+
status?: string;
|
|
1077
|
+
}): Promise<AgentTeamInstancesResponse>;
|
|
1078
|
+
/** List missions managed by the agent team orchestrator. */
|
|
1079
|
+
listMissions(): Promise<AgentTeamMissionsResponse>;
|
|
1080
|
+
/** List pending spawn and tool approvals. */
|
|
1081
|
+
listApprovals(): Promise<AgentTeamApprovalsResponse>;
|
|
1082
|
+
/**
|
|
1083
|
+
* Spawn a new agent team instance.
|
|
1084
|
+
*
|
|
1085
|
+
* @example
|
|
1086
|
+
* ```typescript
|
|
1087
|
+
* const result = await client.agentTeams.spawn({
|
|
1088
|
+
* missionID: "mission-123",
|
|
1089
|
+
* role: "builder",
|
|
1090
|
+
* justification: "Implementing feature X as planned",
|
|
1091
|
+
* });
|
|
1092
|
+
* ```
|
|
1093
|
+
*/
|
|
1094
|
+
spawn(input: AgentTeamSpawnInput): Promise<AgentTeamSpawnResponse>;
|
|
1095
|
+
/** Approve a pending agent team spawn request. */
|
|
1096
|
+
approveSpawn(approvalId: string, reason?: string): Promise<{
|
|
1097
|
+
ok: boolean;
|
|
1098
|
+
}>;
|
|
1099
|
+
/** Deny a pending agent team spawn request. */
|
|
1100
|
+
denySpawn(approvalId: string, reason?: string): Promise<{
|
|
1101
|
+
ok: boolean;
|
|
1102
|
+
}>;
|
|
1103
|
+
}
|
|
1104
|
+
declare class Missions {
|
|
1105
|
+
private req;
|
|
1106
|
+
constructor(req: TandemClient["_request"]);
|
|
1107
|
+
/** List all missions. */
|
|
1108
|
+
list(): Promise<MissionListResponse>;
|
|
1109
|
+
/**
|
|
1110
|
+
* Create a new mission with work items.
|
|
1111
|
+
*
|
|
1112
|
+
* @example
|
|
1113
|
+
* ```typescript
|
|
1114
|
+
* const { mission } = await client.missions.create({
|
|
1115
|
+
* title: "Q1 Security Hardening",
|
|
1116
|
+
* goal: "Audit and fix security issues in the API surface",
|
|
1117
|
+
* work_items: [
|
|
1118
|
+
* { title: "Audit auth middleware", assigned_agent: "security-auditor" },
|
|
1119
|
+
* { title: "Review input validation", assigned_agent: "security-auditor" },
|
|
1120
|
+
* ],
|
|
1121
|
+
* });
|
|
1122
|
+
* ```
|
|
1123
|
+
*/
|
|
1124
|
+
create(input: MissionCreateInput): Promise<MissionCreateResponse>;
|
|
1125
|
+
/** Get a mission by ID. */
|
|
1126
|
+
get(missionId: string): Promise<MissionGetResponse>;
|
|
1127
|
+
/** Apply a state event to a mission. */
|
|
1128
|
+
applyEvent(missionId: string, event: JsonObject): Promise<MissionEventResponse>;
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
/**
|
|
1132
|
+
* Filter an async stream to only yield events of a specific type.
|
|
1133
|
+
*
|
|
1134
|
+
* @example
|
|
1135
|
+
* ```typescript
|
|
1136
|
+
* for await (const event of filterByType(client.stream(s, r), "session.response")) {
|
|
1137
|
+
* console.log(event.properties.delta);
|
|
1138
|
+
* }
|
|
1139
|
+
* ```
|
|
1140
|
+
*/
|
|
1141
|
+
declare function filterByType<T extends KnownEventType>(stream: AsyncIterable<EngineEvent>, type: T): AsyncGenerator<Extract<EngineEvent, {
|
|
1142
|
+
type: T;
|
|
1143
|
+
}>>;
|
|
1144
|
+
/**
|
|
1145
|
+
* Consume a stream in the background and trigger a callback for a specific event type.
|
|
1146
|
+
*
|
|
1147
|
+
* @example
|
|
1148
|
+
* ```typescript
|
|
1149
|
+
* on(client.stream(s, r), "run.completed", (event) => console.log(event.runId));
|
|
1150
|
+
* ```
|
|
1151
|
+
*/
|
|
1152
|
+
declare function on<T extends KnownEventType>(stream: AsyncIterable<EngineEvent>, type: T, callback: (event: Extract<EngineEvent, {
|
|
1153
|
+
type: T;
|
|
1154
|
+
}>) => void | Promise<void>): Promise<void>;
|
|
1155
|
+
/**
|
|
1156
|
+
* Streams Server-Sent Events from a Tandem engine SSE endpoint.
|
|
1157
|
+
*
|
|
1158
|
+
* Uses Node's built-in fetch + ReadableStream — no browser globals required.
|
|
1159
|
+
*
|
|
1160
|
+
* @example
|
|
1161
|
+
* ```typescript
|
|
1162
|
+
* for await (const event of streamSse(url, token)) {
|
|
1163
|
+
* if (event.type === "session.response") {
|
|
1164
|
+
* process.stdout.write(String(event.properties.delta ?? ""));
|
|
1165
|
+
* }
|
|
1166
|
+
* if (event.type === "run.complete") break;
|
|
1167
|
+
* }
|
|
1168
|
+
* ```
|
|
1169
|
+
*/
|
|
1170
|
+
declare function streamSse(url: string, token: string, options?: {
|
|
1171
|
+
/** Signal to abort the stream */
|
|
1172
|
+
signal?: AbortSignal;
|
|
1173
|
+
/** Max time to wait for the first byte (ms, default 30000) */
|
|
1174
|
+
connectTimeoutMs?: number;
|
|
1175
|
+
}): AsyncGenerator<EngineEvent>;
|
|
1176
|
+
|
|
1177
|
+
declare class TandemValidationError extends Error {
|
|
1178
|
+
readonly endpoint: string;
|
|
1179
|
+
readonly status: number;
|
|
1180
|
+
readonly issues: z.ZodIssue[];
|
|
1181
|
+
readonly rawSnippet: string;
|
|
1182
|
+
constructor(endpoint: string, status: number, issues: z.ZodIssue[], rawSnippet: string);
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
export { type AddMcpServerOptions, type AgentTeamApprovalsResponse, type AgentTeamInstance, type AgentTeamInstancesResponse, type AgentTeamMissionsResponse, type AgentTeamSpawnApproval, type AgentTeamSpawnInput, type AgentTeamSpawnResponse, type AgentTeamTemplate, type AgentTeamTemplatesResponse, type ApprovalRequestedEvent, type ApprovalResolvedEvent, type ApprovalStatus, type ArtifactRecord, type AutomationMissionOptions, type ChannelConfigEntry, type ChannelName, type ChannelStatusEntry, type ChannelsConfigResponse, type ChannelsStatusResponse, type CreateAutomationOptions, type CreateRoutineOptions, type CreateSessionOptions, type DefinitionCreateResponse, type DefinitionListResponse, type EngineEvent, type EngineEventBase, type EngineMessage, type JsonObject, type JsonValue, type KnownEventType, type ListSessionsOptions, type MemoryAuditEntry, type MemoryAuditResponse, type MemoryItem, type MemoryListResponse, type MemoryPromoteOptions, type MemoryPromoteResponse, type MemoryPutOptions, type MemoryPutResponse, type MemorySearchOptions, type MemorySearchResponse, type MemorySearchResult, type MessagePart, type MissionCreateInput, type MissionCreateResponse, type MissionEventResponse, type MissionGetResponse, type MissionListResponse, type MissionRecord, type MissionWorkItem, type PatchAutomationOptions, type PatchRoutineOptions, type PermissionReply, type PermissionRequestRecord, type PermissionRule, type PermissionRuleRecord, type PermissionSnapshotResponse, type PromptAsyncResult, type ProviderCatalog, type ProviderConfigEntry, type ProviderEntry, type ProviderModelEntry, type ProvidersConfigResponse, type QuestionRecord, type QuestionsListResponse, type ResourceListResponse, type ResourceRecord, type ResourceWriteOptions, type ResourceWriteResponse, type RoutineCompletedEvent, type RoutineFamily, type RoutineHistoryEntry, type RoutineHistoryResponse, type RoutineRecord, type RoutineSchedule, type RoutineStatus, type RoutineTriggeredEvent, type RunArtifactsResponse, type RunCompletedEvent, type RunFailedEvent, type RunNowResponse, type RunProgressEvent, type RunRecord, type RunStartedEvent, type RunStatus, type RunsListResponse, type SessionDiff, type SessionListResponse, type SessionRecord, type SessionResponseEvent, type SessionRunStateResponse, type SessionTodo, type SkillImportOptions, type SkillImportResponse, type SkillLocation, type SkillRecord, type SkillTemplate, type SkillTemplatesResponse, type SkillsListResponse, type SystemHealth, TandemClient, type TandemClientOptions, TandemValidationError, type ToolCalledEvent, type ToolExecuteResult, type ToolResultEvent, type ToolSchema, type UnknownEvent, type UpdateSessionOptions, filterByType, on, streamSse };
|