squadrant 0.25.0 → 0.25.1
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/index.js +125 -70
- package/dist/index.js.map +1 -1
- package/dist/squadrantd.js +96 -37
- package/dist/squadrantd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -135,13 +135,8 @@ function getDefaultConfig() {
|
|
|
135
135
|
captain: "auto",
|
|
136
136
|
crew: "auto"
|
|
137
137
|
},
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
captain: "opus",
|
|
141
|
-
crew: "sonnet",
|
|
142
|
-
exploration: "haiku",
|
|
143
|
-
review: "opus"
|
|
144
|
-
},
|
|
138
|
+
// #874: no `models` here — it's deprecated (superseded by `roles`), so a
|
|
139
|
+
// fresh init wrote a key the drift check immediately flagged.
|
|
145
140
|
roles: {
|
|
146
141
|
command: { agent: "claude", model: "opus" },
|
|
147
142
|
captain: { agent: "claude", model: "opus" },
|
|
@@ -3359,6 +3354,8 @@ function sanitizePathForPlist(path40) {
|
|
|
3359
3354
|
continue;
|
|
3360
3355
|
if (p.includes("/.claude/plugins/"))
|
|
3361
3356
|
continue;
|
|
3357
|
+
if (p.includes("/.cmuxterm/cmux-cli-shims/"))
|
|
3358
|
+
continue;
|
|
3362
3359
|
if (seen.has(p))
|
|
3363
3360
|
continue;
|
|
3364
3361
|
seen.add(p);
|
|
@@ -3386,18 +3383,7 @@ function resolveAgentBinDirs() {
|
|
|
3386
3383
|
});
|
|
3387
3384
|
}
|
|
3388
3385
|
function buildDaemonPath(shellPath) {
|
|
3389
|
-
|
|
3390
|
-
const sanitized = sanitizePathForPlist(shellPath);
|
|
3391
|
-
if (agentDirs.length === 0)
|
|
3392
|
-
return sanitized;
|
|
3393
|
-
const parts = [...agentDirs, ...sanitized.split(":")];
|
|
3394
|
-
const seen = /* @__PURE__ */ new Set();
|
|
3395
|
-
return parts.filter((p) => {
|
|
3396
|
-
if (!p || seen.has(p))
|
|
3397
|
-
return false;
|
|
3398
|
-
seen.add(p);
|
|
3399
|
-
return true;
|
|
3400
|
-
}).join(":");
|
|
3386
|
+
return sanitizePathForPlist([...resolveAgentBinDirs(), shellPath].join(":"));
|
|
3401
3387
|
}
|
|
3402
3388
|
function renderPlist(nodeBin, daemonEntry, pathEnv = "") {
|
|
3403
3389
|
const logPath2 = join8(homedir5(), ".config", "squadrant", "squadrantd.log");
|
|
@@ -14346,14 +14332,14 @@ var init_runtimes = __esm({
|
|
|
14346
14332
|
});
|
|
14347
14333
|
|
|
14348
14334
|
// packages/workspaces/dist/notifiers/cmux.js
|
|
14349
|
-
import { execFile as execFileCb,
|
|
14335
|
+
import { execFile as execFileCb, execFileSync as execFileSync7 } from "child_process";
|
|
14350
14336
|
import { promisify as promisify2 } from "util";
|
|
14351
14337
|
function createCmuxNotifier(_scope) {
|
|
14352
14338
|
return {
|
|
14353
14339
|
name: "cmux",
|
|
14354
14340
|
async probe() {
|
|
14355
14341
|
try {
|
|
14356
|
-
|
|
14342
|
+
execFileSync7(resolveCmuxBin(), ["capabilities"], { encoding: "utf-8", stdio: "pipe", timeout: CMUX_TIMEOUT });
|
|
14357
14343
|
return { installed: true, reachable: true };
|
|
14358
14344
|
} catch (err) {
|
|
14359
14345
|
const code = err.code;
|
|
@@ -14371,6 +14357,7 @@ function createCmuxNotifier(_scope) {
|
|
|
14371
14357
|
var execFile3;
|
|
14372
14358
|
var init_cmux2 = __esm({
|
|
14373
14359
|
"packages/workspaces/dist/notifiers/cmux.js"() {
|
|
14360
|
+
init_dist();
|
|
14374
14361
|
init_cmux();
|
|
14375
14362
|
execFile3 = promisify2(execFileCb);
|
|
14376
14363
|
}
|
|
@@ -14678,9 +14665,9 @@ var init_events_bridge = __esm({
|
|
|
14678
14665
|
});
|
|
14679
14666
|
|
|
14680
14667
|
// packages/workspaces/dist/cmux-daemon/store-fingerprint.js
|
|
14681
|
-
import { execFileSync as
|
|
14668
|
+
import { execFileSync as execFileSync8 } from "child_process";
|
|
14682
14669
|
function defaultExecPs(pid) {
|
|
14683
|
-
return
|
|
14670
|
+
return execFileSync8("ps", ["-o", "command=", "-p", String(pid)], {
|
|
14684
14671
|
encoding: "utf-8",
|
|
14685
14672
|
stdio: ["ignore", "pipe", "ignore"]
|
|
14686
14673
|
});
|
|
@@ -14890,12 +14877,13 @@ function defaultReadFile(path40) {
|
|
|
14890
14877
|
return void 0;
|
|
14891
14878
|
}
|
|
14892
14879
|
}
|
|
14893
|
-
function defaultWatchDir(dir, cb) {
|
|
14880
|
+
function defaultWatchDir(dir, cb, onError) {
|
|
14894
14881
|
const w = watch(dir, (_event, filename) => {
|
|
14895
14882
|
if (typeof filename === "string" && filename.endsWith("-hook-sessions.json")) {
|
|
14896
14883
|
cb();
|
|
14897
14884
|
}
|
|
14898
14885
|
});
|
|
14886
|
+
w.on("error", onError);
|
|
14899
14887
|
return () => w.close();
|
|
14900
14888
|
}
|
|
14901
14889
|
var CmuxStoreSource;
|
|
@@ -14907,6 +14895,7 @@ var init_cmux_store_source = __esm({
|
|
|
14907
14895
|
debounceMs;
|
|
14908
14896
|
lockRetryMs;
|
|
14909
14897
|
maxLockRetries;
|
|
14898
|
+
rewatchMs;
|
|
14910
14899
|
isPidAlive;
|
|
14911
14900
|
listFiles;
|
|
14912
14901
|
readFile;
|
|
@@ -14918,6 +14907,7 @@ var init_cmux_store_source = __esm({
|
|
|
14918
14907
|
deps;
|
|
14919
14908
|
stopWatcher;
|
|
14920
14909
|
debounceTimer;
|
|
14910
|
+
rewatchTimer;
|
|
14921
14911
|
/** filename → pending lock-retry timer (one per locked file). */
|
|
14922
14912
|
lockRetryTimers = /* @__PURE__ */ new Map();
|
|
14923
14913
|
/** filename → re-scan attempts used in the current lock episode. */
|
|
@@ -14931,6 +14921,7 @@ var init_cmux_store_source = __esm({
|
|
|
14931
14921
|
this.debounceMs = opts.debounceMs ?? 50;
|
|
14932
14922
|
this.lockRetryMs = opts.lockRetryMs ?? 50;
|
|
14933
14923
|
this.maxLockRetries = opts.maxLockRetries ?? 3;
|
|
14924
|
+
this.rewatchMs = opts.rewatchMs ?? 5e3;
|
|
14934
14925
|
this.isPidAlive = opts.isPidAlive ?? defaultIsPidAlive2;
|
|
14935
14926
|
this.listFiles = opts.listFiles ?? defaultListFiles;
|
|
14936
14927
|
this.readFile = opts.readFile ?? defaultReadFile;
|
|
@@ -14946,18 +14937,17 @@ var init_cmux_store_source = __esm({
|
|
|
14946
14937
|
this.active = true;
|
|
14947
14938
|
this.lastError = null;
|
|
14948
14939
|
this.scan();
|
|
14949
|
-
|
|
14950
|
-
this.stopWatcher = this.watchDir(this.stateDir, () => this.scheduleDebounced());
|
|
14951
|
-
} catch (e) {
|
|
14952
|
-
this.lastError = e.message;
|
|
14953
|
-
this.log(`cmux-store: failed to watch ${this.stateDir}: ${e.message}`);
|
|
14954
|
-
}
|
|
14940
|
+
this.armWatcher();
|
|
14955
14941
|
}
|
|
14956
14942
|
stop() {
|
|
14957
14943
|
if (this.debounceTimer !== void 0) {
|
|
14958
14944
|
this.cancelTimer(this.debounceTimer);
|
|
14959
14945
|
this.debounceTimer = void 0;
|
|
14960
14946
|
}
|
|
14947
|
+
if (this.rewatchTimer !== void 0) {
|
|
14948
|
+
this.cancelTimer(this.rewatchTimer);
|
|
14949
|
+
this.rewatchTimer = void 0;
|
|
14950
|
+
}
|
|
14961
14951
|
for (const timer of this.lockRetryTimers.values()) {
|
|
14962
14952
|
this.cancelTimer(timer);
|
|
14963
14953
|
}
|
|
@@ -14978,6 +14968,36 @@ var init_cmux_store_source = __esm({
|
|
|
14978
14968
|
return { active: this.active, error: this.lastError };
|
|
14979
14969
|
}
|
|
14980
14970
|
// ── private ─────────────────────────────────────────────────────────────────
|
|
14971
|
+
/** Watch for subsequent changes, debounced. */
|
|
14972
|
+
armWatcher() {
|
|
14973
|
+
try {
|
|
14974
|
+
this.stopWatcher = this.watchDir(this.stateDir, () => this.scheduleDebounced(), (err) => this.onWatchError(err));
|
|
14975
|
+
} catch (e) {
|
|
14976
|
+
this.lastError = e.message;
|
|
14977
|
+
this.log(`cmux-store: failed to watch ${this.stateDir}: ${e.message}`);
|
|
14978
|
+
}
|
|
14979
|
+
}
|
|
14980
|
+
/**
|
|
14981
|
+
* The watcher failed after starting (macOS: a refused FSEventStreamStart()
|
|
14982
|
+
* surfaces as EMFILE). Drop it and re-arm later instead of letting the error
|
|
14983
|
+
* escape as an uncaughtException that kills the daemon.
|
|
14984
|
+
*/
|
|
14985
|
+
onWatchError(err) {
|
|
14986
|
+
this.lastError = err.message;
|
|
14987
|
+
this.log(`cmux-store: watcher error on ${this.stateDir}: ${err.message} \u2014 re-arming in ${this.rewatchMs}ms`);
|
|
14988
|
+
this.stopWatcher?.();
|
|
14989
|
+
this.stopWatcher = void 0;
|
|
14990
|
+
if (!this.active || this.rewatchTimer !== void 0)
|
|
14991
|
+
return;
|
|
14992
|
+
this.rewatchTimer = this.scheduleTimer(() => {
|
|
14993
|
+
this.rewatchTimer = void 0;
|
|
14994
|
+
if (!this.active)
|
|
14995
|
+
return;
|
|
14996
|
+
this.lastError = null;
|
|
14997
|
+
this.scan();
|
|
14998
|
+
this.armWatcher();
|
|
14999
|
+
}, this.rewatchMs);
|
|
15000
|
+
}
|
|
14981
15001
|
scheduleDebounced() {
|
|
14982
15002
|
if (this.debounceTimer !== void 0) {
|
|
14983
15003
|
this.cancelTimer(this.debounceTimer);
|
|
@@ -15079,8 +15099,35 @@ var init_cmux_store_source = __esm({
|
|
|
15079
15099
|
import { join as join25 } from "path";
|
|
15080
15100
|
import { homedir as homedir13 } from "os";
|
|
15081
15101
|
import { mkdirSync as mkdirSync8, readFileSync as readFileSync18, writeFileSync as writeFileSync11 } from "fs";
|
|
15082
|
-
function hookCommandFor(eventName, sub, hookCmd) {
|
|
15083
|
-
return eventName === "PermissionRequest" ? `${
|
|
15102
|
+
function hookCommandFor(eventName, sub, hookCmd, gateCmd) {
|
|
15103
|
+
return eventName === "PermissionRequest" ? `${gateCmd} claude ${sub}` : `${hookCmd} claude ${sub}`;
|
|
15104
|
+
}
|
|
15105
|
+
function isSquadrantOwnedCommand(command, sub) {
|
|
15106
|
+
if (typeof command !== "string")
|
|
15107
|
+
return false;
|
|
15108
|
+
const m = command.match(/^(.*) (?:hooks|gate) claude (\S+)$/);
|
|
15109
|
+
if (!m || m[2] !== sub)
|
|
15110
|
+
return false;
|
|
15111
|
+
const prefix = m[1];
|
|
15112
|
+
return prefix === DEFAULT_CLI_CMD || /squadrant\/dist\/index\.js'?$/.test(prefix);
|
|
15113
|
+
}
|
|
15114
|
+
function removeStaleOwnedHandlers(entries, sub, keep) {
|
|
15115
|
+
let removed = false;
|
|
15116
|
+
for (let i = entries.length - 1; i >= 0; i--) {
|
|
15117
|
+
const entry = entries[i];
|
|
15118
|
+
if (!Array.isArray(entry?.hooks))
|
|
15119
|
+
continue;
|
|
15120
|
+
const before = entry.hooks.length;
|
|
15121
|
+
entry.hooks = entry.hooks.filter((h) => {
|
|
15122
|
+
const cmd = h?.command;
|
|
15123
|
+
return cmd === keep || !isSquadrantOwnedCommand(cmd, sub);
|
|
15124
|
+
});
|
|
15125
|
+
if (entry.hooks.length !== before)
|
|
15126
|
+
removed = true;
|
|
15127
|
+
if (entry.hooks.length === 0)
|
|
15128
|
+
entries.splice(i, 1);
|
|
15129
|
+
}
|
|
15130
|
+
return removed;
|
|
15084
15131
|
}
|
|
15085
15132
|
function removeCommandHandlers(entries, command) {
|
|
15086
15133
|
let removed = false;
|
|
@@ -15140,7 +15187,9 @@ function removeForeignGateHandlers(entries) {
|
|
|
15140
15187
|
}
|
|
15141
15188
|
function installClaudeHooks(opts = {}) {
|
|
15142
15189
|
const settingsPath = opts.settingsPath ?? join25(homedir13(), ".claude", "settings.json");
|
|
15143
|
-
const
|
|
15190
|
+
const cliCmd = opts.cliCmd ?? DEFAULT_CLI_CMD;
|
|
15191
|
+
const hookCmd = opts.hookCmd ?? `${cliCmd} hooks`;
|
|
15192
|
+
const gateCmd = `${cliCmd} gate`;
|
|
15144
15193
|
const readFile7 = opts.readFile ?? defaultReadFile2;
|
|
15145
15194
|
const writeFile6 = opts.writeFile ?? defaultWriteFile;
|
|
15146
15195
|
const log = opts.log ?? (() => {
|
|
@@ -15162,12 +15211,13 @@ function installClaudeHooks(opts = {}) {
|
|
|
15162
15211
|
let changed = false;
|
|
15163
15212
|
const repaired = [];
|
|
15164
15213
|
const migrated = [];
|
|
15214
|
+
const repointed = [];
|
|
15165
15215
|
for (const [eventName, sub, matcher] of CLAUDE_HOOK_EVENTS) {
|
|
15166
15216
|
if (!Array.isArray(hooks[eventName])) {
|
|
15167
15217
|
hooks[eventName] = [];
|
|
15168
15218
|
}
|
|
15169
15219
|
const entries = hooks[eventName];
|
|
15170
|
-
const command = hookCommandFor(eventName, sub, hookCmd);
|
|
15220
|
+
const command = hookCommandFor(eventName, sub, hookCmd, gateCmd);
|
|
15171
15221
|
const hookMatcher = matcher ?? "";
|
|
15172
15222
|
if (eventName === "PermissionRequest") {
|
|
15173
15223
|
const legacy = `${hookCmd} claude ${sub}`;
|
|
@@ -15193,11 +15243,14 @@ function installClaudeHooks(opts = {}) {
|
|
|
15193
15243
|
}
|
|
15194
15244
|
}
|
|
15195
15245
|
}
|
|
15246
|
+
const wasRepointed = removeStaleOwnedHandlers(entries, sub, command);
|
|
15247
|
+
if (wasRepointed)
|
|
15248
|
+
changed = true;
|
|
15196
15249
|
const alreadyPresent = entries.some((m) => Array.isArray(m.hooks) && m.hooks.some((h) => typeof h.command === "string" && h.command === command));
|
|
15197
15250
|
if (!alreadyPresent) {
|
|
15198
15251
|
entries.push({ matcher: hookMatcher, hooks: [{ type: "command", command, timeout: 10 }] });
|
|
15199
15252
|
changed = true;
|
|
15200
|
-
repaired.push(`${eventName}/${sub}`);
|
|
15253
|
+
(wasRepointed ? repointed : repaired).push(`${eventName}/${sub}`);
|
|
15201
15254
|
}
|
|
15202
15255
|
}
|
|
15203
15256
|
if (repaired.length > 0 && hadExistingSettings) {
|
|
@@ -15206,6 +15259,9 @@ function installClaudeHooks(opts = {}) {
|
|
|
15206
15259
|
if (migrated.length > 0) {
|
|
15207
15260
|
log(`native-hook: migrated ${migrated.length} PermissionRequest hook(s) to the U7 permission gate in ${settingsPath} [${migrated.join(", ")}]`);
|
|
15208
15261
|
}
|
|
15262
|
+
if (repointed.length > 0) {
|
|
15263
|
+
log(`native-hook: repointed ${repointed.length} squadrant hook(s) to ${cliCmd} in ${settingsPath} [${repointed.join(", ")}]`);
|
|
15264
|
+
}
|
|
15209
15265
|
if (opts.claudeEnv && Object.keys(opts.claudeEnv).length > 0) {
|
|
15210
15266
|
if (typeof settings.env !== "object" || settings.env === null || Array.isArray(settings.env)) {
|
|
15211
15267
|
settings.env = {};
|
|
@@ -15320,7 +15376,7 @@ function defaultWriteFile(path40, content) {
|
|
|
15320
15376
|
mkdirSync8(path40.replace(/\/[^/]+$/, ""), { recursive: true });
|
|
15321
15377
|
writeFileSync11(path40, content, "utf-8");
|
|
15322
15378
|
}
|
|
15323
|
-
var CLAUDE_HOOK_EVENTS,
|
|
15379
|
+
var CLAUDE_HOOK_EVENTS, DEFAULT_CLI_CMD, FOREIGN_AUTO_GATE_MARKER, SUBAGENT_MODEL_KEY, SMALL_FAST_MODEL_KEY, NativeHookSource;
|
|
15324
15380
|
var init_native_hook_source = __esm({
|
|
15325
15381
|
"packages/workspaces/dist/native-hooks/native-hook-source.js"() {
|
|
15326
15382
|
CLAUDE_HOOK_EVENTS = [
|
|
@@ -15338,8 +15394,7 @@ var init_native_hook_source = __esm({
|
|
|
15338
15394
|
// this at all; without it the watchdog reports a plain stall (wrong story).
|
|
15339
15395
|
["StopFailure", "stop-failure"]
|
|
15340
15396
|
];
|
|
15341
|
-
|
|
15342
|
-
GATE_HOOK_CMD = "squadrant gate";
|
|
15397
|
+
DEFAULT_CLI_CMD = "squadrant";
|
|
15343
15398
|
FOREIGN_AUTO_GATE_MARKER = "auto-gate-managed";
|
|
15344
15399
|
SUBAGENT_MODEL_KEY = "CLAUDE_CODE_SUBAGENT_MODEL";
|
|
15345
15400
|
SMALL_FAST_MODEL_KEY = "ANTHROPIC_SMALL_FAST_MODEL";
|
|
@@ -15853,7 +15908,7 @@ init_dist();
|
|
|
15853
15908
|
init_dist();
|
|
15854
15909
|
init_dist4();
|
|
15855
15910
|
import { Command } from "commander";
|
|
15856
|
-
import { execSync as
|
|
15911
|
+
import { execSync as execSync7 } from "child_process";
|
|
15857
15912
|
import fs20 from "fs";
|
|
15858
15913
|
import { stat } from "fs/promises";
|
|
15859
15914
|
import path23 from "path";
|
|
@@ -15936,7 +15991,7 @@ function printServiceHealth(rows, now = Date.now()) {
|
|
|
15936
15991
|
init_dist3();
|
|
15937
15992
|
function commandExists(cmd) {
|
|
15938
15993
|
try {
|
|
15939
|
-
|
|
15994
|
+
execSync7(`which ${cmd}`, { stdio: "ignore" });
|
|
15940
15995
|
return true;
|
|
15941
15996
|
} catch {
|
|
15942
15997
|
return false;
|
|
@@ -15944,7 +15999,7 @@ function commandExists(cmd) {
|
|
|
15944
15999
|
}
|
|
15945
16000
|
function claudeVersionOk() {
|
|
15946
16001
|
try {
|
|
15947
|
-
const version =
|
|
16002
|
+
const version = execSync7("claude --version", { encoding: "utf-8" }).trim();
|
|
15948
16003
|
const match = version.match(/(\d+)\.(\d+)\.(\d+)/);
|
|
15949
16004
|
if (!match) return false;
|
|
15950
16005
|
const [major, minor, patch] = match.slice(1).map(Number);
|
|
@@ -15986,7 +16041,7 @@ function nodeVersionOk() {
|
|
|
15986
16041
|
}
|
|
15987
16042
|
function tryGetVersion(cmd) {
|
|
15988
16043
|
try {
|
|
15989
|
-
return
|
|
16044
|
+
return execSync7(`${cmd} --version`, { encoding: "utf-8" }).trim();
|
|
15990
16045
|
} catch {
|
|
15991
16046
|
return "";
|
|
15992
16047
|
}
|
|
@@ -16023,7 +16078,7 @@ function readPackageVersion(packageJsonPath) {
|
|
|
16023
16078
|
}
|
|
16024
16079
|
function tryGetGlobalRoot(cmd, args) {
|
|
16025
16080
|
try {
|
|
16026
|
-
return
|
|
16081
|
+
return execSync7(`${cmd} ${args.join(" ")}`, { encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] }).trim() || void 0;
|
|
16027
16082
|
} catch {
|
|
16028
16083
|
return void 0;
|
|
16029
16084
|
}
|
|
@@ -16461,7 +16516,7 @@ function writePerCrewOpencodeConfig(o) {
|
|
|
16461
16516
|
}
|
|
16462
16517
|
|
|
16463
16518
|
// packages/cli/src/lib/claude-auth.ts
|
|
16464
|
-
import { execSync as
|
|
16519
|
+
import { execSync as execSync8 } from "child_process";
|
|
16465
16520
|
function parseClaudeAuthStatus(raw) {
|
|
16466
16521
|
let parsed;
|
|
16467
16522
|
try {
|
|
@@ -16479,7 +16534,7 @@ function parseClaudeAuthStatus(raw) {
|
|
|
16479
16534
|
};
|
|
16480
16535
|
}
|
|
16481
16536
|
function detectClaudeAuth(probe = {}) {
|
|
16482
|
-
const run = probe.run ?? (() =>
|
|
16537
|
+
const run = probe.run ?? (() => execSync8("claude auth status", {
|
|
16483
16538
|
encoding: "utf8",
|
|
16484
16539
|
stdio: ["ignore", "pipe", "ignore"],
|
|
16485
16540
|
timeout: 1e4
|
|
@@ -16959,7 +17014,7 @@ init_dist4();
|
|
|
16959
17014
|
init_dist3();
|
|
16960
17015
|
init_dist();
|
|
16961
17016
|
import { Command as Command5 } from "commander";
|
|
16962
|
-
import { execSync as
|
|
17017
|
+
import { execSync as execSync9 } from "child_process";
|
|
16963
17018
|
import path26 from "path";
|
|
16964
17019
|
import os15 from "os";
|
|
16965
17020
|
import chalk7 from "chalk";
|
|
@@ -16970,7 +17025,7 @@ var TASK_PROMPTS = {
|
|
|
16970
17025
|
"wiki-aggregate": "Run a wiki aggregation pass using the squadrant:command-ops skill. Scan each spoke wiki index, identify shared knowledge worth promoting, write hub wiki pages, and exit when done."
|
|
16971
17026
|
};
|
|
16972
17027
|
function detectCurrentWorkspace() {
|
|
16973
|
-
const out =
|
|
17028
|
+
const out = execSync9(`"${resolveCmuxBin()}" current-workspace`, { encoding: "utf-8" }).trim();
|
|
16974
17029
|
const match = out.match(/workspace:\d+/);
|
|
16975
17030
|
if (!match) {
|
|
16976
17031
|
throw new Error("Could not detect current cmux workspace. Run `squadrant command` from inside a cmux workspace.");
|
|
@@ -17037,7 +17092,7 @@ init_dist3();
|
|
|
17037
17092
|
import { Command as Command9 } from "commander";
|
|
17038
17093
|
import { createConnection as createConnection4 } from "net";
|
|
17039
17094
|
import { randomUUID as randomUUID5 } from "crypto";
|
|
17040
|
-
import { execFileSync as
|
|
17095
|
+
import { execFileSync as execFileSync9 } from "child_process";
|
|
17041
17096
|
import { homedir as homedir15 } from "os";
|
|
17042
17097
|
import { join as join27 } from "path";
|
|
17043
17098
|
import { mkdirSync as mkdirSync10, writeFileSync as writeFileSync13 } from "fs";
|
|
@@ -17541,10 +17596,10 @@ function resolveApproveTarget(tasks, crew) {
|
|
|
17541
17596
|
return matches.reduce((a, b) => (b.createdAt ?? 0) > (a.createdAt ?? 0) ? b : a);
|
|
17542
17597
|
}
|
|
17543
17598
|
function defaultPushBranch(cwd, branch) {
|
|
17544
|
-
|
|
17599
|
+
execFileSync9("git", ["-C", cwd, "push", "-u", "origin", branch], { encoding: "utf-8", stdio: ["ignore", "pipe", "pipe"] });
|
|
17545
17600
|
}
|
|
17546
17601
|
function defaultCreatePr(cwd, o) {
|
|
17547
|
-
return
|
|
17602
|
+
return execFileSync9(
|
|
17548
17603
|
"gh",
|
|
17549
17604
|
["pr", "create", "--base", o.base, "--head", o.branch, "--title", o.title, "--body", o.body],
|
|
17550
17605
|
{ cwd, encoding: "utf-8" }
|
|
@@ -17552,7 +17607,7 @@ function defaultCreatePr(cwd, o) {
|
|
|
17552
17607
|
}
|
|
17553
17608
|
function defaultGetCommitSubject(cwd) {
|
|
17554
17609
|
try {
|
|
17555
|
-
return
|
|
17610
|
+
return execFileSync9("git", ["-C", cwd, "log", "-1", "--format=%s"], {
|
|
17556
17611
|
encoding: "utf-8",
|
|
17557
17612
|
stdio: ["ignore", "pipe", "pipe"]
|
|
17558
17613
|
}).trim();
|
|
@@ -18092,7 +18147,7 @@ init_dist();
|
|
|
18092
18147
|
init_dist4();
|
|
18093
18148
|
import { Command as Command11 } from "commander";
|
|
18094
18149
|
import chalk11 from "chalk";
|
|
18095
|
-
import { execFileSync as
|
|
18150
|
+
import { execFileSync as execFileSync10 } from "child_process";
|
|
18096
18151
|
import readline2 from "readline";
|
|
18097
18152
|
function resolveDiffTarget(tasks, crew, projectPath) {
|
|
18098
18153
|
const matches = tasks.filter((t) => t.name === crew);
|
|
@@ -18163,14 +18218,14 @@ function promptLine2(question) {
|
|
|
18163
18218
|
}
|
|
18164
18219
|
function getPrDiff(projectPath, pr) {
|
|
18165
18220
|
try {
|
|
18166
|
-
return
|
|
18221
|
+
return execFileSync10("gh", ["pr", "diff", pr], { cwd: projectPath, encoding: "utf-8" });
|
|
18167
18222
|
} catch (e) {
|
|
18168
18223
|
throw new Error(`Could not fetch PR #${pr} diff (gh pr diff failed): ${e.message}`);
|
|
18169
18224
|
}
|
|
18170
18225
|
}
|
|
18171
18226
|
function getRefsDiff(projectPath, base, head) {
|
|
18172
18227
|
try {
|
|
18173
|
-
return
|
|
18228
|
+
return execFileSync10("git", ["-C", projectPath, "diff", `${base}...${head}`], { encoding: "utf-8" });
|
|
18174
18229
|
} catch (e) {
|
|
18175
18230
|
throw new Error(`Could not diff ${base}...${head}: ${e.message}`);
|
|
18176
18231
|
}
|
|
@@ -18191,7 +18246,7 @@ async function openCrewDiff(project, proj, crew, opts, runtime, workspaceId) {
|
|
|
18191
18246
|
let opened = 0;
|
|
18192
18247
|
for (const source of sources) {
|
|
18193
18248
|
const statArgs = source === "staged" ? ["diff", "--stat", "--cached"] : ["diff", "--stat"];
|
|
18194
|
-
const stat2 =
|
|
18249
|
+
const stat2 = execFileSync10("git", ["-C", target.cwd, ...statArgs], { encoding: "utf-8" }).trim();
|
|
18195
18250
|
if (!stat2) continue;
|
|
18196
18251
|
await runtime.showDiff({
|
|
18197
18252
|
workspaceId,
|
|
@@ -18212,7 +18267,7 @@ async function openCrewDiff(project, proj, crew, opts, runtime, workspaceId) {
|
|
|
18212
18267
|
}
|
|
18213
18268
|
return;
|
|
18214
18269
|
}
|
|
18215
|
-
const diffStat =
|
|
18270
|
+
const diffStat = execFileSync10(
|
|
18216
18271
|
"git",
|
|
18217
18272
|
["-C", target.cwd, "diff", "--stat", `${base}...HEAD`],
|
|
18218
18273
|
{ encoding: "utf-8" }
|
|
@@ -18261,7 +18316,7 @@ async function runDiff(project, crewArg, opts) {
|
|
|
18261
18316
|
const base = resolveWorktreeBase(proj.path);
|
|
18262
18317
|
const stats = buildCrewDiffStats(tasks, proj.path, base, (cwd, b) => {
|
|
18263
18318
|
try {
|
|
18264
|
-
return
|
|
18319
|
+
return execFileSync10("git", ["-C", cwd, "diff", "--stat", `${b}...HEAD`], { encoding: "utf-8" });
|
|
18265
18320
|
} catch {
|
|
18266
18321
|
return "";
|
|
18267
18322
|
}
|
|
@@ -18432,7 +18487,7 @@ sideCommand.command("close").description("Close a side-session (closes its tab)"
|
|
|
18432
18487
|
init_dist();
|
|
18433
18488
|
init_dist4();
|
|
18434
18489
|
import { Command as Command13 } from "commander";
|
|
18435
|
-
import { execSync as
|
|
18490
|
+
import { execSync as execSync10 } from "child_process";
|
|
18436
18491
|
import chalk14 from "chalk";
|
|
18437
18492
|
|
|
18438
18493
|
// packages/web/dist/read-status.js
|
|
@@ -19853,7 +19908,7 @@ async function startWebServer(opts) {
|
|
|
19853
19908
|
init_dist();
|
|
19854
19909
|
var SOCK3 = DAEMON_SOCK_PATH;
|
|
19855
19910
|
function detectCurrentWorkspace2() {
|
|
19856
|
-
const out =
|
|
19911
|
+
const out = execSync10(`"${resolveCmuxBin()}" current-workspace`, { encoding: "utf-8" }).trim();
|
|
19857
19912
|
const match = out.match(/workspace:\d+/);
|
|
19858
19913
|
if (!match) {
|
|
19859
19914
|
throw new Error("Could not detect current cmux workspace. Run `squadrant dashboard --pane` from inside a cmux workspace.");
|
|
@@ -19936,7 +19991,7 @@ init_dist3();
|
|
|
19936
19991
|
init_dist4();
|
|
19937
19992
|
init_dist2();
|
|
19938
19993
|
import { Command as Command14 } from "commander";
|
|
19939
|
-
import { execSync as
|
|
19994
|
+
import { execSync as execSync11, execFileSync as execFileSync11 } from "child_process";
|
|
19940
19995
|
import fs25 from "fs";
|
|
19941
19996
|
import path29 from "path";
|
|
19942
19997
|
import os17 from "os";
|
|
@@ -20054,7 +20109,7 @@ function pickResumeSessionId(record, agentName, fresh = false) {
|
|
|
20054
20109
|
}
|
|
20055
20110
|
function isOpencodeCaptainDir(dir) {
|
|
20056
20111
|
try {
|
|
20057
|
-
|
|
20112
|
+
execFileSync11("git", ["-C", dir, "rev-parse", "--verify", "HEAD"], { stdio: "ignore" });
|
|
20058
20113
|
return true;
|
|
20059
20114
|
} catch {
|
|
20060
20115
|
return false;
|
|
@@ -20068,7 +20123,7 @@ function resolveAnthropicRefusal(role, workspaceName, agentName, model, readOpen
|
|
|
20068
20123
|
function ensureCmuxReady(headless) {
|
|
20069
20124
|
if (headless || isInsideCmux()) return;
|
|
20070
20125
|
console.log(chalk15.yellow("\n Not running inside cmux. Opening cmux app...\n"));
|
|
20071
|
-
|
|
20126
|
+
execSync11(`open "${CMUX_APP}"`, { stdio: "inherit" });
|
|
20072
20127
|
console.log(chalk15.bold(" Run `squadrant launch` from inside a cmux workspace.\n"));
|
|
20073
20128
|
process.exit(0);
|
|
20074
20129
|
}
|
|
@@ -20489,7 +20544,7 @@ import fs26 from "fs";
|
|
|
20489
20544
|
import os18 from "os";
|
|
20490
20545
|
import path30 from "path";
|
|
20491
20546
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
20492
|
-
import { execSync as
|
|
20547
|
+
import { execSync as execSync12 } from "child_process";
|
|
20493
20548
|
import chalk17 from "chalk";
|
|
20494
20549
|
var REPO_URL = "https://github.com/tu11aa/squadrant";
|
|
20495
20550
|
function readPkgVersion() {
|
|
@@ -20548,7 +20603,7 @@ var feedbackCommand = new Command16("feedback").description("Open a pre-filled G
|
|
|
20548
20603
|
console.log(chalk17.dim(` URL: ${issueUrl.substring(0, 80)}...
|
|
20549
20604
|
`));
|
|
20550
20605
|
try {
|
|
20551
|
-
|
|
20606
|
+
execSync12(`open "${issueUrl}"`, { stdio: "ignore" });
|
|
20552
20607
|
console.log(chalk17.green(" \u2714 Browser opened\n"));
|
|
20553
20608
|
} catch {
|
|
20554
20609
|
console.log(chalk17.yellow(" \u26A0 Could not open browser automatically."));
|
|
@@ -21303,7 +21358,7 @@ function readPkgVersion2() {
|
|
|
21303
21358
|
|
|
21304
21359
|
// packages/cli/src/commands/heal.ts
|
|
21305
21360
|
init_dist();
|
|
21306
|
-
import { execFileSync as
|
|
21361
|
+
import { execFileSync as execFileSync12 } from "child_process";
|
|
21307
21362
|
import { join as join31 } from "path";
|
|
21308
21363
|
import { homedir as homedir17 } from "os";
|
|
21309
21364
|
import { Command as Command24 } from "commander";
|
|
@@ -21512,7 +21567,7 @@ async function runHealCaptain(projects, deps) {
|
|
|
21512
21567
|
}
|
|
21513
21568
|
function kickstartDaemonForHealCaptain() {
|
|
21514
21569
|
const uid = process.getuid?.() ?? 0;
|
|
21515
|
-
|
|
21570
|
+
execFileSync12("launchctl", ["kickstart", "-k", `gui/${uid}/${LABEL}`], { stdio: "ignore" });
|
|
21516
21571
|
}
|
|
21517
21572
|
var healCommand = new Command24("heal").description("Targeted, idempotent remediation for squadrant components (daemon, health)").addHelpText("after", "\nDeferred: 'squadrant heal crew <id>' (re-attach) \u2014 see issue #100.").addCommand(
|
|
21518
21573
|
new Command24("status").description("Dry-run: print unhealthy components and the exact heal command for each").option("-p, --project <project>", "scope to one project").option("--json", "output machine-readable JSON (exit 0=healthy, 1=error, 2=unhealthy)").action(async (opts) => {
|
|
@@ -21577,7 +21632,7 @@ import chalk26 from "chalk";
|
|
|
21577
21632
|
init_dist();
|
|
21578
21633
|
init_dist2();
|
|
21579
21634
|
import { Command as Command25 } from "commander";
|
|
21580
|
-
import { execSync as
|
|
21635
|
+
import { execSync as execSync13 } from "child_process";
|
|
21581
21636
|
import chalk25 from "chalk";
|
|
21582
21637
|
async function runDispatch(toProject, task, opts) {
|
|
21583
21638
|
const fromProject = resolveCurrentProject(loadConfig());
|
|
@@ -21593,7 +21648,7 @@ async function runDispatch(toProject, task, opts) {
|
|
|
21593
21648
|
warmupTimeoutMs: opts.warmupTimeout,
|
|
21594
21649
|
bootCaptain: async (project) => {
|
|
21595
21650
|
try {
|
|
21596
|
-
|
|
21651
|
+
execSync13(`squadrant launch ${project}`, { stdio: "ignore", timeout: 15e3 });
|
|
21597
21652
|
} catch {
|
|
21598
21653
|
throw new Error(`failed to launch captain for '${project}' \u2014 is squadrant installed?`);
|
|
21599
21654
|
}
|
|
@@ -23158,7 +23213,7 @@ import os20 from "os";
|
|
|
23158
23213
|
|
|
23159
23214
|
// packages/cli/src/lib/handoff-live-repo.ts
|
|
23160
23215
|
init_dist();
|
|
23161
|
-
import { execFileSync as
|
|
23216
|
+
import { execFileSync as execFileSync13 } from "child_process";
|
|
23162
23217
|
import fs33 from "fs";
|
|
23163
23218
|
import path36 from "path";
|
|
23164
23219
|
|
|
@@ -23237,7 +23292,7 @@ var OPEN_PR_LIMIT = 20;
|
|
|
23237
23292
|
var RELEASE_BRANCH = "main";
|
|
23238
23293
|
var defaultCommandRunner = {
|
|
23239
23294
|
run(cmd, args, cwd) {
|
|
23240
|
-
return
|
|
23295
|
+
return execFileSync13(cmd, args, { cwd, encoding: "utf-8", stdio: ["ignore", "pipe", "pipe"] });
|
|
23241
23296
|
}
|
|
23242
23297
|
};
|
|
23243
23298
|
function tryRun2(runner, cmd, args, cwd) {
|