orchajs 0.17.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 (281) hide show
  1. package/README.md +70 -9
  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 +4 -5
  10. package/dist/compiler/build-project.d.ts +0 -1
  11. package/dist/compiler/build-project.js +2 -3
  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 +5 -3
  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 +9 -10
  28. package/dist/playground/server.d.ts +0 -1
  29. package/dist/playground/server.js +9 -5
  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 +1 -2
  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 +67 -5
  45. package/dist/providers/google-gemini.js +13 -3
  46. package/dist/providers/google-genai.d.ts +0 -1
  47. package/dist/providers/google-genai.js +2 -3
  48. package/dist/providers/index.d.ts +0 -1
  49. package/dist/providers/index.js +27 -2
  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 +2 -3
  58. package/dist/runtime/actions/context.d.ts +0 -1
  59. package/dist/runtime/actions/context.js +25 -2
  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 +18 -19
  97. package/dist-cjs/amarsia/sync.js +1 -2
  98. package/dist-cjs/cli-agents-template.js +1 -2
  99. package/dist-cjs/compiler/build-project.js +24 -25
  100. package/dist-cjs/compiler/compile.js +31 -32
  101. package/dist-cjs/env.js +10 -8
  102. package/dist-cjs/errors.js +1 -2
  103. package/dist-cjs/file-content.js +6 -7
  104. package/dist-cjs/index.js +1 -2
  105. package/dist-cjs/integrations/esbuild.js +4 -5
  106. package/dist-cjs/orcha.js +4 -5
  107. package/dist-cjs/playground/server.js +34 -31
  108. package/dist-cjs/playground/source.js +11 -12
  109. package/dist-cjs/project-loader.js +11 -12
  110. package/dist-cjs/providers/anthropic.js +1 -2
  111. package/dist-cjs/providers/bedrock.js +8 -9
  112. package/dist-cjs/providers/catalog.js +1 -2
  113. package/dist-cjs/providers/deepseek.js +1 -2
  114. package/dist-cjs/providers/dispatcher.js +1 -2
  115. package/dist-cjs/providers/google-gemini.js +13 -4
  116. package/dist-cjs/providers/google-genai.js +2 -3
  117. package/dist-cjs/providers/index.js +25 -2
  118. package/dist-cjs/providers/openai.js +1 -2
  119. package/dist-cjs/providers/sse.js +1 -2
  120. package/dist-cjs/providers/types.js +1 -2
  121. package/dist-cjs/providers/vertex-ai.js +6 -3
  122. package/dist-cjs/runtime/actions/context.js +26 -3
  123. package/dist-cjs/runtime/actions/execute.js +17 -3
  124. package/dist-cjs/runtime/actions/native.js +3 -4
  125. package/dist-cjs/runtime/actions/sandbox.js +1 -2
  126. package/dist-cjs/runtime/agent.js +3 -4
  127. package/dist-cjs/runtime/context.js +1 -2
  128. package/dist-cjs/runtime/create-orcha.js +3 -4
  129. package/dist-cjs/runtime/execution.js +1 -2
  130. package/dist-cjs/runtime/session-events.js +1 -2
  131. package/dist-cjs/runtime/structured-output.js +1 -2
  132. package/dist-cjs/storage/browser-indexeddb.js +1 -2
  133. package/dist-cjs/storage/create-store.js +1 -2
  134. package/dist-cjs/storage/edge-store.js +1 -2
  135. package/dist-cjs/storage/migrate.js +1 -2
  136. package/dist-cjs/storage/node-jsonl.js +10 -11
  137. package/dist-cjs/storage/node-sqlite.js +8 -9
  138. package/dist-cjs/storage/react-native-jsonl.js +1 -2
  139. package/dist-cjs/testing.js +17 -18
  140. package/dist-cjs/types/google-genai-sdk.d.js +2 -0
  141. package/dist-cjs/types.js +1 -2
  142. package/package.json +40 -12
  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.js.map +0 -7
@@ -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
@@ -1,4 +1,4 @@
1
- "use strict"; const __orchaImportMetaUrl = require("node:url").pathToFileURL(__filename).href;
1
+ "use strict"; const __orchaImportMetaUrl = require("url").pathToFileURL(__filename).href;
2
2
  "use strict";
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -22,9 +22,9 @@ __export(metadata_exports, {
22
22
  createAmarsiaProjectMetadata: () => createAmarsiaProjectMetadata
23
23
  });
24
24
  module.exports = __toCommonJS(metadata_exports);
25
- var import_node_crypto = require("node:crypto");
26
- var import_node_fs = require("node:fs");
27
- var import_node_path = require("node:path");
25
+ var import_crypto = require("crypto");
26
+ var import_fs = require("fs");
27
+ var import_path = require("path");
28
28
  function createAmarsiaProjectMetadata(bundle, projectRoot) {
29
29
  const packageInfo = readPackageInfo(projectRoot);
30
30
  const projectExternalId = hashStable({
@@ -127,12 +127,12 @@ function actionMetadata(key, action) {
127
127
  };
128
128
  }
129
129
  function readPackageInfo(projectRoot) {
130
- const packagePath = (0, import_node_path.join)(projectRoot, "package.json");
131
- if (!(0, import_node_fs.existsSync)(packagePath)) {
130
+ const packagePath = (0, import_path.join)(projectRoot, "package.json");
131
+ if (!(0, import_fs.existsSync)(packagePath)) {
132
132
  return { repositoryUrl: normalizeRepositoryUrl(readGitRemoteUrl(projectRoot)) };
133
133
  }
134
134
  try {
135
- const parsed = JSON.parse((0, import_node_fs.readFileSync)(packagePath, "utf8"));
135
+ const parsed = JSON.parse((0, import_fs.readFileSync)(packagePath, "utf8"));
136
136
  return {
137
137
  name: typeof parsed.name === "string" ? parsed.name : void 0,
138
138
  description: typeof parsed.description === "string" ? parsed.description : void 0,
@@ -156,30 +156,30 @@ function readPackageRepositoryUrl(repository) {
156
156
  }
157
157
  function readGitRemoteUrl(projectRoot) {
158
158
  const configPath = resolveGitConfigPath(projectRoot);
159
- if (!configPath || !(0, import_node_fs.existsSync)(configPath)) {
159
+ if (!configPath || !(0, import_fs.existsSync)(configPath)) {
160
160
  return void 0;
161
161
  }
162
- const config = (0, import_node_fs.readFileSync)(configPath, "utf8");
162
+ const config = (0, import_fs.readFileSync)(configPath, "utf8");
163
163
  const origin = config.match(/\[remote "origin"\][\s\S]*?\n\s*url = (.+)/);
164
164
  return origin?.[1]?.trim();
165
165
  }
166
166
  function resolveGitConfigPath(projectRoot) {
167
- let directory = (0, import_node_path.resolve)(projectRoot);
167
+ let directory = (0, import_path.resolve)(projectRoot);
168
168
  while (true) {
169
- const gitPath = (0, import_node_path.join)(directory, ".git");
170
- if ((0, import_node_fs.existsSync)(gitPath)) {
169
+ const gitPath = (0, import_path.join)(directory, ".git");
170
+ if ((0, import_fs.existsSync)(gitPath)) {
171
171
  try {
172
- const gitFile = (0, import_node_fs.readFileSync)(gitPath, "utf8");
172
+ const gitFile = (0, import_fs.readFileSync)(gitPath, "utf8");
173
173
  const gitDir = gitFile.match(/^gitdir: (.+)$/m)?.[1]?.trim();
174
174
  if (gitDir) {
175
- return (0, import_node_path.join)((0, import_node_path.resolve)(directory, gitDir), "config");
175
+ return (0, import_path.join)((0, import_path.resolve)(directory, gitDir), "config");
176
176
  }
177
177
  } catch {
178
- return (0, import_node_path.join)(gitPath, "config");
178
+ return (0, import_path.join)(gitPath, "config");
179
179
  }
180
- return (0, import_node_path.join)((0, import_node_path.dirname)(gitPath), ".git", "config");
180
+ return (0, import_path.join)((0, import_path.dirname)(gitPath), ".git", "config");
181
181
  }
182
- const parent = (0, import_node_path.dirname)(directory);
182
+ const parent = (0, import_path.dirname)(directory);
183
183
  if (parent === directory) {
184
184
  return void 0;
185
185
  }
@@ -190,7 +190,7 @@ function normalizeRepositoryUrl(url) {
190
190
  return url?.replace(/^git\+/, "").replace(/^git@github\.com:/, "https://github.com/").replace(/\.git$/, "");
191
191
  }
192
192
  function hashStable(value) {
193
- return (0, import_node_crypto.createHash)("sha256").update(JSON.stringify(sortStable(value))).digest("hex");
193
+ return (0, import_crypto.createHash)("sha256").update(JSON.stringify(sortStable(value))).digest("hex");
194
194
  }
195
195
  function sortStable(value) {
196
196
  if (Array.isArray(value)) {
@@ -207,4 +207,3 @@ function sortStable(value) {
207
207
  0 && (module.exports = {
208
208
  createAmarsiaProjectMetadata
209
209
  });
210
- //# sourceMappingURL=metadata.js.map
@@ -1,4 +1,4 @@
1
- "use strict"; const __orchaImportMetaUrl = require("node:url").pathToFileURL(__filename).href;
1
+ "use strict"; const __orchaImportMetaUrl = require("url").pathToFileURL(__filename).href;
2
2
  "use strict";
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -68,4 +68,3 @@ async function postProjectMetadata(options) {
68
68
  0 && (module.exports = {
69
69
  syncAmarsiaProject
70
70
  });
71
- //# sourceMappingURL=sync.js.map
@@ -1,4 +1,4 @@
1
- "use strict"; const __orchaImportMetaUrl = require("node:url").pathToFileURL(__filename).href;
1
+ "use strict"; const __orchaImportMetaUrl = require("url").pathToFileURL(__filename).href;
2
2
  "use strict";
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -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
@@ -1,4 +1,4 @@
1
- "use strict"; const __orchaImportMetaUrl = require("node:url").pathToFileURL(__filename).href;
1
+ "use strict"; const __orchaImportMetaUrl = require("url").pathToFileURL(__filename).href;
2
2
  "use strict";
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -22,28 +22,28 @@ __export(build_project_exports, {
22
22
  buildProject: () => buildProject
23
23
  });
24
24
  module.exports = __toCommonJS(build_project_exports);
25
- var import_node_fs = require("node:fs");
26
- var import_promises = require("node:fs/promises");
27
- var import_node_path = require("node:path");
28
- var import_node_url = require("node:url");
25
+ var import_fs = require("fs");
26
+ var import_promises = require("fs/promises");
27
+ var import_path = require("path");
28
+ var import_url = require("url");
29
29
  var import_esbuild = require("esbuild");
30
30
  var import_orcha = require("../orcha.js");
31
31
  var import_catalog = require("../providers/catalog.js");
32
32
  async function buildProject(options = {}) {
33
- const projectRoot = (0, import_node_path.resolve)(options.projectRoot ?? process.cwd());
34
- const registryPath = (0, import_node_path.resolve)(projectRoot, "orcha/index.ts");
35
- if (!(0, import_node_fs.existsSync)(registryPath)) {
33
+ const projectRoot = (0, import_path.resolve)(options.projectRoot ?? process.cwd());
34
+ const registryPath = (0, import_path.resolve)(projectRoot, "orcha/index.ts");
35
+ if (!(0, import_fs.existsSync)(registryPath)) {
36
36
  throw new Error('Missing "orcha/index.ts". Run "orcha init" first.');
37
37
  }
38
- const temporaryDirectory = (0, import_node_path.resolve)(projectRoot, ".orcha/.build");
39
- const registryBundlePath = (0, import_node_path.resolve)(temporaryDirectory, "registry.mjs");
40
- const productionEntryPath = (0, import_node_path.resolve)(
38
+ const temporaryDirectory = (0, import_path.resolve)(projectRoot, ".orcha/.build");
39
+ const registryBundlePath = (0, import_path.resolve)(temporaryDirectory, "registry.mjs");
40
+ const productionEntryPath = (0, import_path.resolve)(
41
41
  temporaryDirectory,
42
42
  "production-entry.mjs"
43
43
  );
44
- const outputPath = (0, import_node_path.resolve)(projectRoot, ".orcha/dist/bundle.js");
44
+ const outputPath = (0, import_path.resolve)(projectRoot, ".orcha/dist/bundle.js");
45
45
  await (0, import_promises.mkdir)(temporaryDirectory, { recursive: true });
46
- await (0, import_promises.mkdir)((0, import_node_path.dirname)(outputPath), { recursive: true });
46
+ await (0, import_promises.mkdir)((0, import_path.dirname)(outputPath), { recursive: true });
47
47
  try {
48
48
  await (0, import_esbuild.build)({
49
49
  entryPoints: [registryPath],
@@ -51,7 +51,7 @@ async function buildProject(options = {}) {
51
51
  bundle: true,
52
52
  format: "esm",
53
53
  platform: "node",
54
- target: "node20",
54
+ target: "node18",
55
55
  packages: "external",
56
56
  logLevel: "silent"
57
57
  });
@@ -60,7 +60,7 @@ async function buildProject(options = {}) {
60
60
  process.env.ORCHA_COMPILING = "1";
61
61
  process.env.ORCHA_PROJECT_ROOT = projectRoot;
62
62
  try {
63
- await import(`${(0, import_node_url.pathToFileURL)(registryBundlePath).href}?time=${Date.now()}`);
63
+ await import(`${(0, import_url.pathToFileURL)(registryBundlePath).href}?time=${Date.now()}`);
64
64
  } finally {
65
65
  if (previousCompiling === void 0) {
66
66
  delete process.env.ORCHA_COMPILING;
@@ -74,12 +74,12 @@ async function buildProject(options = {}) {
74
74
  }
75
75
  }
76
76
  const compiledBundle = import_orcha.orcha.getCompiledBundle();
77
- const runtimeFactoryPath = (0, import_node_path.resolve)(
78
- (0, import_node_path.dirname)((0, import_node_url.fileURLToPath)(__orchaImportMetaUrl)),
77
+ const runtimeFactoryPath = (0, import_path.resolve)(
78
+ (0, import_path.dirname)((0, import_url.fileURLToPath)(__orchaImportMetaUrl)),
79
79
  "../runtime/create-orcha.js"
80
80
  ).replaceAll("\\", "/");
81
- const providerDispatcherPath = (0, import_node_path.resolve)(
82
- (0, import_node_path.dirname)((0, import_node_url.fileURLToPath)(__orchaImportMetaUrl)),
81
+ const providerDispatcherPath = (0, import_path.resolve)(
82
+ (0, import_path.dirname)((0, import_url.fileURLToPath)(__orchaImportMetaUrl)),
83
83
  "../providers/dispatcher.js"
84
84
  ).replaceAll("\\", "/");
85
85
  const includedProviders = [
@@ -114,7 +114,7 @@ async function buildProject(options = {}) {
114
114
  bundle: true,
115
115
  format: "esm",
116
116
  platform: "node",
117
- target: "node20",
117
+ target: "node18",
118
118
  minify: true,
119
119
  legalComments: "none",
120
120
  define: {
@@ -125,7 +125,7 @@ async function buildProject(options = {}) {
125
125
  ...needsNodeRequire ? {
126
126
  banner: {
127
127
  js: [
128
- 'import { createRequire as __orchaCreateRequire } from "node:module";',
128
+ 'import { createRequire as __orchaCreateRequire } from "module";',
129
129
  "const require = __orchaCreateRequire(import.meta.url);"
130
130
  ].join("\n")
131
131
  }
@@ -147,8 +147,8 @@ function allCompiledAgents(agents) {
147
147
  ]);
148
148
  }
149
149
  function createProviderRuntimeSource(providerNames) {
150
- const providersDirectory = (0, import_node_path.resolve)(
151
- (0, import_node_path.dirname)((0, import_node_url.fileURLToPath)(__orchaImportMetaUrl)),
150
+ const providersDirectory = (0, import_path.resolve)(
151
+ (0, import_path.dirname)((0, import_url.fileURLToPath)(__orchaImportMetaUrl)),
152
152
  "../providers"
153
153
  );
154
154
  const imports = [];
@@ -161,7 +161,7 @@ function createProviderRuntimeSource(providerNames) {
161
161
  const localName = `provider${index}`;
162
162
  imports.push(
163
163
  `import { ${descriptor.exportName} as ${localName} } from ${JSON.stringify(
164
- (0, import_node_path.resolve)(providersDirectory, descriptor.moduleFile)
164
+ (0, import_path.resolve)(providersDirectory, descriptor.moduleFile)
165
165
  )};`
166
166
  );
167
167
  entries.push(`${JSON.stringify(name)}: ${localName}`);
@@ -177,4 +177,3 @@ function createProviderRuntimeSource(providerNames) {
177
177
  0 && (module.exports = {
178
178
  buildProject
179
179
  });
180
- //# sourceMappingURL=build-project.js.map
@@ -1,4 +1,4 @@
1
- "use strict"; const __orchaImportMetaUrl = require("node:url").pathToFileURL(__filename).href;
1
+ "use strict"; const __orchaImportMetaUrl = require("url").pathToFileURL(__filename).href;
2
2
  "use strict";
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -23,9 +23,9 @@ __export(compile_exports, {
23
23
  serializeBundle: () => serializeBundle
24
24
  });
25
25
  module.exports = __toCommonJS(compile_exports);
26
- var import_node_crypto = require("node:crypto");
27
- var import_node_fs = require("node:fs");
28
- var import_node_path = require("node:path");
26
+ var import_crypto = require("crypto");
27
+ var import_fs = require("fs");
28
+ var import_path = require("path");
29
29
  var import_esbuild = require("esbuild");
30
30
  var import_catalog = require("../providers/catalog.js");
31
31
  function compileRegistry(registrations, registryRoot, actionRuntime = "native") {
@@ -110,12 +110,12 @@ function normalizeAgentRegistration(key, registration) {
110
110
  }
111
111
  function compileAgent(key, registeredPath, registryRoot, actionRuntime) {
112
112
  const name = key;
113
- const sourceDirectory = (0, import_node_path.resolve)(registryRoot, registeredPath);
114
- const configPath = (0, import_node_path.resolve)(sourceDirectory, "index.json");
113
+ const sourceDirectory = (0, import_path.resolve)(registryRoot, registeredPath);
114
+ const configPath = (0, import_path.resolve)(sourceDirectory, "index.json");
115
115
  let configuration;
116
116
  try {
117
117
  configuration = JSON.parse(
118
- (0, import_node_fs.readFileSync)(configPath, "utf8")
118
+ (0, import_fs.readFileSync)(configPath, "utf8")
119
119
  );
120
120
  } catch (error) {
121
121
  throw new Error(
@@ -170,10 +170,10 @@ function compileAgent(key, registeredPath, registryRoot, actionRuntime) {
170
170
  `Agent "${name}" must configure outputSchema when outputType is "json".`
171
171
  );
172
172
  }
173
- const instructionsPath = (0, import_node_path.resolve)(sourceDirectory, "instructions.md");
173
+ const instructionsPath = (0, import_path.resolve)(sourceDirectory, "instructions.md");
174
174
  let systemPrompt;
175
175
  try {
176
- systemPrompt = (0, import_node_fs.readFileSync)(instructionsPath, "utf8").trim();
176
+ systemPrompt = (0, import_fs.readFileSync)(instructionsPath, "utf8").trim();
177
177
  } catch (error) {
178
178
  throw new Error(
179
179
  `Agent "${name}" is missing required instructions.md at ${instructionsPath}.`,
@@ -203,16 +203,16 @@ function compileAgent(key, registeredPath, registryRoot, actionRuntime) {
203
203
  });
204
204
  }
205
205
  function compileActions(agentName, sourceDirectory, actionRuntime) {
206
- const actionsDirectory = (0, import_node_path.resolve)(sourceDirectory, "actions");
207
- if (!(0, import_node_fs.existsSync)(actionsDirectory)) {
206
+ const actionsDirectory = (0, import_path.resolve)(sourceDirectory, "actions");
207
+ if (!(0, import_fs.existsSync)(actionsDirectory)) {
208
208
  return {};
209
209
  }
210
210
  const actions = {};
211
- for (const entry of (0, import_node_fs.readdirSync)(actionsDirectory, { withFileTypes: true })) {
211
+ for (const entry of (0, import_fs.readdirSync)(actionsDirectory, { withFileTypes: true })) {
212
212
  if (!entry.isDirectory()) {
213
213
  continue;
214
214
  }
215
- const configurationPath = (0, import_node_path.resolve)(
215
+ const configurationPath = (0, import_path.resolve)(
216
216
  actionsDirectory,
217
217
  entry.name,
218
218
  "index.json"
@@ -220,7 +220,7 @@ function compileActions(agentName, sourceDirectory, actionRuntime) {
220
220
  let configuration;
221
221
  try {
222
222
  configuration = JSON.parse(
223
- (0, import_node_fs.readFileSync)(configurationPath, "utf8")
223
+ (0, import_fs.readFileSync)(configurationPath, "utf8")
224
224
  );
225
225
  } catch (error) {
226
226
  throw new Error(
@@ -318,19 +318,19 @@ function compileActions(agentName, sourceDirectory, actionRuntime) {
318
318
  return Object.freeze(actions);
319
319
  }
320
320
  function compileSkills(agentName, sourceDirectory) {
321
- const skillsDirectory = (0, import_node_path.resolve)(sourceDirectory, "skills");
322
- if (!(0, import_node_fs.existsSync)(skillsDirectory)) {
321
+ const skillsDirectory = (0, import_path.resolve)(sourceDirectory, "skills");
322
+ if (!(0, import_fs.existsSync)(skillsDirectory)) {
323
323
  return {};
324
324
  }
325
325
  rejectLegacyRegistry(agentName, skillsDirectory, "skills");
326
326
  const skills = {};
327
327
  for (const entry of discoverDirectories(skillsDirectory)) {
328
- const skillDirectory = (0, import_node_path.resolve)(skillsDirectory, entry);
329
- const configurationPath = (0, import_node_path.resolve)(skillDirectory, "index.json");
328
+ const skillDirectory = (0, import_path.resolve)(skillsDirectory, entry);
329
+ const configurationPath = (0, import_path.resolve)(skillDirectory, "index.json");
330
330
  let configuration;
331
331
  try {
332
332
  configuration = JSON.parse(
333
- (0, import_node_fs.readFileSync)(configurationPath, "utf8")
333
+ (0, import_fs.readFileSync)(configurationPath, "utf8")
334
334
  );
335
335
  } catch (error) {
336
336
  throw new Error(
@@ -343,10 +343,10 @@ function compileSkills(agentName, sourceDirectory) {
343
343
  continue;
344
344
  }
345
345
  validateSkillConfiguration(agentName, entry, configuration);
346
- const instructionsPath = (0, import_node_path.resolve)(skillDirectory, "instructions.md");
346
+ const instructionsPath = (0, import_path.resolve)(skillDirectory, "instructions.md");
347
347
  let instructions;
348
348
  try {
349
- instructions = (0, import_node_fs.readFileSync)(instructionsPath, "utf8").trim();
349
+ instructions = (0, import_fs.readFileSync)(instructionsPath, "utf8").trim();
350
350
  } catch (error) {
351
351
  throw new Error(
352
352
  `Skill "${agentName}/${entry}" is missing instructions.md at ${instructionsPath}.`,
@@ -372,19 +372,19 @@ function compileSkills(agentName, sourceDirectory) {
372
372
  return Object.freeze(skills);
373
373
  }
374
374
  function compileEvaluations(agentName, sourceDirectory) {
375
- const evaluationsDirectory = (0, import_node_path.resolve)(sourceDirectory, "evaluations");
376
- if (!(0, import_node_fs.existsSync)(evaluationsDirectory)) {
375
+ const evaluationsDirectory = (0, import_path.resolve)(sourceDirectory, "evaluations");
376
+ if (!(0, import_fs.existsSync)(evaluationsDirectory)) {
377
377
  return {};
378
378
  }
379
379
  rejectLegacyRegistry(agentName, evaluationsDirectory, "evaluations");
380
380
  const evaluations = {};
381
381
  for (const entry of discoverDirectories(evaluationsDirectory)) {
382
- const evaluationDirectory = (0, import_node_path.resolve)(evaluationsDirectory, entry);
383
- const configurationPath = (0, import_node_path.resolve)(evaluationDirectory, "index.json");
382
+ const evaluationDirectory = (0, import_path.resolve)(evaluationsDirectory, entry);
383
+ const configurationPath = (0, import_path.resolve)(evaluationDirectory, "index.json");
384
384
  let configuration;
385
385
  try {
386
386
  configuration = JSON.parse(
387
- (0, import_node_fs.readFileSync)(configurationPath, "utf8")
387
+ (0, import_fs.readFileSync)(configurationPath, "utf8")
388
388
  );
389
389
  } catch (error) {
390
390
  throw new Error(
@@ -418,10 +418,10 @@ function compileEvaluations(agentName, sourceDirectory) {
418
418
  return Object.freeze(evaluations);
419
419
  }
420
420
  function discoverDirectories(directory) {
421
- return (0, import_node_fs.readdirSync)(directory, { withFileTypes: true }).filter((entry) => entry.isDirectory() && !entry.name.startsWith(".")).map((entry) => entry.name).sort();
421
+ return (0, import_fs.readdirSync)(directory, { withFileTypes: true }).filter((entry) => entry.isDirectory() && !entry.name.startsWith(".")).map((entry) => entry.name).sort();
422
422
  }
423
423
  function rejectLegacyRegistry(agentName, directory, collection) {
424
- if ((0, import_node_fs.existsSync)((0, import_node_path.resolve)(directory, "index.js"))) {
424
+ if ((0, import_fs.existsSync)((0, import_path.resolve)(directory, "index.js"))) {
425
425
  throw new Error(
426
426
  `Agent "${agentName}" ${collection}/index.js is no longer supported. Remove the registry; folders are discovered automatically and can be disabled with "enabled": false.`
427
427
  );
@@ -499,8 +499,8 @@ function validateEvaluationConfiguration(agentName, registrationName, configurat
499
499
  }
500
500
  }
501
501
  function compileLocalAction(agentName, directoryName, actionsDirectory, actionRuntime) {
502
- const entryPath = (0, import_node_path.resolve)(actionsDirectory, directoryName, "index.js");
503
- if (!(0, import_node_fs.existsSync)(entryPath)) {
502
+ const entryPath = (0, import_path.resolve)(actionsDirectory, directoryName, "index.js");
503
+ if (!(0, import_fs.existsSync)(entryPath)) {
504
504
  throw new Error(
505
505
  `Local action "${agentName}/${directoryName}" requires index.js.`
506
506
  );
@@ -531,7 +531,7 @@ function compileLocalAction(agentName, directoryName, actionsDirectory, actionRu
531
531
  }
532
532
  return {
533
533
  source: output,
534
- sourceHash: (0, import_node_crypto.createHash)("sha256").update(output).digest("hex")
534
+ sourceHash: (0, import_crypto.createHash)("sha256").update(output).digest("hex")
535
535
  };
536
536
  }
537
537
  function serializeBundle(bundle) {
@@ -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
@@ -1,4 +1,4 @@
1
- "use strict"; const __orchaImportMetaUrl = require("node:url").pathToFileURL(__filename).href;
1
+ "use strict"; const __orchaImportMetaUrl = require("url").pathToFileURL(__filename).href;
2
2
  "use strict";
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -22,17 +22,19 @@ __export(env_exports, {
22
22
  loadProjectEnvironment: () => loadProjectEnvironment
23
23
  });
24
24
  module.exports = __toCommonJS(env_exports);
25
- var import_node_fs = require("node:fs");
26
- var import_node_path = require("node:path");
27
- var import_node_process = require("node:process");
25
+ var import_fs = require("fs");
26
+ var import_path = require("path");
27
+ var import_dotenv = require("dotenv");
28
28
  function loadProjectEnvironment(projectRoot) {
29
- const path = (0, import_node_path.resolve)(projectRoot, ".env");
30
- if ((0, import_node_fs.existsSync)(path)) {
31
- (0, import_node_process.loadEnvFile)(path);
29
+ const path = (0, import_path.resolve)(projectRoot, ".env");
30
+ if ((0, import_fs.existsSync)(path)) {
31
+ const result = (0, import_dotenv.config)({ path, override: false, quiet: true });
32
+ if (result.error) {
33
+ throw result.error;
34
+ }
32
35
  }
33
36
  }
34
37
  // Annotate the CommonJS export names for ESM import in node:
35
38
  0 && (module.exports = {
36
39
  loadProjectEnvironment
37
40
  });
38
- //# sourceMappingURL=env.js.map
@@ -1,4 +1,4 @@
1
- "use strict"; const __orchaImportMetaUrl = require("node:url").pathToFileURL(__filename).href;
1
+ "use strict"; const __orchaImportMetaUrl = require("url").pathToFileURL(__filename).href;
2
2
  "use strict";
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -38,4 +38,3 @@ class OrchaError extends Error {
38
38
  0 && (module.exports = {
39
39
  OrchaError
40
40
  });
41
- //# sourceMappingURL=errors.js.map
@@ -1,4 +1,4 @@
1
- "use strict"; const __orchaImportMetaUrl = require("node:url").pathToFileURL(__filename).href;
1
+ "use strict"; const __orchaImportMetaUrl = require("url").pathToFileURL(__filename).href;
2
2
  "use strict";
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -24,8 +24,8 @@ __export(file_content_exports, {
24
24
  readLocalFileContent: () => readLocalFileContent
25
25
  });
26
26
  module.exports = __toCommonJS(file_content_exports);
27
- var import_promises = require("node:fs/promises");
28
- var import_node_path = require("node:path");
27
+ var import_promises = require("fs/promises");
28
+ var import_path = require("path");
29
29
  const MIME_TYPES = {
30
30
  ".csv": "text/csv",
31
31
  ".doc": "application/msword",
@@ -48,7 +48,7 @@ const MIME_TYPES = {
48
48
  ".xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
49
49
  };
50
50
  function normalizeLocalFile(filePath, mimeType, projectRoot = process.cwd()) {
51
- const absolutePath = (0, import_node_path.resolve)(projectRoot, filePath);
51
+ const absolutePath = (0, import_path.resolve)(projectRoot, filePath);
52
52
  return {
53
53
  type: "file",
54
54
  filePath: absolutePath,
@@ -78,14 +78,14 @@ async function readLocalFileContent(content) {
78
78
  bytes,
79
79
  base64,
80
80
  dataUri: `data:${content.mimeType};base64,${base64}`,
81
- fileName: (0, import_node_path.basename)(content.filePath)
81
+ fileName: (0, import_path.basename)(content.filePath)
82
82
  };
83
83
  }
84
84
  function normalizeMimeType(mimeType, source) {
85
85
  if (mimeType?.trim()) {
86
86
  return mimeType.trim().toLowerCase();
87
87
  }
88
- const inferred = MIME_TYPES[(0, import_node_path.extname)(source).toLowerCase()];
88
+ const inferred = MIME_TYPES[(0, import_path.extname)(source).toLowerCase()];
89
89
  if (!inferred) {
90
90
  throw new Error(
91
91
  `Could not infer a MIME type for "${source}". Provide mimeType explicitly.`
@@ -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
@@ -1,4 +1,4 @@
1
- "use strict"; const __orchaImportMetaUrl = require("node:url").pathToFileURL(__filename).href;
1
+ "use strict"; const __orchaImportMetaUrl = require("url").pathToFileURL(__filename).href;
2
2
  "use strict";
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -41,4 +41,3 @@ var import_migrate = require("./storage/migrate.js");
41
41
  migrateSessionStore,
42
42
  orcha
43
43
  });
44
- //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- "use strict"; const __orchaImportMetaUrl = require("node:url").pathToFileURL(__filename).href;
1
+ "use strict"; const __orchaImportMetaUrl = require("url").pathToFileURL(__filename).href;
2
2
  "use strict";
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -22,11 +22,11 @@ __export(esbuild_exports, {
22
22
  orchaPlugin: () => orchaPlugin
23
23
  });
24
24
  module.exports = __toCommonJS(esbuild_exports);
25
- var import_node_path = require("node:path");
25
+ var import_path = require("path");
26
26
  var import_build_project = require("../compiler/build-project.js");
27
27
  function orchaPlugin(options = {}) {
28
- const projectRoot = (0, import_node_path.resolve)(options.projectRoot ?? process.cwd());
29
- const generatedBundle = (0, import_node_path.resolve)(projectRoot, ".orcha/dist/bundle.js");
28
+ const projectRoot = (0, import_path.resolve)(options.projectRoot ?? process.cwd());
29
+ const generatedBundle = (0, import_path.resolve)(projectRoot, ".orcha/dist/bundle.js");
30
30
  return {
31
31
  name: "orchajs",
32
32
  setup(builder) {
@@ -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
@@ -1,4 +1,4 @@
1
- "use strict"; const __orchaImportMetaUrl = require("node:url").pathToFileURL(__filename).href;
1
+ "use strict"; const __orchaImportMetaUrl = require("url").pathToFileURL(__filename).href;
2
2
  "use strict";
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -22,7 +22,7 @@ __export(orcha_exports, {
22
22
  orcha: () => orcha
23
23
  });
24
24
  module.exports = __toCommonJS(orcha_exports);
25
- var import_node_path = require("node:path");
25
+ var import_path = require("path");
26
26
  var import_compile = require("./compiler/compile.js");
27
27
  var import_providers = require("./providers/index.js");
28
28
  var import_create_orcha = require("./runtime/create-orcha.js");
@@ -33,10 +33,10 @@ const orcha = (0, import_create_orcha.createOrcha)(
33
33
  "ORCHA_PRODUCTION_BUNDLE_MISSING: configure the Orcha integration in your application build."
34
34
  );
35
35
  }
36
- const projectRoot = (0, import_node_path.resolve)(
36
+ const projectRoot = (0, import_path.resolve)(
37
37
  configuration.root ?? process.env.ORCHA_PROJECT_ROOT ?? process.cwd()
38
38
  );
39
- const registryRoot = (0, import_node_path.resolve)(projectRoot, "orcha");
39
+ const registryRoot = (0, import_path.resolve)(projectRoot, "orcha");
40
40
  return (0, import_compile.compileRegistry)(
41
41
  configuration.agents,
42
42
  registryRoot,
@@ -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