@every-app/sdk 0.3.0-rc.12 → 0.3.0-rc.13

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.
@@ -94,7 +94,7 @@ export declare const BUILT_IN_OAUTH_SPECS: {
94
94
  readonly id: "team_id";
95
95
  };
96
96
  };
97
- readonly hint: "A Slack app with the Gateway's callback as its redirect URL and the bot scopes your apps list.";
97
+ readonly hint: "A Slack app with the Gateway's callback as its redirect URL and the bot scopes your apps list. The Gateway takes its Client ID and Client Secret, not a bot token (xoxb-).";
98
98
  };
99
99
  };
100
100
  export type BuiltInOAuthId = keyof typeof BUILT_IN_OAUTH_SPECS;
@@ -117,6 +117,6 @@ export const BUILT_IN_OAUTH_SPECS = {
117
117
  id: "team_id",
118
118
  },
119
119
  },
120
- hint: "A Slack app with the Gateway's callback as its redirect URL and the bot scopes your apps list.",
120
+ hint: "A Slack app with the Gateway's callback as its redirect URL and the bot scopes your apps list. The Gateway takes its Client ID and Client Secret, not a bot token (xoxb-).",
121
121
  },
122
122
  };
@@ -22,7 +22,7 @@ export interface SpecProblem {
22
22
  message: string;
23
23
  }
24
24
  /** The fields of `auth` when its kind is `oauth2-user`. */
25
- export declare const OAUTH_AUTH_FIELDS: readonly ["kind", "authorizeUrl", "tokenUrl", "revokeUrl", "revokeMethod", "clientId", "clientSecret", "inject", "pkce", "scopeSeparator", "scopePrefix", "authorizeParams", "tokenHeaders", "identity", "tolerated"];
25
+ export declare const OAUTH_AUTH_FIELDS: readonly ["kind", "authorizeUrl", "tokenUrl", "revokeUrl", "revokeMethod", "clientId", "clientSecret", "inject", "pkce", "scopeSeparator", "scopePrefix", "authorizeParams", "tokenHeaders", "identity", "tolerated", "resource", "issuer"];
26
26
  /**
27
27
  * Fields an `oauth2-user` spec had before scopes moved to each app's
28
28
  * `everyapp.config.ts`, each with what to write instead: refused with
@@ -1 +1 @@
1
- {"version":3,"file":"oauthSpec.d.ts","sourceRoot":"","sources":["../../src/internal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@@ export const OAUTH_AUTH_FIELDS = [
47
47
  "tokenHeaders",
48
48
  "identity",
49
49
  "tolerated",
50
+ "resource",
51
+ "issuer",
50
52
  ];
51
53
  /**
52
54
  * Fields an `oauth2-user` spec had before scopes moved to each app's
@@ -110,7 +112,9 @@ function endpoint(value, path, problems, { query }) {
110
112
  parsed.hash) {
111
113
  problems.push({
112
114
  path,
113
- message: "must be an https URL with no port, credentials or fragment",
115
+ message: parsed.port
116
+ ? `must be an https URL on the default port (${parsed.port} is not: the Gateway's OAuth requests go to port 443 only), with no credentials or fragment`
117
+ : "must be an https URL with no port, credentials or fragment",
114
118
  });
115
119
  return undefined;
116
120
  }
@@ -120,6 +124,42 @@ function endpoint(value, path, problems, { query }) {
120
124
  }
121
125
  return { url, host: parsed.hostname.toLowerCase() };
122
126
  }
127
+ /**
128
+ * An https URL that names something rather than being fetched (an RFC
129
+ * 8707 resource, an RFC 8414 issuer): a port is allowed, credentials and a
130
+ * fragment are not, and an issuer takes no query either.
131
+ */
132
+ function identifierUrl(value, path, problems, { query }) {
133
+ if (value === undefined)
134
+ return undefined;
135
+ const url = printable(value, path, problems, 2048);
136
+ if (url === undefined)
137
+ return undefined;
138
+ let parsed;
139
+ try {
140
+ parsed = new URL(url);
141
+ }
142
+ catch {
143
+ problems.push({ path, message: "must be an https URL" });
144
+ return undefined;
145
+ }
146
+ if (parsed.protocol !== "https:" ||
147
+ parsed.username ||
148
+ parsed.password ||
149
+ parsed.hash ||
150
+ url.includes("#")) {
151
+ problems.push({
152
+ path,
153
+ message: "must be an https URL with no credentials or fragment",
154
+ });
155
+ return undefined;
156
+ }
157
+ if (!query && parsed.search) {
158
+ problems.push({ path, message: "may not carry a query string" });
159
+ return undefined;
160
+ }
161
+ return url;
162
+ }
123
163
  function settingName(value, path, problems) {
124
164
  if (typeof value !== "string" || !/^[A-Z][A-Z0-9_]{2,63}$/.test(value)) {
125
165
  problems.push({
@@ -345,6 +385,12 @@ export function parseOAuthUserSpec(input, common, problems) {
345
385
  });
346
386
  const parsedIdentity = identity(auth["identity"], common.hosts, problems);
347
387
  const tolerated = scopeList(auth["tolerated"], "auth.tolerated", problems);
388
+ const resource = identifierUrl(auth["resource"], "auth.resource", problems, {
389
+ query: true,
390
+ });
391
+ const issuer = identifierUrl(auth["issuer"], "auth.issuer", problems, {
392
+ query: false,
393
+ });
348
394
  if (!authorize ||
349
395
  !token ||
350
396
  clientId === undefined ||
@@ -371,6 +417,8 @@ export function parseOAuthUserSpec(input, common, problems) {
371
417
  : { identity: parsedIdentity.identity }),
372
418
  identityScopes: parsedIdentity?.scopes ?? [],
373
419
  tolerated: tolerated ?? [],
420
+ ...(resource === undefined ? {} : { resource }),
421
+ ...(issuer === undefined ? {} : { issuer }),
374
422
  };
375
423
  const capability = oauthCapabilityOf(common, {
376
424
  clientId,
@@ -510,6 +558,8 @@ export function oauthSpecOf(id, capability) {
510
558
  ...(flow.tolerated.length === 0
511
559
  ? {}
512
560
  : { tolerated: [...flow.tolerated] }),
561
+ ...(flow.resource === undefined ? {} : { resource: flow.resource }),
562
+ ...(flow.issuer === undefined ? {} : { issuer: flow.issuer }),
513
563
  },
514
564
  ...(capability.hint === undefined ? {} : { hint: capability.hint }),
515
565
  ...(capability.example === undefined
@@ -45,9 +45,10 @@ export interface ProviderRow {
45
45
  * replacing a row's hosts or auth changes the key and the value it held
46
46
  * is no longer read until the operator sets it again. For an OAuth
47
47
  * provider the client is bound to its authorize, token and revoke URLs,
48
- * its API hosts, where the client goes on the token request and its
49
- * client setting names (`oauth.client-bound-to-endpoints`): an admin who
50
- * re-points `tokenUrl` has to paste the secret again.
48
+ * its API hosts, where the client goes on the token request, its client
49
+ * setting names, and its `resource` and `issuer` when it has them
50
+ * (`oauth.client-bound-to-endpoints`): an admin who re-points `tokenUrl`
51
+ * has to paste the secret again.
51
52
  */
52
53
  export declare function providerBindingKey(capability: RegistrableCapability): string;
53
54
  /** One registered row as `provider list` and `provider show` report it. */
@@ -1 +1 @@
1
- {"version":3,"file":"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IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CAC9C,GACA,UAAU,GAAG,IAAI,CAuBnB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,qBAAqB,GAAG,MAAM,EAAE,CAqB5E;AAED,uEAAuE;AACvE,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,WAAW,EAChB,OAAO,EAAE;IACP,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACjC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CAC9C,GAEC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,UAAU,EAAE,qBAAqB,CAAA;CAAE,GAC/C;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,UAAU,CAAA;CAAE,CAyCrC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,GAAE,SAAS,WAAW,EAAO,EACjC,OAAO,GAAE,uBAA4B,GACpC,gBAAgB,CAqElB;AAED,2FAA2F;AAC3F,eAAO,MAAM,iBAAiB,EAAE,gBAAqC,CAAC"}
@@ -30,9 +30,10 @@ import { describeSpecProblems, parseProviderSpec, PROVIDER_ID, } from "./provide
30
30
  * replacing a row's hosts or auth changes the key and the value it held
31
31
  * is no longer read until the operator sets it again. For an OAuth
32
32
  * provider the client is bound to its authorize, token and revoke URLs,
33
- * its API hosts, where the client goes on the token request and its
34
- * client setting names (`oauth.client-bound-to-endpoints`): an admin who
35
- * re-points `tokenUrl` has to paste the secret again.
33
+ * its API hosts, where the client goes on the token request, its client
34
+ * setting names, and its `resource` and `issuer` when it has them
35
+ * (`oauth.client-bound-to-endpoints`): an admin who re-points `tokenUrl`
36
+ * has to paste the secret again.
36
37
  */
37
38
  export function providerBindingKey(capability) {
38
39
  if (capability.mode === "ai") {
@@ -54,6 +55,13 @@ export function providerBindingKey(capability) {
54
55
  clientId: capability.secrets.clientId,
55
56
  clientSecret: capability.secrets.clientSecret ?? null,
56
57
  hosts: [...capability.api].sort(),
58
+ // Only when present, so a row without them keeps the key it was bound to.
59
+ ...(capability.flow?.resource === undefined
60
+ ? {}
61
+ : { resource: capability.flow.resource }),
62
+ ...(capability.flow?.issuer === undefined
63
+ ? {}
64
+ : { issuer: capability.flow.issuer }),
57
65
  });
58
66
  }
59
67
  return JSON.stringify({
@@ -1,34 +1,65 @@
1
+ /**
2
+ * Remote MCP apps: any remote MCP server registered on a gateway by URL
3
+ * (`everyapp mcp add <url>`, Admin → Apps → Add app → "Add an MCP server",
4
+ * `everyapp_mcp_add`), served to members' AI clients as an MCP app of the
5
+ * Gateway's own, like a built-in provider app (./providerApps.ts) but with
6
+ * its tools read from the server and each call forwarded to it
7
+ * (docs/design/2026-10-mcp-by-url.md, docs/design/2026-11-mcp-apps-auth.md).
8
+ *
9
+ * The registration record is the app row's manifest: `id`, `name`,
10
+ * `description` and a `remote` block ({@link RemoteMcpBlock}): the one URL
11
+ * the Gateway ever fetches, its credential ({@link RemoteMcpAuth}: none, or
12
+ * a provider of the registry, whose key or OAuth connection the Gateway
13
+ * holds and binds to the provider's hosts), how a tool's risk is decided
14
+ * when the server's annotations don't say, the operator's per-tool
15
+ * overrides, and a revision the writers bump so the Gateway re-lists the
16
+ * tools on first use after a change. An app with a provider also lists it
17
+ * under `capabilities` ({@link remoteMcpAppManifest}), so the settings
18
+ * model treats its key or client as any app's.
19
+ *
20
+ * A credential the registrar gives at `mcp add` becomes a provider row of
21
+ * the app's own, `<appId>-mcp` ({@link remoteMcpProviderId}; the specs are
22
+ * built in ./mcpOAuth.ts): an API-key row for a static value
23
+ * (`<APPID>_MCP_TOKEN`), a discovered `oauth2-user` row for OAuth
24
+ * (`<APPID>_MCP_CLIENT_ID`, `_SECRET`).
25
+ *
26
+ * Everything here is pure and shared by the CLI, the perimeter's registry
27
+ * rules, the Gateway (which serves the row and validates again at every
28
+ * fetch) and the settings model (./appSettings.ts), so the rules cannot
29
+ * drift: what the URL may be, what the credential may be, how a server's
30
+ * tool names become the ToolBus's, and what risk a tool gets.
31
+ */
32
+ import { type Capability, type CapabilitySettings } from "./capabilities.js";
1
33
  import { type ToolRisk } from "./tools.js";
2
- export declare const REMOTE_MCP_AUTH_KINDS: readonly ["none", "bearer", "header", "basic", "oauth"];
34
+ /** The kinds a stored `remote.auth` block may have. */
35
+ export declare const REMOTE_MCP_AUTH_KINDS: readonly ["none", "provider"];
3
36
  export type RemoteMcpAuthKind = (typeof REMOTE_MCP_AUTH_KINDS)[number];
4
37
  /**
5
- * How the Gateway authenticates to the server. `secret` is the name of
6
- * the Gateway setting holding the value ({@link remoteMcpSecretName}),
7
- * never the value. `oauth` is recorded so the app can say what the server
8
- * wants; it is not served (the design's section 10).
38
+ * How the Gateway authenticates to the server: nothing, or a provider of
39
+ * the registry (a catalog entry such as `elevenlabs`, a registered row, or
40
+ * the row `everyapp mcp add` synthesizes for the app,
41
+ * {@link remoteMcpProviderId}). The credential lives with the provider and
42
+ * is bound to its hosts (`providers.value-bound-to-hosts`); the block only
43
+ * names it. With an OAuth provider each member connects their own
44
+ * account in the app.
9
45
  */
10
46
  export type RemoteMcpAuth = {
11
47
  kind: "none";
12
- }
13
- /** `Authorization: Bearer <value>`. */
14
- | {
15
- kind: "bearer";
16
- secret: string;
17
- }
18
- /** `<header>: <prefix><value>`. */
19
- | {
20
- kind: "header";
21
- secret: string;
22
- header: string;
23
- prefix?: string;
24
- }
25
- /** The value is `user:password`; sent as `Authorization: Basic <base64>`. */
26
- | {
27
- kind: "basic";
28
- secret: string;
29
48
  } | {
30
- kind: "oauth";
49
+ kind: "provider";
50
+ provider: string;
31
51
  };
52
+ /**
53
+ * What the registrar may ask for at `mcp add` (`--auth`): none, a static
54
+ * credential the add turns into a synthesized API-key provider row, or
55
+ * OAuth, a discovered `oauth2-user` row (./mcpOAuth.ts).
56
+ */
57
+ export declare const REMOTE_MCP_CREDENTIAL_KINDS: readonly ["none", "bearer", "header", "query", "basic", "oauth"];
58
+ export type RemoteMcpCredentialKind = (typeof REMOTE_MCP_CREDENTIAL_KINDS)[number];
59
+ /** The static credential kinds: one value, placed as the synthesized row's `auth` says. */
60
+ export type RemoteMcpStaticKind = Exclude<RemoteMcpCredentialKind, "none" | "oauth">;
61
+ /** Why an old registration (`bearer`, `header`, `basic`, `oauth` with a `secret`) no longer parses. */
62
+ export declare const REMOTE_MCP_AUTH_PREDATES = "this registration predates provider credentials; remove it and add it again";
32
63
  /**
33
64
  * How a tool's risk is decided for the app. `annotations`: from the
34
65
  * server's hints ({@link remoteToolRisk}); `read` or `write`: every tool,
@@ -57,13 +88,55 @@ export interface RemoteMcpManifest {
57
88
  name: string;
58
89
  description: string;
59
90
  remote: RemoteMcpBlock;
91
+ /** The provider the app's credential is, listed as a deployed app lists one ({@link remoteMcpAppManifest}). */
92
+ capabilities?: Record<string, RemoteMcpCapabilityEntry>;
60
93
  }
61
94
  /** The manifest fields the Gateway reads, as a stored manifest has them. */
62
95
  export interface RemoteMcpManifestLike {
63
96
  readonly remote?: unknown;
64
97
  }
65
- /** The default credential name for an app id: `treg` → `TREG_MCP_TOKEN`. */
66
- export declare function remoteMcpSecretName(id: string): string;
98
+ /**
99
+ * Why `header` can't carry a remote MCP server's static credential, or
100
+ * null when it can: an HTTP header name the MCP transport and the Gateway
101
+ * don't set themselves.
102
+ */
103
+ export declare function remoteMcpHeaderProblem(header: unknown): string | null;
104
+ /**
105
+ * The provider row `everyapp mcp add` writes for an app's own credential:
106
+ * `<appId>-mcp` (`treg` → `treg-mcp`), its settings `TREG_MCP_*`.
107
+ */
108
+ export declare function remoteMcpProviderId(appId: string): string;
109
+ /** Whether `providerId` is `appId`'s synthesized row ({@link remoteMcpProviderId}). */
110
+ export declare function isRemoteMcpProviderIdOf(providerId: string, appId: string): boolean;
111
+ /** The static credential's setting on the synthesized row: `treg` → `TREG_MCP_TOKEN`. */
112
+ export declare function remoteMcpTokenSetting(appId: string): string;
113
+ /** The OAuth client id's setting on the synthesized row: `treg` → `TREG_MCP_CLIENT_ID`. */
114
+ export declare function remoteMcpClientIdSetting(appId: string): string;
115
+ /** The OAuth client secret's setting on the synthesized row: `treg` → `TREG_MCP_CLIENT_SECRET`. */
116
+ export declare function remoteMcpClientSecretSetting(appId: string): string;
117
+ /**
118
+ * The redirect URI of an app's synthesized OAuth row, what a server's
119
+ * client is registered with: `<gateway origin>/connect/<appId>-mcp/callback`.
120
+ */
121
+ export declare function remoteMcpRedirectUri(gatewayUrl: string, appId: string): string;
122
+ /** Where the Gateway serves its OAuth client metadata documents (public, bypassed behind Access). */
123
+ export declare const REMOTE_MCP_CLIENT_METADATA_PREFIX = "/oauth-clients/";
124
+ /**
125
+ * The Gateway's client id at a server that takes OAuth client ID metadata
126
+ * documents (CIMD) instead of registration: the URL of the document that
127
+ * describes the client, `<gateway origin>/oauth-clients/<appId>-mcp`.
128
+ * Null for a Gateway that isn't on https (a local one): an authorization
129
+ * server fetches the document, and only from https.
130
+ */
131
+ export declare function remoteMcpClientMetadataUrl(gatewayUrl: string, appId: string): string | null;
132
+ /**
133
+ * The hosts a provider sends its credential to, the hosts an MCP URL
134
+ * using it must be on: an API-key provider's `hosts` (and its host
135
+ * setting's value, given `settings`), an OAuth provider's API hosts. Null
136
+ * for a provider a remote MCP app can't use: an AI provider, a service,
137
+ * or an OAuth client the Gateway runs no flow for.
138
+ */
139
+ export declare function remoteMcpProviderHosts(capability: Capability, settings?: CapabilitySettings): string[] | null;
67
140
  /** Whether `id` can be a remote MCP app's id (kebab-case, at most 32, not reserved, not a built-in's). */
68
141
  export declare function remoteMcpIdProblem(id: string): string | null;
69
142
  /**
@@ -88,14 +161,25 @@ export declare function reservedUpstreamHosts(): string[];
88
161
  * `https:` (or `http:` and loopback hosts only while the Gateway itself
89
162
  * runs on `http://`, local dev), a host name rather than an address, no
90
163
  * credentials or fragment in it, not the Gateway's own origin or one of
91
- * its app hosts, and not a provider whose key the Gateway holds. The
92
- * Gateway checks the stored URL again before every fetch, so a row edited
93
- * by hand is refused the same way.
94
- */
95
- export declare function remoteMcpUrlProblem(url: string, env: RemoteMcpUrlEnv): string | null;
96
- /** The credential name's problem, or null: in the family, and bounded. */
97
- export declare function remoteMcpSecretProblem(name: unknown): string | null;
98
- /** The auth block's problem, or the block as typed. */
164
+ * its app hosts, and not a provider whose key the Gateway holds
165
+ * ({@link reservedUpstreamHosts}) unless the app names that provider:
166
+ * `providerHosts` are the hosts of the provider the app's credential is
167
+ * (never an app's own synthesized row), and a reserved host among them is
168
+ * allowed (`mcp add https://api.elevenlabs.io/v1/mcp --provider
169
+ * elevenlabs`). The Gateway's own origin, its app domains and IPs stay
170
+ * refused always. The Gateway checks the stored URL again before every
171
+ * fetch, so a row edited by hand is refused the same way.
172
+ */
173
+ export declare function remoteMcpUrlProblem(url: string, env: RemoteMcpUrlEnv, options?: {
174
+ providerHosts?: readonly string[];
175
+ }): string | null;
176
+ /**
177
+ * The auth block's problem, or the block as typed: `{ kind: "none" }`,
178
+ * or `{ kind: "provider", provider }` naming a provider id. A
179
+ * block of the kinds before provider credentials (`bearer`, `header`,
180
+ * `basic`, `oauth`) is refused with {@link REMOTE_MCP_AUTH_PREDATES}: such
181
+ * a row serves nothing and reads as needing setup.
182
+ */
99
183
  export declare function parseRemoteMcpAuth(raw: unknown): {
100
184
  ok: true;
101
185
  auth: RemoteMcpAuth;
@@ -103,6 +187,8 @@ export declare function parseRemoteMcpAuth(raw: unknown): {
103
187
  ok: false;
104
188
  problem: string;
105
189
  };
190
+ /** The provider the block names, or null for `none`. */
191
+ export declare function remoteMcpProviderOf(auth: RemoteMcpAuth): string | null;
106
192
  /**
107
193
  * The `remote` block of a stored manifest, checked field by field (a row
108
194
  * edited by hand must not make the Gateway send a credential anywhere the
@@ -123,10 +209,14 @@ export declare function parseRemoteMcpBlock(raw: unknown): {
123
209
  * as needing setup, see app-setup).
124
210
  */
125
211
  export declare function remoteMcpOf(manifest: unknown): RemoteMcpBlock | null;
212
+ /**
213
+ * Why a stored manifest's `remote` block can't be read, or null when it
214
+ * can or there is none: {@link REMOTE_MCP_AUTH_PREDATES} for a block from
215
+ * before provider credentials.
216
+ */
217
+ export declare function remoteMcpBlockProblem(manifest: unknown): string | null;
126
218
  /** Whether a stored manifest declares a remote MCP server at all (well-formed or not). */
127
219
  export declare function hasRemoteMcpBlock(manifest: unknown): boolean;
128
- /** The credential's setting name the block declares, if its kind takes one. */
129
- export declare function remoteMcpSecretOf(auth: RemoteMcpAuth): string | null;
130
220
  /**
131
221
  * A description for a row that gave none: the server's origin, read as a
132
222
  * sentence. The origin only: a path or query may carry something the
@@ -143,12 +233,37 @@ export declare function remoteMcpDefaultDescription(name: string, url: string):
143
233
  export declare function remoteToolOverride(block: Pick<RemoteMcpBlock, "tools">, upstreamName: string): RemoteMcpToolOverride | undefined;
144
234
  /** Whether a server's tool name can travel in an HTTP header (`Mcp-Name`): visible ASCII, bounded. */
145
235
  export declare function isHeaderSafeToolName(name: string): boolean;
146
- /** The manifest a remote MCP app's row stores, from what the registrar gave. */
236
+ /**
237
+ * The entry a remote MCP app's manifest lists its provider under
238
+ * (`capabilities`), as a deployed app lists one: `{ access, why }` for an
239
+ * API-key provider, `{ scopes, why }` for an OAuth one.
240
+ */
241
+ export type RemoteMcpCapabilityEntry = {
242
+ access: "read";
243
+ why: string;
244
+ } | {
245
+ scopes: string[];
246
+ why: string;
247
+ };
248
+ /**
249
+ * The manifest a remote MCP app's row stores, from what the registrar
250
+ * gave. An app with a provider credential lists the provider under
251
+ * `capabilities` like a deployed app that uses it, so the settings model
252
+ * (./appSettings.ts) asks for its key or client, `secret list` names it
253
+ * and the connect flow asks for its scopes: nothing about a remote app's
254
+ * credential is special there. `providerCapability` is the provider as
255
+ * the registry resolves it (the synthesized row's, before it is written);
256
+ * for an OAuth provider the entry lists `scopes`, the server's own scope
257
+ * strings the connect asks for (discovery's, or none: the server decides).
258
+ */
147
259
  export declare function remoteMcpAppManifest(input: {
148
260
  id: string;
149
261
  name?: string | null;
150
262
  description?: string | null;
151
263
  remote: RemoteMcpBlock;
264
+ providerCapability?: Capability | null;
265
+ /** An OAuth provider's scopes the connect asks for. */
266
+ scopes?: readonly string[] | null;
152
267
  }): RemoteMcpManifest;
153
268
  /** How a tool got its risk: the server's hint, the app's default, the operator's override, or the fallback. */
154
269
  export type RemoteToolRiskSource = "hint" | "app" | "override" | "default";
@@ -177,10 +292,12 @@ export declare function remoteToolEnabled(block: Pick<RemoteMcpBlock, "tools">,
177
292
  */
178
293
  export declare function normalizeRemoteToolName(name: string): string | null;
179
294
  /**
180
- * The request headers that carry the credential for `auth`, from the
181
- * setting's value. The value never appears anywhere else.
295
+ * Plain words for how the app authenticates, for lists and dialogs. With
296
+ * the provider's capability as the registry resolves it: "bearer token",
297
+ * "header X-Api-Key", "query parameter key", "user and password" (an
298
+ * API-key provider; "<kind>, <provider>'s key" when the provider isn't
299
+ * the app's own synthesized row), or "OAuth, each member connects" (an
300
+ * OAuth provider). Without it, the provider's id.
182
301
  */
183
- export declare function remoteMcpAuthHeaders(auth: RemoteMcpAuth, value: string): Record<string, string>;
184
- /** Plain words for an auth kind, for lists and dialogs. */
185
- export declare function remoteMcpAuthLabel(auth: RemoteMcpAuth): string;
302
+ export declare function remoteMcpAuthLabel(auth: RemoteMcpAuth, capability?: Capability | null): string;
186
303
  //# sourceMappingURL=remoteMcp.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"remoteMcp.d.ts","sourceRoot":"","sources":["../../src/internal/remoteMcp.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAiC,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE1E,eAAO,MAAM,qBAAqB,yDAMxB,CAAC;AACX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvE;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE;AAClB,uCAAuC;GACrC;IAAE,IAAI,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