palmier 1.1.20 → 1.1.21
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 +1 -1
- package/dist/agents/agent.d.ts +1 -1
- package/dist/commands/init.js +2 -0
- package/dist/commands/run.js +16 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -182,7 +182,7 @@ The wizard:
|
|
|
182
182
|
- Offers to install the **Playwright CLI** for browser automation (see [Browser Automation](#browser-automation)). Skipped on re-init if it's already managed.
|
|
183
183
|
- Asks for the HTTP port
|
|
184
184
|
- Detects the default network interface (used for auto-LAN)
|
|
185
|
-
- Shows a summary (including any existing scheduled tasks to recover) and asks for confirmation
|
|
185
|
+
- Shows a summary (including the Palmier daemon version and any existing scheduled tasks to recover) and asks for confirmation
|
|
186
186
|
- Registers with the Palmier server, saves configuration to `~/.config/palmier/host.json`
|
|
187
187
|
- Installs a background daemon (systemd user service on Linux, LaunchAgent on macOS, Task Scheduler on Windows). On re-init, also restarts the daemon so the running process picks up the new agents/versions for `host.info`.
|
|
188
188
|
- Auto-enters pair mode to connect your first device
|
package/dist/agents/agent.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export interface AgentTool {
|
|
|
30
30
|
supportsPermissions?: boolean;
|
|
31
31
|
/** Whether this agent supports yolo mode (auto-approve all tools). */
|
|
32
32
|
supportsYolo?: boolean;
|
|
33
|
-
/** When true, the run loop
|
|
33
|
+
/** When true, the run loop persists the agent's stderr output only if the invocation fails. */
|
|
34
34
|
suppressStdErr?: boolean;
|
|
35
35
|
/** Matches the model name (capture group 1) in the banner the CLI prints on stderr.
|
|
36
36
|
* Takes precedence over the agent's self-reported model marker. */
|
package/dist/commands/init.js
CHANGED
|
@@ -10,6 +10,7 @@ import { getPlatform } from "../platform/index.js";
|
|
|
10
10
|
import { pairCommand } from "./pair.js";
|
|
11
11
|
import { detectDefaultInterface, getInterfaceIpv4 } from "../network.js";
|
|
12
12
|
import { listTasks, taskDisplayName } from "../task.js";
|
|
13
|
+
import { currentVersion } from "../update-checker.js";
|
|
13
14
|
const { bold, dim, green, cyan, red } = colors;
|
|
14
15
|
export async function initCommand() {
|
|
15
16
|
console.log(`\n${bold("=== Palmier Host Setup ===")}\n`);
|
|
@@ -74,6 +75,7 @@ export async function initCommand() {
|
|
|
74
75
|
const defaultInterface = (await detectDefaultInterface()) ?? undefined;
|
|
75
76
|
const lanIp = defaultInterface ? getInterfaceIpv4(defaultInterface) : null;
|
|
76
77
|
console.log(`\n${bold("Setup summary:")}\n`);
|
|
78
|
+
console.log(` ${dim("Daemon:")} Palmier v${currentVersion}\n`);
|
|
77
79
|
console.log(` ${dim("Task storage:")} ${bold(projectRoot)}`);
|
|
78
80
|
console.log(` All tasks and execution data will be stored here.\n`);
|
|
79
81
|
console.log(` ${dim("Local:")} ${cyan(`http://localhost:${httpPort}`)}`);
|
package/dist/commands/run.js
CHANGED
|
@@ -19,6 +19,7 @@ async function invokeAgentWithRetries(ctx, invokeTask) {
|
|
|
19
19
|
let writer;
|
|
20
20
|
let activeStream;
|
|
21
21
|
const lineBufs = { stdout: "", stderr: "" };
|
|
22
|
+
let suppressedStderr = "";
|
|
22
23
|
let notifyPending = false;
|
|
23
24
|
let notifyTimer;
|
|
24
25
|
let agentModel;
|
|
@@ -50,7 +51,9 @@ async function invokeAgentWithRetries(ctx, invokeTask) {
|
|
|
50
51
|
throttledNotify();
|
|
51
52
|
}
|
|
52
53
|
function onStderr(chunk) {
|
|
53
|
-
if (
|
|
54
|
+
if (ctx.agent.suppressStdErr)
|
|
55
|
+
suppressedStderr += chunk;
|
|
56
|
+
else
|
|
54
57
|
emit("stderr", chunk);
|
|
55
58
|
const cliModel = captureCliModel(chunk);
|
|
56
59
|
if (cliModel && !agentModelWritten)
|
|
@@ -71,6 +74,12 @@ async function invokeAgentWithRetries(ctx, invokeTask) {
|
|
|
71
74
|
}
|
|
72
75
|
flushAgentModel();
|
|
73
76
|
}
|
|
77
|
+
function flushTrailingLine(stream) {
|
|
78
|
+
const trailing = lineBufs[stream];
|
|
79
|
+
if (trailing && !trailing.startsWith("[PALMIER")) {
|
|
80
|
+
ensureWriter(stream).write(trailing);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
74
83
|
const { args, stdin, env: agentEnv, files } = ctx.agent.getTaskRunCommandLine(invokeTask, undefined, ctx.task.frontmatter.yolo_mode ? "yolo" : ctx.transientPermissions);
|
|
75
84
|
const command = ctx.agent.command;
|
|
76
85
|
const runDir = getRunDir(ctx.taskDir, ctx.runId);
|
|
@@ -87,21 +96,19 @@ async function invokeAgentWithRetries(ctx, invokeTask) {
|
|
|
87
96
|
onStdout: (chunk) => emit("stdout", chunk),
|
|
88
97
|
onStderr,
|
|
89
98
|
});
|
|
90
|
-
if (notifyTimer)
|
|
91
|
-
clearTimeout(notifyTimer);
|
|
92
99
|
const outcome = result.exitCode !== 0 ? "failed" : parseTaskOutcome(result.output);
|
|
93
100
|
const linkedFiles = listLinkedTaskFiles(ctx.taskDir, ctx.runId, result.output);
|
|
94
101
|
const requiredPermissions = parsePermissions(result.output);
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
}
|
|
102
|
+
flushTrailingLine("stdout");
|
|
103
|
+
if (outcome === "failed")
|
|
104
|
+
emit("stderr", suppressedStderr);
|
|
105
|
+
flushTrailingLine("stderr");
|
|
101
106
|
if (requiredPermissions.length > 0) {
|
|
102
107
|
const permLines = requiredPermissions.map((p) => `- **${p.name}** ${p.description}`).join("\n");
|
|
103
108
|
ensureWriter("stdout").write(`\n\n**Permissions requested:**\n${permLines}\n`);
|
|
104
109
|
}
|
|
110
|
+
if (notifyTimer)
|
|
111
|
+
clearTimeout(notifyTimer);
|
|
105
112
|
writer?.end();
|
|
106
113
|
await publishHostEvent(ctx.taskId, { event_type: "result-updated", run_id: ctx.runId });
|
|
107
114
|
if (linkedFiles.length > 0) {
|