@causyne/agent 1.20.65 → 1.20.68

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.
Files changed (42) hide show
  1. package/package.json +1 -1
  2. package/src/agentLoop.js +23 -15
  3. package/src/agentLoop.ts +23 -15
  4. package/src/browser/causyneBrowser.js +1 -1
  5. package/src/browser/causyneBrowser.ts +1 -1
  6. package/src/cliMode.js +62 -8
  7. package/src/commands.js +46 -19
  8. package/src/contextManager.js +1 -1
  9. package/src/continuum/ui/continuumPicker.js +1 -1
  10. package/src/continuum/ui/continuumPicker.ts +1 -1
  11. package/src/embodimentSession.js +1 -1
  12. package/src/planCache.js +1 -1
  13. package/src/planCache.ts +1 -1
  14. package/src/promptMentions.js +7 -7
  15. package/src/promptMentions.ts +7 -7
  16. package/src/providers/dashscope-byok.js +1 -1
  17. package/src/providers/qwen-byok.js +1 -1
  18. package/src/skillsManager.d.ts +4 -1
  19. package/src/tokenTracker.js +1 -1
  20. package/src/tokenTracker.ts +1 -1
  21. package/src/tool-scripts/ax_snapshot.ps1 +10 -10
  22. package/src/tools/fsList.js +1 -1
  23. package/src/tools/memoryWrite.js +1 -1
  24. package/src/tools/memoryWrite.ts +1 -1
  25. package/src/tui/chatRenderer.js +3 -2
  26. package/src/tui/codeStreamRenderer.js +8 -5
  27. package/src/tui/codeStreamRenderer.ts +10 -5
  28. package/src/tui/lineEditor.js +14 -21
  29. package/src/tui/modelPicker.js +1 -1
  30. package/src/tui/modelPicker.ts +1 -1
  31. package/src/tui/prompt.js +38 -13
  32. package/src/tui/sessionPicker.js +1 -1
  33. package/src/tui/sessionPicker.ts +1 -1
  34. package/src/tui/sessionSidebar.js +13 -0
  35. package/src/tui/sessionSidebar.ts +15 -0
  36. package/src/tui/skillAuthoring.js +147 -0
  37. package/src/tui/skillAuthoring.ts +172 -0
  38. package/src/tui/stage.js +1 -1
  39. package/src/tui/stageSurface.js +8 -10
  40. package/src/tui/theme.js +3 -0
  41. package/src/vfeTracker.js +1 -1
  42. package/src/vfeTracker.ts +1 -1
@@ -74,10 +74,10 @@ export async function resolveMentionedContext(prompt, options = {}) {
74
74
  for (const m of mentions) {
75
75
  if (m.isMeta) {
76
76
  if (m.path === 'workspace' || m.path === 'here') {
77
- sections.push(`📁 REFERENCED SCOPE: Whole workspace (${cwd})`);
77
+ sections.push(`◆ REFERENCED SCOPE: Whole workspace (${cwd})`);
78
78
  }
79
79
  else if (m.path === 'rea' || m.path === 'rea-agents') {
80
- sections.push(`🔬 REFERENCED CAPABILITY: Reverse Engineer Anything (REA) Substrate active.\n` +
80
+ sections.push(`◆ REFERENCED CAPABILITY: Reverse Engineer Anything (REA) Substrate active.\n` +
81
81
  `Use the 'reverse_engineering' tool with action 'inspect', 'unpack', 'decompile', or 'engine_tool' to analyze APKs, binaries, and assemblies.`);
82
82
  }
83
83
  continue;
@@ -120,7 +120,7 @@ export async function resolveMentionedContext(prompt, options = {}) {
120
120
  }
121
121
  const relPath = path.relative(cwd, targetPath).split(path.sep).join('/');
122
122
  if (!found) {
123
- sections.push(`📂 REFERENCED PATH: ${m.path} (Note: path was not found on disk at ${relPath})`);
123
+ sections.push(`◆ REFERENCED PATH: ${m.path} (Note: path was not found on disk at ${relPath})`);
124
124
  continue;
125
125
  }
126
126
  try {
@@ -134,7 +134,7 @@ export async function resolveMentionedContext(prompt, options = {}) {
134
134
  const more = entries.length > MAX_MENTION_DIR_ITEMS
135
135
  ? `\n ... (${entries.length - MAX_MENTION_DIR_ITEMS} more items)`
136
136
  : '';
137
- sections.push(`📁 REFERENCED DIRECTORY: ${relPath}/\n` +
137
+ sections.push(`◆ REFERENCED DIRECTORY: ${relPath}/\n` +
138
138
  `Directory listing (${summary.length} items):\n` +
139
139
  summary.map(s => ` - ${s}`).join('\n') +
140
140
  more);
@@ -144,7 +144,7 @@ export async function resolveMentionedContext(prompt, options = {}) {
144
144
  const isBinary = /\.(apk|aab|dex|dylib|so|dll|exe|bin|asar|zip|tar|gz|tgz)$/i.test(ext);
145
145
  if (isBinary) {
146
146
  const sizeMb = (stats.size / (1024 * 1024)).toFixed(2);
147
- sections.push(`📦 REFERENCED BINARY PACKAGE: ${relPath} (${stats.size.toLocaleString()} bytes, ~${sizeMb} MB, format: ${ext.toUpperCase().replace('.', '')})\n` +
147
+ sections.push(`◆ REFERENCED BINARY PACKAGE: ${relPath} (${stats.size.toLocaleString()} bytes, ~${sizeMb} MB, format: ${ext.toUpperCase().replace('.', '')})\n` +
148
148
  `Note: This is a binary/compiled package. Do not read raw bytes. Use the 'reverse_engineering' tool with action 'inspect', 'unpack', or 'decompile' to analyze manifest, classes, resources, and architecture.`);
149
149
  }
150
150
  else {
@@ -158,7 +158,7 @@ export async function resolveMentionedContext(prompt, options = {}) {
158
158
  else {
159
159
  body = content;
160
160
  }
161
- sections.push(`📄 REFERENCED FILE: ${relPath} (${lines.length} lines):\n` +
161
+ sections.push(`◆ REFERENCED FILE: ${relPath} (${lines.length} lines):\n` +
162
162
  '```\n' +
163
163
  body + '\n' +
164
164
  '```');
@@ -167,7 +167,7 @@ export async function resolveMentionedContext(prompt, options = {}) {
167
167
  }
168
168
  catch (err) {
169
169
  const msg = err instanceof Error ? err.message : String(err);
170
- sections.push(`📂 REFERENCED PATH: ${relPath} (Error reading: ${msg})`);
170
+ sections.push(`◆ REFERENCED PATH: ${relPath} (Error reading: ${msg})`);
171
171
  }
172
172
  }
173
173
  const referencedContext = sections.length > 0
@@ -105,10 +105,10 @@ export async function resolveMentionedContext(
105
105
  for (const m of mentions) {
106
106
  if (m.isMeta) {
107
107
  if (m.path === 'workspace' || m.path === 'here') {
108
- sections.push(`📁 REFERENCED SCOPE: Whole workspace (${cwd})`);
108
+ sections.push(`◆ REFERENCED SCOPE: Whole workspace (${cwd})`);
109
109
  } else if (m.path === 'rea' || m.path === 'rea-agents') {
110
110
  sections.push(
111
- `🔬 REFERENCED CAPABILITY: Reverse Engineer Anything (REA) Substrate active.\n` +
111
+ `◆ REFERENCED CAPABILITY: Reverse Engineer Anything (REA) Substrate active.\n` +
112
112
  `Use the 'reverse_engineering' tool with action 'inspect', 'unpack', 'decompile', or 'engine_tool' to analyze APKs, binaries, and assemblies.`
113
113
  );
114
114
  }
@@ -156,7 +156,7 @@ export async function resolveMentionedContext(
156
156
  const relPath = path.relative(cwd, targetPath).split(path.sep).join('/');
157
157
 
158
158
  if (!found) {
159
- sections.push(`📂 REFERENCED PATH: ${m.path} (Note: path was not found on disk at ${relPath})`);
159
+ sections.push(`◆ REFERENCED PATH: ${m.path} (Note: path was not found on disk at ${relPath})`);
160
160
  continue;
161
161
  }
162
162
 
@@ -174,7 +174,7 @@ export async function resolveMentionedContext(
174
174
  : '';
175
175
 
176
176
  sections.push(
177
- `📁 REFERENCED DIRECTORY: ${relPath}/\n` +
177
+ `◆ REFERENCED DIRECTORY: ${relPath}/\n` +
178
178
  `Directory listing (${summary.length} items):\n` +
179
179
  summary.map(s => ` - ${s}`).join('\n') +
180
180
  more
@@ -185,7 +185,7 @@ export async function resolveMentionedContext(
185
185
  if (isBinary) {
186
186
  const sizeMb = (stats.size / (1024 * 1024)).toFixed(2);
187
187
  sections.push(
188
- `📦 REFERENCED BINARY PACKAGE: ${relPath} (${stats.size.toLocaleString()} bytes, ~${sizeMb} MB, format: ${ext.toUpperCase().replace('.', '')})\n` +
188
+ `◆ REFERENCED BINARY PACKAGE: ${relPath} (${stats.size.toLocaleString()} bytes, ~${sizeMb} MB, format: ${ext.toUpperCase().replace('.', '')})\n` +
189
189
  `Note: This is a binary/compiled package. Do not read raw bytes. Use the 'reverse_engineering' tool with action 'inspect', 'unpack', or 'decompile' to analyze manifest, classes, resources, and architecture.`
190
190
  );
191
191
  } else {
@@ -200,7 +200,7 @@ export async function resolveMentionedContext(
200
200
  }
201
201
 
202
202
  sections.push(
203
- `📄 REFERENCED FILE: ${relPath} (${lines.length} lines):\n` +
203
+ `◆ REFERENCED FILE: ${relPath} (${lines.length} lines):\n` +
204
204
  '```\n' +
205
205
  body + '\n' +
206
206
  '```'
@@ -209,7 +209,7 @@ export async function resolveMentionedContext(
209
209
  }
210
210
  } catch (err: unknown) {
211
211
  const msg = err instanceof Error ? err.message : String(err);
212
- sections.push(`📂 REFERENCED PATH: ${relPath} (Error reading: ${msg})`);
212
+ sections.push(`◆ REFERENCED PATH: ${relPath} (Error reading: ${msg})`);
213
213
  }
214
214
  }
215
215
 
@@ -65,7 +65,7 @@ export class DashscopeByokProvider extends LLMProvider {
65
65
  // Enterprise Error Handling: Detect Workspace-bound API Key configuration errors
66
66
  if (response.status === 401 && this.apiKey && this.apiKey.startsWith('sk-ws-')) {
67
67
  if (!this.baseUrl.includes('ws-')) {
68
- throw new Error(`\n❌ QWEN WORKSPACE CONFIGURATION ERROR ❌\n\nYou are using a Workspace-bound API Key (starts with sk-ws-), but you haven't configured your Workspace Base URL!\n\nAlibaba requires a specific URL for these keys.\n\n🛠️ HOW TO FIX THIS:\n1. Open your computer terminal.\n2. Run command: causyne-agent config\n3. When asked for 'Custom Base URL', paste your Workspace URL from Alibaba (e.g. https://{Your-Workspace-ID}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1/chat/completions).\n\nAlternatively, use a Standard API Key (starts with sk-) which does not require a custom URL.`);
68
+ throw new Error(`\n[QWEN WORKSPACE CONFIGURATION ERROR]\n\nYou are using a Workspace-bound API Key (starts with sk-ws-), but you haven't configured your Workspace Base URL!\n\nAlibaba requires a specific URL for these keys.\n\nHOW TO FIX THIS:\n1. Open your computer terminal.\n2. Run command: causyne-agent config\n3. When asked for 'Custom Base URL', paste your Workspace URL from Alibaba (e.g. https://{Your-Workspace-ID}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1/chat/completions).\n\nAlternatively, use a Standard API Key (starts with sk-) which does not require a custom URL.`);
69
69
  }
70
70
  }
71
71
 
@@ -55,7 +55,7 @@ export class QwenByokProvider extends LLMProvider {
55
55
  // Enterprise Error Handling: Detect Workspace-bound API Key configuration errors
56
56
  if (response.status === 401 && this.apiKey && this.apiKey.startsWith('sk-ws-')) {
57
57
  if (!this.baseUrl.includes('ws-')) {
58
- throw new Error(`\n❌ QWEN WORKSPACE CONFIGURATION ERROR ❌\n\nYou are using a Workspace-bound API Key (starts with sk-ws-), but you haven't configured your Workspace Base URL!\n\nAlibaba requires a specific URL for these keys.\n\n🛠️ HOW TO FIX THIS:\n1. Open your computer terminal.\n2. Run command: causyne-agent config\n3. When asked for 'Custom Base URL', paste your Workspace URL from Alibaba (e.g. https://{Your-Workspace-ID}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1/chat/completions).\n\nAlternatively, use a Standard API Key (starts with sk-) which does not require a custom URL.`);
58
+ throw new Error(`\n[QWEN WORKSPACE CONFIGURATION ERROR]\n\nYou are using a Workspace-bound API Key (starts with sk-ws-), but you haven't configured your Workspace Base URL!\n\nAlibaba requires a specific URL for these keys.\n\nHOW TO FIX THIS:\n1. Open your computer terminal.\n2. Run command: causyne-agent config\n3. When asked for 'Custom Base URL', paste your Workspace URL from Alibaba (e.g. https://{Your-Workspace-ID}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1/chat/completions).\n\nAlternatively, use a Standard API Key (starts with sk-) which does not require a custom URL.`);
59
59
  }
60
60
  }
61
61
 
@@ -1,4 +1,7 @@
1
1
  export function detectWorkspaceDomains(...args: any[]): any;
2
2
  export function ensureSkillRepo(...args: any[]): any;
3
3
  export function getSkillDomainHeader(...args: any[]): any;
4
- export function listCompiledSkills(): Array<{ id: string; name: string; domain: string; description?: string }>;
4
+ export function listCompiledSkills(): Array<{ id: string; name: string; domain: string; description?: string; source?: string }>;
5
+ export function readCompiledSkill(domain: string, skillId: string): string;
6
+ export function invalidateUserSkills(): void;
7
+ export function userSkillProblems(): string[];
@@ -222,7 +222,7 @@ export class TokenTracker {
222
222
  if (alertThreshold && alertThreshold > 0 && daily.totalTokens >= alertThreshold && !daily.alertSent) {
223
223
  daily.alertSent = true;
224
224
  await this.saveDailyUsage(daily);
225
- const msg = `⚠️ Token Budget Alert: Your BYOK usage has reached ${daily.totalTokens.toLocaleString()} tokens (Threshold: ${alertThreshold.toLocaleString()}).`;
225
+ const msg = `△ Token Budget Alert: Your BYOK usage has reached ${daily.totalTokens.toLocaleString()} tokens (Threshold: ${alertThreshold.toLocaleString()}).`;
226
226
  if (onWarning) {
227
227
  onWarning(msg);
228
228
  }
@@ -315,7 +315,7 @@ export class TokenTracker {
315
315
  daily.alertSent = true;
316
316
  await this.saveDailyUsage(daily);
317
317
 
318
- const msg = `⚠️ Token Budget Alert: Your BYOK usage has reached ${daily.totalTokens.toLocaleString()} tokens (Threshold: ${alertThreshold.toLocaleString()}).`;
318
+ const msg = `△ Token Budget Alert: Your BYOK usage has reached ${daily.totalTokens.toLocaleString()} tokens (Threshold: ${alertThreshold.toLocaleString()}).`;
319
319
  if (onWarning) {
320
320
  onWarning(msg);
321
321
  }
@@ -1,10 +1,10 @@
1
- Add-Type -AssemblyName UIAutomationClient,UIAutomationTypes
2
- $max = [int]$args[0]
3
- $root = [System.Windows.Automation.AutomationElement]::RootElement
4
- $cond = [System.Windows.Automation.Condition]::TrueCondition
5
- $n = 0
6
- foreach ($e in $root.FindAll([System.Windows.Automation.TreeScope]::Descendants, $cond)) {
7
- if ($n -ge $max) { break }
8
- $name = $e.Current.Name
9
- if ($name) { Write-Output ("" + $e.Current.ControlType.ProgrammaticName + "|" + $name + "|"); $n++ }
10
- }
1
+ Add-Type -AssemblyName UIAutomationClient,UIAutomationTypes
2
+ $max = [int]$args[0]
3
+ $root = [System.Windows.Automation.AutomationElement]::RootElement
4
+ $cond = [System.Windows.Automation.Condition]::TrueCondition
5
+ $n = 0
6
+ foreach ($e in $root.FindAll([System.Windows.Automation.TreeScope]::Descendants, $cond)) {
7
+ if ($n -ge $max) { break }
8
+ $name = $e.Current.Name
9
+ if ($name) { Write-Output ("" + $e.Current.ControlType.ProgrammaticName + "|" + $name + "|"); $n++ }
10
+ }
@@ -67,7 +67,7 @@ export const fsList = {
67
67
  const maxDepth = args.depth || 2;
68
68
 
69
69
  const tree = await generateTree(target, 1, maxDepth);
70
- const header = `📁 ${target}\n`;
70
+ const header = `${target}\n`;
71
71
 
72
72
  return { success: true, output: header + (tree || ' (Empty or access denied)') };
73
73
  } catch (e) {
@@ -71,7 +71,7 @@ export const memoryWrite = {
71
71
  if (dependencies && typeof dependencies.broadcast === 'function') {
72
72
  dependencies.broadcast({
73
73
  type: 'agent_message',
74
- content: `🧠 Persistent memory updated: "${fact}"`
74
+ content: `◆ Persistent memory updated: "${fact}"`
75
75
  });
76
76
  }
77
77
  const notes = [
@@ -98,7 +98,7 @@ export const memoryWrite = {
98
98
  if (dependencies && typeof dependencies.broadcast === 'function') {
99
99
  dependencies.broadcast({
100
100
  type: 'agent_message',
101
- content: `🧠 Persistent memory updated: "${fact}"`
101
+ content: `◆ Persistent memory updated: "${fact}"`
102
102
  });
103
103
  }
104
104
 
@@ -1219,8 +1219,9 @@ export class ChatRenderer {
1219
1219
  // single write put the continuation lines at column 0, under a marker
1220
1220
  // indented five columns, so the whole block read as unrelated fragments.
1221
1221
  const label = `${msg.tool || ''}`.trim();
1222
- const detail = safeDisplay(`${msg.error || ''}`.trim());
1223
- const head = label ? `${label} ${detail}` : detail;
1222
+ const rawError = msg.error || (msg.result && (msg.result.error || msg.result.message)) || '';
1223
+ const detail = safeDisplay(`${rawError}`.trim());
1224
+ const head = label && detail ? `${label} ${detail}` : (detail || label || 'failed');
1224
1225
 
1225
1226
  this.frame('error', () => {
1226
1227
  const rows = wrapBlock(head, Math.max(20, this.width() - 7), { hang: 0 });
@@ -35,15 +35,18 @@ export class CodeStreamRenderer extends ChatRenderer {
35
35
  const transcript = this.transcript;
36
36
  if (!transcript || !Array.isArray(transcript.frames))
37
37
  return;
38
- const tail = transcript.frames.at(-1);
39
- if (tail?.meta?.reasoning === true && tail.meta.streaming === true) {
38
+ const activeFrame = transcript.frames.findLast((f) => f?.meta?.reasoning === true && f.meta?.streaming === true);
39
+ if (activeFrame && activeFrame.meta) {
40
40
  if (nowMs > 0) {
41
- tail.meta.durationText = formatElapsed(nowMs);
41
+ activeFrame.meta.durationText = formatElapsed(nowMs);
42
42
  }
43
- tail.rows = null;
44
- tail.renderedWidth = -1;
43
+ activeFrame.rows = null;
44
+ activeFrame.renderedWidth = -1;
45
45
  transcript.cache = null;
46
46
  transcript.revision++;
47
+ if (typeof transcript.changed === 'function') {
48
+ transcript.changed();
49
+ }
47
50
  }
48
51
  }
49
52
  renderReasoning(content, options = {}) {
@@ -61,15 +61,20 @@ export class CodeStreamRenderer extends ChatRenderer {
61
61
  this.streamingTick = tick;
62
62
  const transcript = this.transcript as unknown as CodeTranscript | null;
63
63
  if (!transcript || !Array.isArray(transcript.frames)) return;
64
- const tail = transcript.frames.at(-1);
65
- if (tail?.meta?.reasoning === true && tail.meta.streaming === true) {
64
+ const activeFrame = transcript.frames.findLast(
65
+ (f: CodeFrame) => f?.meta?.reasoning === true && f.meta?.streaming === true
66
+ );
67
+ if (activeFrame && activeFrame.meta) {
66
68
  if (nowMs > 0) {
67
- tail.meta.durationText = formatElapsed(nowMs);
69
+ activeFrame.meta.durationText = formatElapsed(nowMs);
68
70
  }
69
- tail.rows = null;
70
- tail.renderedWidth = -1;
71
+ activeFrame.rows = null;
72
+ activeFrame.renderedWidth = -1;
71
73
  transcript.cache = null;
72
74
  transcript.revision++;
75
+ if (typeof transcript.changed === 'function') {
76
+ transcript.changed();
77
+ }
73
78
  }
74
79
  }
75
80
 
@@ -374,12 +374,14 @@ export class LineEditor {
374
374
 
375
375
  let pos = 0;
376
376
  while (pos <= line.length) {
377
- if (isCurrentLine && pos === this.col && !placed) {
378
- cursorRow = rows.length;
379
- cursorCol = prefixWidth + used;
380
- placed = true;
377
+ if (pos === line.length) {
378
+ if (isCurrentLine && pos === this.col && !placed) {
379
+ cursorRow = rows.length;
380
+ cursorCol = prefixWidth + used;
381
+ placed = true;
382
+ }
383
+ break;
381
384
  }
382
- if (pos === line.length) break;
383
385
 
384
386
  const isSpace = /\s/.test(line[pos]);
385
387
  let nextPos = pos;
@@ -389,24 +391,14 @@ export class LineEditor {
389
391
  nextPos++;
390
392
  }
391
393
 
392
- // If non-whitespace word exceeds remaining space on non-empty line: wrap to next line!
394
+ // If non-whitespace word exceeds remaining space on non-empty line: wrap to next line first!
393
395
  if (used > 0 && used + tokenWidth > budget && !isSpace) {
394
396
  rows.push(row);
395
397
  row = prefix;
396
398
  used = 0;
397
- if (isCurrentLine && pos === this.col && !placed) {
398
- cursorRow = rows.length;
399
- cursorCol = prefixWidth;
400
- placed = true;
401
- }
402
399
  }
403
400
 
404
401
  while (pos < nextPos) {
405
- if (isCurrentLine && pos === this.col && !placed) {
406
- cursorRow = rows.length;
407
- cursorCol = prefixWidth + used;
408
- placed = true;
409
- }
410
402
  const char = line[pos];
411
403
  const charWidth = visibleWidth(char);
412
404
 
@@ -414,11 +406,12 @@ export class LineEditor {
414
406
  rows.push(row);
415
407
  row = prefix;
416
408
  used = 0;
417
- if (isCurrentLine && pos === this.col && !placed) {
418
- cursorRow = rows.length;
419
- cursorCol = prefixWidth;
420
- placed = true;
421
- }
409
+ }
410
+
411
+ if (isCurrentLine && pos === this.col && !placed) {
412
+ cursorRow = rows.length;
413
+ cursorCol = prefixWidth + used;
414
+ placed = true;
422
415
  }
423
416
 
424
417
  const isSelected = range ? isInsideRange(index, pos, range) : false;
@@ -367,7 +367,7 @@ export async function runInteractiveModelPicker(prompt, store = { loadConfig, sa
367
367
  // Case 1: ACP Peer Agent or Antigravity
368
368
  if (target.type === 'acp') {
369
369
  if (!target.installed) {
370
- return (`⚠️ Notice: "${target.providerLabel}" is not installed on this machine.\n` +
370
+ return (`△ Notice: "${target.providerLabel}" is not installed on this machine.\n` +
371
371
  `Setup: ${target.setupInstruction || 'Install the CLI binary.'}\n\n` +
372
372
  `Model was not changed.`);
373
373
  }
@@ -468,7 +468,7 @@ export async function runInteractiveModelPicker(
468
468
  if (target.type === 'acp') {
469
469
  if (!target.installed) {
470
470
  return (
471
- `⚠️ Notice: "${target.providerLabel}" is not installed on this machine.\n` +
471
+ `△ Notice: "${target.providerLabel}" is not installed on this machine.\n` +
472
472
  `Setup: ${target.setupInstruction || 'Install the CLI binary.'}\n\n` +
473
473
  `Model was not changed.`
474
474
  );
package/src/tui/prompt.js CHANGED
@@ -138,7 +138,7 @@ export class ChatPrompt {
138
138
  this.cursorRow = 0;
139
139
 
140
140
  // The status row of the live region, and the clock that animates it.
141
- this.renderer = null;
141
+ this.renderer = options.renderer || null;
142
142
  this.statusMessage = '';
143
143
  this.tick = 0;
144
144
  this.tickTimer = null;
@@ -421,6 +421,13 @@ export class ChatPrompt {
421
421
  const plan = this.renderer && Array.isArray(this.renderer.latestPlan) ? this.renderer.latestPlan : [];
422
422
  if (plan.length === 0) return [];
423
423
  const completed = plan.filter(item => item.status === 'completed').length;
424
+ const stageMax = this.surface?.stage?.maxHeight || this.out?.rows || 24;
425
+ if (stageMax < 22) {
426
+ const activeStep = plan.find(item => item.status === 'in_progress') || plan.find(item => item.status !== 'completed') || plan[0];
427
+ const stepText = activeStep ? (activeStep.text || activeStep.step || '') : '';
428
+ const summary = `${paint('accent', GLYPHS.skill || '✦')} ${bold('plan')} ${dim(`(${completed}/${plan.length})`)} ${dim('·')} ${truncate(safeDisplay(stepText), Math.max(8, width - 24), GLYPHS.ellipsis)}`;
429
+ return [summary, ''];
430
+ }
424
431
  const rows = [`${bold(paint('accent', 'implementation plan'))} ${dim(`${completed}/${plan.length}`)}`];
425
432
  const limit = Math.min(plan.length, 5);
426
433
  for (const item of plan.slice(0, limit)) {
@@ -672,9 +679,30 @@ export class ChatPrompt {
672
679
  // Reading
673
680
  // -------------------------------------------------------------------------
674
681
 
682
+ /**
683
+ * Render submitted user message into the chat transcript.
684
+ */
685
+ renderSubmittedUserMessage(text) {
686
+ if (this.surface?.homeInfo) this.surface.leaveHome();
687
+ if (this.renderer?.renderUserMessage) this.renderer.renderUserMessage(text);
688
+ else this.commit('user', (width) => {
689
+ const blockWidth = Math.max(8, width);
690
+ return barBlock(
691
+ wrapBlock(safeDisplay(text), Math.max(8, blockWidth - visibleWidth(GLYPHS.barHeavy || GLYPHS.bar) - GUTTER), { hang: 0 }),
692
+ { width: blockWidth, role: 'user', filled: true, surface: 'surfaceHi' }
693
+ );
694
+ });
695
+ }
696
+
675
697
  /** Next submitted line. Resolves immediately if one was queued while busy. */
676
698
  read() {
677
- if (this.queue.length > 0) return Promise.resolve(this.queue.shift());
699
+ if (this.queue.length > 0) {
700
+ const text = this.queue.shift();
701
+ if (typeof text === 'string' && !this.isCommand(text)) {
702
+ this.renderSubmittedUserMessage(text);
703
+ }
704
+ return Promise.resolve(text);
705
+ }
678
706
  return new Promise((resolve) => { this.waiter = resolve; });
679
707
  }
680
708
 
@@ -805,15 +833,9 @@ export class ChatPrompt {
805
833
  }
806
834
 
807
835
  // Render live submissions through the same path used when history reflows.
808
- if (this.surface?.homeInfo) this.surface.leaveHome();
809
- if (this.renderer?.renderUserMessage) this.renderer.renderUserMessage(text);
810
- else this.commit('user', (width) => {
811
- const blockWidth = Math.max(8, width);
812
- return barBlock(
813
- wrapBlock(safeDisplay(text), Math.max(8, blockWidth - visibleWidth(GLYPHS.barHeavy || GLYPHS.bar) - GUTTER), { hang: 0 }),
814
- { width: blockWidth, role: 'user', filled: true, surface: 'surfaceHi' }
815
- );
816
- });
836
+ if (!this.isCommand(text)) {
837
+ this.renderSubmittedUserMessage(text);
838
+ }
817
839
  const resolve = this.waiter;
818
840
  this.waiter = null;
819
841
  if (resolve) resolve(text);
@@ -916,7 +938,7 @@ export class ChatPrompt {
916
938
  switch (key.name) {
917
939
  case 'escape': return this.handleEscape();
918
940
  case 'enter':
919
- if (key.alt) { this.editor.newline(); return; }
941
+ if (key.alt || key.shift) { this.editor.newline(); return; }
920
942
  return this.submit();
921
943
  case 'tab':
922
944
  if (key.shift) return;
@@ -1691,7 +1713,10 @@ export class ChatPrompt {
1691
1713
  const inline = this.surface && !this.surface.homeInfo;
1692
1714
  const availableWidth = inline ? sessionMainWidth(this.surface.width) : width;
1693
1715
  const panelWidth = dialogWidth(availableWidth, this.layer.width || 64);
1694
- const maxHeight = dialogHeight(this.surface?.stage?.maxHeight || this.out?.rows, this.layer.preferredHeight());
1716
+ const stageMax = this.surface?.stage?.maxHeight || this.out?.rows || 24;
1717
+ const statusReserve = 2; // status row + margin
1718
+ const availableDialogRows = Math.max(4, stageMax - statusReserve);
1719
+ const maxHeight = dialogHeight(availableDialogRows, this.layer.preferredHeight());
1695
1720
  const panel = panelRows(this.layer, panelWidth, maxHeight);
1696
1721
  const status = this.statusRow(width);
1697
1722
  const all = this.clampRows(panel.concat(status), width);
@@ -244,7 +244,7 @@ export async function runInteractiveSessionPicker(prompt, options = {}) {
244
244
  }
245
245
  if (!switched) {
246
246
  cleanPrompt();
247
- return `⚠️ Could not switch to session "${targetId}". File may have been removed.`;
247
+ return `△ Could not switch to session "${targetId}". File may have been removed.`;
248
248
  }
249
249
  const historyMessages = options.loop?.memoryManager && typeof options.loop.memoryManager.loadHistory === 'function'
250
250
  ? options.loop.memoryManager.loadHistory()
@@ -323,7 +323,7 @@ export async function runInteractiveSessionPicker(
323
323
 
324
324
  if (!switched) {
325
325
  cleanPrompt();
326
- return `⚠️ Could not switch to session "${targetId}". File may have been removed.`;
326
+ return `△ Could not switch to session "${targetId}". File may have been removed.`;
327
327
  }
328
328
 
329
329
  const historyMessages = options.loop?.memoryManager && typeof options.loop.memoryManager.loadHistory === 'function'
@@ -61,6 +61,19 @@ export function sessionSidebarRows(facts, height) {
61
61
  line();
62
62
  styled(bold('Workspace'));
63
63
  line(facts.cwd || 'Unknown');
64
+ if (facts.activeSkill) {
65
+ const raw = facts.activeSkill;
66
+ const skillId = typeof raw === 'string' ? raw : (raw.id || raw.name || '');
67
+ const skillDesc = typeof raw === 'object' && raw ? raw.description || '' : '';
68
+ if (skillId) {
69
+ line();
70
+ styled(bold('Active Skill'));
71
+ styled(paint('accent', `✦ ${truncate(skillId, inner - 4, '…')}`));
72
+ if (skillDesc) {
73
+ line(truncate(skillDesc, inner, '…'));
74
+ }
75
+ }
76
+ }
64
77
  if (facts.plan?.length) {
65
78
  const completed = facts.plan.filter(item => item.status === 'completed').length;
66
79
  line();
@@ -15,6 +15,7 @@ export interface SidebarFacts {
15
15
  contextChars?: number;
16
16
  contextLimit?: number;
17
17
  plan?: Array<{ text?: string; step?: string; content?: string; status?: string }>;
18
+ activeSkill?: { id?: string; name?: string; domain?: string; description?: string } | string | null;
18
19
  }
19
20
 
20
21
  /** A side panel is useful only when a readable conversation column remains. */
@@ -76,6 +77,20 @@ export function sessionSidebarRows(facts: SidebarFacts, height: number): string[
76
77
  styled(bold('Workspace'));
77
78
  line(facts.cwd || 'Unknown');
78
79
 
80
+ if (facts.activeSkill) {
81
+ const raw = facts.activeSkill;
82
+ const skillId = typeof raw === 'string' ? raw : (raw.id || raw.name || '');
83
+ const skillDesc = typeof raw === 'object' && raw ? raw.description || '' : '';
84
+ if (skillId) {
85
+ line();
86
+ styled(bold('Active Skill'));
87
+ styled(paint('accent', `✦ ${truncate(skillId, inner - 4, '…')}`));
88
+ if (skillDesc) {
89
+ line(truncate(skillDesc, inner, '…'));
90
+ }
91
+ }
92
+ }
93
+
79
94
  if (facts.plan?.length) {
80
95
  const completed = facts.plan.filter(item => item.status === 'completed').length;
81
96
  line();