zeitlich 0.2.27 → 0.2.28
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/{activities-DE3_q9yq.d.ts → activities-3xj_fEJK.d.ts} +3 -3
- package/dist/{activities-p8PDlRIK.d.cts → activities-BzYq6jf7.d.cts} +3 -3
- package/dist/adapters/sandbox/e2b/index.cjs +230 -0
- package/dist/adapters/sandbox/e2b/index.cjs.map +1 -0
- package/dist/adapters/sandbox/e2b/index.d.cts +77 -0
- package/dist/adapters/sandbox/e2b/index.d.ts +77 -0
- package/dist/adapters/sandbox/e2b/index.js +227 -0
- package/dist/adapters/sandbox/e2b/index.js.map +1 -0
- package/dist/adapters/sandbox/e2b/workflow.cjs +33 -0
- package/dist/adapters/sandbox/e2b/workflow.cjs.map +1 -0
- package/dist/adapters/sandbox/e2b/workflow.d.cts +27 -0
- package/dist/adapters/sandbox/e2b/workflow.d.ts +27 -0
- package/dist/adapters/sandbox/e2b/workflow.js +31 -0
- package/dist/adapters/sandbox/e2b/workflow.js.map +1 -0
- package/dist/adapters/sandbox/virtual/index.d.cts +4 -4
- package/dist/adapters/sandbox/virtual/index.d.ts +4 -4
- package/dist/adapters/sandbox/virtual/workflow.d.cts +2 -2
- package/dist/adapters/sandbox/virtual/workflow.d.ts +2 -2
- package/dist/adapters/thread/anthropic/index.d.cts +5 -5
- package/dist/adapters/thread/anthropic/index.d.ts +5 -5
- package/dist/adapters/thread/anthropic/workflow.d.cts +5 -5
- package/dist/adapters/thread/anthropic/workflow.d.ts +5 -5
- package/dist/adapters/thread/google-genai/index.d.cts +5 -5
- package/dist/adapters/thread/google-genai/index.d.ts +5 -5
- package/dist/adapters/thread/google-genai/workflow.d.cts +5 -5
- package/dist/adapters/thread/google-genai/workflow.d.ts +5 -5
- package/dist/adapters/thread/langchain/index.cjs +22 -10
- package/dist/adapters/thread/langchain/index.cjs.map +1 -1
- package/dist/adapters/thread/langchain/index.d.cts +12 -9
- package/dist/adapters/thread/langchain/index.d.ts +12 -9
- package/dist/adapters/thread/langchain/index.js +22 -10
- package/dist/adapters/thread/langchain/index.js.map +1 -1
- package/dist/adapters/thread/langchain/workflow.d.cts +5 -5
- package/dist/adapters/thread/langchain/workflow.d.ts +5 -5
- package/dist/index.cjs +27 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +27 -16
- package/dist/index.js.map +1 -1
- package/dist/{proxy-BK1ydQt0.d.ts → proxy-7e7v8ccg.d.ts} +1 -1
- package/dist/{proxy-BMAsMHdp.d.cts → proxy-CsB8r0RR.d.cts} +1 -1
- package/dist/{queries-DwnE2bu3.d.cts → queries-DVnukByF.d.cts} +1 -1
- package/dist/{queries-BCgJ9Sr5.d.ts → queries-kjlvsUfz.d.ts} +1 -1
- package/dist/{thread-manager-Bh9x847n.d.ts → thread-manager-B5qA4v7V.d.ts} +1 -1
- package/dist/{thread-manager-dzaJHQEA.d.ts → thread-manager-D8C5QvLi.d.ts} +1 -1
- package/dist/{thread-manager-BlHua5_v.d.cts → thread-manager-DFJ3sKKU.d.cts} +1 -1
- package/dist/{thread-manager-Bz8txKKj.d.cts → thread-manager-DdVFl1IY.d.cts} +1 -1
- package/dist/{types-CIkYBoF8.d.ts → types-BZ75HpYd.d.ts} +1 -1
- package/dist/{types-mCVxKIZb.d.cts → types-BclYm5Ic.d.cts} +0 -4
- package/dist/{types-mCVxKIZb.d.ts → types-BclYm5Ic.d.ts} +0 -4
- package/dist/{types-DRnz-OZp.d.cts → types-BgsAwN3L.d.cts} +1 -1
- package/dist/{types-CvJyXDYt.d.ts → types-BtqbM1bO.d.ts} +1 -1
- package/dist/{types-DSOefLpY.d.cts → types-BuCEZ4dF.d.cts} +1 -1
- package/dist/{types-BfIQABzu.d.cts → types-HbjqzyJH.d.cts} +1 -1
- package/dist/{types-DFUNSYbj.d.ts → types-yU5AINiP.d.ts} +1 -1
- package/dist/workflow.cjs +27 -16
- package/dist/workflow.cjs.map +1 -1
- package/dist/workflow.d.cts +7 -7
- package/dist/workflow.d.ts +7 -7
- package/dist/workflow.js +27 -16
- package/dist/workflow.js.map +1 -1
- package/package.json +21 -1
- package/src/adapters/sandbox/e2b/proxy.ts +56 -0
- package/src/adapters/thread/langchain/hooks.test.ts +195 -0
- package/src/adapters/thread/langchain/hooks.ts +29 -12
- package/src/lib/.env +1 -0
- package/src/lib/session/session.ts +16 -5
- package/src/lib/subagent/handler.ts +5 -2
- package/src/lib/subagent/register.ts +7 -2
- package/src/lib/tool-router/router.ts +2 -5
- package/src/lib/tool-router/types.ts +0 -4
- package/src/tools/bash/.env +1 -0
- package/tsup.config.ts +3 -0
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { FileType, Sandbox } from '@e2b/code-interpreter';
|
|
2
|
+
import { ApplicationFailure } from '@temporalio/common';
|
|
3
|
+
import { posix } from 'path';
|
|
4
|
+
|
|
5
|
+
// src/adapters/sandbox/e2b/index.ts
|
|
6
|
+
var SandboxNotSupportedError = class extends ApplicationFailure {
|
|
7
|
+
constructor(operation) {
|
|
8
|
+
super(
|
|
9
|
+
`Sandbox does not support: ${operation}`,
|
|
10
|
+
"SandboxNotSupportedError",
|
|
11
|
+
true
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
var SandboxNotFoundError = class extends ApplicationFailure {
|
|
16
|
+
constructor(sandboxId) {
|
|
17
|
+
super(`Sandbox not found: ${sandboxId}`, "SandboxNotFoundError", true);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
function toArrayBuffer(u8) {
|
|
21
|
+
return u8.buffer.slice(u8.byteOffset, u8.byteOffset + u8.byteLength);
|
|
22
|
+
}
|
|
23
|
+
var E2bSandboxFileSystem = class {
|
|
24
|
+
constructor(sandbox, workspaceBase = "/home/user") {
|
|
25
|
+
this.sandbox = sandbox;
|
|
26
|
+
this.workspaceBase = posix.resolve("/", workspaceBase);
|
|
27
|
+
}
|
|
28
|
+
workspaceBase;
|
|
29
|
+
normalisePath(path) {
|
|
30
|
+
return posix.resolve(this.workspaceBase, path);
|
|
31
|
+
}
|
|
32
|
+
async readFile(path) {
|
|
33
|
+
return this.sandbox.files.read(this.normalisePath(path));
|
|
34
|
+
}
|
|
35
|
+
async readFileBuffer(path) {
|
|
36
|
+
return this.sandbox.files.read(this.normalisePath(path), {
|
|
37
|
+
format: "bytes"
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
async writeFile(path, content) {
|
|
41
|
+
const norm = this.normalisePath(path);
|
|
42
|
+
if (typeof content === "string") {
|
|
43
|
+
await this.sandbox.files.write(norm, content);
|
|
44
|
+
} else {
|
|
45
|
+
await this.sandbox.files.write(norm, toArrayBuffer(content));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
async appendFile(path, content) {
|
|
49
|
+
const norm = this.normalisePath(path);
|
|
50
|
+
let existing = "";
|
|
51
|
+
try {
|
|
52
|
+
existing = await this.sandbox.files.read(norm);
|
|
53
|
+
} catch {
|
|
54
|
+
}
|
|
55
|
+
const addition = typeof content === "string" ? content : new TextDecoder().decode(content);
|
|
56
|
+
await this.sandbox.files.write(norm, existing + addition);
|
|
57
|
+
}
|
|
58
|
+
async exists(path) {
|
|
59
|
+
return this.sandbox.files.exists(this.normalisePath(path));
|
|
60
|
+
}
|
|
61
|
+
async stat(path) {
|
|
62
|
+
const norm = this.normalisePath(path);
|
|
63
|
+
const info = await this.sandbox.files.getInfo(norm);
|
|
64
|
+
const isSymlink = !!info.symlinkTarget;
|
|
65
|
+
return {
|
|
66
|
+
isFile: isSymlink ? false : info.type === FileType.FILE,
|
|
67
|
+
isDirectory: isSymlink ? false : info.type === FileType.DIR,
|
|
68
|
+
isSymbolicLink: isSymlink,
|
|
69
|
+
size: info.size,
|
|
70
|
+
mtime: info.modifiedTime ?? /* @__PURE__ */ new Date(0)
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
async mkdir(path, _options) {
|
|
74
|
+
await this.sandbox.files.makeDir(this.normalisePath(path));
|
|
75
|
+
}
|
|
76
|
+
async readdir(path) {
|
|
77
|
+
const entries = await this.sandbox.files.list(this.normalisePath(path));
|
|
78
|
+
return entries.map((e) => posix.basename(e.path));
|
|
79
|
+
}
|
|
80
|
+
async readdirWithFileTypes(path) {
|
|
81
|
+
const entries = await this.sandbox.files.list(this.normalisePath(path));
|
|
82
|
+
return entries.map((e) => {
|
|
83
|
+
const isSymlink = !!e.symlinkTarget;
|
|
84
|
+
return {
|
|
85
|
+
name: posix.basename(e.path),
|
|
86
|
+
isFile: isSymlink ? false : e.type === FileType.FILE,
|
|
87
|
+
isDirectory: isSymlink ? false : e.type === FileType.DIR,
|
|
88
|
+
isSymbolicLink: isSymlink
|
|
89
|
+
};
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
async rm(path, options) {
|
|
93
|
+
const norm = this.normalisePath(path);
|
|
94
|
+
try {
|
|
95
|
+
await this.sandbox.files.remove(norm);
|
|
96
|
+
} catch (err) {
|
|
97
|
+
if (!options?.force) throw err;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
async cp(src, dest, _options) {
|
|
101
|
+
const normSrc = this.normalisePath(src);
|
|
102
|
+
const normDest = this.normalisePath(dest);
|
|
103
|
+
await this.sandbox.commands.run(`cp -r "${normSrc}" "${normDest}"`);
|
|
104
|
+
}
|
|
105
|
+
async mv(src, dest) {
|
|
106
|
+
const normSrc = this.normalisePath(src);
|
|
107
|
+
const normDest = this.normalisePath(dest);
|
|
108
|
+
await this.sandbox.files.rename(normSrc, normDest);
|
|
109
|
+
}
|
|
110
|
+
async readlink(path) {
|
|
111
|
+
const norm = this.normalisePath(path);
|
|
112
|
+
const info = await this.sandbox.files.getInfo(norm);
|
|
113
|
+
if (!info.symlinkTarget) {
|
|
114
|
+
throw new Error(`EINVAL: invalid argument, readlink '${path}'`);
|
|
115
|
+
}
|
|
116
|
+
return info.symlinkTarget;
|
|
117
|
+
}
|
|
118
|
+
resolvePath(base, path) {
|
|
119
|
+
return posix.resolve(this.normalisePath(base), path);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
// src/adapters/sandbox/e2b/index.ts
|
|
124
|
+
var E2bSandboxImpl = class {
|
|
125
|
+
constructor(id, sdkSandbox, workspaceBase = "/home/user") {
|
|
126
|
+
this.id = id;
|
|
127
|
+
this.sdkSandbox = sdkSandbox;
|
|
128
|
+
this.fs = new E2bSandboxFileSystem(sdkSandbox, workspaceBase);
|
|
129
|
+
}
|
|
130
|
+
capabilities = {
|
|
131
|
+
filesystem: true,
|
|
132
|
+
execution: true,
|
|
133
|
+
persistence: true
|
|
134
|
+
};
|
|
135
|
+
fs;
|
|
136
|
+
async exec(command, options) {
|
|
137
|
+
const result = await this.sdkSandbox.commands.run(command, {
|
|
138
|
+
cwd: options?.cwd,
|
|
139
|
+
envs: options?.env,
|
|
140
|
+
timeoutMs: options?.timeout
|
|
141
|
+
});
|
|
142
|
+
return {
|
|
143
|
+
exitCode: result.exitCode,
|
|
144
|
+
stdout: result.stdout,
|
|
145
|
+
stderr: result.stderr
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
async destroy() {
|
|
149
|
+
await this.sdkSandbox.kill();
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
var E2bSandboxProvider = class {
|
|
153
|
+
id = "e2b";
|
|
154
|
+
capabilities = {
|
|
155
|
+
filesystem: true,
|
|
156
|
+
execution: true,
|
|
157
|
+
persistence: true
|
|
158
|
+
};
|
|
159
|
+
defaultTemplate;
|
|
160
|
+
defaultWorkspaceBase;
|
|
161
|
+
defaultTimeoutMs;
|
|
162
|
+
constructor(config) {
|
|
163
|
+
this.defaultTemplate = config?.template;
|
|
164
|
+
this.defaultWorkspaceBase = config?.workspaceBase ?? "/home/user";
|
|
165
|
+
this.defaultTimeoutMs = config?.timeoutMs;
|
|
166
|
+
}
|
|
167
|
+
async create(options) {
|
|
168
|
+
const template = options?.template ?? this.defaultTemplate;
|
|
169
|
+
const workspaceBase = this.defaultWorkspaceBase;
|
|
170
|
+
const createOpts = {
|
|
171
|
+
envs: options?.env,
|
|
172
|
+
timeoutMs: options?.timeoutMs ?? this.defaultTimeoutMs
|
|
173
|
+
};
|
|
174
|
+
const sdkSandbox = template ? await Sandbox.create(template, createOpts) : await Sandbox.create(createOpts);
|
|
175
|
+
const sandbox = new E2bSandboxImpl(
|
|
176
|
+
sdkSandbox.sandboxId,
|
|
177
|
+
sdkSandbox,
|
|
178
|
+
workspaceBase
|
|
179
|
+
);
|
|
180
|
+
if (options?.initialFiles) {
|
|
181
|
+
await Promise.all(
|
|
182
|
+
Object.entries(options.initialFiles).map(
|
|
183
|
+
([path, content]) => sandbox.fs.writeFile(path, content)
|
|
184
|
+
)
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
return { sandbox };
|
|
188
|
+
}
|
|
189
|
+
async get(sandboxId) {
|
|
190
|
+
try {
|
|
191
|
+
const sdkSandbox = await Sandbox.connect(sandboxId);
|
|
192
|
+
return new E2bSandboxImpl(sandboxId, sdkSandbox, this.defaultWorkspaceBase);
|
|
193
|
+
} catch {
|
|
194
|
+
throw new SandboxNotFoundError(sandboxId);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
async destroy(sandboxId) {
|
|
198
|
+
try {
|
|
199
|
+
const sdkSandbox = await Sandbox.connect(sandboxId);
|
|
200
|
+
await sdkSandbox.kill();
|
|
201
|
+
} catch {
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
async pause(sandboxId, _ttlSeconds) {
|
|
205
|
+
const sdkSandbox = await Sandbox.connect(sandboxId);
|
|
206
|
+
await sdkSandbox.pause();
|
|
207
|
+
}
|
|
208
|
+
async snapshot(_sandboxId) {
|
|
209
|
+
throw new SandboxNotSupportedError("snapshot");
|
|
210
|
+
}
|
|
211
|
+
async restore(_snapshot) {
|
|
212
|
+
throw new SandboxNotSupportedError("restore");
|
|
213
|
+
}
|
|
214
|
+
async fork(sandboxId) {
|
|
215
|
+
const { snapshotId } = await Sandbox.createSnapshot(sandboxId);
|
|
216
|
+
const sdkSandbox = await Sandbox.create(snapshotId);
|
|
217
|
+
return new E2bSandboxImpl(
|
|
218
|
+
sdkSandbox.sandboxId,
|
|
219
|
+
sdkSandbox,
|
|
220
|
+
this.defaultWorkspaceBase
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
export { E2bSandboxFileSystem, E2bSandboxProvider };
|
|
226
|
+
//# sourceMappingURL=index.js.map
|
|
227
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/sandbox/types.ts","../../../../src/adapters/sandbox/e2b/filesystem.ts","../../../../src/adapters/sandbox/e2b/index.ts"],"names":["E2bSdkSandbox"],"mappings":";;;;;AAkLO,IAAM,wBAAA,GAAN,cAAuC,kBAAA,CAAmB;AAAA,EAC/D,YAAY,SAAA,EAAmB;AAC7B,IAAA,KAAA;AAAA,MACE,6BAA6B,SAAS,CAAA,CAAA;AAAA,MACtC,0BAAA;AAAA,MACA;AAAA,KACF;AAAA,EACF;AACF,CAAA;AAEO,IAAM,oBAAA,GAAN,cAAmC,kBAAA,CAAmB;AAAA,EAC3D,YAAY,SAAA,EAAmB;AAC7B,IAAA,KAAA,CAAM,CAAA,mBAAA,EAAsB,SAAS,CAAA,CAAA,EAAI,sBAAA,EAAwB,IAAI,CAAA;AAAA,EACvE;AACF,CAAA;ACxLA,SAAS,cAAc,EAAA,EAA6B;AAClD,EAAA,OAAO,EAAA,CAAG,OAAO,KAAA,CAAM,EAAA,CAAG,YAAY,EAAA,CAAG,UAAA,GAAa,GAAG,UAAU,CAAA;AACrE;AASO,IAAM,uBAAN,MAAwD;AAAA,EAG7D,WAAA,CACU,OAAA,EACR,aAAA,GAAgB,YAAA,EAChB;AAFQ,IAAA,IAAA,CAAA,OAAA,GAAA,OAAA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UAAA,GAAa,MAAMA,OAAA,CAAc,OAAA,CAAQ,SAAS,CAAA;AACxD,MAAA,MAAM,WAAW,IAAA,EAAK;AAAA,IACxB,CAAA,CAAA,MAAQ;AAAA,IAER;AAAA,EACF;AAAA,EAEA,MAAM,KAAA,CAAM,SAAA,EAAmB,WAAA,EAAqC;AAClE,IAAA,MAAM,UAAA,GAAa,MAAMA,OAAA,CAAc,OAAA,CAAQ,SAAS,CAAA;AACxD,IAAA,MAAM,WAAW,KAAA,EAAM;AAAA,EACzB;AAAA,EAEA,MAAM,SAAS,UAAA,EAA8C;AAC3D,IAAA,MAAM,IAAI,yBAAyB,UAAU,CAAA;AAAA,EAC/C;AAAA,EAEA,MAAM,QAAQ,SAAA,EAA8C;AAC1D,IAAA,MAAM,IAAI,yBAAyB,SAAS,CAAA;AAAA,EAC9C;AAAA,EAEA,MAAM,KAAK,SAAA,EAAqC;AAC9C,IAAA,MAAM,EAAE,UAAA,EAAW,GAAI,MAAMA,OAAA,CAAc,eAAe,SAAS,CAAA;AACnE,IAAA,MAAM,UAAA,GAAa,MAAMA,OAAA,CAAc,MAAA,CAAO,UAAU,CAAA;AACxD,IAAA,OAAO,IAAI,cAAA;AAAA,MACT,UAAA,CAAW,SAAA;AAAA,MACX,UAAA;AAAA,MACA,IAAA,CAAK;AAAA,KACP;AAAA,EACF;AACF","file":"index.js","sourcesContent":["// ============================================================================\n// Sandbox Filesystem\n// ============================================================================\n\nexport interface DirentEntry {\n name: string;\n isFile: boolean;\n isDirectory: boolean;\n isSymbolicLink: boolean;\n}\n\nexport interface FileStat {\n isFile: boolean;\n isDirectory: boolean;\n isSymbolicLink: boolean;\n size: number;\n mtime: Date;\n}\n\n/**\n * Provider-agnostic filesystem interface.\n *\n * Implementations that don't support a method should throw\n * {@link SandboxNotSupportedError}.\n */\nexport interface SandboxFileSystem {\n /** Base directory used when resolving relative paths. */\n readonly workspaceBase: string;\n readFile(path: string): Promise<string>;\n readFileBuffer(path: string): Promise<Uint8Array>;\n writeFile(path: string, content: string | Uint8Array): Promise<void>;\n appendFile(path: string, content: string | Uint8Array): Promise<void>;\n exists(path: string): Promise<boolean>;\n stat(path: string): Promise<FileStat>;\n mkdir(path: string, options?: { recursive?: boolean }): Promise<void>;\n readdir(path: string): Promise<string[]>;\n readdirWithFileTypes(path: string): Promise<DirentEntry[]>;\n rm(\n path: string,\n options?: { recursive?: boolean; force?: boolean }\n ): Promise<void>;\n cp(\n src: string,\n dest: string,\n options?: { recursive?: boolean }\n ): Promise<void>;\n mv(src: string, dest: string): Promise<void>;\n readlink(path: string): Promise<string>;\n resolvePath(base: string, path: string): string;\n}\n\n// ============================================================================\n// Execution\n// ============================================================================\n\nexport interface ExecOptions {\n timeout?: number;\n cwd?: string;\n env?: Record<string, string>;\n}\n\nexport interface ExecResult {\n exitCode: number;\n stdout: string;\n stderr: string;\n}\n\n// ============================================================================\n// Capabilities\n// ============================================================================\n\nexport interface SandboxCapabilities {\n /** Sandbox supports filesystem operations */\n filesystem: boolean;\n /** Sandbox supports shell/command execution */\n execution: boolean;\n /** Sandbox state can be persisted and restored */\n persistence: boolean;\n}\n\n// ============================================================================\n// Sandbox\n// ============================================================================\n\nexport interface Sandbox {\n readonly id: string;\n readonly capabilities: SandboxCapabilities;\n readonly fs: SandboxFileSystem;\n\n exec(command: string, options?: ExecOptions): Promise<ExecResult>;\n destroy(): Promise<void>;\n}\n\n// ============================================================================\n// Snapshots\n// ============================================================================\n\nexport interface SandboxSnapshot {\n sandboxId: string;\n providerId: string;\n /** Provider-specific serialised state */\n data: unknown;\n createdAt: string;\n}\n\n// ============================================================================\n// Provider\n// ============================================================================\n\nexport interface SandboxCreateOptions {\n /** Preferred sandbox ID (provider may ignore) */\n id?: string;\n /** Seed the filesystem with these files */\n initialFiles?: Record<string, string | Uint8Array>;\n /** Environment variables available inside the sandbox */\n env?: Record<string, string>;\n}\n\nexport interface SandboxCreateResult {\n sandbox: Sandbox;\n /** Optional state to merge into the workflow's `AgentState` via the session. */\n stateUpdate?: Record<string, unknown>;\n}\n\nexport interface SandboxProvider<\n TOptions extends SandboxCreateOptions = SandboxCreateOptions,\n TSandbox extends Sandbox = Sandbox,\n> {\n readonly id: string;\n readonly capabilities: SandboxCapabilities;\n\n create(options?: TOptions): Promise<SandboxCreateResult>;\n get(sandboxId: string): Promise<TSandbox>;\n destroy(sandboxId: string): Promise<void>;\n pause(sandboxId: string, ttlSeconds?: number): Promise<void>;\n snapshot(sandboxId: string): Promise<SandboxSnapshot>;\n restore(snapshot: SandboxSnapshot): Promise<Sandbox>;\n fork(sandboxId: string): Promise<Sandbox>;\n}\n\n// ============================================================================\n// SandboxOps — workflow-side activity interface (like ThreadOps)\n// ============================================================================\n\nexport interface SandboxOps<\n TOptions extends SandboxCreateOptions = SandboxCreateOptions,\n> {\n createSandbox(\n options?: TOptions\n ): Promise<{ sandboxId: string; stateUpdate?: Record<string, unknown> }>;\n destroySandbox(sandboxId: string): Promise<void>;\n pauseSandbox(sandboxId: string): Promise<void>;\n snapshotSandbox(sandboxId: string): Promise<SandboxSnapshot>;\n forkSandbox(sandboxId: string): Promise<string>;\n}\n\n/**\n * Maps generic {@link SandboxOps} method names to adapter-prefixed names.\n *\n * @example\n * ```typescript\n * type InMemOps = PrefixedSandboxOps<\"inMemory\">;\n * // → { inMemoryCreateSandbox, inMemoryDestroySandbox, inMemorySnapshotSandbox }\n * ```\n */\nexport type PrefixedSandboxOps<\n TPrefix extends string,\n TOptions extends SandboxCreateOptions = SandboxCreateOptions,\n> = {\n [K in keyof SandboxOps<TOptions> as `${TPrefix}${Capitalize<K & string>}`]: SandboxOps<TOptions>[K];\n};\n\n// ============================================================================\n// Errors\n// ============================================================================\n\nimport { ApplicationFailure } from \"@temporalio/common\";\n\nexport class SandboxNotSupportedError extends ApplicationFailure {\n constructor(operation: string) {\n super(\n `Sandbox does not support: ${operation}`,\n \"SandboxNotSupportedError\",\n true\n );\n }\n}\n\nexport class SandboxNotFoundError extends ApplicationFailure {\n constructor(sandboxId: string) {\n super(`Sandbox not found: ${sandboxId}`, \"SandboxNotFoundError\", true);\n }\n}\n","import { FileType, type Sandbox as E2bSdkSandbox } from \"@e2b/code-interpreter\";\nimport type {\n SandboxFileSystem,\n DirentEntry,\n FileStat,\n} from \"../../../lib/sandbox/types\";\nimport { posix } from \"node:path\";\n\nfunction toArrayBuffer(u8: Uint8Array): ArrayBuffer {\n return u8.buffer.slice(u8.byteOffset, u8.byteOffset + u8.byteLength) as ArrayBuffer;\n}\n\n/**\n * {@link SandboxFileSystem} backed by an E2B SDK sandbox.\n *\n * Maps zeitlich's filesystem interface to E2B's `sandbox.files` and\n * `sandbox.commands` APIs. Operations that have no direct E2B equivalent\n * (e.g. `appendFile`, `cp`) are composed from primitives.\n */\nexport class E2bSandboxFileSystem implements SandboxFileSystem {\n readonly workspaceBase: string;\n\n constructor(\n private sandbox: E2bSdkSandbox,\n workspaceBase = \"/home/user\"\n ) {\n this.workspaceBase = posix.resolve(\"/\", workspaceBase);\n }\n\n private normalisePath(path: string): string {\n return posix.resolve(this.workspaceBase, path);\n }\n\n async readFile(path: string): Promise<string> {\n return this.sandbox.files.read(this.normalisePath(path));\n }\n\n async readFileBuffer(path: string): Promise<Uint8Array> {\n return this.sandbox.files.read(this.normalisePath(path), {\n format: \"bytes\",\n });\n }\n\n async writeFile(path: string, content: string | Uint8Array): Promise<void> {\n const norm = this.normalisePath(path);\n if (typeof content === \"string\") {\n await this.sandbox.files.write(norm, content);\n } else {\n await this.sandbox.files.write(norm, toArrayBuffer(content));\n }\n }\n\n async appendFile(path: string, content: string | Uint8Array): Promise<void> {\n const norm = this.normalisePath(path);\n let existing = \"\";\n try {\n existing = await this.sandbox.files.read(norm);\n } catch {\n // file doesn't exist yet — write from scratch\n }\n const addition =\n typeof content === \"string\"\n ? content\n : new TextDecoder().decode(content);\n await this.sandbox.files.write(norm, existing + addition);\n }\n\n async exists(path: string): Promise<boolean> {\n return this.sandbox.files.exists(this.normalisePath(path));\n }\n\n async stat(path: string): Promise<FileStat> {\n const norm = this.normalisePath(path);\n const info = await this.sandbox.files.getInfo(norm);\n const isSymlink = !!info.symlinkTarget;\n return {\n isFile: isSymlink ? false : info.type === FileType.FILE,\n isDirectory: isSymlink ? false : info.type === FileType.DIR,\n isSymbolicLink: isSymlink,\n size: info.size,\n mtime: info.modifiedTime ?? new Date(0),\n };\n }\n\n async mkdir(path: string, _options?: { recursive?: boolean }): Promise<void> {\n await this.sandbox.files.makeDir(this.normalisePath(path));\n }\n\n async readdir(path: string): Promise<string[]> {\n const entries = await this.sandbox.files.list(this.normalisePath(path));\n return entries.map((e) => posix.basename(e.path));\n }\n\n async readdirWithFileTypes(path: string): Promise<DirentEntry[]> {\n const entries = await this.sandbox.files.list(this.normalisePath(path));\n return entries.map((e) => {\n const isSymlink = !!e.symlinkTarget;\n return {\n name: posix.basename(e.path),\n isFile: isSymlink ? false : e.type === FileType.FILE,\n isDirectory: isSymlink ? false : e.type === FileType.DIR,\n isSymbolicLink: isSymlink,\n };\n });\n }\n\n async rm(\n path: string,\n options?: { recursive?: boolean; force?: boolean }\n ): Promise<void> {\n const norm = this.normalisePath(path);\n try {\n await this.sandbox.files.remove(norm);\n } catch (err) {\n if (!options?.force) throw err;\n }\n }\n\n async cp(\n src: string,\n dest: string,\n _options?: { recursive?: boolean }\n ): Promise<void> {\n const normSrc = this.normalisePath(src);\n const normDest = this.normalisePath(dest);\n await this.sandbox.commands.run(`cp -r \"${normSrc}\" \"${normDest}\"`);\n }\n\n async mv(src: string, dest: string): Promise<void> {\n const normSrc = this.normalisePath(src);\n const normDest = this.normalisePath(dest);\n await this.sandbox.files.rename(normSrc, normDest);\n }\n\n async readlink(path: string): Promise<string> {\n const norm = this.normalisePath(path);\n const info = await this.sandbox.files.getInfo(norm);\n if (!info.symlinkTarget) {\n throw new Error(`EINVAL: invalid argument, readlink '${path}'`);\n }\n return info.symlinkTarget;\n }\n\n resolvePath(base: string, path: string): string {\n return posix.resolve(this.normalisePath(base), path);\n }\n}\n","import { Sandbox as E2bSdkSandbox } from \"@e2b/code-interpreter\";\nimport type {\n Sandbox,\n SandboxCapabilities,\n SandboxCreateResult,\n SandboxProvider,\n SandboxSnapshot,\n ExecOptions,\n ExecResult,\n} from \"../../../lib/sandbox/types\";\nimport {\n SandboxNotFoundError,\n SandboxNotSupportedError,\n} from \"../../../lib/sandbox/types\";\nimport { E2bSandboxFileSystem } from \"./filesystem\";\nimport type {\n E2bSandbox,\n E2bSandboxConfig,\n E2bSandboxCreateOptions,\n} from \"./types\";\n\n// ============================================================================\n// E2bSandbox\n// ============================================================================\n\nclass E2bSandboxImpl implements Sandbox {\n readonly capabilities: SandboxCapabilities = {\n filesystem: true,\n execution: true,\n persistence: true,\n };\n\n readonly fs: E2bSandboxFileSystem;\n\n constructor(\n readonly id: string,\n private sdkSandbox: E2bSdkSandbox,\n workspaceBase = \"/home/user\"\n ) {\n this.fs = new E2bSandboxFileSystem(sdkSandbox, workspaceBase);\n }\n\n async exec(command: string, options?: ExecOptions): Promise<ExecResult> {\n const result = await this.sdkSandbox.commands.run(command, {\n cwd: options?.cwd,\n envs: options?.env,\n timeoutMs: options?.timeout,\n });\n return {\n exitCode: result.exitCode,\n stdout: result.stdout,\n stderr: result.stderr,\n };\n }\n\n async destroy(): Promise<void> {\n await this.sdkSandbox.kill();\n }\n}\n\n// ============================================================================\n// E2bSandboxProvider\n// ============================================================================\n\nexport class E2bSandboxProvider\n implements SandboxProvider<E2bSandboxCreateOptions, E2bSandbox>\n{\n readonly id = \"e2b\";\n readonly capabilities: SandboxCapabilities = {\n filesystem: true,\n execution: true,\n persistence: true,\n };\n\n private readonly defaultTemplate?: string;\n private readonly defaultWorkspaceBase: string;\n private readonly defaultTimeoutMs?: number;\n\n constructor(config?: E2bSandboxConfig) {\n this.defaultTemplate = config?.template;\n this.defaultWorkspaceBase = config?.workspaceBase ?? \"/home/user\";\n this.defaultTimeoutMs = config?.timeoutMs;\n }\n\n async create(\n options?: E2bSandboxCreateOptions\n ): Promise<SandboxCreateResult> {\n const template = options?.template ?? this.defaultTemplate;\n const workspaceBase = this.defaultWorkspaceBase;\n const createOpts = {\n envs: options?.env,\n timeoutMs: options?.timeoutMs ?? this.defaultTimeoutMs,\n };\n\n const sdkSandbox = template\n ? await E2bSdkSandbox.create(template, createOpts)\n : await E2bSdkSandbox.create(createOpts);\n\n const sandbox = new E2bSandboxImpl(\n sdkSandbox.sandboxId,\n sdkSandbox,\n workspaceBase\n );\n\n if (options?.initialFiles) {\n await Promise.all(\n Object.entries(options.initialFiles).map(([path, content]) =>\n sandbox.fs.writeFile(path, content)\n )\n );\n }\n\n return { sandbox };\n }\n\n async get(sandboxId: string): Promise<E2bSandbox> {\n try {\n const sdkSandbox = await E2bSdkSandbox.connect(sandboxId);\n return new E2bSandboxImpl(sandboxId, sdkSandbox, this.defaultWorkspaceBase);\n } catch {\n throw new SandboxNotFoundError(sandboxId);\n }\n }\n\n async destroy(sandboxId: string): Promise<void> {\n try {\n const sdkSandbox = await E2bSdkSandbox.connect(sandboxId);\n await sdkSandbox.kill();\n } catch {\n // Already gone or not found\n }\n }\n\n async pause(sandboxId: string, _ttlSeconds?: number): Promise<void> {\n const sdkSandbox = await E2bSdkSandbox.connect(sandboxId);\n await sdkSandbox.pause();\n }\n\n async snapshot(_sandboxId: string): Promise<SandboxSnapshot> {\n throw new SandboxNotSupportedError(\"snapshot\");\n }\n\n async restore(_snapshot: SandboxSnapshot): Promise<Sandbox> {\n throw new SandboxNotSupportedError(\"restore\");\n }\n\n async fork(sandboxId: string): Promise<Sandbox> {\n const { snapshotId } = await E2bSdkSandbox.createSnapshot(sandboxId);\n const sdkSandbox = await E2bSdkSandbox.create(snapshotId);\n return new E2bSandboxImpl(\n sdkSandbox.sandboxId,\n sdkSandbox,\n this.defaultWorkspaceBase\n );\n }\n}\n\n// Re-exports\nexport { E2bSandboxFileSystem } from \"./filesystem\";\nexport type {\n E2bSandbox,\n E2bSandboxConfig,\n E2bSandboxCreateOptions,\n} from \"./types\";\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var workflow = require('@temporalio/workflow');
|
|
4
|
+
|
|
5
|
+
// src/adapters/sandbox/e2b/proxy.ts
|
|
6
|
+
var ADAPTER_PREFIX = "e2b";
|
|
7
|
+
function proxyE2bSandboxOps(scope, options) {
|
|
8
|
+
const resolvedScope = scope ?? workflow.workflowInfo().workflowType;
|
|
9
|
+
const acts = workflow.proxyActivities(
|
|
10
|
+
options ?? {
|
|
11
|
+
startToCloseTimeout: "120s",
|
|
12
|
+
retry: {
|
|
13
|
+
maximumAttempts: 3,
|
|
14
|
+
initialInterval: "5s",
|
|
15
|
+
maximumInterval: "60s",
|
|
16
|
+
backoffCoefficient: 3
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
const prefix = `${ADAPTER_PREFIX}${resolvedScope.charAt(0).toUpperCase()}${resolvedScope.slice(1)}`;
|
|
21
|
+
const p = (key) => `${prefix}${key.charAt(0).toUpperCase()}${key.slice(1)}`;
|
|
22
|
+
return {
|
|
23
|
+
createSandbox: acts[p("createSandbox")],
|
|
24
|
+
destroySandbox: acts[p("destroySandbox")],
|
|
25
|
+
pauseSandbox: acts[p("pauseSandbox")],
|
|
26
|
+
snapshotSandbox: acts[p("snapshotSandbox")],
|
|
27
|
+
forkSandbox: acts[p("forkSandbox")]
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
exports.proxyE2bSandboxOps = proxyE2bSandboxOps;
|
|
32
|
+
//# sourceMappingURL=workflow.cjs.map
|
|
33
|
+
//# sourceMappingURL=workflow.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/adapters/sandbox/e2b/proxy.ts"],"names":["workflowInfo","proxyActivities"],"mappings":";;;;;AAuBA,IAAM,cAAA,GAAiB,KAAA;AAEhB,SAAS,kBAAA,CACd,OACA,OAAA,EACY;AACZ,EAAA,MAAM,aAAA,GAAgB,KAAA,IAASA,qBAAA,EAAa,CAAE,YAAA;AAG9C,EAAA,MAAM,IAAA,GAAOC,wBAAA;AAAA,IACX,OAAA,IAAW;AAAA,MACT,mBAAA,EAAqB,MAAA;AAAA,MACrB,KAAA,EAAO;AAAA,QACL,eAAA,EAAiB,CAAA;AAAA,QACjB,eAAA,EAAiB,IAAA;AAAA,QACjB,eAAA,EAAiB,KAAA;AAAA,QACjB,kBAAA,EAAoB;AAAA;AACtB;AACF,GACF;AAEA,EAAA,MAAM,MAAA,GAAS,CAAA,EAAG,cAAc,CAAA,EAAG,cAAc,MAAA,CAAO,CAAC,CAAA,CAAE,WAAA,EAAa,CAAA,EAAG,aAAA,CAAc,KAAA,CAAM,CAAC,CAAC,CAAA,CAAA;AACjG,EAAA,MAAM,IAAI,CAAC,GAAA,KACT,CAAA,EAAG,MAAM,GAAG,GAAA,CAAI,MAAA,CAAO,CAAC,CAAA,CAAE,aAAa,CAAA,EAAG,GAAA,CAAI,KAAA,CAAM,CAAC,CAAC,CAAA,CAAA;AAExD,EAAA,OAAO;AAAA,IACL,aAAA,EAAe,IAAA,CAAK,CAAA,CAAE,eAAe,CAAC,CAAA;AAAA,IACtC,cAAA,EAAgB,IAAA,CAAK,CAAA,CAAE,gBAAgB,CAAC,CAAA;AAAA,IACxC,YAAA,EAAc,IAAA,CAAK,CAAA,CAAE,cAAc,CAAC,CAAA;AAAA,IACpC,eAAA,EAAiB,IAAA,CAAK,CAAA,CAAE,iBAAiB,CAAC,CAAA;AAAA,IAC1C,WAAA,EAAa,IAAA,CAAK,CAAA,CAAE,aAAa,CAAC;AAAA,GACpC;AACF","file":"workflow.cjs","sourcesContent":["/**\n * Workflow-safe proxy for E2B sandbox operations.\n *\n * Uses longer timeouts than in-memory providers since E2B\n * sandboxes are remote and creation involves provisioning.\n *\n * Import this from `zeitlich/adapters/sandbox/e2b/workflow`\n * in your Temporal workflow files.\n *\n * By default the scope is derived from `workflowInfo().workflowType`,\n * so activities are automatically namespaced per workflow.\n *\n * @example\n * ```typescript\n * import { proxyE2bSandboxOps } from 'zeitlich/adapters/sandbox/e2b/workflow';\n *\n * const sandbox = proxyE2bSandboxOps();\n * ```\n */\nimport { proxyActivities, workflowInfo } from \"@temporalio/workflow\";\nimport type { SandboxOps } from \"../../../lib/sandbox/types\";\nimport type { E2bSandboxCreateOptions } from \"./types\";\n\nconst ADAPTER_PREFIX = \"e2b\";\n\nexport function proxyE2bSandboxOps(\n scope?: string,\n options?: Parameters<typeof proxyActivities>[0]\n): SandboxOps {\n const resolvedScope = scope ?? workflowInfo().workflowType;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const acts = proxyActivities<Record<string, (...args: any[]) => any>>(\n options ?? {\n startToCloseTimeout: \"120s\",\n retry: {\n maximumAttempts: 3,\n initialInterval: \"5s\",\n maximumInterval: \"60s\",\n backoffCoefficient: 3,\n },\n }\n );\n\n const prefix = `${ADAPTER_PREFIX}${resolvedScope.charAt(0).toUpperCase()}${resolvedScope.slice(1)}`;\n const p = (key: string): string =>\n `${prefix}${key.charAt(0).toUpperCase()}${key.slice(1)}`;\n\n return {\n createSandbox: acts[p(\"createSandbox\")],\n destroySandbox: acts[p(\"destroySandbox\")],\n pauseSandbox: acts[p(\"pauseSandbox\")],\n snapshotSandbox: acts[p(\"snapshotSandbox\")],\n forkSandbox: acts[p(\"forkSandbox\")],\n } as SandboxOps<E2bSandboxCreateOptions>;\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { proxyActivities } from '@temporalio/workflow';
|
|
2
|
+
import { g as SandboxOps } from '../../../types-ChAMwU3q.cjs';
|
|
3
|
+
import '@temporalio/common';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Workflow-safe proxy for E2B sandbox operations.
|
|
7
|
+
*
|
|
8
|
+
* Uses longer timeouts than in-memory providers since E2B
|
|
9
|
+
* sandboxes are remote and creation involves provisioning.
|
|
10
|
+
*
|
|
11
|
+
* Import this from `zeitlich/adapters/sandbox/e2b/workflow`
|
|
12
|
+
* in your Temporal workflow files.
|
|
13
|
+
*
|
|
14
|
+
* By default the scope is derived from `workflowInfo().workflowType`,
|
|
15
|
+
* so activities are automatically namespaced per workflow.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* import { proxyE2bSandboxOps } from 'zeitlich/adapters/sandbox/e2b/workflow';
|
|
20
|
+
*
|
|
21
|
+
* const sandbox = proxyE2bSandboxOps();
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
declare function proxyE2bSandboxOps(scope?: string, options?: Parameters<typeof proxyActivities>[0]): SandboxOps;
|
|
26
|
+
|
|
27
|
+
export { proxyE2bSandboxOps };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { proxyActivities } from '@temporalio/workflow';
|
|
2
|
+
import { g as SandboxOps } from '../../../types-ChAMwU3q.js';
|
|
3
|
+
import '@temporalio/common';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Workflow-safe proxy for E2B sandbox operations.
|
|
7
|
+
*
|
|
8
|
+
* Uses longer timeouts than in-memory providers since E2B
|
|
9
|
+
* sandboxes are remote and creation involves provisioning.
|
|
10
|
+
*
|
|
11
|
+
* Import this from `zeitlich/adapters/sandbox/e2b/workflow`
|
|
12
|
+
* in your Temporal workflow files.
|
|
13
|
+
*
|
|
14
|
+
* By default the scope is derived from `workflowInfo().workflowType`,
|
|
15
|
+
* so activities are automatically namespaced per workflow.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* import { proxyE2bSandboxOps } from 'zeitlich/adapters/sandbox/e2b/workflow';
|
|
20
|
+
*
|
|
21
|
+
* const sandbox = proxyE2bSandboxOps();
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
declare function proxyE2bSandboxOps(scope?: string, options?: Parameters<typeof proxyActivities>[0]): SandboxOps;
|
|
26
|
+
|
|
27
|
+
export { proxyE2bSandboxOps };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { workflowInfo, proxyActivities } from '@temporalio/workflow';
|
|
2
|
+
|
|
3
|
+
// src/adapters/sandbox/e2b/proxy.ts
|
|
4
|
+
var ADAPTER_PREFIX = "e2b";
|
|
5
|
+
function proxyE2bSandboxOps(scope, options) {
|
|
6
|
+
const resolvedScope = scope ?? workflowInfo().workflowType;
|
|
7
|
+
const acts = proxyActivities(
|
|
8
|
+
options ?? {
|
|
9
|
+
startToCloseTimeout: "120s",
|
|
10
|
+
retry: {
|
|
11
|
+
maximumAttempts: 3,
|
|
12
|
+
initialInterval: "5s",
|
|
13
|
+
maximumInterval: "60s",
|
|
14
|
+
backoffCoefficient: 3
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
const prefix = `${ADAPTER_PREFIX}${resolvedScope.charAt(0).toUpperCase()}${resolvedScope.slice(1)}`;
|
|
19
|
+
const p = (key) => `${prefix}${key.charAt(0).toUpperCase()}${key.slice(1)}`;
|
|
20
|
+
return {
|
|
21
|
+
createSandbox: acts[p("createSandbox")],
|
|
22
|
+
destroySandbox: acts[p("destroySandbox")],
|
|
23
|
+
pauseSandbox: acts[p("pauseSandbox")],
|
|
24
|
+
snapshotSandbox: acts[p("snapshotSandbox")],
|
|
25
|
+
forkSandbox: acts[p("forkSandbox")]
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { proxyE2bSandboxOps };
|
|
30
|
+
//# sourceMappingURL=workflow.js.map
|
|
31
|
+
//# sourceMappingURL=workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/adapters/sandbox/e2b/proxy.ts"],"names":[],"mappings":";;;AAuBA,IAAM,cAAA,GAAiB,KAAA;AAEhB,SAAS,kBAAA,CACd,OACA,OAAA,EACY;AACZ,EAAA,MAAM,aAAA,GAAgB,KAAA,IAAS,YAAA,EAAa,CAAE,YAAA;AAG9C,EAAA,MAAM,IAAA,GAAO,eAAA;AAAA,IACX,OAAA,IAAW;AAAA,MACT,mBAAA,EAAqB,MAAA;AAAA,MACrB,KAAA,EAAO;AAAA,QACL,eAAA,EAAiB,CAAA;AAAA,QACjB,eAAA,EAAiB,IAAA;AAAA,QACjB,eAAA,EAAiB,KAAA;AAAA,QACjB,kBAAA,EAAoB;AAAA;AACtB;AACF,GACF;AAEA,EAAA,MAAM,MAAA,GAAS,CAAA,EAAG,cAAc,CAAA,EAAG,cAAc,MAAA,CAAO,CAAC,CAAA,CAAE,WAAA,EAAa,CAAA,EAAG,aAAA,CAAc,KAAA,CAAM,CAAC,CAAC,CAAA,CAAA;AACjG,EAAA,MAAM,IAAI,CAAC,GAAA,KACT,CAAA,EAAG,MAAM,GAAG,GAAA,CAAI,MAAA,CAAO,CAAC,CAAA,CAAE,aAAa,CAAA,EAAG,GAAA,CAAI,KAAA,CAAM,CAAC,CAAC,CAAA,CAAA;AAExD,EAAA,OAAO;AAAA,IACL,aAAA,EAAe,IAAA,CAAK,CAAA,CAAE,eAAe,CAAC,CAAA;AAAA,IACtC,cAAA,EAAgB,IAAA,CAAK,CAAA,CAAE,gBAAgB,CAAC,CAAA;AAAA,IACxC,YAAA,EAAc,IAAA,CAAK,CAAA,CAAE,cAAc,CAAC,CAAA;AAAA,IACpC,eAAA,EAAiB,IAAA,CAAK,CAAA,CAAE,iBAAiB,CAAC,CAAA;AAAA,IAC1C,WAAA,EAAa,IAAA,CAAK,CAAA,CAAE,aAAa,CAAC;AAAA,GACpC;AACF","file":"workflow.js","sourcesContent":["/**\n * Workflow-safe proxy for E2B sandbox operations.\n *\n * Uses longer timeouts than in-memory providers since E2B\n * sandboxes are remote and creation involves provisioning.\n *\n * Import this from `zeitlich/adapters/sandbox/e2b/workflow`\n * in your Temporal workflow files.\n *\n * By default the scope is derived from `workflowInfo().workflowType`,\n * so activities are automatically namespaced per workflow.\n *\n * @example\n * ```typescript\n * import { proxyE2bSandboxOps } from 'zeitlich/adapters/sandbox/e2b/workflow';\n *\n * const sandbox = proxyE2bSandboxOps();\n * ```\n */\nimport { proxyActivities, workflowInfo } from \"@temporalio/workflow\";\nimport type { SandboxOps } from \"../../../lib/sandbox/types\";\nimport type { E2bSandboxCreateOptions } from \"./types\";\n\nconst ADAPTER_PREFIX = \"e2b\";\n\nexport function proxyE2bSandboxOps(\n scope?: string,\n options?: Parameters<typeof proxyActivities>[0]\n): SandboxOps {\n const resolvedScope = scope ?? workflowInfo().workflowType;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const acts = proxyActivities<Record<string, (...args: any[]) => any>>(\n options ?? {\n startToCloseTimeout: \"120s\",\n retry: {\n maximumAttempts: 3,\n initialInterval: \"5s\",\n maximumInterval: \"60s\",\n backoffCoefficient: 3,\n },\n }\n );\n\n const prefix = `${ADAPTER_PREFIX}${resolvedScope.charAt(0).toUpperCase()}${resolvedScope.slice(1)}`;\n const p = (key: string): string =>\n `${prefix}${key.charAt(0).toUpperCase()}${key.slice(1)}`;\n\n return {\n createSandbox: acts[p(\"createSandbox\")],\n destroySandbox: acts[p(\"destroySandbox\")],\n pauseSandbox: acts[p(\"pauseSandbox\")],\n snapshotSandbox: acts[p(\"snapshotSandbox\")],\n forkSandbox: acts[p(\"forkSandbox\")],\n } as SandboxOps<E2bSandboxCreateOptions>;\n}\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as FileEntryMetadata, V as VirtualSandboxCreateOptions, b as FileResolver, c as VirtualSandboxContext, T as TreeMutation, F as FileEntry, d as VirtualSandbox } from '../../../types-
|
|
2
|
-
export { e as VirtualFileTree, f as VirtualSandboxFileSystem, g as VirtualSandboxState } from '../../../types-
|
|
1
|
+
import { a as FileEntryMetadata, V as VirtualSandboxCreateOptions, b as FileResolver, c as VirtualSandboxContext, T as TreeMutation, F as FileEntry, d as VirtualSandbox } from '../../../types-BgsAwN3L.cjs';
|
|
2
|
+
export { e as VirtualFileTree, f as VirtualSandboxFileSystem, g as VirtualSandboxState } from '../../../types-BgsAwN3L.cjs';
|
|
3
3
|
import { b as SandboxProvider, c as SandboxCapabilities, e as SandboxCreateResult } from '../../../types-ChAMwU3q.cjs';
|
|
4
4
|
import { WorkflowClient } from '@temporalio/client';
|
|
5
|
-
import { J as JsonValue, A as ActivityToolHandler, R as RouterContext } from '../../../types-
|
|
6
|
-
export { F as FileTreeAccessor, f as filesWithMimeType, h as hasDirectory, a as hasFileWithMimeType } from '../../../queries-
|
|
5
|
+
import { J as JsonValue, A as ActivityToolHandler, R as RouterContext } from '../../../types-BclYm5Ic.cjs';
|
|
6
|
+
export { F as FileTreeAccessor, f as filesWithMimeType, h as hasDirectory, a as hasFileWithMimeType } from '../../../queries-DVnukByF.cjs';
|
|
7
7
|
import '@temporalio/common';
|
|
8
8
|
import '@temporalio/workflow';
|
|
9
9
|
import '@temporalio/common/lib/interfaces';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as FileEntryMetadata, V as VirtualSandboxCreateOptions, b as FileResolver, c as VirtualSandboxContext, T as TreeMutation, F as FileEntry, d as VirtualSandbox } from '../../../types-
|
|
2
|
-
export { e as VirtualFileTree, f as VirtualSandboxFileSystem, g as VirtualSandboxState } from '../../../types-
|
|
1
|
+
import { a as FileEntryMetadata, V as VirtualSandboxCreateOptions, b as FileResolver, c as VirtualSandboxContext, T as TreeMutation, F as FileEntry, d as VirtualSandbox } from '../../../types-yU5AINiP.js';
|
|
2
|
+
export { e as VirtualFileTree, f as VirtualSandboxFileSystem, g as VirtualSandboxState } from '../../../types-yU5AINiP.js';
|
|
3
3
|
import { b as SandboxProvider, c as SandboxCapabilities, e as SandboxCreateResult } from '../../../types-ChAMwU3q.js';
|
|
4
4
|
import { WorkflowClient } from '@temporalio/client';
|
|
5
|
-
import { J as JsonValue, A as ActivityToolHandler, R as RouterContext } from '../../../types-
|
|
6
|
-
export { F as FileTreeAccessor, f as filesWithMimeType, h as hasDirectory, a as hasFileWithMimeType } from '../../../queries-
|
|
5
|
+
import { J as JsonValue, A as ActivityToolHandler, R as RouterContext } from '../../../types-BclYm5Ic.js';
|
|
6
|
+
export { F as FileTreeAccessor, f as filesWithMimeType, h as hasDirectory, a as hasFileWithMimeType } from '../../../queries-kjlvsUfz.js';
|
|
7
7
|
import '@temporalio/common';
|
|
8
8
|
import '@temporalio/workflow';
|
|
9
9
|
import '@temporalio/common/lib/interfaces';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { proxyActivities } from '@temporalio/workflow';
|
|
2
2
|
import { g as SandboxOps } from '../../../types-ChAMwU3q.cjs';
|
|
3
|
-
import { V as VirtualSandboxCreateOptions } from '../../../types-
|
|
3
|
+
import { V as VirtualSandboxCreateOptions } from '../../../types-BgsAwN3L.cjs';
|
|
4
4
|
import '@temporalio/common';
|
|
5
|
-
import '../../../types-
|
|
5
|
+
import '../../../types-BclYm5Ic.cjs';
|
|
6
6
|
import '@temporalio/common/lib/interfaces';
|
|
7
7
|
import 'zod';
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { proxyActivities } from '@temporalio/workflow';
|
|
2
2
|
import { g as SandboxOps } from '../../../types-ChAMwU3q.js';
|
|
3
|
-
import { V as VirtualSandboxCreateOptions } from '../../../types-
|
|
3
|
+
import { V as VirtualSandboxCreateOptions } from '../../../types-yU5AINiP.js';
|
|
4
4
|
import '@temporalio/common';
|
|
5
|
-
import '../../../types-
|
|
5
|
+
import '../../../types-BclYm5Ic.js';
|
|
6
6
|
import '@temporalio/common/lib/interfaces';
|
|
7
7
|
import 'zod';
|
|
8
8
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import Redis from 'ioredis';
|
|
2
2
|
import Anthropic from '@anthropic-ai/sdk';
|
|
3
|
-
import { R as RouterContext, T as ToolHandlerResponse, A as ActivityToolHandler } from '../../../types-
|
|
4
|
-
import { a as ModelInvoker, P as PrefixedThreadOps, S as ScopedPrefix, M as ModelInvokerConfig, A as AgentResponse } from '../../../types-
|
|
5
|
-
import { A as AnthropicContent, a as AnthropicThreadManagerHooks } from '../../../thread-manager-
|
|
6
|
-
export { b as AnthropicInvocationPayload, c as AnthropicThreadManager, d as AnthropicThreadManagerConfig, S as StoredMessage, e as createAnthropicThreadManager } from '../../../thread-manager-
|
|
3
|
+
import { R as RouterContext, T as ToolHandlerResponse, A as ActivityToolHandler } from '../../../types-BclYm5Ic.cjs';
|
|
4
|
+
import { a as ModelInvoker, P as PrefixedThreadOps, S as ScopedPrefix, M as ModelInvokerConfig, A as AgentResponse } from '../../../types-BuCEZ4dF.cjs';
|
|
5
|
+
import { A as AnthropicContent, a as AnthropicThreadManagerHooks } from '../../../thread-manager-DFJ3sKKU.cjs';
|
|
6
|
+
export { b as AnthropicInvocationPayload, c as AnthropicThreadManager, d as AnthropicThreadManagerConfig, S as StoredMessage, e as createAnthropicThreadManager } from '../../../thread-manager-DFJ3sKKU.cjs';
|
|
7
7
|
import '@temporalio/workflow';
|
|
8
8
|
import '@temporalio/common/lib/interfaces';
|
|
9
9
|
import 'zod';
|
|
10
10
|
import '@temporalio/common';
|
|
11
11
|
import '../../../types-ChAMwU3q.cjs';
|
|
12
|
-
import '../../../types-
|
|
12
|
+
import '../../../types-HbjqzyJH.cjs';
|
|
13
13
|
|
|
14
14
|
declare const ADAPTER_PREFIX: "anthropic";
|
|
15
15
|
type AnthropicThreadOps<TScope extends string = ""> = PrefixedThreadOps<ScopedPrefix<TScope, typeof ADAPTER_PREFIX>, AnthropicContent>;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import Redis from 'ioredis';
|
|
2
2
|
import Anthropic from '@anthropic-ai/sdk';
|
|
3
|
-
import { R as RouterContext, T as ToolHandlerResponse, A as ActivityToolHandler } from '../../../types-
|
|
4
|
-
import { a as ModelInvoker, P as PrefixedThreadOps, S as ScopedPrefix, M as ModelInvokerConfig, A as AgentResponse } from '../../../types-
|
|
5
|
-
import { A as AnthropicContent, a as AnthropicThreadManagerHooks } from '../../../thread-manager-
|
|
6
|
-
export { b as AnthropicInvocationPayload, c as AnthropicThreadManager, d as AnthropicThreadManagerConfig, S as StoredMessage, e as createAnthropicThreadManager } from '../../../thread-manager-
|
|
3
|
+
import { R as RouterContext, T as ToolHandlerResponse, A as ActivityToolHandler } from '../../../types-BclYm5Ic.js';
|
|
4
|
+
import { a as ModelInvoker, P as PrefixedThreadOps, S as ScopedPrefix, M as ModelInvokerConfig, A as AgentResponse } from '../../../types-BtqbM1bO.js';
|
|
5
|
+
import { A as AnthropicContent, a as AnthropicThreadManagerHooks } from '../../../thread-manager-D8C5QvLi.js';
|
|
6
|
+
export { b as AnthropicInvocationPayload, c as AnthropicThreadManager, d as AnthropicThreadManagerConfig, S as StoredMessage, e as createAnthropicThreadManager } from '../../../thread-manager-D8C5QvLi.js';
|
|
7
7
|
import '@temporalio/workflow';
|
|
8
8
|
import '@temporalio/common/lib/interfaces';
|
|
9
9
|
import 'zod';
|
|
10
10
|
import '@temporalio/common';
|
|
11
11
|
import '../../../types-ChAMwU3q.js';
|
|
12
|
-
import '../../../types-
|
|
12
|
+
import '../../../types-BZ75HpYd.js';
|
|
13
13
|
|
|
14
14
|
declare const ADAPTER_PREFIX: "anthropic";
|
|
15
15
|
type AnthropicThreadOps<TScope extends string = ""> = PrefixedThreadOps<ScopedPrefix<TScope, typeof ADAPTER_PREFIX>, AnthropicContent>;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { ActivityInterfaceFor } from '@temporalio/workflow';
|
|
2
|
-
import { T as ThreadOps } from '../../../types-
|
|
3
|
-
import { A as AnthropicContent } from '../../../thread-manager-
|
|
4
|
-
import { c as createThreadOpsProxy } from '../../../proxy-
|
|
2
|
+
import { T as ThreadOps } from '../../../types-BuCEZ4dF.cjs';
|
|
3
|
+
import { A as AnthropicContent } from '../../../thread-manager-DFJ3sKKU.cjs';
|
|
4
|
+
import { c as createThreadOpsProxy } from '../../../proxy-CsB8r0RR.cjs';
|
|
5
5
|
import '@temporalio/common';
|
|
6
|
-
import '../../../types-
|
|
6
|
+
import '../../../types-BclYm5Ic.cjs';
|
|
7
7
|
import '@temporalio/common/lib/interfaces';
|
|
8
8
|
import 'zod';
|
|
9
9
|
import '../../../types-ChAMwU3q.cjs';
|
|
10
10
|
import 'ioredis';
|
|
11
11
|
import '@anthropic-ai/sdk';
|
|
12
|
-
import '../../../types-
|
|
12
|
+
import '../../../types-HbjqzyJH.cjs';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Workflow-safe proxy for Anthropic thread operations.
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { ActivityInterfaceFor } from '@temporalio/workflow';
|
|
2
|
-
import { T as ThreadOps } from '../../../types-
|
|
3
|
-
import { A as AnthropicContent } from '../../../thread-manager-
|
|
4
|
-
import { c as createThreadOpsProxy } from '../../../proxy-
|
|
2
|
+
import { T as ThreadOps } from '../../../types-BtqbM1bO.js';
|
|
3
|
+
import { A as AnthropicContent } from '../../../thread-manager-D8C5QvLi.js';
|
|
4
|
+
import { c as createThreadOpsProxy } from '../../../proxy-7e7v8ccg.js';
|
|
5
5
|
import '@temporalio/common';
|
|
6
|
-
import '../../../types-
|
|
6
|
+
import '../../../types-BclYm5Ic.js';
|
|
7
7
|
import '@temporalio/common/lib/interfaces';
|
|
8
8
|
import 'zod';
|
|
9
9
|
import '../../../types-ChAMwU3q.js';
|
|
10
10
|
import 'ioredis';
|
|
11
11
|
import '@anthropic-ai/sdk';
|
|
12
|
-
import '../../../types-
|
|
12
|
+
import '../../../types-BZ75HpYd.js';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Workflow-safe proxy for Anthropic thread operations.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { G as GoogleGenAIThreadManagerHooks } from '../../../activities-
|
|
2
|
-
export { a as GoogleGenAIAdapter, b as GoogleGenAIAdapterConfig, c as GoogleGenAIContent, d as GoogleGenAIInvocationPayload, e as GoogleGenAIThreadManager, f as GoogleGenAIThreadManagerConfig, g as GoogleGenAIThreadOps, h as GoogleGenAIToolResponse, S as StoredContent, i as createGoogleGenAIAdapter, j as createGoogleGenAIThreadManager } from '../../../activities-
|
|
1
|
+
import { G as GoogleGenAIThreadManagerHooks } from '../../../activities-BzYq6jf7.cjs';
|
|
2
|
+
export { a as GoogleGenAIAdapter, b as GoogleGenAIAdapterConfig, c as GoogleGenAIContent, d as GoogleGenAIInvocationPayload, e as GoogleGenAIThreadManager, f as GoogleGenAIThreadManagerConfig, g as GoogleGenAIThreadOps, h as GoogleGenAIToolResponse, S as StoredContent, i as createGoogleGenAIAdapter, j as createGoogleGenAIThreadManager } from '../../../activities-BzYq6jf7.cjs';
|
|
3
3
|
import Redis from 'ioredis';
|
|
4
4
|
import { GoogleGenAI, Content } from '@google/genai';
|
|
5
|
-
import { M as ModelInvokerConfig, A as AgentResponse } from '../../../types-
|
|
6
|
-
import '../../../types-
|
|
5
|
+
import { M as ModelInvokerConfig, A as AgentResponse } from '../../../types-BuCEZ4dF.cjs';
|
|
6
|
+
import '../../../types-BclYm5Ic.cjs';
|
|
7
7
|
import '@temporalio/workflow';
|
|
8
8
|
import '@temporalio/common/lib/interfaces';
|
|
9
9
|
import 'zod';
|
|
10
|
-
import '../../../types-
|
|
10
|
+
import '../../../types-HbjqzyJH.cjs';
|
|
11
11
|
import '@temporalio/common';
|
|
12
12
|
import '../../../types-ChAMwU3q.cjs';
|
|
13
13
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { G as GoogleGenAIThreadManagerHooks } from '../../../activities-
|
|
2
|
-
export { a as GoogleGenAIAdapter, b as GoogleGenAIAdapterConfig, c as GoogleGenAIContent, d as GoogleGenAIInvocationPayload, e as GoogleGenAIThreadManager, f as GoogleGenAIThreadManagerConfig, g as GoogleGenAIThreadOps, h as GoogleGenAIToolResponse, S as StoredContent, i as createGoogleGenAIAdapter, j as createGoogleGenAIThreadManager } from '../../../activities-
|
|
1
|
+
import { G as GoogleGenAIThreadManagerHooks } from '../../../activities-3xj_fEJK.js';
|
|
2
|
+
export { a as GoogleGenAIAdapter, b as GoogleGenAIAdapterConfig, c as GoogleGenAIContent, d as GoogleGenAIInvocationPayload, e as GoogleGenAIThreadManager, f as GoogleGenAIThreadManagerConfig, g as GoogleGenAIThreadOps, h as GoogleGenAIToolResponse, S as StoredContent, i as createGoogleGenAIAdapter, j as createGoogleGenAIThreadManager } from '../../../activities-3xj_fEJK.js';
|
|
3
3
|
import Redis from 'ioredis';
|
|
4
4
|
import { GoogleGenAI, Content } from '@google/genai';
|
|
5
|
-
import { M as ModelInvokerConfig, A as AgentResponse } from '../../../types-
|
|
6
|
-
import '../../../types-
|
|
5
|
+
import { M as ModelInvokerConfig, A as AgentResponse } from '../../../types-BtqbM1bO.js';
|
|
6
|
+
import '../../../types-BclYm5Ic.js';
|
|
7
7
|
import '@temporalio/workflow';
|
|
8
8
|
import '@temporalio/common/lib/interfaces';
|
|
9
9
|
import 'zod';
|
|
10
|
-
import '../../../types-
|
|
10
|
+
import '../../../types-BZ75HpYd.js';
|
|
11
11
|
import '@temporalio/common';
|
|
12
12
|
import '../../../types-ChAMwU3q.js';
|
|
13
13
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { ActivityInterfaceFor } from '@temporalio/workflow';
|
|
2
|
-
import { T as ThreadOps } from '../../../types-
|
|
3
|
-
import { c as GoogleGenAIContent } from '../../../activities-
|
|
4
|
-
import { c as createThreadOpsProxy } from '../../../proxy-
|
|
2
|
+
import { T as ThreadOps } from '../../../types-BuCEZ4dF.cjs';
|
|
3
|
+
import { c as GoogleGenAIContent } from '../../../activities-BzYq6jf7.cjs';
|
|
4
|
+
import { c as createThreadOpsProxy } from '../../../proxy-CsB8r0RR.cjs';
|
|
5
5
|
import '@temporalio/common';
|
|
6
|
-
import '../../../types-
|
|
6
|
+
import '../../../types-BclYm5Ic.cjs';
|
|
7
7
|
import '@temporalio/common/lib/interfaces';
|
|
8
8
|
import 'zod';
|
|
9
9
|
import '../../../types-ChAMwU3q.cjs';
|
|
10
10
|
import 'ioredis';
|
|
11
11
|
import '@google/genai';
|
|
12
|
-
import '../../../types-
|
|
12
|
+
import '../../../types-HbjqzyJH.cjs';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Workflow-safe proxy for Google GenAI thread operations.
|