@askexenow/exe-os 0.9.166 → 0.9.167
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/deploy/compose/backup.sh +45 -7
- package/deploy/compose/setup.sh +7 -0
- package/deploy/stack-manifests/v0.9.json +40 -1
- package/dist/{active-agent-R2KMWMR6.js → active-agent-DGTIJN2U.js} +2 -2
- package/dist/{active-agent-CYMM3QQA.js → active-agent-HVMLG6FH.js} +2 -2
- package/dist/{agentic-ontology-GKAKYNPE.js → agentic-ontology-S54AFODT.js} +1 -1
- package/dist/{backfill-metadata-Z5SYUWAV.js → backfill-metadata-74IWETRF.js} +4 -3
- package/dist/{behaviors-QGU6XI5R.js → behaviors-LZVAVHTC.js} +2 -2
- package/dist/bin/agentic-ontology-backfill.js +5 -4
- package/dist/bin/agentic-reflection-backfill.js +6 -5
- package/dist/bin/agentic-semantic-label.js +5 -4
- package/dist/bin/backfill-conversations.js +5 -4
- package/dist/bin/backfill-responses.js +5 -4
- package/dist/bin/backfill-vectors.js +6 -5
- package/dist/bin/bulk-sync-postgres.js +6 -5
- package/dist/bin/cleanup-stale-review-tasks.js +9 -9
- package/dist/bin/cli.js +16 -13
- package/dist/bin/daily-summary.js +0 -217
- package/dist/bin/deferred-daemon-restart.js +8 -0
- package/dist/bin/exe-agent-config.js +1 -1
- package/dist/bin/exe-agent.js +10 -10
- package/dist/bin/exe-assign.js +7 -6
- package/dist/bin/exe-boot.js +20 -19
- package/dist/bin/exe-call.js +4 -4
- package/dist/bin/exe-cloud.js +3 -3
- package/dist/bin/exe-dispatch.js +9 -9
- package/dist/bin/exe-doctor.js +1 -1
- package/dist/bin/exe-export-behaviors.js +7 -6
- package/dist/bin/exe-forget.js +6 -5
- package/dist/bin/exe-gateway.js +5 -5
- package/dist/bin/exe-heartbeat.js +9 -9
- package/dist/bin/exe-kill.js +13 -12
- package/dist/bin/exe-launch-agent.js +11 -10
- package/dist/bin/exe-new-employee.js +6 -6
- package/dist/bin/exe-pending-messages.js +10 -10
- package/dist/bin/exe-pending-notifications.js +9 -9
- package/dist/bin/exe-pending-reviews.js +9 -9
- package/dist/bin/exe-rename.js +4 -4
- package/dist/bin/exe-review.js +12 -11
- package/dist/bin/exe-search.js +5 -4
- package/dist/bin/exe-session-cleanup.js +19 -14
- package/dist/bin/exe-settings.js +3 -3
- package/dist/bin/exe-start-codex.js +11 -10
- package/dist/bin/exe-start-opencode.js +8 -7
- package/dist/bin/exe-status.js +10 -10
- package/dist/bin/exe-team.js +2 -2
- package/dist/bin/git-sweep.js +9 -9
- package/dist/bin/graph-backfill.js +4 -3
- package/dist/bin/graph-export.js +5 -4
- package/dist/bin/import-history.js +171 -0
- package/dist/bin/install-launchd.js +41 -0
- package/dist/bin/install.js +50 -74
- package/dist/bin/intercom-check.js +4 -4
- package/dist/bin/postgres-agentic-reflection-backfill.js +2 -2
- package/dist/bin/postgres-agentic-semantic-backfill.js +4 -4
- package/dist/bin/pre-publish.js +1 -1
- package/dist/bin/scan-tasks.js +22 -12
- package/dist/bin/setup.js +1 -1
- package/dist/bin/shard-migrate.js +4 -3
- package/dist/bin/stack-update.js +61 -857
- package/dist/bin/vps-backup.js +170 -0
- package/dist/bin/vps-health-gate.js +232 -0
- package/dist/{capacity-monitor-ZEAE4WP2.js → capacity-monitor-JBZB2S4P.js} +10 -10
- package/dist/{catchup-brief-OGWCHENC.js → catchup-brief-HE2EMZS5.js} +12 -11
- package/dist/{chunk-DJJNB47C.js → chunk-27DO3EZO.js} +1 -1
- package/dist/{chunk-45FYZIHI.js → chunk-32YUET3Y.js} +2 -2
- package/dist/{chunk-Y75ECPO5.js → chunk-3FW5LUGI.js} +2 -2
- package/dist/{chunk-4OZGQZ4U.js → chunk-3M3O56VT.js} +636 -179
- package/dist/{chunk-77WQOD6J.js → chunk-4CXUZ4NI.js} +2 -2
- package/dist/{chunk-PBXWPHEK.js → chunk-4VEHJZ6R.js} +1 -1
- package/dist/{chunk-TH22QIEC.js → chunk-6A4COFDG.js} +1 -1
- package/dist/{chunk-ACBTCC2L.js → chunk-7OJH2A6I.js} +1 -1
- package/dist/{chunk-NHCOTCI6.js → chunk-A7SGEBXJ.js} +2 -2
- package/dist/{chunk-5MPQSNZF.js → chunk-AUTCT6AY.js} +1 -1
- package/dist/{chunk-OEKSTOTE.js → chunk-AZAZ2C75.js} +1 -1
- package/dist/chunk-CHCA3ZM2.js +167 -0
- package/dist/{chunk-X347L57O.js → chunk-CSTJQDOE.js} +4 -3
- package/dist/{chunk-B234R3VW.js → chunk-D7WLV6WD.js} +2 -2
- package/dist/{chunk-GMXF3AHJ.js → chunk-DGAONW36.js} +1 -1
- package/dist/chunk-EAT5YL3W.js +229 -0
- package/dist/{chunk-OD4H5YCJ.js → chunk-EKTQE2R5.js} +8 -8
- package/dist/{chunk-Z44PC42G.js → chunk-ELUBA7XL.js} +2 -2
- package/dist/{chunk-ZWS6XQER.js → chunk-F5AKOE4P.js} +7 -7
- package/dist/{chunk-T5YULDDO.js → chunk-FVI4UBKO.js} +27 -4
- package/dist/{chunk-ESRI7MFI.js → chunk-GAN7PW6G.js} +28 -24
- package/dist/{chunk-K4OWYJSP.js → chunk-GM2WZTG3.js} +2 -2
- package/dist/{chunk-TAB5QGIK.js → chunk-GZYQTPTF.js} +3 -3
- package/dist/{chunk-CXDU5DE3.js → chunk-IAUNGATJ.js} +1 -1
- package/dist/{chunk-YS63NS6M.js → chunk-IHSM5GR4.js} +1 -1
- package/dist/{chunk-23PTS2ZD.js → chunk-IP7KJAUW.js} +117 -15
- package/dist/{chunk-D6IMJAV2.js → chunk-J64P2LB2.js} +2 -2
- package/dist/{chunk-CXAVSQZM.js → chunk-JXMSCKRM.js} +1 -1
- package/dist/{chunk-RQMK3IQH.js → chunk-K4OTJP6N.js} +14 -7
- package/dist/{chunk-L7ROZR2H.js → chunk-KXAUMIOX.js} +1 -1
- package/dist/{chunk-TPC3LAP7.js → chunk-LGY2BIOT.js} +13 -0
- package/dist/{chunk-RPIDSBK7.js → chunk-LLHRJEE4.js} +3 -3
- package/dist/{chunk-6WG2VIKC.js → chunk-LM7H6XU4.js} +1 -1
- package/dist/{chunk-Y6GMKZZ2.js → chunk-LOFFGJSY.js} +150 -23
- package/dist/{chunk-W7SDGBEC.js → chunk-MFI5OXYW.js} +52 -84
- package/dist/{chunk-KNPEVPYG.js → chunk-MSSQWF6X.js} +2 -2
- package/dist/{chunk-QIQAO3VG.js → chunk-NEFFFKMD.js} +3 -3
- package/dist/{chunk-YUC552KZ.js → chunk-NEHONJJC.js} +3 -3
- package/dist/{chunk-KZ7SXZ2V.js → chunk-NFMQRLCD.js} +1 -1
- package/dist/{chunk-52HCNDPG.js → chunk-O4TATDOV.js} +1 -1
- package/dist/{chunk-AR3OYGLB.js → chunk-PEFBRL4S.js} +28 -6
- package/dist/{chunk-AEUXUEJG.js → chunk-PEXVU3HU.js} +5 -3
- package/dist/chunk-Q2G5C3HV.js +217 -0
- package/dist/{chunk-KOO56JVC.js → chunk-Q6N6LDEJ.js} +1 -1
- package/dist/{chunk-TXSJ2L5O.js → chunk-QI4IXJN7.js} +1 -1
- package/dist/{chunk-HLVQ5Y7B.js → chunk-RE4VLK45.js} +1 -1
- package/dist/{chunk-TF6SZGDT.js → chunk-SA2PH6WY.js} +1 -1
- package/dist/{chunk-5RSYY7BE.js → chunk-SJYOPYXH.js} +117 -9
- package/dist/{chunk-PJGHBANY.js → chunk-TTJE7CCU.js} +1 -1
- package/dist/{chunk-A7KEWR6S.js → chunk-TXWQPL2U.js} +1 -1
- package/dist/{chunk-XXSJ35J5.js → chunk-U5ZH52FB.js} +2 -2
- package/dist/{chunk-G4FDG3LK.js → chunk-UVNDLF74.js} +63 -40
- package/dist/{chunk-5OD3AFRW.js → chunk-V6RCZ25F.js} +1 -1
- package/dist/{chunk-LHMBIFKD.js → chunk-VYNNN2S3.js} +4 -4
- package/dist/chunk-WCYT54XP.js +934 -0
- package/dist/{chunk-5AMSQRHT.js → chunk-XGYSTVUH.js} +1 -1
- package/dist/{chunk-MKZBHM6A.js → chunk-XLWF3C4R.js} +4 -4
- package/dist/{chunk-YL36L2SN.js → chunk-Y7YHLV57.js} +1 -1
- package/dist/{chunk-HZC4MR4H.js → chunk-YBKB2PXY.js} +1 -1
- package/dist/{chunk-NWM3A4TK.js → chunk-ZDNLKXZA.js} +1 -1
- package/dist/{chunk-O7KW6QMH.js → chunk-ZW4TKQUM.js} +15 -5
- package/dist/{chunk-6BURHBE6.js → chunk-ZXB44R3E.js} +32 -11
- package/dist/co-occurrence-WCED475N.js +73 -0
- package/dist/{code-context-index-B6VIWPSF.js → code-context-index-LSZ3DKTJ.js} +2 -2
- package/dist/{crdt-sync-XA22KI3S.js → crdt-sync-PBXZTHZC.js} +1 -1
- package/dist/{crm-webhook-CIZNOEY4.js → crm-webhook-W7Q25VZU.js} +2 -2
- package/dist/{cto-delegation-gate-H5IULFRC.js → cto-delegation-gate-JKULOLMC.js} +8 -8
- package/dist/{daemon-orchestration-VO5XQIJL.js → daemon-orchestration-CHV6MB42.js} +13 -11
- package/dist/{exe-drift-DMT75WR3.js → exe-drift-PW36OULT.js} +2 -2
- package/dist/{exe-export-2RZWOSX6.js → exe-export-XQOD3KE6.js} +6 -5
- package/dist/{exe-import-NFNYATHL.js → exe-import-QOFP67LW.js} +6 -5
- package/dist/{exe-key-4D7CF3BU.js → exe-key-WQ34UZR6.js} +1 -1
- package/dist/{fast-db-init-LAEISZQ2.js → fast-db-init-UKETGWQI.js} +1 -1
- package/dist/gateway/index.js +6 -6
- package/dist/{git-staleness-M46AYLPP.js → git-staleness-ATV5CGAP.js} +1 -1
- package/dist/{git-task-sweep-PXOS56YT.js → git-task-sweep-KXZRIP4T.js} +9 -9
- package/dist/{global-procedures-KROQQX54.js → global-procedures-G6IKCYKM.js} +3 -3
- package/dist/{graph-auto-extract-QJ2BBJM2.js → graph-auto-extract-ZJXJOLE2.js} +1 -1
- package/dist/hooks/bug-report-worker.js +10 -10
- package/dist/hooks/codex-stop-task-finalizer.js +10 -10
- package/dist/hooks/commit-complete.js +11 -11
- package/dist/hooks/error-recall.js +8 -7
- package/dist/hooks/exe-heartbeat-hook.js +2 -2
- package/dist/hooks/ingest-worker.js +3 -3
- package/dist/hooks/ingest.js +9 -9
- package/dist/hooks/instructions-loaded.js +3 -3
- package/dist/hooks/notification.js +3 -3
- package/dist/hooks/post-compact.js +10 -10
- package/dist/hooks/post-tool-combined.js +5 -5
- package/dist/hooks/pre-compact.js +16 -16
- package/dist/hooks/pre-tool-use.js +14 -14
- package/dist/hooks/prompt-submit.js +30 -29
- package/dist/hooks/session-end.js +46 -25
- package/dist/hooks/session-start.js +48 -10
- package/dist/hooks/stop.js +17 -17
- package/dist/hooks/subagent-stop.js +10 -10
- package/dist/hooks/summary-worker.js +17 -16
- package/dist/index.js +17 -17
- package/dist/{installer-SDBLJBAB.js → installer-DE2LH5EC.js} +4 -4
- package/dist/{installer-ZA6QNQ4P.js → installer-M2MDS7HC.js} +4 -4
- package/dist/{installer-6KAY6LD6.js → installer-VE23YFXU.js} +4 -4
- package/dist/{intercom-queue-K3DVKSPJ.js → intercom-queue-RNM6EPGA.js} +1 -1
- package/dist/keyword-extractor-UJHFWVZE.js +11 -0
- package/dist/lib/cloud-sync.js +3 -3
- package/dist/lib/consolidation.js +5 -4
- package/dist/lib/database.js +1 -1
- package/dist/lib/db-daemon-client.js +1 -1
- package/dist/lib/db.js +1 -1
- package/dist/lib/embed-worker.js +98 -0
- package/dist/lib/embedder.js +2 -2
- package/dist/lib/employee-templates.js +4 -4
- package/dist/lib/employees.js +1 -1
- package/dist/lib/exe-daemon-client.js +1 -1
- package/dist/lib/exe-daemon.js +523 -500
- package/dist/lib/hybrid-search.js +5 -6
- package/dist/lib/identity.js +1 -1
- package/dist/lib/messaging.js +9 -9
- package/dist/lib/reminders.js +2 -2
- package/dist/lib/schedules.js +5 -4
- package/dist/lib/skill-learning.js +3 -3
- package/dist/lib/store.js +4 -3
- package/dist/lib/task-router.js +2 -2
- package/dist/lib/tasks.js +9 -9
- package/dist/lib/tmux-routing.js +8 -8
- package/dist/lib/tmux-transport.js +1 -1
- package/dist/lib/token-spend.js +2 -2
- package/dist/lib/transport.js +2 -2
- package/dist/lib/ws-client.js +3 -1
- package/dist/mcp/register-tools.js +54 -51
- package/dist/mcp/server.js +58 -55
- package/dist/mcp/tools/complete-reminder.js +3 -3
- package/dist/mcp/tools/create-reminder.js +3 -3
- package/dist/mcp/tools/create-task.js +11 -11
- package/dist/mcp/tools/deactivate-behavior.js +4 -4
- package/dist/mcp/tools/list-reminders.js +3 -3
- package/dist/mcp/tools/list-tasks.js +11 -11
- package/dist/mcp/tools/send-message.js +11 -11
- package/dist/mcp/tools/update-task.js +10 -10
- package/dist/{mcp-http-config-LK2EDOEJ.js → mcp-http-config-Z2E4VUOF.js} +2 -2
- package/dist/{memory-cards-V3DKSRWL.js → memory-cards-SFDKDIAW.js} +1 -1
- package/dist/memory-graph-extractor-YD4GNH7T.js +16 -0
- package/dist/{memory-poisoning-defense-3B75HS74.js → memory-poisoning-defense-VEGNFELN.js} +1 -1
- package/dist/{memory-queue-client-LFPZPPQA.js → memory-queue-client-5HB2XUH7.js} +2 -2
- package/dist/{memory-reflection-HTDAUUE5.js → memory-reflection-MTPRQNI6.js} +2 -2
- package/dist/{notifications-76VCYXWW.js → notifications-6TCE6OBG.js} +8 -8
- package/dist/{orchestrator-CBNSBI5P.js → orchestrator-W2GYJR23.js} +10 -10
- package/dist/{plan-limits-SOR3QXKV.js → plan-limits-4EP46323.js} +2 -2
- package/dist/{projection-worker-FK5YOEIL.js → projection-worker-EBUYNMU2.js} +1 -1
- package/dist/{review-polling-ZLNDUKL4.js → review-polling-2N7KQFZZ.js} +9 -9
- package/dist/runtime/index.js +15 -15
- package/dist/{session-events-CUSPL25D.js → session-events-K47FHAXJ.js} +9 -9
- package/dist/{session-kill-telemetry-FLBRHBDP.js → session-kill-telemetry-275YUXM5.js} +2 -2
- package/dist/{session-scope-PX2ABSJO.js → session-scope-XSFJZEER.js} +8 -8
- package/dist/{setup-wizard-Y6PBZGFX.js → setup-wizard-UEO7HYLQ.js} +1 -1
- package/dist/{skill-refinement-L7PGKCYO.js → skill-refinement-WXBTANDQ.js} +1 -1
- package/dist/stack-update-2B2UXREV.js +50 -0
- package/dist/{task-enforcement-7FUILB63.js → task-enforcement-2JIJSXPU.js} +14 -16
- package/dist/{task-scope-2N45TE32.js → task-scope-W73Z3XWE.js} +8 -8
- package/dist/{tasks-crud-ADLCGHGH.js → tasks-crud-HPJKI3QQ.js} +8 -8
- package/dist/{tasks-review-PJ2DUI6N.js → tasks-review-MXLMPGNZ.js} +8 -8
- package/dist/{token-budget-T5DFXVTM.js → token-budget-BA46CVHX.js} +1 -1
- package/dist/{tool-capability-index-6JJN6ZRC.js → tool-capability-index-42VVN5BS.js} +1 -1
- package/dist/{tool-telemetry-72PVO5HV.js → tool-telemetry-GZ5E2AUL.js} +1 -1
- package/dist/tui/App.js +22 -18
- package/dist/{tui-data-63JHE6EZ.js → tui-data-PVXWQCJX.js} +8 -8
- package/dist/{worker-gate-REVBJUZ6.js → worker-gate-WTTK64TK.js} +1 -1
- package/dist/{workflow-engine-W2WNHJG5.js → workflow-engine-LT3WTT7V.js} +2 -2
- package/package.json +1 -1
- package/release-notes.json +209 -209
- /package/dist/{chunk-BNOZUS6J.js → chunk-6VVCAVRT.js} +0 -0
- /package/dist/{chunk-IC7GKK6I.js → chunk-CWQZZ7X3.js} +0 -0
- /package/dist/{chunk-ZI2ZVERO.js → chunk-EIW5GOBW.js} +0 -0
- /package/dist/{chunk-2BGGDNRD.js → chunk-IPPJEM26.js} +0 -0
- /package/dist/{chunk-4ISDU5KR.js → chunk-K5UR73PM.js} +0 -0
- /package/dist/{chunk-ZWRTVUQ6.js → chunk-KIMO5S45.js} +0 -0
- /package/dist/{chunk-S2FX5KJ4.js → chunk-WBLILGAP.js} +0 -0
- /package/dist/{core-memory-PCJ3L46L.js → core-memory-RAC6M67J.js} +0 -0
- /package/dist/{entity-boost-GHFPE6A2.js → entity-boost-5FIRFRDC.js} +0 -0
- /package/dist/{message-queue-client-CHRQYBH5.js → message-queue-client-PTQ2S7D7.js} +0 -0
- /package/dist/{wiki-acl-QYRAYYVQ.js → wiki-acl-MSDRCIAI.js} +0 -0
|
@@ -14,7 +14,7 @@ import net from "net";
|
|
|
14
14
|
import os from "os";
|
|
15
15
|
import { spawn, execSync } from "child_process";
|
|
16
16
|
import { randomUUID } from "crypto";
|
|
17
|
-
import { existsSync, unlinkSync, readFileSync, openSync, closeSync, statSync } from "fs";
|
|
17
|
+
import { existsSync, unlinkSync, readFileSync, openSync, closeSync, statSync, writeSync } from "fs";
|
|
18
18
|
import path from "path";
|
|
19
19
|
import { fileURLToPath } from "url";
|
|
20
20
|
var SOCKET_PATH = process.env.EXE_DAEMON_SOCK ?? process.env.EXE_EMBED_SOCK ?? path.join(EXE_AI_DIR, "exed.sock");
|
|
@@ -60,11 +60,18 @@ function handleData(chunk) {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
+
var _zombieCache = null;
|
|
63
64
|
function isZombie(pid) {
|
|
65
|
+
if (_zombieCache && _zombieCache.pid === pid && Date.now() - _zombieCache.ts < 2e3) {
|
|
66
|
+
return _zombieCache.result;
|
|
67
|
+
}
|
|
64
68
|
try {
|
|
65
69
|
const state = execSync(`ps -p ${pid} -o state=`, { encoding: "utf8", timeout: 2e3 }).trim();
|
|
66
|
-
|
|
70
|
+
const result = state.startsWith("Z");
|
|
71
|
+
_zombieCache = { pid, result, ts: Date.now() };
|
|
72
|
+
return result;
|
|
67
73
|
} catch {
|
|
74
|
+
_zombieCache = { pid, result: false, ts: Date.now() };
|
|
68
75
|
return false;
|
|
69
76
|
}
|
|
70
77
|
}
|
|
@@ -116,12 +123,19 @@ function findPackageRoot() {
|
|
|
116
123
|
return null;
|
|
117
124
|
}
|
|
118
125
|
function spawnDaemon() {
|
|
126
|
+
try {
|
|
127
|
+
const result = execSync("launchctl list com.askexe.exed 2>/dev/null", { encoding: "utf8", timeout: 3e3 });
|
|
128
|
+
if (result.includes("com.askexe.exed")) {
|
|
129
|
+
process.stderr.write("[exed-client] Daemon not responding \u2014 launchd will restart it. Waiting...\n");
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
} catch {
|
|
133
|
+
}
|
|
134
|
+
process.stderr.write("[exed-client] No launchd supervisor \u2014 spawning daemon directly (dev mode)\n");
|
|
119
135
|
const totalGB = os.totalmem() / (1024 * 1024 * 1024);
|
|
120
136
|
if (totalGB <= 8) {
|
|
121
|
-
process.stderr.write(
|
|
122
|
-
|
|
123
|
-
`
|
|
124
|
-
);
|
|
137
|
+
process.stderr.write(`[exed-client] SKIP: ${totalGB.toFixed(0)}GB system \u2014 daemon disabled.
|
|
138
|
+
`);
|
|
125
139
|
return;
|
|
126
140
|
}
|
|
127
141
|
const pkgRoot = findPackageRoot();
|
|
@@ -131,59 +145,64 @@ function spawnDaemon() {
|
|
|
131
145
|
}
|
|
132
146
|
const daemonPath = path.join(pkgRoot, "dist", "lib", "exe-daemon.js");
|
|
133
147
|
if (!existsSync(daemonPath)) {
|
|
134
|
-
process.stderr.write(`[exed-client] WARN: daemon
|
|
148
|
+
process.stderr.write(`[exed-client] WARN: daemon not found at ${daemonPath}
|
|
135
149
|
`);
|
|
136
150
|
return;
|
|
137
151
|
}
|
|
138
|
-
const resolvedPath = daemonPath;
|
|
139
152
|
const daemonToken = ensureDaemonToken(process.env[DAEMON_TOKEN_ENV] ?? null);
|
|
140
|
-
process.stderr.write(`[exed-client] Spawning daemon: ${resolvedPath}
|
|
141
|
-
`);
|
|
142
153
|
const logPath = path.join(path.dirname(SOCKET_PATH), "exed.log");
|
|
143
154
|
let stderrFd = "ignore";
|
|
144
155
|
try {
|
|
145
156
|
stderrFd = openSync(logPath, "a");
|
|
146
157
|
} catch {
|
|
147
158
|
}
|
|
148
|
-
const heapCapMB = totalGB <=
|
|
149
|
-
const
|
|
150
|
-
const child = spawn(process.execPath, nodeArgs, {
|
|
159
|
+
const heapCapMB = totalGB <= 16 ? 2048 : totalGB <= 32 ? 4096 : totalGB <= 64 ? 6144 : 8192;
|
|
160
|
+
const child = spawn(process.execPath, [`--max-old-space-size=${heapCapMB}`, "--expose-gc", daemonPath], {
|
|
151
161
|
detached: true,
|
|
152
162
|
stdio: ["ignore", "ignore", stderrFd],
|
|
153
163
|
env: {
|
|
154
164
|
...process.env,
|
|
155
165
|
TMUX: void 0,
|
|
156
|
-
// Daemon is global — must not inherit session scope
|
|
157
166
|
TMUX_PANE: void 0,
|
|
158
|
-
// Prevents resolveExeSession() from scoping to one session
|
|
159
167
|
EXE_DAEMON_SOCK: SOCKET_PATH,
|
|
160
168
|
EXE_DAEMON_PID: PID_PATH,
|
|
161
169
|
[DAEMON_TOKEN_ENV]: daemonToken
|
|
162
170
|
}
|
|
163
171
|
});
|
|
164
172
|
child.unref();
|
|
165
|
-
if (typeof stderrFd === "number") {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
} catch {
|
|
169
|
-
}
|
|
173
|
+
if (typeof stderrFd === "number") try {
|
|
174
|
+
closeSync(stderrFd);
|
|
175
|
+
} catch {
|
|
170
176
|
}
|
|
171
177
|
}
|
|
172
178
|
function acquireSpawnLock() {
|
|
173
179
|
try {
|
|
174
180
|
const fd = openSync(SPAWN_LOCK_PATH, "wx");
|
|
181
|
+
writeSync(fd, String(process.pid));
|
|
175
182
|
closeSync(fd);
|
|
176
183
|
return true;
|
|
177
184
|
} catch {
|
|
178
185
|
try {
|
|
186
|
+
const lockContent = readFileSync(SPAWN_LOCK_PATH, "utf8").trim();
|
|
187
|
+
const lockPid = parseInt(lockContent, 10);
|
|
179
188
|
const stat = statSync(SPAWN_LOCK_PATH);
|
|
180
|
-
|
|
189
|
+
const isStale = Date.now() - stat.mtimeMs > SPAWN_LOCK_STALE_MS;
|
|
190
|
+
let holderDead = false;
|
|
191
|
+
if (lockPid > 0) {
|
|
192
|
+
try {
|
|
193
|
+
process.kill(lockPid, 0);
|
|
194
|
+
} catch {
|
|
195
|
+
holderDead = true;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
if (isStale || holderDead) {
|
|
181
199
|
try {
|
|
182
200
|
unlinkSync(SPAWN_LOCK_PATH);
|
|
183
201
|
} catch {
|
|
184
202
|
}
|
|
185
203
|
try {
|
|
186
204
|
const fd = openSync(SPAWN_LOCK_PATH, "wx");
|
|
205
|
+
writeSync(fd, String(process.pid));
|
|
187
206
|
closeSync(fd);
|
|
188
207
|
return true;
|
|
189
208
|
} catch {
|
|
@@ -229,23 +248,27 @@ function connectToSocket() {
|
|
|
229
248
|
_autoReconnecting = true;
|
|
230
249
|
const maxRetries = 20;
|
|
231
250
|
let attempt = 0;
|
|
232
|
-
const
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
251
|
+
const jitter = () => 2e3 + Math.random() * 2e3;
|
|
252
|
+
const initialDelay = Math.random() * 2e3;
|
|
253
|
+
setTimeout(() => {
|
|
254
|
+
const retryTimer = setInterval(async () => {
|
|
255
|
+
attempt++;
|
|
256
|
+
if (attempt > maxRetries) {
|
|
257
|
+
clearInterval(retryTimer);
|
|
258
|
+
_autoReconnecting = false;
|
|
259
|
+
process.stderr.write(`[daemon-client] Auto-reconnect failed after ${maxRetries} attempts
|
|
238
260
|
`);
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
const ok = await connectToSocket();
|
|
264
|
+
if (ok) {
|
|
265
|
+
clearInterval(retryTimer);
|
|
266
|
+
_autoReconnecting = false;
|
|
267
|
+
if (attempt > 1) process.stderr.write(`[daemon-client] Auto-reconnected to daemon (attempt ${attempt})
|
|
246
268
|
`);
|
|
247
|
-
|
|
248
|
-
|
|
269
|
+
}
|
|
270
|
+
}, jitter());
|
|
271
|
+
}, initialDelay);
|
|
249
272
|
}
|
|
250
273
|
});
|
|
251
274
|
socket.on("error", () => {
|
|
@@ -335,11 +358,11 @@ function killAndRespawnDaemon(reason, opts) {
|
|
|
335
358
|
if (!result.ok) {
|
|
336
359
|
return;
|
|
337
360
|
}
|
|
338
|
-
if (isDaemonPidAlive()) {
|
|
339
|
-
|
|
340
|
-
|
|
361
|
+
if (!isDaemonPidAlive()) {
|
|
362
|
+
spawnDaemon();
|
|
363
|
+
} else {
|
|
364
|
+
process.stderr.write("[exed-client] Daemon PID alive after kill \u2014 launchd will restart when it exits\n");
|
|
341
365
|
}
|
|
342
|
-
spawnDaemon();
|
|
343
366
|
}
|
|
344
367
|
async function retryThenRestart(doRequest, label) {
|
|
345
368
|
const result = await doRequest();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
routeTask
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YBKB2PXY.js";
|
|
4
4
|
import {
|
|
5
5
|
createTaskCore,
|
|
6
6
|
employeeSessionName,
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
isEmployeeAlive,
|
|
10
10
|
sessionScopeFilter,
|
|
11
11
|
updateTaskStatus
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-MFI5OXYW.js";
|
|
13
13
|
import {
|
|
14
14
|
DEFAULT_COORDINATOR_TEMPLATE_NAME,
|
|
15
15
|
getCoordinatorName
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-SJYOPYXH.js";
|
|
17
17
|
|
|
18
18
|
// src/runtime/orchestrator.ts
|
|
19
19
|
var STALE_THRESHOLD_MS = 2 * 60 * 60 * 1e3;
|
|
@@ -232,7 +232,7 @@ ${task.context}`,
|
|
|
232
232
|
}
|
|
233
233
|
/**
|
|
234
234
|
* Recover a crashed session by spawning a fresh CC session.
|
|
235
|
-
* The new session boots via
|
|
235
|
+
* The new session boots with identity via --system-prompt, finds existing in_progress tasks, and resumes.
|
|
236
236
|
*/
|
|
237
237
|
recoverSession(employeeName) {
|
|
238
238
|
const sessionName = employeeSessionName(employeeName, this.config.exeSession);
|