@wrongstack/cli 0.292.0 → 0.293.0
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/data/providers.json +346 -17
- package/dist/boot/container-wiring.d.ts +0 -2
- package/dist/boot/container-wiring.d.ts.map +1 -1
- package/dist/boot/tui-settings-adapter.d.ts +0 -1
- package/dist/boot/tui-settings-adapter.d.ts.map +1 -1
- package/dist/boot.d.ts +15 -0
- package/dist/boot.d.ts.map +1 -1
- package/dist/cli-context.d.ts.map +1 -1
- package/dist/execute-deps.d.ts +0 -2
- package/dist/execute-deps.d.ts.map +1 -1
- package/dist/execution.d.ts +1 -3
- package/dist/execution.d.ts.map +1 -1
- package/dist/fleet/host.d.ts.map +1 -1
- package/dist/hq-server.d.ts.map +1 -1
- package/dist/index.js +187 -158
- package/dist/index.js.map +3 -3
- package/dist/repl.d.ts +0 -2
- package/dist/repl.d.ts.map +1 -1
- package/dist/slash-commands/acp.d.ts.map +1 -1
- package/dist/slash-commands/agents.d.ts.map +1 -1
- package/dist/slash-commands/index.d.ts +0 -4
- package/dist/slash-commands/index.d.ts.map +1 -1
- package/dist/slash-commands/settings.d.ts.map +1 -1
- package/dist/subcommands/handlers/acp.d.ts.map +1 -1
- package/dist/subcommands/handlers/mailbox-serve.d.ts.map +1 -1
- package/dist/subcommands/handlers/permissions.d.ts.map +1 -1
- package/dist/webui-server/message-router.d.ts.map +1 -1
- package/dist/webui-server/prefs-seeding.d.ts +1 -1
- package/dist/webui-server/prefs-seeding.d.ts.map +1 -1
- package/dist/webui-server/ws-handlers/oauth.d.ts +1 -1
- package/dist/webui-server/ws-handlers/oauth.d.ts.map +1 -1
- package/dist/wiring/controllers.d.ts +0 -4
- package/dist/wiring/controllers.d.ts.map +1 -1
- package/dist/wiring/slash-commands.d.ts +0 -2
- package/dist/wiring/slash-commands.d.ts.map +1 -1
- package/package.json +21 -21
package/dist/index.js
CHANGED
|
@@ -864,7 +864,7 @@ async function runUpdateCommand(args, deps) {
|
|
|
864
864
|
deps.renderer.write(`Running: ${updateCommand.display}
|
|
865
865
|
`);
|
|
866
866
|
try {
|
|
867
|
-
const result = await new Promise((
|
|
867
|
+
const result = await new Promise((resolve16, reject) => {
|
|
868
868
|
const child = spawn5(updateCommand.executable, updateCommand.args, {
|
|
869
869
|
cwd,
|
|
870
870
|
stdio: "pipe",
|
|
@@ -881,7 +881,7 @@ async function runUpdateCommand(args, deps) {
|
|
|
881
881
|
stderr = appendOutputTail(stderr, data);
|
|
882
882
|
});
|
|
883
883
|
child.on("error", reject);
|
|
884
|
-
child.on("close", (code, signal) =>
|
|
884
|
+
child.on("close", (code, signal) => resolve16({ code, signal, stdout, stderr }));
|
|
885
885
|
});
|
|
886
886
|
if (result.code === 0 && result.signal === null) {
|
|
887
887
|
deps.renderer.write(
|
|
@@ -3676,7 +3676,7 @@ function displayHost(host) {
|
|
|
3676
3676
|
return host === "0.0.0.0" ? "127.0.0.1" : host;
|
|
3677
3677
|
}
|
|
3678
3678
|
function readRequestBody(req2, maxBytes = 1e6) {
|
|
3679
|
-
return new Promise((
|
|
3679
|
+
return new Promise((resolve16, reject) => {
|
|
3680
3680
|
const chunks = [];
|
|
3681
3681
|
let size = 0;
|
|
3682
3682
|
let settled = false;
|
|
@@ -3692,7 +3692,7 @@ function readRequestBody(req2, maxBytes = 1e6) {
|
|
|
3692
3692
|
chunks.push(chunk);
|
|
3693
3693
|
});
|
|
3694
3694
|
req2.on("end", () => {
|
|
3695
|
-
if (!settled)
|
|
3695
|
+
if (!settled) resolve16(Buffer.concat(chunks).toString("utf8"));
|
|
3696
3696
|
});
|
|
3697
3697
|
req2.on("error", (error) => {
|
|
3698
3698
|
if (!settled) reject(error);
|
|
@@ -5038,7 +5038,10 @@ async function handleMailboxGateway(_req, res, match, authorizeMailboxGateway, g
|
|
|
5038
5038
|
return;
|
|
5039
5039
|
}
|
|
5040
5040
|
const suffix = match[2];
|
|
5041
|
-
const
|
|
5041
|
+
const rawUrl = _req.url ?? "";
|
|
5042
|
+
const queryIndex = rawUrl.indexOf("?");
|
|
5043
|
+
const querySuffix = queryIndex === -1 ? "" : rawUrl.slice(queryIndex);
|
|
5044
|
+
const canonicalPath = suffix ? `/mailbox/${suffix}${querySuffix}` : `/mailbox${querySuffix}`;
|
|
5042
5045
|
const projectDir = resolveProjectDir(projectRoot, gatewayGlobalRoot);
|
|
5043
5046
|
await getMailboxGateway(projectDir).router.handle(_req, res, canonicalPath);
|
|
5044
5047
|
}
|
|
@@ -5673,6 +5676,7 @@ import {
|
|
|
5673
5676
|
createHqPersistence as createHqPersistence2,
|
|
5674
5677
|
createMailboxHttpRouter as createMailboxHttpRouter2,
|
|
5675
5678
|
DEFAULT_HQ_REDACTION_POLICY as DEFAULT_HQ_REDACTION_POLICY2,
|
|
5679
|
+
MAILBOX_HTTP_DEFAULT_MAX_AGE_MS,
|
|
5676
5680
|
ensureHqFirstRunAuthFile,
|
|
5677
5681
|
GlobalMailbox as GlobalMailbox2,
|
|
5678
5682
|
HqAlertEngine as HqAlertEngine2,
|
|
@@ -5845,7 +5849,7 @@ function startHqServerWithAuth(options, host, port, dataDir, firstRunAuth) {
|
|
|
5845
5849
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
5846
5850
|
})
|
|
5847
5851
|
);
|
|
5848
|
-
return new Promise((
|
|
5852
|
+
return new Promise((resolve16, reject) => {
|
|
5849
5853
|
const trustedPublicOrigins = /* @__PURE__ */ new Set();
|
|
5850
5854
|
let listeningPort = port;
|
|
5851
5855
|
const clients = /* @__PURE__ */ new Map();
|
|
@@ -5916,7 +5920,13 @@ function startHqServerWithAuth(options, host, port, dataDir, firstRunAuth) {
|
|
|
5916
5920
|
mailbox,
|
|
5917
5921
|
eventEmitter,
|
|
5918
5922
|
rateLimiter: mailboxGatewayRateLimiter,
|
|
5919
|
-
authorize: (request) => authorizeMailboxGateway(request, projectDir)
|
|
5923
|
+
authorize: (request) => authorizeMailboxGateway(request, projectDir),
|
|
5924
|
+
// Wire the 1h look-back that the router's docs promise at
|
|
5925
|
+
// mailbox-http-router.ts:25-32 / :47-62. The router itself is
|
|
5926
|
+
// opt-in (L146-152): without this option, every retained
|
|
5927
|
+
// message would be returned. Per-request opt-in to the full
|
|
5928
|
+
// history remains available via `?sinceMs=0`.
|
|
5929
|
+
defaultMaxAgeMs: MAILBOX_HTTP_DEFAULT_MAX_AGE_MS
|
|
5920
5930
|
});
|
|
5921
5931
|
const gateway = { mailbox, router };
|
|
5922
5932
|
mailboxGateways.set(projectDir, gateway);
|
|
@@ -6211,7 +6221,7 @@ function startHqServerWithAuth(options, host, port, dataDir, firstRunAuth) {
|
|
|
6211
6221
|
port: actualPort,
|
|
6212
6222
|
firstRunSetup: startupInfo
|
|
6213
6223
|
});
|
|
6214
|
-
|
|
6224
|
+
resolve16(handle);
|
|
6215
6225
|
})();
|
|
6216
6226
|
});
|
|
6217
6227
|
});
|
|
@@ -6320,7 +6330,7 @@ async function startServer(deps) {
|
|
|
6320
6330
|
}
|
|
6321
6331
|
}
|
|
6322
6332
|
writeStartupInfo(deps, handle);
|
|
6323
|
-
await new Promise((
|
|
6333
|
+
await new Promise((resolve16) => {
|
|
6324
6334
|
const shutdown = async () => {
|
|
6325
6335
|
try {
|
|
6326
6336
|
await handle.close();
|
|
@@ -6328,7 +6338,7 @@ async function startServer(deps) {
|
|
|
6328
6338
|
deps.renderer.write(`HQ server close error: ${String(err)}
|
|
6329
6339
|
`);
|
|
6330
6340
|
}
|
|
6331
|
-
|
|
6341
|
+
resolve16();
|
|
6332
6342
|
};
|
|
6333
6343
|
process.on("SIGINT", shutdown);
|
|
6334
6344
|
process.on("SIGTERM", shutdown);
|
|
@@ -7854,7 +7864,7 @@ function tail(current, chunk) {
|
|
|
7854
7864
|
return `${current}${String(chunk)}`.slice(-MAX_LOG_CHARS);
|
|
7855
7865
|
}
|
|
7856
7866
|
function startHqQuickTunnel(originUrl, options = {}) {
|
|
7857
|
-
return new Promise((
|
|
7867
|
+
return new Promise((resolve16, reject) => {
|
|
7858
7868
|
const executable = options.executable ?? "cloudflared";
|
|
7859
7869
|
let child;
|
|
7860
7870
|
try {
|
|
@@ -7886,7 +7896,7 @@ function startHqQuickTunnel(originUrl, options = {}) {
|
|
|
7886
7896
|
const readyUrl = publicUrl;
|
|
7887
7897
|
settled = true;
|
|
7888
7898
|
clearTimeout(timer);
|
|
7889
|
-
|
|
7899
|
+
resolve16({
|
|
7890
7900
|
url: readyUrl,
|
|
7891
7901
|
close: () => new Promise((done) => {
|
|
7892
7902
|
if (child.exitCode !== null || child.signalCode !== null) {
|
|
@@ -9946,10 +9956,11 @@ import {
|
|
|
9946
9956
|
function sendStatus(ctx, ws, kind, phase, extra = {}) {
|
|
9947
9957
|
ctx.send(ws, { type: "auth.oauth.status", payload: { kind, phase, ...extra } });
|
|
9948
9958
|
}
|
|
9949
|
-
async function persistOutcome(ctx, outcome) {
|
|
9959
|
+
async function persistOutcome(ctx, outcome, customProviderId) {
|
|
9950
9960
|
const providers = await ctx.providerStore.load();
|
|
9951
|
-
const
|
|
9952
|
-
const
|
|
9961
|
+
const providerId = customProviderId ?? outcome.providerId;
|
|
9962
|
+
const existing = providers[providerId];
|
|
9963
|
+
const p = existing ? { ...existing } : { type: providerId };
|
|
9953
9964
|
p.family = outcome.family;
|
|
9954
9965
|
if (!p.baseUrl) p.baseUrl = outcome.baseUrl;
|
|
9955
9966
|
p.models = [...outcome.models];
|
|
@@ -9957,27 +9968,33 @@ async function persistOutcome(ctx, outcome) {
|
|
|
9957
9968
|
keys.push(outcome.apiKey);
|
|
9958
9969
|
writeKeysBack(p, keys);
|
|
9959
9970
|
p.activeKey = outcome.apiKey.label;
|
|
9960
|
-
providers[
|
|
9971
|
+
providers[providerId] = p;
|
|
9961
9972
|
await ctx.providerStore.save(providers);
|
|
9962
9973
|
broadcastSaved(ctx, providers);
|
|
9963
9974
|
}
|
|
9964
|
-
async function finish(ctx, ws, kind, outcome) {
|
|
9975
|
+
async function finish(ctx, ws, kind, outcome, customProviderId) {
|
|
9965
9976
|
if (!outcome) {
|
|
9966
9977
|
sendStatus(ctx, ws, kind, "error", { message: "Sign-in cancelled or timed out." });
|
|
9967
9978
|
return;
|
|
9968
9979
|
}
|
|
9969
|
-
sendStatus(ctx, ws, kind, "fetching_models", { providerId: outcome.providerId });
|
|
9970
|
-
await persistOutcome(ctx, outcome);
|
|
9980
|
+
sendStatus(ctx, ws, kind, "fetching_models", { providerId: customProviderId ?? outcome.providerId });
|
|
9981
|
+
await persistOutcome(ctx, outcome, customProviderId);
|
|
9971
9982
|
sendStatus(ctx, ws, kind, "success", {
|
|
9972
|
-
providerId: outcome.providerId,
|
|
9973
|
-
message: `Signed in \u2014 saved as ${outcome.providerId} (${outcome.models.length} models).`
|
|
9983
|
+
providerId: customProviderId ?? outcome.providerId,
|
|
9984
|
+
message: `Signed in \u2014 saved as ${customProviderId ?? outcome.providerId} (${outcome.models.length} models).`
|
|
9974
9985
|
});
|
|
9975
9986
|
}
|
|
9976
|
-
async function handleOAuthStart(ctx, ws, kind) {
|
|
9987
|
+
async function handleOAuthStart(ctx, ws, kind, customProviderId) {
|
|
9977
9988
|
try {
|
|
9978
9989
|
oauthSessions.get(kind)?.close();
|
|
9979
9990
|
oauthSessions.delete(kind);
|
|
9980
9991
|
const session = await beginOAuthLogin(kind, { modelsRegistry: ctx.modelsRegistry });
|
|
9992
|
+
if (customProviderId) {
|
|
9993
|
+
session.providerId = customProviderId;
|
|
9994
|
+
customProviderIds.set(kind, customProviderId);
|
|
9995
|
+
} else {
|
|
9996
|
+
customProviderIds.delete(kind);
|
|
9997
|
+
}
|
|
9981
9998
|
oauthSessions.set(kind, session);
|
|
9982
9999
|
if (kind === "copilot") {
|
|
9983
10000
|
sendStatus(ctx, ws, kind, "awaiting_code", {
|
|
@@ -9998,7 +10015,7 @@ async function handleOAuthStart(ctx, ws, kind) {
|
|
|
9998
10015
|
void (async () => {
|
|
9999
10016
|
try {
|
|
10000
10017
|
const outcome = await session.waitForCompletion();
|
|
10001
|
-
await finish(ctx, ws, kind, outcome);
|
|
10018
|
+
await finish(ctx, ws, kind, outcome, customProviderIds.get(kind));
|
|
10002
10019
|
} catch (err) {
|
|
10003
10020
|
sendStatus(ctx, ws, kind, "error", { message: toErrorMessage18(err) });
|
|
10004
10021
|
} finally {
|
|
@@ -10021,7 +10038,7 @@ async function handleOAuthCode(ctx, ws, kind, input) {
|
|
|
10021
10038
|
try {
|
|
10022
10039
|
sendStatus(ctx, ws, kind, "exchanging", { providerId: session.providerId });
|
|
10023
10040
|
const outcome = await session.completeWithCode(input);
|
|
10024
|
-
await finish(ctx, ws, kind, outcome);
|
|
10041
|
+
await finish(ctx, ws, kind, outcome, customProviderIds.get(kind));
|
|
10025
10042
|
} catch (err) {
|
|
10026
10043
|
sendStatus(ctx, ws, kind, "error", { message: toErrorMessage18(err) });
|
|
10027
10044
|
} finally {
|
|
@@ -10034,13 +10051,14 @@ function handleOAuthCancel(ctx, ws, kind) {
|
|
|
10034
10051
|
oauthSessions.delete(kind);
|
|
10035
10052
|
sendStatus(ctx, ws, kind, "error", { message: "Sign-in cancelled." });
|
|
10036
10053
|
}
|
|
10037
|
-
var oauthSessions;
|
|
10054
|
+
var oauthSessions, customProviderIds;
|
|
10038
10055
|
var init_oauth = __esm({
|
|
10039
10056
|
"src/webui-server/ws-handlers/oauth.ts"() {
|
|
10040
10057
|
"use strict";
|
|
10041
10058
|
init_provider_config();
|
|
10042
10059
|
init_providers();
|
|
10043
10060
|
oauthSessions = /* @__PURE__ */ new Map();
|
|
10061
|
+
customProviderIds = /* @__PURE__ */ new Map();
|
|
10044
10062
|
}
|
|
10045
10063
|
});
|
|
10046
10064
|
|
|
@@ -12970,7 +12988,8 @@ function createMessageRouter(deps) {
|
|
|
12970
12988
|
// ── Subscription OAuth login (ChatGPT / Claude / Copilot) ──
|
|
12971
12989
|
"auth.oauth.start": (msg, ws) => {
|
|
12972
12990
|
const kind = oauthKindOf(msg);
|
|
12973
|
-
|
|
12991
|
+
const providerId = msg.payload?.providerId;
|
|
12992
|
+
if (kind) void handleOAuthStart(wsHandlerCtx, ws, kind, typeof providerId === "string" ? providerId : void 0);
|
|
12974
12993
|
},
|
|
12975
12994
|
"auth.oauth.code": (msg, ws) => {
|
|
12976
12995
|
const kind = oauthKindOf(msg);
|
|
@@ -13607,7 +13626,7 @@ async function seedConfigToMeta(opts) {
|
|
|
13607
13626
|
meta["yolo"] = autonomyCfg["yolo"] ?? cfg.yolo ?? false;
|
|
13608
13627
|
meta["chime"] = autonomyCfg["chime"] ?? false;
|
|
13609
13628
|
meta["confirmExit"] = autonomyCfg["confirmExit"] !== false;
|
|
13610
|
-
meta["
|
|
13629
|
+
meta["fleetChatVerbosity"] = autonomyCfg["fleetChatVerbosity"] ?? "off";
|
|
13611
13630
|
meta["enhanceEnabled"] = autonomyCfg["enhance"] ?? true;
|
|
13612
13631
|
meta["enhanceDelayMs"] = autonomyCfg["enhanceDelayMs"] ?? 6e4;
|
|
13613
13632
|
meta["enhanceLanguage"] = autonomyCfg["enhanceLanguage"] ?? "original";
|
|
@@ -13762,9 +13781,8 @@ function createPrefsSeeding(opts) {
|
|
|
13762
13781
|
}
|
|
13763
13782
|
if ("chime" in payload) autonomy["chime"] = payload["chime"];
|
|
13764
13783
|
if ("confirmExit" in payload) autonomy["confirmExit"] = payload["confirmExit"];
|
|
13765
|
-
if ("
|
|
13766
|
-
autonomy["
|
|
13767
|
-
autonomy["fleetChatVerbosity"] = payload["streamFleet"] ? "full" : "off";
|
|
13784
|
+
if ("fleetChatVerbosity" in payload) {
|
|
13785
|
+
autonomy["fleetChatVerbosity"] = payload["fleetChatVerbosity"];
|
|
13768
13786
|
}
|
|
13769
13787
|
if ("enhanceEnabled" in payload) autonomy["enhance"] = payload["enhanceEnabled"];
|
|
13770
13788
|
if ("enhanceDelayMs" in payload) autonomy["enhanceDelayMs"] = payload["enhanceDelayMs"];
|
|
@@ -14000,7 +14018,7 @@ var init_prefs_seeding = __esm({
|
|
|
14000
14018
|
"maxIterations",
|
|
14001
14019
|
"chime",
|
|
14002
14020
|
"confirmExit",
|
|
14003
|
-
"
|
|
14021
|
+
"fleetChatVerbosity",
|
|
14004
14022
|
"nextPrediction",
|
|
14005
14023
|
"fallbackModels",
|
|
14006
14024
|
"fallbackProfiles",
|
|
@@ -15789,7 +15807,7 @@ async function runWebUI(opts) {
|
|
|
15789
15807
|
kanbanRunMirror: kanbanRunMirror ?? void 0,
|
|
15790
15808
|
kanbanSupervisor: kanbanSupervisor ?? void 0
|
|
15791
15809
|
});
|
|
15792
|
-
const stopped = new Promise((
|
|
15810
|
+
const stopped = new Promise((resolve16) => {
|
|
15793
15811
|
wss.on("listening", () => {
|
|
15794
15812
|
console.log(`[WebUI] WebSocket server running on ws://${host}:${port}`);
|
|
15795
15813
|
setupEvents();
|
|
@@ -15879,7 +15897,7 @@ async function runWebUI(opts) {
|
|
|
15879
15897
|
wss,
|
|
15880
15898
|
pid: process.pid,
|
|
15881
15899
|
registryBaseDir,
|
|
15882
|
-
onStopped:
|
|
15900
|
+
onStopped: resolve16
|
|
15883
15901
|
});
|
|
15884
15902
|
registerWebuiSignalHandlers(signalShutdown);
|
|
15885
15903
|
});
|
|
@@ -16148,7 +16166,7 @@ async function runProjectPicker(opts) {
|
|
|
16148
16166
|
const reservedBottom = 3;
|
|
16149
16167
|
const headerHeight = reservedTop + reservedBottom;
|
|
16150
16168
|
const baseVisibleHeight = Math.max(5, terminalHeight() - headerHeight);
|
|
16151
|
-
return new Promise((
|
|
16169
|
+
return new Promise((resolve16) => {
|
|
16152
16170
|
const wasRaw = stdin.isRaw;
|
|
16153
16171
|
const wasPaused = stdin.isPaused();
|
|
16154
16172
|
let filter = "";
|
|
@@ -16272,7 +16290,7 @@ async function runProjectPicker(opts) {
|
|
|
16272
16290
|
cleanup();
|
|
16273
16291
|
out.write(CURSOR_SHOW);
|
|
16274
16292
|
out.write("\n");
|
|
16275
|
-
|
|
16293
|
+
resolve16(void 0);
|
|
16276
16294
|
return;
|
|
16277
16295
|
}
|
|
16278
16296
|
if (ch === ESC) {
|
|
@@ -16285,7 +16303,7 @@ async function runProjectPicker(opts) {
|
|
|
16285
16303
|
cleanup();
|
|
16286
16304
|
out.write(CURSOR_SHOW);
|
|
16287
16305
|
out.write("\n");
|
|
16288
|
-
|
|
16306
|
+
resolve16(void 0);
|
|
16289
16307
|
return;
|
|
16290
16308
|
}
|
|
16291
16309
|
if (ch === BS || ch === "\b") {
|
|
@@ -16302,22 +16320,22 @@ async function runProjectPicker(opts) {
|
|
|
16302
16320
|
out.write(CURSOR_SHOW);
|
|
16303
16321
|
out.write("\n");
|
|
16304
16322
|
if (!item || item.key === "__divider__") {
|
|
16305
|
-
|
|
16323
|
+
resolve16(void 0);
|
|
16306
16324
|
return;
|
|
16307
16325
|
}
|
|
16308
16326
|
if (item.key === "quit") {
|
|
16309
|
-
|
|
16327
|
+
resolve16(void 0);
|
|
16310
16328
|
return;
|
|
16311
16329
|
}
|
|
16312
16330
|
if (item.key === "new-session") {
|
|
16313
|
-
|
|
16331
|
+
resolve16({ kind: "action", key: "new-session", action: "new-session" });
|
|
16314
16332
|
return;
|
|
16315
16333
|
}
|
|
16316
16334
|
if (item.key === "prev-sessions") {
|
|
16317
|
-
|
|
16335
|
+
resolve16({ kind: "action", key: "prev-sessions", action: "prev-sessions" });
|
|
16318
16336
|
return;
|
|
16319
16337
|
}
|
|
16320
|
-
|
|
16338
|
+
resolve16({ kind: "project", key: item.key });
|
|
16321
16339
|
return;
|
|
16322
16340
|
}
|
|
16323
16341
|
if (filter.length === 0) {
|
|
@@ -16325,7 +16343,7 @@ async function runProjectPicker(opts) {
|
|
|
16325
16343
|
cleanup();
|
|
16326
16344
|
out.write(CURSOR_SHOW);
|
|
16327
16345
|
out.write("\n");
|
|
16328
|
-
|
|
16346
|
+
resolve16(void 0);
|
|
16329
16347
|
return;
|
|
16330
16348
|
}
|
|
16331
16349
|
if (ch === "j") {
|
|
@@ -16354,7 +16372,7 @@ async function runProjectPicker(opts) {
|
|
|
16354
16372
|
try {
|
|
16355
16373
|
stdin.setRawMode(true);
|
|
16356
16374
|
} catch {
|
|
16357
|
-
|
|
16375
|
+
resolve16(void 0);
|
|
16358
16376
|
return;
|
|
16359
16377
|
}
|
|
16360
16378
|
stdin.resume();
|
|
@@ -16365,7 +16383,7 @@ async function runProjectPicker(opts) {
|
|
|
16365
16383
|
stdin.once("close", () => {
|
|
16366
16384
|
cleanup();
|
|
16367
16385
|
out.write(CURSOR_SHOW);
|
|
16368
|
-
|
|
16386
|
+
resolve16(void 0);
|
|
16369
16387
|
});
|
|
16370
16388
|
});
|
|
16371
16389
|
}
|
|
@@ -18577,12 +18595,12 @@ function callbackHtml(ok2, message) {
|
|
|
18577
18595
|
function startLoopbackServer(expectedState, signal) {
|
|
18578
18596
|
let resolveCode = () => {
|
|
18579
18597
|
};
|
|
18580
|
-
const codePromise = new Promise((
|
|
18598
|
+
const codePromise = new Promise((resolve16) => {
|
|
18581
18599
|
let settled = false;
|
|
18582
18600
|
resolveCode = (v) => {
|
|
18583
18601
|
if (settled) return;
|
|
18584
18602
|
settled = true;
|
|
18585
|
-
|
|
18603
|
+
resolve16(v);
|
|
18586
18604
|
};
|
|
18587
18605
|
});
|
|
18588
18606
|
const server = createServer((req2, res) => {
|
|
@@ -18636,10 +18654,10 @@ function startLoopbackServer(expectedState, signal) {
|
|
|
18636
18654
|
if (signal.aborted) onAbort();
|
|
18637
18655
|
else signal.addEventListener("abort", onAbort, { once: true });
|
|
18638
18656
|
}
|
|
18639
|
-
return new Promise((
|
|
18657
|
+
return new Promise((resolve16) => {
|
|
18640
18658
|
server.on("error", () => {
|
|
18641
18659
|
resolveCode(null);
|
|
18642
|
-
|
|
18660
|
+
resolve16({
|
|
18643
18661
|
bound: false,
|
|
18644
18662
|
waitForCode: () => Promise.resolve(null),
|
|
18645
18663
|
close: () => {
|
|
@@ -18651,7 +18669,7 @@ function startLoopbackServer(expectedState, signal) {
|
|
|
18651
18669
|
});
|
|
18652
18670
|
});
|
|
18653
18671
|
server.listen(REDIRECT_PORT, REDIRECT_HOST, () => {
|
|
18654
|
-
|
|
18672
|
+
resolve16({
|
|
18655
18673
|
bound: true,
|
|
18656
18674
|
waitForCode: () => codePromise,
|
|
18657
18675
|
close: () => {
|
|
@@ -18823,9 +18841,9 @@ function openBrowser2(url) {
|
|
|
18823
18841
|
}
|
|
18824
18842
|
}
|
|
18825
18843
|
function sleep(ms, signal) {
|
|
18826
|
-
return new Promise((
|
|
18844
|
+
return new Promise((resolve16, reject) => {
|
|
18827
18845
|
if (signal.aborted) return reject(new DOMException("Aborted", "AbortError"));
|
|
18828
|
-
const t = setTimeout(
|
|
18846
|
+
const t = setTimeout(resolve16, ms);
|
|
18829
18847
|
signal.addEventListener(
|
|
18830
18848
|
"abort",
|
|
18831
18849
|
() => {
|
|
@@ -19213,12 +19231,12 @@ function callbackHtml2(ok2, message) {
|
|
|
19213
19231
|
function startLoopbackServer2(state, signal) {
|
|
19214
19232
|
let resolveCode = () => {
|
|
19215
19233
|
};
|
|
19216
|
-
const codePromise = new Promise((
|
|
19234
|
+
const codePromise = new Promise((resolve16) => {
|
|
19217
19235
|
let settled = false;
|
|
19218
19236
|
resolveCode = (v) => {
|
|
19219
19237
|
if (settled) return;
|
|
19220
19238
|
settled = true;
|
|
19221
|
-
|
|
19239
|
+
resolve16(v);
|
|
19222
19240
|
};
|
|
19223
19241
|
});
|
|
19224
19242
|
const server = createServer2((req2, res) => {
|
|
@@ -19271,7 +19289,7 @@ function startLoopbackServer2(state, signal) {
|
|
|
19271
19289
|
if (signal.aborted) onAbort();
|
|
19272
19290
|
else signal.addEventListener("abort", onAbort, { once: true });
|
|
19273
19291
|
}
|
|
19274
|
-
return new Promise((
|
|
19292
|
+
return new Promise((resolve16) => {
|
|
19275
19293
|
const ports = [REDIRECT_PORT2, FALLBACK_REDIRECT_PORT];
|
|
19276
19294
|
let index = 0;
|
|
19277
19295
|
const close = () => {
|
|
@@ -19283,7 +19301,7 @@ function startLoopbackServer2(state, signal) {
|
|
|
19283
19301
|
};
|
|
19284
19302
|
const fail2 = () => {
|
|
19285
19303
|
resolveCode(null);
|
|
19286
|
-
|
|
19304
|
+
resolve16({
|
|
19287
19305
|
bound: false,
|
|
19288
19306
|
port: REDIRECT_PORT2,
|
|
19289
19307
|
waitForCode: () => Promise.resolve(null),
|
|
@@ -19302,7 +19320,7 @@ function startLoopbackServer2(state, signal) {
|
|
|
19302
19320
|
server.on("listening", () => {
|
|
19303
19321
|
const address = server.address();
|
|
19304
19322
|
const port = typeof address === "object" && address ? address.port : ports[index] ?? REDIRECT_PORT2;
|
|
19305
|
-
|
|
19323
|
+
resolve16({
|
|
19306
19324
|
bound: true,
|
|
19307
19325
|
port,
|
|
19308
19326
|
waitForCode: () => codePromise,
|
|
@@ -20336,7 +20354,7 @@ async function runLiveProviderPicker(displayList, savedSet) {
|
|
|
20336
20354
|
writeOut(frame);
|
|
20337
20355
|
writeOut("\x1B7");
|
|
20338
20356
|
cursorToQuery(frame, state.query);
|
|
20339
|
-
return new Promise((
|
|
20357
|
+
return new Promise((resolve16) => {
|
|
20340
20358
|
const wasRaw = stdin.isRaw;
|
|
20341
20359
|
const wasPaused = stdin.isPaused();
|
|
20342
20360
|
setRawMode(stdin, true);
|
|
@@ -20366,7 +20384,7 @@ async function runLiveProviderPicker(displayList, savedSet) {
|
|
|
20366
20384
|
if (state.status === "cancelled") {
|
|
20367
20385
|
cleanup();
|
|
20368
20386
|
writeOut("\n");
|
|
20369
|
-
|
|
20387
|
+
resolve16(void 0);
|
|
20370
20388
|
return;
|
|
20371
20389
|
}
|
|
20372
20390
|
if (state.status === "submitted") {
|
|
@@ -20378,7 +20396,7 @@ async function runLiveProviderPicker(displayList, savedSet) {
|
|
|
20378
20396
|
const pick = ordered[state.selected] ?? ordered[0];
|
|
20379
20397
|
cleanup();
|
|
20380
20398
|
writeOut("\n");
|
|
20381
|
-
|
|
20399
|
+
resolve16(pick);
|
|
20382
20400
|
return;
|
|
20383
20401
|
}
|
|
20384
20402
|
repaint();
|
|
@@ -20591,7 +20609,7 @@ async function runLiveModelPicker(provider, defaultModel) {
|
|
|
20591
20609
|
if (preamble) writeOut(preamble);
|
|
20592
20610
|
let frame = renderLiveModelList(state.query, ordered, state.selected, header);
|
|
20593
20611
|
writeOut(frame);
|
|
20594
|
-
return new Promise((
|
|
20612
|
+
return new Promise((resolve16) => {
|
|
20595
20613
|
const wasRaw = stdin.isRaw;
|
|
20596
20614
|
const wasPaused = stdin.isPaused();
|
|
20597
20615
|
setRawMode(stdin, true);
|
|
@@ -20618,7 +20636,7 @@ async function runLiveModelPicker(provider, defaultModel) {
|
|
|
20618
20636
|
if (state.status === "cancelled") {
|
|
20619
20637
|
cleanup();
|
|
20620
20638
|
writeOut("\n");
|
|
20621
|
-
|
|
20639
|
+
resolve16(void 0);
|
|
20622
20640
|
return;
|
|
20623
20641
|
}
|
|
20624
20642
|
if (state.status === "submitted") {
|
|
@@ -20630,7 +20648,7 @@ async function runLiveModelPicker(provider, defaultModel) {
|
|
|
20630
20648
|
const pick = ordered[state.selected] ?? ordered[0];
|
|
20631
20649
|
cleanup();
|
|
20632
20650
|
writeOut("\n");
|
|
20633
|
-
|
|
20651
|
+
resolve16(pick);
|
|
20634
20652
|
return;
|
|
20635
20653
|
}
|
|
20636
20654
|
repaint();
|
|
@@ -22345,7 +22363,7 @@ function resolveTaskConcurrency() {
|
|
|
22345
22363
|
var WORKTREE_PHASE_CONCURRENCY = 4;
|
|
22346
22364
|
var MAX_CMD_OUTPUT = 2e5;
|
|
22347
22365
|
function gitText(args, cwd) {
|
|
22348
|
-
return new Promise((
|
|
22366
|
+
return new Promise((resolve16, reject) => {
|
|
22349
22367
|
let child;
|
|
22350
22368
|
try {
|
|
22351
22369
|
child = spawn4("git", args, {
|
|
@@ -22370,8 +22388,8 @@ function gitText(args, cwd) {
|
|
|
22370
22388
|
};
|
|
22371
22389
|
child.stdout?.on("data", emit);
|
|
22372
22390
|
child.stderr?.on("data", emit);
|
|
22373
|
-
child.on("error", () =>
|
|
22374
|
-
child.on("close", (code) =>
|
|
22391
|
+
child.on("error", () => resolve16({ code: 1, out: chunks.join("") }));
|
|
22392
|
+
child.on("close", (code) => resolve16({ code: code ?? 1, out: chunks.join("").trim() }));
|
|
22375
22393
|
});
|
|
22376
22394
|
}
|
|
22377
22395
|
async function isGitRepo(cwd) {
|
|
@@ -22420,7 +22438,7 @@ function runCmd(cmd, args, cwd, shell = false) {
|
|
|
22420
22438
|
});
|
|
22421
22439
|
}
|
|
22422
22440
|
}
|
|
22423
|
-
return new Promise((
|
|
22441
|
+
return new Promise((resolve16, reject) => {
|
|
22424
22442
|
const chunks = [];
|
|
22425
22443
|
let child;
|
|
22426
22444
|
try {
|
|
@@ -22443,11 +22461,11 @@ function runCmd(cmd, args, cwd, shell = false) {
|
|
|
22443
22461
|
};
|
|
22444
22462
|
child.stdout?.on("data", append);
|
|
22445
22463
|
child.stderr?.on("data", append);
|
|
22446
|
-
child.on("error", (e) =>
|
|
22464
|
+
child.on("error", (e) => resolve16({ code: 1, out: `${chunks.join("")}${String(e)}` }));
|
|
22447
22465
|
child.on("close", (code) => {
|
|
22448
22466
|
let out = chunks.join("");
|
|
22449
22467
|
if (out.length > MAX_CMD_OUTPUT) out = out.slice(-MAX_CMD_OUTPUT);
|
|
22450
|
-
|
|
22468
|
+
resolve16({ code: code ?? 1, out: out.trim() });
|
|
22451
22469
|
});
|
|
22452
22470
|
});
|
|
22453
22471
|
}
|
|
@@ -23464,25 +23482,25 @@ var ReadlineInputReader = class {
|
|
|
23464
23482
|
async readLine(prompt, timeoutOpts) {
|
|
23465
23483
|
if (this.history.length === 0) await this.loadHistory();
|
|
23466
23484
|
while (this.pending) {
|
|
23467
|
-
await new Promise((
|
|
23485
|
+
await new Promise((resolve16) => setTimeout(resolve16, 50));
|
|
23468
23486
|
}
|
|
23469
23487
|
this.pending = true;
|
|
23470
23488
|
try {
|
|
23471
23489
|
if (this.rl) {
|
|
23472
23490
|
const old = this.rl;
|
|
23473
23491
|
this.rl = void 0;
|
|
23474
|
-
await new Promise((
|
|
23492
|
+
await new Promise((resolve16) => {
|
|
23475
23493
|
if (old.closed) {
|
|
23476
|
-
|
|
23494
|
+
resolve16();
|
|
23477
23495
|
} else {
|
|
23478
|
-
old.once("close",
|
|
23496
|
+
old.once("close", resolve16);
|
|
23479
23497
|
old.close();
|
|
23480
23498
|
}
|
|
23481
23499
|
});
|
|
23482
23500
|
}
|
|
23483
23501
|
const fresh = this.ensure();
|
|
23484
23502
|
this.installPromptGuard(fresh);
|
|
23485
|
-
return new Promise((
|
|
23503
|
+
return new Promise((resolve16) => {
|
|
23486
23504
|
let settled = false;
|
|
23487
23505
|
let timeoutHandle;
|
|
23488
23506
|
const settle = (line) => {
|
|
@@ -23490,7 +23508,7 @@ var ReadlineInputReader = class {
|
|
|
23490
23508
|
settled = true;
|
|
23491
23509
|
if (timeoutHandle) clearTimeout(timeoutHandle);
|
|
23492
23510
|
setOutputLineGuard2(null);
|
|
23493
|
-
|
|
23511
|
+
resolve16(line);
|
|
23494
23512
|
};
|
|
23495
23513
|
if (timeoutOpts) {
|
|
23496
23514
|
timeoutHandle = setTimeout(() => {
|
|
@@ -23554,7 +23572,7 @@ var ReadlineInputReader = class {
|
|
|
23554
23572
|
async readKey(prompt, options) {
|
|
23555
23573
|
setOutputLineGuard2(null);
|
|
23556
23574
|
writeOut2(prompt);
|
|
23557
|
-
return new Promise((
|
|
23575
|
+
return new Promise((resolve16) => {
|
|
23558
23576
|
const stdin = process.stdin;
|
|
23559
23577
|
const wasRaw = stdin.isRaw;
|
|
23560
23578
|
const wasPaused = stdin.isPaused();
|
|
@@ -23565,7 +23583,7 @@ var ReadlineInputReader = class {
|
|
|
23565
23583
|
if (key === "") {
|
|
23566
23584
|
cleanup();
|
|
23567
23585
|
writeOut2("\n");
|
|
23568
|
-
|
|
23586
|
+
resolve16("");
|
|
23569
23587
|
return;
|
|
23570
23588
|
}
|
|
23571
23589
|
const opt = options.find(
|
|
@@ -23575,12 +23593,12 @@ var ReadlineInputReader = class {
|
|
|
23575
23593
|
cleanup();
|
|
23576
23594
|
writeOut2(`${opt.key}
|
|
23577
23595
|
`);
|
|
23578
|
-
|
|
23596
|
+
resolve16(opt.value);
|
|
23579
23597
|
}
|
|
23580
23598
|
};
|
|
23581
23599
|
const onClose = () => {
|
|
23582
23600
|
cleanup();
|
|
23583
|
-
|
|
23601
|
+
resolve16("");
|
|
23584
23602
|
};
|
|
23585
23603
|
const cleanup = () => {
|
|
23586
23604
|
stdin.off("data", onData);
|
|
@@ -23612,7 +23630,7 @@ var ReadlineInputReader = class {
|
|
|
23612
23630
|
this.rl?.close();
|
|
23613
23631
|
this.rl = void 0;
|
|
23614
23632
|
writeOut2(prompt);
|
|
23615
|
-
return new Promise((
|
|
23633
|
+
return new Promise((resolve16) => {
|
|
23616
23634
|
let buf = "";
|
|
23617
23635
|
const wasRaw = stdin.isRaw;
|
|
23618
23636
|
const cleanup = () => {
|
|
@@ -23641,13 +23659,13 @@ var ReadlineInputReader = class {
|
|
|
23641
23659
|
cleanup();
|
|
23642
23660
|
writeOut2(` ${dim(`[${buf.length} chars]`)}
|
|
23643
23661
|
`);
|
|
23644
|
-
|
|
23662
|
+
resolve16(buf);
|
|
23645
23663
|
return;
|
|
23646
23664
|
}
|
|
23647
23665
|
if (ch === "") {
|
|
23648
23666
|
cleanup();
|
|
23649
23667
|
writeOut2("\n");
|
|
23650
|
-
|
|
23668
|
+
resolve16("");
|
|
23651
23669
|
return;
|
|
23652
23670
|
}
|
|
23653
23671
|
if (ch === "") {
|
|
@@ -24047,7 +24065,7 @@ async function runProjectCheck(opts) {
|
|
|
24047
24065
|
if (answer2 === "y" || answer2 === "yes") {
|
|
24048
24066
|
try {
|
|
24049
24067
|
const { spawn: spawn17 } = await import("node:child_process");
|
|
24050
|
-
await new Promise((
|
|
24068
|
+
await new Promise((resolve16, reject) => {
|
|
24051
24069
|
const child = spawn17("git", ["init"], {
|
|
24052
24070
|
cwd,
|
|
24053
24071
|
signal: AbortSignal.timeout(1e4),
|
|
@@ -24056,7 +24074,7 @@ async function runProjectCheck(opts) {
|
|
|
24056
24074
|
child.on("error", reject);
|
|
24057
24075
|
child.on(
|
|
24058
24076
|
"close",
|
|
24059
|
-
(code) => code === 0 ?
|
|
24077
|
+
(code) => code === 0 ? resolve16() : reject(new Error(`git init failed with ${code}`))
|
|
24060
24078
|
);
|
|
24061
24079
|
});
|
|
24062
24080
|
renderer.write(` ${color14.green("\u2713")} Git repository initialized
|
|
@@ -24761,6 +24779,7 @@ init_update();
|
|
|
24761
24779
|
|
|
24762
24780
|
// src/subcommands/handlers/acp.ts
|
|
24763
24781
|
import {
|
|
24782
|
+
defaultPermissionPolicy,
|
|
24764
24783
|
EnsembleRegistry,
|
|
24765
24784
|
probeAcpAgents,
|
|
24766
24785
|
renderAcpBenchText,
|
|
@@ -25258,11 +25277,11 @@ async function runACPWebSocketServer(deps, port) {
|
|
|
25258
25277
|
` : `WrongStack ACP server listening on ws://${host}:${port} (${deps.config.provider}/${deps.config.model}). Press Ctrl+C to stop.
|
|
25259
25278
|
`
|
|
25260
25279
|
);
|
|
25261
|
-
await new Promise((
|
|
25280
|
+
await new Promise((resolve16) => {
|
|
25262
25281
|
const shutdown = () => {
|
|
25263
25282
|
deps.renderer.writeWarning("\nShutting down ACP WebSocket server...");
|
|
25264
25283
|
wss.close();
|
|
25265
|
-
|
|
25284
|
+
resolve16();
|
|
25266
25285
|
};
|
|
25267
25286
|
process.on("SIGINT", shutdown);
|
|
25268
25287
|
process.on("SIGTERM", shutdown);
|
|
@@ -25416,6 +25435,7 @@ async function spawnACPAgent(args, deps) {
|
|
|
25416
25435
|
role: subagentId,
|
|
25417
25436
|
task,
|
|
25418
25437
|
signal: ac.signal,
|
|
25438
|
+
permissionPolicy: defaultPermissionPolicy,
|
|
25419
25439
|
onProgress: (event) => {
|
|
25420
25440
|
const line = formatProgress(event);
|
|
25421
25441
|
if (line) deps.renderer.writeInfo(` ${line}
|
|
@@ -26917,6 +26937,7 @@ import {
|
|
|
26917
26937
|
authorizeMailboxBearerToken,
|
|
26918
26938
|
createMailboxHttpRouter as createMailboxHttpRouter3,
|
|
26919
26939
|
GlobalMailbox as GlobalMailbox3,
|
|
26940
|
+
MAILBOX_HTTP_DEFAULT_MAX_AGE_MS as MAILBOX_HTTP_DEFAULT_MAX_AGE_MS2,
|
|
26920
26941
|
MailboxEventEmitter as MailboxEventEmitter2,
|
|
26921
26942
|
MailboxHttpRateLimiter as MailboxHttpRateLimiter3,
|
|
26922
26943
|
resolveProjectDir as resolveProjectDir2,
|
|
@@ -27003,21 +27024,32 @@ or stop the conflicting process and retry.
|
|
|
27003
27024
|
mailbox,
|
|
27004
27025
|
eventEmitter,
|
|
27005
27026
|
rateLimiter,
|
|
27006
|
-
authorize: (request) => authorizeMailboxBearerToken(request, tentative.token)
|
|
27027
|
+
authorize: (request) => authorizeMailboxBearerToken(request, tentative.token),
|
|
27028
|
+
// Wire the 1h look-back that the router's docs promise at
|
|
27029
|
+
// mailbox-http-router.ts:25-32 / :47-62. The router itself is
|
|
27030
|
+
// opt-in (L146-152): without this option, every retained
|
|
27031
|
+
// message would be returned.
|
|
27032
|
+
//
|
|
27033
|
+
// Per-request override contract (mailbox-http-router.ts:64-80):
|
|
27034
|
+
// - `?sinceMs=0` → no filter (full retained history)
|
|
27035
|
+
// - `?sinceMs > 7d` → silently clamped to
|
|
27036
|
+
// MAILBOX_HTTP_MAX_AGE_CEILING_MS (7d)
|
|
27037
|
+
// - `?sinceMs=-1/NaN/∞` → disable sentinel (same as `undefined`)
|
|
27038
|
+
defaultMaxAgeMs: MAILBOX_HTTP_DEFAULT_MAX_AGE_MS2
|
|
27007
27039
|
});
|
|
27008
27040
|
const server = createServer4((request, response) => {
|
|
27009
27041
|
void router.handle(request, response);
|
|
27010
27042
|
});
|
|
27011
27043
|
let boundPort = -1;
|
|
27012
27044
|
try {
|
|
27013
|
-
await new Promise((
|
|
27045
|
+
await new Promise((resolve16, reject) => {
|
|
27014
27046
|
const onError = (err) => {
|
|
27015
27047
|
server.off("listening", onListening);
|
|
27016
27048
|
reject(err);
|
|
27017
27049
|
};
|
|
27018
27050
|
const onListening = () => {
|
|
27019
27051
|
server.off("error", onError);
|
|
27020
|
-
|
|
27052
|
+
resolve16();
|
|
27021
27053
|
};
|
|
27022
27054
|
server.once("error", onError);
|
|
27023
27055
|
server.once("listening", onListening);
|
|
@@ -27030,14 +27062,14 @@ or stop the conflicting process and retry.
|
|
|
27030
27062
|
const msg = err.message;
|
|
27031
27063
|
if (portExplicitlySet && !strictPort) {
|
|
27032
27064
|
try {
|
|
27033
|
-
await new Promise((
|
|
27065
|
+
await new Promise((resolve16, reject) => {
|
|
27034
27066
|
const onError = (e) => {
|
|
27035
27067
|
server.off("listening", onListening);
|
|
27036
27068
|
reject(e);
|
|
27037
27069
|
};
|
|
27038
27070
|
const onListening = () => {
|
|
27039
27071
|
server.off("error", onError);
|
|
27040
|
-
|
|
27072
|
+
resolve16();
|
|
27041
27073
|
};
|
|
27042
27074
|
server.once("error", onError);
|
|
27043
27075
|
server.once("listening", onListening);
|
|
@@ -27090,7 +27122,7 @@ This usually means no port is available (extremely rare). Retry or pick an expli
|
|
|
27090
27122
|
}
|
|
27091
27123
|
});
|
|
27092
27124
|
writeStartupInfo2(deps, { host, port: boundPort, projectDir, tokenPath: acquireResult.tokenPath });
|
|
27093
|
-
await new Promise((
|
|
27125
|
+
await new Promise((resolve16) => {
|
|
27094
27126
|
let shuttingDown = false;
|
|
27095
27127
|
const shutdown = async (sig) => {
|
|
27096
27128
|
if (shuttingDown) return;
|
|
@@ -27105,7 +27137,7 @@ This usually means no port is available (extremely rare). Retry or pick an expli
|
|
|
27105
27137
|
`);
|
|
27106
27138
|
});
|
|
27107
27139
|
await release2(projectDir, finalized.generation);
|
|
27108
|
-
|
|
27140
|
+
resolve16();
|
|
27109
27141
|
};
|
|
27110
27142
|
process.on("SIGINT", shutdown);
|
|
27111
27143
|
process.on("SIGTERM", shutdown);
|
|
@@ -27443,8 +27475,8 @@ async function serveMcpStdio(deps) {
|
|
|
27443
27475
|
log(
|
|
27444
27476
|
`wrongstack MCP server ready at ${handle2.url} \u2014 exposing ${allowed.length} tool(s), ${selectedContent.resources.length} resource(s), ${selectedContent.prompts.length} prompt(s) (${mode})${token ? " [token auth]" : ""}.`
|
|
27445
27477
|
);
|
|
27446
|
-
await new Promise((
|
|
27447
|
-
const stop = () =>
|
|
27478
|
+
await new Promise((resolve16) => {
|
|
27479
|
+
const stop = () => resolve16();
|
|
27448
27480
|
process.once("SIGINT", stop);
|
|
27449
27481
|
process.once("SIGTERM", stop);
|
|
27450
27482
|
});
|
|
@@ -29944,6 +29976,10 @@ function resolveBundledPromptsDir() {
|
|
|
29944
29976
|
return void 0;
|
|
29945
29977
|
}
|
|
29946
29978
|
}
|
|
29979
|
+
function isHomeDirectory(cwd, userHome) {
|
|
29980
|
+
if (!cwd || !userHome) return false;
|
|
29981
|
+
return path25.resolve(cwd) === path25.resolve(userHome);
|
|
29982
|
+
}
|
|
29947
29983
|
function shouldPrintYoloNotice(lastChoices, yoloPinned, yolo) {
|
|
29948
29984
|
return !lastChoices && yoloPinned === void 0 && yolo;
|
|
29949
29985
|
}
|
|
@@ -30071,6 +30107,17 @@ async function boot(argv) {
|
|
|
30071
30107
|
await reader.close();
|
|
30072
30108
|
return code;
|
|
30073
30109
|
}
|
|
30110
|
+
if (isHomeDirectory(cwd, userHome)) {
|
|
30111
|
+
writeErr3(
|
|
30112
|
+
`
|
|
30113
|
+
${color36.red(color36.bold("\u26A0 This is not a working directory."))}
|
|
30114
|
+
${color36.red("Please open wstack in a project folder.")}
|
|
30115
|
+
|
|
30116
|
+
`
|
|
30117
|
+
);
|
|
30118
|
+
await reader.close();
|
|
30119
|
+
return 1;
|
|
30120
|
+
}
|
|
30074
30121
|
if (!flags["no-models-refresh"]) {
|
|
30075
30122
|
try {
|
|
30076
30123
|
await modelsRegistry.refresh();
|
|
@@ -30339,7 +30386,7 @@ async function checkGitInCwd(opts) {
|
|
|
30339
30386
|
if (answer === "y" || answer === "yes") {
|
|
30340
30387
|
try {
|
|
30341
30388
|
const { spawn: spawn17 } = await import("node:child_process");
|
|
30342
|
-
await new Promise((
|
|
30389
|
+
await new Promise((resolve16, reject) => {
|
|
30343
30390
|
const child = spawn17("git", ["init"], {
|
|
30344
30391
|
cwd,
|
|
30345
30392
|
signal: AbortSignal.timeout(1e4),
|
|
@@ -30348,7 +30395,7 @@ async function checkGitInCwd(opts) {
|
|
|
30348
30395
|
child.on("error", reject);
|
|
30349
30396
|
child.on(
|
|
30350
30397
|
"close",
|
|
30351
|
-
(code) => code === 0 ?
|
|
30398
|
+
(code) => code === 0 ? resolve16() : reject(new Error(`git init failed with ${code}`))
|
|
30352
30399
|
);
|
|
30353
30400
|
});
|
|
30354
30401
|
renderer.write(` ${color36.green("\u2713")} Git repository initialized
|
|
@@ -30431,7 +30478,7 @@ async function launchDesktop(args) {
|
|
|
30431
30478
|
);
|
|
30432
30479
|
return 1;
|
|
30433
30480
|
}
|
|
30434
|
-
return await new Promise((
|
|
30481
|
+
return await new Promise((resolve16) => {
|
|
30435
30482
|
const child = spawn6(process.execPath, [launcherPath, ...args], {
|
|
30436
30483
|
stdio: "inherit",
|
|
30437
30484
|
env: process.env,
|
|
@@ -30440,11 +30487,11 @@ async function launchDesktop(args) {
|
|
|
30440
30487
|
child.once("error", (err) => {
|
|
30441
30488
|
process.stderr.write(`${color37.red("\u2717 Failed to start WrongStack Desktop:")} ${err.message}
|
|
30442
30489
|
`);
|
|
30443
|
-
|
|
30490
|
+
resolve16(1);
|
|
30444
30491
|
});
|
|
30445
30492
|
child.once("exit", (code, signal) => {
|
|
30446
|
-
if (typeof code === "number")
|
|
30447
|
-
else
|
|
30493
|
+
if (typeof code === "number") resolve16(code);
|
|
30494
|
+
else resolve16(signal ? 1 : 0);
|
|
30448
30495
|
});
|
|
30449
30496
|
});
|
|
30450
30497
|
}
|
|
@@ -30478,17 +30525,17 @@ async function isHqAlreadyRunning(dataDir) {
|
|
|
30478
30525
|
}
|
|
30479
30526
|
}
|
|
30480
30527
|
async function isPortInUse(host, port) {
|
|
30481
|
-
return new Promise((
|
|
30528
|
+
return new Promise((resolve16) => {
|
|
30482
30529
|
const server = net.createServer();
|
|
30483
30530
|
server.once("error", (err) => {
|
|
30484
30531
|
if (err.code === "EADDRINUSE") {
|
|
30485
|
-
|
|
30532
|
+
resolve16(true);
|
|
30486
30533
|
} else {
|
|
30487
|
-
|
|
30534
|
+
resolve16(false);
|
|
30488
30535
|
}
|
|
30489
30536
|
});
|
|
30490
30537
|
server.once("listening", () => {
|
|
30491
|
-
server.close(() =>
|
|
30538
|
+
server.close(() => resolve16(false));
|
|
30492
30539
|
});
|
|
30493
30540
|
server.listen(port, host);
|
|
30494
30541
|
});
|
|
@@ -30626,7 +30673,7 @@ ${color38.green("Cloudflare Quick Tunnel ready:")} ${browserUrl}
|
|
|
30626
30673
|
} catch {
|
|
30627
30674
|
}
|
|
30628
30675
|
}
|
|
30629
|
-
await new Promise((
|
|
30676
|
+
await new Promise((resolve16) => {
|
|
30630
30677
|
const shutdown = async () => {
|
|
30631
30678
|
const results = await Promise.allSettled([
|
|
30632
30679
|
...tunnel ? [tunnel.close()] : [],
|
|
@@ -30645,7 +30692,7 @@ ${color38.green("Cloudflare Quick Tunnel ready:")} ${browserUrl}
|
|
|
30645
30692
|
})
|
|
30646
30693
|
);
|
|
30647
30694
|
}
|
|
30648
|
-
|
|
30695
|
+
resolve16();
|
|
30649
30696
|
};
|
|
30650
30697
|
process.on("SIGINT", shutdown);
|
|
30651
30698
|
process.on("SIGTERM", shutdown);
|
|
@@ -31077,8 +31124,6 @@ function wireContainer(deps) {
|
|
|
31077
31124
|
events,
|
|
31078
31125
|
permission: {
|
|
31079
31126
|
yolo: deps.config.yolo,
|
|
31080
|
-
yoloDestructive: deps.yoloDestructive,
|
|
31081
|
-
confirmDestructive: deps.confirmDestructive,
|
|
31082
31127
|
promptDelegate: makePromptDelegate(deps.reader)
|
|
31083
31128
|
},
|
|
31084
31129
|
compactor: {
|
|
@@ -31221,9 +31266,7 @@ async function initializeCli(argv) {
|
|
|
31221
31266
|
logger,
|
|
31222
31267
|
reader,
|
|
31223
31268
|
renderer,
|
|
31224
|
-
modelsRegistry
|
|
31225
|
-
yoloDestructive: ctx.flags["yolo-destructive"] === true || ctx.flags["force-all-yolo"] === true,
|
|
31226
|
-
confirmDestructive: false
|
|
31269
|
+
modelsRegistry
|
|
31227
31270
|
});
|
|
31228
31271
|
const replayFlag = ctx.flags["replay"];
|
|
31229
31272
|
const recordFlag = ctx.flags["record"];
|
|
@@ -31711,18 +31754,18 @@ async function runWebUIDispatch(ctx) {
|
|
|
31711
31754
|
applyLiveSettings?.({ yolo: enabled });
|
|
31712
31755
|
}
|
|
31713
31756
|
});
|
|
31714
|
-
const webuiExit = new Promise((
|
|
31757
|
+
const webuiExit = new Promise((resolve16) => {
|
|
31715
31758
|
webuiPromise.then(() => {
|
|
31716
31759
|
renderer.setSilent(false);
|
|
31717
31760
|
renderer.write("\n");
|
|
31718
31761
|
renderer.writeInfo(
|
|
31719
31762
|
color44.yellow(` Shutting down ${isSimpleUi ? "SimpleUI" : "WebUI"} server\u2026`)
|
|
31720
31763
|
);
|
|
31721
|
-
|
|
31764
|
+
resolve16(0);
|
|
31722
31765
|
}).catch((err) => {
|
|
31723
31766
|
renderer.setSilent(false);
|
|
31724
31767
|
console.debug(`[execution] webui error: ${err}`);
|
|
31725
|
-
|
|
31768
|
+
resolve16(1);
|
|
31726
31769
|
});
|
|
31727
31770
|
});
|
|
31728
31771
|
return webuiExit;
|
|
@@ -32700,8 +32743,6 @@ function createSettingsAdapter(ctx) {
|
|
|
32700
32743
|
delayMs: autonomy?.autoProceedDelayMs ?? 45e3,
|
|
32701
32744
|
titleAnimation: autonomy?.terminalTitleAnimation !== false,
|
|
32702
32745
|
yolo: cfg.yolo ?? (autonomy?.yolo ?? false),
|
|
32703
|
-
// Legacy boolean kept for readers that predate the enum (webui prefs).
|
|
32704
|
-
streamFleet: autonomy?.streamFleet !== false,
|
|
32705
32746
|
fleetChatVerbosity: resolveFleetChatVerbosity(cfg.autonomy),
|
|
32706
32747
|
chime: autonomy?.chime ?? false,
|
|
32707
32748
|
confirmExit: autonomy?.confirmExit !== false,
|
|
@@ -32749,7 +32790,7 @@ function createSettingsAdapter(ctx) {
|
|
|
32749
32790
|
}
|
|
32750
32791
|
async function saveSettings(s) {
|
|
32751
32792
|
try {
|
|
32752
|
-
if (s.mode !== void 0 || s.delayMs !== void 0 || s.titleAnimation !== void 0 || s.yolo !== void 0 || s.
|
|
32793
|
+
if (s.mode !== void 0 || s.delayMs !== void 0 || s.titleAnimation !== void 0 || s.yolo !== void 0 || s.fleetChatVerbosity !== void 0 || s.chime !== void 0 || s.confirmExit !== void 0 || s.mouseMode !== void 0 || s.featureMcp !== void 0 || s.featurePlugins !== void 0 || s.featureMemory !== void 0 || s.featureSkills !== void 0 || s.featureModelsRegistry !== void 0 || s.featureTokenSaving !== void 0 || s.allowOutsideProjectRoot !== void 0 || s.contextAutoCompact !== void 0 || s.contextStrategy !== void 0 || s.contextMode !== void 0 || s.maxConcurrent !== void 0 || s.logLevel !== void 0 || s.auditLevel !== void 0 || s.indexOnStart !== void 0 || s.maxIterations !== void 0 || s.restrictFsToRoot !== void 0 || s.nextPrediction !== void 0 || s.debugStream !== void 0 || s.shellBangWarningDontShowAgain !== void 0 || s.configScope !== void 0 || s.enhanceDelayMs !== void 0 || s.enhanceEnabled !== void 0 || s.enhanceLanguage !== void 0 || s.midRunSendPicker !== void 0 || s.statuslineMode !== void 0 || s.thinkingWord !== void 0 || s.animationStyle !== void 0 || s.autonomyNextPrompt !== void 0 || s.autoProceedMaxIterations !== void 0 || s.reasoningMode !== void 0 || s.reasoningEffort !== void 0 || s.reasoningPreserve !== void 0 || s.cacheTtl !== void 0 || s.breakerEnabled !== void 0 || s.breakerAutoKillResetMs !== void 0 || s.showModelReasoning !== void 0) {
|
|
32753
32794
|
const cfg = configStore.get();
|
|
32754
32795
|
const activeProfileName2 = cfg.activeProfile ?? "default";
|
|
32755
32796
|
const persistDeps = {
|
|
@@ -32782,10 +32823,6 @@ function createSettingsAdapter(ctx) {
|
|
|
32782
32823
|
if (s.yolo !== void 0) autonomy.yolo = s.yolo;
|
|
32783
32824
|
if (s.fleetChatVerbosity !== void 0) {
|
|
32784
32825
|
autonomy.fleetChatVerbosity = s.fleetChatVerbosity;
|
|
32785
|
-
autonomy.streamFleet = s.fleetChatVerbosity !== "off";
|
|
32786
|
-
} else if (s.streamFleet !== void 0) {
|
|
32787
|
-
autonomy.fleetChatVerbosity = s.streamFleet ? "full" : "off";
|
|
32788
|
-
autonomy.streamFleet = s.streamFleet;
|
|
32789
32826
|
}
|
|
32790
32827
|
if (s.chime !== void 0) autonomy.chime = s.chime;
|
|
32791
32828
|
if (s.confirmExit !== void 0) autonomy.confirmExit = s.confirmExit;
|
|
@@ -32960,9 +32997,6 @@ function createSettingsAdapter(ctx) {
|
|
|
32960
32997
|
}
|
|
32961
32998
|
if (s.fleetChatVerbosity !== void 0) {
|
|
32962
32999
|
if (fleetStreamController?.setMode) fleetStreamController.setMode(s.fleetChatVerbosity);
|
|
32963
|
-
else fleetStreamController?.setEnabled(s.fleetChatVerbosity !== "off");
|
|
32964
|
-
} else if (s.streamFleet !== void 0) {
|
|
32965
|
-
fleetStreamController?.setEnabled(s.streamFleet);
|
|
32966
33000
|
}
|
|
32967
33001
|
applyLiveSettings?.(s);
|
|
32968
33002
|
return null;
|
|
@@ -33575,7 +33609,7 @@ async function runRepl(opts) {
|
|
|
33575
33609
|
`[eternal] ${toErrorMessage21(err)}`
|
|
33576
33610
|
);
|
|
33577
33611
|
}
|
|
33578
|
-
await new Promise((
|
|
33612
|
+
await new Promise((resolve16) => setTimeout(resolve16, 250));
|
|
33579
33613
|
continue;
|
|
33580
33614
|
}
|
|
33581
33615
|
} else if (opts.getAutonomy?.() === "eternal-parallel") {
|
|
@@ -33651,7 +33685,7 @@ async function runRepl(opts) {
|
|
|
33651
33685
|
`[parallel] ${toErrorMessage21(err)}`
|
|
33652
33686
|
);
|
|
33653
33687
|
}
|
|
33654
|
-
await new Promise((
|
|
33688
|
+
await new Promise((resolve16) => setTimeout(resolve16, 250));
|
|
33655
33689
|
continue;
|
|
33656
33690
|
}
|
|
33657
33691
|
}
|
|
@@ -34297,12 +34331,12 @@ ${color51.cyan("\u23F3 Auto")} ${color51.dim("(Ctrl+C to cancel)")}
|
|
|
34297
34331
|
let interval;
|
|
34298
34332
|
let lastTickedSecond = sec + 1;
|
|
34299
34333
|
let onAbort;
|
|
34300
|
-
return new Promise((
|
|
34301
|
-
onAbort = () =>
|
|
34334
|
+
return new Promise((resolve16) => {
|
|
34335
|
+
onAbort = () => resolve16(false);
|
|
34302
34336
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
34303
34337
|
interval = setInterval(() => {
|
|
34304
34338
|
if (signal.aborted) {
|
|
34305
|
-
|
|
34339
|
+
resolve16(false);
|
|
34306
34340
|
return;
|
|
34307
34341
|
}
|
|
34308
34342
|
const elapsed = Date.now() - start;
|
|
@@ -34310,7 +34344,7 @@ ${color51.cyan("\u23F3 Auto")} ${color51.dim("(Ctrl+C to cancel)")}
|
|
|
34310
34344
|
if (remaining <= 0) {
|
|
34311
34345
|
opts.renderer.write(color51.dim(` \u21B3 ${truncated}
|
|
34312
34346
|
`));
|
|
34313
|
-
|
|
34347
|
+
resolve16(true);
|
|
34314
34348
|
return;
|
|
34315
34349
|
}
|
|
34316
34350
|
if (opts.onCountdownTick && remaining !== lastTickedSecond) {
|
|
@@ -34321,7 +34355,7 @@ ${color51.cyan("\u23F3 Auto")} ${color51.dim("(Ctrl+C to cancel)")}
|
|
|
34321
34355
|
opts.renderer.write(
|
|
34322
34356
|
color51.yellow(" \u21B3 Countdown cancelled \u2014 switching to manual mode\n")
|
|
34323
34357
|
);
|
|
34324
|
-
|
|
34358
|
+
resolve16(false);
|
|
34325
34359
|
return;
|
|
34326
34360
|
}
|
|
34327
34361
|
} catch {
|
|
@@ -36190,6 +36224,7 @@ init_helpers();
|
|
|
36190
36224
|
|
|
36191
36225
|
// src/slash-commands/acp.ts
|
|
36192
36226
|
import {
|
|
36227
|
+
defaultPermissionPolicy as defaultPermissionPolicy2,
|
|
36193
36228
|
EnsembleRegistry as EnsembleRegistry2,
|
|
36194
36229
|
probeAcpAgents as probeAcpAgents2,
|
|
36195
36230
|
renderAcpBenchText as renderAcpBenchText2,
|
|
@@ -36446,6 +36481,7 @@ ${summary}` };
|
|
|
36446
36481
|
task,
|
|
36447
36482
|
cwd: opts.cwd,
|
|
36448
36483
|
projectRoot: opts.projectRoot,
|
|
36484
|
+
permissionPolicy: defaultPermissionPolicy2,
|
|
36449
36485
|
onProgress: (event) => {
|
|
36450
36486
|
const line = formatProgress2(event);
|
|
36451
36487
|
if (line) opts.renderer.writeInfo(` ${line}
|
|
@@ -38652,7 +38688,7 @@ The following characters are not allowed: ; & | < > ^ $ , ( ) { } [ ] ! # % ' "
|
|
|
38652
38688
|
}
|
|
38653
38689
|
}
|
|
38654
38690
|
function runCommand(cmd, cwd, timeout) {
|
|
38655
|
-
return new Promise((
|
|
38691
|
+
return new Promise((resolve16) => {
|
|
38656
38692
|
validateCommand(cmd);
|
|
38657
38693
|
const opts = {
|
|
38658
38694
|
cwd,
|
|
@@ -38665,7 +38701,7 @@ function runCommand(cmd, cwd, timeout) {
|
|
|
38665
38701
|
shell: process.platform === "win32"
|
|
38666
38702
|
};
|
|
38667
38703
|
execFile(cmd, [], opts, (error, stdout, stderr) => {
|
|
38668
|
-
|
|
38704
|
+
resolve16({
|
|
38669
38705
|
stdout,
|
|
38670
38706
|
stderr,
|
|
38671
38707
|
exitCode: typeof error?.code === "number" ? error.code : 0,
|
|
@@ -41187,7 +41223,7 @@ import { assessCommitSafety } from "@wrongstack/core";
|
|
|
41187
41223
|
import { color as color69, toErrorMessage as toErrorMessage29 } from "@wrongstack/core";
|
|
41188
41224
|
async function runGit(args, cwd) {
|
|
41189
41225
|
try {
|
|
41190
|
-
return await new Promise((
|
|
41226
|
+
return await new Promise((resolve16, reject) => {
|
|
41191
41227
|
const child = spawn9("git", args, {
|
|
41192
41228
|
cwd,
|
|
41193
41229
|
stdio: ["ignore", "pipe", "pipe"],
|
|
@@ -41205,7 +41241,7 @@ async function runGit(args, cwd) {
|
|
|
41205
41241
|
child.on("error", (err) => {
|
|
41206
41242
|
reject(new Error(`Failed to run git: ${err.message}`));
|
|
41207
41243
|
});
|
|
41208
|
-
child.on("close", (code) =>
|
|
41244
|
+
child.on("close", (code) => resolve16({ stdout, stderr, code: code ?? 0 }));
|
|
41209
41245
|
});
|
|
41210
41246
|
} catch (err) {
|
|
41211
41247
|
throw new Error(toErrorMessage29(err));
|
|
@@ -48652,7 +48688,6 @@ function buildAgentsCommand(opts) {
|
|
|
48652
48688
|
},
|
|
48653
48689
|
(autonomy) => {
|
|
48654
48690
|
autonomy.fleetChatVerbosity = mode;
|
|
48655
|
-
autonomy.streamFleet = mode !== "off";
|
|
48656
48691
|
}
|
|
48657
48692
|
);
|
|
48658
48693
|
}
|
|
@@ -49492,7 +49527,7 @@ import { spawn as spawn12 } from "node:child_process";
|
|
|
49492
49527
|
import * as fsp6 from "node:fs/promises";
|
|
49493
49528
|
import * as path63 from "node:path";
|
|
49494
49529
|
async function runGit2(args, cwd) {
|
|
49495
|
-
return new Promise((
|
|
49530
|
+
return new Promise((resolve16) => {
|
|
49496
49531
|
const child = spawn12("git", args, {
|
|
49497
49532
|
cwd,
|
|
49498
49533
|
stdio: ["ignore", "pipe", "pipe"],
|
|
@@ -49503,8 +49538,8 @@ async function runGit2(args, cwd) {
|
|
|
49503
49538
|
child.stdout?.on("data", (d) => {
|
|
49504
49539
|
stdout += d;
|
|
49505
49540
|
});
|
|
49506
|
-
child.on("error", () =>
|
|
49507
|
-
child.on("close", (code) =>
|
|
49541
|
+
child.on("error", () => resolve16({ stdout, code: 1 }));
|
|
49542
|
+
child.on("close", (code) => resolve16({ stdout, code: code ?? 0 }));
|
|
49508
49543
|
});
|
|
49509
49544
|
}
|
|
49510
49545
|
async function getChangedFiles(cwd) {
|
|
@@ -49662,7 +49697,7 @@ function buildSecurityCommand(opts) {
|
|
|
49662
49697
|
};
|
|
49663
49698
|
}
|
|
49664
49699
|
function auditDepsCommand(opts, json) {
|
|
49665
|
-
return new Promise((
|
|
49700
|
+
return new Promise((resolve16) => {
|
|
49666
49701
|
const cwd = opts.cwd;
|
|
49667
49702
|
const child = spawn13("pnpm", ["audit", "--json"], {
|
|
49668
49703
|
cwd,
|
|
@@ -49679,7 +49714,7 @@ function auditDepsCommand(opts, json) {
|
|
|
49679
49714
|
stderr += c.toString("utf8");
|
|
49680
49715
|
});
|
|
49681
49716
|
child.on("error", (err) => {
|
|
49682
|
-
|
|
49717
|
+
resolve16(
|
|
49683
49718
|
securityResult(
|
|
49684
49719
|
color89.red(`/security audit-deps: failed to spawn pnpm: ${err.message}`),
|
|
49685
49720
|
{
|
|
@@ -49727,7 +49762,7 @@ function auditDepsCommand(opts, json) {
|
|
|
49727
49762
|
if (stderr.trim()) summary = color89.dim(stderr.trim().slice(0, 200));
|
|
49728
49763
|
}
|
|
49729
49764
|
const exit = code === 0 ? color89.green("clean") : color89.yellow(`exit ${code}`);
|
|
49730
|
-
|
|
49765
|
+
resolve16(
|
|
49731
49766
|
securityResult(
|
|
49732
49767
|
`${summary}
|
|
49733
49768
|
pnpm audit ${exit}`,
|
|
@@ -50563,7 +50598,6 @@ function buildSettingsCommand(opts) {
|
|
|
50563
50598
|
if (!mode) return { message: `${color90.amber("Usage:")} /settings stream-fleet off|full (on = full)` };
|
|
50564
50599
|
await persistAutonomySetting(persistDeps, (autonomy) => {
|
|
50565
50600
|
autonomy.fleetChatVerbosity = mode;
|
|
50566
|
-
autonomy.streamFleet = mode !== "off";
|
|
50567
50601
|
});
|
|
50568
50602
|
opts.fleetStreamController?.setMode(mode);
|
|
50569
50603
|
const desc = mode === "full" ? "every subagent tool call and message in chat" : "subagent chat lines hidden (F2/F3 stay live)";
|
|
@@ -54199,7 +54233,7 @@ function buildProviderForId(args, providerId) {
|
|
|
54199
54233
|
// src/fleet/host.ts
|
|
54200
54234
|
import { randomUUID as randomUUID11 } from "node:crypto";
|
|
54201
54235
|
import * as path68 from "node:path";
|
|
54202
|
-
import { ACP_AGENT_COMMANDS, findAgentDescriptor, makeACPSubagentRunner } from "@wrongstack/acp";
|
|
54236
|
+
import { ACP_AGENT_COMMANDS, defaultPermissionPolicy as defaultPermissionPolicy3, findAgentDescriptor, makeACPSubagentRunner } from "@wrongstack/acp";
|
|
54203
54237
|
import {
|
|
54204
54238
|
AdaptiveConcurrencyController,
|
|
54205
54239
|
Agent as Agent2,
|
|
@@ -55288,7 +55322,7 @@ ${audienceMemory.map((text) => `- ${text}`).join("\n")}`
|
|
|
55288
55322
|
const oldest = this.acpRunnerAccessOrder.shift();
|
|
55289
55323
|
if (oldest) this.acpRunnerCache.delete(oldest);
|
|
55290
55324
|
}
|
|
55291
|
-
const p = makeACPSubagentRunner(cmd);
|
|
55325
|
+
const p = makeACPSubagentRunner({ ...cmd, permissionPolicy: defaultPermissionPolicy3 });
|
|
55292
55326
|
this.acpRunnerCache.set(subagentId, p);
|
|
55293
55327
|
this.acpRunnerAccessOrder.push(subagentId);
|
|
55294
55328
|
return p;
|
|
@@ -56309,14 +56343,9 @@ async function setupCodebaseIndexing(deps) {
|
|
|
56309
56343
|
// src/wiring/controllers.ts
|
|
56310
56344
|
function createFleetStreamController(initialMode = "off") {
|
|
56311
56345
|
return {
|
|
56312
|
-
enabled: initialMode !== "off",
|
|
56313
56346
|
mode: initialMode,
|
|
56314
|
-
setEnabled(enabled) {
|
|
56315
|
-
this.setMode(enabled ? "full" : "off");
|
|
56316
|
-
},
|
|
56317
56347
|
setMode(mode) {
|
|
56318
56348
|
this.mode = mode;
|
|
56319
|
-
this.enabled = mode !== "off";
|
|
56320
56349
|
}
|
|
56321
56350
|
};
|
|
56322
56351
|
}
|
|
@@ -57744,12 +57773,12 @@ function createSddHandlers(deps) {
|
|
|
57744
57773
|
const sddApi = await import("@wrongstack/sdd");
|
|
57745
57774
|
let worktrees;
|
|
57746
57775
|
if (process.env["WRONGSTACK_SDD_WORKTREES"] !== "0") {
|
|
57747
|
-
const inGit = await new Promise((
|
|
57776
|
+
const inGit = await new Promise((resolve16) => {
|
|
57748
57777
|
let resolved = false;
|
|
57749
57778
|
const settle = (v) => {
|
|
57750
57779
|
if (resolved) return;
|
|
57751
57780
|
resolved = true;
|
|
57752
|
-
|
|
57781
|
+
resolve16(v);
|
|
57753
57782
|
};
|
|
57754
57783
|
try {
|
|
57755
57784
|
const child = spawn15("git", ["rev-parse", "--is-inside-work-tree"], {
|
|
@@ -58284,12 +58313,12 @@ async function main(argv) {
|
|
|
58284
58313
|
requestInput: async (prompt) => {
|
|
58285
58314
|
const { createInterface: createInterface2 } = await import("node:readline");
|
|
58286
58315
|
const rl = createInterface2({ input: process.stdin, output: process.stdout });
|
|
58287
|
-
return new Promise((
|
|
58316
|
+
return new Promise((resolve16) => {
|
|
58288
58317
|
rl.question(`
|
|
58289
58318
|
${prompt}
|
|
58290
58319
|
> `, (answer) => {
|
|
58291
58320
|
rl.close();
|
|
58292
|
-
|
|
58321
|
+
resolve16(answer);
|
|
58293
58322
|
});
|
|
58294
58323
|
});
|
|
58295
58324
|
}
|
|
@@ -58382,8 +58411,8 @@ ${prompt}
|
|
|
58382
58411
|
const projectName = path77.basename(projectRoot);
|
|
58383
58412
|
let gitBranch;
|
|
58384
58413
|
try {
|
|
58385
|
-
const {
|
|
58386
|
-
gitBranch =
|
|
58414
|
+
const { execFileSync: execFileSync2 } = await import("node:child_process");
|
|
58415
|
+
gitBranch = execFileSync2("git", ["rev-parse", "--abbrev-ref", "HEAD"], {
|
|
58387
58416
|
cwd: projectRoot,
|
|
58388
58417
|
timeout: 3e3,
|
|
58389
58418
|
stdio: ["ignore", "pipe", "ignore"],
|
|
@@ -59532,7 +59561,7 @@ Restart WrongStack to load or unload plugin code in this session.`;
|
|
|
59532
59561
|
onBeforeExit: async () => {
|
|
59533
59562
|
const cwd2 = projectRoot;
|
|
59534
59563
|
const statusResult = await new Promise(
|
|
59535
|
-
(
|
|
59564
|
+
(resolve16, reject) => {
|
|
59536
59565
|
const child = spawn16("git", ["status", "--porcelain"], {
|
|
59537
59566
|
cwd: cwd2,
|
|
59538
59567
|
stdio: ["ignore", "pipe", "pipe"],
|
|
@@ -59544,7 +59573,7 @@ Restart WrongStack to load or unload plugin code in this session.`;
|
|
|
59544
59573
|
stdout += d;
|
|
59545
59574
|
});
|
|
59546
59575
|
child.on("error", reject);
|
|
59547
|
-
child.on("close", (code) =>
|
|
59576
|
+
child.on("close", (code) => resolve16({ stdout, code: code ?? 0 }));
|
|
59548
59577
|
}
|
|
59549
59578
|
);
|
|
59550
59579
|
if (statusResult.stdout.trim().length > 0) {
|