@automatalabs/workflows 0.43.0 → 0.44.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"agent-event-source.d.ts","sourceRoot":"","sources":["../src/agent-event-source.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAEV,yBAAyB,EAC1B,MAAM,YAAY,CAAC;AAMpB,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,KAAK,EAAE,yBAAyB,GAAG,IAAI,CAAC;CACjD;AAED,MAAM,WAAW,wBAAwB;IACvC,MAAM,CAAC,IAAI,EAAE,sBAAsB,GAAG,MAAM,IAAI,CAAC;CAClD;AA8CD,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,WAAW,GAAG,wBAAwB,CAUtF;AAuDD,8FAA8F;AAC9F,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,yBAAyB,GAC/B,qBAAqB,GAAG,SAAS,CA+CnC"}
1
+ {"version":3,"file":"agent-event-source.d.ts","sourceRoot":"","sources":["../src/agent-event-source.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAEV,yBAAyB,EAC1B,MAAM,YAAY,CAAC;AAMpB,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,KAAK,EAAE,yBAAyB,GAAG,IAAI,CAAC;CACjD;AAED,MAAM,WAAW,wBAAwB;IACvC,MAAM,CAAC,IAAI,EAAE,sBAAsB,GAAG,MAAM,IAAI,CAAC;CAClD;AA8CD,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,WAAW,GAAG,wBAAwB,CAUtF;AAuDD,8FAA8F;AAC9F,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,yBAAyB,GAC/B,qBAAqB,GAAG,SAAS,CAmEnC"}
@@ -142,9 +142,45 @@ export function projectWorkflowAgentActivity(event) {
142
142
  ...(Number.isSafeInteger(used) && used >= 0 ? { tokensObserved: used } : {}),
143
143
  };
144
144
  }
145
+ if (event.name === "tool_call_update") {
146
+ // A TERMINAL update carrying displayable content becomes a durable tool-result transcript
147
+ // entry; every other update keeps today's behavior (a bare content boundary).
148
+ const status = update.status;
149
+ if (status === "completed" || status === "failed") {
150
+ const text = toolCallContentText(update.content);
151
+ if (text !== undefined) {
152
+ const name = nestedToolName(update._meta) ??
153
+ (typeof update.kind === "string" && update.kind.trim().length > 0 ? update.kind : undefined);
154
+ return {
155
+ ...base,
156
+ kind: "tool-result",
157
+ text,
158
+ ...(name === undefined ? {} : { toolName: name }),
159
+ ...(status === "failed" ? { isError: true } : {}),
160
+ };
161
+ }
162
+ }
163
+ return { ...base, kind: "content-boundary" };
164
+ }
145
165
  if (event.name === "user_message_chunk" || event.name === "agent_thought_chunk" ||
146
- event.name === "tool_call_update" || event.name === "plan" || event.name === "plan_update" ||
166
+ event.name === "plan" || event.name === "plan_update" ||
147
167
  event.name === "plan_removed")
148
168
  return { ...base, kind: "content-boundary" };
149
169
  return undefined;
150
170
  }
171
+ /** Joined text of the update's `content` blocks (type "content" with nested text blocks). */
172
+ function toolCallContentText(content) {
173
+ if (!Array.isArray(content))
174
+ return undefined;
175
+ const parts = [];
176
+ for (const block of content) {
177
+ if (!isObject(block) || block.type !== "content")
178
+ continue;
179
+ const nested = block.content;
180
+ if (isObject(nested) && nested.type === "text" && typeof nested.text === "string" && nested.text.length > 0) {
181
+ parts.push(nested.text);
182
+ }
183
+ }
184
+ const joined = parts.join("\n").trim();
185
+ return joined.length > 0 ? joined : undefined;
186
+ }