agentic-orchestrator 0.2.1 → 0.2.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-orchestrator",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "private": false,
5
5
  "workspaces": [
6
6
  "packages/*"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aop/web-dashboard",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,7 +1,7 @@
1
1
  import { randomUUID } from 'node:crypto';
2
2
  import { existsSync } from 'node:fs';
3
3
  import path from 'node:path';
4
- import { pathToFileURL } from 'node:url';
4
+ import { fileURLToPath, pathToFileURL } from 'node:url';
5
5
  import { getAopRoot } from '@/lib/aop-client.js';
6
6
  import {
7
7
  submitDashboardRuntimeCommand,
@@ -348,16 +348,23 @@ function resolveControlPlaneModulePath(): string {
348
348
  return fromAopRoot;
349
349
  }
350
350
 
351
- // Strategy 3: Resolve from globally installed package
351
+ // Strategy 3: Walk up from this file's compiled location (handles .next chunks
352
+ // within the installed package tree, e.g. packages/web-dashboard/.next/dev/...)
352
353
  try {
353
- // eslint-disable-next-line @typescript-eslint/no-require-imports
354
- const pkgJson = require.resolve('agentic-orchestrator/package.json');
355
- const candidate = path.join(path.dirname(pkgJson), distRelative);
356
- if (existsSync(candidate)) {
357
- return candidate;
354
+ let dir = path.dirname(fileURLToPath(import.meta.url));
355
+ for (let i = 0; i < 10; i++) {
356
+ const candidate = path.join(dir, distRelative);
357
+ if (existsSync(candidate)) {
358
+ return candidate;
359
+ }
360
+ const parent = path.dirname(dir);
361
+ if (parent === dir) {
362
+ break;
363
+ }
364
+ dir = parent;
358
365
  }
359
366
  } catch {
360
- // package not resolvable via require continue
367
+ // import.meta.url may not resolve to a file path in all bundler contexts
361
368
  }
362
369
 
363
370
  // Fallback: return the AOP_ROOT-based path (will fail at import time with a clear error)