overmux 0.0.2 → 0.0.3

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.
@@ -37,7 +37,7 @@ Once the CLI is installed, create your Overmux setup:
37
37
  overmux init
38
38
  ```
39
39
 
40
- This creates your setup in `$XDG_CONFIG_HOME/overmux`. Read more about the Overmux [project structure](../300-fundamentals/100-project-structure.md).
40
+ This validates your toolchain, creates a minimal application in `$XDG_CONFIG_HOME/overmux`, installs its dependencies, and checks the result. Existing scaffold files are left unchanged. Read more in the [`overmux init` reference](../400-reference/400-cli/050-init.md) and [project structure](../300-fundamentals/100-project-structure.md).
41
41
 
42
42
  ## Start the server
43
43
 
@@ -48,4 +48,3 @@ overmux serve
48
48
  Open Overmux in your browser to confirm it works.
49
49
 
50
50
  To configure hosts and ports, see [Configuration](../300-fundamentals/200-configuration.md).
51
-
@@ -1,3 +1,23 @@
1
1
  ---
2
2
  title: Project Structure
3
3
  ---
4
+
5
+ `overmux init` creates this minimal userland application:
6
+
7
+ ```text
8
+ .gitignore
9
+ mise.toml Mise installations only
10
+ package.json
11
+ pnpm-lock.yaml
12
+ overmux.config.ts authentication, server, Vite, and production settings
13
+ src/server/index.ts trusted resources, streams, and operations
14
+ src/ui/app.tsx browser application definition
15
+ src/ui/index.html browser document
16
+ src/ui/main.tsx React and Overmux host entry point
17
+ src/ui/styles.css application styles
18
+ vite.config.ts browser development and production build configuration
19
+ ```
20
+
21
+ The server and UI are separate trust boundaries. `src/server/index.ts` runs as trusted Node.js code. Files under `src/ui` run in the browser and communicate with the server through Overmux's public APIs.
22
+
23
+ The generated application has no shared directory. Add browser-safe shared schemas only when both sides need them.
@@ -1,3 +1,20 @@
1
1
  ---
2
2
  title: Client API
3
3
  ---
4
+
5
+ ## Clipboard
6
+
7
+ ```ts
8
+ import { readClipboardText, writeClipboardText } from "overmux/client";
9
+
10
+ await writeClipboardText("Text to copy");
11
+ const text = await readClipboardText();
12
+ ```
13
+
14
+ `readClipboardText(): Promise<string>` reads the system clipboard through `navigator.clipboard.readText()`. It never reads through the desktop bridge.
15
+
16
+ `writeClipboardText(text: string): Promise<void>` uses Overmux's version-1 desktop write bridge when present, otherwise `navigator.clipboard.writeText()`. Desktop writes are fire-and-forget: resolution confirms dispatch, not completion or acceptance by the host. Existing host origin and active-frame checks still apply.
17
+
18
+ Both reject on unavailable browser APIs, browser permission failures, or synchronous desktop dispatch failures. Browser secure-context, focus, permissions, and user-activation restrictions still apply. These APIs target the system clipboard, not the X11 primary selection. Only read clipboard data you need and trust the source of text you write.
19
+
20
+ For terminal-program access via OSC 52, use the opt-in factories from `@overmux/xterm/client` rather than wiring platform bridges in application code.
@@ -0,0 +1,17 @@
1
+ ---
2
+ title: "overmux init"
3
+ ---
4
+
5
+ # `overmux init`
6
+
7
+ Create a minimal, runnable Overmux application without prompting.
8
+
9
+ ```sh
10
+ overmux init
11
+ ```
12
+
13
+ The application is created in `$XDG_CONFIG_HOME/overmux`.
14
+
15
+ The command validates the toolchain before writing files. When Mise is installed, it must be [activated in the shell](https://mise.jdx.dev/getting-started.html#activate-mise); the generated `mise.toml` pins Node 22, pnpm 10, and the latest published Overmux version. Without Mise, pnpm 10 or newer must already be available and `mise.toml` is omitted.
16
+
17
+ The initializer pins the exact latest published `overmux` version in `package.json`, installs dependencies, generates `pnpm-lock.yaml`, and runs `overmux check`. Existing scaffold files cause the command to fail without changing them. Unrelated files are preserved.
@@ -5,6 +5,23 @@ import { CSSProperties, ComponentType, ReactNode, RefObject } from "react";
5
5
  import { KeyBinding, KeyBinding as KeyBinding$1, formatKeyBinding, keyBindingSchema, matchesKeyBinding } from "@overmux/keybindings";
6
6
  declare const enableBackgroundNotifications: () => Promise<boolean>;
7
7
  declare const disableBackgroundNotifications: () => Promise<void>;
8
+ type DesktopHost = {
9
+ clipboard?: {
10
+ writeText: (text: string) => void;
11
+ version: 1;
12
+ };
13
+ notifications?: {
14
+ show: (notification: unknown) => void;
15
+ version: 1;
16
+ };
17
+ };
18
+ declare global {
19
+ interface Window {
20
+ overmuxHost?: DesktopHost;
21
+ }
22
+ }
23
+ declare const readClipboardText: () => Promise<string>;
24
+ declare const writeClipboardText: (text: string) => Promise<void>;
8
25
  type Operations$1<TConfig> = TConfig extends {
9
26
  operations?: infer TOperations;
10
27
  } ? NonNullable<TOperations> : never;
@@ -233,5 +250,5 @@ type ShortcutInputTarget = {
233
250
  input: RefObject<HTMLElement | null>;
234
251
  };
235
252
  declare const useShortcutInputTarget: (target: ShortcutInputTarget) => void;
236
- export { type ChordPrefix, type CommandBinding, type CommandEntry, type CommandHandle, type ConditionalShortcutBinding, type KeyBinding, type KeySequence, type OvermuxClientAppearance, type OvermuxContrast, type OvermuxExternalPortalContainer, OvermuxHost, OvermuxPortal, type OvermuxPortalProps, type OvermuxScheme, type OvermuxServerApi, type OvermuxStyle, OvermuxThemeScope, type OvermuxThemeScopeProps, type OvermuxThemeToken, type ResourceResult, type ShortcutBinding, type ShortcutInputTarget, type SkipToken, type StreamResult, chordPrefixSchema, commandBindingSchema, createOvermuxHooks, defineCommandRegistry, defineOvermuxClient, disableBackgroundNotifications, enableBackgroundNotifications, formatKeyBinding, formatShortcutBinding, keyBindingSchema, matchesKeyBinding, shortcutBindingSchema, skipToken, useCommand, useCommands, useShortcutInputTarget };
253
+ export { type ChordPrefix, type CommandBinding, type CommandEntry, type CommandHandle, type ConditionalShortcutBinding, type KeyBinding, type KeySequence, type OvermuxClientAppearance, type OvermuxContrast, type OvermuxExternalPortalContainer, OvermuxHost, OvermuxPortal, type OvermuxPortalProps, type OvermuxScheme, type OvermuxServerApi, type OvermuxStyle, OvermuxThemeScope, type OvermuxThemeScopeProps, type OvermuxThemeToken, type ResourceResult, type ShortcutBinding, type ShortcutInputTarget, type SkipToken, type StreamResult, chordPrefixSchema, commandBindingSchema, createOvermuxHooks, defineCommandRegistry, defineOvermuxClient, disableBackgroundNotifications, enableBackgroundNotifications, formatKeyBinding, formatShortcutBinding, keyBindingSchema, matchesKeyBinding, readClipboardText, shortcutBindingSchema, skipToken, useCommand, useCommands, useShortcutInputTarget, writeClipboardText };
237
254
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","names":[],"sources":["../../src/internal/client/background-notifications.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":";;;;;;cAyJa,qCAA6B;cAkB7B,sCAA8B;;;KCrKtC,aAAW,WAAW;EAAkB,mBAAmB;IAC5D,YAAY;KAEX,UAAQ,KAAK;EAAY,aAAa,eAAe,EAAE;IACxD;KAEC,WAAS,KAAK;EAAY,cAAc,gBAAgB,EAAE;IAC3D,EAAE,OAAO;KAER,YAAY,WAAW,cAAc,aAAW;KAChD,eAAe,SAAS,YAAY,YAAY,YAAY,UAC/D,aAAW,SAAS;KAEjB,gBAAgB,SAAS,YAAY,YAAY,YAAY,WAChE,aAAW,SAAS;KAEjB,mBAAmB,eAAe,EAAE,eACpC,uBAAuB,SAC1B,SAAS;KAGC,iBAAiB;EAC3B,mBAAmB,YAAY,YAAY,gBACzC,IAAI,QACD,MAAM,mBAAmB,eAAe,eAAe,UACvD,QAAQ,gBAAgB,eAAe;;;;KCnBlC;KACA;cAEC;KAoBD,4BAA4B;KAE5B,eAAe,gBACzB,QAAQ,OAAO;KAEL;EACV,WAAW;EACX;;KAGU;EACV,UAAU;EACV,WAAW;;KAGD;EACV,UAAU;EACV;EACA,WAAW;EACX,SAAS;EACT,QAAQ;;cAoBG,kBAAiB,UAAA,YAAwB,uCAAkB;cAK3D,sBAAqB,UAAA,WAAA,UAAA,QAAA,SAM/B,2CAAsB,IAAA;;;KCpEb,wBAAwB,cAAY,iBAAe;KACnD,kBAAkB,eAAa;KAC/B;EACV,SAAS;EACT;IAAQ;;;KAEE,iBAAiB,kBAAkB;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,YAAY,cAAc,UAAU,yBAAyB;IAC5D,IAAI;IACJ,OAAO;;GAER,YAAY,cAAc,UAAU,yBAAyB;IAC5D,IAAI;IACJ,OACI,EAAE,MAAM,QAAQ,WAAW,UAAU,eAAe,UACpD;MAEF,eAAe,SAAS,WAAW,UAAU,eAAe;;KAItD,eAAe;EAErB;EACA;EACA;EACA;;EAGA,OAAO;EACP,OAAO;EACP;EACA;;EAGA,MAAM;EACN;EACA;EACA;;KAGM,aAAa,gBAAgB;EACvC;EACA,QAAQ;EACR,OAAO,SAAS;EAChB;EACA,YAAY,WAAW,SAAS;;KAG7B,gBAAgB,qBAAqB,EAAE,SAAS,WAAW,KAC9D,kBAAkB,SAAS,OAAO,EAAE,MAAM;EAG1C,YAAY,MAAM,uBAAuB;EACzC,iBACK,MAAM,uBAAuB,kBAC7B,QAAQ;;cAuJF,qBAAsB;EAClB,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;;;;cC5F/D,gBAAe;EAG1B,YAAY;sBACb,IAAA;;;KCtDW;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/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":";;;;;;cAyJa,qCAA6B;cA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AGA,OAAO;EACP,OAAO;EACP;EACA;;EAGA,MAAM;EACN;EACA;EACA;;KAGM,aAAa,gBAAgB;EACvC;EACA,QAAQ;EACR,OAAO,SAAS;EAChB;EACA,YAAY,WAAW,SAAS;;KAG7B,gBAAgB,qBAAqB,EAAE,SAAS,WAAW,KAC9D,kBAAkB,SAAS,OAAO,EAAE,MAAM;EAG1C,YAAY,MAAM,uBAAuB;EACzC,iBACK,MAAM,uBAAuB,kBAC7B,QAAQ;;cAuJF,qBAAsB;EAClB,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;;;;cC5F/D,gBAAe;EAG1B,YAAY;sBACb,IAAA;;;KCtDW;EACV,WAAW,UAAU;EACrB,OAAO,UAAU;;cAQN,yBAA0B,QAAQ"}
@@ -299,6 +299,21 @@ const reconciledStatus = async () => {
299
299
  return "enabled";
300
300
  };
301
301
  //#endregion
302
+ //#region src/internal/client/clipboard.ts
303
+ const readClipboardText = async () => {
304
+ if (!globalThis.navigator?.clipboard?.readText) throw new Error("Clipboard reading is unavailable in this browser context");
305
+ return navigator.clipboard.readText();
306
+ };
307
+ const writeClipboardText = async (text) => {
308
+ const desktopClipboard = globalThis.window?.overmuxHost?.clipboard;
309
+ if (desktopClipboard?.version === 1) {
310
+ desktopClipboard.writeText(text);
311
+ return;
312
+ }
313
+ if (!globalThis.navigator?.clipboard?.writeText) throw new Error("Clipboard writing is unavailable in this browser context");
314
+ await navigator.clipboard.writeText(text);
315
+ };
316
+ //#endregion
302
317
  //#region src/internal/client/client-definition.ts
303
318
  const shortcutBindingSchema = z.union([keyBindingSchema$1, z.array(keyBindingSchema$1).min(2)]);
304
319
  const commandBindingSchema = z.union([shortcutBindingSchema, z.object({
@@ -1101,6 +1116,13 @@ const createWebSocketTransport = ({ createSocket = () => new WebSocket(socketUrl
1101
1116
  socket?.close();
1102
1117
  },
1103
1118
  openStream: ({ input, onClose, onError, onMessage, onOpen, streamName }) => {
1119
+ if (!active || disposed) {
1120
+ onError(disconnected());
1121
+ return {
1122
+ close: () => {},
1123
+ send: () => false
1124
+ };
1125
+ }
1104
1126
  const streamId = operationId();
1105
1127
  const stream = {
1106
1128
  input,
@@ -1113,7 +1135,7 @@ const createWebSocketTransport = ({ createSocket = () => new WebSocket(socketUrl
1113
1135
  streamName
1114
1136
  };
1115
1137
  streams.set(streamId, stream);
1116
- stream.status = send({
1138
+ stream.status = socket?.readyState === WebSocket.CONNECTING || send({
1117
1139
  input,
1118
1140
  operationId: streamId,
1119
1141
  streamId,
@@ -1638,6 +1660,6 @@ const OvermuxHost = ({ definition }) => /* @__PURE__ */ jsx(OvermuxThemeScope, {
1638
1660
  children: location.pathname === "/_overmux/settings" ? /* @__PURE__ */ jsx(HostedSettingsPage, {}) : location.pathname === "/_overmux/logout" ? /* @__PURE__ */ jsx(HostedLogoutPage, {}) : /* @__PURE__ */ jsx(OvermuxRuntime, { definition })
1639
1661
  });
1640
1662
  //#endregion
1641
- export { OvermuxHost, OvermuxPortal, OvermuxThemeScope, chordPrefixSchema, commandBindingSchema, createOvermuxHooks, defineCommandRegistry, defineOvermuxClient, disableBackgroundNotifications, enableBackgroundNotifications, formatKeyBinding, formatShortcutBinding, keyBindingSchema, matchesKeyBinding, shortcutBindingSchema, skipToken, useCommand, useCommands, useShortcutInputTarget };
1663
+ export { OvermuxHost, OvermuxPortal, OvermuxThemeScope, chordPrefixSchema, commandBindingSchema, createOvermuxHooks, defineCommandRegistry, defineOvermuxClient, disableBackgroundNotifications, enableBackgroundNotifications, formatKeyBinding, formatShortcutBinding, keyBindingSchema, matchesKeyBinding, readClipboardText, shortcutBindingSchema, skipToken, useCommand, useCommands, useShortcutInputTarget, writeClipboardText };
1642
1664
 
1643
1665
  //# sourceMappingURL=client.js.map