@staff0rd/assist 0.634.3 → 0.636.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 +1 -0
- package/dist/commands/sessions/web/bundle.js +105 -105
- package/dist/index.js +67 -12
- package/package.json +1 -1
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.
|
|
9
|
+
version: "0.636.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -677,6 +677,9 @@ var assistConfigShape = {
|
|
|
677
677
|
draft: z3.boolean().default(false),
|
|
678
678
|
readingWordsPerMinute: z3.number().int().positive().optional()
|
|
679
679
|
}).optional(),
|
|
680
|
+
review: z3.strictObject({
|
|
681
|
+
codexModel: z3.string().optional()
|
|
682
|
+
}).optional(),
|
|
680
683
|
readTime: z3.strictObject({
|
|
681
684
|
wordsPerMinute: z3.number().int().positive().default(200)
|
|
682
685
|
}).optional(),
|
|
@@ -3180,6 +3183,15 @@ var refactorConfigHelp = [
|
|
|
3180
3183
|
}
|
|
3181
3184
|
];
|
|
3182
3185
|
|
|
3186
|
+
// src/commands/review/reviewConfigHelp.ts
|
|
3187
|
+
var reviewConfigHelp = [
|
|
3188
|
+
{
|
|
3189
|
+
key: "review.codexModel",
|
|
3190
|
+
setter: "assist config set review.codexModel gpt-5-codex",
|
|
3191
|
+
note: "optional; runs the codex reviewer on this model via the LiteLLM proxy (needs litellm.baseUrl and litellm.apiKey)"
|
|
3192
|
+
}
|
|
3193
|
+
];
|
|
3194
|
+
|
|
3183
3195
|
// src/commands/roam/roamConfigHelp.ts
|
|
3184
3196
|
var roamConfigHelp = [
|
|
3185
3197
|
{
|
|
@@ -3506,6 +3518,7 @@ var configHelpEntries = [
|
|
|
3506
3518
|
...ravendbConfigHelp,
|
|
3507
3519
|
...readTimeConfigHelp,
|
|
3508
3520
|
...refactorConfigHelp,
|
|
3521
|
+
...reviewConfigHelp,
|
|
3509
3522
|
...roamConfigHelp,
|
|
3510
3523
|
...runConfigHelp,
|
|
3511
3524
|
...seqConfigHelp,
|
|
@@ -24120,15 +24133,24 @@ import chalk172 from "chalk";
|
|
|
24120
24133
|
|
|
24121
24134
|
// src/commands/litellm/resolveLitellmConfig.ts
|
|
24122
24135
|
import chalk171 from "chalk";
|
|
24123
|
-
|
|
24136
|
+
|
|
24137
|
+
// src/commands/litellm/readLitellmConfig.ts
|
|
24138
|
+
function readLitellmConfig() {
|
|
24124
24139
|
const litellm = loadConfig().litellm;
|
|
24125
24140
|
const baseUrl = litellm?.baseUrl?.trim();
|
|
24126
24141
|
const apiKey = litellm?.apiKey?.trim();
|
|
24127
|
-
|
|
24128
|
-
|
|
24129
|
-
|
|
24130
|
-
|
|
24131
|
-
|
|
24142
|
+
const missing = [
|
|
24143
|
+
...baseUrl ? [] : ["litellm.baseUrl"],
|
|
24144
|
+
...apiKey ? [] : ["litellm.apiKey"]
|
|
24145
|
+
];
|
|
24146
|
+
if (!baseUrl || !apiKey) return { config: null, missing };
|
|
24147
|
+
return { config: { baseUrl: baseUrl.replace(/\/+$/, ""), apiKey }, missing };
|
|
24148
|
+
}
|
|
24149
|
+
|
|
24150
|
+
// src/commands/litellm/resolveLitellmConfig.ts
|
|
24151
|
+
function resolveLitellmConfig() {
|
|
24152
|
+
const { config, missing } = readLitellmConfig();
|
|
24153
|
+
if (!config) {
|
|
24132
24154
|
console.error(chalk171.red("LiteLLM is not configured"));
|
|
24133
24155
|
for (const key of missing) {
|
|
24134
24156
|
const entry = litellmConfigHelp.find((help) => help.key === key);
|
|
@@ -24138,7 +24160,7 @@ function resolveLitellmConfig() {
|
|
|
24138
24160
|
}
|
|
24139
24161
|
process.exit(1);
|
|
24140
24162
|
}
|
|
24141
|
-
return
|
|
24163
|
+
return config;
|
|
24142
24164
|
}
|
|
24143
24165
|
|
|
24144
24166
|
// src/commands/litellm/listModels.ts
|
|
@@ -30867,7 +30889,8 @@ function writeStdinSafely(child, payload) {
|
|
|
30867
30889
|
function startChild(spec) {
|
|
30868
30890
|
const child = spawn7(spec.command, spec.args, {
|
|
30869
30891
|
stdio: ["pipe", "pipe", "pipe"],
|
|
30870
|
-
shell: process.platform === "win32"
|
|
30892
|
+
shell: process.platform === "win32",
|
|
30893
|
+
...spec.env ? { env: { ...process.env, ...spec.env } } : {}
|
|
30871
30894
|
});
|
|
30872
30895
|
const flushPending = attachLineParser(child, spec.onLine);
|
|
30873
30896
|
const stderr = attachStderrCollector(child);
|
|
@@ -30940,6 +30963,30 @@ function resolveClaude(args) {
|
|
|
30940
30963
|
// src/commands/review/runCodexReviewer.ts
|
|
30941
30964
|
import { existsSync as existsSync62, unlinkSync as unlinkSync18 } from "fs";
|
|
30942
30965
|
|
|
30966
|
+
// src/commands/review/buildCodexModelArgs.ts
|
|
30967
|
+
var API_KEY_ENV = "ASSIST_LITELLM_API_KEY";
|
|
30968
|
+
function buildCodexModelArgs() {
|
|
30969
|
+
const model = loadConfig().review?.codexModel?.trim();
|
|
30970
|
+
if (!model) return { args: [], env: {} };
|
|
30971
|
+
const { config } = readLitellmConfig();
|
|
30972
|
+
if (!config) return { args: [], env: {} };
|
|
30973
|
+
return {
|
|
30974
|
+
args: [
|
|
30975
|
+
"-c",
|
|
30976
|
+
`model_providers.litellm.base_url=${config.baseUrl}/v1`,
|
|
30977
|
+
"-c",
|
|
30978
|
+
`model_providers.litellm.env_key=${API_KEY_ENV}`,
|
|
30979
|
+
"-c",
|
|
30980
|
+
"model_providers.litellm.wire_api=chat",
|
|
30981
|
+
"-c",
|
|
30982
|
+
"model_provider=litellm",
|
|
30983
|
+
"-m",
|
|
30984
|
+
model
|
|
30985
|
+
],
|
|
30986
|
+
env: { [API_KEY_ENV]: config.apiKey }
|
|
30987
|
+
};
|
|
30988
|
+
}
|
|
30989
|
+
|
|
30943
30990
|
// src/commands/review/parseCodexEvent.ts
|
|
30944
30991
|
function isItemStarted(value) {
|
|
30945
30992
|
return typeof value === "object" && value !== null && value.type === "item.started";
|
|
@@ -30965,9 +31012,10 @@ function parseCodexEvent(line) {
|
|
|
30965
31012
|
}
|
|
30966
31013
|
|
|
30967
31014
|
// src/commands/review/runCodexReviewer.ts
|
|
30968
|
-
function codexArgs(outputPath) {
|
|
31015
|
+
function codexArgs(outputPath, modelArgs) {
|
|
30969
31016
|
return [
|
|
30970
31017
|
"exec",
|
|
31018
|
+
...modelArgs,
|
|
30971
31019
|
"--sandbox",
|
|
30972
31020
|
"read-only",
|
|
30973
31021
|
"--json",
|
|
@@ -30978,12 +31026,14 @@ function codexArgs(outputPath) {
|
|
|
30978
31026
|
async function runCodexReviewer(spec) {
|
|
30979
31027
|
const { spinner } = spec;
|
|
30980
31028
|
const command = "codex";
|
|
31029
|
+
const override = buildCodexModelArgs();
|
|
30981
31030
|
const result = await runStreamingChild({
|
|
30982
31031
|
name: spec.name,
|
|
30983
31032
|
command,
|
|
30984
|
-
args: codexArgs(spec.outputPath),
|
|
31033
|
+
args: codexArgs(spec.outputPath, override.args),
|
|
30985
31034
|
stdin: spec.stdin,
|
|
30986
31035
|
quiet: Boolean(spinner),
|
|
31036
|
+
...override.args.length > 0 ? { env: override.env } : {},
|
|
30987
31037
|
onLine: (line) => {
|
|
30988
31038
|
const event = parseCodexEvent(line);
|
|
30989
31039
|
if (event.kind !== "tool_use") return;
|
|
@@ -31290,7 +31340,7 @@ async function review(options2 = {}) {
|
|
|
31290
31340
|
|
|
31291
31341
|
// src/commands/registerReview.ts
|
|
31292
31342
|
function registerReview(program2) {
|
|
31293
|
-
program2.command("review").description(
|
|
31343
|
+
const reviewCommand = program2.command("review").description(
|
|
31294
31344
|
"Run Claude and Codex in parallel to review the current branch's PR, or check out a PR by number first when given; --checkout-only just checks the PR out and leaves an idle Claude session in the checkout tree"
|
|
31295
31345
|
).argument(
|
|
31296
31346
|
"[number]",
|
|
@@ -31328,6 +31378,11 @@ function registerReview(program2) {
|
|
|
31328
31378
|
).action(
|
|
31329
31379
|
(number, options2) => review({ ...options2, number })
|
|
31330
31380
|
);
|
|
31381
|
+
configHelp(
|
|
31382
|
+
reviewCommand,
|
|
31383
|
+
reviewConfigHelp,
|
|
31384
|
+
"With review.codexModel unset the codex reviewer runs on the user's own codex auth; when it is set but the LiteLLM proxy is not configured, the reviewer falls back to that plain codex run."
|
|
31385
|
+
);
|
|
31331
31386
|
}
|
|
31332
31387
|
|
|
31333
31388
|
// src/commands/rules/addRule.ts
|