@nemphi/sdk 0.5.5400 → 0.6.5415

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 (172) hide show
  1. package/dist/generated/agents/client.d.ts +28 -29
  2. package/dist/generated/agents/client.d.ts.map +1 -1
  3. package/dist/generated/agents/client.js.map +1 -1
  4. package/dist/generated/analytics/client.d.ts +4 -4
  5. package/dist/generated/analytics/client.d.ts.map +1 -1
  6. package/dist/generated/analytics/client.js.map +1 -1
  7. package/dist/generated/analytics/index.d.ts +1 -1
  8. package/dist/generated/analytics/index.d.ts.map +1 -1
  9. package/dist/generated/analytics/models.d.ts +0 -3
  10. package/dist/generated/analytics/models.d.ts.map +1 -1
  11. package/dist/generated/analytics/models.js.map +1 -1
  12. package/dist/generated/apps/client.d.ts +4 -5
  13. package/dist/generated/apps/client.d.ts.map +1 -1
  14. package/dist/generated/apps/client.js.map +1 -1
  15. package/dist/generated/callcenter/client.d.ts +2 -24
  16. package/dist/generated/callcenter/client.d.ts.map +1 -1
  17. package/dist/generated/callcenter/client.js +0 -9
  18. package/dist/generated/callcenter/client.js.map +1 -1
  19. package/dist/generated/callcenter/index.d.ts +2 -2
  20. package/dist/generated/callcenter/index.d.ts.map +1 -1
  21. package/dist/generated/callcenter/models.d.ts +0 -3
  22. package/dist/generated/callcenter/models.d.ts.map +1 -1
  23. package/dist/generated/callcenter/models.js.map +1 -1
  24. package/dist/generated/categories/client.d.ts +2 -2
  25. package/dist/generated/categories/client.d.ts.map +1 -1
  26. package/dist/generated/categories/client.js.map +1 -1
  27. package/dist/generated/categories/index.d.ts +1 -1
  28. package/dist/generated/categories/index.d.ts.map +1 -1
  29. package/dist/generated/categories/models.d.ts +0 -1
  30. package/dist/generated/categories/models.d.ts.map +1 -1
  31. package/dist/generated/categories/models.js.map +1 -1
  32. package/dist/generated/client.d.ts +0 -4
  33. package/dist/generated/client.d.ts.map +1 -1
  34. package/dist/generated/client.js +0 -10
  35. package/dist/generated/client.js.map +1 -1
  36. package/dist/generated/crm/client.d.ts +2 -2
  37. package/dist/generated/crm/client.d.ts.map +1 -1
  38. package/dist/generated/crm/client.js.map +1 -1
  39. package/dist/generated/crm/index.d.ts +1 -1
  40. package/dist/generated/crm/index.d.ts.map +1 -1
  41. package/dist/generated/crm/models.d.ts +0 -1
  42. package/dist/generated/crm/models.d.ts.map +1 -1
  43. package/dist/generated/crm/models.js.map +1 -1
  44. package/dist/generated/dashboards/client.d.ts +3 -3
  45. package/dist/generated/dashboards/client.d.ts.map +1 -1
  46. package/dist/generated/dashboards/client.js +3 -3
  47. package/dist/generated/dashboards/client.js.map +1 -1
  48. package/dist/generated/dashboards/index.d.ts +1 -1
  49. package/dist/generated/dashboards/index.d.ts.map +1 -1
  50. package/dist/generated/dashboards/models.d.ts +444 -0
  51. package/dist/generated/dashboards/models.d.ts.map +1 -1
  52. package/dist/generated/dashboards/models.js +26 -0
  53. package/dist/generated/dashboards/models.js.map +1 -1
  54. package/dist/generated/einvoice/client.d.ts +2 -2
  55. package/dist/generated/einvoice/client.d.ts.map +1 -1
  56. package/dist/generated/einvoice/client.js.map +1 -1
  57. package/dist/generated/einvoice/index.d.ts +1 -1
  58. package/dist/generated/einvoice/index.d.ts.map +1 -1
  59. package/dist/generated/einvoice/models.d.ts +0 -1
  60. package/dist/generated/einvoice/models.d.ts.map +1 -1
  61. package/dist/generated/einvoice/models.js.map +1 -1
  62. package/dist/generated/email/models.d.ts +0 -2
  63. package/dist/generated/email/models.d.ts.map +1 -1
  64. package/dist/generated/email/models.js +0 -2
  65. package/dist/generated/email/models.js.map +1 -1
  66. package/dist/generated/imports/client.d.ts +5 -6
  67. package/dist/generated/imports/client.d.ts.map +1 -1
  68. package/dist/generated/imports/client.js.map +1 -1
  69. package/dist/generated/imports/index.d.ts +0 -1
  70. package/dist/generated/imports/index.d.ts.map +1 -1
  71. package/dist/generated/inventory/client.d.ts +1 -29
  72. package/dist/generated/inventory/client.d.ts.map +1 -1
  73. package/dist/generated/inventory/client.js +1 -9
  74. package/dist/generated/inventory/client.js.map +1 -1
  75. package/dist/generated/inventory/index.d.ts +2 -2
  76. package/dist/generated/inventory/index.d.ts.map +1 -1
  77. package/dist/generated/inventory/models.d.ts +0 -127
  78. package/dist/generated/inventory/models.d.ts.map +1 -1
  79. package/dist/generated/inventory/models.js +0 -91
  80. package/dist/generated/inventory/models.js.map +1 -1
  81. package/dist/generated/ledger/client.d.ts +7 -7
  82. package/dist/generated/ledger/client.d.ts.map +1 -1
  83. package/dist/generated/ledger/client.js.map +1 -1
  84. package/dist/generated/ledger/index.d.ts +1 -1
  85. package/dist/generated/ledger/index.d.ts.map +1 -1
  86. package/dist/generated/ledger/models.d.ts +0 -6
  87. package/dist/generated/ledger/models.d.ts.map +1 -1
  88. package/dist/generated/ledger/models.js.map +1 -1
  89. package/dist/generated/marketing/client.d.ts +1 -534
  90. package/dist/generated/marketing/client.d.ts.map +1 -1
  91. package/dist/generated/marketing/client.js +3 -176
  92. package/dist/generated/marketing/client.js.map +1 -1
  93. package/dist/generated/marketing/index.d.ts +2 -2
  94. package/dist/generated/marketing/index.d.ts.map +1 -1
  95. package/dist/generated/marketing/models.d.ts +0 -151
  96. package/dist/generated/marketing/models.d.ts.map +1 -1
  97. package/dist/generated/marketing/models.js +0 -88
  98. package/dist/generated/marketing/models.js.map +1 -1
  99. package/dist/generated/messages/client.d.ts +2 -6
  100. package/dist/generated/messages/client.d.ts.map +1 -1
  101. package/dist/generated/messages/client.js.map +1 -1
  102. package/dist/generated/messages/models.d.ts +0 -1
  103. package/dist/generated/messages/models.d.ts.map +1 -1
  104. package/dist/generated/messages/models.js +0 -1
  105. package/dist/generated/messages/models.js.map +1 -1
  106. package/dist/generated/onboarding/client.d.ts +2 -2
  107. package/dist/generated/onboarding/client.d.ts.map +1 -1
  108. package/dist/generated/onboarding/client.js.map +1 -1
  109. package/dist/generated/onboarding/index.d.ts +1 -1
  110. package/dist/generated/onboarding/index.d.ts.map +1 -1
  111. package/dist/generated/onboarding/models.d.ts +0 -1
  112. package/dist/generated/onboarding/models.d.ts.map +1 -1
  113. package/dist/generated/onboarding/models.js.map +1 -1
  114. package/dist/generated/payroll/client.d.ts +2 -2
  115. package/dist/generated/payroll/client.d.ts.map +1 -1
  116. package/dist/generated/payroll/client.js.map +1 -1
  117. package/dist/generated/payroll/index.d.ts +1 -1
  118. package/dist/generated/payroll/index.d.ts.map +1 -1
  119. package/dist/generated/payroll/models.d.ts +0 -1
  120. package/dist/generated/payroll/models.d.ts.map +1 -1
  121. package/dist/generated/payroll/models.js.map +1 -1
  122. package/dist/generated/tax/client.d.ts +3 -3
  123. package/dist/generated/tax/client.d.ts.map +1 -1
  124. package/dist/generated/tax/client.js.map +1 -1
  125. package/dist/generated/tax/index.d.ts +1 -1
  126. package/dist/generated/tax/index.d.ts.map +1 -1
  127. package/dist/generated/tax/models.d.ts +0 -2
  128. package/dist/generated/tax/models.d.ts.map +1 -1
  129. package/dist/generated/tax/models.js.map +1 -1
  130. package/dist/generated/tenants/client.d.ts +37 -70
  131. package/dist/generated/tenants/client.d.ts.map +1 -1
  132. package/dist/generated/tenants/client.js +10 -18
  133. package/dist/generated/tenants/client.js.map +1 -1
  134. package/dist/generated/tenants/index.d.ts +2 -2
  135. package/dist/generated/tenants/index.d.ts.map +1 -1
  136. package/dist/generated/tenants/models.d.ts +9 -40
  137. package/dist/generated/tenants/models.d.ts.map +1 -1
  138. package/dist/generated/tenants/models.js +8 -29
  139. package/dist/generated/tenants/models.js.map +1 -1
  140. package/dist/index.d.ts +126 -497
  141. package/dist/index.d.ts.map +1 -1
  142. package/dist/index.js +174 -240
  143. package/dist/index.js.map +1 -1
  144. package/package.json +1 -1
  145. package/dist/generated/browser/client.d.ts +0 -106
  146. package/dist/generated/browser/client.d.ts.map +0 -1
  147. package/dist/generated/browser/client.js +0 -38
  148. package/dist/generated/browser/client.js.map +0 -1
  149. package/dist/generated/browser/index.d.ts +0 -6
  150. package/dist/generated/browser/index.d.ts.map +0 -1
  151. package/dist/generated/browser/index.js +0 -5
  152. package/dist/generated/browser/index.js.map +0 -1
  153. package/dist/generated/browser/models.d.ts +0 -49
  154. package/dist/generated/browser/models.d.ts.map +0 -1
  155. package/dist/generated/browser/models.js +0 -28
  156. package/dist/generated/browser/models.js.map +0 -1
  157. package/dist/generated/filesync/client.d.ts +0 -220
  158. package/dist/generated/filesync/client.d.ts.map +0 -1
  159. package/dist/generated/filesync/client.js +0 -73
  160. package/dist/generated/filesync/client.js.map +0 -1
  161. package/dist/generated/filesync/index.d.ts +0 -6
  162. package/dist/generated/filesync/index.d.ts.map +0 -1
  163. package/dist/generated/filesync/index.js +0 -5
  164. package/dist/generated/filesync/index.js.map +0 -1
  165. package/dist/generated/filesync/models.d.ts +0 -32
  166. package/dist/generated/filesync/models.d.ts.map +0 -1
  167. package/dist/generated/filesync/models.js +0 -19
  168. package/dist/generated/filesync/models.js.map +0 -1
  169. package/dist/generated/imports/models.d.ts +0 -6
  170. package/dist/generated/imports/models.d.ts.map +0 -1
  171. package/dist/generated/imports/models.js +0 -4
  172. package/dist/generated/imports/models.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -577,13 +577,12 @@ export interface Notification {
577
577
  seq?: number;
578
578
  }
579
579
  /**
580
- * One realtime event of the workspace (`openRealtimeSocket` and
581
- * `streamEvents`, the frames of `GET /v1/events/stream` and
582
- * `GET /v1/events/socket`), which every member hears. `action` and
583
- * `notification` are wakeups — re-read the surface, the row itself comes by
584
- * cursor; the rest is state that only matters while someone is watching. A
585
- * chat thread's answers are not among them: they are only its members' to
586
- * read, on the thread's own stream (`streamThread`, `ThreadStreamEvent`).
580
+ * One realtime event of the workspace (`openRealtimeSocket`, which polls
581
+ * `GET /v1/events/poll`; the frames of `GET /v1/events/stream` and
582
+ * `GET /v1/events/socket`).
583
+ * `action` and `notification` are wakeups — re-read the surface, the row
584
+ * itself comes by cursor; the rest is state that only matters while
585
+ * someone is watching.
587
586
  */
588
587
  export type RealtimeEvent = {
589
588
  type: "action";
@@ -604,6 +603,25 @@ export type RealtimeEvent = {
604
603
  channel_id: string;
605
604
  /** A message landed, a delivery status changed, or the thread was read. */
606
605
  change: "message" | "status" | "read";
606
+ } | {
607
+ type: "run";
608
+ /** The chat thread this run works in; only thread work is published. */
609
+ thread_id: string;
610
+ run_id: string;
611
+ agent_definition: string;
612
+ /** What the step returned: continue (still working), parked (waiting), idle (a resting session), done. */
613
+ outcome: "continue" | "parked" | "idle" | "done";
614
+ } | {
615
+ type: "run_delta";
616
+ /** The chat thread the run answers in. */
617
+ thread_id: string;
618
+ run_id: string;
619
+ /** The step the model turn will be stored as; a higher one is a new turn. */
620
+ seq: number;
621
+ /** The frame's place within the turn, from 0. */
622
+ n: number;
623
+ /** Prose the model generated since the previous frame. */
624
+ text: string;
607
625
  } | {
608
626
  type: "typing";
609
627
  /** A workspace chat thread or a marketing inbox conversation. */
@@ -635,31 +653,6 @@ export type RealtimeEvent = {
635
653
  /** ISO instant after which a reader drops them unless the signal repeats. */
636
654
  until: string;
637
655
  };
638
- /**
639
- * One frame of a chat thread's own stream (`streamThread`), which only a
640
- * member who sits in the thread may read: a piece of the answer a run is
641
- * writing (`run_delta`), or a run step's end (`run`).
642
- */
643
- export type ThreadStreamEvent = {
644
- type: "run";
645
- /** The chat thread this run works in; only thread work is published. */
646
- thread_id: string;
647
- run_id: string;
648
- agent_definition: string;
649
- /** What the step returned: continue (still working), parked (waiting), idle (a resting session), done. */
650
- outcome: "continue" | "parked" | "idle" | "done";
651
- } | {
652
- type: "run_delta";
653
- /** The chat thread the run answers in. */
654
- thread_id: string;
655
- run_id: string;
656
- /** The step the model turn will be stored as; a higher one is a new turn. */
657
- seq: number;
658
- /** The frame's place within the turn, from 0. */
659
- n: number;
660
- /** Prose the model generated since the previous frame. */
661
- text: string;
662
- };
663
656
  /** Where a person is typing: a chat thread or a marketing inbox conversation. */
664
657
  export type TypingScope = Extract<RealtimeEvent, {
665
658
  type: "typing";
@@ -678,7 +671,7 @@ export interface RealtimeSocketOptions {
678
671
  /** Called when a poll fails after one answered. */
679
672
  onClose?: () => void;
680
673
  /**
681
- * Ignored: the subscription reads `GET /v1/events/stream` over `fetch`
674
+ * Ignored: the subscription polls `GET /v1/events/poll` over `fetch`
682
675
  * rather than holding a WebSocket. Kept so existing callers compile.
683
676
  */
684
677
  webSocket?: (url: string, headers: Record<string, string>) => WebSocket;
@@ -1601,46 +1594,6 @@ export interface LiveDocumentFolder {
1601
1594
  name: string;
1602
1595
  created_at: string;
1603
1596
  }
1604
- /**
1605
- * One item of the desktop folder sync's feed (`filesync.changes`,
1606
- * docs/file-sync.md). A deleted item carries only `id` and `deleted: true`.
1607
- * `size` is null for a live document (its Office export is rendered on demand).
1608
- */
1609
- export interface FileSyncItem {
1610
- id: string;
1611
- type?: "folder" | "file" | "doc" | "sheet" | "slides";
1612
- /** `personal`, `team`, `shared`, `root` or a folder id. */
1613
- parent_id?: string;
1614
- name?: string;
1615
- size?: number | null;
1616
- content_type?: string;
1617
- /** Changes when the content or the metadata change; a write names it as `base_version`. */
1618
- version?: string;
1619
- /** Changes only when the bytes would; the content routes' ETag and If-Match. */
1620
- content_version?: string;
1621
- modified_at?: string;
1622
- writable?: boolean;
1623
- deleted: boolean;
1624
- }
1625
- /** `filesync.changes`' input: no cursor starts a full listing. */
1626
- export interface FileSyncChangesInput {
1627
- cursor?: string;
1628
- limit?: number;
1629
- }
1630
- /** `filesync.move`'s input: a new parent, a new name, or both. */
1631
- export interface FileSyncMoveInput {
1632
- id: string;
1633
- base_version: string;
1634
- parent_id?: string;
1635
- name?: string;
1636
- }
1637
- /** A page of `filesync.changes`: keep calling with `cursor` while `has_more`; `reset` means list again. */
1638
- export interface FileSyncPage {
1639
- items: FileSyncItem[];
1640
- cursor: string;
1641
- has_more: boolean;
1642
- reset: boolean;
1643
- }
1644
1597
  /** Who a personal document is shared with (`knowledge.list_doc_shares`). */
1645
1598
  export interface LiveDocumentShares {
1646
1599
  live_document_id: string;
@@ -2274,13 +2227,9 @@ export interface MessageThreadFile {
2274
2227
  shared_by_id: string | null;
2275
2228
  shared_by_name: string;
2276
2229
  }
2277
- /**
2278
- * Result of messages.list_files. `total` is the thread's whole tally,
2279
- * independent of page_size; `next_cursor` asks for the shares after this page.
2280
- */
2230
+ /** Result of messages.list_files. `total` is the thread's whole tally, independent of page_size. */
2281
2231
  export interface MessageThreadFileList {
2282
2232
  files: MessageThreadFile[];
2283
- next_cursor: string | null;
2284
2233
  total: number;
2285
2234
  }
2286
2235
  export interface MessageMention {
@@ -3197,114 +3146,6 @@ export interface InventoryValuation {
3197
3146
  difference_cents?: number;
3198
3147
  in_agreement?: boolean;
3199
3148
  }
3200
- /** One item × warehouse on the inventory page (`inventory.overview`). */
3201
- export interface InventoryOverviewLevel extends StockLevel {
3202
- quantity_on_rent: number;
3203
- quantity_reserved: number;
3204
- quantity_available: number;
3205
- rentable: boolean;
3206
- /** Units in and out (both positive) in the month asked for. */
3207
- month_in: number;
3208
- month_out: number;
3209
- /** The owned quantity at each of the last twelve week ends, oldest first; the last is today. */
3210
- trend: number[];
3211
- }
3212
- /** A month's movements of one type in one warehouse, summed. */
3213
- export interface InventoryOverviewFlow {
3214
- warehouse_id: string;
3215
- /** A StockMovementType, or a rental custody move (rental_out, rental_return, rental_loss). */
3216
- movement_type: string;
3217
- /** Signed: positive in, negative out. */
3218
- quantity: number;
3219
- value_cents: number;
3220
- movements: number;
3221
- }
3222
- /** One movement of the month on the inventory page. */
3223
- export interface InventoryOverviewMovement {
3224
- id: string;
3225
- item_id: string;
3226
- item_code: string | null;
3227
- item_name: string;
3228
- unit_code: string;
3229
- warehouse_id: string;
3230
- /** A StockMovementType, or a rental custody move (rental_out, rental_return, rental_loss). */
3231
- movement_type: string;
3232
- quantity: number;
3233
- unit_cost_cents: number;
3234
- total_cost_cents: number;
3235
- occurred_at: string;
3236
- reference: string | null;
3237
- notes: string | null;
3238
- source_type: string | null;
3239
- }
3240
- /** An open physical count with what has been found so far. */
3241
- export interface InventoryOverviewCount {
3242
- id: string;
3243
- warehouse_id: string;
3244
- counted_on: string;
3245
- reference: string | null;
3246
- lines: {
3247
- item_id: string;
3248
- expected_quantity: number;
3249
- counted_quantity: number | null;
3250
- }[];
3251
- }
3252
- /** The inventory page in one read (`inventory.overview`). Values in cents. */
3253
- export interface InventoryOverview {
3254
- today: string;
3255
- /** YYYY-MM whose movements and flows these are. */
3256
- month: string;
3257
- currency: string;
3258
- warehouses: {
3259
- id: string;
3260
- code: string;
3261
- name: string;
3262
- is_default: boolean;
3263
- active: boolean;
3264
- }[];
3265
- /** The active items that keep stock. */
3266
- items: {
3267
- id: string;
3268
- code: string | null;
3269
- name: string;
3270
- unit_code: string;
3271
- reorder_point: number | null;
3272
- }[];
3273
- levels: InventoryOverviewLevel[];
3274
- flows: InventoryOverviewFlow[];
3275
- movements: InventoryOverviewMovement[];
3276
- /** Twelve months per warehouse ending with `month`: value in, out and at close. */
3277
- history: {
3278
- warehouse_id: string;
3279
- months: {
3280
- month: string;
3281
- in_cents: number;
3282
- out_cents: number;
3283
- closing_cents: number;
3284
- }[];
3285
- }[];
3286
- stock_value_cents: number;
3287
- ledger_balance_cents: number;
3288
- difference_cents: number;
3289
- low_stock_count: number;
3290
- reorder: {
3291
- estimated_total_cost_cents: number;
3292
- suggestions: ReorderSuggestion[];
3293
- };
3294
- open_counts: InventoryOverviewCount[];
3295
- /** Whether there were more levels or movements than the page carries. */
3296
- truncated: boolean;
3297
- /** Which of the page's writes the caller's role reaches. */
3298
- can: {
3299
- adjust: boolean;
3300
- transfer: boolean;
3301
- count_start: boolean;
3302
- count_record: boolean;
3303
- count_post: boolean;
3304
- opening_balance: boolean;
3305
- warehouses_create: boolean;
3306
- };
3307
- }
3308
3149
  export interface ReorderSuggestion {
3309
3150
  item_id: string;
3310
3151
  item_code: string | null;
@@ -5116,55 +4957,6 @@ export interface MarketingInboxTopic {
5116
4957
  description?: string;
5117
4958
  }
5118
4959
  /** An inbox conversation on a connected marketing channel (WhatsApp Business threads today). */
5119
- /** A public comment under an Instagram or Facebook post, or a reply sent from the inbox. */
5120
- export interface MarketingComment {
5121
- id: string;
5122
- channel_id: string;
5123
- post_id: string | null;
5124
- external_id: string;
5125
- parent_external_id: string;
5126
- author_name: string;
5127
- body: string;
5128
- direction: "in" | "out";
5129
- status: "received" | "pending" | "sent" | "failed";
5130
- hidden: boolean;
5131
- error: string;
5132
- commented_at: string;
5133
- post_caption: string | null;
5134
- post_url: string | null;
5135
- }
5136
- /** A private note teammates left on an inbox thread. */
5137
- export interface MarketingConversationNote {
5138
- id: string;
5139
- author_user_id: string | null;
5140
- author_name: string;
5141
- body: string;
5142
- created_at: string;
5143
- }
5144
- /** An internal comment a teammate left on a post. */
5145
- export interface MarketingPostNote {
5146
- id: string;
5147
- author_user_id: string | null;
5148
- author_name: string;
5149
- body: string;
5150
- created_at: string;
5151
- }
5152
- /** A post idea in the workspace's backlog. */
5153
- export interface MarketingIdea {
5154
- id: string;
5155
- title: string;
5156
- notes: string;
5157
- created_at: string;
5158
- updated_at: string;
5159
- }
5160
- /** A saved caption or hashtag group the composer inserts. */
5161
- export interface MarketingSnippet {
5162
- id: string;
5163
- kind: "caption" | "hashtags";
5164
- name: string;
5165
- body: string;
5166
- updated_at: string;
5167
- }
5168
4960
  export interface MarketingConversation {
5169
4961
  id: string;
5170
4962
  channel_id: string;
@@ -5175,8 +4967,6 @@ export interface MarketingConversation {
5175
4967
  peer_phone: string;
5176
4968
  peer_name: string;
5177
4969
  party_id?: string | null;
5178
- /** The teammate who owns the thread. */
5179
- assignee_user_id?: string;
5180
4970
  last_message_at: string | null;
5181
4971
  last_direction?: "inbound" | "outbound";
5182
4972
  last_snippet: string;
@@ -5611,75 +5401,6 @@ export interface MarketingPost {
5611
5401
  channel_name?: string;
5612
5402
  /** The TikTok direct-post choices a TikTok post carries, as TikTok's `post_info` names them. */
5613
5403
  tiktok?: MarketingPostTikTokSettings | null;
5614
- /** The Instagram and Facebook extras: first comment, alt text, collaborators. */
5615
- details?: MarketingPostDetails | null;
5616
- /** The workspace's own labels for the post; never published. */
5617
- tags?: string[];
5618
- }
5619
- /** What an Instagram or Facebook post carries beside its caption. */
5620
- export interface MarketingPostDetails {
5621
- first_comment?: string;
5622
- alt_text?: string;
5623
- collaborators?: string[];
5624
- }
5625
- /** The extras `marketing.create_post` and `marketing.save_post_draft` take. */
5626
- export interface MarketingPostDetailChoices {
5627
- first_comment?: string;
5628
- alt_text?: string;
5629
- collaborators?: string[];
5630
- }
5631
- /** A caption the AI wrote for one network. */
5632
- export interface MarketingCaptionSuggestion {
5633
- provider: string;
5634
- caption: string;
5635
- }
5636
- /** A request for AI captions and, once done, one suggestion per network. */
5637
- export interface MarketingCaptionDraft {
5638
- id: string;
5639
- status: "queued" | "done" | "failed";
5640
- brief: string;
5641
- tone: string;
5642
- providers: string[];
5643
- suggestions: MarketingCaptionSuggestion[];
5644
- /** Starts with a code: allowance_used, not_configured or failed. */
5645
- error: string;
5646
- created_at: string;
5647
- finished_at: string | null;
5648
- }
5649
- /** A generated picture or video request; url is set once it is done. */
5650
- export interface MarketingGeneration {
5651
- id: string;
5652
- kind: "image" | "video";
5653
- status: "queued" | "rendering" | "done" | "failed";
5654
- prompt: string;
5655
- url: string | null;
5656
- error: string;
5657
- created_at: string;
5658
- }
5659
- /** One weekly posting time: 0 Sunday … 6 Saturday, and a local "HH:MM". */
5660
- export interface MarketingPostScheduleSlot {
5661
- weekday: number;
5662
- time: string;
5663
- }
5664
- /** An account's weekly posting times and the next one no post has taken. */
5665
- export interface MarketingPostSchedule {
5666
- channel_id: string;
5667
- time_zone: string | null;
5668
- slots: MarketingPostScheduleSlot[];
5669
- next_slot: string | null;
5670
- }
5671
- /** A weekday and hour an account's published posts drew the most interactions at. */
5672
- export interface MarketingBestTime {
5673
- weekday: number;
5674
- hour: number;
5675
- posts: number;
5676
- average_interactions: number;
5677
- }
5678
- /** The best times to post, best first, with how many posts they were read from. */
5679
- export interface MarketingBestTimes {
5680
- time_zone: string;
5681
- sample: number;
5682
- times: MarketingBestTime[];
5683
5404
  }
5684
5405
  /** Who can view a TikTok video, as TikTok's creator info offers the levels. */
5685
5406
  export type TikTokPrivacyLevel = "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY";
@@ -6108,10 +5829,7 @@ export interface EmailMessage {
6108
5829
  provider: "gmail" | "outlook";
6109
5830
  thread_id?: string;
6110
5831
  direction: "inbound" | "outbound";
6111
- /** The sender's address. */
6112
5832
  from: string;
6113
- /** The From header's display name ("Anthropic"); absent when it names no one, or on mail synced before it was kept. */
6114
- from_name?: string;
6115
5833
  to: string[];
6116
5834
  cc?: string[];
6117
5835
  subject: string;
@@ -6170,8 +5888,6 @@ export interface EmailMessageBody {
6170
5888
  account_id: string;
6171
5889
  direction: "inbound" | "outbound";
6172
5890
  from: string;
6173
- /** The From header's display name; empty when it names no one. */
6174
- from_name: string;
6175
5891
  to: string[];
6176
5892
  cc?: string[];
6177
5893
  subject: string;
@@ -6631,6 +6347,12 @@ export interface ChatAttachment {
6631
6347
  document_id: string;
6632
6348
  filename: string;
6633
6349
  }
6350
+ export interface ChatMessage {
6351
+ role: "user" | "assistant";
6352
+ content: string;
6353
+ /** Uploaded documents attached to a user message. */
6354
+ attachments?: ChatAttachment[];
6355
+ }
6634
6356
  /**
6635
6357
  * An action parked for in-chat authorization: the exact tool call the model
6636
6358
  * attempted, held server-side until the user approves or denies it.
@@ -6640,6 +6362,17 @@ export interface ChatApproval {
6640
6362
  tool: string;
6641
6363
  input: unknown;
6642
6364
  }
6365
+ /** The outcome of deciding an in-chat authorization request. */
6366
+ export interface ChatApprovalDecision {
6367
+ decided: "approved" | "denied";
6368
+ tool: string;
6369
+ /** Tool output when approved and the call succeeded. */
6370
+ output?: unknown;
6371
+ /** Present when approved but the call failed. */
6372
+ error?: string;
6373
+ /** True when the approved call changed a dashboard. */
6374
+ dashboard_changed?: boolean;
6375
+ }
6643
6376
  /**
6644
6377
  * How a member answered an in-chat authorization, kept on the user turn
6645
6378
  * that carried the answer back to the model so the transcript can draw
@@ -6656,48 +6389,71 @@ export interface ChatApprovalOutcome {
6656
6389
  /** Present when approved but the call failed. */
6657
6390
  error?: string;
6658
6391
  }
6659
- /** How a `askSession` stood when its wait ended. */
6660
- export type SessionAskState = "answered" | "awaiting_approval" | "awaiting_input" | "working" | "failed";
6661
- /**
6662
- * What `askSession` answers: the question as a message in a session thread,
6663
- * and how that session's run stood when the wait ended.
6664
- */
6665
- export interface SessionAsk {
6666
- thread_id: string;
6667
- /** The session the ask opened; absent when it went to a thread already open. */
6668
- session_id?: string;
6669
- /** The message sent; "" for a wait that sent none. */
6670
- message_id: string;
6671
- /** The session run the message reached; "" when none did yet. */
6672
- run_id: string;
6673
- state: SessionAskState;
6674
- /** The answer's prose, markdown, when `state` is `answered`. */
6392
+ export interface OverviewChatResponse {
6675
6393
  reply: string;
6676
- /** The answer's json-render spec, when it drew one. */
6394
+ /**
6395
+ * The answer's json-render spec (ui-spec.ts), when the model drew one:
6396
+ * rendered under the reply in place of `message`, which then leads with
6397
+ * its Block Kit reading for a client that does not draw specs.
6398
+ */
6677
6399
  ui?: UISpec;
6678
- /** The answer's Block Kit blocks, when it laid some out. */
6679
- blocks?: MessageBlock[];
6680
6400
  /**
6681
- * The action that waits for a person: decide it with `approveRun` /
6682
- * `denyRun` on `run_id`, the run that holds it (the session's own, or a
6683
- * specialist's it called).
6401
+ * The answer as Block Kit blocks, when the model laid one out (a table,
6402
+ * a plan, buttons to click): rendered under the reply. See block-kit.ts.
6403
+ */
6404
+ message?: MessageBlock[];
6405
+ blocks: CanvasBlock[];
6406
+ /**
6407
+ * Questions the model posed via user.ask. Render them as a questionnaire
6408
+ * and send the answers back as the next user message.
6684
6409
  */
6685
- approval?: {
6686
- id: string;
6687
- run_id: string;
6688
- tool: string;
6689
- input: Json;
6690
- };
6691
- /** The questions the run asked: answer with `answerRun`, or by writing in the thread. */
6692
6410
  questions?: RunQuestion[];
6693
- /** What the run waits on was pending before this message: the message waits behind it. */
6694
- queued: boolean;
6695
- /** Why the run failed: `ai_allowance_used` when the plan refused the model. */
6696
- error?: {
6697
- code: string;
6698
- message: string;
6411
+ /**
6412
+ * An action awaiting the user's in-chat authorization. Render Approve/Deny;
6413
+ * decide via decideChatApproval and report the outcome back as the next
6414
+ * user message.
6415
+ */
6416
+ approval?: ChatApproval;
6417
+ usage: {
6418
+ tokens_in: number;
6419
+ tokens_out: number;
6699
6420
  };
6421
+ /** True when this turn created, appended, edited, or deleted a dashboard. */
6422
+ dashboard_changed: boolean;
6700
6423
  }
6424
+ /** How far a tool call got during a streaming chat turn. */
6425
+ export type OverviewChatToolPhase = "start" | "ok" | "error" | "approval" | "questions";
6426
+ /**
6427
+ * One event of a streaming overview chat (`overviewChatStream`).
6428
+ *
6429
+ * - `turn` — a model turn began. Text streamed before it was a preamble to
6430
+ * a tool call, so the accumulated answer starts over.
6431
+ * - `delta` — more of the answer's prose, already decoded out of the
6432
+ * model's JSON envelope.
6433
+ * - `tool` — a tool call started or finished; useful as a progress line.
6434
+ * - `done` — the authoritative payload, identical to what `overviewChat`
6435
+ * returns. Blocks, questions and approvals only exist once the turn is
6436
+ * complete, so replace the streamed text with `response.reply`.
6437
+ * - `error` — the round-trip failed; nothing further arrives.
6438
+ */
6439
+ export type OverviewChatStreamEvent = {
6440
+ type: "turn";
6441
+ n: number;
6442
+ } | {
6443
+ type: "delta";
6444
+ text: string;
6445
+ } | {
6446
+ type: "tool";
6447
+ name: string;
6448
+ phase: OverviewChatToolPhase;
6449
+ } | {
6450
+ type: "done";
6451
+ response: OverviewChatResponse;
6452
+ } | {
6453
+ type: "error";
6454
+ error: string;
6455
+ code: string;
6456
+ };
6701
6457
  /** One turn of a saved overview conversation (a historical record: blocks keep the data they were hydrated with). */
6702
6458
  export interface ConversationTurn {
6703
6459
  role: "user" | "assistant";
@@ -7868,68 +7624,12 @@ export interface NemphiClient {
7868
7624
  media_urls?: string[];
7869
7625
  media_type?: MarketingPost["media_type"];
7870
7626
  scheduled_at?: string;
7871
- /** Per-account captions keyed by channel id; an account named here gets its own text. */
7872
- captions?: Record<string, string>;
7873
- /** Schedule each account's post for its next free posting time instead of scheduled_at. */
7874
- queue?: boolean;
7875
- } & TikTokPostChoices & MarketingPostDetailChoices): Promise<{
7627
+ } & TikTokPostChoices): Promise<{
7876
7628
  batch_id: string;
7877
7629
  posts: MarketingPost[];
7878
7630
  note?: string;
7879
7631
  }>;
7880
7632
  getTikTokCreatorInfo(channelId: string): Promise<TikTokCreatorInfo>;
7881
- writeMarketingCaptions(input: {
7882
- brief: string;
7883
- providers: string[];
7884
- tone?: "friendly" | "professional" | "playful" | "bold";
7885
- language?: string;
7886
- current_caption?: string;
7887
- }): Promise<MarketingCaptionDraft>;
7888
- getMarketingCaptionDraft(draftId: string): Promise<MarketingCaptionDraft>;
7889
- generateMarketingImage(input: {
7890
- prompt: string;
7891
- orientation?: "square" | "portrait" | "landscape";
7892
- }): Promise<MarketingGeneration>;
7893
- listMarketingGenerations(input?: {
7894
- kind?: "image" | "video";
7895
- status?: MarketingGeneration["status"];
7896
- }): Promise<MarketingGeneration[]>;
7897
- listMarketingPostSchedules(): Promise<MarketingPostSchedule[]>;
7898
- setMarketingPostSchedule(input: {
7899
- channel_id: string;
7900
- time_zone: string;
7901
- slots: MarketingPostScheduleSlot[];
7902
- }): Promise<MarketingPostSchedule>;
7903
- getMarketingBestPostTimes(input: {
7904
- channel_id: string;
7905
- time_zone?: string;
7906
- }): Promise<MarketingBestTimes>;
7907
- setMarketingPostTags(input: {
7908
- post_id: string;
7909
- tags: string[];
7910
- }): Promise<MarketingPost>;
7911
- listMarketingPostNotes(postId: string): Promise<MarketingPostNote[]>;
7912
- addMarketingPostNote(input: {
7913
- post_id: string;
7914
- body: string;
7915
- }): Promise<MarketingPostNote>;
7916
- listMarketingSnippets(input?: {
7917
- kind?: MarketingSnippet["kind"];
7918
- }): Promise<MarketingSnippet[]>;
7919
- saveMarketingSnippet(input: {
7920
- id?: string;
7921
- kind: MarketingSnippet["kind"];
7922
- name: string;
7923
- body: string;
7924
- }): Promise<MarketingSnippet>;
7925
- deleteMarketingSnippet(id: string): Promise<MarketingSnippet>;
7926
- listMarketingIdeas(): Promise<MarketingIdea[]>;
7927
- saveMarketingIdea(input: {
7928
- id?: string;
7929
- title: string;
7930
- notes?: string;
7931
- }): Promise<MarketingIdea>;
7932
- deleteMarketingIdea(id: string): Promise<MarketingIdea>;
7933
7633
  listMarketingPostRevisions(input: {
7934
7634
  post_id: string;
7935
7635
  before_version?: number;
@@ -7957,7 +7657,7 @@ export interface NemphiClient {
7957
7657
  caption?: string;
7958
7658
  media_type?: MarketingPost["media_type"];
7959
7659
  media_urls?: string[];
7960
- } & TikTokPostChoices & MarketingPostDetailChoices): Promise<{
7660
+ } & TikTokPostChoices): Promise<{
7961
7661
  post: MarketingPost;
7962
7662
  }>;
7963
7663
  submitMarketingPost(postId: string): Promise<{
@@ -8038,28 +7738,6 @@ export interface NemphiClient {
8038
7738
  conversation_id: string;
8039
7739
  body: string;
8040
7740
  }): Promise<MarketingMessage>;
8041
- listMarketingComments(input?: {
8042
- channel_id?: string;
8043
- post_id?: string;
8044
- limit?: number;
8045
- }): Promise<MarketingComment[]>;
8046
- replyToMarketingComment(input: {
8047
- comment_id: string;
8048
- body: string;
8049
- }): Promise<MarketingComment>;
8050
- hideMarketingComment(input: {
8051
- comment_id: string;
8052
- hidden: boolean;
8053
- }): Promise<MarketingComment>;
8054
- assignMarketingConversation(input: {
8055
- conversation_id: string;
8056
- assignee_user_id?: string;
8057
- }): Promise<MarketingConversation>;
8058
- listMarketingConversationNotes(conversationId: string): Promise<MarketingConversationNote[]>;
8059
- addMarketingConversationNote(input: {
8060
- conversation_id: string;
8061
- body: string;
8062
- }): Promise<MarketingConversationNote>;
8063
7741
  linkMarketingConversationParty(input: {
8064
7742
  conversation_id: string;
8065
7743
  party_id: string;
@@ -8788,25 +8466,6 @@ export interface NemphiClient {
8788
8466
  * content type — for showing what was shared, not only its name.
8789
8467
  */
8790
8468
  downloadDocument(id: string): Promise<Response>;
8791
- /** The desktop folder sync's feed: no cursor lists everything, a cursor answers what changed. */
8792
- fileSyncChanges(cursor?: string, limit?: number): Promise<FileSyncPage>;
8793
- /** A synced entry's bytes (a live document exported to Word, Excel or PowerPoint); ETag is its content_version. */
8794
- downloadFileSyncContent(id: string): Promise<Response>;
8795
- /** Replaces an entry's bytes when it still holds `contentVersion`; a stale one throws ApiError 409. */
8796
- replaceFileSyncContent(id: string, contentVersion: string, body: Blob | Uint8Array): Promise<FileSyncItem>;
8797
- /** Files new bytes as a file entry under `parentId` (personal, team or a folder id). */
8798
- createFileSyncFile(parentId: string, name: string, body: Blob | Uint8Array): Promise<FileSyncItem>;
8799
- createFileSyncFolder(parentId: string, name: string): Promise<FileSyncItem>;
8800
- /** Renames or moves an item; a stale `baseVersion` throws ApiError 409. */
8801
- moveFileSyncItem(id: string, change: {
8802
- parentId?: string;
8803
- name?: string;
8804
- }, baseVersion: string): Promise<FileSyncItem>;
8805
- /** Trashes an entry, or a folder with everything in it; a stale `baseVersion` throws ApiError 409. */
8806
- deleteFileSyncItem(id: string, baseVersion: string): Promise<{
8807
- id: string;
8808
- deleted: boolean;
8809
- }>;
8810
8469
  /** Sends documents through a public link, mailed to any recipients. */
8811
8470
  createTransfer(input: TransferInput): Promise<CreatedTransfer>;
8812
8471
  /** The caller's transfers (an owner or admin: the workspace's), newest first. */
@@ -8859,48 +8518,22 @@ export interface NemphiClient {
8859
8518
  next_before?: number;
8860
8519
  }>;
8861
8520
  /**
8862
- * One connection to the workspace's realtime stream
8863
- * (`GET /v1/events/stream`, server-sent events): every frame it carries,
8864
- * checked by its `type`, until the connection ends (the server closes a
8865
- * stream after 15 minutes) or `signal` aborts. `action` and
8866
- * `notification` are wake-ups naming a row; read the row back. The
8867
- * stream keeps no position, so a reader that connects again re-reads
8868
- * what it shows. `openRealtimeSocket` reconnects for you.
8521
+ * Live tail of the action ledger (`GET /v1/events/stream`, SSE).
8522
+ * Resumes from `cursor` (last seen action id); abort via `signal`.
8869
8523
  */
8870
8524
  streamEvents(opts?: {
8871
- /** @deprecated Ignored: the stream keeps no position. */
8872
8525
  cursor?: number;
8873
8526
  signal?: AbortSignal;
8874
- }): AsyncGenerator<RealtimeEvent, void, void>;
8527
+ }): AsyncGenerator<Action, void, void>;
8875
8528
  /**
8876
- * The workspace's realtime events from `GET /v1/events/stream`, opened
8877
- * again with backoff whenever it drops, until `close()`: the ledger and
8878
- * the caller's notifications as wake-ups, the workspace's frames as they
8879
- * are, and who is online. The connection keeps the caller online.
8529
+ * The workspace's realtime events, polled from `GET /v1/events/poll`
8530
+ * every two seconds (at once while the server has more), with retries
8531
+ * until `close()`: the ledger and the caller's notifications as
8532
+ * wake-ups, the workspace's frames as they are, and who is online when
8533
+ * that changed. Each poll keeps the caller online. The web app polls the
8534
+ * same route through its own server route.
8880
8535
  */
8881
8536
  openRealtimeSocket(options: RealtimeSocketOptions): RealtimeSocket;
8882
- /**
8883
- * One chat thread's own stream (`GET /v1/threads/{id}/stream`), for a
8884
- * member who sits in it: the answers its agent runs are writing
8885
- * (`run_delta`) and each run step's end (`run`). It opens the stream
8886
- * again with backoff whenever it drops or the server ends it, until
8887
- * `signal` aborts; a refusal that will not change (401, 403, the thread
8888
- * not found as 404) throws an `ApiError`.
8889
- *
8890
- * Every connection first replays the turn being written, so a reader
8891
- * that reconnects mid-answer has all of it. Fold the pieces by
8892
- * `(seq, n)`: a later `seq` starts the run's text over, a piece already
8893
- * held (the same `seq`, an `n` at or below the last) changes nothing.
8894
- * The answer itself always lands as a message; a `run` frame whose
8895
- * outcome is `continue` or `parked` means the text so far was preamble.
8896
- * A step that ended while the stream was down is not replayed, so
8897
- * `onOpen` after the first is the moment to re-read the thread.
8898
- */
8899
- streamThread(threadId: string, opts?: {
8900
- signal?: AbortSignal;
8901
- /** Called each time the stream answers. */
8902
- onOpen?: () => void;
8903
- }): AsyncGenerator<ThreadStreamEvent, void, void>;
8904
8537
  /** Say the caller is writing in a thread or an inbox conversation (`POST /v1/events/typing`); nothing is stored. */
8905
8538
  sendTyping(input: {
8906
8539
  scope: TypingScope;
@@ -9064,8 +8697,6 @@ export interface NemphiClient {
9064
8697
  warehouse_id?: string;
9065
8698
  limit?: number;
9066
8699
  }): Promise<ReorderSuggestion[]>;
9067
- /** The inventory page in one read; `month` is YYYY-MM, this month when omitted. */
9068
- inventoryOverview(month?: string): Promise<InventoryOverview>;
9069
8700
  adjustStock(input: {
9070
8701
  item_id: string;
9071
8702
  warehouse_id?: string;
@@ -9454,23 +9085,19 @@ export interface NemphiClient {
9454
9085
  kind?: FeatureKind;
9455
9086
  only_unused?: boolean;
9456
9087
  }): Promise<FeatureUsageResponse>;
9088
+ overviewChat(input: {
9089
+ messages: ChatMessage[];
9090
+ }): Promise<OverviewChatResponse>;
9457
9091
  /**
9458
- * Asks the orchestrator one question as a message in a session thread
9459
- * (a new session, or `thread_id` to carry one on) and waits for that
9460
- * session's run: its whole answer, the approval or questions it parked
9461
- * on, or `working` once `wait_ms` (at most 55 000; 25 000 by default)
9462
- * runs out, when the reply lands in the thread. With `thread_id` and no
9463
- * `text` it sends nothing and waits on the thread as it stands: the
9464
- * answer once an approval is decided. Follow the thread live with
9465
- * `streamThread`.
9092
+ * The same round-trip as `overviewChat`, reported as it happens. Render
9093
+ * the deltas for immediate feedback and take the final answer from the
9094
+ * `done` event — it is what `overviewChat` would have returned.
9466
9095
  */
9467
- askSession(input: {
9468
- text?: string;
9469
- thread_id?: string;
9470
- context?: string;
9471
- document_ids?: string[];
9472
- wait_ms?: number;
9473
- }): Promise<SessionAsk>;
9096
+ overviewChatStream(input: {
9097
+ messages: ChatMessage[];
9098
+ }, opts?: {
9099
+ signal?: AbortSignal;
9100
+ }): AsyncGenerator<OverviewChatStreamEvent, void, void>;
9474
9101
  /** Suggested prompts ranked from the tenant's live data. */
9475
9102
  overviewSuggestions(): Promise<OverviewSuggestionsResponse>;
9476
9103
  /**
@@ -9494,6 +9121,8 @@ export interface NemphiClient {
9494
9121
  mirrorOverviewThread(turns: ConversationTurn[]): Promise<{
9495
9122
  thread_id: string;
9496
9123
  }>;
9124
+ /** Decides an in-chat authorization request; approving executes the parked call. */
9125
+ decideChatApproval(id: string, approve: boolean): Promise<ChatApprovalDecision>;
9497
9126
  listDashboards(): Promise<DashboardSummary[]>;
9498
9127
  /**
9499
9128
  * Fetches one dashboard with every block's metric query re-run (live data).