@awak-app/simy-cli 0.6.13 → 0.6.17
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 +91 -6
- package/package.json +1 -1
- package/src/agent.js +97 -23
- package/src/auto-update.js +55 -6
- package/src/cli-contract.js +1 -1
- package/src/codex-plugins/simy/hooks/connection-reminder.mjs +5 -2
- package/src/codex-plugins/simy/hooks/delivery-loop.mjs +30 -3
- package/src/codex-plugins/simy/hooks/dev-work.mjs +7 -1
- package/src/codex-plugins/simy/hooks/hooks.json +2 -2
- package/src/codex-work-pattern-sync.js +37 -9
- package/src/delivery-hooks/command.js +9 -2
- package/src/delivery-hooks/desktop.js +10 -12
- package/src/delivery-hooks/evidence.js +50 -0
- package/src/delivery-hooks/supervisor.js +8 -2
- package/src/desktop-access.js +5 -3
- package/src/desktop-host.js +511 -74
- package/src/desktop-update-stop.js +22 -0
- package/src/doctor.js +2 -1
- package/src/host-exit-diagnostics.js +28 -0
- package/src/index.js +1 -0
- package/src/provider-links.js +74 -0
- package/src/session-supervision/action-association-host.js +23 -10
- package/src/session-supervision/association-refresh.js +12 -0
- package/src/session-supervision/association-store.js +26 -10
- package/src/session-supervision/automatic-continuation.js +31 -2
- package/src/session-supervision/claude-sessions.js +25 -15
- package/src/session-supervision/codex-app-server.js +27 -4
- package/src/session-supervision/index.js +163 -42
- package/src/session-supervision/statistics.js +76 -15
- package/src/sqm/command.js +58 -7
- package/src/sqm/evidence-client.js +11 -1
- package/src/sqm/failure-circuit.js +28 -6
- package/src/sqm/history-store.js +49 -18
- package/src/sqm/provider-diagnostics.js +1 -0
- package/src/sqm/review-worker.js +70 -21
- package/src/sqm/workflow-update.js +12 -3
- package/src/windows-desktop-updater.js +6 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { setTimeout as delay } from "node:timers/promises";
|
|
1
2
|
import { mkdir, readFile, realpath, rm, stat } from "node:fs/promises";
|
|
2
3
|
import { homedir } from "node:os";
|
|
3
4
|
import path from "node:path";
|
|
@@ -36,6 +37,7 @@ export async function syncInstalledWorkflows({ home = homedir(), installMissing
|
|
|
36
37
|
claudeHome = process.env.CLAUDE_CONFIG_DIR || path.join(home, ".claude"),
|
|
37
38
|
inspect = inspectSqmAgentSkill, install = installSqmAgentSkill,
|
|
38
39
|
resolveExecutable = resolveBackendExecutable, run = runProviderCommand,
|
|
40
|
+
lockWaitMs = 0, wait = delay, now = Date.now,
|
|
39
41
|
} = {}) {
|
|
40
42
|
// Multiple daemons may share the same installation. Serialize updates and recover
|
|
41
43
|
// an abandoned lock after more than the bounded Codex command timeouts.
|
|
@@ -44,9 +46,16 @@ export async function syncInstalledWorkflows({ home = homedir(), installMissing
|
|
|
44
46
|
try {
|
|
45
47
|
if (Date.now() - (await stat(lock)).mtimeMs > 5 * 60 * 1000) await rm(lock, { recursive: true, force: true });
|
|
46
48
|
} catch (error) { if (error.code !== "ENOENT") throw error; }
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
const deadline = now() + (Number.isFinite(lockWaitMs) ? Math.max(0, Math.min(lockWaitMs, 30_000)) : 0);
|
|
50
|
+
for (;;) {
|
|
51
|
+
try { await mkdir(lock); break; } catch (error) {
|
|
52
|
+
if (error.code !== "EEXIST") throw error;
|
|
53
|
+
const remaining = deadline - now();
|
|
54
|
+
if (remaining <= 0) return { outcome: "busy" };
|
|
55
|
+
// Explicit setup can join an ongoing background update. Reinspect after
|
|
56
|
+
// acquiring the lock; a background update may not prepare missing sources.
|
|
57
|
+
await wait(Math.min(remaining, 250));
|
|
58
|
+
}
|
|
50
59
|
}
|
|
51
60
|
try {
|
|
52
61
|
const migrated = await retireLegacySqmGate({ home });
|
|
@@ -31,7 +31,12 @@ export function createWindowsDesktopUpdater({ version, fetchImpl = fetch, open =
|
|
|
31
31
|
} catch { update({ state: 'failed', message: 'Could not check for updates. Try again.', action: null }); }
|
|
32
32
|
return events.snapshot();
|
|
33
33
|
})().finally(() => { pending = null; });
|
|
34
|
-
events.performAction = async () => {
|
|
34
|
+
events.performAction = async () => {
|
|
35
|
+
if (state.action?.url) {
|
|
36
|
+
const result = await open(state.action.url);
|
|
37
|
+
if (result?.opened === false) throw new Error('Could not open the update installer download.');
|
|
38
|
+
} else await events.checkNow();
|
|
39
|
+
};
|
|
35
40
|
events.maybeApply = events.performAction;
|
|
36
41
|
events.beginWork = () => () => {};
|
|
37
42
|
events.acceptsNewWork = () => true;
|