palmier 0.6.7 → 0.6.9

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 (94) hide show
  1. package/README.md +14 -0
  2. package/dist/agents/agent-instructions.md +7 -37
  3. package/dist/agents/agent.d.ts +2 -2
  4. package/dist/agents/aider.d.ts +1 -1
  5. package/dist/agents/aider.js +3 -6
  6. package/dist/agents/claude.d.ts +1 -1
  7. package/dist/agents/claude.js +3 -6
  8. package/dist/agents/cline.d.ts +1 -1
  9. package/dist/agents/cline.js +3 -6
  10. package/dist/agents/codex.d.ts +1 -1
  11. package/dist/agents/codex.js +3 -6
  12. package/dist/agents/copilot.d.ts +1 -1
  13. package/dist/agents/copilot.js +3 -6
  14. package/dist/agents/cursor.d.ts +1 -1
  15. package/dist/agents/cursor.js +3 -6
  16. package/dist/agents/deepagents.d.ts +1 -1
  17. package/dist/agents/deepagents.js +3 -6
  18. package/dist/agents/droid.d.ts +1 -1
  19. package/dist/agents/droid.js +3 -6
  20. package/dist/agents/gemini.d.ts +1 -1
  21. package/dist/agents/gemini.js +3 -6
  22. package/dist/agents/goose.d.ts +1 -1
  23. package/dist/agents/goose.js +3 -6
  24. package/dist/agents/hermes.d.ts +1 -1
  25. package/dist/agents/hermes.js +3 -6
  26. package/dist/agents/kimi.d.ts +1 -1
  27. package/dist/agents/kimi.js +3 -6
  28. package/dist/agents/kiro.d.ts +1 -1
  29. package/dist/agents/kiro.js +3 -6
  30. package/dist/agents/openclaw.d.ts +1 -1
  31. package/dist/agents/openclaw.js +3 -6
  32. package/dist/agents/opencode.d.ts +1 -1
  33. package/dist/agents/opencode.js +3 -6
  34. package/dist/agents/qoder.d.ts +1 -1
  35. package/dist/agents/qoder.js +3 -6
  36. package/dist/agents/qwen.d.ts +1 -1
  37. package/dist/agents/qwen.js +3 -6
  38. package/dist/agents/shared-prompt.d.ts +3 -2
  39. package/dist/agents/shared-prompt.js +6 -4
  40. package/dist/commands/run.js +3 -7
  41. package/dist/mcp-handler.js +1 -1
  42. package/dist/mcp-tools.d.ts +6 -1
  43. package/dist/mcp-tools.js +72 -6
  44. package/dist/pwa/assets/{index-DAI3J-jU.css → index-C6Lz09EY.css} +1 -1
  45. package/dist/pwa/assets/{index-RrJvjqz9.js → index-CZejk2al.js} +42 -42
  46. package/dist/pwa/assets/{web-EzNEHXEh.js → web-C48txJFl.js} +1 -1
  47. package/dist/pwa/assets/{web-DQteXlI7.js → web-zj8Blync.js} +1 -1
  48. package/dist/pwa/index.html +2 -2
  49. package/dist/pwa/service-worker.js +1 -1
  50. package/dist/rpc-handler.js +27 -68
  51. package/dist/spawn-command.js +3 -1
  52. package/dist/task.js +2 -3
  53. package/dist/transports/http-transport.js +4 -5
  54. package/dist/types.d.ts +0 -1
  55. package/package.json +2 -2
  56. package/palmier-server/README.md +1 -1
  57. package/palmier-server/pwa/src/App.css +9 -0
  58. package/palmier-server/pwa/src/components/TaskCard.tsx +36 -8
  59. package/palmier-server/pwa/src/components/TaskForm.tsx +63 -53
  60. package/palmier-server/pwa/src/constants.ts +1 -1
  61. package/palmier-server/spec.md +1 -1
  62. package/src/agents/agent-instructions.md +7 -37
  63. package/src/agents/agent.ts +2 -2
  64. package/src/agents/aider.ts +3 -6
  65. package/src/agents/claude.ts +3 -6
  66. package/src/agents/cline.ts +3 -6
  67. package/src/agents/codex.ts +3 -6
  68. package/src/agents/copilot.ts +3 -6
  69. package/src/agents/cursor.ts +3 -6
  70. package/src/agents/deepagents.ts +3 -6
  71. package/src/agents/droid.ts +3 -6
  72. package/src/agents/gemini.ts +3 -6
  73. package/src/agents/goose.ts +3 -6
  74. package/src/agents/hermes.ts +3 -6
  75. package/src/agents/kimi.ts +3 -6
  76. package/src/agents/kiro.ts +3 -6
  77. package/src/agents/openclaw.ts +3 -6
  78. package/src/agents/opencode.ts +3 -6
  79. package/src/agents/qoder.ts +3 -6
  80. package/src/agents/qwen.ts +3 -6
  81. package/src/agents/shared-prompt.ts +7 -4
  82. package/src/commands/run.ts +3 -7
  83. package/src/mcp-handler.ts +1 -1
  84. package/src/mcp-tools.ts +78 -7
  85. package/src/rpc-handler.ts +29 -72
  86. package/src/spawn-command.ts +3 -1
  87. package/src/task.ts +2 -3
  88. package/src/transports/http-transport.ts +4 -5
  89. package/src/types.ts +0 -1
  90. package/test/agent-instructions.test.ts +137 -9
  91. package/test/agent-output-parsing.test.ts +1 -0
  92. package/test/task-parsing.test.ts +3 -3
  93. package/dist/commands/plan-generation.md +0 -22
  94. package/src/commands/plan-generation.md +0 -22
package/README.md CHANGED
@@ -36,6 +36,20 @@ It runs on your machine as a background daemon and connects to a mobile-friendly
36
36
 
37
37
  Palmier runs as a background daemon (systemd on Linux, Task Scheduler on Windows). It invokes your agent CLIs directly, schedules tasks via native OS timers, and exposes an API that the PWA connects to — either directly over HTTP or remotely through a relay server. Agents can interact with the user's mobile device during execution — requesting input, sending push notifications, and fetching GPS location.
38
38
 
39
+ ### MCP Server
40
+
41
+ Palmier exposes an [MCP](https://modelcontextprotocol.io) server at `http://localhost:<port>/mcp` (streamable HTTP transport). MCP-capable agents can register it to get tool definitions automatically. The same tools are also available as REST endpoints for curl-based agents.
42
+
43
+ **MCP server URL:** `http://localhost:<port>/mcp`
44
+
45
+ **Available tools:**
46
+ | Tool | Description |
47
+ |------|-------------|
48
+ | `notify` | Send a push notification to the user's device |
49
+ | `request-input` | Request input from the user (blocks until response) |
50
+ | `request-confirmation` | Request confirmation from the user (blocks until response) |
51
+ | `device-geolocation` | Get GPS location of the user's mobile device |
52
+
39
53
  ```
40
54
  ┌──────────────┐ HTTP ┌──────────────────┐
41
55
  │ │◄──────────────────────│ │
@@ -1,4 +1,4 @@
1
- You are an AI agent executing a task on behalf of the user via the Palmier platform. Follow these instructions carefully.
1
+ You are an AI agent executing a task on behalf of the user. Follow these instructions carefully.
2
2
 
3
3
  ## Reporting Output
4
4
 
@@ -13,46 +13,16 @@ When you are done, output exactly one of these markers as the very last line (no
13
13
 
14
14
  ## Permissions
15
15
 
16
- If the task fails because a tool was denied or you lack the required permissions, print each required permission on its own line using this exact format:
16
+ Whenever a tool you are trying to use is denied or you lack the required permissions, print each required permission on its own line using this exact format:
17
17
  [PALMIER_PERMISSION] <tool_name> | <description>
18
18
 
19
19
  ## HTTP Endpoints
20
20
 
21
- The following HTTP endpoints are available at http://localhost:{{PORT}} during task execution. Use curl to call them. All endpoints require `taskId` in the request body.
22
-
23
- **`POST /request-input`** — Request input from the user. The request blocks until the user responds.
24
- ```json
25
- {"taskId": "{{TASK_ID}}", "description": "optional context", "questions": ["question 1", "question 2"]}
26
- ```
27
- - `taskId` (required, string): The current task ID.
28
- - `questions` (required, string array): Questions to present to the user.
29
- - `description` (optional, string): Context or heading for the input request.
30
- - Response: `{"values": ["answer1", "answer2"]}` on success, or `{"aborted": true}` if the user declines.
31
- - When you need information from the user (credentials, answers to questions, preferences, clarifications, etc.), do not guess, fail, or prompt via stdout, even in a non-interactive environment. Use this endpoint instead.
32
-
33
- **`POST /request-confirmation`** — Request confirmation from the user. The request blocks until the user confirms or aborts.
34
- ```json
35
- {"taskId": "{{TASK_ID}}", "description": "What the user is confirming"}
36
- ```
37
- - `taskId` (required, string): The current task ID.
38
- - `description` (required, string): What the user is confirming.
39
- - Response: `{"confirmed": true}` or `{"confirmed": false}`.
40
-
41
- **`POST /device-geolocation`** — Get the GPS location of the user's mobile device. Blocks until the device responds (up to 30 seconds).
42
- ```json
43
- {"taskId": "{{TASK_ID}}"}
44
- ```
45
- - `taskId` (required, string): The current task ID.
46
- - Response: `{"latitude": ..., "longitude": ..., "accuracy": ..., "timestamp": ...}` on success, or `{"error": "..."}` on failure.
47
-
48
- **`POST /notify`** — Send a push notification to the user's device.
49
- ```json
50
- {"taskId": "{{TASK_ID}}", "title": "...", "body": "..."}
51
- ```
52
- - `taskId` (required, string): The current task ID.
53
- - `title` (required, string): Notification title.
54
- - `body` (required, string): Notification body.
21
+ {{ENDPOINT_DOCS}}
22
+
23
+ The task to execute follows below:
55
24
 
56
25
  ---
57
26
 
58
- The task to execute follows below.
27
+ {{TASK_DESCRIPTION}}
28
+
@@ -12,8 +12,8 @@ export interface CommandLine {
12
12
  * Abstracts how plans are generated and tasks are executed across different AI agents.
13
13
  */
14
14
  export interface AgentTool {
15
- /** Return the command and args used to generate a plan from a prompt. */
16
- getPlanGenerationCommandLine(prompt: string): CommandLine;
15
+ /** Return the command and args for a short, non-interactive prompt (e.g. generating a task name). */
16
+ getPromptCommandLine(prompt: string): CommandLine;
17
17
  /** Return the command and args used to run a task. If followupPrompt is provided, use it instead of the task's prompt,
18
18
  * and treat it as a continuation of the original run (reuse the same session, etc).
19
19
  * extraPermissions: pass an array of RequiredPermission for transient permissions granted for this run only,
@@ -2,7 +2,7 @@ import type { ParsedTask, RequiredPermission } from "../types.js";
2
2
  import type { AgentTool, CommandLine } from "./agent.js";
3
3
  export declare class Aider implements AgentTool {
4
4
  supportsPermissions: boolean;
5
- getPlanGenerationCommandLine(prompt: string): CommandLine;
5
+ getPromptCommandLine(prompt: string): CommandLine;
6
6
  getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine;
7
7
  init(): Promise<boolean>;
8
8
  }
@@ -3,15 +3,12 @@ import { getAgentInstructions } from "./shared-prompt.js";
3
3
  import { SHELL } from "../platform/index.js";
4
4
  export class Aider {
5
5
  supportsPermissions = false;
6
- getPlanGenerationCommandLine(prompt) {
7
- return {
8
- command: "aider",
9
- args: ["--message", prompt],
10
- };
6
+ getPromptCommandLine(prompt) {
7
+ return { command: "aider", args: ["--message", prompt] };
11
8
  }
12
9
  getTaskRunCommandLine(task, followupPrompt, extraPermissions) {
13
10
  const yolo = extraPermissions === "yolo";
14
- const prompt = followupPrompt ?? (getAgentInstructions(task.frontmatter.id, yolo || !this.supportsPermissions) + "\n\n" + (task.body || task.frontmatter.user_prompt));
11
+ const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
15
12
  const args = [];
16
13
  if (yolo) {
17
14
  args.push("--yes-always");
@@ -2,7 +2,7 @@ import type { ParsedTask, RequiredPermission } from "../types.js";
2
2
  import type { AgentTool, CommandLine } from "./agent.js";
3
3
  export declare class ClaudeAgent implements AgentTool {
4
4
  supportsPermissions: boolean;
5
- getPlanGenerationCommandLine(prompt: string): CommandLine;
5
+ getPromptCommandLine(prompt: string): CommandLine;
6
6
  getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine;
7
7
  init(): Promise<boolean>;
8
8
  }
@@ -3,15 +3,12 @@ import { getAgentInstructions } from "./shared-prompt.js";
3
3
  import { SHELL } from "../platform/index.js";
4
4
  export class ClaudeAgent {
5
5
  supportsPermissions = true;
6
- getPlanGenerationCommandLine(prompt) {
7
- return {
8
- command: "claude",
9
- args: ["-p", prompt],
10
- };
6
+ getPromptCommandLine(prompt) {
7
+ return { command: "claude", args: ["-p", prompt] };
11
8
  }
12
9
  getTaskRunCommandLine(task, followupPrompt, extraPermissions) {
13
10
  const yolo = extraPermissions === "yolo";
14
- const prompt = followupPrompt ?? (getAgentInstructions(task.frontmatter.id, yolo || !this.supportsPermissions) + "\n\n" + (task.body || task.frontmatter.user_prompt));
11
+ const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
15
12
  const args = ["--permission-mode", yolo ? "bypassPermissions" : "acceptEdits", "-p"];
16
13
  if (!yolo) {
17
14
  args.push("--allowedTools", "WebFetch");
@@ -2,7 +2,7 @@ import type { ParsedTask, RequiredPermission } from "../types.js";
2
2
  import type { AgentTool, CommandLine } from "./agent.js";
3
3
  export declare class Cline implements AgentTool {
4
4
  supportsPermissions: boolean;
5
- getPlanGenerationCommandLine(prompt: string): CommandLine;
5
+ getPromptCommandLine(prompt: string): CommandLine;
6
6
  getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine;
7
7
  init(): Promise<boolean>;
8
8
  }
@@ -3,15 +3,12 @@ import { getAgentInstructions } from "./shared-prompt.js";
3
3
  import { SHELL } from "../platform/index.js";
4
4
  export class Cline {
5
5
  supportsPermissions = false;
6
- getPlanGenerationCommandLine(prompt) {
7
- return {
8
- command: "cline ",
9
- args: ["--yolo", "-p", prompt],
10
- };
6
+ getPromptCommandLine(prompt) {
7
+ return { command: "cline ", args: ["--yolo", "-p", prompt] };
11
8
  }
12
9
  getTaskRunCommandLine(task, followupPrompt, extraPermissions) {
13
10
  const yolo = extraPermissions === "yolo";
14
- const prompt = followupPrompt ?? (getAgentInstructions(task.frontmatter.id, yolo || !this.supportsPermissions) + "\n\n" + (task.body || task.frontmatter.user_prompt));
11
+ const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
15
12
  const args = [];
16
13
  if (yolo) {
17
14
  args.push("--yolo");
@@ -2,7 +2,7 @@ import type { ParsedTask, RequiredPermission } from "../types.js";
2
2
  import type { AgentTool, CommandLine } from "./agent.js";
3
3
  export declare class CodexAgent implements AgentTool {
4
4
  supportsPermissions: boolean;
5
- getPlanGenerationCommandLine(prompt: string): CommandLine;
5
+ getPromptCommandLine(prompt: string): CommandLine;
6
6
  getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine;
7
7
  init(): Promise<boolean>;
8
8
  }
@@ -3,15 +3,12 @@ import { getAgentInstructions } from "./shared-prompt.js";
3
3
  import { SHELL } from "../platform/index.js";
4
4
  export class CodexAgent {
5
5
  supportsPermissions = true;
6
- getPlanGenerationCommandLine(prompt) {
7
- return {
8
- command: "codex",
9
- args: ["exec", "--skip-git-repo-check", prompt],
10
- };
6
+ getPromptCommandLine(prompt) {
7
+ return { command: "codex", args: ["exec", "--skip-git-repo-check", prompt] };
11
8
  }
12
9
  getTaskRunCommandLine(task, followupPrompt, extraPermissions) {
13
10
  const yolo = extraPermissions === "yolo";
14
- const prompt = followupPrompt ?? (getAgentInstructions(task.frontmatter.id, yolo || !this.supportsPermissions) + "\n\n" + (task.body || task.frontmatter.user_prompt));
11
+ const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
15
12
  const args = ["exec", "--skip-git-repo-check", "--sandbox", yolo ? "danger-full-access" : "workspace-write"];
16
13
  if (!yolo) {
17
14
  const allPerms = [...(task.frontmatter.permissions ?? []), ...(extraPermissions ?? [])];
@@ -2,7 +2,7 @@ import type { ParsedTask, RequiredPermission } from "../types.js";
2
2
  import type { AgentTool, CommandLine } from "./agent.js";
3
3
  export declare class CopilotAgent implements AgentTool {
4
4
  supportsPermissions: boolean;
5
- getPlanGenerationCommandLine(prompt: string): CommandLine;
5
+ getPromptCommandLine(prompt: string): CommandLine;
6
6
  getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine;
7
7
  init(): Promise<boolean>;
8
8
  }
@@ -3,15 +3,12 @@ import { getAgentInstructions } from "./shared-prompt.js";
3
3
  import { SHELL } from "../platform/index.js";
4
4
  export class CopilotAgent {
5
5
  supportsPermissions = false;
6
- getPlanGenerationCommandLine(prompt) {
7
- return {
8
- command: "copilot",
9
- args: ["-p", prompt],
10
- };
6
+ getPromptCommandLine(prompt) {
7
+ return { command: "copilot", args: ["-p", prompt] };
11
8
  }
12
9
  getTaskRunCommandLine(task, followupPrompt, extraPermissions) {
13
10
  const yolo = extraPermissions === "yolo";
14
- const prompt = followupPrompt ?? (getAgentInstructions(task.frontmatter.id, yolo || !this.supportsPermissions) + "\n\n" + (task.body || task.frontmatter.user_prompt));
11
+ const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
15
12
  const args = ["-p", prompt];
16
13
  if (yolo) {
17
14
  args.push("--yolo");
@@ -2,7 +2,7 @@ import type { ParsedTask, RequiredPermission } from "../types.js";
2
2
  import type { AgentTool, CommandLine } from "./agent.js";
3
3
  export declare class Cursor implements AgentTool {
4
4
  supportsPermissions: boolean;
5
- getPlanGenerationCommandLine(prompt: string): CommandLine;
5
+ getPromptCommandLine(prompt: string): CommandLine;
6
6
  getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine;
7
7
  init(): Promise<boolean>;
8
8
  }
@@ -3,15 +3,12 @@ import { getAgentInstructions } from "./shared-prompt.js";
3
3
  import { SHELL } from "../platform/index.js";
4
4
  export class Cursor {
5
5
  supportsPermissions = false;
6
- getPlanGenerationCommandLine(prompt) {
7
- return {
8
- command: "cursor",
9
- args: ["-p", prompt],
10
- };
6
+ getPromptCommandLine(prompt) {
7
+ return { command: "cursor", args: ["-p", prompt] };
11
8
  }
12
9
  getTaskRunCommandLine(task, followupPrompt, extraPermissions) {
13
10
  const yolo = extraPermissions === "yolo";
14
- const prompt = followupPrompt ?? (getAgentInstructions(task.frontmatter.id, yolo || !this.supportsPermissions) + "\n\n" + (task.body || task.frontmatter.user_prompt));
11
+ const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
15
12
  const args = [];
16
13
  if (yolo) {
17
14
  args.push("--force");
@@ -2,7 +2,7 @@ import type { ParsedTask, RequiredPermission } from "../types.js";
2
2
  import type { AgentTool, CommandLine } from "./agent.js";
3
3
  export declare class DeepAgents implements AgentTool {
4
4
  supportsPermissions: boolean;
5
- getPlanGenerationCommandLine(prompt: string): CommandLine;
5
+ getPromptCommandLine(prompt: string): CommandLine;
6
6
  getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine;
7
7
  init(): Promise<boolean>;
8
8
  }
@@ -3,15 +3,12 @@ import { getAgentInstructions } from "./shared-prompt.js";
3
3
  import { SHELL } from "../platform/index.js";
4
4
  export class DeepAgents {
5
5
  supportsPermissions = false;
6
- getPlanGenerationCommandLine(prompt) {
7
- return {
8
- command: "deepagents",
9
- args: ["--non-interactive", prompt],
10
- };
6
+ getPromptCommandLine(prompt) {
7
+ return { command: "deepagents", args: ["--non-interactive", prompt] };
11
8
  }
12
9
  getTaskRunCommandLine(task, followupPrompt, extraPermissions) {
13
10
  const yolo = extraPermissions === "yolo";
14
- const prompt = followupPrompt ?? (getAgentInstructions(task.frontmatter.id, yolo || !this.supportsPermissions) + "\n\n" + (task.body || task.frontmatter.user_prompt));
11
+ const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
15
12
  const args = [];
16
13
  if (yolo) {
17
14
  args.push("--auto-approve");
@@ -2,7 +2,7 @@ import type { ParsedTask, RequiredPermission } from "../types.js";
2
2
  import type { AgentTool, CommandLine } from "./agent.js";
3
3
  export declare class DroidAgent implements AgentTool {
4
4
  supportsPermissions: boolean;
5
- getPlanGenerationCommandLine(prompt: string): CommandLine;
5
+ getPromptCommandLine(prompt: string): CommandLine;
6
6
  getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine;
7
7
  init(): Promise<boolean>;
8
8
  }
@@ -3,15 +3,12 @@ import { getAgentInstructions } from "./shared-prompt.js";
3
3
  import { SHELL } from "../platform/index.js";
4
4
  export class DroidAgent {
5
5
  supportsPermissions = false;
6
- getPlanGenerationCommandLine(prompt) {
7
- return {
8
- command: "droid",
9
- args: ["exec", prompt],
10
- };
6
+ getPromptCommandLine(prompt) {
7
+ return { command: "droid", args: ["exec", prompt] };
11
8
  }
12
9
  getTaskRunCommandLine(task, followupPrompt, extraPermissions) {
13
10
  const yolo = extraPermissions === "yolo";
14
- const prompt = followupPrompt ?? (getAgentInstructions(task.frontmatter.id, yolo || !this.supportsPermissions) + "\n\n" + (task.body || task.frontmatter.user_prompt));
11
+ const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
15
12
  const args = ["exec", "--session-id", task.frontmatter.id];
16
13
  if (yolo) {
17
14
  args.push("--skip-permissions-unsafe");
@@ -2,7 +2,7 @@ import type { ParsedTask, RequiredPermission } from "../types.js";
2
2
  import type { AgentTool, CommandLine } from "./agent.js";
3
3
  export declare class GeminiAgent implements AgentTool {
4
4
  supportsPermissions: boolean;
5
- getPlanGenerationCommandLine(prompt: string): CommandLine;
5
+ getPromptCommandLine(prompt: string): CommandLine;
6
6
  getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine;
7
7
  init(): Promise<boolean>;
8
8
  }
@@ -3,15 +3,12 @@ import { getAgentInstructions } from "./shared-prompt.js";
3
3
  import { SHELL } from "../platform/index.js";
4
4
  export class GeminiAgent {
5
5
  supportsPermissions = true;
6
- getPlanGenerationCommandLine(prompt) {
7
- return {
8
- command: "gemini",
9
- args: ["--prompt", prompt],
10
- };
6
+ getPromptCommandLine(prompt) {
7
+ return { command: "gemini", args: ["--prompt", prompt] };
11
8
  }
12
9
  getTaskRunCommandLine(task, followupPrompt, extraPermissions) {
13
10
  const yolo = extraPermissions === "yolo";
14
- const prompt = followupPrompt ?? (getAgentInstructions(task.frontmatter.id, yolo || !this.supportsPermissions) + "\n\n" + (task.body || task.frontmatter.user_prompt));
11
+ const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
15
12
  const args = ["--approval-mode", yolo ? "yolo" : "auto_edit"];
16
13
  if (!yolo) {
17
14
  const tools = ["run_shell_command", "web_fetch"];
@@ -2,7 +2,7 @@ import type { ParsedTask, RequiredPermission } from "../types.js";
2
2
  import type { AgentTool, CommandLine } from "./agent.js";
3
3
  export declare class GooseAgent implements AgentTool {
4
4
  supportsPermissions: boolean;
5
- getPlanGenerationCommandLine(prompt: string): CommandLine;
5
+ getPromptCommandLine(prompt: string): CommandLine;
6
6
  getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine;
7
7
  init(): Promise<boolean>;
8
8
  }
@@ -3,15 +3,12 @@ import { getAgentInstructions } from "./shared-prompt.js";
3
3
  import { SHELL } from "../platform/index.js";
4
4
  export class GooseAgent {
5
5
  supportsPermissions = false;
6
- getPlanGenerationCommandLine(prompt) {
7
- return {
8
- command: "goose",
9
- args: ["run", "--text", prompt],
10
- };
6
+ getPromptCommandLine(prompt) {
7
+ return { command: "goose", args: ["run", "--text", prompt] };
11
8
  }
12
9
  getTaskRunCommandLine(task, followupPrompt, extraPermissions) {
13
10
  const yolo = extraPermissions === "yolo";
14
- const prompt = followupPrompt ?? (getAgentInstructions(task.frontmatter.id, yolo || !this.supportsPermissions) + "\n\n" + (task.body || task.frontmatter.user_prompt));
11
+ const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
15
12
  const args = ["run"];
16
13
  if (followupPrompt) {
17
14
  args.push("--resume");
@@ -2,7 +2,7 @@ import type { ParsedTask, RequiredPermission } from "../types.js";
2
2
  import type { AgentTool, CommandLine } from "./agent.js";
3
3
  export declare class Hermes implements AgentTool {
4
4
  supportsPermissions: boolean;
5
- getPlanGenerationCommandLine(prompt: string): CommandLine;
5
+ getPromptCommandLine(prompt: string): CommandLine;
6
6
  getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine;
7
7
  init(): Promise<boolean>;
8
8
  }
@@ -3,15 +3,12 @@ import { getAgentInstructions } from "./shared-prompt.js";
3
3
  import { SHELL } from "../platform/index.js";
4
4
  export class Hermes {
5
5
  supportsPermissions = false;
6
- getPlanGenerationCommandLine(prompt) {
7
- return {
8
- command: "hermes",
9
- args: ["chat", "-q", prompt],
10
- };
6
+ getPromptCommandLine(prompt) {
7
+ return { command: "hermes", args: ["chat", "-q", prompt] };
11
8
  }
12
9
  getTaskRunCommandLine(task, followupPrompt, extraPermissions) {
13
10
  const yolo = extraPermissions === "yolo";
14
- const prompt = followupPrompt ?? (getAgentInstructions(task.frontmatter.id, yolo || !this.supportsPermissions) + "\n\n" + (task.body || task.frontmatter.user_prompt));
11
+ const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
15
12
  const args = ["chat"];
16
13
  if (yolo) {
17
14
  args.push("--trust-all-tools");
@@ -2,7 +2,7 @@ import type { ParsedTask, RequiredPermission } from "../types.js";
2
2
  import type { AgentTool, CommandLine } from "./agent.js";
3
3
  export declare class KimiAgent implements AgentTool {
4
4
  supportsPermissions: boolean;
5
- getPlanGenerationCommandLine(prompt: string): CommandLine;
5
+ getPromptCommandLine(prompt: string): CommandLine;
6
6
  getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine;
7
7
  init(): Promise<boolean>;
8
8
  }
@@ -3,15 +3,12 @@ import { getAgentInstructions } from "./shared-prompt.js";
3
3
  import { SHELL } from "../platform/index.js";
4
4
  export class KimiAgent {
5
5
  supportsPermissions = false;
6
- getPlanGenerationCommandLine(prompt) {
7
- return {
8
- command: "kimi",
9
- args: ["-p", prompt],
10
- };
6
+ getPromptCommandLine(prompt) {
7
+ return { command: "kimi", args: ["-p", prompt] };
11
8
  }
12
9
  getTaskRunCommandLine(task, followupPrompt, extraPermissions) {
13
10
  const yolo = extraPermissions === "yolo";
14
- const prompt = followupPrompt ?? (getAgentInstructions(task.frontmatter.id, yolo || !this.supportsPermissions) + "\n\n" + (task.body || task.frontmatter.user_prompt));
11
+ const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
15
12
  const args = [];
16
13
  if (yolo) {
17
14
  args.push("--yolo");
@@ -2,7 +2,7 @@ import type { ParsedTask, RequiredPermission } from "../types.js";
2
2
  import type { AgentTool, CommandLine } from "./agent.js";
3
3
  export declare class Kiro implements AgentTool {
4
4
  supportsPermissions: boolean;
5
- getPlanGenerationCommandLine(prompt: string): CommandLine;
5
+ getPromptCommandLine(prompt: string): CommandLine;
6
6
  getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine;
7
7
  init(): Promise<boolean>;
8
8
  }
@@ -3,15 +3,12 @@ import { getAgentInstructions } from "./shared-prompt.js";
3
3
  import { SHELL } from "../platform/index.js";
4
4
  export class Kiro {
5
5
  supportsPermissions = false;
6
- getPlanGenerationCommandLine(prompt) {
7
- return {
8
- command: "kiro-cli",
9
- args: ["--no-interactive", prompt],
10
- };
6
+ getPromptCommandLine(prompt) {
7
+ return { command: "kiro-cli", args: ["--no-interactive", prompt] };
11
8
  }
12
9
  getTaskRunCommandLine(task, followupPrompt, extraPermissions) {
13
10
  const yolo = extraPermissions === "yolo";
14
- const prompt = followupPrompt ?? (getAgentInstructions(task.frontmatter.id, yolo || !this.supportsPermissions) + "\n\n" + (task.body || task.frontmatter.user_prompt));
11
+ const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
15
12
  const args = [];
16
13
  if (yolo) {
17
14
  args.push("--trust-all-tools");
@@ -2,7 +2,7 @@ import type { ParsedTask, RequiredPermission } from "../types.js";
2
2
  import type { AgentTool, CommandLine } from "./agent.js";
3
3
  export declare class OpenClawAgent implements AgentTool {
4
4
  supportsPermissions: boolean;
5
- getPlanGenerationCommandLine(prompt: string): CommandLine;
5
+ getPromptCommandLine(prompt: string): CommandLine;
6
6
  getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine;
7
7
  init(): Promise<boolean>;
8
8
  }
@@ -2,15 +2,12 @@ import { execSync } from "child_process";
2
2
  import { getAgentInstructions } from "./shared-prompt.js";
3
3
  export class OpenClawAgent {
4
4
  supportsPermissions = false;
5
- getPlanGenerationCommandLine(prompt) {
6
- return {
7
- command: "openclaw",
8
- args: ["agent", "--local", "--agent", "main", "--message", prompt],
9
- };
5
+ getPromptCommandLine(prompt) {
6
+ return { command: "openclaw", args: ["agent", "--local", "--agent", "main", "--message", prompt] };
10
7
  }
11
8
  getTaskRunCommandLine(task, followupPrompt, extraPermissions) {
12
9
  const yolo = extraPermissions === "yolo";
13
- const prompt = followupPrompt ?? (getAgentInstructions(task.frontmatter.id, yolo || !this.supportsPermissions) + "\n\n" + (task.body || task.frontmatter.user_prompt));
10
+ const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
14
11
  // OpenClaw does not support stdin as prompt.
15
12
  const args = ["agent", "--local", "--session-id", task.frontmatter.id, "--message", prompt];
16
13
  return { command: "openclaw", args };
@@ -2,7 +2,7 @@ import type { ParsedTask, RequiredPermission } from "../types.js";
2
2
  import type { AgentTool, CommandLine } from "./agent.js";
3
3
  export declare class OpenCodeAgent implements AgentTool {
4
4
  supportsPermissions: boolean;
5
- getPlanGenerationCommandLine(prompt: string): CommandLine;
5
+ getPromptCommandLine(prompt: string): CommandLine;
6
6
  getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine;
7
7
  init(): Promise<boolean>;
8
8
  }
@@ -3,15 +3,12 @@ import { getAgentInstructions } from "./shared-prompt.js";
3
3
  import { SHELL } from "../platform/index.js";
4
4
  export class OpenCodeAgent {
5
5
  supportsPermissions = false;
6
- getPlanGenerationCommandLine(prompt) {
7
- return {
8
- command: "opencode",
9
- args: ["run", prompt],
10
- };
6
+ getPromptCommandLine(prompt) {
7
+ return { command: "opencode", args: ["run", prompt] };
11
8
  }
12
9
  getTaskRunCommandLine(task, followupPrompt, extraPermissions) {
13
10
  const yolo = extraPermissions === "yolo";
14
- const prompt = followupPrompt ?? (getAgentInstructions(task.frontmatter.id, yolo || !this.supportsPermissions) + "\n\n" + (task.body || task.frontmatter.user_prompt));
11
+ const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
15
12
  const args = ["run"];
16
13
  if (yolo) {
17
14
  args.push("--dangerously-skip-permissions");
@@ -2,7 +2,7 @@ import type { ParsedTask, RequiredPermission } from "../types.js";
2
2
  import type { AgentTool, CommandLine } from "./agent.js";
3
3
  export declare class Qoder implements AgentTool {
4
4
  supportsPermissions: boolean;
5
- getPlanGenerationCommandLine(prompt: string): CommandLine;
5
+ getPromptCommandLine(prompt: string): CommandLine;
6
6
  getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine;
7
7
  init(): Promise<boolean>;
8
8
  }
@@ -3,15 +3,12 @@ import { getAgentInstructions } from "./shared-prompt.js";
3
3
  import { SHELL } from "../platform/index.js";
4
4
  export class Qoder {
5
5
  supportsPermissions = false;
6
- getPlanGenerationCommandLine(prompt) {
7
- return {
8
- command: "qodercli",
9
- args: ["-p", prompt],
10
- };
6
+ getPromptCommandLine(prompt) {
7
+ return { command: "qodercli", args: ["-p", prompt] };
11
8
  }
12
9
  getTaskRunCommandLine(task, followupPrompt, extraPermissions) {
13
10
  const yolo = extraPermissions === "yolo";
14
- const prompt = followupPrompt ?? (getAgentInstructions(task.frontmatter.id, yolo || !this.supportsPermissions) + "\n\n" + (task.body || task.frontmatter.user_prompt));
11
+ const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
15
12
  const args = [];
16
13
  if (yolo) {
17
14
  args.push("--yolo");
@@ -2,7 +2,7 @@ import type { ParsedTask, RequiredPermission } from "../types.js";
2
2
  import type { AgentTool, CommandLine } from "./agent.js";
3
3
  export declare class QwenAgent implements AgentTool {
4
4
  supportsPermissions: boolean;
5
- getPlanGenerationCommandLine(prompt: string): CommandLine;
5
+ getPromptCommandLine(prompt: string): CommandLine;
6
6
  getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine;
7
7
  init(): Promise<boolean>;
8
8
  }
@@ -3,15 +3,12 @@ import { getAgentInstructions } from "./shared-prompt.js";
3
3
  import { SHELL } from "../platform/index.js";
4
4
  export class QwenAgent {
5
5
  supportsPermissions = false;
6
- getPlanGenerationCommandLine(prompt) {
7
- return {
8
- command: "qwen",
9
- args: ["-p", prompt],
10
- };
6
+ getPromptCommandLine(prompt) {
7
+ return { command: "qwen", args: ["-p", prompt] };
11
8
  }
12
9
  getTaskRunCommandLine(task, followupPrompt, extraPermissions) {
13
10
  const yolo = extraPermissions === "yolo";
14
- const prompt = followupPrompt ?? (getAgentInstructions(task.frontmatter.id, yolo || !this.supportsPermissions) + "\n\n" + (task.body || task.frontmatter.user_prompt));
11
+ const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
15
12
  const args = ["--approval-mode", yolo ? "yolo" : "auto-edit"];
16
13
  if (followupPrompt) {
17
14
  args.push("-c");
@@ -1,7 +1,8 @@
1
+ import type { ParsedTask } from "../types.js";
1
2
  /**
2
- * Agent instructions with the serve daemon's HTTP port and task ID baked in.
3
+ * Build the full agent prompt: instructions + endpoint docs + task description.
3
4
  */
4
- export declare function getAgentInstructions(taskId: string, skipPermissions?: boolean): string;
5
+ export declare function getAgentInstructions(task: ParsedTask, skipPermissions?: boolean): string;
5
6
  export declare const TASK_SUCCESS_MARKER = "[PALMIER_TASK_SUCCESS]";
6
7
  export declare const TASK_FAILURE_MARKER = "[PALMIER_TASK_FAILURE]";
7
8
  export declare const TASK_REPORT_PREFIX = "[PALMIER_REPORT]";