@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
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
|
|
2
|
+
// src/permission-rules-view.ts
|
|
3
|
+
import {
|
|
4
|
+
compilePermissionRules,
|
|
5
|
+
matchedPermissionRule,
|
|
6
|
+
withExecutorGate
|
|
7
|
+
} from "@wrongstack/core/security";
|
|
8
|
+
async function explainCall(policy, tool, input, ctx, yolo) {
|
|
9
|
+
if (!policy.explain) throw new Error("This permission policy cannot explain its decisions.");
|
|
10
|
+
const trace = withExecutorGate(await policy.explain(tool, input, ctx), tool, yolo);
|
|
11
|
+
const rules = await compilePermissionRules(policy, ctx, { yolo });
|
|
12
|
+
return { trace, rules, rule: matchedPermissionRule(rules, trace) };
|
|
13
|
+
}
|
|
14
|
+
function actionText(rule) {
|
|
15
|
+
return rule.action === "*" ? "any tool" : rule.action;
|
|
16
|
+
}
|
|
17
|
+
function resourceText(rule) {
|
|
18
|
+
return rule.resource === "*" ? "any input" : rule.resource;
|
|
19
|
+
}
|
|
20
|
+
function describePermissionRule(rule) {
|
|
21
|
+
return `#${rule.n} ${rule.effect} ${actionText(rule)} \u2192 ${resourceText(rule)} (${rule.source})`;
|
|
22
|
+
}
|
|
23
|
+
function formatPermissionRules(rules) {
|
|
24
|
+
const width = String(rules.length).length;
|
|
25
|
+
const lines = ["Permission rules, in the order they are checked; the first match decides:", ""];
|
|
26
|
+
for (const rule of rules) {
|
|
27
|
+
lines.push(
|
|
28
|
+
` ${String(rule.n).padStart(width)}. ${rule.effect.padEnd(5)} ${rule.source.padEnd(15)} ${actionText(rule)} \u2192 ${resourceText(rule)}`
|
|
29
|
+
);
|
|
30
|
+
if (rule.note) lines.push(` ${" ".repeat(width)} ${" ".repeat(22)}${rule.note}`);
|
|
31
|
+
}
|
|
32
|
+
return lines.join("\n");
|
|
33
|
+
}
|
|
34
|
+
function formatExplainedCall({ trace, rule }) {
|
|
35
|
+
const lines = [];
|
|
36
|
+
lines.push(`Permission trace for "${trace.toolName}"`);
|
|
37
|
+
lines.push(`Subject: ${trace.subject ?? "(none)"}`);
|
|
38
|
+
lines.push("");
|
|
39
|
+
for (let i = 0; i < trace.steps.length; i++) {
|
|
40
|
+
const step = trace.steps[i];
|
|
41
|
+
if (!step) continue;
|
|
42
|
+
const winner = i === trace.winnerIndex ? " \u2190 WINNER" : "";
|
|
43
|
+
const matched = step.matched ? "\u2713" : " ";
|
|
44
|
+
lines.push(` ${matched} [${i}] ${step.rule}${winner}`);
|
|
45
|
+
lines.push(` decision: ${step.decision} source: ${step.source}`);
|
|
46
|
+
lines.push(` ${step.detail}`);
|
|
47
|
+
if (i < trace.steps.length - 1) lines.push("");
|
|
48
|
+
}
|
|
49
|
+
lines.push("");
|
|
50
|
+
lines.push(`Effective: ${trace.decision.permission} (source: ${trace.decision.source})`);
|
|
51
|
+
if (rule) lines.push(`Rule: ${describePermissionRule(rule)}`);
|
|
52
|
+
if (trace.decision.reason) lines.push(`Reason: ${trace.decision.reason}`);
|
|
53
|
+
if (trace.decision.riskTier) lines.push(`Risk tier: ${trace.decision.riskTier}`);
|
|
54
|
+
return lines.join("\n");
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export {
|
|
58
|
+
explainCall,
|
|
59
|
+
formatPermissionRules,
|
|
60
|
+
formatExplainedCall
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=chunk-4TVYGG6G.js.map
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import {
|
|
2
|
+
API_VERSION,
|
|
3
|
+
CLI_VERSION
|
|
4
|
+
} from "./chunk-F5DCFAKI.js";
|
|
5
|
+
|
|
6
|
+
// src/subcommands/handlers/version-help.ts
|
|
7
|
+
import * as os from "node:os";
|
|
8
|
+
import { color } from "@wrongstack/core/utils";
|
|
9
|
+
var versionCmd = async (_args, deps) => {
|
|
10
|
+
const bunVersion = globalThis.Bun?.version;
|
|
11
|
+
const runtime = bunVersion ? `bun v${bunVersion}` : `node ${process.version}`;
|
|
12
|
+
deps.renderer.write(
|
|
13
|
+
`WrongStack ${CLI_VERSION} (apiVersion ${API_VERSION}, ${runtime}, ${os.platform()})
|
|
14
|
+
`
|
|
15
|
+
);
|
|
16
|
+
return 0;
|
|
17
|
+
};
|
|
18
|
+
function row(left, description) {
|
|
19
|
+
const pad = 31;
|
|
20
|
+
return left.length < pad - 2 ? ` ${left.padEnd(pad - 2)}${description}` : ` ${left}
|
|
21
|
+
${" ".repeat(pad)}${description}`;
|
|
22
|
+
}
|
|
23
|
+
function section(title, rows) {
|
|
24
|
+
return ["", color.bold(title), ...rows.map(([left, description]) => row(left, description))];
|
|
25
|
+
}
|
|
26
|
+
var helpCmd = async (_args, deps) => {
|
|
27
|
+
const lines = [
|
|
28
|
+
color.bold("WrongStack \u2014 usage"),
|
|
29
|
+
"",
|
|
30
|
+
' wstack [flags] ["<task>"] With a task: run it and exit. Without: start a session.',
|
|
31
|
+
" wstack <command> --help Details for one command",
|
|
32
|
+
...section("Start", [
|
|
33
|
+
["wstack", "Interactive session (REPL or TUI, picked at launch)"],
|
|
34
|
+
['wstack "<task>"', 'Run one task and exit (also: --prompt "<task>")'],
|
|
35
|
+
["wstack quick", "Straight into the TUI with saved defaults"],
|
|
36
|
+
["wstack webui | simpleui", "Browser UI / minimal chat UI for this project"],
|
|
37
|
+
["wstack desktop", "WrongStack Desktop (requires @wrongstack/desktop)"],
|
|
38
|
+
["wstack hq", "HQ command center across projects and machines"],
|
|
39
|
+
["wstack remote <user@host:/path>", "Run on a remote machine over SSH; WebUI tunneled here"],
|
|
40
|
+
['wstack --eternal "<mission>"', "Eternal-autonomy loop against a goal (Ctrl+C stops)"],
|
|
41
|
+
["wstack acp [serve]", "Agent Client Protocol server for editors"]
|
|
42
|
+
]),
|
|
43
|
+
...section("Sessions", [
|
|
44
|
+
["wstack sessions", "List recent sessions (also: fork, doctor, fleet)"],
|
|
45
|
+
["wstack resume [<id>]", "Resume a session (same as -r)"],
|
|
46
|
+
["wstack rewind [<id>]", "Rewind a session to an earlier point"],
|
|
47
|
+
["wstack export <id>", "Render a session as markdown, JSON or text"],
|
|
48
|
+
["wstack audit | replay [<id>]", "Tamper-evident audit log / recorded provider responses"],
|
|
49
|
+
["wstack chronicle", "Cross-session timeline and metrics"],
|
|
50
|
+
["wstack usage", "Token and cost summary"]
|
|
51
|
+
]),
|
|
52
|
+
...section("Setup", [
|
|
53
|
+
["wstack auth", "Provider keys: add/edit/remove, list, status, local"],
|
|
54
|
+
["wstack providers | models", "Browse providers and models; models add|remove|refresh"],
|
|
55
|
+
["wstack config", "Show, edit, back up or restore the active profile config"],
|
|
56
|
+
["wstack config-export | config-import", "Move behaviour settings via ./wstack-config.json"],
|
|
57
|
+
["wstack mcp", "MCP servers: list, add, remove, serve"],
|
|
58
|
+
["wstack import-claude-code", "Import MCP servers from Claude Code (preview; --apply)"],
|
|
59
|
+
["wstack plugin", "Plugins: list, install, enable, disable, remove"],
|
|
60
|
+
["wstack tools | skills", "List registered tools / discovered skills"],
|
|
61
|
+
["wstack typesafe", "TypeSafe account: status, login, test"],
|
|
62
|
+
["wstack update", "Self-update (--check-only)"]
|
|
63
|
+
]),
|
|
64
|
+
...section("Project & diagnostics", [
|
|
65
|
+
["wstack project | projects", "Committed project identity / tracked projects"],
|
|
66
|
+
["wstack permissions explain", "Why a tool call is allowed, asked or denied"],
|
|
67
|
+
["wstack doctor | diag", "Health checks / full diagnostic dump"],
|
|
68
|
+
["wstack governance status", "Project-daemon health"],
|
|
69
|
+
["wstack modeldiag | bench", "Model capability diagnostics / agentic benchmarks"],
|
|
70
|
+
["wstack mailbox serve", "HTTP bridge for external agents"],
|
|
71
|
+
["wstack version", "Print version"]
|
|
72
|
+
]),
|
|
73
|
+
...section("Session flags", [
|
|
74
|
+
["-c, --continue", "Resume the most recent session"],
|
|
75
|
+
["-r, --resume [<id>]", "Resume a session (latest when no id)"],
|
|
76
|
+
["--recover", "Reopen the last session that never closed (crash, kill)"],
|
|
77
|
+
["--fork-session", "With -c/-r/--recover: continue a copy, keep the original"],
|
|
78
|
+
["--provider <id> --model <id>", "Provider and model for this run"],
|
|
79
|
+
["--fallback-model <a,b,...>", "Models to fall back to when the primary is unavailable"],
|
|
80
|
+
["--effort <level>", "Reasoning effort: none|minimal|low|medium|high|xhigh|max"],
|
|
81
|
+
["--system-prompt lite|pro|default", "Bundled system-prompt variant"],
|
|
82
|
+
[
|
|
83
|
+
"--append-system-prompt <text> | --append-system-prompt-file <path>",
|
|
84
|
+
"Add instructions to the host agent prompt for this run"
|
|
85
|
+
],
|
|
86
|
+
['--goal "<goal>" | --ask "<q>"', "Open the TUI with a goal or a question queued"]
|
|
87
|
+
]),
|
|
88
|
+
...section("Tools & permissions", [
|
|
89
|
+
["--yolo | --no-yolo", "Auto-approve on or off (gated destructive kinds still ask)"],
|
|
90
|
+
["--yolo-destructive", "Let YOLO run every destructive kind you may un-gate"],
|
|
91
|
+
["--restricted", "Untrusted repo: no shell/network/MCP tools, stay in project, no YOLO"],
|
|
92
|
+
["--safe-mode", "Troubleshoot: no 3rd-party plugins, hooks, MCP, skills, overrides"],
|
|
93
|
+
["--only-tools <a,b,...>", "Expose only these tools (trailing * = prefix: mcp__gh__*)"],
|
|
94
|
+
["--disallowed-tools <a,b,...>", "Hide these tools, subagents included"],
|
|
95
|
+
["--allowed-tools <a,b,...>", "Run these without a prompt (destructive calls still ask)"],
|
|
96
|
+
["--mcp-config <file|json>", "Extra MCP servers for this run (.mcp.json accepted)"],
|
|
97
|
+
["--strict-mcp-config", "Start only the --mcp-config servers"],
|
|
98
|
+
["--no-hooks", "Skip user and plugin hooks (policy hooks still run)"]
|
|
99
|
+
]),
|
|
100
|
+
...section("Scripting (with a task)", [
|
|
101
|
+
["<stdin>", 'Piped input becomes context: git diff | wstack "review this"'],
|
|
102
|
+
["--output-json", "One JSON result line: status, finalText, sessionId, usage"],
|
|
103
|
+
[
|
|
104
|
+
"--output-format text|json|stream-json",
|
|
105
|
+
"stream-json: init, assistant, tool_result, result lines"
|
|
106
|
+
],
|
|
107
|
+
["--include-partial-messages", "stream-json: add text_delta lines"],
|
|
108
|
+
["--json-schema <file|json>", "Answer must be JSON matching the schema (structuredOutput)"],
|
|
109
|
+
["--max-budget-usd <amount>", "Stop once spend (leader + subagents) passes the amount"],
|
|
110
|
+
["", "Exit: 0 done, 1 failed/limit/budget/schema, 130 aborted, 2 usage"]
|
|
111
|
+
]),
|
|
112
|
+
...section("Interfaces", [
|
|
113
|
+
["--tui | --no-tui", "Force or disable the TUI"],
|
|
114
|
+
["--mouse", "Full mouse mode in the TUI"],
|
|
115
|
+
["--ascii", "Plain-ASCII symbols, borders and spinners (no emoji or box drawing)"],
|
|
116
|
+
["--desktop", "Same as wstack desktop"],
|
|
117
|
+
[
|
|
118
|
+
"--webui [--host <h>] [--port <n>] [--open]",
|
|
119
|
+
"Browser UI (+ --webui-token, --webui-public-url, ...)"
|
|
120
|
+
],
|
|
121
|
+
[
|
|
122
|
+
"--simpleui [same flags] [--full-auto]",
|
|
123
|
+
"Minimal chat UI; --full-auto = YOLO + autonomy for this run only"
|
|
124
|
+
],
|
|
125
|
+
[
|
|
126
|
+
"--hq [--host <h>] [--port <n>] [--password <p>] [--tunnel] [--open]",
|
|
127
|
+
"HQ server (+ --hq-allowlist, --hq-public-url)"
|
|
128
|
+
]
|
|
129
|
+
]),
|
|
130
|
+
...section("Startup & tuning", [
|
|
131
|
+
["--skip", "Skip every startup prompt; use saved choices"],
|
|
132
|
+
["--skip-index", "Skip codebase indexing at startup"],
|
|
133
|
+
["--no-models-refresh", "Use the cached model catalog"],
|
|
134
|
+
["--token-saving-tier <tier>", "auto|off|minimal|light|medium|aggressive"],
|
|
135
|
+
["--max-concurrent <n> | --max-spawns <n>", "Fleet concurrency / lifetime subagent spawns"],
|
|
136
|
+
["--chimera-auto-fix off|ask|auto", "How to handle Chimera review findings"],
|
|
137
|
+
["--cwd <dir>", "Run as if started in <dir>"],
|
|
138
|
+
["--verbose | --trace | --log-level <l>", "Log verbosity"],
|
|
139
|
+
["--metrics [--metrics-port <n>]", "Metrics and health; Prometheus endpoint on the port"],
|
|
140
|
+
[
|
|
141
|
+
"--record | --replay <session-id>",
|
|
142
|
+
"Record provider responses / serve them back (test harnesses; a changed prompt misses)"
|
|
143
|
+
]
|
|
144
|
+
])
|
|
145
|
+
];
|
|
146
|
+
deps.renderer.write(lines.join("\n") + "\n");
|
|
147
|
+
return 0;
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export {
|
|
151
|
+
versionCmd,
|
|
152
|
+
helpCmd
|
|
153
|
+
};
|
|
154
|
+
//# sourceMappingURL=chunk-5JYDKG5B.js.map
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
resolveProviderCfgWithProxy
|
|
3
|
+
} from "./chunk-S4FFHDJG.js";
|
|
1
4
|
import {
|
|
2
5
|
fallbackCodexProviderModels,
|
|
3
6
|
filterCurrentCodexModelIds,
|
|
@@ -140,83 +143,6 @@ async function refreshAcpRegistry(paths, opts) {
|
|
|
140
143
|
return { count: result.agents.length, location, fetchedAt: result.fetchedAt };
|
|
141
144
|
}
|
|
142
145
|
|
|
143
|
-
// src/wiring/provider-runtime.ts
|
|
144
|
-
import { makeProviderFromConfig } from "@wrongstack/providers";
|
|
145
|
-
import {
|
|
146
|
-
getProxyConfig,
|
|
147
|
-
isProxyEligible,
|
|
148
|
-
rewriteBaseUrl,
|
|
149
|
-
sanitizeUrlForLog,
|
|
150
|
-
shouldRewriteFor
|
|
151
|
-
} from "@wrongstack/core/wiring/proxy-rewrite";
|
|
152
|
-
function resolveProviderCfg(config, providerId, opts) {
|
|
153
|
-
const savedCfg = config.providers?.[providerId];
|
|
154
|
-
const rawBaseUrl = savedCfg?.baseUrl ?? config.baseUrl;
|
|
155
|
-
let rewriteReason = "no-base-url";
|
|
156
|
-
let baseUrl = rawBaseUrl;
|
|
157
|
-
if (rawBaseUrl && shouldRewriteFor(providerId)) {
|
|
158
|
-
const rewritten = rewriteBaseUrl(rawBaseUrl, currentProxyBaseUrl());
|
|
159
|
-
if (rewritten !== rawBaseUrl) {
|
|
160
|
-
rewriteReason = "applied";
|
|
161
|
-
baseUrl = rewritten;
|
|
162
|
-
} else {
|
|
163
|
-
rewriteReason = passthroughReason(rawBaseUrl);
|
|
164
|
-
}
|
|
165
|
-
} else if (rawBaseUrl) {
|
|
166
|
-
rewriteReason = proxySkipReason(providerId);
|
|
167
|
-
}
|
|
168
|
-
opts?.logger?.info(
|
|
169
|
-
`WrongProxy rewrite ${rewriteReason} for provider '${providerId}': ${sanitizeUrlForLog(rawBaseUrl) || "<none>"} -> ${sanitizeUrlForLog(baseUrl) || "<none>"}`
|
|
170
|
-
);
|
|
171
|
-
const cfg = {
|
|
172
|
-
...savedCfg,
|
|
173
|
-
apiKey: savedCfg?.apiKey ?? config.apiKey,
|
|
174
|
-
baseUrl,
|
|
175
|
-
type: providerId
|
|
176
|
-
};
|
|
177
|
-
const factoryType = savedCfg?.type ?? providerId;
|
|
178
|
-
return { cfg, factoryType };
|
|
179
|
-
}
|
|
180
|
-
function passthroughReason(rawBaseUrl) {
|
|
181
|
-
if (!rawBaseUrl.includes("://")) return "no-scheme";
|
|
182
|
-
const proxyRoot = currentProxyBaseUrl().replace(/\/+$/, "");
|
|
183
|
-
if (proxyRoot && rawBaseUrl.startsWith(`${proxyRoot}/proxy/`)) {
|
|
184
|
-
return "already-rewritten";
|
|
185
|
-
}
|
|
186
|
-
try {
|
|
187
|
-
const parsed = new URL(rawBaseUrl);
|
|
188
|
-
const host = parsed.hostname;
|
|
189
|
-
const isLoopback = host === "localhost" || host === "127.0.0.1" || host === "[::1]";
|
|
190
|
-
if (isLoopback && parsed.port !== "") return "loopback";
|
|
191
|
-
} catch {
|
|
192
|
-
}
|
|
193
|
-
return "ineligible";
|
|
194
|
-
}
|
|
195
|
-
function proxySkipReason(providerId) {
|
|
196
|
-
const cfg = getProxyConfig();
|
|
197
|
-
if (!cfg.enabled) return "disabled";
|
|
198
|
-
if (!cfg.url) return "no-proxy-url";
|
|
199
|
-
if (!cfg.active) return "inactive";
|
|
200
|
-
if (!isProxyEligible(providerId)) return "excluded";
|
|
201
|
-
return "unknown";
|
|
202
|
-
}
|
|
203
|
-
function currentProxyBaseUrl() {
|
|
204
|
-
return getProxyConfig().url;
|
|
205
|
-
}
|
|
206
|
-
function resolveProviderCfgWithProxy(config, providerId, opts) {
|
|
207
|
-
return resolveProviderCfg(config, providerId, opts);
|
|
208
|
-
}
|
|
209
|
-
function buildProviderForId(args, providerId) {
|
|
210
|
-
const { cfg, factoryType } = resolveProviderCfg(args.config, providerId, {
|
|
211
|
-
logger: args.logger
|
|
212
|
-
});
|
|
213
|
-
const useRegistry = !!args.config.features.modelsRegistry && args.providerRegistry.has(factoryType);
|
|
214
|
-
return useRegistry ? args.providerRegistry.create(cfg, factoryType) : makeProviderFromConfig(
|
|
215
|
-
providerId,
|
|
216
|
-
factoryType === "ai-gateway" ? { ...cfg, type: factoryType } : cfg
|
|
217
|
-
);
|
|
218
|
-
}
|
|
219
|
-
|
|
220
146
|
// src/shutdown-cleanup.ts
|
|
221
147
|
function createGracefulShutdown(cleanup) {
|
|
222
148
|
const exitCode = cleanup.exitCode ?? 0;
|
|
@@ -269,7 +195,8 @@ import {
|
|
|
269
195
|
createSetupProviderFactory,
|
|
270
196
|
installCatalogModelOutputLimits,
|
|
271
197
|
isSetupProvider,
|
|
272
|
-
makeProviderFromConfig
|
|
198
|
+
makeProviderFromConfig,
|
|
199
|
+
setStreamTimeoutDefaults,
|
|
273
200
|
setupProviderResolved,
|
|
274
201
|
withCatalogCapabilities
|
|
275
202
|
} from "@wrongstack/providers";
|
|
@@ -339,6 +266,7 @@ async function setupProvider(params) {
|
|
|
339
266
|
context: { provider: config.provider, family: resolvedProvider.npm, kind: "unsupported" }
|
|
340
267
|
});
|
|
341
268
|
}
|
|
269
|
+
setStreamTimeoutDefaults(config.modelRuntime?.streaming);
|
|
342
270
|
if (config.features.modelsRegistry) {
|
|
343
271
|
await installCatalogModelOutputLimits({
|
|
344
272
|
registry: modelsRegistry,
|
|
@@ -379,7 +307,7 @@ Try \`wstack models refresh\` once you have network access.`,
|
|
|
379
307
|
if (providerRegistry.has(factoryType)) {
|
|
380
308
|
provider = providerRegistry.create(cfgWithType, factoryType);
|
|
381
309
|
} else {
|
|
382
|
-
provider =
|
|
310
|
+
provider = makeProviderFromConfig(config.provider, { ...cfgWithType, type: factoryType });
|
|
383
311
|
}
|
|
384
312
|
} catch (err) {
|
|
385
313
|
throw new ConfigError({
|
|
@@ -405,9 +333,7 @@ export {
|
|
|
405
333
|
formatAcpAgentList,
|
|
406
334
|
loadCachedAcpRegistry,
|
|
407
335
|
refreshAcpRegistry,
|
|
408
|
-
resolveProviderCfg,
|
|
409
|
-
buildProviderForId,
|
|
410
336
|
setupProvider,
|
|
411
337
|
createGracefulShutdown
|
|
412
338
|
};
|
|
413
|
-
//# sourceMappingURL=chunk-
|
|
339
|
+
//# sourceMappingURL=chunk-5SEYGOCH.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
// src/provider-helpers.ts
|
|
3
|
-
import { hasProviderCredential } from "@wrongstack/core/models";
|
|
3
|
+
import { hasProviderCredential, isKeylessLocalProvider } from "@wrongstack/core/models";
|
|
4
4
|
import { catalogProviderIdFor } from "@wrongstack/providers";
|
|
5
5
|
function uniqueModelIds(primary, fallback) {
|
|
6
6
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -18,22 +18,6 @@ function visibleModelIds(providerId, config, catalogModelIds, cfg) {
|
|
|
18
18
|
if (entry?.models === void 0) return [...catalogModelIds];
|
|
19
19
|
return uniqueModelIds(entry.models, catalogModelIds);
|
|
20
20
|
}
|
|
21
|
-
function isLoopbackUrl(apiBase) {
|
|
22
|
-
if (!apiBase) return false;
|
|
23
|
-
let host;
|
|
24
|
-
try {
|
|
25
|
-
host = new URL(apiBase).hostname.toLowerCase();
|
|
26
|
-
} catch {
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
host = host.replace(/^\[|\]$/g, "");
|
|
30
|
-
if (host === "localhost" || host === "::1" || host === "0.0.0.0") return true;
|
|
31
|
-
return /^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(host);
|
|
32
|
-
}
|
|
33
|
-
function isKeylessLocalProvider(provider) {
|
|
34
|
-
if (provider.envVars && provider.envVars.length > 0) return false;
|
|
35
|
-
return isLoopbackUrl(provider.apiBase);
|
|
36
|
-
}
|
|
37
21
|
function hasApiKey(provider, config) {
|
|
38
22
|
return hasProviderCredential(provider, config);
|
|
39
23
|
}
|
|
@@ -122,9 +106,9 @@ function modelDetails(models) {
|
|
|
122
106
|
}
|
|
123
107
|
|
|
124
108
|
export {
|
|
125
|
-
visibleModelIds,
|
|
126
109
|
isKeylessLocalProvider,
|
|
110
|
+
visibleModelIds,
|
|
127
111
|
hasApiKey,
|
|
128
112
|
buildPickableProviders
|
|
129
113
|
};
|
|
130
|
-
//# sourceMappingURL=chunk-
|
|
114
|
+
//# sourceMappingURL=chunk-5UZBUV2H.js.map
|