@wrongstack/cli 1.0.26 → 1.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{acp-LI665LO2.js → acp-M4565YUW.js} +30 -17
- package/dist/boot/dispatch-singleshot.d.ts +8 -0
- package/dist/boot/dispatch-webui.d.ts +2 -0
- package/dist/boot/goal-tui-default.d.ts +10 -0
- package/dist/{chunk-OAVBM55Q.js → chunk-ENRYW73H.js} +525 -379
- package/dist/chunk-HDMFKTT3.js +157 -0
- package/dist/{chunk-WQV2NP57.js → chunk-HFZH2XJN.js} +2 -2
- package/dist/{chunk-BEHGRNOQ.js → chunk-N57IU5FG.js} +9 -9
- package/dist/{chunk-2EBVTYJR.js → chunk-NRXWOMK7.js} +17 -3
- package/dist/{chunk-5SEYGOCH.js → chunk-RDGGWMTI.js} +2 -2
- package/dist/{chunk-KJS5543T.js → chunk-RGFWGUAB.js} +26 -14
- package/dist/{chunk-S4FFHDJG.js → chunk-SDJCLEK6.js} +6 -2
- package/dist/{cli-context-UVGAN3NO.js → cli-context-C7RBSWHF.js} +33 -6
- package/dist/{cli-main-TN3KZ2P6.js → cli-main-TQTH73ZK.js} +304 -345
- package/dist/{execution-7QIP6GRY.js → execution-3STBD2U7.js} +87 -33
- package/dist/execution-chimera-review.d.ts +18 -1
- package/dist/{hq-GLZ7QESM.js → hq-44F4OQH2.js} +5 -4
- package/dist/hq-fleet-control.d.ts +36 -0
- package/dist/hq-live-status.d.ts +22 -0
- package/dist/hq-publisher.d.ts +18 -0
- package/dist/hq-server/routes/command-handlers.d.ts +12 -1
- package/dist/hq-server/routes/data-handlers.d.ts +1 -1
- package/dist/hq-server/socket-credentials.d.ts +63 -0
- package/dist/hq-server/upgrade-handler.d.ts +2 -0
- package/dist/hq-server/ws.d.ts +24 -0
- package/dist/{hq-server-YTKDVQPY.js → hq-server-UIB24LU6.js} +2 -2
- package/dist/{import-claude-code-32PCSIQI.js → import-claude-code-AYG24RG2.js} +36 -4
- package/dist/index.js +3 -3
- package/dist/live-settings-input.d.ts +1 -0
- package/dist/{mailbox-serve-NW5VZG7R.js → mailbox-serve-GNGXEQ2R.js} +2 -2
- package/dist/{modeldiag-36VODVIH.js → modeldiag-W7XAE625.js} +2 -2
- package/dist/{remote-O5WXHLWV.js → remote-GB5VXCCT.js} +38 -23
- package/dist/{sessions-config-SXTTLNXA.js → sessions-config-XHLXJ5C3.js} +75 -6
- package/dist/{short-circuit-flags-74Y5N6CF.js → short-circuit-flags-5TNTJPQR.js} +2 -2
- package/dist/slash-commands/theme.d.ts +15 -1
- package/dist/subcommands/handlers/import-claude-code.d.ts +10 -0
- package/dist/subcommands/handlers/sessions-fleet.d.ts +0 -12
- package/dist/{subcommands-Q6ORSB2E.js → subcommands-BHQYLDSD.js} +2 -2
- package/dist/{webui-server-YTHLRFD2.js → webui-server-GCXIO3JY.js} +37 -30
- package/dist/webui-server-options.d.ts +10 -0
- package/dist/wiring/command-host-state.d.ts +2 -0
- package/dist/wiring/hq-telemetry.d.ts +12 -0
- package/package.json +29 -28
- package/dist/chunk-OWNC7LMD.js +0 -78
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
|
|
2
|
+
// src/boot/execution-mode.ts
|
|
3
|
+
function resolveExecutionMode(positional, flags) {
|
|
4
|
+
const prompt = typeof flags["prompt"] === "string" ? flags["prompt"] : "";
|
|
5
|
+
if (positional.length > 0 || prompt.length > 0) return "single-shot";
|
|
6
|
+
if (flags.tui && flags["no-tui"] !== true && !flags.webui && !flags["webui-session-child"])
|
|
7
|
+
return "tui";
|
|
8
|
+
if (flags.webui || flags["webui-session-child"]) return "webui";
|
|
9
|
+
return "repl";
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// src/hq-fleet-control.ts
|
|
13
|
+
import {
|
|
14
|
+
areSubagentsAllowedForSession,
|
|
15
|
+
FLEET_ROSTER
|
|
16
|
+
} from "@wrongstack/core/coordination";
|
|
17
|
+
import { AgentError } from "@wrongstack/core/types";
|
|
18
|
+
async function killHqSessionFleet(director, sessionId, scope) {
|
|
19
|
+
if (!director) return 0;
|
|
20
|
+
const owned = sessionId ? director.subagentIdsForSession(sessionId) : [];
|
|
21
|
+
if (owned.length > 0 && sessionId) {
|
|
22
|
+
await director.terminateSession(sessionId);
|
|
23
|
+
return owned.length;
|
|
24
|
+
}
|
|
25
|
+
if (scope.multiConversation) return 0;
|
|
26
|
+
let killed = 0;
|
|
27
|
+
for (const subagent of director.status().subagents) {
|
|
28
|
+
if (subagent.status === "running" || subagent.status === "idle") {
|
|
29
|
+
try {
|
|
30
|
+
await director.remove(subagent.id);
|
|
31
|
+
killed++;
|
|
32
|
+
} catch {
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return killed;
|
|
37
|
+
}
|
|
38
|
+
async function terminateHqAgent(director, subagentId) {
|
|
39
|
+
if (!director) return false;
|
|
40
|
+
try {
|
|
41
|
+
await director.terminate(subagentId);
|
|
42
|
+
return true;
|
|
43
|
+
} catch {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
async function spawnHqAgent(director, sessionId, role, task, maxIterations) {
|
|
48
|
+
if (!director) {
|
|
49
|
+
throw new AgentError({
|
|
50
|
+
message: "Director is not available.",
|
|
51
|
+
code: "AGENT_RUN_FAILED",
|
|
52
|
+
context: { phase: "hq-spawn", role }
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
if (!areSubagentsAllowedForSession(sessionId)) {
|
|
56
|
+
throw new Error("Subagents are disabled for this session.");
|
|
57
|
+
}
|
|
58
|
+
const base = FLEET_ROSTER[role] ?? {
|
|
59
|
+
id: `manual-${Date.now()}`,
|
|
60
|
+
name: role,
|
|
61
|
+
maxIterations: maxIterations ?? 0,
|
|
62
|
+
maxToolCalls: 200
|
|
63
|
+
};
|
|
64
|
+
const overrides = maxIterations !== void 0 ? { maxIterations } : {};
|
|
65
|
+
const config = task !== void 0 ? { ...base, ...overrides, task } : { ...base, ...overrides };
|
|
66
|
+
return director.spawn({ ...config, originSessionId: sessionId });
|
|
67
|
+
}
|
|
68
|
+
function createHqFleetControl(getDirector, defaultSessionId, scope) {
|
|
69
|
+
return {
|
|
70
|
+
killFleet: (sessionId) => killHqSessionFleet(getDirector(), sessionId ?? defaultSessionId(), scope),
|
|
71
|
+
terminateAgent: (subagentId) => terminateHqAgent(getDirector(), subagentId),
|
|
72
|
+
spawnAgent: (role, task, maxIterations, sessionId) => spawnHqAgent(getDirector(), sessionId ?? defaultSessionId(), role, task, maxIterations)
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// src/services/suggestion-store.ts
|
|
77
|
+
var sharedSuggestions = [];
|
|
78
|
+
var sharedAutoSuggestions = [];
|
|
79
|
+
function setSuggestions(suggestions) {
|
|
80
|
+
sharedSuggestions = suggestions;
|
|
81
|
+
}
|
|
82
|
+
function setAutoSuggestions(suggestions) {
|
|
83
|
+
sharedAutoSuggestions = suggestions;
|
|
84
|
+
}
|
|
85
|
+
function getSuggestions() {
|
|
86
|
+
return sharedSuggestions;
|
|
87
|
+
}
|
|
88
|
+
function removeSuggestions(indices) {
|
|
89
|
+
if (indices.length === 0) return;
|
|
90
|
+
const set = new Set(indices);
|
|
91
|
+
sharedSuggestions = sharedSuggestions.filter((_, i) => !set.has(i));
|
|
92
|
+
sharedAutoSuggestions = [];
|
|
93
|
+
}
|
|
94
|
+
function clearSuggestions() {
|
|
95
|
+
sharedSuggestions = [];
|
|
96
|
+
sharedAutoSuggestions = [];
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// src/tui-thinking-word.ts
|
|
100
|
+
var DEFAULT_TUI_THINKING_WORD = "thinking";
|
|
101
|
+
var MAX_TUI_THINKING_WORD_LENGTH = 16;
|
|
102
|
+
function normalizeTuiThinkingWord(value) {
|
|
103
|
+
if (typeof value !== "string") return DEFAULT_TUI_THINKING_WORD;
|
|
104
|
+
const word = value.trim();
|
|
105
|
+
if (word.length === 0 || word.length > MAX_TUI_THINKING_WORD_LENGTH) {
|
|
106
|
+
return DEFAULT_TUI_THINKING_WORD;
|
|
107
|
+
}
|
|
108
|
+
if (!/^[\p{L}\p{N}_-]+$/u.test(word)) return DEFAULT_TUI_THINKING_WORD;
|
|
109
|
+
return word;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// src/services/run-git.ts
|
|
113
|
+
import { spawn } from "node:child_process";
|
|
114
|
+
import { toErrorMessage } from "@wrongstack/core/utils";
|
|
115
|
+
async function runGit(args, cwd) {
|
|
116
|
+
try {
|
|
117
|
+
return await new Promise((resolve, reject) => {
|
|
118
|
+
const child = spawn("git", args, {
|
|
119
|
+
cwd,
|
|
120
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
121
|
+
signal: AbortSignal.timeout(3e4),
|
|
122
|
+
windowsHide: true
|
|
123
|
+
});
|
|
124
|
+
let stdout = "";
|
|
125
|
+
let stderr = "";
|
|
126
|
+
child.stdout?.on("data", (d) => {
|
|
127
|
+
stdout += d;
|
|
128
|
+
});
|
|
129
|
+
child.stderr?.on("data", (d) => {
|
|
130
|
+
stderr += d;
|
|
131
|
+
});
|
|
132
|
+
child.on("error", (err) => {
|
|
133
|
+
reject(new Error(`Failed to run git: ${err.message}`));
|
|
134
|
+
});
|
|
135
|
+
child.on("close", (code) => resolve({ stdout, stderr, code: code ?? 1 }));
|
|
136
|
+
});
|
|
137
|
+
} catch (err) {
|
|
138
|
+
throw new Error(toErrorMessage(err));
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export {
|
|
143
|
+
resolveExecutionMode,
|
|
144
|
+
setSuggestions,
|
|
145
|
+
setAutoSuggestions,
|
|
146
|
+
getSuggestions,
|
|
147
|
+
removeSuggestions,
|
|
148
|
+
clearSuggestions,
|
|
149
|
+
killHqSessionFleet,
|
|
150
|
+
terminateHqAgent,
|
|
151
|
+
spawnHqAgent,
|
|
152
|
+
createHqFleetControl,
|
|
153
|
+
MAX_TUI_THINKING_WORD_LENGTH,
|
|
154
|
+
normalizeTuiThinkingWord,
|
|
155
|
+
runGit
|
|
156
|
+
};
|
|
157
|
+
//# sourceMappingURL=chunk-HDMFKTT3.js.map
|
|
@@ -22,7 +22,7 @@ async function handleHelpVersionShortCircuit(argv) {
|
|
|
22
22
|
}
|
|
23
23
|
if (earlyFlags["help"] === true) {
|
|
24
24
|
if (positional.length > 0) {
|
|
25
|
-
const { subcommandNames } = await import("./subcommands-
|
|
25
|
+
const { subcommandNames } = await import("./subcommands-BHQYLDSD.js");
|
|
26
26
|
if (subcommandNames.includes(positional[0])) {
|
|
27
27
|
const first = positional[0];
|
|
28
28
|
const deep = positional[1];
|
|
@@ -43,4 +43,4 @@ async function handleHelpVersionShortCircuit(argv) {
|
|
|
43
43
|
export {
|
|
44
44
|
handleHelpVersionShortCircuit
|
|
45
45
|
};
|
|
46
|
-
//# sourceMappingURL=chunk-
|
|
46
|
+
//# sourceMappingURL=chunk-HFZH2XJN.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
|
|
2
2
|
// src/subcommands/index.ts
|
|
3
3
|
var loaders = {
|
|
4
|
-
acp: async () => (await import("./acp-
|
|
4
|
+
acp: async () => (await import("./acp-M4565YUW.js")).acpCmd,
|
|
5
5
|
init: async () => (await import("./init-DRMMFG2G.js")).initCmd,
|
|
6
6
|
auth: async () => (await import("./auth-TE55JF4Z.js")).authCmd,
|
|
7
7
|
update: async () => (await import("./update-TDZX4IL2.js")).updateCmd,
|
|
8
|
-
remote: async () => (await import("./remote-
|
|
9
|
-
sessions: async () => (await import("./sessions-config-
|
|
10
|
-
config: async () => (await import("./sessions-config-
|
|
8
|
+
remote: async () => (await import("./remote-GB5VXCCT.js")).remoteCmd,
|
|
9
|
+
sessions: async () => (await import("./sessions-config-XHLXJ5C3.js")).sessionsCmd,
|
|
10
|
+
config: async () => (await import("./sessions-config-XHLXJ5C3.js")).configCmd,
|
|
11
11
|
"config-export": async () => (await import("./config-transfer-RUWLDCNK.js")).configExportCmd,
|
|
12
12
|
"config-import": async () => (await import("./config-transfer-RUWLDCNK.js")).configImportCmd,
|
|
13
13
|
rewind: async () => (await import("./rewind-JA3ZLCNM.js")).rewindCmd,
|
|
@@ -30,16 +30,16 @@ var loaders = {
|
|
|
30
30
|
version: async () => (await import("./version-help-XJJQ7YSH.js")).versionCmd,
|
|
31
31
|
help: async () => (await import("./version-help-XJJQ7YSH.js")).helpCmd,
|
|
32
32
|
projects: async () => (await import("./projects-T4CZCA25.js")).projectsCmd,
|
|
33
|
-
modeldiag: async () => (await import("./modeldiag-
|
|
33
|
+
modeldiag: async () => (await import("./modeldiag-W7XAE625.js")).modeldiagCmd,
|
|
34
34
|
quick: async () => (await import("./quick-CNB4Z3HS.js")).quickCmd,
|
|
35
35
|
bench: async () => (await import("./bench-GTLPM22B.js")).benchCmd,
|
|
36
36
|
chronicle: async () => (await import("./chronicle-UTFETHP6.js")).chronicleCmd,
|
|
37
|
-
hq: async () => (await import("./hq-
|
|
38
|
-
mailbox: async () => (await import("./mailbox-serve-
|
|
37
|
+
hq: async () => (await import("./hq-44F4OQH2.js")).hqCmd,
|
|
38
|
+
mailbox: async () => (await import("./mailbox-serve-GNGXEQ2R.js")).mailboxServeCmd,
|
|
39
39
|
permissions: async () => (await import("./permissions-PL27UHYD.js")).permissionsCmd,
|
|
40
40
|
project: async () => (await import("./project-AOQI5XTK.js")).projectCmd,
|
|
41
41
|
governance: async () => (await import("./governance-RYSHV675.js")).governanceCmd,
|
|
42
|
-
"import-claude-code": async () => (await import("./import-claude-code-
|
|
42
|
+
"import-claude-code": async () => (await import("./import-claude-code-AYG24RG2.js")).importClaudeCodeCmd
|
|
43
43
|
};
|
|
44
44
|
var subcommands = Object.fromEntries(
|
|
45
45
|
Object.entries(loaders).map(
|
|
@@ -55,4 +55,4 @@ export {
|
|
|
55
55
|
subcommands,
|
|
56
56
|
subcommandNames
|
|
57
57
|
};
|
|
58
|
-
//# sourceMappingURL=chunk-
|
|
58
|
+
//# sourceMappingURL=chunk-N57IU5FG.js.map
|
|
@@ -172,14 +172,28 @@ async function dispatch(controller, commandId, type, payload) {
|
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
174
|
if (target === "fleet") {
|
|
175
|
-
|
|
175
|
+
if (controller.killFleet === void 0) {
|
|
176
|
+
return {
|
|
177
|
+
commandId,
|
|
178
|
+
status: "rejected",
|
|
179
|
+
message: "this client does not manage a fleet"
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
const killed = await controller.killFleet(sessionId);
|
|
176
183
|
return {
|
|
177
184
|
commandId,
|
|
178
185
|
status: "completed",
|
|
179
186
|
message: `fleet stopped (${killed} agents)`
|
|
180
187
|
};
|
|
181
188
|
}
|
|
182
|
-
|
|
189
|
+
if (controller.terminateAgent === void 0) {
|
|
190
|
+
return {
|
|
191
|
+
commandId,
|
|
192
|
+
status: "rejected",
|
|
193
|
+
message: "this client does not manage subagents"
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
const terminated = await controller.terminateAgent(target, sessionId);
|
|
183
197
|
return {
|
|
184
198
|
commandId,
|
|
185
199
|
status: terminated ? "completed" : "rejected",
|
|
@@ -320,4 +334,4 @@ export {
|
|
|
320
334
|
createProjectKanbanAssignHandler,
|
|
321
335
|
createHqCommandDispatcher
|
|
322
336
|
};
|
|
323
|
-
//# sourceMappingURL=chunk-
|
|
337
|
+
//# sourceMappingURL=chunk-NRXWOMK7.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveProviderCfgWithProxy
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SDJCLEK6.js";
|
|
4
4
|
import {
|
|
5
5
|
fallbackCodexProviderModels,
|
|
6
6
|
filterCurrentCodexModelIds,
|
|
@@ -336,4 +336,4 @@ export {
|
|
|
336
336
|
setupProvider,
|
|
337
337
|
createGracefulShutdown
|
|
338
338
|
};
|
|
339
|
-
//# sourceMappingURL=chunk-
|
|
339
|
+
//# sourceMappingURL=chunk-RDGGWMTI.js.map
|
|
@@ -445,18 +445,15 @@ function hqExplicitlyDisabled(options) {
|
|
|
445
445
|
return options.appConfig?.hq?.enabled === false;
|
|
446
446
|
}
|
|
447
447
|
function resolvedHqConnectionKey(options) {
|
|
448
|
-
|
|
449
|
-
if (options.config.enabled === false) return void 0;
|
|
450
|
-
return options.config.discover === true ? HQ_DISCOVERY_CONNECTION_KEY : `${options.config.url}
|
|
451
|
-
${options.config.token ?? ""}`;
|
|
452
|
-
}
|
|
453
|
-
const config = resolveHqConfig({ config: options.appConfig?.hq });
|
|
448
|
+
const config = options.config !== void 0 ? options.config.enabled === false ? void 0 : options.config : resolveHqConfig({ config: options.appConfig?.hq });
|
|
454
449
|
if (config === void 0) return void 0;
|
|
455
|
-
|
|
450
|
+
const endpoint = config.discover === true ? HQ_DISCOVERY_CONNECTION_KEY : `${config.url}
|
|
456
451
|
${config.token ?? ""}`;
|
|
452
|
+
return `${endpoint}
|
|
453
|
+
raw=${String(config.rawContent)}`;
|
|
457
454
|
}
|
|
458
455
|
function startCliHqConnection(options) {
|
|
459
|
-
const shouldOwnKanbanSync = options.onKanbanSnapshot === void 0;
|
|
456
|
+
const shouldOwnKanbanSync = options.ownKanbanSync !== false && options.onKanbanSnapshot === void 0;
|
|
460
457
|
let kanbanSync;
|
|
461
458
|
const publisherOptions = shouldOwnKanbanSync ? {
|
|
462
459
|
...options,
|
|
@@ -465,17 +462,32 @@ function startCliHqConnection(options) {
|
|
|
465
462
|
let publisher;
|
|
466
463
|
let publisherKey;
|
|
467
464
|
let timer;
|
|
465
|
+
const liveOptions = () => options.getAppConfig === void 0 ? publisherOptions : { ...publisherOptions, appConfig: options.getAppConfig() };
|
|
466
|
+
const retire = () => {
|
|
467
|
+
if (publisher === void 0) return;
|
|
468
|
+
kanbanSync?.stop();
|
|
469
|
+
kanbanSync = void 0;
|
|
470
|
+
publisher.close();
|
|
471
|
+
publisher = void 0;
|
|
472
|
+
publisherKey = void 0;
|
|
473
|
+
options.onDisconnect?.();
|
|
474
|
+
};
|
|
468
475
|
const tryConnect = () => {
|
|
469
|
-
const
|
|
470
|
-
|
|
476
|
+
const current = liveOptions();
|
|
477
|
+
const nextKey = resolvedHqConnectionKey(current);
|
|
478
|
+
if (nextKey === void 0) {
|
|
479
|
+
retire();
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
471
482
|
if (publisher !== void 0 && publisherKey === nextKey) {
|
|
472
|
-
if (nextKey
|
|
483
|
+
if (nextKey.startsWith(`${HQ_DISCOVERY_CONNECTION_KEY}
|
|
484
|
+
`)) publisher.refreshEndpoint();
|
|
473
485
|
return;
|
|
474
486
|
}
|
|
475
487
|
publisher?.close();
|
|
476
488
|
publisher = void 0;
|
|
477
489
|
publisherKey = void 0;
|
|
478
|
-
const next = createCliHqPublisher(
|
|
490
|
+
const next = createCliHqPublisher(current);
|
|
479
491
|
if (next === void 0) return;
|
|
480
492
|
publisher = next;
|
|
481
493
|
publisherKey = nextKey;
|
|
@@ -495,7 +507,7 @@ function startCliHqConnection(options) {
|
|
|
495
507
|
options.onConnect?.(next);
|
|
496
508
|
};
|
|
497
509
|
tryConnect();
|
|
498
|
-
if (!hqExplicitlyDisabled(options)) {
|
|
510
|
+
if (options.getAppConfig !== void 0 || !hqExplicitlyDisabled(options)) {
|
|
499
511
|
timer = setInterval(tryConnect, options.retryIntervalMs ?? 2500);
|
|
500
512
|
timer.unref?.();
|
|
501
513
|
}
|
|
@@ -518,4 +530,4 @@ function startCliHqConnection(options) {
|
|
|
518
530
|
export {
|
|
519
531
|
startCliHqConnection
|
|
520
532
|
};
|
|
521
|
-
//# sourceMappingURL=chunk-
|
|
533
|
+
//# sourceMappingURL=chunk-RGFWGUAB.js.map
|
|
@@ -12,8 +12,12 @@ function resolveRawProviderConnection(config, providerId) {
|
|
|
12
12
|
const savedCfg = config.providers?.[providerId];
|
|
13
13
|
const isAccountAlias = savedCfg?.type !== void 0 && savedCfg.type !== providerId;
|
|
14
14
|
const inheritsPrimary = !isAccountAlias && (config.provider === void 0 || config.provider === providerId);
|
|
15
|
+
const repointed = Array.isArray(savedCfg?.envVars) && savedCfg.envVars.length === 0;
|
|
15
16
|
return {
|
|
16
|
-
|
|
17
|
+
// A repointed entry (`envVars: []` sentinel) must not inherit the legacy
|
|
18
|
+
// top-level key: `leader_model_set` could otherwise make it primary and
|
|
19
|
+
// carry that key to the new base URL (WS-2026-09-26-01).
|
|
20
|
+
apiKey: savedCfg?.apiKey ?? (inheritsPrimary && !repointed ? config.apiKey : void 0),
|
|
17
21
|
baseUrl: savedCfg?.baseUrl ?? (inheritsPrimary ? config.baseUrl : void 0)
|
|
18
22
|
};
|
|
19
23
|
}
|
|
@@ -90,4 +94,4 @@ export {
|
|
|
90
94
|
resolveProviderCfgWithProxy,
|
|
91
95
|
buildProviderForId
|
|
92
96
|
};
|
|
93
|
-
//# sourceMappingURL=chunk-
|
|
97
|
+
//# sourceMappingURL=chunk-SDJCLEK6.js.map
|
|
@@ -27,17 +27,17 @@ import {
|
|
|
27
27
|
} from "./chunk-EWKESL4L.js";
|
|
28
28
|
import {
|
|
29
29
|
subcommands
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-N57IU5FG.js";
|
|
31
31
|
import {
|
|
32
32
|
renderDeepHelp,
|
|
33
33
|
renderFocusedHelp
|
|
34
34
|
} from "./chunk-EPR42SWM.js";
|
|
35
35
|
import {
|
|
36
36
|
handleHelpVersionShortCircuit
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-HFZH2XJN.js";
|
|
38
38
|
import {
|
|
39
39
|
DEFAULT_PORT
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-ENRYW73H.js";
|
|
41
41
|
import "./chunk-HXJYHAR4.js";
|
|
42
42
|
import {
|
|
43
43
|
resolveHqPasswordInput
|
|
@@ -928,7 +928,7 @@ async function isPortInUse(host, port) {
|
|
|
928
928
|
}
|
|
929
929
|
async function handleHqShortCircuit(flags) {
|
|
930
930
|
if (flags["hq"] !== true) return null;
|
|
931
|
-
const { startHqServer } = await import("./hq-server-
|
|
931
|
+
const { startHqServer } = await import("./hq-server-UIB24LU6.js");
|
|
932
932
|
const tunnelRequested = flags["tunnel"] === true;
|
|
933
933
|
const rawPublicUrl = typeof flags["hq-public-url"] === "string" ? flags["hq-public-url"] : process.env.WRONGSTACK_HQ_PUBLIC_URL;
|
|
934
934
|
let publicOrigin;
|
|
@@ -1474,6 +1474,14 @@ async function maybeRestoreDefaultProfileFromBackup(opts) {
|
|
|
1474
1474
|
}
|
|
1475
1475
|
}
|
|
1476
1476
|
|
|
1477
|
+
// src/boot/goal-tui-default.ts
|
|
1478
|
+
function applyGoalTuiDefault(flags, positional) {
|
|
1479
|
+
const prompt = flags["prompt"];
|
|
1480
|
+
if ((typeof flags["goal"] === "string" || typeof flags["ask"] === "string") && positional.length === 0 && !(typeof prompt === "string" && prompt.length > 0)) {
|
|
1481
|
+
flags["tui"] = true;
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1477
1485
|
// src/boot/system-prompt-menu.ts
|
|
1478
1486
|
import {
|
|
1479
1487
|
countSystemPromptTokens,
|
|
@@ -2218,8 +2226,25 @@ var ReadlineInputReader = class {
|
|
|
2218
2226
|
const eraseAll = () => {
|
|
2219
2227
|
for (let i = 0; i < buf.length; i++) eraseChar();
|
|
2220
2228
|
};
|
|
2229
|
+
let escState = 0;
|
|
2221
2230
|
const onData = (chunk) => {
|
|
2222
2231
|
for (const ch of chunk) {
|
|
2232
|
+
if (escState === 1) {
|
|
2233
|
+
escState = ch === "[" ? 2 : ch === "O" ? 3 : 0;
|
|
2234
|
+
continue;
|
|
2235
|
+
}
|
|
2236
|
+
if (escState === 2) {
|
|
2237
|
+
if (ch >= "@" && ch <= "~") escState = 0;
|
|
2238
|
+
continue;
|
|
2239
|
+
}
|
|
2240
|
+
if (escState === 3) {
|
|
2241
|
+
escState = 0;
|
|
2242
|
+
continue;
|
|
2243
|
+
}
|
|
2244
|
+
if (ch === "\x1B") {
|
|
2245
|
+
escState = 1;
|
|
2246
|
+
continue;
|
|
2247
|
+
}
|
|
2223
2248
|
if (ch === "\r" || ch === "\n") {
|
|
2224
2249
|
cleanup();
|
|
2225
2250
|
writeOut(` ${dim(`[${buf.length} chars]`)}
|
|
@@ -2256,6 +2281,7 @@ var ReadlineInputReader = class {
|
|
|
2256
2281
|
buf += ch;
|
|
2257
2282
|
writeOut("\u2022");
|
|
2258
2283
|
}
|
|
2284
|
+
if (escState === 1) escState = 0;
|
|
2259
2285
|
};
|
|
2260
2286
|
stdin.on("data", onData);
|
|
2261
2287
|
});
|
|
@@ -2771,7 +2797,7 @@ async function boot(argv) {
|
|
|
2771
2797
|
});
|
|
2772
2798
|
}
|
|
2773
2799
|
if (positional[0] === "remote" || typeof flags["remote"] === "string") {
|
|
2774
|
-
const { runRemoteCommand } = await import("./remote-
|
|
2800
|
+
const { runRemoteCommand } = await import("./remote-GB5VXCCT.js");
|
|
2775
2801
|
return runRemoteCommand(
|
|
2776
2802
|
positional[0] === "remote" ? positional.slice(1) : positional,
|
|
2777
2803
|
flags,
|
|
@@ -3234,6 +3260,7 @@ To start the app with no model connected, pass --provider ${SETUP_PROVIDER_ID} -
|
|
|
3234
3260
|
}
|
|
3235
3261
|
flags["autonomy"] = effectiveChoices.autonomy;
|
|
3236
3262
|
}
|
|
3263
|
+
applyGoalTuiDefault(flags, positional);
|
|
3237
3264
|
flags["director"] = true;
|
|
3238
3265
|
return {
|
|
3239
3266
|
config,
|
|
@@ -3415,4 +3442,4 @@ async function initializeCli(argv) {
|
|
|
3415
3442
|
export {
|
|
3416
3443
|
initializeCli
|
|
3417
3444
|
};
|
|
3418
|
-
//# sourceMappingURL=cli-context-
|
|
3445
|
+
//# sourceMappingURL=cli-context-C7RBSWHF.js.map
|