@wrongstack/cli 0.298.0 → 0.298.2

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/README.md CHANGED
@@ -75,3 +75,54 @@ pnpm run sync:models -- --diff # what we override
75
75
  Then edit `providers.json` and commit. Keep it **small and curated** — it is an override layer,
76
76
  not a mirror of models.dev. Once models.dev catches up, drop the now-redundant override (`--diff`
77
77
  flags those).
78
+
79
+ ## Overlay vs. per-user `customModels` — when to use which
80
+
81
+ There are **two** override layers in WrongStack, for two different audiences:
82
+
83
+ | Layer | Location | Audience | Purpose |
84
+ |---|---|---|---|
85
+ | **Curated overlay** | `packages/cli/data/providers.json` (this file) | **All users, repo-wide** | Fix upstream errors, add models/providers models.dev doesn't list, remove bad entries (`_removeProviders` / `_removeModels` magic keys). Ships with every release. |
86
+ | **`customModels` config** | `~/.wrongstack/profiles/<name>/config.json` → `providers.<id>.customModels` | **One user, one profile** | Per-user model visibility + per-model metadata overrides (limits, cost, modalities, capability flags) via the WebUI ModelListEditor or TUI `/auth` panel. |
87
+
88
+ **Decision rule:** if the fix benefits every user of the product (an upstream data error, a brand-new
89
+ model id), it belongs in the **overlay** — commit it here. If it's personal tuning (my context limit,
90
+ my custom endpoint's pricing), it belongs in the user's **`customModels`** config — never here.
91
+
92
+ Both layers deep-merge one level into `limit` / `cost` / `modalities` objects, and both follow the
93
+ same precedence contract at resolution time:
94
+
95
+ ```
96
+ top-level config.models > providers.<id>.customModels > overlay > models.dev catalog > wire-family defaults
97
+ ```
98
+
99
+ The top-level `config.models` record overrides provider-local entries for the same model id
100
+ (`mergeCustomModelDefs` in `packages/core/src/utils/merge-custom-models.ts`). Inline
101
+ models.dev-style objects inside `providers.<id>.models` are normalized into `customModels` at
102
+ config load — they are not a separate runtime layer.
103
+
104
+ ## Catalog cache & boot refresh
105
+
106
+ The live models.dev catalog is fetched at boot and cached:
107
+
108
+ - **Cache:** `~/.wrongstack/cache/models.dev.json` (fetched at startup; `--no-models-refresh`
109
+ skips the network fetch and uses the stale cache).
110
+ - **Overlay cache:** `~/.wrongstack/cache/models-overlay.json` (fetched from GitHub raw; the
111
+ bundled `providers.json` is the offline floor).
112
+ - Resolution: `merged = mergeModelsPayload(cachedModelsDev, overlay)` — the overlay always wins.
113
+
114
+ If models.dev is unreachable and no cache exists, a non-empty overlay still drives the catalog
115
+ on its own. Users never edit the cache files — they are regenerated on boot.
116
+
117
+ ## Modalities format (important)
118
+
119
+ `modalities.input` and `modalities.output` are **plain string arrays**, not objects:
120
+
121
+ ```jsonc
122
+ "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
123
+ ```
124
+
125
+ So `modalities.input[0] === "text"` (a string). The known values are `"text" | "image" | "audio" |
126
+ "video" | "pdf"` (see `MODELS_DEV_MODALITY_VALUES` in `packages/core/src/models/models-dev-schema.ts`).
127
+ New upstream values are tolerated at parse time — the schema validates "array of non-empty strings",
128
+ not a closed enum.
@@ -13,10 +13,10 @@ import {
13
13
  runOAuthLoginKind,
14
14
  runOAuthLoginMenu,
15
15
  validateFamily
16
- } from "./chunk-I2BM6FK6.js";
16
+ } from "./chunk-L5CE52XW.js";
17
17
  import {
18
18
  parseAuthFlags
19
- } from "./chunk-JBSQ7ONN.js";
19
+ } from "./chunk-ZNZJ34RF.js";
20
20
  import "./chunk-66T43Q4Y.js";
21
21
  import "./chunk-GO3TJICK.js";
22
22
  import {
@@ -501,4 +501,4 @@ async function runAuthRemove(deps, providerId) {
501
501
  export {
502
502
  authCmd
503
503
  };
504
- //# sourceMappingURL=auth-NLLGEYQR.js.map
504
+ //# sourceMappingURL=auth-G5YKKSRH.js.map
@@ -1,3 +1,4 @@
1
+ import type { ProviderModelStatusTracker } from '@wrongstack/core/coordination';
1
2
  import type { SubagentConfig, SubagentError, TaskResult } from '@wrongstack/core/types';
2
3
  /**
3
4
  * Resolve the fallback-model chain used when spawning the chimera-review
@@ -19,8 +20,14 @@ export declare function __resetReviewerRoundRobinCursor(value?: number): void;
19
20
  * Builds the pool from the configured primary + fallback chain, then picks
20
21
  * the next entry via round-robin. When the pool has <=1 usable entry the
21
22
  * original primary/fallbacks are returned unchanged.
23
+ *
24
+ * When a {@link ProviderModelStatusTracker} is supplied, blocked entries
25
+ * (waiting-room / token-reset-limit room) are filtered from both the pool
26
+ * and the round-robin pick so a 429-stricken model is never re-spawned on
27
+ * a concurrent reviewer turn. Without the tracker, the legacy pre-waiting-
28
+ * room behavior is preserved.
22
29
  */
23
- export declare function assignReviewerModelsRoundRobin(provider: string, model: string, fallbackModels: readonly string[]): {
30
+ export declare function assignReviewerModelsRoundRobin(provider: string, model: string, fallbackModels: readonly string[], statusTracker?: ProviderModelStatusTracker | undefined): {
24
31
  provider: string;
25
32
  model: string;
26
33
  fallbackModels: string[];
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  PLUGIN_AUDIT_ENTRIES
3
- } from "./chunk-XWEGWYDU.js";
3
+ } from "./chunk-PEKUKUCH.js";
4
4
  import {
5
5
  patchConfig
6
6
  } from "./chunk-TYO2OVAD.js";
@@ -255,4 +255,4 @@ export {
255
255
  BUILTIN_PLUGIN_FACTORIES,
256
256
  setupPlugins
257
257
  };
258
- //# sourceMappingURL=chunk-QUNHS6O3.js.map
258
+ //# sourceMappingURL=chunk-4U3DMA2Y.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  LOCAL_LLM_PRESETS,
3
3
  runLiveProviderPicker
4
- } from "./chunk-JBSQ7ONN.js";
4
+ } from "./chunk-ZNZJ34RF.js";
5
5
  import {
6
6
  openBrowser,
7
7
  runCodexOAuthLogin,
@@ -1327,4 +1327,4 @@ export {
1327
1327
  addKeyForProvider,
1328
1328
  runAuthLocal
1329
1329
  };
1330
- //# sourceMappingURL=chunk-I2BM6FK6.js.map
1330
+ //# sourceMappingURL=chunk-L5CE52XW.js.map
@@ -2,76 +2,9 @@
2
2
  // src/plugin-management.ts
3
3
  import * as fs from "node:fs/promises";
4
4
  import { atomicWrite } from "@wrongstack/core/utils";
5
- import { OFFICIAL_PLUGIN_AUDIT_ENTRIES } from "@wrongstack/plugins/audit";
6
- var HOST_PLUGIN_AUDIT_ENTRIES = [
7
- {
8
- name: "wstack-prompts",
9
- risk: "medium",
10
- summary: "Prompt library and prompt authoring commands.",
11
- defaultState: "active",
12
- canDisable: true
13
- },
14
- {
15
- name: "wstack-sync",
16
- risk: "medium",
17
- summary: "Cloud sync commands for prompts, skills, settings, memory, and history.",
18
- defaultState: "active",
19
- canDisable: true
20
- },
21
- {
22
- name: "wstack-git",
23
- risk: "high",
24
- summary: "Git commands for commit, status checks, and push.",
25
- defaultState: "active",
26
- canDisable: true
27
- },
28
- {
29
- name: "wstack-observability",
30
- risk: "low",
31
- summary: "Runtime metrics and health slash commands.",
32
- defaultState: "active",
33
- canDisable: true
34
- },
35
- {
36
- name: "wstack-chimera",
37
- risk: "medium",
38
- summary: "Spawns a post-session code review subagent when explicitly enabled.",
39
- defaultState: "inactive",
40
- canDisable: true
41
- },
42
- {
43
- name: "wstack-skills",
44
- risk: "medium",
45
- summary: "Skill library, authoring, install, update, and uninstall commands.",
46
- defaultState: "active",
47
- canDisable: true
48
- },
49
- {
50
- name: "wstack-plan",
51
- risk: "medium",
52
- summary: "Strategic plan board slash command.",
53
- defaultState: "active",
54
- canDisable: true
55
- },
56
- {
57
- name: "@wrongstack/plug-lsp",
58
- risk: "medium",
59
- summary: "Language Server Protocol tools and slash commands.",
60
- defaultState: "inactive",
61
- canDisable: true
62
- },
63
- {
64
- name: "telegram",
65
- risk: "medium",
66
- summary: "Telegram bridge for messages, approvals, and notifications.",
67
- defaultState: "inactive",
68
- canDisable: true
69
- }
70
- ];
71
- var PLUGIN_AUDIT_ENTRIES = Object.freeze([
72
- ...HOST_PLUGIN_AUDIT_ENTRIES,
73
- ...OFFICIAL_PLUGIN_AUDIT_ENTRIES
74
- ]);
5
+ import {
6
+ PLUGIN_AUDIT_ENTRIES
7
+ } from "@wrongstack/plugins/plugin-audit-catalog";
75
8
  var OFFICIAL_PLUGINS = [
76
9
  {
77
10
  alias: "telegram",
@@ -557,4 +490,4 @@ export {
557
490
  PLUGIN_AUDIT_ENTRIES,
558
491
  runPluginManagementCommand
559
492
  };
560
- //# sourceMappingURL=chunk-XWEGWYDU.js.map
493
+ //# sourceMappingURL=chunk-PEKUKUCH.js.map
@@ -1020,4 +1020,4 @@ export {
1020
1020
  runLiveProviderPicker,
1021
1021
  runPicker
1022
1022
  };
1023
- //# sourceMappingURL=chunk-JBSQ7ONN.js.map
1023
+ //# sourceMappingURL=chunk-ZNZJ34RF.js.map