@codeworksh/harness 0.2.0-dev.20261013041531 → 0.2.0-dev.20261013121551
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/{daytona-ByTHZelc.mjs → daytona-D4sNwzSr.mjs} +13 -7
- package/daytona-D4sNwzSr.mjs.map +1 -0
- package/effect.d.mts +52 -52
- package/effect.mjs +285 -43
- package/effect.mjs.map +1 -1
- package/package.json +3 -3
- package/sandboxes/daytona/index.mjs +1 -1
- package/daytona-ByTHZelc.mjs.map +0 -1
|
@@ -68,6 +68,12 @@ const statsFrom = (info) => {
|
|
|
68
68
|
...mtime === void 0 ? {} : { mtime }
|
|
69
69
|
};
|
|
70
70
|
};
|
|
71
|
+
const enoent = (operation, path) => Object.assign(/* @__PURE__ */ new Error(`ENOENT: no such file or directory, ${operation} '${path}'`), { code: "ENOENT" });
|
|
72
|
+
/** The toolbox rejects a missing path with its own 404; the filesystem contract expects `ENOENT`. */
|
|
73
|
+
const missing = (operation, path) => async (cause) => {
|
|
74
|
+
const { DaytonaFileNotFoundError } = await import("@daytona/sdk");
|
|
75
|
+
throw cause instanceof DaytonaFileNotFoundError ? Object.assign(enoent(operation, path), { cause }) : cause;
|
|
76
|
+
};
|
|
71
77
|
const providerFrom = (sandbox, options) => {
|
|
72
78
|
const run = async (argv) => {
|
|
73
79
|
const result = await sandbox.process.executeCommand((0, shell_exports.quoteArgv)(argv), options.cwd, void 0, options.execTimeout);
|
|
@@ -77,10 +83,10 @@ const providerFrom = (sandbox, options) => {
|
|
|
77
83
|
};
|
|
78
84
|
};
|
|
79
85
|
const filesystem = {
|
|
80
|
-
readFile: async (path) => (await sandbox.fs.downloadFile(path)).toString("utf8"),
|
|
81
|
-
readFileBuffer: async (path) => new Uint8Array(await sandbox.fs.downloadFile(path)),
|
|
86
|
+
readFile: async (path) => (await sandbox.fs.downloadFile(path).catch(missing("open", path))).toString("utf8"),
|
|
87
|
+
readFileBuffer: async (path) => new Uint8Array(await sandbox.fs.downloadFile(path).catch(missing("open", path))),
|
|
82
88
|
writeFile: (path, content) => sandbox.fs.uploadFile(typeof content === "string" ? Buffer.from(content, "utf8") : Buffer.from(content), path),
|
|
83
|
-
stat: async (path) => statsFrom(await sandbox.fs.getFileDetails(path)),
|
|
89
|
+
stat: async (path) => statsFrom(await sandbox.fs.getFileDetails(path).catch(missing("stat", path))),
|
|
84
90
|
lstat: async (path) => {
|
|
85
91
|
const command = `test -L ${(0, shell_exports.quote)(path)}`;
|
|
86
92
|
const result = await sandbox.process.executeCommand(command, options.cwd, void 0, options.execTimeout);
|
|
@@ -89,11 +95,11 @@ const providerFrom = (sandbox, options) => {
|
|
|
89
95
|
isDirectory: false,
|
|
90
96
|
isSymbolicLink: true
|
|
91
97
|
};
|
|
92
|
-
if (result.exitCode === 1) return statsFrom(await sandbox.fs.getFileDetails(path));
|
|
98
|
+
if (result.exitCode === 1) return statsFrom(await sandbox.fs.getFileDetails(path).catch(missing("lstat", path)));
|
|
93
99
|
assertCommandSucceeded(command, result);
|
|
94
100
|
throw new Error(`unreachable lstat result for ${path}`);
|
|
95
101
|
},
|
|
96
|
-
readdir: async (path) => (await sandbox.fs.listFiles(path)).map((entry) => entry.name),
|
|
102
|
+
readdir: async (path) => (await sandbox.fs.listFiles(path).catch(missing("scandir", path))).map((entry) => entry.name),
|
|
97
103
|
exists: async (path) => {
|
|
98
104
|
try {
|
|
99
105
|
await sandbox.fs.getFileDetails(path);
|
|
@@ -134,7 +140,7 @@ const providerFrom = (sandbox, options) => {
|
|
|
134
140
|
const result = await sandbox.process.executeCommand(command, options.cwd, void 0, options.execTimeout);
|
|
135
141
|
if (result.exitCode === 0) return (result.result ?? "").trimEnd();
|
|
136
142
|
}
|
|
137
|
-
throw
|
|
143
|
+
throw enoent("realpath", path);
|
|
138
144
|
},
|
|
139
145
|
scanLines: filesystem_exports.SandboxFileSystem.Scan.viaShell(run),
|
|
140
146
|
readBytes: filesystem_exports.SandboxFileSystem.readBytesViaShell(run)
|
|
@@ -320,4 +326,4 @@ const config = (value) => ({
|
|
|
320
326
|
//#endregion
|
|
321
327
|
export { RuntimeConfig as a, sandbox as c, ResourcesConfig as i, CreateConfig as n, config as o, Options as r, make as s, ClientOptions as t };
|
|
322
328
|
|
|
323
|
-
//# sourceMappingURL=daytona-
|
|
329
|
+
//# sourceMappingURL=daytona-D4sNwzSr.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daytona-D4sNwzSr.mjs","names":["make","SandboxIO","SandboxInstance","quoteArgv","quote","SandboxFileSystem","resolveCwd","ShellError","RemoteFileSystem.make","Shell","SandboxResource","EnvDaytona.SPILL_PATH","EnvDaytona.mountCwd","EnvDaytona.transport"],"sources":["../../src/sandboxes/daytona/fs.ts","../../src/sandboxes/daytona/provider.ts","../../src/sandboxes/daytona/index.ts"],"sourcesContent":["import { posix } from \"../../util/posix.ts\";\nimport { SandboxFileSystem } from \"../../sandbox/fs/filesystem.ts\";\n\nexport type FileStat = SandboxFileSystem.FileStat;\n\nexport interface Interface extends SandboxFileSystem.Provider {\n\treadonly lstat?: (path: string) => Promise<FileStat>;\n}\n\nexport interface Options {\n\treadonly cwd?: string;\n}\n\nconst resolvePath = (path: string, options?: Options) => {\n\tconst normalized = posix.normalize(path);\n\tif (options?.cwd === undefined || posix.isAbsolute(normalized)) return normalized;\n\treturn posix.normalize(posix.join(options.cwd, normalized));\n};\n\n/** Resolve provider paths without adding policy or mutable working-directory state. */\nexport const make = (provider: Interface, options?: Options): SandboxFileSystem.Provider => {\n\tconst resolve = (path: string) => resolvePath(path, options);\n\n\treturn {\n\t\treadFile: (path) => provider.readFile(resolve(path)),\n\t\treadFileBuffer: (path) => provider.readFileBuffer(resolve(path)),\n\t\treadBytes: (path, offset, length) => provider.readBytes(resolve(path), offset, length),\n\t\twriteFile: (path, content) => provider.writeFile(resolve(path), content),\n\t\tstat: (path) => provider.stat(resolve(path)),\n\t\t...(provider.lstat === undefined ? {} : { lstat: (path: string) => provider.lstat!(resolve(path)) }),\n\t\treaddir: (path) => provider.readdir(resolve(path)),\n\t\texists: (path) => provider.exists(resolve(path)),\n\t\tmkdir: (path, mkdirOptions) => provider.mkdir(resolve(path), mkdirOptions),\n\t\trm: (path, rmOptions) => provider.rm(resolve(path), rmOptions),\n\t\trealpath: (path) => provider.realpath(resolve(path)),\n\t\tscanLines: (path, scanOptions) => provider.scanLines(resolve(path), scanOptions),\n\t};\n};\n\nexport const withProvider = make;\n","/* oxlint-disable effecttsgo/async-function -- Daytona's SDK boundary is Promise-based. */\nimport { Context, DateTime, Effect, Layer, Option, Schema } from \"effect\";\nimport { Buffer } from \"node:buffer\";\nimport { posix } from \"../../util/posix.ts\";\nimport { sanitizeError } from \"../../sandbox/errors.ts\";\nimport { SandboxFileSystem } from \"../../sandbox/fs/filesystem.ts\";\nimport { SandboxInstance } from \"../../sandbox/instance.ts\";\nimport { SandboxIO } from \"../../sandbox/io.ts\";\nimport { SandboxResource } from \"../../sandbox/resource.ts\";\nimport { type ISandboxExe, quote, quoteArgv, resolveCwd, Shell, ShellError } from \"../../sandbox/shell/shell.ts\";\nimport * as RemoteFileSystem from \"./fs.ts\";\n\ntype CodeLanguage = import(\"@daytona/sdk\").CodeLanguage;\ntype Daytona = import(\"@daytona/sdk\").Daytona;\ntype FileInfo = import(\"@daytona/sdk\").FileInfo;\ntype Image = import(\"@daytona/sdk\").Image;\ntype RemoteSandbox = import(\"@daytona/sdk\").Sandbox;\ntype Resources = import(\"@daytona/sdk\").Resources;\n\n/** Fallback when Daytona cannot report a snapshot/image-specific work directory. */\nexport const DEFAULT_CWD = \"/home/daytona\";\n/** Where oversized tool output is written inside the sandbox. */\nexport const SPILL_PATH = \"/tmp\";\n\n/**\n * The mount cwd for a Daytona namespace.\n *\n * An absolute override replaces the namespace default outright, so the\n * `getWorkDir()` round-trip is skipped: it would discover a value we then throw\n * away. Otherwise the sandbox's own work directory is the default, and\n * {@link DEFAULT_CWD} covers a snapshot or image that reports none.\n *\n * Taken as a thunk rather than read off the sandbox so all three branches are\n * testable without provisioning one — this decides where every Daytona mount\n * roots, and §8.1 makes a wrong answer here resolve silently rather than fail.\n */\nexport const mountCwd = async (\n\tcwd: string | undefined,\n\tgetWorkDir: () => Promise<string | undefined>,\n): Promise<string> => {\n\tconst defaultCwd = posix.isAbsolute(cwd ?? \"\") ? DEFAULT_CWD : ((await getWorkDir()) ?? DEFAULT_CWD);\n\treturn SandboxIO.resolveMountCwd(defaultCwd, cwd);\n};\n\nexport class DaytonaError extends Schema.TaggedError<DaytonaError>()(\"DaytonaError\", {\n\tsanitized: SandboxInstance.PersistedError,\n}) {}\n\nexport interface Options {\n\t/** API key. Falls back to the `DAYTONA_API_KEY` env var when omitted. */\n\treadonly apiKey?: string | undefined;\n\t/** API URL. Falls back to `DAYTONA_API_URL` / the SDK default. */\n\treadonly apiUrl?: string | undefined;\n\t/** Target region. Falls back to `DAYTONA_TARGET` / the SDK default. */\n\treadonly target?: string | undefined;\n\t/** Reuse an existing sandbox by id or name instead of creating one. */\n\treadonly sandboxId?: string | undefined;\n\t/** Durable instance identity for this namespace. Supplied by the Controller. */\n\treadonly instanceId?: SandboxInstance.ID | undefined;\n\t/** Snapshot to create the sandbox from. */\n\treadonly snapshot?: string | undefined;\n\t/** Image (registry reference or declarative `Image`) to create the sandbox from. */\n\treadonly image?: string | Image | undefined;\n\t/** Runtime used for code execution. Defaults to `\"typescript\"`. */\n\treadonly language?: CodeLanguage | string | undefined;\n\t/** Environment variables baked into the sandbox. */\n\treadonly envVars?: Record<string, string> | undefined;\n\t/** Resource allocation (cpu / memory / disk). */\n\treadonly resources?: Resources | undefined;\n\t/** OS user to run as inside the sandbox. */\n\treadonly user?: string | undefined;\n\t/**\n\t * Mount working directory. Relative values resolve against `getWorkDir()`;\n\t * omitted values use it, with `/home/daytona` as the provider fallback.\n\t */\n\treadonly cwd?: string | undefined;\n\t/** Idle minutes before the sandbox auto-stops. */\n\treadonly autoStopInterval?: number | undefined;\n\t/** Per-command timeout in seconds. 0 means no timeout. */\n\treadonly execTimeout?: number | undefined;\n}\n\ninterface RemoteState {\n\treadonly sandbox: RemoteSandbox;\n\treadonly cwd: string;\n}\n\nclass Remote extends Context.Service<Remote, RemoteState>()(\"@codeworksh/harness/sandboxes/daytona/provider/Remote\") {}\n\nconst assertCommandSucceeded = (command: string, result: { exitCode: number; result?: string }) => {\n\tif (result.exitCode !== 0) throw new Error(result.result || `command failed (${result.exitCode}): ${command}`);\n};\n\nconst dateFrom = (value: string | undefined) => {\n\tif (value === undefined) return undefined;\n\treturn Option.getOrUndefined(DateTime.make(value).pipe(Option.map(DateTime.toDateUtc)));\n};\n\nexport const createSandbox = (daytona: Daytona, options: Options) => {\n\tconst base = {\n\t\tlanguage: options.language ?? \"typescript\",\n\t\t...(options.envVars === undefined ? {} : { envVars: options.envVars }),\n\t\t...(options.user === undefined ? {} : { user: options.user }),\n\t\t...(options.autoStopInterval === undefined ? {} : { autoStopInterval: options.autoStopInterval }),\n\t\tautoDeleteInterval: -1,\n\t};\n\treturn options.image !== undefined\n\t\t? daytona.create({\n\t\t\t\t...base,\n\t\t\t\timage: options.image,\n\t\t\t\t...(options.resources === undefined ? {} : { resources: options.resources }),\n\t\t\t})\n\t\t: daytona.create({ ...base, ...(options.snapshot === undefined ? {} : { snapshot: options.snapshot }) });\n};\n\nconst remote = (options: Options) =>\n\tLayer.effect(\n\t\tRemote,\n\t\tEffect.tryPromise({\n\t\t\ttry: async (): Promise<RemoteState> => {\n\t\t\t\tconst { Daytona } = await import(\"@daytona/sdk\");\n\t\t\t\tconst daytona = new Daytona({\n\t\t\t\t\t...(options.apiKey === undefined ? {} : { apiKey: options.apiKey }),\n\t\t\t\t\t...(options.apiUrl === undefined ? {} : { apiUrl: options.apiUrl }),\n\t\t\t\t\t...(options.target === undefined ? {} : { target: options.target }),\n\t\t\t\t});\n\t\t\t\tconst sandbox = options.sandboxId\n\t\t\t\t\t? await daytona.get(options.sandboxId)\n\t\t\t\t\t: await createSandbox(daytona, options);\n\t\t\t\treturn {\n\t\t\t\t\tsandbox,\n\t\t\t\t\tcwd: await mountCwd(options.cwd, () => sandbox.getWorkDir()),\n\t\t\t\t};\n\t\t\t},\n\t\t\tcatch: (cause) => new DaytonaError({ sanitized: sanitizeError(cause) }),\n\t\t}),\n\t);\n\nexport const statsFrom = (info: FileInfo): RemoteFileSystem.FileStat => {\n\tconst symlink = info.mode === undefined ? undefined : info.mode.startsWith(\"l\");\n\tconst mtime = dateFrom(info.modifiedAt ?? info.modTime);\n\n\t// omit size/mtime/isSymbolicLink the toolbox did not report — never fabricate\n\treturn {\n\t\tisFile: !info.isDir && symlink !== true,\n\t\tisDirectory: info.isDir,\n\t\t...(symlink === undefined ? {} : { isSymbolicLink: symlink }),\n\t\t...(info.size === undefined ? {} : { size: info.size }),\n\t\t...(mtime === undefined ? {} : { mtime }),\n\t};\n};\n\ntype RemoteFilesystemProvider = Pick<\n\tRemoteFileSystem.Interface,\n\t| \"readFile\"\n\t| \"readFileBuffer\"\n\t| \"readBytes\"\n\t| \"writeFile\"\n\t| \"stat\"\n\t| \"lstat\"\n\t| \"readdir\"\n\t| \"exists\"\n\t| \"mkdir\"\n\t| \"rm\"\n\t| \"realpath\"\n\t| \"scanLines\"\n>;\n\nconst enoent = (operation: string, path: string) =>\n\tObject.assign(new Error(`ENOENT: no such file or directory, ${operation} '${path}'`), { code: \"ENOENT\" });\n\n/** The toolbox rejects a missing path with its own 404; the filesystem contract expects `ENOENT`. */\nconst missing =\n\t(operation: string, path: string) =>\n\tasync (cause: unknown): Promise<never> => {\n\t\tconst { DaytonaFileNotFoundError } = await import(\"@daytona/sdk\");\n\t\tthrow cause instanceof DaytonaFileNotFoundError ? Object.assign(enoent(operation, path), { cause }) : cause;\n\t};\n\nconst providerFrom = (sandbox: RemoteSandbox, options: Options) => {\n\tconst run = async (argv: ReadonlyArray<string>) => {\n\t\tconst result = await sandbox.process.executeCommand(quoteArgv(argv), options.cwd, undefined, options.execTimeout);\n\t\treturn { exitCode: result.exitCode, stdout: result.result ?? \"\" };\n\t};\n\tconst filesystem: RemoteFilesystemProvider = {\n\t\treadFile: async (path: string) =>\n\t\t\t(await sandbox.fs.downloadFile(path).catch(missing(\"open\", path))).toString(\"utf8\"),\n\t\treadFileBuffer: async (path: string) =>\n\t\t\tnew Uint8Array(await sandbox.fs.downloadFile(path).catch(missing(\"open\", path))),\n\t\twriteFile: (path: string, content: string | Uint8Array) =>\n\t\t\tsandbox.fs.uploadFile(typeof content === \"string\" ? Buffer.from(content, \"utf8\") : Buffer.from(content), path),\n\t\tstat: async (path: string) => statsFrom(await sandbox.fs.getFileDetails(path).catch(missing(\"stat\", path))),\n\t\t// The toolbox file-details endpoint follows symlinks. Detect the entry\n\t\t// with the sandbox shell first so lstat never reports target metadata as\n\t\t// if it described the link itself.\n\t\tlstat: async (path: string) => {\n\t\t\tconst command = `test -L ${quote(path)}`;\n\t\t\tconst result = await sandbox.process.executeCommand(command, options.cwd, undefined, options.execTimeout);\n\t\t\tif (result.exitCode === 0) {\n\t\t\t\treturn { isFile: false, isDirectory: false, isSymbolicLink: true };\n\t\t\t}\n\t\t\tif (result.exitCode === 1)\n\t\t\t\treturn statsFrom(await sandbox.fs.getFileDetails(path).catch(missing(\"lstat\", path)));\n\t\t\tassertCommandSucceeded(command, result);\n\t\t\tthrow new Error(`unreachable lstat result for ${path}`);\n\t\t},\n\t\treaddir: async (path: string) =>\n\t\t\t(await sandbox.fs.listFiles(path).catch(missing(\"scandir\", path))).map((entry) => entry.name),\n\t\t// Only a genuine 404 means \"absent\". Auth, rate-limit, and transport\n\t\t// failures propagate: a caller that deletes records on absence must not\n\t\t// be told a path is gone because the API was briefly unreachable.\n\t\texists: async (path: string) => {\n\t\t\ttry {\n\t\t\t\tawait sandbox.fs.getFileDetails(path);\n\t\t\t\treturn true;\n\t\t\t} catch (cause) {\n\t\t\t\tconst { DaytonaNotFoundError } = await import(\"@daytona/sdk\");\n\t\t\t\tif (cause instanceof DaytonaNotFoundError) return false;\n\t\t\t\tthrow cause;\n\t\t\t}\n\t\t},\n\t\tmkdir: async (path: string, mkdirOptions?: { recursive?: boolean }) => {\n\t\t\tif (!mkdirOptions?.recursive) {\n\t\t\t\tawait sandbox.fs.createFolder(path, \"755\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst command = `mkdir -p ${quote(path)}`;\n\t\t\tconst result = await sandbox.process.executeCommand(command, options.cwd, undefined, options.execTimeout);\n\t\t\tassertCommandSucceeded(command, result);\n\t\t},\n\t\trm: async (path: string, rmOptions?: { recursive?: boolean; force?: boolean }) => {\n\t\t\tif (rmOptions?.force && !(await filesystem.exists(path))) return;\n\t\t\ttry {\n\t\t\t\tawait sandbox.fs.deleteFile(path, rmOptions?.recursive);\n\t\t\t} catch (cause) {\n\t\t\t\tif (rmOptions?.force && !(await filesystem.exists(path))) return;\n\t\t\t\tthrow cause;\n\t\t\t}\n\t\t},\n\t\trealpath: async (path: string) => {\n\t\t\tfor (const script of SandboxFileSystem.realpathScripts) {\n\t\t\t\tconst command = quoteArgv([\"sh\", \"-c\", script, \"_\", path]);\n\t\t\t\tconst result = await sandbox.process.executeCommand(command, options.cwd, undefined, options.execTimeout);\n\t\t\t\tif (result.exitCode === 0) return (result.result ?? \"\").trimEnd();\n\t\t\t}\n\t\t\tthrow enoent(\"realpath\", path);\n\t\t},\n\t\tscanLines: SandboxFileSystem.Scan.viaShell(run),\n\t\treadBytes: SandboxFileSystem.readBytesViaShell(run),\n\t};\n\n\treturn filesystem;\n};\n\n// Daytona's execute API folds stderr into `result` and reports a single exit\n// code, so the shell surfaces the combined output as stdout and leaves stderr\n// empty rather than inventing a split.\nconst runCommand = (\n\tsandbox: RemoteSandbox,\n\toptions: Options,\n\tcommand: string,\n\topts?: { env?: Record<string, string>; cwd?: string },\n) =>\n\tEffect.tryPromise({\n\t\ttry: () =>\n\t\t\tsandbox.process.executeCommand(command, resolveCwd(options.cwd, opts?.cwd), opts?.env, options.execTimeout),\n\t\tcatch: (cause) => new ShellError({ command, cause }),\n\t}).pipe(Effect.map((response) => ({ stdout: response.result ?? \"\", stderr: \"\", exitCode: response.exitCode })));\n\nconst exec =\n\t(sandbox: RemoteSandbox, options: Options): ISandboxExe[\"exec\"] =>\n\t(command, opts) =>\n\t\trunCommand(sandbox, options, command, opts);\n\n// `executeCommand` takes a single string, so the vector is quoted here rather\n// than spawned; the per-call cwd rides the toolbox's own cwd argument instead\n// of a `cd` prefix.\nconst execArgv =\n\t(sandbox: RemoteSandbox, options: Options): ISandboxExe[\"execArgv\"] =>\n\t(argv, opts) =>\n\t\trunCommand(sandbox, options, quoteArgv(argv), opts);\n\nconst filesystemLayer = (options: Options) =>\n\tLayer.effect(\n\t\tSandboxFileSystem.Service,\n\t\tEffect.map(Remote, ({ sandbox, cwd }) => {\n\t\t\tconst mounted = { ...options, cwd };\n\t\t\treturn SandboxFileSystem.fromProvider(RemoteFileSystem.make(providerFrom(sandbox, mounted), { cwd }));\n\t\t}),\n\t);\n\nconst shellLayer = (options: Options) =>\n\tLayer.effect(\n\t\tShell,\n\t\tEffect.map(Remote, ({ sandbox, cwd }) => {\n\t\t\tconst mounted = { ...options, cwd };\n\t\t\treturn Shell.of({ exec: exec(sandbox, mounted), execArgv: execArgv(sandbox, mounted) });\n\t\t}),\n\t);\n\n/**\n * Cwd-neutral IO attachment for a lifecycle driver.\n *\n * Mount wrappers supply an absolute cwd to every public operation. Internal\n * filesystem helper commands already receive absolute paths, so the transport\n * itself keeps no mutable working-directory state and owns no resource\n * finalizer.\n */\nexport const transport = (\n\tsandbox: RemoteSandbox,\n\toptions: Pick<Options, \"execTimeout\"> = {},\n): Layer.Layer<SandboxFileSystem.Service | Shell> =>\n\tLayer.merge(\n\t\tLayer.succeed(\n\t\t\tSandboxFileSystem.Service,\n\t\t\tSandboxFileSystem.fromProvider(RemoteFileSystem.make(providerFrom(sandbox, options))),\n\t\t),\n\t\tLayer.succeed(\n\t\t\tShell,\n\t\t\tShell.of({\n\t\t\t\texec: exec(sandbox, options),\n\t\t\t\texecArgv: execArgv(sandbox, options),\n\t\t\t}),\n\t\t),\n\t);\n\n// Daytona's locator is the sandbox id. See `SandboxResource` for why this is a\n// shared tag rather than a Daytona-specific one.\nconst resourceLayer = Layer.effect(\n\tSandboxResource.Service,\n\tEffect.map(Remote, ({ sandbox }) => ({ providerResourceId: sandbox.id })),\n);\n\n// Identity is per remote sandbox, not per provider: two sandboxes both rooted at\n// the same directory must not share persisted directory records.\n//\n// The id is minted here only when the caller names none. A durable id is the\n// control plane's to mint and record — deriving one from the provider's own\n// locator is what §6.1 forbids — so a caller that needs the namespace to survive\n// a restart passes `instanceId` rather than relying on this.\nconst identityLayer = (options: Options) =>\n\tLayer.effect(\n\t\tSandboxIO.Current,\n\t\tEffect.map(Remote, ({ cwd }) =>\n\t\t\tSandboxIO.remote({\n\t\t\t\tdriver: \"daytona\",\n\t\t\t\tid: options.instanceId ?? SandboxInstance.ID.create(),\n\t\t\t\tdefaultCwd: cwd,\n\t\t\t\tspillPath: SPILL_PATH,\n\t\t\t}),\n\t\t),\n\t);\n\n/**\n * A Daytona sandbox provides the runtime filesystem service directly plus\n * the sandbox's native remote shell. It intentionally does not provide VFS:\n * remote filesystems have no synchronous filesystem surface.\n */\nexport const layer = (options: Options = {}): Layer.Layer<SandboxIO.Provides | SandboxResource.Service, DaytonaError> =>\n\tLayer.mergeAll(\n\t\tSandboxIO.withMutation(Layer.mergeAll(filesystemLayer(options), shellLayer(options), identityLayer(options))),\n\t\tresourceLayer,\n\t).pipe(Layer.provide(remote(options)));\n\nexport const services = layer;\n","import { Effect, Layer, Option, Schema } from \"effect\";\nimport { SandboxDriver, SandboxInstance, SandboxProvider } from \"../../sandbox.ts\";\nimport * as EnvDaytona from \"./provider.ts\";\n\nexport const Options = Schema.Struct({\n\tapiKey: Schema.optional(Schema.String),\n\tapiUrl: Schema.optional(Schema.String),\n\ttarget: Schema.optional(Schema.String),\n});\nexport type Options = typeof Options.Type;\nexport const ClientOptions = Options;\nexport type ClientOptions = Options;\n\nexport const ResourcesConfig = Schema.Struct({\n\tcpu: Schema.optional(Schema.Finite),\n\tgpu: Schema.optional(Schema.Finite),\n\tmemory: Schema.optional(Schema.Finite),\n\tdisk: Schema.optional(Schema.Finite),\n});\nexport type ResourcesConfig = typeof ResourcesConfig.Type;\n\nexport const CreateConfig = Schema.Struct({\n\tsnapshot: Schema.optional(Schema.String),\n\timage: Schema.optional(Schema.String),\n\tlanguage: Schema.optional(Schema.String),\n\tenvVars: Schema.optional(Schema.Record(Schema.String, Schema.String)),\n\tresources: Schema.optional(ResourcesConfig),\n\tuser: Schema.optional(Schema.String),\n\tcwd: Schema.optional(Schema.String),\n\tautoStopInterval: Schema.optional(Schema.Finite),\n\texecTimeout: Schema.optional(Schema.Finite),\n});\nexport type CreateConfig = typeof CreateConfig.Type;\n\nexport const RuntimeConfig = Schema.Struct({\n\tdefaultCwd: SandboxDriver.AbsolutePath,\n\tspillPath: Schema.optional(SandboxDriver.AbsolutePath),\n\tuser: Schema.optional(Schema.String),\n\texecTimeout: Schema.optional(Schema.Finite),\n});\nexport type RuntimeConfig = typeof RuntimeConfig.Type;\n\nconst name = SandboxDriver.Name.make(\"daytona\");\ntype DaytonaSdk = typeof import(\"@daytona/sdk\");\ntype RemoteSandbox = import(\"@daytona/sdk\").Sandbox;\ntype Resources = import(\"@daytona/sdk\").Resources;\n\nconst statusFrom = (\n\tstate: RemoteSandbox[\"state\"],\n): {\n\treadonly status: SandboxInstance.Status;\n\treadonly providerStatus: string;\n} => {\n\tconst providerStatus = state ?? \"unknown\";\n\treturn {\n\t\tstatus:\n\t\t\tstate === \"stopped\" || state === \"archived\"\n\t\t\t\t? \"offline\"\n\t\t\t\t: state === \"stopping\" || state === \"archiving\" || state === \"snapshotting\" || state === \"destroying\"\n\t\t\t\t\t? \"suspending\"\n\t\t\t\t\t: state === \"destroyed\"\n\t\t\t\t\t\t? \"unavail\"\n\t\t\t\t\t\t: state === \"error\" || state === \"build_failed\" || state === \"unknown\"\n\t\t\t\t\t\t\t? \"faulted\"\n\t\t\t\t\t\t\t: \"online\",\n\t\tproviderStatus,\n\t};\n};\n\nconst shouldWake = (sandbox: RemoteSandbox): boolean => sandbox.state === \"stopped\" || sandbox.state === \"archived\";\n\nexport const make = (\n\tclient: ClientOptions = {},\n): SandboxDriver.Driver<CreateConfig, RuntimeConfig> & SandboxDriver.Registration => {\n\tconst redact = SandboxProvider.makeRedactor([client.apiKey ?? \"\"]);\n\tconst daytona = (sdk: DaytonaSdk) =>\n\t\tnew sdk.Daytona({\n\t\t\t...(client.apiKey === undefined ? {} : { apiKey: client.apiKey }),\n\t\t\t...(client.apiUrl === undefined ? {} : { apiUrl: client.apiUrl }),\n\t\t\t...(client.target === undefined ? {} : { target: client.target }),\n\t\t});\n\n\tconst attempt = <A>(\n\t\toperation: string,\n\t\trun: (sdk: DaytonaSdk) => Promise<A>,\n\t): Effect.Effect<A, SandboxProvider.SandboxProviderError> =>\n\t\tEffect.suspend(() => {\n\t\t\tlet sdk: DaytonaSdk | undefined;\n\t\t\treturn Effect.tryPromise({\n\t\t\t\ttry: () =>\n\t\t\t\t\timport(\"@daytona/sdk\").then((loaded) => {\n\t\t\t\t\t\tsdk = loaded;\n\t\t\t\t\t\treturn run(loaded);\n\t\t\t\t\t}),\n\t\t\t\tcatch: (cause) =>\n\t\t\t\t\tSandboxProvider.providerError({\n\t\t\t\t\t\tdriver: name,\n\t\t\t\t\t\toperation,\n\t\t\t\t\t\tcause,\n\t\t\t\t\t\tredact,\n\t\t\t\t\t\tnotFound: sdk !== undefined && cause instanceof sdk.DaytonaNotFoundError,\n\t\t\t\t\t}),\n\t\t\t});\n\t\t});\n\n\tconst get = (providerResourceId: string, operation: string) =>\n\t\tattempt(operation, (sdk) => daytona(sdk).get(providerResourceId));\n\n\tconst refresh = (sandbox: RemoteSandbox, operation: string) =>\n\t\tattempt(operation, () => sandbox.refreshData()).pipe(Effect.as(sandbox));\n\n\tconst observed = (sandbox: RemoteSandbox): SandboxDriver.Observed => ({\n\t\t...statusFrom(sandbox.state),\n\t\tmetadata: {\n\t\t\ttarget: sandbox.target,\n\t\t},\n\t});\n\n\tconst wake = (sandbox: RemoteSandbox, operation: string) =>\n\t\tshouldWake(sandbox)\n\t\t\t? attempt(operation, () => sandbox.start()).pipe(Effect.map(() => sandbox))\n\t\t\t: Effect.succeed(sandbox);\n\n\tconst runtime = (\n\t\tdefaultCwd: string,\n\t\tinput: { readonly user?: string | undefined; readonly execTimeout?: number | undefined },\n\t) => ({\n\t\tdefaultCwd: SandboxDriver.AbsolutePath.make(defaultCwd),\n\t\tspillPath: SandboxDriver.AbsolutePath.make(EnvDaytona.SPILL_PATH),\n\t\t...(input.user === undefined ? {} : { user: input.user }),\n\t\t...(input.execTimeout === undefined ? {} : { execTimeout: input.execTimeout }),\n\t});\n\n\treturn SandboxDriver.driver({\n\t\tname,\n\t\tkind: \"remote\",\n\t\tcapabilities: {\n\t\t\tinspect: true,\n\t\t\treattach: true,\n\t\t\twake: true,\n\t\t\tstop: true,\n\t\t\tdestroy: true,\n\t\t\t// Installed SDK 0.187.0 has no cancellation signal on\n\t\t\t// executeCommand; session execution cannot carry cwd/env safely.\n\t\t\tcancels: false,\n\t\t},\n\t\tcreateConfigCodec: CreateConfig,\n\t\truntimeConfigCodec: RuntimeConfig,\n\t\tcreate: ({ instanceId, config }) =>\n\t\t\tEffect.gen(function* () {\n\t\t\t\tconst base = {\n\t\t\t\t\tlanguage: config.language ?? \"typescript\",\n\t\t\t\t\t...(config.envVars === undefined ? {} : { envVars: config.envVars }),\n\t\t\t\t\t...(config.user === undefined ? {} : { user: config.user }),\n\t\t\t\t\t...(config.autoStopInterval === undefined ? {} : { autoStopInterval: config.autoStopInterval }),\n\t\t\t\t\tautoDeleteInterval: -1,\n\t\t\t\t\tlabels: {\n\t\t\t\t\t\t\"codework-instance\": instanceId,\n\t\t\t\t\t\t\"codework-managed\": \"true\",\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\tconst sandbox = yield* attempt(\"create\", (loaded) => {\n\t\t\t\t\tconst sdk = daytona(loaded);\n\t\t\t\t\treturn config.image === undefined\n\t\t\t\t\t\t? sdk.create({ ...base, ...(config.snapshot === undefined ? {} : { snapshot: config.snapshot }) })\n\t\t\t\t\t\t: sdk.create({\n\t\t\t\t\t\t\t\t...base,\n\t\t\t\t\t\t\t\timage: config.image,\n\t\t\t\t\t\t\t\t...(config.resources === undefined ? {} : { resources: config.resources as Resources }),\n\t\t\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tconst defaultCwd = yield* attempt(\"create.cwd\", () =>\n\t\t\t\t\tEnvDaytona.mountCwd(config.cwd, () => sandbox.getWorkDir()),\n\t\t\t\t);\n\t\t\t\tconst state = statusFrom(sandbox.state);\n\t\t\t\treturn {\n\t\t\t\t\tproviderResourceId: sandbox.id,\n\t\t\t\t\tproviderStatus: state.providerStatus,\n\t\t\t\t\truntimeConfig: runtime(defaultCwd, config),\n\t\t\t\t\tmetadata: {\n\t\t\t\t\t\ttarget: sandbox.target,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}),\n\t\truntimeConfigFor: ({ providerResourceId, overrides }) =>\n\t\t\tEffect.gen(function* () {\n\t\t\t\tconst sandbox = yield* get(providerResourceId, \"runtimeConfigFor\");\n\t\t\t\tconst defaultCwd =\n\t\t\t\t\toverrides?.defaultCwd ??\n\t\t\t\t\tSandboxDriver.AbsolutePath.make(\n\t\t\t\t\t\tyield* attempt(\"runtimeConfigFor.cwd\", () =>\n\t\t\t\t\t\t\tEnvDaytona.mountCwd(undefined, () => sandbox.getWorkDir()),\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\treturn {\n\t\t\t\t\tdefaultCwd,\n\t\t\t\t\tspillPath: overrides?.spillPath ?? SandboxDriver.AbsolutePath.make(EnvDaytona.SPILL_PATH),\n\t\t\t\t\t...(overrides?.user === undefined ? { user: sandbox.user } : { user: overrides.user }),\n\t\t\t\t\t...(overrides?.execTimeout === undefined ? {} : { execTimeout: overrides.execTimeout }),\n\t\t\t\t};\n\t\t\t}),\n\t\tattach: (input) =>\n\t\t\tLayer.unwrap(\n\t\t\t\tEffect.gen(function* () {\n\t\t\t\t\tconst sandbox = yield* get(\n\t\t\t\t\t\tOption.getOrElse(input.providerResourceId, () => input.id),\n\t\t\t\t\t\t\"attach\",\n\t\t\t\t\t);\n\t\t\t\t\tyield* wake(sandbox, \"attach.wake\");\n\t\t\t\t\treturn EnvDaytona.transport(\n\t\t\t\t\t\tsandbox,\n\t\t\t\t\t\tinput.runtimeConfig.execTimeout === undefined\n\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t: { execTimeout: input.runtimeConfig.execTimeout },\n\t\t\t\t\t);\n\t\t\t\t}),\n\t\t\t),\n\t\tinspect: (input) =>\n\t\t\tEffect.flatMap(\n\t\t\t\tget(\n\t\t\t\t\tOption.getOrElse(input.providerResourceId, () => input.id),\n\t\t\t\t\t\"inspect\",\n\t\t\t\t),\n\t\t\t\t(sandbox) => Effect.map(refresh(sandbox, \"inspect.refresh\"), observed),\n\t\t\t),\n\t\twake: (input) =>\n\t\t\tEffect.flatMap(\n\t\t\t\tget(\n\t\t\t\t\tOption.getOrElse(input.providerResourceId, () => input.id),\n\t\t\t\t\t\"wake\",\n\t\t\t\t),\n\t\t\t\t(sandbox) => Effect.map(wake(sandbox, \"wake.start\"), observed),\n\t\t\t),\n\t\tstop: (input) =>\n\t\t\tEffect.flatMap(\n\t\t\t\tget(\n\t\t\t\t\tOption.getOrElse(input.providerResourceId, () => input.id),\n\t\t\t\t\t\"stop\",\n\t\t\t\t),\n\t\t\t\t(sandbox) => attempt(\"stop\", () => sandbox.stop()).pipe(Effect.map(() => observed(sandbox))),\n\t\t\t),\n\t\tdestroy: (input) =>\n\t\t\tEffect.flatMap(\n\t\t\t\tget(\n\t\t\t\t\tOption.getOrElse(input.providerResourceId, () => input.id),\n\t\t\t\t\t\"destroy\",\n\t\t\t\t),\n\t\t\t\t(sandbox) => attempt(\"destroy\", () => sandbox.delete()),\n\t\t\t),\n\t});\n};\n\nconst sandbox = SandboxDriver.module({\n\tapiVersion: SandboxDriver.apiVersion,\n\tname,\n\toptions: Options,\n\tmake,\n});\n\nexport const config = (value: CreateConfig) => ({ driver: \"daytona\" as const, config: value });\n\nexport default sandbox;\n"],"mappings":";;;;;AAaA,MAAM,eAAe,MAAc,YAAsB;CACxD,MAAM,aAAa,MAAM,UAAU,IAAI;CACvC,IAAI,SAAS,QAAQ,KAAA,KAAa,MAAM,WAAW,UAAU,GAAG,OAAO;CACvE,OAAO,MAAM,UAAU,MAAM,KAAK,QAAQ,KAAK,UAAU,CAAC;AAC3D;;AAGA,MAAaA,UAAQ,UAAqB,YAAkD;CAC3F,MAAM,WAAW,SAAiB,YAAY,MAAM,OAAO;CAE3D,OAAO;EACN,WAAW,SAAS,SAAS,SAAS,QAAQ,IAAI,CAAC;EACnD,iBAAiB,SAAS,SAAS,eAAe,QAAQ,IAAI,CAAC;EAC/D,YAAY,MAAM,QAAQ,WAAW,SAAS,UAAU,QAAQ,IAAI,GAAG,QAAQ,MAAM;EACrF,YAAY,MAAM,YAAY,SAAS,UAAU,QAAQ,IAAI,GAAG,OAAO;EACvE,OAAO,SAAS,SAAS,KAAK,QAAQ,IAAI,CAAC;EAC3C,GAAI,SAAS,UAAU,KAAA,IAAY,CAAC,IAAI,EAAE,QAAQ,SAAiB,SAAS,MAAO,QAAQ,IAAI,CAAC,EAAE;EAClG,UAAU,SAAS,SAAS,QAAQ,QAAQ,IAAI,CAAC;EACjD,SAAS,SAAS,SAAS,OAAO,QAAQ,IAAI,CAAC;EAC/C,QAAQ,MAAM,iBAAiB,SAAS,MAAM,QAAQ,IAAI,GAAG,YAAY;EACzE,KAAK,MAAM,cAAc,SAAS,GAAG,QAAQ,IAAI,GAAG,SAAS;EAC7D,WAAW,SAAS,SAAS,SAAS,QAAQ,IAAI,CAAC;EACnD,YAAY,MAAM,gBAAgB,SAAS,UAA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A0B,MAAM,EAAE,GACzD,MACD,IACC,YAAY,QAAQ,cAAc,QAAQ,KAAK,CAAC,CAAC,CAAC,KAAK,OAAO,UAAU,SAAS,OAAO,CAAC,CAAC,CAC5F;EACD,UAAU,UACT,OAAO,QACN,IACC,OAAO,UAAU,MAAM,0BAA0B,MAAM,EAAE,GACzD,SACD,IACC,YAAY,QAAQ,iBAAiB,QAAQ,OAAO,CAAC,CACvD;CACF,CAAC;AACF;AAEA,MAAM,UAAU,cAAc,OAAO;CACpC,YAAY,cAAc;CAC1B;CACA,SAAS;CACT;AACD,CAAC;AAED,MAAa,UAAU,WAAyB;CAAE,QAAQ;CAAoB,QAAQ;AAAM"}
|
package/effect.d.mts
CHANGED
|
@@ -2715,6 +2715,21 @@ type AikitPart = Message.AssistantMessage["parts"][number] | Message.UserMessage
|
|
|
2715
2715
|
declare const encodePart: (part: AikitPart) => Effect.Effect<AppendPart, ContextEncodeError, never>;
|
|
2716
2716
|
declare const validateUserMessage: (value: unknown, entryId: string, type: string) => Effect.Effect<Message.UserMessage, ContextDecodeError>;
|
|
2717
2717
|
declare const encodeMessage: (message: {
|
|
2718
|
+
messageId: string;
|
|
2719
|
+
role: "user";
|
|
2720
|
+
time: {
|
|
2721
|
+
created: number;
|
|
2722
|
+
};
|
|
2723
|
+
parts: ({
|
|
2724
|
+
type: "text";
|
|
2725
|
+
text: string;
|
|
2726
|
+
textSignature?: string;
|
|
2727
|
+
} | {
|
|
2728
|
+
type: "image";
|
|
2729
|
+
data: string;
|
|
2730
|
+
mimeType: string;
|
|
2731
|
+
})[];
|
|
2732
|
+
} | {
|
|
2718
2733
|
role: "assistant";
|
|
2719
2734
|
protocol: "anthropic" | "github-copilot" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-codex" | "openai-compatible" | "openrouter" | "xai";
|
|
2720
2735
|
provider: {
|
|
@@ -2864,19 +2879,14 @@ declare const encodeMessage: (message: {
|
|
|
2864
2879
|
type: "image";
|
|
2865
2880
|
data: string;
|
|
2866
2881
|
mimeType: string;
|
|
2867
|
-
} | {
|
|
2868
|
-
type: "thinking";
|
|
2869
|
-
thinking: string;
|
|
2870
|
-
thinkingSignature?: string;
|
|
2871
|
-
redacted?: boolean;
|
|
2872
2882
|
} | {
|
|
2873
2883
|
addedToolNames?: string[];
|
|
2874
2884
|
arguments: Record<string, any>;
|
|
2875
2885
|
callID: string;
|
|
2876
2886
|
name: string;
|
|
2877
2887
|
namespace?: string;
|
|
2878
|
-
|
|
2879
|
-
content
|
|
2888
|
+
result: {
|
|
2889
|
+
content: ({
|
|
2880
2890
|
type: "text";
|
|
2881
2891
|
text: string;
|
|
2882
2892
|
textSignature?: string;
|
|
@@ -2886,8 +2896,9 @@ declare const encodeMessage: (message: {
|
|
|
2886
2896
|
mimeType: string;
|
|
2887
2897
|
})[];
|
|
2888
2898
|
details?: any;
|
|
2899
|
+
isError: false;
|
|
2889
2900
|
};
|
|
2890
|
-
status: "
|
|
2901
|
+
status: "completed";
|
|
2891
2902
|
thoughtSignature?: string;
|
|
2892
2903
|
time: {
|
|
2893
2904
|
start: number;
|
|
@@ -2911,9 +2922,9 @@ declare const encodeMessage: (message: {
|
|
|
2911
2922
|
mimeType: string;
|
|
2912
2923
|
})[];
|
|
2913
2924
|
details?: any;
|
|
2914
|
-
isError:
|
|
2925
|
+
isError: true;
|
|
2915
2926
|
};
|
|
2916
|
-
status: "
|
|
2927
|
+
status: "error";
|
|
2917
2928
|
thoughtSignature?: string;
|
|
2918
2929
|
time: {
|
|
2919
2930
|
start: number;
|
|
@@ -2939,7 +2950,7 @@ declare const encodeMessage: (message: {
|
|
|
2939
2950
|
details?: any;
|
|
2940
2951
|
isError: true;
|
|
2941
2952
|
};
|
|
2942
|
-
status: "
|
|
2953
|
+
status: "skipped";
|
|
2943
2954
|
thoughtSignature?: string;
|
|
2944
2955
|
time: {
|
|
2945
2956
|
start: number;
|
|
@@ -2965,21 +2976,26 @@ declare const encodeMessage: (message: {
|
|
|
2965
2976
|
details?: any;
|
|
2966
2977
|
isError: true;
|
|
2967
2978
|
};
|
|
2968
|
-
status: "
|
|
2979
|
+
status: "aborted";
|
|
2969
2980
|
thoughtSignature?: string;
|
|
2970
2981
|
time: {
|
|
2971
2982
|
start: number;
|
|
2972
2983
|
end: number;
|
|
2973
2984
|
};
|
|
2974
2985
|
type: "toolCall";
|
|
2986
|
+
} | {
|
|
2987
|
+
type: "thinking";
|
|
2988
|
+
thinking: string;
|
|
2989
|
+
thinkingSignature?: string;
|
|
2990
|
+
redacted?: boolean;
|
|
2975
2991
|
} | {
|
|
2976
2992
|
addedToolNames?: string[];
|
|
2977
2993
|
arguments: Record<string, any>;
|
|
2978
2994
|
callID: string;
|
|
2979
2995
|
name: string;
|
|
2980
2996
|
namespace?: string;
|
|
2981
|
-
|
|
2982
|
-
content
|
|
2997
|
+
partial?: {
|
|
2998
|
+
content?: ({
|
|
2983
2999
|
type: "text";
|
|
2984
3000
|
text: string;
|
|
2985
3001
|
textSignature?: string;
|
|
@@ -2989,9 +3005,8 @@ declare const encodeMessage: (message: {
|
|
|
2989
3005
|
mimeType: string;
|
|
2990
3006
|
})[];
|
|
2991
3007
|
details?: any;
|
|
2992
|
-
isError: true;
|
|
2993
3008
|
};
|
|
2994
|
-
status: "
|
|
3009
|
+
status: "running";
|
|
2995
3010
|
thoughtSignature?: string;
|
|
2996
3011
|
time: {
|
|
2997
3012
|
start: number;
|
|
@@ -3016,7 +3031,8 @@ declare const encodeMessage: (message: {
|
|
|
3016
3031
|
responseId?: string;
|
|
3017
3032
|
responseModel?: string;
|
|
3018
3033
|
messageId: string;
|
|
3019
|
-
}
|
|
3034
|
+
}) => Effect.Effect<EncodedMessage, ContextEncodeError, never>;
|
|
3035
|
+
declare const decodeSyntheticMessage: (hydrated: HydratedEntry) => Effect.Effect<{
|
|
3020
3036
|
messageId: string;
|
|
3021
3037
|
role: "user";
|
|
3022
3038
|
time: {
|
|
@@ -3031,8 +3047,8 @@ declare const encodeMessage: (message: {
|
|
|
3031
3047
|
data: string;
|
|
3032
3048
|
mimeType: string;
|
|
3033
3049
|
})[];
|
|
3034
|
-
}
|
|
3035
|
-
declare const
|
|
3050
|
+
}, ContextDecodeError, never>;
|
|
3051
|
+
declare const decodeMessage: (hydrated: HydratedEntry) => Effect.Effect<{
|
|
3036
3052
|
messageId: string;
|
|
3037
3053
|
role: "user";
|
|
3038
3054
|
time: {
|
|
@@ -3047,8 +3063,7 @@ declare const decodeSyntheticMessage: (hydrated: HydratedEntry) => Effect.Effect
|
|
|
3047
3063
|
data: string;
|
|
3048
3064
|
mimeType: string;
|
|
3049
3065
|
})[];
|
|
3050
|
-
}
|
|
3051
|
-
declare const decodeMessage: (hydrated: HydratedEntry) => Effect.Effect<{
|
|
3066
|
+
} | {
|
|
3052
3067
|
role: "assistant";
|
|
3053
3068
|
protocol: "anthropic" | "github-copilot" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-codex" | "openai-compatible" | "openrouter" | "xai";
|
|
3054
3069
|
provider: {
|
|
@@ -3198,19 +3213,14 @@ declare const decodeMessage: (hydrated: HydratedEntry) => Effect.Effect<{
|
|
|
3198
3213
|
type: "image";
|
|
3199
3214
|
data: string;
|
|
3200
3215
|
mimeType: string;
|
|
3201
|
-
} | {
|
|
3202
|
-
type: "thinking";
|
|
3203
|
-
thinking: string;
|
|
3204
|
-
thinkingSignature?: string;
|
|
3205
|
-
redacted?: boolean;
|
|
3206
3216
|
} | {
|
|
3207
3217
|
addedToolNames?: string[];
|
|
3208
3218
|
arguments: Record<string, any>;
|
|
3209
3219
|
callID: string;
|
|
3210
3220
|
name: string;
|
|
3211
3221
|
namespace?: string;
|
|
3212
|
-
|
|
3213
|
-
content
|
|
3222
|
+
result: {
|
|
3223
|
+
content: ({
|
|
3214
3224
|
type: "text";
|
|
3215
3225
|
text: string;
|
|
3216
3226
|
textSignature?: string;
|
|
@@ -3220,8 +3230,9 @@ declare const decodeMessage: (hydrated: HydratedEntry) => Effect.Effect<{
|
|
|
3220
3230
|
mimeType: string;
|
|
3221
3231
|
})[];
|
|
3222
3232
|
details?: any;
|
|
3233
|
+
isError: false;
|
|
3223
3234
|
};
|
|
3224
|
-
status: "
|
|
3235
|
+
status: "completed";
|
|
3225
3236
|
thoughtSignature?: string;
|
|
3226
3237
|
time: {
|
|
3227
3238
|
start: number;
|
|
@@ -3245,9 +3256,9 @@ declare const decodeMessage: (hydrated: HydratedEntry) => Effect.Effect<{
|
|
|
3245
3256
|
mimeType: string;
|
|
3246
3257
|
})[];
|
|
3247
3258
|
details?: any;
|
|
3248
|
-
isError:
|
|
3259
|
+
isError: true;
|
|
3249
3260
|
};
|
|
3250
|
-
status: "
|
|
3261
|
+
status: "error";
|
|
3251
3262
|
thoughtSignature?: string;
|
|
3252
3263
|
time: {
|
|
3253
3264
|
start: number;
|
|
@@ -3273,7 +3284,7 @@ declare const decodeMessage: (hydrated: HydratedEntry) => Effect.Effect<{
|
|
|
3273
3284
|
details?: any;
|
|
3274
3285
|
isError: true;
|
|
3275
3286
|
};
|
|
3276
|
-
status: "
|
|
3287
|
+
status: "skipped";
|
|
3277
3288
|
thoughtSignature?: string;
|
|
3278
3289
|
time: {
|
|
3279
3290
|
start: number;
|
|
@@ -3299,21 +3310,26 @@ declare const decodeMessage: (hydrated: HydratedEntry) => Effect.Effect<{
|
|
|
3299
3310
|
details?: any;
|
|
3300
3311
|
isError: true;
|
|
3301
3312
|
};
|
|
3302
|
-
status: "
|
|
3313
|
+
status: "aborted";
|
|
3303
3314
|
thoughtSignature?: string;
|
|
3304
3315
|
time: {
|
|
3305
3316
|
start: number;
|
|
3306
3317
|
end: number;
|
|
3307
3318
|
};
|
|
3308
3319
|
type: "toolCall";
|
|
3320
|
+
} | {
|
|
3321
|
+
type: "thinking";
|
|
3322
|
+
thinking: string;
|
|
3323
|
+
thinkingSignature?: string;
|
|
3324
|
+
redacted?: boolean;
|
|
3309
3325
|
} | {
|
|
3310
3326
|
addedToolNames?: string[];
|
|
3311
3327
|
arguments: Record<string, any>;
|
|
3312
3328
|
callID: string;
|
|
3313
3329
|
name: string;
|
|
3314
3330
|
namespace?: string;
|
|
3315
|
-
|
|
3316
|
-
content
|
|
3331
|
+
partial?: {
|
|
3332
|
+
content?: ({
|
|
3317
3333
|
type: "text";
|
|
3318
3334
|
text: string;
|
|
3319
3335
|
textSignature?: string;
|
|
@@ -3323,9 +3339,8 @@ declare const decodeMessage: (hydrated: HydratedEntry) => Effect.Effect<{
|
|
|
3323
3339
|
mimeType: string;
|
|
3324
3340
|
})[];
|
|
3325
3341
|
details?: any;
|
|
3326
|
-
isError: true;
|
|
3327
3342
|
};
|
|
3328
|
-
status: "
|
|
3343
|
+
status: "running";
|
|
3329
3344
|
thoughtSignature?: string;
|
|
3330
3345
|
time: {
|
|
3331
3346
|
start: number;
|
|
@@ -3350,21 +3365,6 @@ declare const decodeMessage: (hydrated: HydratedEntry) => Effect.Effect<{
|
|
|
3350
3365
|
responseId?: string;
|
|
3351
3366
|
responseModel?: string;
|
|
3352
3367
|
messageId: string;
|
|
3353
|
-
} | {
|
|
3354
|
-
messageId: string;
|
|
3355
|
-
role: "user";
|
|
3356
|
-
time: {
|
|
3357
|
-
created: number;
|
|
3358
|
-
};
|
|
3359
|
-
parts: ({
|
|
3360
|
-
type: "text";
|
|
3361
|
-
text: string;
|
|
3362
|
-
textSignature?: string;
|
|
3363
|
-
} | {
|
|
3364
|
-
type: "image";
|
|
3365
|
-
data: string;
|
|
3366
|
-
mimeType: string;
|
|
3367
|
-
})[];
|
|
3368
3368
|
}, ContextDecodeError, never>;
|
|
3369
3369
|
declare namespace context_d_exports {
|
|
3370
3370
|
export { context_d_exports as Context, assemble_d_exports as ContextAssembly, codec_d_exports as ContextCodec, ContextDecodeError, ContextEncodeError, ContextInvariantError, ContextReadError, EncodedMessage, Interface$1 as Interface, Service$2 as Service, Snapshot, assemblePath, decodeMessage, decodeSyntheticMessage, encodeMessage, encodePart, layer$4 as layer, validateUserMessage };
|