@wrongstack/cli 0.306.3 → 0.307.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{auth-L3WGSGDX.js → auth-TVOOHL4Q.js} +45 -106
- package/dist/boot/short-circuit-flags.d.ts +2 -2
- package/dist/chimera-cascade-evidence.d.ts +1 -1
- package/dist/chunk-2VMJ3E5Z.js +71 -0
- package/dist/{chunk-5N34EWJR.js → chunk-2ZNBRZ4W.js} +2 -2
- package/dist/{chunk-RHLQT3EV.js → chunk-CB35UVXO.js} +1636 -1528
- package/dist/{chunk-YKBRFSGL.js → chunk-DOJLAULS.js} +28 -28
- package/dist/{chunk-JUHRI6OV.js → chunk-G7337TTK.js} +24 -5
- package/dist/{chunk-KXN5HZDL.js → chunk-PKHGLWUJ.js} +24 -6
- package/dist/{chunk-HITHEXE3.js → chunk-TOG7OMKJ.js} +2 -2
- package/dist/{chunk-ARWGQUB3.js → chunk-XSG33WHN.js} +15 -5
- package/dist/{cli-main-3PUWFKSL.js → cli-main-YDOZZOZA.js} +29026 -28205
- package/dist/cli-main.d.ts +0 -20
- package/dist/{execution-4IG5XKOL.js → execution-CGT6J5ZN.js} +306 -274
- package/dist/fleet/host-learning-scheduler.d.ts +27 -0
- package/dist/fleet/host-shadow-manager.d.ts +64 -0
- package/dist/fleet/host.d.ts +5 -140
- package/dist/{hq-ZK6PGN3W.js → hq-PA6RH2UW.js} +2 -2
- package/dist/hq-server/mailbox-gateway-manager.d.ts +32 -0
- package/dist/hq-server/routes/auth/bootstrap-routes.d.ts +5 -0
- package/dist/hq-server/routes/auth/common.d.ts +11 -0
- package/dist/hq-server/routes/auth/password-routes.d.ts +9 -0
- package/dist/hq-server/routes/auth/session-audit-routes.d.ts +6 -0
- package/dist/hq-server/routes/auth/totp-routes.d.ts +9 -0
- package/dist/hq-server/routes/auth-handlers.d.ts +5 -132
- package/dist/hq-server/routes/command-handlers.d.ts +7 -0
- package/dist/hq-server/routes/data-handlers.d.ts +8 -0
- package/dist/hq-server/routes/mailbox-handlers.d.ts +22 -0
- package/dist/hq-server/routes.d.ts +3 -3
- package/dist/hq-server/server-lifecycle.d.ts +37 -0
- package/dist/hq-server/snapshot.d.ts +6 -5
- package/dist/hq-server/types.d.ts +4 -0
- package/dist/hq-server/upgrade-handler.d.ts +34 -0
- package/dist/hq-server/ws-client-events.d.ts +25 -0
- package/dist/hq-server/ws-leader.d.ts +47 -0
- package/dist/hq-server/ws-resume.d.ts +27 -0
- package/dist/hq-server/ws.d.ts +4 -71
- package/dist/{hq-server-IVZLVCFV.js → hq-server-PBRU275L.js} +2 -2
- package/dist/hq-server.d.ts +0 -38
- package/dist/index.js +1267 -122
- package/dist/{mcp-JNWEQ6T2.js → mcp-CMLFHRG2.js} +19 -9
- package/dist/mcp-serve.d.ts +31 -1
- package/dist/{modeldiag-6VS5KDP5.js → modeldiag-ICMPHT5L.js} +868 -831
- package/dist/{project-manifest-GE25PW4S.js → project-manifest-YFTJ3D5N.js} +2 -2
- package/dist/{project-picker-BOCWHBXP.js → project-picker-R5TYAE3Q.js} +3 -3
- package/dist/{providers-models-HQN3AT3K.js → providers-models-4FAKM2WO.js} +4 -4
- package/dist/repl-eternal-loop.d.ts +8 -0
- package/dist/repl-goal-banner.d.ts +21 -0
- package/dist/slash-commands/brain-council.d.ts +36 -0
- package/dist/slash-commands/brain-status.d.ts +12 -0
- package/dist/slash-commands/fallback.d.ts +6 -0
- package/dist/slash-commands/kanban-board-handlers.d.ts +13 -0
- package/dist/slash-commands/kanban-lifecycle-diagnostics.d.ts +16 -0
- package/dist/slash-commands/kanban-task-subcommands.d.ts +8 -0
- package/dist/slash-commands/memory-audience.d.ts +14 -0
- package/dist/slash-commands/memory-gather.d.ts +9 -0
- package/dist/slash-commands/memory-stats.d.ts +5 -0
- package/dist/slash-commands/settings-mutations.d.ts +6 -0
- package/dist/slash-commands/settings-view.d.ts +5 -0
- package/dist/subcommands/handlers/modeldiag-bench.d.ts +10 -0
- package/dist/subcommands/handlers/modeldiag-eval.d.ts +27 -0
- package/dist/subcommands/handlers/modeldiag-test.d.ts +8 -0
- package/dist/{version-help-ASKQYXDJ.js → version-help-TFD6VPF3.js} +2 -2
- package/dist/vibe-protocol-wiring.d.ts +10 -0
- package/dist/webui-server/credential-watcher.d.ts +15 -0
- package/dist/webui-server/domain-handlers.d.ts +21 -0
- package/dist/webui-server/route-contexts.d.ts +41 -0
- package/dist/{webui-server-FTG7JAZU.js → webui-server-IPHGJGXE.js} +515 -437
- package/dist/wiring/cli-execute-builder.d.ts +88 -0
- package/dist/wiring/cli-heap-watchdog.d.ts +33 -0
- package/dist/wiring/cli-prompt-and-tools-setup.d.ts +25 -0
- package/dist/wiring/cli-slash-commands-setup.d.ts +79 -0
- package/dist/wiring/heap-watchdog-setup.d.ts +53 -0
- package/dist/wiring/metrics.d.ts +1 -0
- package/dist/wiring/replay-governance-setup.d.ts +31 -0
- package/package.json +27 -27
|
@@ -38,11 +38,12 @@ var AllowAllPermissionPolicy = class extends AutoApprovePermissionPolicy {
|
|
|
38
38
|
return { permission: "auto", source: "default" };
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
|
-
function parseToolsFlag(flags) {
|
|
41
|
+
function parseToolsFlag(flags, positional) {
|
|
42
42
|
const raw = flags["tools"];
|
|
43
|
-
|
|
43
|
+
const csv = typeof raw === "string" ? raw : raw === true ? positional?.[0] ?? "" : "";
|
|
44
|
+
if (!csv) return null;
|
|
44
45
|
const set = new Set(
|
|
45
|
-
|
|
46
|
+
csv.split(",").map((s) => s.trim()).filter(Boolean)
|
|
46
47
|
);
|
|
47
48
|
return set.size > 0 ? set : null;
|
|
48
49
|
}
|
|
@@ -146,6 +147,9 @@ function mimeTypeFor(file) {
|
|
|
146
147
|
function isTextMime(mimeType) {
|
|
147
148
|
return mimeType.startsWith("text/") || mimeType === "application/json" || mimeType === "application/yaml";
|
|
148
149
|
}
|
|
150
|
+
function resolveServeFsRestriction(config) {
|
|
151
|
+
return config.tools?.restrictToProjectRoot ?? true;
|
|
152
|
+
}
|
|
149
153
|
function makeServeContext(cwd, projectRoot, signal, restrictFsToRoot = true) {
|
|
150
154
|
const provider = {
|
|
151
155
|
id: "mcp-serve",
|
|
@@ -187,10 +191,16 @@ async function selectExposedTools(registry, ctx, policy, whitelist) {
|
|
|
187
191
|
}
|
|
188
192
|
return allowed;
|
|
189
193
|
}
|
|
190
|
-
async function serveMcpStdio(deps) {
|
|
194
|
+
async function serveMcpStdio(deps, positional) {
|
|
191
195
|
const flags = deps.flags ?? {};
|
|
192
196
|
const yolo = flags["yolo"] === true || flags["allow-all"] === true;
|
|
193
|
-
const whitelist = parseToolsFlag(flags);
|
|
197
|
+
const whitelist = parseToolsFlag(flags, positional);
|
|
198
|
+
if (flags["tools"] !== void 0 && whitelist === null) {
|
|
199
|
+
process.stderr.write(
|
|
200
|
+
"wrongstack MCP server: --tools requires a comma-separated tool list (e.g. `--tools read,grep` or `--tools=read,grep`)\n"
|
|
201
|
+
);
|
|
202
|
+
return 1;
|
|
203
|
+
}
|
|
194
204
|
const log = (m) => process.stderr.write(`${m}
|
|
195
205
|
`);
|
|
196
206
|
let selectedContent;
|
|
@@ -213,7 +223,7 @@ async function serveMcpStdio(deps) {
|
|
|
213
223
|
deps.cwd,
|
|
214
224
|
deps.projectRoot,
|
|
215
225
|
controller.signal,
|
|
216
|
-
deps.config
|
|
226
|
+
resolveServeFsRestriction(deps.config)
|
|
217
227
|
);
|
|
218
228
|
const permissionPolicy = yolo ? new AllowAllPermissionPolicy() : new AutoApprovePermissionPolicy();
|
|
219
229
|
const executor = new ToolExecutor(registry, {
|
|
@@ -253,7 +263,7 @@ async function serveMcpStdio(deps) {
|
|
|
253
263
|
deps.cwd,
|
|
254
264
|
deps.projectRoot,
|
|
255
265
|
controller.signal,
|
|
256
|
-
deps.config
|
|
266
|
+
resolveServeFsRestriction(deps.config)
|
|
257
267
|
);
|
|
258
268
|
const batch = await executor.executeBatch([use], requestCtx, "sequential");
|
|
259
269
|
const result = batch.outputs[0]?.result;
|
|
@@ -322,7 +332,7 @@ var mcpCmd = async (args, deps) => {
|
|
|
322
332
|
args = restoreFlags(args, deps, ["enable", "e", "transport", "url", "command"]);
|
|
323
333
|
const sub = args[0];
|
|
324
334
|
if (sub === "serve") {
|
|
325
|
-
return serveMcpStdio(deps);
|
|
335
|
+
return serveMcpStdio(deps, args.slice(1));
|
|
326
336
|
}
|
|
327
337
|
if (!sub || sub === "list") {
|
|
328
338
|
const servers = deps.config.mcpServers ?? {};
|
|
@@ -429,4 +439,4 @@ function isRecord(value) {
|
|
|
429
439
|
export {
|
|
430
440
|
mcpCmd
|
|
431
441
|
};
|
|
432
|
-
//# sourceMappingURL=mcp-
|
|
442
|
+
//# sourceMappingURL=mcp-CMLFHRG2.js.map
|
package/dist/mcp-serve.d.ts
CHANGED
|
@@ -3,12 +3,42 @@ import { ToolRegistry } from '@wrongstack/core/registry';
|
|
|
3
3
|
import type { PermissionPolicy, Tool } from '@wrongstack/core/types';
|
|
4
4
|
import { type MCPServerPrompt, type MCPServerResource } from '@wrongstack/mcp';
|
|
5
5
|
import type { SubcommandDeps } from './subcommands/index.js';
|
|
6
|
+
/**
|
|
7
|
+
* Resolve the `--tools` whitelist for `mcp serve`.
|
|
8
|
+
*
|
|
9
|
+
* `'tools'` is in BOOLEAN_FLAGS (a `models add` capability toggle), so
|
|
10
|
+
* parseArgs turns the space form `mcp serve --tools read,grep` into
|
|
11
|
+
* `tools: true` plus a positional CSV instead of a string value. Accept both
|
|
12
|
+
* shapes: a string value directly, or `true` + the following positional CSV.
|
|
13
|
+
* Returns null only when no list was supplied at all — callers must treat
|
|
14
|
+
* "flag present but no list" as an error, never as "no whitelist".
|
|
15
|
+
*/
|
|
16
|
+
export declare function parseToolsFlag(flags: Record<string, string | boolean>, positional?: readonly string[]): Set<string> | null;
|
|
6
17
|
export interface SelectedMcpServeContent {
|
|
7
18
|
resources: MCPServerResource[];
|
|
8
19
|
prompts: MCPServerPrompt[];
|
|
9
20
|
}
|
|
10
21
|
/** Load only files explicitly named by trusted CLI flags; nothing is auto-discovered. */
|
|
11
22
|
export declare function loadSelectedMcpServeContent(flags: Record<string, string | boolean>, cwd: string): Promise<SelectedMcpServeContent>;
|
|
23
|
+
/**
|
|
24
|
+
* Whether the file tools are confined to the project root for `mcp serve`.
|
|
25
|
+
*
|
|
26
|
+
* `mcp serve` is the one surface where the file tools are driven by a REMOTE
|
|
27
|
+
* caller, so an unset config must inherit containment rather than invert it —
|
|
28
|
+
* an unset value here previously became `false`, which short-circuited
|
|
29
|
+
* `ensureInsideRoot` and let `tools/call read` return `~/.ssh/id_rsa`.
|
|
30
|
+
*
|
|
31
|
+
* This lives in one exported function rather than as a literal repeated at each
|
|
32
|
+
* call site so the invariant is testable and a third call site cannot quietly
|
|
33
|
+
* reintroduce the wrong default. Only a trusted user config can opt out:
|
|
34
|
+
* `tools.restrictToProjectRoot` is on the in-project denylist, so a
|
|
35
|
+
* checked-out repository cannot reach it.
|
|
36
|
+
*/
|
|
37
|
+
export declare function resolveServeFsRestriction(config: {
|
|
38
|
+
tools?: {
|
|
39
|
+
restrictToProjectRoot?: boolean | undefined;
|
|
40
|
+
} | undefined;
|
|
41
|
+
}): boolean;
|
|
12
42
|
/** Minimal run context — tools read cwd/projectRoot/signal; provider/session are stubs. */
|
|
13
43
|
export declare function makeServeContext(cwd: string, projectRoot: string, signal: AbortSignal, restrictFsToRoot?: boolean): Context;
|
|
14
44
|
/**
|
|
@@ -19,5 +49,5 @@ export declare function makeServeContext(cwd: string, projectRoot: string, signa
|
|
|
19
49
|
* Exported for testing — the live path calls it inside `serveMcpStdio`.
|
|
20
50
|
*/
|
|
21
51
|
export declare function selectExposedTools(registry: ToolRegistry, ctx: Context, policy: PermissionPolicy, whitelist: Set<string> | null): Promise<Tool[]>;
|
|
22
|
-
export declare function serveMcpStdio(deps: SubcommandDeps): Promise<number>;
|
|
52
|
+
export declare function serveMcpStdio(deps: SubcommandDeps, positional?: readonly string[]): Promise<number>;
|
|
23
53
|
//# sourceMappingURL=mcp-serve.d.ts.map
|