vouchington-tooling 1.2.1 → 1.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.
@@ -1,5 +1,5 @@
1
1
  import type { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
2
- import type { BlackboardClientDependencies } from '../agent-blackboard/client.mts';
2
+ import { type BlackboardClientDependencies } from '../agent-blackboard/client.mts';
3
3
  import type { RunTextCommand } from '../gh-cli/exec.mts';
4
4
  import { type SdkImporter } from './sdk.mts';
5
5
  export type RunMcpServerOptions = {
@@ -1,7 +1,18 @@
1
+ import { loadClient } from "../agent-blackboard/client.mjs";
1
2
  import { assertBlackboardInstalled, loadMcpSdk } from "./sdk.mjs";
2
3
  import { captureInstall } from "./install-info.mjs";
3
4
  import { createMcpServer } from "./server.mjs";
4
5
  import { launchWorktreeRoot, runIsolatedGit } from "./worktree.mjs";
6
+ /**
7
+ * Imports the agent-blackboard client once, at startup, and hands every tool call that module.
8
+ * Re-importing per call would break a running server whose install directory was evicted.
9
+ */
10
+ async function importBlackboard(resolveFrom) {
11
+ assertBlackboardInstalled(resolveFrom);
12
+ // Resolve from this package's install, never the worktree, matching tool dispatch.
13
+ const client = await loadClient({ resolveFrom: resolveFrom ?? import.meta.url });
14
+ return { loadClient: () => Promise.resolve(client) };
15
+ }
5
16
  /**
6
17
  * Starts the server and resolves once it is connected. Nothing on this path may write to stdout:
7
18
  * stdout is the protocol channel, so diagnostics go to stderr.
@@ -9,8 +20,7 @@ import { launchWorktreeRoot, runIsolatedGit } from "./worktree.mjs";
9
20
  export async function runMcpServer(options) {
10
21
  const runGit = options.runGit ?? runIsolatedGit;
11
22
  const sdk = await loadMcpSdk(options.importSdk);
12
- if (options.blackboard === undefined)
13
- assertBlackboardInstalled(options.resolveFrom);
23
+ const blackboard = options.blackboard ?? (await importBlackboard(options.resolveFrom));
14
24
  const launchRoot = await launchWorktreeRoot(options.cwd, runGit);
15
25
  const environment = {
16
26
  launchRoot,
@@ -18,7 +28,7 @@ export async function runMcpServer(options) {
18
28
  runGit,
19
29
  install: captureInstall(options.version),
20
30
  ...(options.resolveFrom === undefined ? {} : { resolveFrom: options.resolveFrom }),
21
- ...(options.blackboard === undefined ? {} : { blackboard: options.blackboard }),
31
+ blackboard,
22
32
  };
23
33
  const server = createMcpServer(sdk, environment, options.version);
24
34
  /* v8 ignore next -- the stdio default is exercised by the spawned-process test */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vouchington-tooling",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "Vouchington CLI and extractable tooling libraries.",
5
5
  "homepage": "https://github.com/vouchington/vouchington-tooling/tree/main/packages/vouchington-tooling#readme",
6
6
  "bugs": {