@usemcpkit/core 0.13.1 → 0.13.3

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.
@@ -151,6 +151,13 @@ export declare const FORM_WINDOW_BINDINGS: {
151
151
  readonly openLink: "usemcpkitOpenLink";
152
152
  };
153
153
 
154
+ /**
155
+ * The global the CLI's window app defines before the page runs, `{ api, session, request }`: the origin of the form
156
+ * server's API, its session token and the request, which a page served by that server finds in the URL fragment and
157
+ * the request element instead.
158
+ */
159
+ export declare const FORM_WINDOW_CONTEXT = "usemcpkitWindow";
160
+
154
161
  declare interface HeaderAuth {
155
162
  type: "header";
156
163
  env: string;
@@ -241,12 +248,29 @@ declare interface NoneAuth {
241
248
 
242
249
  export declare const number: (description?: string, options?: ParamOptions) => Param;
243
250
 
251
+ export declare type OAuthAuth = OAuthEndpointsAuth | OAuthDiscoveryAuth;
252
+
253
+ /**
254
+ * The same flow for an MCP server that publishes its own sign-in: the endpoints come from its OAuth metadata (RFC 9728
255
+ * and RFC 8414) and usemcpkit registers itself as a client (RFC 7591), so one click signs in with no app, client id
256
+ * or token typed anywhere. A `clientId` skips the registration.
257
+ */
258
+ export declare interface OAuthDiscoveryAuth extends OAuthSignInOptions {
259
+ type: "oauth";
260
+ /** The MCP server url, https only. */
261
+ discovery: string;
262
+ clientId?: string;
263
+ }
264
+
244
265
  /** OAuth 2.0 authorization code flow with PKCE; the browser sign-in starts on the first tool call without a stored token. */
245
- export declare interface OAuthAuth {
266
+ export declare interface OAuthEndpointsAuth extends OAuthSignInOptions {
246
267
  type: "oauth";
247
268
  authorizationUrl: string;
248
269
  tokenUrl: string;
249
270
  clientId: string;
271
+ }
272
+
273
+ declare interface OAuthSignInOptions {
250
274
  clientSecretEnv?: string;
251
275
  scopes?: readonly string[];
252
276
  /** Loopback port for the redirect URI; 0 picks a free port. */
@@ -15,6 +15,12 @@ var FORM_WINDOW_BINDINGS = {
15
15
  fit: "usemcpkitFitWindow",
16
16
  openLink: "usemcpkitOpenLink"
17
17
  };
18
+ /**
19
+ * The global the CLI's window app defines before the page runs, `{ api, session, request }`: the origin of the form
20
+ * server's API, its session token and the request, which a page served by that server finds in the URL fragment and
21
+ * the request element instead.
22
+ */
23
+ var FORM_WINDOW_CONTEXT = "usemcpkitWindow";
18
24
  var CREDENTIALS_FORM_SESSION_HEADER = "X-Usemcpkit-Session";
19
25
  var WEB_HOST_API_PREFIX = "api.";
20
26
  //#endregion
@@ -90,7 +96,7 @@ var fillDomainUrl = (template, domain, loopbackHttp) => {
90
96
  //#endregion
91
97
  //#region src/manifest/domain/apply-auth-domain.ts
92
98
  var applyAuthDomain = (auth, domain, loopbackHttp) => {
93
- if (auth.type !== "oauth") return auth;
99
+ if (auth.type !== "oauth" || "discovery" in auth) return auth;
94
100
  return {
95
101
  ...auth,
96
102
  authorizationUrl: fillDomainUrl(auth.authorizationUrl, domain, loopbackHttp),
@@ -319,4 +325,4 @@ var oneOf = (values, description, options = {}) => string(description, {
319
325
  ...options
320
326
  });
321
327
  //#endregion
322
- export { CREDENTIALS_FORM_API, CREDENTIALS_FORM_SESSION_HEADER, CREDENTIALS_REQUEST_ELEMENT_ID, DEFAULT_UI_TEXTS, FORM_WINDOW_BINDINGS, SERVER_NAME_PATTERN, TOOL_NAME_PATTERN, applyDomain, array, boolean, defineServer, defineTool, defineUI, describeAuth, describeAuthSpec, describeError, fillTemplate, input, isDomainValue, isInteractiveAuth, isJsonObject, listAuthEnvNames, nameUpstreamTool, number, oneOf, optional, resolveLinkUrl, string, toNameMapping };
328
+ export { CREDENTIALS_FORM_API, CREDENTIALS_FORM_SESSION_HEADER, CREDENTIALS_REQUEST_ELEMENT_ID, DEFAULT_UI_TEXTS, FORM_WINDOW_BINDINGS, FORM_WINDOW_CONTEXT, SERVER_NAME_PATTERN, TOOL_NAME_PATTERN, applyDomain, array, boolean, defineServer, defineTool, defineUI, describeAuth, describeAuthSpec, describeError, fillTemplate, input, isDomainValue, isInteractiveAuth, isJsonObject, listAuthEnvNames, nameUpstreamTool, number, oneOf, optional, resolveLinkUrl, string, toNameMapping };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usemcpkit/core",
3
- "version": "0.13.1",
3
+ "version": "0.13.3",
4
4
  "description": "The usemcpkit manifest format: types, the server SDK and the credentials form contract.",
5
5
  "repository": {
6
6
  "type": "git",