toolcraft 0.0.247 → 0.0.249

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/composition.json CHANGED
@@ -113,7 +113,7 @@
113
113
  },
114
114
  {
115
115
  "name": "toolcraft",
116
- "version": "0.0.247",
116
+ "version": "0.0.249",
117
117
  "license": "MIT"
118
118
  },
119
119
  {
@@ -123,7 +123,7 @@
123
123
  },
124
124
  {
125
125
  "name": "toolcraft-schema",
126
- "version": "0.0.247",
126
+ "version": "0.0.249",
127
127
  "license": "MIT"
128
128
  },
129
129
  {
@@ -113,7 +113,7 @@
113
113
  },
114
114
  {
115
115
  "name": "toolcraft",
116
- "version": "0.0.247",
116
+ "version": "0.0.249",
117
117
  "license": "MIT"
118
118
  },
119
119
  {
@@ -123,7 +123,7 @@
123
123
  },
124
124
  {
125
125
  "name": "toolcraft-schema",
126
- "version": "0.0.247",
126
+ "version": "0.0.249",
127
127
  "license": "MIT"
128
128
  },
129
129
  {
@@ -8,7 +8,7 @@
8
8
  },
9
9
  {
10
10
  "name": "toolcraft-schema",
11
- "version": "0.0.247",
11
+ "version": "0.0.249",
12
12
  "license": "MIT"
13
13
  }
14
14
  ]
@@ -9,9 +9,10 @@ export function renderRunView(buffer, options) {
9
9
  const composer = options.showQueue && !options.composer?.focused ? undefined : options.composer;
10
10
  const run = stats.run;
11
11
  const theme = getTheme().styles;
12
+ const compactHeight = buffer.height < 20;
12
13
  const width = Math.max(0, Math.min(164, buffer.width - 4));
13
14
  const x = Math.max(0, Math.floor((buffer.width - width) / 2));
14
- const sidebarWidth = !options.showQueue && width >= 106 ? Math.min(40, Math.floor(width * 0.29)) : 0;
15
+ const sidebarWidth = !compactHeight && !options.showQueue && width >= 106 ? Math.min(40, Math.floor(width * 0.29)) : 0;
15
16
  const transcriptWidth = Math.max(0, width - (sidebarWidth > 0 ? sidebarWidth + 3 : 0));
16
17
  const queue = run?.queue ?? [];
17
18
  const plans = queue.filter((item) => item.kind === "plan");
@@ -21,10 +22,10 @@ export function renderRunView(buffer, options) {
21
22
  const progress = plans.length > 0 ? ` · Plan ${activePlanIndex + 1}/${plans.length}` : "";
22
23
  put(buffer, { x, y: 0, width, height: 1 }, 0, `${options.title}${progress}`, { bold: true });
23
24
  const context = [run?.agent, run?.model ?? (run?.agent ? "default model" : undefined), run?.cwd].filter(Boolean).join(" · ");
24
- put(buffer, { x, y: 1, width, height: 1 }, 0, context, theme.muted);
25
25
  const draft = composer ? layoutComposer(composer, Math.max(1, transcriptWidth - 3)) : undefined;
26
- const inputLines = draft ? Math.min(3, draft.lines.length) : 0;
27
- const composerHeight = composer ? inputLines + 3 : 0;
26
+ const inputLines = draft ? Math.min(compactHeight ? 1 : 3, draft.lines.length) : 0;
27
+ const inputRow = compactHeight ? 1 : 2;
28
+ const composerHeight = composer ? inputLines + inputRow + (!compactHeight || composer.error || options.feedback ? 1 : 0) : 0;
28
29
  const hint = composer?.focused
29
30
  ? composer.kind === "plan" ? "Enter Queue plan Ctrl+P Message Esc Browse"
30
31
  : "Enter Queue Alt+Enter Newline Ctrl+P Plan Alt+↑↓ Target Esc Browse"
@@ -41,14 +42,17 @@ export function renderRunView(buffer, options) {
41
42
  footerLines[footerLines.length - 1] = previous ? `${previous} ${part}` : part;
42
43
  }
43
44
  const footerY = Math.max(0, buffer.height - footerLines.length);
44
- const composerY = Math.max(3, footerY - composerHeight);
45
+ const composerY = Math.max(0, footerY - composerHeight);
45
46
  const contentBottom = composer ? composerY - 1 : footerY - 1;
46
- let outputY = 3;
47
+ const showContext = !compactHeight || contentBottom >= 6;
48
+ if (showContext)
49
+ put(buffer, { x, y: 1, width, height: 1 }, 0, context, theme.muted);
50
+ let outputY = compactHeight ? showContext ? 2 : 1 : 3;
47
51
  if (sidebarWidth === 0) {
48
52
  if (activePlan?.kind === "plan") {
49
53
  put(buffer, { x, y: outputY++, width, height: 1 }, 0, `${marker(activePlan.status)} ${activePlanIndex + 1}. ${basename(activePlan.path)}`, { bold: true });
50
54
  }
51
- if (nextPlan?.kind === "plan" && !options.showQueue) {
55
+ if (nextPlan?.kind === "plan" && !options.showQueue && !compactHeight) {
52
56
  put(buffer, { x, y: outputY++, width, height: 1 }, 0, `○ ${activePlanIndex + 2}. ${basename(nextPlan.path)} · next`, theme.muted);
53
57
  }
54
58
  }
@@ -67,7 +71,8 @@ export function renderRunView(buffer, options) {
67
71
  const phase = truncateToWidth(plainTerminalText(phaseLabel), Math.max(8, transcriptWidth - progressLabel.length - 7));
68
72
  const statusMarker = { running: "●", error: "!", paused: "Ⅱ", idle: "○", done: "✓" }[stats.status];
69
73
  put(buffer, { x, y: outputY++, width: transcriptWidth, height: 1 }, 0, `${statusMarker} ${phase} · ${progressLabel}${run?.activity ? ` · ${run.activity}` : ""}`, stats.status === "error" ? theme.error : { bold: true });
70
- outputY++;
74
+ if (!compactHeight)
75
+ outputY++;
71
76
  const outputRect = { x, y: outputY, width: transcriptWidth, height: Math.max(0, contentBottom - outputY) };
72
77
  let scrollOffset = options.scrollOffset;
73
78
  let workOffset = options.workOffset ?? 0;
@@ -90,21 +95,22 @@ export function renderRunView(buffer, options) {
90
95
  ? "Usage unavailable" : `${formatNumber(stats.tokensIn + stats.tokensOut)} tokens`;
91
96
  const pendingMessages = queue.filter((item) => item.kind === "message" && item.status === "pending").length;
92
97
  const metrics = `${formatElapsed(stats.elapsedMs)} · ${usage}${pendingMessages ? ` · ${pendingMessages} message${pendingMessages === 1 ? "" : "s"} queued` : ""}${scrollOffset > 0 && !options.showQueue ? " · History paused" : ""}`;
93
- put(buffer, { x, y: Math.max(outputY, contentBottom), width: transcriptWidth, height: 1 }, 0, metrics, theme.muted);
98
+ put(buffer, { x, y: contentBottom, width: transcriptWidth, height: 1 }, 0, metrics, theme.muted);
94
99
  let cursor;
95
100
  if (composer && draft) {
96
101
  const rect = { x, y: composerY, width: transcriptWidth, height: composerHeight };
97
102
  const target = plans.find((plan) => plan.id === composer.afterPlanId) ?? activePlan;
98
103
  const label = composer.kind === "plan" ? "ADD PLAN · joins the end of the queue"
99
104
  : `AFTER ${target?.kind === "plan" ? basename(target.path) : "CURRENT PLAN"}`;
100
- put(buffer, rect, 0, "─".repeat(transcriptWidth), theme.muted);
101
- put(buffer, rect, 1, options.submitting ? "Adding to queue…" : label, theme.muted);
105
+ if (!compactHeight)
106
+ put(buffer, rect, 0, "─".repeat(transcriptWidth), theme.muted);
107
+ put(buffer, rect, inputRow - 1, options.submitting ? "Adding to queue…" : label, theme.muted);
102
108
  const start = Math.max(0, Math.min(draft.cursor.y - inputLines + 1, draft.lines.length - inputLines));
103
109
  for (let index = 0; index < inputLines; index++) {
104
110
  const text = composer.text.length === 0
105
111
  ? composer.kind === "plan" ? "docs/plans/next-plan.md" : "Queue a message for this plan…"
106
112
  : draft.lines[start + index] ?? "";
107
- put(buffer, rect, index + 2, `${index === 0 ? "›" : " "} ${text}`, composer.text.length === 0 ? theme.muted : {});
113
+ put(buffer, rect, index + inputRow, `${index === 0 ? "›" : " "} ${text}`, composer.text.length === 0 ? theme.muted : {});
108
114
  }
109
115
  if (composer.error)
110
116
  put(buffer, rect, composerHeight - 1, composer.error, theme.error);
@@ -113,7 +119,7 @@ export function renderRunView(buffer, options) {
113
119
  if (composer.focused && !options.submitting)
114
120
  cursor = {
115
121
  x: Math.min(buffer.width - 1, x + 3 + draft.cursor.x),
116
- y: Math.max(0, Math.min(footerY - 1, composerY + 2 + draft.cursor.y - start))
122
+ y: Math.max(0, Math.min(footerY - 1, composerY + inputRow + draft.cursor.y - start))
117
123
  };
118
124
  }
119
125
  for (const [index, line] of footerLines.entries()) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toolcraft-schema",
3
- "version": "0.0.247",
3
+ "version": "0.0.249",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toolcraft",
3
- "version": "0.0.247",
3
+ "version": "0.0.249",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -158,7 +158,7 @@
158
158
  "yaml"
159
159
  ],
160
160
  "optionalDependencies": {
161
- "toolcraft-schema": "0.0.247",
161
+ "toolcraft-schema": "0.0.249",
162
162
  "toolcraft-design": "*",
163
163
  "@poe-code/frontmatter": "*",
164
164
  "@poe-code/agent-mcp-config": "*",