@theokit/sdk 5.8.0 → 5.9.1
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/CHANGELOG.md +64 -0
- package/dist/{agent-LNTR4QH5.cjs → agent-5M7WLUWH.cjs} +8 -8
- package/dist/{agent-LNTR4QH5.cjs.map → agent-5M7WLUWH.cjs.map} +1 -1
- package/dist/{agent-3RcPVGMo.d.cts → agent-Dh2YHSLj.d.cts} +12 -0
- package/dist/{agent-7ERQNV66.js → agent-R5RERYFU.js} +7 -7
- package/dist/{agent-7ERQNV66.js.map → agent-R5RERYFU.js.map} +1 -1
- package/dist/{agent-lS68mYIL.d.ts → agent-enXXu447.d.ts} +12 -0
- package/dist/{chunk-2STSX2SY.cjs → chunk-56BCEM26.cjs} +32 -32
- package/dist/{chunk-2STSX2SY.cjs.map → chunk-56BCEM26.cjs.map} +1 -1
- package/dist/{chunk-DDRX4LYS.js → chunk-7QJYKVP6.js} +3 -3
- package/dist/{chunk-DDRX4LYS.js.map → chunk-7QJYKVP6.js.map} +1 -1
- package/dist/{chunk-XW4POZ6V.cjs → chunk-C7GKRGKN.cjs} +34 -13
- package/dist/chunk-C7GKRGKN.cjs.map +1 -0
- package/dist/{chunk-J4SA2ZEJ.cjs → chunk-KIKKTW5O.cjs} +4 -4
- package/dist/{chunk-J4SA2ZEJ.cjs.map → chunk-KIKKTW5O.cjs.map} +1 -1
- package/dist/{chunk-AOHRKGAA.cjs → chunk-LL4QA3DI.cjs} +4 -4
- package/dist/{chunk-AOHRKGAA.cjs.map → chunk-LL4QA3DI.cjs.map} +1 -1
- package/dist/{chunk-OCEQ6DW2.cjs → chunk-N6OEX5TN.cjs} +2 -2
- package/dist/chunk-N6OEX5TN.cjs.map +1 -0
- package/dist/{chunk-3CU5J7V3.js → chunk-OOM236Z4.js} +8 -8
- package/dist/{chunk-3CU5J7V3.js.map → chunk-OOM236Z4.js.map} +1 -1
- package/dist/{chunk-7GDHFV2M.js → chunk-OPAKPEPG.js} +2 -2
- package/dist/chunk-OPAKPEPG.js.map +1 -0
- package/dist/{chunk-FRL35MFN.js → chunk-QCIARBLS.js} +3 -3
- package/dist/{chunk-FRL35MFN.js.map → chunk-QCIARBLS.js.map} +1 -1
- package/dist/{chunk-KTA7YTZQ.cjs → chunk-XKZFIP7Z.cjs} +4 -4
- package/dist/{chunk-KTA7YTZQ.cjs.map → chunk-XKZFIP7Z.cjs.map} +1 -1
- package/dist/{chunk-W4VQMXBZ.js → chunk-ZDYDBXSD.js} +34 -13
- package/dist/chunk-ZDYDBXSD.js.map +1 -0
- package/dist/{chunk-PQCTDMUI.js → chunk-ZHWKT2NI.js} +3 -3
- package/dist/{chunk-PQCTDMUI.js.map → chunk-ZHWKT2NI.js.map} +1 -1
- package/dist/context/index.cjs +6 -6
- package/dist/context/index.js +3 -3
- package/dist/context-3FZRAO5K.js +7 -0
- package/dist/{context-SXR2HLHT.js.map → context-3FZRAO5K.js.map} +1 -1
- package/dist/{context-ZOULM2RB.cjs → context-B5J4GX2F.cjs} +7 -7
- package/dist/{context-ZOULM2RB.cjs.map → context-B5J4GX2F.cjs.map} +1 -1
- package/dist/{cron-DJv8zMa3.d.ts → cron-DTuaPMVI.d.ts} +1 -1
- package/dist/{cron-CGxoEKlx.d.cts → cron-QTgcwcZt.d.cts} +1 -1
- package/dist/cron.cjs +7 -7
- package/dist/cron.d.cts +2 -2
- package/dist/cron.d.ts +2 -2
- package/dist/cron.js +6 -6
- package/dist/eval.cjs +6 -6
- package/dist/eval.js +5 -5
- package/dist/index.cjs +24 -24
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +8 -8
- package/dist/internal/runtime/hooks/hooks-source.d.ts +24 -0
- package/dist/subagents-loader-5TZCAIYQ.cjs +16 -0
- package/dist/{subagents-loader-7GE7YUDI.cjs.map → subagents-loader-5TZCAIYQ.cjs.map} +1 -1
- package/dist/subagents-loader-PEV3PD4Q.js +7 -0
- package/dist/{subagents-loader-S2PMZY7J.js.map → subagents-loader-PEV3PD4Q.js.map} +1 -1
- package/dist/subagents-loader.cjs +2 -2
- package/dist/subagents-loader.d.cts +1 -1
- package/dist/subagents-loader.d.ts +1 -1
- package/dist/subagents-loader.js +1 -1
- package/dist/types/agent.d.ts +12 -0
- package/docs/error-codes.md +10 -9
- package/package.json +1 -1
- package/dist/chunk-7GDHFV2M.js.map +0 -1
- package/dist/chunk-OCEQ6DW2.cjs.map +0 -1
- package/dist/chunk-W4VQMXBZ.js.map +0 -1
- package/dist/chunk-XW4POZ6V.cjs.map +0 -1
- package/dist/context-SXR2HLHT.js +0 -7
- package/dist/subagents-loader-7GE7YUDI.cjs +0 -16
- package/dist/subagents-loader-S2PMZY7J.js +0 -7
|
@@ -47,6 +47,17 @@ async function readProjectSubagents(cwd, compatSources) {
|
|
|
47
47
|
}
|
|
48
48
|
return subagents;
|
|
49
49
|
}
|
|
50
|
+
function parseOrSkipForeignRuntime(raw, filename) {
|
|
51
|
+
try {
|
|
52
|
+
return parseSubagentMarkdown(raw, filename);
|
|
53
|
+
} catch (error) {
|
|
54
|
+
if (error instanceof ConfigurationError && error.code === "subagent_foreign_runtime_field") {
|
|
55
|
+
diag(`[theokit-sdk] ${filename}: ${error.message} \u2014 skipping this agent`);
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
throw error;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
50
61
|
async function readSubagentsFrom(root, subagents) {
|
|
51
62
|
const entries = await readWorkspaceDir(root, "subagents_read_error", "subagents directory");
|
|
52
63
|
for (const entry of entries) {
|
|
@@ -57,7 +68,8 @@ async function readSubagentsFrom(root, subagents) {
|
|
|
57
68
|
diag(`[theokit-sdk] ${entry.name} has no frontmatter \u2014 not an agent declaration, skipping`);
|
|
58
69
|
continue;
|
|
59
70
|
}
|
|
60
|
-
const definition =
|
|
71
|
+
const definition = parseOrSkipForeignRuntime(raw, entry.name);
|
|
72
|
+
if (definition === null) continue;
|
|
61
73
|
if (subagents[definition.name] === void 0) {
|
|
62
74
|
subagents[definition.name] = { ...definition.definition, source: path };
|
|
63
75
|
}
|
|
@@ -70,7 +82,8 @@ var ACCEPTED_FIELDS = /* @__PURE__ */ new Set([
|
|
|
70
82
|
"tools",
|
|
71
83
|
"reasoning_effort",
|
|
72
84
|
"mcp",
|
|
73
|
-
"sandbox"
|
|
85
|
+
"sandbox",
|
|
86
|
+
"memory"
|
|
74
87
|
]);
|
|
75
88
|
var INERT_CLAUDE_CODE_FIELDS = /* @__PURE__ */ new Set([
|
|
76
89
|
/** The CLI's label colour for the agent. Presentation only. */
|
|
@@ -91,6 +104,8 @@ function parseSubagentMarkdown(raw, filename) {
|
|
|
91
104
|
if (tools.length > 0) definition.tools = tools;
|
|
92
105
|
const sandbox = resolveSandbox(fields, filename);
|
|
93
106
|
if (sandbox !== void 0) definition.sandbox = sandbox;
|
|
107
|
+
const memory = asString(fields.memory);
|
|
108
|
+
if (memory !== void 0) definition.memory = memory;
|
|
94
109
|
const name = asString(fields.name) ?? filename.replace(/\.md$/, "");
|
|
95
110
|
return { name, definition };
|
|
96
111
|
}
|
|
@@ -99,7 +114,6 @@ var KNOWN_CLAUDE_CODE_FIELDS = /* @__PURE__ */ new Set([
|
|
|
99
114
|
"permissionMode",
|
|
100
115
|
"maxTurns",
|
|
101
116
|
"skills",
|
|
102
|
-
"memory",
|
|
103
117
|
"background",
|
|
104
118
|
"effort",
|
|
105
119
|
"isolation",
|
|
@@ -108,17 +122,24 @@ var KNOWN_CLAUDE_CODE_FIELDS = /* @__PURE__ */ new Set([
|
|
|
108
122
|
"experimental",
|
|
109
123
|
"mcpServers"
|
|
110
124
|
]);
|
|
125
|
+
function unknownFieldError(key, filename) {
|
|
126
|
+
const foreign = KNOWN_CLAUDE_CODE_FIELDS.has(key);
|
|
127
|
+
const siblings = [...KNOWN_CLAUDE_CODE_FIELDS].filter((f) => f !== key);
|
|
128
|
+
const origin = foreign ? ` \u2014 "${key}" is a Claude Code subagent field that this runtime does not support. The same applies to: ${siblings.join(", ")}. Removing them one at a time will meet each in turn; the tree is written for another runtime` : "";
|
|
129
|
+
if (foreign)
|
|
130
|
+
return new ConfigurationError(
|
|
131
|
+
`Subagent ${filename}: unknown frontmatter field "${key}" (accepted: ${[...ACCEPTED_FIELDS].join(", ")})${origin}`,
|
|
132
|
+
{ code: "subagent_foreign_runtime_field" }
|
|
133
|
+
);
|
|
134
|
+
return new ConfigurationError(
|
|
135
|
+
`Subagent ${filename}: unknown frontmatter field "${key}" (accepted: ${[...ACCEPTED_FIELDS].join(", ")})${origin}`,
|
|
136
|
+
{ code: "subagent_unknown_field" }
|
|
137
|
+
);
|
|
138
|
+
}
|
|
111
139
|
function rejectUnknownFields(fields, filename) {
|
|
112
140
|
for (const key of Object.keys(fields)) {
|
|
113
141
|
if (INERT_CLAUDE_CODE_FIELDS.has(key)) continue;
|
|
114
|
-
if (!ACCEPTED_FIELDS.has(key))
|
|
115
|
-
const siblings = [...KNOWN_CLAUDE_CODE_FIELDS].filter((f) => f !== key);
|
|
116
|
-
const origin = KNOWN_CLAUDE_CODE_FIELDS.has(key) ? ` \u2014 "${key}" is a Claude Code subagent field that this runtime does not support. The same applies to: ${siblings.join(", ")}. Removing them one at a time will meet each in turn; the tree is written for another runtime` : "";
|
|
117
|
-
throw new ConfigurationError(
|
|
118
|
-
`Subagent ${filename}: unknown frontmatter field "${key}" (accepted: ${[...ACCEPTED_FIELDS].join(", ")})${origin}`,
|
|
119
|
-
{ code: "subagent_unknown_field" }
|
|
120
|
-
);
|
|
121
|
-
}
|
|
142
|
+
if (!ACCEPTED_FIELDS.has(key)) throw unknownFieldError(key, filename);
|
|
122
143
|
}
|
|
123
144
|
}
|
|
124
145
|
function rejectMcp(fields, filename) {
|
|
@@ -181,5 +202,5 @@ function parseFrontmatterFields(frontmatter) {
|
|
|
181
202
|
}
|
|
182
203
|
|
|
183
204
|
export { loadSubagents, pluginBundleDirs };
|
|
184
|
-
//# sourceMappingURL=chunk-
|
|
185
|
-
//# sourceMappingURL=chunk-
|
|
205
|
+
//# sourceMappingURL=chunk-ZDYDBXSD.js.map
|
|
206
|
+
//# sourceMappingURL=chunk-ZDYDBXSD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/internal/runtime/plugin-loader/plugin-bundles.ts","../src/internal/runtime/skills/subagents-loader.ts"],"names":["join"],"mappings":";;;;;;;AAyBA,eAAsB,gBAAA,CACpB,GAAA,EAEA,aAAA,GAAoD,EAAC,EAClC;AACnB,EAAA,MAAM,OAAiB,EAAC;AACxB,EAAA,KAAA,MAAW,IAAA,IAAQ,iBAAA,CAAkB,GAAA,EAAK,aAAa,CAAA,EAAG;AACxD,IAAA,IAAI,OAAA;AACJ,IAAA,IAAI;AACF,MAAA,OAAA,GAAU,MAAM,OAAA,CAAQ,IAAA,EAAM,EAAE,aAAA,EAAe,MAAM,CAAA;AAAA,IACvD,CAAA,CAAA,MAAQ;AACN,MAAA;AAAA,IACF;AACA,IAAA,KAAA,MAAW,SAAS,OAAA,EAAS;AAC3B,MAAA,IAAI,KAAA,CAAM,aAAY,EAAG,IAAA,CAAK,KAAK,IAAA,CAAK,IAAA,EAAM,KAAA,CAAM,IAAI,CAAC,CAAA;AAAA,IAC3D;AAAA,EACF;AACA,EAAA,OAAO,IAAA;AACT;;;ACrBA,eAAsB,cACpB,GAAA,EACA,4BAAA,EACA,MAAA,EAEA,aAAA,GAAoD,EAAC,EACX;AAC1C,EAAA,MAAM,SAA0C,EAAC;AACjD,EAAA,IAAI,4BAAA,EAA8B;AAChC,IAAA,MAAM,aAAA,GAAgB,MAAM,oBAAA,CAAqB,GAAA,EAAK,aAAa,CAAA;AACnE,IAAA,KAAA,MAAW,CAAC,IAAA,EAAM,UAAU,KAAK,MAAA,CAAO,OAAA,CAAQ,aAAa,CAAA,EAAG;AAC9D,MAAA,MAAA,CAAO,IAAI,CAAA,GAAI,UAAA;AAAA,IACjB;AAAA,EACF;AACA,EAAA,IAAI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S,uBAAuB,WAAA,EAAmE;AAIjG,EAAA,OAAO,gBAAgB,WAAW,CAAA;AACpC","file":"chunk-ZDYDBXSD.js","sourcesContent":["/**\n * Locating the plugin bundles a project carries.\n *\n * Shared by the skills and subagents loaders, which both need the same answer to \"which folders in\n * this project are plugins\" and would otherwise each grow their own copy of the directory walk.\n *\n * @internal\n */\n\nimport type { Dirent } from \"node:fs\";\nimport { readdir } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { pluginBundleRoots } from \"../../persistence/paths.js\";\nimport type { CompatSourceDeclaration } from \"../compat/foreign-config-sources.js\";\n\n/**\n * Every plugin folder under the project's plugin roots.\n *\n * Returns the FOLDERS, not their contents — what a bundle contributes (`skills/`, `agents/`) is the\n * caller's business, and a loader that also knew the layout would have to change whenever the other\n * one did.\n *\n * A missing root is not an error: most projects carry no plugins, and treating their absence as a\n * failure would make \"none installed\" indistinguishable from \"the directory could not be read\".\n */\nexport async function pluginBundleDirs(\n cwd: string,\n /** Declared foreign dialects (#524). Empty reads `.theokit/plugins` only. */\n compatSources: readonly CompatSourceDeclaration[] = [],\n): Promise<string[]> {\n const dirs: string[] = [];\n for (const root of pluginBundleRoots(cwd, compatSources)) {\n let entries: Dirent[];\n try {\n entries = await readdir(root, { withFileTypes: true });\n } catch {\n continue;\n }\n for (const entry of entries) {\n if (entry.isDirectory()) dirs.push(join(root, entry.name));\n }\n }\n return dirs;\n}\n","import { readFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\n\nimport { ConfigurationError } from \"../../../errors.js\";\nimport type { AgentDefinition } from \"../../../types/agent.js\";\nimport type { ModelSelection } from \"../../../types/agent-prims.js\";\nimport { diag } from \"../../diagnostics.js\";\nimport { projectConfigRoots } from \"../../persistence/paths.js\";\nimport type { CompatSourceDeclaration } from \"../compat/foreign-config-sources.js\";\nimport { readWorkspaceDir } from \"../config/workspace-dir.js\";\nimport { type FrontmatterValue, parseSimpleYaml } from \"../context/yaml-frontmatter.js\";\nimport { pluginBundleDirs } from \"../plugin-loader/plugin-bundles.js\";\n\n/**\n * Load file-based subagents from `.theokit/agents/*.md` and merge with\n * inline definitions. Inline overrides file-based on name conflict.\n *\n * Each markdown file has YAML frontmatter (description + optional model)\n * and a body that becomes the subagent prompt.\n *\n * @internal\n */\nexport async function loadSubagents(\n cwd: string,\n settingSourcesIncludeProject: boolean,\n inline: Record<string, AgentDefinition> | undefined,\n /** Declared foreign dialects (#524). Empty reads `.theokit/` only. */\n compatSources: readonly CompatSourceDeclaration[] = [],\n): Promise<Record<string, AgentDefinition>> {\n const result: Record<string, AgentDefinition> = {};\n if (settingSourcesIncludeProject) {\n const projectAgents = await readProjectSubagents(cwd, compatSources);\n for (const [name, definition] of Object.entries(projectAgents)) {\n result[name] = definition;\n }\n }\n if (inline !== undefined) {\n for (const [name, definition] of Object.entries(inline)) {\n result[name] = definition;\n }\n }\n return result;\n}\n\n/**\n * Read agent declarations from every project config root (`.theokit`, then `.claude`).\n *\n * FIRST occurrence of a name wins, which is what makes `projectConfigRoots`' order a contract rather\n * than a detail: a project declaring the same agent in both means the explicit namespace.\n */\nasync function readProjectSubagents(\n cwd: string,\n compatSources: readonly CompatSourceDeclaration[],\n): Promise<Record<string, AgentDefinition>> {\n const subagents: Record<string, AgentDefinition> = {};\n for (const configRoot of projectConfigRoots(cwd, compatSources, \"subagents\")) {\n await readSubagentsFrom(join(configRoot, \"agents\"), subagents);\n }\n // A Claude Code plugin is a BUNDLE, and its `agents/` is what it exists to contribute. Read after\n // the project's own, so a project can shadow an agent a plugin ships without editing the plugin.\n for (const bundle of await pluginBundleDirs(cwd, compatSources)) {\n await readSubagentsFrom(join(bundle, \"agents\"), subagents);\n }\n return subagents;\n}\n\n/**\n * Parse an agent file, or return null when it was written for another runtime.\n *\n * ## What this changed, and what it deliberately did not\n *\n * The failure used to take the whole directory, and that was a decision rather than an oversight:\n * \"a file that HAS frontmatter and gets it wrong is a broken agent and still fails loudly, which is\n * what keeps a typo'd `sandbox` from returning as a silent gate through this door. Isolating the\n * failure per file would hand that risk back.\"\n *\n * The risk named there is real and is NOT handed back, because the isolation is narrower than the\n * one that argument refuses. Only `KNOWN_CLAUDE_CODE_FIELDS` takes this door — the set that already\n * encodes \"this key belongs to another runtime and carries no behaviour here\". A misspelling of one\n * of OUR keys carries `subagent_unknown_field` and still propagates, so `sandboxx` remains fatal\n * and cannot return as a silent gate. `a-claude-code-field-names-itself.test.ts` pins both halves.\n *\n * What moved the decision was the cost, measured in a live TUI on 2026-09-15: one ported\n * `.claude/agents/*.md` carrying `memory:` stopped every sibling agent from loading and the turn\n * produced no answer at all — on an agent the task never used. Beside it, on the same prompt and\n * the same project, another runtime answered normally. The diagnosis fix this file shipped tells a\n * user which key is foreign; it does not give them back the turn.\n *\n * The loader already draws exactly this line for a file with no frontmatter, and for the same\n * stated reason: one of them must not stop every agent in the directory from loading.\n */\nfunction parseOrSkipForeignRuntime(\n raw: string,\n filename: string,\n): { name: string; definition: AgentDefinition } | null {\n try {\n return parseSubagentMarkdown(raw, filename);\n } catch (error) {\n if (error instanceof ConfigurationError && error.code === \"subagent_foreign_runtime_field\") {\n diag(`[theokit-sdk] ${filename}: ${error.message} — skipping this agent`);\n return null;\n }\n throw error;\n }\n}\n\nasync function readSubagentsFrom(\n root: string,\n subagents: Record<string, AgentDefinition>,\n): Promise<void> {\n const entries = await readWorkspaceDir(root, \"subagents_read_error\", \"subagents directory\");\n for (const entry of entries) {\n if (!entry.isFile() || !entry.name.endsWith(\".md\")) continue;\n const path = join(root, entry.name);\n const raw = await readFile(path, \"utf8\");\n // A markdown file with NO frontmatter is not an agent declaration — a directory of agents\n // written for the Claude Code CLI conventionally carries documentation beside them, and\n // `.claude/agents/README.md` exists in this repository. Throwing on it made ONE such file stop\n // every agent in the directory from loading.\n //\n // Skipped with a warn rather than in silence, and ONLY for the no-frontmatter case: a file that\n // HAS frontmatter and gets it wrong is a broken agent and still fails loudly, which is what\n // keeps a typo'd `sandbox` from returning as a silent gate through this door.\n if (!hasFrontmatter(raw)) {\n diag(`[theokit-sdk] ${entry.name} has no frontmatter — not an agent declaration, skipping`);\n continue;\n }\n const definition = parseOrSkipForeignRuntime(raw, entry.name);\n if (definition === null) continue;\n if (subagents[definition.name] === undefined) {\n // `path` is computed above to read the file and was then dropped. Keeping it is the whole\n // visibility fix (#524): without it a listing cannot say which root an agent came from.\n subagents[definition.name] = { ...definition.definition, source: path };\n }\n }\n}\n\n// The frontmatter keys a disk subagent may declare. Any other key is a typed load\n// error rather than a silent drop — a dropped `sandbox` an operator wrote believing\n// it confines the child is exactly the silent-gate failure class this guards against.\nconst ACCEPTED_FIELDS = new Set([\n \"name\",\n \"description\",\n \"model\",\n \"tools\",\n \"reasoning_effort\",\n \"mcp\",\n \"sandbox\",\n \"memory\",\n]);\n\n// Fields the Claude Code CLI writes that carry NO behaviour for this runtime. Accepted and ignored,\n// so an agent authored for the CLI loads here unchanged — measured 2026-08-26 across the 59 agent\n// files on one machine, where `color` appeared in 38 of them and made every one of those a\n// `subagent_unknown_field` load error.\n//\n// Named explicitly instead of loosening the check above, because that check's reason is sound: a\n// dropped `sandbox` an operator wrote believing it confines the child is a silent gate. A field that\n// COULD change behaviour must still fail loudly. This set is the difference between \"we know this\n// one and it does nothing\" and \"we have never heard of this\" — two facts a bare allow-everything\n// would collapse into one.\n//\n// Anything added here needs the same justification: inert for THIS runtime, not merely unfamiliar.\nconst INERT_CLAUDE_CODE_FIELDS = new Set([\n /** The CLI's label colour for the agent. Presentation only. */\n \"color\",\n]);\n\nfunction parseSubagentMarkdown(\n raw: string,\n filename: string,\n): { name: string; definition: AgentDefinition } {\n const { frontmatter, body } = splitFrontmatter(raw, filename);\n const fields = parseFrontmatterFields(frontmatter);\n rejectUnknownFields(fields, filename);\n rejectMcp(fields, filename);\n\n const definition: AgentDefinition = {\n description: asString(fields.description) ?? \"\",\n prompt: body,\n };\n const model = resolveModel(fields, filename);\n if (model !== undefined) definition.model = model;\n const tools = toStringList(fields.tools);\n if (tools.length > 0) definition.tools = tools;\n const sandbox = resolveSandbox(fields, filename);\n if (sandbox !== undefined) definition.sandbox = sandbox;\n // Carried unjudged — see `AgentDefinition.memory`. Which root a scope names, and whether the\n // name is one at all, is `@theokit/agents`' decision and refusing it twice means two lists.\n const memory = asString(fields.memory);\n if (memory !== undefined) definition.memory = memory;\n\n const name = asString(fields.name) ?? filename.replace(/\\.md$/, \"\");\n return { name, definition };\n}\n\n/**\n * Frontmatter keys that Claude Code documents for a subagent and this runtime does not accept.\n *\n * Not an allow-list — every one of these still fails the load. It exists so the FAILURE can say\n * which kind of unknown it met. A user migrating a `.claude/agents/` tree used to learn one key per\n * round trip: fix `memory`, meet `permissionMode`, fix that, meet `maxTurns` — with nothing saying\n * the set was finite or that the tree was simply written for another runtime.\n *\n * The distinction this file already draws for `INERT_CLAUDE_CODE_FIELDS` is the same one: \"the\n * difference between 'we know this one and it does nothing' and 'we have never heard of this' — two\n * facts a bare allow-everything would collapse into one.\" This is the third fact beside them —\n * \"another runtime's field\" — and it changes only the message, never the verdict.\n */\nconst KNOWN_CLAUDE_CODE_FIELDS = new Set([\n \"disallowedTools\",\n \"permissionMode\",\n \"maxTurns\",\n \"skills\",\n \"background\",\n \"effort\",\n \"isolation\",\n \"initialPrompt\",\n \"hooks\",\n \"experimental\",\n \"mcpServers\",\n]);\n\n/**\n * The typed error for a key we do not accept. Built here rather than inline so `rejectUnknownFields`\n * stays a plain loop: the message has two shapes and the code has two values, and computing all four\n * at the throw site is what pushed that function past the cognitive-complexity gate.\n */\nfunction unknownFieldError(key: string, filename: string): ConfigurationError {\n const foreign = KNOWN_CLAUDE_CODE_FIELDS.has(key);\n const siblings = [...KNOWN_CLAUDE_CODE_FIELDS].filter((f) => f !== key);\n const origin = foreign\n ? ` — \"${key}\" is a Claude Code subagent field that this runtime does not support. ` +\n `The same applies to: ${siblings.join(\", \")}. Removing them one at a time will meet each ` +\n `in turn; the tree is written for another runtime`\n : \"\";\n // The two codes are written as LITERALS, one per branch, rather than as a ternary inside the\n // options object. `tools/generate-error-codes.mjs` walks the source for the literal assigned to\n // `code:`, so a ternary there is not a literal and it extracted NEITHER — measured 2026-09-15,\n // when `quality:docs-errors` went red and the regenerated reference had lost\n // `subagent_unknown_field` without ever gaining `subagent_foreign_runtime_field`. Two real,\n // throwable codes were absent from the published error reference, which is the one place a\n // consumer looks to find out what they can catch.\n if (foreign)\n return new ConfigurationError(\n `Subagent ${filename}: unknown frontmatter field \"${key}\" (accepted: ${[...ACCEPTED_FIELDS].join(\", \")})${origin}`,\n { code: \"subagent_foreign_runtime_field\" },\n );\n return new ConfigurationError(\n `Subagent ${filename}: unknown frontmatter field \"${key}\" (accepted: ${[...ACCEPTED_FIELDS].join(\", \")})${origin}`,\n { code: \"subagent_unknown_field\" },\n );\n}\n\nfunction rejectUnknownFields(\n fields: Record<string, FrontmatterValue | undefined>,\n filename: string,\n): void {\n for (const key of Object.keys(fields)) {\n if (INERT_CLAUDE_CODE_FIELDS.has(key)) continue;\n if (!ACCEPTED_FIELDS.has(key)) throw unknownFieldError(key, filename);\n }\n}\n\n// mcp: a known field, but not yet honored on the LOCAL delegation path. The frontmatter YAML can only\n// express server NAMES (parseSimpleYaml has no nested-object support), while a child's `Agent.create`\n// needs `mcpServers` as a Record<name, config>; resolving names→config per-subagent in local delegation\n// is its own follow-up. Rather than silently drop it (the M26/M32 silent-gate class), it is a typed load\n// error that names the field and points at the alternative.\nfunction rejectMcp(fields: Record<string, FrontmatterValue | undefined>, filename: string): void {\n if (fields.mcp !== undefined) {\n throw new ConfigurationError(\n `Subagent ${filename}: per-subagent \"mcp\" is not yet supported on the local delegation path; declare MCP servers in .theokit/mcp.json (or the parent) instead`,\n { code: \"subagent_mcp_unsupported_local\" },\n );\n }\n}\n\n// model + reasoning_effort — effort rides inside `model.params[thinking]`, so it requires a concrete\n// model id to attach to (a child inheriting the parent's model cannot carry the parent's provider-\n// specific effort param safely).\nfunction resolveModel(\n fields: Record<string, FrontmatterValue | undefined>,\n filename: string,\n): ModelSelection | \"inherit\" | undefined {\n const modelId = asString(fields.model);\n const effort = asString(fields.reasoning_effort);\n // reasoning_effort rides in model.params[thinking], so it needs a CONCRETE model id to attach to.\n // Neither an absent model NOR `model: inherit` can carry it (the inherited id is unknown at load), so\n // both are typed errors rather than a silently-dropped effort — the silent-gate class this guards.\n if (effort !== undefined && (modelId === undefined || modelId === \"inherit\")) {\n throw new ConfigurationError(\n `Subagent ${filename}: reasoning_effort requires a concrete model (effort is a model parameter; an absent model or \"inherit\" cannot carry it)`,\n { code: \"subagent_reasoning_effort_without_model\" },\n );\n }\n if (modelId === undefined) return undefined;\n if (modelId === \"inherit\") return \"inherit\";\n return effort !== undefined\n ? { id: modelId, params: [{ id: \"thinking\", value: effort }] }\n : { id: modelId };\n}\n\n// sandbox: boolean only. A granular mode string (read-only/…) is unsupported by the SDK runtime and is\n// a typed error rather than a silent coercion to a boolean.\nfunction resolveSandbox(\n fields: Record<string, FrontmatterValue | undefined>,\n filename: string,\n): boolean | undefined {\n if (fields.sandbox === undefined) return undefined;\n if (typeof fields.sandbox !== \"boolean\") {\n throw new ConfigurationError(\n `Subagent ${filename}: sandbox must be a boolean (got \"${String(fields.sandbox)}\"); granular sandbox modes are not supported by the runtime`,\n { code: \"subagent_sandbox_not_boolean\" },\n );\n }\n return fields.sandbox;\n}\n\nfunction asString(v: FrontmatterValue | undefined): string | undefined {\n if (typeof v !== \"string\") return undefined;\n // parseSimpleYaml does not strip quotes (documented), and `model`/`reasoning_effort` are fields users\n // habitually quote (`model: \"openai/gpt-4o\"`). Strip a single matching surrounding quote pair so a\n // quoted id/effort does not slip past validation and fail only at the provider.\n const m = /^([\"'])(.*)\\1$/.exec(v);\n return m ? m[2] : v;\n}\n\n/** Accept a YAML list (`string[]`) or a comma/space-separated scalar; trim + drop empties. */\nfunction toStringList(v: FrontmatterValue | undefined): string[] {\n if (Array.isArray(v)) return v.map((t) => t.trim()).filter((t) => t.length > 0);\n if (typeof v === \"string\") {\n return v\n .split(/[\\s,]+/)\n .map((t) => t.trim())\n .filter((t) => t.length > 0);\n }\n return [];\n}\n\n/** Does this file open with a frontmatter block at all? Its ABSENCE means \"not an agent\". */\nfunction hasFrontmatter(raw: string): boolean {\n return /^---\\s*\\n/.test(raw);\n}\n\nfunction splitFrontmatter(raw: string, filename: string): { frontmatter: string; body: string } {\n const match = /^---\\s*\\n([\\s\\S]*?)\\n---\\s*\\n([\\s\\S]*)$/.exec(raw);\n if (match === null) {\n throw new ConfigurationError(`Subagent ${filename} is missing frontmatter`, {\n code: \"subagent_missing_frontmatter\",\n });\n }\n return { frontmatter: match[1] ?? \"\", body: (match[2] ?? \"\").trim() };\n}\n\nfunction parseFrontmatterFields(frontmatter: string): Record<string, FrontmatterValue | undefined> {\n // Preserve the rich YAML value types (boolean/number/string[]): `sandbox: true` and\n // `mcp: [a, b]` are meaningful here, so narrowing everything to string (as the\n // pre-M33 loader did) would drop them. Per-field validation happens in parseSubagentMarkdown.\n return parseSimpleYaml(frontmatter);\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { warnOnce } from './chunk-
|
|
1
|
+
import { warnOnce } from './chunk-OPAKPEPG.js';
|
|
2
2
|
import { AsyncLocalStorage } from 'async_hooks';
|
|
3
3
|
|
|
4
4
|
var storage = new AsyncLocalStorage();
|
|
@@ -16,5 +16,5 @@ function warnPersonalitySwitchInsideFork(agentId) {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export { currentPersonalityContext, warnPersonalitySwitchInsideFork, withPersonalityContext };
|
|
19
|
-
//# sourceMappingURL=chunk-
|
|
20
|
-
//# sourceMappingURL=chunk-
|
|
19
|
+
//# sourceMappingURL=chunk-ZHWKT2NI.js.map
|
|
20
|
+
//# sourceMappingURL=chunk-ZHWKT2NI.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/internal/personality/context.ts"],"names":[],"mappings":";;;AAiCA,IAAM,OAAA,GAAU,IAAI,iBAAA,EAA0C;AAQvD,SAAS,sBAAA,CACd,KACA,EAAA,EACY;AACZ,EAAA,OAAO,OAAA,CAAQ,GAAA,CAAI,GAAA,EAAK,EAAE,CAAA;AAC5B;AAQO,SAAS,yBAAA,GAAgE;AAC9E,EAAA,OAAO,QAAQ,QAAA,EAAS;AAC1B;AASO,SAAS,gCAAgC,OAAA,EAAuB;AACrE,EAAA,QAAA;AAAA,IACE,8BAA8B,OAAO,CAAA,CAAA;AAAA,IACrC,CAAA,0IAAA;AAAA,GACF;AACF","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/internal/personality/context.ts"],"names":[],"mappings":";;;AAiCA,IAAM,OAAA,GAAU,IAAI,iBAAA,EAA0C;AAQvD,SAAS,sBAAA,CACd,KACA,EAAA,EACY;AACZ,EAAA,OAAO,OAAA,CAAQ,GAAA,CAAI,GAAA,EAAK,EAAE,CAAA;AAC5B;AAQO,SAAS,yBAAA,GAAgE;AAC9E,EAAA,OAAO,QAAQ,QAAA,EAAS;AAC1B;AASO,SAAS,gCAAgC,OAAA,EAAuB;AACrE,EAAA,QAAA;AAAA,IACE,8BAA8B,OAAO,CAAA,CAAA;AAAA,IACrC,CAAA,0IAAA;AAAA,GACF;AACF","file":"chunk-ZHWKT2NI.js","sourcesContent":["/**\n * Personality fork-context (ADR D168 + EC-A snapshot semantic).\n *\n * Uses Node's `AsyncLocalStorage` so a fork's execution chain can know\n * that it is running inside a fork AND can see the slug that was active\n * on the parent **at fork-construction time**.\n *\n * **EC-A:** The slug stored here is captured ONCE at the wrap site\n * (`localAgentFork`) — passing `parentStore.active(parentAgentId)`\n * returns a primitive `string | undefined`, which is then frozen\n * inside the ALS context object. Subsequent `usePersonality` calls on\n * the parent do NOT mutate the fork's view, because the fork reads from\n * its own ALS frame, not from the parent's store.\n *\n * @internal\n */\n\nimport { AsyncLocalStorage } from \"node:async_hooks\";\n\nimport { warnOnce } from \"../runtime/hooks/hooks-source.js\";\n\n/**\n * Snapshot data carried into a fork's async context.\n *\n * @internal\n */\nexport interface PersonalityForkContext {\n /** Parent's active personality slug at fork-construction time. */\n readonly slug: string | undefined;\n /** Always `true` inside this scope (used by guards). */\n readonly isFork: true;\n}\n\nconst storage = new AsyncLocalStorage<PersonalityForkContext>();\n\n/**\n * Run `fn` with `ctx` bound as the active fork context. Nested calls\n * shadow the outer context (EC-22).\n *\n * @internal\n */\nexport function withPersonalityContext<T>(\n ctx: PersonalityForkContext,\n fn: () => Promise<T>,\n): Promise<T> {\n return storage.run(ctx, fn);\n}\n\n/**\n * Return the active fork context, or `undefined` when called outside a\n * fork scope.\n *\n * @internal\n */\nexport function currentPersonalityContext(): PersonalityForkContext | undefined {\n return storage.getStore();\n}\n\n/**\n * Emit one warning per agentId stating that personality switches inside\n * a fork are no-ops. The fork inherits the parent snapshot — runtime\n * mutation is intentionally rejected to keep fork voice deterministic.\n *\n * @internal\n */\nexport function warnPersonalitySwitchInsideFork(agentId: string): void {\n warnOnce(\n `personality-switch-in-fork-${agentId}`,\n `[theokit-sdk] usePersonality is a no-op inside a fork (D168). Subagents inherit the parent's active personality at fork-construction time.`,\n );\n}\n"]}
|
package/dist/context/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var chunkXKZFIP7Z_cjs = require('../chunk-XKZFIP7Z.cjs');
|
|
4
|
+
require('../chunk-N6OEX5TN.cjs');
|
|
5
5
|
require('../chunk-KRD3GQAA.cjs');
|
|
6
6
|
var chunkSWALPLFQ_cjs = require('../chunk-SWALPLFQ.cjs');
|
|
7
7
|
require('../chunk-SA6K24NB.cjs');
|
|
@@ -17,20 +17,20 @@ function resolveContextImports(content, basePath, options) {
|
|
|
17
17
|
maxBytesPerFile: options.maxBytesPerFile,
|
|
18
18
|
projectRoot: options.projectRoot
|
|
19
19
|
};
|
|
20
|
-
return
|
|
20
|
+
return chunkXKZFIP7Z_cjs.resolveImports(content, basePath, internalOptions);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
Object.defineProperty(exports, "parseRules", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkXKZFIP7Z_cjs.parseRules; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "runDiscovery", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkXKZFIP7Z_cjs.runDiscovery; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "shouldActivateRule", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunkXKZFIP7Z_cjs.shouldActivateRule; }
|
|
34
34
|
});
|
|
35
35
|
Object.defineProperty(exports, "DEFAULT_DISCOVERY_SPECS", {
|
|
36
36
|
enumerable: true,
|
package/dist/context/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { resolveImports } from '../chunk-
|
|
2
|
-
export { parseRules, runDiscovery, shouldActivateRule } from '../chunk-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
import { resolveImports } from '../chunk-7QJYKVP6.js';
|
|
2
|
+
export { parseRules, runDiscovery, shouldActivateRule } from '../chunk-7QJYKVP6.js';
|
|
3
|
+
import '../chunk-OPAKPEPG.js';
|
|
4
4
|
import '../chunk-KVNWIAO4.js';
|
|
5
5
|
export { DEFAULT_DISCOVERY_SPECS, withheldSpecs } from '../chunk-4QCJAJAG.js';
|
|
6
6
|
import '../chunk-UKMBRMGT.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { currentPersonalityContext, warnPersonalitySwitchInsideFork, withPersonalityContext } from './chunk-ZHWKT2NI.js';
|
|
2
|
+
import './chunk-OPAKPEPG.js';
|
|
3
|
+
import './chunk-X7EUUHXU.js';
|
|
4
|
+
import './chunk-B5MHRQJZ.js';
|
|
5
|
+
import './chunk-CZJ6Q7CW.js';
|
|
6
|
+
//# sourceMappingURL=context-3FZRAO5K.js.map
|
|
7
|
+
//# sourceMappingURL=context-3FZRAO5K.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"context-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"context-3FZRAO5K.js"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunkKIKKTW5O_cjs = require('./chunk-KIKKTW5O.cjs');
|
|
4
|
+
require('./chunk-N6OEX5TN.cjs');
|
|
5
5
|
require('./chunk-TY56BKSK.cjs');
|
|
6
6
|
require('./chunk-UNFBHV46.cjs');
|
|
7
7
|
require('./chunk-6LHQPOMI.cjs');
|
|
@@ -10,15 +10,15 @@ require('./chunk-6LHQPOMI.cjs');
|
|
|
10
10
|
|
|
11
11
|
Object.defineProperty(exports, "currentPersonalityContext", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkKIKKTW5O_cjs.currentPersonalityContext; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "warnPersonalitySwitchInsideFork", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkKIKKTW5O_cjs.warnPersonalitySwitchInsideFork; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "withPersonalityContext", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkKIKKTW5O_cjs.withPersonalityContext; }
|
|
22
22
|
});
|
|
23
|
-
//# sourceMappingURL=context-
|
|
24
|
-
//# sourceMappingURL=context-
|
|
23
|
+
//# sourceMappingURL=context-B5J4GX2F.cjs.map
|
|
24
|
+
//# sourceMappingURL=context-B5J4GX2F.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"context-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"context-B5J4GX2F.cjs"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Workflow, WorkflowRun } from './workflow.js';
|
|
2
2
|
import { ab as SDKUserMessage, b as Run } from './run-DsA5Ip2i.js';
|
|
3
|
-
import { A as AgentOptions, d as ListResult } from './agent-
|
|
3
|
+
import { A as AgentOptions, d as ListResult } from './agent-enXXu447.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Owner: `internal/cron/` (4 of 5 importers). Derived from the import graph, not declared —
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Workflow, WorkflowRun } from './workflow.cjs';
|
|
2
2
|
import { ab as SDKUserMessage, b as Run } from './run-DsA5Ip2i.cjs';
|
|
3
|
-
import { A as AgentOptions, d as ListResult } from './agent-
|
|
3
|
+
import { A as AgentOptions, d as ListResult } from './agent-Dh2YHSLj.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Owner: `internal/cron/` (4 of 5 importers). Derived from the import graph, not declared —
|
package/dist/cron.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunkLL4QA3DI_cjs = require('./chunk-LL4QA3DI.cjs');
|
|
4
|
+
require('./chunk-56BCEM26.cjs');
|
|
5
5
|
require('./chunk-J6GXS5A2.cjs');
|
|
6
6
|
require('./chunk-PSLCVSCS.cjs');
|
|
7
7
|
require('./chunk-BUUUWQMB.cjs');
|
|
8
8
|
require('./chunk-TTBIQTO5.cjs');
|
|
9
|
-
require('./chunk-
|
|
9
|
+
require('./chunk-KIKKTW5O.cjs');
|
|
10
10
|
require('./chunk-BV2MWEMV.cjs');
|
|
11
11
|
require('./chunk-MEUBLCM4.cjs');
|
|
12
12
|
require('./chunk-GHX4P3V2.cjs');
|
|
@@ -20,8 +20,8 @@ require('./chunk-WPO3VCY4.cjs');
|
|
|
20
20
|
require('./chunk-QOGNZMHD.cjs');
|
|
21
21
|
require('./chunk-YIFFF23U.cjs');
|
|
22
22
|
require('./chunk-2ZPEDVLM.cjs');
|
|
23
|
-
require('./chunk-
|
|
24
|
-
require('./chunk-
|
|
23
|
+
require('./chunk-XKZFIP7Z.cjs');
|
|
24
|
+
require('./chunk-N6OEX5TN.cjs');
|
|
25
25
|
require('./chunk-KRD3GQAA.cjs');
|
|
26
26
|
require('./chunk-RQMCOFAI.cjs');
|
|
27
27
|
require('./chunk-MUUQ2WFJ.cjs');
|
|
@@ -45,7 +45,7 @@ require('./chunk-OF2CLCTH.cjs');
|
|
|
45
45
|
require('./chunk-ZF2LDKQQ.cjs');
|
|
46
46
|
require('./chunk-GHHIJEFX.cjs');
|
|
47
47
|
require('./chunk-JLRLCBJ4.cjs');
|
|
48
|
-
require('./chunk-
|
|
48
|
+
require('./chunk-C7GKRGKN.cjs');
|
|
49
49
|
require('./chunk-TY56BKSK.cjs');
|
|
50
50
|
require('./chunk-MPR2ISL2.cjs');
|
|
51
51
|
require('./chunk-J5623RIV.cjs');
|
|
@@ -63,7 +63,7 @@ require('./chunk-6LHQPOMI.cjs');
|
|
|
63
63
|
|
|
64
64
|
Object.defineProperty(exports, "Cron", {
|
|
65
65
|
enumerable: true,
|
|
66
|
-
get: function () { return
|
|
66
|
+
get: function () { return chunkLL4QA3DI_cjs.Cron; }
|
|
67
67
|
});
|
|
68
68
|
//# sourceMappingURL=cron.cjs.map
|
|
69
69
|
//# sourceMappingURL=cron.cjs.map
|
package/dist/cron.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './workflow.cjs';
|
|
2
2
|
import './run-DsA5Ip2i.cjs';
|
|
3
|
-
import './agent-
|
|
4
|
-
export { C as Cron } from './cron-
|
|
3
|
+
import './agent-Dh2YHSLj.cjs';
|
|
4
|
+
export { C as Cron } from './cron-QTgcwcZt.cjs';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import './sdk-agent-dNwjwCt5.cjs';
|
|
7
7
|
import './errors-base-B5g01neU.cjs';
|
package/dist/cron.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './workflow.js';
|
|
2
2
|
import './run-DsA5Ip2i.js';
|
|
3
|
-
import './agent-
|
|
4
|
-
export { C as Cron } from './cron-
|
|
3
|
+
import './agent-enXXu447.js';
|
|
4
|
+
export { C as Cron } from './cron-DTuaPMVI.js';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import './sdk-agent-wEOLXD3F.js';
|
|
7
7
|
import './errors-base-B5g01neU.js';
|
package/dist/cron.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { Cron } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { Cron } from './chunk-QCIARBLS.js';
|
|
2
|
+
import './chunk-OOM236Z4.js';
|
|
3
3
|
import './chunk-XKMVJ443.js';
|
|
4
4
|
import './chunk-5522X223.js';
|
|
5
5
|
import './chunk-K2BQQ445.js';
|
|
6
6
|
import './chunk-R2C3HXR3.js';
|
|
7
|
-
import './chunk-
|
|
7
|
+
import './chunk-ZHWKT2NI.js';
|
|
8
8
|
import './chunk-2SFBB54R.js';
|
|
9
9
|
import './chunk-HOHR75KF.js';
|
|
10
10
|
import './chunk-H73MEMQB.js';
|
|
@@ -18,8 +18,8 @@ import './chunk-TE6XVTOA.js';
|
|
|
18
18
|
import './chunk-24MGQDK3.js';
|
|
19
19
|
import './chunk-2WXHA33T.js';
|
|
20
20
|
import './chunk-HKCKOAIO.js';
|
|
21
|
-
import './chunk-
|
|
22
|
-
import './chunk-
|
|
21
|
+
import './chunk-7QJYKVP6.js';
|
|
22
|
+
import './chunk-OPAKPEPG.js';
|
|
23
23
|
import './chunk-KVNWIAO4.js';
|
|
24
24
|
import './chunk-SVQIW5RJ.js';
|
|
25
25
|
import './chunk-FD2UT76F.js';
|
|
@@ -43,7 +43,7 @@ import './chunk-BKMDRBJ7.js';
|
|
|
43
43
|
import './chunk-Q5EWJPRY.js';
|
|
44
44
|
import './chunk-GGRPAQ3B.js';
|
|
45
45
|
import './chunk-3JHIFQ4I.js';
|
|
46
|
-
import './chunk-
|
|
46
|
+
import './chunk-ZDYDBXSD.js';
|
|
47
47
|
import './chunk-X7EUUHXU.js';
|
|
48
48
|
import './chunk-MQGSOKR3.js';
|
|
49
49
|
import './chunk-GMRFAX4I.js';
|
package/dist/eval.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunk7NQ7HJ3E_cjs = require('./chunk-7NQ7HJ3E.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunk56BCEM26_cjs = require('./chunk-56BCEM26.cjs');
|
|
5
5
|
require('./chunk-J6GXS5A2.cjs');
|
|
6
6
|
require('./chunk-PSLCVSCS.cjs');
|
|
7
7
|
var chunkBUUUWQMB_cjs = require('./chunk-BUUUWQMB.cjs');
|
|
8
8
|
require('./chunk-TTBIQTO5.cjs');
|
|
9
|
-
require('./chunk-
|
|
9
|
+
require('./chunk-KIKKTW5O.cjs');
|
|
10
10
|
require('./chunk-BV2MWEMV.cjs');
|
|
11
11
|
require('./chunk-MEUBLCM4.cjs');
|
|
12
12
|
require('./chunk-GHX4P3V2.cjs');
|
|
@@ -20,8 +20,8 @@ require('./chunk-WPO3VCY4.cjs');
|
|
|
20
20
|
require('./chunk-QOGNZMHD.cjs');
|
|
21
21
|
require('./chunk-YIFFF23U.cjs');
|
|
22
22
|
require('./chunk-2ZPEDVLM.cjs');
|
|
23
|
-
require('./chunk-
|
|
24
|
-
require('./chunk-
|
|
23
|
+
require('./chunk-XKZFIP7Z.cjs');
|
|
24
|
+
require('./chunk-N6OEX5TN.cjs');
|
|
25
25
|
require('./chunk-KRD3GQAA.cjs');
|
|
26
26
|
require('./chunk-RQMCOFAI.cjs');
|
|
27
27
|
require('./chunk-MUUQ2WFJ.cjs');
|
|
@@ -45,7 +45,7 @@ var chunkOF2CLCTH_cjs = require('./chunk-OF2CLCTH.cjs');
|
|
|
45
45
|
require('./chunk-ZF2LDKQQ.cjs');
|
|
46
46
|
require('./chunk-GHHIJEFX.cjs');
|
|
47
47
|
require('./chunk-JLRLCBJ4.cjs');
|
|
48
|
-
require('./chunk-
|
|
48
|
+
require('./chunk-C7GKRGKN.cjs');
|
|
49
49
|
require('./chunk-TY56BKSK.cjs');
|
|
50
50
|
require('./chunk-MPR2ISL2.cjs');
|
|
51
51
|
require('./chunk-J5623RIV.cjs');
|
|
@@ -796,7 +796,7 @@ function makeDefaultEmbedder(opts) {
|
|
|
796
796
|
let runtime;
|
|
797
797
|
return (texts) => {
|
|
798
798
|
if (runtime === void 0) {
|
|
799
|
-
runtime =
|
|
799
|
+
runtime = chunk56BCEM26_cjs.openRouterMemoryEmbeddingProviderAdapter.create(embedderCreateOptions(opts));
|
|
800
800
|
}
|
|
801
801
|
return runtime.then((rt) => rt.embed(texts));
|
|
802
802
|
};
|
package/dist/eval.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { shellEscapePosix, LocalSandbox } from './chunk-GMSRRJ53.js';
|
|
2
|
-
import { openRouterMemoryEmbeddingProviderAdapter } from './chunk-
|
|
2
|
+
import { openRouterMemoryEmbeddingProviderAdapter } from './chunk-OOM236Z4.js';
|
|
3
3
|
import './chunk-XKMVJ443.js';
|
|
4
4
|
import './chunk-5522X223.js';
|
|
5
5
|
import { getTracer } from './chunk-K2BQQ445.js';
|
|
6
6
|
import './chunk-R2C3HXR3.js';
|
|
7
|
-
import './chunk-
|
|
7
|
+
import './chunk-ZHWKT2NI.js';
|
|
8
8
|
import './chunk-2SFBB54R.js';
|
|
9
9
|
import './chunk-HOHR75KF.js';
|
|
10
10
|
import './chunk-H73MEMQB.js';
|
|
@@ -18,8 +18,8 @@ import './chunk-TE6XVTOA.js';
|
|
|
18
18
|
import './chunk-24MGQDK3.js';
|
|
19
19
|
import './chunk-2WXHA33T.js';
|
|
20
20
|
import './chunk-HKCKOAIO.js';
|
|
21
|
-
import './chunk-
|
|
22
|
-
import './chunk-
|
|
21
|
+
import './chunk-7QJYKVP6.js';
|
|
22
|
+
import './chunk-OPAKPEPG.js';
|
|
23
23
|
import './chunk-KVNWIAO4.js';
|
|
24
24
|
import './chunk-SVQIW5RJ.js';
|
|
25
25
|
import './chunk-FD2UT76F.js';
|
|
@@ -44,7 +44,7 @@ export { JsonlParseError, loadJsonl } from './chunk-BKMDRBJ7.js';
|
|
|
44
44
|
import './chunk-Q5EWJPRY.js';
|
|
45
45
|
import './chunk-GGRPAQ3B.js';
|
|
46
46
|
import './chunk-3JHIFQ4I.js';
|
|
47
|
-
import './chunk-
|
|
47
|
+
import './chunk-ZDYDBXSD.js';
|
|
48
48
|
import './chunk-X7EUUHXU.js';
|
|
49
49
|
import './chunk-MQGSOKR3.js';
|
|
50
50
|
import './chunk-GMRFAX4I.js';
|
package/dist/index.cjs
CHANGED
|
@@ -9,13 +9,13 @@ require('./chunk-D5KXKBEN.cjs');
|
|
|
9
9
|
var chunkMPQJE3G4_cjs = require('./chunk-MPQJE3G4.cjs');
|
|
10
10
|
require('./chunk-6PB5AQCY.cjs');
|
|
11
11
|
require('./chunk-VTYY7XL5.cjs');
|
|
12
|
-
var
|
|
13
|
-
var
|
|
12
|
+
var chunkLL4QA3DI_cjs = require('./chunk-LL4QA3DI.cjs');
|
|
13
|
+
var chunk56BCEM26_cjs = require('./chunk-56BCEM26.cjs');
|
|
14
14
|
var chunkJ6GXS5A2_cjs = require('./chunk-J6GXS5A2.cjs');
|
|
15
15
|
require('./chunk-PSLCVSCS.cjs');
|
|
16
16
|
require('./chunk-BUUUWQMB.cjs');
|
|
17
17
|
require('./chunk-TTBIQTO5.cjs');
|
|
18
|
-
require('./chunk-
|
|
18
|
+
require('./chunk-KIKKTW5O.cjs');
|
|
19
19
|
require('./chunk-BV2MWEMV.cjs');
|
|
20
20
|
require('./chunk-MEUBLCM4.cjs');
|
|
21
21
|
require('./chunk-GHX4P3V2.cjs');
|
|
@@ -29,8 +29,8 @@ require('./chunk-WPO3VCY4.cjs');
|
|
|
29
29
|
require('./chunk-QOGNZMHD.cjs');
|
|
30
30
|
var chunkYIFFF23U_cjs = require('./chunk-YIFFF23U.cjs');
|
|
31
31
|
require('./chunk-2ZPEDVLM.cjs');
|
|
32
|
-
require('./chunk-
|
|
33
|
-
require('./chunk-
|
|
32
|
+
require('./chunk-XKZFIP7Z.cjs');
|
|
33
|
+
require('./chunk-N6OEX5TN.cjs');
|
|
34
34
|
require('./chunk-KRD3GQAA.cjs');
|
|
35
35
|
require('./chunk-RQMCOFAI.cjs');
|
|
36
36
|
require('./chunk-MUUQ2WFJ.cjs');
|
|
@@ -54,7 +54,7 @@ require('./chunk-OF2CLCTH.cjs');
|
|
|
54
54
|
var chunkZF2LDKQQ_cjs = require('./chunk-ZF2LDKQQ.cjs');
|
|
55
55
|
var chunkGHHIJEFX_cjs = require('./chunk-GHHIJEFX.cjs');
|
|
56
56
|
var chunkJLRLCBJ4_cjs = require('./chunk-JLRLCBJ4.cjs');
|
|
57
|
-
require('./chunk-
|
|
57
|
+
require('./chunk-C7GKRGKN.cjs');
|
|
58
58
|
var chunkTY56BKSK_cjs = require('./chunk-TY56BKSK.cjs');
|
|
59
59
|
require('./chunk-MPR2ISL2.cjs');
|
|
60
60
|
var chunkJ5623RIV_cjs = require('./chunk-J5623RIV.cjs');
|
|
@@ -76,8 +76,8 @@ var os = require('os');
|
|
|
76
76
|
// src/agent-factory.ts
|
|
77
77
|
function createAgentFactory(common) {
|
|
78
78
|
return {
|
|
79
|
-
forSession: (agentId, overrides) =>
|
|
80
|
-
getOrCreate: (agentId, overrides) =>
|
|
79
|
+
forSession: (agentId, overrides) => chunk56BCEM26_cjs.Agent.create(mergeAgentOptions(common, overrides, agentId)),
|
|
80
|
+
getOrCreate: (agentId, overrides) => chunk56BCEM26_cjs.Agent.getOrCreate(agentId, mergeAgentOptions(common, overrides, agentId))
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
83
|
function mergeAgentOptions(common, overrides, agentId) {
|
|
@@ -1373,7 +1373,7 @@ var Memory = {
|
|
|
1373
1373
|
return await peer.IndexManager.open(openArgs);
|
|
1374
1374
|
}
|
|
1375
1375
|
const { IndexManager } = await import('./index-manager-ZGJN25FD.cjs');
|
|
1376
|
-
openArgs.embedding = await resolveEmbedding(opts.embedding,
|
|
1376
|
+
openArgs.embedding = await resolveEmbedding(opts.embedding, chunk56BCEM26_cjs.MEMORY_EMBEDDING_ADAPTERS);
|
|
1377
1377
|
return await IndexManager.open(openArgs);
|
|
1378
1378
|
},
|
|
1379
1379
|
/**
|
|
@@ -1384,7 +1384,7 @@ var Memory = {
|
|
|
1384
1384
|
*/
|
|
1385
1385
|
async runDreamingSweep(opts) {
|
|
1386
1386
|
const peer = await tryLoadSdkMemoryPeer();
|
|
1387
|
-
const catalog = peer !== null ? peer.MEMORY_EMBEDDING_ADAPTERS :
|
|
1387
|
+
const catalog = peer !== null ? peer.MEMORY_EMBEDDING_ADAPTERS : chunk56BCEM26_cjs.MEMORY_EMBEDDING_ADAPTERS;
|
|
1388
1388
|
const sweepArgs = await buildDreamingSweepArgs(opts, catalog);
|
|
1389
1389
|
const result = peer !== null ? (
|
|
1390
1390
|
// biome-ignore lint/suspicious/noExplicitAny: peer is dynamically loaded — structural compat ensured by sdk-memory
|
|
@@ -1994,7 +1994,7 @@ function guardSessionDestruction(sessionId, live) {
|
|
|
1994
1994
|
// src/session-messages.ts
|
|
1995
1995
|
async function readSessionMessages2(options) {
|
|
1996
1996
|
const cwd = options.cwd ?? process.cwd();
|
|
1997
|
-
const baseDir =
|
|
1997
|
+
const baseDir = chunk56BCEM26_cjs.resolveSessionDir({ sessionDir: options.sessionDir });
|
|
1998
1998
|
return chunkYIFFF23U_cjs.readSessionMessages(new chunkB3XXQX6L_cjs.FsSessionStore({ baseDir, cwd }), options.sessionId);
|
|
1999
1999
|
}
|
|
2000
2000
|
|
|
@@ -2011,7 +2011,7 @@ function isBuiltAgent(m) {
|
|
|
2011
2011
|
return typeof m.send === "function";
|
|
2012
2012
|
}
|
|
2013
2013
|
async function materialize(def, index) {
|
|
2014
|
-
const { Agent: Agent2 } = await import('./agent-
|
|
2014
|
+
const { Agent: Agent2 } = await import('./agent-5M7WLUWH.cjs');
|
|
2015
2015
|
return Agent2.create({
|
|
2016
2016
|
// `AgentDefinition.model` admits the sentinel `'inherit'`, which is not a model id. Inheriting
|
|
2017
2017
|
// here means "declare nothing and let the default apply" — forwarding the literal would create
|
|
@@ -2153,7 +2153,7 @@ var FIXTURE_USER = {
|
|
|
2153
2153
|
};
|
|
2154
2154
|
var FIXTURE_MODELS = [
|
|
2155
2155
|
{
|
|
2156
|
-
id:
|
|
2156
|
+
id: chunk56BCEM26_cjs.DEFAULT_AGENTIC_MODEL_ID,
|
|
2157
2157
|
name: "Gemini 2.0 Flash",
|
|
2158
2158
|
displayName: "Gemini 2.0 Flash",
|
|
2159
2159
|
parameters: [
|
|
@@ -2356,7 +2356,7 @@ var Theokit = class {
|
|
|
2356
2356
|
envVars: p.envVars
|
|
2357
2357
|
}));
|
|
2358
2358
|
},
|
|
2359
|
-
embeddingAdapters: () => Object.entries(
|
|
2359
|
+
embeddingAdapters: () => Object.entries(chunk56BCEM26_cjs.MEMORY_EMBEDDING_ADAPTERS).map(([id, adapter]) => ({
|
|
2360
2360
|
id,
|
|
2361
2361
|
transport: adapter.transport,
|
|
2362
2362
|
defaultModel: adapter.defaultModel
|
|
@@ -2575,43 +2575,43 @@ Object.defineProperty(exports, "fn", {
|
|
|
2575
2575
|
});
|
|
2576
2576
|
Object.defineProperty(exports, "Cron", {
|
|
2577
2577
|
enumerable: true,
|
|
2578
|
-
get: function () { return
|
|
2578
|
+
get: function () { return chunkLL4QA3DI_cjs.Cron; }
|
|
2579
2579
|
});
|
|
2580
2580
|
Object.defineProperty(exports, "Agent", {
|
|
2581
2581
|
enumerable: true,
|
|
2582
|
-
get: function () { return
|
|
2582
|
+
get: function () { return chunk56BCEM26_cjs.Agent; }
|
|
2583
2583
|
});
|
|
2584
2584
|
Object.defineProperty(exports, "AgentBuilder", {
|
|
2585
2585
|
enumerable: true,
|
|
2586
|
-
get: function () { return
|
|
2586
|
+
get: function () { return chunk56BCEM26_cjs.AgentBuilder; }
|
|
2587
2587
|
});
|
|
2588
2588
|
Object.defineProperty(exports, "Tool", {
|
|
2589
2589
|
enumerable: true,
|
|
2590
|
-
get: function () { return
|
|
2590
|
+
get: function () { return chunk56BCEM26_cjs.Tool; }
|
|
2591
2591
|
});
|
|
2592
2592
|
Object.defineProperty(exports, "ToolError", {
|
|
2593
2593
|
enumerable: true,
|
|
2594
|
-
get: function () { return
|
|
2594
|
+
get: function () { return chunk56BCEM26_cjs.ToolError; }
|
|
2595
2595
|
});
|
|
2596
2596
|
Object.defineProperty(exports, "UsageAccumulator", {
|
|
2597
2597
|
enumerable: true,
|
|
2598
|
-
get: function () { return
|
|
2598
|
+
get: function () { return chunk56BCEM26_cjs.UsageAccumulator; }
|
|
2599
2599
|
});
|
|
2600
2600
|
Object.defineProperty(exports, "computeCost", {
|
|
2601
2601
|
enumerable: true,
|
|
2602
|
-
get: function () { return
|
|
2602
|
+
get: function () { return chunk56BCEM26_cjs.computeCost; }
|
|
2603
2603
|
});
|
|
2604
2604
|
Object.defineProperty(exports, "getPricingEntry", {
|
|
2605
2605
|
enumerable: true,
|
|
2606
|
-
get: function () { return
|
|
2606
|
+
get: function () { return chunk56BCEM26_cjs.getPricingEntry; }
|
|
2607
2607
|
});
|
|
2608
2608
|
Object.defineProperty(exports, "managedSettingsPathFor", {
|
|
2609
2609
|
enumerable: true,
|
|
2610
|
-
get: function () { return
|
|
2610
|
+
get: function () { return chunk56BCEM26_cjs.managedSettingsPathFor; }
|
|
2611
2611
|
});
|
|
2612
2612
|
Object.defineProperty(exports, "readManagedSettings", {
|
|
2613
2613
|
enumerable: true,
|
|
2614
|
-
get: function () { return
|
|
2614
|
+
get: function () { return chunk56BCEM26_cjs.readManagedSettings; }
|
|
2615
2615
|
});
|
|
2616
2616
|
Object.defineProperty(exports, "emitRunEvent", {
|
|
2617
2617
|
enumerable: true,
|