askell-mcp 0.4.12 → 0.4.14

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.
@@ -4,13 +4,10 @@ import {
4
4
  } from '@modelcontextprotocol/server';
5
5
 
6
6
  import type { MutationGate } from '../config.ts';
7
+ import { isRecord } from '../is-record.ts';
7
8
 
8
9
  export type MutationGateDecision = { action: 'execute' } | { action: 'elicit' };
9
10
 
10
- function isRecord(value: unknown): value is Record<string, unknown> {
11
- return value != null && typeof value === 'object' && !Array.isArray(value);
12
- }
13
-
14
11
  /**
15
12
  * Per-request client capabilities (protocol 2026-07-28).
16
13
  *
@@ -28,9 +25,8 @@ function isRecord(value: unknown): value is Record<string, unknown> {
28
25
  export function readClientCapabilities(
29
26
  envelope: unknown,
30
27
  ): ClientCapabilities | undefined {
31
- if (!isRecord(envelope)) {
32
- return undefined;
33
- }
28
+ if (!isRecord(envelope)) return undefined;
29
+
34
30
  const value = envelope[CLIENT_CAPABILITIES_META_KEY];
35
31
  return isRecord(value) ? (value as ClientCapabilities) : undefined;
36
32
  }
@@ -40,16 +36,13 @@ export function clientSupportsFormElicitation(
40
36
  capabilities: ClientCapabilities | undefined,
41
37
  ): boolean {
42
38
  const elicitation = capabilities?.elicitation;
43
- if (elicitation == null) {
44
- return false;
45
- }
46
- if (elicitation.form != null) {
47
- return true;
48
- }
39
+ if (elicitation == null) return false;
40
+ if (elicitation.form != null) return true;
41
+
49
42
  const keys = Object.keys(elicitation);
50
- if (elicitation.url != null && keys.every((key) => key === 'url')) {
43
+ if (elicitation.url != null && keys.every((key) => key === 'url'))
51
44
  return false;
52
- }
45
+
53
46
  return true;
54
47
  }
55
48