@meistrari/agent-sdk 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -93,6 +93,33 @@ Multi-turn lifecycle rules:
93
93
  - Treat `completed`, `failed`, and `cancelled` as non-normal follow-up states in SDK consumers.
94
94
  - The SDK v4 path does not use the legacy `/v3/sessions/{sessionId}/continue` endpoint.
95
95
 
96
+ ### Update an agent model
97
+
98
+ ```ts
99
+ const update = await client.updateAgentModel({
100
+ repository: 'support-bot',
101
+ model: 'claude-sonnet-4-5',
102
+ commitMessage: 'Switch support bot model',
103
+ })
104
+
105
+ console.log(update.commitHash)
106
+ ```
107
+
108
+ `updateAgentModel` writes `agent.config.json` on the main branch and lets agent-api
109
+ synchronize provider-specific template files when the model provider changes.
110
+
111
+ ### Fetch a timeline summary
112
+
113
+ ```ts
114
+ const timeline = await client.fetchTimeline(sessionId, { signal })
115
+
116
+ console.log(timeline.status, timeline.metrics, timeline.spans)
117
+ ```
118
+
119
+ `fetchTimeline` returns the persisted v4 timeline summary only: `status`, `metrics`,
120
+ `prompt`, and `spans`. It does not return per-event detail. Consumers that need timeline
121
+ events should consume `streamSession` and merge stream-derived timeline events locally.
122
+
96
123
  ### Resolve Vault references
97
124
 
98
125
  ```ts
@@ -115,5 +142,7 @@ This package mirrors `@meistrari/vault-sdk` and is published as `UNLICENSED`.
115
142
 
116
143
  ## Scope
117
144
 
118
- Focused on sandbox execution: `executeAgent`, `streamSession`, and `resolveReference`.
119
- Agent CRUD, legacy polling, and timelines are intentionally out of scope.
145
+ Focused on sandbox execution and the public v4 consumer paths: `executeAgent`,
146
+ `streamSession`, `updateAgentModel`, `fetchTimeline`, and `resolveReference`. Agent CRUD,
147
+ legacy polling, and the internal sandbox timeline callback are intentionally out of
148
+ scope.
package/dist/index.cjs CHANGED
@@ -55,14 +55,445 @@ ${text}`,
55
55
  }
56
56
  }
57
57
 
58
- const sessionStatusSchema = zod.z.enum([
59
- "pending",
60
- "running",
61
- "completed",
62
- "failed",
63
- "waiting_messages",
64
- "cancelled"
58
+ function getDefaultExportFromCjs (x) {
59
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
60
+ }
61
+
62
+ var openrouterModels = [
63
+ {
64
+ id: "openai/gpt-5.5",
65
+ name: "OpenAI: GPT-5.5",
66
+ context_length: 1050000,
67
+ max_completion_tokens: 128000,
68
+ pricing: {
69
+ prompt_per_million: 5,
70
+ completion_per_million: 30,
71
+ input_cache_read_per_million: 0.5
72
+ },
73
+ supported_parameters: [
74
+ "include_reasoning",
75
+ "max_completion_tokens",
76
+ "max_tokens",
77
+ "reasoning",
78
+ "response_format",
79
+ "seed",
80
+ "structured_outputs",
81
+ "tool_choice",
82
+ "tools"
83
+ ],
84
+ modality: "text+image+file->text",
85
+ description: "GPT-5.5 is OpenAI’s frontier model designed for complex professional workloads, building on GPT-5.4 with stronger reasoning, higher reliability, and improved token efficiency on hard tasks. It features a 1M+ token..."
86
+ },
87
+ {
88
+ id: "openai/gpt-5.4",
89
+ name: "OpenAI: GPT-5.4",
90
+ context_length: 1050000,
91
+ max_completion_tokens: 128000,
92
+ pricing: {
93
+ prompt_per_million: 2.5,
94
+ completion_per_million: 15,
95
+ input_cache_read_per_million: 0.25
96
+ },
97
+ supported_parameters: [
98
+ "include_reasoning",
99
+ "max_completion_tokens",
100
+ "max_tokens",
101
+ "reasoning",
102
+ "response_format",
103
+ "seed",
104
+ "structured_outputs",
105
+ "tool_choice",
106
+ "tools"
107
+ ],
108
+ modality: "text+image+file->text",
109
+ description: "GPT-5.4 is OpenAI’s latest frontier model, unifying the Codex and GPT lines into a single system. It features a 1M+ token context window (922K input, 128K output) with support for..."
110
+ },
111
+ {
112
+ id: "openai/gpt-5.3-codex",
113
+ name: "OpenAI: GPT-5.3-Codex",
114
+ context_length: 400000,
115
+ max_completion_tokens: 128000,
116
+ pricing: {
117
+ prompt_per_million: 1.75,
118
+ completion_per_million: 14,
119
+ input_cache_read_per_million: 0.17
120
+ },
121
+ supported_parameters: [
122
+ "include_reasoning",
123
+ "max_completion_tokens",
124
+ "max_tokens",
125
+ "reasoning",
126
+ "response_format",
127
+ "seed",
128
+ "structured_outputs",
129
+ "tool_choice",
130
+ "tools"
131
+ ],
132
+ modality: "text+image+file->text",
133
+ description: "GPT-5.3-Codex is OpenAI’s most advanced agentic coding model, combining the frontier software engineering performance of GPT-5.2-Codex with the broader reasoning and professional knowledge capabilities of GPT-5.2. It achieves state-of-the-art results"
134
+ },
135
+ {
136
+ id: "google/gemini-3.5-flash",
137
+ name: "Google: Gemini 3.5 Flash",
138
+ context_length: 1048576,
139
+ max_completion_tokens: 65536,
140
+ pricing: {
141
+ prompt_per_million: 1.5,
142
+ completion_per_million: 9,
143
+ input_cache_read_per_million: 0.15
144
+ },
145
+ supported_parameters: [
146
+ "include_reasoning",
147
+ "max_tokens",
148
+ "reasoning",
149
+ "response_format",
150
+ "seed",
151
+ "stop",
152
+ "structured_outputs",
153
+ "temperature",
154
+ "tool_choice",
155
+ "tools",
156
+ "top_p"
157
+ ],
158
+ modality: "text+image+file+audio+video->text",
159
+ description: "Gemini 3.5 Flash is a fast multimodal Google model aimed at coding, reasoning, and parallel agent workflows with a Flash-tier cost profile."
160
+ },
161
+ {
162
+ id: "google/gemini-3-flash-preview",
163
+ name: "Google: Gemini 3 Flash Preview",
164
+ context_length: 1048576,
165
+ max_completion_tokens: 65536,
166
+ pricing: {
167
+ prompt_per_million: 0.5,
168
+ completion_per_million: 3,
169
+ input_cache_read_per_million: 0.05
170
+ },
171
+ supported_parameters: [
172
+ "include_reasoning",
173
+ "max_tokens",
174
+ "reasoning",
175
+ "response_format",
176
+ "seed",
177
+ "stop",
178
+ "structured_outputs",
179
+ "temperature",
180
+ "tool_choice",
181
+ "tools",
182
+ "top_p"
183
+ ],
184
+ modality: "text+image+file+audio+video->text",
185
+ description: "Gemini 3 Flash Preview is a high speed, high value thinking model designed for agentic workflows, multi turn chat, and coding assistance. It delivers near Pro level reasoning and tool..."
186
+ },
187
+ {
188
+ id: "google/gemini-3.1-pro-preview",
189
+ name: "Google: Gemini 3.1 Pro Preview",
190
+ context_length: 1048576,
191
+ max_completion_tokens: 65536,
192
+ pricing: {
193
+ prompt_per_million: 2,
194
+ completion_per_million: 12,
195
+ input_cache_read_per_million: 0.2
196
+ },
197
+ supported_parameters: [
198
+ "include_reasoning",
199
+ "max_tokens",
200
+ "reasoning",
201
+ "response_format",
202
+ "seed",
203
+ "stop",
204
+ "structured_outputs",
205
+ "temperature",
206
+ "tool_choice",
207
+ "tools",
208
+ "top_p"
209
+ ],
210
+ modality: "text+image+file+audio+video->text",
211
+ description: "Gemini 3.1 Pro Preview is Google’s frontier reasoning model, delivering enhanced software engineering performance, improved agentic reliability, and more efficient token usage across complex workflows. Building on the multimodal foundation..."
212
+ },
213
+ {
214
+ id: "xiaomi/mimo-v2-pro",
215
+ name: "Xiaomi: MiMo-V2-Pro",
216
+ context_length: 1048576,
217
+ max_completion_tokens: 131072,
218
+ pricing: {
219
+ prompt_per_million: 1,
220
+ completion_per_million: 3,
221
+ input_cache_read_per_million: 0.2
222
+ },
223
+ supported_parameters: [
224
+ "frequency_penalty",
225
+ "include_reasoning",
226
+ "max_tokens",
227
+ "presence_penalty",
228
+ "reasoning",
229
+ "response_format",
230
+ "stop",
231
+ "temperature",
232
+ "tool_choice",
233
+ "tools",
234
+ "top_p"
235
+ ],
236
+ modality: "text->text",
237
+ description: "MiMo-V2-Pro is Xiaomi's flagship foundation model, featuring over 1T total parameters and a 1M context length, deeply optimized for agentic scenarios. It is highly adaptable to general agent frameworks like..."
238
+ },
239
+ {
240
+ id: "xiaomi/mimo-v2-omni",
241
+ name: "Xiaomi: MiMo-V2-Omni",
242
+ context_length: 262144,
243
+ max_completion_tokens: 65536,
244
+ pricing: {
245
+ prompt_per_million: 0.4,
246
+ completion_per_million: 2,
247
+ input_cache_read_per_million: 0.08
248
+ },
249
+ supported_parameters: [
250
+ "frequency_penalty",
251
+ "include_reasoning",
252
+ "max_tokens",
253
+ "presence_penalty",
254
+ "reasoning",
255
+ "response_format",
256
+ "stop",
257
+ "temperature",
258
+ "tool_choice",
259
+ "tools",
260
+ "top_p"
261
+ ],
262
+ modality: "text+image+audio+video->text",
263
+ description: "MiMo-V2-Omni is a frontier omni-modal model that natively processes image, video, and audio inputs within a unified architecture. It combines strong multimodal perception with agentic capability - visual grounding, multi-step..."
264
+ },
265
+ {
266
+ id: "moonshotai/kimi-k2.5",
267
+ name: "MoonshotAI: Kimi K2.5",
268
+ context_length: 262144,
269
+ max_completion_tokens: 65535,
270
+ pricing: {
271
+ prompt_per_million: 0.38,
272
+ completion_per_million: 1.72,
273
+ input_cache_read_per_million: 0.19
274
+ },
275
+ supported_parameters: [
276
+ "frequency_penalty",
277
+ "include_reasoning",
278
+ "logit_bias",
279
+ "logprobs",
280
+ "max_tokens",
281
+ "min_p",
282
+ "parallel_tool_calls",
283
+ "presence_penalty",
284
+ "reasoning",
285
+ "repetition_penalty",
286
+ "response_format",
287
+ "seed",
288
+ "stop",
289
+ "structured_outputs",
290
+ "temperature",
291
+ "tool_choice",
292
+ "tools",
293
+ "top_k",
294
+ "top_logprobs",
295
+ "top_p"
296
+ ],
297
+ modality: "text+image->text",
298
+ description: "Kimi K2.5 is Moonshot AI's native multimodal model, delivering state-of-the-art visual coding capability and a self-directed agent swarm paradigm. Built on Kimi K2 with continued pretraining over approximately 15T mixed..."
299
+ },
300
+ {
301
+ id: "moonshotai/kimi-k2-thinking",
302
+ name: "MoonshotAI: Kimi K2 Thinking",
303
+ context_length: 262144,
304
+ max_completion_tokens: null,
305
+ pricing: {
306
+ prompt_per_million: 0.6,
307
+ completion_per_million: 2.5
308
+ },
309
+ supported_parameters: [
310
+ "frequency_penalty",
311
+ "include_reasoning",
312
+ "logit_bias",
313
+ "max_tokens",
314
+ "min_p",
315
+ "presence_penalty",
316
+ "reasoning",
317
+ "repetition_penalty",
318
+ "response_format",
319
+ "seed",
320
+ "stop",
321
+ "structured_outputs",
322
+ "temperature",
323
+ "tool_choice",
324
+ "tools",
325
+ "top_k",
326
+ "top_p"
327
+ ],
328
+ modality: "text->text",
329
+ description: "Kimi K2 Thinking is Moonshot AI’s most advanced open reasoning model to date, extending the K2 series into agentic, long-horizon reasoning. Built on the trillion-parameter Mixture-of-Experts (MoE) architecture introduced in..."
330
+ },
331
+ {
332
+ id: "moonshotai/kimi-k2-0905",
333
+ name: "MoonshotAI: Kimi K2 0905",
334
+ context_length: 262144,
335
+ max_completion_tokens: 262144,
336
+ pricing: {
337
+ prompt_per_million: 0.4,
338
+ completion_per_million: 2
339
+ },
340
+ supported_parameters: [
341
+ "frequency_penalty",
342
+ "logit_bias",
343
+ "logprobs",
344
+ "max_tokens",
345
+ "min_p",
346
+ "presence_penalty",
347
+ "repetition_penalty",
348
+ "response_format",
349
+ "seed",
350
+ "stop",
351
+ "structured_outputs",
352
+ "temperature",
353
+ "tool_choice",
354
+ "tools",
355
+ "top_k",
356
+ "top_logprobs",
357
+ "top_p"
358
+ ],
359
+ modality: "text->text",
360
+ description: "Kimi K2 0905 is the September update of [Kimi K2 0711](moonshotai/kimi-k2). It is a large-scale Mixture-of-Experts (MoE) language model developed by Moonshot AI, featuring 1 trillion total parameters with 32..."
361
+ },
362
+ {
363
+ id: "z-ai/glm-5.1",
364
+ name: "Z.ai: GLM 5.1",
365
+ context_length: 202752,
366
+ max_completion_tokens: 131072,
367
+ pricing: {
368
+ prompt_per_million: 1.4,
369
+ completion_per_million: 4.4,
370
+ input_cache_read_per_million: 0.26
371
+ },
372
+ supported_parameters: [
373
+ "frequency_penalty",
374
+ "include_reasoning",
375
+ "logit_bias",
376
+ "logprobs",
377
+ "max_tokens",
378
+ "min_p",
379
+ "presence_penalty",
380
+ "reasoning",
381
+ "repetition_penalty",
382
+ "response_format",
383
+ "seed",
384
+ "stop",
385
+ "structured_outputs",
386
+ "temperature",
387
+ "tool_choice",
388
+ "tools",
389
+ "top_k",
390
+ "top_logprobs",
391
+ "top_p"
392
+ ],
393
+ modality: "text->text",
394
+ description: "GLM-5.1 delivers a major leap in coding capability, with particularly significant gains in handling long-horizon tasks. Unlike previous models built around minute-level interactions, GLM-5.1 can work independently and continuously on..."
395
+ },
396
+ {
397
+ id: "z-ai/glm-5v-turbo",
398
+ name: "Z.ai: GLM 5V Turbo",
399
+ context_length: 202752,
400
+ max_completion_tokens: 131072,
401
+ pricing: {
402
+ prompt_per_million: 1.2,
403
+ completion_per_million: 4,
404
+ input_cache_read_per_million: 0.24
405
+ },
406
+ supported_parameters: [
407
+ "include_reasoning",
408
+ "max_tokens",
409
+ "reasoning",
410
+ "response_format",
411
+ "temperature",
412
+ "tool_choice",
413
+ "tools",
414
+ "top_p"
415
+ ],
416
+ modality: "text+image+video->text",
417
+ description: "GLM-5V-Turbo is Z.ai’s first native multimodal agent foundation model, built for vision-based coding and agent-driven tasks. It natively handles image, video, and text inputs, excels at long-horizon planning, complex coding,..."
418
+ },
419
+ {
420
+ id: "minimax/minimax-m2.7",
421
+ name: "MiniMax: MiniMax M2.7",
422
+ context_length: 204800,
423
+ max_completion_tokens: 131072,
424
+ pricing: {
425
+ prompt_per_million: 0.3,
426
+ completion_per_million: 1.2,
427
+ input_cache_read_per_million: 0.06
428
+ },
429
+ supported_parameters: [
430
+ "include_reasoning",
431
+ "max_tokens",
432
+ "reasoning",
433
+ "response_format",
434
+ "temperature",
435
+ "tool_choice",
436
+ "tools",
437
+ "top_p"
438
+ ],
439
+ modality: "text->text",
440
+ description: "MiniMax-M2.7 is a next-generation large language model designed for autonomous, real-world productivity and continuous improvement. Built to actively participate in its own evolution, M2.7 integrates advanced agentic capabilities through multi-agent."
441
+ },
442
+ {
443
+ id: "minimax/minimax-m2.5",
444
+ name: "MiniMax: MiniMax M2.5",
445
+ context_length: 196608,
446
+ max_completion_tokens: 65536,
447
+ pricing: {
448
+ prompt_per_million: 0.12,
449
+ completion_per_million: 0.99,
450
+ input_cache_read_per_million: 0.06
451
+ },
452
+ supported_parameters: [
453
+ "frequency_penalty",
454
+ "include_reasoning",
455
+ "logit_bias",
456
+ "logprobs",
457
+ "max_tokens",
458
+ "min_p",
459
+ "parallel_tool_calls",
460
+ "presence_penalty",
461
+ "reasoning",
462
+ "reasoning_effort",
463
+ "repetition_penalty",
464
+ "response_format",
465
+ "seed",
466
+ "stop",
467
+ "structured_outputs",
468
+ "temperature",
469
+ "tool_choice",
470
+ "tools",
471
+ "top_k",
472
+ "top_logprobs",
473
+ "top_p"
474
+ ],
475
+ modality: "text->text",
476
+ description: "MiniMax-M2.5 is a SOTA large language model designed for real-world productivity. Trained in a diverse range of complex real-world digital working environments, M2.5 builds upon the coding expertise of M2.1..."
477
+ }
478
+ ];
479
+
480
+ const openrouterCatalog = /*@__PURE__*/getDefaultExportFromCjs(openrouterModels);
481
+
482
+ const nativeAnthropicModelIds = [
483
+ "claude-sonnet-4-5",
484
+ "claude-sonnet-4-6",
485
+ "claude-haiku-4-5",
486
+ "claude-opus-4-6",
487
+ "claude-opus-4-7",
488
+ "claude-opus-4-8"
489
+ ];
490
+ zod.z.enum(nativeAnthropicModelIds);
491
+ const openrouterModelIds = openrouterCatalog.map((entry) => entry.id);
492
+ const modelSchema = zod.z.enum([
493
+ ...nativeAnthropicModelIds,
494
+ ...openrouterModelIds
65
495
  ]);
496
+
66
497
  const vaultReferenceSchema = zod.z.string().regex(/^vault:\/\/\S+$/, "vaultRef must start with vault:// and cannot contain whitespace");
67
498
  const agentInputSchema = zod.z.object({
68
499
  vaultRef: vaultReferenceSchema,
@@ -101,6 +532,42 @@ const executeAgentResponseSchema = zod.z.object({
101
532
  sessionId: zod.z.string().optional(),
102
533
  error: zod.z.string().optional()
103
534
  });
535
+ const repositoryNameSchema = zod.z.string().min(1, "Repository is required").max(200, "Repository must be 200 characters or less").regex(/^[\w.-]+$/, "Repository contains unsupported characters");
536
+ const updateAgentModelRequestSchema = zod.z.object({
537
+ repository: repositoryNameSchema,
538
+ model: modelSchema,
539
+ commitMessage: zod.z.string().max(4096, "Commit message must be 4096 characters or less").optional()
540
+ }).strict();
541
+ const updateAgentModelResponseSchema = zod.z.object({
542
+ success: zod.z.boolean(),
543
+ organizationName: zod.z.string().optional(),
544
+ repository: zod.z.string().optional(),
545
+ branch: zod.z.string().optional(),
546
+ commitHash: zod.z.string().optional(),
547
+ model: modelSchema.optional(),
548
+ providerTemplate: zod.z.string().optional(),
549
+ templateSynced: zod.z.boolean().optional(),
550
+ files: zod.z.array(zod.z.string()).optional(),
551
+ deletedFiles: zod.z.array(zod.z.string()).optional(),
552
+ error: zod.z.string().optional()
553
+ });
554
+
555
+ const sessionStatusSchema = zod.z.enum([
556
+ "pending",
557
+ "running",
558
+ "completed",
559
+ "failed",
560
+ "waiting_messages",
561
+ "cancelled"
562
+ ]);
563
+ const sessionTimelineIdSchema = zod.z.string().min(1, "Session ID is required");
564
+ const sessionTimelineResponseSchema = zod.z.object({
565
+ sessionId: zod.z.string(),
566
+ status: zod.z.string(),
567
+ metrics: zod.z.record(zod.z.string(), zod.z.unknown()),
568
+ prompt: zod.z.record(zod.z.string(), zod.z.unknown()),
569
+ spans: zod.z.array(zod.z.record(zod.z.string(), zod.z.unknown()))
570
+ });
104
571
  const sessionStatusEventSchema = zod.z.object({
105
572
  kind: zod.z.literal("status"),
106
573
  sessionId: zod.z.string(),
@@ -280,6 +747,24 @@ function agentClient(config) {
280
747
  });
281
748
  return executeAgentResponseSchema.parse(await response.json());
282
749
  }
750
+ async function updateAgentModel(input) {
751
+ const { repository, ...body } = updateAgentModelRequestSchema.parse(input);
752
+ const response = await request({
753
+ method: "PUT",
754
+ path: `/v4/agents/${encodeURIComponent(repository)}/model`,
755
+ body
756
+ });
757
+ return updateAgentModelResponseSchema.parse(await response.json());
758
+ }
759
+ async function fetchTimeline(sessionId, options) {
760
+ const parsedSessionId = sessionTimelineIdSchema.parse(sessionId);
761
+ const response = await request({
762
+ method: "GET",
763
+ path: `/v4/sessions/${encodeURIComponent(parsedSessionId)}/timeline`,
764
+ signal: options?.signal
765
+ });
766
+ return sessionTimelineResponseSchema.parse(await response.json());
767
+ }
283
768
  async function streamSession(sessionId, options) {
284
769
  const response = await request({
285
770
  method: "GET",
@@ -316,7 +801,7 @@ function agentClient(config) {
316
801
  return JSON.parse(await vaultFile.content.text());
317
802
  return vaultFile.content.arrayBuffer();
318
803
  }
319
- return { executeAgent, streamSession, resolveReference };
804
+ return { executeAgent, updateAgentModel, fetchTimeline, streamSession, resolveReference };
320
805
  }
321
806
 
322
807
  exports.APIKeyAuthStrategy = APIKeyAuthStrategy;
@@ -329,3 +814,7 @@ exports.executeAgentResponseSchema = executeAgentResponseSchema;
329
814
  exports.parseSessionStream = parseSessionStream;
330
815
  exports.sessionStatusSchema = sessionStatusSchema;
331
816
  exports.sessionStreamEventSchema = sessionStreamEventSchema;
817
+ exports.sessionTimelineIdSchema = sessionTimelineIdSchema;
818
+ exports.sessionTimelineResponseSchema = sessionTimelineResponseSchema;
819
+ exports.updateAgentModelRequestSchema = updateAgentModelRequestSchema;
820
+ exports.updateAgentModelResponseSchema = updateAgentModelResponseSchema;
package/dist/index.d.cts CHANGED
@@ -14,15 +14,6 @@ declare class APIKeyAuthStrategy implements AuthStrategy {
14
14
  getHeaders(): Headers;
15
15
  }
16
16
 
17
- declare const sessionStatusSchema: z.ZodEnum<{
18
- pending: "pending";
19
- running: "running";
20
- completed: "completed";
21
- failed: "failed";
22
- waiting_messages: "waiting_messages";
23
- cancelled: "cancelled";
24
- }>;
25
- type SessionStatus = z.infer<typeof sessionStatusSchema>;
26
17
  declare const agentInputSchema: z.ZodObject<{
27
18
  vaultRef: z.ZodString;
28
19
  filename: z.ZodString;
@@ -50,6 +41,49 @@ declare const executeAgentResponseSchema: z.ZodObject<{
50
41
  error: z.ZodOptional<z.ZodString>;
51
42
  }, z.core.$strip>;
52
43
  type ExecuteAgentResponse = z.infer<typeof executeAgentResponseSchema>;
44
+ declare const updateAgentModelRequestSchema: z.ZodObject<{
45
+ repository: z.ZodString;
46
+ model: z.ZodEnum<{
47
+ [x: string]: string;
48
+ }>;
49
+ commitMessage: z.ZodOptional<z.ZodString>;
50
+ }, z.core.$strict>;
51
+ type UpdateAgentModelRequest = z.infer<typeof updateAgentModelRequestSchema>;
52
+ declare const updateAgentModelResponseSchema: z.ZodObject<{
53
+ success: z.ZodBoolean;
54
+ organizationName: z.ZodOptional<z.ZodString>;
55
+ repository: z.ZodOptional<z.ZodString>;
56
+ branch: z.ZodOptional<z.ZodString>;
57
+ commitHash: z.ZodOptional<z.ZodString>;
58
+ model: z.ZodOptional<z.ZodEnum<{
59
+ [x: string]: string;
60
+ }>>;
61
+ providerTemplate: z.ZodOptional<z.ZodString>;
62
+ templateSynced: z.ZodOptional<z.ZodBoolean>;
63
+ files: z.ZodOptional<z.ZodArray<z.ZodString>>;
64
+ deletedFiles: z.ZodOptional<z.ZodArray<z.ZodString>>;
65
+ error: z.ZodOptional<z.ZodString>;
66
+ }, z.core.$strip>;
67
+ type UpdateAgentModelResponse = z.infer<typeof updateAgentModelResponseSchema>;
68
+
69
+ declare const sessionStatusSchema: z.ZodEnum<{
70
+ pending: "pending";
71
+ running: "running";
72
+ completed: "completed";
73
+ failed: "failed";
74
+ waiting_messages: "waiting_messages";
75
+ cancelled: "cancelled";
76
+ }>;
77
+ type SessionStatus = z.infer<typeof sessionStatusSchema>;
78
+ declare const sessionTimelineIdSchema: z.ZodString;
79
+ declare const sessionTimelineResponseSchema: z.ZodObject<{
80
+ sessionId: z.ZodString;
81
+ status: z.ZodString;
82
+ metrics: z.ZodRecord<z.ZodString, z.ZodUnknown>;
83
+ prompt: z.ZodRecord<z.ZodString, z.ZodUnknown>;
84
+ spans: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
85
+ }, z.core.$strip>;
86
+ type SessionTimelineResponse = z.infer<typeof sessionTimelineResponseSchema>;
53
87
  declare const sessionStreamEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
54
88
  kind: z.ZodLiteral<"status">;
55
89
  sessionId: z.ZodString;
@@ -124,6 +158,9 @@ interface StreamSessionOptions {
124
158
  cursor?: number;
125
159
  signal?: AbortSignal;
126
160
  }
161
+ interface FetchTimelineOptions {
162
+ signal?: AbortSignal;
163
+ }
127
164
  type ResolveReferenceAs = 'bytes' | 'stream' | 'json';
128
165
  interface ResolveReferenceOptions {
129
166
  as?: ResolveReferenceAs;
@@ -132,6 +169,8 @@ interface ResolveReferenceOptions {
132
169
 
133
170
  declare function agentClient(config: AgentClientConfig): {
134
171
  executeAgent: (input: ExecuteAgentRequest) => Promise<ExecuteAgentResponse>;
172
+ updateAgentModel: (input: UpdateAgentModelRequest) => Promise<UpdateAgentModelResponse>;
173
+ fetchTimeline: (sessionId: string, options?: FetchTimelineOptions) => Promise<SessionTimelineResponse>;
135
174
  streamSession: (sessionId: string, options?: StreamSessionOptions) => Promise<AsyncIterable<SessionStreamEvent>>;
136
175
  resolveReference: {
137
176
  (reference: string, options?: {
@@ -161,5 +200,5 @@ declare class FetchError extends Error {
161
200
 
162
201
  declare function parseSessionStream(stream: ReadableStream<Uint8Array>): AsyncIterable<SessionStreamEvent>;
163
202
 
164
- export { APIKeyAuthStrategy, DataTokenAuthStrategy, FetchError, agentClient, agentInputSchema, executeAgentRequestSchema, executeAgentResponseSchema, parseSessionStream, sessionStatusSchema, sessionStreamEventSchema };
165
- export type { AgentClient, AgentClientConfig, AgentInput, AuthStrategy, ExecuteAgentRequest, ExecuteAgentResponse, ResolveReferenceAs, ResolveReferenceOptions, SessionStatus, SessionStreamEvent, StreamSessionOptions };
203
+ export { APIKeyAuthStrategy, DataTokenAuthStrategy, FetchError, agentClient, agentInputSchema, executeAgentRequestSchema, executeAgentResponseSchema, parseSessionStream, sessionStatusSchema, sessionStreamEventSchema, sessionTimelineIdSchema, sessionTimelineResponseSchema, updateAgentModelRequestSchema, updateAgentModelResponseSchema };
204
+ export type { AgentClient, AgentClientConfig, AgentInput, AuthStrategy, ExecuteAgentRequest, ExecuteAgentResponse, FetchTimelineOptions, ResolveReferenceAs, ResolveReferenceOptions, SessionStatus, SessionStreamEvent, SessionTimelineResponse, StreamSessionOptions, UpdateAgentModelRequest, UpdateAgentModelResponse };