palmier 0.6.5 → 0.6.6

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.
@@ -14,6 +14,7 @@ import { Cursor } from "./cursor.js";
14
14
  import { Kiro } from "./kiro.js";
15
15
  import { Cline } from "./cline.js";
16
16
  import { Qoder } from "./qoder.js";
17
+ import { Hermes } from "./hermes.js";
17
18
  const agentRegistry = {
18
19
  claude: new ClaudeAgent(),
19
20
  gemini: new GeminiAgent(),
@@ -31,6 +32,7 @@ const agentRegistry = {
31
32
  kiro: new Kiro(),
32
33
  cline: new Cline(),
33
34
  qoder: new Qoder(),
35
+ hermes: new Hermes(),
34
36
  };
35
37
  const agentLabels = {
36
38
  claude: "Claude Code",
@@ -46,9 +48,10 @@ const agentLabels = {
46
48
  deepagents: "Deep Agents CLI",
47
49
  aider: "Aider",
48
50
  cursor: "Cursor CLI",
49
- kiro: "Kiro",
50
- cline: "Cline",
51
- qoder: "Qoder",
51
+ kiro: "Kiro CLI",
52
+ cline: "Cline CLI",
53
+ qoder: "Qoder CLI",
54
+ hermes: "Hermes Agent",
52
55
  };
53
56
  export async function detectAgents() {
54
57
  const detected = [];
@@ -0,0 +1,9 @@
1
+ import type { ParsedTask, RequiredPermission } from "../types.js";
2
+ import type { AgentTool, CommandLine } from "./agent.js";
3
+ export declare class Hermes implements AgentTool {
4
+ supportsPermissions: boolean;
5
+ getPlanGenerationCommandLine(prompt: string): CommandLine;
6
+ getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine;
7
+ init(): Promise<boolean>;
8
+ }
9
+ //# sourceMappingURL=hermes.d.ts.map
@@ -0,0 +1,35 @@
1
+ import { execSync } from "child_process";
2
+ import { getAgentInstructions } from "./shared-prompt.js";
3
+ import { SHELL } from "../platform/index.js";
4
+ export class Hermes {
5
+ supportsPermissions = false;
6
+ getPlanGenerationCommandLine(prompt) {
7
+ return {
8
+ command: "hermes",
9
+ args: ["chat", "-q", prompt],
10
+ };
11
+ }
12
+ getTaskRunCommandLine(task, followupPrompt, extraPermissions) {
13
+ const yolo = extraPermissions === "yolo";
14
+ const prompt = followupPrompt ?? (getAgentInstructions(task.frontmatter.id, yolo || !this.supportsPermissions) + "\n\n" + (task.body || task.frontmatter.user_prompt));
15
+ const args = ["chat"];
16
+ if (yolo) {
17
+ args.push("--trust-all-tools");
18
+ }
19
+ if (followupPrompt) {
20
+ args.push("--continue");
21
+ } // continue mode for followups
22
+ args.push("-q", prompt);
23
+ return { command: "hermes", args };
24
+ }
25
+ async init() {
26
+ try {
27
+ execSync("hermes --version", { stdio: "ignore", shell: SHELL });
28
+ }
29
+ catch {
30
+ return false;
31
+ }
32
+ return true;
33
+ }
34
+ }
35
+ //# sourceMappingURL=hermes.js.map
@@ -317,15 +317,10 @@ export function createRpcHandler(config, nc) {
317
317
  try {
318
318
  const runTaskDir = getTaskDir(config.projectRoot, params.id);
319
319
  const platform = getPlatform();
320
- // Check if the task is already running
320
+ // If the task is already running, kill the stale process and start fresh
321
321
  if (platform.isTaskRunning(params.id)) {
322
- // Ensure status reflects reality
323
- const currentStatus = readTaskStatus(runTaskDir);
324
- if (currentStatus?.running_state !== "started") {
325
- writeTaskStatus(runTaskDir, { running_state: "started", time_stamp: Date.now() });
326
- await publishHostEvent(nc, config.hostId, params.id, { event_type: "running-state", running_state: "started" });
327
- }
328
- return { error: "Task is already running" };
322
+ console.log(`[task.run] Task ${params.id} is already running, killing stale process`);
323
+ await platform.stopTask(params.id);
329
324
  }
330
325
  // Create initial result file so it appears in runs list immediately
331
326
  const runTask = parseTaskFile(runTaskDir);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "palmier",
3
- "version": "0.6.5",
3
+ "version": "0.6.6",
4
4
  "description": "Palmier host CLI - provisions, executes tasks, and serves NATS RPC",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Hongxu Cai",
@@ -15,6 +15,7 @@ import { Cursor } from "./cursor.js";
15
15
  import { Kiro } from "./kiro.js";
16
16
  import { Cline } from "./cline.js";
17
17
  import { Qoder } from "./qoder.js";
18
+ import { Hermes } from "./hermes.js";
18
19
 
19
20
  export interface CommandLine {
20
21
  command: string;
@@ -65,6 +66,7 @@ const agentRegistry: Record<string, AgentTool> = {
65
66
  kiro: new Kiro(),
66
67
  cline: new Cline(),
67
68
  qoder: new Qoder(),
69
+ hermes: new Hermes(),
68
70
  };
69
71
 
70
72
  const agentLabels: Record<string, string> = {
@@ -81,9 +83,10 @@ const agentLabels: Record<string, string> = {
81
83
  deepagents: "Deep Agents CLI",
82
84
  aider: "Aider",
83
85
  cursor: "Cursor CLI",
84
- kiro: "Kiro",
85
- cline: "Cline",
86
- qoder: "Qoder",
86
+ kiro: "Kiro CLI",
87
+ cline: "Cline CLI",
88
+ qoder: "Qoder CLI",
89
+ hermes: "Hermes Agent",
87
90
  };
88
91
 
89
92
  export interface DetectedAgent {
@@ -0,0 +1,38 @@
1
+ import type { ParsedTask, RequiredPermission } from "../types.js";
2
+ import { execSync } from "child_process";
3
+ import type { AgentTool, CommandLine } from "./agent.js";
4
+ import { getAgentInstructions } from "./shared-prompt.js";
5
+ import { SHELL } from "../platform/index.js";
6
+
7
+ export class Hermes implements AgentTool {
8
+ supportsPermissions = false;
9
+ getPlanGenerationCommandLine(prompt: string): CommandLine {
10
+ return {
11
+ command: "hermes",
12
+ args: ["chat", "-q", prompt],
13
+ };
14
+ }
15
+
16
+ getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine {
17
+ const yolo = extraPermissions === "yolo";
18
+ const prompt = followupPrompt ?? (getAgentInstructions(task.frontmatter.id, yolo || !this.supportsPermissions) + "\n\n" + (task.body || task.frontmatter.user_prompt));
19
+ const args = ["chat"];
20
+
21
+ if (yolo) {
22
+ args.push("--trust-all-tools");
23
+ }
24
+ if (followupPrompt) {args.push("--continue");} // continue mode for followups
25
+ args.push("-q", prompt);
26
+
27
+ return { command: "hermes", args};
28
+ }
29
+
30
+ async init(): Promise<boolean> {
31
+ try {
32
+ execSync("hermes --version", { stdio: "ignore", shell: SHELL });
33
+ } catch {
34
+ return false;
35
+ }
36
+ return true;
37
+ }
38
+ }
@@ -382,15 +382,10 @@ export function createRpcHandler(config: HostConfig, nc?: NatsConnection) {
382
382
  const runTaskDir = getTaskDir(config.projectRoot, params.id);
383
383
  const platform = getPlatform();
384
384
 
385
- // Check if the task is already running
385
+ // If the task is already running, kill the stale process and start fresh
386
386
  if (platform.isTaskRunning(params.id)) {
387
- // Ensure status reflects reality
388
- const currentStatus = readTaskStatus(runTaskDir);
389
- if (currentStatus?.running_state !== "started") {
390
- writeTaskStatus(runTaskDir, { running_state: "started", time_stamp: Date.now() });
391
- await publishHostEvent(nc, config.hostId, params.id, { event_type: "running-state", running_state: "started" });
392
- }
393
- return { error: "Task is already running" };
387
+ console.log(`[task.run] Task ${params.id} is already running, killing stale process`);
388
+ await platform.stopTask(params.id);
394
389
  }
395
390
 
396
391
  // Create initial result file so it appears in runs list immediately