@aexol/spectral 0.8.5 → 0.8.6

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.
Files changed (158) hide show
  1. package/dist/agent/index.d.ts +1 -1
  2. package/dist/agent/index.d.ts.map +1 -1
  3. package/dist/agent/index.js +11 -11
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/serve.d.ts +3 -3
  6. package/dist/commands/serve.d.ts.map +1 -1
  7. package/dist/commands/serve.js +5 -2
  8. package/dist/config.d.ts +1 -1
  9. package/dist/config.js +1 -1
  10. package/dist/designer/index.d.ts +3 -3
  11. package/dist/designer/index.d.ts.map +1 -1
  12. package/dist/designer/index.js +9 -9
  13. package/dist/extensions/aexol-mcp.d.ts +6 -6
  14. package/dist/extensions/aexol-mcp.d.ts.map +1 -1
  15. package/dist/extensions/aexol-mcp.js +12 -12
  16. package/dist/extensions/kanban-bridge.d.ts +2 -2
  17. package/dist/extensions/kanban-bridge.d.ts.map +1 -1
  18. package/dist/extensions/kanban-bridge.js +3 -3
  19. package/dist/extensions/openrouter-attribution.d.ts +1 -1
  20. package/dist/extensions/openrouter-attribution.d.ts.map +1 -1
  21. package/dist/extensions/openrouter-attribution.js +2 -2
  22. package/dist/extensions/spectral-vision-fallback.d.ts +1 -1
  23. package/dist/extensions/spectral-vision-fallback.d.ts.map +1 -1
  24. package/dist/extensions/spectral-vision-fallback.js +3 -3
  25. package/dist/index.d.ts +4 -4
  26. package/dist/index.js +4 -4
  27. package/dist/mcp/commands.d.ts +1 -1
  28. package/dist/mcp/commands.d.ts.map +1 -1
  29. package/dist/mcp/commands.js +1 -1
  30. package/dist/mcp/config.d.ts +5 -5
  31. package/dist/mcp/config.d.ts.map +1 -1
  32. package/dist/mcp/config.js +15 -15
  33. package/dist/mcp/host-html-template.js +3 -3
  34. package/dist/mcp/index.d.ts +1 -1
  35. package/dist/mcp/index.d.ts.map +1 -1
  36. package/dist/mcp/index.js +15 -13
  37. package/dist/mcp/init.d.ts +1 -1
  38. package/dist/mcp/init.d.ts.map +1 -1
  39. package/dist/mcp/init.js +4 -4
  40. package/dist/mcp/mcp-oauth-provider.js +1 -1
  41. package/dist/mcp/proxy-modes.d.ts +1 -1
  42. package/dist/mcp/proxy-modes.d.ts.map +1 -1
  43. package/dist/mcp/proxy-modes.js +2 -2
  44. package/dist/mcp/server-manager.js +2 -2
  45. package/dist/mcp/state-getter.d.ts +14 -0
  46. package/dist/mcp/state-getter.d.ts.map +1 -0
  47. package/dist/mcp/state-getter.js +21 -0
  48. package/dist/mcp/tool-registrar.js +1 -1
  49. package/dist/mcp/ui-server.js +1 -1
  50. package/dist/mcp/ui-stream-types.d.ts +11 -11
  51. package/dist/mcp/ui-stream-types.d.ts.map +1 -1
  52. package/dist/mcp/ui-stream-types.js +5 -5
  53. package/dist/mcp/utils.d.ts +2 -2
  54. package/dist/mcp/utils.d.ts.map +1 -1
  55. package/dist/mcp/utils.js +10 -10
  56. package/dist/mcp-client.d.ts +1 -1
  57. package/dist/mcp-client.js +1 -1
  58. package/dist/memory/commands/status.d.ts +1 -1
  59. package/dist/memory/commands/status.d.ts.map +1 -1
  60. package/dist/memory/commands/status.js +2 -2
  61. package/dist/memory/commands/view.d.ts +1 -1
  62. package/dist/memory/commands/view.d.ts.map +1 -1
  63. package/dist/memory/commands/view.js +2 -2
  64. package/dist/memory/hooks/compaction-hook.d.ts +1 -1
  65. package/dist/memory/hooks/compaction-hook.d.ts.map +1 -1
  66. package/dist/memory/hooks/compaction-hook.js +5 -5
  67. package/dist/memory/hooks/compaction-trigger.d.ts +1 -1
  68. package/dist/memory/hooks/compaction-trigger.d.ts.map +1 -1
  69. package/dist/memory/hooks/compaction-trigger.js +3 -3
  70. package/dist/memory/hooks/observer-trigger.d.ts +1 -1
  71. package/dist/memory/hooks/observer-trigger.d.ts.map +1 -1
  72. package/dist/memory/hooks/observer-trigger.js +4 -4
  73. package/dist/memory/index.d.ts +1 -1
  74. package/dist/memory/index.d.ts.map +1 -1
  75. package/dist/memory/index.js +9 -9
  76. package/dist/memory/tools/read-project-observations.d.ts +1 -1
  77. package/dist/memory/tools/read-project-observations.d.ts.map +1 -1
  78. package/dist/memory/tools/read-project-observations.js +2 -2
  79. package/dist/memory/tools/recall-observation.d.ts +1 -1
  80. package/dist/memory/tools/recall-observation.d.ts.map +1 -1
  81. package/dist/memory/tools/recall-observation.js +2 -2
  82. package/dist/memory/tools/write-project-observation.d.ts +1 -1
  83. package/dist/memory/tools/write-project-observation.d.ts.map +1 -1
  84. package/dist/memory/tools/write-project-observation.js +2 -2
  85. package/dist/preflight.d.ts +1 -1
  86. package/dist/preflight.js +1 -1
  87. package/dist/relay/auto-research.d.ts +2 -2
  88. package/dist/relay/auto-research.js +34 -34
  89. package/dist/relay/dispatcher.d.ts +15 -6
  90. package/dist/relay/dispatcher.d.ts.map +1 -1
  91. package/dist/relay/dispatcher.js +33 -6
  92. package/dist/sdk/ai/types.d.ts +1 -1
  93. package/dist/sdk/ai/utils/oauth/openai-codex.d.ts +1 -1
  94. package/dist/sdk/ai/utils/oauth/openai-codex.js +2 -2
  95. package/dist/sdk/coding-agent/core/agent-session.d.ts +2 -2
  96. package/dist/sdk/coding-agent/core/agent-session.js +3 -3
  97. package/dist/sdk/coding-agent/core/auth-storage.d.ts +2 -2
  98. package/dist/sdk/coding-agent/core/auth-storage.js +2 -2
  99. package/dist/sdk/coding-agent/core/bash-executor.js +1 -1
  100. package/dist/sdk/coding-agent/core/compaction/branch-summarization.js +1 -1
  101. package/dist/sdk/coding-agent/core/compaction/compaction.js +1 -1
  102. package/dist/sdk/coding-agent/core/extensions/loader.d.ts.map +1 -1
  103. package/dist/sdk/coding-agent/core/extensions/loader.js +18 -22
  104. package/dist/sdk/coding-agent/core/extensions/runner.d.ts.map +1 -1
  105. package/dist/sdk/coding-agent/core/extensions/runner.js +1 -1
  106. package/dist/sdk/coding-agent/core/extensions/types.d.ts +9 -9
  107. package/dist/sdk/coding-agent/core/extensions/types.d.ts.map +1 -1
  108. package/dist/sdk/coding-agent/core/package-manager.d.ts +1 -1
  109. package/dist/sdk/coding-agent/core/package-manager.d.ts.map +1 -1
  110. package/dist/sdk/coding-agent/core/package-manager.js +14 -14
  111. package/dist/sdk/coding-agent/core/sdk.d.ts +1 -1
  112. package/dist/sdk/coding-agent/core/sdk.js +2 -2
  113. package/dist/sdk/coding-agent/core/session-manager.d.ts +2 -2
  114. package/dist/sdk/coding-agent/core/session-manager.d.ts.map +1 -1
  115. package/dist/sdk/coding-agent/core/system-prompt.js +7 -7
  116. package/dist/sdk/coding-agent/core/tools/bash.d.ts +2 -2
  117. package/dist/sdk/coding-agent/core/tools/bash.js +3 -3
  118. package/dist/sdk/coding-agent/core/tools/output-accumulator.js +1 -1
  119. package/dist/sdk/coding-agent/migrations.d.ts +1 -1
  120. package/dist/sdk/coding-agent/migrations.js +4 -4
  121. package/dist/sdk/coding-agent/modes/print-mode.d.ts +2 -2
  122. package/dist/sdk/coding-agent/modes/print-mode.js +2 -2
  123. package/dist/sdk/coding-agent/utils/clipboard-image.js +1 -1
  124. package/dist/sdk/coding-agent/utils/spectral-user-agent.d.ts +2 -0
  125. package/dist/sdk/coding-agent/utils/spectral-user-agent.d.ts.map +1 -0
  126. package/dist/sdk/coding-agent/utils/spectral-user-agent.js +3 -0
  127. package/dist/sdk/coding-agent/utils/version-check.d.ts +5 -5
  128. package/dist/sdk/coding-agent/utils/version-check.d.ts.map +1 -1
  129. package/dist/sdk/coding-agent/utils/version-check.js +7 -7
  130. package/dist/sdk/coding-agent/utils/windows-self-update.js +1 -1
  131. package/dist/server/agent-bridge.d.ts +33 -33
  132. package/dist/server/agent-bridge.d.ts.map +1 -1
  133. package/dist/server/agent-bridge.js +58 -58
  134. package/dist/server/handlers/mcp-status.d.ts +21 -0
  135. package/dist/server/handlers/mcp-status.d.ts.map +1 -0
  136. package/dist/server/handlers/mcp-status.js +52 -0
  137. package/dist/server/handlers/sessions.d.ts +1 -1
  138. package/dist/server/handlers/sessions.js +1 -1
  139. package/dist/server/handlers/settings.d.ts +30 -0
  140. package/dist/server/handlers/settings.d.ts.map +1 -0
  141. package/dist/server/handlers/settings.js +123 -0
  142. package/dist/server/paths.d.ts +2 -2
  143. package/dist/server/paths.js +2 -2
  144. package/dist/server/session-stream.d.ts +25 -25
  145. package/dist/server/session-stream.d.ts.map +1 -1
  146. package/dist/server/session-stream.js +43 -34
  147. package/dist/server/shutdown.d.ts +3 -3
  148. package/dist/server/shutdown.d.ts.map +1 -1
  149. package/dist/server/shutdown.js +3 -3
  150. package/dist/server/storage.d.ts +4 -4
  151. package/dist/server/storage.js +6 -6
  152. package/dist/server/wire.d.ts +8 -8
  153. package/dist/server/wire.d.ts.map +1 -1
  154. package/dist/server/wire.js +1 -1
  155. package/package.json +1 -1
  156. package/dist/sdk/coding-agent/utils/pi-user-agent.d.ts +0 -2
  157. package/dist/sdk/coding-agent/utils/pi-user-agent.d.ts.map +0 -1
  158. package/dist/sdk/coding-agent/utils/pi-user-agent.js +0 -3
@@ -25,5 +25,5 @@
25
25
  * - Access to observational memory via the recall tool
26
26
  */
27
27
  import { type ExtensionAPI } from "../sdk/coding-agent/index.js";
28
- export default function subagentExtension(pi: ExtensionAPI): void;
28
+ export default function subagentExtension(ext: ExtensionAPI): void;
29
29
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAWH,OAAO,EACN,KAAK,YAAY,EAEjB,MAAM,8BAA8B,CAAC;AAqetC,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CAqThE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAWH,OAAO,EACN,KAAK,YAAY,EAEjB,MAAM,8BAA8B,CAAC;AAqetC,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,GAAG,EAAE,YAAY,GAAG,IAAI,CAqTjE"}
@@ -124,7 +124,7 @@ function resolveModelString(modelStr, modelRegistry) {
124
124
  * `createTool()`. Extension-registered tools (e.g., recall) are resolved
125
125
  * via the ExtensionAPI and wrapped.
126
126
  */
127
- function resolveSubagentTools(toolNames, cwd, pi, ctx) {
127
+ function resolveSubagentTools(toolNames, cwd, ext, ctx) {
128
128
  if (!toolNames || toolNames.length === 0)
129
129
  return [];
130
130
  const tools = [];
@@ -141,10 +141,10 @@ function resolveSubagentTools(toolNames, cwd, pi, ctx) {
141
141
  continue;
142
142
  }
143
143
  // Extension-registered tools (recall, designer_*, etc.)
144
- // pi at runtime is the embedded ExtensionAPI which has getToolDefinition;
144
+ // ext at runtime is the embedded ExtensionAPI which has getToolDefinition;
145
145
  // the npm types don't expose it, so we cast.
146
- const richPi = pi;
147
- const toolDef = richPi.getToolDefinition(name);
146
+ const richApi = ext;
147
+ const toolDef = richApi.getToolDefinition(name);
148
148
  if (toolDef) {
149
149
  tools.push(wrapToolDefinition(toolDef, () => ctx));
150
150
  }
@@ -174,7 +174,7 @@ async function mapWithConcurrencyLimit(items, concurrency, fn) {
174
174
  // ---------------------------------------------------------------------------
175
175
  // Core — run a single subagent in-process via agentLoop
176
176
  // ---------------------------------------------------------------------------
177
- async function runSingleAgent(defaultCwd, agents, agentName, task, cwd, step, signal, onUpdate, makeDetails, pi, ctx) {
177
+ async function runSingleAgent(defaultCwd, agents, agentName, task, cwd, step, signal, onUpdate, makeDetails, ext, ctx) {
178
178
  const agent = agents.find((a) => a.name === agentName);
179
179
  if (!agent) {
180
180
  const available = agents.map((a) => `"${a.name}"`).join(", ") || "none";
@@ -229,7 +229,7 @@ async function runSingleAgent(defaultCwd, agents, agentName, task, cwd, step, si
229
229
  }
230
230
  // Resolve tools
231
231
  const effectiveCwd = cwd ?? defaultCwd;
232
- const tools = resolveSubagentTools(agent.tools, effectiveCwd, pi, ctx);
232
+ const tools = resolveSubagentTools(agent.tools, effectiveCwd, ext, ctx);
233
233
  const currentResult = {
234
234
  agent: agentName,
235
235
  agentSource: agent.source,
@@ -379,8 +379,8 @@ const SubagentParams = Type.Object({
379
379
  // ---------------------------------------------------------------------------
380
380
  // Extension entry point
381
381
  // ---------------------------------------------------------------------------
382
- export default function subagentExtension(pi) {
383
- pi.registerTool({
382
+ export default function subagentExtension(ext) {
383
+ ext.registerTool({
384
384
  name: "subagent",
385
385
  label: "Subagent",
386
386
  description: [
@@ -471,7 +471,7 @@ export default function subagentExtension(pi) {
471
471
  }
472
472
  }
473
473
  : undefined;
474
- const result = await runSingleAgent(ctx.cwd, agents, step.agent, taskWithContext, step.cwd, i + 1, signal, chainUpdate, makeDetails("chain"), pi, ctx);
474
+ const result = await runSingleAgent(ctx.cwd, agents, step.agent, taskWithContext, step.cwd, i + 1, signal, chainUpdate, makeDetails("chain"), ext, ctx);
475
475
  results.push(result);
476
476
  const isError = result.exitCode !== 0 ||
477
477
  result.stopReason === "error" ||
@@ -549,7 +549,7 @@ export default function subagentExtension(pi) {
549
549
  allResults[index] = partial.details.results[0];
550
550
  emitParallelUpdate();
551
551
  }
552
- }, makeDetails("parallel"), pi, ctx);
552
+ }, makeDetails("parallel"), ext, ctx);
553
553
  allResults[index] = result;
554
554
  emitParallelUpdate();
555
555
  return result;
@@ -572,7 +572,7 @@ export default function subagentExtension(pi) {
572
572
  }
573
573
  // ── Single mode ─────────────────────────────────────────────
574
574
  if (params.agent && params.task) {
575
- const result = await runSingleAgent(ctx.cwd, agents, params.agent, params.task, params.cwd, undefined, signal, onUpdate, makeDetails("single"), pi, ctx);
575
+ const result = await runSingleAgent(ctx.cwd, agents, params.agent, params.task, params.cwd, undefined, signal, onUpdate, makeDetails("single"), ext, ctx);
576
576
  const isError = result.exitCode !== 0 ||
577
577
  result.stopReason === "error" ||
578
578
  result.stopReason === "aborted";
package/dist/cli.js CHANGED
@@ -80,7 +80,7 @@ async function main() {
80
80
  process.exit(0);
81
81
  }
82
82
  // Subcommands. Dynamic import keeps the cold-start path light when users
83
- // are just running pi.
83
+ // are just running spectral.
84
84
  if (first === "login") {
85
85
  const { runLogin } = await import("./commands/login.js");
86
86
  await runLogin();
@@ -14,7 +14,7 @@
14
14
  * `{kind:"ack", echo:<frame>}`. This proves the WS is bidirectional
15
15
  * end-to-end and gives operators a smoke check before envelope routing.
16
16
  * 7. SIGINT/SIGTERM trigger graceful shutdown: dispose the relay (close 1000),
17
- * dispose the manager (tear down pi streams), close the store.
17
+ * dispose the manager (tear down agent streams), close the store.
18
18
  *
19
19
  * What this module is NOT (yet):
20
20
  * - It does NOT translate relay envelopes into REST handler calls or WS
@@ -64,7 +64,7 @@ export interface ParsedServeArgs {
64
64
  */
65
65
  export declare function parseServeArgs(args: string[]): ParsedServeArgs;
66
66
  export interface RunServeOptions {
67
- /** Working directory pi runs in. Defaults to homedir(). */
67
+ /** Working directory spectral runs in. Defaults to homedir(). */
68
68
  cwd?: string;
69
69
  /** Skip SIGINT/SIGTERM handlers (tests). */
70
70
  installSignalHandlers?: boolean;
@@ -94,7 +94,7 @@ export interface RunServeOptions {
94
94
  export interface RunServeHandle {
95
95
  /** Open store. Exposed for tests. */
96
96
  store: SessionStore;
97
- /** Manager driving pi streams. Exposed for tests. */
97
+ /** Manager driving agent streams. Exposed for tests. */
98
98
  manager: SessionStreamManager;
99
99
  /** Live relay client. Exposed for tests. */
100
100
  relay: RelayClient;
@@ -1 +1 @@
1
- {"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../src/commands/serve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAiBH,OAAO,EAAE,WAAW,EAAmB,MAAM,oBAAoB,CAAC;AAUlE,OAAO,KAAK,EAAE,aAAa,EAAc,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEn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gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,4CAA4C;IAC5C,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IACzB,+DAA+D;IAC/D,aAAa,CAAC,EAAE,qBAAqB,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC;CAC/E;AAED,MAAM,WAAW,cAAc;IAC7B,qCAAqC;IACrC,KAAK,EAAE,YAAY,CAAC;IACpB,wDAAwD;IACxD,OAAO,EAAE,oBAAoB,CAAC;IAC9B,4CAA4C;IAC5C,KAAK,EAAE,WAAW,CAAC;IACnB,+CAA+C;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED,wBAAsB,QAAQ,CAAC,IAAI,GAAE,eAAoB,GAAG,OAAO,CAAC,cAAc,CAAC,CA4RlF;AAED;;;GAGG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CAa5E"}
@@ -14,7 +14,7 @@
14
14
  * `{kind:"ack", echo:<frame>}`. This proves the WS is bidirectional
15
15
  * end-to-end and gives operators a smoke check before envelope routing.
16
16
  * 7. SIGINT/SIGTERM trigger graceful shutdown: dispose the relay (close 1000),
17
- * dispose the manager (tear down pi streams), close the store.
17
+ * dispose the manager (tear down agent streams), close the store.
18
18
  *
19
19
  * What this module is NOT (yet):
20
20
  * - It does NOT translate relay envelopes into REST handler calls or WS
@@ -42,6 +42,7 @@ import { detachAllSubscribers, handleAutoResearchFrame, handleCancelTurn, handle
42
42
  import { ensureMachineRegistered } from "../relay/registration.js";
43
43
  import { SessionStreamManager } from "../server/session-stream.js";
44
44
  import { gracefulShutdown } from "../server/shutdown.js";
45
+ import { getLiveMcpState } from "../mcp/state-getter.js";
45
46
  import { preflightSqlite, SessionStore } from "../server/storage.js";
46
47
  const __dirname = dirname(fileURLToPath(import.meta.url));
47
48
  /** Default backend base URL when neither env nor override is set. */
@@ -172,7 +173,7 @@ export async function runServe(opts = {}) {
172
173
  }
173
174
  process.exit(1);
174
175
  }
175
- // Stream manager owns per-session pi processes. Batch 3 will subscribe
176
+ // Stream manager owns per-session spectral processes. Batch 3 will subscribe
176
177
  // it to relay frames; for now it's just here so the handles match the
177
178
  // shape Batch 3 expects.
178
179
  const manager = new SessionStreamManager({
@@ -231,7 +232,9 @@ export async function runServe(opts = {}) {
231
232
  void handleRestRequest(frame, {
232
233
  store,
233
234
  manager,
235
+ cwd,
234
236
  publishMetaEvent: deferredPublishMetaEvent,
237
+ mcpState: getLiveMcpState() ?? undefined,
235
238
  }).then((response) => {
236
239
  relay.send(response);
237
240
  });
package/dist/config.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  * The directory is created with mode 0700.
6
6
  *
7
7
  * Keep this module zero-side-effect so it can be imported from both the
8
- * CLI entry (pre-flight check) and the pi extension.
8
+ * CLI entry (pre-flight check) and the spectral extension.
9
9
  *
10
10
  * `getConfigDir()` honors `SPECTRAL_CONFIG_DIR` so tests can redirect to a
11
11
  * temporary directory without touching the real `~/.spectral`.
package/dist/config.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * The directory is created with mode 0700.
6
6
  *
7
7
  * Keep this module zero-side-effect so it can be imported from both the
8
- * CLI entry (pre-flight check) and the pi extension.
8
+ * CLI entry (pre-flight check) and the spectral extension.
9
9
  *
10
10
  * `getConfigDir()` honors `SPECTRAL_CONFIG_DIR` so tests can redirect to a
11
11
  * temporary directory without touching the real `~/.spectral`.
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Designer Extension — Built-in Design Tools for the pi Coding Agent
2
+ * Designer Extension — Built-in Design Tools for the spectral coding agent
3
3
  *
4
4
  * Brings the Open Design workflow (https://github.com/nexu-io/open-design)
5
- * into the pi agent as native tools. The extension provides:
5
+ * into the spectral agent as native tools. The extension provides:
6
6
  *
7
7
  * • Design system knowledge — curated palettes, typography, spacing from
8
8
  * Apple, Stripe, Linear, Vercel, Notion, Airbnb, and more.
@@ -22,5 +22,5 @@
22
22
  * No packages to install — everything is embedded in this extension.
23
23
  */
24
24
  import type { ExtensionAPI } from "../sdk/coding-agent/index.js";
25
- export default function designerExtension(pi: ExtensionAPI): void;
25
+ export default function designerExtension(ext: ExtensionAPI): void;
26
26
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/designer/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAmGjE,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CAkKhE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/designer/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAmGjE,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,GAAG,EAAE,YAAY,GAAG,IAAI,CAkKjE"}
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Designer Extension — Built-in Design Tools for the pi Coding Agent
2
+ * Designer Extension — Built-in Design Tools for the spectral coding agent
3
3
  *
4
4
  * Brings the Open Design workflow (https://github.com/nexu-io/open-design)
5
- * into the pi agent as native tools. The extension provides:
5
+ * into the spectral agent as native tools. The extension provides:
6
6
  *
7
7
  * • Design system knowledge — curated palettes, typography, spacing from
8
8
  * Apple, Stripe, Linear, Vercel, Notion, Airbnb, and more.
@@ -93,12 +93,12 @@ const GetGuidelinesParams = Type.Object({});
93
93
  // ---------------------------------------------------------------------------
94
94
  // Extension entry point
95
95
  // ---------------------------------------------------------------------------
96
- export default function designerExtension(pi) {
96
+ export default function designerExtension(ext) {
97
97
  // ---- Inject design context on relevant prompts ---------------------------
98
98
  // Track whether we've already injected the system prompt for this session
99
99
  let guidelinesInjected = false;
100
100
  let discoveryDone = false;
101
- pi.on("before_agent_start", async (event, ctx) => {
101
+ ext.on("before_agent_start", async (event, ctx) => {
102
102
  if (!promptTriggersDesign(event.prompt))
103
103
  return;
104
104
  // First design turn: inject the discovery protocol to force clarification
@@ -128,7 +128,7 @@ ${guidelines}`,
128
128
  };
129
129
  });
130
130
  // ---- Register tools ------------------------------------------------------
131
- pi.registerTool({
131
+ ext.registerTool({
132
132
  name: "designer_list_systems",
133
133
  label: "List Design Systems",
134
134
  description: "List available design systems with color palettes, typography, and spacing tokens. " +
@@ -146,7 +146,7 @@ ${guidelines}`,
146
146
  };
147
147
  },
148
148
  });
149
- pi.registerTool({
149
+ ext.registerTool({
150
150
  name: "designer_get_system",
151
151
  label: "Get Design System",
152
152
  description: "Get the full design system tokens (CSS custom properties, typography, layout, components) for a specific system. " +
@@ -173,7 +173,7 @@ ${guidelines}`,
173
173
  };
174
174
  },
175
175
  });
176
- pi.registerTool({
176
+ ext.registerTool({
177
177
  name: "designer_list_skills",
178
178
  label: "List Design Skills",
179
179
  description: "List available design skill workflows (web prototype, SaaS landing, slide deck, mobile app, dashboard, social carousel). " +
@@ -191,7 +191,7 @@ ${guidelines}`,
191
191
  };
192
192
  },
193
193
  });
194
- pi.registerTool({
194
+ ext.registerTool({
195
195
  name: "designer_get_skill",
196
196
  label: "Get Design Skill",
197
197
  description: "Get the full workflow guide for a specific design skill. The workflow includes HTML/CSS skeletons, " +
@@ -218,7 +218,7 @@ ${guidelines}`,
218
218
  };
219
219
  },
220
220
  });
221
- pi.registerTool({
221
+ ext.registerTool({
222
222
  name: "designer_get_guidelines",
223
223
  label: "Get Design Guidelines",
224
224
  description: "Get the core design guidelines: anti-AI-slop rules, 5-dimension self-critique framework, and designer identity. " +
@@ -1,25 +1,25 @@
1
1
  /**
2
- * Aexol MCP pi extension.
2
+ * Aexol MCP spectral extension.
3
3
  *
4
4
  * Loaded by the spectral wrapper via `--extension <abs-path>`. On startup it:
5
5
  * 1. Reads ~/.spectral/config.json (writen by `spectral login`).
6
6
  * 2. Calls tools/list against the MCP backend once.
7
7
  * 3. Reads the local Studio binding (`.aexol/aexol.jsonc`) so remote tools
8
8
  * auto-inherit `teamId` / `projectId` without needing `remote_set_context`.
9
- * 4. Registers every returned remote tool through pi.registerTool() so the
9
+ * 4. Registers every returned remote tool through ext.registerTool() so the
10
10
  * model can call them like built-in tools.
11
11
  * 5. Registers local binding-management tools (`local_bind_project`,
12
12
  * `local_unbind_project`, `local_get_binding`) so users can bind a
13
13
  * directory to an Aexol Studio project from within the agent.
14
14
  *
15
- * Each registered tool is just a thin proxy: when pi's model invokes it, we
15
+ * Each registered tool is just a thin proxy: when spectral's model invokes it, we
16
16
  * translate the call into a JSON-RPC tools/call POST and unwrap the response
17
- * into the `{ content: [{ type: "text", text }], details }` shape pi expects.
17
+ * into the `{ content: [{ type: "text", text }], details }` shape spectral expects.
18
18
  *
19
19
  * Failure modes are intentionally non-fatal: if config is missing or the
20
- * backend is unreachable we log a warning and return, leaving pi to start
20
+ * backend is unreachable we log a warning and return, leaving spectral to start
21
21
  * without Aexol tools rather than crashing the whole agent.
22
22
  */
23
23
  import type { ExtensionAPI } from "../sdk/coding-agent/index.js";
24
- export default function aexolMcpExtension(pi: ExtensionAPI): Promise<void>;
24
+ export default function aexolMcpExtension(ext: ExtensionAPI): Promise<void>;
25
25
  //# sourceMappingURL=aexol-mcp.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"aexol-mcp.d.ts","sourceRoot":"","sources":["../../src/extensions/aexol-mcp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAkB,MAAM,8BAA8B,CAAC;AAqFjF,wBAA8B,iBAAiB,CAAC,EAAE,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA6P/E"}
1
+ {"version":3,"file":"aexol-mcp.d.ts","sourceRoot":"","sources":["../../src/extensions/aexol-mcp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAkB,MAAM,8BAA8B,CAAC;AAqFjF,wBAA8B,iBAAiB,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA6PhF"}
@@ -1,30 +1,30 @@
1
1
  /**
2
- * Aexol MCP pi extension.
2
+ * Aexol MCP spectral extension.
3
3
  *
4
4
  * Loaded by the spectral wrapper via `--extension <abs-path>`. On startup it:
5
5
  * 1. Reads ~/.spectral/config.json (writen by `spectral login`).
6
6
  * 2. Calls tools/list against the MCP backend once.
7
7
  * 3. Reads the local Studio binding (`.aexol/aexol.jsonc`) so remote tools
8
8
  * auto-inherit `teamId` / `projectId` without needing `remote_set_context`.
9
- * 4. Registers every returned remote tool through pi.registerTool() so the
9
+ * 4. Registers every returned remote tool through ext.registerTool() so the
10
10
  * model can call them like built-in tools.
11
11
  * 5. Registers local binding-management tools (`local_bind_project`,
12
12
  * `local_unbind_project`, `local_get_binding`) so users can bind a
13
13
  * directory to an Aexol Studio project from within the agent.
14
14
  *
15
- * Each registered tool is just a thin proxy: when pi's model invokes it, we
15
+ * Each registered tool is just a thin proxy: when spectral's model invokes it, we
16
16
  * translate the call into a JSON-RPC tools/call POST and unwrap the response
17
- * into the `{ content: [{ type: "text", text }], details }` shape pi expects.
17
+ * into the `{ content: [{ type: "text", text }], details }` shape spectral expects.
18
18
  *
19
19
  * Failure modes are intentionally non-fatal: if config is missing or the
20
- * backend is unreachable we log a warning and return, leaving pi to start
20
+ * backend is unreachable we log a warning and return, leaving spectral to start
21
21
  * without Aexol tools rather than crashing the whole agent.
22
22
  */
23
23
  import { getApiUrl, getConfigFile, readConfig } from "../config.js";
24
24
  import { AexolMcpClient, AexolMcpError } from "../mcp-client.js";
25
25
  import { readStudioBinding, writeStudioBinding, deleteStudioBinding, } from "../studio-binding.js";
26
26
  /**
27
- * Render a backend tool result into a single string for pi.
27
+ * Render a backend tool result into a single string for ext.
28
28
  *
29
29
  * The Aexol backend wraps results as `{ content: [{ type: "json", json: ... }] }`
30
30
  * but may also send `{ type: "text", text: ... }`. We pick the first content
@@ -96,7 +96,7 @@ function augmentParams(toolName, params) {
96
96
  }
97
97
  return augmented;
98
98
  }
99
- export default async function aexolMcpExtension(pi) {
99
+ export default async function aexolMcpExtension(ext) {
100
100
  const cfg = await readConfig();
101
101
  if (!cfg) {
102
102
  // Pre-flight in cli.ts should have caught this. Logging is enough.
@@ -153,7 +153,7 @@ export default async function aexolMcpExtension(pi) {
153
153
  // Surface backend tool errors as a textual result, not a thrown
154
154
  // exception. Pi treats this as the tool's natural reply; the model
155
155
  // sees the `[Aexol MCP error] ...` marker and can recover. Throwing
156
- // here would force pi to wrap the message and risk crashing
156
+ // here would force spectral to wrap the message and risk crashing
157
157
  // callers that don't expect agent-tool exceptions.
158
158
  const errorText = `[Aexol MCP error] ${text || "Tool reported an error with no message."}`;
159
159
  return {
@@ -168,7 +168,7 @@ export default async function aexolMcpExtension(pi) {
168
168
  },
169
169
  };
170
170
  try {
171
- pi.registerTool(definition);
171
+ ext.registerTool(definition);
172
172
  registered++;
173
173
  }
174
174
  catch (err) {
@@ -181,7 +181,7 @@ export default async function aexolMcpExtension(pi) {
181
181
  // binding directly from within the agent, without the user having to drop
182
182
  // out to the terminal and run `spectral bind` / `spectral unbind`.
183
183
  try {
184
- pi.registerTool({
184
+ ext.registerTool({
185
185
  name: "local_bind_project",
186
186
  label: "Bind Project",
187
187
  description: "Link the current working directory to an Aexol Studio project. " +
@@ -249,7 +249,7 @@ export default async function aexolMcpExtension(pi) {
249
249
  process.stderr.write(`[aexol-mcp] Failed to register local_bind_project: ${msg}\n`);
250
250
  }
251
251
  try {
252
- pi.registerTool({
252
+ ext.registerTool({
253
253
  name: "local_unbind_project",
254
254
  label: "Unbind Project",
255
255
  description: "Remove the Aexol Studio project binding from the current working directory. " +
@@ -301,7 +301,7 @@ export default async function aexolMcpExtension(pi) {
301
301
  process.stderr.write(`[aexol-mcp] Failed to register local_unbind_project: ${msg}\n`);
302
302
  }
303
303
  try {
304
- pi.registerTool({
304
+ ext.registerTool({
305
305
  name: "local_get_binding",
306
306
  label: "Get Binding",
307
307
  description: "Show the current Aexol Studio project binding for this directory. " +
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Kanban Bridge pi extension.
2
+ * Kanban Bridge spectral extension.
3
3
  *
4
4
  * Registers kanban management tools that allow the coding agent to read,
5
5
  * create, update, and move Kanban tasks on the Aexol Studio board. This
@@ -20,5 +20,5 @@
20
20
  * - kanban_delete — Delete a task
21
21
  */
22
22
  import type { ExtensionAPI } from "../sdk/coding-agent/index.js";
23
- export default function kanbanBridgeExtension(pi: ExtensionAPI): Promise<void>;
23
+ export default function kanbanBridgeExtension(ext: ExtensionAPI): Promise<void>;
24
24
  //# sourceMappingURL=kanban-bridge.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"kanban-bridge.d.ts","sourceRoot":"","sources":["../../src/extensions/kanban-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAkB,MAAM,8BAA8B,CAAC;AAixBjF,wBAA8B,qBAAqB,CAAC,EAAE,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAiCnF"}
1
+ {"version":3,"file":"kanban-bridge.d.ts","sourceRoot":"","sources":["../../src/extensions/kanban-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAkB,MAAM,8BAA8B,CAAC;AAixBjF,wBAA8B,qBAAqB,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAiCpF"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Kanban Bridge pi extension.
2
+ * Kanban Bridge spectral extension.
3
3
  *
4
4
  * Registers kanban management tools that allow the coding agent to read,
5
5
  * create, update, and move Kanban tasks on the Aexol Studio board. This
@@ -636,7 +636,7 @@ const kanbanDeleteTool = {
636
636
  // ---------------------------------------------------------------------------
637
637
  // Extension entry point
638
638
  // ---------------------------------------------------------------------------
639
- export default async function kanbanBridgeExtension(pi) {
639
+ export default async function kanbanBridgeExtension(ext) {
640
640
  const tools = [
641
641
  kanbanListTool,
642
642
  kanbanGetTool,
@@ -649,7 +649,7 @@ export default async function kanbanBridgeExtension(pi) {
649
649
  let registered = 0;
650
650
  for (const tool of tools) {
651
651
  try {
652
- pi.registerTool(tool);
652
+ ext.registerTool(tool);
653
653
  registered++;
654
654
  }
655
655
  catch (err) {
@@ -8,5 +8,5 @@
8
8
  * @see https://openrouter.ai/docs/app-attribution
9
9
  */
10
10
  import type { ExtensionAPI } from "../sdk/coding-agent/index.js";
11
- export default function openrouterAttributionExtension(pi: ExtensionAPI): void;
11
+ export default function openrouterAttributionExtension(ext: ExtensionAPI): void;
12
12
  //# sourceMappingURL=openrouter-attribution.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"openrouter-attribution.d.ts","sourceRoot":"","sources":["../../src/extensions/openrouter-attribution.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAEjE,MAAM,CAAC,OAAO,UAAU,8BAA8B,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CAU7E"}
1
+ {"version":3,"file":"openrouter-attribution.d.ts","sourceRoot":"","sources":["../../src/extensions/openrouter-attribution.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAEjE,MAAM,CAAC,OAAO,UAAU,8BAA8B,CAAC,GAAG,EAAE,YAAY,GAAG,IAAI,CAU9E"}
@@ -7,8 +7,8 @@
7
7
  *
8
8
  * @see https://openrouter.ai/docs/app-attribution
9
9
  */
10
- export default function openrouterAttributionExtension(pi) {
11
- pi.registerProvider("openrouter", {
10
+ export default function openrouterAttributionExtension(ext) {
11
+ ext.registerProvider("openrouter", {
12
12
  headers: {
13
13
  "HTTP-Referer": "https://aexol.ai",
14
14
  "X-OpenRouter-Title": "Aexol",
@@ -19,5 +19,5 @@
19
19
  * the LLM (covers user-attached images and tool-result images alike).
20
20
  */
21
21
  import type { ExtensionAPI } from "../sdk/coding-agent/index.js";
22
- export default function spectralVisionExtension(pi: ExtensionAPI): void;
22
+ export default function spectralVisionExtension(ext: ExtensionAPI): void;
23
23
  //# sourceMappingURL=spectral-vision-fallback.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"spectral-vision-fallback.d.ts","sourceRoot":"","sources":["../../src/extensions/spectral-vision-fallback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAuNjE,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CAmFtE"}
1
+ {"version":3,"file":"spectral-vision-fallback.d.ts","sourceRoot":"","sources":["../../src/extensions/spectral-vision-fallback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAuNjE,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,GAAG,EAAE,YAAY,GAAG,IAAI,CAmFvE"}
@@ -177,9 +177,9 @@ async function describeImages(visionModel, content, contextText, ctx) {
177
177
  // ---------------------------------------------------------------------------
178
178
  // Extension entry point
179
179
  // ---------------------------------------------------------------------------
180
- export default function spectralVisionExtension(pi) {
180
+ export default function spectralVisionExtension(ext) {
181
181
  let visionModel;
182
- pi.on("session_start", (_event, ctx) => {
182
+ ext.on("session_start", (_event, ctx) => {
183
183
  visionModel = resolveVisionModel(ctx);
184
184
  if (visionModel) {
185
185
  process.stderr.write(`[spectral-vision] Ready — using ${visionModel.provider}/${visionModel.id} for image descriptions.\n`);
@@ -191,7 +191,7 @@ export default function spectralVisionExtension(pi) {
191
191
  process.stderr.write("[spectral-vision] No vision model with auth configured. Image description disabled.\n");
192
192
  }
193
193
  });
194
- pi.on("context", async (event, ctx) => {
194
+ ext.on("context", async (event, ctx) => {
195
195
  const messages = event.messages;
196
196
  // Check if any message contains images
197
197
  let totalImages = 0;
package/dist/index.d.ts CHANGED
@@ -8,8 +8,8 @@
8
8
  * ```ts
9
9
  * import type { ExtensionAPI, ToolDefinition } from "@aexol/spectral";
10
10
  *
11
- * export default function activate(pi: ExtensionAPI): void {
12
- * pi.registerTool({
11
+ * export default function activate(ext: ExtensionAPI): void {
12
+ * ext.registerTool({
13
13
  * name: "my_tool",
14
14
  * label: "My Tool",
15
15
  * description: "Does something useful.",
@@ -26,8 +26,8 @@
26
26
  * ```ts
27
27
  * import type { ExtensionAPI, BeforeAgentStartEvent } from "@aexol/spectral";
28
28
  *
29
- * export default function activate(pi: ExtensionAPI): void {
30
- * pi.on("before_agent_start", (event, ctx) => {
29
+ * export default function activate(ext: ExtensionAPI): void {
30
+ * ext.on("before_agent_start", (event, ctx) => {
31
31
  * // inspect or modify the system prompt
32
32
  * return { systemPrompt: event.systemPrompt + "\nExtra instructions..." };
33
33
  * });
package/dist/index.js CHANGED
@@ -8,8 +8,8 @@
8
8
  * ```ts
9
9
  * import type { ExtensionAPI, ToolDefinition } from "@aexol/spectral";
10
10
  *
11
- * export default function activate(pi: ExtensionAPI): void {
12
- * pi.registerTool({
11
+ * export default function activate(ext: ExtensionAPI): void {
12
+ * ext.registerTool({
13
13
  * name: "my_tool",
14
14
  * label: "My Tool",
15
15
  * description: "Does something useful.",
@@ -26,8 +26,8 @@
26
26
  * ```ts
27
27
  * import type { ExtensionAPI, BeforeAgentStartEvent } from "@aexol/spectral";
28
28
  *
29
- * export default function activate(pi: ExtensionAPI): void {
30
- * pi.on("before_agent_start", (event, ctx) => {
29
+ * export default function activate(ext: ExtensionAPI): void {
30
+ * ext.on("before_agent_start", (event, ctx) => {
31
31
  * // inspect or modify the system prompt
32
32
  * return { systemPrompt: event.systemPrompt + "\nExtra instructions..." };
33
33
  * });
@@ -5,5 +5,5 @@ export declare function showStatus(state: McpExtensionState, ctx: ExtensionConte
5
5
  export declare function showTools(state: McpExtensionState, ctx: ExtensionContext): Promise<void>;
6
6
  export declare function reconnectServers(state: McpExtensionState, ctx: ExtensionContext, targetServer?: string): Promise<void>;
7
7
  export declare function authenticateServer(serverName: string, config: McpConfig, ctx: ExtensionContext): Promise<void>;
8
- export declare function showSetupStatus(state: McpExtensionState, pi: ExtensionAPI, ctx: ExtensionContext, configOverridePath?: string): Promise<void>;
8
+ export declare function showSetupStatus(state: McpExtensionState, ext: ExtensionAPI, ctx: ExtensionContext, configOverridePath?: string): Promise<void>;
9
9
  //# sourceMappingURL=commands.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/mcp/commands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,YAAY,CAAC;AASzD,wBAAsB,UAAU,CAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsC/F;AAED,wBAAsB,SAAS,CAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmB9F;AAED,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,iBAAiB,EACxB,GAAG,EAAE,gBAAgB,EACrB,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC,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J"}
@@ -131,7 +131,7 @@ export async function authenticateServer(serverName, config, ctx) {
131
131
  ctx.ui.notify(`Failed to authenticate "${serverName}": ${message}`, "error");
132
132
  }
133
133
  }
134
- export async function showSetupStatus(state, pi, ctx, configOverridePath) {
134
+ export async function showSetupStatus(state, ext, ctx, configOverridePath) {
135
135
  // Show MCP status first, then check for shared-config discovery hints
136
136
  await showStatus(state, ctx);
137
137
  if (!ctx.hasUI)