@alexkroman1/aai 0.12.2 → 1.0.2

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 (135) hide show
  1. package/.turbo/turbo-build.log +20 -0
  2. package/CHANGELOG.md +174 -0
  3. package/dist/constants-VTFoymJ-.js +47 -0
  4. package/dist/host/_run-code.d.ts +4 -2
  5. package/dist/host/_runtime-conformance.d.ts +4 -5
  6. package/dist/host/builtin-tools.d.ts +11 -7
  7. package/dist/host/runtime-barrel.d.ts +15 -0
  8. package/dist/{direct-executor-ZUU0Ke4j.js → host/runtime-barrel.js} +463 -345
  9. package/dist/host/runtime-config.d.ts +42 -0
  10. package/dist/host/runtime.d.ts +119 -35
  11. package/dist/host/s2s.d.ts +14 -38
  12. package/dist/host/server.d.ts +16 -8
  13. package/dist/host/session-ctx.d.ts +55 -0
  14. package/dist/host/session.d.ts +21 -70
  15. package/dist/host/tool-executor.d.ts +20 -0
  16. package/dist/host/unstorage-kv.d.ts +1 -1
  17. package/dist/host/ws-handler.d.ts +4 -2
  18. package/dist/index.d.ts +9 -20
  19. package/dist/index.js +63 -2
  20. package/dist/{isolate → sdk}/_internal-types.d.ts +6 -10
  21. package/dist/{isolate → sdk}/constants.d.ts +6 -4
  22. package/dist/sdk/define.d.ts +66 -0
  23. package/dist/{isolate → sdk}/kv.d.ts +1 -49
  24. package/dist/sdk/manifest-barrel.d.ts +8 -0
  25. package/dist/sdk/manifest-barrel.js +52 -0
  26. package/dist/sdk/manifest.d.ts +50 -0
  27. package/dist/{isolate → sdk}/protocol.d.ts +59 -36
  28. package/dist/sdk/protocol.js +163 -0
  29. package/dist/{isolate → sdk}/system-prompt.d.ts +3 -2
  30. package/dist/sdk/types.d.ts +201 -0
  31. package/dist/sdk/ws-upgrade.d.ts +5 -0
  32. package/dist/{system-prompt-CVJSQJiA.js → system-prompt-nik_iavo.js} +11 -10
  33. package/dist/types-Cfx_4QDK.js +39 -0
  34. package/dist/ws-upgrade-BeOQ7fXL.js +30 -0
  35. package/exports-no-dev-deps.test.ts +62 -0
  36. package/host/_mock-ws.ts +185 -0
  37. package/host/_run-code.ts +217 -0
  38. package/host/_runtime-conformance.ts +143 -0
  39. package/host/_test-utils.ts +276 -0
  40. package/host/builtin-tools.test.ts +774 -0
  41. package/host/builtin-tools.ts +255 -0
  42. package/host/cleanup.test.ts +422 -0
  43. package/host/fixture-replay.test.ts +463 -0
  44. package/host/fixtures/README.md +40 -0
  45. package/host/fixtures/greeting-session-sequence.json +40 -0
  46. package/host/fixtures/reply-audio-samples.json +42 -0
  47. package/host/fixtures/reply-lifecycle.json +21 -0
  48. package/host/fixtures/session-ready.json +48 -0
  49. package/host/fixtures/session-updated.json +45 -0
  50. package/host/fixtures/simple-question-sequence.json +73 -0
  51. package/host/fixtures/tool-call-sequence.json +114 -0
  52. package/host/fixtures/tool-calls.json +11 -0
  53. package/host/fixtures/tool-config-session-sequence.json +51 -0
  54. package/host/fixtures/user-speech-recognition.json +30 -0
  55. package/host/fixtures/web-search-sequence.json +122 -0
  56. package/host/integration.test.ts +222 -0
  57. package/host/runtime-barrel.ts +25 -0
  58. package/host/runtime-config.test.ts +71 -0
  59. package/host/runtime-config.ts +99 -0
  60. package/host/runtime.test.ts +641 -0
  61. package/host/runtime.ts +308 -0
  62. package/host/s2s-fixtures.test.ts +237 -0
  63. package/host/s2s.test.ts +562 -0
  64. package/host/s2s.ts +310 -0
  65. package/host/server-shutdown.test.ts +76 -0
  66. package/host/server.test.ts +116 -0
  67. package/host/server.ts +223 -0
  68. package/host/session-ctx.ts +107 -0
  69. package/host/session-fixture-replay.test.ts +136 -0
  70. package/host/session-prompt.test.ts +77 -0
  71. package/host/session.test.ts +590 -0
  72. package/host/session.ts +370 -0
  73. package/host/tool-executor.test.ts +124 -0
  74. package/host/tool-executor.ts +80 -0
  75. package/host/unstorage-kv.test.ts +99 -0
  76. package/host/unstorage-kv.ts +69 -0
  77. package/host/ws-handler.test.ts +739 -0
  78. package/host/ws-handler.ts +255 -0
  79. package/index.ts +16 -0
  80. package/package.json +28 -72
  81. package/sdk/_internal-types.test.ts +34 -0
  82. package/sdk/_internal-types.ts +115 -0
  83. package/sdk/compat-fixtures/README.md +26 -0
  84. package/sdk/compat-fixtures/v1.json +68 -0
  85. package/sdk/constants.ts +77 -0
  86. package/sdk/define.test.ts +57 -0
  87. package/sdk/define.ts +88 -0
  88. package/sdk/kv.ts +60 -0
  89. package/sdk/manifest-barrel.ts +12 -0
  90. package/sdk/manifest.test.ts +56 -0
  91. package/sdk/manifest.ts +89 -0
  92. package/sdk/protocol-compat.test.ts +187 -0
  93. package/sdk/protocol-snapshot.test.ts +199 -0
  94. package/sdk/protocol.test.ts +170 -0
  95. package/sdk/protocol.ts +223 -0
  96. package/sdk/schema-alignment.test.ts +191 -0
  97. package/sdk/system-prompt.test.ts +111 -0
  98. package/sdk/system-prompt.ts +74 -0
  99. package/sdk/tsconfig.json +12 -0
  100. package/sdk/types-inference.test.ts +122 -0
  101. package/sdk/types.test.ts +14 -0
  102. package/sdk/types.ts +226 -0
  103. package/sdk/utils.test.ts +52 -0
  104. package/sdk/utils.ts +20 -0
  105. package/sdk/ws-upgrade.test.ts +48 -0
  106. package/sdk/ws-upgrade.ts +13 -0
  107. package/tsconfig.build.json +14 -0
  108. package/tsconfig.json +10 -0
  109. package/tsdown.config.ts +26 -0
  110. package/vitest.config.ts +17 -0
  111. package/dist/host/_test-utils.d.ts +0 -73
  112. package/dist/host/direct-executor.d.ts +0 -128
  113. package/dist/host/index.d.ts +0 -18
  114. package/dist/host/index.js +0 -165
  115. package/dist/host/matchers.d.ts +0 -20
  116. package/dist/host/matchers.js +0 -41
  117. package/dist/host/server.js +0 -164
  118. package/dist/host/testing.d.ts +0 -294
  119. package/dist/host/testing.js +0 -2
  120. package/dist/host/vite-plugin.d.ts +0 -15
  121. package/dist/host/vite-plugin.js +0 -83
  122. package/dist/isolate/_kv-utils.d.ts +0 -10
  123. package/dist/isolate/_utils.js +0 -17
  124. package/dist/isolate/hooks.d.ts +0 -44
  125. package/dist/isolate/hooks.js +0 -58
  126. package/dist/isolate/index.d.ts +0 -18
  127. package/dist/isolate/index.js +0 -6
  128. package/dist/isolate/kv.js +0 -1
  129. package/dist/isolate/protocol.js +0 -2
  130. package/dist/isolate/types.d.ts +0 -418
  131. package/dist/isolate/types.js +0 -175
  132. package/dist/protocol-rcOrz7T3.js +0 -183
  133. package/dist/testing-Bb2B5Uob.js +0 -513
  134. package/dist/types.test-d.d.ts +0 -7
  135. /package/dist/{isolate/_utils.d.ts → sdk/utils.d.ts} +0 -0
@@ -0,0 +1,20 @@
1
+
2
+ > @alexkroman1/aai@1.0.2 build /home/runner/work/agent/agent/packages/aai
3
+ > tsdown && tsc -p tsconfig.build.json
4
+
5
+ ℹ tsdown v0.21.7 powered by rolldown v1.0.0-rc.12
6
+ ℹ config file: /home/runner/work/agent/agent/packages/aai/tsdown.config.ts
7
+ ℹ entry: index.ts, sdk/protocol.ts, host/runtime-barrel.ts, sdk/manifest-barrel.ts
8
+ ℹ target: node22
9
+ ℹ tsconfig: tsconfig.json
10
+ ℹ Build start
11
+ ℹ dist/host/runtime-barrel.js 47.10 kB │ gzip: 14.49 kB
12
+ ℹ dist/sdk/protocol.js  4.83 kB │ gzip: 1.77 kB
13
+ ℹ dist/index.js  2.49 kB │ gzip: 1.04 kB
14
+ ℹ dist/sdk/manifest-barrel.js  2.19 kB │ gzip: 0.99 kB
15
+ ℹ dist/system-prompt-nik_iavo.js  4.77 kB │ gzip: 2.09 kB
16
+ ℹ dist/constants-VTFoymJ-.js  2.75 kB │ gzip: 1.23 kB
17
+ ℹ dist/types-Cfx_4QDK.js  1.74 kB │ gzip: 0.93 kB
18
+ ℹ dist/ws-upgrade-BeOQ7fXL.js  1.14 kB │ gzip: 0.54 kB
19
+ ℹ 8 files, total: 67.02 kB
20
+ ✔ Build complete in 36ms
package/CHANGELOG.md ADDED
@@ -0,0 +1,174 @@
1
+ # @alexkroman1/aai
2
+
3
+ ## 1.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 76d25d4: Stop re-exporting test-only conformance suite from runtime barrel; this previously pulled `vitest` into the production bundle and crashed the deployed server with ERR_MODULE_NOT_FOUND.
8
+ - a3d3835: Force all libraries and the server to publish/deploy after the 1.0.1
9
+ release failure. Restores the `@alexkroman1/` scope on publishable
10
+ packages so npm accepts the publish, and bumps `aai-server` to trigger
11
+ the Fly.io deploy job in the release workflow.
12
+
13
+ ## 1.0.1
14
+
15
+ ### Patch Changes
16
+
17
+ - 5517333: Simplify codebase: fix SSRF bypass in sandbox builtins, deduplicate utilities, strengthen types
18
+ - 5d55c12: Remove unnecessary comments that restate obvious code
19
+ - b4ff42e: Redeploy aai-server and refresh client/CLI/SDK releases
20
+
21
+ ## 1.0.0
22
+
23
+ ### Major Changes
24
+
25
+ - 837e34f: Remove self-hosted ./server API. Platform sandbox now uses Deno guest runtime with NDJSON transport.
26
+ - 7669733: Migrate aai-ui from Preact to React 19 with simplified API: useSession, useTheme, useToolResult hooks + two-tier defineClient
27
+
28
+ ### Minor Changes
29
+
30
+ - 8ecb7d1: Add protocol compat fixtures and harden wire format for rolling upgrades
31
+ - befca9a: Simplify agent surface area: directory-based agent format with agent.json, tools/_.ts, hooks/_.ts replacing defineAgent/Zod
32
+ - ab98c61: Remove unused SDK features: `tool` alias, `ctx.fetch`, `onError` hook, `toolChoice: "none"` and `toolChoice: { type: "tool" }` variants. Add `ToolResultMap` typing to solo-rpg template.
33
+ - 14d0653: Remove kv.list() and kv.keys() from KV API — use explicit index keys instead
34
+ - 5fd5cb3: Zod-based agent.ts authoring with agent() and tool() helpers, rename aai-core to aai
35
+
36
+ ### Patch Changes
37
+
38
+ - 3bd18a9: Fix security vulnerabilities: run_code sandbox escape, SSRF wiring, credential key enforcement, DNS rebinding, path traversal, harness auth bypass, timing-safe hash comparison
39
+ - 9211c65: Add default aai-ui client served by the server when no custom client is deployed. Remove zod externalization from the worker bundler — zod 4 works natively in Deno sandboxes. Update S2S API endpoint and fix load test event handling.
40
+ - b9b5c02: Deduplicate shared utilities, fix N+1 KV list, async static serving, and race timer leak
41
+ - 99db30d: Simplify protocol, security boundaries, and SDK structure
42
+ - 5cc9550: Security hardening: deploy ownership check, SSRF DNS fail-closed + hostname blocking, timing-safe auth tokens, run_code timer cleanup, WebSocket payload limits, message buffer cap, clientFiles size limits, HTML escape completeness, KV error sanitization
43
+ - 4c1cd20: Remove duplicate startSession patterns and dead resumeFrom plumbing
44
+ - f6e7a5c: BREAKING: Align SDK naming with S2S API
45
+
46
+ - `instructions` → `systemPrompt` in AgentOptions/AgentDef
47
+ - `DEFAULT_INSTRUCTIONS` → `DEFAULT_SYSTEM_PROMPT`
48
+ - `onTurn` → `onUserTranscript` hook
49
+ - Protocol events renamed: `transcript` → `user_transcript_delta`, `turn` → `user_transcript`, `chat` → `agent_transcript`, `chat_delta` → `agent_transcript_delta`, `tts_done` → `reply_done`, `tool_call_start` → `tool_call`
50
+
51
+ - 9d2141b: Simplify and refactor: eliminate duplicated code, fix leaky abstractions, improve hot-path efficiency
52
+ - 05f8759: Replace hand-rolled utilities with dependencies: dotenv for .env parsing, mime-types and escape-html in dev server, p-debounce for file watcher
53
+ - 1678546: Simplify codebase: use p-timeout for shutdown, html-to-text for HTML conversion, deduplicate secret key validation
54
+ - 64d83b6: Add Zod validation to NDJSON guest-to-host responses, fix session state memory leak
55
+ - 6d3ec72: Improve S2S load test concurrency: quiet mode, staggered ramp-up, zero-copy audio buffers
56
+
57
+ ## 0.12.3
58
+
59
+ ### Patch Changes
60
+
61
+ - 4ebd7b6: Standardize file and directory naming to idiomatic kebab-case conventions
62
+
63
+ - Add ls-lint for file naming enforcement
64
+ - Drop underscore prefix from internal files in aai-server (e.g. `_schemas.ts` → `schemas.ts`)
65
+ - Rename `_components` → `components` and `__fixtures__` → `fixtures` in aai-ui
66
+ - Rename `__fixtures__` → `fixtures` in aai/host
67
+ - Flatten aai-server by removing `src/` directory
68
+
69
+ - 68f4d84: Make more cross platform
70
+
71
+ ## 0.12.2
72
+
73
+ ## 0.12.1
74
+
75
+ ### Patch Changes
76
+
77
+ - f4762a1: Externalize zod from agent bundles, remove storage cache, improve CI reliability
78
+
79
+ ## 0.12.0
80
+
81
+ ### Minor Changes
82
+
83
+ - 99e62c3: Remove `memoryTools()` and the `"memory"` builtin tool. Users who need KV-backed memory tools should define them directly in their agent's `tools` record.
84
+
85
+ ## 0.11.1
86
+
87
+ ### Patch Changes
88
+
89
+ - c25ee7e: Trigger deploy for SDK and server
90
+
91
+ ## 0.11.0
92
+
93
+ ### Patch Changes
94
+
95
+ - 491ec37: CLI overhaul: remove generate command, unify output style, template descriptions
96
+
97
+ - Remove `generate` and `run` commands and AI SDK dependencies
98
+ - Unify CLI output to use @clack/prompts style consistently
99
+ - Add template descriptions shown as hints in `aai init` select prompt
100
+ - Fix deploy slug mismatch between bundle and deploy steps
101
+ - Clean deploy error messages (no stack traces)
102
+ - Add `@alexkroman1/aai-cli` to scaffold devDependencies
103
+ - Remove fly.toml from scaffold
104
+ - Use cyanBright for all URLs in CLI output
105
+ - Remove eventsource-parser patch
106
+ - Add link-workspace-packages to .npmrc
107
+ - Fix Dockerfile: run esbuild install script, remove patches references
108
+
109
+ ## 0.10.4
110
+
111
+ ### Patch Changes
112
+
113
+ - 6f6a43e: Harden platform security and refactor to @hono/zod-validator
114
+
115
+ - Fix crash in sandbox-network when host.internal hit without handler
116
+ - Add Zod validation to KV bridge (isolate→host) replacing raw JSON.parse
117
+ - Refactor deploy, secret, and KV handlers to use @hono/zod-validator middleware
118
+ - Fix type errors in \_harness-runtime.ts and sandbox.ts
119
+ - Remove factory.ts, inline into orchestrator
120
+ - Add 185 new security tests for cross-agent isolation, SSRF, and trust boundaries
121
+
122
+ ## 0.10.3
123
+
124
+ ### Patch Changes
125
+
126
+ - 8d5f616: Use Hono builtins for WebSocket, security headers, and HTML escaping
127
+
128
+ - Replace manual WebSocketServer + upgrade handling with @hono/node-ws
129
+ - Replace custom escapeHtml() with Hono's html tagged template
130
+ - Replace manual CSP string with secureHeaders middleware
131
+ - Fix aai rag to use local dev server in dev mode
132
+ - Fix vector upsert model loading in local dev mode
133
+ - Add missing aws4fetch dependency for unstorage S3 driver
134
+
135
+ ## 0.10.2
136
+
137
+ ### Patch Changes
138
+
139
+ - 9de059e: Add repository.url for npm provenance, fix circular dependency, bump CI actions
140
+ - 1397f37: Fix Fly deploy config path and CI improvements
141
+
142
+ ## 0.10.1
143
+
144
+ ### Patch Changes
145
+
146
+ - aa23a1c: Add repository.url for npm provenance, fix circular dependency, bump CI actions
147
+
148
+ ## 0.10.0
149
+
150
+ ### Minor Changes
151
+
152
+ - Replace LanceDB with sqlite-vec for vector storage, add `generate` CLI command, extract templates to giget, local dev mode improvements, auth cleanup, and graceful shutdown fixes
153
+
154
+ ## 0.9.4
155
+
156
+ ### Patch Changes
157
+
158
+ - Release all packages with version increment
159
+
160
+ ## 0.9.3
161
+
162
+ ## 0.9.2
163
+
164
+ ## 0.9.1
165
+
166
+ ### Patch Changes
167
+
168
+ - Update
169
+
170
+ ## 0.9.0
171
+
172
+ ### Minor Changes
173
+
174
+ - Updated toolchain
@@ -0,0 +1,47 @@
1
+ //#region sdk/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 tool execution in the worker. */
13
+ const TOOL_EXECUTION_TIMEOUT_MS = 3e4;
14
+ /** Timeout for session.start() (S2S connection setup). */
15
+ const DEFAULT_SESSION_START_TIMEOUT_MS = 1e4;
16
+ /** S2S session idle timeout before auto-close. */
17
+ const DEFAULT_IDLE_TIMEOUT_MS = 3e5;
18
+ /** Per-fetch timeout for network tools (web_search, visit_webpage, fetch_json). */
19
+ const FETCH_TIMEOUT_MS = 15e3;
20
+ /** Timeout for sandboxed run_code execution. */
21
+ const RUN_CODE_TIMEOUT_MS = 5e3;
22
+ /** Maximum time to wait for sessions to stop during graceful shutdown. */
23
+ const DEFAULT_SHUTDOWN_TIMEOUT_MS = 3e4;
24
+ /** Maximum length for tool result strings sent to clients. */
25
+ const MAX_TOOL_RESULT_CHARS = 4e3;
26
+ /** Maximum chars for webpage text after HTML-to-text conversion. */
27
+ const MAX_PAGE_CHARS = 1e4;
28
+ /** Maximum bytes to fetch from an HTML page before conversion. */
29
+ const MAX_HTML_BYTES = 2e5;
30
+ /** Maximum value size for KV store entries (bytes). */
31
+ const MAX_VALUE_SIZE = 65536;
32
+ /** Maximum conversation messages to retain (sliding window). */
33
+ const DEFAULT_MAX_HISTORY = 200;
34
+ /** Maximum WebSocket message payload size (bytes, 1 MiB). */
35
+ const MAX_WS_PAYLOAD_BYTES = 1 * 1024 * 1024;
36
+ /** Maximum messages buffered while session.start() is pending. */
37
+ const MAX_MESSAGE_BUFFER_SIZE = 100;
38
+ /** WebSocket readyState value indicating the connection is open. */
39
+ const WS_OPEN = 1;
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 { WS_OPEN as _, DEFAULT_SHUTDOWN_TIMEOUT_MS as a, FETCH_TIMEOUT_MS as c, MAX_PAGE_CHARS as d, MAX_TOOL_RESULT_CHARS as f, TOOL_EXECUTION_TIMEOUT_MS as g, RUN_CODE_TIMEOUT_MS as h, DEFAULT_SESSION_START_TIMEOUT_MS as i, MAX_HTML_BYTES as l, MAX_WS_PAYLOAD_BYTES as m, DEFAULT_IDLE_TIMEOUT_MS as n, DEFAULT_STT_SAMPLE_RATE as o, MAX_VALUE_SIZE as p, DEFAULT_MAX_HISTORY as r, DEFAULT_TTS_SAMPLE_RATE as s, AGENT_CSP as t, MAX_MESSAGE_BUFFER_SIZE as u };
@@ -3,7 +3,7 @@
3
3
  * context with no network, filesystem, or process access.
4
4
  */
5
5
  import { z } from "zod";
6
- import type { ToolDef } from "../isolate/types.ts";
6
+ import type { ToolDef } from "../sdk/types.ts";
7
7
  declare const runCodeParams: z.ZodObject<{
8
8
  code: z.ZodString;
9
9
  }, z.core.$strip>;
@@ -20,7 +20,9 @@ declare const runCodeParams: z.ZodObject<{
20
20
  * The context is discarded after execution, so no state leaks between
21
21
  * invocations or across sessions.
22
22
  */
23
- export declare function createRunCode(): ToolDef<typeof runCodeParams>;
23
+ export declare function createRunCode(): ToolDef<typeof runCodeParams> & {
24
+ guidance: string;
25
+ };
24
26
  /**
25
27
  * Execute user code in a fresh `node:vm` context.
26
28
  *
@@ -19,7 +19,8 @@
19
19
  *
20
20
  * @example Sandbox (integration test in aai-server)
21
21
  * ```ts
22
- * import { testRuntime } from "@alexkroman1/aai/host";
22
+ * // Internal module — import the .ts source directly from this package.
23
+ * import { testRuntime } from "../../aai/host/_runtime-conformance.ts";
23
24
  *
24
25
  * testRuntime("sandbox", async () => {
25
26
  * // ... start isolate with a bundled agent
@@ -27,9 +28,8 @@
27
28
  * });
28
29
  * ```
29
30
  */
30
- import type { ExecuteTool } from "../isolate/_internal-types.ts";
31
- import type { AgentHooks } from "../isolate/hooks.ts";
32
- import { type AgentDef } from "../isolate/types.ts";
31
+ import type { ExecuteTool } from "../sdk/_internal-types.ts";
32
+ import type { AgentDef } from "../sdk/types.ts";
33
33
  /**
34
34
  * Minimal runtime surface needed for conformance tests.
35
35
  *
@@ -38,7 +38,6 @@ import { type AgentDef } from "../isolate/types.ts";
38
38
  */
39
39
  export type RuntimeTestContext = {
40
40
  executeTool: ExecuteTool;
41
- hooks: AgentHooks;
42
41
  };
43
42
  /** Agent definition used by the conformance suite (direct executor path). */
44
43
  export declare const CONFORMANCE_AGENT: AgentDef;
@@ -6,8 +6,8 @@
6
6
  * Network requests go through the host's fetch proxy (with SSRF protection).
7
7
  */
8
8
  import { z } from "zod";
9
- import { type ToolSchema } from "../isolate/_internal-types.ts";
10
- import type { ToolDef } from "../isolate/types.ts";
9
+ import { type ToolSchema } from "../sdk/_internal-types.ts";
10
+ import type { ToolDef } from "../sdk/types.ts";
11
11
  export { executeInIsolate } from "./_run-code.ts";
12
12
  /** Options for creating built-in tool definitions. */
13
13
  export type BuiltinToolOptions = {
@@ -15,10 +15,14 @@ export type BuiltinToolOptions = {
15
15
  fetch?: typeof globalThis.fetch;
16
16
  };
17
17
  type ToolDefRecord = Record<string, ToolDef<z.ZodObject<z.ZodRawShape>>>;
18
+ /** Resolved builtins with defs, schemas, and guidance computed in a single pass. */
19
+ export type ResolvedBuiltins = {
20
+ defs: ToolDefRecord;
21
+ schemas: ToolSchema[];
22
+ guidance: string[];
23
+ };
18
24
  /**
19
- * Create built-in tool definitions for the given tool names.
20
- * For runtime use.
25
+ * Resolve all builtin tools in one pass, returning defs, schemas, and guidance.
26
+ * Avoids redundant calls to `resolveBuiltin` and `z.toJSONSchema`.
21
27
  */
22
- export declare function getBuiltinToolDefs(names: readonly string[], opts?: BuiltinToolOptions): ToolDefRecord;
23
- /** Returns JSON tool schemas for the specified builtin tools. */
24
- export declare function getBuiltinToolSchemas(names: readonly string[]): ToolSchema[];
28
+ export declare function resolveAllBuiltins(names: readonly string[], opts?: BuiltinToolOptions): ResolvedBuiltins;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Runtime barrel — the full Node.js runtime engine for running agents.
3
+ *
4
+ * Used by aai-server (sandbox) and aai-cli (dev server).
5
+ */
6
+ export * from "./builtin-tools.ts";
7
+ export * from "./runtime.ts";
8
+ export * from "./runtime-config.ts";
9
+ export * from "./s2s.ts";
10
+ export * from "./server.ts";
11
+ export * from "./session.ts";
12
+ export * from "./session-ctx.ts";
13
+ export * from "./tool-executor.ts";
14
+ export * from "./unstorage-kv.ts";
15
+ export * from "./ws-handler.ts";