crosscheck-mcp 0.2.27 → 0.2.29

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,6 @@
1
1
  import { Server } from '@modelcontextprotocol/sdk/server/index.js';
2
2
  import { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
3
+ import { P as Provider } from './types-BcprisDl.cjs';
3
4
 
4
5
  interface PricingDoc {
5
6
  /** `<provider>` -> `<model>` -> ModelRates. */
@@ -313,8 +314,8 @@ interface Storage extends StorageRead, StorageWrite {
313
314
  migrate(): Promise<{
314
315
  applied: readonly string[];
315
316
  }>;
316
- /** PRAGMA-derived canonical schema string. Used by the parity gate to
317
- * assert a TS-init'd DB has the same schema as a Python-init'd one. */
317
+ /** PRAGMA-derived canonical schema string, stable across SQLite versions
318
+ * and statement formatting. */
318
319
  canonicalSchema(): Promise<string>;
319
320
  /** Access the unsafe surface. Migrations only. */
320
321
  unsafe(): UnsafeStorage;
@@ -322,104 +323,14 @@ interface Storage extends StorageRead, StorageWrite {
322
323
  close(): Promise<void>;
323
324
  }
324
325
 
325
- /** One provider call's token + cost record. Mirrors `Usage.to_dict()`
326
- * output exactly. */
327
- interface Usage {
328
- provider: string;
329
- model: string;
330
- prompt_tokens: number;
331
- completion_tokens: number;
332
- cached_tokens: number;
333
- total_tokens: number;
334
- cost_usd: number;
335
- estimated: boolean;
336
- purpose: string;
337
- }
338
-
339
- /** Inbound message shape — chat-completions style. */
340
- interface ChatMessage {
341
- role: "system" | "user" | "assistant" | string;
342
- content: string;
343
- [k: string]: unknown;
344
- }
345
- /** A successful `send()` result. */
346
- interface SendResult {
347
- /** Concatenated text from the provider response. */
348
- text: string;
349
- /** Number of HTTP attempts that produced this result (>= 1). */
350
- attempts: number;
351
- /** Parsed + cost-augmented usage record. */
352
- usage: Usage;
353
- }
354
- /** Args passed into every `Provider.send()` call. Mirrors the Python
355
- * `send(messages, max_tokens, temperature, purpose='worker')` signature
356
- * plus an optional `signal` for cancellation. */
357
- interface SendArgs {
358
- messages: readonly ChatMessage[];
359
- maxTokens: number;
360
- temperature: number;
361
- purpose?: string;
362
- /** Optional AbortSignal so callers can cancel long-running calls. */
363
- signal?: AbortSignal;
364
- /** Optional one-call model override. Used by the cheap-mode tier
365
- * picker (see core/retarget.ts) to route a node to a cheaper model
366
- * without mutating the provider's default. */
367
- modelOverride?: string;
368
- /** F4b: optional JSON Schema that the response MUST conform to.
369
- * When set, provider adapters that support native structured output
370
- * (currently: openai-compatible adapter with provider=openai) wire
371
- * it into the request as `response_format: {type: "json_schema"}`
372
- * or the provider's equivalent. Adapters that don't support native
373
- * structured mode silently ignore this field — the schema-in-prompt
374
- * + F4c tolerant parser path still works as the universal fallback.
375
- * Mirror of OpenAI's json_schema spec; downstream adapters normalise
376
- * to their own provider's native shape. */
377
- jsonSchema?: Record<string, unknown>;
378
- }
379
- /** Provider adapter. */
380
- interface Provider {
381
- /** Lowercased identifier (e.g. "anthropic", "openai"). */
382
- readonly name: string;
383
- /** Default model for this provider (env-resolved at factory time). */
384
- readonly model: string;
385
- /** Ordered fallback models — "greenlight" candidates to try, in order,
386
- * when `model` comes back with a model-access failure (the account/
387
- * project doesn't have it enabled) rather than any other kind of
388
- * error. Env-resolved at factory time from `<PROVIDER>_MODEL_
389
- * FALLBACKS`, or set from a user's/org's configured chain. Empty for
390
- * most providers — a bad key or rate limit isn't fixed by switching
391
- * models, so this is only ever consulted for that one failure mode
392
- * (see core/model-fallback.ts). */
393
- readonly fallbackModels?: readonly string[];
394
- /** Make a request and return the parsed result. Throws `ProviderError`
395
- * on classified failures (auth, rate_limit, timeout, server, parse,
396
- * network, client). */
397
- send(args: SendArgs): Promise<SendResult>;
398
- }
399
-
400
- /** A live bridge to a Python crosscheck-agent child. */
401
- interface BridgeHandle {
402
- /** Names of the tools exposed by the Python child (from its
403
- * `tools/list` response). */
404
- readonly toolNames: ReadonlySet<string>;
405
- /** PID of the spawned Python child process, or `null` if the
406
- * transport hasn't started yet / has already closed. Useful for
407
- * shutdown verification and host-side diagnostics. */
408
- readonly pid: number | null;
409
- /** Forward a `tools/call` to the Python child and return the result
410
- * envelope verbatim. */
411
- callTool(name: string, args: Record<string, unknown>): Promise<{
412
- content: {
413
- type: string;
414
- text: string;
415
- }[];
416
- isError?: boolean;
417
- }>;
418
- /** Re-fetch the tool list (in case the child surfaces new tools mid-
419
- * session). Returns the new tool names. */
420
- refreshTools(): Promise<ReadonlySet<string>>;
421
- /** Tear down the bridge cleanly. Idempotent — repeat calls are no-ops. */
422
- close(): Promise<void>;
326
+ interface FetchConfig {
327
+ enabled?: boolean;
328
+ url_allowlist?: readonly string[];
329
+ max_bytes?: number;
330
+ max_bytes_per_session?: number;
331
+ max_unique_hosts_per_session?: number;
332
+ timeout_s?: number;
333
+ evidence_dir?: string;
423
334
  }
424
335
 
425
336
  /** Per-call node-cache config block. Mirrors Python's CFG.node_cache. */
@@ -461,30 +372,13 @@ interface ConfigPinningConfig {
461
372
  reject_drift?: boolean;
462
373
  }
463
374
 
464
- interface FetchConfig {
465
- enabled?: boolean;
466
- url_allowlist?: readonly string[];
467
- max_bytes?: number;
468
- max_bytes_per_session?: number;
469
- max_unique_hosts_per_session?: number;
470
- timeout_s?: number;
471
- evidence_dir?: string;
472
- }
473
-
474
375
  declare const SERVER_NAME = "crosscheck-agent";
475
376
  declare const SERVER_VERSION: string;
476
377
 
477
378
  interface CreateServerOptions {
478
- /** Optional Python bridge. When supplied, the bridge's tools are
479
- * merged into the registry as proxy entries — they forward `tools/call`
480
- * to the Python child. In Phase 4 this is route-all mode (every
481
- * tool name comes from Python); in Phase 5+ native TS tools
482
- * override per-name. */
483
- bridge?: BridgeHandle;
484
379
  /** Native LLM providers, keyed by lowercased name. Threaded into
485
380
  * pick / audit / confer via the tool registry. When absent, those
486
- * tools return a clear "no providers" error (or defer to the bridge
487
- * if one is wired). */
381
+ * tools return a clear "no providers" error. */
488
382
  providers?: Readonly<Record<string, Provider>>;
489
383
  /** Optional provider allowlist. */
490
384
  providerAllowlist?: readonly string[] | null;
@@ -530,10 +424,6 @@ interface CreateServerOptions {
530
424
  /**
531
425
  * Create a not-yet-connected MCP server with the current tool surface
532
426
  * registered. The caller is responsible for connecting it to a Transport.
533
- *
534
- * When `opts.bridge` is supplied, the Python tool surface is merged in
535
- * via proxy handlers — TS-native tools win on name collisions so we can
536
- * cut over per-tool in Phase 5 without restarting.
537
427
  */
538
428
  declare function createServer(opts?: CreateServerOptions): Server;
539
429
  /**
@@ -1,5 +1,6 @@
1
1
  import { Server } from '@modelcontextprotocol/sdk/server/index.js';
2
2
  import { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
3
+ import { P as Provider } from './types-BcprisDl.js';
3
4
 
4
5
  interface PricingDoc {
5
6
  /** `<provider>` -> `<model>` -> ModelRates. */
@@ -313,8 +314,8 @@ interface Storage extends StorageRead, StorageWrite {
313
314
  migrate(): Promise<{
314
315
  applied: readonly string[];
315
316
  }>;
316
- /** PRAGMA-derived canonical schema string. Used by the parity gate to
317
- * assert a TS-init'd DB has the same schema as a Python-init'd one. */
317
+ /** PRAGMA-derived canonical schema string, stable across SQLite versions
318
+ * and statement formatting. */
318
319
  canonicalSchema(): Promise<string>;
319
320
  /** Access the unsafe surface. Migrations only. */
320
321
  unsafe(): UnsafeStorage;
@@ -322,104 +323,14 @@ interface Storage extends StorageRead, StorageWrite {
322
323
  close(): Promise<void>;
323
324
  }
324
325
 
325
- /** One provider call's token + cost record. Mirrors `Usage.to_dict()`
326
- * output exactly. */
327
- interface Usage {
328
- provider: string;
329
- model: string;
330
- prompt_tokens: number;
331
- completion_tokens: number;
332
- cached_tokens: number;
333
- total_tokens: number;
334
- cost_usd: number;
335
- estimated: boolean;
336
- purpose: string;
337
- }
338
-
339
- /** Inbound message shape — chat-completions style. */
340
- interface ChatMessage {
341
- role: "system" | "user" | "assistant" | string;
342
- content: string;
343
- [k: string]: unknown;
344
- }
345
- /** A successful `send()` result. */
346
- interface SendResult {
347
- /** Concatenated text from the provider response. */
348
- text: string;
349
- /** Number of HTTP attempts that produced this result (>= 1). */
350
- attempts: number;
351
- /** Parsed + cost-augmented usage record. */
352
- usage: Usage;
353
- }
354
- /** Args passed into every `Provider.send()` call. Mirrors the Python
355
- * `send(messages, max_tokens, temperature, purpose='worker')` signature
356
- * plus an optional `signal` for cancellation. */
357
- interface SendArgs {
358
- messages: readonly ChatMessage[];
359
- maxTokens: number;
360
- temperature: number;
361
- purpose?: string;
362
- /** Optional AbortSignal so callers can cancel long-running calls. */
363
- signal?: AbortSignal;
364
- /** Optional one-call model override. Used by the cheap-mode tier
365
- * picker (see core/retarget.ts) to route a node to a cheaper model
366
- * without mutating the provider's default. */
367
- modelOverride?: string;
368
- /** F4b: optional JSON Schema that the response MUST conform to.
369
- * When set, provider adapters that support native structured output
370
- * (currently: openai-compatible adapter with provider=openai) wire
371
- * it into the request as `response_format: {type: "json_schema"}`
372
- * or the provider's equivalent. Adapters that don't support native
373
- * structured mode silently ignore this field — the schema-in-prompt
374
- * + F4c tolerant parser path still works as the universal fallback.
375
- * Mirror of OpenAI's json_schema spec; downstream adapters normalise
376
- * to their own provider's native shape. */
377
- jsonSchema?: Record<string, unknown>;
378
- }
379
- /** Provider adapter. */
380
- interface Provider {
381
- /** Lowercased identifier (e.g. "anthropic", "openai"). */
382
- readonly name: string;
383
- /** Default model for this provider (env-resolved at factory time). */
384
- readonly model: string;
385
- /** Ordered fallback models — "greenlight" candidates to try, in order,
386
- * when `model` comes back with a model-access failure (the account/
387
- * project doesn't have it enabled) rather than any other kind of
388
- * error. Env-resolved at factory time from `<PROVIDER>_MODEL_
389
- * FALLBACKS`, or set from a user's/org's configured chain. Empty for
390
- * most providers — a bad key or rate limit isn't fixed by switching
391
- * models, so this is only ever consulted for that one failure mode
392
- * (see core/model-fallback.ts). */
393
- readonly fallbackModels?: readonly string[];
394
- /** Make a request and return the parsed result. Throws `ProviderError`
395
- * on classified failures (auth, rate_limit, timeout, server, parse,
396
- * network, client). */
397
- send(args: SendArgs): Promise<SendResult>;
398
- }
399
-
400
- /** A live bridge to a Python crosscheck-agent child. */
401
- interface BridgeHandle {
402
- /** Names of the tools exposed by the Python child (from its
403
- * `tools/list` response). */
404
- readonly toolNames: ReadonlySet<string>;
405
- /** PID of the spawned Python child process, or `null` if the
406
- * transport hasn't started yet / has already closed. Useful for
407
- * shutdown verification and host-side diagnostics. */
408
- readonly pid: number | null;
409
- /** Forward a `tools/call` to the Python child and return the result
410
- * envelope verbatim. */
411
- callTool(name: string, args: Record<string, unknown>): Promise<{
412
- content: {
413
- type: string;
414
- text: string;
415
- }[];
416
- isError?: boolean;
417
- }>;
418
- /** Re-fetch the tool list (in case the child surfaces new tools mid-
419
- * session). Returns the new tool names. */
420
- refreshTools(): Promise<ReadonlySet<string>>;
421
- /** Tear down the bridge cleanly. Idempotent — repeat calls are no-ops. */
422
- close(): Promise<void>;
326
+ interface FetchConfig {
327
+ enabled?: boolean;
328
+ url_allowlist?: readonly string[];
329
+ max_bytes?: number;
330
+ max_bytes_per_session?: number;
331
+ max_unique_hosts_per_session?: number;
332
+ timeout_s?: number;
333
+ evidence_dir?: string;
423
334
  }
424
335
 
425
336
  /** Per-call node-cache config block. Mirrors Python's CFG.node_cache. */
@@ -461,30 +372,13 @@ interface ConfigPinningConfig {
461
372
  reject_drift?: boolean;
462
373
  }
463
374
 
464
- interface FetchConfig {
465
- enabled?: boolean;
466
- url_allowlist?: readonly string[];
467
- max_bytes?: number;
468
- max_bytes_per_session?: number;
469
- max_unique_hosts_per_session?: number;
470
- timeout_s?: number;
471
- evidence_dir?: string;
472
- }
473
-
474
375
  declare const SERVER_NAME = "crosscheck-agent";
475
376
  declare const SERVER_VERSION: string;
476
377
 
477
378
  interface CreateServerOptions {
478
- /** Optional Python bridge. When supplied, the bridge's tools are
479
- * merged into the registry as proxy entries — they forward `tools/call`
480
- * to the Python child. In Phase 4 this is route-all mode (every
481
- * tool name comes from Python); in Phase 5+ native TS tools
482
- * override per-name. */
483
- bridge?: BridgeHandle;
484
379
  /** Native LLM providers, keyed by lowercased name. Threaded into
485
380
  * pick / audit / confer via the tool registry. When absent, those
486
- * tools return a clear "no providers" error (or defer to the bridge
487
- * if one is wired). */
381
+ * tools return a clear "no providers" error. */
488
382
  providers?: Readonly<Record<string, Provider>>;
489
383
  /** Optional provider allowlist. */
490
384
  providerAllowlist?: readonly string[] | null;
@@ -530,10 +424,6 @@ interface CreateServerOptions {
530
424
  /**
531
425
  * Create a not-yet-connected MCP server with the current tool surface
532
426
  * registered. The caller is responsible for connecting it to a Transport.
533
- *
534
- * When `opts.bridge` is supplied, the Python tool surface is merged in
535
- * via proxy handlers — TS-native tools win on name collisions so we can
536
- * cut over per-tool in Phase 5 without restarting.
537
427
  */
538
428
  declare function createServer(opts?: CreateServerOptions): Server;
539
429
  /**