@elqnt/agents 3.4.0 → 4.0.0

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 (72) hide show
  1. package/README.md +6 -0
  2. package/SKILL.md +724 -0
  3. package/dist/{agent-models-D6WgsFMZ.d.mts → agent-models-B-wTMdwF.d.mts} +44 -9
  4. package/dist/{agent-models-D6WgsFMZ.d.ts → agent-models-B-wTMdwF.d.ts} +44 -9
  5. package/dist/api/index.d.mts +6 -6
  6. package/dist/api/index.d.ts +6 -6
  7. package/dist/api/index.js +3 -4
  8. package/dist/api/index.js.map +1 -1
  9. package/dist/api/index.mjs +1 -2
  10. package/dist/api/server.d.mts +3 -3
  11. package/dist/api/server.d.ts +3 -3
  12. package/dist/api/server.js +6 -8
  13. package/dist/api/server.js.map +1 -1
  14. package/dist/api/server.mjs +5 -7
  15. package/dist/api/server.mjs.map +1 -1
  16. package/dist/{chunk-XQ7LOAN3.js → chunk-2FZZW4O4.js} +7 -5
  17. package/dist/chunk-2FZZW4O4.js.map +1 -0
  18. package/dist/{chunk-3EHE4O57.mjs → chunk-6FKG2JBT.mjs} +1 -3
  19. package/dist/{chunk-3EHE4O57.mjs.map → chunk-6FKG2JBT.mjs.map} +1 -1
  20. package/dist/{chunk-TY57JG3P.mjs → chunk-CCQNGD3U.mjs} +5 -3
  21. package/dist/chunk-CCQNGD3U.mjs.map +1 -0
  22. package/dist/{chunk-ZS7DRNCT.js → chunk-DQATIIAV.js} +2 -4
  23. package/dist/chunk-DQATIIAV.js.map +1 -0
  24. package/dist/{chunk-L5FLJB3H.mjs → chunk-NHIVBTLU.mjs} +5 -7
  25. package/dist/chunk-NHIVBTLU.mjs.map +1 -0
  26. package/dist/{chunk-3PFZRJ4A.js → chunk-QH234LAO.js} +6 -8
  27. package/dist/chunk-QH234LAO.js.map +1 -0
  28. package/dist/{chunk-2JDVRL35.js → chunk-QXMZEZRM.js} +2 -4
  29. package/dist/chunk-QXMZEZRM.js.map +1 -0
  30. package/dist/{chunk-HYR7PXFU.mjs → chunk-YQFBZW6F.mjs} +1 -3
  31. package/dist/{chunk-HYR7PXFU.mjs.map → chunk-YQFBZW6F.mjs.map} +1 -1
  32. package/dist/hooks/index.d.mts +354 -142
  33. package/dist/hooks/index.d.ts +354 -142
  34. package/dist/hooks/index.js +1094 -6
  35. package/dist/hooks/index.js.map +1 -1
  36. package/dist/hooks/index.mjs +1107 -19
  37. package/dist/hooks/index.mjs.map +1 -1
  38. package/dist/index.d.mts +2 -4
  39. package/dist/index.d.ts +2 -4
  40. package/dist/index.js +5 -35
  41. package/dist/index.js.map +1 -1
  42. package/dist/index.mjs +8 -38
  43. package/dist/models/index.d.mts +2 -2
  44. package/dist/models/index.d.ts +2 -2
  45. package/dist/models/index.js +6 -3
  46. package/dist/models/index.js.map +1 -1
  47. package/dist/models/index.mjs +5 -2
  48. package/dist/{sandbox-DOxoM2Ge.d.ts → sandbox-Djb8gA7e.d.mts} +32 -2
  49. package/dist/{sandbox-DOxoM2Ge.d.mts → sandbox-Djb8gA7e.d.ts} +32 -2
  50. package/dist/transport/index.d.mts +3 -3
  51. package/dist/transport/index.d.ts +3 -3
  52. package/dist/transport/index.js +3 -4
  53. package/dist/transport/index.js.map +1 -1
  54. package/dist/transport/index.mjs +1 -2
  55. package/dist/{types-BBPz_6kK.d.ts → types-BzNzXaqk.d.ts} +2 -2
  56. package/dist/{types-BtfxlyHk.d.mts → types-CSyY6Qv7.d.mts} +2 -2
  57. package/dist/utils/index.d.mts +1 -1
  58. package/dist/utils/index.d.ts +1 -1
  59. package/dist/utils/index.js +3 -4
  60. package/dist/utils/index.js.map +1 -1
  61. package/dist/utils/index.mjs +1 -2
  62. package/package.json +9 -8
  63. package/dist/chunk-2JDVRL35.js.map +0 -1
  64. package/dist/chunk-3PFZRJ4A.js.map +0 -1
  65. package/dist/chunk-43FTKGM6.mjs +0 -1114
  66. package/dist/chunk-43FTKGM6.mjs.map +0 -1
  67. package/dist/chunk-L5FLJB3H.mjs.map +0 -1
  68. package/dist/chunk-RG42SHBX.js +0 -1114
  69. package/dist/chunk-RG42SHBX.js.map +0 -1
  70. package/dist/chunk-TY57JG3P.mjs.map +0 -1
  71. package/dist/chunk-XQ7LOAN3.js.map +0 -1
  72. package/dist/chunk-ZS7DRNCT.js.map +0 -1
@@ -321,13 +321,21 @@ interface EmailDetails {
321
321
  provider?: IntegrationProviderTS;
322
322
  }
323
323
  /**
324
- * EmailAttachment represents an email attachment
324
+ * EmailAttachment represents an email attachment. ID is the provider-side
325
+ * attachment identifier (Gmail's attachmentId / Graph's id) — used to
326
+ * re-fetch bytes when include_attachments=false the first time. URL,
327
+ * when set, is a persistent public URL where the attachment bytes have
328
+ * been uploaded (set by GetEmail when include_attachments=true). That
329
+ * URL is what consumers should hand to the LLM, WhatsApp outbound,
330
+ * email.send forwarding, etc. — never the provider ID, which only
331
+ * the integrations service can resolve.
325
332
  */
326
333
  interface EmailAttachment {
327
334
  id: string;
328
335
  filename: string;
329
336
  mime_type: string;
330
337
  size: number;
338
+ url?: string;
331
339
  }
332
340
  /**
333
341
  * SendEmailResult represents the result of sending an email
@@ -367,6 +375,28 @@ interface SendEmailRequest {
367
375
  body_html?: string;
368
376
  reply_to?: string;
369
377
  thread_id?: string;
378
+ /**
379
+ * Attachments to include with the outgoing email. The agent calls
380
+ * email.send with a list of public URLs (typically images it
381
+ * generated or files it composed); the provider client fetches the
382
+ * bytes server-side and embeds them as RFC 2822 multipart parts
383
+ * (Gmail) or Graph attachment objects (Microsoft). The recipient
384
+ * receives them as normal email attachments — no token, no preview
385
+ * link gating, no client-specific surprises.
386
+ */
387
+ attachments?: OutboundEmailAttachment[];
388
+ }
389
+ /**
390
+ * OutboundEmailAttachment describes one attachment to fetch and embed
391
+ * when sending an email. URL is required; Filename and MimeType are
392
+ * optional overrides — when empty, Filename is inferred from the URL
393
+ * basename and MimeType from the HTTP response (with a final fallback
394
+ * to application/octet-stream).
395
+ */
396
+ interface OutboundEmailAttachment {
397
+ url: string;
398
+ filename?: string;
399
+ mime_type?: string;
370
400
  }
371
401
  /**
372
402
  * SendEmailResponse represents send email response
@@ -879,4 +909,4 @@ interface ValidationResult {
879
909
  warnings?: string[];
880
910
  }
881
911
 
882
- export { HubIntegrationEmailArchive as $, type ArchiveEmailRequest as A, type GetCalendarEventResponse as B, type CalendarEvent as C, type DeleteCalendarEventRequest as D, type EmailAttachment as E, type FileDetails as F, type GetCalendarEventRequest as G, type GetDriveFileRequest as H, type GetDriveFileResponse as I, type GetEmailRequest as J, type GetEmailResponse as K, type GetEmailThreadRequest as L, type GetEmailThreadResponse as M, type GetSandboxRequest as N, type GetSandboxResponse as O, GetSandboxSubject as P, type GetUserIntegrationRequest as Q, type GetUserIntegrationResponse as R, HubEmailTriageRunNow as S, HubIntegrationCalendarCreate as T, HubIntegrationCalendarDelete as U, HubIntegrationCalendarGet as V, HubIntegrationCalendarList as W, HubIntegrationCalendarRSVP as X, HubIntegrationCalendarUpdate as Y, HubIntegrationDriveGet as Z, HubIntegrationDriveSearch as _, type ArchiveEmailResponse as a, type SendEmailResult as a$, HubIntegrationEmailForward as a0, HubIntegrationEmailGet as a1, HubIntegrationEmailMarkRead as a2, HubIntegrationEmailSearch as a3, HubIntegrationEmailSend as a4, HubIntegrationEmailThread as a5, HubIntegrationOrgConfigure as a6, HubIntegrationOrgDisable as a7, HubIntegrationOrgList as a8, HubIntegrationSetupOrg as a9, type IntegrationTypeTS as aA, type ListCalendarEventsRequest as aB, type ListCalendarEventsResponse as aC, type ListDriveFilesRequest as aD, type ListDriveFilesResponse as aE, type ListOrgIntegrationsRequest as aF, type ListOrgIntegrationsResponse as aG, ListSandboxSubject as aH, type ListSandboxesRequest as aI, type ListSandboxesResponse as aJ, type ListUserIntegrationsRequest as aK, type ListUserIntegrationsResponse as aL, type MarkAsReadRequest as aM, type MarkAsReadResponse as aN, type OAuthState as aO, type OrgIntegration as aP, type RSVPCalendarEventRequest as aQ, type RSVPCalendarEventResponse as aR, type RefreshIntegrationRequest as aS, type RefreshIntegrationResponse as aT, type RunEmailTriageRequest as aU, type RunEmailTriageResponse as aV, type Sandbox as aW, type SearchEmailsRequest as aX, type SearchEmailsResponse as aY, type SendEmailRequest as aZ, type SendEmailResponse as a_, HubIntegrationUserCallback as aa, HubIntegrationUserConnect as ab, HubIntegrationUserDisconnect as ac, HubIntegrationUserGet as ad, HubIntegrationUserList as ae, HubIntegrationUserRefresh as af, HubIntegrationUserUpdateTriage as ag, type IntegrationCallbackRequest as ah, type IntegrationCallbackResponse as ai, type IntegrationMode as aj, IntegrationModeDomainDelegation as ak, IntegrationModeServicePrincipal as al, type IntegrationProvider as am, IntegrationProviderGoogle as an, IntegrationProviderMicrosoft as ao, type IntegrationProviderTS as ap, type IntegrationStatus as aq, IntegrationStatusActive as ar, IntegrationStatusError as as, IntegrationStatusExpired as at, IntegrationStatusRevoked as au, type IntegrationStatusTS as av, type IntegrationType as aw, IntegrationTypeCalendar as ax, IntegrationTypeDrive as ay, IntegrationTypeEmail as az, type ConfigureOrgIntegrationRequest as b, type SetupIntegrationsRequest as b0, type SetupIntegrationsResponse as b1, type TokenData as b2, type UpdateCalendarEventRequest as b3, type UpdateCalendarEventResponse as b4, type UpdateSandboxRequest as b5, type UpdateSandboxResponse as b6, UpdateSandboxSubject as b7, type UpdateTriageEnabledRequest as b8, type UpdateTriageEnabledResponse as b9, type UserIntegration as ba, type ValidationResult as bb, type ConfigureOrgIntegrationResponse as c, type ConnectIntegrationRequest as d, type ConnectIntegrationResponse as e, type CreateCalendarEventRequest as f, type CreateCalendarEventResponse as g, type CreateSandboxRequest as h, type CreateSandboxResponse as i, CreateSandboxSubject as j, type DeleteCalendarEventResponse as k, type DeleteSandboxRequest as l, type DeleteSandboxResponse as m, DeleteSandboxSubject as n, type DisableOrgIntegrationRequest as o, type DisableOrgIntegrationResponse as p, type DisconnectIntegrationRequest as q, type DisconnectIntegrationResponse as r, type EmailDetails as s, type EmailSummary as t, type EventAttendee as u, type EventReminder as v, type FilePermission as w, type FileSummary as x, type FileWithContent as y, type ForwardEmailRequest as z };
912
+ export { HubIntegrationEmailArchive as $, type ArchiveEmailRequest as A, type GetCalendarEventResponse as B, type CalendarEvent as C, type DeleteCalendarEventRequest as D, type EmailAttachment as E, type FileDetails as F, type GetCalendarEventRequest as G, type GetDriveFileRequest as H, type GetDriveFileResponse as I, type GetEmailRequest as J, type GetEmailResponse as K, type GetEmailThreadRequest as L, type GetEmailThreadResponse as M, type GetSandboxRequest as N, type GetSandboxResponse as O, GetSandboxSubject as P, type GetUserIntegrationRequest as Q, type GetUserIntegrationResponse as R, HubEmailTriageRunNow as S, HubIntegrationCalendarCreate as T, HubIntegrationCalendarDelete as U, HubIntegrationCalendarGet as V, HubIntegrationCalendarList as W, HubIntegrationCalendarRSVP as X, HubIntegrationCalendarUpdate as Y, HubIntegrationDriveGet as Z, HubIntegrationDriveSearch as _, type ArchiveEmailResponse as a, type SendEmailResponse as a$, HubIntegrationEmailForward as a0, HubIntegrationEmailGet as a1, HubIntegrationEmailMarkRead as a2, HubIntegrationEmailSearch as a3, HubIntegrationEmailSend as a4, HubIntegrationEmailThread as a5, HubIntegrationOrgConfigure as a6, HubIntegrationOrgDisable as a7, HubIntegrationOrgList as a8, HubIntegrationSetupOrg as a9, type IntegrationTypeTS as aA, type ListCalendarEventsRequest as aB, type ListCalendarEventsResponse as aC, type ListDriveFilesRequest as aD, type ListDriveFilesResponse as aE, type ListOrgIntegrationsRequest as aF, type ListOrgIntegrationsResponse as aG, ListSandboxSubject as aH, type ListSandboxesRequest as aI, type ListSandboxesResponse as aJ, type ListUserIntegrationsRequest as aK, type ListUserIntegrationsResponse as aL, type MarkAsReadRequest as aM, type MarkAsReadResponse as aN, type OAuthState as aO, type OrgIntegration as aP, type OutboundEmailAttachment as aQ, type RSVPCalendarEventRequest as aR, type RSVPCalendarEventResponse as aS, type RefreshIntegrationRequest as aT, type RefreshIntegrationResponse as aU, type RunEmailTriageRequest as aV, type RunEmailTriageResponse as aW, type Sandbox as aX, type SearchEmailsRequest as aY, type SearchEmailsResponse as aZ, type SendEmailRequest as a_, HubIntegrationUserCallback as aa, HubIntegrationUserConnect as ab, HubIntegrationUserDisconnect as ac, HubIntegrationUserGet as ad, HubIntegrationUserList as ae, HubIntegrationUserRefresh as af, HubIntegrationUserUpdateTriage as ag, type IntegrationCallbackRequest as ah, type IntegrationCallbackResponse as ai, type IntegrationMode as aj, IntegrationModeDomainDelegation as ak, IntegrationModeServicePrincipal as al, type IntegrationProvider as am, IntegrationProviderGoogle as an, IntegrationProviderMicrosoft as ao, type IntegrationProviderTS as ap, type IntegrationStatus as aq, IntegrationStatusActive as ar, IntegrationStatusError as as, IntegrationStatusExpired as at, IntegrationStatusRevoked as au, type IntegrationStatusTS as av, type IntegrationType as aw, IntegrationTypeCalendar as ax, IntegrationTypeDrive as ay, IntegrationTypeEmail as az, type ConfigureOrgIntegrationRequest as b, type SendEmailResult as b0, type SetupIntegrationsRequest as b1, type SetupIntegrationsResponse as b2, type TokenData as b3, type UpdateCalendarEventRequest as b4, type UpdateCalendarEventResponse as b5, type UpdateSandboxRequest as b6, type UpdateSandboxResponse as b7, UpdateSandboxSubject as b8, type UpdateTriageEnabledRequest as b9, type UpdateTriageEnabledResponse as ba, type UserIntegration as bb, type ValidationResult as bc, type ConfigureOrgIntegrationResponse as c, type ConnectIntegrationRequest as d, type ConnectIntegrationResponse as e, type CreateCalendarEventRequest as f, type CreateCalendarEventResponse as g, type CreateSandboxRequest as h, type CreateSandboxResponse as i, CreateSandboxSubject as j, type DeleteCalendarEventResponse as k, type DeleteSandboxRequest as l, type DeleteSandboxResponse as m, DeleteSandboxSubject as n, type DisableOrgIntegrationRequest as o, type DisableOrgIntegrationResponse as p, type DisconnectIntegrationRequest as q, type DisconnectIntegrationResponse as r, type EmailDetails as s, type EmailSummary as t, type EventAttendee as u, type EventReminder as v, type FilePermission as w, type FileSummary as x, type FileWithContent as y, type ForwardEmailRequest as z };
@@ -321,13 +321,21 @@ interface EmailDetails {
321
321
  provider?: IntegrationProviderTS;
322
322
  }
323
323
  /**
324
- * EmailAttachment represents an email attachment
324
+ * EmailAttachment represents an email attachment. ID is the provider-side
325
+ * attachment identifier (Gmail's attachmentId / Graph's id) — used to
326
+ * re-fetch bytes when include_attachments=false the first time. URL,
327
+ * when set, is a persistent public URL where the attachment bytes have
328
+ * been uploaded (set by GetEmail when include_attachments=true). That
329
+ * URL is what consumers should hand to the LLM, WhatsApp outbound,
330
+ * email.send forwarding, etc. — never the provider ID, which only
331
+ * the integrations service can resolve.
325
332
  */
326
333
  interface EmailAttachment {
327
334
  id: string;
328
335
  filename: string;
329
336
  mime_type: string;
330
337
  size: number;
338
+ url?: string;
331
339
  }
332
340
  /**
333
341
  * SendEmailResult represents the result of sending an email
@@ -367,6 +375,28 @@ interface SendEmailRequest {
367
375
  body_html?: string;
368
376
  reply_to?: string;
369
377
  thread_id?: string;
378
+ /**
379
+ * Attachments to include with the outgoing email. The agent calls
380
+ * email.send with a list of public URLs (typically images it
381
+ * generated or files it composed); the provider client fetches the
382
+ * bytes server-side and embeds them as RFC 2822 multipart parts
383
+ * (Gmail) or Graph attachment objects (Microsoft). The recipient
384
+ * receives them as normal email attachments — no token, no preview
385
+ * link gating, no client-specific surprises.
386
+ */
387
+ attachments?: OutboundEmailAttachment[];
388
+ }
389
+ /**
390
+ * OutboundEmailAttachment describes one attachment to fetch and embed
391
+ * when sending an email. URL is required; Filename and MimeType are
392
+ * optional overrides — when empty, Filename is inferred from the URL
393
+ * basename and MimeType from the HTTP response (with a final fallback
394
+ * to application/octet-stream).
395
+ */
396
+ interface OutboundEmailAttachment {
397
+ url: string;
398
+ filename?: string;
399
+ mime_type?: string;
370
400
  }
371
401
  /**
372
402
  * SendEmailResponse represents send email response
@@ -879,4 +909,4 @@ interface ValidationResult {
879
909
  warnings?: string[];
880
910
  }
881
911
 
882
- export { HubIntegrationEmailArchive as $, type ArchiveEmailRequest as A, type GetCalendarEventResponse as B, type CalendarEvent as C, type DeleteCalendarEventRequest as D, type EmailAttachment as E, type FileDetails as F, type GetCalendarEventRequest as G, type GetDriveFileRequest as H, type GetDriveFileResponse as I, type GetEmailRequest as J, type GetEmailResponse as K, type GetEmailThreadRequest as L, type GetEmailThreadResponse as M, type GetSandboxRequest as N, type GetSandboxResponse as O, GetSandboxSubject as P, type GetUserIntegrationRequest as Q, type GetUserIntegrationResponse as R, HubEmailTriageRunNow as S, HubIntegrationCalendarCreate as T, HubIntegrationCalendarDelete as U, HubIntegrationCalendarGet as V, HubIntegrationCalendarList as W, HubIntegrationCalendarRSVP as X, HubIntegrationCalendarUpdate as Y, HubIntegrationDriveGet as Z, HubIntegrationDriveSearch as _, type ArchiveEmailResponse as a, type SendEmailResult as a$, HubIntegrationEmailForward as a0, HubIntegrationEmailGet as a1, HubIntegrationEmailMarkRead as a2, HubIntegrationEmailSearch as a3, HubIntegrationEmailSend as a4, HubIntegrationEmailThread as a5, HubIntegrationOrgConfigure as a6, HubIntegrationOrgDisable as a7, HubIntegrationOrgList as a8, HubIntegrationSetupOrg as a9, type IntegrationTypeTS as aA, type ListCalendarEventsRequest as aB, type ListCalendarEventsResponse as aC, type ListDriveFilesRequest as aD, type ListDriveFilesResponse as aE, type ListOrgIntegrationsRequest as aF, type ListOrgIntegrationsResponse as aG, ListSandboxSubject as aH, type ListSandboxesRequest as aI, type ListSandboxesResponse as aJ, type ListUserIntegrationsRequest as aK, type ListUserIntegrationsResponse as aL, type MarkAsReadRequest as aM, type MarkAsReadResponse as aN, type OAuthState as aO, type OrgIntegration as aP, type RSVPCalendarEventRequest as aQ, type RSVPCalendarEventResponse as aR, type RefreshIntegrationRequest as aS, type RefreshIntegrationResponse as aT, type RunEmailTriageRequest as aU, type RunEmailTriageResponse as aV, type Sandbox as aW, type SearchEmailsRequest as aX, type SearchEmailsResponse as aY, type SendEmailRequest as aZ, type SendEmailResponse as a_, HubIntegrationUserCallback as aa, HubIntegrationUserConnect as ab, HubIntegrationUserDisconnect as ac, HubIntegrationUserGet as ad, HubIntegrationUserList as ae, HubIntegrationUserRefresh as af, HubIntegrationUserUpdateTriage as ag, type IntegrationCallbackRequest as ah, type IntegrationCallbackResponse as ai, type IntegrationMode as aj, IntegrationModeDomainDelegation as ak, IntegrationModeServicePrincipal as al, type IntegrationProvider as am, IntegrationProviderGoogle as an, IntegrationProviderMicrosoft as ao, type IntegrationProviderTS as ap, type IntegrationStatus as aq, IntegrationStatusActive as ar, IntegrationStatusError as as, IntegrationStatusExpired as at, IntegrationStatusRevoked as au, type IntegrationStatusTS as av, type IntegrationType as aw, IntegrationTypeCalendar as ax, IntegrationTypeDrive as ay, IntegrationTypeEmail as az, type ConfigureOrgIntegrationRequest as b, type SetupIntegrationsRequest as b0, type SetupIntegrationsResponse as b1, type TokenData as b2, type UpdateCalendarEventRequest as b3, type UpdateCalendarEventResponse as b4, type UpdateSandboxRequest as b5, type UpdateSandboxResponse as b6, UpdateSandboxSubject as b7, type UpdateTriageEnabledRequest as b8, type UpdateTriageEnabledResponse as b9, type UserIntegration as ba, type ValidationResult as bb, type ConfigureOrgIntegrationResponse as c, type ConnectIntegrationRequest as d, type ConnectIntegrationResponse as e, type CreateCalendarEventRequest as f, type CreateCalendarEventResponse as g, type CreateSandboxRequest as h, type CreateSandboxResponse as i, CreateSandboxSubject as j, type DeleteCalendarEventResponse as k, type DeleteSandboxRequest as l, type DeleteSandboxResponse as m, DeleteSandboxSubject as n, type DisableOrgIntegrationRequest as o, type DisableOrgIntegrationResponse as p, type DisconnectIntegrationRequest as q, type DisconnectIntegrationResponse as r, type EmailDetails as s, type EmailSummary as t, type EventAttendee as u, type EventReminder as v, type FilePermission as w, type FileSummary as x, type FileWithContent as y, type ForwardEmailRequest as z };
912
+ export { HubIntegrationEmailArchive as $, type ArchiveEmailRequest as A, type GetCalendarEventResponse as B, type CalendarEvent as C, type DeleteCalendarEventRequest as D, type EmailAttachment as E, type FileDetails as F, type GetCalendarEventRequest as G, type GetDriveFileRequest as H, type GetDriveFileResponse as I, type GetEmailRequest as J, type GetEmailResponse as K, type GetEmailThreadRequest as L, type GetEmailThreadResponse as M, type GetSandboxRequest as N, type GetSandboxResponse as O, GetSandboxSubject as P, type GetUserIntegrationRequest as Q, type GetUserIntegrationResponse as R, HubEmailTriageRunNow as S, HubIntegrationCalendarCreate as T, HubIntegrationCalendarDelete as U, HubIntegrationCalendarGet as V, HubIntegrationCalendarList as W, HubIntegrationCalendarRSVP as X, HubIntegrationCalendarUpdate as Y, HubIntegrationDriveGet as Z, HubIntegrationDriveSearch as _, type ArchiveEmailResponse as a, type SendEmailResponse as a$, HubIntegrationEmailForward as a0, HubIntegrationEmailGet as a1, HubIntegrationEmailMarkRead as a2, HubIntegrationEmailSearch as a3, HubIntegrationEmailSend as a4, HubIntegrationEmailThread as a5, HubIntegrationOrgConfigure as a6, HubIntegrationOrgDisable as a7, HubIntegrationOrgList as a8, HubIntegrationSetupOrg as a9, type IntegrationTypeTS as aA, type ListCalendarEventsRequest as aB, type ListCalendarEventsResponse as aC, type ListDriveFilesRequest as aD, type ListDriveFilesResponse as aE, type ListOrgIntegrationsRequest as aF, type ListOrgIntegrationsResponse as aG, ListSandboxSubject as aH, type ListSandboxesRequest as aI, type ListSandboxesResponse as aJ, type ListUserIntegrationsRequest as aK, type ListUserIntegrationsResponse as aL, type MarkAsReadRequest as aM, type MarkAsReadResponse as aN, type OAuthState as aO, type OrgIntegration as aP, type OutboundEmailAttachment as aQ, type RSVPCalendarEventRequest as aR, type RSVPCalendarEventResponse as aS, type RefreshIntegrationRequest as aT, type RefreshIntegrationResponse as aU, type RunEmailTriageRequest as aV, type RunEmailTriageResponse as aW, type Sandbox as aX, type SearchEmailsRequest as aY, type SearchEmailsResponse as aZ, type SendEmailRequest as a_, HubIntegrationUserCallback as aa, HubIntegrationUserConnect as ab, HubIntegrationUserDisconnect as ac, HubIntegrationUserGet as ad, HubIntegrationUserList as ae, HubIntegrationUserRefresh as af, HubIntegrationUserUpdateTriage as ag, type IntegrationCallbackRequest as ah, type IntegrationCallbackResponse as ai, type IntegrationMode as aj, IntegrationModeDomainDelegation as ak, IntegrationModeServicePrincipal as al, type IntegrationProvider as am, IntegrationProviderGoogle as an, IntegrationProviderMicrosoft as ao, type IntegrationProviderTS as ap, type IntegrationStatus as aq, IntegrationStatusActive as ar, IntegrationStatusError as as, IntegrationStatusExpired as at, IntegrationStatusRevoked as au, type IntegrationStatusTS as av, type IntegrationType as aw, IntegrationTypeCalendar as ax, IntegrationTypeDrive as ay, IntegrationTypeEmail as az, type ConfigureOrgIntegrationRequest as b, type SendEmailResult as b0, type SetupIntegrationsRequest as b1, type SetupIntegrationsResponse as b2, type TokenData as b3, type UpdateCalendarEventRequest as b4, type UpdateCalendarEventResponse as b5, type UpdateSandboxRequest as b6, type UpdateSandboxResponse as b7, UpdateSandboxSubject as b8, type UpdateTriageEnabledRequest as b9, type UpdateTriageEnabledResponse as ba, type UserIntegration as bb, type ValidationResult as bc, type ConfigureOrgIntegrationResponse as c, type ConnectIntegrationRequest as d, type ConnectIntegrationResponse as e, type CreateCalendarEventRequest as f, type CreateCalendarEventResponse as g, type CreateSandboxRequest as h, type CreateSandboxResponse as i, CreateSandboxSubject as j, type DeleteCalendarEventResponse as k, type DeleteSandboxRequest as l, type DeleteSandboxResponse as m, DeleteSandboxSubject as n, type DisableOrgIntegrationRequest as o, type DisableOrgIntegrationResponse as p, type DisconnectIntegrationRequest as q, type DisconnectIntegrationResponse as r, type EmailDetails as s, type EmailSummary as t, type EventAttendee as u, type EventReminder as v, type FilePermission as w, type FileSummary as x, type FileWithContent as y, type ForwardEmailRequest as z };
@@ -1,6 +1,6 @@
1
- import { b as BGAgentTransportOptions, B as BGAgentTransport } from '../types-BtfxlyHk.mjs';
2
- export { c as BGAgentEventType, a as BGAgentTransportConfig, d as BGAgentTransportError, e as BGAgentTransportState, E as EventHandler, U as Unsubscribe } from '../types-BtfxlyHk.mjs';
3
- export { ba as BackgroundAgentProgressEvent } from '../agent-models-D6WgsFMZ.mjs';
1
+ import { B as BGAgentTransportOptions, a as BGAgentTransport } from '../types-CSyY6Qv7.mjs';
2
+ export { b as BGAgentEventType, c as BGAgentTransportConfig, d as BGAgentTransportError, e as BGAgentTransportState, E as EventHandler, U as Unsubscribe } from '../types-CSyY6Qv7.mjs';
3
+ export { bc as BackgroundAgentProgressEvent } from '../agent-models-B-wTMdwF.mjs';
4
4
  import '@elqnt/types';
5
5
 
6
6
  /**
@@ -1,6 +1,6 @@
1
- import { b as BGAgentTransportOptions, B as BGAgentTransport } from '../types-BBPz_6kK.js';
2
- export { c as BGAgentEventType, a as BGAgentTransportConfig, d as BGAgentTransportError, e as BGAgentTransportState, E as EventHandler, U as Unsubscribe } from '../types-BBPz_6kK.js';
3
- export { ba as BackgroundAgentProgressEvent } from '../agent-models-D6WgsFMZ.js';
1
+ import { B as BGAgentTransportOptions, a as BGAgentTransport } from '../types-BzNzXaqk.js';
2
+ export { b as BGAgentEventType, c as BGAgentTransportConfig, d as BGAgentTransportError, e as BGAgentTransportState, E as EventHandler, U as Unsubscribe } from '../types-BzNzXaqk.js';
3
+ export { bc as BackgroundAgentProgressEvent } from '../agent-models-B-wTMdwF.js';
4
4
  import '@elqnt/types';
5
5
 
6
6
  /**
@@ -1,8 +1,7 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
+ var _chunkQXMZEZRMjs = require('../chunk-QXMZEZRM.js');
3
4
 
4
- var _chunk2JDVRL35js = require('../chunk-2JDVRL35.js');
5
5
 
6
-
7
- exports.createBGAgentTransport = _chunk2JDVRL35js.createBGAgentTransport;
6
+ exports.createBGAgentTransport = _chunkQXMZEZRMjs.createBGAgentTransport;
8
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/eloquent/eloquent/packages/@elqnt/agents/dist/transport/index.js"],"names":[],"mappings":"AAAA,qFAAY;AACZ;AACE;AACF,uDAA6B;AAC7B;AACE;AACF,yEAAC","file":"/home/runner/work/eloquent/eloquent/packages/@elqnt/agents/dist/transport/index.js"}
1
+ {"version":3,"sources":["/home/runner/work/eloquent/eloquent/packages/@elqnt/agents/dist/transport/index.js"],"names":[],"mappings":"AAAA;AACE;AACF,uDAA6B;AAC7B;AACE;AACF,yEAAC","file":"/home/runner/work/eloquent/eloquent/packages/@elqnt/agents/dist/transport/index.js"}
@@ -1,7 +1,6 @@
1
- "use client";
2
1
  import {
3
2
  createBGAgentTransport
4
- } from "../chunk-3EHE4O57.mjs";
3
+ } from "../chunk-6FKG2JBT.mjs";
5
4
  export {
6
5
  createBGAgentTransport
7
6
  };
@@ -1,4 +1,4 @@
1
- import { ba as BackgroundAgentProgressEvent } from './agent-models-D6WgsFMZ.js';
1
+ import { bc as BackgroundAgentProgressEvent } from './agent-models-B-wTMdwF.js';
2
2
 
3
3
  /**
4
4
  * Background Agent SSE Transport Types
@@ -48,4 +48,4 @@ interface BGAgentTransportOptions {
48
48
  debug?: boolean;
49
49
  }
50
50
 
51
- export type { BGAgentTransport as B, EventHandler as E, Unsubscribe as U, BGAgentTransportConfig as a, BGAgentTransportOptions as b, BGAgentEventType as c, BGAgentTransportError as d, BGAgentTransportState as e };
51
+ export type { BGAgentTransportOptions as B, EventHandler as E, Unsubscribe as U, BGAgentTransport as a, BGAgentEventType as b, BGAgentTransportConfig as c, BGAgentTransportError as d, BGAgentTransportState as e };
@@ -1,4 +1,4 @@
1
- import { ba as BackgroundAgentProgressEvent } from './agent-models-D6WgsFMZ.mjs';
1
+ import { bc as BackgroundAgentProgressEvent } from './agent-models-B-wTMdwF.mjs';
2
2
 
3
3
  /**
4
4
  * Background Agent SSE Transport Types
@@ -48,4 +48,4 @@ interface BGAgentTransportOptions {
48
48
  debug?: boolean;
49
49
  }
50
50
 
51
- export type { BGAgentTransport as B, EventHandler as E, Unsubscribe as U, BGAgentTransportConfig as a, BGAgentTransportOptions as b, BGAgentEventType as c, BGAgentTransportError as d, BGAgentTransportState as e };
51
+ export type { BGAgentTransportOptions as B, EventHandler as E, Unsubscribe as U, BGAgentTransport as a, BGAgentEventType as b, BGAgentTransportConfig as c, BGAgentTransportError as d, BGAgentTransportState as e };
@@ -1,4 +1,4 @@
1
- import { ad as AgentProvisionDefinition, bu as DefaultDefinitions } from '../agent-models-D6WgsFMZ.mjs';
1
+ import { ad as AgentProvisionDefinition, bw as DefaultDefinitions } from '../agent-models-B-wTMdwF.mjs';
2
2
  import '@elqnt/types';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { ad as AgentProvisionDefinition, bu as DefaultDefinitions } from '../agent-models-D6WgsFMZ.js';
1
+ import { ad as AgentProvisionDefinition, bw as DefaultDefinitions } from '../agent-models-B-wTMdwF.js';
2
2
  import '@elqnt/types';
3
3
 
4
4
  /**
@@ -1,10 +1,9 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
+ var _chunkDQATIIAVjs = require('../chunk-DQATIIAV.js');
4
5
 
5
- var _chunkZS7DRNCTjs = require('../chunk-ZS7DRNCT.js');
6
6
 
7
7
 
8
-
9
- exports.toDefaultDefinitions = _chunkZS7DRNCTjs.toDefaultDefinitions; exports.toDefaultDefinitionsArray = _chunkZS7DRNCTjs.toDefaultDefinitionsArray;
8
+ exports.toDefaultDefinitions = _chunkDQATIIAVjs.toDefaultDefinitions; exports.toDefaultDefinitionsArray = _chunkDQATIIAVjs.toDefaultDefinitionsArray;
10
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/eloquent/eloquent/packages/@elqnt/agents/dist/utils/index.js"],"names":[],"mappings":"AAAA,qFAAY;AACZ;AACE;AACA;AACF,uDAA6B;AAC7B;AACE;AACA;AACF,qJAAC","file":"/home/runner/work/eloquent/eloquent/packages/@elqnt/agents/dist/utils/index.js"}
1
+ {"version":3,"sources":["/home/runner/work/eloquent/eloquent/packages/@elqnt/agents/dist/utils/index.js"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,uDAA6B;AAC7B;AACE;AACA;AACF,qJAAC","file":"/home/runner/work/eloquent/eloquent/packages/@elqnt/agents/dist/utils/index.js"}
@@ -1,8 +1,7 @@
1
- "use client";
2
1
  import {
3
2
  toDefaultDefinitions,
4
3
  toDefaultDefinitionsArray
5
- } from "../chunk-HYR7PXFU.mjs";
4
+ } from "../chunk-YQFBZW6F.mjs";
6
5
  export {
7
6
  toDefaultDefinitions,
8
7
  toDefaultDefinitionsArray
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elqnt/agents",
3
- "version": "3.4.0",
3
+ "version": "4.0.0",
4
4
  "description": "Agent management and orchestration for Eloquent platform - models, browser & server APIs, React hooks, and utilities",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -43,7 +43,8 @@
43
43
  }
44
44
  },
45
45
  "files": [
46
- "dist"
46
+ "dist",
47
+ "SKILL.md"
47
48
  ],
48
49
  "repository": {
49
50
  "type": "git",
@@ -51,10 +52,10 @@
51
52
  "directory": "packages/agents"
52
53
  },
53
54
  "dependencies": {
54
- "@elqnt/kg": "3.0.2",
55
- "@elqnt/types": "2.0.14",
56
- "@elqnt/chat": "3.1.0",
57
- "@elqnt/api-client": "1.0.5"
55
+ "@elqnt/kg": "3.1.0",
56
+ "@elqnt/types": "2.2.0",
57
+ "@elqnt/api-client": "2.2.0",
58
+ "@elqnt/chat": "3.5.0"
58
59
  },
59
60
  "peerDependencies": {
60
61
  "react": "^18.0.0 || ^19.0.0"
@@ -64,10 +65,10 @@
64
65
  "react": "^19.0.0",
65
66
  "tsup": "^8.0.0",
66
67
  "typescript": "^5.0.0",
67
- "@elqnt/api-client": "1.0.5"
68
+ "@elqnt/api-client": "2.2.0"
68
69
  },
69
70
  "scripts": {
70
- "build": "tsup",
71
+ "build": "rm -rf dist && tsup",
71
72
  "dev": "tsup --watch",
72
73
  "clean": "rm -rf dist",
73
74
  "typecheck": "tsc --noEmit"
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/eloquent/eloquent/packages/@elqnt/agents/dist/chunk-2JDVRL35.js","../transport/sse.ts"],"names":[],"mappings":"AAAA,6rBAAY;AACZ;AACA;ACwCO,SAAS,sBAAA,CACd,OAAA,EACkB;AAClB,EAAA,MAAM,MAAA,mCAAQ,OAAA,2BAAS,OAAA,UAAS,OAAA;AAGhC,EAAA,IAAI,OAAA,EAAiC,CAAC,CAAA;AACtC,EAAA,IAAI,MAAA,EAA+B,cAAA;AACnC,EAAA,IAAI,KAAA;AAGJ,EAAA,MAAM,QAAA,kBAAU,IAAI,GAAA,CAAyB,CAAA;AAG7C,EAAA,MAAM,eAAA,kBAAiB,IAAI,GAAA,CAAkB,CAAA;AAC7C,EAAA,MAAM,aAAA,kBAAe,IAAI,GAAA,CAA+B,CAAA;AAIxD,EAAA,SAAS,GAAA,CAAA,GAAO,IAAA,EAAiB;AAC/B,IAAA,GAAA,CAAI,KAAA,EAAO,OAAA,CAAQ,GAAA,CAAI,oBAAA,EAAsB,GAAG,IAAI,CAAA;AAAA,EACtD;AAEA,EAAA,SAAS,IAAA,CAAK,KAAA,EAAqC;AAEjD,IAAA,IAAA,CAAA,MAAW,QAAA,GAAW,cAAA,EAAgB;AACpC,MAAA,IAAI;AACF,QAAA,OAAA,CAAQ,KAAK,CAAA;AAAA,MACf,EAAA,MAAA,CAAS,GAAA,EAAK;AACZ,QAAA,OAAA,CAAQ,KAAA,CAAM,mCAAA,EAAqC,GAAG,CAAA;AAAA,MACxD;AAAA,IACF;AAEA,IAAA,MAAM,SAAA,EAAW,YAAA,CAAa,GAAA,CAAI,KAAA,CAAM,IAAI,CAAA;AAC5C,IAAA,GAAA,CAAI,QAAA,EAAU;AACZ,MAAA,IAAA,CAAA,MAAW,QAAA,GAAW,QAAA,EAAU;AAC9B,QAAA,IAAI;AACF,UAAA,OAAA,CAAQ,KAAK,C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AACD,MAAA;AACL,MAAA;AACN,IAAA;AACQ,IAAA;AACR,IAAA;AACa,IAAA;AACL,IAAA;AACA,IAAA;AACJ,IAAA;AACN,EAAA;AAES,EAAA;AACA,IAAA;AACT,EAAA;AAES,EAAA;AACA,IAAA;AACT,EAAA;AAES,EAAA;AACC,IAAA;AACV,EAAA;AAEO,EAAA;AACL,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACF,EAAA;AACF;ADzEiB;AACA;AACA;AACA","file":"/home/runner/work/eloquent/eloquent/packages/@elqnt/agents/dist/chunk-2JDVRL35.js","sourcesContent":[null,"/**\n * Browser SSE Transport for Background Agent Progress\n *\n * Uses native EventSource for receiving agent progress events.\n * Follows the same factory pattern as @elqnt/docs/transport/sse.ts.\n *\n * @example\n * ```ts\n * import { createBGAgentTransport } from \"@elqnt/agents/transport\";\n *\n * const transport = createBGAgentTransport();\n * transport.connect();\n *\n * transport.on(\"bg_agent.round\", (event) => {\n * console.log(`Round ${event.round}: ${event.content}`);\n * });\n *\n * transport.on(\"bg_agent.completed\", (event) => {\n * console.log(\"Done:\", event.result);\n * });\n *\n * transport.streamJob(\"job-uuid-123\");\n *\n * // Clean up\n * transport.disconnect();\n * ```\n */\n\nimport type {\n BGAgentTransport,\n BGAgentTransportConfig,\n BGAgentTransportState,\n BGAgentTransportError,\n BGAgentTransportOptions,\n BGAgentEventType,\n EventHandler,\n Unsubscribe,\n BackgroundAgentProgressEvent,\n} from \"./types\";\n\nexport type { BGAgentTransportOptions };\n\nexport function createBGAgentTransport(\n options?: BGAgentTransportOptions\n): BGAgentTransport {\n const debug = options?.debug ?? false;\n\n // Internal state\n let config: BGAgentTransportConfig = {};\n let state: BGAgentTransportState = \"disconnected\";\n let error: BGAgentTransportError | undefined;\n\n // Active EventSource connections per jobId\n const streams = new Map<string, EventSource>();\n\n // Handler registry\n const globalHandlers = new Set<EventHandler>();\n const typeHandlers = new Map<string, Set<EventHandler>>();\n\n // ============== Internal Helpers ==============\n\n function log(...args: unknown[]) {\n if (debug) console.log(\"[BGAgentTransport]\", ...args);\n }\n\n function emit(event: BackgroundAgentProgressEvent) {\n // Global handlers\n for (const handler of globalHandlers) {\n try {\n handler(event);\n } catch (err) {\n console.error(\"[BGAgentTransport] Handler error:\", err);\n }\n }\n // Type-specific handlers\n const handlers = typeHandlers.get(event.type);\n if (handlers) {\n for (const handler of handlers) {\n try {\n handler(event);\n } catch (err) {\n console.error(\"[BGAgentTransport] Handler error:\", err);\n }\n }\n }\n }\n\n // ============== Transport Methods ==============\n\n function connect(cfg?: BGAgentTransportConfig): void {\n config = cfg || {};\n state = \"connected\";\n error = undefined;\n log(\"Connected\", config);\n }\n\n function streamJob(jobId: string): void {\n if (streams.has(jobId)) {\n log(\"Already streaming\", jobId);\n return;\n }\n\n const baseUrl = config.streamBaseUrl || \"\";\n const url = `${baseUrl}/api/v1/bg-agents/stream?jobId=${jobId}`;\n log(\"Opening stream\", url);\n\n const es = new EventSource(url);\n\n es.onmessage = (event) => {\n try {\n const data = JSON.parse(event.data) as BackgroundAgentProgressEvent;\n emit(data);\n\n // Auto-close on terminal events\n if (data.type === \"bg_agent.completed\" || data.type === \"bg_agent.failed\") {\n log(\"Terminal event, closing stream\", jobId, data.type);\n es.close();\n streams.delete(jobId);\n if (streams.size === 0) state = \"connected\";\n }\n } catch {\n // Ignore parse errors (heartbeat comments, etc.)\n }\n };\n\n es.onopen = () => {\n state = \"streaming\";\n error = undefined;\n log(\"Stream opened\", jobId);\n };\n\n es.onerror = () => {\n log(\"Stream error\", jobId);\n es.close();\n streams.delete(jobId);\n if (streams.size === 0) state = \"connected\";\n error = { code: \"STREAM_ERROR\", message: `SSE connection failed for job ${jobId}`, retryable: true };\n };\n\n streams.set(jobId, es);\n }\n\n function stopJob(jobId: string): void {\n const es = streams.get(jobId);\n if (es) {\n es.close();\n streams.delete(jobId);\n log(\"Stopped stream\", jobId);\n if (streams.size === 0) state = \"connected\";\n }\n }\n\n function onEvent(handler: EventHandler): Unsubscribe {\n globalHandlers.add(handler);\n return () => globalHandlers.delete(handler);\n }\n\n function on(eventType: BGAgentEventType, handler: EventHandler): Unsubscribe {\n if (!typeHandlers.has(eventType)) {\n typeHandlers.set(eventType, new Set());\n }\n typeHandlers.get(eventType)!.add(handler);\n return () => typeHandlers.get(eventType)?.delete(handler);\n }\n\n function disconnect(): void {\n for (const [jobId, es] of streams) {\n es.close();\n log(\"Closed stream\", jobId);\n }\n streams.clear();\n globalHandlers.clear();\n typeHandlers.clear();\n state = \"disconnected\";\n error = undefined;\n log(\"Disconnected\");\n }\n\n function getState(): BGAgentTransportState {\n return state;\n }\n\n function getError(): BGAgentTransportError | undefined {\n return error;\n }\n\n function clearError(): void {\n error = undefined;\n }\n\n return {\n connect,\n streamJob,\n stopJob,\n onEvent,\n on,\n disconnect,\n getState,\n getError,\n clearError,\n };\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/eloquent/eloquent/packages/@elqnt/agents/dist/chunk-3PFZRJ4A.js","../api/index.ts"],"names":[],"mappings":"AAAA,ylBAAY;AACZ;AACA;ACKA,oDAAkC;AAyClC,MAAA,SAAsB,aAAA,CAAc,OAAA,EAAqE;AACvG,EAAA,OAAO,wCAAA,gBAAkB,EAAkB,EAAE,MAAA,EAAQ,KAAA,EAAO,GAAG,QAAQ,CAAC,CAAA;AAC1E;AAEA,MAAA,SAAsB,oBAAA,CAAqB,OAAA,EAA4E;AACrH,EAAA,OAAO,wCAAA,wBAAkB,EAA0B,EAAE,MAAA,EAAQ,KAAA,EAAO,GAAG,QAAQ,CAAC,CAAA;AAClF;AAEA,MAAA,SAAsB,WAAA,CAAY,OAAA,EAAiB,OAAA,EAAgE;AACjH,EAAA,OAAO,wCAAA,CAAkB,eAAA,EAAkB,OAAO,CAAA,CAAA;AACpD;AAE4H;AAC7E,EAAA;AAC/C;AAE6E;AACzB,EAAA;AACpD;AAEyJ;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/eloquent/eloquent/packages/@elqnt/agents/dist/chunk-3PFZRJ4A.js","sourcesContent":[null,"/**\n * Agents API functions\n *\n * Browser-side API client for agent operations.\n * Uses @elqnt/api-client for HTTP requests with automatic token management.\n */\n\nimport { browserApiRequest } from \"@elqnt/api-client/browser\";\nimport type { ApiResponse, ApiClientOptions } from \"@elqnt/api-client\";\nimport type { ResponseMetadata } from \"@elqnt/types\";\nimport type {\n Agent,\n AgentSummary,\n AgentResponse,\n ListAgentsResponse,\n ListAgentsSummaryResponse,\n Skill,\n SkillResponse,\n SkillsListResponse,\n GetSkillsByIDsResponse,\n SubAgent,\n SubAgentResponse,\n SubAgentsListResponse,\n AgentWidget,\n AgentWidgetResponse,\n ListAgentWidgetsResponse,\n SkillUserConfig,\n SkillUserConfigResponse,\n SkillUserConfigListResponse,\n ResolveSkillConfigResponse,\n ToolDefinition,\n ToolDefinitionResponse,\n ToolDefinitionsListResponse,\n GetToolDefinitionsByIDsResponse,\n AgentJob,\n AgentJobResponse,\n AgentJobsListResponse,\n TriggerBackgroundAgentRequest,\n TriggerBackgroundAgentResponse,\n BackgroundAgentStatusResponse,\n StructuredOutputRequest,\n StructuredOutputResponse,\n} from \"../models\";\n\n// =============================================================================\n// AGENTS\n// =============================================================================\n\nexport async function listAgentsApi(options: ApiClientOptions): Promise<ApiResponse<ListAgentsResponse>> {\n return browserApiRequest(\"/api/v1/agents\", { method: \"GET\", ...options });\n}\n\nexport async function listAgentsSummaryApi(options: ApiClientOptions): Promise<ApiResponse<ListAgentsSummaryResponse>> {\n return browserApiRequest(\"/api/v1/agents/summary\", { method: \"GET\", ...options });\n}\n\nexport async function getAgentApi(agentId: string, options: ApiClientOptions): Promise<ApiResponse<AgentResponse>> {\n return browserApiRequest(`/api/v1/agents/${agentId}`, { method: \"GET\", ...options });\n}\n\nexport async function createAgentApi(agent: Partial<Agent>, options: ApiClientOptions): Promise<ApiResponse<AgentResponse>> {\n return browserApiRequest(\"/api/v1/agents\", { method: \"POST\", body: agent, ...options });\n}\n\nexport async function updateAgentApi(agentId: string, agent: Partial<Agent>, options: ApiClientOptions): Promise<ApiResponse<AgentResponse>> {\n return browserApiRequest(`/api/v1/agents/${agentId}`, { method: \"PUT\", body: agent, ...options });\n}\n\nexport async function deleteAgentApi(agentId: string, options: ApiClientOptions): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n return browserApiRequest(`/api/v1/agents/${agentId}`, { method: \"DELETE\", ...options });\n}\n\nexport async function getDefaultAgentApi(options: ApiClientOptions): Promise<ApiResponse<AgentResponse>> {\n return browserApiRequest(\"/api/v1/agents/default\", { method: \"GET\", ...options });\n}\n\nexport async function getAgentByNameApi(\n name: string,\n options: ApiClientOptions\n): Promise<ApiResponse<AgentResponse>> {\n return browserApiRequest(`/api/v1/agents/by-name?name=${encodeURIComponent(name)}`, {\n method: \"GET\",\n ...options,\n });\n}\n\nexport async function exportAgentApi(agentId: string, options: ApiClientOptions): Promise<Agent> {\n const resp = await browserApiRequest<AgentResponse>(`/api/v1/agents/${agentId}/export`, { method: \"GET\", ...options });\n const agent = (resp.data as AgentResponse)?.agent;\n if (!agent) throw new Error(\"Export returned no agent data\");\n return agent;\n}\n\nexport async function importAgentApi(agent: Agent, options: ApiClientOptions): Promise<ApiResponse<AgentResponse>> {\n return browserApiRequest(\"/api/v1/agents/import\", { method: \"POST\", body: agent, ...options });\n}\n\n// =============================================================================\n// SKILLS\n// =============================================================================\n\nexport async function listSkillsApi(options: ApiClientOptions): Promise<ApiResponse<SkillsListResponse>> {\n return browserApiRequest(\"/api/v1/skills\", { method: \"GET\", ...options });\n}\n\nexport async function getSkillApi(skillId: string, options: ApiClientOptions): Promise<ApiResponse<SkillResponse>> {\n return browserApiRequest(`/api/v1/skills/${skillId}`, { method: \"GET\", ...options });\n}\n\nexport async function getSkillsByIdsApi(ids: string[], options: ApiClientOptions): Promise<ApiResponse<GetSkillsByIDsResponse>> {\n return browserApiRequest(\"/api/v1/skills/by-ids\", { method: \"POST\", body: { ids }, ...options });\n}\n\nexport async function createSkillApi(skill: Partial<Skill>, options: ApiClientOptions): Promise<ApiResponse<SkillResponse>> {\n return browserApiRequest(\"/api/v1/skills\", { method: \"POST\", body: skill, ...options });\n}\n\nexport async function updateSkillApi(skillId: string, skill: Partial<Skill>, options: ApiClientOptions): Promise<ApiResponse<SkillResponse>> {\n return browserApiRequest(`/api/v1/skills/${skillId}`, { method: \"PUT\", body: skill, ...options });\n}\n\nexport async function deleteSkillApi(skillId: string, options: ApiClientOptions): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n return browserApiRequest(`/api/v1/skills/${skillId}`, { method: \"DELETE\", ...options });\n}\n\nexport async function searchSkillsApi(\n query: string,\n options: ApiClientOptions & { category?: string; limit?: number }\n): Promise<ApiResponse<SkillsListResponse>> {\n const params = new URLSearchParams();\n params.set(\"q\", query);\n if (options.category) params.set(\"category\", options.category);\n if (options.limit) params.set(\"limit\", String(options.limit));\n return browserApiRequest(`/api/v1/skills/search?${params.toString()}`, { method: \"GET\", ...options });\n}\n\n// =============================================================================\n// SKILL USER CONFIG\n// =============================================================================\n\nexport async function getSkillUserConfigApi(\n skillId: string,\n options: ApiClientOptions & { agentId?: string }\n): Promise<ApiResponse<SkillUserConfigResponse>> {\n const params = new URLSearchParams();\n if (options.agentId) params.set(\"agentId\", options.agentId);\n const query = params.toString();\n return browserApiRequest(`/api/v1/skills/${skillId}/user-config${query ? `?${query}` : \"\"}`, {\n method: \"GET\",\n ...options,\n });\n}\n\nexport async function updateSkillUserConfigApi(\n skillId: string,\n data: {\n enabled?: boolean;\n displayOrder?: number;\n config?: Record<string, unknown>;\n agentId?: string;\n },\n options: ApiClientOptions\n): Promise<ApiResponse<SkillUserConfigResponse>> {\n return browserApiRequest(`/api/v1/skills/${skillId}/user-config`, {\n method: \"PUT\",\n body: data,\n ...options,\n });\n}\n\nexport async function deleteSkillUserConfigApi(\n skillId: string,\n options: ApiClientOptions & { agentId?: string }\n): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n const params = new URLSearchParams();\n if (options.agentId) params.set(\"agentId\", options.agentId);\n const query = params.toString();\n return browserApiRequest(`/api/v1/skills/${skillId}/user-config${query ? `?${query}` : \"\"}`, {\n method: \"DELETE\",\n ...options,\n });\n}\n\nexport async function listSkillUserConfigsApi(\n options: ApiClientOptions & { agentId?: string; limit?: number; offset?: number }\n): Promise<ApiResponse<SkillUserConfigListResponse>> {\n const params = new URLSearchParams();\n if (options.agentId) params.set(\"agentId\", options.agentId);\n if (options.limit) params.set(\"limit\", String(options.limit));\n if (options.offset) params.set(\"offset\", String(options.offset));\n const query = params.toString();\n return browserApiRequest(`/api/v1/skills/user-configs${query ? `?${query}` : \"\"}`, {\n method: \"GET\",\n ...options,\n });\n}\n\nexport async function resolveSkillConfigApi(\n skillId: string,\n agentId: string,\n options: ApiClientOptions\n): Promise<ApiResponse<ResolveSkillConfigResponse>> {\n return browserApiRequest(`/api/v1/skills/${skillId}/resolve-config?agentId=${agentId}`, {\n method: \"GET\",\n ...options,\n });\n}\n\nexport async function updateSkillOrgConfigApi(\n skillId: string,\n data: {\n enabled?: boolean;\n displayOrder?: number;\n config?: Record<string, unknown>;\n },\n options: ApiClientOptions\n): Promise<ApiResponse<SkillUserConfigResponse>> {\n return browserApiRequest(`/api/v1/skills/${skillId}/org-config`, {\n method: \"PUT\",\n body: data,\n ...options,\n });\n}\n\n// =============================================================================\n// SUB-AGENTS\n// =============================================================================\n\nexport async function listSubAgentsApi(\n options: ApiClientOptions & { onlySystem?: boolean; enabled?: boolean }\n): Promise<ApiResponse<SubAgentsListResponse>> {\n const params = new URLSearchParams();\n if (options.onlySystem !== undefined) params.set(\"onlySystem\", String(options.onlySystem));\n if (options.enabled !== undefined) params.set(\"enabled\", String(options.enabled));\n const queryString = params.toString();\n return browserApiRequest(`/api/v1/subagents${queryString ? `?${queryString}` : \"\"}`, { method: \"GET\", ...options });\n}\n\nexport async function getSubAgentApi(subAgentId: string, options: ApiClientOptions): Promise<ApiResponse<SubAgentResponse>> {\n return browserApiRequest(`/api/v1/subagents/${subAgentId}`, { method: \"GET\", ...options });\n}\n\nexport async function createSubAgentApi(subAgent: Partial<SubAgent>, options: ApiClientOptions): Promise<ApiResponse<SubAgentResponse>> {\n return browserApiRequest(\"/api/v1/subagents\", { method: \"POST\", body: { subAgent }, ...options });\n}\n\nexport async function updateSubAgentApi(subAgentId: string, subAgent: Partial<SubAgent>, options: ApiClientOptions): Promise<ApiResponse<SubAgentResponse>> {\n return browserApiRequest(`/api/v1/subagents/${subAgentId}`, { method: \"PUT\", body: { subAgent }, ...options });\n}\n\nexport async function deleteSubAgentApi(subAgentId: string, options: ApiClientOptions): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n return browserApiRequest(`/api/v1/subagents/${subAgentId}`, { method: \"DELETE\", ...options });\n}\n\n// =============================================================================\n// WIDGETS\n// =============================================================================\n\nexport async function listWidgetsApi(agentId: string, options: ApiClientOptions): Promise<ApiResponse<ListAgentWidgetsResponse>> {\n return browserApiRequest(`/api/v1/agents/${agentId}/widgets`, { method: \"GET\", ...options });\n}\n\nexport async function getDefaultWidgetApi(agentId: string, options: ApiClientOptions): Promise<ApiResponse<AgentWidgetResponse>> {\n return browserApiRequest(`/api/v1/agents/${agentId}/widgets/default`, { method: \"GET\", ...options });\n}\n\nexport async function createWidgetApi(agentId: string, widget: Partial<AgentWidget>, options: ApiClientOptions): Promise<ApiResponse<AgentWidgetResponse>> {\n return browserApiRequest(`/api/v1/agents/${agentId}/widgets`, { method: \"POST\", body: { widget }, ...options });\n}\n\nexport async function getWidgetApi(widgetId: string, options: ApiClientOptions): Promise<ApiResponse<AgentWidgetResponse>> {\n return browserApiRequest(`/api/v1/widgets/${widgetId}`, { method: \"GET\", ...options });\n}\n\nexport async function getWidgetByWidgetIdApi(widgetId: string, baseUrl: string): Promise<ApiResponse<AgentWidgetResponse>> {\n return browserApiRequest(`/api/v1/widgets/by-widget-id/${widgetId}`, { method: \"GET\", baseUrl, orgId: \"\" });\n}\n\nexport async function updateWidgetApi(widgetId: string, widget: Partial<AgentWidget>, options: ApiClientOptions): Promise<ApiResponse<AgentWidgetResponse>> {\n return browserApiRequest(`/api/v1/widgets/${widgetId}`, { method: \"PUT\", body: { widget }, ...options });\n}\n\nexport async function deleteWidgetApi(widgetId: string, options: ApiClientOptions): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n return browserApiRequest(`/api/v1/widgets/${widgetId}`, { method: \"DELETE\", ...options });\n}\n\nexport async function setDefaultWidgetApi(widgetId: string, agentId: string, options: ApiClientOptions): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n return browserApiRequest(`/api/v1/widgets/${widgetId}/default`, { method: \"POST\", body: { agentId }, ...options });\n}\n\n// =============================================================================\n// STRUCTURED OUTPUT\n// =============================================================================\n\n/**\n * Call the one-shot structured-output LLM primitive.\n *\n * Sends `{ provider, model, prompts, schema }` through the API Gateway and\n * returns a typed JSON object matching the supplied schema. No tool use, no\n * streaming, no persistence — a single LLM roundtrip.\n *\n * @see docs/agents/structured-output.md\n * @typeParam T - Shape of the expected output (inferred from schema).\n */\nexport async function structuredOutputApi<T = unknown>(\n request: StructuredOutputRequest,\n options: ApiClientOptions\n): Promise<ApiResponse<StructuredOutputResponse<T>>> {\n return browserApiRequest<StructuredOutputResponse<T>>(\"/api/v1/agents/structured\", {\n method: \"POST\",\n body: request,\n ...options,\n });\n}\n\n// =============================================================================\n// ANALYTICS\n// =============================================================================\n\nexport interface DateFilter {\n from?: string;\n to?: string;\n}\n\nexport interface AnalyticsDataResponse {\n data: unknown[];\n metadata: ResponseMetadata;\n}\n\nexport async function getAgentChatsAnalyticsApi(\n params: { date_filter: DateFilter; agent_id?: string },\n options: ApiClientOptions\n): Promise<ApiResponse<AnalyticsDataResponse>> {\n return browserApiRequest(\"/api/v1/analytics/agents/chats\", {\n method: \"POST\",\n body: params,\n ...options,\n });\n}\n\nexport async function getAgentCSATAnalyticsApi(\n params: { date_filter: DateFilter; agent_id?: string },\n options: ApiClientOptions\n): Promise<ApiResponse<AnalyticsDataResponse>> {\n return browserApiRequest(\"/api/v1/analytics/agents/csat\", {\n method: \"POST\",\n body: params,\n ...options,\n });\n}\n\nexport async function getAgentListAnalyticsApi(\n options: ApiClientOptions\n): Promise<ApiResponse<AnalyticsDataResponse>> {\n return browserApiRequest(\"/api/v1/analytics/agents\", {\n method: \"GET\",\n ...options,\n });\n}\n\nexport async function getTaskOutcomesApi(\n params: { date_filter: DateFilter },\n options: ApiClientOptions\n): Promise<ApiResponse<AnalyticsDataResponse>> {\n return browserApiRequest(\"/api/v1/analytics/tasks\", {\n method: \"POST\",\n body: params,\n ...options,\n });\n}\n\n// =============================================================================\n// TOOL DEFINITIONS\n// =============================================================================\n\nexport async function listToolDefinitionsApi(\n options: ApiClientOptions & { onlySystem?: boolean; enabled?: boolean; limit?: number; offset?: number }\n): Promise<ApiResponse<ToolDefinitionsListResponse>> {\n const params = new URLSearchParams();\n if (options.onlySystem !== undefined) params.set(\"onlySystem\", String(options.onlySystem));\n if (options.enabled !== undefined) params.set(\"enabled\", String(options.enabled));\n if (options.limit !== undefined) params.set(\"limit\", String(options.limit));\n if (options.offset !== undefined) params.set(\"offset\", String(options.offset));\n const queryString = params.toString();\n return browserApiRequest(`/api/v1/tool-definitions${queryString ? `?${queryString}` : \"\"}`, { method: \"GET\", ...options });\n}\n\nexport async function getToolDefinitionApi(toolDefId: string, options: ApiClientOptions): Promise<ApiResponse<ToolDefinitionResponse>> {\n return browserApiRequest(`/api/v1/tool-definitions/${toolDefId}`, { method: \"GET\", ...options });\n}\n\nexport async function getToolDefinitionsByIdsApi(ids: string[], options: ApiClientOptions): Promise<ApiResponse<GetToolDefinitionsByIDsResponse>> {\n return browserApiRequest(\"/api/v1/tool-definitions/by-ids\", { method: \"POST\", body: { ids }, ...options });\n}\n\nexport async function createToolDefinitionApi(toolDefinition: Partial<ToolDefinition>, options: ApiClientOptions): Promise<ApiResponse<ToolDefinitionResponse>> {\n return browserApiRequest(\"/api/v1/tool-definitions\", { method: \"POST\", body: { toolDefinition }, ...options });\n}\n\nexport async function updateToolDefinitionApi(toolDefId: string, toolDefinition: Partial<ToolDefinition>, options: ApiClientOptions): Promise<ApiResponse<ToolDefinitionResponse>> {\n return browserApiRequest(`/api/v1/tool-definitions/${toolDefId}`, { method: \"PUT\", body: { toolDefinition }, ...options });\n}\n\nexport async function deleteToolDefinitionApi(toolDefId: string, options: ApiClientOptions): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n return browserApiRequest(`/api/v1/tool-definitions/${toolDefId}`, { method: \"DELETE\", ...options });\n}\n\n// =============================================================================\n// AGENT JOBS\n// =============================================================================\n\nexport async function listAgentJobsApi(\n options: ApiClientOptions & {\n agentId?: string;\n ownerId?: string;\n scope?: string;\n status?: string;\n frequency?: string;\n limit?: number;\n offset?: number;\n }\n): Promise<ApiResponse<AgentJobsListResponse>> {\n const params = new URLSearchParams();\n if (options.agentId) params.set(\"agentId\", options.agentId);\n if (options.ownerId) params.set(\"ownerId\", options.ownerId);\n if (options.scope) params.set(\"scope\", options.scope);\n if (options.status) params.set(\"status\", options.status);\n if (options.frequency) params.set(\"frequency\", options.frequency);\n if (options.limit !== undefined) params.set(\"limit\", String(options.limit));\n if (options.offset !== undefined) params.set(\"offset\", String(options.offset));\n const queryString = params.toString();\n return browserApiRequest(`/api/v1/agent-jobs${queryString ? `?${queryString}` : \"\"}`, { method: \"GET\", ...options });\n}\n\nexport async function getAgentJobApi(jobId: string, options: ApiClientOptions): Promise<ApiResponse<AgentJobResponse>> {\n return browserApiRequest(`/api/v1/agent-jobs/${jobId}`, { method: \"GET\", ...options });\n}\n\nexport async function createAgentJobApi(job: Partial<AgentJob>, options: ApiClientOptions): Promise<ApiResponse<AgentJobResponse>> {\n return browserApiRequest(\"/api/v1/agent-jobs\", { method: \"POST\", body: { job }, ...options });\n}\n\nexport async function updateAgentJobApi(jobId: string, job: Partial<AgentJob>, options: ApiClientOptions): Promise<ApiResponse<AgentJobResponse>> {\n return browserApiRequest(`/api/v1/agent-jobs/${jobId}`, { method: \"PUT\", body: { job }, ...options });\n}\n\nexport async function deleteAgentJobApi(jobId: string, options: ApiClientOptions): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n return browserApiRequest(`/api/v1/agent-jobs/${jobId}`, { method: \"DELETE\", ...options });\n}\n\nexport async function pauseAgentJobApi(jobId: string, options: ApiClientOptions): Promise<ApiResponse<AgentJobResponse>> {\n return browserApiRequest(`/api/v1/agent-jobs/${jobId}/pause`, { method: \"POST\", ...options });\n}\n\nexport async function resumeAgentJobApi(jobId: string, options: ApiClientOptions): Promise<ApiResponse<AgentJobResponse>> {\n return browserApiRequest(`/api/v1/agent-jobs/${jobId}/resume`, { method: \"POST\", ...options });\n}\n\n// =============================================================================\n// BACKGROUND AGENT TRIGGER\n// =============================================================================\n\nexport async function triggerBackgroundAgentApi(\n request: Pick<TriggerBackgroundAgentRequest, \"name\" | \"prompt\" | \"agentName\" | \"context\" | \"enableSSE\" | \"frequency\" | \"cron\" | \"timezone\" | \"scope\" | \"description\" | \"taskId\" | \"libraryId\">,\n options: ApiClientOptions\n): Promise<ApiResponse<TriggerBackgroundAgentResponse>> {\n return browserApiRequest(\"/api/v1/agent-jobs/trigger\", { method: \"POST\", body: request, ...options });\n}\n\nexport async function checkBackgroundAgentStatusApi(\n jobId: string,\n options: ApiClientOptions\n): Promise<ApiResponse<BackgroundAgentStatusResponse>> {\n return browserApiRequest(`/api/v1/agent-jobs/${jobId}/status`, { method: \"GET\", ...options });\n}\n\n// =============================================================================\n// BACKGROUND CHAT (Chat Service via API Gateway)\n// =============================================================================\n\nexport interface CreateBackgroundChatRequest {\n agentName: string;\n background: boolean;\n metadata?: Record<string, unknown>;\n}\n\nexport interface CreateBackgroundChatResponse {\n chatKey: string;\n}\n\nexport interface SendChatMessageRequest {\n chatKey: string;\n message: {\n role: string;\n content: string;\n };\n}\n\nexport interface SendChatMessageResponse {\n success: boolean;\n}\n\n// Re-export chat types from @elqnt/chat for convenience\nexport type { ChatMessage, Attachment } from \"@elqnt/chat/models\";\nimport type { ChatMessage } from \"@elqnt/chat/models\";\n\nexport interface LoadChatResponse {\n chat: {\n key: string;\n orgId: string;\n title?: string;\n status?: string;\n messages?: ChatMessage[];\n metadata?: Record<string, unknown>;\n lastUpdated?: number;\n };\n}\n\n/**\n * Create a background chat session via the chat service.\n * Uses the existing /v1/chat/create endpoint with background agent metadata.\n */\nexport async function createBackgroundChatApi(\n request: CreateBackgroundChatRequest,\n options: ApiClientOptions\n): Promise<ApiResponse<CreateBackgroundChatResponse>> {\n return browserApiRequest(\"/api/v1/chat/create\", {\n method: \"POST\",\n body: {\n orgId: options.orgId,\n metadata: {\n agentName: request.agentName,\n background: request.background,\n ...request.metadata,\n },\n },\n ...options,\n });\n}\n\n/**\n * Send a message to a chat session via the chat service.\n */\nexport async function sendChatMessageApi(\n request: SendChatMessageRequest,\n options: ApiClientOptions\n): Promise<ApiResponse<SendChatMessageResponse>> {\n return browserApiRequest(\"/api/v1/chat/send\", {\n method: \"POST\",\n body: {\n orgId: options.orgId,\n chatKey: request.chatKey,\n type: \"message\",\n message: request.message,\n },\n ...options,\n });\n}\n\n/**\n * Load a chat session including its messages via the chat service.\n */\nexport async function loadChatApi(\n chatKey: string,\n options: ApiClientOptions\n): Promise<ApiResponse<LoadChatResponse>> {\n return browserApiRequest(\"/api/v1/chat/load\", {\n method: \"POST\",\n body: {\n orgId: options.orgId,\n chatKey,\n },\n ...options,\n });\n}\n\n// =============================================================================\n// SKILL CATEGORIES\n// =============================================================================\n\nexport interface SkillCategoriesResponse {\n categories: string[];\n metadata: ResponseMetadata;\n}\n\nexport async function getSkillCategoriesApi(options: ApiClientOptions): Promise<ApiResponse<SkillCategoriesResponse>> {\n return browserApiRequest(\"/api/v1/skills/categories\", { method: \"GET\", ...options });\n}\n\n// =============================================================================\n// PROVISIONING\n// =============================================================================\n\nexport interface ProvisionAgentsResponse {\n agents?: Agent[];\n agentsCreated: number;\n subAgentsCreated: number;\n toolsCreated: number;\n skillsCreated: number;\n success: boolean;\n metadata: ResponseMetadata;\n}\n\n/**\n * Provision default agents for an organization.\n * Creates or updates agents, tools, sub-agents, and skills in bulk.\n *\n * @param definitions - Array of DefaultDefinitions to provision\n * @param options - API client options (baseUrl, orgId)\n */\nexport async function provisionAgentsApi(\n definitions: unknown[],\n options: ApiClientOptions\n): Promise<ApiResponse<ProvisionAgentsResponse>> {\n return browserApiRequest(\"/api/v1/admin/provision/agents\", {\n method: \"POST\",\n body: { definitions },\n ...options,\n });\n}\n\n// =============================================================================\n// INTEGRATIONS\n// =============================================================================\n\nimport type {\n UserIntegration,\n ListUserIntegrationsResponse,\n GetUserIntegrationResponse,\n ConnectIntegrationResponse,\n IntegrationCallbackResponse,\n DisconnectIntegrationResponse,\n RefreshIntegrationResponse,\n UpdateTriageEnabledResponse,\n RunEmailTriageResponse,\n IntegrationProviderTS,\n IntegrationTypeTS,\n} from \"../models\";\n\nexport async function listIntegrationsApi(\n options: ApiClientOptions\n): Promise<ApiResponse<ListUserIntegrationsResponse>> {\n return browserApiRequest(\"/api/v1/integrations\", { method: \"GET\", ...options });\n}\n\nexport async function getIntegrationApi(\n provider: IntegrationProviderTS,\n integrationType: IntegrationTypeTS,\n options: ApiClientOptions\n): Promise<ApiResponse<GetUserIntegrationResponse>> {\n return browserApiRequest(`/api/v1/integrations/${provider}/${integrationType}`, {\n method: \"GET\",\n ...options,\n });\n}\n\nexport async function connectIntegrationApi(\n params: {\n provider: IntegrationProviderTS;\n integrationType: IntegrationTypeTS;\n redirectUri: string;\n },\n options: ApiClientOptions\n): Promise<ApiResponse<ConnectIntegrationResponse>> {\n return browserApiRequest(\"/api/v1/integrations/connect\", {\n method: \"POST\",\n body: {\n provider: params.provider,\n integration_type: params.integrationType,\n redirect_uri: params.redirectUri,\n },\n ...options,\n });\n}\n\nexport async function integrationCallbackApi(\n params: {\n state: string;\n code: string;\n error?: string;\n },\n options: ApiClientOptions\n): Promise<ApiResponse<IntegrationCallbackResponse>> {\n return browserApiRequest(\"/api/v1/integrations/callback\", {\n method: \"POST\",\n body: params,\n ...options,\n });\n}\n\nexport async function disconnectIntegrationApi(\n params: {\n provider: IntegrationProviderTS;\n integrationType: IntegrationTypeTS;\n },\n options: ApiClientOptions\n): Promise<ApiResponse<DisconnectIntegrationResponse>> {\n return browserApiRequest(\"/api/v1/integrations/disconnect\", {\n method: \"POST\",\n body: {\n provider: params.provider,\n integration_type: params.integrationType,\n },\n ...options,\n });\n}\n\nexport async function refreshIntegrationApi(\n params: {\n provider: IntegrationProviderTS;\n integrationType: IntegrationTypeTS;\n },\n options: ApiClientOptions\n): Promise<ApiResponse<RefreshIntegrationResponse>> {\n return browserApiRequest(\"/api/v1/integrations/refresh\", {\n method: \"POST\",\n body: {\n provider: params.provider,\n integration_type: params.integrationType,\n },\n ...options,\n });\n}\n\nexport async function updateIntegrationTriageApi(\n params: {\n provider: IntegrationProviderTS;\n integrationType: IntegrationTypeTS;\n triageEnabled: boolean;\n },\n options: ApiClientOptions\n): Promise<ApiResponse<UpdateTriageEnabledResponse>> {\n return browserApiRequest(\"/api/v1/integrations/triage\", {\n method: \"PUT\",\n body: {\n provider: params.provider,\n integration_type: params.integrationType,\n triage_enabled: params.triageEnabled,\n },\n ...options,\n });\n}\n\nexport async function runEmailTriageApi(\n options: ApiClientOptions\n): Promise<ApiResponse<RunEmailTriageResponse>> {\n return browserApiRequest(\"/api/v1/integrations/triage/run\", {\n method: \"POST\",\n body: {},\n ...options,\n });\n}\n\n// =============================================================================\n// SANDBOX\n// =============================================================================\n\nimport type {\n Sandbox,\n CreateSandboxRequest,\n CreateSandboxResponse,\n GetSandboxResponse,\n UpdateSandboxRequest,\n UpdateSandboxResponse,\n ListSandboxesResponse,\n DeleteSandboxResponse,\n} from \"../models\";\n\n/**\n * Create a new sandbox from a prompt\n */\nexport async function createSandboxApi(\n request: Omit<CreateSandboxRequest, \"orgId\">,\n options: ApiClientOptions\n): Promise<ApiResponse<CreateSandboxResponse>> {\n return browserApiRequest(\"/api/v1/sandbox\", {\n method: \"POST\",\n body: request,\n timeout: 60000, // Sandbox generation can take time\n ...options,\n });\n}\n\n/**\n * Get a sandbox by ID\n */\nexport async function getSandboxApi(\n sandboxId: string,\n options: ApiClientOptions\n): Promise<ApiResponse<GetSandboxResponse>> {\n return browserApiRequest(`/api/v1/sandbox/${sandboxId}`, {\n method: \"GET\",\n ...options,\n });\n}\n\n/**\n * Update a sandbox via prompt\n */\nexport async function updateSandboxApi(\n sandboxId: string,\n request: Omit<UpdateSandboxRequest, \"id\" | \"orgId\">,\n options: ApiClientOptions\n): Promise<ApiResponse<UpdateSandboxResponse>> {\n return browserApiRequest(`/api/v1/sandbox/${sandboxId}`, {\n method: \"PUT\",\n body: request,\n timeout: 60000,\n ...options,\n });\n}\n\n/**\n * List sandboxes for the current user\n */\nexport async function listSandboxesApi(\n options: ApiClientOptions & { limit?: number }\n): Promise<ApiResponse<ListSandboxesResponse>> {\n const params = new URLSearchParams();\n if (options.limit) params.set(\"limit\", String(options.limit));\n const queryString = params.toString();\n return browserApiRequest(`/api/v1/sandbox${queryString ? `?${queryString}` : \"\"}`, {\n method: \"GET\",\n ...options,\n });\n}\n\n/**\n * Delete a sandbox\n */\nexport async function deleteSandboxApi(\n sandboxId: string,\n options: ApiClientOptions\n): Promise<ApiResponse<DeleteSandboxResponse>> {\n return browserApiRequest(`/api/v1/sandbox/${sandboxId}`, {\n method: \"DELETE\",\n ...options,\n });\n}\n\n// =============================================================================\n// SCHEDULER - TASKS\n// =============================================================================\n\nexport interface SchedulerTask {\n id: string;\n orgId: string;\n name?: string;\n description?: string;\n subject: string;\n fields?: Record<string, unknown>;\n status: \"scheduled\" | \"running\" | \"in-progress\" | \"completed\" | \"failed\" | \"cancelled\";\n progress: number;\n runAt: number;\n delay?: { amount?: number; unit?: string };\n recurring?: boolean;\n cronExpr?: string;\n maxRetries?: number;\n retryCount?: number;\n lastError?: string;\n metadata?: Record<string, unknown>;\n createdAt: string;\n updatedAt: string;\n completedAt?: string;\n createdBy?: string;\n updatedBy?: string;\n}\n\nexport interface SchedulerTaskResponse {\n task?: SchedulerTask;\n metadata: ResponseMetadata;\n}\n\nexport interface SchedulerTaskListResponse {\n tasks: SchedulerTask[];\n metadata: ResponseMetadata;\n}\n\nexport interface SchedulerSchedule {\n id: string;\n orgId: string;\n userId: string;\n userEmail: string;\n name: string;\n description?: string;\n cronExpression: string;\n timezone?: string;\n status: \"active\" | \"paused\" | \"failed\" | \"deleted\";\n action: {\n type: string;\n emailQuery?: string;\n taskTemplate?: {\n titleTemplate: string;\n descriptionTemplate?: string;\n type: string;\n priority: string;\n projectId: string;\n assignedTo?: string;\n };\n };\n lastRunAt?: string;\n nextRunAt?: string;\n runCount: number;\n lastError?: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface SchedulerScheduleResponse {\n schedule?: SchedulerSchedule;\n metadata: ResponseMetadata;\n}\n\nexport interface SchedulerScheduleListResponse {\n schedules: SchedulerSchedule[];\n metadata: ResponseMetadata;\n}\n\n/**\n * List scheduler tasks\n */\nexport async function listSchedulerTasksApi(\n options: ApiClientOptions & { status?: string; limit?: number; offset?: number }\n): Promise<ApiResponse<SchedulerTaskListResponse>> {\n const params = new URLSearchParams();\n if (options.status) params.set(\"status\", options.status);\n if (options.limit) params.set(\"limit\", String(options.limit));\n if (options.offset) params.set(\"offset\", String(options.offset));\n const queryString = params.toString();\n return browserApiRequest(`/api/v1/scheduler/tasks${queryString ? `?${queryString}` : \"\"}`, {\n method: \"GET\",\n ...options,\n });\n}\n\n/**\n * Create a scheduler task\n */\nexport async function createSchedulerTaskApi(\n task: Partial<SchedulerTask>,\n options: ApiClientOptions\n): Promise<ApiResponse<SchedulerTaskResponse>> {\n return browserApiRequest(\"/api/v1/scheduler/tasks\", {\n method: \"POST\",\n body: { task },\n ...options,\n });\n}\n\n/**\n * Get a scheduler task by ID\n */\nexport async function getSchedulerTaskApi(\n taskId: string,\n options: ApiClientOptions\n): Promise<ApiResponse<SchedulerTaskResponse>> {\n return browserApiRequest(`/api/v1/scheduler/tasks/${taskId}`, {\n method: \"GET\",\n ...options,\n });\n}\n\n/**\n * Update a scheduler task\n */\nexport async function updateSchedulerTaskApi(\n taskId: string,\n task: Partial<SchedulerTask>,\n options: ApiClientOptions\n): Promise<ApiResponse<SchedulerTaskResponse>> {\n return browserApiRequest(`/api/v1/scheduler/tasks/${taskId}`, {\n method: \"PUT\",\n body: { task },\n ...options,\n });\n}\n\n/**\n * Delete a scheduler task\n */\nexport async function deleteSchedulerTaskApi(\n taskId: string,\n options: ApiClientOptions\n): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n return browserApiRequest(`/api/v1/scheduler/tasks/${taskId}`, {\n method: \"DELETE\",\n ...options,\n });\n}\n\n/**\n * Snooze a scheduler task\n */\nexport async function snoozeSchedulerTaskApi(\n taskId: string,\n delay: { amount: number; unit: string },\n options: ApiClientOptions\n): Promise<ApiResponse<SchedulerTaskResponse>> {\n return browserApiRequest(`/api/v1/scheduler/tasks/${taskId}/snooze`, {\n method: \"POST\",\n body: { delay },\n ...options,\n });\n}\n\n/**\n * Mark a scheduler task as complete\n */\nexport async function completeSchedulerTaskApi(\n taskId: string,\n options: ApiClientOptions\n): Promise<ApiResponse<SchedulerTaskResponse>> {\n return browserApiRequest(`/api/v1/scheduler/tasks/${taskId}/complete`, {\n method: \"POST\",\n body: {},\n ...options,\n });\n}\n\n/**\n * Start a scheduler task manually\n */\nexport async function startSchedulerTaskApi(\n taskId: string,\n options: ApiClientOptions\n): Promise<ApiResponse<SchedulerTaskResponse>> {\n return browserApiRequest(`/api/v1/scheduler/tasks/${taskId}/start`, {\n method: \"POST\",\n body: {},\n ...options,\n });\n}\n\n// =============================================================================\n// SCHEDULER - SCHEDULES\n// =============================================================================\n\n/**\n * List schedules\n */\nexport async function listSchedulesApi(\n options: ApiClientOptions & { status?: string; limit?: number; offset?: number }\n): Promise<ApiResponse<SchedulerScheduleListResponse>> {\n const params = new URLSearchParams();\n if (options.status) params.set(\"status\", options.status);\n if (options.limit) params.set(\"limit\", String(options.limit));\n if (options.offset) params.set(\"offset\", String(options.offset));\n const queryString = params.toString();\n return browserApiRequest(`/api/v1/scheduler/schedules${queryString ? `?${queryString}` : \"\"}`, {\n method: \"GET\",\n ...options,\n });\n}\n\n/**\n * Create a schedule\n */\nexport async function createScheduleApi(\n schedule: Partial<SchedulerSchedule>,\n options: ApiClientOptions\n): Promise<ApiResponse<SchedulerScheduleResponse>> {\n return browserApiRequest(\"/api/v1/scheduler/schedules\", {\n method: \"POST\",\n body: { schedule },\n ...options,\n });\n}\n\n/**\n * Get a schedule by ID\n */\nexport async function getScheduleApi(\n scheduleId: string,\n options: ApiClientOptions\n): Promise<ApiResponse<SchedulerScheduleResponse>> {\n return browserApiRequest(`/api/v1/scheduler/schedules/${scheduleId}`, {\n method: \"GET\",\n ...options,\n });\n}\n\n/**\n * Update a schedule\n */\nexport async function updateScheduleApi(\n scheduleId: string,\n schedule: Partial<SchedulerSchedule>,\n options: ApiClientOptions\n): Promise<ApiResponse<SchedulerScheduleResponse>> {\n return browserApiRequest(`/api/v1/scheduler/schedules/${scheduleId}`, {\n method: \"PUT\",\n body: { schedule },\n ...options,\n });\n}\n\n/**\n * Delete a schedule\n */\nexport async function deleteScheduleApi(\n scheduleId: string,\n options: ApiClientOptions\n): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n return browserApiRequest(`/api/v1/scheduler/schedules/${scheduleId}`, {\n method: \"DELETE\",\n ...options,\n });\n}\n\n/**\n * Pause a schedule\n */\nexport async function pauseScheduleApi(\n scheduleId: string,\n options: ApiClientOptions\n): Promise<ApiResponse<SchedulerScheduleResponse>> {\n return browserApiRequest(`/api/v1/scheduler/schedules/${scheduleId}/pause`, {\n method: \"POST\",\n body: {},\n ...options,\n });\n}\n\n/**\n * Resume a paused schedule\n */\nexport async function resumeScheduleApi(\n scheduleId: string,\n options: ApiClientOptions\n): Promise<ApiResponse<SchedulerScheduleResponse>> {\n return browserApiRequest(`/api/v1/scheduler/schedules/${scheduleId}/resume`, {\n method: \"POST\",\n body: {},\n ...options,\n });\n}\n\n/**\n * Run a schedule immediately\n */\nexport async function runScheduleApi(\n scheduleId: string,\n options: ApiClientOptions\n): Promise<ApiResponse<SchedulerScheduleResponse>> {\n return browserApiRequest(`/api/v1/scheduler/schedules/${scheduleId}/run`, {\n method: \"POST\",\n body: {},\n ...options,\n });\n}\n\n// Re-export types from models\nexport type {\n StructuredOutputRequest,\n StructuredOutputResponse,\n StructuredOutputProvider,\n StructuredOutputUsage,\n} from \"../models\";\n\nexport type {\n Agent,\n AgentSummary,\n Skill,\n SubAgent,\n AgentWidget,\n SkillUserConfig,\n SkillUserConfigResponse,\n SkillUserConfigListResponse,\n ResolveSkillConfigResponse,\n ToolDefinition,\n ToolDefinitionResponse,\n ToolDefinitionsListResponse,\n GetToolDefinitionsByIDsResponse,\n AgentJob,\n AgentJobResponse,\n AgentJobsListResponse,\n // Integration types\n UserIntegration,\n ListUserIntegrationsResponse,\n GetUserIntegrationResponse,\n ConnectIntegrationResponse,\n IntegrationCallbackResponse,\n DisconnectIntegrationResponse,\n RefreshIntegrationResponse,\n UpdateTriageEnabledResponse,\n RunEmailTriageResponse,\n IntegrationProviderTS,\n IntegrationTypeTS,\n // Sandbox types\n Sandbox,\n CreateSandboxRequest,\n CreateSandboxResponse,\n GetSandboxResponse,\n UpdateSandboxRequest,\n UpdateSandboxResponse,\n ListSandboxesResponse,\n DeleteSandboxResponse,\n} from \"../models\";\n"]}