terminal-pilot 0.0.47 → 0.0.49

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 (90) hide show
  1. package/dist/cli.d.ts +5 -0
  2. package/dist/cli.js +706 -164
  3. package/dist/cli.js.map +4 -4
  4. package/dist/commands/close-session.js.map +1 -1
  5. package/dist/commands/create-session.js.map +1 -1
  6. package/dist/commands/daemon-runtime.js.map +1 -1
  7. package/dist/commands/fill.js.map +1 -1
  8. package/dist/commands/get-session.js.map +1 -1
  9. package/dist/commands/index.js +77 -10
  10. package/dist/commands/index.js.map +4 -4
  11. package/dist/commands/install.js +81 -14
  12. package/dist/commands/install.js.map +4 -4
  13. package/dist/commands/installer.js +37 -6
  14. package/dist/commands/installer.js.map +3 -3
  15. package/dist/commands/list-sessions.js.map +1 -1
  16. package/dist/commands/press-key.js.map +1 -1
  17. package/dist/commands/read-history.js.map +1 -1
  18. package/dist/commands/read-screen.js.map +1 -1
  19. package/dist/commands/resize.js.map +1 -1
  20. package/dist/commands/runtime.js.map +1 -1
  21. package/dist/commands/screenshot.js.map +1 -1
  22. package/dist/commands/send-signal.js.map +1 -1
  23. package/dist/commands/type.js.map +1 -1
  24. package/dist/commands/uninstall.js +37 -6
  25. package/dist/commands/uninstall.js.map +3 -3
  26. package/dist/commands/wait-for-exit.js.map +1 -1
  27. package/dist/commands/wait-for.js.map +1 -1
  28. package/dist/composition.json +6 -1
  29. package/dist/testing/cli-repl.js +704 -163
  30. package/dist/testing/cli-repl.js.map +4 -4
  31. package/dist/testing/qa-cli.js +704 -163
  32. package/dist/testing/qa-cli.js.map +4 -4
  33. package/node_modules/@poe-code/agent-defs/README.md +15 -2
  34. package/node_modules/@poe-code/agent-defs/dist/agents/claude-code.js +2 -1
  35. package/node_modules/@poe-code/agent-defs/dist/agents/claude-desktop.js +1 -0
  36. package/node_modules/@poe-code/agent-defs/dist/agents/codex.js +2 -1
  37. package/node_modules/@poe-code/agent-defs/dist/agents/cursor.js +1 -0
  38. package/node_modules/@poe-code/agent-defs/dist/agents/gemini-cli.js +2 -1
  39. package/node_modules/@poe-code/agent-defs/dist/agents/goose.js +1 -0
  40. package/node_modules/@poe-code/agent-defs/dist/agents/index.d.ts +1 -0
  41. package/node_modules/@poe-code/agent-defs/dist/agents/index.js +1 -0
  42. package/node_modules/@poe-code/agent-defs/dist/agents/kimi.js +2 -1
  43. package/node_modules/@poe-code/agent-defs/dist/agents/opencode.js +2 -1
  44. package/node_modules/@poe-code/agent-defs/dist/agents/pi.d.ts +2 -0
  45. package/node_modules/@poe-code/agent-defs/dist/agents/pi.js +15 -0
  46. package/node_modules/@poe-code/agent-defs/dist/agents/poe-agent.js +1 -0
  47. package/node_modules/@poe-code/agent-defs/dist/capabilities.d.ts +14 -0
  48. package/node_modules/@poe-code/agent-defs/dist/capabilities.js +63 -0
  49. package/node_modules/@poe-code/agent-defs/dist/index.d.ts +3 -2
  50. package/node_modules/@poe-code/agent-defs/dist/index.js +2 -1
  51. package/node_modules/@poe-code/agent-defs/dist/registry.js +5 -1
  52. package/node_modules/@poe-code/agent-defs/dist/types.d.ts +8 -1
  53. package/node_modules/@poe-code/agent-skill-config/dist/apply.d.ts +2 -0
  54. package/node_modules/@poe-code/agent-skill-config/dist/apply.js +18 -14
  55. package/node_modules/@poe-code/agent-skill-config/dist/bridge-active-skills.js +3 -1
  56. package/node_modules/@poe-code/agent-skill-config/dist/configs.d.ts +2 -0
  57. package/node_modules/@poe-code/agent-skill-config/dist/configs.js +2 -1
  58. package/node_modules/@poe-code/frontmatter/README.md +3 -0
  59. package/node_modules/@poe-code/frontmatter/dist/index.d.ts +1 -1
  60. package/node_modules/@poe-code/frontmatter/dist/index.js +1 -1
  61. package/node_modules/@poe-code/frontmatter/dist/parse.d.ts +9 -0
  62. package/node_modules/@poe-code/frontmatter/dist/parse.js +16 -0
  63. package/node_modules/toolcraft-design/dist/acp/components.d.ts +8 -1
  64. package/node_modules/toolcraft-design/dist/acp/components.js +11 -6
  65. package/node_modules/toolcraft-design/dist/acp/index.d.ts +1 -0
  66. package/node_modules/toolcraft-design/dist/components/command-errors.d.ts +2 -0
  67. package/node_modules/toolcraft-design/dist/components/command-errors.js +8 -2
  68. package/node_modules/toolcraft-design/dist/components/help-formatter-plain.js +61 -25
  69. package/node_modules/toolcraft-design/dist/components/help-formatter.d.ts +17 -0
  70. package/node_modules/toolcraft-design/dist/components/help-formatter.js +128 -29
  71. package/node_modules/toolcraft-design/dist/components/index.d.ts +3 -3
  72. package/node_modules/toolcraft-design/dist/components/index.js +2 -2
  73. package/node_modules/toolcraft-design/dist/components/table.d.ts +1 -0
  74. package/node_modules/toolcraft-design/dist/components/table.js +52 -5
  75. package/node_modules/toolcraft-design/dist/components/template.d.ts +9 -0
  76. package/node_modules/toolcraft-design/dist/components/template.js +27 -2
  77. package/node_modules/toolcraft-design/dist/explorer/actions.d.ts +1 -0
  78. package/node_modules/toolcraft-design/dist/explorer/actions.js +1 -0
  79. package/node_modules/toolcraft-design/dist/explorer/reducer.js +1 -0
  80. package/node_modules/toolcraft-design/dist/explorer/runtime.js +21 -2
  81. package/node_modules/toolcraft-design/dist/explorer/state.d.ts +6 -0
  82. package/node_modules/toolcraft-design/dist/explorer/state.js +9 -6
  83. package/node_modules/toolcraft-design/dist/help-formatter.d.ts +2 -2
  84. package/node_modules/toolcraft-design/dist/help-formatter.js +1 -1
  85. package/node_modules/toolcraft-design/dist/index.d.ts +4 -4
  86. package/node_modules/toolcraft-design/dist/index.js +3 -3
  87. package/node_modules/toolcraft-design/dist/prompts/interactive/core.d.ts +5 -0
  88. package/node_modules/toolcraft-design/dist/prompts/interactive/core.js +15 -1
  89. package/node_modules/toolcraft-design/dist/prompts/primitives/spinner.js +1 -1
  90. package/package.json +4 -3
@@ -7,7 +7,7 @@ var claudeCodeAgent = {
7
7
  id: "claude-code",
8
8
  name: "claude-code",
9
9
  label: "Claude Code",
10
- summary: "Configure Claude Code to route through Poe.",
10
+ summary: "Anthropic's agentic coding tool for the terminal.",
11
11
  aliases: ["claude"],
12
12
  binaryName: "claude",
13
13
  apiShapes: ["anthropic-messages"],
@@ -17,6 +17,7 @@ var claudeCodeAgent = {
17
17
  }
18
18
  },
19
19
  configPath: "~/.claude.json",
20
+ capabilities: ["spawn", "configure", "install", "test", "skill", "mcp"],
20
21
  branding: {
21
22
  colors: {
22
23
  dark: "#C15F3C",
@@ -37,6 +38,7 @@ var claudeDesktopAgent = {
37
38
  linux: "~/.config/Claude/claude_desktop_config.json",
38
39
  win32: "~/AppData/Roaming/Claude/claude_desktop_config.json"
39
40
  },
41
+ capabilities: ["mcp"],
40
42
  branding: {
41
43
  colors: {
42
44
  dark: "#D97757",
@@ -50,7 +52,7 @@ var codexAgent = {
50
52
  id: "codex",
51
53
  name: "codex",
52
54
  label: "Codex",
53
- summary: "Configure Codex to use Poe as the model provider.",
55
+ summary: "OpenAI's coding agent for the terminal.",
54
56
  binaryName: "codex",
55
57
  apiShapes: ["openai-responses"],
56
58
  otelCapture: {
@@ -64,6 +66,7 @@ var codexAgent = {
64
66
  ]
65
67
  },
66
68
  configPath: "~/.codex/config.toml",
69
+ capabilities: ["spawn", "configure", "install", "test", "skill", "mcp"],
67
70
  branding: {
68
71
  colors: {
69
72
  dark: "#D5D9DF",
@@ -81,6 +84,7 @@ var cursorAgent = {
81
84
  summary: "Cursor's CLI coding agent.",
82
85
  binaryName: "cursor-agent",
83
86
  configPath: "~/.cursor/mcp.json",
87
+ capabilities: ["spawn", "configure", "install", "test", "skill", "mcp"],
84
88
  branding: {
85
89
  colors: {
86
90
  dark: "#FFFFFF",
@@ -95,10 +99,11 @@ var geminiCliAgent = {
95
99
  name: "gemini-cli",
96
100
  aliases: ["gemini"],
97
101
  label: "Gemini CLI",
98
- summary: "Configure Google's Gemini CLI to use a compatible Google generations API.",
102
+ summary: "Google's open-source AI agent for the terminal.",
99
103
  binaryName: "gemini",
100
104
  configPath: "~/.gemini/settings.json",
101
105
  apiShapes: ["google-generations"],
106
+ capabilities: ["spawn", "configure", "install", "test", "skill"],
102
107
  branding: {
103
108
  colors: {
104
109
  dark: "#8AB4F8",
@@ -112,7 +117,7 @@ var openCodeAgent = {
112
117
  id: "opencode",
113
118
  name: "opencode",
114
119
  label: "OpenCode CLI",
115
- summary: "Configure OpenCode CLI to use the Poe API.",
120
+ summary: "Open-source AI coding agent for the terminal.",
116
121
  binaryName: "opencode",
117
122
  apiShapes: ["openai-chat-completions"],
118
123
  otelCapture: {
@@ -121,6 +126,7 @@ var openCodeAgent = {
121
126
  }
122
127
  },
123
128
  configPath: "~/.config/opencode/opencode.json",
129
+ capabilities: ["spawn", "configure", "install", "test", "skill", "mcp"],
124
130
  branding: {
125
131
  colors: {
126
132
  dark: "#4A4F55",
@@ -134,11 +140,12 @@ var kimiAgent = {
134
140
  id: "kimi",
135
141
  name: "kimi",
136
142
  label: "Kimi",
137
- summary: "Configure Kimi CLI to use Poe API",
143
+ summary: "Moonshot AI's coding agent for the terminal.",
138
144
  aliases: ["kimi-cli"],
139
145
  binaryName: "kimi",
140
146
  apiShapes: ["openai-chat-completions"],
141
147
  configPath: "~/.kimi/mcp.json",
148
+ capabilities: ["spawn", "configure", "install", "test", "mcp"],
142
149
  branding: {
143
150
  colors: {
144
151
  dark: "#7B68EE",
@@ -157,6 +164,7 @@ var gooseAgent = {
157
164
  apiShapes: ["openai-chat-completions"],
158
165
  otelCapture: {},
159
166
  configPath: "~/.config/goose/config.yaml",
167
+ capabilities: ["spawn", "configure", "install", "test", "skill", "mcp"],
160
168
  branding: {
161
169
  colors: {
162
170
  dark: "#FF6B35",
@@ -165,6 +173,23 @@ var gooseAgent = {
165
173
  }
166
174
  };
167
175
 
176
+ // ../agent-defs/src/agents/pi.ts
177
+ var piAgent = {
178
+ id: "pi",
179
+ name: "pi",
180
+ aliases: ["pi-agent"],
181
+ label: "Pi",
182
+ summary: "Minimal AI coding agent for the terminal.",
183
+ binaryName: "pi",
184
+ capabilities: ["spawn"],
185
+ branding: {
186
+ colors: {
187
+ dark: "#F2F2F2",
188
+ light: "#242424"
189
+ }
190
+ }
191
+ };
192
+
168
193
  // ../agent-defs/src/agents/poe-agent.ts
169
194
  var poeAgentAgent = {
170
195
  id: "poe-agent",
@@ -173,6 +198,7 @@ var poeAgentAgent = {
173
198
  summary: "Run one-shot prompts with the built-in Poe agent runtime.",
174
199
  apiShapes: ["openai-responses", "openai-chat-completions"],
175
200
  configPath: "~/.poe-code/config.json",
201
+ capabilities: ["configure"],
176
202
  branding: {
177
203
  colors: {
178
204
  dark: "#A465F7",
@@ -189,6 +215,9 @@ function freezeAgent(agent) {
189
215
  if (agent.apiShapes !== void 0) {
190
216
  Object.freeze(agent.apiShapes);
191
217
  }
218
+ if (agent.capabilities !== void 0) {
219
+ Object.freeze(agent.capabilities);
220
+ }
192
221
  if (agent.otelCapture?.env !== void 0) {
193
222
  Object.freeze(agent.otelCapture.env);
194
223
  }
@@ -208,6 +237,7 @@ var allAgents = Object.freeze([
208
237
  freezeAgent(openCodeAgent),
209
238
  freezeAgent(kimiAgent),
210
239
  freezeAgent(gooseAgent),
240
+ freezeAgent(piAgent),
211
241
  freezeAgent(poeAgentAgent)
212
242
  ]);
213
243
  var lookup = /* @__PURE__ */ new Map();
@@ -251,7 +281,8 @@ var agentSkillConfigs = {
251
281
  },
252
282
  goose: {
253
283
  globalSkillDir: "~/.agents/skills",
254
- localSkillDir: ".agents/skills"
284
+ localSkillDir: ".agents/skills",
285
+ dirNote: "Goose discovers skills from the shared .agents/skills convention, not a goose-specific directory."
255
286
  }
256
287
  };
257
288
  var supportedAgents = Object.freeze(Object.keys(agentSkillConfigs));
@@ -977,6 +1008,19 @@ import { wrapAnsi } from "fast-wrap-ansi";
977
1008
 
978
1009
  // ../toolcraft-design/src/components/template.ts
979
1010
  var MAX_PARTIAL_DEPTH = 100;
1011
+ var MAX_TAG_EXCERPT_LENGTH = 40;
1012
+ var TemplateParseError = class extends Error {
1013
+ description;
1014
+ line;
1015
+ column;
1016
+ constructor(description, position) {
1017
+ super(`${description} at line ${position.line}, column ${position.column}`);
1018
+ this.name = "TemplateParseError";
1019
+ this.description = description;
1020
+ this.line = position.line;
1021
+ this.column = position.column;
1022
+ }
1023
+ };
980
1024
  var HTML_ESCAPE = {
981
1025
  "&": "&",
982
1026
  "<": "&lt;",
@@ -1083,13 +1127,13 @@ function parseTag(template, open) {
1083
1127
  if (template.startsWith("{{{", open)) {
1084
1128
  const close2 = template.indexOf("}}}", open + 3);
1085
1129
  if (close2 === -1) {
1086
- throw new Error("Unclosed unescaped tag");
1130
+ throw unclosedTagError(template, open, "}}}");
1087
1131
  }
1088
1132
  return { kind: "unescaped", name: template.slice(open + 3, close2).trim(), end: close2 + 3 };
1089
1133
  }
1090
1134
  const close = template.indexOf("}}", open + 2);
1091
1135
  if (close === -1) {
1092
- throw new Error("Unclosed tag");
1136
+ throw unclosedTagError(template, open, "}}");
1093
1137
  }
1094
1138
  const raw = template.slice(open + 2, close).trim();
1095
1139
  const sigil = raw[0];
@@ -1104,6 +1148,16 @@ function parseTag(template, open) {
1104
1148
  if (sigil === "=" && raw.endsWith("=")) return { kind: "delimiter", name, end };
1105
1149
  return { kind: "name", name: raw, end };
1106
1150
  }
1151
+ function unclosedTagError(template, open, expected) {
1152
+ const before = template.slice(0, open);
1153
+ const lineEnd = template.indexOf("\n", open);
1154
+ const opened = template.slice(open, lineEnd === -1 ? template.length : lineEnd).trimEnd();
1155
+ const tag = opened.length > MAX_TAG_EXCERPT_LENGTH ? `${opened.slice(0, MAX_TAG_EXCERPT_LENGTH)}...` : opened;
1156
+ return new TemplateParseError(`Unclosed tag "${tag}": expected "${expected}"`, {
1157
+ line: before.split("\n").length,
1158
+ column: open - (before.lastIndexOf("\n") + 1) + 1
1159
+ });
1160
+ }
1107
1161
  function getStandalone(template, tagStart, tagEnd, kind) {
1108
1162
  if (!["section", "inverted", "close", "comment", "partial", "delimiter"].includes(kind)) {
1109
1163
  return void 0;
@@ -2864,6 +2918,16 @@ async function executeMutation(mutation, context, options) {
2864
2918
  }
2865
2919
  }
2866
2920
 
2921
+ // ../user-error/src/index.ts
2922
+ var UserError = class extends Error {
2923
+ hint;
2924
+ constructor(message2, options) {
2925
+ super(message2, options);
2926
+ this.name = "UserError";
2927
+ this.hint = options?.hint;
2928
+ }
2929
+ };
2930
+
2867
2931
  // ../agent-skill-config/src/error-codes.ts
2868
2932
  function hasOwnErrorCode2(error2, code) {
2869
2933
  return error2 instanceof Error && Object.prototype.hasOwnProperty.call(error2, "code") && error2.code === code;
@@ -2915,8 +2979,11 @@ async function installSkill(agentId, skill, options) {
2915
2979
  const skillFilePath = `${skillFolderPath}/SKILL.md`;
2916
2980
  const displayPath = `${scope === "global" ? config2.globalSkillDir : config2.localSkillDir}/${skill.name}/SKILL.md`;
2917
2981
  const absoluteSkillPath = `${scope === "global" ? options.homeDir : options.cwd}/${skillFilePath.slice(2)}`;
2918
- if (await pathExists2(options.fs, absoluteSkillPath)) {
2919
- throw new Error(`Skill already exists: ${displayPath}`);
2982
+ if (!options.force && await pathExists2(options.fs, absoluteSkillPath)) {
2983
+ throw new UserError(
2984
+ `Skill already exists: ${displayPath}
2985
+ Re-run with --force to overwrite it, or remove it first.`
2986
+ );
2920
2987
  }
2921
2988
  await runMutations(
2922
2989
  [
@@ -2965,7 +3032,7 @@ import path7 from "node:path";
2965
3032
  import { fileURLToPath as fileURLToPath3 } from "node:url";
2966
3033
 
2967
3034
  // ../toolcraft/src/user-error.ts
2968
- var UserError = class extends Error {
3035
+ var UserError2 = class extends Error {
2969
3036
  constructor(message2, options) {
2970
3037
  super(message2, options);
2971
3038
  this.name = "UserError";
@@ -3949,7 +4016,7 @@ function resolveInstallerServices(installer) {
3949
4016
  };
3950
4017
  }
3951
4018
  function throwUnsupportedAgent(agent) {
3952
- throw new UserError(`Unsupported agent: ${agent}`);
4019
+ throw new UserError2(`Unsupported agent: ${agent}`);
3953
4020
  }
3954
4021
  function resolveInstallableAgent(agent) {
3955
4022
  const skillSupport = resolveAgentSupport(agent);
@@ -3960,7 +4027,7 @@ function resolveInstallableAgent(agent) {
3960
4027
  }
3961
4028
  function resolveInstallScope(input) {
3962
4029
  if (input.local && input.global) {
3963
- throw new UserError("Use either --local or --global, not both.");
4030
+ throw new UserError2("Use either --local or --global, not both.");
3964
4031
  }
3965
4032
  if (input.local) {
3966
4033
  return "local";
@@ -3986,7 +4053,7 @@ async function loadTerminalPilotTemplate() {
3986
4053
  throw error2;
3987
4054
  }
3988
4055
  }
3989
- throw new UserError("terminal-pilot skill template is missing.");
4056
+ throw new UserError2("terminal-pilot skill template is missing.");
3990
4057
  }
3991
4058
 
3992
4059
  // src/commands/install.ts