librechat-data-provider 0.8.523 → 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 (48) hide show
  1. package/dist/{data-service-Bx6IFaSa.mjs → data-service-B-WUVvTH.mjs} +434 -174
  2. package/dist/data-service-B-WUVvTH.mjs.map +1 -0
  3. package/dist/{data-service-CTX0tVO5.js → data-service-CUG1qdeC.js} +577 -203
  4. package/dist/data-service-CUG1qdeC.js.map +1 -0
  5. package/dist/index.js +346 -72
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +307 -68
  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/actions.d.ts +1 -1
  12. package/dist/types/agentToolOptions.d.ts +1 -1
  13. package/dist/types/api-endpoints.d.ts +1 -0
  14. package/dist/types/backgroundResults.d.ts +13 -0
  15. package/dist/types/balance.d.ts +4 -0
  16. package/dist/types/bedrock.d.ts +77 -70
  17. package/dist/types/code/workspace.d.ts +22 -0
  18. package/dist/types/config.d.ts +5362 -4206
  19. package/dist/types/data-service.d.ts +14 -12
  20. package/dist/types/file-config.d.ts +81 -42
  21. package/dist/types/filters.d.ts +205 -205
  22. package/dist/types/footer.d.ts +20 -0
  23. package/dist/types/generate.d.ts +28 -28
  24. package/dist/types/index.d.ts +4 -0
  25. package/dist/types/keys.d.ts +2 -1
  26. package/dist/types/limits.d.ts +8 -0
  27. package/dist/types/mcp.d.ts +999 -352
  28. package/dist/types/messages.d.ts +12 -7
  29. package/dist/types/models.d.ts +429 -429
  30. package/dist/types/parameterSettings.d.ts +2 -1
  31. package/dist/types/parsers.d.ts +25 -1
  32. package/dist/types/resolve-llm-delivery-path.d.ts +97 -4
  33. package/dist/types/schemas.d.ts +646 -643
  34. package/dist/types/types/agents.d.ts +233 -2
  35. package/dist/types/types/assistants.d.ts +2 -641
  36. package/dist/types/types/content.d.ts +286 -0
  37. package/dist/types/types/files.d.ts +14 -1
  38. package/dist/types/types/mutations.d.ts +3 -2
  39. package/dist/types/types/queuedTurns.d.ts +124 -90
  40. package/dist/types/types/runs.d.ts +9 -0
  41. package/dist/types/types/schedules.d.ts +10 -10
  42. package/dist/types/types/skills.d.ts +43 -0
  43. package/dist/types/types/tools.d.ts +132 -0
  44. package/dist/types/types/traces.d.ts +49 -0
  45. package/dist/types/types.d.ts +31 -1
  46. package/package.json +1 -1
  47. package/dist/data-service-Bx6IFaSa.mjs.map +0 -1
  48. package/dist/data-service-CTX0tVO5.js.map +0 -1
@@ -315,10 +315,53 @@ export type TSkillListResponse = {
315
315
  has_more: boolean;
316
316
  after: string | null;
317
317
  };
318
+ /**
319
+ * Why one archive entry could not be imported. A stable code rather than a
320
+ * message, so the client localizes the reason and server-side storage and
321
+ * database text never reaches the uploader.
322
+ */
323
+ export type SkillImportFailureReason =
324
+ /** Path is absolute, traverses, or uses characters skills cannot store. */
325
+ 'invalid_path'
326
+ /** Entry alone exceeds the per-file decompression limit. */
327
+ | 'file_too_large'
328
+ /** Archive exhausted the cumulative decompression budget at or before this entry. */
329
+ | 'archive_too_large'
330
+ /** Entry no longer matches what content inspection read. */
331
+ | 'archive_entry_changed'
332
+ /** Storage write or database row failed. */
333
+ | 'persistence_failed';
334
+ /** One archive entry POST `/api/skills/import` could not persist. */
335
+ export type TSkillImportFailedFile = {
336
+ /** Path inside the archive, relative to `SKILL.md`. */
337
+ path: string;
338
+ reason: SkillImportFailureReason;
339
+ /** Limit in MB, when `reason` names a size limit. */
340
+ limitMb?: number;
341
+ };
342
+ /**
343
+ * Response from a failed `POST /api/skills/import` of an archive.
344
+ *
345
+ * `skill_import_incomplete` (422) means at least one bundled file failed and
346
+ * everything the import created was rolled back. `skill_import_rollback_failed`
347
+ * (500) means the same failure occurred but the partially created skill could
348
+ * not be removed, so it may still be listed and needs deleting by hand.
349
+ * `skill_import_cleanup_incomplete` (500) means the Skill row was removed but
350
+ * dependent database or blob cleanup did not finish.
351
+ */
352
+ export type TSkillImportFailedResponse = {
353
+ error: 'skill_import_incomplete' | 'skill_import_rollback_failed' | 'skill_import_cleanup_incomplete';
354
+ message: string;
355
+ failedFiles: TSkillImportFailedFile[];
356
+ /** Present when the Skill row may remain and should be surfaced for deletion. */
357
+ skillId?: string;
358
+ };
318
359
  /** Response from DELETE `/api/skills/:id`. */
319
360
  export type TDeleteSkillResponse = {
320
361
  id: string;
321
362
  deleted: true;
363
+ /** False when the Skill row is gone but a dependent cleanup step needs repair. */
364
+ cleanupComplete?: boolean;
322
365
  };
323
366
  /** Response from GET `/api/skills/:id/files`. */
324
367
  export type TListSkillFilesResponse = {
@@ -0,0 +1,132 @@
1
+ import type { OpenAPIV3 } from 'openapi-types';
2
+ export type Schema = OpenAPIV3.SchemaObject & {
3
+ description?: string;
4
+ };
5
+ export type Reference = OpenAPIV3.ReferenceObject & {
6
+ description?: string;
7
+ };
8
+ export declare enum Tools {
9
+ execute_code = "execute_code",
10
+ code_interpreter = "code_interpreter",
11
+ file_search = "file_search",
12
+ web_search = "web_search",
13
+ retrieval = "retrieval",
14
+ function = "function",
15
+ memory = "memory",
16
+ ui_resources = "ui_resources",
17
+ skill = "skill",
18
+ read_file = "read_file",
19
+ bash_tool = "bash_tool"
20
+ }
21
+ export declare enum EToolResources {
22
+ code_interpreter = "code_interpreter",
23
+ execute_code = "execute_code",
24
+ file_search = "file_search",
25
+ image_edit = "image_edit",
26
+ context = "context",
27
+ ocr = "ocr"
28
+ }
29
+ export type Tool = {
30
+ [type: string]: Tools;
31
+ };
32
+ export type FunctionTool = {
33
+ type: Tools;
34
+ function?: {
35
+ description: string;
36
+ name: string;
37
+ parameters: Record<string, unknown>;
38
+ strict?: boolean;
39
+ additionalProperties?: boolean;
40
+ };
41
+ };
42
+ /**
43
+ * A set of resources that are used by the assistant's tools. The resources are
44
+ * specific to the type of tool. For example, the `code_interpreter` tool requires
45
+ * a list of file IDs, while the `file_search` tool requires a list of vector store
46
+ * IDs.
47
+ */
48
+ export interface ToolResources {
49
+ code_interpreter?: CodeInterpreterResource;
50
+ file_search?: FileSearchResource;
51
+ }
52
+ export interface CodeInterpreterResource {
53
+ /**
54
+ * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made
55
+ * available to the `code_interpreter`` tool. There can be a maximum of 20 files
56
+ * associated with the tool.
57
+ */
58
+ file_ids?: Array<string>;
59
+ }
60
+ export interface FileSearchResource {
61
+ /**
62
+ * The ID of the
63
+ * [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
64
+ * attached to this assistant. There can be a maximum of 1 vector store attached to
65
+ * the assistant.
66
+ */
67
+ vector_store_ids?: Array<string>;
68
+ }
69
+ /**
70
+ * Specifies who can invoke a tool.
71
+ * - 'direct': LLM can call directly
72
+ * - 'code_execution': Only callable via programmatic tool calling (PTC)
73
+ */
74
+ export type AllowedCaller = 'direct' | 'code_execution';
75
+ /**
76
+ * Per-tool configuration options stored at the agent level.
77
+ * Keyed by tool_id (e.g., "search_mcp_github").
78
+ */
79
+ export type ToolOptions = {
80
+ /**
81
+ * If true, the tool uses deferred loading (discoverable via tool search).
82
+ * @default false
83
+ */
84
+ defer_loading?: boolean;
85
+ /**
86
+ * Specifies who can invoke this tool.
87
+ * - 'direct': LLM can call directly (default behavior)
88
+ * - 'code_execution': Only callable via PTC sandbox
89
+ * @default ['direct']
90
+ */
91
+ allowed_callers?: AllowedCaller[];
92
+ /**
93
+ * If true (and the `run_in_background` capability is enabled), the tool's
94
+ * schema gains a `run_in_background` boolean so the model can dispatch the
95
+ * call detached and poll its result via `check_background_task`.
96
+ * @default false
97
+ */
98
+ run_in_background?: boolean;
99
+ /**
100
+ * If true (and the `tool_intents` capability is enabled), the tool's schema
101
+ * gains an `intent` string as its FIRST property — one model-authored
102
+ * sentence per call, rendered as the call's live status label. Native host
103
+ * tools default on while the capability is enabled; `false` opts one out.
104
+ * @default false
105
+ */
106
+ describe_intent?: boolean;
107
+ };
108
+ /**
109
+ * Map of tool_id to its configuration options.
110
+ * Used to customize tool behavior per agent.
111
+ */
112
+ export type AgentToolOptions = Record<string, ToolOptions>;
113
+ export declare const actionDelimiter = "_action_";
114
+ export declare const actionDomainSeparator = "---";
115
+ /**
116
+ * Checks whether a tool name is an OpenAPI action tool.
117
+ *
118
+ * Action format: `operationId_action_normalizedDomain`
119
+ * MCP format: `toolName_mcp_serverName`
120
+ *
121
+ * Cross-delimiter collision: an MCP tool like `get_action_mcp_srv` contains
122
+ * `_action_` as a false positive. Guarded by checking whether `_mcp_` appears
123
+ * after `_action_`. In the collision case the `_mcp_` suffix always follows
124
+ * `_action_`; in a valid action tool whose operationId contains `_mcp_`, the
125
+ * `_mcp_` precedes `_action_`.
126
+ *
127
+ * Theoretical limitation: a non-RFC-compliant domain containing literal
128
+ * underscores that form `_mcp_` (e.g. `api_mcp_internal.com`) would produce
129
+ * a false negative. RFC 952/1123 prohibit underscores in hostnames, so this
130
+ * is not expected in practice.
131
+ */
132
+ export declare function isActionTool(toolName: string): boolean;
@@ -4,6 +4,15 @@
4
4
  * backend's field names, credentials, URL structure or API version.
5
5
  */
6
6
  export type TTraceRecordKind = 'agent' | 'generation' | 'tool' | 'span' | 'event';
7
+ /**
8
+ * What a record did in the run, in the application's own terms, so a client never reads a tracing
9
+ * backend's span names. Absent on a record the backend did not describe: it is listed by `kind`.
10
+ * `run` is a whole agent run, `agent` the named agent inside it, `plumbing` a wrapper that only
11
+ * frames a model call, `model` a model call of the response, `tools` one round of tool calls, and
12
+ * the label roles are the model calls that wrote the activity labels the chat shows while a
13
+ * response runs.
14
+ */
15
+ export type TTraceRecordRole = 'run' | 'agent' | 'plumbing' | 'model' | 'tools' | 'stepLabel' | 'reasoningLabel' | 'phaseLabel';
7
16
  /** `running` marks a record with no end time yet; it has a start but no duration. */
8
17
  export type TTraceStatus = 'ok' | 'warning' | 'error' | 'running';
9
18
  export type TTraceUsage = {
@@ -22,6 +31,11 @@ export type TTraceRecord = {
22
31
  /** `null` for a root; may name a record that is not loaded (or does not exist). */
23
32
  parentId: string | null;
24
33
  kind: TTraceRecordKind;
34
+ role?: TTraceRecordRole;
35
+ /** The saved agent a `role: 'agent'` record ran; absent for an agent that was never saved. */
36
+ agentId?: string;
37
+ /** The tools a `role: 'tools'` round called, in order, as the backend recorded the round. */
38
+ tools?: string[];
25
39
  name: string;
26
40
  model?: string;
27
41
  /** ISO-8601 timestamps. */
@@ -34,6 +48,8 @@ export type TTraceRecord = {
34
48
  usage?: TTraceUsage;
35
49
  /** Total cost in USD, when the backend priced the record. */
36
50
  cost?: number;
51
+ /** Set on records of the turn's title generation; absent on the response run itself. */
52
+ origin?: 'title';
37
53
  };
38
54
  export type TTraceErrorCode = 'disabled' | 'not_found' | 'invalid_request' | 'rate_limited' | 'timeout' | 'unauthorized' | 'unsupported' | 'upstream_error';
39
55
  export type TTraceErrorResponse = {
@@ -72,10 +88,43 @@ export type TTraceContent = {
72
88
  value: string;
73
89
  truncated: boolean;
74
90
  };
91
+ export type TTraceMessageRole = 'system' | 'user' | 'assistant' | 'tool';
92
+ export type TTraceToolCall = {
93
+ name: string;
94
+ args?: TTraceContent;
95
+ };
96
+ /** One message of a model call's conversation, each bounded on its own so a long one hides no other. */
97
+ export type TTraceMessage = {
98
+ role: TTraceMessageRole;
99
+ text?: TTraceContent;
100
+ /** The tool a `tool` message answers for. */
101
+ toolName?: string;
102
+ /** The tools an `assistant` message asked for. */
103
+ toolCalls?: TTraceToolCall[];
104
+ /** Parts that are not text (an image, a file), by their type. */
105
+ attachments?: string[];
106
+ };
107
+ /**
108
+ * What a model call was given, as a conversation. A long one keeps its system
109
+ * message and its newest messages, which are what the call answered, and
110
+ * `omitted` counts the older ones left out between them.
111
+ */
112
+ export type TTracePrompt = {
113
+ messages: TTraceMessage[];
114
+ /** Every message the call was given, listed or not. */
115
+ total: number;
116
+ omitted: number;
117
+ /** Names of the tools the model could call. */
118
+ tools?: string[];
119
+ };
75
120
  export type TTraceRecordDetail = {
76
121
  record: TTraceRecord;
77
122
  /** False when the deployment withholds input, output and metadata. */
78
123
  contentAvailable: boolean;
124
+ /** Set when the input is a conversation the backend could read as one; `input` stays the raw form. */
125
+ prompt?: TTracePrompt;
126
+ /** Set when the output is a message the backend could read as one; `output` stays the raw form. */
127
+ reply?: TTraceMessage;
79
128
  input?: TTraceContent;
80
129
  output?: TTraceContent;
81
130
  metadata?: TTraceContent;
@@ -2,13 +2,15 @@ import type { InfiniteData } from '@tanstack/react-query';
2
2
  import type { TConversationTag, EModelEndpoint, TConversation, TSharedLink, TAttachment, TMessage, TBanner, ReasoningResponseKey, ReasoningParameterFormat } from './schemas';
3
3
  import type { CodeWorkspaceDescriptor, CodeEnvironmentMode, CodeWorkspaceOperation, CodeWorkspaceSelection } from './code/workspace';
4
4
  import type { CodeEnvironmentUserConfigSchema, CodeEnvironmentUserSettings, TAgentsEndpoint } from './config';
5
- import type { Agent, EToolResources, StatefulCodeEnvironment } from './types/assistants';
5
+ import type { StatefulCodeEnvironment } from './stateful-code';
6
6
  import type { CodeApprovalMode } from './code/approval';
7
+ import type { EToolResources } from './types/tools';
7
8
  import type { RefillIntervalUnit } from './balance';
8
9
  import type { SettingDefinition } from './generate';
9
10
  import type { TMinimalFeedback } from './feedback';
10
11
  import type { ContentTypes } from './types/runs';
11
12
  import type { ProviderId } from './providers';
13
+ import type { Agent } from './types/agents';
12
14
  export * from './schemas';
13
15
  export * from './types/subagents';
14
16
  export type TMessages = TMessage[];
@@ -347,6 +349,9 @@ export type TPinConversationResponse = TConversation;
347
349
  export type TSharedMessagesResponse = Omit<TSharedLink, 'messages'> & {
348
350
  messages: TMessage[];
349
351
  langfuseSessionUrl?: string;
352
+ /** Whether the link was published with a configured sender label; withholds the
353
+ * model on hover. */
354
+ hasConfiguredSender?: boolean;
350
355
  };
351
356
  export type TCreateShareLinkRequest = Pick<TConversation, 'conversationId'>;
352
357
  export type TUpdateShareLinkRequest = Pick<TSharedLink, 'shareId' | 'targetMessageId'>;
@@ -454,7 +459,32 @@ export type TCodeEnvironmentStatusResponse = {
454
459
  operations?: CodeWorkspaceOperation[];
455
460
  workspaces?: CodeWorkspaceDescriptor[];
456
461
  };
462
+ /** Moves a sealed attached decision onto the environments a conversation's agents now use. */
463
+ export type TCodeEnvironmentMoveRequest = {
464
+ conversationId: string;
465
+ /** The persisted selections being replaced; a mismatch rejects the move as stale. */
466
+ from: CodeWorkspaceSelection[];
467
+ to: CodeWorkspaceSelection[];
468
+ };
469
+ export type TCodeEnvironmentMoveResponse = {
470
+ conversationId: string;
471
+ codeEnvironmentMode: 'attached';
472
+ codeWorkspaces: CodeWorkspaceSelection[];
473
+ };
474
+ /** Sanitized results of server request shaping for each saved toggle state. */
475
+ export type ResponsesApiRoute = {
476
+ default: boolean;
477
+ on: boolean;
478
+ off: boolean;
479
+ withWebSearch?: {
480
+ default: boolean;
481
+ on: boolean;
482
+ off: boolean;
483
+ };
484
+ };
485
+ export type ResponsesApiRouting = Record<string, ResponsesApiRoute>;
457
486
  export type TConfig = {
487
+ responsesApiRouting?: ResponsesApiRouting;
458
488
  order: number;
459
489
  type?: EModelEndpoint;
460
490
  azure?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "librechat-data-provider",
3
- "version": "0.8.523",
3
+ "version": "0.8.524",
4
4
  "description": "data services for librechat apps",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",