crosscheck-mcp 0.2.28 → 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/dist/browser-ext.cjs +99 -11
- package/dist/browser-ext.cjs.map +1 -1
- package/dist/browser-ext.js +99 -11
- package/dist/browser-ext.js.map +1 -1
- package/dist/embed.cjs +303 -13
- package/dist/embed.cjs.map +1 -1
- package/dist/embed.d.cts +94 -2
- package/dist/embed.d.ts +94 -2
- package/dist/embed.js +302 -13
- package/dist/embed.js.map +1 -1
- package/dist/node-stdio.cjs +99 -11
- package/dist/node-stdio.cjs.map +1 -1
- package/dist/node-stdio.d.cts +1 -75
- package/dist/node-stdio.d.ts +1 -75
- package/dist/node-stdio.js +99 -11
- package/dist/node-stdio.js.map +1 -1
- package/dist/types-BcprisDl.d.cts +76 -0
- package/dist/types-BcprisDl.d.ts +76 -0
- package/package.json +1 -1
package/dist/embed.d.cts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { C as ChatMessage } from './types-BcprisDl.cjs';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* A record of which engine processes are alive, and what they are RUNNING.
|
|
3
5
|
*
|
|
@@ -128,6 +130,7 @@ declare const DEFAULT_EXCLUDED_PROVIDERS: readonly string[];
|
|
|
128
130
|
* inherits `process.env`. Keeping keys out of it is what stops a user's own
|
|
129
131
|
* `env | grep KEY` from printing their Anthropic key inside our app.
|
|
130
132
|
*/
|
|
133
|
+
|
|
131
134
|
/**
|
|
132
135
|
* Vault provider id → engine env var.
|
|
133
136
|
*
|
|
@@ -208,7 +211,54 @@ type EngineEvent =
|
|
|
208
211
|
runId: string;
|
|
209
212
|
at: number;
|
|
210
213
|
message: string;
|
|
214
|
+
}
|
|
215
|
+
/** ACTIVITY — one provider request went out. Emitted for EVERY model call
|
|
216
|
+
* a run makes, whatever the tool: panelists, the planner, workers,
|
|
217
|
+
* reviewers, judges, synthesis, the co-reasoner. `purpose` is the
|
|
218
|
+
* engine's role tag; `asked` is the start of the last user message. */
|
|
219
|
+
| {
|
|
220
|
+
type: "call.start";
|
|
221
|
+
runId: string;
|
|
222
|
+
at: number;
|
|
223
|
+
callId: number;
|
|
224
|
+
provider: string;
|
|
225
|
+
model: string;
|
|
226
|
+
purpose: string;
|
|
227
|
+
asked: string;
|
|
228
|
+
}
|
|
229
|
+
/** ACTIVITY — that request resolved. `text` is what the model said (capped
|
|
230
|
+
* at ACTIVITY_TEXT_CAP; `truncated` says so). Finished text, not a token
|
|
231
|
+
* stream: no adapter streams, and pretending otherwise would be a lie. */
|
|
232
|
+
| {
|
|
233
|
+
type: "call.done";
|
|
234
|
+
runId: string;
|
|
235
|
+
at: number;
|
|
236
|
+
callId: number;
|
|
237
|
+
provider: string;
|
|
238
|
+
model: string;
|
|
239
|
+
purpose: string;
|
|
240
|
+
ok: boolean;
|
|
241
|
+
ms: number;
|
|
242
|
+
text: string;
|
|
243
|
+
truncated: boolean;
|
|
244
|
+
error: string | null;
|
|
245
|
+
usage: EventUsage | null;
|
|
246
|
+
/** Set when the host stopped waiting (embed only): "user" from
|
|
247
|
+
* skip(), "timeout" from the run's per-call time limit. The request
|
|
248
|
+
* was aborted; the provider may still bill for work already done. */
|
|
249
|
+
stopped?: "user" | "timeout";
|
|
250
|
+
}
|
|
251
|
+
/** ACTIVITY — a step message from a multi-stage tool (orchestrate's
|
|
252
|
+
* levels, recombine). */
|
|
253
|
+
| {
|
|
254
|
+
type: "progress";
|
|
255
|
+
runId: string;
|
|
256
|
+
at: number;
|
|
257
|
+
message: string;
|
|
211
258
|
};
|
|
259
|
+
/** How much of each model reply an activity event carries. Enough to read
|
|
260
|
+
* the back-and-forth; the full text is in the envelope. */
|
|
261
|
+
declare const ACTIVITY_TEXT_CAP = 8000;
|
|
212
262
|
type EngineEventSink = (event: EngineEvent) => void;
|
|
213
263
|
interface EmbeddedEngineOptions {
|
|
214
264
|
/** Vault provider id → raw API key. Only providers present here are built.
|
|
@@ -224,6 +274,33 @@ interface EmbeddedEngineOptions {
|
|
|
224
274
|
/** Directory to archive run transcripts into. Omit to write none. */
|
|
225
275
|
transcriptsDir?: string;
|
|
226
276
|
}
|
|
277
|
+
interface RunOptions {
|
|
278
|
+
/** Stop waiting on any single model call after this long (ms). The run
|
|
279
|
+
* continues with the answers already in. Off when 0/undefined. */
|
|
280
|
+
callTimeoutMs?: number;
|
|
281
|
+
}
|
|
282
|
+
interface AskOptions {
|
|
283
|
+
/** Vault id ("grok", not "xai"). Must be a provider this engine built. */
|
|
284
|
+
provider: string;
|
|
285
|
+
/** Model override; defaults to the provider's effective model. */
|
|
286
|
+
model?: string;
|
|
287
|
+
messages: ChatMessage[];
|
|
288
|
+
schema?: Record<string, unknown>;
|
|
289
|
+
/** Role tag for usage + the activity feed, e.g. "unify" or "code". */
|
|
290
|
+
purpose: string;
|
|
291
|
+
maxTokens?: number;
|
|
292
|
+
runId?: string;
|
|
293
|
+
onEvent?: EngineEventSink;
|
|
294
|
+
}
|
|
295
|
+
interface AskResult {
|
|
296
|
+
ok: boolean;
|
|
297
|
+
/** The model's raw reply. */
|
|
298
|
+
text: string;
|
|
299
|
+
/** Schema-validated value when a schema was given and the reply passed. */
|
|
300
|
+
json: unknown | null;
|
|
301
|
+
error: string | null;
|
|
302
|
+
model: string;
|
|
303
|
+
}
|
|
227
304
|
interface EmbeddedEngine {
|
|
228
305
|
readonly version: string;
|
|
229
306
|
/** Providers actually built, by vault id — i.e. the ones with a usable key
|
|
@@ -233,12 +310,27 @@ interface EmbeddedEngine {
|
|
|
233
310
|
readonly models: Readonly<Record<string, string>>;
|
|
234
311
|
/** Every registered tool name. */
|
|
235
312
|
listTools(): string[];
|
|
313
|
+
/** A tool's required input fields, from its own schema — or null if there
|
|
314
|
+
* is no such tool. Lets a host test its argument mapping against the
|
|
315
|
+
* engine instead of guessing field names (the desktop guessed five of ten
|
|
316
|
+
* wrong, and every one of those tools failed on missing input). */
|
|
317
|
+
requiredArgs(name: string): string[] | null;
|
|
236
318
|
/** Invoke any tool and wait for the final envelope. No events. */
|
|
237
319
|
call(name: string, args: Record<string, unknown>): Promise<unknown>;
|
|
238
320
|
/** Invoke a tool, emitting lifecycle events as the panel progresses.
|
|
239
321
|
* `confer` and `debate` stream; every other tool emits `run.start` and
|
|
240
322
|
* `run.done` around a plain `call`, so a host can use one code path. */
|
|
241
|
-
run(name: string, args: Record<string, unknown>, onEvent: EngineEventSink): Promise<unknown>;
|
|
323
|
+
run(name: string, args: Record<string, unknown>, onEvent: EngineEventSink, opts?: RunOptions): Promise<unknown>;
|
|
324
|
+
/** Stop waiting on one provider for the rest of a run: its in-flight
|
|
325
|
+
* requests are aborted and later ones (e.g. debate rounds) aren't sent.
|
|
326
|
+
* The run carries on with everyone else. The run's moderator is never
|
|
327
|
+
* stopped mid-synthesis. Returns how many in-flight calls were stopped;
|
|
328
|
+
* 0 (and a no-op) once the run has finished. */
|
|
329
|
+
skip(runId: string, provider: string): number;
|
|
330
|
+
/** One call to one chosen provider/model — the host's own moderator or
|
|
331
|
+
* coding step. With `runId` + `onEvent` it reports into that run's
|
|
332
|
+
* activity feed. With `schema`, returns validated JSON when it can. */
|
|
333
|
+
ask(opts: AskOptions): Promise<AskResult>;
|
|
242
334
|
/** Flush queued telemetry. Call before the host process exits. */
|
|
243
335
|
close(): Promise<void>;
|
|
244
336
|
}
|
|
@@ -259,4 +351,4 @@ declare const __test_internals: {
|
|
|
259
351
|
vaultId: typeof vaultId;
|
|
260
352
|
};
|
|
261
353
|
|
|
262
|
-
export { DEFAULT_EXCLUDED_PROVIDERS, DEFAULT_FALLBACKS, DEFAULT_MODELS, type EmbeddedEngine, type EmbeddedEngineOptions, type EngineEvent, type EngineEventSink, type EventUsage, type ProcRecord, type ProcStatus, KEY_ENV as __KEY_ENV, MODEL_ENV as __MODEL_ENV, __test_internals, createEmbeddedEngine, isAlive, listProcesses, processRegistryPath };
|
|
354
|
+
export { ACTIVITY_TEXT_CAP, type AskOptions, type AskResult, DEFAULT_EXCLUDED_PROVIDERS, DEFAULT_FALLBACKS, DEFAULT_MODELS, type EmbeddedEngine, type EmbeddedEngineOptions, type EngineEvent, type EngineEventSink, type EventUsage, type ProcRecord, type ProcStatus, type RunOptions, KEY_ENV as __KEY_ENV, MODEL_ENV as __MODEL_ENV, __test_internals, createEmbeddedEngine, isAlive, listProcesses, processRegistryPath };
|
package/dist/embed.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { C as ChatMessage } from './types-BcprisDl.js';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* A record of which engine processes are alive, and what they are RUNNING.
|
|
3
5
|
*
|
|
@@ -128,6 +130,7 @@ declare const DEFAULT_EXCLUDED_PROVIDERS: readonly string[];
|
|
|
128
130
|
* inherits `process.env`. Keeping keys out of it is what stops a user's own
|
|
129
131
|
* `env | grep KEY` from printing their Anthropic key inside our app.
|
|
130
132
|
*/
|
|
133
|
+
|
|
131
134
|
/**
|
|
132
135
|
* Vault provider id → engine env var.
|
|
133
136
|
*
|
|
@@ -208,7 +211,54 @@ type EngineEvent =
|
|
|
208
211
|
runId: string;
|
|
209
212
|
at: number;
|
|
210
213
|
message: string;
|
|
214
|
+
}
|
|
215
|
+
/** ACTIVITY — one provider request went out. Emitted for EVERY model call
|
|
216
|
+
* a run makes, whatever the tool: panelists, the planner, workers,
|
|
217
|
+
* reviewers, judges, synthesis, the co-reasoner. `purpose` is the
|
|
218
|
+
* engine's role tag; `asked` is the start of the last user message. */
|
|
219
|
+
| {
|
|
220
|
+
type: "call.start";
|
|
221
|
+
runId: string;
|
|
222
|
+
at: number;
|
|
223
|
+
callId: number;
|
|
224
|
+
provider: string;
|
|
225
|
+
model: string;
|
|
226
|
+
purpose: string;
|
|
227
|
+
asked: string;
|
|
228
|
+
}
|
|
229
|
+
/** ACTIVITY — that request resolved. `text` is what the model said (capped
|
|
230
|
+
* at ACTIVITY_TEXT_CAP; `truncated` says so). Finished text, not a token
|
|
231
|
+
* stream: no adapter streams, and pretending otherwise would be a lie. */
|
|
232
|
+
| {
|
|
233
|
+
type: "call.done";
|
|
234
|
+
runId: string;
|
|
235
|
+
at: number;
|
|
236
|
+
callId: number;
|
|
237
|
+
provider: string;
|
|
238
|
+
model: string;
|
|
239
|
+
purpose: string;
|
|
240
|
+
ok: boolean;
|
|
241
|
+
ms: number;
|
|
242
|
+
text: string;
|
|
243
|
+
truncated: boolean;
|
|
244
|
+
error: string | null;
|
|
245
|
+
usage: EventUsage | null;
|
|
246
|
+
/** Set when the host stopped waiting (embed only): "user" from
|
|
247
|
+
* skip(), "timeout" from the run's per-call time limit. The request
|
|
248
|
+
* was aborted; the provider may still bill for work already done. */
|
|
249
|
+
stopped?: "user" | "timeout";
|
|
250
|
+
}
|
|
251
|
+
/** ACTIVITY — a step message from a multi-stage tool (orchestrate's
|
|
252
|
+
* levels, recombine). */
|
|
253
|
+
| {
|
|
254
|
+
type: "progress";
|
|
255
|
+
runId: string;
|
|
256
|
+
at: number;
|
|
257
|
+
message: string;
|
|
211
258
|
};
|
|
259
|
+
/** How much of each model reply an activity event carries. Enough to read
|
|
260
|
+
* the back-and-forth; the full text is in the envelope. */
|
|
261
|
+
declare const ACTIVITY_TEXT_CAP = 8000;
|
|
212
262
|
type EngineEventSink = (event: EngineEvent) => void;
|
|
213
263
|
interface EmbeddedEngineOptions {
|
|
214
264
|
/** Vault provider id → raw API key. Only providers present here are built.
|
|
@@ -224,6 +274,33 @@ interface EmbeddedEngineOptions {
|
|
|
224
274
|
/** Directory to archive run transcripts into. Omit to write none. */
|
|
225
275
|
transcriptsDir?: string;
|
|
226
276
|
}
|
|
277
|
+
interface RunOptions {
|
|
278
|
+
/** Stop waiting on any single model call after this long (ms). The run
|
|
279
|
+
* continues with the answers already in. Off when 0/undefined. */
|
|
280
|
+
callTimeoutMs?: number;
|
|
281
|
+
}
|
|
282
|
+
interface AskOptions {
|
|
283
|
+
/** Vault id ("grok", not "xai"). Must be a provider this engine built. */
|
|
284
|
+
provider: string;
|
|
285
|
+
/** Model override; defaults to the provider's effective model. */
|
|
286
|
+
model?: string;
|
|
287
|
+
messages: ChatMessage[];
|
|
288
|
+
schema?: Record<string, unknown>;
|
|
289
|
+
/** Role tag for usage + the activity feed, e.g. "unify" or "code". */
|
|
290
|
+
purpose: string;
|
|
291
|
+
maxTokens?: number;
|
|
292
|
+
runId?: string;
|
|
293
|
+
onEvent?: EngineEventSink;
|
|
294
|
+
}
|
|
295
|
+
interface AskResult {
|
|
296
|
+
ok: boolean;
|
|
297
|
+
/** The model's raw reply. */
|
|
298
|
+
text: string;
|
|
299
|
+
/** Schema-validated value when a schema was given and the reply passed. */
|
|
300
|
+
json: unknown | null;
|
|
301
|
+
error: string | null;
|
|
302
|
+
model: string;
|
|
303
|
+
}
|
|
227
304
|
interface EmbeddedEngine {
|
|
228
305
|
readonly version: string;
|
|
229
306
|
/** Providers actually built, by vault id — i.e. the ones with a usable key
|
|
@@ -233,12 +310,27 @@ interface EmbeddedEngine {
|
|
|
233
310
|
readonly models: Readonly<Record<string, string>>;
|
|
234
311
|
/** Every registered tool name. */
|
|
235
312
|
listTools(): string[];
|
|
313
|
+
/** A tool's required input fields, from its own schema — or null if there
|
|
314
|
+
* is no such tool. Lets a host test its argument mapping against the
|
|
315
|
+
* engine instead of guessing field names (the desktop guessed five of ten
|
|
316
|
+
* wrong, and every one of those tools failed on missing input). */
|
|
317
|
+
requiredArgs(name: string): string[] | null;
|
|
236
318
|
/** Invoke any tool and wait for the final envelope. No events. */
|
|
237
319
|
call(name: string, args: Record<string, unknown>): Promise<unknown>;
|
|
238
320
|
/** Invoke a tool, emitting lifecycle events as the panel progresses.
|
|
239
321
|
* `confer` and `debate` stream; every other tool emits `run.start` and
|
|
240
322
|
* `run.done` around a plain `call`, so a host can use one code path. */
|
|
241
|
-
run(name: string, args: Record<string, unknown>, onEvent: EngineEventSink): Promise<unknown>;
|
|
323
|
+
run(name: string, args: Record<string, unknown>, onEvent: EngineEventSink, opts?: RunOptions): Promise<unknown>;
|
|
324
|
+
/** Stop waiting on one provider for the rest of a run: its in-flight
|
|
325
|
+
* requests are aborted and later ones (e.g. debate rounds) aren't sent.
|
|
326
|
+
* The run carries on with everyone else. The run's moderator is never
|
|
327
|
+
* stopped mid-synthesis. Returns how many in-flight calls were stopped;
|
|
328
|
+
* 0 (and a no-op) once the run has finished. */
|
|
329
|
+
skip(runId: string, provider: string): number;
|
|
330
|
+
/** One call to one chosen provider/model — the host's own moderator or
|
|
331
|
+
* coding step. With `runId` + `onEvent` it reports into that run's
|
|
332
|
+
* activity feed. With `schema`, returns validated JSON when it can. */
|
|
333
|
+
ask(opts: AskOptions): Promise<AskResult>;
|
|
242
334
|
/** Flush queued telemetry. Call before the host process exits. */
|
|
243
335
|
close(): Promise<void>;
|
|
244
336
|
}
|
|
@@ -259,4 +351,4 @@ declare const __test_internals: {
|
|
|
259
351
|
vaultId: typeof vaultId;
|
|
260
352
|
};
|
|
261
353
|
|
|
262
|
-
export { DEFAULT_EXCLUDED_PROVIDERS, DEFAULT_FALLBACKS, DEFAULT_MODELS, type EmbeddedEngine, type EmbeddedEngineOptions, type EngineEvent, type EngineEventSink, type EventUsage, type ProcRecord, type ProcStatus, KEY_ENV as __KEY_ENV, MODEL_ENV as __MODEL_ENV, __test_internals, createEmbeddedEngine, isAlive, listProcesses, processRegistryPath };
|
|
354
|
+
export { ACTIVITY_TEXT_CAP, type AskOptions, type AskResult, DEFAULT_EXCLUDED_PROVIDERS, DEFAULT_FALLBACKS, DEFAULT_MODELS, type EmbeddedEngine, type EmbeddedEngineOptions, type EngineEvent, type EngineEventSink, type EventUsage, type ProcRecord, type ProcStatus, type RunOptions, KEY_ENV as __KEY_ENV, MODEL_ENV as __MODEL_ENV, __test_internals, createEmbeddedEngine, isAlive, listProcesses, processRegistryPath };
|