graphlit-client 1.0.20260422003 → 1.0.20260422004

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.
Files changed (2) hide show
  1. package/dist/client.js +8 -11
  2. package/package.json +1 -1
package/dist/client.js CHANGED
@@ -6116,8 +6116,7 @@ class Graphlit {
6116
6116
  const toolCallNames = [];
6117
6117
  const errors = [];
6118
6118
  let totalToolCallCount = 0;
6119
- // Sidecar map for reasoning metadata
6120
- const reasoningByMessageIndex = new Map();
6119
+ const persistedIntermediateMessages = [];
6121
6120
  // Artifact collector for tool handlers
6122
6121
  const pendingArtifacts = [];
6123
6122
  const artifactCollector = {
@@ -6134,7 +6133,6 @@ class Graphlit {
6134
6133
  (OPENAI_RESPONSES_AUTO_ROUTING_ENABLED && useResponsesApi !== false)) &&
6135
6134
  serviceType === Types.ModelServiceTypes.OpenAi &&
6136
6135
  isOpenAIResponsesEligibleModel(specification);
6137
- const toolMessagesStartIndex = messages.length;
6138
6136
  let lastRoundReasoning;
6139
6137
  let openAIResponsesState;
6140
6138
  let openAIResponsesPendingToolMessages = [];
@@ -6548,9 +6546,9 @@ class Graphlit {
6548
6546
  if (roundReasoning.signature) {
6549
6547
  assistantMessage.thinkingSignature = roundReasoning.signature;
6550
6548
  }
6551
- reasoningByMessageIndex.set(messages.length, roundReasoning);
6552
6549
  }
6553
6550
  messages.push(assistantMessage);
6551
+ persistedIntermediateMessages.push(assistantMessage);
6554
6552
  // Track tool names for stuck detection
6555
6553
  for (const tc of roundToolCalls) {
6556
6554
  toolCallNames.push(tc.name);
@@ -6845,6 +6843,7 @@ class Graphlit {
6845
6843
  }
6846
6844
  }
6847
6845
  messages.push(executionResult.toolMessage);
6846
+ persistedIntermediateMessages.push(executionResult.toolMessage);
6848
6847
  if (executionResult.errorEntry) {
6849
6848
  errors.push(executionResult.errorEntry);
6850
6849
  }
@@ -6874,7 +6873,7 @@ class Graphlit {
6874
6873
  currentRound++;
6875
6874
  }
6876
6875
  // Build intermediate messages for completeConversation
6877
- const intermediateMessages = messages.slice(toolMessagesStartIndex);
6876
+ const intermediateMessages = persistedIntermediateMessages;
6878
6877
  const messageInputs = intermediateMessages.map((msg, idx) => {
6879
6878
  const input = {
6880
6879
  role: msg.role,
@@ -6898,12 +6897,10 @@ class Graphlit {
6898
6897
  firstStatusAt: tc.firstStatusAt,
6899
6898
  }));
6900
6899
  }
6901
- const absoluteIndex = toolMessagesStartIndex + idx;
6902
- const reasoning = reasoningByMessageIndex.get(absoluteIndex);
6903
- if (reasoning) {
6904
- input.thinkingContent = reasoning.content;
6905
- if (reasoning.signature) {
6906
- input.thinkingSignature = reasoning.signature;
6900
+ if (msg.thinkingContent) {
6901
+ input.thinkingContent = msg.thinkingContent;
6902
+ if (msg.thinkingSignature) {
6903
+ input.thinkingSignature = msg.thinkingSignature;
6907
6904
  }
6908
6905
  }
6909
6906
  return input;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphlit-client",
3
- "version": "1.0.20260422003",
3
+ "version": "1.0.20260422004",
4
4
  "description": "Graphlit API Client for TypeScript",
5
5
  "type": "module",
6
6
  "main": "./dist/client.js",