@bike4mind/cli 5.0.0 → 5.0.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/{AgentHistoryStore-C3hJOgpM.mjs → AgentHistoryStore-DW6BBbVj.mjs} +442 -30
- package/dist/{ApiClient-CeuIcSY8.mjs → ApiClient-D4bDuWXg.mjs} +3 -3
- package/dist/{BubblewrapRuntime-BF5wXaNS.mjs → BubblewrapRuntime-D3EO5Y0C.mjs} +2 -2
- package/dist/{ConfigStore-nr0ebq4v.mjs → ConfigStore-BuLA_-uZ.mjs} +17 -1
- package/dist/ConfigStore-DdqxfmDr.mjs +2 -0
- package/dist/{Logger-CovZt7LL.mjs → Logger-CjaYx85U.mjs} +1055 -706
- package/dist/{SandboxOrchestrator-DTz_5Zub.mjs → SandboxOrchestrator-yORi2eFV.mjs} +1 -1
- package/dist/{SandboxRuntimeAdapter-X0HAkbpW.mjs → SandboxRuntimeAdapter-BjJwJNfg.mjs} +1 -1
- package/dist/{SandboxRuntimeAdapter-CC5KlbZ8.mjs → SandboxRuntimeAdapter-BmkaFzqU.mjs} +2 -2
- package/dist/{SeatbeltRuntime-zdxVqGZ3.mjs → SeatbeltRuntime-CyZNmFwD.mjs} +2 -2
- package/dist/{WorkItemsClient-lKJCPP0j.mjs → WorkItemsClient-xmo0DrCm.mjs} +1 -1
- package/dist/{buildToolSearch-BlOSK4m3.mjs → buildToolSearch-CXxEtVKc.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/{createFile-B8bur5Rb-CVzCarEA.mjs → createFile-CPKmd6Uf-Bk-3V2T3.mjs} +3 -3
- package/dist/{deleteFile-9B3gW_Nb-DG2sovIl.mjs → deleteFile-CD_xQ7Y6-C1X4Ievb.mjs} +17 -4
- package/dist/{dist-BrBjZ6Cv.mjs → dist-DsMzCRLX.mjs} +64 -32
- package/dist/{fit-vnmP4Dfc.mjs → fit-C9eLTDcR.mjs} +3 -3
- package/dist/{globFiles-CwJ8qmYo-BR5b2KvO.mjs → globFiles-CoapsO8G-CpvQo-R2.mjs} +9 -5
- package/dist/{grepSearch-CLtEqT4j-BnKPtNWr.mjs → grepSearch-DeH7M2e7-BIvo-yNy.mjs} +2 -2
- package/dist/index.mjs +9 -9
- package/dist/{modelServers-CjSlPFsg.mjs → modelServers-DeOGFwLi.mjs} +1 -1
- package/dist/{package-BTvxFRbB.mjs → package-CvffLo0I.mjs} +1 -1
- package/dist/{pathValidation-BRqf4HFX-CHwtwp3O.mjs → pathValidation-C4ADzpUR-BPIpINwZ.mjs} +36 -12
- package/dist/{serve-BLBhPkyw.mjs → serve-tmC__JNj.mjs} +6 -6
- package/dist/{updateChecker-uDIZuEZg.mjs → updateChecker-U4AfrPKj.mjs} +1 -1
- package/package.json +10 -10
- package/dist/ConfigStore--dPqdX3O.mjs +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { t as DEFAULT_SANDBOX_CONFIG } from "./types-CxrzVXel.mjs";
|
|
3
|
-
import { c as resolveSandboxPath } from "./SandboxRuntimeAdapter-
|
|
3
|
+
import { c as resolveSandboxPath } from "./SandboxRuntimeAdapter-BmkaFzqU.mjs";
|
|
4
4
|
import path from "path";
|
|
5
5
|
//#region src/sandbox/SandboxOrchestrator.ts
|
|
6
6
|
var SandboxOrchestrator = class {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
export { t as assertProxyPort, n as createSandboxRuntime, r as detectPlatform, i as expandPath, a as getContainerSocketPaths, o as getProtectedWorkspacePaths, s as isBinaryAvailable, c as resolveSandboxPath } from "./SandboxRuntimeAdapter-
|
|
2
|
+
export { t as assertProxyPort, n as createSandboxRuntime, r as detectPlatform, i as expandPath, a as getContainerSocketPaths, o as getProtectedWorkspacePaths, s as isBinaryAvailable, c as resolveSandboxPath } from "./SandboxRuntimeAdapter-BmkaFzqU.mjs";
|
|
@@ -178,11 +178,11 @@ async function createSandboxRuntime() {
|
|
|
178
178
|
const platform = detectPlatform();
|
|
179
179
|
if (!platform) return null;
|
|
180
180
|
if (platform === "darwin") {
|
|
181
|
-
const { SeatbeltRuntime } = await import("./SeatbeltRuntime-
|
|
181
|
+
const { SeatbeltRuntime } = await import("./SeatbeltRuntime-CyZNmFwD.mjs");
|
|
182
182
|
const runtime = new SeatbeltRuntime();
|
|
183
183
|
return runtime.isAvailable() ? runtime : null;
|
|
184
184
|
}
|
|
185
|
-
const { BubblewrapRuntime } = await import("./BubblewrapRuntime-
|
|
185
|
+
const { BubblewrapRuntime } = await import("./BubblewrapRuntime-D3EO5Y0C.mjs");
|
|
186
186
|
const runtime = new BubblewrapRuntime();
|
|
187
187
|
return runtime.isAvailable() ? runtime : null;
|
|
188
188
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as logger } from "./Logger-
|
|
3
|
-
import { a as getContainerSocketPaths, c as resolveSandboxPath, o as getProtectedWorkspacePaths, s as isBinaryAvailable, t as assertProxyPort } from "./SandboxRuntimeAdapter-
|
|
2
|
+
import { t as logger } from "./Logger-CjaYx85U.mjs";
|
|
3
|
+
import { a as getContainerSocketPaths, c as resolveSandboxPath, o as getProtectedWorkspacePaths, s as isBinaryAvailable, t as assertProxyPort } from "./SandboxRuntimeAdapter-BmkaFzqU.mjs";
|
|
4
4
|
import { mkdtempSync, writeFileSync } from "fs";
|
|
5
5
|
import os from "os";
|
|
6
6
|
import path from "path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { Zt as tokenEstimateMultiplier } from "./Logger-
|
|
2
|
+
import { Zt as tokenEstimateMultiplier } from "./Logger-CjaYx85U.mjs";
|
|
3
3
|
import { get_encoding } from "tiktoken";
|
|
4
4
|
//#region ../../b4m-core/utils/dist/calibratedTokenizer.mjs
|
|
5
5
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { F as generateCliTools, a as loadProjectContext, at as ReActAgent, ct as wrapTools, ft as getPlanModeFilePath, i as buildProjectAgentStore, it as DeferredToolRegistry, n as BackgroundAgentManager, nt as buildSystemPrompt, o as McpManager, ot as createToolSearchTool, r as SubagentOrchestrator, t as AgentHistoryStore } from "./AgentHistoryStore-
|
|
3
|
-
import { pt as completionsSupportsToolSearch, t as logger } from "./Logger-
|
|
2
|
+
import { F as generateCliTools, a as loadProjectContext, at as ReActAgent, ct as wrapTools, ft as getPlanModeFilePath, i as buildProjectAgentStore, it as DeferredToolRegistry, n as BackgroundAgentManager, nt as buildSystemPrompt, o as McpManager, ot as createToolSearchTool, r as SubagentOrchestrator, t as AgentHistoryStore } from "./AgentHistoryStore-DW6BBbVj.mjs";
|
|
3
|
+
import { pt as completionsSupportsToolSearch, t as logger } from "./Logger-CjaYx85U.mjs";
|
|
4
4
|
//#region src/llm/NotifyingLlmBackend.ts
|
|
5
5
|
/**
|
|
6
6
|
* LLM backend wrapper that injects background agent notifications
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { A as FallbackLlmBackend, D as createResumeAgentTool, E as createCoordinateTaskTool, N as PermissionManager, O as createBackgroundAgentTools, P as buildCliToolList, S as createWriteTodosTool, U as NoLocalModelsError, Z as signInUncheckedHeadlessMessage, b as createFindDefinitionTool, c as checkSavedSignIn, f as buildLlmBackend, gt as CheckpointStore, k as createAgentDelegateTool, l as settleSignInRefresh, pt as CustomCommandStore, q as SIGN_IN_EXPIRED_HEADLESS, s as buildSandbox, ut as setWebSocketToolExecutor, v as createGetFileStructureTool, vt as SessionStore, w as createSkillTool, x as createTodoStore } from "../AgentHistoryStore-
|
|
3
|
-
import { c as ToolCatalog, t as ConfigStore, v as requireApiUrl } from "../ConfigStore-
|
|
4
|
-
import { mt as createMutex, t as logger } from "../Logger-
|
|
2
|
+
import { A as FallbackLlmBackend, D as createResumeAgentTool, E as createCoordinateTaskTool, N as PermissionManager, O as createBackgroundAgentTools, P as buildCliToolList, S as createWriteTodosTool, U as NoLocalModelsError, Z as signInUncheckedHeadlessMessage, b as createFindDefinitionTool, c as checkSavedSignIn, f as buildLlmBackend, gt as CheckpointStore, k as createAgentDelegateTool, l as settleSignInRefresh, pt as CustomCommandStore, q as SIGN_IN_EXPIRED_HEADLESS, s as buildSandbox, ut as setWebSocketToolExecutor, v as createGetFileStructureTool, vt as SessionStore, w as createSkillTool, x as createTodoStore } from "../AgentHistoryStore-DW6BBbVj.mjs";
|
|
3
|
+
import { c as ToolCatalog, t as ConfigStore, v as requireApiUrl } from "../ConfigStore-BuLA_-uZ.mjs";
|
|
4
|
+
import { mt as createMutex, t as logger } from "../Logger-CjaYx85U.mjs";
|
|
5
5
|
import { t as RemoteSkillSource } from "../RemoteSkillSource-HqoLRV56.mjs";
|
|
6
|
-
import { t as ApiClient } from "../ApiClient-
|
|
7
|
-
import { a as NotifyingLlmBackend, i as deferredToolRegistry, n as buildAgent, r as buildSupportingStores, t as buildToolSearch } from "../buildToolSearch-
|
|
6
|
+
import { t as ApiClient } from "../ApiClient-D4bDuWXg.mjs";
|
|
7
|
+
import { a as NotifyingLlmBackend, i as deferredToolRegistry, n as buildAgent, r as buildSupportingStores, t as buildToolSearch } from "../buildToolSearch-CXxEtVKc.mjs";
|
|
8
8
|
import { randomUUID } from "crypto";
|
|
9
9
|
import { existsSync, realpathSync, statSync } from "fs";
|
|
10
10
|
import { isAbsolute } from "path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { T as parseApiUrl, t as ConfigStore, y as resolveApiEndpoint } from "../ConfigStore-
|
|
2
|
+
import { T as parseApiUrl, t as ConfigStore, y as resolveApiEndpoint } from "../ConfigStore-BuLA_-uZ.mjs";
|
|
3
3
|
//#region src/commands/apiCommand.ts
|
|
4
4
|
/**
|
|
5
5
|
* External API config command (--api-url / --reset-api)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as version } from "../package-
|
|
3
|
-
import { c as isNpmPrefixWritable, i as fetchLatestVersion, r as compareSemver } from "../updateChecker-
|
|
2
|
+
import { t as version } from "../package-CvffLo0I.mjs";
|
|
3
|
+
import { c as isNpmPrefixWritable, i as fetchLatestVersion, r as compareSemver } from "../updateChecker-U4AfrPKj.mjs";
|
|
4
4
|
import { t as checkRipgrep } from "../ripgrepCheck-BmkyTK2i.mjs";
|
|
5
5
|
import { existsSync } from "fs";
|
|
6
6
|
import { homedir } from "os";
|
|
@@ -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 { l as OllamaBackend, u as OpenAICompatibleBackend } from "../dist-
|
|
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-DW6BBbVj.mjs";
|
|
3
|
+
import { D as sanitizeTerminalText, c as ToolCatalog, f as toolCategory, l as commandTextOf, t as ConfigStore, v as requireApiUrl } from "../ConfigStore-BuLA_-uZ.mjs";
|
|
4
|
+
import { l as OllamaBackend, u as OpenAICompatibleBackend } from "../dist-DsMzCRLX.mjs";
|
|
5
|
+
import { t as logger } from "../Logger-CjaYx85U.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-xmo0DrCm.mjs";
|
|
8
|
+
import { t as ApiClient } from "../ApiClient-D4bDuWXg.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-BuLA_-uZ.mjs";
|
|
3
|
+
import { t as version } from "../package-CvffLo0I.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-tmC__JNj.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-BuLA_-uZ.mjs";
|
|
3
|
+
import { t as ApiClient } from "../ApiClient-D4bDuWXg.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-BuLA_-uZ.mjs";
|
|
3
|
+
import "../Logger-CjaYx85U.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-DeOGFwLi.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-C9eLTDcR.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-BuLA_-uZ.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 { fn as readSkillMdSourceUrl, pn as splitSkillMdFrontmatter } from "../Logger-
|
|
2
|
+
import { t as ConfigStore, v as requireApiUrl } from "../ConfigStore-BuLA_-uZ.mjs";
|
|
3
|
+
import { fn as readSkillMdSourceUrl, pn as splitSkillMdFrontmatter } from "../Logger-CjaYx85U.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-D4bDuWXg.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-CvffLo0I.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-U4AfrPKj.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,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { n as assertWritablePath } from "./pathValidation-C4ADzpUR-BPIpINwZ.mjs";
|
|
3
3
|
import { existsSync, promises } from "fs";
|
|
4
4
|
import path from "path";
|
|
5
|
-
//#region ../../b4m-core/services/dist/createFile-
|
|
5
|
+
//#region ../../b4m-core/services/dist/createFile-CPKmd6Uf.mjs
|
|
6
6
|
async function createFile(params, allowedDirectories) {
|
|
7
7
|
const { path: filePath, content, createDirectories = true } = params;
|
|
8
|
-
const resolvedPath =
|
|
8
|
+
const resolvedPath = assertWritablePath(filePath, allowedDirectories, "create");
|
|
9
9
|
const action = existsSync(resolvedPath) ? "overwritten" : "created";
|
|
10
10
|
if (createDirectories) {
|
|
11
11
|
const dir = path.dirname(resolvedPath);
|
|
@@ -1,17 +1,30 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import { existsSync, promises, statSync } from "fs";
|
|
2
|
+
import { i as isGitDirectoryName, n as assertWritablePath } from "./pathValidation-C4ADzpUR-BPIpINwZ.mjs";
|
|
3
|
+
import { existsSync, promises, readdirSync, statSync } from "fs";
|
|
4
4
|
import path from "path";
|
|
5
|
-
//#region ../../b4m-core/services/dist/deleteFile-
|
|
5
|
+
//#region ../../b4m-core/services/dist/deleteFile-CD_xQ7Y6.mjs
|
|
6
|
+
/** Whether a `.git` entry exists anywhere under `dir`, without following symlinks. */
|
|
7
|
+
function containsGitDirectory(dir) {
|
|
8
|
+
const pending = [dir];
|
|
9
|
+
while (pending.length > 0) {
|
|
10
|
+
const current = pending.pop();
|
|
11
|
+
for (const entry of readdirSync(current, { withFileTypes: true })) {
|
|
12
|
+
if (isGitDirectoryName(entry.name)) return true;
|
|
13
|
+
if (entry.isDirectory()) pending.push(path.join(current, entry.name));
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
6
18
|
async function deleteFile(params, allowedDirectories) {
|
|
7
19
|
const { path: filePath, recursive = false } = params;
|
|
8
|
-
const resolvedPath =
|
|
20
|
+
const resolvedPath = assertWritablePath(filePath, allowedDirectories, "delete");
|
|
9
21
|
if (!existsSync(resolvedPath)) throw new Error(`File or directory not found: ${filePath}`);
|
|
10
22
|
const stats = statSync(resolvedPath);
|
|
11
23
|
const isDirectory = stats.isDirectory();
|
|
12
24
|
const size = stats.size;
|
|
13
25
|
if (isDirectory && !recursive) throw new Error(`Path is a directory: ${filePath}. Use recursive=true to delete directories and their contents.`);
|
|
14
26
|
if (isDirectory) {
|
|
27
|
+
if (containsGitDirectory(resolvedPath)) throw new Error(`Access denied: Cannot delete ${filePath}: it contains a .git directory.`);
|
|
15
28
|
await promises.rm(resolvedPath, {
|
|
16
29
|
recursive: true,
|
|
17
30
|
force: true
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { Ct as getQuestErrorCode, Dt as isEnforceCreditsLocked, E as CompletionReasoningEffortSchema, F as EMBEDDING_MODEL_IDS, Gt as servableEmbeddingDimensions, H as MODEL_INFO_FIELD_GROUP_OF, Jt as stripDeliveredArtifactBlocks, K as OllamaEmbeddingModel, Mt as isSupportedEmbeddingModel, Nt as isSupportedFabFileMimeType, Ot as isExpectedToolError, P as EMBEDDING_MODEL_CATALOG, Pt as isUserInitiatedAbort, S as CONTEXT_WINDOW_SAFETY_BUFFER_TOKENS, T as ChatModels, Tt as hasDeliverablePinnedArtifact, Ut as resolveSettingDefinition, W as ModelBackend, Y as PermissionDeniedError, Yt as stripToolArtifactMarkup, _ as AudioMimeType, _t as escapeThinkMarkers, d as ARTIFACT_REMOVED_PLACEHOLDER, f as AdminAiStoredConfigSchema, gt as createThinkMarkerEscaper, hn as WEBSITE_URL, lt as VoyageAIEmbeddingModel, mn as APP_NAME, ot as SupportedFabFileMimeTypes, p as AiAccessRefusedError, q as OpenAIEmbeddingModel, tn as visibleReplyText, u as ARTIFACT_DELIVERED_PLACEHOLDER, vt as filterToolArtifactMarkup, xt as getEmbeddingModelCapabilities, y as BedrockEmbeddingModel } from "./Logger-
|
|
2
|
+
import { Ct as getQuestErrorCode, Dt as isEnforceCreditsLocked, E as CompletionReasoningEffortSchema, F as EMBEDDING_MODEL_IDS, Gt as servableEmbeddingDimensions, H as MODEL_INFO_FIELD_GROUP_OF, Jt as stripDeliveredArtifactBlocks, K as OllamaEmbeddingModel, Mt as isSupportedEmbeddingModel, Nt as isSupportedFabFileMimeType, Ot as isExpectedToolError, P as EMBEDDING_MODEL_CATALOG, Pt as isUserInitiatedAbort, S as CONTEXT_WINDOW_SAFETY_BUFFER_TOKENS, T as ChatModels, Tt as hasDeliverablePinnedArtifact, Ut as resolveSettingDefinition, W as ModelBackend, Y as PermissionDeniedError, Yt as stripToolArtifactMarkup, _ as AudioMimeType, _t as escapeThinkMarkers, d as ARTIFACT_REMOVED_PLACEHOLDER, f as AdminAiStoredConfigSchema, gt as createThinkMarkerEscaper, hn as WEBSITE_URL, lt as VoyageAIEmbeddingModel, mn as APP_NAME, ot as SupportedFabFileMimeTypes, p as AiAccessRefusedError, q as OpenAIEmbeddingModel, tn as visibleReplyText, u as ARTIFACT_DELIVERED_PLACEHOLDER, vt as filterToolArtifactMarkup, xt as getEmbeddingModelCapabilities, y as BedrockEmbeddingModel } from "./Logger-CjaYx85U.mjs";
|
|
3
3
|
import { b as ollamaNumCtx } from "./modelHub-BSB6qRFP.mjs";
|
|
4
4
|
import "crypto";
|
|
5
5
|
import path from "path";
|
|
@@ -733,8 +733,9 @@ ModelBackend.Anthropic, ModelBackend.Gemini, ModelBackend.XAI, ModelBackend.Olla
|
|
|
733
733
|
CompletionReasoningEffortSchema.options;
|
|
734
734
|
//#endregion
|
|
735
735
|
//#region ../../b4m-core/llm-adapters/dist/index.mjs
|
|
736
|
-
function getAbortAwareRetrySignal({ retryMode, abortSignal, stream, tools, responseFormat, _internal }) {
|
|
737
|
-
if (retryMode !== "abort-aware") return void 0;
|
|
736
|
+
function getAbortAwareRetrySignal({ retryMode, abortSignal, stream, tools, responseFormat, _internal }, singleAttemptSupported = false) {
|
|
737
|
+
if (retryMode !== "abort-aware" && retryMode !== "single-attempt") return void 0;
|
|
738
|
+
if (retryMode === "single-attempt" && !singleAttemptSupported) throw new Error("Single-attempt completion is unsupported by this adapter");
|
|
738
739
|
if (!abortSignal) throw new Error("Abort-aware completion retries require an abort signal");
|
|
739
740
|
abortSignal.throwIfAborted();
|
|
740
741
|
const hasTools = Array.isArray(tools) ? tools.length > 0 : tools !== void 0;
|
|
@@ -1531,6 +1532,52 @@ function appendIdentityReminderToMessages(messages, identityReminder) {
|
|
|
1531
1532
|
}, ...messages];
|
|
1532
1533
|
}
|
|
1533
1534
|
ChatModels.CLAUDE_4_5_SONNET, ChatModels.CLAUDE_4_1_OPUS, ChatModels.CLAUDE_4_5_HAIKU, ChatModels.CLAUDE_4_5_OPUS, ChatModels.CLAUDE_4_6_SONNET, ChatModels.CLAUDE_4_6_OPUS;
|
|
1535
|
+
/**
|
|
1536
|
+
* A reasoning model spent its whole output budget thinking and produced no answer
|
|
1537
|
+
* (finish_reason: length). The same budget fails the same way, so callers must not retry it.
|
|
1538
|
+
* The message keeps the "output budget was exhausted" phrase that log searches and tests match.
|
|
1539
|
+
*/
|
|
1540
|
+
var OutputBudgetExhaustedError = class extends Error {
|
|
1541
|
+
provider;
|
|
1542
|
+
model;
|
|
1543
|
+
constructor(provider, model) {
|
|
1544
|
+
super(`${provider} returned no content for ${model}: the output budget was exhausted before any answer was produced (finish_reason: length). Raise maxTokens or lower the reasoning effort.`);
|
|
1545
|
+
this.provider = provider;
|
|
1546
|
+
this.model = model;
|
|
1547
|
+
this.name = "OutputBudgetExhaustedError";
|
|
1548
|
+
}
|
|
1549
|
+
};
|
|
1550
|
+
/**
|
|
1551
|
+
* The stream closed with no finish reason and nothing usable. Transient, so worth one retry.
|
|
1552
|
+
* The message must not say "aborted", "overloaded" or "timeout": the fallback predicates match those.
|
|
1553
|
+
*/
|
|
1554
|
+
var StreamEndedWithoutFinishError = class extends Error {
|
|
1555
|
+
provider;
|
|
1556
|
+
model;
|
|
1557
|
+
constructor(provider, model) {
|
|
1558
|
+
super(`${provider} returned no content for ${model} (finish_reason: unknown).`);
|
|
1559
|
+
this.provider = provider;
|
|
1560
|
+
this.model = model;
|
|
1561
|
+
this.name = "StreamEndedWithoutFinishError";
|
|
1562
|
+
}
|
|
1563
|
+
};
|
|
1564
|
+
/**
|
|
1565
|
+
* The turn ended normally (terminal event received) after streaming only a reasoning block: no
|
|
1566
|
+
* displayed text and no tool call. Usually a one-off sampling outcome, so worth one same-model retry
|
|
1567
|
+
* and then the fallback chain. Distinct from a stall (an LlmTimeoutError or "stream timeout" message)
|
|
1568
|
+
* and from the deterministic empty turn left by the max-tool-calls cap, which must not be retried.
|
|
1569
|
+
* The message must not say "aborted", "overloaded" or "timeout": the fallback predicates match those.
|
|
1570
|
+
*/
|
|
1571
|
+
var HiddenReasoningOnlyEmptyError = class extends Error {
|
|
1572
|
+
provider;
|
|
1573
|
+
model;
|
|
1574
|
+
constructor(provider, model, message) {
|
|
1575
|
+
super(message);
|
|
1576
|
+
this.provider = provider;
|
|
1577
|
+
this.model = model;
|
|
1578
|
+
this.name = "HiddenReasoningOnlyEmptyError";
|
|
1579
|
+
}
|
|
1580
|
+
};
|
|
1534
1581
|
ChatModels.CLAUDE_4_5_SONNET_BEDROCK, ChatModels.CLAUDE_4_5_HAIKU_BEDROCK, ChatModels.CLAUDE_4_5_OPUS_BEDROCK, ChatModels.CLAUDE_4_6_SONNET_BEDROCK, ChatModels.CLAUDE_4_6_OPUS_BEDROCK;
|
|
1535
1582
|
/**
|
|
1536
1583
|
* Models served by ConverseBedrockBackend. Adding a Converse-compatible Bedrock model is a
|
|
@@ -1577,35 +1624,6 @@ function normalizeOllamaDoneReason(reason) {
|
|
|
1577
1624
|
default: return reason;
|
|
1578
1625
|
}
|
|
1579
1626
|
}
|
|
1580
|
-
/**
|
|
1581
|
-
* A reasoning model spent its whole output budget thinking and produced no answer
|
|
1582
|
-
* (finish_reason: length). The same budget fails the same way, so callers must not retry it.
|
|
1583
|
-
* The message keeps the "output budget was exhausted" phrase that log searches and tests match.
|
|
1584
|
-
*/
|
|
1585
|
-
var OutputBudgetExhaustedError = class extends Error {
|
|
1586
|
-
provider;
|
|
1587
|
-
model;
|
|
1588
|
-
constructor(provider, model) {
|
|
1589
|
-
super(`${provider} returned no content for ${model}: the output budget was exhausted before any answer was produced (finish_reason: length). Raise maxTokens or lower the reasoning effort.`);
|
|
1590
|
-
this.provider = provider;
|
|
1591
|
-
this.model = model;
|
|
1592
|
-
this.name = "OutputBudgetExhaustedError";
|
|
1593
|
-
}
|
|
1594
|
-
};
|
|
1595
|
-
/**
|
|
1596
|
-
* The stream closed with no finish reason and nothing usable. Transient, so worth one retry.
|
|
1597
|
-
* The message must not say "aborted", "overloaded" or "timeout": the fallback predicates match those.
|
|
1598
|
-
*/
|
|
1599
|
-
var StreamEndedWithoutFinishError = class extends Error {
|
|
1600
|
-
provider;
|
|
1601
|
-
model;
|
|
1602
|
-
constructor(provider, model) {
|
|
1603
|
-
super(`${provider} returned no content for ${model} (finish_reason: unknown).`);
|
|
1604
|
-
this.provider = provider;
|
|
1605
|
-
this.model = model;
|
|
1606
|
-
this.name = "StreamEndedWithoutFinishError";
|
|
1607
|
-
}
|
|
1608
|
-
};
|
|
1609
1627
|
/** Type guard: does this message already carry OpenAI-style `tool_calls`? */
|
|
1610
1628
|
function hasToolCalls(msg) {
|
|
1611
1629
|
return msg.role === "assistant" && "tool_calls" in msg;
|
|
@@ -8419,6 +8437,7 @@ var OpenAICompatibleBackend = class {
|
|
|
8419
8437
|
if (!sawProse && calls.length === 0) {
|
|
8420
8438
|
if (finishReason === "length") throw new OutputBudgetExhaustedError(this.options.label, name);
|
|
8421
8439
|
if (finishReason === void 0 && !options.abortSignal?.aborted) throw new StreamEndedWithoutFinishError(this.options.label, name);
|
|
8440
|
+
if (reasoning && finishReason !== void 0 && toolCallCount < maxToolCalls) throw new HiddenReasoningOnlyEmptyError(this.options.label, name, `${this.options.label} returned only reasoning for ${name}, with no displayed text and no tool call (finish_reason: ${finishReason}).`);
|
|
8422
8441
|
throw new Error(`${this.options.label} returned no content for ${name} (finish_reason: ${finishReason ?? "unknown"}).`);
|
|
8423
8442
|
}
|
|
8424
8443
|
if (calls.length === 0) return;
|
|
@@ -8633,6 +8652,7 @@ function textOf(message) {
|
|
|
8633
8652
|
if (!Array.isArray(content)) return "";
|
|
8634
8653
|
return content.map((part) => typeof part === "string" ? part : part.text ?? "").join("");
|
|
8635
8654
|
}
|
|
8655
|
+
Object.freeze({ provenance: "not_reported" });
|
|
8636
8656
|
ModelBackend.Ollama, ModelBackend.LocalImage;
|
|
8637
8657
|
//#endregion
|
|
8638
8658
|
//#region ../../b4m-core/utils/dist/index.mjs
|
|
@@ -9204,6 +9224,10 @@ const operations = {
|
|
|
9204
9224
|
method: "POST",
|
|
9205
9225
|
path: "/api/v1/briefs"
|
|
9206
9226
|
},
|
|
9227
|
+
composeFollowUpBrief: {
|
|
9228
|
+
method: "POST",
|
|
9229
|
+
path: "/api/v1/briefs/follow-ups"
|
|
9230
|
+
},
|
|
9207
9231
|
createAgent: {
|
|
9208
9232
|
method: "POST",
|
|
9209
9233
|
path: "/api/v1/agents"
|
|
@@ -9344,6 +9368,10 @@ const operations = {
|
|
|
9344
9368
|
method: "POST",
|
|
9345
9369
|
path: "/api/v1/pending-actions/{questId}/deny"
|
|
9346
9370
|
},
|
|
9371
|
+
editBriefDecision: {
|
|
9372
|
+
method: "PATCH",
|
|
9373
|
+
path: "/api/v1/briefs/{id}/decisions/{decisionId}"
|
|
9374
|
+
},
|
|
9347
9375
|
editImage: {
|
|
9348
9376
|
method: "POST",
|
|
9349
9377
|
path: "/api/v1/image-edits"
|
|
@@ -9788,6 +9816,10 @@ const operations = {
|
|
|
9788
9816
|
method: "POST",
|
|
9789
9817
|
path: "/api/v1/skills/market/versions/{vid}/rescan"
|
|
9790
9818
|
},
|
|
9819
|
+
resolveBriefDecision: {
|
|
9820
|
+
method: "POST",
|
|
9821
|
+
path: "/api/v1/briefs/{id}/decisions/{decisionId}/resolve"
|
|
9822
|
+
},
|
|
9791
9823
|
reviewSkillMarketVersion: {
|
|
9792
9824
|
method: "POST",
|
|
9793
9825
|
path: "/api/v1/skills/market/versions/{vid}/review"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "./Logger-
|
|
2
|
+
import "./Logger-CjaYx85U.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-CvffLo0I.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-DeOGFwLi.mjs";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import { homedir } from "node:os";
|
|
9
9
|
//#region src/models/curatedList.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { a as isPathAllowed, r as createPathChecker } from "./pathValidation-C4ADzpUR-BPIpINwZ.mjs";
|
|
3
3
|
import path from "path";
|
|
4
4
|
import { stat } from "fs/promises";
|
|
5
5
|
import { glob } from "glob";
|
|
6
|
-
//#region ../../b4m-core/services/dist/globFiles-
|
|
6
|
+
//#region ../../b4m-core/services/dist/globFiles-CoapsO8G.mjs
|
|
7
7
|
const DEFAULT_IGNORE_PATTERNS = [
|
|
8
8
|
"**/node_modules/**",
|
|
9
9
|
"**/.git/**",
|
|
@@ -25,7 +25,7 @@ async function findFiles(params, allowedDirectories) {
|
|
|
25
25
|
throw new Error(`Access denied: Cannot search outside allowed directories. ${dirsMsg}`);
|
|
26
26
|
}
|
|
27
27
|
if (path.isAbsolute(pattern) || pattern.split("/").includes("..")) throw new Error("Access denied: Cannot search outside allowed directories. The pattern must be relative to the search directory.");
|
|
28
|
-
const
|
|
28
|
+
const expanded = await glob(pattern, {
|
|
29
29
|
cwd: targetDir,
|
|
30
30
|
dot: false,
|
|
31
31
|
ignore: respect_git_ignore ? DEFAULT_IGNORE_PATTERNS : [],
|
|
@@ -34,7 +34,11 @@ async function findFiles(params, allowedDirectories) {
|
|
|
34
34
|
nocase: !case_sensitive,
|
|
35
35
|
maxDepth: 20
|
|
36
36
|
});
|
|
37
|
-
|
|
37
|
+
const checkPath = createPathChecker(allowedDirectories);
|
|
38
|
+
const matches = expanded.filter((match) => checkPath(match).allowed);
|
|
39
|
+
const skipped = expanded.length - matches.length;
|
|
40
|
+
const skippedNote = skipped > 0 ? `\n${skipped} match(es) outside the allowed directories were skipped.` : "";
|
|
41
|
+
if (matches.length === 0) return `No files found matching pattern: ${pattern}${dir_path ? ` in ${dir_path}` : ""}${skippedNote}`;
|
|
38
42
|
const filesWithStats = [];
|
|
39
43
|
for (const filePath of matches) try {
|
|
40
44
|
const stats = await stat(filePath);
|
|
@@ -49,7 +53,7 @@ async function findFiles(params, allowedDirectories) {
|
|
|
49
53
|
const MAX_RESULTS = 500;
|
|
50
54
|
const truncated = filesWithStats.length > MAX_RESULTS;
|
|
51
55
|
const results = truncated ? filesWithStats.slice(0, MAX_RESULTS) : filesWithStats;
|
|
52
|
-
return `${`Found ${filesWithStats.length} file(s)${truncated ? ` (showing first ${MAX_RESULTS})` : ""} matching: ${pattern}`}${dir_path ? `\nDirectory: ${dir_path}` : ""}\n\n${results.map((file) => path.relative(baseCwd, file.path)).join("\n")}`;
|
|
56
|
+
return `${`Found ${filesWithStats.length} file(s)${truncated ? ` (showing first ${MAX_RESULTS})` : ""} matching: ${pattern}`}${dir_path ? `\nDirectory: ${dir_path}` : ""}${skippedNote}\n\n${results.map((file) => path.relative(baseCwd, file.path)).join("\n")}`;
|
|
53
57
|
}
|
|
54
58
|
const globFilesTool = {
|
|
55
59
|
name: "glob_files",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { a as isPathAllowed } from "./pathValidation-C4ADzpUR-BPIpINwZ.mjs";
|
|
3
3
|
import { existsSync } from "fs";
|
|
4
4
|
import path from "path";
|
|
5
5
|
import { stat } from "fs/promises";
|
|
6
6
|
import { execFile } from "child_process";
|
|
7
7
|
import { promisify } from "util";
|
|
8
|
-
//#region ../../b4m-core/services/dist/grepSearch-
|
|
8
|
+
//#region ../../b4m-core/services/dist/grepSearch-DeH7M2e7.mjs
|
|
9
9
|
const execFileAsync = promisify(execFile);
|
|
10
10
|
/** Cached ripgrep binary path after first resolution */
|
|
11
11
|
let cachedRgPath = null;
|
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-DW6BBbVj.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-BuLA_-uZ.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 { C as CREDIT_DEDUCT_TRANSACTION_TYPES, Et as isEarlyStop, Rt as planLeaves, T as ChatModels, Zt as tokenEstimateMultiplier, an as DELEGATION_PAYLOAD_SCHEMA_NAME, cn as actorKindSchema, in as ACTOR_COLOR_SLOTS, ln as delegationPayloadSchema, n as SESSION_ID_PATTERN, on as actorColorIndex, r as isValidSessionId, sn as actorKindMarker, t as logger, un as selfClaimedActorKindSchema, zt as planProgress } from "./Logger-
|
|
5
|
+
import { a as extractErrorMessage$1 } from "./dist-DsMzCRLX.mjs";
|
|
6
|
+
import { C as CREDIT_DEDUCT_TRANSACTION_TYPES, Et as isEarlyStop, Rt as planLeaves, T as ChatModels, Zt as tokenEstimateMultiplier, an as DELEGATION_PAYLOAD_SCHEMA_NAME, cn as actorKindSchema, in as ACTOR_COLOR_SLOTS, ln as delegationPayloadSchema, n as SESSION_ID_PATTERN, on as actorColorIndex, r as isValidSessionId, sn as actorKindMarker, t as logger, un as selfClaimedActorKindSchema, zt as planProgress } from "./Logger-CjaYx85U.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-xmo0DrCm.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-D4bDuWXg.mjs";
|
|
12
|
+
import { t as version } from "./package-CvffLo0I.mjs";
|
|
13
|
+
import { a as NotifyingLlmBackend, i as deferredToolRegistry, n as buildAgent, r as buildSupportingStores, t as buildToolSearch } from "./buildToolSearch-CXxEtVKc.mjs";
|
|
14
|
+
import { s as getStartupUpdateStatus } from "./updateChecker-U4AfrPKj.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-BuLA_-uZ.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";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { readlinkSync, realpathSync } from "fs";
|
|
3
3
|
import path from "path";
|
|
4
|
-
//#region ../../b4m-core/services/dist/pathValidation-
|
|
4
|
+
//#region ../../b4m-core/services/dist/pathValidation-C4ADzpUR.mjs
|
|
5
5
|
/**
|
|
6
6
|
* Resolves a path to its canonical form, following symlinks.
|
|
7
7
|
* If the path doesn't exist (e.g., file being created), resolves the
|
|
@@ -31,18 +31,27 @@ function resolveRealPath(filePath) {
|
|
|
31
31
|
* @returns Object with validation result, resolved path, and matched directory if allowed
|
|
32
32
|
*/
|
|
33
33
|
function isPathAllowed(filePath, allowedDirectories) {
|
|
34
|
+
return createPathChecker(allowedDirectories)(filePath);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* {@link isPathAllowed} with the working directory and allowed directories resolved once, for
|
|
38
|
+
* checking many paths against the same roots.
|
|
39
|
+
*/
|
|
40
|
+
function createPathChecker(allowedDirectories) {
|
|
34
41
|
const cwd = resolveRealPath(process.cwd());
|
|
35
42
|
const allAllowed = [cwd, ...(allowedDirectories || []).map((d) => resolveRealPath(d))];
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
return (filePath) => {
|
|
44
|
+
const normalizedPath = path.normalize(filePath);
|
|
45
|
+
const resolvedPath = resolveRealPath(path.isAbsolute(normalizedPath) ? normalizedPath : path.resolve(cwd, normalizedPath));
|
|
46
|
+
for (const dir of allAllowed) if (resolvedPath === dir || resolvedPath.startsWith(dir + path.sep)) return {
|
|
47
|
+
allowed: true,
|
|
48
|
+
resolvedPath,
|
|
49
|
+
matchedDirectory: dir
|
|
50
|
+
};
|
|
51
|
+
return {
|
|
52
|
+
allowed: false,
|
|
53
|
+
resolvedPath
|
|
54
|
+
};
|
|
46
55
|
};
|
|
47
56
|
}
|
|
48
57
|
/**
|
|
@@ -63,5 +72,20 @@ function assertPathAllowed(filePath, allowedDirectories, operation = "access") {
|
|
|
63
72
|
}
|
|
64
73
|
return result.resolvedPath;
|
|
65
74
|
}
|
|
75
|
+
/** Whether a file name is `.git`, compared the way case-insensitive filesystems and Windows do. */
|
|
76
|
+
function isGitDirectoryName(name) {
|
|
77
|
+
return name.replace(/[. ]+$/, "").toLowerCase() === ".git";
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* {@link assertPathAllowed} for a tool that creates, edits or deletes files: also refuses any path
|
|
81
|
+
* with a `.git` segment below the allowed directory it falls in. Only literal `.git` segments are
|
|
82
|
+
* covered, not a hooks directory configured elsewhere through `core.hooksPath`.
|
|
83
|
+
*/
|
|
84
|
+
function assertWritablePath(filePath, allowedDirectories, operation = "write") {
|
|
85
|
+
const resolvedPath = assertPathAllowed(filePath, allowedDirectories, operation);
|
|
86
|
+
const { matchedDirectory } = isPathAllowed(resolvedPath, allowedDirectories);
|
|
87
|
+
if ((matchedDirectory ? path.relative(matchedDirectory, resolvedPath) : resolvedPath).split(/[\\/]/).some(isGitDirectoryName)) throw new Error(`Access denied: Cannot ${operation} files inside a .git directory.`);
|
|
88
|
+
return resolvedPath;
|
|
89
|
+
}
|
|
66
90
|
//#endregion
|
|
67
|
-
export { isPathAllowed as n, assertPathAllowed as t };
|
|
91
|
+
export { isPathAllowed as a, isGitDirectoryName as i, assertWritablePath as n, createPathChecker as r, assertPathAllowed as t };
|