@wrongstack/cli 1.1.4 → 1.1.5

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.
Files changed (100) hide show
  1. package/dist/{acp-MZ5MQBFN.js → acp-NKUEYJDZ.js} +6 -5
  2. package/dist/acp-leader/acp-leader-confirm.d.ts +2 -0
  3. package/dist/acp-leader/acp-leader-host-binding.d.ts +1 -0
  4. package/dist/acp-leader/acp-leader-host.d.ts +2 -0
  5. package/dist/acp-leader/acp-leader-picker.d.ts +6 -3
  6. package/dist/acp-leader/acp-leader-stream.d.ts +1 -0
  7. package/dist/{auth-IHQS6AFW.js → auth-2ZG5DBHS.js} +4 -4
  8. package/dist/boot/launch-menu-arrow.d.ts +20 -0
  9. package/dist/boot/launch-menu-types.d.ts +36 -0
  10. package/dist/boot/launch-menu.d.ts +1 -57
  11. package/dist/boot/tui-session-resume-rollback.d.ts +31 -0
  12. package/dist/{boot-auto-thin-7D4OVEWA.js → boot-auto-thin-N2CIGTXE.js} +3 -3
  13. package/dist/{chunk-TZPKOS5G.js → chunk-2XQ6SRKG.js} +2 -2
  14. package/dist/{chunk-JKTJSLUT.js → chunk-5SGMUDP5.js} +242 -18
  15. package/dist/{chunk-3EXRPTAU.js → chunk-5TQ65PXQ.js} +17 -17
  16. package/dist/{chunk-2LTHDKZX.js → chunk-7BM4LGKQ.js} +18 -18
  17. package/dist/{chunk-VAQXOZKP.js → chunk-AJM4EFCM.js} +139 -136
  18. package/dist/{chunk-C2BBH4S4.js → chunk-E3MJFAFR.js} +2 -2
  19. package/dist/{chunk-AWRZWPJ3.js → chunk-JFYQGMMM.js} +99 -75
  20. package/dist/{chunk-BIGSVBPI.js → chunk-KNYIEQAY.js} +64 -61
  21. package/dist/{chunk-GKGWPFW2.js → chunk-LUEO5HLZ.js} +1 -1
  22. package/dist/chunk-LYWOV4OX.js +252 -0
  23. package/dist/{chunk-COGI7EQU.js → chunk-M7FNHCE3.js} +621 -9
  24. package/dist/{chunk-75OLD563.js → chunk-M7PSENGF.js} +3 -1
  25. package/dist/{chunk-TAE3EGBM.js → chunk-MEBXWI7U.js} +5 -5
  26. package/dist/{chunk-I5LJLKA3.js → chunk-MKMM5RIW.js} +12 -5
  27. package/dist/{chunk-ZF4HRR5F.js → chunk-P7MEEUGT.js} +275 -250
  28. package/dist/chunk-QLYPIJ7X.js +258 -0
  29. package/dist/chunk-RN5CFAVQ.js +292 -0
  30. package/dist/{chunk-WDXNBYGD.js → chunk-TDP7CZGE.js} +6 -1
  31. package/dist/{chunk-6VPWQ4TG.js → chunk-UROB7MK5.js} +2 -1
  32. package/dist/chunk-VEESMPTX.js +254 -0
  33. package/dist/{chunk-IJLIAPCW.js → chunk-VPSAKGLK.js} +47 -47
  34. package/dist/{cli-context-E44HQ4ZO.js → cli-context-CQYGIWOU.js} +247 -236
  35. package/dist/{cli-main-OT63I2FX.js → cli-main-VRUJNUBX.js} +1743 -1491
  36. package/dist/cli-main-boot.d.ts +1 -1
  37. package/dist/config-doctor-known-keys.d.ts +33 -0
  38. package/dist/config-doctor.d.ts +2 -47
  39. package/dist/config-history-support.d.ts +36 -0
  40. package/dist/config-history.d.ts +1 -1
  41. package/dist/{config-transfer-Y7XJMJRN.js → config-transfer-B4GOZTFC.js} +2 -2
  42. package/dist/{execution-OK34CJKJ.js → execution-IV72RUSM.js} +5883 -5792
  43. package/dist/execution-tui.d.ts +30 -0
  44. package/dist/fleet/acp-wrongstack-bridge.d.ts +11 -3
  45. package/dist/fleet/host-acp.d.ts +3 -0
  46. package/dist/fleet/wrongforge-client.d.ts +116 -0
  47. package/dist/fleet/wrongforge-gateway.d.ts +20 -0
  48. package/dist/fleet/wrongforge-info.d.ts +32 -0
  49. package/dist/fleet/wrongforge-quota.d.ts +10 -0
  50. package/dist/fleet/wrongforge-runner.d.ts +37 -0
  51. package/dist/fleet/wrongforge-runtime.d.ts +10 -0
  52. package/dist/{hq-JD5AZVMG.js → hq-54PQYR5O.js} +311 -307
  53. package/dist/hq-server/sweeps.d.ts +28 -0
  54. package/dist/{hq-server-BI23EPM7.js → hq-server-YK7FBLL6.js} +3 -3
  55. package/dist/index.js +5 -5
  56. package/dist/mcp-22CFBX4H.js +236 -0
  57. package/dist/mcp-serve.d.ts +0 -63
  58. package/dist/{modeldiag-HDIKG37X.js → modeldiag-5PBB777J.js} +4 -4
  59. package/dist/{per-subcommand-help-4GYSCMLU.js → per-subcommand-help-MQGERD4E.js} +2 -2
  60. package/dist/plugin-llm-command.d.ts +9 -0
  61. package/dist/{plugin-usage-TYF5HY4K.js → plugin-usage-UWKYMNQU.js} +3 -3
  62. package/dist/{plugins-XGAXDLPT.js → plugins-VP7JQH47.js} +4 -4
  63. package/dist/{sdd-runtime-6MFUXWJK.js → sdd-runtime-HIJ4Z5TF.js} +2 -2
  64. package/dist/services/sdd/state.d.ts +2 -0
  65. package/dist/session-event-wiring-types.d.ts +62 -0
  66. package/dist/session-event-wiring.d.ts +2 -52
  67. package/dist/{sessions-config-SJVQXCIE.js → sessions-config-7MK742OW.js} +2 -2
  68. package/dist/short-circuit-flags-AGHURHMQ.js +11 -0
  69. package/dist/slash-commands/command-context-fleet.d.ts +187 -0
  70. package/dist/slash-commands/command-context-sdd-goal.d.ts +102 -0
  71. package/dist/slash-commands/command-context.d.ts +3 -282
  72. package/dist/slash-commands/project-switch-interactive.d.ts +11 -0
  73. package/dist/slash-commands/setmodel-helpers.d.ts +36 -0
  74. package/dist/subcommands/handlers/hq-token.d.ts +3 -0
  75. package/dist/subcommands/handlers/hq.d.ts +0 -21
  76. package/dist/subcommands/handlers/per-subcommand-help-operations.d.ts +8 -0
  77. package/dist/subcommands/handlers/tools-cli-args.d.ts +57 -0
  78. package/dist/subcommands/handlers/tools-cli.d.ts +5 -0
  79. package/dist/subcommands/handlers/tools-serve.d.ts +4 -0
  80. package/dist/{subcommands-YADUV7IJ.js → subcommands-OCJNO57E.js} +2 -2
  81. package/dist/tool-gateway-http.d.ts +30 -0
  82. package/dist/tool-gateway.d.ts +185 -0
  83. package/dist/tools-cli-44MLIUQO.js +509 -0
  84. package/dist/tools-serve-TRCET2M7.js +102 -0
  85. package/dist/{tools-skills-55QVTMSK.js → tools-skills-WDTMCE46.js} +7 -2
  86. package/dist/tuneup-runtime-checks.d.ts +7 -0
  87. package/dist/tuneup-types.d.ts +118 -0
  88. package/dist/tuneup.d.ts +3 -122
  89. package/dist/{typesafe-YBEADNAH.js → typesafe-QLSMFU7J.js} +1 -1
  90. package/dist/{version-help-RBZC5GZZ.js → version-help-X6CC4CFY.js} +2 -2
  91. package/dist/{webui-server-CB64CFDG.js → webui-server-V2R5WQUK.js} +44 -6
  92. package/dist/wiring/provider-runtime-setup.d.ts +3 -1
  93. package/dist/wiring/session-runtime.d.ts +1 -1
  94. package/dist/wrongforge-gateway-UOFBK56J.js +92 -0
  95. package/dist/wrongforge-leader/wrongforge-leader-gateway.d.ts +9 -0
  96. package/dist/wrongforge-leader/wrongforge-leader-picker.d.ts +12 -0
  97. package/dist/wrongforge-leader/wrongforge-leader-provider.d.ts +49 -0
  98. package/package.json +1 -1
  99. package/dist/mcp-W7A5HUXV.js +0 -560
  100. package/dist/short-circuit-flags-QEXUS3BY.js +0 -11
@@ -0,0 +1,118 @@
1
+ import type { Config } from '@wrongstack/core/types';
2
+ import type { UpdateInfo } from './update-check.js';
3
+ type TuneupSeverity = 'error' | 'warning' | 'info' | 'ok';
4
+ /** Stable check-group ids — one section per group in the rendered report. */
5
+ export type TuneupCategory = 'version' | 'autonomy' | 'skills' | 'mcp' | 'plugins' | 'memory' | 'hooks' | 'permissions' | 'performance' | 'reliability' | 'config';
6
+ /**
7
+ * A structured, deterministic repair the command knows how to apply.
8
+ * `set-config` is the generic one — a dot-path into the global config plus the
9
+ * value to set — so most knobs need no bespoke apply logic.
10
+ */
11
+ export type TuneupAction = {
12
+ kind: 'set-config';
13
+ path: string[];
14
+ value: unknown;
15
+ label: string;
16
+ } | {
17
+ kind: 'add-exec-allow';
18
+ commands: string[];
19
+ } | {
20
+ kind: 'normalize-hook-timeout';
21
+ event: string;
22
+ index: number;
23
+ timeoutMs: number;
24
+ };
25
+ export interface TuneupFinding {
26
+ category: TuneupCategory;
27
+ severity: TuneupSeverity;
28
+ /** One-line problem statement. */
29
+ problem: string;
30
+ /** Optional human hint about the recommended action. */
31
+ suggestion?: string | undefined;
32
+ /** Present when a deterministic auto-fix exists; short description shown in the report. */
33
+ fix?: string | undefined;
34
+ /** Machine-readable descriptor the command applies on `/tuneup fix`. */
35
+ action?: TuneupAction | undefined;
36
+ /** A line folded into the agent follow-up turn (fuzzy items with no mechanical fix). */
37
+ handoff?: string | undefined;
38
+ }
39
+ /** A discovered skill, reduced to what the checks need. */
40
+ export interface TuneupSkill {
41
+ name: string;
42
+ source: string;
43
+ /** Body length in chars, when the command could read it (best-effort). */
44
+ bodyChars?: number | undefined;
45
+ }
46
+ /** Live MCP server status, reduced from `mcpRegistry.describe()`. */
47
+ interface TuneupMcpServer {
48
+ name: string;
49
+ state: string;
50
+ enabled: boolean;
51
+ toolCount: number;
52
+ }
53
+ /** An instruction/memory file layer to compare + size-check. */
54
+ export interface TuneupMemoryFile {
55
+ /** Human label, e.g. "user memory" or "project AGENTS.md". */
56
+ label: string;
57
+ path: string;
58
+ content: string;
59
+ /** True for committed/shared layers (project AGENTS.md, root CLAUDE.md). */
60
+ committed: boolean;
61
+ }
62
+ /** The persistent permission trust file, `~/.wrongstack/projects/<hash>/trust.json`. */
63
+ export type TuneupTrustPolicy = Record<string, {
64
+ allow?: string[] | undefined;
65
+ deny?: string[] | undefined;
66
+ auto?: boolean | undefined;
67
+ }>;
68
+ /** Ambient facts the command precomputes (host / disk / env) for the checks. */
69
+ interface TuneupEnv {
70
+ /** Logical CPU count, for the maxConcurrent sanity check. */
71
+ cpuCount?: number | undefined;
72
+ /** Number of configured providers, for the fallback-chain check. */
73
+ providerCount?: number | undefined;
74
+ /** Whether the secret vault is passphrase-hardened at rest. */
75
+ vaultHardened?: boolean | undefined;
76
+ /** Total bytes of on-disk session logs for this project (disk-hygiene check). */
77
+ sessionBytes?: number | undefined;
78
+ }
79
+ export interface TuneupInput {
80
+ config: Config;
81
+ skills: TuneupSkill[];
82
+ /** `config.skills.eagerMaxChars` or its default. */
83
+ eagerMaxChars: number;
84
+ skillMode: 'eager' | 'progressive';
85
+ /** Live MCP status when the host wired `mcpStatus`; undefined → skip live MCP checks. */
86
+ mcp?: TuneupMcpServer[] | undefined;
87
+ /** Instruction-file layers (user memory, project AGENTS.md, root CLAUDE.md/AGENTS.md). */
88
+ memoryFiles: TuneupMemoryFile[];
89
+ /** Self-update info (from `checkForUpdate`), when the version check ran. */
90
+ update?: UpdateInfo | undefined;
91
+ /** Parsed trust file, when present. */
92
+ trust?: TuneupTrustPolicy | undefined;
93
+ /**
94
+ * Denied read-only commands mined from session history (optional richer
95
+ * signal). Each entry is a command line and how many times it was denied.
96
+ */
97
+ deniedFromHistory?: Array<{
98
+ command: string;
99
+ count: number;
100
+ }> | undefined;
101
+ /** Ambient host/disk facts. */
102
+ env?: TuneupEnv | undefined;
103
+ /** Count of `/doctor`-style config issues (from `diagnoseConfig`). */
104
+ configIssues?: number | undefined;
105
+ /**
106
+ * Power profile: `/tuneup fix --power`. Gates the autonomy/yolo/director
107
+ * actions so a plain tune-up never flips them (respects the user-owned
108
+ * autonomy invariant).
109
+ */
110
+ power?: boolean | undefined;
111
+ }
112
+ export interface TuneupReport {
113
+ findings: TuneupFinding[];
114
+ /** Composed agent follow-up prompt for fuzzy items; empty when none. */
115
+ agentHandoff: string;
116
+ }
117
+ export {};
118
+ //# sourceMappingURL=tuneup-types.d.ts.map
package/dist/tuneup.d.ts CHANGED
@@ -1,3 +1,6 @@
1
+ import type { TuneupFinding, TuneupInput, TuneupReport } from './tuneup-types.js';
2
+ export { checkPerformance, checkPermissions, checkReliability, isReadOnlyCommand, } from './tuneup-runtime-checks.js';
3
+ export type { TuneupAction, TuneupCategory, TuneupFinding, TuneupInput, TuneupMemoryFile, TuneupSkill, TuneupTrustPolicy, } from './tuneup-types.js';
1
4
  /**
2
5
  * Tune-up engine — deterministic health, context-cost, and performance checks
3
6
  * for a WrongStack session, mapping the "clean up + speed up your setup" idea
@@ -17,126 +20,8 @@
17
20
  * - `handoff` — a line folded into an agent follow-up turn for the fuzzy,
18
21
  * judgement-heavy items (instruction-file dedup / split).
19
22
  */
20
- import type { Config } from '@wrongstack/core/types';
21
- import type { UpdateInfo } from './update-check.js';
22
- type TuneupSeverity = 'error' | 'warning' | 'info' | 'ok';
23
- /** Stable check-group ids — one section per group in the rendered report. */
24
- export type TuneupCategory = 'version' | 'autonomy' | 'skills' | 'mcp' | 'plugins' | 'memory' | 'hooks' | 'permissions' | 'performance' | 'reliability' | 'config';
25
- /**
26
- * A structured, deterministic repair the command knows how to apply.
27
- * `set-config` is the generic one — a dot-path into the global config plus the
28
- * value to set — so most knobs need no bespoke apply logic.
29
- */
30
- export type TuneupAction = {
31
- kind: 'set-config';
32
- path: string[];
33
- value: unknown;
34
- label: string;
35
- } | {
36
- kind: 'add-exec-allow';
37
- commands: string[];
38
- } | {
39
- kind: 'normalize-hook-timeout';
40
- event: string;
41
- index: number;
42
- timeoutMs: number;
43
- };
44
- export interface TuneupFinding {
45
- category: TuneupCategory;
46
- severity: TuneupSeverity;
47
- /** One-line problem statement. */
48
- problem: string;
49
- /** Optional human hint about the recommended action. */
50
- suggestion?: string | undefined;
51
- /** Present when a deterministic auto-fix exists; short description shown in the report. */
52
- fix?: string | undefined;
53
- /** Machine-readable descriptor the command applies on `/tuneup fix`. */
54
- action?: TuneupAction | undefined;
55
- /** A line folded into the agent follow-up turn (fuzzy items with no mechanical fix). */
56
- handoff?: string | undefined;
57
- }
58
- /** A discovered skill, reduced to what the checks need. */
59
- export interface TuneupSkill {
60
- name: string;
61
- source: string;
62
- /** Body length in chars, when the command could read it (best-effort). */
63
- bodyChars?: number | undefined;
64
- }
65
- /** Live MCP server status, reduced from `mcpRegistry.describe()`. */
66
- interface TuneupMcpServer {
67
- name: string;
68
- state: string;
69
- enabled: boolean;
70
- toolCount: number;
71
- }
72
- /** An instruction/memory file layer to compare + size-check. */
73
- export interface TuneupMemoryFile {
74
- /** Human label, e.g. "user memory" or "project AGENTS.md". */
75
- label: string;
76
- path: string;
77
- content: string;
78
- /** True for committed/shared layers (project AGENTS.md, root CLAUDE.md). */
79
- committed: boolean;
80
- }
81
- /** The persistent permission trust file, `~/.wrongstack/projects/<hash>/trust.json`. */
82
- export type TuneupTrustPolicy = Record<string, {
83
- allow?: string[] | undefined;
84
- deny?: string[] | undefined;
85
- auto?: boolean | undefined;
86
- }>;
87
- /** Ambient facts the command precomputes (host / disk / env) for the checks. */
88
- interface TuneupEnv {
89
- /** Logical CPU count, for the maxConcurrent sanity check. */
90
- cpuCount?: number | undefined;
91
- /** Number of configured providers, for the fallback-chain check. */
92
- providerCount?: number | undefined;
93
- /** Whether the secret vault is passphrase-hardened at rest. */
94
- vaultHardened?: boolean | undefined;
95
- /** Total bytes of on-disk session logs for this project (disk-hygiene check). */
96
- sessionBytes?: number | undefined;
97
- }
98
- export interface TuneupInput {
99
- config: Config;
100
- skills: TuneupSkill[];
101
- /** `config.skills.eagerMaxChars` or its default. */
102
- eagerMaxChars: number;
103
- skillMode: 'eager' | 'progressive';
104
- /** Live MCP status when the host wired `mcpStatus`; undefined → skip live MCP checks. */
105
- mcp?: TuneupMcpServer[] | undefined;
106
- /** Instruction-file layers (user memory, project AGENTS.md, root CLAUDE.md/AGENTS.md). */
107
- memoryFiles: TuneupMemoryFile[];
108
- /** Self-update info (from `checkForUpdate`), when the version check ran. */
109
- update?: UpdateInfo | undefined;
110
- /** Parsed trust file, when present. */
111
- trust?: TuneupTrustPolicy | undefined;
112
- /**
113
- * Denied read-only commands mined from session history (optional richer
114
- * signal). Each entry is a command line and how many times it was denied.
115
- */
116
- deniedFromHistory?: Array<{
117
- command: string;
118
- count: number;
119
- }> | undefined;
120
- /** Ambient host/disk facts. */
121
- env?: TuneupEnv | undefined;
122
- /** Count of `/doctor`-style config issues (from `diagnoseConfig`). */
123
- configIssues?: number | undefined;
124
- /**
125
- * Power profile: `/tuneup fix --power`. Gates the autonomy/yolo/director
126
- * actions so a plain tune-up never flips them (respects the user-owned
127
- * autonomy invariant).
128
- */
129
- power?: boolean | undefined;
130
- }
131
- interface TuneupReport {
132
- findings: TuneupFinding[];
133
- /** Composed agent follow-up prompt for fuzzy items; empty when none. */
134
- agentHandoff: string;
135
- }
136
23
  /** Default eager skill-body budget (mirrors `SkillsConfig.eagerMaxChars`). */
137
24
  export declare const DEFAULT_EAGER_MAX_CHARS = 24000;
138
- /** True when `command` is safely read-only by our conservative heuristic. */
139
- export declare function isReadOnlyCommand(command: string): boolean;
140
25
  export declare function checkSkills(input: TuneupInput): TuneupFinding[];
141
26
  export declare function checkMcp(input: TuneupInput): TuneupFinding[];
142
27
  export declare function checkPlugins(input: TuneupInput): TuneupFinding[];
@@ -146,9 +31,6 @@ export declare function checkHooks(input: TuneupInput): TuneupFinding[];
146
31
  export declare function checkAutonomy(input: TuneupInput): TuneupFinding[];
147
32
  /** Power-only: yolo + director launch defaults (explicit `--power` opt-in). */
148
33
  export declare function checkPowerProfile(input: TuneupInput): TuneupFinding[];
149
- export declare function checkPermissions(input: TuneupInput): TuneupFinding[];
150
- export declare function checkPerformance(input: TuneupInput): TuneupFinding[];
151
- export declare function checkReliability(input: TuneupInput): TuneupFinding[];
152
34
  export declare function checkConfigDoctor(input: TuneupInput): TuneupFinding[];
153
35
  /** Run every check and compose the report + agent hand-off text. */
154
36
  export declare function runTuneup(input: TuneupInput): TuneupReport;
@@ -158,5 +40,4 @@ export declare function runTuneup(input: TuneupInput): TuneupReport;
158
40
  * tier). Kept here so it is unit-testable alongside the checks.
159
41
  */
160
42
  export declare function buildDeepPrompt(report: TuneupReport): string;
161
- export {};
162
43
  //# sourceMappingURL=tuneup.d.ts.map
@@ -341,4 +341,4 @@ async function lintConventions(deps, write) {
341
341
  export {
342
342
  typesafeCmd
343
343
  };
344
- //# sourceMappingURL=typesafe-YBEADNAH.js.map
344
+ //# sourceMappingURL=typesafe-QLSMFU7J.js.map
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  helpCmd,
3
3
  versionCmd
4
- } from "./chunk-6VPWQ4TG.js";
4
+ } from "./chunk-UROB7MK5.js";
5
5
  import "./chunk-HKMOIIPQ.js";
6
6
  import "./chunk-W23PY4IJ.js";
7
7
  export {
8
8
  helpCmd,
9
9
  versionCmd
10
10
  };
11
- //# sourceMappingURL=version-help-RBZC5GZZ.js.map
11
+ //# sourceMappingURL=version-help-X6CC4CFY.js.map
@@ -15,8 +15,15 @@ import {
15
15
  createHqCommandDispatcher,
16
16
  createProjectKanbanAssignHandler,
17
17
  createProjectKanbanTransitionHandler,
18
- installedBridgeAgents
19
- } from "./chunk-JKTJSLUT.js";
18
+ installedBridgeAgents,
19
+ readCachedWrongForgeInfo,
20
+ refreshWrongForgeInfoCache,
21
+ reportWrongForgeQuota
22
+ } from "./chunk-5SGMUDP5.js";
23
+ import {
24
+ WRONGFORGE_AGENT_ID,
25
+ resolveWrongForgeEndpoint
26
+ } from "./chunk-VEESMPTX.js";
20
27
  import {
21
28
  startCliHqConnection
22
29
  } from "./chunk-76JE54WD.js";
@@ -26,7 +33,7 @@ import {
26
33
  import {
27
34
  ACP_LEADER_PROVIDER_ID,
28
35
  setAcpLeaderSessionAgents
29
- } from "./chunk-GKGWPFW2.js";
36
+ } from "./chunk-LUEO5HLZ.js";
30
37
  import {
31
38
  CLI_VERSION
32
39
  } from "./chunk-HKMOIIPQ.js";
@@ -1118,12 +1125,42 @@ function acpLeaderPickable(config) {
1118
1125
  }
1119
1126
  ];
1120
1127
  }
1128
+ var HOST_BUILT_LEADERS = /* @__PURE__ */ new Set([ACP_LEADER_PROVIDER_ID, "wrongforge"]);
1121
1129
  function buildAcpLeaderProvider(registry, providerId, config) {
1122
1130
  const type = config.type ?? providerId;
1123
- if (type !== ACP_LEADER_PROVIDER_ID || !registry?.has(type)) return void 0;
1131
+ if (!HOST_BUILT_LEADERS.has(type) || !registry?.has(type)) return void 0;
1124
1132
  return registry.create({ ...config, type: providerId }, type);
1125
1133
  }
1126
1134
 
1135
+ // src/wrongforge-leader/wrongforge-leader-picker.ts
1136
+ function wrongForgeLeaderPickable() {
1137
+ const ep = resolveWrongForgeEndpoint();
1138
+ if (!ep) return [];
1139
+ void reportWrongForgeQuota({ endpoint: ep });
1140
+ refreshWrongForgeInfoCache(ep);
1141
+ const info = readCachedWrongForgeInfo();
1142
+ if (!info) return [];
1143
+ return [
1144
+ {
1145
+ id: WRONGFORGE_AGENT_ID,
1146
+ type: WRONGFORGE_AGENT_ID,
1147
+ refreshQuota: () => reportWrongForgeQuota({ endpoint: ep, force: true }),
1148
+ models: info.models.map((id) => {
1149
+ const details = info.modelDetails?.find((model) => model.id === id);
1150
+ return {
1151
+ id,
1152
+ name: id === info.defaultModel ? `${id} (WrongForge default)` : id,
1153
+ description: details?.description || "WrongForge leading the session",
1154
+ ...details ? {
1155
+ reasoningEffortLevels: details.effortLevels,
1156
+ effortSupported: details.effortLevels.length > 0
1157
+ } : {}
1158
+ };
1159
+ })
1160
+ }
1161
+ ];
1162
+ }
1163
+
1127
1164
  // src/webui-server/credential-watcher.ts
1128
1165
  import { TOKENS } from "@wrongstack/core/kernel";
1129
1166
  import { watchProviderConfig } from "@wrongstack/core/storage";
@@ -1209,7 +1246,8 @@ function createEmbeddedProviderPlane(input) {
1209
1246
  getDisabledProviders: () => opts.appConfig?.disabledProviders ?? [],
1210
1247
  // `acp` with the installed ACP agents: an agent such as Claude Code can
1211
1248
  // lead a tab like a model (see docs/slash/acp.md).
1212
- hostProviders: () => acpLeaderPickable(opts.appConfig),
1249
+ // `wrongforge` with the models the machine's WrongForge serves.
1250
+ hostProviders: () => [...acpLeaderPickable(opts.appConfig), ...wrongForgeLeaderPickable()],
1213
1251
  send,
1214
1252
  broadcast,
1215
1253
  log: (m) => console.log(m)
@@ -2496,4 +2534,4 @@ async function runWebUI(opts) {
2496
2534
  export {
2497
2535
  runWebUI
2498
2536
  };
2499
- //# sourceMappingURL=webui-server-CB64CFDG.js.map
2537
+ //# sourceMappingURL=webui-server-V2R5WQUK.js.map
@@ -8,7 +8,9 @@ export declare function serializeProviderRuntimeSnapshot(snapshot: unknown): str
8
8
  type AnyObj = any;
9
9
  export interface ProviderRuntimeDeps {
10
10
  config: Config;
11
- /** Called whenever the function patches config, so the caller stays in sync. */
11
+ /** Re-run the canonical layered config loader for file-triggered hot reload. */
12
+ loadConfig: () => Promise<Config>;
13
+ /** Called whenever the live ConfigStore changes, so the caller stays in sync. */
12
14
  onConfigUpdate: (config: Config) => void;
13
15
  configStore: AnyObj;
14
16
  /** Shared live fallback profile manager from the runtime container. */
@@ -47,7 +47,7 @@ interface SessionRuntimeArgs {
47
47
  governanceHandle: GovernanceHandle;
48
48
  }
49
49
  export declare function setupSessionRuntime(args: SessionRuntimeArgs): {
50
- errorRing: import("../session-event-wiring.js").ErrorEntry[];
50
+ errorRing: import("../session-event-wiring-types.js").ErrorEntry[];
51
51
  sessionBridge: import("@wrongstack/core/storage").SessionEventBridge;
52
52
  stats: SessionStats;
53
53
  pipelines: import("@wrongstack/core/agent").AgentPipelines;
@@ -0,0 +1,92 @@
1
+ import {
2
+ serveToolGatewayHttp
3
+ } from "./chunk-RN5CFAVQ.js";
4
+ import {
5
+ createToolGateway,
6
+ resolveGatewayRegistry
7
+ } from "./chunk-LYWOV4OX.js";
8
+ import "./chunk-W23PY4IJ.js";
9
+
10
+ // src/fleet/wrongforge-gateway.ts
11
+ import { randomBytes } from "node:crypto";
12
+ var DUPLICATES_OF_WRONGFORGE_TOOLS = [
13
+ "read",
14
+ "glob",
15
+ "grep",
16
+ "fetch",
17
+ "read_url_content",
18
+ "tree"
19
+ ];
20
+ var WORKER_WITHHELD_TOOLS = /* @__PURE__ */ new Set([
21
+ "delegate",
22
+ "spawn_subagent",
23
+ "define_subagent",
24
+ "assign_task",
25
+ "await_tasks",
26
+ "roll_up",
27
+ "ask_subagent",
28
+ "ask_result",
29
+ "fleet",
30
+ "fleet_status",
31
+ "fleet_emit",
32
+ "session_note",
33
+ "session_rename",
34
+ "terminate_subagent",
35
+ "terminate_all",
36
+ "work_complete",
37
+ "nextsteps",
38
+ "collab_debug",
39
+ "plugin_manager",
40
+ "mcp_control"
41
+ ]);
42
+ var gateways = /* @__PURE__ */ new Map();
43
+ function sharedWrongForgeGateway(opts) {
44
+ const existing = gateways.get(opts.projectRoot);
45
+ if (existing) return existing;
46
+ const started = startGateway(opts);
47
+ gateways.set(opts.projectRoot, started);
48
+ started.catch(() => {
49
+ if (gateways.get(opts.projectRoot) === started) gateways.delete(opts.projectRoot);
50
+ });
51
+ return started;
52
+ }
53
+ async function startGateway(opts) {
54
+ const registry = resolveGatewayRegistry(opts.registry, opts.config);
55
+ const gateway = await createToolGateway({
56
+ registry,
57
+ config: opts.config,
58
+ cwd: opts.projectRoot,
59
+ projectRoot: opts.projectRoot,
60
+ yolo: true,
61
+ ...opts.yoloPlus ? { yoloPlus: opts.yoloPlus } : {},
62
+ whitelist: new Set(
63
+ registry.list().map((t) => t.name).filter((name) => !WORKER_WITHHELD_TOOLS.has(name))
64
+ ),
65
+ remoteAgent: true,
66
+ ...opts.log ? { onWarning: opts.log } : {}
67
+ });
68
+ const token = randomBytes(24).toString("hex");
69
+ const handle = await serveToolGatewayHttp({
70
+ gateway,
71
+ registry,
72
+ token,
73
+ port: 0,
74
+ host: "127.0.0.1",
75
+ unref: true,
76
+ ...opts.log ? { log: opts.log } : {}
77
+ });
78
+ return {
79
+ url: handle.url.replace(/\/+$/, ""),
80
+ token,
81
+ list_path: "/v1/tools",
82
+ call_path: "/v1/tools/{name}/call",
83
+ name_prefix: "wstack_",
84
+ deny: DUPLICATES_OF_WRONGFORGE_TOOLS,
85
+ optional: true
86
+ };
87
+ }
88
+ export {
89
+ WORKER_WITHHELD_TOOLS,
90
+ sharedWrongForgeGateway
91
+ };
92
+ //# sourceMappingURL=wrongforge-gateway-UOFBK56J.js.map
@@ -0,0 +1,9 @@
1
+ import type { AcpLeaderHost } from '../acp-leader/acp-leader-host.js';
2
+ import type { WrongForgeGatewaySpec } from '../fleet/wrongforge-client.js';
3
+ export interface LeaderGateway {
4
+ spec: WrongForgeGatewaySpec;
5
+ tools: string[];
6
+ close(): Promise<void>;
7
+ }
8
+ export declare function startLeaderGateway(host: AcpLeaderHost, sessionId: string): Promise<LeaderGateway | undefined>;
9
+ //# sourceMappingURL=wrongforge-leader-gateway.d.ts.map
@@ -0,0 +1,12 @@
1
+ /**
2
+ * The machine's WrongForge as a pickable provider for the WebUI: `wrongforge`,
3
+ * with the models it serves. It has no saved record and no models.dev entry,
4
+ * so the WebUI pickers only offer it through this list.
5
+ *
6
+ * The WebUI asks synchronously, so this reads the cached `/v1/info` list and
7
+ * refreshes the cache in the background for the next look.
8
+ */
9
+ import type { PickableHostProvider } from '../acp-leader/acp-leader-picker.js';
10
+ /** The `wrongforge` entry, or none when no WrongForge is set up here or its models are unknown. */
11
+ export declare function wrongForgeLeaderPickable(): PickableHostProvider[];
12
+ //# sourceMappingURL=wrongforge-leader-picker.d.ts.map
@@ -0,0 +1,49 @@
1
+ import type { AgentContextUsage, Capabilities, Config, Provider, ProviderFactory, Request, Response, StreamEvent } from '@wrongstack/core/types';
2
+ export declare const WRONGFORGE_LEADER_PROVIDER_ID = "wrongforge";
3
+ export interface WrongForgeLeaderProviderOptions {
4
+ id?: string | undefined;
5
+ bootConfig: Config;
6
+ /** Build a WrongStack provider by id, for side requests when `acp.leader.sideModel` is set. */
7
+ buildProvider(providerId: string, config: Config): Provider | undefined;
8
+ fetchImpl?: typeof fetch | undefined;
9
+ }
10
+ export declare class WrongForgeLeaderProvider implements Provider {
11
+ private readonly opts;
12
+ readonly id: string;
13
+ readonly capabilities: Capabilities;
14
+ private readonly sessions;
15
+ private readonly sideProviders;
16
+ constructor(opts: WrongForgeLeaderProviderOptions);
17
+ private config;
18
+ private client;
19
+ private info;
20
+ private model;
21
+ /** A configured side model, when the user named one. */
22
+ private sideProvider;
23
+ complete(req: Request, opts: {
24
+ signal: AbortSignal;
25
+ }): Promise<Response>;
26
+ /** WrongForge as a plain model: one step, no tools, its own throwaway session. */
27
+ private oneShot;
28
+ stream(req: Request, opts: {
29
+ signal: AbortSignal;
30
+ }): AsyncIterable<StreamEvent>;
31
+ /** The turn's prompt; WrongForge joining a conversation under way gets the turns before it. */
32
+ private promptText;
33
+ private wfSessionExists;
34
+ private sessionFor;
35
+ private observeContext;
36
+ /** `/compact` on this route: WrongForge compacts its own session. */
37
+ compactOwnContext(opts: {
38
+ sessionId: string;
39
+ signal: AbortSignal;
40
+ }): Promise<AgentContextUsage | undefined>;
41
+ /** Close every session gateway (process shutdown). */
42
+ closeAll(): Promise<void>;
43
+ }
44
+ /**
45
+ * Registered with the provider registry at boot. Inert unless the session
46
+ * names it (`--provider wrongforge`, `/model wrongforge/<model>`).
47
+ */
48
+ export declare function createWrongForgeLeaderProviderFactory(opts: Omit<WrongForgeLeaderProviderOptions, 'id'>): ProviderFactory;
49
+ //# sourceMappingURL=wrongforge-leader-provider.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrongstack/cli",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
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": [