orchajs 0.18.0 → 0.19.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 (282) hide show
  1. package/README.md +63 -8
  2. package/dist/amarsia/metadata.d.ts +0 -1
  3. package/dist/amarsia/metadata.js +0 -1
  4. package/dist/amarsia/sync.d.ts +0 -1
  5. package/dist/amarsia/sync.js +0 -1
  6. package/dist/cli-agents-template.d.ts +0 -1
  7. package/dist/cli-agents-template.js +0 -1
  8. package/dist/cli.d.ts +0 -1
  9. package/dist/cli.js +0 -1
  10. package/dist/compiler/build-project.d.ts +0 -1
  11. package/dist/compiler/build-project.js +0 -1
  12. package/dist/compiler/compile.d.ts +0 -1
  13. package/dist/compiler/compile.js +0 -1
  14. package/dist/env.d.ts +0 -1
  15. package/dist/env.js +0 -1
  16. package/dist/errors.d.ts +0 -1
  17. package/dist/errors.js +0 -1
  18. package/dist/file-content.d.ts +0 -1
  19. package/dist/file-content.js +0 -1
  20. package/dist/index.d.ts +0 -1
  21. package/dist/index.js +0 -1
  22. package/dist/integrations/esbuild.d.ts +0 -1
  23. package/dist/integrations/esbuild.js +0 -1
  24. package/dist/orcha.d.ts +0 -1
  25. package/dist/orcha.js +0 -1
  26. package/dist/playground/public/app.css +0 -1
  27. package/dist/playground/public/app.js +0 -1
  28. package/dist/playground/server.d.ts +0 -1
  29. package/dist/playground/server.js +0 -1
  30. package/dist/playground/source.d.ts +0 -1
  31. package/dist/playground/source.js +0 -1
  32. package/dist/project-loader.d.ts +0 -1
  33. package/dist/project-loader.js +0 -1
  34. package/dist/providers/anthropic.d.ts +0 -1
  35. package/dist/providers/anthropic.js +0 -1
  36. package/dist/providers/bedrock.d.ts +0 -1
  37. package/dist/providers/bedrock.js +0 -1
  38. package/dist/providers/catalog.d.ts +0 -1
  39. package/dist/providers/catalog.js +0 -1
  40. package/dist/providers/deepseek.d.ts +0 -1
  41. package/dist/providers/deepseek.js +0 -1
  42. package/dist/providers/dispatcher.d.ts +0 -1
  43. package/dist/providers/dispatcher.js +0 -1
  44. package/dist/providers/google-gemini.d.ts +0 -1
  45. package/dist/providers/google-gemini.js +0 -1
  46. package/dist/providers/google-genai.d.ts +0 -1
  47. package/dist/providers/google-genai.js +0 -1
  48. package/dist/providers/index.d.ts +0 -1
  49. package/dist/providers/index.js +20 -5
  50. package/dist/providers/openai.d.ts +0 -1
  51. package/dist/providers/openai.js +0 -1
  52. package/dist/providers/sse.d.ts +0 -1
  53. package/dist/providers/sse.js +0 -1
  54. package/dist/providers/types.d.ts +0 -1
  55. package/dist/providers/types.js +0 -1
  56. package/dist/providers/vertex-ai.d.ts +0 -1
  57. package/dist/providers/vertex-ai.js +0 -1
  58. package/dist/runtime/actions/context.d.ts +0 -1
  59. package/dist/runtime/actions/context.js +0 -1
  60. package/dist/runtime/actions/execute.d.ts +0 -1
  61. package/dist/runtime/actions/execute.js +14 -2
  62. package/dist/runtime/actions/native.d.ts +0 -1
  63. package/dist/runtime/actions/native.js +0 -1
  64. package/dist/runtime/actions/sandbox.d.ts +0 -1
  65. package/dist/runtime/actions/sandbox.js +0 -1
  66. package/dist/runtime/agent.d.ts +0 -1
  67. package/dist/runtime/agent.js +0 -1
  68. package/dist/runtime/context.d.ts +0 -1
  69. package/dist/runtime/context.js +0 -1
  70. package/dist/runtime/create-orcha.d.ts +0 -1
  71. package/dist/runtime/create-orcha.js +0 -1
  72. package/dist/runtime/execution.d.ts +0 -1
  73. package/dist/runtime/execution.js +0 -1
  74. package/dist/runtime/session-events.d.ts +0 -1
  75. package/dist/runtime/session-events.js +0 -1
  76. package/dist/runtime/structured-output.d.ts +0 -1
  77. package/dist/runtime/structured-output.js +0 -1
  78. package/dist/storage/browser-indexeddb.d.ts +0 -1
  79. package/dist/storage/browser-indexeddb.js +0 -1
  80. package/dist/storage/create-store.d.ts +0 -1
  81. package/dist/storage/create-store.js +0 -1
  82. package/dist/storage/edge-store.d.ts +0 -1
  83. package/dist/storage/edge-store.js +0 -1
  84. package/dist/storage/migrate.d.ts +0 -1
  85. package/dist/storage/migrate.js +0 -1
  86. package/dist/storage/node-jsonl.d.ts +0 -1
  87. package/dist/storage/node-jsonl.js +0 -1
  88. package/dist/storage/node-sqlite.d.ts +0 -1
  89. package/dist/storage/node-sqlite.js +1 -2
  90. package/dist/storage/react-native-jsonl.d.ts +0 -1
  91. package/dist/storage/react-native-jsonl.js +0 -1
  92. package/dist/testing.d.ts +0 -1
  93. package/dist/testing.js +0 -1
  94. package/dist/types.d.ts +0 -1
  95. package/dist/types.js +0 -1
  96. package/dist-cjs/amarsia/metadata.js +0 -1
  97. package/dist-cjs/amarsia/sync.js +0 -1
  98. package/dist-cjs/cli-agents-template.js +0 -1
  99. package/dist-cjs/compiler/build-project.js +0 -1
  100. package/dist-cjs/compiler/compile.js +0 -1
  101. package/dist-cjs/env.js +0 -1
  102. package/dist-cjs/errors.js +0 -1
  103. package/dist-cjs/file-content.js +0 -1
  104. package/dist-cjs/index.js +0 -1
  105. package/dist-cjs/integrations/esbuild.js +0 -1
  106. package/dist-cjs/orcha.js +0 -1
  107. package/dist-cjs/playground/server.js +0 -1
  108. package/dist-cjs/playground/source.js +0 -1
  109. package/dist-cjs/project-loader.js +0 -1
  110. package/dist-cjs/providers/anthropic.js +0 -1
  111. package/dist-cjs/providers/bedrock.js +0 -1
  112. package/dist-cjs/providers/catalog.js +0 -1
  113. package/dist-cjs/providers/deepseek.js +0 -1
  114. package/dist-cjs/providers/dispatcher.js +0 -1
  115. package/dist-cjs/providers/google-gemini.js +0 -1
  116. package/dist-cjs/providers/google-genai.js +0 -1
  117. package/dist-cjs/providers/index.js +16 -3
  118. package/dist-cjs/providers/openai.js +0 -1
  119. package/dist-cjs/providers/sse.js +0 -1
  120. package/dist-cjs/providers/types.js +0 -1
  121. package/dist-cjs/providers/vertex-ai.js +0 -1
  122. package/dist-cjs/runtime/actions/context.js +0 -1
  123. package/dist-cjs/runtime/actions/execute.js +16 -2
  124. package/dist-cjs/runtime/actions/native.js +0 -1
  125. package/dist-cjs/runtime/actions/sandbox.js +0 -1
  126. package/dist-cjs/runtime/agent.js +0 -1
  127. package/dist-cjs/runtime/context.js +0 -1
  128. package/dist-cjs/runtime/create-orcha.js +0 -1
  129. package/dist-cjs/runtime/execution.js +0 -1
  130. package/dist-cjs/runtime/session-events.js +0 -1
  131. package/dist-cjs/runtime/structured-output.js +0 -1
  132. package/dist-cjs/storage/browser-indexeddb.js +0 -1
  133. package/dist-cjs/storage/create-store.js +0 -1
  134. package/dist-cjs/storage/edge-store.js +0 -1
  135. package/dist-cjs/storage/migrate.js +0 -1
  136. package/dist-cjs/storage/node-jsonl.js +0 -1
  137. package/dist-cjs/storage/node-sqlite.js +1 -2
  138. package/dist-cjs/storage/react-native-jsonl.js +0 -1
  139. package/dist-cjs/testing.js +0 -1
  140. package/dist-cjs/types/google-genai-sdk.d.js +0 -1
  141. package/dist-cjs/types.js +0 -1
  142. package/package.json +33 -9
  143. package/dist/amarsia/metadata.d.ts.map +0 -1
  144. package/dist/amarsia/metadata.js.map +0 -1
  145. package/dist/amarsia/sync.d.ts.map +0 -1
  146. package/dist/amarsia/sync.js.map +0 -1
  147. package/dist/cli-agents-template.d.ts.map +0 -1
  148. package/dist/cli-agents-template.js.map +0 -1
  149. package/dist/cli.d.ts.map +0 -1
  150. package/dist/cli.js.map +0 -1
  151. package/dist/compiler/build-project.d.ts.map +0 -1
  152. package/dist/compiler/build-project.js.map +0 -1
  153. package/dist/compiler/compile.d.ts.map +0 -1
  154. package/dist/compiler/compile.js.map +0 -1
  155. package/dist/env.d.ts.map +0 -1
  156. package/dist/env.js.map +0 -1
  157. package/dist/errors.d.ts.map +0 -1
  158. package/dist/errors.js.map +0 -1
  159. package/dist/file-content.d.ts.map +0 -1
  160. package/dist/file-content.js.map +0 -1
  161. package/dist/index.d.ts.map +0 -1
  162. package/dist/index.js.map +0 -1
  163. package/dist/integrations/esbuild.d.ts.map +0 -1
  164. package/dist/integrations/esbuild.js.map +0 -1
  165. package/dist/orcha.d.ts.map +0 -1
  166. package/dist/orcha.js.map +0 -1
  167. package/dist/playground/public/app.css.map +0 -7
  168. package/dist/playground/public/app.js.map +0 -7
  169. package/dist/playground/server.d.ts.map +0 -1
  170. package/dist/playground/server.js.map +0 -1
  171. package/dist/playground/source.d.ts.map +0 -1
  172. package/dist/playground/source.js.map +0 -1
  173. package/dist/project-loader.d.ts.map +0 -1
  174. package/dist/project-loader.js.map +0 -1
  175. package/dist/providers/anthropic.d.ts.map +0 -1
  176. package/dist/providers/anthropic.js.map +0 -1
  177. package/dist/providers/bedrock.d.ts.map +0 -1
  178. package/dist/providers/bedrock.js.map +0 -1
  179. package/dist/providers/catalog.d.ts.map +0 -1
  180. package/dist/providers/catalog.js.map +0 -1
  181. package/dist/providers/deepseek.d.ts.map +0 -1
  182. package/dist/providers/deepseek.js.map +0 -1
  183. package/dist/providers/dispatcher.d.ts.map +0 -1
  184. package/dist/providers/dispatcher.js.map +0 -1
  185. package/dist/providers/google-gemini.d.ts.map +0 -1
  186. package/dist/providers/google-gemini.js.map +0 -1
  187. package/dist/providers/google-genai.d.ts.map +0 -1
  188. package/dist/providers/google-genai.js.map +0 -1
  189. package/dist/providers/index.d.ts.map +0 -1
  190. package/dist/providers/index.js.map +0 -1
  191. package/dist/providers/openai.d.ts.map +0 -1
  192. package/dist/providers/openai.js.map +0 -1
  193. package/dist/providers/sse.d.ts.map +0 -1
  194. package/dist/providers/sse.js.map +0 -1
  195. package/dist/providers/types.d.ts.map +0 -1
  196. package/dist/providers/types.js.map +0 -1
  197. package/dist/providers/vertex-ai.d.ts.map +0 -1
  198. package/dist/providers/vertex-ai.js.map +0 -1
  199. package/dist/runtime/actions/context.d.ts.map +0 -1
  200. package/dist/runtime/actions/context.js.map +0 -1
  201. package/dist/runtime/actions/execute.d.ts.map +0 -1
  202. package/dist/runtime/actions/execute.js.map +0 -1
  203. package/dist/runtime/actions/native.d.ts.map +0 -1
  204. package/dist/runtime/actions/native.js.map +0 -1
  205. package/dist/runtime/actions/sandbox.d.ts.map +0 -1
  206. package/dist/runtime/actions/sandbox.js.map +0 -1
  207. package/dist/runtime/agent.d.ts.map +0 -1
  208. package/dist/runtime/agent.js.map +0 -1
  209. package/dist/runtime/context.d.ts.map +0 -1
  210. package/dist/runtime/context.js.map +0 -1
  211. package/dist/runtime/create-orcha.d.ts.map +0 -1
  212. package/dist/runtime/create-orcha.js.map +0 -1
  213. package/dist/runtime/execution.d.ts.map +0 -1
  214. package/dist/runtime/execution.js.map +0 -1
  215. package/dist/runtime/session-events.d.ts.map +0 -1
  216. package/dist/runtime/session-events.js.map +0 -1
  217. package/dist/runtime/structured-output.d.ts.map +0 -1
  218. package/dist/runtime/structured-output.js.map +0 -1
  219. package/dist/storage/browser-indexeddb.d.ts.map +0 -1
  220. package/dist/storage/browser-indexeddb.js.map +0 -1
  221. package/dist/storage/create-store.d.ts.map +0 -1
  222. package/dist/storage/create-store.js.map +0 -1
  223. package/dist/storage/edge-store.d.ts.map +0 -1
  224. package/dist/storage/edge-store.js.map +0 -1
  225. package/dist/storage/migrate.d.ts.map +0 -1
  226. package/dist/storage/migrate.js.map +0 -1
  227. package/dist/storage/node-jsonl.d.ts.map +0 -1
  228. package/dist/storage/node-jsonl.js.map +0 -1
  229. package/dist/storage/node-sqlite.d.ts.map +0 -1
  230. package/dist/storage/node-sqlite.js.map +0 -1
  231. package/dist/storage/react-native-jsonl.d.ts.map +0 -1
  232. package/dist/storage/react-native-jsonl.js.map +0 -1
  233. package/dist/testing.d.ts.map +0 -1
  234. package/dist/testing.js.map +0 -1
  235. package/dist/types.d.ts.map +0 -1
  236. package/dist/types.js.map +0 -1
  237. package/dist-cjs/amarsia/metadata.js.map +0 -7
  238. package/dist-cjs/amarsia/sync.js.map +0 -7
  239. package/dist-cjs/cli-agents-template.js.map +0 -7
  240. package/dist-cjs/compiler/build-project.js.map +0 -7
  241. package/dist-cjs/compiler/compile.js.map +0 -7
  242. package/dist-cjs/env.js.map +0 -7
  243. package/dist-cjs/errors.js.map +0 -7
  244. package/dist-cjs/file-content.js.map +0 -7
  245. package/dist-cjs/index.js.map +0 -7
  246. package/dist-cjs/integrations/esbuild.js.map +0 -7
  247. package/dist-cjs/orcha.js.map +0 -7
  248. package/dist-cjs/playground/server.js.map +0 -7
  249. package/dist-cjs/playground/source.js.map +0 -7
  250. package/dist-cjs/project-loader.js.map +0 -7
  251. package/dist-cjs/providers/anthropic.js.map +0 -7
  252. package/dist-cjs/providers/bedrock.js.map +0 -7
  253. package/dist-cjs/providers/catalog.js.map +0 -7
  254. package/dist-cjs/providers/deepseek.js.map +0 -7
  255. package/dist-cjs/providers/dispatcher.js.map +0 -7
  256. package/dist-cjs/providers/google-gemini.js.map +0 -7
  257. package/dist-cjs/providers/google-genai.js.map +0 -7
  258. package/dist-cjs/providers/index.js.map +0 -7
  259. package/dist-cjs/providers/openai.js.map +0 -7
  260. package/dist-cjs/providers/sse.js.map +0 -7
  261. package/dist-cjs/providers/types.js.map +0 -7
  262. package/dist-cjs/providers/vertex-ai.js.map +0 -7
  263. package/dist-cjs/runtime/actions/context.js.map +0 -7
  264. package/dist-cjs/runtime/actions/execute.js.map +0 -7
  265. package/dist-cjs/runtime/actions/native.js.map +0 -7
  266. package/dist-cjs/runtime/actions/sandbox.js.map +0 -7
  267. package/dist-cjs/runtime/agent.js.map +0 -7
  268. package/dist-cjs/runtime/context.js.map +0 -7
  269. package/dist-cjs/runtime/create-orcha.js.map +0 -7
  270. package/dist-cjs/runtime/execution.js.map +0 -7
  271. package/dist-cjs/runtime/session-events.js.map +0 -7
  272. package/dist-cjs/runtime/structured-output.js.map +0 -7
  273. package/dist-cjs/storage/browser-indexeddb.js.map +0 -7
  274. package/dist-cjs/storage/create-store.js.map +0 -7
  275. package/dist-cjs/storage/edge-store.js.map +0 -7
  276. package/dist-cjs/storage/migrate.js.map +0 -7
  277. package/dist-cjs/storage/node-jsonl.js.map +0 -7
  278. package/dist-cjs/storage/node-sqlite.js.map +0 -7
  279. package/dist-cjs/storage/react-native-jsonl.js.map +0 -7
  280. package/dist-cjs/testing.js.map +0 -7
  281. package/dist-cjs/types/google-genai-sdk.d.js.map +0 -7
  282. package/dist-cjs/types.js.map +0 -7
@@ -1,4 +1,3 @@
1
1
  import type { ProviderResponseGenerator } from "./types.js";
2
2
  export { isBuiltInProvider } from "./catalog.js";
3
3
  export declare const generateProviderResponse: ProviderResponseGenerator;
4
- //# sourceMappingURL=index.d.ts.map
@@ -25,16 +25,32 @@ function loadProvider(name) {
25
25
  })
26
26
  .catch((error) => {
27
27
  loadedProviders.delete(name);
28
- if ((name === "googlegenai" || name === "vertexai") &&
29
- error instanceof Error &&
30
- error.message.includes("@google/genai")) {
31
- throw new OrchaError("provider_error", `Provider "${name}" requires Node.js 20 or newer and the optional "@google/genai" package.`, { cause: error });
28
+ const dependency = missingProviderDependency(name, error);
29
+ if (dependency) {
30
+ const nodeRequirement = dependency === "@google/genai"
31
+ ? " Node.js 20 or newer is also required."
32
+ : "";
33
+ throw new OrchaError("provider_error", `Provider "${name}" requires the optional "${dependency}" package.${nodeRequirement} Install it in the application that uses this provider.`, { cause: error });
32
34
  }
33
35
  throw error;
34
36
  });
35
37
  loadedProviders.set(name, loading);
36
38
  return loading;
37
39
  }
40
+ function missingProviderDependency(name, error) {
41
+ if (!(error instanceof Error)) {
42
+ return undefined;
43
+ }
44
+ if (name === "bedrock" &&
45
+ error.message.includes("@aws-sdk/client-bedrock-runtime")) {
46
+ return "@aws-sdk/client-bedrock-runtime";
47
+ }
48
+ if ((name === "googlegenai" || name === "vertexai") &&
49
+ error.message.includes("@google/genai")) {
50
+ return "@google/genai";
51
+ }
52
+ return undefined;
53
+ }
38
54
  function isProviderAdapter(value) {
39
55
  return (typeof value === "object" &&
40
56
  value !== null &&
@@ -42,4 +58,3 @@ function isProviderAdapter(value) {
42
58
  "generate" in value &&
43
59
  typeof value.generate === "function");
44
60
  }
45
- //# sourceMappingURL=index.js.map
@@ -1,3 +1,2 @@
1
1
  import type { ProviderAdapter } from "./types.js";
2
2
  export declare const openAIProvider: ProviderAdapter;
3
- //# sourceMappingURL=openai.d.ts.map
@@ -316,4 +316,3 @@ function normalizeUsage(usage) {
316
316
  function isRecord(value) {
317
317
  return typeof value === "object" && value !== null && !Array.isArray(value);
318
318
  }
319
- //# sourceMappingURL=openai.js.map
@@ -1,2 +1 @@
1
1
  export declare function readServerSentEvents(response: Response): AsyncGenerator<Record<string, unknown>>;
2
- //# sourceMappingURL=sse.d.ts.map
@@ -55,4 +55,3 @@ export async function* readServerSentEvents(response) {
55
55
  reader.releaseLock();
56
56
  }
57
57
  }
58
- //# sourceMappingURL=sse.js.map
@@ -69,4 +69,3 @@ export interface ProviderAdapter {
69
69
  generate(configuration: ProviderConfiguration, request: ProviderRequest): Promise<ProviderResponse>;
70
70
  }
71
71
  export type ProviderResponseGenerator = (name: ProviderName, configuration: ProviderConfiguration, request: ProviderRequest) => Promise<ProviderResponse>;
72
- //# sourceMappingURL=types.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=types.js.map
@@ -1,3 +1,2 @@
1
1
  import type { ProviderAdapter } from "./types.js";
2
2
  export declare const vertexAIProvider: ProviderAdapter;
3
- //# sourceMappingURL=vertex-ai.d.ts.map
@@ -37,4 +37,3 @@ async function generateVertexAI(configuration, request) {
37
37
  });
38
38
  return generateGoogleContent(toGoogleContentClient(client), request, "vertexai");
39
39
  }
40
- //# sourceMappingURL=vertex-ai.js.map
@@ -14,4 +14,3 @@ export declare function createLocalActionContext(options: {
14
14
  metadata: SessionMetadata;
15
15
  idempotencyKey: string;
16
16
  }): LocalActionContext;
17
- //# sourceMappingURL=context.d.ts.map
@@ -66,4 +66,3 @@ function isAllowedHost(hostname, allowedHosts) {
66
66
  return hostname === allowed;
67
67
  });
68
68
  }
69
- //# sourceMappingURL=context.js.map
@@ -7,4 +7,3 @@ export declare function executeLocalAction(options: {
7
7
  metadata: SessionMetadata;
8
8
  idempotencyKey: string;
9
9
  }): Promise<unknown>;
10
- //# sourceMappingURL=execute.d.ts.map
@@ -6,9 +6,21 @@ export async function executeLocalAction(options) {
6
6
  return executeNativeAction(options.action, options.parameters, context);
7
7
  }
8
8
  if (process.env.ORCHA_INCLUDE_SANDBOX !== "0") {
9
- const { executeSandboxedAction } = await import("./sandbox.js");
9
+ const { executeSandboxedAction } = await loadSandboxRuntime();
10
10
  return executeSandboxedAction(options.action, options.parameters, context, options.configuration.sandbox);
11
11
  }
12
12
  throw new Error("The production bundle was built without the QuickJS sandbox.");
13
13
  }
14
- //# sourceMappingURL=execute.js.map
14
+ async function loadSandboxRuntime() {
15
+ try {
16
+ return await import("./sandbox.js");
17
+ }
18
+ catch (error) {
19
+ if (error instanceof Error &&
20
+ (error.message.includes("quickjs-emscripten-core") ||
21
+ error.message.includes("@jitl/quickjs-singlefile-cjs-release-sync"))) {
22
+ throw new Error('Sandboxed actions require the optional "quickjs-emscripten-core" and "@jitl/quickjs-singlefile-cjs-release-sync" packages. Install both in the application that selects the sandbox runtime.', { cause: error });
23
+ }
24
+ throw error;
25
+ }
26
+ }
@@ -1,4 +1,3 @@
1
1
  import type { CompiledActionManifest } from "../../types.js";
2
2
  import type { LocalActionContext } from "./context.js";
3
3
  export declare function executeNativeAction(action: CompiledActionManifest, parameters: Record<string, unknown>, context: LocalActionContext): Promise<unknown>;
4
- //# sourceMappingURL=native.d.ts.map
@@ -26,4 +26,3 @@ export async function executeNativeAction(action, parameters, context) {
26
26
  }
27
27
  }
28
28
  }
29
- //# sourceMappingURL=native.js.map
@@ -4,4 +4,3 @@ export declare function executeSandboxedAction(action: CompiledActionManifest, p
4
4
  memoryLimitMb?: number;
5
5
  stackLimitKb?: number;
6
6
  }): Promise<unknown>;
7
- //# sourceMappingURL=sandbox.d.ts.map
@@ -114,4 +114,3 @@ function createSandboxProgram(action, parameters, context) {
114
114
  "})()",
115
115
  ].join("\n");
116
116
  }
117
- //# sourceMappingURL=sandbox.js.map
@@ -39,4 +39,3 @@ export declare class RuntimeAgent implements AgentRuntime {
39
39
  pause(sessionId: string): Promise<SessionSnapshot>;
40
40
  update(sessionId: string, update: SessionUpdate): Promise<SessionSnapshot>;
41
41
  }
42
- //# sourceMappingURL=agent.d.ts.map
@@ -2622,4 +2622,3 @@ function failure(sessionId, code, message, options = {}) {
2622
2622
  },
2623
2623
  };
2624
2624
  }
2625
- //# sourceMappingURL=agent.js.map
@@ -9,4 +9,3 @@ export interface OrchaRuntimeContext {
9
9
  }
10
10
  export declare function setOrchaRuntimeContext(client: object, context: OrchaRuntimeContext): void;
11
11
  export declare function getOrchaRuntimeContext(client: object): OrchaRuntimeContext;
12
- //# sourceMappingURL=context.d.ts.map
@@ -9,4 +9,3 @@ export function getOrchaRuntimeContext(client) {
9
9
  }
10
10
  return context;
11
11
  }
12
- //# sourceMappingURL=context.js.map
@@ -9,4 +9,3 @@ export interface Orcha {
9
9
  export type OrchaClient = Orcha & Record<string, AgentRuntime>;
10
10
  export type BundleResolver = (configuration: OrchaInitConfiguration) => CompiledBundle;
11
11
  export declare function createOrcha(resolveBundle: BundleResolver, generateProviderResponse: ProviderResponseGenerator): OrchaClient;
12
- //# sourceMappingURL=create-orcha.d.ts.map
@@ -120,4 +120,3 @@ export function createOrcha(resolveBundle, generateProviderResponse) {
120
120
  core.attachClient(client);
121
121
  return client;
122
122
  }
123
- //# sourceMappingURL=create-orcha.js.map
@@ -2,4 +2,3 @@ import type { EvaluationResult, Execution, ExecutionSnapshot, RunResult } from "
2
2
  export type OutputSnapshotPublisher<TOutput> = (output: TOutput) => void;
3
3
  export type ExecutionSnapshotPublisher<TOutput> = (snapshot: ExecutionSnapshot<TOutput>) => void;
4
4
  export declare function createExecution<TOutput>(sessionId: string, execute: (publishOutput: OutputSnapshotPublisher<TOutput>, publishSnapshot: ExecutionSnapshotPublisher<TOutput>) => Promise<RunResult<TOutput>>, resolveEvaluations?: () => Promise<EvaluationResult[]>): Execution<TOutput>;
5
- //# sourceMappingURL=execution.d.ts.map
@@ -74,4 +74,3 @@ export function createExecution(sessionId, execute, resolveEvaluations) {
74
74
  evaluations,
75
75
  };
76
76
  }
77
- //# sourceMappingURL=execution.js.map
@@ -9,4 +9,3 @@ export declare class SessionEventWriter {
9
9
  }
10
10
  export declare function messagesFromEvents(events: SessionEvent[], includeRun?: number): ProviderMessage[];
11
11
  export declare function normalizePersistedToolResults(value: unknown[]): ProviderToolResult[] | undefined;
12
- //# sourceMappingURL=session-events.d.ts.map
@@ -237,4 +237,3 @@ function isProviderName(value) {
237
237
  return (value === "amarsia" ||
238
238
  (typeof value === "string" && isBuiltInProvider(value)));
239
239
  }
240
- //# sourceMappingURL=session-events.js.map
@@ -1,3 +1,2 @@
1
1
  export declare function parseStructuredOutput(text: string, schema: Record<string, unknown>): unknown;
2
2
  export declare function validateStructuredValue(value: unknown, schema: Record<string, unknown>): void;
3
- //# sourceMappingURL=structured-output.d.ts.map
@@ -123,4 +123,3 @@ function matchesType(value, type) {
123
123
  function isObject(value) {
124
124
  return typeof value === "object" && value !== null && !Array.isArray(value);
125
125
  }
126
- //# sourceMappingURL=structured-output.js.map
@@ -18,4 +18,3 @@ export declare class BrowserIndexedDbSessionStore implements SessionStore {
18
18
  append(_sessionId: string, _events: SessionEvent[]): Promise<void>;
19
19
  listSessionIds(): Promise<string[]>;
20
20
  }
21
- //# sourceMappingURL=browser-indexeddb.d.ts.map
@@ -23,4 +23,3 @@ export class BrowserIndexedDbSessionStore {
23
23
  throw new Error("Browser IndexedDB session storage is not implemented yet.");
24
24
  }
25
25
  }
26
- //# sourceMappingURL=browser-indexeddb.js.map
@@ -7,4 +7,3 @@ export interface CreateSessionStoreOptions {
7
7
  agentName: string;
8
8
  }
9
9
  export declare function createSessionStore(options: CreateSessionStoreOptions): SessionStore;
10
- //# sourceMappingURL=create-store.d.ts.map
@@ -11,4 +11,3 @@ export function createSessionStore(options) {
11
11
  }
12
12
  throw new Error(`Storage strategy "${String(strategy)}" is not implemented.`);
13
13
  }
14
- //# sourceMappingURL=create-store.js.map
@@ -17,4 +17,3 @@ export declare class EdgeSessionStore implements SessionStore {
17
17
  append(_sessionId: string, _events: SessionEvent[]): Promise<void>;
18
18
  listSessionIds(): Promise<string[]>;
19
19
  }
20
- //# sourceMappingURL=edge-store.d.ts.map
@@ -22,4 +22,3 @@ export class EdgeSessionStore {
22
22
  throw new Error("Edge session storage is not implemented yet.");
23
23
  }
24
24
  }
25
- //# sourceMappingURL=edge-store.js.map
@@ -5,4 +5,3 @@ export interface SessionStoreMigrationResult {
5
5
  }
6
6
  export declare function migrateSessionStore(source: SessionStore, destination: SessionStore): Promise<SessionStoreMigrationResult>;
7
7
  export declare function exportSessionJsonl(store: SessionStore, sessionId: string): Promise<string>;
8
- //# sourceMappingURL=migrate.d.ts.map
@@ -32,4 +32,3 @@ function assertCompatibleHistory(sessionId, source, destination) {
32
32
  function incompatibleHistory(sessionId) {
33
33
  return new Error(`Cannot migrate session "${sessionId}" because the destination contains conflicting history.`);
34
34
  }
35
- //# sourceMappingURL=migrate.js.map
@@ -11,4 +11,3 @@ export declare class NodeJsonlSessionStore implements SessionStore {
11
11
  subscribeAll(listener: (sessionId: string, events: SessionEvent[]) => void): () => void;
12
12
  }
13
13
  export declare function sessionAgentDirectoryName(agent: string): string;
14
- //# sourceMappingURL=node-jsonl.d.ts.map
@@ -239,4 +239,3 @@ function isMissingFileError(error) {
239
239
  "code" in error &&
240
240
  error.code === "ENOENT");
241
241
  }
242
- //# sourceMappingURL=node-jsonl.js.map
@@ -11,4 +11,3 @@ export declare class NodeSqliteSessionStore implements SessionStore {
11
11
  subscribeAll(listener: (sessionId: string, events: SessionEvent[]) => void): () => void;
12
12
  describeLocation(_sessionId: string): Promise<string>;
13
13
  }
14
- //# sourceMappingURL=node-sqlite.d.ts.map
@@ -139,7 +139,7 @@ function loadDatabaseConstructor() {
139
139
  return "default" in loaded ? loaded.default : loaded;
140
140
  }
141
141
  catch (error) {
142
- throw new Error('Orcha\'s optional SQLite dependency is unavailable. Reinstall "orchajs" with optional dependencies enabled or use the "node-jsonl" strategy.', { cause: error });
142
+ throw new Error('SQLite storage requires the optional "better-sqlite3" package. Install it in the application or use the default "node-jsonl" strategy.', { cause: error });
143
143
  }
144
144
  }
145
145
  function validateSessionId(sessionId) {
@@ -155,4 +155,3 @@ function safelyNotify(notify) {
155
155
  // Observers cannot invalidate a durable write.
156
156
  }
157
157
  }
158
- //# sourceMappingURL=node-sqlite.js.map
@@ -18,4 +18,3 @@ export declare class ReactNativeJsonlSessionStore implements SessionStore {
18
18
  append(_sessionId: string, _events: SessionEvent[]): Promise<void>;
19
19
  listSessionIds(): Promise<string[]>;
20
20
  }
21
- //# sourceMappingURL=react-native-jsonl.d.ts.map
@@ -23,4 +23,3 @@ export class ReactNativeJsonlSessionStore {
23
23
  throw new Error("React Native JSONL session storage is not implemented yet.");
24
24
  }
25
25
  }
26
- //# sourceMappingURL=react-native-jsonl.js.map
package/dist/testing.d.ts CHANGED
@@ -2,4 +2,3 @@ import type { OrchaClient } from "./runtime/create-orcha.js";
2
2
  import type { AgentTestCaseSummary, AgentTestReport, RunTestsOptions } from "./types.js";
3
3
  export declare function listTests(orcha: OrchaClient, options?: RunTestsOptions): Promise<AgentTestCaseSummary[]>;
4
4
  export declare function runTests(orcha: OrchaClient, options?: RunTestsOptions): Promise<AgentTestReport>;
5
- //# sourceMappingURL=testing.d.ts.map
package/dist/testing.js CHANGED
@@ -544,4 +544,3 @@ function isRecord(value) {
544
544
  value !== null &&
545
545
  !Array.isArray(value));
546
546
  }
547
- //# sourceMappingURL=testing.js.map
package/dist/types.d.ts CHANGED
@@ -474,4 +474,3 @@ export interface RunTestsOptions {
474
474
  test: string;
475
475
  }) => void;
476
476
  }
477
- //# sourceMappingURL=types.d.ts.map
package/dist/types.js CHANGED
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=types.js.map
@@ -207,4 +207,3 @@ function sortStable(value) {
207
207
  0 && (module.exports = {
208
208
  createAmarsiaProjectMetadata
209
209
  });
210
- //# sourceMappingURL=metadata.js.map
@@ -68,4 +68,3 @@ async function postProjectMetadata(options) {
68
68
  0 && (module.exports = {
69
69
  syncAmarsiaProject
70
70
  });
71
- //# sourceMappingURL=sync.js.map
@@ -1093,4 +1093,3 @@ needed for faithful continuation but are omitted from evaluation transcripts.
1093
1093
  0 && (module.exports = {
1094
1094
  AGENTS_MD
1095
1095
  });
1096
- //# sourceMappingURL=cli-agents-template.js.map
@@ -177,4 +177,3 @@ function createProviderRuntimeSource(providerNames) {
177
177
  0 && (module.exports = {
178
178
  buildProject
179
179
  });
180
- //# sourceMappingURL=build-project.js.map
@@ -555,4 +555,3 @@ function validateNumber(agentName, field, value, constraints) {
555
555
  compileRegistry,
556
556
  serializeBundle
557
557
  });
558
- //# sourceMappingURL=compile.js.map
package/dist-cjs/env.js CHANGED
@@ -38,4 +38,3 @@ function loadProjectEnvironment(projectRoot) {
38
38
  0 && (module.exports = {
39
39
  loadProjectEnvironment
40
40
  });
41
- //# sourceMappingURL=env.js.map
@@ -38,4 +38,3 @@ class OrchaError extends Error {
38
38
  0 && (module.exports = {
39
39
  OrchaError
40
40
  });
41
- //# sourceMappingURL=errors.js.map
@@ -99,4 +99,3 @@ function normalizeMimeType(mimeType, source) {
99
99
  normalizeUrlContent,
100
100
  readLocalFileContent
101
101
  });
102
- //# sourceMappingURL=file-content.js.map
package/dist-cjs/index.js CHANGED
@@ -41,4 +41,3 @@ var import_migrate = require("./storage/migrate.js");
41
41
  migrateSessionStore,
42
42
  orcha
43
43
  });
44
- //# sourceMappingURL=index.js.map
@@ -43,4 +43,3 @@ function orchaPlugin(options = {}) {
43
43
  0 && (module.exports = {
44
44
  orchaPlugin
45
45
  });
46
- //# sourceMappingURL=esbuild.js.map
package/dist-cjs/orcha.js CHANGED
@@ -49,4 +49,3 @@ const orcha = (0, import_create_orcha.createOrcha)(
49
49
  0 && (module.exports = {
50
50
  orcha
51
51
  });
52
- //# sourceMappingURL=orcha.js.map
@@ -686,4 +686,3 @@ function validateMutationRequest(request, mutationToken) {
686
686
  0 && (module.exports = {
687
687
  startPlayground
688
688
  });
689
- //# sourceMappingURL=server.js.map
@@ -152,4 +152,3 @@ function parseObject(source, label) {
152
152
  0 && (module.exports = {
153
153
  readPlaygroundAgentSource
154
154
  });
155
- //# sourceMappingURL=source.js.map
@@ -83,4 +83,3 @@ function restoreEnvironment(name, value) {
83
83
  0 && (module.exports = {
84
84
  loadProject
85
85
  });
86
- //# sourceMappingURL=project-loader.js.map
@@ -416,4 +416,3 @@ function getReasoningConfiguration(request) {
416
416
  0 && (module.exports = {
417
417
  anthropicProvider
418
418
  });
419
- //# sourceMappingURL=anthropic.js.map
@@ -575,4 +575,3 @@ function isRecord(value) {
575
575
  bedrockProvider,
576
576
  generateBedrockContent
577
577
  });
578
- //# sourceMappingURL=bedrock.js.map
@@ -57,4 +57,3 @@ function isBuiltInProvider(name) {
57
57
  builtInProviderCatalog,
58
58
  isBuiltInProvider
59
59
  });
60
- //# sourceMappingURL=catalog.js.map
@@ -312,4 +312,3 @@ function isRecord(value) {
312
312
  0 && (module.exports = {
313
313
  deepSeekProvider
314
314
  });
315
- //# sourceMappingURL=deepseek.js.map
@@ -39,4 +39,3 @@ function createProviderResponseGenerator(providers) {
39
39
  0 && (module.exports = {
40
40
  createProviderResponseGenerator
41
41
  });
42
- //# sourceMappingURL=dispatcher.js.map
@@ -373,4 +373,3 @@ function isRecord(value) {
373
373
  generateGoogleContent,
374
374
  toGoogleContentClient
375
375
  });
376
- //# sourceMappingURL=google-gemini.js.map
@@ -48,4 +48,3 @@ async function generateGoogleGenAI(configuration, request) {
48
48
  0 && (module.exports = {
49
49
  googleGenAIProvider
50
50
  });
51
- //# sourceMappingURL=google-genai.js.map
@@ -53,10 +53,12 @@ function loadProvider(name) {
53
53
  return provider;
54
54
  }).catch((error) => {
55
55
  loadedProviders.delete(name);
56
- if ((name === "googlegenai" || name === "vertexai") && error instanceof Error && error.message.includes("@google/genai")) {
56
+ const dependency = missingProviderDependency(name, error);
57
+ if (dependency) {
58
+ const nodeRequirement = dependency === "@google/genai" ? " Node.js 20 or newer is also required." : "";
57
59
  throw new import_errors.OrchaError(
58
60
  "provider_error",
59
- `Provider "${name}" requires Node.js 20 or newer and the optional "@google/genai" package.`,
61
+ `Provider "${name}" requires the optional "${dependency}" package.${nodeRequirement} Install it in the application that uses this provider.`,
60
62
  { cause: error }
61
63
  );
62
64
  }
@@ -65,6 +67,18 @@ function loadProvider(name) {
65
67
  loadedProviders.set(name, loading);
66
68
  return loading;
67
69
  }
70
+ function missingProviderDependency(name, error) {
71
+ if (!(error instanceof Error)) {
72
+ return void 0;
73
+ }
74
+ if (name === "bedrock" && error.message.includes("@aws-sdk/client-bedrock-runtime")) {
75
+ return "@aws-sdk/client-bedrock-runtime";
76
+ }
77
+ if ((name === "googlegenai" || name === "vertexai") && error.message.includes("@google/genai")) {
78
+ return "@google/genai";
79
+ }
80
+ return void 0;
81
+ }
68
82
  function isProviderAdapter(value) {
69
83
  return typeof value === "object" && value !== null && "name" in value && "generate" in value && typeof value.generate === "function";
70
84
  }
@@ -73,4 +87,3 @@ function isProviderAdapter(value) {
73
87
  generateProviderResponse,
74
88
  isBuiltInProvider
75
89
  });
76
- //# sourceMappingURL=index.js.map
@@ -327,4 +327,3 @@ function isRecord(value) {
327
327
  0 && (module.exports = {
328
328
  openAIProvider
329
329
  });
330
- //# sourceMappingURL=openai.js.map
@@ -80,4 +80,3 @@ async function* readServerSentEvents(response) {
80
80
  0 && (module.exports = {
81
81
  readServerSentEvents
82
82
  });
83
- //# sourceMappingURL=sse.js.map
@@ -15,4 +15,3 @@ var __copyProps = (to, from, except, desc) => {
15
15
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
16
  var types_exports = {};
17
17
  module.exports = __toCommonJS(types_exports);
18
- //# sourceMappingURL=types.js.map
@@ -69,4 +69,3 @@ async function generateVertexAI(configuration, request) {
69
69
  0 && (module.exports = {
70
70
  vertexAIProvider
71
71
  });
72
- //# sourceMappingURL=vertex-ai.js.map
@@ -103,4 +103,3 @@ function isAllowedHost(hostname, allowedHosts) {
103
103
  0 && (module.exports = {
104
104
  createLocalActionContext
105
105
  });
106
- //# sourceMappingURL=context.js.map
@@ -40,7 +40,7 @@ async function executeLocalAction(options) {
40
40
  return (0, import_native.executeNativeAction)(options.action, options.parameters, context);
41
41
  }
42
42
  if (process.env.ORCHA_INCLUDE_SANDBOX !== "0") {
43
- const { executeSandboxedAction } = await import("./sandbox.js");
43
+ const { executeSandboxedAction } = await loadSandboxRuntime();
44
44
  return executeSandboxedAction(
45
45
  options.action,
46
46
  options.parameters,
@@ -52,8 +52,22 @@ async function executeLocalAction(options) {
52
52
  "The production bundle was built without the QuickJS sandbox."
53
53
  );
54
54
  }
55
+ async function loadSandboxRuntime() {
56
+ try {
57
+ return await import("./sandbox.js");
58
+ } catch (error) {
59
+ if (error instanceof Error && (error.message.includes("quickjs-emscripten-core") || error.message.includes(
60
+ "@jitl/quickjs-singlefile-cjs-release-sync"
61
+ ))) {
62
+ throw new Error(
63
+ 'Sandboxed actions require the optional "quickjs-emscripten-core" and "@jitl/quickjs-singlefile-cjs-release-sync" packages. Install both in the application that selects the sandbox runtime.',
64
+ { cause: error }
65
+ );
66
+ }
67
+ throw error;
68
+ }
69
+ }
55
70
  // Annotate the CommonJS export names for ESM import in node:
56
71
  0 && (module.exports = {
57
72
  executeLocalAction
58
73
  });
59
- //# sourceMappingURL=execute.js.map
@@ -65,4 +65,3 @@ return __orchaActionModule.default;`
65
65
  0 && (module.exports = {
66
66
  executeNativeAction
67
67
  });
68
- //# sourceMappingURL=native.js.map
@@ -165,4 +165,3 @@ function createSandboxProgram(action, parameters, context) {
165
165
  0 && (module.exports = {
166
166
  executeSandboxedAction
167
167
  });
168
- //# sourceMappingURL=sandbox.js.map
@@ -2839,4 +2839,3 @@ function failure(sessionId, code, message, options = {}) {
2839
2839
  0 && (module.exports = {
2840
2840
  RuntimeAgent
2841
2841
  });
2842
- //# sourceMappingURL=agent.js.map
@@ -41,4 +41,3 @@ function getOrchaRuntimeContext(client) {
41
41
  getOrchaRuntimeContext,
42
42
  setOrchaRuntimeContext
43
43
  });
44
- //# sourceMappingURL=context.js.map