@wrongstack/cli 1.0.19 → 1.0.26
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 +44 -0
- package/dist/{acp-INCNOH42.js → acp-LI665LO2.js} +18 -7
- package/dist/arg-parser.d.ts +1 -0
- package/dist/ascii-mode-SG4PRNLP.js +7 -0
- package/dist/{auth-YXK3EDUL.js → auth-TE55JF4Z.js} +68 -22
- package/dist/auth-menu/direct.d.ts +1 -0
- package/dist/auth-menu/local.d.ts +2 -0
- package/dist/auth-menu/oauth-menu.d.ts +3 -1
- package/dist/auth-menu/panel-service.d.ts +20 -0
- package/dist/{bench-YBU6BVQP.js → bench-GTLPM22B.js} +2 -2
- package/dist/boot/append-system-prompt.d.ts +10 -0
- package/dist/boot/ascii-mode.d.ts +12 -0
- package/dist/boot/config-backup-recovery.d.ts +2 -1
- package/dist/boot/container-wiring.d.ts +4 -2
- package/dist/boot/dispatch-singleshot.d.ts +4 -1
- package/dist/boot/dispatch-webui.d.ts +11 -0
- package/dist/boot/mcp-config-flag.d.ts +22 -0
- package/dist/boot/piped-stdin.d.ts +40 -0
- package/dist/boot/restricted-mode.d.ts +15 -0
- package/dist/boot/safe-mode.d.ts +30 -0
- package/dist/boot/short-circuit-desktop.d.ts +1 -0
- package/dist/boot/single-shot-budget.d.ts +30 -0
- package/dist/boot/stream-json.d.ts +36 -0
- package/dist/boot/structured-output.d.ts +16 -0
- package/dist/boot/system-prompt-builder.d.ts +2 -0
- package/dist/boot/tool-restriction-flags.d.ts +36 -0
- package/dist/boot/tui-project-picker-callback.d.ts +1 -1
- package/dist/boot/tui-settings-adapter.d.ts +15 -2
- package/dist/boot/worktree-sessions.d.ts +21 -0
- package/dist/{boot-auto-thin-MANHOYHE.js → boot-auto-thin-6Q56FY3F.js} +3 -2
- package/dist/boot-provider-selection.d.ts +67 -0
- package/dist/boot.d.ts +1 -38
- package/dist/{chunk-JY52HWL6.js → chunk-2EBVTYJR.js} +2 -2
- package/dist/{chunk-RDHFXOJM.js → chunk-2ERX3RPN.js} +112 -65
- package/dist/chunk-4TVYGG6G.js +62 -0
- package/dist/chunk-5JYDKG5B.js +154 -0
- package/dist/{chunk-KEPABQYT.js → chunk-5SEYGOCH.js} +8 -82
- package/dist/{chunk-3VXYY5JC.js → chunk-5UZBUV2H.js} +3 -19
- package/dist/chunk-BBHWW6LR.js +549 -0
- package/dist/chunk-BEHGRNOQ.js +58 -0
- package/dist/chunk-CZTXF6HY.js +140 -0
- package/dist/{chunk-JX6KL7OF.js → chunk-EPR42SWM.js} +39 -8
- package/dist/chunk-F5DCFAKI.js +36 -0
- package/dist/chunk-HLSHFXTO.js +97 -0
- package/dist/{chunk-CJTBLTS4.js → chunk-KJS5543T.js} +4 -3
- package/dist/{chunk-DE7BZDNK.js → chunk-KOEO4CJG.js} +27 -4
- package/dist/{chunk-SIS37L3W.js → chunk-L2RVEQWO.js} +211 -193
- package/dist/chunk-LBPLTTZ6.js +105 -0
- package/dist/chunk-LDCGZJTC.js +46 -0
- package/dist/chunk-LKPEBZBE.js +143 -0
- package/dist/chunk-LUMETJFO.js +171 -0
- package/dist/{chunk-KK2LB3ZS.js → chunk-OAVBM55Q.js} +9 -5
- package/dist/chunk-PZQBGUVZ.js +18 -0
- package/dist/{chunk-C3Z4N6A6.js → chunk-Q4INH2DG.js} +51 -3
- package/dist/chunk-R4QGL6GB.js +10 -0
- package/dist/{chunk-YLQEGYV4.js → chunk-RZ4ZDRYA.js} +14 -4
- package/dist/chunk-S4FFHDJG.js +93 -0
- package/dist/chunk-SFBFYIOW.js +271 -0
- package/dist/{chunk-RMQNCHGO.js → chunk-TI7KLHYX.js} +136 -11
- package/dist/{chunk-2ENZU66X.js → chunk-WQV2NP57.js} +5 -5
- package/dist/{chunk-B4JLSXZB.js → chunk-WSTVGC2C.js} +73 -45
- package/dist/chunk-X756ZS72.js +329 -0
- package/dist/{chunk-XJ7K67PP.js → chunk-YHYINL47.js} +63 -24
- package/dist/{chunk-2VMJ3E5Z.js → chunk-YTEOAWOJ.js} +6 -2
- package/dist/{chunk-GPPRNAKW.js → chunk-ZMX5HRLI.js} +2 -2
- package/dist/{cli-context-33F74CSZ.js → cli-context-UVGAN3NO.js} +496 -384
- package/dist/cli-entry-point.d.ts +2 -0
- package/dist/{cli-main-FNGMKPBA.js → cli-main-TN3KZ2P6.js} +3561 -2724
- package/dist/cli-update-notice.d.ts +2 -1
- package/dist/config-doctor.d.ts +10 -2
- package/dist/{config-transfer-2YF3CRTN.js → config-transfer-RUWLDCNK.js} +34 -13
- package/dist/{diag-doctor-ANPRUYFM.js → diag-doctor-BIZAFIAT.js} +2 -2
- package/dist/execute-deps.d.ts +2 -1
- package/dist/{execution-A6WJLSOC.js → execution-7QIP6GRY.js} +2384 -2055
- package/dist/fleet/host-types.d.ts +3 -1
- package/dist/goal-commands.d.ts +47 -0
- package/dist/goal-host.d.ts +1 -14
- package/dist/{hq-XQWQTRDA.js → hq-GLZ7QESM.js} +277 -261
- package/dist/hq-command-controller.d.ts +1 -1
- package/dist/{hq-server-IIBZQZU4.js → hq-server-YTKDVQPY.js} +2 -2
- package/dist/{hq-service-L5INQFM4.js → hq-service-BMMJAHRT.js} +11 -4
- package/dist/import-claude-code-32PCSIQI.js +236 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +19 -10
- package/dist/kanban-supervisor-67ECABTD.js +7 -0
- package/dist/live-settings-input.d.ts +7 -0
- package/dist/{mailbox-serve-3GFOK2I7.js → mailbox-serve-NW5VZG7R.js} +3 -3
- package/dist/{mcp-DC5WSBOO.js → mcp-LBS45HWZ.js} +4 -4
- package/dist/modeldiag-36VODVIH.js +828 -0
- package/dist/{per-subcommand-help-DHTYU524.js → per-subcommand-help-QDAQASPZ.js} +3 -3
- package/dist/permission-prompt-mirror.d.ts +1 -1
- package/dist/permission-prompt.d.ts +16 -2
- package/dist/permission-rules-view.d.ts +18 -0
- package/dist/{permissions-CFDLXETM.js → permissions-PL27UHYD.js} +67 -45
- package/dist/plugin-config.d.ts +12 -0
- package/dist/plugin-management-types.d.ts +31 -0
- package/dist/plugin-management.d.ts +2 -30
- package/dist/plugin-package-install.d.ts +3 -0
- package/dist/{plugin-usage-M6KET4OZ.js → plugin-usage-CIGOOTX3.js} +6 -5
- package/dist/{plugins-WJLW6ULV.js → plugins-HQTXUD6A.js} +6 -3
- package/dist/preflight.d.ts +1 -1
- package/dist/{projects-LMNAGGEU.js → projects-T4CZCA25.js} +3 -6
- package/dist/provider-config-utils.d.ts +1 -6
- package/dist/provider-helpers.d.ts +7 -11
- package/dist/{providers-models-LFNZ5WI7.js → providers-models-5Z2PJTEW.js} +44 -34
- package/dist/release-asset-download.d.ts +13 -0
- package/dist/release-attestation.d.ts +28 -0
- package/dist/remote/remote-session.d.ts +64 -0
- package/dist/remote/remote-target.d.ts +69 -0
- package/dist/remote-O5WXHLWV.js +561 -0
- package/dist/{replay-Z3FTJEMM.js → replay-DEI566CW.js} +2 -2
- package/dist/services/commit-message.d.ts +2 -1
- package/dist/services/dispatch-classifier.d.ts +39 -5
- package/dist/session-move-P2EC2COA.js +44 -0
- package/dist/session-move.d.ts +20 -0
- package/dist/session-stats.d.ts +10 -0
- package/dist/{sessions-config-UL45XKX7.js → sessions-config-SXTTLNXA.js} +47 -9
- package/dist/settings-menu.d.ts +2 -0
- package/dist/short-circuit-flags-74Y5N6CF.js +10 -0
- package/dist/{simpleui-dist-CXSIDAXZ.js → simpleui-dist-7BQISSEP.js} +7 -3
- package/dist/skill-suggest-L2EVWB6R.js +290 -0
- package/dist/slash-commands/command-context.d.ts +15 -5
- package/dist/slash-commands/effort.d.ts +1 -1
- package/dist/slash-commands/fallback.d.ts +1 -1
- package/dist/slash-commands/gitid.d.ts +1 -1
- package/dist/slash-commands/goal-refiner.d.ts +4 -49
- package/dist/slash-commands/jev.d.ts +4 -0
- package/dist/slash-commands/mcp.d.ts +2 -1
- package/dist/slash-commands/openai-quota.d.ts +15 -0
- package/dist/slash-commands/permissions.d.ts +4 -0
- package/dist/slash-commands/sdd-task-mutations.d.ts +4 -0
- package/dist/slash-commands/settings-context-mutations.d.ts +5 -0
- package/dist/slash-commands/settings-keys.d.ts +2 -0
- package/dist/slash-commands/settings-limits-mutations.d.ts +12 -0
- package/dist/slash-commands/settings-reset.d.ts +6 -0
- package/dist/standalone-auto-update-TOTRGCSA.js +249 -0
- package/dist/standalone-auto-update.d.ts +65 -0
- package/dist/standalone-update-LZO3MNLH.js +24 -0
- package/dist/standalone-update.d.ts +55 -0
- package/dist/subcommands/handlers/hq-alerts.d.ts +3 -0
- package/dist/subcommands/handlers/hq-audit.d.ts +46 -0
- package/dist/subcommands/handlers/hq-data-dir.d.ts +13 -0
- package/dist/subcommands/handlers/import-claude-code.d.ts +42 -0
- package/dist/subcommands/handlers/permissions.d.ts +9 -3
- package/dist/subcommands/handlers/remote.d.ts +6 -0
- package/dist/subcommands/handlers/skill-suggest.d.ts +21 -0
- package/dist/subcommands/handlers/typesafe-brain-replay.d.ts +26 -0
- package/dist/subcommands/handlers/typesafe-judgment-check.d.ts +3 -0
- package/dist/subcommands/handlers/typesafe-topic-replay.d.ts +19 -0
- package/dist/subcommands/handlers/typesafe-triage-replay.d.ts +18 -0
- package/dist/subcommands/handlers/typesafe.d.ts +23 -0
- package/dist/subcommands/handlers/version-help.d.ts +5 -0
- package/dist/{subcommands-XSLXMIDP.js → subcommands-Q6ORSB2E.js} +2 -2
- package/dist/tui-resume-callback.d.ts +18 -0
- package/dist/typesafe-U7YB2RRV.js +316 -0
- package/dist/typesafe-brain-replay-C5276FVR.js +222 -0
- package/dist/typesafe-judgment-check-GGYYV5UF.js +29 -0
- package/dist/typesafe-topic-replay-ZILIU3WS.js +234 -0
- package/dist/typesafe-triage-replay-FGAW7QM7.js +215 -0
- package/dist/{update-5DPB4YD4.js → update-TDZX4IL2.js} +4 -3
- package/dist/{update-check-BS3DHTSI.js → update-check-J5ZVKS73.js} +3 -2
- package/dist/update-check.d.ts +1 -1
- package/dist/version-JB2UAV2A.js +11 -0
- package/dist/version-help-XJJQ7YSH.js +10 -0
- package/dist/version.d.ts +3 -2
- package/dist/webui-client-observability.d.ts +7 -0
- package/dist/webui-server/route-contexts.d.ts +1 -1
- package/dist/webui-server/session-start-payload.d.ts +5 -1
- package/dist/{webui-server-MRPGTTKL.js → webui-server-YTHLRFD2.js} +577 -370
- package/dist/webui-server-lifecycle.d.ts +57 -0
- package/dist/webui-server-options.d.ts +11 -0
- package/dist/webui-server.d.ts +1 -1
- package/dist/wiring/brain-and-orchestration.d.ts +3 -1
- package/dist/wiring/cli-prompt-and-tools-setup.d.ts +9 -0
- package/dist/wiring/cli-slash-commands-setup.d.ts +1 -0
- package/dist/wiring/domain-glossary.d.ts +5 -4
- package/dist/wiring/lifecycle-plugins.d.ts +4 -2
- package/dist/wiring/metrics.d.ts +9 -1
- package/dist/wiring/pipeline.d.ts +2 -7
- package/dist/wiring/plugins.d.ts +4 -1
- package/dist/wiring/provider-persisters.d.ts +24 -0
- package/dist/wiring/provider-runtime.d.ts +9 -1
- package/dist/wiring/provider-status.d.ts +1 -0
- package/dist/wiring/provider-utility-tools.d.ts +3 -1
- package/dist/wiring/runtime-dispatch-state.d.ts +3 -1
- package/package.json +28 -28
- package/dist/chunk-2CZEORLV.js +0 -54
- package/dist/chunk-672UXYL3.js +0 -65
- package/dist/chunk-6WRKAACA.js +0 -96
- package/dist/chunk-DR2OXU46.js +0 -174
- package/dist/chunk-JACOMTIH.js +0 -275
- package/dist/chunk-XJXDOF63.js +0 -28
- package/dist/modeldiag-CJSFHZ3J.js +0 -1356
- package/dist/short-circuit-flags-7GQIGMVD.js +0 -10
- package/dist/version-help-WXI42PZ3.js +0 -10
package/data/providers.json
CHANGED
|
@@ -26,6 +26,50 @@
|
|
|
26
26
|
"output": 128000
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
|
+
"gpt-6-sol": {
|
|
30
|
+
"id": "gpt-6-sol",
|
|
31
|
+
"name": "GPT-6 Sol",
|
|
32
|
+
"description": "Built to power complex coding and agentic workflows.",
|
|
33
|
+
"reasoning": true,
|
|
34
|
+
"reasoningConfig": {
|
|
35
|
+
"default": "enabled",
|
|
36
|
+
"disableSupported": false,
|
|
37
|
+
"effortSupported": true,
|
|
38
|
+
"effortLevels": ["low", "medium", "high", "xhigh", "max"],
|
|
39
|
+
"preserveThinking": "unsupported"
|
|
40
|
+
},
|
|
41
|
+
"tool_call": true,
|
|
42
|
+
"modalities": {
|
|
43
|
+
"input": ["text", "image"],
|
|
44
|
+
"output": ["text"]
|
|
45
|
+
},
|
|
46
|
+
"limit": {
|
|
47
|
+
"context": 872000,
|
|
48
|
+
"output": 128000
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"gpt-6-luna": {
|
|
52
|
+
"id": "gpt-6-luna",
|
|
53
|
+
"name": "GPT-6 Luna",
|
|
54
|
+
"description": "Most efficient model for focused, high-volume tasks.",
|
|
55
|
+
"reasoning": true,
|
|
56
|
+
"reasoningConfig": {
|
|
57
|
+
"default": "enabled",
|
|
58
|
+
"disableSupported": false,
|
|
59
|
+
"effortSupported": true,
|
|
60
|
+
"effortLevels": ["low", "medium", "high", "xhigh", "max"],
|
|
61
|
+
"preserveThinking": "unsupported"
|
|
62
|
+
},
|
|
63
|
+
"tool_call": true,
|
|
64
|
+
"modalities": {
|
|
65
|
+
"input": ["text", "image"],
|
|
66
|
+
"output": ["text"]
|
|
67
|
+
},
|
|
68
|
+
"limit": {
|
|
69
|
+
"context": 872000,
|
|
70
|
+
"output": 128000
|
|
71
|
+
}
|
|
72
|
+
},
|
|
29
73
|
"gpt-5.6-sol": {
|
|
30
74
|
"id": "gpt-5.6-sol",
|
|
31
75
|
"name": "GPT-5.6 Sol",
|
|
@@ -4,17 +4,18 @@ import {
|
|
|
4
4
|
loadCachedAcpRegistry,
|
|
5
5
|
refreshAcpRegistry,
|
|
6
6
|
setupProvider
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-5SEYGOCH.js";
|
|
8
8
|
import {
|
|
9
9
|
createHqCommandDispatcher
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-2EBVTYJR.js";
|
|
11
11
|
import {
|
|
12
12
|
startCliHqConnection
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-KJS5543T.js";
|
|
14
|
+
import "./chunk-S4FFHDJG.js";
|
|
15
|
+
import "./chunk-F5DCFAKI.js";
|
|
15
16
|
import "./chunk-SIGUWXAA.js";
|
|
17
|
+
import "./chunk-LUMETJFO.js";
|
|
16
18
|
import "./chunk-DAKVBMD4.js";
|
|
17
|
-
import "./chunk-DR2OXU46.js";
|
|
18
19
|
|
|
19
20
|
// src/subcommands/handlers/acp.ts
|
|
20
21
|
import { randomBytes } from "node:crypto";
|
|
@@ -589,6 +590,11 @@ async function loadLive(deps) {
|
|
|
589
590
|
}
|
|
590
591
|
var acpCmd = async (args, deps) => {
|
|
591
592
|
const sub = args[0];
|
|
593
|
+
const loginIndex = sub === "auth" ? 0 : (sub === "server" || sub === "serve") && args[1] === "auth" ? 1 : -1;
|
|
594
|
+
if (loginIndex >= 0) {
|
|
595
|
+
const { authCmd } = await import("./auth-TE55JF4Z.js");
|
|
596
|
+
return authCmd(args.slice(loginIndex + 1), deps);
|
|
597
|
+
}
|
|
592
598
|
if (!sub || sub === "server" || sub === "serve") {
|
|
593
599
|
return runACPServer(deps);
|
|
594
600
|
}
|
|
@@ -803,6 +809,12 @@ async function runACPServer(deps) {
|
|
|
803
809
|
return runACPWebSocketServer(deps, wsPort);
|
|
804
810
|
}
|
|
805
811
|
const echo = deps.flags?.echo === true || deps.flags?.echo === "true";
|
|
812
|
+
if (!echo && (!deps.config.provider || !deps.config.model)) {
|
|
813
|
+
deps.renderer.writeError(
|
|
814
|
+
"No model provider configured. Run `wstack auth` before starting ACP, or use `--echo` for a connectivity test.\n"
|
|
815
|
+
);
|
|
816
|
+
return 1;
|
|
817
|
+
}
|
|
806
818
|
let stdioHqTelemetry;
|
|
807
819
|
const server = new WrongStackACPServer(
|
|
808
820
|
echo ? {} : (() => {
|
|
@@ -813,7 +825,6 @@ async function runACPServer(deps) {
|
|
|
813
825
|
if (err instanceof AcpServerConfigError) {
|
|
814
826
|
deps.renderer.writeError(`${err.message}
|
|
815
827
|
`);
|
|
816
|
-
return {};
|
|
817
828
|
}
|
|
818
829
|
throw err;
|
|
819
830
|
}
|
|
@@ -1168,4 +1179,4 @@ ${renderAcpBenchText(result)}
|
|
|
1168
1179
|
export {
|
|
1169
1180
|
acpCmd
|
|
1170
1181
|
};
|
|
1171
|
-
//# sourceMappingURL=acp-
|
|
1182
|
+
//# sourceMappingURL=acp-LI665LO2.js.map
|
package/dist/arg-parser.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export interface ParsedArgs {
|
|
|
12
12
|
export declare function parseArgs(argv: string[]): ParsedArgs;
|
|
13
13
|
export interface AuthFlags {
|
|
14
14
|
positional: string[];
|
|
15
|
+
alias?: string | undefined;
|
|
15
16
|
label?: string | undefined;
|
|
16
17
|
family?: import('@wrongstack/core/types').WireFamily | undefined;
|
|
17
18
|
baseUrl?: string | undefined;
|
|
@@ -16,24 +16,13 @@ import {
|
|
|
16
16
|
runOAuthLoginKind,
|
|
17
17
|
runOAuthLoginMenu,
|
|
18
18
|
validateFamily
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-2ERX3RPN.js";
|
|
20
20
|
import {
|
|
21
21
|
renderAuthLocalHelpToString,
|
|
22
22
|
wantsLocalHelp
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import {
|
|
26
|
-
restoreFlags
|
|
27
|
-
} from "./chunk-CSAPOCBP.js";
|
|
28
|
-
import "./chunk-3VXYY5JC.js";
|
|
29
|
-
import {
|
|
30
|
-
activeProfileConfigPath
|
|
31
|
-
} from "./chunk-YMXXOOFN.js";
|
|
32
|
-
import {
|
|
33
|
-
parseAuthFlags
|
|
34
|
-
} from "./chunk-C3Z4N6A6.js";
|
|
23
|
+
} from "./chunk-YTEOAWOJ.js";
|
|
24
|
+
import "./chunk-5UZBUV2H.js";
|
|
35
25
|
import "./chunk-SIGUWXAA.js";
|
|
36
|
-
import "./chunk-DAKVBMD4.js";
|
|
37
26
|
import {
|
|
38
27
|
loadConfigProviders,
|
|
39
28
|
maskedKey,
|
|
@@ -41,10 +30,22 @@ import {
|
|
|
41
30
|
normalizeKeys,
|
|
42
31
|
nowIso,
|
|
43
32
|
writeKeysBack
|
|
44
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-LUMETJFO.js";
|
|
34
|
+
import "./chunk-DAKVBMD4.js";
|
|
35
|
+
import {
|
|
36
|
+
activeProfileConfigPath
|
|
37
|
+
} from "./chunk-YMXXOOFN.js";
|
|
38
|
+
import {
|
|
39
|
+
restoreFlags
|
|
40
|
+
} from "./chunk-CSAPOCBP.js";
|
|
41
|
+
import "./chunk-WSTVGC2C.js";
|
|
42
|
+
import {
|
|
43
|
+
parseAuthFlags
|
|
44
|
+
} from "./chunk-Q4INH2DG.js";
|
|
45
45
|
|
|
46
46
|
// src/subcommands/handlers/auth.ts
|
|
47
47
|
import { color as color5 } from "@wrongstack/core/utils";
|
|
48
|
+
import { authProfileAliasError as authProfileAliasError2 } from "@wrongstack/providers";
|
|
48
49
|
|
|
49
50
|
// src/auth-menu/anthropic-oauth.ts
|
|
50
51
|
import {
|
|
@@ -57,16 +58,31 @@ var REDIRECT_PATH = "/callback";
|
|
|
57
58
|
var REDIRECT_URI = `http://localhost:${REDIRECT_PORT}${REDIRECT_PATH}`;
|
|
58
59
|
|
|
59
60
|
// src/auth-menu/direct.ts
|
|
61
|
+
import { authProfileAliasError } from "@wrongstack/providers";
|
|
60
62
|
async function runAuthDirect(deps, opts) {
|
|
61
|
-
const
|
|
63
|
+
const sourceId = opts.providerId;
|
|
64
|
+
const providerId = opts.alias?.trim() || sourceId;
|
|
65
|
+
const aliasError = authProfileAliasError(
|
|
66
|
+
opts.alias !== void 0 ? opts.alias.trim() : providerId
|
|
67
|
+
);
|
|
68
|
+
if (aliasError) {
|
|
69
|
+
deps.renderer.writeError(aliasError);
|
|
70
|
+
return 1;
|
|
71
|
+
}
|
|
62
72
|
const providers = await loadProviders(deps);
|
|
63
73
|
const existing = providers[providerId];
|
|
74
|
+
if (opts.alias && existing) {
|
|
75
|
+
deps.renderer.writeError(
|
|
76
|
+
`Auth profile "${providerId}" already exists. Choose another alias or manage its keys explicitly.`
|
|
77
|
+
);
|
|
78
|
+
return 1;
|
|
79
|
+
}
|
|
64
80
|
if (!existing && !opts.family) {
|
|
65
81
|
let knownFamily;
|
|
66
82
|
let knownBase;
|
|
67
83
|
let knownEnv;
|
|
68
84
|
try {
|
|
69
|
-
const k = await deps.modelsRegistry.getProvider(
|
|
85
|
+
const k = await deps.modelsRegistry.getProvider(sourceId);
|
|
70
86
|
if (k) {
|
|
71
87
|
knownFamily = k.family;
|
|
72
88
|
knownBase = k.apiBase;
|
|
@@ -98,8 +114,12 @@ async function runAuthDirect(deps, opts) {
|
|
|
98
114
|
deps.profileConfigPath,
|
|
99
115
|
deps.vault,
|
|
100
116
|
(all) => {
|
|
101
|
-
|
|
102
|
-
|
|
117
|
+
if (opts.alias && all[providerId])
|
|
118
|
+
throw new Error(
|
|
119
|
+
`Auth profile "${providerId}" already exists. Choose another alias or manage its keys explicitly.`
|
|
120
|
+
);
|
|
121
|
+
const p = all[providerId] ?? { type: sourceId };
|
|
122
|
+
if (!p.type) p.type = sourceId;
|
|
103
123
|
if (!p.family && opts.family) p.family = opts.family;
|
|
104
124
|
if (!p.baseUrl && opts.baseUrl) p.baseUrl = opts.baseUrl;
|
|
105
125
|
if (!p.envVars && opts.envVars) p.envVars = opts.envVars;
|
|
@@ -388,6 +408,7 @@ ${color4.amber("?")} Pick: `)).trim().toLowerCase();
|
|
|
388
408
|
var authCmd = async (args, deps) => {
|
|
389
409
|
args = restoreFlags(args, deps, [
|
|
390
410
|
"label",
|
|
411
|
+
"alias",
|
|
391
412
|
"family",
|
|
392
413
|
"base-url",
|
|
393
414
|
"env",
|
|
@@ -413,6 +434,29 @@ var authCmd = async (args, deps) => {
|
|
|
413
434
|
vault: deps.vault,
|
|
414
435
|
profileConfigPath
|
|
415
436
|
};
|
|
437
|
+
if (flags.positional[0] !== "local" && (args.includes("--help") || args.includes("-h"))) {
|
|
438
|
+
deps.renderer.write(
|
|
439
|
+
[
|
|
440
|
+
"Usage: wstack auth",
|
|
441
|
+
" wstack auth <provider-type> --alias <account> Create a separately keyed auth profile",
|
|
442
|
+
" wstack auth login <strategy> --alias <account> Sign in to an auth profile",
|
|
443
|
+
" wstack auth <saved-alias> --label <key-label> Add a key inside an existing profile",
|
|
444
|
+
" wstack auth list | status <alias> | remove <alias>",
|
|
445
|
+
"",
|
|
446
|
+
"Fallback targets are <auth-profile-alias>/<model-id>; provider type chooses the transport.",
|
|
447
|
+
"Direct flags: --alias, --label, --family, --base-url, --env",
|
|
448
|
+
""
|
|
449
|
+
].join("\n")
|
|
450
|
+
);
|
|
451
|
+
return 0;
|
|
452
|
+
}
|
|
453
|
+
if (flags.alias !== void 0) {
|
|
454
|
+
const invalid = authProfileAliasError2(flags.alias.trim());
|
|
455
|
+
if (invalid) {
|
|
456
|
+
deps.renderer.writeError(invalid);
|
|
457
|
+
return 1;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
416
460
|
if (flags.positional.length === 0) {
|
|
417
461
|
return runTopMenu(menuDeps);
|
|
418
462
|
}
|
|
@@ -434,6 +478,7 @@ var authCmd = async (args, deps) => {
|
|
|
434
478
|
const modelIdx = args.indexOf("--model") >= 0 ? args.indexOf("--model") : args.indexOf("-m");
|
|
435
479
|
return runAuthLocal(menuDeps, {
|
|
436
480
|
name: flags.positional[1] ?? value("name"),
|
|
481
|
+
alias: flags.alias,
|
|
437
482
|
baseUrl: flags.baseUrl ?? value("base-url"),
|
|
438
483
|
label: flags.label,
|
|
439
484
|
skipKey: has("no-key", "skip-key"),
|
|
@@ -465,9 +510,9 @@ var authCmd = async (args, deps) => {
|
|
|
465
510
|
}
|
|
466
511
|
if (first === "login") {
|
|
467
512
|
const pid = (flags.positional[1] ?? "").toLowerCase();
|
|
468
|
-
if (!pid) return runOAuthLoginKind(menuDeps, "chatgpt");
|
|
513
|
+
if (!pid) return runOAuthLoginKind(menuDeps, "chatgpt", { providerId: flags.alias });
|
|
469
514
|
const kind = resolveOAuthKind(pid, { allowNumeric: false, deps: menuDeps });
|
|
470
|
-
if (kind) return runOAuthLoginKind(menuDeps, kind);
|
|
515
|
+
if (kind) return runOAuthLoginKind(menuDeps, kind, { providerId: flags.alias });
|
|
471
516
|
const available = providerAuthStrategiesFor(menuDeps);
|
|
472
517
|
deps.renderer.writeError(`Unknown OAuth login strategy "${pid}".`);
|
|
473
518
|
for (const strategy of available) {
|
|
@@ -482,6 +527,7 @@ var authCmd = async (args, deps) => {
|
|
|
482
527
|
}
|
|
483
528
|
return runAuthDirect(menuDeps, {
|
|
484
529
|
providerId: first,
|
|
530
|
+
alias: flags.alias,
|
|
485
531
|
label: flags.label,
|
|
486
532
|
family: flags.family,
|
|
487
533
|
baseUrl: flags.baseUrl,
|
|
@@ -625,4 +671,4 @@ async function runAuthRemove(deps, providerId) {
|
|
|
625
671
|
export {
|
|
626
672
|
authCmd
|
|
627
673
|
};
|
|
628
|
-
//# sourceMappingURL=auth-
|
|
674
|
+
//# sourceMappingURL=auth-TE55JF4Z.js.map
|
|
@@ -7,6 +7,7 @@ import type { AuthMenuDeps } from './types.js';
|
|
|
7
7
|
*/
|
|
8
8
|
export declare function runAuthDirect(deps: AuthMenuDeps, opts: {
|
|
9
9
|
providerId: string;
|
|
10
|
+
alias?: string | undefined;
|
|
10
11
|
label?: string | undefined;
|
|
11
12
|
family?: WireFamily | undefined;
|
|
12
13
|
baseUrl?: string | undefined;
|
|
@@ -34,6 +34,8 @@ import { suggestLabel } from './shared.js';
|
|
|
34
34
|
import type { AuthMenuDeps } from './types.js';
|
|
35
35
|
export { LOCAL_LLM_PRESETS, type ProbeOptions, type ProbeResult, probeLocalLlm };
|
|
36
36
|
export interface RunAuthLocalOptions {
|
|
37
|
+
/** Create a separately routed auth profile for this local provider preset. */
|
|
38
|
+
alias?: string | undefined;
|
|
37
39
|
/**
|
|
38
40
|
* Direct pick: skip the interactive menu and configure this preset.
|
|
39
41
|
* `wstack auth local --name ollama` maps to `{ name: 'ollama' }`.
|
|
@@ -17,7 +17,9 @@ export declare function runOAuthLoginChoice(deps: AuthMenuDeps, choice: string,
|
|
|
17
17
|
allowNumeric?: boolean;
|
|
18
18
|
}): Promise<boolean>;
|
|
19
19
|
/** Run the OAuth login flow for an already-resolved kind. */
|
|
20
|
-
export declare function runOAuthLoginKind(deps: AuthMenuDeps, kind: OAuthMenuKind
|
|
20
|
+
export declare function runOAuthLoginKind(deps: AuthMenuDeps, kind: OAuthMenuKind, opts?: {
|
|
21
|
+
providerId?: string | undefined;
|
|
22
|
+
}): Promise<number>;
|
|
21
23
|
/** Sub-menu: pick a subscription to sign in with (OAuth). */
|
|
22
24
|
export declare function runOAuthLoginMenu(deps: AuthMenuDeps): Promise<void>;
|
|
23
25
|
//# sourceMappingURL=oauth-menu.d.ts.map
|
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TUI auth-panel host — the structured, UI-agnostic surface behind the
|
|
3
|
+
* interactive `/auth` panel in the Ink TUI.
|
|
4
|
+
*
|
|
5
|
+
* Two kinds of operations:
|
|
6
|
+
*
|
|
7
|
+
* - **Direct mutations** (set active key, delete key, remove provider):
|
|
8
|
+
* plain async methods that mutate the config atomically and return an
|
|
9
|
+
* error string or `null`.
|
|
10
|
+
*
|
|
11
|
+
* - **Flows** (add key, add from catalog, add custom, add local, OAuth
|
|
12
|
+
* sign-in, field edits): the existing battle-tested readline flows from
|
|
13
|
+
* this package, driven through an {@link AuthFlowIo} bridge. The bridge
|
|
14
|
+
* adapts `renderer.write*` → panel log lines (ANSI-stripped) and
|
|
15
|
+
* `reader.readLine/readSecret` → the panel's modal prompt. A rejected
|
|
16
|
+
* prompt (TUI Esc) aborts the flow before anything is saved.
|
|
17
|
+
*
|
|
18
|
+
* Secrets never cross into the TUI: key values are masked here, and the
|
|
19
|
+
* modal prompt sends the plaintext only INTO the flow (never back out).
|
|
20
|
+
*/
|
|
1
21
|
import type { ModelsRegistry, SecretScrubber, SecretVault } from '@wrongstack/core/types';
|
|
2
22
|
import type { AuthPanelHost } from '@wrongstack/tui';
|
|
3
23
|
import type { AuthMenuDeps } from './types.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CLI_VERSION
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-F5DCFAKI.js";
|
|
4
4
|
|
|
5
5
|
// src/subcommands/handlers/bench.ts
|
|
6
6
|
import * as fs from "node:fs/promises";
|
|
@@ -414,4 +414,4 @@ async function benchList(_args, deps) {
|
|
|
414
414
|
export {
|
|
415
415
|
benchCmd
|
|
416
416
|
};
|
|
417
|
-
//# sourceMappingURL=bench-
|
|
417
|
+
//# sourceMappingURL=bench-GTLPM22B.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve `--append-system-prompt <text>` and `--append-system-prompt-file
|
|
3
|
+
* <path>` into the text appended to the host system prompt. Both may be given;
|
|
4
|
+
* the inline text comes first. Returns `undefined` when neither carries text.
|
|
5
|
+
*
|
|
6
|
+
* An unreadable file throws: silently dropping instructions the operator asked
|
|
7
|
+
* for would run the session under a prompt they did not intend.
|
|
8
|
+
*/
|
|
9
|
+
export declare function resolveAppendedSystemPrompt(flags: Readonly<Record<string, string | boolean>>, cwd: string): Promise<string | undefined>;
|
|
10
|
+
//# sourceMappingURL=append-system-prompt.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `--ascii` (or `WRONGSTACK_TUI_ICON_STYLE=ascii`): plain-ASCII output for
|
|
3
|
+
* terminals and fonts without box drawing, emoji or Nerd Font glyphs.
|
|
4
|
+
*
|
|
5
|
+
* The flag sets the env var so the lazily loaded TUI (its glyph set and Ink
|
|
6
|
+
* wrapper read it at module load) and child `wstack` processes see the same
|
|
7
|
+
* choice. stdout/stderr are wrapped so the plain REPL, one-shot output and
|
|
8
|
+
* anything the TUI did not route through its `Text` wrapper come out ASCII too.
|
|
9
|
+
* Runs before any surface is loaded.
|
|
10
|
+
*/
|
|
11
|
+
export declare function applyAsciiMode(flags: Record<string, unknown>, env?: NodeJS.ProcessEnv, streams?: readonly NodeJS.WriteStream[]): boolean;
|
|
12
|
+
//# sourceMappingURL=ascii-mode.d.ts.map
|
|
@@ -18,11 +18,12 @@ export declare function defaultProfileProvidersAreEmpty(profilePath: string): Pr
|
|
|
18
18
|
* providers. Profile config history uses names such as
|
|
19
19
|
* `profiles-default-config-2026-07-19T12-34-56-789.json`.
|
|
20
20
|
*/
|
|
21
|
-
export declare function findLatestProviderBackup(globalRoot: string): Promise<ProviderConfigBackup | undefined>;
|
|
21
|
+
export declare function findLatestProviderBackup(globalRoot: string, profileName?: string): Promise<ProviderConfigBackup | undefined>;
|
|
22
22
|
/** Prompt once during an ordinary interactive boot. Enter accepts recovery. */
|
|
23
23
|
export declare function maybeRestoreDefaultProfileFromBackup(opts: {
|
|
24
24
|
globalRoot: string;
|
|
25
25
|
profilePath: string;
|
|
26
|
+
profileName?: string | undefined;
|
|
26
27
|
renderer: TerminalRenderer;
|
|
27
28
|
reader: ReadlineInputReader;
|
|
28
29
|
}): Promise<boolean>;
|
|
@@ -3,16 +3,18 @@ import type { EventBus } from '@wrongstack/core/kernel';
|
|
|
3
3
|
import type { Config, Logger, ModelsRegistry, Renderer } from '@wrongstack/core/types';
|
|
4
4
|
import type { WstackPaths } from '@wrongstack/core/utils';
|
|
5
5
|
import { createDefaultContainer } from '@wrongstack/runtime';
|
|
6
|
-
import {
|
|
6
|
+
import { makeStdinPromptDelegate } from '../permission-prompt.js';
|
|
7
7
|
import { type ApprovalMirrorRef } from '../permission-prompt-mirror.js';
|
|
8
8
|
interface WireContainerDeps {
|
|
9
9
|
config: Config;
|
|
10
10
|
wpaths: WstackPaths;
|
|
11
11
|
cwd: string;
|
|
12
12
|
logger: Logger;
|
|
13
|
-
reader: Parameters<typeof
|
|
13
|
+
reader: Parameters<typeof makeStdinPromptDelegate>[0];
|
|
14
14
|
renderer: Renderer;
|
|
15
15
|
modelsRegistry: ModelsRegistry;
|
|
16
|
+
/** `--allowed-tools`, already validated at boot. */
|
|
17
|
+
launchAllowedTools?: readonly string[] | undefined;
|
|
16
18
|
}
|
|
17
19
|
/**
|
|
18
20
|
* Build the PathResolver, create the EventBus, call
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* closure mutation.
|
|
13
13
|
*/
|
|
14
14
|
import type { Agent } from '@wrongstack/core/agent';
|
|
15
|
+
import type { EventBus } from '@wrongstack/core/kernel';
|
|
15
16
|
import type { TokenCounter } from '@wrongstack/core/types';
|
|
16
17
|
import type { TerminalRenderer } from '../renderer.js';
|
|
17
18
|
interface SingleShotDispatchContext {
|
|
@@ -19,12 +20,14 @@ interface SingleShotDispatchContext {
|
|
|
19
20
|
agent: Agent;
|
|
20
21
|
/** Joined positional args forming the query string. */
|
|
21
22
|
query: string;
|
|
22
|
-
/** Parsed top-level CLI flags (e.g. `--output-json`). */
|
|
23
|
+
/** Parsed top-level CLI flags (e.g. `--output-json`, `--output-format`). */
|
|
23
24
|
flags: Record<string, string | boolean>;
|
|
24
25
|
/** Token counter for usage delta computation. */
|
|
25
26
|
tokenCounter: TokenCounter;
|
|
26
27
|
/** Terminal renderer for output. */
|
|
27
28
|
renderer: TerminalRenderer;
|
|
29
|
+
/** Host event bus; required for `--max-budget-usd` to see spend as it lands. */
|
|
30
|
+
events?: Pick<EventBus, 'on'> | undefined;
|
|
28
31
|
}
|
|
29
32
|
/**
|
|
30
33
|
* Run a single `agent.run()` turn and render the result.
|
|
@@ -88,6 +88,17 @@ export interface WebUIDispatchContext {
|
|
|
88
88
|
role?: string | undefined;
|
|
89
89
|
skills?: string[] | undefined;
|
|
90
90
|
tools?: string[] | undefined;
|
|
91
|
+
signal?: AbortSignal | undefined;
|
|
92
|
+
context?: {
|
|
93
|
+
sessionId?: string;
|
|
94
|
+
kanban?: {
|
|
95
|
+
boardId?: string;
|
|
96
|
+
taskId?: string;
|
|
97
|
+
projectRoot?: string;
|
|
98
|
+
leaseId?: string;
|
|
99
|
+
managementToken?: string;
|
|
100
|
+
};
|
|
101
|
+
} | undefined;
|
|
91
102
|
name?: string | undefined;
|
|
92
103
|
allowedCapabilities?: readonly string[] | undefined;
|
|
93
104
|
onDone?: ((result: {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { MCPServerConfig } from '@wrongstack/core/types';
|
|
2
|
+
export type LaunchMcpServers = Record<string, Partial<MCPServerConfig>>;
|
|
3
|
+
/**
|
|
4
|
+
* Normalize one server entry (Claude Code `type` or WrongStack `transport`
|
|
5
|
+
* form). Throws with the server name on anything unusable. The result carries
|
|
6
|
+
* no `enabled` decision — callers own that.
|
|
7
|
+
*/
|
|
8
|
+
export declare function normalizeMcpServerEntry(name: string, raw: unknown): Partial<MCPServerConfig>;
|
|
9
|
+
/** Parse a document already read from disk or given inline. */
|
|
10
|
+
export declare function parseLaunchMcpServers(text: string, source: string): LaunchMcpServers;
|
|
11
|
+
/**
|
|
12
|
+
* Resolve the flag: inline JSON when the value starts with `{`, otherwise a
|
|
13
|
+
* path relative to `cwd`. `undefined` when the flag is absent.
|
|
14
|
+
*/
|
|
15
|
+
export declare function resolveLaunchMcpServers(flags: Readonly<Record<string, string | boolean>>, cwd: string): Promise<LaunchMcpServers | undefined>;
|
|
16
|
+
/**
|
|
17
|
+
* The server set this process starts: config servers (unless strict) with the
|
|
18
|
+
* launch servers layered on top — a launch entry replaces a config entry of the
|
|
19
|
+
* same name rather than merging into it.
|
|
20
|
+
*/
|
|
21
|
+
export declare function effectiveMcpServers(configured: Readonly<Record<string, Partial<MCPServerConfig>>> | undefined, launch: LaunchMcpServers | undefined, strict: boolean): Record<string, Partial<MCPServerConfig>>;
|
|
22
|
+
//# sourceMappingURL=mcp-config-flag.d.ts.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Piped-stdin context for single-shot runs: `git diff | wstack "review this"`.
|
|
3
|
+
*
|
|
4
|
+
* The prompt still comes from argv; whatever was piped in is appended to it as
|
|
5
|
+
* context. Only single-shot mode reads it — the REPL and TUI own stdin.
|
|
6
|
+
*
|
|
7
|
+
* A parent process can hand us an open pipe it never writes to (a harness
|
|
8
|
+
* spawning `wstack` with default stdio), which would block forever waiting for
|
|
9
|
+
* EOF. So the read gives up if no first byte arrives within
|
|
10
|
+
* `firstByteTimeoutMs`; once data starts flowing it reads to EOF, capped at
|
|
11
|
+
* `maxBytes` so a runaway producer cannot blow the context window.
|
|
12
|
+
*/
|
|
13
|
+
import type { Readable } from 'node:stream';
|
|
14
|
+
/** `process.stdin` in production; any readable in tests. */
|
|
15
|
+
export type PipedStdinSource = Readable & {
|
|
16
|
+
readonly isTTY?: boolean | undefined;
|
|
17
|
+
unref?: (() => unknown) | undefined;
|
|
18
|
+
};
|
|
19
|
+
export interface PipedStdinResult {
|
|
20
|
+
/** Piped text, trimmed of trailing whitespace. Empty when nothing arrived. */
|
|
21
|
+
text: string;
|
|
22
|
+
/** True when the input exceeded `maxBytes` and was cut. */
|
|
23
|
+
truncated: boolean;
|
|
24
|
+
/** True when no first byte arrived in time and the read was abandoned. */
|
|
25
|
+
timedOut: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface ReadPipedStdinOptions {
|
|
28
|
+
firstByteTimeoutMs?: number | undefined;
|
|
29
|
+
maxBytes?: number | undefined;
|
|
30
|
+
}
|
|
31
|
+
export declare const PIPED_STDIN_FIRST_BYTE_TIMEOUT_MS = 3000;
|
|
32
|
+
export declare const PIPED_STDIN_MAX_BYTES: number;
|
|
33
|
+
/**
|
|
34
|
+
* Read piped stdin. Resolves `EMPTY` immediately for a TTY — an interactive
|
|
35
|
+
* terminal is never "piped input".
|
|
36
|
+
*/
|
|
37
|
+
export declare function readPipedStdin(source: PipedStdinSource, opts?: ReadPipedStdinOptions): Promise<PipedStdinResult>;
|
|
38
|
+
/** Join the argv prompt with piped context. The prompt stays first: it is the instruction. */
|
|
39
|
+
export declare function appendPipedStdin(query: string, piped: string): string;
|
|
40
|
+
//# sourceMappingURL=piped-stdin.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ToolRestriction } from './tool-restriction-flags.js';
|
|
2
|
+
export declare const RESTRICTED_ENV = "WRONGSTACK_RESTRICTED";
|
|
3
|
+
export declare const RESTRICTED_DENY_CAPABILITIES: readonly string[];
|
|
4
|
+
export declare function isRestrictedMode(flags: Readonly<Record<string, unknown>>): boolean;
|
|
5
|
+
/** Throws on a conflicting flag. Returns whether restricted mode is on. */
|
|
6
|
+
export declare function validateRestrictedMode(flags: Readonly<Record<string, unknown>>): boolean;
|
|
7
|
+
/** Fold `--restricted` into the launch tool restriction (if any). */
|
|
8
|
+
export declare function withRestrictedTools(restriction: ToolRestriction | undefined, restricted: boolean): ToolRestriction | undefined;
|
|
9
|
+
export declare const RESTRICTED_NOTICE = "Restricted mode: no shell, network, installs or MCP tools; files stay inside the project; YOLO is off.";
|
|
10
|
+
/**
|
|
11
|
+
* Validate, engage the process-wide locks, export the env switch and — once
|
|
12
|
+
* per process — tell the user. Throws on a conflicting flag.
|
|
13
|
+
*/
|
|
14
|
+
export declare function activateRestrictedMode(flags: Readonly<Record<string, unknown>>, write: (line: string) => void): boolean;
|
|
15
|
+
//# sourceMappingURL=restricted-mode.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `--safe-mode`: start with the user's and the project's customizations off,
|
|
3
|
+
* to tell a broken setup apart from a broken WrongStack.
|
|
4
|
+
*
|
|
5
|
+
* Off: third-party plugins, hooks (policy hooks stay, as with `--no-hooks` —
|
|
6
|
+
* they are enforcement, not customization), configured MCP servers, skills,
|
|
7
|
+
* and instruction override files (`instructions/` under the profile and the
|
|
8
|
+
* project). Unchanged: config itself, auth, model selection, permissions,
|
|
9
|
+
* built-in tools and built-in plugins. Servers named with `--mcp-config` still
|
|
10
|
+
* start: the flag is an explicit request for them.
|
|
11
|
+
*
|
|
12
|
+
* Every decision is read at its consumption point instead of being patched
|
|
13
|
+
* into config: a patched config can be saved back by any settings write, and
|
|
14
|
+
* one troubleshooting launch would then silently disable plugins for good.
|
|
15
|
+
*
|
|
16
|
+
* `WRONGSTACK_SAFE_MODE=1` is equivalent and is exported to child processes
|
|
17
|
+
* (WebUI session children, spawned tools) so they start the same way.
|
|
18
|
+
*/
|
|
19
|
+
export declare const SAFE_MODE_ENV = "WRONGSTACK_SAFE_MODE";
|
|
20
|
+
export declare function isSafeMode(flags: Readonly<Record<string, unknown>>): boolean;
|
|
21
|
+
/** Called once at boot: makes `--safe-mode` visible to child processes. */
|
|
22
|
+
export declare function propagateSafeMode(flags: Readonly<Record<string, unknown>>): boolean;
|
|
23
|
+
export declare const SAFE_MODE_NOTICE = "Safe mode: third-party plugins, hooks, configured MCP servers, skills and instruction overrides are off.";
|
|
24
|
+
/**
|
|
25
|
+
* Propagate and, once per process, tell the user. Without the guard a real
|
|
26
|
+
* `--safe-mode` launch printed the notice twice, which reads like a second
|
|
27
|
+
* mode switch.
|
|
28
|
+
*/
|
|
29
|
+
export declare function announceSafeMode(flags: Readonly<Record<string, unknown>>, write: (line: string) => void): boolean;
|
|
30
|
+
//# sourceMappingURL=safe-mode.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare function desktopExecutableCandidates(platform: string, home: string, env: NodeJS.ProcessEnv): string[];
|
|
1
2
|
export declare function stripDesktopLauncherArgs(argv: string[]): string[];
|
|
2
3
|
export declare function selectDesktopLauncherExecutable(execPath: string, runningUnderBun: boolean, nodeOverride?: string): string;
|
|
3
4
|
export declare function handleDesktopShortCircuit(flags: Record<string, string | boolean>, argv: string[]): Promise<number | null>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `--max-budget-usd` for single-shot runs.
|
|
3
|
+
*
|
|
4
|
+
* Spend is the leader's cost delta since the run started plus every subagent's
|
|
5
|
+
* cumulative cost. Subagents run on their own token counters, so the leader's
|
|
6
|
+
* counter alone would let a delegating run blow straight past the cap.
|
|
7
|
+
*
|
|
8
|
+
* The check fires after each accounted request; the request that crosses the
|
|
9
|
+
* line has already been paid for, so the cap bounds the overshoot to one
|
|
10
|
+
* request rather than preventing it.
|
|
11
|
+
*/
|
|
12
|
+
import type { EventBus } from '@wrongstack/core/kernel';
|
|
13
|
+
import type { TokenCounter } from '@wrongstack/core/types';
|
|
14
|
+
/** Parse the flag. `undefined` = not set; throws on a value that is set but unusable. */
|
|
15
|
+
export declare function parseMaxBudgetUsd(value: string | boolean | undefined): number | undefined;
|
|
16
|
+
export interface SingleShotBudget {
|
|
17
|
+
/** Spend so far, in USD. */
|
|
18
|
+
spent(): number;
|
|
19
|
+
/** True once the limit was crossed and `onExceeded` fired. */
|
|
20
|
+
readonly exceeded: boolean;
|
|
21
|
+
/** Detach the event listeners. */
|
|
22
|
+
dispose(): void;
|
|
23
|
+
}
|
|
24
|
+
export declare function watchSingleShotBudget(opts: {
|
|
25
|
+
limitUsd: number;
|
|
26
|
+
tokenCounter: Pick<TokenCounter, 'estimateCost'>;
|
|
27
|
+
events: Pick<EventBus, 'on'>;
|
|
28
|
+
onExceeded: () => void;
|
|
29
|
+
}): SingleShotBudget;
|
|
30
|
+
//# sourceMappingURL=single-shot-budget.d.ts.map
|