aicodeman 1.24.4 → 1.24.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/cli.d.ts.map +1 -1
- package/dist/cli.js +3 -4
- package/dist/cli.js.map +1 -1
- package/dist/config/cli-registry/argv.d.ts +44 -0
- package/dist/config/cli-registry/argv.d.ts.map +1 -0
- package/dist/config/cli-registry/argv.js +157 -0
- package/dist/config/cli-registry/argv.js.map +1 -0
- package/dist/config/cli-registry/index.d.ts +17 -0
- package/dist/config/cli-registry/index.d.ts.map +1 -0
- package/dist/config/cli-registry/index.js +11 -0
- package/dist/config/cli-registry/index.js.map +1 -0
- package/dist/config/cli-registry/patterns.d.ts +42 -0
- package/dist/config/cli-registry/patterns.d.ts.map +1 -0
- package/dist/config/cli-registry/patterns.js +104 -0
- package/dist/config/cli-registry/patterns.js.map +1 -0
- package/dist/config/cli-registry/profiles.d.ts +74 -0
- package/dist/config/cli-registry/profiles.d.ts.map +1 -0
- package/dist/config/cli-registry/profiles.js +90 -0
- package/dist/config/cli-registry/profiles.js.map +1 -0
- package/dist/config/cli-registry/registry.d.ts +63 -0
- package/dist/config/cli-registry/registry.d.ts.map +1 -0
- package/dist/config/cli-registry/registry.js +216 -0
- package/dist/config/cli-registry/registry.js.map +1 -0
- package/dist/config/cli-registry/schema.d.ts +259 -0
- package/dist/config/cli-registry/schema.d.ts.map +1 -0
- package/dist/config/cli-registry/schema.js +398 -0
- package/dist/config/cli-registry/schema.js.map +1 -0
- package/dist/config/cli-registry/stock.d.ts +15 -0
- package/dist/config/cli-registry/stock.d.ts.map +1 -0
- package/dist/config/cli-registry/stock.js +996 -0
- package/dist/config/cli-registry/stock.js.map +1 -0
- package/dist/config/cli-registry/types.d.ts +565 -0
- package/dist/config/cli-registry/types.d.ts.map +1 -0
- package/dist/config/cli-registry/types.js +13 -0
- package/dist/config/cli-registry/types.js.map +1 -0
- package/dist/config/dependency-registry.d.ts +12 -1
- package/dist/config/dependency-registry.d.ts.map +1 -1
- package/dist/config/dependency-registry.js +155 -203
- package/dist/config/dependency-registry.js.map +1 -1
- package/dist/cron/cron-service.d.ts.map +1 -1
- package/dist/cron/cron-service.js +51 -17
- package/dist/cron/cron-service.js.map +1 -1
- package/dist/docker-hosts.d.ts +9 -1
- package/dist/docker-hosts.d.ts.map +1 -1
- package/dist/docker-hosts.js +25 -17
- package/dist/docker-hosts.js.map +1 -1
- package/dist/remote-hosts.d.ts +73 -0
- package/dist/remote-hosts.d.ts.map +1 -1
- package/dist/remote-hosts.js +139 -45
- package/dist/remote-hosts.js.map +1 -1
- package/dist/remote-reconnect.d.ts +10 -1
- package/dist/remote-reconnect.d.ts.map +1 -1
- package/dist/remote-reconnect.js +9 -0
- package/dist/remote-reconnect.js.map +1 -1
- package/dist/session-cli-registry-bridge.d.ts +66 -0
- package/dist/session-cli-registry-bridge.d.ts.map +1 -0
- package/dist/session-cli-registry-bridge.js +165 -0
- package/dist/session-cli-registry-bridge.js.map +1 -0
- package/dist/session.d.ts +13 -1
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +69 -76
- package/dist/session.js.map +1 -1
- package/dist/tmux-manager.d.ts +50 -35
- package/dist/tmux-manager.d.ts.map +1 -1
- package/dist/tmux-manager.js +258 -623
- package/dist/tmux-manager.js.map +1 -1
- package/dist/utils/antigravity-cli-resolver.d.ts.map +1 -1
- package/dist/utils/antigravity-cli-resolver.js +8 -10
- package/dist/utils/antigravity-cli-resolver.js.map +1 -1
- package/dist/utils/cli-executable-resolver.d.ts +9 -1
- package/dist/utils/cli-executable-resolver.d.ts.map +1 -1
- package/dist/utils/cli-executable-resolver.js +3 -2
- package/dist/utils/cli-executable-resolver.js.map +1 -1
- package/dist/utils/cli-launcher.d.ts +46 -0
- package/dist/utils/cli-launcher.d.ts.map +1 -0
- package/dist/utils/cli-launcher.js +101 -0
- package/dist/utils/cli-launcher.js.map +1 -0
- package/dist/utils/cli-resolver.d.ts +101 -0
- package/dist/utils/cli-resolver.d.ts.map +1 -0
- package/dist/utils/cli-resolver.js +220 -0
- package/dist/utils/cli-resolver.js.map +1 -0
- package/dist/utils/codex-cli-resolver.d.ts.map +1 -1
- package/dist/utils/codex-cli-resolver.js +8 -11
- package/dist/utils/codex-cli-resolver.js.map +1 -1
- package/dist/utils/deepseek-cli-resolver.d.ts.map +1 -1
- package/dist/utils/deepseek-cli-resolver.js +8 -6
- package/dist/utils/deepseek-cli-resolver.js.map +1 -1
- package/dist/utils/gemini-cli-resolver.d.ts.map +1 -1
- package/dist/utils/gemini-cli-resolver.js +8 -10
- package/dist/utils/gemini-cli-resolver.js.map +1 -1
- package/dist/utils/grok-cli-resolver.js +8 -8
- package/dist/utils/grok-cli-resolver.js.map +1 -1
- package/dist/utils/omp-cli-resolver.d.ts.map +1 -1
- package/dist/utils/omp-cli-resolver.js +10 -15
- package/dist/utils/omp-cli-resolver.js.map +1 -1
- package/dist/utils/opencode-cli-resolver.d.ts.map +1 -1
- package/dist/utils/opencode-cli-resolver.js +8 -11
- package/dist/utils/opencode-cli-resolver.js.map +1 -1
- package/dist/utils/pi-cli-resolver.d.ts.map +1 -1
- package/dist/utils/pi-cli-resolver.js +8 -9
- package/dist/utils/pi-cli-resolver.js.map +1 -1
- package/dist/web/public/admin-ui.js.gz +0 -0
- package/dist/web/public/api-client.c9b1cddc.js.gz +0 -0
- package/dist/web/public/app.a5d2fc08.js.gz +0 -0
- package/dist/web/public/approvals-ui.js.gz +0 -0
- package/dist/web/public/constants.7bd482dc.js.gz +0 -0
- package/dist/web/public/cron-ui.js.gz +0 -0
- package/dist/web/public/entrance-animations.js.gz +0 -0
- package/dist/web/public/home-sessions.js.gz +0 -0
- package/dist/web/public/i18n.9ae15b51.js.gz +0 -0
- package/dist/web/public/image-input.ee16ad88.js.gz +0 -0
- package/dist/web/public/index.html +9 -2
- package/dist/web/public/index.html.br +0 -0
- package/dist/web/public/index.html.gz +0 -0
- package/dist/web/public/input-cjk.87f14251.js.gz +0 -0
- package/dist/web/public/keyboard-accessory.0454a3e9.js.gz +0 -0
- package/dist/web/public/mobile-handlers.0f83a608.js.gz +0 -0
- package/dist/web/public/mobile-overview.js.gz +0 -0
- package/dist/web/public/mobile.87674154.css.gz +0 -0
- package/dist/web/public/notification-manager.5d229063.js.gz +0 -0
- package/dist/web/public/orchestrator-panel.js.gz +0 -0
- package/dist/web/public/panels-ui.e6e06034.js.gz +0 -0
- package/dist/web/public/ralph-panel.6de2d0f8.js.gz +0 -0
- package/dist/web/public/ralph-wizard.13a1831e.js.gz +0 -0
- package/dist/web/public/readmymind-ui.js.gz +0 -0
- package/dist/web/public/respawn-ui.ff0dae4c.js.gz +0 -0
- package/dist/web/public/sanitize-html.bc7078d6.js.gz +0 -0
- package/dist/web/public/session-lineage.js.gz +0 -0
- package/dist/web/public/session-ui.c558f981.js.gz +0 -0
- package/dist/web/public/{settings-ui.2a814a17.js → settings-ui.95b333c6.js} +1 -1
- package/dist/web/public/settings-ui.95b333c6.js.br +0 -0
- package/dist/web/public/settings-ui.95b333c6.js.gz +0 -0
- package/dist/web/public/styles.421b36d4.css.gz +0 -0
- package/dist/web/public/subagent-windows.e6ca799f.js.gz +0 -0
- package/dist/web/public/sw.js.gz +0 -0
- package/dist/web/public/tab-rail-resize.42c24949.js.gz +0 -0
- package/dist/web/public/terminal-ui.70445f81.js.gz +0 -0
- package/dist/web/public/ultracode-panel.js.gz +0 -0
- package/dist/web/public/ultracode-windows.js.gz +0 -0
- package/dist/web/public/upload.html.gz +0 -0
- package/dist/web/public/vendor/dompurify.min.js.gz +0 -0
- package/dist/web/public/vendor/marked.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-fit.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-serialize.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-unicode11.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-webgl.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-predictive-echo.bd6882b8.js.gz +0 -0
- package/dist/web/public/vendor/xterm-zerolag-input.6fee72f2.js.gz +0 -0
- package/dist/web/public/vendor/xterm.css.gz +0 -0
- package/dist/web/public/vendor/xterm.min.js.gz +0 -0
- package/dist/web/public/voice-input.4ec670b0.js.gz +0 -0
- package/dist/web/public/voice-pcm-worklet.js.gz +0 -0
- package/dist/web/public/webview-tabs.js.gz +0 -0
- package/dist/web/routes/cron-routes.d.ts.map +1 -1
- package/dist/web/routes/cron-routes.js +3 -2
- package/dist/web/routes/cron-routes.js.map +1 -1
- package/dist/web/routes/session-routes.d.ts +8 -34
- package/dist/web/routes/session-routes.d.ts.map +1 -1
- package/dist/web/routes/session-routes.js +164 -251
- package/dist/web/routes/session-routes.js.map +1 -1
- package/dist/web/routes/system-routes.d.ts.map +1 -1
- package/dist/web/routes/system-routes.js +2 -1
- package/dist/web/routes/system-routes.js.map +1 -1
- package/dist/web/schemas.d.ts +12 -48
- package/dist/web/schemas.d.ts.map +1 -1
- package/dist/web/schemas.js +82 -37
- package/dist/web/schemas.js.map +1 -1
- package/dist/web/session-wait-registry.d.ts +1 -1
- package/dist/web/session-wait-registry.d.ts.map +1 -1
- package/dist/web/session-wait-registry.js +20 -12
- package/dist/web/session-wait-registry.js.map +1 -1
- package/package.json +1 -1
- package/dist/web/public/settings-ui.2a814a17.js.br +0 -0
- package/dist/web/public/settings-ui.2a814a17.js.gz +0 -0
|
@@ -45,5 +45,16 @@ export interface ToolDependency {
|
|
|
45
45
|
resolvers: ResolverSpec[];
|
|
46
46
|
installHint?: Partial<Record<ProbeEnvironment, string>>;
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
/**
|
|
49
|
+
* The tools `codeman doctor` probes, resolved AT CALL TIME.
|
|
50
|
+
*
|
|
51
|
+
* ⚠️ A FUNCTION, not a module-level const, and for the same reason `sessionModeSchema()` and
|
|
52
|
+
* `allowedEnvPrefixes()` are functions: `cliDependencyEntries()` reads the CLI registry, and
|
|
53
|
+
* a const would have frozen the doctor's rows at first import while every schema resolved
|
|
54
|
+
* per parse. A CLI enabled while the server was running — or a `reloadCliRegistry()` — then
|
|
55
|
+
* moved the run menu and the validation but never the doctor, which would keep reporting the
|
|
56
|
+
* catalog as it stood when something first imported this module. Building the array per call
|
|
57
|
+
* costs a handful of object literals on a command that shells out to probe binaries anyway.
|
|
58
|
+
*/
|
|
59
|
+
export declare function dependencyRegistry(): ToolDependency[];
|
|
49
60
|
//# sourceMappingURL=dependency-registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependency-registry.d.ts","sourceRoot":"","sources":["../../src/config/dependency-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"dependency-registry.d.ts","sourceRoot":"","sources":["../../src/config/dependency-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,KAAK,CAAC;AAEpE;2CAC2C;AAC3C,eAAO,MAAM,eAAe,sCAAuC,CAAC;AACpE,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D,yDAAyD;AACzD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,mEAAmE;AACnE,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,cAAc,CAAC;IACrB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,QAAQ,EAAE,YAAY,GAAG,mBAAmB,CAAC;CAC9C;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,YAAY,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,YAAY,EAAE,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC,CAAC;CACzD;AAqFD;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,IAAI,cAAc,EAAE,CAoErD"}
|
|
@@ -6,216 +6,168 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module config/dependency-registry
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { DEEPSEEK_VERSION_REGEX } from '../utils/deepseek-cli-resolver.js';
|
|
12
|
-
import { OMP_VERSION_REGEX } from '../utils/omp-cli-resolver.js';
|
|
9
|
+
import { enabledClis } from './cli-registry/registry.js';
|
|
10
|
+
import { compileVersionRegex } from './cli-registry/patterns.js';
|
|
13
11
|
/** The valid `--category` filter values; single source of truth for the type, the CLI
|
|
14
12
|
* help text, and CLI input validation. */
|
|
15
13
|
export const TOOL_CATEGORIES = ['core', 'office', 'other'];
|
|
16
14
|
const ALL = ['linux', 'darwin', 'wsl', 'win32'];
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
{
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
{
|
|
89
|
-
match: ALL,
|
|
90
|
-
resolver: {
|
|
91
|
-
kind: 'path',
|
|
92
|
-
bins: ['pi'],
|
|
93
|
-
versionArg: '--version',
|
|
94
|
-
versionRegex: PI_VERSION_REGEX,
|
|
95
|
-
requireVersionMatch: true,
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
],
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
id: 'grok',
|
|
102
|
-
label: 'Grok CLI',
|
|
103
|
-
category: 'core',
|
|
104
|
-
required: false,
|
|
105
|
-
usedBy: ['Grok sessions'],
|
|
106
|
-
// Version match required for the same reason as pi: `grok` has known squatters
|
|
107
|
-
// (the unrelated @vibe-kit/grok-cli npm package also installs a `grok` bin), so a
|
|
108
|
-
// bare `which grok` hit is not the coding agent. Both sides share
|
|
109
|
-
// GROK_VERSION_REGEX, so the doctor and the run mode cannot drift.
|
|
110
|
-
resolvers: [
|
|
111
|
-
{
|
|
112
|
-
match: ALL,
|
|
113
|
-
resolver: {
|
|
114
|
-
kind: 'path',
|
|
115
|
-
bins: ['grok'],
|
|
116
|
-
versionArg: '--version',
|
|
117
|
-
versionRegex: GROK_VERSION_REGEX,
|
|
118
|
-
requireVersionMatch: true,
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
],
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
id: 'dsh',
|
|
125
|
-
label: 'DeepSeek Harness CLI',
|
|
126
|
-
category: 'core',
|
|
127
|
-
required: false,
|
|
128
|
-
usedBy: ['DeepSeek sessions'],
|
|
129
|
-
// Version match required, and for a sharper reason than pi or grok: `dsh` is
|
|
130
|
-
// not merely a squattable npm name, it is an existing Debian program
|
|
131
|
-
// (dancer's shell, `apt install dsh`). The run mode's resolver additionally
|
|
132
|
-
// demands the harness's own help banner before it will point a spawn line at
|
|
133
|
-
// a candidate; the doctor is advisory and settles for the shared
|
|
134
|
-
// DEEPSEEK_VERSION_REGEX, so the two cannot disagree about the VERSION even
|
|
135
|
-
// though the resolver is the stricter of the pair about IDENTITY.
|
|
136
|
-
resolvers: [
|
|
137
|
-
{
|
|
138
|
-
match: ALL,
|
|
139
|
-
resolver: {
|
|
140
|
-
kind: 'path',
|
|
141
|
-
bins: ['dsh'],
|
|
142
|
-
versionArg: '--version',
|
|
143
|
-
versionRegex: DEEPSEEK_VERSION_REGEX,
|
|
144
|
-
requireVersionMatch: true,
|
|
15
|
+
/**
|
|
16
|
+
* The doctor's ROW IDENTITY for a CLI, where it differs from the registry id.
|
|
17
|
+
*
|
|
18
|
+
* These are two separate contracts and they have never been the same thing: `codeman doctor`
|
|
19
|
+
* prints a tool table whose ids predate the registry, and `dsh` names the BINARY while the
|
|
20
|
+
* run mode is `deepseek`. Keeping the historical id here means the doctor's output does not
|
|
21
|
+
* shift under a refactor that was supposed to change nothing a user can see.
|
|
22
|
+
*
|
|
23
|
+
* `usedBy` is likewise preserved verbatim rather than generated, because the strings are
|
|
24
|
+
* shown to the user and claude's does not follow the pattern.
|
|
25
|
+
*/
|
|
26
|
+
const DOCTOR_ROW_OVERRIDES = {
|
|
27
|
+
claude: { usedBy: ['Claude Code sessions (default backend)'] },
|
|
28
|
+
opencode: { usedBy: ['OpenCode sessions'] },
|
|
29
|
+
codex: { usedBy: ['Codex sessions'] },
|
|
30
|
+
gemini: { usedBy: ['Gemini sessions'] },
|
|
31
|
+
antigravity: { usedBy: ['Antigravity sessions'] },
|
|
32
|
+
pi: { usedBy: ['Pi sessions'] },
|
|
33
|
+
grok: { usedBy: ['Grok sessions'] },
|
|
34
|
+
// Both the id and the label are historical: `dsh` names the binary, and the doctor has
|
|
35
|
+
// always spelled this row out in full rather than as `${label} CLI`.
|
|
36
|
+
deepseek: { id: 'dsh', label: 'DeepSeek Harness CLI', usedBy: ['DeepSeek sessions'] },
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Build one `codeman doctor` row per enabled CLI, straight from its registry entry.
|
|
40
|
+
*
|
|
41
|
+
* This replaces eight hand-written rows that had to be kept in step with the run modes by
|
|
42
|
+
* hand — and were not: an earlier draft of this refactor silently dropped the Grok and
|
|
43
|
+
* DeepSeek rows, so `codeman doctor` stopped reporting two shipped CLIs at all. Deriving
|
|
44
|
+
* the list makes that class of omission impossible.
|
|
45
|
+
*
|
|
46
|
+
* ⚠️ The version regex is compiled through `compileVersionRegex()`, NOT `new RegExp()`. It
|
|
47
|
+
* is a config-supplied pattern, so it goes through the same length cap and
|
|
48
|
+
* nested-quantifier rejection the argv engine applies; the doctor runs it over command
|
|
49
|
+
* output exactly like the resolver does, and skipping the guard here would leave one
|
|
50
|
+
* unguarded path into a user-supplied regex.
|
|
51
|
+
*
|
|
52
|
+
* ⚠️ Sharing the entry's regex with the resolver is what stops the doctor and the run mode
|
|
53
|
+
* telling the user opposite things about the same binary — the Dependencies panel reporting
|
|
54
|
+
* "Pi CLI ✓" on a box where Run Pi stays hidden.
|
|
55
|
+
*/
|
|
56
|
+
function cliDependencyEntries() {
|
|
57
|
+
const rows = [];
|
|
58
|
+
for (const cli of enabledClis()) {
|
|
59
|
+
// `shell` has no binary of its own (the login shell is resolved at spawn time), so
|
|
60
|
+
// there is nothing for the doctor to probe.
|
|
61
|
+
const bin = cli.discovery.binaries[0];
|
|
62
|
+
if (!bin)
|
|
63
|
+
continue;
|
|
64
|
+
const override = DOCTOR_ROW_OVERRIDES[cli.id];
|
|
65
|
+
const version = cli.discovery.version;
|
|
66
|
+
const versionRegex = version?.regex ? (compileVersionRegex(version.regex) ?? undefined) : undefined;
|
|
67
|
+
rows.push({
|
|
68
|
+
id: override?.id ?? cli.id,
|
|
69
|
+
label: override?.label ?? `${cli.label} CLI`,
|
|
70
|
+
category: 'core',
|
|
71
|
+
required: false,
|
|
72
|
+
usedBy: override?.usedBy ?? [`${cli.label} sessions`],
|
|
73
|
+
resolvers: [
|
|
74
|
+
{
|
|
75
|
+
match: ALL,
|
|
76
|
+
resolver: {
|
|
77
|
+
kind: 'path',
|
|
78
|
+
bins: [bin],
|
|
79
|
+
versionArg: version?.arg ?? '--version',
|
|
80
|
+
versionRegex,
|
|
81
|
+
// Only meaningful for a CLI whose binary name is short, generic or squatted
|
|
82
|
+
// (pi, grok, dsh): a bare `which` hit there is not evidence of the right
|
|
83
|
+
// program, so a version mismatch means MISSING rather than unknown-version.
|
|
84
|
+
requireVersionMatch: version?.requireVersionMatch,
|
|
85
|
+
},
|
|
145
86
|
},
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
87
|
+
],
|
|
88
|
+
installHint: cli.discovery.install.command,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
return rows;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* The tools `codeman doctor` probes, resolved AT CALL TIME.
|
|
95
|
+
*
|
|
96
|
+
* ⚠️ A FUNCTION, not a module-level const, and for the same reason `sessionModeSchema()` and
|
|
97
|
+
* `allowedEnvPrefixes()` are functions: `cliDependencyEntries()` reads the CLI registry, and
|
|
98
|
+
* a const would have frozen the doctor's rows at first import while every schema resolved
|
|
99
|
+
* per parse. A CLI enabled while the server was running — or a `reloadCliRegistry()` — then
|
|
100
|
+
* moved the run menu and the validation but never the doctor, which would keep reporting the
|
|
101
|
+
* catalog as it stood when something first imported this module. Building the array per call
|
|
102
|
+
* costs a handful of object literals on a command that shells out to probe binaries anyway.
|
|
103
|
+
*/
|
|
104
|
+
export function dependencyRegistry() {
|
|
105
|
+
return [
|
|
106
|
+
{
|
|
107
|
+
id: 'node',
|
|
108
|
+
label: 'Node.js',
|
|
109
|
+
category: 'core',
|
|
110
|
+
required: true,
|
|
111
|
+
minVersion: '22.0.0',
|
|
112
|
+
resolvers: [{ match: ALL, resolver: { kind: 'path', bins: ['node'], versionArg: '--version' } }],
|
|
113
|
+
installHint: { linux: 'https://nodejs.org', darwin: 'brew install node', wsl: 'https://nodejs.org' },
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
id: 'tmux',
|
|
117
|
+
label: 'tmux',
|
|
118
|
+
category: 'core',
|
|
119
|
+
required: true,
|
|
120
|
+
resolvers: [{ match: ['linux', 'darwin', 'wsl'], resolver: { kind: 'path', bins: ['tmux'], versionArg: '-V' } }],
|
|
121
|
+
installHint: { linux: 'sudo apt install tmux', darwin: 'brew install tmux', wsl: 'sudo apt install tmux' },
|
|
122
|
+
},
|
|
123
|
+
...cliDependencyEntries(),
|
|
124
|
+
{
|
|
125
|
+
id: 'libreoffice',
|
|
126
|
+
label: 'LibreOffice',
|
|
127
|
+
category: 'office',
|
|
128
|
+
required: false,
|
|
129
|
+
usedBy: ['document preview', 'thumbnails'],
|
|
130
|
+
resolvers: [
|
|
131
|
+
{
|
|
132
|
+
match: ['linux', 'darwin', 'wsl'],
|
|
133
|
+
resolver: { kind: 'path', bins: ['libreoffice', 'soffice'], versionArg: '--version' },
|
|
168
134
|
},
|
|
135
|
+
],
|
|
136
|
+
installHint: { linux: 'sudo apt install libreoffice', darwin: 'brew install --cask libreoffice' },
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
id: 'pdftoppm',
|
|
140
|
+
label: 'pdftoppm',
|
|
141
|
+
category: 'office',
|
|
142
|
+
required: false,
|
|
143
|
+
usedBy: ['document preview', 'PDF/Office first-page thumbnails'],
|
|
144
|
+
// poppler's pdftoppm prints its version to stderr; presence is what matters here.
|
|
145
|
+
resolvers: [
|
|
146
|
+
{ match: ['linux', 'darwin', 'wsl'], resolver: { kind: 'path', bins: ['pdftoppm'], versionArg: '-v' } },
|
|
147
|
+
],
|
|
148
|
+
installHint: {
|
|
149
|
+
linux: 'sudo apt install poppler-utils',
|
|
150
|
+
darwin: 'brew install poppler',
|
|
151
|
+
wsl: 'sudo apt install poppler-utils',
|
|
169
152
|
},
|
|
170
|
-
],
|
|
171
|
-
installHint: { linux: 'curl -fsSL https://omp.sh/install | sh', darwin: 'brew install can1357/tap/omp' },
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
id: 'libreoffice',
|
|
175
|
-
label: 'LibreOffice',
|
|
176
|
-
category: 'office',
|
|
177
|
-
required: false,
|
|
178
|
-
usedBy: ['document preview', 'thumbnails'],
|
|
179
|
-
resolvers: [
|
|
180
|
-
{
|
|
181
|
-
match: ['linux', 'darwin', 'wsl'],
|
|
182
|
-
resolver: { kind: 'path', bins: ['libreoffice', 'soffice'], versionArg: '--version' },
|
|
183
|
-
},
|
|
184
|
-
],
|
|
185
|
-
installHint: { linux: 'sudo apt install libreoffice', darwin: 'brew install --cask libreoffice' },
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
id: 'pdftoppm',
|
|
189
|
-
label: 'pdftoppm',
|
|
190
|
-
category: 'office',
|
|
191
|
-
required: false,
|
|
192
|
-
usedBy: ['document preview', 'PDF/Office first-page thumbnails'],
|
|
193
|
-
// poppler's pdftoppm prints its version to stderr; presence is what matters here.
|
|
194
|
-
resolvers: [
|
|
195
|
-
{ match: ['linux', 'darwin', 'wsl'], resolver: { kind: 'path', bins: ['pdftoppm'], versionArg: '-v' } },
|
|
196
|
-
],
|
|
197
|
-
installHint: {
|
|
198
|
-
linux: 'sudo apt install poppler-utils',
|
|
199
|
-
darwin: 'brew install poppler',
|
|
200
|
-
wsl: 'sudo apt install poppler-utils',
|
|
201
153
|
},
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
154
|
+
{
|
|
155
|
+
id: 'msoffice',
|
|
156
|
+
label: 'MS Office',
|
|
157
|
+
category: 'office',
|
|
158
|
+
required: false,
|
|
159
|
+
usedBy: ['document preview', 'thumbnails'],
|
|
160
|
+
resolvers: [
|
|
161
|
+
{
|
|
162
|
+
match: ['wsl', 'win32'],
|
|
163
|
+
resolver: {
|
|
164
|
+
kind: 'windows-side',
|
|
165
|
+
appDirs: ['Microsoft Office/root/Office16'],
|
|
166
|
+
exes: ['WINWORD.EXE', 'POWERPNT.EXE', 'EXCEL.EXE'],
|
|
167
|
+
},
|
|
216
168
|
},
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
169
|
+
],
|
|
170
|
+
},
|
|
171
|
+
];
|
|
172
|
+
}
|
|
221
173
|
//# sourceMappingURL=dependency-registry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependency-registry.js","sourceRoot":"","sources":["../../src/config/dependency-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"dependency-registry.js","sourceRoot":"","sources":["../../src/config/dependency-registry.ts"],"names":[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QAAQ;YAClB,QAAQ,EAAE,KAAK;YACf,MAAM,EAAE,CAAC,kBAAkB,EAAE,kCAAkC,CAAC;YAChE,kFAAkF;YAClF,SAAS,EAAE;gBACT,EAAE,KAAK,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE;aACxG;YACD,WAAW,EAAE;gBACX,KAAK,EAAE,gCAAgC;gBACvC,MAAM,EAAE,sBAAsB;gBAC9B,GAAG,EAAE,gCAAgC;aACtC;SACF;QACD;YACE,EAAE,EAAE,UAAU;YACd,KAAK,EAAE,WAAW;YAClB,QAAQ,EAAE,QAAQ;YAClB,QAAQ,EAAE,KAAK;YACf,MAAM,EAAE,CAAC,kBAAkB,EAAE,YAAY,CAAC;YAC1C,SAAS,EAAE;gBACT;oBACE,KAAK,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC;oBACvB,QAAQ,EAAE;wBACR,IAAI,EAAE,cAAc;wBACpB,OAAO,EAAE,CAAC,gCAAgC,CAAC;wBAC3C,IAAI,EAAE,CAAC,aAAa,EAAE,cAAc,EAAE,WAAW,CAAC;qBACnD;iBACF;aACF;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cron-service.d.ts","sourceRoot":"","sources":["../../src/cron/cron-service.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"cron-service.d.ts","sourceRoot":"","sources":["../../src/cron/cron-service.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAuBH,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC3F,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAiC,MAAM,kBAAkB,CAAC;A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IAMpD;;;OAGG;IACG,WAAW,CAAC,GAAG,GAAE,MAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAwC1D,0EAA0E;IAC1E,IAAI,IAAI,IAAI;IAaZ,OAAO,CAAC,gBAAgB;YAaV,MAAM;IAyJpB;;;;;;;;OAQG;YACW,aAAa;IAkB3B;;;;;;;;;;;;;;;OAeG;YACW,qBAAqB;IA+CnC,OAAO,CAAC,mBAAmB;IAyD3B,gFAAgF;IAChF,OAAO,CAAC,UAAU;IAOlB;;;;;OAKG;IACH,OAAO,CAAC,qBAAqB;IAa7B,2FAA2F;YAC7E,wBAAwB;IAYtC,OAAO,CAAC,OAAO;IAUf,OAAO,CAAC,gBAAgB;IA2BxB,mFAAmF;IACnF,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,mBAAmB;IAW3B,OAAO,CAAC,oBAAoB;CAG7B"}
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
import { v4 as uuidv4 } from 'uuid';
|
|
10
10
|
import { readFile } from 'node:fs/promises';
|
|
11
11
|
import { statSync, realpathSync } from 'node:fs';
|
|
12
|
+
import { getCli } from '../config/cli-registry/registry.js';
|
|
13
|
+
import { resolveCliLaunchError } from '../utils/cli-launcher.js';
|
|
12
14
|
import { Session } from '../session.js';
|
|
13
15
|
import { applyWorkspaceHooks } from '../hooks-config.js';
|
|
14
16
|
import { SseEvent } from '../web/sse-events.js';
|
|
@@ -42,9 +44,26 @@ const delay = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
|
42
44
|
export function clampCronExternalCliConfigs(mode, ownerGranted) {
|
|
43
45
|
if (ownerGranted)
|
|
44
46
|
return { geminiConfig: undefined, piConfig: undefined };
|
|
47
|
+
// A cron job carries no per-CLI config at all, so ONLY the materialize-when-absent params
|
|
48
|
+
// can apply here — an only-if-sent clamp has nothing to clamp. Reading them off the
|
|
49
|
+
// registry rather than naming gemini and pi means a future CLI whose bare spawn is unsafe
|
|
50
|
+
// is covered the moment its entry says so, instead of silently missing this path.
|
|
51
|
+
const entry = getCli(mode);
|
|
52
|
+
const aliases = entry?.launch.legacyConfigAliases ?? {};
|
|
53
|
+
const materialized = {};
|
|
54
|
+
for (const { param, clampTo, materializeWhenAbsent } of entry?.capabilities.privilegedParams ?? []) {
|
|
55
|
+
// Same registry-param → legacy-wire-field hop the HTTP clamp makes. Neither gemini's
|
|
56
|
+
// `approvalMode` nor pi's `approveProjectTrust` is aliased today, so this changes nothing
|
|
57
|
+
// now — but the two are DIFFERENT namespaces, and writing the raw param here would make
|
|
58
|
+
// this path stop clamping the moment one of them gained an alias, silently.
|
|
59
|
+
if (materializeWhenAbsent)
|
|
60
|
+
materialized[aliases[param] ?? param] = clampTo;
|
|
61
|
+
}
|
|
62
|
+
const has = Object.keys(materialized).length > 0;
|
|
63
|
+
const field = entry?.launch.legacyConfigField;
|
|
45
64
|
return {
|
|
46
|
-
geminiConfig:
|
|
47
|
-
piConfig:
|
|
65
|
+
geminiConfig: has && field === 'geminiConfig' ? materialized : undefined,
|
|
66
|
+
piConfig: has && field === 'piConfig' ? materialized : undefined,
|
|
48
67
|
};
|
|
49
68
|
}
|
|
50
69
|
/** Hard ceiling on a prompt-file read (defends against unbounded-read DoS). */
|
|
@@ -345,31 +364,44 @@ export class CronService {
|
|
|
345
364
|
// Section 6.3: re-resolve the owner's grant at FIRE time (it may have been revoked
|
|
346
365
|
// since create). Gates shell/launchCommand AND clamps the external-CLI bypass below.
|
|
347
366
|
const ownerGranted = await canUsernameRunPrivilegedCommands(job.owner);
|
|
348
|
-
if ((job.agentType
|
|
367
|
+
if ((getCli(job.agentType)?.capabilities.privilegedCommandGate || job.launchCommand) && !ownerGranted) {
|
|
349
368
|
return this.failRun(job, run, 'Owner lacks the can-bypass-permissions grant for shell/launchCommand jobs');
|
|
350
369
|
}
|
|
351
370
|
// Create + start the session (mirrors the quick-start route flow).
|
|
352
371
|
let session;
|
|
353
372
|
try {
|
|
354
373
|
const mode = job.agentType;
|
|
355
|
-
//
|
|
356
|
-
//
|
|
357
|
-
//
|
|
358
|
-
//
|
|
359
|
-
//
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
374
|
+
// A LAUNCHER CLI's binary is not its agent, so "installed" is not "runnable": without
|
|
375
|
+
// this, a job on a box carrying only dsh's stock web/headless profiles spawns a bare
|
|
376
|
+
// `dsh` that boots a profile unable to drive a pane, and the prompt is typed into a
|
|
377
|
+
// logging server or a dead pane instead of failing the run with an actionable message.
|
|
378
|
+
//
|
|
379
|
+
// ⚠️ Scoped to `discovery.launcherProfile`, which is byte-identical to the
|
|
380
|
+
// `mode === 'deepseek'` check this replaces (dsh is the only launcher today) and
|
|
381
|
+
// generalises to the next one. Deliberately NOT every CLI: cron has never pre-flighted
|
|
382
|
+
// a merely-missing binary, and doing so replaces tmux-manager's own not-found throw
|
|
383
|
+
// ("Session launch failed") with a different message for claude and shell. An earlier
|
|
384
|
+
// draft of this line was unscoped and did exactly that — three cron tests caught it.
|
|
385
|
+
if (getCli(mode)?.discovery.launcherProfile !== undefined) {
|
|
386
|
+
const cronLaunchError = await resolveCliLaunchError(mode);
|
|
387
|
+
if (cronLaunchError)
|
|
388
|
+
return this.failRun(job, run, cronLaunchError);
|
|
365
389
|
}
|
|
366
390
|
const globalNice = await this.deps.getGlobalNiceConfig();
|
|
367
391
|
const modelConfig = await this.deps.getModelConfig();
|
|
368
392
|
const claudeModeConfig = await this.deps.getClaudeModeConfig();
|
|
369
393
|
const effectiveClaudeMode = await resolveClaudeModeForUsername(claudeModeConfig.claudeMode, job.owner);
|
|
370
|
-
//
|
|
371
|
-
//
|
|
372
|
-
|
|
394
|
+
// Cron carries no per-CLI config object, so the only model it can supply is the global
|
|
395
|
+
// default — and only to a CLI that takes a model at all.
|
|
396
|
+
//
|
|
397
|
+
// ⚠️ `!== 'none'` is the faithful reading of the `mode !== 'shell' && mode !== 'deepseek'`
|
|
398
|
+
// ladder this replaces: those two are exactly the entries declaring `model.source: 'none'`
|
|
399
|
+
// (shell has no model; deepseek's is a profile composition entry, not a session flag).
|
|
400
|
+
// NOT `=== 'claude-settings-file'`, which is the HTTP route's question — there, every
|
|
401
|
+
// external CLI reads its model from its own config object earlier in the chain, so only
|
|
402
|
+
// claude reaches the global default. Cron has no such config, so the same expression
|
|
403
|
+
// means something different here.
|
|
404
|
+
const model = getCli(mode)?.capabilities.model.source !== 'none' ? modelConfig?.defaultModel || undefined : undefined;
|
|
373
405
|
// Section 6.3: materialize the safe default for a non-granted owner (see
|
|
374
406
|
// clampCronExternalCliConfigs — cron sends no per-CLI config, so the CLI's own
|
|
375
407
|
// spawn default is what would otherwise apply).
|
|
@@ -516,7 +548,9 @@ export class CronService {
|
|
|
516
548
|
sendPromptWhenReady(sessionId, prompt, job, run) {
|
|
517
549
|
setImmediate(() => {
|
|
518
550
|
const poll = async () => {
|
|
519
|
-
|
|
551
|
+
// A shell pane is ready the moment it exists; an agent CLI has a TUI to paint
|
|
552
|
+
// first. That is the `kind` the registry already records, not a fact about shell.
|
|
553
|
+
if (getCli(job.agentType)?.kind !== 'shell') {
|
|
520
554
|
for (let attempt = 0; attempt < CRON_READY_MAX_ATTEMPTS; attempt++) {
|
|
521
555
|
await delay(500);
|
|
522
556
|
const s = this.deps.sessions.get(sessionId);
|