@agent-vm/mcp-portal 0.0.69 → 0.0.70
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 +42 -11
- package/dist/agent-bearer-token-DCtpDPCZ.js +59 -0
- package/dist/agent-bearer-token-DCtpDPCZ.js.map +1 -0
- package/dist/bin/mcp-portal.d.ts +28 -0
- package/dist/bin/mcp-portal.d.ts.map +1 -0
- package/dist/bin/mcp-portal.js +318 -0
- package/dist/bin/mcp-portal.js.map +1 -0
- package/dist/{catalog-types--gUGFPpN.d.ts → catalog-types-BVuB4Ynx.d.ts} +1 -1
- package/dist/{catalog-types--gUGFPpN.d.ts.map → catalog-types-BVuB4Ynx.d.ts.map} +1 -1
- package/dist/cli/index.d.ts +101 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +2 -0
- package/dist/core/index.d.ts +40 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +5 -0
- package/dist/hmac-env-B4shpRRB.js +20 -0
- package/dist/hmac-env-B4shpRRB.js.map +1 -0
- package/dist/hmac-token-DBqWY3-w.js +100 -0
- package/dist/hmac-token-DBqWY3-w.js.map +1 -0
- package/dist/index.d.ts +5 -485
- package/dist/index.js +4 -5
- package/dist/mcp-proxy/index.d.ts +24 -0
- package/dist/mcp-proxy/index.d.ts.map +1 -0
- package/dist/mcp-proxy/index.js +2 -0
- package/dist/portal-auth/agent-bearer-token.d.ts +22 -0
- package/dist/portal-auth/agent-bearer-token.d.ts.map +1 -0
- package/dist/portal-auth/agent-bearer-token.js +2 -0
- package/dist/portal-auth/hmac-env.d.ts +6 -0
- package/dist/portal-auth/hmac-env.d.ts.map +1 -0
- package/dist/portal-auth/hmac-env.js +2 -0
- package/dist/portal-auth/hmac-token.d.ts +40 -0
- package/dist/portal-auth/hmac-token.d.ts.map +1 -0
- package/dist/portal-auth/hmac-token.js +2 -0
- package/dist/portal-config/index.d.ts +11 -0
- package/dist/portal-config/index.d.ts.map +1 -0
- package/dist/{tool-vm → portal-config}/index.js +2 -3
- package/dist/portal-core-CZQI7Ob6.d.ts +264 -0
- package/dist/portal-core-CZQI7Ob6.d.ts.map +1 -0
- package/dist/portal-core-Cgu714CL.js +416 -0
- package/dist/portal-core-Cgu714CL.js.map +1 -0
- package/dist/portal-session-DG2CUjIo.d.ts +184 -0
- package/dist/portal-session-DG2CUjIo.d.ts.map +1 -0
- package/dist/portal-tools-DKci1szO.js +528 -0
- package/dist/portal-tools-DKci1szO.js.map +1 -0
- package/dist/resolve-agent-identity-DnC_Pmnh.js +550 -0
- package/dist/resolve-agent-identity-DnC_Pmnh.js.map +1 -0
- package/dist/resolve-agent-identity-FQL02YdW.d.ts +81 -0
- package/dist/resolve-agent-identity-FQL02YdW.d.ts.map +1 -0
- package/dist/serve-command-CnSMUybd.js +358 -0
- package/dist/serve-command-CnSMUybd.js.map +1 -0
- package/dist/testing/fake-upstream-mcp-server.d.ts +5 -2
- package/dist/testing/fake-upstream-mcp-server.d.ts.map +1 -1
- package/dist/testing/fake-upstream-mcp-server.js +14 -4
- package/dist/testing/fake-upstream-mcp-server.js.map +1 -1
- package/dist/typescript-artifact-BVLt3Ifd.js +60 -0
- package/dist/typescript-artifact-BVLt3Ifd.js.map +1 -0
- package/dist/upstream-mcp-client-runtime-JlsfTm7_.js +760 -0
- package/dist/upstream-mcp-client-runtime-JlsfTm7_.js.map +1 -0
- package/dist/upstream-response-middleware-1MZnAD9C.d.ts +115 -0
- package/dist/upstream-response-middleware-1MZnAD9C.d.ts.map +1 -0
- package/dist/upstream-response-middleware-BjUWZ2G8.js +172 -0
- package/dist/upstream-response-middleware-BjUWZ2G8.js.map +1 -0
- package/dist/{index-BcI9c8sg.d.ts → zod-schema-loader-DLGQpYFD.d.ts} +3 -9
- package/dist/zod-schema-loader-DLGQpYFD.d.ts.map +1 -0
- package/dist/{typescript-artifact-BqU8okQy.js → zod-schema-loader-yNekKNpm.js} +85 -55
- package/dist/zod-schema-loader-yNekKNpm.js.map +1 -0
- package/package.json +30 -13
- package/dist/bin/agent-vm-mcp-portal.d.ts +0 -10
- package/dist/bin/agent-vm-mcp-portal.d.ts.map +0 -1
- package/dist/bin/agent-vm-mcp-portal.js +0 -56
- package/dist/bin/agent-vm-mcp-portal.js.map +0 -1
- package/dist/bin/portal-server.d.ts +0 -55
- package/dist/bin/portal-server.d.ts.map +0 -1
- package/dist/bin/portal-server.js +0 -289
- package/dist/bin/portal-server.js.map +0 -1
- package/dist/index-BcI9c8sg.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/tool-vm/index.d.ts +0 -2
- package/dist/tool-vm-ihnzDyjJ.js +0 -3
- package/dist/typescript-artifact-BqU8okQy.js.map +0 -1
- package/dist/upstream-mcp-client-runtime-DiBCBsDj.js +0 -1729
- package/dist/upstream-mcp-client-runtime-DiBCBsDj.js.map +0 -1
- package/dist/zod-schema-loader-CDDtoRE1.js +0 -90
- package/dist/zod-schema-loader-CDDtoRE1.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,485 +1,5 @@
|
|
|
1
|
-
import { a as safeToolMetadataSchema, c as JsonPrimitive, d as isJsonObject, f as jsonObjectSchema, i as portalToolRecordSchema, l as JsonValue, n as PortalToolRecord, o as JsonArray, p as jsonValueSchema, r as portalToolAnnotationsSchema, s as JsonObject, t as PortalToolAnnotations, u as assertJsonObject } from "./catalog-types
|
|
2
|
-
import { a as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
7
|
-
import { McpPortalAgentConfig, McpPortalConfig, ResolvedMcpPortalProfile, SecretValue } from "@agent-vm/config-contracts";
|
|
8
|
-
import { SSEClientTransportOptions } from "@modelcontextprotocol/sdk/client/sse.js";
|
|
9
|
-
|
|
10
|
-
//#region src/auth/hmac-env.d.ts
|
|
11
|
-
declare function portalHmacKeyEnvName(agentId: string): string;
|
|
12
|
-
declare function parseHmacKeysFromEnv(env: Readonly<Record<string, string | undefined>>): ReadonlyMap<string, Buffer>;
|
|
13
|
-
//#endregion
|
|
14
|
-
//#region src/auth/hmac-token.d.ts
|
|
15
|
-
interface ApprovalTokenCallDigest {
|
|
16
|
-
readonly argumentsHash: string;
|
|
17
|
-
readonly namespace: string;
|
|
18
|
-
readonly toolName: string;
|
|
19
|
-
}
|
|
20
|
-
interface SignApprovalTokenProps {
|
|
21
|
-
readonly agentId: string;
|
|
22
|
-
readonly calls: readonly ApprovalTokenCallDigest[];
|
|
23
|
-
readonly expiresAtMs: number;
|
|
24
|
-
readonly key: Buffer;
|
|
25
|
-
}
|
|
26
|
-
interface VerifyApprovalTokenProps {
|
|
27
|
-
readonly agentId: string;
|
|
28
|
-
readonly calls: readonly ApprovalTokenCallDigest[];
|
|
29
|
-
readonly key: Buffer;
|
|
30
|
-
readonly nowMs: number;
|
|
31
|
-
readonly token: string;
|
|
32
|
-
}
|
|
33
|
-
type VerifyApprovalTokenResult = {
|
|
34
|
-
readonly ok: true;
|
|
35
|
-
} | {
|
|
36
|
-
readonly ok: false;
|
|
37
|
-
readonly reason: 'agent-mismatch' | 'call-mismatch' | 'expired' | 'malformed' | 'signature-mismatch';
|
|
38
|
-
};
|
|
39
|
-
declare function hashCallArguments(args: unknown): string;
|
|
40
|
-
declare function signApprovalToken(props: SignApprovalTokenProps): string;
|
|
41
|
-
declare function verifyApprovalToken(props: VerifyApprovalTokenProps): VerifyApprovalTokenResult;
|
|
42
|
-
//#endregion
|
|
43
|
-
//#region src/mcp-server/portal-call-validation.d.ts
|
|
44
|
-
declare function validatePortalToolArguments(tool: PortalToolRecord, argumentsValue: JsonObject): {
|
|
45
|
-
readonly ok: true;
|
|
46
|
-
readonly value: unknown;
|
|
47
|
-
} | {
|
|
48
|
-
readonly error: {
|
|
49
|
-
readonly issues: readonly {
|
|
50
|
-
readonly code: string;
|
|
51
|
-
readonly message: string;
|
|
52
|
-
readonly path: readonly (number | string)[];
|
|
53
|
-
}[];
|
|
54
|
-
readonly kind: 'input_validation';
|
|
55
|
-
readonly namespace: string;
|
|
56
|
-
readonly toolName: string;
|
|
57
|
-
} | {
|
|
58
|
-
readonly feature: string;
|
|
59
|
-
readonly kind: 'schema_validation_unavailable';
|
|
60
|
-
readonly message: string;
|
|
61
|
-
readonly namespace: string;
|
|
62
|
-
readonly path: readonly (number | string)[];
|
|
63
|
-
readonly toolName: string;
|
|
64
|
-
};
|
|
65
|
-
readonly ok: false;
|
|
66
|
-
};
|
|
67
|
-
//#endregion
|
|
68
|
-
//#region src/portal-access-policy.d.ts
|
|
69
|
-
declare const portalAgentIdentityBrand: unique symbol;
|
|
70
|
-
type PortalAgentIdentity = {
|
|
71
|
-
readonly agentId: string;
|
|
72
|
-
readonly agentScopeId: string;
|
|
73
|
-
readonly sessionId?: string;
|
|
74
|
-
readonly [portalAgentIdentityBrand]: true;
|
|
75
|
-
};
|
|
76
|
-
interface PortalToolSelector {
|
|
77
|
-
readonly namespace: string;
|
|
78
|
-
readonly toolName: string;
|
|
79
|
-
}
|
|
80
|
-
type PortalDefaultPolicy = 'allow-all' | 'deny-all';
|
|
81
|
-
interface PortalAccessPolicyConfig {
|
|
82
|
-
readonly defaultPolicy?: PortalDefaultPolicy;
|
|
83
|
-
readonly enabledNamespaces?: readonly string[];
|
|
84
|
-
readonly enabledNamespacesByAgent: Readonly<Record<string, readonly string[]>>;
|
|
85
|
-
readonly enabledToolsByAgent?: Readonly<Record<string, readonly PortalToolSelector[]>>;
|
|
86
|
-
readonly hiddenToolsByAgent: Readonly<Record<string, readonly PortalToolSelector[]>>;
|
|
87
|
-
}
|
|
88
|
-
interface ResolvedPortalAccessPolicy {
|
|
89
|
-
readonly allowedNamespaces: readonly string[];
|
|
90
|
-
readonly enabledTools: readonly PortalToolSelector[];
|
|
91
|
-
readonly hiddenTools: readonly PortalToolSelector[];
|
|
92
|
-
}
|
|
93
|
-
declare function createPortalAgentIdentity(input: {
|
|
94
|
-
readonly agentId: string;
|
|
95
|
-
readonly agentScopeId: string;
|
|
96
|
-
readonly sessionId?: string;
|
|
97
|
-
}): PortalAgentIdentity;
|
|
98
|
-
declare function portalAgentScopeKey(identity: PortalAgentIdentity): string;
|
|
99
|
-
declare function resolvePortalAccessPolicy(props: {
|
|
100
|
-
readonly config: PortalAccessPolicyConfig;
|
|
101
|
-
readonly identity: PortalAgentIdentity;
|
|
102
|
-
readonly upstreamNamespaces: readonly string[];
|
|
103
|
-
}): ResolvedPortalAccessPolicy;
|
|
104
|
-
//#endregion
|
|
105
|
-
//#region src/tool-ref.d.ts
|
|
106
|
-
interface ToolIdentity {
|
|
107
|
-
readonly namespace: string;
|
|
108
|
-
readonly toolName: string;
|
|
109
|
-
}
|
|
110
|
-
declare const toolRefSchema: z.core.$ZodBranded<z.ZodString, "ToolRef", "out">;
|
|
111
|
-
type ToolRef = z.infer<typeof toolRefSchema>;
|
|
112
|
-
declare function encodeToolRef(identity: ToolIdentity): ToolRef;
|
|
113
|
-
declare function decodeToolRef(toolRef: string | ToolRef): ToolIdentity;
|
|
114
|
-
//#endregion
|
|
115
|
-
//#region src/tool-graph.d.ts
|
|
116
|
-
type ToolRelationshipType = 'entity' | 'schema-field' | 'skill';
|
|
117
|
-
interface ToolRelationshipEndpoint extends ToolIdentity {
|
|
118
|
-
readonly toolRef: string;
|
|
119
|
-
}
|
|
120
|
-
interface ToolRelationship {
|
|
121
|
-
readonly field?: string;
|
|
122
|
-
readonly from: ToolRelationshipEndpoint;
|
|
123
|
-
readonly reason: string;
|
|
124
|
-
readonly to: ToolRelationshipEndpoint;
|
|
125
|
-
readonly type: ToolRelationshipType;
|
|
126
|
-
}
|
|
127
|
-
interface SkillGraphInput {
|
|
128
|
-
readonly description?: string;
|
|
129
|
-
readonly tags?: readonly string[];
|
|
130
|
-
readonly title: string;
|
|
131
|
-
readonly toolRefs: readonly string[];
|
|
132
|
-
}
|
|
133
|
-
interface ScopedSkillGraphEntry {
|
|
134
|
-
readonly description?: string;
|
|
135
|
-
readonly tags: readonly string[];
|
|
136
|
-
readonly title: string;
|
|
137
|
-
readonly toolRefs: readonly string[];
|
|
138
|
-
}
|
|
139
|
-
interface ToolGraphInput {
|
|
140
|
-
readonly skills?: readonly SkillGraphInput[];
|
|
141
|
-
readonly tools: readonly PortalToolRecord[];
|
|
142
|
-
}
|
|
143
|
-
interface ToolGraph {
|
|
144
|
-
readonly relationships: readonly ToolRelationship[];
|
|
145
|
-
readonly skills: readonly ScopedSkillGraphEntry[];
|
|
146
|
-
}
|
|
147
|
-
declare function buildToolGraph(input: ToolGraphInput): ToolGraph;
|
|
148
|
-
//#endregion
|
|
149
|
-
//#region src/tool-summary.d.ts
|
|
150
|
-
interface ToolSchemaSummary {
|
|
151
|
-
readonly optional: readonly string[];
|
|
152
|
-
readonly propertyCount: number;
|
|
153
|
-
readonly required: readonly string[];
|
|
154
|
-
readonly type: string;
|
|
155
|
-
}
|
|
156
|
-
interface ToolSafetySummary {
|
|
157
|
-
readonly destructiveHint?: boolean;
|
|
158
|
-
readonly readOnlyHint?: boolean;
|
|
159
|
-
}
|
|
160
|
-
interface ToolSummary {
|
|
161
|
-
readonly description?: string;
|
|
162
|
-
readonly input: ToolSchemaSummary;
|
|
163
|
-
readonly namespace: string;
|
|
164
|
-
readonly output?: ToolSchemaSummary;
|
|
165
|
-
readonly safety: ToolSafetySummary;
|
|
166
|
-
readonly title?: string;
|
|
167
|
-
readonly toolName: string;
|
|
168
|
-
readonly toolRef: string;
|
|
169
|
-
}
|
|
170
|
-
declare function summarizeJsonSchema(schema: JsonObject): ToolSchemaSummary;
|
|
171
|
-
declare function createToolSummary(tool: PortalToolRecord): ToolSummary;
|
|
172
|
-
//#endregion
|
|
173
|
-
//#region src/search-index.d.ts
|
|
174
|
-
interface SearchQuery {
|
|
175
|
-
readonly limit: number;
|
|
176
|
-
readonly namespaces?: readonly string[];
|
|
177
|
-
readonly query?: string;
|
|
178
|
-
}
|
|
179
|
-
interface SearchResultSet {
|
|
180
|
-
readonly results: readonly ToolSearchResult[];
|
|
181
|
-
}
|
|
182
|
-
interface SearchIndex {
|
|
183
|
-
readonly search: (query: SearchQuery) => SearchResultSet;
|
|
184
|
-
}
|
|
185
|
-
interface ToolRelationshipHint {
|
|
186
|
-
readonly field?: string;
|
|
187
|
-
readonly reason: string;
|
|
188
|
-
readonly sourceToolRef: string;
|
|
189
|
-
readonly type: ToolRelationship['type'];
|
|
190
|
-
}
|
|
191
|
-
interface ToolSearchResult extends ToolSummary {
|
|
192
|
-
readonly relationshipHints?: readonly ToolRelationshipHint[];
|
|
193
|
-
readonly schemaFieldMatches?: readonly string[];
|
|
194
|
-
}
|
|
195
|
-
declare function createSearchIndex(tools: readonly PortalToolRecord[], graph?: ToolGraph): SearchIndex;
|
|
196
|
-
//#endregion
|
|
197
|
-
//#region src/portal-session.d.ts
|
|
198
|
-
interface PortalCatalogSnapshot {
|
|
199
|
-
readonly agentScopeId: string;
|
|
200
|
-
readonly discoveryFailures: readonly PortalDiscoveryFailure[];
|
|
201
|
-
readonly generatedAt: string;
|
|
202
|
-
readonly sourceHash: string;
|
|
203
|
-
readonly tools: readonly PortalToolRecord[];
|
|
204
|
-
}
|
|
205
|
-
interface PortalDiscoveryFailure {
|
|
206
|
-
readonly message: string;
|
|
207
|
-
readonly namespace: string;
|
|
208
|
-
}
|
|
209
|
-
interface PortalSession {
|
|
210
|
-
readonly catalog: PortalCatalogSnapshot;
|
|
211
|
-
readonly graph: ToolGraph;
|
|
212
|
-
readonly identity: PortalAgentIdentity;
|
|
213
|
-
readonly searchIndex: SearchIndex;
|
|
214
|
-
}
|
|
215
|
-
interface PortalSessionRuntime {
|
|
216
|
-
readonly closeAgentScope: (agentScopeId: string) => Promise<void> | void;
|
|
217
|
-
readonly closeSession?: (scopeKey: string) => Promise<void> | void;
|
|
218
|
-
readonly listTools: (call: {
|
|
219
|
-
readonly agentScopeId: string;
|
|
220
|
-
readonly namespace: string;
|
|
221
|
-
}) => Promise<readonly Tool[]>;
|
|
222
|
-
}
|
|
223
|
-
interface PortalSessionManagerOptions {
|
|
224
|
-
readonly accessPolicy: PortalAccessPolicyConfig;
|
|
225
|
-
readonly catalogTtlMs: number;
|
|
226
|
-
readonly discoveryFailures?: readonly PortalDiscoveryFailure[];
|
|
227
|
-
readonly now?: () => number;
|
|
228
|
-
readonly runtime: PortalSessionRuntime;
|
|
229
|
-
readonly skills?: readonly SkillGraphInput[];
|
|
230
|
-
readonly upstreamNamespaces: readonly string[];
|
|
231
|
-
}
|
|
232
|
-
interface PortalSessionManager {
|
|
233
|
-
readonly getSession: (identity: PortalAgentIdentity) => Promise<PortalSession>;
|
|
234
|
-
readonly invalidateAgentScope: (agentScopeId: string) => Promise<void>;
|
|
235
|
-
readonly invalidateSession: (identity: PortalAgentIdentity) => Promise<void>;
|
|
236
|
-
}
|
|
237
|
-
declare function createPortalSessionManager(options: PortalSessionManagerOptions): PortalSessionManager;
|
|
238
|
-
//#endregion
|
|
239
|
-
//#region src/mcp-server/portal-tools.d.ts
|
|
240
|
-
interface PortalToolSuccess {
|
|
241
|
-
readonly input: Readonly<Record<string, unknown>>;
|
|
242
|
-
readonly ok: true;
|
|
243
|
-
readonly output: Readonly<Record<string, unknown>>;
|
|
244
|
-
}
|
|
245
|
-
interface PortalToolFailure {
|
|
246
|
-
readonly error: unknown;
|
|
247
|
-
readonly input: Readonly<Record<string, unknown>>;
|
|
248
|
-
readonly ok: false;
|
|
249
|
-
}
|
|
250
|
-
type PortalToolResult = PortalToolFailure | PortalToolSuccess;
|
|
251
|
-
type PortalToolResultMap = Readonly<Record<string, PortalToolResult>>;
|
|
252
|
-
interface PortalBatchError {
|
|
253
|
-
readonly id?: string;
|
|
254
|
-
readonly kind: string;
|
|
255
|
-
readonly message: string;
|
|
256
|
-
}
|
|
257
|
-
interface PortalBatchDiagnostic {
|
|
258
|
-
readonly kind: string;
|
|
259
|
-
readonly message: string;
|
|
260
|
-
readonly namespace?: string;
|
|
261
|
-
}
|
|
262
|
-
interface PortalBatchResult {
|
|
263
|
-
readonly diagnostics: readonly PortalBatchDiagnostic[];
|
|
264
|
-
readonly errors: readonly PortalBatchError[];
|
|
265
|
-
readonly ok: boolean;
|
|
266
|
-
readonly results: PortalToolResultMap;
|
|
267
|
-
}
|
|
268
|
-
interface PortalApprovalCall {
|
|
269
|
-
readonly arguments: JsonObject;
|
|
270
|
-
readonly id: string;
|
|
271
|
-
readonly namespace: string;
|
|
272
|
-
readonly tool: PortalToolRecord;
|
|
273
|
-
readonly toolName: string;
|
|
274
|
-
}
|
|
275
|
-
declare const portalToolInputSchemas: {
|
|
276
|
-
readonly mcp_portal_call: {
|
|
277
|
-
[x: string]: unknown;
|
|
278
|
-
type: "object";
|
|
279
|
-
properties?: {
|
|
280
|
-
[x: string]: object;
|
|
281
|
-
} | undefined;
|
|
282
|
-
required?: string[] | undefined;
|
|
283
|
-
};
|
|
284
|
-
readonly mcp_portal_describe: {
|
|
285
|
-
[x: string]: unknown;
|
|
286
|
-
type: "object";
|
|
287
|
-
properties?: {
|
|
288
|
-
[x: string]: object;
|
|
289
|
-
} | undefined;
|
|
290
|
-
required?: string[] | undefined;
|
|
291
|
-
};
|
|
292
|
-
readonly mcp_portal_list: {
|
|
293
|
-
[x: string]: unknown;
|
|
294
|
-
type: "object";
|
|
295
|
-
properties?: {
|
|
296
|
-
[x: string]: object;
|
|
297
|
-
} | undefined;
|
|
298
|
-
required?: string[] | undefined;
|
|
299
|
-
};
|
|
300
|
-
readonly mcp_portal_search: {
|
|
301
|
-
[x: string]: unknown;
|
|
302
|
-
type: "object";
|
|
303
|
-
properties?: {
|
|
304
|
-
[x: string]: object;
|
|
305
|
-
} | undefined;
|
|
306
|
-
required?: string[] | undefined;
|
|
307
|
-
};
|
|
308
|
-
};
|
|
309
|
-
interface PortalToolHandlerCall {
|
|
310
|
-
readonly identity: PortalAgentIdentity;
|
|
311
|
-
readonly input: unknown;
|
|
312
|
-
}
|
|
313
|
-
interface PortalCallUpstreamTool {
|
|
314
|
-
readonly arguments: JsonObject;
|
|
315
|
-
readonly agentScopeId: string;
|
|
316
|
-
readonly namespace: string;
|
|
317
|
-
readonly toolName: string;
|
|
318
|
-
}
|
|
319
|
-
interface PortalToolRuntime {
|
|
320
|
-
readonly approval?: (calls: readonly PortalApprovalCall[], identity: PortalAgentIdentity, approvalToken: string | undefined) => {
|
|
321
|
-
readonly kind: 'allow';
|
|
322
|
-
} | {
|
|
323
|
-
readonly kind: 'approval_token_invalid';
|
|
324
|
-
readonly reason: string;
|
|
325
|
-
} | {
|
|
326
|
-
readonly kind: 'approval_token_missing';
|
|
327
|
-
} | {
|
|
328
|
-
readonly kind: 'approval_required';
|
|
329
|
-
readonly level: 'critical' | 'standard';
|
|
330
|
-
};
|
|
331
|
-
readonly callUpstreamTool: (call: PortalCallUpstreamTool) => Promise<unknown>;
|
|
332
|
-
readonly getSession: (identity: PortalAgentIdentity) => Promise<PortalSession>;
|
|
333
|
-
}
|
|
334
|
-
interface PortalToolHandlers {
|
|
335
|
-
readonly call: (call: PortalToolHandlerCall) => Promise<PortalBatchResult>;
|
|
336
|
-
readonly describe: (call: PortalToolHandlerCall) => Promise<PortalBatchResult>;
|
|
337
|
-
readonly list: (call: PortalToolHandlerCall) => Promise<PortalBatchResult>;
|
|
338
|
-
readonly search: (call: PortalToolHandlerCall) => Promise<PortalBatchResult>;
|
|
339
|
-
}
|
|
340
|
-
declare function createPortalToolHandlers(runtime: PortalToolRuntime): PortalToolHandlers;
|
|
341
|
-
//#endregion
|
|
342
|
-
//#region src/mcp-server/portal-http-server.d.ts
|
|
343
|
-
interface PortalHttpAgentIdentity extends PortalAgentIdentity {}
|
|
344
|
-
interface PortalServerAccess {
|
|
345
|
-
readonly expectedValue: string;
|
|
346
|
-
readonly headerName: string;
|
|
347
|
-
}
|
|
348
|
-
interface PortalHttpAppOptions {
|
|
349
|
-
readonly onSessionClosed?: (identity: PortalAgentIdentity) => Promise<void> | void;
|
|
350
|
-
readonly registeredAgentIds?: readonly string[];
|
|
351
|
-
readonly resolveAgentIdentity?: (agentId: string) => PortalHttpAgentIdentity | null;
|
|
352
|
-
readonly serverAccess?: PortalServerAccess;
|
|
353
|
-
readonly toolRuntime: PortalToolRuntime;
|
|
354
|
-
}
|
|
355
|
-
type PortalHttpApp = Hono & {
|
|
356
|
-
readonly closePortalSessions: () => Promise<void>;
|
|
357
|
-
};
|
|
358
|
-
declare function createPortalHttpApp(options: PortalHttpAppOptions): PortalHttpApp;
|
|
359
|
-
//#endregion
|
|
360
|
-
//#region src/mcp-server/portal-mcp-server.d.ts
|
|
361
|
-
declare const portalMcpToolNames: readonly ["mcp_portal_list", "mcp_portal_search", "mcp_portal_describe", "mcp_portal_call"];
|
|
362
|
-
type PortalMcpToolName = (typeof portalMcpToolNames)[number];
|
|
363
|
-
declare function listPortalMcpTools(): readonly Tool[];
|
|
364
|
-
declare function createPortalMcpServer(props: {
|
|
365
|
-
readonly identity: PortalAgentIdentity;
|
|
366
|
-
readonly runtime: PortalToolRuntime;
|
|
367
|
-
}): Server;
|
|
368
|
-
//#endregion
|
|
369
|
-
//#region src/mcp-server/resolve-agent-identity.d.ts
|
|
370
|
-
interface ResolveAgentHmacKeysProps {
|
|
371
|
-
readonly agents: Readonly<Record<string, McpPortalAgentConfig>>;
|
|
372
|
-
readonly envKeys: ReadonlyMap<string, Buffer>;
|
|
373
|
-
readonly resolveSecret: (secret: SecretValue) => Promise<string>;
|
|
374
|
-
}
|
|
375
|
-
interface PortalAgentRuntimeRecord {
|
|
376
|
-
readonly agentId: string;
|
|
377
|
-
readonly hmacKey: Buffer;
|
|
378
|
-
readonly profile: ResolvedMcpPortalProfile;
|
|
379
|
-
readonly profileName: string;
|
|
380
|
-
}
|
|
381
|
-
declare function resolveAgentHmacKeys(props: ResolveAgentHmacKeysProps): Promise<ReadonlyMap<string, Buffer>>;
|
|
382
|
-
declare function createPortalAgentRuntimeRecords(props: {
|
|
383
|
-
readonly hmacKeys: ReadonlyMap<string, Buffer>;
|
|
384
|
-
readonly portalConfig: McpPortalConfig;
|
|
385
|
-
}): ReadonlyMap<string, PortalAgentRuntimeRecord>;
|
|
386
|
-
declare function createPortalHttpAgentResolver(records: ReadonlyMap<string, PortalAgentRuntimeRecord>): (agentId: string) => ReturnType<typeof createPortalAgentIdentity> | null;
|
|
387
|
-
interface ConservativeApprovalFallbackEvent {
|
|
388
|
-
readonly agentId: string;
|
|
389
|
-
readonly primaryReason: string;
|
|
390
|
-
readonly strictCallCount: number;
|
|
391
|
-
readonly conservativeCallCount: number;
|
|
392
|
-
readonly toolRefs: readonly string[];
|
|
393
|
-
}
|
|
394
|
-
declare function createPortalApprovalVerifier(props: {
|
|
395
|
-
readonly onConservativeApprovalFallback?: (event: ConservativeApprovalFallbackEvent) => void;
|
|
396
|
-
readonly records: ReadonlyMap<string, PortalAgentRuntimeRecord>;
|
|
397
|
-
}): (calls: readonly PortalApprovalCall[], agentId: string, token: string | undefined) => {
|
|
398
|
-
readonly kind: 'allow';
|
|
399
|
-
} | {
|
|
400
|
-
readonly kind: 'approval_token_invalid';
|
|
401
|
-
readonly reason: string;
|
|
402
|
-
} | {
|
|
403
|
-
readonly kind: 'approval_token_missing';
|
|
404
|
-
};
|
|
405
|
-
//#endregion
|
|
406
|
-
//#region src/upstream-mcp-client-runtime.d.ts
|
|
407
|
-
type UpstreamMcpTransportKind = 'auto-http' | 'sse' | 'stdio' | 'streamable-http';
|
|
408
|
-
interface BaseUpstreamMcpServer {
|
|
409
|
-
readonly connectionTimeoutMs?: number;
|
|
410
|
-
readonly namespace: string;
|
|
411
|
-
readonly transport: UpstreamMcpTransportKind;
|
|
412
|
-
}
|
|
413
|
-
interface RemoteUpstreamMcpServer extends BaseUpstreamMcpServer {
|
|
414
|
-
readonly eventSourceInit?: SSEClientTransportOptions['eventSourceInit'];
|
|
415
|
-
readonly headers?: Readonly<Record<string, string>>;
|
|
416
|
-
readonly requestInit?: RequestInit;
|
|
417
|
-
readonly transport: 'auto-http' | 'sse' | 'streamable-http';
|
|
418
|
-
readonly url: string;
|
|
419
|
-
}
|
|
420
|
-
interface StdioUpstreamMcpServer extends BaseUpstreamMcpServer {
|
|
421
|
-
readonly args?: readonly string[];
|
|
422
|
-
readonly command: string;
|
|
423
|
-
readonly cwd?: string;
|
|
424
|
-
readonly env?: Readonly<Record<string, string>>;
|
|
425
|
-
readonly transport: 'stdio';
|
|
426
|
-
}
|
|
427
|
-
type NormalizedUpstreamMcpServer = RemoteUpstreamMcpServer | StdioUpstreamMcpServer;
|
|
428
|
-
interface ListToolsCall {
|
|
429
|
-
readonly agentScopeId: string;
|
|
430
|
-
readonly namespace: string;
|
|
431
|
-
}
|
|
432
|
-
interface UpstreamToolCall {
|
|
433
|
-
readonly arguments: JsonObject;
|
|
434
|
-
readonly agentScopeId: string;
|
|
435
|
-
readonly namespace: string;
|
|
436
|
-
readonly toolName: string;
|
|
437
|
-
}
|
|
438
|
-
interface UpstreamListToolsResult {
|
|
439
|
-
readonly nextCursor?: string | undefined;
|
|
440
|
-
readonly tools: readonly Tool[];
|
|
441
|
-
}
|
|
442
|
-
interface UpstreamMcpClientLike {
|
|
443
|
-
readonly callTool: (params: {
|
|
444
|
-
readonly arguments: JsonObject;
|
|
445
|
-
readonly name: string;
|
|
446
|
-
}) => Promise<unknown>;
|
|
447
|
-
readonly close: () => Promise<void> | void;
|
|
448
|
-
readonly connect: (transport: unknown) => Promise<void>;
|
|
449
|
-
readonly listTools: (params?: {
|
|
450
|
-
readonly cursor?: string;
|
|
451
|
-
}) => Promise<UpstreamListToolsResult>;
|
|
452
|
-
}
|
|
453
|
-
interface UpstreamMcpRuntimeOptions {
|
|
454
|
-
readonly additionalRedactionValues?: readonly string[];
|
|
455
|
-
readonly createClient?: () => UpstreamMcpClientLike;
|
|
456
|
-
readonly createTransport?: (server: NormalizedUpstreamMcpServer, transport: Exclude<UpstreamMcpTransportKind, 'auto-http'>) => unknown;
|
|
457
|
-
readonly onCloseError?: (error: Error, context: UpstreamMcpCloseErrorContext) => void;
|
|
458
|
-
readonly servers: readonly NormalizedUpstreamMcpServer[];
|
|
459
|
-
}
|
|
460
|
-
interface UpstreamMcpCloseErrorContext {
|
|
461
|
-
readonly agentScopeId: string;
|
|
462
|
-
readonly namespace?: string;
|
|
463
|
-
}
|
|
464
|
-
interface UpstreamMcpClientRuntime {
|
|
465
|
-
readonly callTool: (call: UpstreamToolCall) => Promise<unknown>;
|
|
466
|
-
readonly closeAgentScope: (agentScopeId: string) => Promise<void>;
|
|
467
|
-
readonly closeSession: (scopeKey: string) => Promise<void>;
|
|
468
|
-
readonly listTools: (call: ListToolsCall) => Promise<readonly Tool[]>;
|
|
469
|
-
}
|
|
470
|
-
declare function createUpstreamMcpClientRuntime(options: UpstreamMcpRuntimeOptions): UpstreamMcpClientRuntime;
|
|
471
|
-
//#endregion
|
|
472
|
-
//#region src/upstream-response-middleware.d.ts
|
|
473
|
-
interface RedactionOptions {
|
|
474
|
-
readonly exactValues?: readonly string[];
|
|
475
|
-
}
|
|
476
|
-
declare function isCredentialConfigKey(key: string): boolean;
|
|
477
|
-
declare function redactExactCredentialText(text: string, options?: RedactionOptions): string;
|
|
478
|
-
declare function redactCredentialText(text: string, options?: RedactionOptions): string;
|
|
479
|
-
declare function redactUpstreamResponse(response: unknown, options?: RedactionOptions): unknown;
|
|
480
|
-
declare function redactUpstreamCatalogValue(response: unknown, options?: RedactionOptions): unknown;
|
|
481
|
-
declare function redactThrownError(error: unknown, options?: RedactionOptions): Error;
|
|
482
|
-
declare function toRedactedJsonValue(value: unknown, options?: RedactionOptions): JsonValue;
|
|
483
|
-
//#endregion
|
|
484
|
-
export { ApprovalTokenCallDigest, BuiltZodValidator, CatalogArtifactInput, ConservativeApprovalFallbackEvent, InputValidationError, InputValidationIssue, JsonArray, JsonObject, JsonPrimitive, JsonValue, ListToolsCall, NormalizedUpstreamMcpServer, PortalAccessPolicyConfig, PortalAgentIdentity, PortalAgentRuntimeRecord, PortalApprovalCall, PortalBatchDiagnostic, PortalBatchError, PortalBatchResult, PortalCallUpstreamTool, PortalCatalogSnapshot, PortalDefaultPolicy, PortalDiscoveryFailure, PortalHttpAgentIdentity, PortalHttpApp, PortalHttpAppOptions, PortalMcpToolName, PortalServerAccess, PortalSession, PortalSessionManager, PortalSessionManagerOptions, PortalSessionRuntime, PortalToolAnnotations, PortalToolFailure, PortalToolHandlerCall, PortalToolHandlers, PortalToolRecord, PortalToolResult, PortalToolResultMap, PortalToolRuntime, PortalToolSelector, PortalToolSuccess, PortalValidationResult, RedactionOptions, RemoteUpstreamMcpServer, ResolveAgentHmacKeysProps, ResolvedPortalAccessPolicy, SchemaValidationUnavailableError, ScopedSkillGraphEntry, SearchIndex, SearchQuery, SearchResultSet, SignApprovalTokenProps, SkillGraphInput, StdioUpstreamMcpServer, ToolGraph, ToolGraphInput, ToolIdentity, ToolRef, ToolRelationship, ToolRelationshipEndpoint, ToolRelationshipHint, ToolRelationshipType, ToolSafetySummary, ToolSchemaSummary, ToolSearchResult, ToolSummary, UpstreamListToolsResult, UpstreamMcpClientLike, UpstreamMcpClientRuntime, UpstreamMcpCloseErrorContext, UpstreamMcpRuntimeOptions, UpstreamMcpTransportKind, UpstreamToolCall, VerifyApprovalTokenProps, VerifyApprovalTokenResult, assertJsonObject, buildToolGraph, buildZodValidatorFromJsonSchema, createPortalAgentIdentity, createPortalAgentRuntimeRecords, createPortalApprovalVerifier, createPortalHttpAgentResolver, createPortalHttpApp, createPortalMcpServer, createPortalSessionManager, createPortalToolHandlers, createSearchIndex, createToolSummary, createUpstreamMcpClientRuntime, decodeToolRef, encodeToolRef, generateTypescriptCatalogArtifact, hashCallArguments, isCredentialConfigKey, isJsonObject, jsonObjectSchema, jsonValueSchema, listPortalMcpTools, parseHmacKeysFromEnv, portalAgentScopeKey, portalHmacKeyEnvName, portalMcpToolNames, portalToolAnnotationsSchema, portalToolInputSchemas, portalToolRecordSchema, redactCredentialText, redactExactCredentialText, redactThrownError, redactUpstreamCatalogValue, redactUpstreamResponse, resolveAgentHmacKeys, resolvePortalAccessPolicy, safeToolMetadataSchema, signApprovalToken, summarizeJsonSchema, toRedactedJsonValue, validatePortalToolArguments, verifyApprovalToken };
|
|
485
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
import { a as safeToolMetadataSchema, c as JsonPrimitive, d as isJsonObject, f as jsonObjectSchema, i as portalToolRecordSchema, l as JsonValue, n as PortalToolRecord, o as JsonArray, p as jsonValueSchema, r as portalToolAnnotationsSchema, s as JsonObject, t as PortalToolAnnotations, u as assertJsonObject } from "./catalog-types-BVuB4Ynx.js";
|
|
2
|
+
import { A as encodeToolRef, C as ToolRelationship, D as ToolIdentity, E as buildToolGraph, F as PortalToolSelector, I as ResolvedPortalAccessPolicy, L as createPortalAgentIdentity, M as PortalAgentIdentity, N as PortalAgentScopeSource, O as ToolRef, P as PortalDefaultPolicy, R as portalAgentScopeKey, S as ToolGraphInput, T as ToolRelationshipType, _ as createToolSummary, a as PortalSessionManagerOptions, b as SkillGraphInput, c as SearchIndex, d as ToolRelationshipHint, f as ToolSearchResult, g as ToolSummary, h as ToolSchemaSummary, i as PortalSessionManager, j as PortalAccessPolicyConfig, k as decodeToolRef, l as SearchQuery, m as ToolSafetySummary, n as PortalDiscoveryFailure, o as PortalSessionRuntime, p as createSearchIndex, r as PortalSession, s as createPortalSessionManager, t as PortalCatalogSnapshot, u as SearchResultSet, v as summarizeJsonSchema, w as ToolRelationshipEndpoint, x as ToolGraph, y as ScopedSkillGraphEntry, z as resolvePortalAccessPolicy } from "./portal-session-DG2CUjIo.js";
|
|
3
|
+
import { S as createUpstreamMcpClientRuntime, _ as UpstreamMcpProgress, a as redactThrownError, b as UpstreamToolCall, c as toRedactedJsonValue, d as RemoteUpstreamMcpServer, f as StdioUpstreamMcpServer, g as UpstreamMcpCloseErrorContext, h as UpstreamMcpClientRuntime, i as redactExactCredentialText, l as ListToolsCall, m as UpstreamMcpClientLike, n as isCredentialConfigKey, o as redactUpstreamCatalogValue, p as UpstreamListToolsResult, r as redactCredentialText, s as redactUpstreamResponse, t as RedactionOptions, u as NormalizedUpstreamMcpServer, v as UpstreamMcpRuntimeOptions, x as UpstreamToolEvent, y as UpstreamMcpTransportKind } from "./upstream-response-middleware-1MZnAD9C.js";
|
|
4
|
+
import { a as SchemaValidationUnavailableError, i as PortalValidationResult, n as InputValidationError, o as buildZodValidatorFromJsonSchema, r as InputValidationIssue, t as BuiltZodValidator } from "./zod-schema-loader-DLGQpYFD.js";
|
|
5
|
+
export { BuiltZodValidator, InputValidationError, InputValidationIssue, JsonArray, JsonObject, JsonPrimitive, JsonValue, ListToolsCall, NormalizedUpstreamMcpServer, PortalAccessPolicyConfig, PortalAgentIdentity, PortalAgentScopeSource, PortalCatalogSnapshot, PortalDefaultPolicy, PortalDiscoveryFailure, PortalSession, PortalSessionManager, PortalSessionManagerOptions, PortalSessionRuntime, PortalToolAnnotations, PortalToolRecord, PortalToolSelector, PortalValidationResult, RedactionOptions, RemoteUpstreamMcpServer, ResolvedPortalAccessPolicy, SchemaValidationUnavailableError, ScopedSkillGraphEntry, SearchIndex, SearchQuery, SearchResultSet, SkillGraphInput, StdioUpstreamMcpServer, ToolGraph, ToolGraphInput, ToolIdentity, ToolRef, ToolRelationship, ToolRelationshipEndpoint, ToolRelationshipHint, ToolRelationshipType, ToolSafetySummary, ToolSchemaSummary, ToolSearchResult, ToolSummary, UpstreamListToolsResult, UpstreamMcpClientLike, UpstreamMcpClientRuntime, UpstreamMcpCloseErrorContext, UpstreamMcpProgress, UpstreamMcpRuntimeOptions, UpstreamMcpTransportKind, UpstreamToolCall, UpstreamToolEvent, assertJsonObject, buildToolGraph, buildZodValidatorFromJsonSchema, createPortalAgentIdentity, createPortalSessionManager, createSearchIndex, createToolSummary, createUpstreamMcpClientRuntime, decodeToolRef, encodeToolRef, isCredentialConfigKey, isJsonObject, jsonObjectSchema, jsonValueSchema, portalAgentScopeKey, portalToolAnnotationsSchema, portalToolRecordSchema, redactCredentialText, redactExactCredentialText, redactThrownError, redactUpstreamCatalogValue, redactUpstreamResponse, resolvePortalAccessPolicy, safeToolMetadataSchema, summarizeJsonSchema, toRedactedJsonValue };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { a as portalToolRecordSchema, c as isJsonObject, i as portalToolAnnotationsSchema, l as jsonObjectSchema, n as decodeToolRef, o as safeToolMetadataSchema, r as encodeToolRef, s as assertJsonObject, t as
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
|
|
5
|
-
export { assertJsonObject, buildToolGraph, buildZodValidatorFromJsonSchema, createPortalAgentIdentity, createPortalAgentRuntimeRecords, createPortalApprovalVerifier, createPortalHttpAgentResolver, createPortalHttpApp, createPortalMcpServer, createPortalSessionManager, createPortalToolHandlers, createSearchIndex, createToolSummary, createUpstreamMcpClientRuntime, decodeToolRef, encodeToolRef, generateTypescriptCatalogArtifact, hashCallArguments, isCredentialConfigKey, isJsonObject, jsonObjectSchema, jsonValueSchema, listPortalMcpTools, parseHmacKeysFromEnv, portalAgentScopeKey, portalHmacKeyEnvName, portalMcpToolNames, portalToolAnnotationsSchema, portalToolInputSchemas, portalToolRecordSchema, redactCredentialText, redactExactCredentialText, redactThrownError, redactUpstreamCatalogValue, redactUpstreamResponse, resolveAgentHmacKeys, resolvePortalAccessPolicy, safeToolMetadataSchema, signApprovalToken, summarizeJsonSchema, toRedactedJsonValue, validatePortalToolArguments, verifyApprovalToken };
|
|
1
|
+
import { a as portalToolRecordSchema, c as isJsonObject, i as portalToolAnnotationsSchema, l as jsonObjectSchema, n as decodeToolRef, o as safeToolMetadataSchema, r as encodeToolRef, s as assertJsonObject, t as buildZodValidatorFromJsonSchema, u as jsonValueSchema } from "./zod-schema-loader-yNekKNpm.js";
|
|
2
|
+
import { a as redactUpstreamCatalogValue, c as createToolSummary, d as portalAgentScopeKey, f as resolvePortalAccessPolicy, i as redactThrownError, l as summarizeJsonSchema, n as redactCredentialText, o as redactUpstreamResponse, r as redactExactCredentialText, s as toRedactedJsonValue, t as isCredentialConfigKey, u as createPortalAgentIdentity } from "./upstream-response-middleware-BjUWZ2G8.js";
|
|
3
|
+
import { i as createSearchIndex, n as createPortalSessionManager, r as buildToolGraph, t as createUpstreamMcpClientRuntime } from "./upstream-mcp-client-runtime-JlsfTm7_.js";
|
|
4
|
+
export { assertJsonObject, buildToolGraph, buildZodValidatorFromJsonSchema, createPortalAgentIdentity, createPortalSessionManager, createSearchIndex, createToolSummary, createUpstreamMcpClientRuntime, decodeToolRef, encodeToolRef, isCredentialConfigKey, isJsonObject, jsonObjectSchema, jsonValueSchema, portalAgentScopeKey, portalToolAnnotationsSchema, portalToolRecordSchema, redactCredentialText, redactExactCredentialText, redactThrownError, redactUpstreamCatalogValue, redactUpstreamResponse, resolvePortalAccessPolicy, safeToolMetadataSchema, summarizeJsonSchema, toRedactedJsonValue };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { a as PortalCore, c as PortalCoreEvent, m as PortalCoreToolDescriptor, n as PortalAgentScope } from "../portal-core-CZQI7Ob6.js";
|
|
2
|
+
import { a as createPortalApprovalVerifier, c as PortalAgentBearerAuth, d as PortalHttpAppOptions, f as PortalHttpAuditEvent, i as createPortalAgentRuntimeRecords, l as PortalHttpAgentIdentity, n as PortalApprovalAuditEvent, o as createPortalHttpAgentResolver, p as createPortalHttpApp, r as ResolveAgentHmacKeysProps, s as resolveAgentHmacKeys, t as PortalAgentRuntimeRecord, u as PortalHttpApp } from "../resolve-agent-identity-FQL02YdW.js";
|
|
3
|
+
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
4
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
5
|
+
|
|
6
|
+
//#region src/mcp-proxy/portal-mcp-server.d.ts
|
|
7
|
+
declare const portalMcpToolNames: readonly ["mcp_portal_list", "mcp_portal_search", "mcp_portal_describe", "mcp_portal_call"];
|
|
8
|
+
type PortalMcpToolName = (typeof portalMcpToolNames)[number];
|
|
9
|
+
declare function listPortalMcpTools(descriptors?: readonly PortalCoreToolDescriptor[]): readonly Tool[];
|
|
10
|
+
declare function emitMcpProgress(props: {
|
|
11
|
+
readonly event: PortalCoreEvent;
|
|
12
|
+
readonly sendNotification: (notification: {
|
|
13
|
+
readonly method: 'notifications/message' | 'notifications/progress';
|
|
14
|
+
readonly params: Record<string, unknown>;
|
|
15
|
+
}) => Promise<void>;
|
|
16
|
+
readonly progressToken: number | string | undefined;
|
|
17
|
+
}): Promise<void>;
|
|
18
|
+
declare function createPortalMcpServer(props: {
|
|
19
|
+
readonly core: PortalCore;
|
|
20
|
+
readonly scope: PortalAgentScope;
|
|
21
|
+
}): Server;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { PortalAgentBearerAuth, PortalAgentRuntimeRecord, PortalApprovalAuditEvent, PortalHttpAgentIdentity, PortalHttpApp, PortalHttpAppOptions, PortalHttpAuditEvent, PortalMcpToolName, ResolveAgentHmacKeysProps, createPortalAgentRuntimeRecords, createPortalApprovalVerifier, createPortalHttpAgentResolver, createPortalHttpApp, createPortalMcpServer, emitMcpProgress, listPortalMcpTools, portalMcpToolNames, resolveAgentHmacKeys };
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/mcp-proxy/portal-mcp-server.ts"],"mappings":";;;;;;cAmBa,kBAAA;AAAA,KAOD,iBAAA,WAA4B,kBAAA;AAAA,iBAQxB,kBAAA,CACf,WAAA,YAAuB,wBAAA,cACZ,IAAA;AAAA,iBA8EU,eAAA,CAAgB,KAAA;EAAA,SAC5B,KAAA,EAAO,eAAA;EAAA,SACP,gBAAA,GAAmB,YAAA;IAAA,SAClB,MAAA;IAAA,SACA,MAAA,EAAQ,MAAA;EAAA,MACZ,OAAA;EAAA,SACG,aAAA;AAAA,IACN,OAAA;AAAA,iBAuEY,qBAAA,CAAsB,KAAA;EAAA,SAC5B,IAAA,EAAM,UAAA;EAAA,SACN,KAAA,EAAO,gBAAA;AAAA,IACb,MAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as createPortalHttpApp, c as listPortalMcpTools, i as resolveAgentHmacKeys, l as portalMcpToolNames, n as createPortalApprovalVerifier, o as createPortalMcpServer, r as createPortalHttpAgentResolver, s as emitMcpProgress, t as createPortalAgentRuntimeRecords } from "../resolve-agent-identity-DnC_Pmnh.js";
|
|
2
|
+
export { createPortalAgentRuntimeRecords, createPortalApprovalVerifier, createPortalHttpAgentResolver, createPortalHttpApp, createPortalMcpServer, emitMcpProgress, listPortalMcpTools, portalMcpToolNames, resolveAgentHmacKeys };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/portal-auth/agent-bearer-token.d.ts
|
|
2
|
+
interface DeriveAgentBearerTokenProps {
|
|
3
|
+
readonly agentId: string;
|
|
4
|
+
readonly credentialVersion: number;
|
|
5
|
+
readonly masterKey: Buffer;
|
|
6
|
+
}
|
|
7
|
+
interface VerifyAgentBearerAuthorizationProps extends DeriveAgentBearerTokenProps {
|
|
8
|
+
readonly authorizationHeader: string | undefined;
|
|
9
|
+
}
|
|
10
|
+
type VerifyAgentBearerAuthorizationResult = {
|
|
11
|
+
readonly ok: true;
|
|
12
|
+
} | {
|
|
13
|
+
readonly ok: false;
|
|
14
|
+
readonly reason: 'malformed' | 'missing' | 'signature-mismatch';
|
|
15
|
+
};
|
|
16
|
+
declare function decodePortalMasterKey(encodedMasterKey: string): Buffer;
|
|
17
|
+
declare function deriveAgentBearerToken(props: DeriveAgentBearerTokenProps): string;
|
|
18
|
+
declare function formatMasterKeyFingerprint(masterKey: Buffer): string;
|
|
19
|
+
declare function verifyAgentBearerAuthorization(props: VerifyAgentBearerAuthorizationProps): VerifyAgentBearerAuthorizationResult;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { DeriveAgentBearerTokenProps, VerifyAgentBearerAuthorizationProps, VerifyAgentBearerAuthorizationResult, decodePortalMasterKey, deriveAgentBearerToken, formatMasterKeyFingerprint, verifyAgentBearerAuthorization };
|
|
22
|
+
//# sourceMappingURL=agent-bearer-token.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-bearer-token.d.ts","names":[],"sources":["../../src/portal-auth/agent-bearer-token.ts"],"mappings":";UAEiB,2BAAA;EAAA,SACP,OAAA;EAAA,SACA,iBAAA;EAAA,SACA,SAAA,EAAW,MAAA;AAAA;AAAA,UAGJ,mCAAA,SAA4C,2BAAA;EAAA,SACnD,mBAAA;AAAA;AAAA,KAGE,oCAAA;EAAA,SACE,EAAA;AAAA;EAAA,SACA,EAAA;EAAA,SAAoB,MAAA;AAAA;AAAA,iBAMlB,qBAAA,CAAsB,gBAAA,WAA2B,MAAA;AAAA,iBAiBjD,sBAAA,CAAuB,KAAA,EAAO,2BAAA;AAAA,iBAM9B,0BAAA,CAA2B,SAAA,EAAW,MAAA;AAAA,iBAetC,8BAAA,CACf,KAAA,EAAO,mCAAA,GACL,oCAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { i as verifyAgentBearerAuthorization, n as deriveAgentBearerToken, r as formatMasterKeyFingerprint, t as decodePortalMasterKey } from "../agent-bearer-token-DCtpDPCZ.js";
|
|
2
|
+
export { decodePortalMasterKey, deriveAgentBearerToken, formatMasterKeyFingerprint, verifyAgentBearerAuthorization };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region src/portal-auth/hmac-env.d.ts
|
|
2
|
+
declare function portalHmacKeyEnvName(agentId: string): string;
|
|
3
|
+
declare function parseHmacKeysFromEnv(env: Readonly<Record<string, string | undefined>>): ReadonlyMap<string, Buffer>;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { parseHmacKeysFromEnv, portalHmacKeyEnvName };
|
|
6
|
+
//# sourceMappingURL=hmac-env.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmac-env.d.ts","names":[],"sources":["../../src/portal-auth/hmac-env.ts"],"mappings":";iBAGgB,oBAAA,CAAqB,OAAA;AAAA,iBAIrB,oBAAA,CACf,GAAA,EAAK,QAAA,CAAS,MAAA,gCACZ,WAAA,SAAoB,MAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
//#region src/portal-auth/hmac-token.d.ts
|
|
2
|
+
interface ApprovalTokenCallDigest {
|
|
3
|
+
readonly argumentsHash: string;
|
|
4
|
+
readonly namespace: string;
|
|
5
|
+
readonly toolName: string;
|
|
6
|
+
}
|
|
7
|
+
interface SignApprovalTokenProps {
|
|
8
|
+
readonly agentId: string;
|
|
9
|
+
readonly calls: readonly ApprovalTokenCallDigest[];
|
|
10
|
+
readonly expiresAtMs: number;
|
|
11
|
+
readonly issuedAtMs?: number;
|
|
12
|
+
readonly jti?: string;
|
|
13
|
+
readonly key: Buffer;
|
|
14
|
+
}
|
|
15
|
+
interface VerifyApprovalTokenProps {
|
|
16
|
+
readonly agentId: string;
|
|
17
|
+
readonly calls: readonly ApprovalTokenCallDigest[];
|
|
18
|
+
readonly key: Buffer;
|
|
19
|
+
readonly consumeTokenId?: (jti: string, expiresAtMs: number) => {
|
|
20
|
+
readonly ok: true;
|
|
21
|
+
} | {
|
|
22
|
+
readonly ok: false;
|
|
23
|
+
readonly reason: 'replay-cache-full' | 'replayed';
|
|
24
|
+
};
|
|
25
|
+
readonly maxLifetimeMs?: number;
|
|
26
|
+
readonly nowMs: number;
|
|
27
|
+
readonly token: string;
|
|
28
|
+
}
|
|
29
|
+
type VerifyApprovalTokenResult = {
|
|
30
|
+
readonly ok: true;
|
|
31
|
+
} | {
|
|
32
|
+
readonly ok: false;
|
|
33
|
+
readonly reason: 'agent-mismatch' | 'call-mismatch' | 'expired' | 'malformed' | 'replay-cache-full' | 'replayed' | 'signature-mismatch' | 'ttl-exceeded';
|
|
34
|
+
};
|
|
35
|
+
declare function hashCallArguments(args: unknown): string;
|
|
36
|
+
declare function signApprovalToken(props: SignApprovalTokenProps): string;
|
|
37
|
+
declare function verifyApprovalToken(props: VerifyApprovalTokenProps): VerifyApprovalTokenResult;
|
|
38
|
+
//#endregion
|
|
39
|
+
export { ApprovalTokenCallDigest, SignApprovalTokenProps, VerifyApprovalTokenProps, VerifyApprovalTokenResult, hashCallArguments, signApprovalToken, verifyApprovalToken };
|
|
40
|
+
//# sourceMappingURL=hmac-token.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmac-token.d.ts","names":[],"sources":["../../src/portal-auth/hmac-token.ts"],"mappings":";UAIiB,uBAAA;EAAA,SACP,aAAA;EAAA,SACA,SAAA;EAAA,SACA,QAAA;AAAA;AAAA,UAGO,sBAAA;EAAA,SACP,OAAA;EAAA,SACA,KAAA,WAAgB,uBAAA;EAAA,SAChB,WAAA;EAAA,SACA,UAAA;EAAA,SACA,GAAA;EAAA,SACA,GAAA,EAAK,MAAA;AAAA;AAAA,UAGE,wBAAA;EAAA,SACP,OAAA;EAAA,SACA,KAAA,WAAgB,uBAAA;EAAA,SAChB,GAAA,EAAK,MAAA;EAAA,SACL,cAAA,IACR,GAAA,UACA,WAAA;IAAA,SAEa,EAAA;EAAA;IAAA,SACA,EAAA;IAAA,SAAoB,MAAA;EAAA;EAAA,SACzB,aAAA;EAAA,SACA,KAAA;EAAA,SACA,KAAA;AAAA;AAAA,KAGE,yBAAA;EAAA,SACE,EAAA;AAAA;EAAA,SAEF,EAAA;EAAA,SACA,MAAA;AAAA;AAAA,iBAkDI,iBAAA,CAAkB,IAAA;AAAA,iBAIlB,iBAAA,CAAkB,KAAA,EAAO,sBAAA;AAAA,iBA6CzB,mBAAA,CAAoB,KAAA,EAAO,wBAAA,GAA2B,yBAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { n as PortalToolRecord } from "../catalog-types-BVuB4Ynx.js";
|
|
2
|
+
import { a as SchemaValidationUnavailableError, i as PortalValidationResult, n as InputValidationError, o as buildZodValidatorFromJsonSchema, r as InputValidationIssue, t as BuiltZodValidator } from "../zod-schema-loader-DLGQpYFD.js";
|
|
3
|
+
|
|
4
|
+
//#region src/portal-config/typescript-artifact.d.ts
|
|
5
|
+
interface CatalogArtifactInput {
|
|
6
|
+
readonly tools: readonly PortalToolRecord[];
|
|
7
|
+
}
|
|
8
|
+
declare function generateTypescriptCatalogArtifact(input: CatalogArtifactInput): string;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { BuiltZodValidator, CatalogArtifactInput, InputValidationError, InputValidationIssue, PortalValidationResult, SchemaValidationUnavailableError, buildZodValidatorFromJsonSchema, generateTypescriptCatalogArtifact };
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/portal-config/typescript-artifact.ts"],"mappings":";;;;UAKiB,oBAAA;EAAA,SACP,KAAA,WAAgB,gBAAA;AAAA;AAAA,iBAwBV,iCAAA,CAAkC,KAAA,EAAO,oBAAA"}
|