@alexkroman1/aai 0.10.3 → 0.10.4

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 (73) hide show
  1. package/dist/_internal-types.d.ts +8 -1
  2. package/dist/_runtime-conformance.d.ts +64 -0
  3. package/dist/_test-utils.d.ts +70 -0
  4. package/dist/_utils.d.ts +1 -8
  5. package/dist/_utils.js +49 -2
  6. package/dist/builtin-tools.d.ts +1 -5
  7. package/dist/constants-BbAOvKl_.js +47 -0
  8. package/dist/constants.d.ts +44 -0
  9. package/dist/direct-executor-BfHrDdPL.js +1589 -0
  10. package/dist/direct-executor.d.ts +90 -31
  11. package/dist/hooks.d.ts +44 -0
  12. package/dist/hooks.js +58 -0
  13. package/dist/index.d.ts +1 -2
  14. package/dist/index.js +2 -2
  15. package/dist/internal.d.ts +19 -0
  16. package/dist/internal.js +209 -0
  17. package/dist/kv.d.ts +1 -1
  18. package/dist/kv.js +32 -1
  19. package/dist/matchers.js +1 -1
  20. package/dist/protocol.d.ts +3 -29
  21. package/dist/protocol.js +140 -2
  22. package/dist/server.d.ts +27 -40
  23. package/dist/server.js +117 -145
  24. package/dist/session.d.ts +65 -44
  25. package/dist/{testing-BbitshLb.js → testing-BonJtfHJ.js} +25 -43
  26. package/dist/testing.d.ts +9 -14
  27. package/dist/testing.js +2 -2
  28. package/dist/types.d.ts +24 -226
  29. package/dist/types.js +176 -2
  30. package/dist/types.test-d.d.ts +7 -0
  31. package/dist/vite-plugin.d.ts +15 -0
  32. package/dist/vite-plugin.js +82 -0
  33. package/dist/ws-handler.d.ts +1 -2
  34. package/package.json +28 -88
  35. package/dist/_embeddings.d.ts +0 -31
  36. package/dist/_internal-types-IfPcaJd5.js +0 -61
  37. package/dist/_internal-types.js +0 -2
  38. package/dist/_session-ctx.d.ts +0 -73
  39. package/dist/_session-otel.d.ts +0 -43
  40. package/dist/_session-persist.d.ts +0 -30
  41. package/dist/_ssrf-DCp_27V4.js +0 -123
  42. package/dist/_ssrf.d.ts +0 -30
  43. package/dist/_ssrf.js +0 -2
  44. package/dist/_utils-DgzpOMSV.js +0 -61
  45. package/dist/direct-executor-B-5mq3cu.js +0 -570
  46. package/dist/kv-iXtikQmR.js +0 -32
  47. package/dist/middleware-core-BwyBIPed.js +0 -107
  48. package/dist/middleware-core.d.ts +0 -47
  49. package/dist/middleware-core.js +0 -2
  50. package/dist/middleware.d.ts +0 -37
  51. package/dist/protocol-B-H2Q4ox.js +0 -162
  52. package/dist/runtime-CxcwaK68.js +0 -58
  53. package/dist/runtime.js +0 -2
  54. package/dist/s2s-M7JqtgFw.js +0 -272
  55. package/dist/s2s.js +0 -2
  56. package/dist/session-BYlwcrya.js +0 -683
  57. package/dist/session.js +0 -2
  58. package/dist/telemetry-CJlaDFNc.js +0 -95
  59. package/dist/telemetry.d.ts +0 -49
  60. package/dist/telemetry.js +0 -2
  61. package/dist/types-D8ZBxTL_.js +0 -192
  62. package/dist/unstorage-kv-CDgP-frt.js +0 -64
  63. package/dist/unstorage-kv.js +0 -2
  64. package/dist/unstorage-vector-Cj5llNhg.js +0 -172
  65. package/dist/unstorage-vector.d.ts +0 -47
  66. package/dist/unstorage-vector.js +0 -2
  67. package/dist/vector.d.ts +0 -86
  68. package/dist/vector.js +0 -49
  69. package/dist/worker-entry-2jaiqIj0.js +0 -70
  70. package/dist/worker-entry.d.ts +0 -47
  71. package/dist/worker-entry.js +0 -2
  72. package/dist/ws-handler-C0Q6eSay.js +0 -207
  73. package/dist/ws-handler.js +0 -2
@@ -5,7 +5,15 @@
5
5
  */
6
6
  import type { JSONSchema7 } from "json-schema";
7
7
  import { z } from "zod";
8
+ import type { Message } from "./types.ts";
8
9
  import { type ToolDef } from "./types.ts";
10
+ /**
11
+ * Function signature for executing a tool by name.
12
+ *
13
+ * Used by session.ts to invoke tools, by direct-executor.ts and
14
+ * _harness-runtime.ts to implement the execution.
15
+ */
16
+ export type ExecuteTool = (name: string, args: Readonly<Record<string, unknown>>, sessionId?: string, messages?: readonly Message[]) => Promise<string>;
9
17
  /**
10
18
  * Zod schema for serializable agent configuration sent over the wire.
11
19
  *
@@ -31,7 +39,6 @@ export declare const AgentConfigSchema: z.ZodObject<{
31
39
  visit_webpage: "visit_webpage";
32
40
  fetch_json: "fetch_json";
33
41
  run_code: "run_code";
34
- vector_search: "vector_search";
35
42
  memory: "memory";
36
43
  }>>>>;
37
44
  idleTimeoutMs: z.ZodOptional<z.ZodNumber>;
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Shared runtime conformance tests.
3
+ *
4
+ * Both the self-hosted direct executor and the platform sandbox must satisfy
5
+ * the same behavioral contract. This module defines that contract as a
6
+ * reusable test suite that can be wired to either runtime.
7
+ *
8
+ * Inspired by Nitro's `testNitro()` pattern: one test fixture, many runtimes.
9
+ *
10
+ * @example Direct executor (unit test)
11
+ * ```ts
12
+ * import { testRuntime } from "./_runtime-conformance.ts";
13
+ *
14
+ * testRuntime("direct", () => {
15
+ * const exec = createRuntime({ agent: CONFORMANCE_AGENT, env: { MY_VAR: "test-value" } });
16
+ * return { executeTool: exec.executeTool, hooks: exec.hooks };
17
+ * });
18
+ * ```
19
+ *
20
+ * @example Sandbox (integration test)
21
+ * ```ts
22
+ * import { testRuntime, CONFORMANCE_AGENT_BUNDLE } from "@alexkroman1/aai/runtime-conformance";
23
+ *
24
+ * testRuntime("sandbox", async () => {
25
+ * // ... start isolate with CONFORMANCE_AGENT_BUNDLE
26
+ * return { executeTool: buildExecuteTool(...), hooks: buildHookInvoker(...) };
27
+ * });
28
+ * ```
29
+ */
30
+ import type { ExecuteTool } from "./_internal-types.ts";
31
+ import type { AgentHooks } from "./hooks.ts";
32
+ import { type AgentDef } from "./types.ts";
33
+ /**
34
+ * Minimal runtime surface needed for conformance tests.
35
+ *
36
+ * Both `Runtime` and `buildExecuteTool`/`buildHookInvoker` from the
37
+ * sandbox produce objects that satisfy this interface.
38
+ */
39
+ export type RuntimeTestContext = {
40
+ executeTool: ExecuteTool;
41
+ hooks: AgentHooks;
42
+ };
43
+ /**
44
+ * Agent definition used by the conformance suite (direct executor path).
45
+ *
46
+ * Must be kept in sync with {@link CONFORMANCE_AGENT_BUNDLE}.
47
+ */
48
+ export declare const CONFORMANCE_AGENT: AgentDef;
49
+ /**
50
+ * JavaScript bundle equivalent of {@link CONFORMANCE_AGENT} for the sandbox
51
+ * isolate path. Must be kept in sync with the AgentDef above.
52
+ */
53
+ export declare const CONFORMANCE_AGENT_BUNDLE = "\nexport default {\n name: \"conformance-test\",\n instructions: \"Conformance test agent.\",\n greeting: \"Hello!\",\n maxSteps: 5,\n state: () => ({ count: 0, lastTurn: \"\" }),\n tools: {\n echo: {\n description: \"Echo input\",\n execute(args) { return \"echo:\" + args.text; },\n },\n get_env: {\n description: \"Get MY_VAR from env\",\n execute(_args, ctx) { return ctx.env.MY_VAR ?? \"missing\"; },\n },\n get_state: {\n description: \"Get session state\",\n execute(_args, ctx) { return JSON.stringify(ctx.state); },\n },\n echo_messages: {\n description: \"Return messages as JSON\",\n execute(_args, ctx) { return JSON.stringify(ctx.messages); },\n },\n kv_roundtrip: {\n description: \"KV set then get\",\n async execute(args, ctx) {\n await ctx.kv.set(\"test-key\", args.value);\n const result = await ctx.kv.get(\"test-key\");\n return \"stored:\" + JSON.stringify(result);\n },\n },\n },\n onConnect: (ctx) => { ctx.state.count = 1; },\n onTurn: (text, ctx) => { ctx.state.lastTurn = text; },\n};\n";
54
+ /**
55
+ * Run the runtime conformance test suite against a given runtime context.
56
+ *
57
+ * The `getContext` callback is invoked once per test to retrieve the
58
+ * current {@link RuntimeTestContext}. This allows the caller to set up
59
+ * the runtime in a `beforeAll` and return it lazily.
60
+ *
61
+ * All tests assume the runtime was created with {@link CONFORMANCE_AGENT}
62
+ * (or its bundle equivalent) and `env: { MY_VAR: "test-value" }`.
63
+ */
64
+ export declare function testRuntime(label: string, getContext: () => RuntimeTestContext): void;
@@ -0,0 +1,70 @@
1
+ import type { AgentConfig } from "./_internal-types.ts";
2
+ import type { ClientSink } from "./protocol.ts";
3
+ import type { S2sEvents, S2sHandle } from "./s2s.ts";
4
+ import { type S2sSessionOptions } from "./session.ts";
5
+ import type { AgentDef, ToolContext, ToolDef } from "./types.ts";
6
+ /** Yield to the microtask queue so pending promises settle. */
7
+ export declare function flush(): Promise<void>;
8
+ export declare function createMockToolContext(overrides?: Partial<ToolContext>): ToolContext;
9
+ export declare function makeTool(overrides?: Partial<ToolDef>): ToolDef;
10
+ export declare function makeAgent(overrides?: Partial<AgentDef>): AgentDef;
11
+ export declare function makeConfig(overrides?: Partial<AgentConfig>): AgentConfig;
12
+ export type MockS2sHandle = S2sHandle & {
13
+ _fire: <K extends keyof S2sEvents>(type: K, ...args: Parameters<S2sEvents[K]>) => void;
14
+ };
15
+ /** Create a mock S2sHandle backed by nanoevents. */
16
+ export declare function makeMockHandle(): MockS2sHandle;
17
+ /** Minimal client that tracks events and audio. All methods are vi.fn() spies. */
18
+ export declare function makeClient(): ClientSink & {
19
+ events: unknown[];
20
+ audioChunks: Uint8Array[];
21
+ audioDoneCount: number;
22
+ };
23
+ export declare const silentLogger: {
24
+ info: (...args: unknown[]) => void;
25
+ warn: (...args: unknown[]) => void;
26
+ error: (...args: unknown[]) => void;
27
+ debug: (...args: unknown[]) => void;
28
+ };
29
+ export declare function makeSessionOpts(overrides?: Partial<S2sSessionOptions>): S2sSessionOptions;
30
+ /** Load a JSON fixture from __fixtures__/. */
31
+ export declare function loadFixture<T = Record<string, unknown>[]>(name: string): T;
32
+ /**
33
+ * Replay recorded S2S API messages through a MockS2sHandle.
34
+ *
35
+ * Converts raw wire-format JSON (from __fixtures__/) into typed `_fire()` calls.
36
+ * This is the inverse of `dispatchS2sMessage` in s2s.ts — it translates
37
+ * snake_case API fields to camelCase event payloads.
38
+ *
39
+ * Messages that don't map to an event (audio, `reply.content_part.*`) are skipped.
40
+ */
41
+ export declare function replayFixtureMessages(handle: MockS2sHandle, messages: Record<string, unknown>[]): void;
42
+ /**
43
+ * Create a real Runtime-backed session for fixture replay testing.
44
+ *
45
+ * Uses a real `Runtime` (real tool execution, real hooks) but replaces the
46
+ * S2S WebSocket with a mock handle so fixture messages can be replayed
47
+ * through the full orchestration layer.
48
+ *
49
+ * Exercises: defineAgent → toAgentConfig → tool schemas → Zod arg validation
50
+ * → executeToolCall → session orchestration (reply guards, tool buffering,
51
+ * turnPromise chaining).
52
+ *
53
+ * Call `cleanup()` when done to restore the connectS2s spy.
54
+ */
55
+ export declare function createFixtureSession(agent: AgentDef<any>, opts?: {
56
+ env?: Record<string, string>;
57
+ }): {
58
+ session: import("./session.ts").Session;
59
+ client: ClientSink & {
60
+ events: unknown[];
61
+ audioChunks: Uint8Array[];
62
+ audioDoneCount: number;
63
+ };
64
+ mockHandle: MockS2sHandle;
65
+ executor: import("./direct-executor.ts").Runtime;
66
+ /** Replay a fixture file through the session's S2S handle. */
67
+ replay(fixtureName: string): void;
68
+ /** Restore the connectS2s spy. Call in afterEach. */
69
+ cleanup(): void;
70
+ };
package/dist/_utils.d.ts CHANGED
@@ -3,15 +3,8 @@
3
3
  export declare function errorMessage(err: unknown): string;
4
4
  /** Extract a detailed error string (message + stack) for diagnostic logging. */
5
5
  export declare function errorDetail(err: unknown): string;
6
- /** Filter out undefined values from an env record. */
7
- export declare function filterEnv(env: Record<string, string | undefined>): Record<string, string>;
8
6
  /** Check whether a filesystem operation is a read-only operation. */
9
7
  export declare function isReadOnlyFsOp(op: string): boolean;
10
- /**
11
- * Safely extract the port from `server.address()`, guarding against the
12
- * string (pipe/socket) and null return types.
13
- */
14
- export declare function getServerPort(addr: unknown): number;
15
8
  /**
16
9
  * Lazily initialized per-session state manager.
17
10
  *
@@ -20,7 +13,7 @@ export declare function getServerPort(addr: unknown): number;
20
13
  */
21
14
  export declare function createSessionStateMap(initState?: () => Record<string, unknown>): {
22
15
  get(sessionId: string): Record<string, unknown>;
23
- /** Explicitly set the state for a session (used by persistence restore). */
16
+ /** Explicitly set the state for a session. */
24
17
  set(sessionId: string, state: Record<string, unknown>): void;
25
18
  delete(sessionId: string): boolean;
26
19
  };
package/dist/_utils.js CHANGED
@@ -1,2 +1,49 @@
1
- import { a as getServerPort, i as filterEnv, n as errorDetail, o as isReadOnlyFsOp, r as errorMessage, s as toolError, t as createSessionStateMap } from "./_utils-DgzpOMSV.js";
2
- export { createSessionStateMap, errorDetail, errorMessage, filterEnv, getServerPort, isReadOnlyFsOp, toolError };
1
+ //#region _utils.ts
2
+ /** Shared utility functions. */
3
+ /** Extract an error message from an unknown thrown value. */
4
+ function errorMessage(err) {
5
+ return err instanceof Error ? err.message : String(err);
6
+ }
7
+ /** Extract a detailed error string (message + stack) for diagnostic logging. */
8
+ function errorDetail(err) {
9
+ if (err instanceof Error) return err.stack ?? err.message;
10
+ return String(err);
11
+ }
12
+ /** Set of filesystem operations that are safe for read-only access. */
13
+ const READ_ONLY_FS_OPS = new Set([
14
+ "read",
15
+ "stat",
16
+ "readdir",
17
+ "exists"
18
+ ]);
19
+ /** Check whether a filesystem operation is a read-only operation. */
20
+ function isReadOnlyFsOp(op) {
21
+ return READ_ONLY_FS_OPS.has(op);
22
+ }
23
+ /**
24
+ * Lazily initialized per-session state manager.
25
+ *
26
+ * On first access for a given session, calls `initState()` (if provided) to
27
+ * create the initial state. Returns `{}` if no initializer and no prior state.
28
+ */
29
+ function createSessionStateMap(initState) {
30
+ const map = /* @__PURE__ */ new Map();
31
+ return {
32
+ get(sessionId) {
33
+ if (!map.has(sessionId) && initState) map.set(sessionId, initState());
34
+ return map.get(sessionId) ?? {};
35
+ },
36
+ set(sessionId, state) {
37
+ map.set(sessionId, state);
38
+ },
39
+ delete(sessionId) {
40
+ return map.delete(sessionId);
41
+ }
42
+ };
43
+ }
44
+ /** Return a JSON error string for the LLM: `'{"error":"<message>"}'`. */
45
+ function toolError(message) {
46
+ return JSON.stringify({ error: message });
47
+ }
48
+ //#endregion
49
+ export { createSessionStateMap, errorDetail, errorMessage, isReadOnlyFsOp, toolError };
@@ -10,19 +10,15 @@ import { type ToolSchema } from "./_internal-types.ts";
10
10
  import type { ToolDef } from "./types.ts";
11
11
  export { executeInIsolate } from "./_run-code.ts";
12
12
  export { memoryTools } from "./memory-tools.ts";
13
- /** Callback for proxying vector search through the host RPC. */
14
- export type VectorSearchFn = (query: string, topK: number) => Promise<string>;
15
13
  /** Options for creating built-in tool definitions. */
16
14
  export type BuiltinToolOptions = {
17
- /** RPC callback for vector_search (proxied through host). */
18
- vectorSearch?: VectorSearchFn;
19
15
  /** Override fetch implementation (defaults to globalThis.fetch). For testing. */
20
16
  fetch?: typeof globalThis.fetch;
21
17
  };
22
18
  type ToolDefRecord = Record<string, ToolDef<z.ZodObject<z.ZodRawShape>>>;
23
19
  /**
24
20
  * Create built-in tool definitions for the given tool names.
25
- * For runtime use — vector_search requires opts.vectorSearch to be included.
21
+ * For runtime use.
26
22
  */
27
23
  export declare function getBuiltinToolDefs(names: readonly string[], opts?: BuiltinToolOptions): ToolDefRecord;
28
24
  /** Returns JSON tool schemas for the specified builtin tools. */
@@ -0,0 +1,47 @@
1
+ //#region constants.ts
2
+ /**
3
+ * Centralised numeric constants — timeouts, size limits, sample rates.
4
+ *
5
+ * Every magic number that controls a timeout, buffer size, or threshold
6
+ * lives here so the values are discoverable in one place.
7
+ */
8
+ /** Default sample rate for speech-to-text audio in Hz (AssemblyAI). */
9
+ const DEFAULT_STT_SAMPLE_RATE = 16e3;
10
+ /** Default sample rate for text-to-speech audio in Hz. */
11
+ const DEFAULT_TTS_SAMPLE_RATE = 24e3;
12
+ /** Default timeout for agent lifecycle hooks (onConnect, onTurn, etc). */
13
+ const HOOK_TIMEOUT_MS = 5e3;
14
+ /** Default timeout for tool execution in the worker. */
15
+ const TOOL_EXECUTION_TIMEOUT_MS = 3e4;
16
+ /** Timeout for session.start() (S2S connection setup). */
17
+ const DEFAULT_SESSION_START_TIMEOUT_MS = 1e4;
18
+ /** S2S session idle timeout before auto-close. */
19
+ const DEFAULT_IDLE_TIMEOUT_MS = 3e5;
20
+ /** Per-fetch timeout for network tools (web_search, visit_webpage, fetch_json). */
21
+ const FETCH_TIMEOUT_MS = 15e3;
22
+ /** Timeout for sandboxed run_code execution. */
23
+ const RUN_CODE_TIMEOUT_MS = 5e3;
24
+ /** Maximum time to wait for sessions to stop during graceful shutdown. */
25
+ const DEFAULT_SHUTDOWN_TIMEOUT_MS = 3e4;
26
+ /** Maximum length for tool result strings sent to clients. */
27
+ const MAX_TOOL_RESULT_CHARS = 4e3;
28
+ /** Maximum chars for webpage text after HTML-to-text conversion. */
29
+ const MAX_PAGE_CHARS = 1e4;
30
+ /** Maximum bytes to fetch from an HTML page before conversion. */
31
+ const MAX_HTML_BYTES = 2e5;
32
+ /** Maximum value size for KV store entries (bytes). */
33
+ const MAX_VALUE_SIZE = 65536;
34
+ /** Maximum glob pattern length to prevent ReDoS. */
35
+ const MAX_GLOB_PATTERN_LENGTH = 1024;
36
+ /** Maximum conversation messages to retain (sliding window). */
37
+ const DEFAULT_MAX_HISTORY = 200;
38
+ /** Memory limit for run_code isolates (MB). */
39
+ const RUN_CODE_MEMORY_MB = 32;
40
+ /**
41
+ * Content-Security-Policy applied to agent UI pages (both self-hosted and
42
+ * platform). Single source of truth — used by `secureHeaders` middleware
43
+ * and per-response CSP headers.
44
+ */
45
+ const AGENT_CSP = "default-src 'self'; script-src 'self' 'unsafe-eval' blob:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; connect-src 'self' wss: ws:; img-src 'self' data:; font-src 'self' https://fonts.gstatic.com; object-src 'none'; base-uri 'self'";
46
+ //#endregion
47
+ export { TOOL_EXECUTION_TIMEOUT_MS as _, DEFAULT_SHUTDOWN_TIMEOUT_MS as a, FETCH_TIMEOUT_MS as c, MAX_HTML_BYTES as d, MAX_PAGE_CHARS as f, RUN_CODE_TIMEOUT_MS as g, RUN_CODE_MEMORY_MB as h, DEFAULT_SESSION_START_TIMEOUT_MS as i, HOOK_TIMEOUT_MS as l, MAX_VALUE_SIZE as m, DEFAULT_IDLE_TIMEOUT_MS as n, DEFAULT_STT_SAMPLE_RATE as o, MAX_TOOL_RESULT_CHARS as p, DEFAULT_MAX_HISTORY as r, DEFAULT_TTS_SAMPLE_RATE as s, AGENT_CSP as t, MAX_GLOB_PATTERN_LENGTH as u };
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Centralised numeric constants — timeouts, size limits, sample rates.
3
+ *
4
+ * Every magic number that controls a timeout, buffer size, or threshold
5
+ * lives here so the values are discoverable in one place.
6
+ */
7
+ /** Default sample rate for speech-to-text audio in Hz (AssemblyAI). */
8
+ export declare const DEFAULT_STT_SAMPLE_RATE = 16000;
9
+ /** Default sample rate for text-to-speech audio in Hz. */
10
+ export declare const DEFAULT_TTS_SAMPLE_RATE = 24000;
11
+ /** Default timeout for agent lifecycle hooks (onConnect, onTurn, etc). */
12
+ export declare const HOOK_TIMEOUT_MS = 5000;
13
+ /** Default timeout for tool execution in the worker. */
14
+ export declare const TOOL_EXECUTION_TIMEOUT_MS = 30000;
15
+ /** Timeout for session.start() (S2S connection setup). */
16
+ export declare const DEFAULT_SESSION_START_TIMEOUT_MS = 10000;
17
+ /** S2S session idle timeout before auto-close. */
18
+ export declare const DEFAULT_IDLE_TIMEOUT_MS = 300000;
19
+ /** Per-fetch timeout for network tools (web_search, visit_webpage, fetch_json). */
20
+ export declare const FETCH_TIMEOUT_MS = 15000;
21
+ /** Timeout for sandboxed run_code execution. */
22
+ export declare const RUN_CODE_TIMEOUT_MS = 5000;
23
+ /** Maximum time to wait for sessions to stop during graceful shutdown. */
24
+ export declare const DEFAULT_SHUTDOWN_TIMEOUT_MS = 30000;
25
+ /** Maximum length for tool result strings sent to clients. */
26
+ export declare const MAX_TOOL_RESULT_CHARS = 4000;
27
+ /** Maximum chars for webpage text after HTML-to-text conversion. */
28
+ export declare const MAX_PAGE_CHARS = 10000;
29
+ /** Maximum bytes to fetch from an HTML page before conversion. */
30
+ export declare const MAX_HTML_BYTES = 200000;
31
+ /** Maximum value size for KV store entries (bytes). */
32
+ export declare const MAX_VALUE_SIZE = 65536;
33
+ /** Maximum glob pattern length to prevent ReDoS. */
34
+ export declare const MAX_GLOB_PATTERN_LENGTH = 1024;
35
+ /** Maximum conversation messages to retain (sliding window). */
36
+ export declare const DEFAULT_MAX_HISTORY = 200;
37
+ /** Memory limit for run_code isolates (MB). */
38
+ export declare const RUN_CODE_MEMORY_MB = 32;
39
+ /**
40
+ * Content-Security-Policy applied to agent UI pages (both self-hosted and
41
+ * platform). Single source of truth — used by `secureHeaders` middleware
42
+ * and per-response CSP headers.
43
+ */
44
+ export declare const AGENT_CSP: string;