palmier 0.6.3 → 0.6.4

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
@@ -113,36 +113,6 @@ The daemon automatically recovers existing tasks by reinstalling their system ti
113
113
 
114
114
  Agents are re-detected on every daemon start. Run `palmier restart` after installing or removing a CLI.
115
115
 
116
- ### Verifying the Service
117
-
118
- After `palmier init`, verify the host is running:
119
-
120
- **Linux:**
121
-
122
- ```bash
123
- # Check service status
124
- systemctl --user status palmier.service
125
-
126
- # View recent logs
127
- journalctl --user -u palmier.service -n 50 --no-pager
128
-
129
- # Follow logs in real time
130
- journalctl --user -u palmier.service -f
131
- ```
132
-
133
- **Windows (PowerShell):**
134
-
135
- ```powershell
136
- # Check if the daemon is running
137
- Get-Process -Name node -ErrorAction SilentlyContinue | Where-Object { $_.CommandLine -like '*palmier*serve*' }
138
- ```
139
-
140
- **Restarting the daemon (both platforms):**
141
-
142
- ```bash
143
- palmier restart
144
- ```
145
-
146
116
  ## CLI Reference
147
117
 
148
118
  | Command | Description |
@@ -14,8 +14,8 @@ task_name: <concise label, 3-6 words>
14
14
 
15
15
  - Write a numbered sequence of concrete, actionable steps.
16
16
  - If the task produces formatted output (report, email, summary, etc.), specify the structure, sections, and tone.
17
- - When a step requires user input, simply state what information is needed from the user. Do not specify how to obtain it — the agent has its own tool for requesting user input.
18
- - Relative times in the task description (e.g., "today", "yesterday", "last week") refer to execution time, not plan generation time. Keep them as-is in the plan do not convert them to specific dates.
17
+ - When a step requires user input, simply state what information is needed from the user. Do **not** specify how to obtain it — the agent has its own tool for requesting user input.
18
+ - Preserve relative time expressions (e.g., "today", "yesterday", "last week") exactly as written do **not** resolve them to specific dates. The plan may be executed on a different day than it was generated.
19
19
 
20
20
  ## Task Description
21
21
 
@@ -342,7 +342,12 @@ async function runCommandTriggeredMode(ctx) {
342
342
  invocationsFailed++;
343
343
  });
344
344
  });
345
- child.stderr?.on("data", (d) => process.stderr.write(d));
345
+ let stderrBuf = "";
346
+ child.stderr?.on("data", (d) => {
347
+ const chunk = d.toString();
348
+ stderrBuf += chunk;
349
+ process.stderr.write(d);
350
+ });
346
351
  // Wait for command to exit
347
352
  const exitCode = await new Promise((resolve) => {
348
353
  child.on("close", (code) => {
@@ -352,6 +357,7 @@ async function runCommandTriggeredMode(ctx) {
352
357
  });
353
358
  child.on("error", (err) => {
354
359
  console.error(`[command-triggered] Command error:`, err);
360
+ stderrBuf += err.message;
355
361
  commandExited = true;
356
362
  rl.close();
357
363
  resolve(1);
@@ -365,6 +371,17 @@ async function runCommandTriggeredMode(ctx) {
365
371
  });
366
372
  }
367
373
  const endTime = Date.now();
374
+ if (exitCode !== 0) {
375
+ const errorDetail = stderrBuf.trim() || `Command exited with code ${exitCode}`;
376
+ appendRunMessage(ctx.taskDir, ctx.runId, {
377
+ role: "status",
378
+ time: endTime,
379
+ content: errorDetail,
380
+ type: "error",
381
+ });
382
+ await publishHostEvent(ctx.nc, ctx.config.hostId, ctx.taskId, { event_type: "result-updated", run_id: ctx.runId });
383
+ return { outcome: "failed", endTime };
384
+ }
368
385
  return { outcome: "finished", endTime };
369
386
  }
370
387
  async function publishTaskEvent(nc, config, taskDir, taskId, eventType, taskName, runId) {
package/dist/types.d.ts CHANGED
@@ -62,7 +62,7 @@ export interface ConversationMessage {
62
62
  role: "assistant" | "user" | "status";
63
63
  time: number;
64
64
  content: string;
65
- type?: "input" | "permission" | "confirmation" | "monitoring" | "started" | "finished" | "failed" | "aborted" | "stopped";
65
+ type?: "input" | "permission" | "confirmation" | "monitoring" | "started" | "finished" | "failed" | "aborted" | "stopped" | "error";
66
66
  attachments?: string[];
67
67
  }
68
68
  export interface RpcMessage {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "palmier",
3
- "version": "0.6.3",
3
+ "version": "0.6.4",
4
4
  "description": "Palmier host CLI - provisions, executes tasks, and serves NATS RPC",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Hongxu Cai",
@@ -14,8 +14,8 @@ task_name: <concise label, 3-6 words>
14
14
 
15
15
  - Write a numbered sequence of concrete, actionable steps.
16
16
  - If the task produces formatted output (report, email, summary, etc.), specify the structure, sections, and tone.
17
- - When a step requires user input, simply state what information is needed from the user. Do not specify how to obtain it — the agent has its own tool for requesting user input.
18
- - Relative times in the task description (e.g., "today", "yesterday", "last week") refer to execution time, not plan generation time. Keep them as-is in the plan do not convert them to specific dates.
17
+ - When a step requires user input, simply state what information is needed from the user. Do **not** specify how to obtain it — the agent has its own tool for requesting user input.
18
+ - Preserve relative time expressions (e.g., "today", "yesterday", "last week") exactly as written do **not** resolve them to specific dates. The plan may be executed on a different day than it was generated.
19
19
 
20
20
  ## Task Description
21
21
 
@@ -411,7 +411,12 @@ async function runCommandTriggeredMode(
411
411
  });
412
412
  });
413
413
 
414
- child.stderr?.on("data", (d: Buffer) => process.stderr.write(d));
414
+ let stderrBuf = "";
415
+ child.stderr?.on("data", (d: Buffer) => {
416
+ const chunk = d.toString();
417
+ stderrBuf += chunk;
418
+ process.stderr.write(d);
419
+ });
415
420
 
416
421
  // Wait for command to exit
417
422
  const exitCode = await new Promise<number | null>((resolve) => {
@@ -422,6 +427,7 @@ async function runCommandTriggeredMode(
422
427
  });
423
428
  child.on("error", (err: Error) => {
424
429
  console.error(`[command-triggered] Command error:`, err);
430
+ stderrBuf += err.message;
425
431
  commandExited = true;
426
432
  rl.close();
427
433
  resolve(1);
@@ -437,6 +443,19 @@ async function runCommandTriggeredMode(
437
443
  }
438
444
 
439
445
  const endTime = Date.now();
446
+
447
+ if (exitCode !== 0) {
448
+ const errorDetail = stderrBuf.trim() || `Command exited with code ${exitCode}`;
449
+ appendRunMessage(ctx.taskDir, ctx.runId, {
450
+ role: "status",
451
+ time: endTime,
452
+ content: errorDetail,
453
+ type: "error",
454
+ });
455
+ await publishHostEvent(ctx.nc, ctx.config.hostId, ctx.taskId, { event_type: "result-updated", run_id: ctx.runId });
456
+ return { outcome: "failed", endTime };
457
+ }
458
+
440
459
  return { outcome: "finished", endTime };
441
460
  }
442
461
 
package/src/types.ts CHANGED
@@ -73,7 +73,7 @@ export interface ConversationMessage {
73
73
  role: "assistant" | "user" | "status";
74
74
  time: number;
75
75
  content: string;
76
- type?: "input" | "permission" | "confirmation" | "monitoring" | "started" | "finished" | "failed" | "aborted" | "stopped";
76
+ type?: "input" | "permission" | "confirmation" | "monitoring" | "started" | "finished" | "failed" | "aborted" | "stopped" | "error";
77
77
  attachments?: string[];
78
78
  }
79
79