@drakonkat/ai-helper 1.2.7 → 1.2.8

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/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@ All notable changes to **`ai-helper` (`aih`)** are documented in this file.
4
4
 
5
5
  ---
6
6
 
7
+ ## [1.2.8] - 2026-09-24
8
+
9
+ ### Added
10
+ - Persist the proxy model selection with `aih config pxpipe-models="model1,model2"`. Subsequent starts reuse it; explicit `--models` overrides the saved preference.
11
+
12
+ ---
13
+
7
14
  ## [Unreleased]
8
15
 
9
16
  ### Added
package/README.md CHANGED
@@ -296,13 +296,26 @@ aih up --models="gpt-6-astra,anthropic/claude-fable*" # Equivalent value syntax
296
296
  aih start --models= # Use pxpipe's default model selection
297
297
  ```
298
298
 
299
+ To save a model list once and reuse it on subsequent starts:
300
+
301
+ ```bash
302
+ aih config pxpipe-models="gpt-6-astra,claude-opus-5-5"
303
+ aih start
304
+ ```
305
+
306
+ The preference is saved in `~/.aih/state.json` (or `AIH_HOME/state.json`).
307
+ It applies to `start`/`up` and proxy starts/restarts; an explicit `--models`
308
+ takes precedence without changing the preference. `aih config pxpipe-models=`
309
+ saves pxpipe's default selection. Configuration does not restart a running proxy.
310
+
299
311
  The value is passed only to the built-in proxy; `ocx` and `agentmemory` start
300
312
  normally. `--models=` passes an empty string; `--models ""` also works when your
301
313
  shell preserves empty arguments. A bare `--models` without a value is an error.
302
314
  See [Select models](#select-models) for matching and compression behavior.
303
315
 
304
316
  The no-target `start`/`up` commands supply the upstream, listener and preset above
305
- on every invocation, plus that model list unless `--models` overrides it.
317
+ on every invocation, plus the configured model list (or the list above if unset),
318
+ unless `--models` overrides it.
306
319
  Other saved proxy options are retained.
307
320
  A first `aih start proxy <upstream>` instead uses listener `http://127.0.0.1:10101`
308
321
  and preset `none` unless specified. After configuration, `aih start proxy` reuses
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drakonkat/ai-helper",
3
- "version": "1.2.7",
3
+ "version": "1.2.8",
4
4
  "description": "Zero-config background service manager, auto-discovery daemon & dashboard launcher for AI agent ecosystems (pxpipe, ocx, agentmemory, headroom)",
5
5
  "main": "src/index.js",
6
6
  "module": "src/index.js",
package/src/index.js CHANGED
@@ -41,6 +41,7 @@ ${bold("COMMANDS:")}
41
41
  ${yellow("<service> update")} Update one service (for example: aih ocx update)
42
42
  ${yellow("logs")} <service> [-n 50] [-f] View or stream live logs for a service
43
43
  ${yellow("stats proxy")} [--json] Show proxy token savings estimates and recent requests
44
+ ${yellow("config")} pxpipe-models=<list> Save the proxy model list for future starts
44
45
  ${yellow("install")} Build standalone binary to ~/.local/bin and verify PATH
45
46
  ${yellow("version")}, ${yellow("-v")}, ${yellow("--version")} Show version information
46
47
  ${yellow("help")}, ${yellow("-h")}, ${yellow("--help")} Show this help message
@@ -79,7 +80,7 @@ ${bold("START DEFAULTS AND MODEL VALUES:")}
79
80
  Without service targets, start/up launches ocx, agentmemory, then proxy with:
80
81
  upstream: http://127.0.0.1:10100/ listen: http://127.0.0.1:10102 preset: pxpipe
81
82
  models: gpt-6-astra,google-antigravity/gemini-3.8*,anthropic/claude-fable*
82
- --models on start/up replaces this list for the proxy only.
83
+ config pxpipe-models=<list> saves a replacement list; --models overrides it.
83
84
  Model names are comma-separated; a trailing * matches a prefix (include provider names).
84
85
  All models are forwarded; the list selects which ones pxpipe may process.
85
86
  Value options accept --flag value or --flag=value. Quote lists, wildcards and spaced paths.
@@ -109,6 +110,7 @@ ${bold("EXAMPLES - STATUS, DASHBOARDS AND LOGS:")}
109
110
 
110
111
  ${bold("EXAMPLES - START, STOP AND UPDATE:")}
111
112
  ${dim("$")} ${cyan(CLI_NAME)} start
113
+ ${dim("$")} ${cyan(CLI_NAME)} config pxpipe-models="gpt-6-astra,claude-opus-5-5"
112
114
  ${dim("$")} ${cyan(CLI_NAME)} start --models "gpt-6-astra,anthropic/claude-fable*" --json
113
115
  ${dim("$")} ${cyan(CLI_NAME)} up --models="google-antigravity/gemini-3.8*"
114
116
  ${dim("$")} ${cyan(CLI_NAME)} start --models= ${dim("# Use pxpipe's default model selection")}
@@ -284,6 +286,16 @@ export async function main({ updateSelfImpl = updateSelf } = {}) {
284
286
  const targets = serviceFirstUpdate ? [positionalArgs[0].toLowerCase()] : positionalArgs.slice(1);
285
287
 
286
288
  switch (command) {
289
+ case "config": {
290
+ if (targets.length !== 1 || !targets[0].startsWith("pxpipe-models=") || rawArgs.some(arg => arg.startsWith("-"))) {
291
+ throw new Error('Usage: aih config pxpipe-models="model1,model2" (use pxpipe-models= for pxpipe defaults)');
292
+ }
293
+ const state = manager.readState();
294
+ state.config = { ...state.config, pxpipeModels: targets[0].slice("pxpipe-models=".length) };
295
+ manager.saveState(state);
296
+ console.log(green(`Saved pxpipe-models=${state.config.pxpipeModels}; applies on the next proxy start or restart.`));
297
+ break;
298
+ }
287
299
  case "update": {
288
300
  const ids = [...new Set(targets)];
289
301
  const invalid = ids.filter(id => !SERVICE_IDS.includes(id));
@@ -428,7 +440,7 @@ export async function main({ updateSelfImpl = updateSelf } = {}) {
428
440
  upstream: "http://127.0.0.1:10100/",
429
441
  listen: "http://127.0.0.1:10102",
430
442
  preset: "pxpipe",
431
- models: models ?? "gpt-6-astra,google-antigravity/gemini-3.8*,anthropic/claude-fable*",
443
+ models: models ?? manager.readState().config?.pxpipeModels ?? "gpt-6-astra,google-antigravity/gemini-3.8*,anthropic/claude-fable*",
432
444
  } : id === "proxy" && models !== undefined ? { models } : undefined);
433
445
  results.push({ id, ...res });
434
446
  if (jsonOutput) continue;
package/src/manager.js CHANGED
@@ -399,7 +399,11 @@ export class ServiceManager {
399
399
  async startProxyService(options) {
400
400
  const state = this.loadState();
401
401
  const current = state.services.proxy;
402
- const config = normalizeProxyOptions({ ...current?.proxyOptions, ...options });
402
+ const config = normalizeProxyOptions({
403
+ ...current?.proxyOptions,
404
+ ...(state.config?.pxpipeModels !== undefined ? { models: state.config.pxpipeModels } : {}),
405
+ ...options,
406
+ });
403
407
  if (current?.status === "running" && isPidRunning(current.pid)) {
404
408
  if (JSON.stringify(config) !== JSON.stringify(current.proxyOptions)) {
405
409
  throw new Error("Proxy is already running with different options; use 'aih restart proxy <upstream> [options]'");