@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
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { findDesktopPipe } from './desktop-tools.mjs';
|
|
2
|
+
|
|
3
|
+
// Optional Desktop presentation data never blocks the shared execution service.
|
|
4
|
+
export class DesktopMonitor {
|
|
5
|
+
constructor({ discover = () => findDesktopPipe({ allowMissing: true }), read, report = console.error }) {
|
|
6
|
+
this.discover = discover; this.read = read; this.report = report;
|
|
7
|
+
this.pipe = null; this.snapshot = null; this.stopped = true;
|
|
8
|
+
}
|
|
9
|
+
start() { this.stopped = false; void this.tick(); }
|
|
10
|
+
stop() { this.stopped = true; clearTimeout(this.timer); }
|
|
11
|
+
async refresh() {
|
|
12
|
+
try {
|
|
13
|
+
const pipe = await this.discover();
|
|
14
|
+
if (this.stopped) return;
|
|
15
|
+
this.pipe = pipe;
|
|
16
|
+
if (!pipe) { this.snapshot = null; return; }
|
|
17
|
+
const [listing, projects] = await Promise.all([
|
|
18
|
+
this.read('list_threads', { limit: 50 }, pipe), this.read('list_projects', {}, pipe),
|
|
19
|
+
]);
|
|
20
|
+
if (this.stopped) return;
|
|
21
|
+
if (!listing.success || !projects.success) throw new Error('Desktop 列表读取失败');
|
|
22
|
+
this.snapshot = { listing: listing.data, projects: projects.data.projects || [] };
|
|
23
|
+
this.error = null;
|
|
24
|
+
} catch (error) {
|
|
25
|
+
this.pipe = null; this.snapshot = null;
|
|
26
|
+
if (this.error !== error.message) this.report(`Desktop 排序暂不可用:${error.message}`);
|
|
27
|
+
this.error = error.message;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
async tick() {
|
|
31
|
+
await this.refresh();
|
|
32
|
+
if (!this.stopped) { this.timer = setTimeout(() => this.tick(), this.pipe ? 10000 : 2000); this.timer.unref(); }
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
param([string]$NodePath, [string]$Entry, [ValidateSet('shared-start','desktop-start')][string]$Action)
|
|
2
|
+
$ErrorActionPreference = 'Stop'
|
|
3
|
+
[Console]::OutputEncoding = New-Object System.Text.UTF8Encoding($false)
|
|
4
|
+
& $NodePath $Entry $Action
|
|
5
|
+
if ($LASTEXITCODE -ne 0) { Write-Host '启动未完成,请根据上方提示处理后重试。' }
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
param([string]$NodePath, [string]$Entry, [switch]$Remove, [string]$Destination)
|
|
2
|
+
$ErrorActionPreference = 'Stop'
|
|
3
|
+
[Console]::OutputEncoding = New-Object System.Text.UTF8Encoding($false)
|
|
4
|
+
$shell = New-Object -ComObject WScript.Shell
|
|
5
|
+
if (-not $Destination) { $Destination = $shell.SpecialFolders.Item('Desktop') }
|
|
6
|
+
$launcher = Join-Path $PSScriptRoot 'desktop-shortcut-run.ps1'
|
|
7
|
+
$items = @(@{Name='Code Relax - 完整控制'; Command='shared-start'}, @{Name='Code Relax - 基础控制'; Command='desktop-start'})
|
|
8
|
+
$results = @()
|
|
9
|
+
foreach ($item in $items) {
|
|
10
|
+
$target = Join-Path $Destination ($item.Name + '.lnk')
|
|
11
|
+
$arguments = '-NoProfile -NoExit -ExecutionPolicy Bypass -File "' + $launcher + '" -NodePath "' + $NodePath + '" -Entry "' + $Entry + '" -Action ' + $item.Command
|
|
12
|
+
if (Test-Path -LiteralPath $target) {
|
|
13
|
+
$existing = $shell.CreateShortcut($target)
|
|
14
|
+
if ($existing.Arguments -ne $arguments) { throw ('快捷方式不是本安装创建的,未覆盖或删除:' + $target) }
|
|
15
|
+
}
|
|
16
|
+
if ($Remove) {
|
|
17
|
+
if (Test-Path -LiteralPath $target) { Remove-Item -LiteralPath $target }
|
|
18
|
+
} else {
|
|
19
|
+
$link = $shell.CreateShortcut($target)
|
|
20
|
+
$link.TargetPath = Join-Path $env:SystemRoot 'System32/WindowsPowerShell/v1.0/powershell.exe'
|
|
21
|
+
$link.Arguments = $arguments
|
|
22
|
+
$link.WorkingDirectory = Split-Path $Entry -Parent
|
|
23
|
+
$link.Description = $item.Name
|
|
24
|
+
$link.Save()
|
|
25
|
+
}
|
|
26
|
+
$results += $target
|
|
27
|
+
}
|
|
28
|
+
ConvertTo-Json -InputObject $results -Compress
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import net from 'node:net';
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import { setTimeout as delay } from 'node:timers/promises';
|
|
4
|
+
|
|
5
|
+
async function isToolsPipe(pipe, timeout) {
|
|
6
|
+
return new Promise(resolve => {
|
|
7
|
+
const socket = net.createConnection(pipe);
|
|
8
|
+
let data = Buffer.alloc(0);
|
|
9
|
+
const finish = value => { clearTimeout(timer); socket.destroy(); resolve(value); };
|
|
10
|
+
const timer = setTimeout(() => finish(false), timeout);
|
|
11
|
+
socket.on('error', () => finish(false));
|
|
12
|
+
socket.on('end', () => finish(false));
|
|
13
|
+
socket.on('connect', () => {
|
|
14
|
+
const body = Buffer.from(JSON.stringify({ jsonrpc: '2.0', id: 1, method: 'tools/list', params: { threadStartKind: 'all' } }));
|
|
15
|
+
const header = Buffer.alloc(4); header.writeUInt32LE(body.length);
|
|
16
|
+
socket.write(Buffer.concat([header, body]));
|
|
17
|
+
});
|
|
18
|
+
socket.on('data', chunk => {
|
|
19
|
+
data = Buffer.concat([data, chunk]);
|
|
20
|
+
if (data.length < 4) return;
|
|
21
|
+
const length = data.readUInt32LE(0);
|
|
22
|
+
if (length > 8 * 1024 * 1024) return finish(false);
|
|
23
|
+
if (data.length < length + 4) return;
|
|
24
|
+
try {
|
|
25
|
+
const response = JSON.parse(data.subarray(4, length + 4));
|
|
26
|
+
finish(response.id === 1 && response.result?.tools?.some(tool => tool.namespace === 'codex_app' && tool.name === 'send_message_to_thread'));
|
|
27
|
+
} catch { finish(false); }
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
// The Desktop WebSocket may connect before its tools router is ready.
|
|
34
|
+
export async function findDesktopPipe({ timeout = 0, allowMissing = false, wait = delay, now = Date.now,
|
|
35
|
+
enumerate = () => fs.readdirSync('\\\\.\\pipe\\').filter(name => name.startsWith('codex-browser-use-')).map(name => `\\\\.\\pipe\\${name}`),
|
|
36
|
+
ready = isToolsPipe } = {}) {
|
|
37
|
+
const deadline = now() + timeout;
|
|
38
|
+
do {
|
|
39
|
+
const matches = (await Promise.all(enumerate().map(async pipe =>
|
|
40
|
+
await ready(pipe, Math.max(1, Math.min(2000, timeout ? deadline - now() : 2000))) ? pipe : null))).filter(Boolean);
|
|
41
|
+
if (matches.length === 1) return matches[0];
|
|
42
|
+
if (matches.length > 1) throw new Error(`检测到 ${matches.length} 个桌面工具管道,无法确定 Bridge 应连接的 Desktop。`);
|
|
43
|
+
if (now() >= deadline) break;
|
|
44
|
+
await wait(Math.min(250, deadline - now()));
|
|
45
|
+
} while (true);
|
|
46
|
+
if (allowMissing) return null;
|
|
47
|
+
throw new Error('Desktop 工具接口尚未就绪。请等待 Desktop 首页加载完成后重试;未启动 Bridge,也未结束 Desktop。');
|
|
48
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
$ErrorActionPreference = 'Stop'
|
|
2
|
+
$spec = $env:CODEX_REMOTE_PROCESS_SPEC | ConvertFrom-Json
|
|
3
|
+
Remove-Item Env:CODEX_REMOTE_PROCESS_SPEC
|
|
4
|
+
$result = @{instance=$spec.instance; brokerPid=$PID}
|
|
5
|
+
try {
|
|
6
|
+
Add-Type -Path (Join-Path $PSScriptRoot 'IsolatedProcess.cs')
|
|
7
|
+
$stdout = if ($spec.logs.Count -gt 0) { [string]$spec.logs[0] } else { 'NUL' }
|
|
8
|
+
$stderr = if ($spec.logs.Count -gt 1) { [string]$spec.logs[1] } else { 'NUL' }
|
|
9
|
+
$result.pid = [IsolatedProcess]::Start([string]$spec.executable, [string[]]$spec.args, $stdout, $stderr)
|
|
10
|
+
} catch { $result.error = $_.Exception.Message }
|
|
11
|
+
$temporary = $spec.ready + '.tmp'
|
|
12
|
+
[IO.File]::WriteAllText($temporary, ($result | ConvertTo-Json -Compress), (New-Object Text.UTF8Encoding($false)))
|
|
13
|
+
[IO.File]::Move($temporary, $spec.ready)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { execFile } from 'node:child_process';
|
|
2
|
+
import { promisify } from 'node:util';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
|
|
6
|
+
const exec = promisify(execFile);
|
|
7
|
+
const bridgeRoot = fileURLToPath(new URL('../../../', import.meta.url));
|
|
8
|
+
|
|
9
|
+
export async function lanNetworks() {
|
|
10
|
+
const executable = path.join(process.env.SystemRoot, 'System32/WindowsPowerShell/v1.0/powershell.exe');
|
|
11
|
+
const { stdout } = await exec(executable, ['-NoProfile', '-NonInteractive', '-File', path.join(bridgeRoot, 'get-lan-networks.ps1')],
|
|
12
|
+
{ windowsHide: true, encoding: 'utf8' });
|
|
13
|
+
const records = JSON.parse(stdout.trim() || '[]');
|
|
14
|
+
if (!Array.isArray(records) || records.length > 8) throw new Error('Windows 返回了无效的局域网信息');
|
|
15
|
+
return records.map(record => {
|
|
16
|
+
if (!privateIpv4(record.address) || !['wifi', 'ethernet'].includes(record.networkType) ||
|
|
17
|
+
!plainLabel(record.networkName) || !plainLabel(record.interfaceName)) throw new Error('Windows 返回了无效的局域网信息');
|
|
18
|
+
return { address: record.address, networkType: record.networkType,
|
|
19
|
+
networkName: record.networkName.trim(), interfaceName: record.interfaceName.trim() };
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function privateIpv4(value) {
|
|
24
|
+
if (typeof value !== 'string') return false;
|
|
25
|
+
const parts = value.split('.').map(Number);
|
|
26
|
+
if (parts.length !== 4 || parts.some(part => !Number.isInteger(part) || part < 0 || part > 255)) return false;
|
|
27
|
+
return parts[0] === 10 || (parts[0] === 192 && parts[1] === 168) ||
|
|
28
|
+
(parts[0] === 172 && parts[1] >= 16 && parts[1] <= 31) ||
|
|
29
|
+
(parts[0] === 100 && parts[1] >= 64 && parts[1] <= 127);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function plainLabel(value) {
|
|
33
|
+
return typeof value === 'string' && value.trim().length > 0 && value.trim().length <= 80 && !/[\u0000-\u001f\u007f]/.test(value);
|
|
34
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
param([Parameter(Mandatory=$true)][string]$NodePath, [Parameter(Mandatory=$true)][string]$Entry)
|
|
2
|
+
$ErrorActionPreference = 'Stop'
|
|
3
|
+
[Console]::OutputEncoding = New-Object System.Text.UTF8Encoding($false)
|
|
4
|
+
$state = Join-Path $env:LOCALAPPDATA 'CodexRemote'
|
|
5
|
+
New-Item -ItemType Directory -Path $state -Force | Out-Null
|
|
6
|
+
& $NodePath $Entry start --json >> (Join-Path $state 'resident-start.log') 2>&1
|
|
7
|
+
exit $LASTEXITCODE
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
param([string]$NodePath, [string]$Entry, [ValidateSet('enable','disable','status')][string]$Action='status')
|
|
2
|
+
$ErrorActionPreference = 'Stop'
|
|
3
|
+
[Console]::OutputEncoding = New-Object System.Text.UTF8Encoding($false)
|
|
4
|
+
$shell = New-Object -ComObject WScript.Shell
|
|
5
|
+
$target = Join-Path $shell.SpecialFolders.Item('Startup') 'Code Relax Bridge.lnk'
|
|
6
|
+
$launcher = Join-Path $PSScriptRoot 'resident-start.ps1'
|
|
7
|
+
$powershell = Join-Path $env:SystemRoot 'System32/WindowsPowerShell/v1.0/powershell.exe'
|
|
8
|
+
$exists = Test-Path -LiteralPath $target
|
|
9
|
+
if ($exists) {
|
|
10
|
+
$existing = $shell.CreateShortcut($target)
|
|
11
|
+
if ($existing.TargetPath -ne $powershell -or -not $existing.Arguments.Contains('"' + $launcher + '"')) {
|
|
12
|
+
throw 'Startup shortcut is not owned by this installation.'
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
if ($Action -eq 'enable') {
|
|
16
|
+
if (-not (Test-Path -LiteralPath $NodePath) -or -not (Test-Path -LiteralPath $Entry)) { throw 'Installed runtime is missing.' }
|
|
17
|
+
$link = $shell.CreateShortcut($target)
|
|
18
|
+
$link.TargetPath = $powershell
|
|
19
|
+
$link.Arguments = '-NoProfile -NonInteractive -WindowStyle Hidden -ExecutionPolicy Bypass -File "' + $launcher + '" -NodePath "' + $NodePath + '" -Entry "' + $Entry + '"'
|
|
20
|
+
$link.WorkingDirectory = $env:USERPROFILE
|
|
21
|
+
$link.WindowStyle = 7
|
|
22
|
+
$link.Description = 'Code Relax resident computer connection'
|
|
23
|
+
$link.Save()
|
|
24
|
+
} elseif ($Action -eq 'disable' -and $exists) {
|
|
25
|
+
Remove-Item -LiteralPath $target
|
|
26
|
+
}
|
|
27
|
+
@{ enabled=(Test-Path -LiteralPath $target); path=$target; scope='current-user-logon' } | ConvertTo-Json -Compress
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
param([Parameter(Mandatory=$true)][string]$StateRoot)
|
|
2
|
+
$ErrorActionPreference='Stop'
|
|
3
|
+
[Console]::OutputEncoding=New-Object Text.UTF8Encoding($false)
|
|
4
|
+
Add-Type -Path (Join-Path $PSScriptRoot 'IsolatedProcess.cs')
|
|
5
|
+
New-Item -ItemType Directory -Path $StateRoot -Force | Out-Null
|
|
6
|
+
$anchor=Join-Path $StateRoot 'bridge-config.json'
|
|
7
|
+
$temporary=$false
|
|
8
|
+
if(-not(Test-Path -LiteralPath $anchor)) {
|
|
9
|
+
$anchor=Join-Path $StateRoot ('.state-path-'+[Guid]::NewGuid().ToString()+'.tmp')
|
|
10
|
+
Set-Content -LiteralPath $anchor -Value 'path-resolution' -Encoding ASCII
|
|
11
|
+
$temporary=$true
|
|
12
|
+
}
|
|
13
|
+
try { [IO.Path]::GetDirectoryName([IsolatedProcess]::ResolvePath($anchor)) }
|
|
14
|
+
finally { if($temporary){Remove-Item -LiteralPath $anchor} }
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import os from 'node:os';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
|
|
5
|
+
// Windows host data locations. Keep existing paths and historical attachments.
|
|
6
|
+
export function runtimePaths(environment = process.env, home = os.homedir()) {
|
|
7
|
+
const codexDataRoot = environment.CODEX_HOME?.trim() || path.join(home, '.codex');
|
|
8
|
+
const serviceRoot = path.join(environment.LOCALAPPDATA || path.join(home, 'AppData', 'Local'), 'Programs', 'CodexRemote', 'service');
|
|
9
|
+
let installed;
|
|
10
|
+
try { installed = JSON.parse(fs.readFileSync(path.join(serviceRoot, 'installation.json'), 'utf8').replace(/^\uFEFF/, '')); }
|
|
11
|
+
catch (error) { if (error.code !== 'ENOENT') throw error; }
|
|
12
|
+
return {
|
|
13
|
+
codexDataRoot,
|
|
14
|
+
sessionsRoot: path.join(codexDataRoot, 'sessions'),
|
|
15
|
+
stateRoot: installed?.stateRoot || path.join(environment.LOCALAPPDATA || path.join(home, 'AppData', 'Local'), 'CodexRemote'),
|
|
16
|
+
serviceRoot,
|
|
17
|
+
uploadsRoot: path.join(environment.ProgramData || 'C:\\ProgramData', 'CodexRemote', 'attachments'),
|
|
18
|
+
credentialsRoot: path.join(environment.ProgramData || 'C:\\ProgramData', 'CodexRemote', 'credentials'),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { execFile } from 'node:child_process';
|
|
2
|
+
import { promisify } from 'node:util';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import fs from 'node:fs';
|
|
6
|
+
import { runtimePaths } from './runtime-paths.mjs';
|
|
7
|
+
import { readRecord } from '../../service-lifecycle.mjs';
|
|
8
|
+
import { lanNetworks } from './network-info.mjs';
|
|
9
|
+
|
|
10
|
+
const exec = promisify(execFile);
|
|
11
|
+
const bridgeRoot = fileURLToPath(new URL('../../../', import.meta.url));
|
|
12
|
+
async function detect(script) {
|
|
13
|
+
const executable = path.join(process.env.SystemRoot, 'System32/WindowsPowerShell/v1.0/powershell.exe');
|
|
14
|
+
const { stdout } = await exec(executable, ['-NoProfile', '-NonInteractive', '-File',
|
|
15
|
+
path.join(bridgeRoot, script)], { windowsHide: true, encoding: 'utf8' });
|
|
16
|
+
return stdout.trim();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Windows-only network metadata stays here, outside the lifecycle implementation.
|
|
20
|
+
export const sharedServiceUrl = () => detect('get-shared-service-url.ps1');
|
|
21
|
+
export const lanAddress = async () => (await lanNetworks())[0]?.address || '';
|
|
22
|
+
export { lanNetworks };
|
|
23
|
+
export function migrateState(stateRoot) {
|
|
24
|
+
fs.mkdirSync(stateRoot, { recursive: true });
|
|
25
|
+
for (const name of ['bridge-config.json', 'bridge-session.json']) {
|
|
26
|
+
const target = path.join(stateRoot, name);
|
|
27
|
+
const old = path.join(bridgeRoot, '../.codex/bridge', name);
|
|
28
|
+
if (!fs.existsSync(target) && fs.existsSync(old)) fs.copyFileSync(old, target, fs.constants.COPYFILE_EXCL);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export async function desktopEnvironment(context, sharedUrl) {
|
|
32
|
+
const environment = { ...process.env };
|
|
33
|
+
environment.CODEX_THREAD_ID ||= environment.CODEX_SESSION_ID || context?.sourceThreadId;
|
|
34
|
+
if (sharedUrl) environment.CODEX_REMOTE_SHARED_WS_URL = sharedUrl;
|
|
35
|
+
else delete environment.CODEX_REMOTE_SHARED_WS_URL;
|
|
36
|
+
const installation = readRecord(path.join(runtimePaths(environment).serviceRoot, 'installation.json'));
|
|
37
|
+
const executable = installation?.nodeExecutable;
|
|
38
|
+
if (!executable || !fs.existsSync(executable)) throw new Error('安装时选用的 Node 不存在,请重新安装 Code Relax。');
|
|
39
|
+
environment.CODEX_MCP_NODE_PATH = executable;
|
|
40
|
+
environment.CODEX_REMOTE_LEGACY_UPLOADS_ROOTS = JSON.stringify(installation.legacyUploadsRoots || []);
|
|
41
|
+
if (sharedUrl) delete environment.CODEX_APP_TOOLS_PIPE_PATH;
|
|
42
|
+
return { executable, environment };
|
|
43
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
$ErrorActionPreference = 'Stop'
|
|
2
|
+
[Console]::InputEncoding = New-Object System.Text.UTF8Encoding($false)
|
|
3
|
+
[Console]::OutputEncoding = New-Object System.Text.UTF8Encoding($false)
|
|
4
|
+
try {
|
|
5
|
+
$spec = [Console]::In.ReadToEnd() | ConvertFrom-Json
|
|
6
|
+
# WMI owns this launch, not the caller's kill-on-close Desktop job hierarchy.
|
|
7
|
+
$instance = [Guid]::NewGuid().ToString()
|
|
8
|
+
$launchRoot = [IO.Path]::GetFullPath((Join-Path $env:LOCALAPPDATA 'CodexRemote\process-launch'))
|
|
9
|
+
New-Item -ItemType Directory -Path $launchRoot -Force | Out-Null
|
|
10
|
+
Add-Type -Path (Join-Path $PSScriptRoot 'IsolatedProcess.cs')
|
|
11
|
+
$launchRoot = [IsolatedProcess]::ResolvePath($launchRoot)
|
|
12
|
+
$ready = Join-Path $launchRoot ($instance + '.json')
|
|
13
|
+
$spec | Add-Member -NotePropertyName instance -NotePropertyValue $instance
|
|
14
|
+
$spec | Add-Member -NotePropertyName ready -NotePropertyValue $ready
|
|
15
|
+
$environment = @(Get-ChildItem Env: | Where-Object { $_.Name -ne 'CODEX_REMOTE_PROCESS_SPEC' } | ForEach-Object { $_.Name + '=' + $_.Value })
|
|
16
|
+
$environment += 'CODEX_REMOTE_PROCESS_SPEC=' + ($spec | ConvertTo-Json -Compress -Depth 10)
|
|
17
|
+
$startup = New-CimInstance -ClassName Win32_ProcessStartup -ClientOnly -Property @{
|
|
18
|
+
ShowWindow=[uint16]0; CreateFlags=[uint32]0x1000010; EnvironmentVariables=[string[]]$environment
|
|
19
|
+
}
|
|
20
|
+
$powershell = Join-Path $env:SystemRoot 'System32\WindowsPowerShell\v1.0\powershell.exe'
|
|
21
|
+
$command = '"' + $powershell + '" -NoProfile -NonInteractive -WindowStyle Hidden -ExecutionPolicy Bypass -File "' + (Join-Path $PSScriptRoot 'launch-worker.ps1') + '"'
|
|
22
|
+
$broker = Invoke-CimMethod -ClassName Win32_Process -MethodName Create -Arguments @{
|
|
23
|
+
CommandLine=$command; CurrentDirectory=$env:USERPROFILE; ProcessStartupInformation=$startup
|
|
24
|
+
}
|
|
25
|
+
if ($broker.ReturnValue -ne 0) { throw ('Windows process broker failed: ' + $broker.ReturnValue) }
|
|
26
|
+
$deadline = [DateTime]::UtcNow.AddSeconds(20)
|
|
27
|
+
while (-not (Test-Path -LiteralPath $ready)) {
|
|
28
|
+
if ([DateTime]::UtcNow -gt $deadline) { throw 'Windows process broker handoff timed out.' }
|
|
29
|
+
Start-Sleep -Milliseconds 50
|
|
30
|
+
}
|
|
31
|
+
$result = Get-Content -LiteralPath $ready -Raw -Encoding UTF8 | ConvertFrom-Json
|
|
32
|
+
Remove-Item -LiteralPath $ready
|
|
33
|
+
if ($result.instance -ne $instance -or $result.brokerPid -ne $broker.ProcessId) { throw 'Windows process broker identity mismatch.' }
|
|
34
|
+
if ($result.error) { throw [string]$result.error }
|
|
35
|
+
[Console]::WriteLine([int]$result.pid)
|
|
36
|
+
} catch {
|
|
37
|
+
[Console]::Error.WriteLine($_.Exception.Message)
|
|
38
|
+
exit 1
|
|
39
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
param([Parameter(Mandatory=$true)][string]$Executable)
|
|
2
|
+
$ErrorActionPreference = 'Stop'
|
|
3
|
+
[Console]::OutputEncoding = New-Object System.Text.UTF8Encoding($false)
|
|
4
|
+
$package = Get-AppxPackage OpenAI.Codex | Select-Object -First 1
|
|
5
|
+
if (-not $package -or $Executable -ne (Join-Path $package.InstallLocation 'app/ChatGPT.exe')) {
|
|
6
|
+
throw 'Desktop executable identity changed; recovery stopped.'
|
|
7
|
+
}
|
|
8
|
+
# This action is only reached after explicit whole-workstation recovery confirmation.
|
|
9
|
+
# Never kill an app-server process tree: the independent recovery worker must survive.
|
|
10
|
+
$workers = @(Get-CimInstance Win32_Process -Filter "Name='ChatGPT.exe'" | Where-Object { $_.ExecutablePath -eq $Executable })
|
|
11
|
+
foreach ($worker in $workers) {
|
|
12
|
+
$actual = Get-CimInstance Win32_Process -Filter "ProcessId=$($worker.ProcessId)"
|
|
13
|
+
if ($actual -and $actual.ExecutablePath -eq $worker.ExecutablePath -and $actual.CreationDate -eq $worker.CreationDate) {
|
|
14
|
+
Stop-Process -Id $worker.ProcessId -Force -ErrorAction Stop
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
if (Get-Process ChatGPT -ErrorAction SilentlyContinue | Where-Object { $_.Path -eq $Executable }) {
|
|
18
|
+
throw 'Desktop did not exit; recovery stopped.'
|
|
19
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import { readRecord, writeRecord } from '../../service-lifecycle.mjs';
|
|
4
|
+
import { runScript } from './desktop-host.mjs';
|
|
5
|
+
import { managedAppServerUrl } from '../../managed-app-server.mjs';
|
|
6
|
+
|
|
7
|
+
const ownershipFile = 'managed-environment.json';
|
|
8
|
+
|
|
9
|
+
export async function readManagedEnvironment() {
|
|
10
|
+
return JSON.parse(await runScript('user-environment.ps1', ['-Action', 'Read']));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export async function configureManagedEnvironment(stateRoot) {
|
|
14
|
+
const current = await readManagedEnvironment();
|
|
15
|
+
const ownershipPath = path.join(stateRoot, ownershipFile);
|
|
16
|
+
const ownership = readRecord(ownershipPath);
|
|
17
|
+
if (current.forceCliUser === '1' || current.forceCliMachine === '1') {
|
|
18
|
+
throw new Error('CODEX_APP_SERVER_FORCE_CLI=1 会让 Codex 忽略受管 app-server;未修改该配置。');
|
|
19
|
+
}
|
|
20
|
+
if (current.userValue && current.userValue !== managedAppServerUrl) {
|
|
21
|
+
throw new Error(`用户已有 CODEX_APP_SERVER_WS_URL=${current.userValue};未覆盖该配置。`);
|
|
22
|
+
}
|
|
23
|
+
if (current.userValue === managedAppServerUrl) {
|
|
24
|
+
const owned = ownership?.value === managedAppServerUrl;
|
|
25
|
+
return { configured: true, value: current.userValue, changed: false, owned };
|
|
26
|
+
}
|
|
27
|
+
const applied = JSON.parse(await runScript('user-environment.ps1', ['-Action', 'Set', '-Value', managedAppServerUrl]));
|
|
28
|
+
writeRecord(ownershipPath, { name: 'CODEX_APP_SERVER_WS_URL', value: managedAppServerUrl,
|
|
29
|
+
configuredAt: new Date().toISOString() });
|
|
30
|
+
return { configured: true, value: applied.userValue, changed: true, owned: true };
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export async function clearManagedEnvironment(stateRoot) {
|
|
34
|
+
const ownershipPath = path.join(stateRoot, ownershipFile);
|
|
35
|
+
const ownership = readRecord(ownershipPath);
|
|
36
|
+
const current = await readManagedEnvironment();
|
|
37
|
+
if (!current.userValue) {
|
|
38
|
+
fs.rmSync(ownershipPath, { force: true });
|
|
39
|
+
return { removed: false, preserved: false, reason: 'already-empty' };
|
|
40
|
+
}
|
|
41
|
+
if (ownership?.value !== managedAppServerUrl || current.userValue !== managedAppServerUrl) {
|
|
42
|
+
fs.rmSync(ownershipPath, { force: true });
|
|
43
|
+
return { removed: false, preserved: true, value: current.userValue,
|
|
44
|
+
reason: ownership?.value === managedAppServerUrl ? 'user-modified' : 'not-owned' };
|
|
45
|
+
}
|
|
46
|
+
const result = JSON.parse(await runScript('user-environment.ps1', ['-Action', 'Clear']));
|
|
47
|
+
if (result.userValue) throw new Error('CODEX_APP_SERVER_WS_URL 清理后读回仍不为空。');
|
|
48
|
+
fs.rmSync(ownershipPath, { force: true });
|
|
49
|
+
return { removed: true, preserved: false, reason: 'removed' };
|
|
50
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
param(
|
|
2
|
+
[ValidateSet('Read', 'Set', 'Clear')][string]$Action = 'Read',
|
|
3
|
+
[string]$Value = ''
|
|
4
|
+
)
|
|
5
|
+
$ErrorActionPreference = 'Stop'
|
|
6
|
+
[Console]::OutputEncoding = New-Object System.Text.UTF8Encoding($false)
|
|
7
|
+
$name = 'CODEX_APP_SERVER_WS_URL'
|
|
8
|
+
|
|
9
|
+
function Broadcast-EnvironmentChange {
|
|
10
|
+
if (-not ('CodeRelax.EnvironmentBroadcast' -as [type])) {
|
|
11
|
+
Add-Type -Namespace CodeRelax -Name EnvironmentBroadcast -MemberDefinition @'
|
|
12
|
+
[System.Runtime.InteropServices.DllImport("user32.dll", CharSet=System.Runtime.InteropServices.CharSet.Unicode, SetLastError=true)]
|
|
13
|
+
public static extern System.IntPtr SendMessageTimeout(
|
|
14
|
+
System.IntPtr hWnd, uint Msg, System.UIntPtr wParam, string lParam,
|
|
15
|
+
uint flags, uint timeout, out System.UIntPtr result);
|
|
16
|
+
'@
|
|
17
|
+
}
|
|
18
|
+
[UIntPtr]$result = [UIntPtr]::Zero
|
|
19
|
+
[void][CodeRelax.EnvironmentBroadcast]::SendMessageTimeout(
|
|
20
|
+
[IntPtr]0xffff, 0x001A, [UIntPtr]::Zero, 'Environment', 0x0002, 5000, [ref]$result)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if ($Action -eq 'Set') {
|
|
24
|
+
if ([string]::IsNullOrWhiteSpace($Value)) { throw 'Environment value is required.' }
|
|
25
|
+
[Environment]::SetEnvironmentVariable($name, $Value, 'User')
|
|
26
|
+
Broadcast-EnvironmentChange
|
|
27
|
+
} elseif ($Action -eq 'Clear') {
|
|
28
|
+
[Environment]::SetEnvironmentVariable($name, $null, 'User')
|
|
29
|
+
Broadcast-EnvironmentChange
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
$userValue = [Environment]::GetEnvironmentVariable($name, 'User')
|
|
33
|
+
$result = @{
|
|
34
|
+
userValue = $userValue
|
|
35
|
+
machineValue = [Environment]::GetEnvironmentVariable($name, 'Machine')
|
|
36
|
+
forceCliUser = [Environment]::GetEnvironmentVariable('CODEX_APP_SERVER_FORCE_CLI', 'User')
|
|
37
|
+
forceCliMachine = [Environment]::GetEnvironmentVariable('CODEX_APP_SERVER_FORCE_CLI', 'Machine')
|
|
38
|
+
}
|
|
39
|
+
if ($Action -eq 'Set' -and $userValue -ne $Value) { throw 'Environment value verification failed.' }
|
|
40
|
+
if ($Action -eq 'Clear' -and -not [string]::IsNullOrEmpty($userValue)) { throw 'Environment removal verification failed.' }
|
|
41
|
+
$result | ConvertTo-Json -Compress
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { EventEmitter } from 'node:events';
|
|
2
|
+
import WebSocket from 'ws';
|
|
3
|
+
import { decode, relayAddress, send } from './wire.mjs';
|
|
4
|
+
|
|
5
|
+
// Headless mobile-side adapter for the local validation. No OpenAI credentials.
|
|
6
|
+
export function connectRelayClient({ relayUrl, room, code, credential, clientId, observe = false }) {
|
|
7
|
+
relayAddress(relayUrl);
|
|
8
|
+
const events = new EventEmitter(), pending = new Map();
|
|
9
|
+
const socket = new WebSocket(relayUrl, { maxPayload: 64 * 1024 * 1024, perMessageDeflate: true });
|
|
10
|
+
let serial = 0, connected = false, pairedCredential = credential, pairedClientId = clientId;
|
|
11
|
+
const ready = new Promise((resolve, reject) => {
|
|
12
|
+
const timer = setTimeout(() => { reject(new Error('Relay connection timeout')); socket.terminate(); }, 7000);
|
|
13
|
+
socket.on('open', () => send(socket, observe ? { type: 'observe', room, credential, clientId }
|
|
14
|
+
: code ? { type: 'pair', room, code, credential, clientId } : { type: 'resume', room, credential, clientId }));
|
|
15
|
+
socket.on('error', error => { reject(error); events.emit('diagnostic', error.message); });
|
|
16
|
+
socket.on('close', () => {
|
|
17
|
+
clearTimeout(timer); connected = false; reject(new Error('Relay connection closed'));
|
|
18
|
+
for (const request of pending.values()) { clearTimeout(request.timer); request.reject(new Error('连接断开,操作结果未确认,不自动重发')); }
|
|
19
|
+
pending.clear(); events.emit('disconnected');
|
|
20
|
+
});
|
|
21
|
+
socket.on('message', (bytes, binary) => {
|
|
22
|
+
try {
|
|
23
|
+
const message = decode(bytes, binary);
|
|
24
|
+
if (message.type === 'paired') { if (message.credential) pairedCredential = message.credential; if (message.clientId) pairedClientId = message.clientId; }
|
|
25
|
+
else if (message.type === 'observing') { clearTimeout(timer); connected = true; events.emit('observing', message); resolve({ room, credential: pairedCredential, clientId: pairedClientId }); }
|
|
26
|
+
else if (message.type === 'computer-info') events.emit('computer-info', { hostName: message.hostName });
|
|
27
|
+
else if (message.type === 'lan-candidates') events.emit('lan-candidates', message.candidates);
|
|
28
|
+
else if (message.type === 'official-computer') events.emit('official-computer', message.computer);
|
|
29
|
+
else if (message.type === 'official-computer-saved') events.emit('official-computer-saved', message.computer);
|
|
30
|
+
else if (message.type === 'ready') { clearTimeout(timer); connected = true; resolve({ room, credential: pairedCredential, clientId: pairedClientId }); }
|
|
31
|
+
else if (message.type === 'data') {
|
|
32
|
+
const body = decode(message.payload, false), request = pending.get(body.id);
|
|
33
|
+
if (body.type === 'response' && request) { clearTimeout(request.timer); pending.delete(body.id); request.resolve(body); }
|
|
34
|
+
else events.emit('message', body);
|
|
35
|
+
} else throw new Error('Invalid relay message');
|
|
36
|
+
} catch (error) { reject(error); events.emit('diagnostic', error.message); socket.close(1008, 'Invalid response'); }
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
return {
|
|
40
|
+
ready, events,
|
|
41
|
+
request(path, { method = 'GET', body, timeoutMs = 5000 } = {}) {
|
|
42
|
+
if (!connected) return Promise.reject(new Error('Relay not ready'));
|
|
43
|
+
const id = ++serial;
|
|
44
|
+
return new Promise((resolve, reject) => {
|
|
45
|
+
const timer = setTimeout(() => { pending.delete(id); reject(new Error('请求超时,结果未确认,不自动重发')); }, timeoutMs);
|
|
46
|
+
pending.set(id, { resolve, reject, timer });
|
|
47
|
+
if (!send(socket, { type: 'data', payload: JSON.stringify({ type: 'request', id, path, method, ...(body ? { body } : {}) }) })) {
|
|
48
|
+
clearTimeout(timer); pending.delete(id); reject(new Error('Relay not connected'));
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
},
|
|
52
|
+
send(message) { if (!connected) throw new Error('Relay not ready'); return send(socket, { type: 'data', payload: JSON.stringify(message) }); },
|
|
53
|
+
recordOfficialComputer(computer) {
|
|
54
|
+
if (!connected || !observe) throw new Error('Metadata channel not ready');
|
|
55
|
+
return send(socket, { type: 'official-computer', ...computer });
|
|
56
|
+
},
|
|
57
|
+
close() { socket.terminate(); },
|
|
58
|
+
};
|
|
59
|
+
}
|