@adonis-agora/agent 0.33.0 → 0.34.0
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/CHANGELOG.md +57 -0
- package/dist/assets/spa/assets/index-DjIMQOxi.js +9 -0
- package/dist/assets/spa/index.html +1 -1
- package/dist/providers/mcp_provider.d.ts +5 -0
- package/dist/providers/mcp_provider.d.ts.map +1 -1
- package/dist/providers/mcp_provider.js +51 -21
- package/dist/providers/mcp_provider.js.map +1 -1
- package/dist/src/agent-loop.d.ts +2 -0
- package/dist/src/agent-loop.d.ts.map +1 -1
- package/dist/src/agent-loop.js +56 -8
- package/dist/src/agent-loop.js.map +1 -1
- package/dist/src/authz/authz-tool-authorizer.d.ts +3 -3
- package/dist/src/authz/authz-tool-authorizer.d.ts.map +1 -1
- package/dist/src/authz/authz-tool-authorizer.js +1 -1
- package/dist/src/authz/authz-tool-authorizer.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/mcp/auth.d.ts +93 -4
- package/dist/src/mcp/auth.d.ts.map +1 -1
- package/dist/src/mcp/auth.js +106 -1
- package/dist/src/mcp/auth.js.map +1 -1
- package/dist/src/mcp/define_config.d.ts +12 -4
- package/dist/src/mcp/define_config.d.ts.map +1 -1
- package/dist/src/mcp/define_config.js +2 -2
- package/dist/src/mcp/define_config.js.map +1 -1
- package/dist/src/mcp/discovery.d.ts +48 -0
- package/dist/src/mcp/discovery.d.ts.map +1 -0
- package/dist/src/mcp/discovery.js +70 -0
- package/dist/src/mcp/discovery.js.map +1 -0
- package/dist/src/mcp/index.d.ts +4 -2
- package/dist/src/mcp/index.d.ts.map +1 -1
- package/dist/src/mcp/index.js +2 -1
- package/dist/src/mcp/index.js.map +1 -1
- package/dist/src/memory.d.ts.map +1 -1
- package/dist/src/memory.js +10 -2
- package/dist/src/memory.js.map +1 -1
- package/dist/src/rag/index.d.ts +1 -1
- package/dist/src/rag/index.d.ts.map +1 -1
- package/dist/src/rag/index.js +1 -1
- package/dist/src/rag/index.js.map +1 -1
- package/dist/src/rag/pg-vector-store.d.ts +41 -0
- package/dist/src/rag/pg-vector-store.d.ts.map +1 -1
- package/dist/src/rag/pg-vector-store.js +93 -15
- package/dist/src/rag/pg-vector-store.js.map +1 -1
- package/dist/src/types.d.ts +15 -0
- package/dist/src/types.d.ts.map +1 -1
- package/dist/stubs/config/mcp.stub +9 -1
- package/package.json +28 -24
- package/dist/assets/spa/assets/index-3Q2m5_Ax.js +0 -9
|
@@ -36,13 +36,13 @@ export interface AuthzToolAuthorizerConfig {
|
|
|
36
36
|
*/
|
|
37
37
|
authz: AuthzServiceLike;
|
|
38
38
|
/**
|
|
39
|
-
* Maps an {@link Actor} onto the user object authz resolves a `
|
|
40
|
-
* `{ id: actor.id }` — enough for authz's `
|
|
39
|
+
* Maps an {@link Actor} onto the user object authz resolves a `SubjectRef` from. Defaults to
|
|
40
|
+
* `{ id: actor.id }` — enough for authz's `defaultResolveSubjectRef` (which reads `.id`, defaulting
|
|
41
41
|
* the type to `user`). Override to attach a polymorphic `type` or a host user entity.
|
|
42
42
|
*/
|
|
43
43
|
userFromActor?: (actor: Actor) => unknown;
|
|
44
44
|
}
|
|
45
|
-
/** Default {@link Actor} → authz
|
|
45
|
+
/** Default {@link Actor} → authz subject mapping: the minimal `{ id }` authz needs to resolve a `SubjectRef`. */
|
|
46
46
|
export declare function defaultUserFromActor(actor: Actor): unknown;
|
|
47
47
|
/**
|
|
48
48
|
* A {@link RolesPolicy} (the agent's `ToolAuthorizer` seam) backed by `@adonis-agora/authz`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authz-tool-authorizer.d.ts","sourceRoot":"","sources":["../../../src/authz/authz-tool-authorizer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa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iH;AACjH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAE1D;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,mBAAoB,YAAW,WAAW;;IAIrD,YAAY,MAAM,EAAE,yBAAyB,EAG5C;IAEK,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,CAYxD;CACF;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,yBAAyB,GAAG,mBAAmB,CAE1F"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Default {@link Actor} → authz
|
|
1
|
+
/** Default {@link Actor} → authz subject mapping: the minimal `{ id }` authz needs to resolve a `SubjectRef`. */
|
|
2
2
|
export function defaultUserFromActor(actor) {
|
|
3
3
|
return { id: actor.id };
|
|
4
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authz-tool-authorizer.js","sourceRoot":"","sources":["../../../src/authz/authz-tool-authorizer.ts"],"names":[],"mappings":"AA8CA,
|
|
1
|
+
{"version":3,"file":"authz-tool-authorizer.js","sourceRoot":"","sources":["../../../src/authz/authz-tool-authorizer.ts"],"names":[],"mappings":"AA8CA,iHAAiH;AACjH,MAAM,UAAU,oBAAoB,CAAC,KAAY;IAC/C,OAAO,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;AAC1B,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,mBAAmB;IACrB,MAAM,CAAmB;IACzB,cAAc,CAA4B;IAEnD,YAAY,MAAiC;QAC3C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC;QAC3B,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,aAAa,IAAI,oBAAoB,CAAC;IACrE,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,KAAY,EAAE,IAAc;QACpC,kFAAkF;QAClF,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS;YAAE,OAAO,KAAK,CAAC;QAC7C,IAAI,CAAC;YACH,8FAA8F;YAC9F,4FAA4F;YAC5F,MAAM,OAAO,GAAG,KAAK,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC9F,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAClF,CAAC;QAAC,MAAM,CAAC;YACP,0DAA0D;YAC1D,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;CACF;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAiC;IACnE,OAAO,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC;AACzC,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
package/dist/src/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.34.0';
|
|
2
2
|
// Re-export the configure hook from the package root so `node ace configure` finds it.
|
|
3
3
|
// AdonisJS imports the package MAIN and reads `configure` off the module namespace —
|
|
4
4
|
// the `./configure` subpath alone is never consulted.
|
package/dist/src/mcp/auth.d.ts
CHANGED
|
@@ -46,9 +46,42 @@ export interface McpAuthInfo extends Omit<AuthInfo, 'extra'> {
|
|
|
46
46
|
export interface McpAuth {
|
|
47
47
|
/** OAuth metadata to advertise, resolved lazily (the authkit peer may not be bootable until first use). */
|
|
48
48
|
oauth?: McpOAuthMetadata | (() => McpOAuthMetadata | Promise<McpOAuthMetadata>);
|
|
49
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* Validate `token` and resolve the acting actor as a typed `McpAuthInfo`. Throws on rejection:
|
|
51
|
+
* {@link McpAuthError} for a deliberate refusal (its `status` and message reach the client), any
|
|
52
|
+
* other `Error` for a token this strategy does not recognize (→ `401`).
|
|
53
|
+
*/
|
|
50
54
|
verify(token: string): Promise<McpAuthInfo>;
|
|
51
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* A typed refusal from an MCP auth strategy: the token was recognized and deliberately refused (a
|
|
58
|
+
* client that is not allowed on this endpoint, an account that left the tenant, a revoked grant).
|
|
59
|
+
*
|
|
60
|
+
* Throw it from `verify` — or from the `toActor` of `authKitAuth()` / `apiKeyAuth()` — and the
|
|
61
|
+
* provider answers with its `status` and message, plus the matching `WWW-Authenticate` challenge:
|
|
62
|
+
* `401` → `error="invalid_token"`, `403` → `error="insufficient_scope"`.
|
|
63
|
+
*
|
|
64
|
+
* Inside {@link anyOf} it is also a stop signal: a strategy that throws `McpAuthError` has claimed
|
|
65
|
+
* the token, so the remaining strategies are not tried. Any other error means "not my token" and
|
|
66
|
+
* the next strategy gets its turn.
|
|
67
|
+
*
|
|
68
|
+
* ```ts
|
|
69
|
+
* authKitAuth({
|
|
70
|
+
* toActor: ({ accountId, clientId }) => {
|
|
71
|
+
* if (clientId === 'web') throw new McpAuthError('token was not issued for MCP')
|
|
72
|
+
* return { id: accountId }
|
|
73
|
+
* },
|
|
74
|
+
* })
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
export declare class McpAuthError extends Error {
|
|
78
|
+
/** HTTP status of the refusal: `401` (the token does not authenticate) or `403` (it does, but may not do this). */
|
|
79
|
+
readonly status: 401 | 403;
|
|
80
|
+
constructor(message: string, options?: {
|
|
81
|
+
status?: 401 | 403;
|
|
82
|
+
cause?: unknown;
|
|
83
|
+
});
|
|
84
|
+
}
|
|
52
85
|
/**
|
|
53
86
|
* A configured MCP auth strategy, as a lazy thunk the provider calls at boot. Each factory lazily
|
|
54
87
|
* imports / resolves its peer inside the thunk, so nothing loads until the strategy is actually selected.
|
|
@@ -58,12 +91,48 @@ export type McpAuthFactory = (ctx: McpAuthContext) => McpAuth | Promise<McpAuth>
|
|
|
58
91
|
* Resolve a `McpAuth` config value (a ready instance or a lazy factory) at provider boot.
|
|
59
92
|
*/
|
|
60
93
|
export declare function resolveMcpAuth(auth: McpAuth | McpAuthFactory, ctx: McpAuthContext): Promise<McpAuth>;
|
|
61
|
-
/**
|
|
62
|
-
|
|
94
|
+
/**
|
|
95
|
+
* The organization authkit bound to a grant at consent time (the active org of the session that
|
|
96
|
+
* approved it). Stored on the grant as `activeOrg`.
|
|
97
|
+
*/
|
|
98
|
+
export interface AuthKitActiveOrg {
|
|
99
|
+
orgId: string;
|
|
100
|
+
orgSlug?: string;
|
|
101
|
+
orgRole?: string;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* The oidc-provider `Grant` behind an access token — the authorization the user gave to a client.
|
|
105
|
+
* Duck-typed: only the fields this package reads are named; the rest of the stored grant is there too.
|
|
106
|
+
*/
|
|
107
|
+
export interface AuthKitGrant {
|
|
108
|
+
accountId?: string;
|
|
109
|
+
clientId?: string;
|
|
110
|
+
/** Set by authkit at consent when the session had an active organization. */
|
|
111
|
+
activeOrg?: unknown;
|
|
112
|
+
[key: string]: unknown;
|
|
113
|
+
}
|
|
114
|
+
/** What `authKitAuth()` hands `toActor` for a verified access token. */
|
|
115
|
+
export interface AuthKitActorInfo {
|
|
116
|
+
/** The account the token was issued to. */
|
|
63
117
|
accountId: string;
|
|
118
|
+
/** The token's granted scopes. */
|
|
64
119
|
scopes: string[];
|
|
120
|
+
/** The client the token was issued to — refuse clients that should not reach MCP by throwing {@link McpAuthError}. */
|
|
65
121
|
clientId: string | undefined;
|
|
66
|
-
|
|
122
|
+
/** The grant id the token belongs to, when the provider tracks one. */
|
|
123
|
+
grantId: string | undefined;
|
|
124
|
+
/** The grant itself (loaded per request, so a revoked grant stops the token right away). */
|
|
125
|
+
grant: AuthKitGrant | undefined;
|
|
126
|
+
/** The organization authkit bound to the grant at consent — the tenant the user authorized. */
|
|
127
|
+
activeOrg: AuthKitActiveOrg | undefined;
|
|
128
|
+
/** Extra claims stored on the access token (`extraTokenClaims`), if any. */
|
|
129
|
+
extra: Record<string, unknown> | undefined;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* How `authKitAuth()` maps an access token to the MCP actor. Defaults to the account id. Throw
|
|
133
|
+
* {@link McpAuthError} to refuse the token (e.g. a client that is not allowed on this endpoint).
|
|
134
|
+
*/
|
|
135
|
+
export type AuthKitActorResolver = (info: AuthKitActorInfo) => Actor | Promise<Actor>;
|
|
67
136
|
/** Options for {@link authKitAuth}. */
|
|
68
137
|
export interface AuthKitMcpAuthOptions {
|
|
69
138
|
/** Scopes the authorization server advertises. Defaults to the standard authkit scopes. */
|
|
@@ -99,4 +168,24 @@ export interface ApiKeyMcpAuthOptions {
|
|
|
99
168
|
* checks the key. Keys are compared with a constant-time compare to resist timing attacks.
|
|
100
169
|
*/
|
|
101
170
|
export declare function apiKeyAuth(options: ApiKeyMcpAuthOptions): McpAuthFactory;
|
|
171
|
+
/**
|
|
172
|
+
* Accept more than one kind of bearer token on the same MCP endpoint — e.g. OAuth access tokens from
|
|
173
|
+
* MCP clients that logged in through the browser AND personal access tokens for machine integrations:
|
|
174
|
+
*
|
|
175
|
+
* ```ts
|
|
176
|
+
* auth: anyOf(
|
|
177
|
+
* authKitAuth({ toActor }),
|
|
178
|
+
* { verify: verifyPersonalAccessToken },
|
|
179
|
+
* )
|
|
180
|
+
* ```
|
|
181
|
+
*
|
|
182
|
+
* Strategies are tried in order and the first that verifies the token wins. A strategy that throws a
|
|
183
|
+
* plain `Error` passes ("not my token"); one that throws {@link McpAuthError} has claimed the token and
|
|
184
|
+
* refused it, so the chain stops there with that refusal. When every strategy passes, the last error
|
|
185
|
+
* is rethrown.
|
|
186
|
+
*
|
|
187
|
+
* OAuth metadata comes from the first strategy that exposes it, so the RFC 9728 document and the
|
|
188
|
+
* `WWW-Authenticate` challenge still point MCP clients at the login flow.
|
|
189
|
+
*/
|
|
190
|
+
export declare function anyOf(...strategies: Array<McpAuth | McpAuthFactory>): McpAuthFactory;
|
|
102
191
|
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/mcp/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,kBAAkB,CAAC;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,yGAAyG;IACzG,MAAM,EAAE,MAAM,CAAC;IACf,kFAAkF;IAClF,qBAAqB,EAAE,MAAM,CAAC;IAC9B,oFAAoF;IACpF,aAAa,EAAE,MAAM,CAAC;IACtB,oDAAoD;IACpD,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,8CAA8C;IAC9C,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC1D,KAAK,EAAE;QAAE,KAAK,EAAE,KAAK,CAAA;KAAE,CAAC;CACzB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,OAAO;IACtB,2GAA2G;IAC3G,KAAK,CAAC,EAAE,gBAAgB,GAAG,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAChF
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/mcp/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,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ACjG,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,gFAAgF;IAChF,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,qBAA0B,GAAG,cAAc,CAgE/E;AA+BD,oFAAoF;AACpF,MAAM,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AAE7E,sCAAsC;AACtC,MAAM,WAAW,oBAAoB;IACnC,wEAAwE;IACxE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,yFAAyF;IACzF,OAAO,CAAC,EAAE,mBAAmB,CAAC;CAC/B;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,oBAAoB,GAAG,cAAc,CAcxE;AAcD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,KAAK,CAAC,GAAG,UAAU,EAAE,KAAK,CAAC,OAAO,GAAG,cAAc,CAAC,GAAG,cAAc,CAuBpF"}
|
package/dist/src/mcp/auth.js
CHANGED
|
@@ -1,3 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A typed refusal from an MCP auth strategy: the token was recognized and deliberately refused (a
|
|
3
|
+
* client that is not allowed on this endpoint, an account that left the tenant, a revoked grant).
|
|
4
|
+
*
|
|
5
|
+
* Throw it from `verify` — or from the `toActor` of `authKitAuth()` / `apiKeyAuth()` — and the
|
|
6
|
+
* provider answers with its `status` and message, plus the matching `WWW-Authenticate` challenge:
|
|
7
|
+
* `401` → `error="invalid_token"`, `403` → `error="insufficient_scope"`.
|
|
8
|
+
*
|
|
9
|
+
* Inside {@link anyOf} it is also a stop signal: a strategy that throws `McpAuthError` has claimed
|
|
10
|
+
* the token, so the remaining strategies are not tried. Any other error means "not my token" and
|
|
11
|
+
* the next strategy gets its turn.
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* authKitAuth({
|
|
15
|
+
* toActor: ({ accountId, clientId }) => {
|
|
16
|
+
* if (clientId === 'web') throw new McpAuthError('token was not issued for MCP')
|
|
17
|
+
* return { id: accountId }
|
|
18
|
+
* },
|
|
19
|
+
* })
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export class McpAuthError extends Error {
|
|
23
|
+
/** HTTP status of the refusal: `401` (the token does not authenticate) or `403` (it does, but may not do this). */
|
|
24
|
+
status;
|
|
25
|
+
constructor(message, options = {}) {
|
|
26
|
+
super(message, options.cause !== undefined ? { cause: options.cause } : undefined);
|
|
27
|
+
this.name = 'McpAuthError';
|
|
28
|
+
this.status = options.status ?? 401;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
1
31
|
/**
|
|
2
32
|
* Resolve a `McpAuth` config value (a ready instance or a lazy factory) at provider boot.
|
|
3
33
|
*/
|
|
@@ -42,14 +72,30 @@ export function authKitAuth(options = {}) {
|
|
|
42
72
|
async verify(token) {
|
|
43
73
|
const service = await getService();
|
|
44
74
|
const at = await service.provider.AccessToken.find(token);
|
|
45
|
-
if (!at
|
|
75
|
+
if (!at) {
|
|
76
|
+
// Not an access token this issuer knows — plain `Error`, so `anyOf` tries the next strategy.
|
|
46
77
|
throw new Error('invalid or expired access token');
|
|
47
78
|
}
|
|
79
|
+
if (at.isExpired) {
|
|
80
|
+
throw new McpAuthError('invalid or expired access token');
|
|
81
|
+
}
|
|
82
|
+
let grant;
|
|
83
|
+
if (at.grantId !== undefined && service.provider.Grant !== undefined) {
|
|
84
|
+
grant = await service.provider.Grant.find(at.grantId);
|
|
85
|
+
if (grant === undefined) {
|
|
86
|
+
// The user revoked the authorization; the token must not outlive it.
|
|
87
|
+
throw new McpAuthError('authorization revoked');
|
|
88
|
+
}
|
|
89
|
+
}
|
|
48
90
|
const tokenScopes = (at.scope ?? '').split(' ').filter(Boolean);
|
|
49
91
|
const actor = await toActor({
|
|
50
92
|
accountId: at.accountId,
|
|
51
93
|
scopes: tokenScopes,
|
|
52
94
|
clientId: at.clientId,
|
|
95
|
+
grantId: at.grantId,
|
|
96
|
+
grant,
|
|
97
|
+
activeOrg: readActiveOrg(grant?.activeOrg),
|
|
98
|
+
extra: at.extra,
|
|
53
99
|
});
|
|
54
100
|
return {
|
|
55
101
|
token,
|
|
@@ -62,6 +108,19 @@ export function authKitAuth(options = {}) {
|
|
|
62
108
|
};
|
|
63
109
|
};
|
|
64
110
|
}
|
|
111
|
+
/** Narrow the grant's stored `activeOrg` to {@link AuthKitActiveOrg}; anything without an `orgId` string is no org. */
|
|
112
|
+
function readActiveOrg(value) {
|
|
113
|
+
if (typeof value !== 'object' || value === null)
|
|
114
|
+
return undefined;
|
|
115
|
+
const candidate = value;
|
|
116
|
+
if (typeof candidate.orgId !== 'string' || candidate.orgId === '')
|
|
117
|
+
return undefined;
|
|
118
|
+
return {
|
|
119
|
+
orgId: candidate.orgId,
|
|
120
|
+
...(typeof candidate.orgSlug === 'string' ? { orgSlug: candidate.orgSlug } : {}),
|
|
121
|
+
...(typeof candidate.orgRole === 'string' ? { orgRole: candidate.orgRole } : {}),
|
|
122
|
+
};
|
|
123
|
+
}
|
|
65
124
|
/**
|
|
66
125
|
* Resolve the authkit `OidcService` from the container. `@adonis-agora/authkit-server` augments
|
|
67
126
|
* `ContainerBindings` with `'authkit.server'`, so `make` is fully typed with no cast.
|
|
@@ -105,4 +164,50 @@ function timingSafeEqual(a, b) {
|
|
|
105
164
|
}
|
|
106
165
|
return diff === 0;
|
|
107
166
|
}
|
|
167
|
+
// ── anyOf ───────────────────────────────────────────────────────────────────
|
|
168
|
+
/**
|
|
169
|
+
* Accept more than one kind of bearer token on the same MCP endpoint — e.g. OAuth access tokens from
|
|
170
|
+
* MCP clients that logged in through the browser AND personal access tokens for machine integrations:
|
|
171
|
+
*
|
|
172
|
+
* ```ts
|
|
173
|
+
* auth: anyOf(
|
|
174
|
+
* authKitAuth({ toActor }),
|
|
175
|
+
* { verify: verifyPersonalAccessToken },
|
|
176
|
+
* )
|
|
177
|
+
* ```
|
|
178
|
+
*
|
|
179
|
+
* Strategies are tried in order and the first that verifies the token wins. A strategy that throws a
|
|
180
|
+
* plain `Error` passes ("not my token"); one that throws {@link McpAuthError} has claimed the token and
|
|
181
|
+
* refused it, so the chain stops there with that refusal. When every strategy passes, the last error
|
|
182
|
+
* is rethrown.
|
|
183
|
+
*
|
|
184
|
+
* OAuth metadata comes from the first strategy that exposes it, so the RFC 9728 document and the
|
|
185
|
+
* `WWW-Authenticate` challenge still point MCP clients at the login flow.
|
|
186
|
+
*/
|
|
187
|
+
export function anyOf(...strategies) {
|
|
188
|
+
if (strategies.length === 0) {
|
|
189
|
+
throw new Error('[@adonis-agora/agent] `anyOf()` needs at least one MCP auth strategy');
|
|
190
|
+
}
|
|
191
|
+
return async (ctx) => {
|
|
192
|
+
const resolved = await Promise.all(strategies.map((strategy) => resolveMcpAuth(strategy, ctx)));
|
|
193
|
+
const oauth = resolved.find((strategy) => strategy.oauth !== undefined)?.oauth;
|
|
194
|
+
return {
|
|
195
|
+
...(oauth !== undefined ? { oauth } : {}),
|
|
196
|
+
async verify(token) {
|
|
197
|
+
let lastError;
|
|
198
|
+
for (const strategy of resolved) {
|
|
199
|
+
try {
|
|
200
|
+
return await strategy.verify(token);
|
|
201
|
+
}
|
|
202
|
+
catch (error) {
|
|
203
|
+
if (error instanceof McpAuthError)
|
|
204
|
+
throw error;
|
|
205
|
+
lastError = error;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
throw lastError;
|
|
209
|
+
},
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
}
|
|
108
213
|
//# sourceMappingURL=auth.js.map
|
package/dist/src/mcp/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/mcp/auth.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/mcp/auth.ts"],"names":[],"mappings":"A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AM,QAAQ,IAAI,QAAQ,EAAE,CAAC;oBAChC,IAAI,CAAC;wBACH,OAAO,MAAM,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;oBACtC,CAAC;oBAAC,OAAO,KAAK,EAAE,CAAC;wBACf,IAAI,KAAK,YAAY,YAAY;4BAAE,MAAM,KAAK,CAAC;wBAC/C,SAAS,GAAG,KAAK,CAAC;oBACpB,CAAC;gBACH,CAAC;gBACD,MAAM,SAAS,CAAC;YAClB,CAAC;SACF,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RolesPolicy } from '../spi/roles-policy.js';
|
|
2
2
|
import type { McpAuth, McpAuthFactory } from './auth.js';
|
|
3
|
-
import { apiKeyAuth, authKitAuth } from './auth.js';
|
|
3
|
+
import { anyOf, apiKeyAuth, authKitAuth, McpAuthError } from './auth.js';
|
|
4
4
|
/**
|
|
5
5
|
* Shape of `config/mcp.ts`. The MCP provider exposes the agent's {@link ToolRegistry} over the Model
|
|
6
6
|
* Context Protocol (Streamable HTTP): `tools/list` mirrors the tools the acting actor may call
|
|
@@ -27,9 +27,17 @@ export interface McpConfig {
|
|
|
27
27
|
* OAuth metadata (when `auth.oauth` is set) is served at `/.well-known/oauth-protected-resource{path}`.
|
|
28
28
|
*/
|
|
29
29
|
path?: string;
|
|
30
|
+
/**
|
|
31
|
+
* The public origin MCP clients reach this app at (e.g. `'https://app.example.com'`) — the base of
|
|
32
|
+
* the RFC 9728 `resource` and of the `resource_metadata` URL in the `WWW-Authenticate` challenge.
|
|
33
|
+
* Set it whenever TLS terminates at a proxy the app does not trust (the request then "sees"
|
|
34
|
+
* `http://`). Omit → both are built from the request's protocol and `Host` header. Must be an
|
|
35
|
+
* origin only: a path, query, or fragment is rejected at boot.
|
|
36
|
+
*/
|
|
37
|
+
publicUrl?: string;
|
|
30
38
|
/**
|
|
31
39
|
* How MCP clients authenticate. Pass a ready {@link McpAuth} or a lazy {@link McpAuthFactory} thunk
|
|
32
|
-
* (`authKitAuth()` / `apiKeyAuth()`). Omit → the server is open (no bearer check); the acting actor
|
|
40
|
+
* (`authKitAuth()` / `apiKeyAuth()`, or several of them combined with `anyOf()`). Omit → the server is open (no bearer check); the acting actor
|
|
33
41
|
* falls back to `actor`. Fail-closed: with no `auth` AND no `actor`, requests are rejected.
|
|
34
42
|
*/
|
|
35
43
|
auth?: McpAuth | McpAuthFactory;
|
|
@@ -58,7 +66,7 @@ export interface McpConfig {
|
|
|
58
66
|
}
|
|
59
67
|
/** Identity helper giving `config/mcp.ts` full type-checking. */
|
|
60
68
|
export declare function defineMcpConfig(config: McpConfig): McpConfig;
|
|
61
|
-
export type { ApiKeyActorResolver, ApiKeyMcpAuthOptions, AuthKitActorResolver, AuthKitMcpAuthOptions, McpAuth, McpAuthContext, McpAuthFactory, McpOAuthMetadata, } from './auth.js';
|
|
69
|
+
export type { ApiKeyActorResolver, ApiKeyMcpAuthOptions, AuthKitActiveOrg, AuthKitActorInfo, AuthKitActorResolver, AuthKitGrant, AuthKitMcpAuthOptions, McpAuth, McpAuthContext, McpAuthFactory, McpOAuthMetadata, } from './auth.js';
|
|
62
70
|
export { resolveMcpAuth } from './auth.js';
|
|
63
|
-
export { apiKeyAuth, authKitAuth };
|
|
71
|
+
export { anyOf, apiKeyAuth, authKitAuth, McpAuthError };
|
|
64
72
|
//# sourceMappingURL=define_config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define_config.d.ts","sourceRoot":"","sources":["../../../src/mcp/define_config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"define_config.d.ts","sourceRoot":"","sources":["../../../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YAAY,EAAE,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { apiKeyAuth, authKitAuth } from './auth.js';
|
|
1
|
+
import { anyOf, apiKeyAuth, authKitAuth, McpAuthError } from './auth.js';
|
|
2
2
|
/** Identity helper giving `config/mcp.ts` full type-checking. */
|
|
3
3
|
export function defineMcpConfig(config) {
|
|
4
4
|
return config;
|
|
5
5
|
}
|
|
6
6
|
export { resolveMcpAuth } from './auth.js';
|
|
7
|
-
export { apiKeyAuth, authKitAuth };
|
|
7
|
+
export { anyOf, apiKeyAuth, authKitAuth, McpAuthError };
|
|
8
8
|
//# sourceMappingURL=define_config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define_config.js","sourceRoot":"","sources":["../../../src/mcp/define_config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"define_config.js","sourceRoot":"","sources":["../../../src/mcp/define_config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AA8DzE,iEAAiE;AACjE,MAAM,UAAU,eAAe,CAAC,MAAiB;IAC/C,OAAO,MAAM,CAAC;AAChB,CAAC;AAeD,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The OAuth discovery surface of the MCP server (MCP Authorization spec, RFC 9728, RFC 6750 §3): the
|
|
3
|
+
* protected-resource metadata document, its well-known URL, and the `WWW-Authenticate` challenge a
|
|
4
|
+
* `401`/`403` carries so an MCP client knows where to start the login.
|
|
5
|
+
*
|
|
6
|
+
* Pure functions over strings — the provider decides which origin to feed them (the configured
|
|
7
|
+
* `publicUrl`, or the request's own protocol and `Host` as a fallback).
|
|
8
|
+
*/
|
|
9
|
+
import type { McpOAuthMetadata } from './auth.js';
|
|
10
|
+
/** Normalize a route prefix the way the provider mounts it: no leading/trailing slashes. */
|
|
11
|
+
export declare function normalizeMcpPath(path: string | undefined): string;
|
|
12
|
+
/**
|
|
13
|
+
* Validate `publicUrl` from `config/mcp.ts` and reduce it to its origin (`https://app.example.com`).
|
|
14
|
+
* Only an origin is meaningful: the MCP endpoint and its well-known document are mounted at fixed
|
|
15
|
+
* paths on this app, so a path, query, or fragment would advertise URLs the app does not serve.
|
|
16
|
+
*/
|
|
17
|
+
export declare function publicOrigin(publicUrl: string): string;
|
|
18
|
+
/** The protected resource (RFC 9728 `resource`): the URL an MCP client points at, e.g. `https://app.example.com/mcp`. */
|
|
19
|
+
export declare function mcpResourceUrl(origin: string, path: string): string;
|
|
20
|
+
/** Where the protected-resource metadata lives (RFC 9728 §3.1): the well-known segment goes between host and path. */
|
|
21
|
+
export declare function protectedResourceMetadataUrl(origin: string, path: string): string;
|
|
22
|
+
/** The RFC 9728 protected-resource metadata document. */
|
|
23
|
+
export interface ProtectedResourceMetadata {
|
|
24
|
+
resource: string;
|
|
25
|
+
authorization_servers: string[];
|
|
26
|
+
scopes_supported: string[];
|
|
27
|
+
bearer_methods_supported: string[];
|
|
28
|
+
resource_name: string;
|
|
29
|
+
}
|
|
30
|
+
/** Build the RFC 9728 document for the MCP endpoint at `origin` + `path`. */
|
|
31
|
+
export declare function protectedResourceMetadata(meta: McpOAuthMetadata, origin: string, path: string): ProtectedResourceMetadata;
|
|
32
|
+
/** Options for {@link wwwAuthenticateChallenge}. */
|
|
33
|
+
export interface WwwAuthenticateOptions {
|
|
34
|
+
/**
|
|
35
|
+
* The RFC 6750 error code. `invalid_token` when the request carried a token that was refused,
|
|
36
|
+
* `insufficient_scope` for a `403`, omitted when no token was sent at all (RFC 6750 §3.1).
|
|
37
|
+
*/
|
|
38
|
+
error?: 'invalid_token' | 'insufficient_scope';
|
|
39
|
+
/** The metadata URL (RFC 9728 §5.1). Set only when the auth strategy exposes OAuth metadata. */
|
|
40
|
+
resourceMetadataUrl?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The `WWW-Authenticate` value for a `401`/`403` from the MCP endpoint — e.g.
|
|
44
|
+
* `Bearer error="invalid_token", resource_metadata="https://app.example.com/.well-known/oauth-protected-resource/mcp"`.
|
|
45
|
+
* `resource_metadata` is what makes an MCP client discover the authorization server and open the login.
|
|
46
|
+
*/
|
|
47
|
+
export declare function wwwAuthenticateChallenge(options?: WwwAuthenticateOptions): string;
|
|
48
|
+
//# sourceMappingURL=discovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../../src/mcp/discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAElD,4FAA4F;AAC5F,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAEjE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAoBtD;AAED,yHAAyH;AACzH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED,sHAAsH;AACtH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjF;AAED,yDAAyD;AACzD,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,wBAAwB,EAAE,MAAM,EAAE,CAAC;IACnC,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,6EAA6E;AAC7E,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,gBAAgB,EACtB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GACX,yBAAyB,CAQ3B;AAED,oDAAoD;AACpD,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,KAAK,CAAC,EAAE,eAAe,GAAG,oBAAoB,CAAC;IAC/C,gGAAgG;IAChG,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,GAAE,sBAA2B,GAAG,MAAM,CAOrF"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The OAuth discovery surface of the MCP server (MCP Authorization spec, RFC 9728, RFC 6750 §3): the
|
|
3
|
+
* protected-resource metadata document, its well-known URL, and the `WWW-Authenticate` challenge a
|
|
4
|
+
* `401`/`403` carries so an MCP client knows where to start the login.
|
|
5
|
+
*
|
|
6
|
+
* Pure functions over strings — the provider decides which origin to feed them (the configured
|
|
7
|
+
* `publicUrl`, or the request's own protocol and `Host` as a fallback).
|
|
8
|
+
*/
|
|
9
|
+
/** Normalize a route prefix the way the provider mounts it: no leading/trailing slashes. */
|
|
10
|
+
export function normalizeMcpPath(path) {
|
|
11
|
+
return (path ?? 'mcp').replace(/^\/+|\/+$/g, '');
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Validate `publicUrl` from `config/mcp.ts` and reduce it to its origin (`https://app.example.com`).
|
|
15
|
+
* Only an origin is meaningful: the MCP endpoint and its well-known document are mounted at fixed
|
|
16
|
+
* paths on this app, so a path, query, or fragment would advertise URLs the app does not serve.
|
|
17
|
+
*/
|
|
18
|
+
export function publicOrigin(publicUrl) {
|
|
19
|
+
let url;
|
|
20
|
+
try {
|
|
21
|
+
url = new URL(publicUrl);
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
throw new Error(`[@adonis-agora/agent] \`publicUrl\` in config/mcp.ts is not an absolute URL: ${JSON.stringify(publicUrl)}`);
|
|
25
|
+
}
|
|
26
|
+
if (url.protocol !== 'http:' && url.protocol !== 'https:') {
|
|
27
|
+
throw new Error(`[@adonis-agora/agent] \`publicUrl\` in config/mcp.ts must be http(s), got ${JSON.stringify(publicUrl)}`);
|
|
28
|
+
}
|
|
29
|
+
if (url.pathname !== '/' || url.search !== '' || url.hash !== '') {
|
|
30
|
+
throw new Error(`[@adonis-agora/agent] \`publicUrl\` in config/mcp.ts must be an origin only (e.g. "https://app.example.com"), got ${JSON.stringify(publicUrl)}`);
|
|
31
|
+
}
|
|
32
|
+
return url.origin;
|
|
33
|
+
}
|
|
34
|
+
/** The protected resource (RFC 9728 `resource`): the URL an MCP client points at, e.g. `https://app.example.com/mcp`. */
|
|
35
|
+
export function mcpResourceUrl(origin, path) {
|
|
36
|
+
return `${origin}/${normalizeMcpPath(path)}`;
|
|
37
|
+
}
|
|
38
|
+
/** Where the protected-resource metadata lives (RFC 9728 §3.1): the well-known segment goes between host and path. */
|
|
39
|
+
export function protectedResourceMetadataUrl(origin, path) {
|
|
40
|
+
return `${origin}/.well-known/oauth-protected-resource/${normalizeMcpPath(path)}`;
|
|
41
|
+
}
|
|
42
|
+
/** Build the RFC 9728 document for the MCP endpoint at `origin` + `path`. */
|
|
43
|
+
export function protectedResourceMetadata(meta, origin, path) {
|
|
44
|
+
return {
|
|
45
|
+
resource: mcpResourceUrl(origin, path),
|
|
46
|
+
authorization_servers: [meta.issuer],
|
|
47
|
+
scopes_supported: meta.scopesSupported,
|
|
48
|
+
bearer_methods_supported: ['header'],
|
|
49
|
+
resource_name: meta.resourceName,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The `WWW-Authenticate` value for a `401`/`403` from the MCP endpoint — e.g.
|
|
54
|
+
* `Bearer error="invalid_token", resource_metadata="https://app.example.com/.well-known/oauth-protected-resource/mcp"`.
|
|
55
|
+
* `resource_metadata` is what makes an MCP client discover the authorization server and open the login.
|
|
56
|
+
*/
|
|
57
|
+
export function wwwAuthenticateChallenge(options = {}) {
|
|
58
|
+
const params = [];
|
|
59
|
+
if (options.error !== undefined)
|
|
60
|
+
params.push(`error="${options.error}"`);
|
|
61
|
+
if (options.resourceMetadataUrl !== undefined) {
|
|
62
|
+
params.push(`resource_metadata="${quote(options.resourceMetadataUrl)}"`);
|
|
63
|
+
}
|
|
64
|
+
return params.length === 0 ? 'Bearer' : `Bearer ${params.join(', ')}`;
|
|
65
|
+
}
|
|
66
|
+
/** Escape a value for an RFC 7230 quoted-string. */
|
|
67
|
+
function quote(value) {
|
|
68
|
+
return value.replace(/[\\"]/g, (char) => `\\${char}`);
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=discovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery.js","sourceRoot":"","sources":["../../../src/mcp/discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,4FAA4F;AAC5F,MAAM,UAAU,gBAAgB,CAAC,IAAwB;IACvD,OAAO,CAAC,IAAI,IAAI,KAAK,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AACnD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,SAAiB;IAC5C,IAAI,GAAQ,CAAC;IACb,IAAI,CAAC;QACH,GAAG,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CACb,gFAAgF,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAC5G,CAAC;IACJ,CAAC;IACD,IAAI,GAAG,CAAC,QAAQ,KAAK,OAAO,IAAI,GAAG,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC1D,MAAM,IAAI,KAAK,CACb,6EAA6E,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CACzG,CAAC;IACJ,CAAC;IACD,IAAI,GA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AmB,CAAC,GAAG,CAAC,CAAC;IAC3E,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AACxE,CAAC;AAED,oDAAoD;AACpD,SAAS,KAAK,CAAC,KAAa;IAC1B,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;AACxD,CAAC"}
|
package/dist/src/mcp/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export { actorFromAuthInfo, isActor } from './actor.js';
|
|
2
|
-
export type { ApiKeyActorResolver, ApiKeyMcpAuthOptions, AuthKitActorResolver, AuthKitMcpAuthOptions, McpAuth, McpAuthContext, McpAuthFactory, McpAuthInfo, McpOAuthMetadata, } from './auth.js';
|
|
3
|
-
export { apiKeyAuth, authKitAuth, resolveMcpAuth } from './auth.js';
|
|
2
|
+
export type { ApiKeyActorResolver, ApiKeyMcpAuthOptions, AuthKitActiveOrg, AuthKitActorInfo, AuthKitActorResolver, AuthKitGrant, AuthKitMcpAuthOptions, McpAuth, McpAuthContext, McpAuthFactory, McpAuthInfo, McpOAuthMetadata, } from './auth.js';
|
|
3
|
+
export { anyOf, apiKeyAuth, authKitAuth, McpAuthError, resolveMcpAuth } from './auth.js';
|
|
4
4
|
export type { McpConfig } from './define_config.js';
|
|
5
5
|
export { defineMcpConfig } from './define_config.js';
|
|
6
|
+
export type { ProtectedResourceMetadata, WwwAuthenticateOptions } from './discovery.js';
|
|
7
|
+
export { mcpResourceUrl, protectedResourceMetadata, protectedResourceMetadataUrl, publicOrigin, wwwAuthenticateChallenge, } from './discovery.js';
|
|
6
8
|
export type { CreateMcpServerOptions, McpToolContextOptions } from './server.js';
|
|
7
9
|
export { createMcpServer } from './server.js';
|
|
8
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mcp/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACxD,YAAY,EACV,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,OAAO,EACP,cAAc,EACd,cAAc,EACd,WAAW,EACX,gBAAgB,GACjB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mcp/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACxD,YAAY,EACV,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,YAAY,EACZ,qBAAqB,EACrB,OAAO,EACP,cAAc,EACd,cAAc,EACd,WAAW,EACX,gBAAgB,GACjB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACzF,YAAY,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,YAAY,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxF,OAAO,EACL,cAAc,EACd,yBAAyB,EACzB,4BAA4B,EAC5B,YAAY,EACZ,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/src/mcp/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { actorFromAuthInfo, isActor } from './actor.js';
|
|
2
|
-
export { apiKeyAuth, authKitAuth, resolveMcpAuth } from './auth.js';
|
|
2
|
+
export { anyOf, apiKeyAuth, authKitAuth, McpAuthError, resolveMcpAuth } from './auth.js';
|
|
3
3
|
export { defineMcpConfig } from './define_config.js';
|
|
4
|
+
export { mcpResourceUrl, protectedResourceMetadata, protectedResourceMetadataUrl, publicOrigin, wwwAuthenticateChallenge, } from './discovery.js';
|
|
4
5
|
export { createMcpServer } from './server.js';
|
|
5
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/mcp/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/mcp/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAexD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEzF,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EACL,cAAc,EACd,yBAAyB,EACzB,4BAA4B,EAC5B,YAAY,EACZ,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/src/memory.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/memory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,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