@composio/client 2.0.0-rc.17 → 2.0.0-rc.18

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 (173) hide show
  1. package/README.md +107 -33
  2. package/dist/{api-key-revocation-lc3308Ao.mjs → api-key-revocation-JkA4sOGH.mjs} +1 -1
  3. package/dist/{auth-DkGiEaxg.mjs → auth-B_K-wdMm.mjs} +1 -1
  4. package/dist/{auth-configs-DbxqGahP.mjs → auth-configs-RAgN782Z.mjs} +1 -1
  5. package/dist/{clanker-fK9cAkTz.mjs → clanker-Pgyyh95r.mjs} +1 -1
  6. package/dist/{cli-K1MskpaR.mjs → cli-Ca5bRiEN.mjs} +4 -5
  7. package/dist/{connected-accounts-Bfl7_SY_.mjs → connected-accounts-D6NTwvbi.mjs} +1 -1
  8. package/dist/{consumer-5o2zMQwr.mjs → consumer-BP4OyJS0.mjs} +6 -7
  9. package/dist/{custom-wEkSiPHn.mjs → custom-BBr7KbCv.mjs} +1 -1
  10. package/dist/{custom-8rs-sHnb.mjs → custom-DA3ABHnI.mjs} +1 -1
  11. package/dist/effect.d.mts +54 -23
  12. package/dist/effect.mjs +204 -143
  13. package/dist/{error-D9cG225M.mjs → error-Bw7_G2NZ.mjs} +1 -1
  14. package/dist/{files-BPKJXlpc.mjs → files-CeBs4ZE1.mjs} +1 -1
  15. package/dist/{files-BjPFzRnM.mjs → files-DLRmNLRD.mjs} +1 -1
  16. package/dist/{generate-DDHNgbPS.mjs → generate-16uLPwUU.mjs} +1 -1
  17. package/dist/{generated-deprecated-inputs--L5LHDO_.mjs → generated-deprecated-inputs-zx6ml908.mjs} +2 -2
  18. package/dist/{generated-operations-D1e__yar.mjs → generated-operations-DKgGT6Dg.mjs} +426 -198
  19. package/dist/index.d.mts +3 -3
  20. package/dist/index.mjs +131 -101
  21. package/dist/{keyring-Dkm6DQIp.mjs → keyring-Q8GSieAv.mjs} +1 -1
  22. package/dist/{link-BBU-J5L_.mjs → link-D4dY_eaN.mjs} +1 -1
  23. package/dist/{logs-CuuysWk1.mjs → logs-Dc63Ju74.mjs} +3 -3
  24. package/dist/{manage-B1R7I3ZM.mjs → manage-ByF6b3OD.mjs} +1 -1
  25. package/dist/{mcp-C3beSy48.mjs → mcp-Cw7-Mtkm.mjs} +3 -3
  26. package/dist/{org-B13XOuKh.mjs → org-RRUxKfRw.mjs} +6 -6
  27. package/dist/{owner-BAr5uwk3.mjs → owner-GZX-sp-h.mjs} +1 -1
  28. package/dist/{pagination-rules-uMUdPq_7.mjs → pagination-rules-CMnBwktJ.mjs} +1 -1
  29. package/dist/pagination.mjs +1 -1
  30. package/dist/{project-BbCgXD83.mjs → project-BsKmk9T7.mjs} +1 -1
  31. package/dist/{project-C30H_5b6.mjs → project-C1uq7bV_.mjs} +1 -1
  32. package/dist/{project-DF5KclHm.mjs → project-C_YZ-eLI.mjs} +4 -7
  33. package/dist/{project-CDm8tjUw.mjs → project-Cj9ULE0a.mjs} +1 -1
  34. package/dist/{realtime-6LigMh83.mjs → realtime-W-lJ0Vcs.mjs} +1 -1
  35. package/dist/resources/api-key-revocation.d.mts +1 -1
  36. package/dist/resources/api-key-revocation.mjs +1 -1
  37. package/dist/resources/auth/auth.d.mts +1 -1
  38. package/dist/resources/auth/auth.mjs +1 -1
  39. package/dist/resources/auth/index.d.mts +1 -1
  40. package/dist/resources/auth/index.mjs +2 -2
  41. package/dist/resources/auth/session.d.mts +1 -1
  42. package/dist/resources/auth/session.mjs +1 -1
  43. package/dist/resources/auth-configs.d.mts +1 -1
  44. package/dist/resources/auth-configs.mjs +1 -1
  45. package/dist/resources/auth.d.mts +1 -1
  46. package/dist/resources/auth.mjs +2 -2
  47. package/dist/resources/cli/cli.d.mts +1 -1
  48. package/dist/resources/cli/cli.mjs +1 -1
  49. package/dist/resources/cli/index.d.mts +1 -1
  50. package/dist/resources/cli/index.mjs +2 -2
  51. package/dist/resources/cli/realtime.d.mts +1 -1
  52. package/dist/resources/cli/realtime.mjs +1 -1
  53. package/dist/resources/cli.d.mts +1 -1
  54. package/dist/resources/cli.mjs +2 -2
  55. package/dist/resources/connected-accounts.d.mts +1 -1
  56. package/dist/resources/connected-accounts.mjs +1 -1
  57. package/dist/resources/custom.d.mts +1 -1
  58. package/dist/resources/custom.mjs +1 -1
  59. package/dist/resources/files.d.mts +1 -1
  60. package/dist/resources/files.mjs +1 -1
  61. package/dist/resources/index.d.mts +1 -1
  62. package/dist/resources/index.mjs +13 -13
  63. package/dist/resources/keyring.d.mts +1 -1
  64. package/dist/resources/keyring.mjs +1 -1
  65. package/dist/resources/link.d.mts +1 -1
  66. package/dist/resources/link.mjs +1 -1
  67. package/dist/resources/logs/index.d.mts +1 -1
  68. package/dist/resources/logs/index.mjs +3 -3
  69. package/dist/resources/logs/logs.d.mts +1 -1
  70. package/dist/resources/logs/logs.mjs +1 -1
  71. package/dist/resources/logs/tools.d.mts +1 -1
  72. package/dist/resources/logs/tools.mjs +1 -1
  73. package/dist/resources/logs/triggers.d.mts +1 -1
  74. package/dist/resources/logs/triggers.mjs +1 -1
  75. package/dist/resources/logs.d.mts +1 -1
  76. package/dist/resources/logs.mjs +3 -3
  77. package/dist/resources/mcp/custom.d.mts +1 -1
  78. package/dist/resources/mcp/custom.mjs +1 -1
  79. package/dist/resources/mcp/generate.d.mts +1 -1
  80. package/dist/resources/mcp/generate.mjs +1 -1
  81. package/dist/resources/mcp/index.d.mts +1 -1
  82. package/dist/resources/mcp/index.mjs +3 -3
  83. package/dist/resources/mcp/mcp.d.mts +1 -1
  84. package/dist/resources/mcp/mcp.mjs +1 -1
  85. package/dist/resources/mcp.d.mts +1 -1
  86. package/dist/resources/mcp.mjs +3 -3
  87. package/dist/resources/org/clanker.d.mts +1 -1
  88. package/dist/resources/org/clanker.mjs +1 -1
  89. package/dist/resources/org/consumer/consumer.d.mts +1 -1
  90. package/dist/resources/org/consumer/consumer.mjs +1 -1
  91. package/dist/resources/org/consumer/index.d.mts +1 -1
  92. package/dist/resources/org/consumer/index.mjs +2 -2
  93. package/dist/resources/org/consumer/project.d.mts +1 -1
  94. package/dist/resources/org/consumer/project.mjs +1 -1
  95. package/dist/resources/org/consumer.d.mts +1 -1
  96. package/dist/resources/org/consumer.mjs +2 -2
  97. package/dist/resources/org/index.d.mts +1 -1
  98. package/dist/resources/org/index.mjs +6 -6
  99. package/dist/resources/org/org.d.mts +1 -1
  100. package/dist/resources/org/org.mjs +1 -1
  101. package/dist/resources/org/owner/index.d.mts +1 -1
  102. package/dist/resources/org/owner/index.mjs +2 -2
  103. package/dist/resources/org/owner/owner.d.mts +1 -1
  104. package/dist/resources/org/owner/owner.mjs +1 -1
  105. package/dist/resources/org/owner/project.d.mts +1 -1
  106. package/dist/resources/org/owner/project.mjs +1 -1
  107. package/dist/resources/org/owner.d.mts +1 -1
  108. package/dist/resources/org/owner.mjs +2 -2
  109. package/dist/resources/org/project.d.mts +1 -1
  110. package/dist/resources/org/project.mjs +1 -1
  111. package/dist/resources/org/usage.d.mts +1 -1
  112. package/dist/resources/org/usage.mjs +1 -1
  113. package/dist/resources/org.d.mts +1 -1
  114. package/dist/resources/org.mjs +6 -6
  115. package/dist/resources/project/index.d.mts +1 -1
  116. package/dist/resources/project/index.mjs +1 -1
  117. package/dist/resources/project/project.d.mts +1 -1
  118. package/dist/resources/project/project.mjs +1 -1
  119. package/dist/resources/project/usage.d.mts +1 -1
  120. package/dist/resources/project/usage.mjs +1 -1
  121. package/dist/resources/project.d.mts +1 -1
  122. package/dist/resources/project.mjs +1 -1
  123. package/dist/resources/session-configs.d.mts +1 -1
  124. package/dist/resources/session-configs.mjs +1 -1
  125. package/dist/resources/tool-router/index.d.mts +1 -1
  126. package/dist/resources/tool-router/index.mjs +2 -2
  127. package/dist/resources/tool-router/session/files.d.mts +1 -1
  128. package/dist/resources/tool-router/session/files.mjs +1 -1
  129. package/dist/resources/tool-router/session/index.d.mts +1 -1
  130. package/dist/resources/tool-router/session/index.mjs +2 -2
  131. package/dist/resources/tool-router/session/session.d.mts +1 -1
  132. package/dist/resources/tool-router/session/session.mjs +1 -1
  133. package/dist/resources/tool-router/session.d.mts +1 -1
  134. package/dist/resources/tool-router/session.mjs +2 -2
  135. package/dist/resources/tool-router/tool-router.d.mts +1 -1
  136. package/dist/resources/tool-router/tool-router.mjs +1 -1
  137. package/dist/resources/tool-router.d.mts +1 -1
  138. package/dist/resources/tool-router.mjs +2 -2
  139. package/dist/resources/toolkits.d.mts +1 -1
  140. package/dist/resources/toolkits.mjs +1 -1
  141. package/dist/resources/tools.d.mts +1 -1
  142. package/dist/resources/tools.mjs +1 -1
  143. package/dist/resources/trigger-instances/index.d.mts +1 -1
  144. package/dist/resources/trigger-instances/index.mjs +2 -2
  145. package/dist/resources/trigger-instances/manage.d.mts +1 -1
  146. package/dist/resources/trigger-instances/manage.mjs +1 -1
  147. package/dist/resources/trigger-instances/trigger-instances.d.mts +1 -1
  148. package/dist/resources/trigger-instances/trigger-instances.mjs +1 -1
  149. package/dist/resources/trigger-instances.d.mts +1 -1
  150. package/dist/resources/trigger-instances.mjs +2 -2
  151. package/dist/resources/triggers-types.d.mts +1 -1
  152. package/dist/resources/triggers-types.mjs +1 -1
  153. package/dist/resources/webhook-endpoints.d.mts +1 -1
  154. package/dist/resources/webhook-endpoints.mjs +1 -1
  155. package/dist/resources/webhook-subscriptions.d.mts +1 -1
  156. package/dist/resources/webhook-subscriptions.mjs +1 -1
  157. package/dist/{session-Dm8WtF4I.mjs → session-BT5NJfbm.mjs} +1 -1
  158. package/dist/{session-DEfDnHZZ.mjs → session-BmXeclWC.mjs} +2 -2
  159. package/dist/{session-configs-nA6TL_i4.d.mts → session-configs-x3OA4CSe.d.mts} +179 -102
  160. package/dist/{tool-router-6l_dREjC.mjs → tool-router-DYPUf-fN.mjs} +1 -1
  161. package/dist/{toolkits-Mn_uLV98.mjs → toolkits-DZOZDm-4.mjs} +1 -1
  162. package/dist/{tools-btk0mzFP.mjs → tools-BDCRk80t.mjs} +1 -1
  163. package/dist/{tools-z-PjBsf7.mjs → tools-C0GjPEpP.mjs} +1 -1
  164. package/dist/{trigger-instances-PQaObQQy.mjs → trigger-instances-J5frdgzO.mjs} +2 -2
  165. package/dist/{triggers-y0mi0XzT.mjs → triggers-CnvE7y0L.mjs} +1 -1
  166. package/dist/{triggers-types-KoRbT0k5.mjs → triggers-types-DLVCtuwC.mjs} +1 -1
  167. package/dist/{usage-B2Z947BK.mjs → usage-DPxuivP6.mjs} +1 -1
  168. package/dist/{usage-DvjkSmpI.mjs → usage-DjQg9WIV.mjs} +1 -1
  169. package/dist/version-DEAhxVwC.d.mts +4 -0
  170. package/dist/{webhook-endpoints-kf4Jj2Mz.mjs → webhook-endpoints-BrSjXOf0.mjs} +1 -1
  171. package/dist/{webhook-subscriptions-DcYN8qo1.mjs → webhook-subscriptions-HT1acmwH.mjs} +1 -1
  172. package/package.json +2 -2
  173. package/dist/version-DUxhnnPj.d.mts +0 -4
package/README.md CHANGED
@@ -6,17 +6,58 @@ This repo is the successor to the Stainless-generated [`@composio/client`](https
6
6
 
7
7
  ## Usage
8
8
 
9
- The package root is the Stainless-compatible drop-in surface: `new Composio({ apiKey })`, the Stainless type names, and throwing `APIPromise` semantics (shipped via UXE-163/UXE-164).
9
+ The package root is the Promise client: `new Composio({ auth })`, the Stainless type names, and throwing `APIPromise` semantics (shipped via UXE-163/UXE-164).
10
10
 
11
11
  ```ts
12
- import Composio from '@composio/client'
12
+ import Composio, { Auth } from '@composio/client'
13
13
 
14
- const composio = new Composio({ apiKey: process.env.COMPOSIO_API_KEY })
14
+ const composio = new Composio({ auth: Auth.project(process.env.COMPOSIO_API_KEY!) })
15
15
 
16
16
  const session = await composio.toolRouter.session.create({ user_id: 'user_123' })
17
17
  console.log(session.session_id, session.mcp.url)
18
18
  ```
19
19
 
20
+ ### Authentication and scope
21
+
22
+ `auth` is required and says how every request authenticates. A request carries at most one Composio
23
+ credential.
24
+
25
+ | `auth` | Sends |
26
+ | --- | --- |
27
+ | `Auth.project(key)` | `x-api-key` on every request to the API origin |
28
+ | `Auth.user(key)` | `x-user-api-key` on every request to the API origin |
29
+ | `Auth.organization(key)` | `x-org-api-key` on every request to the API origin |
30
+ | `Auth.auto({ project, user, organization })` | one of the keys given, chosen per operation: the project key wherever the operation accepts it, otherwise the first scheme it declares that a key is given for. This is how releases before rc.18 chose |
31
+ | `Auth.none()` | no credential. The credential header names are then ordinary headers, for a client used as a transport for schemes it does not model |
32
+
33
+ A fixed mode never consults the operation table. A key may be a function that returns one (or a
34
+ promise of one): it is called once per call, after the call starts, and its key is reused across
35
+ retries and same-origin redirects. It is not called for a call that starts off the API origin.
36
+ `client.authMode` reads the mode back; the client never returns a credential it was given as a
37
+ function.
38
+
39
+ `scope` names the organization and project the client addresses, sent as `x-org-id` and
40
+ `x-project-id` on requests to the API origin: `{ organizationId }`, `{ projectId }`, or both.
41
+
42
+ ```ts
43
+ const composio = new Composio({
44
+ auth: Auth.user(() => vault.read('composio-user-key')),
45
+ scope: { organizationId: 'org_123', projectId: 'pr_456' },
46
+ })
47
+ ```
48
+
49
+ A header name is reserved while something is configured to write it: the three credential names
50
+ while `auth` is not `none`, `x-org-id` and `x-project-id` while `scope` is set, and the identity
51
+ names as [below](#identify-the-calling-product). `defaultHeaders` and `COMPOSIO_CUSTOM_HEADERS` that
52
+ name a reserved header fail construction, and a call's `headers` that name one fail the call before
53
+ anything is sent. A client that needs another credential or scope derives one:
54
+ `composio.withOptions({ auth: Auth.project(key) })`. `withOptions` re-runs every construction check.
55
+
56
+ Three operations declare a credential or scope id as a header parameter
57
+ (`org.consumer.project.resolve`, `org.consumer.listConnectedToolkits`, `cli.createCodactFailure`).
58
+ Their signatures are unchanged: the value replaces the configured credential for that call, and an
59
+ `x-org-id` that disagrees with the configured `scope` fails the call.
60
+
20
61
  ### Pagination
21
62
 
22
63
  Use the `@composio/client/pagination` subpath to traverse list operations that return the standard
@@ -65,28 +106,30 @@ cursor ends traversal. When a response omits `next_cursor` but numeric `current_
65
106
  returning partial results; provide a custom adapter for that response shape. Requests are sequential
66
107
  and inherit the normal client retry/backoff path, but this is not proactive/shared rate-limit pacing.
67
108
 
68
- Use `fromEnv` when configuration must come from a specific environment snapshot instead of the
69
- host process. Explicit options replace mapped values, so this is safe for tests, workers, and
70
- applications that load configuration themselves:
109
+ The constructor reads nothing from the process. `Composio.fromEnv` is the one reader of the
110
+ environment, and it reads the mapping it is handed:
71
111
 
72
112
  ```ts
73
- const composio = Composio.fromEnv(config, { environment: 'staging' })
113
+ const composio = Composio.fromEnv(process.env, { environment: 'staging' })
74
114
  ```
75
115
 
76
- `fromEnv` recognizes `COMPOSIO_API_KEY`, `COMPOSIO_USER_API_KEY`, `COMPOSIO_ORG_API_KEY`,
77
- `COMPOSIO_BASE_URL`, `COMPOSIO_ALLOW_INSECURE_HTTP`, `COMPOSIO_CUSTOM_HEADERS`, and
78
- `COMPOSIO_LOG_LEVEL`. Derived clients created with `withOptions()` keep using the resolved snapshot and do
79
- not fall back to ambient values.
116
+ `fromEnv` reads `COMPOSIO_API_KEY`, `COMPOSIO_USER_API_KEY` and `COMPOSIO_ORG_API_KEY` into `auth`
117
+ (one set: that fixed mode; several: `Auth.auto`; none: `Auth.none()`), and `COMPOSIO_BASE_URL`,
118
+ `COMPOSIO_ALLOW_INSECURE_HTTP=1`, `COMPOSIO_CUSTOM_HEADERS` (as `defaultHeaders`) and
119
+ `COMPOSIO_LOG_LEVEL`. It does not read `COMPOSIO_ORG_ID` or `COMPOSIO_PROJECT_ID`: `scope` is always
120
+ an argument. An override replaces the whole field it names, so `{ auth: Auth.none() }` means none
121
+ whatever the mapping holds. Derived clients created with `withOptions()` keep using the resolved
122
+ snapshot.
80
123
 
81
124
  Inject a `Transport` when an application or test needs to own HTTP dispatch. The transport receives
82
125
  a complete `Request`; retries, credential-safe redirects, timeouts, and response parsing stay in the
83
126
  client:
84
127
 
85
128
  ```ts
86
- import Composio, { createFetchTransport } from '@composio/client'
129
+ import Composio, { Auth, createFetchTransport } from '@composio/client'
87
130
 
88
131
  const transport = createFetchTransport({ fetch: instrumentedFetch })
89
- const composio = new Composio({ apiKey, transport })
132
+ const composio = new Composio({ auth: Auth.project(apiKey), transport })
90
133
  ```
91
134
 
92
135
  Without a `transport`, the client resolves `globalThis.fetch` when a request is sent, so late
@@ -133,13 +176,13 @@ subpaths never import it and load without it.
133
176
  ```ts
134
177
  import { Effect, Layer } from 'effect'
135
178
  import * as FetchHttpClient from 'effect/http/FetchHttpClient'
136
- import { ComposioClient, layer, layerConfig, layerFetch } from '@composio/client/effect'
179
+ import { Auth, ComposioClient, layer, layerConfig, layerFetch } from '@composio/client/effect'
137
180
 
138
181
  // Explicit options, over a fetch-backed `HttpClient` the layer brings with it.
139
- const live = layerFetch({ apiKey: 'your-api-key' })
182
+ const live = layerFetch({ auth: Auth.project('your-api-key') })
140
183
 
141
184
  // Explicit options, over the `HttpClient` the application provides.
142
- const overMyTransport = layer({ apiKey: 'your-api-key' }).pipe(Layer.provide(FetchHttpClient.layer))
185
+ const overMyTransport = layer({ auth: Auth.project('your-api-key') }).pipe(Layer.provide(FetchHttpClient.layer))
143
186
 
144
187
  // Options read from the `COMPOSIO_*` settings.
145
188
  const fromConfig = layerConfig().pipe(Layer.provide(FetchHttpClient.layer))
@@ -156,15 +199,24 @@ const slug: Promise<string> = Effect.runPromise(program.pipe(Effect.provide(live
156
199
  `make(options, httpClient)` builds the same client synchronously from an `HttpClient` you already
157
200
  hold, and throws where the layers fail.
158
201
 
159
- Only `layerConfig` reads the environment. It reads `COMPOSIO_API_KEY`, `COMPOSIO_USER_API_KEY`,
160
- `COMPOSIO_ORG_API_KEY`, `COMPOSIO_BASE_URL` and `COMPOSIO_ALLOW_INSECURE_HTTP=1` through Effect's
161
- `Config`, so the `ConfigProvider` in context decides where they come from; by default that is the
162
- process environment. An option passed to `layerConfig` wins over its setting, and `null` for a
163
- credential means none, whatever is configured. `make`, `layer` and `layerFetch` read nothing.
164
-
165
- A credential option takes a `string` or a `Redacted<string>`. Construction fails with a
166
- `ConfigurationError` when a credentialed origin is not HTTPS (loopback and `allowInsecureHTTP`
167
- excepted, as on the root client), or when `decode: true` is given without `schemas`.
202
+ `auth` and `scope` mean what they mean on the root client (see
203
+ [Authentication and scope](#authentication-and-scope)), and `Auth` is exported from
204
+ `@composio/client/effect` too. A key may also be a `Redacted<string>`, or a function returning a
205
+ string or a `Redacted<string>`. There is no `withOptions`: a client is a value, and a caller that
206
+ needs another credential calls `make` again with the same `HttpClient`.
207
+
208
+ Only `layerConfig` reads the environment. It reads `COMPOSIO_API_KEY`, `COMPOSIO_USER_API_KEY` and
209
+ `COMPOSIO_ORG_API_KEY` into `auth` by the rule `Composio.fromEnv` applies, each key `Redacted`
210
+ throughout, and `COMPOSIO_BASE_URL` and `COMPOSIO_ALLOW_INSECURE_HTTP=1`, through Effect's `Config`,
211
+ so the `ConfigProvider` in context decides where they come from; by default that is the process
212
+ environment. An option passed to `layerConfig` replaces the setting it names, so
213
+ `layerConfig({ auth: Auth.none() })` means none whatever is configured. `make`, `layer` and
214
+ `layerFetch` read nothing.
215
+
216
+ Construction fails with a `ConfigurationError` when a credentialed origin is not HTTPS (loopback and
217
+ `allowInsecureHTTP` excepted, as on the root client), when a key or a header option is refused, or
218
+ when `decode: true` is given without `schemas`. A credential provider that fails, or returns
219
+ something a header cannot carry, fails the call with a `ConfigurationError` before anything is sent.
168
220
 
169
221
  The resources are plain objects of functions, not classes, so a method can be passed around without
170
222
  binding. One thing on the root client has no counterpart here: the resources that hold no operation
@@ -287,7 +339,7 @@ import { make } from '@composio/client/effect'
287
339
  import { schemaLoaders } from '@composio/client/effect/schemas'
288
340
 
289
341
  const checkedCategories = (httpClient: HttpClient.HttpClient) => {
290
- const composio = make({ apiKey: 'your-api-key', schemas: schemaLoaders }, httpClient)
342
+ const composio = make({ auth: Auth.project('your-api-key'), schemas: schemaLoaders }, httpClient)
291
343
  return composio.toolkits.retrieveCategories({ decode: true }).pipe(
292
344
  Effect.catchTag('@composio/client/DecodeError', (error) =>
293
345
  Effect.logError(`${error.operation}: ${JSON.stringify(error.issues)}`).pipe(Effect.as(null)),
@@ -345,10 +397,10 @@ top of the span itself.
345
397
 
346
398
  ### Credentials and redaction
347
399
 
348
- A request carries one credential header, chosen per operation as on the root client: `x-api-key`,
349
- `x-user-api-key` or `x-org-api-key`. The client holds all three as `Redacted` values and adds all
350
- three header names to Effect's redaction list for its requests, so spans and renderings of a request
351
- show `<redacted>`; Effect's own list knows only `x-api-key`.
400
+ A request carries at most one credential header, chosen by `auth` as on the root client:
401
+ `x-api-key`, `x-user-api-key` or `x-org-api-key`. The client holds every key as a `Redacted` value
402
+ and adds all three header names to Effect's redaction list for its requests, so spans and renderings
403
+ of a request show `<redacted>`; Effect's own list knows only `x-api-key`.
352
404
 
353
405
  No error the client produces holds the request, the transport's error or a credential value. One
354
406
  caveat: `APIConnectionError.description` is the transport's own message text, copied. A transport
@@ -439,7 +491,7 @@ and `./effect` take the same option:
439
491
 
440
492
  ```ts
441
493
  const composio = new Composio({
442
- apiKey,
494
+ auth: Auth.project(apiKey),
443
495
  identity: { product: '@composio/core', version: '0.9.0', source: 'TYPESCRIPT_SDK', framework: 'openai' },
444
496
  })
445
497
  ```
@@ -471,13 +523,13 @@ configured origin:
471
523
 
472
524
  ```ts
473
525
  const composio = new Composio({
474
- apiKey,
526
+ auth: Auth.project(apiKey),
475
527
  baseURL: 'http://host.docker.internal:9900',
476
528
  allowInsecureHTTP: true,
477
529
  })
478
530
  ```
479
531
 
480
- The equivalent environment configuration is:
532
+ The equivalent environment configuration, for `Composio.fromEnv`, is:
481
533
 
482
534
  ```sh
483
535
  COMPOSIO_BASE_URL=http://host.docker.internal:9900 \
@@ -488,6 +540,28 @@ The opt-in records the resolved scheme, hostname, and port. Mutating `baseURL` c
488
540
  and `withOptions({ baseURL: ... })` requires `allowInsecureHTTP: true` again when the origin
489
541
  changes. Redirects to another origin remain credential-free.
490
542
 
543
+ ### Removed in 2.0.0-rc.18
544
+
545
+ Each removal is a declared entry in `packages/codegen/assignability-ledger.json`. The other rows are
546
+ behaviour the type check cannot see, listed so an upgrade can find them.
547
+
548
+ | Removed | Migration |
549
+ | --- | --- |
550
+ | `apiKey` (root `ClientOptions` and `./effect` `ComposioClientOptions`) | `auth: Auth.project(key)` |
551
+ | `userApiKey` | `auth: Auth.user(key)`, which sends the user key on every request. The old per-operation selection is `Auth.auto({ project, user, organization })` |
552
+ | `orgApiKey` | `auth: Auth.organization(key)`, or `Auth.auto({ ... })` |
553
+ | `apiKey: null` plus a credential in `defaultHeaders` | the `auth` that credential is. While `auth` is not `none`, `defaultHeaders`, `COMPOSIO_CUSTOM_HEADERS` and a call's `headers` cannot name `x-api-key`, `x-user-api-key` or `x-org-api-key` |
554
+ | `x-api-key` overriding the credential for one call | a second client: `withOptions({ auth: Auth.project(key) })` on the root, `make({ ...options, auth: Auth.project(key) }, httpClient)` on `./effect` |
555
+ | `x-org-id`, `x-project-id` in `defaultHeaders` | `scope: { organizationId, projectId }`, which reserves both names. Without `scope` they are still ordinary headers |
556
+ | the constructor reading `COMPOSIO_*` from the process | `Composio.fromEnv(process.env, overrides)`; nothing else reads the environment. `new Composio()` with no options is gone with it |
557
+ | `layerConfig({ apiKey: null })` | `layerConfig({ auth: Auth.none() })`; an override replaces the whole `auth` |
558
+ | `layer()`, `layerFetch()` with no options | pass the options, `auth` included |
559
+ | assigning `client.apiKey`, `userApiKey` or `orgApiKey` | `withOptions({ auth })`. The three fields stay readable until rc.19 and read the string keys `auth` holds; keep your own copy of a key you need |
560
+ | `Credential` on `./effect` accepting `null` | `Auth.none()`. It now also accepts a function that returns a key |
561
+
562
+ Python makes the same change: `auth=ProjectAuth(key)` (and `UserAuth`, `OrganizationAuth`,
563
+ `AutoAuth`, `NoAuth`) and `scope=Scope(...)`, see [`python/README.md`](./python/README.md).
564
+
491
565
  ### Changed in 2.0.0-rc.17
492
566
 
493
567
  `defaultHeaders`, `COMPOSIO_CUSTOM_HEADERS` and per-call `headers` refuse the library headers
@@ -1,4 +1,4 @@
1
- import { b as withOperation, n as generatedOperation } from "./generated-operations-D1e__yar.mjs";
1
+ import { n as generatedOperation, y as withOperation } from "./generated-operations-DKgGT6Dg.mjs";
2
2
 
3
3
  //#region src/compat/resources/api-key-revocation.ts
4
4
  const OP_CREATE = generatedOperation("apiKeyRevocation.create");
@@ -1,4 +1,4 @@
1
- import { t as Session } from "./session-Dm8WtF4I.mjs";
1
+ import { t as Session } from "./session-BT5NJfbm.mjs";
2
2
 
3
3
  //#region src/compat/resources/auth/auth.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { b as withOperation, d as path, n as generatedOperation } from "./generated-operations-D1e__yar.mjs";
1
+ import { d as path, n as generatedOperation, y as withOperation } from "./generated-operations-DKgGT6Dg.mjs";
2
2
 
3
3
  //#region src/compat/resources/auth-configs.ts
4
4
  const OP_CREATE = generatedOperation("authConfigs.create");
@@ -1,4 +1,4 @@
1
- import { b as withOperation, n as generatedOperation } from "./generated-operations-D1e__yar.mjs";
1
+ import { n as generatedOperation, y as withOperation } from "./generated-operations-DKgGT6Dg.mjs";
2
2
 
3
3
  //#region src/compat/resources/org/clanker.ts
4
4
  const OP_CREATE_CLAIM = generatedOperation("org.clanker.createClaim");
@@ -1,5 +1,5 @@
1
- import { F as mergeHeaders, b as withOperation, n as generatedOperation } from "./generated-operations-D1e__yar.mjs";
2
- import { t as Realtime } from "./realtime-6LigMh83.mjs";
1
+ import { n as generatedOperation, y as withOperation } from "./generated-operations-DKgGT6Dg.mjs";
2
+ import { t as Realtime } from "./realtime-W-lJ0Vcs.mjs";
3
3
 
4
4
  //#region src/compat/resources/cli/cli.ts
5
5
  const OP_CREATE_CODACT_FAILURE = generatedOperation("cli.createCodactFailure");
@@ -22,9 +22,8 @@ var Cli = class {
22
22
  const { "x-user-api-key": xUserApiKey, ...body } = params;
23
23
  return this.#client.post("/api/v3.1/cli/codact_failures", withOperation(OP_CREATE_CODACT_FAILURE, {
24
24
  body,
25
- ...options,
26
- headers: mergeHeaders([{ ...xUserApiKey != null ? { "x-user-api-key": xUserApiKey } : void 0 }, options?.headers])
27
- }));
25
+ ...options
26
+ }, { "x-user-api-key": xUserApiKey }));
28
27
  }
29
28
  createSession(body = {}, options) {
30
29
  return this.#client.post("/api/v3.1/cli/create-session", withOperation(OP_CREATE_SESSION, {
@@ -1,4 +1,4 @@
1
- import { b as withOperation, d as path, n as generatedOperation } from "./generated-operations-D1e__yar.mjs";
1
+ import { d as path, n as generatedOperation, y as withOperation } from "./generated-operations-DKgGT6Dg.mjs";
2
2
 
3
3
  //#region src/compat/resources/connected-accounts.ts
4
4
  const OP_CREATE = generatedOperation("connectedAccounts.create");
@@ -1,5 +1,5 @@
1
- import { F as mergeHeaders, b as withOperation, n as generatedOperation } from "./generated-operations-D1e__yar.mjs";
2
- import { t as Project } from "./project-DF5KclHm.mjs";
1
+ import { n as generatedOperation, y as withOperation } from "./generated-operations-DKgGT6Dg.mjs";
2
+ import { t as Project } from "./project-C_YZ-eLI.mjs";
3
3
 
4
4
  //#region src/compat/resources/org/consumer/consumer.ts
5
5
  const OP_LIST_CONNECTED_TOOLKITS = generatedOperation("org.consumer.listConnectedToolkits");
@@ -20,11 +20,10 @@ var Consumer = class {
20
20
  const { "x-user-api-key": xUserApiKey, "x-org-id": xOrgId, ...query } = params;
21
21
  return this.#client.get("/api/v3.1/org/consumer/connected_toolkits", withOperation(OP_LIST_CONNECTED_TOOLKITS, {
22
22
  query,
23
- ...options,
24
- headers: mergeHeaders([{
25
- ...xUserApiKey != null ? { "x-user-api-key": xUserApiKey } : void 0,
26
- ...xOrgId != null ? { "x-org-id": xOrgId } : void 0
27
- }, options?.headers])
23
+ ...options
24
+ }, {
25
+ "x-user-api-key": xUserApiKey,
26
+ "x-org-id": xOrgId
28
27
  }));
29
28
  }
30
29
  };
@@ -1,4 +1,4 @@
1
- import { b as withOperation, n as generatedOperation } from "./generated-operations-D1e__yar.mjs";
1
+ import { n as generatedOperation, y as withOperation } from "./generated-operations-DKgGT6Dg.mjs";
2
2
 
3
3
  //#region src/compat/resources/mcp/custom.ts
4
4
  const OP_CREATE = generatedOperation("mcp.custom.create");
@@ -1,4 +1,4 @@
1
- import { b as withOperation, d as path, n as generatedOperation } from "./generated-operations-D1e__yar.mjs";
1
+ import { d as path, n as generatedOperation, y as withOperation } from "./generated-operations-DKgGT6Dg.mjs";
2
2
 
3
3
  //#region src/compat/resources/custom.ts
4
4
  const OP_DELETE_TOOLKIT = generatedOperation("custom.deleteToolkit");
package/dist/effect.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { $ as ProjectRegenerateAPIKeyResponse, $n as ToolkitRetrieveChangelogResponse, $r as SessionCreateResponse, $t as McpCreateInstanceParams, A as ClankerCreateClaimResponse, An as TriggersTypeListParams, Ar as FileListResponse$1, At as LogRetrieveToolExecutionResponse, B as ConsumerListConnectedToolkitsParams, Bn as AuthConfigListParams, Br as ToolRetrieveEnumResponse, Ci as FileDeleteResponse, Cn as TriggerInstanceUpsertParams, Cr as ConnectedAccountRevokeResponse, D as OrgListResponse, Dn as ManageDeleteResponse, Dr as FileCreatePresignedURLParams, Dt as UsageRetrieveSummaryResponse, E as OrgListParams, Et as UsageRetrieveSummaryParams, F as UsageRetrieveSummaryResponse$1, Fr as ToolGetInputResponse, Ft as ToolRetrieveResponse$1, Gn as AuthConfigUpdateStatusParams, Gt as CliCreateSessionResponse, Hn as AuthConfigRetrieveResponse, Hr as ToolRetrieveRequiredScopesParams, Ht as CliCreateCodactFailureParams, Ii as APIErrorBody, In as AuthConfigCreateParams, Ir as ToolListParams, J as ProjectCreateResponse, Jn as ToolkitListParams, Jr as SessionAttachParams, Kn as AuthConfigUpdateStatusResponse, Kt as CliGetSessionParams, L as ProjectListParams$1, Ln as AuthConfigCreateResponse, Lr as ToolListResponse, Lt as TriggerListParams, M as UsageRetrieveParams$1, Mi as HeadersLike, Mn as TriggersTypeRetrieveEnumResponse, Mr as ToolExecuteParams, Mt as ToolListFieldsResponse, N as UsageRetrieveResponse$1, Nn as TriggersTypeRetrieveParams, Nr as ToolExecuteResponse, Nt as ToolListParams$1, On as ManageUpdateParams, Or as FileCreatePresignedURLResponse, Ot as LogCreateToolExecutionParams, P as UsageRetrieveSummaryParams$1, Pn as TriggersTypeRetrieveResponse, Pr as ToolGetInputParams, Pt as ToolListResponse$1, Q as ProjectListResponse, Qn as ToolkitRetrieveCategoriesResponse, Qr as SessionCreateParams, R as ProjectListResponse$1, Rn as AuthConfigDeleteParams, Rr as ToolProxyParams, Rt as TriggerListResponse, Si as FileDeleteParams, Sn as TriggerInstanceListActiveResponse, Sr as ConnectedAccountRetrieveResponse, Ti as FileListResponse, Tr as ConnectedAccountUpdateStatusResponse, Tt as UsageRetrieveResponse, U as ProjectResolveParams, Un as AuthConfigUpdateParams, Ur as ToolRetrieveRequiredScopesResponse, Ut as CliCreateCodactFailureResponse, V as ConsumerListConnectedToolkitsResponse, Vn as AuthConfigListResponse, Vr as ToolRetrieveParams, W as ProjectResolveResponse, Wn as AuthConfigUpdateResponse, Wr as ToolRetrieveResponse, Wt as CliCreateSessionParams, X as ProjectDeleteResponse, Xn as ToolkitRecommendScopesParams, Xr as SessionConfigHistoryParams, Xt as RealtimeAuthResponse, Y as ProjectDeleteParams, Yn as ToolkitListResponse, Yr as SessionAttachResponse, Yt as RealtimeAuthParams, Z as ProjectListParams, Zn as ToolkitRecommendScopesResponse, Zr as SessionConfigHistoryResponse, Zt as RealtimeCredentialsResponse, _ as CustomUpsertParams, _i as SessionToolsResponse, _n as GenerateURLResponse, _r as ConnectedAccountListResponse, _t as WebhookSubscriptionRetrieveResponse, ai as SessionLinkParams, an as McpDeleteResponse, ar as ToolkitRetrieveScopesGrantContextResponse, at as WebhookEndpointReplaceParams, b as ApiKeyRevocationCreateParams, bi as FileCreateUploadURLParams, bn as CustomCreateResponse, br as ConnectedAccountRefreshParams, bt as WebhookSubscriptionUpdateResponse, ci as SessionPatchResponse, cn as McpListParams, cr as LinkCreateParams, ct as WebhookEndpointUpdateParams, d as KeyringListTransferKeysResponse, di as SessionRetrieveResponse, dn as McpRetrieveAppResponse, dr as ConnectedAccountCompleteAuthResponse, dt as WebhookSubscriptionCreateParams, ei as SessionDeleteResponse, en as McpCreateInstanceResponse, er as ToolkitRetrieveMultiParams, et as ProjectRetrieveResponse, fi as SessionSearchParams, fn as McpRetrieveResponse, fr as ConnectedAccountCreateParams, ft as WebhookSubscriptionCreateResponse, g as CustomSyncResponse, gi as SessionToolsParams, gn as GenerateURLParams, gr as ConnectedAccountListParams, gt as WebhookSubscriptionListResponse, h as CustomSyncParams, hi as SessionToolkitsResponse, hr as ConnectedAccountDeleteResponse, ht as WebhookSubscriptionListParams, i as SessionConfigsRetrieveResponse, ii as SessionExecuteResponse, in as McpDeleteInstanceResponse, ir as ToolkitRetrieveScopesGrantContextParams, it as WebhookEndpointListResponse, ji as ClientIdentity, jn as TriggersTypeListResponse, k as ClankerCreateClaimParams, kn as ManageUpdateResponse, kr as FileListParams$1, kt as LogCreateToolExecutionResponse, li as SessionProxyExecuteParams, ln as McpListResponse, lr as LinkCreateResponse, lt as WebhookEndpointUpdateResponse, m as CustomDeleteToolkitResponse, mi as SessionToolkitsParams, mn as McpUpdateResponse, mr as ConnectedAccountDeleteParams, mt as WebhookSubscriptionListEventTypesResponse, n as SessionConfigsListParams, ni as SessionExecuteMetaResponse, nn as McpCreateResponse, nr as ToolkitRetrieveParams, nt as WebhookEndpointCreateResponse, oi as SessionLinkResponse, on as McpListInstancesParams, ot as WebhookEndpointReplaceResponse, p as CustomDeleteToolkitParams, pi as SessionSearchResponse, pn as McpUpdateParams, pr as ConnectedAccountCreateResponse, pt as WebhookSubscriptionDeleteResponse, q as ProjectCreateParams, qt as CliGetSessionResponse, r as SessionConfigsListResponse, ri as SessionExecuteParams, rn as McpDeleteInstanceParams, rr as ToolkitRetrieveResponse, rt as WebhookEndpointListParams, si as SessionPatchParams, sn as McpListInstancesResponse, st as WebhookEndpointRetrieveResponse, ti as SessionExecuteMetaParams, tn as McpCreateParams, tr as ToolkitRetrieveMultiResponse, tt as WebhookEndpointCreateParams, ui as SessionProxyExecuteResponse, un as McpRetrieveAppParams, ur as ConnectedAccountCompleteAuthParams, v as CustomUpsertResponse, vi as FileCreateDownloadURLParams, vr as ConnectedAccountPatchParams, vt as WebhookSubscriptionRotateSecretResponse, w as SessionRetrieveInfoResponse, wi as FileListParams, wn as TriggerInstanceUpsertResponse, wr as ConnectedAccountUpdateStatusParams, wt as UsageRetrieveParams, x as ApiKeyRevocationCreateResponse, xi as FileCreateUploadURLResponse, xn as TriggerInstanceListActiveParams, xr as ConnectedAccountRefreshResponse, yi as FileCreateDownloadURLResponse, yn as CustomCreateParams, yr as ConnectedAccountPatchResponse, yt as WebhookSubscriptionUpdateParams, zn as AuthConfigDeleteResponse, zr as ToolProxyResponse, zt as TriggerRetrieveResponse } from "./session-configs-nA6TL_i4.mjs";
2
- import { t as VERSION } from "./version-DUxhnnPj.mjs";
1
+ import { $ as ProjectRegenerateAPIKeyResponse, $i as HeadersLike, $n as ToolkitRetrieveChangelogResponse, $r as SessionCreateResponse, $t as McpCreateInstanceParams, A as ClankerCreateClaimResponse, Ai as AuthOf, An as TriggersTypeListParams, Ar as FileListResponse$1, At as LogRetrieveToolExecutionResponse, B as ConsumerListConnectedToolkitsParams, Bn as AuthConfigListParams, Br as ToolRetrieveEnumResponse, Ci as FileDeleteResponse, Cn as TriggerInstanceUpsertParams, Cr as ConnectedAccountRevokeResponse, D as OrgListResponse, Dn as ManageDeleteResponse, Dr as FileCreatePresignedURLParams, Dt as UsageRetrieveSummaryResponse, E as OrgListParams, Et as UsageRetrieveSummaryParams, F as UsageRetrieveSummaryResponse$1, Fr as ToolGetInputResponse, Ft as ToolRetrieveResponse$1, Gn as AuthConfigUpdateStatusParams, Gt as CliCreateSessionResponse, Hn as AuthConfigRetrieveResponse, Hr as ToolRetrieveRequiredScopesParams, Ht as CliCreateCodactFailureParams, In as AuthConfigCreateParams, Ir as ToolListParams, J as ProjectCreateResponse, Jn as ToolkitListParams, Jr as SessionAttachParams, Kn as AuthConfigUpdateStatusResponse, Kt as CliGetSessionParams, L as ProjectListParams$1, Li as APIErrorBody, Ln as AuthConfigCreateResponse, Lr as ToolListResponse, Lt as TriggerListParams, M as UsageRetrieveParams$1, Mn as TriggersTypeRetrieveEnumResponse, Mr as ToolExecuteParams, Mt as ToolListFieldsResponse, N as UsageRetrieveResponse$1, Ni as Scope, Nn as TriggersTypeRetrieveParams, Nr as ToolExecuteResponse, Nt as ToolListParams$1, Oi as AuthConstructors, On as ManageUpdateParams, Or as FileCreatePresignedURLResponse, Ot as LogCreateToolExecutionParams, P as UsageRetrieveSummaryParams$1, Pn as TriggersTypeRetrieveResponse, Pr as ToolGetInputParams, Pt as ToolListResponse$1, Q as ProjectListResponse, Qi as ClientIdentity, Qn as ToolkitRetrieveCategoriesResponse, Qr as SessionCreateParams, R as ProjectListResponse$1, Rn as AuthConfigDeleteParams, Rr as ToolProxyParams, Rt as TriggerListResponse, Si as FileDeleteParams, Sn as TriggerInstanceListActiveResponse, Sr as ConnectedAccountRetrieveResponse, Ti as FileListResponse, Tr as ConnectedAccountUpdateStatusResponse, Tt as UsageRetrieveResponse, U as ProjectResolveParams, Un as AuthConfigUpdateParams, Ur as ToolRetrieveRequiredScopesResponse, Ut as CliCreateCodactFailureResponse, V as ConsumerListConnectedToolkitsResponse, Vn as AuthConfigListResponse, Vr as ToolRetrieveParams, W as ProjectResolveResponse, Wn as AuthConfigUpdateResponse, Wr as ToolRetrieveResponse, Wt as CliCreateSessionParams, X as ProjectDeleteResponse, Xn as ToolkitRecommendScopesParams, Xr as SessionConfigHistoryParams, Xt as RealtimeAuthResponse, Y as ProjectDeleteParams, Yn as ToolkitListResponse, Yr as SessionAttachResponse, Yt as RealtimeAuthParams, Z as ProjectListParams, Zn as ToolkitRecommendScopesResponse, Zr as SessionConfigHistoryResponse, Zt as RealtimeCredentialsResponse, _ as CustomUpsertParams, _i as SessionToolsResponse, _n as GenerateURLResponse, _r as ConnectedAccountListResponse, _t as WebhookSubscriptionRetrieveResponse, ai as SessionLinkParams, an as McpDeleteResponse, ar as ToolkitRetrieveScopesGrantContextResponse, at as WebhookEndpointReplaceParams, b as ApiKeyRevocationCreateParams, bi as FileCreateUploadURLParams, bn as CustomCreateResponse, br as ConnectedAccountRefreshParams, bt as WebhookSubscriptionUpdateResponse, ci as SessionPatchResponse, cn as McpListParams, cr as LinkCreateParams, ct as WebhookEndpointUpdateParams, d as KeyringListTransferKeysResponse, di as SessionRetrieveResponse, dn as McpRetrieveAppResponse, dr as ConnectedAccountCompleteAuthResponse, dt as WebhookSubscriptionCreateParams, ei as SessionDeleteResponse, en as McpCreateInstanceResponse, er as ToolkitRetrieveMultiParams, et as ProjectRetrieveResponse, fi as SessionSearchParams, fn as McpRetrieveResponse, fr as ConnectedAccountCreateParams, ft as WebhookSubscriptionCreateResponse, g as CustomSyncResponse, gi as SessionToolsParams, gn as GenerateURLParams, gr as ConnectedAccountListParams, gt as WebhookSubscriptionListResponse, h as CustomSyncParams, hi as SessionToolkitsResponse, hr as ConnectedAccountDeleteResponse, ht as WebhookSubscriptionListParams, i as SessionConfigsRetrieveResponse, ii as SessionExecuteResponse, in as McpDeleteInstanceResponse, ir as ToolkitRetrieveScopesGrantContextParams, it as WebhookEndpointListResponse, ji as AutoCredentials, jn as TriggersTypeListResponse, k as ClankerCreateClaimParams, kn as ManageUpdateResponse, kr as FileListParams$1, kt as LogCreateToolExecutionResponse, li as SessionProxyExecuteParams, ln as McpListResponse, lr as LinkCreateResponse, lt as WebhookEndpointUpdateResponse, m as CustomDeleteToolkitResponse, mi as SessionToolkitsParams, mn as McpUpdateResponse, mr as ConnectedAccountDeleteParams, mt as WebhookSubscriptionListEventTypesResponse, n as SessionConfigsListParams, ni as SessionExecuteMetaResponse, nn as McpCreateResponse, nr as ToolkitRetrieveParams, nt as WebhookEndpointCreateResponse, oi as SessionLinkResponse, on as McpListInstancesParams, ot as WebhookEndpointReplaceResponse, p as CustomDeleteToolkitParams, pi as SessionSearchResponse, pn as McpUpdateParams, pr as ConnectedAccountCreateResponse, pt as WebhookSubscriptionDeleteResponse, q as ProjectCreateParams, qt as CliGetSessionResponse, r as SessionConfigsListResponse, ri as SessionExecuteParams, rn as McpDeleteInstanceParams, rr as ToolkitRetrieveResponse, rt as WebhookEndpointListParams, si as SessionPatchParams, sn as McpListInstancesResponse, st as WebhookEndpointRetrieveResponse, ti as SessionExecuteMetaParams, tn as McpCreateParams, tr as ToolkitRetrieveMultiResponse, tt as WebhookEndpointCreateParams, ui as SessionProxyExecuteResponse, un as McpRetrieveAppParams, ur as ConnectedAccountCompleteAuthParams, v as CustomUpsertResponse, vi as FileCreateDownloadURLParams, vr as ConnectedAccountPatchParams, vt as WebhookSubscriptionRotateSecretResponse, w as SessionRetrieveInfoResponse, wi as FileListParams, wn as TriggerInstanceUpsertResponse, wr as ConnectedAccountUpdateStatusParams, wt as UsageRetrieveParams, x as ApiKeyRevocationCreateResponse, xi as FileCreateUploadURLResponse, xn as TriggerInstanceListActiveParams, xr as ConnectedAccountRefreshResponse, yi as FileCreateDownloadURLResponse, yn as CustomCreateParams, yr as ConnectedAccountPatchResponse, yt as WebhookSubscriptionUpdateParams, zn as AuthConfigDeleteResponse, zr as ToolProxyResponse, zt as TriggerRetrieveResponse } from "./session-configs-x3OA4CSe.mjs";
2
+ import { t as VERSION } from "./version-DEAhxVwC.mjs";
3
3
  import { Context, Effect, Layer, Redacted, Stream } from "effect";
4
4
  import * as HttpClient from "effect/http/HttpClient";
5
5
  import * as Schema from "effect/Schema";
@@ -130,6 +130,18 @@ declare const isAPIError: (value: unknown) => value is APIStatusError;
130
130
  /** Whether a value is any error this surface produces. Structural, like {@link isAPIError}. */
131
131
  declare const isComposioError: (value: unknown) => value is ComposioError;
132
132
  //#endregion
133
+ //#region src/effect/credentials.d.ts
134
+ type Key = string | Redacted.Redacted<string>;
135
+ /**
136
+ * A key, or a function that returns one, as the Effect client takes it: a
137
+ * string or a `Redacted<string>`. A function is called once per call, after
138
+ * the call starts, and its key is reused across retries and same-origin
139
+ * redirects.
140
+ */
141
+ type Credential = Key | (() => Key | PromiseLike<Key>);
142
+ /** How the Effect client authenticates: `Auth.project(key)` and its siblings, with `Redacted` keys accepted. */
143
+ type Auth$2 = AuthOf<Credential>;
144
+ //#endregion
133
145
  //#region src/effect/decode.d.ts
134
146
  /**
135
147
  * What a client decodes with: an operation's public chain (`toolkits.list`) →
@@ -573,7 +585,7 @@ interface Session {
573
585
  //#endregion
574
586
  //#region src/effect/generated/resources/auth/auth.d.ts
575
587
  /** `client.auth` on the Effect surface. */
576
- interface Auth {
588
+ interface Auth$1 {
577
589
  readonly session: Session;
578
590
  }
579
591
  //#endregion
@@ -627,7 +639,7 @@ interface ClientResources {
627
639
  readonly webhookSubscriptions: WebhookSubscriptions;
628
640
  readonly webhookEndpoints: WebhookEndpoints;
629
641
  readonly org: Org;
630
- readonly auth: Auth;
642
+ readonly auth: Auth$1;
631
643
  readonly apiKeyRevocation: ApiKeyRevocation;
632
644
  readonly custom: Custom;
633
645
  readonly keyring: Keyring;
@@ -635,15 +647,30 @@ interface ClientResources {
635
647
  }
636
648
  //#endregion
637
649
  //#region src/effect/client.d.ts
638
- /** A credential as a caller supplies it: `null` means "none". */
639
- type Credential = string | Redacted.Redacted<string> | null | undefined;
650
+ /** How the client authenticates; a key may be a string, a `Redacted<string>`, or a function that returns either. */
651
+ type Auth = Auth$2;
652
+ /**
653
+ * The constructors of {@link Auth}, the same as the root entry's: `Auth.project(key)`,
654
+ * `Auth.user(key)`, `Auth.organization(key)`, `Auth.auto({ ... })` and
655
+ * `Auth.none()`. A key may be a string, a `Redacted<string>`, or a function
656
+ * that returns either.
657
+ */
658
+ declare const Auth: AuthConstructors<Credential>;
640
659
  interface ClientSettings {
641
- /** Project API key (`ApiKeyAuth`, `x-api-key`). */
642
- readonly apiKey?: Credential;
643
- /** User API key (`UserApiKeyAuth`, `x-user-api-key`), sent where an operation asks for it. */
644
- readonly userApiKey?: Credential;
645
- /** Organization API key (`OrgApiKeyAuth`, `x-org-api-key`), sent where an operation asks for it. */
646
- readonly orgApiKey?: Credential;
660
+ /**
661
+ * How the client authenticates. A fixed mode sends its credential on every
662
+ * request to the API origin; `Auth.auto` picks one per operation; with
663
+ * `Auth.none()` the credential header names are the caller's. While `auth`
664
+ * is not `none`, neither `defaultHeaders` nor a call's `headers` may name a
665
+ * credential header.
666
+ */
667
+ readonly auth: Auth;
668
+ /**
669
+ * The organization and project the client addresses, sent as `x-org-id` and
670
+ * `x-project-id`. While it is set, neither `defaultHeaders` nor a call's
671
+ * `headers` may name either header.
672
+ */
673
+ readonly scope?: Scope | undefined;
647
674
  /** The API origin. Defaults to `https://backend.composio.dev`. */
648
675
  readonly baseURL?: string | undefined;
649
676
  /**
@@ -699,7 +726,7 @@ interface ClientSettings {
699
726
  * ```ts
700
727
  * import { schemaLoaders } from '@composio/client/effect/schemas'
701
728
  *
702
- * make({ apiKey, decode: true, schemas: schemaLoaders }, httpClient)
729
+ * make({ auth: Auth.project(key), decode: true, schemas: schemaLoaders }, httpClient)
703
730
  * ```
704
731
  */
705
732
  type DecodingOptions = {
@@ -749,21 +776,25 @@ declare const make: (options: ComposioClientOptions, httpClient: HttpClient.Http
749
776
  * Provides the client from explicit options and the `HttpClient` in context.
750
777
  * Reads no environment variable.
751
778
  */
752
- declare const layer: (options?: ComposioClientOptions) => Layer.Layer<ComposioClient, ConfigurationError, HttpClient.HttpClient>;
779
+ declare const layer: (options: ComposioClientOptions) => Layer.Layer<ComposioClient, ConfigurationError, HttpClient.HttpClient>;
753
780
  /**
754
781
  * {@link layer} over a fetch-backed `HttpClient`, for an application that has
755
782
  * no transport of its own to supply. `fetch` is the platform's, or whatever
756
783
  * the `FetchHttpClient.Fetch` reference in context names.
757
784
  */
758
- declare const layerFetch: (options?: ComposioClientOptions) => Layer.Layer<ComposioClient, ConfigurationError>;
785
+ declare const layerFetch: (options: ComposioClientOptions) => Layer.Layer<ComposioClient, ConfigurationError>;
759
786
  /**
760
- * Provides the client from the `COMPOSIO_*` settings — `COMPOSIO_API_KEY`,
761
- * `COMPOSIO_USER_API_KEY`, `COMPOSIO_ORG_API_KEY`, `COMPOSIO_BASE_URL` and
762
- * `COMPOSIO_ALLOW_INSECURE_HTTP=1` — read through the `ConfigProvider` in
763
- * context, which is the process environment unless the application says
764
- * otherwise. An option given here wins over its setting; `null` for a
765
- * credential means "none", whatever is configured.
787
+ * Provides the client from the `COMPOSIO_*` settings, read through the
788
+ * `ConfigProvider` in context, which is the process environment unless the
789
+ * application says otherwise. `COMPOSIO_API_KEY`, `COMPOSIO_USER_API_KEY` and
790
+ * `COMPOSIO_ORG_API_KEY` become `auth` by the rule `Composio.fromEnv` applies
791
+ * (one set: that fixed mode; several: `Auth.auto`; none: `Auth.none()`), each
792
+ * key `Redacted` throughout; `COMPOSIO_BASE_URL` and
793
+ * `COMPOSIO_ALLOW_INSECURE_HTTP=1` are read too. `COMPOSIO_ORG_ID` and
794
+ * `COMPOSIO_PROJECT_ID` are not: `scope` is an argument. An option given here
795
+ * replaces the whole setting it names, so `{ auth: Auth.none() }` means none
796
+ * whatever is configured.
766
797
  */
767
- declare const layerConfig: (options?: ComposioClientOptions) => Layer.Layer<ComposioClient, ConfigurationError, HttpClient.HttpClient>;
798
+ declare const layerConfig: (overrides?: Partial<ClientSettings> & DecodingOptions) => Layer.Layer<ComposioClient, ConfigurationError, HttpClient.HttpClient>;
768
799
  //#endregion
769
- export { APIConnectionError, APIConnectionTimeoutError, APIError, type APIErrorBody, type APIErrorFields, type APIStatusError, AuthenticationError, BadRequestError, type ClientIdentity, ComposioClient, type ComposioClientOptions, type ComposioClientShape, type ComposioError, ConfigurationError, ConflictError, type Credential, DecodeError, type DecodeIssue, type DeprecationNotices, type HeadersLike, InternalServerError, NotFoundError, PermissionDeniedError, RateLimitError, type RawBodyRequestOptions, type RawRequestOptions, type RequestOptions, type SchemaLoaders, type Tracing, UnprocessableEntityError, VERSION, isAPIError, isComposioError, layer, layerConfig, layerFetch, make };
800
+ export { APIConnectionError, APIConnectionTimeoutError, APIError, type APIErrorBody, type APIErrorFields, type APIStatusError, Auth, AuthenticationError, type AutoCredentials, BadRequestError, type ClientIdentity, ComposioClient, type ComposioClientOptions, type ComposioClientShape, type ComposioError, ConfigurationError, ConflictError, type Credential, DecodeError, type DecodeIssue, type DeprecationNotices, type HeadersLike, InternalServerError, NotFoundError, PermissionDeniedError, RateLimitError, type RawBodyRequestOptions, type RawRequestOptions, type RequestOptions, type SchemaLoaders, type Scope, type Tracing, UnprocessableEntityError, VERSION, isAPIError, isComposioError, layer, layerConfig, layerFetch, make };