@tryvira/mcp 0.1.0 → 0.1.2
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/cli.js +2 -2
- package/dist/index.js +0 -1
- package/package.json +5 -9
- package/dist/cli.js.map +0 -7
- package/dist/domain/src/scope-composer.d.ts +0 -138
- package/dist/domain/src/vnext.d.ts +0 -53
- package/dist/index.js.map +0 -7
- package/dist/mcp/src/index.d.ts +0 -1
- package/dist/migrations/001_vnext_foundation.sql +0 -628
- package/dist/runtime/src/mcp-gateway.d.ts +0 -104
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { type ComposedScope } from '../../domain/src/scope-composer.ts';
|
|
2
|
-
import type { Scope } from '../../domain/src/vnext.ts';
|
|
3
|
-
export interface McpInvocation extends Scope {
|
|
4
|
-
id: string;
|
|
5
|
-
server: string;
|
|
6
|
-
tool: string;
|
|
7
|
-
arguments: Record<string, unknown>;
|
|
8
|
-
receiptId: string;
|
|
9
|
-
idempotencyKey: string;
|
|
10
|
-
authorityDigest?: string;
|
|
11
|
-
composedScope?: ComposedScope;
|
|
12
|
-
}
|
|
13
|
-
export interface McpResult extends Scope {
|
|
14
|
-
invocationId: string;
|
|
15
|
-
ok: boolean;
|
|
16
|
-
result?: unknown;
|
|
17
|
-
error?: string;
|
|
18
|
-
provenanceDigest: string;
|
|
19
|
-
server: string;
|
|
20
|
-
tool: string;
|
|
21
|
-
receiptId: string;
|
|
22
|
-
idempotencyKey: string;
|
|
23
|
-
argumentsDigest: string;
|
|
24
|
-
authorityDecisionDigest: string;
|
|
25
|
-
authorityDigest?: string | null;
|
|
26
|
-
}
|
|
27
|
-
export interface McpTransport {
|
|
28
|
-
call(input: {
|
|
29
|
-
server: string;
|
|
30
|
-
tool: string;
|
|
31
|
-
arguments: Record<string, unknown>;
|
|
32
|
-
signal?: AbortSignal;
|
|
33
|
-
}): Promise<{
|
|
34
|
-
result?: unknown;
|
|
35
|
-
error?: string;
|
|
36
|
-
}>;
|
|
37
|
-
}
|
|
38
|
-
export interface McpToolDefinition {
|
|
39
|
-
name: string;
|
|
40
|
-
description?: string;
|
|
41
|
-
inputSchema: Record<string, unknown>;
|
|
42
|
-
effectful?: boolean;
|
|
43
|
-
}
|
|
44
|
-
export interface McpResourceDefinition {
|
|
45
|
-
uri: string;
|
|
46
|
-
name: string;
|
|
47
|
-
description?: string;
|
|
48
|
-
mimeType?: string;
|
|
49
|
-
}
|
|
50
|
-
export interface McpPromptDefinition {
|
|
51
|
-
name: string;
|
|
52
|
-
description?: string;
|
|
53
|
-
arguments?: readonly Record<string, unknown>[];
|
|
54
|
-
}
|
|
55
|
-
export interface McpAuthorityDecision {
|
|
56
|
-
allowed: boolean;
|
|
57
|
-
decisionDigest: string;
|
|
58
|
-
reason?: string;
|
|
59
|
-
}
|
|
60
|
-
export interface McpCancellationRegistry {
|
|
61
|
-
register(requestId: string): AbortSignal;
|
|
62
|
-
cancel(requestId: string): boolean;
|
|
63
|
-
unregister(requestId: string, signal?: AbortSignal): void;
|
|
64
|
-
}
|
|
65
|
-
export declare function canonicalMcpJson(value: unknown): string;
|
|
66
|
-
export declare function verifyMcpResult(result: McpResult): true;
|
|
67
|
-
export declare function createMcpCancellationRegistry(): McpCancellationRegistry;
|
|
68
|
-
export declare function parseMcpEventStream(body: string, expectedId?: string): readonly string[];
|
|
69
|
-
export declare function createRegisteredMcpTransport(input: {
|
|
70
|
-
endpoint: string;
|
|
71
|
-
allowedHosts: readonly string[];
|
|
72
|
-
fetcher?: typeof fetch;
|
|
73
|
-
timeoutMs?: number;
|
|
74
|
-
protocolVersion?: string;
|
|
75
|
-
headers?: Readonly<Record<string, string>>;
|
|
76
|
-
}): McpTransport;
|
|
77
|
-
export declare function handleMcpJsonRpc(input: {
|
|
78
|
-
request: {
|
|
79
|
-
jsonrpc: '2.0';
|
|
80
|
-
id?: string | number;
|
|
81
|
-
method: string;
|
|
82
|
-
params?: Record<string, unknown>;
|
|
83
|
-
};
|
|
84
|
-
server: string;
|
|
85
|
-
tools: readonly McpToolDefinition[];
|
|
86
|
-
resources?: readonly McpResourceDefinition[];
|
|
87
|
-
prompts?: readonly McpPromptDefinition[];
|
|
88
|
-
readResource?: (uri: string) => Promise<Record<string, unknown> | null> | Record<string, unknown> | null;
|
|
89
|
-
getPrompt?: (name: string, args: Record<string, unknown>) => Promise<Record<string, unknown> | null> | Record<string, unknown> | null;
|
|
90
|
-
invocation: Omit<McpInvocation, 'server' | 'tool' | 'arguments'>;
|
|
91
|
-
transport: McpTransport;
|
|
92
|
-
signal?: AbortSignal;
|
|
93
|
-
cancellationRegistry?: McpCancellationRegistry;
|
|
94
|
-
authorize?: (input: {
|
|
95
|
-
invocation: McpInvocation;
|
|
96
|
-
definition: McpToolDefinition;
|
|
97
|
-
}) => Promise<McpAuthorityDecision> | McpAuthorityDecision;
|
|
98
|
-
}): Promise<Record<string, unknown> | null>;
|
|
99
|
-
export declare function invokeMcpTool(input: {
|
|
100
|
-
invocation: McpInvocation;
|
|
101
|
-
transport: McpTransport;
|
|
102
|
-
authority?: McpAuthorityDecision;
|
|
103
|
-
signal?: AbortSignal;
|
|
104
|
-
}): Promise<McpResult>;
|