@run402/sdk 4.17.9 → 4.18.1
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 +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/namespaces/rooms.d.ts +165 -0
- package/dist/namespaces/rooms.d.ts.map +1 -0
- package/dist/namespaces/rooms.js +399 -0
- package/dist/namespaces/rooms.js.map +1 -0
- package/dist/namespaces/rooms.types.d.ts +296 -0
- package/dist/namespaces/rooms.types.d.ts.map +1 -0
- package/dist/namespaces/rooms.types.js +27 -0
- package/dist/namespaces/rooms.types.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -331,6 +331,7 @@ The `CredentialsProvider` interface has two required methods (`getAuth`, `getPro
|
|
|
331
331
|
| `orgs` | **Org-owned control plane** (v1.77+; first-class orgs v1.82). `create`, `list`, `whoami` (the gateway-resolved control-plane identity) on the collection; the scoped `r.org(id)` sub-client (org analog of `r.project(id)`) adds `get`, `rename`, `setPayoutWallet`, `members.*` (`list`/`add`/`setRole`/`revoke`), `invites.*` (`list`/`create`/`revoke`), `audit`. Org create/read/rename summaries include `tier`, `lease_started_at`, and `lease_expires_at`. |
|
|
332
332
|
| `grants` | `create`, `revoke` — per-project capability grants (e.g. `"deploy"`, `"functions:write"`) for agent/CI principals; owner-gated, also reachable project-scoped as `r.project(id).grants` |
|
|
333
333
|
| `events` | `list`, `listForOrg` — the cursored project events feed ("what happened since I last looked"): deploy activations, suspensions, transfers, lifecycle cliffs, each with platform-suggested `next_actions`, plus app-emitted business facts (`source: "app"`) alongside the platform's own (`source: "platform"`) — filter with `{ source?, eventType? }`. Opaque store-and-echo cursor; `reset: true` + `earliest_cursor` instead of errors on expiry. Also reachable project-scoped as `r.project(id).events` |
|
|
334
|
+
| `rooms` | `registerPresence`, `listPresences`, `getPresence`, `sendMessage`, `listMessages`, `getMessage`, `ackMessage`, `createClaim`, `listClaims`, `releaseClaim`, plus `scoped(orgId, roomKey)` (sync) and `forProject(projectId)` (async — resolves the project's org; the default room's key IS the project id) returning a room-bound `ScopedRoom`. Org-scoped agent coordination rooms: per-session presence (~1h silence expiry; `requestedName` honored-or-suffixed, reported via `requested_name` + `renamed`), room-visible ≤32 KiB markdown messages (`to`/`cc` route attention, not access control; `idempotencyKey` replay returns the ORIGINAL + `deduplicated: true`) with opaque `mcr_…` cursors (`reset: true` + `earliest_cursor` on expiry, never an error), and ADVISORY claims — `createClaim` always succeeds with a complete `conflicts[]`; nothing is ever blocked by a claim |
|
|
334
335
|
| `errors` | `list`, `get`, `watch` — the release-error-rollup query surface. **Verdict-first**: each page leads with a gateway-computed promote-vs-revert verdict (`new_fingerprints` / `recurring_fingerprints` / `invocations_in_window`, baselined against the previous ACTIVE release), then grouped, deploy-stable error fingerprints with `fetch_logs` drill-downs. `watch({ newIn })` is the promote-gate poll loop — run it right after apply/promote; `clean === (verdict.new_fingerprints === 0)`, the gateway's count (no client-side identity math). Opaque keyset cursor. Also reachable project-scoped as `r.project(id).errors` |
|
|
335
336
|
|
|
336
337
|
CLI-style aliases are available for agent ergonomics: `r.image` aliases `r.ai`,
|
package/dist/index.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ import { Orgs, ScopedOrg } from "./namespaces/org.js";
|
|
|
39
39
|
import { Grants } from "./namespaces/grants.js";
|
|
40
40
|
import { Delegates } from "./namespaces/delegates.js";
|
|
41
41
|
import { Events } from "./namespaces/events.js";
|
|
42
|
+
import { Rooms } from "./namespaces/rooms.js";
|
|
42
43
|
import { Errors } from "./namespaces/errors.js";
|
|
43
44
|
import { Pay, type PayExecutor } from "./namespaces/pay.js";
|
|
44
45
|
import { IdentityLinks } from "./namespaces/identity-links.js";
|
|
@@ -134,6 +135,12 @@ export declare class Run402 {
|
|
|
134
135
|
* Also available project-scoped as `r.project(id).events`.
|
|
135
136
|
*/
|
|
136
137
|
readonly events: Events;
|
|
138
|
+
/**
|
|
139
|
+
* Agent-messaging coordination rooms — presence, room-visible addressed
|
|
140
|
+
* messages, advisory claims. Org-scoped; a project id names its default
|
|
141
|
+
* room (`r.rooms.forProject(projectId)` is the zero-config rendezvous).
|
|
142
|
+
*/
|
|
143
|
+
readonly rooms: Rooms;
|
|
137
144
|
/** Pay arbitrary x402-priced URLs with a spend ceiling and structured receipt. */
|
|
138
145
|
readonly pay: Pay;
|
|
139
146
|
/**
|
|
@@ -298,6 +305,8 @@ export { Delegates } from "./namespaces/delegates.js";
|
|
|
298
305
|
export type * from "./namespaces/delegates.types.js";
|
|
299
306
|
export { Events } from "./namespaces/events.js";
|
|
300
307
|
export type * from "./namespaces/events.types.js";
|
|
308
|
+
export { Rooms, ScopedRoom } from "./namespaces/rooms.js";
|
|
309
|
+
export type * from "./namespaces/rooms.types.js";
|
|
301
310
|
export { Errors } from "./namespaces/errors.js";
|
|
302
311
|
export type * from "./namespaces/errors.types.js";
|
|
303
312
|
export { Pay, PaymentBuyerError, PaymentPolicyError, DEFAULT_PAYMENT_MAX_USD_MICROS, X402_COMMERCE_RESULT_SCHEMA_VERSION, X402_EVIDENCE_STATUSES, X402_GATEWAY_AVAILABILITY_ERROR_CODE, X402_MUTATION_STATES, X402_PAYMENT_POLICY_ERROR_CODES, X402_RECOVERY_ACTIONS, RUN402_PENDING_CLASSIFIER_VERSION, isPaymentBuyerError, isPaymentPolicyError, isTrustedRun402PaymentUrl, isTrustedRun402PendingResponse, payFetchResultToJson, } from "./namespaces/pay.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAA+C,KAAK,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACrG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EA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,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,mBAAmB,gCAAgC,CAAC;AACpD,mBAAmB,gCAAgC,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACnF,mBAAmB,gCAAgC,CAAC;AACpD,mBAAmB,sCAAsC,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC3I,mBAAmB,4BAA4B,CAAC;AAChD,mBAAmB,yBAAyB,CAAC;AAC7C,mBAAmB,+BAA+B,CAAC;AACnD,mBAAmB,yBAAyB,CAAC;AAC7C,mBAAmB,uBAAuB,CAAC;AAC3C,mBAAmB,4BAA4B,CAAC;AAChD,mBAAmB,sBAAsB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,mBAAmB,yBAAyB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -38,6 +38,7 @@ import { Orgs, ScopedOrg } from "./namespaces/org.js";
|
|
|
38
38
|
import { Grants } from "./namespaces/grants.js";
|
|
39
39
|
import { Delegates } from "./namespaces/delegates.js";
|
|
40
40
|
import { Events } from "./namespaces/events.js";
|
|
41
|
+
import { Rooms } from "./namespaces/rooms.js";
|
|
41
42
|
import { Errors } from "./namespaces/errors.js";
|
|
42
43
|
import { Pay } from "./namespaces/pay.js";
|
|
43
44
|
import { IdentityLinks } from "./namespaces/identity-links.js";
|
|
@@ -111,6 +112,12 @@ export class Run402 {
|
|
|
111
112
|
* Also available project-scoped as `r.project(id).events`.
|
|
112
113
|
*/
|
|
113
114
|
events;
|
|
115
|
+
/**
|
|
116
|
+
* Agent-messaging coordination rooms — presence, room-visible addressed
|
|
117
|
+
* messages, advisory claims. Org-scoped; a project id names its default
|
|
118
|
+
* room (`r.rooms.forProject(projectId)` is the zero-config rendezvous).
|
|
119
|
+
*/
|
|
120
|
+
rooms;
|
|
114
121
|
/** Pay arbitrary x402-priced URLs with a spend ceiling and structured receipt. */
|
|
115
122
|
pay;
|
|
116
123
|
/**
|
|
@@ -188,6 +195,7 @@ export class Run402 {
|
|
|
188
195
|
this.grants = new Grants(client);
|
|
189
196
|
this.delegates = new Delegates(client);
|
|
190
197
|
this.events = new Events(client);
|
|
198
|
+
this.rooms = new Rooms(client);
|
|
191
199
|
this.pay = new Pay(client, opts.payExecutor);
|
|
192
200
|
this.errors = new Errors(client);
|
|
193
201
|
this.identityLinks = new IdentityLinks(client);
|
|
@@ -343,6 +351,7 @@ export { Orgs, ScopedOrg, OrgMembers, OrgInvites } from "./namespaces/org.js";
|
|
|
343
351
|
export { Grants } from "./namespaces/grants.js";
|
|
344
352
|
export { Delegates } from "./namespaces/delegates.js";
|
|
345
353
|
export { Events } from "./namespaces/events.js";
|
|
354
|
+
export { Rooms, ScopedRoom } from "./namespaces/rooms.js";
|
|
346
355
|
export { Errors } from "./namespaces/errors.js";
|
|
347
356
|
export { Pay, PaymentBuyerError, PaymentPolicyError, DEFAULT_PAYMENT_MAX_USD_MICROS, X402_COMMERCE_RESULT_SCHEMA_VERSION, X402_EVIDENCE_STATUSES, X402_GATEWAY_AVAILABILITY_ERROR_CODE, X402_MUTATION_STATES, X402_PAYMENT_POLICY_ERROR_CODES, X402_RECOVERY_ACTIONS, RUN402_PENDING_CLASSIFIER_VERSION, isPaymentBuyerError, isPaymentPolicyError, isTrustedRun402PaymentUrl, isTrustedRun402PendingResponse, payFetchResultToJson, } from "./namespaces/pay.js";
|
|
348
357
|
export { Archives } from "./namespaces/archives.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAA6D,MAAM,aAAa,CAAC;AAErG,OAAO,EAAE,QAAQ,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AE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAE9E,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,OAAO,EACL,GAAG,EACH,iBAAiB,EACjB,kBAAkB,EAClB,8BAA8B,EAC9B,mCAAmC,EACnC,sBAAsB,EACtB,oCAAoC,EACpC,oBAAoB,EACpB,+BAA+B,EAC/B,qBAAqB,EACrB,iCAAiC,EACjC,mBAAmB,EACnB,oBAAoB,EACpB,yBAAyB,EACzB,8BAA8B,EAC9B,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGpD,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGnF,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAQ3I,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,165 @@
|
|
|
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 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"],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IzE,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":"rooms.js","sourceRoot":"","sources":["../../src/namespaces/rooms.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAqB1C,SAAS,QAAQ,CAAC,KAAa,EAAE,OAAe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1B,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IACpE,CAAC;IAED,oCAAoC;IACpC,UAAU,CAAC,SAAiB,EAAE,OAA8B,EAAE;QAC5D,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IAC1E,CAAC;IAED,qCAAqC;IACrC,WAAW,CAAC,KAA2B;QACrC,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACjE,CAAC;IAED,oCAAoC;IACpC,UAAU,CAAC,OAA8B,EAAE;QACzC,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC/D,CAAC;IAED,sCAAsC;IACtC,YAAY,CAAC,OAAe;QAC1B,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;CACF"}
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Request/response types for the `rooms` namespace — agent-messaging
|
|
3
|
+
* coordination rooms (`/orgs/v1/:org_id/rooms/:room_key/*`): session-grained
|
|
4
|
+
* presences, room-visible addressed messages, and TTL-expiring advisory
|
|
5
|
+
* claims.
|
|
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
|
+
* the zero-config rendezvous for agents sharing a `run402.config.json`.
|
|
10
|
+
* Load-bearing conventions:
|
|
11
|
+
*
|
|
12
|
+
* - **Presence names are unique per room, forever** (never recycled). A
|
|
13
|
+
* `requestedName` is honored verbatim when free, else deterministically
|
|
14
|
+
* suffixed (`Opus` → `Opus-2`) with the registration reporting
|
|
15
|
+
* `renamed: true` — never an error, never a retry.
|
|
16
|
+
* - **Claims are advisory and never block** anything, anywhere (deploys
|
|
17
|
+
* included): claim creation always succeeds and reports the complete
|
|
18
|
+
* `conflicts[]`.
|
|
19
|
+
* - **Message cursors are OPAQUE** (`mcr_…`): store the page's `cursor` and
|
|
20
|
+
* echo it back next time — never parse one. An unusable cursor never
|
|
21
|
+
* errors; the page returns `reset: true` + `earliest_cursor`.
|
|
22
|
+
*
|
|
23
|
+
* Every response interface carries an index signature so additive gateway
|
|
24
|
+
* fields pass through untyped.
|
|
25
|
+
*/
|
|
26
|
+
/** A platform-synthesized drill-down suggestion attached to a rooms response. */
|
|
27
|
+
export interface RoomNextAction {
|
|
28
|
+
type: string;
|
|
29
|
+
method?: string;
|
|
30
|
+
path?: string;
|
|
31
|
+
command?: string;
|
|
32
|
+
why?: string;
|
|
33
|
+
[key: string]: unknown;
|
|
34
|
+
}
|
|
35
|
+
/** One session-grained presence in a room. */
|
|
36
|
+
export interface RoomPresence {
|
|
37
|
+
/** Opaque presence id (`prs_…`). */
|
|
38
|
+
presence_id: string;
|
|
39
|
+
/** Room-unique display name (server-assigned like `GreenCastle`, or your requested name, possibly suffixed). */
|
|
40
|
+
name: string;
|
|
41
|
+
/** Display-only "what I'm working on" line, or null. */
|
|
42
|
+
task: string | null;
|
|
43
|
+
/** Display-only program/harness label (e.g. `claude-code`), or null. */
|
|
44
|
+
program: string | null;
|
|
45
|
+
/** Display-only model label, or null. */
|
|
46
|
+
model: string | null;
|
|
47
|
+
/** Server-reported presence state (`"active"` in v1; future states are reserved for the escalation ladder). */
|
|
48
|
+
state: string;
|
|
49
|
+
/** Bumped by any coordination call from this presence. */
|
|
50
|
+
last_active: string;
|
|
51
|
+
/** Liveness expiry (~1h of silence); any coordination call extends it. */
|
|
52
|
+
expires_at: string;
|
|
53
|
+
/** Count of this presence's active claims. Present on list reads. */
|
|
54
|
+
active_claims?: number;
|
|
55
|
+
[key: string]: unknown;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Response of {@link Rooms.registerPresence} — the created presence plus the
|
|
59
|
+
* name-resolution report and the platform's suggested next call.
|
|
60
|
+
*/
|
|
61
|
+
export interface PresenceRegistration extends RoomPresence {
|
|
62
|
+
/** Echo of the name you asked for. Present only when `requestedName` was sent. */
|
|
63
|
+
requested_name?: string;
|
|
64
|
+
/**
|
|
65
|
+
* True when the room's forever-unique name index suffixed your requested
|
|
66
|
+
* name (`Opus` → `Opus-2`); `name` carries the resolved result.
|
|
67
|
+
*/
|
|
68
|
+
renamed?: boolean;
|
|
69
|
+
next_actions?: RoomNextAction[];
|
|
70
|
+
}
|
|
71
|
+
/** Options for {@link Rooms.registerPresence}. All fields are display-only metadata. */
|
|
72
|
+
export interface RegisterPresenceOptions {
|
|
73
|
+
/**
|
|
74
|
+
* Self-chosen name — honored verbatim when free, else deterministically
|
|
75
|
+
* suffixed against the room's forever-unique index (reported via
|
|
76
|
+
* `renamed: true`, never an error). Omit for a server-assigned memorable
|
|
77
|
+
* name.
|
|
78
|
+
*/
|
|
79
|
+
requestedName?: string;
|
|
80
|
+
/** What you're working on — shown to the other presences. */
|
|
81
|
+
task?: string;
|
|
82
|
+
/** Program/harness label, e.g. `claude-code`. */
|
|
83
|
+
program?: string;
|
|
84
|
+
/** Model label, e.g. `fable-5`. */
|
|
85
|
+
model?: string;
|
|
86
|
+
}
|
|
87
|
+
/** Options for {@link Rooms.listPresences}. */
|
|
88
|
+
export interface ListPresencesOptions {
|
|
89
|
+
/** Include expired presences (history) alongside live ones. */
|
|
90
|
+
includeExpired?: boolean;
|
|
91
|
+
/** Exact-name lookup. */
|
|
92
|
+
name?: string;
|
|
93
|
+
}
|
|
94
|
+
/** Response of {@link Rooms.listPresences}. */
|
|
95
|
+
export interface RoomPresenceList {
|
|
96
|
+
presences: RoomPresence[];
|
|
97
|
+
[key: string]: unknown;
|
|
98
|
+
}
|
|
99
|
+
/** Per-recipient addressing + ack state on a message. */
|
|
100
|
+
export interface RoomMessageRecipient {
|
|
101
|
+
/** Recipient presence name. */
|
|
102
|
+
name: string;
|
|
103
|
+
/** Addressing lane: direct (`to`) or courtesy copy (`cc`). */
|
|
104
|
+
kind: "to" | "cc";
|
|
105
|
+
ack_required: boolean;
|
|
106
|
+
/** When this recipient acked, or null. */
|
|
107
|
+
acked_at: string | null;
|
|
108
|
+
[key: string]: unknown;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* One room message. Messages are ROOM-VISIBLE — `recipients` routes
|
|
112
|
+
* attention, it is not access control. List reads carry `body_snippet` only
|
|
113
|
+
* (`body_truncated` says whether it was cut); the full `body` arrives on
|
|
114
|
+
* get-one — the view truncates, the data never does.
|
|
115
|
+
*/
|
|
116
|
+
export interface RoomMessage {
|
|
117
|
+
/** Opaque message id (`msg_…`). */
|
|
118
|
+
message_id: string;
|
|
119
|
+
/** This message's own opaque cursor (`mcr_…`) — a valid `cursor` input to resume after it. */
|
|
120
|
+
cursor: string;
|
|
121
|
+
room_key: string;
|
|
122
|
+
/** Sender presence name. */
|
|
123
|
+
sender: string;
|
|
124
|
+
/** Bounded preview of the body. */
|
|
125
|
+
body_snippet: string;
|
|
126
|
+
/** True when `body_snippet` is shorter than the full body. */
|
|
127
|
+
body_truncated: boolean;
|
|
128
|
+
/** Full markdown body. Present on get-one only. */
|
|
129
|
+
body?: string;
|
|
130
|
+
thread_id: string | null;
|
|
131
|
+
importance: "normal" | "high";
|
|
132
|
+
/** True when the sender asked addressees to ack. */
|
|
133
|
+
ack_required: boolean;
|
|
134
|
+
recipients: RoomMessageRecipient[];
|
|
135
|
+
created_at: string;
|
|
136
|
+
[key: string]: unknown;
|
|
137
|
+
}
|
|
138
|
+
/** Input for {@link Rooms.sendMessage}. */
|
|
139
|
+
export interface SendRoomMessageInput {
|
|
140
|
+
/** Markdown body, ≤32 KiB (over-cap is a 400 — never truncated). Required. */
|
|
141
|
+
body: string;
|
|
142
|
+
/** Presence names to address directly. Attention routing, not access control. */
|
|
143
|
+
to?: string[];
|
|
144
|
+
/** Presence names to courtesy-copy. */
|
|
145
|
+
cc?: string[];
|
|
146
|
+
/** Thread to reply into. */
|
|
147
|
+
threadId?: string;
|
|
148
|
+
importance?: "normal" | "high";
|
|
149
|
+
/** Ask addressees to ack (their ack state rides `recipients[]`). */
|
|
150
|
+
ackRequired?: boolean;
|
|
151
|
+
/**
|
|
152
|
+
* Dedup key per (room, sender presence): a replayed send returns the
|
|
153
|
+
* ORIGINAL stored message with `deduplicated: true` instead of a new row.
|
|
154
|
+
*/
|
|
155
|
+
idempotencyKey?: string;
|
|
156
|
+
/** Send as this existing presence (`prs_…`). Omit to resolve-or-create your live presence implicitly. */
|
|
157
|
+
presenceId?: string;
|
|
158
|
+
/** Name for the implicit presence-creation case — same honored-or-suffixed semantics as registration. */
|
|
159
|
+
requestedName?: string;
|
|
160
|
+
/** Task metadata for the implicit presence-creation case. */
|
|
161
|
+
task?: string;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Response of {@link Rooms.sendMessage} — the stored message plus send-time
|
|
165
|
+
* riders: your resolved presence, the room's other live presences, and the
|
|
166
|
+
* platform's suggested next call.
|
|
167
|
+
*/
|
|
168
|
+
export interface SentRoomMessage extends RoomMessage {
|
|
169
|
+
/** True when `idempotencyKey` matched an earlier send: this is the ORIGINAL stored message, not a new row. */
|
|
170
|
+
deduplicated: boolean;
|
|
171
|
+
/** The presence the message was attributed to (yours). */
|
|
172
|
+
sender_presence: RoomPresence;
|
|
173
|
+
/** Other live presences in the room at send time (your own excluded). */
|
|
174
|
+
live_presences: RoomPresence[];
|
|
175
|
+
next_actions: RoomNextAction[];
|
|
176
|
+
}
|
|
177
|
+
/** Options for {@link Rooms.listMessages}. */
|
|
178
|
+
export interface ListRoomMessagesOptions {
|
|
179
|
+
/**
|
|
180
|
+
* Opaque cursor (`mcr_…`) from a prior page. Returns messages strictly
|
|
181
|
+
* after it, oldest-first. Ascending mode only — omit on first contact to
|
|
182
|
+
* start from the earliest retained message.
|
|
183
|
+
*/
|
|
184
|
+
cursor?: string;
|
|
185
|
+
/** `"asc"` (default — catch-up polling) or `"desc"` (newest-first display). */
|
|
186
|
+
order?: "asc" | "desc";
|
|
187
|
+
/** Desc mode only: page older than this cursor (`before_cursor` from a prior page). */
|
|
188
|
+
before?: string;
|
|
189
|
+
/** Restrict to one thread. */
|
|
190
|
+
threadId?: string;
|
|
191
|
+
/** `"me"`: only messages addressed to your presence. Requires a live presence. */
|
|
192
|
+
addressedTo?: "me";
|
|
193
|
+
/** Only messages past your presence's read watermark. Requires a live presence. */
|
|
194
|
+
unread?: boolean;
|
|
195
|
+
/** Read as this presence (`prs_…`) when your credential holds several. */
|
|
196
|
+
presenceId?: string;
|
|
197
|
+
/** Page size (server default 50, max 200). */
|
|
198
|
+
limit?: number;
|
|
199
|
+
}
|
|
200
|
+
/** One page of room messages (events-feed cursor semantics). */
|
|
201
|
+
export interface RoomMessagePage {
|
|
202
|
+
messages: RoomMessage[];
|
|
203
|
+
/** High-water catch-up cursor: store and pass back as `{ cursor }` next time. Present even on an empty page. */
|
|
204
|
+
cursor: string;
|
|
205
|
+
/** True when more messages are immediately available past `cursor`. */
|
|
206
|
+
has_more: boolean;
|
|
207
|
+
/**
|
|
208
|
+
* True when the supplied cursor was unusable (malformed or below
|
|
209
|
+
* retention). The page restarts from the earliest retained message and
|
|
210
|
+
* `earliest_cursor` is provided — never a bare error.
|
|
211
|
+
*/
|
|
212
|
+
reset?: boolean;
|
|
213
|
+
/** Present only when `reset` is true: a cursor just before the earliest retained message. */
|
|
214
|
+
earliest_cursor?: string;
|
|
215
|
+
/** Desc mode only: keyset cursor for the next-older page; absent on the oldest retained page. */
|
|
216
|
+
before_cursor?: string;
|
|
217
|
+
[key: string]: unknown;
|
|
218
|
+
}
|
|
219
|
+
/** Options for {@link Rooms.ackMessage}. */
|
|
220
|
+
export interface AckRoomMessageOptions {
|
|
221
|
+
/** Ack as this presence (`prs_…`) when your credential holds several. */
|
|
222
|
+
presenceId?: string;
|
|
223
|
+
}
|
|
224
|
+
/** Response of {@link Rooms.ackMessage}. Idempotent — a replay reports the ORIGINAL `acked_at`. */
|
|
225
|
+
export interface RoomAckResult {
|
|
226
|
+
message_id: string;
|
|
227
|
+
acked_at: string;
|
|
228
|
+
/** True when the ack had already been recorded; `acked_at` is the original time. */
|
|
229
|
+
already_acked: boolean;
|
|
230
|
+
[key: string]: unknown;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* One advisory claim ("I'm editing `repo:src/auth/**` for the next hour").
|
|
234
|
+
* Advisory means advisory: a claim never blocks anything, anywhere.
|
|
235
|
+
*/
|
|
236
|
+
export interface RoomClaim {
|
|
237
|
+
/** Opaque claim id (`clm_…`). */
|
|
238
|
+
claim_id: string;
|
|
239
|
+
/**
|
|
240
|
+
* Claimed resource. Namespaces: `repo:<glob>` (glob-overlap conflict
|
|
241
|
+
* detection), `function:<name>`, `table:<name>`, `deploy`, or free-form
|
|
242
|
+
* (exact match).
|
|
243
|
+
*/
|
|
244
|
+
resource: string;
|
|
245
|
+
mode: "exclusive" | "shared";
|
|
246
|
+
note: string | null;
|
|
247
|
+
/** Holder's presence name. */
|
|
248
|
+
holder: string;
|
|
249
|
+
/** Auto-expiry — claims lapse on their own. */
|
|
250
|
+
expires_at: string;
|
|
251
|
+
/** Present on history reads (`includeInactive`): when the claim was explicitly released, or null. */
|
|
252
|
+
released_at?: string | null;
|
|
253
|
+
created_at: string;
|
|
254
|
+
[key: string]: unknown;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Response of {@link Rooms.createClaim} — grant-and-report: the claim was
|
|
258
|
+
* granted regardless; `conflicts` is the complete overlap report.
|
|
259
|
+
*/
|
|
260
|
+
export interface CreatedRoomClaim extends RoomClaim {
|
|
261
|
+
/** Overlapping active claims held by other live presences. Complete, never trimmed — and never a block. */
|
|
262
|
+
conflicts: RoomClaim[];
|
|
263
|
+
}
|
|
264
|
+
/** Input for {@link Rooms.createClaim}. */
|
|
265
|
+
export interface CreateRoomClaimInput {
|
|
266
|
+
/** Resource to claim (see {@link RoomClaim.resource} for the namespace grammar). Required. */
|
|
267
|
+
resource: string;
|
|
268
|
+
/** Required: `exclusive` conflicts with everything overlapping; `shared` conflicts only with `exclusive`. */
|
|
269
|
+
mode: "exclusive" | "shared";
|
|
270
|
+
/** Seconds until auto-expiry (server default 3600, max 86400). */
|
|
271
|
+
ttlSeconds?: number;
|
|
272
|
+
/** Display-only context for the other agents. */
|
|
273
|
+
note?: string;
|
|
274
|
+
/** Claim as this presence (`prs_…`). Omit to resolve-or-create your live presence implicitly. */
|
|
275
|
+
presenceId?: string;
|
|
276
|
+
}
|
|
277
|
+
/** Options for {@link Rooms.listClaims}. */
|
|
278
|
+
export interface ListRoomClaimsOptions {
|
|
279
|
+
/** Include released/expired claims (history) alongside active ones. */
|
|
280
|
+
includeInactive?: boolean;
|
|
281
|
+
}
|
|
282
|
+
/** Response of {@link Rooms.listClaims}. */
|
|
283
|
+
export interface RoomClaimList {
|
|
284
|
+
claims: RoomClaim[];
|
|
285
|
+
[key: string]: unknown;
|
|
286
|
+
}
|
|
287
|
+
/** Response of {@link Rooms.releaseClaim}. Idempotent — a replay reports the original time. */
|
|
288
|
+
export interface RoomClaimReleaseResult {
|
|
289
|
+
claim_id: string;
|
|
290
|
+
/** When the claim was released (the original time on a replay). */
|
|
291
|
+
released_at: string | null;
|
|
292
|
+
/** True when the claim had already been released. */
|
|
293
|
+
already_released: boolean;
|
|
294
|
+
[key: string]: unknown;
|
|
295
|
+
}
|
|
296
|
+
//# sourceMappingURL=rooms.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rooms.types.d.ts","sourceRoot":"","sources":["../../src/namespaces/rooms.types.ts"],"names":[],"m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AE,SAAS,EAAE,CAAC;CACxB;AAED,2CAA2C;AAC3C,MAAM,WAAW,oBAAoB;IACnC,8FAA8F;IAC9F,QAAQ,EAAE,MAAM,CAAC;IACjB,6GAA6G;IAC7G,IAAI,EAAE,WAAW,GAAG,QAAQ,CAAC;IAC7B,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iGAAiG;IACjG,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,4CAA4C;AAC5C,MAAM,WAAW,qBAAqB;IACpC,uEAAuE;IACvE,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,4CAA4C;AAC5C,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,+FAA+F;AAC/F,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,mEAAmE;IACnE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,qDAAqD;IACrD,gBAAgB,EAAE,OAAO,CAAC;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Request/response types for the `rooms` namespace — agent-messaging
|
|
3
|
+
* coordination rooms (`/orgs/v1/:org_id/rooms/:room_key/*`): session-grained
|
|
4
|
+
* presences, room-visible addressed messages, and TTL-expiring advisory
|
|
5
|
+
* claims.
|
|
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
|
+
* the zero-config rendezvous for agents sharing a `run402.config.json`.
|
|
10
|
+
* Load-bearing conventions:
|
|
11
|
+
*
|
|
12
|
+
* - **Presence names are unique per room, forever** (never recycled). A
|
|
13
|
+
* `requestedName` is honored verbatim when free, else deterministically
|
|
14
|
+
* suffixed (`Opus` → `Opus-2`) with the registration reporting
|
|
15
|
+
* `renamed: true` — never an error, never a retry.
|
|
16
|
+
* - **Claims are advisory and never block** anything, anywhere (deploys
|
|
17
|
+
* included): claim creation always succeeds and reports the complete
|
|
18
|
+
* `conflicts[]`.
|
|
19
|
+
* - **Message cursors are OPAQUE** (`mcr_…`): store the page's `cursor` and
|
|
20
|
+
* echo it back next time — never parse one. An unusable cursor never
|
|
21
|
+
* errors; the page returns `reset: true` + `earliest_cursor`.
|
|
22
|
+
*
|
|
23
|
+
* Every response interface carries an index signature so additive gateway
|
|
24
|
+
* fields pass through untyped.
|
|
25
|
+
*/
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=rooms.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rooms.types.js","sourceRoot":"","sources":["../../src/namespaces/rooms.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@run402/sdk",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.18.1",
|
|
4
4
|
"description": "Typed TypeScript client for the Run402 API. Kernel shared by the run402-mcp server, the run402 CLI, and user-deployed run402 functions.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|