aicodeman 1.30.0 → 1.32.0
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/README.md +7 -6
- package/dist/config/cli-registry/schema.d.ts +8 -0
- package/dist/config/cli-registry/schema.d.ts.map +1 -1
- package/dist/config/cli-registry/schema.js +29 -0
- package/dist/config/cli-registry/schema.js.map +1 -1
- package/dist/config/cli-registry/stock.d.ts.map +1 -1
- package/dist/config/cli-registry/stock.js +62 -7
- package/dist/config/cli-registry/stock.js.map +1 -1
- package/dist/config/cli-registry/types.d.ts +62 -0
- package/dist/config/cli-registry/types.d.ts.map +1 -1
- package/dist/config/remote-wake-limits.d.ts +23 -0
- package/dist/config/remote-wake-limits.d.ts.map +1 -0
- package/dist/config/remote-wake-limits.js +23 -0
- package/dist/config/remote-wake-limits.js.map +1 -0
- package/dist/custom-model-hosts.d.ts +32 -0
- package/dist/custom-model-hosts.d.ts.map +1 -1
- package/dist/custom-model-hosts.js.map +1 -1
- package/dist/custom-model-injection-apply.d.ts +29 -1
- package/dist/custom-model-injection-apply.d.ts.map +1 -1
- package/dist/custom-model-injection-apply.js +191 -5
- package/dist/custom-model-injection-apply.js.map +1 -1
- package/dist/custom-model-injection.d.ts +35 -9
- package/dist/custom-model-injection.d.ts.map +1 -1
- package/dist/custom-model-injection.js +37 -16
- package/dist/custom-model-injection.js.map +1 -1
- package/dist/mux-interface.d.ts +12 -0
- package/dist/mux-interface.d.ts.map +1 -1
- package/dist/remote-hosts.d.ts +20 -0
- package/dist/remote-hosts.d.ts.map +1 -1
- package/dist/remote-hosts.js +33 -0
- package/dist/remote-hosts.js.map +1 -1
- package/dist/remote-wake.d.ts +446 -0
- package/dist/remote-wake.d.ts.map +1 -0
- package/dist/remote-wake.js +880 -0
- package/dist/remote-wake.js.map +1 -0
- package/dist/session-env-clamp.d.ts +12 -7
- package/dist/session-env-clamp.d.ts.map +1 -1
- package/dist/session-env-clamp.js +12 -7
- package/dist/session-env-clamp.js.map +1 -1
- package/dist/session-submit-verifier.d.ts +44 -0
- package/dist/session-submit-verifier.d.ts.map +1 -0
- package/dist/session-submit-verifier.js +122 -0
- package/dist/session-submit-verifier.js.map +1 -0
- package/dist/session.d.ts +9 -0
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +42 -1
- package/dist/session.js.map +1 -1
- package/dist/tmux-manager.d.ts.map +1 -1
- package/dist/tmux-manager.js +9 -0
- package/dist/tmux-manager.js.map +1 -1
- package/dist/types/session.d.ts +26 -0
- package/dist/types/session.d.ts.map +1 -1
- package/dist/types/session.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.a792bf71.js +38 -0
- package/dist/web/public/app.a792bf71.js.br +0 -0
- package/dist/web/public/app.a792bf71.js.gz +0 -0
- package/dist/web/public/approvals-ui.js.gz +0 -0
- package/dist/web/public/{constants.258b140f.js → constants.b26748e9.js} +123 -0
- package/dist/web/public/constants.b26748e9.js.br +0 -0
- package/dist/web/public/constants.b26748e9.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/host-wake-ui.js +440 -0
- package/dist/web/public/host-wake-ui.js.br +0 -0
- package/dist/web/public/host-wake-ui.js.gz +0 -0
- package/dist/web/public/i18n.d22be5c4.js +1 -0
- package/dist/web/public/i18n.d22be5c4.js.br +0 -0
- package/dist/web/public/i18n.d22be5c4.js.gz +0 -0
- package/dist/web/public/{image-input.cd4b97c4.js → image-input.a216cf9e.js} +8 -4
- package/dist/web/public/image-input.a216cf9e.js.br +0 -0
- package/dist/web/public/image-input.a216cf9e.js.gz +0 -0
- package/dist/web/public/index.html +191 -12
- package/dist/web/public/index.html.br +0 -0
- package/dist/web/public/index.html.gz +0 -0
- package/dist/web/public/input-cjk.8bc46081.js.gz +0 -0
- package/dist/web/public/{keyboard-accessory.2cf04f17.js → keyboard-accessory.c1e7c7b7.js} +280 -15
- package/dist/web/public/keyboard-accessory.c1e7c7b7.js.br +0 -0
- package/dist/web/public/keyboard-accessory.c1e7c7b7.js.gz +0 -0
- package/dist/web/public/mobile-handlers.6f354a87.js.gz +0 -0
- package/dist/web/public/mobile-overview.js.gz +0 -0
- package/dist/web/public/mobile.6caaa28a.css.gz +0 -0
- package/dist/web/public/notification-manager.36ea4624.js.gz +0 -0
- package/dist/web/public/orchestrator-panel.js.gz +0 -0
- package/dist/web/public/{panels-ui.5b07ad14.js → panels-ui.28df5053.js} +5 -5
- package/dist/web/public/panels-ui.28df5053.js.br +0 -0
- package/dist/web/public/panels-ui.28df5053.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/reboot-restore-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.7df17fd3.js +88 -0
- package/dist/web/public/session-ui.7df17fd3.js.br +0 -0
- package/dist/web/public/session-ui.7df17fd3.js.gz +0 -0
- package/dist/web/public/settings-ui.df5ffb68.js +78 -0
- package/dist/web/public/settings-ui.df5ffb68.js.br +0 -0
- package/dist/web/public/settings-ui.df5ffb68.js.gz +0 -0
- package/dist/web/public/styles.74f312e5.css +1 -0
- package/dist/web/public/styles.74f312e5.css.br +0 -0
- package/dist/web/public/styles.74f312e5.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-keycode229-recovery.fb91b25b.js.gz +0 -0
- package/dist/web/public/terminal-split.js +804 -0
- package/dist/web/public/terminal-split.js.br +0 -0
- package/dist/web/public/terminal-split.js.gz +0 -0
- package/dist/web/public/terminal-ui.32fbeaf6.js +2 -0
- package/dist/web/public/terminal-ui.32fbeaf6.js.br +0 -0
- package/dist/web/public/terminal-ui.32fbeaf6.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.c4b51eb6.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/custom-model-routes.d.ts +173 -0
- package/dist/web/routes/custom-model-routes.d.ts.map +1 -1
- package/dist/web/routes/custom-model-routes.js +628 -11
- package/dist/web/routes/custom-model-routes.js.map +1 -1
- package/dist/web/routes/index.d.ts +1 -1
- package/dist/web/routes/index.d.ts.map +1 -1
- package/dist/web/routes/index.js +1 -1
- package/dist/web/routes/index.js.map +1 -1
- package/dist/web/routes/session-routes.d.ts +6 -1
- package/dist/web/routes/session-routes.d.ts.map +1 -1
- package/dist/web/routes/session-routes.js +448 -17
- package/dist/web/routes/session-routes.js.map +1 -1
- package/dist/web/schemas.d.ts +15 -0
- package/dist/web/schemas.d.ts.map +1 -1
- package/dist/web/schemas.js +76 -0
- package/dist/web/schemas.js.map +1 -1
- package/dist/web/server.d.ts +21 -0
- package/dist/web/server.d.ts.map +1 -1
- package/dist/web/server.js +142 -9
- package/dist/web/server.js.map +1 -1
- package/dist/web/sse-events.d.ts +25 -2
- package/dist/web/sse-events.d.ts.map +1 -1
- package/dist/web/sse-events.js +30 -3
- package/dist/web/sse-events.js.map +1 -1
- package/package.json +1 -1
- package/skills/codeman/SKILL.md +75 -26
- package/skills/codeman/preamble.sh +66 -19
- package/skills/codeman/reference/recipes.md +1 -1
- package/dist/web/public/app.6d2dc4e8.js +0 -38
- package/dist/web/public/app.6d2dc4e8.js.br +0 -0
- package/dist/web/public/app.6d2dc4e8.js.gz +0 -0
- package/dist/web/public/constants.258b140f.js.br +0 -0
- package/dist/web/public/constants.258b140f.js.gz +0 -0
- package/dist/web/public/i18n.5f897ed5.js +0 -1
- package/dist/web/public/i18n.5f897ed5.js.br +0 -0
- package/dist/web/public/i18n.5f897ed5.js.gz +0 -0
- package/dist/web/public/image-input.cd4b97c4.js.br +0 -0
- package/dist/web/public/image-input.cd4b97c4.js.gz +0 -0
- package/dist/web/public/keyboard-accessory.2cf04f17.js.br +0 -0
- package/dist/web/public/keyboard-accessory.2cf04f17.js.gz +0 -0
- package/dist/web/public/panels-ui.5b07ad14.js.br +0 -0
- package/dist/web/public/panels-ui.5b07ad14.js.gz +0 -0
- package/dist/web/public/session-ui.42b81477.js +0 -77
- package/dist/web/public/session-ui.42b81477.js.br +0 -0
- package/dist/web/public/session-ui.42b81477.js.gz +0 -0
- package/dist/web/public/settings-ui.58f1d756.js +0 -67
- package/dist/web/public/settings-ui.58f1d756.js.br +0 -0
- package/dist/web/public/settings-ui.58f1d756.js.gz +0 -0
- package/dist/web/public/styles.e6edfb0b.css +0 -1
- package/dist/web/public/styles.e6edfb0b.css.br +0 -0
- package/dist/web/public/styles.e6edfb0b.css.gz +0 -0
- package/dist/web/public/terminal-ui.4f8d5820.js +0 -2
- package/dist/web/public/terminal-ui.4f8d5820.js.br +0 -0
- package/dist/web/public/terminal-ui.4f8d5820.js.gz +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote-wake-limits.js","sourceRoot":"","sources":["../../src/config/remote-wake-limits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC"}
|
|
@@ -32,6 +32,38 @@ export interface CustomModelHost {
|
|
|
32
32
|
authStyle?: CustomModelAuthStyle;
|
|
33
33
|
models?: string[];
|
|
34
34
|
lastDiscoveredAt?: string;
|
|
35
|
+
/**
|
|
36
|
+
* The model the Run-menu picker (docs/custom-model-endpoints-plan.md) applies when
|
|
37
|
+
* this endpoint is picked with no further choice — one generated menu entry per
|
|
38
|
+
* (CLI, endpoint) pair, not per (CLI, endpoint, model), so it needs a single answer.
|
|
39
|
+
* Must be a member of `models` when set; the picker falls back to `models[0]` when
|
|
40
|
+
* this is unset, and disables the entry entirely when `models` is empty (nothing to
|
|
41
|
+
* default to). Never auto-set on discovery — the previous default staying valid
|
|
42
|
+
* after a re-discover is a property worth keeping even if the model list changes.
|
|
43
|
+
*/
|
|
44
|
+
defaultModelId?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Discovered context-window size (tokens) per model id, keyed by the same strings as
|
|
47
|
+
* `models`. Populated opportunistically during discovery (`custom-model-routes.ts`) from
|
|
48
|
+
* llama.cpp/llama-swap's `GET /props?model=<id>` — the plain OpenAI-shaped `/v1/models`
|
|
49
|
+
* response has no such field. Only ever probed for a model the server already reports as
|
|
50
|
+
* loaded (llama-swap's `status.value === 'loaded'`); an unloaded one is deliberately never
|
|
51
|
+
* probed, since llama-swap treats `/props?model=` as a routing hint that can trigger an
|
|
52
|
+
* actual (slow, GPU-swapping) model load as a side effect of merely asking. A model this
|
|
53
|
+
* has no entry for simply gets no context-length env override applied — never a guess.
|
|
54
|
+
*/
|
|
55
|
+
modelContextLengths?: Record<string, number>;
|
|
56
|
+
/**
|
|
57
|
+
* Discovered file size (GB) per model id, keyed by the same strings as `models`.
|
|
58
|
+
* Populated during discovery by parsing llama-swap's own `description` field for an
|
|
59
|
+
* auto-discovered model ("Auto-discovered 16.35 GB - parameters auto-fitted by
|
|
60
|
+
* llama.cpp") — a hand-configured profile's own description has no such figure and
|
|
61
|
+
* correctly gets no entry, never a guess. Used only to label the Run-menu picker's
|
|
62
|
+
* "loading model" banner with a rough, unmeasured expected-time estimate
|
|
63
|
+
* (the Run-menu picker's loading banner in session-ui.js) — never a guarantee, and never anything a
|
|
64
|
+
* server-side check relies on.
|
|
65
|
+
*/
|
|
66
|
+
modelSizesGB?: Record<string, number>;
|
|
35
67
|
}
|
|
36
68
|
export declare function customModelHostsPath(configDir: string): string;
|
|
37
69
|
export declare function readCustomModelHosts(configDir: string): Promise<CustomModelHost[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-model-hosts.d.ts","sourceRoot":"","sources":["../src/custom-model-hosts.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,SAAS,CAAC;AAExD,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,6FAA6F;IAC7F,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;;;;;;;;OAcG;IACH,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"custom-model-hosts.d.ts","sourceRoot":"","sources":["../src/custom-model-hosts.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,SAAS,CAAC;AAExD,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,6FAA6F;IAC7F,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;;;;;;;;OAcG;IACH,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;;;;;OAQG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;;;OASG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C;;;;;;;;;OASG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC;AAED,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE9D;AAED,wBAAsB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CAQxF;AAED,wBAAsB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAMtG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-model-hosts.js","sourceRoot":"","sources":["../src/custom-model-hosts.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,uBAAuB,GAAG,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"custom-model-hosts.js","sourceRoot":"","sources":["../src/custom-model-hosts.ts"],"names":[],"mappings":"AAAA;;;;;;;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AG,EAAE,MAAM,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -27,6 +27,26 @@ export declare function customModelConfigDir(sessionId: string): string;
|
|
|
27
27
|
* creation).
|
|
28
28
|
*/
|
|
29
29
|
export declare function applyConfigDirInjection(baseDir: string, injection: ConfigDirInjection): Record<string, string>;
|
|
30
|
+
/**
|
|
31
|
+
* Pre-approves the injected API key in an isolated config directory's trust-dialog state
|
|
32
|
+
* (`customModelInjection.apiKeyTrustFile`), so an otherwise-empty directory doesn't make the
|
|
33
|
+
* CLI stop at an interactive "Detected a custom API key — use it?" prompt on every single
|
|
34
|
+
* launch. Confirmed live: with nobody at the TTY to answer, that prompt's own default
|
|
35
|
+
* ("No") silently refuses the very key this feature just injected — this isn't bypassing
|
|
36
|
+
* the check, it's answering it the same field a real answered prompt itself writes to
|
|
37
|
+
* (verified against a real `~/.claude.json` after answering by hand once).
|
|
38
|
+
*
|
|
39
|
+
* Merges rather than overwrites: the file may already carry fields the CLI itself wrote on
|
|
40
|
+
* an earlier launch in this same isolated directory (machineID, userID, other approved
|
|
41
|
+
* keys), and a corrupt or partially-written file (a crash mid-write) is treated as absent
|
|
42
|
+
* rather than failing the whole apply over a nice-to-have.
|
|
43
|
+
*/
|
|
44
|
+
/**
|
|
45
|
+
* The form Claude Code actually stores an approved key in: the trimmed last 20
|
|
46
|
+
* characters. Mirrors the CLI's own `e.trim().slice(-20)`, which is applied on BOTH
|
|
47
|
+
* the write and the lookup, so anything else never matches.
|
|
48
|
+
*/
|
|
49
|
+
export declare function truncateApiKeyForTrustFile(apiKey: string): string;
|
|
30
50
|
/** Best-effort recursive removal of a previously-written configDir. Never throws. */
|
|
31
51
|
export declare function removeConfigDir(dir: string | undefined): void;
|
|
32
52
|
/** What applying an endpoint to a session yields, ready for `Session.setCustomModel()`. */
|
|
@@ -45,5 +65,13 @@ export interface AppliedCustomModel {
|
|
|
45
65
|
* (same content) and the env values, which are never persisted because they carry
|
|
46
66
|
* the API key, are re-derived from the endpoint store instead.
|
|
47
67
|
*/
|
|
48
|
-
export declare function applyCustomModelInjection(entry: Pick<CliEntry, 'capabilities'>, endpoint: CustomModelEndpoint, modelId: string, sessionId: string
|
|
68
|
+
export declare function applyCustomModelInjection(entry: Pick<CliEntry, 'capabilities'>, endpoint: CustomModelEndpoint, modelId: string, sessionId: string,
|
|
69
|
+
/** Discovered context-window size for `modelId`, if known — see `contextLengthVar`. */
|
|
70
|
+
contextLength?: number,
|
|
71
|
+
/**
|
|
72
|
+
* The session's own working directory — only used for `skipFirstRunPrompts`'s per-project
|
|
73
|
+
* trust-dialog seed, and only when provided (boot recovery, which has no reason to
|
|
74
|
+
* re-answer a dialog that already fired once, omits it rather than re-deriving it).
|
|
75
|
+
*/
|
|
76
|
+
workingDir?: string): AppliedCustomModel | undefined;
|
|
49
77
|
//# sourceMappingURL=custom-model-injection-apply.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-model-injection-apply.d.ts","sourceRoot":"","sources":["../src/custom-model-injection-apply.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"custom-model-injection-apply.d.ts","sourceRoot":"","sources":["../src/custom-model-injection-apply.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACzB,MAAM,6BAA6B,CAAC;AAErC,qGAAqG;AACrG,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE9D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAQ9G;AAgCD;;;;;;;;;;;;;GAaG;AACH;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEjE;AA+GD,qFAAqF;AACrF,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAO7D;AAED,2FAA2F;AAC3F,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,EACrC,QAAQ,EAAE,mBAAmB,EAC7B,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM;AACjB,uFAAuF;AACvF,aAAa,CAAC,EAAE,MAAM;AACtB;;;;GAIG;AACH,UAAU,CAAC,EAAE,MAAM,GAClB,kBAAkB,GAAG,SAAS,CAkChC"}
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
* see docs/custom-model-endpoints-plan.md and the "dynamic to support
|
|
10
10
|
* cli-registry changes" requirement it was written against.
|
|
11
11
|
*/
|
|
12
|
-
import { chmodSync, mkdirSync, writeFileSync, rmSync } from 'node:fs';
|
|
12
|
+
import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync, rmSync, symlinkSync } from 'node:fs';
|
|
13
|
+
import { homedir, platform } from 'node:os';
|
|
13
14
|
import { join, dirname } from 'node:path';
|
|
14
15
|
import { dataPath } from './config/instance.js';
|
|
15
16
|
import { buildCustomModelInjection, } from './custom-model-injection.js';
|
|
@@ -39,6 +40,161 @@ export function applyConfigDirInjection(baseDir, injection) {
|
|
|
39
40
|
}
|
|
40
41
|
return { [injection.dirEnvVar]: baseDir, ...injection.extraEnv };
|
|
41
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Real, shared Claude config directory Codeman's own host process runs under — honors
|
|
45
|
+
* `CLAUDE_CONFIG_DIR` the same way `claude-credentials.ts`'s `claudeCredentialsPath()`
|
|
46
|
+
* does, so the symlink below points at wherever `~/.claude/projects` actually lives
|
|
47
|
+
* rather than assuming the plain default.
|
|
48
|
+
*/
|
|
49
|
+
function realClaudeConfigDir() {
|
|
50
|
+
const configured = typeof process.env.CLAUDE_CONFIG_DIR === 'string' && process.env.CLAUDE_CONFIG_DIR.trim();
|
|
51
|
+
return configured || join(homedir(), '.claude');
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Symlinks `<isolatedDir>/projects` back to the real, shared `~/.claude/projects`, so an
|
|
55
|
+
* isolated `CLAUDE_CONFIG_DIR` (used to keep an injected API key away from a stored OAuth
|
|
56
|
+
* session — see `configDirVar` on customModelInjection) doesn't also blind the response
|
|
57
|
+
* viewer, subagent windows, and Read My Mind for that session (docs/wiki/Agent-CLIs.md).
|
|
58
|
+
* Best-effort: a platform that refuses symlinks (unprivileged Windows without a junction
|
|
59
|
+
* fallback working, e.g.) just keeps the pre-existing documented side effect instead of
|
|
60
|
+
* failing the whole custom-model apply over a nice-to-have.
|
|
61
|
+
*/
|
|
62
|
+
function linkSharedProjectsDir(isolatedDir) {
|
|
63
|
+
const link = join(isolatedDir, 'projects');
|
|
64
|
+
if (existsSync(link))
|
|
65
|
+
return; // already linked (idempotent re-apply) or real dir wrote one
|
|
66
|
+
try {
|
|
67
|
+
symlinkSync(join(realClaudeConfigDir(), 'projects'), link, platform() === 'win32' ? 'junction' : 'dir');
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
// best-effort only — response viewer/subagent windows go blind for this session instead
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Pre-approves the injected API key in an isolated config directory's trust-dialog state
|
|
75
|
+
* (`customModelInjection.apiKeyTrustFile`), so an otherwise-empty directory doesn't make the
|
|
76
|
+
* CLI stop at an interactive "Detected a custom API key — use it?" prompt on every single
|
|
77
|
+
* launch. Confirmed live: with nobody at the TTY to answer, that prompt's own default
|
|
78
|
+
* ("No") silently refuses the very key this feature just injected — this isn't bypassing
|
|
79
|
+
* the check, it's answering it the same field a real answered prompt itself writes to
|
|
80
|
+
* (verified against a real `~/.claude.json` after answering by hand once).
|
|
81
|
+
*
|
|
82
|
+
* Merges rather than overwrites: the file may already carry fields the CLI itself wrote on
|
|
83
|
+
* an earlier launch in this same isolated directory (machineID, userID, other approved
|
|
84
|
+
* keys), and a corrupt or partially-written file (a crash mid-write) is treated as absent
|
|
85
|
+
* rather than failing the whole apply over a nice-to-have.
|
|
86
|
+
*/
|
|
87
|
+
/**
|
|
88
|
+
* The form Claude Code actually stores an approved key in: the trimmed last 20
|
|
89
|
+
* characters. Mirrors the CLI's own `e.trim().slice(-20)`, which is applied on BOTH
|
|
90
|
+
* the write and the lookup, so anything else never matches.
|
|
91
|
+
*/
|
|
92
|
+
export function truncateApiKeyForTrustFile(apiKey) {
|
|
93
|
+
return apiKey.trim().slice(-20);
|
|
94
|
+
}
|
|
95
|
+
function seedApiKeyTrustFile(configDir, trustFile, apiKey) {
|
|
96
|
+
const filePath = join(configDir, trustFile.relPath);
|
|
97
|
+
let existing = {};
|
|
98
|
+
try {
|
|
99
|
+
existing = JSON.parse(readFileSync(filePath, 'utf8'));
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
existing = {};
|
|
103
|
+
}
|
|
104
|
+
const responses = (existing.customApiKeyResponses ?? {});
|
|
105
|
+
const approved = new Set(Array.isArray(responses.approved) ? responses.approved : []);
|
|
106
|
+
// ⚠ Claude Code stores and compares only the LAST 20 CHARACTERS of a key, never the
|
|
107
|
+
// whole thing: its lookup is `approved.includes(key.trim().slice(-20))` (decompiled
|
|
108
|
+
// from the 2.1.278 bundle, and corroborated by real `~/.claude.json` files, whose
|
|
109
|
+
// customApiKeyResponses entries are all exactly 20 characters). Seeding the full key
|
|
110
|
+
// therefore never matches for a REAL key, and claude stops at the interactive
|
|
111
|
+
// "Detected a custom API key in your environment" prompt, whose default is
|
|
112
|
+
// "No (recommended)" — so the launch hangs or silently refuses the key this feature
|
|
113
|
+
// just injected. It went unnoticed because a keyless llama.cpp/llama-swap endpoint
|
|
114
|
+
// uses DEFAULT_API_KEY ('local-dummy-key', 15 chars), where slice(-20) is the whole
|
|
115
|
+
// string and the seed matches by accident. Truncating here also keeps a full
|
|
116
|
+
// third-party credential from being written into a second file on disk.
|
|
117
|
+
approved.add(truncateApiKeyForTrustFile(apiKey));
|
|
118
|
+
const rejected = Array.isArray(responses.rejected) ? responses.rejected : [];
|
|
119
|
+
existing.customApiKeyResponses = { approved: [...approved], rejected };
|
|
120
|
+
try {
|
|
121
|
+
writeFileSync(filePath, JSON.stringify(existing, null, 2), { encoding: 'utf8', mode: 0o600 });
|
|
122
|
+
chmodSync(filePath, 0o600);
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
// best-effort only — the interactive prompt returns instead of a hard failure here
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Pre-seeds the two remaining pieces of "already been onboarded" state a fresh
|
|
130
|
+
* `CLAUDE_CONFIG_DIR` has none of (`customModelInjection.skipFirstRunPrompts`, alongside
|
|
131
|
+
* apiKeyTrustFile): claude replays its whole first-run sequence — the theme picker, the
|
|
132
|
+
* security-notes screen, and (per-project) the "trust this folder?" dialog — against ANY
|
|
133
|
+
* config directory that has never completed it, confirmed live against a genuinely fresh
|
|
134
|
+
* isolated directory. `hasCompletedOnboarding` skips the theme/security-notes screens
|
|
135
|
+
* outright; `projects[workingDir].hasTrustDialogAccepted` answers the trust dialog for
|
|
136
|
+
* THIS session's own working directory the same way a real profile's own prior approval
|
|
137
|
+
* would — other projects in the file are left alone, and `workingDir` is used verbatim
|
|
138
|
+
* (never realpath'd or slash-normalized) since that's the literal string claude itself
|
|
139
|
+
* uses as the project key, being whatever string the session was actually launched with
|
|
140
|
+
* as its cwd.
|
|
141
|
+
*
|
|
142
|
+
* Same merge-not-overwrite and corrupt-file-tolerant behavior as `seedApiKeyTrustFile`
|
|
143
|
+
* (same file, so a second sequential read-modify-write here is deliberate rather than
|
|
144
|
+
* folding both into one pass — keeps each seed independently testable and optional).
|
|
145
|
+
*/
|
|
146
|
+
function seedFirstRunOnboardingState(configDir, trustFile, workingDir) {
|
|
147
|
+
const filePath = join(configDir, trustFile.relPath);
|
|
148
|
+
let existing = {};
|
|
149
|
+
try {
|
|
150
|
+
existing = JSON.parse(readFileSync(filePath, 'utf8'));
|
|
151
|
+
}
|
|
152
|
+
catch {
|
|
153
|
+
existing = {};
|
|
154
|
+
}
|
|
155
|
+
existing.hasCompletedOnboarding = true;
|
|
156
|
+
const projects = existing.projects && typeof existing.projects === 'object' && !Array.isArray(existing.projects)
|
|
157
|
+
? existing.projects
|
|
158
|
+
: {};
|
|
159
|
+
const existingProject = projects[workingDir] && typeof projects[workingDir] === 'object' ? projects[workingDir] : {};
|
|
160
|
+
projects[workingDir] = { ...existingProject, hasTrustDialogAccepted: true };
|
|
161
|
+
existing.projects = projects;
|
|
162
|
+
try {
|
|
163
|
+
writeFileSync(filePath, JSON.stringify(existing, null, 2), { encoding: 'utf8', mode: 0o600 });
|
|
164
|
+
chmodSync(filePath, 0o600);
|
|
165
|
+
}
|
|
166
|
+
catch {
|
|
167
|
+
// best-effort only — the interactive dialogs return instead of a hard failure here
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Pre-seeds the "skip the bypass-permissions warning" setting (`customModelInjection.
|
|
172
|
+
* skipFirstRunPrompts`, alongside apiKeyTrustFile) into an isolated config directory's
|
|
173
|
+
* `settings.json` — a real, already-onboarded profile answers claude's one-time warning
|
|
174
|
+
* about running with a bypass-permissions flag once and never sees it again, but every
|
|
175
|
+
* custom-model session launches with a fresh, otherwise-empty CLAUDE_CONFIG_DIR that
|
|
176
|
+
* carries none of that (confirmed live). A different file from apiKeyTrustFile's
|
|
177
|
+
* `.claude.json` — this is claude's own global `settings.json`, not project-keyed —
|
|
178
|
+
* so it gets its own merge-not-overwrite read-modify-write.
|
|
179
|
+
*/
|
|
180
|
+
function seedSkipBypassPermissionsPrompt(configDir) {
|
|
181
|
+
const filePath = join(configDir, 'settings.json');
|
|
182
|
+
let existing = {};
|
|
183
|
+
try {
|
|
184
|
+
existing = JSON.parse(readFileSync(filePath, 'utf8'));
|
|
185
|
+
}
|
|
186
|
+
catch {
|
|
187
|
+
existing = {};
|
|
188
|
+
}
|
|
189
|
+
existing.skipDangerousModePermissionPrompt = true;
|
|
190
|
+
try {
|
|
191
|
+
writeFileSync(filePath, JSON.stringify(existing, null, 2), { encoding: 'utf8', mode: 0o600 });
|
|
192
|
+
chmodSync(filePath, 0o600);
|
|
193
|
+
}
|
|
194
|
+
catch {
|
|
195
|
+
// best-effort only — the interactive warning returns instead of a hard failure here
|
|
196
|
+
}
|
|
197
|
+
}
|
|
42
198
|
/** Best-effort recursive removal of a previously-written configDir. Never throws. */
|
|
43
199
|
export function removeConfigDir(dir) {
|
|
44
200
|
if (!dir)
|
|
@@ -59,14 +215,44 @@ export function removeConfigDir(dir) {
|
|
|
59
215
|
* (same content) and the env values, which are never persisted because they carry
|
|
60
216
|
* the API key, are re-derived from the endpoint store instead.
|
|
61
217
|
*/
|
|
62
|
-
export function applyCustomModelInjection(entry, endpoint, modelId, sessionId
|
|
63
|
-
|
|
218
|
+
export function applyCustomModelInjection(entry, endpoint, modelId, sessionId,
|
|
219
|
+
/** Discovered context-window size for `modelId`, if known — see `contextLengthVar`. */
|
|
220
|
+
contextLength,
|
|
221
|
+
/**
|
|
222
|
+
* The session's own working directory — only used for `skipFirstRunPrompts`'s per-project
|
|
223
|
+
* trust-dialog seed, and only when provided (boot recovery, which has no reason to
|
|
224
|
+
* re-answer a dialog that already fired once, omits it rather than re-deriving it).
|
|
225
|
+
*/
|
|
226
|
+
workingDir) {
|
|
227
|
+
const injection = buildCustomModelInjection(entry, endpoint, modelId, contextLength);
|
|
64
228
|
if (injection.kind === 'unsupported')
|
|
65
229
|
return undefined;
|
|
66
230
|
if (injection.kind === 'env') {
|
|
231
|
+
// `configDirVar` (claude's CLAUDE_CONFIG_DIR): point it at the same isolated,
|
|
232
|
+
// per-session directory the `configDir` kind uses, but write no files into it — an
|
|
233
|
+
// empty directory has no stored OAuth credential to conflict with the injected API
|
|
234
|
+
// key, which is the whole point. Reusing the same path keyed by sessionId keeps this
|
|
235
|
+
// idempotent across a boot-recovery re-apply, same as the configDir kind below.
|
|
236
|
+
let envOverrides = injection.envOverrides;
|
|
237
|
+
let configDir;
|
|
238
|
+
if (injection.configDirVar) {
|
|
239
|
+
configDir = customModelConfigDir(sessionId);
|
|
240
|
+
mkdirSync(configDir, { recursive: true, mode: 0o700 });
|
|
241
|
+
linkSharedProjectsDir(configDir);
|
|
242
|
+
if (injection.apiKeyTrustFile && injection.apiKey) {
|
|
243
|
+
seedApiKeyTrustFile(configDir, injection.apiKeyTrustFile, injection.apiKey);
|
|
244
|
+
}
|
|
245
|
+
if (injection.skipFirstRunPrompts && injection.apiKeyTrustFile) {
|
|
246
|
+
if (workingDir)
|
|
247
|
+
seedFirstRunOnboardingState(configDir, injection.apiKeyTrustFile, workingDir);
|
|
248
|
+
seedSkipBypassPermissionsPrompt(configDir);
|
|
249
|
+
}
|
|
250
|
+
envOverrides = { ...envOverrides, [injection.configDirVar]: configDir };
|
|
251
|
+
}
|
|
67
252
|
return {
|
|
68
|
-
envOverrides
|
|
69
|
-
envKeys: Object.keys(
|
|
253
|
+
envOverrides,
|
|
254
|
+
envKeys: Object.keys(envOverrides),
|
|
255
|
+
configDir,
|
|
70
256
|
launchModel: injection.launchModel,
|
|
71
257
|
};
|
|
72
258
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-model-injection-apply.js","sourceRoot":"","sources":["../src/custom-model-injection-apply.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,a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EAAE,CAAC;AAC7G,CAAC"}
|
|
@@ -16,14 +16,21 @@
|
|
|
16
16
|
* shape was rejected by a real codex binary with "invalid type: map,
|
|
17
17
|
* expected a string" — caught by `scripts/test-local-llm-harnesses.ts`),
|
|
18
18
|
* but `wire_api = "responses"` is the only value codex still accepts
|
|
19
|
-
* (support for `"chat"` was dropped in Feb 2026)
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
19
|
+
* (support for `"chat"` was dropped in Feb 2026). ⚠️ Re-verified live
|
|
20
|
+
* against a llama-swap deployment that DOES answer `/v1/responses`: a
|
|
21
|
+
* plain, no-tool-call turn gets a real reply, but a real tool-call attempt
|
|
22
|
+
* comes back as `agent_message` TEXT (the tool-call JSON printed as the
|
|
23
|
+
* answer) rather than a `function_call` item codex would execute —
|
|
24
|
+
* confirmed via `codex exec --json`'s raw event stream. Tool execution is
|
|
25
|
+
* what makes codex a coding agent, so this remains not usable for real
|
|
26
|
+
* work even where plain chat succeeds; see docs/custom-model-endpoints-plan.md
|
|
27
|
+
* for the full picture (including the harmless `Model metadata ... not
|
|
28
|
+
* found` warning every custom-endpoint codex session prints — sourced from
|
|
29
|
+
* a local cache of OpenAI's OWN hosted model catalog that a custom model
|
|
30
|
+
* can never appear in, confirmed to have no effect on the outcome above).
|
|
31
|
+
* The rest (gemini/pi/grok/deepseek/omp) have their ONE-SHOT INVOCATION
|
|
32
|
+
* flags confirmed against real installed binaries' own `--help` output,
|
|
33
|
+
* but their custom-endpoint env/config conventions remain web-researched,
|
|
27
34
|
* unverified.
|
|
28
35
|
*/
|
|
29
36
|
import type { CliEntry } from './config/cli-registry/types.js';
|
|
@@ -41,6 +48,23 @@ export interface EnvInjection {
|
|
|
41
48
|
envOverrides: Record<string, string>;
|
|
42
49
|
/** See {@link ConfigDirInjection.launchModel}. */
|
|
43
50
|
launchModel?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Name of the env var the caller should point at an isolated, credential-free config
|
|
53
|
+
* directory for this session (claude's `CLAUDE_CONFIG_DIR`), from the registry entry's
|
|
54
|
+
* `customModelInjection.configDirVar`. The actual directory value isn't computed here —
|
|
55
|
+
* this module is pure and has no sessionId to derive one from — the IO wrapper
|
|
56
|
+
* (`custom-model-injection-apply.ts`) creates it and adds it to `envOverrides`.
|
|
57
|
+
*/
|
|
58
|
+
configDirVar?: string;
|
|
59
|
+
/** See `customModelInjection.apiKeyTrustFile` — carried through so the IO wrapper can seed it. */
|
|
60
|
+
apiKeyTrustFile?: {
|
|
61
|
+
relPath: string;
|
|
62
|
+
shape: 'claude-api-key-responses';
|
|
63
|
+
};
|
|
64
|
+
/** The literal API key value this injection used, for `apiKeyTrustFile` to pre-approve. */
|
|
65
|
+
apiKey?: string;
|
|
66
|
+
/** See `customModelInjection.skipFirstRunPrompts` — carried through so the IO wrapper can seed it. */
|
|
67
|
+
skipFirstRunPrompts?: boolean;
|
|
44
68
|
}
|
|
45
69
|
export interface ConfigDirInjection {
|
|
46
70
|
kind: 'configDir';
|
|
@@ -72,7 +96,9 @@ export interface UnsupportedInjection {
|
|
|
72
96
|
export type CustomModelInjectionResult = EnvInjection | ConfigDirInjection | UnsupportedInjection;
|
|
73
97
|
/** Normalizes a base URL to end in exactly one trailing `/v1`, for CLIs whose config expects the OpenAI-style suffix. */
|
|
74
98
|
export declare function withV1Suffix(baseUrl: string): string;
|
|
75
|
-
export declare function buildCustomModelInjection(entry: Pick<CliEntry, 'capabilities'>, endpoint: CustomModelEndpoint, modelId: string
|
|
99
|
+
export declare function buildCustomModelInjection(entry: Pick<CliEntry, 'capabilities'>, endpoint: CustomModelEndpoint, modelId: string,
|
|
100
|
+
/** Discovered context-window size for `modelId`, if known — see `contextLengthVar`. */
|
|
101
|
+
contextLength?: number): CustomModelInjectionResult;
|
|
76
102
|
/** The `[model.<name>]` block name grok's config.toml uses for the injected model — also
|
|
77
103
|
* what `-m <name>` in the standalone script's ONE_SHOT argv must reference to select it. */
|
|
78
104
|
export declare const GROK_CUSTOM_MODEL_NAME = "codeman-custom";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-model-injection.d.ts","sourceRoot":"","sources":["../src/custom-model-injection.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"custom-model-injection.d.ts","sourceRoot":"","sources":["../src/custom-model-injection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAE/D,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,yGAAyG;IACzG,OAAO,EAAE,MAAM,CAAC;IAChB,0FAA0F;IAC1F,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,KAAK,CAAC;IACZ,oDAAoD;IACpD,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kGAAkG;IAClG,eAAe,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,0BAA0B,CAAA;KAAE,CAAC;IACzE,2FAA2F;IAC3F,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sGAAsG;IACtG,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,WAAW,CAAC;IAClB,iFAAiF;IACjF,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnD;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,aAAa,CAAC;CACrB;AAED,MAAM,MAAM,0BAA0B,GAAG,YAAY,GAAG,kBAAkB,GAAG,oBAAoB,CAAC;AAIlG,yHAAyH;AACzH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGpD;AAOD,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,EACrC,QAAQ,EAAE,mBAAmB,EAC7B,OAAO,EAAE,MAAM;AACf,uFAAuF;AACvF,aAAa,CAAC,EAAE,MAAM,GACrB,0BAA0B,CAsC5B;AAmCD;6FAC6F;AAC7F,eAAO,MAAM,sBAAsB,mBAAmB,CAAC"}
|
|
@@ -16,14 +16,21 @@
|
|
|
16
16
|
* shape was rejected by a real codex binary with "invalid type: map,
|
|
17
17
|
* expected a string" — caught by `scripts/test-local-llm-harnesses.ts`),
|
|
18
18
|
* but `wire_api = "responses"` is the only value codex still accepts
|
|
19
|
-
* (support for `"chat"` was dropped in Feb 2026)
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
19
|
+
* (support for `"chat"` was dropped in Feb 2026). ⚠️ Re-verified live
|
|
20
|
+
* against a llama-swap deployment that DOES answer `/v1/responses`: a
|
|
21
|
+
* plain, no-tool-call turn gets a real reply, but a real tool-call attempt
|
|
22
|
+
* comes back as `agent_message` TEXT (the tool-call JSON printed as the
|
|
23
|
+
* answer) rather than a `function_call` item codex would execute —
|
|
24
|
+
* confirmed via `codex exec --json`'s raw event stream. Tool execution is
|
|
25
|
+
* what makes codex a coding agent, so this remains not usable for real
|
|
26
|
+
* work even where plain chat succeeds; see docs/custom-model-endpoints-plan.md
|
|
27
|
+
* for the full picture (including the harmless `Model metadata ... not
|
|
28
|
+
* found` warning every custom-endpoint codex session prints — sourced from
|
|
29
|
+
* a local cache of OpenAI's OWN hosted model catalog that a custom model
|
|
30
|
+
* can never appear in, confirmed to have no effect on the outcome above).
|
|
31
|
+
* The rest (gemini/pi/grok/deepseek/omp) have their ONE-SHOT INVOCATION
|
|
32
|
+
* flags confirmed against real installed binaries' own `--help` output,
|
|
33
|
+
* but their custom-endpoint env/config conventions remain web-researched,
|
|
27
34
|
* unverified.
|
|
28
35
|
*/
|
|
29
36
|
const DEFAULT_API_KEY = 'local-dummy-key';
|
|
@@ -36,18 +43,30 @@ export function withV1Suffix(baseUrl) {
|
|
|
36
43
|
function quoted(value) {
|
|
37
44
|
return JSON.stringify(value);
|
|
38
45
|
}
|
|
39
|
-
export function buildCustomModelInjection(entry, endpoint, modelId
|
|
46
|
+
export function buildCustomModelInjection(entry, endpoint, modelId,
|
|
47
|
+
/** Discovered context-window size for `modelId`, if known — see `contextLengthVar`. */
|
|
48
|
+
contextLength) {
|
|
40
49
|
const cap = entry.capabilities.customModelInjection;
|
|
41
50
|
const apiKey = endpoint.apiKey?.trim() || DEFAULT_API_KEY;
|
|
42
51
|
switch (cap.kind) {
|
|
43
52
|
case 'env': {
|
|
44
53
|
const envOverrides = {
|
|
45
|
-
[cap.baseUrlVar]: endpoint.baseUrl,
|
|
54
|
+
[cap.baseUrlVar]: cap.appendV1Suffix ? withV1Suffix(endpoint.baseUrl) : endpoint.baseUrl,
|
|
46
55
|
[cap.apiKeyVar]: apiKey,
|
|
47
56
|
};
|
|
48
57
|
for (const modelVar of cap.modelVars)
|
|
49
58
|
envOverrides[modelVar] = modelId;
|
|
50
|
-
|
|
59
|
+
if (cap.contextLengthVar && contextLength !== undefined && Number.isFinite(contextLength)) {
|
|
60
|
+
envOverrides[cap.contextLengthVar] = String(Math.trunc(contextLength));
|
|
61
|
+
}
|
|
62
|
+
let result = withLaunchModel({ kind: 'env', envOverrides }, cap.launchModel, modelId);
|
|
63
|
+
if (cap.configDirVar)
|
|
64
|
+
result = { ...result, configDirVar: cap.configDirVar };
|
|
65
|
+
if (cap.apiKeyTrustFile)
|
|
66
|
+
result = { ...result, apiKeyTrustFile: cap.apiKeyTrustFile, apiKey };
|
|
67
|
+
if (cap.skipFirstRunPrompts)
|
|
68
|
+
result = { ...result, skipFirstRunPrompts: true };
|
|
69
|
+
return result;
|
|
51
70
|
}
|
|
52
71
|
case 'configContentEnv': {
|
|
53
72
|
const content = renderConfigContent(cap.template, endpoint, modelId, apiKey);
|
|
@@ -97,11 +116,13 @@ function renderConfigFile(template, endpoint, modelId, apiKey) {
|
|
|
97
116
|
// `env_key`, the NAME of an env var it reads the credential from at runtime, so the
|
|
98
117
|
// actual value must ride along as an extra env var, never embedded in the file.
|
|
99
118
|
// ⚠️ `wire_api = "responses"` is the only value codex still accepts (it dropped
|
|
100
|
-
// `"chat"` support in Feb 2026)
|
|
101
|
-
//
|
|
102
|
-
//
|
|
103
|
-
//
|
|
104
|
-
//
|
|
119
|
+
// `"chat"` support in Feb 2026). Even against a llama-swap deployment that DOES
|
|
120
|
+
// answer `/v1/responses`, a real tool-call attempt came back as plain TEXT (the
|
|
121
|
+
// tool-call JSON printed as the model's answer) rather than an executable
|
|
122
|
+
// `function_call` item — confirmed live via `codex exec --json`. Tool execution is
|
|
123
|
+
// what makes codex a coding agent, so this remains not usable for real work even
|
|
124
|
+
// where plain chat succeeds — see the confidence table in
|
|
125
|
+
// docs/custom-model-endpoints-plan.md, not a syntax bug in this file.
|
|
105
126
|
const content = [
|
|
106
127
|
`model = ${quoted(modelId)}`,
|
|
107
128
|
`model_provider = "custom"`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-model-injection.js","sourceRoot":"","sources":["../src/custom-model-injection.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"custom-model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AC/E,OAAO;gBACL,OAAO,EAAE,uCAAuC,MAAM,CAAC,OAAO,CAAC,iBAAiB,MAAM,CAAC,MAAM,CAAC,iFAAiF,MAAM,CAAC,OAAO,CAAC,IAAI;aACnM,CAAC;QACJ,KAAK,WAAW,CAAC,CAAC,CAAC;YACjB,0EAA0E;YAC1E,gFAAgF;YAChF,gFAAgF;YAChF,8EAA8E;YAC9E,6EAA6E;YAC7E,iFAAiF;YACjF,8EAA8E;YAC9E,MAAM,OAAO,GAAG;gBACd,UAAU,sBAAsB,GAAG;gBACnC,WAAW,MAAM,CAAC,OAAO,CAAC,EAAE;gBAC5B,cAAc,MAAM,CAAC,OAAO,CAAC,EAAE;gBAC/B,0BAA0B;gBAC1B,yBAAyB;gBACzB,kCAAkC;gBAClC,EAAE;aACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACb,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,CAAC;QACxD,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/mux-interface.d.ts
CHANGED
|
@@ -136,6 +136,18 @@ export interface PaneCaptureOptions {
|
|
|
136
136
|
* the 1MB execSync default (ENOBUFS).
|
|
137
137
|
*/
|
|
138
138
|
maxCaptureBytes?: number;
|
|
139
|
+
/**
|
|
140
|
+
* Filled in by the implementation with the pane geometry the capture was
|
|
141
|
+
* really taken at, which is not always the geometry the caller last asked
|
|
142
|
+
* for: a resize and a capture can race, and a pane whose size a desktop
|
|
143
|
+
* viewport has claimed ignores a smaller client's resize outright. A
|
|
144
|
+
* visible-frame capture addresses every row absolutely, so a consumer
|
|
145
|
+
* rendering it needs the real height to know the frame fits.
|
|
146
|
+
*/
|
|
147
|
+
capturedGeometry?: {
|
|
148
|
+
cols: number;
|
|
149
|
+
rows: number;
|
|
150
|
+
};
|
|
139
151
|
}
|
|
140
152
|
/**
|
|
141
153
|
* Terminal multiplexer interface.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mux-interface.d.ts","sourceRoot":"","sources":["../src/mux-interface.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EACV,YAAY,EACZ,sBAAsB,EACtB,UAAU,EACV,UAAU,EACV,WAAW,EACX,cAAc,EACd,WAAW,EACX,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,QAAQ,EACR,UAAU,EACV,cAAc,EACd,SAAS,EACT,aAAa,EACb,aAAa,EACd,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,yBAAyB;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,6BAA6B;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,wBAAwB;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,qEAAqE;IACrE,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,+EAA+E;IAC/E,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,6FAA6F;IAC7F,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mBAAmB;IACnB,IAAI,EAAE,WAAW,CAAC;IAClB,oDAAoD;IACpD,QAAQ,EAAE,OAAO,CAAC;IAClB,sCAAsC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8EAA8E;IAC9E,aAAa,CAAC,EAAE,sBAAsB,CAAC;IACvC,+CAA+C;IAC/C,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,UAAU;IACrD,mCAAmC;IACnC,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB;AAED,sDAAsD;AACtD,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAA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U,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhD,6CAA6C;IAC7C,mBAAmB,IAAI,IAAI,CAAC;IAI5B;;OAEG;IACH,gBAAgB,IAAI,MAAM,CAAC;IAE3B;;OAEG;IACH,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAEzC,iFAAiF;IACjF,mBAAmB,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IAE/C,8EAA8E;IAC9E,YAAY,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAIpE,iEAAiE;IACjE,WAAW,IAAI,OAAO,CAAC;IAEvB,6FAA6F;IAC7F,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IAE3C,gGAAgG;IAChG,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IAErC,wFAAwF;IACxF,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAEjE;;;;OAIG;IACH,iBAAiB,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,kBAAkB,GAAG,MAAM,GAAG,IAAI,CAAC;IAEnG;;;OAGG;IACH,uBAAuB,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,kBAAkB,GAAG,MAAM,GAAG,IAAI,CAAC;IAEpF;;;;;;OAMG;IACH,eAAe,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;CACvE"}
|
package/dist/remote-hosts.d.ts
CHANGED
|
@@ -230,6 +230,26 @@ export declare function remoteDisplayPath(remote: Pick<SessionRemote, 'username'
|
|
|
230
230
|
host: string;
|
|
231
231
|
path: string;
|
|
232
232
|
}): string;
|
|
233
|
+
/**
|
|
234
|
+
* Refresh HOST-level config on a RESTORED `SessionRemote`.
|
|
235
|
+
*
|
|
236
|
+
* A session's `remote` block is persisted at launch time (mux-sessions.json /
|
|
237
|
+
* state.json) and recovery uses that snapshot, so a field ADDED to the host config
|
|
238
|
+
* later never reaches an already-running session — not even across a Codeman
|
|
239
|
+
* restart. That is exactly how a `wakeCommand` added to `remote-hosts.json` would
|
|
240
|
+
* silently do nothing until the session is relaunched (which for an owned remote
|
|
241
|
+
* session means killing the remote tmux).
|
|
242
|
+
*
|
|
243
|
+
* Deliberately narrow: ONLY `wakeCommand`/`wakeMac` are taken from the host config,
|
|
244
|
+
* and the host is authoritative for them (removing one in the config turns that
|
|
245
|
+
* wake path off again). The other host-level fields (`commands`, ssh options) stay as
|
|
246
|
+
* persisted so this cannot silently change how an existing pane connects.
|
|
247
|
+
*/
|
|
248
|
+
export declare function rehydrateRemoteHostFields<T extends {
|
|
249
|
+
hostId: string;
|
|
250
|
+
wakeCommand?: string;
|
|
251
|
+
wakeMac?: string;
|
|
252
|
+
}>(remote: T | undefined, hostsById: ReadonlyMap<string, RemoteHost>): T | undefined;
|
|
233
253
|
export declare function toSessionRemote(host: RemoteHost, remoteCase: RemoteCase): SessionRemote;
|
|
234
254
|
/**
|
|
235
255
|
* COD-105 — build a NON-owned `SessionRemote` for ATTACHING to a `codeman-*`
|