@botbotgo/agent-harness 0.0.311 → 0.0.312

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.
@@ -1 +1 @@
1
- export declare const AGENT_HARNESS_VERSION = "0.0.310";
1
+ export declare const AGENT_HARNESS_VERSION = "0.0.311";
@@ -1 +1 @@
1
- export const AGENT_HARNESS_VERSION = "0.0.310";
1
+ export const AGENT_HARNESS_VERSION = "0.0.311";
@@ -1,4 +1,5 @@
1
- import { readFileSync } from "node:fs";
1
+ import { existsSync, readFileSync } from "node:fs";
2
+ import { fileURLToPath } from "node:url";
2
3
  const bundledTextCache = new Map();
3
4
  export function readBundledText(relativePath) {
4
5
  const normalized = relativePath.replace(/^\.?\//, "");
@@ -6,10 +7,23 @@ export function readBundledText(relativePath) {
6
7
  if (cached !== undefined) {
7
8
  return cached;
8
9
  }
9
- const value = readFileSync(new URL(`../../resources/${normalized}`, import.meta.url), "utf8");
10
+ const resourceUrl = resolveBundledResourceUrl(normalized);
11
+ const value = readFileSync(resourceUrl, "utf8");
10
12
  bundledTextCache.set(normalized, value);
11
13
  return value;
12
14
  }
15
+ function resolveBundledResourceUrl(relativePath) {
16
+ const candidates = [
17
+ new URL(`../resources/${relativePath}`, import.meta.url),
18
+ new URL(`../../resources/${relativePath}`, import.meta.url),
19
+ ];
20
+ for (const candidate of candidates) {
21
+ if (existsSync(fileURLToPath(candidate))) {
22
+ return candidate;
23
+ }
24
+ }
25
+ return candidates[0];
26
+ }
13
27
  export function renderTemplateText(template, values) {
14
28
  return template
15
29
  .replace(/\{\{([a-zA-Z0-9_]+)\}\}/g, (_match, key) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botbotgo/agent-harness",
3
- "version": "0.0.311",
3
+ "version": "0.0.312",
4
4
  "description": "Workspace runtime for multi-agent applications",
5
5
  "license": "MIT",
6
6
  "type": "module",