@theokit/sdk 4.39.3 → 4.40.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.
Files changed (60) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/{agent-ZCZa7YQv.d.ts → agent-BzZwYFiw.d.ts} +1 -1
  3. package/dist/{agent-D7bRK9Kg.d.cts → agent-DxEL4fHh.d.cts} +1 -1
  4. package/dist/{agent-CJPUQ6BT.js → agent-MSR3DHO4.js} +5 -5
  5. package/dist/{agent-CJPUQ6BT.js.map → agent-MSR3DHO4.js.map} +1 -1
  6. package/dist/{agent-IKDNM7OA.cjs → agent-OOXJJD6A.cjs} +6 -6
  7. package/dist/{agent-IKDNM7OA.cjs.map → agent-OOXJJD6A.cjs.map} +1 -1
  8. package/dist/{chunk-PP3ZKVZZ.js → chunk-2UBBO2MD.js} +3 -3
  9. package/dist/{chunk-PP3ZKVZZ.js.map → chunk-2UBBO2MD.js.map} +1 -1
  10. package/dist/{chunk-RTDT2UMT.js → chunk-5VKUZ26Q.js} +22 -7
  11. package/dist/chunk-5VKUZ26Q.js.map +1 -0
  12. package/dist/{chunk-IIBQBMIS.cjs → chunk-6AE4QTSF.cjs} +5 -5
  13. package/dist/{chunk-IIBQBMIS.cjs.map → chunk-6AE4QTSF.cjs.map} +1 -1
  14. package/dist/{chunk-GKZY34TD.cjs → chunk-BVGJXMSB.cjs} +20 -10
  15. package/dist/chunk-BVGJXMSB.cjs.map +1 -0
  16. package/dist/{chunk-MWVLE5RY.cjs → chunk-WMWZAJMJ.cjs} +5 -5
  17. package/dist/{chunk-MWVLE5RY.cjs.map → chunk-WMWZAJMJ.cjs.map} +1 -1
  18. package/dist/{chunk-7WXT5M6P.js → chunk-XRKFWV7K.js} +3 -3
  19. package/dist/{chunk-7WXT5M6P.js.map → chunk-XRKFWV7K.js.map} +1 -1
  20. package/dist/{chunk-JWRMBFSP.js → chunk-ZRQZOJ3N.js} +16 -6
  21. package/dist/chunk-ZRQZOJ3N.js.map +1 -0
  22. package/dist/{chunk-JERO4TP6.cjs → chunk-ZVQJHY4Y.cjs} +22 -7
  23. package/dist/chunk-ZVQJHY4Y.cjs.map +1 -0
  24. package/dist/{cron-D-DVjGQe.d.cts → cron-BGR0HOz9.d.cts} +2 -2
  25. package/dist/{cron-Bx7tzm5R.d.ts → cron-CDAIWCrL.d.ts} +2 -2
  26. package/dist/cron.cjs +5 -5
  27. package/dist/cron.d.cts +3 -3
  28. package/dist/cron.d.ts +3 -3
  29. package/dist/cron.js +4 -4
  30. package/dist/{errors-DjBQ4Tn8.d.ts → errors-DxQe4_Qy.d.ts} +1 -1
  31. package/dist/{errors-DMY-gLSK.d.cts → errors-L1bxHHO0.d.cts} +1 -1
  32. package/dist/errors.d.cts +2 -2
  33. package/dist/errors.d.ts +2 -2
  34. package/dist/eval.cjs +8 -8
  35. package/dist/eval.js +4 -4
  36. package/dist/fs-session-store-I6GUIFRO.js +10 -0
  37. package/dist/{fs-session-store-YPZIOLJM.js.map → fs-session-store-I6GUIFRO.js.map} +1 -1
  38. package/dist/{fs-session-store-V32XJ63Z.cjs → fs-session-store-KRZZIG3O.cjs} +5 -5
  39. package/dist/{fs-session-store-V32XJ63Z.cjs.map → fs-session-store-KRZZIG3O.cjs.map} +1 -1
  40. package/dist/index.cjs +20 -20
  41. package/dist/index.d.cts +8 -8
  42. package/dist/index.d.ts +8 -8
  43. package/dist/index.js +6 -6
  44. package/dist/internal/persistence/index.cjs +6 -6
  45. package/dist/internal/persistence/index.js +1 -1
  46. package/dist/persistence.cjs +6 -6
  47. package/dist/persistence.js +1 -1
  48. package/dist/{run-i2-fUohR.d.ts → run-XXnwwGOT.d.cts} +15 -0
  49. package/dist/{run-i2-fUohR.d.cts → run-XXnwwGOT.d.ts} +15 -0
  50. package/dist/server/errors-envelope.d.cts +3 -3
  51. package/dist/server/errors-envelope.d.ts +3 -3
  52. package/dist/subagents-loader.d.cts +2 -2
  53. package/dist/subagents-loader.d.ts +2 -2
  54. package/dist/types/run.d.ts +15 -0
  55. package/package.json +1 -1
  56. package/dist/chunk-GKZY34TD.cjs.map +0 -1
  57. package/dist/chunk-JERO4TP6.cjs.map +0 -1
  58. package/dist/chunk-JWRMBFSP.js.map +0 -1
  59. package/dist/chunk-RTDT2UMT.js.map +0 -1
  60. package/dist/fs-session-store-YPZIOLJM.js +0 -10
@@ -9,6 +9,22 @@ var path = require('path');
9
9
  var cached;
10
10
  var warnedMissing = false;
11
11
  var warnedStructural = false;
12
+ var loadFailure;
13
+ function isModuleAbsent(err) {
14
+ const code = err?.code;
15
+ return code === "ERR_MODULE_NOT_FOUND" || code === "MODULE_NOT_FOUND";
16
+ }
17
+ function describeLockLoadFailure(err) {
18
+ const consequence = "cross-process file lock unavailable \u2014 concurrent processes over the same file are NOT serialized.";
19
+ if (isModuleAbsent(err)) {
20
+ return `[theokit-sdk] proper-lockfile not installed; ${consequence} Install with: pnpm add proper-lockfile
21
+ `;
22
+ }
23
+ const code = err?.code;
24
+ const detail = err instanceof Error ? err.message : String(err);
25
+ return `[theokit-sdk] proper-lockfile could not be loaded${code !== void 0 ? ` (${String(code)})` : ""}: ${detail}. ${consequence} The package resolves for the SDK but failed to load \u2014 check bundling and module-format interop before re-checking the install.
26
+ `;
27
+ }
12
28
  async function getProperLockfile() {
13
29
  if (cached !== void 0) return cached;
14
30
  try {
@@ -24,7 +40,8 @@ async function getProperLockfile() {
24
40
  return cached;
25
41
  }
26
42
  cached = mod;
27
- } catch {
43
+ } catch (err) {
44
+ loadFailure = err;
28
45
  cached = null;
29
46
  }
30
47
  return cached;
@@ -37,11 +54,9 @@ function validateLockModule(mod) {
37
54
  async function withFileLock(path, fn, options) {
38
55
  const lib = await getProperLockfile();
39
56
  if (lib === null) {
40
- if (!warnedMissing) {
57
+ if (!warnedMissing && !warnedStructural) {
41
58
  warnedMissing = true;
42
- chunkA76OFN2B_cjs.diag(
43
- "[theokit-sdk] proper-lockfile not installed; cross-process file lock unavailable. Install with: pnpm add proper-lockfile\n"
44
- );
59
+ chunkA76OFN2B_cjs.diag(describeLockLoadFailure(loadFailure));
45
60
  }
46
61
  return chunkYLQQX5W2_cjs.withCwdMutex(`file-lock:${path}`, fn);
47
62
  }
@@ -166,5 +181,5 @@ exports.appendJsonl = appendJsonl;
166
181
  exports.loadJsonl = loadJsonl;
167
182
  exports.readJsonlIds = readJsonlIds;
168
183
  exports.withFileLock = withFileLock;
169
- //# sourceMappingURL=chunk-JERO4TP6.cjs.map
170
- //# sourceMappingURL=chunk-JERO4TP6.cjs.map
184
+ //# sourceMappingURL=chunk-ZVQJHY4Y.cjs.map
185
+ //# sourceMappingURL=chunk-ZVQJHY4Y.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/internal/persistence/file-lock.ts","../src/internal/persistence/jsonl.ts"],"names":["diag","withCwdMutex","readFileSync","path","mkdirSync","dirname","openSync","writeSync","closeSync","fstatSync","readSync"],"mappings":";;;;;;;;AAiCA,IAAI,MAAA;AACJ,IAAI,aAAA,GAAgB,KAAA;AACpB,IAAI,gBAAA,GAAmB,KAAA;AAEvB,IAAI,WAAA;AAGJ,SAAS,eAAe,GAAA,EAAuB;AAC7C,EAAA,MAAM,OAAQ,GAAA,EAA+C,IAAA;AAC7D,EAAA,OAAO,IAAA,KAAS,0BAA0B,IAAA,KAAS,kBAAA;AACrD;AAgBA,SAAS,wBAAwB,GAAA,EAAsB;AACrD,EAAA,MAAM,WAAA,GACJ,wGAAA;AACF,EAAA,IAAI,cAAA,CAAe,GAAG,CAAA,EAAG;AACvB,IAAA,OAAO,gDAAgD,WAAW,CAAA;AAAA,CAAA;AAAA,EACpE;AACA,EAAA,MAAM,OAAQ,GAAA,EAA+C,IAAA;AAC7D,EAAA,MAAM,SAAS,GAAA,YAAe,KAAA,GAAQ,GAAA,CAAI,OAAA,GAAU,OAAO,GAAG,CAAA;AAC9D,EAAA,OACE,CAAA,iDAAA,EAAoD,IAAA,KAAS,MAAA,GAAY,CAAA,EAAA,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,CAAA,EAAG,OAAO,CAAC,CAAA;AAChC,IAAA,OAAO,GAAA,CAAI,CAAC,CAAA,KAAM,EAAA;AAAA,EACpB,CAAA,SAAE;AACA,IAAAF,YAAA,CAAU,EAAE,CAAA;AAAA,EACd;AACF;AAYO,SAAS,YAAA,CACd,MACA,KAAA,EACa;AACb,EAAA,MAAM,IAAA,uBAAW,GAAA,EAAY;AAC7B,EAAA,IAAI,IAAA;AACJ,EAAA,IAAI;AACF,IAAA,IAAA,GAAON,eAAA,CAAa,MAAM,MAAM,CAAA;AAAA,EAClC,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,IAAA;AAAA,EACT;AACA,EAAA,KAAA,MAAW,OAAA,IAAW,IAAA,CAAK,KAAA,CAAM,IAAI,CAAA,EAAG;AAEtC,IAAA,MAAM,MAAA,GAAS,kBAAA,CAAmB,OAAA,CAAQ,IAAA,EAAM,CAAA;AAChD,IAAA,IAAI,WAAW,MAAA,EAAW;AAC1B,IAAA,MAAM,GAAA,GAAM,MAAM,MAAM,CAAA;AACxB,IAAA,IAAI,OAAO,QAAQ,QAAA,IAAY,GAAA,CAAI,SAAS,CAAA,EAAG,IAAA,CAAK,IAAI,GAAG,CAAA;AAAA,EAC7D;AACA,EAAA,OAAO,IAAA;AACT","file":"chunk-ZVQJHY4Y.cjs","sourcesContent":["/**\n * Cross-process file lock helper (ADR D61).\n *\n * Uses `proper-lockfile` (optional peer dep) for cross-process locks. When\n * the peer dep is absent, falls back to `withCwdMutex` (in-process only)\n * with a one-shot stderr warning.\n *\n * EC-1 fix: uses a companion `<path>.lock` file with `realpath: false` so\n * `withFileLock` works even when the target `path` does not exist yet.\n * Without this, fresh installs that lock-then-create would crash with ENOENT.\n *\n * @internal\n */\n\nimport { diag } from \"../diagnostics.js\";\nimport { withCwdMutex } from \"./cwd-mutex.js\";\n\ninterface ProperLockfileModule {\n lock: (file: string, options: ProperLockfileOptions) => Promise<() => Promise<void>>;\n}\n\ninterface ProperLockfileOptions {\n lockfilePath?: string;\n realpath?: boolean;\n stale?: number;\n retries?: {\n retries: number;\n factor?: number;\n minTimeout?: number;\n maxTimeout?: number;\n };\n}\n\nlet cached: ProperLockfileModule | null | undefined;\nlet warnedMissing = false;\nlet warnedStructural = false;\n/** Why the import failed, kept so the warning can report the observation instead of a guess (#174). */\nlet loadFailure: unknown;\n\n/** Node reports a missing module as `ERR_MODULE_NOT_FOUND` (ESM loader) or `MODULE_NOT_FOUND` (CJS). */\nfunction isModuleAbsent(err: unknown): boolean {\n const code = (err as { code?: unknown } | null | undefined)?.code;\n return code === \"ERR_MODULE_NOT_FOUND\" || code === \"MODULE_NOT_FOUND\";\n}\n\n/**\n * #174 — build the fallback warning from what actually happened.\n *\n * This used to always read \"proper-lockfile not installed\", because the import was wrapped in a\n * bare `catch` that discarded the error (Unbreakable Rule 8: a swallowed error is the dangerous\n * kind). A consumer whose package WAS installed, declared and resolvable spent a debugging session\n * re-verifying the install, because the message named a cause the code had never checked.\n *\n * Absence is now the only case that claims absence. Every other failure — a broken install, an\n * interop problem, a bundler that rewrote the specifier — reports its own code and message, which\n * is what points at the real cause.\n *\n * @internal\n */\nfunction describeLockLoadFailure(err: unknown): string {\n const consequence =\n \"cross-process file lock unavailable — concurrent processes over the same file are NOT serialized.\";\n if (isModuleAbsent(err)) {\n return `[theokit-sdk] proper-lockfile not installed; ${consequence} Install with: pnpm add proper-lockfile\\n`;\n }\n const code = (err as { code?: unknown } | null | undefined)?.code;\n const detail = err instanceof Error ? err.message : String(err);\n return (\n `[theokit-sdk] proper-lockfile could not be loaded${code !== undefined ? ` (${String(code)})` : \"\"}: ` +\n `${detail}. ${consequence} The package resolves for the SDK but failed to load — check bundling ` +\n \"and module-format interop before re-checking the install.\\n\"\n );\n}\n\n/** Test seam for the message builder — NOT in the public barrel. @internal */\nexport function __TESTING__describeLockLoadFailure(err: unknown): string {\n return describeLockLoadFailure(err);\n}\n\nasync function getProperLockfile(): Promise<ProperLockfileModule | null> {\n if (cached !== undefined) return cached;\n try {\n const mod = await import(\"proper-lockfile\");\n // T5.9 — supply-chain hardening: validate the imported module\n // exposes the API surface we depend on BEFORE caching it. A\n // tampered or incompatible version that lacks `lock`/`unlock`\n // functions gets treated as \"not installed\" with an advisory\n // warning — never silently used.\n if (!validateLockModule(mod)) {\n if (!warnedStructural) {\n warnedStructural = true;\n diag(\n \"[theokit-sdk] proper-lockfile: imported module does NOT expose \" +\n \"the expected `lock`/`unlock` API surface. This may indicate a \" +\n \"supply-chain compromise or an incompatible major version. \" +\n \"Falling back to in-process mutex (no cross-process safety). \" +\n \"Reinstall with: pnpm add proper-lockfile@^11\\n\",\n );\n }\n cached = null;\n return cached;\n }\n cached = mod as ProperLockfileModule;\n } catch (err) {\n // #174 — keep WHY. Discarding it here is what made the fallback warning assert a cause it had\n // never observed, and sent a consumer to re-check an install that was already correct.\n loadFailure = err;\n cached = null;\n }\n return cached;\n}\n\n/**\n * T5.9 — Structural validation of the dynamically-imported\n * `proper-lockfile` module. Verifies the API surface we depend on\n * (`lock` and `unlock` as functions) is present. Pure function —\n * never throws, never mutates, never performs I/O.\n *\n * Exported via `__TESTING__validateLockModule` seam so unit tests\n * can drive the check without spinning up the dynamic import.\n *\n * @internal\n */\nfunction validateLockModule(mod: unknown): boolean {\n if (mod === null || mod === undefined || typeof mod !== \"object\") return false;\n const m = mod as Record<string, unknown>;\n return typeof m.lock === \"function\" && typeof m.unlock === \"function\";\n}\n\n/**\n * T5.9 — Test seam: expose the structural validator for unit tests.\n * NOT included in the public barrel.\n *\n * @internal\n */\nexport function __TESTING__validateLockModule(mod: unknown): boolean {\n return validateLockModule(mod);\n}\n\n/**\n * T5.9 — Test seam: reset the module cache + warning flags between\n * tests so each test starts fresh. NOT included in the public barrel.\n *\n * @internal\n */\nexport function __TESTING__resetFileLockCache(): void {\n cached = undefined;\n warnedMissing = false;\n warnedStructural = false;\n loadFailure = undefined;\n}\n\n/**\n * Options for `withFileLock`.\n *\n * @internal\n */\nexport interface FileLockOptions {\n /** Stale lock timeout in ms. Default 30_000 (30s). */\n stale?: number;\n /** Max retries on busy lock. Default 5. */\n retries?: number;\n /** Backoff factor between retries. Default 1.5. */\n retryFactor?: number;\n}\n\n/**\n * Run `fn` while holding an OS-level cross-process lock on `path`.\n *\n * If `proper-lockfile` is installed, uses it with a companion `<path>.lock`\n * file (`realpath: false`, so target file does NOT need to exist yet).\n * Otherwise falls back to in-process `withCwdMutex` and prints a one-shot\n * stderr warning telling the user to install `proper-lockfile` for\n * cross-process safety.\n *\n * The lock is released even when `fn` throws.\n *\n * @internal\n */\nexport async function withFileLock<T>(\n path: string,\n fn: () => Promise<T>,\n options?: FileLockOptions,\n): Promise<T> {\n const lib = await getProperLockfile();\n\n if (lib === null) {\n // #174 — stay silent when the structural check already explained itself. Emitting \"not\n // installed\" on top of \"does not expose lock/unlock\" would be two contradictory diagnoses of\n // one failure, and the reader has no way to tell which is true.\n if (!warnedMissing && !warnedStructural) {\n warnedMissing = true;\n diag(describeLockLoadFailure(loadFailure));\n }\n return withCwdMutex(`file-lock:${path}`, fn);\n }\n\n // proper-lockfile errors immediately on same-process concurrent acquire\n // (\"Lock file is already being held\"). Wrap with cwd-mutex first so\n // in-process callers queue and only ONE thread at a time enters the\n // cross-process acquire path. Combined: full in-process + cross-process\n // serialization.\n return withCwdMutex(`file-lock:${path}`, async () => {\n const release = await lib.lock(path, {\n // EC-1: companion lockfile, target path may not exist yet.\n lockfilePath: `${path}.lock`,\n realpath: false,\n stale: options?.stale ?? 30_000,\n retries: {\n retries: options?.retries ?? 5,\n factor: options?.retryFactor ?? 1.5,\n minTimeout: 100,\n maxTimeout: 5_000,\n },\n });\n\n try {\n return await fn();\n } finally {\n await release();\n }\n });\n}\n\n/**\n * Test helper — resets the cached proper-lockfile module + warning flag.\n * Allows tests to simulate \"module absent\" by clearing cache then\n * monkey-patching the dynamic import resolution.\n *\n * @internal\n */\nexport function _resetFileLockCacheForTesting(): void {\n cached = undefined;\n warnedMissing = false;\n}\n","/**\n * Durable JSONL primitives shared by the eval harness (M6).\n *\n * - `loadJsonl` — generic dataset reader (split/trim/skip-blank/parse) with a\n * line-numbered {@link JsonlParseError}. The dataset SCHEMA is the caller's\n * concern via `map` (M6 ADR D3) — this module owns only the parse.\n * - `appendJsonl` / `readJsonlIds` — crash-durable, resumable batch persistence\n * (M6 ADR D1): each record is appended as one whole `\\n`-terminated line the\n * instant it is produced, and a re-run resumes by skipping already-keyed rows.\n *\n * referencia: knowledge-base/references/theocode-eval/lib/swebench-dataset.ts:82\n * (parseJsonl + line-N error) and swebench-batch.ts:113,205 (resume + per-line\n * flush).\n *\n * @internal\n */\nimport {\n closeSync,\n fstatSync,\n mkdirSync,\n openSync,\n readFileSync,\n readSync,\n writeSync,\n} from \"node:fs\";\nimport { dirname } from \"node:path\";\n\n/** Raised when a JSONL line is not valid JSON or is not a JSON object. Carries the 1-based line number. */\nexport class JsonlParseError extends Error {\n constructor(\n message: string,\n readonly line: number,\n ) {\n super(message);\n this.name = \"JsonlParseError\";\n }\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/** Parse a single trimmed line to a plain object, or `undefined` if blank / invalid / non-object. */\nfunction tryParseObjectLine(line: string): Record<string, unknown> | undefined {\n if (line.length === 0) return undefined;\n let parsed: unknown;\n try {\n parsed = JSON.parse(line);\n } catch {\n return undefined;\n }\n return isPlainObject(parsed) ? parsed : undefined;\n}\n\n/**\n * Parse a JSONL file into rows. Blank lines are skipped. A malformed or\n * non-object line throws {@link JsonlParseError} naming the 1-based line. When\n * `map` is provided, each raw object is mapped to the typed row (the SWE-bench\n * schema lives in the caller's `map`, per M6 ADR D3).\n */\nexport function loadJsonl<T = Record<string, unknown>>(\n path: string,\n opts: {\n map?: (raw: Record<string, unknown>, lineNumber: number) => T;\n /**\n * M81 — tolerate a truncated LAST line (a crash artifact: the process died mid-write).\n *\n * Opt-in on purpose. As a default it would also swallow corruption in the MIDDLE of the file,\n * turning loud data loss into silent data loss — the wrong trade for a session store.\n */\n tolerateTrailingPartialLine?: boolean;\n } = {},\n): T[] {\n const lines = readFileSync(path, \"utf8\").split(\"\\n\");\n const out: T[] = [];\n for (let i = 0; i < lines.length; i += 1) {\n const lineNumber = i + 1;\n const line = (lines[i] ?? \"\").trim();\n if (line.length === 0) continue;\n // M81 — `undefined` = a tolerated invalid line (the last one, truncated by a crash). Any other\n // invalid line has already thrown inside `parseLine`.\n const parsed = parseLine(\n line,\n lineNumber,\n opts.tolerateTrailingPartialLine === true && lineNumber === lines.length,\n );\n if (parsed === undefined) break;\n out.push(opts.map ? opts.map(parsed, lineNumber) : (parsed as unknown as T));\n }\n return out;\n}\n\n/**\n * Parses ONE line, returning `undefined` when it is a tolerated truncated last line.\n *\n * Extracted because `loadJsonl` went over the cognitive-complexity ceiling once it gained the\n * tolerance — and because parsing a line and iterating a file are two responsibilities that were\n * only together out of habit.\n */\nfunction parseLine(\n line: string,\n lineNumber: number,\n tolerate: boolean,\n): Record<string, unknown> | undefined {\n let parsed: unknown;\n try {\n parsed = JSON.parse(line);\n } catch {\n if (tolerate) return undefined;\n throw new JsonlParseError(`line ${lineNumber}: invalid JSON`, lineNumber);\n }\n if (!isPlainObject(parsed)) {\n throw new JsonlParseError(`line ${lineNumber}: not a JSON object`, lineNumber);\n }\n return parsed;\n}\n\n/**\n * Append one record as a whole `\\n`-terminated JSON line. Creates the parent dir\n * if missing. `appendFileSync` is synchronous, so within a single Node process\n * the event loop serializes writes and each call writes its line atomically —\n * interleave-safe for the bounded-concurrency batch runner.\n *\n * referencia: swebench-batch.ts:192 (mkdir-before-append), :205 (per-line flush).\n */\nexport function appendJsonl(path: string, record: unknown): void {\n mkdirSync(dirname(path), { recursive: true });\n const prefix = needsLineBreakBefore(path) ? \"\\n\" : \"\";\n // M93 (adversarial review, H1) — `0o600`. `appendFileSync` takes no `mode`, so the permission came\n // from the umask: under `umask 022` the transcript was born `0664`, world-readable. The previous\n // path (`replaceFileAtomic`) pinned `0o600` on purpose — \"holds the FULL in-flight content\n // (credential snapshots, OAuth tokens)\" (`atomic-write.ts:107`) — and switching to append lost\n // that silently. The same class had already been caught in the consumer (`atomic-sync.ts`, M88\n // HIGH-1).\n //\n // `mode` only applies on CREATION; a pre-existing file keeps whatever permission it already has.\n const fd = openSync(path, \"a\", 0o600);\n try {\n writeSync(fd, `${prefix}${JSON.stringify(record)}\\n`);\n } finally {\n closeSync(fd);\n }\n}\n\n/**\n * Does the file end without a `\\n`? Then the last line is truncated — a crash mid-append.\n *\n * Without this check the next append **glues** itself onto the middle of the broken line, producing\n * an invalid line the reader discards: the NEW record disappears along with the partial one. The\n * previous path (read-modify-write) self-healed from this because it rewrote the whole file.\n * Measured in M93's adversarial review (H2): after an append over a truncated file, the\n * just-written record was no longer readable.\n *\n * Reads **one byte**, not the file.\n */\nfunction needsLineBreakBefore(path: string): boolean {\n let fd: number;\n try {\n fd = openSync(path, \"r\");\n } catch {\n return false; // the file does not exist yet: nothing to splice onto\n }\n try {\n const size = fstatSync(fd).size;\n if (size === 0) return false;\n const buf = Buffer.alloc(1);\n readSync(fd, buf, 0, 1, size - 1);\n return buf[0] !== 0x0a;\n } finally {\n closeSync(fd);\n }\n}\n\n/**\n * Read the set of keys from an existing JSONL file for which `keyFn(parsed)`\n * returns a non-empty string. Used to resume a crashed batch by skipping rows\n * already persisted with a successful result. A trailing partial line from an\n * interrupted append is tolerated (skipped, not thrown), and a missing file\n * yields an empty set.\n *\n * referencia: swebench-batch.ts:113 (readDoneIds), :129 (success-only),\n * :131 (tolerate partial line).\n */\nexport function readJsonlIds(\n path: string,\n keyFn: (parsed: Record<string, unknown>) => string | undefined,\n): Set<string> {\n const done = new Set<string>();\n let text: string;\n try {\n text = readFileSync(path, \"utf8\");\n } catch {\n return done; // no file yet → nothing done\n }\n for (const rawLine of text.split(\"\\n\")) {\n // A trailing partial line from an interrupted run parses to undefined → skipped.\n const parsed = tryParseObjectLine(rawLine.trim());\n if (parsed === undefined) continue;\n const key = keyFn(parsed);\n if (typeof key === \"string\" && key.length > 0) done.add(key);\n }\n return done;\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { ZodType } from 'zod';
2
- import { e as SDKAgent, A as AgentOptions, g as ListResult } from './agent-D7bRK9Kg.cjs';
3
- import { u as MessageOrigin, ad as SDKUserMessage, b as Run } from './run-i2-fUohR.cjs';
2
+ import { e as SDKAgent, A as AgentOptions, g as ListResult } from './agent-DxEL4fHh.cjs';
3
+ import { u as MessageOrigin, ad as SDKUserMessage, b as Run } from './run-XXnwwGOT.cjs';
4
4
 
5
5
  /**
6
6
  * Public type contract for `Workflow.create / .run / .resume` (Adoption
@@ -1,6 +1,6 @@
1
1
  import { ZodType } from 'zod';
2
- import { e as SDKAgent, A as AgentOptions, g as ListResult } from './agent-ZCZa7YQv.js';
3
- import { u as MessageOrigin, ad as SDKUserMessage, b as Run } from './run-i2-fUohR.js';
2
+ import { e as SDKAgent, A as AgentOptions, g as ListResult } from './agent-BzZwYFiw.js';
3
+ import { u as MessageOrigin, ad as SDKUserMessage, b as Run } from './run-XXnwwGOT.js';
4
4
 
5
5
  /**
6
6
  * Public type contract for `Workflow.create / .run / .resume` (Adoption
package/dist/cron.cjs CHANGED
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var chunkIIBQBMIS_cjs = require('./chunk-IIBQBMIS.cjs');
4
- require('./chunk-GKZY34TD.cjs');
3
+ var chunk6AE4QTSF_cjs = require('./chunk-6AE4QTSF.cjs');
4
+ require('./chunk-BVGJXMSB.cjs');
5
5
  require('./chunk-BV2MWEMV.cjs');
6
6
  require('./chunk-QMIG7TKG.cjs');
7
7
  require('./chunk-BUUUWQMB.cjs');
8
8
  require('./chunk-N4JNY5DT.cjs');
9
- require('./chunk-MWVLE5RY.cjs');
9
+ require('./chunk-WMWZAJMJ.cjs');
10
10
  require('./chunk-SEWAPWAF.cjs');
11
11
  require('./chunk-ELYGL52R.cjs');
12
12
  require('./chunk-BURYFNOM.cjs');
@@ -28,7 +28,7 @@ require('./chunk-RHQJX3EI.cjs');
28
28
  require('./chunk-PDOLUFGY.cjs');
29
29
  require('./chunk-4E3HLSYE.cjs');
30
30
  require('./chunk-NJVV5OAV.cjs');
31
- require('./chunk-JERO4TP6.cjs');
31
+ require('./chunk-ZVQJHY4Y.cjs');
32
32
  require('./chunk-4H2QARXM.cjs');
33
33
  require('./chunk-YLQQX5W2.cjs');
34
34
  require('./chunk-H2V6CXM7.cjs');
@@ -50,7 +50,7 @@ require('./chunk-A76OFN2B.cjs');
50
50
 
51
51
  Object.defineProperty(exports, "Cron", {
52
52
  enumerable: true,
53
- get: function () { return chunkIIBQBMIS_cjs.Cron; }
53
+ get: function () { return chunk6AE4QTSF_cjs.Cron; }
54
54
  });
55
55
  //# sourceMappingURL=cron.cjs.map
56
56
  //# sourceMappingURL=cron.cjs.map
package/dist/cron.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { C as Cron } from './cron-D-DVjGQe.cjs';
2
- import './run-i2-fUohR.cjs';
3
- import './agent-D7bRK9Kg.cjs';
1
+ export { C as Cron } from './cron-BGR0HOz9.cjs';
2
+ import './run-XXnwwGOT.cjs';
3
+ import './agent-DxEL4fHh.cjs';
4
4
  import 'zod';
package/dist/cron.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { C as Cron } from './cron-Bx7tzm5R.js';
2
- import './run-i2-fUohR.js';
3
- import './agent-ZCZa7YQv.js';
1
+ export { C as Cron } from './cron-CDAIWCrL.js';
2
+ import './run-XXnwwGOT.js';
3
+ import './agent-BzZwYFiw.js';
4
4
  import 'zod';
package/dist/cron.js CHANGED
@@ -1,10 +1,10 @@
1
- export { Cron } from './chunk-PP3ZKVZZ.js';
2
- import './chunk-JWRMBFSP.js';
1
+ export { Cron } from './chunk-2UBBO2MD.js';
2
+ import './chunk-ZRQZOJ3N.js';
3
3
  import './chunk-2SFBB54R.js';
4
4
  import './chunk-UIPTINIF.js';
5
5
  import './chunk-K2BQQ445.js';
6
6
  import './chunk-ONVIALVV.js';
7
- import './chunk-7WXT5M6P.js';
7
+ import './chunk-XRKFWV7K.js';
8
8
  import './chunk-X627TO3A.js';
9
9
  import './chunk-MI3OKONE.js';
10
10
  import './chunk-5KOW3GLE.js';
@@ -26,7 +26,7 @@ import './chunk-XKGOIGTJ.js';
26
26
  import './chunk-F4SQTWVR.js';
27
27
  import './chunk-LWVKI75U.js';
28
28
  import './chunk-EYUZZXHZ.js';
29
- import './chunk-RTDT2UMT.js';
29
+ import './chunk-5VKUZ26Q.js';
30
30
  import './chunk-VTDQRUAJ.js';
31
31
  import './chunk-2XLKLVVR.js';
32
32
  import './chunk-BM7VYZED.js';
@@ -1,4 +1,4 @@
1
- import { Q as RunOperation } from './run-i2-fUohR.js';
1
+ import { Q as RunOperation } from './run-XXnwwGOT.js';
2
2
 
3
3
  /**
4
4
  * Public type contract for the Budget enforcement primitive
@@ -1,4 +1,4 @@
1
- import { Q as RunOperation } from './run-i2-fUohR.cjs';
1
+ import { Q as RunOperation } from './run-XXnwwGOT.cjs';
2
2
 
3
3
  /**
4
4
  * Public type contract for the Budget enforcement primitive
package/dist/errors.d.cts CHANGED
@@ -1,3 +1,3 @@
1
- export { A as AgentDisposedError, c as AgentRunError, d as AgentRunErrorCode, e as AuthenticationError, g as BudgetExceededError, C as ConfigurationError, u as CredentialPoolExhaustedError, m as ErrorCode, E as ErrorMetadata, I as IntegrationNotConnectedError, n as InvalidTaskIdError, K as KnownAgentRunErrorCode, M as MemoryAdapterError, o as MemoryAdapterErrorCode, N as NetworkError, R as RateLimitError, p as TaskNotFoundError, T as TheokitAgentError, U as UnknownAgentError, q as UnsupportedBudgetOperationError, r as UnsupportedRunOperationError, s as UnsupportedTaskOperationError, t as isTransientError } from './errors-DMY-gLSK.cjs';
2
- import './run-i2-fUohR.cjs';
1
+ export { A as AgentDisposedError, c as AgentRunError, d as AgentRunErrorCode, e as AuthenticationError, g as BudgetExceededError, C as ConfigurationError, u as CredentialPoolExhaustedError, m as ErrorCode, E as ErrorMetadata, I as IntegrationNotConnectedError, n as InvalidTaskIdError, K as KnownAgentRunErrorCode, M as MemoryAdapterError, o as MemoryAdapterErrorCode, N as NetworkError, R as RateLimitError, p as TaskNotFoundError, T as TheokitAgentError, U as UnknownAgentError, q as UnsupportedBudgetOperationError, r as UnsupportedRunOperationError, s as UnsupportedTaskOperationError, t as isTransientError } from './errors-L1bxHHO0.cjs';
2
+ import './run-XXnwwGOT.cjs';
3
3
  import 'zod';
package/dist/errors.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { A as AgentDisposedError, c as AgentRunError, d as AgentRunErrorCode, e as AuthenticationError, g as BudgetExceededError, C as ConfigurationError, u as CredentialPoolExhaustedError, m as ErrorCode, E as ErrorMetadata, I as IntegrationNotConnectedError, n as InvalidTaskIdError, K as KnownAgentRunErrorCode, M as MemoryAdapterError, o as MemoryAdapterErrorCode, N as NetworkError, R as RateLimitError, p as TaskNotFoundError, T as TheokitAgentError, U as UnknownAgentError, q as UnsupportedBudgetOperationError, r as UnsupportedRunOperationError, s as UnsupportedTaskOperationError, t as isTransientError } from './errors-DjBQ4Tn8.js';
2
- import './run-i2-fUohR.js';
1
+ export { A as AgentDisposedError, c as AgentRunError, d as AgentRunErrorCode, e as AuthenticationError, g as BudgetExceededError, C as ConfigurationError, u as CredentialPoolExhaustedError, m as ErrorCode, E as ErrorMetadata, I as IntegrationNotConnectedError, n as InvalidTaskIdError, K as KnownAgentRunErrorCode, M as MemoryAdapterError, o as MemoryAdapterErrorCode, N as NetworkError, R as RateLimitError, p as TaskNotFoundError, T as TheokitAgentError, U as UnknownAgentError, q as UnsupportedBudgetOperationError, r as UnsupportedRunOperationError, s as UnsupportedTaskOperationError, t as isTransientError } from './errors-DxQe4_Qy.js';
2
+ import './run-XXnwwGOT.js';
3
3
  import 'zod';
package/dist/eval.cjs CHANGED
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkS7OEXQMI_cjs = require('./chunk-S7OEXQMI.cjs');
4
- var chunkGKZY34TD_cjs = require('./chunk-GKZY34TD.cjs');
4
+ var chunkBVGJXMSB_cjs = require('./chunk-BVGJXMSB.cjs');
5
5
  require('./chunk-BV2MWEMV.cjs');
6
6
  require('./chunk-QMIG7TKG.cjs');
7
7
  var chunkBUUUWQMB_cjs = require('./chunk-BUUUWQMB.cjs');
8
8
  require('./chunk-N4JNY5DT.cjs');
9
- require('./chunk-MWVLE5RY.cjs');
9
+ require('./chunk-WMWZAJMJ.cjs');
10
10
  require('./chunk-SEWAPWAF.cjs');
11
11
  require('./chunk-ELYGL52R.cjs');
12
12
  require('./chunk-BURYFNOM.cjs');
@@ -28,7 +28,7 @@ require('./chunk-RHQJX3EI.cjs');
28
28
  require('./chunk-PDOLUFGY.cjs');
29
29
  require('./chunk-4E3HLSYE.cjs');
30
30
  require('./chunk-NJVV5OAV.cjs');
31
- var chunkJERO4TP6_cjs = require('./chunk-JERO4TP6.cjs');
31
+ var chunkZVQJHY4Y_cjs = require('./chunk-ZVQJHY4Y.cjs');
32
32
  require('./chunk-4H2QARXM.cjs');
33
33
  require('./chunk-YLQQX5W2.cjs');
34
34
  require('./chunk-H2V6CXM7.cjs');
@@ -330,14 +330,14 @@ function probeRow(entry, index) {
330
330
  }
331
331
  function computeDoneKeys(persist) {
332
332
  if (persist.resume !== true) return /* @__PURE__ */ new Set();
333
- return chunkJERO4TP6_cjs.readJsonlIds(
333
+ return chunkZVQJHY4Y_cjs.readJsonlIds(
334
334
  persist.path,
335
335
  (parsed) => parsed.error === void 0 ? persist.key(parsed) : void 0
336
336
  );
337
337
  }
338
338
  function appendRowSafely(path, row) {
339
339
  try {
340
- chunkJERO4TP6_cjs.appendJsonl(path, row);
340
+ chunkZVQJHY4Y_cjs.appendJsonl(path, row);
341
341
  } catch (err) {
342
342
  chunkA76OFN2B_cjs.diag(
343
343
  `[eval] persist append failed (ignored): ${err instanceof Error ? err.message : String(err)}
@@ -773,7 +773,7 @@ function makeDefaultEmbedder(opts) {
773
773
  let runtime;
774
774
  return (texts) => {
775
775
  if (runtime === void 0) {
776
- runtime = chunkGKZY34TD_cjs.openRouterMemoryEmbeddingProviderAdapter.create(embedderCreateOptions(opts));
776
+ runtime = chunkBVGJXMSB_cjs.openRouterMemoryEmbeddingProviderAdapter.create(embedderCreateOptions(opts));
777
777
  }
778
778
  return runtime.then((rt) => rt.embed(texts));
779
779
  };
@@ -1017,11 +1017,11 @@ var Eval = class _Eval {
1017
1017
 
1018
1018
  Object.defineProperty(exports, "JsonlParseError", {
1019
1019
  enumerable: true,
1020
- get: function () { return chunkJERO4TP6_cjs.JsonlParseError; }
1020
+ get: function () { return chunkZVQJHY4Y_cjs.JsonlParseError; }
1021
1021
  });
1022
1022
  Object.defineProperty(exports, "loadJsonl", {
1023
1023
  enumerable: true,
1024
- get: function () { return chunkJERO4TP6_cjs.loadJsonl; }
1024
+ get: function () { return chunkZVQJHY4Y_cjs.loadJsonl; }
1025
1025
  });
1026
1026
  exports.Eval = Eval;
1027
1027
  exports.EvalAlreadyRunningError = EvalAlreadyRunningError;
package/dist/eval.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { shellEscapePosix, LocalSandbox } from './chunk-SKWVAQAY.js';
2
- import { openRouterMemoryEmbeddingProviderAdapter } from './chunk-JWRMBFSP.js';
2
+ import { openRouterMemoryEmbeddingProviderAdapter } from './chunk-ZRQZOJ3N.js';
3
3
  import './chunk-2SFBB54R.js';
4
4
  import './chunk-UIPTINIF.js';
5
5
  import { getTracer } from './chunk-K2BQQ445.js';
6
6
  import './chunk-ONVIALVV.js';
7
- import './chunk-7WXT5M6P.js';
7
+ import './chunk-XRKFWV7K.js';
8
8
  import './chunk-X627TO3A.js';
9
9
  import './chunk-MI3OKONE.js';
10
10
  import './chunk-5KOW3GLE.js';
@@ -26,8 +26,8 @@ import './chunk-XKGOIGTJ.js';
26
26
  import './chunk-F4SQTWVR.js';
27
27
  import './chunk-LWVKI75U.js';
28
28
  import './chunk-EYUZZXHZ.js';
29
- import { readJsonlIds, appendJsonl } from './chunk-RTDT2UMT.js';
30
- export { JsonlParseError, loadJsonl } from './chunk-RTDT2UMT.js';
29
+ import { readJsonlIds, appendJsonl } from './chunk-5VKUZ26Q.js';
30
+ export { JsonlParseError, loadJsonl } from './chunk-5VKUZ26Q.js';
31
31
  import './chunk-VTDQRUAJ.js';
32
32
  import './chunk-2XLKLVVR.js';
33
33
  import './chunk-BM7VYZED.js';
@@ -0,0 +1,10 @@
1
+ export { FsSessionStore } from './chunk-XRKFWV7K.js';
2
+ import './chunk-LWVKI75U.js';
3
+ import './chunk-EYUZZXHZ.js';
4
+ import './chunk-5VKUZ26Q.js';
5
+ import './chunk-2XLKLVVR.js';
6
+ import './chunk-5XPKYDK7.js';
7
+ import './chunk-VQ33XLC6.js';
8
+ import './chunk-RNCN2TTP.js';
9
+ //# sourceMappingURL=fs-session-store-I6GUIFRO.js.map
10
+ //# sourceMappingURL=fs-session-store-I6GUIFRO.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"fs-session-store-YPZIOLJM.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"fs-session-store-I6GUIFRO.js"}
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunkMWVLE5RY_cjs = require('./chunk-MWVLE5RY.cjs');
3
+ var chunkWMWZAJMJ_cjs = require('./chunk-WMWZAJMJ.cjs');
4
4
  require('./chunk-4E3HLSYE.cjs');
5
5
  require('./chunk-NJVV5OAV.cjs');
6
- require('./chunk-JERO4TP6.cjs');
6
+ require('./chunk-ZVQJHY4Y.cjs');
7
7
  require('./chunk-YLQQX5W2.cjs');
8
8
  require('./chunk-33B2BSME.cjs');
9
9
  require('./chunk-E7WWIX34.cjs');
@@ -13,7 +13,7 @@ require('./chunk-A76OFN2B.cjs');
13
13
 
14
14
  Object.defineProperty(exports, "FsSessionStore", {
15
15
  enumerable: true,
16
- get: function () { return chunkMWVLE5RY_cjs.FsSessionStore; }
16
+ get: function () { return chunkWMWZAJMJ_cjs.FsSessionStore; }
17
17
  });
18
- //# sourceMappingURL=fs-session-store-V32XJ63Z.cjs.map
19
- //# sourceMappingURL=fs-session-store-V32XJ63Z.cjs.map
18
+ //# sourceMappingURL=fs-session-store-KRZZIG3O.cjs.map
19
+ //# sourceMappingURL=fs-session-store-KRZZIG3O.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"fs-session-store-V32XJ63Z.cjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"fs-session-store-KRZZIG3O.cjs"}
package/dist/index.cjs CHANGED
@@ -8,13 +8,13 @@ require('./chunk-PIBXDEZM.cjs');
8
8
  var chunkEJNFZET4_cjs = require('./chunk-EJNFZET4.cjs');
9
9
  require('./chunk-5COPO3H4.cjs');
10
10
  require('./chunk-PNVDQL5Y.cjs');
11
- var chunkIIBQBMIS_cjs = require('./chunk-IIBQBMIS.cjs');
12
- var chunkGKZY34TD_cjs = require('./chunk-GKZY34TD.cjs');
11
+ var chunk6AE4QTSF_cjs = require('./chunk-6AE4QTSF.cjs');
12
+ var chunkBVGJXMSB_cjs = require('./chunk-BVGJXMSB.cjs');
13
13
  require('./chunk-BV2MWEMV.cjs');
14
14
  var chunkQMIG7TKG_cjs = require('./chunk-QMIG7TKG.cjs');
15
15
  require('./chunk-BUUUWQMB.cjs');
16
16
  require('./chunk-N4JNY5DT.cjs');
17
- require('./chunk-MWVLE5RY.cjs');
17
+ require('./chunk-WMWZAJMJ.cjs');
18
18
  var chunkSEWAPWAF_cjs = require('./chunk-SEWAPWAF.cjs');
19
19
  require('./chunk-ELYGL52R.cjs');
20
20
  require('./chunk-BURYFNOM.cjs');
@@ -36,7 +36,7 @@ require('./chunk-RHQJX3EI.cjs');
36
36
  require('./chunk-PDOLUFGY.cjs');
37
37
  require('./chunk-4E3HLSYE.cjs');
38
38
  require('./chunk-NJVV5OAV.cjs');
39
- require('./chunk-JERO4TP6.cjs');
39
+ require('./chunk-ZVQJHY4Y.cjs');
40
40
  require('./chunk-4H2QARXM.cjs');
41
41
  var chunkYLQQX5W2_cjs = require('./chunk-YLQQX5W2.cjs');
42
42
  require('./chunk-H2V6CXM7.cjs');
@@ -62,8 +62,8 @@ var fs = require('fs');
62
62
  // src/agent-factory.ts
63
63
  function createAgentFactory(common) {
64
64
  return {
65
- forSession: (agentId, overrides) => chunkGKZY34TD_cjs.Agent.create(mergeAgentOptions(common, overrides, agentId)),
66
- getOrCreate: (agentId, overrides) => chunkGKZY34TD_cjs.Agent.getOrCreate(agentId, mergeAgentOptions(common, overrides, agentId))
65
+ forSession: (agentId, overrides) => chunkBVGJXMSB_cjs.Agent.create(mergeAgentOptions(common, overrides, agentId)),
66
+ getOrCreate: (agentId, overrides) => chunkBVGJXMSB_cjs.Agent.getOrCreate(agentId, mergeAgentOptions(common, overrides, agentId))
67
67
  };
68
68
  }
69
69
  function mergeAgentOptions(common, overrides, agentId) {
@@ -1167,7 +1167,7 @@ var Memory = {
1167
1167
  return await peer.IndexManager.open(openArgs);
1168
1168
  }
1169
1169
  const { IndexManager } = await import('./index-manager-LEMQ73A7.cjs');
1170
- openArgs.embedding = await resolveEmbedding(opts.embedding, chunkGKZY34TD_cjs.MEMORY_EMBEDDING_ADAPTERS);
1170
+ openArgs.embedding = await resolveEmbedding(opts.embedding, chunkBVGJXMSB_cjs.MEMORY_EMBEDDING_ADAPTERS);
1171
1171
  return await IndexManager.open(openArgs);
1172
1172
  },
1173
1173
  /**
@@ -1178,7 +1178,7 @@ var Memory = {
1178
1178
  */
1179
1179
  async runDreamingSweep(opts) {
1180
1180
  const peer = await tryLoadSdkMemoryPeer();
1181
- const catalog = peer !== null ? peer.MEMORY_EMBEDDING_ADAPTERS : chunkGKZY34TD_cjs.MEMORY_EMBEDDING_ADAPTERS;
1181
+ const catalog = peer !== null ? peer.MEMORY_EMBEDDING_ADAPTERS : chunkBVGJXMSB_cjs.MEMORY_EMBEDDING_ADAPTERS;
1182
1182
  const sweepArgs = await buildDreamingSweepArgs(opts, catalog);
1183
1183
  const result = peer !== null ? (
1184
1184
  // biome-ignore lint/suspicious/noExplicitAny: peer is dynamically loaded — structural compat ensured by sdk-memory
@@ -1600,7 +1600,7 @@ function ehAgenteConstruido(m) {
1600
1600
  return typeof m.send === "function";
1601
1601
  }
1602
1602
  async function materializar(def, indice) {
1603
- const { Agent: Agent2 } = await import('./agent-IKDNM7OA.cjs');
1603
+ const { Agent: Agent2 } = await import('./agent-OOXJJD6A.cjs');
1604
1604
  return Agent2.create({
1605
1605
  // `AgentDefinition.model` admits the sentinel `'inherit'`, which is not a model id. Inheriting
1606
1606
  // here means "declare nothing and let the default apply" — forwarding the literal would create
@@ -1742,7 +1742,7 @@ var FIXTURE_USER = {
1742
1742
  };
1743
1743
  var FIXTURE_MODELS = [
1744
1744
  {
1745
- id: chunkGKZY34TD_cjs.DEFAULT_AGENTIC_MODEL_ID,
1745
+ id: chunkBVGJXMSB_cjs.DEFAULT_AGENTIC_MODEL_ID,
1746
1746
  name: "Gemini 2.0 Flash",
1747
1747
  displayName: "Gemini 2.0 Flash",
1748
1748
  parameters: [
@@ -1945,7 +1945,7 @@ var Theokit = class {
1945
1945
  envVars: p.envVars
1946
1946
  }));
1947
1947
  },
1948
- embeddingAdapters: () => Object.entries(chunkGKZY34TD_cjs.MEMORY_EMBEDDING_ADAPTERS).map(([id, adapter]) => ({
1948
+ embeddingAdapters: () => Object.entries(chunkBVGJXMSB_cjs.MEMORY_EMBEDDING_ADAPTERS).map(([id, adapter]) => ({
1949
1949
  id,
1950
1950
  transport: adapter.transport,
1951
1951
  defaultModel: adapter.defaultModel
@@ -1977,7 +1977,7 @@ function resolveLocalProviderBaseUrl(providerName, fallback) {
1977
1977
  return fallback;
1978
1978
  }
1979
1979
  async function executeCatalogRequest(request) {
1980
- const apiKey = chunkGKZY34TD_cjs.resolveApiKey(request.apiKey);
1980
+ const apiKey = chunkBVGJXMSB_cjs.resolveApiKey(request.apiKey);
1981
1981
  if (apiKey === void 0) {
1982
1982
  throw new chunkE7WWIX34_cjs.AuthenticationError("Missing API key", { code: "missing_api_key" });
1983
1983
  }
@@ -2103,35 +2103,35 @@ Object.defineProperty(exports, "GenerateObjectError", {
2103
2103
  });
2104
2104
  Object.defineProperty(exports, "Cron", {
2105
2105
  enumerable: true,
2106
- get: function () { return chunkIIBQBMIS_cjs.Cron; }
2106
+ get: function () { return chunk6AE4QTSF_cjs.Cron; }
2107
2107
  });
2108
2108
  Object.defineProperty(exports, "Agent", {
2109
2109
  enumerable: true,
2110
- get: function () { return chunkGKZY34TD_cjs.Agent; }
2110
+ get: function () { return chunkBVGJXMSB_cjs.Agent; }
2111
2111
  });
2112
2112
  Object.defineProperty(exports, "AgentBuilder", {
2113
2113
  enumerable: true,
2114
- get: function () { return chunkGKZY34TD_cjs.AgentBuilder; }
2114
+ get: function () { return chunkBVGJXMSB_cjs.AgentBuilder; }
2115
2115
  });
2116
2116
  Object.defineProperty(exports, "Tool", {
2117
2117
  enumerable: true,
2118
- get: function () { return chunkGKZY34TD_cjs.Tool; }
2118
+ get: function () { return chunkBVGJXMSB_cjs.Tool; }
2119
2119
  });
2120
2120
  Object.defineProperty(exports, "ToolError", {
2121
2121
  enumerable: true,
2122
- get: function () { return chunkGKZY34TD_cjs.ToolError; }
2122
+ get: function () { return chunkBVGJXMSB_cjs.ToolError; }
2123
2123
  });
2124
2124
  Object.defineProperty(exports, "UsageAccumulator", {
2125
2125
  enumerable: true,
2126
- get: function () { return chunkGKZY34TD_cjs.UsageAccumulator; }
2126
+ get: function () { return chunkBVGJXMSB_cjs.UsageAccumulator; }
2127
2127
  });
2128
2128
  Object.defineProperty(exports, "computeCost", {
2129
2129
  enumerable: true,
2130
- get: function () { return chunkGKZY34TD_cjs.computeCost; }
2130
+ get: function () { return chunkBVGJXMSB_cjs.computeCost; }
2131
2131
  });
2132
2132
  Object.defineProperty(exports, "getPricingEntry", {
2133
2133
  enumerable: true,
2134
- get: function () { return chunkGKZY34TD_cjs.getPricingEntry; }
2134
+ get: function () { return chunkBVGJXMSB_cjs.getPricingEntry; }
2135
2135
  });
2136
2136
  Object.defineProperty(exports, "emitRunEvent", {
2137
2137
  enumerable: true,
package/dist/index.d.cts CHANGED
@@ -1,13 +1,13 @@
1
- import { T as TheokitAgentError, B as BudgetOptions, a as BudgetHandle, b as BudgetSnapshot, E as ErrorMetadata } from './errors-DMY-gLSK.cjs';
2
- export { A as AgentDisposedError, c as AgentRunError, d as AgentRunErrorCode, e as AuthenticationError, f as BudgetExceedEvent, g as BudgetExceededError, h as BudgetLimit, i as BudgetMode, j as BudgetScope, k as BudgetThresholdEvent, l as BudgetWindow, C as ConfigurationError, m as ErrorCode, I as IntegrationNotConnectedError, n as InvalidTaskIdError, M as MemoryAdapterError, o as MemoryAdapterErrorCode, N as NetworkError, R as RateLimitError, p as TaskNotFoundError, U as UnknownAgentError, q as UnsupportedBudgetOperationError, r as UnsupportedRunOperationError, s as UnsupportedTaskOperationError, t as isTransientError } from './errors-DMY-gLSK.cjs';
3
- import { A as AgentOptions, L as LocalOptions, P as ProviderRoutingSettings, S as SystemPromptResolver, C as CloudOptions, M as MemorySettings, a as AgentDefinition, b as ContextSettings, c as PluginsSettings, d as SkillsSettings, e as SDKAgent, f as ListAgentsOptions, g as ListResult, h as SDKAgentInfo, G as GetAgentOptions, i as ListRunsOptions, j as GetRunOptions, k as AgentOperationOptions, l as AgentDescription, m as Plugin$1, n as ProviderProfile, I as InlineSkill, J as JudgeResult, o as GoalOptions, p as GoalEvent, q as GoalResult, B as BudgetTracker, r as MemoryProvider, s as MemoryId, t as PreToolCallDecision, u as SDKProvider } from './agent-D7bRK9Kg.cjs';
4
- export { v as ActiveMemoryPassArgs, w as ActiveMemoryPassResult, x as AgentMemory, y as AgentSubagentDescription, z as AgentToolDescription, D as BudgetCheck, E as BudgetTotal, F as BudgetUsageEvent, H as CloudEnv, K as CloudRepo, N as ContextBudget, O as ContextManagerKind, Q as ContextSnapshot, R as ContextSource, T as ContextSourceStatus, U as CreateSkillSpec, V as HookName, W as InvalidateCacheOptions, X as MemoryAdapter, Y as MemoryAdapterCapabilities, Z as MemoryContext, _ as MemoryFact, $ as MemoryProviderHandle, a0 as MemoryProviderInitOptions, a1 as MemoryRevision, a2 as MemoryToolSchema, a3 as MemoryTurnMessage, a4 as PersonalityPreset, a5 as PluginContext, a6 as PostAssistantReplyContext, a7 as PostToolCallContext, a8 as PreToolCallContext, a9 as PreUserSendContext, aa as PreUserSendResult, ab as ProviderCapability, ac as ProviderRoute, ad as ProviderTransform, ae as ProviderTransformContext, af as RecordSessionSummaryArgs, ag as ResolvedProviderRoute, ah as RunUntilIterator, ai as SDKAgentPlugins, aj as SDKAgentSkillDetail, ak as SDKAgentSkills, al as SDKArtifact, am as SDKContextManager, an as SDKPluginMetadata, ao as SDKProvidersManager, ap as SessionLifecycleContext, aq as SessionRecord, ar as SessionStore, as as SettingSource, at as Skill, au as SkillsResolver, av as SkillsResolverContext, aw as SystemPromptContext, ax as SystemPromptMemoryFact, ay as SystemPromptSkillRef, az as TelemetrySettings, aA as ToolCallSummary, aB as ToolResultTransformContext, aC as TransformContext, aD as Verdict } from './agent-D7bRK9Kg.cjs';
5
- import { R as RunResult, M as ModelSelection, C as CustomTool, a as McpServerConfig, T as ToolResultContentBlock, b as Run, P as Processor, c as PermissionMode, d as PermissionEngine, e as RunEventSink, S as SDKMessage } from './run-i2-fUohR.cjs';
6
- export { A as AgentConversationTurn, f as AssistantMessage, g as CompletionCheck, h as CompletionCheckResult, i as ConversationStep, j as ConversationTurn, k as CostBreakdown, l as CostSource, m as CostStatus, D as DoomLoopThresholds, G as GenerateOptions, n as GenerateRunResult, I as ImageBlock, o as InputProcessorContext, p as InteractionUpdate, q as McpAuthConfig, r as McpHttpServerConfig, s as McpOAuthConfig, t as McpStdioServerConfig, u as MessageOrigin, v as ModelParameterValue, O as OutputProcessorContext, w as PartialToolCallUpdate, x as PermissionAction, y as PermissionEngineOptions, z as PermissionRule, B as ProcessorControls, E as ProcessorTripwire, F as ProcessorViolation, H as RunCompactBoundaryEvent, J as RunCompletionCheckEvent, K as RunErrorDetail, L as RunEvent, N as RunGitInfo, Q as RunOperation, U as RunPermissionDeniedEvent, V as RunRateLimitEvent, W as RunStatus, X as RunTaskCompletedEvent, Y as RunTaskStartedEvent, Z as RunTaskUpdatedEvent, _ as RunTimelineEvent, $ as RunToCompletionOptions, a0 as RunToCompletionResult, a1 as RunToolProgressEvent, a2 as RunTripwireEvent, a3 as SDKAssistantMessage, a4 as SDKImage, a5 as SDKImageDimension, a6 as SDKObjectDelta, a7 as SDKRequestMessage, a8 as SDKStatusMessage, a9 as SDKSystemMessage, aa as SDKTaskMessage, ab as SDKThinkingMessage, ac as SDKToolUseMessage, ad as SDKUserMessage, ae as SDKUserMessageEvent, af as SendOptions, ag as ShellCommand, ah as ShellConversationTurn, ai as ShellOutput, aj as ShellOutputDeltaUpdate, ak as StepCompletedUpdate, al as StepStartedUpdate, am as StreamToCompletionResult, an as SummaryCompletedUpdate, ao as SummaryStartedUpdate, ap as SummaryUpdate, aq as TextBlock, ar as TextDeltaUpdate, as as ThinkingCompletedUpdate, at as ThinkingDeltaUpdate, au as ThinkingMessage, av as TokenDeltaUpdate, aw as TokenUsage, ax as ToolCall, ay as ToolCallCompletedUpdate, az as ToolCallStartedUpdate, aA as ToolContextMessage, aB as ToolResult, aC as ToolResultGuardOptions, aD as ToolUseBlock, aE as TurnEndedUpdate, aF as UserMessage, aG as UserMessageAppendedUpdate, aH as applyMode, aI as emitRunEvent } from './run-i2-fUohR.cjs';
1
+ import { T as TheokitAgentError, B as BudgetOptions, a as BudgetHandle, b as BudgetSnapshot, E as ErrorMetadata } from './errors-L1bxHHO0.cjs';
2
+ export { A as AgentDisposedError, c as AgentRunError, d as AgentRunErrorCode, e as AuthenticationError, f as BudgetExceedEvent, g as BudgetExceededError, h as BudgetLimit, i as BudgetMode, j as BudgetScope, k as BudgetThresholdEvent, l as BudgetWindow, C as ConfigurationError, m as ErrorCode, I as IntegrationNotConnectedError, n as InvalidTaskIdError, M as MemoryAdapterError, o as MemoryAdapterErrorCode, N as NetworkError, R as RateLimitError, p as TaskNotFoundError, U as UnknownAgentError, q as UnsupportedBudgetOperationError, r as UnsupportedRunOperationError, s as UnsupportedTaskOperationError, t as isTransientError } from './errors-L1bxHHO0.cjs';
3
+ import { A as AgentOptions, L as LocalOptions, P as ProviderRoutingSettings, S as SystemPromptResolver, C as CloudOptions, M as MemorySettings, a as AgentDefinition, b as ContextSettings, c as PluginsSettings, d as SkillsSettings, e as SDKAgent, f as ListAgentsOptions, g as ListResult, h as SDKAgentInfo, G as GetAgentOptions, i as ListRunsOptions, j as GetRunOptions, k as AgentOperationOptions, l as AgentDescription, m as Plugin$1, n as ProviderProfile, I as InlineSkill, J as JudgeResult, o as GoalOptions, p as GoalEvent, q as GoalResult, B as BudgetTracker, r as MemoryProvider, s as MemoryId, t as PreToolCallDecision, u as SDKProvider } from './agent-DxEL4fHh.cjs';
4
+ export { v as ActiveMemoryPassArgs, w as ActiveMemoryPassResult, x as AgentMemory, y as AgentSubagentDescription, z as AgentToolDescription, D as BudgetCheck, E as BudgetTotal, F as BudgetUsageEvent, H as CloudEnv, K as CloudRepo, N as ContextBudget, O as ContextManagerKind, Q as ContextSnapshot, R as ContextSource, T as ContextSourceStatus, U as CreateSkillSpec, V as HookName, W as InvalidateCacheOptions, X as MemoryAdapter, Y as MemoryAdapterCapabilities, Z as MemoryContext, _ as MemoryFact, $ as MemoryProviderHandle, a0 as MemoryProviderInitOptions, a1 as MemoryRevision, a2 as MemoryToolSchema, a3 as MemoryTurnMessage, a4 as PersonalityPreset, a5 as PluginContext, a6 as PostAssistantReplyContext, a7 as PostToolCallContext, a8 as PreToolCallContext, a9 as PreUserSendContext, aa as PreUserSendResult, ab as ProviderCapability, ac as ProviderRoute, ad as ProviderTransform, ae as ProviderTransformContext, af as RecordSessionSummaryArgs, ag as ResolvedProviderRoute, ah as RunUntilIterator, ai as SDKAgentPlugins, aj as SDKAgentSkillDetail, ak as SDKAgentSkills, al as SDKArtifact, am as SDKContextManager, an as SDKPluginMetadata, ao as SDKProvidersManager, ap as SessionLifecycleContext, aq as SessionRecord, ar as SessionStore, as as SettingSource, at as Skill, au as SkillsResolver, av as SkillsResolverContext, aw as SystemPromptContext, ax as SystemPromptMemoryFact, ay as SystemPromptSkillRef, az as TelemetrySettings, aA as ToolCallSummary, aB as ToolResultTransformContext, aC as TransformContext, aD as Verdict } from './agent-DxEL4fHh.cjs';
5
+ import { R as RunResult, M as ModelSelection, C as CustomTool, a as McpServerConfig, T as ToolResultContentBlock, b as Run, P as Processor, c as PermissionMode, d as PermissionEngine, e as RunEventSink, S as SDKMessage } from './run-XXnwwGOT.cjs';
6
+ export { A as AgentConversationTurn, f as AssistantMessage, g as CompletionCheck, h as CompletionCheckResult, i as ConversationStep, j as ConversationTurn, k as CostBreakdown, l as CostSource, m as CostStatus, D as DoomLoopThresholds, G as GenerateOptions, n as GenerateRunResult, I as ImageBlock, o as InputProcessorContext, p as InteractionUpdate, q as McpAuthConfig, r as McpHttpServerConfig, s as McpOAuthConfig, t as McpStdioServerConfig, u as MessageOrigin, v as ModelParameterValue, O as OutputProcessorContext, w as PartialToolCallUpdate, x as PermissionAction, y as PermissionEngineOptions, z as PermissionRule, B as ProcessorControls, E as ProcessorTripwire, F as ProcessorViolation, H as RunCompactBoundaryEvent, J as RunCompletionCheckEvent, K as RunErrorDetail, L as RunEvent, N as RunGitInfo, Q as RunOperation, U as RunPermissionDeniedEvent, V as RunRateLimitEvent, W as RunStatus, X as RunTaskCompletedEvent, Y as RunTaskStartedEvent, Z as RunTaskUpdatedEvent, _ as RunTimelineEvent, $ as RunToCompletionOptions, a0 as RunToCompletionResult, a1 as RunToolProgressEvent, a2 as RunTripwireEvent, a3 as SDKAssistantMessage, a4 as SDKImage, a5 as SDKImageDimension, a6 as SDKObjectDelta, a7 as SDKRequestMessage, a8 as SDKStatusMessage, a9 as SDKSystemMessage, aa as SDKTaskMessage, ab as SDKThinkingMessage, ac as SDKToolUseMessage, ad as SDKUserMessage, ae as SDKUserMessageEvent, af as SendOptions, ag as ShellCommand, ah as ShellConversationTurn, ai as ShellOutput, aj as ShellOutputDeltaUpdate, ak as StepCompletedUpdate, al as StepStartedUpdate, am as StreamToCompletionResult, an as SummaryCompletedUpdate, ao as SummaryStartedUpdate, ap as SummaryUpdate, aq as TextBlock, ar as TextDeltaUpdate, as as ThinkingCompletedUpdate, at as ThinkingDeltaUpdate, au as ThinkingMessage, av as TokenDeltaUpdate, aw as TokenUsage, ax as ToolCall, ay as ToolCallCompletedUpdate, az as ToolCallStartedUpdate, aA as ToolContextMessage, aB as ToolResult, aC as ToolResultGuardOptions, aD as ToolUseBlock, aE as TurnEndedUpdate, aF as UserMessage, aG as UserMessageAppendedUpdate, aH as applyMode, aI as emitRunEvent } from './run-XXnwwGOT.cjs';
7
7
  import * as zod from 'zod';
8
8
  import { ZodType, z } from 'zod';
9
- import { S as StepResult } from './cron-D-DVjGQe.cjs';
10
- export { C as Cron, a as CronCreateOptions, b as CronGetOptions, c as CronJob, d as CronJobStatus, e as CronListOptions, f as CronOperationOptions, g as CronRunOptions, h as CronRuntime, i as CronSchedulerStatus, j as CronStartOptions } from './cron-D-DVjGQe.cjs';
9
+ import { S as StepResult } from './cron-BGR0HOz9.cjs';
10
+ export { C as Cron, a as CronCreateOptions, b as CronGetOptions, c as CronJob, d as CronJobStatus, e as CronListOptions, f as CronOperationOptions, g as CronRunOptions, h as CronRuntime, i as CronSchedulerStatus, j as CronStartOptions } from './cron-BGR0HOz9.cjs';
11
11
 
12
12
  /**
13
13
  * Public compaction / context-management helpers (M2-1, extended V3-3).
package/dist/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- import { T as TheokitAgentError, B as BudgetOptions, a as BudgetHandle, b as BudgetSnapshot, E as ErrorMetadata } from './errors-DjBQ4Tn8.js';
2
- export { A as AgentDisposedError, c as AgentRunError, d as AgentRunErrorCode, e as AuthenticationError, f as BudgetExceedEvent, g as BudgetExceededError, h as BudgetLimit, i as BudgetMode, j as BudgetScope, k as BudgetThresholdEvent, l as BudgetWindow, C as ConfigurationError, m as ErrorCode, I as IntegrationNotConnectedError, n as InvalidTaskIdError, M as MemoryAdapterError, o as MemoryAdapterErrorCode, N as NetworkError, R as RateLimitError, p as TaskNotFoundError, U as UnknownAgentError, q as UnsupportedBudgetOperationError, r as UnsupportedRunOperationError, s as UnsupportedTaskOperationError, t as isTransientError } from './errors-DjBQ4Tn8.js';
3
- import { A as AgentOptions, L as LocalOptions, P as ProviderRoutingSettings, S as SystemPromptResolver, C as CloudOptions, M as MemorySettings, a as AgentDefinition, b as ContextSettings, c as PluginsSettings, d as SkillsSettings, e as SDKAgent, f as ListAgentsOptions, g as ListResult, h as SDKAgentInfo, G as GetAgentOptions, i as ListRunsOptions, j as GetRunOptions, k as AgentOperationOptions, l as AgentDescription, m as Plugin$1, n as ProviderProfile, I as InlineSkill, J as JudgeResult, o as GoalOptions, p as GoalEvent, q as GoalResult, B as BudgetTracker, r as MemoryProvider, s as MemoryId, t as PreToolCallDecision, u as SDKProvider } from './agent-ZCZa7YQv.js';
4
- export { v as ActiveMemoryPassArgs, w as ActiveMemoryPassResult, x as AgentMemory, y as AgentSubagentDescription, z as AgentToolDescription, D as BudgetCheck, E as BudgetTotal, F as BudgetUsageEvent, H as CloudEnv, K as CloudRepo, N as ContextBudget, O as ContextManagerKind, Q as ContextSnapshot, R as ContextSource, T as ContextSourceStatus, U as CreateSkillSpec, V as HookName, W as InvalidateCacheOptions, X as MemoryAdapter, Y as MemoryAdapterCapabilities, Z as MemoryContext, _ as MemoryFact, $ as MemoryProviderHandle, a0 as MemoryProviderInitOptions, a1 as MemoryRevision, a2 as MemoryToolSchema, a3 as MemoryTurnMessage, a4 as PersonalityPreset, a5 as PluginContext, a6 as PostAssistantReplyContext, a7 as PostToolCallContext, a8 as PreToolCallContext, a9 as PreUserSendContext, aa as PreUserSendResult, ab as ProviderCapability, ac as ProviderRoute, ad as ProviderTransform, ae as ProviderTransformContext, af as RecordSessionSummaryArgs, ag as ResolvedProviderRoute, ah as RunUntilIterator, ai as SDKAgentPlugins, aj as SDKAgentSkillDetail, ak as SDKAgentSkills, al as SDKArtifact, am as SDKContextManager, an as SDKPluginMetadata, ao as SDKProvidersManager, ap as SessionLifecycleContext, aq as SessionRecord, ar as SessionStore, as as SettingSource, at as Skill, au as SkillsResolver, av as SkillsResolverContext, aw as SystemPromptContext, ax as SystemPromptMemoryFact, ay as SystemPromptSkillRef, az as TelemetrySettings, aA as ToolCallSummary, aB as ToolResultTransformContext, aC as TransformContext, aD as Verdict } from './agent-ZCZa7YQv.js';
5
- import { R as RunResult, M as ModelSelection, C as CustomTool, a as McpServerConfig, T as ToolResultContentBlock, b as Run, P as Processor, c as PermissionMode, d as PermissionEngine, e as RunEventSink, S as SDKMessage } from './run-i2-fUohR.js';
6
- export { A as AgentConversationTurn, f as AssistantMessage, g as CompletionCheck, h as CompletionCheckResult, i as ConversationStep, j as ConversationTurn, k as CostBreakdown, l as CostSource, m as CostStatus, D as DoomLoopThresholds, G as GenerateOptions, n as GenerateRunResult, I as ImageBlock, o as InputProcessorContext, p as InteractionUpdate, q as McpAuthConfig, r as McpHttpServerConfig, s as McpOAuthConfig, t as McpStdioServerConfig, u as MessageOrigin, v as ModelParameterValue, O as OutputProcessorContext, w as PartialToolCallUpdate, x as PermissionAction, y as PermissionEngineOptions, z as PermissionRule, B as ProcessorControls, E as ProcessorTripwire, F as ProcessorViolation, H as RunCompactBoundaryEvent, J as RunCompletionCheckEvent, K as RunErrorDetail, L as RunEvent, N as RunGitInfo, Q as RunOperation, U as RunPermissionDeniedEvent, V as RunRateLimitEvent, W as RunStatus, X as RunTaskCompletedEvent, Y as RunTaskStartedEvent, Z as RunTaskUpdatedEvent, _ as RunTimelineEvent, $ as RunToCompletionOptions, a0 as RunToCompletionResult, a1 as RunToolProgressEvent, a2 as RunTripwireEvent, a3 as SDKAssistantMessage, a4 as SDKImage, a5 as SDKImageDimension, a6 as SDKObjectDelta, a7 as SDKRequestMessage, a8 as SDKStatusMessage, a9 as SDKSystemMessage, aa as SDKTaskMessage, ab as SDKThinkingMessage, ac as SDKToolUseMessage, ad as SDKUserMessage, ae as SDKUserMessageEvent, af as SendOptions, ag as ShellCommand, ah as ShellConversationTurn, ai as ShellOutput, aj as ShellOutputDeltaUpdate, ak as StepCompletedUpdate, al as StepStartedUpdate, am as StreamToCompletionResult, an as SummaryCompletedUpdate, ao as SummaryStartedUpdate, ap as SummaryUpdate, aq as TextBlock, ar as TextDeltaUpdate, as as ThinkingCompletedUpdate, at as ThinkingDeltaUpdate, au as ThinkingMessage, av as TokenDeltaUpdate, aw as TokenUsage, ax as ToolCall, ay as ToolCallCompletedUpdate, az as ToolCallStartedUpdate, aA as ToolContextMessage, aB as ToolResult, aC as ToolResultGuardOptions, aD as ToolUseBlock, aE as TurnEndedUpdate, aF as UserMessage, aG as UserMessageAppendedUpdate, aH as applyMode, aI as emitRunEvent } from './run-i2-fUohR.js';
1
+ import { T as TheokitAgentError, B as BudgetOptions, a as BudgetHandle, b as BudgetSnapshot, E as ErrorMetadata } from './errors-DxQe4_Qy.js';
2
+ export { A as AgentDisposedError, c as AgentRunError, d as AgentRunErrorCode, e as AuthenticationError, f as BudgetExceedEvent, g as BudgetExceededError, h as BudgetLimit, i as BudgetMode, j as BudgetScope, k as BudgetThresholdEvent, l as BudgetWindow, C as ConfigurationError, m as ErrorCode, I as IntegrationNotConnectedError, n as InvalidTaskIdError, M as MemoryAdapterError, o as MemoryAdapterErrorCode, N as NetworkError, R as RateLimitError, p as TaskNotFoundError, U as UnknownAgentError, q as UnsupportedBudgetOperationError, r as UnsupportedRunOperationError, s as UnsupportedTaskOperationError, t as isTransientError } from './errors-DxQe4_Qy.js';
3
+ import { A as AgentOptions, L as LocalOptions, P as ProviderRoutingSettings, S as SystemPromptResolver, C as CloudOptions, M as MemorySettings, a as AgentDefinition, b as ContextSettings, c as PluginsSettings, d as SkillsSettings, e as SDKAgent, f as ListAgentsOptions, g as ListResult, h as SDKAgentInfo, G as GetAgentOptions, i as ListRunsOptions, j as GetRunOptions, k as AgentOperationOptions, l as AgentDescription, m as Plugin$1, n as ProviderProfile, I as InlineSkill, J as JudgeResult, o as GoalOptions, p as GoalEvent, q as GoalResult, B as BudgetTracker, r as MemoryProvider, s as MemoryId, t as PreToolCallDecision, u as SDKProvider } from './agent-BzZwYFiw.js';
4
+ export { v as ActiveMemoryPassArgs, w as ActiveMemoryPassResult, x as AgentMemory, y as AgentSubagentDescription, z as AgentToolDescription, D as BudgetCheck, E as BudgetTotal, F as BudgetUsageEvent, H as CloudEnv, K as CloudRepo, N as ContextBudget, O as ContextManagerKind, Q as ContextSnapshot, R as ContextSource, T as ContextSourceStatus, U as CreateSkillSpec, V as HookName, W as InvalidateCacheOptions, X as MemoryAdapter, Y as MemoryAdapterCapabilities, Z as MemoryContext, _ as MemoryFact, $ as MemoryProviderHandle, a0 as MemoryProviderInitOptions, a1 as MemoryRevision, a2 as MemoryToolSchema, a3 as MemoryTurnMessage, a4 as PersonalityPreset, a5 as PluginContext, a6 as PostAssistantReplyContext, a7 as PostToolCallContext, a8 as PreToolCallContext, a9 as PreUserSendContext, aa as PreUserSendResult, ab as ProviderCapability, ac as ProviderRoute, ad as ProviderTransform, ae as ProviderTransformContext, af as RecordSessionSummaryArgs, ag as ResolvedProviderRoute, ah as RunUntilIterator, ai as SDKAgentPlugins, aj as SDKAgentSkillDetail, ak as SDKAgentSkills, al as SDKArtifact, am as SDKContextManager, an as SDKPluginMetadata, ao as SDKProvidersManager, ap as SessionLifecycleContext, aq as SessionRecord, ar as SessionStore, as as SettingSource, at as Skill, au as SkillsResolver, av as SkillsResolverContext, aw as SystemPromptContext, ax as SystemPromptMemoryFact, ay as SystemPromptSkillRef, az as TelemetrySettings, aA as ToolCallSummary, aB as ToolResultTransformContext, aC as TransformContext, aD as Verdict } from './agent-BzZwYFiw.js';
5
+ import { R as RunResult, M as ModelSelection, C as CustomTool, a as McpServerConfig, T as ToolResultContentBlock, b as Run, P as Processor, c as PermissionMode, d as PermissionEngine, e as RunEventSink, S as SDKMessage } from './run-XXnwwGOT.js';
6
+ export { A as AgentConversationTurn, f as AssistantMessage, g as CompletionCheck, h as CompletionCheckResult, i as ConversationStep, j as ConversationTurn, k as CostBreakdown, l as CostSource, m as CostStatus, D as DoomLoopThresholds, G as GenerateOptions, n as GenerateRunResult, I as ImageBlock, o as InputProcessorContext, p as InteractionUpdate, q as McpAuthConfig, r as McpHttpServerConfig, s as McpOAuthConfig, t as McpStdioServerConfig, u as MessageOrigin, v as ModelParameterValue, O as OutputProcessorContext, w as PartialToolCallUpdate, x as PermissionAction, y as PermissionEngineOptions, z as PermissionRule, B as ProcessorControls, E as ProcessorTripwire, F as ProcessorViolation, H as RunCompactBoundaryEvent, J as RunCompletionCheckEvent, K as RunErrorDetail, L as RunEvent, N as RunGitInfo, Q as RunOperation, U as RunPermissionDeniedEvent, V as RunRateLimitEvent, W as RunStatus, X as RunTaskCompletedEvent, Y as RunTaskStartedEvent, Z as RunTaskUpdatedEvent, _ as RunTimelineEvent, $ as RunToCompletionOptions, a0 as RunToCompletionResult, a1 as RunToolProgressEvent, a2 as RunTripwireEvent, a3 as SDKAssistantMessage, a4 as SDKImage, a5 as SDKImageDimension, a6 as SDKObjectDelta, a7 as SDKRequestMessage, a8 as SDKStatusMessage, a9 as SDKSystemMessage, aa as SDKTaskMessage, ab as SDKThinkingMessage, ac as SDKToolUseMessage, ad as SDKUserMessage, ae as SDKUserMessageEvent, af as SendOptions, ag as ShellCommand, ah as ShellConversationTurn, ai as ShellOutput, aj as ShellOutputDeltaUpdate, ak as StepCompletedUpdate, al as StepStartedUpdate, am as StreamToCompletionResult, an as SummaryCompletedUpdate, ao as SummaryStartedUpdate, ap as SummaryUpdate, aq as TextBlock, ar as TextDeltaUpdate, as as ThinkingCompletedUpdate, at as ThinkingDeltaUpdate, au as ThinkingMessage, av as TokenDeltaUpdate, aw as TokenUsage, ax as ToolCall, ay as ToolCallCompletedUpdate, az as ToolCallStartedUpdate, aA as ToolContextMessage, aB as ToolResult, aC as ToolResultGuardOptions, aD as ToolUseBlock, aE as TurnEndedUpdate, aF as UserMessage, aG as UserMessageAppendedUpdate, aH as applyMode, aI as emitRunEvent } from './run-XXnwwGOT.js';
7
7
  import * as zod from 'zod';
8
8
  import { ZodType, z } from 'zod';
9
- import { S as StepResult } from './cron-Bx7tzm5R.js';
10
- export { C as Cron, a as CronCreateOptions, b as CronGetOptions, c as CronJob, d as CronJobStatus, e as CronListOptions, f as CronOperationOptions, g as CronRunOptions, h as CronRuntime, i as CronSchedulerStatus, j as CronStartOptions } from './cron-Bx7tzm5R.js';
9
+ import { S as StepResult } from './cron-CDAIWCrL.js';
10
+ export { C as Cron, a as CronCreateOptions, b as CronGetOptions, c as CronJob, d as CronJobStatus, e as CronListOptions, f as CronOperationOptions, g as CronRunOptions, h as CronRuntime, i as CronSchedulerStatus, j as CronStartOptions } from './cron-CDAIWCrL.js';
11
11
 
12
12
  /**
13
13
  * Public compaction / context-management helpers (M2-1, extended V3-3).