@pingroom/sdk 0.7.1 → 0.9.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 (191) hide show
  1. package/README.md +288 -44
  2. package/dist/client.d.ts +27 -312
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +33 -1154
  5. package/dist/client.js.map +1 -1
  6. package/dist/errors.d.ts +40 -6
  7. package/dist/errors.d.ts.map +1 -1
  8. package/dist/errors.js +56 -4
  9. package/dist/errors.js.map +1 -1
  10. package/dist/http.d.ts +12 -1
  11. package/dist/http.d.ts.map +1 -1
  12. package/dist/http.js +47 -18
  13. package/dist/http.js.map +1 -1
  14. package/dist/index.d.ts +3 -5
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +1 -2
  17. package/dist/index.js.map +1 -1
  18. package/dist/internal/async.d.ts +2 -0
  19. package/dist/internal/async.d.ts.map +1 -1
  20. package/dist/internal/async.js +6 -0
  21. package/dist/internal/async.js.map +1 -1
  22. package/dist/internal/guards.d.ts +16 -0
  23. package/dist/internal/guards.d.ts.map +1 -1
  24. package/dist/internal/guards.js +22 -1
  25. package/dist/internal/guards.js.map +1 -1
  26. package/dist/internal/request.d.ts +41 -0
  27. package/dist/internal/request.d.ts.map +1 -0
  28. package/dist/internal/request.js +78 -0
  29. package/dist/internal/request.js.map +1 -0
  30. package/dist/internal/retry.d.ts +65 -0
  31. package/dist/internal/retry.d.ts.map +1 -0
  32. package/dist/internal/retry.js +126 -0
  33. package/dist/internal/retry.js.map +1 -0
  34. package/dist/internal/url.d.ts +9 -0
  35. package/dist/internal/url.d.ts.map +1 -1
  36. package/dist/internal/url.js +25 -0
  37. package/dist/internal/url.js.map +1 -1
  38. package/dist/internal/validate.d.ts +13 -0
  39. package/dist/internal/validate.d.ts.map +1 -0
  40. package/dist/internal/validate.js +36 -0
  41. package/dist/internal/validate.js.map +1 -0
  42. package/dist/linkPing.d.ts.map +1 -1
  43. package/dist/linkPing.js +6 -2
  44. package/dist/linkPing.js.map +1 -1
  45. package/dist/liveStatus.d.ts +106 -11
  46. package/dist/liveStatus.d.ts.map +1 -1
  47. package/dist/liveStatus.js +20 -3
  48. package/dist/liveStatus.js.map +1 -1
  49. package/dist/mcp.d.ts.map +1 -1
  50. package/dist/mcp.js +40 -10
  51. package/dist/mcp.js.map +1 -1
  52. package/dist/namespaces/actions.d.ts +50 -0
  53. package/dist/namespaces/actions.d.ts.map +1 -0
  54. package/dist/namespaces/actions.js +219 -0
  55. package/dist/namespaces/actions.js.map +1 -0
  56. package/dist/namespaces/approvals.d.ts +23 -0
  57. package/dist/namespaces/approvals.d.ts.map +1 -0
  58. package/dist/namespaces/approvals.js +78 -0
  59. package/dist/namespaces/approvals.js.map +1 -0
  60. package/dist/namespaces/attachments.d.ts +37 -0
  61. package/dist/namespaces/attachments.d.ts.map +1 -0
  62. package/dist/namespaces/attachments.js +91 -0
  63. package/dist/namespaces/attachments.js.map +1 -0
  64. package/dist/namespaces/auth.d.ts +58 -0
  65. package/dist/namespaces/auth.d.ts.map +1 -0
  66. package/dist/namespaces/auth.js +242 -0
  67. package/dist/namespaces/auth.js.map +1 -0
  68. package/dist/namespaces/directory.d.ts +10 -0
  69. package/dist/namespaces/directory.d.ts.map +1 -0
  70. package/dist/namespaces/directory.js +19 -0
  71. package/dist/namespaces/directory.js.map +1 -0
  72. package/dist/namespaces/handoffs.d.ts +47 -0
  73. package/dist/namespaces/handoffs.d.ts.map +1 -0
  74. package/dist/namespaces/handoffs.js +126 -0
  75. package/dist/namespaces/handoffs.js.map +1 -0
  76. package/dist/namespaces/inbox.d.ts +17 -0
  77. package/dist/namespaces/inbox.d.ts.map +1 -0
  78. package/dist/namespaces/inbox.js +192 -0
  79. package/dist/namespaces/inbox.js.map +1 -0
  80. package/dist/namespaces/live.d.ts +57 -0
  81. package/dist/namespaces/live.d.ts.map +1 -0
  82. package/dist/namespaces/live.js +116 -0
  83. package/dist/namespaces/live.js.map +1 -0
  84. package/dist/namespaces/notifications.d.ts +25 -0
  85. package/dist/namespaces/notifications.d.ts.map +1 -0
  86. package/dist/namespaces/notifications.js +128 -0
  87. package/dist/namespaces/notifications.js.map +1 -0
  88. package/dist/namespaces/profile.d.ts +19 -0
  89. package/dist/namespaces/profile.d.ts.map +1 -0
  90. package/dist/namespaces/profile.js +22 -0
  91. package/dist/namespaces/profile.js.map +1 -0
  92. package/dist/namespaces/questions.d.ts +41 -0
  93. package/dist/namespaces/questions.d.ts.map +1 -0
  94. package/dist/namespaces/questions.js +107 -0
  95. package/dist/namespaces/questions.js.map +1 -0
  96. package/dist/namespaces/rooms.d.ts +13 -0
  97. package/dist/namespaces/rooms.d.ts.map +1 -0
  98. package/dist/namespaces/rooms.js +41 -0
  99. package/dist/namespaces/rooms.js.map +1 -0
  100. package/dist/namespaces/webhooks.d.ts +11 -0
  101. package/dist/namespaces/webhooks.d.ts.map +1 -0
  102. package/dist/namespaces/webhooks.js +32 -0
  103. package/dist/namespaces/webhooks.js.map +1 -0
  104. package/dist/types/approvals.d.ts +62 -0
  105. package/dist/types/approvals.d.ts.map +1 -0
  106. package/dist/types/approvals.js +2 -0
  107. package/dist/types/approvals.js.map +1 -0
  108. package/dist/types/auth.d.ts +185 -0
  109. package/dist/types/auth.d.ts.map +1 -0
  110. package/dist/types/auth.js +2 -0
  111. package/dist/types/auth.js.map +1 -0
  112. package/dist/types/common.d.ts +43 -0
  113. package/dist/types/common.d.ts.map +1 -0
  114. package/dist/types/common.js +2 -0
  115. package/dist/types/common.js.map +1 -0
  116. package/dist/types/handoffs.d.ts +121 -0
  117. package/dist/types/handoffs.d.ts.map +1 -0
  118. package/dist/types/handoffs.js +2 -0
  119. package/dist/types/handoffs.js.map +1 -0
  120. package/dist/types/inbox.d.ts +51 -0
  121. package/dist/types/inbox.d.ts.map +1 -0
  122. package/dist/types/inbox.js +2 -0
  123. package/dist/types/inbox.js.map +1 -0
  124. package/dist/types/notifications.d.ts +376 -0
  125. package/dist/types/notifications.d.ts.map +1 -0
  126. package/dist/types/notifications.js +2 -0
  127. package/dist/types/notifications.js.map +1 -0
  128. package/dist/types/profile.d.ts +30 -0
  129. package/dist/types/profile.d.ts.map +1 -0
  130. package/dist/types/profile.js +3 -0
  131. package/dist/types/profile.js.map +1 -0
  132. package/dist/types/questions.d.ts +210 -0
  133. package/dist/types/questions.d.ts.map +1 -0
  134. package/dist/types/questions.js +2 -0
  135. package/dist/types/questions.js.map +1 -0
  136. package/dist/types/rooms.d.ts +163 -0
  137. package/dist/types/rooms.d.ts.map +1 -0
  138. package/dist/types/rooms.js +3 -0
  139. package/dist/types/rooms.js.map +1 -0
  140. package/dist/types.d.ts +9 -1035
  141. package/dist/types.d.ts.map +1 -1
  142. package/dist/version.d.ts +1 -1
  143. package/dist/version.js +1 -1
  144. package/dist/webhooks.d.ts +32 -5
  145. package/dist/webhooks.d.ts.map +1 -1
  146. package/dist/webhooks.js +44 -14
  147. package/dist/webhooks.js.map +1 -1
  148. package/package.json +4 -2
  149. package/src/client.ts +115 -0
  150. package/src/errors.ts +291 -0
  151. package/src/http.ts +225 -0
  152. package/src/index.ts +97 -0
  153. package/src/internal/async.ts +54 -0
  154. package/src/internal/guards.ts +129 -0
  155. package/src/internal/request.ts +97 -0
  156. package/src/internal/retry.ts +157 -0
  157. package/src/internal/url.ts +78 -0
  158. package/src/internal/validate.ts +42 -0
  159. package/src/linkPing.ts +56 -0
  160. package/src/liveStatus.ts +337 -0
  161. package/src/locationPing.ts +101 -0
  162. package/src/mcp.ts +161 -0
  163. package/src/namespaces/actions.ts +234 -0
  164. package/src/namespaces/approvals.ts +104 -0
  165. package/src/namespaces/attachments.ts +106 -0
  166. package/src/namespaces/auth.ts +284 -0
  167. package/src/namespaces/directory.ts +21 -0
  168. package/src/namespaces/handoffs.ts +160 -0
  169. package/src/namespaces/inbox.ts +253 -0
  170. package/src/namespaces/live.ts +134 -0
  171. package/src/namespaces/notifications.ts +152 -0
  172. package/src/namespaces/profile.ts +24 -0
  173. package/src/namespaces/questions.ts +133 -0
  174. package/src/namespaces/rooms.ts +53 -0
  175. package/src/namespaces/webhooks.ts +38 -0
  176. package/src/types/approvals.ts +67 -0
  177. package/src/types/auth.ts +202 -0
  178. package/src/types/common.ts +74 -0
  179. package/src/types/handoffs.ts +148 -0
  180. package/src/types/inbox.ts +64 -0
  181. package/src/types/notifications.ts +393 -0
  182. package/src/types/profile.ts +37 -0
  183. package/src/types/questions.ts +226 -0
  184. package/src/types/rooms.ts +169 -0
  185. package/src/types.ts +17 -0
  186. package/src/version.ts +2 -0
  187. package/src/webhooks.ts +373 -0
  188. package/dist/liveActivity.d.ts +0 -101
  189. package/dist/liveActivity.d.ts.map +0 -1
  190. package/dist/liveActivity.js +0 -83
  191. package/dist/liveActivity.js.map +0 -1
package/dist/types.d.ts CHANGED
@@ -5,1039 +5,13 @@
5
5
  * SDK is a faithful, reviewable wrapper — what you pass is what the API sees.
6
6
  * SDK-only knobs (timeouts, signals, callbacks) use camelCase.
7
7
  */
8
- /** A plain JSON object — the shape the API accepts for structured `data`. */
9
- export type JsonObject = Record<string, unknown>;
10
- /** Minimal fetch signature the SDK depends on (Node >= 18, browsers, workers, Deno, Bun). */
11
- export type FetchLike = (input: string, init?: RequestInit) => Promise<Response>;
12
- /** The scopes an agent credential can hold. */
13
- export type AgentScope = 'pingroom:full' | 'pingroom:rooms:read' | 'pingroom:rooms:write' | 'pingroom:rooms:publish' | 'pingroom:rooms:join' | 'pingroom:actions:write' | 'pingroom:actions:trigger' | 'pingroom:broadcast:send' | 'pingroom:attachments:write' | 'pingroom:notifications:read' | 'pingroom:webhooks:read' | 'pingroom:webhooks:write' | 'pingroom:webhooks:delete' | 'pingroom:agents:ping' | 'pingroom:approvals:request' | 'pingroom:questions:ask' | 'pingroom:handoffs:create' | 'pingroom:live:write' | 'pingroom:profile:write' | 'pingroom:codes:redeem';
14
- /** A known scope, or any forward-compatible string (keeps autocomplete on the knowns). */
15
- export type ScopeInput = AgentScope | (string & {});
16
- export interface PingRoomOptions {
17
- /** Agent credential (Bearer JWT). Optional — public reads (directory) work without it. */
18
- token?: string | null;
19
- /** API base URL. Defaults to env PINGROOM_API_URL/PINGROOM_BASE_URL, else https://api.pingroom.io. */
20
- baseUrl?: string;
21
- /** Default per-request timeout in ms (long-poll calls extend this automatically). Default 30000. */
22
- timeoutMs?: number;
23
- /** Custom fetch implementation (for tests or non-global-fetch runtimes). */
24
- fetch?: FetchLike;
25
- /** Override the User-Agent header. */
26
- userAgent?: string;
27
- /** Allow plain-http base URLs to non-loopback hosts. Off by default — credentials require https. */
28
- allowInsecure?: boolean;
29
- }
30
- /** Pro entitlement applied to the human who authorized this agent. */
31
- export interface RedeemCodeResult {
32
- message: string;
33
- kind: 'gift' | 'redeem';
34
- reward_days: number | null;
35
- package: string | null;
36
- lifetime: boolean;
37
- plan: 'pro';
38
- plan_expires_at: string | null;
39
- }
40
- export type AgentRegisterType = 'identity_assertion' | 'anonymous';
41
- export type AgentAssertionType = 'urn:ietf:params:oauth:token-type:id-jag' | 'verified_email';
42
- export interface RegisterParams {
43
- type: AgentRegisterType;
44
- assertion_type?: AgentAssertionType;
45
- assertion?: string;
46
- scopes?: ScopeInput[];
47
- agent_label?: string;
48
- }
49
- /**
50
- * How wide the human made this agent's room grant.
51
- *
52
- * `'all'` — every room the account is in; the grant lists none, while `room`
53
- * may identify one eligible private delivery destination. `'selected'` —
54
- * exactly the rooms in `rooms`.
55
- */
56
- export type AgentRoomAccess = 'all' | 'selected';
57
- /** One room inside an agent's grant. */
58
- export interface AgentAccessRoom {
59
- id: string;
60
- invite_code: string;
61
- name: string;
62
- }
63
- /** The delivery room: where handoffs and questions land. */
64
- export interface AgentDeliveryRoom {
65
- invite_code: string;
66
- name?: string | null;
67
- }
68
- /** Stable, non-credential URLs returned with an approved agent connection. */
69
- export interface AgentCredentialLinks {
70
- /** REST endpoint for the agent's latest visible pings. Authenticate normally. */
71
- latest_pings: string;
72
- /** Token-free smart link for installing PingRoom on iOS or Android. */
73
- install_app?: string;
74
- }
75
- /** Public robot identity provisioned before a person approves pairing. */
76
- export interface AgentProfile {
77
- display_name: string | null;
78
- handle: string | null;
79
- avatar_id: string | null;
80
- avatar_url: string | null;
81
- }
82
- /** Agent wrapper used by pairing v2. Older servers omit it entirely. */
83
- export interface PairingAgent {
84
- id?: string;
85
- label?: string | null;
86
- handle?: string | null;
87
- profile?: AgentProfile;
88
- }
89
- /** Human who claimed the robot. Present only after approval. */
90
- export interface PairingOwner {
91
- name: string | null;
92
- }
93
- /** Visible home-room membership, distinct from the wider room-access grant. */
94
- export interface AgentRoomMembership {
95
- status: 'active' | 'removed';
96
- joined_at: string | null;
97
- removed_at: string | null;
98
- room: AgentDeliveryRoom | null;
99
- }
100
- /** Additive pairing-v2 identity metadata; every field is optional for old servers. */
101
- export interface PairingIdentityMetadata {
102
- flow_version?: 2;
103
- claim_mode?: 'agent_identity';
104
- agent?: PairingAgent;
105
- owner?: PairingOwner;
106
- /** Alias of legacy `room`: the robot's Question/Handoff delivery room. */
107
- home_room?: AgentDeliveryRoom | null;
108
- room_membership?: AgentRoomMembership | null;
109
- }
110
- export interface Credential extends PairingIdentityMetadata {
111
- credential: string;
112
- credential_type: 'pre_claim' | 'active';
113
- expires_in: number | null;
114
- scopes: string[];
115
- handle?: string;
116
- claim?: {
117
- start_uri: string;
118
- complete_uri: string;
119
- };
120
- account?: {
121
- name?: string | null;
122
- } | null;
123
- /** The delivery room, or null when the human pinned none. */
124
- room?: AgentDeliveryRoom | null;
125
- room_access?: AgentRoomAccess | null;
126
- /** The full grant. Empty under `room_access: 'all'`. */
127
- rooms?: AgentAccessRoom[];
128
- /** Server-authoritative endpoints associated with this connection. */
129
- links?: AgentCredentialLinks;
130
- }
131
- export interface ClaimStartParams {
132
- email: string;
133
- }
134
- export interface ClaimCompleteParams {
135
- email: string;
136
- otp: string;
137
- scopes?: ScopeInput[];
138
- }
139
- /** Start an app-approved pairing without copying an API token or room code. */
140
- export interface StartPairingParams {
141
- /**
142
- * @deprecated Pairing grants are server-authoritative. This value is ignored
143
- * and retained only so existing TypeScript callers continue to compile.
144
- */
145
- scopes?: ScopeInput[];
146
- agent_label?: string;
147
- }
148
- /** Short-lived browser and native-app links returned when pairing starts. */
149
- export interface PairingStart extends PairingIdentityMetadata {
150
- pair_token: string;
151
- /** Legacy approval link, kept QR-compatible for existing clients. */
152
- pair_url: string;
153
- /** Browser approval page. Fall back to `pair_url` on older servers. */
154
- pair_browser_url?: string;
155
- /** Native app universal link for QR renderers. Falls back to `pair_url` on older servers. */
156
- pair_qr_url?: string;
157
- /** Token-free smart install link. Never append `pair_token` to it. */
158
- app_install_url?: string;
159
- expires_in: number;
160
- poll_interval_ms: number;
161
- }
162
- export type PairedCredential = Omit<Credential, 'credential_type' | 'scopes'> & {
163
- credential_type: 'active';
164
- /**
165
- * The selected/deterministic private delivery room. Null remains valid when
166
- * the account has no eligible private room (and for older servers).
167
- */
168
- room: AgentDeliveryRoom | null;
169
- room_access: AgentRoomAccess;
170
- /** The full grant. Empty under `room_access: 'all'`. */
171
- rooms: AgentAccessRoom[];
172
- };
173
- export type PairingStatus = (PairingIdentityMetadata & {
174
- status: 'pending';
175
- }) | (PairingIdentityMetadata & {
176
- status: 'expired';
177
- }) | (PairedCredential & {
178
- status: 'active';
179
- /** Legacy server metadata accepted on input and omitted from the result. */
180
- scopes?: string[];
181
- });
182
- export interface WaitForPairingOptions {
183
- /** Stop waiting without consuming the pairing session. */
184
- signal?: AbortSignal;
185
- /** Override the server-suggested polling interval (clamped to 1–10 seconds). */
186
- pollIntervalMs?: number;
187
- }
188
- /**
189
- * The detail every press of a quick action must carry. `location` needs
190
- * `data.location`, `link` needs `data.url`, `file`/`photo`/`pdf` need
191
- * `attachment_ids` (photo: jpg/png only, pdf: pdf only). A press without it is
192
- * refused with `422 quick_action_input_required` and nothing is sent.
193
- */
194
- export type QuickActionInputType = 'none' | 'location' | 'link' | 'file' | 'photo' | 'pdf';
195
- export interface QuickActionInput {
196
- action_number: number;
197
- label: string;
198
- /**
199
- * Emoji or icon id. Sending `label` and `icon` both empty reserves the slot
200
- * as disabled: it stays in the layout and a press answers `404
201
- * action_not_configured`.
202
- */
203
- icon: string;
204
- sound?: string | null;
205
- haptic_style?: string | null;
206
- /** Every fire of this reusable action opens the acknowledgement lifecycle. */
207
- requires_ack?: boolean;
208
- /** Omit to keep the stored value; new slots default to `none`. */
209
- input_type?: QuickActionInputType;
210
- }
211
- /**
212
- * Body of `actions.updateLayout()`. `page_order` lists the new page positions:
213
- * each entry is the ORIGINAL page number (1–4) to keep at that index, or
214
- * `null` for a fresh blank page; original pages absent from the list are
215
- * deleted. `actions` is the full renumbered 4–16 set. `base_action_ids` is
216
- * every stored action id in `action_number` order as last read — a stale
217
- * snapshot is refused with `409 quick_action_layout_changed`.
218
- */
219
- export interface UpdateQuickActionLayoutInput {
220
- base_action_ids: string[];
221
- page_order: Array<number | null>;
222
- actions: QuickActionInput[];
223
- }
224
- export interface CreateRoomInput {
225
- name: string;
226
- icon: string;
227
- color: string;
228
- }
229
- export interface CreatePublicRoomInput extends CreateRoomInput {
230
- handle: string;
231
- description?: string;
232
- everyone_can_trigger?: boolean;
233
- is_password_protected?: boolean;
234
- password?: string;
235
- actions?: QuickActionInput[];
236
- category?: string;
237
- show_owner?: boolean;
238
- /**
239
- * Public-room location for nearby discovery. Send all three or none —
240
- * `createPublic()` rejects a partial trio locally, the server with a 422.
241
- */
242
- location_name?: string;
243
- location_latitude?: number;
244
- location_longitude?: number;
245
- }
246
- export interface JoinRoomInput {
247
- invite_code: string;
248
- password?: string;
249
- }
250
- export interface UpdateQuickActionInput {
251
- /**
252
- * The Ping's title. Must be sent, but may be `''` — a Ping can be named by
253
- * its emoji alone, and the app renders an untitled one as just the emoji.
254
- */
255
- label: string;
256
- icon: string;
257
- sound?: string | null;
258
- haptic_style?: string | null;
259
- /** Every fire of this reusable action opens the acknowledgement lifecycle. */
260
- requires_ack?: boolean;
261
- /** Omit to keep the stored value. */
262
- input_type?: QuickActionInputType;
263
- }
264
- export interface QuickAction {
265
- id?: string;
266
- action_number: number;
267
- label: string;
268
- icon: string;
269
- sound?: string | null;
270
- haptic_style?: string | null;
271
- /** Every fire of this reusable action opens the acknowledgement lifecycle. */
272
- requires_ack?: boolean;
273
- /** Missing on pre-2026-09-16 rows; treat absent as `none`. */
274
- input_type?: QuickActionInputType;
275
- [key: string]: unknown;
276
- }
277
- export interface Room {
278
- id: string;
279
- name: string;
280
- icon: string | null;
281
- color: string | null;
282
- invite_code: string;
283
- is_public?: boolean;
284
- handle?: string | null;
285
- quick_actions?: QuickAction[];
286
- /** 4, or 16 while the room owner is Pro. */
287
- quick_action_limit?: 4 | 16;
288
- /** Every stored slot, including pages hidden by a lapsed Pro. */
289
- quick_action_count?: number;
290
- location_name?: string | null;
291
- location_latitude?: number | null;
292
- location_longitude?: number | null;
293
- [key: string]: unknown;
294
- }
295
- /** Catalog ids accepted by room and webhook creation. */
296
- export interface RoomIconCatalog {
297
- version: number;
298
- base_url: string;
299
- categories: Array<{
300
- id: string;
301
- label: string;
302
- icons: string[];
303
- }>;
304
- icons: Record<string, {
305
- file: string;
306
- tags: string[];
307
- }>;
308
- }
309
- export interface CreateWebhookInput {
310
- name: string;
311
- title?: string | null;
312
- message?: string | null;
313
- emoji?: string | null;
314
- icon?: string | null;
315
- color?: string | null;
316
- sound?: string | null;
317
- haptic?: string | null;
318
- /** Optional Quick Ping preset. Omit or use null for an independent webhook. */
319
- action_number?: number | null;
320
- enabled?: boolean;
321
- cooldown_seconds?: number;
322
- }
323
- export interface UpdateWebhookInput extends Partial<CreateWebhookInput> {
324
- /** Rotate the trigger URL; the previous URL stops working. */
325
- regenerate_secret?: boolean;
326
- }
327
- /** Incoming webhook configuration. The trigger URL contains its credential. */
328
- export interface Webhook {
329
- id: string;
330
- room_id: string;
331
- name: string;
332
- title: string | null;
333
- message: string | null;
334
- emoji: string | null;
335
- icon: string | null;
336
- color: string | null;
337
- sound: string | null;
338
- haptic: string | null;
339
- /** Null when the webhook uses its own content without a Quick Ping preset. */
340
- action_number: number | null;
341
- enabled: boolean;
342
- cooldown_seconds: number;
343
- trigger_count: number;
344
- last_triggered_at?: string | null;
345
- webhook_url: string;
346
- created_at: string;
347
- updated_at: string;
348
- [key: string]: unknown;
349
- }
350
- /** A visible Ping — used for broadcasts and the retired direct-ping compatibility method. */
351
- export interface PingInput {
352
- /** Visible body (≤ 120 characters in private rooms; ≤ 160 in public rooms). */
353
- message: string;
354
- /** Optional visible title (≤ 40 characters). */
355
- title?: string;
356
- action_number?: number;
357
- action_icon?: string;
358
- /**
359
- * Structured data echoed on every read surface (<= 25 keys / 8KB).
360
- * Reserved keys `url` + `button_label` make the ping a tappable link —
361
- * see the `linkPing()` helper. Reserved `location` carries finite numeric
362
- * latitude/longitude plus an optional label/address — see `locationPing()`.
363
- */
364
- data?: JsonObject;
365
- correlation_id?: string;
366
- reply_to?: string;
367
- /**
368
- * Ordered ids from `attachments.upload()` (max 4). Ids are single-use: the
369
- * send claims them, and an already-claimed or expired id fails the whole
370
- * ping. File bytes never ride this JSON body.
371
- */
372
- attachment_ids?: string[];
373
- /**
374
- * Open the acknowledgement lifecycle for this ping. The ack_mode rule
375
- * determines when it resolves, and recipients see a lock-screen card with an Acknowledge button.
376
- *
377
- * Does NOT raise the delivery priority — that is {@link SendPingInput.is_urgent},
378
- * and the two are independent. They were one flag, which meant asking for a
379
- * ping that cuts through Focus also demanded that somebody acknowledge it.
380
- */
381
- requires_ack?: boolean;
382
- /** Confirmation rule; defaults to any. all waits for every original eligible recipient. */
383
- ack_mode?: AckMode;
384
- /**
385
- * Deliver time-sensitive so the ping breaks through Focus / Do Not Disturb
386
- * and reaches members who muted the room or you (a block still wins).
387
- * Delivery priority only: no acknowledgement, no Live Activity, nothing asked
388
- * of the recipient. Set alongside `requires_ack` for an acknowledgement that
389
- * also cuts through Focus.
390
- */
391
- is_urgent?: boolean;
392
- /** Optional acknowledgement deadline in seconds. Omit/null for no deadline. Ignored unless `requires_ack` is set. */
393
- ack_timeout_seconds?: number | null;
394
- }
395
- /**
396
- * Safe attachment metadata. Storage keys, checksums, owner ids, and permanent
397
- * URLs are deliberately not part of this contract — read the bytes through
398
- * `attachments.content()` with the credential that can see the ping.
399
- */
400
- export interface Attachment {
401
- id: string;
402
- filename: string;
403
- mime_type: string;
404
- size_bytes: number;
405
- created_at: string;
406
- }
407
- /** The file types the attachment endpoint accepts. */
408
- /** One row of a `.zip` attachment's listing. */
409
- export interface ZipManifestEntry {
410
- name: string;
411
- /** Null when the archive declared no size, or declared a ZIP64 sentinel. */
412
- size_bytes: number | null;
413
- is_directory: boolean;
414
- }
415
- /**
416
- * A `.zip` attachment's contents as recorded at upload. Bounded server-side, so
417
- * `entries` may be shorter than `total_entries`.
418
- */
419
- export interface ZipManifest {
420
- entries: ZipManifestEntry[];
421
- total_entries: number;
422
- truncated: boolean;
423
- /** Sum of the sizes the archive DECLARES. Nothing verifies or expands them. */
424
- total_uncompressed_bytes: number;
425
- }
426
- export type AttachmentExtension = 'md' | 'pdf' | 'html' | 'txt' | 'jpg' | 'jpeg' | 'png' | 'zip';
427
- export interface UploadAttachmentInput {
428
- /** File bytes (1 byte–5 MiB). A Blob/File, a Uint8Array, or a UTF-8 string. */
429
- content: Blob | Uint8Array | string;
430
- /** Display filename. Its extension must be one of AttachmentExtension. */
431
- filename: string;
432
- /** Overrides the type sent in the multipart part. Usually inferred is fine. */
433
- contentType?: string;
434
- signal?: AbortSignal;
435
- }
436
- export interface TriggerInput {
437
- /**
438
- * Only the sources a device legitimately originates. `webhook`/`system` are
439
- * stamped server-side and are rejected here.
440
- */
441
- trigger_source?: 'manual' | 'location';
442
- /**
443
- * Deliver this one press time-sensitive so it breaks through Focus / Do Not
444
- * Disturb and reaches members who muted the room or you (a block still
445
- * wins). Send-time only — the action's saved configuration is untouched,
446
- * and quick actions have no stored urgency policy to override. Never implies
447
- * `requires_ack`, which is the action's own saved acknowledgement policy.
448
- */
449
- is_urgent?: boolean;
450
- /**
451
- * One-shot acknowledgement modifier for this press only. It is OR-ed with the
452
- * action's stored policy, so it can only ADD an ack requirement — passing
453
- * `false` never removes one from an action already configured to require it.
454
- * The action's saved configuration is untouched either way.
455
- */
456
- requires_ack?: boolean;
457
- /** Applies to this press only, when its effective acknowledgement policy is enabled. */
458
- ack_mode?: AckMode;
459
- /**
460
- * The detail this press carries when the action has an `input_type`. Only
461
- * `location` and `url` are accepted on a trigger — no `button_label`; build
462
- * the fragments with `locationPing()` / `linkPing()` or pass them directly.
463
- */
464
- data?: TriggerData;
465
- /**
466
- * Ids from `attachments.upload()`, at most 4. Required when `input_type` is
467
- * `file`, `photo` (jpg/png only) or `pdf` (pdf only); a mismatched type is
468
- * `422 quick_action_input_type`.
469
- */
470
- attachment_ids?: string[];
471
- /**
472
- * The action's `id` as read from `actions.list()`. When that slot has since
473
- * moved pages the press is refused with `409 quick_action_layout_changed`
474
- * rather than firing the wrong Ping.
475
- */
476
- quick_action_id?: string;
477
- }
478
- /** The closed `data` object a quick-action press may carry. */
479
- export interface TriggerData {
480
- location?: TriggerLocation;
481
- /** Absolute http(s) URL, at most 2048 characters. */
482
- url?: string;
483
- }
484
- /** Same shape as `LocationPingLocation`; declared here to keep types.ts import-free. */
485
- export interface TriggerLocation {
486
- latitude: number;
487
- longitude: number;
488
- label?: string;
489
- address?: string;
490
- }
491
- export type AckMode = 'any' | 'all';
492
- /** The server-authoritative acknowledgement lifecycle attached to a ping. */
493
- export interface ActionState {
494
- /** Omitted by older servers and by the default any mode. */
495
- mode?: AckMode;
496
- confirmed_count?: number;
497
- required_count?: number;
498
- /** REST only; public rooms redact identities and MCP omits them. */
499
- confirmed_user_ids?: string[];
500
- status: 'open' | 'acked' | 'expired' | null;
501
- requires_ack: boolean;
502
- acked_by: {
503
- id: string | null;
504
- name: string | null;
505
- profile_image: string | null;
506
- } | null;
507
- acked_at: string | null;
508
- expires_at: string | null;
509
- /** Set when the confirmation window was closed early. */
510
- ended_at?: string | null;
511
- /** Viewer-specific human mutation eligibility; agent read paths return false. */
512
- can_ack?: boolean;
513
- /** Recipients who dismissed the card without confirming. Never counts as a confirmation. */
514
- dismissed_count?: number;
515
- /** REST only; public rooms redact identities and MCP omits them. */
516
- dismissed_user_ids?: string[];
517
- /** Viewer-scoped: when the reading viewer dismissed it. */
518
- dismissed_at?: string | null;
519
- }
520
- export interface PingResult {
521
- id: string;
522
- message: string;
523
- action_number: number | null;
524
- action_icon: string | null;
525
- trigger_source: string | null;
526
- data?: JsonObject | null;
527
- correlation_id?: string | null;
528
- reply_to?: string | null;
529
- attachments?: Attachment[];
530
- action_state?: ActionState | null;
531
- created_at: string;
532
- recipient_count?: number;
533
- muted_count?: number;
534
- [key: string]: unknown;
535
- }
536
- export interface DirectPingResult {
537
- id: string;
538
- target_handle: string;
539
- room_code: string;
540
- message: string;
541
- correlation_id: string | null;
542
- reply_to: string | null;
543
- action_state?: ActionState | null;
544
- created_at: string;
545
- [key: string]: unknown;
546
- }
547
- /**
548
- * The named fields of a listened/listed notification, without the index
549
- * signature. `Omit` collapses a type carrying a string index signature down to
550
- * that signature alone, so `NotificationDetail` derives from this rather than
551
- * from `AgentNotification` — otherwise every named field would widen to
552
- * `unknown`.
553
- */
554
- interface AgentNotificationFields {
555
- id: string;
556
- message: string;
557
- action_number: number | null;
558
- action_icon: string | null;
559
- trigger_source: string | null;
560
- /**
561
- * True when this ping is an agent handoff (a request to take over a
562
- * conversation) rather than an ordinary ping.
563
- */
564
- is_handoff?: boolean;
565
- data?: JsonObject | null;
566
- correlation_id?: string | null;
567
- reply_to?: string | null;
568
- attachments?: Attachment[];
569
- action_state?: ActionState | null;
570
- /** Confirmation rule the ping was sent with; absent on older rows. */
571
- ack_mode?: AckMode;
572
- /**
573
- * Delivered without sound/haptics (the sender's silent mode at send time).
574
- * `null` on rows written before 2026-09-16; not surfaced through MCP.
575
- */
576
- is_silent?: boolean | null;
577
- /**
578
- * The embedded Question when this ping carries one, else null. Same wire
579
- * shape as the dedicated Question read paths.
580
- */
581
- question?: Question | null;
582
- created_at: string;
583
- room?: {
584
- code: string;
585
- name: string;
586
- icon: string | null;
587
- color: string | null;
588
- };
589
- sender?: {
590
- id: string;
591
- name: string | null;
592
- };
593
- /**
594
- * Present when a connected agent (MCP / CLI credential) originated the
595
- * ping: the agent registration's display identity. Null/absent on human,
596
- * webhook, and trigger rows.
597
- */
598
- origin_agent?: {
599
- id?: string;
600
- handle: string | null;
601
- display_name: string | null;
602
- avatar_url?: string | null;
603
- } | null;
604
- }
605
- export interface AgentNotification extends AgentNotificationFields {
606
- [key: string]: unknown;
607
- }
608
- /** Full notification record returned by the single-notification read path. */
609
- export type NotificationDetail = Omit<AgentNotificationFields, 'room'> & {
610
- room_id?: string;
611
- sender_id?: string;
612
- type?: string;
613
- requires_ack?: boolean;
614
- /** Whether this ping was delivered time-sensitive. Independent of `requires_ack`. */
615
- is_urgent?: boolean;
616
- action_state: ActionState | null;
617
- room?: Room;
618
- [key: string]: unknown;
619
- };
620
- /** History keeps the full room and adds the listener-compatible `room.code`. */
621
- export interface NotificationHistoryEntry extends AgentNotification {
622
- room?: Room & {
623
- code: string;
624
- };
625
- }
626
- export interface ListNotificationsInput {
627
- type?: string;
628
- room_id?: string;
629
- date?: string;
630
- /** Page size (1–25). Omit to retain the server's legacy default. */
631
- limit?: number;
632
- /** Page number, starting at 1. */
633
- page?: number;
634
- /** @deprecated Use limit. Sent as limit when limit is absent. */
635
- notifications_per_page?: number;
636
- }
637
- export interface WaitInput {
638
- /** Cursor (a notification id). Omit to start from the current head. */
639
- after?: string;
640
- /** Seconds to hold the connection (0–30, default 20). */
641
- timeout?: number;
642
- /** Max notifications to return (1–100, default 50). */
643
- limit?: number;
644
- signal?: AbortSignal;
645
- }
646
- export interface WaitResult {
647
- notifications: AgentNotification[];
648
- cursor: string;
649
- }
650
- export interface WaitForAcknowledgementInput {
651
- /** Seconds to hold the connection (0–30, default 20). */
652
- timeout?: number;
653
- signal?: AbortSignal;
654
- }
655
- export interface AcknowledgementWaitResult {
656
- id: string;
657
- action_state: ActionState;
658
- }
659
- export interface ListenInput {
660
- after?: string;
661
- timeout?: number;
662
- limit?: number;
663
- signal?: AbortSignal;
664
- /** Called on a transient error instead of throwing; the loop backs off and retries. */
665
- onError?: (err: unknown) => void;
666
- /** Backoff after a handled error, in ms (default 1000). */
667
- backoffMs?: number;
668
- }
669
- export interface ApprovalInput {
670
- question: string;
671
- title?: string;
672
- options?: string[];
673
- correlation_id?: string;
674
- data?: JsonObject;
675
- ttl?: number;
676
- }
677
- export interface Approval {
678
- id: string;
679
- /** A human answer has status `decided`; inspect `decision` for the chosen option. */
680
- status: 'pending' | 'decided' | 'approved' | 'denied' | 'expired' | (string & {});
681
- question: string;
682
- title: string | null;
683
- options: string[];
684
- decision: string | null;
685
- decided_at: string | null;
686
- expires_at: string | null;
687
- correlation_id: string | null;
688
- data: JsonObject | null;
689
- room_code: string;
690
- [key: string]: unknown;
691
- }
692
- export interface WaitApprovalInput {
693
- /** Seconds the server holds the connection (0–30, default 20). */
694
- timeout?: number;
695
- signal?: AbortSignal;
696
- }
697
- /**
698
- * The authenticated human who answered a Question or handoff (never
699
- * caller-supplied).
700
- *
701
- * Every field is redacted to `null` together when the caller is not entitled to
702
- * see who answered, which is why `id` is nullable even on a decided question.
703
- * The server sends all five fields from both `QuestionPresenter::responder` and
704
- * the handoff presenter; the type previously declared only `id` and
705
- * `display_name`, and being a closed object type that made the avatar fields
706
- * unreachable without a cast.
707
- */
708
- export interface QuestionResponder {
709
- id: string | null;
710
- display_name: string | null;
711
- profile_image_url: string | null;
712
- emoji: string | null;
713
- color: string | null;
714
- }
715
- /** The lifecycle states of a Question. Terminal states are immutable. */
716
- export type QuestionState = 'pending' | 'answered' | 'expired' | 'cancelled';
717
- /** Who may answer: `direct` (one named person) or `room` (any eligible member). */
718
- export type ResponderScope = 'direct' | 'room';
719
- /** One option offered on a Question. A bare string is shorthand for `{ value, label: value }`. */
720
- export interface QuestionOptionInput {
721
- /** Stable machine token returned as the answer (1–40 chars, unique per question). */
722
- value: string;
723
- /** Human text on the button (defaults to `value`; 1–40 chars). */
724
- label?: string;
725
- /** Presentation hint: `primary` = brand-strike affirmative, `danger` = cancel. */
726
- style?: 'primary' | 'danger' | 'default';
727
- /** Legacy boolean form of `style: 'primary'`. */
728
- primary?: boolean;
729
- /** Legacy boolean form of `style: 'danger'`. */
730
- destructive?: boolean;
731
- }
732
- export type QuestionOptionSpec = string | QuestionOptionInput;
733
- /** Invite a short typed answer, on its own (text-only) or alongside options. */
734
- export interface QuestionTextInput {
735
- placeholder?: string;
736
- /** 1–60; clamped server-side. */
737
- max_length?: number;
738
- }
739
- export interface QuestionInput {
740
- /** The question the human reads (required, ≤ 500 chars). */
741
- prompt: string;
742
- /** Optional secondary line, e.g. a build number (≤ 40 chars). */
743
- context?: string;
744
- /** 2–4 options. Omit for the binary Approve/Deny default (the lock-screen fast path). */
745
- options?: QuestionOptionSpec[];
746
- /** Offer a typed answer instead of / alongside options. */
747
- text_input?: QuestionTextInput;
748
- /** `direct` (defaults to your bound user) or `room` (any eligible member). Default `direct`. */
749
- responder_scope?: ResponderScope;
750
- /** For `direct` scope: a specific room member (UUID). Defaults to the bound user. */
751
- target_user_id?: string;
752
- /** Seconds until expiry. Omit for the server default (1h); clamped to 30–86400. */
753
- ttl?: number;
754
- data?: JsonObject;
755
- correlation_id?: string;
756
- reply_to?: string;
757
- /** Ordered ids from `attachments.upload()` (max 4). Same single-use rules as PingInput. */
758
- attachment_ids?: string[];
759
- /** Reuse this key when retrying the same question creation. */
760
- idempotencyKey?: string;
761
- }
762
- /** A resolved option on the Question wire shape. */
763
- export interface QuestionOption {
764
- value: string;
765
- label: string;
766
- primary?: boolean;
767
- destructive?: boolean;
768
- [key: string]: unknown;
769
- }
770
- /** The resolution, present once `state === 'answered'`. */
771
- export interface QuestionAnswer {
772
- /** The chosen option's `value`, or null for a text-only answer. */
773
- value: string | null;
774
- /** The chosen option's `label`. */
775
- label: string | null;
776
- /** The typed answer, when the question invited one. */
777
- text: string | null;
778
- /**
779
- * The authenticated human who answered (never caller-supplied). Present once
780
- * the question is decided — but every field is redacted to `null` when the
781
- * caller is not entitled to see who answered, so `id` is nullable even here.
782
- * Matches `HandoffAnswer.responder`.
783
- */
784
- responder: QuestionResponder | null;
785
- answered_at: string | null;
786
- }
787
- /** The public Question wire shape — identical across ask / get / wait / list. */
788
- export interface Question {
789
- id: string;
790
- /** Canonical delivery notification when supplied by the server. */
791
- notification_id?: string | null;
792
- kind: 'question';
793
- prompt: string;
794
- context: string | null;
795
- options: QuestionOption[];
796
- text_input: {
797
- placeholder: string | null;
798
- max_length: number;
799
- } | null;
800
- responder_scope: ResponderScope;
801
- target_user_id: string | null;
802
- resolution_policy: 'first' | (string & {});
803
- state: QuestionState;
804
- answer: QuestionAnswer | null;
805
- expires_at: string | null;
806
- resolved_at: string | null;
807
- correlation_id: string | null;
808
- reply_to: string | null;
809
- data: JsonObject | null;
810
- created_at: string | null;
811
- room?: {
812
- code: string;
813
- name: string;
814
- icon: string | null;
815
- color: string | null;
816
- };
817
- room_code?: string;
818
- asker?: {
819
- /**
820
- * `'user'` for a human-asked Question (composer "Add Options"), `'agent'`
821
- * when an agent asked it. Both reach an agent's listen/list feed, so this
822
- * cannot be narrowed to `'agent'`.
823
- */
824
- type: 'agent' | 'user';
825
- id: string | null;
826
- handle: string | null;
827
- display_name: string | null;
828
- avatar_url: string | null;
829
- };
830
- [key: string]: unknown;
831
- }
832
- export interface WaitQuestionInput {
833
- /** Seconds the server holds the connection (0–30, default 20). */
834
- timeout?: number;
835
- signal?: AbortSignal;
836
- }
837
- export interface ListQuestionsInput {
838
- /** Filter by state; `all` returns every state. Omit for the recent window across states. */
839
- state?: QuestionState | 'all';
840
- }
841
- /** Which primitive backs a handoff: an acknowledgement or a multi-option question. */
842
- export type HandoffKind = 'ack' | 'question';
843
- /** The lifecycle states of an `ack` handoff. Terminal: `acked`, `expired`. */
844
- export type HandoffAckState = 'open' | 'acked' | 'expired';
845
- /** The lifecycle states of a `question` handoff. Terminal: `answered`, `expired`, `cancelled`. */
846
- export type HandoffQuestionState = 'answered' | 'expired' | 'cancelled' | 'pending';
847
- /** The full handoff state space (union of ack + question states). */
848
- export type HandoffState = HandoffAckState | HandoffQuestionState;
849
- /**
850
- * Whether the ping was enqueued, remains pending dispatch, or exhausted its
851
- * retry budget (`failed`). Only populated on create; null on reads.
852
- */
853
- export type HandoffDeliveryState = 'enqueued' | 'pending' | 'failed';
854
- /** One option offered on a `question` handoff. A bare string is shorthand for `{ value, label: value }`. */
855
- export interface HandoffOptionInput {
856
- /** Stable machine token returned as the answer. */
857
- value: string;
858
- /** Human text on the button (defaults to `value`). */
859
- label?: string;
860
- /** Presentation hint: `primary` = affirmative, `danger` = cancel/negative. */
861
- style?: 'primary' | 'danger' | 'default';
862
- }
863
- export type HandoffOptionSpec = string | HandoffOptionInput;
864
- /** A resolved option on the handoff wire shape. */
865
- export interface HandoffOption {
866
- value: string;
867
- label: string;
868
- [key: string]: unknown;
869
- }
870
- /** The human who acknowledged an `ack` handoff (present once `state === 'acked'`). */
871
- export interface HandoffAcker {
872
- /** Null when the actor is redacted (reader-privacy). */
873
- id: string | null;
874
- display_name: string | null;
875
- }
876
- /** The resolution of a `question` handoff (present once `state === 'answered'`). */
877
- export interface HandoffAnswer {
878
- /** The chosen option's `value`, or null for a text-only answer. */
879
- value: string | null;
880
- /** The chosen option's `label`. */
881
- label: string | null;
882
- /** The typed answer, when the question invited one. */
883
- text: string | null;
884
- /** The authenticated human who answered. */
885
- responder: QuestionResponder | null;
886
- answered_at: string | null;
887
- }
888
- /**
889
- * The public handoff wire shape — identical across create / get / wait / list.
890
- * `options`/`answer` appear on question handoffs; `acked_by`/`acked_at` on ack
891
- * handoffs.
892
- */
893
- export interface Handoff {
894
- id: string;
895
- kind: HandoffKind;
896
- prompt: string;
897
- state: HandoffState;
898
- /** Delivery status, populated only on create; null on reads. */
899
- delivery_state: HandoffDeliveryState | null;
900
- correlation_id: string | null;
901
- reply_to: string | null;
902
- data: JsonObject | null;
903
- expires_at: string | null;
904
- created_at: string | null;
905
- /** ack handoff: the human who acknowledged (once `state === 'acked'`). */
906
- acked_by?: HandoffAcker | null;
907
- /** ack handoff: when it was acknowledged. */
908
- acked_at?: string | null;
909
- /** question handoff: the offered options. */
910
- options?: HandoffOption[];
911
- /** question handoff: the resolution (once `state === 'answered'`). */
912
- answer?: HandoffAnswer | null;
913
- /**
914
- * Question handoffs used for Agent Inbox onboarding expose whether the
915
- * server recorded the exact delivery + answer + agent-observation event.
916
- */
917
- activation_completed?: boolean;
918
- [key: string]: unknown;
919
- }
920
- /** Ask a human to acknowledge (the ack handoff). Resolves on the first acknowledgement. */
921
- export interface RequestAckInput {
922
- /** What the human reads (required, ≤ 500 chars). */
923
- prompt: string;
924
- /** Who to reach: `me` (the bound human, the default) or a user UUID. */
925
- target?: string;
926
- /** Seconds until expiry. Clamped server-side to 120–86400; default 900. */
927
- expiresIn?: number;
928
- /** Interruption level — `active` (default) or `passive`. */
929
- urgency?: 'active' | 'passive';
930
- correlationId?: string;
931
- replyTo?: string;
932
- data?: JsonObject;
933
- /**
934
- * Idempotency key — same key + same body replays the original resource; a
935
- * different body for the same key returns a 409 `idempotency_conflict`.
936
- * Reuse it verbatim on network retries.
937
- */
938
- idempotencyKey?: string;
939
- }
940
- /** Ask a human a multi-option question (the question handoff). Resolves on the first tapped answer. */
941
- export interface AskInput extends RequestAckInput {
942
- /** 2–4 options. A bare string is shorthand for `{ value, label: value }`. */
943
- options: HandoffOptionSpec[];
944
- }
945
- export interface WaitHandoffInput {
946
- /** Seconds the server holds the connection (server caps at 25s; default 20). */
947
- timeout?: number;
948
- signal?: AbortSignal;
949
- }
950
- export interface ListHandoffsInput {
951
- /** `open` for unresolved work, or `all` for recent history (up to 200 per kind). */
952
- state?: 'open' | 'all';
953
- }
954
- /** Idempotent first-connect result from POST /api/agent/inbox/ensure. */
955
- export interface AgentInboxEnsureResult {
956
- onboarded: true;
957
- replayed: boolean;
958
- room: {
959
- id: string;
960
- name: string;
961
- invite_code: string;
962
- is_agent_inbox: boolean;
963
- };
964
- question: {
965
- id: string;
966
- kind: 'question';
967
- prompt: string;
968
- options: HandoffOption[];
969
- state: HandoffQuestionState;
970
- expires_at: string | null;
971
- created_at: string | null;
972
- };
973
- }
974
- /** Cancellation for the idempotent Agent Inbox ensure request. */
975
- export interface AgentInboxEnsureInput {
976
- signal?: AbortSignal;
977
- }
978
- /**
979
- * Controls the activation handoff wait. `timeout` is the duration of each
980
- * bounded server hold; a still-pending response is polled again until the
981
- * server confirms activation, the Question expires/cancels, the overall
982
- * deadline elapses, or `signal` is aborted.
983
- */
984
- export interface AgentInboxActivateInput extends WaitHandoffInput {
985
- /**
986
- * Wall-clock limit for ensure + every pending long-poll combined. Defaults
987
- * to 120000 (two minutes). Distinct from `timeout`, which controls one hold.
988
- */
989
- overallTimeoutMs?: number;
990
- }
991
- /** The terminal question returned by a completed Agent Inbox activation. */
992
- export type AgentInboxActivationQuestion = Handoff & {
993
- kind: 'question';
994
- state: 'answered';
995
- answer: HandoffAnswer;
996
- activation_completed: true;
997
- };
998
- /** `ensure` metadata plus the terminal, fully resolved onboarding handoff. */
999
- export type AgentInboxActivationResult = Omit<AgentInboxEnsureResult, 'question'> & {
1000
- activation_completed: true;
1001
- question: AgentInboxActivationQuestion;
1002
- };
1003
- export interface RotateHandleResult {
1004
- handle: string;
1005
- [key: string]: unknown;
1006
- }
1007
- export type PingPolicy = 'open' | 'members' | 'closed' | (string & {});
1008
- export type ActivityBucket = 'active_now' | 'today' | 'this_week' | 'quiet' | (string & {});
1009
- export interface DirectoryEntry {
1010
- handle: string;
1011
- display_name: string;
1012
- tagline: string;
1013
- tags: string[];
1014
- icon: string | null;
1015
- color: string | null;
1016
- ping_policy: PingPolicy;
1017
- is_featured: boolean;
1018
- operated_by: string | null;
1019
- last_active: ActivityBucket;
1020
- }
1021
- export interface DirectoryProfile extends DirectoryEntry {
1022
- description: string | null;
1023
- listed_at: string | null;
1024
- card_url: string | null;
1025
- }
1026
- export interface DirectoryListInput {
1027
- search?: string;
1028
- tag?: string;
1029
- per_page?: number;
1030
- page?: number;
1031
- }
1032
- export interface Paginated<T> {
1033
- current_page: number;
1034
- data: T[];
1035
- per_page: number;
1036
- total: number;
1037
- last_page: number;
1038
- next_page_url: string | null;
1039
- prev_page_url: string | null;
1040
- [key: string]: unknown;
1041
- }
1042
- export {};
8
+ export type * from './types/common.js';
9
+ export type * from './types/auth.js';
10
+ export type * from './types/rooms.js';
11
+ export type * from './types/notifications.js';
12
+ export type * from './types/approvals.js';
13
+ export type * from './types/questions.js';
14
+ export type * from './types/handoffs.js';
15
+ export type * from './types/inbox.js';
16
+ export type * from './types/profile.js';
1043
17
  //# sourceMappingURL=types.d.ts.map