@polaris-auth/client 0.9.0 → 0.10.1
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/agents.d.ts +9189 -0
- package/dist/agents.js +51 -0
- package/dist/index.d.ts +10 -2
- package/dist/index.js +7 -1
- package/dist/mcp.d.ts +456 -0
- package/dist/mcp.js +9 -0
- package/openapi.json +5470 -1
- package/package.json +6 -2
- package/src/agents.ts +58 -0
- package/src/index.ts +12 -2
- package/src/mcp.ts +16 -0
- package/src/schema.d.ts +8552 -5499
package/dist/agents.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/** The `agents` plugin's routes as methods of `client.agents`. */
|
|
2
|
+
export function agents(client) {
|
|
3
|
+
return {
|
|
4
|
+
/** GET /admin/agents: List every agent */
|
|
5
|
+
adminListAgents: (...init) => client.GET("/admin/agents", ...init),
|
|
6
|
+
/** POST /admin/agents/{id}/revoke: Revoke an agent as an operator */
|
|
7
|
+
adminRevokeAgent: (...init) => client.POST("/admin/agents/{id}/revoke", ...init),
|
|
8
|
+
/** GET /agents/capabilities: List the capabilities */
|
|
9
|
+
capabilities: (...init) => client.GET("/agents/capabilities", ...init),
|
|
10
|
+
/** GET /.well-known/agent-configuration: Agent protocol discovery */
|
|
11
|
+
configuration: (...init) => client.GET("/.well-known/agent-configuration", ...init),
|
|
12
|
+
/** POST /agents/hosts: Create a host */
|
|
13
|
+
createHost: (...init) => client.POST("/agents/hosts", ...init),
|
|
14
|
+
/** POST /agents/approvals/{id}/decide: Approve or deny a grant request */
|
|
15
|
+
decideApproval: (...init) => client.POST("/agents/approvals/{id}/decide", ...init),
|
|
16
|
+
/** DELETE /agents/grants/{id}: Revoke a grant */
|
|
17
|
+
deleteGrant: (...init) => client.DELETE("/agents/grants/{id}", ...init),
|
|
18
|
+
/** DELETE /agents/hosts/{id}: Revoke a host */
|
|
19
|
+
deleteHost: (...init) => client.DELETE("/agents/hosts/{id}", ...init),
|
|
20
|
+
/** POST /agents/enroll: Enrol an agent through a host */
|
|
21
|
+
enroll: (...init) => client.POST("/agents/enroll", ...init),
|
|
22
|
+
/** POST /agents/execute: Execute a capability */
|
|
23
|
+
execute: (...init) => client.POST("/agents/execute", ...init),
|
|
24
|
+
/** GET /agents: List my agents */
|
|
25
|
+
listAgents: (...init) => client.GET("/agents", ...init),
|
|
26
|
+
/** GET /agents/approvals: List pending approvals */
|
|
27
|
+
listApprovals: (...init) => client.GET("/agents/approvals", ...init),
|
|
28
|
+
/** GET /agents/hosts: List my hosts */
|
|
29
|
+
listHosts: (...init) => client.GET("/agents/hosts", ...init),
|
|
30
|
+
/** GET /agents/{id}/receipts: List an agent's receipts */
|
|
31
|
+
listReceipts: (...init) => client.GET("/agents/{id}/receipts", ...init),
|
|
32
|
+
/** GET /agents/approvals/code: Read the approval behind a user code */
|
|
33
|
+
readApproval: (...init) => client.GET("/agents/approvals/code", ...init),
|
|
34
|
+
/** POST /agents/register: Register an agent */
|
|
35
|
+
register: (...init) => client.POST("/agents/register", ...init),
|
|
36
|
+
/** POST /agents/grants/request: Request capability grants */
|
|
37
|
+
requestGrants: (...init) => client.POST("/agents/grants/request", ...init),
|
|
38
|
+
/** POST /agents/{id}/resume: Resume an agent */
|
|
39
|
+
resume: (...init) => client.POST("/agents/{id}/resume", ...init),
|
|
40
|
+
/** POST /agents/{id}/revoke: Revoke an agent */
|
|
41
|
+
revoke: (...init) => client.POST("/agents/{id}/revoke", ...init),
|
|
42
|
+
/** GET /agents/session: The agent's session */
|
|
43
|
+
session: (...init) => client.GET("/agents/session", ...init),
|
|
44
|
+
/** GET /agents/{id}: Read an agent */
|
|
45
|
+
showAgent: (...init) => client.GET("/agents/{id}", ...init),
|
|
46
|
+
/** POST /agents/{id}/suspend: Suspend an agent */
|
|
47
|
+
suspend: (...init) => client.POST("/agents/{id}/suspend", ...init),
|
|
48
|
+
/** GET /agents/receipts/{id}/verify: Verify a receipt */
|
|
49
|
+
verifyReceipt: (...init) => client.GET("/agents/receipts/{id}/verify", ...init),
|
|
50
|
+
};
|
|
51
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ import { type ScimApi } from "./scim.js";
|
|
|
11
11
|
import { type SocialApi } from "./social.js";
|
|
12
12
|
import { type ApiKeysApi } from "./api-keys.js";
|
|
13
13
|
import { type OauthApi } from "./oauth.js";
|
|
14
|
+
import { type McpApi } from "./mcp.js";
|
|
15
|
+
import { type AgentsApi } from "./agents.js";
|
|
14
16
|
import { type SsoApi } from "./sso.js";
|
|
15
17
|
import { type UsernameApi } from "./username.js";
|
|
16
18
|
import type { components, paths } from "./schema.js";
|
|
@@ -27,6 +29,8 @@ export { scim, type ScimApi } from "./scim.js";
|
|
|
27
29
|
export { social, type SocialApi } from "./social.js";
|
|
28
30
|
export { apiKeys, type ApiKeysApi } from "./api-keys.js";
|
|
29
31
|
export { oauth, type OauthApi } from "./oauth.js";
|
|
32
|
+
export { mcp, type McpApi } from "./mcp.js";
|
|
33
|
+
export { agents, type AgentsApi } from "./agents.js";
|
|
30
34
|
export { sso, type SsoApi } from "./sso.js";
|
|
31
35
|
export { username, type UsernameApi } from "./username.js";
|
|
32
36
|
export { registerPasskey, signInWithPasskey, passkeyAssertion, passkeyAutofillAvailable, type SignInWithPasskeyOptions } from "./webauthn.js";
|
|
@@ -34,7 +38,7 @@ export { registerPasskey, signInWithPasskey, passkeyAssertion, passkeyAutofillAv
|
|
|
34
38
|
export type ErrorBody = components["schemas"]["Error"];
|
|
35
39
|
/** The `{ errors: [...] }` envelope of a core route's 422. */
|
|
36
40
|
export type ValidationErrorBody = components["schemas"]["ValidationError"];
|
|
37
|
-
/** The RFC 9457 problem document every non-2xx response of a plugin route (`audit`, `admin`, `sentinel`, `sso`, `scim`, `passwordless`, `username`, `anonymous`, `multi-session`, `social`, `passkey`, `api-keys`, `oauth`) carries. */
|
|
41
|
+
/** The RFC 9457 problem document every non-2xx response of a plugin route (`audit`, `admin`, `sentinel`, `sso`, `scim`, `passwordless`, `username`, `anonymous`, `multi-session`, `social`, `passkey`, `api-keys`, `oauth`, `mcp`, `agents`) carries. */
|
|
38
42
|
export type ProblemBody = components["schemas"]["Problem"];
|
|
39
43
|
export interface PolarisClientOptions extends ClientOptions {
|
|
40
44
|
/** Where Polaris is mounted: `https://app.example.com`, or `https://app.example.com/api/auth` behind a prefix. */
|
|
@@ -80,6 +84,10 @@ export interface PolarisClient extends Client<paths> {
|
|
|
80
84
|
readonly apiKeys: ApiKeysApi;
|
|
81
85
|
/** The `polaris/oauth-provider` routes: `client.oauth.authorize()`, `decision()`, `token()`, `userinfo()`, `revoke()`, `introspect()`, `register()`, the device, CIBA, consent, client-management and discovery methods. */
|
|
82
86
|
readonly oauth: OauthApi;
|
|
87
|
+
/** The `polaris/mcp` routes: `client.mcp.mcp()` (one JSON-RPC message to `POST /mcp`) and `protectedResource()` (the RFC 9728 metadata). */
|
|
88
|
+
readonly mcp: McpApi;
|
|
89
|
+
/** The `polaris/agents` routes: the owner's (`register()`, `listAgents()`, `listApprovals()`, `decideApproval()`, `revoke()`, ...), the agent's (`requestGrants()`, `execute()`, `session()`; `@polaris-auth/agent` signs them) and `configuration()`. */
|
|
90
|
+
readonly agents: AgentsApi;
|
|
83
91
|
/** A new client on the same options bound to another token (null for anonymous); this one is unchanged. */
|
|
84
92
|
withToken(token: string | null): PolarisClient;
|
|
85
93
|
}
|
|
@@ -87,7 +95,7 @@ export interface PolarisClient extends Client<paths> {
|
|
|
87
95
|
* An `openapi-fetch` client typed by `paths` (generated from `polaris manifest --format=openapi`), so
|
|
88
96
|
* `client.POST("/auth/login", { body })` checks the body and types `data` and `error`; the plugins' routes
|
|
89
97
|
* are also methods of `client.audit`, `client.admin`, `client.sentinel`, `client.sso`, `client.scim`, `client.passwordless`,
|
|
90
|
-
* `client.username`, `client.anonymous`, `client.multiSession`, `client.social`, `client.passkey`, `client.apiKeys` and `client.
|
|
98
|
+
* `client.username`, `client.anonymous`, `client.multiSession`, `client.social`, `client.passkey`, `client.apiKeys`, `client.oauth`, `client.mcp` and `client.agents`; `challenge.captcha`
|
|
91
99
|
* answers a sentinel captcha challenge with one retry. No refresh loop and no storage: when to refresh
|
|
92
100
|
* and where to keep tokens is the application's policy.
|
|
93
101
|
*/
|
package/dist/index.js
CHANGED
|
@@ -11,6 +11,8 @@ import { scim } from "./scim.js";
|
|
|
11
11
|
import { social } from "./social.js";
|
|
12
12
|
import { apiKeys } from "./api-keys.js";
|
|
13
13
|
import { oauth } from "./oauth.js";
|
|
14
|
+
import { mcp } from "./mcp.js";
|
|
15
|
+
import { agents } from "./agents.js";
|
|
14
16
|
import { sso } from "./sso.js";
|
|
15
17
|
import { username } from "./username.js";
|
|
16
18
|
export { admin } from "./admin.js";
|
|
@@ -25,6 +27,8 @@ export { scim } from "./scim.js";
|
|
|
25
27
|
export { social } from "./social.js";
|
|
26
28
|
export { apiKeys } from "./api-keys.js";
|
|
27
29
|
export { oauth } from "./oauth.js";
|
|
30
|
+
export { mcp } from "./mcp.js";
|
|
31
|
+
export { agents } from "./agents.js";
|
|
28
32
|
export { sso } from "./sso.js";
|
|
29
33
|
export { username } from "./username.js";
|
|
30
34
|
export { registerPasskey, signInWithPasskey, passkeyAssertion, passkeyAutofillAvailable } from "./webauthn.js";
|
|
@@ -32,7 +36,7 @@ export { registerPasskey, signInWithPasskey, passkeyAssertion, passkeyAutofillAv
|
|
|
32
36
|
* An `openapi-fetch` client typed by `paths` (generated from `polaris manifest --format=openapi`), so
|
|
33
37
|
* `client.POST("/auth/login", { body })` checks the body and types `data` and `error`; the plugins' routes
|
|
34
38
|
* are also methods of `client.audit`, `client.admin`, `client.sentinel`, `client.sso`, `client.scim`, `client.passwordless`,
|
|
35
|
-
* `client.username`, `client.anonymous`, `client.multiSession`, `client.social`, `client.passkey`, `client.apiKeys` and `client.
|
|
39
|
+
* `client.username`, `client.anonymous`, `client.multiSession`, `client.social`, `client.passkey`, `client.apiKeys`, `client.oauth`, `client.mcp` and `client.agents`; `challenge.captcha`
|
|
36
40
|
* answers a sentinel captcha challenge with one retry. No refresh loop and no storage: when to refresh
|
|
37
41
|
* and where to keep tokens is the application's policy.
|
|
38
42
|
*/
|
|
@@ -66,6 +70,8 @@ export function createClient(options) {
|
|
|
66
70
|
passkey: passkey(client),
|
|
67
71
|
apiKeys: apiKeys(client),
|
|
68
72
|
oauth: oauth(client),
|
|
73
|
+
mcp: mcp(client),
|
|
74
|
+
agents: agents(client),
|
|
69
75
|
withToken: (next) => createClient({ ...options, token: next }),
|
|
70
76
|
};
|
|
71
77
|
}
|
package/dist/mcp.d.ts
ADDED
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
import type { Client } from "openapi-fetch";
|
|
2
|
+
import type { paths } from "./schema.js";
|
|
3
|
+
import type { Init } from "./namespace.js";
|
|
4
|
+
/** The `mcp` plugin's routes as methods of `client.mcp`. */
|
|
5
|
+
export declare function mcp(client: Client<paths>): {
|
|
6
|
+
/** POST /mcp: Serve an MCP message */
|
|
7
|
+
mcp: (init_0?: ({
|
|
8
|
+
params?: {
|
|
9
|
+
query?: never;
|
|
10
|
+
header?: never;
|
|
11
|
+
path?: never;
|
|
12
|
+
cookie?: never;
|
|
13
|
+
};
|
|
14
|
+
} & {
|
|
15
|
+
body?: undefined;
|
|
16
|
+
} & {
|
|
17
|
+
baseUrl?: string;
|
|
18
|
+
querySerializer?: import("openapi-fetch").QuerySerializerOptions | import("openapi-fetch").QuerySerializer<{
|
|
19
|
+
parameters: {
|
|
20
|
+
query?: never;
|
|
21
|
+
header?: never;
|
|
22
|
+
path?: never;
|
|
23
|
+
cookie?: never;
|
|
24
|
+
};
|
|
25
|
+
requestBody?: never;
|
|
26
|
+
responses: {
|
|
27
|
+
200: {
|
|
28
|
+
headers: {
|
|
29
|
+
[name: string]: unknown;
|
|
30
|
+
};
|
|
31
|
+
content: {
|
|
32
|
+
"application/json": {
|
|
33
|
+
jsonrpc: string;
|
|
34
|
+
id: number;
|
|
35
|
+
result: {
|
|
36
|
+
tools: [];
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
400: {
|
|
42
|
+
headers: {
|
|
43
|
+
[name: string]: unknown;
|
|
44
|
+
};
|
|
45
|
+
content: {
|
|
46
|
+
"application/problem+json": import("./schema.js").components["schemas"]["Problem"];
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
401: {
|
|
50
|
+
headers: {
|
|
51
|
+
[name: string]: unknown;
|
|
52
|
+
};
|
|
53
|
+
content: {
|
|
54
|
+
"application/problem+json": import("./schema.js").components["schemas"]["Problem"];
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
403: {
|
|
58
|
+
headers: {
|
|
59
|
+
[name: string]: unknown;
|
|
60
|
+
};
|
|
61
|
+
content: {
|
|
62
|
+
"application/problem+json": import("./schema.js").components["schemas"]["Problem"];
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
}>;
|
|
67
|
+
bodySerializer?: import("openapi-fetch").BodySerializer<{
|
|
68
|
+
parameters: {
|
|
69
|
+
query?: never;
|
|
70
|
+
header?: never;
|
|
71
|
+
path?: never;
|
|
72
|
+
cookie?: never;
|
|
73
|
+
};
|
|
74
|
+
requestBody?: never;
|
|
75
|
+
responses: {
|
|
76
|
+
200: {
|
|
77
|
+
headers: {
|
|
78
|
+
[name: string]: unknown;
|
|
79
|
+
};
|
|
80
|
+
content: {
|
|
81
|
+
"application/json": {
|
|
82
|
+
jsonrpc: string;
|
|
83
|
+
id: number;
|
|
84
|
+
result: {
|
|
85
|
+
tools: [];
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
400: {
|
|
91
|
+
headers: {
|
|
92
|
+
[name: string]: unknown;
|
|
93
|
+
};
|
|
94
|
+
content: {
|
|
95
|
+
"application/problem+json": import("./schema.js").components["schemas"]["Problem"];
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
401: {
|
|
99
|
+
headers: {
|
|
100
|
+
[name: string]: unknown;
|
|
101
|
+
};
|
|
102
|
+
content: {
|
|
103
|
+
"application/problem+json": import("./schema.js").components["schemas"]["Problem"];
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
403: {
|
|
107
|
+
headers: {
|
|
108
|
+
[name: string]: unknown;
|
|
109
|
+
};
|
|
110
|
+
content: {
|
|
111
|
+
"application/problem+json": import("./schema.js").components["schemas"]["Problem"];
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
}>;
|
|
116
|
+
pathSerializer?: import("openapi-fetch").PathSerializer;
|
|
117
|
+
parseAs?: import("openapi-fetch").ParseAs;
|
|
118
|
+
fetch?: import("openapi-fetch").ClientOptions["fetch"];
|
|
119
|
+
headers?: import("openapi-fetch").HeadersOptions;
|
|
120
|
+
middleware?: import("openapi-fetch").Middleware[];
|
|
121
|
+
} & Omit<RequestInit, "body" | "headers"> & {
|
|
122
|
+
[key: string]: unknown;
|
|
123
|
+
}) | undefined) => Promise<import("openapi-fetch").FetchResponse<{
|
|
124
|
+
parameters: {
|
|
125
|
+
query?: never;
|
|
126
|
+
header?: never;
|
|
127
|
+
path?: never;
|
|
128
|
+
cookie?: never;
|
|
129
|
+
};
|
|
130
|
+
requestBody?: never;
|
|
131
|
+
responses: {
|
|
132
|
+
200: {
|
|
133
|
+
headers: {
|
|
134
|
+
[name: string]: unknown;
|
|
135
|
+
};
|
|
136
|
+
content: {
|
|
137
|
+
"application/json": {
|
|
138
|
+
jsonrpc: string;
|
|
139
|
+
id: number;
|
|
140
|
+
result: {
|
|
141
|
+
tools: [];
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
400: {
|
|
147
|
+
headers: {
|
|
148
|
+
[name: string]: unknown;
|
|
149
|
+
};
|
|
150
|
+
content: {
|
|
151
|
+
"application/problem+json": import("./schema.js").components["schemas"]["Problem"];
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
401: {
|
|
155
|
+
headers: {
|
|
156
|
+
[name: string]: unknown;
|
|
157
|
+
};
|
|
158
|
+
content: {
|
|
159
|
+
"application/problem+json": import("./schema.js").components["schemas"]["Problem"];
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
403: {
|
|
163
|
+
headers: {
|
|
164
|
+
[name: string]: unknown;
|
|
165
|
+
};
|
|
166
|
+
content: {
|
|
167
|
+
"application/problem+json": import("./schema.js").components["schemas"]["Problem"];
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
}, ({
|
|
172
|
+
params?: {
|
|
173
|
+
query?: never;
|
|
174
|
+
header?: never;
|
|
175
|
+
path?: never;
|
|
176
|
+
cookie?: never;
|
|
177
|
+
};
|
|
178
|
+
} & {
|
|
179
|
+
body?: undefined;
|
|
180
|
+
} & {
|
|
181
|
+
baseUrl?: string;
|
|
182
|
+
querySerializer?: import("openapi-fetch").QuerySerializerOptions | import("openapi-fetch").QuerySerializer<{
|
|
183
|
+
parameters: {
|
|
184
|
+
query?: never;
|
|
185
|
+
header?: never;
|
|
186
|
+
path?: never;
|
|
187
|
+
cookie?: never;
|
|
188
|
+
};
|
|
189
|
+
requestBody?: never;
|
|
190
|
+
responses: {
|
|
191
|
+
200: {
|
|
192
|
+
headers: {
|
|
193
|
+
[name: string]: unknown;
|
|
194
|
+
};
|
|
195
|
+
content: {
|
|
196
|
+
"application/json": {
|
|
197
|
+
jsonrpc: string;
|
|
198
|
+
id: number;
|
|
199
|
+
result: {
|
|
200
|
+
tools: [];
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
400: {
|
|
206
|
+
headers: {
|
|
207
|
+
[name: string]: unknown;
|
|
208
|
+
};
|
|
209
|
+
content: {
|
|
210
|
+
"application/problem+json": import("./schema.js").components["schemas"]["Problem"];
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
401: {
|
|
214
|
+
headers: {
|
|
215
|
+
[name: string]: unknown;
|
|
216
|
+
};
|
|
217
|
+
content: {
|
|
218
|
+
"application/problem+json": import("./schema.js").components["schemas"]["Problem"];
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
403: {
|
|
222
|
+
headers: {
|
|
223
|
+
[name: string]: unknown;
|
|
224
|
+
};
|
|
225
|
+
content: {
|
|
226
|
+
"application/problem+json": import("./schema.js").components["schemas"]["Problem"];
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
}>;
|
|
231
|
+
bodySerializer?: import("openapi-fetch").BodySerializer<{
|
|
232
|
+
parameters: {
|
|
233
|
+
query?: never;
|
|
234
|
+
header?: never;
|
|
235
|
+
path?: never;
|
|
236
|
+
cookie?: never;
|
|
237
|
+
};
|
|
238
|
+
requestBody?: never;
|
|
239
|
+
responses: {
|
|
240
|
+
200: {
|
|
241
|
+
headers: {
|
|
242
|
+
[name: string]: unknown;
|
|
243
|
+
};
|
|
244
|
+
content: {
|
|
245
|
+
"application/json": {
|
|
246
|
+
jsonrpc: string;
|
|
247
|
+
id: number;
|
|
248
|
+
result: {
|
|
249
|
+
tools: [];
|
|
250
|
+
};
|
|
251
|
+
};
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
400: {
|
|
255
|
+
headers: {
|
|
256
|
+
[name: string]: unknown;
|
|
257
|
+
};
|
|
258
|
+
content: {
|
|
259
|
+
"application/problem+json": import("./schema.js").components["schemas"]["Problem"];
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
401: {
|
|
263
|
+
headers: {
|
|
264
|
+
[name: string]: unknown;
|
|
265
|
+
};
|
|
266
|
+
content: {
|
|
267
|
+
"application/problem+json": import("./schema.js").components["schemas"]["Problem"];
|
|
268
|
+
};
|
|
269
|
+
};
|
|
270
|
+
403: {
|
|
271
|
+
headers: {
|
|
272
|
+
[name: string]: unknown;
|
|
273
|
+
};
|
|
274
|
+
content: {
|
|
275
|
+
"application/problem+json": import("./schema.js").components["schemas"]["Problem"];
|
|
276
|
+
};
|
|
277
|
+
};
|
|
278
|
+
};
|
|
279
|
+
}>;
|
|
280
|
+
pathSerializer?: import("openapi-fetch").PathSerializer;
|
|
281
|
+
parseAs?: import("openapi-fetch").ParseAs;
|
|
282
|
+
fetch?: import("openapi-fetch").ClientOptions["fetch"];
|
|
283
|
+
headers?: import("openapi-fetch").HeadersOptions;
|
|
284
|
+
middleware?: import("openapi-fetch").Middleware[];
|
|
285
|
+
} & Omit<RequestInit, "body" | "headers"> & {
|
|
286
|
+
[key: string]: unknown;
|
|
287
|
+
}) | undefined, `${string}/${string}`>>;
|
|
288
|
+
/** GET /.well-known/oauth-protected-resource/mcp: Protected resource metadata of /mcp */
|
|
289
|
+
protectedResource: (init_0?: ({
|
|
290
|
+
params?: {
|
|
291
|
+
query?: never;
|
|
292
|
+
header?: never;
|
|
293
|
+
path?: never;
|
|
294
|
+
cookie?: never;
|
|
295
|
+
};
|
|
296
|
+
} & {
|
|
297
|
+
body?: undefined;
|
|
298
|
+
} & {
|
|
299
|
+
baseUrl?: string;
|
|
300
|
+
querySerializer?: import("openapi-fetch").QuerySerializerOptions | import("openapi-fetch").QuerySerializer<{
|
|
301
|
+
parameters: {
|
|
302
|
+
query?: never;
|
|
303
|
+
header?: never;
|
|
304
|
+
path?: never;
|
|
305
|
+
cookie?: never;
|
|
306
|
+
};
|
|
307
|
+
requestBody?: never;
|
|
308
|
+
responses: {
|
|
309
|
+
200: {
|
|
310
|
+
headers: {
|
|
311
|
+
[name: string]: unknown;
|
|
312
|
+
};
|
|
313
|
+
content: {
|
|
314
|
+
"application/json": {
|
|
315
|
+
resource: string;
|
|
316
|
+
authorization_servers: string[];
|
|
317
|
+
scopes_supported: string[];
|
|
318
|
+
bearer_methods_supported: string[];
|
|
319
|
+
dpop_signing_alg_values_supported: string[];
|
|
320
|
+
resource_name: string;
|
|
321
|
+
};
|
|
322
|
+
};
|
|
323
|
+
};
|
|
324
|
+
};
|
|
325
|
+
}>;
|
|
326
|
+
bodySerializer?: import("openapi-fetch").BodySerializer<{
|
|
327
|
+
parameters: {
|
|
328
|
+
query?: never;
|
|
329
|
+
header?: never;
|
|
330
|
+
path?: never;
|
|
331
|
+
cookie?: never;
|
|
332
|
+
};
|
|
333
|
+
requestBody?: never;
|
|
334
|
+
responses: {
|
|
335
|
+
200: {
|
|
336
|
+
headers: {
|
|
337
|
+
[name: string]: unknown;
|
|
338
|
+
};
|
|
339
|
+
content: {
|
|
340
|
+
"application/json": {
|
|
341
|
+
resource: string;
|
|
342
|
+
authorization_servers: string[];
|
|
343
|
+
scopes_supported: string[];
|
|
344
|
+
bearer_methods_supported: string[];
|
|
345
|
+
dpop_signing_alg_values_supported: string[];
|
|
346
|
+
resource_name: string;
|
|
347
|
+
};
|
|
348
|
+
};
|
|
349
|
+
};
|
|
350
|
+
};
|
|
351
|
+
}>;
|
|
352
|
+
pathSerializer?: import("openapi-fetch").PathSerializer;
|
|
353
|
+
parseAs?: import("openapi-fetch").ParseAs;
|
|
354
|
+
fetch?: import("openapi-fetch").ClientOptions["fetch"];
|
|
355
|
+
headers?: import("openapi-fetch").HeadersOptions;
|
|
356
|
+
middleware?: import("openapi-fetch").Middleware[];
|
|
357
|
+
} & Omit<RequestInit, "body" | "headers"> & {
|
|
358
|
+
[key: string]: unknown;
|
|
359
|
+
}) | undefined) => Promise<import("openapi-fetch").FetchResponse<{
|
|
360
|
+
parameters: {
|
|
361
|
+
query?: never;
|
|
362
|
+
header?: never;
|
|
363
|
+
path?: never;
|
|
364
|
+
cookie?: never;
|
|
365
|
+
};
|
|
366
|
+
requestBody?: never;
|
|
367
|
+
responses: {
|
|
368
|
+
200: {
|
|
369
|
+
headers: {
|
|
370
|
+
[name: string]: unknown;
|
|
371
|
+
};
|
|
372
|
+
content: {
|
|
373
|
+
"application/json": {
|
|
374
|
+
resource: string;
|
|
375
|
+
authorization_servers: string[];
|
|
376
|
+
scopes_supported: string[];
|
|
377
|
+
bearer_methods_supported: string[];
|
|
378
|
+
dpop_signing_alg_values_supported: string[];
|
|
379
|
+
resource_name: string;
|
|
380
|
+
};
|
|
381
|
+
};
|
|
382
|
+
};
|
|
383
|
+
};
|
|
384
|
+
}, ({
|
|
385
|
+
params?: {
|
|
386
|
+
query?: never;
|
|
387
|
+
header?: never;
|
|
388
|
+
path?: never;
|
|
389
|
+
cookie?: never;
|
|
390
|
+
};
|
|
391
|
+
} & {
|
|
392
|
+
body?: undefined;
|
|
393
|
+
} & {
|
|
394
|
+
baseUrl?: string;
|
|
395
|
+
querySerializer?: import("openapi-fetch").QuerySerializerOptions | import("openapi-fetch").QuerySerializer<{
|
|
396
|
+
parameters: {
|
|
397
|
+
query?: never;
|
|
398
|
+
header?: never;
|
|
399
|
+
path?: never;
|
|
400
|
+
cookie?: never;
|
|
401
|
+
};
|
|
402
|
+
requestBody?: never;
|
|
403
|
+
responses: {
|
|
404
|
+
200: {
|
|
405
|
+
headers: {
|
|
406
|
+
[name: string]: unknown;
|
|
407
|
+
};
|
|
408
|
+
content: {
|
|
409
|
+
"application/json": {
|
|
410
|
+
resource: string;
|
|
411
|
+
authorization_servers: string[];
|
|
412
|
+
scopes_supported: string[];
|
|
413
|
+
bearer_methods_supported: string[];
|
|
414
|
+
dpop_signing_alg_values_supported: string[];
|
|
415
|
+
resource_name: string;
|
|
416
|
+
};
|
|
417
|
+
};
|
|
418
|
+
};
|
|
419
|
+
};
|
|
420
|
+
}>;
|
|
421
|
+
bodySerializer?: import("openapi-fetch").BodySerializer<{
|
|
422
|
+
parameters: {
|
|
423
|
+
query?: never;
|
|
424
|
+
header?: never;
|
|
425
|
+
path?: never;
|
|
426
|
+
cookie?: never;
|
|
427
|
+
};
|
|
428
|
+
requestBody?: never;
|
|
429
|
+
responses: {
|
|
430
|
+
200: {
|
|
431
|
+
headers: {
|
|
432
|
+
[name: string]: unknown;
|
|
433
|
+
};
|
|
434
|
+
content: {
|
|
435
|
+
"application/json": {
|
|
436
|
+
resource: string;
|
|
437
|
+
authorization_servers: string[];
|
|
438
|
+
scopes_supported: string[];
|
|
439
|
+
bearer_methods_supported: string[];
|
|
440
|
+
dpop_signing_alg_values_supported: string[];
|
|
441
|
+
resource_name: string;
|
|
442
|
+
};
|
|
443
|
+
};
|
|
444
|
+
};
|
|
445
|
+
};
|
|
446
|
+
}>;
|
|
447
|
+
pathSerializer?: import("openapi-fetch").PathSerializer;
|
|
448
|
+
parseAs?: import("openapi-fetch").ParseAs;
|
|
449
|
+
fetch?: import("openapi-fetch").ClientOptions["fetch"];
|
|
450
|
+
headers?: import("openapi-fetch").HeadersOptions;
|
|
451
|
+
middleware?: import("openapi-fetch").Middleware[];
|
|
452
|
+
} & Omit<RequestInit, "body" | "headers"> & {
|
|
453
|
+
[key: string]: unknown;
|
|
454
|
+
}) | undefined, `${string}/${string}`>>;
|
|
455
|
+
};
|
|
456
|
+
export type McpApi = ReturnType<typeof mcp>;
|
package/dist/mcp.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** The `mcp` plugin's routes as methods of `client.mcp`. */
|
|
2
|
+
export function mcp(client) {
|
|
3
|
+
return {
|
|
4
|
+
/** POST /mcp: Serve an MCP message */
|
|
5
|
+
mcp: (...init) => client.POST("/mcp", ...init),
|
|
6
|
+
/** GET /.well-known/oauth-protected-resource/mcp: Protected resource metadata of /mcp */
|
|
7
|
+
protectedResource: (...init) => client.GET("/.well-known/oauth-protected-resource/mcp", ...init),
|
|
8
|
+
};
|
|
9
|
+
}
|