palmier 0.9.15 → 0.9.17

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 (55) hide show
  1. package/README.md +1 -1
  2. package/dist/agents/agent.d.ts +43 -14
  3. package/dist/agents/agent.js +104 -38
  4. package/dist/agents/aider.d.ts +2 -9
  5. package/dist/agents/aider.js +9 -21
  6. package/dist/agents/claude.d.ts +2 -9
  7. package/dist/agents/claude.js +12 -21
  8. package/dist/agents/cline.d.ts +2 -9
  9. package/dist/agents/cline.js +10 -21
  10. package/dist/agents/codex.d.ts +2 -9
  11. package/dist/agents/codex.js +12 -27
  12. package/dist/agents/copilot.d.ts +2 -9
  13. package/dist/agents/copilot.js +12 -21
  14. package/dist/agents/cursor.d.ts +2 -9
  15. package/dist/agents/cursor.js +9 -21
  16. package/dist/agents/deepagents.d.ts +2 -9
  17. package/dist/agents/deepagents.js +9 -21
  18. package/dist/agents/droid.d.ts +2 -9
  19. package/dist/agents/droid.js +10 -21
  20. package/dist/agents/gemini.d.ts +2 -9
  21. package/dist/agents/gemini.js +12 -21
  22. package/dist/agents/goose.d.ts +2 -9
  23. package/dist/agents/goose.js +9 -21
  24. package/dist/agents/hermes.d.ts +2 -9
  25. package/dist/agents/hermes.js +9 -21
  26. package/dist/agents/kimi.d.ts +2 -9
  27. package/dist/agents/kimi.js +9 -21
  28. package/dist/agents/kiro.d.ts +2 -9
  29. package/dist/agents/kiro.js +9 -21
  30. package/dist/agents/openclaw.d.ts +2 -9
  31. package/dist/agents/openclaw.js +9 -20
  32. package/dist/agents/opencode.d.ts +2 -9
  33. package/dist/agents/opencode.js +10 -21
  34. package/dist/agents/qoder.d.ts +2 -9
  35. package/dist/agents/qoder.js +10 -21
  36. package/dist/agents/qwen.d.ts +2 -9
  37. package/dist/agents/qwen.js +10 -21
  38. package/dist/agents/shared-prompt.d.ts +1 -1
  39. package/dist/agents/shared-prompt.js +4 -2
  40. package/dist/commands/init.js +84 -15
  41. package/dist/commands/run.js +3 -2
  42. package/dist/commands/serve.js +1 -1
  43. package/dist/prompts.d.ts +5 -0
  44. package/dist/prompts.js +67 -0
  45. package/dist/pwa/assets/index-yaoUw47d.js +120 -0
  46. package/dist/pwa/assets/{web-BUi47bZi.js → web-6nrvzqi7.js} +1 -1
  47. package/dist/pwa/assets/{web-B66LN9cT.js → web-Btb09jZq.js} +1 -1
  48. package/dist/pwa/assets/{web-DQOof3g6.js → web-Dv6FIZ03.js} +1 -1
  49. package/dist/pwa/index.html +1 -1
  50. package/dist/rpc-handler.js +27 -4
  51. package/dist/types.d.ts +5 -2
  52. package/dist/update-checker.d.ts +2 -0
  53. package/dist/update-checker.js +20 -0
  54. package/package.json +1 -1
  55. package/dist/pwa/assets/index-rt6aPV6d.js +0 -120
package/README.md CHANGED
@@ -134,7 +134,7 @@ Three ways to reach your host, ordered by setup effort:
134
134
  |------|-------|---------|-------|
135
135
  | **Local** | `http://localhost:7256` in a browser on the host machine | Not required | Loopback only. No internet needed. |
136
136
  | **Remote (web)** | [https://app.palmier.me](https://app.palmier.me) in any browser | Required | Always goes through the cloud relay. |
137
- | **Remote (app)** | [Android APK](https://github.com/caihongxu/palmier-android/releases/latest) | Required | Push notifications, device capabilities, and **auto-LAN**. |
137
+ | **Remote (app)** | [Android APK](https://github.com/caihongxu/palmier-android/releases/latest/download/palmier.apk) | Required | Push notifications, device capabilities, and **auto-LAN**. |
138
138
 
139
139
  **Auto-LAN (native app only).** When the Android app is on the same network as the host, it transparently routes RPC over direct LAN HTTP (`http://<host-ip>:7256/rpc/...`) instead of through the relay — lower latency, no protocol change. Browser PWAs can't do this (Private Network Access / mixed-content restrictions) and stay on the relay.
140
140
 
@@ -1,6 +1,5 @@
1
1
  import type { ParsedTask, RequiredPermission } from "../types.js";
2
2
  export interface CommandLine {
3
- command: string;
4
3
  args: string[];
5
4
  /** If provided, the string is written to the process's stdin and then the pipe is closed. */
6
5
  stdin?: string;
@@ -13,27 +12,57 @@ export interface CommandLine {
13
12
  }>;
14
13
  }
15
14
  export interface AgentTool {
16
- /** Return the command and args for a short, non-interactive prompt (e.g. generating a task name). */
17
- getPromptCommandLine(prompt: string): CommandLine;
15
+ /** The agent's CLI binary name (e.g. "claude", "kiro-cli"). */
16
+ command: string;
17
+ /** Static args for a short, non-interactive prompt. The prompt is appended to the end of this list. */
18
+ promptCommandLineArgs: string[];
19
+ /** Single arg passed to `command` to probe whether the CLI is installed. Usually `"--version"`. */
20
+ versionCommandLineArg: string;
21
+ /** Whether this agent supports permission overrides (e.g. --allowedTools).
22
+ * When falsy, the permissions section is omitted from agent instructions. */
23
+ supportsPermissions?: boolean;
24
+ /** Whether this agent supports yolo mode (auto-approve all tools). */
25
+ supportsYolo?: boolean;
26
+ /** When true, the run loop will not listen to or persist the agent's stderr output. */
27
+ suppressStdErr?: boolean;
28
+ /** npm package that provides this agent's CLI, if installable via `npm install -g`.
29
+ * Used by `palmier init` to offer one-click installation when no agents are detected. */
30
+ npmPackage?: string;
31
+ /** Optional human-readable note about free-usage availability (e.g. "Free Tier").
32
+ * Surfaced next to the agent in the installer. */
33
+ freeUsage?: string;
18
34
  /** Return the command and args used to run a task. If followupPrompt is provided, use it instead of the task's prompt,
19
35
  * and treat it as a continuation of the original run (reuse the same session, etc).
20
36
  * extraPermissions: pass an array of RequiredPermission for transient permissions granted for this run only,
21
37
  * or pass `"yolo"` to enable yolo mode (auto-approve all tools, skip permission instructions). */
22
38
  getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine;
23
- /** Whether this agent supports permission overrides (e.g. --allowedTools).
24
- * If false, the permissions section is omitted from agent instructions. */
25
- supportsPermissions: boolean;
26
- /** Whether this agent supports yolo mode (auto-approve all tools). */
27
- supportsYolo: boolean;
28
- /** Detect whether the agent CLI is available and perform any agent-specific
29
- * initialization. Returns true if the agent was detected and initialized successfully. */
30
- init(): Promise<boolean>;
31
39
  }
40
+ export declare function getPromptCommandLine(agent: AgentTool, prompt: string): CommandLine;
41
+ export declare function probeAgent(agent: AgentTool): Promise<boolean>;
42
+ /** Look up the installed version of an npm-managed agent via `npm ls -g --json`.
43
+ * Returns the version string, or null if the package isn't reported as installed
44
+ * globally. Does not gate on exit code — `npm ls` exits non-zero on extraneous
45
+ * deps in the global tree but still prints valid JSON to stdout. */
46
+ export declare function getNpmInstalledVersion(npmPackage: string): string | null;
32
47
  export interface DetectedAgent {
33
48
  key: string;
34
49
  label: string;
35
- supportsPermissions: boolean;
36
- supportsYolo: boolean;
50
+ supportsPermissions?: boolean;
51
+ supportsYolo?: boolean;
52
+ /** npm package name, present iff the agent is installable via npm. */
53
+ npmPackage?: string;
54
+ /** Currently-installed version (resolved via `npm ls -g`) for npm-installed agents. */
55
+ version?: string;
56
+ /** True when this agent was installed by Palmier (the init wizard). Persists across detections. */
57
+ palmierManaged?: boolean;
58
+ }
59
+ export interface InstallableAgent {
60
+ key: string;
61
+ label: string;
62
+ npmPackage: string;
63
+ command: string;
64
+ freeUsage?: string;
37
65
  }
38
- export declare function detectAgents(): Promise<DetectedAgent[]>;
66
+ export declare function listInstallableAgents(): InstallableAgent[];
67
+ export declare function detectAgents(previous?: DetectedAgent[]): Promise<DetectedAgent[]>;
39
68
  export declare function getAgent(name: string): AgentTool;
@@ -1,38 +1,77 @@
1
- import { ClaudeAgent } from "./claude.js";
2
- import { GeminiAgent } from "./gemini.js";
3
- import { CodexAgent } from "./codex.js";
4
- import { DroidAgent } from "./droid.js";
5
- import { OpenClawAgent } from "./openclaw.js";
6
- import { CopilotAgent } from "./copilot.js";
7
- import { QwenAgent } from "./qwen.js";
8
- import { KimiAgent } from "./kimi.js";
9
- import { GooseAgent } from "./goose.js";
10
- import { OpenCodeAgent } from "./opencode.js";
11
- import { DeepAgents } from "./deepagents.js";
12
- import { Aider } from "./aider.js";
13
- import { Cursor } from "./cursor.js";
14
- import { Kiro } from "./kiro.js";
15
- import { Cline } from "./cline.js";
16
- import { Qoder } from "./qoder.js";
17
- import { Hermes } from "./hermes.js";
1
+ import { execSync } from "child_process";
2
+ import { SHELL } from "../platform/index.js";
3
+ import { claudeAgent } from "./claude.js";
4
+ import { geminiAgent } from "./gemini.js";
5
+ import { codexAgent } from "./codex.js";
6
+ import { droidAgent } from "./droid.js";
7
+ import { openClawAgent } from "./openclaw.js";
8
+ import { copilotAgent } from "./copilot.js";
9
+ import { qwenAgent } from "./qwen.js";
10
+ import { kimiAgent } from "./kimi.js";
11
+ import { gooseAgent } from "./goose.js";
12
+ import { openCodeAgent } from "./opencode.js";
13
+ import { deepAgentsAgent } from "./deepagents.js";
14
+ import { aiderAgent } from "./aider.js";
15
+ import { cursorAgent } from "./cursor.js";
16
+ import { kiroAgent } from "./kiro.js";
17
+ import { clineAgent } from "./cline.js";
18
+ import { qoderAgent } from "./qoder.js";
19
+ import { hermesAgent } from "./hermes.js";
20
+ export function getPromptCommandLine(agent, prompt) {
21
+ return { args: [...agent.promptCommandLineArgs, prompt] };
22
+ }
23
+ export async function probeAgent(agent) {
24
+ const probe = `${agent.command} ${agent.versionCommandLineArg}`;
25
+ try {
26
+ execSync(probe, { stdio: "ignore", shell: SHELL });
27
+ }
28
+ catch {
29
+ return false;
30
+ }
31
+ return true;
32
+ }
33
+ /** Look up the installed version of an npm-managed agent via `npm ls -g --json`.
34
+ * Returns the version string, or null if the package isn't reported as installed
35
+ * globally. Does not gate on exit code — `npm ls` exits non-zero on extraneous
36
+ * deps in the global tree but still prints valid JSON to stdout. */
37
+ export function getNpmInstalledVersion(npmPackage) {
38
+ const cmd = `npm ls -g ${npmPackage} --depth=0 --json`;
39
+ let stdout;
40
+ try {
41
+ stdout = execSync(cmd, { stdio: ["ignore", "pipe", "ignore"], shell: SHELL, encoding: "utf-8" });
42
+ }
43
+ catch (err) {
44
+ const e = err;
45
+ if (!e.stdout)
46
+ return null;
47
+ stdout = e.stdout.toString();
48
+ }
49
+ try {
50
+ const parsed = JSON.parse(stdout);
51
+ return parsed.dependencies?.[npmPackage]?.version ?? null;
52
+ }
53
+ catch {
54
+ return null;
55
+ }
56
+ }
18
57
  const agentRegistry = {
19
- claude: new ClaudeAgent(),
20
- gemini: new GeminiAgent(),
21
- codex: new CodexAgent(),
22
- openclaw: new OpenClawAgent(),
23
- copilot: new CopilotAgent(),
24
- qwen: new QwenAgent(),
25
- kimi: new KimiAgent(),
26
- droid: new DroidAgent(),
27
- goose: new GooseAgent(),
28
- opencode: new OpenCodeAgent(),
29
- deepagents: new DeepAgents(),
30
- aider: new Aider(),
31
- cursor: new Cursor(),
32
- kiro: new Kiro(),
33
- cline: new Cline(),
34
- qoder: new Qoder(),
35
- hermes: new Hermes(),
58
+ claude: claudeAgent,
59
+ gemini: geminiAgent,
60
+ codex: codexAgent,
61
+ openclaw: openClawAgent,
62
+ copilot: copilotAgent,
63
+ qwen: qwenAgent,
64
+ kimi: kimiAgent,
65
+ droid: droidAgent,
66
+ goose: gooseAgent,
67
+ opencode: openCodeAgent,
68
+ deepagents: deepAgentsAgent,
69
+ aider: aiderAgent,
70
+ cursor: cursorAgent,
71
+ kiro: kiroAgent,
72
+ cline: clineAgent,
73
+ qoder: qoderAgent,
74
+ hermes: hermesAgent,
36
75
  };
37
76
  const agentLabels = {
38
77
  claude: "Claude Code",
@@ -53,13 +92,40 @@ const agentLabels = {
53
92
  qoder: "Qoder CLI",
54
93
  hermes: "Hermes Agent",
55
94
  };
56
- export async function detectAgents() {
95
+ export function listInstallableAgents() {
96
+ const out = [];
97
+ for (const [key, agent] of Object.entries(agentRegistry)) {
98
+ if (!agent.npmPackage)
99
+ continue;
100
+ out.push({
101
+ key,
102
+ label: agentLabels[key] ?? key,
103
+ npmPackage: agent.npmPackage,
104
+ command: agent.command,
105
+ ...(agent.freeUsage ? { freeUsage: agent.freeUsage } : {}),
106
+ });
107
+ }
108
+ return out;
109
+ }
110
+ export async function detectAgents(previous) {
111
+ const previousByKey = new Map((previous ?? []).map((a) => [a.key, a]));
57
112
  const detected = [];
58
113
  for (const [key, agent] of Object.entries(agentRegistry)) {
59
114
  const label = agentLabels[key] ?? key;
60
- const ok = await agent.init();
61
- if (ok)
62
- detected.push({ key, label, supportsPermissions: agent.supportsPermissions, supportsYolo: agent.supportsYolo });
115
+ const ok = await probeAgent(agent);
116
+ if (!ok)
117
+ continue;
118
+ const version = agent.npmPackage ? getNpmInstalledVersion(agent.npmPackage) ?? undefined : undefined;
119
+ const prevManaged = previousByKey.get(key)?.palmierManaged;
120
+ detected.push({
121
+ key,
122
+ label,
123
+ supportsPermissions: agent.supportsPermissions,
124
+ supportsYolo: agent.supportsYolo,
125
+ ...(agent.npmPackage ? { npmPackage: agent.npmPackage } : {}),
126
+ ...(version ? { version } : {}),
127
+ ...(prevManaged ? { palmierManaged: true } : {}),
128
+ });
63
129
  }
64
130
  return detected;
65
131
  }
@@ -1,9 +1,2 @@
1
- import type { ParsedTask, RequiredPermission } from "../types.js";
2
- import type { AgentTool, CommandLine } from "./agent.js";
3
- export declare class Aider implements AgentTool {
4
- supportsPermissions: boolean;
5
- supportsYolo: boolean;
6
- getPromptCommandLine(prompt: string): CommandLine;
7
- getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine;
8
- init(): Promise<boolean>;
9
- }
1
+ import type { AgentTool } from "./agent.js";
2
+ export declare const aiderAgent: AgentTool;
@@ -1,29 +1,17 @@
1
- import { execSync } from "child_process";
2
1
  import { getAgentInstructions } from "./shared-prompt.js";
3
- import { SHELL } from "../platform/index.js";
4
- export class Aider {
5
- supportsPermissions = false;
6
- supportsYolo = true;
7
- getPromptCommandLine(prompt) {
8
- return { command: "aider", args: ["--message", prompt] };
9
- }
2
+ export const aiderAgent = {
3
+ command: "aider",
4
+ promptCommandLineArgs: ["--message"],
5
+ versionCommandLineArg: "--version",
6
+ supportsYolo: true,
10
7
  getTaskRunCommandLine(task, followupPrompt, extraPermissions) {
11
8
  const yolo = extraPermissions === "yolo";
12
- const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
9
+ const prompt = followupPrompt ?? getAgentInstructions(task);
13
10
  const args = [];
14
11
  if (yolo) {
15
12
  args.push("--yes-always");
16
13
  }
17
14
  args.push("--message", prompt);
18
- return { command: "aider", args };
19
- }
20
- async init() {
21
- try {
22
- execSync("aider --version", { stdio: "ignore", shell: SHELL });
23
- }
24
- catch {
25
- return false;
26
- }
27
- return true;
28
- }
29
- }
15
+ return { args };
16
+ },
17
+ };
@@ -1,9 +1,2 @@
1
- import type { ParsedTask, RequiredPermission } from "../types.js";
2
- import type { AgentTool, CommandLine } from "./agent.js";
3
- export declare class ClaudeAgent implements AgentTool {
4
- supportsPermissions: boolean;
5
- supportsYolo: boolean;
6
- getPromptCommandLine(prompt: string): CommandLine;
7
- getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine;
8
- init(): Promise<boolean>;
9
- }
1
+ import type { AgentTool } from "./agent.js";
2
+ export declare const claudeAgent: AgentTool;
@@ -1,15 +1,15 @@
1
- import { execSync } from "child_process";
2
1
  import { getAgentInstructions } from "./shared-prompt.js";
3
- import { SHELL } from "../platform/index.js";
4
- export class ClaudeAgent {
5
- supportsPermissions = true;
6
- supportsYolo = true;
7
- getPromptCommandLine(prompt) {
8
- return { command: "claude", args: ["-p", prompt] };
9
- }
2
+ export const claudeAgent = {
3
+ command: "claude",
4
+ promptCommandLineArgs: ["-p"],
5
+ versionCommandLineArg: "--version",
6
+ supportsPermissions: true,
7
+ supportsYolo: true,
8
+ npmPackage: "@anthropic-ai/claude-code",
9
+ freeUsage: "Free with Claude Pro",
10
10
  getTaskRunCommandLine(task, followupPrompt, extraPermissions) {
11
11
  const yolo = extraPermissions === "yolo";
12
- const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
12
+ const prompt = followupPrompt ?? getAgentInstructions(task);
13
13
  const args = ["--permission-mode", yolo ? "bypassPermissions" : "acceptEdits", "-p"];
14
14
  if (!yolo) {
15
15
  args.push("--allowedTools", "Bash(curl)", "WebFetch");
@@ -21,15 +21,6 @@ export class ClaudeAgent {
21
21
  if (followupPrompt) {
22
22
  args.push("-c");
23
23
  }
24
- return { command: "claude", args, stdin: prompt };
25
- }
26
- async init() {
27
- try {
28
- execSync("claude --version", { stdio: "ignore", shell: SHELL });
29
- }
30
- catch {
31
- return false;
32
- }
33
- return true;
34
- }
35
- }
24
+ return { args, stdin: prompt };
25
+ },
26
+ };
@@ -1,9 +1,2 @@
1
- import type { ParsedTask, RequiredPermission } from "../types.js";
2
- import type { AgentTool, CommandLine } from "./agent.js";
3
- export declare class Cline implements AgentTool {
4
- supportsPermissions: boolean;
5
- supportsYolo: boolean;
6
- getPromptCommandLine(prompt: string): CommandLine;
7
- getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine;
8
- init(): Promise<boolean>;
9
- }
1
+ import type { AgentTool } from "./agent.js";
2
+ export declare const clineAgent: AgentTool;
@@ -1,29 +1,18 @@
1
- import { execSync } from "child_process";
2
1
  import { getAgentInstructions } from "./shared-prompt.js";
3
- import { SHELL } from "../platform/index.js";
4
- export class Cline {
5
- supportsPermissions = false;
6
- supportsYolo = true;
7
- getPromptCommandLine(prompt) {
8
- return { command: "cline ", args: ["--yolo", "-p", prompt] };
9
- }
2
+ export const clineAgent = {
3
+ command: "cline",
4
+ promptCommandLineArgs: ["--yolo", "-p"],
5
+ versionCommandLineArg: "--version",
6
+ supportsYolo: true,
7
+ npmPackage: "cline",
10
8
  getTaskRunCommandLine(task, followupPrompt, extraPermissions) {
11
9
  const yolo = extraPermissions === "yolo";
12
- const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
10
+ const prompt = followupPrompt ?? getAgentInstructions(task);
13
11
  const args = [];
14
12
  if (yolo) {
15
13
  args.push("--yolo");
16
14
  }
17
15
  args.push(prompt);
18
- return { command: "cline ", args };
19
- }
20
- async init() {
21
- try {
22
- execSync("cline --version", { stdio: "ignore", shell: SHELL });
23
- }
24
- catch {
25
- return false;
26
- }
27
- return true;
28
- }
29
- }
16
+ return { args };
17
+ },
18
+ };
@@ -1,9 +1,2 @@
1
- import type { ParsedTask, RequiredPermission } from "../types.js";
2
- import type { AgentTool, CommandLine } from "./agent.js";
3
- export declare class CodexAgent implements AgentTool {
4
- supportsPermissions: boolean;
5
- supportsYolo: boolean;
6
- getPromptCommandLine(prompt: string): CommandLine;
7
- getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine;
8
- init(): Promise<boolean>;
9
- }
1
+ import type { AgentTool } from "./agent.js";
2
+ export declare const codexAgent: AgentTool;
@@ -1,35 +1,20 @@
1
- import { execSync } from "child_process";
2
1
  import { getAgentInstructions } from "./shared-prompt.js";
3
- import { SHELL } from "../platform/index.js";
4
- export class CodexAgent {
5
- supportsPermissions = true;
6
- supportsYolo = true;
7
- getPromptCommandLine(prompt) {
8
- return { command: "codex", args: ["exec", "--skip-git-repo-check", prompt] };
9
- }
2
+ export const codexAgent = {
3
+ command: "codex",
4
+ promptCommandLineArgs: ["exec", "--skip-git-repo-check"],
5
+ versionCommandLineArg: "--version",
6
+ supportsYolo: true,
7
+ suppressStdErr: true,
8
+ npmPackage: "@openai/codex",
9
+ freeUsage: "Free Tier",
10
10
  getTaskRunCommandLine(task, followupPrompt, extraPermissions) {
11
11
  const yolo = extraPermissions === "yolo";
12
- const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
12
+ const prompt = followupPrompt ?? getAgentInstructions(task);
13
13
  const args = ["exec", "--skip-git-repo-check", "--sandbox", yolo ? "danger-full-access" : "workspace-write"];
14
- if (!yolo) {
15
- const allPerms = [...(task.frontmatter.permissions ?? []), ...(extraPermissions ?? [])];
16
- for (const p of allPerms) {
17
- args.push("--config", `apps.${p.name}.default_tools_approval_mode="approve"`);
18
- }
19
- }
20
14
  if (followupPrompt) {
21
15
  args.push("resume", "--last");
22
16
  }
23
17
  args.push("-");
24
- return { command: "codex", args, stdin: prompt };
25
- }
26
- async init() {
27
- try {
28
- execSync("codex --version", { stdio: "ignore", shell: SHELL });
29
- }
30
- catch {
31
- return false;
32
- }
33
- return true;
34
- }
35
- }
18
+ return { args, stdin: prompt, env: { RUST_LOG: "warn" } };
19
+ },
20
+ };
@@ -1,9 +1,2 @@
1
- import type { ParsedTask, RequiredPermission } from "../types.js";
2
- import type { AgentTool, CommandLine } from "./agent.js";
3
- export declare class CopilotAgent implements AgentTool {
4
- supportsPermissions: boolean;
5
- supportsYolo: boolean;
6
- getPromptCommandLine(prompt: string): CommandLine;
7
- getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine;
8
- init(): Promise<boolean>;
9
- }
1
+ import type { AgentTool } from "./agent.js";
2
+ export declare const copilotAgent: AgentTool;
@@ -1,15 +1,15 @@
1
- import { execSync } from "child_process";
2
1
  import { getAgentInstructions } from "./shared-prompt.js";
3
- import { SHELL } from "../platform/index.js";
4
- export class CopilotAgent {
5
- supportsPermissions = false;
6
- supportsYolo = true;
7
- getPromptCommandLine(prompt) {
8
- return { command: "copilot", args: ["-p", prompt] };
9
- }
2
+ export const copilotAgent = {
3
+ command: "copilot",
4
+ promptCommandLineArgs: ["-p"],
5
+ versionCommandLineArg: "-v",
6
+ supportsYolo: true,
7
+ suppressStdErr: true,
8
+ npmPackage: "@github/copilot",
9
+ freeUsage: "Free Tier",
10
10
  getTaskRunCommandLine(task, followupPrompt, extraPermissions) {
11
11
  const yolo = extraPermissions === "yolo";
12
- const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
12
+ const prompt = followupPrompt ?? getAgentInstructions(task);
13
13
  const args = ["-p", prompt];
14
14
  if (yolo) {
15
15
  args.push("--yolo");
@@ -21,15 +21,6 @@ export class CopilotAgent {
21
21
  if (followupPrompt) {
22
22
  args.push("--continue");
23
23
  }
24
- return { command: "copilot", args };
25
- }
26
- async init() {
27
- try {
28
- execSync("copilot -v", { stdio: "ignore", shell: SHELL });
29
- }
30
- catch {
31
- return false;
32
- }
33
- return true;
34
- }
35
- }
24
+ return { args };
25
+ },
26
+ };
@@ -1,9 +1,2 @@
1
- import type { ParsedTask, RequiredPermission } from "../types.js";
2
- import type { AgentTool, CommandLine } from "./agent.js";
3
- export declare class Cursor implements AgentTool {
4
- supportsPermissions: boolean;
5
- supportsYolo: boolean;
6
- getPromptCommandLine(prompt: string): CommandLine;
7
- getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine;
8
- init(): Promise<boolean>;
9
- }
1
+ import type { AgentTool } from "./agent.js";
2
+ export declare const cursorAgent: AgentTool;
@@ -1,15 +1,12 @@
1
- import { execSync } from "child_process";
2
1
  import { getAgentInstructions } from "./shared-prompt.js";
3
- import { SHELL } from "../platform/index.js";
4
- export class Cursor {
5
- supportsPermissions = false;
6
- supportsYolo = true;
7
- getPromptCommandLine(prompt) {
8
- return { command: "cursor", args: ["-p", prompt] };
9
- }
2
+ export const cursorAgent = {
3
+ command: "cursor",
4
+ promptCommandLineArgs: ["-p"],
5
+ versionCommandLineArg: "--version",
6
+ supportsYolo: true,
10
7
  getTaskRunCommandLine(task, followupPrompt, extraPermissions) {
11
8
  const yolo = extraPermissions === "yolo";
12
- const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
9
+ const prompt = followupPrompt ?? getAgentInstructions(task);
13
10
  const args = [];
14
11
  if (yolo) {
15
12
  args.push("--force");
@@ -18,15 +15,6 @@ export class Cursor {
18
15
  args.push("--continue");
19
16
  }
20
17
  args.push("-p", prompt);
21
- return { command: "cursor", args };
22
- }
23
- async init() {
24
- try {
25
- execSync("cursor --version", { stdio: "ignore", shell: SHELL });
26
- }
27
- catch {
28
- return false;
29
- }
30
- return true;
31
- }
32
- }
18
+ return { args };
19
+ },
20
+ };
@@ -1,9 +1,2 @@
1
- import type { ParsedTask, RequiredPermission } from "../types.js";
2
- import type { AgentTool, CommandLine } from "./agent.js";
3
- export declare class DeepAgents implements AgentTool {
4
- supportsPermissions: boolean;
5
- supportsYolo: boolean;
6
- getPromptCommandLine(prompt: string): CommandLine;
7
- getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine;
8
- init(): Promise<boolean>;
9
- }
1
+ import type { AgentTool } from "./agent.js";
2
+ export declare const deepAgentsAgent: AgentTool;
@@ -1,15 +1,12 @@
1
- import { execSync } from "child_process";
2
1
  import { getAgentInstructions } from "./shared-prompt.js";
3
- import { SHELL } from "../platform/index.js";
4
- export class DeepAgents {
5
- supportsPermissions = false;
6
- supportsYolo = true;
7
- getPromptCommandLine(prompt) {
8
- return { command: "deepagents", args: ["--non-interactive", prompt] };
9
- }
2
+ export const deepAgentsAgent = {
3
+ command: "deepagents",
4
+ promptCommandLineArgs: ["--non-interactive"],
5
+ versionCommandLineArg: "--version",
6
+ supportsYolo: true,
10
7
  getTaskRunCommandLine(task, followupPrompt, extraPermissions) {
11
8
  const yolo = extraPermissions === "yolo";
12
- const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
9
+ const prompt = followupPrompt ?? getAgentInstructions(task);
13
10
  const args = [];
14
11
  if (yolo) {
15
12
  args.push("--auto-approve");
@@ -18,15 +15,6 @@ export class DeepAgents {
18
15
  args.push("--resume");
19
16
  }
20
17
  args.push("--non-interactive", prompt);
21
- return { command: "deepagents", args };
22
- }
23
- async init() {
24
- try {
25
- execSync("deepagents --version", { stdio: "ignore", shell: SHELL });
26
- }
27
- catch {
28
- return false;
29
- }
30
- return true;
31
- }
32
- }
18
+ return { args };
19
+ },
20
+ };
@@ -1,9 +1,2 @@
1
- import type { ParsedTask, RequiredPermission } from "../types.js";
2
- import type { AgentTool, CommandLine } from "./agent.js";
3
- export declare class DroidAgent implements AgentTool {
4
- supportsPermissions: boolean;
5
- supportsYolo: boolean;
6
- getPromptCommandLine(prompt: string): CommandLine;
7
- getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine;
8
- init(): Promise<boolean>;
9
- }
1
+ import type { AgentTool } from "./agent.js";
2
+ export declare const droidAgent: AgentTool;