palmier 0.9.29 → 0.9.30
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/command-runners.js
CHANGED
|
@@ -49,6 +49,7 @@ function spawnRunner(config, taskId, command) {
|
|
|
49
49
|
rl.on("line", (line) => {
|
|
50
50
|
if (!line.trim())
|
|
51
51
|
return;
|
|
52
|
+
console.log(`[command-runner] ${taskId} stdout line (${line.length} chars): ${line.slice(0, 100)}`);
|
|
52
53
|
dispatchTrigger(taskId, line);
|
|
53
54
|
});
|
|
54
55
|
child.stderr?.on("data", (d) => process.stderr.write(d));
|
package/dist/event-queues.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ 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;
|
|
23
24
|
/** Drop a stranded active flag so a fresh run can be launched (watchdog only). */
|
|
24
25
|
export declare function resetActiveRun(taskId: string): void;
|
|
25
26
|
/** Re-acquire the active flag without enqueuing (watchdog relaunch only). */
|
package/dist/event-queues.js
CHANGED
|
@@ -37,6 +37,9 @@ 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
|
+
}
|
|
40
43
|
/** Drop a stranded active flag so a fresh run can be launched (watchdog only). */
|
|
41
44
|
export function resetActiveRun(taskId) {
|
|
42
45
|
activeRuns.delete(taskId);
|
package/dist/trigger-dispatch.js
CHANGED
|
@@ -10,14 +10,15 @@
|
|
|
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, resetActiveRun, markActiveRun } from "./event-queues.js";
|
|
13
|
+
import { enqueueEvent, hasPendingEvents, pendingCount, 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
|
-
|
|
18
|
+
console.log(`[trigger] ${taskId} requesting run start`);
|
|
19
|
+
getPlatform().startTask(taskId)
|
|
20
|
+
.then(() => console.log(`[trigger] ${taskId} run start request returned`))
|
|
21
|
+
.catch((err) => console.error(`[trigger] failed to start run for ${taskId}:`, err));
|
|
21
22
|
}
|
|
22
23
|
function armWatchdog(taskId) {
|
|
23
24
|
const existing = watchdogs.get(taskId);
|
|
@@ -45,6 +46,7 @@ function watchdogTick(taskId) {
|
|
|
45
46
|
/** Enqueue a trigger payload and ensure a run is (or will be) draining it. */
|
|
46
47
|
export function dispatchTrigger(taskId, payload) {
|
|
47
48
|
const { shouldStart } = enqueueEvent(taskId, payload);
|
|
49
|
+
console.log(`[trigger] ${taskId} enqueued (shouldStart=${shouldStart}, pending=${pendingCount(taskId)})`);
|
|
48
50
|
if (shouldStart)
|
|
49
51
|
startRun(taskId);
|
|
50
52
|
armWatchdog(taskId);
|