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.
- package/README.md +4 -20
- package/dist/browser-ext.cjs +386 -360
- package/dist/browser-ext.cjs.map +1 -1
- package/dist/browser-ext.js +371 -345
- package/dist/browser-ext.js.map +1 -1
- package/dist/embed.cjs +635 -381
- package/dist/embed.cjs.map +1 -1
- package/dist/embed.d.cts +151 -2
- package/dist/embed.d.ts +151 -2
- package/dist/embed.js +612 -362
- package/dist/embed.js.map +1 -1
- package/dist/node-stdio.cjs +453 -473
- package/dist/node-stdio.cjs.map +1 -1
- package/dist/node-stdio.d.cts +12 -122
- package/dist/node-stdio.d.ts +12 -122
- package/dist/node-stdio.js +424 -444
- package/dist/node-stdio.js.map +1 -1
- package/dist/pricing.json +47 -9
- package/dist/self-check.cjs.map +1 -1
- package/dist/self-check.js.map +1 -1
- package/dist/types-BcprisDl.d.cts +76 -0
- package/dist/types-BcprisDl.d.ts +76 -0
- package/package.json +7 -2
package/dist/node-stdio.d.cts
CHANGED
|
@@ -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
|
|
317
|
-
*
|
|
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
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
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
|
|
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
|
/**
|
package/dist/node-stdio.d.ts
CHANGED
|
@@ -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
|
|
317
|
-
*
|
|
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
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
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
|
|
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
|
/**
|