@akshar5/cohall 0.7.0 → 0.8.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.8.0](https://github.com/AksharP5/cohall/compare/v0.7.0...v0.8.0) (2026-09-27)
4
+
5
+
6
+ ### Features
7
+
8
+ * **doctor:** verify MCP server exposes tools ([#89](https://github.com/AksharP5/cohall/issues/89)) ([bee2abc](https://github.com/AksharP5/cohall/commit/bee2abcf64bd5715a88c560d07b8515455cd90d1))
9
+
3
10
  ## [0.7.0](https://github.com/AksharP5/cohall/compare/v0.6.2...v0.7.0) (2026-09-26)
4
11
 
5
12
 
package/bin/cohall.js CHANGED
@@ -17,7 +17,7 @@ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
17
17
 
18
18
  // packages/protocol/src/index.ts
19
19
  import { Effect, Schema } from "effect";
20
- var version = "0.7.0", maxSocketPayloadBytes, maxAttachmentBytes, maxTaskAttachments = 2, bounded = (maxLength) => Schema.String.check(Schema.isMinLength(1), Schema.isMaxLength(maxLength)), optionalText = (maxLength) => Schema.String.check(Schema.isMaxLength(maxLength)), boundedArray = (schema, maxLength) => Schema.Array(schema).check(Schema.isMaxLength(maxLength)), count, uuid = (name) => Schema.String.check(Schema.isUUID(4)).pipe(Schema.brand(name)), isoTimestamp = (name) => Schema.String.check(Schema.isPattern(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?Z$/, {
20
+ var version = "0.8.0", maxSocketPayloadBytes, maxAttachmentBytes, maxTaskAttachments = 2, bounded = (maxLength) => Schema.String.check(Schema.isMinLength(1), Schema.isMaxLength(maxLength)), optionalText = (maxLength) => Schema.String.check(Schema.isMaxLength(maxLength)), boundedArray = (schema, maxLength) => Schema.Array(schema).check(Schema.isMaxLength(maxLength)), count, uuid = (name) => Schema.String.check(Schema.isUUID(4)).pipe(Schema.brand(name)), isoTimestamp = (name) => Schema.String.check(Schema.isPattern(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?Z$/, {
21
21
  expected: "an ISO-8601 UTC timestamp"
22
22
  })).pipe(Schema.brand(name)), BotId, Bot, DeviceId, ThreadId, MessageId, TaskId, AuthSessionId, OperationId, Timestamp, Platform, Provider, DeviceStatus, TaskStatus, OperationStatus, TaskTraceEventKind, MessageRole, ConnectionRole, AuthSession, CreatePairingInput, PairingCredential, ExchangePairingInput, SessionCredential, PairingResult, Capability, Workspace, Device, minimumDeviceOperationVersion = "0.5.0", parsedVersion = (value) => {
23
23
  const match = /^v?(\d+)\.(\d+)\.(\d+)(-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/.exec(value);
@@ -5530,6 +5530,39 @@ var collectOutputs = async (directory) => {
5530
5530
  return files;
5531
5531
  };
5532
5532
 
5533
+ // apps/device/src/mcp-diagnostics.ts
5534
+ init_src();
5535
+ import { Client } from "@modelcontextprotocol/sdk/client/index.js";
5536
+ import {
5537
+ getDefaultEnvironment,
5538
+ StdioClientTransport
5539
+ } from "@modelcontextprotocol/sdk/client/stdio.js";
5540
+ var checkMcp = async (entrypoint, relayUrl, token) => {
5541
+ const client = new Client({ name: "cohall-doctor", version });
5542
+ const transport = new StdioClientTransport({
5543
+ command: process.execPath,
5544
+ args: [entrypoint, "mcp"],
5545
+ env: {
5546
+ ...getDefaultEnvironment(),
5547
+ COHALL_CONFIG: configurationPath(),
5548
+ COHALL_RELAY_URL: relayUrl,
5549
+ COHALL_CLIENT_TOKEN: token
5550
+ },
5551
+ stderr: "pipe"
5552
+ });
5553
+ try {
5554
+ await client.connect(transport, { timeout: 5000 });
5555
+ const { tools } = await client.listTools(undefined, { timeout: 5000 });
5556
+ if (tools.length === 0)
5557
+ return { status: "error", error: "MCP server exposed no tools" };
5558
+ return { status: "ok", tool_count: tools.length };
5559
+ } catch (cause) {
5560
+ return { status: "error", error: cause instanceof Error ? cause.message : String(cause) };
5561
+ } finally {
5562
+ await client.close();
5563
+ }
5564
+ };
5565
+
5533
5566
  // apps/device/src/cli.ts
5534
5567
  var valueOptions = new Set([
5535
5568
  "attach",
@@ -6132,6 +6165,7 @@ var runCli = async (command, raw) => {
6132
6165
  return;
6133
6166
  });
6134
6167
  const clientToken = process.env.COHALL_CLIENT_TOKEN ?? storedCredentials.clientToken;
6168
+ const mcp = clientToken === undefined ? { status: "not configured" } : await checkMcp(process.argv[1] ?? "", relayUrl, clientToken);
6135
6169
  const hasDeviceCredential = process.env.COHALL_DEVICE_TOKEN !== undefined || storedCredentials.deviceToken !== undefined;
6136
6170
  const deviceId = process.env.COHALL_DEVICE_ID ?? configuration2?.deviceId;
6137
6171
  const currentDevice = response?.ok !== true || clientToken === undefined || deviceId === undefined ? undefined : await Effect10.runPromise(exports_src.make({ baseUrl: relayUrl, token: clientToken }).devices()).then((devices) => devices.find((device) => device.id === deviceId)).catch(() => {
@@ -6141,6 +6175,7 @@ var runCli = async (command, raw) => {
6141
6175
  const warnings = [
6142
6176
  ...response?.ok === true ? [] : ["Relay is unreachable"],
6143
6177
  ...versionWarning === undefined ? [] : [versionWarning],
6178
+ ...mcp.status === "error" ? [`MCP check failed: ${mcp.error}`] : [],
6144
6179
  ...hasDeviceCredential && response?.ok === true && currentDevice?.status !== "online" && currentDevice?.status !== "busy" ? [
6145
6180
  clientToken === undefined ? "Device status cannot be checked without a client credential" : "Device daemon is not connected or is not registered with the relay"
6146
6181
  ] : [],
@@ -6154,6 +6189,7 @@ var runCli = async (command, raw) => {
6154
6189
  relay_url: relayUrl,
6155
6190
  config_path: configurationPath(),
6156
6191
  client_credential: process.env.COHALL_CLIENT_TOKEN !== undefined || storedCredentials.clientToken !== undefined,
6192
+ mcp,
6157
6193
  device_credential: hasDeviceCredential,
6158
6194
  workspaces: configuration2?.workspaces ?? [],
6159
6195
  providers: providerExecutables,
@@ -7071,4 +7107,4 @@ await main().catch((cause) => {
7071
7107
  process.exitCode = 1;
7072
7108
  });
7073
7109
 
7074
- //# debugId=C3F729038365DD7F64756E2164756E21
7110
+ //# debugId=9F11AB66C376A14E64756E2164756E21