@wrongstack/cli 1.1.2 → 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.
- package/dist/{acp-HCGUTFNE.js → acp-NKUEYJDZ.js} +14 -5
- package/dist/acp-leader/acp-leader-confirm.d.ts +20 -0
- package/dist/acp-leader/acp-leader-context.d.ts +29 -0
- package/dist/acp-leader/acp-leader-fleet.d.ts +26 -0
- package/dist/acp-leader/acp-leader-host-binding.d.ts +17 -0
- package/dist/acp-leader/acp-leader-host.d.ts +82 -0
- package/dist/acp-leader/acp-leader-picker.d.ts +24 -0
- package/dist/acp-leader/acp-leader-provider.d.ts +85 -0
- package/dist/acp-leader/acp-leader-resume.d.ts +10 -0
- package/dist/acp-leader/acp-leader-stream.d.ts +83 -0
- package/dist/{auth-ANOVZVHE.js → auth-2ZG5DBHS.js} +62 -66
- package/dist/auth-menu/index.d.ts +1 -2
- package/dist/boot/dispatch-webui.d.ts +16 -0
- package/dist/boot/launch-menu-arrow.d.ts +20 -0
- package/dist/boot/launch-menu-types.d.ts +36 -0
- package/dist/boot/launch-menu.d.ts +1 -57
- package/dist/boot/tui-session-resume-rollback.d.ts +31 -0
- package/dist/{boot-auto-thin-7D4OVEWA.js → boot-auto-thin-N2CIGTXE.js} +3 -3
- package/dist/{chunk-TZPKOS5G.js → chunk-2XQ6SRKG.js} +2 -2
- package/dist/chunk-3LEIFO5D.js +65 -0
- package/dist/chunk-5SGMUDP5.js +752 -0
- package/dist/{chunk-3EXRPTAU.js → chunk-5TQ65PXQ.js} +17 -17
- package/dist/{chunk-GRAGMA4B.js → chunk-7BM4LGKQ.js} +18 -18
- package/dist/{chunk-VAQXOZKP.js → chunk-AJM4EFCM.js} +139 -136
- package/dist/{chunk-C2BBH4S4.js → chunk-E3MJFAFR.js} +2 -2
- package/dist/{chunk-5TRZZHMN.js → chunk-JCZ2D3VV.js} +4 -65
- package/dist/{chunk-AWRZWPJ3.js → chunk-JFYQGMMM.js} +99 -75
- package/dist/{chunk-BIGSVBPI.js → chunk-KNYIEQAY.js} +64 -61
- package/dist/chunk-LUEO5HLZ.js +50 -0
- package/dist/chunk-LYWOV4OX.js +252 -0
- package/dist/chunk-M7FNHCE3.js +2070 -0
- package/dist/{chunk-75OLD563.js → chunk-M7PSENGF.js} +3 -1
- package/dist/{chunk-NMXQFQ26.js → chunk-MEBXWI7U.js} +5 -5
- package/dist/{chunk-RAWHRRUJ.js → chunk-MKMM5RIW.js} +209 -201
- package/dist/{chunk-3R3OADC5.js → chunk-P7MEEUGT.js} +281 -252
- package/dist/chunk-QLYPIJ7X.js +258 -0
- package/dist/chunk-RN5CFAVQ.js +292 -0
- package/dist/{chunk-WDXNBYGD.js → chunk-TDP7CZGE.js} +6 -1
- package/dist/{chunk-6VPWQ4TG.js → chunk-UROB7MK5.js} +2 -1
- package/dist/chunk-VEESMPTX.js +254 -0
- package/dist/{chunk-IJLIAPCW.js → chunk-VPSAKGLK.js} +47 -47
- package/dist/{cli-context-YIT4FEDM.js → cli-context-CQYGIWOU.js} +254 -237
- package/dist/{cli-main-JIADJ5OL.js → cli-main-VRUJNUBX.js} +2081 -1594
- package/dist/cli-main-boot.d.ts +1 -1
- package/dist/config-doctor-known-keys.d.ts +33 -0
- package/dist/config-doctor.d.ts +2 -47
- package/dist/config-history-support.d.ts +36 -0
- package/dist/config-history.d.ts +1 -1
- package/dist/{config-transfer-Y7XJMJRN.js → config-transfer-B4GOZTFC.js} +2 -2
- package/dist/{execution-BAP566QC.js → execution-IV72RUSM.js} +5354 -5258
- package/dist/execution-tui.d.ts +30 -0
- package/dist/fleet/acp-live-steer.d.ts +28 -0
- package/dist/fleet/acp-permission-bridge.d.ts +49 -0
- package/dist/fleet/acp-quota-hold.d.ts +3 -0
- package/dist/fleet/acp-quota-reading.d.ts +3 -0
- package/dist/fleet/acp-turn-reminders.d.ts +15 -0
- package/dist/fleet/acp-wrongstack-bridge.d.ts +50 -0
- package/dist/fleet/host-acp.d.ts +23 -2
- package/dist/fleet/wrongforge-client.d.ts +116 -0
- package/dist/fleet/wrongforge-gateway.d.ts +20 -0
- package/dist/fleet/wrongforge-info.d.ts +32 -0
- package/dist/fleet/wrongforge-quota.d.ts +10 -0
- package/dist/fleet/wrongforge-runner.d.ts +37 -0
- package/dist/fleet/wrongforge-runtime.d.ts +10 -0
- package/dist/{hq-JD5AZVMG.js → hq-54PQYR5O.js} +311 -307
- package/dist/hq-server/sweeps.d.ts +28 -0
- package/dist/{hq-server-BI23EPM7.js → hq-server-YK7FBLL6.js} +3 -3
- package/dist/index.js +8 -5
- package/dist/mcp-22CFBX4H.js +236 -0
- package/dist/mcp-serve-project.d.ts +18 -0
- package/dist/mcp-serve.d.ts +0 -63
- package/dist/{modeldiag-HDIKG37X.js → modeldiag-5PBB777J.js} +4 -4
- package/dist/{per-subcommand-help-D6J4ZXW2.js → per-subcommand-help-MQGERD4E.js} +2 -2
- package/dist/plugin-llm-command.d.ts +9 -0
- package/dist/{plugin-usage-TYF5HY4K.js → plugin-usage-UWKYMNQU.js} +3 -3
- package/dist/{plugins-XGAXDLPT.js → plugins-VP7JQH47.js} +4 -4
- package/dist/{sdd-runtime-6MFUXWJK.js → sdd-runtime-HIJ4Z5TF.js} +2 -2
- package/dist/services/sdd/state.d.ts +2 -0
- package/dist/session-event-wiring-types.d.ts +62 -0
- package/dist/session-event-wiring.d.ts +2 -52
- package/dist/{sessions-config-SJVQXCIE.js → sessions-config-7MK742OW.js} +2 -2
- package/dist/short-circuit-flags-AGHURHMQ.js +11 -0
- package/dist/slash-commands/command-context-fleet.d.ts +187 -0
- package/dist/slash-commands/command-context-sdd-goal.d.ts +102 -0
- package/dist/slash-commands/command-context.d.ts +3 -282
- package/dist/slash-commands/project-switch-interactive.d.ts +11 -0
- package/dist/slash-commands/setmodel-helpers.d.ts +36 -0
- package/dist/subcommands/handlers/hq-token.d.ts +3 -0
- package/dist/subcommands/handlers/hq.d.ts +0 -21
- package/dist/subcommands/handlers/per-subcommand-help-operations.d.ts +8 -0
- package/dist/subcommands/handlers/tools-cli-args.d.ts +57 -0
- package/dist/subcommands/handlers/tools-cli.d.ts +5 -0
- package/dist/subcommands/handlers/tools-serve.d.ts +4 -0
- package/dist/{subcommands-VTMIZQBP.js → subcommands-OCJNO57E.js} +2 -2
- package/dist/tool-gateway-http.d.ts +30 -0
- package/dist/tool-gateway.d.ts +185 -0
- package/dist/tools-cli-44MLIUQO.js +509 -0
- package/dist/tools-serve-TRCET2M7.js +102 -0
- package/dist/{tools-skills-55QVTMSK.js → tools-skills-WDTMCE46.js} +7 -2
- package/dist/tuneup-runtime-checks.d.ts +7 -0
- package/dist/tuneup-types.d.ts +118 -0
- package/dist/tuneup.d.ts +3 -122
- package/dist/{typesafe-YBEADNAH.js → typesafe-QLSMFU7J.js} +1 -1
- package/dist/{version-help-RBZC5GZZ.js → version-help-X6CC4CFY.js} +2 -2
- package/dist/{webui-server-HIUY3RHD.js → webui-server-V2R5WQUK.js} +79 -3
- package/dist/wiring/provider-runtime-setup.d.ts +3 -1
- package/dist/wiring/session-runtime.d.ts +1 -1
- package/dist/wrongforge-gateway-UOFBK56J.js +92 -0
- package/dist/wrongforge-leader/wrongforge-leader-gateway.d.ts +9 -0
- package/dist/wrongforge-leader/wrongforge-leader-picker.d.ts +12 -0
- package/dist/wrongforge-leader/wrongforge-leader-provider.d.ts +49 -0
- package/package.json +34 -30
- package/dist/auth-menu/anthropic-oauth.d.ts +0 -43
- package/dist/chunk-XT3NAHRX.js +0 -337
- package/dist/chunk-ZNNFEKDZ.js +0 -319
- package/dist/mcp-2XWBJEQN.js +0 -464
- package/dist/short-circuit-flags-CPCT5MWB.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
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
helpCmd,
|
|
3
3
|
versionCmd
|
|
4
|
-
} from "./chunk-
|
|
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-
|
|
11
|
+
//# sourceMappingURL=version-help-X6CC4CFY.js.map
|
|
@@ -14,14 +14,26 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
createHqCommandDispatcher,
|
|
16
16
|
createProjectKanbanAssignHandler,
|
|
17
|
-
createProjectKanbanTransitionHandler
|
|
18
|
-
|
|
17
|
+
createProjectKanbanTransitionHandler,
|
|
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";
|
|
19
27
|
import {
|
|
20
28
|
startCliHqConnection
|
|
21
29
|
} from "./chunk-76JE54WD.js";
|
|
22
30
|
import {
|
|
23
31
|
WebSocketServer
|
|
24
32
|
} from "./chunk-OZCYZYN2.js";
|
|
33
|
+
import {
|
|
34
|
+
ACP_LEADER_PROVIDER_ID,
|
|
35
|
+
setAcpLeaderSessionAgents
|
|
36
|
+
} from "./chunk-LUEO5HLZ.js";
|
|
25
37
|
import {
|
|
26
38
|
CLI_VERSION
|
|
27
39
|
} from "./chunk-HKMOIIPQ.js";
|
|
@@ -1092,6 +1104,63 @@ import {
|
|
|
1092
1104
|
createEmbeddedProviderOperations
|
|
1093
1105
|
} from "@wrongstack/webui-server";
|
|
1094
1106
|
|
|
1107
|
+
// src/acp-leader/acp-leader-picker.ts
|
|
1108
|
+
import { findAgentDescriptor } from "@wrongstack/acp";
|
|
1109
|
+
function acpLeaderPickable(config) {
|
|
1110
|
+
const agents = installedBridgeAgents(config?.acp);
|
|
1111
|
+
if (agents.length === 0) return [];
|
|
1112
|
+
return [
|
|
1113
|
+
{
|
|
1114
|
+
id: ACP_LEADER_PROVIDER_ID,
|
|
1115
|
+
type: ACP_LEADER_PROVIDER_ID,
|
|
1116
|
+
models: agents.map((id) => {
|
|
1117
|
+
const descriptor = findAgentDescriptor(id);
|
|
1118
|
+
return {
|
|
1119
|
+
id,
|
|
1120
|
+
name: descriptor?.displayName ?? id,
|
|
1121
|
+
description: "ACP agent leading the session",
|
|
1122
|
+
...descriptor?.contextWindow ? { contextWindow: descriptor.contextWindow } : {}
|
|
1123
|
+
};
|
|
1124
|
+
})
|
|
1125
|
+
}
|
|
1126
|
+
];
|
|
1127
|
+
}
|
|
1128
|
+
var HOST_BUILT_LEADERS = /* @__PURE__ */ new Set([ACP_LEADER_PROVIDER_ID, "wrongforge"]);
|
|
1129
|
+
function buildAcpLeaderProvider(registry, providerId, config) {
|
|
1130
|
+
const type = config.type ?? providerId;
|
|
1131
|
+
if (!HOST_BUILT_LEADERS.has(type) || !registry?.has(type)) return void 0;
|
|
1132
|
+
return registry.create({ ...config, type: providerId }, type);
|
|
1133
|
+
}
|
|
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
|
+
|
|
1095
1164
|
// src/webui-server/credential-watcher.ts
|
|
1096
1165
|
import { TOKENS } from "@wrongstack/core/kernel";
|
|
1097
1166
|
import { watchProviderConfig } from "@wrongstack/core/storage";
|
|
@@ -1175,6 +1244,10 @@ function createEmbeddedProviderPlane(input) {
|
|
|
1175
1244
|
providerAuthRegistry: opts.providerAuthRegistry,
|
|
1176
1245
|
getDisabledModels: () => opts.appConfig?.disabledModels ?? [],
|
|
1177
1246
|
getDisabledProviders: () => opts.appConfig?.disabledProviders ?? [],
|
|
1247
|
+
// `acp` with the installed ACP agents: an agent such as Claude Code can
|
|
1248
|
+
// lead a tab like a model (see docs/slash/acp.md).
|
|
1249
|
+
// `wrongforge` with the models the machine's WrongForge serves.
|
|
1250
|
+
hostProviders: () => [...acpLeaderPickable(opts.appConfig), ...wrongForgeLeaderPickable()],
|
|
1178
1251
|
send,
|
|
1179
1252
|
broadcast,
|
|
1180
1253
|
log: (m) => console.log(m)
|
|
@@ -1308,6 +1381,8 @@ function createWebuiRouteContexts({
|
|
|
1308
1381
|
getConfig: () => opts.appConfig,
|
|
1309
1382
|
onMaxContextResolved: opts.onModelContextResolved,
|
|
1310
1383
|
persistPrefs,
|
|
1384
|
+
// The ACP leader's factory lives in the CLI's provider registry.
|
|
1385
|
+
buildProvider: (providerId, config) => buildAcpLeaderProvider(opts.agent.providers, providerId, config),
|
|
1311
1386
|
send,
|
|
1312
1387
|
broadcast,
|
|
1313
1388
|
log: (m) => console.log(m)
|
|
@@ -2302,6 +2377,7 @@ async function runWebUI(opts) {
|
|
|
2302
2377
|
abortControllers
|
|
2303
2378
|
);
|
|
2304
2379
|
sessionAgentsRef = sessionAgents;
|
|
2380
|
+
setAcpLeaderSessionAgents((sessionId) => sessionAgents.peek(sessionId));
|
|
2305
2381
|
const autoWakeHost = opts.leaderAutoWake ? createWebuiLeaderAutoWakeHost({
|
|
2306
2382
|
controller: opts.leaderAutoWake,
|
|
2307
2383
|
events: opts.events,
|
|
@@ -2458,4 +2534,4 @@ async function runWebUI(opts) {
|
|
|
2458
2534
|
export {
|
|
2459
2535
|
runWebUI
|
|
2460
2536
|
};
|
|
2461
|
-
//# sourceMappingURL=webui-server-
|
|
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
|
-
/**
|
|
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
|