@walkhi/code-relax 0.1.0-beta.1
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/README.md +83 -0
- package/dist/bin/codex-remote.mjs +262 -0
- package/dist/bin/self-relay-demo.mjs +33 -0
- package/dist/bin/self-relay-server.mjs +50 -0
- package/dist/get-lan-networks.ps1 +40 -0
- package/dist/get-shared-service-url.ps1 +6 -0
- package/dist/shared/app-server-events.cjs +266 -0
- package/dist/shared/p2p-diagnostics.cjs +28 -0
- package/dist/shared/server-requests.cjs +67 -0
- package/dist/shared/timeline-sync.cjs +67 -0
- package/dist/skills/code-relax/SKILL.md +17 -0
- package/dist/src/app-server-client.mjs +468 -0
- package/dist/src/app-server-tasks.mjs +355 -0
- package/dist/src/background-process.mjs +18 -0
- package/dist/src/debug-ui.mjs +131 -0
- package/dist/src/desktop-launcher.mjs +51 -0
- package/dist/src/execution-health.mjs +26 -0
- package/dist/src/lan-socket-server.mjs +103 -0
- package/dist/src/managed-app-server.mjs +207 -0
- package/dist/src/message-images.mjs +27 -0
- package/dist/src/onboarding.mjs +31 -0
- package/dist/src/platform/README.md +12 -0
- package/dist/src/platform/linux/README.md +3 -0
- package/dist/src/platform/macos/README.md +3 -0
- package/dist/src/platform/windows/IsolatedProcess.cs +75 -0
- package/dist/src/platform/windows/background-process.mjs +25 -0
- package/dist/src/platform/windows/credential-store.mjs +27 -0
- package/dist/src/platform/windows/credential-store.ps1 +49 -0
- package/dist/src/platform/windows/desktop-host.mjs +38 -0
- package/dist/src/platform/windows/desktop-info.ps1 +16 -0
- package/dist/src/platform/windows/desktop-monitor.mjs +34 -0
- package/dist/src/platform/windows/desktop-shortcut-run.ps1 +5 -0
- package/dist/src/platform/windows/desktop-shortcuts.ps1 +28 -0
- package/dist/src/platform/windows/desktop-tools.mjs +48 -0
- package/dist/src/platform/windows/launch-worker.ps1 +13 -0
- package/dist/src/platform/windows/network-info.mjs +34 -0
- package/dist/src/platform/windows/resident-start.ps1 +7 -0
- package/dist/src/platform/windows/resident-startup.ps1 +27 -0
- package/dist/src/platform/windows/resolve-state-root.ps1 +14 -0
- package/dist/src/platform/windows/runtime-paths.mjs +20 -0
- package/dist/src/platform/windows/service-host.mjs +43 -0
- package/dist/src/platform/windows/start-hidden-console.ps1 +39 -0
- package/dist/src/platform/windows/stop-desktop.ps1 +19 -0
- package/dist/src/platform/windows/user-environment.mjs +50 -0
- package/dist/src/platform/windows/user-environment.ps1 +41 -0
- package/dist/src/self-relay/client.mjs +59 -0
- package/dist/src/self-relay/connector.mjs +147 -0
- package/dist/src/self-relay/debug-allowlist.mjs +33 -0
- package/dist/src/self-relay/demo.mjs +38 -0
- package/dist/src/self-relay/device-store.mjs +84 -0
- package/dist/src/self-relay/lan-authorizations.mjs +29 -0
- package/dist/src/self-relay/lifecycle.mjs +281 -0
- package/dist/src/self-relay/p2p-probe.mjs +83 -0
- package/dist/src/self-relay/server.mjs +340 -0
- package/dist/src/self-relay/windows-route-helper.mjs +75 -0
- package/dist/src/self-relay/wire.mjs +36 -0
- package/dist/src/server.mjs +2086 -0
- package/dist/src/service-control.mjs +72 -0
- package/dist/src/service-doctor.mjs +63 -0
- package/dist/src/service-health.mjs +33 -0
- package/dist/src/service-install.mjs +91 -0
- package/dist/src/service-lifecycle.mjs +130 -0
- package/dist/src/service-restart.mjs +48 -0
- package/dist/src/shared-app-server.mjs +356 -0
- package/dist/src/shared-catalog.mjs +60 -0
- package/dist/src/shared-recovery.mjs +142 -0
- package/dist/src/shared-thread-stream.mjs +80 -0
- package/dist/src/skill-install.mjs +64 -0
- package/dist/src/thread-catalog.mjs +42 -0
- package/dist/src/thread-title-generation.mjs +150 -0
- package/dist/tools/find-desktop-pipe.mjs +10 -0
- package/dist/tools/rtc-route-helper.ps1 +99 -0
- package/dist/tools/start-rtc-route-helper.ps1 +15 -0
- package/dist/web/approval-ui.js +188 -0
- package/dist/web/capabilities.js +57 -0
- package/dist/web/chat-transport.js +196 -0
- package/dist/web/chat.css +736 -0
- package/dist/web/chat.js +5149 -0
- package/dist/web/client-platform.js +11 -0
- package/dist/web/harmony-platform.js +51 -0
- package/dist/web/highlight-powershell.min.js +39 -0
- package/dist/web/highlight.min.js +1262 -0
- package/dist/web/history-cache.js +146 -0
- package/dist/web/index.html +222 -0
- package/dist/web/lan-session.js +122 -0
- package/dist/web/p2p-diagnostics.js +28 -0
- package/dist/web/p2p-probe.js +83 -0
- package/dist/web/resources.json +1 -0
- package/dist/web/self-relay-session.js +119 -0
- package/dist/web/server-requests.js +67 -0
- package/dist/web/timeline-sync.js +67 -0
- package/dist/web/vendor/README.md +14 -0
- package/dist/web/vendor/highlight-powershell.min.js +39 -0
- package/dist/web/vendor/highlight.LICENSE.txt +29 -0
- package/dist/web/vendor/highlight.min.js +1262 -0
- package/dist/web/vendor/markdown-it.LICENSE.txt +22 -0
- package/dist/web/vendor/markdown-it.umd.min.js +14 -0
- package/node_modules/@img/colour/LICENSE.md +82 -0
- package/node_modules/@img/colour/README.md +15 -0
- package/node_modules/@img/colour/color.cjs +1596 -0
- package/node_modules/@img/colour/index.cjs +1 -0
- package/node_modules/@img/colour/index.d.ts +929 -0
- package/node_modules/@img/colour/package.json +58 -0
- package/node_modules/@img/sharp-win32-x64/LICENSE +191 -0
- package/node_modules/@img/sharp-win32-x64/README.md +59 -0
- package/node_modules/@img/sharp-win32-x64/index.cjs +1 -0
- package/node_modules/@img/sharp-win32-x64/lib/libvips-42.dll +0 -0
- package/node_modules/@img/sharp-win32-x64/lib/libvips-cpp-8.18.6.dll +0 -0
- package/node_modules/@img/sharp-win32-x64/lib/sharp-win32-x64-0.35.4.node +0 -0
- package/node_modules/@img/sharp-win32-x64/package.json +40 -0
- package/node_modules/@img/sharp-win32-x64/versions.json +30 -0
- package/node_modules/@node-datachannel/win32-x64-msvc/node_datachannel.node +0 -0
- package/node_modules/@node-datachannel/win32-x64-msvc/package.json +20 -0
- package/node_modules/ansi-regex/index.d.ts +37 -0
- package/node_modules/ansi-regex/index.js +10 -0
- package/node_modules/ansi-regex/license +9 -0
- package/node_modules/ansi-regex/package.json +55 -0
- package/node_modules/ansi-regex/readme.md +78 -0
- package/node_modules/ansi-styles/index.d.ts +345 -0
- package/node_modules/ansi-styles/index.js +163 -0
- package/node_modules/ansi-styles/license +9 -0
- package/node_modules/ansi-styles/package.json +56 -0
- package/node_modules/ansi-styles/readme.md +152 -0
- package/node_modules/camelcase/index.d.ts +63 -0
- package/node_modules/camelcase/index.js +76 -0
- package/node_modules/camelcase/license +9 -0
- package/node_modules/camelcase/package.json +43 -0
- package/node_modules/camelcase/readme.md +99 -0
- package/node_modules/cliui/CHANGELOG.md +76 -0
- package/node_modules/cliui/LICENSE.txt +14 -0
- package/node_modules/cliui/README.md +115 -0
- package/node_modules/cliui/index.js +354 -0
- package/node_modules/cliui/package.json +65 -0
- package/node_modules/color-convert/CHANGELOG.md +54 -0
- package/node_modules/color-convert/LICENSE +21 -0
- package/node_modules/color-convert/README.md +68 -0
- package/node_modules/color-convert/conversions.js +839 -0
- package/node_modules/color-convert/index.js +81 -0
- package/node_modules/color-convert/package.json +48 -0
- package/node_modules/color-convert/route.js +97 -0
- package/node_modules/color-name/LICENSE +8 -0
- package/node_modules/color-name/README.md +11 -0
- package/node_modules/color-name/index.js +152 -0
- package/node_modules/color-name/package.json +28 -0
- package/node_modules/decamelize/index.js +13 -0
- package/node_modules/decamelize/license +21 -0
- package/node_modules/decamelize/package.json +38 -0
- package/node_modules/decamelize/readme.md +48 -0
- package/node_modules/detect-libc/LICENSE +201 -0
- package/node_modules/detect-libc/README.md +163 -0
- package/node_modules/detect-libc/index.d.ts +14 -0
- package/node_modules/detect-libc/lib/detect-libc.js +313 -0
- package/node_modules/detect-libc/lib/elf.js +39 -0
- package/node_modules/detect-libc/lib/filesystem.js +51 -0
- package/node_modules/detect-libc/lib/process.js +24 -0
- package/node_modules/detect-libc/package.json +44 -0
- package/node_modules/dijkstrajs/.travis.yml +4 -0
- package/node_modules/dijkstrajs/CONTRIBUTING.md +8 -0
- package/node_modules/dijkstrajs/LICENSE.md +19 -0
- package/node_modules/dijkstrajs/README.md +18 -0
- package/node_modules/dijkstrajs/dijkstra.js +165 -0
- package/node_modules/dijkstrajs/package.json +60 -0
- package/node_modules/dijkstrajs/test/dijkstra.test.js +96 -0
- package/node_modules/emoji-regex/LICENSE-MIT.txt +20 -0
- package/node_modules/emoji-regex/README.md +73 -0
- package/node_modules/emoji-regex/es2015/index.js +6 -0
- package/node_modules/emoji-regex/es2015/text.js +6 -0
- package/node_modules/emoji-regex/index.d.ts +23 -0
- package/node_modules/emoji-regex/index.js +6 -0
- package/node_modules/emoji-regex/package.json +50 -0
- package/node_modules/emoji-regex/text.js +6 -0
- package/node_modules/find-up/index.d.ts +137 -0
- package/node_modules/find-up/index.js +89 -0
- package/node_modules/find-up/license +9 -0
- package/node_modules/find-up/package.json +53 -0
- package/node_modules/find-up/readme.md +156 -0
- package/node_modules/get-caller-file/LICENSE.md +6 -0
- package/node_modules/get-caller-file/README.md +41 -0
- package/node_modules/get-caller-file/index.d.ts +2 -0
- package/node_modules/get-caller-file/index.js +22 -0
- package/node_modules/get-caller-file/index.js.map +1 -0
- package/node_modules/get-caller-file/package.json +42 -0
- package/node_modules/is-fullwidth-code-point/index.d.ts +17 -0
- package/node_modules/is-fullwidth-code-point/index.js +50 -0
- package/node_modules/is-fullwidth-code-point/license +9 -0
- package/node_modules/is-fullwidth-code-point/package.json +42 -0
- package/node_modules/is-fullwidth-code-point/readme.md +39 -0
- package/node_modules/locate-path/index.d.ts +83 -0
- package/node_modules/locate-path/index.js +65 -0
- package/node_modules/locate-path/license +9 -0
- package/node_modules/locate-path/package.json +45 -0
- package/node_modules/locate-path/readme.md +122 -0
- package/node_modules/node-datachannel/.clang-format +17 -0
- package/node_modules/node-datachannel/.editorconfig +12 -0
- package/node_modules/node-datachannel/.eslintignore +8 -0
- package/node_modules/node-datachannel/.eslintrc.json +27 -0
- package/node_modules/node-datachannel/.gitmodules +3 -0
- package/node_modules/node-datachannel/.prettierignore +7 -0
- package/node_modules/node-datachannel/.prettierrc +13 -0
- package/node_modules/node-datachannel/API.md +247 -0
- package/node_modules/node-datachannel/BULDING.md +26 -0
- package/node_modules/node-datachannel/CMakeLists.txt +153 -0
- package/node_modules/node-datachannel/LICENSE +373 -0
- package/node_modules/node-datachannel/README.md +129 -0
- package/node_modules/node-datachannel/dist/cjs/index.cjs +11 -0
- package/node_modules/node-datachannel/dist/cjs/index.cjs.map +1 -0
- package/node_modules/node-datachannel/dist/cjs/lib/datachannel-stream.cjs +101 -0
- package/node_modules/node-datachannel/dist/cjs/lib/datachannel-stream.cjs.map +1 -0
- package/node_modules/node-datachannel/dist/cjs/lib/index.cjs +91 -0
- package/node_modules/node-datachannel/dist/cjs/lib/index.cjs.map +1 -0
- package/node_modules/node-datachannel/dist/cjs/lib/node-datachannel.cjs +94 -0
- package/node_modules/node-datachannel/dist/cjs/lib/node-datachannel.cjs.map +1 -0
- package/node_modules/node-datachannel/dist/cjs/lib/websocket-server.cjs +45 -0
- package/node_modules/node-datachannel/dist/cjs/lib/websocket-server.cjs.map +1 -0
- package/node_modules/node-datachannel/dist/cjs/lib/websocket.cjs +8 -0
- package/node_modules/node-datachannel/dist/cjs/lib/websocket.cjs.map +1 -0
- package/node_modules/node-datachannel/dist/cjs/polyfill/Events.cjs +86 -0
- package/node_modules/node-datachannel/dist/cjs/polyfill/Events.cjs.map +1 -0
- package/node_modules/node-datachannel/dist/cjs/polyfill/Exception.cjs +34 -0
- package/node_modules/node-datachannel/dist/cjs/polyfill/Exception.cjs.map +1 -0
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCCertificate.cjs +34 -0
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCCertificate.cjs.map +1 -0
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCDataChannel.cjs +214 -0
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCDataChannel.cjs.map +1 -0
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCDtlsTransport.cjs +53 -0
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCDtlsTransport.cjs.map +1 -0
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCError.cjs +83 -0
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCError.cjs.map +1 -0
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCIceCandidate.cjs +132 -0
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCIceCandidate.cjs.map +1 -0
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCIceTransport.cjs +94 -0
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCIceTransport.cjs.map +1 -0
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCPeerConnection.cjs +434 -0
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCPeerConnection.cjs.map +1 -0
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCSctpTransport.cjs +59 -0
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCSctpTransport.cjs.map +1 -0
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCSessionDescription.cjs +45 -0
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCSessionDescription.cjs.map +1 -0
- package/node_modules/node-datachannel/dist/cjs/polyfill/index.cjs +42 -0
- package/node_modules/node-datachannel/dist/cjs/polyfill/index.cjs.map +1 -0
- package/node_modules/node-datachannel/dist/esm/index.mjs +8 -0
- package/node_modules/node-datachannel/dist/esm/index.mjs.map +1 -0
- package/node_modules/node-datachannel/dist/esm/lib/datachannel-stream.mjs +78 -0
- package/node_modules/node-datachannel/dist/esm/lib/datachannel-stream.mjs.map +1 -0
- package/node_modules/node-datachannel/dist/esm/lib/index.mjs +64 -0
- package/node_modules/node-datachannel/dist/esm/lib/index.mjs.map +1 -0
- package/node_modules/node-datachannel/dist/esm/lib/node-datachannel.mjs +78 -0
- package/node_modules/node-datachannel/dist/esm/lib/node-datachannel.mjs.map +1 -0
- package/node_modules/node-datachannel/dist/esm/lib/websocket-server.mjs +43 -0
- package/node_modules/node-datachannel/dist/esm/lib/websocket-server.mjs.map +1 -0
- package/node_modules/node-datachannel/dist/esm/lib/websocket.mjs +6 -0
- package/node_modules/node-datachannel/dist/esm/lib/websocket.mjs.map +1 -0
- package/node_modules/node-datachannel/dist/esm/polyfill/Events.mjs +82 -0
- package/node_modules/node-datachannel/dist/esm/polyfill/Events.mjs.map +1 -0
- package/node_modules/node-datachannel/dist/esm/polyfill/Exception.mjs +28 -0
- package/node_modules/node-datachannel/dist/esm/polyfill/Exception.mjs.map +1 -0
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCCertificate.mjs +30 -0
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCCertificate.mjs.map +1 -0
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCDataChannel.mjs +210 -0
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCDataChannel.mjs.map +1 -0
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCDtlsTransport.mjs +49 -0
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCDtlsTransport.mjs.map +1 -0
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCError.mjs +79 -0
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCError.mjs.map +1 -0
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCIceCandidate.mjs +128 -0
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCIceCandidate.mjs.map +1 -0
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCIceTransport.mjs +89 -0
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCIceTransport.mjs.map +1 -0
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCPeerConnection.mjs +430 -0
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCPeerConnection.mjs.map +1 -0
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCSctpTransport.mjs +55 -0
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCSctpTransport.mjs.map +1 -0
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCSessionDescription.mjs +41 -0
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCSessionDescription.mjs.map +1 -0
- package/node_modules/node-datachannel/dist/esm/polyfill/index.mjs +27 -0
- package/node_modules/node-datachannel/dist/esm/polyfill/index.mjs.map +1 -0
- package/node_modules/node-datachannel/dist/types/lib/datachannel-stream.d.ts +24 -0
- package/node_modules/node-datachannel/dist/types/lib/index.d.ts +241 -0
- package/node_modules/node-datachannel/dist/types/lib/types.d.ts +119 -0
- package/node_modules/node-datachannel/dist/types/lib/websocket-server.d.ts +13 -0
- package/node_modules/node-datachannel/dist/types/lib/websocket.d.ts +25 -0
- package/node_modules/node-datachannel/dist/types/polyfill/Events.d.ts +15 -0
- package/node_modules/node-datachannel/dist/types/polyfill/RTCCertificate.d.ts +9 -0
- package/node_modules/node-datachannel/dist/types/polyfill/RTCDataChannel.d.ts +29 -0
- package/node_modules/node-datachannel/dist/types/polyfill/RTCDtlsTransport.d.ts +15 -0
- package/node_modules/node-datachannel/dist/types/polyfill/RTCError.d.ts +17 -0
- package/node_modules/node-datachannel/dist/types/polyfill/RTCIceCandidate.d.ts +21 -0
- package/node_modules/node-datachannel/dist/types/polyfill/RTCIceTransport.d.ts +30 -0
- package/node_modules/node-datachannel/dist/types/polyfill/RTCPeerConnection.d.ts +64 -0
- package/node_modules/node-datachannel/dist/types/polyfill/RTCSctpTransport.d.ts +15 -0
- package/node_modules/node-datachannel/dist/types/polyfill/RTCSessionDescription.d.ts +10 -0
- package/node_modules/node-datachannel/dist/types/polyfill/index.d.ts +26 -0
- package/node_modules/node-datachannel/jest.config.ts +14 -0
- package/node_modules/node-datachannel/package.json +133 -0
- package/node_modules/node-datachannel/rollup.config.mjs +67 -0
- package/node_modules/node-datachannel/src/cpp/data-channel-wrapper.cpp +530 -0
- package/node_modules/node-datachannel/src/cpp/data-channel-wrapper.h +63 -0
- package/node_modules/node-datachannel/src/cpp/ice-udp-mux-listener-wrapper.cpp +172 -0
- package/node_modules/node-datachannel/src/cpp/ice-udp-mux-listener-wrapper.h +43 -0
- package/node_modules/node-datachannel/src/cpp/main.cpp +58 -0
- package/node_modules/node-datachannel/src/cpp/media-audio-wrapper.cpp +457 -0
- package/node_modules/node-datachannel/src/cpp/media-audio-wrapper.h +52 -0
- package/node_modules/node-datachannel/src/cpp/media-av1packetization.cpp +24 -0
- package/node_modules/node-datachannel/src/cpp/media-av1packetization.h +11 -0
- package/node_modules/node-datachannel/src/cpp/media-av1rtppacketizer-wrapper.cpp +126 -0
- package/node_modules/node-datachannel/src/cpp/media-av1rtppacketizer-wrapper.h +29 -0
- package/node_modules/node-datachannel/src/cpp/media-direction.cpp +43 -0
- package/node_modules/node-datachannel/src/cpp/media-direction.h +10 -0
- package/node_modules/node-datachannel/src/cpp/media-h264rtppacketizer-wrapper.cpp +126 -0
- package/node_modules/node-datachannel/src/cpp/media-h264rtppacketizer-wrapper.h +30 -0
- package/node_modules/node-datachannel/src/cpp/media-h265rtppacketizer-wrapper.cpp +126 -0
- package/node_modules/node-datachannel/src/cpp/media-h265rtppacketizer-wrapper.h +30 -0
- package/node_modules/node-datachannel/src/cpp/media-h26xseparator.cpp +32 -0
- package/node_modules/node-datachannel/src/cpp/media-h26xseparator.h +11 -0
- package/node_modules/node-datachannel/src/cpp/media-mediahandler-helper.cpp +31 -0
- package/node_modules/node-datachannel/src/cpp/media-mediahandler-helper.h +11 -0
- package/node_modules/node-datachannel/src/cpp/media-pacinghandler-wrapper.cpp +79 -0
- package/node_modules/node-datachannel/src/cpp/media-pacinghandler-wrapper.h +28 -0
- package/node_modules/node-datachannel/src/cpp/media-rtcpnackresponder-wrapper.cpp +68 -0
- package/node_modules/node-datachannel/src/cpp/media-rtcpnackresponder-wrapper.h +28 -0
- package/node_modules/node-datachannel/src/cpp/media-rtcpreceivingsession-wrapper.cpp +57 -0
- package/node_modules/node-datachannel/src/cpp/media-rtcpreceivingsession-wrapper.h +28 -0
- package/node_modules/node-datachannel/src/cpp/media-rtcpsrreporter-wrapper.cpp +93 -0
- package/node_modules/node-datachannel/src/cpp/media-rtcpsrreporter-wrapper.h +30 -0
- package/node_modules/node-datachannel/src/cpp/media-rtppacketizationconfig-wrapper.cpp +167 -0
- package/node_modules/node-datachannel/src/cpp/media-rtppacketizationconfig-wrapper.h +35 -0
- package/node_modules/node-datachannel/src/cpp/media-rtppacketizer-wrapper.cpp +95 -0
- package/node_modules/node-datachannel/src/cpp/media-rtppacketizer-wrapper.h +30 -0
- package/node_modules/node-datachannel/src/cpp/media-track-wrapper.cpp +458 -0
- package/node_modules/node-datachannel/src/cpp/media-track-wrapper.h +61 -0
- package/node_modules/node-datachannel/src/cpp/media-video-wrapper.cpp +526 -0
- package/node_modules/node-datachannel/src/cpp/media-video-wrapper.h +56 -0
- package/node_modules/node-datachannel/src/cpp/peer-connection-wrapper.cpp +1298 -0
- package/node_modules/node-datachannel/src/cpp/peer-connection-wrapper.h +89 -0
- package/node_modules/node-datachannel/src/cpp/rtc-wrapper.cpp +205 -0
- package/node_modules/node-datachannel/src/cpp/rtc-wrapper.h +24 -0
- package/node_modules/node-datachannel/src/cpp/thread-safe-callback.cpp +57 -0
- package/node_modules/node-datachannel/src/cpp/thread-safe-callback.h +47 -0
- package/node_modules/node-datachannel/src/cpp/web-socket-server-wrapper.cpp +275 -0
- package/node_modules/node-datachannel/src/cpp/web-socket-server-wrapper.h +41 -0
- package/node_modules/node-datachannel/src/cpp/web-socket-wrapper.cpp +796 -0
- package/node_modules/node-datachannel/src/cpp/web-socket-wrapper.h +63 -0
- package/node_modules/node-datachannel/src/index.ts +9 -0
- package/node_modules/node-datachannel/src/lib/datachannel-stream.ts +100 -0
- package/node_modules/node-datachannel/src/lib/index.ts +290 -0
- package/node_modules/node-datachannel/src/lib/node-datachannel.ts +84 -0
- package/node_modules/node-datachannel/src/lib/types.ts +169 -0
- package/node_modules/node-datachannel/src/lib/websocket-server.ts +37 -0
- package/node_modules/node-datachannel/src/lib/websocket.ts +26 -0
- package/node_modules/node-datachannel/src/polyfill/Events.ts +82 -0
- package/node_modules/node-datachannel/src/polyfill/Exception.ts +37 -0
- package/node_modules/node-datachannel/src/polyfill/README.md +41 -0
- package/node_modules/node-datachannel/src/polyfill/RTCCertificate.ts +21 -0
- package/node_modules/node-datachannel/src/polyfill/RTCDataChannel.ts +225 -0
- package/node_modules/node-datachannel/src/polyfill/RTCDtlsTransport.ts +46 -0
- package/node_modules/node-datachannel/src/polyfill/RTCError.ts +78 -0
- package/node_modules/node-datachannel/src/polyfill/RTCIceCandidate.ts +128 -0
- package/node_modules/node-datachannel/src/polyfill/RTCIceTransport.ts +90 -0
- package/node_modules/node-datachannel/src/polyfill/RTCPeerConnection.ts +527 -0
- package/node_modules/node-datachannel/src/polyfill/RTCSctpTransport.ts +51 -0
- package/node_modules/node-datachannel/src/polyfill/RTCSessionDescription.ts +41 -0
- package/node_modules/node-datachannel/src/polyfill/index.ts +38 -0
- package/node_modules/node-datachannel/tsconfig.json +21 -0
- package/node_modules/p-limit/index.d.ts +38 -0
- package/node_modules/p-limit/index.js +57 -0
- package/node_modules/p-limit/license +9 -0
- package/node_modules/p-limit/package.json +52 -0
- package/node_modules/p-limit/readme.md +101 -0
- package/node_modules/p-locate/index.d.ts +64 -0
- package/node_modules/p-locate/index.js +52 -0
- package/node_modules/p-locate/license +9 -0
- package/node_modules/p-locate/package.json +53 -0
- package/node_modules/p-locate/readme.md +90 -0
- package/node_modules/p-try/index.d.ts +39 -0
- package/node_modules/p-try/index.js +9 -0
- package/node_modules/p-try/license +9 -0
- package/node_modules/p-try/package.json +42 -0
- package/node_modules/p-try/readme.md +58 -0
- package/node_modules/path-exists/index.d.ts +28 -0
- package/node_modules/path-exists/index.js +23 -0
- package/node_modules/path-exists/license +9 -0
- package/node_modules/path-exists/package.json +39 -0
- package/node_modules/path-exists/readme.md +52 -0
- package/node_modules/pngjs/.eslintignore +2 -0
- package/node_modules/pngjs/.eslintrc.json +19 -0
- package/node_modules/pngjs/.prettierignore +3 -0
- package/node_modules/pngjs/LICENSE +20 -0
- package/node_modules/pngjs/README.md +429 -0
- package/node_modules/pngjs/browser.js +16096 -0
- package/node_modules/pngjs/coverage/lcov-report/base.css +354 -0
- package/node_modules/pngjs/coverage/lcov-report/bitmapper.js.html +881 -0
- package/node_modules/pngjs/coverage/lcov-report/bitpacker.js.html +554 -0
- package/node_modules/pngjs/coverage/lcov-report/block-navigation.js +77 -0
- package/node_modules/pngjs/coverage/lcov-report/chunkstream.js.html +647 -0
- package/node_modules/pngjs/coverage/lcov-report/constants.js.html +176 -0
- package/node_modules/pngjs/coverage/lcov-report/crc.js.html +200 -0
- package/node_modules/pngjs/coverage/lcov-report/favicon.png +0 -0
- package/node_modules/pngjs/coverage/lcov-report/filter-pack.js.html +593 -0
- package/node_modules/pngjs/coverage/lcov-report/filter-parse-async.js.html +152 -0
- package/node_modules/pngjs/coverage/lcov-report/filter-parse-sync.js.html +143 -0
- package/node_modules/pngjs/coverage/lcov-report/filter-parse.js.html +611 -0
- package/node_modules/pngjs/coverage/lcov-report/format-normaliser.js.html +359 -0
- package/node_modules/pngjs/coverage/lcov-report/index.html +426 -0
- package/node_modules/pngjs/coverage/lcov-report/interlace.js.html +365 -0
- package/node_modules/pngjs/coverage/lcov-report/packer-async.js.html +230 -0
- package/node_modules/pngjs/coverage/lcov-report/packer-sync.js.html +248 -0
- package/node_modules/pngjs/coverage/lcov-report/packer.js.html +467 -0
- package/node_modules/pngjs/coverage/lcov-report/paeth-predictor.js.html +128 -0
- package/node_modules/pngjs/coverage/lcov-report/parser-async.js.html +575 -0
- package/node_modules/pngjs/coverage/lcov-report/parser-sync.js.html +404 -0
- package/node_modules/pngjs/coverage/lcov-report/parser.js.html +950 -0
- package/node_modules/pngjs/coverage/lcov-report/png-sync.js.html +116 -0
- package/node_modules/pngjs/coverage/lcov-report/png.js.html +662 -0
- package/node_modules/pngjs/coverage/lcov-report/prettify.css +101 -0
- package/node_modules/pngjs/coverage/lcov-report/prettify.js +1007 -0
- package/node_modules/pngjs/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/node_modules/pngjs/coverage/lcov-report/sorter.js +169 -0
- package/node_modules/pngjs/coverage/lcov-report/sync-inflate.js.html +584 -0
- package/node_modules/pngjs/coverage/lcov-report/sync-reader.js.html +215 -0
- package/node_modules/pngjs/coverage/lcov.info +2177 -0
- package/node_modules/pngjs/lib/bitmapper.js +267 -0
- package/node_modules/pngjs/lib/bitpacker.js +158 -0
- package/node_modules/pngjs/lib/chunkstream.js +189 -0
- package/node_modules/pngjs/lib/constants.js +32 -0
- package/node_modules/pngjs/lib/crc.js +40 -0
- package/node_modules/pngjs/lib/filter-pack.js +171 -0
- package/node_modules/pngjs/lib/filter-parse-async.js +24 -0
- package/node_modules/pngjs/lib/filter-parse-sync.js +21 -0
- package/node_modules/pngjs/lib/filter-parse.js +177 -0
- package/node_modules/pngjs/lib/format-normaliser.js +93 -0
- package/node_modules/pngjs/lib/interlace.js +95 -0
- package/node_modules/pngjs/lib/packer-async.js +50 -0
- package/node_modules/pngjs/lib/packer-sync.js +56 -0
- package/node_modules/pngjs/lib/packer.js +129 -0
- package/node_modules/pngjs/lib/paeth-predictor.js +16 -0
- package/node_modules/pngjs/lib/parser-async.js +165 -0
- package/node_modules/pngjs/lib/parser-sync.js +108 -0
- package/node_modules/pngjs/lib/parser.js +290 -0
- package/node_modules/pngjs/lib/png-sync.js +12 -0
- package/node_modules/pngjs/lib/png.js +194 -0
- package/node_modules/pngjs/lib/sync-inflate.js +168 -0
- package/node_modules/pngjs/lib/sync-reader.js +45 -0
- package/node_modules/pngjs/package.json +73 -0
- package/node_modules/qrcode/README.md +770 -0
- package/node_modules/qrcode/bin/qrcode +159 -0
- package/node_modules/qrcode/helper/to-sjis-browser.js +2 -0
- package/node_modules/qrcode/helper/to-sjis.js +105 -0
- package/node_modules/qrcode/lib/browser.js +76 -0
- package/node_modules/qrcode/lib/can-promise.js +7 -0
- package/node_modules/qrcode/lib/core/alignment-pattern.js +83 -0
- package/node_modules/qrcode/lib/core/alphanumeric-data.js +59 -0
- package/node_modules/qrcode/lib/core/bit-buffer.js +37 -0
- package/node_modules/qrcode/lib/core/bit-matrix.js +65 -0
- package/node_modules/qrcode/lib/core/byte-data.js +30 -0
- package/node_modules/qrcode/lib/core/error-correction-code.js +135 -0
- package/node_modules/qrcode/lib/core/error-correction-level.js +50 -0
- package/node_modules/qrcode/lib/core/finder-pattern.js +22 -0
- package/node_modules/qrcode/lib/core/format-info.js +29 -0
- package/node_modules/qrcode/lib/core/galois-field.js +69 -0
- package/node_modules/qrcode/lib/core/kanji-data.js +54 -0
- package/node_modules/qrcode/lib/core/mask-pattern.js +234 -0
- package/node_modules/qrcode/lib/core/mode.js +167 -0
- package/node_modules/qrcode/lib/core/numeric-data.js +43 -0
- package/node_modules/qrcode/lib/core/polynomial.js +62 -0
- package/node_modules/qrcode/lib/core/qrcode.js +495 -0
- package/node_modules/qrcode/lib/core/reed-solomon-encoder.js +56 -0
- package/node_modules/qrcode/lib/core/regex.js +31 -0
- package/node_modules/qrcode/lib/core/segments.js +330 -0
- package/node_modules/qrcode/lib/core/utils.js +63 -0
- package/node_modules/qrcode/lib/core/version-check.js +9 -0
- package/node_modules/qrcode/lib/core/version.js +163 -0
- package/node_modules/qrcode/lib/index.js +12 -0
- package/node_modules/qrcode/lib/renderer/canvas.js +63 -0
- package/node_modules/qrcode/lib/renderer/png.js +78 -0
- package/node_modules/qrcode/lib/renderer/svg-tag.js +81 -0
- package/node_modules/qrcode/lib/renderer/svg.js +19 -0
- package/node_modules/qrcode/lib/renderer/terminal/terminal-small.js +85 -0
- package/node_modules/qrcode/lib/renderer/terminal/terminal.js +49 -0
- package/node_modules/qrcode/lib/renderer/terminal.js +9 -0
- package/node_modules/qrcode/lib/renderer/utf8.js +71 -0
- package/node_modules/qrcode/lib/renderer/utils.js +99 -0
- package/node_modules/qrcode/lib/server.js +138 -0
- package/node_modules/qrcode/license +10 -0
- package/node_modules/qrcode/package.json +77 -0
- package/node_modules/require-directory/.jshintrc +67 -0
- package/node_modules/require-directory/.npmignore +1 -0
- package/node_modules/require-directory/.travis.yml +3 -0
- package/node_modules/require-directory/LICENSE +22 -0
- package/node_modules/require-directory/README.markdown +184 -0
- package/node_modules/require-directory/index.js +86 -0
- package/node_modules/require-directory/package.json +40 -0
- package/node_modules/require-main-filename/CHANGELOG.md +26 -0
- package/node_modules/require-main-filename/LICENSE.txt +14 -0
- package/node_modules/require-main-filename/README.md +26 -0
- package/node_modules/require-main-filename/index.js +18 -0
- package/node_modules/require-main-filename/package.json +35 -0
- package/node_modules/semver/LICENSE +15 -0
- package/node_modules/semver/README.md +680 -0
- package/node_modules/semver/bin/semver.js +195 -0
- package/node_modules/semver/classes/comparator.js +143 -0
- package/node_modules/semver/classes/index.js +7 -0
- package/node_modules/semver/classes/range.js +577 -0
- package/node_modules/semver/classes/semver.js +350 -0
- package/node_modules/semver/functions/clean.js +8 -0
- package/node_modules/semver/functions/cmp.js +54 -0
- package/node_modules/semver/functions/coerce.js +62 -0
- package/node_modules/semver/functions/compare-build.js +9 -0
- package/node_modules/semver/functions/compare-loose.js +5 -0
- package/node_modules/semver/functions/compare.js +7 -0
- package/node_modules/semver/functions/diff.js +60 -0
- package/node_modules/semver/functions/eq.js +5 -0
- package/node_modules/semver/functions/gt.js +5 -0
- package/node_modules/semver/functions/gte.js +5 -0
- package/node_modules/semver/functions/inc.js +21 -0
- package/node_modules/semver/functions/lt.js +5 -0
- package/node_modules/semver/functions/lte.js +5 -0
- package/node_modules/semver/functions/major.js +5 -0
- package/node_modules/semver/functions/minor.js +5 -0
- package/node_modules/semver/functions/neq.js +5 -0
- package/node_modules/semver/functions/parse.js +18 -0
- package/node_modules/semver/functions/patch.js +5 -0
- package/node_modules/semver/functions/prerelease.js +8 -0
- package/node_modules/semver/functions/rcompare.js +5 -0
- package/node_modules/semver/functions/rsort.js +5 -0
- package/node_modules/semver/functions/satisfies.js +12 -0
- package/node_modules/semver/functions/sort.js +5 -0
- package/node_modules/semver/functions/truncate.js +48 -0
- package/node_modules/semver/functions/valid.js +8 -0
- package/node_modules/semver/index.js +93 -0
- package/node_modules/semver/internal/constants.js +37 -0
- package/node_modules/semver/internal/debug.js +11 -0
- package/node_modules/semver/internal/identifiers.js +29 -0
- package/node_modules/semver/internal/lrucache.js +42 -0
- package/node_modules/semver/internal/parse-options.js +17 -0
- package/node_modules/semver/internal/re.js +223 -0
- package/node_modules/semver/package.json +78 -0
- package/node_modules/semver/preload.js +4 -0
- package/node_modules/semver/range.bnf +17 -0
- package/node_modules/semver/ranges/gtr.js +6 -0
- package/node_modules/semver/ranges/intersects.js +9 -0
- package/node_modules/semver/ranges/ltr.js +6 -0
- package/node_modules/semver/ranges/max-satisfying.js +27 -0
- package/node_modules/semver/ranges/min-satisfying.js +26 -0
- package/node_modules/semver/ranges/min-version.js +63 -0
- package/node_modules/semver/ranges/outside.js +82 -0
- package/node_modules/semver/ranges/simplify.js +49 -0
- package/node_modules/semver/ranges/subset.js +249 -0
- package/node_modules/semver/ranges/to-comparators.js +10 -0
- package/node_modules/semver/ranges/valid.js +13 -0
- package/node_modules/set-blocking/CHANGELOG.md +26 -0
- package/node_modules/set-blocking/LICENSE.txt +14 -0
- package/node_modules/set-blocking/README.md +31 -0
- package/node_modules/set-blocking/index.js +7 -0
- package/node_modules/set-blocking/package.json +42 -0
- package/node_modules/sharp/LICENSE +191 -0
- package/node_modules/sharp/README.md +112 -0
- package/node_modules/sharp/dist/channel.cjs +177 -0
- package/node_modules/sharp/dist/channel.mjs +177 -0
- package/node_modules/sharp/dist/colour.cjs +199 -0
- package/node_modules/sharp/dist/colour.mjs +199 -0
- package/node_modules/sharp/dist/composite.cjs +213 -0
- package/node_modules/sharp/dist/composite.mjs +213 -0
- package/node_modules/sharp/dist/constructor.cjs +511 -0
- package/node_modules/sharp/dist/constructor.mjs +511 -0
- package/node_modules/sharp/dist/index.cjs +25 -0
- package/node_modules/sharp/dist/index.d.cts +1999 -0
- package/node_modules/sharp/dist/index.d.mts +2046 -0
- package/node_modules/sharp/dist/index.mjs +25 -0
- package/node_modules/sharp/dist/input.cjs +819 -0
- package/node_modules/sharp/dist/input.mjs +819 -0
- package/node_modules/sharp/dist/is.cjs +143 -0
- package/node_modules/sharp/dist/is.mjs +143 -0
- package/node_modules/sharp/dist/libvips.cjs +212 -0
- package/node_modules/sharp/dist/libvips.mjs +212 -0
- package/node_modules/sharp/dist/operation.cjs +1002 -0
- package/node_modules/sharp/dist/operation.mjs +1002 -0
- package/node_modules/sharp/dist/output.cjs +1785 -0
- package/node_modules/sharp/dist/output.mjs +1785 -0
- package/node_modules/sharp/dist/resize.cjs +617 -0
- package/node_modules/sharp/dist/resize.mjs +617 -0
- package/node_modules/sharp/dist/sharp.cjs +174 -0
- package/node_modules/sharp/dist/sharp.mjs +174 -0
- package/node_modules/sharp/dist/utility.cjs +301 -0
- package/node_modules/sharp/dist/utility.mjs +301 -0
- package/node_modules/sharp/install/build.js +38 -0
- package/node_modules/sharp/lib/index.d.ts +1999 -0
- package/node_modules/sharp/package.json +227 -0
- package/node_modules/sharp/src/binding.gyp +303 -0
- package/node_modules/sharp/src/common.cc +1186 -0
- package/node_modules/sharp/src/common.h +421 -0
- package/node_modules/sharp/src/metadata.cc +404 -0
- package/node_modules/sharp/src/metadata.h +95 -0
- package/node_modules/sharp/src/operations.cc +516 -0
- package/node_modules/sharp/src/operations.h +137 -0
- package/node_modules/sharp/src/pipeline.cc +1948 -0
- package/node_modules/sharp/src/pipeline.h +422 -0
- package/node_modules/sharp/src/sharp.cc +43 -0
- package/node_modules/sharp/src/stats.cc +186 -0
- package/node_modules/sharp/src/stats.h +62 -0
- package/node_modules/sharp/src/utilities.cc +289 -0
- package/node_modules/sharp/src/utilities.h +22 -0
- package/node_modules/string-width/index.d.ts +29 -0
- package/node_modules/string-width/index.js +47 -0
- package/node_modules/string-width/license +9 -0
- package/node_modules/string-width/package.json +56 -0
- package/node_modules/string-width/readme.md +50 -0
- package/node_modules/strip-ansi/index.d.ts +17 -0
- package/node_modules/strip-ansi/index.js +4 -0
- package/node_modules/strip-ansi/license +9 -0
- package/node_modules/strip-ansi/package.json +54 -0
- package/node_modules/strip-ansi/readme.md +46 -0
- package/node_modules/which-module/LICENSE +13 -0
- package/node_modules/which-module/README.md +58 -0
- package/node_modules/which-module/index.js +9 -0
- package/node_modules/which-module/package.json +41 -0
- package/node_modules/wrap-ansi/index.js +186 -0
- package/node_modules/wrap-ansi/license +9 -0
- package/node_modules/wrap-ansi/package.json +61 -0
- package/node_modules/wrap-ansi/readme.md +97 -0
- package/node_modules/ws/LICENSE +20 -0
- package/node_modules/ws/README.md +548 -0
- package/node_modules/ws/browser.js +8 -0
- package/node_modules/ws/index.js +22 -0
- package/node_modules/ws/lib/buffer-util.js +131 -0
- package/node_modules/ws/lib/constants.js +19 -0
- package/node_modules/ws/lib/event-target.js +292 -0
- package/node_modules/ws/lib/extension.js +203 -0
- package/node_modules/ws/lib/limiter.js +55 -0
- package/node_modules/ws/lib/permessage-deflate.js +530 -0
- package/node_modules/ws/lib/receiver.js +743 -0
- package/node_modules/ws/lib/sender.js +607 -0
- package/node_modules/ws/lib/stream.js +161 -0
- package/node_modules/ws/lib/subprotocol.js +62 -0
- package/node_modules/ws/lib/validation.js +152 -0
- package/node_modules/ws/lib/websocket-server.js +562 -0
- package/node_modules/ws/lib/websocket.js +1407 -0
- package/node_modules/ws/package.json +74 -0
- package/node_modules/ws/wrapper.mjs +21 -0
- package/node_modules/y18n/CHANGELOG.md +35 -0
- package/node_modules/y18n/LICENSE +13 -0
- package/node_modules/y18n/README.md +109 -0
- package/node_modules/y18n/index.js +188 -0
- package/node_modules/y18n/package.json +39 -0
- package/node_modules/yargs/CHANGELOG.md +420 -0
- package/node_modules/yargs/LICENSE +21 -0
- package/node_modules/yargs/README.md +140 -0
- package/node_modules/yargs/build/lib/apply-extends.d.ts +2 -0
- package/node_modules/yargs/build/lib/apply-extends.js +65 -0
- package/node_modules/yargs/build/lib/argsert.d.ts +2 -0
- package/node_modules/yargs/build/lib/argsert.js +65 -0
- package/node_modules/yargs/build/lib/command.d.ts +64 -0
- package/node_modules/yargs/build/lib/command.js +416 -0
- package/node_modules/yargs/build/lib/common-types.d.ts +36 -0
- package/node_modules/yargs/build/lib/common-types.js +25 -0
- package/node_modules/yargs/build/lib/completion-templates.d.ts +2 -0
- package/node_modules/yargs/build/lib/completion-templates.js +50 -0
- package/node_modules/yargs/build/lib/completion.d.ts +21 -0
- package/node_modules/yargs/build/lib/completion.js +135 -0
- package/node_modules/yargs/build/lib/is-promise.d.ts +1 -0
- package/node_modules/yargs/build/lib/is-promise.js +9 -0
- package/node_modules/yargs/build/lib/levenshtein.d.ts +1 -0
- package/node_modules/yargs/build/lib/levenshtein.js +58 -0
- package/node_modules/yargs/build/lib/middleware.d.ts +10 -0
- package/node_modules/yargs/build/lib/middleware.js +57 -0
- package/node_modules/yargs/build/lib/obj-filter.d.ts +1 -0
- package/node_modules/yargs/build/lib/obj-filter.js +14 -0
- package/node_modules/yargs/build/lib/parse-command.d.ts +11 -0
- package/node_modules/yargs/build/lib/parse-command.js +36 -0
- package/node_modules/yargs/build/lib/process-argv.d.ts +2 -0
- package/node_modules/yargs/build/lib/process-argv.js +31 -0
- package/node_modules/yargs/build/lib/usage.d.ts +49 -0
- package/node_modules/yargs/build/lib/usage.js +540 -0
- package/node_modules/yargs/build/lib/validation.d.ts +34 -0
- package/node_modules/yargs/build/lib/validation.js +330 -0
- package/node_modules/yargs/build/lib/yargs.d.ts +274 -0
- package/node_modules/yargs/build/lib/yargs.js +1190 -0
- package/node_modules/yargs/build/lib/yerror.d.ts +4 -0
- package/node_modules/yargs/build/lib/yerror.js +11 -0
- package/node_modules/yargs/index.js +40 -0
- package/node_modules/yargs/locales/be.json +46 -0
- package/node_modules/yargs/locales/de.json +46 -0
- package/node_modules/yargs/locales/en.json +51 -0
- package/node_modules/yargs/locales/es.json +46 -0
- package/node_modules/yargs/locales/fi.json +49 -0
- package/node_modules/yargs/locales/fr.json +53 -0
- package/node_modules/yargs/locales/hi.json +49 -0
- package/node_modules/yargs/locales/hu.json +46 -0
- package/node_modules/yargs/locales/id.json +50 -0
- package/node_modules/yargs/locales/it.json +46 -0
- package/node_modules/yargs/locales/ja.json +51 -0
- package/node_modules/yargs/locales/ko.json +49 -0
- package/node_modules/yargs/locales/nb.json +44 -0
- package/node_modules/yargs/locales/nl.json +49 -0
- package/node_modules/yargs/locales/nn.json +44 -0
- package/node_modules/yargs/locales/pirate.json +13 -0
- package/node_modules/yargs/locales/pl.json +49 -0
- package/node_modules/yargs/locales/pt.json +45 -0
- package/node_modules/yargs/locales/pt_BR.json +48 -0
- package/node_modules/yargs/locales/ru.json +46 -0
- package/node_modules/yargs/locales/th.json +46 -0
- package/node_modules/yargs/locales/tr.json +48 -0
- package/node_modules/yargs/locales/zh_CN.json +48 -0
- package/node_modules/yargs/locales/zh_TW.json +47 -0
- package/node_modules/yargs/package.json +92 -0
- package/node_modules/yargs/yargs.js +14 -0
- package/node_modules/yargs-parser/CHANGELOG.md +601 -0
- package/node_modules/yargs-parser/LICENSE.txt +14 -0
- package/node_modules/yargs-parser/README.md +449 -0
- package/node_modules/yargs-parser/index.js +1032 -0
- package/node_modules/yargs-parser/lib/tokenize-arg-string.js +40 -0
- package/node_modules/yargs-parser/package.json +46 -0
- package/package.json +50 -0
- package/tools/postinstall.mjs +9 -0
package/README.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Code Relax Bridge(Windows 私测包)
|
|
2
|
+
|
|
3
|
+
Bridge 让 HarmonyOS 客户端控制 Windows 上的 Codex Desktop。当前要求 Windows x64、Node >=22.12 和已登录的 Codex Desktop;npm 包不包含 Node,也不修改官方程序文件。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
计划发布到 npm 后在线安装;当前命令为发布占位,尚不能从 registry 执行:
|
|
8
|
+
|
|
9
|
+
```powershell
|
|
10
|
+
npm.cmd install -g @walkhi/code-relax@beta
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
首次安装或更新前先保存工作,并从 Codex 菜单或 Windows 托盘完全退出 Codex。npm 全局安装会自动执行 `setup` 和 Skill 安装。`setup` 将完整服务部署到 `%LOCALAPPDATA%\Programs\CodexRemote\service`,记录安装所用 Node 的绝对路径,不复制 Node。配置、日志和二维码以 `installation.json.stateRoot` 为准,通常位于 `%LOCALAPPDATA%\CodexRemote`,MSIX 环境可能解析到包缓存目录;附件位于 `%ProgramData%\CodexRemote\attachments`。
|
|
14
|
+
|
|
15
|
+
`setup` 立即启动 Bridge 和固定 45839 受管 app-server,并启用当前用户登录自启;自启不打开 Codex。受管实例健康后配置当前用户 `CODEX_APP_SERVER_WS_URL`,之后正常启动的 Desktop 自动接入。若安装时 Desktop 仍在运行,不中断现有任务,允许两个 app-server 暂时共存,并在手机提示立即或稍后重启。
|
|
16
|
+
|
|
17
|
+
## 基础控制与完整控制
|
|
18
|
+
|
|
19
|
+
```powershell
|
|
20
|
+
relax shortcuts # 创建完整控制/基础控制两个桌面快捷方式
|
|
21
|
+
relax shared-start # 完整控制、Desktop、Bridge
|
|
22
|
+
relax desktop-start # 基础控制、Desktop、Bridge
|
|
23
|
+
relax start # 启动/复用常驻 Bridge 和已配置中继
|
|
24
|
+
relax pair # 启动/复用服务并打开配对二维码
|
|
25
|
+
relax status
|
|
26
|
+
relax stop
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
基础控制使用普通 Desktop 工具管道。完整控制由官方 `codex app-server --listen ws://127.0.0.1:45839` 提供执行服务,Desktop 和 Bridge 同时连接;它只监听回环地址。Bridge 独立报告 app-server 健康、Desktop 接入和手机可写状态;Desktop 离线时不允许手机发起任务。同一 thread 已被另一个实例持有时,手机只读且可重新检测。
|
|
30
|
+
|
|
31
|
+
手机工作站详情可确认启用完整控制,独立进程逐步执行并保留 Bridge/中继连接,见[启用流程](../docs/shared-recovery.md)。本地 `shared-start` / `desktop-start` 在控制方式不匹配时要求先自行退出 Desktop,不强制结束任务。Bridge 状态匹配且健康时直接复用;未知进程占用 45831/45839 时拒绝接管。`stop` 只停止 Bridge,不停止 Desktop 或完整控制使用的 app-server。
|
|
32
|
+
|
|
33
|
+
完整控制使用的 app-server 通过隐藏控制台启动,使后续控制台子进程继承隐藏窗口。完整控制不等待 Desktop 工具管道:项目、任务列表和新建任务使用 app-server;Bridge 在后台发现工具管道并读取桌面排序、置顶信息,后续列表读取应用这些信息,项目和任务 ID 保持不变。工具通道断开后重新发现,不中断手机聊天;Desktop 页面跳转在通道就绪后可用。
|
|
34
|
+
|
|
35
|
+
基础控制聊天仍依赖 Desktop 工具管道;Bridge 启动不等待管道,后台发现成功后恢复聊天能力。管道缺失或多个候选时保留管理连接并报告执行不可用,不猜测目标。
|
|
36
|
+
|
|
37
|
+
## Code Relax 中继
|
|
38
|
+
|
|
39
|
+
私有中继仍需要本机 Bridge:
|
|
40
|
+
|
|
41
|
+
```powershell
|
|
42
|
+
relax relay-shared-start --json
|
|
43
|
+
relax relay-start --json
|
|
44
|
+
relax relay-status --json
|
|
45
|
+
relax pair --json
|
|
46
|
+
relax relay-stop --json
|
|
47
|
+
relax relay-revoke --json
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
`relay-shared-start` 先准备完整控制和 Bridge,再连接公网私有中继。每台移动设备通过 `pair` 配对一次;新增设备不替换已有设备。连接器把 Windows hostname 和当前 Wi-Fi/有线网络候选经已认证 WebSocket 临时发送给手机,手机本地保存电脑名,只在设备身份验证通过后保存可达地址;服务器不持久化这些 Code Relax 中继 hostname、IP 或网络名。OpenAI 官方认证和设备配对仍直接访问 OpenAI;完成后,手机使用统一配对产生的设备凭据,通过独立元数据 WebSocket 把官方环境 ID、名称和 hostname 写入设备记录,不上传 OpenAI access token、配对码或登录态。停止连接器不撤销授权。
|
|
51
|
+
|
|
52
|
+
## Bridge 调试页面
|
|
53
|
+
|
|
54
|
+
```powershell
|
|
55
|
+
relax dev --json
|
|
56
|
+
relax dev-status --json
|
|
57
|
+
relax dev-stop --json
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
调试页面与 Bridge 共用进程和端口(默认 45831),只额外提供白名单静态资源,用于基础控制和完整控制的局域网页面调试。`dev-stop` 只关闭静态页面,不影响 Bridge WebSocket。Code Relax 中继和 OpenAI 中继均使用 HAP 内置页面。
|
|
61
|
+
|
|
62
|
+
## 更新与卸载
|
|
63
|
+
|
|
64
|
+
更新固定服务:
|
|
65
|
+
|
|
66
|
+
```powershell
|
|
67
|
+
npm.cmd install -g @walkhi/code-relax@beta
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
`setup` 先暂存并校验新版本,再短暂停止 Bridge/中继完成切换;原服务此前正在运行时会自动恢复,新版本启动失败则回滚并启动旧版本。无需提前执行 `stop`。Node 路径变化或原 Node 被删除后需重新 setup。升级可能因 Node 可执行文件路径变化而再次触发 Windows 防火墙授权。
|
|
71
|
+
|
|
72
|
+
卸载:
|
|
73
|
+
|
|
74
|
+
```powershell
|
|
75
|
+
relax uninstall
|
|
76
|
+
npm uninstall -g @walkhi/code-relax
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
`uninstall` 停止 Bridge 后先核对并清理 Code Relax 所有的当前用户 `CODEX_APP_SERVER_WS_URL`;用户后来修改或不归属 Code Relax 的值会保留。随后删除固定程序和本包管理且未修改的 Skill;保留其他配置、Token、日志、长期设备凭据、附件和自定义 Skill。它不卸载 Node、Codex Desktop,也不强制结束完整控制的执行进程。
|
|
80
|
+
|
|
81
|
+
## 发布边界
|
|
82
|
+
|
|
83
|
+
包名为 `@walkhi/code-relax@0.1.0-beta.1`,主 CLI 为 `relax`,并保留 `code-relax` 兼容入口。首次公开 beta 发布前仍需确认 npm scope 所有权、第三方许可、新电脑首次安装、防火墙、升级/卸载和移动端到端验收。详细规则见 [npm 分发](../docs/npm-distribution.md)。
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { phonePairingSteps, desktopSetupSteps, pairingDisplayText } from '../src/onboarding.mjs';
|
|
3
|
+
import { lifecycle, readRecord } from '../src/service-lifecycle.mjs';
|
|
4
|
+
import { runtimePaths } from '../src/platform/windows/runtime-paths.mjs';
|
|
5
|
+
import * as host from '../src/platform/windows/service-host.mjs';
|
|
6
|
+
import { installService, uninstallService, packageRoot } from '../src/service-install.mjs';
|
|
7
|
+
import { installSkill, removeSkill, inspectSkill } from '../src/skill-install.mjs';
|
|
8
|
+
import { doctor } from '../src/service-doctor.mjs';
|
|
9
|
+
import { launchDesktop } from '../src/desktop-launcher.mjs';
|
|
10
|
+
import { desktopHost, desktopShortcuts, residentStartup, resolveStateRoot } from '../src/platform/windows/desktop-host.mjs';
|
|
11
|
+
import { debugUi } from '../src/debug-ui.mjs';
|
|
12
|
+
import { selfRelay } from '../src/self-relay/lifecycle.mjs';
|
|
13
|
+
import { fileURLToPath } from 'node:url';
|
|
14
|
+
import path from 'node:path';
|
|
15
|
+
import fs from 'node:fs';
|
|
16
|
+
import { spawn } from 'node:child_process';
|
|
17
|
+
import { setTimeout as delay } from 'node:timers/promises';
|
|
18
|
+
import { requestRecovery, recoveryStatus, recoveryWarning } from '../src/shared-recovery.mjs';
|
|
19
|
+
import { configureManagedEnvironment, clearManagedEnvironment } from '../src/platform/windows/user-environment.mjs';
|
|
20
|
+
|
|
21
|
+
const help = `Code Relax(Windows)
|
|
22
|
+
用法:relax <setup|doctor|skill-install|skill-remove|uninstall|start|shared-start|desktop-start|shortcuts|pair|status|stop> [--json]
|
|
23
|
+
setup 部署并启动固定目录服务、受管 app-server 和登录自启动;安全配置 Desktop 后续接入
|
|
24
|
+
start 启动或复用 Bridge,并恢复已配置的私有中继
|
|
25
|
+
shared-start 启动或复用完整控制,再启动 Bridge 和已配置的私有中继
|
|
26
|
+
shared-recover --confirm 启用或重新启动完整控制,保留 Bridge 和中继,可能中断当前任务
|
|
27
|
+
shared-recovery-status 查看最近一次恢复的实际阶段和结果
|
|
28
|
+
autostart-enable / autostart-disable / autostart-status 管理当前用户登录时启动 Bridge
|
|
29
|
+
desktop-start 恢复基础控制,再启动 Bridge(切换前须自行退出 Desktop)
|
|
30
|
+
shortcuts 创建完整控制/基础控制桌面快捷方式
|
|
31
|
+
pair 启动或复用工作站服务,并打开一次性配对二维码
|
|
32
|
+
status 查看服务健康状态
|
|
33
|
+
stop 停止服务
|
|
34
|
+
dev 在 Bridge 端口开启调试页面(实时读取当前源码/包资源)
|
|
35
|
+
dev-status 查看 Bridge 调试页面状态
|
|
36
|
+
dev-stop 关闭调试页面,不停止 Bridge
|
|
37
|
+
relay-start 启动或复用私有中继,已有授权直接恢复,首次授权生成二维码
|
|
38
|
+
relay-shared-start 启动完整控制和 Bridge 后连接私有中继(需先退出当前 Codex)
|
|
39
|
+
relay-status 查看私有中继连接器及手机连接状态
|
|
40
|
+
relay-stop 停止私有中继连接器,不停止 Bridge 或 Codex
|
|
41
|
+
relay-revoke 撤销这台电脑的全部移动设备授权(停止连接器不会撤销授权)
|
|
42
|
+
doctor 检查安装、Node、Desktop、网络和 Skill,提示防火墙处理方式
|
|
43
|
+
skill-install 安装/更新当前用户的 Codex Skill,不覆盖自定义文件
|
|
44
|
+
skill-remove 移除本包安装且未修改的 Skill
|
|
45
|
+
uninstall 停止并移除固定目录服务和本包 Skill,清理自有 Desktop 环境变量,保留其他配置与附件
|
|
46
|
+
默认监听 0.0.0.0,手机与电脑需在同一受信任局域网。
|
|
47
|
+
--json 输出机器可读结果;统一二维码不含 LAN 地址、Bridge Token 或中继地址。`;
|
|
48
|
+
|
|
49
|
+
async function main() {
|
|
50
|
+
const [command, ...flags] = process.argv.slice(2);
|
|
51
|
+
if (!command || command === '--help' || command === '-h') {
|
|
52
|
+
console.log(help);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (!['autostart-enable', 'autostart-disable', 'autostart-status', 'shared-recover', 'shared-recovery-status', 'relay-shared-start', 'relay-revoke', 'relay-start', 'relay-status', 'relay-stop', 'dev', 'dev-status', 'dev-stop', 'setup', 'doctor', 'skill-install', 'skill-remove', 'uninstall', 'shared-start', 'desktop-start', 'shortcuts', 'start', 'pair', 'status', 'stop'].includes(command)
|
|
56
|
+
|| flags.some(flag => flag !== '--json' && !(command === 'shared-recover' && flag === '--confirm'))) {
|
|
57
|
+
throw new Error('无效命令或参数。使用 --help 查看用法。');
|
|
58
|
+
}
|
|
59
|
+
if (process.platform !== 'win32') throw new Error('当前被控端仅支持 Windows。');
|
|
60
|
+
const json = flags.includes('--json');
|
|
61
|
+
const paths = runtimePaths();
|
|
62
|
+
const { stateRoot, serviceRoot } = paths;
|
|
63
|
+
if (['relay-shared-start', 'relay-revoke', 'relay-start', 'relay-status', 'relay-stop'].includes(command)) {
|
|
64
|
+
if (command === 'relay-shared-start') {
|
|
65
|
+
const existing = await selfRelay('relay-status', stateRoot);
|
|
66
|
+
if (existing.running && existing.transportMode !== 'lan-shared') throw new Error('基础控制的中继连接器仍在运行,请先执行 relay-stop;不会自动中断手机连接。');
|
|
67
|
+
const result = await new Promise((resolve, reject) => {
|
|
68
|
+
const child = spawn(process.execPath, [fileURLToPath(import.meta.url), 'shared-start', '--json'], { windowsHide: true, stdio: ['ignore', 'pipe', 'pipe'] });
|
|
69
|
+
let output = '', errors = '';
|
|
70
|
+
child.stdout.on('data', chunk => { output += chunk; }); child.stderr.on('data', chunk => { errors += chunk; });
|
|
71
|
+
child.once('error', reject);
|
|
72
|
+
child.once('exit', code => { if (code) reject(new Error(errors.trim().replace(/^(?:Code Relax:)+/u, '') || '完整控制启动失败')); else { try { resolve(JSON.parse(output)); } catch { reject(new Error('完整控制启动结果无法确认,未启动中继')); } } });
|
|
73
|
+
});
|
|
74
|
+
if (!result.bridgeReady) { console.log(json ? JSON.stringify(result) : result.displayText); return; }
|
|
75
|
+
}
|
|
76
|
+
const result = await selfRelay(command === 'relay-shared-start' ? 'relay-start' : command, stateRoot, command === 'relay-shared-start' ? 'lan-shared' : '');
|
|
77
|
+
console.log(json ? JSON.stringify(result) : `${result.displayText}${result.qrPath ? '\n二维码:' + result.qrPath : ''}`);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if (['dev', 'dev-status', 'dev-stop'].includes(command)) {
|
|
81
|
+
const result = await debugUi(command, stateRoot);
|
|
82
|
+
console.log(json ? JSON.stringify(result) : result.message || JSON.stringify(result));
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const installedEntry = path.join(serviceRoot, 'dist/bin/codex-remote.mjs');
|
|
86
|
+
if (['autostart-enable', 'autostart-disable', 'autostart-status', 'shared-recover', 'shared-recovery-status', 'shared-start', 'desktop-start', 'shortcuts', 'start', 'pair', 'status', 'stop'].includes(command) && path.resolve(fileURLToPath(import.meta.url)).toLowerCase() !== installedEntry.toLowerCase()) {
|
|
87
|
+
if (!fs.existsSync(installedEntry)) throw new Error('尚未部署服务,请先执行 relax setup。');
|
|
88
|
+
const executable = readRecord(path.join(serviceRoot, 'installation.json'))?.nodeExecutable;
|
|
89
|
+
if (!executable || !fs.existsSync(executable)) throw new Error('安装时选用的 Node 不存在,请重新执行 relax setup。');
|
|
90
|
+
const child = spawn(executable, [installedEntry, command, ...flags], { stdio: 'inherit', windowsHide: true });
|
|
91
|
+
const code = await new Promise((resolve, reject) => { child.once('error', reject); child.once('exit', resolve); });
|
|
92
|
+
process.exitCode = code ?? 1;
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
host.migrateState(stateRoot);
|
|
96
|
+
const service = lifecycle({ stateRoot, host });
|
|
97
|
+
if (command.startsWith('autostart-')) {
|
|
98
|
+
const installation = readRecord(path.join(serviceRoot, 'installation.json'));
|
|
99
|
+
if (!installation?.nodeExecutable) throw new Error('请先执行 setup。');
|
|
100
|
+
const result = await residentStartup({ serviceRoot, nodeExecutable: installation.nodeExecutable }, command.slice('autostart-'.length));
|
|
101
|
+
console.log(json ? JSON.stringify(result) : `登录启动:${result.enabled ? '已启用' : '已关闭'}`); return;
|
|
102
|
+
}
|
|
103
|
+
if (command === 'shared-recover' || command === 'shared-recovery-status') {
|
|
104
|
+
if (command === 'shared-recover' && !flags.includes('--confirm')) throw new Error(recoveryWarning + ' 使用 --confirm 确认。');
|
|
105
|
+
const result = command === 'shared-recover'
|
|
106
|
+
? await requestRecovery(stateRoot, { confirmed: true }) : await recoveryStatus(stateRoot);
|
|
107
|
+
console.log(json ? JSON.stringify(result) : `${result.message || result.status}${result.error ? '\n' + result.error : ''}\n${result.operationId || ''}`.trim());
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
if (command === 'pair') {
|
|
111
|
+
let bridge = await service.status();
|
|
112
|
+
if (!bridge.running) {
|
|
113
|
+
await service.start();
|
|
114
|
+
bridge = await service.status();
|
|
115
|
+
}
|
|
116
|
+
if (!bridge.running) throw new Error('Code Relax 工作站服务未能启动。');
|
|
117
|
+
const result = await selfRelay('relay-pair', stateRoot);
|
|
118
|
+
if (!json && result.qrPath) {
|
|
119
|
+
const viewer = spawn('explorer.exe', [result.qrPath], { detached: true, stdio: 'ignore', windowsHide: true });
|
|
120
|
+
viewer.unref();
|
|
121
|
+
}
|
|
122
|
+
console.log(json ? JSON.stringify(result) : `${result.displayText}\n二维码:${result.qrPath}`);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
if (command === 'shortcuts') {
|
|
126
|
+
const installation = readRecord(path.join(serviceRoot, 'installation.json'));
|
|
127
|
+
if (!installation?.nodeExecutable) throw new Error('请先执行 relax setup。');
|
|
128
|
+
const shortcuts = await desktopShortcuts({ serviceRoot, nodeExecutable: installation.nodeExecutable });
|
|
129
|
+
console.log(json ? JSON.stringify({ shortcuts }) : `桌面快捷方式已创建:\n${shortcuts.join('\n')}`);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (command === 'doctor') {
|
|
133
|
+
const result = await doctor({ paths, host, service });
|
|
134
|
+
console.log(json ? JSON.stringify(result) : result.checks.map(item => `[${item.status}] ${item.message}`).join('\n'));
|
|
135
|
+
if (!result.ready) process.exitCode = 1;
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
if (command === 'skill-install' || command === 'skill-remove') {
|
|
139
|
+
const result = command === 'skill-install'
|
|
140
|
+
? installSkill(path.join(packageRoot(path.dirname(fileURLToPath(import.meta.url))), 'dist/skills/code-relax/SKILL.md'))
|
|
141
|
+
: removeSkill();
|
|
142
|
+
console.log(json ? JSON.stringify(result) : `${result.message}\n${result.target}`);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
if (command === 'uninstall') {
|
|
146
|
+
const skill = inspectSkill();
|
|
147
|
+
let environment;
|
|
148
|
+
const result = await uninstallService(paths, service, async () => {
|
|
149
|
+
environment = await clearManagedEnvironment(stateRoot);
|
|
150
|
+
const installation = readRecord(path.join(serviceRoot, 'installation.json'));
|
|
151
|
+
if (installation?.nodeExecutable) await desktopShortcuts({ serviceRoot, nodeExecutable: installation.nodeExecutable }, true);
|
|
152
|
+
if (installation?.nodeExecutable) await residentStartup({ serviceRoot, nodeExecutable: installation.nodeExecutable }, 'disable');
|
|
153
|
+
});
|
|
154
|
+
result.environment = environment;
|
|
155
|
+
result.skill = skill.managed ? removeSkill() : { removed: false, message: '未移除自定义或未安装的 Skill。' };
|
|
156
|
+
result.message = environment?.preserved
|
|
157
|
+
? '固定目录服务已卸载;检测到用户自定义的 CODEX_APP_SERVER_WS_URL,已保留。配置、附件也已保留。npm 命令入口可再用 npm uninstall -g @walkhi/code-relax 移除。'
|
|
158
|
+
: '固定目录服务已卸载;Code Relax 设置的 app-server 环境变量已清理,其他配置和附件已保留。npm 命令入口可再用 npm uninstall -g @walkhi/code-relax 移除。';
|
|
159
|
+
console.log(json ? JSON.stringify(result) : `${result.message}\n${result.skill.message}`);
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
if (command === 'setup') {
|
|
163
|
+
const [major, minor] = process.versions.node.split('.').map(Number);
|
|
164
|
+
if (major < 22 || (major === 22 && minor < 12)) throw new Error('需要 Node >=22.12。');
|
|
165
|
+
const physicalStateRoot = await resolveStateRoot(stateRoot);
|
|
166
|
+
// Preserve the effective package view; never replace a newer file already in it.
|
|
167
|
+
for (const name of ['bridge-config.json', 'bridge-session.json', 'bridge-startup-context.json', 'execution-mode.json',
|
|
168
|
+
'self-relay-config.json', 'self-relay-session.json', 'lan-device-authorizations.json', 'shared-desktop.json',
|
|
169
|
+
'managed-app-server.json', 'managed-environment.json', 'shared-recovery.json', 'shared-recovery.lock', 'debug-ui-session.json']) {
|
|
170
|
+
const source = path.join(stateRoot, name), target = path.join(physicalStateRoot, name);
|
|
171
|
+
if (fs.existsSync(source) && !fs.existsSync(target)) fs.copyFileSync(source, target, fs.constants.COPYFILE_EXCL);
|
|
172
|
+
}
|
|
173
|
+
const previous = fs.existsSync(serviceRoot) ? await service.status() : { processRunning: false };
|
|
174
|
+
const previousRelay = await selfRelay('relay-status', stateRoot);
|
|
175
|
+
const resumeAfterUpdate = previous.processRunning || previousRelay.running;
|
|
176
|
+
const executable = fs.realpathSync(process.execPath);
|
|
177
|
+
const startInstalled = async () => {
|
|
178
|
+
const entry = path.join(serviceRoot, 'dist/bin/codex-remote.mjs');
|
|
179
|
+
const child = spawn(executable, [entry, 'start', '--json'], { windowsHide: true, stdio: ['ignore', 'ignore', 'pipe'] });
|
|
180
|
+
let errors = '';
|
|
181
|
+
child.stderr.on('data', chunk => { errors += chunk; });
|
|
182
|
+
const code = await new Promise((resolve, reject) => { child.once('error', reject); child.once('exit', resolve); });
|
|
183
|
+
if (code) {
|
|
184
|
+
try { await selfRelay('relay-stop', stateRoot); } catch {}
|
|
185
|
+
try { await service.stop(); } catch {}
|
|
186
|
+
throw new Error(errors.trim().replace(/^(?:Code Relax:)+/u, '') || 'Bridge 启动失败');
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
let stoppedForUpdate = false;
|
|
190
|
+
const installed = await installService(packageRoot(path.dirname(fileURLToPath(import.meta.url))), serviceRoot, executable, physicalStateRoot, {
|
|
191
|
+
beforeActivate: async () => {
|
|
192
|
+
stoppedForUpdate = resumeAfterUpdate;
|
|
193
|
+
if (previousRelay.running) await selfRelay('relay-stop', stateRoot);
|
|
194
|
+
if (previous.processRunning) await service.stop();
|
|
195
|
+
},
|
|
196
|
+
verifyActivation: async () => { await startInstalled(); },
|
|
197
|
+
restoreActivation: async () => { if (stoppedForUpdate) await startInstalled(); },
|
|
198
|
+
});
|
|
199
|
+
const deadline = Date.now() + 35_000;
|
|
200
|
+
let bridge = await service.status();
|
|
201
|
+
while (bridge.running && !['ready', 'failed'].includes(bridge.managedAppServer?.state) && Date.now() < deadline) {
|
|
202
|
+
await delay(250);
|
|
203
|
+
bridge = await service.status();
|
|
204
|
+
}
|
|
205
|
+
if (!bridge.running || bridge.managedAppServer?.state !== 'ready') {
|
|
206
|
+
throw new Error(bridge.managedAppServer?.error || 'Bridge 已安装,但受管 app-server 未就绪;未写入 Desktop 环境变量。');
|
|
207
|
+
}
|
|
208
|
+
const autostart = await residentStartup(installed, 'enable');
|
|
209
|
+
const environment = await configureManagedEnvironment(physicalStateRoot);
|
|
210
|
+
installed.autostart = autostart;
|
|
211
|
+
installed.restarted = resumeAfterUpdate;
|
|
212
|
+
installed.environment = environment;
|
|
213
|
+
installed.managedAppServer = bridge.managedAppServer;
|
|
214
|
+
installed.desktop = bridge.desktop;
|
|
215
|
+
installed.desktopRestartRecommended = bridge.desktop?.state === 'ordinary';
|
|
216
|
+
const restartText = installed.desktopRestartRecommended
|
|
217
|
+
? 'Codex 当前仍在使用原连接。可以在手机端选择“立即重启(推荐)”,或稍后自行完全退出再启动。'
|
|
218
|
+
: '下次正常启动 Codex 时会连接受管 app-server。';
|
|
219
|
+
console.log(json ? JSON.stringify({ ...installed, nextSteps: desktopSetupSteps, displayText: `${desktopSetupSteps.join('\n')}\n${restartText}` }) : `服务已安装:${installed.serviceRoot}\n使用已安装的 Node:${installed.nodeExecutable}\n受管 app-server 已就绪;首次联网可能需要 Windows 防火墙授权。\n${desktopSetupSteps.join('\n')}\n${restartText}`);
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
if (command === 'stop') {
|
|
223
|
+
const result = await service.stop();
|
|
224
|
+
console.log(json ? JSON.stringify(result) : result.message);
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
let desktop;
|
|
228
|
+
if (command === 'shared-start' || command === 'desktop-start') {
|
|
229
|
+
if (!json) console.log('正在检查 Codex 的启动模式…');
|
|
230
|
+
desktop = await launchDesktop(command === 'shared-start' ? 'shared' : 'ordinary', { stateRoot, host: desktopHost });
|
|
231
|
+
delete process.env.CODEX_APP_TOOLS_PIPE_PATH;
|
|
232
|
+
}
|
|
233
|
+
if (!json && (desktop || command === 'start')) console.log('正在检查电脑连接并准备 Bridge…');
|
|
234
|
+
const result = await service[desktop ? 'start' : command]();
|
|
235
|
+
if (command === 'status') {
|
|
236
|
+
console.log(json ? JSON.stringify(result) : result.running
|
|
237
|
+
? `服务正常:${result.mode},端口 ${result.port},PID ${result.pid}` : '服务未就绪。');
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
const { accessUrl, qrPath: _legacyQrPath, ...metadata } = result;
|
|
241
|
+
const notice = '本机服务检查通过,手机连通性尚未验证。若电脑弹出 Node 网络访问提示,请先处理 Windows 防火墙授权,再用手机连接。';
|
|
242
|
+
let relay;
|
|
243
|
+
if (fs.existsSync(path.join(stateRoot, 'self-relay-config.json'))) relay = await selfRelay('relay-start', stateRoot);
|
|
244
|
+
const nextSteps = phonePairingSteps(metadata.transportMode, relay?.paired === true);
|
|
245
|
+
const displayText = pairingDisplayText(nextSteps, notice);
|
|
246
|
+
const output = { ...metadata, ...(desktop ? { desktop, bridgeReady: true } : {}), ...(relay ? { relayConnected: relay.relayConnected,
|
|
247
|
+
paired: relay.paired, clientCount: relay.clientCount, ...(relay.qrPath ? { qrPath: relay.qrPath, expiresAt: relay.expiresAt } : {}) } : {}),
|
|
248
|
+
nextSteps, displayText, mode: 'lan', listenAddress: '0.0.0.0', address: new URL(accessUrl).host,
|
|
249
|
+
lanAccess: 'unverified', notice };
|
|
250
|
+
if (json) console.log(JSON.stringify(output));
|
|
251
|
+
else {
|
|
252
|
+
console.log('电脑连接检查通过 · Bridge 已就绪');
|
|
253
|
+
console.log(`局域网模式:监听 0.0.0.0:${result.port},连接地址 ${output.address},PID ${result.pid}`);
|
|
254
|
+
if (relay?.qrPath) console.log(`配对二维码:${relay.qrPath}`);
|
|
255
|
+
console.log(displayText);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
main().catch(error => {
|
|
260
|
+
console.error(`Code Relax:${error.message}`);
|
|
261
|
+
process.exitCode = 1;
|
|
262
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { startRelayDemo } from '../src/self-relay/demo.mjs';
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
import { spawnSync } from 'node:child_process';
|
|
5
|
+
|
|
6
|
+
const mode = process.argv.includes('--legacy') ? 'lan-legacy' : 'lan-shared';
|
|
7
|
+
let remoteRelay;
|
|
8
|
+
if (process.env.RELAY_URL) {
|
|
9
|
+
let hostKey;
|
|
10
|
+
const sshIndex = process.argv.indexOf('--ssh-host');
|
|
11
|
+
if (sshIndex !== -1) {
|
|
12
|
+
const host = process.argv[sshIndex + 1];
|
|
13
|
+
if (!/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/.test(host || '')) throw new Error('Invalid SSH alias');
|
|
14
|
+
const result = spawnSync('ssh', ['-o', 'BatchMode=yes', '-o', 'ConnectTimeout=10', host,
|
|
15
|
+
'sudo -n cat /etc/codex-relay/host.key'], { encoding: 'utf8', timeout: 15000, windowsHide: true });
|
|
16
|
+
if (result.error || result.status !== 0) throw new Error('Cannot read relay credential through SSH');
|
|
17
|
+
hostKey = result.stdout.trim();
|
|
18
|
+
} else hostKey = fs.readFileSync(process.env.RELAY_HOST_KEY_FILE, 'utf8').trim();
|
|
19
|
+
remoteRelay = { url: process.env.RELAY_URL, hostKey };
|
|
20
|
+
}
|
|
21
|
+
const demo = await startRelayDemo({ mode, remoteRelay });
|
|
22
|
+
let client;
|
|
23
|
+
try {
|
|
24
|
+
client = demo.connect(); await client.ready;
|
|
25
|
+
const health = await client.request('/api/health');
|
|
26
|
+
if (health.status !== 200 || health.body.transportMode !== mode) throw new Error('Relay validation failed');
|
|
27
|
+
console.log(JSON.stringify({ ok: true, simulated: true, mode, relay: demo.relay.url,
|
|
28
|
+
bridge: demo.bridgeUrl, message: '中继 → 连接器 → 模拟 Bridge 已连通;未连接 Codex,未执行任务。' }, null, 2));
|
|
29
|
+
if (!process.argv.includes('--check')) {
|
|
30
|
+
console.log('验证连接保持运行。Ctrl+C 停止全部模拟进程内服务。');
|
|
31
|
+
await new Promise(resolve => { process.once('SIGINT', resolve); process.once('SIGTERM', resolve); });
|
|
32
|
+
}
|
|
33
|
+
} finally { client?.close(); await demo.close(); }
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import { deviceStore, validId } from '../src/self-relay/device-store.mjs';
|
|
4
|
+
import { startSelfRelay } from '../src/self-relay/server.mjs';
|
|
5
|
+
import { updateDebugAllowlist } from '../src/self-relay/debug-allowlist.mjs';
|
|
6
|
+
|
|
7
|
+
const keyFile = process.env.RELAY_HOST_KEY_FILE;
|
|
8
|
+
if (!keyFile) throw new Error('RELAY_HOST_KEY_FILE is required');
|
|
9
|
+
const hostKey = fs.readFileSync(keyFile, 'utf8').trim();
|
|
10
|
+
const port = Number(process.env.RELAY_PORT || 45850);
|
|
11
|
+
if (!Number.isInteger(port) || port < 1024 || port > 65535) throw new Error('Invalid RELAY_PORT');
|
|
12
|
+
const stateFile = process.env.RELAY_STATE_FILE;
|
|
13
|
+
if (!stateFile) throw new Error('RELAY_STATE_FILE is required');
|
|
14
|
+
const debugAllowlistFile = process.env.RELAY_DEBUG_ALLOWLIST_FILE || '/etc/codex-relay/debug-allowlist.json';
|
|
15
|
+
const debugCommand = process.argv.find(value => ['--debug-list', '--debug-allow', '--debug-deny'].includes(value));
|
|
16
|
+
if (debugCommand) {
|
|
17
|
+
const records = deviceStore(stateFile).entries();
|
|
18
|
+
if (debugCommand === '--debug-list') {
|
|
19
|
+
console.log(JSON.stringify(records.map(record => ({
|
|
20
|
+
deviceId: record.id, status: record.status, clientCount: record.clients.length,
|
|
21
|
+
})), null, 2));
|
|
22
|
+
} else {
|
|
23
|
+
const index = process.argv.indexOf(debugCommand), deviceId = process.argv[index + 1];
|
|
24
|
+
if (!validId(deviceId)) throw new Error('Invalid device ID');
|
|
25
|
+
const record = records.find(record => record.id === deviceId && record.status === 'active');
|
|
26
|
+
if (!record && debugCommand === '--debug-allow') throw new Error('Active paired device not found');
|
|
27
|
+
updateDebugAllowlist(debugAllowlistFile, deviceId, debugCommand === '--debug-allow');
|
|
28
|
+
console.log('Debug allowlist updated; restart relay to apply.');
|
|
29
|
+
}
|
|
30
|
+
process.exit(0);
|
|
31
|
+
}
|
|
32
|
+
if (process.argv.includes('--init-state')) { deviceStore(stateFile, { initialize: true }); console.log('Device store initialized'); process.exit(0); }
|
|
33
|
+
const revokeIndex = process.argv.indexOf('--revoke-host');
|
|
34
|
+
if (revokeIndex >= 0) {
|
|
35
|
+
// Run only with the service stopped: this is an offline administrator operation.
|
|
36
|
+
if (!process.argv.includes('--offline')) throw new Error('Stop the relay service and supply --offline');
|
|
37
|
+
const id = process.argv[revokeIndex + 1];
|
|
38
|
+
if (!validId(id)) throw new Error('Invalid device ID');
|
|
39
|
+
const store = deviceStore(stateFile), record = store.entries().find(item => item.id === id);
|
|
40
|
+
if (!record) throw new Error('Device not found');
|
|
41
|
+
store.save({ ...record, status: 'revoked', clientHash: undefined, clientId: undefined, revision: record.revision + 1, updatedAt: new Date().toISOString() });
|
|
42
|
+
console.log('Computer and phone authorization revoked'); process.exit(0);
|
|
43
|
+
}
|
|
44
|
+
const relay = await startSelfRelay({ port, hostKey, stateFile, debugAllowlistFile,
|
|
45
|
+
publicRelayUrl: process.env.RELAY_PUBLIC_URL || '', appDownloadUrl: process.env.RELAY_APP_DOWNLOAD_URL || '',
|
|
46
|
+
log: entry => console.log(JSON.stringify({ time: new Date().toISOString(), ...entry })) });
|
|
47
|
+
console.log(JSON.stringify({ service: 'codex-self-relay', listen: relay.url, maxConnections: 32,
|
|
48
|
+
maxFrameMiB: 8, encryption: 'TLS must be supplied by reverse proxy; no end-to-end encryption' }));
|
|
49
|
+
await new Promise(resolve => { process.once('SIGTERM', resolve); process.once('SIGINT', resolve); });
|
|
50
|
+
await relay.close();
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
[Console]::OutputEncoding = New-Object System.Text.UTF8Encoding($false)
|
|
2
|
+
|
|
3
|
+
$profiles = @{}
|
|
4
|
+
Get-NetConnectionProfile -ErrorAction SilentlyContinue | ForEach-Object {
|
|
5
|
+
$profiles[[int]$_.InterfaceIndex] = [string]$_.Name
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
$networks = [System.Net.NetworkInformation.NetworkInterface]::GetAllNetworkInterfaces() |
|
|
9
|
+
Where-Object {
|
|
10
|
+
$_.OperationalStatus -eq 'Up' -and
|
|
11
|
+
$_.NetworkInterfaceType -in @('Wireless80211', 'Ethernet') -and
|
|
12
|
+
$_.GetIPProperties().GatewayAddresses.Count -gt 0
|
|
13
|
+
} | ForEach-Object {
|
|
14
|
+
$adapter = $_
|
|
15
|
+
$properties = $adapter.GetIPProperties()
|
|
16
|
+
$interfaceIndex = $properties.GetIPv4Properties().Index
|
|
17
|
+
$networkType = if ($adapter.NetworkInterfaceType -eq 'Wireless80211') { 'wifi' } else { 'ethernet' }
|
|
18
|
+
$networkName = $profiles[$interfaceIndex]
|
|
19
|
+
if ($networkType -eq 'wifi') {
|
|
20
|
+
$wlan = (& netsh wlan show interfaces interface="$($adapter.Name)" 2>$null) -join "`n"
|
|
21
|
+
$ssid = [regex]::Match($wlan, '(?m)^\s*SSID\s*:\s*(.*?)\s*$')
|
|
22
|
+
if ($ssid.Success -and -not [string]::IsNullOrWhiteSpace($ssid.Groups[1].Value)) {
|
|
23
|
+
$networkName = $ssid.Groups[1].Value.Trim()
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if ([string]::IsNullOrWhiteSpace($networkName)) { $networkName = $adapter.Name }
|
|
27
|
+
$properties.UnicastAddresses | Where-Object {
|
|
28
|
+
$_.Address.AddressFamily -eq 'InterNetwork' -and
|
|
29
|
+
$_.Address.IPAddressToString -match '^(192\.168\.|10\.|172\.(1[6-9]|2[0-9]|3[01])\.|100\.(6[4-9]|[7-9][0-9]|1[01][0-9]|12[0-7])\.)'
|
|
30
|
+
} | ForEach-Object {
|
|
31
|
+
[PSCustomObject]@{
|
|
32
|
+
address = $_.Address.IPAddressToString
|
|
33
|
+
networkType = $networkType
|
|
34
|
+
networkName = $networkName
|
|
35
|
+
interfaceName = [string]$adapter.Name
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
ConvertTo-Json -InputObject @($networks) -Compress
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Detect the Desktop connection, not merely a listening standalone server.
|
|
2
|
+
$connections = @(Get-NetTCPConnection -RemotePort 45839 -State Established -ErrorAction SilentlyContinue | Where-Object {
|
|
3
|
+
$_.RemoteAddress -eq '127.0.0.1' -and
|
|
4
|
+
(Get-Process -Id $_.OwningProcess -ErrorAction SilentlyContinue).ProcessName -eq 'ChatGPT'
|
|
5
|
+
})
|
|
6
|
+
if ($connections.Count) { 'ws://127.0.0.1:45839' }
|