@awak-app/simy-cli 0.7.47 → 0.7.48
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/package.json
CHANGED
package/src/cli-contract.js
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "./durable-local-task-steps-contract.js";
|
|
15
15
|
import { buildExecutionCapabilityContract } from "./execution-capability-contract.js";
|
|
16
16
|
|
|
17
|
-
export const CLI_VERSION = "0.7.
|
|
17
|
+
export const CLI_VERSION = "0.7.48";
|
|
18
18
|
export const CLI_API_CONTRACT_VERSION = 10;
|
|
19
19
|
|
|
20
20
|
export function narrativeImageCapabilityMetadata() {
|
|
@@ -691,6 +691,23 @@ export function createManagedSupervisor(options) {
|
|
|
691
691
|
// Continue actual task work and its result checks. Starting an unrelated
|
|
692
692
|
// periodic audit here could acquire a lease that prevents that work.
|
|
693
693
|
if (!running) running = (async () => {
|
|
694
|
+
// Share cancellation discovery within this offered batch, never its
|
|
695
|
+
// authority: reconciliation still reads each current record. Long-lived
|
|
696
|
+
// queued jobs refresh at the desktop's 3s maintenance cadence; new ticks
|
|
697
|
+
// also replace their queued observations. Failed reads remain retryable.
|
|
698
|
+
let cancellationCandidates, cancellationReadAt;
|
|
699
|
+
const readCancellationRecords = () => {
|
|
700
|
+
const age = Date.now() - cancellationReadAt;
|
|
701
|
+
if (!cancellationCandidates || !(age >= 0 && age < 3000)) {
|
|
702
|
+
cancellationReadAt = Date.now();
|
|
703
|
+
const pending = Promise.resolve()
|
|
704
|
+
.then(() => options.readCancellationRecords ? options.readCancellationRecords() : listRecords(options.root))
|
|
705
|
+
.then(records => records.filter(record => record.run?.managed?.nativeHandoff));
|
|
706
|
+
cancellationCandidates = pending;
|
|
707
|
+
void pending.catch(() => { if (cancellationCandidates === pending) cancellationCandidates = null; });
|
|
708
|
+
}
|
|
709
|
+
return cancellationCandidates;
|
|
710
|
+
};
|
|
694
711
|
for (const record of await readCandidates()) {
|
|
695
712
|
if (closed || await options.shouldYield?.()) break;
|
|
696
713
|
if (!record.run?.managed) continue;
|
|
@@ -707,7 +724,7 @@ export function createManagedSupervisor(options) {
|
|
|
707
724
|
return rows.filter(row => row?.provider === record.provider && row.session === record.session &&
|
|
708
725
|
row.run?.id === record.run.id && row.run?.managed?.taskId === record.run.managed.taskId);
|
|
709
726
|
};
|
|
710
|
-
await tickManagedTasks({ ...options, readRecords, signal: controller.signal });
|
|
727
|
+
await tickManagedTasks({ ...options, readRecords, readCancellationRecords, signal: controller.signal });
|
|
711
728
|
});
|
|
712
729
|
}
|
|
713
730
|
})().finally(() => { running = null; });
|
package/src/desktop-host.js
CHANGED
|
@@ -1053,7 +1053,7 @@ export async function startDesktopHost({ input = process.stdin, output = process
|
|
|
1053
1053
|
setImmediate(() => { void publish().catch(() => {}); });
|
|
1054
1054
|
} },
|
|
1055
1055
|
});
|
|
1056
|
-
// Batch burst notifications and
|
|
1056
|
+
// Batch burst notifications and heartbeat/status requests into one frame. The
|
|
1057
1057
|
// short window leaves commands responsive and the regular heartbeat intact.
|
|
1058
1058
|
const publish = () => {
|
|
1059
1059
|
if (closed || relay || !agent) return Promise.resolve();
|
|
@@ -1544,7 +1544,11 @@ export async function startDesktopHost({ input = process.stdin, output = process
|
|
|
1544
1544
|
const maintenance = new Map();
|
|
1545
1545
|
const tick = worker => {
|
|
1546
1546
|
if (closed || relay || !coordinator.acceptsNewWork() || maintenance.has(worker)) return;
|
|
1547
|
-
|
|
1547
|
+
// The existing heartbeat publishes completed background maintenance.
|
|
1548
|
+
// Completion itself does not prove a visible change; after the short
|
|
1549
|
+
// batching window it otherwise reprojects/repaints the entire history.
|
|
1550
|
+
// Explicit commands and actual change notifications keep their live path.
|
|
1551
|
+
const pending = Promise.resolve().then(() => worker.tick()).catch(() => {}).finally(() => maintenance.delete(worker));
|
|
1548
1552
|
maintenance.set(worker, pending);
|
|
1549
1553
|
};
|
|
1550
1554
|
tick(actionAssociations);
|