palmier 0.9.16 → 0.9.18

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 (53) hide show
  1. package/README.md +1 -1
  2. package/dist/agents/agent.d.ts +38 -14
  3. package/dist/agents/agent.js +102 -38
  4. package/dist/agents/aider.d.ts +2 -9
  5. package/dist/agents/aider.js +8 -20
  6. package/dist/agents/claude.d.ts +2 -9
  7. package/dist/agents/claude.js +11 -20
  8. package/dist/agents/cline.d.ts +2 -9
  9. package/dist/agents/cline.js +9 -20
  10. package/dist/agents/codex.d.ts +2 -9
  11. package/dist/agents/codex.js +11 -20
  12. package/dist/agents/copilot.d.ts +2 -9
  13. package/dist/agents/copilot.js +11 -20
  14. package/dist/agents/cursor.d.ts +2 -9
  15. package/dist/agents/cursor.js +8 -20
  16. package/dist/agents/deepagents.d.ts +2 -9
  17. package/dist/agents/deepagents.js +8 -20
  18. package/dist/agents/droid.d.ts +2 -9
  19. package/dist/agents/droid.js +9 -20
  20. package/dist/agents/gemini.d.ts +2 -9
  21. package/dist/agents/gemini.js +11 -20
  22. package/dist/agents/goose.d.ts +2 -9
  23. package/dist/agents/goose.js +8 -20
  24. package/dist/agents/hermes.d.ts +2 -9
  25. package/dist/agents/hermes.js +8 -20
  26. package/dist/agents/kimi.d.ts +2 -9
  27. package/dist/agents/kimi.js +8 -20
  28. package/dist/agents/kiro.d.ts +2 -9
  29. package/dist/agents/kiro.js +8 -20
  30. package/dist/agents/openclaw.d.ts +2 -9
  31. package/dist/agents/openclaw.js +8 -19
  32. package/dist/agents/opencode.d.ts +2 -9
  33. package/dist/agents/opencode.js +9 -20
  34. package/dist/agents/qoder.d.ts +2 -9
  35. package/dist/agents/qoder.js +9 -20
  36. package/dist/agents/qwen.d.ts +2 -9
  37. package/dist/agents/qwen.js +9 -20
  38. package/dist/commands/init.js +86 -15
  39. package/dist/commands/run.js +3 -2
  40. package/dist/commands/serve.js +1 -1
  41. package/dist/prompts.d.ts +5 -0
  42. package/dist/prompts.js +67 -0
  43. package/dist/pwa/assets/index-DJ-f-zPM.js +120 -0
  44. package/dist/pwa/assets/{web-BUi47bZi.js → web-BM8S3YX9.js} +1 -1
  45. package/dist/pwa/assets/{web-DQOof3g6.js → web-BuyV-_jZ.js} +1 -1
  46. package/dist/pwa/assets/{web-B66LN9cT.js → web-OvMaxdX0.js} +1 -1
  47. package/dist/pwa/index.html +1 -1
  48. package/dist/rpc-handler.js +27 -4
  49. package/dist/types.d.ts +5 -2
  50. package/dist/update-checker.d.ts +2 -0
  51. package/dist/update-checker.js +20 -0
  52. package/package.json +1 -1
  53. package/dist/pwa/assets/index-rt6aPV6d.js +0 -120
@@ -0,0 +1,67 @@
1
+ import * as readline from "readline";
2
+ export async function selectFromList(message, choices, footer = "(↑/↓ to navigate, Enter to select)") {
3
+ if (!process.stdin.isTTY) {
4
+ process.stdout.write(message + "\n");
5
+ choices.forEach((c, i) => {
6
+ const hint = c.hint ? ` ${c.hint}` : "";
7
+ process.stdout.write(` ${i + 1}) ${c.label}${hint}\n`);
8
+ });
9
+ return null;
10
+ }
11
+ const stdout = process.stdout;
12
+ return new Promise((resolve) => {
13
+ let active = 0;
14
+ const messageLines = (message.match(/\n/g)?.length ?? 0) + 1;
15
+ const totalLines = messageLines + choices.length + (footer ? 1 : 0);
16
+ let firstRender = true;
17
+ readline.emitKeypressEvents(process.stdin);
18
+ process.stdin.setRawMode(true);
19
+ process.stdin.resume();
20
+ stdout.write("\x1b[?25l");
21
+ const render = () => {
22
+ if (!firstRender) {
23
+ readline.moveCursor(stdout, 0, -totalLines);
24
+ readline.clearScreenDown(stdout);
25
+ }
26
+ firstRender = false;
27
+ stdout.write(message + "\n");
28
+ choices.forEach((c, i) => {
29
+ const isActive = i === active;
30
+ const marker = isActive ? "\x1b[36m❯\x1b[0m" : " ";
31
+ const label = isActive ? `\x1b[36m${c.label}\x1b[0m` : c.label;
32
+ const hint = c.hint ? ` \x1b[2m${c.hint}\x1b[0m` : "";
33
+ stdout.write(`${marker} ${label}${hint}\n`);
34
+ });
35
+ if (footer)
36
+ stdout.write(`\x1b[2m${footer}\x1b[0m\n`);
37
+ };
38
+ const cleanup = () => {
39
+ stdout.write("\x1b[?25h");
40
+ process.stdin.setRawMode(false);
41
+ process.stdin.removeListener("keypress", onKey);
42
+ process.stdin.pause();
43
+ };
44
+ const onKey = (_str, key) => {
45
+ if (!key)
46
+ return;
47
+ if (key.name === "up" || (key.ctrl && key.name === "p")) {
48
+ active = (active - 1 + choices.length) % choices.length;
49
+ render();
50
+ }
51
+ else if (key.name === "down" || (key.ctrl && key.name === "n")) {
52
+ active = (active + 1) % choices.length;
53
+ render();
54
+ }
55
+ else if (key.name === "return") {
56
+ cleanup();
57
+ resolve(active);
58
+ }
59
+ else if (key.ctrl && key.name === "c") {
60
+ cleanup();
61
+ process.exit(130);
62
+ }
63
+ };
64
+ process.stdin.on("keypress", onKey);
65
+ render();
66
+ });
67
+ }