@usemcpkit/core 0.13.2 → 0.13.4

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;
@@ -209,7 +216,7 @@ export declare interface Manifest {
209
216
  category: string;
210
217
  version: string;
211
218
  description?: string;
212
- /** May contain `{domain}`, as may the oauth URLs; `domain` then says where the value comes from. An `upstream` manifest never requests it, so it only names the service's https home. */
219
+ /** May contain `{domain}`, as may the oauth URLs (`discovery` included) and an HTTP upstream's `url`; `domain` then says where the value comes from. An `upstream` manifest never requests it, so it only names the service's https home. */
213
220
  baseUrl: string;
214
221
  domain?: DomainSpec;
215
222
  /** Deployments picked by the domain's host; a domain matching none uses the tools' own requests. */
@@ -250,7 +257,7 @@ export declare type OAuthAuth = OAuthEndpointsAuth | OAuthDiscoveryAuth;
250
257
  */
251
258
  export declare interface OAuthDiscoveryAuth extends OAuthSignInOptions {
252
259
  type: "oauth";
253
- /** The MCP server url, https only. */
260
+ /** The MCP server url, https only; may contain `{domain}`. */
254
261
  discovery: string;
255
262
  clientId?: string;
256
263
  }
@@ -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,11 @@ 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" || "discovery" in auth) return auth;
99
+ if (auth.type !== "oauth") return auth;
100
+ if ("discovery" in auth) return {
101
+ ...auth,
102
+ discovery: fillDomainUrl(auth.discovery, domain, loopbackHttp)
103
+ };
94
104
  return {
95
105
  ...auth,
96
106
  authorizationUrl: fillDomainUrl(auth.authorizationUrl, domain, loopbackHttp),
@@ -319,4 +329,4 @@ var oneOf = (values, description, options = {}) => string(description, {
319
329
  ...options
320
330
  });
321
331
  //#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 };
332
+ 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.2",
3
+ "version": "0.13.4",
4
4
  "description": "The usemcpkit manifest format: types, the server SDK and the credentials form contract.",
5
5
  "repository": {
6
6
  "type": "git",