palmier 0.9.15 → 0.9.16

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.
@@ -9,7 +9,7 @@ export class Aider {
9
9
  }
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 = [];
14
14
  if (yolo) {
15
15
  args.push("--yes-always");
@@ -9,7 +9,7 @@ export class ClaudeAgent {
9
9
  }
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");
@@ -9,7 +9,7 @@ export class Cline {
9
9
  }
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 = [];
14
14
  if (yolo) {
15
15
  args.push("--yolo");
@@ -2,21 +2,15 @@ import { execSync } from "child_process";
2
2
  import { getAgentInstructions } from "./shared-prompt.js";
3
3
  import { SHELL } from "../platform/index.js";
4
4
  export class CodexAgent {
5
- supportsPermissions = true;
5
+ supportsPermissions = false;
6
6
  supportsYolo = true;
7
7
  getPromptCommandLine(prompt) {
8
8
  return { command: "codex", args: ["exec", "--skip-git-repo-check", prompt] };
9
9
  }
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
  }
@@ -9,7 +9,7 @@ export class CopilotAgent {
9
9
  }
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");
@@ -9,7 +9,7 @@ export class Cursor {
9
9
  }
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 = [];
14
14
  if (yolo) {
15
15
  args.push("--force");
@@ -9,7 +9,7 @@ export class DeepAgents {
9
9
  }
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 = [];
14
14
  if (yolo) {
15
15
  args.push("--auto-approve");
@@ -9,7 +9,7 @@ export class DroidAgent {
9
9
  }
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", "--session-id", task.frontmatter.id];
14
14
  if (yolo) {
15
15
  args.push("--skip-permissions-unsafe");
@@ -25,7 +25,7 @@ export class GeminiAgent {
25
25
  }
26
26
  getTaskRunCommandLine(task, followupPrompt, extraPermissions) {
27
27
  const yolo = extraPermissions === "yolo";
28
- const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
28
+ const prompt = followupPrompt ?? getAgentInstructions(task);
29
29
  const args = ["--approval-mode", yolo ? "yolo" : "auto_edit"];
30
30
  const files = [];
31
31
  if (!yolo) {
@@ -9,7 +9,7 @@ export class GooseAgent {
9
9
  }
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 = ["run"];
14
14
  if (followupPrompt) {
15
15
  args.push("--resume");
@@ -9,7 +9,7 @@ export class Hermes {
9
9
  }
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 = ["chat"];
14
14
  if (yolo) {
15
15
  args.push("--trust-all-tools");
@@ -9,7 +9,7 @@ export class KimiAgent {
9
9
  }
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 = [];
14
14
  if (yolo) {
15
15
  args.push("--yolo");
@@ -9,7 +9,7 @@ export class Kiro {
9
9
  }
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 = [];
14
14
  if (yolo) {
15
15
  args.push("--trust-all-tools");
@@ -7,7 +7,7 @@ export class OpenClawAgent {
7
7
  return { command: "openclaw", args: ["agent", "--local", "--agent", "main", "--message", prompt] };
8
8
  }
9
9
  getTaskRunCommandLine(task, followupPrompt, extraPermissions) {
10
- const prompt = followupPrompt ?? getAgentInstructions(task, true);
10
+ const prompt = followupPrompt ?? getAgentInstructions(task);
11
11
  // OpenClaw does not support stdin as prompt.
12
12
  const args = ["agent", "--local", "--session-id", task.frontmatter.id, "--message", prompt];
13
13
  return { command: "openclaw", args };
@@ -9,7 +9,7 @@ export class OpenCodeAgent {
9
9
  }
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 = ["run"];
14
14
  if (yolo) {
15
15
  args.push("--dangerously-skip-permissions");
@@ -9,7 +9,7 @@ export class Qoder {
9
9
  }
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 = [];
14
14
  if (yolo) {
15
15
  args.push("--yolo");
@@ -9,7 +9,7 @@ export class QwenAgent {
9
9
  }
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 = ["--approval-mode", yolo ? "yolo" : "auto-edit"];
14
14
  if (followupPrompt) {
15
15
  args.push("-c");
@@ -1,5 +1,5 @@
1
1
  import type { ParsedTask } from "../types.js";
2
- export declare function getAgentInstructions(task: ParsedTask, skipPermissions?: boolean): string;
2
+ export declare function getAgentInstructions(task: ParsedTask): string;
3
3
  export declare const TASK_SUCCESS_MARKER = "[PALMIER_TASK_SUCCESS]";
4
4
  export declare const TASK_FAILURE_MARKER = "[PALMIER_TASK_FAILURE]";
5
5
  export declare const TASK_REPORT_PREFIX = "[PALMIER_REPORT]";
@@ -3,15 +3,17 @@ import * as path from "path";
3
3
  import { fileURLToPath } from "url";
4
4
  import { loadConfig } from "../config.js";
5
5
  import { generateEndpointDocs } from "../mcp-tools.js";
6
+ import { getAgent } from "./agent.js";
6
7
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
7
8
  const AGENT_INSTRUCTIONS_TEMPLATE = fs.readFileSync(path.join(__dirname, "agent-instructions.md"), "utf-8");
8
- export function getAgentInstructions(task, skipPermissions) {
9
+ export function getAgentInstructions(task) {
9
10
  const port = loadConfig().httpPort ?? 7256;
10
11
  const taskDescription = task.frontmatter.user_prompt;
11
12
  let instructions = AGENT_INSTRUCTIONS_TEMPLATE
12
13
  .replace(/\{\{ENDPOINT_DOCS\}\}/g, generateEndpointDocs(port, task.frontmatter.id))
13
14
  .replace(/\{\{TASK_DESCRIPTION\}\}/g, taskDescription);
14
- if (skipPermissions) {
15
+ const agent = getAgent(task.frontmatter.agent);
16
+ if (!agent.supportsPermissions || !!task.frontmatter.yolo_mode) {
15
17
  instructions = instructions.replace(/## Permissions\r?\n[\s\S]*?(?=## |\r?\n---)/m, "");
16
18
  }
17
19
  return instructions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "palmier",
3
- "version": "0.9.15",
3
+ "version": "0.9.16",
4
4
  "description": "Palmier host CLI - provisions, executes tasks, and serves NATS RPC",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Hongxu Cai",