@librechat/agents 3.7.7 → 3.7.8
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/agents/AgentContext.cjs +23 -3
- package/dist/cjs/agents/AgentContext.cjs.map +1 -1
- package/dist/cjs/common/constants.cjs +10 -0
- package/dist/cjs/common/constants.cjs.map +1 -1
- package/dist/cjs/graphs/Graph.cjs +16 -5
- package/dist/cjs/graphs/Graph.cjs.map +1 -1
- package/dist/cjs/langfuseTraceShaping.cjs +75 -0
- package/dist/cjs/langfuseTraceShaping.cjs.map +1 -1
- package/dist/cjs/llm/bedrock/toolCache.cjs +1 -1
- package/dist/cjs/llm/fake.cjs +9 -5
- package/dist/cjs/llm/fake.cjs.map +1 -1
- package/dist/cjs/llm/invoke.cjs +1 -1
- package/dist/cjs/llm/openrouter/toolCache.cjs +1 -1
- package/dist/cjs/llm/prepareProviderRequest.cjs +2 -2
- package/dist/cjs/llm/providers.cjs +1 -1
- package/dist/cjs/llm/truncation.cjs +1 -0
- package/dist/cjs/main.cjs +3 -2
- package/dist/cjs/messages/format.cjs +298 -3
- package/dist/cjs/messages/format.cjs.map +1 -1
- package/dist/cjs/messages/prune.cjs +1 -1
- package/dist/cjs/run.cjs +25 -15
- package/dist/cjs/run.cjs.map +1 -1
- package/dist/cjs/stream.cjs +1 -1
- package/dist/cjs/summarization/node.cjs +43 -9
- package/dist/cjs/summarization/node.cjs.map +1 -1
- package/dist/cjs/summarization/semanticIndex.cjs +362 -0
- package/dist/cjs/summarization/semanticIndex.cjs.map +1 -0
- package/dist/cjs/tools/subagent/childGraphConfig.cjs +2 -1
- package/dist/cjs/tools/subagent/childGraphConfig.cjs.map +1 -1
- package/dist/cjs/utils/index.cjs +1 -1
- package/dist/esm/agents/AgentContext.mjs +23 -3
- package/dist/esm/agents/AgentContext.mjs.map +1 -1
- package/dist/esm/common/constants.mjs +10 -1
- package/dist/esm/common/constants.mjs.map +1 -1
- package/dist/esm/graphs/Graph.mjs +16 -5
- package/dist/esm/graphs/Graph.mjs.map +1 -1
- package/dist/esm/langfuseTraceShaping.mjs +75 -0
- package/dist/esm/langfuseTraceShaping.mjs.map +1 -1
- package/dist/esm/llm/bedrock/toolCache.mjs +1 -1
- package/dist/esm/llm/fake.mjs +9 -5
- package/dist/esm/llm/fake.mjs.map +1 -1
- package/dist/esm/llm/invoke.mjs +1 -1
- package/dist/esm/llm/openrouter/toolCache.mjs +1 -1
- package/dist/esm/llm/prepareProviderRequest.mjs +2 -2
- package/dist/esm/llm/providers.mjs +1 -1
- package/dist/esm/llm/truncation.mjs +1 -1
- package/dist/esm/main.mjs +4 -4
- package/dist/esm/messages/format.mjs +298 -3
- package/dist/esm/messages/format.mjs.map +1 -1
- package/dist/esm/messages/prune.mjs +1 -1
- package/dist/esm/run.mjs +25 -15
- package/dist/esm/run.mjs.map +1 -1
- package/dist/esm/stream.mjs +1 -1
- package/dist/esm/summarization/node.mjs +43 -9
- package/dist/esm/summarization/node.mjs.map +1 -1
- package/dist/esm/summarization/semanticIndex.mjs +360 -0
- package/dist/esm/summarization/semanticIndex.mjs.map +1 -0
- package/dist/esm/tools/subagent/childGraphConfig.mjs +2 -1
- package/dist/esm/tools/subagent/childGraphConfig.mjs.map +1 -1
- package/dist/esm/utils/index.mjs +1 -1
- package/dist/types/agents/AgentContext.d.ts +27 -1
- package/dist/types/common/constants.d.ts +10 -0
- package/dist/types/graphs/Graph.d.ts +15 -0
- package/dist/types/llm/fake.d.ts +12 -2
- package/dist/types/messages/format.d.ts +10 -1
- package/dist/types/run.d.ts +17 -5
- package/dist/types/summarization/semanticIndex.d.ts +19 -0
- package/dist/types/types/graph.d.ts +9 -1
- package/dist/types/types/summarize.d.ts +38 -0
- package/package.json +2 -1
- package/src/agents/AgentContext.ts +61 -1
- package/src/common/constants.ts +11 -0
- package/src/graphs/Graph.ts +41 -8
- package/src/langfuseTraceShaping.ts +94 -0
- package/src/llm/fake.ts +35 -4
- package/src/messages/format.ts +652 -4
- package/src/run.ts +36 -10
- package/src/summarization/node.ts +90 -33
- package/src/summarization/semanticIndex.ts +653 -0
- package/src/tools/subagent/childGraphConfig.ts +3 -0
- package/src/types/graph.ts +9 -0
- package/src/types/summarize.ts +50 -0
package/src/types/summarize.ts
CHANGED
|
@@ -36,6 +36,52 @@ export type RetainRecentConfig = {
|
|
|
36
36
|
tokens?: number;
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
+
export type CompactionSemanticIndexStatus = 'committed' | 'pending';
|
|
40
|
+
|
|
41
|
+
type CompactionSemanticIndexEntryBase = {
|
|
42
|
+
/** Persisted message that owns the indexed content. */
|
|
43
|
+
sourceMessageId: string;
|
|
44
|
+
/** Zero-based content-part index within the persisted source message. */
|
|
45
|
+
sourceContentIndex: number;
|
|
46
|
+
/** Monotonic host revision for this logical entry. */
|
|
47
|
+
revision: number;
|
|
48
|
+
/** Only committed entries may guide compaction. */
|
|
49
|
+
status: CompactionSemanticIndexStatus;
|
|
50
|
+
/** User-visible semantic guidance. Hidden reasoning must never be supplied. */
|
|
51
|
+
text: string;
|
|
52
|
+
/** Omits the entry entirely when host policy redacts its source. */
|
|
53
|
+
redacted?: boolean;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export type CompactionToolSemanticIndexEntry =
|
|
57
|
+
CompactionSemanticIndexEntryBase & {
|
|
58
|
+
type: 'tool_intent' | 'tool_outcome';
|
|
59
|
+
toolCallId: string;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export type CompactionActivitySemanticIndexEntry =
|
|
63
|
+
CompactionSemanticIndexEntryBase & {
|
|
64
|
+
type: 'activity_phase';
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export type CompactionReasoningSemanticIndexEntry =
|
|
68
|
+
CompactionSemanticIndexEntryBase & {
|
|
69
|
+
type: 'reasoning_label';
|
|
70
|
+
/** Stable identity shared by every user-visible label revision. */
|
|
71
|
+
reasoningStepId: string;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Source-addressed navigation hints for the compaction model. Entries remain
|
|
76
|
+
* advisory: raw messages are always sent and remain authoritative.
|
|
77
|
+
*/
|
|
78
|
+
export type CompactionSemanticIndexEntry =
|
|
79
|
+
| CompactionToolSemanticIndexEntry
|
|
80
|
+
| CompactionActivitySemanticIndexEntry
|
|
81
|
+
| CompactionReasoningSemanticIndexEntry;
|
|
82
|
+
|
|
83
|
+
export type CompactionSemanticIndex = readonly CompactionSemanticIndexEntry[];
|
|
84
|
+
|
|
39
85
|
export type SummarizationConfig = {
|
|
40
86
|
provider?: ProviderName;
|
|
41
87
|
model?: string;
|
|
@@ -96,6 +142,10 @@ export interface SummarizeStartEvent {
|
|
|
96
142
|
messagesToRefineCount: number;
|
|
97
143
|
/** Which summarization cycle this is (1-based, increments each time summarization fires) */
|
|
98
144
|
summaryVersion: number;
|
|
145
|
+
/** Committed, source-valid semantic hints included in the request. */
|
|
146
|
+
semanticIndexEntryCount?: number;
|
|
147
|
+
/** Serialized semantic-index characters included in the request. */
|
|
148
|
+
semanticIndexCharCount?: number;
|
|
99
149
|
}
|
|
100
150
|
|
|
101
151
|
export interface SummarizeDeltaEvent {
|