agent-worker 0.9.0 → 0.10.0

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.
@@ -2157,7 +2157,7 @@ Examples:
2157
2157
 
2158
2158
  Note: Workflow name is inferred from YAML 'name' field or filename
2159
2159
  `).action(async (file, options) => {
2160
- const { parseWorkflowFile, runWorkflowWithControllers } = await import("../workflow-CoZnnJ3O.mjs");
2160
+ const { parseWorkflowFile, runWorkflowWithControllers } = await import("../workflow-BGpkJlFb.mjs");
2161
2161
  const tag = options.tag || DEFAULT_TAG;
2162
2162
  const parsedWorkflow = await parseWorkflowFile(file, { tag });
2163
2163
  const workflowName = parsedWorkflow.name;
@@ -2168,7 +2168,7 @@ Note: Workflow name is inferred from YAML 'name' field or filename
2168
2168
  isCleaningUp = true;
2169
2169
  console.log("\nInterrupted, cleaning up...");
2170
2170
  if (controllers) {
2171
- const { shutdownControllers } = await import("../workflow-CoZnnJ3O.mjs");
2171
+ const { shutdownControllers } = await import("../workflow-BGpkJlFb.mjs");
2172
2172
  const { createSilentLogger } = await import("../logger-C3ekEOzi.mjs");
2173
2173
  await shutdownControllers(controllers, createSilentLogger());
2174
2174
  }
@@ -2206,7 +2206,7 @@ Note: Workflow name is inferred from YAML 'name' field or filename
2206
2206
  feedback: result.feedback
2207
2207
  }, null, 2));
2208
2208
  else if (!options.debug) {
2209
- const { showWorkflowSummary } = await import("../display-pretty-BL9H2ocr.mjs");
2209
+ const { showWorkflowSummary } = await import("../display-pretty-CWoRE9FY.mjs");
2210
2210
  showWorkflowSummary({
2211
2211
  duration: result.duration,
2212
2212
  document: finalDoc,
@@ -2238,7 +2238,7 @@ Examples:
2238
2238
 
2239
2239
  Note: Workflow name is inferred from YAML 'name' field or filename
2240
2240
  `).action(async (file, options) => {
2241
- const { parseWorkflowFile, runWorkflowWithControllers } = await import("../workflow-CoZnnJ3O.mjs");
2241
+ const { parseWorkflowFile, runWorkflowWithControllers } = await import("../workflow-BGpkJlFb.mjs");
2242
2242
  const tag = options.tag || DEFAULT_TAG;
2243
2243
  const parsedWorkflow = await parseWorkflowFile(file, { tag });
2244
2244
  const workflowName = parsedWorkflow.name;
@@ -2581,7 +2581,7 @@ Note: Requires agent to be created with --feedback flag
2581
2581
 
2582
2582
  //#endregion
2583
2583
  //#region package.json
2584
- var version = "0.9.0";
2584
+ var version = "0.10.0";
2585
2585
 
2586
2586
  //#endregion
2587
2587
  //#region src/cli/index.ts
@@ -49,10 +49,21 @@ function getAgentColor(name, agentNames) {
49
49
  return AGENT_COLORS[idx % AGENT_COLORS.length];
50
50
  }
51
51
  /**
52
+ * Extract HH:MM:SS from ISO timestamp for display
53
+ */
54
+ function formatTime(timestamp) {
55
+ const d = new Date(timestamp);
56
+ const h = String(d.getHours()).padStart(2, "0");
57
+ const m = String(d.getMinutes()).padStart(2, "0");
58
+ const s = String(d.getSeconds()).padStart(2, "0");
59
+ return pc.dim(`${h}:${m}:${s}`);
60
+ }
61
+ /**
52
62
  * Process a channel entry for pretty display
53
63
  */
54
64
  function processEntry(entry, state, agentNames) {
55
- const { kind, from, content, toolCall } = entry;
65
+ const { kind, from, content, toolCall, timestamp } = entry;
66
+ const time = formatTime(timestamp);
56
67
  if (kind === "debug") return;
57
68
  if (kind === "tool_call" && toolCall) {
58
69
  const caller = from.includes(":") ? from.split(":").pop() : from;
@@ -60,8 +71,18 @@ function processEntry(entry, state, agentNames) {
60
71
  const color = getAgentColor(caller, agentNames);
61
72
  const tool = pc.bold(pc.cyan(toolCall.name));
62
73
  const args = toolCall.args ? pc.dim(`(${toolCall.args})`) : pc.dim("()");
63
- p.log.message(`${color(caller)} called ${tool}${args}`, { symbol: pc.cyan("▶") });
64
- } else p.log.message(`called ${pc.cyan(pc.bold(toolCall.name))}${pc.dim(`(${toolCall.args || ""})`)}`, { symbol: pc.cyan("▶") });
74
+ p.log.message(`${time} ${color(caller)} called ${tool}${args}`, { symbol: pc.cyan("▶") });
75
+ } else p.log.message(`${time} called ${pc.cyan(pc.bold(toolCall.name))}${pc.dim(`(${toolCall.args || ""})`)}`, { symbol: pc.cyan("▶") });
76
+ return;
77
+ }
78
+ if (kind === "stream") {
79
+ const color = getAgentColor(from, agentNames);
80
+ const agent = from.includes(":") ? from.split(":").pop() : from;
81
+ if (content.startsWith("STARTING ") || content.startsWith("CALL ")) p.log.message(`${time} ${color(agent)} ${content}`, { symbol: pc.cyan("▶") });
82
+ else if (content.startsWith("Assistant: ")) {
83
+ const text = content.slice(11);
84
+ p.log.message(`${time} ${color(agent)} ${text}`, { symbol: pc.cyan("◆") });
85
+ } else p.log.message(`${time} ${color(agent)} ${pc.dim(content)}`, { symbol: pc.dim("│") });
65
86
  return;
66
87
  }
67
88
  if (kind === "log") {
@@ -73,7 +94,7 @@ function processEntry(entry, state, agentNames) {
73
94
  if (content.includes("Starting agents")) {
74
95
  if (state.spinner) {
75
96
  const agentList = agentNames.join(", ");
76
- state.spinner.stop(`Initialized: ${pc.dim(agentList)}`);
97
+ state.spinner.stop(`${time} Initialized: ${pc.dim(agentList)}`);
77
98
  }
78
99
  state.spinner = p.spinner();
79
100
  state.spinner.start("Starting agents");
@@ -83,22 +104,22 @@ function processEntry(entry, state, agentNames) {
83
104
  state.spinner = null;
84
105
  }
85
106
  const match = content.match(/\(([0-9.]+)s\)/);
86
- if (match) p.log.success(`Completed in ${pc.bold(match[1])}s`);
87
- else p.log.success("Workflow complete");
107
+ if (match) p.log.success(`${time} Completed in ${pc.bold(match[1])}s`);
108
+ else p.log.success(`${time} Workflow complete`);
88
109
  state.phase = "complete";
89
110
  } else if (content.startsWith("[ERROR]")) {
90
111
  if (state.spinner) {
91
112
  state.spinner.stop();
92
113
  state.spinner = null;
93
114
  }
94
- p.log.error(content.replace("[ERROR] ", ""));
115
+ p.log.error(`${time} ${content.replace("[ERROR] ", "")}`);
95
116
  state.phase = "error";
96
- } else if (content.startsWith("[WARN]")) p.log.warn(content.replace("[WARN] ", ""));
97
- else if (content.match(/Inbox: \d+ message/)) p.log.step(pc.dim(content));
98
- else if (content.match(/Running \(attempt/)) p.log.step(pc.dim(content));
117
+ } else if (content.startsWith("[WARN]")) p.log.warn(`${time} ${content.replace("[WARN] ", "")}`);
118
+ else if (content.match(/Inbox: \d+ message/)) p.log.step(`${time} ${pc.dim(content)}`);
119
+ else if (content.match(/Running \(attempt/)) p.log.step(`${time} ${pc.dim(content)}`);
99
120
  else if (content.startsWith("DONE")) {
100
121
  const details = content.replace("DONE ", "");
101
- p.log.info(pc.green("✓") + " " + pc.dim(details));
122
+ p.log.info(`${time} ${pc.green("✓")} ${pc.dim(details)}`);
102
123
  }
103
124
  return;
104
125
  }
@@ -106,10 +127,10 @@ function processEntry(entry, state, agentNames) {
106
127
  if (state.spinner && state.phase === "running" && !state.hasShownAgentsStarted) {
107
128
  state.spinner.stop();
108
129
  state.spinner = null;
109
- p.log.info("Agents ready and processing");
130
+ p.log.info(`${time} Agents ready and processing`);
110
131
  state.hasShownAgentsStarted = true;
111
132
  }
112
- p.note(content.trim(), color(from));
133
+ p.note(content.trim(), `${time} ${color(from)}`);
113
134
  }
114
135
  /**
115
136
  * Start pretty display watcher
@@ -1620,7 +1620,7 @@ async function runWorkflowWithControllers(config) {
1620
1620
  logger.debug("Kickoff sent");
1621
1621
  let channelWatcher;
1622
1622
  if (config.prettyDisplay) {
1623
- const { startPrettyDisplay } = await import("./display-pretty-BL9H2ocr.mjs");
1623
+ const { startPrettyDisplay } = await import("./display-pretty-CWoRE9FY.mjs");
1624
1624
  channelWatcher = startPrettyDisplay({
1625
1625
  contextProvider: runtime.contextProvider,
1626
1626
  agentNames: runtime.agentNames,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-worker",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "SDK and CLI for creating and testing agent workers with Vercel AI SDK",
5
5
  "type": "module",
6
6
  "main": "./dist/index.mjs",