@arbidocs/sdk 0.3.132 → 0.3.134

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
@@ -4187,14 +4187,10 @@ async function resolveWorkspace(store, workspaceOpt) {
4187
4187
  }
4188
4188
 
4189
4189
  // src/sse.ts
4190
- var LIFECYCLE_LABELS_FALLBACK = {
4191
- goal: "Thinking\u2026",
4192
- evaluation: "Evaluating results",
4193
- answering: "Answered",
4194
- interjection: "Your message",
4195
- planning: "Planning",
4196
- tool_progress: "Working"
4197
- };
4190
+ function humanizeStep(identifier) {
4191
+ const spaced = identifier.replace(/[_-]+/g, " ").trim();
4192
+ return spaced.charAt(0).toUpperCase() + spaced.slice(1);
4193
+ }
4198
4194
  function buildDocNameMap(docs) {
4199
4195
  const map = {};
4200
4196
  for (const doc of docs) {
@@ -4247,13 +4243,13 @@ function formatAgentStepLabel(step, docNames) {
4247
4243
  if (step.label) return `${step.label}${suffix}`;
4248
4244
  const detail = step.detail;
4249
4245
  if (step.step === "tool_progress" && detail && detail.length > 0) {
4250
- const label = detail[0].label || LIFECYCLE_LABELS_FALLBACK.tool_progress;
4246
+ const label = detail[0].label || detail[0].tool && humanizeStep(detail[0].tool) || humanizeStep(step.step);
4251
4247
  if (suffix) return `${label}${suffix}`;
4252
4248
  const message = detail[0].message;
4253
4249
  return message ? `${label}: ${resolveDocRefs(message, docNames)}` : label;
4254
4250
  }
4255
4251
  if (step.step) {
4256
- return LIFECYCLE_LABELS_FALLBACK[step.step] || step.step;
4252
+ return humanizeStep(step.step);
4257
4253
  }
4258
4254
  if (detail && detail.length > 0) {
4259
4255
  if (detail[0].label) return `${detail[0].label}${suffix}`;
@@ -4376,6 +4372,11 @@ async function streamSSE(response, callbacks = {}) {
4376
4372
  callbacks.onAgentStep?.(data);
4377
4373
  if (data.t != null) callbacks.onElapsedTime?.(data.t);
4378
4374
  },
4375
+ "arbi.generating": (raw) => {
4376
+ const data = JSON.parse(raw);
4377
+ callbacks.onGenerating?.(data);
4378
+ if (data.t != null) callbacks.onElapsedTime?.(data.t);
4379
+ },
4379
4380
  "arbi.agent_step_delta": (raw) => {
4380
4381
  const data = JSON.parse(raw);
4381
4382
  callbacks.onAgentStepDelta?.(data);