deepagents 1.16.3 → 1.16.5
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/{agent-DOFzksfM.d.cts → agent-Di09Mxb3.d.cts} +34 -1
- package/dist/{agent-BAuGxPZn.d.ts → agent-DiA5yRzO.d.ts} +35 -2
- package/dist/browser.cjs +1 -1
- package/dist/browser.d.cts +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/{langsmith-BCgECepG.js → langsmith-CH6GPPud.js} +260 -31
- package/dist/langsmith-CH6GPPud.js.map +1 -0
- package/dist/{langsmith-CAjAu64d.cjs → langsmith-CR3a2-Z7.cjs} +263 -28
- package/dist/langsmith-CR3a2-Z7.cjs.map +1 -0
- package/dist/node.cjs +2 -2
- package/dist/node.d.cts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.js +2 -2
- package/dist/{src-BB1S1Jfy.cjs → src-DeLlHk9u.cjs} +151 -26
- package/dist/src-DeLlHk9u.cjs.map +1 -0
- package/dist/{src-0lJMqL6V.js → src-tRcDW-tU.js} +151 -26
- package/dist/src-tRcDW-tU.js.map +1 -0
- package/package.json +6 -6
- package/dist/langsmith-BCgECepG.js.map +0 -1
- package/dist/langsmith-CAjAu64d.cjs.map +0 -1
- package/dist/src-0lJMqL6V.js.map +0 -1
- package/dist/src-BB1S1Jfy.cjs.map +0 -1
package/dist/node.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_langsmith = require("./langsmith-
|
|
3
|
-
const require_src = require("./src-
|
|
2
|
+
const require_langsmith = require("./langsmith-CR3a2-Z7.cjs");
|
|
3
|
+
const require_src = require("./src-DeLlHk9u.cjs");
|
|
4
4
|
exports.ASYNC_TASK_SYSTEM_PROMPT = require_langsmith.ASYNC_TASK_SYSTEM_PROMPT;
|
|
5
5
|
exports.BASE_AGENT_PROMPT = require_langsmith.BASE_AGENT_PROMPT;
|
|
6
6
|
exports.BaseSandbox = require_langsmith.BaseSandbox;
|
package/dist/node.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as scrubUnsupportedMultimodalContent, $t as SystemPromptConfig, A as createSettings, An as SandboxGetOrCreateOptions, At as SUBAGENT_RESPONSE_FORMAT_CONFIG_KEY, B as FlattenSubAgentMiddleware, Bn as BackendProtocolV2, Bt as parseHarnessProfileConfig, C as listSkills, Cn as MaybePromise, Ct as StateBackend, D as filesValue, Dn as SandboxDeleteOptions, Dt as DEFAULT_SUBAGENT_PROMPT, E as createAgentMemoryMiddleware, En as SandboxBackendProtocol, Et as DEFAULT_GENERAL_PURPOSE_DESCRIPTION, F as CreateDeepAgentParams, Fn as WriteResult, Ft as getHarnessProfile, G as InferSubagentByName, Gt as HarnessProfile, H as InferDeepAgentType, Hn as BackendProtocolV1, Ht as EMPTY_HARNESS_PROFILE, I as DeepAgent, In as applyGrepMaxCount, It as registerHarnessProfile, J as ResolveDeepAgentTypeConfig, Jt as ConfigurationError, K as InferSubagentReactAgentType, Kt as HarnessProfileOptions, L as DeepAgentTypeConfig, Ln as isSandboxBackend, Lt as HarnessProfileConfigData, M as DeepAgentRunStream, Mn as SandboxListOptions, Mt as SubAgentMiddlewareOptions, N as SubagentRunStream, Nn as SandboxListResponse, Nt as createSubAgent, O as Settings, On as SandboxError, Ot as ForkedSubAgent, P as AnySubAgent, Pn as StateAndStore, Pt as createSubAgentMiddleware, Q as multimodalBlockSupported, Qt as EXECUTION_SYSTEM_PROMPT, R as DefaultDeepAgentTypeConfig, Rn as isSandboxProtocol, Rt as generalPurposeSubagentConfigSchema, S as SkillMetadata, Sn as LsResult, St as createMemoryMiddleware, T as AgentMemoryMiddlewareOptions, Tn as ReadResult, Tt as CompiledSubAgent, U as InferStructuredResponse, Un as SandboxBackendProtocolV1, Ut as createHarnessProfile, V as InferDeepAgentSubagents, Vn as SandboxBackendProtocolV2, Vt as serializeProfile, W as InferSubAgentMiddlewareStates, Wt as GeneralPurposeSubagentConfig, X as MULTIMODAL_BLOCK_TYPES, Xt as ASYNC_TASK_SYSTEM_PROMPT, Y as SupportedResponseFormat, Yt as ConfigurationErrorCode, Z as createUnsupportedContentMiddleware, Zt as BASE_AGENT_PROMPT, _ as StoreBackend, _n as FileOperationError, _t as SkillsMiddlewareOptions, a as adaptBackendProtocol, an as FilesystemPermission, at as createAsyncSubAgentMiddleware, b as StoreBackendOptions, bn as GrepMatch, bt as skillsMetadataValue, c as LangSmithSandbox, cn as BackendFactory, ct as createSummarizationMiddleware, d as BaseSandbox, dn as DeleteResult, dt as MAX_SKILL_DESCRIPTION_LENGTH, en as TASK_SYSTEM_PROMPT, et as AsyncSubAgent, f as LocalShellBackend, fn as EditResult, ft as MAX_SKILL_FILE_SIZE, g as FilesystemBackend, gn as FileInfo, gt as SkillToolResolver, h as CompositeBackend, hn as FileDownloadResponse, ht as SkillMetadataEntry, i as LangSmithStartSandboxOptions, in as FilesystemOperation, it as TaskEvent, j as findProjectRoot, jn as SandboxInfo, jt as SubAgent, k as SettingsOptions, kn as SandboxErrorCode, kt as GENERAL_PURPOSE_SUBAGENT, l as LangSmithSandboxCreateOptions, ln as BackendProtocol, lt as CompletionCallbackOptions, m as ContextHubBackend, mn as FileData, mt as SkillMetadata$1, n as LangSmithCaptureSnapshotOptions, nn as FsToolName, nt as AsyncTask, o as adaptSandboxProtocol, on as PermissionMode, ot as isAsyncSubAgent, p as LocalShellBackendOptions, pn as ExecuteResponse, pt as MAX_SKILL_NAME_LENGTH, q as MergedDeepAgentState, qt as REQUIRED_MIDDLEWARE_NAMES, r as LangSmithSnapshot, rn as createFilesystemMiddleware, rt as AsyncTaskStatus, s as normalizeReadPagination, sn as AnyBackendProtocol, st as computeSummarizationDefaults, t as createDeepAgent, tn as FilesystemMiddlewareOptions, tt as AsyncSubAgentMiddlewareOptions, u as LangSmithSandboxOptions, un as BackendRuntime, ut as createCompletionCallbackMiddleware, v as StoreBackendContext, vn as FileUploadResponse, vt as createSkillsMiddleware, w as parseSkillMetadata, wn as ReadRawResult, wt as createPatchToolCallsMiddleware, x as ListSkillsOptions, xn as GrepResult, xt as MemoryMiddlewareOptions, y as StoreBackendNamespaceFactory, yn as GlobResult, yt as pinnedSkillsValue, z as ExtractSubAgentMiddleware, zn as resolveBackend, zt as harnessProfileConfigSchema } from "./agent-
|
|
1
|
+
import { $ as scrubUnsupportedMultimodalContent, $t as SystemPromptConfig, A as createSettings, An as SandboxGetOrCreateOptions, At as SUBAGENT_RESPONSE_FORMAT_CONFIG_KEY, B as FlattenSubAgentMiddleware, Bn as BackendProtocolV2, Bt as parseHarnessProfileConfig, C as listSkills, Cn as MaybePromise, Ct as StateBackend, D as filesValue, Dn as SandboxDeleteOptions, Dt as DEFAULT_SUBAGENT_PROMPT, E as createAgentMemoryMiddleware, En as SandboxBackendProtocol, Et as DEFAULT_GENERAL_PURPOSE_DESCRIPTION, F as CreateDeepAgentParams, Fn as WriteResult, Ft as getHarnessProfile, G as InferSubagentByName, Gt as HarnessProfile, H as InferDeepAgentType, Hn as BackendProtocolV1, Ht as EMPTY_HARNESS_PROFILE, I as DeepAgent, In as applyGrepMaxCount, It as registerHarnessProfile, J as ResolveDeepAgentTypeConfig, Jt as ConfigurationError, K as InferSubagentReactAgentType, Kt as HarnessProfileOptions, L as DeepAgentTypeConfig, Ln as isSandboxBackend, Lt as HarnessProfileConfigData, M as DeepAgentRunStream, Mn as SandboxListOptions, Mt as SubAgentMiddlewareOptions, N as SubagentRunStream, Nn as SandboxListResponse, Nt as createSubAgent, O as Settings, On as SandboxError, Ot as ForkedSubAgent, P as AnySubAgent, Pn as StateAndStore, Pt as createSubAgentMiddleware, Q as multimodalBlockSupported, Qt as EXECUTION_SYSTEM_PROMPT, R as DefaultDeepAgentTypeConfig, Rn as isSandboxProtocol, Rt as generalPurposeSubagentConfigSchema, S as SkillMetadata, Sn as LsResult, St as createMemoryMiddleware, T as AgentMemoryMiddlewareOptions, Tn as ReadResult, Tt as CompiledSubAgent, U as InferStructuredResponse, Un as SandboxBackendProtocolV1, Ut as createHarnessProfile, V as InferDeepAgentSubagents, Vn as SandboxBackendProtocolV2, Vt as serializeProfile, W as InferSubAgentMiddlewareStates, Wt as GeneralPurposeSubagentConfig, X as MULTIMODAL_BLOCK_TYPES, Xt as ASYNC_TASK_SYSTEM_PROMPT, Y as SupportedResponseFormat, Yt as ConfigurationErrorCode, Z as createUnsupportedContentMiddleware, Zt as BASE_AGENT_PROMPT, _ as StoreBackend, _n as FileOperationError, _t as SkillsMiddlewareOptions, a as adaptBackendProtocol, an as FilesystemPermission, at as createAsyncSubAgentMiddleware, b as StoreBackendOptions, bn as GrepMatch, bt as skillsMetadataValue, c as LangSmithSandbox, cn as BackendFactory, ct as createSummarizationMiddleware, d as BaseSandbox, dn as DeleteResult, dt as MAX_SKILL_DESCRIPTION_LENGTH, en as TASK_SYSTEM_PROMPT, et as AsyncSubAgent, f as LocalShellBackend, fn as EditResult, ft as MAX_SKILL_FILE_SIZE, g as FilesystemBackend, gn as FileInfo, gt as SkillToolResolver, h as CompositeBackend, hn as FileDownloadResponse, ht as SkillMetadataEntry, i as LangSmithStartSandboxOptions, in as FilesystemOperation, it as TaskEvent, j as findProjectRoot, jn as SandboxInfo, jt as SubAgent, k as SettingsOptions, kn as SandboxErrorCode, kt as GENERAL_PURPOSE_SUBAGENT, l as LangSmithSandboxCreateOptions, ln as BackendProtocol, lt as CompletionCallbackOptions, m as ContextHubBackend, mn as FileData, mt as SkillMetadata$1, n as LangSmithCaptureSnapshotOptions, nn as FsToolName, nt as AsyncTask, o as adaptSandboxProtocol, on as PermissionMode, ot as isAsyncSubAgent, p as LocalShellBackendOptions, pn as ExecuteResponse, pt as MAX_SKILL_NAME_LENGTH, q as MergedDeepAgentState, qt as REQUIRED_MIDDLEWARE_NAMES, r as LangSmithSnapshot, rn as createFilesystemMiddleware, rt as AsyncTaskStatus, s as normalizeReadPagination, sn as AnyBackendProtocol, st as computeSummarizationDefaults, t as createDeepAgent, tn as FilesystemMiddlewareOptions, tt as AsyncSubAgentMiddlewareOptions, u as LangSmithSandboxOptions, un as BackendRuntime, ut as createCompletionCallbackMiddleware, v as StoreBackendContext, vn as FileUploadResponse, vt as createSkillsMiddleware, w as parseSkillMetadata, wn as ReadRawResult, wt as createPatchToolCallsMiddleware, x as ListSkillsOptions, xn as GrepResult, xt as MemoryMiddlewareOptions, y as StoreBackendNamespaceFactory, yn as GlobResult, yt as pinnedSkillsValue, z as ExtractSubAgentMiddleware, zn as resolveBackend, zt as harnessProfileConfigSchema } from "./agent-Di09Mxb3.cjs";
|
|
2
2
|
export { ASYNC_TASK_SYSTEM_PROMPT, type AgentMemoryMiddlewareOptions, type AnyBackendProtocol, type AnySubAgent, type AsyncSubAgent, type AsyncSubAgentMiddlewareOptions, type AsyncTask, type AsyncTaskStatus, BASE_AGENT_PROMPT, type BackendFactory, type BackendProtocol, type BackendProtocolV1, type BackendProtocolV2, type BackendRuntime, BaseSandbox, type CompiledSubAgent, type CompletionCallbackOptions, CompositeBackend, ConfigurationError, type ConfigurationErrorCode, ContextHubBackend, type CreateDeepAgentParams, DEFAULT_GENERAL_PURPOSE_DESCRIPTION, DEFAULT_SUBAGENT_PROMPT, type DeepAgent, type DeepAgentRunStream, type DeepAgentTypeConfig, type DefaultDeepAgentTypeConfig, type DeleteResult, EMPTY_HARNESS_PROFILE, EXECUTION_SYSTEM_PROMPT, type EditResult, type ExecuteResponse, type ExtractSubAgentMiddleware, type FileData, type FileDownloadResponse, type FileInfo, type FileOperationError, type FileUploadResponse, FilesystemBackend, type FilesystemMiddlewareOptions, type FilesystemOperation, type FilesystemPermission, type FlattenSubAgentMiddleware, type ForkedSubAgent, type FsToolName, GENERAL_PURPOSE_SUBAGENT, type GeneralPurposeSubagentConfig, type GlobResult, type GrepMatch, type GrepResult, type HarnessProfile, type HarnessProfileConfigData, type HarnessProfileOptions, type InferDeepAgentSubagents, type InferDeepAgentType, type InferStructuredResponse, type InferSubAgentMiddlewareStates, type InferSubagentByName, type InferSubagentReactAgentType, type LangSmithCaptureSnapshotOptions, LangSmithSandbox, type LangSmithSandboxCreateOptions, type LangSmithSandboxOptions, type LangSmithSnapshot, type LangSmithStartSandboxOptions, type ListSkillsOptions, type SkillMetadata as LoaderSkillMetadata, LocalShellBackend, type LocalShellBackendOptions, type LsResult, MAX_SKILL_DESCRIPTION_LENGTH, MAX_SKILL_FILE_SIZE, MAX_SKILL_NAME_LENGTH, MULTIMODAL_BLOCK_TYPES, type MaybePromise, type MemoryMiddlewareOptions, type MergedDeepAgentState, type PermissionMode, REQUIRED_MIDDLEWARE_NAMES, type ReadRawResult, type ReadResult, type ResolveDeepAgentTypeConfig, SUBAGENT_RESPONSE_FORMAT_CONFIG_KEY, type SandboxBackendProtocol, type SandboxBackendProtocolV1, type SandboxBackendProtocolV2, type SandboxDeleteOptions, SandboxError, type SandboxErrorCode, type SandboxGetOrCreateOptions, type SandboxInfo, type SandboxListOptions, type SandboxListResponse, type Settings, type SettingsOptions, type SkillMetadata$1 as SkillMetadata, type SkillMetadataEntry, type SkillToolResolver, type SkillsMiddlewareOptions, type StateAndStore, StateBackend, StoreBackend, type StoreBackendContext, type StoreBackendNamespaceFactory, type StoreBackendOptions, type SubAgent, type SubAgentMiddlewareOptions, type SubagentRunStream, type SupportedResponseFormat, type SystemPromptConfig, TASK_SYSTEM_PROMPT, type TaskEvent, type WriteResult, adaptBackendProtocol, adaptSandboxProtocol, applyGrepMaxCount, computeSummarizationDefaults, createAgentMemoryMiddleware, createAsyncSubAgentMiddleware, createCompletionCallbackMiddleware, createDeepAgent, createFilesystemMiddleware, createHarnessProfile, createMemoryMiddleware, createPatchToolCallsMiddleware, createSettings, createSkillsMiddleware, createSubAgent, createSubAgentMiddleware, createSummarizationMiddleware, createUnsupportedContentMiddleware, filesValue, findProjectRoot, generalPurposeSubagentConfigSchema, getHarnessProfile, harnessProfileConfigSchema, isAsyncSubAgent, isSandboxBackend, isSandboxProtocol, listSkills, multimodalBlockSupported, normalizeReadPagination, parseHarnessProfileConfig, parseSkillMetadata, pinnedSkillsValue, registerHarnessProfile, resolveBackend, scrubUnsupportedMultimodalContent, serializeProfile, skillsMetadataValue };
|
package/dist/node.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as scrubUnsupportedMultimodalContent, $t as SystemPromptConfig, A as createSettings, An as SandboxGetOrCreateOptions, At as SUBAGENT_RESPONSE_FORMAT_CONFIG_KEY, B as FlattenSubAgentMiddleware, Bn as BackendProtocolV2, Bt as parseHarnessProfileConfig, C as listSkills, Cn as MaybePromise, Ct as StateBackend, D as filesValue, Dn as SandboxDeleteOptions, Dt as DEFAULT_SUBAGENT_PROMPT, E as createAgentMemoryMiddleware, En as SandboxBackendProtocol, Et as DEFAULT_GENERAL_PURPOSE_DESCRIPTION, F as CreateDeepAgentParams, Fn as WriteResult, Ft as getHarnessProfile, G as InferSubagentByName, Gt as HarnessProfile, H as InferDeepAgentType, Hn as BackendProtocolV1, Ht as EMPTY_HARNESS_PROFILE, I as DeepAgent, In as applyGrepMaxCount, It as registerHarnessProfile, J as ResolveDeepAgentTypeConfig, Jt as ConfigurationError, K as InferSubagentReactAgentType, Kt as HarnessProfileOptions, L as DeepAgentTypeConfig, Ln as isSandboxBackend, Lt as HarnessProfileConfigData, M as DeepAgentRunStream, Mn as SandboxListOptions, Mt as SubAgentMiddlewareOptions, N as SubagentRunStream, Nn as SandboxListResponse, Nt as createSubAgent, O as Settings, On as SandboxError, Ot as ForkedSubAgent, P as AnySubAgent, Pn as StateAndStore, Pt as createSubAgentMiddleware, Q as multimodalBlockSupported, Qt as EXECUTION_SYSTEM_PROMPT, R as DefaultDeepAgentTypeConfig, Rn as isSandboxProtocol, Rt as generalPurposeSubagentConfigSchema, S as SkillMetadata, Sn as LsResult, St as createMemoryMiddleware, T as AgentMemoryMiddlewareOptions, Tn as ReadResult, Tt as CompiledSubAgent, U as InferStructuredResponse, Un as SandboxBackendProtocolV1, Ut as createHarnessProfile, V as InferDeepAgentSubagents, Vn as SandboxBackendProtocolV2, Vt as serializeProfile, W as InferSubAgentMiddlewareStates, Wt as GeneralPurposeSubagentConfig, X as MULTIMODAL_BLOCK_TYPES, Xt as ASYNC_TASK_SYSTEM_PROMPT, Y as SupportedResponseFormat, Yt as ConfigurationErrorCode, Z as createUnsupportedContentMiddleware, Zt as BASE_AGENT_PROMPT, _ as StoreBackend, _n as FileOperationError, _t as SkillsMiddlewareOptions, a as adaptBackendProtocol, an as FilesystemPermission, at as createAsyncSubAgentMiddleware, b as StoreBackendOptions, bn as GrepMatch, bt as skillsMetadataValue, c as LangSmithSandbox, cn as BackendFactory, ct as createSummarizationMiddleware, d as BaseSandbox, dn as DeleteResult, dt as MAX_SKILL_DESCRIPTION_LENGTH, en as TASK_SYSTEM_PROMPT, et as AsyncSubAgent, f as LocalShellBackend, fn as EditResult, ft as MAX_SKILL_FILE_SIZE, g as FilesystemBackend, gn as FileInfo, gt as SkillToolResolver, h as CompositeBackend, hn as FileDownloadResponse, ht as SkillMetadataEntry, i as LangSmithStartSandboxOptions, in as FilesystemOperation, it as TaskEvent, j as findProjectRoot, jn as SandboxInfo, jt as SubAgent, k as SettingsOptions, kn as SandboxErrorCode, kt as GENERAL_PURPOSE_SUBAGENT, l as LangSmithSandboxCreateOptions, ln as BackendProtocol, lt as CompletionCallbackOptions, m as ContextHubBackend, mn as FileData, mt as SkillMetadata$1, n as LangSmithCaptureSnapshotOptions, nn as FsToolName, nt as AsyncTask, o as adaptSandboxProtocol, on as PermissionMode, ot as isAsyncSubAgent, p as LocalShellBackendOptions, pn as ExecuteResponse, pt as MAX_SKILL_NAME_LENGTH, q as MergedDeepAgentState, qt as REQUIRED_MIDDLEWARE_NAMES, r as LangSmithSnapshot, rn as createFilesystemMiddleware, rt as AsyncTaskStatus, s as normalizeReadPagination, sn as AnyBackendProtocol, st as computeSummarizationDefaults, t as createDeepAgent, tn as FilesystemMiddlewareOptions, tt as AsyncSubAgentMiddlewareOptions, u as LangSmithSandboxOptions, un as BackendRuntime, ut as createCompletionCallbackMiddleware, v as StoreBackendContext, vn as FileUploadResponse, vt as createSkillsMiddleware, w as parseSkillMetadata, wn as ReadRawResult, wt as createPatchToolCallsMiddleware, x as ListSkillsOptions, xn as GrepResult, xt as MemoryMiddlewareOptions, y as StoreBackendNamespaceFactory, yn as GlobResult, yt as pinnedSkillsValue, z as ExtractSubAgentMiddleware, zn as resolveBackend, zt as harnessProfileConfigSchema } from "./agent-
|
|
1
|
+
import { $ as scrubUnsupportedMultimodalContent, $t as SystemPromptConfig, A as createSettings, An as SandboxGetOrCreateOptions, At as SUBAGENT_RESPONSE_FORMAT_CONFIG_KEY, B as FlattenSubAgentMiddleware, Bn as BackendProtocolV2, Bt as parseHarnessProfileConfig, C as listSkills, Cn as MaybePromise, Ct as StateBackend, D as filesValue, Dn as SandboxDeleteOptions, Dt as DEFAULT_SUBAGENT_PROMPT, E as createAgentMemoryMiddleware, En as SandboxBackendProtocol, Et as DEFAULT_GENERAL_PURPOSE_DESCRIPTION, F as CreateDeepAgentParams, Fn as WriteResult, Ft as getHarnessProfile, G as InferSubagentByName, Gt as HarnessProfile, H as InferDeepAgentType, Hn as BackendProtocolV1, Ht as EMPTY_HARNESS_PROFILE, I as DeepAgent, In as applyGrepMaxCount, It as registerHarnessProfile, J as ResolveDeepAgentTypeConfig, Jt as ConfigurationError, K as InferSubagentReactAgentType, Kt as HarnessProfileOptions, L as DeepAgentTypeConfig, Ln as isSandboxBackend, Lt as HarnessProfileConfigData, M as DeepAgentRunStream, Mn as SandboxListOptions, Mt as SubAgentMiddlewareOptions, N as SubagentRunStream, Nn as SandboxListResponse, Nt as createSubAgent, O as Settings, On as SandboxError, Ot as ForkedSubAgent, P as AnySubAgent, Pn as StateAndStore, Pt as createSubAgentMiddleware, Q as multimodalBlockSupported, Qt as EXECUTION_SYSTEM_PROMPT, R as DefaultDeepAgentTypeConfig, Rn as isSandboxProtocol, Rt as generalPurposeSubagentConfigSchema, S as SkillMetadata, Sn as LsResult, St as createMemoryMiddleware, T as AgentMemoryMiddlewareOptions, Tn as ReadResult, Tt as CompiledSubAgent, U as InferStructuredResponse, Un as SandboxBackendProtocolV1, Ut as createHarnessProfile, V as InferDeepAgentSubagents, Vn as SandboxBackendProtocolV2, Vt as serializeProfile, W as InferSubAgentMiddlewareStates, Wt as GeneralPurposeSubagentConfig, X as MULTIMODAL_BLOCK_TYPES, Xt as ASYNC_TASK_SYSTEM_PROMPT, Y as SupportedResponseFormat, Yt as ConfigurationErrorCode, Z as createUnsupportedContentMiddleware, Zt as BASE_AGENT_PROMPT, _ as StoreBackend, _n as FileOperationError, _t as SkillsMiddlewareOptions, a as adaptBackendProtocol, an as FilesystemPermission, at as createAsyncSubAgentMiddleware, b as StoreBackendOptions, bn as GrepMatch, bt as skillsMetadataValue, c as LangSmithSandbox, cn as BackendFactory, ct as createSummarizationMiddleware, d as BaseSandbox, dn as DeleteResult, dt as MAX_SKILL_DESCRIPTION_LENGTH, en as TASK_SYSTEM_PROMPT, et as AsyncSubAgent, f as LocalShellBackend, fn as EditResult, ft as MAX_SKILL_FILE_SIZE, g as FilesystemBackend, gn as FileInfo, gt as SkillToolResolver, h as CompositeBackend, hn as FileDownloadResponse, ht as SkillMetadataEntry, i as LangSmithStartSandboxOptions, in as FilesystemOperation, it as TaskEvent, j as findProjectRoot, jn as SandboxInfo, jt as SubAgent, k as SettingsOptions, kn as SandboxErrorCode, kt as GENERAL_PURPOSE_SUBAGENT, l as LangSmithSandboxCreateOptions, ln as BackendProtocol, lt as CompletionCallbackOptions, m as ContextHubBackend, mn as FileData, mt as SkillMetadata$1, n as LangSmithCaptureSnapshotOptions, nn as FsToolName, nt as AsyncTask, o as adaptSandboxProtocol, on as PermissionMode, ot as isAsyncSubAgent, p as LocalShellBackendOptions, pn as ExecuteResponse, pt as MAX_SKILL_NAME_LENGTH, q as MergedDeepAgentState, qt as REQUIRED_MIDDLEWARE_NAMES, r as LangSmithSnapshot, rn as createFilesystemMiddleware, rt as AsyncTaskStatus, s as normalizeReadPagination, sn as AnyBackendProtocol, st as computeSummarizationDefaults, t as createDeepAgent, tn as FilesystemMiddlewareOptions, tt as AsyncSubAgentMiddlewareOptions, u as LangSmithSandboxOptions, un as BackendRuntime, ut as createCompletionCallbackMiddleware, v as StoreBackendContext, vn as FileUploadResponse, vt as createSkillsMiddleware, w as parseSkillMetadata, wn as ReadRawResult, wt as createPatchToolCallsMiddleware, x as ListSkillsOptions, xn as GrepResult, xt as MemoryMiddlewareOptions, y as StoreBackendNamespaceFactory, yn as GlobResult, yt as pinnedSkillsValue, z as ExtractSubAgentMiddleware, zn as resolveBackend, zt as harnessProfileConfigSchema } from "./agent-DiA5yRzO.js";
|
|
2
2
|
export { ASYNC_TASK_SYSTEM_PROMPT, type AgentMemoryMiddlewareOptions, type AnyBackendProtocol, type AnySubAgent, type AsyncSubAgent, type AsyncSubAgentMiddlewareOptions, type AsyncTask, type AsyncTaskStatus, BASE_AGENT_PROMPT, type BackendFactory, type BackendProtocol, type BackendProtocolV1, type BackendProtocolV2, type BackendRuntime, BaseSandbox, type CompiledSubAgent, type CompletionCallbackOptions, CompositeBackend, ConfigurationError, type ConfigurationErrorCode, ContextHubBackend, type CreateDeepAgentParams, DEFAULT_GENERAL_PURPOSE_DESCRIPTION, DEFAULT_SUBAGENT_PROMPT, type DeepAgent, type DeepAgentRunStream, type DeepAgentTypeConfig, type DefaultDeepAgentTypeConfig, type DeleteResult, EMPTY_HARNESS_PROFILE, EXECUTION_SYSTEM_PROMPT, type EditResult, type ExecuteResponse, type ExtractSubAgentMiddleware, type FileData, type FileDownloadResponse, type FileInfo, type FileOperationError, type FileUploadResponse, FilesystemBackend, type FilesystemMiddlewareOptions, type FilesystemOperation, type FilesystemPermission, type FlattenSubAgentMiddleware, type ForkedSubAgent, type FsToolName, GENERAL_PURPOSE_SUBAGENT, type GeneralPurposeSubagentConfig, type GlobResult, type GrepMatch, type GrepResult, type HarnessProfile, type HarnessProfileConfigData, type HarnessProfileOptions, type InferDeepAgentSubagents, type InferDeepAgentType, type InferStructuredResponse, type InferSubAgentMiddlewareStates, type InferSubagentByName, type InferSubagentReactAgentType, type LangSmithCaptureSnapshotOptions, LangSmithSandbox, type LangSmithSandboxCreateOptions, type LangSmithSandboxOptions, type LangSmithSnapshot, type LangSmithStartSandboxOptions, type ListSkillsOptions, type SkillMetadata as LoaderSkillMetadata, LocalShellBackend, type LocalShellBackendOptions, type LsResult, MAX_SKILL_DESCRIPTION_LENGTH, MAX_SKILL_FILE_SIZE, MAX_SKILL_NAME_LENGTH, MULTIMODAL_BLOCK_TYPES, type MaybePromise, type MemoryMiddlewareOptions, type MergedDeepAgentState, type PermissionMode, REQUIRED_MIDDLEWARE_NAMES, type ReadRawResult, type ReadResult, type ResolveDeepAgentTypeConfig, SUBAGENT_RESPONSE_FORMAT_CONFIG_KEY, type SandboxBackendProtocol, type SandboxBackendProtocolV1, type SandboxBackendProtocolV2, type SandboxDeleteOptions, SandboxError, type SandboxErrorCode, type SandboxGetOrCreateOptions, type SandboxInfo, type SandboxListOptions, type SandboxListResponse, type Settings, type SettingsOptions, type SkillMetadata$1 as SkillMetadata, type SkillMetadataEntry, type SkillToolResolver, type SkillsMiddlewareOptions, type StateAndStore, StateBackend, StoreBackend, type StoreBackendContext, type StoreBackendNamespaceFactory, type StoreBackendOptions, type SubAgent, type SubAgentMiddlewareOptions, type SubagentRunStream, type SupportedResponseFormat, type SystemPromptConfig, TASK_SYSTEM_PROMPT, type TaskEvent, type WriteResult, adaptBackendProtocol, adaptSandboxProtocol, applyGrepMaxCount, computeSummarizationDefaults, createAgentMemoryMiddleware, createAsyncSubAgentMiddleware, createCompletionCallbackMiddleware, createDeepAgent, createFilesystemMiddleware, createHarnessProfile, createMemoryMiddleware, createPatchToolCallsMiddleware, createSettings, createSkillsMiddleware, createSubAgent, createSubAgentMiddleware, createSummarizationMiddleware, createUnsupportedContentMiddleware, filesValue, findProjectRoot, generalPurposeSubagentConfigSchema, getHarnessProfile, harnessProfileConfigSchema, isAsyncSubAgent, isSandboxBackend, isSandboxProtocol, listSkills, multimodalBlockSupported, normalizeReadPagination, parseHarnessProfileConfig, parseSkillMetadata, pinnedSkillsValue, registerHarnessProfile, resolveBackend, scrubUnsupportedMultimodalContent, serializeProfile, skillsMetadataValue };
|
package/dist/node.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as adaptSandboxProtocol, A as filesValue, B as createFilesystemMiddleware, C as MAX_SKILL_FILE_SIZE, D as skillsMetadataValue, E as pinnedSkillsValue, F as SUBAGENT_RESPONSE_FORMAT_CONFIG_KEY, G as scrubUnsupportedMultimodalContent, H as MULTIMODAL_BLOCK_TYPES, I as createSubAgent, J as applyGrepMaxCount, K as StateBackend, L as createSubAgentMiddleware, M as DEFAULT_GENERAL_PURPOSE_DESCRIPTION, N as DEFAULT_SUBAGENT_PROMPT, O as ConfigurationError, P as GENERAL_PURPOSE_SUBAGENT, Q as adaptBackendProtocol, R as computeSummarizationDefaults, S as MAX_SKILL_DESCRIPTION_LENGTH, T as createSkillsMiddleware, U as createUnsupportedContentMiddleware, V as CompositeBackend, W as multimodalBlockSupported, X as isSandboxProtocol, Y as isSandboxBackend, Z as resolveBackend, _ as createHarnessProfile, a as ASYNC_TASK_SYSTEM_PROMPT, b as isAsyncSubAgent, c as TASK_SYSTEM_PROMPT, d as registerHarnessProfile, f as generalPurposeSubagentConfigSchema, g as EMPTY_HARNESS_PROFILE, h as serializeProfile, i as StoreBackend, j as createPatchToolCallsMiddleware, k as createMemoryMiddleware, l as createDeepAgent, m as parseHarnessProfileConfig, n as BaseSandbox, o as BASE_AGENT_PROMPT, p as harnessProfileConfigSchema, q as SandboxError, r as ContextHubBackend, rt as normalizeReadPagination, s as EXECUTION_SYSTEM_PROMPT, t as LangSmithSandbox, u as getHarnessProfile, v as REQUIRED_MIDDLEWARE_NAMES, w as MAX_SKILL_NAME_LENGTH, x as createCompletionCallbackMiddleware, y as createAsyncSubAgentMiddleware, z as createSummarizationMiddleware } from "./langsmith-
|
|
2
|
-
import { a as createAgentMemoryMiddleware, i as parseSkillMetadata, n as FilesystemBackend, o as createSettings, r as listSkills, s as findProjectRoot, t as LocalShellBackend } from "./src-
|
|
1
|
+
import { $ as adaptSandboxProtocol, A as filesValue, B as createFilesystemMiddleware, C as MAX_SKILL_FILE_SIZE, D as skillsMetadataValue, E as pinnedSkillsValue, F as SUBAGENT_RESPONSE_FORMAT_CONFIG_KEY, G as scrubUnsupportedMultimodalContent, H as MULTIMODAL_BLOCK_TYPES, I as createSubAgent, J as applyGrepMaxCount, K as StateBackend, L as createSubAgentMiddleware, M as DEFAULT_GENERAL_PURPOSE_DESCRIPTION, N as DEFAULT_SUBAGENT_PROMPT, O as ConfigurationError, P as GENERAL_PURPOSE_SUBAGENT, Q as adaptBackendProtocol, R as computeSummarizationDefaults, S as MAX_SKILL_DESCRIPTION_LENGTH, T as createSkillsMiddleware, U as createUnsupportedContentMiddleware, V as CompositeBackend, W as multimodalBlockSupported, X as isSandboxProtocol, Y as isSandboxBackend, Z as resolveBackend, _ as createHarnessProfile, a as ASYNC_TASK_SYSTEM_PROMPT, b as isAsyncSubAgent, c as TASK_SYSTEM_PROMPT, d as registerHarnessProfile, f as generalPurposeSubagentConfigSchema, g as EMPTY_HARNESS_PROFILE, h as serializeProfile, i as StoreBackend, j as createPatchToolCallsMiddleware, k as createMemoryMiddleware, l as createDeepAgent, m as parseHarnessProfileConfig, n as BaseSandbox, o as BASE_AGENT_PROMPT, p as harnessProfileConfigSchema, q as SandboxError, r as ContextHubBackend, rt as normalizeReadPagination, s as EXECUTION_SYSTEM_PROMPT, t as LangSmithSandbox, u as getHarnessProfile, v as REQUIRED_MIDDLEWARE_NAMES, w as MAX_SKILL_NAME_LENGTH, x as createCompletionCallbackMiddleware, y as createAsyncSubAgentMiddleware, z as createSummarizationMiddleware } from "./langsmith-CH6GPPud.js";
|
|
2
|
+
import { a as createAgentMemoryMiddleware, i as parseSkillMetadata, n as FilesystemBackend, o as createSettings, r as listSkills, s as findProjectRoot, t as LocalShellBackend } from "./src-tRcDW-tU.js";
|
|
3
3
|
export { ASYNC_TASK_SYSTEM_PROMPT, BASE_AGENT_PROMPT, BaseSandbox, CompositeBackend, ConfigurationError, ContextHubBackend, DEFAULT_GENERAL_PURPOSE_DESCRIPTION, DEFAULT_SUBAGENT_PROMPT, EMPTY_HARNESS_PROFILE, EXECUTION_SYSTEM_PROMPT, FilesystemBackend, GENERAL_PURPOSE_SUBAGENT, LangSmithSandbox, LocalShellBackend, MAX_SKILL_DESCRIPTION_LENGTH, MAX_SKILL_FILE_SIZE, MAX_SKILL_NAME_LENGTH, MULTIMODAL_BLOCK_TYPES, REQUIRED_MIDDLEWARE_NAMES, SUBAGENT_RESPONSE_FORMAT_CONFIG_KEY, SandboxError, StateBackend, StoreBackend, TASK_SYSTEM_PROMPT, adaptBackendProtocol, adaptSandboxProtocol, applyGrepMaxCount, computeSummarizationDefaults, createAgentMemoryMiddleware, createAsyncSubAgentMiddleware, createCompletionCallbackMiddleware, createDeepAgent, createFilesystemMiddleware, createHarnessProfile, createMemoryMiddleware, createPatchToolCallsMiddleware, createSettings, createSkillsMiddleware, createSubAgent, createSubAgentMiddleware, createSummarizationMiddleware, createUnsupportedContentMiddleware, filesValue, findProjectRoot, generalPurposeSubagentConfigSchema, getHarnessProfile, harnessProfileConfigSchema, isAsyncSubAgent, isSandboxBackend, isSandboxProtocol, listSkills, multimodalBlockSupported, normalizeReadPagination, parseHarnessProfileConfig, parseSkillMetadata, pinnedSkillsValue, registerHarnessProfile, resolveBackend, scrubUnsupportedMultimodalContent, serializeProfile, skillsMetadataValue };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_langsmith = require("./langsmith-
|
|
1
|
+
const require_langsmith = require("./langsmith-CR3a2-Z7.cjs");
|
|
2
2
|
let langchain = require("langchain");
|
|
3
3
|
let _langchain_core_tracers_tracer_langchain = require("@langchain/core/tracers/tracer_langchain");
|
|
4
4
|
let micromatch = require("micromatch");
|
|
@@ -12,6 +12,7 @@ let node_path = require("node:path");
|
|
|
12
12
|
node_path = require_langsmith.__toESM(node_path, 1);
|
|
13
13
|
let node_os = require("node:os");
|
|
14
14
|
node_os = require_langsmith.__toESM(node_os, 1);
|
|
15
|
+
let node_async_hooks = require("node:async_hooks");
|
|
15
16
|
let node_fs_promises = require("node:fs/promises");
|
|
16
17
|
node_fs_promises = require_langsmith.__toESM(node_fs_promises, 1);
|
|
17
18
|
let node_child_process = require("node:child_process");
|
|
@@ -540,6 +541,17 @@ function listSkills(options) {
|
|
|
540
541
|
* and optional glob include filtering, while preserving virtual path behavior
|
|
541
542
|
*/
|
|
542
543
|
const SUPPORTS_NOFOLLOW = node_fs.default.constants.O_NOFOLLOW !== void 0;
|
|
544
|
+
/**
|
|
545
|
+
* Linux exposes each open descriptor as `/proc/self/fd/<n>`: reading the link
|
|
546
|
+
* gives the real path of what is open, and resolving through it stays inside
|
|
547
|
+
* that directory. Elsewhere the pin hook is not installed.
|
|
548
|
+
*/
|
|
549
|
+
const PROC_FD = "/proc/self/fd";
|
|
550
|
+
const SUPPORTS_PIN = process.platform === "linux" && node_fs.default.existsSync(PROC_FD);
|
|
551
|
+
const DIR_FLAGS = 2097152 | node_fs.default.constants.O_DIRECTORY;
|
|
552
|
+
function notFound(nativePath) {
|
|
553
|
+
return Object.assign(/* @__PURE__ */ new Error(`ENOENT: no such file or directory, '${nativePath}'`), { code: "ENOENT" });
|
|
554
|
+
}
|
|
543
555
|
/** A Windows drive root (`C:\`) or network-share root (`\\server\share\`). */
|
|
544
556
|
const WIN32_VOLUME_ROOT = /^(?:[A-Za-z]:[\\/]|[\\/]{2}(?![?.][\\/])[^\\/]+[\\/][^\\/]+[\\/]?)$/;
|
|
545
557
|
/**
|
|
@@ -568,12 +580,14 @@ var FilesystemBackend = class {
|
|
|
568
580
|
cwd;
|
|
569
581
|
virtualMode;
|
|
570
582
|
maxFileSizeBytes;
|
|
583
|
+
pinnedDir = new node_async_hooks.AsyncLocalStorage();
|
|
571
584
|
constructor(options = {}) {
|
|
572
585
|
const { rootDir, virtualMode = false, maxFileSizeMb = 10 } = options;
|
|
573
586
|
this.cwd = rootDir ? node_path.default.resolve(rootDir) : process.cwd();
|
|
574
587
|
this.virtualMode = virtualMode;
|
|
575
588
|
this.maxFileSizeBytes = maxFileSizeMb * 1024 * 1024;
|
|
576
589
|
require_langsmith.setRealpath(this, (key) => this.resolveRealPath(key));
|
|
590
|
+
if (SUPPORTS_PIN) require_langsmith.setPin(this, (key, options, authorize, operation) => this.runPinned(key, options, authorize, operation));
|
|
577
591
|
}
|
|
578
592
|
/**
|
|
579
593
|
* Resolve a file path with security checks.
|
|
@@ -666,7 +680,13 @@ var FilesystemBackend = class {
|
|
|
666
680
|
anchor = parent;
|
|
667
681
|
}
|
|
668
682
|
}
|
|
669
|
-
|
|
683
|
+
return this.toToolPath(node_path.default.join(realAnchor, ...missing), key);
|
|
684
|
+
}
|
|
685
|
+
/**
|
|
686
|
+
* Map a native real path to the tool path form. Paths inside the root keep
|
|
687
|
+
* the root's configured form; in virtual mode a path outside the root throws.
|
|
688
|
+
*/
|
|
689
|
+
async toToolPath(realPath, key) {
|
|
670
690
|
let realRoot;
|
|
671
691
|
try {
|
|
672
692
|
realRoot = await node_fs_promises.default.realpath(this.cwd);
|
|
@@ -682,6 +702,94 @@ var FilesystemBackend = class {
|
|
|
682
702
|
return toSlashRootedPath(insideRoot ? node_path.default.join(this.cwd, relative) : realPath);
|
|
683
703
|
}
|
|
684
704
|
/**
|
|
705
|
+
* {@link PinFn} implementation. Opens the deepest existing directory above
|
|
706
|
+
* `key`, authorizes the real path the kernel reports for it, creates any
|
|
707
|
+
* missing directories beneath it without following symlinks (when
|
|
708
|
+
* `options.create`), then runs `operation` with I/O on `key` routed through
|
|
709
|
+
* the open directory. A path component swapped after the directory is
|
|
710
|
+
* opened cannot redirect the operation.
|
|
711
|
+
*/
|
|
712
|
+
async runPinned(key, options, authorize, operation) {
|
|
713
|
+
const pinned = await this.pinParent(key, options, authorize);
|
|
714
|
+
if (pinned === void 0) return operation();
|
|
715
|
+
if (!("handle" in pinned)) return pinned;
|
|
716
|
+
const fdPath = `${PROC_FD}/${pinned.handle.fd}/`;
|
|
717
|
+
try {
|
|
718
|
+
const result = await this.pinnedDir.run(pinned, operation);
|
|
719
|
+
return typeof result.error === "string" ? {
|
|
720
|
+
...result,
|
|
721
|
+
error: result.error.replaceAll(fdPath, `${pinned.parent}/`)
|
|
722
|
+
} : result;
|
|
723
|
+
} finally {
|
|
724
|
+
await pinned.handle.close();
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
/**
|
|
728
|
+
* Open and authorize the parent directory for {@link runPinned}. Returns
|
|
729
|
+
* `undefined` when `key` has no parent to pin (the root), and throws when
|
|
730
|
+
* the directory cannot be pinned.
|
|
731
|
+
*/
|
|
732
|
+
async pinParent(key, options, authorize) {
|
|
733
|
+
const target = this.resolvePath(key);
|
|
734
|
+
const parent = node_path.default.dirname(target);
|
|
735
|
+
if (parent === target || this.virtualMode && target === this.cwd) return;
|
|
736
|
+
const missing = [];
|
|
737
|
+
let dir = parent;
|
|
738
|
+
let handle;
|
|
739
|
+
while (handle === void 0) try {
|
|
740
|
+
handle = await node_fs_promises.default.open(dir, DIR_FLAGS);
|
|
741
|
+
} catch (error) {
|
|
742
|
+
const code = error.code;
|
|
743
|
+
const next = node_path.default.dirname(dir);
|
|
744
|
+
if (code !== "ENOENT" && code !== "ENOTDIR" || next === dir) throw error;
|
|
745
|
+
missing.unshift(node_path.default.basename(dir));
|
|
746
|
+
dir = next;
|
|
747
|
+
}
|
|
748
|
+
let current = dir;
|
|
749
|
+
try {
|
|
750
|
+
const realDir = await node_fs_promises.default.readlink(`${PROC_FD}/${handle.fd}`);
|
|
751
|
+
if (realDir.endsWith(" (deleted)")) throw notFound(dir);
|
|
752
|
+
const denied = await authorize(await this.toToolPath(node_path.default.join(realDir, ...missing, node_path.default.basename(target)), key));
|
|
753
|
+
if (denied !== void 0) {
|
|
754
|
+
await handle.close();
|
|
755
|
+
return { error: denied };
|
|
756
|
+
}
|
|
757
|
+
if (missing.length > 0 && !options.create) throw notFound(target);
|
|
758
|
+
for (const segment of missing) {
|
|
759
|
+
const child = `${PROC_FD}/${handle.fd}/${segment}`;
|
|
760
|
+
try {
|
|
761
|
+
await node_fs_promises.default.mkdir(child);
|
|
762
|
+
} catch (error) {
|
|
763
|
+
if (error.code !== "EEXIST") throw error;
|
|
764
|
+
}
|
|
765
|
+
const next = await node_fs_promises.default.open(child, DIR_FLAGS | node_fs.default.constants.O_NOFOLLOW);
|
|
766
|
+
const previous = handle;
|
|
767
|
+
handle = next;
|
|
768
|
+
current = node_path.default.join(current, segment);
|
|
769
|
+
await previous.close();
|
|
770
|
+
}
|
|
771
|
+
return {
|
|
772
|
+
parent,
|
|
773
|
+
handle
|
|
774
|
+
};
|
|
775
|
+
} catch (error) {
|
|
776
|
+
if (typeof error === "object" && error !== null && "message" in error && typeof error.message === "string") error.message = error.message.replaceAll(`${PROC_FD}/${handle.fd}/`, `${current}/`);
|
|
777
|
+
await handle.close();
|
|
778
|
+
throw error;
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
/**
|
|
782
|
+
* The path to use for I/O on `resolvedPath`: routed through the directory
|
|
783
|
+
* pinned by {@link runPinned} when it is the parent, otherwise unchanged.
|
|
784
|
+
*/
|
|
785
|
+
ioPath(resolvedPath) {
|
|
786
|
+
return this.pinnedPath(resolvedPath) ?? resolvedPath;
|
|
787
|
+
}
|
|
788
|
+
pinnedPath(resolvedPath) {
|
|
789
|
+
const pinned = this.pinnedDir.getStore();
|
|
790
|
+
return pinned !== void 0 && node_path.default.dirname(resolvedPath) === pinned.parent ? `${PROC_FD}/${pinned.handle.fd}/${node_path.default.basename(resolvedPath)}` : void 0;
|
|
791
|
+
}
|
|
792
|
+
/**
|
|
685
793
|
* Resolve the concrete path to unlink for a virtual delete operation.
|
|
686
794
|
*/
|
|
687
795
|
async resolveDeletePath(resolvedPath, filePath) {
|
|
@@ -763,12 +871,13 @@ var FilesystemBackend = class {
|
|
|
763
871
|
try {
|
|
764
872
|
const resolvedPath = this.resolvePath(filePath);
|
|
765
873
|
await this.assertRealPathWithinRoot(resolvedPath, filePath, { includeLeaf: true });
|
|
874
|
+
const ioPath = this.ioPath(resolvedPath);
|
|
766
875
|
const mimeType = require_langsmith.getMimeType(filePath);
|
|
767
876
|
const isBinary = !require_langsmith.isTextMimeType(mimeType);
|
|
768
877
|
let content;
|
|
769
878
|
if (SUPPORTS_NOFOLLOW) {
|
|
770
|
-
if (!(await node_fs_promises.default.stat(
|
|
771
|
-
const fd = await node_fs_promises.default.open(
|
|
879
|
+
if (!(await node_fs_promises.default.stat(ioPath)).isFile()) return { error: `File '${filePath}' not found` };
|
|
880
|
+
const fd = await node_fs_promises.default.open(ioPath, node_fs.default.constants.O_RDONLY | node_fs.default.constants.O_NOFOLLOW);
|
|
772
881
|
try {
|
|
773
882
|
if (isBinary) {
|
|
774
883
|
const buffer = await fd.readFile();
|
|
@@ -782,17 +891,17 @@ var FilesystemBackend = class {
|
|
|
782
891
|
await fd.close();
|
|
783
892
|
}
|
|
784
893
|
} else {
|
|
785
|
-
const stat = await node_fs_promises.default.lstat(
|
|
894
|
+
const stat = await node_fs_promises.default.lstat(ioPath);
|
|
786
895
|
if (stat.isSymbolicLink()) return { error: `Symlinks are not allowed: ${filePath}` };
|
|
787
896
|
if (!stat.isFile()) return { error: `File '${filePath}' not found` };
|
|
788
897
|
if (isBinary) {
|
|
789
|
-
const buffer = await node_fs_promises.default.readFile(
|
|
898
|
+
const buffer = await node_fs_promises.default.readFile(ioPath);
|
|
790
899
|
return {
|
|
791
900
|
content: new Uint8Array(buffer),
|
|
792
901
|
mimeType
|
|
793
902
|
};
|
|
794
903
|
}
|
|
795
|
-
content = await node_fs_promises.default.readFile(
|
|
904
|
+
content = await node_fs_promises.default.readFile(ioPath, "utf-8");
|
|
796
905
|
}
|
|
797
906
|
const emptyMsg = require_langsmith.checkEmptyContent(content);
|
|
798
907
|
if (emptyMsg) return {
|
|
@@ -883,15 +992,16 @@ var FilesystemBackend = class {
|
|
|
883
992
|
try {
|
|
884
993
|
const resolvedPath = this.resolvePath(filePath);
|
|
885
994
|
await this.assertRealPathWithinRoot(resolvedPath, filePath, { includeLeaf: true });
|
|
995
|
+
const ioPath = this.ioPath(resolvedPath);
|
|
886
996
|
const mimeType = require_langsmith.getMimeType(filePath);
|
|
887
997
|
const isBinary = !require_langsmith.isTextMimeType(mimeType);
|
|
888
998
|
try {
|
|
889
|
-
if ((await node_fs_promises.default.lstat(
|
|
999
|
+
if ((await node_fs_promises.default.lstat(ioPath)).isSymbolicLink()) return { error: `Cannot write to ${filePath} because it is a symlink. Symlinks are not allowed.` };
|
|
890
1000
|
} catch {}
|
|
891
|
-
await node_fs_promises.default.mkdir(node_path.default.dirname(
|
|
1001
|
+
await node_fs_promises.default.mkdir(node_path.default.dirname(ioPath), { recursive: true });
|
|
892
1002
|
if (SUPPORTS_NOFOLLOW) {
|
|
893
1003
|
const flags = node_fs.default.constants.O_WRONLY | node_fs.default.constants.O_CREAT | node_fs.default.constants.O_TRUNC | node_fs.default.constants.O_NOFOLLOW;
|
|
894
|
-
const fd = await node_fs_promises.default.open(
|
|
1004
|
+
const fd = await node_fs_promises.default.open(ioPath, flags, 420);
|
|
895
1005
|
try {
|
|
896
1006
|
if (isBinary) {
|
|
897
1007
|
const buffer = Buffer.from(content, "base64");
|
|
@@ -902,8 +1012,8 @@ var FilesystemBackend = class {
|
|
|
902
1012
|
}
|
|
903
1013
|
} else if (isBinary) {
|
|
904
1014
|
const buffer = Buffer.from(content, "base64");
|
|
905
|
-
await node_fs_promises.default.writeFile(
|
|
906
|
-
} else await node_fs_promises.default.writeFile(
|
|
1015
|
+
await node_fs_promises.default.writeFile(ioPath, buffer);
|
|
1016
|
+
} else await node_fs_promises.default.writeFile(ioPath, content, "utf-8");
|
|
907
1017
|
return {
|
|
908
1018
|
path: filePath,
|
|
909
1019
|
filesUpdate: null
|
|
@@ -934,7 +1044,7 @@ var FilesystemBackend = class {
|
|
|
934
1044
|
filesUpdate: null
|
|
935
1045
|
};
|
|
936
1046
|
}
|
|
937
|
-
const deletePath = await this.resolveDeletePath(resolvedPath, filePath);
|
|
1047
|
+
const deletePath = this.pinnedPath(resolvedPath) ?? await this.resolveDeletePath(resolvedPath, filePath);
|
|
938
1048
|
const stat = await node_fs_promises.default.lstat(deletePath).catch(() => null);
|
|
939
1049
|
if (!stat) return { error: `Error: '${filePath}' not found` };
|
|
940
1050
|
if (stat.isDirectory() && !stat.isSymbolicLink()) await node_fs_promises.default.rm(deletePath, {
|
|
@@ -958,33 +1068,34 @@ var FilesystemBackend = class {
|
|
|
958
1068
|
try {
|
|
959
1069
|
const resolvedPath = this.resolvePath(filePath);
|
|
960
1070
|
await this.assertRealPathWithinRoot(resolvedPath, filePath, { includeLeaf: true });
|
|
1071
|
+
const ioPath = this.ioPath(resolvedPath);
|
|
961
1072
|
let content;
|
|
962
1073
|
if (SUPPORTS_NOFOLLOW) {
|
|
963
|
-
if (!(await node_fs_promises.default.stat(
|
|
964
|
-
const fd = await node_fs_promises.default.open(
|
|
1074
|
+
if (!(await node_fs_promises.default.stat(ioPath)).isFile()) return { error: `Error: File '${filePath}' not found` };
|
|
1075
|
+
const fd = await node_fs_promises.default.open(ioPath, node_fs.default.constants.O_RDONLY | node_fs.default.constants.O_NOFOLLOW);
|
|
965
1076
|
try {
|
|
966
1077
|
content = await fd.readFile({ encoding: "utf-8" });
|
|
967
1078
|
} finally {
|
|
968
1079
|
await fd.close();
|
|
969
1080
|
}
|
|
970
1081
|
} else {
|
|
971
|
-
const stat = await node_fs_promises.default.lstat(
|
|
1082
|
+
const stat = await node_fs_promises.default.lstat(ioPath);
|
|
972
1083
|
if (stat.isSymbolicLink()) return { error: `Error: Symlinks are not allowed: ${filePath}` };
|
|
973
1084
|
if (!stat.isFile()) return { error: `Error: File '${filePath}' not found` };
|
|
974
|
-
content = await node_fs_promises.default.readFile(
|
|
1085
|
+
content = await node_fs_promises.default.readFile(ioPath, "utf-8");
|
|
975
1086
|
}
|
|
976
1087
|
const result = require_langsmith.performStringReplacement(content, oldString, newString, replaceAll);
|
|
977
1088
|
if (typeof result === "string") return { error: result };
|
|
978
1089
|
const [newContent, occurrences] = result;
|
|
979
1090
|
if (SUPPORTS_NOFOLLOW) {
|
|
980
1091
|
const flags = node_fs.default.constants.O_WRONLY | node_fs.default.constants.O_TRUNC | node_fs.default.constants.O_NOFOLLOW;
|
|
981
|
-
const fd = await node_fs_promises.default.open(
|
|
1092
|
+
const fd = await node_fs_promises.default.open(ioPath, flags);
|
|
982
1093
|
try {
|
|
983
1094
|
await fd.writeFile(newContent, "utf-8");
|
|
984
1095
|
} finally {
|
|
985
1096
|
await fd.close();
|
|
986
1097
|
}
|
|
987
|
-
} else await node_fs_promises.default.writeFile(
|
|
1098
|
+
} else await node_fs_promises.default.writeFile(ioPath, newContent, "utf-8");
|
|
988
1099
|
return {
|
|
989
1100
|
path: filePath,
|
|
990
1101
|
filesUpdate: null,
|
|
@@ -1244,12 +1355,26 @@ var FilesystemBackend = class {
|
|
|
1244
1355
|
for (const filePath of paths) try {
|
|
1245
1356
|
const resolvedPath = this.resolvePath(filePath);
|
|
1246
1357
|
await this.assertRealPathWithinRoot(resolvedPath, filePath, { includeLeaf: true });
|
|
1247
|
-
const
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1358
|
+
const fd = await node_fs_promises.default.open(resolvedPath, node_fs.default.constants.O_RDONLY | (node_fs.default.constants.O_NONBLOCK ?? 0));
|
|
1359
|
+
try {
|
|
1360
|
+
const stat = await fd.stat();
|
|
1361
|
+
if (!stat.isFile()) {
|
|
1362
|
+
responses.push({
|
|
1363
|
+
path: filePath,
|
|
1364
|
+
content: null,
|
|
1365
|
+
error: stat.isDirectory() ? "is_directory" : "file_not_found"
|
|
1366
|
+
});
|
|
1367
|
+
continue;
|
|
1368
|
+
}
|
|
1369
|
+
const content = await fd.readFile();
|
|
1370
|
+
responses.push({
|
|
1371
|
+
path: filePath,
|
|
1372
|
+
content,
|
|
1373
|
+
error: null
|
|
1374
|
+
});
|
|
1375
|
+
} finally {
|
|
1376
|
+
await fd.close();
|
|
1377
|
+
}
|
|
1253
1378
|
} catch (e) {
|
|
1254
1379
|
if (e.code === "ENOENT") responses.push({
|
|
1255
1380
|
path: filePath,
|
|
@@ -1612,4 +1737,4 @@ Object.defineProperty(exports, "parseSkillMetadata", {
|
|
|
1612
1737
|
}
|
|
1613
1738
|
});
|
|
1614
1739
|
|
|
1615
|
-
//# sourceMappingURL=src-
|
|
1740
|
+
//# sourceMappingURL=src-DeLlHk9u.cjs.map
|