@staff0rd/assist 0.690.0 → 0.691.1

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/index.js CHANGED
@@ -6,7 +6,7 @@ import { Command } from "commander";
6
6
  // package.json
7
7
  var package_default = {
8
8
  name: "@staff0rd/assist",
9
- version: "0.690.0",
9
+ version: "0.691.1",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -2862,7 +2862,7 @@ var harnessConfigHelp = [
2862
2862
  {
2863
2863
  key: "harness.codexModel",
2864
2864
  setter: "assist config set harness.codexModel <model>",
2865
- note: "run non-review Codex launches against this model on the LiteLLM proxy; plain codex when LiteLLM is unconfigured"
2865
+ note: "empty uses codex's own configured provider; a value routes non-review Codex launches through the LiteLLM proxy with that model (needs litellm.baseUrl and litellm.apiKey)"
2866
2866
  }
2867
2867
  ];
2868
2868
 
@@ -6422,7 +6422,7 @@ function spawnInherit(command, args, options2 = {}) {
6422
6422
  } = process.env;
6423
6423
  const child = spawn2(command, args, {
6424
6424
  stdio: "inherit",
6425
- env,
6425
+ env: { ...env, ...options2.env },
6426
6426
  cwd: options2.cwd
6427
6427
  });
6428
6428
  const done2 = new Promise((resolve25, reject) => {
@@ -8005,6 +8005,51 @@ function buildPhasePrompt(item, phaseNumber, phase) {
8005
8005
  });
8006
8006
  }
8007
8007
 
8008
+ // src/commands/litellm/readLitellmConfig.ts
8009
+ function readLitellmConfig() {
8010
+ const litellm = loadConfig().litellm;
8011
+ const baseUrl = litellm?.baseUrl?.trim();
8012
+ const apiKey = litellm?.apiKey?.trim();
8013
+ const missing = [
8014
+ ...baseUrl ? [] : ["litellm.baseUrl"],
8015
+ ...apiKey ? [] : ["litellm.apiKey"]
8016
+ ];
8017
+ if (!baseUrl || !apiKey) return { config: null, missing };
8018
+ return { config: { baseUrl: baseUrl.replace(/\/+$/, ""), apiKey }, missing };
8019
+ }
8020
+
8021
+ // src/commands/litellm/buildLitellmCodexArgs.ts
8022
+ var API_KEY_ENV = "ASSIST_LITELLM_API_KEY";
8023
+ function buildLitellmCodexArgs(rawModel) {
8024
+ const model = rawModel?.trim();
8025
+ if (!model) return { args: [], env: {} };
8026
+ const { config } = readLitellmConfig();
8027
+ if (!config) return { args: [], env: {} };
8028
+ return {
8029
+ args: [
8030
+ "-c",
8031
+ "model_providers.litellm.name=LiteLLM",
8032
+ "-c",
8033
+ `model_providers.litellm.base_url=${config.baseUrl}/v1`,
8034
+ "-c",
8035
+ `model_providers.litellm.env_key=${API_KEY_ENV}`,
8036
+ "-c",
8037
+ "model_providers.litellm.wire_api=responses",
8038
+ "-c",
8039
+ "model_provider=litellm",
8040
+ "-m",
8041
+ model
8042
+ ],
8043
+ env: { [API_KEY_ENV]: config.apiKey },
8044
+ model
8045
+ };
8046
+ }
8047
+
8048
+ // src/shared/buildHarnessCodexArgs.ts
8049
+ function buildHarnessCodexArgs() {
8050
+ return buildLitellmCodexArgs(loadConfig().harness.codexModel);
8051
+ }
8052
+
8008
8053
  // src/shared/harnesses.ts
8009
8054
  import * as os from "os";
8010
8055
  import * as path16 from "path";
@@ -8065,13 +8110,19 @@ function isHarnessAvailable(kind) {
8065
8110
  // src/shared/spawnCodex.ts
8066
8111
  function spawnCodex(prompt, options2 = {}) {
8067
8112
  const cwd = options2.cwd ?? process.cwd();
8068
- return spawnInherit(harnesses.codex.command, [
8069
- "-C",
8070
- cwd,
8071
- "--sandbox",
8072
- options2.sandbox ?? "workspace-write",
8073
- prompt
8074
- ]);
8113
+ const override = buildHarnessCodexArgs();
8114
+ return spawnInherit(
8115
+ harnesses.codex.command,
8116
+ [
8117
+ ...override.args,
8118
+ "-C",
8119
+ cwd,
8120
+ "--sandbox",
8121
+ options2.sandbox ?? "workspace-write",
8122
+ prompt
8123
+ ],
8124
+ { env: override.env }
8125
+ );
8075
8126
  }
8076
8127
 
8077
8128
  // src/shared/spawnPi.ts
@@ -25138,21 +25189,6 @@ import chalk170 from "chalk";
25138
25189
 
25139
25190
  // src/commands/litellm/resolveLitellmConfig.ts
25140
25191
  import chalk169 from "chalk";
25141
-
25142
- // src/commands/litellm/readLitellmConfig.ts
25143
- function readLitellmConfig() {
25144
- const litellm = loadConfig().litellm;
25145
- const baseUrl = litellm?.baseUrl?.trim();
25146
- const apiKey = litellm?.apiKey?.trim();
25147
- const missing = [
25148
- ...baseUrl ? [] : ["litellm.baseUrl"],
25149
- ...apiKey ? [] : ["litellm.apiKey"]
25150
- ];
25151
- if (!baseUrl || !apiKey) return { config: null, missing };
25152
- return { config: { baseUrl: baseUrl.replace(/\/+$/, ""), apiKey }, missing };
25153
- }
25154
-
25155
- // src/commands/litellm/resolveLitellmConfig.ts
25156
25192
  function resolveLitellmConfig() {
25157
25193
  const { config, missing } = readLitellmConfig();
25158
25194
  if (!config) {
@@ -34436,33 +34472,6 @@ function resolveClaude(args) {
34436
34472
  });
34437
34473
  }
34438
34474
 
34439
- // src/commands/litellm/buildLitellmCodexArgs.ts
34440
- var API_KEY_ENV = "ASSIST_LITELLM_API_KEY";
34441
- function buildLitellmCodexArgs(rawModel) {
34442
- const model = rawModel?.trim();
34443
- if (!model) return { args: [], env: {} };
34444
- const { config } = readLitellmConfig();
34445
- if (!config) return { args: [], env: {} };
34446
- return {
34447
- args: [
34448
- "-c",
34449
- "model_providers.litellm.name=LiteLLM",
34450
- "-c",
34451
- `model_providers.litellm.base_url=${config.baseUrl}/v1`,
34452
- "-c",
34453
- `model_providers.litellm.env_key=${API_KEY_ENV}`,
34454
- "-c",
34455
- "model_providers.litellm.wire_api=responses",
34456
- "-c",
34457
- "model_provider=litellm",
34458
- "-m",
34459
- model
34460
- ],
34461
- env: { [API_KEY_ENV]: config.apiKey },
34462
- model
34463
- };
34464
- }
34465
-
34466
34475
  // src/commands/review/buildCodexModelArgs.ts
34467
34476
  function buildCodexModelArgs() {
34468
34477
  return buildLitellmCodexArgs(loadConfig().review?.codexModel);
@@ -39048,11 +39057,6 @@ function sessionBase(id, status3) {
39048
39057
  };
39049
39058
  }
39050
39059
 
39051
- // src/shared/buildHarnessCodexArgs.ts
39052
- function buildHarnessCodexArgs() {
39053
- return buildLitellmCodexArgs(loadConfig().harness.codexModel);
39054
- }
39055
-
39056
39060
  // src/commands/sessions/daemon/spawnPty.ts
39057
39061
  import { existsSync as existsSync89 } from "fs";
39058
39062
  import * as pty from "node-pty";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.690.0",
3
+ "version": "0.691.1",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {