parasor 0.1.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/LICENSE +21 -0
- package/README.md +208 -0
- package/THIRD-PARTY-NOTICES.md +138 -0
- package/bin/parasor.mjs +3 -0
- package/node_modules/@parasor/shared/dist/client.d.ts +8 -0
- package/node_modules/@parasor/shared/dist/client.d.ts.map +1 -0
- package/node_modules/@parasor/shared/dist/client.js +2 -0
- package/node_modules/@parasor/shared/dist/client.js.map +1 -0
- package/node_modules/@parasor/shared/dist/drops.d.ts +24 -0
- package/node_modules/@parasor/shared/dist/drops.d.ts.map +1 -0
- package/node_modules/@parasor/shared/dist/drops.js +2 -0
- package/node_modules/@parasor/shared/dist/drops.js.map +1 -0
- package/node_modules/@parasor/shared/dist/file-uploads.d.ts +56 -0
- package/node_modules/@parasor/shared/dist/file-uploads.d.ts.map +1 -0
- package/node_modules/@parasor/shared/dist/file-uploads.js +13 -0
- package/node_modules/@parasor/shared/dist/file-uploads.js.map +1 -0
- package/node_modules/@parasor/shared/dist/ide-commands.d.ts +8 -0
- package/node_modules/@parasor/shared/dist/ide-commands.d.ts.map +1 -0
- package/node_modules/@parasor/shared/dist/ide-commands.js +59 -0
- package/node_modules/@parasor/shared/dist/ide-commands.js.map +1 -0
- package/node_modules/@parasor/shared/dist/pane-commands.d.ts +7 -0
- package/node_modules/@parasor/shared/dist/pane-commands.d.ts.map +1 -0
- package/node_modules/@parasor/shared/dist/pane-commands.js +47 -0
- package/node_modules/@parasor/shared/dist/pane-commands.js.map +1 -0
- package/node_modules/@parasor/shared/dist/pane-model.d.ts +63 -0
- package/node_modules/@parasor/shared/dist/pane-model.d.ts.map +1 -0
- package/node_modules/@parasor/shared/dist/pane-model.js +89 -0
- package/node_modules/@parasor/shared/dist/pane-model.js.map +1 -0
- package/node_modules/@parasor/shared/dist/panes.d.ts +33 -0
- package/node_modules/@parasor/shared/dist/panes.d.ts.map +1 -0
- package/node_modules/@parasor/shared/dist/panes.js +2 -0
- package/node_modules/@parasor/shared/dist/panes.js.map +1 -0
- package/node_modules/@parasor/shared/dist/runtime.d.ts +180 -0
- package/node_modules/@parasor/shared/dist/runtime.d.ts.map +1 -0
- package/node_modules/@parasor/shared/dist/runtime.js +2 -0
- package/node_modules/@parasor/shared/dist/runtime.js.map +1 -0
- package/node_modules/@parasor/shared/dist/state.d.ts +192 -0
- package/node_modules/@parasor/shared/dist/state.d.ts.map +1 -0
- package/node_modules/@parasor/shared/dist/state.js +10 -0
- package/node_modules/@parasor/shared/dist/state.js.map +1 -0
- package/node_modules/@parasor/shared/dist/terminal.d.ts +191 -0
- package/node_modules/@parasor/shared/dist/terminal.d.ts.map +1 -0
- package/node_modules/@parasor/shared/dist/terminal.js +174 -0
- package/node_modules/@parasor/shared/dist/terminal.js.map +1 -0
- package/node_modules/@parasor/shared/dist/types.d.ts +13 -0
- package/node_modules/@parasor/shared/dist/types.d.ts.map +1 -0
- package/node_modules/@parasor/shared/dist/types.js +13 -0
- package/node_modules/@parasor/shared/dist/types.js.map +1 -0
- package/node_modules/@parasor/shared/dist/worktree-local-files.d.ts +14 -0
- package/node_modules/@parasor/shared/dist/worktree-local-files.d.ts.map +1 -0
- package/node_modules/@parasor/shared/dist/worktree-local-files.js +41 -0
- package/node_modules/@parasor/shared/dist/worktree-local-files.js.map +1 -0
- package/node_modules/@parasor/shared/dist/ws-events.d.ts +152 -0
- package/node_modules/@parasor/shared/dist/ws-events.d.ts.map +1 -0
- package/node_modules/@parasor/shared/dist/ws-events.js +2 -0
- package/node_modules/@parasor/shared/dist/ws-events.js.map +1 -0
- package/node_modules/@parasor/shared/package.json +13 -0
- package/package.json +61 -0
- package/server/agent-detector/agent-state-store.d.ts +23 -0
- package/server/agent-detector/agent-state-store.d.ts.map +1 -0
- package/server/agent-detector/agent-state-store.js +110 -0
- package/server/agent-detector/agent-state-store.js.map +1 -0
- package/server/agent-detector/detector.d.ts +80 -0
- package/server/agent-detector/detector.d.ts.map +1 -0
- package/server/agent-detector/detector.js +219 -0
- package/server/agent-detector/detector.js.map +1 -0
- package/server/agent-detector/event-map.d.ts +25 -0
- package/server/agent-detector/event-map.d.ts.map +1 -0
- package/server/agent-detector/event-map.js +136 -0
- package/server/agent-detector/event-map.js.map +1 -0
- package/server/agent-detector/manual-agent-tracker.d.ts +19 -0
- package/server/agent-detector/manual-agent-tracker.d.ts.map +1 -0
- package/server/agent-detector/manual-agent-tracker.js +123 -0
- package/server/agent-detector/manual-agent-tracker.js.map +1 -0
- package/server/agent-detector/output-eligibility.d.ts +3 -0
- package/server/agent-detector/output-eligibility.d.ts.map +1 -0
- package/server/agent-detector/output-eligibility.js +39 -0
- package/server/agent-detector/output-eligibility.js.map +1 -0
- package/server/application/files/errors.d.ts +28 -0
- package/server/application/files/errors.d.ts.map +1 -0
- package/server/application/files/errors.js +55 -0
- package/server/application/files/errors.js.map +1 -0
- package/server/application/files/local-filesystem.d.ts +36 -0
- package/server/application/files/local-filesystem.d.ts.map +1 -0
- package/server/application/files/local-filesystem.js +171 -0
- package/server/application/files/local-filesystem.js.map +1 -0
- package/server/application/files/project-file-queries.d.ts +16 -0
- package/server/application/files/project-file-queries.d.ts.map +1 -0
- package/server/application/files/project-file-queries.js +126 -0
- package/server/application/files/project-file-queries.js.map +1 -0
- package/server/application/integrations/errors.d.ts +16 -0
- package/server/application/integrations/errors.d.ts.map +1 -0
- package/server/application/integrations/errors.js +31 -0
- package/server/application/integrations/errors.js.map +1 -0
- package/server/application/integrations/hook-notify.d.ts +32 -0
- package/server/application/integrations/hook-notify.d.ts.map +1 -0
- package/server/application/integrations/hook-notify.js +118 -0
- package/server/application/integrations/hook-notify.js.map +1 -0
- package/server/application/integrations/open-url.d.ts +11 -0
- package/server/application/integrations/open-url.d.ts.map +1 -0
- package/server/application/integrations/open-url.js +23 -0
- package/server/application/integrations/open-url.js.map +1 -0
- package/server/application/ports.d.ts +11 -0
- package/server/application/ports.d.ts.map +1 -0
- package/server/application/ports.js +2 -0
- package/server/application/ports.js.map +1 -0
- package/server/application/workspace/errors.d.ts +21 -0
- package/server/application/workspace/errors.d.ts.map +1 -0
- package/server/application/workspace/errors.js +21 -0
- package/server/application/workspace/errors.js.map +1 -0
- package/server/application/workspace/pane-commands.d.ts +47 -0
- package/server/application/workspace/pane-commands.d.ts.map +1 -0
- package/server/application/workspace/pane-commands.js +193 -0
- package/server/application/workspace/pane-commands.js.map +1 -0
- package/server/application/workspace/project-commands.d.ts +34 -0
- package/server/application/workspace/project-commands.d.ts.map +1 -0
- package/server/application/workspace/project-commands.js +81 -0
- package/server/application/workspace/project-commands.js.map +1 -0
- package/server/application/workspace/project-queries.d.ts +21 -0
- package/server/application/workspace/project-queries.d.ts.map +1 -0
- package/server/application/workspace/project-queries.js +216 -0
- package/server/application/workspace/project-queries.js.map +1 -0
- package/server/application/workspace/session-commands.d.ts +24 -0
- package/server/application/workspace/session-commands.d.ts.map +1 -0
- package/server/application/workspace/session-commands.js +123 -0
- package/server/application/workspace/session-commands.js.map +1 -0
- package/server/application/workspace/session-queries.d.ts +14 -0
- package/server/application/workspace/session-queries.d.ts.map +1 -0
- package/server/application/workspace/session-queries.js +47 -0
- package/server/application/workspace/session-queries.js.map +1 -0
- package/server/application/workspace/worktree-commands.d.ts +98 -0
- package/server/application/workspace/worktree-commands.d.ts.map +1 -0
- package/server/application/workspace/worktree-commands.js +323 -0
- package/server/application/workspace/worktree-commands.js.map +1 -0
- package/server/application/workspace/worktree-local-files.d.ts +11 -0
- package/server/application/workspace/worktree-local-files.d.ts.map +1 -0
- package/server/application/workspace/worktree-local-files.js +223 -0
- package/server/application/workspace/worktree-local-files.js.map +1 -0
- package/server/application/workspace/worktree-reconcile.d.ts +21 -0
- package/server/application/workspace/worktree-reconcile.d.ts.map +1 -0
- package/server/application/workspace/worktree-reconcile.js +49 -0
- package/server/application/workspace/worktree-reconcile.js.map +1 -0
- package/server/auth/origin.d.ts +17 -0
- package/server/auth/origin.d.ts.map +1 -0
- package/server/auth/origin.js +93 -0
- package/server/auth/origin.js.map +1 -0
- package/server/auth/pairing-token.d.ts +28 -0
- package/server/auth/pairing-token.d.ts.map +1 -0
- package/server/auth/pairing-token.js +46 -0
- package/server/auth/pairing-token.js.map +1 -0
- package/server/auth/token-exchange.d.ts +11 -0
- package/server/auth/token-exchange.d.ts.map +1 -0
- package/server/auth/token-exchange.js +27 -0
- package/server/auth/token-exchange.js.map +1 -0
- package/server/auth/token.d.ts +18 -0
- package/server/auth/token.d.ts.map +1 -0
- package/server/auth/token.js +115 -0
- package/server/auth/token.js.map +1 -0
- package/server/bootstrap/create-app-server.d.ts +49 -0
- package/server/bootstrap/create-app-server.d.ts.map +1 -0
- package/server/bootstrap/create-app-server.js +154 -0
- package/server/bootstrap/create-app-server.js.map +1 -0
- package/server/bootstrap/project-runtime.d.ts +29 -0
- package/server/bootstrap/project-runtime.d.ts.map +1 -0
- package/server/bootstrap/project-runtime.js +253 -0
- package/server/bootstrap/project-runtime.js.map +1 -0
- package/server/bootstrap/pty-env.d.ts +3 -0
- package/server/bootstrap/pty-env.d.ts.map +1 -0
- package/server/bootstrap/pty-env.js +15 -0
- package/server/bootstrap/pty-env.js.map +1 -0
- package/server/bootstrap/reconcile-state.d.ts +16 -0
- package/server/bootstrap/reconcile-state.d.ts.map +1 -0
- package/server/bootstrap/reconcile-state.js +73 -0
- package/server/bootstrap/reconcile-state.js.map +1 -0
- package/server/bootstrap/runtime-loops.d.ts +51 -0
- package/server/bootstrap/runtime-loops.d.ts.map +1 -0
- package/server/bootstrap/runtime-loops.js +189 -0
- package/server/bootstrap/runtime-loops.js.map +1 -0
- package/server/bootstrap/runtime-port.d.ts +4 -0
- package/server/bootstrap/runtime-port.d.ts.map +1 -0
- package/server/bootstrap/runtime-port.js +52 -0
- package/server/bootstrap/runtime-port.js.map +1 -0
- package/server/bootstrap/safety-gate.d.ts +22 -0
- package/server/bootstrap/safety-gate.d.ts.map +1 -0
- package/server/bootstrap/safety-gate.js +43 -0
- package/server/bootstrap/safety-gate.js.map +1 -0
- package/server/bootstrap/shutdown-marker.d.ts +35 -0
- package/server/bootstrap/shutdown-marker.d.ts.map +1 -0
- package/server/bootstrap/shutdown-marker.js +100 -0
- package/server/bootstrap/shutdown-marker.js.map +1 -0
- package/server/bootstrap/shutdown-runtime.d.ts +62 -0
- package/server/bootstrap/shutdown-runtime.d.ts.map +1 -0
- package/server/bootstrap/shutdown-runtime.js +66 -0
- package/server/bootstrap/shutdown-runtime.js.map +1 -0
- package/server/bootstrap/startup-banner.d.ts +34 -0
- package/server/bootstrap/startup-banner.d.ts.map +1 -0
- package/server/bootstrap/startup-banner.js +114 -0
- package/server/bootstrap/startup-banner.js.map +1 -0
- package/server/bootstrap/wire-runtime.d.ts +42 -0
- package/server/bootstrap/wire-runtime.d.ts.map +1 -0
- package/server/bootstrap/wire-runtime.js +205 -0
- package/server/bootstrap/wire-runtime.js.map +1 -0
- package/server/cli/help.d.ts +3 -0
- package/server/cli/help.d.ts.map +1 -0
- package/server/cli/help.js +39 -0
- package/server/cli/help.js.map +1 -0
- package/server/cli/hook-client.d.ts +12 -0
- package/server/cli/hook-client.d.ts.map +1 -0
- package/server/cli/hook-client.js +81 -0
- package/server/cli/hook-client.js.map +1 -0
- package/server/cli/hook.d.ts +3 -0
- package/server/cli/hook.d.ts.map +1 -0
- package/server/cli/hook.js +152 -0
- package/server/cli/hook.js.map +1 -0
- package/server/cli/main.d.ts +2 -0
- package/server/cli/main.d.ts.map +1 -0
- package/server/cli/main.js +133 -0
- package/server/cli/main.js.map +1 -0
- package/server/cli/notify.d.ts +19 -0
- package/server/cli/notify.d.ts.map +1 -0
- package/server/cli/notify.js +77 -0
- package/server/cli/notify.js.map +1 -0
- package/server/cli/open.d.ts +2 -0
- package/server/cli/open.d.ts.map +1 -0
- package/server/cli/open.js +47 -0
- package/server/cli/open.js.map +1 -0
- package/server/cli/probe-daemon-version.d.ts +46 -0
- package/server/cli/probe-daemon-version.d.ts.map +1 -0
- package/server/cli/probe-daemon-version.js +167 -0
- package/server/cli/probe-daemon-version.js.map +1 -0
- package/server/cli/pty-host.d.ts +36 -0
- package/server/cli/pty-host.d.ts.map +1 -0
- package/server/cli/pty-host.js +390 -0
- package/server/cli/pty-host.js.map +1 -0
- package/server/cli/qr.d.ts +2 -0
- package/server/cli/qr.d.ts.map +1 -0
- package/server/cli/qr.js +70 -0
- package/server/cli/qr.js.map +1 -0
- package/server/cli/restart-confirm.d.ts +33 -0
- package/server/cli/restart-confirm.d.ts.map +1 -0
- package/server/cli/restart-confirm.js +107 -0
- package/server/cli/restart-confirm.js.map +1 -0
- package/server/cli/restart.d.ts +17 -0
- package/server/cli/restart.d.ts.map +1 -0
- package/server/cli/restart.js +145 -0
- package/server/cli/restart.js.map +1 -0
- package/server/cli/service-darwin.d.ts +70 -0
- package/server/cli/service-darwin.d.ts.map +1 -0
- package/server/cli/service-darwin.js +562 -0
- package/server/cli/service-darwin.js.map +1 -0
- package/server/cli/service-linux.d.ts +81 -0
- package/server/cli/service-linux.d.ts.map +1 -0
- package/server/cli/service-linux.js +412 -0
- package/server/cli/service-linux.js.map +1 -0
- package/server/cli/service.d.ts +33 -0
- package/server/cli/service.d.ts.map +1 -0
- package/server/cli/service.js +133 -0
- package/server/cli/service.js.map +1 -0
- package/server/cli/shim-installer.d.ts +35 -0
- package/server/cli/shim-installer.d.ts.map +1 -0
- package/server/cli/shim-installer.js +662 -0
- package/server/cli/shim-installer.js.map +1 -0
- package/server/cli/shim-open.d.ts +2 -0
- package/server/cli/shim-open.d.ts.map +1 -0
- package/server/cli/shim-open.js +128 -0
- package/server/cli/shim-open.js.map +1 -0
- package/server/cli/shutdown-deps.d.ts +41 -0
- package/server/cli/shutdown-deps.d.ts.map +1 -0
- package/server/cli/shutdown-deps.js +158 -0
- package/server/cli/shutdown-deps.js.map +1 -0
- package/server/cli/stop.d.ts +11 -0
- package/server/cli/stop.d.ts.map +1 -0
- package/server/cli/stop.js +123 -0
- package/server/cli/stop.js.map +1 -0
- package/server/cli/unknown-command.d.ts +8 -0
- package/server/cli/unknown-command.d.ts.map +1 -0
- package/server/cli/unknown-command.js +14 -0
- package/server/cli/unknown-command.js.map +1 -0
- package/server/debug/agent-status-recorder.d.ts +57 -0
- package/server/debug/agent-status-recorder.d.ts.map +1 -0
- package/server/debug/agent-status-recorder.js +209 -0
- package/server/debug/agent-status-recorder.js.map +1 -0
- package/server/debug/terminal-trace-recorder.d.ts +41 -0
- package/server/debug/terminal-trace-recorder.d.ts.map +1 -0
- package/server/debug/terminal-trace-recorder.js +112 -0
- package/server/debug/terminal-trace-recorder.js.map +1 -0
- package/server/fonts/catalog.d.ts +35 -0
- package/server/fonts/catalog.d.ts.map +1 -0
- package/server/fonts/catalog.js +76 -0
- package/server/fonts/catalog.js.map +1 -0
- package/server/fonts/installer.d.ts +45 -0
- package/server/fonts/installer.d.ts.map +1 -0
- package/server/fonts/installer.js +201 -0
- package/server/fonts/installer.js.map +1 -0
- package/server/fonts/routes.d.ts +4 -0
- package/server/fonts/routes.d.ts.map +1 -0
- package/server/fonts/routes.js +91 -0
- package/server/fonts/routes.js.map +1 -0
- package/server/fs/drops.d.ts +50 -0
- package/server/fs/drops.d.ts.map +1 -0
- package/server/fs/drops.js +137 -0
- package/server/fs/drops.js.map +1 -0
- package/server/fs/file-uploads.d.ts +57 -0
- package/server/fs/file-uploads.d.ts.map +1 -0
- package/server/fs/file-uploads.js +214 -0
- package/server/fs/file-uploads.js.map +1 -0
- package/server/fs/file-watcher.d.ts +22 -0
- package/server/fs/file-watcher.d.ts.map +1 -0
- package/server/fs/file-watcher.js +105 -0
- package/server/fs/file-watcher.js.map +1 -0
- package/server/fs/git-watcher.d.ts +76 -0
- package/server/fs/git-watcher.d.ts.map +1 -0
- package/server/fs/git-watcher.js +356 -0
- package/server/fs/git-watcher.js.map +1 -0
- package/server/fs/media.d.ts +35 -0
- package/server/fs/media.d.ts.map +1 -0
- package/server/fs/media.js +271 -0
- package/server/fs/media.js.map +1 -0
- package/server/fs/service.d.ts +97 -0
- package/server/fs/service.d.ts.map +1 -0
- package/server/fs/service.js +306 -0
- package/server/fs/service.js.map +1 -0
- package/server/fs/upload-staging.d.ts +76 -0
- package/server/fs/upload-staging.d.ts.map +1 -0
- package/server/fs/upload-staging.js +283 -0
- package/server/fs/upload-staging.js.map +1 -0
- package/server/fs/watcher-lifecycle.d.ts +24 -0
- package/server/fs/watcher-lifecycle.d.ts.map +1 -0
- package/server/fs/watcher-lifecycle.js +105 -0
- package/server/fs/watcher-lifecycle.js.map +1 -0
- package/server/index.d.ts +17 -0
- package/server/index.d.ts.map +1 -0
- package/server/index.js +510 -0
- package/server/index.js.map +1 -0
- package/server/ipc/socket-server.d.ts +28 -0
- package/server/ipc/socket-server.d.ts.map +1 -0
- package/server/ipc/socket-server.js +206 -0
- package/server/ipc/socket-server.js.map +1 -0
- package/server/lib/git-exec.d.ts +38 -0
- package/server/lib/git-exec.d.ts.map +1 -0
- package/server/lib/git-exec.js +96 -0
- package/server/lib/git-exec.js.map +1 -0
- package/server/lib/open-in-ide.d.ts +22 -0
- package/server/lib/open-in-ide.d.ts.map +1 -0
- package/server/lib/open-in-ide.js +90 -0
- package/server/lib/open-in-ide.js.map +1 -0
- package/server/lib/open-in-os.d.ts +20 -0
- package/server/lib/open-in-os.d.ts.map +1 -0
- package/server/lib/open-in-os.js +51 -0
- package/server/lib/open-in-os.js.map +1 -0
- package/server/lib/path.d.ts +2 -0
- package/server/lib/path.d.ts.map +1 -0
- package/server/lib/path.js +10 -0
- package/server/lib/path.js.map +1 -0
- package/server/lib/promise-mutex.d.ts +7 -0
- package/server/lib/promise-mutex.d.ts.map +1 -0
- package/server/lib/promise-mutex.js +26 -0
- package/server/lib/promise-mutex.js.map +1 -0
- package/server/lib/sd-notify.d.ts +8 -0
- package/server/lib/sd-notify.d.ts.map +1 -0
- package/server/lib/sd-notify.js +27 -0
- package/server/lib/sd-notify.js.map +1 -0
- package/server/net/local-machine.d.ts +7 -0
- package/server/net/local-machine.d.ts.map +1 -0
- package/server/net/local-machine.js +79 -0
- package/server/net/local-machine.js.map +1 -0
- package/server/net/reachable-host.d.ts +12 -0
- package/server/net/reachable-host.d.ts.map +1 -0
- package/server/net/reachable-host.js +25 -0
- package/server/net/reachable-host.js.map +1 -0
- package/server/network/endpoints.d.ts +14 -0
- package/server/network/endpoints.d.ts.map +1 -0
- package/server/network/endpoints.js +104 -0
- package/server/network/endpoints.js.map +1 -0
- package/server/network/qr.d.ts +16 -0
- package/server/network/qr.d.ts.map +1 -0
- package/server/network/qr.js +89 -0
- package/server/network/qr.js.map +1 -0
- package/server/port-forwarder/forwarder.d.ts +47 -0
- package/server/port-forwarder/forwarder.d.ts.map +1 -0
- package/server/port-forwarder/forwarder.js +159 -0
- package/server/port-forwarder/forwarder.js.map +1 -0
- package/server/port-scanner/scanner.d.ts +24 -0
- package/server/port-scanner/scanner.d.ts.map +1 -0
- package/server/port-scanner/scanner.js +193 -0
- package/server/port-scanner/scanner.js.map +1 -0
- package/server/pty/connection-lifecycle.d.ts +50 -0
- package/server/pty/connection-lifecycle.d.ts.map +1 -0
- package/server/pty/connection-lifecycle.js +113 -0
- package/server/pty/connection-lifecycle.js.map +1 -0
- package/server/pty/daemon-connect.d.ts +52 -0
- package/server/pty/daemon-connect.d.ts.map +1 -0
- package/server/pty/daemon-connect.js +62 -0
- package/server/pty/daemon-connect.js.map +1 -0
- package/server/pty/handshake-timeout-race.d.ts +22 -0
- package/server/pty/handshake-timeout-race.d.ts.map +1 -0
- package/server/pty/handshake-timeout-race.js +23 -0
- package/server/pty/handshake-timeout-race.js.map +1 -0
- package/server/pty/headless-replay-snapshot.d.ts +28 -0
- package/server/pty/headless-replay-snapshot.d.ts.map +1 -0
- package/server/pty/headless-replay-snapshot.js +285 -0
- package/server/pty/headless-replay-snapshot.js.map +1 -0
- package/server/pty/headless-terminal-state-cache.d.ts +31 -0
- package/server/pty/headless-terminal-state-cache.d.ts.map +1 -0
- package/server/pty/headless-terminal-state-cache.js +119 -0
- package/server/pty/headless-terminal-state-cache.js.map +1 -0
- package/server/pty/hello-ack-validator.d.ts +15 -0
- package/server/pty/hello-ack-validator.d.ts.map +1 -0
- package/server/pty/hello-ack-validator.js +30 -0
- package/server/pty/hello-ack-validator.js.map +1 -0
- package/server/pty/host-daemon/bootstrap.d.ts +100 -0
- package/server/pty/host-daemon/bootstrap.d.ts.map +1 -0
- package/server/pty/host-daemon/bootstrap.js +611 -0
- package/server/pty/host-daemon/bootstrap.js.map +1 -0
- package/server/pty/host-daemon/daemon.d.ts +111 -0
- package/server/pty/host-daemon/daemon.d.ts.map +1 -0
- package/server/pty/host-daemon/daemon.js +648 -0
- package/server/pty/host-daemon/daemon.js.map +1 -0
- package/server/pty/host-daemon/entry.d.ts +3 -0
- package/server/pty/host-daemon/entry.d.ts.map +1 -0
- package/server/pty/host-daemon/entry.js +72 -0
- package/server/pty/host-daemon/entry.js.map +1 -0
- package/server/pty/host-daemon/lockfile.d.ts +12 -0
- package/server/pty/host-daemon/lockfile.d.ts.map +1 -0
- package/server/pty/host-daemon/lockfile.js +120 -0
- package/server/pty/host-daemon/lockfile.js.map +1 -0
- package/server/pty/host-daemon/mode-marker.d.ts +77 -0
- package/server/pty/host-daemon/mode-marker.d.ts.map +1 -0
- package/server/pty/host-daemon/mode-marker.js +228 -0
- package/server/pty/host-daemon/mode-marker.js.map +1 -0
- package/server/pty/host-daemon/orphan-cleanup.d.ts +42 -0
- package/server/pty/host-daemon/orphan-cleanup.d.ts.map +1 -0
- package/server/pty/host-daemon/orphan-cleanup.js +84 -0
- package/server/pty/host-daemon/orphan-cleanup.js.map +1 -0
- package/server/pty/host-daemon/paths.d.ts +10 -0
- package/server/pty/host-daemon/paths.d.ts.map +1 -0
- package/server/pty/host-daemon/paths.js +56 -0
- package/server/pty/host-daemon/paths.js.map +1 -0
- package/server/pty/host-daemon/server-connection.d.ts +44 -0
- package/server/pty/host-daemon/server-connection.d.ts.map +1 -0
- package/server/pty/host-daemon/server-connection.js +100 -0
- package/server/pty/host-daemon/server-connection.js.map +1 -0
- package/server/pty/host-daemon/service-detection.d.ts +24 -0
- package/server/pty/host-daemon/service-detection.d.ts.map +1 -0
- package/server/pty/host-daemon/service-detection.js +16 -0
- package/server/pty/host-daemon/service-detection.js.map +1 -0
- package/server/pty/host-daemon/socket-ready.d.ts +22 -0
- package/server/pty/host-daemon/socket-ready.d.ts.map +1 -0
- package/server/pty/host-daemon/socket-ready.js +33 -0
- package/server/pty/host-daemon/socket-ready.js.map +1 -0
- package/server/pty/host-daemon/spawn-daemon.d.ts +45 -0
- package/server/pty/host-daemon/spawn-daemon.d.ts.map +1 -0
- package/server/pty/host-daemon/spawn-daemon.js +155 -0
- package/server/pty/host-daemon/spawn-daemon.js.map +1 -0
- package/server/pty/host-daemon/terminate-daemon.d.ts +16 -0
- package/server/pty/host-daemon/terminate-daemon.d.ts.map +1 -0
- package/server/pty/host-daemon/terminate-daemon.js +128 -0
- package/server/pty/host-daemon/terminate-daemon.js.map +1 -0
- package/server/pty/host-protocol/frames.d.ts +110 -0
- package/server/pty/host-protocol/frames.d.ts.map +1 -0
- package/server/pty/host-protocol/frames.js +255 -0
- package/server/pty/host-protocol/frames.js.map +1 -0
- package/server/pty/host-protocol/messages.d.ts +140 -0
- package/server/pty/host-protocol/messages.d.ts.map +1 -0
- package/server/pty/host-protocol/messages.js +117 -0
- package/server/pty/host-protocol/messages.js.map +1 -0
- package/server/pty/host.d.ts +273 -0
- package/server/pty/host.d.ts.map +1 -0
- package/server/pty/host.js +184 -0
- package/server/pty/host.js.map +1 -0
- package/server/pty/in-process-host.d.ts +224 -0
- package/server/pty/in-process-host.d.ts.map +1 -0
- package/server/pty/in-process-host.js +1183 -0
- package/server/pty/in-process-host.js.map +1 -0
- package/server/pty/osc7-lifecycle.d.ts +8 -0
- package/server/pty/osc7-lifecycle.d.ts.map +1 -0
- package/server/pty/osc7-lifecycle.js +22 -0
- package/server/pty/osc7-lifecycle.js.map +1 -0
- package/server/pty/osc7-parser.d.ts +23 -0
- package/server/pty/osc7-parser.d.ts.map +1 -0
- package/server/pty/osc7-parser.js +91 -0
- package/server/pty/osc7-parser.js.map +1 -0
- package/server/pty/remote-host.d.ts +188 -0
- package/server/pty/remote-host.d.ts.map +1 -0
- package/server/pty/remote-host.js +810 -0
- package/server/pty/remote-host.js.map +1 -0
- package/server/pty/request-correlator.d.ts +59 -0
- package/server/pty/request-correlator.d.ts.map +1 -0
- package/server/pty/request-correlator.js +75 -0
- package/server/pty/request-correlator.js.map +1 -0
- package/server/pty/scrollback-log.d.ts +130 -0
- package/server/pty/scrollback-log.d.ts.map +1 -0
- package/server/pty/scrollback-log.js +344 -0
- package/server/pty/scrollback-log.js.map +1 -0
- package/server/pty/scrollback-sanitize.d.ts +2 -0
- package/server/pty/scrollback-sanitize.d.ts.map +1 -0
- package/server/pty/scrollback-sanitize.js +54 -0
- package/server/pty/scrollback-sanitize.js.map +1 -0
- package/server/pty/session-mirror.d.ts +67 -0
- package/server/pty/session-mirror.d.ts.map +1 -0
- package/server/pty/session-mirror.js +112 -0
- package/server/pty/session-mirror.js.map +1 -0
- package/server/pty/session-policy.d.ts +85 -0
- package/server/pty/session-policy.d.ts.map +1 -0
- package/server/pty/session-policy.js +186 -0
- package/server/pty/session-policy.js.map +1 -0
- package/server/pty/version-mismatch-recovery.d.ts +71 -0
- package/server/pty/version-mismatch-recovery.d.ts.map +1 -0
- package/server/pty/version-mismatch-recovery.js +63 -0
- package/server/pty/version-mismatch-recovery.js.map +1 -0
- package/server/routes/debug-agent-status.d.ts +5 -0
- package/server/routes/debug-agent-status.d.ts.map +1 -0
- package/server/routes/debug-agent-status.js +22 -0
- package/server/routes/debug-agent-status.js.map +1 -0
- package/server/routes/debug-diagnostics.d.ts +8 -0
- package/server/routes/debug-diagnostics.d.ts.map +1 -0
- package/server/routes/debug-diagnostics.js +34 -0
- package/server/routes/debug-diagnostics.js.map +1 -0
- package/server/routes/debug-terminal-trace.d.ts +16 -0
- package/server/routes/debug-terminal-trace.d.ts.map +1 -0
- package/server/routes/debug-terminal-trace.js +545 -0
- package/server/routes/debug-terminal-trace.js.map +1 -0
- package/server/routes/drops.d.ts +13 -0
- package/server/routes/drops.d.ts.map +1 -0
- package/server/routes/drops.js +126 -0
- package/server/routes/drops.js.map +1 -0
- package/server/routes/file-uploads.d.ts +9 -0
- package/server/routes/file-uploads.d.ts.map +1 -0
- package/server/routes/file-uploads.js +119 -0
- package/server/routes/file-uploads.js.map +1 -0
- package/server/routes/files.d.ts +9 -0
- package/server/routes/files.d.ts.map +1 -0
- package/server/routes/files.js +441 -0
- package/server/routes/files.js.map +1 -0
- package/server/routes/filesystem.d.ts +6 -0
- package/server/routes/filesystem.d.ts.map +1 -0
- package/server/routes/filesystem.js +76 -0
- package/server/routes/filesystem.js.map +1 -0
- package/server/routes/git.d.ts +38 -0
- package/server/routes/git.d.ts.map +1 -0
- package/server/routes/git.js +585 -0
- package/server/routes/git.js.map +1 -0
- package/server/routes/healthz.d.ts +8 -0
- package/server/routes/healthz.d.ts.map +1 -0
- package/server/routes/healthz.js +24 -0
- package/server/routes/healthz.js.map +1 -0
- package/server/routes/hook.d.ts +14 -0
- package/server/routes/hook.d.ts.map +1 -0
- package/server/routes/hook.js +86 -0
- package/server/routes/hook.js.map +1 -0
- package/server/routes/ide-commands.d.ts +9 -0
- package/server/routes/ide-commands.d.ts.map +1 -0
- package/server/routes/ide-commands.js +23 -0
- package/server/routes/ide-commands.js.map +1 -0
- package/server/routes/lib/resolve-worktree.d.ts +30 -0
- package/server/routes/lib/resolve-worktree.d.ts.map +1 -0
- package/server/routes/lib/resolve-worktree.js +35 -0
- package/server/routes/lib/resolve-worktree.js.map +1 -0
- package/server/routes/open.d.ts +4 -0
- package/server/routes/open.d.ts.map +1 -0
- package/server/routes/open.js +21 -0
- package/server/routes/open.js.map +1 -0
- package/server/routes/pane-commands.d.ts +9 -0
- package/server/routes/pane-commands.d.ts.map +1 -0
- package/server/routes/pane-commands.js +23 -0
- package/server/routes/pane-commands.js.map +1 -0
- package/server/routes/projects.d.ts +15 -0
- package/server/routes/projects.d.ts.map +1 -0
- package/server/routes/projects.js +363 -0
- package/server/routes/projects.js.map +1 -0
- package/server/routes/server-notices.d.ts +4 -0
- package/server/routes/server-notices.d.ts.map +1 -0
- package/server/routes/server-notices.js +29 -0
- package/server/routes/server-notices.js.map +1 -0
- package/server/routes/service-config.d.ts +11 -0
- package/server/routes/service-config.d.ts.map +1 -0
- package/server/routes/service-config.js +64 -0
- package/server/routes/service-config.js.map +1 -0
- package/server/routes/sessions.d.ts +7 -0
- package/server/routes/sessions.d.ts.map +1 -0
- package/server/routes/sessions.js +218 -0
- package/server/routes/sessions.js.map +1 -0
- package/server/service/caffeinate.d.ts +33 -0
- package/server/service/caffeinate.d.ts.map +1 -0
- package/server/service/caffeinate.js +72 -0
- package/server/service/caffeinate.js.map +1 -0
- package/server/state/app-state.d.ts +167 -0
- package/server/state/app-state.d.ts.map +1 -0
- package/server/state/app-state.js +335 -0
- package/server/state/app-state.js.map +1 -0
- package/server/state/project-manager.d.ts +30 -0
- package/server/state/project-manager.d.ts.map +1 -0
- package/server/state/project-manager.js +128 -0
- package/server/state/project-manager.js.map +1 -0
- package/server/state/server-notices.d.ts +12 -0
- package/server/state/server-notices.d.ts.map +1 -0
- package/server/state/server-notices.js +32 -0
- package/server/state/server-notices.js.map +1 -0
- package/server/state/worktree-cache.d.ts +25 -0
- package/server/state/worktree-cache.d.ts.map +1 -0
- package/server/state/worktree-cache.js +53 -0
- package/server/state/worktree-cache.js.map +1 -0
- package/server/ws/events.d.ts +45 -0
- package/server/ws/events.d.ts.map +1 -0
- package/server/ws/events.js +134 -0
- package/server/ws/events.js.map +1 -0
- package/server/ws/keepalive.d.ts +27 -0
- package/server/ws/keepalive.d.ts.map +1 -0
- package/server/ws/keepalive.js +63 -0
- package/server/ws/keepalive.js.map +1 -0
- package/server/ws/terminal-attach.d.ts +13 -0
- package/server/ws/terminal-attach.d.ts.map +1 -0
- package/server/ws/terminal-attach.js +233 -0
- package/server/ws/terminal-attach.js.map +1 -0
- package/server/ws/terminal-flow.d.ts +17 -0
- package/server/ws/terminal-flow.d.ts.map +1 -0
- package/server/ws/terminal-flow.js +64 -0
- package/server/ws/terminal-flow.js.map +1 -0
- package/server/ws/terminal.d.ts +69 -0
- package/server/ws/terminal.d.ts.map +1 -0
- package/server/ws/terminal.js +311 -0
- package/server/ws/terminal.js.map +1 -0
- package/web/assets/EditorPane-CzzT3iYY.js +123 -0
- package/web/assets/SymbolsNerdFontMono-Regular-CwEZqMeU.woff2 +0 -0
- package/web/assets/TerminalPane-CjbYzePr.js +68 -0
- package/web/assets/TerminalPane-DkTCHfhq.css +1 -0
- package/web/assets/file-icons-JBi09j0r.js +6 -0
- package/web/assets/index-CTTkRpnn.css +2 -0
- package/web/assets/index-CmhewzMp.js +34 -0
- package/web/assets/session-resume-7f-tB-ZU.js +2 -0
- package/web/assets/terminal-trace-PuuFRybC.js +2803 -0
- package/web/assets/useVirtualKeyboard-DgJb9u9d.js +1 -0
- package/web/index.html +52 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawn-daemon.js","sourceRoot":"","sources":["../../../src/pty/host-daemon/spawn-daemon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AA+BzC,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IAG9B;IAFX,YACE,OAAe,EACN,KAAa;QAEtB,KAAK,CAAC,OAAO,CAAC,CAAC;QAFN,UAAK,GAAL,KAAK,CAAQ;QAGtB,IAAI,CAAC,IAAI,GAAG,kBAAk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ile" | "already-dead" | "stopped" | "killed-after-timeout" | "still-alive";
|
|
3
|
+
export interface TerminateDaemonResult {
|
|
4
|
+
outcome: TerminateDaemonOutcome;
|
|
5
|
+
pid: number | null;
|
|
6
|
+
}
|
|
7
|
+
export interface TerminateDaemonDeps {
|
|
8
|
+
killProcess: (pid: number, signal: NodeJS.Signals | 0) => boolean;
|
|
9
|
+
readPidFile: (path: string) => number | null;
|
|
10
|
+
unlinkSocket: (path: string) => void;
|
|
11
|
+
unlinkLockFile: (lockFile: string) => void;
|
|
12
|
+
sleep: (ms: number) => Promise<void>;
|
|
13
|
+
now: () => number;
|
|
14
|
+
}
|
|
15
|
+
export declare function terminateDaemon(paths: DaemonPaths, partial?: Partial<TerminateDaemonDeps>): Promise<TerminateDaemonResult>;
|
|
16
|
+
//# sourceMappingURL=terminate-daemon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminate-daemon.d.ts","sourceRoot":"","sources":["../../../src/pty/host-daemon/terminate-daemon.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAM9C,MAAM,MAAM,sBAAsB,GAC9B,YAAY,GACZ,cAAc,GACd,SAAS,GACT,sBAAsB,GACtB,aAAa,CAAC;AAElB,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,sBAAsB,CAAC;IAChC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,CAAC,KAAK,OAAO,CAAC;IAClE,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IAC7C,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,cAAc,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,GAAG,EAAE,MAAM,MAAM,CAAC;CACnB;AAmDD,wBAAsB,eAAe,CACnC,KAAK,EAAE,WAAW,EAClB,OAAO,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,GACrC,OAAO,CAAC,qBAAqB,CAAC,CA8ChC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* daemon protocol mismatch recovery -- server-side daemon force-termination used by the
|
|
3
|
+
* `version-mismatch` auto-recovery path in createPtyHost. The CLI's
|
|
4
|
+
* `stopCmd` is the user-facing entry point; this is the in-process
|
|
5
|
+
* variant the server invokes when handshake NACK proves the running
|
|
6
|
+
* daemon is incompatible with the freshly-installed binary.
|
|
7
|
+
*
|
|
8
|
+
* Behaviour:
|
|
9
|
+
* 1. Read pidfile. Missing -> unlink stale socket + lock, return "no-pidfile".
|
|
10
|
+
* 2. probe `kill(pid, 0)` -- already dead -> unlink socket + lock, return.
|
|
11
|
+
* 3. SIGTERM, poll ≤ SIGTERM_TIMEOUT_MS for the pid to die.
|
|
12
|
+
* 4. Still alive -> SIGKILL, poll ≤ SIGKILL_TIMEOUT_MS.
|
|
13
|
+
* 5. Still alive after SIGKILL -> still unlink socket + lock and return
|
|
14
|
+
* "still-alive". Caller treats this as fatal so the user sees a
|
|
15
|
+
* clear failure, but we leave no stale inodes/lockdir behind that
|
|
16
|
+
* would block a manual `parasor pty-host stop --force` recovery.
|
|
17
|
+
*
|
|
18
|
+
* Why we also break the proper-lockfile directory: a SIGKILLed daemon
|
|
19
|
+
* cannot release its `proper-lockfile` flock, and the stale-mtime
|
|
20
|
+
* window is up to 30s (refresh interval) before the next acquire would
|
|
21
|
+
* succeed. spawnDaemon does not retry on ELOCKED, so without explicit
|
|
22
|
+
* cleanup the immediate post-kill respawn would fail with
|
|
23
|
+
* `DaemonAlreadyRunningError`. We forcibly remove the
|
|
24
|
+
* `<lockFile>.lock` state directory proper-lockfile creates, which is
|
|
25
|
+
* safe because we just confirmed (or attempted to confirm) the holder
|
|
26
|
+
* is dead.
|
|
27
|
+
*/
|
|
28
|
+
import { existsSync, readFileSync, rmSync, unlinkSync } from "node:fs";
|
|
29
|
+
const SIGTERM_TIMEOUT_MS = 5_000;
|
|
30
|
+
const SIGKILL_TIMEOUT_MS = 2_000;
|
|
31
|
+
const POLL_INTERVAL_MS = 50;
|
|
32
|
+
function defaultReadPidFile(path) {
|
|
33
|
+
if (!existsSync(path))
|
|
34
|
+
return null;
|
|
35
|
+
try {
|
|
36
|
+
const pid = Number(readFileSync(path, "utf8").trim());
|
|
37
|
+
return Number.isFinite(pid) && pid > 0 ? pid : null;
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function defaultKillProcess(pid, signal) {
|
|
44
|
+
try {
|
|
45
|
+
process.kill(pid, signal);
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
return err.code === "EPERM";
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function defaultUnlinkSocket(path) {
|
|
53
|
+
try {
|
|
54
|
+
unlinkSync(path);
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
/* ENOENT or owned-by-other-fd; spawnDaemon's lock arbitration owns the rest */
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function defaultUnlinkLockFile(lockFile) {
|
|
61
|
+
// proper-lockfile records its held state as a `<lockFile>.lock` directory
|
|
62
|
+
// (see `acquireDaemonLock` in lockfile.ts). The stamp file at `lockFile`
|
|
63
|
+
// is just a touchpoint we created; the real lock is the directory. Both
|
|
64
|
+
// are safe to remove here because the daemon that owned them is dead
|
|
65
|
+
// (or assumed dead -- this is the force-termination path).
|
|
66
|
+
try {
|
|
67
|
+
rmSync(`${lockFile}.lock`, { recursive: true, force: true });
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
/* nothing to clean up */
|
|
71
|
+
}
|
|
72
|
+
try {
|
|
73
|
+
unlinkSync(lockFile);
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
/* nothing to clean up */
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function defaultSleep(ms) {
|
|
80
|
+
return new Promise((r) => setTimeout(r, ms));
|
|
81
|
+
}
|
|
82
|
+
export async function terminateDaemon(paths, partial) {
|
|
83
|
+
const deps = {
|
|
84
|
+
killProcess: partial?.killProcess ?? defaultKillProcess,
|
|
85
|
+
readPidFile: partial?.readPidFile ?? defaultReadPidFile,
|
|
86
|
+
unlinkSocket: partial?.unlinkSocket ?? defaultUnlinkSocket,
|
|
87
|
+
unlinkLockFile: partial?.unlinkLockFile ?? defaultUnlinkLockFile,
|
|
88
|
+
sleep: partial?.sleep ?? defaultSleep,
|
|
89
|
+
now: partial?.now ?? Date.now,
|
|
90
|
+
};
|
|
91
|
+
const cleanup = () => {
|
|
92
|
+
deps.unlinkSocket(paths.socketPath);
|
|
93
|
+
deps.unlinkLockFile(paths.lockFile);
|
|
94
|
+
};
|
|
95
|
+
const pid = deps.readPidFile(paths.pidFile);
|
|
96
|
+
if (pid === null) {
|
|
97
|
+
cleanup();
|
|
98
|
+
return { outcome: "no-pidfile", pid: null };
|
|
99
|
+
}
|
|
100
|
+
if (!deps.killProcess(pid, 0)) {
|
|
101
|
+
cleanup();
|
|
102
|
+
return { outcome: "already-dead", pid };
|
|
103
|
+
}
|
|
104
|
+
deps.killProcess(pid, "SIGTERM");
|
|
105
|
+
const sigtermDeadline = deps.now() + SIGTERM_TIMEOUT_MS;
|
|
106
|
+
while (deps.now() < sigtermDeadline) {
|
|
107
|
+
if (!deps.killProcess(pid, 0)) {
|
|
108
|
+
cleanup();
|
|
109
|
+
return { outcome: "stopped", pid };
|
|
110
|
+
}
|
|
111
|
+
await deps.sleep(POLL_INTERVAL_MS);
|
|
112
|
+
}
|
|
113
|
+
deps.killProcess(pid, "SIGKILL");
|
|
114
|
+
const sigkillDeadline = deps.now() + SIGKILL_TIMEOUT_MS;
|
|
115
|
+
while (deps.now() < sigkillDeadline) {
|
|
116
|
+
if (!deps.killProcess(pid, 0)) {
|
|
117
|
+
cleanup();
|
|
118
|
+
return { outcome: "killed-after-timeout", pid };
|
|
119
|
+
}
|
|
120
|
+
await deps.sleep(POLL_INTERVAL_MS);
|
|
121
|
+
}
|
|
122
|
+
// Surviving SIGKILL is the abort signal for host.ts, but we still
|
|
123
|
+
// sweep socket + lockfile so a manual `parasor pty-host stop --force`
|
|
124
|
+
// afterward does not need to break a stale lock too.
|
|
125
|
+
cleanup();
|
|
126
|
+
return { outcome: "still-alive", pid };
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=terminate-daemon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminate-daemon.js","sourceRoot":"","sources":["../../../src/pty/host-daemon/terminate-daemon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGvE,MAAM,kBAAkB,GAAG,KAAK,CAAC;AACjC,MAAM,kBAAkB,GAAG,KAAK,CAAC;AACjC,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAuB5B,SAAS,kBAAkB,CAAC,IAAY;IACtC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACnC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QACtD,OAAO,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAA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C;IACrC,CAAC;IACD,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;IACjC,MAAM,eAAe,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,kBAAkB,CAAC;IACxD,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,eAAe,EAAE,CAAC;QACpC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;YAC9B,OAAO,EAAE,CAAC;YACV,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,GAAG,EAAE,CAAC;QAClD,CAAC;QACD,MAAM,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IACrC,CAAC;IACD,kEAAkE;IAClE,sEAAsE;IACtE,qDAAqD;IACrD,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,EAAE,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
export declare const FRAME_HEADER_BYTES: number;
|
|
2
|
+
/**
|
|
3
|
+
* Hard cap on payload size. Defends against a malformed/hostile sender
|
|
4
|
+
* advertising a huge `len` and forcing the peer to allocate. 16 MiB is
|
|
5
|
+
* far above any legitimate frame (the largest realistic payload is a
|
|
6
|
+
* scrollback snapshot, which is line-segmented and typically <1 MiB).
|
|
7
|
+
*/
|
|
8
|
+
export declare const MAX_PAYLOAD_BYTES: number;
|
|
9
|
+
export declare const FrameType: {
|
|
10
|
+
readonly HELLO: 1;
|
|
11
|
+
readonly HELLO_ACK: 2;
|
|
12
|
+
readonly NACK: 3;
|
|
13
|
+
readonly CREATE_REQ: 16;
|
|
14
|
+
readonly CREATE_ACK: 17;
|
|
15
|
+
readonly RESTART_REQ: 18;
|
|
16
|
+
readonly RESTART_ACK: 19;
|
|
17
|
+
readonly DISPOSE_REQ: 20;
|
|
18
|
+
readonly DISPOSE_ACK: 21;
|
|
19
|
+
readonly DISPOSE_ALL_REQ: 22;
|
|
20
|
+
readonly DISPOSE_ALL_ACK: 23;
|
|
21
|
+
readonly SHUTDOWN_ALL_REQ: 24;
|
|
22
|
+
readonly SHUTDOWN_ALL_ACK: 25;
|
|
23
|
+
readonly INIT_CLIENT_REQ: 26;
|
|
24
|
+
readonly INIT_CLIENT_ACK: 27;
|
|
25
|
+
readonly PERSIST_PROJECT_DOMAINS_REQ: 28;
|
|
26
|
+
readonly PERSIST_PROJECT_DOMAINS_ACK: 29;
|
|
27
|
+
readonly WRITE: 32;
|
|
28
|
+
readonly RESIZE: 33;
|
|
29
|
+
readonly REFRESH: 34;
|
|
30
|
+
readonly DETACH_CLIENT: 35;
|
|
31
|
+
readonly SET_TITLE: 36;
|
|
32
|
+
readonly SET_PINNED: 37;
|
|
33
|
+
readonly SET_PTY_ENV: 38;
|
|
34
|
+
readonly PAUSE_OUTPUT: 39;
|
|
35
|
+
readonly RESUME_OUTPUT: 40;
|
|
36
|
+
readonly DATA: 48;
|
|
37
|
+
readonly SESSION_UPDATE: 49;
|
|
38
|
+
readonly SESSION_LIST: 50;
|
|
39
|
+
readonly SESSION_EXIT: 51;
|
|
40
|
+
readonly SESSION_INPUT: 52;
|
|
41
|
+
};
|
|
42
|
+
export type FrameTypeValue = (typeof FrameType)[keyof typeof FrameType];
|
|
43
|
+
/**
|
|
44
|
+
* Stream-payload frames carry session-routed binary data. Format:
|
|
45
|
+
* `[sessionIdLen:u8][sessionId:utf8][raw bytes]`
|
|
46
|
+
*
|
|
47
|
+
* Avoids JSON+base64 (~33% inflation) and UTF-8 boundary corruption on
|
|
48
|
+
* partial writes. Used by WRITE / DATA / SESSION_INPUT -- every other
|
|
49
|
+
* frame type carries a JSON payload (see `messages.ts`).
|
|
50
|
+
*/
|
|
51
|
+
export declare const STREAM_FRAME_TYPES: ReadonlySet<number>;
|
|
52
|
+
/**
|
|
53
|
+
* Generation-tagged stream payload (PTY generation gate). Wire format:
|
|
54
|
+
* `[sessionIdLen:u8][sessionId:utf8][generation:u32 BE][raw bytes]`
|
|
55
|
+
*
|
|
56
|
+
* Used by both directions of the auto-resume race fix:
|
|
57
|
+
* - WRITE (server -> daemon): `generation` tags the PTY generation the
|
|
58
|
+
* client believes is current. Daemon drops on mismatch.
|
|
59
|
+
* - DATA (daemon -> server): `generation` tags the PTY generation that
|
|
60
|
+
* produced this OUTPUT batch. Server forwards to the WS client so
|
|
61
|
+
* the client knows which generation to echo back on subsequent
|
|
62
|
+
* INPUT.
|
|
63
|
+
*
|
|
64
|
+
* Kept separate from `encodeStreamPayload` because SESSION_INPUT does
|
|
65
|
+
* not need a generation tag -- it is a server-side echo for hooks
|
|
66
|
+
* (osc7 / port-detect) and never feeds back into the input gate.
|
|
67
|
+
*/
|
|
68
|
+
export declare const STREAM_GENERATION_BYTES = 4;
|
|
69
|
+
export declare function encodeGenerationStreamPayload(sessionId: string, data: Buffer, generation: number): Buffer;
|
|
70
|
+
export declare function decodeGenerationStreamPayload(payload: Buffer): {
|
|
71
|
+
sessionId: string;
|
|
72
|
+
generation: number;
|
|
73
|
+
data: Buffer;
|
|
74
|
+
};
|
|
75
|
+
export declare function encodeStreamPayload(sessionId: string, data: Buffer): Buffer;
|
|
76
|
+
export declare function decodeStreamPayload(payload: Buffer): {
|
|
77
|
+
sessionId: string;
|
|
78
|
+
data: Buffer;
|
|
79
|
+
};
|
|
80
|
+
export interface Frame {
|
|
81
|
+
type: number;
|
|
82
|
+
connectionId: number;
|
|
83
|
+
generation: bigint;
|
|
84
|
+
requestId: number;
|
|
85
|
+
payload: Buffer;
|
|
86
|
+
}
|
|
87
|
+
export declare class FrameError extends Error {
|
|
88
|
+
readonly code: "FRAME_TOO_LARGE" | "FRAME_INVALID";
|
|
89
|
+
constructor(code: "FRAME_TOO_LARGE" | "FRAME_INVALID", message: string);
|
|
90
|
+
}
|
|
91
|
+
export declare function encodeFrame(frame: Frame): Buffer;
|
|
92
|
+
/**
|
|
93
|
+
* Stream-safe frame decoder. Push raw chunks as they arrive on the
|
|
94
|
+
* socket; the parser yields zero or more complete frames per push and
|
|
95
|
+
* keeps any trailing partial frame buffered for the next push.
|
|
96
|
+
*
|
|
97
|
+
* Throws `FrameError("FRAME_TOO_LARGE")` synchronously from `push()` if
|
|
98
|
+
* a peer advertises a length above the cap -- caller MUST close the
|
|
99
|
+
* connection rather than continue draining the buffer.
|
|
100
|
+
*/
|
|
101
|
+
export declare class FrameParser {
|
|
102
|
+
private chunks;
|
|
103
|
+
private size;
|
|
104
|
+
push(chunk: Buffer): Frame[];
|
|
105
|
+
/** Bytes currently buffered (partial/unparsed). Useful for diagnostics. */
|
|
106
|
+
bufferedBytes(): number;
|
|
107
|
+
private takeOne;
|
|
108
|
+
private materialize;
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=frames.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frames.d.ts","sourceRoot":"","sources":["../../../src/pty/host-protocol/frames.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,kBAAkB,QAAgB,CAAC;AAEhD;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,QAAmB,CAAC;AAclD,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CZ,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAExE;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAIjD,CAAC;AAEH;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAEzC,wBAAgB,6BAA6B,CAC3C,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,GACjB,MAAM,CAgBR;AAED,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,MAAM,GAAG;IAC9D,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd,CAoBA;AAED,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAa3E;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd,CAiBA;AAED,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,UAAW,SAAQ,KAAK;aAEjB,IAAI,EAAE,iBAAiB,GAAG,eAAe;gBAAzC,IAAI,EAAE,iBAAiB,GAAG,eAAe,EACzD,OAAO,EAAE,MAAM;CAKlB;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAqChD;AAED;;;;;;;;GAQG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,IAAI,CAAK;IAEjB,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,EAAE;IAa5B,2EAA2E;IAC3E,aAAa,IAAI,MAAM;IAIvB,OAAO,CAAC,OAAO;IAmCf,OAAO,CAAC,WAAW;CAMpB"}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Wire frame format for the PtyHost daemon IPC.
|
|
3
|
+
*
|
|
4
|
+
* [len:u32be][type:u8][connectionId:u32be][generation:u64be][requestId:u32be][payload]
|
|
5
|
+
*
|
|
6
|
+
* `len` covers everything after itself (type + connectionId + generation +
|
|
7
|
+
* requestId + payload). One TCP/Unix-socket recv may deliver any number
|
|
8
|
+
* of bytes -- fewer than one frame, exactly one, or several plus a partial
|
|
9
|
+
* tail. `FrameParser` buffers raw chunks and yields whole frames only.
|
|
10
|
+
*
|
|
11
|
+
* The envelope is fixed for every frame type. HELLO (the first frame on a
|
|
12
|
+
* fresh connection) uses connectionId=0 / generation=0n / requestId=0
|
|
13
|
+
* because daemon assigns them in HELLO_ACK; subsequent frames carry the
|
|
14
|
+
* assigned triple verbatim, which is what epoch fencing relies on.
|
|
15
|
+
*/
|
|
16
|
+
export const FRAME_HEADER_BYTES = 1 + 4 + 8 + 4; // type + connId + generation + reqId
|
|
17
|
+
/**
|
|
18
|
+
* Hard cap on payload size. Defends against a malformed/hostile sender
|
|
19
|
+
* advertising a huge `len` and forcing the peer to allocate. 16 MiB is
|
|
20
|
+
* far above any legitimate frame (the largest realistic payload is a
|
|
21
|
+
* scrollback snapshot, which is line-segmented and typically <1 MiB).
|
|
22
|
+
*/
|
|
23
|
+
export const MAX_PAYLOAD_BYTES = 16 * 1024 * 1024;
|
|
24
|
+
/*
|
|
25
|
+
* Frame type registry. Numbering blocks:
|
|
26
|
+
* 0x01-0x0F handshake / control
|
|
27
|
+
* 0x10-0x1F request frames (paired with 0x10|0x01 = ACK pattern below)
|
|
28
|
+
* 0x20-0x2F fire-and-forget mutators (no ack)
|
|
29
|
+
* 0x30-0x3F daemon->server one-way events / streams
|
|
30
|
+
*
|
|
31
|
+
* Per the ack-semantics decision: only Promise<X>-returning PtyHost
|
|
32
|
+
* methods get a request/ACK pair. Sync-returning methods (write/resize/
|
|
33
|
+
* setTitle/setPinned/...) ride on fire-and-forget mutators and rely on
|
|
34
|
+
* SESSION_UPDATE broadcasts to reconcile the optimistic mirror.
|
|
35
|
+
*/
|
|
36
|
+
export const FrameType = {
|
|
37
|
+
// 0x01-0x0F handshake / control
|
|
38
|
+
HELLO: 0x01,
|
|
39
|
+
HELLO_ACK: 0x02,
|
|
40
|
+
NACK: 0x03,
|
|
41
|
+
// 0x10-0x1F request -> ack pairs (request awaits ACK with same requestId)
|
|
42
|
+
CREATE_REQ: 0x10,
|
|
43
|
+
CREATE_ACK: 0x11,
|
|
44
|
+
RESTART_REQ: 0x12,
|
|
45
|
+
RESTART_ACK: 0x13,
|
|
46
|
+
DISPOSE_REQ: 0x14,
|
|
47
|
+
DISPOSE_ACK: 0x15,
|
|
48
|
+
DISPOSE_ALL_REQ: 0x16,
|
|
49
|
+
DISPOSE_ALL_ACK: 0x17,
|
|
50
|
+
SHUTDOWN_ALL_REQ: 0x18, // Remote: detach-only (by design). Daemon does NOT kill sessions.
|
|
51
|
+
SHUTDOWN_ALL_ACK: 0x19,
|
|
52
|
+
INIT_CLIENT_REQ: 0x1a,
|
|
53
|
+
INIT_CLIENT_ACK: 0x1b,
|
|
54
|
+
// daemon state ownership -- server forwards project-domain snapshot for daemon to persist
|
|
55
|
+
// (single-writer-of-state.json invariant). Daemon adopts via
|
|
56
|
+
// internalMutate + flush; ACK gates on persistence success.
|
|
57
|
+
PERSIST_PROJECT_DOMAINS_REQ: 0x1c,
|
|
58
|
+
PERSIST_PROJECT_DOMAINS_ACK: 0x1d,
|
|
59
|
+
// 0x20-0x2F fire-and-forget mutators (caller does not await; epoch fencing only)
|
|
60
|
+
WRITE: 0x20,
|
|
61
|
+
RESIZE: 0x21,
|
|
62
|
+
REFRESH: 0x22,
|
|
63
|
+
DETACH_CLIENT: 0x23,
|
|
64
|
+
SET_TITLE: 0x24,
|
|
65
|
+
SET_PINNED: 0x25,
|
|
66
|
+
SET_PTY_ENV: 0x26,
|
|
67
|
+
PAUSE_OUTPUT: 0x27,
|
|
68
|
+
RESUME_OUTPUT: 0x28,
|
|
69
|
+
// 0x30-0x3F daemon -> server events (no ack expected)
|
|
70
|
+
DATA: 0x30,
|
|
71
|
+
SESSION_UPDATE: 0x31,
|
|
72
|
+
SESSION_LIST: 0x32,
|
|
73
|
+
SESSION_EXIT: 0x33,
|
|
74
|
+
SESSION_INPUT: 0x34, // echo of WRITE input for server hooks (osc7 / port detect)
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Stream-payload frames carry session-routed binary data. Format:
|
|
78
|
+
* `[sessionIdLen:u8][sessionId:utf8][raw bytes]`
|
|
79
|
+
*
|
|
80
|
+
* Avoids JSON+base64 (~33% inflation) and UTF-8 boundary corruption on
|
|
81
|
+
* partial writes. Used by WRITE / DATA / SESSION_INPUT -- every other
|
|
82
|
+
* frame type carries a JSON payload (see `messages.ts`).
|
|
83
|
+
*/
|
|
84
|
+
export const STREAM_FRAME_TYPES = new Set([
|
|
85
|
+
FrameType.WRITE,
|
|
86
|
+
FrameType.DATA,
|
|
87
|
+
FrameType.SESSION_INPUT,
|
|
88
|
+
]);
|
|
89
|
+
/**
|
|
90
|
+
* Generation-tagged stream payload (PTY generation gate). Wire format:
|
|
91
|
+
* `[sessionIdLen:u8][sessionId:utf8][generation:u32 BE][raw bytes]`
|
|
92
|
+
*
|
|
93
|
+
* Used by both directions of the auto-resume race fix:
|
|
94
|
+
* - WRITE (server -> daemon): `generation` tags the PTY generation the
|
|
95
|
+
* client believes is current. Daemon drops on mismatch.
|
|
96
|
+
* - DATA (daemon -> server): `generation` tags the PTY generation that
|
|
97
|
+
* produced this OUTPUT batch. Server forwards to the WS client so
|
|
98
|
+
* the client knows which generation to echo back on subsequent
|
|
99
|
+
* INPUT.
|
|
100
|
+
*
|
|
101
|
+
* Kept separate from `encodeStreamPayload` because SESSION_INPUT does
|
|
102
|
+
* not need a generation tag -- it is a server-side echo for hooks
|
|
103
|
+
* (osc7 / port-detect) and never feeds back into the input gate.
|
|
104
|
+
*/
|
|
105
|
+
export const STREAM_GENERATION_BYTES = 4;
|
|
106
|
+
export function encodeGenerationStreamPayload(sessionId, data, generation) {
|
|
107
|
+
const idBuf = Buffer.from(sessionId, "utf8");
|
|
108
|
+
if (idBuf.length > 0xff) {
|
|
109
|
+
throw new FrameError("FRAME_INVALID", `sessionId byte length ${idBuf.length} exceeds u8 max 255`);
|
|
110
|
+
}
|
|
111
|
+
const out = Buffer.allocUnsafe(1 + idBuf.length + STREAM_GENERATION_BYTES + data.length);
|
|
112
|
+
out.writeUInt8(idBuf.length, 0);
|
|
113
|
+
idBuf.copy(out, 1);
|
|
114
|
+
out.writeUInt32BE(generation >>> 0, 1 + idBuf.length);
|
|
115
|
+
data.copy(out, 1 + idBuf.length + STREAM_GENERATION_BYTES);
|
|
116
|
+
return out;
|
|
117
|
+
}
|
|
118
|
+
export function decodeGenerationStreamPayload(payload) {
|
|
119
|
+
if (payload.length < 1) {
|
|
120
|
+
throw new FrameError("FRAME_INVALID", "generation stream payload missing sessionIdLen");
|
|
121
|
+
}
|
|
122
|
+
const idLen = payload.readUInt8(0);
|
|
123
|
+
if (payload.length < 1 + idLen + STREAM_GENERATION_BYTES) {
|
|
124
|
+
throw new FrameError("FRAME_INVALID", `generation stream payload truncated (need 1+${idLen}+${STREAM_GENERATION_BYTES}, got ${payload.length})`);
|
|
125
|
+
}
|
|
126
|
+
const sessionId = payload.subarray(1, 1 + idLen).toString("utf8");
|
|
127
|
+
const generation = payload.readUInt32BE(1 + idLen);
|
|
128
|
+
const data = Buffer.from(payload.subarray(1 + idLen + STREAM_GENERATION_BYTES));
|
|
129
|
+
return { sessionId, generation, data };
|
|
130
|
+
}
|
|
131
|
+
export function encodeStreamPayload(sessionId, data) {
|
|
132
|
+
const idBuf = Buffer.from(sessionId, "utf8");
|
|
133
|
+
if (idBuf.length > 0xff) {
|
|
134
|
+
throw new FrameError("FRAME_INVALID", `sessionId byte length ${idBuf.length} exceeds u8 max 255`);
|
|
135
|
+
}
|
|
136
|
+
const out = Buffer.allocUnsafe(1 + idBuf.length + data.length);
|
|
137
|
+
out.writeUInt8(idBuf.length, 0);
|
|
138
|
+
idBuf.copy(out, 1);
|
|
139
|
+
data.copy(out, 1 + idBuf.length);
|
|
140
|
+
return out;
|
|
141
|
+
}
|
|
142
|
+
export function decodeStreamPayload(payload) {
|
|
143
|
+
if (payload.length < 1) {
|
|
144
|
+
throw new FrameError("FRAME_INVALID", "stream payload missing sessionIdLen");
|
|
145
|
+
}
|
|
146
|
+
const idLen = payload.readUInt8(0);
|
|
147
|
+
if (payload.length < 1 + idLen) {
|
|
148
|
+
throw new FrameError("FRAME_INVALID", `stream payload truncated (need 1+${idLen}, got ${payload.length})`);
|
|
149
|
+
}
|
|
150
|
+
const sessionId = payload.subarray(1, 1 + idLen).toString("utf8");
|
|
151
|
+
const data = Buffer.from(payload.subarray(1 + idLen));
|
|
152
|
+
return { sessionId, data };
|
|
153
|
+
}
|
|
154
|
+
export class FrameError extends Error {
|
|
155
|
+
code;
|
|
156
|
+
constructor(code, message) {
|
|
157
|
+
super(message);
|
|
158
|
+
this.code = code;
|
|
159
|
+
this.name = "FrameError";
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
export function encodeFrame(frame) {
|
|
163
|
+
if (frame.payload.length > MAX_PAYLOAD_BYTES) {
|
|
164
|
+
throw new FrameError("FRAME_TOO_LARGE", `payload size ${frame.payload.length} exceeds cap ${MAX_PAYLOAD_BYTES}`);
|
|
165
|
+
}
|
|
166
|
+
if (frame.type < 0 || frame.type > 0xff) {
|
|
167
|
+
throw new FrameError("FRAME_INVALID", `type ${frame.type} out of u8 range`);
|
|
168
|
+
}
|
|
169
|
+
if (frame.connectionId < 0 || frame.connectionId > 0xffffffff) {
|
|
170
|
+
throw new FrameError("FRAME_INVALID", `connectionId ${frame.connectionId} out of u32 range`);
|
|
171
|
+
}
|
|
172
|
+
if (frame.generation < 0n || frame.generation > 0xffffffffffffffffn) {
|
|
173
|
+
throw new FrameError("FRAME_INVALID", `generation ${frame.generation} out of u64 range`);
|
|
174
|
+
}
|
|
175
|
+
if (frame.requestId < 0 || frame.requestId > 0xffffffff) {
|
|
176
|
+
throw new FrameError("FRAME_INVALID", `requestId ${frame.requestId} out of u32 range`);
|
|
177
|
+
}
|
|
178
|
+
const totalAfterLen = FRAME_HEADER_BYTES + frame.payload.length;
|
|
179
|
+
const buf = Buffer.allocUnsafe(4 + totalAfterLen);
|
|
180
|
+
buf.writeUInt32BE(totalAfterLen, 0);
|
|
181
|
+
buf.writeUInt8(frame.type, 4);
|
|
182
|
+
buf.writeUInt32BE(frame.connectionId, 5);
|
|
183
|
+
buf.writeBigUInt64BE(frame.generation, 9);
|
|
184
|
+
buf.writeUInt32BE(frame.requestId, 17);
|
|
185
|
+
frame.payload.copy(buf, 21);
|
|
186
|
+
return buf;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Stream-safe frame decoder. Push raw chunks as they arrive on the
|
|
190
|
+
* socket; the parser yields zero or more complete frames per push and
|
|
191
|
+
* keeps any trailing partial frame buffered for the next push.
|
|
192
|
+
*
|
|
193
|
+
* Throws `FrameError("FRAME_TOO_LARGE")` synchronously from `push()` if
|
|
194
|
+
* a peer advertises a length above the cap -- caller MUST close the
|
|
195
|
+
* connection rather than continue draining the buffer.
|
|
196
|
+
*/
|
|
197
|
+
export class FrameParser {
|
|
198
|
+
chunks = [];
|
|
199
|
+
size = 0;
|
|
200
|
+
push(chunk) {
|
|
201
|
+
if (chunk.length === 0)
|
|
202
|
+
return [];
|
|
203
|
+
this.chunks.push(chunk);
|
|
204
|
+
this.size += chunk.length;
|
|
205
|
+
const out = [];
|
|
206
|
+
for (;;) {
|
|
207
|
+
const frame = this.takeOne();
|
|
208
|
+
if (!frame)
|
|
209
|
+
break;
|
|
210
|
+
out.push(frame);
|
|
211
|
+
}
|
|
212
|
+
return out;
|
|
213
|
+
}
|
|
214
|
+
/** Bytes currently buffered (partial/unparsed). Useful for diagnostics. */
|
|
215
|
+
bufferedBytes() {
|
|
216
|
+
return this.size;
|
|
217
|
+
}
|
|
218
|
+
takeOne() {
|
|
219
|
+
if (this.size < 4)
|
|
220
|
+
return null;
|
|
221
|
+
const buf = this.materialize();
|
|
222
|
+
const totalAfterLen = buf.readUInt32BE(0);
|
|
223
|
+
if (totalAfterLen < FRAME_HEADER_BYTES) {
|
|
224
|
+
throw new FrameError("FRAME_INVALID", `len=${totalAfterLen} smaller than header (${FRAME_HEADER_BYTES})`);
|
|
225
|
+
}
|
|
226
|
+
if (totalAfterLen - FRAME_HEADER_BYTES > MAX_PAYLOAD_BYTES) {
|
|
227
|
+
throw new FrameError("FRAME_TOO_LARGE", `payload size ${totalAfterLen - FRAME_HEADER_BYTES} exceeds cap ${MAX_PAYLOAD_BYTES}`);
|
|
228
|
+
}
|
|
229
|
+
if (buf.length < 4 + totalAfterLen)
|
|
230
|
+
return null;
|
|
231
|
+
const type = buf.readUInt8(4);
|
|
232
|
+
const connectionId = buf.readUInt32BE(5);
|
|
233
|
+
const generation = buf.readBigUInt64BE(9);
|
|
234
|
+
const requestId = buf.readUInt32BE(17);
|
|
235
|
+
const payload = Buffer.from(buf.subarray(21, 4 + totalAfterLen));
|
|
236
|
+
const remainder = buf.subarray(4 + totalAfterLen);
|
|
237
|
+
if (remainder.length > 0) {
|
|
238
|
+
this.chunks = [Buffer.from(remainder)];
|
|
239
|
+
this.size = remainder.length;
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
this.chunks = [];
|
|
243
|
+
this.size = 0;
|
|
244
|
+
}
|
|
245
|
+
return { type, connectionId, generation, requestId, payload };
|
|
246
|
+
}
|
|
247
|
+
materialize() {
|
|
248
|
+
if (this.chunks.length === 1)
|
|
249
|
+
return this.chunks[0];
|
|
250
|
+
const merged = Buffer.concat(this.chunks, this.size);
|
|
251
|
+
this.chunks = [merged];
|
|
252
|
+
return merged;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
//# sourceMappingURL=frames.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frames.js","sourceRoot":"","sources":["../../../src/pty/host-protocol/frames.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,qCAAqC;AAEtF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAEl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