@vibgrate/cli 2026.727.3 → 2026.727.4
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/baseline-ENCOSJYQ.js +8 -0
- package/dist/{baseline-ATM5MXBZ.js.map → baseline-ENCOSJYQ.js.map} +1 -1
- package/dist/chunk-3SDV6ADQ.js +78 -0
- package/dist/chunk-3SDV6ADQ.js.map +1 -0
- package/dist/{chunk-6JIKUDWM.js → chunk-6AXHLQBV.js} +219 -22
- package/dist/chunk-6AXHLQBV.js.map +1 -0
- package/dist/{chunk-C66GOHYB.js → chunk-FPEOIS7K.js} +58 -23
- package/dist/chunk-FPEOIS7K.js.map +1 -0
- package/dist/{chunk-OOIG3RUM.js → chunk-GYSOQH5C.js} +18 -79
- package/dist/chunk-GYSOQH5C.js.map +1 -0
- package/dist/{chunk-FFWGT55D.js → chunk-HYRAILGM.js} +3 -3
- package/dist/{chunk-FFWGT55D.js.map → chunk-HYRAILGM.js.map} +1 -1
- package/dist/{chunk-NDMDSPFX.js → chunk-KKRSQQ3A.js} +4 -3
- package/dist/chunk-KKRSQQ3A.js.map +1 -0
- package/dist/chunk-KUIBP3LU.js +101 -0
- package/dist/chunk-KUIBP3LU.js.map +1 -0
- package/dist/{chunk-OFUC6RYN.js → chunk-KXSKFQMI.js} +6 -99
- package/dist/chunk-KXSKFQMI.js.map +1 -0
- package/dist/{chunk-AVQSHIJ5.js → chunk-LJP2EPKM.js} +4 -4
- package/dist/{chunk-AVQSHIJ5.js.map → chunk-LJP2EPKM.js.map} +1 -1
- package/dist/{chunk-Z7GP7XTJ.js → chunk-MAUJTPQW.js} +5 -5
- package/dist/{chunk-Z7GP7XTJ.js.map → chunk-MAUJTPQW.js.map} +1 -1
- package/dist/{chunk-3V24O47U.js → chunk-PVZBYZZR.js} +19 -9
- package/dist/chunk-PVZBYZZR.js.map +1 -0
- package/dist/{chunk-2VFWXNS5.js → chunk-R6ZRVVZT.js} +3 -3
- package/dist/{chunk-2VFWXNS5.js.map → chunk-R6ZRVVZT.js.map} +1 -1
- package/dist/{chunk-Y23HMSWU.js → chunk-T3AYRS7J.js} +14 -7
- package/dist/chunk-T3AYRS7J.js.map +1 -0
- package/dist/chunk-YCJIIGLP.js +356 -0
- package/dist/chunk-YCJIIGLP.js.map +1 -0
- package/dist/{chunk-MAY5HLDH.js → chunk-YKVH2PGF.js} +68 -23
- package/dist/chunk-YKVH2PGF.js.map +1 -0
- package/dist/cli.js +68 -199
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -6
- package/dist/index.js.map +1 -1
- package/dist/{interactive-INGJNSON.js → interactive-SMHVURYK.js} +44 -14
- package/dist/interactive-SMHVURYK.js.map +1 -0
- package/dist/model-manager-PN7HEDXD.js +9 -0
- package/dist/{model-orchestrator-TVONAUPS.js.map → model-manager-PN7HEDXD.js.map} +1 -1
- package/dist/{model-orchestrator-TVONAUPS.js → model-orchestrator-4VSYP4J4.js} +3 -3
- package/dist/model-orchestrator-4VSYP4J4.js.map +1 -0
- package/dist/resolve-gguf-Y6FH3CNB.js +9 -0
- package/dist/{resolve-gguf-VPL4YQ6J.js.map → resolve-gguf-Y6FH3CNB.js.map} +1 -1
- package/dist/{session-M72522AP.js → session-W3646AOV.js} +5 -4
- package/dist/{session-M72522AP.js.map → session-W3646AOV.js.map} +1 -1
- package/dist/{stream-json-6ZBUA2L3.js → stream-json-X7UQFB4T.js} +7 -6
- package/dist/stream-json-X7UQFB4T.js.map +1 -0
- package/package.json +1 -1
- package/dist/baseline-ATM5MXBZ.js +0 -8
- package/dist/chunk-3V24O47U.js.map +0 -1
- package/dist/chunk-6JIKUDWM.js.map +0 -1
- package/dist/chunk-C66GOHYB.js.map +0 -1
- package/dist/chunk-MAY5HLDH.js.map +0 -1
- package/dist/chunk-NDMDSPFX.js.map +0 -1
- package/dist/chunk-OFUC6RYN.js.map +0 -1
- package/dist/chunk-OOIG3RUM.js.map +0 -1
- package/dist/chunk-Y23HMSWU.js.map +0 -1
- package/dist/interactive-INGJNSON.js.map +0 -1
- package/dist/resolve-gguf-VPL4YQ6J.js +0 -8
- package/dist/stream-json-6ZBUA2L3.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import {
|
|
2
|
+
import { sha256Hex, generateKeypair, dssePae, DSSE_PAYLOAD_TYPE, keyId, registerBuild, readGlobal, applyGlobalOptions, ProgressBar, printLogo, fetchCatalog, resolveProviders, runBuild } from './chunk-FPEOIS7K.js';
|
|
3
|
+
export { runBuild } from './chunk-FPEOIS7K.js';
|
|
4
|
+
import { CONTEXT_POLICY_VERSION, computeFcsReport, renderFcsReportMarkdown, createTrajectoryCollector, runAgent } from './chunk-MAUJTPQW.js';
|
|
5
|
+
import { loadAdvancedScanHook, baselineCommand } from './chunk-HYRAILGM.js';
|
|
6
|
+
import { runCodeSession } from './chunk-R6ZRVVZT.js';
|
|
7
|
+
import { summarizeDiffs, ScriptedProvider } from './chunk-KXSKFQMI.js';
|
|
6
8
|
import { disableColor, info, c, json, out } from './chunk-CT5BS56U.js';
|
|
7
9
|
import { VGD_PROTOCOL_VERSION, startVgdServer } from './chunk-77LYGXBI.js';
|
|
8
10
|
import './chunk-5I4VSBWQ.js';
|
|
9
11
|
import './chunk-IS7VTH2Q.js';
|
|
10
12
|
import { gatherSystemMemory } from './chunk-6UQMXIAG.js';
|
|
11
|
-
import { readOrchestratorState, writeOrchestratorState, parseMode, setDefaultMode, recommendMode, activePin, resolveMode, providerForBackend, QUALIFIED_PACKS, pinPack, unpinPack, buildOrchestratorStatus } from './chunk-
|
|
13
|
+
import { readOrchestratorState, writeOrchestratorState, parseMode, setDefaultMode, recommendMode, activePin, resolveMode, providerForBackend, QUALIFIED_PACKS, pinPack, unpinPack, buildOrchestratorStatus } from './chunk-PVZBYZZR.js';
|
|
12
14
|
import { fmt, estimateModelBytes } from './chunk-7N4Y3E47.js';
|
|
13
15
|
import './chunk-IZDH67DX.js';
|
|
14
16
|
import './chunk-HK3AWUXH.js';
|
|
@@ -16,18 +18,19 @@ import { vgdIsRunning, vgdRequest, vgdSocketPath } from './chunk-PMYWZRRS.js';
|
|
|
16
18
|
import { defaultProcessEndpoint, startProcessHostServer, resolveInferenceIsolation } from './chunk-PXHNTC6D.js';
|
|
17
19
|
import { clearHostSessionPool, acquireHostSession, generateOnSession, listHostSessions, hostSessionPoolSize } from './chunk-K7REHDQS.js';
|
|
18
20
|
import { buildIdentifierTrieFromGraph } from './chunk-JIBOJTGS.js';
|
|
19
|
-
import './chunk-
|
|
20
|
-
import {
|
|
21
|
-
import { ensurePackage, ensureUnavailableMessage
|
|
22
|
-
import { serveStdio, exportGraph, GraphSource, createServer, formatForExt } from './chunk-
|
|
23
|
-
import { resolveDsn, resolveIngestHost, dashHostForIngestHost, resolveCliInvocation, availableRegionIds, createWorkspaceDsn, writeStoredCredentials, credentialsPath, findGitRoot, ensureGitignored, gitignoreEntryForCredentials, clearStoredCredentials, CliError, ExitCode, parseDsn as parseDsn$1, uploadScanArtifact, ingestHostForRegionId, dsnCommand, pushCommand, NPX_INVOCATION, refreshIfStale, driftCount, countTokens, shortestPath, pathDisconnect, testsToRun, detectRunner, ASSISTANTS, detectAssistants, usageError, detectServeLaunch, installAssistant, writeNavigationConfig, uninstallAssistant, coveringTests, FREE_PACK, readScanArtifact, buildGraph, writeSnapshot, probeFreshness, discover, assistantById, SMALL_REPO_FILES, publishPrivateLibrary, assessDocQuality, symbolsFromApi, fetchHostedDocsCached, selectForBudget, hostedBase, readStoredCredentials, projectCredentialsPath, homeCredentialsPath, SKIP_DIRS, SKIP_FILES } from './chunk-
|
|
24
|
-
import { inventory, enrichOnline, ECOSYSTEMS, catalogPath, libDir, loadCatalog, driftFor, addLibrary, resolveLib, libId, resolveVersion, readDoc, localPackageDocs, localApiSurface } from './chunk-
|
|
25
|
-
import { writeDefaultConfig, parseDsn, detectVcs, computeRepoFingerprint, resolveRepositoryName, fetchScanPreflight, runCoreScan, VERSION, loadConfig, prepareCompressedUpload, computeDriftScore, titleBox, projectTypeToVulnEcosystem, driftBar, gitHistoryAvailable, buildVersionTimelines, findPackageAnyEcosystem, normalizeConstraint, findVersionCrossings, versionSatisfies, PROJECT_TYPE_TO_OSV_ECOSYSTEM, fetchRiskySymbols } from './chunk-
|
|
21
|
+
import './chunk-KKRSQQ3A.js';
|
|
22
|
+
import { buildModelInstallPlan } from './chunk-YCJIIGLP.js';
|
|
23
|
+
import { ensurePackage, ensureUnavailableMessage } from './chunk-KUIBP3LU.js';
|
|
24
|
+
import { serveStdio, exportGraph, GraphSource, createServer, formatForExt } from './chunk-LJP2EPKM.js';
|
|
25
|
+
import { resolveDsn, resolveIngestHost, dashHostForIngestHost, resolveCliInvocation, availableRegionIds, createWorkspaceDsn, writeStoredCredentials, credentialsPath, findGitRoot, ensureGitignored, gitignoreEntryForCredentials, clearStoredCredentials, CliError, ExitCode, parseDsn as parseDsn$1, uploadScanArtifact, ingestHostForRegionId, dsnCommand, pushCommand, NPX_INVOCATION, refreshIfStale, driftCount, countTokens, shortestPath, pathDisconnect, testsToRun, detectRunner, ASSISTANTS, detectAssistants, usageError, detectServeLaunch, installAssistant, writeNavigationConfig, uninstallAssistant, coveringTests, FREE_PACK, readScanArtifact, buildGraph, writeSnapshot, probeFreshness, discover, assistantById, SMALL_REPO_FILES, publishPrivateLibrary, assessDocQuality, symbolsFromApi, fetchHostedDocsCached, selectForBudget, hostedBase, readStoredCredentials, projectCredentialsPath, homeCredentialsPath, SKIP_DIRS, SKIP_FILES } from './chunk-YKVH2PGF.js';
|
|
26
|
+
import { inventory, enrichOnline, ECOSYSTEMS, catalogPath, libDir, loadCatalog, driftFor, addLibrary, resolveLib, libId, resolveVersion, readDoc, localPackageDocs, localApiSurface } from './chunk-6AXHLQBV.js';
|
|
27
|
+
import { writeDefaultConfig, parseDsn, detectVcs, computeRepoFingerprint, resolveRepositoryName, fetchScanPreflight, runCoreScan, VERSION, loadConfig, prepareCompressedUpload, computeDriftScore, titleBox, projectTypeToVulnEcosystem, driftBar, gitHistoryAvailable, buildVersionTimelines, findPackageAnyEcosystem, normalizeConstraint, findVersionCrossings, versionSatisfies, PROJECT_TYPE_TO_OSV_ECOSYSTEM, fetchRiskySymbols } from './chunk-T3AYRS7J.js';
|
|
28
|
+
import { recordCliCall, CLI_TOOL_ALIASES, savingsLedgerPath, clearSavings, readSavings, readUsage, readModelSavings, CAPSULE_RANKING_VERSION, SAVINGS_TOOLS, sanitizeClient } from './chunk-ZBTY6VV4.js';
|
|
26
29
|
import { ensureDir, pathExists, readJsonFile, writeTextFile, writeJsonFile } from './chunk-CRAMOEBE.js';
|
|
27
30
|
import { resolveOne } from './chunk-J7LKEB2R.js';
|
|
28
|
-
import { discoverModels, listCachedWeights, isWeightCached, lookupCatalog, ensureWeightCached, catalogIntegrityReport, weightStoreDir } from './chunk-OOIG3RUM.js';
|
|
29
|
-
import { recordCliCall, CLI_TOOL_ALIASES, savingsLedgerPath, clearSavings, readSavings, readUsage, readModelSavings, CAPSULE_RANKING_VERSION, SAVINGS_TOOLS, sanitizeClient } from './chunk-ZBTY6VV4.js';
|
|
30
31
|
import { embeddingsCached, resolveEmbedModel, loadEmbedder, getNodeEmbeddings, queryGraphSemantic, queryGraph, unavailableMessage, countPending, indexFor, impactOf, modelCacheInfo, clearModelCache } from './chunk-6UK6QPTR.js';
|
|
32
|
+
import { discoverModels } from './chunk-3SDV6ADQ.js';
|
|
33
|
+
import { listCachedWeights, ensureWeightCached, catalogIntegrityReport, weightStoreDir } from './chunk-GYSOQH5C.js';
|
|
31
34
|
import { resolvedGrammarFiles, grammarSetVersion } from './chunk-ON25BX6T.js';
|
|
32
35
|
import './chunk-RXP66R2E.js';
|
|
33
36
|
import { resolveGraphPath, renderReport, loadGraph, writeArtifacts, vibgrateDir, SCHEMA_VERSION } from './chunk-B3YUO3NW.js';
|
|
@@ -3540,166 +3543,6 @@ function toEstimateJson(e) {
|
|
|
3540
3543
|
guessed: e.guessed
|
|
3541
3544
|
};
|
|
3542
3545
|
}
|
|
3543
|
-
|
|
3544
|
-
// src/runtime/model-install-plan.ts
|
|
3545
|
-
var MODEL_INSTALL_PLAN_SCHEMA_VERSION = "model-install-plan/0";
|
|
3546
|
-
function runtimeDepsForBackend(backend) {
|
|
3547
|
-
const b = backend.toLowerCase();
|
|
3548
|
-
if (b === "llama.cpp" || b === "llama-cpp" || b === "vibgrate") {
|
|
3549
|
-
return [
|
|
3550
|
-
{
|
|
3551
|
-
id: "node-llama-cpp",
|
|
3552
|
-
kind: "npm-runtime",
|
|
3553
|
-
spec: "node-llama-cpp@^3",
|
|
3554
|
-
reason: "in-process llama.cpp binding for the first-party / llama-cpp provider"
|
|
3555
|
-
}
|
|
3556
|
-
];
|
|
3557
|
-
}
|
|
3558
|
-
if (b === "ollama") {
|
|
3559
|
-
return [
|
|
3560
|
-
{
|
|
3561
|
-
id: "ollama",
|
|
3562
|
-
kind: "native-binary",
|
|
3563
|
-
binary: "ollama",
|
|
3564
|
-
reason: "Ollama on PATH (install from https://ollama.com \u2014 third-party apps are not auto-installed)"
|
|
3565
|
-
}
|
|
3566
|
-
];
|
|
3567
|
-
}
|
|
3568
|
-
return [];
|
|
3569
|
-
}
|
|
3570
|
-
function weightsChannelForBackend(backend, opts) {
|
|
3571
|
-
const b = backend.toLowerCase();
|
|
3572
|
-
if (b === "ollama") return "ollama";
|
|
3573
|
-
if (b === "llama.cpp" || b === "llama-cpp" || b === "vibgrate") {
|
|
3574
|
-
if (opts?.downloadUrl || opts?.weightsRef && lookupCatalog(opts.weightsRef)) return "vibgrate";
|
|
3575
|
-
return "local-path";
|
|
3576
|
-
}
|
|
3577
|
-
if (b === "lm-studio" || b === "lmstudio" || b === "foundry-local") return "manual";
|
|
3578
|
-
return "manual";
|
|
3579
|
-
}
|
|
3580
|
-
function weightsInstalled(ref, installedNames) {
|
|
3581
|
-
const want = ref.toLowerCase();
|
|
3582
|
-
return installedNames.some((n) => {
|
|
3583
|
-
const have = n.toLowerCase();
|
|
3584
|
-
return have === want || have.includes(want) || want.includes(have);
|
|
3585
|
-
});
|
|
3586
|
-
}
|
|
3587
|
-
function buildModelInstallPlan(input) {
|
|
3588
|
-
const hasBinary2 = input.hasBinary ?? (() => false);
|
|
3589
|
-
const pkgInstalled = input.isPackageInstalled ?? isPackageInstalled;
|
|
3590
|
-
const installedNames = input.installedNames ?? [];
|
|
3591
|
-
const offline = !!input.offline;
|
|
3592
|
-
const backend = input.backend;
|
|
3593
|
-
const provider = providerLabel(backend);
|
|
3594
|
-
const runtimeDeps = runtimeDepsForBackend(backend).map((dep) => {
|
|
3595
|
-
if (dep.kind === "npm-runtime" && dep.spec) {
|
|
3596
|
-
return { ...dep, status: pkgInstalled(dep.spec) ? "satisfied" : "missing" };
|
|
3597
|
-
}
|
|
3598
|
-
if (dep.kind === "native-binary" && dep.binary) {
|
|
3599
|
-
return { ...dep, status: hasBinary2(dep.binary) ? "satisfied" : "unmanaged" };
|
|
3600
|
-
}
|
|
3601
|
-
return { ...dep, status: "unmanaged" };
|
|
3602
|
-
});
|
|
3603
|
-
const channel = weightsChannelForBackend(backend, {
|
|
3604
|
-
downloadUrl: input.downloadUrl,
|
|
3605
|
-
weightsRef: input.weightsRef
|
|
3606
|
-
});
|
|
3607
|
-
const weightCached = (input.isWeightCached ?? isWeightCached)(input.weightsRef);
|
|
3608
|
-
const catalog = lookupCatalog(input.weightsRef);
|
|
3609
|
-
const downloadUrl = input.downloadUrl ?? catalog?.url;
|
|
3610
|
-
let weightsStatus = "missing";
|
|
3611
|
-
if (channel === "ollama") {
|
|
3612
|
-
weightsStatus = weightsInstalled(input.weightsRef, installedNames) ? "satisfied" : "missing";
|
|
3613
|
-
} else if (channel === "vibgrate") {
|
|
3614
|
-
weightsStatus = weightCached || weightsInstalled(input.weightsRef, installedNames) || !!input.modelPath ? "satisfied" : "missing";
|
|
3615
|
-
} else if (channel === "local-path") {
|
|
3616
|
-
weightsStatus = weightsInstalled(input.weightsRef, installedNames) || !!input.modelPath || weightCached ? "satisfied" : "manual";
|
|
3617
|
-
} else {
|
|
3618
|
-
weightsStatus = weightsInstalled(input.weightsRef, installedNames) ? "satisfied" : "manual";
|
|
3619
|
-
}
|
|
3620
|
-
const alreadySatisfied = [];
|
|
3621
|
-
const willInstall = [];
|
|
3622
|
-
const willDownload = [];
|
|
3623
|
-
const blocked = [];
|
|
3624
|
-
for (const dep of runtimeDeps) {
|
|
3625
|
-
if (dep.status === "satisfied") {
|
|
3626
|
-
alreadySatisfied.push(dep.id);
|
|
3627
|
-
continue;
|
|
3628
|
-
}
|
|
3629
|
-
if (dep.kind === "npm-runtime" && dep.spec && dep.status === "missing") {
|
|
3630
|
-
if (offline) {
|
|
3631
|
-
blocked.push({ id: dep.id, reason: `${dep.spec} needed but --local/offline forbids install` });
|
|
3632
|
-
} else {
|
|
3633
|
-
willInstall.push(dep.spec);
|
|
3634
|
-
}
|
|
3635
|
-
continue;
|
|
3636
|
-
}
|
|
3637
|
-
if (dep.kind === "native-binary" && dep.status === "unmanaged") {
|
|
3638
|
-
blocked.push({
|
|
3639
|
-
id: dep.id,
|
|
3640
|
-
reason: dep.reason
|
|
3641
|
-
});
|
|
3642
|
-
}
|
|
3643
|
-
}
|
|
3644
|
-
if (weightsStatus === "satisfied") {
|
|
3645
|
-
alreadySatisfied.push(`weights:${input.weightsRef}`);
|
|
3646
|
-
} else if (weightsStatus === "missing" && (channel === "ollama" || channel === "vibgrate")) {
|
|
3647
|
-
if (offline) {
|
|
3648
|
-
blocked.push({ id: `weights:${input.weightsRef}`, reason: "weights missing and --local/offline forbids download" });
|
|
3649
|
-
} else if (channel === "ollama" && runtimeDeps.some((d) => d.id === "ollama" && d.status === "unmanaged")) {
|
|
3650
|
-
willDownload.push(input.weightsRef);
|
|
3651
|
-
} else if (channel === "vibgrate" && !downloadUrl) {
|
|
3652
|
-
blocked.push({
|
|
3653
|
-
id: `weights:${input.weightsRef}`,
|
|
3654
|
-
reason: `no first-party download URL for ${input.weightsRef} \u2014 place a gguf in the weight store or pass --model-path`
|
|
3655
|
-
});
|
|
3656
|
-
} else {
|
|
3657
|
-
willDownload.push(input.weightsRef);
|
|
3658
|
-
}
|
|
3659
|
-
} else if (weightsStatus === "manual" || weightsStatus === "missing") {
|
|
3660
|
-
blocked.push({
|
|
3661
|
-
id: `weights:${input.weightsRef}`,
|
|
3662
|
-
reason: channel === "local-path" ? `point --model-path at a local gguf for ${input.weightsRef}, or run install when a first-party URL is catalogued` : `install or link weights for ${input.weightsRef} via the backend app`
|
|
3663
|
-
});
|
|
3664
|
-
}
|
|
3665
|
-
const effectiveWillInstall = offline ? [] : willInstall;
|
|
3666
|
-
const effectiveWillDownload = offline ? [] : willDownload;
|
|
3667
|
-
const offlineBlocked = offline && blocked.some((b) => /offline|forbids/i.test(b.reason));
|
|
3668
|
-
const allRuntimeOk = runtimeDeps.every((d) => d.status === "satisfied");
|
|
3669
|
-
const fullyReady = allRuntimeOk && weightsStatus === "satisfied" && blocked.length === 0;
|
|
3670
|
-
return {
|
|
3671
|
-
schemaVersion: MODEL_INSTALL_PLAN_SCHEMA_VERSION,
|
|
3672
|
-
provider,
|
|
3673
|
-
backend,
|
|
3674
|
-
model: input.weightsRef,
|
|
3675
|
-
mode: input.mode,
|
|
3676
|
-
packId: input.packId,
|
|
3677
|
-
license: input.license,
|
|
3678
|
-
promise: input.promise,
|
|
3679
|
-
fit: input.fit,
|
|
3680
|
-
runtimeDeps,
|
|
3681
|
-
weights: {
|
|
3682
|
-
channel,
|
|
3683
|
-
ref: input.weightsRef,
|
|
3684
|
-
status: weightsStatus,
|
|
3685
|
-
downloadUrl: channel === "vibgrate" ? downloadUrl : void 0
|
|
3686
|
-
},
|
|
3687
|
-
alreadySatisfied,
|
|
3688
|
-
willInstall: effectiveWillInstall,
|
|
3689
|
-
willDownload: effectiveWillDownload,
|
|
3690
|
-
blocked,
|
|
3691
|
-
offlineBlocked,
|
|
3692
|
-
ready: fullyReady
|
|
3693
|
-
};
|
|
3694
|
-
}
|
|
3695
|
-
function providerLabel(backend) {
|
|
3696
|
-
const b = backend.toLowerCase();
|
|
3697
|
-
if (b === "llama.cpp" || b === "llama-cpp") return "llama-cpp";
|
|
3698
|
-
if (b === "vibgrate") return "vibgrate";
|
|
3699
|
-
if (b === "lm-studio" || b === "lmstudio") return "lmstudio";
|
|
3700
|
-
if (b === "foundry-local") return "foundry-local";
|
|
3701
|
-
return b === "ollama" ? "ollama" : backend;
|
|
3702
|
-
}
|
|
3703
3546
|
async function executeModelInstallPlan(plan, options = {}) {
|
|
3704
3547
|
const installedDeps = [];
|
|
3705
3548
|
const pulledWeights = [];
|
|
@@ -5853,9 +5696,11 @@ function registerCode(program) {
|
|
|
5853
5696
|
let provider = opts.provider ?? config.provider;
|
|
5854
5697
|
let model = opts.model ?? config.model;
|
|
5855
5698
|
const modeFlag = opts.mode ?? config.modelProfile?.mode;
|
|
5856
|
-
|
|
5699
|
+
let codeModeActive = false;
|
|
5700
|
+
const customSelection = !!(opts.provider || opts.model || opts.modelPath || config.provider || config.model);
|
|
5701
|
+
if (!customSelection && (modeFlag || !provider && !model)) {
|
|
5857
5702
|
try {
|
|
5858
|
-
const { parseMode: parseMode2, resolveMode: resolveMode2, readOrchestratorState: readOrchestratorState2, activePin: activePin2
|
|
5703
|
+
const { parseMode: parseMode2, resolveMode: resolveMode2, readOrchestratorState: readOrchestratorState2, activePin: activePin2 } = await import('./model-orchestrator-4VSYP4J4.js');
|
|
5859
5704
|
const { gatherSystemMemory: gatherSystemMemory2 } = await import('./local-runtime-5O2NN3GA.js');
|
|
5860
5705
|
const { loadGraph: loadGraph2 } = await import('./load-QPOWQD7C.js');
|
|
5861
5706
|
const state = readOrchestratorState2();
|
|
@@ -5886,26 +5731,31 @@ function registerCode(program) {
|
|
|
5886
5731
|
ExitCode.ERROR
|
|
5887
5732
|
);
|
|
5888
5733
|
}
|
|
5889
|
-
const { resolveGgufPath } = await import('./resolve-gguf-
|
|
5734
|
+
const { resolveGgufPath } = await import('./resolve-gguf-Y6FH3CNB.js');
|
|
5735
|
+
const primaryRef = resolved.pack.primary.backend === "llama.cpp" ? resolved.pack.primary.weightsRef : resolved.underlying.weightsRef;
|
|
5890
5736
|
const gguf = resolveGgufPath({
|
|
5891
|
-
modelRef:
|
|
5737
|
+
modelRef: primaryRef,
|
|
5892
5738
|
modelPath: opts.modelPath
|
|
5893
5739
|
}) ?? resolveGgufPath({
|
|
5894
|
-
modelRef: resolved.
|
|
5740
|
+
modelRef: resolved.underlying.weightsRef,
|
|
5741
|
+
modelPath: opts.modelPath
|
|
5895
5742
|
});
|
|
5896
|
-
if (gguf && !opts.
|
|
5743
|
+
if (!gguf && !opts.mock) {
|
|
5744
|
+
throw new CliError(
|
|
5745
|
+
`Code Mode ${resolved.mode} uses the Vibgrate model manager \u2014 weights not installed. Run \`vg models install ${resolved.mode}\` then retry. (Custom Ollama/LM Studio: pass --provider explicitly.)`,
|
|
5746
|
+
ExitCode.NOT_FOUND
|
|
5747
|
+
);
|
|
5748
|
+
}
|
|
5749
|
+
if (gguf) {
|
|
5750
|
+
codeModeActive = true;
|
|
5897
5751
|
provider = "llama-cpp";
|
|
5898
|
-
model = model ?? gguf.ref ??
|
|
5752
|
+
model = model ?? gguf.ref ?? primaryRef;
|
|
5899
5753
|
opts.modelPath = gguf.path;
|
|
5900
5754
|
if (!global.json && !global.quiet && !opts.streamJson) {
|
|
5901
5755
|
info(
|
|
5902
|
-
`${c.cyan("vg code")} \xB7 Code Mode ${c.bold(resolved.mode)} \u2192
|
|
5756
|
+
`${c.cyan("vg code")} \xB7 Code Mode ${c.bold(resolved.mode)} \u2192 Vibgrate manager ${c.dim(gguf.path)} ${c.dim(`(${resolved.fit.label})`)}`
|
|
5903
5757
|
);
|
|
5904
5758
|
}
|
|
5905
|
-
} else {
|
|
5906
|
-
const ollamaFb = resolved.underlying.backend === "ollama" ? resolved.underlying : resolved.pack.fallback?.find((f) => f.backend === "ollama") ?? resolved.underlying;
|
|
5907
|
-
provider = provider ?? providerForBackend2(ollamaFb.backend);
|
|
5908
|
-
model = model ?? ollamaFb.weightsRef;
|
|
5909
5759
|
}
|
|
5910
5760
|
if (!config.modelProfile?.capsuleBudgetTokens) {
|
|
5911
5761
|
config.modelProfile = {
|
|
@@ -5919,11 +5769,6 @@ function registerCode(program) {
|
|
|
5919
5769
|
} else if (!config.modelProfile?.mode) {
|
|
5920
5770
|
config.modelProfile = { ...config.modelProfile, mode: resolved.mode };
|
|
5921
5771
|
}
|
|
5922
|
-
if (!global.json && !global.quiet && !opts.streamJson && provider !== "llama-cpp") {
|
|
5923
|
-
info(
|
|
5924
|
-
`${c.cyan("vg code")} \xB7 Code Mode ${c.bold(resolved.mode)} \u2192 ${resolved.underlying.weightsRef} ${c.dim(`(${resolved.fit.label})`)}`
|
|
5925
|
-
);
|
|
5926
|
-
}
|
|
5927
5772
|
} catch (e) {
|
|
5928
5773
|
if (e instanceof CliError) throw e;
|
|
5929
5774
|
if (!provider && !model && !opts.mock) throw e;
|
|
@@ -5941,7 +5786,7 @@ function registerCode(program) {
|
|
|
5941
5786
|
if (!(process.stdin.isTTY && process.stdout.isTTY)) {
|
|
5942
5787
|
throw usageError('say what to change, e.g. `vg code "add a --timeout flag to the scan command"` (guided mode needs an interactive terminal)');
|
|
5943
5788
|
}
|
|
5944
|
-
const { runInteractive } = await import('./interactive-
|
|
5789
|
+
const { runInteractive } = await import('./interactive-SMHVURYK.js');
|
|
5945
5790
|
await runInteractive(
|
|
5946
5791
|
rootOf(global),
|
|
5947
5792
|
global,
|
|
@@ -5985,18 +5830,42 @@ function registerCode(program) {
|
|
|
5985
5830
|
model,
|
|
5986
5831
|
modelPath: opts.modelPath,
|
|
5987
5832
|
local: global.local,
|
|
5988
|
-
consent: opts.yes,
|
|
5989
|
-
mockReply
|
|
5833
|
+
consent: opts.yes || codeModeActive || customSelection,
|
|
5834
|
+
mockReply,
|
|
5835
|
+
codeMode: codeModeActive,
|
|
5836
|
+
preferEmbedded: codeModeActive || void 0
|
|
5990
5837
|
},
|
|
5991
5838
|
{}
|
|
5992
5839
|
);
|
|
5840
|
+
if (!opts.mock && route.providers[0]) {
|
|
5841
|
+
const { ensureManagerRuntime } = await import('./model-manager-PN7HEDXD.js');
|
|
5842
|
+
const ensure = await ensureManagerRuntime({
|
|
5843
|
+
providerId: route.providers[0].id,
|
|
5844
|
+
model: route.providers[0].model,
|
|
5845
|
+
offline: !!global.local,
|
|
5846
|
+
// Code Mode / explicit custom selection / --yes count as consent for
|
|
5847
|
+
// npm runtime deps (and ollama pull when the binary is already present).
|
|
5848
|
+
consent: !!(opts.yes || codeModeActive || customSelection || process.stdin.isTTY),
|
|
5849
|
+
onProgress: (line) => {
|
|
5850
|
+
if (!global.json && !global.quiet && !opts.streamJson) info(c.dim(` ${line}`));
|
|
5851
|
+
}
|
|
5852
|
+
});
|
|
5853
|
+
if (!ensure.ok) {
|
|
5854
|
+
throw new CliError(ensure.error ?? "model manager runtime not ready", ExitCode.ERROR);
|
|
5855
|
+
}
|
|
5856
|
+
if (!global.json && !global.quiet && !opts.streamJson && (ensure.installed.length || ensure.pulled.length)) {
|
|
5857
|
+
for (const s of ensure.installed) info(c.dim(` installed ${s}`));
|
|
5858
|
+
for (const s of ensure.pulled) info(c.dim(` pulled ${s}`));
|
|
5859
|
+
}
|
|
5860
|
+
}
|
|
5993
5861
|
if (!global.json && !global.quiet) {
|
|
5994
5862
|
info(`${c.cyan("vg code")} \xB7 ${c.dim(route.reason)}`);
|
|
5863
|
+
info(`${c.cyan("vg code")} \xB7 manager ${c.bold(route.managerLine)}`);
|
|
5995
5864
|
}
|
|
5996
5865
|
if (opts.streamJson && !opts.mock) {
|
|
5997
5866
|
const primarySlug = route.providers[0]?.model.includes("/") ? route.providers[0].model.split("/")[0] : route.providers[0]?.id;
|
|
5998
|
-
const { runCodeStreamJson } = await import('./stream-json-
|
|
5999
|
-
const { nodeCodeFs } = await import('./session-
|
|
5867
|
+
const { runCodeStreamJson } = await import('./stream-json-X7UQFB4T.js');
|
|
5868
|
+
const { nodeCodeFs } = await import('./session-W3646AOV.js');
|
|
6000
5869
|
const readline5 = await import('readline');
|
|
6001
5870
|
const child = await import('child_process');
|
|
6002
5871
|
const { loadOrDiscoverFederation } = await import('./federation-SZWZIFZ7.js');
|
|
@@ -6095,8 +5964,8 @@ ${res.stderr}` : ""), exitCode: res.status ?? 1 };
|
|
|
6095
5964
|
if (!autonomous && !tty) {
|
|
6096
5965
|
throw usageError("the agent approves each edit/command \u2014 run in a terminal to approve interactively, or pass --auto to run autonomously (or --single for a one-shot diff).");
|
|
6097
5966
|
}
|
|
6098
|
-
const { agentTask } = await import('./interactive-
|
|
6099
|
-
const { nodeCodeFs } = await import('./session-
|
|
5967
|
+
const { agentTask } = await import('./interactive-SMHVURYK.js');
|
|
5968
|
+
const { nodeCodeFs } = await import('./session-W3646AOV.js');
|
|
6100
5969
|
const { TtyPrompter } = await import('./ui-Q6DJ3GCU.js');
|
|
6101
5970
|
let priorSummary;
|
|
6102
5971
|
if (opts.continue) {
|
|
@@ -7301,7 +7170,7 @@ var initCommand = new Command("init").description("Initialize vibgrate in a proj
|
|
|
7301
7170
|
console.log(chalk7.green("\u2714") + ` Created ${chalk7.bold("vibgrate.config.ts")}`);
|
|
7302
7171
|
}
|
|
7303
7172
|
if (opts.baseline) {
|
|
7304
|
-
const { runBaseline } = await import('./baseline-
|
|
7173
|
+
const { runBaseline } = await import('./baseline-ENCOSJYQ.js');
|
|
7305
7174
|
await runBaseline(rootDir);
|
|
7306
7175
|
}
|
|
7307
7176
|
console.log("");
|