@mono-agent/web 0.12.0 → 0.14.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 +132 -14
- package/dist/contracts.d.ts +12 -0
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +1 -0
- package/dist/contracts.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- 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 +6 -1
- package/dist/operator-client.d.ts.map +1 -1
- package/dist/operator-client.js +30 -0
- package/dist/operator-client.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +40 -2
- package/dist/server.js.map +1 -1
- package/dist/service.d.ts +17 -1
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +78 -5
- 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 +20 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +186 -10
- package/dist/store.js.map +1 -1
- package/package.json +4 -4
- package/webapp/dist/assets/assistant-ui-DTnHvSvW.js +70 -0
- package/webapp/dist/assets/index-BpHUwRCC.css +1 -0
- package/webapp/dist/assets/index-DpEe0YWc.js +47 -0
- package/webapp/dist/assets/{markdown-qFW9VWmB.js → markdown-DxoHTsvM.js} +1 -1
- package/webapp/dist/index.html +4 -4
- package/webapp/dist/notification-sw.js +16 -0
- package/webapp/dist/sw.js +1 -1
- package/webapp/dist/assets/assistant-ui-CU4gqU0g.js +0 -70
- package/webapp/dist/assets/index-Ck3BY0Ti.js +0 -47
- package/webapp/dist/assets/index-CoB6Xwh-.css +0 -1
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,35 @@ 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
|
+
- Render a running agent's structured `AskUser` interaction as one complete web
|
|
28
|
+
form and proxy validated answer submission back to that same model run.
|
|
20
29
|
- Accept browser-selected files through bounded staged uploads and forward the
|
|
21
30
|
exact transport-neutral `AgentAttachment` contract used by Telegram.
|
|
22
31
|
- Serve the assistant-ui PWA and its versioned JSON/SSE API.
|
|
32
|
+
- Accept explicit cron/webhook `web:new` notification delivery through an
|
|
33
|
+
owner-private, bearer-authenticated loopback ingress; persist one marked,
|
|
34
|
+
assistant-only conversation per distinct result only after agent history is
|
|
35
|
+
durably appended.
|
|
23
36
|
|
|
24
37
|
## Install / Usage
|
|
25
38
|
|
|
26
|
-
|
|
27
|
-
|
|
39
|
+
`@mono-agent/agent-app` provides the normal managed-service lifecycle:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
mono-agent web start
|
|
43
|
+
mono-agent web status
|
|
44
|
+
mono-agent web
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Bare `mono-agent web` reports status and usable URLs; it does not implicitly
|
|
48
|
+
start or mutate the service. Use `mono-agent web run` for a foreground process
|
|
49
|
+
or `--loopback` to bind only `127.0.0.1`.
|
|
50
|
+
|
|
51
|
+
Install this package directly only when embedding the server in another host:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
pnpm add @mono-agent/web
|
|
55
|
+
```
|
|
28
56
|
|
|
29
57
|
```ts
|
|
30
58
|
import { startWebServer } from "@mono-agent/web";
|
|
@@ -46,25 +74,96 @@ Tailscale DNS name); suffix wildcards are intentionally not trusted. When a
|
|
|
46
74
|
managed agent protects its loopback operator endpoint, discovery reads only
|
|
47
75
|
`MONO_AGENT_TUI_API_KEY` from that agent's attested, owner-owned dotenv file.
|
|
48
76
|
|
|
49
|
-
On desktop,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
77
|
+
On desktop, the agent rail has fixed compact and expanded layouts selected by
|
|
78
|
+
an explicit expand/collapse control. That choice is remembered by the browser.
|
|
79
|
+
Offline agents are hidden behind a subtle count by default; pinned agents and
|
|
80
|
+
the currently selected agent remain visible even while offline. The same
|
|
81
|
+
filter applies to the desktop rail, mobile picker, and command palette. Pin or
|
|
82
|
+
unpin with the star control; pins live in the web service so favorites stay
|
|
83
|
+
consistent over localhost, LAN, and Tailscale.
|
|
56
84
|
|
|
57
85
|
The assistant-ui run-settings popover combines searchable model selection with
|
|
58
86
|
the selected model's supported reasoning-effort choices and becomes a
|
|
59
87
|
viewport-safe bottom sheet on narrow screens. Usage telemetry remains internal
|
|
60
|
-
and is summarized through a context display that
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
88
|
+
and is summarized through a context display that keeps the final provider
|
|
89
|
+
request's exact context snapshot separate from last-turn processed tokens and
|
|
90
|
+
conversation cost. Exact snapshots can decrease after compaction; legacy threads
|
|
91
|
+
show `Context —` instead of deriving a percentage from aggregate work. Structured
|
|
92
|
+
reasoning and routine tools share one stream-aware Activity disclosure that
|
|
93
|
+
collapses at every terminal message state without reordering answer parts.
|
|
64
94
|
Typing `/` in an empty composer opens the available command triggers.
|
|
65
95
|
|
|
96
|
+
Select rendered message text to quote it into the composer. One quote is kept
|
|
97
|
+
with the authored user message and supplied to the operator as Markdown
|
|
98
|
+
blockquote context; it does not rewrite the visible message text. The public
|
|
99
|
+
turn DTO exposes this as `quote: { text, messageId }`, and the source message
|
|
100
|
+
must belong to the same thread.
|
|
101
|
+
|
|
102
|
+
The header bell explicitly enables browser notifications for successful
|
|
103
|
+
responses that arrive while the console is hidden or unfocused. Notifications
|
|
104
|
+
include a short response preview and open the exact conversation. Permission
|
|
105
|
+
is requested only from the bell, the preference is browser-origin-local, and
|
|
106
|
+
the page/PWA must remain alive: this is not a Web Push subscription and does
|
|
107
|
+
not notify after the application is fully closed. Cron/webhook notification
|
|
108
|
+
threads use the same bell and are marked `CRON` / `WEBHOOK` in the sidebar,
|
|
109
|
+
header, and browser notification title.
|
|
110
|
+
|
|
111
|
+
An app-managed cron job or webhook endpoint can set `notify: true` with the
|
|
112
|
+
exact destination `notifyConversationId: "web:new"`. Each distinct result gets
|
|
113
|
+
a new thread without changing the selected thread. Delivery is idempotent,
|
|
114
|
+
best-effort, attempted once with a five-second bound, and has no outbox when the
|
|
115
|
+
web service is unavailable. Other `web:*` destinations are not accepted.
|
|
116
|
+
|
|
117
|
+
When the selected agent advertises `capabilities.askUser`, a running `AskUser`
|
|
118
|
+
tool call appears as one form containing all remaining questions. Each question
|
|
119
|
+
has two or three described choices plus an **Other** custom-reply field;
|
|
120
|
+
multi-select questions accept several choices and custom text. The browser
|
|
121
|
+
submits the form atomically and the agent resumes the existing run. Cancelling
|
|
122
|
+
the turn also cancels its pending form.
|
|
123
|
+
|
|
124
|
+
## Architecture
|
|
125
|
+
|
|
126
|
+
### Data flow
|
|
127
|
+
|
|
128
|
+
1. `server.ts` accepts the versioned browser API, staged uploads, and SSE
|
|
129
|
+
subscriptions, then delegates stateful work to `WebConsoleService`.
|
|
130
|
+
2. The service discovers agents from the trace-source registry, persists agent,
|
|
131
|
+
thread, message, part, turn, upload, and preference records through the
|
|
132
|
+
SQLite store, and drives each agent over its loopback operator endpoint.
|
|
133
|
+
3. Service mutations publish invalidations. Browsers consume `/api/v1/events`
|
|
134
|
+
and refetch authoritative projections, so reloads and concurrent tabs do not
|
|
135
|
+
own or interrupt upstream turns.
|
|
136
|
+
4. The bundled assistant-ui webapp maps those DTOs into its external store,
|
|
137
|
+
thread list, messages, composer, attachments, activity, and notification UI.
|
|
138
|
+
5. `deliverWebNotification` reads the owner-private live ingress record and
|
|
139
|
+
performs one bearer-authenticated loopback delivery. The service first
|
|
140
|
+
appends the result to agent history, then atomically exposes an idempotent
|
|
141
|
+
assistant-only cron or webhook thread.
|
|
142
|
+
|
|
143
|
+
### Package structure
|
|
144
|
+
|
|
145
|
+
| Source area | Responsibility |
|
|
146
|
+
| --- | --- |
|
|
147
|
+
| [`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. |
|
|
148
|
+
| [`service.ts`](https://github.com/robertsreberski/mono-agent/blob/main/packages/web/src/service.ts) | Application lifecycle for discovery, threads, turns, attachments, `AskUser` snapshots/submission, cancellation, notifications, and invalidation. |
|
|
149
|
+
| [`store.ts`](https://github.com/robertsreberski/mono-agent/blob/main/packages/web/src/store.ts) | Owner-private SQLite schema and transactional persistence. |
|
|
150
|
+
| [`operator-client.ts`](https://github.com/robertsreberski/mono-agent/blob/main/packages/web/src/operator-client.ts) | Structured turn streaming, info, pending/submitted `AskUser`, cancellation, and durable history append over the operator protocol. |
|
|
151
|
+
| [`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. |
|
|
152
|
+
| [`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. |
|
|
153
|
+
|
|
66
154
|
## Public API
|
|
67
155
|
|
|
156
|
+
### Start here
|
|
157
|
+
|
|
158
|
+
| API | Use it for |
|
|
159
|
+
| --- | --- |
|
|
160
|
+
| `startWebServer` | Start the persistent browser service and receive the actual bound URL plus idempotent stop methods. |
|
|
161
|
+
| `prepareWebState` / `prepareWebStatePaths` | Create and validate the owner-private state layout before starting a custom service. |
|
|
162
|
+
| `resetWebState` | Perform the explicit whole-store reset used by host lifecycle commands. |
|
|
163
|
+
| `deliverWebNotification` | Deliver one idempotent cron/webhook result through the private loopback ingress. |
|
|
164
|
+
| `discoverOperatorAgents` | Read trusted operator endpoints from trace-source manifests. |
|
|
165
|
+
| `WebBootstrap`, `WebThreadDetail`, `WebEvent`, and related `Web*` DTOs | Build another client against the versioned browser API. |
|
|
166
|
+
|
|
68
167
|
<!-- public-api-inventory:start -->
|
|
69
168
|
<!-- Generated by scripts/generate-public-api-docs.mjs. Do not edit by hand. -->
|
|
70
169
|
|
|
@@ -77,6 +176,9 @@ CreateWebThreadInput
|
|
|
77
176
|
CreateWebUploadInput
|
|
78
177
|
DEFAULT_WEB_HOST
|
|
79
178
|
DEFAULT_WEB_PORT
|
|
179
|
+
DeliverWebNotificationInput
|
|
180
|
+
DeliverWebNotificationOptions
|
|
181
|
+
DeliverWebNotificationResult
|
|
80
182
|
DiscoverOperatorAgentsOptions
|
|
81
183
|
DiscoveredOperatorAgent
|
|
82
184
|
PatchWebAgentInput
|
|
@@ -103,6 +205,8 @@ WebMessage
|
|
|
103
205
|
WebMessagePart
|
|
104
206
|
WebMessageStatus
|
|
105
207
|
WebModelOption
|
|
208
|
+
WebNotificationTriggerKind
|
|
209
|
+
WebQuote
|
|
106
210
|
WebRunState
|
|
107
211
|
WebRunStatus
|
|
108
212
|
WebServerHandle
|
|
@@ -110,8 +214,10 @@ WebStatePathOptions
|
|
|
110
214
|
WebStatePaths
|
|
111
215
|
WebThread
|
|
112
216
|
WebThreadDetail
|
|
217
|
+
WebThreadTrigger
|
|
113
218
|
defaultTraceRegistryDir
|
|
114
219
|
defaultWebStateDir
|
|
220
|
+
deliverWebNotification
|
|
115
221
|
discoverOperatorAgents
|
|
116
222
|
isTrustedOperatorBaseUrl
|
|
117
223
|
operatorBaseUrlFromMetadata
|
|
@@ -133,10 +239,14 @@ The browser API is rooted at `/api/v1`:
|
|
|
133
239
|
|
|
134
240
|
- `GET /bootstrap`, `PATCH /agents/:id`, and `GET/PATCH /threads/:id`
|
|
135
241
|
- `POST /threads`, `/threads/:id/turns`, and `/threads/:id/cancel`
|
|
242
|
+
- `GET /threads/:id/ask` and `POST /threads/:id/ask` for the current structured
|
|
243
|
+
`AskUser` snapshot and atomic answer submission
|
|
136
244
|
- `POST /uploads`, `PUT/GET /uploads/:id/content`, and `DELETE /uploads/:id`
|
|
137
245
|
- `GET /events` (SSE)
|
|
138
246
|
|
|
139
247
|
`GET /healthz` is intentionally outside the versioned API for service probes.
|
|
248
|
+
`POST /threads/:id/turns` accepts optional
|
|
249
|
+
`quote: { text, messageId }` metadata in addition to the authored `text`.
|
|
140
250
|
|
|
141
251
|
## Dependency Boundary
|
|
142
252
|
|
|
@@ -155,11 +265,19 @@ import a communication adapter or another operator surface.
|
|
|
155
265
|
- Agent runtime/provider execution or conversation history inside an agent.
|
|
156
266
|
- The operator-adapter HTTP server published by each agent.
|
|
157
267
|
- CLI background-process, launchd, or conflict-safe Tailscale Serve lifecycle.
|
|
158
|
-
-
|
|
268
|
+
- Recorded-run replay, which belongs to `@mono-agent/tui`; the legacy read-only
|
|
269
|
+
Session Recorder remains a separate package pending retirement.
|
|
159
270
|
- Authentication. Network reachability is the intentional security boundary.
|
|
160
271
|
- Host filesystem browsing: attachments come only from the browser device's
|
|
161
272
|
native file picker.
|
|
162
273
|
|
|
274
|
+
## Related Documentation
|
|
275
|
+
|
|
276
|
+
- [Always-on web console guide](https://mono-agent-docs.vercel.app/observability/web-console/)
|
|
277
|
+
- [Operator stream endpoint](https://mono-agent-docs.vercel.app/channels/tui/)
|
|
278
|
+
- [Sessions and concurrency](https://mono-agent-docs.vercel.app/runtime/sessions-concurrency/)
|
|
279
|
+
- [Artifacts and traces](https://mono-agent-docs.vercel.app/observability/artifacts-and-traces/)
|
|
280
|
+
|
|
163
281
|
## Verification
|
|
164
282
|
|
|
165
283
|
```sh
|
package/dist/contracts.d.ts
CHANGED
|
@@ -8,7 +8,12 @@ export declare const WEB_MAX_STAGED_UPLOADS = 100;
|
|
|
8
8
|
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
|
+
export declare const WEB_MAX_TURN_TEXT_CHARACTERS = 200000;
|
|
11
12
|
export type WebAgentStatus = "online" | "offline" | "degraded";
|
|
13
|
+
export type WebNotificationTriggerKind = "cron" | "webhook";
|
|
14
|
+
export interface WebThreadTrigger {
|
|
15
|
+
readonly kind: WebNotificationTriggerKind;
|
|
16
|
+
}
|
|
12
17
|
export interface WebModelOption {
|
|
13
18
|
readonly effortLevels?: readonly string[];
|
|
14
19
|
readonly reasoning?: boolean;
|
|
@@ -51,6 +56,7 @@ export interface WebThread {
|
|
|
51
56
|
readonly createdAt: string;
|
|
52
57
|
readonly updatedAt: string;
|
|
53
58
|
readonly revision: number;
|
|
59
|
+
readonly trigger?: WebThreadTrigger;
|
|
54
60
|
readonly lastMessagePreview?: string;
|
|
55
61
|
readonly messageCount: number;
|
|
56
62
|
readonly runState: WebRunState;
|
|
@@ -96,12 +102,17 @@ export interface WebMessage {
|
|
|
96
102
|
readonly threadId: string;
|
|
97
103
|
readonly turnId?: string;
|
|
98
104
|
readonly role: "user" | "assistant" | "system";
|
|
105
|
+
readonly quote?: WebQuote;
|
|
99
106
|
readonly parts: readonly WebMessagePart[];
|
|
100
107
|
readonly attachments: readonly WebAttachment[];
|
|
101
108
|
readonly createdAt: string;
|
|
102
109
|
readonly updatedAt: string;
|
|
103
110
|
readonly status: WebMessageStatus;
|
|
104
111
|
}
|
|
112
|
+
export interface WebQuote {
|
|
113
|
+
readonly text: string;
|
|
114
|
+
readonly messageId: string;
|
|
115
|
+
}
|
|
105
116
|
export interface WebThreadDetail {
|
|
106
117
|
readonly thread: WebThread;
|
|
107
118
|
readonly messages: readonly WebMessage[];
|
|
@@ -139,6 +150,7 @@ export interface PatchWebThreadInput {
|
|
|
139
150
|
}
|
|
140
151
|
export interface StartWebTurnInput {
|
|
141
152
|
readonly text?: string;
|
|
153
|
+
readonly quote?: WebQuote;
|
|
142
154
|
readonly attachmentIds?: readonly string[];
|
|
143
155
|
readonly model?: string;
|
|
144
156
|
readonly effort?: string;
|
package/dist/contracts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA,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;
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,eAAO,MAAM,eAAe,EAAG,CAAU,CAAC;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AE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC;IAC1B,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B"}
|
package/dist/contracts.js
CHANGED
|
@@ -8,4 +8,5 @@ export const WEB_MAX_STAGED_UPLOADS = 100;
|
|
|
8
8
|
export const WEB_MAX_CONCURRENT_UPLOADS = 4;
|
|
9
9
|
export const WEB_MAX_ACTIVE_ATTACHMENT_TURN_BYTES = 64 * 1024 * 1024;
|
|
10
10
|
export const WEB_MAX_QUEUED_ATTACHMENT_TURNS = 32;
|
|
11
|
+
export const WEB_MAX_TURN_TEXT_CHARACTERS = 200_000;
|
|
11
12
|
//# 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"}
|
|
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"}
|
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
13
|
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, WebRunState, WebRunStatus, WebThread, WebThreadDetail, } from "./contracts.js";
|
|
14
|
+
export type { CreateWebThreadInput, CreateWebUploadInput, PatchWebAgentInput, PatchWebThreadInput, StartWebTurnInput, WebAgentStatus, WebAgentSummary, WebAttachment, WebBootstrap, WebEvent, WebEventType, 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,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,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,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,YAAY,EACV,2BAA2B,EAC3B,6BAA6B,EAC7B,4BAA4B,GAC7B,MAAM,0BAA0B,CAAC;AAElC,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,0BAA0B,EAC1B,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,SAAS,EACT,eAAe,EACf,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export { DEFAULT_WEB_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
9
|
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
10
|
export { WebConsoleError } from "./errors.js";
|
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,2BAA2B,EAC3B,sBAAsB,EACtB,+BAA+B,EAC/B,6BAA6B,EAC7B,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AA0BxB,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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,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IAC/C,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC1F,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QACzE,CAAC,CAAC,KAAgC;QAClC,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { WebService, WebServiceLogger } from "./service.js";
|
|
2
|
+
declare const INGRESS_SCHEMA = 1;
|
|
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"}
|