librechat-data-provider 0.8.522 → 0.8.524

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.
Files changed (57) hide show
  1. package/dist/{data-service-CaB7saTP.mjs → data-service-B-WUVvTH.mjs} +1044 -173
  2. package/dist/data-service-B-WUVvTH.mjs.map +1 -0
  3. package/dist/{data-service-D5kHzBt-.js → data-service-CUG1qdeC.js} +1426 -207
  4. package/dist/data-service-CUG1qdeC.js.map +1 -0
  5. package/dist/index.js +886 -74
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +780 -70
  8. package/dist/index.mjs.map +1 -1
  9. package/dist/react-query/index.js +1 -1
  10. package/dist/react-query/index.mjs +1 -1
  11. package/dist/types/accessPermissions.d.ts +54 -1
  12. package/dist/types/actions.d.ts +1 -1
  13. package/dist/types/agentToolOptions.d.ts +1 -1
  14. package/dist/types/api-endpoints.d.ts +7 -0
  15. package/dist/types/backgroundResults.d.ts +13 -0
  16. package/dist/types/balance.d.ts +4 -0
  17. package/dist/types/bedrock.d.ts +132 -65
  18. package/dist/types/code/approval.d.ts +26 -0
  19. package/dist/types/code/worker.d.ts +10 -0
  20. package/dist/types/code/workspace.d.ts +50 -0
  21. package/dist/types/codeEnvRef.d.ts +5 -0
  22. package/dist/types/config.d.ts +5859 -2469
  23. package/dist/types/data-service.d.ts +22 -12
  24. package/dist/types/errors.d.ts +2 -0
  25. package/dist/types/file-config.d.ts +179 -12
  26. package/dist/types/filters.d.ts +97 -97
  27. package/dist/types/footer.d.ts +20 -0
  28. package/dist/types/generate.d.ts +48 -24
  29. package/dist/types/index.d.ts +11 -0
  30. package/dist/types/keys.d.ts +13 -2
  31. package/dist/types/limits.d.ts +8 -0
  32. package/dist/types/mcp.d.ts +683 -30
  33. package/dist/types/messages.d.ts +25 -1
  34. package/dist/types/models.d.ts +312 -183
  35. package/dist/types/parameterSettings.d.ts +10 -1
  36. package/dist/types/parsers.d.ts +25 -1
  37. package/dist/types/providers.d.ts +1 -0
  38. package/dist/types/resolve-llm-delivery-path.d.ts +161 -0
  39. package/dist/types/schemas.d.ts +771 -457
  40. package/dist/types/svg.d.ts +34 -0
  41. package/dist/types/types/agents.d.ts +257 -2
  42. package/dist/types/types/assistants.d.ts +2 -617
  43. package/dist/types/types/content.d.ts +286 -0
  44. package/dist/types/types/files.d.ts +48 -1
  45. package/dist/types/types/insights.d.ts +9 -0
  46. package/dist/types/types/mutations.d.ts +3 -2
  47. package/dist/types/types/queries.d.ts +8 -1
  48. package/dist/types/types/queuedTurns.d.ts +140 -106
  49. package/dist/types/types/runs.d.ts +33 -5
  50. package/dist/types/types/schedules.d.ts +40 -7
  51. package/dist/types/types/skills.d.ts +43 -0
  52. package/dist/types/types/tools.d.ts +132 -0
  53. package/dist/types/types/traces.d.ts +134 -0
  54. package/dist/types/types.d.ts +72 -2
  55. package/package.json +2 -2
  56. package/dist/data-service-CaB7saTP.mjs.map +0 -1
  57. package/dist/data-service-D5kHzBt-.js.map +0 -1
@@ -1,85 +1,11 @@
1
- import type { OpenAPIV3 } from 'openapi-types';
2
- import type { AssistantsEndpoint, AgentProvider, MemoryScope, SkillsScope } from 'src/schemas';
3
- import type { StatefulCodeEnvironment } from '../stateful-code';
4
- import type { Agents, GraphEdge } from './agents';
5
- import type { ContentTypes } from './runs';
6
- import type { TFile } from './files';
7
- import { ArtifactModes } from 'src/artifacts';
8
- export { STATEFUL_CODE_ENVIRONMENTS, resolveStatefulCodeEnvironment, resolveAllowedStatefulCodeEnvironments, } from '../stateful-code';
9
- export type { StatefulCodeEnvironment } from '../stateful-code';
10
- export type Schema = OpenAPIV3.SchemaObject & {
11
- description?: string;
12
- };
13
- export type Reference = OpenAPIV3.ReferenceObject & {
14
- description?: string;
15
- };
1
+ import type { FunctionTool, ToolResources } from './tools';
2
+ import type { AssistantsEndpoint } from 'src/schemas';
16
3
  export type Metadata = {
17
4
  avatar?: string;
18
5
  author?: string;
19
6
  } & {
20
7
  [key: string]: unknown;
21
8
  };
22
- export declare enum Tools {
23
- execute_code = "execute_code",
24
- code_interpreter = "code_interpreter",
25
- file_search = "file_search",
26
- web_search = "web_search",
27
- retrieval = "retrieval",
28
- function = "function",
29
- memory = "memory",
30
- ui_resources = "ui_resources",
31
- skill = "skill",
32
- read_file = "read_file",
33
- bash_tool = "bash_tool"
34
- }
35
- export declare enum EToolResources {
36
- code_interpreter = "code_interpreter",
37
- execute_code = "execute_code",
38
- file_search = "file_search",
39
- image_edit = "image_edit",
40
- context = "context",
41
- ocr = "ocr"
42
- }
43
- export type Tool = {
44
- [type: string]: Tools;
45
- };
46
- export type FunctionTool = {
47
- type: Tools;
48
- function?: {
49
- description: string;
50
- name: string;
51
- parameters: Record<string, unknown>;
52
- strict?: boolean;
53
- additionalProperties?: boolean;
54
- };
55
- };
56
- /**
57
- * A set of resources that are used by the assistant's tools. The resources are
58
- * specific to the type of tool. For example, the `code_interpreter` tool requires
59
- * a list of file IDs, while the `file_search` tool requires a list of vector store
60
- * IDs.
61
- */
62
- export interface ToolResources {
63
- code_interpreter?: CodeInterpreterResource;
64
- file_search?: FileSearchResource;
65
- }
66
- export interface CodeInterpreterResource {
67
- /**
68
- * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made
69
- * available to the `code_interpreter`` tool. There can be a maximum of 20 files
70
- * associated with the tool.
71
- */
72
- file_ids?: Array<string>;
73
- }
74
- export interface FileSearchResource {
75
- /**
76
- * The ID of the
77
- * [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
78
- * attached to this assistant. There can be a maximum of 1 vector store attached to
79
- * the assistant.
80
- */
81
- vector_store_ids?: Array<string>;
82
- }
83
9
  export type Assistant = {
84
10
  id: string;
85
11
  created_at: number;
@@ -145,363 +71,6 @@ export type File = {
145
71
  object: string;
146
72
  purpose: 'fine-tune' | 'fine-tune-results' | 'assistants' | 'assistants_output';
147
73
  };
148
- export type AgentParameterValue = number | string | null;
149
- export type AgentModelParameters = {
150
- model?: string;
151
- temperature: AgentParameterValue;
152
- maxContextTokens: AgentParameterValue;
153
- max_context_tokens: AgentParameterValue;
154
- max_output_tokens: AgentParameterValue;
155
- top_p: AgentParameterValue;
156
- frequency_penalty: AgentParameterValue;
157
- presence_penalty: AgentParameterValue;
158
- useResponsesApi?: boolean;
159
- };
160
- export interface AgentBaseResource {
161
- /**
162
- * A list of file IDs made available to the tool.
163
- */
164
- file_ids?: Array<string>;
165
- /**
166
- * A list of files already fetched.
167
- */
168
- files?: Array<TFile>;
169
- }
170
- export interface AgentToolResources {
171
- [EToolResources.image_edit]?: AgentBaseResource;
172
- [EToolResources.execute_code]?: ExecuteCodeResource;
173
- [EToolResources.file_search]?: AgentFileResource;
174
- [EToolResources.context]?: AgentBaseResource;
175
- /** @deprecated Use context instead */
176
- [EToolResources.ocr]?: AgentBaseResource;
177
- }
178
- /**
179
- * A resource for the execute_code tool.
180
- * Contains file IDs made available to the tool (max 20 files) and already fetched files.
181
- */
182
- export type ExecuteCodeResource = AgentBaseResource;
183
- export interface AgentFileResource extends AgentBaseResource {
184
- /**
185
- * The ID of the vector store attached to this agent. There
186
- * can be a maximum of 1 vector store attached to the agent.
187
- */
188
- vector_store_ids?: Array<string>;
189
- }
190
- export type SupportContact = {
191
- name?: string;
192
- email?: string;
193
- };
194
- export type AgentOwnerContact = {
195
- name?: string;
196
- };
197
- /**
198
- * Specifies who can invoke a tool.
199
- * - 'direct': LLM can call directly
200
- * - 'code_execution': Only callable via programmatic tool calling (PTC)
201
- */
202
- export type AllowedCaller = 'direct' | 'code_execution';
203
- /**
204
- * Per-tool configuration options stored at the agent level.
205
- * Keyed by tool_id (e.g., "search_mcp_github").
206
- */
207
- export type ToolOptions = {
208
- /**
209
- * If true, the tool uses deferred loading (discoverable via tool search).
210
- * @default false
211
- */
212
- defer_loading?: boolean;
213
- /**
214
- * Specifies who can invoke this tool.
215
- * - 'direct': LLM can call directly (default behavior)
216
- * - 'code_execution': Only callable via PTC sandbox
217
- * @default ['direct']
218
- */
219
- allowed_callers?: AllowedCaller[];
220
- /**
221
- * If true (and the `run_in_background` capability is enabled), the tool's
222
- * schema gains a `run_in_background` boolean so the model can dispatch the
223
- * call detached and poll its result via `check_background_task`.
224
- * @default false
225
- */
226
- run_in_background?: boolean;
227
- /**
228
- * If true (and the `tool_intents` capability is enabled), the tool's schema
229
- * gains an `intent` string as its FIRST property — one model-authored
230
- * sentence per call, rendered as the call's live status label. Native host
231
- * tools default on while the capability is enabled; `false` opts one out.
232
- * @default false
233
- */
234
- describe_intent?: boolean;
235
- };
236
- /**
237
- * Map of tool_id to its configuration options.
238
- * Used to customize tool behavior per agent.
239
- */
240
- export type AgentToolOptions = Record<string, ToolOptions>;
241
- /**
242
- * Configuration for spawning subagents (isolated-context child agents) from an agent.
243
- * When `enabled` is true, the agent gets a subagent-spawn tool that can delegate work
244
- * to itself, listed single-agent targets, and/or explicit saved-agent teams.
245
- */
246
- export type AgentSubagentGraphEdge = Omit<GraphEdge, 'edgeType' | 'condition' | 'prompt' | 'promptKey'> & {
247
- edgeType: 'direct';
248
- condition?: never;
249
- prompt?: string;
250
- promptKey?: never;
251
- };
252
- /** A bounded saved-agent team that can be spawned as one isolated child graph. */
253
- export type AgentSubagentGraph = {
254
- /** Stable spawn-tool enum value for the team. */
255
- type: string;
256
- name: string;
257
- description: string;
258
- /** Member IDs. In create/update payloads, an empty ID refers to the current agent. */
259
- agent_ids: string[];
260
- edges: AgentSubagentGraphEdge[];
261
- /** Entry member ID. In create/update payloads, an empty ID refers to the current agent. */
262
- entry_agent_id: string;
263
- /** Result member ID. In create/update payloads, an empty ID refers to the current agent. */
264
- result_agent_id: string;
265
- };
266
- export type AgentSubagentsConfig = {
267
- enabled?: boolean;
268
- /** When true (default), the agent may spawn itself in an isolated context. */
269
- allowSelf?: boolean;
270
- /** Specific agents that may be spawned as subagents. */
271
- agent_ids?: string[];
272
- /** Explicit saved-agent teams that may be spawned as bounded child graphs. */
273
- graphs?: AgentSubagentGraph[];
274
- };
275
- export type Agent = {
276
- _id?: string;
277
- id: string;
278
- name: string | null;
279
- author?: string | null;
280
- /** The original custom endpoint name, lowercased */
281
- endpoint?: string | null;
282
- authorName?: string | null;
283
- description: string | null;
284
- created_at: number;
285
- avatar: AgentAvatar | null;
286
- instructions?: string | null;
287
- additional_instructions?: string | null;
288
- tools?: string[];
289
- tool_kwargs?: Record<string, unknown>;
290
- metadata?: Record<string, unknown>;
291
- provider: AgentProvider;
292
- model: string | null;
293
- model_parameters: AgentModelParameters;
294
- conversation_starters?: string[];
295
- tool_resources?: AgentToolResources;
296
- /** @deprecated Use edges instead */
297
- agent_ids?: string[];
298
- edges?: GraphEdge[];
299
- end_after_tools?: boolean;
300
- hide_sequential_outputs?: boolean;
301
- /** Per-agent opt-in for stateful code sessions (requires the app-level capability). */
302
- stateful_code_sessions?: boolean;
303
- /** Stateful workspace sharing scope. Defaults to one workspace per user. */
304
- stateful_code_environment?: StatefulCodeEnvironment;
305
- /** Operator-configured managed or attached stateful execution environment. */
306
- code_environment_id?: string | null;
307
- artifacts?: ArtifactModes;
308
- recursion_limit?: number;
309
- isPublic?: boolean;
310
- /**
311
- * Whether the requesting user holds EDIT on this agent, so a single VIEW-scoped fetch can
312
- * serve consumers that only need the editable subset instead of issuing a second full
313
- * paginated walk under an EDIT-scoped cache key.
314
- *
315
- * Set by the list endpoint only; single-agent responses omit it. Treat absence as unknown
316
- * and fail open (`isEditable !== false`), never as `false`, since a client on an older
317
- * server would otherwise see an empty list rather than too many rows.
318
- *
319
- * Reflects the caller's ACL grant. The `MANAGE_AGENTS` capability bypasses ACL on write,
320
- * so a capability holder can edit agents this flag reports as not editable.
321
- */
322
- isEditable?: boolean;
323
- version?: number;
324
- category?: string;
325
- support_contact?: SupportContact;
326
- owner_contact?: AgentOwnerContact;
327
- /** Per-tool configuration options (deferred loading, allowed callers, etc.) */
328
- tool_options?: AgentToolOptions;
329
- /** Attached action registrations, each `${encodedDomain}${actionDelimiter}${action_id}` */
330
- actions?: string[];
331
- /** Optional allowlist of skill ObjectIds. Only applies when `skills_enabled`. */
332
- skills?: string[];
333
- /** Master toggle for skill use on this agent. `true` = active (full catalog unless
334
- * `skills` narrows it). `false`/undefined = inactive (no skills available). */
335
- skills_enabled?: boolean;
336
- /** Enables runtime skill creation without exposing an existing skill catalog. */
337
- skill_authoring_enabled?: boolean;
338
- /** Explicit catalog exposure while skills are enabled. Missing preserves legacy semantics. */
339
- skills_scope?: SkillsScope;
340
- /** Subagent spawning configuration — isolated-context child agents. */
341
- subagents?: AgentSubagentsConfig;
342
- /** Memory partition: `agent` isolates memories per (user, agent); default shared pool */
343
- memory_scope?: MemoryScope;
344
- };
345
- export type TAgentsMap = Record<string, Agent | undefined>;
346
- export type AgentCreateParams = {
347
- name?: string | null;
348
- description?: string | null;
349
- avatar?: AgentAvatar | null;
350
- file_ids?: string[];
351
- instructions?: string | null;
352
- tools?: Array<FunctionTool | string>;
353
- provider: AgentProvider;
354
- model: string | null;
355
- model_parameters: AgentModelParameters;
356
- } & Pick<Agent, 'agent_ids' | 'edges' | 'end_after_tools' | 'hide_sequential_outputs' | 'stateful_code_sessions' | 'stateful_code_environment' | 'code_environment_id' | 'artifacts' | 'recursion_limit' | 'category' | 'support_contact' | 'tool_options' | 'skills' | 'skills_enabled' | 'skill_authoring_enabled' | 'skills_scope' | 'subagents' | 'memory_scope'>;
357
- export type AgentUpdateParams = {
358
- name?: string | null;
359
- description?: string | null;
360
- avatar?: AgentAvatar | null;
361
- file_ids?: string[];
362
- instructions?: string | null;
363
- tools?: Array<FunctionTool | string>;
364
- tool_resources?: ToolResources;
365
- provider?: AgentProvider;
366
- model?: string | null;
367
- model_parameters?: AgentModelParameters;
368
- } & Pick<Agent, 'agent_ids' | 'edges' | 'end_after_tools' | 'hide_sequential_outputs' | 'stateful_code_sessions' | 'stateful_code_environment' | 'code_environment_id' | 'artifacts' | 'recursion_limit' | 'category' | 'support_contact' | 'tool_options' | 'skills' | 'skills_enabled' | 'skill_authoring_enabled' | 'skills_scope' | 'subagents' | 'memory_scope'>;
369
- export type AgentListParams = {
370
- limit?: number;
371
- requiredPermission: number;
372
- category?: string;
373
- search?: string;
374
- cursor?: string;
375
- promoted?: 0 | 1;
376
- };
377
- export type AgentListResponse = {
378
- object: string;
379
- data: Agent[];
380
- first_id: string;
381
- last_id: string;
382
- has_more: boolean;
383
- after?: string;
384
- };
385
- export type AgentFile = {
386
- file_id: string;
387
- id?: string;
388
- temp_file_id?: string;
389
- bytes: number;
390
- created_at: number;
391
- filename: string;
392
- object: string;
393
- purpose: 'fine-tune' | 'fine-tune-results' | 'agents' | 'agents_output';
394
- };
395
- /**
396
- * Details of the Code Interpreter tool call the run step was involved in.
397
- * Includes the tool call ID, the code interpreter definition, and the type of tool call.
398
- */
399
- export type CodeToolCall = {
400
- id: string;
401
- code_interpreter: {
402
- input: string;
403
- outputs: Array<Record<string, unknown>>;
404
- };
405
- type: 'code_interpreter';
406
- };
407
- /**
408
- * Details of a Function tool call the run step was involved in.
409
- * Includes the tool call ID, the function definition, and the type of tool call.
410
- */
411
- export type FunctionToolCall = {
412
- id: string;
413
- function: {
414
- arguments: string;
415
- name: string;
416
- output: string | null;
417
- };
418
- type: 'function';
419
- };
420
- /**
421
- * Details of a Retrieval tool call the run step was involved in.
422
- * Includes the tool call ID and the type of tool call.
423
- */
424
- export type RetrievalToolCall = {
425
- id: string;
426
- retrieval: unknown;
427
- type: 'retrieval';
428
- };
429
- /**
430
- * Details of a Retrieval tool call the run step was involved in.
431
- * Includes the tool call ID and the type of tool call.
432
- */
433
- export type FileSearchToolCall = {
434
- id: string;
435
- file_search: unknown;
436
- type: 'file_search';
437
- };
438
- /**
439
- * Details of the tool calls involved in a run step.
440
- * Can be associated with one of three types of tools: `code_interpreter`, `retrieval`, or `function`.
441
- */
442
- export type ToolCallsStepDetails = {
443
- tool_calls: Array<CodeToolCall | RetrievalToolCall | FileSearchToolCall | FunctionToolCall>;
444
- type: 'tool_calls';
445
- };
446
- export type ImageFile = TFile & {
447
- /**
448
- * The [File](https://platform.openai.com/docs/api-reference/files) ID of the image
449
- * in the message content.
450
- */
451
- file_id: string;
452
- filename: string;
453
- filepath: string;
454
- height: number;
455
- width: number;
456
- /**
457
- * Prompt used to generate the image if applicable.
458
- */
459
- prompt?: string;
460
- /**
461
- * Additional metadata used to generate or about the image/tool_call.
462
- */
463
- metadata?: Record<string, unknown>;
464
- };
465
- export type FileCitation = {
466
- end_index: number;
467
- file_citation: FileCitationDetails;
468
- start_index: number;
469
- text: string;
470
- type: 'file_citation';
471
- };
472
- export type FileCitationDetails = {
473
- file_id: string;
474
- quote: string;
475
- };
476
- export type FilePath = {
477
- end_index: number;
478
- file_path: FilePathDetails;
479
- start_index: number;
480
- text: string;
481
- type: 'file_path';
482
- };
483
- export type FilePathDetails = {
484
- file_id: string;
485
- };
486
- export type Text = {
487
- annotations?: Array<FileCitation | FilePath>;
488
- value: string;
489
- };
490
- export declare enum AnnotationTypes {
491
- FILE_CITATION = "file_citation",
492
- FILE_PATH = "file_path"
493
- }
494
- export declare enum StepStatus {
495
- IN_PROGRESS = "in_progress",
496
- CANCELLED = "cancelled",
497
- FAILED = "failed",
498
- COMPLETED = "completed",
499
- EXPIRED = "expired"
500
- }
501
- export declare enum MessageContentTypes {
502
- TEXT = "text",
503
- IMAGE_FILE = "image_file"
504
- }
505
74
  export declare enum RunStatus {
506
75
  QUEUED = "queued",
507
76
  IN_PROGRESS = "in_progress",
@@ -512,186 +81,6 @@ export declare enum RunStatus {
512
81
  COMPLETED = "completed",
513
82
  EXPIRED = "expired"
514
83
  }
515
- export type PartMetadata = {
516
- progress?: number;
517
- asset_pointer?: string;
518
- status?: string;
519
- action?: boolean;
520
- auth?: string;
521
- expires_at?: number;
522
- /** Index indicating parallel sibling content (same stepIndex in multi-agent runs) */
523
- siblingIndex?: number;
524
- /** Agent ID for parallel agent rendering - identifies which agent produced this content */
525
- agentId?: string;
526
- /** Group ID for parallel content - parts with same groupId are displayed in columns */
527
- groupId?: number;
528
- /**
529
- * Terminal lifecycle status of the run step that produced this part, from
530
- * `on_run_step_closed`. Distinct from `status`, which is already claimed by
531
- * activity-label and question-form parts. Absent on parts predating the
532
- * event or from endpoints that do not emit it, in which case renderers fall
533
- * back to inferring "stopped" from `progress` and `isSubmitting`.
534
- */
535
- runStepStatus?: Agents.RunStepClosedStatus;
536
- /**
537
- * Wall-clock milliseconds the run step took, derived from the same
538
- * `on_run_step_closed` event as {@link runStepStatus} via
539
- * `getRunStepDurationMs`. Only written when the event carried both
540
- * timestamps and they agree in order — so its absence means "not
541
- * derivable", never "instant". The raw value is persisted unfiltered;
542
- * whether it is worth showing (`isReportableRunStepDuration`) is decided
543
- * at render time.
544
- */
545
- runStepDurationMs?: number;
546
- /**
547
- * Stamped by the background harvester when a detached task's final output
548
- * replaces the dispatch handle in `tool_call.output`. The handle JSON and
549
- * the live status-marker attachment are both transient, so after the patch
550
- * (or a reload) this is the only signal that the call ran in the
551
- * background — renderers use it to keep treating {@link runStepDurationMs}
552
- * as dispatch time rather than the task's runtime.
553
- */
554
- backgrounded?: boolean;
555
- /**
556
- * Content index this part occupied while its run streamed. The aggregator
557
- * writes parts at provider-source indexes, so the streamed array is sparse;
558
- * persistence compacts it and every part after a hole shifts down. The
559
- * client's final handler stamps the streamed position onto the compacted
560
- * parts it adopts, so index-derived render identity survives the swap
561
- * instead of remounting the settled message. Client-only and absent
562
- * everywhere else — persisted content never carries it.
563
- */
564
- streamedIndex?: number;
565
- };
566
- /** Metadata for parallel content rendering - subset of PartMetadata */
567
- export type ContentMetadata = Pick<PartMetadata, 'agentId' | 'groupId' | 'streamedIndex'>;
568
- export type ContentPart = (CodeToolCall | RetrievalToolCall | FileSearchToolCall | FunctionToolCall | Agents.AgentToolCall | ImageFile | Text) & PartMetadata;
569
- export type TextData = (Text & PartMetadata) | undefined;
570
- export type SummaryContentPart = {
571
- type: ContentTypes.SUMMARY;
572
- content?: Array<{
573
- type: ContentTypes.TEXT;
574
- text: string;
575
- }>;
576
- tokenCount?: number;
577
- summarizing?: boolean;
578
- summaryVersion?: number;
579
- model?: string;
580
- provider?: string;
581
- createdAt?: string;
582
- boundary?: {
583
- messageId: string;
584
- contentIndex: number;
585
- };
586
- };
587
- /**
588
- * A user steering message injected mid-run at a tool-batch boundary.
589
- * Persisted inline in the response message's content array (keyed by the
590
- * type name like `text`/`think` so token counting reads it for free);
591
- * replayed as a user message on subsequent turns by `formatAgentMessages`.
592
- */
593
- export type SteerContentPart = {
594
- type: ContentTypes.STEER;
595
- steer: string;
596
- steerId?: string;
597
- /** Stable optimistic-client id used to settle a POST whose response was lost. */
598
- clientSteerId?: string;
599
- createdAt?: number;
600
- /** Attachments steered with the message; re-encoded per turn on replay
601
- * like any other user-message media (refs only, never encoded data). */
602
- files?: Partial<TFile>[];
603
- /** Quoted excerpts steered with the message, persisted separately from the
604
- * typed text (mirroring `TMessage.quotes`) so the UI renders them as
605
- * reference blocks; merged into the model-bound user turn on every replay. */
606
- quotes?: string[];
607
- };
608
- export type TMessageContentParts = ({
609
- type: ContentTypes.ERROR;
610
- text?: string | TextData;
611
- error?: string;
612
- } & ContentMetadata) | ({
613
- type: ContentTypes.THINK;
614
- think?: string | TextData;
615
- /** Generated orientation for this user-visible reasoning step. */
616
- reasoning_label?: string;
617
- /** Stable SDK run-step identity used to correlate live revisions. */
618
- reasoning_label_step_id?: string;
619
- /** Durable provider-call count used to enforce the per-run cost cap across resumes. */
620
- reasoning_label_attempts?: number;
621
- /** Visible reasoning length included in this step's latest provider call. */
622
- reasoning_label_submitted_chars?: number;
623
- /** Monotonic provider-call revision; gaps are allowed after unsuccessful attempts. */
624
- reasoning_label_revision?: number;
625
- /** Whether the reasoning step can still produce a newer label. */
626
- reasoning_label_status?: 'streaming' | 'complete';
627
- /** The reasoning happened but its text is not available to this view
628
- * (e.g. detached subagent projections retain only a marker). */
629
- reasoning_unavailable?: boolean;
630
- } & ContentMetadata) | (SteerContentPart & ContentMetadata) | ({
631
- type: ContentTypes.TEXT;
632
- text?: string | TextData;
633
- tool_call_ids?: string[];
634
- /** Open Responses semantic channel for assistant text. */
635
- phase?: 'commentary' | 'final_answer';
636
- } & ContentMetadata) | ({
637
- type: ContentTypes.TOOL_CALL;
638
- tool_call: (CodeToolCall | RetrievalToolCall | FileSearchToolCall | FunctionToolCall | Agents.AgentToolCall) & PartMetadata;
639
- } & ContentMetadata) | ({
640
- type: ContentTypes.IMAGE_FILE;
641
- image_file: ImageFile & PartMetadata;
642
- } & ContentMetadata) | (SummaryContentPart & ContentMetadata) | ({
643
- /** One-line LLM-generated note describing a completed tool batch. UI-only:
644
- * never sent to the model (stripped before payload formatting). */
645
- type: ContentTypes.ACTIVITY_LABEL;
646
- activity_label?: string;
647
- /** Missing means the legacy/per-batch activity label. */
648
- activity_label_type?: 'phase';
649
- tool_call_ids?: string[];
650
- /** Parent phase bounds and telemetry. */
651
- activity_start_index?: number;
652
- /** Exclusive end of the grouped content; may precede the marker itself. */
653
- activity_end_index?: number;
654
- activity_count?: number;
655
- agent_ids?: string[];
656
- /** ok = all tools succeeded, failed = all failed, partial = mixed. */
657
- status?: 'ok' | 'partial' | 'failed';
658
- pending?: boolean;
659
- } & ContentMetadata) | (Agents.AgentUpdate & ContentMetadata) | (Agents.MessageContentImageUrl & ContentMetadata) | (Agents.MessageContentVideoUrl & ContentMetadata) | (Agents.MessageContentInputAudio & ContentMetadata);
660
- export type StreamContentData = TMessageContentParts & {
661
- /** The index of the current content part */
662
- index: number;
663
- /** The current text content was already served but edited to replace elements therein */
664
- edited?: boolean;
665
- };
666
- export type TContentData = StreamContentData & {
667
- messageId: string;
668
- conversationId: string;
669
- userMessageId: string;
670
- thread_id: string;
671
- stream?: boolean;
672
- };
673
- export declare const actionDelimiter = "_action_";
674
- export declare const actionDomainSeparator = "---";
675
- /**
676
- * Checks whether a tool name is an OpenAPI action tool.
677
- *
678
- * Action format: `operationId_action_normalizedDomain`
679
- * MCP format: `toolName_mcp_serverName`
680
- *
681
- * Cross-delimiter collision: an MCP tool like `get_action_mcp_srv` contains
682
- * `_action_` as a false positive. Guarded by checking whether `_mcp_` appears
683
- * after `_action_`. In the collision case the `_mcp_` suffix always follows
684
- * `_action_`; in a valid action tool whose operationId contains `_mcp_`, the
685
- * `_mcp_` precedes `_action_`.
686
- *
687
- * Theoretical limitation: a non-RFC-compliant domain containing literal
688
- * underscores that form `_mcp_` (e.g. `api_mcp_internal.com`) would produce
689
- * a false negative. RFC 952/1123 prohibit underscores in hostnames, so this
690
- * is not expected in practice.
691
- */
692
- export declare function isActionTool(toolName: string): boolean;
693
- export declare const hostImageIdSuffix = "_host_copy";
694
- export declare const hostImageNamePrefix = "host_copy_";
695
84
  export type AssistantAvatar = {
696
85
  filepath: string;
697
86
  source: string;
@@ -708,10 +97,6 @@ export type AssistantDocument = {
708
97
  updatedAt?: Date;
709
98
  append_current_datetime?: boolean;
710
99
  };
711
- export type AgentAvatar = {
712
- filepath: string;
713
- source: string;
714
- };
715
100
  export declare enum FilePurpose {
716
101
  Vision = "vision",
717
102
  FineTune = "fine-tune",