@wrongstack/cli 0.298.3 → 0.300.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/{acp-S4LZQB66.js → acp-IDNS2YVE.js} +3 -3
- package/dist/{auth-G5YKKSRH.js → auth-6T6ZOT2R.js} +5 -5
- package/dist/auth-menu/loopback-server.d.ts +41 -55
- package/dist/auth-menu/openai-codex-oauth.d.ts +36 -123
- package/dist/auto-discover-providers-DRW4OZHG.js +8 -0
- package/dist/boot/dispatch-webui.d.ts +3 -0
- package/dist/{chunk-PEKUKUCH.js → chunk-3MWUZMOL.js} +19 -12
- package/dist/{chunk-TGDHN4LM.js → chunk-4GVH7V3S.js} +4 -24
- package/dist/{chunk-4U3DMA2Y.js → chunk-4WJKVQJY.js} +15 -20
- package/dist/{chunk-C5GH4YBL.js → chunk-GYDQABMA.js} +271 -182
- package/dist/{chunk-4HH3YGG4.js → chunk-MRLYDHQ7.js} +8 -5
- package/dist/{chunk-66T43Q4Y.js → chunk-N7ULWBO5.js} +4 -3
- package/dist/{chunk-ZNZJ34RF.js → chunk-PEMN4T5O.js} +2 -2
- package/dist/chunk-PYTFS4MC.js +238 -0
- package/dist/{chunk-L5CE52XW.js → chunk-V76R7DC5.js} +25 -19
- package/dist/{cli-main-ZDZMCVLM.js → cli-main-7B3G2YSG.js} +943 -160
- package/dist/{execution-BY556FCF.js → execution-SHGM7BVC.js} +76 -8
- package/dist/fleet/budget-source.d.ts +18 -0
- package/dist/fleet/host-status.d.ts +31 -0
- package/dist/fleet/host-types.d.ts +8 -0
- package/dist/fleet/host.d.ts +5 -0
- package/dist/{hq-WO6CLUSI.js → hq-DVDD4XPV.js} +22 -3
- package/dist/hq-server/auth-state.d.ts +29 -1
- package/dist/hq-server/auth.d.ts +16 -0
- package/dist/hq-server/client-address.d.ts +56 -0
- package/dist/hq-server/login-attempt-store.d.ts +30 -10
- package/dist/hq-server/routes/auth-handlers.d.ts +66 -26
- package/dist/hq-server/routes.d.ts +13 -0
- package/dist/hq-server/types.d.ts +10 -0
- package/dist/{hq-server-6TSAORAC.js → hq-server-DQHLNHDL.js} +2 -2
- package/dist/hq-server.d.ts +19 -0
- package/dist/index.js +20 -20
- package/dist/{modeldiag-HENYJ4N7.js → modeldiag-YOQZHBQV.js} +2 -2
- package/dist/{plugin-usage-VTL7ZTVC.js → plugin-usage-EOG4ET4S.js} +2 -2
- package/dist/{plugins-ETY6W3DC.js → plugins-56CMWMPR.js} +3 -3
- package/dist/{providers-models-GDELBHZK.js → providers-models-K6RT7ABI.js} +34 -9
- package/dist/slash-commands/command-context.d.ts +19 -0
- package/dist/slash-commands/intake.d.ts +4 -0
- package/dist/slash-commands/memory-triage.d.ts +47 -0
- package/dist/webui-server/setup-events.d.ts +17 -0
- package/dist/webui-server/terminal-log-view.d.ts +29 -12
- package/dist/{webui-server-PCLSXX6L.js → webui-server-G3EKFXLL.js} +109 -38
- package/dist/webui-server-options.d.ts +16 -0
- package/dist/wiring/brain-and-orchestration.d.ts +3 -0
- package/dist/wiring/director-setup.d.ts +4 -0
- package/dist/wiring/fallback-gate.d.ts +31 -0
- package/dist/wiring/fleet-command-handlers.d.ts +1 -1
- package/dist/wiring/plugins.d.ts +2 -8
- package/dist/wiring/provider-utility-tools.d.ts +26 -1
- package/package.json +23 -22
- package/dist/chunk-GO3TJICK.js +0 -489
|
@@ -16,6 +16,7 @@ import type { createMailboxHttpRouter } from '@wrongstack/core/coordination';
|
|
|
16
16
|
import { type Mailbox, type MailboxHttpAccessDecision, type MailboxHttpRateLimiter } from '@wrongstack/core/coordination';
|
|
17
17
|
import * as HqServerAuth from './auth.js';
|
|
18
18
|
import * as HqServerUtils from './utils.js';
|
|
19
|
+
import { type ApplyHqAuthFile } from './routes/auth-handlers.js';
|
|
19
20
|
export declare const setHqSecurityHeaders: typeof HqServerAuth.setHqSecurityHeaders;
|
|
20
21
|
export declare const hasTrustedBrowserOrigin: typeof HqServerAuth.hasTrustedBrowserOrigin;
|
|
21
22
|
export declare const authenticateBrowserRequest: typeof HqServerAuth.authenticateBrowserRequest;
|
|
@@ -77,6 +78,18 @@ export interface HqRouterDeps {
|
|
|
77
78
|
getTokenStats?: (() => HqSnapshot['totals']['tokenStats'] | undefined) | undefined;
|
|
78
79
|
/** One-time bootstrap code store for token-to-cookie exchange. */
|
|
79
80
|
bootstrapStore?: import('@wrongstack/core/hq').HqBootstrapCodeStore | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* Applies a freshly-persisted `auth.json` to live server state. Bound to
|
|
83
|
+
* `HqAuthState.apply` so the in-process mutation routes share one projection
|
|
84
|
+
* — and one WS-010 exposure re-assessment — with the reload watcher.
|
|
85
|
+
*/
|
|
86
|
+
applyAuthFile: ApplyHqAuthFile;
|
|
87
|
+
/**
|
|
88
|
+
* How many trusted reverse proxies sit in front of this server. Only used to
|
|
89
|
+
* resolve the address the login backoff keys on — see `client-address.ts`.
|
|
90
|
+
* Defaults to 0, which ignores `X-Forwarded-For` entirely.
|
|
91
|
+
*/
|
|
92
|
+
trustedProxyHops?: number | undefined;
|
|
80
93
|
}
|
|
81
94
|
/**
|
|
82
95
|
* Create the HTTP request listener that handles all `/api/*` routes as well
|
|
@@ -83,6 +83,16 @@ export interface HqRouterMutableAuth {
|
|
|
83
83
|
totpPendingSecret?: string | undefined;
|
|
84
84
|
/** SHA-256 hashes of single-use recovery codes (live-reloaded from auth.json). */
|
|
85
85
|
totpRecoveryCodes?: string[] | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* Highest TOTP time-step counter already spent on a successful login
|
|
88
|
+
* (RFC 6238 §5.2 single-use). The ±1-step validation window keeps a code
|
|
89
|
+
* arithmetically valid for ~90s, so without this a code captured in transit
|
|
90
|
+
* — shoulder-surfed, read off a notification, replayed from a proxy log —
|
|
91
|
+
* authenticates a second time. Deliberately process-local and NOT persisted
|
|
92
|
+
* to auth.json: a code cannot outlive its own window, so a restart losing
|
|
93
|
+
* the marker costs at most the tail of one step.
|
|
94
|
+
*/
|
|
95
|
+
totpLastUsedCounter?: number | undefined;
|
|
86
96
|
alertRules: HqAlertRuleConfig | undefined;
|
|
87
97
|
/**
|
|
88
98
|
* WS-010: set when the live bind would become unauthenticated and
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
readLocalSubagentTranscript,
|
|
16
16
|
sanitizeApiError,
|
|
17
17
|
startHqServer
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-GYDQABMA.js";
|
|
19
19
|
import "./chunk-Q5GTM25S.js";
|
|
20
20
|
import "./chunk-7OCVIDC7.js";
|
|
21
21
|
export {
|
|
@@ -36,4 +36,4 @@ export {
|
|
|
36
36
|
sanitizeApiError,
|
|
37
37
|
startHqServer
|
|
38
38
|
};
|
|
39
|
-
//# sourceMappingURL=hq-server-
|
|
39
|
+
//# sourceMappingURL=hq-server-DQHLNHDL.js.map
|
package/dist/hq-server.d.ts
CHANGED
|
@@ -60,6 +60,25 @@ export interface HqServerOptions {
|
|
|
60
60
|
* `--hq-token-ttl-ms` CLI flag.
|
|
61
61
|
*/
|
|
62
62
|
tokenTtlMs?: number;
|
|
63
|
+
/**
|
|
64
|
+
* How many trusted reverse proxies sit between a browser and this server.
|
|
65
|
+
* Controls which address the login backoff keys on (WS-106).
|
|
66
|
+
*
|
|
67
|
+
* Default `0`: `X-Forwarded-For` is ignored entirely and the socket peer is
|
|
68
|
+
* used — correct for a direct bind, and the only safe default, because the
|
|
69
|
+
* header is client-supplied and honouring it unasked would let an attacker
|
|
70
|
+
* mint a fresh rate-limit identity per request.
|
|
71
|
+
*
|
|
72
|
+
* Set it to the real hop count when HQ runs behind a tunnel or relay
|
|
73
|
+
* (`--hq-public-url`, `--hq-require-browser-auth`). Without it every request
|
|
74
|
+
* arrives from the tunnel's own address, so all users share one backoff
|
|
75
|
+
* bucket: one attacker locks out everyone, and a distributed attacker is not
|
|
76
|
+
* limited per-source at all. `1` covers the common single-tunnel case.
|
|
77
|
+
*
|
|
78
|
+
* Only the rightmost `n` forwarded entries are ever read — see
|
|
79
|
+
* `hq-server/client-address.ts`. Set via `--hq-trusted-proxy-hops`.
|
|
80
|
+
*/
|
|
81
|
+
trustedProxyHops?: number;
|
|
63
82
|
}
|
|
64
83
|
export interface HqStartupConnectionInfo {
|
|
65
84
|
dataDir: string;
|
package/dist/index.js
CHANGED
|
@@ -13,20 +13,20 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
patchConfig
|
|
15
15
|
} from "./chunk-TYO2OVAD.js";
|
|
16
|
+
import {
|
|
17
|
+
DEFAULT_PORT
|
|
18
|
+
} from "./chunk-GYDQABMA.js";
|
|
19
|
+
import "./chunk-Q5GTM25S.js";
|
|
16
20
|
import {
|
|
17
21
|
helpCmd,
|
|
18
22
|
versionCmd
|
|
19
23
|
} from "./chunk-ARWGQUB3.js";
|
|
20
|
-
import {
|
|
21
|
-
discoverAndMergeProviders
|
|
22
|
-
} from "./chunk-TGDHN4LM.js";
|
|
23
|
-
import {
|
|
24
|
-
DEFAULT_PORT
|
|
25
|
-
} from "./chunk-C5GH4YBL.js";
|
|
26
|
-
import "./chunk-Q5GTM25S.js";
|
|
27
24
|
import {
|
|
28
25
|
CLI_VERSION
|
|
29
26
|
} from "./chunk-XJXDOF63.js";
|
|
27
|
+
import {
|
|
28
|
+
discoverAndMergeProviders
|
|
29
|
+
} from "./chunk-4GVH7V3S.js";
|
|
30
30
|
import {
|
|
31
31
|
runUpdateCommand
|
|
32
32
|
} from "./chunk-I5MEUFDI.js";
|
|
@@ -36,11 +36,11 @@ import {
|
|
|
36
36
|
parseArgs,
|
|
37
37
|
runPicker,
|
|
38
38
|
saveToGlobalConfig
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-PEMN4T5O.js";
|
|
40
40
|
import {
|
|
41
41
|
isKeylessLocalProvider,
|
|
42
42
|
visibleModelIds
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-N7ULWBO5.js";
|
|
44
44
|
import {
|
|
45
45
|
mutateConfigProviders,
|
|
46
46
|
normalizeKeys,
|
|
@@ -1495,9 +1495,9 @@ function compactSingleLine(text) {
|
|
|
1495
1495
|
|
|
1496
1496
|
// src/subcommands/index.ts
|
|
1497
1497
|
var loaders = {
|
|
1498
|
-
acp: async () => (await import("./acp-
|
|
1498
|
+
acp: async () => (await import("./acp-IDNS2YVE.js")).acpCmd,
|
|
1499
1499
|
init: async () => (await import("./init-E2NDDOHI.js")).initCmd,
|
|
1500
|
-
auth: async () => (await import("./auth-
|
|
1500
|
+
auth: async () => (await import("./auth-6T6ZOT2R.js")).authCmd,
|
|
1501
1501
|
update: async () => (await import("./update-MV6TUACD.js")).updateCmd,
|
|
1502
1502
|
sessions: async () => (await import("./sessions-config-NLCMK3BY.js")).sessionsCmd,
|
|
1503
1503
|
config: async () => (await import("./sessions-config-NLCMK3BY.js")).configCmd,
|
|
@@ -1506,23 +1506,23 @@ var loaders = {
|
|
|
1506
1506
|
audit: async () => (await import("./audit-2ZSFGNIF.js")).auditCmd,
|
|
1507
1507
|
tools: async () => (await import("./tools-skills-UNKLOB7M.js")).toolsCmd,
|
|
1508
1508
|
skills: async () => (await import("./tools-skills-UNKLOB7M.js")).skillsCmd,
|
|
1509
|
-
providers: async () => (await import("./providers-models-
|
|
1510
|
-
models: async () => (await import("./providers-models-
|
|
1509
|
+
providers: async () => (await import("./providers-models-K6RT7ABI.js")).providersCmd,
|
|
1510
|
+
models: async () => (await import("./providers-models-K6RT7ABI.js")).modelsCmd,
|
|
1511
1511
|
mcp: async () => (await import("./mcp-CYLPUEHC.js")).mcpCmd,
|
|
1512
|
-
plugin: async () => (await import("./plugin-usage-
|
|
1513
|
-
plugins: async () => (await import("./plugin-usage-
|
|
1512
|
+
plugin: async () => (await import("./plugin-usage-EOG4ET4S.js")).pluginCmd,
|
|
1513
|
+
plugins: async () => (await import("./plugin-usage-EOG4ET4S.js")).pluginCmd,
|
|
1514
1514
|
diag: async () => (await import("./diag-doctor-OQ3AA63O.js")).diagCmd,
|
|
1515
1515
|
doctor: async () => (await import("./diag-doctor-OQ3AA63O.js")).doctorCmd,
|
|
1516
1516
|
export: async () => (await import("./export-TPORYVRZ.js")).exportCmd,
|
|
1517
|
-
usage: async () => (await import("./plugin-usage-
|
|
1517
|
+
usage: async () => (await import("./plugin-usage-EOG4ET4S.js")).usageCmd,
|
|
1518
1518
|
version: async () => (await import("./version-help-ASKQYXDJ.js")).versionCmd,
|
|
1519
1519
|
help: async () => (await import("./version-help-ASKQYXDJ.js")).helpCmd,
|
|
1520
1520
|
projects: async () => (await import("./projects-XE76NFNZ.js")).projectsCmd,
|
|
1521
|
-
modeldiag: async () => (await import("./modeldiag-
|
|
1521
|
+
modeldiag: async () => (await import("./modeldiag-YOQZHBQV.js")).modeldiagCmd,
|
|
1522
1522
|
quick: async () => (await import("./quick-VIO2BEHS.js")).quickCmd,
|
|
1523
1523
|
bench: async () => (await import("./bench-7ZDWSNEF.js")).benchCmd,
|
|
1524
1524
|
chronicle: async () => (await import("./chronicle-QQEQFSSE.js")).chronicleCmd,
|
|
1525
|
-
hq: async () => (await import("./hq-
|
|
1525
|
+
hq: async () => (await import("./hq-DVDD4XPV.js")).hqCmd,
|
|
1526
1526
|
mailbox: async () => (await import("./mailbox-serve-DBOOOOWZ.js")).mailboxServeCmd,
|
|
1527
1527
|
permissions: async () => (await import("./permissions-FNYLZIL4.js")).permissionsCmd,
|
|
1528
1528
|
project: async () => (await import("./project-BLQ3ALVL.js")).projectCmd,
|
|
@@ -2159,7 +2159,7 @@ async function isPortInUse(host, port) {
|
|
|
2159
2159
|
}
|
|
2160
2160
|
async function handleHqShortCircuit(flags) {
|
|
2161
2161
|
if (flags["hq"] !== true) return null;
|
|
2162
|
-
const { startHqServer } = await import("./hq-server-
|
|
2162
|
+
const { startHqServer } = await import("./hq-server-DQHLNHDL.js");
|
|
2163
2163
|
const tunnelRequested = flags["tunnel"] === true;
|
|
2164
2164
|
const host = typeof flags["host"] === "string" ? flags["host"] : tunnelRequested ? "127.0.0.1" : HQ_CLI_DEFAULT_HOST;
|
|
2165
2165
|
if (tunnelRequested && !isLoopbackHost(host)) {
|
|
@@ -3149,7 +3149,7 @@ async function initializeCli(argv) {
|
|
|
3149
3149
|
async function main(argv) {
|
|
3150
3150
|
const cliCtx = await initializeCli(argv);
|
|
3151
3151
|
if (typeof cliCtx === "number") return cliCtx;
|
|
3152
|
-
const { runInteractive } = await import("./cli-main-
|
|
3152
|
+
const { runInteractive } = await import("./cli-main-7B3G2YSG.js");
|
|
3153
3153
|
return runInteractive(cliCtx);
|
|
3154
3154
|
}
|
|
3155
3155
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
discoverAndMergeProviders
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4GVH7V3S.js";
|
|
4
4
|
import {
|
|
5
5
|
mutateConfigProviders,
|
|
6
6
|
normalizeKeys,
|
|
@@ -1287,4 +1287,4 @@ ${color2.dim('Enter numbers or provider IDs (comma-separated, or "all"):')}
|
|
|
1287
1287
|
export {
|
|
1288
1288
|
modeldiagCmd
|
|
1289
1289
|
};
|
|
1290
|
-
//# sourceMappingURL=modeldiag-
|
|
1290
|
+
//# sourceMappingURL=modeldiag-YOQZHBQV.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runPluginManagementCommand
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3MWUZMOL.js";
|
|
4
4
|
import {
|
|
5
5
|
activeProfileConfigPath
|
|
6
6
|
} from "./chunk-DPJZQCVP.js";
|
|
@@ -37,4 +37,4 @@ export {
|
|
|
37
37
|
pluginCmd,
|
|
38
38
|
usageCmd
|
|
39
39
|
};
|
|
40
|
-
//# sourceMappingURL=plugin-usage-
|
|
40
|
+
//# sourceMappingURL=plugin-usage-EOG4ET4S.js.map
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
pluginNameFromSpec,
|
|
8
8
|
setupPlugins,
|
|
9
9
|
warnIfDeprecatedPluginName
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-4WJKVQJY.js";
|
|
11
|
+
import "./chunk-3MWUZMOL.js";
|
|
12
12
|
import "./chunk-TYO2OVAD.js";
|
|
13
13
|
import "./chunk-7OCVIDC7.js";
|
|
14
14
|
export {
|
|
@@ -21,4 +21,4 @@ export {
|
|
|
21
21
|
setupPlugins,
|
|
22
22
|
warnIfDeprecatedPluginName
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=plugins-
|
|
24
|
+
//# sourceMappingURL=plugins-56CMWMPR.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
visibleModelIds
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-N7ULWBO5.js";
|
|
4
4
|
import {
|
|
5
5
|
mutateConfigProviders
|
|
6
6
|
} from "./chunk-PJHET45A.js";
|
|
@@ -127,7 +127,7 @@ var modelsCmd = async (args, deps) => {
|
|
|
127
127
|
return 1;
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
const flags =
|
|
130
|
+
const flags = subcommandFlags(args, deps);
|
|
131
131
|
const search = typeof flags["search"] === "string" ? flags["search"].toLowerCase() : "";
|
|
132
132
|
const perPage = Number(flags["per-page"]) > 0 ? Number(flags["per-page"]) : DEFAULT_PER_PAGE;
|
|
133
133
|
const page = Math.max(1, Number(flags["page"]) || 1);
|
|
@@ -138,10 +138,10 @@ var modelsCmd = async (args, deps) => {
|
|
|
138
138
|
);
|
|
139
139
|
return 1;
|
|
140
140
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
141
|
+
const { providerId: lookupId, provider } = await getCatalogProviderForConfigProvider(
|
|
142
|
+
providerId,
|
|
143
|
+
deps
|
|
144
|
+
);
|
|
145
145
|
if (!provider) {
|
|
146
146
|
deps.renderer.writeError(
|
|
147
147
|
lookupId !== providerId ? `Alias "${providerId}" points at catalog id "${lookupId}" which is not in the cache.` : `Provider "${providerId}" not in catalog.`
|
|
@@ -234,11 +234,33 @@ ${navLines.join(" \xB7 ")}
|
|
|
234
234
|
function aliasProviderId(configProviderId, cfg) {
|
|
235
235
|
return cfg?.type && cfg.type !== configProviderId ? cfg.type : configProviderId;
|
|
236
236
|
}
|
|
237
|
+
async function discoverProviderModels(deps, ids) {
|
|
238
|
+
if (!("mergeOverlay" in deps.modelsRegistry)) return void 0;
|
|
239
|
+
try {
|
|
240
|
+
const { discoverAndMergeProviders } = await import("./auto-discover-providers-DRW4OZHG.js");
|
|
241
|
+
await discoverAndMergeProviders({
|
|
242
|
+
config: deps.config,
|
|
243
|
+
registry: deps.modelsRegistry,
|
|
244
|
+
cacheDir: deps.paths.cacheDir
|
|
245
|
+
});
|
|
246
|
+
} catch {
|
|
247
|
+
return void 0;
|
|
248
|
+
}
|
|
249
|
+
for (const id of ids) {
|
|
250
|
+
const found = await deps.modelsRegistry.getProvider(id);
|
|
251
|
+
if (found) return found;
|
|
252
|
+
}
|
|
253
|
+
return void 0;
|
|
254
|
+
}
|
|
237
255
|
async function getCatalogProviderForConfigProvider(providerId, deps) {
|
|
238
256
|
const cfg = deps.config.providers?.[providerId];
|
|
239
257
|
const lookupId = aliasProviderId(providerId, cfg);
|
|
240
258
|
const provider = await deps.modelsRegistry.getProvider(lookupId);
|
|
241
|
-
return { providerId: lookupId, provider };
|
|
259
|
+
if (provider) return { providerId: lookupId, provider };
|
|
260
|
+
return {
|
|
261
|
+
providerId: lookupId,
|
|
262
|
+
provider: await discoverProviderModels(deps, [lookupId, providerId])
|
|
263
|
+
};
|
|
242
264
|
}
|
|
243
265
|
function uniqueStrings(values) {
|
|
244
266
|
return [...new Set(values.map((v) => v.trim()).filter(Boolean))];
|
|
@@ -478,13 +500,16 @@ function parseSizeFlag(raw) {
|
|
|
478
500
|
if (unit === "k") return Math.round(num * 1e3);
|
|
479
501
|
return Math.round(num);
|
|
480
502
|
}
|
|
503
|
+
function subcommandFlags(args, deps) {
|
|
504
|
+
return { ...deps.flags ?? {}, ...parseFlags(args) };
|
|
505
|
+
}
|
|
481
506
|
function parseBoolFlag(flags, key) {
|
|
482
507
|
if (flags[key] === true || flags[key] === "true") return true;
|
|
483
508
|
if (flags[`no-${key}`] !== void 0) return false;
|
|
484
509
|
return void 0;
|
|
485
510
|
}
|
|
486
511
|
async function modelsAdd(args, deps) {
|
|
487
|
-
const flags =
|
|
512
|
+
const flags = subcommandFlags(args, deps);
|
|
488
513
|
const pos = positionals(args);
|
|
489
514
|
const modelId = pos[0];
|
|
490
515
|
if (!modelId) {
|
|
@@ -586,4 +611,4 @@ export {
|
|
|
586
611
|
modelsCmd,
|
|
587
612
|
providersCmd
|
|
588
613
|
};
|
|
589
|
-
//# sourceMappingURL=providers-models-
|
|
614
|
+
//# sourceMappingURL=providers-models-K6RT7ABI.js.map
|
|
@@ -130,6 +130,25 @@ export interface SlashCommandContext {
|
|
|
130
130
|
* Get live coordinator status for /fleet. Returns null when no fleet is active.
|
|
131
131
|
*/
|
|
132
132
|
onFleetStatus?: (() => import('@wrongstack/core/types').CoordinatorStatus | null) | undefined;
|
|
133
|
+
/**
|
|
134
|
+
* Read-only concurrency + lifetime spawn budget for `/fleet status`.
|
|
135
|
+
* Returns null when no fleet host is available.
|
|
136
|
+
*/
|
|
137
|
+
onFleetBudget?: (() => {
|
|
138
|
+
maxConcurrent: number;
|
|
139
|
+
activeAgents: number;
|
|
140
|
+
maxSpawns: number;
|
|
141
|
+
usedSpawns: number;
|
|
142
|
+
remainingSpawns: number;
|
|
143
|
+
maxTokens?: number | undefined;
|
|
144
|
+
usedTokens?: number | undefined;
|
|
145
|
+
remainingTokens?: number | undefined;
|
|
146
|
+
maxCostUsd?: number | undefined;
|
|
147
|
+
usedCostUsd?: number | undefined;
|
|
148
|
+
remainingCostUsd?: number | undefined;
|
|
149
|
+
checkpointMaxSpawns?: number | undefined;
|
|
150
|
+
ceilingMismatch?: boolean | undefined;
|
|
151
|
+
} | null) | undefined;
|
|
133
152
|
/**
|
|
134
153
|
* Get fleet usage summary for /fleet usage.
|
|
135
154
|
*/
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `/memory triage` slash command.
|
|
3
|
+
*
|
|
4
|
+
* Runs the SAGE Memory Triage pipeline (Phase 1 → 2 → 3 → 4 → 5):
|
|
5
|
+
* 1. preFilter → keep / discard / uncertain
|
|
6
|
+
* 2. valueScore → 0-100 numeric score
|
|
7
|
+
* 3. LLM triage → gray-zone evaluation (1-5)
|
|
8
|
+
* 4. merge detect → cluster + pair LLM comparison
|
|
9
|
+
* 5. dispatch → auto-apply updates + proposals
|
|
10
|
+
*
|
|
11
|
+
* Flags:
|
|
12
|
+
* --dry-run (default) Print what would happen. No state changes.
|
|
13
|
+
* --apply Execute auto-apply updates and file proposals.
|
|
14
|
+
* --limit N Max memories to process (default: all active).
|
|
15
|
+
* --max-phase3 N Max LLM calls for Phase 3 (default: 1000).
|
|
16
|
+
* --max-phase4-pairs N Max pairs for Phase 4 (default: 50).
|
|
17
|
+
*
|
|
18
|
+
* Transport: `opts.llmProvider` (Provider.complete) — same pattern as
|
|
19
|
+
* `/memory compact`. Falls back to a no-op LLM if the provider is absent
|
|
20
|
+
* (Phase 3 and 4 will degrade to skip-only; report is still useful).
|
|
21
|
+
*/
|
|
22
|
+
import type { SageSurface, CreateCandidateInput } from '@wrongstack/sage';
|
|
23
|
+
import { type TriageReport } from '@wrongstack/sage';
|
|
24
|
+
import type { SlashCommandContext } from './command-context.js';
|
|
25
|
+
export declare function runTriageCommand(opts: SlashCommandContext, args: string[]): Promise<{
|
|
26
|
+
message: string;
|
|
27
|
+
}>;
|
|
28
|
+
export interface ProposalFileResult {
|
|
29
|
+
filed: number;
|
|
30
|
+
failed: number;
|
|
31
|
+
total: number;
|
|
32
|
+
failures: Array<{
|
|
33
|
+
memoryId: string;
|
|
34
|
+
error: string;
|
|
35
|
+
}>;
|
|
36
|
+
/** All inputs that were submitted to Sage.createCandidate, for test verification. */
|
|
37
|
+
inputs: CreateCandidateInput[];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* File triage proposals as MemoryCandidates via the Sage surface.
|
|
41
|
+
*
|
|
42
|
+
* Exported for unit testing — the round-trip path through
|
|
43
|
+
* Sage.createCandidate is the key contract: every proposal must
|
|
44
|
+
* surface in `/memory candidates` for human review.
|
|
45
|
+
*/
|
|
46
|
+
export declare function fileProposals(Sage: SageSurface, proposals: TriageReport['dispatch']['proposals']): Promise<ProposalFileResult>;
|
|
47
|
+
//# sourceMappingURL=memory-triage.d.ts.map
|
|
@@ -29,6 +29,23 @@ export interface SetupEventsDeps {
|
|
|
29
29
|
eventUnsubscribers: Array<() => void>;
|
|
30
30
|
globalConfigPath?: string | undefined;
|
|
31
31
|
onFleetBroadcaster?: ((fn: () => Promise<void>) => void) | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Live fleet budget snapshot (issue #323). Merged into
|
|
34
|
+
* `fleet.concurrency_update` so the WebUI can show used/remaining spawns
|
|
35
|
+
* without a probe spawn.
|
|
36
|
+
*/
|
|
37
|
+
getFleetBudget?: (() => {
|
|
38
|
+
maxSpawns?: number | undefined;
|
|
39
|
+
usedSpawns?: number | undefined;
|
|
40
|
+
remainingSpawns?: number | undefined;
|
|
41
|
+
maxConcurrent?: number | undefined;
|
|
42
|
+
activeAgents?: number | undefined;
|
|
43
|
+
maxSpawnsSource?: string | undefined;
|
|
44
|
+
maxConcurrentSource?: string | undefined;
|
|
45
|
+
effectiveSource?: string | undefined;
|
|
46
|
+
checkpointMaxSpawns?: number | undefined;
|
|
47
|
+
ceilingMismatch?: boolean | undefined;
|
|
48
|
+
} | null) | undefined;
|
|
32
49
|
}
|
|
33
50
|
/** CLI adapter around the canonical EventBus→WebSocket subscription graph. */
|
|
34
51
|
export declare function createSetupEvents(deps: SetupEventsDeps): () => void;
|
|
@@ -6,25 +6,42 @@ interface ConsoleTarget {
|
|
|
6
6
|
error: ConsoleMethod;
|
|
7
7
|
debug: ConsoleMethod;
|
|
8
8
|
}
|
|
9
|
-
export interface
|
|
10
|
-
maxLines?: number | undefined;
|
|
11
|
-
refreshMs?: number | undefined;
|
|
9
|
+
export interface QuietSurfaceConsoleOptions {
|
|
12
10
|
isTTY?: boolean | undefined;
|
|
11
|
+
/** Pass everything through untouched (the `WEBUI_VERBOSE=1` escape hatch). */
|
|
12
|
+
verbose?: boolean | undefined;
|
|
13
13
|
consoleTarget?: ConsoleTarget | undefined;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
clearIntervalFn?: ((timer: NodeJS.Timeout) => void) | undefined;
|
|
14
|
+
/** Ring-buffer size for {@link QuietSurfaceConsole.recent}. */
|
|
15
|
+
bufferLines?: number | undefined;
|
|
17
16
|
}
|
|
18
|
-
export interface
|
|
17
|
+
export interface QuietSurfaceConsole {
|
|
18
|
+
/** `false` when the console was left untouched (non-TTY or verbose). */
|
|
19
19
|
readonly enabled: boolean;
|
|
20
|
-
|
|
20
|
+
/** Chatter lines dropped from the terminal so far. */
|
|
21
|
+
readonly mutedCount: number;
|
|
22
|
+
/** Newest muted lines, oldest first — for a diagnostic dump on failure. */
|
|
23
|
+
recent(): readonly string[];
|
|
21
24
|
stop(): void;
|
|
22
25
|
}
|
|
23
26
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
+
* Keep an interactive WebUI/SimpleUI terminal quiet while the browser owns
|
|
28
|
+
* the output surface.
|
|
29
|
+
*
|
|
30
|
+
* Two things fill that terminal, and this handles both:
|
|
31
|
+
*
|
|
32
|
+
* - **Chatter.** Every `console.log`/`info`/`debug` from the server is
|
|
33
|
+
* progress the browser already shows. Those are dropped from the
|
|
34
|
+
* terminal (still counted, and the newest are kept in memory for a
|
|
35
|
+
* failure dump); `console.warn`/`error` are forwarded untouched.
|
|
36
|
+
*
|
|
37
|
+
* - **Repetition.** A warning that fires on a timer used to append an
|
|
38
|
+
* identical line every tick until the terminal was pages deep in the
|
|
39
|
+
* same text. Consecutive identical lines now collapse into a single
|
|
40
|
+
* `↑ previous line repeated N×` notice emitted when the streak ends.
|
|
41
|
+
*
|
|
42
|
+
* Non-TTY output is deliberately untouched so redirected output and log
|
|
43
|
+
* collectors retain the complete append-only log, as is `WEBUI_VERBOSE=1`.
|
|
27
44
|
*/
|
|
28
|
-
export declare function
|
|
45
|
+
export declare function startQuietSurfaceConsole(options?: QuietSurfaceConsoleOptions): QuietSurfaceConsole;
|
|
29
46
|
export {};
|
|
30
47
|
//# sourceMappingURL=terminal-log-view.d.ts.map
|