librechat-data-provider 0.8.521 → 0.8.522
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-pwrlWjJs.mjs → data-service-CaB7saTP.mjs} +1145 -37
- package/dist/data-service-CaB7saTP.mjs.map +1 -0
- package/dist/{data-service-DOIF4BkW.js → data-service-D5kHzBt-.js} +1588 -36
- package/dist/data-service-D5kHzBt-.js.map +1 -0
- package/dist/index.js +947 -36
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +825 -37
- package/dist/index.mjs.map +1 -1
- package/dist/react-query/index.js +2 -1
- package/dist/react-query/index.js.map +1 -1
- package/dist/react-query/index.mjs +2 -1
- package/dist/react-query/index.mjs.map +1 -1
- package/dist/types/accessPermissions.d.ts +4 -0
- package/dist/types/actions.d.ts +2 -2
- package/dist/types/agentToolOptions.d.ts +11 -0
- package/dist/types/api-endpoints.d.ts +18 -0
- package/dist/types/bedrock.d.ts +168 -0
- package/dist/types/cadence.d.ts +33 -0
- package/dist/types/codeEnvRef.d.ts +21 -0
- package/dist/types/config.d.ts +9060 -1135
- package/dist/types/data-service.d.ts +40 -2
- package/dist/types/file-config.d.ts +1 -0
- package/dist/types/filters.d.ts +1422 -0
- package/dist/types/generate.d.ts +79 -1
- package/dist/types/index.d.ts +10 -0
- package/dist/types/keys.d.ts +23 -2
- package/dist/types/langchain.d.ts +4 -0
- package/dist/types/limits.d.ts +13 -0
- package/dist/types/mcp.d.ts +299 -210
- package/dist/types/messages.d.ts +5 -0
- package/dist/types/models.d.ts +732 -68
- package/dist/types/parameterSettings.d.ts +5 -1
- package/dist/types/parsers.d.ts +10 -0
- package/dist/types/permissions.d.ts +42 -1
- package/dist/types/providers.d.ts +36 -0
- package/dist/types/request.d.ts +2 -2
- package/dist/types/roles.d.ts +34 -0
- package/dist/types/runSteps.d.ts +59 -0
- package/dist/types/schemas.d.ts +1191 -26
- package/dist/types/stateful-code.d.ts +7 -0
- package/dist/types/types/agents.d.ts +92 -7
- package/dist/types/types/assistants.d.ts +96 -5
- package/dist/types/types/files.d.ts +12 -2
- package/dist/types/types/index.d.ts +2 -0
- package/dist/types/types/insights.d.ts +62 -0
- package/dist/types/types/mutations.d.ts +1 -0
- package/dist/types/types/queries.d.ts +30 -2
- package/dist/types/types/queuedTurns.d.ts +870 -0
- package/dist/types/types/runs.d.ts +95 -4
- package/dist/types/types/schedules.d.ts +306 -0
- package/dist/types/types/skills.d.ts +9 -0
- package/dist/types/types/subagents.d.ts +159 -0
- package/dist/types/types/web.d.ts +12 -2
- package/dist/types/types.d.ts +61 -1
- package/package.json +4 -2
- package/dist/data-service-DOIF4BkW.js.map +0 -1
- package/dist/data-service-pwrlWjJs.mjs.map +0 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const STATEFUL_CODE_ENVIRONMENTS: readonly ["user", "agent-user", "conversation"];
|
|
2
|
+
export type StatefulCodeEnvironment = (typeof STATEFUL_CODE_ENVIRONMENTS)[number];
|
|
3
|
+
/** Resolve a deployment allowlist in stable UI order. An omitted value preserves
|
|
4
|
+
* the backward-compatible behavior where every environment is available. */
|
|
5
|
+
export declare function resolveAllowedStatefulCodeEnvironments(configured?: readonly StatefulCodeEnvironment[] | null): StatefulCodeEnvironment[];
|
|
6
|
+
/** Keep an allowed preference, otherwise select the first deployment-allowed scope. */
|
|
7
|
+
export declare function resolveStatefulCodeEnvironment(preferred: StatefulCodeEnvironment | null | undefined, configured?: readonly StatefulCodeEnvironment[] | null): StatefulCodeEnvironment | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TTokenUsageEvent, TContextUsageEvent, TPendingSteer } from './runs';
|
|
2
|
-
import type { FunctionToolCall, SummaryContentPart } from './assistants';
|
|
3
2
|
import type { TAttachment, TPlugin } from 'src/schemas';
|
|
3
|
+
import type { SummaryContentPart } from './assistants';
|
|
4
4
|
import { StepTypes, ContentTypes, ToolCallTypes } from './runs';
|
|
5
5
|
export declare namespace Agents {
|
|
6
6
|
type MessageType = 'human' | 'ai' | 'generic' | 'system' | 'function' | 'tool' | 'remove';
|
|
@@ -52,16 +52,36 @@ export declare namespace Agents {
|
|
|
52
52
|
* A call to a tool.
|
|
53
53
|
*/
|
|
54
54
|
type ToolCall = {
|
|
55
|
-
/** Type ("tool_call") according to Assistants Tool Call Structure
|
|
56
|
-
|
|
55
|
+
/** Type ("tool_call") according to Assistants Tool Call Structure; optional literal
|
|
56
|
+
* form included to mirror langchain's ToolCall, whose `type` is optional. */
|
|
57
|
+
type?: ToolCallTypes.TOOL_CALL | 'tool_call';
|
|
57
58
|
/** The name of the tool to be called */
|
|
58
59
|
name: string;
|
|
60
|
+
/** Host-derived MCP server identity retained to disambiguate historical tool keys. */
|
|
61
|
+
mcpServerName?: string;
|
|
59
62
|
/** The arguments to the tool call */
|
|
60
63
|
args?: string | Record<string, any>;
|
|
61
64
|
/** If provided, an identifier associated with the tool call */
|
|
62
65
|
id?: string;
|
|
66
|
+
/** Host run-step identity; unlike provider ids, this is unique across turns. */
|
|
67
|
+
stepId?: string;
|
|
63
68
|
/** If provided, the output of the tool call */
|
|
64
69
|
output?: string;
|
|
70
|
+
/** Host-owned durable receipt for a detached ordinary tool result.
|
|
71
|
+
* It lives beside the original call so reload, manual collection, and
|
|
72
|
+
* automatic continuation all arbitrate the same result identity. */
|
|
73
|
+
backgroundTask?: {
|
|
74
|
+
version: 1;
|
|
75
|
+
taskId: string;
|
|
76
|
+
toolName: string;
|
|
77
|
+
status: 'completed' | 'error';
|
|
78
|
+
settledAt: Date;
|
|
79
|
+
resultClaim?: {
|
|
80
|
+
kind: 'manual' | 'wakeup';
|
|
81
|
+
claimId: string;
|
|
82
|
+
claimedAt: Date;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
65
85
|
/** The tool call was rejected before execution because its input failed schema validation. */
|
|
66
86
|
inputValidationError?: true;
|
|
67
87
|
/** Auth URL */
|
|
@@ -177,7 +197,35 @@ export declare namespace Agents {
|
|
|
177
197
|
groupId?: number;
|
|
178
198
|
stepDetails: StepDetails;
|
|
179
199
|
summary?: SummaryContentPart;
|
|
180
|
-
usage
|
|
200
|
+
/** Optional to mirror the agents SDK, which omits usage until a step reports it. */
|
|
201
|
+
usage?: null | object;
|
|
202
|
+
/** Epoch ms the step was opened. Emitted by `@librechat/agents` >= 3.4.6. */
|
|
203
|
+
created_at?: number;
|
|
204
|
+
status?: RunStepStatus;
|
|
205
|
+
};
|
|
206
|
+
/** Lifecycle status of a run step. `in_progress` until a terminal close. */
|
|
207
|
+
type RunStepStatus = 'in_progress' | 'completed' | 'cancelled' | 'failed';
|
|
208
|
+
/** Terminal status a run step can close with. */
|
|
209
|
+
type RunStepClosedStatus = Exclude<RunStepStatus, 'in_progress'>;
|
|
210
|
+
/**
|
|
211
|
+
* Payload of {@link StepEvents.ON_RUN_STEP_CLOSED}. Emitted once per step
|
|
212
|
+
* when it reaches a terminal state, including steps swept at end-of-run
|
|
213
|
+
* because the caller aborted — which is the only signal that distinguishes
|
|
214
|
+
* a stopped step from one still in flight.
|
|
215
|
+
*/
|
|
216
|
+
type RunStepClosedEvent = {
|
|
217
|
+
id: string;
|
|
218
|
+
index: number;
|
|
219
|
+
type: StepTypes;
|
|
220
|
+
status: RunStepClosedStatus;
|
|
221
|
+
/** Epoch ms the step was opened, when the emitter knows it. */
|
|
222
|
+
created_at?: number;
|
|
223
|
+
/** Epoch ms the step reached its terminal state. */
|
|
224
|
+
closed_at: number;
|
|
225
|
+
runId?: string;
|
|
226
|
+
agentId?: string;
|
|
227
|
+
groupId?: number;
|
|
228
|
+
stepIndex?: number;
|
|
181
229
|
};
|
|
182
230
|
/** Content part for aggregated message content */
|
|
183
231
|
interface ContentPart {
|
|
@@ -197,6 +245,16 @@ export declare namespace Agents {
|
|
|
197
245
|
manualSkills?: string[];
|
|
198
246
|
alwaysAppliedSkills?: string[];
|
|
199
247
|
}
|
|
248
|
+
/** Client-safe state for one MCP authorization prompt that remains actionable. */
|
|
249
|
+
interface PendingMCPOAuthPrompt {
|
|
250
|
+
stepId: string;
|
|
251
|
+
runId?: string;
|
|
252
|
+
index: number;
|
|
253
|
+
toolCallId?: string;
|
|
254
|
+
toolName: string;
|
|
255
|
+
authURL: string;
|
|
256
|
+
expiresAt?: number;
|
|
257
|
+
}
|
|
200
258
|
/** State data sent to reconnecting clients */
|
|
201
259
|
interface ResumeState {
|
|
202
260
|
runSteps: RunStep[];
|
|
@@ -204,6 +262,8 @@ export declare namespace Agents {
|
|
|
204
262
|
aggregatedContent?: MessageContentComplex[];
|
|
205
263
|
userMessage?: UserMessageMeta;
|
|
206
264
|
responseMessageId?: string;
|
|
265
|
+
/** True when the live generation replaces an existing assistant branch. */
|
|
266
|
+
isRegenerate?: boolean;
|
|
207
267
|
conversationId?: string;
|
|
208
268
|
sender?: string;
|
|
209
269
|
iconURL?: string;
|
|
@@ -220,6 +280,8 @@ export declare namespace Agents {
|
|
|
220
280
|
data?: unknown;
|
|
221
281
|
[key: string]: unknown;
|
|
222
282
|
}>;
|
|
283
|
+
/** Pending MCP authorization prompts projected from durable stream state. */
|
|
284
|
+
pendingOAuthPrompts?: PendingMCPOAuthPrompt[];
|
|
223
285
|
/** Cumulative provider-reported usage for the run; backfills usage totals on resume */
|
|
224
286
|
collectedUsage?: TTokenUsageEvent[];
|
|
225
287
|
/** Latest context window snapshot; restores the usage gauge on resume */
|
|
@@ -263,7 +325,7 @@ export declare namespace Agents {
|
|
|
263
325
|
};
|
|
264
326
|
type ToolCallsDetails = {
|
|
265
327
|
type: StepTypes.TOOL_CALLS;
|
|
266
|
-
tool_calls
|
|
328
|
+
tool_calls?: AgentToolCall[];
|
|
267
329
|
};
|
|
268
330
|
type ToolCallDelta = {
|
|
269
331
|
type: StepTypes.TOOL_CALLS | string;
|
|
@@ -277,7 +339,21 @@ export declare namespace Agents {
|
|
|
277
339
|
description?: string;
|
|
278
340
|
};
|
|
279
341
|
};
|
|
280
|
-
|
|
342
|
+
/**
|
|
343
|
+
* Mirrors the agents SDK's function tool-call variant: `arguments` may arrive as a
|
|
344
|
+
* parsed object, and `output` is attached by LibreChat aggregation only once available
|
|
345
|
+
* (the legacy assistants `FunctionToolCall` requires both as string/present).
|
|
346
|
+
*/
|
|
347
|
+
type AgentFunctionToolCall = {
|
|
348
|
+
id: string;
|
|
349
|
+
type: 'function';
|
|
350
|
+
function: {
|
|
351
|
+
name: string;
|
|
352
|
+
arguments: string | object;
|
|
353
|
+
output?: string | null;
|
|
354
|
+
};
|
|
355
|
+
};
|
|
356
|
+
type AgentToolCall = AgentFunctionToolCall | ToolCall;
|
|
281
357
|
/**
|
|
282
358
|
* Human-in-the-loop interrupt categories. The discriminator on
|
|
283
359
|
* {@link HumanInterruptPayload}.
|
|
@@ -646,8 +722,17 @@ export type GraphEdge = {
|
|
|
646
722
|
*
|
|
647
723
|
* For handoff edges: Description for the input parameter that the handoff tool accepts,
|
|
648
724
|
* allowing the supervisor to pass specific instructions/context to the transferred agent.
|
|
725
|
+
*
|
|
726
|
+
* The callback receives a minimal structural view of the run's messages (data-provider
|
|
727
|
+
* cannot depend on langchain's BaseMessage): every langchain message satisfies
|
|
728
|
+
* `{ content: unknown }`, and callbacks typed against richer structural message shapes
|
|
729
|
+
* remain assignable. The promise branch mirrors the agents SDK signature exactly —
|
|
730
|
+
* widening it (e.g. to `Promise<string | undefined>`) would break assignability of
|
|
731
|
+
* stored edges into the SDK's `GraphEdge`.
|
|
649
732
|
*/
|
|
650
|
-
prompt?: string | ((messages:
|
|
733
|
+
prompt?: string | ((messages: {
|
|
734
|
+
content: unknown;
|
|
735
|
+
}[], runStartIndex: number) => string | Promise<string> | undefined);
|
|
651
736
|
/**
|
|
652
737
|
* When true, excludes messages from startIndex when adding prompt.
|
|
653
738
|
* Automatically set to true when {results} variable is used in prompt.
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
|
-
import type { AssistantsEndpoint, AgentProvider, MemoryScope } from 'src/schemas';
|
|
2
|
+
import type { AssistantsEndpoint, AgentProvider, MemoryScope, SkillsScope } from 'src/schemas';
|
|
3
|
+
import type { StatefulCodeEnvironment } from '../stateful-code';
|
|
3
4
|
import type { Agents, GraphEdge } from './agents';
|
|
4
5
|
import type { ContentTypes } from './runs';
|
|
5
6
|
import type { TFile } from './files';
|
|
6
7
|
import { ArtifactModes } from 'src/artifacts';
|
|
8
|
+
export { STATEFUL_CODE_ENVIRONMENTS, resolveStatefulCodeEnvironment, resolveAllowedStatefulCodeEnvironments, } from '../stateful-code';
|
|
9
|
+
export type { StatefulCodeEnvironment } from '../stateful-code';
|
|
7
10
|
export type Schema = OpenAPIV3.SchemaObject & {
|
|
8
11
|
description?: string;
|
|
9
12
|
};
|
|
@@ -238,14 +241,36 @@ export type AgentToolOptions = Record<string, ToolOptions>;
|
|
|
238
241
|
/**
|
|
239
242
|
* Configuration for spawning subagents (isolated-context child agents) from an agent.
|
|
240
243
|
* When `enabled` is true, the agent gets a subagent-spawn tool that can delegate work
|
|
241
|
-
* to
|
|
244
|
+
* to itself, listed single-agent targets, and/or explicit saved-agent teams.
|
|
242
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
|
+
};
|
|
243
266
|
export type AgentSubagentsConfig = {
|
|
244
267
|
enabled?: boolean;
|
|
245
268
|
/** When true (default), the agent may spawn itself in an isolated context. */
|
|
246
269
|
allowSelf?: boolean;
|
|
247
270
|
/** Specific agents that may be spawned as subagents. */
|
|
248
271
|
agent_ids?: string[];
|
|
272
|
+
/** Explicit saved-agent teams that may be spawned as bounded child graphs. */
|
|
273
|
+
graphs?: AgentSubagentGraph[];
|
|
249
274
|
};
|
|
250
275
|
export type Agent = {
|
|
251
276
|
_id?: string;
|
|
@@ -275,6 +300,10 @@ export type Agent = {
|
|
|
275
300
|
hide_sequential_outputs?: boolean;
|
|
276
301
|
/** Per-agent opt-in for stateful code sessions (requires the app-level capability). */
|
|
277
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;
|
|
278
307
|
artifacts?: ArtifactModes;
|
|
279
308
|
recursion_limit?: number;
|
|
280
309
|
isPublic?: boolean;
|
|
@@ -297,11 +326,17 @@ export type Agent = {
|
|
|
297
326
|
owner_contact?: AgentOwnerContact;
|
|
298
327
|
/** Per-tool configuration options (deferred loading, allowed callers, etc.) */
|
|
299
328
|
tool_options?: AgentToolOptions;
|
|
329
|
+
/** Attached action registrations, each `${encodedDomain}${actionDelimiter}${action_id}` */
|
|
330
|
+
actions?: string[];
|
|
300
331
|
/** Optional allowlist of skill ObjectIds. Only applies when `skills_enabled`. */
|
|
301
332
|
skills?: string[];
|
|
302
333
|
/** Master toggle for skill use on this agent. `true` = active (full catalog unless
|
|
303
334
|
* `skills` narrows it). `false`/undefined = inactive (no skills available). */
|
|
304
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;
|
|
305
340
|
/** Subagent spawning configuration — isolated-context child agents. */
|
|
306
341
|
subagents?: AgentSubagentsConfig;
|
|
307
342
|
/** Memory partition: `agent` isolates memories per (user, agent); default shared pool */
|
|
@@ -318,7 +353,7 @@ export type AgentCreateParams = {
|
|
|
318
353
|
provider: AgentProvider;
|
|
319
354
|
model: string | null;
|
|
320
355
|
model_parameters: AgentModelParameters;
|
|
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'>;
|
|
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'>;
|
|
322
357
|
export type AgentUpdateParams = {
|
|
323
358
|
name?: string | null;
|
|
324
359
|
description?: string | null;
|
|
@@ -330,7 +365,7 @@ export type AgentUpdateParams = {
|
|
|
330
365
|
provider?: AgentProvider;
|
|
331
366
|
model?: string | null;
|
|
332
367
|
model_parameters?: AgentModelParameters;
|
|
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'>;
|
|
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'>;
|
|
334
369
|
export type AgentListParams = {
|
|
335
370
|
limit?: number;
|
|
336
371
|
requiredPermission: number;
|
|
@@ -490,9 +525,46 @@ export type PartMetadata = {
|
|
|
490
525
|
agentId?: string;
|
|
491
526
|
/** Group ID for parallel content - parts with same groupId are displayed in columns */
|
|
492
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;
|
|
493
565
|
};
|
|
494
566
|
/** Metadata for parallel content rendering - subset of PartMetadata */
|
|
495
|
-
export type ContentMetadata = Pick<PartMetadata, 'agentId' | 'groupId'>;
|
|
567
|
+
export type ContentMetadata = Pick<PartMetadata, 'agentId' | 'groupId' | 'streamedIndex'>;
|
|
496
568
|
export type ContentPart = (CodeToolCall | RetrievalToolCall | FileSearchToolCall | FunctionToolCall | Agents.AgentToolCall | ImageFile | Text) & PartMetadata;
|
|
497
569
|
export type TextData = (Text & PartMetadata) | undefined;
|
|
498
570
|
export type SummaryContentPart = {
|
|
@@ -528,6 +600,10 @@ export type SteerContentPart = {
|
|
|
528
600
|
/** Attachments steered with the message; re-encoded per turn on replay
|
|
529
601
|
* like any other user-message media (refs only, never encoded data). */
|
|
530
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[];
|
|
531
607
|
};
|
|
532
608
|
export type TMessageContentParts = ({
|
|
533
609
|
type: ContentTypes.ERROR;
|
|
@@ -536,6 +612,21 @@ export type TMessageContentParts = ({
|
|
|
536
612
|
} & ContentMetadata) | ({
|
|
537
613
|
type: ContentTypes.THINK;
|
|
538
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;
|
|
539
630
|
} & ContentMetadata) | (SteerContentPart & ContentMetadata) | ({
|
|
540
631
|
type: ContentTypes.TEXT;
|
|
541
632
|
text?: string | TextData;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CodeEnvRef } from '../codeEnvRef';
|
|
1
|
+
import type { CodeEnvRef, CodeEnvRefMap } from '../codeEnvRef';
|
|
2
2
|
import { EToolResources } from './assistants';
|
|
3
3
|
export declare enum FileSources {
|
|
4
4
|
local = "local",
|
|
@@ -60,6 +60,8 @@ export type FileConfig = {
|
|
|
60
60
|
maxWidth?: number;
|
|
61
61
|
maxHeight?: number;
|
|
62
62
|
quality?: number;
|
|
63
|
+
/** Set when `enabled` came from the admin config, in which case it wins over the user's setting */
|
|
64
|
+
enforced?: boolean;
|
|
63
65
|
};
|
|
64
66
|
ocr?: {
|
|
65
67
|
supportedMimeTypes?: RegexLike[];
|
|
@@ -155,6 +157,9 @@ export type TFile = {
|
|
|
155
157
|
* resolve via `resolveCodeEnvRef`.
|
|
156
158
|
*/
|
|
157
159
|
codeEnvRef?: CodeEnvRef;
|
|
160
|
+
codeEnvRefs?: CodeEnvRefMap;
|
|
161
|
+
/** Dispatch-order stamp for the current source artifact generation. */
|
|
162
|
+
sourceDispatchedAt?: number;
|
|
158
163
|
};
|
|
159
164
|
createdAt?: string | Date;
|
|
160
165
|
updatedAt?: string | Date;
|
|
@@ -230,7 +235,9 @@ export type TFilesUsageResponse = {
|
|
|
230
235
|
};
|
|
231
236
|
export type DeleteFilesResponse = {
|
|
232
237
|
message: string;
|
|
233
|
-
result
|
|
238
|
+
result?: Record<string, unknown>;
|
|
239
|
+
deletedFileIds?: string[];
|
|
240
|
+
failedFileIds?: string[];
|
|
234
241
|
};
|
|
235
242
|
export type BatchFile = {
|
|
236
243
|
file_id: string;
|
|
@@ -251,4 +258,7 @@ export type DeleteMutationOptions = {
|
|
|
251
258
|
onSuccess?: (data: DeleteFilesResponse, variables: DeleteFilesBody, context?: unknown) => void;
|
|
252
259
|
onMutate?: (variables: DeleteFilesBody) => void | Promise<unknown>;
|
|
253
260
|
onError?: (error: unknown, variables: DeleteFilesBody, context?: unknown) => void;
|
|
261
|
+
/** Suppresses the result toasts. Background cleanup runs on a timer the user never asked for,
|
|
262
|
+
* and a storage failure that keeps failing would otherwise announce itself on every retry. */
|
|
263
|
+
silent?: boolean;
|
|
254
264
|
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export type InsightsRange = '24h' | '7d' | '30d' | 'custom';
|
|
2
|
+
export declare const INSIGHTS_MAX_RANGE_DAYS = 30;
|
|
3
|
+
export declare const INSIGHTS_SEARCH_MIN_LENGTH = 3;
|
|
4
|
+
export declare const INSIGHTS_SEARCH_MAX_LENGTH = 200;
|
|
5
|
+
export type TInsightsParams = {
|
|
6
|
+
range?: InsightsRange;
|
|
7
|
+
fromTimestamp?: string;
|
|
8
|
+
toTimestamp?: string;
|
|
9
|
+
timeZone?: string;
|
|
10
|
+
search?: string;
|
|
11
|
+
page?: number;
|
|
12
|
+
pageSize?: number;
|
|
13
|
+
};
|
|
14
|
+
export type TInsightsDailyPoint = {
|
|
15
|
+
date: string;
|
|
16
|
+
conversations: number;
|
|
17
|
+
users: number;
|
|
18
|
+
messages: number;
|
|
19
|
+
totalTokens: number;
|
|
20
|
+
};
|
|
21
|
+
export type TInsightsUser = {
|
|
22
|
+
userId: string;
|
|
23
|
+
name: string;
|
|
24
|
+
email: string;
|
|
25
|
+
conversations: number;
|
|
26
|
+
messages: number;
|
|
27
|
+
};
|
|
28
|
+
export type TInsightsChurnedUser = TInsightsUser & {
|
|
29
|
+
firstSeen: string;
|
|
30
|
+
lastSeen: string;
|
|
31
|
+
};
|
|
32
|
+
export type TInsightsConversation = {
|
|
33
|
+
conversationId: string;
|
|
34
|
+
date: string;
|
|
35
|
+
userId: string;
|
|
36
|
+
name: string;
|
|
37
|
+
email: string;
|
|
38
|
+
firstMessage: string;
|
|
39
|
+
messages: number;
|
|
40
|
+
totalTokens: number;
|
|
41
|
+
};
|
|
42
|
+
export type TInsightsSummary = {
|
|
43
|
+
totalUsers: number;
|
|
44
|
+
totalConversations: number;
|
|
45
|
+
totalMessages: number;
|
|
46
|
+
totalTokens: number;
|
|
47
|
+
};
|
|
48
|
+
export type TInsightsResponse = {
|
|
49
|
+
summary: TInsightsSummary;
|
|
50
|
+
daily: TInsightsDailyPoint[];
|
|
51
|
+
topUsers: TInsightsUser[];
|
|
52
|
+
churnedUsers: TInsightsChurnedUser[];
|
|
53
|
+
latest: {
|
|
54
|
+
conversations: TInsightsConversation[];
|
|
55
|
+
page: number;
|
|
56
|
+
pageSize: number;
|
|
57
|
+
pages: number;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
export type TInsightsAccessResponse = {
|
|
61
|
+
access: boolean;
|
|
62
|
+
};
|
|
@@ -119,6 +119,7 @@ export type CreateSharedLinkOptions = MutationOptions<types.TSharedLink, Partial
|
|
|
119
119
|
export type updateTagsInConvoOptions = MutationOptions<types.TTagConversationResponse, types.TTagConversationRequest>;
|
|
120
120
|
export type UpdateSharedLinkOptions = MutationOptions<types.TSharedLink, Partial<types.TSharedLink>>;
|
|
121
121
|
export type ArchiveConvoOptions = MutationOptions<types.TArchiveConversationResponse, types.TArchiveConversationRequest>;
|
|
122
|
+
export type ArchiveAllConversationsOptions = MutationOptions<types.TArchiveAllConversationsResponse, void>;
|
|
122
123
|
export type DeleteSharedLinkContext = {
|
|
123
124
|
previousQueries?: Map<string, TDeleteSharedLinkResponse>;
|
|
124
125
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { InfiniteData } from '@tanstack/react-query';
|
|
2
|
+
import type { RerankerTypes, SearchProviders, ScraperProviders } from '../config';
|
|
2
3
|
import type * as p from '../accessPermissions';
|
|
3
4
|
import type * as a from '../types/agents';
|
|
4
5
|
import type * as s from '../schemas';
|
|
@@ -12,14 +13,16 @@ export type Conversation = {
|
|
|
12
13
|
};
|
|
13
14
|
export type ConversationListParams = {
|
|
14
15
|
cursor?: string;
|
|
16
|
+
limit?: number;
|
|
15
17
|
isArchived?: boolean;
|
|
16
|
-
|
|
18
|
+
pinned?: boolean;
|
|
19
|
+
sortBy?: 'title' | 'createdAt' | 'updatedAt' | 'archivedAt';
|
|
17
20
|
sortDirection?: 'asc' | 'desc';
|
|
18
21
|
tags?: string[];
|
|
19
22
|
search?: string;
|
|
20
23
|
projectId?: string;
|
|
21
24
|
};
|
|
22
|
-
export type MinimalConversation = Pick<s.TConversation, 'conversationId' | 'endpoint' | 'title' | 'createdAt' | 'updatedAt' | 'user' | 'chatProjectId'>;
|
|
25
|
+
export type MinimalConversation = Pick<s.TConversation, 'conversationId' | 'endpoint' | 'title' | 'createdAt' | 'updatedAt' | 'archivedAt' | 'user' | 'chatProjectId' | 'pinned'>;
|
|
23
26
|
export type ConversationListResponse = {
|
|
24
27
|
conversations: MinimalConversation[];
|
|
25
28
|
nextCursor: string | null;
|
|
@@ -92,6 +95,9 @@ export type MCPTool = {
|
|
|
92
95
|
name: string;
|
|
93
96
|
pluginKey: string;
|
|
94
97
|
description: string;
|
|
98
|
+
/** Raw upstream tool name when the model-facing key stripped a redundant
|
|
99
|
+
* server-name prefix — gates the agent editor's legacy id migration. */
|
|
100
|
+
serverToolName?: string;
|
|
95
101
|
};
|
|
96
102
|
export type MCPServer = {
|
|
97
103
|
name: string;
|
|
@@ -110,20 +116,29 @@ export type VerifyToolAuthResponse = {
|
|
|
110
116
|
authenticated: boolean;
|
|
111
117
|
message?: string | s.AuthType;
|
|
112
118
|
authTypes?: [string, s.AuthType][];
|
|
119
|
+
searchProvider?: SearchProviders;
|
|
120
|
+
scraperProvider?: ScraperProviders;
|
|
121
|
+
rerankerType?: RerankerTypes;
|
|
113
122
|
};
|
|
114
123
|
export type GetToolCallParams = {
|
|
115
124
|
conversationId: string;
|
|
116
125
|
};
|
|
117
126
|
export type ToolCallResults = a.ToolCallResult[];
|
|
118
127
|
export type TUserMemory = {
|
|
128
|
+
/** Stable stored record identifier retained when content fields are redacted. */
|
|
129
|
+
_id?: string;
|
|
119
130
|
key: string;
|
|
120
131
|
value: string;
|
|
132
|
+
/** Optional generated or legacy summary content. */
|
|
133
|
+
summary?: string;
|
|
121
134
|
updated_at: string;
|
|
122
135
|
tokenCount?: number;
|
|
123
136
|
/** Agent partition this memory belongs to; absent = shared personal pool */
|
|
124
137
|
agentId?: string;
|
|
125
138
|
/** Display name of the partition's agent, resolved server-side when available */
|
|
126
139
|
agentName?: string;
|
|
140
|
+
/** Current policy removed one or more memory content fields from this response. */
|
|
141
|
+
contentFilterBlocked?: boolean;
|
|
127
142
|
};
|
|
128
143
|
export type MemoriesResponse = {
|
|
129
144
|
memories: TUserMemory[];
|
|
@@ -131,6 +146,13 @@ export type MemoriesResponse = {
|
|
|
131
146
|
tokenLimit: number | null;
|
|
132
147
|
usagePercentage: number | null;
|
|
133
148
|
};
|
|
149
|
+
export type UpdateMemoryResponse = {
|
|
150
|
+
updated: boolean;
|
|
151
|
+
memory: TUserMemory;
|
|
152
|
+
};
|
|
153
|
+
export type DeleteMemoryResponse = {
|
|
154
|
+
deleted: boolean;
|
|
155
|
+
};
|
|
134
156
|
export type PrincipalSearchParams = {
|
|
135
157
|
q: string;
|
|
136
158
|
limit?: number;
|
|
@@ -166,6 +188,10 @@ export type ListRolesResponse = {
|
|
|
166
188
|
};
|
|
167
189
|
export interface MCPServerStatus {
|
|
168
190
|
requiresOAuth: boolean;
|
|
191
|
+
/** The server connects only inside a chat request because its config reads BODY placeholders. */
|
|
192
|
+
requestScoped?: boolean;
|
|
193
|
+
/** Whether all declared per-user variables are present for an on-demand connection. */
|
|
194
|
+
configurationState?: 'configured' | 'needs_configuration';
|
|
169
195
|
connectionState: 'disconnected' | 'connecting' | 'connected' | 'error';
|
|
170
196
|
authorizationState?: 'not_required' | 'authorizing' | 'authorized' | 'needs_authorization' | 'error';
|
|
171
197
|
}
|
|
@@ -179,6 +205,8 @@ export interface MCPServerConnectionStatusResponse {
|
|
|
179
205
|
success: boolean;
|
|
180
206
|
serverName: string;
|
|
181
207
|
requiresOAuth: boolean;
|
|
208
|
+
requestScoped?: boolean;
|
|
209
|
+
configurationState?: MCPServerStatus['configurationState'];
|
|
182
210
|
connectionStatus: 'disconnected' | 'connecting' | 'connected' | 'error';
|
|
183
211
|
authorizationState?: MCPServerStatus['authorizationState'];
|
|
184
212
|
}
|