@every-app/sdk 0.3.0-rc.9 → 0.3.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.
Files changed (131) hide show
  1. package/README.md +79 -74
  2. package/dist/cloudflare/catalogSettings.generated.d.ts +19 -6
  3. package/dist/cloudflare/catalogSettings.generated.d.ts.map +1 -1
  4. package/dist/cloudflare/catalogSettings.generated.js +43 -14
  5. package/dist/cloudflare/index.d.ts +1 -1
  6. package/dist/cloudflare/index.d.ts.map +1 -1
  7. package/dist/cloudflare/worker.d.ts +63 -9
  8. package/dist/cloudflare/worker.d.ts.map +1 -1
  9. package/dist/cloudflare/worker.js +45 -9
  10. package/dist/index.d.ts +1 -1
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/internal/aiDefault.d.ts +36 -79
  13. package/dist/internal/aiDefault.d.ts.map +1 -1
  14. package/dist/internal/aiDefault.js +47 -149
  15. package/dist/internal/aiProviders.d.ts +1 -1
  16. package/dist/internal/aiProviders.d.ts.map +1 -1
  17. package/dist/internal/aiProviders.js +2 -2
  18. package/dist/internal/appSettings.d.ts +140 -89
  19. package/dist/internal/appSettings.d.ts.map +1 -1
  20. package/dist/internal/appSettings.js +264 -156
  21. package/dist/internal/capabilities.d.ts +109 -503
  22. package/dist/internal/capabilities.d.ts.map +1 -1
  23. package/dist/internal/capabilities.js +30 -550
  24. package/dist/internal/catalog/commerce.js +1 -1
  25. package/dist/internal/catalog/index.d.ts +35 -0
  26. package/dist/internal/catalog/index.d.ts.map +1 -1
  27. package/dist/internal/catalog/infra.d.ts +35 -0
  28. package/dist/internal/catalog/infra.d.ts.map +1 -1
  29. package/dist/internal/catalog/infra.js +65 -0
  30. package/dist/internal/devProviders.d.ts +1 -19
  31. package/dist/internal/devProviders.d.ts.map +1 -1
  32. package/dist/internal/devProviders.js +7 -1
  33. package/dist/internal/events.d.ts +52 -1
  34. package/dist/internal/events.d.ts.map +1 -1
  35. package/dist/internal/events.js +66 -4
  36. package/dist/internal/gatewaySettings.d.ts +6 -16
  37. package/dist/internal/gatewaySettings.d.ts.map +1 -1
  38. package/dist/internal/gatewaySettings.js +5 -23
  39. package/dist/internal/index.d.ts +1 -0
  40. package/dist/internal/index.d.ts.map +1 -1
  41. package/dist/internal/index.js +1 -0
  42. package/dist/internal/mcpOAuth.d.ts +210 -0
  43. package/dist/internal/mcpOAuth.d.ts.map +1 -0
  44. package/dist/internal/mcpOAuth.js +735 -0
  45. package/dist/internal/oauthClient.d.ts +36 -44
  46. package/dist/internal/oauthClient.d.ts.map +1 -1
  47. package/dist/internal/oauthClient.js +30 -113
  48. package/dist/internal/oauthPresets.d.ts +356 -20
  49. package/dist/internal/oauthPresets.d.ts.map +1 -1
  50. package/dist/internal/oauthPresets.js +183 -861
  51. package/dist/internal/oauthScopes.d.ts +43 -155
  52. package/dist/internal/oauthScopes.d.ts.map +1 -1
  53. package/dist/internal/oauthScopes.js +82 -475
  54. package/dist/internal/oauthSpec.d.ts +28 -71
  55. package/dist/internal/oauthSpec.d.ts.map +1 -1
  56. package/dist/internal/oauthSpec.js +172 -448
  57. package/dist/internal/protocol.d.ts +24 -14
  58. package/dist/internal/protocol.d.ts.map +1 -1
  59. package/dist/internal/protocol.js +26 -7
  60. package/dist/internal/providerApps.d.ts +2 -2
  61. package/dist/internal/providerApps.js +2 -2
  62. package/dist/internal/providerRegistry.d.ts +5 -64
  63. package/dist/internal/providerRegistry.d.ts.map +1 -1
  64. package/dist/internal/providerRegistry.js +19 -118
  65. package/dist/internal/providerSpec.d.ts.map +1 -1
  66. package/dist/internal/providerSpec.js +14 -36
  67. package/dist/internal/remoteMcp.d.ts +191 -47
  68. package/dist/internal/remoteMcp.d.ts.map +1 -1
  69. package/dist/internal/remoteMcp.js +338 -133
  70. package/dist/internal/signInProviders.d.ts +1 -1
  71. package/dist/internal/signInProviders.d.ts.map +1 -1
  72. package/dist/internal/tools.d.ts +15 -8
  73. package/dist/internal/tools.d.ts.map +1 -1
  74. package/dist/internal/tools.js +9 -8
  75. package/dist/manifest.d.ts +96 -40
  76. package/dist/manifest.d.ts.map +1 -1
  77. package/dist/manifest.js +1 -1
  78. package/dist/server/ai.d.ts +1 -93
  79. package/dist/server/ai.d.ts.map +1 -1
  80. package/dist/server/ai.js +17 -111
  81. package/dist/server/attribution.d.ts +11 -1
  82. package/dist/server/attribution.d.ts.map +1 -1
  83. package/dist/server/attribution.js +7 -1
  84. package/dist/server/connectUrl.d.ts +5 -10
  85. package/dist/server/connectUrl.d.ts.map +1 -1
  86. package/dist/server/connectUrl.js +22 -14
  87. package/dist/server/context.d.ts +12 -14
  88. package/dist/server/context.d.ts.map +1 -1
  89. package/dist/server/context.js +23 -25
  90. package/dist/server/eventsEndpoint.d.ts +48 -0
  91. package/dist/server/eventsEndpoint.d.ts.map +1 -0
  92. package/dist/server/eventsEndpoint.js +145 -0
  93. package/dist/server/everyApp.d.ts +16 -26
  94. package/dist/server/everyApp.d.ts.map +1 -1
  95. package/dist/server/everyApp.js +22 -46
  96. package/dist/server/gatewayFetch.d.ts +1 -1
  97. package/dist/server/gatewayFetch.js +1 -1
  98. package/dist/server/index.d.ts +6 -9
  99. package/dist/server/index.d.ts.map +1 -1
  100. package/dist/server/index.js +4 -8
  101. package/dist/server/integrationFetch.d.ts +66 -72
  102. package/dist/server/integrationFetch.d.ts.map +1 -1
  103. package/dist/server/integrationFetch.js +120 -392
  104. package/dist/server/refusal.d.ts +0 -9
  105. package/dist/server/refusal.d.ts.map +1 -1
  106. package/dist/server/refusal.js +0 -22
  107. package/dist/server/tools.d.ts +18 -7
  108. package/dist/server/tools.d.ts.map +1 -1
  109. package/dist/server/tools.js +15 -5
  110. package/dist/server/toolsEndpoint.d.ts +2 -1
  111. package/dist/server/toolsEndpoint.d.ts.map +1 -1
  112. package/dist/server/toolsEndpoint.js +4 -3
  113. package/dist/server/webhooks.d.ts +56 -0
  114. package/dist/server/webhooks.d.ts.map +1 -0
  115. package/dist/server/webhooks.js +205 -0
  116. package/dist/testing/index.d.ts +2 -3
  117. package/dist/testing/index.d.ts.map +1 -1
  118. package/dist/testing/index.js +2 -6
  119. package/package.json +6 -1
  120. package/dist/server/aiBinding.d.ts +0 -68
  121. package/dist/server/aiBinding.d.ts.map +0 -1
  122. package/dist/server/aiBinding.js +0 -294
  123. package/dist/server/authorizeUrl.d.ts +0 -43
  124. package/dist/server/authorizeUrl.d.ts.map +0 -1
  125. package/dist/server/authorizeUrl.js +0 -106
  126. package/dist/server/emailBinding.d.ts +0 -72
  127. package/dist/server/emailBinding.d.ts.map +0 -1
  128. package/dist/server/emailBinding.js +0 -124
  129. package/dist/server/fromMcpTools.d.ts +0 -89
  130. package/dist/server/fromMcpTools.d.ts.map +0 -1
  131. package/dist/server/fromMcpTools.js +0 -192
@@ -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 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
@@ -134,6 +224,35 @@ export declare function remoteMcpSecretOf(auth: RemoteMcpAuth): string | null;
134
224
  * member with access and every AI client.
135
225
  */
136
226
  export declare function remoteMcpDefaultDescription(name: string, url: string): string;
227
+ /** What a server says about itself in its MCP handshake (`serverInfo`). */
228
+ export interface RemoteMcpServerInfo {
229
+ name?: string;
230
+ title?: string;
231
+ description?: string;
232
+ }
233
+ /**
234
+ * The name and description a row takes from its server's `serverInfo`, or
235
+ * null when nothing changes. A row is named by the server unless the
236
+ * registrar named it: a name that is still the app id (none given) or the
237
+ * server's own last title gives way to the server's `title` (or a `name`
238
+ * that reads as one, not a code identifier like `mcp-server`); a
239
+ * description that is still the default sentence or the server's last one
240
+ * gives way to the server's `description`. What the server said last is
241
+ * kept in the manifest's `server`, so a later change on the server follows
242
+ * and a name or description the registrar set (Edit in Admin → Apps) is never
243
+ * overwritten.
244
+ */
245
+ export declare function remoteMcpServerNaming(input: {
246
+ id: string;
247
+ url: string;
248
+ /** The stored manifest JSON. */
249
+ manifest: string | null;
250
+ serverInfo: RemoteMcpServerInfo | undefined;
251
+ }): {
252
+ manifest: string;
253
+ name: string;
254
+ description: string;
255
+ } | null;
137
256
  /**
138
257
  * The operator's override for a server tool: by the server's name, or by
139
258
  * a name that becomes the same ToolBus name ({@link normalizeRemoteToolName}),
@@ -143,23 +262,46 @@ export declare function remoteMcpDefaultDescription(name: string, url: string):
143
262
  export declare function remoteToolOverride(block: Pick<RemoteMcpBlock, "tools">, upstreamName: string): RemoteMcpToolOverride | undefined;
144
263
  /** Whether a server's tool name can travel in an HTTP header (`Mcp-Name`): visible ASCII, bounded. */
145
264
  export declare function isHeaderSafeToolName(name: string): boolean;
146
- /** The manifest a remote MCP app's row stores, from what the registrar gave. */
265
+ /**
266
+ * The entry a remote MCP app's manifest lists its provider under
267
+ * (`capabilities`), as a deployed app lists one: `{ access, why }` for an
268
+ * API-key provider, `{ scopes, why }` for an OAuth one.
269
+ */
270
+ export type RemoteMcpCapabilityEntry = {
271
+ access: "read";
272
+ why: string;
273
+ } | {
274
+ scopes: string[];
275
+ why: string;
276
+ };
277
+ /**
278
+ * The manifest a remote MCP app's row stores, from what the registrar
279
+ * gave. An app with a provider credential lists the provider under
280
+ * `capabilities` like a deployed app that uses it, so the settings model
281
+ * (./appSettings.ts) asks for its key or client, `secret list` names it
282
+ * and the connect flow asks for its scopes: nothing about a remote app's
283
+ * credential is special there. `providerCapability` is the provider as
284
+ * the registry resolves it (the synthesized row's, before it is written);
285
+ * for an OAuth provider the entry lists `scopes`, the server's own scope
286
+ * strings the connect asks for (discovery's, or none: the server decides).
287
+ */
147
288
  export declare function remoteMcpAppManifest(input: {
148
289
  id: string;
149
290
  name?: string | null;
150
291
  description?: string | null;
151
292
  remote: RemoteMcpBlock;
293
+ providerCapability?: Capability | null;
294
+ /** An OAuth provider's scopes the connect asks for. */
295
+ scopes?: readonly string[] | null;
152
296
  }): RemoteMcpManifest;
153
297
  /** How a tool got its risk: the server's hint, the app's default, the operator's override, or the fallback. */
154
298
  export type RemoteToolRiskSource = "hint" | "app" | "override" | "default";
155
299
  /**
156
300
  * A tool's risk for the Gateway. An override wins; then the app's `read`
157
- * or `write` default; then the server's hints, read conservatively: an
158
- * explicit `readOnlyHint: true` is `read`, an explicit `destructiveHint:
159
- * true` is `destructive` (hidden until approvals exist), and anything
160
- * else, a missing hint included, is `write`. The spec's missing-means-true
161
- * default for `destructiveHint` is not followed: it would hide every
162
- * unhinted tool.
301
+ * or `write` default; then the server's hints: an explicit `readOnlyHint:
302
+ * true` is `read`, and anything else, a missing hint included, is `write`.
303
+ * A write tool keeps the server's `destructiveHint`, so clients still ask
304
+ * before calling it.
163
305
  */
164
306
  export declare function remoteToolRisk(hints: {
165
307
  readOnlyHint?: unknown;
@@ -179,10 +321,12 @@ export declare function remoteToolEnabled(block: Pick<RemoteMcpBlock, "tools">,
179
321
  */
180
322
  export declare function normalizeRemoteToolName(name: string): string | null;
181
323
  /**
182
- * The request headers that carry the credential for `auth`, from the
183
- * setting's value. The value never appears anywhere else.
324
+ * Plain words for how the app authenticates, for lists and dialogs. With
325
+ * the provider's capability as the registry resolves it: "bearer token",
326
+ * "header X-Api-Key", "query parameter key", "user and password" (an
327
+ * API-key provider; "<kind>, <provider>'s key" when the provider isn't
328
+ * the app's own synthesized row), or "OAuth, each member connects" (an
329
+ * OAuth provider). Without it, the provider's id.
184
330
  */
185
- export declare function remoteMcpAuthHeaders(auth: RemoteMcpAuth, value: string): Record<string, string>;
186
- /** Plain words for an auth kind, for lists and dialogs. */
187
- export declare function remoteMcpAuthLabel(auth: RemoteMcpAuth): string;
331
+ export declare function remoteMcpAuthLabel(auth: RemoteMcpAuth, capability?: Capability | null): string;
188
332
  //# 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,qBAAq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