@bike4mind/cli 5.1.0 → 5.2.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/dist/{AgentHistoryStore-DrZ47hqO.mjs → AgentHistoryStore-dVWBO__c.mjs} +378 -17
- package/dist/{ApiClient-B8VxyNEM.mjs → ApiClient-ByJM2OpM.mjs} +3 -3
- package/dist/{BubblewrapRuntime-DotKnqtu.mjs → BubblewrapRuntime-BQICHr_L.mjs} +2 -2
- package/dist/ConfigStore-9rudXRh5.mjs +2 -0
- package/dist/{ConfigStore-DfuE49PH.mjs → ConfigStore-BnhyywYB.mjs} +1 -1
- package/dist/{Logger-D6QD3c7G.mjs → Logger-DqWiTWp3.mjs} +222 -90
- package/dist/{SandboxOrchestrator-Cm9L1TRR.mjs → SandboxOrchestrator-B-6_ssTd.mjs} +1 -1
- package/dist/{SandboxRuntimeAdapter-HEkl0-qG.mjs → SandboxRuntimeAdapter-CJhDJVwo.mjs} +2 -2
- package/dist/{SandboxRuntimeAdapter-DF9hg5Xl.mjs → SandboxRuntimeAdapter-DdF8pI-i.mjs} +1 -1
- package/dist/{SeatbeltRuntime-CYsIp616.mjs → SeatbeltRuntime-oPrQ1VGL.mjs} +2 -2
- package/dist/{WorkItemsClient-sUftLgOz.mjs → WorkItemsClient-BRvm9GFY.mjs} +1 -1
- package/dist/{buildToolSearch-Bb-DPCb0.mjs → buildToolSearch-BLpr9m1F.mjs} +2 -2
- package/dist/commands/acpCommand.mjs +5 -5
- package/dist/commands/apiCommand.mjs +1 -1
- package/dist/commands/doctorCommand.mjs +2 -2
- package/dist/commands/envCommand.mjs +1 -1
- package/dist/commands/headlessCommand.mjs +6 -6
- package/dist/commands/mcpCommand.mjs +3 -3
- package/dist/commands/mirrorCommand.mjs +2 -2
- package/dist/commands/modelsCommand.mjs +4 -4
- package/dist/commands/pluginCommand.mjs +1 -1
- package/dist/commands/skillsCommand.mjs +3 -3
- package/dist/commands/updateCommand.mjs +2 -2
- package/dist/{dist-De8Q0ivE.mjs → dist-DQHccCo7.mjs} +23 -295
- package/dist/{fit-BsHUrxwe.mjs → fit-hHSF95FV.mjs} +3 -3
- package/dist/index.mjs +9 -9
- package/dist/{modelServers-Ca1l2hMC.mjs → modelServers-BmmJuF8X.mjs} +1 -1
- package/dist/{package-hEkaJgsy.mjs → package-CZ2nssWx.mjs} +1 -1
- package/dist/{serve-CiSddein.mjs → serve-BDv7yCLB.mjs} +163 -7
- package/dist/{updateChecker-dZqiMftm.mjs → updateChecker-DoKgSiYX.mjs} +1 -1
- package/package.json +11 -11
- package/dist/ConfigStore-1lUx9qD8.mjs +0 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { A as FallbackLlmBackend, D as createResumeAgentTool, E as createCoordinateTaskTool, F as generateCliTools, N as PermissionManager, O as createBackgroundAgentTools, P as buildCliToolList, S as createWriteTodosTool, Y as SignedOutCloudBackend, Z as signInUncheckedHeadlessMessage, _ as createSseBackend, a as loadProjectContext, at as ReActAgent, b as createFindDefinitionTool, c as checkSavedSignIn, ct as wrapTools, d as attachLocalModels, dt as classifyCommandRisk, g as withSignedOutLocalDefault, gt as CheckpointStore, h as resolveSignedOutHeadlessModel, i as buildProjectAgentStore, k as createAgentDelegateTool, l as settleSignInRefresh, m as resolveHeadlessModel, n as BackgroundAgentManager, nt as buildSystemPrompt, o as McpManager, p as defaultLlmBackendDeps, pt as CustomCommandStore, q as SIGN_IN_EXPIRED_HEADLESS, r as SubagentOrchestrator, s as buildSandbox, t as AgentHistoryStore, ut as setWebSocketToolExecutor, v as createGetFileStructureTool, vt as SessionStore, w as createSkillTool, x as createTodoStore, y as createWorkItemTools } from "../AgentHistoryStore-
|
|
3
|
-
import { D as sanitizeTerminalText, c as ToolCatalog, f as toolCategory, l as commandTextOf, t as ConfigStore, v as requireApiUrl } from "../ConfigStore-
|
|
4
|
-
import {
|
|
5
|
-
import { t as logger } from "../Logger-
|
|
2
|
+
import { A as FallbackLlmBackend, D as createResumeAgentTool, E as createCoordinateTaskTool, F as generateCliTools, N as PermissionManager, O as createBackgroundAgentTools, P as buildCliToolList, S as createWriteTodosTool, Y as SignedOutCloudBackend, Z as signInUncheckedHeadlessMessage, _ as createSseBackend, a as loadProjectContext, at as ReActAgent, b as createFindDefinitionTool, c as checkSavedSignIn, ct as wrapTools, d as attachLocalModels, dt as classifyCommandRisk, g as withSignedOutLocalDefault, gt as CheckpointStore, h as resolveSignedOutHeadlessModel, i as buildProjectAgentStore, k as createAgentDelegateTool, l as settleSignInRefresh, m as resolveHeadlessModel, n as BackgroundAgentManager, nt as buildSystemPrompt, o as McpManager, p as defaultLlmBackendDeps, pt as CustomCommandStore, q as SIGN_IN_EXPIRED_HEADLESS, r as SubagentOrchestrator, s as buildSandbox, t as AgentHistoryStore, ut as setWebSocketToolExecutor, v as createGetFileStructureTool, vt as SessionStore, w as createSkillTool, x as createTodoStore, y as createWorkItemTools } from "../AgentHistoryStore-dVWBO__c.mjs";
|
|
3
|
+
import { D as sanitizeTerminalText, c as ToolCatalog, f as toolCategory, l as commandTextOf, t as ConfigStore, v as requireApiUrl } from "../ConfigStore-BnhyywYB.mjs";
|
|
4
|
+
import { c as OpenAICompatibleBackend, s as OllamaBackend } from "../dist-DQHccCo7.mjs";
|
|
5
|
+
import { t as logger } from "../Logger-DqWiTWp3.mjs";
|
|
6
6
|
import { t as RemoteSkillSource } from "../RemoteSkillSource-HqoLRV56.mjs";
|
|
7
|
-
import { r as reconstructTurnBlocks, t as WorkItemsClient } from "../WorkItemsClient-
|
|
8
|
-
import { t as ApiClient } from "../ApiClient-
|
|
7
|
+
import { r as reconstructTurnBlocks, t as WorkItemsClient } from "../WorkItemsClient-BRvm9GFY.mjs";
|
|
8
|
+
import { t as ApiClient } from "../ApiClient-ByJM2OpM.mjs";
|
|
9
9
|
import { randomBytes } from "crypto";
|
|
10
10
|
import { readFile } from "fs/promises";
|
|
11
11
|
//#region src/commands/headlessOllama.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { n as McpToggleRefusedError, t as ConfigStore } from "../ConfigStore-
|
|
3
|
-
import { t as version } from "../package-
|
|
2
|
+
import { n as McpToggleRefusedError, t as ConfigStore } from "../ConfigStore-BnhyywYB.mjs";
|
|
3
|
+
import { t as version } from "../package-CZ2nssWx.mjs";
|
|
4
4
|
//#region src/commands/mcpCommand.ts
|
|
5
5
|
/**
|
|
6
6
|
* External MCP commands (b4m mcp list, b4m mcp add, etc.)
|
|
@@ -70,7 +70,7 @@ async function handleMcpCommand(subcommand, argv) {
|
|
|
70
70
|
await handleDisable(argv.name, configStore);
|
|
71
71
|
break;
|
|
72
72
|
case "serve": {
|
|
73
|
-
const { handleMcpServeCommand } = await import("../serve-
|
|
73
|
+
const { handleMcpServeCommand } = await import("../serve-BDv7yCLB.mjs");
|
|
74
74
|
await handleMcpServeCommand({
|
|
75
75
|
http: Boolean(argv.http),
|
|
76
76
|
local: Boolean(argv.local),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as ConfigStore, v as requireApiUrl } from "../ConfigStore-
|
|
3
|
-
import { t as ApiClient } from "../ApiClient-
|
|
2
|
+
import { t as ConfigStore, v as requireApiUrl } from "../ConfigStore-BnhyywYB.mjs";
|
|
3
|
+
import { t as ApiClient } from "../ApiClient-ByJM2OpM.mjs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { z as z$1 } from "zod";
|
|
6
6
|
import { createHash } from "node:crypto";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as ConfigStore } from "../ConfigStore-
|
|
3
|
-
import "../Logger-
|
|
2
|
+
import { t as ConfigStore } from "../ConfigStore-BnhyywYB.mjs";
|
|
3
|
+
import "../Logger-DqWiTWp3.mjs";
|
|
4
4
|
import { S as vramNeedsLlamaServer, l as OLLAMA_SKIPS_INTEL_IGPU } from "../modelHub-BSB6qRFP.mjs";
|
|
5
5
|
import { $ as RuntimeHttpError, E as HuggingFaceHub, F as curatedRunner, G as ollamaLibraryLayers, H as isPermissiveEntry, I as curatedSource, M as curatedParamsLabel, N as curatedPicks, T as HUGGING_FACE_SSH_KEYS_URL, V as isHubRepoId, h as probeHardware, j as curatedListing, z as isAbliteratedModel } from "../dist-K7a9yOUb.mjs";
|
|
6
|
-
import { $ as gatedMessage, A as serverRuntimeId, C as discoverSshServers, Ct as withDefaultOllamaPort, D as probeServer, E as parseSshPort, J as abortable, K as REF_ISSUES, M as toolsOffHint, N as transportVerdict, O as probeToolSupport, P as usualPorts, Q as formatBytes, T as parseServerAddress, U as CancelledError, W as NOT_RECOMMENDED_LABEL, X as clean, Y as buildTag, Z as findInstalledModel, _t as resolveRuntimeTarget, a as needsCredential, at as licenseFor, b as answersWithoutCredentials, bt as shortDigest, c as requireManageable, ct as pickBuild, d as serverBaseUrl, dt as removeInstalled, et as hadTagBefore, f as serverFetch, ft as requireInstalledReviewed, g as withSignal, gt as requireUnchangedManifest, h as validateSecret, ht as requireUnchangedLicenses, i as loginHint, j as sshDestinationProblem, k as scopeOfIp, l as resolveServerTarget, lt as planPull, m as unusableStatus, mt as requireReviewedLayers, n as findModelServer, nt as hubAccessMessage, o as noSuchServer, ot as licenseName, p as serverRedactor, pt as requireRemovable, q as UNPULLABLE, r as loadModelServers, rt as installedUncheckedMessage, s as productLabel, st as listInstalled, t as defaultOn, tt as hiddenAbliteratedMessage, u as serverAddressLabel, ut as rankSearchHits, v as SSH_PORT_PROBLEM, vt as runtimeLabel, w as leastTrusted, x as createSshFetch, xt as readOllamaManifest, y as SSH_PROBE_TIMEOUT_MS, yt as sameModelName, z as localModelId } from "../modelServers-
|
|
7
|
-
import { a as machineLabel, i as fitForPlan, n as LLAMA_SERVER_VRAM_HELP, o as machineReader, r as fitForHubBuild, s as createCliCuratedList, t as FIT_LABELS } from "../fit-
|
|
6
|
+
import { $ as gatedMessage, A as serverRuntimeId, C as discoverSshServers, Ct as withDefaultOllamaPort, D as probeServer, E as parseSshPort, J as abortable, K as REF_ISSUES, M as toolsOffHint, N as transportVerdict, O as probeToolSupport, P as usualPorts, Q as formatBytes, T as parseServerAddress, U as CancelledError, W as NOT_RECOMMENDED_LABEL, X as clean, Y as buildTag, Z as findInstalledModel, _t as resolveRuntimeTarget, a as needsCredential, at as licenseFor, b as answersWithoutCredentials, bt as shortDigest, c as requireManageable, ct as pickBuild, d as serverBaseUrl, dt as removeInstalled, et as hadTagBefore, f as serverFetch, ft as requireInstalledReviewed, g as withSignal, gt as requireUnchangedManifest, h as validateSecret, ht as requireUnchangedLicenses, i as loginHint, j as sshDestinationProblem, k as scopeOfIp, l as resolveServerTarget, lt as planPull, m as unusableStatus, mt as requireReviewedLayers, n as findModelServer, nt as hubAccessMessage, o as noSuchServer, ot as licenseName, p as serverRedactor, pt as requireRemovable, q as UNPULLABLE, r as loadModelServers, rt as installedUncheckedMessage, s as productLabel, st as listInstalled, t as defaultOn, tt as hiddenAbliteratedMessage, u as serverAddressLabel, ut as rankSearchHits, v as SSH_PORT_PROBLEM, vt as runtimeLabel, w as leastTrusted, x as createSshFetch, xt as readOllamaManifest, y as SSH_PROBE_TIMEOUT_MS, yt as sameModelName, z as localModelId } from "../modelServers-BmmJuF8X.mjs";
|
|
7
|
+
import { a as machineLabel, i as fitForPlan, n as LLAMA_SERVER_VRAM_HELP, o as machineReader, r as fitForHubBuild, s as createCliCuratedList, t as FIT_LABELS } from "../fit-hHSF95FV.mjs";
|
|
8
8
|
import { createInterface } from "readline";
|
|
9
9
|
import { lookup } from "dns/promises";
|
|
10
10
|
import { Writable } from "stream";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { D as sanitizeTerminalText, t as ConfigStore } from "../ConfigStore-
|
|
2
|
+
import { D as sanitizeTerminalText, t as ConfigStore } from "../ConfigStore-BnhyywYB.mjs";
|
|
3
3
|
import { n as getDefaultPluginsDir, r as isFeatureEnabled, t as PluginStore } from "../PluginStore-DwvOJ-G3.mjs";
|
|
4
4
|
import { promises } from "fs";
|
|
5
5
|
import path from "path";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as ConfigStore, v as requireApiUrl } from "../ConfigStore-
|
|
3
|
-
import {
|
|
2
|
+
import { t as ConfigStore, v as requireApiUrl } from "../ConfigStore-BnhyywYB.mjs";
|
|
3
|
+
import { hn as splitSkillMdFrontmatter, mn as readSkillMdSourceUrl } from "../Logger-DqWiTWp3.mjs";
|
|
4
4
|
import { r as isReservedCommandName, t as RemoteSkillSource } from "../RemoteSkillSource-HqoLRV56.mjs";
|
|
5
|
-
import { t as ApiClient } from "../ApiClient-
|
|
5
|
+
import { t as ApiClient } from "../ApiClient-ByJM2OpM.mjs";
|
|
6
6
|
import { promises } from "fs";
|
|
7
7
|
import os from "os";
|
|
8
8
|
import path from "path";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as version } from "../package-
|
|
3
|
-
import { a as forceCheckForUpdate, c as isNpmPrefixWritable, d as shouldAttemptAutoUpdate, l as readCachedUpdate, n as REEXEC_GUARD_ENV, o as getAutoUpdatePreference, t as INSTALL_CMD, u as setAutoUpdatePreference } from "../updateChecker-
|
|
2
|
+
import { t as version } from "../package-CZ2nssWx.mjs";
|
|
3
|
+
import { a as forceCheckForUpdate, c as isNpmPrefixWritable, d as shouldAttemptAutoUpdate, l as readCachedUpdate, n as REEXEC_GUARD_ENV, o as getAutoUpdatePreference, t as INSTALL_CMD, u as setAutoUpdatePreference } from "../updateChecker-DoKgSiYX.mjs";
|
|
4
4
|
import { t as checkRipgrep } from "../ripgrepCheck-BmkyTK2i.mjs";
|
|
5
5
|
import { execSync, spawnSync } from "child_process";
|
|
6
6
|
import { createInterface } from "readline";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { C as CONTEXT_WINDOW_SAFETY_BUFFER_TOKENS, D as CompletionReasoningEffortSchema, E as ChatModels, Et as hasDeliverablePinnedArtifact, F as EMBEDDING_MODEL_CATALOG, Ft as isSupportedFabFileMimeType, G as ModelBackend, I as EMBEDDING_MODEL_IDS, It as isUserInitiatedAbort, J as OpenAIEmbeddingModel, Pt as isSupportedEmbeddingModel, St as getEmbeddingModelCapabilities, U as MODEL_INFO_FIELD_GROUP_OF, X as PermissionDeniedError, Xt as stripDeliveredArtifactBlocks, Zt as stripToolArtifactMarkup, _ as AudioMimeType, _n as WEBSITE_URL, _t as createThinkMarkerEscaper, b as BedrockEmbeddingModel, d as ARTIFACT_REMOVED_PLACEHOLDER, gn as APP_NAME, kt as isExpectedToolError, p as AiAccessRefusedError, q as OllamaEmbeddingModel, qt as servableEmbeddingDimensions, rn as visibleReplyText, st as SupportedFabFileMimeTypes, u as ARTIFACT_DELIVERED_PLACEHOLDER, ut as VoyageAIEmbeddingModel, vt as escapeThinkMarkers, wt as getQuestErrorCode, yt as filterToolArtifactMarkup } from "./Logger-DqWiTWp3.mjs";
|
|
3
3
|
import { b as ollamaNumCtx } from "./modelHub-BSB6qRFP.mjs";
|
|
4
4
|
import "crypto";
|
|
5
5
|
import path from "path";
|
|
@@ -654,6 +654,7 @@ new https.Agent({
|
|
|
654
654
|
lookup: ssrfSafeLookup,
|
|
655
655
|
keepAlive: false
|
|
656
656
|
});
|
|
657
|
+
new Map(EMBEDDING_MODEL_IDS.filter(isSupportedEmbeddingModel).map((model) => [model, getEmbeddingModelCapabilities(model).dimensions.native]));
|
|
657
658
|
SupportedFabFileMimeTypes.TXT_MARKDOWN, SupportedFabFileMimeTypes.TXT_MD_LEGACY, SupportedFabFileMimeTypes.TXT_PLAIN;
|
|
658
659
|
z$1.object({
|
|
659
660
|
text: z$1.string(),
|
|
@@ -710,17 +711,6 @@ embeddingModelInfoMap(Object.values(OllamaEmbeddingModel));
|
|
|
710
711
|
"[role=\"tooltip\"]",
|
|
711
712
|
"[role=\"radiogroup\"]"
|
|
712
713
|
].join(", ");
|
|
713
|
-
var BaseStorage = class {
|
|
714
|
-
/**
|
|
715
|
-
* Origin a browser fetches this storage's signed GET links from, or '' when signed links
|
|
716
|
-
* are not usable by a browser here. Storages that cannot presign for browsers keep the
|
|
717
|
-
* default.
|
|
718
|
-
*/
|
|
719
|
-
async browserSigningOrigin() {
|
|
720
|
-
return "";
|
|
721
|
-
}
|
|
722
|
-
};
|
|
723
|
-
new Map(EMBEDDING_MODEL_IDS.filter(isSupportedEmbeddingModel).map((model) => [model, getEmbeddingModelCapabilities(model).dimensions.native]));
|
|
724
714
|
ChatModels.KIMI_K3, ChatModels.KIMI_K3_1_PRO;
|
|
725
715
|
ChatModels.KIMI_K2_7_CODE, ChatModels.KIMI_K2_7_CODE_HIGHSPEED, ChatModels.KIMI_K2_6;
|
|
726
716
|
ChatModels.KIMI_K2_7_CODE, ChatModels.KIMI_K2_7_CODE_HIGHSPEED;
|
|
@@ -733,6 +723,16 @@ ChatModels.DEEPSEEK_FLASH, ChatModels.DEEPSEEK_V4_PRO;
|
|
|
733
723
|
ModelBackend.Anthropic, ModelBackend.Gemini, ModelBackend.XAI, ModelBackend.Ollama, ModelBackend.BFL, ModelBackend.LocalImage, ModelBackend.AWS;
|
|
734
724
|
CompletionReasoningEffortSchema.options;
|
|
735
725
|
//#endregion
|
|
726
|
+
//#region ../../b4m-core/llm-adapters/dist/modelDataProviders.mjs
|
|
727
|
+
const changeListeners = /* @__PURE__ */ new Set();
|
|
728
|
+
/** Returns an unsubscribe function. index.ts registers one to drop its caches. */
|
|
729
|
+
function onModelDataProviderChange(listener) {
|
|
730
|
+
changeListeners.add(listener);
|
|
731
|
+
return () => {
|
|
732
|
+
changeListeners.delete(listener);
|
|
733
|
+
};
|
|
734
|
+
}
|
|
735
|
+
//#endregion
|
|
736
736
|
//#region ../../b4m-core/llm-adapters/dist/index.mjs
|
|
737
737
|
function getAbortAwareRetrySignal({ retryMode, abortSignal, stream, tools, responseFormat, _internal }, singleAttemptSupported = false) {
|
|
738
738
|
if (retryMode !== "abort-aware" && retryMode !== "single-attempt") return void 0;
|
|
@@ -1330,11 +1330,13 @@ function splitCacheInclusiveInput(totalPromptTokens, cacheReadTokens) {
|
|
|
1330
1330
|
* `prior` plus one provider request's usage, split like splitCacheInclusiveInput. Takes the
|
|
1331
1331
|
* request's OWN prompt/cached/output counts, never the running totals: each entry is priced on its
|
|
1332
1332
|
* own long-context tier (getTurnsCost), so an accumulated value here would re-tier the whole chain.
|
|
1333
|
+
* `timing` is for a model priced by time of day (ModelInfo.offPeak).
|
|
1333
1334
|
*/
|
|
1334
|
-
function appendCacheInclusiveTurn(prior, turnPromptTokens, turnCacheReadTokens, turnOutputTokens) {
|
|
1335
|
+
function appendCacheInclusiveTurn(prior, turnPromptTokens, turnCacheReadTokens, turnOutputTokens, timing) {
|
|
1335
1336
|
return [...prior ?? [], {
|
|
1336
1337
|
...splitCacheInclusiveInput(turnPromptTokens, turnCacheReadTokens),
|
|
1337
|
-
outputTokens: turnOutputTokens
|
|
1338
|
+
outputTokens: turnOutputTokens,
|
|
1339
|
+
...timing
|
|
1338
1340
|
}];
|
|
1339
1341
|
}
|
|
1340
1342
|
/**
|
|
@@ -8656,290 +8658,16 @@ function textOf(message) {
|
|
|
8656
8658
|
return content.map((part) => typeof part === "string" ? part : part.text ?? "").join("");
|
|
8657
8659
|
}
|
|
8658
8660
|
Object.freeze({ provenance: "not_reported" });
|
|
8661
|
+
const _inFlightBuilds = /* @__PURE__ */ new Map();
|
|
8662
|
+
let _revisionEpoch = 0;
|
|
8663
|
+
onModelDataProviderChange((kind) => {
|
|
8664
|
+
if (kind === "revision") _revisionEpoch += 1;
|
|
8665
|
+
_inFlightBuilds.clear();
|
|
8666
|
+
});
|
|
8659
8667
|
ModelBackend.Ollama, ModelBackend.LocalImage;
|
|
8660
8668
|
//#endregion
|
|
8661
8669
|
//#region ../../b4m-core/utils/dist/index.mjs
|
|
8662
8670
|
/**
|
|
8663
|
-
* In-memory cache for admin settings with TTL support and active cleanup
|
|
8664
|
-
* Can be easily extended to use Redis for production
|
|
8665
|
-
*/
|
|
8666
|
-
var AdminSettingsCache = class AdminSettingsCache {
|
|
8667
|
-
cache = /* @__PURE__ */ new Map();
|
|
8668
|
-
individualCache = /* @__PURE__ */ new Map();
|
|
8669
|
-
/**
|
|
8670
|
-
* Every call through this field is optional-chained (`this.logger.debug?.()`).
|
|
8671
|
-
*
|
|
8672
|
-
* A cache must not throw because it could not log, and this one is exposed to that: it is a
|
|
8673
|
-
* process-wide singleton created with whichever logger happens to reach `getSettingsCache` first.
|
|
8674
|
-
* What each caller then does with a throw varies, and it is mostly NOT a degrade-to-defaults
|
|
8675
|
-
* guard: `getSettingsByNames` has none at all, the scoped resolver guards one layer out in
|
|
8676
|
-
* `resolveAll`, and `resolveSpendLevers` deliberately rethrows to halt spend. So a logger missing
|
|
8677
|
-
* a quieter level could surface as a silent wrong VALUE, as an unhandled rejection, or as a hard
|
|
8678
|
-
* fail-closed, depending on who asked. `ScopedSettingsCache` is built by the same factory pair
|
|
8679
|
-
* and still has one unguarded call - the same hazard, not a solved one.
|
|
8680
|
-
*/
|
|
8681
|
-
logger;
|
|
8682
|
-
cleanupInterval = null;
|
|
8683
|
-
maxCacheSize = 1e3;
|
|
8684
|
-
static DEFAULT_TTL = 3e5;
|
|
8685
|
-
static DEVELOPMENT_TTL = 3e4;
|
|
8686
|
-
static CLEANUP_INTERVAL = 6e4;
|
|
8687
|
-
constructor(logger) {
|
|
8688
|
-
this.logger = logger;
|
|
8689
|
-
this.startCleanupTimer();
|
|
8690
|
-
}
|
|
8691
|
-
/**
|
|
8692
|
-
* Start periodic cleanup timer (only in persistent environments)
|
|
8693
|
-
*/
|
|
8694
|
-
startCleanupTimer() {
|
|
8695
|
-
if (process.env.NODE_ENV !== "production" || process.env.VERCEL || process.env.AWS_LAMBDA_FUNCTION_NAME) {
|
|
8696
|
-
this.logger.debug?.("Skipping cleanup timer in serverless environment");
|
|
8697
|
-
return;
|
|
8698
|
-
}
|
|
8699
|
-
this.cleanupInterval = setInterval(() => {
|
|
8700
|
-
this.performCleanup();
|
|
8701
|
-
}, AdminSettingsCache.CLEANUP_INTERVAL);
|
|
8702
|
-
this.logger.debug?.("Started cache cleanup timer");
|
|
8703
|
-
}
|
|
8704
|
-
/**
|
|
8705
|
-
* Stop cleanup timer (for graceful shutdown)
|
|
8706
|
-
*/
|
|
8707
|
-
stopCleanupTimer() {
|
|
8708
|
-
if (this.cleanupInterval) {
|
|
8709
|
-
clearInterval(this.cleanupInterval);
|
|
8710
|
-
this.cleanupInterval = null;
|
|
8711
|
-
this.logger.debug?.("Stopped cache cleanup timer");
|
|
8712
|
-
}
|
|
8713
|
-
}
|
|
8714
|
-
/**
|
|
8715
|
-
* Active cleanup of expired entries
|
|
8716
|
-
*/
|
|
8717
|
-
performCleanup() {
|
|
8718
|
-
const beforeSize = this.cache.size + this.individualCache.size;
|
|
8719
|
-
let removedCount = 0;
|
|
8720
|
-
for (const [key, entry] of Array.from(this.cache.entries())) if (!this.isValid(entry.timestamp, entry.ttl)) {
|
|
8721
|
-
this.cache.delete(key);
|
|
8722
|
-
removedCount++;
|
|
8723
|
-
}
|
|
8724
|
-
for (const [key, entry] of Array.from(this.individualCache.entries())) if (!this.isValid(entry.timestamp, entry.ttl)) {
|
|
8725
|
-
this.individualCache.delete(key);
|
|
8726
|
-
removedCount++;
|
|
8727
|
-
}
|
|
8728
|
-
if (this.individualCache.size > this.maxCacheSize) {
|
|
8729
|
-
const entries = Array.from(this.individualCache.entries());
|
|
8730
|
-
entries.sort((a, b) => a[1].timestamp - b[1].timestamp);
|
|
8731
|
-
const toRemove = this.individualCache.size - this.maxCacheSize;
|
|
8732
|
-
for (let i = 0; i < toRemove; i++) {
|
|
8733
|
-
this.individualCache.delete(entries[i][0]);
|
|
8734
|
-
removedCount++;
|
|
8735
|
-
}
|
|
8736
|
-
this.logger.warn?.(`Emergency cache cleanup: removed ${toRemove} entries due to size limit`);
|
|
8737
|
-
}
|
|
8738
|
-
if (removedCount > 0) this.logger.debug?.(`Cache cleanup removed ${removedCount} expired entries (${beforeSize} → ${this.cache.size + this.individualCache.size})`);
|
|
8739
|
-
}
|
|
8740
|
-
/**
|
|
8741
|
-
* Get TTL based on environment
|
|
8742
|
-
*/
|
|
8743
|
-
getTTL() {
|
|
8744
|
-
return process.env.NODE_ENV === "development" ? AdminSettingsCache.DEVELOPMENT_TTL : AdminSettingsCache.DEFAULT_TTL;
|
|
8745
|
-
}
|
|
8746
|
-
/**
|
|
8747
|
-
* Check if cache entry is valid (not expired)
|
|
8748
|
-
*/
|
|
8749
|
-
isValid(timestamp, ttl) {
|
|
8750
|
-
return Date.now() - timestamp < ttl;
|
|
8751
|
-
}
|
|
8752
|
-
/**
|
|
8753
|
-
* Get all admin settings with caching
|
|
8754
|
-
*/
|
|
8755
|
-
async getSettingsMap(db) {
|
|
8756
|
-
const cacheKey = "all_settings";
|
|
8757
|
-
const cached = this.cache.get(cacheKey);
|
|
8758
|
-
if (cached && this.isValid(cached.timestamp, cached.ttl)) {
|
|
8759
|
-
this.logger.debug?.("📦 Admin settings cache HIT");
|
|
8760
|
-
return cached.data;
|
|
8761
|
-
}
|
|
8762
|
-
if (cached) this.cache.delete(cacheKey);
|
|
8763
|
-
this.logger.debug?.("🔍 Admin settings cache MISS - fetching from database");
|
|
8764
|
-
const fetchStart = Date.now();
|
|
8765
|
-
const settingsMap = (await db.adminSettings.findAll()).reduce((out, s) => {
|
|
8766
|
-
out[s.settingName] = s.settingValue;
|
|
8767
|
-
return out;
|
|
8768
|
-
}, {});
|
|
8769
|
-
const fetchTime = Date.now() - fetchStart;
|
|
8770
|
-
this.logger.info?.(`📦 Cached ${Object.keys(settingsMap).length} admin settings in ${fetchTime}ms`);
|
|
8771
|
-
const ttl = this.getTTL();
|
|
8772
|
-
this.cache.set(cacheKey, {
|
|
8773
|
-
data: settingsMap,
|
|
8774
|
-
timestamp: Date.now(),
|
|
8775
|
-
ttl
|
|
8776
|
-
});
|
|
8777
|
-
Object.entries(settingsMap).forEach(([key, value]) => {
|
|
8778
|
-
this.individualCache.set(key, {
|
|
8779
|
-
value,
|
|
8780
|
-
timestamp: Date.now(),
|
|
8781
|
-
ttl
|
|
8782
|
-
});
|
|
8783
|
-
});
|
|
8784
|
-
return settingsMap;
|
|
8785
|
-
}
|
|
8786
|
-
/**
|
|
8787
|
-
* Get individual admin setting with caching
|
|
8788
|
-
*/
|
|
8789
|
-
async getSettingByName(settingName, db) {
|
|
8790
|
-
const cached = this.individualCache.get(settingName);
|
|
8791
|
-
if (cached && this.isValid(cached.timestamp, cached.ttl)) {
|
|
8792
|
-
this.logger.debug?.(`📦 Individual setting '${settingName}' cache HIT`);
|
|
8793
|
-
return cached.value;
|
|
8794
|
-
}
|
|
8795
|
-
if (cached) this.individualCache.delete(settingName);
|
|
8796
|
-
this.logger.debug?.(`🔍 Individual setting '${settingName}' cache MISS - fetching from database`);
|
|
8797
|
-
const fetchStart = Date.now();
|
|
8798
|
-
const value = (await db.adminSettings.findBySettingName(settingName))?.settingValue ?? null;
|
|
8799
|
-
const fetchTime = Date.now() - fetchStart;
|
|
8800
|
-
this.logger.debug?.(`📦 Cached individual setting '${settingName}' in ${fetchTime}ms`);
|
|
8801
|
-
this.individualCache.set(settingName, {
|
|
8802
|
-
value,
|
|
8803
|
-
timestamp: Date.now(),
|
|
8804
|
-
ttl: this.getTTL()
|
|
8805
|
-
});
|
|
8806
|
-
return value;
|
|
8807
|
-
}
|
|
8808
|
-
/**
|
|
8809
|
-
* Get multiple admin settings with caching
|
|
8810
|
-
*/
|
|
8811
|
-
async getSettingsByNames(settingNames, db) {
|
|
8812
|
-
const result = {};
|
|
8813
|
-
const uncachedSettings = [];
|
|
8814
|
-
for (const settingName of settingNames) {
|
|
8815
|
-
const cached = this.individualCache.get(settingName);
|
|
8816
|
-
if (cached && this.isValid(cached.timestamp, cached.ttl)) {
|
|
8817
|
-
if (cached.value !== null) result[settingName] = cached.value;
|
|
8818
|
-
} else {
|
|
8819
|
-
if (cached) this.individualCache.delete(settingName);
|
|
8820
|
-
uncachedSettings.push(settingName);
|
|
8821
|
-
}
|
|
8822
|
-
}
|
|
8823
|
-
if (uncachedSettings.length > 0) {
|
|
8824
|
-
this.logger.debug?.(`🔍 Batch fetching ${uncachedSettings.length} uncached settings: ${uncachedSettings.join(", ")}`);
|
|
8825
|
-
const fetchStart = Date.now();
|
|
8826
|
-
const settings = await db.adminSettings.findBySettingNames(uncachedSettings);
|
|
8827
|
-
const fetchTime = Date.now() - fetchStart;
|
|
8828
|
-
this.logger.debug?.(`📦 Batch fetched ${settings.length} settings in ${fetchTime}ms`);
|
|
8829
|
-
const ttl = this.getTTL();
|
|
8830
|
-
settings.forEach((setting) => {
|
|
8831
|
-
result[setting.settingName] = setting.settingValue;
|
|
8832
|
-
this.individualCache.set(setting.settingName, {
|
|
8833
|
-
value: setting.settingValue,
|
|
8834
|
-
timestamp: Date.now(),
|
|
8835
|
-
ttl
|
|
8836
|
-
});
|
|
8837
|
-
});
|
|
8838
|
-
uncachedSettings.forEach((settingName) => {
|
|
8839
|
-
if (!settings.some((s) => s.settingName === settingName)) this.individualCache.set(settingName, {
|
|
8840
|
-
value: null,
|
|
8841
|
-
timestamp: Date.now(),
|
|
8842
|
-
ttl
|
|
8843
|
-
});
|
|
8844
|
-
});
|
|
8845
|
-
}
|
|
8846
|
-
this.logger.debug?.(`📦 Returned ${Object.keys(result).length} settings (${settingNames.length - uncachedSettings.length} from cache, ${uncachedSettings.length} from DB)`);
|
|
8847
|
-
return result;
|
|
8848
|
-
}
|
|
8849
|
-
/**
|
|
8850
|
-
* Invalidate specific setting(s) from cache
|
|
8851
|
-
*/
|
|
8852
|
-
invalidateSetting(settingName) {
|
|
8853
|
-
this.individualCache.delete(settingName);
|
|
8854
|
-
this.cache.delete("all_settings");
|
|
8855
|
-
this.logger.info?.(`🗑️ Invalidated cache for setting: ${settingName}`);
|
|
8856
|
-
}
|
|
8857
|
-
/**
|
|
8858
|
-
* Invalidate all cached admin settings
|
|
8859
|
-
*/
|
|
8860
|
-
invalidateAll() {
|
|
8861
|
-
this.cache.clear();
|
|
8862
|
-
this.individualCache.clear();
|
|
8863
|
-
this.logger.info?.("🗑️ Invalidated all admin settings cache");
|
|
8864
|
-
}
|
|
8865
|
-
/**
|
|
8866
|
-
* Get cache statistics for monitoring
|
|
8867
|
-
*/
|
|
8868
|
-
getStats() {
|
|
8869
|
-
const estimateMemoryUsage = () => {
|
|
8870
|
-
let totalSize = 0;
|
|
8871
|
-
for (const [key, value] of Array.from(this.individualCache.entries())) {
|
|
8872
|
-
totalSize += key.length * 2;
|
|
8873
|
-
totalSize += (value.value?.length || 0) * 2;
|
|
8874
|
-
totalSize += 32;
|
|
8875
|
-
}
|
|
8876
|
-
return totalSize;
|
|
8877
|
-
};
|
|
8878
|
-
return {
|
|
8879
|
-
totalEntries: this.cache.size,
|
|
8880
|
-
individualEntries: this.individualCache.size,
|
|
8881
|
-
memoryUsage: {
|
|
8882
|
-
approximate: `~${Math.round(estimateMemoryUsage() / 1024)}KB`,
|
|
8883
|
-
cacheSize: this.cache.size,
|
|
8884
|
-
individualCacheSize: this.individualCache.size
|
|
8885
|
-
},
|
|
8886
|
-
environment: {
|
|
8887
|
-
isServerless: !!(process.env.VERCEL || process.env.AWS_LAMBDA_FUNCTION_NAME),
|
|
8888
|
-
hasCleanupTimer: this.cleanupInterval !== null
|
|
8889
|
-
}
|
|
8890
|
-
};
|
|
8891
|
-
}
|
|
8892
|
-
/**
|
|
8893
|
-
* Warm up the cache by fetching all settings
|
|
8894
|
-
*/
|
|
8895
|
-
async warmUp(db) {
|
|
8896
|
-
this.logger.info?.("🔥 Warming up admin settings cache...");
|
|
8897
|
-
await this.getSettingsMap(db);
|
|
8898
|
-
this.logger.info?.("✅ Admin settings cache warmed up");
|
|
8899
|
-
}
|
|
8900
|
-
/**
|
|
8901
|
-
* Graceful shutdown - cleanup timers
|
|
8902
|
-
*/
|
|
8903
|
-
shutdown() {
|
|
8904
|
-
this.stopCleanupTimer();
|
|
8905
|
-
this.logger.info?.("🛑 Admin settings cache shutdown complete");
|
|
8906
|
-
}
|
|
8907
|
-
};
|
|
8908
|
-
let globalSettingsCache = null;
|
|
8909
|
-
/**
|
|
8910
|
-
* Get or create the global settings cache instance
|
|
8911
|
-
*/
|
|
8912
|
-
function getSettingsCache(logger) {
|
|
8913
|
-
if (!globalSettingsCache) globalSettingsCache = new AdminSettingsCache(logger || new Logger());
|
|
8914
|
-
return globalSettingsCache;
|
|
8915
|
-
}
|
|
8916
|
-
function getSettingsValue(key, settings, defaultValue) {
|
|
8917
|
-
if (key === "enforceCredits" && isEnforceCreditsLocked()) return true;
|
|
8918
|
-
const settingConfig = resolveSettingDefinition(key);
|
|
8919
|
-
if (!settingConfig) {
|
|
8920
|
-
Logger.globalInstance.warn(`Unknown setting key: ${key}`);
|
|
8921
|
-
return defaultValue;
|
|
8922
|
-
}
|
|
8923
|
-
const rawValue = settings[key];
|
|
8924
|
-
const parsed = (key === "adminAiConfig" ? AdminAiStoredConfigSchema : settingConfig.schema).safeParse(rawValue);
|
|
8925
|
-
if (parsed.success) {
|
|
8926
|
-
if (parsed.data === "" && defaultValue !== void 0) return defaultValue;
|
|
8927
|
-
return parsed.data;
|
|
8928
|
-
} else return defaultValue !== void 0 ? defaultValue : settingConfig.defaultValue;
|
|
8929
|
-
}
|
|
8930
|
-
/**
|
|
8931
|
-
* Retrieves all admin settings from the database and converts them into a key-value map.
|
|
8932
|
-
* Uses caching for improved performance.
|
|
8933
|
-
*/
|
|
8934
|
-
async function getSettingsMap(db, options) {
|
|
8935
|
-
const logger = options?.logger;
|
|
8936
|
-
if (options?.skipCache) return (options?.names ? await db.adminSettings.findBySettingNames(options.names) : await db.adminSettings.findAll()).reduce((out, s) => {
|
|
8937
|
-
out[s.settingName] = s.settingValue;
|
|
8938
|
-
return out;
|
|
8939
|
-
}, {});
|
|
8940
|
-
return getSettingsCache(logger).getSettingsMap(db);
|
|
8941
|
-
}
|
|
8942
|
-
/**
|
|
8943
8671
|
* Extracts the extension from a file name and returns it in lowercase without the leading dot.
|
|
8944
8672
|
*
|
|
8945
8673
|
* @param fileName
|
|
@@ -10288,4 +10016,4 @@ function toBase64(bytes) {
|
|
|
10288
10016
|
return btoa(binary);
|
|
10289
10017
|
}
|
|
10290
10018
|
//#endregion
|
|
10291
|
-
export { extractErrorMessage as a,
|
|
10019
|
+
export { extractErrorMessage as a, OpenAICompatibleBackend as c, redactLogText as d, redactLogValue as f, parseRetryAfterSeconds as i, isPrivateIP as l, B4mStreamEndedError as n, resolveSupportedMimeType as o, createClient as r, OllamaBackend as s, B4mApiError as t, Logger as u };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "./Logger-
|
|
2
|
+
import "./Logger-DqWiTWp3.mjs";
|
|
3
3
|
import { S as vramNeedsLlamaServer, b as ollamaNumCtx, v as estimateFitFromSize } from "./modelHub-BSB6qRFP.mjs";
|
|
4
|
-
import { t as version } from "./package-
|
|
4
|
+
import { t as version } from "./package-CZ2nssWx.mjs";
|
|
5
5
|
import { D as PRODUCTION_CURATED_KEYS, U as loadCuratedManifest, _ as resolveCuratedUrl, h as probeHardware, n as CuratedStore, t as CuratedListSource, u as curatedStoreRoot, w as BUNDLED_CURATED_JSON_TEXT } from "./dist-K7a9yOUb.mjs";
|
|
6
|
-
import { Q as formatBytes, it as largestProjectorBytes } from "./modelServers-
|
|
6
|
+
import { Q as formatBytes, it as largestProjectorBytes } from "./modelServers-BmmJuF8X.mjs";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import { homedir } from "node:os";
|
|
9
9
|
//#region src/models/curatedList.ts
|
package/dist/index.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { $ as signInUncheckedMessage, A as FallbackLlmBackend, B as DEFAULT_THOROUGHNESS, C as resetTodoStore, D as createResumeAgentTool, E as createCoordinateTaskTool, G as SIGN_IN_DURING_TURN, H as LOGGED_OUT_RESTART, I as ALWAYS_DENIED_FOR_AGENTS, J as SIGN_IN_HINT, K as SIGN_IN_EXPIRED, L as DEFAULT_AGENT_MODEL, M as substituteArguments, N as PermissionManager, O as createBackgroundAgentTools, P as buildCliToolList, Q as signInUncheckedLoginMessage, R as DEFAULT_MAX_ITERATIONS, S as createWriteTodosTool, St as COMPACTION_SUMMARY_MARKER, T as parseAgentConfig, U as NoLocalModelsError, V as LOCAL_SESSION_CONTINUES, W as SIGNED_OUT_BANNER, X as loginBlocked, _t as CommandHistoryStore, b as createFindDefinitionTool, bt as searchFiles, c as checkSavedSignIn, ct as wrapTools, et as signedOutCommandMessage, f as buildLlmBackend, ft as getPlanModeFilePath, gt as CheckpointStore, ht as hasFileReferences, j as isConnectionDrop, k as createAgentDelegateTool, l as settleSignInRefresh, lt as getProcessHooks, mt as processFileReferences, nt as buildSystemPrompt, pt as CustomCommandStore, rt as buildSkillsPromptSection, s as buildSandbox, st as findIterationBoundary, tt as signedOutNoMatchMessage, u as startupMode, ut as setWebSocketToolExecutor, v as createGetFileStructureTool, vt as SessionStore, w as createSkillTool, wt as MAX_PASTE_SIZE, x as createTodoStore, xt as warmFileCache, y as createWorkItemTools, yt as formatFileSize, z as DEFAULT_RETRY_CONFIG } from "./AgentHistoryStore-
|
|
3
|
-
import { D as sanitizeTerminalText, E as escapeTerminalControlChars, S as LOCAL_DEV_URL, T as parseApiUrl, _ as getEnvironmentName, c as ToolCatalog, g as getDefaultApiUrl, h as getCreditsUrl, m as ApiEndpointUnconfiguredError, o as extractCompactInstructions, t as ConfigStore, v as requireApiUrl, y as resolveApiEndpoint } from "./ConfigStore-
|
|
2
|
+
import { $ as signInUncheckedMessage, A as FallbackLlmBackend, B as DEFAULT_THOROUGHNESS, C as resetTodoStore, D as createResumeAgentTool, E as createCoordinateTaskTool, G as SIGN_IN_DURING_TURN, H as LOGGED_OUT_RESTART, I as ALWAYS_DENIED_FOR_AGENTS, J as SIGN_IN_HINT, K as SIGN_IN_EXPIRED, L as DEFAULT_AGENT_MODEL, M as substituteArguments, N as PermissionManager, O as createBackgroundAgentTools, P as buildCliToolList, Q as signInUncheckedLoginMessage, R as DEFAULT_MAX_ITERATIONS, S as createWriteTodosTool, St as COMPACTION_SUMMARY_MARKER, T as parseAgentConfig, U as NoLocalModelsError, V as LOCAL_SESSION_CONTINUES, W as SIGNED_OUT_BANNER, X as loginBlocked, _t as CommandHistoryStore, b as createFindDefinitionTool, bt as searchFiles, c as checkSavedSignIn, ct as wrapTools, et as signedOutCommandMessage, f as buildLlmBackend, ft as getPlanModeFilePath, gt as CheckpointStore, ht as hasFileReferences, j as isConnectionDrop, k as createAgentDelegateTool, l as settleSignInRefresh, lt as getProcessHooks, mt as processFileReferences, nt as buildSystemPrompt, pt as CustomCommandStore, rt as buildSkillsPromptSection, s as buildSandbox, st as findIterationBoundary, tt as signedOutNoMatchMessage, u as startupMode, ut as setWebSocketToolExecutor, v as createGetFileStructureTool, vt as SessionStore, w as createSkillTool, wt as MAX_PASTE_SIZE, x as createTodoStore, xt as warmFileCache, y as createWorkItemTools, yt as formatFileSize, z as DEFAULT_RETRY_CONFIG } from "./AgentHistoryStore-dVWBO__c.mjs";
|
|
3
|
+
import { D as sanitizeTerminalText, E as escapeTerminalControlChars, S as LOCAL_DEV_URL, T as parseApiUrl, _ as getEnvironmentName, c as ToolCatalog, g as getDefaultApiUrl, h as getCreditsUrl, m as ApiEndpointUnconfiguredError, o as extractCompactInstructions, t as ConfigStore, v as requireApiUrl, y as resolveApiEndpoint } from "./ConfigStore-BnhyywYB.mjs";
|
|
4
4
|
import { a as selectLiveSubagentTokens, i as selectLiveSubagentCredits, n as selectActiveBackgroundShells, o as useCliStore, r as selectCompletedBackgroundShells, t as selectActiveBackgroundAgents } from "./store-CmOg7JIt.mjs";
|
|
5
|
-
import { a as extractErrorMessage$1 } from "./dist-
|
|
6
|
-
import {
|
|
5
|
+
import { a as extractErrorMessage$1 } from "./dist-DQHccCo7.mjs";
|
|
6
|
+
import { $t as tokenEstimateMultiplier, Bt as planLeaves, Dt as isEarlyStop, E as ChatModels, Vt as planProgress, cn as actorColorIndex, dn as delegationPayloadSchema, fn as selfClaimedActorKindSchema, ln as actorKindMarker, n as SESSION_ID_PATTERN, on as ACTOR_COLOR_SLOTS, r as isValidSessionId, sn as DELEGATION_PAYLOAD_SCHEMA_NAME, t as logger, un as actorKindSchema, w as CREDIT_DEDUCT_TRANSACTION_TYPES } from "./Logger-DqWiTWp3.mjs";
|
|
7
7
|
import { a as rewireReservedNames, i as mergeCommands, n as COMMANDS, t as RemoteSkillSource } from "./RemoteSkillSource-HqoLRV56.mjs";
|
|
8
8
|
import { r as isFeatureEnabled, t as PluginStore } from "./PluginStore-DwvOJ-G3.mjs";
|
|
9
|
-
import { i as getTokenCounter, n as ConversationContext, r as reconstructTurnBlocks, t as WorkItemsClient } from "./WorkItemsClient-
|
|
9
|
+
import { i as getTokenCounter, n as ConversationContext, r as reconstructTurnBlocks, t as WorkItemsClient } from "./WorkItemsClient-BRvm9GFY.mjs";
|
|
10
10
|
import { t as getShellSessionManager } from "./ShellSessionManager-6o8KZzl1-vrbPAUTq.mjs";
|
|
11
|
-
import { r as OAuthClient, t as ApiClient } from "./ApiClient-
|
|
12
|
-
import { t as version } from "./package-
|
|
13
|
-
import { a as NotifyingLlmBackend, i as deferredToolRegistry, n as buildAgent, r as buildSupportingStores, t as buildToolSearch } from "./buildToolSearch-
|
|
14
|
-
import { s as getStartupUpdateStatus } from "./updateChecker-
|
|
11
|
+
import { r as OAuthClient, t as ApiClient } from "./ApiClient-ByJM2OpM.mjs";
|
|
12
|
+
import { t as version } from "./package-CZ2nssWx.mjs";
|
|
13
|
+
import { a as NotifyingLlmBackend, i as deferredToolRegistry, n as buildAgent, r as buildSupportingStores, t as buildToolSearch } from "./buildToolSearch-BLpr9m1F.mjs";
|
|
14
|
+
import { s as getStartupUpdateStatus } from "./updateChecker-DoKgSiYX.mjs";
|
|
15
15
|
import React, { createContext, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore } from "react";
|
|
16
16
|
import { Box, Static, Text, measureElement, render, useApp, useInput, usePaste, useStdin, useStdout } from "ink";
|
|
17
17
|
import { formatWithOptions, promisify } from "node:util";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { D as sanitizeTerminalText } from "./ConfigStore-
|
|
2
|
+
import { D as sanitizeTerminalText } from "./ConfigStore-BnhyywYB.mjs";
|
|
3
3
|
import { C as trackChild, H as isPermissiveEntry, K as ollamaModelKey, L as findHubBuild, O as curatedBuildForRef, Q as PullIdleTimeoutError, R as hubBuildTag, S as signalTree, T as HUGGING_FACE_SSH_KEYS_URL, V as isHubRepoId, Y as HubAccessError, Z as ModelNotFoundError, b as lmStudioModelsSchema, c as checkReviewedLayers, d as detectRuntimes, et as parseBaseUrl, f as licensesChanged, i as OllamaRuntime, k as curatedEntryForRef, l as checkRuntime, p as manifestChange, s as checkInstalledDigest, x as productFromOwner, y as OpenAICompatibleRuntime, z as isAbliteratedModel } from "./dist-K7a9yOUb.mjs";
|
|
4
4
|
import { createHash } from "crypto";
|
|
5
5
|
import path from "node:path";
|