palmier 0.9.30 → 0.9.31
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/dist/commands/run.js
CHANGED
|
@@ -285,6 +285,9 @@ async function runEventTriggeredMode(ctx) {
|
|
|
285
285
|
break;
|
|
286
286
|
eventsProcessed++;
|
|
287
287
|
console.log(`[triggered] Processing ${label} #${eventsProcessed}`);
|
|
288
|
+
// Show the triggering input on the user's side before the agent responds,
|
|
289
|
+
// mirroring the regular task view (prompt, then agent output).
|
|
290
|
+
await appendAndNotify(ctx, { role: "user", time: Date.now(), content: body.event });
|
|
288
291
|
const perEventPrompt = isCommand
|
|
289
292
|
? `${ctx.task.frontmatter.user_prompt}\n\nProcess this input:\n${body.event}`
|
|
290
293
|
: `${ctx.task.frontmatter.user_prompt}\n\nProcess this new ${label}:\n${body.event}`;
|
package/dist/commands/serve.js
CHANGED
|
@@ -16,6 +16,7 @@ import { addNotification } from "../notification-store.js";
|
|
|
16
16
|
import { addSmsMessage } from "../sms-store.js";
|
|
17
17
|
import { dispatchTrigger } from "../trigger-dispatch.js";
|
|
18
18
|
import { startEnabledCommandRunners } from "../command-runners.js";
|
|
19
|
+
import { currentVersion } from "../update-checker.js";
|
|
19
20
|
const POLL_INTERVAL_MS = 30_000;
|
|
20
21
|
const DAEMON_PID_FILE = path.join(CONFIG_DIR, "daemon.pid");
|
|
21
22
|
/**
|
|
@@ -98,7 +99,7 @@ export async function serveCommand() {
|
|
|
98
99
|
const config = loadConfig();
|
|
99
100
|
// PID file lets `palmier restart` find us regardless of how we were started
|
|
100
101
|
fs.writeFileSync(DAEMON_PID_FILE, String(process.pid), "utf-8");
|
|
101
|
-
console.log(
|
|
102
|
+
console.log(`Starting Palmier daemon v${currentVersion}...`);
|
|
102
103
|
const agents = await detectAgents(config.agents);
|
|
103
104
|
config.agents = agents;
|
|
104
105
|
saveConfig(config);
|
package/dist/event-queues.d.ts
CHANGED
|
@@ -20,7 +20,6 @@ export declare function popEvent(taskId: string): {
|
|
|
20
20
|
empty: true;
|
|
21
21
|
};
|
|
22
22
|
export declare function hasPendingEvents(taskId: string): boolean;
|
|
23
|
-
export declare function pendingCount(taskId: string): number;
|
|
24
23
|
/** Drop a stranded active flag so a fresh run can be launched (watchdog only). */
|
|
25
24
|
export declare function resetActiveRun(taskId: string): void;
|
|
26
25
|
/** Re-acquire the active flag without enqueuing (watchdog relaunch only). */
|
package/dist/event-queues.js
CHANGED
|
@@ -37,9 +37,6 @@ export function hasPendingEvents(taskId) {
|
|
|
37
37
|
const queue = queues.get(taskId);
|
|
38
38
|
return !!queue && queue.length > 0;
|
|
39
39
|
}
|
|
40
|
-
export function pendingCount(taskId) {
|
|
41
|
-
return queues.get(taskId)?.length ?? 0;
|
|
42
|
-
}
|
|
43
40
|
/** Drop a stranded active flag so a fresh run can be launched (watchdog only). */
|
|
44
41
|
export function resetActiveRun(taskId) {
|
|
45
42
|
activeRuns.delete(taskId);
|
package/dist/trigger-dispatch.js
CHANGED
|
@@ -10,15 +10,14 @@
|
|
|
10
10
|
* detects "work queued but no live run" shortly after triggers quiesce and
|
|
11
11
|
* relaunches. High-frequency sources (commands) would otherwise wedge fast.
|
|
12
12
|
*/
|
|
13
|
-
import { enqueueEvent, hasPendingEvents,
|
|
13
|
+
import { enqueueEvent, hasPendingEvents, resetActiveRun, markActiveRun } from "./event-queues.js";
|
|
14
14
|
import { getPlatform } from "./platform/index.js";
|
|
15
15
|
const WATCHDOG_MS = 3000;
|
|
16
16
|
const watchdogs = new Map();
|
|
17
17
|
function startRun(taskId) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
.catch((err) => console.error(`[trigger] failed to start run for ${taskId}:`, err));
|
|
18
|
+
getPlatform().startTask(taskId).catch((err) => {
|
|
19
|
+
console.error(`[trigger] failed to start run for ${taskId}:`, err);
|
|
20
|
+
});
|
|
22
21
|
}
|
|
23
22
|
function armWatchdog(taskId) {
|
|
24
23
|
const existing = watchdogs.get(taskId);
|
|
@@ -46,7 +45,6 @@ function watchdogTick(taskId) {
|
|
|
46
45
|
/** Enqueue a trigger payload and ensure a run is (or will be) draining it. */
|
|
47
46
|
export function dispatchTrigger(taskId, payload) {
|
|
48
47
|
const { shouldStart } = enqueueEvent(taskId, payload);
|
|
49
|
-
console.log(`[trigger] ${taskId} enqueued (shouldStart=${shouldStart}, pending=${pendingCount(taskId)})`);
|
|
50
48
|
if (shouldStart)
|
|
51
49
|
startRun(taskId);
|
|
52
50
|
armWatchdog(taskId);
|