overmux 0.0.11 → 0.0.12

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 (65) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/bin.js +145 -58
  3. package/dist/bin.js.map +1 -1
  4. package/dist/docs/400-reference/200-configuration.md +19 -4
  5. package/dist/docs/400-reference/500-server/000-index.md +4 -0
  6. package/dist/docs/400-reference/500-server/100-resources.md +5 -0
  7. package/dist/docs/400-reference/500-server/200-operations.md +1 -0
  8. package/dist/docs/400-reference/500-server/300-streams.md +7 -1
  9. package/dist/docs/400-reference/500-server/500-api.md +26 -5
  10. package/dist/exports/client.d.ts +1 -1
  11. package/dist/exports/client.d.ts.map +1 -1
  12. package/dist/exports/client.js +6 -7
  13. package/dist/exports/client.js.map +1 -1
  14. package/dist/exports/{index-Dk11nKIv.d.ts → index-C-8Kzrnc.d.ts} +23 -8
  15. package/dist/exports/index-C-8Kzrnc.d.ts.map +1 -0
  16. package/dist/exports/index.d.ts +2 -2
  17. package/dist/exports/index.js +1 -1
  18. package/dist/exports/index.js.map +1 -1
  19. package/dist/exports/{notifications-BFAD3QQl.js → notifications-BBKvKZgI.js} +8 -2
  20. package/dist/exports/{notifications-BFAD3QQl.js.map → notifications-BBKvKZgI.js.map} +1 -1
  21. package/dist/exports/server.d.ts.map +1 -1
  22. package/dist/exports/server.js +8 -2
  23. package/dist/exports/server.js.map +1 -1
  24. package/dist/internal/server/coordinator/server-child.js +592 -883
  25. package/dist/internal/server/coordinator/server-child.js.map +1 -1
  26. package/dist/internal/server/worker-entry.d.ts +1 -0
  27. package/dist/internal/server/worker-entry.js +728 -0
  28. package/dist/internal/server/worker-entry.js.map +1 -0
  29. package/dist/push/sw.js +4 -4
  30. package/dist/push/sw.js.map +1 -1
  31. package/dist/worker-protocol-hXs4FXCH.js +638 -0
  32. package/dist/worker-protocol-hXs4FXCH.js.map +1 -0
  33. package/docs/400-reference/200-configuration.md +19 -4
  34. package/docs/400-reference/500-server/000-index.md +4 -0
  35. package/docs/400-reference/500-server/100-resources.md +5 -0
  36. package/docs/400-reference/500-server/200-operations.md +1 -0
  37. package/docs/400-reference/500-server/300-streams.md +7 -1
  38. package/docs/400-reference/500-server/500-api.md +26 -5
  39. package/package.json +3 -2
  40. package/src/internal/client/host/overmux-host.tsx +4 -8
  41. package/src/internal/server/coordinator/ipc-protocol.ts +2 -1
  42. package/src/internal/server/http/operation-handler.ts +3 -0
  43. package/src/internal/server/http/request-logging.ts +1 -1
  44. package/src/internal/server/protocol-error.ts +19 -0
  45. package/src/internal/server/runtime/create-runtime.ts +11 -5
  46. package/src/internal/server/runtime/handler-logger.ts +54 -0
  47. package/src/internal/server/runtime/runtime-operations.ts +23 -5
  48. package/src/internal/server/runtime/runtime-resources.ts +158 -88
  49. package/src/internal/server/runtime/runtime-streams.ts +24 -8
  50. package/src/internal/server/runtime/worker-capabilities.ts +67 -0
  51. package/src/internal/server/runtime/worker-connection.ts +549 -0
  52. package/src/internal/server/runtime/worker-protocol.ts +173 -0
  53. package/src/internal/server/runtime/worker-runtime.ts +214 -0
  54. package/src/internal/server/server-logger.ts +25 -37
  55. package/src/internal/server/server-startup-options.ts +7 -6
  56. package/src/internal/server/start-application-server.ts +22 -18
  57. package/src/internal/server/start-overmux-server.ts +2 -2
  58. package/src/internal/server/websocket-connection.ts +97 -32
  59. package/src/internal/server/websocket-server.ts +5 -1
  60. package/src/internal/server/worker-entry.ts +504 -0
  61. package/src/internal/shared/protocol.ts +3 -3
  62. package/src/public/config.ts +15 -23
  63. package/src/public/handler-logger.ts +7 -0
  64. package/src/public/index.ts +3 -1
  65. package/dist/exports/index-Dk11nKIv.d.ts.map +0 -1
@@ -161,7 +161,7 @@ export default defineOvermuxConfig({
161
161
 
162
162
  See [`overmux serve`](/docs/reference/cli/serve) for development mode.
163
163
 
164
- ### `debug`
164
+ ### `logLevel`
165
165
 
166
166
  ```ts
167
167
  import { defineOvermuxConfig } from "overmux";
@@ -169,12 +169,27 @@ import { defineOvermuxConfig } from "overmux";
169
169
  export default defineOvermuxConfig({
170
170
  // ...other config
171
171
 
172
- // Default: true.
173
- // Enable debug logging.
174
- debug: true,
172
+ // Default: "info", in development and production.
173
+ // Options: "debug", "info", "warn", "error".
174
+ logLevel: "info",
175
175
  });
176
176
  ```
177
177
 
178
+ `logLevel` sets the minimum severity for runtime and [structured handler logs](./500-server/500-api.md#logging):
179
+
180
+ | Level | Written events |
181
+ | --- | --- |
182
+ | `"debug"` | debug, info, warn, error |
183
+ | `"info"` (default) | info, warn, error |
184
+ | `"warn"` | warn, error |
185
+ | `"error"` | error |
186
+
187
+ Server startup/shutdown are info events; routine HTTP requests, WebSocket connections, and operation start/completion are debug events. Lifecycle events do not bypass the threshold. Logs go to the server JSONL file and stderr; existing stdout/stderr journal capture is unchanged.
188
+
189
+ Browser console forwarding is enabled only at `"debug"`, not at the other levels, even for browser console errors. Treat this as diagnostic capture that may contain application data.
190
+
191
+ This replaces the removed `debug` boolean. Use `logLevel: "debug"` for investigation, or omit the option for normal `"info"` logging. Configuration using `debug` is rejected.
192
+
178
193
  See [Storage locations](/docs/reference/storage-locations) for the server log location.
179
194
 
180
195
  ### `aiContextSnippets`
@@ -11,3 +11,7 @@ Overmux's server architecture provides three primitives that package authors can
11
11
  - [Streams](./300-streams.md): Provide low-latency, bidirectional data flow between your UI and server, such as terminal input/output or live AI agent output.
12
12
 
13
13
  See [Notifications](./400-notifications.md) for sending notifications and [Server API](./500-api.md) for definition helpers and handler context.
14
+
15
+ ## Execution model
16
+
17
+ Overmux uses workers, which are separate JavaScript threads. Resources and operations share one worker, while each named stream has its own. This keeps resource and operation work from blocking streams, helping streams stay responsive.
@@ -96,6 +96,8 @@ subscribe: async (_input, invalidate, context) => {
96
96
 
97
97
  `context.signal` is an `AbortSignal` that Overmux aborts when the client unsubscribes, disconnects, or the server shuts down. Cancellation does not automatically stop an async function: pass the signal to APIs that support it and check it after awaiting setup. Here, `realpath` does not accept a signal, so `throwIfAborted()` prevents starting a watcher if cancellation happened during that work.
98
98
 
99
+ Both `read` and `subscribe` receive `context.logger` for [structured logging](./500-api.md#logging), including during cleanup.
100
+
99
101
  Overmux calls the returned cleanup function once, even if setup finishes after cancellation. Cleanup may also be asynchronous. In this example, the signal can close the watcher before Overmux calls cleanup; `watcher.close()` is safe to call again. If setup throws before returning cleanup, your handler must release any resources it already acquired.
100
102
 
101
103
  ## Derived
@@ -105,6 +107,9 @@ Derived resources compute a value from other resources.
105
107
  For example, count the entries returned by the `ls` resource above. Add `entryCount` alongside `ls` in your `resources` object:
106
108
 
107
109
  ```ts
110
+ import { defineOvermuxServer, defineResourceContract, noInputSchema } from "overmux";
111
+ import { z } from "zod";
112
+
108
113
  defineOvermuxServer({
109
114
  resources: {
110
115
  ls: {
@@ -43,6 +43,7 @@ handle: async (input, context) => {
43
43
 
44
44
  - **`invalidate(resourceId, input?)`**: tells clients to read an affected resource again after you change server-side data. See [Invalidating resources](./100-resources.md#invalidating-resources).
45
45
  - **[`notifications.send(...)`](./400-notifications.md)**: sends a notification through Overmux.
46
+ - **[`logger`](./500-api.md#logging)**: writes structured logs with `debug`, `info`, `warn`, and `error`.
46
47
 
47
48
  See [Server API](./500-api.md#handler-context) for the full handler context.
48
49
 
@@ -129,12 +129,18 @@ Overmux calls `dispose` once when the session closes. Use it to stop timers, rem
129
129
 
130
130
  `useStream` closes its session when the component unmounts. You can also close it explicitly with `close()`.
131
131
 
132
- The handler context provides an abort `signal` for cancelling background work and `fail(cause)` for failing and closing the session. See [Server API: Stream handlers](./500-api.md#stream-handlers).
132
+ The stream context provides an abort `signal` for cancelling background work and `fail(cause)` for failing and closing the session. See [Server API: Stream handlers](./500-api.md#stream-handlers).
133
+
134
+ Use `context.logger` for [structured logging](./500-api.md#logging) in the handler and its message and cleanup callbacks.
133
135
 
134
136
  ## How streams work
135
137
 
136
138
  Streams communicate over a persistent WebSocket connection between your browser and server.
137
139
 
140
+ Each named stream runs in its own worker. Resources, including derived resources, and operations share a separate application worker; module-local state is not shared with streams. See [Configuration](../200-configuration.md#server).
141
+
142
+ Streams cannot invalidate resources. To mutate data and invalidate affected resources, have the client call an [operation](./200-operations.md). To refresh resources when an external source changes, use a [subscription resource watcher](./100-resources.md#subscription). A stream does not automatically invoke an operation.
143
+
138
144
  Overmux validates the opening input and messages against the stream contract. Client messages are passed to `onMessage` in order; calls to `emit` send messages to that session's client.
139
145
 
140
146
  A restored stream after a WebSocket reconnect creates a new server session. Do not assume that state held by the previous session survives.
@@ -40,6 +40,8 @@ export const serverConfig = defineOvermuxServer({
40
40
 
41
41
  Object keys are the IDs used by clients. See [Resources](./100-resources.md), [Operations](./200-operations.md), and [Streams](./300-streams.md) for usage guides.
42
42
 
43
+ See [Configuration](../200-configuration.md#server) for worker ownership and shared-state constraints.
44
+
43
45
  ## Resource handlers
44
46
 
45
47
  A resource definition has a `contract` created with `defineResourceContract({ input, output })`. Overmux parses handler input with `input` and validates every result with `output`.
@@ -71,7 +73,7 @@ const resources = {
71
73
 
72
74
  `subscribe` returns a cleanup function, directly or asynchronously. Overmux aborts `context.signal` when the subscription ends, including during setup, on client disconnect, or on server shutdown. Overmux calls the returned cleanup function once, even if setup returns it after cancellation. The cleanup function itself may also be asynchronous. If setup throws before returning cleanup, the handler must release any resources it already acquired. See [Asynchronous setup](./100-resources.md#asynchronous-setup) for an example.
73
75
 
74
- A derived resource reads the resources named by `dependencies`; invalidating a dependency also invalidates its dependants. See [Resources](./100-resources.md) for contracts, derived dependencies, and invalidation.
76
+ A derived resource reads the resources named by `dependencies`; invalidating a dependency also invalidates its dependants. See [Resources](./100-resources.md#derived) for contracts, derived dependencies, and invalidation.
75
77
 
76
78
  ## Stream handlers
77
79
 
@@ -88,10 +90,14 @@ const terminal = defineStreamHandler(contract, (input, context) => ({
88
90
  }));
89
91
  ```
90
92
 
91
- `open(input, context)` may return the session object or a promise for it. Its context extends the [handler context](#handler-context) with:
93
+ `open(input, context)` may return the session object or a promise for it. Streams receive their own context, without `invalidate`:
92
94
 
93
95
  | API | Purpose |
94
96
  | --- | --- |
97
+ | `signal` | An `AbortSignal` that aborts when the session or server runtime closes. |
98
+ | `instance.getInstanceId()` | Get this server instance's ID. |
99
+ | `instance.getDeepLinkPrefix()` | Get this instance's Overmux deep-link prefix. |
100
+ | `logger` | Write [structured handler logs](#logging), including from `onMessage` and `dispose` closures. |
95
101
  | `emit(message)` | Validate and send a server message to this session. Calls after closure are ignored. |
96
102
  | `fail(cause)` | Fail and close this session. A later call has no effect. |
97
103
 
@@ -106,15 +112,30 @@ The stream `signal` aborts when its session or the runtime closes. Stop backgrou
106
112
 
107
113
  ## Handler context
108
114
 
109
- Inline resource, operation, and stream handlers infer valid resource IDs and inputs.
115
+ Inline resource and operation handlers infer valid resource IDs and inputs.
110
116
 
111
- Resource and stream handlers receive a context with:
117
+ Resource handlers receive a context with:
112
118
 
113
119
  | API | Purpose |
114
120
  | --- | --- |
115
121
  | `invalidate(resourceId, input?)` | Ask clients to [read a resource again](./100-resources.md#invalidating-resources). Pass the resource's key in `resources`. Omit `input` to invalidate all inputs; otherwise it is validated and only matching inputs are invalidated. Unknown IDs throw. |
116
- | `signal` | An `AbortSignal` that aborts when the request or session, or the server runtime, closes. |
122
+ | `logger` | Write [structured handler logs](#logging). |
123
+ | `signal` | An `AbortSignal` that aborts when the request or subscription, or the server runtime, closes. |
117
124
  | `instance.getInstanceId()` | Get this server instance's ID. |
118
125
  | `instance.getDeepLinkPrefix()` | Get this instance's Overmux deep-link prefix. |
119
126
 
120
127
  Operation handlers receive the same context plus `notifications.send(notification)`, which returns `Promise<void>`. See [Notifications](./400-notifications.md).
128
+
129
+ ### Logging
130
+
131
+ Resource, stream, and operation handlers receive `context.logger`, with synchronous `debug`, `info`, `warn`, and `error` methods:
132
+
133
+ ```ts
134
+ logger.info("read-complete", { count: 42 });
135
+ ```
136
+
137
+ Each method accepts an event name and optional `Record<string, unknown>` details, returning `void`. The public type is `HandlerLogger` from `overmux`.
138
+
139
+ Overmux automatically adds capability and request/session identity, including in message and cleanup closures. Logs go to the [server log file](/docs/reference/storage-locations) and stderr, filtered by [`logLevel`](../200-configuration.md#loglevel), which defaults to `"info"`.
140
+
141
+ Logging remains usable after cancellation, and logging failures never fail handlers or cleanup. Delivery is best effort: oversized entries and logs that exceed a worker's bounded queue are dropped rather than delaying application work. Inputs, results, and stream contents are not logged automatically. Avoid secrets or sensitive payloads in your events and details.
@@ -1,4 +1,4 @@
1
- import { B as InstanceIdentity, w as ContractInputArguments } from "./index-Dk11nKIv.js";
1
+ import { H as InstanceIdentity, T as ContractInputArguments } from "./index-C-8Kzrnc.js";
2
2
  import { z } from "zod";
3
3
  import { UseMutationResult } from "@tanstack/react-query";
4
4
  import { CSSProperties, ComponentType, ReactNode, RefObject } from "react";
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","names":[],"sources":["../../src/internal/client/background-notifications.ts","../../src/internal/client/native-web-view.tsx","../../src/internal/client/host/desktop-host.ts","../../src/internal/client/clipboard.ts","../../src/internal/client/browser-api.ts","../../src/internal/client/theme-scope.tsx","../../src/internal/client/client-definition.ts","../../src/internal/client/commands.tsx","../../src/internal/client/overmux-react.ts","../../src/internal/client/host/overmux-host.tsx","../../src/internal/client/shortcuts.tsx"],"mappings":";;;;;;cA2Ja,qCAA6B;cAkB7B,sCAA8B;;;KCvK/B;EACV;EACA;EACA;;KAEU;EACV;EACA;EACA,QAAQ;EACR,WAAW;EACX,eAAe,OAAO;EACtB;EACA,+BAA+B;;cA2DpB,kBAAiB,KAAA,WAAA,OAAA,UAAA,aAAA,oBAAA,uBAQ3B,uCAAkB,IAAA;;;KChFT;EACV;EACA,UACE;IACM;IAA4B;;IAE5B;IACA;IACA;IACA;IACA,8BAA8B;QAEjC;EACL,YACE,YACA;IAAU;IAAW;IAAW;IAAe;;EAEjD,cACE,WAAW;IAAS;IAAY,OAAO;;;KAItC;EACH;EACA;EACA,gBAAgB;EAChB;IAAa,SAAS;MAAY;;IAA+B;;EACjE;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EATX,mBAAA;EAWP,eAAA,YAAY,cAAc,WAAW,2BAAuB,IAAA;IAIzE,IAAI;IACJ,SAAS;QACV,gBAAA,QAAA,WAAA,eAAA,OAAA,SAAA,WAAA,eAAA;EAUO,aAAA,YAAY;EACR,YAAA,YAAY,cAAc,QAAQ,2BAAuB,IAAA,SAGlE,iBAAiB,KAAK,QAAQ,WAAW,QAAQ,eAAe,YAAO,aAAA,gBAAA,QAAA,eAAA,OAAA,gBAAA,QAAA,eAAA;;;;cC9N/D,gBAAe;EAG1B,YAAY;sBACb,IAAA;;;KCxFW;EACV,WAAW,UAAU;EACrB,OAAO,UAAU;;cAQN,yBAA0B,QAAQ"}
1
+ {"version":3,"file":"client.d.ts","names":[],"sources":["../../src/internal/client/background-notifications.ts","../../src/internal/client/native-web-view.tsx","../../src/internal/client/host/desktop-host.ts","../../src/internal/client/clipboard.ts","../../src/internal/client/browser-api.ts","../../src/internal/client/theme-scope.tsx","../../src/internal/client/client-definition.ts","../../src/internal/client/commands.tsx","../../src/internal/client/overmux-react.ts","../../src/internal/client/host/overmux-host.tsx","../../src/internal/client/shortcuts.tsx"],"mappings":";;;;;;cA2Ja,qCAA6B;cAkB7B,sCAA8B;;;KCvK/B;EACV;EACA;EACA;;KAEU;EACV;EACA;EACA,QAAQ;EACR,WAAW;EACX,eAAe,OAAO;EACtB;EACA,+BAA+B;;cA2DpB,kBAAiB,KAAA,WAAA,OAAA,UAAA,aAAA,oBAAA,uBAQ3B,uCAAkB,IAAA;;;KChFT;EACV;EACA,UACE;IACM;IAA4B;;IAE5B;IACA;IACA;IACA;IACA,8BAA8B;QAEjC;EACL,YACE,YACA;IAAU;IAAW;IAAW;IAAe;;EAEjD,cACE,WAAW;IAAS;IAAY,OAAO;;;KAItC;EACH;EACA;EACA,gBAAgB;EAChB;IAAa,SAAS;MAAY;;IAA+B;;EACjE;IAAc,YAAY;IAAuB;;EACjD;IAAkB,OAAO;IAAgC;;;QAGnD;YACI;IACR,cAAc;;;;;cCnCL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ACV,gBAAA,QAAA,WAAA,eAAA,OAAA,SAAA,WAAA,eAAA;EAUO,aAAA,YAAY;EACR,YAAA,YAAY,cAAc,QAAQ,2BAAuB,IAAA,SAGlE,iBAAiB,KAAK,QAAQ,WAAW,QAAQ,eAAe,YAAO,aAAA,gBAAA,QAAA,eAAA,OAAA,gBAAA,QAAA,eAAA;;;;cClO/D,gBAAe;EAG1B,YAAY;sBACb,IAAA;;;KCpFW;EACV,WAAW,UAAU;EACrB,OAAO,UAAU;;cAQN,yBAA0B,QAAQ"}
@@ -1,5 +1,5 @@
1
1
  import "./style.css";
2
- import { a as notificationSchema, c as parseDeepLink, l as resolveOvermuxReturnTo, o as overmuxLogoutPath, r as instanceIdSchema, t as createInstanceIdentity } from "./notifications-BFAD3QQl.js";
2
+ import { i as logLevelSchema, l as parseDeepLink, o as notificationSchema, r as instanceIdSchema, s as overmuxLogoutPath, t as createInstanceIdentity, u as resolveOvermuxReturnTo } from "./notifications-BBKvKZgI.js";
3
3
  import { z } from "zod";
4
4
  import { QueryClient, QueryClientProvider, useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
5
5
  import { Component, createContext, createElement, useCallback, useContext, useEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore } from "react";
@@ -26,9 +26,9 @@ const webSocketCloseCode = {
26
26
  authenticationUnavailable: 4002
27
27
  };
28
28
  const runtimeManifestSchema = z.object({
29
- debug: z.boolean(),
29
+ logLevel: logLevelSchema,
30
30
  operations: z.array(z.string().min(1)),
31
- protocolVersion: z.literal(10),
31
+ protocolVersion: z.literal(11),
32
32
  resources: z.array(z.string().min(1)),
33
33
  streams: z.array(z.string().min(1))
34
34
  });
@@ -1862,7 +1862,6 @@ const OvermuxRuntime = ({ definition }) => {
1862
1862
  const safeMode = new URLSearchParams(location.search).get("safe") === "1";
1863
1863
  const transport = useMemo(createClientTransport, []);
1864
1864
  const queryClient = useMemo(() => new QueryClient(), []);
1865
- const logForwardingDisposer = useRef(void 0);
1866
1865
  const [manifest, setManifest] = useState();
1867
1866
  const [error, setError] = useState();
1868
1867
  useEffect(() => {
@@ -1885,13 +1884,13 @@ const OvermuxRuntime = ({ definition }) => {
1885
1884
  const registrations = useMemo(() => /* @__PURE__ */ new Set(), []);
1886
1885
  const [registrationRevision, setRegistrationRevision] = useState(0);
1887
1886
  useEffect(() => {
1888
- if (manifest?.debug && !logForwardingDisposer.current) logForwardingDisposer.current = installBrowserLogForwarding(transport.reportDiagnostic);
1889
- }, [manifest?.debug, transport]);
1887
+ if (manifest?.logLevel !== "debug") return;
1888
+ return installBrowserLogForwarding(transport.reportDiagnostic);
1889
+ }, [manifest?.logLevel, transport]);
1890
1890
  useEffect(() => transport.subscribeStatus((status) => {
1891
1891
  if (status === "authentication-required") redirectToLogin();
1892
1892
  }), [transport]);
1893
1893
  useEffect(() => () => {
1894
- logForwardingDisposer.current?.();
1895
1894
  transport.dispose();
1896
1895
  }, [transport]);
1897
1896
  useEffect(() => installNotificationForwarding(transport), [transport]);