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.
- package/CHANGELOG.md +11 -0
- package/dist/bin.js +339 -7
- package/dist/bin.js.map +1 -1
- package/dist/docs/200-getting-started/100-install-and-run-overmux.md +1 -2
- package/dist/docs/300-fundamentals/100-project-structure.md +20 -0
- package/dist/docs/400-reference/300-client-api.md +17 -0
- package/dist/docs/400-reference/400-cli/050-init.md +17 -0
- package/dist/exports/client.d.ts +18 -1
- package/dist/exports/client.d.ts.map +1 -1
- package/dist/exports/client.js +24 -2
- package/dist/exports/client.js.map +1 -1
- package/docs/200-getting-started/100-install-and-run-overmux.md +1 -2
- package/docs/300-fundamentals/100-project-structure.md +20 -0
- package/docs/400-reference/300-client-api.md +17 -0
- package/docs/400-reference/400-cli/050-init.md +17 -0
- package/package.json +2 -2
- package/src/internal/cli/app.ts +5 -1
- package/src/internal/cli/commands/init-template.ts +146 -0
- package/src/internal/cli/commands/init.ts +267 -0
- package/src/internal/cli/commands/integration.ts +15 -0
- package/src/internal/cli/commands/zellij-install.ts +96 -0
- package/src/internal/client/clipboard.ts +22 -0
- package/src/internal/client/host/desktop-host.ts +12 -0
- package/src/internal/client/host/notification-forwarding.ts +1 -10
- package/src/internal/client/websocket.ts +17 -9
- package/src/public/client.ts +4 -0
|
@@ -1,18 +1,9 @@
|
|
|
1
|
+
import "./desktop-host";
|
|
1
2
|
import { notificationEventSchema } from "../../shared/index";
|
|
2
3
|
|
|
3
4
|
import type { WebSocketTransport } from "../transport";
|
|
4
5
|
|
|
5
6
|
// Forwards server notifications to the optional desktop host injected at window.overmuxHost.
|
|
6
|
-
type NotificationHost = {
|
|
7
|
-
notifications?: { show: (notification: unknown) => void; version: 1 };
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
declare global {
|
|
11
|
-
interface Window {
|
|
12
|
-
overmuxHost?: NotificationHost;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
7
|
export const installNotificationForwarding = (transport: WebSocketTransport) =>
|
|
17
8
|
transport.subscribeNotification((event) => {
|
|
18
9
|
const notification = notificationEventSchema.safeParse(event);
|
|
@@ -335,6 +335,10 @@ export const createWebSocketTransport = ({
|
|
|
335
335
|
onOpen,
|
|
336
336
|
streamName,
|
|
337
337
|
}) => {
|
|
338
|
+
if (!active || disposed) {
|
|
339
|
+
onError(disconnected());
|
|
340
|
+
return { close: () => {}, send: () => false };
|
|
341
|
+
}
|
|
338
342
|
const streamId = operationId();
|
|
339
343
|
const stream: Stream = {
|
|
340
344
|
input,
|
|
@@ -347,15 +351,19 @@ export const createWebSocketTransport = ({
|
|
|
347
351
|
streamName,
|
|
348
352
|
};
|
|
349
353
|
streams.set(streamId, stream);
|
|
350
|
-
stream
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
354
|
+
// Initial connection is not a failure: restore sends stream-open when the socket
|
|
355
|
+
// opens, then stream-opened flushes queued messages. Actual failures still reject.
|
|
356
|
+
stream.status =
|
|
357
|
+
socket?.readyState === WebSocket.CONNECTING ||
|
|
358
|
+
send({
|
|
359
|
+
input,
|
|
360
|
+
operationId: streamId,
|
|
361
|
+
streamId,
|
|
362
|
+
streamName,
|
|
363
|
+
type: "stream-open",
|
|
364
|
+
})
|
|
365
|
+
? "opening"
|
|
366
|
+
: "disconnected";
|
|
359
367
|
if (stream.status === "disconnected") {
|
|
360
368
|
onError(disconnected());
|
|
361
369
|
}
|
package/src/public/client.ts
CHANGED
|
@@ -2,6 +2,10 @@ export {
|
|
|
2
2
|
disableBackgroundNotifications,
|
|
3
3
|
enableBackgroundNotifications,
|
|
4
4
|
} from "../internal/client/background-notifications";
|
|
5
|
+
export {
|
|
6
|
+
readClipboardText,
|
|
7
|
+
writeClipboardText,
|
|
8
|
+
} from "../internal/client/clipboard";
|
|
5
9
|
export type { OvermuxServerApi } from "../internal/client/browser-api";
|
|
6
10
|
export {
|
|
7
11
|
createOvermuxHooks,
|