orchajs 0.23.1 → 0.23.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,8 +2,8 @@ import { spawn } from "node:child_process";
2
2
  import { randomBytes } from "node:crypto";
3
3
  import { existsSync } from "node:fs";
4
4
  import { copyFile, mkdir, readFile, writeFile, } from "node:fs/promises";
5
- import { createRequire } from "node:module";
6
5
  import { extname, isAbsolute, relative, resolve } from "node:path";
6
+ import { fileURLToPath } from "node:url";
7
7
  import { createServer, } from "node:http";
8
8
  import { watch } from "chokidar";
9
9
  import { build } from "esbuild";
@@ -475,12 +475,11 @@ async function serveAsset(response, pathname, publicRoot) {
475
475
  response.end(await readFile(path));
476
476
  }
477
477
  async function buildPlaygroundAssets(projectRoot) {
478
- const require = createRequire(import.meta.url);
479
478
  let entryPath;
480
479
  let logoPath;
481
480
  try {
482
- entryPath = require.resolve("@orchajs/playground-ui/mount");
483
- logoPath = require.resolve("@orchajs/playground-ui/orcha-logo.svg");
481
+ entryPath = fileURLToPath(import.meta.resolve("@orchajs/playground-ui/mount"));
482
+ logoPath = fileURLToPath(import.meta.resolve("@orchajs/playground-ui/orcha-logo.svg"));
484
483
  }
485
484
  catch (error) {
486
485
  throw new Error('The playground requires the optional "@orchajs/playground-ui" package. Install it as a development dependency.', { cause: error });
@@ -26,8 +26,8 @@ var import_child_process = require("child_process");
26
26
  var import_crypto = require("crypto");
27
27
  var import_fs = require("fs");
28
28
  var import_promises = require("fs/promises");
29
- var import_module = require("module");
30
29
  var import_path = require("path");
30
+ var import_url = require("url");
31
31
  var import_http = require("http");
32
32
  var import_chokidar = require("chokidar");
33
33
  var import_esbuild = require("esbuild");
@@ -35,6 +35,7 @@ var import_orcha = require("../orcha.js");
35
35
  var import_project_loader = require("../project-loader.js");
36
36
  var import_testing = require("../testing.js");
37
37
  var import_source = require("./source.js");
38
+ const import_meta = {};
38
39
  async function startPlayground(options = {}) {
39
40
  const projectRoot = (0, import_path.resolve)(options.projectRoot ?? process.cwd());
40
41
  const host = options.host ?? "localhost";
@@ -501,12 +502,15 @@ async function serveAsset(response, pathname, publicRoot) {
501
502
  response.end(await (0, import_promises.readFile)(path));
502
503
  }
503
504
  async function buildPlaygroundAssets(projectRoot) {
504
- const require2 = (0, import_module.createRequire)(__orchaImportMetaUrl);
505
505
  let entryPath;
506
506
  let logoPath;
507
507
  try {
508
- entryPath = require2.resolve("@orchajs/playground-ui/mount");
509
- logoPath = require2.resolve("@orchajs/playground-ui/orcha-logo.svg");
508
+ entryPath = (0, import_url.fileURLToPath)(
509
+ import_meta.resolve("@orchajs/playground-ui/mount")
510
+ );
511
+ logoPath = (0, import_url.fileURLToPath)(
512
+ import_meta.resolve("@orchajs/playground-ui/orcha-logo.svg")
513
+ );
510
514
  } catch (error) {
511
515
  throw new Error(
512
516
  'The playground requires the optional "@orchajs/playground-ui" package. Install it as a development dependency.',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orchajs",
3
- "version": "0.23.1",
3
+ "version": "0.23.2",
4
4
  "description": "A filesystem-convention, stateful agent framework for JavaScript.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -124,7 +124,7 @@
124
124
  "node": ">=18.20.8"
125
125
  },
126
126
  "peerDependencies": {
127
- "@orchajs/playground-ui": ">=0.2.2 <1",
127
+ "@orchajs/playground-ui": ">=0.2.3",
128
128
  "@react-native-async-storage/async-storage": ">=2 <3",
129
129
  "@aws-sdk/client-bedrock-runtime": ">=3.864.0 <4",
130
130
  "@google/genai": ">=2.22.0 <3",