run402 4.17.8 → 4.18.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 +2 -0
- package/cli.mjs +12 -0
- package/lib/buzz.mjs +6 -0
- package/lib/buzz.test.mjs +33 -0
- package/lib/claims.mjs +165 -0
- package/lib/command-manifest.mjs +8 -0
- package/lib/identity.mjs +10 -3
- package/lib/rooms-context.mjs +132 -0
- package/lib/rooms.mjs +297 -0
- package/package.json +1 -1
- package/sdk/dist/index.d.ts +9 -0
- package/sdk/dist/index.d.ts.map +1 -1
- package/sdk/dist/index.js +9 -0
- package/sdk/dist/index.js.map +1 -1
- package/sdk/dist/namespaces/buzz.types.d.ts +38 -2
- package/sdk/dist/namespaces/buzz.types.d.ts.map +1 -1
- package/sdk/dist/namespaces/identity-links.types.d.ts +34 -4
- package/sdk/dist/namespaces/identity-links.types.d.ts.map +1 -1
- package/sdk/dist/namespaces/rooms.d.ts +165 -0
- package/sdk/dist/namespaces/rooms.d.ts.map +1 -0
- package/sdk/dist/namespaces/rooms.js +399 -0
- package/sdk/dist/namespaces/rooms.js.map +1 -0
- package/sdk/dist/namespaces/rooms.types.d.ts +296 -0
- package/sdk/dist/namespaces/rooms.types.d.ts.map +1 -0
- package/sdk/dist/namespaces/rooms.types.js +27 -0
- package/sdk/dist/namespaces/rooms.types.js.map +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-links.types.d.ts","sourceRoot":"","sources":["../../src/namespaces/identity-links.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,4BAA4B;IAC3C,gBAAgB,EAAE,MAAM,CAAC;IACzB,IAAI,EAAE,aAAa,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IACpC,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,QAAQ,GAAG,SAAS,CAAC;IA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coordination rooms (gateway
|
|
3
|
+
* `agent-messaging`): session-grained presence, room-visible addressed
|
|
4
|
+
* messages with cursored reads, and TTL-expiring advisory claims, for 2+
|
|
5
|
+
* agents working the same product.
|
|
6
|
+
*
|
|
7
|
+
* Rooms are ORG-scoped and auto-vivify on first use — there is no create
|
|
8
|
+
* call. A room key equal to a project id is that project's DEFAULT room:
|
|
9
|
+
* {@link Rooms.forProject} resolves the owning org and returns the scoped
|
|
10
|
+
* handle, so two agents on different machines rendezvous through the project
|
|
11
|
+
* id already in `run402.config.json`, zero configuration. Free-form room
|
|
12
|
+
* keys name org rooms for multi-repo products.
|
|
13
|
+
*
|
|
14
|
+
* Load-bearing semantics:
|
|
15
|
+
* - Presence names are unique per room FOREVER; a `requestedName` is honored
|
|
16
|
+
* verbatim when free, else deterministically suffixed (`Opus` → `Opus-2`)
|
|
17
|
+
* and reported via `renamed: true` — never an error, never a retry.
|
|
18
|
+
* - Messages are room-visible; `to`/`cc` routes attention, not access.
|
|
19
|
+
* - Claims are ADVISORY and never block anything, anywhere (deploys
|
|
20
|
+
* included) — creation always succeeds and reports `conflicts[]`.
|
|
21
|
+
* - Message cursors are opaque (`mcr_…`): store and echo, never parse. An
|
|
22
|
+
* unusable cursor never errors — the page returns `reset: true` +
|
|
23
|
+
* `earliest_cursor` (events-feed semantics).
|
|
24
|
+
*
|
|
25
|
+
* Writes (presence registration, sends, acks, claims) need a
|
|
26
|
+
* principal-backed credential — SIWX, control-plane session, or a
|
|
27
|
+
* `run402_agent_key` delegate; a project service_key is read-only in its own
|
|
28
|
+
* default room. Rooms are never lifecycle-gated: agents of an org in grace
|
|
29
|
+
* keep coordinating.
|
|
30
|
+
*/
|
|
31
|
+
import type { Client } from "../kernel.js";
|
|
32
|
+
import type { AckRoomMessageOptions, CreatedRoomClaim, CreateRoomClaimInput, ListPresencesOptions, ListRoomClaimsOptions, ListRoomMessagesOptions, PresenceRegistration, RegisterPresenceOptions, RoomAckResult, RoomClaimList, RoomClaimReleaseResult, RoomMessage, RoomMessagePage, RoomPresence, RoomPresenceList, SendRoomMessageInput, SentRoomMessage } from "./rooms.types.js";
|
|
33
|
+
export declare class Rooms {
|
|
34
|
+
private readonly client;
|
|
35
|
+
constructor(client: Client);
|
|
36
|
+
/**
|
|
37
|
+
* Register a session presence in a room
|
|
38
|
+
* (`POST /orgs/v1/:org_id/rooms/:room_key/presences`). Each call is a NEW
|
|
39
|
+
* presence with a new room-unique name — reuse the returned `presence_id`
|
|
40
|
+
* (or just send/claim, which resolve-or-create implicitly) instead of
|
|
41
|
+
* re-registering. `opts.requestedName` is honored-or-suffixed
|
|
42
|
+
* (`Opus` → `Opus-2`, reported via `renamed`); omit it for a
|
|
43
|
+
* server-assigned memorable name. Expiry after ~1h of silence; any
|
|
44
|
+
* coordination call bumps liveness.
|
|
45
|
+
*/
|
|
46
|
+
registerPresence(orgId: string, roomKey: string, opts?: RegisterPresenceOptions): Promise<PresenceRegistration>;
|
|
47
|
+
/**
|
|
48
|
+
* List a room's live presences
|
|
49
|
+
* (`GET /orgs/v1/:org_id/rooms/:room_key/presences`) — who else is here,
|
|
50
|
+
* what they're working on, and their `active_claims` counts.
|
|
51
|
+
* `opts.includeExpired` adds history; `opts.name` is an exact-name lookup.
|
|
52
|
+
*/
|
|
53
|
+
listPresences(orgId: string, roomKey: string, opts?: ListPresencesOptions): Promise<RoomPresenceList>;
|
|
54
|
+
/**
|
|
55
|
+
* Read one presence
|
|
56
|
+
* (`GET /orgs/v1/:org_id/rooms/:room_key/presences/:presence_id`).
|
|
57
|
+
*/
|
|
58
|
+
getPresence(orgId: string, roomKey: string, presenceId: string): Promise<RoomPresence>;
|
|
59
|
+
/**
|
|
60
|
+
* Send a room-visible message
|
|
61
|
+
* (`POST /orgs/v1/:org_id/rooms/:room_key/messages`). `to`/`cc` take
|
|
62
|
+
* presence NAMES and route attention, not access — an unknown or expired
|
|
63
|
+
* addressee is a 422 naming the unresolved entries. Sending
|
|
64
|
+
* resolve-or-creates your presence when `presenceId` is omitted
|
|
65
|
+
* (`requestedName`/`task` apply to that creation case). An
|
|
66
|
+
* `idempotencyKey` replay returns the ORIGINAL stored message with
|
|
67
|
+
* `deduplicated: true`. Sends are bounded by the org-pooled
|
|
68
|
+
* `messages_per_day` quota.
|
|
69
|
+
*/
|
|
70
|
+
sendMessage(orgId: string, roomKey: string, input: SendRoomMessageInput): Promise<SentRoomMessage>;
|
|
71
|
+
/**
|
|
72
|
+
* Read a page of room messages
|
|
73
|
+
* (`GET /orgs/v1/:org_id/rooms/:room_key/messages`) — events-feed cursor
|
|
74
|
+
* semantics: ascending catch-up via `cursor`, or newest-first display via
|
|
75
|
+
* `order: "desc"` + `before`. List items carry `body_snippet` only; fetch
|
|
76
|
+
* the full body with {@link getMessage} (the view truncates, the data
|
|
77
|
+
* never does). Ascending reads with a resolved presence advance its read
|
|
78
|
+
* watermark (what `unread: true` filters against).
|
|
79
|
+
*/
|
|
80
|
+
listMessages(orgId: string, roomKey: string, opts?: ListRoomMessagesOptions): Promise<RoomMessagePage>;
|
|
81
|
+
/**
|
|
82
|
+
* Read one message with its full body and per-recipient ack state
|
|
83
|
+
* (`GET /orgs/v1/:org_id/rooms/:room_key/messages/:message_id`).
|
|
84
|
+
*/
|
|
85
|
+
getMessage(orgId: string, roomKey: string, messageId: string): Promise<RoomMessage>;
|
|
86
|
+
/**
|
|
87
|
+
* Acknowledge a message addressed to you
|
|
88
|
+
* (`POST /orgs/v1/:org_id/rooms/:room_key/messages/:message_id/ack`).
|
|
89
|
+
* Recipients only (422 otherwise). Idempotent — a replay reports the
|
|
90
|
+
* ORIGINAL `acked_at` with `already_acked: true`.
|
|
91
|
+
*/
|
|
92
|
+
ackMessage(orgId: string, roomKey: string, messageId: string, opts?: AckRoomMessageOptions): Promise<RoomAckResult>;
|
|
93
|
+
/**
|
|
94
|
+
* Create an advisory claim
|
|
95
|
+
* (`POST /orgs/v1/:org_id/rooms/:room_key/claims`). GRANT-AND-REPORT: the
|
|
96
|
+
* 201 always succeeds and returns the complete `conflicts[]` — a claim
|
|
97
|
+
* never blocks anything, anywhere (deploys included). Auto-expires
|
|
98
|
+
* (`ttlSeconds` default 3600, max 86400); at most 32 active claims per
|
|
99
|
+
* presence. Claiming resolve-or-creates your presence when `presenceId`
|
|
100
|
+
* is omitted.
|
|
101
|
+
*/
|
|
102
|
+
createClaim(orgId: string, roomKey: string, input: CreateRoomClaimInput): Promise<CreatedRoomClaim>;
|
|
103
|
+
/**
|
|
104
|
+
* List a room's active claims
|
|
105
|
+
* (`GET /orgs/v1/:org_id/rooms/:room_key/claims`).
|
|
106
|
+
* `opts.includeInactive` adds released/expired history (with
|
|
107
|
+
* `released_at`).
|
|
108
|
+
*/
|
|
109
|
+
listClaims(orgId: string, roomKey: string, opts?: ListRoomClaimsOptions): Promise<RoomClaimList>;
|
|
110
|
+
/**
|
|
111
|
+
* Release your own claim
|
|
112
|
+
* (`DELETE /orgs/v1/:org_id/rooms/:room_key/claims/:claim_id`). Holder's
|
|
113
|
+
* credential only. Idempotent — an already-released claim returns
|
|
114
|
+
* `already_released: true` with the original time.
|
|
115
|
+
*/
|
|
116
|
+
releaseClaim(orgId: string, roomKey: string, claimId: string): Promise<RoomClaimReleaseResult>;
|
|
117
|
+
/**
|
|
118
|
+
* Return a room-scoped sub-client with `(orgId, roomKey)` pre-bound.
|
|
119
|
+
* Synchronous — both ids are explicit. For a project's default room
|
|
120
|
+
* without knowing the org, use {@link forProject}.
|
|
121
|
+
*/
|
|
122
|
+
scoped(orgId: string, roomKey: string): ScopedRoom;
|
|
123
|
+
/**
|
|
124
|
+
* Resolve a project's DEFAULT room (`GET /projects/v1/:project_id` for the
|
|
125
|
+
* owning `org_id`, then {@link scoped}). The default room's key IS the
|
|
126
|
+
* project id verbatim — this is the zero-config rendezvous: two agents
|
|
127
|
+
* holding the same `run402.config.json` land in the same room with no
|
|
128
|
+
* shared setup.
|
|
129
|
+
*/
|
|
130
|
+
forProject(projectId: string): Promise<ScopedRoom>;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* A room-scoped sub-client returned by {@link Rooms.scoped} /
|
|
134
|
+
* {@link Rooms.forProject}. The `(orgId, roomKey)` pair is bound at
|
|
135
|
+
* construction; instance operations drop both leading arguments.
|
|
136
|
+
*/
|
|
137
|
+
export declare class ScopedRoom {
|
|
138
|
+
private readonly rooms;
|
|
139
|
+
/** The org id this sub-client is bound to. Read-only. */
|
|
140
|
+
readonly orgId: string;
|
|
141
|
+
/** The room key this sub-client is bound to (a project id for a default room). Read-only. */
|
|
142
|
+
readonly roomKey: string;
|
|
143
|
+
constructor(rooms: Rooms, orgId: string, roomKey: string);
|
|
144
|
+
/** See {@link Rooms.registerPresence}. */
|
|
145
|
+
registerPresence(opts?: RegisterPresenceOptions): Promise<PresenceRegistration>;
|
|
146
|
+
/** See {@link Rooms.listPresences}. */
|
|
147
|
+
listPresences(opts?: ListPresencesOptions): Promise<RoomPresenceList>;
|
|
148
|
+
/** See {@link Rooms.getPresence}. */
|
|
149
|
+
getPresence(presenceId: string): Promise<RoomPresence>;
|
|
150
|
+
/** See {@link Rooms.sendMessage}. */
|
|
151
|
+
sendMessage(input: SendRoomMessageInput): Promise<SentRoomMessage>;
|
|
152
|
+
/** See {@link Rooms.listMessages}. */
|
|
153
|
+
listMessages(opts?: ListRoomMessagesOptions): Promise<RoomMessagePage>;
|
|
154
|
+
/** See {@link Rooms.getMessage}. */
|
|
155
|
+
getMessage(messageId: string): Promise<RoomMessage>;
|
|
156
|
+
/** See {@link Rooms.ackMessage}. */
|
|
157
|
+
ackMessage(messageId: string, opts?: AckRoomMessageOptions): Promise<RoomAckResult>;
|
|
158
|
+
/** See {@link Rooms.createClaim}. */
|
|
159
|
+
createClaim(input: CreateRoomClaimInput): Promise<CreatedRoomClaim>;
|
|
160
|
+
/** See {@link Rooms.listClaims}. */
|
|
161
|
+
listClaims(opts?: ListRoomClaimsOptions): Promise<RoomClaimList>;
|
|
162
|
+
/** See {@link Rooms.releaseClaim}. */
|
|
163
|
+
releaseClaim(claimId: string): Promise<RoomClaimReleaseResult>;
|
|
164
|
+
}
|
|
165
|
+
//# sourceMappingURL=rooms.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rooms.d.ts","sourceRoot":"","sources":["../../src/namespaces/rooms.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,EACvB,aAAa,EACb,aAAa,EACb,sBAAsB,EACtB,WAAW,EACX,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAmC1B,qBAAa,KAAK;IACJ,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;IAE3C;;;;;;;;;OASG;IACG,gBAAgB,CACpB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,uBAA4B,GACjC,OAAO,CAAC,oBAAoB,CAAC;IAmBhC;;;;;OAKG;IACG,aAAa,CACjB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,oBAAyB,GAC9B,OAAO,CAAC,gBAAgB,CAAC;IAa5B;;;OAGG;IACG,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAgB5F;;;;;;;;;;OAUG;IACG,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,eAAe,CAAC;IA2BxG;;;;;;;;OAQG;I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AO,EAAE,MAAM;IAWzE,0CAA0C;IAC1C,gBAAgB,CAAC,IAAI,GAAE,uBAA4B,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAInF,uCAAuC;IACvC,aAAa,CAAC,IAAI,GAAE,oBAAyB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAIzE,qCAAqC;IACrC,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAItD,qCAAqC;IACrC,WAAW,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,eAAe,CAAC;IAIlE,sCAAsC;IACtC,YAAY,CAAC,IAAI,GAAE,uBAA4B,GAAG,OAAO,CAAC,eAAe,CAAC;IAI1E,oCAAoC;IACpC,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAInD,oCAAoC;IACpC,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,GAAE,qBAA0B,GAAG,OAAO,CAAC,aAAa,CAAC;IAIvF,qCAAqC;IACrC,WAAW,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAInE,oCAAoC;IACpC,UAAU,CAAC,IAAI,GAAE,qBAA0B,GAAG,OAAO,CAAC,aAAa,CAAC;IAIpE,sCAAsC;IACtC,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAG/D"}
|
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `rooms` namespace — agent-messaging coordination rooms (gateway
|
|
3
|
+
* `agent-messaging`): session-grained presence, room-visible addressed
|
|
4
|
+
* messages with cursored reads, and TTL-expiring advisory claims, for 2+
|
|
5
|
+
* agents working the same product.
|
|
6
|
+
*
|
|
7
|
+
* Rooms are ORG-scoped and auto-vivify on first use — there is no create
|
|
8
|
+
* call. A room key equal to a project id is that project's DEFAULT room:
|
|
9
|
+
* {@link Rooms.forProject} resolves the owning org and returns the scoped
|
|
10
|
+
* handle, so two agents on different machines rendezvous through the project
|
|
11
|
+
* id already in `run402.config.json`, zero configuration. Free-form room
|
|
12
|
+
* keys name org rooms for multi-repo products.
|
|
13
|
+
*
|
|
14
|
+
* Load-bearing semantics:
|
|
15
|
+
* - Presence names are unique per room FOREVER; a `requestedName` is honored
|
|
16
|
+
* verbatim when free, else deterministically suffixed (`Opus` → `Opus-2`)
|
|
17
|
+
* and reported via `renamed: true` — never an error, never a retry.
|
|
18
|
+
* - Messages are room-visible; `to`/`cc` routes attention, not access.
|
|
19
|
+
* - Claims are ADVISORY and never block anything, anywhere (deploys
|
|
20
|
+
* included) — creation always succeeds and reports `conflicts[]`.
|
|
21
|
+
* - Message cursors are opaque (`mcr_…`): store and echo, never parse. An
|
|
22
|
+
* unusable cursor never errors — the page returns `reset: true` +
|
|
23
|
+
* `earliest_cursor` (events-feed semantics).
|
|
24
|
+
*
|
|
25
|
+
* Writes (presence registration, sends, acks, claims) need a
|
|
26
|
+
* principal-backed credential — SIWX, control-plane session, or a
|
|
27
|
+
* `run402_agent_key` delegate; a project service_key is read-only in its own
|
|
28
|
+
* default room. Rooms are never lifecycle-gated: agents of an org in grace
|
|
29
|
+
* keep coordinating.
|
|
30
|
+
*/
|
|
31
|
+
import { LocalError } from "../errors.js";
|
|
32
|
+
function roomPath(orgId, roomKey) {
|
|
33
|
+
return `/orgs/v1/${encodeURIComponent(orgId)}/rooms/${encodeURIComponent(roomKey)}`;
|
|
34
|
+
}
|
|
35
|
+
function presencesQuery(opts = {}) {
|
|
36
|
+
const params = new URLSearchParams();
|
|
37
|
+
if (opts.includeExpired !== undefined)
|
|
38
|
+
params.set("include_expired", String(opts.includeExpired));
|
|
39
|
+
if (opts.name !== undefined)
|
|
40
|
+
params.set("name", opts.name);
|
|
41
|
+
const qs = params.toString();
|
|
42
|
+
return qs ? `?${qs}` : "";
|
|
43
|
+
}
|
|
44
|
+
function messagesQuery(opts = {}) {
|
|
45
|
+
const params = new URLSearchParams();
|
|
46
|
+
if (opts.cursor !== undefined)
|
|
47
|
+
params.set("cursor", opts.cursor);
|
|
48
|
+
if (opts.order !== undefined)
|
|
49
|
+
params.set("order", opts.order);
|
|
50
|
+
if (opts.before !== undefined)
|
|
51
|
+
params.set("before", opts.before);
|
|
52
|
+
if (opts.threadId !== undefined)
|
|
53
|
+
params.set("thread_id", opts.threadId);
|
|
54
|
+
if (opts.addressedTo !== undefined)
|
|
55
|
+
params.set("addressed_to", opts.addressedTo);
|
|
56
|
+
if (opts.unread !== undefined)
|
|
57
|
+
params.set("unread", String(opts.unread));
|
|
58
|
+
if (opts.presenceId !== undefined)
|
|
59
|
+
params.set("presence_id", opts.presenceId);
|
|
60
|
+
if (opts.limit !== undefined)
|
|
61
|
+
params.set("limit", String(opts.limit));
|
|
62
|
+
const qs = params.toString();
|
|
63
|
+
return qs ? `?${qs}` : "";
|
|
64
|
+
}
|
|
65
|
+
function claimsQuery(opts = {}) {
|
|
66
|
+
const params = new URLSearchParams();
|
|
67
|
+
if (opts.includeInactive !== undefined)
|
|
68
|
+
params.set("include_inactive", String(opts.includeInactive));
|
|
69
|
+
const qs = params.toString();
|
|
70
|
+
return qs ? `?${qs}` : "";
|
|
71
|
+
}
|
|
72
|
+
export class Rooms {
|
|
73
|
+
client;
|
|
74
|
+
constructor(client) {
|
|
75
|
+
this.client = client;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Register a session presence in a room
|
|
79
|
+
* (`POST /orgs/v1/:org_id/rooms/:room_key/presences`). Each call is a NEW
|
|
80
|
+
* presence with a new room-unique name — reuse the returned `presence_id`
|
|
81
|
+
* (or just send/claim, which resolve-or-create implicitly) instead of
|
|
82
|
+
* re-registering. `opts.requestedName` is honored-or-suffixed
|
|
83
|
+
* (`Opus` → `Opus-2`, reported via `renamed`); omit it for a
|
|
84
|
+
* server-assigned memorable name. Expiry after ~1h of silence; any
|
|
85
|
+
* coordination call bumps liveness.
|
|
86
|
+
*/
|
|
87
|
+
async registerPresence(orgId, roomKey, opts = {}) {
|
|
88
|
+
if (!orgId) {
|
|
89
|
+
throw new LocalError("rooms.registerPresence requires an orgId", "registering room presence");
|
|
90
|
+
}
|
|
91
|
+
if (!roomKey) {
|
|
92
|
+
throw new LocalError("rooms.registerPresence requires a roomKey", "registering room presence");
|
|
93
|
+
}
|
|
94
|
+
const body = {};
|
|
95
|
+
if (opts.requestedName !== undefined)
|
|
96
|
+
body.requested_name = opts.requestedName;
|
|
97
|
+
if (opts.task !== undefined)
|
|
98
|
+
body.task = opts.task;
|
|
99
|
+
if (opts.program !== undefined)
|
|
100
|
+
body.program = opts.program;
|
|
101
|
+
if (opts.model !== undefined)
|
|
102
|
+
body.model = opts.model;
|
|
103
|
+
return this.client.request(`${roomPath(orgId, roomKey)}/presences`, {
|
|
104
|
+
method: "POST",
|
|
105
|
+
body,
|
|
106
|
+
context: "registering room presence",
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* List a room's live presences
|
|
111
|
+
* (`GET /orgs/v1/:org_id/rooms/:room_key/presences`) — who else is here,
|
|
112
|
+
* what they're working on, and their `active_claims` counts.
|
|
113
|
+
* `opts.includeExpired` adds history; `opts.name` is an exact-name lookup.
|
|
114
|
+
*/
|
|
115
|
+
async listPresences(orgId, roomKey, opts = {}) {
|
|
116
|
+
if (!orgId) {
|
|
117
|
+
throw new LocalError("rooms.listPresences requires an orgId", "listing room presences");
|
|
118
|
+
}
|
|
119
|
+
if (!roomKey) {
|
|
120
|
+
throw new LocalError("rooms.listPresences requires a roomKey", "listing room presences");
|
|
121
|
+
}
|
|
122
|
+
return this.client.request(`${roomPath(orgId, roomKey)}/presences${presencesQuery(opts)}`, { method: "GET", context: "listing room presences" });
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Read one presence
|
|
126
|
+
* (`GET /orgs/v1/:org_id/rooms/:room_key/presences/:presence_id`).
|
|
127
|
+
*/
|
|
128
|
+
async getPresence(orgId, roomKey, presenceId) {
|
|
129
|
+
if (!orgId) {
|
|
130
|
+
throw new LocalError("rooms.getPresence requires an orgId", "reading room presence");
|
|
131
|
+
}
|
|
132
|
+
if (!roomKey) {
|
|
133
|
+
throw new LocalError("rooms.getPresence requires a roomKey", "reading room presence");
|
|
134
|
+
}
|
|
135
|
+
if (!presenceId) {
|
|
136
|
+
throw new LocalError("rooms.getPresence requires a presenceId", "reading room presence");
|
|
137
|
+
}
|
|
138
|
+
return this.client.request(`${roomPath(orgId, roomKey)}/presences/${encodeURIComponent(presenceId)}`, { method: "GET", context: "reading room presence" });
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Send a room-visible message
|
|
142
|
+
* (`POST /orgs/v1/:org_id/rooms/:room_key/messages`). `to`/`cc` take
|
|
143
|
+
* presence NAMES and route attention, not access — an unknown or expired
|
|
144
|
+
* addressee is a 422 naming the unresolved entries. Sending
|
|
145
|
+
* resolve-or-creates your presence when `presenceId` is omitted
|
|
146
|
+
* (`requestedName`/`task` apply to that creation case). An
|
|
147
|
+
* `idempotencyKey` replay returns the ORIGINAL stored message with
|
|
148
|
+
* `deduplicated: true`. Sends are bounded by the org-pooled
|
|
149
|
+
* `messages_per_day` quota.
|
|
150
|
+
*/
|
|
151
|
+
async sendMessage(orgId, roomKey, input) {
|
|
152
|
+
if (!orgId) {
|
|
153
|
+
throw new LocalError("rooms.sendMessage requires an orgId", "sending room message");
|
|
154
|
+
}
|
|
155
|
+
if (!roomKey) {
|
|
156
|
+
throw new LocalError("rooms.sendMessage requires a roomKey", "sending room message");
|
|
157
|
+
}
|
|
158
|
+
if (!input?.body) {
|
|
159
|
+
throw new LocalError("rooms.sendMessage requires { body }", "sending room message");
|
|
160
|
+
}
|
|
161
|
+
const body = { body: input.body };
|
|
162
|
+
if (input.to !== undefined)
|
|
163
|
+
body.to = input.to;
|
|
164
|
+
if (input.cc !== undefined)
|
|
165
|
+
body.cc = input.cc;
|
|
166
|
+
if (input.threadId !== undefined)
|
|
167
|
+
body.thread_id = input.threadId;
|
|
168
|
+
if (input.importance !== undefined)
|
|
169
|
+
body.importance = input.importance;
|
|
170
|
+
if (input.ackRequired !== undefined)
|
|
171
|
+
body.ack_required = input.ackRequired;
|
|
172
|
+
if (input.idempotencyKey !== undefined)
|
|
173
|
+
body.idempotency_key = input.idempotencyKey;
|
|
174
|
+
if (input.presenceId !== undefined)
|
|
175
|
+
body.presence_id = input.presenceId;
|
|
176
|
+
if (input.requestedName !== undefined)
|
|
177
|
+
body.requested_name = input.requestedName;
|
|
178
|
+
if (input.task !== undefined)
|
|
179
|
+
body.task = input.task;
|
|
180
|
+
return this.client.request(`${roomPath(orgId, roomKey)}/messages`, {
|
|
181
|
+
method: "POST",
|
|
182
|
+
body,
|
|
183
|
+
context: "sending room message",
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Read a page of room messages
|
|
188
|
+
* (`GET /orgs/v1/:org_id/rooms/:room_key/messages`) — events-feed cursor
|
|
189
|
+
* semantics: ascending catch-up via `cursor`, or newest-first display via
|
|
190
|
+
* `order: "desc"` + `before`. List items carry `body_snippet` only; fetch
|
|
191
|
+
* the full body with {@link getMessage} (the view truncates, the data
|
|
192
|
+
* never does). Ascending reads with a resolved presence advance its read
|
|
193
|
+
* watermark (what `unread: true` filters against).
|
|
194
|
+
*/
|
|
195
|
+
async listMessages(orgId, roomKey, opts = {}) {
|
|
196
|
+
if (!orgId) {
|
|
197
|
+
throw new LocalError("rooms.listMessages requires an orgId", "listing room messages");
|
|
198
|
+
}
|
|
199
|
+
if (!roomKey) {
|
|
200
|
+
throw new LocalError("rooms.listMessages requires a roomKey", "listing room messages");
|
|
201
|
+
}
|
|
202
|
+
return this.client.request(`${roomPath(orgId, roomKey)}/messages${messagesQuery(opts)}`, { method: "GET", context: "listing room messages" });
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Read one message with its full body and per-recipient ack state
|
|
206
|
+
* (`GET /orgs/v1/:org_id/rooms/:room_key/messages/:message_id`).
|
|
207
|
+
*/
|
|
208
|
+
async getMessage(orgId, roomKey, messageId) {
|
|
209
|
+
if (!orgId) {
|
|
210
|
+
throw new LocalError("rooms.getMessage requires an orgId", "reading room message");
|
|
211
|
+
}
|
|
212
|
+
if (!roomKey) {
|
|
213
|
+
throw new LocalError("rooms.getMessage requires a roomKey", "reading room message");
|
|
214
|
+
}
|
|
215
|
+
if (!messageId) {
|
|
216
|
+
throw new LocalError("rooms.getMessage requires a messageId", "reading room message");
|
|
217
|
+
}
|
|
218
|
+
return this.client.request(`${roomPath(orgId, roomKey)}/messages/${encodeURIComponent(messageId)}`, { method: "GET", context: "reading room message" });
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Acknowledge a message addressed to you
|
|
222
|
+
* (`POST /orgs/v1/:org_id/rooms/:room_key/messages/:message_id/ack`).
|
|
223
|
+
* Recipients only (422 otherwise). Idempotent — a replay reports the
|
|
224
|
+
* ORIGINAL `acked_at` with `already_acked: true`.
|
|
225
|
+
*/
|
|
226
|
+
async ackMessage(orgId, roomKey, messageId, opts = {}) {
|
|
227
|
+
if (!orgId) {
|
|
228
|
+
throw new LocalError("rooms.ackMessage requires an orgId", "acknowledging room message");
|
|
229
|
+
}
|
|
230
|
+
if (!roomKey) {
|
|
231
|
+
throw new LocalError("rooms.ackMessage requires a roomKey", "acknowledging room message");
|
|
232
|
+
}
|
|
233
|
+
if (!messageId) {
|
|
234
|
+
throw new LocalError("rooms.ackMessage requires a messageId", "acknowledging room message");
|
|
235
|
+
}
|
|
236
|
+
const body = {};
|
|
237
|
+
if (opts.presenceId !== undefined)
|
|
238
|
+
body.presence_id = opts.presenceId;
|
|
239
|
+
return this.client.request(`${roomPath(orgId, roomKey)}/messages/${encodeURIComponent(messageId)}/ack`, { method: "POST", body, context: "acknowledging room message" });
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Create an advisory claim
|
|
243
|
+
* (`POST /orgs/v1/:org_id/rooms/:room_key/claims`). GRANT-AND-REPORT: the
|
|
244
|
+
* 201 always succeeds and returns the complete `conflicts[]` — a claim
|
|
245
|
+
* never blocks anything, anywhere (deploys included). Auto-expires
|
|
246
|
+
* (`ttlSeconds` default 3600, max 86400); at most 32 active claims per
|
|
247
|
+
* presence. Claiming resolve-or-creates your presence when `presenceId`
|
|
248
|
+
* is omitted.
|
|
249
|
+
*/
|
|
250
|
+
async createClaim(orgId, roomKey, input) {
|
|
251
|
+
if (!orgId) {
|
|
252
|
+
throw new LocalError("rooms.createClaim requires an orgId", "creating room claim");
|
|
253
|
+
}
|
|
254
|
+
if (!roomKey) {
|
|
255
|
+
throw new LocalError("rooms.createClaim requires a roomKey", "creating room claim");
|
|
256
|
+
}
|
|
257
|
+
if (!input?.resource) {
|
|
258
|
+
throw new LocalError("rooms.createClaim requires { resource }", "creating room claim");
|
|
259
|
+
}
|
|
260
|
+
if (!input?.mode) {
|
|
261
|
+
throw new LocalError("rooms.createClaim requires { mode }", "creating room claim");
|
|
262
|
+
}
|
|
263
|
+
const body = { resource: input.resource, mode: input.mode };
|
|
264
|
+
if (input.ttlSeconds !== undefined)
|
|
265
|
+
body.ttl_seconds = input.ttlSeconds;
|
|
266
|
+
if (input.note !== undefined)
|
|
267
|
+
body.note = input.note;
|
|
268
|
+
if (input.presenceId !== undefined)
|
|
269
|
+
body.presence_id = input.presenceId;
|
|
270
|
+
return this.client.request(`${roomPath(orgId, roomKey)}/claims`, {
|
|
271
|
+
method: "POST",
|
|
272
|
+
body,
|
|
273
|
+
context: "creating room claim",
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* List a room's active claims
|
|
278
|
+
* (`GET /orgs/v1/:org_id/rooms/:room_key/claims`).
|
|
279
|
+
* `opts.includeInactive` adds released/expired history (with
|
|
280
|
+
* `released_at`).
|
|
281
|
+
*/
|
|
282
|
+
async listClaims(orgId, roomKey, opts = {}) {
|
|
283
|
+
if (!orgId) {
|
|
284
|
+
throw new LocalError("rooms.listClaims requires an orgId", "listing room claims");
|
|
285
|
+
}
|
|
286
|
+
if (!roomKey) {
|
|
287
|
+
throw new LocalError("rooms.listClaims requires a roomKey", "listing room claims");
|
|
288
|
+
}
|
|
289
|
+
return this.client.request(`${roomPath(orgId, roomKey)}/claims${claimsQuery(opts)}`, { method: "GET", context: "listing room claims" });
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Release your own claim
|
|
293
|
+
* (`DELETE /orgs/v1/:org_id/rooms/:room_key/claims/:claim_id`). Holder's
|
|
294
|
+
* credential only. Idempotent — an already-released claim returns
|
|
295
|
+
* `already_released: true` with the original time.
|
|
296
|
+
*/
|
|
297
|
+
async releaseClaim(orgId, roomKey, claimId) {
|
|
298
|
+
if (!orgId) {
|
|
299
|
+
throw new LocalError("rooms.releaseClaim requires an orgId", "releasing room claim");
|
|
300
|
+
}
|
|
301
|
+
if (!roomKey) {
|
|
302
|
+
throw new LocalError("rooms.releaseClaim requires a roomKey", "releasing room claim");
|
|
303
|
+
}
|
|
304
|
+
if (!claimId) {
|
|
305
|
+
throw new LocalError("rooms.releaseClaim requires a claimId", "releasing room claim");
|
|
306
|
+
}
|
|
307
|
+
return this.client.request(`${roomPath(orgId, roomKey)}/claims/${encodeURIComponent(claimId)}`, { method: "DELETE", context: "releasing room claim" });
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Return a room-scoped sub-client with `(orgId, roomKey)` pre-bound.
|
|
311
|
+
* Synchronous — both ids are explicit. For a project's default room
|
|
312
|
+
* without knowing the org, use {@link forProject}.
|
|
313
|
+
*/
|
|
314
|
+
scoped(orgId, roomKey) {
|
|
315
|
+
return new ScopedRoom(this, orgId, roomKey);
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Resolve a project's DEFAULT room (`GET /projects/v1/:project_id` for the
|
|
319
|
+
* owning `org_id`, then {@link scoped}). The default room's key IS the
|
|
320
|
+
* project id verbatim — this is the zero-config rendezvous: two agents
|
|
321
|
+
* holding the same `run402.config.json` land in the same room with no
|
|
322
|
+
* shared setup.
|
|
323
|
+
*/
|
|
324
|
+
async forProject(projectId) {
|
|
325
|
+
if (!projectId) {
|
|
326
|
+
throw new LocalError("rooms.forProject requires a projectId", "resolving a project's default room");
|
|
327
|
+
}
|
|
328
|
+
const project = await this.client.request(`/projects/v1/${encodeURIComponent(projectId)}`, { method: "GET", context: "resolving a project's default room" });
|
|
329
|
+
const orgId = typeof project.org_id === "string" ? project.org_id : "";
|
|
330
|
+
if (!orgId) {
|
|
331
|
+
throw new LocalError("rooms.forProject could not resolve the project's owning org: the project read carried no org_id", "resolving a project's default room");
|
|
332
|
+
}
|
|
333
|
+
return this.scoped(orgId, projectId);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* A room-scoped sub-client returned by {@link Rooms.scoped} /
|
|
338
|
+
* {@link Rooms.forProject}. The `(orgId, roomKey)` pair is bound at
|
|
339
|
+
* construction; instance operations drop both leading arguments.
|
|
340
|
+
*/
|
|
341
|
+
export class ScopedRoom {
|
|
342
|
+
rooms;
|
|
343
|
+
/** The org id this sub-client is bound to. Read-only. */
|
|
344
|
+
orgId;
|
|
345
|
+
/** The room key this sub-client is bound to (a project id for a default room). Read-only. */
|
|
346
|
+
roomKey;
|
|
347
|
+
constructor(rooms, orgId, roomKey) {
|
|
348
|
+
this.rooms = rooms;
|
|
349
|
+
if (!orgId) {
|
|
350
|
+
throw new LocalError("rooms.scoped requires an orgId", "scoping client to room");
|
|
351
|
+
}
|
|
352
|
+
if (!roomKey) {
|
|
353
|
+
throw new LocalError("rooms.scoped requires a roomKey", "scoping client to room");
|
|
354
|
+
}
|
|
355
|
+
this.orgId = orgId;
|
|
356
|
+
this.roomKey = roomKey;
|
|
357
|
+
}
|
|
358
|
+
/** See {@link Rooms.registerPresence}. */
|
|
359
|
+
registerPresence(opts = {}) {
|
|
360
|
+
return this.rooms.registerPresence(this.orgId, this.roomKey, opts);
|
|
361
|
+
}
|
|
362
|
+
/** See {@link Rooms.listPresences}. */
|
|
363
|
+
listPresences(opts = {}) {
|
|
364
|
+
return this.rooms.listPresences(this.orgId, this.roomKey, opts);
|
|
365
|
+
}
|
|
366
|
+
/** See {@link Rooms.getPresence}. */
|
|
367
|
+
getPresence(presenceId) {
|
|
368
|
+
return this.rooms.getPresence(this.orgId, this.roomKey, presenceId);
|
|
369
|
+
}
|
|
370
|
+
/** See {@link Rooms.sendMessage}. */
|
|
371
|
+
sendMessage(input) {
|
|
372
|
+
return this.rooms.sendMessage(this.orgId, this.roomKey, input);
|
|
373
|
+
}
|
|
374
|
+
/** See {@link Rooms.listMessages}. */
|
|
375
|
+
listMessages(opts = {}) {
|
|
376
|
+
return this.rooms.listMessages(this.orgId, this.roomKey, opts);
|
|
377
|
+
}
|
|
378
|
+
/** See {@link Rooms.getMessage}. */
|
|
379
|
+
getMessage(messageId) {
|
|
380
|
+
return this.rooms.getMessage(this.orgId, this.roomKey, messageId);
|
|
381
|
+
}
|
|
382
|
+
/** See {@link Rooms.ackMessage}. */
|
|
383
|
+
ackMessage(messageId, opts = {}) {
|
|
384
|
+
return this.rooms.ackMessage(this.orgId, this.roomKey, messageId, opts);
|
|
385
|
+
}
|
|
386
|
+
/** See {@link Rooms.createClaim}. */
|
|
387
|
+
createClaim(input) {
|
|
388
|
+
return this.rooms.createClaim(this.orgId, this.roomKey, input);
|
|
389
|
+
}
|
|
390
|
+
/** See {@link Rooms.listClaims}. */
|
|
391
|
+
listClaims(opts = {}) {
|
|
392
|
+
return this.rooms.listClaims(this.orgId, this.roomKey, opts);
|
|
393
|
+
}
|
|
394
|
+
/** See {@link Rooms.releaseClaim}. */
|
|
395
|
+
releaseClaim(claimId) {
|
|
396
|
+
return this.rooms.releaseClaim(this.orgId, this.roomKey, claimId);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
//# sourceMappingURL=rooms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roo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