@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,64 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import os from 'node:os';
|
|
4
|
+
import { createHash } from 'node:crypto';
|
|
5
|
+
import { readRecord, writeRecord } from './service-lifecycle.mjs';
|
|
6
|
+
|
|
7
|
+
const owner = '@walkhi/code-relax';
|
|
8
|
+
const markerName = '.code-relax-install.json';
|
|
9
|
+
const legacyOwner = '@closedhi/codex-remote';
|
|
10
|
+
const legacyMarkerName = '.codex-remote-install.json';
|
|
11
|
+
const digest = value => createHash('sha256').update(value).digest('hex');
|
|
12
|
+
export const skillDirectory = (home = os.homedir()) => path.join(home, '.agents/skills/code-relax');
|
|
13
|
+
const legacySkillDirectory = (home = os.homedir()) => path.join(home, '.agents/skills/codex-remote');
|
|
14
|
+
|
|
15
|
+
// Refuse junctions/symlinks along managed paths before writing or removing files.
|
|
16
|
+
export function assertPlainPath(target) {
|
|
17
|
+
for (let item = path.resolve(target); ; item = path.dirname(item)) {
|
|
18
|
+
try { if (fs.lstatSync(item).isSymbolicLink()) throw new Error(`不自动修改链接路径:${item}`); }
|
|
19
|
+
catch (error) { if (error.code !== 'ENOENT') throw error; }
|
|
20
|
+
if (path.dirname(item) === item) break;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function inspectSkill(target = skillDirectory()) {
|
|
25
|
+
assertPlainPath(target);
|
|
26
|
+
if (!fs.existsSync(target)) return { installed: false, managed: false, target };
|
|
27
|
+
const markerPath = path.join(target, markerName), file = path.join(target, 'SKILL.md');
|
|
28
|
+
assertPlainPath(markerPath); assertPlainPath(file);
|
|
29
|
+
const marker = readRecord(markerPath);
|
|
30
|
+
const managed = marker?.owner === owner && fs.existsSync(file)
|
|
31
|
+
&& marker.sha256 === digest(fs.readFileSync(file))
|
|
32
|
+
&& fs.readdirSync(target).every(name => ['SKILL.md', markerName].includes(name));
|
|
33
|
+
return { installed: true, managed, target };
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function removeLegacyManagedSkill(target = legacySkillDirectory()) {
|
|
37
|
+
const marker = readRecord(path.join(target, legacyMarkerName));
|
|
38
|
+
const file = path.join(target, 'SKILL.md');
|
|
39
|
+
if (marker?.owner !== legacyOwner || !fs.existsSync(file) || marker.sha256 !== digest(fs.readFileSync(file))
|
|
40
|
+
|| !fs.readdirSync(target).every(name => ['SKILL.md', legacyMarkerName].includes(name))) return false;
|
|
41
|
+
fs.unlinkSync(file); fs.unlinkSync(path.join(target, legacyMarkerName)); fs.rmdirSync(target);
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function installSkill(source, target = skillDirectory()) {
|
|
46
|
+
const state = inspectSkill(target);
|
|
47
|
+
if (state.installed && !state.managed) throw new Error(`同名 Skill 非本包管理或已被修改,请保留并手动处理:${target}`);
|
|
48
|
+
const content = fs.readFileSync(source);
|
|
49
|
+
fs.mkdirSync(target, { recursive: true });
|
|
50
|
+
fs.writeFileSync(path.join(target, 'SKILL.md'), content);
|
|
51
|
+
writeRecord(path.join(target, markerName), { owner, sha256: digest(content) });
|
|
52
|
+
if (path.resolve(target) === path.resolve(skillDirectory())) removeLegacyManagedSkill();
|
|
53
|
+
return { installed: true, target, message: 'Skill 已安装/更新;若 Codex 尚未显示,请重新打开 Codex。' };
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function removeSkill(target = skillDirectory()) {
|
|
57
|
+
const state = inspectSkill(target);
|
|
58
|
+
if (!state.installed) return { removed: false, target, message: 'Skill 未安装。' };
|
|
59
|
+
if (!state.managed) throw new Error(`同名 Skill 非本包管理或已被修改,未删除:${target}`);
|
|
60
|
+
fs.unlinkSync(path.join(target, 'SKILL.md'));
|
|
61
|
+
fs.unlinkSync(path.join(target, markerName));
|
|
62
|
+
fs.rmdirSync(target);
|
|
63
|
+
return { removed: true, target, message: '已移除本包安装的 Skill。' };
|
|
64
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { DatabaseSync } from 'node:sqlite';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
|
|
4
|
+
function normalizedPath(value) {
|
|
5
|
+
return String(value || '').replace(/^\\\\\?\\/, '').replaceAll('\\', '/').replace(/\/+$/, '').toLowerCase();
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function supplementThreadCatalog(data, projects, codexRoot, limit) {
|
|
9
|
+
const db = new DatabaseSync(path.join(codexRoot, 'state_5.sqlite'), { readOnly: true });
|
|
10
|
+
try {
|
|
11
|
+
const rows = db.prepare(`SELECT id, name, title, cwd, project_id, archived,
|
|
12
|
+
COALESCE(updated_at_ms, updated_at * 1000) AS updated_ms,
|
|
13
|
+
MAX(recency_at_ms, recency_at * 1000, COALESCE(updated_at_ms, updated_at * 1000)) AS sort_ms
|
|
14
|
+
FROM threads WHERE source IN ('vscode', 'cli') ORDER BY sort_ms DESC`).all();
|
|
15
|
+
const indexed = new Map(rows.map(row => [row.id, row]));
|
|
16
|
+
const localProjects = projects.filter(project => project.hostId === 'local' && project.path)
|
|
17
|
+
.sort((a, b) => normalizedPath(b.path).length - normalizedPath(a.path).length);
|
|
18
|
+
const assignProject = thread => {
|
|
19
|
+
if (thread.projectId || thread.hostId !== 'local') return thread;
|
|
20
|
+
const cwd = normalizedPath(thread.cwd);
|
|
21
|
+
const project = localProjects.find(project => cwd === normalizedPath(project.path) || cwd.startsWith(normalizedPath(project.path) + '/'));
|
|
22
|
+
return { ...thread, projectId: project?.projectId || null };
|
|
23
|
+
};
|
|
24
|
+
const visible = thread => thread.kind === 'codex'
|
|
25
|
+
&& (thread.hostId !== 'local' || !indexed.get(thread.id)?.archived);
|
|
26
|
+
const pinnedThreads = (data.pinnedThreads || []).filter(visible).map(assignProject);
|
|
27
|
+
const pinned = new Set(pinnedThreads.map(thread => thread.id));
|
|
28
|
+
const threads = new Map((data.threads || []).filter(visible).map(thread => [thread.id, assignProject(thread)]));
|
|
29
|
+
for (const row of rows) {
|
|
30
|
+
if (row.archived || pinned.has(row.id) || threads.has(row.id)) continue;
|
|
31
|
+
threads.set(row.id, assignProject({ id: row.id, kind: 'codex', hostId: 'local',
|
|
32
|
+
title: row.name || row.title, cwd: row.cwd, projectId: row.project_id,
|
|
33
|
+
updatedAt: row.updated_ms / 1000, status: 'unknown' }));
|
|
34
|
+
}
|
|
35
|
+
const recency = thread => thread.hostId === 'local' && indexed.has(thread.id)
|
|
36
|
+
? indexed.get(thread.id).sort_ms : Number(thread.updatedAt || 0) * 1000;
|
|
37
|
+
return { ...data, pinnedThreads, threads: [...threads.values()]
|
|
38
|
+
.sort((a, b) => recency(b) - recency(a)).slice(0, limit) };
|
|
39
|
+
} finally {
|
|
40
|
+
db.close();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
|
|
3
|
+
const TITLE_MODEL = 'gpt-5.6-luna';
|
|
4
|
+
const TITLE_TIMEOUT_MS = 30_000;
|
|
5
|
+
const TITLE_SCHEMA = Object.freeze({
|
|
6
|
+
type: 'object',
|
|
7
|
+
properties: {
|
|
8
|
+
title: { type: 'string', minLength: 1, maxLength: 36 },
|
|
9
|
+
description: { type: 'string', minLength: 1, maxLength: 100 },
|
|
10
|
+
},
|
|
11
|
+
required: ['title', 'description'],
|
|
12
|
+
additionalProperties: false,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
function titlePrompt(prompt) {
|
|
16
|
+
return [
|
|
17
|
+
'You are a helpful assistant. You will be presented with a user prompt, and your job is to provide a short title for a task that will be created from that prompt.',
|
|
18
|
+
'The title will be shown in the UI to represent the prompt.',
|
|
19
|
+
'Generate a concise UI title of at most 36 characters and fill the structured title field with plain text.',
|
|
20
|
+
'Fill the structured description field with a compact, search-oriented summary of at most 100 characters.',
|
|
21
|
+
'Write both values in the user\'s locale. Do not include quotes, markdown, formatting characters, or trailing punctuation.',
|
|
22
|
+
'Capture the question or core change requested instead of copying the whole prompt.',
|
|
23
|
+
'Do not respond to the user or attempt to solve the problem; only fill the structured fields.',
|
|
24
|
+
'',
|
|
25
|
+
'User prompt:',
|
|
26
|
+
prompt,
|
|
27
|
+
].join('\n');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function normalizeTitle(value) {
|
|
31
|
+
let title = String(value || '').replace(/\r\n/g, '\n').split('\n').find(line => line.trim())?.trim() || '';
|
|
32
|
+
title = title.replace(/^title[:\s]+/i, '');
|
|
33
|
+
title = title.replace(/^[`"'“”‘’]+|[`"'“”‘’]+$/g, '');
|
|
34
|
+
title = title.replace(/\s+/g, ' ').replace(/[.?!。?!]+$/, '').trim();
|
|
35
|
+
if (!title) return null;
|
|
36
|
+
if (title.length <= 36) return title;
|
|
37
|
+
let end = 36;
|
|
38
|
+
if (title[end] !== ' ' && title[end - 1] !== ' ') {
|
|
39
|
+
const nextSpace = title.indexOf(' ', end);
|
|
40
|
+
end = nextSpace < 0 ? title.length : nextSpace;
|
|
41
|
+
}
|
|
42
|
+
const head = title.slice(0, end).trimEnd();
|
|
43
|
+
return title.slice(end).trim() ? `${head}…` : head;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function parseStructuredTitle(text) {
|
|
47
|
+
if (!text?.trim()) return null;
|
|
48
|
+
try {
|
|
49
|
+
const value = JSON.parse(text.trim());
|
|
50
|
+
return normalizeTitle(value?.title);
|
|
51
|
+
} catch {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export async function generateThreadTitle({ request, subscribe, prompt, cwd = null,
|
|
57
|
+
timeoutMs = TITLE_TIMEOUT_MS, uuid = randomUUID }) {
|
|
58
|
+
const source = String(prompt || '').trim();
|
|
59
|
+
if (!source) return null;
|
|
60
|
+
const { thread } = await request('thread/start', {
|
|
61
|
+
model: TITLE_MODEL,
|
|
62
|
+
modelProvider: null,
|
|
63
|
+
allowProviderModelFallback: true,
|
|
64
|
+
cwd,
|
|
65
|
+
approvalPolicy: 'never',
|
|
66
|
+
permissions: ':read-only',
|
|
67
|
+
runtimeWorkspaceRoots: [],
|
|
68
|
+
config: {
|
|
69
|
+
'features.enable_fanout': false,
|
|
70
|
+
'features.hooks': false,
|
|
71
|
+
'features.multi_agent': false,
|
|
72
|
+
'features.multi_agent_v2': false,
|
|
73
|
+
'features.plugins': false,
|
|
74
|
+
'features.shell_snapshot': false,
|
|
75
|
+
'features.tool_suggest': false,
|
|
76
|
+
'features.apps': false,
|
|
77
|
+
'mcp_servers.codex_app': { enabled: false, command: '' },
|
|
78
|
+
apps: { _default: { enabled: false, destructive_enabled: false, open_world_enabled: false } },
|
|
79
|
+
model_reasoning_effort: 'low',
|
|
80
|
+
web_search: 'disabled',
|
|
81
|
+
},
|
|
82
|
+
personality: null,
|
|
83
|
+
ephemeral: true,
|
|
84
|
+
threadSource: 'thread_title',
|
|
85
|
+
experimentalRawEvents: false,
|
|
86
|
+
dynamicTools: null,
|
|
87
|
+
serviceTier: null,
|
|
88
|
+
});
|
|
89
|
+
const threadId = thread.id;
|
|
90
|
+
let message = '';
|
|
91
|
+
let turnId = null;
|
|
92
|
+
let stop = () => {};
|
|
93
|
+
try {
|
|
94
|
+
const completed = new Promise((resolve, reject) => {
|
|
95
|
+
const timer = setTimeout(() => reject(new Error('生成对话标题超时。')), timeoutMs);
|
|
96
|
+
timer.unref?.();
|
|
97
|
+
const unsubscribe = subscribe(({ method, params }) => {
|
|
98
|
+
if (params.threadId !== threadId) return;
|
|
99
|
+
if (method === 'turn/started') turnId = params.turn?.id || turnId;
|
|
100
|
+
if (turnId && params.turnId && params.turnId !== turnId) return;
|
|
101
|
+
if (method === 'item/agentMessage/delta') message += params.delta || '';
|
|
102
|
+
if (method === 'item/completed' && params.item?.type === 'agentMessage') message = params.item.text || message;
|
|
103
|
+
if (method === 'error') {
|
|
104
|
+
clearTimeout(timer);
|
|
105
|
+
reject(new Error(params.error?.message || '生成对话标题失败。'));
|
|
106
|
+
}
|
|
107
|
+
if (method === 'turn/completed') {
|
|
108
|
+
clearTimeout(timer);
|
|
109
|
+
if (params.turn?.status !== 'completed') {
|
|
110
|
+
reject(new Error(params.turn?.error?.message || `生成对话标题失败:${params.turn?.status || 'unknown'}`));
|
|
111
|
+
} else resolve(parseStructuredTitle(message));
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
stop = () => { clearTimeout(timer); unsubscribe(); };
|
|
115
|
+
});
|
|
116
|
+
const started = await request('turn/start', {
|
|
117
|
+
threadId,
|
|
118
|
+
turnTrigger: 'thread_title',
|
|
119
|
+
clientUserMessageId: uuid(),
|
|
120
|
+
input: [{ type: 'text', text: titlePrompt(source), text_elements: [] }],
|
|
121
|
+
cwd: null,
|
|
122
|
+
approvalPolicy: null,
|
|
123
|
+
permissions: ':read-only',
|
|
124
|
+
runtimeWorkspaceRoots: [],
|
|
125
|
+
model: null,
|
|
126
|
+
effort: null,
|
|
127
|
+
serviceTier: null,
|
|
128
|
+
personality: null,
|
|
129
|
+
outputSchema: TITLE_SCHEMA,
|
|
130
|
+
collaborationMode: null,
|
|
131
|
+
});
|
|
132
|
+
turnId ||= started.turn?.id || null;
|
|
133
|
+
return await completed;
|
|
134
|
+
} finally {
|
|
135
|
+
stop();
|
|
136
|
+
await request('thread/unsubscribe', { threadId }).catch(() => {});
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export async function generateAndSetThreadTitle({ request, subscribe, threadId, prompt, cwd = null,
|
|
141
|
+
timeoutMs, uuid }) {
|
|
142
|
+
const title = await generateThreadTitle({ request, subscribe, prompt, cwd, timeoutMs, uuid });
|
|
143
|
+
if (!title) return null;
|
|
144
|
+
const current = await request('thread/read', { threadId, includeTurns: false });
|
|
145
|
+
if (current.thread?.name?.trim()) return null;
|
|
146
|
+
await request('thread/name/set', { threadId, name: title });
|
|
147
|
+
return title;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export const threadTitleInternals = { normalizeTitle, parseStructuredTitle, TITLE_SCHEMA, TITLE_MODEL };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { findDesktopPipe } from '../src/platform/windows/desktop-tools.mjs';
|
|
2
|
+
|
|
3
|
+
try {
|
|
4
|
+
const args = process.argv.slice(2);
|
|
5
|
+
if (args.length && (args.length !== 1 || args[0] !== '--wait')) throw new Error('Invalid pipe discovery arguments');
|
|
6
|
+
console.log(await findDesktopPipe({ timeout: args.length ? 120000 : 0 }));
|
|
7
|
+
} catch (error) {
|
|
8
|
+
console.error(error.message);
|
|
9
|
+
process.exitCode = 1;
|
|
10
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
param(
|
|
2
|
+
[Parameter(Mandatory = $true)][string]$Token,
|
|
3
|
+
[int]$IdleSeconds = 1800
|
|
4
|
+
)
|
|
5
|
+
|
|
6
|
+
$ErrorActionPreference = 'Stop'
|
|
7
|
+
$pipeName = 'CodeRelaxRtcRouteHelper'
|
|
8
|
+
$leases = @{}
|
|
9
|
+
$pipeSecurity = [System.IO.Pipes.PipeSecurity]::new()
|
|
10
|
+
$currentUser = [System.Security.Principal.WindowsIdentity]::GetCurrent().User
|
|
11
|
+
$pipeSecurity.AddAccessRule([System.IO.Pipes.PipeAccessRule]::new($currentUser, [System.IO.Pipes.PipeAccessRights]::ReadWrite,
|
|
12
|
+
[System.Security.AccessControl.AccessControlType]::Allow))
|
|
13
|
+
$pipeSecurity.AddAccessRule([System.IO.Pipes.PipeAccessRule]::new([System.Security.Principal.SecurityIdentifier]::new('S-1-5-18'),
|
|
14
|
+
[System.IO.Pipes.PipeAccessRights]::FullControl, [System.Security.AccessControl.AccessControlType]::Allow))
|
|
15
|
+
$pipeSecurity.AddAccessRule([System.IO.Pipes.PipeAccessRule]::new([System.Security.Principal.SecurityIdentifier]::new('S-1-5-32-544'),
|
|
16
|
+
[System.IO.Pipes.PipeAccessRights]::FullControl, [System.Security.AccessControl.AccessControlType]::Allow))
|
|
17
|
+
|
|
18
|
+
function Test-PublicIpv4([string]$Address) {
|
|
19
|
+
$parts = $Address.Split('.')
|
|
20
|
+
if ($parts.Count -ne 4) { return $false }
|
|
21
|
+
try { $bytes = $parts | ForEach-Object { [byte]$_ } } catch { return $false }
|
|
22
|
+
$a = $bytes[0]; $b = $bytes[1]
|
|
23
|
+
return $a -ne 0 -and $a -ne 10 -and $a -ne 127 -and $a -lt 224 -and -not ($a -eq 169 -and $b -eq 254) -and
|
|
24
|
+
-not ($a -eq 172 -and $b -ge 16 -and $b -le 31) -and -not ($a -eq 192 -and $b -eq 168) -and
|
|
25
|
+
-not ($a -eq 100 -and $b -ge 64 -and $b -le 127) -and -not ($a -eq 198 -and ($b -eq 18 -or $b -eq 19))
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function Get-PhysicalDefaultRoute {
|
|
29
|
+
$routes = Get-NetRoute -DestinationPrefix '0.0.0.0/0' -AddressFamily IPv4 | Where-Object {
|
|
30
|
+
$adapter = Get-NetAdapter -InterfaceIndex $_.InterfaceIndex -ErrorAction SilentlyContinue
|
|
31
|
+
$_.NextHop -and $_.NextHop -ne '0.0.0.0' -and $adapter.Status -eq 'Up' -and $adapter.HardwareInterface -eq $true -and $adapter.Virtual -ne $true
|
|
32
|
+
} | Sort-Object @{ Expression = { $_.RouteMetric + $_.InterfaceMetric } }
|
|
33
|
+
foreach ($route in $routes) {
|
|
34
|
+
$adapter = Get-NetAdapter -InterfaceIndex $route.InterfaceIndex -ErrorAction SilentlyContinue
|
|
35
|
+
if ($adapter.Name -notmatch 'Mihomo|Meta|Tunnel|VPN|TAP|Wintun') { return $route }
|
|
36
|
+
}
|
|
37
|
+
throw '找不到活动物理 IPv4 默认路由'
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function Clear-ExpiredRoutes {
|
|
41
|
+
$now = Get-Date
|
|
42
|
+
foreach ($address in @($leases.Keys)) {
|
|
43
|
+
if ($leases[$address].expires -gt $now) { continue }
|
|
44
|
+
$lease = $leases[$address]
|
|
45
|
+
if ($lease.created) {
|
|
46
|
+
Get-NetRoute -DestinationPrefix "$address/32" -InterfaceIndex $lease.ifIndex -NextHop $lease.nextHop -ErrorAction SilentlyContinue |
|
|
47
|
+
Remove-NetRoute -Confirm:$false -ErrorAction SilentlyContinue
|
|
48
|
+
}
|
|
49
|
+
$leases.Remove($address)
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function Clear-AllRoutes {
|
|
54
|
+
foreach ($address in @($leases.Keys)) {
|
|
55
|
+
$lease = $leases[$address]
|
|
56
|
+
if ($lease.created) {
|
|
57
|
+
Get-NetRoute -DestinationPrefix "$address/32" -InterfaceIndex $lease.ifIndex -NextHop $lease.nextHop -ErrorAction SilentlyContinue |
|
|
58
|
+
Remove-NetRoute -Confirm:$false -ErrorAction SilentlyContinue
|
|
59
|
+
}
|
|
60
|
+
$leases.Remove($address)
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
try {
|
|
65
|
+
$deadline = (Get-Date).AddSeconds($IdleSeconds)
|
|
66
|
+
while ((Get-Date) -lt $deadline) {
|
|
67
|
+
Clear-ExpiredRoutes
|
|
68
|
+
$server = [System.IO.Pipes.NamedPipeServerStream]::new($pipeName, [System.IO.Pipes.PipeDirection]::InOut, 1,
|
|
69
|
+
[System.IO.Pipes.PipeTransmissionMode]::Byte, [System.IO.Pipes.PipeOptions]::Asynchronous, 0, 0, $pipeSecurity)
|
|
70
|
+
$writer = $null
|
|
71
|
+
try {
|
|
72
|
+
$wait = $server.WaitForConnectionAsync()
|
|
73
|
+
if (-not $wait.Wait(1000)) { continue }
|
|
74
|
+
$reader = [System.IO.StreamReader]::new($server)
|
|
75
|
+
$writer = [System.IO.StreamWriter]::new($server); $writer.AutoFlush = $true
|
|
76
|
+
$request = $reader.ReadLine() | ConvertFrom-Json
|
|
77
|
+
if ($request.token -cne $Token -or $request.action -ne 'add') { throw '请求未授权' }
|
|
78
|
+
$ttl = [Math]::Min([Math]::Max([int]$request.ttlSeconds, 15), 180)
|
|
79
|
+
$route = Get-PhysicalDefaultRoute
|
|
80
|
+
$rawAddresses = @($request.addresses)
|
|
81
|
+
$addresses = @($rawAddresses | Where-Object { Test-PublicIpv4 $_ } | Select-Object -Unique)
|
|
82
|
+
if ($addresses.Count -ne $rawAddresses.Count -or $addresses.Count -gt 8) { throw '路由目标无效' }
|
|
83
|
+
foreach ($address in $addresses) {
|
|
84
|
+
$created = $leases[$address].created -eq $true
|
|
85
|
+
if (-not $leases.ContainsKey($address) -and -not (Get-NetRoute -DestinationPrefix "$address/32" -InterfaceIndex $route.InterfaceIndex -NextHop $route.NextHop -ErrorAction SilentlyContinue)) {
|
|
86
|
+
New-NetRoute -DestinationPrefix "$address/32" -InterfaceIndex $route.InterfaceIndex -NextHop $route.NextHop -RouteMetric 5 -PolicyStore ActiveStore | Out-Null
|
|
87
|
+
$created = $true
|
|
88
|
+
}
|
|
89
|
+
$leases[$address] = @{ expires = (Get-Date).AddSeconds($ttl); ifIndex = $route.InterfaceIndex; nextHop = $route.NextHop; created = $created }
|
|
90
|
+
}
|
|
91
|
+
$writer.WriteLine((@{ ok = $true; count = $addresses.Count } | ConvertTo-Json -Compress))
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
if ($writer) { $writer.WriteLine((@{ ok = $false; error = $_.Exception.Message } | ConvertTo-Json -Compress)) }
|
|
95
|
+
}
|
|
96
|
+
finally { $server.Dispose() }
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
finally { Clear-AllRoutes }
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
$ErrorActionPreference = 'Stop'
|
|
2
|
+
$roots = @(
|
|
3
|
+
(Join-Path $env:LOCALAPPDATA 'CodexRemote'),
|
|
4
|
+
(Join-Path $env:LOCALAPPDATA 'Packages\OpenAI.Codex_2p2nqsd0c76g0\LocalCache\Local\CodexRemote')
|
|
5
|
+
)
|
|
6
|
+
$config = $null
|
|
7
|
+
foreach ($root in $roots) {
|
|
8
|
+
$path = Join-Path $root 'self-relay-config.json'
|
|
9
|
+
if (-not (Test-Path -LiteralPath $path)) { continue }
|
|
10
|
+
$value = Get-Content -LiteralPath $path -Raw -Encoding UTF8 | ConvertFrom-Json
|
|
11
|
+
if ($value.p2pWindowsRouteHelper -eq $true -and $value.p2pWindowsRouteHelperToken) { $config = $value; break }
|
|
12
|
+
}
|
|
13
|
+
if (-not $config) { throw '未找到已启用的 RTC 路由辅助配置' }
|
|
14
|
+
$helper = Join-Path $PSScriptRoot 'rtc-route-helper.ps1'
|
|
15
|
+
& $helper -Token $config.p2pWindowsRouteHelperToken -IdleSeconds 1800
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
(function (root) {
|
|
2
|
+
root.createApprovalPanel = function (host, respond, pendingChanged = () => {}) {
|
|
3
|
+
const cards = new Map();
|
|
4
|
+
let connected = false;
|
|
5
|
+
const titles = { accept: '允许本次', acceptForSession: '本会话允许', decline: '拒绝', cancel: '拒绝并停止' };
|
|
6
|
+
function content(text, label, collapsed = false) {
|
|
7
|
+
const full = document.createElement('pre'); full.textContent = text;
|
|
8
|
+
if (!text) full.hidden = true;
|
|
9
|
+
if (!collapsed && text.length <= 180 && text.split('\n').length <= 3) return full;
|
|
10
|
+
const details = document.createElement('details'); details.className = 'approval-details';
|
|
11
|
+
const summary = document.createElement('summary');
|
|
12
|
+
const title = document.createElement('span'); title.className = 'approval-details-title'; title.textContent = label;
|
|
13
|
+
const preview = document.createElement('span'); preview.className = 'approval-preview';
|
|
14
|
+
preview.textContent = text.split('\n').slice(0, 3).join('\n').slice(0, 180) + '…';
|
|
15
|
+
summary.append(title);
|
|
16
|
+
if (!collapsed) summary.append(preview);
|
|
17
|
+
details.append(summary, full);
|
|
18
|
+
return details;
|
|
19
|
+
}
|
|
20
|
+
function paragraph(text, className = '') {
|
|
21
|
+
const p = document.createElement('p'); p.textContent = text; p.className = className; return p;
|
|
22
|
+
}
|
|
23
|
+
function shellPresentation(command) {
|
|
24
|
+
if (typeof command !== 'string') return null;
|
|
25
|
+
const match = command.trim().match(/^(?:"([^"]+)"|'([^']+)'|(\S+))(?:\s+([\s\S]*))?$/);
|
|
26
|
+
if (!match) return null;
|
|
27
|
+
const executable = match[1] || match[2] || match[3];
|
|
28
|
+
const name = executable.replaceAll('\\', '/').split('/').at(-1)?.toLowerCase() || '';
|
|
29
|
+
const rest = match[4] || '';
|
|
30
|
+
const shells = [
|
|
31
|
+
{ names: ['powershell', 'powershell.exe', 'pwsh', 'pwsh.exe'], label: 'PowerShell', marker: /(?:^|\s)-(?:command|c)\s+/i },
|
|
32
|
+
{ names: ['cmd', 'cmd.exe'], label: '命令提示符', marker: /(?:^|\s)\/(?:c|k)\s+/i },
|
|
33
|
+
{ names: ['bash', 'bash.exe', 'sh', 'sh.exe'], label: 'Shell', marker: /(?:^|\s)-(?:c|lc)\s+/i }
|
|
34
|
+
];
|
|
35
|
+
const shell = shells.find(candidate => candidate.names.includes(name));
|
|
36
|
+
if (!shell) return null;
|
|
37
|
+
const marker = shell.marker.exec(rest);
|
|
38
|
+
const text = marker ? rest.slice(marker.index + marker[0].length).trim() : rest.trim();
|
|
39
|
+
return { label: shell.label, text };
|
|
40
|
+
}
|
|
41
|
+
function requestDetails(request) {
|
|
42
|
+
const p = request.params, body = document.createElement('div'); body.className = 'approval-body';
|
|
43
|
+
const network = p.networkApprovalContext;
|
|
44
|
+
if (network) body.append(paragraph(`目标:${network.protocol}://${network.host}`));
|
|
45
|
+
if (p.reason && network) body.append(paragraph(p.reason));
|
|
46
|
+
for (const action of p.commandActions || []) {
|
|
47
|
+
if (action.type === 'read') body.append(paragraph(`读取文件:${action.path || action.name}`));
|
|
48
|
+
else if (action.type === 'listFiles') body.append(paragraph(`列出文件:${action.path || p.cwd || '当前目录'}`));
|
|
49
|
+
else if (action.type === 'search') body.append(paragraph(`搜索${action.query ? `“${action.query}”` : '内容'}${action.path ? `:${action.path}` : ''}`));
|
|
50
|
+
}
|
|
51
|
+
const shell = shellPresentation(p.command);
|
|
52
|
+
if (shell) {
|
|
53
|
+
body.append(paragraph(`执行方式:${shell.label}`, 'approval-meta'));
|
|
54
|
+
if (shell.text) body.append(content(shell.text, '要执行的内容'));
|
|
55
|
+
body.append(content(p.command, '完整原始命令', true));
|
|
56
|
+
} else if (p.command) body.append(content(p.command, '完整命令'));
|
|
57
|
+
if (p.cwd) body.append(paragraph(`工作目录:${p.cwd}`, 'approval-meta'));
|
|
58
|
+
if (p.grantRoot) body.append(paragraph(`申请本会话写入目录:${p.grantRoot}`));
|
|
59
|
+
for (const change of request.fileChanges || []) {
|
|
60
|
+
const kind = change.kind?.type || change.kind;
|
|
61
|
+
const move = change.kind?.movePath;
|
|
62
|
+
const label = `${{ add: '新增', delete: '删除', update: '修改' }[kind] || '文件'}:${change.path}${move ? ` → ${move}` : ''}`;
|
|
63
|
+
body.append(change.diff ? content(change.diff, label, true) : paragraph(label));
|
|
64
|
+
}
|
|
65
|
+
if (request.method === CodexServerRequests.file && !request.fileChanges?.length) body.append(paragraph('尚未收到文件修改明细,请先在工作站查看。'));
|
|
66
|
+
const permissions = p.additionalPermissions || p.permissions;
|
|
67
|
+
if (permissions) {
|
|
68
|
+
if (permissions.network?.enabled === true) body.append(paragraph('额外权限:连接互联网'));
|
|
69
|
+
const files = permissions.fileSystem;
|
|
70
|
+
for (const path of files?.read || []) body.append(paragraph(`允许读取:${path}`));
|
|
71
|
+
for (const path of files?.write || []) body.append(paragraph(`允许写入:${path}`));
|
|
72
|
+
for (const entry of files?.entries || []) {
|
|
73
|
+
const path = entry.path?.path || entry.path?.pattern;
|
|
74
|
+
const action = { read: '允许读取', write: '允许写入', deny: '禁止访问' }[entry.access];
|
|
75
|
+
if (path && action) body.append(paragraph(`${action}:${path}`));
|
|
76
|
+
}
|
|
77
|
+
body.append(content(JSON.stringify(permissions, null, 2), '完整权限范围', true));
|
|
78
|
+
}
|
|
79
|
+
return body;
|
|
80
|
+
}
|
|
81
|
+
function decisionDescription(request, decision) {
|
|
82
|
+
if (decision === 'acceptForSession') return request.method === CodexServerRequests.file
|
|
83
|
+
? '本次及本会话内对相同文件的后续修改无需再次询问。' : '本次及会话内匹配的后续操作无需再次询问,不是只允许这一次。';
|
|
84
|
+
if (decision?.applyNetworkPolicyAmendment) {
|
|
85
|
+
const rule = decision.applyNetworkPolicyAmendment.network_policy_amendment;
|
|
86
|
+
return `${rule.action === 'allow' ? '允许' : '禁止'}访问 ${rule.host},并保存为后续网络规则。`;
|
|
87
|
+
}
|
|
88
|
+
return JSON.stringify(decision, null, 2);
|
|
89
|
+
}
|
|
90
|
+
const refresh = () => {
|
|
91
|
+
host.hidden = cards.size === 0;
|
|
92
|
+
for (const card of cards.values()) {
|
|
93
|
+
const status = card.request.status;
|
|
94
|
+
card.status.textContent = !connected ? '连接未恢复,暂不能操作' : card.error || (status === 'submitted' ? '决定已提交,等待工作站确认…' : status === 'unknown' ? '提交结果未确认,请检查工作站' : '等待你处理');
|
|
95
|
+
for (const control of card.form.querySelectorAll('button, input, textarea')) control.disabled = !connected || status !== 'pending' || card.busy;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
const notifyPending = threadId => {
|
|
99
|
+
if (!threadId) return;
|
|
100
|
+
const pending = [...cards.values()].some(card => card.request.params.threadId === threadId
|
|
101
|
+
&& card.request.status === 'pending');
|
|
102
|
+
pendingChanged(threadId, pending);
|
|
103
|
+
};
|
|
104
|
+
function create(request) {
|
|
105
|
+
const element = document.createElement('div'); element.className = 'approval-card';
|
|
106
|
+
const heading = document.createElement('strong');
|
|
107
|
+
const p = request.params;
|
|
108
|
+
heading.textContent = request.method === CodexServerRequests.input ? '需要你的回答'
|
|
109
|
+
: p.networkApprovalContext ? `允许连接 ${p.networkApprovalContext.host}?`
|
|
110
|
+
: p.reason?.trim() || (request.method === CodexServerRequests.file ? '允许修改以下文件?'
|
|
111
|
+
: request.method === CodexServerRequests.command
|
|
112
|
+
? p.kind === 'writeStdin' ? '允许向正在运行的终端发送输入?'
|
|
113
|
+
: '允许执行此命令?'
|
|
114
|
+
: '需要你的批准');
|
|
115
|
+
const status = document.createElement('p'); status.setAttribute('role', 'status');
|
|
116
|
+
const detail = requestDetails(request);
|
|
117
|
+
const form = document.createElement('form');
|
|
118
|
+
const card = { element, status, detail, form, request, fileChangesKey: JSON.stringify(request.fileChanges), busy: false, error: '' };
|
|
119
|
+
const submit = async result => {
|
|
120
|
+
if (!connected || card.busy || card.request.status !== 'pending') return;
|
|
121
|
+
card.busy = true; card.error = '';
|
|
122
|
+
card.request = { ...card.request, status: 'submitted' };
|
|
123
|
+
notifyPending(card.request.params.threadId); refresh();
|
|
124
|
+
try { await respond(card.request, result); }
|
|
125
|
+
catch (error) {
|
|
126
|
+
card.request = { ...card.request, status: 'unknown' };
|
|
127
|
+
card.error = error.message;
|
|
128
|
+
} finally { notifyPending(card.request.params.threadId); refresh(); }
|
|
129
|
+
};
|
|
130
|
+
form.onsubmit = event => event.preventDefault();
|
|
131
|
+
if (request.method === CodexServerRequests.input) {
|
|
132
|
+
const inputs = (p.questions || []).map(q => {
|
|
133
|
+
const label = document.createElement('label'); label.textContent = q.question;
|
|
134
|
+
const input = document.createElement('input'); input.type = q.isSecret ? 'password' : 'text'; input.autocomplete = 'off';
|
|
135
|
+
label.append(input); form.append(label);
|
|
136
|
+
for (const option of q.options || []) {
|
|
137
|
+
const button = document.createElement('button'); button.type = 'button'; button.textContent = option.label;
|
|
138
|
+
button.title = option.description || ''; button.onclick = () => { input.value = option.label; }; form.append(button);
|
|
139
|
+
}
|
|
140
|
+
return { id: q.id, input };
|
|
141
|
+
});
|
|
142
|
+
const button = document.createElement('button'); button.textContent = '提交回答'; form.append(button);
|
|
143
|
+
form.onsubmit = event => { event.preventDefault(); submit({ answers: Object.fromEntries(inputs.map(({ id, input }) => [id, { answers: [input.value] }])) }); };
|
|
144
|
+
} else {
|
|
145
|
+
const choices = CodexServerRequests.decisions(request);
|
|
146
|
+
const actions = document.createElement('div'); actions.className = 'approval-actions';
|
|
147
|
+
for (const decision of choices) {
|
|
148
|
+
const button = document.createElement('button'); button.type = 'button';
|
|
149
|
+
button.textContent = typeof decision === 'string' ? titles[decision] || decision : decision.acceptWithExecpolicyAmendment ? '允许类似命令' : decision.applyNetworkPolicyAmendment ? '保存网络规则' : '应用所示决定';
|
|
150
|
+
button.onclick = () => submit({ decision });
|
|
151
|
+
if (decision === 'acceptForSession' || (typeof decision === 'object' && !decision.acceptWithExecpolicyAmendment)) {
|
|
152
|
+
const option = document.createElement('div'); option.className = 'approval-scope-option';
|
|
153
|
+
option.append(paragraph(decisionDescription(request, decision))); form.append(option);
|
|
154
|
+
}
|
|
155
|
+
actions.append(button);
|
|
156
|
+
}
|
|
157
|
+
if (choices.length) form.append(actions);
|
|
158
|
+
if (!choices.length) {
|
|
159
|
+
const unsupported = document.createElement('p'); unsupported.textContent = '此类请求暂不支持手机处理,请到工作站查看。'; form.append(unsupported);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
const type = request.method === CodexServerRequests.input ? '问题'
|
|
163
|
+
: p.networkApprovalContext ? '互联网访问' : request.method === CodexServerRequests.file ? '编辑文件'
|
|
164
|
+
: request.method === CodexServerRequests.command ? '终端' : '请求权限';
|
|
165
|
+
element.append(paragraph(type, 'approval-kind'), heading, status, detail, form); return card;
|
|
166
|
+
}
|
|
167
|
+
return {
|
|
168
|
+
update(requests) {
|
|
169
|
+
const threadId = requests[0]?.params?.threadId || [...cards.values()][0]?.request.params.threadId;
|
|
170
|
+
const active = new Set();
|
|
171
|
+
for (const request of requests) {
|
|
172
|
+
const key = JSON.stringify([request.epoch, request.id]); active.add(key);
|
|
173
|
+
let card = cards.get(key);
|
|
174
|
+
if (!card) { card = create(request); cards.set(key, card); host.append(card.element); }
|
|
175
|
+
const fileChangesKey = JSON.stringify(request.fileChanges);
|
|
176
|
+
if (card.fileChangesKey !== fileChangesKey) {
|
|
177
|
+
card.detail.replaceChildren(...requestDetails(request).children); card.fileChangesKey = fileChangesKey;
|
|
178
|
+
}
|
|
179
|
+
card.request = request;
|
|
180
|
+
}
|
|
181
|
+
for (const [key, card] of cards) if (!active.has(key)) { card.element.remove(); cards.delete(key); }
|
|
182
|
+
notifyPending(threadId); refresh();
|
|
183
|
+
},
|
|
184
|
+
setConnected(value) { connected = value; refresh(); },
|
|
185
|
+
clear() { cards.clear(); host.replaceChildren(); refresh(); }
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
})(globalThis);
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
(function (root, factory) {
|
|
2
|
+
if (typeof module === 'object' && module.exports) module.exports = factory();
|
|
3
|
+
else root.CodexCapabilities = factory();
|
|
4
|
+
})(globalThis, function () {
|
|
5
|
+
// Execution semantics belong to a connection/task, never to a client OS.
|
|
6
|
+
const profiles = {
|
|
7
|
+
'lan-legacy': { input: 'markdown-path', history: 'recent', settings: 'next-message', updates: 'snapshot-poll',
|
|
8
|
+
stop: 'none', queueOwner: 'bridge', desktopNavigation: true },
|
|
9
|
+
'lan-shared': { input: 'inline-image', history: 'paged', settings: 'immediate', updates: 'events',
|
|
10
|
+
stop: 'primary', queueOwner: 'codex', archive: true, approvals: true, desktopNavigation: true, syncBeforeWrite: true, sharedRecovery: true },
|
|
11
|
+
relay: { input: 'inline-image', history: 'paged', settings: 'immediate', updates: 'events',
|
|
12
|
+
stop: 'primary', queueOwner: 'codex', archive: true, approvals: true, syncBeforeWrite: true, historyCache: true, remoteImages: true, remoteFiles: true, managedConnection: true },
|
|
13
|
+
'app-server': { input: 'inline-image', history: 'recent', settings: 'next-message', updates: 'events',
|
|
14
|
+
stop: 'separate', queueOwner: 'bridge' },
|
|
15
|
+
};
|
|
16
|
+
const unknown = Object.freeze({ input: 'unknown', history: 'unknown', settings: 'unknown', updates: 'unknown',
|
|
17
|
+
stop: 'none', queueOwner: 'none' });
|
|
18
|
+
for (const profile of Object.values(profiles)) Object.freeze(profile);
|
|
19
|
+
Object.freeze(profiles);
|
|
20
|
+
|
|
21
|
+
function describe(mode) { return profiles[mode] || unknown; }
|
|
22
|
+
function has(mode, feature) {
|
|
23
|
+
const p = describe(mode);
|
|
24
|
+
switch (feature) {
|
|
25
|
+
case 'queue': return p.queueOwner !== 'none';
|
|
26
|
+
case 'nativeInput': return ['local-image', 'inline-image'].includes(p.input);
|
|
27
|
+
case 'primaryStop': return p.stop === 'primary';
|
|
28
|
+
case 'separateStop': return p.stop === 'separate';
|
|
29
|
+
case 'immediateSettings': return p.settings === 'immediate';
|
|
30
|
+
case 'pagedHistory': return p.history === 'paged';
|
|
31
|
+
case 'recentHistory': return p.history === 'recent';
|
|
32
|
+
case 'archive': return p.archive === true;
|
|
33
|
+
// The independent adapter keeps its existing snapshot-based UI contract.
|
|
34
|
+
case 'incrementalEvents': return p.updates === 'events' && mode !== 'app-server';
|
|
35
|
+
default: return p[feature] === true;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Support is stable; availability is recalculated for the current task. */
|
|
40
|
+
function actionState(mode, action, context = {}) {
|
|
41
|
+
const p = describe(mode);
|
|
42
|
+
const supported = action === 'interrupt' ? p.stop !== 'none'
|
|
43
|
+
: action === 'queue' ? has(mode, 'queue')
|
|
44
|
+
: action === 'settings' ? has(mode, 'immediateSettings')
|
|
45
|
+
: action === 'send' && p.input !== 'unknown';
|
|
46
|
+
if (!supported) return { visible: false, enabled: false, reason: '当前连接不支持此操作' };
|
|
47
|
+
if (context.connected === false) return { visible: true, enabled: false, reason: '连接尚未恢复' };
|
|
48
|
+
if (context.writable === false) return { visible: true, enabled: false, reason: context.readOnlyReason || '当前对话为只读' };
|
|
49
|
+
if (context.busy) return { visible: true, enabled: false, reason: '操作正在提交' };
|
|
50
|
+
if ((action === 'interrupt' || action === 'settings') && context.syncing) {
|
|
51
|
+
return { visible: true, enabled: false, reason: '请等待对话同步完成' };
|
|
52
|
+
}
|
|
53
|
+
if (action === 'interrupt' && !context.active) return { visible: true, enabled: false, reason: '当前没有运行中的轮次' };
|
|
54
|
+
return { visible: true, enabled: true, reason: '' };
|
|
55
|
+
}
|
|
56
|
+
return { describe, has, actionState };
|
|
57
|
+
});
|