@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
|
@@ -679,9 +679,23 @@ function createSetupEvents(deps) {
|
|
|
679
679
|
let fleetConcurrency = 0;
|
|
680
680
|
let fleetConcurrencyMax = 4;
|
|
681
681
|
const emitConcurrency = () => {
|
|
682
|
+
const budget = deps.getFleetBudget?.() ?? null;
|
|
682
683
|
deps.broadcast({
|
|
683
684
|
type: "fleet.concurrency_update",
|
|
684
|
-
payload: deps.sessionPayload({
|
|
685
|
+
payload: deps.sessionPayload({
|
|
686
|
+
fleetConcurrency: budget?.activeAgents ?? fleetConcurrency,
|
|
687
|
+
fleetConcurrencyMax: budget?.maxConcurrent ?? fleetConcurrencyMax,
|
|
688
|
+
...budget ? {
|
|
689
|
+
maxSpawns: budget.maxSpawns,
|
|
690
|
+
usedSpawns: budget.usedSpawns,
|
|
691
|
+
remainingSpawns: budget.remainingSpawns,
|
|
692
|
+
maxSpawnsSource: budget.maxSpawnsSource,
|
|
693
|
+
maxConcurrentSource: budget.maxConcurrentSource,
|
|
694
|
+
effectiveSource: budget.effectiveSource,
|
|
695
|
+
checkpointMaxSpawns: budget.checkpointMaxSpawns,
|
|
696
|
+
ceilingMismatch: budget.ceilingMismatch
|
|
697
|
+
} : {}
|
|
698
|
+
})
|
|
685
699
|
});
|
|
686
700
|
};
|
|
687
701
|
return function setupEvents() {
|
|
@@ -761,24 +775,35 @@ import {
|
|
|
761
775
|
|
|
762
776
|
// src/webui-server/terminal-log-view.ts
|
|
763
777
|
import { format } from "node:util";
|
|
764
|
-
var
|
|
765
|
-
var
|
|
766
|
-
var
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
778
|
+
var DEFAULT_BUFFER_LINES = 200;
|
|
779
|
+
var MUTED_LEVELS = ["log", "info", "debug"];
|
|
780
|
+
var FORWARDED_LEVELS = ["warn", "error"];
|
|
781
|
+
var DISABLED = {
|
|
782
|
+
enabled: false,
|
|
783
|
+
mutedCount: 0,
|
|
784
|
+
recent: () => [],
|
|
785
|
+
stop: () => {
|
|
786
|
+
}
|
|
787
|
+
};
|
|
788
|
+
function envVerbose() {
|
|
789
|
+
for (const name of ["WEBUI_VERBOSE", "WRONGSTACK_WEBUI_VERBOSE"]) {
|
|
790
|
+
const value = process.env[name]?.trim().toLowerCase();
|
|
791
|
+
if (value === "1" || value === "true" || value === "yes" || value === "on") return true;
|
|
773
792
|
}
|
|
774
|
-
|
|
775
|
-
|
|
793
|
+
return false;
|
|
794
|
+
}
|
|
795
|
+
function startQuietSurfaceConsole(options = {}) {
|
|
796
|
+
const isTTY = options.isTTY ?? process.stdout.isTTY === true;
|
|
797
|
+
const verbose = options.verbose ?? envVerbose();
|
|
798
|
+
if (!isTTY || verbose) return DISABLED;
|
|
799
|
+
const bufferLines = Math.max(1, Math.trunc(options.bufferLines ?? DEFAULT_BUFFER_LINES));
|
|
776
800
|
const target = options.consoleTarget ?? console;
|
|
777
|
-
const
|
|
778
|
-
|
|
779
|
-
const clearIntervalFn = options.clearIntervalFn ?? clearInterval;
|
|
780
|
-
const lines = [];
|
|
801
|
+
const muted = [];
|
|
802
|
+
let mutedCount = 0;
|
|
781
803
|
let stopped = false;
|
|
804
|
+
let lastLine = null;
|
|
805
|
+
let lastEmit = null;
|
|
806
|
+
let repeats = 0;
|
|
782
807
|
const originals = {
|
|
783
808
|
log: target.log,
|
|
784
809
|
info: target.info,
|
|
@@ -787,35 +812,47 @@ function startBoundedTerminalLogView(options = {}) {
|
|
|
787
812
|
debug: target.debug
|
|
788
813
|
};
|
|
789
814
|
const wrappers = {};
|
|
790
|
-
const
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
}
|
|
815
|
+
const flushRepeats = () => {
|
|
816
|
+
if (repeats === 0 || !lastEmit) return;
|
|
817
|
+
const count = repeats;
|
|
818
|
+
repeats = 0;
|
|
819
|
+
lastEmit.call(target, ` \u2191 previous line repeated ${count}\xD7`);
|
|
795
820
|
};
|
|
796
|
-
for (const level of
|
|
821
|
+
for (const level of MUTED_LEVELS) {
|
|
822
|
+
const wrapper = (...args) => {
|
|
823
|
+
mutedCount += 1;
|
|
824
|
+
muted.push(format(...args));
|
|
825
|
+
if (muted.length > bufferLines) muted.shift();
|
|
826
|
+
};
|
|
827
|
+
wrappers[level] = wrapper;
|
|
828
|
+
target[level] = wrapper;
|
|
829
|
+
}
|
|
830
|
+
for (const level of FORWARDED_LEVELS) {
|
|
797
831
|
const original = originals[level];
|
|
798
832
|
const wrapper = (...args) => {
|
|
799
|
-
|
|
833
|
+
const line = format(...args);
|
|
834
|
+
if (line === lastLine) {
|
|
835
|
+
repeats += 1;
|
|
836
|
+
return;
|
|
837
|
+
}
|
|
838
|
+
flushRepeats();
|
|
839
|
+
lastLine = line;
|
|
840
|
+
lastEmit = original;
|
|
800
841
|
original.apply(target, args);
|
|
801
842
|
};
|
|
802
843
|
wrappers[level] = wrapper;
|
|
803
844
|
target[level] = wrapper;
|
|
804
845
|
}
|
|
805
|
-
const redraw = () => {
|
|
806
|
-
if (stopped || lines.length === 0) return;
|
|
807
|
-
write(`${CLEAR_VISIBLE_TERMINAL}${lines.join("\n")}
|
|
808
|
-
`);
|
|
809
|
-
};
|
|
810
|
-
const timer = setIntervalFn(redraw, refreshMs);
|
|
811
|
-
timer.unref?.();
|
|
812
846
|
return {
|
|
813
847
|
enabled: true,
|
|
814
|
-
|
|
848
|
+
get mutedCount() {
|
|
849
|
+
return mutedCount;
|
|
850
|
+
},
|
|
851
|
+
recent: () => [...muted],
|
|
815
852
|
stop: () => {
|
|
816
853
|
if (stopped) return;
|
|
817
854
|
stopped = true;
|
|
818
|
-
|
|
855
|
+
flushRepeats();
|
|
819
856
|
for (const level of Object.keys(originals)) {
|
|
820
857
|
if (target[level] === wrappers[level]) target[level] = originals[level];
|
|
821
858
|
}
|
|
@@ -825,6 +862,7 @@ function startBoundedTerminalLogView(options = {}) {
|
|
|
825
862
|
|
|
826
863
|
// src/webui-server.ts
|
|
827
864
|
async function runWebUI(opts) {
|
|
865
|
+
const terminalLogView = startQuietSurfaceConsole();
|
|
828
866
|
const trustBoundary = opts.trustBoundary ?? createCompatibilityTrustBoundary({ policyId: "cli-webui-trusted-host-compat-v1" });
|
|
829
867
|
const host = opts.host ?? process.env["WEBUI_HOST"] ?? process.env["WS_HOST"] ?? "127.0.0.1";
|
|
830
868
|
const publicUrl = opts.publicUrl ?? process.env["WEBUI_PUBLIC_URL"];
|
|
@@ -1060,7 +1098,10 @@ async function runWebUI(opts) {
|
|
|
1060
1098
|
publicUrl,
|
|
1061
1099
|
projectRoot: opts.projectRoot,
|
|
1062
1100
|
startedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1063
|
-
registryBaseDir
|
|
1101
|
+
registryBaseDir,
|
|
1102
|
+
// Lets a same-project TUI/REPL authenticate `POST /api/fleet/ping` now
|
|
1103
|
+
// that the API requires a token on every bind (H3).
|
|
1104
|
+
authToken: wsToken
|
|
1064
1105
|
});
|
|
1065
1106
|
}
|
|
1066
1107
|
const eventUnsubscribers = [];
|
|
@@ -1096,7 +1137,8 @@ async function runWebUI(opts) {
|
|
|
1096
1137
|
globalConfigPath: path5.join(globalRoot, "config.json"),
|
|
1097
1138
|
onFleetBroadcaster: (fn) => {
|
|
1098
1139
|
fleetBroadcastCli = fn;
|
|
1099
|
-
}
|
|
1140
|
+
},
|
|
1141
|
+
...opts.getFleetBudget ? { getFleetBudget: opts.getFleetBudget } : {}
|
|
1100
1142
|
});
|
|
1101
1143
|
const wsHandlerCtx = {
|
|
1102
1144
|
providerStore: createProviderConfigStore(
|
|
@@ -1172,7 +1214,10 @@ async function runWebUI(opts) {
|
|
|
1172
1214
|
...snapshot.baseUrl !== void 0 ? { baseUrl: snapshot.baseUrl } : {}
|
|
1173
1215
|
};
|
|
1174
1216
|
const oldMax = opts.agent.ctx.provider.capabilities?.maxContext;
|
|
1175
|
-
const prov = makeProviderFromConfig(activeId, {
|
|
1217
|
+
const prov = makeProviderFromConfig(activeId, {
|
|
1218
|
+
...newCfg,
|
|
1219
|
+
type: newCfg.type ?? activeId
|
|
1220
|
+
});
|
|
1176
1221
|
if (oldMax != null && prov.capabilities) prov.capabilities.maxContext = oldMax;
|
|
1177
1222
|
opts.agent.ctx.provider = prov;
|
|
1178
1223
|
console.log(`[WebUI] Provider credentials reloaded from config.json (${activeId})`);
|
|
@@ -1352,7 +1397,6 @@ async function runWebUI(opts) {
|
|
|
1352
1397
|
kanbanHostRoutes,
|
|
1353
1398
|
statusTracker: opts.statusTracker
|
|
1354
1399
|
});
|
|
1355
|
-
const terminalLogView = startBoundedTerminalLogView();
|
|
1356
1400
|
const stopped = new Promise((resolve) => {
|
|
1357
1401
|
let listeningAnnounced = false;
|
|
1358
1402
|
const announceListening = () => {
|
|
@@ -1431,6 +1475,28 @@ async function runWebUI(opts) {
|
|
|
1431
1475
|
flushAllStreamBuffers();
|
|
1432
1476
|
for (const unsub of eventUnsubscribers) unsub();
|
|
1433
1477
|
},
|
|
1478
|
+
// Issue #322: kill session-owned children (MCP, bash/exec, tool-spawned
|
|
1479
|
+
// dev servers) before closing the listen socket so Windows process trees
|
|
1480
|
+
// do not outlive the parent and strand the event loop on open stdio.
|
|
1481
|
+
stopOwnedChildren: async () => {
|
|
1482
|
+
try {
|
|
1483
|
+
const { getProcessRegistry } = await import("@wrongstack/tools");
|
|
1484
|
+
getProcessRegistry().killAll({ force: true, includeProtected: true });
|
|
1485
|
+
} catch (err) {
|
|
1486
|
+
console.debug(
|
|
1487
|
+
`[webui-server] process-registry killAll failed: ${err instanceof Error ? err.message : String(err)}`
|
|
1488
|
+
);
|
|
1489
|
+
}
|
|
1490
|
+
if (opts.mcpRegistry) {
|
|
1491
|
+
try {
|
|
1492
|
+
await opts.mcpRegistry.stopAll();
|
|
1493
|
+
} catch (err) {
|
|
1494
|
+
console.debug(
|
|
1495
|
+
`[webui-server] mcpRegistry.stopAll failed: ${err instanceof Error ? err.message : String(err)}`
|
|
1496
|
+
);
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1499
|
+
},
|
|
1434
1500
|
disposeResources: () => {
|
|
1435
1501
|
credentialWatcherClose?.();
|
|
1436
1502
|
credentialWatcherClose = void 0;
|
|
@@ -1455,8 +1521,13 @@ async function runWebUI(opts) {
|
|
|
1455
1521
|
pid: process.pid,
|
|
1456
1522
|
registryBaseDir,
|
|
1457
1523
|
onStopped: () => {
|
|
1458
|
-
terminalLogView.
|
|
1524
|
+
const muted = terminalLogView.mutedCount;
|
|
1459
1525
|
terminalLogView.stop();
|
|
1526
|
+
if (muted > 0) {
|
|
1527
|
+
console.log(
|
|
1528
|
+
`[WebUI] ${muted} progress line(s) kept out of this terminal \u2014 set WEBUI_VERBOSE=1 to see them.`
|
|
1529
|
+
);
|
|
1530
|
+
}
|
|
1460
1531
|
opts.onExit?.();
|
|
1461
1532
|
resolve();
|
|
1462
1533
|
}
|
|
@@ -1487,4 +1558,4 @@ async function runWebUI(opts) {
|
|
|
1487
1558
|
export {
|
|
1488
1559
|
runWebUI
|
|
1489
1560
|
};
|
|
1490
|
-
//# sourceMappingURL=webui-server-
|
|
1561
|
+
//# sourceMappingURL=webui-server-G3EKFXLL.js.map
|
|
@@ -36,6 +36,22 @@ export interface CliWebUIOptions {
|
|
|
36
36
|
surface?: 'webui' | 'simpleui' | undefined;
|
|
37
37
|
/** Fixed access token/password. Defaults to WEBUI_TOKEN or random per process. */
|
|
38
38
|
accessToken?: string | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Live fleet concurrency + lifetime spawn budget for WebUI (issue #323).
|
|
41
|
+
* Merged into `fleet.concurrency_update` broadcasts.
|
|
42
|
+
*/
|
|
43
|
+
getFleetBudget?: (() => {
|
|
44
|
+
maxSpawns?: number | undefined;
|
|
45
|
+
usedSpawns?: number | undefined;
|
|
46
|
+
remainingSpawns?: number | undefined;
|
|
47
|
+
maxConcurrent?: number | undefined;
|
|
48
|
+
activeAgents?: number | undefined;
|
|
49
|
+
maxSpawnsSource?: string | undefined;
|
|
50
|
+
maxConcurrentSource?: string | undefined;
|
|
51
|
+
effectiveSource?: string | undefined;
|
|
52
|
+
checkpointMaxSpawns?: number | undefined;
|
|
53
|
+
ceilingMismatch?: boolean | undefined;
|
|
54
|
+
} | null) | undefined;
|
|
39
55
|
/** Browser-facing HTTP URL, used when WebUI is exposed behind a tunnel/proxy. */
|
|
40
56
|
publicUrl?: string | undefined;
|
|
41
57
|
/** Browser-facing WebSocket URL injected into the frontend. */
|
|
@@ -49,6 +49,9 @@ export interface BrainOrchestrationDeps {
|
|
|
49
49
|
stateCheckpointPath: string | undefined;
|
|
50
50
|
fleetRootForPromotion: string;
|
|
51
51
|
maxConcurrent: number | undefined;
|
|
52
|
+
maxSpawns?: number | undefined;
|
|
53
|
+
maxConcurrentSource?: import('../fleet/budget-source.js').FleetBudgetSource | undefined;
|
|
54
|
+
maxSpawnsSource?: import('../fleet/budget-source.js').FleetBudgetSource | undefined;
|
|
52
55
|
effectiveMaxContextRef: {
|
|
53
56
|
current: number;
|
|
54
57
|
};
|
|
@@ -23,6 +23,10 @@ export interface DirectorAutonomyResult {
|
|
|
23
23
|
director: Director | null;
|
|
24
24
|
directorMode: boolean;
|
|
25
25
|
maxConcurrent: number | undefined;
|
|
26
|
+
/** Lifetime spawn ceiling resolved from flag/env/profile/default. */
|
|
27
|
+
maxSpawns: number;
|
|
28
|
+
maxConcurrentSource: import('../fleet/budget-source.js').FleetBudgetSource;
|
|
29
|
+
maxSpawnsSource: import('../fleet/budget-source.js').FleetBudgetSource;
|
|
26
30
|
autonomyMode: import('../services/autonomy-mode.js').AutonomyMode;
|
|
27
31
|
nextPredictEnabled: boolean;
|
|
28
32
|
currentSuggestions: string[];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Factory for the fallback gate function.
|
|
3
|
+
*
|
|
4
|
+
* The gate is injected into `createFallbackModelExtension` as `fallbackGate`.
|
|
5
|
+
* When the fallback chain is about to engage, the gate:
|
|
6
|
+
*
|
|
7
|
+
* 1. Registers a `provider.fallback_choice` listener keyed on `requestId`.
|
|
8
|
+
* 2. Emits `provider.fallback_pending` on the EventBus — carrying the
|
|
9
|
+
* candidate list, countdown duration, and the caller-supplied
|
|
10
|
+
* `requestId` (generated by the fallback-model extension so the
|
|
11
|
+
* `provider.fallback` completion event can share the same id).
|
|
12
|
+
* 3. Waits for the choice event (the user manually picked a model), OR for
|
|
13
|
+
* the countdown timer to expire (auto-switch to the chain head).
|
|
14
|
+
* 4. Resolves with the chosen model reference, or `null` for auto-switch.
|
|
15
|
+
*
|
|
16
|
+
* Registration happens BEFORE the emit so a same-tick choice reply from a
|
|
17
|
+
* synchronous EventBus listener (test harness, automated UI pick) is not
|
|
18
|
+
* dropped.
|
|
19
|
+
*
|
|
20
|
+
* An absolute deadline (autoSwitchSeconds * 1.5) ensures the gate never
|
|
21
|
+
* hangs indefinitely even if neither signal arrives (headless mode, no UI
|
|
22
|
+
* listener, etc.).
|
|
23
|
+
*/
|
|
24
|
+
import type { FallbackGateFn } from '@wrongstack/core/agent';
|
|
25
|
+
import type { EventBus } from '@wrongstack/core/kernel';
|
|
26
|
+
/**
|
|
27
|
+
* Create a fallback gate that emits `provider.fallback_pending` and waits
|
|
28
|
+
* for a `provider.fallback_choice` event or the countdown timer.
|
|
29
|
+
*/
|
|
30
|
+
export declare function createFallbackGate(_events: EventBus): FallbackGateFn;
|
|
31
|
+
//# sourceMappingURL=fallback-gate.d.ts.map
|
|
@@ -3,7 +3,7 @@ import type { EventBus } from '@wrongstack/core/kernel';
|
|
|
3
3
|
import type { MultiAgentHost } from '../multi-agent.js';
|
|
4
4
|
import type { BuiltinSlashCommandDeps } from './slash-commands.js';
|
|
5
5
|
type SlashCommandDeps = BuiltinSlashCommandDeps;
|
|
6
|
-
export type FleetCommandHandlers = Pick<SlashCommandDeps, 'onSpawn' | 'onSpawnAndWait' | 'onAgents' | 'onFleet' | 'onFleetStatus' | 'onFleetUsage' | 'onFleetKill' | 'onFleetTerminate' | 'onFleetSpawn' | 'onFleetLog' | 'onFleetRetry' | 'onDirector'>;
|
|
6
|
+
export type FleetCommandHandlers = Pick<SlashCommandDeps, 'onSpawn' | 'onSpawnAndWait' | 'onAgents' | 'onFleet' | 'onFleetStatus' | 'onFleetBudget' | 'onFleetUsage' | 'onFleetKill' | 'onFleetTerminate' | 'onFleetSpawn' | 'onFleetLog' | 'onFleetRetry' | 'onDirector'>;
|
|
7
7
|
export interface FleetCommandHandlersInput {
|
|
8
8
|
multiAgentHost: MultiAgentHost;
|
|
9
9
|
getDirector: () => Director | null;
|
package/dist/wiring/plugins.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AgentPipelines } from '@wrongstack/core/agent';
|
|
2
2
|
import type { Config, HealthRegistry, Logger, MetricsRuntimeStatus, MetricsSinkView, ModelsRegistry, Plugin, PromptLoader, SkillLoader } from '@wrongstack/core/types';
|
|
3
3
|
import type { ExtensionRegistry } from '@wrongstack/core/extension';
|
|
4
|
-
import type { PluginHostHandle } from '@wrongstack/core/plugin';
|
|
4
|
+
import type { PluginAPIInit, PluginHostHandle } from '@wrongstack/core/plugin';
|
|
5
5
|
import type { ConfigStore, SessionWriter } from '@wrongstack/core/types';
|
|
6
6
|
import type { Container, EventBus } from '@wrongstack/core/kernel';
|
|
7
7
|
import type { ProviderRegistry, SlashCommandRegistry, ToolRegistry } from '@wrongstack/core/registry';
|
|
@@ -71,13 +71,7 @@ export interface PluginsWiringDeps {
|
|
|
71
71
|
* default model, and a factory for named-provider overrides. Optional —
|
|
72
72
|
* minimal hosts omit it and plugins see `api.llm === undefined`.
|
|
73
73
|
*/
|
|
74
|
-
llm?:
|
|
75
|
-
provider: import('@wrongstack/core/types').Provider;
|
|
76
|
-
model: string;
|
|
77
|
-
getProvider?: (() => import('@wrongstack/core/types').Provider) | undefined;
|
|
78
|
-
getModel?: (() => string) | undefined;
|
|
79
|
-
createProvider?: ((name: string, model?: string) => import('@wrongstack/core/types').Provider) | undefined;
|
|
80
|
-
} | undefined;
|
|
74
|
+
llm?: PluginAPIInit['llm'];
|
|
81
75
|
/** Health registry — injected so the observability built-in can run /health. */
|
|
82
76
|
healthRegistry?: HealthRegistry | undefined;
|
|
83
77
|
/** Skill loader — injected so the skills built-in can list/read skills. */
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/** Registers provider-neutral one-shot, council, and context-summary tools. */
|
|
2
|
-
import type { Config, Provider } from '@wrongstack/core/types';
|
|
2
|
+
import type { Config, CouncilToolConfig, OneShotModelRouter, Provider } from '@wrongstack/core/types';
|
|
3
3
|
import { createContextManagerTool } from '@wrongstack/core/infrastructure';
|
|
4
4
|
import type { FallbackProfileManager } from '@wrongstack/core/agent';
|
|
5
|
+
import { type CouncilPersonaRegistry, type CouncilProfileRegistry } from '@wrongstack/core/execution';
|
|
5
6
|
import type { ProviderModelStatusTracker } from '@wrongstack/core/coordination';
|
|
6
7
|
import type { ToolRegistry } from '@wrongstack/core/registry';
|
|
7
8
|
export interface ProviderUtilityToolsInput {
|
|
@@ -21,5 +22,29 @@ export declare function adoptResumedProvider(input: {
|
|
|
21
22
|
warn(message: string): void;
|
|
22
23
|
};
|
|
23
24
|
}): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* A router that reads the LIVE config on every pick.
|
|
27
|
+
*
|
|
28
|
+
* `ModelRouter` snapshots `modelMatrix` and the provider list at construction,
|
|
29
|
+
* but `/setmodel` and credential edits change both mid-session. Rebuilding per
|
|
30
|
+
* call keeps role routing consistent with what the user last configured; the
|
|
31
|
+
* router itself does no I/O, so this is a plain object construction.
|
|
32
|
+
*/
|
|
33
|
+
export declare function createLiveModelRouter(getConfig: () => Config): OneShotModelRouter;
|
|
34
|
+
/**
|
|
35
|
+
* Build the Council tool's persona/profile registries from configuration.
|
|
36
|
+
*
|
|
37
|
+
* `createCouncilPersonaRegistry` / `createCouncilProfileRegistry` shipped from
|
|
38
|
+
* day one but no host ever called them, so the tool was pinned to the built-in
|
|
39
|
+
* lenses and panels with no way to add either. A malformed entry must not take
|
|
40
|
+
* the whole tool registration down with it — a bad panel definition degrades to
|
|
41
|
+
* the built-ins and is reported, exactly like an unresolvable Brain pool entry.
|
|
42
|
+
*/
|
|
43
|
+
export declare function buildCouncilRegistries(cfg: CouncilToolConfig | undefined): {
|
|
44
|
+
personas?: CouncilPersonaRegistry | undefined;
|
|
45
|
+
profiles?: CouncilProfileRegistry | undefined;
|
|
46
|
+
defaultProfile?: string | undefined;
|
|
47
|
+
maxConcurrency?: number | undefined;
|
|
48
|
+
};
|
|
24
49
|
export declare function registerProviderUtilityTools(input: ProviderUtilityToolsInput): void;
|
|
25
50
|
//# sourceMappingURL=provider-utility-tools.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wrongstack/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.300.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "WrongStack CLI — terminal AI coding agent with provider catalog from models.dev. Provides `wrongstack` and `wstack` binaries.",
|
|
6
6
|
"keywords": [
|
|
@@ -42,29 +42,30 @@
|
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"ws": "^8.21.1",
|
|
45
|
-
"@wrongstack/
|
|
46
|
-
"@wrongstack/
|
|
47
|
-
"@wrongstack/
|
|
48
|
-
"@wrongstack/
|
|
49
|
-
"@wrongstack/
|
|
50
|
-
"@wrongstack/kanban": "0.
|
|
51
|
-
"@wrongstack/sdd": "0.
|
|
52
|
-
"@wrongstack/
|
|
53
|
-
"@wrongstack/
|
|
54
|
-
"@wrongstack/
|
|
55
|
-
"@wrongstack/
|
|
56
|
-
"@wrongstack/
|
|
57
|
-
"@wrongstack/
|
|
58
|
-
"@wrongstack/
|
|
59
|
-
"@wrongstack/
|
|
60
|
-
"@wrongstack/
|
|
61
|
-
"@wrongstack/tools": "0.
|
|
62
|
-
"@wrongstack/webui": "0.
|
|
63
|
-
"@wrongstack/
|
|
64
|
-
"@wrongstack/webui
|
|
45
|
+
"@wrongstack/core": "0.300.0",
|
|
46
|
+
"@wrongstack/bench": "0.300.0",
|
|
47
|
+
"@wrongstack/providers": "0.300.0",
|
|
48
|
+
"@wrongstack/mcp": "0.300.0",
|
|
49
|
+
"@wrongstack/acp": "0.300.0",
|
|
50
|
+
"@wrongstack/kanban": "0.300.0",
|
|
51
|
+
"@wrongstack/sdd": "0.300.0",
|
|
52
|
+
"@wrongstack/plugins": "0.300.0",
|
|
53
|
+
"@wrongstack/plug-lsp": "0.300.0",
|
|
54
|
+
"@wrongstack/requirement-intake": "0.300.0",
|
|
55
|
+
"@wrongstack/security-scanner": "0.300.0",
|
|
56
|
+
"@wrongstack/runtime": "0.300.0",
|
|
57
|
+
"@wrongstack/sage": "0.300.0",
|
|
58
|
+
"@wrongstack/techstack": "0.300.0",
|
|
59
|
+
"@wrongstack/telegram": "0.300.0",
|
|
60
|
+
"@wrongstack/simpleui": "0.300.0",
|
|
61
|
+
"@wrongstack/tools": "0.300.0",
|
|
62
|
+
"@wrongstack/webui-hq": "0.300.0",
|
|
63
|
+
"@wrongstack/tui": "0.300.0",
|
|
64
|
+
"@wrongstack/webui": "0.300.0",
|
|
65
|
+
"@wrongstack/webui-server": "0.300.0"
|
|
65
66
|
},
|
|
66
67
|
"optionalDependencies": {
|
|
67
|
-
"@wrongstack/desktop": "0.
|
|
68
|
+
"@wrongstack/desktop": "0.300.0"
|
|
68
69
|
},
|
|
69
70
|
"devDependencies": {
|
|
70
71
|
"@types/node": "^26.1.2",
|