theokit 0.80.2 → 0.82.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 (71) hide show
  1. package/README.md +26 -0
  2. package/dist/{actions-virtual-module-CA4YEAL3.js → actions-virtual-module-SY4QNAUM.js} +18 -18
  3. package/dist/adapters/agent-mount.js +12 -12
  4. package/dist/{app-typed-client-ZCLFXBEC.js → app-typed-client-TJJFQ6H4.js} +20 -20
  5. package/dist/{chunk-HWRZUQPE.js → chunk-4DYCGAMJ.js} +6 -6
  6. package/dist/{chunk-2Z3GHQ64.js → chunk-5EZJNG6M.js} +5 -5
  7. package/dist/{chunk-APUYC5BE.js → chunk-6QNGLLJX.js} +3 -3
  8. package/dist/{chunk-TQTEKNOL.js → chunk-AP2E5WHS.js} +1 -5
  9. package/dist/{chunk-TQTEKNOL.js.map → chunk-AP2E5WHS.js.map} +1 -1
  10. package/dist/{chunk-QEVTZ3IH.js → chunk-B74FR53E.js} +30 -30
  11. package/dist/{chunk-SHBPXX5E.js → chunk-CM25CTBJ.js} +3 -3
  12. package/dist/{chunk-U3SPBLJF.js → chunk-DIPCJ5VE.js} +1 -5
  13. package/dist/chunk-DIPCJ5VE.js.map +1 -0
  14. package/dist/{chunk-AL5JHX7X.js → chunk-E73VSDYN.js} +1 -5
  15. package/dist/chunk-E73VSDYN.js.map +1 -0
  16. package/dist/{chunk-JZLNZOEL.js → chunk-F6YBS77T.js} +2 -2
  17. package/dist/{chunk-ICLIUEST.js → chunk-JDDJDMBV.js} +9 -9
  18. package/dist/{chunk-KSEPYAMJ.js → chunk-K3MYB4LO.js} +5 -5
  19. package/dist/{chunk-36ZACTF3.js → chunk-TEH6RKDC.js} +7 -15
  20. package/dist/{chunk-36ZACTF3.js.map → chunk-TEH6RKDC.js.map} +1 -1
  21. package/dist/{chunk-LXV5IEBB.js → chunk-WHQN35LA.js} +2 -2
  22. package/dist/{chunk-4XZOUS5G.js → chunk-Z7G5F7YF.js} +5 -5
  23. package/dist/{chunk-7HGZ3CKL.js → chunk-ZSMB75Z2.js} +1 -5
  24. package/dist/{chunk-7HGZ3CKL.js.map → chunk-ZSMB75Z2.js.map} +1 -1
  25. package/dist/cli/index.js +10 -4
  26. package/dist/cli/index.js.map +1 -1
  27. package/dist/client/index.js +3 -3
  28. package/dist/{db-OHFGYI5J.js → db-D3MFAH3Y.js} +43 -16
  29. package/dist/db-D3MFAH3Y.js.map +1 -0
  30. package/dist/{dev-emit-BR6ERY63.js → dev-emit-VCXNCJND.js} +2 -2
  31. package/dist/{index-BGIX-H9s.d.ts → index-BgEWXhWb.d.ts} +1 -4
  32. package/dist/index.js +18 -18
  33. package/dist/{internal-api-JFA4JI3Z.js → internal-api-CX5F6QD5.js} +30 -30
  34. package/dist/server/auth/index.d.ts +1 -7
  35. package/dist/server/auth/index.js +1 -3
  36. package/dist/server/cron/index.js +5 -5
  37. package/dist/server/http/index.d.ts +1 -1
  38. package/dist/server/http/index.js +10 -14
  39. package/dist/server/index.d.ts +5 -12
  40. package/dist/server/index.js +64 -80
  41. package/dist/server/index.js.map +1 -1
  42. package/dist/server/jobs/index.js +7 -7
  43. package/dist/server/observability/index.d.ts +1 -5
  44. package/dist/server/observability/index.js +1 -3
  45. package/dist/server/scan/index.d.ts +1 -3
  46. package/dist/server/scan/index.js +1 -3
  47. package/dist/server/storage/index.js +3 -3
  48. package/dist/{server-boundary-OJ6YIPQT.js → server-boundary-Q4PMJ2KR.js} +18 -18
  49. package/dist/testing/index.d.ts +31 -0
  50. package/dist/testing/index.js +205 -0
  51. package/dist/testing/index.js.map +1 -0
  52. package/dist/vite-plugin/index.js +18 -18
  53. package/package.json +7 -3
  54. package/dist/chunk-AL5JHX7X.js.map +0 -1
  55. package/dist/chunk-U3SPBLJF.js.map +0 -1
  56. package/dist/db-OHFGYI5J.js.map +0 -1
  57. /package/dist/{actions-virtual-module-CA4YEAL3.js.map → actions-virtual-module-SY4QNAUM.js.map} +0 -0
  58. /package/dist/{app-typed-client-ZCLFXBEC.js.map → app-typed-client-TJJFQ6H4.js.map} +0 -0
  59. /package/dist/{chunk-HWRZUQPE.js.map → chunk-4DYCGAMJ.js.map} +0 -0
  60. /package/dist/{chunk-2Z3GHQ64.js.map → chunk-5EZJNG6M.js.map} +0 -0
  61. /package/dist/{chunk-APUYC5BE.js.map → chunk-6QNGLLJX.js.map} +0 -0
  62. /package/dist/{chunk-QEVTZ3IH.js.map → chunk-B74FR53E.js.map} +0 -0
  63. /package/dist/{chunk-SHBPXX5E.js.map → chunk-CM25CTBJ.js.map} +0 -0
  64. /package/dist/{chunk-JZLNZOEL.js.map → chunk-F6YBS77T.js.map} +0 -0
  65. /package/dist/{chunk-ICLIUEST.js.map → chunk-JDDJDMBV.js.map} +0 -0
  66. /package/dist/{chunk-KSEPYAMJ.js.map → chunk-K3MYB4LO.js.map} +0 -0
  67. /package/dist/{chunk-LXV5IEBB.js.map → chunk-WHQN35LA.js.map} +0 -0
  68. /package/dist/{chunk-4XZOUS5G.js.map → chunk-Z7G5F7YF.js.map} +0 -0
  69. /package/dist/{dev-emit-BR6ERY63.js.map → dev-emit-VCXNCJND.js.map} +0 -0
  70. /package/dist/{internal-api-JFA4JI3Z.js.map → internal-api-CX5F6QD5.js.map} +0 -0
  71. /package/dist/{server-boundary-OJ6YIPQT.js.map → server-boundary-Q4PMJ2KR.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli/commands/db.ts"],"sourcesContent":["import { execFileSync } from 'node:child_process'\nimport { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs'\nimport { createRequire } from 'node:module'\nimport { dirname, join, resolve } from 'node:path'\n\nimport { loadConfig } from '../../config/load-config.js'\nimport { storageSchema } from '../../config/schema.js'\n\ntype DbAction = 'migrate' | 'push' | 'generate' | 'seed' | 'studio' | 'check' | 'reset'\n\nconst VALID_ACTIONS = new Set<DbAction>([\n 'migrate',\n 'push',\n 'generate',\n 'seed',\n 'studio',\n 'check',\n 'reset',\n])\n\nexport interface DbCommandOptions {\n force?: boolean\n host?: string\n port?: number\n}\n\ninterface DbCommandResult {\n status: 'success' | 'error' | 'invalid_action'\n message: string\n action?: DbAction\n}\n\ntype DbTool = 'drizzle-kit' | 'tsx'\n\n/**\n * Runs one of the project's own tools, without a shell: the tool name and its argv, so a path with a\n * space or a quote is never parsed. Injected so a test can see the command without running it.\n */\ntype RunCommand = (tool: DbTool, args: readonly string[], cwd: string) => void\n\n/**\n * The JS entry of a tool installed in the project, read from its package.json `bin`. Running it with\n * `process.execPath` needs neither a shell nor `npx`/`.cmd` shims, which Node refuses to spawn\n * without a shell on Windows (CVE-2024-27980).\n */\nexport function resolveToolBin(cwd: string, tool: DbTool): string {\n const req = createRequire(join(cwd, 'package.json'))\n let pkgPath: string\n try {\n pkgPath = req.resolve(`${tool}/package.json`)\n } catch {\n throw new Error(`${tool} not found. Run: npm install -D ${tool}`)\n }\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf8')) as { bin?: string | Record<string, string> }\n const rel = typeof pkg.bin === 'string' ? pkg.bin : pkg.bin?.[tool]\n if (rel === undefined) throw new Error(`${tool} has no \"${tool}\" bin in its package.json`)\n return resolve(dirname(pkgPath), rel)\n}\n\nconst runInherited: RunCommand = (tool, args, cwd) => {\n execFileSync(process.execPath, [resolveToolBin(cwd, tool), ...args], { cwd, stdio: 'inherit' })\n}\n\nfunction assertFileExists(cwd: string, relPath: string, hint: string): void {\n if (!existsSync(resolve(cwd, relPath))) {\n throw new Error(`${relPath} not found. ${hint}`)\n }\n}\n\nfunction assertBinExists(cwd: string, bin: string): void {\n const binPath = resolve(cwd, 'node_modules', '.bin', bin)\n if (!existsSync(binPath)) {\n throw new Error(`${bin} not found. Run: npm install -D ${bin}`)\n }\n}\n\n/**\n * Each verb runs the drizzle-kit command of the same name.\n *\n * `migrate` used to run `drizzle-kit push` (usetheokit/theokit#1021). Push diffs the schema straight\n * into the database: it never reads the files `generate` writes and keeps no\n * `drizzle.__drizzle_migrations` journal, so a deploy script calling `theokit db migrate` applied\n * an unreviewed diff with no record of it. `migrate` now applies the generated files, and the old\n * behaviour stays available, under its real name, as `push`.\n */\nconst DRIZZLE_KIT = 'drizzle-kit' as const\n\nconst DRIZZLE_KIT_VERBS = {\n migrate: { args: [DRIZZLE_KIT, 'migrate'], message: 'Migrations applied' },\n push: { args: [DRIZZLE_KIT, 'push'], message: 'Schema pushed to the database' },\n generate: { args: [DRIZZLE_KIT, 'generate'], message: 'Migration files generated' },\n studio: { args: [DRIZZLE_KIT, 'studio'], message: 'Studio stopped' },\n check: { args: [DRIZZLE_KIT, 'check'], message: 'Migrations are consistent' },\n} as const\n\nasync function runProjectScript(\n name: 'seed' | 'reset',\n cwd: string,\n run: RunCommand,\n hint: string,\n): Promise<void> {\n // The script lives under the configured `serverDir`; a hardcoded `server/` missed the\n // scaffold's `src/server` layout.\n const { serverDir, storage } = await loadConfig(cwd)\n const seedPath = join(serverDir, 'db', `${name}.ts`)\n assertFileExists(cwd, seedPath, `Create ${seedPath} ${hint}`)\n console.log(`\\n ▸ Running ${name}...\\n`)\n // #1439 — the seed is a bare child process, so `config.storage` never reached its storage manager\n // and any seed importing a `usePostgres('main', ...)` module threw \"Database not configured\".\n // A preload applies the parsed storage config through the project's own `theokit` instance.\n const preloadDir = resolve(cwd, 'node_modules', '.cache', 'theokit')\n const preload = join(preloadDir, 'seed-preload.mjs')\n const hasStorage = storage !== undefined\n if (hasStorage) {\n mkdirSync(preloadDir, { recursive: true })\n const parsed = JSON.stringify(storageSchema.parse(storage))\n writeFileSync(\n preload,\n `import { getStorageManager } from 'theokit/server/storage'\\ngetStorageManager().configure(${parsed})\\n`,\n )\n }\n try {\n run('tsx', hasStorage ? ['--import', preload, seedPath] : [seedPath], cwd)\n } finally {\n if (hasStorage) rmSync(preload, { force: true })\n }\n}\n\nexport async function dbCommand(\n action: string,\n cwd: string,\n run: RunCommand = runInherited,\n options: DbCommandOptions = {},\n): Promise<DbCommandResult> {\n if (!VALID_ACTIONS.has(action as DbAction)) {\n return {\n status: 'invalid_action',\n message: `Unknown db action \"${action}\". Available: ${[...VALID_ACTIONS].join(', ')}`,\n }\n }\n\n const dbAction = action as DbAction\n\n try {\n if (dbAction === 'seed') {\n await runProjectScript('seed', cwd, run, 'with your seed data.')\n return { status: 'success', message: 'Database seeded successfully', action: dbAction }\n }\n if (dbAction === 'reset') {\n if (options.force !== true) {\n throw new Error(\n 'db reset is destructive: it runs your db/reset.ts against the database. Re-run with --force to confirm.',\n )\n }\n await runProjectScript('reset', cwd, run, 'with the code that resets your database.')\n return { status: 'success', message: 'Database reset', action: dbAction }\n }\n const verb = DRIZZLE_KIT_VERBS[dbAction]\n assertFileExists(cwd, 'drizzle.config.ts', 'Create a drizzle.config.ts for your project.')\n assertBinExists(cwd, DRIZZLE_KIT)\n console.log(`\\n ▸ Running ${verb.args.join(' ')}...\\n`)\n const extra: string[] = []\n if (dbAction === 'studio') {\n if (options.host !== undefined) extra.push('--host', options.host)\n if (options.port !== undefined) extra.push('--port', String(options.port))\n }\n run(DRIZZLE_KIT, [...verb.args.slice(1), ...extra], cwd)\n return { status: 'success', message: verb.message, action: dbAction }\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err)\n return { status: 'error', message: msg, action: dbAction }\n }\n}\n\nexport async function dbCommandCli(action: string, options: DbCommandOptions = {}): Promise<void> {\n const result = await dbCommand(action, process.cwd(), undefined, options)\n if (result.status === 'success') {\n console.log(`\\n ✓ ${result.message}\\n`)\n } else {\n console.error(`\\n ✗ ${result.message}\\n`)\n process.exit(1)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA,SAAS,oBAAoB;AAC7B,SAAS,YAAY,WAAW,cAAc,QAAQ,qBAAqB;AAC3E,SAAS,qBAAqB;AAC9B,SAAS,SAAS,MAAM,eAAe;AAOvC,IAAM,gBAAgB,oBAAI,IAAc;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,E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YAAQ,MAAM;AAAA,WAAS,OAAO,OAAO;AAAA,CAAI;AACzC,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  generateManifest
3
- } from "./chunk-7HGZ3CKL.js";
3
+ } from "./chunk-ZSMB75Z2.js";
4
4
  import "./chunk-A6UFN6QQ.js";
5
5
  import "./chunk-DV34VG3N.js";
6
6
  import "./chunk-SOYOYGWY.js";
@@ -343,4 +343,4 @@ export {
343
343
  _resetInFlightForTests,
344
344
  reEmitOpenApi
345
345
  };
346
- //# sourceMappingURL=dev-emit-BR6ERY63.js.map
346
+ //# sourceMappingURL=dev-emit-VCXNCJND.js.map
@@ -554,7 +554,6 @@ interface MiddlewareResult {
554
554
  * path that is not there would turn that into a load error.
555
555
  */
556
556
  declare function resolveUserModule(dir: string, base: string): string | undefined;
557
- declare function _resetMiddlewareCacheForTests(): void;
558
557
  /**
559
558
  * Run a Web-shaped middleware — the one `middleware()` and `defineMiddleware()` produce (#345).
560
559
  *
@@ -581,8 +580,6 @@ declare function _resetMiddlewareCacheForTests(): void;
581
580
  declare class MiddlewareNextUnavailableError extends Error {
582
581
  constructor();
583
582
  }
584
- /** Test seam: the latch is per-process, and a suite needs to assert the FIRST warning repeatedly. */
585
- declare function _resetUninvocableWarningsForTests(): void;
586
583
  declare function runMiddlewareAndContext(req: IncomingMessage, res: ServerResponse, loadModule: LoadModule, serverDir: string): Promise<MiddlewareResult>;
587
584
  /**
588
585
  * Run ONLY the application's `server/context.ts` factory and return what it produced.
@@ -991,4 +988,4 @@ interface OpenApiDocsOptions {
991
988
  */
992
989
  declare function createOpenApiHandler(opts?: OpenApiDocsOptions): (request: Request) => Response | null;
993
990
 
994
- export { executeWebRequest as $, _resetUninvocableWarningsForTests as A, BATCH_PATH as B, type CookieOptions as C, appendCookieToHeaders as D, type ExecuteActionOptions as E, FileTooLargeError as F, appendDeleteCookieToHeaders as G, type HandleBatchOptions as H, callProcedure as I, createCorsHandler as J, createCorsWebHandler as K, createOpenApiHandler as L, MAX_ERROR_HTML_BYTES as M, NotFoundError as N, type OpenApiDocsOptions as O, type ParsedBody as P, createServerContext as Q, type RawRouteInput as R, STRIPPED_HEADERS as S, TRACE_HEADER as T, type UploadedFile as U, deleteCookie as V, type W3CTraceContext as W, envelopeCodeToStatus as X, executeAction as Y, executeRoute as Z, _resetMiddlewareCacheForTests as _, type BatchExecuteFn as a, extractTraceId as a0, extractTraceIdFromRequest as a1, extractW3CTraceContext as a2, fromUnknown as a3, getCookie as a4, getCookieFromRequest as a5, handleBatchRequest as a6, handleRequestError as a7, handleWebRequestError as a8, injectModulePreloads as a9, jsonTransformer as aa, loadCustomErrorPages as ab, matchesOrigin as ac, parseCookieHeader as ad, parseRequestBody as ae, parseTraceparent as af, parseTraceparentContext as ag, resolveTransformer as ah, resolveUserModule as ai, runMiddlewareAndContext as aj, sendError as ak, sendJson as al, serializeCookie as am, serveStaticFile as an, serverErrorToEnvelope as ao, setCookie as ap, superjsonTransformer as aq, validateRouteInput as ar, BatchPathConflictError as b, type BatchPayload as c, type BatchRequestItem as d, type BatchResponse as e, type BatchResultItem as f, type BodyParserOptions as g, type CorsConfig as h, type CorsHandler as i, type CorsOrigin as j, type CorsWebHandler as k, type CustomErrorPages as l, type ExecuteRouteContext as m, MiddlewareNextUnavailableError as n, type MiddlewareResult as o, type ProcedureInput as p, ProcedureInputError as q, ProcedureOutputError as r, type RouteInputChannel as s, type RouteInputSchemas as t, type RouteInputValidation as u, type SendErrorInput as v, type SendErrorOptions as w, TRACE_PARENT_HEADER as x, TheoError as y, type TheoTransformer as z };
991
+ export { extractTraceIdFromRequest as $, appendCookieToHeaders as A, BATCH_PATH as B, type CookieOptions as C, appendDeleteCookieToHeaders as D, type ExecuteActionOptions as E, FileTooLargeError as F, callProcedure as G, type HandleBatchOptions as H, createCorsHandler as I, createCorsWebHandler as J, createOpenApiHandler as K, createServerContext as L, MAX_ERROR_HTML_BYTES as M, NotFoundError as N, type OpenApiDocsOptions as O, type ParsedBody as P, deleteCookie as Q, type RawRouteInput as R, STRIPPED_HEADERS as S, TRACE_HEADER as T, type UploadedFile as U, envelopeCodeToStatus as V, type W3CTraceContext as W, executeAction as X, executeRoute as Y, executeWebRequest as Z, extractTraceId as _, type BatchExecuteFn as a, extractW3CTraceContext as a0, fromUnknown as a1, getCookie as a2, getCookieFromRequest as a3, handleBatchRequest as a4, handleRequestError as a5, handleWebRequestError as a6, injectModulePreloads as a7, jsonTransformer as a8, loadCustomErrorPages as a9, matchesOrigin as aa, parseCookieHeader as ab, parseRequestBody as ac, parseTraceparent as ad, parseTraceparentContext as ae, resolveTransformer as af, resolveUserModule as ag, runMiddlewareAndContext as ah, sendError as ai, sendJson as aj, serializeCookie as ak, serveStaticFile as al, serverErrorToEnvelope as am, setCookie as an, superjsonTransformer as ao, validateRouteInput as ap, BatchPathConflictError as b, type BatchPayload as c, type BatchRequestItem as d, type BatchResponse as e, type BatchResultItem as f, type BodyParserOptions as g, type CorsConfig as h, type CorsHandler as i, type CorsOrigin as j, type CorsWebHandler as k, type CustomErrorPages as l, type ExecuteRouteContext as m, MiddlewareNextUnavailableError as n, type MiddlewareResult as o, type ProcedureInput as p, ProcedureInputError as q, ProcedureOutputError as r, type RouteInputChannel as s, type RouteInputSchemas as t, type RouteInputValidation as u, type SendErrorInput as v, type SendErrorOptions as w, TRACE_PARENT_HEADER as x, TheoError as y, type TheoTransformer as z };
package/dist/index.js CHANGED
@@ -8,34 +8,40 @@ import {
8
8
  scanRoutes,
9
9
  theoConfigSchema,
10
10
  theoPlugin
11
- } from "./chunk-QEVTZ3IH.js";
11
+ } from "./chunk-B74FR53E.js";
12
12
  import "./chunk-7NRFZBAL.js";
13
13
  import "./chunk-SSYDEKWF.js";
14
- import "./chunk-SHBPXX5E.js";
15
- import "./chunk-APUYC5BE.js";
16
- import "./chunk-4XZOUS5G.js";
14
+ import "./chunk-CM25CTBJ.js";
15
+ import "./chunk-6QNGLLJX.js";
16
+ import "./chunk-Z7G5F7YF.js";
17
17
  import "./chunk-OIGJOYX6.js";
18
- import "./chunk-U3SPBLJF.js";
18
+ import "./chunk-DIPCJ5VE.js";
19
+ import "./chunk-4Z5XO4O4.js";
20
+ import "./chunk-ZSMB75Z2.js";
21
+ import "./chunk-A6UFN6QQ.js";
19
22
  import "./chunk-WSOAN4KN.js";
20
23
  import "./chunk-ENSFCKP6.js";
24
+ import "./chunk-DV34VG3N.js";
21
25
  import "./chunk-OGLS76RN.js";
22
- import "./chunk-HWRZUQPE.js";
23
- import "./chunk-36ZACTF3.js";
26
+ import "./chunk-4DYCGAMJ.js";
27
+ import "./chunk-TEH6RKDC.js";
28
+ import "./chunk-V6Y2SMRG.js";
24
29
  import "./chunk-P6OS7652.js";
25
30
  import "./chunk-ZDUO4IYN.js";
26
31
  import "./chunk-IDWN2OSG.js";
32
+ import "./chunk-AHYOVVJ7.js";
33
+ import "./chunk-SOYOYGWY.js";
27
34
  import "./chunk-YH5CDWLU.js";
35
+ import "./chunk-ZWN3AODA.js";
28
36
  import "./chunk-NTDN54XO.js";
29
37
  import "./chunk-JO462JZM.js";
30
38
  import "./chunk-IXXZBZF7.js";
31
39
  import "./chunk-AVQU5CQF.js";
40
+ import "./chunk-UMNXCU3K.js";
41
+ import "./chunk-AP2E5WHS.js";
42
+ import "./chunk-CHTAWXC2.js";
32
43
  import "./chunk-VSLTKX5L.js";
33
44
  import "./chunk-SFGGRC35.js";
34
- import "./chunk-4Z5XO4O4.js";
35
- import "./chunk-7HGZ3CKL.js";
36
- import "./chunk-A6UFN6QQ.js";
37
- import "./chunk-DV34VG3N.js";
38
- import "./chunk-V6Y2SMRG.js";
39
45
  import "./chunk-ACKBVBUI.js";
40
46
  import "./chunk-IZ3TIL6K.js";
41
47
  import "./chunk-TRCJHFAX.js";
@@ -44,12 +50,6 @@ import "./chunk-54BIQFP4.js";
44
50
  import "./chunk-ZICY2CD7.js";
45
51
  import "./chunk-YSJOZEI6.js";
46
52
  import "./chunk-Z4PJMZLM.js";
47
- import "./chunk-UMNXCU3K.js";
48
- import "./chunk-TQTEKNOL.js";
49
- import "./chunk-CHTAWXC2.js";
50
- import "./chunk-AHYOVVJ7.js";
51
- import "./chunk-SOYOYGWY.js";
52
- import "./chunk-ZWN3AODA.js";
53
53
  import "./chunk-XTHN6JBX.js";
54
54
 
55
55
  // src/config/define-config.ts
@@ -1,9 +1,24 @@
1
1
  import {
2
2
  dispatchControllerRequest
3
- } from "./chunk-SHBPXX5E.js";
3
+ } from "./chunk-CM25CTBJ.js";
4
4
  import {
5
5
  mountAgent
6
- } from "./chunk-4XZOUS5G.js";
6
+ } from "./chunk-Z7G5F7YF.js";
7
+ import {
8
+ createViteLoader
9
+ } from "./chunk-4Z5XO4O4.js";
10
+ import {
11
+ ACTION_SCHEMAS_DIR,
12
+ generateManifest,
13
+ matchRoute,
14
+ scanServerActions,
15
+ scanServerActionsEnriched,
16
+ scanServerRoutes,
17
+ scanWebSocketRoutes
18
+ } from "./chunk-ZSMB75Z2.js";
19
+ import {
20
+ scanAgents
21
+ } from "./chunk-A6UFN6QQ.js";
7
22
  import {
8
23
  CSP_REPORT_PATH,
9
24
  CsrfReadinessStore,
@@ -12,21 +27,26 @@ import {
12
27
  handleCsrfReadiness
13
28
  } from "./chunk-WSOAN4KN.js";
14
29
  import "./chunk-ENSFCKP6.js";
30
+ import "./chunk-DV34VG3N.js";
15
31
  import {
16
32
  BATCH_PATH,
17
33
  createCorsHandler,
18
34
  executeAction,
19
35
  executeRoute,
20
36
  handleBatchRequest
21
- } from "./chunk-HWRZUQPE.js";
37
+ } from "./chunk-4DYCGAMJ.js";
22
38
  import {
23
39
  incomingMessageToHandlerRequest,
24
40
  sendError
25
- } from "./chunk-36ZACTF3.js";
41
+ } from "./chunk-TEH6RKDC.js";
42
+ import "./chunk-V6Y2SMRG.js";
26
43
  import "./chunk-P6OS7652.js";
27
44
  import "./chunk-ZDUO4IYN.js";
28
45
  import "./chunk-IDWN2OSG.js";
46
+ import "./chunk-AHYOVVJ7.js";
47
+ import "./chunk-SOYOYGWY.js";
29
48
  import "./chunk-YH5CDWLU.js";
49
+ import "./chunk-ZWN3AODA.js";
30
50
  import {
31
51
  findSuggestion
32
52
  } from "./chunk-NTDN54XO.js";
@@ -36,29 +56,17 @@ import {
36
56
  extractTraceId
37
57
  } from "./chunk-IXXZBZF7.js";
38
58
  import "./chunk-AVQU5CQF.js";
59
+ import "./chunk-UMNXCU3K.js";
60
+ import {
61
+ logRequest
62
+ } from "./chunk-AP2E5WHS.js";
63
+ import "./chunk-CHTAWXC2.js";
39
64
  import {
40
65
  createPluginRunnerFromConfig
41
66
  } from "./chunk-VSLTKX5L.js";
42
67
  import {
43
68
  createRateLimiter
44
69
  } from "./chunk-SFGGRC35.js";
45
- import {
46
- createViteLoader
47
- } from "./chunk-4Z5XO4O4.js";
48
- import {
49
- ACTION_SCHEMAS_DIR,
50
- generateManifest,
51
- matchRoute,
52
- scanServerActions,
53
- scanServerActionsEnriched,
54
- scanServerRoutes,
55
- scanWebSocketRoutes
56
- } from "./chunk-7HGZ3CKL.js";
57
- import {
58
- scanAgents
59
- } from "./chunk-A6UFN6QQ.js";
60
- import "./chunk-DV34VG3N.js";
61
- import "./chunk-V6Y2SMRG.js";
62
70
  import "./chunk-ACKBVBUI.js";
63
71
  import "./chunk-IZ3TIL6K.js";
64
72
  import {
@@ -69,14 +77,6 @@ import "./chunk-YSJOZEI6.js";
69
77
  import {
70
78
  generateNonce
71
79
  } from "./chunk-Z4PJMZLM.js";
72
- import "./chunk-UMNXCU3K.js";
73
- import {
74
- logRequest
75
- } from "./chunk-TQTEKNOL.js";
76
- import "./chunk-CHTAWXC2.js";
77
- import "./chunk-AHYOVVJ7.js";
78
- import "./chunk-SOYOYGWY.js";
79
- import "./chunk-ZWN3AODA.js";
80
80
  import "./chunk-XTHN6JBX.js";
81
81
  export {
82
82
  ACTION_SCHEMAS_DIR,
@@ -111,4 +111,4 @@ export {
111
111
  scanWebSocketRoutes,
112
112
  sendError
113
113
  };
114
- //# sourceMappingURL=internal-api-JFA4JI3Z.js.map
114
+ //# sourceMappingURL=internal-api-CX5F6QD5.js.map
@@ -310,12 +310,6 @@ declare function Authenticated<TSession>(sessions: SessionReader<TSession>): new
310
310
 
311
311
  declare function encrypt<T>(data: T, secret: string): Promise<string>;
312
312
  declare function decrypt<T>(token: string, secret: string): Promise<T | null>;
313
- /**
314
- * Reset the derived-key cache. Test helper — never call from production code.
315
- * Used by Vitest to guarantee isolation between tests that use distinct
316
- * secrets and want to confirm the derivation path runs.
317
- */
318
- declare function _resetKeyCacheForTests(): void;
319
313
 
320
314
  /**
321
315
  * T6.2 — RFC 6238 TOTP primitive.
@@ -590,4 +584,4 @@ declare function clearOidcCache(): void;
590
584
  */
591
585
  declare function discoverOidcProvider(issuer: string | URL): Promise<OidcMetadata>;
592
586
 
593
- export { AuthRequiredError, Authenticated, type BackupCode, type BackupCodeOptions, MIN_SECRET_LENGTH, type OidcMetadata, type PkceChallenge, type PreviewMarker, type PreviewMarkerConfig, type SecretWeakness, type SecretWeaknessCode, type SessionConfig, type SessionManager, type SessionManagerWeb, type SessionMeta, type SessionReader, type ThrottleOptions, type ThrottleState, type TotpAlgorithm, type TotpOptions, type TotpUriOptions, type VerifyTotpOptions, _resetKeyCacheForTests, assertProductionSecret, checkThrottle, clearOidcCache, createPreviewMarker, createSessionManager, createSessionManagerWeb, decrypt, discoverOidcProvider, encrypt, generateBackupCodes, generateOAuthState, generatePkceChallenge, generateTotp, generateTotpSecret, inspectSecret, pkceChallengeFromVerifier, recordAttempt, requireAuth, rotateIfNeeded, rotateIfNeededWeb, totpUri, verifyBackupCode, verifyOAuthState, verifyTotp };
587
+ export { AuthRequiredError, Authenticated, type BackupCode, type BackupCodeOptions, MIN_SECRET_LENGTH, type OidcMetadata, type PkceChallenge, type PreviewMarker, type PreviewMarkerConfig, type SecretWeakness, type SecretWeaknessCode, type SessionConfig, type SessionManager, type SessionManagerWeb, type SessionMeta, type SessionReader, type ThrottleOptions, type ThrottleState, type TotpAlgorithm, type TotpOptions, type TotpUriOptions, type VerifyTotpOptions, assertProductionSecret, checkThrottle, clearOidcCache, createPreviewMarker, createSessionManager, createSessionManagerWeb, decrypt, discoverOidcProvider, encrypt, generateBackupCodes, generateOAuthState, generatePkceChallenge, generateTotp, generateTotpSecret, inspectSecret, pkceChallengeFromVerifier, recordAttempt, requireAuth, rotateIfNeeded, rotateIfNeededWeb, totpUri, verifyBackupCode, verifyOAuthState, verifyTotp };
@@ -2,7 +2,6 @@ import {
2
2
  AuthRequiredError,
3
3
  Authenticated,
4
4
  MIN_SECRET_LENGTH,
5
- _resetKeyCacheForTests,
6
5
  assertProductionSecret,
7
6
  checkThrottle,
8
7
  clearOidcCache,
@@ -27,7 +26,7 @@ import {
27
26
  verifyBackupCode,
28
27
  verifyOAuthState,
29
28
  verifyTotp
30
- } from "../../chunk-AL5JHX7X.js";
29
+ } from "../../chunk-E73VSDYN.js";
31
30
  import "../../chunk-4FWBKX6G.js";
32
31
  import "../../chunk-YSJOZEI6.js";
33
32
  import {
@@ -38,7 +37,6 @@ export {
38
37
  AuthRequiredError,
39
38
  Authenticated,
40
39
  MIN_SECRET_LENGTH,
41
- _resetKeyCacheForTests,
42
40
  assertProductionSecret,
43
41
  checkThrottle,
44
42
  clearOidcCache,
@@ -14,17 +14,17 @@ import {
14
14
  translateCronToVercel,
15
15
  validateCronSchedule,
16
16
  writeCronManifest
17
- } from "../../chunk-2Z3GHQ64.js";
17
+ } from "../../chunk-5EZJNG6M.js";
18
18
  import {
19
19
  createPostgresCronLock
20
- } from "../../chunk-LXV5IEBB.js";
20
+ } from "../../chunk-WHQN35LA.js";
21
21
  import "../../chunk-ZN5H7CUR.js";
22
- import "../../chunk-UMNXCU3K.js";
23
- import "../../chunk-TQTEKNOL.js";
24
- import "../../chunk-CHTAWXC2.js";
25
22
  import "../../chunk-AHYOVVJ7.js";
26
23
  import "../../chunk-SOYOYGWY.js";
27
24
  import "../../chunk-ZWN3AODA.js";
25
+ import "../../chunk-UMNXCU3K.js";
26
+ import "../../chunk-AP2E5WHS.js";
27
+ import "../../chunk-CHTAWXC2.js";
28
28
  import "../../chunk-XTHN6JBX.js";
29
29
  export {
30
30
  CRON_MANIFEST_SCHEMA_VERSION,
@@ -1,4 +1,4 @@
1
- export { B as BATCH_PATH, a as BatchExecuteFn, b as BatchPathConflictError, c as BatchPayload, d as BatchRequestItem, e as BatchResponse, f as BatchResultItem, C as CookieOptions, h as CorsConfig, i as CorsHandler, j as CorsOrigin, k as CorsWebHandler, l as CustomErrorPages, E as ExecuteActionOptions, m as ExecuteRouteContext, F as FileTooLargeError, H as HandleBatchOptions, M as MAX_ERROR_HTML_BYTES, n as MiddlewareNextUnavailableError, o as MiddlewareResult, N as NotFoundError, q as ProcedureInputError, r as ProcedureOutputError, S as STRIPPED_HEADERS, v as SendErrorInput, w as SendErrorOptions, T as TRACE_HEADER, x as TRACE_PARENT_HEADER, y as TheoError, W as W3CTraceContext, _ as _resetMiddlewareCacheForTests, A as _resetUninvocableWarningsForTests, D as appendCookieToHeaders, G as appendDeleteCookieToHeaders, I as callProcedure, J as createCorsHandler, K as createCorsWebHandler, L as createOpenApiHandler, Q as createServerContext, V as deleteCookie, X as envelopeCodeToStatus, Y as executeAction, Z as executeRoute, $ as executeWebRequest, a0 as extractTraceId, a1 as extractTraceIdFromRequest, a2 as extractW3CTraceContext, a3 as fromUnknown, a4 as getCookie, a5 as getCookieFromRequest, a6 as handleBatchRequest, a7 as handleRequestError, a8 as handleWebRequestError, a9 as injectModulePreloads, aa as jsonTransformer, ab as loadCustomErrorPages, ac as matchesOrigin, ad as parseCookieHeader, ae as parseRequestBody, af as parseTraceparent, ag as parseTraceparentContext, ah as resolveTransformer, ai as resolveUserModule, aj as runMiddlewareAndContext, ak as sendError, al as sendJson, am as serializeCookie, an as serveStaticFile, ao as serverErrorToEnvelope, ap as setCookie, aq as superjsonTransformer, ar as validateRouteInput } from '../../index-BGIX-H9s.js';
1
+ export { B as BATCH_PATH, a as BatchExecuteFn, b as BatchPathConflictError, c as BatchPayload, d as BatchRequestItem, e as BatchResponse, f as BatchResultItem, C as CookieOptions, h as CorsConfig, i as CorsHandler, j as CorsOrigin, k as CorsWebHandler, l as CustomErrorPages, E as ExecuteActionOptions, m as ExecuteRouteContext, F as FileTooLargeError, H as HandleBatchOptions, M as MAX_ERROR_HTML_BYTES, n as MiddlewareNextUnavailableError, o as MiddlewareResult, N as NotFoundError, q as ProcedureInputError, r as ProcedureOutputError, S as STRIPPED_HEADERS, v as SendErrorInput, w as SendErrorOptions, T as TRACE_HEADER, x as TRACE_PARENT_HEADER, y as TheoError, W as W3CTraceContext, A as appendCookieToHeaders, D as appendDeleteCookieToHeaders, G as callProcedure, I as createCorsHandler, J as createCorsWebHandler, K as createOpenApiHandler, L as createServerContext, Q as deleteCookie, V as envelopeCodeToStatus, X as executeAction, Y as executeRoute, Z as executeWebRequest, _ as extractTraceId, $ as extractTraceIdFromRequest, a0 as extractW3CTraceContext, a1 as fromUnknown, a2 as getCookie, a3 as getCookieFromRequest, a4 as handleBatchRequest, a5 as handleRequestError, a6 as handleWebRequestError, a7 as injectModulePreloads, a8 as jsonTransformer, a9 as loadCustomErrorPages, aa as matchesOrigin, ab as parseCookieHeader, ac as parseRequestBody, ad as parseTraceparent, ae as parseTraceparentContext, af as resolveTransformer, ag as resolveUserModule, ah as runMiddlewareAndContext, ai as sendError, aj as sendJson, ak as serializeCookie, al as serveStaticFile, am as serverErrorToEnvelope, an as setCookie, ao as superjsonTransformer, ap as validateRouteInput } from '../../index-BgEWXhWb.js';
2
2
  export { f as defineReadyRoute, s as serveReservedRoute } from '../../health-route-CYI7z5g3.js';
3
3
  export { A as ActionError, b as ActionInputError, f as extractUniversalIssues, i as isActionError, d as isInputError } from '../../action-protocol-tGm3NKRg.js';
4
4
  import '../../error-envelope-DG47lt8E.js';
@@ -7,7 +7,7 @@ import {
7
7
  injectModulePreloads,
8
8
  loadCustomErrorPages,
9
9
  serveStaticFile
10
- } from "../../chunk-JZLNZOEL.js";
10
+ } from "../../chunk-F6YBS77T.js";
11
11
  import "../../chunk-O2KGDLA7.js";
12
12
  import {
13
13
  jsonTransformer,
@@ -26,11 +26,9 @@ import {
26
26
  handleRequestError,
27
27
  handleWebRequestError,
28
28
  matchesOrigin
29
- } from "../../chunk-HWRZUQPE.js";
29
+ } from "../../chunk-4DYCGAMJ.js";
30
30
  import {
31
31
  MiddlewareNextUnavailableError,
32
- _resetMiddlewareCacheForTests,
33
- _resetUninvocableWarningsForTests,
34
32
  createServerContext,
35
33
  executeWebRequest,
36
34
  resolveUserModule,
@@ -38,7 +36,8 @@ import {
38
36
  sendError,
39
37
  sendJson,
40
38
  validateRouteInput
41
- } from "../../chunk-36ZACTF3.js";
39
+ } from "../../chunk-TEH6RKDC.js";
40
+ import "../../chunk-V6Y2SMRG.js";
42
41
  import "../../chunk-P6OS7652.js";
43
42
  import {
44
43
  ActionError,
@@ -49,6 +48,7 @@ import {
49
48
  } from "../../chunk-ZDUO4IYN.js";
50
49
  import "../../chunk-IDWN2OSG.js";
51
50
  import "../../chunk-YH5CDWLU.js";
51
+ import "../../chunk-ZWN3AODA.js";
52
52
  import {
53
53
  TRACE_HEADER,
54
54
  TRACE_PARENT_HEADER,
@@ -59,7 +59,11 @@ import {
59
59
  parseTraceparentContext
60
60
  } from "../../chunk-IXXZBZF7.js";
61
61
  import "../../chunk-AVQU5CQF.js";
62
- import "../../chunk-V6Y2SMRG.js";
62
+ import {
63
+ FileTooLargeError,
64
+ parseRequestBody
65
+ } from "../../chunk-AP2E5WHS.js";
66
+ import "../../chunk-CHTAWXC2.js";
63
67
  import {
64
68
  envelopeCodeToStatus
65
69
  } from "../../chunk-ACKBVBUI.js";
@@ -83,12 +87,6 @@ import {
83
87
  serializeCookie,
84
88
  setCookie
85
89
  } from "../../chunk-4FWBKX6G.js";
86
- import {
87
- FileTooLargeError,
88
- parseRequestBody
89
- } from "../../chunk-TQTEKNOL.js";
90
- import "../../chunk-CHTAWXC2.js";
91
- import "../../chunk-ZWN3AODA.js";
92
90
  import "../../chunk-XTHN6JBX.js";
93
91
  export {
94
92
  ActionError,
@@ -105,8 +103,6 @@ export {
105
103
  TRACE_HEADER,
106
104
  TRACE_PARENT_HEADER,
107
105
  TheoError,
108
- _resetMiddlewareCacheForTests,
109
- _resetUninvocableWarningsForTests,
110
106
  appendCookieToHeaders,
111
107
  appendDeleteCookieToHeaders,
112
108
  callProcedure,
@@ -6,16 +6,16 @@ export { C as CustomTool, D as DefineAgentToolSpec, T as ToolContextMessage, a a
6
6
  export { A as AccessDecision, R as RoutePolicy, b as RoutePolicyInput, a as RouteSubject, e as evaluateRoutePolicy, r as requireOwner, s as subjectFromContext } from '../route-policy-BHXQDzBF.js';
7
7
  export { b as HookName, H as HookResult, O as OnErrorHook, c as OnRequestHook, d as OnResponseHook, P as PluginContext, e as PluginErrorContext, f as PreHandlerHook, R as RunHookOptions, a as TheoApp, T as TheoPlugin } from '../plugin-types-BUVfUQ0V.js';
8
8
  export { H as HEALTH_PATH, a as HealthRouteConfig, b as READY_PATH, c as ReadyRouteConfig, d as ReservedResponse, R as ReservedRoutes, e as defineHealthRoute, f as defineReadyRoute, s as serveReservedRoute } from '../health-route-CYI7z5g3.js';
9
- export { B as BATCH_PATH, a as BatchExecuteFn, b as BatchPathConflictError, c as BatchPayload, d as BatchRequestItem, e as BatchResponse, f as BatchResultItem, g as BodyParserOptions, C as CookieOptions, h as CorsConfig, i as CorsHandler, j as CorsOrigin, k as CorsWebHandler, l as CustomErrorPages, E as ExecuteActionOptions, m as ExecuteRouteContext, F as FileTooLargeError, H as HandleBatchOptions, M as MAX_ERROR_HTML_BYTES, n as MiddlewareNextUnavailableError, o as MiddlewareResult, N as NotFoundError, O as OpenApiDocsOptions, P as ParsedBody, p as ProcedureInput, q as ProcedureInputError, r as ProcedureOutputError, R as RawRouteInput, s as RouteInputChannel, t as RouteInputSchemas, u as RouteInputValidation, S as STRIPPED_HEADERS, v as SendErrorInput, w as SendErrorOptions, T as TRACE_HEADER, x as TRACE_PARENT_HEADER, y as TheoError, z as TheoTransformer, U as UploadedFile, W as W3CTraceContext, _ as _resetMiddlewareCacheForTests, A as _resetUninvocableWarningsForTests, D as appendCookieToHeaders, G as appendDeleteCookieToHeaders, I as callProcedure, J as createCorsHandler, K as createCorsWebHandler, L as createOpenApiHandler, Q as createServerContext, V as deleteCookie, X as envelopeCodeToStatus, Y as executeAction, Z as executeRoute, $ as executeWebRequest, a0 as extractTraceId, a1 as extractTraceIdFromRequest, a2 as extractW3CTraceContext, a3 as fromUnknown, a4 as getCookie, a5 as getCookieFromRequest, a6 as handleBatchRequest, a7 as handleRequestError, a8 as handleWebRequestError, a9 as injectModulePreloads, aa as jsonTransformer, ab as loadCustomErrorPages, ac as matchesOrigin, ad as parseCookieHeader, ae as parseRequestBody, af as parseTraceparent, ag as parseTraceparentContext, ah as resolveTransformer, ai as resolveUserModule, aj as runMiddlewareAndContext, ak as sendError, al as sendJson, am as serializeCookie, an as serveStaticFile, ao as serverErrorToEnvelope, ap as setCookie, aq as superjsonTransformer, ar as validateRouteInput } from '../index-BGIX-H9s.js';
9
+ export { B as BATCH_PATH, a as BatchExecuteFn, b as BatchPathConflictError, c as BatchPayload, d as BatchRequestItem, e as BatchResponse, f as BatchResultItem, g as BodyParserOptions, C as CookieOptions, h as CorsConfig, i as CorsHandler, j as CorsOrigin, k as CorsWebHandler, l as CustomErrorPages, E as ExecuteActionOptions, m as ExecuteRouteContext, F as FileTooLargeError, H as HandleBatchOptions, M as MAX_ERROR_HTML_BYTES, n as MiddlewareNextUnavailableError, o as MiddlewareResult, N as NotFoundError, O as OpenApiDocsOptions, P as ParsedBody, p as ProcedureInput, q as ProcedureInputError, r as ProcedureOutputError, R as RawRouteInput, s as RouteInputChannel, t as RouteInputSchemas, u as RouteInputValidation, S as STRIPPED_HEADERS, v as SendErrorInput, w as SendErrorOptions, T as TRACE_HEADER, x as TRACE_PARENT_HEADER, y as TheoError, z as TheoTransformer, U as UploadedFile, W as W3CTraceContext, A as appendCookieToHeaders, D as appendDeleteCookieToHeaders, G as callProcedure, I as createCorsHandler, J as createCorsWebHandler, K as createOpenApiHandler, L as createServerContext, Q as deleteCookie, V as envelopeCodeToStatus, X as executeAction, Y as executeRoute, Z as executeWebRequest, _ as extractTraceId, $ as extractTraceIdFromRequest, a0 as extractW3CTraceContext, a1 as fromUnknown, a2 as getCookie, a3 as getCookieFromRequest, a4 as handleBatchRequest, a5 as handleRequestError, a6 as handleWebRequestError, a7 as injectModulePreloads, a8 as jsonTransformer, a9 as loadCustomErrorPages, aa as matchesOrigin, ab as parseCookieHeader, ac as parseRequestBody, ad as parseTraceparent, ae as parseTraceparentContext, af as resolveTransformer, ag as resolveUserModule, ah as runMiddlewareAndContext, ai as sendError, aj as sendJson, ak as serializeCookie, al as serveStaticFile, am as serverErrorToEnvelope, an as setCookie, ao as superjsonTransformer, ap as validateRouteInput } from '../index-BgEWXhWb.js';
10
10
  export { A as ActionError, a as ActionErrorCode, b as ActionInputError, e as ActionManifestEntry, c as ActionResult, S as SerializedActionResult, U as UniversalZodIssue, f as extractUniversalIssues, i as isActionError, d as isInputError } from '../action-protocol-tGm3NKRg.js';
11
- export { ACTION_SCHEMAS_DIR, ActionNode, ActionScanError, LoadedManifest, ManifestAction, ManifestAgent, ManifestRoute, ManifestWebSocket, TheoManifest, WebSocketRouteNode, _resetRouteScanCacheForTests, compareRouteSpecificity, generateManifest, loadManifest, scanMiddlewares, scanServerActions, scanServerActionsEnriched, scanServerRoutes, scanWebSocketRoutes, writeManifest } from './scan/index.js';
11
+ export { ACTION_SCHEMAS_DIR, ActionNode, ActionScanError, LoadedManifest, ManifestAction, ManifestAgent, ManifestRoute, ManifestWebSocket, TheoManifest, WebSocketRouteNode, compareRouteSpecificity, generateManifest, loadManifest, scanMiddlewares, scanServerActions, scanServerActionsEnriched, scanServerRoutes, scanWebSocketRoutes, writeManifest } from './scan/index.js';
12
12
  export { S as ServerRouteNode, c as compilePattern, m as matchRoute } from '../match-DaKsL73w.js';
13
13
  export { L as LoadModule, c as createProductionLoader, a as createViteLoader } from '../module-loader-DCip7NoL.js';
14
14
  export { AcpRequestTimeoutError, AcpToolConfig, AcpToolTransport, AcpTransportClosedError, AcpTurnStoppedError, AppResource, AppResourceInput, ChannelMessage, ChannelWebhookConfig, DEFAULT_ACP_TIMEOUT_MS, McpResourceContents, McpResourceDescriptor, NodeAcpTransport, StdioStreams, VendorAgentClient, VendorAgentToolConfig, WorkflowLike, WorkflowToolConfig, buildResourceDescriptors, createACPTool, createVendorAgentTool, createWorkflowTool, defineAppResource, extractAppResources, handleChannelWebhook, handleMcpStdioLine, handleMcpToolsJsonRpc, isChannelPath, parseChannelPath, readAppResource, serveMcpStdio, serveMcpToolsStdio } from './agent/index.js';
15
15
  export { CodeModeApi, CodeModeConfig, CodeModePermission, CodeModePermissionDeniedError, Sandbox, createCodeMode } from '@theokit/agents/code-mode';
16
16
  export { AgentModule, InProcessApprovalRequest, InProcessApprovalRequiredError, InProcessAwaitApproval, StreamAgentTurnDeps, StreamAgentTurnInProcessInput, streamAgentTurnInProcess } from '@theokit/agents';
17
17
  export { P as ProviderDescriptor, R as ResolvedProvider, l as listProviders, a as registerProvider, b as resetProviderRegistry, r as resolveProvider, t as tryResolveProvider } from '../provider-resolver-Cc9C3-Rb.js';
18
- export { AuthRequiredError, Authenticated, BackupCode, BackupCodeOptions, MIN_SECRET_LENGTH, OidcMetadata, PkceChallenge, PreviewMarker, PreviewMarkerConfig, SecretWeakness, SecretWeaknessCode, SessionConfig, SessionManager, SessionManagerWeb, SessionMeta, SessionReader, ThrottleOptions, ThrottleState, TotpAlgorithm, TotpOptions, TotpUriOptions, VerifyTotpOptions, _resetKeyCacheForTests, assertProductionSecret, checkThrottle, clearOidcCache, createPreviewMarker, createSessionManager, createSessionManagerWeb, decrypt, discoverOidcProvider, encrypt, generateBackupCodes, generateOAuthState, generatePkceChallenge, generateTotp, generateTotpSecret, inspectSecret, pkceChallengeFromVerifier, recordAttempt, requireAuth, rotateIfNeeded, rotateIfNeededWeb, totpUri, verifyBackupCode, verifyOAuthState, verifyTotp } from './auth/index.js';
18
+ export { AuthRequiredError, Authenticated, BackupCode, BackupCodeOptions, MIN_SECRET_LENGTH, OidcMetadata, PkceChallenge, PreviewMarker, PreviewMarkerConfig, SecretWeakness, SecretWeaknessCode, SessionConfig, SessionManager, SessionManagerWeb, SessionMeta, SessionReader, ThrottleOptions, ThrottleState, TotpAlgorithm, TotpOptions, TotpUriOptions, VerifyTotpOptions, assertProductionSecret, checkThrottle, clearOidcCache, createPreviewMarker, createSessionManager, createSessionManagerWeb, decrypt, discoverOidcProvider, encrypt, generateBackupCodes, generateOAuthState, generatePkceChallenge, generateTotp, generateTotpSecret, inspectSecret, pkceChallengeFromVerifier, recordAttempt, requireAuth, rotateIfNeeded, rotateIfNeededWeb, totpUri, verifyBackupCode, verifyOAuthState, verifyTotp } from './auth/index.js';
19
19
  export { g as generateNonce } from '../nonce-BXt7Qu_C.js';
20
20
  export { InMemoryUsageStorage, ToolHookEvent, TrackAgentRunInput, TrackAgentRunOptions, TrackAgentToolsHooks, TrackAgentToolsOptions, trackAgentRun, trackAgentTools } from './cost/index.js';
21
21
  export { T as ToolUsageRecord, b as UsageQuery, a as UsageRecord, c as UsageResult, U as UsageStorageAdapter } from '../cost-types-BALTuBpG.js';
@@ -24,7 +24,7 @@ export { CRON_MANIFEST_SCHEMA_VERSION, CronConcurrencyPolicy, CronContext, CronD
24
24
  export { C as CronLock, P as PostgresCronLockOptions, c as createPostgresCronLock } from '../cron-lock-CfAvLApv.js';
25
25
  export { DuplicateContextKeyError, DuplicateJobNameError, EnqueueOptions, InMemoryJobBackend, InMemoryJobBackendOptions, JOB_MANIFEST_SCHEMA_VERSION, JobContext, JobDefinition, JobManifest, JobManifestEntry, JobNode, JobOptions, JobRegistry, JobRunner, JobWorker, JobWorkerOptions, Outbox, OutboxFlushOptions, PostgresJobBackend, PostgresJobBackendOptions, QueueClient, TransactionalEnqueueUnsupportedError, buildJobManifest, createJobRunner, createJobWorker, createOutbox, createOutboxDispatcher, createQueueClient, defineJob, scanJobs, writeJobManifest } from './jobs/index.js';
26
26
  export { J as JobBackend, a as JobEnqueueInput, b as JobLease, c as JobLeaseExtensionUnsupportedError, d as JobLeaseFence, e as JobLeaseLostError, f as JobNackOptions, N as NonRetryableError } from '../job-backend-BRfDfojf.js';
27
- export { ConsoleObservabilityAdapter, LogLevel, LoggerFn, NoopObservabilityAdapter, NoopSpan, ObservabilityAdapter, RequestLog, SpanAttributes, SpanHandle, SpanImpl, StructuredLog, TheoCloudObservabilityAdapter, TheoLogger, _resetWarnOnceForTests, createLogger, createObservabilityPlugin, defineObservabilityAdapter, findSuggestion, levenshtein, logRequest, resolveAdapter, serializeSpansToOtlp, warnOnce } from './observability/index.js';
27
+ export { ConsoleObservabilityAdapter, LogLevel, LoggerFn, NoopObservabilityAdapter, NoopSpan, ObservabilityAdapter, RequestLog, SpanAttributes, SpanHandle, SpanImpl, StructuredLog, TheoCloudObservabilityAdapter, TheoLogger, createLogger, createObservabilityPlugin, defineObservabilityAdapter, findSuggestion, levenshtein, logRequest, resolveAdapter, serializeSpansToOtlp, warnOnce } from './observability/index.js';
28
28
  export { a as AuditEvent, A as AuditLogger, J as JsonStdoutSink, c as createNoOpLogger, s as safeAudit } from '../audit-log-BQWM5YLG.js';
29
29
  export { D as DuplicateDecorationError, a as DuplicatePluginError, P as PluginRunner } from '../plugin-runner-BVMOSxvb.js';
30
30
  export { InvalidPluginShapeError, createPluginRunnerFromConfig } from './plugins/index.js';
@@ -398,11 +398,6 @@ declare function initCacheEngine(config: NormalizedCacheConfig, hooks?: Pick<Cac
398
398
  * bootstrap missed calling initCacheEngine, or cache.enabled is false.
399
399
  */
400
400
  declare function getCacheEngine(): CacheEngine;
401
- /**
402
- * Test-only: clear the singleton so the next test can re-init.
403
- * Production code MUST NOT call this.
404
- */
405
- declare function _resetCacheEngine(): void;
406
401
 
407
402
  interface RouteRule {
408
403
  maxAge?: number;
@@ -628,8 +623,6 @@ interface LoadEnvResult {
628
623
  * `process.env.NODE_ENV`. Stashed in `__THEOKIT_USER_NODE_ENV` instead.
629
624
  */
630
625
 
631
- /** Test-only side-door for EC-2 — clear the module-level cache between vitest test files. */
632
- declare function _resetEnvCache(): void;
633
626
  declare function loadEnv(options?: LoadEnvOptions): LoadEnvResult;
634
627
 
635
- export { DEFAULT_MAX_AGE as CACHE_DEFAULT_MAX_AGE, DEFAULT_MAX_ENTRY_SIZE as CACHE_DEFAULT_MAX_ENTRY_SIZE, DEFAULT_SWR_MULTIPLIER as CACHE_DEFAULT_SWR_MULTIPLIER, CACHE_TAG_MAX_ITEMS, CACHE_TAG_MAX_LENGTH, CTX_WRITERS, type CacheControlInput, type CacheEngine, type CacheEngineOptions, type CacheEntry, type CacheStatus, type CacheStorageAdapter, type CacheStore, type CacheStoreAdmin, type ValidationResult as CacheValidationResult, type CachedFunction, type CachedRouteConfig, type CompiledRouteRule, type ContextValue, DEFAULT_EXCLUDED_QUERY_PARAMS, type DefineCachedFunctionOptions, type GetOrComputeOptions, InMemoryCacheAdapter, type InMemoryCacheAdapterOptions, type JobsAugmentedCtx, type KeyDerivationOptions, type LoadEnvOptions, type LoadEnvResult, type NormalizedCacheConfig, type QueueClientLike, type RevalidateResult, type RouteCacheOptions, RouteConfig, type RouteRule, type RouteRules, type SerializedResponse, THEO_T_PREFIX, _resetCacheEngine, _resetEnvCache, compileRouteRules, createCacheEngine, defineCachedFunction, defineCachedRoute, deriveKey as deriveCacheKey, deserializeResponse, getCacheControlHeader, getCacheEngine, initCacheEngine, loadEnv, resolveRouteRule, revalidatePath, revalidateTag, serializeResponse, updateTag, validateExpire as validateCacheExpire, validateMaxAge as validateCacheMaxAge, validateTags as validateCacheTags };
628
+ export { DEFAULT_MAX_AGE as CACHE_DEFAULT_MAX_AGE, DEFAULT_MAX_ENTRY_SIZE as CACHE_DEFAULT_MAX_ENTRY_SIZE, DEFAULT_SWR_MULTIPLIER as CACHE_DEFAULT_SWR_MULTIPLIER, CACHE_TAG_MAX_ITEMS, CACHE_TAG_MAX_LENGTH, CTX_WRITERS, type CacheControlInput, type CacheEngine, type CacheEngineOptions, type CacheEntry, type CacheStatus, type CacheStorageAdapter, type CacheStore, type CacheStoreAdmin, type ValidationResult as CacheValidationResult, type CachedFunction, type CachedRouteConfig, type CompiledRouteRule, type ContextValue, DEFAULT_EXCLUDED_QUERY_PARAMS, type DefineCachedFunctionOptions, type GetOrComputeOptions, InMemoryCacheAdapter, type InMemoryCacheAdapterOptions, type JobsAugmentedCtx, type KeyDerivationOptions, type LoadEnvOptions, type LoadEnvResult, type NormalizedCacheConfig, type QueueClientLike, type RevalidateResult, type RouteCacheOptions, RouteConfig, type RouteRule, type RouteRules, type SerializedResponse, THEO_T_PREFIX, compileRouteRules, createCacheEngine, defineCachedFunction, defineCachedRoute, deriveKey as deriveCacheKey, deserializeResponse, getCacheControlHeader, getCacheEngine, initCacheEngine, loadEnv, resolveRouteRule, revalidatePath, revalidateTag, serializeResponse, updateTag, validateExpire as validateCacheExpire, validateMaxAge as validateCacheMaxAge, validateTags as validateCacheTags };