@wrongstack/cli 1.0.24 → 1.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/providers.json +44 -0
- package/dist/{acp-AJWSKWE5.js → acp-M4565YUW.js} +33 -20
- package/dist/ascii-mode-SG4PRNLP.js +7 -0
- package/dist/{auth-GRBZ7Y3D.js → auth-TE55JF4Z.js} +14 -14
- package/dist/{bench-N5K7Z5O3.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/container-wiring.d.ts +4 -2
- package/dist/boot/dispatch-singleshot.d.ts +12 -1
- package/dist/boot/dispatch-webui.d.ts +2 -0
- package/dist/boot/goal-tui-default.d.ts +10 -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/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/worktree-sessions.d.ts +21 -0
- package/dist/boot-provider-selection.d.ts +67 -0
- package/dist/boot.d.ts +1 -38
- package/dist/{chunk-LFMVHT3R.js → chunk-2ERX3RPN.js} +11 -13
- package/dist/chunk-4TVYGG6G.js +62 -0
- package/dist/chunk-5JYDKG5B.js +154 -0
- package/dist/{chunk-3VXYY5JC.js → chunk-5UZBUV2H.js} +3 -19
- package/dist/chunk-CZTXF6HY.js +140 -0
- package/dist/{chunk-DRM7PSW7.js → chunk-ENRYW73H.js} +527 -381
- package/dist/{chunk-SKPDE62W.js → chunk-EPR42SWM.js} +36 -6
- package/dist/{chunk-YBUCXXYZ.js → chunk-F5DCFAKI.js} +1 -1
- package/dist/chunk-HDMFKTT3.js +157 -0
- package/dist/{chunk-PGKJ2OQP.js → chunk-HFZH2XJN.js} +5 -5
- package/dist/chunk-HLSHFXTO.js +97 -0
- package/dist/{chunk-QFPQXKCG.js → chunk-KOEO4CJG.js} +21 -6
- package/dist/chunk-LBPLTTZ6.js +105 -0
- package/dist/{chunk-3OCUS3VN.js → chunk-LDCGZJTC.js} +4 -4
- package/dist/chunk-LKPEBZBE.js +143 -0
- package/dist/chunk-N57IU5FG.js +58 -0
- package/dist/{chunk-2EBVTYJR.js → chunk-NRXWOMK7.js} +17 -3
- package/dist/chunk-PZQBGUVZ.js +18 -0
- package/dist/{chunk-MHEBWVXL.js → chunk-Q4INH2DG.js} +46 -2
- package/dist/{chunk-5SEYGOCH.js → chunk-RDGGWMTI.js} +2 -2
- package/dist/{chunk-BLD5DSVA.js → chunk-RGFWGUAB.js} +27 -15
- package/dist/{chunk-ZZRSG7VK.js → chunk-RZ4ZDRYA.js} +3 -3
- package/dist/{chunk-S4FFHDJG.js → chunk-SDJCLEK6.js} +6 -2
- package/dist/{chunk-U46QR4WR.js → chunk-TI7KLHYX.js} +132 -3
- package/dist/chunk-X756ZS72.js +329 -0
- package/dist/{chunk-JF2MULWF.js → chunk-YHYINL47.js} +47 -15
- package/dist/{cli-context-34Q5IJRA.js → cli-context-C7RBSWHF.js} +434 -327
- package/dist/{cli-main-AELJDBGU.js → cli-main-TQTH73ZK.js} +2948 -2315
- package/dist/cli-update-notice.d.ts +2 -1
- package/dist/config-doctor.d.ts +1 -1
- package/dist/{diag-doctor-WIFJH3XH.js → diag-doctor-BIZAFIAT.js} +2 -2
- package/dist/{execution-PYC5FCS4.js → execution-3STBD2U7.js} +2167 -1831
- package/dist/execution-chimera-review.d.ts +18 -1
- 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-JTUTFI4L.js → hq-44F4OQH2.js} +9 -8
- package/dist/hq-fleet-control.d.ts +36 -0
- package/dist/hq-live-status.d.ts +22 -0
- package/dist/hq-publisher.d.ts +18 -0
- package/dist/hq-server/routes/command-handlers.d.ts +12 -1
- package/dist/hq-server/routes/data-handlers.d.ts +1 -1
- package/dist/hq-server/socket-credentials.d.ts +63 -0
- package/dist/hq-server/upgrade-handler.d.ts +2 -0
- package/dist/hq-server/ws.d.ts +24 -0
- package/dist/{hq-server-PC7GZMPT.js → hq-server-UIB24LU6.js} +2 -2
- package/dist/{hq-service-NW56MUP2.js → hq-service-BMMJAHRT.js} +4 -4
- package/dist/import-claude-code-AYG24RG2.js +268 -0
- package/dist/index.js +12 -8
- package/dist/live-settings-input.d.ts +1 -0
- package/dist/{mailbox-serve-WDOCH6KR.js → mailbox-serve-GNGXEQ2R.js} +3 -3
- package/dist/{modeldiag-36OGAL5C.js → modeldiag-W7XAE625.js} +9 -9
- package/dist/{per-subcommand-help-XE77MTGJ.js → per-subcommand-help-QDAQASPZ.js} +2 -2
- package/dist/permission-prompt.d.ts +14 -0
- package/dist/permission-rules-view.d.ts +18 -0
- package/dist/{permissions-CFDLXETM.js → permissions-PL27UHYD.js} +67 -45
- package/dist/{plugin-usage-S5LVGMBW.js → plugin-usage-CIGOOTX3.js} +2 -2
- package/dist/{plugins-RHBIVLI7.js → plugins-HQTXUD6A.js} +4 -2
- package/dist/preflight.d.ts +1 -1
- package/dist/{projects-LMNAGGEU.js → projects-T4CZCA25.js} +3 -6
- package/dist/provider-helpers.d.ts +7 -11
- package/dist/{providers-models-2CFG46RD.js → providers-models-5Z2PJTEW.js} +5 -5
- package/dist/release-asset-download.d.ts +10 -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-GB5VXCCT.js +576 -0
- package/dist/{replay-Z3FTJEMM.js → replay-DEI566CW.js} +2 -2
- package/dist/services/commit-message.d.ts +2 -1
- 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-IQUH2GXT.js → sessions-config-XHLXJ5C3.js} +109 -10
- package/dist/short-circuit-flags-5TNTJPQR.js +10 -0
- package/dist/slash-commands/command-context.d.ts +15 -5
- package/dist/slash-commands/goal-refiner.d.ts +4 -49
- package/dist/slash-commands/mcp.d.ts +2 -1
- package/dist/slash-commands/permissions.d.ts +4 -0
- package/dist/slash-commands/settings-context-mutations.d.ts +5 -0
- package/dist/slash-commands/settings-limits-mutations.d.ts +12 -0
- package/dist/slash-commands/theme.d.ts +15 -1
- 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 +37 -1
- package/dist/subcommands/handlers/import-claude-code.d.ts +52 -0
- package/dist/subcommands/handlers/permissions.d.ts +9 -3
- package/dist/subcommands/handlers/remote.d.ts +6 -0
- package/dist/subcommands/handlers/sessions-fleet.d.ts +0 -12
- package/dist/subcommands/handlers/version-help.d.ts +5 -0
- package/dist/{subcommands-ZTSIN7LG.js → subcommands-BHQYLDSD.js} +2 -2
- package/dist/tui-resume-callback.d.ts +18 -0
- package/dist/{typesafe-HVEVPA6R.js → typesafe-U7YB2RRV.js} +5 -5
- package/dist/{typesafe-topic-replay-4W73BOLV.js → typesafe-topic-replay-ZILIU3WS.js} +18 -2
- package/dist/{update-7XIOEXTD.js → update-TDZX4IL2.js} +4 -4
- package/dist/{update-check-2POMBHFB.js → update-check-J5ZVKS73.js} +3 -3
- package/dist/version-JB2UAV2A.js +11 -0
- package/dist/version-help-XJJQ7YSH.js +10 -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-L2SICPTB.js → webui-server-GCXIO3JY.js} +515 -365
- package/dist/webui-server-lifecycle.d.ts +57 -0
- package/dist/webui-server-options.d.ts +10 -0
- package/dist/webui-server.d.ts +0 -14
- 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/command-host-state.d.ts +2 -0
- package/dist/wiring/hq-telemetry.d.ts +12 -0
- 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 +3 -0
- package/dist/wiring/provider-status.d.ts +1 -0
- package/dist/wiring/provider-utility-tools.d.ts +3 -1
- package/package.json +29 -28
- package/dist/chunk-2BKFWIER.js +0 -98
- package/dist/chunk-424ORSE7.js +0 -56
- package/dist/chunk-OWNC7LMD.js +0 -78
- package/dist/chunk-QBBF7GIK.js +0 -65
- package/dist/short-circuit-flags-SDT53OML.js +0 -10
- package/dist/standalone-update-MW47J3AK.js +0 -164
- package/dist/version-help-WZ623NWM.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,22 +4,22 @@ import {
|
|
|
4
4
|
loadCachedAcpRegistry,
|
|
5
5
|
refreshAcpRegistry,
|
|
6
6
|
setupProvider
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-RDGGWMTI.js";
|
|
8
8
|
import {
|
|
9
9
|
createHqCommandDispatcher
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-NRXWOMK7.js";
|
|
11
11
|
import {
|
|
12
12
|
startCliHqConnection
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-RGFWGUAB.js";
|
|
14
|
+
import "./chunk-SDJCLEK6.js";
|
|
15
|
+
import "./chunk-F5DCFAKI.js";
|
|
15
16
|
import "./chunk-SIGUWXAA.js";
|
|
16
|
-
import "./chunk-DAKVBMD4.js";
|
|
17
17
|
import "./chunk-LUMETJFO.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-DAKVBMD4.js";
|
|
19
19
|
|
|
20
20
|
// src/subcommands/handlers/acp.ts
|
|
21
21
|
import { randomBytes } from "node:crypto";
|
|
22
|
-
import * as
|
|
22
|
+
import * as path2 from "node:path";
|
|
23
23
|
import {
|
|
24
24
|
defaultPermissionPolicy,
|
|
25
25
|
EnsembleRegistry,
|
|
@@ -41,6 +41,7 @@ import { leaderDeliveryHub } from "@wrongstack/core/coordination";
|
|
|
41
41
|
import { WebSocketServer } from "ws";
|
|
42
42
|
|
|
43
43
|
// src/acp-hq-telemetry.ts
|
|
44
|
+
import * as path from "node:path";
|
|
44
45
|
import { AgentStatusTracker } from "@wrongstack/core/coordination";
|
|
45
46
|
import {
|
|
46
47
|
createApprovalRegistry,
|
|
@@ -60,6 +61,15 @@ function startAcpHqTelemetry(options) {
|
|
|
60
61
|
}
|
|
61
62
|
return false;
|
|
62
63
|
};
|
|
64
|
+
const resolveUserInput = (requestId, response, sessionId) => {
|
|
65
|
+
if (sessionId !== void 0) {
|
|
66
|
+
return entries.get(sessionId)?.approvals?.resolveUserInput?.(requestId, response, sessionId) ?? false;
|
|
67
|
+
}
|
|
68
|
+
for (const entry of entries.values()) {
|
|
69
|
+
if (entry.approvals?.resolveUserInput?.(requestId, response) === true) return true;
|
|
70
|
+
}
|
|
71
|
+
return false;
|
|
72
|
+
};
|
|
63
73
|
const connection = startCliHqConnection({
|
|
64
74
|
clientKind: "acp",
|
|
65
75
|
projectRoot: options.projectRoot,
|
|
@@ -70,11 +80,11 @@ function startAcpHqTelemetry(options) {
|
|
|
70
80
|
"mailbox.summary",
|
|
71
81
|
"fleet.summary",
|
|
72
82
|
"session.summary",
|
|
73
|
-
// Approvals are the ONLY control this host
|
|
74
|
-
// the server's gate for any command at
|
|
75
|
-
// everything except `approve`
|
|
76
|
-
//
|
|
77
|
-
// to abort.
|
|
83
|
+
// Approvals and answers to ask_user are the ONLY control this host
|
|
84
|
+
// accepts. `control.receive` is the server's gate for any command at
|
|
85
|
+
// all, so it has to be declared; everything except `approve` and
|
|
86
|
+
// `answer-input` falls through the dispatcher and is refused, because
|
|
87
|
+
// an ACP session has no mailbox to steer and no leader to abort.
|
|
78
88
|
"control.receive",
|
|
79
89
|
"control.approve"
|
|
80
90
|
],
|
|
@@ -83,7 +93,8 @@ function startAcpHqTelemetry(options) {
|
|
|
83
93
|
sessionTag: () => "acp",
|
|
84
94
|
ownsSession: (sessionId) => entries.has(sessionId),
|
|
85
95
|
allowRunCommand: () => false,
|
|
86
|
-
resolveApproval
|
|
96
|
+
resolveApproval,
|
|
97
|
+
resolveUserInput
|
|
87
98
|
})
|
|
88
99
|
});
|
|
89
100
|
const attach = (sessionId, agent, cwd) => {
|
|
@@ -103,7 +114,9 @@ function startAcpHqTelemetry(options) {
|
|
|
103
114
|
// An ACP session works in the directory the client opened, which is
|
|
104
115
|
// not necessarily where the server booted.
|
|
105
116
|
projectRoot: cwd,
|
|
106
|
-
|
|
117
|
+
// A NAME, not a path: the full root is an absolute path (it carries
|
|
118
|
+
// the OS account name) and `projectName` is not a redacted key.
|
|
119
|
+
projectName: options.projectName ?? path.basename(cwd),
|
|
107
120
|
initialAgents: tracker.getAgents(),
|
|
108
121
|
startedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
109
122
|
});
|
|
@@ -592,7 +605,7 @@ var acpCmd = async (args, deps) => {
|
|
|
592
605
|
const sub = args[0];
|
|
593
606
|
const loginIndex = sub === "auth" ? 0 : (sub === "server" || sub === "serve") && args[1] === "auth" ? 1 : -1;
|
|
594
607
|
if (loginIndex >= 0) {
|
|
595
|
-
const { authCmd } = await import("./auth-
|
|
608
|
+
const { authCmd } = await import("./auth-TE55JF4Z.js");
|
|
596
609
|
return authCmd(args.slice(loginIndex + 1), deps);
|
|
597
610
|
}
|
|
598
611
|
if (!sub || sub === "server" || sub === "serve") {
|
|
@@ -709,13 +722,13 @@ async function runACPWebSocketServer(deps, port) {
|
|
|
709
722
|
}
|
|
710
723
|
hqTelemetry = startAcpHqTelemetry({
|
|
711
724
|
projectRoot: deps.cwd ?? process.cwd(),
|
|
712
|
-
projectName:
|
|
725
|
+
projectName: path2.basename(deps.cwd ?? process.cwd()),
|
|
713
726
|
appConfig: deps.config
|
|
714
727
|
});
|
|
715
728
|
const tracked = hqTelemetry.wrapAgentFactory(agentFor);
|
|
716
729
|
wsAgentFactory = agentFor;
|
|
717
730
|
turnFactory = () => makeACPServerAgentTurn({ agentFor: tracked, pendingDeliveries: pendingLeaderDeliveries });
|
|
718
|
-
store = deps.paths?.projectDir ? new ACPSessionStore({ dir:
|
|
731
|
+
store = deps.paths?.projectDir ? new ACPSessionStore({ dir: path2.join(deps.paths.projectDir, "acp-sessions") }) : void 0;
|
|
719
732
|
}
|
|
720
733
|
const acpToken = process.env["WRONGSTACK_ACP_TOKEN"]?.trim() || randomBytes(32).toString("hex");
|
|
721
734
|
const gate = createAcpConnectionGate({ host, port, token: acpToken });
|
|
@@ -830,7 +843,7 @@ async function runACPServer(deps) {
|
|
|
830
843
|
}
|
|
831
844
|
stdioHqTelemetry = startAcpHqTelemetry({
|
|
832
845
|
projectRoot: deps.cwd ?? process.cwd(),
|
|
833
|
-
projectName:
|
|
846
|
+
projectName: path2.basename(deps.cwd ?? process.cwd()),
|
|
834
847
|
appConfig: deps.config
|
|
835
848
|
});
|
|
836
849
|
const stdioAgentFactory = agentFor;
|
|
@@ -838,7 +851,7 @@ async function runACPServer(deps) {
|
|
|
838
851
|
agentFor: stdioHqTelemetry.wrapAgentFactory(agentFor),
|
|
839
852
|
pendingDeliveries: pendingLeaderDeliveries
|
|
840
853
|
});
|
|
841
|
-
const store = deps.paths?.projectDir ? new ACPSessionStore({ dir:
|
|
854
|
+
const store = deps.paths?.projectDir ? new ACPSessionStore({ dir: path2.join(deps.paths.projectDir, "acp-sessions") }) : void 0;
|
|
842
855
|
return {
|
|
843
856
|
runTurn: turn,
|
|
844
857
|
replayFor: turn.replay,
|
|
@@ -1179,4 +1192,4 @@ ${renderAcpBenchText(result)}
|
|
|
1179
1192
|
export {
|
|
1180
1193
|
acpCmd
|
|
1181
1194
|
};
|
|
1182
|
-
//# sourceMappingURL=acp-
|
|
1195
|
+
//# sourceMappingURL=acp-M4565YUW.js.map
|
|
@@ -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
23
|
} from "./chunk-YTEOAWOJ.js";
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import {
|
|
26
|
-
activeProfileConfigPath
|
|
27
|
-
} from "./chunk-YMXXOOFN.js";
|
|
28
|
-
import "./chunk-WSTVGC2C.js";
|
|
29
|
-
import {
|
|
30
|
-
restoreFlags
|
|
31
|
-
} from "./chunk-CSAPOCBP.js";
|
|
32
|
-
import {
|
|
33
|
-
parseAuthFlags
|
|
34
|
-
} from "./chunk-MHEBWVXL.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,
|
|
@@ -42,6 +31,17 @@ import {
|
|
|
42
31
|
nowIso,
|
|
43
32
|
writeKeysBack
|
|
44
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";
|
|
@@ -671,4 +671,4 @@ async function runAuthRemove(deps, providerId) {
|
|
|
671
671
|
export {
|
|
672
672
|
authCmd
|
|
673
673
|
};
|
|
674
|
-
//# sourceMappingURL=auth-
|
|
674
|
+
//# sourceMappingURL=auth-TE55JF4Z.js.map
|
|
@@ -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
|
|
@@ -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,22 @@ 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;
|
|
31
|
+
/**
|
|
32
|
+
* The host's interrupt seam. HQ's "abort leader" and every other remote stop
|
|
33
|
+
* call `abortLeader()`; a one-shot turn has no TUI to rebind it, so this run
|
|
34
|
+
* binds it to its own controller for the duration of the turn.
|
|
35
|
+
*/
|
|
36
|
+
interruptController?: {
|
|
37
|
+
abortLeader: () => boolean;
|
|
38
|
+
} | undefined;
|
|
28
39
|
}
|
|
29
40
|
/**
|
|
30
41
|
* Run a single `agent.run()` turn and render the result.
|
|
@@ -110,6 +110,8 @@ export interface WebUIDispatchContext {
|
|
|
110
110
|
/** Live fleet budget for WebUI concurrency/spawn gauges (issue #323). */
|
|
111
111
|
getFleetBudget?: CliWebUIOptions['getFleetBudget'];
|
|
112
112
|
stopSessionFleet?: CliWebUIOptions['stopSessionFleet'];
|
|
113
|
+
interruptController?: CliWebUIOptions['interruptController'];
|
|
114
|
+
hqFleetControl?: CliWebUIOptions['hqFleetControl'];
|
|
113
115
|
onSessionRetired?: CliWebUIOptions['onSessionRetired'];
|
|
114
116
|
/** The process's single background-delegation auto-wake controller. */
|
|
115
117
|
leaderAutoWake?: CliWebUIOptions['leaderAutoWake'];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `--goal` / `--ask` without a prompt run in the TUI (`--no-tui` still wins).
|
|
3
|
+
*
|
|
4
|
+
* Decided in `boot`, before the composition root reads `flags.tui`: this used
|
|
5
|
+
* to happen in execution.ts, after cli-main had already derived screen
|
|
6
|
+
* ownership and the HQ client kind from it — a goal run painted the TUI but
|
|
7
|
+
* announced itself to HQ as `cli`, with non-TUI stderr behaviour.
|
|
8
|
+
*/
|
|
9
|
+
export declare function applyGoalTuiDefault(flags: Record<string, string | boolean>, positional: readonly string[]): void;
|
|
10
|
+
//# sourceMappingURL=goal-tui-default.d.ts.map
|
|
@@ -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
|
|
@@ -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
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `--output-format stream-json`: single-shot progress as JSON Lines on stdout.
|
|
3
|
+
*
|
|
4
|
+
* One object per line, each with a `type`:
|
|
5
|
+
* init session id, provider/model, cwd, tool names — first line
|
|
6
|
+
* text_delta streamed answer text (only with --include-partial-messages)
|
|
7
|
+
* assistant one model response: text and tool_use blocks, stop reason, usage
|
|
8
|
+
* tool_result one finished tool call: id, name, ok, duration, output preview
|
|
9
|
+
* result the `--output-json` payload — always the last line
|
|
10
|
+
*
|
|
11
|
+
* Only the leader's own activity is streamed. Subagents report through their
|
|
12
|
+
* `subagent.*` events; the ones that reach the host bus under the plain names
|
|
13
|
+
* carry a non-leader `agentId` and are dropped, so a delegating run does not
|
|
14
|
+
* interleave several conversations on one stream.
|
|
15
|
+
*/
|
|
16
|
+
import type { EventBus } from '@wrongstack/core/kernel';
|
|
17
|
+
export type OutputFormat = 'text' | 'json' | 'stream-json';
|
|
18
|
+
/** `undefined` when the flag is absent. Throws on an unknown format. */
|
|
19
|
+
export declare function parseOutputFormat(value: string | boolean | undefined): OutputFormat | undefined;
|
|
20
|
+
export interface StreamJsonOptions {
|
|
21
|
+
events: Pick<EventBus, 'on'>;
|
|
22
|
+
/** Writes one line (the caller adds nothing; this function appends `\n`). */
|
|
23
|
+
write: (line: string) => void;
|
|
24
|
+
includePartialMessages: boolean;
|
|
25
|
+
}
|
|
26
|
+
/** Subscribe and start writing. Returns the unsubscribe function. */
|
|
27
|
+
export declare function startStreamJson(opts: StreamJsonOptions): () => void;
|
|
28
|
+
/** The first line of the stream. */
|
|
29
|
+
export declare function streamJsonInit(info: {
|
|
30
|
+
sessionId: string | null;
|
|
31
|
+
provider: string | null;
|
|
32
|
+
model: string | null;
|
|
33
|
+
cwd: string;
|
|
34
|
+
tools: readonly string[];
|
|
35
|
+
}): string;
|
|
36
|
+
//# sourceMappingURL=stream-json.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { JSONSchema } from '@wrongstack/core/types';
|
|
2
|
+
/** Inline JSON when the value starts with `{`, otherwise a path relative to `cwd`. */
|
|
3
|
+
export declare function resolveJsonSchemaFlag(value: string | boolean | undefined, cwd: string): Promise<JSONSchema | undefined>;
|
|
4
|
+
/** Appended to the user's task. The task stays first: it is the instruction. */
|
|
5
|
+
export declare function withSchemaInstruction(query: string, schema: JSONSchema): string;
|
|
6
|
+
export type StructuredCheck = {
|
|
7
|
+
ok: true;
|
|
8
|
+
value: unknown;
|
|
9
|
+
} | {
|
|
10
|
+
ok: false;
|
|
11
|
+
errors: string[];
|
|
12
|
+
};
|
|
13
|
+
/** Parse and validate a final answer. */
|
|
14
|
+
export declare function checkStructuredAnswer(text: string | undefined, schema: JSONSchema): StructuredCheck;
|
|
15
|
+
export declare function repairPrompt(errors: readonly string[]): string;
|
|
16
|
+
//# sourceMappingURL=structured-output.d.ts.map
|
|
@@ -86,6 +86,8 @@ interface BindSystemPromptBuilderDeps {
|
|
|
86
86
|
tokenSavingMode?: TokenSavingTier | boolean | undefined;
|
|
87
87
|
/** `config.systemPrompt.variant` — selects system.md, system-lite.md, or system-pro.md. */
|
|
88
88
|
systemPromptVariant?: SystemInstructionVariant | undefined;
|
|
89
|
+
/** `--append-system-prompt[-file]` text; appended to the host prompt only. */
|
|
90
|
+
appendedInstructions?: string | undefined;
|
|
89
91
|
paths: SystemPromptBuilderPaths;
|
|
90
92
|
/** Project root, for the Atlas brief. Omit to leave the brief out entirely. */
|
|
91
93
|
projectRoot?: string | undefined;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `--only-tools <names>` and `--disallowed-tools <names>`: a launch-time tool
|
|
3
|
+
* restriction applied to the tool registry (see `ToolRegistry.setSessionRestriction`).
|
|
4
|
+
*
|
|
5
|
+
* `--only-tools` rather than Claude Code's `--tools`: `--tools` is already a
|
|
6
|
+
* boolean of `wstack models add` and the CSV of `wstack mcp serve`, so a value
|
|
7
|
+
* form here would swallow the prompt in `wstack --tools read "task"`.
|
|
8
|
+
*
|
|
9
|
+
* Names are comma- or space-separated; a trailing `*` matches a prefix
|
|
10
|
+
* (`mcp__github__*`). Claude Code's scoped rules (`Bash(git *)`) are refused
|
|
11
|
+
* instead of ignored: dropping a deny rule silently would leave the operator
|
|
12
|
+
* believing a command is blocked when it is not.
|
|
13
|
+
*/
|
|
14
|
+
export interface ToolRestriction {
|
|
15
|
+
only?: string[] | undefined;
|
|
16
|
+
deny: string[];
|
|
17
|
+
/** Set by `--restricted` only (see restricted-mode.ts). */
|
|
18
|
+
denyCapabilities?: readonly string[] | undefined;
|
|
19
|
+
requireDeclaredCapabilities?: boolean | undefined;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* `--allowed-tools <names>`: pre-approve tools (no permission prompt) for this
|
|
23
|
+
* process. Same list syntax and the same refusal of scoped rules — a scoped
|
|
24
|
+
* allow like `Bash(git *)` widened to all of `bash` would approve far more
|
|
25
|
+
* than the operator asked for.
|
|
26
|
+
*/
|
|
27
|
+
export declare function resolveLaunchAllowedTools(flags: Readonly<Record<string, string | boolean>>): string[] | undefined;
|
|
28
|
+
/** `undefined` when neither flag is set. Throws on an unusable value. */
|
|
29
|
+
export declare function resolveToolRestriction(flags: Readonly<Record<string, string | boolean>>): ToolRestriction | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Names in the restriction that match no registered tool — most likely typos.
|
|
32
|
+
* Globs and MCP-style names (`server__tool`) are skipped: MCP servers
|
|
33
|
+
* register after boot, so their absence here proves nothing.
|
|
34
|
+
*/
|
|
35
|
+
export declare function unknownRestrictedToolNames(restriction: ToolRestriction, isRegistered: (name: string) => boolean): string[];
|
|
36
|
+
//# sourceMappingURL=tool-restriction-flags.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { SessionSummary } from '@wrongstack/core/types';
|
|
2
|
+
import type { GitWorktreeEntry } from '@wrongstack/core/worktree';
|
|
3
|
+
export interface WorktreeRef {
|
|
4
|
+
root: string;
|
|
5
|
+
name: string;
|
|
6
|
+
branch?: string | undefined;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The other worktree a session belongs to, or undefined when it ran in the
|
|
10
|
+
* current checkout, in a checkout git no longer lists (resuming it here is
|
|
11
|
+
* the only option left), or before checkouts were recorded.
|
|
12
|
+
*/
|
|
13
|
+
export declare function worktreeOfSession(summary: Pick<SessionSummary, 'checkout'>, worktrees: readonly GitWorktreeEntry[]): WorktreeRef | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Wrap the resume callback: a session that belongs to another worktree
|
|
16
|
+
* (per `lookup`, filled from the last listing) first switches the TUI to that
|
|
17
|
+
* worktree, then resumes there. A failed switch rejects, which the picker
|
|
18
|
+
* shows, and leaves the current project untouched.
|
|
19
|
+
*/
|
|
20
|
+
export declare function withWorktreeSwitch<A extends unknown[], R>(resume: (sessionId: string, ...rest: A) => Promise<R>, lookup: (sessionId: string) => WorktreeRef | undefined, switchProject: (root: string, name: string) => Promise<string | null>): (sessionId: string, ...rest: A) => Promise<R>;
|
|
21
|
+
//# sourceMappingURL=worktree-sessions.d.ts.map
|