palmier 0.1.6 → 0.1.7

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.
package/README.md CHANGED
@@ -63,7 +63,10 @@ cat ~/.config/palmier/agent.json
63
63
  ## How It Works
64
64
 
65
65
  - The agent runs as a **systemd user service**, staying alive in the background.
66
- - Incoming tasks from the platform are stored as `TASK.md` files in a local `tasks/` directory.
66
+ - The persistent process (`palmier serve`) is a NATS RPC handler. It derives the RPC method from the NATS subject (e.g., `...rpc.task.create` `task.create`) and treats the message body as request parameters.
67
+ - **Task IDs** are generated by the agent as UUIDs.
68
+ - All RPC responses (`task.list`, `task.create`, `task.update`) return **flat task objects** — frontmatter fields at the top level, not nested under a `frontmatter` key.
69
+ - Incoming tasks are stored as `TASK.md` files in a local `tasks/` directory.
67
70
  - Task execution spawns **Claude Code in a PTY**, giving the AI full CLI access within the project.
68
71
  - **Hooks** intercept Claude Code permission, confirmation, and input prompts, resolving them remotely via NATS KV so tasks can run unattended.
69
72
 
@@ -1,3 +1,4 @@
1
+ import { randomUUID } from "crypto";
1
2
  import { execSync } from "child_process";
2
3
  import * as fs from "fs";
3
4
  import { StringCodec } from "nats";
@@ -75,9 +76,6 @@ export async function serveCommand() {
75
76
  msg.respond(sc.encode(JSON.stringify(response)));
76
77
  }
77
78
  }
78
- function toKebab(str) {
79
- return str.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
80
- }
81
79
  function flattenTask(task, status) {
82
80
  return { ...task.frontmatter, body: task.body, ...(status != null ? { status } : {}) };
83
81
  }
@@ -91,7 +89,7 @@ export async function serveCommand() {
91
89
  }
92
90
  case "task.create": {
93
91
  const params = request.params;
94
- const id = toKebab(params.name);
92
+ const id = randomUUID();
95
93
  const taskDir = getTaskDir(config.projectRoot, id);
96
94
  const task = {
97
95
  frontmatter: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "palmier",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Palmier agent CLI - provisions, executes tasks, and serves NATS RPC",
5
5
  "license": "ISC",
6
6
  "author": "Hongxu Cai",
@@ -1,3 +1,4 @@
1
+ import { randomUUID } from "crypto";
1
2
  import { execSync } from "child_process";
2
3
  import * as fs from "fs";
3
4
  import { StringCodec } from "nats";
@@ -86,10 +87,6 @@ export async function serveCommand(): Promise<void> {
86
87
  }
87
88
  }
88
89
 
89
- function toKebab(str: string): string {
90
- return str.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
91
- }
92
-
93
90
  function flattenTask(task: ParsedTask, status?: unknown) {
94
91
  return { ...task.frontmatter, body: task.body, ...(status != null ? { status } : {}) };
95
92
  }
@@ -116,7 +113,7 @@ export async function serveCommand(): Promise<void> {
116
113
  body?: string;
117
114
  };
118
115
 
119
- const id = toKebab(params.name);
116
+ const id = randomUUID();
120
117
  const taskDir = getTaskDir(config.projectRoot, id);
121
118
  const task = {
122
119
  frontmatter: {