@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.
- package/README.md +288 -44
- package/dist/client.d.ts +27 -312
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +33 -1154
- package/dist/client.js.map +1 -1
- package/dist/errors.d.ts +40 -6
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +56 -4
- package/dist/errors.js.map +1 -1
- package/dist/http.d.ts +12 -1
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +47 -18
- package/dist/http.js.map +1 -1
- package/dist/index.d.ts +3 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/internal/async.d.ts +2 -0
- package/dist/internal/async.d.ts.map +1 -1
- package/dist/internal/async.js +6 -0
- package/dist/internal/async.js.map +1 -1
- package/dist/internal/guards.d.ts +16 -0
- package/dist/internal/guards.d.ts.map +1 -1
- package/dist/internal/guards.js +22 -1
- package/dist/internal/guards.js.map +1 -1
- package/dist/internal/request.d.ts +41 -0
- package/dist/internal/request.d.ts.map +1 -0
- package/dist/internal/request.js +78 -0
- package/dist/internal/request.js.map +1 -0
- package/dist/internal/retry.d.ts +65 -0
- package/dist/internal/retry.d.ts.map +1 -0
- package/dist/internal/retry.js +126 -0
- package/dist/internal/retry.js.map +1 -0
- package/dist/internal/url.d.ts +9 -0
- package/dist/internal/url.d.ts.map +1 -1
- package/dist/internal/url.js +25 -0
- package/dist/internal/url.js.map +1 -1
- package/dist/internal/validate.d.ts +13 -0
- package/dist/internal/validate.d.ts.map +1 -0
- package/dist/internal/validate.js +36 -0
- package/dist/internal/validate.js.map +1 -0
- package/dist/linkPing.d.ts.map +1 -1
- package/dist/linkPing.js +6 -2
- package/dist/linkPing.js.map +1 -1
- package/dist/liveStatus.d.ts +106 -11
- package/dist/liveStatus.d.ts.map +1 -1
- package/dist/liveStatus.js +20 -3
- package/dist/liveStatus.js.map +1 -1
- package/dist/mcp.d.ts.map +1 -1
- package/dist/mcp.js +40 -10
- package/dist/mcp.js.map +1 -1
- package/dist/namespaces/actions.d.ts +50 -0
- package/dist/namespaces/actions.d.ts.map +1 -0
- package/dist/namespaces/actions.js +219 -0
- package/dist/namespaces/actions.js.map +1 -0
- package/dist/namespaces/approvals.d.ts +23 -0
- package/dist/namespaces/approvals.d.ts.map +1 -0
- package/dist/namespaces/approvals.js +78 -0
- package/dist/namespaces/approvals.js.map +1 -0
- package/dist/namespaces/attachments.d.ts +37 -0
- package/dist/namespaces/attachments.d.ts.map +1 -0
- package/dist/namespaces/attachments.js +91 -0
- package/dist/namespaces/attachments.js.map +1 -0
- package/dist/namespaces/auth.d.ts +58 -0
- package/dist/namespaces/auth.d.ts.map +1 -0
- package/dist/namespaces/auth.js +242 -0
- package/dist/namespaces/auth.js.map +1 -0
- package/dist/namespaces/directory.d.ts +10 -0
- package/dist/namespaces/directory.d.ts.map +1 -0
- package/dist/namespaces/directory.js +19 -0
- package/dist/namespaces/directory.js.map +1 -0
- package/dist/namespaces/handoffs.d.ts +47 -0
- package/dist/namespaces/handoffs.d.ts.map +1 -0
- package/dist/namespaces/handoffs.js +126 -0
- package/dist/namespaces/handoffs.js.map +1 -0
- package/dist/namespaces/inbox.d.ts +17 -0
- package/dist/namespaces/inbox.d.ts.map +1 -0
- package/dist/namespaces/inbox.js +192 -0
- package/dist/namespaces/inbox.js.map +1 -0
- package/dist/namespaces/live.d.ts +57 -0
- package/dist/namespaces/live.d.ts.map +1 -0
- package/dist/namespaces/live.js +116 -0
- package/dist/namespaces/live.js.map +1 -0
- package/dist/namespaces/notifications.d.ts +25 -0
- package/dist/namespaces/notifications.d.ts.map +1 -0
- package/dist/namespaces/notifications.js +128 -0
- package/dist/namespaces/notifications.js.map +1 -0
- package/dist/namespaces/profile.d.ts +19 -0
- package/dist/namespaces/profile.d.ts.map +1 -0
- package/dist/namespaces/profile.js +22 -0
- package/dist/namespaces/profile.js.map +1 -0
- package/dist/namespaces/questions.d.ts +41 -0
- package/dist/namespaces/questions.d.ts.map +1 -0
- package/dist/namespaces/questions.js +107 -0
- package/dist/namespaces/questions.js.map +1 -0
- package/dist/namespaces/rooms.d.ts +13 -0
- package/dist/namespaces/rooms.d.ts.map +1 -0
- package/dist/namespaces/rooms.js +41 -0
- package/dist/namespaces/rooms.js.map +1 -0
- package/dist/namespaces/webhooks.d.ts +11 -0
- package/dist/namespaces/webhooks.d.ts.map +1 -0
- package/dist/namespaces/webhooks.js +32 -0
- package/dist/namespaces/webhooks.js.map +1 -0
- package/dist/types/approvals.d.ts +62 -0
- package/dist/types/approvals.d.ts.map +1 -0
- package/dist/types/approvals.js +2 -0
- package/dist/types/approvals.js.map +1 -0
- package/dist/types/auth.d.ts +185 -0
- package/dist/types/auth.d.ts.map +1 -0
- package/dist/types/auth.js +2 -0
- package/dist/types/auth.js.map +1 -0
- package/dist/types/common.d.ts +43 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/common.js +2 -0
- package/dist/types/common.js.map +1 -0
- package/dist/types/handoffs.d.ts +121 -0
- package/dist/types/handoffs.d.ts.map +1 -0
- package/dist/types/handoffs.js +2 -0
- package/dist/types/handoffs.js.map +1 -0
- package/dist/types/inbox.d.ts +51 -0
- package/dist/types/inbox.d.ts.map +1 -0
- package/dist/types/inbox.js +2 -0
- package/dist/types/inbox.js.map +1 -0
- package/dist/types/notifications.d.ts +376 -0
- package/dist/types/notifications.d.ts.map +1 -0
- package/dist/types/notifications.js +2 -0
- package/dist/types/notifications.js.map +1 -0
- package/dist/types/profile.d.ts +30 -0
- package/dist/types/profile.d.ts.map +1 -0
- package/dist/types/profile.js +3 -0
- package/dist/types/profile.js.map +1 -0
- package/dist/types/questions.d.ts +210 -0
- package/dist/types/questions.d.ts.map +1 -0
- package/dist/types/questions.js +2 -0
- package/dist/types/questions.js.map +1 -0
- package/dist/types/rooms.d.ts +163 -0
- package/dist/types/rooms.d.ts.map +1 -0
- package/dist/types/rooms.js +3 -0
- package/dist/types/rooms.js.map +1 -0
- package/dist/types.d.ts +9 -1035
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/webhooks.d.ts +32 -5
- package/dist/webhooks.d.ts.map +1 -1
- package/dist/webhooks.js +44 -14
- package/dist/webhooks.js.map +1 -1
- package/package.json +4 -2
- package/src/client.ts +115 -0
- package/src/errors.ts +291 -0
- package/src/http.ts +225 -0
- package/src/index.ts +97 -0
- package/src/internal/async.ts +54 -0
- package/src/internal/guards.ts +129 -0
- package/src/internal/request.ts +97 -0
- package/src/internal/retry.ts +157 -0
- package/src/internal/url.ts +78 -0
- package/src/internal/validate.ts +42 -0
- package/src/linkPing.ts +56 -0
- package/src/liveStatus.ts +337 -0
- package/src/locationPing.ts +101 -0
- package/src/mcp.ts +161 -0
- package/src/namespaces/actions.ts +234 -0
- package/src/namespaces/approvals.ts +104 -0
- package/src/namespaces/attachments.ts +106 -0
- package/src/namespaces/auth.ts +284 -0
- package/src/namespaces/directory.ts +21 -0
- package/src/namespaces/handoffs.ts +160 -0
- package/src/namespaces/inbox.ts +253 -0
- package/src/namespaces/live.ts +134 -0
- package/src/namespaces/notifications.ts +152 -0
- package/src/namespaces/profile.ts +24 -0
- package/src/namespaces/questions.ts +133 -0
- package/src/namespaces/rooms.ts +53 -0
- package/src/namespaces/webhooks.ts +38 -0
- package/src/types/approvals.ts +67 -0
- package/src/types/auth.ts +202 -0
- package/src/types/common.ts +74 -0
- package/src/types/handoffs.ts +148 -0
- package/src/types/inbox.ts +64 -0
- package/src/types/notifications.ts +393 -0
- package/src/types/profile.ts +37 -0
- package/src/types/questions.ts +226 -0
- package/src/types/rooms.ts +169 -0
- package/src/types.ts +17 -0
- package/src/version.ts +2 -0
- package/src/webhooks.ts +373 -0
- package/dist/liveActivity.d.ts +0 -101
- package/dist/liveActivity.d.ts.map +0 -1
- package/dist/liveActivity.js +0 -83
- package/dist/liveActivity.js.map +0 -1
package/dist/client.d.ts
CHANGED
|
@@ -1,314 +1,20 @@
|
|
|
1
|
-
import { HttpClient } from './http.js';
|
|
2
|
-
import type { LiveStatusPing, LiveStatusResult, LiveStatusSnapshot } from './liveStatus.js';
|
|
3
1
|
import { McpClient } from './mcp.js';
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
* PingRoom app. The server owns the full grant shown to the approver; this
|
|
21
|
-
* client sends no scope list. The pending credential stays private inside the
|
|
22
|
-
* client and is replaced automatically once waitForPairing() succeeds.
|
|
23
|
-
*/
|
|
24
|
-
startPairing(params?: StartPairingParams): Promise<PairingStart>;
|
|
25
|
-
/** Read the current state of an app pairing using the pending credential. */
|
|
26
|
-
pairingStatus(options?: Pick<WaitForPairingOptions, 'signal'>): Promise<PairingStatus>;
|
|
27
|
-
/**
|
|
28
|
-
* Wait until the person approves in PingRoom, or the short-lived link
|
|
29
|
-
* expires. Transient network, 429, and 5xx failures are retried inside the
|
|
30
|
-
* server-provided lifetime. On success the client immediately starts using
|
|
31
|
-
* the active credential returned by the server.
|
|
32
|
-
*/
|
|
33
|
-
waitForPairing(pairing: PairingStart, options?: WaitForPairingOptions): Promise<PairedCredential>;
|
|
34
|
-
private throwIfPairingAborted;
|
|
35
|
-
/** Rotate to a fresh credential (same scopes/handle). */
|
|
36
|
-
refresh(): Promise<Credential>;
|
|
37
|
-
/** Revoke the current credential. */
|
|
38
|
-
revoke(): Promise<void>;
|
|
39
|
-
}
|
|
40
|
-
declare class RoomsApi {
|
|
41
|
-
private readonly http;
|
|
42
|
-
constructor(http: HttpClient);
|
|
43
|
-
icons(): Promise<RoomIconCatalog>;
|
|
44
|
-
list(): Promise<Room[]>;
|
|
45
|
-
get(inviteCode: string): Promise<Room>;
|
|
46
|
-
create(input: CreateRoomInput): Promise<Room>;
|
|
47
|
-
createPublic(input: CreatePublicRoomInput): Promise<Room>;
|
|
48
|
-
join(input: JoinRoomInput): Promise<Room>;
|
|
49
|
-
}
|
|
50
|
-
declare class ActionsApi {
|
|
51
|
-
private readonly http;
|
|
52
|
-
constructor(http: HttpClient);
|
|
53
|
-
list(inviteCode: string): Promise<QuickAction[]>;
|
|
54
|
-
update(inviteCode: string, actionNumber: number, input: UpdateQuickActionInput): Promise<QuickAction>;
|
|
55
|
-
/**
|
|
56
|
-
* Write up to 16 action slots in one request. The server enforces the room owner's plan.
|
|
57
|
-
* Add new pages in complete groups of four; existing slots may be edited individually.
|
|
58
|
-
*
|
|
59
|
-
* Prefer this over looping `update()`. Each single-slot write enqueues its
|
|
60
|
-
* own silent rooms-refresh push, so configuring a room's four Pings one at a
|
|
61
|
-
* time wakes room members' devices four times inside a few seconds — four of a
|
|
62
|
-
* finite daily background-push budget spent on one logical operation.
|
|
63
|
-
*
|
|
64
|
-
* Partial and additive: slots absent from `actions` keep their current
|
|
65
|
-
* configuration, so this is also the right call for editing a single Ping.
|
|
66
|
-
* Nothing here deletes an action, and an empty array is rejected locally
|
|
67
|
-
* rather than being sent as a clear. Resolves to the room's full ordered
|
|
68
|
-
* action set, not just the slots written.
|
|
69
|
-
*/
|
|
70
|
-
updateMany(inviteCode: string, actions: QuickActionInput[]): Promise<QuickAction[]>;
|
|
71
|
-
/**
|
|
72
|
-
* Press a slot. When the action has an `input_type`, pass the matching
|
|
73
|
-
* detail (`data.location`, `data.url`, or `attachment_ids`) or the server
|
|
74
|
-
* refuses the press with `422 quick_action_input_required` and sends nothing.
|
|
75
|
-
* Read `input_type` from `list()` first; pass the action's `id` as
|
|
76
|
-
* `quick_action_id` to be refused rather than fire the wrong Ping if the
|
|
77
|
-
* owner moved pages meanwhile.
|
|
78
|
-
*/
|
|
79
|
-
trigger(inviteCode: string, actionNumber: number, input?: TriggerInput): Promise<PingResult>;
|
|
80
|
-
/**
|
|
81
|
-
* Replace the room's page layout atomically (room owner on Pro only). See
|
|
82
|
-
* `UpdateQuickActionLayoutInput` for the snapshot contract; a stale
|
|
83
|
-
* `base_action_ids` is `409 quick_action_layout_changed`, a page still used
|
|
84
|
-
* by a time trigger, webhook, agent binding or running live update is
|
|
85
|
-
* `409 quick_action_page_in_use`. Prefer `deletePage()`, which builds the
|
|
86
|
-
* body from a fresh read.
|
|
87
|
-
*/
|
|
88
|
-
updateLayout(inviteCode: string, input: UpdateQuickActionLayoutInput): Promise<QuickAction[]>;
|
|
89
|
-
/**
|
|
90
|
-
* Delete one page (1–4) and shift the later pages left, keeping every other
|
|
91
|
-
* slot's configuration. Reads the current action set first so the layout
|
|
92
|
-
* snapshot is real, then calls `updateLayout()`. Page 1 can be deleted only
|
|
93
|
-
* when another page remains.
|
|
94
|
-
*/
|
|
95
|
-
deletePage(inviteCode: string, page: number): Promise<QuickAction[]>;
|
|
96
|
-
}
|
|
97
|
-
declare class WebhooksApi {
|
|
98
|
-
private readonly http;
|
|
99
|
-
constructor(http: HttpClient);
|
|
100
|
-
list(inviteCode: string): Promise<Webhook[]>;
|
|
101
|
-
create(inviteCode: string, input: CreateWebhookInput): Promise<Webhook>;
|
|
102
|
-
update(inviteCode: string, webhookId: string, input: UpdateWebhookInput): Promise<Webhook>;
|
|
103
|
-
delete(inviteCode: string, webhookId: string): Promise<void>;
|
|
104
|
-
}
|
|
105
|
-
declare class NotificationsApi {
|
|
106
|
-
private readonly http;
|
|
107
|
-
constructor(http: HttpClient);
|
|
108
|
-
/** Paginated list (polling fallback). Prefer wait()/listen() for real-time. */
|
|
109
|
-
list(input?: ListNotificationsInput): Promise<Paginated<NotificationHistoryEntry>>;
|
|
110
|
-
/** Fetch one visible notification, including its current acknowledgement state. */
|
|
111
|
-
getNotification(notificationId: string): Promise<NotificationDetail>;
|
|
112
|
-
/**
|
|
113
|
-
* One bounded long-poll for an ack-required ping. The returned state may
|
|
114
|
-
* still be `open` when the hold timeout elapses; call again to keep waiting.
|
|
115
|
-
*/
|
|
116
|
-
waitForAcknowledgement(notificationId: string, input?: WaitForAcknowledgementInput): Promise<AcknowledgementWaitResult>;
|
|
117
|
-
/** One long-poll: resolves as soon as new pings land, or with an empty list at timeout. */
|
|
118
|
-
wait(input?: WaitInput): Promise<WaitResult>;
|
|
119
|
-
/**
|
|
120
|
-
* Continuous real-time inbound: an async iterator that long-polls in a loop,
|
|
121
|
-
* advancing the cursor, yielding each new ping. Stops when `signal` aborts.
|
|
122
|
-
*
|
|
123
|
-
* for await (const ping of pr.notifications.listen({ signal })) { ... }
|
|
124
|
-
*/
|
|
125
|
-
listen(input?: ListenInput): AsyncGenerator<AgentNotification, void, void>;
|
|
126
|
-
}
|
|
127
|
-
declare class AgentsApi {
|
|
128
|
-
private readonly http;
|
|
129
|
-
constructor(http: HttpClient);
|
|
130
|
-
/**
|
|
131
|
-
* @deprecated Retired server-side — always fails with 410
|
|
132
|
-
* `cross_account_ping_retired`. An agent can only reach the account that
|
|
133
|
-
* connected it; to reach anyone else, post into a room you both belong to.
|
|
134
|
-
*/
|
|
135
|
-
ping(handle: string, ping: PingInput): Promise<DirectPingResult>;
|
|
136
|
-
}
|
|
137
|
-
declare class ApprovalsApi {
|
|
138
|
-
private readonly http;
|
|
139
|
-
constructor(http: HttpClient);
|
|
140
|
-
/** Ask the human you act for to decide; returns the pending approval. */
|
|
141
|
-
request(inviteCode: string, input: ApprovalInput): Promise<Approval>;
|
|
142
|
-
get(approvalId: string): Promise<Approval>;
|
|
143
|
-
/** One long-poll for the decision; returns the (possibly still-pending) approval. */
|
|
144
|
-
wait(approvalId: string, input?: WaitApprovalInput): Promise<Approval>;
|
|
145
|
-
/** Block until the human decides (or the request expires), looping wait() under the hood. */
|
|
146
|
-
waitForDecision(approvalId: string, input?: {
|
|
147
|
-
signal?: AbortSignal;
|
|
148
|
-
}): Promise<Approval>;
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* The general human-in-the-loop primitive: ask a human a question with 2–4
|
|
152
|
-
* options (or a short typed answer) and block until they tap an answer. An
|
|
153
|
-
* {@link ApprovalsApi | approval} is the two-option case; reach for questions
|
|
154
|
-
* when you need more choices, a typed reply, or room-scope answering.
|
|
155
|
-
*/
|
|
156
|
-
declare class QuestionsApi {
|
|
157
|
-
private readonly http;
|
|
158
|
-
constructor(http: HttpClient);
|
|
159
|
-
/** Ask a Question in a room; returns the pending Question (id + computed expiry). */
|
|
160
|
-
ask(inviteCode: string, input: QuestionInput): Promise<Question>;
|
|
161
|
-
/** Fetch a Question's current state. */
|
|
162
|
-
get(questionId: string): Promise<Question>;
|
|
163
|
-
/** One long-poll for the answer; returns the (possibly still-pending) Question. */
|
|
164
|
-
wait(questionId: string, input?: WaitQuestionInput): Promise<Question>;
|
|
165
|
-
/**
|
|
166
|
-
* Block until the human answers (or the question expires/cancels), looping
|
|
167
|
-
* wait() under the hood. Returns the resolved Question — inspect `state` and
|
|
168
|
-
* `answer.value` to branch.
|
|
169
|
-
*/
|
|
170
|
-
waitForAnswer(questionId: string, input?: {
|
|
171
|
-
signal?: AbortSignal;
|
|
172
|
-
}): Promise<Question>;
|
|
173
|
-
/** List the asker's Questions, optionally filtered by state. */
|
|
174
|
-
list(input?: ListQuestionsInput): Promise<Question[]>;
|
|
175
|
-
/** Withdraw a still-pending Question (409 if it already resolved). */
|
|
176
|
-
cancel(questionId: string): Promise<Question>;
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* The Handoff façade: the Agent → one-human loop. Always DIRECT (exactly one
|
|
180
|
-
* human) and PRIVATE (no other room member can read it). Backed by the ack and
|
|
181
|
-
* question primitives, so its {@link Handoff.state | state} space is their union
|
|
182
|
-
* — kept DISTINCT per {@link Handoff.kind | kind}. A negative answer to a
|
|
183
|
-
* question handoff (e.g. `hold`) is a SUCCESSFUL `answered` result, not an error.
|
|
184
|
-
*
|
|
185
|
-
* const task = await pr.handoffs.requestAck({ prompt, idempotencyKey });
|
|
186
|
-
* const result = await pr.handoffs.waitForResult(task.id);
|
|
187
|
-
*
|
|
188
|
-
* const q = await pr.handoffs.ask({ prompt, options: ['deploy', 'hold'], idempotencyKey });
|
|
189
|
-
*/
|
|
190
|
-
declare class HandoffsApi {
|
|
191
|
-
private readonly http;
|
|
192
|
-
constructor(http: HttpClient);
|
|
193
|
-
/** Ask a human to acknowledge (an `ack` handoff). Resolves on the first acknowledgement. */
|
|
194
|
-
requestAck(input: RequestAckInput): Promise<Handoff>;
|
|
195
|
-
/**
|
|
196
|
-
* Ask a human a multi-option question (a `question` handoff). Resolves on the
|
|
197
|
-
* first tapped answer. Bare-string options normalize to `{ value, label }`.
|
|
198
|
-
*/
|
|
199
|
-
ask(input: AskInput): Promise<Handoff>;
|
|
200
|
-
/** Fetch a handoff's current state. */
|
|
201
|
-
get(id: string): Promise<Handoff>;
|
|
202
|
-
/**
|
|
203
|
-
* Block until the handoff resolves (or expires/cancels), looping the bounded
|
|
204
|
-
* long-poll under the hood. `expired`/`cancelled` and a negative answer (e.g.
|
|
205
|
-
* `hold`) all surface as normal terminal results — nothing is thrown for them.
|
|
206
|
-
*/
|
|
207
|
-
waitForResult(id: string, input?: WaitHandoffInput): Promise<Handoff>;
|
|
208
|
-
/** List the agent's open handoffs or bounded recent history. */
|
|
209
|
-
list(input?: ListHandoffsInput): Promise<Handoff[]>;
|
|
210
|
-
/** One bounded long-poll; returns the (possibly still-open) handoff. */
|
|
211
|
-
private wait;
|
|
212
|
-
private create;
|
|
213
|
-
}
|
|
214
|
-
/** Setup and activation of the bound human's Agent Inbox delivery room. */
|
|
215
|
-
declare class InboxApi {
|
|
216
|
-
private readonly http;
|
|
217
|
-
constructor(http: HttpClient);
|
|
218
|
-
/** Replay the viable activation attempt or create its next numbered retry. */
|
|
219
|
-
ensure(input?: AgentInboxEnsureInput): Promise<AgentInboxEnsureResult>;
|
|
220
|
-
/**
|
|
221
|
-
* Ensure the bound human's Agent Inbox, then block on its onboarding
|
|
222
|
-
* Question until the server confirms activation, it expires/cancels, or the
|
|
223
|
-
* overall deadline elapses. Pairing remains a separate operation so adopting
|
|
224
|
-
* a credential never silently waits for a phone response.
|
|
225
|
-
*/
|
|
226
|
-
activate(input?: AgentInboxActivateInput): Promise<AgentInboxActivationResult>;
|
|
227
|
-
}
|
|
228
|
-
declare class ProfileApi {
|
|
229
|
-
private readonly http;
|
|
230
|
-
constructor(http: HttpClient);
|
|
231
|
-
/**
|
|
232
|
-
* Set this agent's own avatar (from the bot avatar set) — the robot face
|
|
233
|
-
* its pings and Questions wear. Never touches the bound human's profile
|
|
234
|
-
* picture. Returns `{ ok, avatar_id, avatar_url }`.
|
|
235
|
-
*/
|
|
236
|
-
setAvatar(avatarId: string): Promise<{
|
|
237
|
-
ok: boolean;
|
|
238
|
-
avatar_id: string;
|
|
239
|
-
avatar_url: string;
|
|
240
|
-
}>;
|
|
241
|
-
/** Rotate the agent's handle — the kill-switch for a leaked handle. */
|
|
242
|
-
rotateHandle(): Promise<RotateHandleResult>;
|
|
243
|
-
}
|
|
244
|
-
/**
|
|
245
|
-
* Live-status streams — a self-updating card on the room members' lock screen.
|
|
246
|
-
*
|
|
247
|
-
* Requires the `pingroom:live:write` scope. Free accounts get a small daily
|
|
248
|
-
* budget of NEW streams; updates and the terminal ping of an open stream are
|
|
249
|
-
* never charged, so a card can never be quota-blocked into hanging open. A
|
|
250
|
-
* first ping that is already `done`/`failed` is a new stream and is charged.
|
|
251
|
-
*/
|
|
252
|
-
declare class LiveApi {
|
|
253
|
-
private readonly http;
|
|
254
|
-
constructor(http: HttpClient);
|
|
255
|
-
/**
|
|
256
|
-
* Send one stream ping — start, update, or end, chosen by `live_status.state`
|
|
257
|
-
* and whether the correlation already exists.
|
|
258
|
-
*/
|
|
259
|
-
push(inviteCode: string, ping: LiveStatusPing): Promise<LiveStatusResult>;
|
|
260
|
-
/**
|
|
261
|
-
* Read back a stream this credential started, so a restarted producer can
|
|
262
|
-
* reconcile instead of opening a duplicate.
|
|
263
|
-
*
|
|
264
|
-
* Resolves null for a 404 ONLY — no stream with that correlation id in the
|
|
265
|
-
* last 24 hours. Every other failure throws: in particular a 403
|
|
266
|
-
* `room_not_granted` ({@link RoomScopedErrorCode}), raised when the room is
|
|
267
|
-
* outside the grant the human gave this agent, propagates rather than being
|
|
268
|
-
* reported as "no stream".
|
|
269
|
-
*/
|
|
270
|
-
get(inviteCode: string, correlationId: string): Promise<LiveStatusSnapshot | null>;
|
|
271
|
-
}
|
|
272
|
-
/**
|
|
273
|
-
* Private files that a Ping or Question can carry.
|
|
274
|
-
*
|
|
275
|
-
* Upload first, then pass the returned ids to `broadcast()` / `questions.ask()`
|
|
276
|
-
* as `attachment_ids`. Bytes never travel over MCP or a JSON ping body. An
|
|
277
|
-
* upload that is never attached expires on its own after 24 hours.
|
|
278
|
-
* Each file must be 1 byte–5 MiB with an md/pdf/html/txt/jpg/jpeg/png/zip filename;
|
|
279
|
-
* a Ping or Question accepts at most four ids.
|
|
280
|
-
*
|
|
281
|
-
* Uploading requires the bound account to hold Pro (the API answers 402
|
|
282
|
-
* `pro_required` otherwise). Reading and deleting are not gated.
|
|
283
|
-
*/
|
|
284
|
-
declare class AttachmentsApi {
|
|
285
|
-
private readonly http;
|
|
286
|
-
constructor(http: HttpClient);
|
|
287
|
-
/** Upload one file and get back the id a send can claim. */
|
|
288
|
-
upload(input: UploadAttachmentInput): Promise<Attachment>;
|
|
289
|
-
/**
|
|
290
|
-
* Raw bytes for an attachment this credential is allowed to see. Returns the
|
|
291
|
-
* undecoded Response so a caller can stream it, or read text/arrayBuffer.
|
|
292
|
-
*/
|
|
293
|
-
content(attachmentId: string, signal?: AbortSignal): Promise<Response>;
|
|
294
|
-
/**
|
|
295
|
-
* The listing of a `.zip`'s contents, recorded when it was uploaded.
|
|
296
|
-
*
|
|
297
|
-
* Resolves null for a non-archive, and for an archive whose central
|
|
298
|
-
* directory did not parse. Nothing decompresses the file to produce this, so
|
|
299
|
-
* the declared sizes are what the archive claims, not verified output.
|
|
300
|
-
*/
|
|
301
|
-
manifest(attachmentId: string, signal?: AbortSignal): Promise<ZipManifest | null>;
|
|
302
|
-
/** Discard an upload that has not been attached to a ping yet. */
|
|
303
|
-
delete(attachmentId: string): Promise<void>;
|
|
304
|
-
}
|
|
305
|
-
/** Public, unauthenticated agent directory. */
|
|
306
|
-
declare class DirectoryApi {
|
|
307
|
-
private readonly http;
|
|
308
|
-
constructor(http: HttpClient);
|
|
309
|
-
list(input?: DirectoryListInput): Promise<Paginated<DirectoryEntry>>;
|
|
310
|
-
get(handle: string): Promise<DirectoryProfile>;
|
|
311
|
-
}
|
|
2
|
+
import type { PingInput, PingResult, PingRoomOptions, RedeemCodeResult } from './types.js';
|
|
3
|
+
import { AuthApi } from './namespaces/auth.js';
|
|
4
|
+
import { RoomsApi } from './namespaces/rooms.js';
|
|
5
|
+
import { ActionsApi } from './namespaces/actions.js';
|
|
6
|
+
import { WebhooksApi } from './namespaces/webhooks.js';
|
|
7
|
+
import { NotificationsApi } from './namespaces/notifications.js';
|
|
8
|
+
import { AttachmentsApi } from './namespaces/attachments.js';
|
|
9
|
+
import { ApprovalsApi } from './namespaces/approvals.js';
|
|
10
|
+
import { QuestionsApi } from './namespaces/questions.js';
|
|
11
|
+
import { HandoffsApi } from './namespaces/handoffs.js';
|
|
12
|
+
import { InboxApi } from './namespaces/inbox.js';
|
|
13
|
+
import { ProfileApi } from './namespaces/profile.js';
|
|
14
|
+
import { LiveApi } from './namespaces/live.js';
|
|
15
|
+
import { DirectoryApi } from './namespaces/directory.js';
|
|
16
|
+
/** Node's util.inspect hook, named through the global registry so no import is needed. */
|
|
17
|
+
declare const INSPECT: unique symbol;
|
|
312
18
|
export declare class PingRoom {
|
|
313
19
|
readonly auth: AuthApi;
|
|
314
20
|
readonly rooms: RoomsApi;
|
|
@@ -316,7 +22,6 @@ export declare class PingRoom {
|
|
|
316
22
|
readonly actions: ActionsApi;
|
|
317
23
|
readonly notifications: NotificationsApi;
|
|
318
24
|
readonly attachments: AttachmentsApi;
|
|
319
|
-
readonly agents: AgentsApi;
|
|
320
25
|
readonly approvals: ApprovalsApi;
|
|
321
26
|
readonly questions: QuestionsApi;
|
|
322
27
|
readonly handoffs: HandoffsApi;
|
|
@@ -332,8 +37,18 @@ export declare class PingRoom {
|
|
|
332
37
|
getToken(): string | null;
|
|
333
38
|
/** Redeem a gift or promotional code for this agent's authorizing human. */
|
|
334
39
|
redeemCode(code: string): Promise<RedeemCodeResult>;
|
|
335
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* Broadcast a ping to every member of a room you own. Pass `idempotencyKey`
|
|
42
|
+
* and reuse it when retrying after a timeout or network error, so a send
|
|
43
|
+
* the server already committed is replayed rather than delivered twice.
|
|
44
|
+
*/
|
|
336
45
|
broadcast(inviteCode: string, ping: PingInput): Promise<PingResult>;
|
|
46
|
+
/** What a logger or JSON.stringify() sees: the API origin, never the credential. */
|
|
47
|
+
toJSON(): {
|
|
48
|
+
baseUrl: string;
|
|
49
|
+
token: '[redacted]' | null;
|
|
50
|
+
};
|
|
51
|
+
[INSPECT](): string;
|
|
337
52
|
}
|
|
338
53
|
export {};
|
|
339
54
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE3F,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGzD,0FAA0F;AAC1F,QAAA,MAAM,OAAO,EAAE,OAAO,MAAiD,CAAC;AASxE,qBAAa,QAAQ;IACnB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,gBAAgB,CAAC;IACzC,QAAQ,CAAC,WAAW,EAAE,cAAc,CAAC;IACrC,QAAQ,CAAC,SAAS,EAAE,YAAY,CAAC;IACjC,QAAQ,CAAC,SAAS,EAAE,YAAY,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,YAAY,CAAC;IACjC,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC;IAExB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAa;gBAEtB,OAAO,GAAE,eAAoB;IA2BzC,gFAAgF;IAChF,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAIpC,QAAQ,IAAI,MAAM,GAAG,IAAI;IAIzB,4EAA4E;IAC5E,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAMnD;;;;OAIG;IACH,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC;IASnE,oFAAoF;IACpF,MAAM,IAAI;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAA;KAAE;IAIzD,CAAC,OAAO,CAAC,IAAI,MAAM;CAIpB"}
|