@arbidocs/sdk 0.3.139 → 0.3.140

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/index.cjs CHANGED
@@ -4363,6 +4363,7 @@ async function streamSSE(response, callbacks = {}) {
4363
4363
  }
4364
4364
  if (data.context) {
4365
4365
  context = data.context;
4366
+ callbacks.onContextUpdate?.(data.context);
4366
4367
  }
4367
4368
  if (data.t != null) callbacks.onElapsedTime?.(data.t);
4368
4369
  callbacks.onComplete?.();
@@ -4478,6 +4479,9 @@ function formatStreamSummary(result, elapsedTime) {
4478
4479
  const used = result.context.all_llm_calls?.last_input_tokens ?? result.context.total_input;
4479
4480
  parts.push(`${used.toLocaleString()}/${result.context.context_window.toLocaleString()} context`);
4480
4481
  }
4482
+ if (result.context?.credits_spent != null && result.context.credit_budget != null) {
4483
+ parts.push(`${result.context.credits_spent.toFixed(2)}/${result.context.credit_budget} credits`);
4484
+ }
4481
4485
  if (elapsedTime != null) {
4482
4486
  parts.push(`${elapsedTime.toFixed(1)}s`);
4483
4487
  }