@cotal-ai/web 0.138.2 → 0.139.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.
Files changed (48) hide show
  1. package/dist/web/assets/AgentPage-CpDkKMSj.js +1 -0
  2. package/dist/web/assets/FailedTip-DfF85PmB.js +1 -0
  3. package/dist/web/assets/bash-CLZ0U2zV.js +1 -0
  4. package/dist/web/assets/characters-BsW4RWhl.js +9 -0
  5. package/dist/web/assets/controller-D_lQfVDy.js +70 -0
  6. package/dist/web/assets/core-Bfff_dYO.js +12 -0
  7. package/dist/web/assets/diff-woXpYk--.js +1 -0
  8. package/dist/web/assets/dist-BB9Crw5c.js +1 -0
  9. package/dist/web/assets/dist-DktEa9vr.js +1 -0
  10. package/dist/web/assets/engine-javascript-C30F4iNc.js +141 -0
  11. package/dist/web/assets/index-DQdr6c2w.css +1 -0
  12. package/dist/web/assets/index-Dfeh4Ewy.js +13 -0
  13. package/dist/web/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
  14. package/dist/web/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
  15. package/dist/web/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
  16. package/dist/web/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
  17. package/dist/web/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  18. package/dist/web/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  19. package/dist/web/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
  20. package/dist/web/assets/javascript-BgS3c2Ky.js +1 -0
  21. package/dist/web/assets/json-qhed-kSA.js +1 -0
  22. package/dist/web/assets/markdown-BYOwaDjH.js +1 -0
  23. package/dist/web/assets/python-gzcpVVnB.js +1 -0
  24. package/dist/web/assets/rolldown-runtime-XKyaHtl9.js +1 -0
  25. package/dist/web/assets/typescript-bsJCZSQ-.js +1 -0
  26. package/dist/web/assets/yaml-rwi0_p6S.js +1 -0
  27. package/dist/web/bundle-licenses.json +389 -0
  28. package/dist/web/index.html +9 -513
  29. package/dist/web/theme-boot.js +8 -0
  30. package/dist/web.d.ts +312 -21
  31. package/dist/web.d.ts.map +1 -1
  32. package/dist/web.js +647 -121
  33. package/dist/web.js.map +1 -1
  34. package/package.json +30 -6
  35. package/dist/web/agui-frame.js +0 -210
  36. package/dist/web/app.js +0 -1428
  37. package/dist/web/event-order.js +0 -283
  38. package/dist/web/graph.html +0 -225
  39. package/dist/web/graph.js +0 -868
  40. package/dist/web/harness.js +0 -46
  41. package/dist/web/md.js +0 -31
  42. package/dist/web/parts.js +0 -114
  43. package/dist/web/presence-ages.js +0 -33
  44. package/dist/web/presence.js +0 -17
  45. package/dist/web/snapshot.js +0 -99
  46. package/dist/web/vendor/marked.umd.js +0 -79
  47. package/dist/web/vendor/purify.min.js +0 -3
  48. package/dist/web/vendor/vendor-manifest.json +0 -18
package/dist/web.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { type ChildProcess } from "node:child_process";
2
2
  import { type IncomingMessage } from "node:http";
3
- import { type CotalMessage, type ParsedArgs } from "@cotal-ai/core";
3
+ import { CotalEndpoint, type DeliveryMode, type CotalMessage, type ParsedArgs, type SpaceAuth } from "@cotal-ai/core";
4
4
  import { type Connection, type LocalProcess, type WebSession } from "@cotal-ai/workspace";
5
5
  /** The dashboard's default port and its branded address. The server binds loopback
6
6
  * (127.0.0.1) but serves any Host, so `cotal.localhost` — which Chrome/Firefox/Edge
@@ -43,14 +43,42 @@ export declare function makeAuthGate(port: number, host?: string): {
43
43
  export declare const webProcess: LocalProcess;
44
44
  /** The one condition name for "the membership read did not answer", shared by the HTTP body and the
45
45
  * SSE event so a browser matches ONE token and a test asserts the same token the server emits.
46
- * Exported for the same reason `PAGE` is: a test that restates it only agrees with itself. */
46
+ * Exported so a test asserts the token the server emits rather than a restated copy. */
47
47
  export declare const MEMBERSHIP_READ_FAILED = "membership-read-failed";
48
- /** Exported so a test can resolve what the browser is actually served, rather than restating the
49
- * route table in its own source and agreeing with itself. */
50
- export declare const PAGE: Record<string, {
48
+ /** One servable file of the client build. `immutable` marks a content-hashed asset, which a
49
+ * browser may cache forever because a new build gives it a new name. */
50
+ export interface ClientFile {
51
51
  path: string;
52
52
  type: string;
53
- }>;
53
+ immutable: boolean;
54
+ }
55
+ /** The answer when the client build is missing: the server keeps serving the API and says what to
56
+ * do instead of serving nothing. It speaks to both readers who can meet it: in a source checkout
57
+ * the page has not been built yet, while an installed package always ships its page, so there the
58
+ * install itself is broken. */
59
+ export declare const CLIENT_NOT_BUILT: string;
60
+ /** The classic script the page loads in its head, before the stylesheet, to put the saved theme on
61
+ * the root element before anything is drawn (`client/src/lib/themeBoot.ts`, written by the build). */
62
+ export declare const THEME_BOOT = "theme-boot.js";
63
+ /** The client build as an allow-list, read once at startup: the page at `/` (and `/graph`, so an
64
+ * old link opens the app), the theme boot script at `/theme-boot.js`, and the files directly inside
65
+ * `assets/`. Nothing else under `dir` is reachable, and no request path is ever joined onto the
66
+ * filesystem. The boot script's name carries no hash, so unlike the assets it is not cached for good. */
67
+ export declare function clientAssets(dir: string): Map<string, ClientFile>;
68
+ /** The answer to a static request: the file when the build has it, a 503 naming the build command
69
+ * when the build is missing and the page is asked for, otherwise a 404. A pure function of the
70
+ * route map and the path, so the 503 is testable without a server. */
71
+ export declare function clientResponse(routes: Map<string, ClientFile>, path: string): {
72
+ status: 200;
73
+ file: ClientFile;
74
+ } | {
75
+ status: 503;
76
+ body: {
77
+ error: string;
78
+ };
79
+ } | {
80
+ status: 404;
81
+ };
54
82
  /** What the two backfill routes need from an endpoint. Narrow on purpose: it is the seam the filter
55
83
  * is measured through, and a mock satisfying six methods it never calls would prove less. */
56
84
  export interface ActivitySource {
@@ -76,7 +104,7 @@ export interface ActivitySource {
76
104
  * WHY AN AGENT'S EVENT CHANNEL IS NOT ONE OF THEM. `listChannels()` derives a row from every
77
105
  * retained concrete subject and the chat stream caps per subject rather than by age, so the list
78
106
  * grows by one row per agent that has ever run and those rows never age out. Unfiltered, the channel
79
- * sidebar is buried under machine streams, the graph page grows a hub node for each, and
107
+ * sidebar is buried under machine streams, the client's graph grows a hub node for each, and
80
108
  * `/api/activity` merges every event channel into a global top-N that a human reading chat did not
81
109
  * ask for, and pays to move those messages across the link first. That is a cost that scales with
82
110
  * the number of agents ever run, which is the wrong axis entirely.
@@ -89,11 +117,12 @@ export interface ActivitySource {
89
117
  * surfaces share this classifier rather than each spelling the convention, so they cannot disagree
90
118
  * about what a channel is.
91
119
  *
92
- * WHAT IS NOT FILTERED, DELIBERATELY, IN TWO PLACES. The live SSE tap still carries frames, marked
93
- * rather than dropped: dropping them would silently delete the live event traffic the surface draws.
94
- * And `/api/channels/<name>/history` still serves an event channel when a caller names one, because
95
- * that route answers a question about a channel the caller already identified; a filter there would
96
- * mean the dashboard could render a frame it could never fetch. */
120
+ * WHAT IS NOT FILTERED, DELIBERATELY, IN TWO PLACES. The live SSE tap still receives frames, and
121
+ * sends each one as an `agent-frame` only to the feeds watching that agent (see {@link classifyTap}
122
+ * and {@link SessionWatchers}), never as a `message` to every browser and never dropped for a
123
+ * watcher. And `/api/channels/<name>/history` still serves an event channel
124
+ * when a caller names one, because that route answers a question about a channel the caller already
125
+ * identified; a filter there would mean the dashboard could render a frame it could never fetch. */
97
126
  export declare function chatOnly<T extends {
98
127
  channel: string;
99
128
  }>(rows: readonly T[]): T[];
@@ -155,6 +184,11 @@ export declare class BadRequest extends Error {
155
184
  * 400 by fixing its payload would loop forever on a size it never learns is the problem. */
156
185
  export declare class PayloadTooLarge extends Error {
157
186
  }
187
+ /** A post the broker, or the operator's connection to it, refused. Neither the caller's fault nor
188
+ * this server's, so the frame answers 502 with the broker's own message, escaped by
189
+ * {@link escapeForOperator}. */
190
+ export declare class BrokerRefused extends Error {
191
+ }
158
192
  /** QUOTE A CALLER'S OWN VALUE SO AN OPERATOR CAN READ IT.
159
193
  *
160
194
  * `JSON.stringify` was doing two jobs at every site below and only claims one of them. It builds
@@ -180,16 +214,24 @@ export declare class PayloadTooLarge extends Error {
180
214
  * leave as two escapes. `\u1d173` is not a JSON escape, and a body carrying it would stop parsing
181
215
  * for the caller who asked what was wrong with their request. */
182
216
  export declare function quoteForOperator(value: string): string;
217
+ /** Escapes a message someone else wrote, keeping its wording. A broker refusal names the subject it
218
+ * refused, and a DM subject carries a recipient id taken from another agent's presence card, so the
219
+ * message reaches the 502 body and the operator's line as untrusted text. Each codepoint the quoter
220
+ * escapes leaves as its escape; the rest, quotes included, stays as the broker wrote it. */
221
+ export declare function escapeForOperator(text: string): string;
183
222
  /** The channel name out of the path. A percent escape the decoder cannot read is the caller having
184
223
  * typed a bad one, so it is refused as a bad request like any other malformed input. Left as a
185
224
  * bare `URIError` it reached the request frame unrecognised and was reported as a server fault,
186
225
  * which is the one thing the 400/500 split exists to prevent. */
187
226
  export declare function channelNameFromPath(raw: string): string;
188
- /** The `limit` out of the query. The safe-integer refusal is reachable only through the digits-only
189
- * test above it, so its value cannot carry anything the quoter would escape today. It quotes
190
- * anyway: the guarantee that a refusal renders its input unambiguously should hold because the
191
- * quoting site holds it, not because a regex two lines up stays exactly as narrow as it is this
192
- * morning.
227
+ /** The most messages one read may ask for. A route reads up to `limit` messages and holds them all
228
+ * before it answers, so a limit with no ceiling lets one request make the server read a stream's
229
+ * whole retained history. The dashboard asks for at most 500. */
230
+ export declare const MAX_HISTORY_LIMIT = 2000;
231
+ /** The `limit` out of the query. The ceiling refusal is reachable only through the digits-only test
232
+ * above it, so its value cannot carry anything the quoter would escape today. It quotes anyway:
233
+ * the guarantee that a refusal renders its input unambiguously should hold because the quoting site
234
+ * holds it, not because a regex two lines up stays exactly as narrow as it is this morning.
193
235
  *
194
236
  * THE LIMIT, PARSED ONCE, because three routes each re-deriving
195
237
  * `query.get("limit") ? Number(...) : N` is how they came to disagree about the same parameter.
@@ -205,7 +247,8 @@ export declare function channelNameFromPath(raw: string): string;
205
247
  * ?limit=2.5 silently truncated to 2.
206
248
  * ?limit=" 5" accepted as 5, because `Number()` trims whitespace.
207
249
  *
208
- * So the accepted form is the narrow one: a plain run of digits naming a safe integer. `0` keeps
250
+ * So the accepted form is the narrow one: a plain run of digits no larger than
251
+ * {@link MAX_HISTORY_LIMIT}. `0` keeps
209
252
  * meaning zero, which is what it already did and what a caller expects; an absent or empty
210
253
  * parameter keeps meaning the route's own default, the one shape the old parse got right.
211
254
  *
@@ -213,6 +256,169 @@ export declare function channelNameFromPath(raw: string): string;
213
256
  * the caller who wrote `limit=2.5` would never learn that the page they read was not the page they
214
257
  * asked for. */
215
258
  export declare function historyLimit(query: URLSearchParams, fallback: number): number;
259
+ /** An agent id out of a path segment: decoded, and a principal key, or a BadRequest naming it.
260
+ *
261
+ * The id is the roster's `card.id`, which is `principalKey(owner, actor).key` by construction, so
262
+ * the agent is named by its principal and never by a display name: two live agents with one name
263
+ * never share a session. The answer's `id` is rebuilt from the parsed tokens rather than passed
264
+ * through, so the id a route acts on is the one the event channel is formed from. */
265
+ export declare function agentIdFromPath(raw: string): {
266
+ id: string;
267
+ owner: string;
268
+ actor: string;
269
+ };
270
+ /** What the live tap does with one message. A chat message on a principal-shaped event channel is an
271
+ * agent frame for `principalKey(owner, actor).key`; everything else goes out as today's `message`.
272
+ *
273
+ * WHY FRAMES LEAVE THE BROADCAST. The observer taps `chat.>`, and an agent's event channel is a
274
+ * chat channel, so this one subscription receives every agent's frames. A NATS wildcard cannot
275
+ * exclude a sub-tree, so the observer still receives them; what changes is who it forwards them to.
276
+ * Sent as `message` to every browser, each frame cost every open dashboard a write whether or not
277
+ * anyone was reading that agent. As `agent-frame` it reaches only the feeds watching that agent.
278
+ *
279
+ * The agent is the event channel's principal, the same derivation the chat-only filter reads, so a
280
+ * near-miss name such as `events.standup` stays an ordinary `message`. The channel is the one the
281
+ * broker policed, taken from the subject, never the payload's own claim.
282
+ *
283
+ * A FRAME FROM ANYONE BUT THE AGENT IS DROPPED, and dropped rather than sent on as a `message`. The
284
+ * subject's sender is the verified publisher, and a frame is that agent's only when the agent
285
+ * published it. On a mesh where another principal may write the channel (an open mesh, or a grant
286
+ * wider than the agent's own), a forged frame would otherwise read as the agent's session, and
287
+ * falling through to `message` would hand it to every browser instead. */
288
+ export declare function classifyTap(subject: string, msg: CotalMessage | undefined): {
289
+ event: "message";
290
+ data: {
291
+ mode: DeliveryMode;
292
+ senderId?: string;
293
+ channel?: string;
294
+ msg: CotalMessage;
295
+ };
296
+ } | {
297
+ event: "agent-frame";
298
+ agent: string;
299
+ data: {
300
+ id: string;
301
+ msg: CotalMessage;
302
+ };
303
+ } | null;
304
+ /** The most bytes a feed may have waiting to be sent before the server gives up on it. A browser on
305
+ * a slow link, watching a busy agent, cannot take frames as fast as the tap produces them, and
306
+ * every byte it has not taken waits in this process. Past this the feed is told why and ended, and
307
+ * the browser's own reconnect opens a fresh one, watches again and reads the gap from history. */
308
+ export declare const MAX_FEED_BUFFER_BYTES = 1048576;
309
+ /** What a feed write is. A `live` event is traffic the feed may fall behind on, so it is held to the
310
+ * ceiling. A `snapshot` is the state a feed is opened with (its hello, the roster, the presence view
311
+ * and the membership seed), written once on connect: a mesh whose roster alone is larger than the
312
+ * ceiling must still open, or every new feed would end at once and reconnect into the same end. */
313
+ export type FeedWrite = "live" | "snapshot";
314
+ /** The parts of a feed's response that `writeFeed` uses. `once` is the stream's own, used to learn
315
+ * when the opening state has drained; a response without it is warmed by the zero-backlog check. */
316
+ export interface FeedResponse {
317
+ readonly writableEnded: boolean;
318
+ readonly writableLength: number;
319
+ write(chunk: string): unknown;
320
+ end(): unknown;
321
+ once?(event: "drain", listener: () => void): unknown;
322
+ }
323
+ /** Writes one SSE event to a feed. A feed that has ended takes nothing more.
324
+ *
325
+ * A live event is checked against the backlog the feed already holds, measured BEFORE the write:
326
+ * when more than `ceiling` bytes are still unsent, the feed is told so with one `overflow` event
327
+ * `{ reason }` and ended, and the event is not written. Measuring after the write would end a feed
328
+ * for one event larger than the ceiling on its own, such as a single long chat message, which would
329
+ * disconnect every dashboard at once. So one large event over an empty backlog is written, and the
330
+ * feed ends only when it is in fact behind.
331
+ *
332
+ * A snapshot is never checked. Its unsent bytes are not live traffic the feed fell behind on, so
333
+ * while they drain (the feed is cold) a live event is allowed them on top of the ceiling: on a slow
334
+ * link a roster over the ceiling would otherwise end the feed at its first live event, and every
335
+ * reconnect would end the same way. The allowance goes when the opening state has drained, so a
336
+ * cold feed still has a bound, its opening bytes plus the ceiling plus one event. */
337
+ export declare function writeFeed(res: FeedResponse, event: string, data: unknown, kind?: FeedWrite, ceiling?: number): void;
338
+ /** The state a feed opens with, in the order a browser needs it. */
339
+ export interface FeedOpening {
340
+ /** The feed's id, which every watch request names. */
341
+ feed: string;
342
+ roster: unknown;
343
+ presenceView: unknown;
344
+ /** Reads the current membership snapshot. The live tap carries only post-connect traffic, and
345
+ * membership is state, so a fresh feed needs it read for it. */
346
+ membership(): Promise<unknown>;
347
+ }
348
+ /** Writes a new feed's opening state through `send`, every write a snapshot: `hello` first, so a
349
+ * browser can watch an agent before the roster arrives, then the roster and the presence view, then
350
+ * the membership seed once it is read, or its refusal when the read fails. Resolves when the seed
351
+ * is written. */
352
+ export declare function writeOpening(send: (event: string, data: unknown, kind: FeedWrite) => void, state: FeedOpening): Promise<void>;
353
+ /** The most agents one feed may watch at once. A watch is a row in a map this process holds for as
354
+ * long as the feed is open, and the id is the caller's, so without a ceiling one browser could
355
+ * grow that map without bound by asking for ids nobody runs. The dashboard watches the agent whose
356
+ * session is open, in the panel and the centre, so it never comes near this. */
357
+ export declare const MAX_WATCHES_PER_FEED = 64;
358
+ /** Which feeds watch which agent. A feed is counted once per agent however many times it asks.
359
+ *
360
+ * This is the refcount behind "subscribe on demand": the tap already receives every frame, so an
361
+ * agent with no watcher costs no browser anything, and an agent leaves the map with its last
362
+ * watcher. Both directions are kept so `drop` touches only the agents its feed held, and so the
363
+ * per-feed ceiling is a lookup rather than a scan. */
364
+ export declare class SessionWatchers<F> {
365
+ private readonly perFeed;
366
+ private readonly byAgent;
367
+ private readonly byFeed;
368
+ constructor(perFeed?: number);
369
+ /** Throws a BadRequest when the feed already watches `perFeed` other agents. */
370
+ watch(agent: string, feed: F): void;
371
+ unwatch(agent: string, feed: F): void;
372
+ /** A feed closed: forget every watch it held. */
373
+ drop(feed: F): void;
374
+ targets(agent: string): readonly F[];
375
+ /** Agents with at least one watcher. An agent with none is absent, not zero. */
376
+ agents(): string[];
377
+ }
378
+ /** The events read ran past its deadline. Its own type, so the route can tell it from a refusal
379
+ * (an answer) and from any other failure (a 503 with the reason). */
380
+ export declare class AgentEventsLate extends Error {
381
+ }
382
+ /** One agent's newest frames within the deadline. Reads `limit + 1` from `events.<owner>.<actor>`
383
+ * with `channelHistory` and answers the newest `limit`, oldest first, with `more` when one more
384
+ * existed. A permission denial (`isPermissionDenied` from core) is an answer, `{ refused }` with the
385
+ * broker's own text and the grant command for this mesh. The deadline throws `AgentEventsLate`; any
386
+ * other failure rethrows.
387
+ *
388
+ * SENDER-CHECKED LIKE THE LIVE FEED. The read names the agent as `publisher`, so it filters on the
389
+ * agent's own subject, `chat.<owner>.<actor>.events.<owner>.<actor>`, and a frame whose subject
390
+ * names another sender is never read. That is the check `classifyTap` makes on a live frame, so a
391
+ * session's history and its live frames hold the same frames. Like that check, it is as strong as
392
+ * the mesh's publish permissions: on an open mesh any raw NATS client can publish on this subject.
393
+ *
394
+ * BOUNDED TWICE. The caller's `limit` is already capped at {@link MAX_HISTORY_LIMIT}, so one read
395
+ * holds at most one more message than that, and the read races the same deadline its siblings do,
396
+ * with the signal handed down so a late read stops its pull and drops its consumer.
397
+ *
398
+ * `channelHistory`, not the mediated `readHistory`: the mediated read caps a page at 200 and has
399
+ * no cursor, and this is the same credential the channel history route already reads with. */
400
+ export declare function agentEventsPage(source: {
401
+ channelHistory(channel: string, opts: {
402
+ limit: number;
403
+ signal: AbortSignal;
404
+ publisher: {
405
+ owner: string;
406
+ actor: string;
407
+ };
408
+ }): Promise<CotalMessage[]>;
409
+ }, agent: {
410
+ owner: string;
411
+ actor: string;
412
+ }, limit: number, grantFor: (channel: string, owner: string) => string | undefined, deadlineMs?: number): Promise<{
413
+ frames: CotalMessage[];
414
+ more: boolean;
415
+ } | {
416
+ refused: string;
417
+ grant?: string;
418
+ }>;
419
+ /** The command that lets a reader see one agent's event channel, as `docs/connect-claude.md` gives
420
+ * it for each kind of mesh, or nothing on an open mesh, where there is no grant to give. */
421
+ export declare function eventsGrantFor(mode: "user" | "static" | "open"): (channel: string, owner: string) => string | undefined;
216
422
  /** One aggregated page, and what it is missing. `partial` and the counts are ALWAYS present, so a
217
423
  * page that ran out of time cannot be mistaken for a complete one by omission. */
218
424
  export interface ActivityPage {
@@ -253,6 +459,91 @@ export interface ActivityPage {
253
459
  * were asked for, which is the only evidence that separates filtering before the fetch from
254
460
  * filtering after it. The route is a thin caller. */
255
461
  export declare function activityBackfill(ep: ActivitySource, limit: number, deadlineMs?: number, concurrency?: number): Promise<ActivityPage>;
462
+ /** What the dashboard can post as, decided once at startup and reported in `/api/meta`. A
463
+ * `participant` posts as one operator for the life of the process and joins the roster on its
464
+ * first post, on open and static-auth meshes alike. */
465
+ export type PostCapability = {
466
+ mode: "participant";
467
+ } | {
468
+ mode: "off";
469
+ reason: string;
470
+ };
471
+ /** Why posting is off on a dashboard started with `--creds`: the file is the only credential it
472
+ * holds, and it has no seed to mint an operator from. */
473
+ export declare const POST_OFF_CREDS = "This dashboard was started with --creds, which can only read.";
474
+ /** Why posting is off on a per-user sign-in mesh. */
475
+ export declare const POST_OFF_USER = "Posting from the dashboard isn't available on a sign-in mesh yet. Use cotal send.";
476
+ /** Why posting is off on a dashboard run as a service: the service holds a read-only credential. */
477
+ export declare const POST_OFF_SERVICE = "This dashboard runs as a read-only service. Use cotal send.";
478
+ /** The operator credential's lifetime: 24 days. Core arms a reconnect fence with one `setTimeout`
479
+ * at the credential's expiry, and Node caps a timer at 2^31-1 ms (about 24.8 days), so a longer
480
+ * credential turns library reconnect off 1 ms after every connect. */
481
+ export declare const OPERATOR_TTL_SECONDS: number;
482
+ /** The posting decision. `--creds` wins: a raw credential file is all such a dashboard holds. */
483
+ export declare function postCapability(creds: string | undefined, userMode: boolean): PostCapability;
484
+ /** The static-mesh operator: its credential, the lifecycle uid its presence registers under, and
485
+ * the credential's expiry in epoch milliseconds, read from the credential itself. */
486
+ export interface OperatorCred {
487
+ creds: string;
488
+ lifecycleUid: string;
489
+ expiresAt: number;
490
+ }
491
+ /** Mints the operator for a static-auth mesh with one new identity. Called once, from
492
+ * {@link connectWithoutSeed}, so every post the process makes carries that one `from.id` and an
493
+ * agent's replies land in one DM thread. With `consume: false` the uid names no broker resources,
494
+ * so it needs no provisioning. */
495
+ export declare function mintOperatorCred(auth: SpaceAuth): Promise<OperatorCred>;
496
+ /** The dashboard's one posting endpoint, built at startup and started on the first post. */
497
+ export interface OperatorPoster {
498
+ /** The id the operator posts as, once it is known: from startup on a static mesh, whose
499
+ * credential names it, and from the first post on an open mesh. */
500
+ operatorId(): string | undefined;
501
+ /** Starts the endpoint once. Concurrent first posts share one start. A failed start is stopped
502
+ * and dropped, so the next post tries again under the same id. Rejects once the poster has
503
+ * stopped. */
504
+ ensure(): Promise<CotalEndpoint>;
505
+ /** Whether the operator credential has expired, so a refused post can say why. Never on an open
506
+ * mesh, which has no credential. */
507
+ expired(): boolean;
508
+ /** Stops the endpoint if it started, so the operator leaves an offline record, and closes the
509
+ * poster: a start still in flight stops what it started, and a later post is refused. */
510
+ stop(): Promise<void>;
511
+ }
512
+ /** What `ensure()` rejects with once the poster has stopped. */
513
+ export declare const POSTER_STOPPED = "the dashboard is shutting down, so it no longer posts";
514
+ /** Why a post is refused once the operator credential has expired. */
515
+ export declare const POST_OFF_EXPIRED = "The operator credential expired. Restart cotal web to post again.";
516
+ /** What `POST /api/send` answers for a post that went out. `seq` is a DM's stored sequence, the
517
+ * broker's proof that it kept the message; a channel post has none. */
518
+ export interface SendAnswer {
519
+ ok: true;
520
+ id: string;
521
+ operatorId: string;
522
+ seq?: number;
523
+ }
524
+ /** `POST /api/send`: posts the body `{kind: "msg", channel, text}` to one channel, or
525
+ * `{kind: "dm", to, text}` to one roster member, as the operator. Separate from the handler so the
526
+ * refusals that need a stopped or expired poster can be driven with one.
527
+ *
528
+ * The body is read before any refusal, so the size cap bounds what a refused post costs: a reply
529
+ * written over an unread body leaves Node draining the rest of it to keep the connection. Every
530
+ * check runs before the poster starts, so a refused post never puts the operator on the roster.
531
+ * Throws `PayloadTooLarge`, `BadRequest` and `BrokerRefused` for the request frame to answer. */
532
+ export declare function sendAsOperator(post: PostCapability, poster: OperatorPoster | undefined, onRoster: (id: string) => boolean, readRequest: () => Promise<unknown>): Promise<{
533
+ status: number;
534
+ body: SendAnswer | {
535
+ error: string;
536
+ };
537
+ }>;
538
+ /** Builds the operator poster: a presence-registering endpoint with the card
539
+ * `{ name: "operator", role: "operator", kind: "endpoint" }`, on the static operator credential
540
+ * when there is one. The id is fixed here. The credential names it on a static mesh, and an open
541
+ * mesh pins one, so a start retried after a failure keeps it. */
542
+ export declare function operatorPoster(target: {
543
+ space: string;
544
+ server: string;
545
+ tls: boolean;
546
+ }, operator: OperatorCred | undefined): OperatorPoster;
256
547
  /** Trusted native service embedding. The supplied connection is explicitly scoped by its
257
548
  * credential file; no account signer, cached operator login or purger mint is substituted. */
258
549
  export interface WebServiceLifecycle {
@@ -262,9 +553,9 @@ export interface WebServiceLifecycle {
262
553
  readonly onClosed: () => void | Promise<void>;
263
554
  }
264
555
  /** A live observability dashboard for a space, served over HTTP + SSE. A read-only
265
- * observer endpoint (invisible to peers) feeds the page presence, channel history,
266
- * and a live message stream — no manager required. Bound to loopback unless the operator opts in
267
- * to a different host explicitly. */
556
+ * observer endpoint (invisible to peers) feeds the React client in `dist/web` presence, channel
557
+ * history and a live message stream, with no manager required. Bound to loopback unless the
558
+ * operator opts in to a different host explicitly. */
268
559
  export declare function web(args: ParsedArgs, lifecycle?: WebServiceLifecycle): Promise<void>;
269
560
  /** Write the session file. A stale `web.session` with a broader mode is set to 0o600 through the
270
561
  * descriptor on every write, so the launch URL and readiness nonce never stay readable to others,
package/dist/web.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"web.d.ts","sourceRoot":"","sources":["../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE9D,OAAO,EAAgB,KAAK,eAAe,EAAuB,MAAM,WAAW,CAAC;AAKpF,OAAO,EAcL,KAAK,YAAY,EAGjB,KAAK,UAAU,EAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAoBL,KAAK,UAAU,EACf,KAAK,YAAY,EAGjB,KAAK,UAAU,EAChB,MAAM,qBAAqB,CAAC;AAI7B;;;+DAG+D;AAC/D,eAAO,MAAM,QAAQ,OAAO,CAAC;AAC7B,eAAO,MAAM,QAAQ,cAAc,CAAC;AACpC,eAAO,MAAM,OAAO,iCAAwC,CAAC;AAG7D;;wCAEwC;AACxC,eAAO,MAAM,eAAe,oBAAoB,CAAC;AACjD,eAAO,MAAM,yBAAyB,8BAA8B,CAAC;AACrE,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAa3C;6FAC6F;AAC7F,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAIvD;AAiDD;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,MAAiB;;;IA+B9D,4FAA4F;eACjF,eAAe,SAAS,eAAe,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS;EAqC7G;AAMD,eAAO,MAAM,UAAU,EAAE,YAUxB,CAAC;AAmDF;;+FAE+F;AAC/F,eAAO,MAAM,sBAAsB,2BAA2B,CAAC;AAE/D;8DAC8D;AAC9D,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,MAAM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