@aexol/spectral 0.2.6 → 0.2.7

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.
@@ -51,7 +51,7 @@
51
51
  import { AuthStorage, createAgentSession, DefaultResourceLoader, ModelRegistry, SessionManager, } from "@mariozechner/pi-coding-agent";
52
52
  import { createJiti } from "@mariozechner/jiti";
53
53
  import { randomUUID } from "node:crypto";
54
- import { existsSync, readFileSync } from "node:fs";
54
+ import { existsSync } from "node:fs";
55
55
  import { dirname, resolve } from "node:path";
56
56
  import { fileURLToPath } from "node:url";
57
57
  import aexolMcpExtension from "../extensions/aexol-mcp.js";
@@ -91,38 +91,17 @@ function extractTextFromContent(content) {
91
91
  return out;
92
92
  }
93
93
  /**
94
- * Resolve the entry point of the pi-mcp-adapter extension (index.ts)
95
- * by walking up from this file's location through node_modules.
96
- * Returns the absolute path, or null if the package is not installed.
94
+ * Resolve the entry point of the pi-mcp-adapter extension.
95
+ * Uses the bundled copy in dist/mcp/index.js (same directory as this file).
96
+ * Returns the absolute path, or null if the bundled file is missing.
97
97
  */
98
98
  function resolveMcpAdapterEntry() {
99
99
  const __dirname = dirname(fileURLToPath(import.meta.url));
100
- const rel = "node_modules/pi-mcp-adapter/package.json";
101
- const root = "/";
102
- let dir = __dirname;
103
- for (let i = 0; i < 20; i++) {
104
- const pkgPath = resolve(dir, rel);
105
- try {
106
- const raw = readFileSync(pkgPath, "utf8");
107
- const pkg = JSON.parse(raw);
108
- const extRel = pkg.pi?.extensions?.[0];
109
- if (extRel) {
110
- return resolve(dirname(pkgPath), extRel);
111
- }
112
- // Package found but no pi.extensions — try index.ts as fallback
113
- const indexTs = resolve(dirname(pkgPath), "index.ts");
114
- if (existsSync(indexTs))
115
- return indexTs;
116
- break;
117
- }
118
- catch {
119
- // package.json not readable at this level, keep walking up
120
- }
121
- const parent = dirname(dir);
122
- if (parent === dir || parent === root)
123
- break;
124
- dir = parent;
125
- }
100
+ // pi-bridge.ts compiles to dist/server/pi-bridge.js;
101
+ // the bundled MCP adapter sits next door at dist/mcp/index.js.
102
+ const bundledIndex = resolve(__dirname, "..", "mcp", "index.js");
103
+ if (existsSync(bundledIndex))
104
+ return bundledIndex;
126
105
  return null;
127
106
  }
128
107
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aexol/spectral",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "Always-on coding agent for Aexol — branded pi wrapper with relay-based browser access.",
5
5
  "type": "module",
6
6
  "private": false,