pi-ultracode 0.10.0 → 0.10.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-ultracode",
3
- "version": "0.10.0",
3
+ "version": "0.10.2",
4
4
  "description": "Adaptive semantic-depth workflow orchestration for Pi, with focused, standard, and deep modes, isolated subagents, worktree delivery, structured output, and durable resume.",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -6,7 +6,7 @@
6
6
 
7
7
  import * as crypto from "node:crypto";
8
8
  import * as path from "node:path";
9
- import { defineTool, type ToolDefinition } from "@earendil-works/pi-coding-agent";
9
+ import { defineTool, highlightCode, type ToolDefinition } from "@earendil-works/pi-coding-agent";
10
10
  import { Text } from "@earendil-works/pi-tui";
11
11
  import { Type } from "typebox";
12
12
  import {
@@ -14,7 +14,7 @@ import {
14
14
  WORKFLOW_PROMPT_SNIPPET,
15
15
  WORKFLOW_TOOL_DESCRIPTION,
16
16
  } from "../prompts.ts";
17
- import { redactCommand, safeDisplayText } from "./display-text.ts";
17
+ import { DISPLAY_INPUT_LIMIT, redactCommand, safeDisplayText, safeTranscriptText } from "./display-text.ts";
18
18
  import { parseWorkflowScript, normalizeScript } from "./parser.ts";
19
19
  import {
20
20
  ABSOLUTE_MAX_AGENTS,
@@ -603,20 +603,29 @@ export function createWorkflowTool(deps: WorkflowToolDeps = {}): ToolDefinition<
603
603
  signal?.removeEventListener("abort", onOuterAbort);
604
604
  }
605
605
  },
606
- renderCall(_args, theme) {
607
- return new Text(theme.fg("toolTitle", theme.bold("workflow")), 0, 0);
606
+ renderCall(args, theme) {
607
+ const title = theme.fg("toolTitle", theme.bold("workflow"));
608
+ // Arguments arrive incrementally; display source without parsing incomplete JavaScript.
609
+ if (typeof args.script === "string" && args.script.length > 0) {
610
+ const source = safeTranscriptText(args.script, DISPLAY_INPUT_LIMIT);
611
+ const heading = theme.fg("muted", "Script · JavaScript");
612
+ return new Text(`${title}\n\n${heading}\n${highlightCode(source, "javascript").join("\n")}`, 0, 0);
613
+ }
614
+ const source = args.scriptPath || args.name;
615
+ return new Text(source ? `${title} ${theme.fg("muted", safeDisplayText(source, 240))}` : title, 0, 0);
608
616
  },
609
617
  renderResult(result, { isPartial, expanded }, theme) {
610
618
  const snapshot = result.details as WorkflowSnapshot | undefined;
611
619
  if (snapshot?.name) {
612
- return new Text(renderWorkflowText(snapshot, {
620
+ return new Text(`\n${theme.fg("toolTitle", theme.bold("Status"))}\n${renderWorkflowText(snapshot, {
613
621
  maxAgentRows: expanded ? Number.MAX_SAFE_INTEGER : undefined,
614
622
  maxLogs: expanded ? 12 : undefined,
615
623
  showResultPreviews: expanded && !isPartial,
616
- }), 0, 0);
624
+ })}`, 0, 0);
617
625
  }
618
626
  const text = result.content?.[0];
619
- return new Text(text?.type === "text" ? text.text : theme.fg("muted", "workflow"), 0, 0);
627
+ const heading = theme.fg("toolTitle", theme.bold("Result"));
628
+ return new Text(`\n${heading}\n${text?.type === "text" ? text.text : theme.fg("muted", "workflow")}`, 0, 0);
620
629
  },
621
630
  });
622
631
  }