@wrongstack/cli 0.292.1 → 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/index.js +162 -155
- 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/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);
|
|
@@ -5849,7 +5849,7 @@ function startHqServerWithAuth(options, host, port, dataDir, firstRunAuth) {
|
|
|
5849
5849
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
5850
5850
|
})
|
|
5851
5851
|
);
|
|
5852
|
-
return new Promise((
|
|
5852
|
+
return new Promise((resolve16, reject) => {
|
|
5853
5853
|
const trustedPublicOrigins = /* @__PURE__ */ new Set();
|
|
5854
5854
|
let listeningPort = port;
|
|
5855
5855
|
const clients = /* @__PURE__ */ new Map();
|
|
@@ -6221,7 +6221,7 @@ function startHqServerWithAuth(options, host, port, dataDir, firstRunAuth) {
|
|
|
6221
6221
|
port: actualPort,
|
|
6222
6222
|
firstRunSetup: startupInfo
|
|
6223
6223
|
});
|
|
6224
|
-
|
|
6224
|
+
resolve16(handle);
|
|
6225
6225
|
})();
|
|
6226
6226
|
});
|
|
6227
6227
|
});
|
|
@@ -6330,7 +6330,7 @@ async function startServer(deps) {
|
|
|
6330
6330
|
}
|
|
6331
6331
|
}
|
|
6332
6332
|
writeStartupInfo(deps, handle);
|
|
6333
|
-
await new Promise((
|
|
6333
|
+
await new Promise((resolve16) => {
|
|
6334
6334
|
const shutdown = async () => {
|
|
6335
6335
|
try {
|
|
6336
6336
|
await handle.close();
|
|
@@ -6338,7 +6338,7 @@ async function startServer(deps) {
|
|
|
6338
6338
|
deps.renderer.write(`HQ server close error: ${String(err)}
|
|
6339
6339
|
`);
|
|
6340
6340
|
}
|
|
6341
|
-
|
|
6341
|
+
resolve16();
|
|
6342
6342
|
};
|
|
6343
6343
|
process.on("SIGINT", shutdown);
|
|
6344
6344
|
process.on("SIGTERM", shutdown);
|
|
@@ -7864,7 +7864,7 @@ function tail(current, chunk) {
|
|
|
7864
7864
|
return `${current}${String(chunk)}`.slice(-MAX_LOG_CHARS);
|
|
7865
7865
|
}
|
|
7866
7866
|
function startHqQuickTunnel(originUrl, options = {}) {
|
|
7867
|
-
return new Promise((
|
|
7867
|
+
return new Promise((resolve16, reject) => {
|
|
7868
7868
|
const executable = options.executable ?? "cloudflared";
|
|
7869
7869
|
let child;
|
|
7870
7870
|
try {
|
|
@@ -7896,7 +7896,7 @@ function startHqQuickTunnel(originUrl, options = {}) {
|
|
|
7896
7896
|
const readyUrl = publicUrl;
|
|
7897
7897
|
settled = true;
|
|
7898
7898
|
clearTimeout(timer);
|
|
7899
|
-
|
|
7899
|
+
resolve16({
|
|
7900
7900
|
url: readyUrl,
|
|
7901
7901
|
close: () => new Promise((done) => {
|
|
7902
7902
|
if (child.exitCode !== null || child.signalCode !== null) {
|
|
@@ -9956,10 +9956,11 @@ import {
|
|
|
9956
9956
|
function sendStatus(ctx, ws, kind, phase, extra = {}) {
|
|
9957
9957
|
ctx.send(ws, { type: "auth.oauth.status", payload: { kind, phase, ...extra } });
|
|
9958
9958
|
}
|
|
9959
|
-
async function persistOutcome(ctx, outcome) {
|
|
9959
|
+
async function persistOutcome(ctx, outcome, customProviderId) {
|
|
9960
9960
|
const providers = await ctx.providerStore.load();
|
|
9961
|
-
const
|
|
9962
|
-
const
|
|
9961
|
+
const providerId = customProviderId ?? outcome.providerId;
|
|
9962
|
+
const existing = providers[providerId];
|
|
9963
|
+
const p = existing ? { ...existing } : { type: providerId };
|
|
9963
9964
|
p.family = outcome.family;
|
|
9964
9965
|
if (!p.baseUrl) p.baseUrl = outcome.baseUrl;
|
|
9965
9966
|
p.models = [...outcome.models];
|
|
@@ -9967,27 +9968,33 @@ async function persistOutcome(ctx, outcome) {
|
|
|
9967
9968
|
keys.push(outcome.apiKey);
|
|
9968
9969
|
writeKeysBack(p, keys);
|
|
9969
9970
|
p.activeKey = outcome.apiKey.label;
|
|
9970
|
-
providers[
|
|
9971
|
+
providers[providerId] = p;
|
|
9971
9972
|
await ctx.providerStore.save(providers);
|
|
9972
9973
|
broadcastSaved(ctx, providers);
|
|
9973
9974
|
}
|
|
9974
|
-
async function finish(ctx, ws, kind, outcome) {
|
|
9975
|
+
async function finish(ctx, ws, kind, outcome, customProviderId) {
|
|
9975
9976
|
if (!outcome) {
|
|
9976
9977
|
sendStatus(ctx, ws, kind, "error", { message: "Sign-in cancelled or timed out." });
|
|
9977
9978
|
return;
|
|
9978
9979
|
}
|
|
9979
|
-
sendStatus(ctx, ws, kind, "fetching_models", { providerId: outcome.providerId });
|
|
9980
|
-
await persistOutcome(ctx, outcome);
|
|
9980
|
+
sendStatus(ctx, ws, kind, "fetching_models", { providerId: customProviderId ?? outcome.providerId });
|
|
9981
|
+
await persistOutcome(ctx, outcome, customProviderId);
|
|
9981
9982
|
sendStatus(ctx, ws, kind, "success", {
|
|
9982
|
-
providerId: outcome.providerId,
|
|
9983
|
-
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).`
|
|
9984
9985
|
});
|
|
9985
9986
|
}
|
|
9986
|
-
async function handleOAuthStart(ctx, ws, kind) {
|
|
9987
|
+
async function handleOAuthStart(ctx, ws, kind, customProviderId) {
|
|
9987
9988
|
try {
|
|
9988
9989
|
oauthSessions.get(kind)?.close();
|
|
9989
9990
|
oauthSessions.delete(kind);
|
|
9990
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
|
+
}
|
|
9991
9998
|
oauthSessions.set(kind, session);
|
|
9992
9999
|
if (kind === "copilot") {
|
|
9993
10000
|
sendStatus(ctx, ws, kind, "awaiting_code", {
|
|
@@ -10008,7 +10015,7 @@ async function handleOAuthStart(ctx, ws, kind) {
|
|
|
10008
10015
|
void (async () => {
|
|
10009
10016
|
try {
|
|
10010
10017
|
const outcome = await session.waitForCompletion();
|
|
10011
|
-
await finish(ctx, ws, kind, outcome);
|
|
10018
|
+
await finish(ctx, ws, kind, outcome, customProviderIds.get(kind));
|
|
10012
10019
|
} catch (err) {
|
|
10013
10020
|
sendStatus(ctx, ws, kind, "error", { message: toErrorMessage18(err) });
|
|
10014
10021
|
} finally {
|
|
@@ -10031,7 +10038,7 @@ async function handleOAuthCode(ctx, ws, kind, input) {
|
|
|
10031
10038
|
try {
|
|
10032
10039
|
sendStatus(ctx, ws, kind, "exchanging", { providerId: session.providerId });
|
|
10033
10040
|
const outcome = await session.completeWithCode(input);
|
|
10034
|
-
await finish(ctx, ws, kind, outcome);
|
|
10041
|
+
await finish(ctx, ws, kind, outcome, customProviderIds.get(kind));
|
|
10035
10042
|
} catch (err) {
|
|
10036
10043
|
sendStatus(ctx, ws, kind, "error", { message: toErrorMessage18(err) });
|
|
10037
10044
|
} finally {
|
|
@@ -10044,13 +10051,14 @@ function handleOAuthCancel(ctx, ws, kind) {
|
|
|
10044
10051
|
oauthSessions.delete(kind);
|
|
10045
10052
|
sendStatus(ctx, ws, kind, "error", { message: "Sign-in cancelled." });
|
|
10046
10053
|
}
|
|
10047
|
-
var oauthSessions;
|
|
10054
|
+
var oauthSessions, customProviderIds;
|
|
10048
10055
|
var init_oauth = __esm({
|
|
10049
10056
|
"src/webui-server/ws-handlers/oauth.ts"() {
|
|
10050
10057
|
"use strict";
|
|
10051
10058
|
init_provider_config();
|
|
10052
10059
|
init_providers();
|
|
10053
10060
|
oauthSessions = /* @__PURE__ */ new Map();
|
|
10061
|
+
customProviderIds = /* @__PURE__ */ new Map();
|
|
10054
10062
|
}
|
|
10055
10063
|
});
|
|
10056
10064
|
|
|
@@ -12980,7 +12988,8 @@ function createMessageRouter(deps) {
|
|
|
12980
12988
|
// ── Subscription OAuth login (ChatGPT / Claude / Copilot) ──
|
|
12981
12989
|
"auth.oauth.start": (msg, ws) => {
|
|
12982
12990
|
const kind = oauthKindOf(msg);
|
|
12983
|
-
|
|
12991
|
+
const providerId = msg.payload?.providerId;
|
|
12992
|
+
if (kind) void handleOAuthStart(wsHandlerCtx, ws, kind, typeof providerId === "string" ? providerId : void 0);
|
|
12984
12993
|
},
|
|
12985
12994
|
"auth.oauth.code": (msg, ws) => {
|
|
12986
12995
|
const kind = oauthKindOf(msg);
|
|
@@ -13617,7 +13626,7 @@ async function seedConfigToMeta(opts) {
|
|
|
13617
13626
|
meta["yolo"] = autonomyCfg["yolo"] ?? cfg.yolo ?? false;
|
|
13618
13627
|
meta["chime"] = autonomyCfg["chime"] ?? false;
|
|
13619
13628
|
meta["confirmExit"] = autonomyCfg["confirmExit"] !== false;
|
|
13620
|
-
meta["
|
|
13629
|
+
meta["fleetChatVerbosity"] = autonomyCfg["fleetChatVerbosity"] ?? "off";
|
|
13621
13630
|
meta["enhanceEnabled"] = autonomyCfg["enhance"] ?? true;
|
|
13622
13631
|
meta["enhanceDelayMs"] = autonomyCfg["enhanceDelayMs"] ?? 6e4;
|
|
13623
13632
|
meta["enhanceLanguage"] = autonomyCfg["enhanceLanguage"] ?? "original";
|
|
@@ -13772,9 +13781,8 @@ function createPrefsSeeding(opts) {
|
|
|
13772
13781
|
}
|
|
13773
13782
|
if ("chime" in payload) autonomy["chime"] = payload["chime"];
|
|
13774
13783
|
if ("confirmExit" in payload) autonomy["confirmExit"] = payload["confirmExit"];
|
|
13775
|
-
if ("
|
|
13776
|
-
autonomy["
|
|
13777
|
-
autonomy["fleetChatVerbosity"] = payload["streamFleet"] ? "full" : "off";
|
|
13784
|
+
if ("fleetChatVerbosity" in payload) {
|
|
13785
|
+
autonomy["fleetChatVerbosity"] = payload["fleetChatVerbosity"];
|
|
13778
13786
|
}
|
|
13779
13787
|
if ("enhanceEnabled" in payload) autonomy["enhance"] = payload["enhanceEnabled"];
|
|
13780
13788
|
if ("enhanceDelayMs" in payload) autonomy["enhanceDelayMs"] = payload["enhanceDelayMs"];
|
|
@@ -14010,7 +14018,7 @@ var init_prefs_seeding = __esm({
|
|
|
14010
14018
|
"maxIterations",
|
|
14011
14019
|
"chime",
|
|
14012
14020
|
"confirmExit",
|
|
14013
|
-
"
|
|
14021
|
+
"fleetChatVerbosity",
|
|
14014
14022
|
"nextPrediction",
|
|
14015
14023
|
"fallbackModels",
|
|
14016
14024
|
"fallbackProfiles",
|
|
@@ -15799,7 +15807,7 @@ async function runWebUI(opts) {
|
|
|
15799
15807
|
kanbanRunMirror: kanbanRunMirror ?? void 0,
|
|
15800
15808
|
kanbanSupervisor: kanbanSupervisor ?? void 0
|
|
15801
15809
|
});
|
|
15802
|
-
const stopped = new Promise((
|
|
15810
|
+
const stopped = new Promise((resolve16) => {
|
|
15803
15811
|
wss.on("listening", () => {
|
|
15804
15812
|
console.log(`[WebUI] WebSocket server running on ws://${host}:${port}`);
|
|
15805
15813
|
setupEvents();
|
|
@@ -15889,7 +15897,7 @@ async function runWebUI(opts) {
|
|
|
15889
15897
|
wss,
|
|
15890
15898
|
pid: process.pid,
|
|
15891
15899
|
registryBaseDir,
|
|
15892
|
-
onStopped:
|
|
15900
|
+
onStopped: resolve16
|
|
15893
15901
|
});
|
|
15894
15902
|
registerWebuiSignalHandlers(signalShutdown);
|
|
15895
15903
|
});
|
|
@@ -16158,7 +16166,7 @@ async function runProjectPicker(opts) {
|
|
|
16158
16166
|
const reservedBottom = 3;
|
|
16159
16167
|
const headerHeight = reservedTop + reservedBottom;
|
|
16160
16168
|
const baseVisibleHeight = Math.max(5, terminalHeight() - headerHeight);
|
|
16161
|
-
return new Promise((
|
|
16169
|
+
return new Promise((resolve16) => {
|
|
16162
16170
|
const wasRaw = stdin.isRaw;
|
|
16163
16171
|
const wasPaused = stdin.isPaused();
|
|
16164
16172
|
let filter = "";
|
|
@@ -16282,7 +16290,7 @@ async function runProjectPicker(opts) {
|
|
|
16282
16290
|
cleanup();
|
|
16283
16291
|
out.write(CURSOR_SHOW);
|
|
16284
16292
|
out.write("\n");
|
|
16285
|
-
|
|
16293
|
+
resolve16(void 0);
|
|
16286
16294
|
return;
|
|
16287
16295
|
}
|
|
16288
16296
|
if (ch === ESC) {
|
|
@@ -16295,7 +16303,7 @@ async function runProjectPicker(opts) {
|
|
|
16295
16303
|
cleanup();
|
|
16296
16304
|
out.write(CURSOR_SHOW);
|
|
16297
16305
|
out.write("\n");
|
|
16298
|
-
|
|
16306
|
+
resolve16(void 0);
|
|
16299
16307
|
return;
|
|
16300
16308
|
}
|
|
16301
16309
|
if (ch === BS || ch === "\b") {
|
|
@@ -16312,22 +16320,22 @@ async function runProjectPicker(opts) {
|
|
|
16312
16320
|
out.write(CURSOR_SHOW);
|
|
16313
16321
|
out.write("\n");
|
|
16314
16322
|
if (!item || item.key === "__divider__") {
|
|
16315
|
-
|
|
16323
|
+
resolve16(void 0);
|
|
16316
16324
|
return;
|
|
16317
16325
|
}
|
|
16318
16326
|
if (item.key === "quit") {
|
|
16319
|
-
|
|
16327
|
+
resolve16(void 0);
|
|
16320
16328
|
return;
|
|
16321
16329
|
}
|
|
16322
16330
|
if (item.key === "new-session") {
|
|
16323
|
-
|
|
16331
|
+
resolve16({ kind: "action", key: "new-session", action: "new-session" });
|
|
16324
16332
|
return;
|
|
16325
16333
|
}
|
|
16326
16334
|
if (item.key === "prev-sessions") {
|
|
16327
|
-
|
|
16335
|
+
resolve16({ kind: "action", key: "prev-sessions", action: "prev-sessions" });
|
|
16328
16336
|
return;
|
|
16329
16337
|
}
|
|
16330
|
-
|
|
16338
|
+
resolve16({ kind: "project", key: item.key });
|
|
16331
16339
|
return;
|
|
16332
16340
|
}
|
|
16333
16341
|
if (filter.length === 0) {
|
|
@@ -16335,7 +16343,7 @@ async function runProjectPicker(opts) {
|
|
|
16335
16343
|
cleanup();
|
|
16336
16344
|
out.write(CURSOR_SHOW);
|
|
16337
16345
|
out.write("\n");
|
|
16338
|
-
|
|
16346
|
+
resolve16(void 0);
|
|
16339
16347
|
return;
|
|
16340
16348
|
}
|
|
16341
16349
|
if (ch === "j") {
|
|
@@ -16364,7 +16372,7 @@ async function runProjectPicker(opts) {
|
|
|
16364
16372
|
try {
|
|
16365
16373
|
stdin.setRawMode(true);
|
|
16366
16374
|
} catch {
|
|
16367
|
-
|
|
16375
|
+
resolve16(void 0);
|
|
16368
16376
|
return;
|
|
16369
16377
|
}
|
|
16370
16378
|
stdin.resume();
|
|
@@ -16375,7 +16383,7 @@ async function runProjectPicker(opts) {
|
|
|
16375
16383
|
stdin.once("close", () => {
|
|
16376
16384
|
cleanup();
|
|
16377
16385
|
out.write(CURSOR_SHOW);
|
|
16378
|
-
|
|
16386
|
+
resolve16(void 0);
|
|
16379
16387
|
});
|
|
16380
16388
|
});
|
|
16381
16389
|
}
|
|
@@ -18587,12 +18595,12 @@ function callbackHtml(ok2, message) {
|
|
|
18587
18595
|
function startLoopbackServer(expectedState, signal) {
|
|
18588
18596
|
let resolveCode = () => {
|
|
18589
18597
|
};
|
|
18590
|
-
const codePromise = new Promise((
|
|
18598
|
+
const codePromise = new Promise((resolve16) => {
|
|
18591
18599
|
let settled = false;
|
|
18592
18600
|
resolveCode = (v) => {
|
|
18593
18601
|
if (settled) return;
|
|
18594
18602
|
settled = true;
|
|
18595
|
-
|
|
18603
|
+
resolve16(v);
|
|
18596
18604
|
};
|
|
18597
18605
|
});
|
|
18598
18606
|
const server = createServer((req2, res) => {
|
|
@@ -18646,10 +18654,10 @@ function startLoopbackServer(expectedState, signal) {
|
|
|
18646
18654
|
if (signal.aborted) onAbort();
|
|
18647
18655
|
else signal.addEventListener("abort", onAbort, { once: true });
|
|
18648
18656
|
}
|
|
18649
|
-
return new Promise((
|
|
18657
|
+
return new Promise((resolve16) => {
|
|
18650
18658
|
server.on("error", () => {
|
|
18651
18659
|
resolveCode(null);
|
|
18652
|
-
|
|
18660
|
+
resolve16({
|
|
18653
18661
|
bound: false,
|
|
18654
18662
|
waitForCode: () => Promise.resolve(null),
|
|
18655
18663
|
close: () => {
|
|
@@ -18661,7 +18669,7 @@ function startLoopbackServer(expectedState, signal) {
|
|
|
18661
18669
|
});
|
|
18662
18670
|
});
|
|
18663
18671
|
server.listen(REDIRECT_PORT, REDIRECT_HOST, () => {
|
|
18664
|
-
|
|
18672
|
+
resolve16({
|
|
18665
18673
|
bound: true,
|
|
18666
18674
|
waitForCode: () => codePromise,
|
|
18667
18675
|
close: () => {
|
|
@@ -18833,9 +18841,9 @@ function openBrowser2(url) {
|
|
|
18833
18841
|
}
|
|
18834
18842
|
}
|
|
18835
18843
|
function sleep(ms, signal) {
|
|
18836
|
-
return new Promise((
|
|
18844
|
+
return new Promise((resolve16, reject) => {
|
|
18837
18845
|
if (signal.aborted) return reject(new DOMException("Aborted", "AbortError"));
|
|
18838
|
-
const t = setTimeout(
|
|
18846
|
+
const t = setTimeout(resolve16, ms);
|
|
18839
18847
|
signal.addEventListener(
|
|
18840
18848
|
"abort",
|
|
18841
18849
|
() => {
|
|
@@ -19223,12 +19231,12 @@ function callbackHtml2(ok2, message) {
|
|
|
19223
19231
|
function startLoopbackServer2(state, signal) {
|
|
19224
19232
|
let resolveCode = () => {
|
|
19225
19233
|
};
|
|
19226
|
-
const codePromise = new Promise((
|
|
19234
|
+
const codePromise = new Promise((resolve16) => {
|
|
19227
19235
|
let settled = false;
|
|
19228
19236
|
resolveCode = (v) => {
|
|
19229
19237
|
if (settled) return;
|
|
19230
19238
|
settled = true;
|
|
19231
|
-
|
|
19239
|
+
resolve16(v);
|
|
19232
19240
|
};
|
|
19233
19241
|
});
|
|
19234
19242
|
const server = createServer2((req2, res) => {
|
|
@@ -19281,7 +19289,7 @@ function startLoopbackServer2(state, signal) {
|
|
|
19281
19289
|
if (signal.aborted) onAbort();
|
|
19282
19290
|
else signal.addEventListener("abort", onAbort, { once: true });
|
|
19283
19291
|
}
|
|
19284
|
-
return new Promise((
|
|
19292
|
+
return new Promise((resolve16) => {
|
|
19285
19293
|
const ports = [REDIRECT_PORT2, FALLBACK_REDIRECT_PORT];
|
|
19286
19294
|
let index = 0;
|
|
19287
19295
|
const close = () => {
|
|
@@ -19293,7 +19301,7 @@ function startLoopbackServer2(state, signal) {
|
|
|
19293
19301
|
};
|
|
19294
19302
|
const fail2 = () => {
|
|
19295
19303
|
resolveCode(null);
|
|
19296
|
-
|
|
19304
|
+
resolve16({
|
|
19297
19305
|
bound: false,
|
|
19298
19306
|
port: REDIRECT_PORT2,
|
|
19299
19307
|
waitForCode: () => Promise.resolve(null),
|
|
@@ -19312,7 +19320,7 @@ function startLoopbackServer2(state, signal) {
|
|
|
19312
19320
|
server.on("listening", () => {
|
|
19313
19321
|
const address = server.address();
|
|
19314
19322
|
const port = typeof address === "object" && address ? address.port : ports[index] ?? REDIRECT_PORT2;
|
|
19315
|
-
|
|
19323
|
+
resolve16({
|
|
19316
19324
|
bound: true,
|
|
19317
19325
|
port,
|
|
19318
19326
|
waitForCode: () => codePromise,
|
|
@@ -20346,7 +20354,7 @@ async function runLiveProviderPicker(displayList, savedSet) {
|
|
|
20346
20354
|
writeOut(frame);
|
|
20347
20355
|
writeOut("\x1B7");
|
|
20348
20356
|
cursorToQuery(frame, state.query);
|
|
20349
|
-
return new Promise((
|
|
20357
|
+
return new Promise((resolve16) => {
|
|
20350
20358
|
const wasRaw = stdin.isRaw;
|
|
20351
20359
|
const wasPaused = stdin.isPaused();
|
|
20352
20360
|
setRawMode(stdin, true);
|
|
@@ -20376,7 +20384,7 @@ async function runLiveProviderPicker(displayList, savedSet) {
|
|
|
20376
20384
|
if (state.status === "cancelled") {
|
|
20377
20385
|
cleanup();
|
|
20378
20386
|
writeOut("\n");
|
|
20379
|
-
|
|
20387
|
+
resolve16(void 0);
|
|
20380
20388
|
return;
|
|
20381
20389
|
}
|
|
20382
20390
|
if (state.status === "submitted") {
|
|
@@ -20388,7 +20396,7 @@ async function runLiveProviderPicker(displayList, savedSet) {
|
|
|
20388
20396
|
const pick = ordered[state.selected] ?? ordered[0];
|
|
20389
20397
|
cleanup();
|
|
20390
20398
|
writeOut("\n");
|
|
20391
|
-
|
|
20399
|
+
resolve16(pick);
|
|
20392
20400
|
return;
|
|
20393
20401
|
}
|
|
20394
20402
|
repaint();
|
|
@@ -20601,7 +20609,7 @@ async function runLiveModelPicker(provider, defaultModel) {
|
|
|
20601
20609
|
if (preamble) writeOut(preamble);
|
|
20602
20610
|
let frame = renderLiveModelList(state.query, ordered, state.selected, header);
|
|
20603
20611
|
writeOut(frame);
|
|
20604
|
-
return new Promise((
|
|
20612
|
+
return new Promise((resolve16) => {
|
|
20605
20613
|
const wasRaw = stdin.isRaw;
|
|
20606
20614
|
const wasPaused = stdin.isPaused();
|
|
20607
20615
|
setRawMode(stdin, true);
|
|
@@ -20628,7 +20636,7 @@ async function runLiveModelPicker(provider, defaultModel) {
|
|
|
20628
20636
|
if (state.status === "cancelled") {
|
|
20629
20637
|
cleanup();
|
|
20630
20638
|
writeOut("\n");
|
|
20631
|
-
|
|
20639
|
+
resolve16(void 0);
|
|
20632
20640
|
return;
|
|
20633
20641
|
}
|
|
20634
20642
|
if (state.status === "submitted") {
|
|
@@ -20640,7 +20648,7 @@ async function runLiveModelPicker(provider, defaultModel) {
|
|
|
20640
20648
|
const pick = ordered[state.selected] ?? ordered[0];
|
|
20641
20649
|
cleanup();
|
|
20642
20650
|
writeOut("\n");
|
|
20643
|
-
|
|
20651
|
+
resolve16(pick);
|
|
20644
20652
|
return;
|
|
20645
20653
|
}
|
|
20646
20654
|
repaint();
|
|
@@ -22355,7 +22363,7 @@ function resolveTaskConcurrency() {
|
|
|
22355
22363
|
var WORKTREE_PHASE_CONCURRENCY = 4;
|
|
22356
22364
|
var MAX_CMD_OUTPUT = 2e5;
|
|
22357
22365
|
function gitText(args, cwd) {
|
|
22358
|
-
return new Promise((
|
|
22366
|
+
return new Promise((resolve16, reject) => {
|
|
22359
22367
|
let child;
|
|
22360
22368
|
try {
|
|
22361
22369
|
child = spawn4("git", args, {
|
|
@@ -22380,8 +22388,8 @@ function gitText(args, cwd) {
|
|
|
22380
22388
|
};
|
|
22381
22389
|
child.stdout?.on("data", emit);
|
|
22382
22390
|
child.stderr?.on("data", emit);
|
|
22383
|
-
child.on("error", () =>
|
|
22384
|
-
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() }));
|
|
22385
22393
|
});
|
|
22386
22394
|
}
|
|
22387
22395
|
async function isGitRepo(cwd) {
|
|
@@ -22430,7 +22438,7 @@ function runCmd(cmd, args, cwd, shell = false) {
|
|
|
22430
22438
|
});
|
|
22431
22439
|
}
|
|
22432
22440
|
}
|
|
22433
|
-
return new Promise((
|
|
22441
|
+
return new Promise((resolve16, reject) => {
|
|
22434
22442
|
const chunks = [];
|
|
22435
22443
|
let child;
|
|
22436
22444
|
try {
|
|
@@ -22453,11 +22461,11 @@ function runCmd(cmd, args, cwd, shell = false) {
|
|
|
22453
22461
|
};
|
|
22454
22462
|
child.stdout?.on("data", append);
|
|
22455
22463
|
child.stderr?.on("data", append);
|
|
22456
|
-
child.on("error", (e) =>
|
|
22464
|
+
child.on("error", (e) => resolve16({ code: 1, out: `${chunks.join("")}${String(e)}` }));
|
|
22457
22465
|
child.on("close", (code) => {
|
|
22458
22466
|
let out = chunks.join("");
|
|
22459
22467
|
if (out.length > MAX_CMD_OUTPUT) out = out.slice(-MAX_CMD_OUTPUT);
|
|
22460
|
-
|
|
22468
|
+
resolve16({ code: code ?? 1, out: out.trim() });
|
|
22461
22469
|
});
|
|
22462
22470
|
});
|
|
22463
22471
|
}
|
|
@@ -23474,25 +23482,25 @@ var ReadlineInputReader = class {
|
|
|
23474
23482
|
async readLine(prompt, timeoutOpts) {
|
|
23475
23483
|
if (this.history.length === 0) await this.loadHistory();
|
|
23476
23484
|
while (this.pending) {
|
|
23477
|
-
await new Promise((
|
|
23485
|
+
await new Promise((resolve16) => setTimeout(resolve16, 50));
|
|
23478
23486
|
}
|
|
23479
23487
|
this.pending = true;
|
|
23480
23488
|
try {
|
|
23481
23489
|
if (this.rl) {
|
|
23482
23490
|
const old = this.rl;
|
|
23483
23491
|
this.rl = void 0;
|
|
23484
|
-
await new Promise((
|
|
23492
|
+
await new Promise((resolve16) => {
|
|
23485
23493
|
if (old.closed) {
|
|
23486
|
-
|
|
23494
|
+
resolve16();
|
|
23487
23495
|
} else {
|
|
23488
|
-
old.once("close",
|
|
23496
|
+
old.once("close", resolve16);
|
|
23489
23497
|
old.close();
|
|
23490
23498
|
}
|
|
23491
23499
|
});
|
|
23492
23500
|
}
|
|
23493
23501
|
const fresh = this.ensure();
|
|
23494
23502
|
this.installPromptGuard(fresh);
|
|
23495
|
-
return new Promise((
|
|
23503
|
+
return new Promise((resolve16) => {
|
|
23496
23504
|
let settled = false;
|
|
23497
23505
|
let timeoutHandle;
|
|
23498
23506
|
const settle = (line) => {
|
|
@@ -23500,7 +23508,7 @@ var ReadlineInputReader = class {
|
|
|
23500
23508
|
settled = true;
|
|
23501
23509
|
if (timeoutHandle) clearTimeout(timeoutHandle);
|
|
23502
23510
|
setOutputLineGuard2(null);
|
|
23503
|
-
|
|
23511
|
+
resolve16(line);
|
|
23504
23512
|
};
|
|
23505
23513
|
if (timeoutOpts) {
|
|
23506
23514
|
timeoutHandle = setTimeout(() => {
|
|
@@ -23564,7 +23572,7 @@ var ReadlineInputReader = class {
|
|
|
23564
23572
|
async readKey(prompt, options) {
|
|
23565
23573
|
setOutputLineGuard2(null);
|
|
23566
23574
|
writeOut2(prompt);
|
|
23567
|
-
return new Promise((
|
|
23575
|
+
return new Promise((resolve16) => {
|
|
23568
23576
|
const stdin = process.stdin;
|
|
23569
23577
|
const wasRaw = stdin.isRaw;
|
|
23570
23578
|
const wasPaused = stdin.isPaused();
|
|
@@ -23575,7 +23583,7 @@ var ReadlineInputReader = class {
|
|
|
23575
23583
|
if (key === "") {
|
|
23576
23584
|
cleanup();
|
|
23577
23585
|
writeOut2("\n");
|
|
23578
|
-
|
|
23586
|
+
resolve16("");
|
|
23579
23587
|
return;
|
|
23580
23588
|
}
|
|
23581
23589
|
const opt = options.find(
|
|
@@ -23585,12 +23593,12 @@ var ReadlineInputReader = class {
|
|
|
23585
23593
|
cleanup();
|
|
23586
23594
|
writeOut2(`${opt.key}
|
|
23587
23595
|
`);
|
|
23588
|
-
|
|
23596
|
+
resolve16(opt.value);
|
|
23589
23597
|
}
|
|
23590
23598
|
};
|
|
23591
23599
|
const onClose = () => {
|
|
23592
23600
|
cleanup();
|
|
23593
|
-
|
|
23601
|
+
resolve16("");
|
|
23594
23602
|
};
|
|
23595
23603
|
const cleanup = () => {
|
|
23596
23604
|
stdin.off("data", onData);
|
|
@@ -23622,7 +23630,7 @@ var ReadlineInputReader = class {
|
|
|
23622
23630
|
this.rl?.close();
|
|
23623
23631
|
this.rl = void 0;
|
|
23624
23632
|
writeOut2(prompt);
|
|
23625
|
-
return new Promise((
|
|
23633
|
+
return new Promise((resolve16) => {
|
|
23626
23634
|
let buf = "";
|
|
23627
23635
|
const wasRaw = stdin.isRaw;
|
|
23628
23636
|
const cleanup = () => {
|
|
@@ -23651,13 +23659,13 @@ var ReadlineInputReader = class {
|
|
|
23651
23659
|
cleanup();
|
|
23652
23660
|
writeOut2(` ${dim(`[${buf.length} chars]`)}
|
|
23653
23661
|
`);
|
|
23654
|
-
|
|
23662
|
+
resolve16(buf);
|
|
23655
23663
|
return;
|
|
23656
23664
|
}
|
|
23657
23665
|
if (ch === "") {
|
|
23658
23666
|
cleanup();
|
|
23659
23667
|
writeOut2("\n");
|
|
23660
|
-
|
|
23668
|
+
resolve16("");
|
|
23661
23669
|
return;
|
|
23662
23670
|
}
|
|
23663
23671
|
if (ch === "") {
|
|
@@ -24057,7 +24065,7 @@ async function runProjectCheck(opts) {
|
|
|
24057
24065
|
if (answer2 === "y" || answer2 === "yes") {
|
|
24058
24066
|
try {
|
|
24059
24067
|
const { spawn: spawn17 } = await import("node:child_process");
|
|
24060
|
-
await new Promise((
|
|
24068
|
+
await new Promise((resolve16, reject) => {
|
|
24061
24069
|
const child = spawn17("git", ["init"], {
|
|
24062
24070
|
cwd,
|
|
24063
24071
|
signal: AbortSignal.timeout(1e4),
|
|
@@ -24066,7 +24074,7 @@ async function runProjectCheck(opts) {
|
|
|
24066
24074
|
child.on("error", reject);
|
|
24067
24075
|
child.on(
|
|
24068
24076
|
"close",
|
|
24069
|
-
(code) => code === 0 ?
|
|
24077
|
+
(code) => code === 0 ? resolve16() : reject(new Error(`git init failed with ${code}`))
|
|
24070
24078
|
);
|
|
24071
24079
|
});
|
|
24072
24080
|
renderer.write(` ${color14.green("\u2713")} Git repository initialized
|
|
@@ -24771,6 +24779,7 @@ init_update();
|
|
|
24771
24779
|
|
|
24772
24780
|
// src/subcommands/handlers/acp.ts
|
|
24773
24781
|
import {
|
|
24782
|
+
defaultPermissionPolicy,
|
|
24774
24783
|
EnsembleRegistry,
|
|
24775
24784
|
probeAcpAgents,
|
|
24776
24785
|
renderAcpBenchText,
|
|
@@ -25268,11 +25277,11 @@ async function runACPWebSocketServer(deps, port) {
|
|
|
25268
25277
|
` : `WrongStack ACP server listening on ws://${host}:${port} (${deps.config.provider}/${deps.config.model}). Press Ctrl+C to stop.
|
|
25269
25278
|
`
|
|
25270
25279
|
);
|
|
25271
|
-
await new Promise((
|
|
25280
|
+
await new Promise((resolve16) => {
|
|
25272
25281
|
const shutdown = () => {
|
|
25273
25282
|
deps.renderer.writeWarning("\nShutting down ACP WebSocket server...");
|
|
25274
25283
|
wss.close();
|
|
25275
|
-
|
|
25284
|
+
resolve16();
|
|
25276
25285
|
};
|
|
25277
25286
|
process.on("SIGINT", shutdown);
|
|
25278
25287
|
process.on("SIGTERM", shutdown);
|
|
@@ -25426,6 +25435,7 @@ async function spawnACPAgent(args, deps) {
|
|
|
25426
25435
|
role: subagentId,
|
|
25427
25436
|
task,
|
|
25428
25437
|
signal: ac.signal,
|
|
25438
|
+
permissionPolicy: defaultPermissionPolicy,
|
|
25429
25439
|
onProgress: (event) => {
|
|
25430
25440
|
const line = formatProgress(event);
|
|
25431
25441
|
if (line) deps.renderer.writeInfo(` ${line}
|
|
@@ -27032,14 +27042,14 @@ or stop the conflicting process and retry.
|
|
|
27032
27042
|
});
|
|
27033
27043
|
let boundPort = -1;
|
|
27034
27044
|
try {
|
|
27035
|
-
await new Promise((
|
|
27045
|
+
await new Promise((resolve16, reject) => {
|
|
27036
27046
|
const onError = (err) => {
|
|
27037
27047
|
server.off("listening", onListening);
|
|
27038
27048
|
reject(err);
|
|
27039
27049
|
};
|
|
27040
27050
|
const onListening = () => {
|
|
27041
27051
|
server.off("error", onError);
|
|
27042
|
-
|
|
27052
|
+
resolve16();
|
|
27043
27053
|
};
|
|
27044
27054
|
server.once("error", onError);
|
|
27045
27055
|
server.once("listening", onListening);
|
|
@@ -27052,14 +27062,14 @@ or stop the conflicting process and retry.
|
|
|
27052
27062
|
const msg = err.message;
|
|
27053
27063
|
if (portExplicitlySet && !strictPort) {
|
|
27054
27064
|
try {
|
|
27055
|
-
await new Promise((
|
|
27065
|
+
await new Promise((resolve16, reject) => {
|
|
27056
27066
|
const onError = (e) => {
|
|
27057
27067
|
server.off("listening", onListening);
|
|
27058
27068
|
reject(e);
|
|
27059
27069
|
};
|
|
27060
27070
|
const onListening = () => {
|
|
27061
27071
|
server.off("error", onError);
|
|
27062
|
-
|
|
27072
|
+
resolve16();
|
|
27063
27073
|
};
|
|
27064
27074
|
server.once("error", onError);
|
|
27065
27075
|
server.once("listening", onListening);
|
|
@@ -27112,7 +27122,7 @@ This usually means no port is available (extremely rare). Retry or pick an expli
|
|
|
27112
27122
|
}
|
|
27113
27123
|
});
|
|
27114
27124
|
writeStartupInfo2(deps, { host, port: boundPort, projectDir, tokenPath: acquireResult.tokenPath });
|
|
27115
|
-
await new Promise((
|
|
27125
|
+
await new Promise((resolve16) => {
|
|
27116
27126
|
let shuttingDown = false;
|
|
27117
27127
|
const shutdown = async (sig) => {
|
|
27118
27128
|
if (shuttingDown) return;
|
|
@@ -27127,7 +27137,7 @@ This usually means no port is available (extremely rare). Retry or pick an expli
|
|
|
27127
27137
|
`);
|
|
27128
27138
|
});
|
|
27129
27139
|
await release2(projectDir, finalized.generation);
|
|
27130
|
-
|
|
27140
|
+
resolve16();
|
|
27131
27141
|
};
|
|
27132
27142
|
process.on("SIGINT", shutdown);
|
|
27133
27143
|
process.on("SIGTERM", shutdown);
|
|
@@ -27465,8 +27475,8 @@ async function serveMcpStdio(deps) {
|
|
|
27465
27475
|
log(
|
|
27466
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]" : ""}.`
|
|
27467
27477
|
);
|
|
27468
|
-
await new Promise((
|
|
27469
|
-
const stop = () =>
|
|
27478
|
+
await new Promise((resolve16) => {
|
|
27479
|
+
const stop = () => resolve16();
|
|
27470
27480
|
process.once("SIGINT", stop);
|
|
27471
27481
|
process.once("SIGTERM", stop);
|
|
27472
27482
|
});
|
|
@@ -29966,6 +29976,10 @@ function resolveBundledPromptsDir() {
|
|
|
29966
29976
|
return void 0;
|
|
29967
29977
|
}
|
|
29968
29978
|
}
|
|
29979
|
+
function isHomeDirectory(cwd, userHome) {
|
|
29980
|
+
if (!cwd || !userHome) return false;
|
|
29981
|
+
return path25.resolve(cwd) === path25.resolve(userHome);
|
|
29982
|
+
}
|
|
29969
29983
|
function shouldPrintYoloNotice(lastChoices, yoloPinned, yolo) {
|
|
29970
29984
|
return !lastChoices && yoloPinned === void 0 && yolo;
|
|
29971
29985
|
}
|
|
@@ -30093,6 +30107,17 @@ async function boot(argv) {
|
|
|
30093
30107
|
await reader.close();
|
|
30094
30108
|
return code;
|
|
30095
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
|
+
}
|
|
30096
30121
|
if (!flags["no-models-refresh"]) {
|
|
30097
30122
|
try {
|
|
30098
30123
|
await modelsRegistry.refresh();
|
|
@@ -30361,7 +30386,7 @@ async function checkGitInCwd(opts) {
|
|
|
30361
30386
|
if (answer === "y" || answer === "yes") {
|
|
30362
30387
|
try {
|
|
30363
30388
|
const { spawn: spawn17 } = await import("node:child_process");
|
|
30364
|
-
await new Promise((
|
|
30389
|
+
await new Promise((resolve16, reject) => {
|
|
30365
30390
|
const child = spawn17("git", ["init"], {
|
|
30366
30391
|
cwd,
|
|
30367
30392
|
signal: AbortSignal.timeout(1e4),
|
|
@@ -30370,7 +30395,7 @@ async function checkGitInCwd(opts) {
|
|
|
30370
30395
|
child.on("error", reject);
|
|
30371
30396
|
child.on(
|
|
30372
30397
|
"close",
|
|
30373
|
-
(code) => code === 0 ?
|
|
30398
|
+
(code) => code === 0 ? resolve16() : reject(new Error(`git init failed with ${code}`))
|
|
30374
30399
|
);
|
|
30375
30400
|
});
|
|
30376
30401
|
renderer.write(` ${color36.green("\u2713")} Git repository initialized
|
|
@@ -30453,7 +30478,7 @@ async function launchDesktop(args) {
|
|
|
30453
30478
|
);
|
|
30454
30479
|
return 1;
|
|
30455
30480
|
}
|
|
30456
|
-
return await new Promise((
|
|
30481
|
+
return await new Promise((resolve16) => {
|
|
30457
30482
|
const child = spawn6(process.execPath, [launcherPath, ...args], {
|
|
30458
30483
|
stdio: "inherit",
|
|
30459
30484
|
env: process.env,
|
|
@@ -30462,11 +30487,11 @@ async function launchDesktop(args) {
|
|
|
30462
30487
|
child.once("error", (err) => {
|
|
30463
30488
|
process.stderr.write(`${color37.red("\u2717 Failed to start WrongStack Desktop:")} ${err.message}
|
|
30464
30489
|
`);
|
|
30465
|
-
|
|
30490
|
+
resolve16(1);
|
|
30466
30491
|
});
|
|
30467
30492
|
child.once("exit", (code, signal) => {
|
|
30468
|
-
if (typeof code === "number")
|
|
30469
|
-
else
|
|
30493
|
+
if (typeof code === "number") resolve16(code);
|
|
30494
|
+
else resolve16(signal ? 1 : 0);
|
|
30470
30495
|
});
|
|
30471
30496
|
});
|
|
30472
30497
|
}
|
|
@@ -30500,17 +30525,17 @@ async function isHqAlreadyRunning(dataDir) {
|
|
|
30500
30525
|
}
|
|
30501
30526
|
}
|
|
30502
30527
|
async function isPortInUse(host, port) {
|
|
30503
|
-
return new Promise((
|
|
30528
|
+
return new Promise((resolve16) => {
|
|
30504
30529
|
const server = net.createServer();
|
|
30505
30530
|
server.once("error", (err) => {
|
|
30506
30531
|
if (err.code === "EADDRINUSE") {
|
|
30507
|
-
|
|
30532
|
+
resolve16(true);
|
|
30508
30533
|
} else {
|
|
30509
|
-
|
|
30534
|
+
resolve16(false);
|
|
30510
30535
|
}
|
|
30511
30536
|
});
|
|
30512
30537
|
server.once("listening", () => {
|
|
30513
|
-
server.close(() =>
|
|
30538
|
+
server.close(() => resolve16(false));
|
|
30514
30539
|
});
|
|
30515
30540
|
server.listen(port, host);
|
|
30516
30541
|
});
|
|
@@ -30648,7 +30673,7 @@ ${color38.green("Cloudflare Quick Tunnel ready:")} ${browserUrl}
|
|
|
30648
30673
|
} catch {
|
|
30649
30674
|
}
|
|
30650
30675
|
}
|
|
30651
|
-
await new Promise((
|
|
30676
|
+
await new Promise((resolve16) => {
|
|
30652
30677
|
const shutdown = async () => {
|
|
30653
30678
|
const results = await Promise.allSettled([
|
|
30654
30679
|
...tunnel ? [tunnel.close()] : [],
|
|
@@ -30667,7 +30692,7 @@ ${color38.green("Cloudflare Quick Tunnel ready:")} ${browserUrl}
|
|
|
30667
30692
|
})
|
|
30668
30693
|
);
|
|
30669
30694
|
}
|
|
30670
|
-
|
|
30695
|
+
resolve16();
|
|
30671
30696
|
};
|
|
30672
30697
|
process.on("SIGINT", shutdown);
|
|
30673
30698
|
process.on("SIGTERM", shutdown);
|
|
@@ -31099,8 +31124,6 @@ function wireContainer(deps) {
|
|
|
31099
31124
|
events,
|
|
31100
31125
|
permission: {
|
|
31101
31126
|
yolo: deps.config.yolo,
|
|
31102
|
-
yoloDestructive: deps.yoloDestructive,
|
|
31103
|
-
confirmDestructive: deps.confirmDestructive,
|
|
31104
31127
|
promptDelegate: makePromptDelegate(deps.reader)
|
|
31105
31128
|
},
|
|
31106
31129
|
compactor: {
|
|
@@ -31243,9 +31266,7 @@ async function initializeCli(argv) {
|
|
|
31243
31266
|
logger,
|
|
31244
31267
|
reader,
|
|
31245
31268
|
renderer,
|
|
31246
|
-
modelsRegistry
|
|
31247
|
-
yoloDestructive: ctx.flags["yolo-destructive"] === true || ctx.flags["force-all-yolo"] === true,
|
|
31248
|
-
confirmDestructive: false
|
|
31269
|
+
modelsRegistry
|
|
31249
31270
|
});
|
|
31250
31271
|
const replayFlag = ctx.flags["replay"];
|
|
31251
31272
|
const recordFlag = ctx.flags["record"];
|
|
@@ -31733,18 +31754,18 @@ async function runWebUIDispatch(ctx) {
|
|
|
31733
31754
|
applyLiveSettings?.({ yolo: enabled });
|
|
31734
31755
|
}
|
|
31735
31756
|
});
|
|
31736
|
-
const webuiExit = new Promise((
|
|
31757
|
+
const webuiExit = new Promise((resolve16) => {
|
|
31737
31758
|
webuiPromise.then(() => {
|
|
31738
31759
|
renderer.setSilent(false);
|
|
31739
31760
|
renderer.write("\n");
|
|
31740
31761
|
renderer.writeInfo(
|
|
31741
31762
|
color44.yellow(` Shutting down ${isSimpleUi ? "SimpleUI" : "WebUI"} server\u2026`)
|
|
31742
31763
|
);
|
|
31743
|
-
|
|
31764
|
+
resolve16(0);
|
|
31744
31765
|
}).catch((err) => {
|
|
31745
31766
|
renderer.setSilent(false);
|
|
31746
31767
|
console.debug(`[execution] webui error: ${err}`);
|
|
31747
|
-
|
|
31768
|
+
resolve16(1);
|
|
31748
31769
|
});
|
|
31749
31770
|
});
|
|
31750
31771
|
return webuiExit;
|
|
@@ -32722,8 +32743,6 @@ function createSettingsAdapter(ctx) {
|
|
|
32722
32743
|
delayMs: autonomy?.autoProceedDelayMs ?? 45e3,
|
|
32723
32744
|
titleAnimation: autonomy?.terminalTitleAnimation !== false,
|
|
32724
32745
|
yolo: cfg.yolo ?? (autonomy?.yolo ?? false),
|
|
32725
|
-
// Legacy boolean kept for readers that predate the enum (webui prefs).
|
|
32726
|
-
streamFleet: autonomy?.streamFleet !== false,
|
|
32727
32746
|
fleetChatVerbosity: resolveFleetChatVerbosity(cfg.autonomy),
|
|
32728
32747
|
chime: autonomy?.chime ?? false,
|
|
32729
32748
|
confirmExit: autonomy?.confirmExit !== false,
|
|
@@ -32771,7 +32790,7 @@ function createSettingsAdapter(ctx) {
|
|
|
32771
32790
|
}
|
|
32772
32791
|
async function saveSettings(s) {
|
|
32773
32792
|
try {
|
|
32774
|
-
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) {
|
|
32775
32794
|
const cfg = configStore.get();
|
|
32776
32795
|
const activeProfileName2 = cfg.activeProfile ?? "default";
|
|
32777
32796
|
const persistDeps = {
|
|
@@ -32804,10 +32823,6 @@ function createSettingsAdapter(ctx) {
|
|
|
32804
32823
|
if (s.yolo !== void 0) autonomy.yolo = s.yolo;
|
|
32805
32824
|
if (s.fleetChatVerbosity !== void 0) {
|
|
32806
32825
|
autonomy.fleetChatVerbosity = s.fleetChatVerbosity;
|
|
32807
|
-
autonomy.streamFleet = s.fleetChatVerbosity !== "off";
|
|
32808
|
-
} else if (s.streamFleet !== void 0) {
|
|
32809
|
-
autonomy.fleetChatVerbosity = s.streamFleet ? "full" : "off";
|
|
32810
|
-
autonomy.streamFleet = s.streamFleet;
|
|
32811
32826
|
}
|
|
32812
32827
|
if (s.chime !== void 0) autonomy.chime = s.chime;
|
|
32813
32828
|
if (s.confirmExit !== void 0) autonomy.confirmExit = s.confirmExit;
|
|
@@ -32982,9 +32997,6 @@ function createSettingsAdapter(ctx) {
|
|
|
32982
32997
|
}
|
|
32983
32998
|
if (s.fleetChatVerbosity !== void 0) {
|
|
32984
32999
|
if (fleetStreamController?.setMode) fleetStreamController.setMode(s.fleetChatVerbosity);
|
|
32985
|
-
else fleetStreamController?.setEnabled(s.fleetChatVerbosity !== "off");
|
|
32986
|
-
} else if (s.streamFleet !== void 0) {
|
|
32987
|
-
fleetStreamController?.setEnabled(s.streamFleet);
|
|
32988
33000
|
}
|
|
32989
33001
|
applyLiveSettings?.(s);
|
|
32990
33002
|
return null;
|
|
@@ -33597,7 +33609,7 @@ async function runRepl(opts) {
|
|
|
33597
33609
|
`[eternal] ${toErrorMessage21(err)}`
|
|
33598
33610
|
);
|
|
33599
33611
|
}
|
|
33600
|
-
await new Promise((
|
|
33612
|
+
await new Promise((resolve16) => setTimeout(resolve16, 250));
|
|
33601
33613
|
continue;
|
|
33602
33614
|
}
|
|
33603
33615
|
} else if (opts.getAutonomy?.() === "eternal-parallel") {
|
|
@@ -33673,7 +33685,7 @@ async function runRepl(opts) {
|
|
|
33673
33685
|
`[parallel] ${toErrorMessage21(err)}`
|
|
33674
33686
|
);
|
|
33675
33687
|
}
|
|
33676
|
-
await new Promise((
|
|
33688
|
+
await new Promise((resolve16) => setTimeout(resolve16, 250));
|
|
33677
33689
|
continue;
|
|
33678
33690
|
}
|
|
33679
33691
|
}
|
|
@@ -34319,12 +34331,12 @@ ${color51.cyan("\u23F3 Auto")} ${color51.dim("(Ctrl+C to cancel)")}
|
|
|
34319
34331
|
let interval;
|
|
34320
34332
|
let lastTickedSecond = sec + 1;
|
|
34321
34333
|
let onAbort;
|
|
34322
|
-
return new Promise((
|
|
34323
|
-
onAbort = () =>
|
|
34334
|
+
return new Promise((resolve16) => {
|
|
34335
|
+
onAbort = () => resolve16(false);
|
|
34324
34336
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
34325
34337
|
interval = setInterval(() => {
|
|
34326
34338
|
if (signal.aborted) {
|
|
34327
|
-
|
|
34339
|
+
resolve16(false);
|
|
34328
34340
|
return;
|
|
34329
34341
|
}
|
|
34330
34342
|
const elapsed = Date.now() - start;
|
|
@@ -34332,7 +34344,7 @@ ${color51.cyan("\u23F3 Auto")} ${color51.dim("(Ctrl+C to cancel)")}
|
|
|
34332
34344
|
if (remaining <= 0) {
|
|
34333
34345
|
opts.renderer.write(color51.dim(` \u21B3 ${truncated}
|
|
34334
34346
|
`));
|
|
34335
|
-
|
|
34347
|
+
resolve16(true);
|
|
34336
34348
|
return;
|
|
34337
34349
|
}
|
|
34338
34350
|
if (opts.onCountdownTick && remaining !== lastTickedSecond) {
|
|
@@ -34343,7 +34355,7 @@ ${color51.cyan("\u23F3 Auto")} ${color51.dim("(Ctrl+C to cancel)")}
|
|
|
34343
34355
|
opts.renderer.write(
|
|
34344
34356
|
color51.yellow(" \u21B3 Countdown cancelled \u2014 switching to manual mode\n")
|
|
34345
34357
|
);
|
|
34346
|
-
|
|
34358
|
+
resolve16(false);
|
|
34347
34359
|
return;
|
|
34348
34360
|
}
|
|
34349
34361
|
} catch {
|
|
@@ -36212,6 +36224,7 @@ init_helpers();
|
|
|
36212
36224
|
|
|
36213
36225
|
// src/slash-commands/acp.ts
|
|
36214
36226
|
import {
|
|
36227
|
+
defaultPermissionPolicy as defaultPermissionPolicy2,
|
|
36215
36228
|
EnsembleRegistry as EnsembleRegistry2,
|
|
36216
36229
|
probeAcpAgents as probeAcpAgents2,
|
|
36217
36230
|
renderAcpBenchText as renderAcpBenchText2,
|
|
@@ -36468,6 +36481,7 @@ ${summary}` };
|
|
|
36468
36481
|
task,
|
|
36469
36482
|
cwd: opts.cwd,
|
|
36470
36483
|
projectRoot: opts.projectRoot,
|
|
36484
|
+
permissionPolicy: defaultPermissionPolicy2,
|
|
36471
36485
|
onProgress: (event) => {
|
|
36472
36486
|
const line = formatProgress2(event);
|
|
36473
36487
|
if (line) opts.renderer.writeInfo(` ${line}
|
|
@@ -38674,7 +38688,7 @@ The following characters are not allowed: ; & | < > ^ $ , ( ) { } [ ] ! # % ' "
|
|
|
38674
38688
|
}
|
|
38675
38689
|
}
|
|
38676
38690
|
function runCommand(cmd, cwd, timeout) {
|
|
38677
|
-
return new Promise((
|
|
38691
|
+
return new Promise((resolve16) => {
|
|
38678
38692
|
validateCommand(cmd);
|
|
38679
38693
|
const opts = {
|
|
38680
38694
|
cwd,
|
|
@@ -38687,7 +38701,7 @@ function runCommand(cmd, cwd, timeout) {
|
|
|
38687
38701
|
shell: process.platform === "win32"
|
|
38688
38702
|
};
|
|
38689
38703
|
execFile(cmd, [], opts, (error, stdout, stderr) => {
|
|
38690
|
-
|
|
38704
|
+
resolve16({
|
|
38691
38705
|
stdout,
|
|
38692
38706
|
stderr,
|
|
38693
38707
|
exitCode: typeof error?.code === "number" ? error.code : 0,
|
|
@@ -41209,7 +41223,7 @@ import { assessCommitSafety } from "@wrongstack/core";
|
|
|
41209
41223
|
import { color as color69, toErrorMessage as toErrorMessage29 } from "@wrongstack/core";
|
|
41210
41224
|
async function runGit(args, cwd) {
|
|
41211
41225
|
try {
|
|
41212
|
-
return await new Promise((
|
|
41226
|
+
return await new Promise((resolve16, reject) => {
|
|
41213
41227
|
const child = spawn9("git", args, {
|
|
41214
41228
|
cwd,
|
|
41215
41229
|
stdio: ["ignore", "pipe", "pipe"],
|
|
@@ -41227,7 +41241,7 @@ async function runGit(args, cwd) {
|
|
|
41227
41241
|
child.on("error", (err) => {
|
|
41228
41242
|
reject(new Error(`Failed to run git: ${err.message}`));
|
|
41229
41243
|
});
|
|
41230
|
-
child.on("close", (code) =>
|
|
41244
|
+
child.on("close", (code) => resolve16({ stdout, stderr, code: code ?? 0 }));
|
|
41231
41245
|
});
|
|
41232
41246
|
} catch (err) {
|
|
41233
41247
|
throw new Error(toErrorMessage29(err));
|
|
@@ -48674,7 +48688,6 @@ function buildAgentsCommand(opts) {
|
|
|
48674
48688
|
},
|
|
48675
48689
|
(autonomy) => {
|
|
48676
48690
|
autonomy.fleetChatVerbosity = mode;
|
|
48677
|
-
autonomy.streamFleet = mode !== "off";
|
|
48678
48691
|
}
|
|
48679
48692
|
);
|
|
48680
48693
|
}
|
|
@@ -49514,7 +49527,7 @@ import { spawn as spawn12 } from "node:child_process";
|
|
|
49514
49527
|
import * as fsp6 from "node:fs/promises";
|
|
49515
49528
|
import * as path63 from "node:path";
|
|
49516
49529
|
async function runGit2(args, cwd) {
|
|
49517
|
-
return new Promise((
|
|
49530
|
+
return new Promise((resolve16) => {
|
|
49518
49531
|
const child = spawn12("git", args, {
|
|
49519
49532
|
cwd,
|
|
49520
49533
|
stdio: ["ignore", "pipe", "pipe"],
|
|
@@ -49525,8 +49538,8 @@ async function runGit2(args, cwd) {
|
|
|
49525
49538
|
child.stdout?.on("data", (d) => {
|
|
49526
49539
|
stdout += d;
|
|
49527
49540
|
});
|
|
49528
|
-
child.on("error", () =>
|
|
49529
|
-
child.on("close", (code) =>
|
|
49541
|
+
child.on("error", () => resolve16({ stdout, code: 1 }));
|
|
49542
|
+
child.on("close", (code) => resolve16({ stdout, code: code ?? 0 }));
|
|
49530
49543
|
});
|
|
49531
49544
|
}
|
|
49532
49545
|
async function getChangedFiles(cwd) {
|
|
@@ -49684,7 +49697,7 @@ function buildSecurityCommand(opts) {
|
|
|
49684
49697
|
};
|
|
49685
49698
|
}
|
|
49686
49699
|
function auditDepsCommand(opts, json) {
|
|
49687
|
-
return new Promise((
|
|
49700
|
+
return new Promise((resolve16) => {
|
|
49688
49701
|
const cwd = opts.cwd;
|
|
49689
49702
|
const child = spawn13("pnpm", ["audit", "--json"], {
|
|
49690
49703
|
cwd,
|
|
@@ -49701,7 +49714,7 @@ function auditDepsCommand(opts, json) {
|
|
|
49701
49714
|
stderr += c.toString("utf8");
|
|
49702
49715
|
});
|
|
49703
49716
|
child.on("error", (err) => {
|
|
49704
|
-
|
|
49717
|
+
resolve16(
|
|
49705
49718
|
securityResult(
|
|
49706
49719
|
color89.red(`/security audit-deps: failed to spawn pnpm: ${err.message}`),
|
|
49707
49720
|
{
|
|
@@ -49749,7 +49762,7 @@ function auditDepsCommand(opts, json) {
|
|
|
49749
49762
|
if (stderr.trim()) summary = color89.dim(stderr.trim().slice(0, 200));
|
|
49750
49763
|
}
|
|
49751
49764
|
const exit = code === 0 ? color89.green("clean") : color89.yellow(`exit ${code}`);
|
|
49752
|
-
|
|
49765
|
+
resolve16(
|
|
49753
49766
|
securityResult(
|
|
49754
49767
|
`${summary}
|
|
49755
49768
|
pnpm audit ${exit}`,
|
|
@@ -50585,7 +50598,6 @@ function buildSettingsCommand(opts) {
|
|
|
50585
50598
|
if (!mode) return { message: `${color90.amber("Usage:")} /settings stream-fleet off|full (on = full)` };
|
|
50586
50599
|
await persistAutonomySetting(persistDeps, (autonomy) => {
|
|
50587
50600
|
autonomy.fleetChatVerbosity = mode;
|
|
50588
|
-
autonomy.streamFleet = mode !== "off";
|
|
50589
50601
|
});
|
|
50590
50602
|
opts.fleetStreamController?.setMode(mode);
|
|
50591
50603
|
const desc = mode === "full" ? "every subagent tool call and message in chat" : "subagent chat lines hidden (F2/F3 stay live)";
|
|
@@ -54221,7 +54233,7 @@ function buildProviderForId(args, providerId) {
|
|
|
54221
54233
|
// src/fleet/host.ts
|
|
54222
54234
|
import { randomUUID as randomUUID11 } from "node:crypto";
|
|
54223
54235
|
import * as path68 from "node:path";
|
|
54224
|
-
import { ACP_AGENT_COMMANDS, findAgentDescriptor, makeACPSubagentRunner } from "@wrongstack/acp";
|
|
54236
|
+
import { ACP_AGENT_COMMANDS, defaultPermissionPolicy as defaultPermissionPolicy3, findAgentDescriptor, makeACPSubagentRunner } from "@wrongstack/acp";
|
|
54225
54237
|
import {
|
|
54226
54238
|
AdaptiveConcurrencyController,
|
|
54227
54239
|
Agent as Agent2,
|
|
@@ -55310,7 +55322,7 @@ ${audienceMemory.map((text) => `- ${text}`).join("\n")}`
|
|
|
55310
55322
|
const oldest = this.acpRunnerAccessOrder.shift();
|
|
55311
55323
|
if (oldest) this.acpRunnerCache.delete(oldest);
|
|
55312
55324
|
}
|
|
55313
|
-
const p = makeACPSubagentRunner(cmd);
|
|
55325
|
+
const p = makeACPSubagentRunner({ ...cmd, permissionPolicy: defaultPermissionPolicy3 });
|
|
55314
55326
|
this.acpRunnerCache.set(subagentId, p);
|
|
55315
55327
|
this.acpRunnerAccessOrder.push(subagentId);
|
|
55316
55328
|
return p;
|
|
@@ -56331,14 +56343,9 @@ async function setupCodebaseIndexing(deps) {
|
|
|
56331
56343
|
// src/wiring/controllers.ts
|
|
56332
56344
|
function createFleetStreamController(initialMode = "off") {
|
|
56333
56345
|
return {
|
|
56334
|
-
enabled: initialMode !== "off",
|
|
56335
56346
|
mode: initialMode,
|
|
56336
|
-
setEnabled(enabled) {
|
|
56337
|
-
this.setMode(enabled ? "full" : "off");
|
|
56338
|
-
},
|
|
56339
56347
|
setMode(mode) {
|
|
56340
56348
|
this.mode = mode;
|
|
56341
|
-
this.enabled = mode !== "off";
|
|
56342
56349
|
}
|
|
56343
56350
|
};
|
|
56344
56351
|
}
|
|
@@ -57766,12 +57773,12 @@ function createSddHandlers(deps) {
|
|
|
57766
57773
|
const sddApi = await import("@wrongstack/sdd");
|
|
57767
57774
|
let worktrees;
|
|
57768
57775
|
if (process.env["WRONGSTACK_SDD_WORKTREES"] !== "0") {
|
|
57769
|
-
const inGit = await new Promise((
|
|
57776
|
+
const inGit = await new Promise((resolve16) => {
|
|
57770
57777
|
let resolved = false;
|
|
57771
57778
|
const settle = (v) => {
|
|
57772
57779
|
if (resolved) return;
|
|
57773
57780
|
resolved = true;
|
|
57774
|
-
|
|
57781
|
+
resolve16(v);
|
|
57775
57782
|
};
|
|
57776
57783
|
try {
|
|
57777
57784
|
const child = spawn15("git", ["rev-parse", "--is-inside-work-tree"], {
|
|
@@ -58306,12 +58313,12 @@ async function main(argv) {
|
|
|
58306
58313
|
requestInput: async (prompt) => {
|
|
58307
58314
|
const { createInterface: createInterface2 } = await import("node:readline");
|
|
58308
58315
|
const rl = createInterface2({ input: process.stdin, output: process.stdout });
|
|
58309
|
-
return new Promise((
|
|
58316
|
+
return new Promise((resolve16) => {
|
|
58310
58317
|
rl.question(`
|
|
58311
58318
|
${prompt}
|
|
58312
58319
|
> `, (answer) => {
|
|
58313
58320
|
rl.close();
|
|
58314
|
-
|
|
58321
|
+
resolve16(answer);
|
|
58315
58322
|
});
|
|
58316
58323
|
});
|
|
58317
58324
|
}
|
|
@@ -58404,8 +58411,8 @@ ${prompt}
|
|
|
58404
58411
|
const projectName = path77.basename(projectRoot);
|
|
58405
58412
|
let gitBranch;
|
|
58406
58413
|
try {
|
|
58407
|
-
const {
|
|
58408
|
-
gitBranch =
|
|
58414
|
+
const { execFileSync: execFileSync2 } = await import("node:child_process");
|
|
58415
|
+
gitBranch = execFileSync2("git", ["rev-parse", "--abbrev-ref", "HEAD"], {
|
|
58409
58416
|
cwd: projectRoot,
|
|
58410
58417
|
timeout: 3e3,
|
|
58411
58418
|
stdio: ["ignore", "pipe", "ignore"],
|
|
@@ -59554,7 +59561,7 @@ Restart WrongStack to load or unload plugin code in this session.`;
|
|
|
59554
59561
|
onBeforeExit: async () => {
|
|
59555
59562
|
const cwd2 = projectRoot;
|
|
59556
59563
|
const statusResult = await new Promise(
|
|
59557
|
-
(
|
|
59564
|
+
(resolve16, reject) => {
|
|
59558
59565
|
const child = spawn16("git", ["status", "--porcelain"], {
|
|
59559
59566
|
cwd: cwd2,
|
|
59560
59567
|
stdio: ["ignore", "pipe", "pipe"],
|
|
@@ -59566,7 +59573,7 @@ Restart WrongStack to load or unload plugin code in this session.`;
|
|
|
59566
59573
|
stdout += d;
|
|
59567
59574
|
});
|
|
59568
59575
|
child.on("error", reject);
|
|
59569
|
-
child.on("close", (code) =>
|
|
59576
|
+
child.on("close", (code) => resolve16({ stdout, code: code ?? 0 }));
|
|
59570
59577
|
}
|
|
59571
59578
|
);
|
|
59572
59579
|
if (statusResult.stdout.trim().length > 0) {
|