@askexenow/exe-os 0.9.85 → 0.9.87
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/bin/agentic-ontology-backfill.js +50 -14
- package/dist/bin/agentic-reflection-backfill.js +50 -14
- package/dist/bin/agentic-semantic-label.js +50 -14
- package/dist/bin/backfill-conversations.js +50 -14
- package/dist/bin/backfill-responses.js +50 -14
- package/dist/bin/backfill-vectors.js +50 -14
- package/dist/bin/bulk-sync-postgres.js +50 -14
- package/dist/bin/cleanup-stale-review-tasks.js +53 -17
- package/dist/bin/cli.js +339 -81
- package/dist/bin/exe-agent.js +18 -0
- package/dist/bin/exe-assign.js +50 -14
- package/dist/bin/exe-boot.js +75 -39
- package/dist/bin/exe-call.js +18 -0
- package/dist/bin/exe-cloud.js +40 -4
- package/dist/bin/exe-dispatch.js +61 -25
- package/dist/bin/exe-doctor.js +40 -4
- package/dist/bin/exe-export-behaviors.js +50 -14
- package/dist/bin/exe-forget.js +50 -14
- package/dist/bin/exe-gateway.js +65 -29
- package/dist/bin/exe-heartbeat.js +55 -19
- package/dist/bin/exe-kill.js +54 -18
- package/dist/bin/exe-launch-agent.js +58 -22
- package/dist/bin/exe-new-employee.js +33 -2
- package/dist/bin/exe-pending-messages.js +53 -17
- package/dist/bin/exe-pending-notifications.js +53 -17
- package/dist/bin/exe-pending-reviews.js +55 -19
- package/dist/bin/exe-rename.js +52 -16
- package/dist/bin/exe-review.js +50 -14
- package/dist/bin/exe-search.js +58 -22
- package/dist/bin/exe-session-cleanup.js +85 -44
- package/dist/bin/exe-start-codex.js +57 -21
- package/dist/bin/exe-start-opencode.js +55 -19
- package/dist/bin/exe-status.js +62 -26
- package/dist/bin/exe-team.js +50 -14
- package/dist/bin/git-sweep.js +63 -27
- package/dist/bin/graph-backfill.js +50 -14
- package/dist/bin/graph-export.js +50 -14
- package/dist/bin/install.js +9 -0
- package/dist/bin/intercom-check.js +67 -31
- package/dist/bin/scan-tasks.js +63 -27
- package/dist/bin/setup.js +53 -13
- package/dist/bin/shard-migrate.js +50 -14
- package/dist/bin/stack-update.js +59 -2
- package/dist/bin/update.js +1 -1
- package/dist/gateway/index.js +65 -29
- package/dist/hooks/bug-report-worker.js +65 -29
- package/dist/hooks/codex-stop-task-finalizer.js +59 -23
- package/dist/hooks/commit-complete.js +64 -28
- package/dist/hooks/error-recall.js +62 -26
- package/dist/hooks/ingest-worker.js +4 -4
- package/dist/hooks/ingest.js +56 -20
- package/dist/hooks/instructions-loaded.js +50 -14
- package/dist/hooks/notification.js +50 -14
- package/dist/hooks/post-compact.js +50 -14
- package/dist/hooks/post-tool-combined.js +63 -27
- package/dist/hooks/pre-compact.js +61 -25
- package/dist/hooks/pre-tool-use.js +58 -22
- package/dist/hooks/prompt-submit.js +78 -42
- package/dist/hooks/session-end.js +66 -30
- package/dist/hooks/session-start.js +68 -32
- package/dist/hooks/stop.js +53 -17
- package/dist/hooks/subagent-stop.js +50 -14
- package/dist/hooks/summary-worker.js +55 -19
- package/dist/index.js +61 -25
- package/dist/lib/cloud-sync.js +32 -14
- package/dist/lib/database.js +22 -4
- package/dist/lib/db-daemon-client.js +16 -4
- package/dist/lib/db.js +22 -4
- package/dist/lib/device-registry.js +22 -4
- package/dist/lib/embedder.js +16 -4
- package/dist/lib/employee-templates.js +18 -0
- package/dist/lib/exe-daemon-client.js +16 -4
- package/dist/lib/exe-daemon.js +874 -232
- package/dist/lib/hybrid-search.js +58 -22
- package/dist/lib/identity-templates.js +6 -2
- package/dist/lib/schedules.js +53 -17
- package/dist/lib/skill-learning.js +16 -4
- package/dist/lib/store.js +50 -14
- package/dist/lib/tasks.js +16 -4
- package/dist/lib/tmux-routing.js +18 -6
- package/dist/mcp/server.js +809 -200
- package/dist/mcp/tools/create-task.js +24 -8
- package/dist/mcp/tools/update-task.js +18 -6
- package/dist/runtime/index.js +61 -25
- package/dist/tui/App.js +91 -55
- package/package.json +1 -1
package/dist/bin/exe-search.js
CHANGED
|
@@ -1046,7 +1046,7 @@ var init_daemon_auth = __esm({
|
|
|
1046
1046
|
// src/lib/exe-daemon-client.ts
|
|
1047
1047
|
import net from "net";
|
|
1048
1048
|
import os4 from "os";
|
|
1049
|
-
import { spawn } from "child_process";
|
|
1049
|
+
import { spawn, execSync as execSync2 } from "child_process";
|
|
1050
1050
|
import { randomUUID } from "crypto";
|
|
1051
1051
|
import { existsSync as existsSync5, unlinkSync as unlinkSync2, readFileSync as readFileSync4, openSync, closeSync, statSync } from "fs";
|
|
1052
1052
|
import path5 from "path";
|
|
@@ -1076,6 +1076,14 @@ function handleData(chunk) {
|
|
|
1076
1076
|
}
|
|
1077
1077
|
}
|
|
1078
1078
|
}
|
|
1079
|
+
function isZombie(pid) {
|
|
1080
|
+
try {
|
|
1081
|
+
const state = execSync2(`ps -p ${pid} -o state=`, { encoding: "utf8", timeout: 2e3 }).trim();
|
|
1082
|
+
return state.startsWith("Z");
|
|
1083
|
+
} catch {
|
|
1084
|
+
return false;
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1079
1087
|
function cleanupStaleFiles() {
|
|
1080
1088
|
if (existsSync5(PID_PATH)) {
|
|
1081
1089
|
try {
|
|
@@ -1083,7 +1091,11 @@ function cleanupStaleFiles() {
|
|
|
1083
1091
|
if (pid > 0) {
|
|
1084
1092
|
try {
|
|
1085
1093
|
process.kill(pid, 0);
|
|
1086
|
-
|
|
1094
|
+
if (!isZombie(pid)) {
|
|
1095
|
+
return;
|
|
1096
|
+
}
|
|
1097
|
+
process.stderr.write(`[exed-client] PID ${pid} is a zombie \u2014 cleaning up stale files
|
|
1098
|
+
`);
|
|
1087
1099
|
} catch {
|
|
1088
1100
|
}
|
|
1089
1101
|
}
|
|
@@ -1111,8 +1123,8 @@ function findPackageRoot() {
|
|
|
1111
1123
|
function getAvailableMemoryGB() {
|
|
1112
1124
|
if (process.platform === "darwin") {
|
|
1113
1125
|
try {
|
|
1114
|
-
const { execSync:
|
|
1115
|
-
const vmstat =
|
|
1126
|
+
const { execSync: execSync6 } = __require("child_process");
|
|
1127
|
+
const vmstat = execSync6("vm_stat", { encoding: "utf8" });
|
|
1116
1128
|
const pageSize = 16384;
|
|
1117
1129
|
const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
|
|
1118
1130
|
const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
|
|
@@ -3047,6 +3059,12 @@ async function disposeDatabase() {
|
|
|
3047
3059
|
clearInterval(_walCheckpointTimer);
|
|
3048
3060
|
_walCheckpointTimer = null;
|
|
3049
3061
|
}
|
|
3062
|
+
if (_client) {
|
|
3063
|
+
try {
|
|
3064
|
+
await _client.execute("PRAGMA wal_checkpoint(PASSIVE)");
|
|
3065
|
+
} catch {
|
|
3066
|
+
}
|
|
3067
|
+
}
|
|
3050
3068
|
if (_daemonClient) {
|
|
3051
3069
|
_daemonClient.close();
|
|
3052
3070
|
_daemonClient = null;
|
|
@@ -3083,7 +3101,7 @@ var init_database = __esm({
|
|
|
3083
3101
|
// src/lib/keychain.ts
|
|
3084
3102
|
import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
|
|
3085
3103
|
import { existsSync as existsSync6, statSync as statSync2 } from "fs";
|
|
3086
|
-
import { execSync as
|
|
3104
|
+
import { execSync as execSync3 } from "child_process";
|
|
3087
3105
|
import path6 from "path";
|
|
3088
3106
|
import os5 from "os";
|
|
3089
3107
|
function getKeyDir() {
|
|
@@ -3100,13 +3118,13 @@ function linuxSecretAvailable() {
|
|
|
3100
3118
|
if (process.platform !== "linux") return false;
|
|
3101
3119
|
if (linuxSecretAvailability !== null) return linuxSecretAvailability;
|
|
3102
3120
|
try {
|
|
3103
|
-
|
|
3121
|
+
execSync3("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
|
|
3104
3122
|
} catch {
|
|
3105
3123
|
linuxSecretAvailability = false;
|
|
3106
3124
|
return false;
|
|
3107
3125
|
}
|
|
3108
3126
|
try {
|
|
3109
|
-
|
|
3127
|
+
execSync3("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
|
|
3110
3128
|
linuxSecretAvailability = true;
|
|
3111
3129
|
} catch {
|
|
3112
3130
|
linuxSecretAvailability = false;
|
|
@@ -3130,7 +3148,7 @@ function macKeychainGet(service = SERVICE) {
|
|
|
3130
3148
|
if (!nativeKeychainAllowed()) return null;
|
|
3131
3149
|
if (process.platform !== "darwin") return null;
|
|
3132
3150
|
try {
|
|
3133
|
-
return
|
|
3151
|
+
return execSync3(
|
|
3134
3152
|
`security find-generic-password -s "${service}" -a "${ACCOUNT}" -w 2>/dev/null`,
|
|
3135
3153
|
{ encoding: "utf-8", timeout: 5e3 }
|
|
3136
3154
|
).trim();
|
|
@@ -3143,13 +3161,13 @@ function macKeychainSet(value, service = SERVICE) {
|
|
|
3143
3161
|
if (process.platform !== "darwin") return false;
|
|
3144
3162
|
try {
|
|
3145
3163
|
try {
|
|
3146
|
-
|
|
3164
|
+
execSync3(
|
|
3147
3165
|
`security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
|
|
3148
3166
|
{ timeout: 5e3 }
|
|
3149
3167
|
);
|
|
3150
3168
|
} catch {
|
|
3151
3169
|
}
|
|
3152
|
-
|
|
3170
|
+
execSync3(
|
|
3153
3171
|
`security add-generic-password -s "${service}" -a "${ACCOUNT}" -w "${value}"`,
|
|
3154
3172
|
{ timeout: 5e3 }
|
|
3155
3173
|
);
|
|
@@ -3162,7 +3180,7 @@ function macKeychainDelete(service = SERVICE) {
|
|
|
3162
3180
|
if (!nativeKeychainAllowed()) return false;
|
|
3163
3181
|
if (process.platform !== "darwin") return false;
|
|
3164
3182
|
try {
|
|
3165
|
-
|
|
3183
|
+
execSync3(
|
|
3166
3184
|
`security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
|
|
3167
3185
|
{ timeout: 5e3 }
|
|
3168
3186
|
);
|
|
@@ -3174,7 +3192,7 @@ function macKeychainDelete(service = SERVICE) {
|
|
|
3174
3192
|
function linuxSecretGet(service = SERVICE) {
|
|
3175
3193
|
if (!linuxSecretAvailable()) return null;
|
|
3176
3194
|
try {
|
|
3177
|
-
return
|
|
3195
|
+
return execSync3(
|
|
3178
3196
|
`secret-tool lookup service "${service}" account "${ACCOUNT}" 2>/dev/null`,
|
|
3179
3197
|
{ encoding: "utf-8", timeout: 5e3 }
|
|
3180
3198
|
).trim();
|
|
@@ -3185,7 +3203,7 @@ function linuxSecretGet(service = SERVICE) {
|
|
|
3185
3203
|
function linuxSecretSet(value, service = SERVICE) {
|
|
3186
3204
|
if (!linuxSecretAvailable()) return false;
|
|
3187
3205
|
try {
|
|
3188
|
-
|
|
3206
|
+
execSync3(
|
|
3189
3207
|
`echo -n "${value}" | secret-tool store --label="exe-os master key" service "${service}" account "${ACCOUNT}" 2>/dev/null`,
|
|
3190
3208
|
{ timeout: 5e3 }
|
|
3191
3209
|
);
|
|
@@ -3198,7 +3216,7 @@ function linuxSecretDelete(service = SERVICE) {
|
|
|
3198
3216
|
if (!nativeKeychainAllowed()) return false;
|
|
3199
3217
|
if (process.platform !== "linux") return false;
|
|
3200
3218
|
try {
|
|
3201
|
-
|
|
3219
|
+
execSync3(
|
|
3202
3220
|
`secret-tool clear service "${service}" account "${ACCOUNT}" 2>/dev/null`,
|
|
3203
3221
|
{ timeout: 5e3 }
|
|
3204
3222
|
);
|
|
@@ -4135,6 +4153,24 @@ var init_platform_procedures = __esm({
|
|
|
4135
4153
|
priority: "p0",
|
|
4136
4154
|
content: "When an agent encounters a suspected Exe OS bug, update breakage, MCP/tool failure, installer issue, memory/orchestration defect, or customer-local patch need, it MUST use create_bug_report. Do this before or alongside any local workaround so the report reaches AskExe support directly via the customer's license. Do NOT ask the founder for permission to file a required bug report. If create_bug_report is deferred/lazy-loaded, load it and call it. If it is unavailable in the live MCP surface, report 'create_bug_report unavailable in this session' and save a local report in exe/output \u2014 never claim the tool does not exist unless the live MCP surface was checked. If upstream delivery fails, call support_test (MCP) and include its result in the local report so AskExe can distinguish customer setup, license provisioning, and server intake issues; only ask the founder to run `exe-os support test` if MCP is disconnected/unavailable. Classify first: upstream_bug = reproducible exe-os/platform defect; customer_customization = identity, behavior, procedure, config, branding, workflow preference that belongs in customer-owned layers; emergency_hotfix = temporary local patch. For upstream bugs/emergency hotfixes include version, repro steps, expected/actual, files changed, workaround, and local diff summary. Avoid permanent platform-code patches unless founder approves; if a hotfix is unavoidable, document it in the bug report and re-check after npm update."
|
|
4137
4155
|
},
|
|
4156
|
+
{
|
|
4157
|
+
title: "Bug report status check \u2014 surface available fixes on boot",
|
|
4158
|
+
domain: "support",
|
|
4159
|
+
priority: "p1",
|
|
4160
|
+
content: "Once per session (COO boot only, never repeat), call list_my_bug_reports to check if any previously filed bug reports have been fixed by AskExe. If any report has status 'fixed' with a fixed_version, surface it to the founder immediately: '\u{1F527} N bug fix(es) available \u2014 run exe-os update to get version X.Y.Z'. This is a one-time check at boot, not a recurring poll. If no reports exist or none are fixed, skip silently. If the MCP tool is unavailable or the network call fails, skip silently \u2014 this is informational, not blocking."
|
|
4161
|
+
},
|
|
4162
|
+
{
|
|
4163
|
+
title: "Feature request triage \u2014 upstream feature vs local customization",
|
|
4164
|
+
domain: "support",
|
|
4165
|
+
priority: "p0",
|
|
4166
|
+
content: "When an agent or founder identifies a desired capability that exe-os does not yet provide, the COO (or equivalent coordinator) must decide: is this a local customization (identity, behavior, procedure, config, branding, workflow preference that can be configured in customer-owned layers) or an upstream feature request (a platform capability that requires changes to exe-os code, shipped via npm update)? Local customizations: implement immediately using store_behavior, update_identity, company_procedure, or config changes. Upstream features: use create_feature_request to submit to AskExe. Include use case, business impact, and current workaround. Do NOT ask the founder for permission to file a feature request \u2014 file it proactively when the need is clear."
|
|
4167
|
+
},
|
|
4168
|
+
{
|
|
4169
|
+
title: "Feature request status check \u2014 surface shipped features on boot",
|
|
4170
|
+
domain: "support",
|
|
4171
|
+
priority: "p1",
|
|
4172
|
+
content: "Once per session (COO boot only, never repeat), call list_my_feature_requests to check if any previously filed feature requests have been shipped by AskExe. If any request has status 'shipped' with a shipped_version, surface it to the founder immediately: '\u{1F680} N feature(s) shipped \u2014 run exe-os update to get version X.Y.Z'. This is a one-time check at boot, not a recurring poll. If no requests exist or none are shipped, skip silently. If the MCP tool is unavailable or the network call fails, skip silently \u2014 this is informational, not blocking."
|
|
4173
|
+
},
|
|
4138
4174
|
// --- Operations ---
|
|
4139
4175
|
{
|
|
4140
4176
|
title: "Managers must supervise deployed workers",
|
|
@@ -5666,7 +5702,7 @@ __export(project_name_exports, {
|
|
|
5666
5702
|
_resetCache: () => _resetCache,
|
|
5667
5703
|
getProjectName: () => getProjectName
|
|
5668
5704
|
});
|
|
5669
|
-
import { execSync as
|
|
5705
|
+
import { execSync as execSync4 } from "child_process";
|
|
5670
5706
|
import path9 from "path";
|
|
5671
5707
|
function getProjectName(cwd) {
|
|
5672
5708
|
const dir = cwd ?? process.cwd();
|
|
@@ -5674,7 +5710,7 @@ function getProjectName(cwd) {
|
|
|
5674
5710
|
try {
|
|
5675
5711
|
let repoRoot;
|
|
5676
5712
|
try {
|
|
5677
|
-
const gitCommonDir =
|
|
5713
|
+
const gitCommonDir = execSync4("git rev-parse --path-format=absolute --git-common-dir", {
|
|
5678
5714
|
cwd: dir,
|
|
5679
5715
|
encoding: "utf8",
|
|
5680
5716
|
timeout: 2e3,
|
|
@@ -5682,7 +5718,7 @@ function getProjectName(cwd) {
|
|
|
5682
5718
|
}).trim();
|
|
5683
5719
|
repoRoot = path9.dirname(gitCommonDir);
|
|
5684
5720
|
} catch {
|
|
5685
|
-
repoRoot =
|
|
5721
|
+
repoRoot = execSync4("git rev-parse --show-toplevel", {
|
|
5686
5722
|
cwd: dir,
|
|
5687
5723
|
encoding: "utf8",
|
|
5688
5724
|
timeout: 2e3,
|
|
@@ -5716,14 +5752,14 @@ var file_grep_exports = {};
|
|
|
5716
5752
|
__export(file_grep_exports, {
|
|
5717
5753
|
grepProjectFiles: () => grepProjectFiles
|
|
5718
5754
|
});
|
|
5719
|
-
import { execSync as
|
|
5755
|
+
import { execSync as execSync5 } from "child_process";
|
|
5720
5756
|
import { readFileSync as readFileSync5, readdirSync as readdirSync2, statSync as statSync4, existsSync as existsSync9 } from "fs";
|
|
5721
5757
|
import path10 from "path";
|
|
5722
5758
|
import crypto2 from "crypto";
|
|
5723
5759
|
function hasRipgrep() {
|
|
5724
5760
|
if (_hasRg === null) {
|
|
5725
5761
|
try {
|
|
5726
|
-
|
|
5762
|
+
execSync5("rg --version", { stdio: "ignore", timeout: 2e3 });
|
|
5727
5763
|
_hasRg = true;
|
|
5728
5764
|
} catch {
|
|
5729
5765
|
_hasRg = false;
|
|
@@ -5789,7 +5825,7 @@ function grepWithRipgrep(pattern, projectRoot, patterns) {
|
|
|
5789
5825
|
const globs = (patterns ?? DEFAULT_PATTERNS).map((p) => `--glob '${p}'`).join(" ");
|
|
5790
5826
|
const excludes = EXCLUDE_DIRS.map((d) => `--glob '!${d}'`).join(" ");
|
|
5791
5827
|
const cmd = `rg -i -c --hidden --no-config --no-ignore '${pattern.replace(/'/g, "\\'")}' . ${globs} ${excludes} --max-filesize ${MAX_FILE_SIZE} 2>/dev/null || true`;
|
|
5792
|
-
const output =
|
|
5828
|
+
const output = execSync5(cmd, {
|
|
5793
5829
|
cwd: projectRoot,
|
|
5794
5830
|
encoding: "utf8",
|
|
5795
5831
|
timeout: 3e3,
|
|
@@ -5804,12 +5840,12 @@ function grepWithRipgrep(pattern, projectRoot, patterns) {
|
|
|
5804
5840
|
const matchCount = parseInt(line.slice(colonIdx + 1));
|
|
5805
5841
|
if (isNaN(matchCount) || matchCount === 0) continue;
|
|
5806
5842
|
try {
|
|
5807
|
-
const firstMatch =
|
|
5843
|
+
const firstMatch = execSync5(
|
|
5808
5844
|
`rg -i -n --hidden '${pattern.replace(/'/g, "\\'")}' '${filePath}' --max-count 1 2>/dev/null | head -1`,
|
|
5809
5845
|
{ cwd: projectRoot, encoding: "utf8", timeout: 1e3 }
|
|
5810
5846
|
).trim();
|
|
5811
5847
|
const lineNum = parseInt(firstMatch.split(":")[0] ?? "1");
|
|
5812
|
-
const totalLines =
|
|
5848
|
+
const totalLines = execSync5(`wc -l < '${filePath}'`, {
|
|
5813
5849
|
cwd: projectRoot,
|
|
5814
5850
|
encoding: "utf8",
|
|
5815
5851
|
timeout: 1e3
|
|
@@ -1090,7 +1090,7 @@ var init_daemon_auth = __esm({
|
|
|
1090
1090
|
// src/lib/exe-daemon-client.ts
|
|
1091
1091
|
import net from "net";
|
|
1092
1092
|
import os4 from "os";
|
|
1093
|
-
import { spawn } from "child_process";
|
|
1093
|
+
import { spawn, execSync as execSync2 } from "child_process";
|
|
1094
1094
|
import { randomUUID } from "crypto";
|
|
1095
1095
|
import { existsSync as existsSync5, unlinkSync as unlinkSync2, readFileSync as readFileSync4, openSync, closeSync, statSync } from "fs";
|
|
1096
1096
|
import path5 from "path";
|
|
@@ -1120,6 +1120,14 @@ function handleData(chunk) {
|
|
|
1120
1120
|
}
|
|
1121
1121
|
}
|
|
1122
1122
|
}
|
|
1123
|
+
function isZombie(pid) {
|
|
1124
|
+
try {
|
|
1125
|
+
const state = execSync2(`ps -p ${pid} -o state=`, { encoding: "utf8", timeout: 2e3 }).trim();
|
|
1126
|
+
return state.startsWith("Z");
|
|
1127
|
+
} catch {
|
|
1128
|
+
return false;
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1123
1131
|
function cleanupStaleFiles() {
|
|
1124
1132
|
if (existsSync5(PID_PATH)) {
|
|
1125
1133
|
try {
|
|
@@ -1127,7 +1135,11 @@ function cleanupStaleFiles() {
|
|
|
1127
1135
|
if (pid > 0) {
|
|
1128
1136
|
try {
|
|
1129
1137
|
process.kill(pid, 0);
|
|
1130
|
-
|
|
1138
|
+
if (!isZombie(pid)) {
|
|
1139
|
+
return;
|
|
1140
|
+
}
|
|
1141
|
+
process.stderr.write(`[exed-client] PID ${pid} is a zombie \u2014 cleaning up stale files
|
|
1142
|
+
`);
|
|
1131
1143
|
} catch {
|
|
1132
1144
|
}
|
|
1133
1145
|
}
|
|
@@ -1155,8 +1167,8 @@ function findPackageRoot() {
|
|
|
1155
1167
|
function getAvailableMemoryGB() {
|
|
1156
1168
|
if (process.platform === "darwin") {
|
|
1157
1169
|
try {
|
|
1158
|
-
const { execSync:
|
|
1159
|
-
const vmstat =
|
|
1170
|
+
const { execSync: execSync12 } = __require("child_process");
|
|
1171
|
+
const vmstat = execSync12("vm_stat", { encoding: "utf8" });
|
|
1160
1172
|
const pageSize = 16384;
|
|
1161
1173
|
const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
|
|
1162
1174
|
const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
|
|
@@ -3091,6 +3103,12 @@ async function disposeDatabase() {
|
|
|
3091
3103
|
clearInterval(_walCheckpointTimer);
|
|
3092
3104
|
_walCheckpointTimer = null;
|
|
3093
3105
|
}
|
|
3106
|
+
if (_client) {
|
|
3107
|
+
try {
|
|
3108
|
+
await _client.execute("PRAGMA wal_checkpoint(PASSIVE)");
|
|
3109
|
+
} catch {
|
|
3110
|
+
}
|
|
3111
|
+
}
|
|
3094
3112
|
if (_daemonClient) {
|
|
3095
3113
|
_daemonClient.close();
|
|
3096
3114
|
_daemonClient = null;
|
|
@@ -3127,7 +3145,7 @@ var init_database = __esm({
|
|
|
3127
3145
|
// src/lib/keychain.ts
|
|
3128
3146
|
import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
|
|
3129
3147
|
import { existsSync as existsSync6, statSync as statSync2 } from "fs";
|
|
3130
|
-
import { execSync as
|
|
3148
|
+
import { execSync as execSync3 } from "child_process";
|
|
3131
3149
|
import path6 from "path";
|
|
3132
3150
|
import os5 from "os";
|
|
3133
3151
|
function getKeyDir() {
|
|
@@ -3144,13 +3162,13 @@ function linuxSecretAvailable() {
|
|
|
3144
3162
|
if (process.platform !== "linux") return false;
|
|
3145
3163
|
if (linuxSecretAvailability !== null) return linuxSecretAvailability;
|
|
3146
3164
|
try {
|
|
3147
|
-
|
|
3165
|
+
execSync3("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
|
|
3148
3166
|
} catch {
|
|
3149
3167
|
linuxSecretAvailability = false;
|
|
3150
3168
|
return false;
|
|
3151
3169
|
}
|
|
3152
3170
|
try {
|
|
3153
|
-
|
|
3171
|
+
execSync3("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
|
|
3154
3172
|
linuxSecretAvailability = true;
|
|
3155
3173
|
} catch {
|
|
3156
3174
|
linuxSecretAvailability = false;
|
|
@@ -3174,7 +3192,7 @@ function macKeychainGet(service = SERVICE) {
|
|
|
3174
3192
|
if (!nativeKeychainAllowed()) return null;
|
|
3175
3193
|
if (process.platform !== "darwin") return null;
|
|
3176
3194
|
try {
|
|
3177
|
-
return
|
|
3195
|
+
return execSync3(
|
|
3178
3196
|
`security find-generic-password -s "${service}" -a "${ACCOUNT}" -w 2>/dev/null`,
|
|
3179
3197
|
{ encoding: "utf-8", timeout: 5e3 }
|
|
3180
3198
|
).trim();
|
|
@@ -3187,13 +3205,13 @@ function macKeychainSet(value, service = SERVICE) {
|
|
|
3187
3205
|
if (process.platform !== "darwin") return false;
|
|
3188
3206
|
try {
|
|
3189
3207
|
try {
|
|
3190
|
-
|
|
3208
|
+
execSync3(
|
|
3191
3209
|
`security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
|
|
3192
3210
|
{ timeout: 5e3 }
|
|
3193
3211
|
);
|
|
3194
3212
|
} catch {
|
|
3195
3213
|
}
|
|
3196
|
-
|
|
3214
|
+
execSync3(
|
|
3197
3215
|
`security add-generic-password -s "${service}" -a "${ACCOUNT}" -w "${value}"`,
|
|
3198
3216
|
{ timeout: 5e3 }
|
|
3199
3217
|
);
|
|
@@ -3206,7 +3224,7 @@ function macKeychainDelete(service = SERVICE) {
|
|
|
3206
3224
|
if (!nativeKeychainAllowed()) return false;
|
|
3207
3225
|
if (process.platform !== "darwin") return false;
|
|
3208
3226
|
try {
|
|
3209
|
-
|
|
3227
|
+
execSync3(
|
|
3210
3228
|
`security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
|
|
3211
3229
|
{ timeout: 5e3 }
|
|
3212
3230
|
);
|
|
@@ -3218,7 +3236,7 @@ function macKeychainDelete(service = SERVICE) {
|
|
|
3218
3236
|
function linuxSecretGet(service = SERVICE) {
|
|
3219
3237
|
if (!linuxSecretAvailable()) return null;
|
|
3220
3238
|
try {
|
|
3221
|
-
return
|
|
3239
|
+
return execSync3(
|
|
3222
3240
|
`secret-tool lookup service "${service}" account "${ACCOUNT}" 2>/dev/null`,
|
|
3223
3241
|
{ encoding: "utf-8", timeout: 5e3 }
|
|
3224
3242
|
).trim();
|
|
@@ -3229,7 +3247,7 @@ function linuxSecretGet(service = SERVICE) {
|
|
|
3229
3247
|
function linuxSecretSet(value, service = SERVICE) {
|
|
3230
3248
|
if (!linuxSecretAvailable()) return false;
|
|
3231
3249
|
try {
|
|
3232
|
-
|
|
3250
|
+
execSync3(
|
|
3233
3251
|
`echo -n "${value}" | secret-tool store --label="exe-os master key" service "${service}" account "${ACCOUNT}" 2>/dev/null`,
|
|
3234
3252
|
{ timeout: 5e3 }
|
|
3235
3253
|
);
|
|
@@ -3242,7 +3260,7 @@ function linuxSecretDelete(service = SERVICE) {
|
|
|
3242
3260
|
if (!nativeKeychainAllowed()) return false;
|
|
3243
3261
|
if (process.platform !== "linux") return false;
|
|
3244
3262
|
try {
|
|
3245
|
-
|
|
3263
|
+
execSync3(
|
|
3246
3264
|
`secret-tool clear service "${service}" account "${ACCOUNT}" 2>/dev/null`,
|
|
3247
3265
|
{ timeout: 5e3 }
|
|
3248
3266
|
);
|
|
@@ -4179,6 +4197,24 @@ var init_platform_procedures = __esm({
|
|
|
4179
4197
|
priority: "p0",
|
|
4180
4198
|
content: "When an agent encounters a suspected Exe OS bug, update breakage, MCP/tool failure, installer issue, memory/orchestration defect, or customer-local patch need, it MUST use create_bug_report. Do this before or alongside any local workaround so the report reaches AskExe support directly via the customer's license. Do NOT ask the founder for permission to file a required bug report. If create_bug_report is deferred/lazy-loaded, load it and call it. If it is unavailable in the live MCP surface, report 'create_bug_report unavailable in this session' and save a local report in exe/output \u2014 never claim the tool does not exist unless the live MCP surface was checked. If upstream delivery fails, call support_test (MCP) and include its result in the local report so AskExe can distinguish customer setup, license provisioning, and server intake issues; only ask the founder to run `exe-os support test` if MCP is disconnected/unavailable. Classify first: upstream_bug = reproducible exe-os/platform defect; customer_customization = identity, behavior, procedure, config, branding, workflow preference that belongs in customer-owned layers; emergency_hotfix = temporary local patch. For upstream bugs/emergency hotfixes include version, repro steps, expected/actual, files changed, workaround, and local diff summary. Avoid permanent platform-code patches unless founder approves; if a hotfix is unavoidable, document it in the bug report and re-check after npm update."
|
|
4181
4199
|
},
|
|
4200
|
+
{
|
|
4201
|
+
title: "Bug report status check \u2014 surface available fixes on boot",
|
|
4202
|
+
domain: "support",
|
|
4203
|
+
priority: "p1",
|
|
4204
|
+
content: "Once per session (COO boot only, never repeat), call list_my_bug_reports to check if any previously filed bug reports have been fixed by AskExe. If any report has status 'fixed' with a fixed_version, surface it to the founder immediately: '\u{1F527} N bug fix(es) available \u2014 run exe-os update to get version X.Y.Z'. This is a one-time check at boot, not a recurring poll. If no reports exist or none are fixed, skip silently. If the MCP tool is unavailable or the network call fails, skip silently \u2014 this is informational, not blocking."
|
|
4205
|
+
},
|
|
4206
|
+
{
|
|
4207
|
+
title: "Feature request triage \u2014 upstream feature vs local customization",
|
|
4208
|
+
domain: "support",
|
|
4209
|
+
priority: "p0",
|
|
4210
|
+
content: "When an agent or founder identifies a desired capability that exe-os does not yet provide, the COO (or equivalent coordinator) must decide: is this a local customization (identity, behavior, procedure, config, branding, workflow preference that can be configured in customer-owned layers) or an upstream feature request (a platform capability that requires changes to exe-os code, shipped via npm update)? Local customizations: implement immediately using store_behavior, update_identity, company_procedure, or config changes. Upstream features: use create_feature_request to submit to AskExe. Include use case, business impact, and current workaround. Do NOT ask the founder for permission to file a feature request \u2014 file it proactively when the need is clear."
|
|
4211
|
+
},
|
|
4212
|
+
{
|
|
4213
|
+
title: "Feature request status check \u2014 surface shipped features on boot",
|
|
4214
|
+
domain: "support",
|
|
4215
|
+
priority: "p1",
|
|
4216
|
+
content: "Once per session (COO boot only, never repeat), call list_my_feature_requests to check if any previously filed feature requests have been shipped by AskExe. If any request has status 'shipped' with a shipped_version, surface it to the founder immediately: '\u{1F680} N feature(s) shipped \u2014 run exe-os update to get version X.Y.Z'. This is a one-time check at boot, not a recurring poll. If no requests exist or none are shipped, skip silently. If the MCP tool is unavailable or the network call fails, skip silently \u2014 this is informational, not blocking."
|
|
4217
|
+
},
|
|
4182
4218
|
// --- Operations ---
|
|
4183
4219
|
{
|
|
4184
4220
|
title: "Managers must supervise deployed workers",
|
|
@@ -5453,7 +5489,7 @@ var init_session_registry = __esm({
|
|
|
5453
5489
|
});
|
|
5454
5490
|
|
|
5455
5491
|
// src/lib/session-key.ts
|
|
5456
|
-
import { execSync as
|
|
5492
|
+
import { execSync as execSync4 } from "child_process";
|
|
5457
5493
|
function normalizeCommand(command) {
|
|
5458
5494
|
const trimmed = command.trim().toLowerCase();
|
|
5459
5495
|
const parts = trimmed.split(/[\\/]/);
|
|
@@ -5472,7 +5508,7 @@ function resolveRuntimeProcess() {
|
|
|
5472
5508
|
let pid = process.ppid;
|
|
5473
5509
|
for (let i = 0; i < 10; i++) {
|
|
5474
5510
|
try {
|
|
5475
|
-
const info =
|
|
5511
|
+
const info = execSync4(`ps -p ${pid} -o ppid=,comm=`, {
|
|
5476
5512
|
encoding: "utf8",
|
|
5477
5513
|
timeout: 2e3
|
|
5478
5514
|
}).trim();
|
|
@@ -5638,14 +5674,14 @@ var init_transport = __esm({
|
|
|
5638
5674
|
});
|
|
5639
5675
|
|
|
5640
5676
|
// src/lib/cc-agent-support.ts
|
|
5641
|
-
import { execSync as
|
|
5677
|
+
import { execSync as execSync5 } from "child_process";
|
|
5642
5678
|
function _resetCcAgentSupportCache() {
|
|
5643
5679
|
_cachedSupport = null;
|
|
5644
5680
|
}
|
|
5645
5681
|
function claudeSupportsAgentFlag() {
|
|
5646
5682
|
if (_cachedSupport !== null) return _cachedSupport;
|
|
5647
5683
|
try {
|
|
5648
|
-
const helpOutput =
|
|
5684
|
+
const helpOutput = execSync5("claude --help 2>&1", {
|
|
5649
5685
|
encoding: "utf-8",
|
|
5650
5686
|
timeout: 5e3
|
|
5651
5687
|
});
|
|
@@ -6158,7 +6194,7 @@ var init_session_kill_telemetry = __esm({
|
|
|
6158
6194
|
});
|
|
6159
6195
|
|
|
6160
6196
|
// src/lib/project-name.ts
|
|
6161
|
-
import { execSync as
|
|
6197
|
+
import { execSync as execSync6 } from "child_process";
|
|
6162
6198
|
import path15 from "path";
|
|
6163
6199
|
function getProjectName(cwd) {
|
|
6164
6200
|
const dir = cwd ?? process.cwd();
|
|
@@ -6166,7 +6202,7 @@ function getProjectName(cwd) {
|
|
|
6166
6202
|
try {
|
|
6167
6203
|
let repoRoot;
|
|
6168
6204
|
try {
|
|
6169
|
-
const gitCommonDir =
|
|
6205
|
+
const gitCommonDir = execSync6("git rev-parse --path-format=absolute --git-common-dir", {
|
|
6170
6206
|
cwd: dir,
|
|
6171
6207
|
encoding: "utf8",
|
|
6172
6208
|
timeout: 2e3,
|
|
@@ -6174,7 +6210,7 @@ function getProjectName(cwd) {
|
|
|
6174
6210
|
}).trim();
|
|
6175
6211
|
repoRoot = path15.dirname(gitCommonDir);
|
|
6176
6212
|
} catch {
|
|
6177
|
-
repoRoot =
|
|
6213
|
+
repoRoot = execSync6("git rev-parse --show-toplevel", {
|
|
6178
6214
|
cwd: dir,
|
|
6179
6215
|
encoding: "utf8",
|
|
6180
6216
|
timeout: 2e3,
|
|
@@ -6281,7 +6317,7 @@ __export(tasks_crud_exports, {
|
|
|
6281
6317
|
import crypto4 from "crypto";
|
|
6282
6318
|
import path16 from "path";
|
|
6283
6319
|
import os11 from "os";
|
|
6284
|
-
import { execSync as
|
|
6320
|
+
import { execSync as execSync7 } from "child_process";
|
|
6285
6321
|
import { mkdir as mkdir4, writeFile as writeFile4, appendFile } from "fs/promises";
|
|
6286
6322
|
import { existsSync as existsSync15, readFileSync as readFileSync11 } from "fs";
|
|
6287
6323
|
async function writeCheckpoint(input) {
|
|
@@ -6626,14 +6662,14 @@ function isTmuxSessionAlive(identifier) {
|
|
|
6626
6662
|
if (!identifier || identifier === "unknown") return true;
|
|
6627
6663
|
try {
|
|
6628
6664
|
if (identifier.startsWith("%")) {
|
|
6629
|
-
const output =
|
|
6665
|
+
const output = execSync7("tmux list-panes -a -F '#{pane_id}'", {
|
|
6630
6666
|
timeout: 2e3,
|
|
6631
6667
|
encoding: "utf8",
|
|
6632
6668
|
stdio: ["pipe", "pipe", "pipe"]
|
|
6633
6669
|
});
|
|
6634
6670
|
return output.split("\n").some((l) => l.trim() === identifier);
|
|
6635
6671
|
} else {
|
|
6636
|
-
|
|
6672
|
+
execSync7(`tmux has-session -t ${JSON.stringify(identifier)}`, {
|
|
6637
6673
|
timeout: 2e3,
|
|
6638
6674
|
stdio: ["pipe", "pipe", "pipe"]
|
|
6639
6675
|
});
|
|
@@ -6642,7 +6678,7 @@ function isTmuxSessionAlive(identifier) {
|
|
|
6642
6678
|
} catch {
|
|
6643
6679
|
if (identifier.startsWith("%")) return true;
|
|
6644
6680
|
try {
|
|
6645
|
-
|
|
6681
|
+
execSync7("tmux list-sessions", {
|
|
6646
6682
|
timeout: 2e3,
|
|
6647
6683
|
stdio: ["pipe", "pipe", "pipe"]
|
|
6648
6684
|
});
|
|
@@ -6657,12 +6693,12 @@ function checkStaleCompletion(taskContext, taskCreatedAt) {
|
|
|
6657
6693
|
if (!DELEGATION_KEYWORDS.test(taskContext)) return null;
|
|
6658
6694
|
try {
|
|
6659
6695
|
const since = new Date(taskCreatedAt).toISOString();
|
|
6660
|
-
const branch =
|
|
6696
|
+
const branch = execSync7(
|
|
6661
6697
|
"git rev-parse --abbrev-ref HEAD 2>/dev/null",
|
|
6662
6698
|
{ encoding: "utf8", timeout: 3e3 }
|
|
6663
6699
|
).trim();
|
|
6664
6700
|
const branchArg = branch && branch !== "HEAD" ? branch : "";
|
|
6665
|
-
const commitCount =
|
|
6701
|
+
const commitCount = execSync7(
|
|
6666
6702
|
`git log --oneline --since="${since}" ${branchArg} 2>/dev/null | wc -l`,
|
|
6667
6703
|
{ encoding: "utf8", timeout: 5e3 }
|
|
6668
6704
|
).trim();
|
|
@@ -8261,7 +8297,7 @@ __export(tmux_routing_exports, {
|
|
|
8261
8297
|
spawnEmployee: () => spawnEmployee,
|
|
8262
8298
|
verifyPaneAtCapacity: () => verifyPaneAtCapacity
|
|
8263
8299
|
});
|
|
8264
|
-
import { execFileSync as execFileSync2, execSync as
|
|
8300
|
+
import { execFileSync as execFileSync2, execSync as execSync8 } from "child_process";
|
|
8265
8301
|
import { readFileSync as readFileSync12, writeFileSync as writeFileSync8, mkdirSync as mkdirSync8, existsSync as existsSync17, appendFileSync, readdirSync as readdirSync4 } from "fs";
|
|
8266
8302
|
import path20 from "path";
|
|
8267
8303
|
import os12 from "os";
|
|
@@ -8982,7 +9018,7 @@ function spawnEmployee(employeeName, exeSession2, projectDir, opts) {
|
|
|
8982
9018
|
let booted = false;
|
|
8983
9019
|
for (let i = 0; i < 30; i++) {
|
|
8984
9020
|
try {
|
|
8985
|
-
|
|
9021
|
+
execSync8("sleep 0.5");
|
|
8986
9022
|
} catch {
|
|
8987
9023
|
}
|
|
8988
9024
|
try {
|
|
@@ -9100,7 +9136,7 @@ __export(git_task_sweep_exports, {
|
|
|
9100
9136
|
matchScore: () => matchScore,
|
|
9101
9137
|
sweepTasks: () => sweepTasks
|
|
9102
9138
|
});
|
|
9103
|
-
import { execSync as
|
|
9139
|
+
import { execSync as execSync9 } from "child_process";
|
|
9104
9140
|
function extractKeywords(text) {
|
|
9105
9141
|
return text.toLowerCase().replace(/[^a-z0-9\s-]/g, " ").split(/\s+/).filter((w) => w.length >= 3 && !STOP_WORDS.has(w));
|
|
9106
9142
|
}
|
|
@@ -9129,7 +9165,7 @@ function matchScore(task, commitMessage, changedFiles) {
|
|
|
9129
9165
|
function getRecentCommits(limit = DEFAULT_COMMIT_LIMIT) {
|
|
9130
9166
|
try {
|
|
9131
9167
|
const SEPARATOR = "<<SEP>>";
|
|
9132
|
-
const output =
|
|
9168
|
+
const output = execSync9(
|
|
9133
9169
|
`git log --format="%h${SEPARATOR}%s${SEPARATOR}%aI" --name-only -n ${limit} -z`,
|
|
9134
9170
|
{ encoding: "utf8", timeout: 1e4 }
|
|
9135
9171
|
);
|
|
@@ -9320,12 +9356,12 @@ __export(worktree_exports, {
|
|
|
9320
9356
|
worktreeBranch: () => worktreeBranch,
|
|
9321
9357
|
worktreePath: () => worktreePath
|
|
9322
9358
|
});
|
|
9323
|
-
import { execSync as
|
|
9359
|
+
import { execSync as execSync10 } from "child_process";
|
|
9324
9360
|
import { existsSync as existsSync18, readFileSync as readFileSync13, appendFileSync as appendFileSync2, mkdirSync as mkdirSync9, realpathSync } from "fs";
|
|
9325
9361
|
import path21 from "path";
|
|
9326
9362
|
function getGitRoot(dir) {
|
|
9327
9363
|
try {
|
|
9328
|
-
const root =
|
|
9364
|
+
const root = execSync10("git rev-parse --show-toplevel", {
|
|
9329
9365
|
cwd: dir,
|
|
9330
9366
|
encoding: "utf-8",
|
|
9331
9367
|
timeout: GIT_TIMEOUT_MS,
|
|
@@ -9338,7 +9374,7 @@ function getGitRoot(dir) {
|
|
|
9338
9374
|
}
|
|
9339
9375
|
function getMainRepoRoot(dir) {
|
|
9340
9376
|
try {
|
|
9341
|
-
const commonDir =
|
|
9377
|
+
const commonDir = execSync10(
|
|
9342
9378
|
"git rev-parse --path-format=absolute --git-common-dir",
|
|
9343
9379
|
{ cwd: dir, encoding: "utf-8", timeout: GIT_TIMEOUT_MS, stdio: ["pipe", "pipe", "pipe"] }
|
|
9344
9380
|
).trim();
|
|
@@ -9369,7 +9405,7 @@ function ensureWorktree(projectDir, employeeName, instance) {
|
|
|
9369
9405
|
mkdirSync9(worktreesDir, { recursive: true });
|
|
9370
9406
|
ensureGitignoreEntry(repoRoot, "/.worktrees/");
|
|
9371
9407
|
try {
|
|
9372
|
-
|
|
9408
|
+
execSync10("git worktree prune", {
|
|
9373
9409
|
cwd: repoRoot,
|
|
9374
9410
|
encoding: "utf-8",
|
|
9375
9411
|
timeout: GIT_TIMEOUT_MS,
|
|
@@ -9380,14 +9416,14 @@ function ensureWorktree(projectDir, employeeName, instance) {
|
|
|
9380
9416
|
const branchExists = branchExistsLocally(repoRoot, branch);
|
|
9381
9417
|
try {
|
|
9382
9418
|
if (branchExists) {
|
|
9383
|
-
|
|
9419
|
+
execSync10(`git worktree add "${wtPath}" "${branch}"`, {
|
|
9384
9420
|
cwd: repoRoot,
|
|
9385
9421
|
encoding: "utf-8",
|
|
9386
9422
|
timeout: GIT_TIMEOUT_MS,
|
|
9387
9423
|
stdio: ["pipe", "pipe", "pipe"]
|
|
9388
9424
|
});
|
|
9389
9425
|
} else {
|
|
9390
|
-
|
|
9426
|
+
execSync10(`git worktree add "${wtPath}" -b "${branch}" HEAD`, {
|
|
9391
9427
|
cwd: repoRoot,
|
|
9392
9428
|
encoding: "utf-8",
|
|
9393
9429
|
timeout: GIT_TIMEOUT_MS,
|
|
@@ -9405,7 +9441,7 @@ function ensureWorktree(projectDir, employeeName, instance) {
|
|
|
9405
9441
|
}
|
|
9406
9442
|
function isWorktreeDirty(wtPath) {
|
|
9407
9443
|
try {
|
|
9408
|
-
const status =
|
|
9444
|
+
const status = execSync10("git status --porcelain", {
|
|
9409
9445
|
cwd: wtPath,
|
|
9410
9446
|
encoding: "utf-8",
|
|
9411
9447
|
timeout: GIT_TIMEOUT_MS,
|
|
@@ -9435,7 +9471,7 @@ function cleanupWorktree(projectDir, employeeName, instance) {
|
|
|
9435
9471
|
return { cleaned: false, reason: `branch ${branch} not merged into ${mainBranch}` };
|
|
9436
9472
|
}
|
|
9437
9473
|
try {
|
|
9438
|
-
|
|
9474
|
+
execSync10(`git worktree remove "${wtPath}"`, {
|
|
9439
9475
|
cwd: repoRoot,
|
|
9440
9476
|
encoding: "utf-8",
|
|
9441
9477
|
timeout: GIT_TIMEOUT_MS,
|
|
@@ -9448,7 +9484,7 @@ function cleanupWorktree(projectDir, employeeName, instance) {
|
|
|
9448
9484
|
};
|
|
9449
9485
|
}
|
|
9450
9486
|
try {
|
|
9451
|
-
|
|
9487
|
+
execSync10(`git branch -d "${branch}"`, {
|
|
9452
9488
|
cwd: repoRoot,
|
|
9453
9489
|
encoding: "utf-8",
|
|
9454
9490
|
timeout: GIT_TIMEOUT_MS,
|
|
@@ -9460,7 +9496,7 @@ function cleanupWorktree(projectDir, employeeName, instance) {
|
|
|
9460
9496
|
}
|
|
9461
9497
|
function branchExistsLocally(repoRoot, branch) {
|
|
9462
9498
|
try {
|
|
9463
|
-
|
|
9499
|
+
execSync10(`git rev-parse --verify "refs/heads/${branch}"`, {
|
|
9464
9500
|
cwd: repoRoot,
|
|
9465
9501
|
encoding: "utf-8",
|
|
9466
9502
|
timeout: GIT_TIMEOUT_MS,
|
|
@@ -9479,7 +9515,7 @@ function detectMainBranch(repoRoot) {
|
|
|
9479
9515
|
}
|
|
9480
9516
|
function isBranchMerged(repoRoot, branch, into) {
|
|
9481
9517
|
try {
|
|
9482
|
-
const merged =
|
|
9518
|
+
const merged = execSync10(`git branch --merged "${into}"`, {
|
|
9483
9519
|
cwd: repoRoot,
|
|
9484
9520
|
encoding: "utf-8",
|
|
9485
9521
|
timeout: GIT_TIMEOUT_MS,
|
|
@@ -9526,7 +9562,7 @@ init_database();
|
|
|
9526
9562
|
init_task_scope();
|
|
9527
9563
|
init_project_name();
|
|
9528
9564
|
import crypto7 from "crypto";
|
|
9529
|
-
import { execSync as
|
|
9565
|
+
import { execSync as execSync11 } from "child_process";
|
|
9530
9566
|
var agentName = process.argv[2];
|
|
9531
9567
|
var exeSession = process.argv[3];
|
|
9532
9568
|
if (!agentName) process.exit(0);
|
|
@@ -9702,7 +9738,7 @@ try {
|
|
|
9702
9738
|
}
|
|
9703
9739
|
const msg = `session-ended: ${agentName} session terminated. ${parts.join(". ")}`;
|
|
9704
9740
|
try {
|
|
9705
|
-
|
|
9741
|
+
execSync11(`tmux send-keys -t ${JSON.stringify(exeSession)} ${JSON.stringify(msg)} Enter`, {
|
|
9706
9742
|
timeout: 3e3
|
|
9707
9743
|
});
|
|
9708
9744
|
} catch {
|
|
@@ -9718,6 +9754,11 @@ try {
|
|
|
9718
9754
|
}
|
|
9719
9755
|
} catch {
|
|
9720
9756
|
}
|
|
9757
|
+
try {
|
|
9758
|
+
const client = getClient();
|
|
9759
|
+
await client.execute("PRAGMA wal_checkpoint(PASSIVE)");
|
|
9760
|
+
} catch {
|
|
9761
|
+
}
|
|
9721
9762
|
try {
|
|
9722
9763
|
const { cleanupWorktree: cleanupWorktree2 } = await Promise.resolve().then(() => (init_worktree(), worktree_exports));
|
|
9723
9764
|
const cleanup = cleanupWorktree2(process.cwd(), agentName);
|