@workerdeck/core 1.0.0 → 1.1.0
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/build/index.d.mts +0 -1
- package/build/index.mjs +30 -25
- package/build/index.mjs.map +1 -1
- package/package.json +14 -14
package/build/index.d.mts
CHANGED
|
@@ -3,7 +3,6 @@ import { ApiMessage, CreateSessionRequest, EngineCapabilities, McpServerConfigWi
|
|
|
3
3
|
import { LanguageModel, LanguageModel as LanguageModel$1, ModelMessage, Tool, Tool as Tool$1, ToolSet, ToolSet as ToolSet$1 } from "ai";
|
|
4
4
|
import { SandboxEngine, SandboxVfs } from "@workerdeck/sandbox";
|
|
5
5
|
import { Readable, Writable } from "node:stream";
|
|
6
|
-
|
|
7
6
|
//#region src/lib/attachments.d.ts
|
|
8
7
|
type AttachmentInput = MessageAttachment & {
|
|
9
8
|
data: string;
|
package/build/index.mjs
CHANGED
|
@@ -11,13 +11,13 @@ import { lookup } from "node:dns/promises";
|
|
|
11
11
|
import { homedir, tmpdir } from "node:os";
|
|
12
12
|
import { dirname, join, resolve, sep } from "node:path";
|
|
13
13
|
//#region src/lib/attachments.ts
|
|
14
|
-
const IMAGE_TYPES = new Set([
|
|
14
|
+
const IMAGE_TYPES = /* @__PURE__ */ new Set([
|
|
15
15
|
"image/jpeg",
|
|
16
16
|
"image/png",
|
|
17
17
|
"image/gif",
|
|
18
18
|
"image/webp"
|
|
19
19
|
]);
|
|
20
|
-
const TEXT_TYPES = new Set([
|
|
20
|
+
const TEXT_TYPES = /* @__PURE__ */ new Set([
|
|
21
21
|
"application/json",
|
|
22
22
|
"application/xml",
|
|
23
23
|
"application/yaml",
|
|
@@ -634,7 +634,7 @@ function withTitle(config, title) {
|
|
|
634
634
|
}
|
|
635
635
|
//#endregion
|
|
636
636
|
//#region src/engines/claude/subagents.ts
|
|
637
|
-
const SPAWNER_NAMES = new Set(["Task", "Agent"]);
|
|
637
|
+
const SPAWNER_NAMES = /* @__PURE__ */ new Set(["Task", "Agent"]);
|
|
638
638
|
var SubagentTracker = class {
|
|
639
639
|
#records = /* @__PURE__ */ new Map();
|
|
640
640
|
#settleCounter = 0;
|
|
@@ -2022,10 +2022,7 @@ var AiSdkRunner = class {
|
|
|
2022
2022
|
case "finish-step":
|
|
2023
2023
|
flush();
|
|
2024
2024
|
break;
|
|
2025
|
-
case "error":
|
|
2026
|
-
streamError ??= part.error;
|
|
2027
|
-
break;
|
|
2028
|
-
default: break;
|
|
2025
|
+
case "error": streamError ??= part.error;
|
|
2029
2026
|
}
|
|
2030
2027
|
}
|
|
2031
2028
|
flush();
|
|
@@ -2160,7 +2157,8 @@ function errorText(error) {
|
|
|
2160
2157
|
//#region src/engines/claude/auth.ts
|
|
2161
2158
|
function resolveBundledClaudeExecutable() {
|
|
2162
2159
|
try {
|
|
2163
|
-
const
|
|
2160
|
+
const fromHere = createRequire(import.meta.url);
|
|
2161
|
+
const fromSdk = createRequire(fromHere.resolve("@anthropic-ai/claude-agent-sdk"));
|
|
2164
2162
|
const suffix = process.platform === "win32" ? ".exe" : "";
|
|
2165
2163
|
const platforms = process.platform === "linux" ? [`linux-${process.arch}`, `linux-${process.arch}-musl`] : [`${process.platform}-${process.arch}`];
|
|
2166
2164
|
for (const platform of platforms) try {
|
|
@@ -2219,7 +2217,7 @@ var QuickJsExecutor = class {
|
|
|
2219
2217
|
vfs: call.vfs,
|
|
2220
2218
|
signal: call.signal,
|
|
2221
2219
|
timeoutMs: call.limits?.timeoutMs ?? this.#options.defaultTimeoutMs ?? 5e3,
|
|
2222
|
-
memoryLimitBytes: call.limits?.memoryLimitBytes ?? this.#options.defaultMemoryLimitBytes ??
|
|
2220
|
+
memoryLimitBytes: call.limits?.memoryLimitBytes ?? this.#options.defaultMemoryLimitBytes ?? 67108864,
|
|
2223
2221
|
fetchText: this.#allowsNetwork() ? (url) => this.#fetchText(url, call.signal) : void 0
|
|
2224
2222
|
});
|
|
2225
2223
|
const logs = result.logs.map((l) => `[${l.level}] ${l.text}`);
|
|
@@ -2504,7 +2502,7 @@ var DeferredExecutor = class {
|
|
|
2504
2502
|
};
|
|
2505
2503
|
//#endregion
|
|
2506
2504
|
//#region src/engines/provider/tools.ts
|
|
2507
|
-
const MAX_FILE_BYTES =
|
|
2505
|
+
const MAX_FILE_BYTES = 1048576;
|
|
2508
2506
|
function createToolContext(options) {
|
|
2509
2507
|
const vfs = options.vfs ?? createVfs();
|
|
2510
2508
|
const definitions = [];
|
|
@@ -2698,9 +2696,9 @@ const MAX_CACHE_ENTRIES = 64;
|
|
|
2698
2696
|
const MAX_REDIRECTS = 5;
|
|
2699
2697
|
function createWebFetch(options = {}) {
|
|
2700
2698
|
const fetchImpl = options.fetchImpl ?? fetch;
|
|
2701
|
-
const maxContentBytes = options.maxContentBytes ??
|
|
2702
|
-
const maxMarkdownBytes = options.maxMarkdownBytes ??
|
|
2703
|
-
const cacheTtlMs = options.cacheTtlMs ??
|
|
2699
|
+
const maxContentBytes = options.maxContentBytes ?? 1048576;
|
|
2700
|
+
const maxMarkdownBytes = options.maxMarkdownBytes ?? 51200;
|
|
2701
|
+
const cacheTtlMs = options.cacheTtlMs ?? 9e5;
|
|
2704
2702
|
const cache = /* @__PURE__ */ new Map();
|
|
2705
2703
|
const fetchPage = async (rawUrl) => {
|
|
2706
2704
|
const cached = cache.get(rawUrl);
|
|
@@ -3063,13 +3061,13 @@ function toTransport(server) {
|
|
|
3063
3061
|
//#endregion
|
|
3064
3062
|
//#region src/engines/claude/catalog.ts
|
|
3065
3063
|
const CLAUDE_CATALOG = {
|
|
3066
|
-
provenance: "supportedModels() of @anthropic-ai/claude-agent-sdk 0.3.
|
|
3064
|
+
provenance: "supportedModels() of @anthropic-ai/claude-agent-sdk 0.3.258 (Claude Code CLI), extracted 2026-09-02; older-model rows hand-maintained",
|
|
3067
3065
|
models: [
|
|
3068
3066
|
{
|
|
3069
|
-
value: "claude-fable-5[1m]",
|
|
3070
|
-
resolvedModel: "claude-fable-5",
|
|
3071
|
-
displayName: "Fable 5",
|
|
3072
|
-
description: "Fable 5 · Most capable for your hardest and longest-running tasks",
|
|
3067
|
+
value: "claude-fable-5-1[1m]",
|
|
3068
|
+
resolvedModel: "claude-fable-5-1",
|
|
3069
|
+
displayName: "Fable 5.1",
|
|
3070
|
+
description: "Fable 5.1 · Most capable for your hardest and longest-running tasks",
|
|
3073
3071
|
primary: true,
|
|
3074
3072
|
reasoningEfforts: [
|
|
3075
3073
|
"low",
|
|
@@ -3079,6 +3077,12 @@ const CLAUDE_CATALOG = {
|
|
|
3079
3077
|
"max"
|
|
3080
3078
|
]
|
|
3081
3079
|
},
|
|
3080
|
+
{
|
|
3081
|
+
value: "claude-fable-5[1m]",
|
|
3082
|
+
resolvedModel: "claude-fable-5",
|
|
3083
|
+
displayName: "Fable 5",
|
|
3084
|
+
description: "Fable 5 · Previous Fable generation"
|
|
3085
|
+
},
|
|
3082
3086
|
{
|
|
3083
3087
|
value: "opus[1m]",
|
|
3084
3088
|
resolvedModel: "claude-opus-5[1m]",
|
|
@@ -3645,7 +3649,7 @@ const GRANULAR_NEVER = { granular: {
|
|
|
3645
3649
|
request_permissions: false,
|
|
3646
3650
|
skill_approval: false
|
|
3647
3651
|
} };
|
|
3648
|
-
const THREAD_SCOPED_NOTIFICATIONS = new Set([
|
|
3652
|
+
const THREAD_SCOPED_NOTIFICATIONS = /* @__PURE__ */ new Set([
|
|
3649
3653
|
"turn/started",
|
|
3650
3654
|
"turn/completed",
|
|
3651
3655
|
"thread/tokenUsage/updated"
|
|
@@ -3702,7 +3706,8 @@ const PRODUCED_MEDIA_TYPES = {
|
|
|
3702
3706
|
pdf: "application/pdf"
|
|
3703
3707
|
};
|
|
3704
3708
|
function producedMediaType(path) {
|
|
3705
|
-
|
|
3709
|
+
const extension = path.slice(path.lastIndexOf(".") + 1).toLowerCase();
|
|
3710
|
+
return PRODUCED_MEDIA_TYPES[extension];
|
|
3706
3711
|
}
|
|
3707
3712
|
function skillInfo(skill) {
|
|
3708
3713
|
return {
|
|
@@ -5117,7 +5122,7 @@ var CodexRunner = class {
|
|
|
5117
5122
|
* .replace("package.json","vendor/aarch64-apple-darwin/bin/codex")')"
|
|
5118
5123
|
*/
|
|
5119
5124
|
const CODEX_CATALOG = {
|
|
5120
|
-
provenance: "embedded model presets of @openai/codex@0.
|
|
5125
|
+
provenance: "embedded model presets of @openai/codex@0.151.0 (darwin-arm64 binary), re-extracted 2026-09-02 and unchanged since 0.149.0",
|
|
5121
5126
|
models: [
|
|
5122
5127
|
{
|
|
5123
5128
|
value: "gpt-5.6-sol",
|
|
@@ -5217,7 +5222,6 @@ const CODEX_CATALOG = {
|
|
|
5217
5222
|
};
|
|
5218
5223
|
//#endregion
|
|
5219
5224
|
//#region src/engines/codex/process.ts
|
|
5220
|
-
const STDERR_TAIL_BYTES = 4096;
|
|
5221
5225
|
function connectAppServer(options) {
|
|
5222
5226
|
const child = spawn(options.executable, ["app-server"], {
|
|
5223
5227
|
env: options.env,
|
|
@@ -5233,7 +5237,7 @@ function connectAppServer(options) {
|
|
|
5233
5237
|
});
|
|
5234
5238
|
let stderrTail = "";
|
|
5235
5239
|
child.stderr.on("data", (chunk) => {
|
|
5236
|
-
stderrTail = (stderrTail + String(chunk)).slice(-
|
|
5240
|
+
stderrTail = (stderrTail + String(chunk)).slice(-4096);
|
|
5237
5241
|
});
|
|
5238
5242
|
let closeHandler;
|
|
5239
5243
|
let done = false;
|
|
@@ -5270,7 +5274,8 @@ function resolveBundledCodexExecutable() {
|
|
|
5270
5274
|
const triple = targetTriple();
|
|
5271
5275
|
if (!triple) return;
|
|
5272
5276
|
try {
|
|
5273
|
-
const
|
|
5277
|
+
const wrapper = createRequire(import.meta.url).resolve("@openai/codex/package.json");
|
|
5278
|
+
const path = createRequire(wrapper).resolve(`@openai/codex-${platformPackageSuffix()}/package.json`).replace(/package\.json$/, `vendor/${triple}/bin/codex`);
|
|
5274
5279
|
if (existsSync(path)) return path;
|
|
5275
5280
|
} catch {}
|
|
5276
5281
|
}
|
|
@@ -5314,7 +5319,7 @@ async function checkCodexAvailability(profile, env, options = {}) {
|
|
|
5314
5319
|
const LIST_PAGE_SIZE = 100;
|
|
5315
5320
|
const MAX_LIST_PAGES = 40;
|
|
5316
5321
|
function cwdFilter(dir) {
|
|
5317
|
-
const forms = new Set([dir]);
|
|
5322
|
+
const forms = /* @__PURE__ */ new Set([dir]);
|
|
5318
5323
|
try {
|
|
5319
5324
|
forms.add(realpathSync(dir));
|
|
5320
5325
|
} catch {}
|