librechat-data-provider 0.8.509 → 0.8.521
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/dist/{data-service-XTxx76uB.js → data-service-DOIF4BkW.js} +1195 -91
- package/dist/data-service-DOIF4BkW.js.map +1 -0
- package/dist/{data-service-BsdHkdKS.mjs → data-service-pwrlWjJs.mjs} +1046 -92
- package/dist/data-service-pwrlWjJs.mjs.map +1 -0
- package/dist/index.js +457 -57
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +425 -58
- package/dist/index.mjs.map +1 -1
- package/dist/react-query/index.js +1 -1
- package/dist/react-query/index.js.map +1 -1
- package/dist/react-query/index.mjs +1 -1
- package/dist/react-query/index.mjs.map +1 -1
- package/dist/types/actions.d.ts +1 -1
- package/dist/types/api-endpoints.d.ts +10 -2
- package/dist/types/bedrock.d.ts +52 -0
- package/dist/types/config.d.ts +4142 -183
- package/dist/types/data-service.d.ts +27 -14
- package/dist/types/feedback.d.ts +9 -1
- package/dist/types/file-config.d.ts +41 -5
- package/dist/types/generate.d.ts +6 -0
- package/dist/types/keys.d.ts +6 -2
- package/dist/types/mcp.d.ts +45 -24
- package/dist/types/messages.d.ts +8 -0
- package/dist/types/models.d.ts +108 -0
- package/dist/types/parameterSettings.d.ts +2 -2
- package/dist/types/parsers.d.ts +3 -1
- package/dist/types/react-query/react-query-service.d.ts +2 -7
- package/dist/types/request.d.ts +3 -1
- package/dist/types/schemas.d.ts +167 -8
- package/dist/types/types/agents.d.ts +211 -1
- package/dist/types/types/assistants.d.ts +77 -5
- package/dist/types/types/files.d.ts +18 -7
- package/dist/types/types/mcpServers.d.ts +25 -0
- package/dist/types/types/mutations.d.ts +1 -0
- package/dist/types/types/queries.d.ts +17 -3
- package/dist/types/types/runs.d.ts +114 -25
- package/dist/types/types/skills.d.ts +25 -6
- package/dist/types/types.d.ts +115 -2
- package/dist/types/upload.d.ts +2 -0
- package/package.json +4 -4
- package/dist/data-service-BsdHkdKS.mjs.map +0 -1
- package/dist/data-service-XTxx76uB.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { TTokenUsageEvent, TContextUsageEvent, TPendingSteer } from './runs';
|
|
1
2
|
import type { FunctionToolCall, SummaryContentPart } from './assistants';
|
|
2
|
-
import type { TTokenUsageEvent, TContextUsageEvent } from './runs';
|
|
3
3
|
import type { TAttachment, TPlugin } from 'src/schemas';
|
|
4
4
|
import { StepTypes, ContentTypes, ToolCallTypes } from './runs';
|
|
5
5
|
export declare namespace Agents {
|
|
@@ -62,10 +62,22 @@ export declare namespace Agents {
|
|
|
62
62
|
id?: string;
|
|
63
63
|
/** If provided, the output of the tool call */
|
|
64
64
|
output?: string;
|
|
65
|
+
/** The tool call was rejected before execution because its input failed schema validation. */
|
|
66
|
+
inputValidationError?: true;
|
|
65
67
|
/** Auth URL */
|
|
66
68
|
auth?: string;
|
|
67
69
|
/** Expiration time */
|
|
68
70
|
expires_at?: number;
|
|
71
|
+
/**
|
|
72
|
+
* When set, this tool call is paused for human review.
|
|
73
|
+
* The presence of this field signals the UI to render approval controls
|
|
74
|
+
* instead of the in-flight tool execution state.
|
|
75
|
+
*/
|
|
76
|
+
approval?: {
|
|
77
|
+
actionId: string;
|
|
78
|
+
allowed_decisions: ToolApprovalDecisionType[];
|
|
79
|
+
description?: string;
|
|
80
|
+
};
|
|
69
81
|
};
|
|
70
82
|
type ToolEndEvent = {
|
|
71
83
|
/** The Step Id of the Tool Call */
|
|
@@ -179,6 +191,11 @@ export declare namespace Agents {
|
|
|
179
191
|
parentMessageId?: string;
|
|
180
192
|
conversationId?: string;
|
|
181
193
|
text?: string;
|
|
194
|
+
/** Skill selections on the turn, carried so a HITL-resumed turn's reconstructed
|
|
195
|
+
* requestMessage keeps its skill pills (they aren't on the DB row the client refetches
|
|
196
|
+
* until reload). */
|
|
197
|
+
manualSkills?: string[];
|
|
198
|
+
alwaysAppliedSkills?: string[];
|
|
182
199
|
}
|
|
183
200
|
/** State data sent to reconnecting clients */
|
|
184
201
|
interface ResumeState {
|
|
@@ -207,6 +224,18 @@ export declare namespace Agents {
|
|
|
207
224
|
collectedUsage?: TTokenUsageEvent[];
|
|
208
225
|
/** Latest context window snapshot; restores the usage gauge on resume */
|
|
209
226
|
contextUsage?: TContextUsageEvent;
|
|
227
|
+
/**
|
|
228
|
+
* Live pending approval when the run is paused for human review. Carried in
|
|
229
|
+
* the resume contract (not just /chat/status) so a reloading or
|
|
230
|
+
* cross-replica client can rebuild and render the prompt from `resumeState`.
|
|
231
|
+
*/
|
|
232
|
+
pendingAction?: PendingAction;
|
|
233
|
+
/**
|
|
234
|
+
* Steers queued server-side but not yet injected into the run. Injected
|
|
235
|
+
* steers already live inside `aggregatedContent`; these are the remainder,
|
|
236
|
+
* so a reconnecting client can rebuild its pending-steer chips.
|
|
237
|
+
*/
|
|
238
|
+
pendingSteers?: TPendingSteer[];
|
|
210
239
|
}
|
|
211
240
|
/**
|
|
212
241
|
* Represents a run step delta i.e. any changed fields on a run step during
|
|
@@ -227,6 +256,9 @@ export declare namespace Agents {
|
|
|
227
256
|
type: StepTypes.MESSAGE_CREATION;
|
|
228
257
|
message_creation: {
|
|
229
258
|
message_id: string;
|
|
259
|
+
/** Provider content kind and Open Responses semantic text channel. */
|
|
260
|
+
content_type?: 'text' | 'think';
|
|
261
|
+
phase?: 'commentary' | 'final_answer';
|
|
230
262
|
};
|
|
231
263
|
};
|
|
232
264
|
type ToolCallsDetails = {
|
|
@@ -238,8 +270,186 @@ export declare namespace Agents {
|
|
|
238
270
|
tool_calls?: ToolCallChunk[];
|
|
239
271
|
auth?: string;
|
|
240
272
|
expires_at?: number;
|
|
273
|
+
/** Approval metadata, set when a tool call is paused for human review. */
|
|
274
|
+
approval?: {
|
|
275
|
+
actionId: string;
|
|
276
|
+
allowed_decisions: ToolApprovalDecisionType[];
|
|
277
|
+
description?: string;
|
|
278
|
+
};
|
|
241
279
|
};
|
|
242
280
|
type AgentToolCall = FunctionToolCall | ToolCall;
|
|
281
|
+
/**
|
|
282
|
+
* Human-in-the-loop interrupt categories. The discriminator on
|
|
283
|
+
* {@link HumanInterruptPayload}.
|
|
284
|
+
*
|
|
285
|
+
* - `tool_approval`: agent paused before executing one or more tools; user
|
|
286
|
+
* approves / rejects / edits each call.
|
|
287
|
+
* - `ask_user_question`: agent invoked the `AskUserQuestion` tool to gather
|
|
288
|
+
* clarification; user replies with free-form text (or selects an option).
|
|
289
|
+
*
|
|
290
|
+
* `tool_approval` is a permission gate; `ask_user_question` is a clarification
|
|
291
|
+
* channel — they share the {@link PendingAction} envelope but have different
|
|
292
|
+
* UI affordances and resume payloads.
|
|
293
|
+
*/
|
|
294
|
+
type HumanInterruptType = 'tool_approval' | 'ask_user_question';
|
|
295
|
+
/** String enum of decision kinds the user can make on a paused tool call. */
|
|
296
|
+
type ToolApprovalDecisionType = 'approve' | 'reject' | 'edit' | 'respond';
|
|
297
|
+
/**
|
|
298
|
+
* One pending tool execution awaiting user review.
|
|
299
|
+
* Field naming mirrors LangChain HumanInterrupt's `ActionRequest`.
|
|
300
|
+
*/
|
|
301
|
+
interface ToolApprovalRequest {
|
|
302
|
+
/** Tool name as registered with the agent */
|
|
303
|
+
name: string;
|
|
304
|
+
/** Sanitized arguments (no auth tokens / file blobs). May be string or parsed object. */
|
|
305
|
+
arguments: string | Record<string, unknown>;
|
|
306
|
+
/** Provider tool_call_id linking this request to the model's tool_use block */
|
|
307
|
+
tool_call_id: string;
|
|
308
|
+
/** Optional human-readable description shown alongside the prompt */
|
|
309
|
+
description?: string;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Per-call review configuration: which decisions the user is allowed to make.
|
|
313
|
+
*
|
|
314
|
+
* `tool_call_id` (NOT `action_name`) is the join key against
|
|
315
|
+
* {@link ToolApprovalRequest.tool_call_id}. By-position mapping breaks the
|
|
316
|
+
* moment a single batch contains the same tool called twice — e.g. a model
|
|
317
|
+
* fanning out two `mcp:server:search` calls in parallel — so always join
|
|
318
|
+
* by `tool_call_id`. `action_name` is retained for display only.
|
|
319
|
+
*/
|
|
320
|
+
interface ToolReviewConfig {
|
|
321
|
+
action_name: string;
|
|
322
|
+
tool_call_id: string;
|
|
323
|
+
allowed_decisions: ToolApprovalDecisionType[];
|
|
324
|
+
}
|
|
325
|
+
/** Interrupt payload for a tool-approval pause. */
|
|
326
|
+
interface ToolApprovalInterruptPayload {
|
|
327
|
+
type: 'tool_approval';
|
|
328
|
+
action_requests: ToolApprovalRequest[];
|
|
329
|
+
review_configs: ToolReviewConfig[];
|
|
330
|
+
}
|
|
331
|
+
/** A selectable answer for an ask-user-question prompt. */
|
|
332
|
+
interface AskUserQuestionOption {
|
|
333
|
+
label: string;
|
|
334
|
+
value: string;
|
|
335
|
+
}
|
|
336
|
+
/** The question itself: free-form prompt with optional curated answers. */
|
|
337
|
+
interface AskUserQuestionRequest {
|
|
338
|
+
question: string;
|
|
339
|
+
/** Optional descriptive context for the prompt; mirrors the SDK field. */
|
|
340
|
+
description?: string;
|
|
341
|
+
options?: AskUserQuestionOption[];
|
|
342
|
+
/** When true the user may pick several options; the answer is their
|
|
343
|
+
* selected option values joined with ", ". */
|
|
344
|
+
multiSelect?: boolean;
|
|
345
|
+
}
|
|
346
|
+
/** One independently answerable question in a batched clarification. */
|
|
347
|
+
interface AskUserQuestionBatchItem extends AskUserQuestionRequest {
|
|
348
|
+
/** Batch-unique identifier used to map the submitted answer. */
|
|
349
|
+
id: string;
|
|
350
|
+
/** Optional short heading rendered above the question. */
|
|
351
|
+
header?: string;
|
|
352
|
+
}
|
|
353
|
+
/** Input shape for one tool call that asks several related questions. */
|
|
354
|
+
interface AskUserQuestionsRequest {
|
|
355
|
+
questions: AskUserQuestionBatchItem[];
|
|
356
|
+
}
|
|
357
|
+
/** Interrupt payload for an ask-user-question pause. */
|
|
358
|
+
interface AskUserQuestionInterruptPayload {
|
|
359
|
+
type: 'ask_user_question';
|
|
360
|
+
question: AskUserQuestionRequest;
|
|
361
|
+
/** Present for a batched clarification; `question` remains the first-item fallback. */
|
|
362
|
+
questions?: AskUserQuestionBatchItem[];
|
|
363
|
+
/**
|
|
364
|
+
* The ask tool call that raised this interrupt (mirrors the SDK field,
|
|
365
|
+
* present from `@librechat/agents` > 3.3.8). Lets the question/answer
|
|
366
|
+
* stamps target the exact tool-call part instead of guessing by
|
|
367
|
+
* position when a model emits several ask calls in one turn.
|
|
368
|
+
*/
|
|
369
|
+
tool_call_id?: string;
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Discriminated by `type`. Mirrors `@librechat/agents`'s `HumanInterruptPayload`
|
|
373
|
+
* so the SDK's `Run.getInterrupt()` output can be embedded directly.
|
|
374
|
+
*/
|
|
375
|
+
type HumanInterruptPayload = ToolApprovalInterruptPayload | AskUserQuestionInterruptPayload;
|
|
376
|
+
/**
|
|
377
|
+
* Server-side record of a job that is waiting for user input.
|
|
378
|
+
* Persisted with the job; consumed by approval routes and the status endpoint.
|
|
379
|
+
*/
|
|
380
|
+
interface PendingAction {
|
|
381
|
+
/** Stable identifier used in approval URLs */
|
|
382
|
+
actionId: string;
|
|
383
|
+
streamId: string;
|
|
384
|
+
conversationId?: string;
|
|
385
|
+
/** Stable per-turn identifier (LangGraph checkpoint_ns) when available */
|
|
386
|
+
runId?: string;
|
|
387
|
+
responseMessageId?: string;
|
|
388
|
+
payload: HumanInterruptPayload;
|
|
389
|
+
createdAt: number;
|
|
390
|
+
/** Optional expiry; clients should treat past `expiresAt` as stale */
|
|
391
|
+
expiresAt?: number;
|
|
392
|
+
/**
|
|
393
|
+
* SDK interrupt id (`RunInterruptResult.interruptId`). Persisted so a
|
|
394
|
+
* cross-process resume can correlate the decision with the LangGraph
|
|
395
|
+
* interrupt after the original `Run` object is gone.
|
|
396
|
+
*/
|
|
397
|
+
interruptId?: string;
|
|
398
|
+
/**
|
|
399
|
+
* LangGraph `thread_id` the run was bound to (`RunInterruptResult.threadId`).
|
|
400
|
+
* Required, with the checkpointer, to rebuild `Command({ resume })` on a
|
|
401
|
+
* worker that didn't originate the run.
|
|
402
|
+
*/
|
|
403
|
+
threadId?: string;
|
|
404
|
+
/**
|
|
405
|
+
* Fingerprint of the request fields that determine the agent/graph + tool set
|
|
406
|
+
* (endpoint, agent_id, model, spec, ephemeralAgent), captured at pause time. The
|
|
407
|
+
* resume route recomputes it from the resume request and rejects a mismatch — the
|
|
408
|
+
* guard that catches an ephemeral-agent config swap, where `agent_id` is undefined
|
|
409
|
+
* so the id check can't.
|
|
410
|
+
*/
|
|
411
|
+
requestFingerprint?: string;
|
|
412
|
+
/**
|
|
413
|
+
* Graph-determining request fields (endpoint, agent_id, model, spec, promptPrefix,
|
|
414
|
+
* ephemeralAgent) captured at pause. The resume route REPLAYS these onto the request
|
|
415
|
+
* before rebuilding the run, so a reload/cross-replica resume — where the client can
|
|
416
|
+
* no longer reconstruct the ephemeral config — still rebuilds the same agent/graph.
|
|
417
|
+
*/
|
|
418
|
+
resumeContext?: Record<string, unknown>;
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Scope of a tool-approval decision — drives the "remember this" persistence
|
|
422
|
+
* envelope. Storage of session/always decisions is a Slice B+ concern; the
|
|
423
|
+
* field is on the wire today so route signatures don't break later.
|
|
424
|
+
*/
|
|
425
|
+
type DecisionScope = 'once' | 'session' | 'always';
|
|
426
|
+
/**
|
|
427
|
+
* Per-tool decision returned from the approval UI.
|
|
428
|
+
* Wire format. The host adapts each entry to the SDK's discriminated
|
|
429
|
+
* `ToolApprovalDecision` (e.g. `{ type: 'edit', updatedInput }`) at the resume route.
|
|
430
|
+
*
|
|
431
|
+
* Constraints:
|
|
432
|
+
* - `editedArguments` is required when `decision === 'edit'`.
|
|
433
|
+
* - `responseText` is required when `decision === 'respond'`.
|
|
434
|
+
* - `reason` is optional metadata; useful for reject/edit audit trails.
|
|
435
|
+
* - `scope` defaults to `'once'`.
|
|
436
|
+
*/
|
|
437
|
+
interface ToolApprovalResolution {
|
|
438
|
+
tool_call_id: string;
|
|
439
|
+
decision: ToolApprovalDecisionType;
|
|
440
|
+
editedArguments?: Record<string, unknown>;
|
|
441
|
+
responseText?: string;
|
|
442
|
+
reason?: string;
|
|
443
|
+
scope?: DecisionScope;
|
|
444
|
+
}
|
|
445
|
+
/** Wire format for an ask-user-question response. */
|
|
446
|
+
interface AskUserQuestionResolution {
|
|
447
|
+
answer: string;
|
|
448
|
+
}
|
|
449
|
+
/** Wire format for a batched ask-user-question response. */
|
|
450
|
+
interface AskUserQuestionsResolution {
|
|
451
|
+
answers: Record<string, string>;
|
|
452
|
+
}
|
|
243
453
|
interface ExtendedMessageContent {
|
|
244
454
|
type?: string;
|
|
245
455
|
text?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
|
-
import type { AssistantsEndpoint, AgentProvider } from 'src/schemas';
|
|
2
|
+
import type { AssistantsEndpoint, AgentProvider, MemoryScope } from 'src/schemas';
|
|
3
3
|
import type { Agents, GraphEdge } from './agents';
|
|
4
4
|
import type { ContentTypes } from './runs';
|
|
5
5
|
import type { TFile } from './files';
|
|
@@ -188,6 +188,9 @@ export type SupportContact = {
|
|
|
188
188
|
name?: string;
|
|
189
189
|
email?: string;
|
|
190
190
|
};
|
|
191
|
+
export type AgentOwnerContact = {
|
|
192
|
+
name?: string;
|
|
193
|
+
};
|
|
191
194
|
/**
|
|
192
195
|
* Specifies who can invoke a tool.
|
|
193
196
|
* - 'direct': LLM can call directly
|
|
@@ -211,6 +214,21 @@ export type ToolOptions = {
|
|
|
211
214
|
* @default ['direct']
|
|
212
215
|
*/
|
|
213
216
|
allowed_callers?: AllowedCaller[];
|
|
217
|
+
/**
|
|
218
|
+
* If true (and the `run_in_background` capability is enabled), the tool's
|
|
219
|
+
* schema gains a `run_in_background` boolean so the model can dispatch the
|
|
220
|
+
* call detached and poll its result via `check_background_task`.
|
|
221
|
+
* @default false
|
|
222
|
+
*/
|
|
223
|
+
run_in_background?: boolean;
|
|
224
|
+
/**
|
|
225
|
+
* If true (and the `tool_intents` capability is enabled), the tool's schema
|
|
226
|
+
* gains an `intent` string as its FIRST property — one model-authored
|
|
227
|
+
* sentence per call, rendered as the call's live status label. Native host
|
|
228
|
+
* tools default on while the capability is enabled; `false` opts one out.
|
|
229
|
+
* @default false
|
|
230
|
+
*/
|
|
231
|
+
describe_intent?: boolean;
|
|
214
232
|
};
|
|
215
233
|
/**
|
|
216
234
|
* Map of tool_id to its configuration options.
|
|
@@ -255,12 +273,28 @@ export type Agent = {
|
|
|
255
273
|
edges?: GraphEdge[];
|
|
256
274
|
end_after_tools?: boolean;
|
|
257
275
|
hide_sequential_outputs?: boolean;
|
|
276
|
+
/** Per-agent opt-in for stateful code sessions (requires the app-level capability). */
|
|
277
|
+
stateful_code_sessions?: boolean;
|
|
258
278
|
artifacts?: ArtifactModes;
|
|
259
279
|
recursion_limit?: number;
|
|
260
280
|
isPublic?: boolean;
|
|
281
|
+
/**
|
|
282
|
+
* Whether the requesting user holds EDIT on this agent, so a single VIEW-scoped fetch can
|
|
283
|
+
* serve consumers that only need the editable subset instead of issuing a second full
|
|
284
|
+
* paginated walk under an EDIT-scoped cache key.
|
|
285
|
+
*
|
|
286
|
+
* Set by the list endpoint only; single-agent responses omit it. Treat absence as unknown
|
|
287
|
+
* and fail open (`isEditable !== false`), never as `false`, since a client on an older
|
|
288
|
+
* server would otherwise see an empty list rather than too many rows.
|
|
289
|
+
*
|
|
290
|
+
* Reflects the caller's ACL grant. The `MANAGE_AGENTS` capability bypasses ACL on write,
|
|
291
|
+
* so a capability holder can edit agents this flag reports as not editable.
|
|
292
|
+
*/
|
|
293
|
+
isEditable?: boolean;
|
|
261
294
|
version?: number;
|
|
262
295
|
category?: string;
|
|
263
296
|
support_contact?: SupportContact;
|
|
297
|
+
owner_contact?: AgentOwnerContact;
|
|
264
298
|
/** Per-tool configuration options (deferred loading, allowed callers, etc.) */
|
|
265
299
|
tool_options?: AgentToolOptions;
|
|
266
300
|
/** Optional allowlist of skill ObjectIds. Only applies when `skills_enabled`. */
|
|
@@ -270,6 +304,8 @@ export type Agent = {
|
|
|
270
304
|
skills_enabled?: boolean;
|
|
271
305
|
/** Subagent spawning configuration — isolated-context child agents. */
|
|
272
306
|
subagents?: AgentSubagentsConfig;
|
|
307
|
+
/** Memory partition: `agent` isolates memories per (user, agent); default shared pool */
|
|
308
|
+
memory_scope?: MemoryScope;
|
|
273
309
|
};
|
|
274
310
|
export type TAgentsMap = Record<string, Agent | undefined>;
|
|
275
311
|
export type AgentCreateParams = {
|
|
@@ -282,7 +318,7 @@ export type AgentCreateParams = {
|
|
|
282
318
|
provider: AgentProvider;
|
|
283
319
|
model: string | null;
|
|
284
320
|
model_parameters: AgentModelParameters;
|
|
285
|
-
} & Pick<Agent, 'agent_ids' | 'edges' | 'end_after_tools' | 'hide_sequential_outputs' | 'artifacts' | 'recursion_limit' | 'category' | 'support_contact' | 'tool_options' | 'skills' | 'skills_enabled' | 'subagents'>;
|
|
321
|
+
} & Pick<Agent, 'agent_ids' | 'edges' | 'end_after_tools' | 'hide_sequential_outputs' | 'stateful_code_sessions' | 'artifacts' | 'recursion_limit' | 'category' | 'support_contact' | 'tool_options' | 'skills' | 'skills_enabled' | 'subagents' | 'memory_scope'>;
|
|
286
322
|
export type AgentUpdateParams = {
|
|
287
323
|
name?: string | null;
|
|
288
324
|
description?: string | null;
|
|
@@ -294,7 +330,7 @@ export type AgentUpdateParams = {
|
|
|
294
330
|
provider?: AgentProvider;
|
|
295
331
|
model?: string | null;
|
|
296
332
|
model_parameters?: AgentModelParameters;
|
|
297
|
-
} & Pick<Agent, 'agent_ids' | 'edges' | 'end_after_tools' | 'hide_sequential_outputs' | 'artifacts' | 'recursion_limit' | 'category' | 'support_contact' | 'tool_options' | 'skills' | 'skills_enabled' | 'subagents'>;
|
|
333
|
+
} & Pick<Agent, 'agent_ids' | 'edges' | 'end_after_tools' | 'hide_sequential_outputs' | 'stateful_code_sessions' | 'artifacts' | 'recursion_limit' | 'category' | 'support_contact' | 'tool_options' | 'skills' | 'skills_enabled' | 'subagents' | 'memory_scope'>;
|
|
298
334
|
export type AgentListParams = {
|
|
299
335
|
limit?: number;
|
|
300
336
|
requiredPermission: number;
|
|
@@ -476,6 +512,23 @@ export type SummaryContentPart = {
|
|
|
476
512
|
contentIndex: number;
|
|
477
513
|
};
|
|
478
514
|
};
|
|
515
|
+
/**
|
|
516
|
+
* A user steering message injected mid-run at a tool-batch boundary.
|
|
517
|
+
* Persisted inline in the response message's content array (keyed by the
|
|
518
|
+
* type name like `text`/`think` so token counting reads it for free);
|
|
519
|
+
* replayed as a user message on subsequent turns by `formatAgentMessages`.
|
|
520
|
+
*/
|
|
521
|
+
export type SteerContentPart = {
|
|
522
|
+
type: ContentTypes.STEER;
|
|
523
|
+
steer: string;
|
|
524
|
+
steerId?: string;
|
|
525
|
+
/** Stable optimistic-client id used to settle a POST whose response was lost. */
|
|
526
|
+
clientSteerId?: string;
|
|
527
|
+
createdAt?: number;
|
|
528
|
+
/** Attachments steered with the message; re-encoded per turn on replay
|
|
529
|
+
* like any other user-message media (refs only, never encoded data). */
|
|
530
|
+
files?: Partial<TFile>[];
|
|
531
|
+
};
|
|
479
532
|
export type TMessageContentParts = ({
|
|
480
533
|
type: ContentTypes.ERROR;
|
|
481
534
|
text?: string | TextData;
|
|
@@ -483,17 +536,36 @@ export type TMessageContentParts = ({
|
|
|
483
536
|
} & ContentMetadata) | ({
|
|
484
537
|
type: ContentTypes.THINK;
|
|
485
538
|
think?: string | TextData;
|
|
486
|
-
} & ContentMetadata) | ({
|
|
539
|
+
} & ContentMetadata) | (SteerContentPart & ContentMetadata) | ({
|
|
487
540
|
type: ContentTypes.TEXT;
|
|
488
541
|
text?: string | TextData;
|
|
489
542
|
tool_call_ids?: string[];
|
|
543
|
+
/** Open Responses semantic channel for assistant text. */
|
|
544
|
+
phase?: 'commentary' | 'final_answer';
|
|
490
545
|
} & ContentMetadata) | ({
|
|
491
546
|
type: ContentTypes.TOOL_CALL;
|
|
492
547
|
tool_call: (CodeToolCall | RetrievalToolCall | FileSearchToolCall | FunctionToolCall | Agents.AgentToolCall) & PartMetadata;
|
|
493
548
|
} & ContentMetadata) | ({
|
|
494
549
|
type: ContentTypes.IMAGE_FILE;
|
|
495
550
|
image_file: ImageFile & PartMetadata;
|
|
496
|
-
} & ContentMetadata) | (SummaryContentPart & ContentMetadata) | (
|
|
551
|
+
} & ContentMetadata) | (SummaryContentPart & ContentMetadata) | ({
|
|
552
|
+
/** One-line LLM-generated note describing a completed tool batch. UI-only:
|
|
553
|
+
* never sent to the model (stripped before payload formatting). */
|
|
554
|
+
type: ContentTypes.ACTIVITY_LABEL;
|
|
555
|
+
activity_label?: string;
|
|
556
|
+
/** Missing means the legacy/per-batch activity label. */
|
|
557
|
+
activity_label_type?: 'phase';
|
|
558
|
+
tool_call_ids?: string[];
|
|
559
|
+
/** Parent phase bounds and telemetry. */
|
|
560
|
+
activity_start_index?: number;
|
|
561
|
+
/** Exclusive end of the grouped content; may precede the marker itself. */
|
|
562
|
+
activity_end_index?: number;
|
|
563
|
+
activity_count?: number;
|
|
564
|
+
agent_ids?: string[];
|
|
565
|
+
/** ok = all tools succeeded, failed = all failed, partial = mixed. */
|
|
566
|
+
status?: 'ok' | 'partial' | 'failed';
|
|
567
|
+
pending?: boolean;
|
|
568
|
+
} & ContentMetadata) | (Agents.AgentUpdate & ContentMetadata) | (Agents.MessageContentImageUrl & ContentMetadata) | (Agents.MessageContentVideoUrl & ContentMetadata) | (Agents.MessageContentInputAudio & ContentMetadata);
|
|
497
569
|
export type StreamContentData = TMessageContentParts & {
|
|
498
570
|
/** The index of the current content part */
|
|
499
571
|
index: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EToolResources } from './assistants';
|
|
2
1
|
import type { CodeEnvRef } from '../codeEnvRef';
|
|
2
|
+
import { EToolResources } from './assistants';
|
|
3
3
|
export declare enum FileSources {
|
|
4
4
|
local = "local",
|
|
5
5
|
firebase = "firebase",
|
|
@@ -34,12 +34,16 @@ export declare enum FileContext {
|
|
|
34
34
|
context = "context",
|
|
35
35
|
bytes = "bytes"
|
|
36
36
|
}
|
|
37
|
+
/** Structural type for a compiled matcher: a native `RegExp` or a linear-time engine both satisfy it. Only `test` is ever called on `supportedMimeTypes`. */
|
|
38
|
+
export type RegexLike = {
|
|
39
|
+
test(input: string): boolean;
|
|
40
|
+
};
|
|
37
41
|
export type EndpointFileConfig = {
|
|
38
42
|
disabled?: boolean;
|
|
39
43
|
fileLimit?: number;
|
|
40
44
|
fileSizeLimit?: number;
|
|
41
45
|
totalSizeLimit?: number;
|
|
42
|
-
supportedMimeTypes?:
|
|
46
|
+
supportedMimeTypes?: RegexLike[];
|
|
43
47
|
};
|
|
44
48
|
export type FileConfig = {
|
|
45
49
|
endpoints: {
|
|
@@ -58,15 +62,15 @@ export type FileConfig = {
|
|
|
58
62
|
quality?: number;
|
|
59
63
|
};
|
|
60
64
|
ocr?: {
|
|
61
|
-
supportedMimeTypes?:
|
|
65
|
+
supportedMimeTypes?: RegexLike[];
|
|
62
66
|
};
|
|
63
67
|
text?: {
|
|
64
|
-
supportedMimeTypes?:
|
|
68
|
+
supportedMimeTypes?: RegexLike[];
|
|
65
69
|
};
|
|
66
70
|
stt?: {
|
|
67
|
-
supportedMimeTypes?:
|
|
71
|
+
supportedMimeTypes?: RegexLike[];
|
|
68
72
|
};
|
|
69
|
-
checkType?: (fileType: string, supportedTypes:
|
|
73
|
+
checkType?: (fileType: string, supportedTypes: RegexLike[]) => boolean;
|
|
70
74
|
};
|
|
71
75
|
export type FileConfigInput = {
|
|
72
76
|
endpoints?: {
|
|
@@ -92,7 +96,7 @@ export type FileConfigInput = {
|
|
|
92
96
|
stt?: {
|
|
93
97
|
supportedMimeTypes?: string[];
|
|
94
98
|
};
|
|
95
|
-
checkType?: (fileType: string, supportedTypes:
|
|
99
|
+
checkType?: (fileType: string, supportedTypes: RegexLike[]) => boolean;
|
|
96
100
|
};
|
|
97
101
|
export type TFile = {
|
|
98
102
|
_id?: string;
|
|
@@ -217,6 +221,13 @@ export type VoiceOptions = {
|
|
|
217
221
|
onMutate?: () => void | Promise<unknown>;
|
|
218
222
|
onError?: (error: unknown, variables: unknown, context?: unknown) => void;
|
|
219
223
|
};
|
|
224
|
+
export type TFilesUsageBody = {
|
|
225
|
+
file_ids: string[];
|
|
226
|
+
};
|
|
227
|
+
export type TFilesUsageResponse = {
|
|
228
|
+
/** Count of queued uploads whose TTL hold was extended. */
|
|
229
|
+
held: number;
|
|
230
|
+
};
|
|
220
231
|
export type DeleteFilesResponse = {
|
|
221
232
|
message: string;
|
|
222
233
|
result: Record<string, unknown>;
|
|
@@ -39,5 +39,30 @@ export type MCPServerDBObjectResponse = {
|
|
|
39
39
|
serverName: string;
|
|
40
40
|
/** True if access is only via agent (not directly shared with user) */
|
|
41
41
|
consumeOnly?: boolean;
|
|
42
|
+
/** True when chat request fields are required before the server can connect. */
|
|
43
|
+
requestScoped?: boolean;
|
|
42
44
|
} & MCPOptions;
|
|
43
45
|
export type MCPServersListResponse = Record<string, MCPServerDBObjectResponse>;
|
|
46
|
+
export type MCPReinitializeFailureReason = 'unreachable' | 'missing_custom_user_vars' | 'oauth_required' | 'initialization_failed';
|
|
47
|
+
export interface MCPReinitializeResponse {
|
|
48
|
+
success: boolean;
|
|
49
|
+
message: string;
|
|
50
|
+
serverName: string;
|
|
51
|
+
oauthRequired?: boolean;
|
|
52
|
+
oauthUrl?: string | null;
|
|
53
|
+
/** Shared OAuth attempt identifier used to poll durable flow state. */
|
|
54
|
+
flowId?: string;
|
|
55
|
+
/** Remaining OAuth completion window for this attempt, in milliseconds. */
|
|
56
|
+
oauthTimeout?: number;
|
|
57
|
+
failureReason?: MCPReinitializeFailureReason;
|
|
58
|
+
missingUserVars?: string[];
|
|
59
|
+
/** True when the server uses request-scoped placeholders and the connection
|
|
60
|
+
* was deferred to the next chat turn (tools are not enumerable up front). */
|
|
61
|
+
connectionDeferred?: boolean;
|
|
62
|
+
}
|
|
63
|
+
export interface MCPOAuthStatusResponse {
|
|
64
|
+
status: 'PENDING' | 'COMPLETED' | 'FAILED';
|
|
65
|
+
completed: boolean;
|
|
66
|
+
failed: boolean;
|
|
67
|
+
error?: string;
|
|
68
|
+
}
|
|
@@ -114,6 +114,7 @@ export type ArchiveConversationOptions = MutationOptions<types.TArchiveConversat
|
|
|
114
114
|
export type PinConversationOptions = MutationOptions<types.TPinConversationResponse, types.TPinConversationRequest>;
|
|
115
115
|
export type DuplicateConvoOptions = MutationOptions<types.TDuplicateConvoResponse, types.TDuplicateConvoRequest>;
|
|
116
116
|
export type ForkConvoOptions = MutationOptions<types.TForkConvoResponse, types.TForkConvoRequest>;
|
|
117
|
+
export type ForkSharedConvoOptions = MutationOptions<types.TForkConvoResponse, types.TForkSharedConvoRequest>;
|
|
117
118
|
export type CreateSharedLinkOptions = MutationOptions<types.TSharedLink, Partial<types.TSharedLink>>;
|
|
118
119
|
export type updateTagsInConvoOptions = MutationOptions<types.TTagConversationResponse, types.TTagConversationRequest>;
|
|
119
120
|
export type UpdateSharedLinkOptions = MutationOptions<types.TSharedLink, Partial<types.TSharedLink>>;
|
|
@@ -64,7 +64,7 @@ export interface SharedLinksListParams {
|
|
|
64
64
|
export type SharedLinkItem = {
|
|
65
65
|
shareId: string;
|
|
66
66
|
title: string;
|
|
67
|
-
createdAt:
|
|
67
|
+
createdAt: string;
|
|
68
68
|
conversationId: string;
|
|
69
69
|
};
|
|
70
70
|
export interface SharedLinksResponse {
|
|
@@ -120,6 +120,10 @@ export type TUserMemory = {
|
|
|
120
120
|
value: string;
|
|
121
121
|
updated_at: string;
|
|
122
122
|
tokenCount?: number;
|
|
123
|
+
/** Agent partition this memory belongs to; absent = shared personal pool */
|
|
124
|
+
agentId?: string;
|
|
125
|
+
/** Display name of the partition's agent, resolved server-side when available */
|
|
126
|
+
agentName?: string;
|
|
123
127
|
};
|
|
124
128
|
export type MemoriesResponse = {
|
|
125
129
|
memories: TUserMemory[];
|
|
@@ -163,6 +167,7 @@ export type ListRolesResponse = {
|
|
|
163
167
|
export interface MCPServerStatus {
|
|
164
168
|
requiresOAuth: boolean;
|
|
165
169
|
connectionState: 'disconnected' | 'connecting' | 'connected' | 'error';
|
|
170
|
+
authorizationState?: 'not_required' | 'authorizing' | 'authorized' | 'needs_authorization' | 'error';
|
|
166
171
|
}
|
|
167
172
|
export interface MCPConnectionStatusResponse {
|
|
168
173
|
success: boolean;
|
|
@@ -175,6 +180,7 @@ export interface MCPServerConnectionStatusResponse {
|
|
|
175
180
|
serverName: string;
|
|
176
181
|
requiresOAuth: boolean;
|
|
177
182
|
connectionStatus: 'disconnected' | 'connecting' | 'connected' | 'error';
|
|
183
|
+
authorizationState?: MCPServerStatus['authorizationState'];
|
|
178
184
|
}
|
|
179
185
|
export interface MCPAuthValuesResponse {
|
|
180
186
|
success: boolean;
|
|
@@ -191,8 +197,16 @@ export type TUserFavorite = {
|
|
|
191
197
|
model?: string;
|
|
192
198
|
endpoint?: string;
|
|
193
199
|
spec?: string;
|
|
194
|
-
|
|
195
|
-
|
|
200
|
+
};
|
|
201
|
+
/**
|
|
202
|
+
* Tool favorites — starred marketplace items (built-in capabilities, plugin
|
|
203
|
+
* tools, MCP servers, skills). Identity is the compound (itemType, itemId)
|
|
204
|
+
* pair, matching the marketplace `itemKey` format `itemType:itemId`.
|
|
205
|
+
*/
|
|
206
|
+
export type TToolFavoriteType = 'builtin' | 'tool' | 'mcp' | 'skill';
|
|
207
|
+
export type TToolFavorite = {
|
|
208
|
+
itemType: TToolFavoriteType;
|
|
209
|
+
itemId: string;
|
|
196
210
|
};
|
|
197
211
|
export type GraphTokenParams = {
|
|
198
212
|
scopes: string;
|