@darqlabs/curator-sdk 0.1.4 → 0.1.6

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 (52) hide show
  1. package/README.md +56 -42
  2. package/dist/cjs/client.d.ts +13 -0
  3. package/dist/cjs/client.d.ts.map +1 -1
  4. package/dist/cjs/client.js +30 -0
  5. package/dist/cjs/client.js.map +1 -1
  6. package/dist/cjs/errors.d.ts +17 -1
  7. package/dist/cjs/errors.d.ts.map +1 -1
  8. package/dist/cjs/errors.js +23 -1
  9. package/dist/cjs/errors.js.map +1 -1
  10. package/dist/cjs/index.d.ts +4 -3
  11. package/dist/cjs/index.d.ts.map +1 -1
  12. package/dist/cjs/index.js +5 -1
  13. package/dist/cjs/index.js.map +1 -1
  14. package/dist/cjs/integrations.d.ts +57 -0
  15. package/dist/cjs/integrations.d.ts.map +1 -0
  16. package/dist/cjs/integrations.js +85 -0
  17. package/dist/cjs/integrations.js.map +1 -0
  18. package/dist/cjs/streamEventParse.d.ts.map +1 -1
  19. package/dist/cjs/streamEventParse.js +19 -0
  20. package/dist/cjs/streamEventParse.js.map +1 -1
  21. package/dist/cjs/streamEvents.d.ts +37 -2
  22. package/dist/cjs/streamEvents.d.ts.map +1 -1
  23. package/dist/cjs/streamEvents.js +1 -0
  24. package/dist/cjs/streamEvents.js.map +1 -1
  25. package/dist/cjs/types.d.ts +31 -2
  26. package/dist/cjs/types.d.ts.map +1 -1
  27. package/dist/esm/client.d.ts +13 -0
  28. package/dist/esm/client.d.ts.map +1 -1
  29. package/dist/esm/client.js +31 -1
  30. package/dist/esm/client.js.map +1 -1
  31. package/dist/esm/errors.d.ts +17 -1
  32. package/dist/esm/errors.d.ts.map +1 -1
  33. package/dist/esm/errors.js +21 -0
  34. package/dist/esm/errors.js.map +1 -1
  35. package/dist/esm/index.d.ts +4 -3
  36. package/dist/esm/index.d.ts.map +1 -1
  37. package/dist/esm/index.js +2 -1
  38. package/dist/esm/index.js.map +1 -1
  39. package/dist/esm/integrations.d.ts +57 -0
  40. package/dist/esm/integrations.d.ts.map +1 -0
  41. package/dist/esm/integrations.js +80 -0
  42. package/dist/esm/integrations.js.map +1 -0
  43. package/dist/esm/streamEventParse.d.ts.map +1 -1
  44. package/dist/esm/streamEventParse.js +19 -0
  45. package/dist/esm/streamEventParse.js.map +1 -1
  46. package/dist/esm/streamEvents.d.ts +37 -2
  47. package/dist/esm/streamEvents.d.ts.map +1 -1
  48. package/dist/esm/streamEvents.js +1 -0
  49. package/dist/esm/streamEvents.js.map +1 -1
  50. package/dist/esm/types.d.ts +31 -2
  51. package/dist/esm/types.d.ts.map +1 -1
  52. package/package.json +1 -1
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  Official Curator SDK.
4
4
 
5
+ > **Beta.** The Curator SDKs are in beta. APIs and behavior may change in future versions, including breaking changes to existing behavior, until a 1.0 release. Pin an exact version and review the release notes before upgrading.
6
+
5
7
  Integrate with your deployed agents. Works in Node, the browser, and modern edge runtimes (anywhere `fetch` exists).
6
8
 
7
9
  ```ts
@@ -17,7 +19,7 @@ const reply = await curator.agent("support-bot").run("How do I reset my password
17
19
 
18
20
  You'll need three things from your Curator dashboard:
19
21
 
20
- 1. **An API key.** Generate one at **Settings → Developer**. Each key is scoped to a single environment (production, staging, or development) pick the one you're integrating against.
22
+ 1. **An API key.** Generate one at **Settings → Developer**. Each key is scoped to a single environment (production, staging, or development), pick the one you're integrating against.
21
23
  2. **Your project slug.**
22
24
  3. **A deployed agent's identifier slug.**
23
25
 
@@ -31,7 +33,7 @@ pnpm add @darqlabs/curator-sdk
31
33
  yarn add @darqlabs/curator-sdk
32
34
  ```
33
35
 
34
- Requires Node 18+ or any runtime with a global `fetch`. Ships ESM + CommonJS modern bundlers tree-shake it automatically.
36
+ Requires Node 18+ or any runtime with a global `fetch`. Ships ESM + CommonJS, modern bundlers tree-shake it automatically.
35
37
 
36
38
  ### 2. Initialize the client
37
39
 
@@ -54,13 +56,13 @@ For a single round-trip, use `agent.run()`:
54
56
  ```ts
55
57
  const reply = await curator
56
58
  .agent("support-bot")
57
- .run("Hi, I lost my receipt can you resend it for order #4823?")
59
+ .run("Hi, I lost my receipt, can you resend it for order #4823?")
58
60
 
59
61
  console.log(reply.content)
60
- // reply.conversationId store this if you want to follow up
61
- // reply.runId useful for log correlation
62
- // reply.sequence per-conversation message index
63
- // reply.metadata structured result from the agent, or null (see below)
62
+ // reply.conversationId, store this if you want to follow up
63
+ // reply.runId, useful for log correlation
64
+ // reply.sequence, per-conversation message index
65
+ // reply.metadata, structured result from the agent, or null (see below)
64
66
  ```
65
67
 
66
68
  ### 4. Multi-turn conversations
@@ -116,7 +118,7 @@ try {
116
118
  } catch (err) {
117
119
  if (err instanceof CuratorApprovalRequiredError) {
118
120
  // The agent paused waiting for human approval. Resolution happens in
119
- // the Curator dashboard surface a friendly message to your user.
121
+ // the Curator dashboard, surface a friendly message to your user.
120
122
  showToUser(
121
123
  `That action needs administrator approval. Please contact your ` +
122
124
  `administrator to review the request for "${err.approval.tool_name}".`,
@@ -126,15 +128,15 @@ try {
126
128
  // Either give the user a "still thinking…" message, or keep waiting:
127
129
  const reply = await err.continueWaiting(180000)
128
130
  } else if (err instanceof CuratorAgentError) {
129
- // Terminal agent failure LLM quota, provider auth, etc.
131
+ // Terminal agent failure, LLM quota, provider auth, etc.
130
132
  // err.failureClass is one of: provider_quota_exhausted | provider_auth |
131
133
  // provider_bad_request | provider_rate_limited | provider_unavailable |
132
134
  // internal | unknown. err.isPermanent tells you whether retrying helps.
133
135
  log.error({ err }, "agent run failed")
134
136
  } else if (err instanceof CuratorAuthError) {
135
- // 401 bad / revoked API key.
137
+ // 401, bad / revoked API key.
136
138
  } else if (err instanceof CuratorNotFoundError) {
137
- // 404 wrong deployment slug, project, or conversation id.
139
+ // 404, wrong deployment slug, project, or conversation id.
138
140
  } else {
139
141
  throw err
140
142
  }
@@ -159,7 +161,7 @@ const reply = await chat.send("What does this CSV show?", {
159
161
  })
160
162
  ```
161
163
 
162
- **Two-step** useful when you want to drive the PUT yourself (progress UI, resumable uploads, custom transport):
164
+ **Two-step:** useful when you want to drive the PUT yourself (progress UI, resumable uploads, custom transport):
163
165
 
164
166
  ```ts
165
167
  const { uploadUrl, headers, fileReference } = await curator.files.createUpload({
@@ -205,18 +207,18 @@ const reply = await chat.send("Do a deep research pass on this brief.", {
205
207
 
206
208
  ### Structured results (`metadata`)
207
209
 
208
- An agent whose instructions define a structured output a booking draft, an extracted form, a plan returns that object on `reply.metadata` alongside the conversational `reply.content`. It's `null` for plain conversational agents. The shape is whatever the agent emits (schema-agnostic); validate it in your app (e.g. with a zod schema).
210
+ An agent whose instructions define a structured output (an itinerary draft, an extracted form, a plan) returns that object on `reply.metadata` alongside the conversational `reply.content`. It's `null` for plain conversational agents. The shape is whatever the agent emits (schema-agnostic); validate it in your app (e.g. with a zod schema).
209
211
 
210
212
  ```ts
211
- const reply = await chat.send("Book Acme from Fontana to Ontario on July 1.")
212
- console.log(reply.content) // "I've started the booking draft…"
213
- console.log(reply.metadata) // { bookingDraft: { origin: {…}, }, changedFields: [...], clarification: null }
213
+ const reply = await chat.send("Plan 3 days in Kyoto in April, focused on temples.")
214
+ console.log(reply.content) // "I've sketched a 3-day Kyoto itinerary…"
215
+ console.log(reply.metadata) // { itinerary: { destination: "Kyoto", days: [...] }, changedFields: [...], clarification: null }
214
216
  ```
215
217
 
216
- **Live updates:** `chat.send()` returns only the final snapshot. To render progress as the agent fills the object in turn by turn, before it replies stream instead and handle `state` events:
218
+ **Live updates:** `chat.send()` returns only the final snapshot. To render progress as the agent fills the object in (turn by turn, before it replies), stream instead and handle `state` events:
217
219
 
218
220
  ```ts
219
- for await (const event of chat.stream("Book Acme from Fontana to Ontario.")) {
221
+ for await (const event of chat.stream("Plan 3 days in Kyoto in April.")) {
220
222
  if (event.type === "delta") appendText(event.text) // prose tokens
221
223
  else if (event.type === "state") renderDraft(event.metadata) // live structured snapshot, every turn
222
224
  else if (event.type === "done") finalize(event.message) // message.metadata = final snapshot
@@ -235,9 +237,9 @@ Using React? `@darqlabs/curator-sdk-react`'s `<CuratorChat onState={…} />` wir
235
237
 
236
238
  ## Optional: verified end-user identity
237
239
 
238
- **You don't need this to get started.** An API key + project is all it takes to talk to your agents everything above works without any user-level identity.
240
+ **You don't need this to get started.** An API key + project is all it takes to talk to your agents. Everything above works without any user-level identity.
239
241
 
240
- Turn this on only when you want Curator to know *which* of your users is driving a conversation for per-user policies, audit attribution, or tenant isolation. It's opt-in per org: until an operator enables it in **Settings → Developer → End-user auth**, the SDK ignores `endUserJwt` entirely and requests authenticate on the API key alone.
242
+ Turn this on only when you want Curator to know *which* of your users is driving a conversation, for per-user policies, audit attribution, or tenant isolation. It's opt-in per org: until an operator enables it in **Settings → Developer → End-user auth**, the SDK ignores `endUserJwt` entirely and requests authenticate on the API key alone.
241
243
 
242
244
  When enabled, your backend mints a short-lived JWT per user and hands it to the SDK. The server verifies it against your configured JWKS endpoint:
243
245
 
@@ -250,7 +252,7 @@ const curator = new Curator({
250
252
  })
251
253
  ```
252
254
 
253
- Standing up a JWKS endpoint is **not required for MVP** skip this section and revisit it when you need verified identity.
255
+ Standing up a JWKS endpoint is **not required for MVP**. Skip this section and revisit it when you need verified identity.
254
256
 
255
257
  ---
256
258
 
@@ -260,14 +262,14 @@ Standing up a JWKS endpoint is **not required for MVP** — skip this section an
260
262
 
261
263
  | Option | Type | Default | Notes |
262
264
  | --- | --- | --- | --- |
263
- | `apiKey` | `string` | | Required. `curator_live_*` (production) or `curator_test_*` (staging / development), from Settings → Developer. |
264
- | `project` | `string` | | Default project slug. Required unless every call passes `{ system: true }`. |
265
+ | `apiKey` | `string` | - | Required. `curator_live_*` (production) or `curator_test_*` (staging / development), from Settings → Developer. |
266
+ | `project` | `string` | - | Default project slug. Required unless every call passes `{ system: true }`. |
265
267
  | `environment` | `'production' \| 'staging' \| 'development'` | `'production'` | Default environment. Must match the environment your `apiKey` was issued for. |
266
268
  | `baseUrl` | `string` | managed host | Override for self-hosted. |
267
269
  | `defaultTimeoutMs` | `number` | `120000` | Server-capped at `300000`. |
268
270
  | `defaultHeaders` | `Record<string,string>` | `{}` | Sent on every request. |
269
271
  | `fetch` | `typeof fetch` | global | Inject a custom fetch. |
270
- | `endUserJwt` | `string \| () => string \| Promise<string>` | | **Optional.** Only needed if your org has turned on verified end-user identity (see below). Leave it unset otherwise. |
272
+ | `endUserJwt` | `string \| () => string \| Promise<string>` | - | **Optional.** Only needed if your org has turned on verified end-user identity (see below). Leave it unset otherwise. |
271
273
 
272
274
  ### `curator.agent(slug, locator?)`
273
275
 
@@ -287,8 +289,8 @@ Reattach to an existing conversation by id.
287
289
 
288
290
  ### `chat.send(content, opts?) → Promise<AssistantMessage>`
289
291
 
290
- `opts.files?: FileAttachment[]` attachments.
291
- `opts.timeoutMs?: number` override the wait timeout for this call.
292
+ `opts.files?: FileAttachment[]`, attachments.
293
+ `opts.timeoutMs?: number`, override the wait timeout for this call.
292
294
 
293
295
  Returns the final assistant message. `message.metadata` holds the agent's structured result (or `null`).
294
296
 
@@ -298,19 +300,31 @@ Same send, streamed. Yields events as they arrive:
298
300
 
299
301
  | `event.type` | Payload | Terminal |
300
302
  | --- | --- | --- |
301
- | `delta` | `text` incremental prose tokens | no |
302
- | `state` | `metadata` complete structured snapshot for this turn | no |
303
+ | `delta` | `text`, incremental prose tokens | no |
304
+ | `state` | `metadata`, complete structured snapshot for this turn | no |
305
+ | `plan_progress` | `phase`, `message`, `completed`/`total`, `labels` | no |
303
306
  | `tool_call.started` / `tool_call.completed` | tool call id / name | no |
304
307
  | `done` | `message` (with `message.metadata`) | yes |
305
308
  | `error` | `failureClass`, `message` | yes |
306
309
  | `paused_for_approval` | `approval` | yes |
307
310
 
308
- `state` fires on every turn the agent reports structured state see [Structured results](#structured-results-metadata).
311
+ `state` fires on every turn the agent reports structured state, see [Structured results](#structured-results-metadata).
312
+
313
+ `plan_progress` fires for **planned** agents (ones that decompose a request into a task plan). It reports coarse progress through `phase` (`planning` → `executing` → `finalizing`) with a user-facing `message` (e.g. "Working on 3 tasks") and, once tasks are running, `completed`/`total`. A planned run is otherwise quiet until the finalizer streams `delta`s, so handle this to show progress while it works:
314
+
315
+ ```ts
316
+ for await (const event of chat.stream("Research our top 5 competitors")) {
317
+ if (event.type === "delta") appendText(event.text)
318
+ else if (event.type === "plan_progress") setStatus(event.message) // "Planning the work…", "Completed 2 of 5"
319
+ }
320
+ ```
321
+
322
+ Non-planned agents never emit it, so it's always safe to ignore.
309
323
 
310
324
  ### `chat.history(opts?) → Promise<HistoryPage>`
311
325
 
312
- `opts.limit?: number` page size (server cap 500).
313
- `opts.beforeSequence?: number` cursor; pass `page.oldestSequence` from the previous page.
326
+ `opts.limit?: number`, page size (server cap 500).
327
+ `opts.beforeSequence?: number`, cursor; pass `page.oldestSequence` from the previous page.
314
328
 
315
329
  ### `chat.id`
316
330
 
@@ -328,26 +342,26 @@ Two-step: returns `{ uploadUrl, method, headers, expiresAt, fileReference }`. PU
328
342
 
329
343
  | Class | Thrown when |
330
344
  | --- | --- |
331
- | `CuratorAuthError` | 401 bad / revoked API key. |
332
- | `CuratorForbiddenError` | 403 permission denied. |
333
- | `CuratorNotFoundError` | 404 unknown deployment / conversation. |
334
- | `CuratorDeploymentRetiredError` | 410 deployment retired. |
335
- | `CuratorRateLimitError` | 429 back off. |
345
+ | `CuratorAuthError` | 401: bad / revoked API key. |
346
+ | `CuratorForbiddenError` | 403: permission denied. |
347
+ | `CuratorNotFoundError` | 404: unknown deployment / conversation. |
348
+ | `CuratorDeploymentRetiredError` | 410: deployment retired. |
349
+ | `CuratorRateLimitError` | 429: back off. |
336
350
  | `CuratorApprovalRequiredError` | Run paused for human approval. |
337
351
  | `CuratorAgentError` | Terminal agent failure (LLM quota, etc.). `failureClass` + `isPermanent`. |
338
352
  | `CuratorTimeoutError` | Wait expired. `continueWaiting()` resumes. |
339
- | `CuratorError` | Base class everything above extends this. |
353
+ | `CuratorError` | Base class; everything above extends this. |
340
354
 
341
355
  ---
342
356
 
343
357
  ## Troubleshooting
344
358
 
345
- **`CuratorAuthError: Invalid or revoked API key`** double-check the key in **Settings → Developer**. The SDK sends it as `Authorization: Bearer <key>`.
359
+ **`CuratorAuthError: Invalid or revoked API key`**, double-check the key in **Settings → Developer**. The SDK sends it as `Authorization: Bearer <key>`.
346
360
 
347
- **`CuratorNotFoundError: Deployment not found`** verify (project slug, environment, deployment slug) all match what the **Deployments** tab shows. Missing one of these is the #1 cause.
361
+ **`CuratorNotFoundError: Deployment not found`**, verify (project slug, environment, deployment slug) all match what the **Deployments** tab shows. Missing one of these is the #1 cause.
348
362
 
349
- **`CuratorTimeoutError` on every call** your agent is taking longer than `defaultTimeoutMs`. Raise the timeout (`new Curator({ defaultTimeoutMs: 300000 })`) or call `err.continueWaiting()` once.
363
+ **`CuratorTimeoutError` on every call**, your agent is taking longer than `defaultTimeoutMs`. Raise the timeout (`new Curator({ defaultTimeoutMs: 300000 })`) or call `err.continueWaiting()` once.
350
364
 
351
- **Browser requests fail with a CORS error** add your origin to the allowlist in **Settings → Developer**. The SDK isn't doing anything unusual; the request gets blocked before it reaches Curator.
365
+ **Browser requests fail with a CORS error**, add your origin to the allowlist in **Settings → Developer**. The SDK isn't doing anything unusual; the request gets blocked before it reaches Curator.
352
366
 
353
- **Approval-required pauses on every send** your agent has tools that require human approval. Resolve them once in the dashboard and adjust the deployment's policy if you don't want this gate in your environment.
367
+ **Approval-required pauses on every send**, your agent has tools that require human approval. Resolve them once in the dashboard and adjust the deployment's policy if you don't want this gate in your environment.
@@ -19,6 +19,7 @@
19
19
  * to contact an administrator, who handles it in the dashboard.
20
20
  */
21
21
  import { Files } from "./files.js";
22
+ import { Integrations } from "./integrations.js";
22
23
  import { HttpClient, type DeploymentRoute, type EndUserJwtProvider } from "./http.js";
23
24
  import type { StreamEvent } from "./streamEvents.js";
24
25
  import type { AssistantMessage, DeploymentConfig, Environment, HistoryOptions, HistoryPage, SendOptions } from "./types.js";
@@ -67,6 +68,8 @@ export declare class Curator {
67
68
  private readonly defaultTimeoutMs;
68
69
  /** File-upload surface — see {@link Files}. */
69
70
  readonly files: Files;
71
+ /** End-user integration connect surface — see {@link Integrations}. */
72
+ readonly integrations: Integrations;
70
73
  constructor(opts: CuratorOptions);
71
74
  /**
72
75
  * Address an agent deployment by its slug. Project / environment fall
@@ -133,6 +136,9 @@ export declare class Chat {
133
136
  * Throws:
134
137
  * - CuratorApprovalRequiredError if the run pauses for HITL (an
135
138
  * administrator must resolve it in the dashboard)
139
+ * - CuratorAuthorizationRequiredError if the run pauses for a
140
+ * delegated-user connect (send the user to `connect_url`, then
141
+ * call `chat.authorize()` to resume)
136
142
  * - CuratorAgentError on terminal agent failure
137
143
  * - CuratorTimeoutError if the wait expires (the run keeps running)
138
144
  */
@@ -156,6 +162,13 @@ export declare class Chat {
156
162
  stream(content: string, opts?: SendOptions): AsyncGenerator<StreamEvent, void, void>;
157
163
  /** Fetch (paginated) conversation history. */
158
164
  history(opts?: HistoryOptions): Promise<HistoryPage>;
165
+ /**
166
+ * Resume a conversation paused on a delegated-user connect pause
167
+ * (see {@link CuratorAuthorizationRequiredError}), after the end user has
168
+ * connected the provider at `authorization.connect_url`. Safe to call again
169
+ * if the connection is still insufficient — the run simply re-pauses.
170
+ */
171
+ authorize(): Promise<void>;
159
172
  private createConversation;
160
173
  /**
161
174
  * Continue waiting for the next terminal state on an already-running
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAQH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,KAAK,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAGrF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAEpD,OAAO,KAAK,EAEV,gBAAgB,EAEhB,gBAAgB,EA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OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAQ;IACzC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAiB;IACvC,OAAO,CAAC,cAAc,CAAe;IACrC,6DAA6D;IAC7D,OAAO,CAAC,aAAa,CAA+B;IAEpD,gBAAgB;gBAEd,IAAI,EAAE,UAAU,EAChB,gBAAgB,EAAE,MAAM,EACxB,KAAK,EAAE,eAAe,EACtB,qBAAqB,EAAE,MAAM,GAAG,IAAI;IAQtC;;;;OAIG;IACH,IAAI,EAAE,IAAI,MAAM,GAAG,IAAI,CAEtB;IAED,yDAAyD;IACnD,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC;IASjC;;;;;;;;;;;;OAYG;IACG,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA4B9E;;;;;;;;;;;;;;;OAeG;IACI,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,WAAgB,GAAG,cAAc,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,CAAC;IAoC/F,8CAA8C;IACxC,OAAO,CAAC,IAAI,GAAE,cAAmB,GAAG,OAAO,CAAC,WAAW,CAAC;IAuC9D;;;;;OAKG;IACG,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;YAclB,kBAAkB;IAchC;;;;;;;;;OASG;YACW,gBAAgB;YA8BhB,cAAc;IAc5B,OAAO,CAAC,iBAAiB;CAmE1B"}
@@ -23,6 +23,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
23
23
  exports.Chat = exports.Agent = exports.Curator = void 0;
24
24
  const errors_js_1 = require("./errors.js");
25
25
  const files_js_1 = require("./files.js");
26
+ const integrations_js_1 = require("./integrations.js");
26
27
  const http_js_1 = require("./http.js");
27
28
  const sse_js_1 = require("./sse.js");
28
29
  const streamEventParse_js_1 = require("./streamEventParse.js");
@@ -36,6 +37,8 @@ class Curator {
36
37
  defaultTimeoutMs;
37
38
  /** File-upload surface — see {@link Files}. */
38
39
  files;
40
+ /** End-user integration connect surface — see {@link Integrations}. */
41
+ integrations;
39
42
  constructor(opts) {
40
43
  const baseUrl = opts.baseUrl ?? DEFAULT_BASE_URL;
41
44
  // Same bind-to-host dance as HttpClient — needed because the bare
@@ -54,6 +57,7 @@ class Curator {
54
57
  this.defaultEnvironment = opts.environment ?? "production";
55
58
  this.defaultTimeoutMs = opts.defaultTimeoutMs ?? DEFAULT_TIMEOUT_MS;
56
59
  this.files = new files_js_1.Files(this.http, stripTrailingSlash(baseUrl), fetchImpl);
60
+ this.integrations = new integrations_js_1.Integrations(this.http, stripTrailingSlash(baseUrl));
57
61
  }
58
62
  /**
59
63
  * Address an agent deployment by its slug. Project / environment fall
@@ -173,6 +177,9 @@ class Chat {
173
177
  * Throws:
174
178
  * - CuratorApprovalRequiredError if the run pauses for HITL (an
175
179
  * administrator must resolve it in the dashboard)
180
+ * - CuratorAuthorizationRequiredError if the run pauses for a
181
+ * delegated-user connect (send the user to `connect_url`, then
182
+ * call `chat.authorize()` to resume)
176
183
  * - CuratorAgentError on terminal agent failure
177
184
  * - CuratorTimeoutError if the wait expires (the run keeps running)
178
185
  */
@@ -265,6 +272,18 @@ class Chat {
265
272
  totalMessageCount: envelope.data.message_count,
266
273
  };
267
274
  }
275
+ /**
276
+ * Resume a conversation paused on a delegated-user connect pause
277
+ * (see {@link CuratorAuthorizationRequiredError}), after the end user has
278
+ * connected the provider at `authorization.connect_url`. Safe to call again
279
+ * if the connection is still insufficient — the run simply re-pauses.
280
+ */
281
+ async authorize() {
282
+ if (!this.conversationId) {
283
+ throw new errors_js_1.CuratorError("Cannot authorize before the conversation exists.");
284
+ }
285
+ await this.http.request(`${this.http.deploymentBase(this.route)}/conversations/${encodeURIComponent(this.conversationId)}/authorize`, { method: "POST" });
286
+ }
268
287
  // ── internals ────────────────────────────────────────────────────
269
288
  async createConversation() {
270
289
  const envelope = await this.http.request(`${this.http.deploymentBase(this.route)}/conversations`, {
@@ -346,6 +365,17 @@ class Chat {
346
365
  runId: run_id,
347
366
  });
348
367
  }
368
+ case "paused_for_authorization": {
369
+ const authorization = data.authorization;
370
+ if (!authorization) {
371
+ throw new errors_js_1.CuratorError("Server returned `paused_for_authorization` without authorization payload.");
372
+ }
373
+ throw new errors_js_1.CuratorAuthorizationRequiredError({
374
+ authorization,
375
+ conversationId: conversation_id,
376
+ runId: run_id,
377
+ });
378
+ }
349
379
  case "errored": {
350
380
  const err = data.error;
351
381
  if (!err) {
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,2CAKoB;AACpB,yCAAkC;AAClC,uCAAqF;AACrF,qCAAyC;AACzC,+DAA0D;AAE1D,uDAAyD;AA+EzD,MAAM,gBAAgB,GAAG,yBAAyB,CAAA;AAClD,MAAM,kBAAkB,GAAG,OAAO,CAAA;AAElC,MAAa,OAAO;IACD,IAAI,CAAY;IAChB,cAAc,CAAS;IACvB,kBAAkB,CAAa;IAC/B,gBAAgB,CAAQ;IACzC,+CAA+C;IACtC,KAAK,CAAO;IAErB,YAAY,IAAoB;QAC9B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,gBAAgB,CAAA;QAChD,kEAAkE;QAClE,qEAAqE;QACrE,0EAA0E;QAC1E,MAAM,WAAW,GAAG,UAAU,CAAC,KAAK,CAAA;QACpC,MAAM,SAAS,GACb,IAAI,CAAC,KAAK,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAE,SAAqC,CAAC,CAAA;QACrG,IAAI,CAAC,IAAI,GAAG,IAAI,oBAAU,CAAC;YACzB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,OAAO;YACP,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,UAAU,E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KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAA;AAC1D,CAAC;AAED,SAAS,kBAAkB,CAAC,CAAS;IACnC,OAAO,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;AAC9B,CAAC"}
@@ -8,7 +8,7 @@
8
8
  * `CuratorError` so a single `catch (err: CuratorError)` works as a
9
9
  * backstop.
10
10
  */
11
- import type { AssistantMessage, ApprovalDetails, AgentFailureClass } from "./types.js";
11
+ import type { AssistantMessage, ApprovalDetails, AuthorizationDetails, AgentFailureClass } from "./types.js";
12
12
  export declare class CuratorError extends Error {
13
13
  constructor(message: string, options?: {
14
14
  cause?: unknown;
@@ -53,6 +53,22 @@ export declare class CuratorApprovalRequiredError extends CuratorError {
53
53
  runId: string;
54
54
  });
55
55
  }
56
+ /**
57
+ * Run paused because the end user must connect an external provider (e.g.
58
+ * Gmail) before a delegated-user tool can run. Unlike approval, this is
59
+ * self-resolvable: send the user to `authorization.connect_url`, then call
60
+ * `chat.authorize()` (or POST /conversations/:id/authorize) to resume.
61
+ */
62
+ export declare class CuratorAuthorizationRequiredError extends CuratorError {
63
+ readonly authorization: AuthorizationDetails;
64
+ readonly conversationId: string;
65
+ readonly runId: string;
66
+ constructor(args: {
67
+ authorization: AuthorizationDetails;
68
+ conversationId: string;
69
+ runId: string;
70
+ });
71
+ }
56
72
  /**
57
73
  * The agent run reached a terminal error state (LLM quota, auth, 5xx
58
74
  * exhausted retries, etc.). `failureClass` and `isPermanent` mirror the
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEtF,qBAAa,YAAa,SAAQ,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AAA;gBAElB,IAAI,EAAE;QAChB,OAAO,EAAE,MAAM,CAAA;QACf,YAAY,EAAE,iBAAiB,CAAA;QAC/B,WAAW,EAAE,OAAO,CAAA;QACpB,cAAc,EAAE,MAAM,CAAA;QACtB,KAAK,EAAE,MAAM,CAAA;QACb,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KACvB;CASF;AAED;;;;GAIG;AACH,qBAAa,mBAAoB,SAAQ,YAAY;IACnD,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,eAAe,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAA;gBAE/D,IAAI,EAAE;QAChB,cAAc,EAAE,MAAM,CAAA;QACtB,KAAK,EAAE,MAAM,CAAA;QACb,eAAe,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAA;KACnE;CAOF"}
@@ -10,7 +10,7 @@
10
10
  * backstop.
11
11
  */
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.CuratorTimeoutError = exports.CuratorAgentError = exports.CuratorApprovalRequiredError = exports.CuratorRateLimitError = exports.CuratorDeploymentRetiredError = exports.CuratorNotFoundError = exports.CuratorForbiddenError = exports.CuratorAuthError = exports.CuratorError = void 0;
13
+ exports.CuratorTimeoutError = exports.CuratorAgentError = exports.CuratorAuthorizationRequiredError = exports.CuratorApprovalRequiredError = exports.CuratorRateLimitError = exports.CuratorDeploymentRetiredError = exports.CuratorNotFoundError = exports.CuratorForbiddenError = exports.CuratorAuthError = exports.CuratorError = void 0;
14
14
  class CuratorError extends Error {
15
15
  constructor(message, options) {
16
16
  super(message);
@@ -88,6 +88,28 @@ class CuratorApprovalRequiredError extends CuratorError {
88
88
  }
89
89
  }
90
90
  exports.CuratorApprovalRequiredError = CuratorApprovalRequiredError;
91
+ /**
92
+ * Run paused because the end user must connect an external provider (e.g.
93
+ * Gmail) before a delegated-user tool can run. Unlike approval, this is
94
+ * self-resolvable: send the user to `authorization.connect_url`, then call
95
+ * `chat.authorize()` (or POST /conversations/:id/authorize) to resume.
96
+ */
97
+ class CuratorAuthorizationRequiredError extends CuratorError {
98
+ authorization;
99
+ conversationId;
100
+ runId;
101
+ constructor(args) {
102
+ super(`Run paused for authorization — connect ${args.authorization.provider} to continue. ` +
103
+ (args.authorization.connect_url
104
+ ? `Connect at ${args.authorization.connect_url}, then resume the conversation.`
105
+ : "Connect the provider, then resume the conversation."));
106
+ this.name = "CuratorAuthorizationRequiredError";
107
+ this.authorization = args.authorization;
108
+ this.conversationId = args.conversationId;
109
+ this.runId = args.runId;
110
+ }
111
+ }
112
+ exports.CuratorAuthorizationRequiredError = CuratorAuthorizationRequiredError;
91
113
  /**
92
114
  * The agent run reached a terminal error state (LLM quota, auth, 5xx
93
115
  * exhausted retries, etc.). `failureClass` and `isPermanent` mirror the
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAIH,MAAa,YAAa,SAAQ,KAAK;IACrC,YAAY,OAAe,EAAE,OAA6B;QACxD,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,cAAc,CAAA;QAC1B,4DAA4D;QAC5D,IAAI,OAAO,EAAE,KAAK,KAAK,SAAS,EAAE,CAAC;YACjC,CAAC;YAAC,IAA4B,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAA;QACtD,CAAC;IACH,CAAC;CACF;AATD,oCASC;AAED,4EAA4E;AAC5E,MAAa,gBAAiB,SAAQ,YAAY;IAChD,YAAY,OAAO,GAAG,4BAA4B;QAChD,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAA;IAChC,CAAC;CACF;AALD,4CAKC;AAED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,YAAY,CAAmB;IAC/B,WAAW,CAAS;IACpB,cAAc,CAAQ;IACtB,KAAK,CAAQ;IACb,MAAM,CAAe;IAE9B,YAAY,IAOX;QACC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QACnB,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAA;QAC/B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAA;QACrC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAA;QACnC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAA;QACzC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACvB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAA;IACnC,CAAC;CACF;AAvBD,8CAuBC;AAED;;;;GAIG;AACH,MAAa,mBAAoB,SAAQ,YAAY;IAC1C,cAAc,CAAQ;IACtB,KAAK,CAAQ;IACb,eAAe,CAAmD;IAE3E,YAAY,IAIX;QACC,KAAK,CAAC,0EAA0E,CAAC,CAAA;QACjF,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAA;QACjC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAA;QACzC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACvB,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAA;IAC7C,CAAC;CACF;AAhBD,kDAgBC"}
@@ -3,8 +3,9 @@ export type { CuratorOptions, AgentLocator } from "./client.js";
3
3
  export type { EndUserJwtProvider } from "./http.js";
4
4
  export { Files } from "./files.js";
5
5
  export type { PresignUploadInput, PresignUploadResult, OneShotUploadInput, UploadData, } from "./files.js";
6
- export { CuratorError, CuratorAuthError, CuratorForbiddenError, CuratorNotFoundError, CuratorDeploymentRetiredError, CuratorRateLimitError, CuratorApprovalRequiredError, CuratorAgentError, CuratorTimeoutError, } from "./errors.js";
7
- export type { AssistantMessage, UserMessage, ToolMessage, ConversationMessage, Environment, FileAttachment, ApprovalDetails, AgentFailureClass, SendOptions, HistoryOptions, HistoryPage, DeploymentConfig, } from "./types.js";
8
- export type { StreamEvent, StreamDelta, StreamToolCallStarted, StreamToolCallCompleted, StreamState, StreamDone, StreamError, StreamPausedForApproval, } from "./streamEvents.js";
6
+ export { CuratorError, CuratorAuthError, CuratorForbiddenError, CuratorNotFoundError, CuratorDeploymentRetiredError, CuratorRateLimitError, CuratorApprovalRequiredError, CuratorAuthorizationRequiredError, CuratorAgentError, CuratorTimeoutError, } from "./errors.js";
7
+ export type { AssistantMessage, UserMessage, ToolMessage, ConversationMessage, Environment, FileAttachment, ApprovalDetails, AuthorizationDetails, AgentFailureClass, SendOptions, HistoryOptions, HistoryPage, DeploymentConfig, EndUserConnection, } from "./types.js";
8
+ export { Integrations, GmailIntegration } from "./integrations.js";
9
+ export type { StreamEvent, StreamDelta, StreamToolCallStarted, StreamToolCallCompleted, StreamState, StreamPlanProgress, StreamDone, StreamError, StreamPausedForApproval, StreamPausedForAuthorization, } from "./streamEvents.js";
9
10
  export { isTerminalStreamEvent } from "./streamEvents.js";
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClD,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/D,YAAY,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,YAAY,EACV,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,UAAU,GACX,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,6BAA6B,EAC7B,qBAAqB,EACrB,4BAA4B,EAC5B,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,aAAa,CAAA;AACpB,YAAY,EACV,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,mBAAmB,EACnB,WAAW,EACX,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,cAAc,EACd,WAAW,EACX,gBAAgB,GACjB,MAAM,YAAY,CAAA;AACnB,YAAY,EACV,WAAW,EACX,WAAW,EACX,qBAAqB,EACrB,uBAAuB,EACvB,WAAW,EACX,UAAU,EACV,WAAW,EACX,uBAAuB,GACxB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClD,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/D,YAAY,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,YAAY,EACV,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,UAAU,GACX,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,6BAA6B,EAC7B,qBAAqB,EACrB,4BAA4B,EAC5B,iCAAiC,EACjC,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,aAAa,CAAA;AACpB,YAAY,EACV,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,mBAAmB,EACnB,WAAW,EACX,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,WAAW,EACX,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAClE,YAAY,EACV,WAAW,EACX,WAAW,EACX,qBAAqB,EACrB,uBAAuB,EACvB,WAAW,EACX,kBAAkB,EAClB,UAAU,EACV,WAAW,EACX,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAA"}
package/dist/cjs/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isTerminalStreamEvent = exports.CuratorTimeoutError = exports.CuratorAgentError = exports.CuratorApprovalRequiredError = exports.CuratorRateLimitError = exports.CuratorDeploymentRetiredError = exports.CuratorNotFoundError = exports.CuratorForbiddenError = exports.CuratorAuthError = exports.CuratorError = exports.Files = exports.Chat = exports.Agent = exports.Curator = void 0;
3
+ exports.isTerminalStreamEvent = exports.GmailIntegration = exports.Integrations = exports.CuratorTimeoutError = exports.CuratorAgentError = exports.CuratorAuthorizationRequiredError = exports.CuratorApprovalRequiredError = exports.CuratorRateLimitError = exports.CuratorDeploymentRetiredError = exports.CuratorNotFoundError = exports.CuratorForbiddenError = exports.CuratorAuthError = exports.CuratorError = exports.Files = exports.Chat = exports.Agent = exports.Curator = void 0;
4
4
  var client_js_1 = require("./client.js");
5
5
  Object.defineProperty(exports, "Curator", { enumerable: true, get: function () { return client_js_1.Curator; } });
6
6
  Object.defineProperty(exports, "Agent", { enumerable: true, get: function () { return client_js_1.Agent; } });
@@ -15,8 +15,12 @@ Object.defineProperty(exports, "CuratorNotFoundError", { enumerable: true, get:
15
15
  Object.defineProperty(exports, "CuratorDeploymentRetiredError", { enumerable: true, get: function () { return errors_js_1.CuratorDeploymentRetiredError; } });
16
16
  Object.defineProperty(exports, "CuratorRateLimitError", { enumerable: true, get: function () { return errors_js_1.CuratorRateLimitError; } });
17
17
  Object.defineProperty(exports, "CuratorApprovalRequiredError", { enumerable: true, get: function () { return errors_js_1.CuratorApprovalRequiredError; } });
18
+ Object.defineProperty(exports, "CuratorAuthorizationRequiredError", { enumerable: true, get: function () { return errors_js_1.CuratorAuthorizationRequiredError; } });
18
19
  Object.defineProperty(exports, "CuratorAgentError", { enumerable: true, get: function () { return errors_js_1.CuratorAgentError; } });
19
20
  Object.defineProperty(exports, "CuratorTimeoutError", { enumerable: true, get: function () { return errors_js_1.CuratorTimeoutError; } });
21
+ var integrations_js_1 = require("./integrations.js");
22
+ Object.defineProperty(exports, "Integrations", { enumerable: true, get: function () { return integrations_js_1.Integrations; } });
23
+ Object.defineProperty(exports, "GmailIntegration", { enumerable: true, get: function () { return integrations_js_1.GmailIntegration; } });
20
24
  var streamEvents_js_1 = require("./streamEvents.js");
21
25
  Object.defineProperty(exports, "isTerminalStreamEvent", { enumerable: true, get: function () { return streamEvents_js_1.isTerminalStreamEvent; } });
22
26
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,yCAAkD;AAAzC,oGAAA,OAAO,OAAA;AAAE,kGAAA,KAAK,OAAA;AAAE,iGAAA,IAAI,OAAA;AAG7B,uCAAkC;AAAzB,iGAAA,KAAK,OAAA;AAOd,yCAUoB;AATlB,yGAAA,YAAY,OAAA;AACZ,6GAAA,gBAAgB,OAAA;AAChB,kHAAA,qBAAqB,OAAA;AACrB,iHAAA,oBAAoB,OAAA;AACpB,0HAAA,6BAA6B,OAAA;AAC7B,kHAAA,qBAAqB,OAAA;AACrB,yHAAA,4BAA4B,OAAA;AAC5B,8GAAA,iBAAiB,OAAA;AACjB,gHAAA,mBAAmB,OAAA;AA0BrB,qDAAyD;AAAhD,wHAAA,qBAAqB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,yCAAkD;AAAzC,oGAAA,OAAO,OAAA;AAAE,kGAAA,KAAK,OAAA;AAAE,iGAAA,IAAI,OAAA;AAG7B,uCAAkC;AAAzB,iGAAA,KAAK,OAAA;AAOd,yCAWoB;AAVlB,yGAAA,YAAY,OAAA;AACZ,6GAAA,gBAAgB,OAAA;AAChB,kHAAA,qBAAqB,OAAA;AACrB,iHAAA,oBAAoB,OAAA;AACpB,0HAAA,6BAA6B,OAAA;AAC7B,kHAAA,qBAAqB,OAAA;AACrB,yHAAA,4BAA4B,OAAA;AAC5B,8HAAA,iCAAiC,OAAA;AACjC,8GAAA,iBAAiB,OAAA;AACjB,gHAAA,mBAAmB,OAAA;AAkBrB,qDAAkE;AAAzD,+GAAA,YAAY,OAAA;AAAE,mHAAA,gBAAgB,OAAA;AAavC,qDAAyD;AAAhD,wHAAA,qBAAqB,OAAA"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Integration connect surface for the host app's end users (SDK delegated
3
+ * identity). Lets a host app drive the OAuth connect flow for the currently
4
+ * authenticated end user (identified by the end-user JWT the client carries),
5
+ * so an agent can act as them.
6
+ *
7
+ * Typical loop, on a `CuratorAuthorizationRequiredError`:
8
+ *
9
+ * const { consentUrl } = await curator.integrations.gmail.startConnect({
10
+ * returnUrl: "https://myapp.com/after-connect",
11
+ * })
12
+ * window.location = consentUrl // Google consent
13
+ * // …user returns to returnUrl?status=connected&confirm_token=… …
14
+ * await curator.integrations.gmail.confirm(confirmToken) // bind
15
+ * await chat.authorize() // resume the paused run
16
+ */
17
+ import type { HttpClient } from "./http.js";
18
+ import type { EndUserConnection } from "./types.js";
19
+ export declare class GmailIntegration {
20
+ private readonly http;
21
+ private readonly baseUrl;
22
+ constructor(http: HttpClient, baseUrl: string);
23
+ private base;
24
+ /**
25
+ * Begin an end-user Gmail connect. Returns a Google consent URL to open
26
+ * (redirect or popup). `returnUrl` must be an origin your org has
27
+ * allowlisted (Settings → End-user identity); the callback 302s back to it
28
+ * with `?status=connected&confirm_token=…`.
29
+ */
30
+ startConnect(opts: {
31
+ returnUrl: string;
32
+ }): Promise<{
33
+ consentUrl: string;
34
+ }>;
35
+ /**
36
+ * Finalize the connection after the user returns from consent, passing the
37
+ * `confirm_token` from the return URL. Binds only when the end user's
38
+ * verified JWT matches the one the flow was started for.
39
+ */
40
+ confirm(confirmToken: string): Promise<{
41
+ connectionId: string;
42
+ status: string;
43
+ }>;
44
+ /** The current end user's own Gmail connection, or null if not connected. */
45
+ getConnection(): Promise<EndUserConnection | null>;
46
+ /** Disconnect (revoke) the current end user's own Gmail connection. */
47
+ disconnect(): Promise<{
48
+ status: string;
49
+ }>;
50
+ }
51
+ export declare class Integrations {
52
+ /** Gmail connect surface for end users. */
53
+ readonly gmail: GmailIntegration;
54
+ /** @internal */
55
+ constructor(http: HttpClient, baseUrl: string);
56
+ }
57
+ //# sourceMappingURL=integrations.d.ts.map