agent-whisker 0.1.0 → 0.2.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.
Files changed (83) hide show
  1. package/README.md +12 -3
  2. package/README.zh-CN.md +12 -3
  3. package/package.json +3 -2
  4. package/packages/antigravity-plugin/package.json +1 -1
  5. package/packages/antigravity-plugin/plugin.json +1 -1
  6. package/packages/claude-plugin/.claude-plugin/plugin.json +1 -1
  7. package/packages/claude-plugin/.codex-plugin/plugin.json +1 -1
  8. package/packages/claude-plugin/README.md +11 -1
  9. package/packages/claude-plugin/README.zh-CN.md +4 -1
  10. package/packages/claude-plugin/bin/taskstate +145 -4
  11. package/packages/claude-plugin/hooks/codex.json +8 -8
  12. package/packages/claude-plugin/package.json +1 -1
  13. package/packages/cli/README.md +76 -3
  14. package/packages/cli/README.zh-CN.md +76 -3
  15. package/packages/cli/package.json +1 -1
  16. package/packages/cli/src/command.js +20 -3
  17. package/packages/cli/src/commands/catalog.js +26 -7
  18. package/packages/cli/src/commands/doctor.js +31 -27
  19. package/packages/cli/src/commands/exclude.js +156 -0
  20. package/packages/cli/src/commands/extract.js +4 -2
  21. package/packages/cli/src/commands/index-command.js +1 -1
  22. package/packages/cli/src/commands/index.js +4 -0
  23. package/packages/cli/src/commands/install.js +12 -1
  24. package/packages/cli/src/commands/nudge.js +39 -37
  25. package/packages/cli/src/commands/read.js +2 -1
  26. package/packages/cli/src/commands/search.js +33 -3
  27. package/packages/cli/src/commands/sessions.js +20 -12
  28. package/packages/cli/src/commands/status.js +6 -3
  29. package/packages/cli/src/commands/tui.js +62 -0
  30. package/packages/cli/src/commands/version.js +4 -4
  31. package/packages/cli/src/exclusion.js +88 -0
  32. package/packages/cli/src/install/codex-plugin.js +6 -5
  33. package/packages/cli/src/install/external.js +48 -37
  34. package/packages/cli/src/install/handlers.js +4 -3
  35. package/packages/cli/src/install/mcp.js +3 -3
  36. package/packages/cli/src/install/steps.js +43 -15
  37. package/packages/cli/src/install/wrapper.js +28 -5
  38. package/packages/cli/src/main.js +9 -12
  39. package/packages/cli/src/node-version.js +25 -0
  40. package/packages/cli/src/run.js +25 -5
  41. package/packages/cli/src/tui/app.js +1430 -0
  42. package/packages/cli/src/tui/data/call.js +83 -0
  43. package/packages/cli/src/tui/data/poll.js +24 -0
  44. package/packages/cli/src/tui/glyphs.js +93 -0
  45. package/packages/cli/src/tui/i18n.js +342 -0
  46. package/packages/cli/src/tui/model.js +251 -0
  47. package/packages/cli/src/tui/pages/common.js +71 -0
  48. package/packages/cli/src/tui/pages/library.js +154 -0
  49. package/packages/cli/src/tui/pages/sessions.js +96 -0
  50. package/packages/cli/src/tui/pages/system.js +124 -0
  51. package/packages/cli/src/tui/pages/tasks.js +297 -0
  52. package/packages/cli/src/tui/run.js +216 -0
  53. package/packages/cli/src/tui/term/keys.js +152 -0
  54. package/packages/cli/src/tui/term/screen.js +88 -0
  55. package/packages/cli/src/tui/term/term.js +157 -0
  56. package/packages/cli/src/tui/term/width.js +290 -0
  57. package/packages/cli/src/tui/ui/widgets.js +247 -0
  58. package/packages/core/README.md +1 -1
  59. package/packages/core/README.zh-CN.md +2 -2
  60. package/packages/core/package.json +1 -1
  61. package/packages/core/src/catalog.js +13 -1
  62. package/packages/core/src/clairic.js +1 -1
  63. package/packages/core/src/convert.js +1 -1
  64. package/packages/core/src/db.js +6 -1
  65. package/packages/core/src/host.js +104 -0
  66. package/packages/core/src/index.js +2 -2
  67. package/packages/core/src/library-read.js +12 -8
  68. package/packages/core/src/nudge.js +34 -1
  69. package/packages/core/src/schema.js +17 -0
  70. package/packages/core/src/sessions-read.js +23 -11
  71. package/packages/dsh-plugin/package.json +1 -1
  72. package/packages/herdr-plugin/herdr-plugin.toml +1 -1
  73. package/packages/herdr-plugin/package.json +1 -1
  74. package/packages/mcp/README.md +5 -5
  75. package/packages/mcp/README.zh-CN.md +5 -5
  76. package/packages/mcp/package.json +1 -1
  77. package/packages/pi-extension/README.md +1 -1
  78. package/packages/pi-extension/README.zh-CN.md +1 -1
  79. package/packages/pi-extension/package.json +1 -1
  80. package/packages/pi-extension/src/extension.ts +3 -3
  81. package/packages/service/package.json +1 -1
  82. package/packages/service/src/index.js +1 -1
  83. package/packages/service/src/runtime.js +4 -0
@@ -5,6 +5,8 @@ import { parseArgs } from "node:util";
5
5
  import { initCreatesStore, resolveHome, StoreError } from "../../core/src/index.js";
6
6
  import { displayField, EXIT, errorLine, exitCodeOf, UsageError } from "./command.js";
7
7
  import { commands } from "./commands/index.js";
8
+ import { nudgeCommand } from "./commands/nudge.js";
9
+ import { versionCommand } from "./commands/version.js";
8
10
  import { APP_MOD_DIR } from "./install/external.js";
9
11
  import { keyStoreFor, rerankKeyReader } from "./keystore.js";
10
12
  import { agentsInForce } from "./launcher.js";
@@ -31,7 +33,7 @@ const GENERAL_USAGE = "agent-whisker <command> [<args>] [--json] [--cwd <dir>]";
31
33
  const GLOBAL_OPTIONS = {
32
34
  json: { type: "boolean" },
33
35
  cwd: { type: "string" },
34
- help: { type: "boolean" },
36
+ help: { type: "boolean", short: "h" },
35
37
  } ;
36
38
 
37
39
  /**
@@ -77,6 +79,10 @@ export async function runCli(argv , host , options
77
79
  host.out(commandHelp(command));
78
80
  return EXIT.ok;
79
81
  }
82
+ if (name === "version" || name === "nudge") {
83
+ const standalone = name === "version" ? versionCommand : nudgeCommand;
84
+ return standalone.run({ args: split.args, host, json: split.json });
85
+ }
80
86
  const keyStore = Object.hasOwn(options, "keyStore") ? (options.keyStore ?? null) : keyStoreFor(host);
81
87
  const agents = agentsInForce(host);
82
88
  home = resolveHome(host.env, host.homeDir);
@@ -95,7 +101,7 @@ export async function runCli(argv , host , options
95
101
  };
96
102
  return await command.run(ctx);
97
103
  } catch (error) {
98
- host.err(errorLine(error));
104
+ host.err(errorLine(error, undefined, command?.name));
99
105
  if (error instanceof UsageError) host.err(usageBlock(command));
100
106
  else if (initRemedies(error, home)) host.err("run: agent-whisker init\n");
101
107
  return exitCodeOf(error);
@@ -153,6 +159,11 @@ function splitArguments(argv ) {
153
159
  nameIndex ??= token.index;
154
160
  continue;
155
161
  }
162
+ if (nameIndex === undefined && token.kind === "option" && ["--version", "-V"].includes(token.rawName)) {
163
+ if (token.value !== undefined) throw new UsageError(`${token.rawName} takes no value`);
164
+ nameIndex = token.index;
165
+ continue;
166
+ }
156
167
  if (token.kind !== "option" || !Object.hasOwn(GLOBAL_OPTIONS, token.name)) continue;
157
168
  if (token.name === "cwd") {
158
169
  const value = token.value;
@@ -180,7 +191,13 @@ function splitArguments(argv ) {
180
191
  if (nameIndex === undefined) return { name: undefined, args: [], json, cwd, help };
181
192
  const first = nameIndex + 1;
182
193
  const args = argv.slice(first).filter((_, offset) => !consumed.has(first + offset));
183
- return { name: argv[nameIndex], args, json, cwd, help };
194
+ return {
195
+ name: argv[nameIndex] === "--version" || argv[nameIndex] === "-V" ? "version" : argv[nameIndex],
196
+ args,
197
+ json,
198
+ cwd,
199
+ help,
200
+ };
184
201
  }
185
202
 
186
203
  /** The overall help, listing each command's summary in table order (by name). */
@@ -189,13 +206,14 @@ function generalHelp() {
189
206
  const lines = [
190
207
  `usage: ${GENERAL_USAGE}`,
191
208
  "",
209
+ "-V, --version: print the version of agent-whisker and Node",
192
210
  "commands:",
193
211
  ...commands.map((command) => ` ${command.name.padEnd(width)} ${command.summary}`),
194
212
  "",
195
213
  "options for every command:",
196
214
  " --json print the result as one line of JSON",
197
215
  " --cwd <dir> use <dir> as the working directory",
198
- " --help print the usage of the command",
216
+ " -h, --help print the usage of the command",
199
217
  "",
200
218
  "The data directory is $AGENT_WHISKER_HOME, or ~/.agent-whisker when it is not set.",
201
219
  "Run agent-whisker help <command> for the usage of one command.",
@@ -212,13 +230,15 @@ function helpFor(args ) {
212
230
  if (args.length === 0) return generalHelp();
213
231
  const [name] = args;
214
232
  const command = args.length === 1 ? commands.find((candidate) => candidate.name === name) : undefined;
233
+ if (command === undefined && args.length === 1 && name && !name.startsWith("-"))
234
+ throw new UsageError(`unknown command '${displayField(name)}'`);
215
235
  if (command === undefined) throw new UsageError(`help takes one command name, got '${displayField(args.join(" "))}'`);
216
236
  return commandHelp(command);
217
237
  }
218
238
 
219
239
  /** A command's description and usage, printed by `agent-whisker <name> --help` and `agent-whisker help <name>`. */
220
240
  function commandHelp(command ) {
221
- return `${command.summary}\n\n${usageBlock(command)}options for every command: --json, --cwd <dir>, --help\n`;
241
+ return `${command.summary}\n\n${usageBlock(command)}${command.help ? `${command.help}\n` : ""}options for every command: --json, --cwd <dir>, --help\n`;
222
242
  }
223
243
 
224
244
  /**