@wrongstack/cli 1.1.4 → 1.1.6
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-MZ5MQBFN.js → acp-CZBSFQB7.js} +6 -5
- package/dist/acp-leader/acp-leader-confirm.d.ts +2 -0
- package/dist/acp-leader/acp-leader-host-binding.d.ts +1 -0
- package/dist/acp-leader/acp-leader-host.d.ts +9 -0
- package/dist/acp-leader/acp-leader-picker.d.ts +6 -3
- package/dist/acp-leader/acp-leader-provider.d.ts +10 -0
- package/dist/acp-leader/acp-leader-skills.d.ts +5 -0
- package/dist/acp-leader/acp-leader-stream.d.ts +9 -0
- package/dist/{auth-IHQS6AFW.js → auth-2ZG5DBHS.js} +4 -4
- 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-3EXRPTAU.js → chunk-5TQ65PXQ.js} +17 -17
- package/dist/{chunk-VAQXOZKP.js → chunk-AJM4EFCM.js} +139 -136
- package/dist/{chunk-C2BBH4S4.js → chunk-E3MJFAFR.js} +2 -2
- package/dist/{chunk-COGI7EQU.js → chunk-EAATL6FL.js} +713 -21
- package/dist/{chunk-AWRZWPJ3.js → chunk-FWUIKCCO.js} +152 -123
- package/dist/{chunk-TAE3EGBM.js → chunk-H5DCQFUI.js} +5 -5
- package/dist/{chunk-BIGSVBPI.js → chunk-KNYIEQAY.js} +64 -61
- package/dist/chunk-LYWOV4OX.js +252 -0
- package/dist/{chunk-75OLD563.js → chunk-M7PSENGF.js} +3 -1
- package/dist/{chunk-I5LJLKA3.js → chunk-MKMM5RIW.js} +12 -5
- package/dist/{chunk-ZF4HRR5F.js → chunk-P7MEEUGT.js} +275 -250
- package/dist/chunk-PGC44T7N.js +255 -0
- package/dist/chunk-QLYPIJ7X.js +258 -0
- package/dist/{chunk-JKTJSLUT.js → chunk-QRWXHGLB.js} +242 -18
- 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-IJLIAPCW.js → chunk-VPSAKGLK.js} +47 -47
- package/dist/{chunk-2LTHDKZX.js → chunk-W7X23HI6.js} +18 -18
- package/dist/{chunk-GKGWPFW2.js → chunk-X4DEQLAZ.js} +1 -1
- package/dist/{cli-context-E44HQ4ZO.js → cli-context-6KS3HV5R.js} +247 -236
- package/dist/{cli-main-OT63I2FX.js → cli-main-NF3YGDME.js} +1779 -1494
- 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-OK34CJKJ.js → execution-RVDUXLNT.js} +6522 -6426
- package/dist/execution-tui.d.ts +30 -0
- package/dist/fleet/acp-wrongstack-bridge.d.ts +11 -3
- package/dist/fleet/host-acp.d.ts +3 -0
- 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-V2M4IYCI.js} +320 -306
- package/dist/hq-server/login-attempt-store.d.ts +2 -0
- package/dist/hq-server/sweeps.d.ts +28 -0
- package/dist/{hq-server-BI23EPM7.js → hq-server-QM7EIVGJ.js} +3 -3
- package/dist/index.js +5 -5
- package/dist/mcp-22CFBX4H.js +236 -0
- package/dist/mcp-serve.d.ts +0 -63
- package/dist/{modeldiag-HDIKG37X.js → modeldiag-5PBB777J.js} +4 -4
- package/dist/{per-subcommand-help-4GYSCMLU.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-276OLPIN.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-YADUV7IJ.js → subcommands-SKJPUJ7N.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-CB64CFDG.js → webui-server-6I6QOECV.js} +44 -6
- 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 +56 -0
- package/package.json +1 -1
- package/dist/mcp-W7A5HUXV.js +0 -560
- 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
|
|
@@ -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
|
|
@@ -15,8 +15,15 @@ import {
|
|
|
15
15
|
createHqCommandDispatcher,
|
|
16
16
|
createProjectKanbanAssignHandler,
|
|
17
17
|
createProjectKanbanTransitionHandler,
|
|
18
|
-
installedBridgeAgents
|
|
19
|
-
|
|
18
|
+
installedBridgeAgents,
|
|
19
|
+
readCachedWrongForgeInfo,
|
|
20
|
+
refreshWrongForgeInfoCache,
|
|
21
|
+
reportWrongForgeQuota
|
|
22
|
+
} from "./chunk-QRWXHGLB.js";
|
|
23
|
+
import {
|
|
24
|
+
WRONGFORGE_AGENT_ID,
|
|
25
|
+
resolveWrongForgeEndpoint
|
|
26
|
+
} from "./chunk-PGC44T7N.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-
|
|
36
|
+
} from "./chunk-X4DEQLAZ.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
|
|
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
|
-
|
|
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-
|
|
2537
|
+
//# sourceMappingURL=webui-server-6I6QOECV.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,56 @@
|
|
|
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
|
+
/**
|
|
22
|
+
* A side model for a turn WrongForge does not lead. `explicitOnly` (a side
|
|
23
|
+
* request through `complete()`) takes only the model the user named in
|
|
24
|
+
* `acp.leader.sideModel`: WrongForge answers those itself (`oneShot`), and
|
|
25
|
+
* handing them to `fallbackModels[0]` let that model take over the session.
|
|
26
|
+
* A worker's turn may still fall back to the fallback chain, since `oneShot`
|
|
27
|
+
* would leave it without tools.
|
|
28
|
+
*/
|
|
29
|
+
private sideProvider;
|
|
30
|
+
complete(req: Request, opts: {
|
|
31
|
+
signal: AbortSignal;
|
|
32
|
+
}): Promise<Response>;
|
|
33
|
+
/** WrongForge as a plain model: one step, no tools, its own throwaway session. */
|
|
34
|
+
private oneShot;
|
|
35
|
+
stream(req: Request, opts: {
|
|
36
|
+
signal: AbortSignal;
|
|
37
|
+
}): AsyncIterable<StreamEvent>;
|
|
38
|
+
/** The turn's prompt; WrongForge joining a conversation under way gets the turns before it. */
|
|
39
|
+
private promptText;
|
|
40
|
+
private wfSessionExists;
|
|
41
|
+
private sessionFor;
|
|
42
|
+
private observeContext;
|
|
43
|
+
/** `/compact` on this route: WrongForge compacts its own session. */
|
|
44
|
+
compactOwnContext(opts: {
|
|
45
|
+
sessionId: string;
|
|
46
|
+
signal: AbortSignal;
|
|
47
|
+
}): Promise<AgentContextUsage | undefined>;
|
|
48
|
+
/** Close every session gateway (process shutdown). */
|
|
49
|
+
closeAll(): Promise<void>;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Registered with the provider registry at boot. Inert unless the session
|
|
53
|
+
* names it (`--provider wrongforge`, `/model wrongforge/<model>`).
|
|
54
|
+
*/
|
|
55
|
+
export declare function createWrongForgeLeaderProviderFactory(opts: Omit<WrongForgeLeaderProviderOptions, 'id'>): ProviderFactory;
|
|
56
|
+
//# sourceMappingURL=wrongforge-leader-provider.d.ts.map
|
package/package.json
CHANGED