Revert "fix: use createRequire for sandbox-runtime lazy loading in ESM"
This reverts commit 9949c7a75a.
This commit is contained in:
1 parent
9949c7a75a
commit
57a7823c69
3 files changed
+6
-7
No files matched your search
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@shipany/open-agent-sdk",
|
||||
"version": "0.1.6",
|
||||
"version": "0.1.5",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@shipany/open-agent-sdk",
|
||||
"version": "0.1.6",
|
||||
"version": "0.1.5",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/shipany-ai/open-agent-sdk/issues"
|
||||
},
|
||||
"version": "0.1.6",
|
||||
"version": "0.1.5",
|
||||
"description": "Open-source Agent SDK inspired by @anthropic-ai/claude-agent-sdk. Runs the agent loop in-process — no local CLI required. Deploy anywhere: cloud, serverless, Docker, CI/CD.",
|
||||
"type": "module",
|
||||
"main": "./dist/sdk.js",
|
||||
|
||||
@@ -20,8 +20,6 @@ type SandboxViolationEvent = any
|
||||
// ---------------------------------------------------------------------------
|
||||
// Lazy-load @anthropic-ai/sandbox-runtime (optional dependency)
|
||||
// ---------------------------------------------------------------------------
|
||||
import { createRequire } from 'module'
|
||||
|
||||
let _sandboxModule: any = null
|
||||
let _sandboxLoadAttempted = false
|
||||
|
||||
@@ -29,8 +27,9 @@ function getSandboxModule(): any {
|
||||
if (!_sandboxLoadAttempted) {
|
||||
_sandboxLoadAttempted = true
|
||||
try {
|
||||
const _require = createRequire(import.meta.url)
|
||||
_sandboxModule = _require('@anthropic-ai/sandbox-runtime')
|
||||
// Use require so the module is resolved at call-time, not import-time.
|
||||
// This keeps the SDK functional when the package is absent.
|
||||
_sandboxModule = require('@anthropic-ai/sandbox-runtime')
|
||||
} catch {
|
||||
_sandboxModule = null
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user