@frumu/tandem-client 0.3.22 → 0.3.23

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,mBAAmB,mBAAmB,CAAC"}
package/dist/index.js CHANGED
@@ -297,6 +297,13 @@ var TandemClient = class {
297
297
  this.agentTeams = new AgentTeams(req);
298
298
  this.missions = new Missions(req);
299
299
  }
300
+ /**
301
+ * Update the bearer token used for future HTTP and SSE requests.
302
+ */
303
+ setToken(token) {
304
+ this.token = token;
305
+ this.sessions.setToken(token);
306
+ }
300
307
  // ─── Health ───────────────────────────────────────────────────────────────
301
308
  /** Check engine health. Returns `{ ready: true }` when the engine is ready. */
302
309
  async health() {
@@ -404,6 +411,9 @@ var Sessions = class {
404
411
  this.timeoutMs = timeoutMs;
405
412
  this.req = req;
406
413
  }
414
+ setToken(token) {
415
+ this.token = token;
416
+ }
407
417
  /** Create a new session. Returns the session ID. */
408
418
  async create(options = {}) {
409
419
  const payload = {
@@ -587,7 +597,12 @@ var Sessions = class {
587
597
  */
588
598
  async children(sessionId) {
589
599
  const raw = await this.req(`/session/${encodeURIComponent(sessionId)}/children`);
590
- const parsed = parseResponse(SessionListResponseSchema, raw, `/session/${sessionId}/children`, 200);
600
+ const parsed = parseResponse(
601
+ SessionListResponseSchema,
602
+ raw,
603
+ `/session/${sessionId}/children`,
604
+ 200
605
+ );
591
606
  return parsed.sessions;
592
607
  }
593
608
  /**
@@ -756,10 +771,9 @@ var Mcp = class {
756
771
  }
757
772
  /** Re-discover tools from a connected MCP server. */
758
773
  async refresh(name) {
759
- return this.req(
760
- `/mcp/${encodeURIComponent(name)}/refresh`,
761
- { method: "POST" }
762
- );
774
+ return this.req(`/mcp/${encodeURIComponent(name)}/refresh`, {
775
+ method: "POST"
776
+ });
763
777
  }
764
778
  /** Enable or disable an MCP server. */
765
779
  async setEnabled(name, enabled) {
@@ -1093,7 +1107,9 @@ var Automations = class {
1093
1107
  }
1094
1108
  /** List artifacts from an automation run. */
1095
1109
  async listArtifacts(runId) {
1096
- return this.req(`/automations/runs/${encodeURIComponent(runId)}/artifacts`);
1110
+ return this.req(
1111
+ `/automations/runs/${encodeURIComponent(runId)}/artifacts`
1112
+ );
1097
1113
  }
1098
1114
  /** Approve an automation run pending human review. */
1099
1115
  async approveRun(runId, reason) {
@@ -0,0 +1,259 @@
1
+ import { z } from "zod";
2
+ import * as Public from "../public/index.js";
3
+ export declare class TandemValidationError extends Error {
4
+ readonly endpoint: string;
5
+ readonly status: number;
6
+ readonly issues: z.ZodIssue[];
7
+ readonly rawSnippet: string;
8
+ constructor(endpoint: string, status: number, issues: z.ZodIssue[], rawSnippet: string);
9
+ }
10
+ export declare const idNormalizer: z.ZodPipe<z.ZodUnion<[z.ZodString, z.ZodObject<{
11
+ id: z.ZodOptional<z.ZodString>;
12
+ runID: z.ZodOptional<z.ZodString>;
13
+ runId: z.ZodOptional<z.ZodString>;
14
+ run_id: z.ZodOptional<z.ZodString>;
15
+ sessionID: z.ZodOptional<z.ZodString>;
16
+ sessionId: z.ZodOptional<z.ZodString>;
17
+ session_id: z.ZodOptional<z.ZodString>;
18
+ missionID: z.ZodOptional<z.ZodString>;
19
+ missionId: z.ZodOptional<z.ZodString>;
20
+ mission_id: z.ZodOptional<z.ZodString>;
21
+ instanceID: z.ZodOptional<z.ZodString>;
22
+ instanceId: z.ZodOptional<z.ZodString>;
23
+ instance_id: z.ZodOptional<z.ZodString>;
24
+ }, z.core.$strip>]>, z.ZodTransform<string | undefined, string | {
25
+ id?: string | undefined;
26
+ runID?: string | undefined;
27
+ runId?: string | undefined;
28
+ run_id?: string | undefined;
29
+ sessionID?: string | undefined;
30
+ sessionId?: string | undefined;
31
+ session_id?: string | undefined;
32
+ missionID?: string | undefined;
33
+ missionId?: string | undefined;
34
+ mission_id?: string | undefined;
35
+ instanceID?: string | undefined;
36
+ instanceId?: string | undefined;
37
+ instance_id?: string | undefined;
38
+ }>>;
39
+ export declare const jsonFallback: z.ZodPipe<z.ZodAny, z.ZodTransform<string | number | boolean | Public.JsonValue[] | {
40
+ [key: string]: Public.JsonValue;
41
+ } | null, any>>;
42
+ export declare const jsonObjectFallback: z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodTransform<Public.JsonObject, Record<string, any>>>;
43
+ export declare const SystemHealthSchema: z.ZodObject<{
44
+ ready: z.ZodOptional<z.ZodBoolean>;
45
+ phase: z.ZodOptional<z.ZodString>;
46
+ }, z.core.$loose>;
47
+ export declare const SessionRecordSchema: z.ZodPipe<z.ZodObject<{
48
+ id: z.ZodString;
49
+ title: z.ZodString;
50
+ created_at_ms: z.ZodOptional<z.ZodNumber>;
51
+ createdAtMs: z.ZodOptional<z.ZodNumber>;
52
+ directory: z.ZodOptional<z.ZodString>;
53
+ workspace_root: z.ZodOptional<z.ZodString>;
54
+ workspaceRoot: z.ZodOptional<z.ZodString>;
55
+ archived: z.ZodOptional<z.ZodBoolean>;
56
+ }, z.core.$loose>, z.ZodTransform<Public.SessionRecord, {
57
+ [x: string]: unknown;
58
+ id: string;
59
+ title: string;
60
+ created_at_ms?: number | undefined;
61
+ createdAtMs?: number | undefined;
62
+ directory?: string | undefined;
63
+ workspace_root?: string | undefined;
64
+ workspaceRoot?: string | undefined;
65
+ archived?: boolean | undefined;
66
+ }>>;
67
+ export declare const SessionListResponseSchema: z.ZodObject<{
68
+ sessions: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodObject<{
69
+ id: z.ZodString;
70
+ title: z.ZodString;
71
+ created_at_ms: z.ZodOptional<z.ZodNumber>;
72
+ createdAtMs: z.ZodOptional<z.ZodNumber>;
73
+ directory: z.ZodOptional<z.ZodString>;
74
+ workspace_root: z.ZodOptional<z.ZodString>;
75
+ workspaceRoot: z.ZodOptional<z.ZodString>;
76
+ archived: z.ZodOptional<z.ZodBoolean>;
77
+ }, z.core.$loose>, z.ZodTransform<Public.SessionRecord, {
78
+ [x: string]: unknown;
79
+ id: string;
80
+ title: string;
81
+ created_at_ms?: number | undefined;
82
+ createdAtMs?: number | undefined;
83
+ directory?: string | undefined;
84
+ workspace_root?: string | undefined;
85
+ workspaceRoot?: string | undefined;
86
+ archived?: boolean | undefined;
87
+ }>>>>>;
88
+ count: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
89
+ }, z.core.$loose>;
90
+ export declare const SessionRunStateResponseSchema: z.ZodPipe<z.ZodObject<{
91
+ active: z.ZodOptional<z.ZodNullable<z.ZodObject<{
92
+ runID: z.ZodOptional<z.ZodString>;
93
+ runId: z.ZodOptional<z.ZodString>;
94
+ run_id: z.ZodOptional<z.ZodString>;
95
+ attachEventStream: z.ZodOptional<z.ZodString>;
96
+ }, z.core.$loose>>>;
97
+ }, z.core.$loose>, z.ZodTransform<Public.SessionRunStateResponse, {
98
+ [x: string]: unknown;
99
+ active?: {
100
+ [x: string]: unknown;
101
+ runID?: string | undefined;
102
+ runId?: string | undefined;
103
+ run_id?: string | undefined;
104
+ attachEventStream?: string | undefined;
105
+ } | null | undefined;
106
+ }>>;
107
+ export declare const RunNowResponseSchema: z.ZodPipe<z.ZodObject<{
108
+ ok: z.ZodOptional<z.ZodBoolean>;
109
+ runID: z.ZodOptional<z.ZodString>;
110
+ runId: z.ZodOptional<z.ZodString>;
111
+ run_id: z.ZodOptional<z.ZodString>;
112
+ status: z.ZodOptional<z.ZodString>;
113
+ }, z.core.$loose>, z.ZodTransform<Public.RunNowResponse, {
114
+ [x: string]: unknown;
115
+ ok?: boolean | undefined;
116
+ runID?: string | undefined;
117
+ runId?: string | undefined;
118
+ run_id?: string | undefined;
119
+ status?: string | undefined;
120
+ }>>;
121
+ export declare const RunRecordSchema: z.ZodPipe<z.ZodObject<{
122
+ id: z.ZodOptional<z.ZodString>;
123
+ runID: z.ZodOptional<z.ZodString>;
124
+ runId: z.ZodOptional<z.ZodString>;
125
+ run_id: z.ZodOptional<z.ZodString>;
126
+ routine_id: z.ZodOptional<z.ZodString>;
127
+ automation_id: z.ZodOptional<z.ZodString>;
128
+ status: z.ZodOptional<z.ZodString>;
129
+ started_at_ms: z.ZodOptional<z.ZodNumber>;
130
+ finished_at_ms: z.ZodOptional<z.ZodNumber>;
131
+ }, z.core.$loose>, z.ZodTransform<Public.RunRecord, {
132
+ [x: string]: unknown;
133
+ id?: string | undefined;
134
+ runID?: string | undefined;
135
+ runId?: string | undefined;
136
+ run_id?: string | undefined;
137
+ routine_id?: string | undefined;
138
+ automation_id?: string | undefined;
139
+ status?: string | undefined;
140
+ started_at_ms?: number | undefined;
141
+ finished_at_ms?: number | undefined;
142
+ }>>;
143
+ export declare const ResourceWriteResponseSchema: z.ZodObject<{
144
+ ok: z.ZodDefault<z.ZodBoolean>;
145
+ rev: z.ZodOptional<z.ZodNumber>;
146
+ }, z.core.$loose>;
147
+ export declare const ResourceRecordSchema: z.ZodPipe<z.ZodObject<{
148
+ key: z.ZodString;
149
+ value: z.ZodAny;
150
+ rev: z.ZodOptional<z.ZodNumber>;
151
+ updated_at_ms: z.ZodOptional<z.ZodNumber>;
152
+ updated_by: z.ZodOptional<z.ZodString>;
153
+ }, z.core.$loose>, z.ZodTransform<Public.ResourceRecord, {
154
+ [x: string]: unknown;
155
+ key: string;
156
+ value: any;
157
+ rev?: number | undefined;
158
+ updated_at_ms?: number | undefined;
159
+ updated_by?: string | undefined;
160
+ }>>;
161
+ export declare const ResourceListResponseSchema: z.ZodObject<{
162
+ items: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodObject<{
163
+ key: z.ZodString;
164
+ value: z.ZodAny;
165
+ rev: z.ZodOptional<z.ZodNumber>;
166
+ updated_at_ms: z.ZodOptional<z.ZodNumber>;
167
+ updated_by: z.ZodOptional<z.ZodString>;
168
+ }, z.core.$loose>, z.ZodTransform<Public.ResourceRecord, {
169
+ [x: string]: unknown;
170
+ key: string;
171
+ value: any;
172
+ rev?: number | undefined;
173
+ updated_at_ms?: number | undefined;
174
+ updated_by?: string | undefined;
175
+ }>>>>>;
176
+ count: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
177
+ }, z.core.$loose>;
178
+ export declare const MemoryItemSchema: z.ZodPipe<z.ZodObject<{
179
+ id: z.ZodOptional<z.ZodString>;
180
+ text: z.ZodString;
181
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
182
+ source: z.ZodOptional<z.ZodString>;
183
+ session_id: z.ZodOptional<z.ZodString>;
184
+ sessionID: z.ZodOptional<z.ZodString>;
185
+ run_id: z.ZodOptional<z.ZodString>;
186
+ runID: z.ZodOptional<z.ZodString>;
187
+ }, z.core.$loose>, z.ZodTransform<Public.MemoryItem, {
188
+ [x: string]: unknown;
189
+ text: string;
190
+ id?: string | undefined;
191
+ tags?: string[] | undefined;
192
+ source?: string | undefined;
193
+ session_id?: string | undefined;
194
+ sessionID?: string | undefined;
195
+ run_id?: string | undefined;
196
+ runID?: string | undefined;
197
+ }>>;
198
+ export declare const MemoryListResponseSchema: z.ZodObject<{
199
+ items: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodObject<{
200
+ id: z.ZodOptional<z.ZodString>;
201
+ text: z.ZodString;
202
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
203
+ source: z.ZodOptional<z.ZodString>;
204
+ session_id: z.ZodOptional<z.ZodString>;
205
+ sessionID: z.ZodOptional<z.ZodString>;
206
+ run_id: z.ZodOptional<z.ZodString>;
207
+ runID: z.ZodOptional<z.ZodString>;
208
+ }, z.core.$loose>, z.ZodTransform<Public.MemoryItem, {
209
+ [x: string]: unknown;
210
+ text: string;
211
+ id?: string | undefined;
212
+ tags?: string[] | undefined;
213
+ source?: string | undefined;
214
+ session_id?: string | undefined;
215
+ sessionID?: string | undefined;
216
+ run_id?: string | undefined;
217
+ runID?: string | undefined;
218
+ }>>>>>;
219
+ count: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
220
+ }, z.core.$loose>;
221
+ export declare const MemorySearchResultSchema: z.ZodObject<{
222
+ id: z.ZodString;
223
+ text: z.ZodString;
224
+ score: z.ZodOptional<z.ZodNumber>;
225
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
226
+ }, z.core.$loose>;
227
+ export declare const MemorySearchResponseSchema: z.ZodObject<{
228
+ results: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
229
+ id: z.ZodString;
230
+ text: z.ZodString;
231
+ score: z.ZodOptional<z.ZodNumber>;
232
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
233
+ }, z.core.$loose>>>>;
234
+ count: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
235
+ }, z.core.$loose>;
236
+ export declare const EngineEventSchema: z.ZodPipe<z.ZodObject<{
237
+ type: z.ZodString;
238
+ properties: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
239
+ sessionID: z.ZodOptional<z.ZodString>;
240
+ session_id: z.ZodOptional<z.ZodString>;
241
+ sessionId: z.ZodOptional<z.ZodString>;
242
+ runID: z.ZodOptional<z.ZodString>;
243
+ run_id: z.ZodOptional<z.ZodString>;
244
+ runId: z.ZodOptional<z.ZodString>;
245
+ timestamp: z.ZodOptional<z.ZodString>;
246
+ }, z.core.$loose>, z.ZodTransform<Public.RunStartedEvent | Public.RunProgressEvent | Public.RunCompletedEvent | Public.RunFailedEvent | Public.ToolCalledEvent | Public.ToolResultEvent | Public.ApprovalRequestedEvent | Public.ApprovalResolvedEvent | Public.RoutineTriggeredEvent | Public.RoutineCompletedEvent | Public.SessionResponseEvent | Public.UnknownEvent, {
247
+ [x: string]: unknown;
248
+ type: string;
249
+ properties: Record<string, any>;
250
+ sessionID?: string | undefined;
251
+ session_id?: string | undefined;
252
+ sessionId?: string | undefined;
253
+ runID?: string | undefined;
254
+ run_id?: string | undefined;
255
+ runId?: string | undefined;
256
+ timestamp?: string | undefined;
257
+ }>>;
258
+ export declare function parseResponse<T>(schema: z.ZodType<T, any, any>, rawData: unknown, endpoint: string, status: number): T;
259
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/normalize/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAE7C,qBAAa,qBAAsB,SAAQ,KAAK;aAExB,QAAQ,EAAE,MAAM;aAChB,MAAM,EAAE,MAAM;aACd,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;aACpB,UAAU,EAAE,MAAM;gBAHlB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,EACpB,UAAU,EAAE,MAAM;CAKzC;AAKD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoBvB,CAAC;AAGH,eAAO,MAAM,YAAY;;eAAoD,CAAC;AAC9E,eAAO,MAAM,kBAAkB,uGAA2E,CAAC;AAI3G,eAAO,MAAM,kBAAkB;;;iBAGoC,CAAC;AAIpE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;GAa7B,CAAC;AAEJ,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;iBAGtB,CAAC;AAEjB,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;GAexC,CAAC;AAIH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;GAS9B,CAAC;AAEJ,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;GAiBzB,CAAC;AAIJ,eAAO,MAAM,2BAA2B;;;iBAGxB,CAAC;AAEjB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;GAU9B,CAAC;AAEJ,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;iBAGvB,CAAC;AAIjB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;GAa1B,CAAC;AAEJ,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;iBAGrB,CAAC;AAEjB,eAAO,MAAM,wBAAwB;;;;;iBAKrB,CAAC;AAEjB,eAAO,MAAM,0BAA0B;;;;;;;;iBAGvB,CAAC;AAIjB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;GAiB5B,CAAC;AAGH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC,CAOtH"}