overmux 0.0.1 → 0.0.2

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 (193) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +7 -0
  3. package/dist/auth/.vite/manifest.json +11 -0
  4. package/dist/auth/assets/index-Bx8JhwVi.css +1 -0
  5. package/dist/auth/assets/index-CHIE7qYj.js +72 -0
  6. package/dist/auth/index.html +14 -0
  7. package/dist/bin.js +4504 -7870
  8. package/dist/bin.js.map +1 -0
  9. package/dist/docs/000-index.md +21 -0
  10. package/dist/docs/100-introduction/100-what-is-overmux.md +7 -0
  11. package/dist/docs/100-introduction/200-how-overmux-works.md +7 -0
  12. package/dist/docs/100-introduction/300-why-overmux.md +22 -0
  13. package/dist/docs/200-getting-started/100-install-and-run-overmux.md +51 -0
  14. package/dist/docs/200-getting-started/200-install-overmux-desktop.md +41 -0
  15. package/dist/docs/200-getting-started/300-install-overmux-pwa.mdx +92 -0
  16. package/dist/docs/200-getting-started/400-secure-with-https/100-choose-an-https-setup.md +14 -0
  17. package/dist/docs/200-getting-started/400-secure-with-https/200-tailscale-serve.md +44 -0
  18. package/dist/docs/200-getting-started/400-secure-with-https/300-cloudflare-tunnel.md +59 -0
  19. package/dist/docs/200-getting-started/400-secure-with-https/400-self-hosted-reverse-proxy.md +32 -0
  20. package/dist/docs/300-fundamentals/100-project-structure.md +3 -0
  21. package/dist/docs/300-fundamentals/200-configuration.md +3 -0
  22. package/dist/docs/300-fundamentals/300-theming.md +3 -0
  23. package/dist/docs/300-fundamentals/400-server.md +3 -0
  24. package/dist/docs/300-fundamentals/500-client.md +3 -0
  25. package/dist/docs/300-fundamentals/600-operations.md +3 -0
  26. package/dist/docs/300-fundamentals/700-resources.md +3 -0
  27. package/dist/docs/300-fundamentals/800-streams.md +3 -0
  28. package/dist/docs/300-fundamentals/900-authentication-and-security.md +3 -0
  29. package/dist/docs/400-reference/100-configuration.md +3 -0
  30. package/dist/docs/400-reference/200-server-api.md +3 -0
  31. package/dist/docs/400-reference/300-client-api.md +3 -0
  32. package/dist/docs/400-reference/400-cli/100-serve.md +33 -0
  33. package/dist/docs/400-reference/400-cli/200-auth.md +52 -0
  34. package/dist/docs/400-reference/400-cli/300-call.md +28 -0
  35. package/dist/docs/400-reference/400-cli/400-check.md +20 -0
  36. package/dist/docs/400-reference/400-cli/500-ai-context.md +102 -0
  37. package/dist/docs/400-reference/400-cli/600-docs.md +23 -0
  38. package/dist/docs/400-reference/400-cli/700-desktop.md +35 -0
  39. package/dist/docs/500-hosted-pages.md +31 -0
  40. package/dist/exports/client.d.ts +237 -0
  41. package/dist/exports/client.d.ts.map +1 -0
  42. package/dist/exports/client.js +1643 -0
  43. package/dist/exports/client.js.map +1 -0
  44. package/dist/exports/index-D3_Dpy_T.d.ts +155 -0
  45. package/dist/exports/index-D3_Dpy_T.d.ts.map +1 -0
  46. package/dist/exports/index.d.ts +2 -0
  47. package/dist/exports/index.js +49 -0
  48. package/dist/exports/index.js.map +1 -0
  49. package/dist/exports/notifications-kDp16bU_.js +56 -0
  50. package/dist/exports/notifications-kDp16bU_.js.map +1 -0
  51. package/dist/exports/server.d.ts +63 -0
  52. package/dist/exports/server.d.ts.map +1 -0
  53. package/dist/exports/server.js +1120 -0
  54. package/dist/exports/server.js.map +1 -0
  55. package/dist/exports/style.css +368 -0
  56. package/dist/internal/server/coordinator/server-child.d.ts +1 -0
  57. package/dist/internal/server/coordinator/server-child.js +3299 -0
  58. package/dist/internal/server/coordinator/server-child.js.map +1 -0
  59. package/docs/000-index.md +21 -0
  60. package/docs/100-introduction/100-what-is-overmux.md +7 -0
  61. package/docs/100-introduction/200-how-overmux-works.md +7 -0
  62. package/docs/100-introduction/300-why-overmux.md +22 -0
  63. package/docs/200-getting-started/100-install-and-run-overmux.md +51 -0
  64. package/docs/200-getting-started/200-install-overmux-desktop.md +41 -0
  65. package/docs/200-getting-started/300-install-overmux-pwa.mdx +92 -0
  66. package/docs/200-getting-started/400-secure-with-https/100-choose-an-https-setup.md +14 -0
  67. package/docs/200-getting-started/400-secure-with-https/200-tailscale-serve.md +44 -0
  68. package/docs/200-getting-started/400-secure-with-https/300-cloudflare-tunnel.md +59 -0
  69. package/docs/200-getting-started/400-secure-with-https/400-self-hosted-reverse-proxy.md +32 -0
  70. package/docs/300-fundamentals/100-project-structure.md +3 -0
  71. package/docs/300-fundamentals/200-configuration.md +3 -0
  72. package/docs/300-fundamentals/300-theming.md +3 -0
  73. package/docs/300-fundamentals/400-server.md +3 -0
  74. package/docs/300-fundamentals/500-client.md +3 -0
  75. package/docs/300-fundamentals/600-operations.md +3 -0
  76. package/docs/300-fundamentals/700-resources.md +3 -0
  77. package/docs/300-fundamentals/800-streams.md +3 -0
  78. package/docs/300-fundamentals/900-authentication-and-security.md +3 -0
  79. package/docs/400-reference/100-configuration.md +3 -0
  80. package/docs/400-reference/200-server-api.md +3 -0
  81. package/docs/400-reference/300-client-api.md +3 -0
  82. package/docs/400-reference/400-cli/100-serve.md +33 -0
  83. package/docs/400-reference/400-cli/200-auth.md +52 -0
  84. package/docs/400-reference/400-cli/300-call.md +28 -0
  85. package/docs/400-reference/400-cli/400-check.md +20 -0
  86. package/docs/400-reference/400-cli/500-ai-context.md +102 -0
  87. package/docs/400-reference/400-cli/600-docs.md +23 -0
  88. package/docs/400-reference/400-cli/700-desktop.md +35 -0
  89. package/docs/500-hosted-pages.md +31 -0
  90. package/package.json +59 -18
  91. package/src/internal/cli/app.ts +72 -0
  92. package/src/internal/cli/bin.ts +3 -0
  93. package/src/internal/cli/commands/ai.ts +44 -0
  94. package/src/internal/cli/commands/auth.ts +195 -0
  95. package/src/internal/cli/commands/call.ts +128 -0
  96. package/src/internal/cli/commands/check.ts +48 -0
  97. package/src/internal/cli/commands/desktop-installer.ts +446 -0
  98. package/src/internal/cli/commands/desktop-release.ts +190 -0
  99. package/src/internal/cli/commands/desktop.ts +47 -0
  100. package/src/internal/cli/commands/docs.ts +34 -0
  101. package/src/internal/cli/commands/serve.ts +322 -0
  102. package/src/internal/cli/environment.ts +54 -0
  103. package/src/internal/cli/login.ts +46 -0
  104. package/src/internal/cli/managed-vite.ts +267 -0
  105. package/src/internal/cli/parse-port.ts +8 -0
  106. package/src/internal/client/auth/auth-api.ts +53 -0
  107. package/src/internal/client/auth/auth-shell.css +74 -0
  108. package/src/internal/client/auth/auth-shell.tsx +167 -0
  109. package/src/internal/client/auth/entry.tsx +26 -0
  110. package/src/internal/client/auth/index.html +13 -0
  111. package/src/internal/client/background-notifications.ts +194 -0
  112. package/src/internal/client/browser-api.ts +97 -0
  113. package/src/internal/client/client-definition.ts +184 -0
  114. package/src/internal/client/commands.tsx +260 -0
  115. package/src/internal/client/host/browser-log-forwarding.ts +149 -0
  116. package/src/internal/client/host/hosted-pages/browser-notification-settings.tsx +118 -0
  117. package/src/internal/client/host/hosted-pages/hosted-page.css +87 -0
  118. package/src/internal/client/host/hosted-pages/hosted-page.tsx +9 -0
  119. package/src/internal/client/host/hosted-pages/logout-page.tsx +75 -0
  120. package/src/internal/client/host/hosted-pages/settings-page.tsx +45 -0
  121. package/src/internal/client/host/notification-forwarding.ts +22 -0
  122. package/src/internal/client/host/overmux-host.tsx +200 -0
  123. package/src/internal/client/host/recovery-screen.css +75 -0
  124. package/src/internal/client/host/recovery-screen.tsx +17 -0
  125. package/src/internal/client/host/update-popover.css +82 -0
  126. package/src/internal/client/host/update-popover.tsx +166 -0
  127. package/src/internal/client/index.ts +45 -0
  128. package/src/internal/client/overmux-react.ts +283 -0
  129. package/src/internal/client/shortcuts.tsx +373 -0
  130. package/src/internal/client/theme-scope.css +114 -0
  131. package/src/internal/client/theme-scope.tsx +107 -0
  132. package/src/internal/client/transport.ts +69 -0
  133. package/src/internal/client/websocket.ts +441 -0
  134. package/src/internal/server/auth/auth-http.ts +414 -0
  135. package/src/internal/server/auth/auth-service.ts +627 -0
  136. package/src/internal/server/auth/auth-shell-http.ts +90 -0
  137. package/src/internal/server/auth/instance-control.ts +381 -0
  138. package/src/internal/server/check-overmux.ts +364 -0
  139. package/src/internal/server/coordinator/ipc-protocol.ts +44 -0
  140. package/src/internal/server/coordinator/server-child.ts +108 -0
  141. package/src/internal/server/coordinator/server-coordinator.ts +262 -0
  142. package/src/internal/server/coordinator/update-watcher.ts +54 -0
  143. package/src/internal/server/http/authenticated-http-app-test-helper.ts +45 -0
  144. package/src/internal/server/http/background-notification-handlers.ts +83 -0
  145. package/src/internal/server/http/control-handlers.ts +44 -0
  146. package/src/internal/server/http/create-http-app.ts +53 -0
  147. package/src/internal/server/http/development-web-backend.ts +83 -0
  148. package/src/internal/server/http/operation-handler.ts +93 -0
  149. package/src/internal/server/http/request-logging.ts +34 -0
  150. package/src/internal/server/http/routes.ts +241 -0
  151. package/src/internal/server/http/runtime-manifest-handler.ts +12 -0
  152. package/src/internal/server/index.ts +16 -0
  153. package/src/internal/server/notifications/background-notification-payload.ts +74 -0
  154. package/src/internal/server/notifications/background-notification-service.ts +139 -0
  155. package/src/internal/server/notifications/background-notification-store.ts +162 -0
  156. package/src/internal/server/notifications/notification-service.ts +70 -0
  157. package/src/internal/server/notifications/private-json-file.ts +84 -0
  158. package/src/internal/server/paths.ts +13 -0
  159. package/src/internal/server/rate-limiter.ts +58 -0
  160. package/src/internal/server/runtime/create-runtime.ts +87 -0
  161. package/src/internal/server/runtime/resource-dependency-graph.ts +128 -0
  162. package/src/internal/server/runtime/runtime-lifecycle.ts +95 -0
  163. package/src/internal/server/runtime/runtime-operations.ts +78 -0
  164. package/src/internal/server/runtime/runtime-resources.ts +201 -0
  165. package/src/internal/server/runtime/runtime-streams.ts +130 -0
  166. package/src/internal/server/server-logger.ts +110 -0
  167. package/src/internal/server/server-startup-options.ts +51 -0
  168. package/src/internal/server/start-application-server.ts +412 -0
  169. package/src/internal/server/start-overmux-server.ts +26 -0
  170. package/src/internal/server/test-port.ts +23 -0
  171. package/src/internal/server/vite-websocket-proxy.ts +201 -0
  172. package/src/internal/server/websocket-connection.ts +586 -0
  173. package/src/internal/server/websocket-limits.ts +2 -0
  174. package/src/internal/server/websocket-server.ts +311 -0
  175. package/src/internal/shared/background-notifications.ts +37 -0
  176. package/src/internal/shared/index.ts +2 -0
  177. package/src/internal/shared/protocol.ts +317 -0
  178. package/src/internal/shared/routes.ts +3 -0
  179. package/src/public/ai-context.ts +44 -0
  180. package/src/public/client.ts +53 -0
  181. package/src/public/config.ts +287 -0
  182. package/src/public/contracts.ts +55 -0
  183. package/src/public/index.ts +57 -0
  184. package/src/public/notifications.ts +10 -0
  185. package/src/public/server.ts +16 -0
  186. package/dist/public/core.ts +0 -119
  187. package/dist/public/protocol.ts +0 -51
  188. package/dist/public/terminal.ts +0 -23
  189. package/dist/web/assets/index-DC___IUw.css +0 -2
  190. package/dist/web/assets/index-DF9Cptse.js +0 -74
  191. package/dist/web/assets/terminal-component-BrP-ENHg.css +0 -1
  192. package/dist/web/assets/terminal-component-DyLEbMrx.js +0 -36
  193. package/dist/web/index.html +0 -14
@@ -0,0 +1,102 @@
1
+ ---
2
+ title: "overmux ai context"
3
+ description: "Set up your coding agent and configure its Overmux context"
4
+ ---
5
+
6
+ # `overmux ai context`
7
+
8
+ Print version-aware Overmux guidance for coding agents as Markdown.
9
+
10
+ ## Usage
11
+
12
+ ```text
13
+ overmux ai context [--config path]
14
+ ```
15
+
16
+ ## Set up your coding agent
17
+
18
+ Add a short instruction that tells your agent how to load the context when it needs Overmux guidance:
19
+
20
+ <CodeBlockTabs defaultValue="agents">
21
+ <CodeBlockTabsList>
22
+ <CodeBlockTabsTrigger value="agents">AGENTS.md</CodeBlockTabsTrigger>
23
+ <CodeBlockTabsTrigger value="claude">CLAUDE.md</CodeBlockTabsTrigger>
24
+ </CodeBlockTabsList>
25
+ <CodeBlockTab value="agents">
26
+
27
+ ```bash
28
+ echo 'Run `overmux ai context` for help configuring Overmux.' >> AGENTS.md
29
+ ```
30
+
31
+ </CodeBlockTab>
32
+ <CodeBlockTab value="claude">
33
+
34
+ ```bash
35
+ echo 'Run `overmux ai context` for help configuring Overmux.' >> CLAUDE.md
36
+ ```
37
+
38
+ </CodeBlockTab>
39
+ </CodeBlockTabs>
40
+
41
+ ## Configure context snippets
42
+
43
+ Set `aiContextSnippets` in `$XDG_CONFIG_HOME/overmux/overmux.config.ts` to choose the guidance included in the command output:
44
+
45
+ ```ts
46
+ import {
47
+ coreAiContextSnippets,
48
+ defineOvermuxConfig,
49
+ } from "overmux";
50
+
51
+ export default defineOvermuxConfig({
52
+ aiContextSnippets: coreAiContextSnippets,
53
+ // ...
54
+ });
55
+ ```
56
+
57
+ When `aiContextSnippets` is omitted, Overmux uses `defaultAiContextSnippets`. Set it to an empty array to emit no context.
58
+
59
+ ## Options
60
+
61
+ | Flag | Description | Default |
62
+ | --- | --- | --- |
63
+ | `--config <path>, -c <path>` | Configuration file | `$XDG_CONFIG_HOME/overmux/overmux.config.ts` |
64
+
65
+ ## Preset groups
66
+
67
+ | Export | Included snippets |
68
+ | --- | --- |
69
+ | `defaultAiContextSnippets` | `package-source`, `tech-stack-recommendations` |
70
+ | `coreAiContextSnippets` | `package-source` |
71
+
72
+ ## Snippet reference
73
+
74
+ ### `package-source`
75
+
76
+ Export: `packageSourceSnippet`
77
+
78
+ Included in the core and default presets. Tells agents to inspect the documentation and TypeScript source shipped in installed Overmux packages so their guidance matches the versions used by the application.
79
+
80
+ ### `tech-stack-recommendations`
81
+
82
+ Export: `techStackRecommendationsSnippet`
83
+
84
+ Included in the default preset. Recommends pnpm, TanStack Router, shadcn/ui, and Zod while deferring to the application's established stack.
85
+
86
+ You can compose an explicit selection from the individual exports:
87
+
88
+ ```ts
89
+ import {
90
+ defineOvermuxConfig,
91
+ packageSourceSnippet,
92
+ techStackRecommendationsSnippet,
93
+ } from "overmux";
94
+
95
+ export default defineOvermuxConfig({
96
+ aiContextSnippets: [
97
+ packageSourceSnippet,
98
+ techStackRecommendationsSnippet,
99
+ ],
100
+ // ...
101
+ });
102
+ ```
@@ -0,0 +1,23 @@
1
+ ---
2
+ title: "overmux docs"
3
+ description: "Print the installed documentation directory"
4
+ ---
5
+
6
+ # `overmux docs`
7
+
8
+ Print the installed documentation directory.
9
+
10
+ ## Usage
11
+
12
+ ```text
13
+ overmux docs
14
+ ```
15
+
16
+ ## Example
17
+
18
+ ```console
19
+ $ overmux docs
20
+ /path/to/project/node_modules/overmux/docs
21
+ ```
22
+
23
+ The command prints the absolute path to the documentation shipped with the installed `overmux` package.
@@ -0,0 +1,35 @@
1
+ ---
2
+ title: "overmux desktop"
3
+ ---
4
+
5
+ # `overmux desktop`
6
+
7
+ Install or upgrade the experimental macOS desktop preview. The desktop version is independent from the `overmux` npm package version.
8
+
9
+ ## Install
10
+
11
+ ```sh
12
+ overmux desktop install
13
+ ```
14
+
15
+ This command is available only on macOS arm64 and x64. It selects the newest stable `desktop-v*` GitHub release supporting the current architecture and installs it only at `~/Applications/Overmux.app`. It refuses to overwrite an existing bundle; use `upgrade` instead.
16
+
17
+ The macOS application is an **experimental unsigned, non-notarized preview**. macOS cannot verify its publisher, compatibility is not guaranteed, and no DMG is published. First install requires interactive confirmation:
18
+
19
+ ```sh
20
+ overmux desktop install --yes
21
+ ```
22
+
23
+ Use `--yes` only when automation has explicitly accepted the unsigned application risk.
24
+
25
+ ## Upgrade
26
+
27
+ ```sh
28
+ overmux desktop upgrade
29
+ ```
30
+
31
+ Upgrade verifies that the existing app has the `com.overmux.desktop` bundle identity before replacing it. A running app is asked to quit; an app that is not running is upgraded normally. The new app is launched, and the previous bundle is restored when replacement or launch fails where practical.
32
+
33
+ Both commands accept release assets only from the fixed official GitHub repository over HTTPS, verify asset size and `SHA256SUMS`, reject unsafe ZIP paths, validate the staged bundle, ad-hoc sign it if needed, and remove quarantine only from that bundle. They never use `sudo` or write to `/Applications`.
34
+
35
+ Checksums detect accidental corruption but are not independent publisher authentication because they are hosted with the artifacts. There is no cryptographically signed release manifest in this experimental distribution.
@@ -0,0 +1,31 @@
1
+ ---
2
+ title: Hosted pages
3
+ description: Link to Overmux-owned settings and logout pages.
4
+ ---
5
+
6
+ # Hosted pages
7
+
8
+ Overmux reserves two authenticated client paths above the user application router:
9
+
10
+ - `/_overmux/settings` provides notification and session settings.
11
+ - `/_overmux/logout` ends the current session and returns to login.
12
+
13
+ Use the neutral public constants when linking from userland or host integrations:
14
+
15
+ ```tsx
16
+ import {
17
+ createOvermuxSettingsPath,
18
+ overmuxLogoutPath,
19
+ } from "overmux";
20
+
21
+ const returnTo = `${location.pathname}${location.search}${location.hash}`;
22
+
23
+ <a href={createOvermuxSettingsPath(returnTo)}>Overmux settings</a>
24
+ <a href={overmuxLogoutPath}>Log out</a>
25
+ ```
26
+
27
+ These are full-document destinations. Do not send them through a userland client router.
28
+
29
+ `createOvermuxSettingsPath(returnTo)` includes a same-origin application path for **Back to Overmux**. Absolute URLs, protocol-relative URLs, login and API paths, and reserved `/_overmux` paths are discarded. Use `resolveOvermuxReturnTo()` when the validated return path is needed separately.
30
+
31
+ Browser notification controls live on the settings page. In the Electron desktop app, settings instead explains that delivery uses the desktop app and notification permissions are managed by the operating system.
@@ -0,0 +1,237 @@
1
+ import { C as ContractInputArguments } from "./index-D3_Dpy_T.js";
2
+ import { z } from "zod";
3
+ import { UseMutationResult } from "@tanstack/react-query";
4
+ import { CSSProperties, ComponentType, ReactNode, RefObject } from "react";
5
+ import { KeyBinding, KeyBinding as KeyBinding$1, formatKeyBinding, keyBindingSchema, matchesKeyBinding } from "@overmux/keybindings";
6
+ declare const enableBackgroundNotifications: () => Promise<boolean>;
7
+ declare const disableBackgroundNotifications: () => Promise<void>;
8
+ type Operations$1<TConfig> = TConfig extends {
9
+ operations?: infer TOperations;
10
+ } ? NonNullable<TOperations> : never;
11
+ type InputOf$1<T> = T extends {
12
+ input: infer TInput extends z.ZodType;
13
+ } ? TInput : never;
14
+ type OutputOf$1<T> = T extends {
15
+ output: infer TOutput extends z.ZodType;
16
+ } ? z.output<TOutput> : never;
17
+ type OperationId<TConfig> = Extract<keyof Operations$1<TConfig>, string>;
18
+ type OperationInput<TConfig, TId extends OperationId<TConfig>> = InputOf$1<Operations$1<TConfig>[TId]>;
19
+ type OperationOutput<TConfig, TId extends OperationId<TConfig>> = OutputOf$1<Operations$1<TConfig>[TId]>;
20
+ type OperationArguments<TInput extends z.ZodType> = [...ContractInputArguments<TInput>, signal?: AbortSignal];
21
+ type OvermuxServerApi<TServerConfig> = {
22
+ executeOperation: <TId extends OperationId<TServerConfig>>(id: TId, ...args: OperationArguments<OperationInput<TServerConfig, TId>>) => Promise<OperationOutput<TServerConfig, TId>>;
23
+ };
24
+ type OvermuxScheme = "dark" | "light" | "system";
25
+ type OvermuxContrast = "auto" | "high" | "normal";
26
+ declare const overmuxThemeTokens: readonly ["--om-color-accent", "--om-color-accent-fg", "--om-color-border", "--om-color-canvas", "--om-color-danger", "--om-color-fg", "--om-color-muted", "--om-color-panel", "--om-color-success", "--om-color-surface", "--om-elevation", "--om-focus-ring", "--om-font-mono", "--om-font-sans", "--om-motion-duration", "--om-radius", "--om-spacing"];
27
+ type OvermuxThemeToken = (typeof overmuxThemeTokens)[number];
28
+ type OvermuxStyle = CSSProperties & Partial<Record<OvermuxThemeToken, number | string>>;
29
+ type OvermuxExternalPortalContainer = {
30
+ container: HTMLElement;
31
+ scopeAttributesAndVariables: "caller-owned";
32
+ };
33
+ type OvermuxPortalProps = {
34
+ children: ReactNode;
35
+ external?: OvermuxExternalPortalContainer;
36
+ };
37
+ type OvermuxThemeScopeProps = {
38
+ children: ReactNode;
39
+ className?: string;
40
+ contrast?: OvermuxContrast;
41
+ scheme?: OvermuxScheme;
42
+ style?: OvermuxStyle;
43
+ };
44
+ declare const OvermuxPortal: ({ children, external }: OvermuxPortalProps) => import("react").ReactPortal | null;
45
+ declare const OvermuxThemeScope: ({ children, className, contrast, scheme, style }: OvermuxThemeScopeProps) => import("react").JSX.Element;
46
+ type KeySequence = readonly [KeyBinding$1, KeyBinding$1, ...KeyBinding$1[]];
47
+ type ShortcutBinding = KeyBinding$1 | KeySequence;
48
+ type ConditionalShortcutBinding = {
49
+ binding: ShortcutBinding;
50
+ when: {
51
+ media: string;
52
+ };
53
+ };
54
+ type CommandBinding = ShortcutBinding | ConditionalShortcutBinding;
55
+ type ChordPrefix = {
56
+ binding: KeyBinding$1;
57
+ unmatched: "replay-to-focused-input";
58
+ };
59
+ declare const shortcutBindingSchema: z.ZodUnion<readonly [z.ZodCustom<KeyBinding$1, KeyBinding$1>, z.ZodArray<z.ZodCustom<KeyBinding$1, KeyBinding$1>>]>;
60
+ declare const commandBindingSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodCustom<KeyBinding$1, KeyBinding$1>, z.ZodArray<z.ZodCustom<KeyBinding$1, KeyBinding$1>>]>, z.ZodObject<{
61
+ binding: z.ZodUnion<readonly [z.ZodCustom<KeyBinding$1, KeyBinding$1>, z.ZodArray<z.ZodCustom<KeyBinding$1, KeyBinding$1>>]>;
62
+ when: z.ZodObject<{
63
+ media: z.ZodString;
64
+ }, z.core.$strip>;
65
+ }, z.core.$strip>]>;
66
+ declare const chordPrefixSchema: z.ZodObject<{
67
+ binding: z.ZodCustom<KeyBinding$1, KeyBinding$1>;
68
+ unmatched: z.ZodLiteral<"replay-to-focused-input">;
69
+ }, z.core.$strip>;
70
+ declare const formatShortcutBinding: (binding: ShortcutBinding) => string;
71
+ type CommandRunResult$1 = Promise<unknown> | unknown;
72
+ type CommandRun<TServerConfig, TParams> = (input: {
73
+ overmuxServerApi: OvermuxServerApi<TServerConfig>;
74
+ params: TParams;
75
+ }) => CommandRunResult$1;
76
+ type CommandDefinitionSource = {
77
+ defaultBindings?: readonly CommandBinding[];
78
+ params?: z.ZodType;
79
+ run?: unknown;
80
+ title: string;
81
+ };
82
+ type ParamsSchema$1<TCommand> = TCommand extends {
83
+ params: infer TParams extends z.ZodType;
84
+ } ? TParams : undefined;
85
+ type ParamsOutput<TCommand> = ParamsSchema$1<TCommand> extends z.ZodType ? z.output<ParamsSchema$1<TCommand>> : undefined;
86
+ type CheckedCommand<TServerConfig, TCommand extends CommandDefinitionSource> = { [TKey in keyof TCommand]: TKey extends "run" ? CommandRun<TServerConfig, ParamsOutput<TCommand>> : TCommand[TKey]; } & {
87
+ defaultBindings?: readonly CommandBinding[];
88
+ params?: z.ZodType;
89
+ title: string;
90
+ };
91
+ type CheckedCommands<TServerConfig, TCommands extends Record<string, CommandDefinitionSource>> = { [TId in keyof TCommands]: CheckedCommand<TServerConfig, TCommands[TId]>; };
92
+ type CommandHandle<TId extends string = string> = {
93
+ defaultBindings?: readonly CommandBinding[];
94
+ id: TId;
95
+ params?: z.ZodType;
96
+ run?: unknown;
97
+ title: string;
98
+ };
99
+ type DefinedCommands<TServerConfig, TCommands extends Record<string, CommandDefinitionSource>> = { readonly [TId in keyof TCommands]: CheckedCommand<TServerConfig, TCommands[TId]> & {
100
+ readonly id: Extract<TId, string>;
101
+ }; };
102
+ declare const defineCommandRegistry: <TServerConfig>() => <const TCommands extends Record<string, CommandDefinitionSource>>(commands: CheckedCommands<TServerConfig, TCommands>) => DefinedCommands<TServerConfig, TCommands>;
103
+ type CommandRegistry = Readonly<Record<string, CommandHandle>>;
104
+ type OvermuxClientAppearance = {
105
+ contrast?: OvermuxContrast;
106
+ scheme?: OvermuxScheme;
107
+ };
108
+ type ClientAppDefinition<TCommands extends CommandRegistry = CommandRegistry> = {
109
+ appearance?: OvermuxClientAppearance;
110
+ chordPrefixes?: readonly ChordPrefix[];
111
+ commands: TCommands;
112
+ component: ComponentType;
113
+ shortcutOverrides?: Partial<Record<Extract<keyof TCommands, string>, readonly CommandBinding[]>>;
114
+ };
115
+ declare const defineOvermuxClient: <const TCommands extends CommandRegistry>(definition: ClientAppDefinition<TCommands>) => ClientAppDefinition<TCommands>;
116
+ type CommandRunResult = Promise<unknown> | unknown;
117
+ type LocalCommandRun = () => CommandRunResult;
118
+ type ParamsSchema<TCommand> = TCommand extends {
119
+ params: infer TParams extends z.ZodType;
120
+ } ? TParams : undefined;
121
+ type RegistrationParams<TCommand> = ParamsSchema<TCommand> extends z.ZodType ? {
122
+ params: z.input<ParamsSchema<TCommand>>;
123
+ } : {
124
+ params?: never;
125
+ };
126
+ type RegistrationRun<TCommand> = TCommand extends {
127
+ run: (...args: never[]) => unknown;
128
+ } ? {
129
+ run?: LocalCommandRun;
130
+ } : {
131
+ run: LocalCommandRun;
132
+ };
133
+ type CommandRegistration<TCommand> = RegistrationParams<TCommand> & RegistrationRun<TCommand> & {
134
+ element?: RefObject<HTMLElement | null>;
135
+ enabled?: boolean;
136
+ };
137
+ type UseCommandRegistration<TCommand> = ParamsSchema<TCommand> extends z.ZodType ? CommandRegistration<TCommand> | SkipToken : CommandRegistration<TCommand>;
138
+ declare const skipToken: unique symbol;
139
+ type SkipToken = typeof skipToken;
140
+ declare const useCommand: <TCommand extends CommandHandle>(command: TCommand, registration: UseCommandRegistration<TCommand>) => void;
141
+ type CommandEntry = {
142
+ bindings: readonly ShortcutBinding[];
143
+ disabledReason?: string;
144
+ enabled: boolean;
145
+ execute: () => Promise<void>;
146
+ id: string;
147
+ title: string;
148
+ };
149
+ declare const useCommands: () => readonly CommandEntry[];
150
+ type Resources<TConfig> = TConfig extends {
151
+ resources?: infer TResources;
152
+ } ? NonNullable<TResources> : never;
153
+ type Operations<TConfig> = TConfig extends {
154
+ operations?: infer TOperations;
155
+ } ? NonNullable<TOperations> : never;
156
+ type Streams<TConfig> = TConfig extends {
157
+ streams?: infer TStreams;
158
+ } ? NonNullable<TStreams> : never;
159
+ type ContractOf<T> = T extends {
160
+ contract: infer TContract;
161
+ } ? TContract : never;
162
+ type InputOf<T> = T extends {
163
+ input: infer TInput extends z.ZodType;
164
+ } ? TInput : never;
165
+ type OutputOf<T> = T extends {
166
+ output: infer TOutput extends z.ZodType;
167
+ } ? z.output<TOutput> : never;
168
+ type ClientMessageOf<T> = ContractOf<T> extends {
169
+ clientMessage: infer TMessage extends z.ZodType;
170
+ } ? z.input<TMessage> : never;
171
+ type ServerMessageOf<T> = ContractOf<T> extends {
172
+ serverMessage: infer TMessage extends z.ZodType;
173
+ } ? z.output<TMessage> : never;
174
+ type InputProperty<TInput extends z.ZodType> = undefined extends z.input<TInput> ? {
175
+ input?: Exclude<z.input<TInput>, undefined>;
176
+ } : {
177
+ input: z.input<TInput>;
178
+ };
179
+ type OperationOptions<TId extends string, TInput extends z.ZodType> = {
180
+ id: TId;
181
+ } & InputProperty<TInput>;
182
+ type UseResource<TServerConfig> = {
183
+ <TId extends Extract<keyof Resources<TServerConfig>, string>>(options: OperationOptions<TId, InputOf<ContractOf<Resources<TServerConfig>[TId]>>>): ResourceResult<OutputOf<ContractOf<Resources<TServerConfig>[TId]>>>;
184
+ <TId extends Extract<keyof Resources<TServerConfig>, string>>(options: {
185
+ id: TId;
186
+ input: SkipToken;
187
+ }): undefined;
188
+ <TId extends Extract<keyof Resources<TServerConfig>, string>>(options: {
189
+ id: TId;
190
+ input: z.input<InputOf<ContractOf<Resources<TServerConfig>[TId]>>> | SkipToken;
191
+ }): ResourceResult<OutputOf<ContractOf<Resources<TServerConfig>[TId]>>> | undefined;
192
+ };
193
+ type ResourceResult<T> = {
194
+ data?: never;
195
+ error?: never;
196
+ refetch: () => void;
197
+ status: "pending";
198
+ } | {
199
+ data?: T;
200
+ error: Error;
201
+ refetch: () => void;
202
+ status: "error";
203
+ } | {
204
+ data: T;
205
+ error?: never;
206
+ refetch: () => void;
207
+ status: "success";
208
+ };
209
+ type StreamResult<TClientMessage, TServerMessage> = {
210
+ close: () => void;
211
+ error?: Error;
212
+ send: (message: TClientMessage) => boolean;
213
+ status: "closed" | "open" | "opening";
214
+ subscribe: (listener: (message: TServerMessage) => void) => () => void;
215
+ };
216
+ type OperationResult<TInputSchema extends z.ZodType, TOutput> = Omit<UseMutationResult<TOutput, Error, z.input<TInputSchema>>, "mutate" | "mutateAsync"> & {
217
+ mutate: (...args: ContractInputArguments<TInputSchema>) => void;
218
+ mutateAsync: (...args: ContractInputArguments<TInputSchema>) => Promise<TOutput>;
219
+ };
220
+ declare const createOvermuxHooks: <TServerConfig>() => {
221
+ useOperation: <TId extends Extract<keyof Operations<TServerConfig>, string>>({ id, signal }: {
222
+ id: TId;
223
+ signal?: AbortSignal;
224
+ }) => OperationResult<InputOf<Operations<TServerConfig>[TId]>, OutputOf<Operations<TServerConfig>[TId]>>;
225
+ useResource: UseResource<TServerConfig>;
226
+ useStream: <TId extends Extract<keyof Streams<TServerConfig>, string>>({ id, input }: OperationOptions<TId, InputOf<ContractOf<Streams<TServerConfig>[TId]>>>) => StreamResult<ClientMessageOf<Streams<TServerConfig>[TId]>, ServerMessageOf<Streams<TServerConfig>[TId]>>;
227
+ };
228
+ declare const OvermuxHost: ({ definition }: {
229
+ definition: ClientAppDefinition;
230
+ }) => import("react").JSX.Element;
231
+ type ShortcutInputTarget = {
232
+ container: RefObject<HTMLElement | null>;
233
+ input: RefObject<HTMLElement | null>;
234
+ };
235
+ 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 };
237
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +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;KACnC;EACV,SAAS;EACT;;cAGW,uBAAqB,EAAA,mBAAA,EAAA,UAAA,cAAA,eAAA,EAAA,SAAA,EAAA,UAAA,cAAA;cAIrB,sBAAoB,EAAA,mBAAA,EAAA,mBAAA,EAAA,UAAA,cAAA,eAAA,EAAA,SAAA,EAAA,UAAA,cAAA,kBAAA,EAAA;;;;;GAM/B,EAAA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