sproutkit-code 0.3.0 → 0.3.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 +50 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -30384,8 +30384,10 @@ var require_llm = __commonJS({
|
|
|
30384
30384
|
};
|
|
30385
30385
|
})();
|
|
30386
30386
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
30387
|
+
exports2.CLAUDE_CODE_MODELS = void 0;
|
|
30387
30388
|
exports2.getBackend = getBackend2;
|
|
30388
30389
|
exports2.claudeBin = claudeBin2;
|
|
30390
|
+
exports2.getClaudeCodeModel = getClaudeCodeModel2;
|
|
30389
30391
|
exports2.visionUnavailable = visionUnavailable;
|
|
30390
30392
|
exports2.generateText = generateText;
|
|
30391
30393
|
exports2.checkClaudeCodeAuth = checkClaudeCodeAuth2;
|
|
@@ -30409,6 +30411,16 @@ var require_llm = __commonJS({
|
|
|
30409
30411
|
function claudeBin2() {
|
|
30410
30412
|
return process.env.SPROUTKIT_CLAUDE_BIN || "claude";
|
|
30411
30413
|
}
|
|
30414
|
+
exports2.CLAUDE_CODE_MODELS = [
|
|
30415
|
+
{ alias: "opus", label: "Opus \u2014 most capable" },
|
|
30416
|
+
{ alias: "sonnet", label: "Sonnet \u2014 balanced (default)" },
|
|
30417
|
+
{ alias: "haiku", label: "Haiku \u2014 fastest / cheapest on your plan" },
|
|
30418
|
+
{ alias: "fable", label: "Fable \u2014 frontier (needs 30-day data retention)" }
|
|
30419
|
+
];
|
|
30420
|
+
function getClaudeCodeModel2() {
|
|
30421
|
+
const v = readSetting("claude_code_model");
|
|
30422
|
+
return v && exports2.CLAUDE_CODE_MODELS.some((m) => m.alias === v) ? v : null;
|
|
30423
|
+
}
|
|
30412
30424
|
function visionUnavailable(hasImages) {
|
|
30413
30425
|
return hasImages && getBackend2() === "claude_code";
|
|
30414
30426
|
}
|
|
@@ -30446,8 +30458,9 @@ var require_llm = __commonJS({
|
|
|
30446
30458
|
throw new Error("Image input isn't supported on the Claude subscription backend. This step needs an Anthropic API key.");
|
|
30447
30459
|
}
|
|
30448
30460
|
const cliArgs = ["-p", "--output-format", "json"];
|
|
30449
|
-
|
|
30450
|
-
|
|
30461
|
+
const alias = getClaudeCodeModel2();
|
|
30462
|
+
if (alias)
|
|
30463
|
+
cliArgs.push("--model", alias);
|
|
30451
30464
|
const bin = claudeBin2();
|
|
30452
30465
|
const timeoutMs = args.timeoutMs ?? 18e4;
|
|
30453
30466
|
return new Promise((resolve, reject) => {
|
|
@@ -82251,7 +82264,7 @@ var require_package = __commonJS({
|
|
|
82251
82264
|
"package.json"(exports2, module2) {
|
|
82252
82265
|
module2.exports = {
|
|
82253
82266
|
name: "sproutkit-code",
|
|
82254
|
-
version: "0.3.
|
|
82267
|
+
version: "0.3.1",
|
|
82255
82268
|
description: "Sproutkit in your terminal \u2014 find leads, build sites, run outreach, all via chat.",
|
|
82256
82269
|
bin: {
|
|
82257
82270
|
sproutkit: "./dist/index.js"
|
|
@@ -82313,6 +82326,8 @@ var getPreferredModel = models.getPreferredModel;
|
|
|
82313
82326
|
var checkClaudeCodeAuth = llm.checkClaudeCodeAuth;
|
|
82314
82327
|
var llmBackend = llm.getBackend;
|
|
82315
82328
|
var claudeBin = llm.claudeBin;
|
|
82329
|
+
var CLAUDE_CODE_MODELS = llm.CLAUDE_CODE_MODELS;
|
|
82330
|
+
var getClaudeCodeModel = llm.getClaudeCodeModel;
|
|
82316
82331
|
|
|
82317
82332
|
// src/config.ts
|
|
82318
82333
|
var REQUIRED_KEYS = [
|
|
@@ -82998,7 +83013,39 @@ async function notifyIfOutdated() {
|
|
|
82998
83013
|
}
|
|
82999
83014
|
|
|
83000
83015
|
// src/models-cmd.ts
|
|
83016
|
+
async function runModelsClaudeCode() {
|
|
83017
|
+
const current = getClaudeCodeModel();
|
|
83018
|
+
say();
|
|
83019
|
+
say(c.bold(" Model (Claude subscription):"));
|
|
83020
|
+
say(c.dim(" Uses your Claude Code login \u2014 pick which model builds run on."));
|
|
83021
|
+
CLAUDE_CODE_MODELS.forEach((m, i) => {
|
|
83022
|
+
const active = m.alias === current ? c.green(" \u2190 current") : "";
|
|
83023
|
+
const isDefault = !current && m.alias === "sonnet" ? c.dim(" (CLI default)") : "";
|
|
83024
|
+
say(` ${c.greenBold(String(i + 1).padStart(2))} ${m.label} ${c.dim(m.alias)}${active}${isDefault}`);
|
|
83025
|
+
});
|
|
83026
|
+
say();
|
|
83027
|
+
const pick = await ask(c.green(" Pick a number to switch (or Enter to keep current): "));
|
|
83028
|
+
if (!pick) {
|
|
83029
|
+
say(c.dim(" No change."));
|
|
83030
|
+
return;
|
|
83031
|
+
}
|
|
83032
|
+
const idx = Number(pick) - 1;
|
|
83033
|
+
if (Number.isNaN(idx) || idx < 0 || idx >= CLAUDE_CODE_MODELS.length) {
|
|
83034
|
+
say(c.amber(" Not a valid choice \u2014 no change made."));
|
|
83035
|
+
return;
|
|
83036
|
+
}
|
|
83037
|
+
const chosen = CLAUDE_CODE_MODELS[idx];
|
|
83038
|
+
setSetting("claude_code_model", chosen.alias);
|
|
83039
|
+
say(c.green(` \u2713 Builds will now use ${chosen.alias}.`));
|
|
83040
|
+
if (chosen.alias === "fable") {
|
|
83041
|
+
say(c.dim(" Note: Fable needs 30-day data retention on your Claude account, or it'll error."));
|
|
83042
|
+
}
|
|
83043
|
+
}
|
|
83001
83044
|
async function runModels() {
|
|
83045
|
+
if (getBackend() === "claude_code") {
|
|
83046
|
+
await runModelsClaudeCode();
|
|
83047
|
+
return;
|
|
83048
|
+
}
|
|
83002
83049
|
const apiKey = getSetting("anthropic_key");
|
|
83003
83050
|
if (!apiKey) {
|
|
83004
83051
|
say(c.red(" No Anthropic key set. Run 'sproutkit setup' first."));
|