@aexol/spectral 0.0.7 → 0.1.1

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.
@@ -45,7 +45,7 @@ import { gracefulShutdown } from "../server/shutdown.js";
45
45
  import { preflightSqlite, SessionStore } from "../server/storage.js";
46
46
  const __dirname = dirname(fileURLToPath(import.meta.url));
47
47
  /** Default backend base URL when neither env nor override is set. */
48
- const DEFAULT_BACKEND_URL = "http://api.aexol.ai";
48
+ const DEFAULT_BACKEND_URL = "https://api.aexol.ai";
49
49
  function readPackageVersion() {
50
50
  // dist/commands/serve.js → ../../package.json
51
51
  // src/commands/serve.ts → ../../package.json (tsx / vitest)
@@ -48,6 +48,7 @@
48
48
  * conversations within a single WS connection work normally.
49
49
  */
50
50
  import { AuthStorage, createAgentSession, DefaultResourceLoader, ModelRegistry, SessionManager, } from "@mariozechner/pi-coding-agent";
51
+ import { createRequire } from "node:module";
51
52
  import { randomUUID } from "node:crypto";
52
53
  import aexolMcpExtension from "../extensions/aexol-mcp.js";
53
54
  import { fetchAllowedModels as defaultFetchAllowedModels, } from "../relay/models-fetch.js";
@@ -116,13 +117,32 @@ export class PiBridge {
116
117
  async start() {
117
118
  if (this.disposed)
118
119
  throw new Error("PiBridge already disposed");
119
- // ResourceLoader with the Aexol MCP extension wired in via factory.
120
- // The extension's signature `(pi: ExtensionAPI) => Promise<void>` matches
121
- // the ExtensionFactory type exactly, so we can pass it directly.
120
+ // Build extension factories. Always include the Aexol MCP extension;
121
+ // dynamically load the pi-mcp-adapter (standard MCP servers) with
122
+ // graceful degradation when the package is not installed.
123
+ const extensionFactories = [aexolMcpExtension];
124
+ // Use createRequire to avoid TypeScript walking into pi-mcp-adapter's
125
+ // raw .ts sources (the package doesn't ship .d.ts). The extension factory
126
+ // is the default export: `export default function mcpAdapter(pi)`.
127
+ try {
128
+ const piMcpRequire = createRequire(import.meta.url);
129
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
130
+ const mcpAdapterExtension = piMcpRequire("pi-mcp-adapter");
131
+ if (typeof mcpAdapterExtension === "function") {
132
+ extensionFactories.push(mcpAdapterExtension);
133
+ console.info("[PiBridge] Standard MCP adapter loaded (pi-mcp-adapter)");
134
+ }
135
+ }
136
+ catch {
137
+ console.info("[PiBridge] pi-mcp-adapter not found; standard MCP servers disabled.");
138
+ }
139
+ // ResourceLoader with extensions wired in via factories.
140
+ // Each factory's signature `(pi: ExtensionAPI) => Promise<void>` matches
141
+ // the ExtensionFactory type exactly, so we can pass them directly.
122
142
  const resourceLoader = new DefaultResourceLoader({
123
143
  cwd: this.opts.cwd,
124
144
  agentDir: this.opts.agentDir ?? `${process.env.HOME ?? ""}/.pi/agent`,
125
- extensionFactories: [aexolMcpExtension],
145
+ extensionFactories,
126
146
  // Skip on-disk extension/skill discovery so the server is self-contained.
127
147
  noExtensions: false,
128
148
  noSkills: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aexol/spectral",
3
- "version": "0.0.7",
3
+ "version": "0.1.1",
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,