@wrongstack/cli 1.0.35 → 1.0.37
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-T77EAEDB.js → acp-HCGUTFNE.js} +11 -8
- package/dist/ascii-mode-B6PKLRHM.js +8 -0
- package/dist/{audit-KCBTHUQI.js → audit-NH7NUKBV.js} +3 -2
- package/dist/{auth-M6LXZTDA.js → auth-ANOVZVHE.js} +12 -11
- package/dist/auto-discover-providers-V75ICIBG.js +8 -0
- package/dist/{automation-MCDFCIMV.js → automation-O7ZRZSFS.js} +20 -4
- package/dist/{bench-MMZHFHDL.js → bench-NDYES33Y.js} +3 -2
- package/dist/boot/governance-evidence-candidate.d.ts +1 -1
- package/dist/boot/system-prompt-menu.d.ts +7 -0
- package/dist/boot/tui-settings-adapter.d.ts +0 -12
- package/dist/{boot-auto-thin-YMAZI3QL.js → boot-auto-thin-7D4OVEWA.js} +5 -4
- package/dist/boot-provider-selection.d.ts +9 -0
- package/dist/{chronicle-PBJS7BN6.js → chronicle-WBK3TJRB.js} +2 -1
- package/dist/{chunk-R4QGL6GB.js → chunk-2MV474XR.js} +1 -1
- package/dist/{chunk-AFOH6CHO.js → chunk-3EXRPTAU.js} +1 -1
- package/dist/{chunk-2EZ2DHOW.js → chunk-3R3OADC5.js} +2 -2
- package/dist/{chunk-RKU66D2O.js → chunk-57PSSEBR.js} +1 -1
- package/dist/{chunk-2CMMWRQH.js → chunk-5TRZZHMN.js} +2 -2
- package/dist/{chunk-RWNI5OWT.js → chunk-6KJU6POA.js} +6 -6
- package/dist/{chunk-AKESWZH5.js → chunk-6VPWQ4TG.js} +2 -2
- package/dist/{chunk-CJSHS2K7.js → chunk-75OLD563.js} +1 -1
- package/dist/{chunk-4UWCMBPG.js → chunk-76JE54WD.js} +7 -5
- package/dist/{chunk-7BNBD4PE.js → chunk-7IY2UTBE.js} +2 -2
- package/dist/{chunk-6Z6C6ZHH.js → chunk-AWRZWPJ3.js} +20 -26
- package/dist/{chunk-TXAFIERF.js → chunk-BAWRRA6O.js} +2 -2
- package/dist/{chunk-DAKVBMD4.js → chunk-BCKVNORU.js} +1 -1
- package/dist/{chunk-4BX2YDTQ.js → chunk-BIGSVBPI.js} +45 -4
- package/dist/{chunk-CZTXF6HY.js → chunk-BJ4LDJ4H.js} +1 -1
- package/dist/{chunk-KMU7GF7X.js → chunk-C2BBH4S4.js} +2 -2
- package/dist/chunk-C4654QI2.js +8 -0
- package/dist/{chunk-M4G5FO7F.js → chunk-C5JP6DJN.js} +1 -1
- package/dist/{chunk-LDV4ERNV.js → chunk-CIGEY7NU.js} +5 -5
- package/dist/{chunk-WTJDSTYD.js → chunk-CVVQ5NCN.js} +5 -5
- package/dist/{chunk-D3K4NYQL.js → chunk-DXHQFV5V.js} +1 -1
- package/dist/{chunk-SUDNPYWD.js → chunk-FM7DPSYA.js} +2 -2
- package/dist/{chunk-YL4KCHZG.js → chunk-FPUB5WWP.js} +1 -1
- package/dist/{chunk-P3Q3KMFH.js → chunk-FUJHWQV4.js} +1 -1
- package/dist/{chunk-ERX4BLKP.js → chunk-GFQH77OH.js} +1 -1
- package/dist/{chunk-DIOODAYM.js → chunk-H53EXXAU.js} +3 -3
- package/dist/{chunk-F5DCFAKI.js → chunk-HKMOIIPQ.js} +1 -1
- package/dist/{chunk-AUQDGU5D.js → chunk-HQBY6OFT.js} +1 -1
- package/dist/{chunk-6SIUTX75.js → chunk-IJLIAPCW.js} +1 -2
- package/dist/{chunk-QD544J2B.js → chunk-JTTV2EVA.js} +1 -1
- package/dist/{chunk-UKP7H2U4.js → chunk-KHFFJ2LC.js} +1 -1
- package/dist/{chunk-4TVYGG6G.js → chunk-MKM4X2AM.js} +1 -1
- package/dist/chunk-ML3US333.js +61 -0
- package/dist/{chunk-HLSHFXTO.js → chunk-NL2ABOAS.js} +2 -2
- package/dist/{chunk-Q7E3BPDU.js → chunk-OGVSKS4Q.js} +1 -1
- package/dist/chunk-OZCYZYN2.js +3708 -0
- package/dist/{chunk-EWKESL4L.js → chunk-P24ZPPYH.js} +1 -1
- package/dist/chunk-PY2LMG2V.js +1 -0
- package/dist/{chunk-CSAPOCBP.js → chunk-QC6CLAK7.js} +1 -1
- package/dist/{chunk-HXJYHAR4.js → chunk-QVITQ425.js} +1 -1
- package/dist/{chunk-GZSKLXYG.js → chunk-RAWHRRUJ.js} +10 -10
- package/dist/{chunk-PA4VBCXS.js → chunk-RBZVDWTL.js} +1 -1
- package/dist/{chunk-YMXXOOFN.js → chunk-SPSHEZ46.js} +1 -1
- package/dist/{chunk-TWSQTQKR.js → chunk-T4TGMTH2.js} +3 -3
- package/dist/{chunk-LKFKO4JW.js → chunk-TZPKOS5G.js} +3 -3
- package/dist/{chunk-X4LW5CZM.js → chunk-UBDLNC3N.js} +1 -1
- package/dist/{chunk-SDJCLEK6.js → chunk-UFRVTBV6.js} +1 -1
- package/dist/{chunk-VCYZ3WZV.js → chunk-UOQPDZ5H.js} +1 -1
- package/dist/{chunk-PZQBGUVZ.js → chunk-UVF3BGET.js} +1 -1
- package/dist/{chunk-HHRYIDOW.js → chunk-VAQXOZKP.js} +34 -7
- package/dist/{chunk-4XCBEUBX.js → chunk-VHC47E7U.js} +1 -1
- package/dist/{chunk-LKPEBZBE.js → chunk-VI2HE4A5.js} +1 -1
- package/dist/chunk-W23PY4IJ.js +44 -0
- package/dist/{chunk-AT2A7RJZ.js → chunk-WDXNBYGD.js} +1 -1
- package/dist/{chunk-NRXWOMK7.js → chunk-XT3NAHRX.js} +1 -1
- package/dist/{chunk-ZYACRPLN.js → chunk-ZCXZGYO5.js} +6 -3
- package/dist/{chunk-65VNCAF6.js → chunk-ZNNFEKDZ.js} +2 -2
- package/dist/{chunk-CDY4D5QK.js → chunk-ZTSTMFYW.js} +2 -2
- package/dist/{chunk-YTEOAWOJ.js → chunk-ZXX3MJRL.js} +1 -1
- package/dist/{cli-context-II57EHD2.js → cli-context-V6NKFU2X.js} +166 -100
- package/dist/{cli-main-YR2WJCPL.js → cli-main-LHQTVOYW.js} +963 -246
- package/dist/{config-transfer-VOIFY7U4.js → config-transfer-Y7XJMJRN.js} +8 -5
- package/dist/{diag-doctor-BIZAFIAT.js → diag-doctor-5SVYK2DR.js} +5 -4
- package/dist/execute-deps.d.ts +8 -0
- package/dist/{execution-IBAZ2EIU.js → execution-BAP566QC.js} +103 -33
- package/dist/{export-VVRIOWFV.js → export-W27PTU6Y.js} +3 -2
- package/dist/fleet/host-director-setup.d.ts +2 -0
- package/dist/fleet/host-skill-companion.d.ts +73 -0
- package/dist/fleet/host.d.ts +1 -0
- package/dist/fleet/skill-companion-policy.d.ts +33 -0
- package/dist/{governance-RYSHV675.js → governance-A32M4ILK.js} +2 -1
- package/dist/{hq-5OIEKB4V.js → hq-JD5AZVMG.js} +8 -7
- package/dist/hq-server/snapshot.d.ts +1 -1
- package/dist/hq-server/socket-credentials.d.ts +1 -1
- package/dist/hq-server/ws.d.ts +1 -1
- package/dist/{hq-server-DU3ZH3X7.js → hq-server-BI23EPM7.js} +7 -5
- package/dist/{hq-service-LYZV7EK7.js → hq-service-TQNPIRHL.js} +8 -7
- package/dist/hq-ttl-RKRF7AQX.js +8 -0
- package/dist/{hq-tunnel-NIJ5EP2Y.js → hq-tunnel-6VU4IWV4.js} +2 -1
- package/dist/{import-claude-code-AYG24RG2.js → import-claude-code-D4F6ZE7I.js} +6 -5
- package/dist/index.js +9 -8
- package/dist/{init-DRMMFG2G.js → init-5PLABNLR.js} +2 -1
- package/dist/ip-allowlist-YDOFO7XJ.js +10 -0
- package/dist/{kanban-run-mirror-22HQ5FNG.js → kanban-run-mirror-SZ3S3S3Z.js} +3 -2
- package/dist/kanban-supervisor-55XPUHAM.js +8 -0
- package/dist/live-settings-input.d.ts +8 -0
- package/dist/{mailbox-serve-S536N66F.js → mailbox-serve-MMQCHOHI.js} +5 -3
- package/dist/{mcp-LBS45HWZ.js → mcp-2XWBJEQN.js} +4 -3
- package/dist/{modeldiag-NEPTLFZW.js → modeldiag-ERXYJODJ.js} +8 -7
- package/dist/{per-subcommand-help-VKPV3OEY.js → per-subcommand-help-D6J4ZXW2.js} +4 -3
- package/dist/{permissions-PL27UHYD.js → permissions-6YJ64W65.js} +3 -2
- package/dist/plugin-config.d.ts +6 -0
- package/dist/{plugin-usage-3TZGROK7.js → plugin-usage-TYF5HY4K.js} +6 -5
- package/dist/{plugins-ITH4SLO6.js → plugins-XGAXDLPT.js} +6 -5
- package/dist/pre-launch/launch-prompts.d.ts +21 -2
- package/dist/pre-launch.d.ts +1 -1
- package/dist/{project-AOQI5XTK.js → project-V5KNTLV4.js} +2 -1
- package/dist/{project-manifest-FTFDCCTZ.js → project-manifest-HXCID644.js} +3 -2
- package/dist/{project-picker-NZYJKQQC.js → project-picker-FUSLXKSA.js} +4 -3
- package/dist/{projects-T4CZCA25.js → projects-FWRJHW3S.js} +2 -1
- package/dist/{providers-models-37DUV2GW.js → providers-models-CDI5GVBX.js} +7 -6
- package/dist/{proxy-wiring-K2DORFFL.js → proxy-wiring-FIW6HFJV.js} +4 -3
- package/dist/{quick-CNB4Z3HS.js → quick-NPC3N3ZX.js} +2 -1
- package/dist/{remote-C74BCNND.js → remote-AKKRJEHK.js} +5 -4
- package/dist/{replay-DEI566CW.js → replay-5FOPERB2.js} +2 -1
- package/dist/{replay-JJ2NOWD6.js → replay-URJFMQCU.js} +3 -2
- package/dist/{rewind-7AULJS7F.js → rewind-GAUXWSTU.js} +3 -2
- package/dist/{sage-FFKUOCQL.js → sage-6KKXK2ZS.js} +11 -6
- package/dist/{sage-sync-ZMTHB477.js → sage-sync-IN3WKEBN.js} +5 -3
- package/dist/{sandbox-TYGD6FI2.js → sandbox-EZQ76MNY.js} +2 -1
- package/dist/{sdd-runtime-PF72WHLO.js → sdd-runtime-6MFUXWJK.js} +4 -3
- package/dist/{session-move-P2EC2COA.js → session-move-F3N45UQQ.js} +2 -1
- package/dist/{sessions-config-VE26SB56.js → sessions-config-SJVQXCIE.js} +7 -6
- package/dist/{sessions-doctor-QUL37U32.js → sessions-doctor-DZQTDQRY.js} +2 -1
- package/dist/short-circuit-flags-647S5WBL.js +11 -0
- package/dist/{simpleui-dist-7BQISSEP.js → simpleui-dist-EE3TJRBG.js} +2 -1
- package/dist/{skill-suggest-THANK3LV.js → skill-suggest-LZV2TIPQ.js} +22 -6
- package/dist/slash-commands/browser.d.ts +3 -0
- package/dist/slash-commands/command-context.d.ts +3 -0
- package/dist/slash-commands/doctor.d.ts +0 -9
- package/dist/{standalone-auto-update-VQC4GYCM.js → standalone-auto-update-X5SK4M5B.js} +17 -5
- package/dist/{standalone-update-HZHDZZOR.js → standalone-update-6U4NP5MN.js} +4 -3
- package/dist/subcommands-EGZPBQOO.js +10 -0
- package/dist/{tools-skills-33AI6K6S.js → tools-skills-55QVTMSK.js} +2 -1
- package/dist/{typesafe-NHC322W5.js → typesafe-YBEADNAH.js} +8 -7
- package/dist/{typesafe-brain-replay-C5276FVR.js → typesafe-brain-replay-XBU5RZDY.js} +2 -1
- package/dist/{typesafe-judgment-check-GGYYV5UF.js → typesafe-judgment-check-XRLBF5JV.js} +2 -1
- package/dist/{typesafe-topic-replay-DB2AYL7V.js → typesafe-topic-replay-L6NKFYPM.js} +4 -3
- package/dist/{typesafe-triage-replay-27NDAZ3V.js → typesafe-triage-replay-IRV2HHLN.js} +3 -2
- package/dist/{update-6OEPAEUV.js → update-54W7GUS5.js} +6 -5
- package/dist/{update-check-VLVT4IV2.js → update-check-JBGP4ZFI.js} +4 -3
- package/dist/utils/win32-cmd.d.ts +1 -1
- package/dist/{version-JB2UAV2A.js → version-Q6KJ23GB.js} +3 -2
- package/dist/version-help-RBZC5GZZ.js +11 -0
- package/dist/webui-server/credential-watcher.d.ts +3 -1
- package/dist/webui-server/provider-config.d.ts +12 -5
- package/dist/{webui-server-6IC3SLZG.js → webui-server-HIUY3RHD.js} +59 -49
- package/dist/wiring/management-tools.d.ts +9 -1
- package/dist/wiring/slash-commands.d.ts +3 -0
- package/dist/{wrongtrace-gate-counters-7C2EAAZL.js → wrongtrace-gate-counters-K44XG3H3.js} +3 -2
- package/dist/{wrongtrace-telemetry-3ASFKOZO.js → wrongtrace-telemetry-YS6SUBXK.js} +3 -2
- package/dist/ws-runtime.d.ts +6 -0
- package/package.json +39 -39
- package/LICENSE +0 -21
- package/dist/ascii-mode-SG4PRNLP.js +0 -7
- package/dist/auto-discover-providers-JX346GOM.js +0 -7
- package/dist/chunk-BHXAKTBE.js +0 -10
- package/dist/chunk-LDXXMPMS.js +0 -61
- package/dist/chunk-TGSPCFBT.js +0 -1
- package/dist/hq-ttl-N4DAIAVX.js +0 -7
- package/dist/ip-allowlist-NHXO6AKJ.js +0 -9
- package/dist/kanban-supervisor-67ECABTD.js +0 -7
- package/dist/short-circuit-flags-EXJBJ5GT.js +0 -10
- package/dist/subcommands-DTKBXLPU.js +0 -9
- package/dist/version-help-JQGRPDJW.js +0 -10
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseOutputFormat,
|
|
3
3
|
resolveJsonSchemaFlag
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-VI2HE4A5.js";
|
|
5
5
|
import {
|
|
6
6
|
parseWebuiSessionChildOptions,
|
|
7
7
|
writeWebuiSessionChildError
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-FUJHWQV4.js";
|
|
9
9
|
import {
|
|
10
10
|
activateRestrictedMode,
|
|
11
11
|
announceSafeMode,
|
|
@@ -17,46 +17,46 @@ import {
|
|
|
17
17
|
renderDiff,
|
|
18
18
|
resolveLaunchAllowedTools,
|
|
19
19
|
resolveToolRestriction
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-5TRZZHMN.js";
|
|
21
21
|
import {
|
|
22
22
|
theme as theme2
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-JTTV2EVA.js";
|
|
24
24
|
import {
|
|
25
25
|
fmtTok,
|
|
26
26
|
patchConfig
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-P24ZPPYH.js";
|
|
28
28
|
import {
|
|
29
29
|
resolveLaunchMcpServers
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-NL2ABOAS.js";
|
|
31
31
|
import {
|
|
32
32
|
subcommands
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-ML3US333.js";
|
|
34
34
|
import {
|
|
35
35
|
renderDeepHelp,
|
|
36
36
|
renderFocusedHelp
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-3R3OADC5.js";
|
|
38
38
|
import {
|
|
39
39
|
handleHelpVersionShortCircuit
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-CIGEY7NU.js";
|
|
41
41
|
import {
|
|
42
42
|
DEFAULT_PORT
|
|
43
|
-
} from "./chunk-
|
|
44
|
-
import "./chunk-
|
|
43
|
+
} from "./chunk-AWRZWPJ3.js";
|
|
44
|
+
import "./chunk-QVITQ425.js";
|
|
45
45
|
import {
|
|
46
46
|
resolveHqPasswordInput
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-HQBY6OFT.js";
|
|
48
48
|
import {
|
|
49
49
|
normalizeHqPublicOrigin
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-3EXRPTAU.js";
|
|
51
51
|
import {
|
|
52
52
|
parseHqIpAllowlist
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-OGVSKS4Q.js";
|
|
54
54
|
import {
|
|
55
55
|
installProviderPersisters
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-T4TGMTH2.js";
|
|
57
57
|
import {
|
|
58
58
|
discoverAndMergeProviders
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-RBZVDWTL.js";
|
|
60
60
|
import {
|
|
61
61
|
addFromCatalog,
|
|
62
62
|
boxBottom,
|
|
@@ -69,40 +69,42 @@ import {
|
|
|
69
69
|
runPicker,
|
|
70
70
|
saveToGlobalConfig,
|
|
71
71
|
theme
|
|
72
|
-
} from "./chunk-
|
|
73
|
-
import "./chunk-
|
|
72
|
+
} from "./chunk-RAWHRRUJ.js";
|
|
73
|
+
import "./chunk-ZXX3MJRL.js";
|
|
74
74
|
import {
|
|
75
75
|
isKeylessLocalProvider,
|
|
76
76
|
visibleModelIds
|
|
77
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-57PSSEBR.js";
|
|
78
78
|
import {
|
|
79
79
|
resolveActiveApiKey
|
|
80
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-ZCXZGYO5.js";
|
|
81
81
|
import {
|
|
82
82
|
activeProfileConfigPath
|
|
83
|
-
} from "./chunk-
|
|
84
|
-
import "./chunk-
|
|
83
|
+
} from "./chunk-SPSHEZ46.js";
|
|
84
|
+
import "./chunk-BIGSVBPI.js";
|
|
85
|
+
import "./chunk-OZCYZYN2.js";
|
|
85
86
|
import {
|
|
86
87
|
runUpdateCommand
|
|
87
|
-
} from "./chunk-
|
|
88
|
-
import "./chunk-
|
|
89
|
-
import "./chunk-
|
|
88
|
+
} from "./chunk-6KJU6POA.js";
|
|
89
|
+
import "./chunk-C4654QI2.js";
|
|
90
|
+
import "./chunk-BCKVNORU.js";
|
|
90
91
|
import {
|
|
91
92
|
applyNodeEnvDefault,
|
|
92
93
|
applySessionShellDefault,
|
|
93
94
|
runPreflight
|
|
94
|
-
} from "./chunk-
|
|
95
|
+
} from "./chunk-CVVQ5NCN.js";
|
|
95
96
|
import {
|
|
96
97
|
parseArgs
|
|
97
|
-
} from "./chunk-
|
|
98
|
-
import "./chunk-
|
|
98
|
+
} from "./chunk-75OLD563.js";
|
|
99
|
+
import "./chunk-H53EXXAU.js";
|
|
99
100
|
import {
|
|
100
101
|
applyAsciiMode
|
|
101
|
-
} from "./chunk-
|
|
102
|
-
import "./chunk-
|
|
102
|
+
} from "./chunk-UVF3BGET.js";
|
|
103
|
+
import "./chunk-6VPWQ4TG.js";
|
|
103
104
|
import {
|
|
104
105
|
CLI_VERSION
|
|
105
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-HKMOIIPQ.js";
|
|
107
|
+
import "./chunk-W23PY4IJ.js";
|
|
106
108
|
|
|
107
109
|
// src/cli-context.ts
|
|
108
110
|
import { TOKENS as TOKENS3 } from "@wrongstack/core/kernel";
|
|
@@ -234,7 +236,7 @@ function wireContainer(deps) {
|
|
|
234
236
|
// src/boot/launch-menu.ts
|
|
235
237
|
import * as fs from "node:fs/promises";
|
|
236
238
|
import { HQ_CLI_DEFAULT_HOST } from "@wrongstack/core/hq";
|
|
237
|
-
import { atomicWrite, color, isStdinTTY, setRawMode } from "@wrongstack/core/utils";
|
|
239
|
+
import { atomicWrite, color, isStdinTTY, setRawMode, withFileLock } from "@wrongstack/core/utils";
|
|
238
240
|
|
|
239
241
|
// src/boot/launch-banner.ts
|
|
240
242
|
var STACK_ORANGE = { r: 253, g: 159, b: 2 };
|
|
@@ -750,29 +752,31 @@ function toPersistedMenuChoice(result) {
|
|
|
750
752
|
};
|
|
751
753
|
}
|
|
752
754
|
async function persistMenuChoice(globalConfigPath, choice) {
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
let existing = {};
|
|
760
|
-
try {
|
|
761
|
-
const raw = await fs.readFile(globalConfigPath, "utf8");
|
|
762
|
-
existing = JSON.parse(raw);
|
|
763
|
-
} catch (err) {
|
|
764
|
-
if (fileExists) {
|
|
765
|
-
throw new Error(
|
|
766
|
-
`Refusing to overwrite corrupt config at ${globalConfigPath} (${err.message}). Fix or move the file aside before retrying.`,
|
|
767
|
-
{ cause: err }
|
|
768
|
-
);
|
|
755
|
+
await withFileLock(globalConfigPath, async () => {
|
|
756
|
+
let fileExists = false;
|
|
757
|
+
try {
|
|
758
|
+
await fs.access(globalConfigPath);
|
|
759
|
+
fileExists = true;
|
|
760
|
+
} catch {
|
|
769
761
|
}
|
|
770
|
-
existing = {};
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
762
|
+
let existing = {};
|
|
763
|
+
try {
|
|
764
|
+
const raw = await fs.readFile(globalConfigPath, "utf8");
|
|
765
|
+
existing = JSON.parse(raw.replace(/^\uFEFF/, ""));
|
|
766
|
+
} catch (err) {
|
|
767
|
+
if (fileExists) {
|
|
768
|
+
throw new Error(
|
|
769
|
+
`Refusing to overwrite corrupt config at ${globalConfigPath} (${err.message}). Fix or move the file aside before retrying.`,
|
|
770
|
+
{ cause: err }
|
|
771
|
+
);
|
|
772
|
+
}
|
|
773
|
+
existing = {};
|
|
774
|
+
}
|
|
775
|
+
const launch = existing.launch ?? {};
|
|
776
|
+
existing.launch = { ...launch, menuChoice: choice };
|
|
777
|
+
await atomicWrite(globalConfigPath, JSON.stringify(existing, null, 2), {
|
|
778
|
+
mode: 384
|
|
779
|
+
});
|
|
776
780
|
});
|
|
777
781
|
}
|
|
778
782
|
|
|
@@ -929,7 +933,7 @@ async function isPortInUse(host, port) {
|
|
|
929
933
|
}
|
|
930
934
|
async function handleHqShortCircuit(flags) {
|
|
931
935
|
if (flags["hq"] !== true) return null;
|
|
932
|
-
const { startHqServer } = await import("./hq-server-
|
|
936
|
+
const { startHqServer } = await import("./hq-server-BI23EPM7.js");
|
|
933
937
|
const tunnelRequested = flags["tunnel"] === true;
|
|
934
938
|
const rawPublicUrl = typeof flags["hq-public-url"] === "string" ? flags["hq-public-url"] : process.env.WRONGSTACK_HQ_PUBLIC_URL;
|
|
935
939
|
let publicOrigin;
|
|
@@ -1036,7 +1040,7 @@ async function handleHqShortCircuit(flags) {
|
|
|
1036
1040
|
let tokenTtlMs;
|
|
1037
1041
|
const rawTtl = typeof flags["hq-token-ttl"] === "string" ? flags["hq-token-ttl"] : process.env.WRONGSTACK_HQ_TOKEN_TTL;
|
|
1038
1042
|
if (rawTtl !== void 0 && rawTtl.length > 0) {
|
|
1039
|
-
const { parseTokenTtlValue } = await import("./hq-ttl-
|
|
1043
|
+
const { parseTokenTtlValue } = await import("./hq-ttl-RKRF7AQX.js");
|
|
1040
1044
|
const parsed = parseTokenTtlValue(rawTtl);
|
|
1041
1045
|
if (parsed.error) {
|
|
1042
1046
|
process.stderr.write(`${color3.red("\u2717")} Invalid --hq-token-ttl: ${parsed.error}
|
|
@@ -1103,7 +1107,7 @@ ${color3.green("Persistent HQ origin ready:")} ${publicOrigin}/
|
|
|
1103
1107
|
return 1;
|
|
1104
1108
|
}
|
|
1105
1109
|
try {
|
|
1106
|
-
const { buildPublicHqUrl, startHqQuickTunnel } = await import("./hq-tunnel-
|
|
1110
|
+
const { buildPublicHqUrl, startHqQuickTunnel } = await import("./hq-tunnel-6VU4IWV4.js");
|
|
1107
1111
|
const originHost = handle.host === "::1" ? "[::1]" : handle.host;
|
|
1108
1112
|
tunnel = await startHqQuickTunnel(`http://${originHost}:${handle.port}`, {
|
|
1109
1113
|
onUnexpectedExit: (message) => process.stderr.write(`${color3.yellow("!")} ${message}
|
|
@@ -1486,7 +1490,7 @@ ${color5.amber("?")} Choose ${color5.dim("(1-4)")} ${color5.dim("[q to quit]")}:
|
|
|
1486
1490
|
|
|
1487
1491
|
// src/pre-launch/launch-prompts.ts
|
|
1488
1492
|
import * as fs4 from "node:fs/promises";
|
|
1489
|
-
import { atomicWrite as atomicWrite3, color as color6 } from "@wrongstack/core/utils";
|
|
1493
|
+
import { atomicWrite as atomicWrite3, color as color6, withFileLock as withFileLock2 } from "@wrongstack/core/utils";
|
|
1490
1494
|
var LaunchAbortedError = class extends Error {
|
|
1491
1495
|
exitCode = 0;
|
|
1492
1496
|
constructor() {
|
|
@@ -1495,7 +1499,7 @@ var LaunchAbortedError = class extends Error {
|
|
|
1495
1499
|
}
|
|
1496
1500
|
};
|
|
1497
1501
|
async function runLaunchPrompts(opts) {
|
|
1498
|
-
const { renderer, reader, modePinned, yoloPinned, autonomyPinned, lastChoices } = opts;
|
|
1502
|
+
const { renderer, reader, modePinned, yoloPinned, autonomyPinned, lastChoices, reuseLast } = opts;
|
|
1499
1503
|
if (modePinned !== void 0 && yoloPinned !== void 0 && autonomyPinned !== void 0) {
|
|
1500
1504
|
return {
|
|
1501
1505
|
mode: modePinned,
|
|
@@ -1524,7 +1528,7 @@ async function runLaunchPrompts(opts) {
|
|
|
1524
1528
|
${color6.dim("Last settings:")} ${color6.bold(modeLabel)} \xB7 YOLO ${onOff(effective.yolo)} \xB7 Autonomy ${effective.autonomy === "auto" ? color6.green("auto") : color6.dim("off")}
|
|
1525
1529
|
`
|
|
1526
1530
|
);
|
|
1527
|
-
const answer = (await reader.readLine(
|
|
1531
|
+
const answer = reuseLast ? "y" : (await reader.readLine(
|
|
1528
1532
|
` ${color6.amber("?")} Continue with these? ${color6.dim("[Y/n/q]")} ${color6.dim("(auto Y in 5s)")} `,
|
|
1529
1533
|
{ timeoutMs: 5e3, defaultAnswer: "y" }
|
|
1530
1534
|
)).trim().toLowerCase();
|
|
@@ -1601,32 +1605,52 @@ function buildBadges(chosen) {
|
|
|
1601
1605
|
badges.push(color6.magenta(`AUTONOMY:${chosen.autonomy.toUpperCase()}`));
|
|
1602
1606
|
return badges;
|
|
1603
1607
|
}
|
|
1604
|
-
async function
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1608
|
+
async function promptStopAskingStartupQuestions(opts) {
|
|
1609
|
+
const answer = (await opts.reader.readLine(
|
|
1610
|
+
` ${color6.amber("?")} Stop asking these startup questions? ${color6.dim("(reuse the last choices from now on)")} ${color6.dim("[y/N]")} ${color6.dim("(auto N in 5s)")} `,
|
|
1611
|
+
{ timeoutMs: 5e3, defaultAnswer: "n" }
|
|
1612
|
+
)).trim().toLowerCase();
|
|
1613
|
+
const stop = answer === "y" || answer === "yes";
|
|
1614
|
+
if (stop) {
|
|
1615
|
+
opts.renderer.write(
|
|
1616
|
+
` ${color6.green("\u25B6")} ${color6.dim("Startup questions off \u2014 turn back on with /settings reuse-startup-choices off.")}
|
|
1617
|
+
|
|
1618
|
+
`
|
|
1619
|
+
);
|
|
1610
1620
|
}
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
);
|
|
1621
|
+
return stop;
|
|
1622
|
+
}
|
|
1623
|
+
async function persistLaunchChoices(configPath, choices, extra) {
|
|
1624
|
+
await withFileLock2(configPath, async () => {
|
|
1625
|
+
let fileExists = false;
|
|
1626
|
+
try {
|
|
1627
|
+
await fs4.access(configPath);
|
|
1628
|
+
fileExists = true;
|
|
1629
|
+
} catch {
|
|
1621
1630
|
}
|
|
1622
|
-
existing = {};
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1631
|
+
let existing = {};
|
|
1632
|
+
try {
|
|
1633
|
+
const raw = await fs4.readFile(configPath, "utf8");
|
|
1634
|
+
existing = JSON.parse(raw.replace(/^\uFEFF/, ""));
|
|
1635
|
+
} catch (err) {
|
|
1636
|
+
if (fileExists) {
|
|
1637
|
+
throw new Error(
|
|
1638
|
+
`Refusing to overwrite corrupt config at ${configPath} (${err.message}). Fix or move the file aside before retrying.`,
|
|
1639
|
+
{ cause: err }
|
|
1640
|
+
);
|
|
1641
|
+
}
|
|
1642
|
+
existing = {};
|
|
1643
|
+
}
|
|
1644
|
+
existing.yolo = choices.yolo;
|
|
1645
|
+
const launch = existing.launch && typeof existing.launch === "object" ? existing.launch : {};
|
|
1646
|
+
existing.launch = {
|
|
1647
|
+
...launch,
|
|
1648
|
+
mode: choices.mode,
|
|
1649
|
+
autonomy: choices.autonomy,
|
|
1650
|
+
...extra?.rememberStartupChoices !== void 0 ? { rememberStartupChoices: extra.rememberStartupChoices } : {}
|
|
1651
|
+
};
|
|
1652
|
+
await atomicWrite3(configPath, JSON.stringify(existing, null, 2), { mode: 384 });
|
|
1653
|
+
});
|
|
1630
1654
|
}
|
|
1631
1655
|
|
|
1632
1656
|
// src/pre-launch/project-check.ts
|
|
@@ -1763,7 +1787,14 @@ function labelFor(variant) {
|
|
|
1763
1787
|
return SYSTEM_PROMPT_OPTIONS.find((o) => o.variant === variant)?.label ?? variant;
|
|
1764
1788
|
}
|
|
1765
1789
|
async function runSystemPromptMenu(deps) {
|
|
1766
|
-
const { renderer, reader, paths, lastVariant, suggestScout } = deps;
|
|
1790
|
+
const { renderer, reader, paths, lastVariant, suggestScout, reuseLast } = deps;
|
|
1791
|
+
if (lastVariant && reuseLast) {
|
|
1792
|
+
renderer.write(
|
|
1793
|
+
` ${color8.green("\u25B6")} ${color8.bold(labelFor(lastVariant))} ${color8.dim("system prompt")}
|
|
1794
|
+
`
|
|
1795
|
+
);
|
|
1796
|
+
return lastVariant;
|
|
1797
|
+
}
|
|
1767
1798
|
const tokens = await countSystemPromptTokens(paths);
|
|
1768
1799
|
const defaultVariant = suggestScout ? "scout" : lastVariant ?? "default";
|
|
1769
1800
|
if (lastVariant) {
|
|
@@ -1827,7 +1858,8 @@ async function maybeRunSystemPromptMenu(opts) {
|
|
|
1827
1858
|
reader: opts.reader,
|
|
1828
1859
|
lastVariant: savedVariant,
|
|
1829
1860
|
paths: opts.paths,
|
|
1830
|
-
suggestScout: opts.outsideProject
|
|
1861
|
+
suggestScout: opts.outsideProject,
|
|
1862
|
+
reuseLast: opts.reuseLast
|
|
1831
1863
|
});
|
|
1832
1864
|
if (chosen === savedVariant) return { variant: chosen, aborted: false, changed: false };
|
|
1833
1865
|
if (opts.outsideProject && chosen === "scout") {
|
|
@@ -1938,6 +1970,10 @@ function isHomeDirectory(cwd, userHome) {
|
|
|
1938
1970
|
if (!cwd || !userHome) return false;
|
|
1939
1971
|
return path7.resolve(cwd) === path7.resolve(userHome);
|
|
1940
1972
|
}
|
|
1973
|
+
function shouldReuseStartupChoices(config) {
|
|
1974
|
+
return config.launch?.rememberStartupChoices !== false;
|
|
1975
|
+
}
|
|
1976
|
+
var REUSE_STARTUP_CHOICES_HINT = "(ask every launch: /settings reuse-startup-choices off)";
|
|
1941
1977
|
function shouldPrintYoloNotice(lastChoices, yoloPinned, yolo) {
|
|
1942
1978
|
return !lastChoices && yoloPinned === void 0 && yolo;
|
|
1943
1979
|
}
|
|
@@ -2008,6 +2044,7 @@ async function applyBootLaunchChoices(input) {
|
|
|
2008
2044
|
projectRoot
|
|
2009
2045
|
} = input;
|
|
2010
2046
|
if (isInteractiveTTY) {
|
|
2047
|
+
const reuseLast = shouldReuseStartupChoices(config);
|
|
2011
2048
|
const promptMenu = await maybeRunSystemPromptMenu({
|
|
2012
2049
|
isInteractiveTTY,
|
|
2013
2050
|
flags,
|
|
@@ -2018,7 +2055,8 @@ async function applyBootLaunchChoices(input) {
|
|
|
2018
2055
|
globalDir: wpaths.globalInstructions,
|
|
2019
2056
|
projectDir: wpaths.inProjectInstructions
|
|
2020
2057
|
},
|
|
2021
|
-
outsideProject: await isOutsideProject(projectRoot)
|
|
2058
|
+
outsideProject: await isOutsideProject(projectRoot),
|
|
2059
|
+
reuseLast
|
|
2022
2060
|
});
|
|
2023
2061
|
if (promptMenu.aborted) {
|
|
2024
2062
|
await reader.close();
|
|
@@ -2060,7 +2098,8 @@ async function applyBootLaunchChoices(input) {
|
|
|
2060
2098
|
modePinned,
|
|
2061
2099
|
yoloPinned,
|
|
2062
2100
|
autonomyPinned,
|
|
2063
|
-
lastChoices
|
|
2101
|
+
lastChoices,
|
|
2102
|
+
reuseLast
|
|
2064
2103
|
});
|
|
2065
2104
|
} catch (err) {
|
|
2066
2105
|
if (err instanceof LaunchAbortedError) {
|
|
@@ -2092,10 +2131,25 @@ async function applyBootLaunchChoices(input) {
|
|
|
2092
2131
|
indexing: { ...config.indexing, onSessionStart: false }
|
|
2093
2132
|
});
|
|
2094
2133
|
}
|
|
2134
|
+
if (reuseLast && lastChoices) {
|
|
2135
|
+
renderer.write(` ${color10.dim(REUSE_STARTUP_CHOICES_HINT)}
|
|
2136
|
+
|
|
2137
|
+
`);
|
|
2138
|
+
}
|
|
2139
|
+
const launchGateAsked = lastChoices !== void 0 && !(modePinned !== void 0 && yoloPinned !== void 0 && autonomyPinned !== void 0);
|
|
2140
|
+
let rememberStartupChoices;
|
|
2141
|
+
if (!reuseLast && (promptMenu.variant !== void 0 || launchGateAsked)) {
|
|
2142
|
+
if (await promptStopAskingStartupQuestions({ renderer, reader })) {
|
|
2143
|
+
rememberStartupChoices = true;
|
|
2144
|
+
config = patchConfig(config, {
|
|
2145
|
+
launch: { ...config.launch, rememberStartupChoices: true }
|
|
2146
|
+
});
|
|
2147
|
+
}
|
|
2148
|
+
}
|
|
2095
2149
|
if (!simpleUiFullAuto) {
|
|
2096
2150
|
try {
|
|
2097
2151
|
const toPersist = flags["webui"] ? { ...choices, mode: lastChoices?.mode ?? config.launch?.mode ?? "tui" } : choices;
|
|
2098
|
-
await persistLaunchChoices(profileConfigPath, toPersist);
|
|
2152
|
+
await persistLaunchChoices(profileConfigPath, toPersist, { rememberStartupChoices });
|
|
2099
2153
|
} catch {
|
|
2100
2154
|
}
|
|
2101
2155
|
}
|
|
@@ -2189,6 +2243,14 @@ async function resolveBootProviderModel(input) {
|
|
|
2189
2243
|
if (!savedStatus.ok) {
|
|
2190
2244
|
renderer.writeWarning(
|
|
2191
2245
|
`Saved provider/model is no longer usable (${savedStatus.reason ?? "unknown reason"}); choose a provider.
|
|
2246
|
+
`
|
|
2247
|
+
);
|
|
2248
|
+
} else if (shouldReuseStartupChoices(config)) {
|
|
2249
|
+
skipPicker = true;
|
|
2250
|
+
renderer.write(
|
|
2251
|
+
`
|
|
2252
|
+
${color11.green("\u25B6")} ${color11.bold(savedProvider)} / ${color11.bold(savedModel)}
|
|
2253
|
+
|
|
2192
2254
|
`
|
|
2193
2255
|
);
|
|
2194
2256
|
} else {
|
|
@@ -2666,7 +2728,7 @@ function dim(s) {
|
|
|
2666
2728
|
}
|
|
2667
2729
|
|
|
2668
2730
|
// src/renderer.ts
|
|
2669
|
-
import { color as color12 } from "@wrongstack/core/utils";
|
|
2731
|
+
import { color as color12, sanitizeTerminalText } from "@wrongstack/core/utils";
|
|
2670
2732
|
var TerminalRenderer = class _TerminalRenderer {
|
|
2671
2733
|
out;
|
|
2672
2734
|
err;
|
|
@@ -2778,9 +2840,11 @@ var TerminalRenderer = class _TerminalRenderer {
|
|
|
2778
2840
|
if (this.suppressStdout()) return;
|
|
2779
2841
|
if (!this.lineStart) this.out.write("\n");
|
|
2780
2842
|
const arrow = theme2.primary("\u2192");
|
|
2781
|
-
const display = formatInputSummary(input);
|
|
2782
|
-
this.out.write(
|
|
2783
|
-
`)
|
|
2843
|
+
const display = sanitizeTerminalText(formatInputSummary(input));
|
|
2844
|
+
this.out.write(
|
|
2845
|
+
`${arrow} ${theme2.bold(sanitizeTerminalText(name))}${display ? color12.dim(` ${display}`) : ""}
|
|
2846
|
+
`
|
|
2847
|
+
);
|
|
2784
2848
|
this.lineStart = true;
|
|
2785
2849
|
}
|
|
2786
2850
|
writeToolResult(name, content, isError) {
|
|
@@ -2788,11 +2852,13 @@ var TerminalRenderer = class _TerminalRenderer {
|
|
|
2788
2852
|
this.clearRenderMode(name);
|
|
2789
2853
|
return;
|
|
2790
2854
|
}
|
|
2791
|
-
const txt =
|
|
2855
|
+
const txt = sanitizeTerminalText(
|
|
2856
|
+
typeof content === "string" ? content : safeStringify(content)
|
|
2857
|
+
);
|
|
2792
2858
|
const prefix = isError ? theme2.error("\u2718") : theme2.success("\u2713");
|
|
2793
2859
|
const renderMode = this.getRenderMode(name);
|
|
2794
2860
|
this.clearRenderMode(name);
|
|
2795
|
-
const bodyText = extractBodyText(content, name);
|
|
2861
|
+
const bodyText = sanitizeTerminalText(extractBodyText(content, name));
|
|
2796
2862
|
if (isError) {
|
|
2797
2863
|
const firstLine = txt.split("\n")[0] ?? "";
|
|
2798
2864
|
const truncated = firstLine.length > 200 ? `${firstLine.slice(0, 197)}\u2026` : firstLine;
|
|
@@ -2804,7 +2870,7 @@ var TerminalRenderer = class _TerminalRenderer {
|
|
|
2804
2870
|
const isEditLike = name === "edit" || name === "write";
|
|
2805
2871
|
const diff = extractDiff(content);
|
|
2806
2872
|
if (isEditLike && diff) {
|
|
2807
|
-
this.out.write(` ${prefix} ${color12.dim(summarize(content, name))}
|
|
2873
|
+
this.out.write(` ${prefix} ${color12.dim(sanitizeTerminalText(summarize(content, name)))}
|
|
2808
2874
|
`);
|
|
2809
2875
|
const rendered = renderDiff(diff).split("\n").map((l) => ` ${l}`).join("\n");
|
|
2810
2876
|
this.out.write(`${rendered}
|
|
@@ -2812,7 +2878,7 @@ var TerminalRenderer = class _TerminalRenderer {
|
|
|
2812
2878
|
this.lineStart = true;
|
|
2813
2879
|
return;
|
|
2814
2880
|
}
|
|
2815
|
-
const summary = summarize(content, name);
|
|
2881
|
+
const summary = sanitizeTerminalText(summarize(content, name));
|
|
2816
2882
|
const isReadLike = name === "read" || name === "grep" || name === "glob" || name === "bash" || name === "exec";
|
|
2817
2883
|
if (renderMode === "simple") {
|
|
2818
2884
|
this.out.write(` ${prefix} ${color12.dim(summary || compactSingleLine(bodyText))}
|
|
@@ -3155,7 +3221,7 @@ var GITHUB_PROVIDERS_OVERLAY_URL = "https://raw.githubusercontent.com/WrongStack
|
|
|
3155
3221
|
async function boot(argv) {
|
|
3156
3222
|
const { flags, positional } = parseArgs(argv);
|
|
3157
3223
|
if (positional[0] === "sandbox") {
|
|
3158
|
-
const { runSandboxCommand } = await import("./sandbox-
|
|
3224
|
+
const { runSandboxCommand } = await import("./sandbox-EZQ76MNY.js");
|
|
3159
3225
|
return runSandboxCommand(positional.slice(1), flags, new TerminalRenderer());
|
|
3160
3226
|
}
|
|
3161
3227
|
if (positional[0] === "update") {
|
|
@@ -3168,7 +3234,7 @@ async function boot(argv) {
|
|
|
3168
3234
|
});
|
|
3169
3235
|
}
|
|
3170
3236
|
if (positional[0] === "remote" || typeof flags["remote"] === "string") {
|
|
3171
|
-
const { runRemoteCommand } = await import("./remote-
|
|
3237
|
+
const { runRemoteCommand } = await import("./remote-AKKRJEHK.js");
|
|
3172
3238
|
return runRemoteCommand(
|
|
3173
3239
|
positional[0] === "remote" ? positional.slice(1) : positional,
|
|
3174
3240
|
flags,
|
|
@@ -3553,4 +3619,4 @@ async function initializeCli(argv, options = {}) {
|
|
|
3553
3619
|
export {
|
|
3554
3620
|
initializeCli
|
|
3555
3621
|
};
|
|
3556
|
-
//# sourceMappingURL=cli-context-
|
|
3622
|
+
//# sourceMappingURL=cli-context-V6NKFU2X.js.map
|