graphlit-client 1.0.20260402002 → 1.0.20260403002
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/client.js
CHANGED
|
@@ -5875,7 +5875,7 @@ class Graphlit {
|
|
|
5875
5875
|
});
|
|
5876
5876
|
// Complete the conversation and get token count
|
|
5877
5877
|
let finalTokens;
|
|
5878
|
-
const trimmedMessage = loopResult.
|
|
5878
|
+
const trimmedMessage = loopResult.finalAssistantMessage;
|
|
5879
5879
|
if (trimmedMessage) {
|
|
5880
5880
|
// Calculate metrics for completeConversation
|
|
5881
5881
|
const completionTime = uiAdapter.getCompletionTime();
|
|
@@ -5932,6 +5932,7 @@ class Graphlit {
|
|
|
5932
5932
|
let messages = config.messages;
|
|
5933
5933
|
let currentRound = 0;
|
|
5934
5934
|
let fullMessage = "";
|
|
5935
|
+
let finalAssistantMessage = "";
|
|
5935
5936
|
const contextActions = [];
|
|
5936
5937
|
const toolCallNames = [];
|
|
5937
5938
|
const errors = [];
|
|
@@ -6287,6 +6288,9 @@ class Graphlit {
|
|
|
6287
6288
|
}
|
|
6288
6289
|
// Update the full message and capture reasoning for persistence
|
|
6289
6290
|
fullMessage = roundMessage;
|
|
6291
|
+
if (roundMessage.trim()) {
|
|
6292
|
+
finalAssistantMessage = roundMessage.trim();
|
|
6293
|
+
}
|
|
6290
6294
|
lastRoundReasoning = roundReasoning;
|
|
6291
6295
|
// Check abort after streaming completes, before starting tool execution
|
|
6292
6296
|
if (abortSignal?.aborted) {
|
|
@@ -6663,6 +6667,7 @@ class Graphlit {
|
|
|
6663
6667
|
});
|
|
6664
6668
|
return {
|
|
6665
6669
|
fullMessage,
|
|
6670
|
+
finalAssistantMessage,
|
|
6666
6671
|
toolCallCount: totalToolCallCount,
|
|
6667
6672
|
toolCallNames,
|
|
6668
6673
|
errors,
|
|
@@ -7047,7 +7052,7 @@ class Graphlit {
|
|
|
7047
7052
|
uiAdapter.dispose();
|
|
7048
7053
|
}
|
|
7049
7054
|
// 8. Complete conversation (persist turn)
|
|
7050
|
-
const trimmedMessage = loopResult.
|
|
7055
|
+
const trimmedMessage = loopResult.finalAssistantMessage;
|
|
7051
7056
|
if (trimmedMessage) {
|
|
7052
7057
|
const completionTime = uiAdapter.getCompletionTime();
|
|
7053
7058
|
const ttft = uiAdapter.getTTFT();
|
|
@@ -7103,7 +7108,7 @@ class Graphlit {
|
|
|
7103
7108
|
};
|
|
7104
7109
|
turnResults.push(turnResult);
|
|
7105
7110
|
totalToolCalls += loopResult.toolCallCount;
|
|
7106
|
-
finalMessage = loopResult.fullMessage;
|
|
7111
|
+
finalMessage = loopResult.finalAssistantMessage || loopResult.fullMessage;
|
|
7107
7112
|
lastContextWindow = loopResult.contextWindow;
|
|
7108
7113
|
// 10. Notify callback
|
|
7109
7114
|
options?.onTurnComplete?.(turnResult);
|
|
@@ -13,7 +13,7 @@ export declare function estimateTokens(text: string): number;
|
|
|
13
13
|
* Values can be provided by the server (via ConversationStrategy) or set client-side.
|
|
14
14
|
*/
|
|
15
15
|
export interface ContextStrategyConfig {
|
|
16
|
-
/** Max tokens for any single tool result. Results exceeding this are truncated. Default:
|
|
16
|
+
/** Max tokens for any single tool result. Results exceeding this are truncated. Default: 128000 */
|
|
17
17
|
toolResultTokenLimit: number;
|
|
18
18
|
/** Max tool call/response rounds to keep in context. Older rounds are dropped FIFO. Default: 10 */
|
|
19
19
|
toolRoundLimit: number;
|
package/dist/types/agent.d.ts
CHANGED
|
@@ -208,6 +208,7 @@ export interface StreamingLoopConfig {
|
|
|
208
208
|
/** Result returned from executeStreamingLoop. */
|
|
209
209
|
export interface StreamingLoopResult {
|
|
210
210
|
fullMessage: string;
|
|
211
|
+
finalAssistantMessage: string;
|
|
211
212
|
toolCallCount: number;
|
|
212
213
|
toolCallNames: string[];
|
|
213
214
|
errors: string[];
|