@librechat/agents 3.6.4 → 3.6.5
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/cjs/graphs/Graph.cjs +14 -2
- package/dist/cjs/graphs/Graph.cjs.map +1 -1
- package/dist/cjs/langchain/index.cjs +12 -0
- package/dist/cjs/langchain/messages.cjs +12 -0
- package/dist/cjs/langfuseConfig.cjs +16 -0
- package/dist/cjs/langfuseConfig.cjs.map +1 -1
- package/dist/cjs/langfuseSpanRegistry.cjs +16 -4
- package/dist/cjs/langfuseSpanRegistry.cjs.map +1 -1
- package/dist/cjs/main.cjs +12 -0
- package/dist/cjs/tools/SubagentTool.cjs +7 -2
- package/dist/cjs/tools/SubagentTool.cjs.map +1 -1
- package/dist/cjs/tools/subagent/InMemorySubagentTaskStore.cjs +5 -1
- package/dist/cjs/tools/subagent/InMemorySubagentTaskStore.cjs.map +1 -1
- package/dist/cjs/tools/subagent/SubagentExecutor.cjs +38 -6
- package/dist/cjs/tools/subagent/SubagentExecutor.cjs.map +1 -1
- package/dist/esm/graphs/Graph.mjs +14 -2
- package/dist/esm/graphs/Graph.mjs.map +1 -1
- package/dist/esm/langchain/index.mjs +2 -2
- package/dist/esm/langchain/messages.mjs +2 -2
- package/dist/esm/langfuseConfig.mjs +16 -0
- package/dist/esm/langfuseConfig.mjs.map +1 -1
- package/dist/esm/langfuseSpanRegistry.mjs +16 -4
- package/dist/esm/langfuseSpanRegistry.mjs.map +1 -1
- package/dist/esm/main.mjs +2 -2
- package/dist/esm/tools/SubagentTool.mjs +7 -2
- package/dist/esm/tools/SubagentTool.mjs.map +1 -1
- package/dist/esm/tools/subagent/InMemorySubagentTaskStore.mjs +5 -1
- package/dist/esm/tools/subagent/InMemorySubagentTaskStore.mjs.map +1 -1
- package/dist/esm/tools/subagent/SubagentExecutor.mjs +38 -6
- package/dist/esm/tools/subagent/SubagentExecutor.mjs.map +1 -1
- package/dist/types/langchain/messages.d.ts +2 -2
- package/dist/types/langfuseSpanRegistry.d.ts +9 -4
- package/dist/types/tools/SubagentTool.d.ts +2 -1
- package/dist/types/tools/subagent/SubagentExecutor.d.ts +4 -0
- package/dist/types/types/graph.d.ts +11 -0
- package/dist/types/types/subagentTasks.d.ts +35 -3
- package/package.json +1 -1
- package/src/graphs/Graph.ts +22 -1
- package/src/langchain/messages.ts +3 -0
- package/src/langfuseConfig.ts +43 -0
- package/src/langfuseSpanRegistry.ts +42 -4
- package/src/tools/SubagentTool.ts +18 -2
- package/src/tools/subagent/InMemorySubagentTaskStore.ts +9 -1
- package/src/tools/subagent/SubagentExecutor.ts +75 -5
- package/src/types/graph.ts +11 -0
- package/src/types/subagentTasks.ts +36 -3
|
@@ -27,8 +27,14 @@ export interface SubagentTaskProgress {
|
|
|
27
27
|
}
|
|
28
28
|
/** Read-only task metadata. Results are exposed only through `claim`. */
|
|
29
29
|
export interface SubagentTaskSnapshot {
|
|
30
|
-
/** Handle for this child-
|
|
30
|
+
/** Handle for this child-thread execution lease within its trusted scope. */
|
|
31
31
|
taskId: string;
|
|
32
|
+
/**
|
|
33
|
+
* Stable logical thread identity shared by fresh execution leases. Required
|
|
34
|
+
* from stores that advertise `supportsThreadContinuation`; optional for
|
|
35
|
+
* legacy/process-local stores that do not expose a durable conversation.
|
|
36
|
+
*/
|
|
37
|
+
threadId?: string;
|
|
32
38
|
subagentType: string;
|
|
33
39
|
status: SubagentTaskStatus;
|
|
34
40
|
createdAt: number;
|
|
@@ -77,15 +83,34 @@ export interface SubagentTaskRuntime {
|
|
|
77
83
|
export interface SubagentTaskStartRequest {
|
|
78
84
|
scopeId: string;
|
|
79
85
|
idempotencyKey: string;
|
|
86
|
+
/** Host/SDK-owned parent run identity for durable lineage. */
|
|
87
|
+
parentRunId: string;
|
|
88
|
+
/** Executing parent agent, when the graph has a stable agent identity. */
|
|
89
|
+
parentAgentId?: string;
|
|
90
|
+
/** Provider tool-call identity that created this execution lease. */
|
|
91
|
+
parentToolCallId: string;
|
|
92
|
+
/**
|
|
93
|
+
* Untrusted child-thread selector supplied by the parent model. A
|
|
94
|
+
* continuation-capable store MUST validate ownership, scope, lineage, and
|
|
95
|
+
* `subagentType` before loading any saved messages.
|
|
96
|
+
*/
|
|
97
|
+
threadId?: string;
|
|
98
|
+
/** Untrusted new user-turn text for host persistence and audit. */
|
|
99
|
+
input: string;
|
|
80
100
|
/** Stable hash of model-writable inputs used to reject conflicting replays. */
|
|
81
101
|
requestFingerprint?: string;
|
|
102
|
+
/** Execution shape selected from the host-provided subagent catalog. */
|
|
103
|
+
subagentKind: SubagentUpdateEvent['subagentKind'];
|
|
82
104
|
subagentType: string;
|
|
83
105
|
/**
|
|
84
106
|
* Starts one ephemeral execution lease. The canonical child transcript is
|
|
85
107
|
* returned so a host-owned store may persist it for a later fresh run;
|
|
86
108
|
* retaining a graph/checkpoint after terminal completion is unnecessary.
|
|
87
109
|
*/
|
|
88
|
-
run(
|
|
110
|
+
run(
|
|
111
|
+
runtime: SubagentTaskRuntime,
|
|
112
|
+
initialMessages?: BaseMessage[]
|
|
113
|
+
): Promise<{
|
|
89
114
|
content: string;
|
|
90
115
|
messages?: BaseMessage[];
|
|
91
116
|
}>;
|
|
@@ -98,6 +123,7 @@ export type SubagentTaskStartResult =
|
|
|
98
123
|
task: SubagentTaskSnapshot;
|
|
99
124
|
}
|
|
100
125
|
| { accepted: false; reason: 'capacity' }
|
|
126
|
+
| { accepted: false; reason: 'thread_unavailable' }
|
|
101
127
|
| {
|
|
102
128
|
accepted: false;
|
|
103
129
|
reason: 'conflict';
|
|
@@ -107,10 +133,17 @@ export type SubagentTaskStartResult =
|
|
|
107
133
|
/**
|
|
108
134
|
* Host-replaceable store contract used by the SDK's subagent tool. The store
|
|
109
135
|
* should normally outlive individual `Run` instances. Durable hosts may
|
|
110
|
-
* persist the transcript returned by `run` under the task/
|
|
136
|
+
* persist the transcript returned by `run` under the task/thread
|
|
111
137
|
* lineage and start a fresh execution for a later turn.
|
|
112
138
|
*/
|
|
113
139
|
export interface SubagentTaskStore {
|
|
140
|
+
/**
|
|
141
|
+
* True only when `start` authorizes an existing `threadId`, loads its
|
|
142
|
+
* saved transcript, and supplies that transcript to `run`. The flag exposes
|
|
143
|
+
* the model-facing continuation field, so a store must fail closed for an
|
|
144
|
+
* unknown or unauthorized id rather than starting an empty child.
|
|
145
|
+
*/
|
|
146
|
+
readonly supportsThreadContinuation?: boolean;
|
|
114
147
|
start(request: SubagentTaskStartRequest): SubagentTaskStartResult;
|
|
115
148
|
get(scopeId: string, taskId: string): SubagentTaskSnapshot | undefined;
|
|
116
149
|
list(scopeId: string): SubagentTaskSnapshot[];
|