@mono-agent/web 0.13.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +136 -12
- package/dist/contracts.d.ts +14 -0
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +2 -0
- package/dist/contracts.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/notification-client.d.ts +19 -0
- package/dist/notification-client.d.ts.map +1 -0
- package/dist/notification-client.js +136 -0
- package/dist/notification-client.js.map +1 -0
- package/dist/notification-ingress.d.ts +17 -0
- package/dist/notification-ingress.d.ts.map +1 -0
- package/dist/notification-ingress.js +170 -0
- package/dist/notification-ingress.js.map +1 -0
- package/dist/operator-client.d.ts +19 -1
- package/dist/operator-client.d.ts.map +1 -1
- package/dist/operator-client.js +58 -0
- package/dist/operator-client.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +50 -18
- package/dist/server.js.map +1 -1
- package/dist/service.d.ts +24 -1
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +203 -7
- package/dist/service.js.map +1 -1
- package/dist/state-paths.d.ts +1 -0
- package/dist/state-paths.d.ts.map +1 -1
- package/dist/state-paths.js +12 -0
- package/dist/state-paths.js.map +1 -1
- package/dist/store.d.ts +47 -2
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +496 -11
- package/dist/store.js.map +1 -1
- package/package.json +5 -5
- package/webapp/dist/assets/index-D3Tzt8AW.css +1 -0
- package/webapp/dist/assets/index-DlEfCKkw.js +51 -0
- package/webapp/dist/index.html +2 -2
- package/webapp/dist/sw.js +1 -1
- package/webapp/dist/assets/index-1UedhLBk.css +0 -1
- package/webapp/dist/assets/index-D-X2B4kU.js +0 -47
package/README.md
CHANGED
|
@@ -6,7 +6,14 @@ and serves the assistant-ui PWA from one always-on process.
|
|
|
6
6
|
|
|
7
7
|
## Category
|
|
8
8
|
|
|
9
|
+
<!-- package-metadata:start -->
|
|
10
|
+
<!-- Generated by scripts/generate-package-docs.mjs. Do not edit by hand. -->
|
|
11
|
+
|
|
9
12
|
Category: `operator-surface`
|
|
13
|
+
Tier: `core`
|
|
14
|
+
Catalog responsibility: Serves the always-on browser operator console for persistent multi-agent conversations, streamed turns, and local-device attachments.
|
|
15
|
+
|
|
16
|
+
<!-- package-metadata:end -->
|
|
10
17
|
|
|
11
18
|
## Responsibility
|
|
12
19
|
|
|
@@ -17,14 +24,37 @@ Category: `operator-surface`
|
|
|
17
24
|
`~/.mono-agent/web`.
|
|
18
25
|
- Keep an upstream turn running when a browser reloads or disconnects, and expose
|
|
19
26
|
state invalidations over SSE so any connected browser can catch up.
|
|
27
|
+
- Offer plain-text follow-ups to a capable active provider run, persist their
|
|
28
|
+
pending/applied/queued state, and promote safe fallbacks into normal turns.
|
|
29
|
+
- Render a running agent's structured `AskUser` interaction as one complete web
|
|
30
|
+
form and proxy validated answer submission back to that same model run.
|
|
20
31
|
- Accept browser-selected files through bounded staged uploads and forward the
|
|
21
32
|
exact transport-neutral `AgentAttachment` contract used by Telegram.
|
|
22
33
|
- Serve the assistant-ui PWA and its versioned JSON/SSE API.
|
|
34
|
+
- Accept explicit cron/webhook `web:new` notification delivery through an
|
|
35
|
+
owner-private, bearer-authenticated loopback ingress; persist one marked,
|
|
36
|
+
assistant-only conversation per distinct result only after agent history is
|
|
37
|
+
durably appended.
|
|
23
38
|
|
|
24
39
|
## Install / Usage
|
|
25
40
|
|
|
26
|
-
|
|
27
|
-
|
|
41
|
+
`@mono-agent/agent-app` provides the normal managed-service lifecycle:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
mono-agent web start
|
|
45
|
+
mono-agent web status
|
|
46
|
+
mono-agent web
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Bare `mono-agent web` reports status and usable URLs; it does not implicitly
|
|
50
|
+
start or mutate the service. Use `mono-agent web run` for a foreground process
|
|
51
|
+
or `--loopback` to bind only `127.0.0.1`.
|
|
52
|
+
|
|
53
|
+
Install this package directly only when embedding the server in another host:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
pnpm add @mono-agent/web
|
|
57
|
+
```
|
|
28
58
|
|
|
29
59
|
```ts
|
|
30
60
|
import { startWebServer } from "@mono-agent/web";
|
|
@@ -57,12 +87,15 @@ consistent over localhost, LAN, and Tailscale.
|
|
|
57
87
|
The assistant-ui run-settings popover combines searchable model selection with
|
|
58
88
|
the selected model's supported reasoning-effort choices and becomes a
|
|
59
89
|
viewport-safe bottom sheet on narrow screens. Usage telemetry remains internal
|
|
60
|
-
and is summarized through a context display that keeps
|
|
61
|
-
request
|
|
62
|
-
conversation cost.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
90
|
+
and is summarized through a context display that keeps exact Pi, Codex, and
|
|
91
|
+
OpenCode provider-request snapshots separate from last-turn processed tokens and
|
|
92
|
+
conversation cost. Running turns are labeled `Updating`; failed turns and model
|
|
93
|
+
changes are `Last measured`. A running or successful compaction suppresses the
|
|
94
|
+
older number until the next exact snapshot, while legacy and unsupported-runtime
|
|
95
|
+
threads show `Context —` instead of deriving a percentage from aggregate work.
|
|
96
|
+
Structured reasoning, routine tools, and one update-in-place row per compaction
|
|
97
|
+
share the stream-aware Activity disclosure, which collapses at every terminal
|
|
98
|
+
message state without reordering answer parts.
|
|
66
99
|
Typing `/` in an empty composer opens the available command triggers.
|
|
67
100
|
|
|
68
101
|
Select rendered message text to quote it into the composer. One quote is kept
|
|
@@ -71,15 +104,80 @@ blockquote context; it does not rewrite the visible message text. The public
|
|
|
71
104
|
turn DTO exposes this as `quote: { text, messageId }`, and the source message
|
|
72
105
|
must belong to the same thread.
|
|
73
106
|
|
|
107
|
+
The composer remains sendable while a response is running. A text-only send is
|
|
108
|
+
persisted immediately and offered to the active provider as live guidance. Its
|
|
109
|
+
message shows `pending`, `applied`, `queued`, or `cancelled`; an unsupported
|
|
110
|
+
provider, delivery failure, end-of-turn race, or web-service restart queues it
|
|
111
|
+
as the next normal turn instead of dropping it. Attachments keep the ordinary
|
|
112
|
+
turn path, and cancelling the active turn also cancels its pending or queued
|
|
113
|
+
live follow-ups. Live follow-ups are capped at 8,000 characters and 100
|
|
114
|
+
unsettled messages per thread.
|
|
115
|
+
|
|
74
116
|
The header bell explicitly enables browser notifications for successful
|
|
75
117
|
responses that arrive while the console is hidden or unfocused. Notifications
|
|
76
118
|
include a short response preview and open the exact conversation. Permission
|
|
77
119
|
is requested only from the bell, the preference is browser-origin-local, and
|
|
78
120
|
the page/PWA must remain alive: this is not a Web Push subscription and does
|
|
79
|
-
not notify after the application is fully closed.
|
|
121
|
+
not notify after the application is fully closed. Cron/webhook notification
|
|
122
|
+
threads use the same bell and are marked `CRON` / `WEBHOOK` in the sidebar,
|
|
123
|
+
header, and browser notification title.
|
|
124
|
+
|
|
125
|
+
An app-managed cron job or webhook endpoint can set `notify: true` with the
|
|
126
|
+
exact destination `notifyConversationId: "web:new"`. Each distinct result gets
|
|
127
|
+
a new thread without changing the selected thread. Delivery is idempotent,
|
|
128
|
+
best-effort, attempted once with a five-second bound, and has no outbox when the
|
|
129
|
+
web service is unavailable. Other `web:*` destinations are not accepted.
|
|
130
|
+
|
|
131
|
+
When the selected agent advertises `capabilities.askUser`, a running `AskUser`
|
|
132
|
+
tool call appears as one form containing all remaining questions. Each question
|
|
133
|
+
has two or three described choices plus an **Other** custom-reply field;
|
|
134
|
+
multi-select questions accept several choices and custom text. The browser
|
|
135
|
+
submits the form atomically and the agent resumes the existing run. Cancelling
|
|
136
|
+
the turn also cancels its pending form.
|
|
137
|
+
|
|
138
|
+
## Architecture
|
|
139
|
+
|
|
140
|
+
### Data flow
|
|
141
|
+
|
|
142
|
+
1. `server.ts` accepts the versioned browser API, staged uploads, and SSE
|
|
143
|
+
subscriptions, then delegates stateful work to `WebConsoleService`.
|
|
144
|
+
2. The service discovers agents from the trace-source registry, persists agent,
|
|
145
|
+
thread, message, part, turn, live-input, upload, and preference records through the
|
|
146
|
+
SQLite store, and drives each agent over its loopback operator endpoint.
|
|
147
|
+
3. Service mutations publish invalidations. Browsers consume `/api/v1/events`
|
|
148
|
+
and refetch authoritative projections, so reloads and concurrent tabs do not
|
|
149
|
+
own or interrupt upstream turns.
|
|
150
|
+
4. The bundled assistant-ui webapp maps those DTOs into its external store,
|
|
151
|
+
thread list, messages, composer, attachments, activity, and notification UI.
|
|
152
|
+
5. `deliverWebNotification` reads the owner-private live ingress record and
|
|
153
|
+
performs one bearer-authenticated loopback delivery. The service first
|
|
154
|
+
appends the result to agent history, then atomically exposes an idempotent
|
|
155
|
+
assistant-only cron or webhook thread.
|
|
156
|
+
|
|
157
|
+
### Package structure
|
|
158
|
+
|
|
159
|
+
| Source area | Responsibility |
|
|
160
|
+
| --- | --- |
|
|
161
|
+
| [`server.ts`](https://github.com/robertsreberski/mono-agent/blob/main/packages/web/src/server.ts) | HTTP service, `/api/v1` routes, uploads, SSE invalidations, host/origin checks, and static webapp serving. |
|
|
162
|
+
| [`service.ts`](https://github.com/robertsreberski/mono-agent/blob/main/packages/web/src/service.ts) | Application lifecycle for discovery, threads, turns, live-input delivery/fallback, attachments, `AskUser` snapshots/submission, cancellation, notifications, and invalidation. |
|
|
163
|
+
| [`store.ts`](https://github.com/robertsreberski/mono-agent/blob/main/packages/web/src/store.ts) | Owner-private SQLite schema and transactional persistence. |
|
|
164
|
+
| [`operator-client.ts`](https://github.com/robertsreberski/mono-agent/blob/main/packages/web/src/operator-client.ts) | Structured turn streaming, info/capabilities, live-input settlement, pending/submitted `AskUser`, cancellation, and durable history append over the operator protocol. |
|
|
165
|
+
| [`notification-client.ts`](https://github.com/robertsreberski/mono-agent/blob/main/packages/web/src/notification-client.ts) and [`notification-ingress.ts`](https://github.com/robertsreberski/mono-agent/blob/main/packages/web/src/notification-ingress.ts) | Bounded, authenticated cron/webhook notification delivery. |
|
|
166
|
+
| [`webapp/`](https://github.com/robertsreberski/mono-agent/tree/main/packages/web/webapp) | Isolated assistant-ui PWA, including atomic `AskUser` forms, tests, and its own dependency lockfile. |
|
|
80
167
|
|
|
81
168
|
## Public API
|
|
82
169
|
|
|
170
|
+
### Start here
|
|
171
|
+
|
|
172
|
+
| API | Use it for |
|
|
173
|
+
| --- | --- |
|
|
174
|
+
| `startWebServer` | Start the persistent browser service and receive the actual bound URL plus idempotent stop methods. |
|
|
175
|
+
| `prepareWebState` / `prepareWebStatePaths` | Create and validate the owner-private state layout before starting a custom service. |
|
|
176
|
+
| `resetWebState` | Perform the explicit whole-store reset used by host lifecycle commands. |
|
|
177
|
+
| `deliverWebNotification` | Deliver one idempotent cron/webhook result through the private loopback ingress. |
|
|
178
|
+
| `discoverOperatorAgents` | Read trusted operator endpoints from trace-source manifests. |
|
|
179
|
+
| `WebBootstrap`, `WebThreadDetail`, `WebEvent`, and related `Web*` DTOs | Build another client against the versioned browser API. |
|
|
180
|
+
|
|
83
181
|
<!-- public-api-inventory:start -->
|
|
84
182
|
<!-- Generated by scripts/generate-public-api-docs.mjs. Do not edit by hand. -->
|
|
85
183
|
|
|
@@ -92,16 +190,21 @@ CreateWebThreadInput
|
|
|
92
190
|
CreateWebUploadInput
|
|
93
191
|
DEFAULT_WEB_HOST
|
|
94
192
|
DEFAULT_WEB_PORT
|
|
193
|
+
DeliverWebNotificationInput
|
|
194
|
+
DeliverWebNotificationOptions
|
|
195
|
+
DeliverWebNotificationResult
|
|
95
196
|
DiscoverOperatorAgentsOptions
|
|
96
197
|
DiscoveredOperatorAgent
|
|
97
198
|
PatchWebAgentInput
|
|
98
199
|
PatchWebThreadInput
|
|
200
|
+
StartWebLiveInputInput
|
|
99
201
|
StartWebServerOptions
|
|
100
202
|
StartWebTurnInput
|
|
101
203
|
WEB_API_VERSION
|
|
102
204
|
WEB_MAX_ACTIVE_ATTACHMENT_TURN_BYTES
|
|
103
205
|
WEB_MAX_CONCURRENT_UPLOADS
|
|
104
206
|
WEB_MAX_FILES_PER_TURN
|
|
207
|
+
WEB_MAX_LIVE_INPUTS_PER_THREAD
|
|
105
208
|
WEB_MAX_QUEUED_ATTACHMENT_TURNS
|
|
106
209
|
WEB_MAX_STAGED_UPLOADS
|
|
107
210
|
WEB_MAX_STAGED_UPLOAD_BYTES
|
|
@@ -114,10 +217,12 @@ WebBootstrap
|
|
|
114
217
|
WebConsoleError
|
|
115
218
|
WebEvent
|
|
116
219
|
WebEventType
|
|
220
|
+
WebLiveInputReceipt
|
|
117
221
|
WebMessage
|
|
118
222
|
WebMessagePart
|
|
119
223
|
WebMessageStatus
|
|
120
224
|
WebModelOption
|
|
225
|
+
WebNotificationTriggerKind
|
|
121
226
|
WebQuote
|
|
122
227
|
WebRunState
|
|
123
228
|
WebRunStatus
|
|
@@ -126,8 +231,10 @@ WebStatePathOptions
|
|
|
126
231
|
WebStatePaths
|
|
127
232
|
WebThread
|
|
128
233
|
WebThreadDetail
|
|
234
|
+
WebThreadTrigger
|
|
129
235
|
defaultTraceRegistryDir
|
|
130
236
|
defaultWebStateDir
|
|
237
|
+
deliverWebNotification
|
|
131
238
|
discoverOperatorAgents
|
|
132
239
|
isTrustedOperatorBaseUrl
|
|
133
240
|
operatorBaseUrlFromMetadata
|
|
@@ -147,14 +254,24 @@ the actual bound address/port plus idempotent `stop()` and `close()` methods.
|
|
|
147
254
|
|
|
148
255
|
The browser API is rooted at `/api/v1`:
|
|
149
256
|
|
|
150
|
-
- `GET /bootstrap`, `PATCH /agents/:id`, and `GET/PATCH /threads/:id`
|
|
151
|
-
- `POST /threads`, `/threads/:id/turns`,
|
|
257
|
+
- `GET /bootstrap`, `PATCH /agents/:id`, and `GET/PATCH/DELETE /threads/:id`
|
|
258
|
+
- `POST /threads`, `/threads/:id/turns`, `/threads/:id/live-input`, and
|
|
259
|
+
`/threads/:id/cancel`
|
|
260
|
+
- `GET /threads/:id/ask` and `POST /threads/:id/ask` for the current structured
|
|
261
|
+
`AskUser` snapshot and atomic answer submission
|
|
152
262
|
- `POST /uploads`, `PUT/GET /uploads/:id/content`, and `DELETE /uploads/:id`
|
|
153
263
|
- `GET /events` (SSE)
|
|
154
264
|
|
|
155
265
|
`GET /healthz` is intentionally outside the versioned API for service probes.
|
|
156
266
|
`POST /threads/:id/turns` accepts optional
|
|
157
267
|
`quote: { text, messageId }` metadata in addition to the authored `text`.
|
|
268
|
+
`POST /threads/:id/live-input` accepts `{ text }` and returns a persisted message
|
|
269
|
+
with `disposition: "pending" | "queued"`; SSE invalidation exposes its later
|
|
270
|
+
`liveInputStatus` settlement.
|
|
271
|
+
Permanent deletion is limited to archived, inactive conversations. It removes
|
|
272
|
+
database descendants transactionally and deletes committed attachment files;
|
|
273
|
+
startup and scheduled cleanup remove any file orphaned by a crash or transient
|
|
274
|
+
filesystem failure after the database commit.
|
|
158
275
|
|
|
159
276
|
## Dependency Boundary
|
|
160
277
|
|
|
@@ -173,11 +290,18 @@ import a communication adapter or another operator surface.
|
|
|
173
290
|
- Agent runtime/provider execution or conversation history inside an agent.
|
|
174
291
|
- The operator-adapter HTTP server published by each agent.
|
|
175
292
|
- CLI background-process, launchd, or conflict-safe Tailscale Serve lifecycle.
|
|
176
|
-
-
|
|
293
|
+
- Recorded-run replay, which belongs to `@mono-agent/tui`.
|
|
177
294
|
- Authentication. Network reachability is the intentional security boundary.
|
|
178
295
|
- Host filesystem browsing: attachments come only from the browser device's
|
|
179
296
|
native file picker.
|
|
180
297
|
|
|
298
|
+
## Related Documentation
|
|
299
|
+
|
|
300
|
+
- [Always-on web console guide](https://mono-agent-docs.vercel.app/observability/web-console/)
|
|
301
|
+
- [Operator stream endpoint](https://mono-agent-docs.vercel.app/channels/tui/)
|
|
302
|
+
- [Sessions and concurrency](https://mono-agent-docs.vercel.app/runtime/sessions-concurrency/)
|
|
303
|
+
- [Artifacts and traces](https://mono-agent-docs.vercel.app/observability/artifacts-and-traces/)
|
|
304
|
+
|
|
181
305
|
## Verification
|
|
182
306
|
|
|
183
307
|
```sh
|
package/dist/contracts.d.ts
CHANGED
|
@@ -9,7 +9,12 @@ export declare const WEB_MAX_CONCURRENT_UPLOADS = 4;
|
|
|
9
9
|
export declare const WEB_MAX_ACTIVE_ATTACHMENT_TURN_BYTES: number;
|
|
10
10
|
export declare const WEB_MAX_QUEUED_ATTACHMENT_TURNS = 32;
|
|
11
11
|
export declare const WEB_MAX_TURN_TEXT_CHARACTERS = 200000;
|
|
12
|
+
export declare const WEB_MAX_LIVE_INPUTS_PER_THREAD = 100;
|
|
12
13
|
export type WebAgentStatus = "online" | "offline" | "degraded";
|
|
14
|
+
export type WebNotificationTriggerKind = "cron" | "webhook";
|
|
15
|
+
export interface WebThreadTrigger {
|
|
16
|
+
readonly kind: WebNotificationTriggerKind;
|
|
17
|
+
}
|
|
13
18
|
export interface WebModelOption {
|
|
14
19
|
readonly effortLevels?: readonly string[];
|
|
15
20
|
readonly reasoning?: boolean;
|
|
@@ -52,6 +57,7 @@ export interface WebThread {
|
|
|
52
57
|
readonly createdAt: string;
|
|
53
58
|
readonly updatedAt: string;
|
|
54
59
|
readonly revision: number;
|
|
60
|
+
readonly trigger?: WebThreadTrigger;
|
|
55
61
|
readonly lastMessagePreview?: string;
|
|
56
62
|
readonly messageCount: number;
|
|
57
63
|
readonly runState: WebRunState;
|
|
@@ -103,6 +109,7 @@ export interface WebMessage {
|
|
|
103
109
|
readonly createdAt: string;
|
|
104
110
|
readonly updatedAt: string;
|
|
105
111
|
readonly status: WebMessageStatus;
|
|
112
|
+
readonly liveInputStatus?: "pending" | "applied" | "queued" | "cancelled";
|
|
106
113
|
}
|
|
107
114
|
export interface WebQuote {
|
|
108
115
|
readonly text: string;
|
|
@@ -150,6 +157,13 @@ export interface StartWebTurnInput {
|
|
|
150
157
|
readonly model?: string;
|
|
151
158
|
readonly effort?: string;
|
|
152
159
|
}
|
|
160
|
+
export interface StartWebLiveInputInput {
|
|
161
|
+
readonly text: string;
|
|
162
|
+
}
|
|
163
|
+
export interface WebLiveInputReceipt {
|
|
164
|
+
readonly message: WebMessage;
|
|
165
|
+
readonly disposition: "pending" | "queued";
|
|
166
|
+
}
|
|
153
167
|
export interface CreateWebUploadInput {
|
|
154
168
|
readonly name: string;
|
|
155
169
|
readonly contentType: string;
|
package/dist/contracts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAEA,2DAA2D;AAC3D,eAAO,MAAM,eAAe,EAAG,CAAU,CAAC;AAE1C,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,eAAO,MAAM,6BAA6B,QAAmB,CAAC;AAC9D,eAAO,MAAM,wBAAwB,QAAsB,CAAC;AAC5D,eAAO,MAAM,2BAA2B,QAAoB,CAAC;AAC7D,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAC1C,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAC5C,eAAO,MAAM,oCAAoC,QAAmB,CAAC;AACrE,eAAO,MAAM,+BAA+B,KAAK,CAAC;AAClD,eAAO,MAAM,4BAA4B,SAAU,CAAC;AACpD,eAAO,MAAM,8BAA8B,MAAgC,CAAC;AAE5E,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;AAC/D,MAAM,MAAM,0BAA0B,GAAG,MAAM,GAAG,SAAS,CAAC;AAE5D,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,0BAA0B,CAAC;CAC3C;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACx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/agent-contracts";
|
|
1
2
|
/** Version of the browser-facing JSON and SSE contract. */
|
|
2
3
|
export const WEB_API_VERSION = 1;
|
|
3
4
|
export const WEB_MAX_FILES_PER_TURN = 10;
|
|
@@ -9,4 +10,5 @@ export const WEB_MAX_CONCURRENT_UPLOADS = 4;
|
|
|
9
10
|
export const WEB_MAX_ACTIVE_ATTACHMENT_TURN_BYTES = 64 * 1024 * 1024;
|
|
10
11
|
export const WEB_MAX_QUEUED_ATTACHMENT_TURNS = 32;
|
|
11
12
|
export const WEB_MAX_TURN_TEXT_CHARACTERS = 200_000;
|
|
13
|
+
export const WEB_MAX_LIVE_INPUTS_PER_THREAD = AGENT_LIVE_INPUT_MAX_MESSAGES;
|
|
12
14
|
//# sourceMappingURL=contracts.js.map
|
package/dist/contracts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,MAAM,CAAC,MAAM,eAAe,GAAG,CAAU,CAAC;AAE1C,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AACzC,MAAM,CAAC,MAAM,6BAA6B,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAC9D,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAC5D,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC;AAC7D,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAC1C,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC;AAC5C,MAAM,CAAC,MAAM,oCAAoC,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AACrE,MAAM,CAAC,MAAM,+BAA+B,GAAG,EAAE,CAAC;AAClD,MAAM,CAAC,MAAM,4BAA4B,GAAG,OAAO,CAAC"}
|
|
1
|
+
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAE5E,2DAA2D;AAC3D,MAAM,CAAC,MAAM,eAAe,GAAG,CAAU,CAAC;AAE1C,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AACzC,MAAM,CAAC,MAAM,6BAA6B,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAC9D,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAC5D,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC;AAC7D,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAC1C,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC;AAC5C,MAAM,CAAC,MAAM,oCAAoC,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AACrE,MAAM,CAAC,MAAM,+BAA+B,GAAG,EAAE,CAAC;AAClD,MAAM,CAAC,MAAM,4BAA4B,GAAG,OAAO,CAAC;AACpD,MAAM,CAAC,MAAM,8BAA8B,GAAG,6BAA6B,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,9 +6,11 @@ export { DEFAULT_WEB_HOST, DEFAULT_WEB_PORT, startWebServer, } from "./server.js
|
|
|
6
6
|
export type { StartWebServerOptions, WebServerHandle } from "./server.js";
|
|
7
7
|
export { defaultWebStateDir, prepareWebState, prepareWebStatePaths, resetWebState, resolveWebStatePaths, } from "./state-paths.js";
|
|
8
8
|
export type { WebStatePathOptions, WebStatePaths } from "./state-paths.js";
|
|
9
|
+
export { deliverWebNotification } from "./notification-client.js";
|
|
10
|
+
export type { DeliverWebNotificationInput, DeliverWebNotificationOptions, DeliverWebNotificationResult, } from "./notification-client.js";
|
|
9
11
|
export { defaultTraceRegistryDir, discoverOperatorAgents, isTrustedOperatorBaseUrl, operatorBaseUrlFromMetadata, } from "./discovery.js";
|
|
10
12
|
export type { DiscoverOperatorAgentsOptions, DiscoveredOperatorAgent, } from "./discovery.js";
|
|
11
|
-
export { WEB_API_VERSION, WEB_MAX_CONCURRENT_UPLOADS, WEB_MAX_ACTIVE_ATTACHMENT_TURN_BYTES, WEB_MAX_FILES_PER_TURN, WEB_MAX_STAGED_UPLOAD_BYTES, WEB_MAX_STAGED_UPLOADS, WEB_MAX_QUEUED_ATTACHMENT_TURNS, WEB_MAX_TURN_ATTACHMENT_BYTES, WEB_STAGED_UPLOAD_TTL_MS, } from "./contracts.js";
|
|
12
|
-
export type { CreateWebThreadInput, CreateWebUploadInput, PatchWebAgentInput, PatchWebThreadInput, StartWebTurnInput, WebAgentStatus, WebAgentSummary, WebAttachment, WebBootstrap, WebEvent, WebEventType, WebMessage, WebMessagePart, WebMessageStatus, WebModelOption, WebQuote, WebRunState, WebRunStatus, WebThread, WebThreadDetail, } from "./contracts.js";
|
|
13
|
+
export { WEB_API_VERSION, WEB_MAX_CONCURRENT_UPLOADS, WEB_MAX_ACTIVE_ATTACHMENT_TURN_BYTES, WEB_MAX_FILES_PER_TURN, WEB_MAX_LIVE_INPUTS_PER_THREAD, WEB_MAX_STAGED_UPLOAD_BYTES, WEB_MAX_STAGED_UPLOADS, WEB_MAX_QUEUED_ATTACHMENT_TURNS, WEB_MAX_TURN_ATTACHMENT_BYTES, WEB_STAGED_UPLOAD_TTL_MS, } from "./contracts.js";
|
|
14
|
+
export type { CreateWebThreadInput, CreateWebUploadInput, PatchWebAgentInput, PatchWebThreadInput, StartWebLiveInputInput, StartWebTurnInput, WebAgentStatus, WebAgentSummary, WebAttachment, WebBootstrap, WebEvent, WebEventType, WebLiveInputReceipt, WebMessage, WebMessagePart, WebMessageStatus, WebModelOption, WebNotificationTriggerKind, WebQuote, WebRunState, WebRunStatus, WebThread, WebThreadDetail, WebThreadTrigger, } from "./contracts.js";
|
|
13
15
|
export { WebConsoleError } from "./errors.js";
|
|
14
16
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,GACf,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE1E,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EACpB,aAAa,EACb,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE3E,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,wBAAwB,EACxB,2BAA2B,GAC5B,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,6BAA6B,EAC7B,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,eAAe,EACf,0BAA0B,EAC1B,oCAAoC,EACpC,sBAAsB,EACtB,2BAA2B,EAC3B,sBAAsB,EACtB,+BAA+B,EAC/B,6BAA6B,EAC7B,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,aAAa,EACb,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,SAAS,EACT,eAAe,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,gBAAgB,EAChB,gBAAgB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_HOST, DEFAULT_WEB_PORT, startWebServer, } from "./server.js";
|
|
6
6
|
export { defaultWebStateDir, prepareWebState, prepareWebStatePaths, resetWebState, resolveWebStatePaths, } from "./state-paths.js";
|
|
7
|
+
export { deliverWebNotification } from "./notification-client.js";
|
|
7
8
|
export { defaultTraceRegistryDir, discoverOperatorAgents, isTrustedOperatorBaseUrl, operatorBaseUrlFromMetadata, } from "./discovery.js";
|
|
8
|
-
export { WEB_API_VERSION, WEB_MAX_CONCURRENT_UPLOADS, WEB_MAX_ACTIVE_ATTACHMENT_TURN_BYTES, WEB_MAX_FILES_PER_TURN, WEB_MAX_STAGED_UPLOAD_BYTES, WEB_MAX_STAGED_UPLOADS, WEB_MAX_QUEUED_ATTACHMENT_TURNS, WEB_MAX_TURN_ATTACHMENT_BYTES, WEB_STAGED_UPLOAD_TTL_MS, } from "./contracts.js";
|
|
9
|
+
export { WEB_API_VERSION, WEB_MAX_CONCURRENT_UPLOADS, WEB_MAX_ACTIVE_ATTACHMENT_TURN_BYTES, WEB_MAX_FILES_PER_TURN, WEB_MAX_LIVE_INPUTS_PER_THREAD, WEB_MAX_STAGED_UPLOAD_BYTES, WEB_MAX_STAGED_UPLOADS, WEB_MAX_QUEUED_ATTACHMENT_TURNS, WEB_MAX_TURN_ATTACHMENT_BYTES, WEB_STAGED_UPLOAD_TTL_MS, } from "./contracts.js";
|
|
9
10
|
export { WebConsoleError } from "./errors.js";
|
|
10
11
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,GACf,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EACpB,aAAa,EACb,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,wBAAwB,EACxB,2BAA2B,GAC5B,MAAM,gBAAgB,CAAC;AAMxB,OAAO,EACL,eAAe,EACf,0BAA0B,EAC1B,oCAAoC,EACpC,sBAAsB,EACtB,2BAA2B,EAC3B,sBAAsB,EACtB,+BAA+B,EAC/B,6BAA6B,EAC7B,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,GACf,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EACpB,aAAa,EACb,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAOlE,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,wBAAwB,EACxB,2BAA2B,GAC5B,MAAM,gBAAgB,CAAC;AAMxB,OAAO,EACL,eAAe,EACf,0BAA0B,EAC1B,oCAAoC,EACpC,sBAAsB,EACtB,8BAA8B,EAC9B,2BAA2B,EAC3B,sBAAsB,EACtB,+BAA+B,EAC/B,6BAA6B,EAC7B,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AA4BxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { WebNotificationTriggerKind } from "./contracts.js";
|
|
2
|
+
import { type WebStatePathOptions } from "./state-paths.js";
|
|
3
|
+
export interface DeliverWebNotificationInput {
|
|
4
|
+
readonly sourceId: string;
|
|
5
|
+
readonly triggerKind: WebNotificationTriggerKind;
|
|
6
|
+
readonly deliveryKey: string;
|
|
7
|
+
readonly text: string;
|
|
8
|
+
}
|
|
9
|
+
export interface DeliverWebNotificationOptions extends WebStatePathOptions {
|
|
10
|
+
readonly fetchImpl?: typeof fetch;
|
|
11
|
+
readonly timeoutMs?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface DeliverWebNotificationResult {
|
|
14
|
+
readonly threadId: string;
|
|
15
|
+
readonly duplicate: boolean;
|
|
16
|
+
}
|
|
17
|
+
/** Deliver once to the active local web console. There is intentionally no retry or outbox. */
|
|
18
|
+
export declare function deliverWebNotification(input: DeliverWebNotificationInput, options?: DeliverWebNotificationOptions): Promise<DeliverWebNotificationResult>;
|
|
19
|
+
//# sourceMappingURL=notification-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-client.d.ts","sourceRoot":"","sources":["../src/notification-client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAEjE,OAAO,EAAwB,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAQlF,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,0BAA0B,CAAC;IACjD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,6BAA8B,SAAQ,mBAAmB;IACxE,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IAClC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B;AAWD,+FAA+F;AAC/F,wBAAsB,sBAAsB,CAC1C,KAAK,EAAE,2BAA2B,EAClC,OAAO,GAAE,6BAAkC,GAC1C,OAAO,CAAC,4BAA4B,CAAC,CA0CvC"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { constants as fsConstants } from "node:fs";
|
|
2
|
+
import { lstat, open } from "node:fs/promises";
|
|
3
|
+
import { errorMessage, WebConsoleError } from "./errors.js";
|
|
4
|
+
import { resolveWebStatePaths } from "./state-paths.js";
|
|
5
|
+
const NOTIFICATION_INGRESS_SCHEMA = 1;
|
|
6
|
+
const NOTIFICATION_INGRESS_PATH = "/internal/v1/notifications";
|
|
7
|
+
const MAX_INGRESS_RECORD_BYTES = 64 * 1024;
|
|
8
|
+
const MAX_RESPONSE_BYTES = 64 * 1024;
|
|
9
|
+
const DEFAULT_TIMEOUT_MS = 5_000;
|
|
10
|
+
/** Deliver once to the active local web console. There is intentionally no retry or outbox. */
|
|
11
|
+
export async function deliverWebNotification(input, options = {}) {
|
|
12
|
+
const path = resolveWebStatePaths(options).notificationIngress;
|
|
13
|
+
const ingress = await readIngressRecord(path);
|
|
14
|
+
const fetchImpl = options.fetchImpl ?? fetch;
|
|
15
|
+
let response;
|
|
16
|
+
try {
|
|
17
|
+
response = await fetchImpl(ingress.url, {
|
|
18
|
+
method: "POST",
|
|
19
|
+
redirect: "error",
|
|
20
|
+
signal: AbortSignal.timeout(options.timeoutMs ?? DEFAULT_TIMEOUT_MS),
|
|
21
|
+
headers: {
|
|
22
|
+
authorization: `Bearer ${ingress.token}`,
|
|
23
|
+
"content-type": "application/json",
|
|
24
|
+
},
|
|
25
|
+
body: JSON.stringify(input),
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
throw new WebConsoleError("notification_ingress_unavailable", `The web notification ingress is unavailable (${errorMessage(error)}).`, 503);
|
|
30
|
+
}
|
|
31
|
+
const bodyText = await readBoundedResponse(response);
|
|
32
|
+
if (!response.ok) {
|
|
33
|
+
throw new WebConsoleError("notification_delivery_failed", `The web notification ingress responded ${String(response.status)}${bodyText.length === 0 ? "." : `: ${bodyText.slice(0, 300)}`}`, 502);
|
|
34
|
+
}
|
|
35
|
+
let parsed;
|
|
36
|
+
try {
|
|
37
|
+
parsed = JSON.parse(bodyText);
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
throw new WebConsoleError("invalid_notification_response", "The web notification ingress returned invalid JSON.", 502);
|
|
41
|
+
}
|
|
42
|
+
const result = asRecord(parsed);
|
|
43
|
+
if (result === undefined || typeof result.threadId !== "string" || typeof result.duplicate !== "boolean") {
|
|
44
|
+
throw new WebConsoleError("invalid_notification_response", "The web notification ingress returned an invalid result.", 502);
|
|
45
|
+
}
|
|
46
|
+
return { threadId: result.threadId, duplicate: result.duplicate };
|
|
47
|
+
}
|
|
48
|
+
async function readIngressRecord(path) {
|
|
49
|
+
const info = await lstat(path).catch(() => undefined);
|
|
50
|
+
const currentUid = typeof process.getuid === "function" ? process.getuid() : undefined;
|
|
51
|
+
if (info === undefined || !info.isFile() || info.isSymbolicLink()
|
|
52
|
+
|| info.size <= 0 || info.size > MAX_INGRESS_RECORD_BYTES
|
|
53
|
+
|| (currentUid !== undefined && info.uid !== currentUid)
|
|
54
|
+
|| (info.mode & 0o077) !== 0) {
|
|
55
|
+
throw new WebConsoleError("notification_ingress_unavailable", "The owner-private web notification ingress record is unavailable.", 503);
|
|
56
|
+
}
|
|
57
|
+
const handle = await open(path, fsConstants.O_RDONLY | (fsConstants.O_NOFOLLOW ?? 0));
|
|
58
|
+
let contents;
|
|
59
|
+
try {
|
|
60
|
+
const opened = await handle.stat();
|
|
61
|
+
if (!opened.isFile() || opened.dev !== info.dev || opened.ino !== info.ino || opened.size !== info.size) {
|
|
62
|
+
throw new WebConsoleError("notification_ingress_unavailable", "The web notification ingress record changed while opening.", 503);
|
|
63
|
+
}
|
|
64
|
+
contents = await handle.readFile("utf8");
|
|
65
|
+
}
|
|
66
|
+
finally {
|
|
67
|
+
await handle.close();
|
|
68
|
+
}
|
|
69
|
+
let parsed;
|
|
70
|
+
try {
|
|
71
|
+
parsed = JSON.parse(contents);
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
throw new WebConsoleError("notification_ingress_unavailable", "The web notification ingress record is invalid.", 503);
|
|
75
|
+
}
|
|
76
|
+
const record = asRecord(parsed);
|
|
77
|
+
if (record === undefined
|
|
78
|
+
|| record.schema !== NOTIFICATION_INGRESS_SCHEMA
|
|
79
|
+
|| !Number.isSafeInteger(record.pid) || record.pid <= 0
|
|
80
|
+
|| typeof record.instanceId !== "string" || record.instanceId.length === 0 || record.instanceId.length > 128
|
|
81
|
+
|| typeof record.url !== "string"
|
|
82
|
+
|| typeof record.token !== "string" || record.token.length < 32 || record.token.length > 256
|
|
83
|
+
|| typeof record.updatedAt !== "string" || !Number.isFinite(Date.parse(record.updatedAt))) {
|
|
84
|
+
throw new WebConsoleError("notification_ingress_unavailable", "The web notification ingress record is invalid.", 503);
|
|
85
|
+
}
|
|
86
|
+
assertTrustedIngressUrl(record.url);
|
|
87
|
+
return record;
|
|
88
|
+
}
|
|
89
|
+
function assertTrustedIngressUrl(value) {
|
|
90
|
+
let url;
|
|
91
|
+
try {
|
|
92
|
+
url = new URL(value);
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
throw new WebConsoleError("notification_ingress_unavailable", "The web notification ingress URL is invalid.", 503);
|
|
96
|
+
}
|
|
97
|
+
if (url.protocol !== "http:"
|
|
98
|
+
|| url.hostname !== "127.0.0.1"
|
|
99
|
+
|| url.port.length === 0
|
|
100
|
+
|| url.pathname !== NOTIFICATION_INGRESS_PATH
|
|
101
|
+
|| url.search.length > 0
|
|
102
|
+
|| url.hash.length > 0
|
|
103
|
+
|| url.username.length > 0
|
|
104
|
+
|| url.password.length > 0) {
|
|
105
|
+
throw new WebConsoleError("notification_ingress_unavailable", "The web notification ingress URL is not trusted.", 503);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
async function readBoundedResponse(response) {
|
|
109
|
+
if (response.body === null)
|
|
110
|
+
return "";
|
|
111
|
+
const reader = response.body.getReader();
|
|
112
|
+
const chunks = [];
|
|
113
|
+
let total = 0;
|
|
114
|
+
try {
|
|
115
|
+
for (;;) {
|
|
116
|
+
const { done, value } = await reader.read();
|
|
117
|
+
if (done)
|
|
118
|
+
break;
|
|
119
|
+
total += value.byteLength;
|
|
120
|
+
if (total > MAX_RESPONSE_BYTES) {
|
|
121
|
+
throw new WebConsoleError("invalid_notification_response", "The web notification response is too large.", 502);
|
|
122
|
+
}
|
|
123
|
+
chunks.push(value);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
finally {
|
|
127
|
+
await reader.cancel().catch(() => undefined);
|
|
128
|
+
}
|
|
129
|
+
return Buffer.concat(chunks.map((chunk) => Buffer.from(chunk)), total).toString("utf8");
|
|
130
|
+
}
|
|
131
|
+
function asRecord(value) {
|
|
132
|
+
return typeof value === "object" && value !== null && !Array.isArray(value)
|
|
133
|
+
? value
|
|
134
|
+
: undefined;
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=notification-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-client.js","sourceRoot":"","sources":["../src/notification-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAG/C,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAA4B,MAAM,kBAAkB,CAAC;AAElF,MAAM,2BAA2B,GAAG,CAAC,CAAC;AACtC,MAAM,yBAAyB,GAAG,4BAA4B,CAAC;AAC/D,MAAM,wBAAwB,GAAG,EAAE,GAAG,IAAI,CAAC;AAC3C,MAAM,kBAAkB,GAAG,EAAE,GAAG,IAAI,CAAC;AACrC,MAAM,kBAAkB,GAAG,KAAK,CAAC;AA4BjC,+FAA+F;AAC/F,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,KAAkC,EAClC,UAAyC,EAAE;IAE3C,MAAM,IAAI,GAAG,o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;
|
|
3
|
+
export interface WebNotificationIngressRecord {
|
|
4
|
+
readonly schema: typeof INGRESS_SCHEMA;
|
|
5
|
+
readonly pid: number;
|
|
6
|
+
readonly instanceId: string;
|
|
7
|
+
readonly url: string;
|
|
8
|
+
readonly token: string;
|
|
9
|
+
readonly updatedAt: string;
|
|
10
|
+
}
|
|
11
|
+
export interface WebNotificationIngressHandle {
|
|
12
|
+
readonly url: string;
|
|
13
|
+
stop(): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
export declare function startWebNotificationIngress(service: WebService, logger?: WebServiceLogger): Promise<WebNotificationIngressHandle>;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=notification-ingress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-ingress.d.ts","sourceRoot":"","sources":["../src/notification-ingress.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEjE,QAAA,MAAM,cAAc,IAAI,CAAC;AAMzB,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,MAAM,EAAE,OAAO,cAAc,CAAC;IACvC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AAED,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,UAAU,EACnB,MAAM,CAAC,EAAE,gBAAgB,GACxB,OAAO,CAAC,4BAA4B,CAAC,CAmGvC"}
|