@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
@@ -16,18 +16,16 @@
16
16
  * proxy's rules: inference routes only, the model allowlist, the usage
17
17
  * tap. Never a capability: its key would reach the account's credits
18
18
  * and keys on the same host.
19
- * - `oauth_client`: a provider's OAuth client (Google's, Microsoft's,
20
- * Slack's), held the same way. The gateway completes the token endpoint
21
- * calls only, putting the client on them; the app builds the authorize
22
- * URL from the public client id (`integrationStatus()`), sends people
23
- * back to a callback its manifest entry lists (`redirectPaths`), keeps
24
- * the user tokens and calls the provider's API with them itself. Other
25
- * providers' clients (GitHub, the social networks) are presets
26
- * (./oauthPresets.ts): rows only once an operator adds one. A client shared by apps
27
- * with different needs carries a `scopePolicy`: named scope sets an app
28
- * lists in its manifest entry's `scopes`, which ./oauthScopes.ts turns
29
- * into what the app may ask the provider for and what a token it is
30
- * handed may carry.
19
+ * - `oauth_client`: an OAuth provider whose client the gateway holds and
20
+ * whose flow it runs. None is in the catalog: each is a registered row,
21
+ * written from a preset (./oauthPresets.ts: Google, Microsoft, Slack,
22
+ * GitHub and the rest) or an operator's spec. A person connects once,
23
+ * for the provider scopes the organization's apps list in their
24
+ * manifest entries (`scopes`), and allows each app that asks to use the
25
+ * connection; the gateway keeps the tokens and puts the person's token
26
+ * on the app's calls to the provider's `api` hosts. Each provider is a
27
+ * spec (./oauthSpec.ts), its differences data; ./oauthScopes.ts holds
28
+ * the one set of scope rules.
31
29
  * - `service`: something the gateway does itself, with no upstream host
32
30
  * an app names (sending email, listing the organization's members). An
33
31
  * app lists it the same way and calls its routes,
@@ -168,7 +166,7 @@ export interface ApiKeyCapability extends ProviderDetails {
168
166
  auth: ApiKeyAuth;
169
167
  /** Where an operator gets the key: the provider's API access page. */
170
168
  docs: string;
171
- /** The everyapp skill's setup guide for it, relative to the skill (`setup/dataforseo.md`); a row has none. */
169
+ /** Its setup guide, relative to the agent docs (`setup/dataforseo.md`: https://everyapp.com/docs/agent/setup/dataforseo.md); a row has none. */
172
170
  setup?: string;
173
171
  /** The only hosts the key is ever sent to, always over https; may be empty when `hostSetting` names the host. */
174
172
  hosts: readonly string[];
@@ -205,9 +203,9 @@ export interface ApiKeyCapability extends ProviderDetails {
205
203
  * An AI provider (OpenAI, OpenRouter, Workers AI): the AI proxy's table as
206
204
  * a catalog entry. The app's path is joined onto `origin` and `basePath`
207
205
  * (with `{SETTING}` placeholders filled from the Gateway's settings, each
208
- * URL-encoded) and must be one of `inferenceRoutes` (a POST), unless both
209
- * the operator (`AI_PROXY_EXTRA_ROUTES`) and the app's manifest (`ai.routes`)
210
- * allow more (`extraRoutes`). `unstoredRoutes` get `store: false`.
206
+ * URL-encoded) and must be one of `inferenceRoutes` (a POST), unless the
207
+ * app's manifest (`ai.routes`) allows more on an entry that takes more
208
+ * (`extraRoutes`). `unstoredRoutes` get `store: false`.
211
209
  * `normalize` names the one response rewrite the gateway has.
212
210
  */
213
211
  export interface AiProviderCapability extends ProviderDetails {
@@ -231,6 +229,7 @@ export interface AiProviderCapability extends ProviderDetails {
231
229
  basePath?: string;
232
230
  inferenceRoutes: readonly string[];
233
231
  unstoredRoutes?: readonly string[];
232
+ /** Paths beyond inference an app may name in its manifest's `ai.routes`: OpenAI only. */
234
233
  extraRoutes?: boolean;
235
234
  normalize?: "workers-ai";
236
235
  /**
@@ -288,11 +287,11 @@ export interface AiRoute {
288
287
  /** One of the entry's `inferenceRoutes`: `/api/v1/chat/completions`. */
289
288
  path: string;
290
289
  /**
291
- * The seed: the model the Gateway fills in when its operator set none
292
- * for this provider (`everyapp ai model`, `org_settings.ai_models`), a
293
- * cheap, capable one of the provider's. Data, never the only answer:
294
- * read it through `resolveAiDefault` (./aiDefault.ts), which puts the
295
- * operator's setting first.
290
+ * The seed: the model the Gateway fills in when the workspace's default
291
+ * names this provider without a model (or the order picked it), a
292
+ * cheap, capable one of the provider's. Read it through
293
+ * `resolveAiDefault` (./aiDefault.ts), which puts the setting's model
294
+ * first.
296
295
  */
297
296
  seedModel: string;
298
297
  }
@@ -314,108 +313,13 @@ export interface GatewayServiceCapability {
314
313
  settings: readonly string[];
315
314
  /** Settings it reads when set (another transport), ready or not. */
316
315
  optionalSettings: readonly string[];
317
- /** The everyapp skill's setup guide, when there is anything to set up. */
316
+ /** The setup guide in the agent docs, when there is anything to set up. */
318
317
  setup?: string;
319
318
  }
320
- /** Where the gateway puts an OAuth client on a token request. */
319
+ /** Where the Gateway puts its OAuth client on a token request: the form body or HTTP Basic. */
321
320
  export type OAuthClientInjection = "form" | "basic";
322
- /** A token endpoint an `oauth_client` capability completes, with its rule. */
323
- export interface OAuthTokenEndpoint {
324
- /** The endpoint's host, always over https. */
325
- host: string;
326
- /** The exact pathname. */
327
- path: string;
328
- methods: readonly ("GET" | "POST")[];
329
- /**
330
- * Where the client goes: the form body or HTTP Basic
331
- * (injectClientCredentials() in ./oauthClient.ts).
332
- */
333
- inject: OAuthClientInjection;
334
- }
335
- /**
336
- * One host's allowlist a scope set unlocks. Matched against the raw
337
- * pathname, case preserved, by `scopeRouteAllows()` in ./oauthScopes.ts:
338
- * the proxy boundary once the gateway holds tokens, tested data until then.
339
- */
340
- export interface OAuthScopeRoute {
341
- /** A bare https host, one of the capability's `api` hosts. */
342
- host: string;
343
- /**
344
- * Raw-path entries: exact, or a prefix when the entry ends in `/`. GET
345
- * and HEAD go through when one matches.
346
- */
347
- paths: readonly string[];
348
- /**
349
- * The read-shaped POSTs a read set allows (queries, watches): anchored,
350
- * flagless RegExps over the raw pathname. Every other POST is refused.
351
- */
352
- posts?: readonly RegExp[];
353
- }
354
- /**
355
- * A named bundle an app lists under `scopes`: what it asks the provider for
356
- * and what that unlocks.
357
- */
358
- export interface OAuthScopeSet {
359
- /** What Admin → Apps and a consent page call it: "Gmail (read-only)". */
360
- label: string;
361
- /**
362
- * A read set unlocks GET, HEAD and its `posts` only. No write set exists
363
- * on the shared clients yet; adding one is a reviewed registry change.
364
- */
365
- access: CapabilityAccess;
366
- /** The provider's scope strings, requested verbatim (Slack: bot scopes). */
367
- scopes: readonly string[];
368
- /** Slack's `user_scope` strings, issued to the installing person's own token; absent elsewhere. */
369
- userScopes?: readonly string[];
370
- routes: readonly OAuthScopeRoute[];
371
- }
372
- /**
373
- * How a provider spells granted scopes in its token response; each has a
374
- * parser in ./oauthScopes.ts. `space` and `comma` are the plain spellings
375
- * a registered provider names (`scopeDialect`): a token response without
376
- * a `scope` field is taken as granted-as-requested (RFC 6749 §5.1).
377
- */
378
- export type OAuthScopeDialect = "google" | "microsoft" | "slack" | "space" | "comma";
379
- /**
380
- * Everything the gateway needs to hold an app to its scope sets at the
381
- * token endpoint. Present means an app's entry must list `scopes` and the
382
- * gateway refuses tokens outside them. Data only: the dialect selects the
383
- * parser, so the registry stays a table.
384
- */
385
- export interface OAuthScopePolicy {
386
- sets: Readonly<Record<string, OAuthScopeSet>>;
387
- /**
388
- * Scopes a token may carry beyond the declared sets without refusal:
389
- * identity and refresh scopes, in every spelling the provider uses.
390
- * Never a data scope.
391
- */
392
- tolerated: readonly string[];
393
- /**
394
- * Scopes every declaring app asks for whatever its sets, on the authorize
395
- * URL and Microsoft's token leg (`offline_access`). Always tolerated.
396
- */
397
- alwaysRequested: readonly string[];
398
- dialect: OAuthScopeDialect;
399
- /**
400
- * The `tokenGrantType()` values the gateway completes through this
401
- * client. `null` is a code exchange that carries no `grant_type` (Slack's
402
- * oauth.v2.access).
403
- */
404
- grantTypes: readonly (string | null)[];
405
- /**
406
- * What becomes of the token request's `scope` once it passes the check:
407
- * `replace` it with the app's requested list (Microsoft's token-leg
408
- * extension, which keeps a token to one resource), `drop` it (Google
409
- * documents no `scope` on either token leg), or `keep` it (Slack).
410
- */
411
- requestScope: "replace" | "drop" | "keep";
412
- /**
413
- * Decoded path segments no set unlocks on any host, compared
414
- * case-insensitively: batch tunnels that carry other requests inside, and
415
- * resources that reveal secrets under a read scope.
416
- */
417
- deniedSegments: readonly string[];
418
- }
321
+ /** How a provider separates scopes in its `scope` parameter and its token answer. */
322
+ export type OAuthScopeSeparator = "space" | "comma";
419
323
  /** How a provider names the account a new connection is for, read once after the exchange. */
420
324
  export interface OAuthIdentity {
421
325
  /** An https URL on one of the provider's `api` hosts, GET with the new token. */
@@ -426,94 +330,84 @@ export interface OAuthIdentity {
426
330
  id?: string;
427
331
  }
428
332
  /**
429
- * What the Gateway needs to run a provider's authorization-code flow
430
- * itself (docs/design/2026-10-oauth-providers.md section 5): present on a
431
- * catalog entry that supports the Gateway-owned flow, and built from a
432
- * registered row's `auth` (`kind: "oauth2-user"`). Absent: the entry
433
- * keeps the app-driven flow only (the social networks).
333
+ * The provider's authorization-code flow as data, from its spec
334
+ * (./oauthSpec.ts): everything that differs between providers. The
335
+ * Gateway runs it; an app never sees a token or the client.
434
336
  */
435
337
  export interface OAuthFlow {
338
+ /** Where the browser goes to consent (https). */
339
+ authorizeUrl: string;
436
340
  /** The token endpoint the Gateway posts the code and refresh token to (https). */
437
341
  tokenUrl: string;
438
342
  /** Where a disconnect revokes the token; absent means the tokens die at their expiry. */
439
343
  revokeUrl?: string;
440
344
  /** The revoke call's method (default POST). */
441
345
  revokeMethod?: "POST" | "DELETE";
442
- /** Whether the authorize request carries a PKCE S256 challenge (default true). */
346
+ /** Where the client goes on the token request. */
347
+ inject: OAuthClientInjection;
348
+ /** Whether the authorize request carries a PKCE S256 challenge. */
443
349
  pkce: boolean;
444
- /** How the token response spells what it granted. */
445
- scopeDialect: OAuthScopeDialect;
350
+ scopeSeparator: OAuthScopeSeparator;
351
+ /**
352
+ * Joined onto an app's short scope (`gmail.modify`) for the authorize
353
+ * URL, and taken off a granted one for comparison: Google's
354
+ * `https://www.googleapis.com/auth/`. Absent: scopes as written.
355
+ */
356
+ scopePrefix?: string;
446
357
  /** Extra query on the authorize URL (Google's `access_type=offline`). */
447
358
  authorizeParams?: Readonly<Record<string, string>>;
448
359
  /** Extra headers on the token request (GitHub's `Accept: application/json`). */
449
360
  tokenHeaders?: Readonly<Record<string, string>>;
450
361
  identity?: OAuthIdentity;
362
+ /**
363
+ * Scopes the Gateway adds to every connect, whatever the app lists: what
364
+ * the identity URL needs, and a refresh token's (Microsoft's
365
+ * `offline_access`). Tolerated at mint; apps never list them.
366
+ */
367
+ identityScopes: readonly string[];
368
+ /** Scopes a token may carry beyond what was asked without refusal (another spelling of an identity scope). Never a data scope. */
369
+ tolerated: readonly string[];
370
+ /**
371
+ * The resource the tokens are for (RFC 8707), an https URL: sent as
372
+ * `resource` on the authorize URL, the code exchange and every refresh.
373
+ * An MCP server's row carries its URL here (./mcpOAuth.ts).
374
+ */
375
+ resource?: string;
376
+ /**
377
+ * The authorization server's issuer (RFC 8414), an https URL: when the
378
+ * callback carries `iss` it must equal this (RFC 9207, the mix-up
379
+ * defense).
380
+ */
381
+ issuer?: string;
451
382
  }
452
383
  /**
453
- * A provider's OAuth client the gateway holds. The gateway completes its
454
- * token endpoints only (`token`), putting the client on each request; the
455
- * app builds the authorize URL from the public client id and calls the
456
- * provider's API with the user tokens it keeps.
384
+ * An OAuth provider the Gateway holds a client for and runs the flow for
385
+ * (docs/design/2026-11-oauth-one-connection.md). A person connects once;
386
+ * the connection is theirs, for the scopes the organization's apps list
387
+ * in `everyapp.config.ts`, and each app they allow calls the provider's
388
+ * `api` hosts through the Gateway, which puts the token on.
457
389
  */
458
390
  export interface OAuthClientCapability {
459
391
  mode: "oauth_client";
460
- /** The provider's name in errors and logs. */
392
+ /** The provider's name in errors, pages and logs. */
461
393
  label: string;
462
- /** Gateway secret names. No `clientSecret`: a public client, the id alone. */
394
+ /** Gateway setting names. No `clientSecret`: a public client, the id alone. */
463
395
  secrets: {
464
396
  clientId: string;
465
397
  clientSecret?: string;
466
398
  };
467
- /** The only calls the gateway completes; anything else is refused. */
468
- token: readonly OAuthTokenEndpoint[];
469
- /**
470
- * Obtaining and refreshing user tokens with the operator's client
471
- * writes, so a catalog client is `["write"]`. A registered OAuth
472
- * provider says what the proxy may do with the held token: read, write
473
- * or both (docs/design/2026-10-oauth-providers.md section 7).
474
- */
475
- access: readonly CapabilityAccess[];
476
- /** Where the operator registers the client. */
399
+ /** Where the operator registers the client (the spec's `docs`). */
477
400
  console: string;
478
- /** The everyapp skill's setup guide for the client, when one exists. */
479
- setup?: string;
480
- /**
481
- * The authorize endpoint the app sends people to and the scopes the
482
- * client must be allowed: the operator's checklist and the docs. With
483
- * a `scopePolicy`, the union of its sets' scopes and `alwaysRequested`.
484
- */
485
- authorize: {
486
- url: string;
487
- scopes: readonly string[];
488
- };
489
- /**
490
- * Named scope sets an app lists in its manifest entry's `scopes`, for a
491
- * client several apps share with different needs. Absent: the whole
492
- * client is the grant.
493
- */
494
- scopePolicy?: OAuthScopePolicy;
495
- /**
496
- * Hosts the app calls afterwards with the user's token; the Gateway's
497
- * held-token branch forwards to these alone, and a scope policy's
498
- * routes are on them.
499
- */
401
+ /** The only hosts the held token is ever sent to, over https. */
500
402
  api: readonly string[];
501
- /** The Gateway-owned flow, when the entry supports it. */
502
- flow?: OAuthFlow;
503
- /** A registered OAuth provider's spec fields (a catalog client has `setup` instead). */
403
+ flow: OAuthFlow;
404
+ /** What it is for, in one line. */
504
405
  description?: string;
505
406
  /** The API reference (a spec's `api`), optional. */
506
407
  reference?: string;
507
408
  hint?: string;
508
409
  example?: string;
509
410
  tags?: readonly string[];
510
- /**
511
- * A registered OAuth provider's methods: what a read grant may use
512
- * (default GET and HEAD) and what a write grant adds (default the
513
- * API-key default). A catalog client leaves both unset.
514
- */
515
- readMethods?: readonly string[];
516
- writeMethods?: readonly string[];
517
411
  }
518
412
  export type Capability = ApiKeyCapability | AiProviderCapability | OAuthClientCapability | GatewayServiceCapability;
519
413
  export declare const CAPABILITIES: {
@@ -1724,6 +1618,41 @@ export declare const CAPABILITIES: {
1724
1618
  };
1725
1619
  readonly tags: readonly ["weather", "forecast"];
1726
1620
  };
1621
+ readonly daytona: {
1622
+ readonly mode: "api_key";
1623
+ readonly label: "Daytona";
1624
+ readonly description: "Sandboxes for running code: create, start, stop, archive and delete sandboxes, and manage their snapshots and volumes.";
1625
+ readonly auth: {
1626
+ readonly kind: "bearer";
1627
+ readonly secret: "DAYTONA_API_KEY";
1628
+ };
1629
+ readonly docs: "https://www.daytona.io/docs/en/api-keys/";
1630
+ readonly api: "https://www.daytona.io/docs/en/tools/api/";
1631
+ readonly hosts: readonly ["app.daytona.io"];
1632
+ readonly data: "account";
1633
+ readonly access: readonly ["read", "write"];
1634
+ readonly readMethods: readonly ["GET", "HEAD"];
1635
+ readonly writeMethods: readonly ["POST", "PUT", "PATCH", "DELETE"];
1636
+ readonly accountWidePaths: readonly [readonly ["organizations"], readonly ["organization"], readonly ["billing"], readonly ["api-keys"], readonly ["users"], readonly ["audit"], readonly ["webhooks"], readonly ["secret"], readonly ["docker-registry"], readonly ["object-storage"], readonly ["regions"], readonly ["runners"], readonly ["for-runner"], readonly ["jobs"], readonly ["warm-pools"], readonly ["preview"], readonly ["ssh-access", "validate"]];
1637
+ readonly hint: "An API key from the Daytona dashboard's Keys page, with only the permissions the apps need; the Gateway sends it as a bearer token to app.daytona.io. Any key of an organization reaches every running sandbox in it, so give the Gateway a Daytona organization of its own.";
1638
+ readonly secrets: readonly [{
1639
+ readonly name: "DAYTONA_API_KEY";
1640
+ readonly hint: "An API key from the Daytona dashboard's Keys page: write:sandboxes and delete:sandboxes (and the snapshot or volume ones) only if an app needs them, and never manage:api_keys, manage:secrets, manage:billing or the region and runner permissions.";
1641
+ }];
1642
+ readonly smoke: {
1643
+ readonly method: "GET";
1644
+ readonly path: "/api/sandbox";
1645
+ readonly expect: readonly [200];
1646
+ readonly free: true;
1647
+ readonly note: "Lists the organization's sandboxes; any key may read them.";
1648
+ };
1649
+ readonly example: "start a sandbox from my snapshot and stop it when the run is done";
1650
+ readonly verified: {
1651
+ readonly on: "2026-11-01";
1652
+ readonly how: "docs";
1653
+ };
1654
+ readonly tags: readonly ["sandbox", "compute", "hosting"];
1655
+ };
1727
1656
  readonly postmark: {
1728
1657
  readonly mode: "api_key";
1729
1658
  readonly label: "Postmark";
@@ -2702,305 +2631,6 @@ export declare const CAPABILITIES: {
2702
2631
  readonly settings: readonly [];
2703
2632
  readonly optionalSettings: readonly [];
2704
2633
  };
2705
- readonly slack: {
2706
- readonly mode: "oauth_client";
2707
- readonly label: "Slack";
2708
- readonly secrets: {
2709
- readonly clientId: "SLACK_CLIENT_ID";
2710
- readonly clientSecret: "SLACK_CLIENT_SECRET";
2711
- };
2712
- readonly token: readonly [{
2713
- readonly host: "slack.com";
2714
- readonly path: "/api/oauth.v2.access";
2715
- readonly methods: readonly ["POST"];
2716
- readonly inject: "form";
2717
- }];
2718
- readonly access: readonly ["write"];
2719
- readonly console: "https://api.slack.com/apps";
2720
- readonly setup: "setup/slack.md";
2721
- readonly authorize: {
2722
- readonly url: "https://slack.com/oauth/v2/authorize";
2723
- readonly scopes: readonly ["channels:read", "groups:read", "users:read", "users:read.email", "chat:write", "chat:write.public", "chat:write.customize", "channels:join", "channels:manage", "groups:write", "channels:write.invites", "groups:write.invites", "im:write", "files:write", "channels:write"];
2724
- };
2725
- readonly scopePolicy: {
2726
- readonly dialect: "slack";
2727
- readonly grantTypes: readonly [null, "refresh_token"];
2728
- readonly requestScope: "keep";
2729
- readonly alwaysRequested: readonly [];
2730
- readonly tolerated: readonly [];
2731
- readonly deniedSegments: readonly [];
2732
- readonly sets: {
2733
- readonly "channels.read": {
2734
- readonly label: "Channels (read-only)";
2735
- readonly access: "read";
2736
- readonly scopes: readonly ["channels:read", "groups:read"];
2737
- readonly routes: readonly [{
2738
- readonly host: "slack.com";
2739
- readonly paths: readonly ["/api/conversations.list", "/api/conversations.info", "/api/conversations.members", "/api/users.conversations"];
2740
- readonly posts: readonly [RegExp, RegExp];
2741
- }];
2742
- };
2743
- readonly "users.read": {
2744
- readonly label: "Members (read-only)";
2745
- readonly access: "read";
2746
- readonly scopes: readonly ["users:read"];
2747
- readonly routes: readonly [{
2748
- readonly host: "slack.com";
2749
- readonly paths: readonly ["/api/users.list", "/api/users.info", "/api/users.getPresence", "/api/bots.info"];
2750
- readonly posts: readonly [RegExp, RegExp];
2751
- }];
2752
- };
2753
- readonly "users.email": {
2754
- readonly label: "Members' email addresses (read-only)";
2755
- readonly access: "read";
2756
- readonly scopes: readonly ["users:read.email"];
2757
- readonly routes: readonly [{
2758
- readonly host: "slack.com";
2759
- readonly paths: readonly ["/api/users.lookupByEmail"];
2760
- readonly posts: readonly [RegExp];
2761
- }];
2762
- };
2763
- readonly "messages.write": {
2764
- readonly label: "Messages (post as the app)";
2765
- readonly access: "write";
2766
- readonly scopes: readonly ["chat:write", "chat:write.public", "chat:write.customize"];
2767
- readonly routes: readonly [{
2768
- readonly host: "slack.com";
2769
- readonly paths: readonly ["/api/chat.scheduledMessages.list"];
2770
- readonly posts: readonly [RegExp];
2771
- }];
2772
- };
2773
- readonly "channels.join": {
2774
- readonly label: "Channels (join public ones)";
2775
- readonly access: "write";
2776
- readonly scopes: readonly ["channels:join"];
2777
- readonly routes: readonly [{
2778
- readonly host: "slack.com";
2779
- readonly paths: readonly [];
2780
- readonly posts: readonly [RegExp];
2781
- }];
2782
- };
2783
- readonly "channels.manage": {
2784
- readonly label: "Channels (create, manage and invite to; open DMs)";
2785
- readonly access: "write";
2786
- readonly scopes: readonly ["channels:manage", "groups:write", "channels:write.invites", "groups:write.invites", "im:write"];
2787
- readonly routes: readonly [{
2788
- readonly host: "slack.com";
2789
- readonly paths: readonly [];
2790
- readonly posts: readonly [RegExp];
2791
- }];
2792
- };
2793
- readonly "files.write": {
2794
- readonly label: "Files (upload)";
2795
- readonly access: "write";
2796
- readonly scopes: readonly ["files:write"];
2797
- readonly routes: readonly [{
2798
- readonly host: "slack.com";
2799
- readonly paths: readonly [];
2800
- readonly posts: readonly [RegExp];
2801
- }];
2802
- };
2803
- readonly "user-channels.manage": {
2804
- readonly label: "Channels (as the installing person: read, manage, invite to)";
2805
- readonly access: "write";
2806
- readonly scopes: readonly [];
2807
- readonly userScopes: readonly ["channels:read", "channels:write", "groups:read", "groups:write"];
2808
- readonly routes: readonly [{
2809
- readonly host: "slack.com";
2810
- readonly paths: readonly ["/api/conversations.list", "/api/conversations.info", "/api/conversations.members", "/api/users.conversations"];
2811
- readonly posts: readonly [RegExp, RegExp];
2812
- }];
2813
- };
2814
- };
2815
- };
2816
- readonly api: readonly ["slack.com"];
2817
- readonly flow: {
2818
- readonly tokenUrl: "https://slack.com/api/oauth.v2.access";
2819
- readonly revokeUrl: "https://slack.com/api/auth.revoke";
2820
- readonly pkce: false;
2821
- readonly scopeDialect: "slack";
2822
- readonly identity: {
2823
- readonly url: "https://slack.com/api/auth.test";
2824
- readonly label: "team";
2825
- readonly id: "user_id";
2826
- };
2827
- };
2828
- };
2829
- readonly "google-workspace": {
2830
- readonly mode: "oauth_client";
2831
- readonly label: "Google (Gmail, Calendar, Search Console and Analytics)";
2832
- readonly secrets: {
2833
- readonly clientId: "GOOGLE_WORKSPACE_CLIENT_ID";
2834
- readonly clientSecret: "GOOGLE_WORKSPACE_CLIENT_SECRET";
2835
- };
2836
- readonly token: readonly [{
2837
- readonly host: "oauth2.googleapis.com";
2838
- readonly path: "/token";
2839
- readonly methods: readonly ["POST"];
2840
- readonly inject: "form";
2841
- }];
2842
- readonly access: readonly ["write"];
2843
- readonly console: "https://console.cloud.google.com/apis/credentials";
2844
- readonly setup: "setup/google.md";
2845
- readonly authorize: {
2846
- readonly url: "https://accounts.google.com/o/oauth2/v2/auth";
2847
- readonly scopes: readonly ["openid", "email", "profile", "https://www.googleapis.com/auth/gmail.readonly", "https://www.googleapis.com/auth/calendar.readonly", "https://www.googleapis.com/auth/webmasters.readonly", "https://www.googleapis.com/auth/analytics.readonly"];
2848
- };
2849
- readonly scopePolicy: {
2850
- readonly dialect: "google";
2851
- readonly grantTypes: readonly ["authorization_code", "refresh_token"];
2852
- readonly requestScope: "drop";
2853
- readonly alwaysRequested: readonly [];
2854
- readonly tolerated: readonly ["openid", "email", "profile", "https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile"];
2855
- readonly deniedSegments: readonly ["batch", "measurementProtocolSecrets"];
2856
- readonly sets: {
2857
- readonly identity: {
2858
- readonly label: "Google account (who you are)";
2859
- readonly access: "read";
2860
- readonly scopes: readonly ["openid", "email", "profile"];
2861
- readonly routes: readonly [{
2862
- readonly host: "openidconnect.googleapis.com";
2863
- readonly paths: readonly ["/v1/userinfo"];
2864
- }, {
2865
- readonly host: "www.googleapis.com";
2866
- readonly paths: readonly ["/oauth2/v2/userinfo", "/oauth2/v3/userinfo", "/userinfo/v2/me"];
2867
- }];
2868
- };
2869
- readonly "gmail.read": {
2870
- readonly label: "Gmail (read-only)";
2871
- readonly access: "read";
2872
- readonly scopes: readonly ["https://www.googleapis.com/auth/gmail.readonly"];
2873
- readonly routes: readonly [{
2874
- readonly host: "gmail.googleapis.com";
2875
- readonly paths: readonly ["/gmail/v1/users/"];
2876
- readonly posts: readonly [RegExp];
2877
- }];
2878
- };
2879
- readonly "calendar.read": {
2880
- readonly label: "Google Calendar (read-only)";
2881
- readonly access: "read";
2882
- readonly scopes: readonly ["https://www.googleapis.com/auth/calendar.readonly"];
2883
- readonly routes: readonly [{
2884
- readonly host: "www.googleapis.com";
2885
- readonly paths: readonly ["/calendar/v3/"];
2886
- readonly posts: readonly [RegExp, RegExp, RegExp, RegExp];
2887
- }];
2888
- };
2889
- readonly "search-console.read": {
2890
- readonly label: "Search Console (read-only)";
2891
- readonly access: "read";
2892
- readonly scopes: readonly ["https://www.googleapis.com/auth/webmasters.readonly"];
2893
- readonly routes: readonly [{
2894
- readonly host: "www.googleapis.com";
2895
- readonly paths: readonly ["/webmasters/v3/"];
2896
- readonly posts: readonly [RegExp];
2897
- }, {
2898
- readonly host: "searchconsole.googleapis.com";
2899
- readonly paths: readonly ["/webmasters/v3/"];
2900
- readonly posts: readonly [RegExp, RegExp];
2901
- }];
2902
- };
2903
- readonly "analytics.read": {
2904
- readonly label: "Google Analytics (read-only)";
2905
- readonly access: "read";
2906
- readonly scopes: readonly ["https://www.googleapis.com/auth/analytics.readonly"];
2907
- readonly routes: readonly [{
2908
- readonly host: "analyticsdata.googleapis.com";
2909
- readonly paths: readonly ["/v1beta/properties/"];
2910
- readonly posts: readonly [RegExp];
2911
- }, {
2912
- readonly host: "analyticsadmin.googleapis.com";
2913
- readonly paths: readonly ["/v1beta/accountSummaries", "/v1beta/accounts", "/v1beta/accounts/", "/v1beta/properties", "/v1beta/properties/", "/v1alpha/properties/"];
2914
- }];
2915
- };
2916
- };
2917
- };
2918
- readonly api: readonly ["gmail.googleapis.com", "www.googleapis.com", "searchconsole.googleapis.com", "analyticsdata.googleapis.com", "analyticsadmin.googleapis.com", "openidconnect.googleapis.com"];
2919
- readonly flow: {
2920
- readonly tokenUrl: "https://oauth2.googleapis.com/token";
2921
- readonly pkce: true;
2922
- readonly scopeDialect: "google";
2923
- readonly authorizeParams: {
2924
- readonly access_type: "offline";
2925
- readonly prompt: "consent";
2926
- };
2927
- readonly identity: {
2928
- readonly url: "https://openidconnect.googleapis.com/v1/userinfo";
2929
- readonly label: "email";
2930
- readonly id: "sub";
2931
- };
2932
- };
2933
- };
2934
- readonly "microsoft-365": {
2935
- readonly mode: "oauth_client";
2936
- readonly label: "Microsoft 365 (Outlook mail and calendar)";
2937
- readonly secrets: {
2938
- readonly clientId: "MICROSOFT_365_CLIENT_ID";
2939
- readonly clientSecret: "MICROSOFT_365_CLIENT_SECRET";
2940
- };
2941
- readonly token: readonly [{
2942
- readonly host: "login.microsoftonline.com";
2943
- readonly path: "/common/oauth2/v2.0/token";
2944
- readonly methods: readonly ["POST"];
2945
- readonly inject: "form";
2946
- }];
2947
- readonly access: readonly ["write"];
2948
- readonly console: "https://entra.microsoft.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade";
2949
- readonly setup: "setup/microsoft-365.md";
2950
- readonly authorize: {
2951
- readonly url: "https://login.microsoftonline.com/common/oauth2/v2.0/authorize";
2952
- readonly scopes: readonly ["offline_access", "User.Read", "Mail.Read", "Calendars.Read"];
2953
- };
2954
- readonly scopePolicy: {
2955
- readonly dialect: "microsoft";
2956
- readonly grantTypes: readonly ["authorization_code", "refresh_token"];
2957
- readonly requestScope: "replace";
2958
- readonly alwaysRequested: readonly ["offline_access"];
2959
- readonly tolerated: readonly ["openid", "profile", "email", "offline_access", "User.Read"];
2960
- readonly deniedSegments: readonly ["$batch", "beta"];
2961
- readonly sets: {
2962
- readonly identity: {
2963
- readonly label: "Microsoft account (who you are)";
2964
- readonly access: "read";
2965
- readonly scopes: readonly ["User.Read"];
2966
- readonly routes: readonly [{
2967
- readonly host: "graph.microsoft.com";
2968
- readonly paths: readonly ["/v1.0/me", "/oidc/userinfo"];
2969
- }];
2970
- };
2971
- readonly "mail.read": {
2972
- readonly label: "Outlook mail (read-only)";
2973
- readonly access: "read";
2974
- readonly scopes: readonly ["Mail.Read"];
2975
- readonly routes: readonly [{
2976
- readonly host: "graph.microsoft.com";
2977
- readonly paths: readonly ["/v1.0/me/messages", "/v1.0/me/messages/", "/v1.0/me/mailFolders", "/v1.0/me/mailFolders/"];
2978
- }];
2979
- };
2980
- readonly "calendar.read": {
2981
- readonly label: "Outlook calendar (read-only)";
2982
- readonly access: "read";
2983
- readonly scopes: readonly ["Calendars.Read"];
2984
- readonly routes: readonly [{
2985
- readonly host: "graph.microsoft.com";
2986
- readonly paths: readonly ["/v1.0/me/calendar", "/v1.0/me/calendar/", "/v1.0/me/calendars", "/v1.0/me/calendars/", "/v1.0/me/events", "/v1.0/me/events/", "/v1.0/me/calendarView", "/v1.0/me/calendarView/"];
2987
- readonly posts: readonly [RegExp];
2988
- }];
2989
- };
2990
- };
2991
- };
2992
- readonly api: readonly ["graph.microsoft.com"];
2993
- readonly flow: {
2994
- readonly tokenUrl: "https://login.microsoftonline.com/common/oauth2/v2.0/token";
2995
- readonly pkce: true;
2996
- readonly scopeDialect: "microsoft";
2997
- readonly identity: {
2998
- readonly url: "https://graph.microsoft.com/v1.0/me";
2999
- readonly label: "userPrincipalName";
3000
- readonly id: "id";
3001
- };
3002
- };
3003
- };
3004
2634
  };
3005
2635
  export type CapabilityId = keyof typeof CAPABILITIES;
3006
2636
  type CapabilityIdOf<Mode extends Capability["mode"]> = {
@@ -3012,18 +2642,6 @@ export type ApiKeyCapabilityId = CapabilityIdOf<"api_key">;
3012
2642
  export type AiProviderId = CapabilityIdOf<"ai">;
3013
2643
  /** Capabilities the gateway performs itself, each with its SDK helper. */
3014
2644
  export type ServiceCapabilityId = CapabilityIdOf<"service">;
3015
- /** OAuth clients whose token endpoints apps reach with `integrationFetch()`. */
3016
- export type OAuthClientCapabilityId = CapabilityIdOf<"oauth_client">;
3017
- /**
3018
- * The scope set names an OAuth client offers; `never` for a client without
3019
- * a scope policy. Distributes over a union of ids, so a generic over two
3020
- * clients gets every name either offers rather than the names they share.
3021
- */
3022
- export type OAuthScopeSetName<Id extends OAuthClientCapabilityId> = Id extends unknown ? (typeof CAPABILITIES)[Id] extends {
3023
- scopePolicy: {
3024
- sets: infer S;
3025
- };
3026
- } ? keyof S & string : never : never;
3027
2645
  /** The Gateway settings an `auth` block names: the key, and a Basic username held as a setting. */
3028
2646
  type AuthSettingsOf<A> = (A extends {
3029
2647
  secret: infer S extends string;
@@ -3036,9 +2654,6 @@ type SettingsOf<C> = C extends {
3036
2654
  settings: readonly (infer S extends string)[];
3037
2655
  optionalSettings: readonly (infer O extends string)[];
3038
2656
  } ? S | O : C extends {
3039
- secrets: infer S;
3040
- token: unknown;
3041
- } ? S[keyof S] & string : C extends {
3042
2657
  auth: infer A;
3043
2658
  } ? AuthSettingsOf<A> | (C extends {
3044
2659
  alsoNeeds: readonly (infer N extends string)[];
@@ -3107,7 +2722,7 @@ export declare const INTEGRATION_PROXY_PREFIX = "/api/integrations";
3107
2722
  * `/api/integrations/<id>/<host><path>?<query>`. The host is in the path so
3108
2723
  * a provider with several API hosts needs no other channel.
3109
2724
  */
3110
- export declare function integrationProxyPath(id: ApiKeyCapabilityId | OAuthClientCapabilityId | (string & {}), upstream: URL): string;
2725
+ export declare function integrationProxyPath(id: ApiKeyCapabilityId | (string & {}), upstream: URL): string;
3111
2726
  /** The AppGateway path of a service capability's route: `/api/integrations/<id>/<route>`. */
3112
2727
  export declare function serviceRoutePath(id: ServiceCapabilityId, route: string): string;
3113
2728
  /** What an AppGateway capability path names. */
@@ -3119,13 +2734,12 @@ export type IntegrationProxyRoute =
3119
2734
  capability: ApiKeyCapability;
3120
2735
  upstream: URL;
3121
2736
  }
3122
- /** A call to one of an OAuth client's token endpoints, with its rule. */
2737
+ /** A call to one of an OAuth provider's API hosts, which goes with the person's held token. */
3123
2738
  | {
3124
2739
  kind: "oauth_client";
3125
2740
  id: string;
3126
2741
  capability: OAuthClientCapability;
3127
2742
  upstream: URL;
3128
- endpoint: OAuthTokenEndpoint;
3129
2743
  }
3130
2744
  /** A call to one of the routes a service capability declares. */
3131
2745
  | {
@@ -3139,20 +2753,12 @@ export type CapabilitySettings = Readonly<Record<string, unknown>>;
3139
2753
  /**
3140
2754
  * The capability call an AppGateway path names, or null when the path names
3141
2755
  * an unknown capability (or an AI provider, which has its own route), a
3142
- * host outside the provider's, a path that could leave that host, a path
3143
- * that isn't one of an OAuth client's token endpoints, or a route a service
3144
- * capability doesn't declare. `settings` resolves an API-key provider's
2756
+ * host outside the provider's, a path that could leave that host, or a
2757
+ * route a service capability doesn't declare. `settings` resolves an API-key provider's
3145
2758
  * `hostSetting` (a Shopify store's host); `lookup` is where the id is found,
3146
2759
  * the catalog alone by default.
3147
2760
  */
3148
2761
  export declare function parseIntegrationProxyPath(pathname: string, search: string, settings?: CapabilitySettings, lookup?: CapabilityLookup): IntegrationProxyRoute | null;
3149
- /**
3150
- * The token endpoint `upstream` is, by its exact host and path, or null.
3151
- * Its method is the caller's to check.
3152
- */
3153
- export declare function tokenEndpointFor(capability: OAuthClientCapability, upstream: URL): OAuthTokenEndpoint | null;
3154
- /** An OAuth client's token endpoints, as `POST https://host/path` lines for messages. */
3155
- export declare function describeTokenEndpoints(capability: OAuthClientCapability): string;
3156
2762
  /**
3157
2763
  * The command that gives the gateway `capability`'s client:
3158
2764
  * `pnpm everyapp secret set <ID> <SECRET>`.