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.
- package/README.md +70 -9
- package/dist/amarsia/metadata.d.ts +0 -1
- package/dist/amarsia/metadata.js +0 -1
- package/dist/amarsia/sync.d.ts +0 -1
- package/dist/amarsia/sync.js +0 -1
- package/dist/cli-agents-template.d.ts +0 -1
- package/dist/cli-agents-template.js +0 -1
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +4 -5
- package/dist/compiler/build-project.d.ts +0 -1
- package/dist/compiler/build-project.js +2 -3
- package/dist/compiler/compile.d.ts +0 -1
- package/dist/compiler/compile.js +0 -1
- package/dist/env.d.ts +0 -1
- package/dist/env.js +5 -3
- package/dist/errors.d.ts +0 -1
- package/dist/errors.js +0 -1
- package/dist/file-content.d.ts +0 -1
- package/dist/file-content.js +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/integrations/esbuild.d.ts +0 -1
- package/dist/integrations/esbuild.js +0 -1
- package/dist/orcha.d.ts +0 -1
- package/dist/orcha.js +0 -1
- package/dist/playground/public/app.css +0 -1
- package/dist/playground/public/app.js +9 -10
- package/dist/playground/server.d.ts +0 -1
- package/dist/playground/server.js +9 -5
- package/dist/playground/source.d.ts +0 -1
- package/dist/playground/source.js +0 -1
- package/dist/project-loader.d.ts +0 -1
- package/dist/project-loader.js +1 -2
- package/dist/providers/anthropic.d.ts +0 -1
- package/dist/providers/anthropic.js +0 -1
- package/dist/providers/bedrock.d.ts +0 -1
- package/dist/providers/bedrock.js +0 -1
- package/dist/providers/catalog.d.ts +0 -1
- package/dist/providers/catalog.js +0 -1
- package/dist/providers/deepseek.d.ts +0 -1
- package/dist/providers/deepseek.js +0 -1
- package/dist/providers/dispatcher.d.ts +0 -1
- package/dist/providers/dispatcher.js +0 -1
- package/dist/providers/google-gemini.d.ts +67 -5
- package/dist/providers/google-gemini.js +13 -3
- package/dist/providers/google-genai.d.ts +0 -1
- package/dist/providers/google-genai.js +2 -3
- package/dist/providers/index.d.ts +0 -1
- package/dist/providers/index.js +27 -2
- package/dist/providers/openai.d.ts +0 -1
- package/dist/providers/openai.js +0 -1
- package/dist/providers/sse.d.ts +0 -1
- package/dist/providers/sse.js +0 -1
- package/dist/providers/types.d.ts +0 -1
- package/dist/providers/types.js +0 -1
- package/dist/providers/vertex-ai.d.ts +0 -1
- package/dist/providers/vertex-ai.js +2 -3
- package/dist/runtime/actions/context.d.ts +0 -1
- package/dist/runtime/actions/context.js +25 -2
- package/dist/runtime/actions/execute.d.ts +0 -1
- package/dist/runtime/actions/execute.js +14 -2
- package/dist/runtime/actions/native.d.ts +0 -1
- package/dist/runtime/actions/native.js +0 -1
- package/dist/runtime/actions/sandbox.d.ts +0 -1
- package/dist/runtime/actions/sandbox.js +0 -1
- package/dist/runtime/agent.d.ts +0 -1
- package/dist/runtime/agent.js +0 -1
- package/dist/runtime/context.d.ts +0 -1
- package/dist/runtime/context.js +0 -1
- package/dist/runtime/create-orcha.d.ts +0 -1
- package/dist/runtime/create-orcha.js +0 -1
- package/dist/runtime/execution.d.ts +0 -1
- package/dist/runtime/execution.js +0 -1
- package/dist/runtime/session-events.d.ts +0 -1
- package/dist/runtime/session-events.js +0 -1
- package/dist/runtime/structured-output.d.ts +0 -1
- package/dist/runtime/structured-output.js +0 -1
- package/dist/storage/browser-indexeddb.d.ts +0 -1
- package/dist/storage/browser-indexeddb.js +0 -1
- package/dist/storage/create-store.d.ts +0 -1
- package/dist/storage/create-store.js +0 -1
- package/dist/storage/edge-store.d.ts +0 -1
- package/dist/storage/edge-store.js +0 -1
- package/dist/storage/migrate.d.ts +0 -1
- package/dist/storage/migrate.js +0 -1
- package/dist/storage/node-jsonl.d.ts +0 -1
- package/dist/storage/node-jsonl.js +0 -1
- package/dist/storage/node-sqlite.d.ts +0 -1
- package/dist/storage/node-sqlite.js +1 -2
- package/dist/storage/react-native-jsonl.d.ts +0 -1
- package/dist/storage/react-native-jsonl.js +0 -1
- package/dist/testing.d.ts +0 -1
- package/dist/testing.js +0 -1
- package/dist/types.d.ts +0 -1
- package/dist/types.js +0 -1
- package/dist-cjs/amarsia/metadata.js +18 -19
- package/dist-cjs/amarsia/sync.js +1 -2
- package/dist-cjs/cli-agents-template.js +1 -2
- package/dist-cjs/compiler/build-project.js +24 -25
- package/dist-cjs/compiler/compile.js +31 -32
- package/dist-cjs/env.js +10 -8
- package/dist-cjs/errors.js +1 -2
- package/dist-cjs/file-content.js +6 -7
- package/dist-cjs/index.js +1 -2
- package/dist-cjs/integrations/esbuild.js +4 -5
- package/dist-cjs/orcha.js +4 -5
- package/dist-cjs/playground/server.js +34 -31
- package/dist-cjs/playground/source.js +11 -12
- package/dist-cjs/project-loader.js +11 -12
- package/dist-cjs/providers/anthropic.js +1 -2
- package/dist-cjs/providers/bedrock.js +8 -9
- package/dist-cjs/providers/catalog.js +1 -2
- package/dist-cjs/providers/deepseek.js +1 -2
- package/dist-cjs/providers/dispatcher.js +1 -2
- package/dist-cjs/providers/google-gemini.js +13 -4
- package/dist-cjs/providers/google-genai.js +2 -3
- package/dist-cjs/providers/index.js +25 -2
- package/dist-cjs/providers/openai.js +1 -2
- package/dist-cjs/providers/sse.js +1 -2
- package/dist-cjs/providers/types.js +1 -2
- package/dist-cjs/providers/vertex-ai.js +6 -3
- package/dist-cjs/runtime/actions/context.js +26 -3
- package/dist-cjs/runtime/actions/execute.js +17 -3
- package/dist-cjs/runtime/actions/native.js +3 -4
- package/dist-cjs/runtime/actions/sandbox.js +1 -2
- package/dist-cjs/runtime/agent.js +3 -4
- package/dist-cjs/runtime/context.js +1 -2
- package/dist-cjs/runtime/create-orcha.js +3 -4
- package/dist-cjs/runtime/execution.js +1 -2
- package/dist-cjs/runtime/session-events.js +1 -2
- package/dist-cjs/runtime/structured-output.js +1 -2
- package/dist-cjs/storage/browser-indexeddb.js +1 -2
- package/dist-cjs/storage/create-store.js +1 -2
- package/dist-cjs/storage/edge-store.js +1 -2
- package/dist-cjs/storage/migrate.js +1 -2
- package/dist-cjs/storage/node-jsonl.js +10 -11
- package/dist-cjs/storage/node-sqlite.js +8 -9
- package/dist-cjs/storage/react-native-jsonl.js +1 -2
- package/dist-cjs/testing.js +17 -18
- package/dist-cjs/types/google-genai-sdk.d.js +2 -0
- package/dist-cjs/types.js +1 -2
- package/package.json +40 -12
- package/dist/amarsia/metadata.d.ts.map +0 -1
- package/dist/amarsia/metadata.js.map +0 -1
- package/dist/amarsia/sync.d.ts.map +0 -1
- package/dist/amarsia/sync.js.map +0 -1
- package/dist/cli-agents-template.d.ts.map +0 -1
- package/dist/cli-agents-template.js.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/compiler/build-project.d.ts.map +0 -1
- package/dist/compiler/build-project.js.map +0 -1
- package/dist/compiler/compile.d.ts.map +0 -1
- package/dist/compiler/compile.js.map +0 -1
- package/dist/env.d.ts.map +0 -1
- package/dist/env.js.map +0 -1
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js.map +0 -1
- package/dist/file-content.d.ts.map +0 -1
- package/dist/file-content.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/integrations/esbuild.d.ts.map +0 -1
- package/dist/integrations/esbuild.js.map +0 -1
- package/dist/orcha.d.ts.map +0 -1
- package/dist/orcha.js.map +0 -1
- package/dist/playground/public/app.css.map +0 -7
- package/dist/playground/public/app.js.map +0 -7
- package/dist/playground/server.d.ts.map +0 -1
- package/dist/playground/server.js.map +0 -1
- package/dist/playground/source.d.ts.map +0 -1
- package/dist/playground/source.js.map +0 -1
- package/dist/project-loader.d.ts.map +0 -1
- package/dist/project-loader.js.map +0 -1
- package/dist/providers/anthropic.d.ts.map +0 -1
- package/dist/providers/anthropic.js.map +0 -1
- package/dist/providers/bedrock.d.ts.map +0 -1
- package/dist/providers/bedrock.js.map +0 -1
- package/dist/providers/catalog.d.ts.map +0 -1
- package/dist/providers/catalog.js.map +0 -1
- package/dist/providers/deepseek.d.ts.map +0 -1
- package/dist/providers/deepseek.js.map +0 -1
- package/dist/providers/dispatcher.d.ts.map +0 -1
- package/dist/providers/dispatcher.js.map +0 -1
- package/dist/providers/google-gemini.d.ts.map +0 -1
- package/dist/providers/google-gemini.js.map +0 -1
- package/dist/providers/google-genai.d.ts.map +0 -1
- package/dist/providers/google-genai.js.map +0 -1
- package/dist/providers/index.d.ts.map +0 -1
- package/dist/providers/index.js.map +0 -1
- package/dist/providers/openai.d.ts.map +0 -1
- package/dist/providers/openai.js.map +0 -1
- package/dist/providers/sse.d.ts.map +0 -1
- package/dist/providers/sse.js.map +0 -1
- package/dist/providers/types.d.ts.map +0 -1
- package/dist/providers/types.js.map +0 -1
- package/dist/providers/vertex-ai.d.ts.map +0 -1
- package/dist/providers/vertex-ai.js.map +0 -1
- package/dist/runtime/actions/context.d.ts.map +0 -1
- package/dist/runtime/actions/context.js.map +0 -1
- package/dist/runtime/actions/execute.d.ts.map +0 -1
- package/dist/runtime/actions/execute.js.map +0 -1
- package/dist/runtime/actions/native.d.ts.map +0 -1
- package/dist/runtime/actions/native.js.map +0 -1
- package/dist/runtime/actions/sandbox.d.ts.map +0 -1
- package/dist/runtime/actions/sandbox.js.map +0 -1
- package/dist/runtime/agent.d.ts.map +0 -1
- package/dist/runtime/agent.js.map +0 -1
- package/dist/runtime/context.d.ts.map +0 -1
- package/dist/runtime/context.js.map +0 -1
- package/dist/runtime/create-orcha.d.ts.map +0 -1
- package/dist/runtime/create-orcha.js.map +0 -1
- package/dist/runtime/execution.d.ts.map +0 -1
- package/dist/runtime/execution.js.map +0 -1
- package/dist/runtime/session-events.d.ts.map +0 -1
- package/dist/runtime/session-events.js.map +0 -1
- package/dist/runtime/structured-output.d.ts.map +0 -1
- package/dist/runtime/structured-output.js.map +0 -1
- package/dist/storage/browser-indexeddb.d.ts.map +0 -1
- package/dist/storage/browser-indexeddb.js.map +0 -1
- package/dist/storage/create-store.d.ts.map +0 -1
- package/dist/storage/create-store.js.map +0 -1
- package/dist/storage/edge-store.d.ts.map +0 -1
- package/dist/storage/edge-store.js.map +0 -1
- package/dist/storage/migrate.d.ts.map +0 -1
- package/dist/storage/migrate.js.map +0 -1
- package/dist/storage/node-jsonl.d.ts.map +0 -1
- package/dist/storage/node-jsonl.js.map +0 -1
- package/dist/storage/node-sqlite.d.ts.map +0 -1
- package/dist/storage/node-sqlite.js.map +0 -1
- package/dist/storage/react-native-jsonl.d.ts.map +0 -1
- package/dist/storage/react-native-jsonl.js.map +0 -1
- package/dist/testing.d.ts.map +0 -1
- package/dist/testing.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist-cjs/amarsia/metadata.js.map +0 -7
- package/dist-cjs/amarsia/sync.js.map +0 -7
- package/dist-cjs/cli-agents-template.js.map +0 -7
- package/dist-cjs/compiler/build-project.js.map +0 -7
- package/dist-cjs/compiler/compile.js.map +0 -7
- package/dist-cjs/env.js.map +0 -7
- package/dist-cjs/errors.js.map +0 -7
- package/dist-cjs/file-content.js.map +0 -7
- package/dist-cjs/index.js.map +0 -7
- package/dist-cjs/integrations/esbuild.js.map +0 -7
- package/dist-cjs/orcha.js.map +0 -7
- package/dist-cjs/playground/server.js.map +0 -7
- package/dist-cjs/playground/source.js.map +0 -7
- package/dist-cjs/project-loader.js.map +0 -7
- package/dist-cjs/providers/anthropic.js.map +0 -7
- package/dist-cjs/providers/bedrock.js.map +0 -7
- package/dist-cjs/providers/catalog.js.map +0 -7
- package/dist-cjs/providers/deepseek.js.map +0 -7
- package/dist-cjs/providers/dispatcher.js.map +0 -7
- package/dist-cjs/providers/google-gemini.js.map +0 -7
- package/dist-cjs/providers/google-genai.js.map +0 -7
- package/dist-cjs/providers/index.js.map +0 -7
- package/dist-cjs/providers/openai.js.map +0 -7
- package/dist-cjs/providers/sse.js.map +0 -7
- package/dist-cjs/providers/types.js.map +0 -7
- package/dist-cjs/providers/vertex-ai.js.map +0 -7
- package/dist-cjs/runtime/actions/context.js.map +0 -7
- package/dist-cjs/runtime/actions/execute.js.map +0 -7
- package/dist-cjs/runtime/actions/native.js.map +0 -7
- package/dist-cjs/runtime/actions/sandbox.js.map +0 -7
- package/dist-cjs/runtime/agent.js.map +0 -7
- package/dist-cjs/runtime/context.js.map +0 -7
- package/dist-cjs/runtime/create-orcha.js.map +0 -7
- package/dist-cjs/runtime/execution.js.map +0 -7
- package/dist-cjs/runtime/session-events.js.map +0 -7
- package/dist-cjs/runtime/structured-output.js.map +0 -7
- package/dist-cjs/storage/browser-indexeddb.js.map +0 -7
- package/dist-cjs/storage/create-store.js.map +0 -7
- package/dist-cjs/storage/edge-store.js.map +0 -7
- package/dist-cjs/storage/migrate.js.map +0 -7
- package/dist-cjs/storage/node-jsonl.js.map +0 -7
- package/dist-cjs/storage/node-sqlite.js.map +0 -7
- package/dist-cjs/storage/react-native-jsonl.js.map +0 -7
- package/dist-cjs/testing.js.map +0 -7
- package/dist-cjs/types.js.map +0 -7
|
@@ -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('
|
|
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
|
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
package/dist/types.d.ts
CHANGED
package/dist/types.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict"; const __orchaImportMetaUrl = require("
|
|
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
|
|
26
|
-
var
|
|
27
|
-
var
|
|
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,
|
|
131
|
-
if (!(0,
|
|
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,
|
|
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,
|
|
159
|
+
if (!configPath || !(0, import_fs.existsSync)(configPath)) {
|
|
160
160
|
return void 0;
|
|
161
161
|
}
|
|
162
|
-
const config = (0,
|
|
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,
|
|
167
|
+
let directory = (0, import_path.resolve)(projectRoot);
|
|
168
168
|
while (true) {
|
|
169
|
-
const gitPath = (0,
|
|
170
|
-
if ((0,
|
|
169
|
+
const gitPath = (0, import_path.join)(directory, ".git");
|
|
170
|
+
if ((0, import_fs.existsSync)(gitPath)) {
|
|
171
171
|
try {
|
|
172
|
-
const gitFile = (0,
|
|
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,
|
|
175
|
+
return (0, import_path.join)((0, import_path.resolve)(directory, gitDir), "config");
|
|
176
176
|
}
|
|
177
177
|
} catch {
|
|
178
|
-
return (0,
|
|
178
|
+
return (0, import_path.join)(gitPath, "config");
|
|
179
179
|
}
|
|
180
|
-
return (0,
|
|
180
|
+
return (0, import_path.join)((0, import_path.dirname)(gitPath), ".git", "config");
|
|
181
181
|
}
|
|
182
|
-
const parent = (0,
|
|
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,
|
|
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
|
package/dist-cjs/amarsia/sync.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict"; const __orchaImportMetaUrl = require("
|
|
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("
|
|
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("
|
|
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
|
|
26
|
-
var import_promises = require("
|
|
27
|
-
var
|
|
28
|
-
var
|
|
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,
|
|
34
|
-
const registryPath = (0,
|
|
35
|
-
if (!(0,
|
|
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,
|
|
39
|
-
const registryBundlePath = (0,
|
|
40
|
-
const productionEntryPath = (0,
|
|
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,
|
|
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,
|
|
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: "
|
|
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,
|
|
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,
|
|
78
|
-
(0,
|
|
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,
|
|
82
|
-
(0,
|
|
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: "
|
|
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 "
|
|
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,
|
|
151
|
-
(0,
|
|
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,
|
|
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("
|
|
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
|
|
27
|
-
var
|
|
28
|
-
var
|
|
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,
|
|
114
|
-
const configPath = (0,
|
|
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,
|
|
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,
|
|
173
|
+
const instructionsPath = (0, import_path.resolve)(sourceDirectory, "instructions.md");
|
|
174
174
|
let systemPrompt;
|
|
175
175
|
try {
|
|
176
|
-
systemPrompt = (0,
|
|
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,
|
|
207
|
-
if (!(0,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
322
|
-
if (!(0,
|
|
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,
|
|
329
|
-
const configurationPath = (0,
|
|
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,
|
|
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,
|
|
346
|
+
const instructionsPath = (0, import_path.resolve)(skillDirectory, "instructions.md");
|
|
347
347
|
let instructions;
|
|
348
348
|
try {
|
|
349
|
-
instructions = (0,
|
|
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,
|
|
376
|
-
if (!(0,
|
|
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,
|
|
383
|
-
const configurationPath = (0,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
503
|
-
if (!(0,
|
|
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,
|
|
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("
|
|
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
|
|
26
|
-
var
|
|
27
|
-
var
|
|
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,
|
|
30
|
-
if ((0,
|
|
31
|
-
(0,
|
|
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
|
package/dist-cjs/errors.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict"; const __orchaImportMetaUrl = require("
|
|
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
|
package/dist-cjs/file-content.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict"; const __orchaImportMetaUrl = require("
|
|
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("
|
|
28
|
-
var
|
|
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,
|
|
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,
|
|
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,
|
|
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("
|
|
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("
|
|
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
|
|
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,
|
|
29
|
-
const generatedBundle = (0,
|
|
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("
|
|
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
|
|
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,
|
|
36
|
+
const projectRoot = (0, import_path.resolve)(
|
|
37
37
|
configuration.root ?? process.env.ORCHA_PROJECT_ROOT ?? process.cwd()
|
|
38
38
|
);
|
|
39
|
-
const registryRoot = (0,
|
|
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
|