@wrongstack/cli 1.0.28 → 1.0.32
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 +8 -177
- package/dist/{acp-M4565YUW.js → acp-EDGUWU7N.js} +4 -7
- package/dist/{audit-46YK5DSC.js → audit-KCBTHUQI.js} +1 -1
- package/dist/{auth-TE55JF4Z.js → auth-SUHKFFO4.js} +136 -59
- package/dist/auth-menu/github-copilot-oauth.d.ts +1 -35
- package/dist/auth-menu/index-input.d.ts +3 -0
- package/dist/auth-menu/panel-flow-bridge.d.ts +29 -0
- package/dist/auth-menu/panel-service.d.ts +3 -34
- package/dist/auth-menu/provider-auth-login.d.ts +1 -1
- package/dist/auto-discover-providers-QIL34K3U.js +7 -0
- package/dist/automation-MCDFCIMV.js +369 -0
- package/dist/{bench-GTLPM22B.js → bench-MMZHFHDL.js} +152 -43
- package/dist/boot/brain-decision-log.d.ts +1 -1
- package/dist/boot/system-prompt-builder.d.ts +1 -1
- package/dist/boot/system-prompt-menu.d.ts +11 -2
- package/dist/boot/tui-coordinator-setup.d.ts +2 -0
- package/dist/boot/tui-startup-output.d.ts +11 -0
- package/dist/{boot-auto-thin-6Q56FY3F.js → boot-auto-thin-K2DHHYIW.js} +3 -3
- package/dist/{chronicle-UTFETHP6.js → chronicle-PBJS7BN6.js} +5 -3
- package/dist/{chunk-EPR42SWM.js → chunk-2EZ2DHOW.js} +60 -7
- package/dist/{chunk-7IQWQCBH.js → chunk-3LEFXLAW.js} +39 -39
- package/dist/{chunk-WSTVGC2C.js → chunk-4BX2YDTQ.js} +13 -6
- package/dist/{chunk-SFBFYIOW.js → chunk-4MDRHMX4.js} +3 -2
- package/dist/{chunk-RGFWGUAB.js → chunk-4UWCMBPG.js} +159 -3
- package/dist/{chunk-RDGGWMTI.js → chunk-65VNCAF6.js} +2 -22
- package/dist/{chunk-WQZW3RDP.js → chunk-7BNBD4PE.js} +2 -2
- package/dist/chunk-CFHWIFXL.js +123 -0
- package/dist/{chunk-RZ4ZDRYA.js → chunk-DIOODAYM.js} +2 -2
- package/dist/{chunk-L2RVEQWO.js → chunk-HHRYIDOW.js} +2 -2
- package/dist/chunk-LIZXJHZQ.js +61 -0
- package/dist/{chunk-YHYINL47.js → chunk-LKFKO4JW.js} +2 -2
- package/dist/{chunk-Q4INH2DG.js → chunk-MPQCHBDJ.js} +2 -1
- package/dist/{chunk-2ERX3RPN.js → chunk-P3GRLV47.js} +30 -17
- package/dist/{chunk-ZMX5HRLI.js → chunk-P3Q3KMFH.js} +6 -4
- package/dist/{chunk-KOEO4CJG.js → chunk-PGNERAZL.js} +4 -4
- package/dist/{chunk-ENRYW73H.js → chunk-RQ4UBKYH.js} +81 -10
- package/dist/{chunk-X756ZS72.js → chunk-SUDNPYWD.js} +2 -2
- package/dist/{chunk-LDCGZJTC.js → chunk-TWSQTQKR.js} +12 -4
- package/dist/chunk-TXAFIERF.js +37 -0
- package/dist/{chunk-UZ2TMHNH.js → chunk-UKP7H2U4.js} +10 -2
- package/dist/{chunk-5JYDKG5B.js → chunk-WHEYHDIE.js} +7 -2
- package/dist/{chunk-LBPLTTZ6.js → chunk-WTJDSTYD.js} +4 -4
- package/dist/{chunk-L5TD7UIG.js → chunk-WXJH4F6K.js} +7 -7
- package/dist/{chunk-IS2PPBQV.js → chunk-X4LW5CZM.js} +8 -4
- package/dist/{chunk-BBHWW6LR.js → chunk-YL4KCHZG.js} +18 -6
- package/dist/{chunk-LUMETJFO.js → chunk-ZYACRPLN.js} +2 -2
- package/dist/{cli-context-O2SHBDFH.js → cli-context-ITHGP2CE.js} +91 -84
- package/dist/cli-context.d.ts +3 -1
- package/dist/cli-infrastructure.d.ts +33 -0
- package/dist/{cli-main-BKG4ZVLN.js → cli-main-TQGLKB6D.js} +3783 -2753
- package/dist/config-doctor.d.ts +1 -1
- package/dist/{config-transfer-RUWLDCNK.js → config-transfer-UE37X4B5.js} +2 -2
- package/dist/{execution-THXWTHYT.js → execution-C2IECWF7.js} +5271 -5118
- package/dist/execution-chimera-handlers.d.ts +6 -0
- package/dist/execution-session-callbacks.d.ts +36 -0
- package/dist/execution-webui.d.ts +3 -0
- package/dist/execution.d.ts +1 -1
- package/dist/fleet/host-acp-runner.d.ts +15 -0
- package/dist/fleet/host-budget.d.ts +13 -0
- package/dist/fleet/host-context.d.ts +5 -0
- package/dist/fleet/host-explore-companion.d.ts +7 -16
- package/dist/fleet/host.d.ts +2 -0
- package/dist/fleet/status-broadcast.d.ts +1 -1
- package/dist/{hq-44F4OQH2.js → hq-KBFDKTDD.js} +13 -7
- package/dist/hq-publisher.d.ts +4 -1
- package/dist/hq-server/sage-sync-send.d.ts +5 -0
- package/dist/hq-server/server-lifecycle.d.ts +1 -1
- package/dist/hq-server/snapshot.d.ts +1 -1
- package/dist/{hq-server-UIB24LU6.js → hq-server-AVNKZ2PV.js} +2 -2
- package/dist/{hq-service-BMMJAHRT.js → hq-service-FGB7BY2D.js} +3 -3
- package/dist/hq-ttl-N4DAIAVX.js +7 -0
- package/dist/index.js +126 -10
- package/dist/{mailbox-serve-GNGXEQ2R.js → mailbox-serve-S536N66F.js} +4 -3
- package/dist/{modeldiag-W7XAE625.js → modeldiag-PQILD7TN.js} +26 -8
- package/dist/{per-subcommand-help-QDAQASPZ.js → per-subcommand-help-VKPV3OEY.js} +2 -2
- package/dist/{plugin-usage-CIGOOTX3.js → plugin-usage-3TZGROK7.js} +3 -3
- package/dist/{plugins-HQTXUD6A.js → plugins-ITH4SLO6.js} +4 -4
- package/dist/pre-launch/project-check.d.ts +2 -8
- package/dist/pre-launch.d.ts +1 -1
- package/dist/{project-manifest-7NSFVBM3.js → project-manifest-FTFDCCTZ.js} +2 -2
- package/dist/{project-picker-SVBXMPKX.js → project-picker-NZYJKQQC.js} +3 -3
- package/dist/provider-cloud-config.d.ts +4 -0
- package/dist/provider-config-utils.d.ts +1 -1
- package/dist/{providers-models-5Z2PJTEW.js → providers-models-W57I3QOA.js} +3 -3
- package/dist/{remote-GB5VXCCT.js → remote-C74BCNND.js} +5 -5
- package/dist/{rewind-JA3ZLCNM.js → rewind-7AULJS7F.js} +7 -5
- package/dist/sage-FFKUOCQL.js +475 -0
- package/dist/sage-connect.d.ts +62 -0
- package/dist/sage-hq-sync.d.ts +8 -0
- package/dist/sage-sync-ZMTHB477.js +69 -0
- package/dist/sandbox-TYGD6FI2.js +131 -0
- package/dist/services/sdd/project-context.d.ts +1 -1
- package/dist/{sessions-config-XHLXJ5C3.js → sessions-config-VE26SB56.js} +19 -8
- package/dist/short-circuit-flags-6LB3EGF7.js +10 -0
- package/dist/slash-commands/openai-quota.d.ts +12 -6
- package/dist/slash-commands/sandbox.d.ts +5 -0
- package/dist/slash-commands/scout-stats.d.ts +46 -0
- package/dist/slash-commands/sdd-inspect-commands.d.ts +9 -0
- package/dist/slash-commands/sdd-session-commands.d.ts +19 -0
- package/dist/slash-commands/sdd.d.ts +1 -1
- package/dist/slash-commands/zai-plan.d.ts +26 -0
- package/dist/{standalone-auto-update-TOTRGCSA.js → standalone-auto-update-VQC4GYCM.js} +3 -3
- package/dist/{standalone-update-LZO3MNLH.js → standalone-update-HZHDZZOR.js} +2 -2
- package/dist/subcommands/handlers/automation-credentials.d.ts +8 -0
- package/dist/subcommands/handlers/automation.d.ts +3 -0
- package/dist/subcommands/handlers/bench-experiments.d.ts +5 -0
- package/dist/subcommands/handlers/helpers.d.ts +1 -1
- package/dist/subcommands/handlers/sage-sync.d.ts +4 -0
- package/dist/subcommands/handlers/sage.d.ts +5 -0
- package/dist/subcommands/handlers/sandbox.d.ts +5 -0
- package/dist/{subcommands-SRRB3RAS.js → subcommands-QO7VYTSS.js} +2 -2
- package/dist/{tools-skills-GH24UCBY.js → tools-skills-33AI6K6S.js} +2 -2
- package/dist/tui-provider-quota-menu.d.ts +5 -0
- package/dist/{typesafe-WA5O3KVS.js → typesafe-NHC322W5.js} +27 -8
- package/dist/{typesafe-topic-replay-ZILIU3WS.js → typesafe-topic-replay-DB2AYL7V.js} +2 -2
- package/dist/{typesafe-triage-replay-FGAW7QM7.js → typesafe-triage-replay-27NDAZ3V.js} +2 -2
- package/dist/{update-TDZX4IL2.js → update-J5WHAFPE.js} +3 -3
- package/dist/{update-check-J5ZVKS73.js → update-check-VLVT4IV2.js} +2 -2
- package/dist/{version-help-XJJQ7YSH.js → version-help-ATOKGMTK.js} +2 -2
- package/dist/webui-server/prefs-seeding.d.ts +1 -0
- package/dist/webui-server/route-contexts.d.ts +1 -0
- package/dist/{webui-server-GCXIO3JY.js → webui-server-GQOVLQS3.js} +79 -40
- package/dist/webui-session-retirement.d.ts +10 -0
- package/dist/wiring/command-host-state.d.ts +2 -0
- package/dist/wiring/director-announcement.d.ts +3 -1
- package/dist/wiring/session-establishment.d.ts +10 -8
- package/dist/wiring/session-runtime.d.ts +1 -1
- package/dist/wiring/session.d.ts +3 -0
- package/package.json +30 -29
- package/dist/auto-discover-providers-DXR25GTG.js +0 -7
- package/dist/chunk-3ZTLPNEQ.js +0 -58
- package/dist/chunk-D5GB5MHA.js +0 -87
- package/dist/chunk-SIGUWXAA.js +0 -43
- package/dist/hq-ttl-VJR65OBJ.js +0 -7
- package/dist/short-circuit-flags-BSIPTAPD.js +0 -10
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
parseOutputFormat,
|
|
3
|
+
resolveJsonSchemaFlag
|
|
4
|
+
} from "./chunk-LKPEBZBE.js";
|
|
5
|
+
import {
|
|
6
|
+
parseWebuiSessionChildOptions,
|
|
7
|
+
writeWebuiSessionChildError
|
|
8
|
+
} from "./chunk-P3Q3KMFH.js";
|
|
1
9
|
import {
|
|
2
10
|
activateRestrictedMode,
|
|
3
11
|
announceSafeMode,
|
|
@@ -10,34 +18,29 @@ import {
|
|
|
10
18
|
resolveLaunchAllowedTools,
|
|
11
19
|
resolveToolRestriction
|
|
12
20
|
} from "./chunk-TI7KLHYX.js";
|
|
13
|
-
import {
|
|
14
|
-
parseOutputFormat,
|
|
15
|
-
resolveJsonSchemaFlag
|
|
16
|
-
} from "./chunk-LKPEBZBE.js";
|
|
17
21
|
import {
|
|
18
22
|
theme as theme2
|
|
19
23
|
} from "./chunk-QD544J2B.js";
|
|
20
|
-
import {
|
|
21
|
-
parseWebuiSessionChildOptions,
|
|
22
|
-
writeWebuiSessionChildError
|
|
23
|
-
} from "./chunk-ZMX5HRLI.js";
|
|
24
24
|
import {
|
|
25
25
|
fmtTok,
|
|
26
26
|
patchConfig
|
|
27
27
|
} from "./chunk-EWKESL4L.js";
|
|
28
|
+
import {
|
|
29
|
+
resolveLaunchMcpServers
|
|
30
|
+
} from "./chunk-HLSHFXTO.js";
|
|
28
31
|
import {
|
|
29
32
|
subcommands
|
|
30
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-LIZXJHZQ.js";
|
|
31
34
|
import {
|
|
32
35
|
renderDeepHelp,
|
|
33
36
|
renderFocusedHelp
|
|
34
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-2EZ2DHOW.js";
|
|
35
38
|
import {
|
|
36
39
|
handleHelpVersionShortCircuit
|
|
37
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-WXJH4F6K.js";
|
|
38
41
|
import {
|
|
39
42
|
DEFAULT_PORT
|
|
40
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-RQ4UBKYH.js";
|
|
41
44
|
import "./chunk-HXJYHAR4.js";
|
|
42
45
|
import {
|
|
43
46
|
resolveHqPasswordInput
|
|
@@ -45,47 +48,28 @@ import {
|
|
|
45
48
|
import {
|
|
46
49
|
normalizeHqPublicOrigin
|
|
47
50
|
} from "./chunk-5EA6OTLJ.js";
|
|
48
|
-
import {
|
|
49
|
-
resolveLaunchMcpServers
|
|
50
|
-
} from "./chunk-HLSHFXTO.js";
|
|
51
|
-
import {
|
|
52
|
-
installProviderPersisters
|
|
53
|
-
} from "./chunk-LDCGZJTC.js";
|
|
54
51
|
import {
|
|
55
52
|
parseHqIpAllowlist
|
|
56
53
|
} from "./chunk-Q7E3BPDU.js";
|
|
57
54
|
import {
|
|
58
|
-
|
|
59
|
-
} from "./chunk-
|
|
60
|
-
import {
|
|
61
|
-
runUpdateCommand
|
|
62
|
-
} from "./chunk-KOEO4CJG.js";
|
|
63
|
-
import "./chunk-U3SS4NRH.js";
|
|
64
|
-
import {
|
|
65
|
-
applyNodeEnvDefault,
|
|
66
|
-
applySessionShellDefault,
|
|
67
|
-
runPreflight
|
|
68
|
-
} from "./chunk-LBPLTTZ6.js";
|
|
69
|
-
import "./chunk-RZ4ZDRYA.js";
|
|
70
|
-
import {
|
|
71
|
-
applyAsciiMode
|
|
72
|
-
} from "./chunk-PZQBGUVZ.js";
|
|
73
|
-
import "./chunk-5JYDKG5B.js";
|
|
55
|
+
installProviderPersisters
|
|
56
|
+
} from "./chunk-TWSQTQKR.js";
|
|
74
57
|
import {
|
|
75
|
-
|
|
76
|
-
} from "./chunk-
|
|
58
|
+
discoverAndMergeProviders
|
|
59
|
+
} from "./chunk-CFHWIFXL.js";
|
|
77
60
|
import {
|
|
78
61
|
addFromCatalog,
|
|
79
62
|
boxBottom,
|
|
80
63
|
boxDivider,
|
|
81
64
|
boxRow,
|
|
82
65
|
boxTop,
|
|
66
|
+
parseAuthMenuIndex,
|
|
83
67
|
runAuthLocal,
|
|
84
68
|
runOAuthLoginMenu,
|
|
85
69
|
runPicker,
|
|
86
70
|
saveToGlobalConfig,
|
|
87
71
|
theme
|
|
88
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-P3GRLV47.js";
|
|
89
73
|
import "./chunk-YTEOAWOJ.js";
|
|
90
74
|
import {
|
|
91
75
|
isKeylessLocalProvider,
|
|
@@ -93,15 +77,32 @@ import {
|
|
|
93
77
|
} from "./chunk-5UZBUV2H.js";
|
|
94
78
|
import {
|
|
95
79
|
resolveActiveApiKey
|
|
96
|
-
} from "./chunk-
|
|
97
|
-
import "./chunk-DAKVBMD4.js";
|
|
80
|
+
} from "./chunk-ZYACRPLN.js";
|
|
98
81
|
import {
|
|
99
82
|
activeProfileConfigPath
|
|
100
83
|
} from "./chunk-YMXXOOFN.js";
|
|
101
|
-
import "./chunk-
|
|
84
|
+
import "./chunk-4BX2YDTQ.js";
|
|
85
|
+
import {
|
|
86
|
+
runUpdateCommand
|
|
87
|
+
} from "./chunk-PGNERAZL.js";
|
|
88
|
+
import "./chunk-U3SS4NRH.js";
|
|
89
|
+
import "./chunk-DAKVBMD4.js";
|
|
90
|
+
import {
|
|
91
|
+
applyNodeEnvDefault,
|
|
92
|
+
applySessionShellDefault,
|
|
93
|
+
runPreflight
|
|
94
|
+
} from "./chunk-WTJDSTYD.js";
|
|
102
95
|
import {
|
|
103
96
|
parseArgs
|
|
104
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-MPQCHBDJ.js";
|
|
98
|
+
import "./chunk-DIOODAYM.js";
|
|
99
|
+
import {
|
|
100
|
+
applyAsciiMode
|
|
101
|
+
} from "./chunk-PZQBGUVZ.js";
|
|
102
|
+
import "./chunk-WHEYHDIE.js";
|
|
103
|
+
import {
|
|
104
|
+
CLI_VERSION
|
|
105
|
+
} from "./chunk-F5DCFAKI.js";
|
|
105
106
|
|
|
106
107
|
// src/cli-context.ts
|
|
107
108
|
import { TOKENS as TOKENS3 } from "@wrongstack/core/kernel";
|
|
@@ -657,7 +658,7 @@ async function promptPort(deps, defaultPort) {
|
|
|
657
658
|
)).trim();
|
|
658
659
|
if (answer === "" || answer === "\n") return defaultPort;
|
|
659
660
|
if (answer === "q" || answer === "quit") return defaultPort;
|
|
660
|
-
const parsed = Number
|
|
661
|
+
const parsed = /^\d+$/.test(answer) ? Number(answer) : Number.NaN;
|
|
661
662
|
if (Number.isFinite(parsed) && parsed > 0 && parsed < 65536) {
|
|
662
663
|
return parsed;
|
|
663
664
|
}
|
|
@@ -928,7 +929,7 @@ async function isPortInUse(host, port) {
|
|
|
928
929
|
}
|
|
929
930
|
async function handleHqShortCircuit(flags) {
|
|
930
931
|
if (flags["hq"] !== true) return null;
|
|
931
|
-
const { startHqServer } = await import("./hq-server-
|
|
932
|
+
const { startHqServer } = await import("./hq-server-AVNKZ2PV.js");
|
|
932
933
|
const tunnelRequested = flags["tunnel"] === true;
|
|
933
934
|
const rawPublicUrl = typeof flags["hq-public-url"] === "string" ? flags["hq-public-url"] : process.env.WRONGSTACK_HQ_PUBLIC_URL;
|
|
934
935
|
let publicOrigin;
|
|
@@ -959,7 +960,8 @@ async function handleHqShortCircuit(flags) {
|
|
|
959
960
|
}
|
|
960
961
|
let port;
|
|
961
962
|
if (typeof flags["port"] === "string" && flags["port"].trim() !== "") {
|
|
962
|
-
const
|
|
963
|
+
const rawPort = flags["port"].trim();
|
|
964
|
+
const parsed = /^\d+$/.test(rawPort) ? Number(rawPort) : Number.NaN;
|
|
963
965
|
if (Number.isFinite(parsed) && parsed > 0 && parsed < 65536) {
|
|
964
966
|
port = parsed;
|
|
965
967
|
} else {
|
|
@@ -1034,7 +1036,7 @@ async function handleHqShortCircuit(flags) {
|
|
|
1034
1036
|
let tokenTtlMs;
|
|
1035
1037
|
const rawTtl = typeof flags["hq-token-ttl"] === "string" ? flags["hq-token-ttl"] : process.env.WRONGSTACK_HQ_TOKEN_TTL;
|
|
1036
1038
|
if (rawTtl !== void 0 && rawTtl.length > 0) {
|
|
1037
|
-
const { parseTokenTtlValue } = await import("./hq-ttl-
|
|
1039
|
+
const { parseTokenTtlValue } = await import("./hq-ttl-N4DAIAVX.js");
|
|
1038
1040
|
const parsed = parseTokenTtlValue(rawTtl);
|
|
1039
1041
|
if (parsed.error) {
|
|
1040
1042
|
process.stderr.write(`${color3.red("\u2717")} Invalid --hq-token-ttl: ${parsed.error}
|
|
@@ -1759,34 +1761,12 @@ async function persistLaunchChoices(configPath, choices) {
|
|
|
1759
1761
|
// src/pre-launch/project-check.ts
|
|
1760
1762
|
import * as fs6 from "node:fs/promises";
|
|
1761
1763
|
import * as path7 from "node:path";
|
|
1762
|
-
import {
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
"Makefile",
|
|
1769
|
-
"pom.xml",
|
|
1770
|
-
"build.gradle",
|
|
1771
|
-
"build.gradle.kts",
|
|
1772
|
-
"composer.json",
|
|
1773
|
-
"Gemfile"
|
|
1774
|
-
];
|
|
1775
|
-
async function detectProjectKind(projectRoot) {
|
|
1776
|
-
try {
|
|
1777
|
-
await fs6.access(path7.join(projectRoot, ".wrongstack", "AGENTS.md"));
|
|
1778
|
-
return "initialized";
|
|
1779
|
-
} catch {
|
|
1780
|
-
}
|
|
1781
|
-
for (const m of MANIFESTS) {
|
|
1782
|
-
try {
|
|
1783
|
-
await fs6.access(path7.join(projectRoot, m));
|
|
1784
|
-
return "project";
|
|
1785
|
-
} catch {
|
|
1786
|
-
}
|
|
1787
|
-
}
|
|
1788
|
-
return "empty";
|
|
1789
|
-
}
|
|
1764
|
+
import {
|
|
1765
|
+
color as color8,
|
|
1766
|
+
detectProjectKind,
|
|
1767
|
+
isOutsideProject,
|
|
1768
|
+
toErrorMessage as toErrorMessage4
|
|
1769
|
+
} from "@wrongstack/core/utils";
|
|
1790
1770
|
async function scaffoldAgentsMd(projectRoot) {
|
|
1791
1771
|
const dir = path7.join(projectRoot, ".wrongstack");
|
|
1792
1772
|
const file = path7.join(dir, "AGENTS.md");
|
|
@@ -1898,7 +1878,7 @@ function flagOn(value) {
|
|
|
1898
1878
|
return normalized === "true" || normalized === "1" || normalized === "yes" || normalized === "on";
|
|
1899
1879
|
}
|
|
1900
1880
|
function isSystemPromptPinned(flags) {
|
|
1901
|
-
return flagOn(flags["system-pro"]) || flagOn(flags["system-lite"]) || typeof flags["system-prompt"] === "string";
|
|
1881
|
+
return flagOn(flags["system-pro"]) || flagOn(flags["system-lite"]) || flagOn(flags["system-scout"]) || typeof flags["system-prompt"] === "string";
|
|
1902
1882
|
}
|
|
1903
1883
|
function shouldSkipSystemPromptMenu(flags) {
|
|
1904
1884
|
if (isSystemPromptPinned(flags)) return true;
|
|
@@ -1912,10 +1892,17 @@ function labelFor(variant) {
|
|
|
1912
1892
|
return SYSTEM_PROMPT_OPTIONS.find((o) => o.variant === variant)?.label ?? variant;
|
|
1913
1893
|
}
|
|
1914
1894
|
async function runSystemPromptMenu(deps) {
|
|
1915
|
-
const { renderer, reader, paths, lastVariant } = deps;
|
|
1895
|
+
const { renderer, reader, paths, lastVariant, suggestScout } = deps;
|
|
1916
1896
|
const tokens = await countSystemPromptTokens(paths);
|
|
1917
|
-
const defaultVariant = lastVariant ?? "default";
|
|
1897
|
+
const defaultVariant = suggestScout ? "scout" : lastVariant ?? "default";
|
|
1918
1898
|
if (lastVariant) {
|
|
1899
|
+
if (suggestScout && lastVariant !== "scout") {
|
|
1900
|
+
renderer.write(
|
|
1901
|
+
`
|
|
1902
|
+
${color9.dim("\u25CB")} ${color9.dim(`Not a project folder \u2014 ${labelFor("scout")} (general-purpose) may fit better; answer n to choose it.`)}
|
|
1903
|
+
`
|
|
1904
|
+
);
|
|
1905
|
+
}
|
|
1919
1906
|
const answer2 = (await reader.readLine(
|
|
1920
1907
|
` ${color9.amber("?")} Continue with ${color9.bold(labelFor(lastVariant))} system prompt ${color9.dim(`(~${fmtTok(tokens[lastVariant])} tokens)`)}? ${color9.dim("[Y/n/q]")} ${color9.dim("(auto Y in 5s)")} `,
|
|
1921
1908
|
{ timeoutMs: SUMMARY_TIMEOUT_MS2, defaultAnswer: "y" }
|
|
@@ -1926,6 +1913,12 @@ async function runSystemPromptMenu(deps) {
|
|
|
1926
1913
|
renderer.write(`
|
|
1927
1914
|
${color9.amber("?")} System prompt:
|
|
1928
1915
|
`);
|
|
1916
|
+
if (suggestScout) {
|
|
1917
|
+
renderer.write(
|
|
1918
|
+
` ${color9.dim(`Not a project folder \u2014 ${labelFor("scout")} is preselected.`)}
|
|
1919
|
+
`
|
|
1920
|
+
);
|
|
1921
|
+
}
|
|
1929
1922
|
for (const [index, opt] of SYSTEM_PROMPT_OPTIONS.entries()) {
|
|
1930
1923
|
const num2 = index + 1;
|
|
1931
1924
|
const isDefault = opt.variant === defaultVariant;
|
|
@@ -1942,8 +1935,8 @@ async function runSystemPromptMenu(deps) {
|
|
|
1942
1935
|
)).trim().toLowerCase();
|
|
1943
1936
|
if (answer === "q" || answer === "quit") throw new LaunchAbortedError();
|
|
1944
1937
|
if (!answer) return defaultVariant;
|
|
1945
|
-
const num =
|
|
1946
|
-
if (
|
|
1938
|
+
const num = parseAuthMenuIndex(answer);
|
|
1939
|
+
if (num !== void 0 && num <= SYSTEM_PROMPT_OPTIONS.length) {
|
|
1947
1940
|
return SYSTEM_PROMPT_OPTIONS[num - 1].variant;
|
|
1948
1941
|
}
|
|
1949
1942
|
const byName = SYSTEM_PROMPT_OPTIONS.find(
|
|
@@ -1962,9 +1955,17 @@ async function maybeRunSystemPromptMenu(opts) {
|
|
|
1962
1955
|
renderer: opts.renderer,
|
|
1963
1956
|
reader: opts.reader,
|
|
1964
1957
|
lastVariant: savedVariant,
|
|
1965
|
-
paths: opts.paths
|
|
1958
|
+
paths: opts.paths,
|
|
1959
|
+
suggestScout: opts.outsideProject
|
|
1966
1960
|
});
|
|
1967
1961
|
if (chosen === savedVariant) return { variant: chosen, aborted: false, changed: false };
|
|
1962
|
+
if (opts.outsideProject && chosen === "scout") {
|
|
1963
|
+
opts.renderer.write(
|
|
1964
|
+
` ${color9.dim(`${labelFor("scout")} for this launch only; the saved default stays ${labelFor(savedVariant ?? "default")}.`)}
|
|
1965
|
+
`
|
|
1966
|
+
);
|
|
1967
|
+
return { variant: chosen, aborted: false, changed: true };
|
|
1968
|
+
}
|
|
1968
1969
|
try {
|
|
1969
1970
|
await (opts.persist ?? persistSystemPromptVariant)(opts.profileConfigPath, chosen);
|
|
1970
1971
|
} catch (err) {
|
|
@@ -2787,6 +2788,10 @@ function compactSingleLine(text) {
|
|
|
2787
2788
|
var GITHUB_PROVIDERS_OVERLAY_URL = "https://raw.githubusercontent.com/WrongStack/WrongStack/main/packages/cli/data/providers.json";
|
|
2788
2789
|
async function boot(argv) {
|
|
2789
2790
|
const { flags, positional } = parseArgs(argv);
|
|
2791
|
+
if (positional[0] === "sandbox") {
|
|
2792
|
+
const { runSandboxCommand } = await import("./sandbox-TYGD6FI2.js");
|
|
2793
|
+
return runSandboxCommand(positional.slice(1), flags, new TerminalRenderer());
|
|
2794
|
+
}
|
|
2790
2795
|
if (positional[0] === "update") {
|
|
2791
2796
|
const renderer2 = new TerminalRenderer();
|
|
2792
2797
|
return runUpdateCommand(positional.slice(1), {
|
|
@@ -2797,7 +2802,7 @@ async function boot(argv) {
|
|
|
2797
2802
|
});
|
|
2798
2803
|
}
|
|
2799
2804
|
if (positional[0] === "remote" || typeof flags["remote"] === "string") {
|
|
2800
|
-
const { runRemoteCommand } = await import("./remote-
|
|
2805
|
+
const { runRemoteCommand } = await import("./remote-C74BCNND.js");
|
|
2801
2806
|
return runRemoteCommand(
|
|
2802
2807
|
positional[0] === "remote" ? positional.slice(1) : positional,
|
|
2803
2808
|
flags,
|
|
@@ -2906,9 +2911,9 @@ async function boot(argv) {
|
|
|
2906
2911
|
overlayFile: resolveBundledOverlayFile(),
|
|
2907
2912
|
overlayCacheFile: wpaths.modelsOverlayCache
|
|
2908
2913
|
});
|
|
2914
|
+
installProviderPersisters({ config, paths: wpaths, vault, logger });
|
|
2909
2915
|
const subcommandHandler = first ? subcommands[first] : void 0;
|
|
2910
2916
|
if (first && subcommandHandler) {
|
|
2911
|
-
installProviderPersisters({ config, paths: wpaths, vault, logger });
|
|
2912
2917
|
if (flags["help"] === true || flags["h"] === true) {
|
|
2913
2918
|
const deepSub = positional[1];
|
|
2914
2919
|
if (deepSub && renderDeepHelp(`${first}:${deepSub}`, renderer)) {
|
|
@@ -3162,7 +3167,8 @@ To start the app with no model connected, pass --provider ${SETUP_PROVIDER_ID} -
|
|
|
3162
3167
|
paths: {
|
|
3163
3168
|
globalDir: wpaths.globalInstructions,
|
|
3164
3169
|
projectDir: wpaths.inProjectInstructions
|
|
3165
|
-
}
|
|
3170
|
+
},
|
|
3171
|
+
outsideProject: await isOutsideProject(projectRoot)
|
|
3166
3172
|
});
|
|
3167
3173
|
if (promptMenu.aborted) {
|
|
3168
3174
|
await reader.close();
|
|
@@ -3280,7 +3286,7 @@ To start the app with no model connected, pass --provider ${SETUP_PROVIDER_ID} -
|
|
|
3280
3286
|
}
|
|
3281
3287
|
|
|
3282
3288
|
// src/cli-context.ts
|
|
3283
|
-
async function initializeCli(argv) {
|
|
3289
|
+
async function initializeCli(argv, options = {}) {
|
|
3284
3290
|
applyNodeEnvDefault();
|
|
3285
3291
|
applySessionShellDefault();
|
|
3286
3292
|
const earlyFlags = parseArgs(argv).flags;
|
|
@@ -3339,6 +3345,7 @@ async function initializeCli(argv) {
|
|
|
3339
3345
|
return 0;
|
|
3340
3346
|
}
|
|
3341
3347
|
effectiveArgv = applyLaunchMenuToArgv(argv, menuResult);
|
|
3348
|
+
if (menuResult.mode !== "tui-repl") options.onNonTuiLaunch?.();
|
|
3342
3349
|
const augmentedFlags = parseArgs(effectiveArgv).flags;
|
|
3343
3350
|
if (menuResult.mode === "hq") {
|
|
3344
3351
|
const hqAfterMenu = await handleHqShortCircuit(augmentedFlags);
|
|
@@ -3442,4 +3449,4 @@ async function initializeCli(argv) {
|
|
|
3442
3449
|
export {
|
|
3443
3450
|
initializeCli
|
|
3444
3451
|
};
|
|
3445
|
-
//# sourceMappingURL=cli-context-
|
|
3452
|
+
//# sourceMappingURL=cli-context-ITHGP2CE.js.map
|
package/dist/cli-context.d.ts
CHANGED
|
@@ -32,5 +32,7 @@ export interface CliContext extends BootContext {
|
|
|
32
32
|
* or a numeric exit code when a short-circuit flag (--help, --desktop, --hq)
|
|
33
33
|
* fires. When the return is a number the caller must return it immediately.
|
|
34
34
|
*/
|
|
35
|
-
export declare function initializeCli(argv: string[]
|
|
35
|
+
export declare function initializeCli(argv: string[], options?: {
|
|
36
|
+
onNonTuiLaunch?: () => void;
|
|
37
|
+
}): Promise<CliContext | number>;
|
|
36
38
|
//# sourceMappingURL=cli-context.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { SystemPromptBuilder } from '@wrongstack/core/types';
|
|
2
|
+
export declare function setupCliInfrastructure(inputs: {
|
|
3
|
+
flags: Record<string, string | boolean>;
|
|
4
|
+
wpaths: import('@wrongstack/core/utils').WstackPaths;
|
|
5
|
+
events: import('@wrongstack/core/kernel').EventBus;
|
|
6
|
+
logger: import('@wrongstack/core/infrastructure').DefaultLogger;
|
|
7
|
+
getConfig: () => import('@wrongstack/core/types').Config;
|
|
8
|
+
teardownHandlers: (() => void)[];
|
|
9
|
+
vectorMemoryStore: import('@wrongstack/vector-memory').VectorMemoryStore | undefined;
|
|
10
|
+
renderer: import('./renderer.js').TerminalRenderer;
|
|
11
|
+
sessionRef: {
|
|
12
|
+
current: import('@wrongstack/core/types').SessionWriter | undefined;
|
|
13
|
+
};
|
|
14
|
+
activeMode: import('@wrongstack/core/types').Mode | null;
|
|
15
|
+
toolRegistry: import('@wrongstack/core/registry').ToolRegistry;
|
|
16
|
+
configStore: import('@wrongstack/core/types').ConfigStore;
|
|
17
|
+
container: import('@wrongstack/core/kernel').Container;
|
|
18
|
+
cwd: string;
|
|
19
|
+
projectRoot: string;
|
|
20
|
+
provider: import('@wrongstack/core/types').Provider;
|
|
21
|
+
}): Promise<{
|
|
22
|
+
metricsSink: import("@wrongstack/core/types").MetricsSink | undefined;
|
|
23
|
+
healthRegistry: import("@wrongstack/core/types").HealthRegistry | undefined;
|
|
24
|
+
metricsStatus: import("@wrongstack/core/types").MetricsRuntimeStatus;
|
|
25
|
+
tracer: import("@wrongstack/core/types").Tracer | undefined;
|
|
26
|
+
tuiOwnsScreen: boolean;
|
|
27
|
+
evOn: (event: string, handler: (...args: unknown[]) => void) => void;
|
|
28
|
+
eventWiring: import("./boot/event-wiring.js").EventWiring;
|
|
29
|
+
promptBuilder: SystemPromptBuilder;
|
|
30
|
+
onlineAgents: import("@wrongstack/core/coordination").MailboxAgentStatus[];
|
|
31
|
+
systemPrompt: import("@wrongstack/core/types").TextBlock[];
|
|
32
|
+
}>;
|
|
33
|
+
//# sourceMappingURL=cli-infrastructure.d.ts.map
|