@walkhi/code-relax 0.1.0-beta.29 → 0.1.0-beta.30
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 +12 -3
- package/dist/bin/codex-remote.mjs +54 -37
- package/dist/bin/manage-relay-admin.mjs +20 -20
- package/dist/bin/migrate-relay-db.mjs +109 -109
- package/dist/bin/publish-android-release.mjs +58 -0
- package/dist/bin/self-relay-admin.mjs +8 -8
- package/dist/bin/self-relay-demo.mjs +33 -33
- package/dist/bin/self-relay-server.mjs +66 -64
- package/dist/build-platform.json +1 -0
- package/dist/get-lan-networks.ps1 +40 -40
- package/dist/shared/file-mentions.cjs +12 -0
- package/dist/shared/message-delivery.cjs +17 -1
- package/dist/shared/p2p-data-channel.cjs +72 -50
- package/dist/shared/p2p-diagnostics.cjs +28 -28
- package/dist/shared/p2p-file-channel.cjs +3 -3
- package/dist/shared/plan-pricing.cjs +32 -0
- package/dist/shared/server-requests.cjs +17 -1
- package/dist/skills/code-relax/SKILL.md +3 -3
- package/dist/src/background-process.mjs +18 -18
- package/dist/src/code-browser.mjs +7 -8
- package/dist/src/dots-chat-server.mjs +50 -1
- package/dist/src/dots-room-client.mjs +2 -2
- package/dist/src/dots-task-catalog.mjs +22 -3
- package/dist/src/dots-task-files.mjs +52 -0
- package/dist/src/execution-health.mjs +26 -26
- package/dist/src/lan-socket-server.mjs +2 -2
- package/dist/src/managed-app-server.mjs +9 -6
- package/dist/src/message-images.mjs +9 -9
- package/dist/src/onboarding.mjs +9 -26
- package/dist/src/plan-pricing.mjs +47 -0
- package/dist/src/platform/README.md +11 -11
- package/dist/src/platform/codex-protocol.mjs +46 -0
- package/dist/src/platform/codex-runtime.mjs +3 -0
- package/dist/src/platform/credential-store.mjs +3 -0
- package/dist/src/platform/desktop-host.mjs +3 -0
- package/dist/src/platform/desktop-project-registration.mjs +3 -0
- package/dist/src/platform/desktop-project-store.mjs +149 -0
- package/dist/src/platform/linux/README.md +3 -3
- package/dist/src/platform/macos/README.md +3 -3
- package/dist/src/platform/macos/codex-runtime.mjs +125 -0
- package/dist/src/platform/macos/credential-store.mjs +10 -0
- package/dist/src/platform/macos/desktop-host.mjs +82 -0
- package/dist/src/platform/macos/desktop-project-registration.mjs +10 -0
- package/dist/src/platform/macos/network-info.mjs +28 -0
- package/dist/src/platform/macos/project-locations.mjs +8 -0
- package/dist/src/platform/macos/resident-startup.mjs +84 -0
- package/dist/src/platform/macos/retained-runtime.mjs +127 -0
- package/dist/src/platform/macos/service-host.mjs +18 -0
- package/dist/src/platform/macos/system.mjs +29 -0
- package/dist/src/platform/macos/user-environment.mjs +7 -0
- package/dist/src/platform/native-package.mjs +46 -0
- package/dist/src/platform/network-info.mjs +3 -0
- package/dist/src/platform/path-identity.mjs +5 -0
- package/dist/src/platform/posix/runtime-paths.mjs +25 -0
- package/dist/src/platform/project-locations.mjs +3 -0
- package/dist/src/platform/runtime-paths.mjs +8 -0
- package/dist/src/platform/select.mjs +5 -0
- package/dist/src/platform/service-host.mjs +3 -0
- package/dist/src/platform/user-environment.mjs +3 -0
- package/dist/src/platform/windows/IsolatedProcess.cs +79 -79
- package/dist/src/platform/windows/background-process.mjs +30 -30
- package/dist/src/platform/windows/codex-runtime.mjs +2 -40
- package/dist/src/platform/windows/desktop-helper.mjs +179 -0
- package/dist/src/platform/windows/desktop-project-registration.mjs +3 -152
- package/dist/src/platform/windows/desktop-runtime.ps1 +10 -10
- package/dist/src/platform/windows/desktop-shortcuts.ps1 +7 -7
- package/dist/src/platform/windows/network-info.mjs +34 -34
- package/dist/src/platform/windows/resident-start.js +20 -20
- package/dist/src/platform/windows/resident-start.ps1 +7 -7
- package/dist/src/platform/windows/resident-startup.ps1 +83 -83
- package/dist/src/platform/windows/resolve-state-root.ps1 +14 -14
- package/dist/src/platform/windows/runtime-paths.mjs +20 -20
- package/dist/src/platform/windows/rustdesk-video-probe.mjs +168 -0
- package/dist/src/platform/windows/service-host.mjs +11 -11
- package/dist/src/platform/windows/start-hidden-console.ps1 +49 -49
- package/dist/src/platform/windows/stop-desktop.ps1 +22 -22
- package/dist/src/platform/windows/user-environment.mjs +50 -50
- package/dist/src/platform/windows/user-environment.ps1 +41 -41
- package/dist/src/project-create.mjs +4 -4
- package/dist/src/runtime-discovery.mjs +47 -43
- package/dist/src/self-relay/account-connections.mjs +52 -52
- package/dist/src/self-relay/admin-cloud.mjs +101 -101
- package/dist/src/self-relay/admin-server.mjs +74 -74
- package/dist/src/self-relay/admin-state.mjs +127 -127
- package/dist/src/self-relay/android-releases.mjs +61 -0
- package/dist/src/self-relay/client.mjs +61 -61
- package/dist/src/self-relay/connector.mjs +36 -20
- package/dist/src/self-relay/debug-allowlist.mjs +33 -33
- package/dist/src/self-relay/demo.mjs +6 -6
- package/dist/src/self-relay/device-store.mjs +84 -84
- package/dist/src/self-relay/lan-authorizations.mjs +42 -42
- package/dist/src/self-relay/lifecycle.mjs +250 -250
- package/dist/src/self-relay/long-pairing.mjs +40 -40
- package/dist/src/self-relay/mysql-state.mjs +105 -105
- package/dist/src/self-relay/p2p-probe.mjs +13 -6
- package/dist/src/self-relay/server.mjs +19 -9
- package/dist/src/self-relay/usage-daily.mjs +55 -55
- package/dist/src/self-relay/windows-route-helper.mjs +75 -75
- package/dist/src/self-relay/wire.mjs +36 -36
- package/dist/src/server.mjs +132 -32
- package/dist/src/service-control.mjs +82 -82
- package/dist/src/service-doctor.mjs +51 -13
- package/dist/src/service-health.mjs +33 -33
- package/dist/src/service-install.mjs +10 -7
- package/dist/src/service-lifecycle.mjs +1 -1
- package/dist/src/service-restart.mjs +81 -81
- package/dist/src/shared-app-server.mjs +16 -7
- package/dist/src/shared-recovery.mjs +146 -144
- package/dist/src/skill-install.mjs +51 -51
- package/dist/src/thread-title-generation.mjs +150 -150
- package/dist/src/turn-model-history.mjs +47 -47
- package/dist/tools/rtc-route-helper.ps1 +99 -99
- package/dist/tools/start-rtc-route-helper.ps1 +15 -15
- package/dist/web/vendor/markdown-it.LICENSE.txt +22 -22
- package/dist/web/vendor/markdown-it.umd.min.js +13 -13
- package/package.json +47 -49
- package/tools/postinstall.mjs +127 -127
- package/node_modules/@img/colour/LICENSE.md +0 -82
- package/node_modules/@img/colour/README.md +0 -15
- package/node_modules/@img/colour/color.cjs +0 -1596
- package/node_modules/@img/colour/index.cjs +0 -1
- package/node_modules/@img/colour/index.d.ts +0 -929
- package/node_modules/@img/colour/package.json +0 -58
- package/node_modules/@img/sharp-win32-x64/LICENSE +0 -191
- package/node_modules/@img/sharp-win32-x64/README.md +0 -59
- package/node_modules/@img/sharp-win32-x64/index.cjs +0 -1
- 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 +0 -40
- package/node_modules/@img/sharp-win32-x64/versions.json +0 -30
- package/node_modules/@node-datachannel/win32-x64-msvc/node_datachannel.node +0 -0
- package/node_modules/@node-datachannel/win32-x64-msvc/package.json +0 -20
- package/node_modules/ansi-regex/index.d.ts +0 -37
- package/node_modules/ansi-regex/index.js +0 -10
- package/node_modules/ansi-regex/license +0 -9
- package/node_modules/ansi-regex/package.json +0 -55
- package/node_modules/ansi-regex/readme.md +0 -78
- package/node_modules/ansi-styles/index.d.ts +0 -345
- package/node_modules/ansi-styles/index.js +0 -163
- package/node_modules/ansi-styles/license +0 -9
- package/node_modules/ansi-styles/package.json +0 -56
- package/node_modules/ansi-styles/readme.md +0 -152
- package/node_modules/camelcase/index.d.ts +0 -63
- package/node_modules/camelcase/index.js +0 -76
- package/node_modules/camelcase/license +0 -9
- package/node_modules/camelcase/package.json +0 -43
- package/node_modules/camelcase/readme.md +0 -99
- package/node_modules/cliui/CHANGELOG.md +0 -76
- package/node_modules/cliui/LICENSE.txt +0 -14
- package/node_modules/cliui/README.md +0 -115
- package/node_modules/cliui/index.js +0 -354
- package/node_modules/cliui/package.json +0 -65
- package/node_modules/color-convert/CHANGELOG.md +0 -54
- package/node_modules/color-convert/LICENSE +0 -21
- package/node_modules/color-convert/README.md +0 -68
- package/node_modules/color-convert/conversions.js +0 -839
- package/node_modules/color-convert/index.js +0 -81
- package/node_modules/color-convert/package.json +0 -48
- package/node_modules/color-convert/route.js +0 -97
- package/node_modules/color-name/LICENSE +0 -8
- package/node_modules/color-name/README.md +0 -11
- package/node_modules/color-name/index.js +0 -152
- package/node_modules/color-name/package.json +0 -28
- package/node_modules/decamelize/index.js +0 -13
- package/node_modules/decamelize/license +0 -21
- package/node_modules/decamelize/package.json +0 -38
- package/node_modules/decamelize/readme.md +0 -48
- package/node_modules/detect-libc/LICENSE +0 -201
- package/node_modules/detect-libc/README.md +0 -163
- package/node_modules/detect-libc/index.d.ts +0 -14
- package/node_modules/detect-libc/lib/detect-libc.js +0 -313
- package/node_modules/detect-libc/lib/elf.js +0 -39
- package/node_modules/detect-libc/lib/filesystem.js +0 -51
- package/node_modules/detect-libc/lib/process.js +0 -24
- package/node_modules/detect-libc/package.json +0 -44
- package/node_modules/dijkstrajs/.travis.yml +0 -4
- package/node_modules/dijkstrajs/CONTRIBUTING.md +0 -8
- package/node_modules/dijkstrajs/LICENSE.md +0 -19
- package/node_modules/dijkstrajs/README.md +0 -18
- package/node_modules/dijkstrajs/dijkstra.js +0 -165
- package/node_modules/dijkstrajs/package.json +0 -60
- package/node_modules/dijkstrajs/test/dijkstra.test.js +0 -96
- package/node_modules/emoji-regex/LICENSE-MIT.txt +0 -20
- package/node_modules/emoji-regex/README.md +0 -73
- package/node_modules/emoji-regex/es2015/index.js +0 -6
- package/node_modules/emoji-regex/es2015/text.js +0 -6
- package/node_modules/emoji-regex/index.d.ts +0 -23
- package/node_modules/emoji-regex/index.js +0 -6
- package/node_modules/emoji-regex/package.json +0 -50
- package/node_modules/emoji-regex/text.js +0 -6
- package/node_modules/find-up/index.d.ts +0 -137
- package/node_modules/find-up/index.js +0 -89
- package/node_modules/find-up/license +0 -9
- package/node_modules/find-up/package.json +0 -53
- package/node_modules/find-up/readme.md +0 -156
- package/node_modules/get-caller-file/LICENSE.md +0 -6
- package/node_modules/get-caller-file/README.md +0 -41
- package/node_modules/get-caller-file/index.d.ts +0 -2
- package/node_modules/get-caller-file/index.js +0 -22
- package/node_modules/get-caller-file/index.js.map +0 -1
- package/node_modules/get-caller-file/package.json +0 -42
- package/node_modules/is-fullwidth-code-point/index.d.ts +0 -17
- package/node_modules/is-fullwidth-code-point/index.js +0 -50
- package/node_modules/is-fullwidth-code-point/license +0 -9
- package/node_modules/is-fullwidth-code-point/package.json +0 -42
- package/node_modules/is-fullwidth-code-point/readme.md +0 -39
- package/node_modules/locate-path/index.d.ts +0 -83
- package/node_modules/locate-path/index.js +0 -65
- package/node_modules/locate-path/license +0 -9
- package/node_modules/locate-path/package.json +0 -45
- package/node_modules/locate-path/readme.md +0 -122
- package/node_modules/node-datachannel/.clang-format +0 -17
- package/node_modules/node-datachannel/.editorconfig +0 -12
- package/node_modules/node-datachannel/.eslintignore +0 -8
- package/node_modules/node-datachannel/.eslintrc.json +0 -27
- package/node_modules/node-datachannel/.gitmodules +0 -3
- package/node_modules/node-datachannel/.prettierignore +0 -7
- package/node_modules/node-datachannel/.prettierrc +0 -13
- package/node_modules/node-datachannel/API.md +0 -247
- package/node_modules/node-datachannel/BULDING.md +0 -26
- package/node_modules/node-datachannel/CMakeLists.txt +0 -153
- package/node_modules/node-datachannel/LICENSE +0 -373
- package/node_modules/node-datachannel/README.md +0 -129
- package/node_modules/node-datachannel/dist/cjs/index.cjs +0 -11
- package/node_modules/node-datachannel/dist/cjs/index.cjs.map +0 -1
- package/node_modules/node-datachannel/dist/cjs/lib/datachannel-stream.cjs +0 -101
- package/node_modules/node-datachannel/dist/cjs/lib/datachannel-stream.cjs.map +0 -1
- package/node_modules/node-datachannel/dist/cjs/lib/index.cjs +0 -91
- package/node_modules/node-datachannel/dist/cjs/lib/index.cjs.map +0 -1
- package/node_modules/node-datachannel/dist/cjs/lib/node-datachannel.cjs +0 -94
- package/node_modules/node-datachannel/dist/cjs/lib/node-datachannel.cjs.map +0 -1
- package/node_modules/node-datachannel/dist/cjs/lib/websocket-server.cjs +0 -45
- package/node_modules/node-datachannel/dist/cjs/lib/websocket-server.cjs.map +0 -1
- package/node_modules/node-datachannel/dist/cjs/lib/websocket.cjs +0 -8
- package/node_modules/node-datachannel/dist/cjs/lib/websocket.cjs.map +0 -1
- package/node_modules/node-datachannel/dist/cjs/polyfill/Events.cjs +0 -86
- package/node_modules/node-datachannel/dist/cjs/polyfill/Events.cjs.map +0 -1
- package/node_modules/node-datachannel/dist/cjs/polyfill/Exception.cjs +0 -34
- package/node_modules/node-datachannel/dist/cjs/polyfill/Exception.cjs.map +0 -1
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCCertificate.cjs +0 -34
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCCertificate.cjs.map +0 -1
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCDataChannel.cjs +0 -214
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCDataChannel.cjs.map +0 -1
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCDtlsTransport.cjs +0 -53
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCDtlsTransport.cjs.map +0 -1
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCError.cjs +0 -83
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCError.cjs.map +0 -1
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCIceCandidate.cjs +0 -132
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCIceCandidate.cjs.map +0 -1
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCIceTransport.cjs +0 -94
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCIceTransport.cjs.map +0 -1
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCPeerConnection.cjs +0 -434
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCPeerConnection.cjs.map +0 -1
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCSctpTransport.cjs +0 -59
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCSctpTransport.cjs.map +0 -1
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCSessionDescription.cjs +0 -45
- package/node_modules/node-datachannel/dist/cjs/polyfill/RTCSessionDescription.cjs.map +0 -1
- package/node_modules/node-datachannel/dist/cjs/polyfill/index.cjs +0 -42
- package/node_modules/node-datachannel/dist/cjs/polyfill/index.cjs.map +0 -1
- package/node_modules/node-datachannel/dist/esm/index.mjs +0 -8
- package/node_modules/node-datachannel/dist/esm/index.mjs.map +0 -1
- package/node_modules/node-datachannel/dist/esm/lib/datachannel-stream.mjs +0 -78
- package/node_modules/node-datachannel/dist/esm/lib/datachannel-stream.mjs.map +0 -1
- package/node_modules/node-datachannel/dist/esm/lib/index.mjs +0 -64
- package/node_modules/node-datachannel/dist/esm/lib/index.mjs.map +0 -1
- package/node_modules/node-datachannel/dist/esm/lib/node-datachannel.mjs +0 -78
- package/node_modules/node-datachannel/dist/esm/lib/node-datachannel.mjs.map +0 -1
- package/node_modules/node-datachannel/dist/esm/lib/websocket-server.mjs +0 -43
- package/node_modules/node-datachannel/dist/esm/lib/websocket-server.mjs.map +0 -1
- package/node_modules/node-datachannel/dist/esm/lib/websocket.mjs +0 -6
- package/node_modules/node-datachannel/dist/esm/lib/websocket.mjs.map +0 -1
- package/node_modules/node-datachannel/dist/esm/polyfill/Events.mjs +0 -82
- package/node_modules/node-datachannel/dist/esm/polyfill/Events.mjs.map +0 -1
- package/node_modules/node-datachannel/dist/esm/polyfill/Exception.mjs +0 -28
- package/node_modules/node-datachannel/dist/esm/polyfill/Exception.mjs.map +0 -1
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCCertificate.mjs +0 -30
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCCertificate.mjs.map +0 -1
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCDataChannel.mjs +0 -210
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCDataChannel.mjs.map +0 -1
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCDtlsTransport.mjs +0 -49
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCDtlsTransport.mjs.map +0 -1
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCError.mjs +0 -79
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCError.mjs.map +0 -1
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCIceCandidate.mjs +0 -128
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCIceCandidate.mjs.map +0 -1
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCIceTransport.mjs +0 -89
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCIceTransport.mjs.map +0 -1
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCPeerConnection.mjs +0 -430
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCPeerConnection.mjs.map +0 -1
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCSctpTransport.mjs +0 -55
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCSctpTransport.mjs.map +0 -1
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCSessionDescription.mjs +0 -41
- package/node_modules/node-datachannel/dist/esm/polyfill/RTCSessionDescription.mjs.map +0 -1
- package/node_modules/node-datachannel/dist/esm/polyfill/index.mjs +0 -27
- package/node_modules/node-datachannel/dist/esm/polyfill/index.mjs.map +0 -1
- package/node_modules/node-datachannel/dist/types/lib/datachannel-stream.d.ts +0 -24
- package/node_modules/node-datachannel/dist/types/lib/index.d.ts +0 -241
- package/node_modules/node-datachannel/dist/types/lib/types.d.ts +0 -119
- package/node_modules/node-datachannel/dist/types/lib/websocket-server.d.ts +0 -13
- package/node_modules/node-datachannel/dist/types/lib/websocket.d.ts +0 -25
- package/node_modules/node-datachannel/dist/types/polyfill/Events.d.ts +0 -15
- package/node_modules/node-datachannel/dist/types/polyfill/RTCCertificate.d.ts +0 -9
- package/node_modules/node-datachannel/dist/types/polyfill/RTCDataChannel.d.ts +0 -29
- package/node_modules/node-datachannel/dist/types/polyfill/RTCDtlsTransport.d.ts +0 -15
- package/node_modules/node-datachannel/dist/types/polyfill/RTCError.d.ts +0 -17
- package/node_modules/node-datachannel/dist/types/polyfill/RTCIceCandidate.d.ts +0 -21
- package/node_modules/node-datachannel/dist/types/polyfill/RTCIceTransport.d.ts +0 -30
- package/node_modules/node-datachannel/dist/types/polyfill/RTCPeerConnection.d.ts +0 -64
- package/node_modules/node-datachannel/dist/types/polyfill/RTCSctpTransport.d.ts +0 -15
- package/node_modules/node-datachannel/dist/types/polyfill/RTCSessionDescription.d.ts +0 -10
- package/node_modules/node-datachannel/dist/types/polyfill/index.d.ts +0 -26
- package/node_modules/node-datachannel/jest.config.ts +0 -14
- package/node_modules/node-datachannel/package.json +0 -133
- package/node_modules/node-datachannel/rollup.config.mjs +0 -67
- package/node_modules/node-datachannel/src/cpp/data-channel-wrapper.cpp +0 -530
- package/node_modules/node-datachannel/src/cpp/data-channel-wrapper.h +0 -63
- package/node_modules/node-datachannel/src/cpp/ice-udp-mux-listener-wrapper.cpp +0 -172
- package/node_modules/node-datachannel/src/cpp/ice-udp-mux-listener-wrapper.h +0 -43
- package/node_modules/node-datachannel/src/cpp/main.cpp +0 -58
- package/node_modules/node-datachannel/src/cpp/media-audio-wrapper.cpp +0 -457
- package/node_modules/node-datachannel/src/cpp/media-audio-wrapper.h +0 -52
- package/node_modules/node-datachannel/src/cpp/media-av1packetization.cpp +0 -24
- package/node_modules/node-datachannel/src/cpp/media-av1packetization.h +0 -11
- package/node_modules/node-datachannel/src/cpp/media-av1rtppacketizer-wrapper.cpp +0 -126
- package/node_modules/node-datachannel/src/cpp/media-av1rtppacketizer-wrapper.h +0 -29
- package/node_modules/node-datachannel/src/cpp/media-direction.cpp +0 -43
- package/node_modules/node-datachannel/src/cpp/media-direction.h +0 -10
- package/node_modules/node-datachannel/src/cpp/media-h264rtppacketizer-wrapper.cpp +0 -126
- package/node_modules/node-datachannel/src/cpp/media-h264rtppacketizer-wrapper.h +0 -30
- package/node_modules/node-datachannel/src/cpp/media-h265rtppacketizer-wrapper.cpp +0 -126
- package/node_modules/node-datachannel/src/cpp/media-h265rtppacketizer-wrapper.h +0 -30
- package/node_modules/node-datachannel/src/cpp/media-h26xseparator.cpp +0 -32
- package/node_modules/node-datachannel/src/cpp/media-h26xseparator.h +0 -11
- package/node_modules/node-datachannel/src/cpp/media-mediahandler-helper.cpp +0 -31
- package/node_modules/node-datachannel/src/cpp/media-mediahandler-helper.h +0 -11
- package/node_modules/node-datachannel/src/cpp/media-pacinghandler-wrapper.cpp +0 -79
- package/node_modules/node-datachannel/src/cpp/media-pacinghandler-wrapper.h +0 -28
- package/node_modules/node-datachannel/src/cpp/media-rtcpnackresponder-wrapper.cpp +0 -68
- package/node_modules/node-datachannel/src/cpp/media-rtcpnackresponder-wrapper.h +0 -28
- package/node_modules/node-datachannel/src/cpp/media-rtcpreceivingsession-wrapper.cpp +0 -57
- package/node_modules/node-datachannel/src/cpp/media-rtcpreceivingsession-wrapper.h +0 -28
- package/node_modules/node-datachannel/src/cpp/media-rtcpsrreporter-wrapper.cpp +0 -93
- package/node_modules/node-datachannel/src/cpp/media-rtcpsrreporter-wrapper.h +0 -30
- package/node_modules/node-datachannel/src/cpp/media-rtppacketizationconfig-wrapper.cpp +0 -167
- package/node_modules/node-datachannel/src/cpp/media-rtppacketizationconfig-wrapper.h +0 -35
- package/node_modules/node-datachannel/src/cpp/media-rtppacketizer-wrapper.cpp +0 -95
- package/node_modules/node-datachannel/src/cpp/media-rtppacketizer-wrapper.h +0 -30
- package/node_modules/node-datachannel/src/cpp/media-track-wrapper.cpp +0 -458
- package/node_modules/node-datachannel/src/cpp/media-track-wrapper.h +0 -61
- package/node_modules/node-datachannel/src/cpp/media-video-wrapper.cpp +0 -526
- package/node_modules/node-datachannel/src/cpp/media-video-wrapper.h +0 -56
- package/node_modules/node-datachannel/src/cpp/peer-connection-wrapper.cpp +0 -1298
- package/node_modules/node-datachannel/src/cpp/peer-connection-wrapper.h +0 -89
- package/node_modules/node-datachannel/src/cpp/rtc-wrapper.cpp +0 -205
- package/node_modules/node-datachannel/src/cpp/rtc-wrapper.h +0 -24
- package/node_modules/node-datachannel/src/cpp/thread-safe-callback.cpp +0 -57
- package/node_modules/node-datachannel/src/cpp/thread-safe-callback.h +0 -47
- package/node_modules/node-datachannel/src/cpp/web-socket-server-wrapper.cpp +0 -275
- package/node_modules/node-datachannel/src/cpp/web-socket-server-wrapper.h +0 -41
- package/node_modules/node-datachannel/src/cpp/web-socket-wrapper.cpp +0 -796
- package/node_modules/node-datachannel/src/cpp/web-socket-wrapper.h +0 -63
- package/node_modules/node-datachannel/src/index.ts +0 -9
- package/node_modules/node-datachannel/src/lib/datachannel-stream.ts +0 -100
- package/node_modules/node-datachannel/src/lib/index.ts +0 -290
- package/node_modules/node-datachannel/src/lib/node-datachannel.ts +0 -84
- package/node_modules/node-datachannel/src/lib/types.ts +0 -169
- package/node_modules/node-datachannel/src/lib/websocket-server.ts +0 -37
- package/node_modules/node-datachannel/src/lib/websocket.ts +0 -26
- package/node_modules/node-datachannel/src/polyfill/Events.ts +0 -82
- package/node_modules/node-datachannel/src/polyfill/Exception.ts +0 -37
- package/node_modules/node-datachannel/src/polyfill/README.md +0 -41
- package/node_modules/node-datachannel/src/polyfill/RTCCertificate.ts +0 -21
- package/node_modules/node-datachannel/src/polyfill/RTCDataChannel.ts +0 -225
- package/node_modules/node-datachannel/src/polyfill/RTCDtlsTransport.ts +0 -46
- package/node_modules/node-datachannel/src/polyfill/RTCError.ts +0 -78
- package/node_modules/node-datachannel/src/polyfill/RTCIceCandidate.ts +0 -128
- package/node_modules/node-datachannel/src/polyfill/RTCIceTransport.ts +0 -90
- package/node_modules/node-datachannel/src/polyfill/RTCPeerConnection.ts +0 -527
- package/node_modules/node-datachannel/src/polyfill/RTCSctpTransport.ts +0 -51
- package/node_modules/node-datachannel/src/polyfill/RTCSessionDescription.ts +0 -41
- package/node_modules/node-datachannel/src/polyfill/index.ts +0 -38
- package/node_modules/node-datachannel/tsconfig.json +0 -21
- package/node_modules/p-limit/index.d.ts +0 -38
- package/node_modules/p-limit/index.js +0 -57
- package/node_modules/p-limit/license +0 -9
- package/node_modules/p-limit/package.json +0 -52
- package/node_modules/p-limit/readme.md +0 -101
- package/node_modules/p-locate/index.d.ts +0 -64
- package/node_modules/p-locate/index.js +0 -52
- package/node_modules/p-locate/license +0 -9
- package/node_modules/p-locate/package.json +0 -53
- package/node_modules/p-locate/readme.md +0 -90
- package/node_modules/p-try/index.d.ts +0 -39
- package/node_modules/p-try/index.js +0 -9
- package/node_modules/p-try/license +0 -9
- package/node_modules/p-try/package.json +0 -42
- package/node_modules/p-try/readme.md +0 -58
- package/node_modules/path-exists/index.d.ts +0 -28
- package/node_modules/path-exists/index.js +0 -23
- package/node_modules/path-exists/license +0 -9
- package/node_modules/path-exists/package.json +0 -39
- package/node_modules/path-exists/readme.md +0 -52
- package/node_modules/pngjs/.eslintignore +0 -2
- package/node_modules/pngjs/.eslintrc.json +0 -19
- package/node_modules/pngjs/.prettierignore +0 -3
- package/node_modules/pngjs/LICENSE +0 -20
- package/node_modules/pngjs/README.md +0 -429
- package/node_modules/pngjs/browser.js +0 -16096
- package/node_modules/pngjs/coverage/lcov-report/base.css +0 -354
- package/node_modules/pngjs/coverage/lcov-report/bitmapper.js.html +0 -881
- package/node_modules/pngjs/coverage/lcov-report/bitpacker.js.html +0 -554
- package/node_modules/pngjs/coverage/lcov-report/block-navigation.js +0 -77
- package/node_modules/pngjs/coverage/lcov-report/chunkstream.js.html +0 -647
- package/node_modules/pngjs/coverage/lcov-report/constants.js.html +0 -176
- package/node_modules/pngjs/coverage/lcov-report/crc.js.html +0 -200
- package/node_modules/pngjs/coverage/lcov-report/favicon.png +0 -0
- package/node_modules/pngjs/coverage/lcov-report/filter-pack.js.html +0 -593
- package/node_modules/pngjs/coverage/lcov-report/filter-parse-async.js.html +0 -152
- package/node_modules/pngjs/coverage/lcov-report/filter-parse-sync.js.html +0 -143
- package/node_modules/pngjs/coverage/lcov-report/filter-parse.js.html +0 -611
- package/node_modules/pngjs/coverage/lcov-report/format-normaliser.js.html +0 -359
- package/node_modules/pngjs/coverage/lcov-report/index.html +0 -426
- package/node_modules/pngjs/coverage/lcov-report/interlace.js.html +0 -365
- package/node_modules/pngjs/coverage/lcov-report/packer-async.js.html +0 -230
- package/node_modules/pngjs/coverage/lcov-report/packer-sync.js.html +0 -248
- package/node_modules/pngjs/coverage/lcov-report/packer.js.html +0 -467
- package/node_modules/pngjs/coverage/lcov-report/paeth-predictor.js.html +0 -128
- package/node_modules/pngjs/coverage/lcov-report/parser-async.js.html +0 -575
- package/node_modules/pngjs/coverage/lcov-report/parser-sync.js.html +0 -404
- package/node_modules/pngjs/coverage/lcov-report/parser.js.html +0 -950
- package/node_modules/pngjs/coverage/lcov-report/png-sync.js.html +0 -116
- package/node_modules/pngjs/coverage/lcov-report/png.js.html +0 -662
- package/node_modules/pngjs/coverage/lcov-report/prettify.css +0 -101
- package/node_modules/pngjs/coverage/lcov-report/prettify.js +0 -1007
- package/node_modules/pngjs/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/node_modules/pngjs/coverage/lcov-report/sorter.js +0 -169
- package/node_modules/pngjs/coverage/lcov-report/sync-inflate.js.html +0 -584
- package/node_modules/pngjs/coverage/lcov-report/sync-reader.js.html +0 -215
- package/node_modules/pngjs/coverage/lcov.info +0 -2177
- package/node_modules/pngjs/lib/bitmapper.js +0 -267
- package/node_modules/pngjs/lib/bitpacker.js +0 -158
- package/node_modules/pngjs/lib/chunkstream.js +0 -189
- package/node_modules/pngjs/lib/constants.js +0 -32
- package/node_modules/pngjs/lib/crc.js +0 -40
- package/node_modules/pngjs/lib/filter-pack.js +0 -171
- package/node_modules/pngjs/lib/filter-parse-async.js +0 -24
- package/node_modules/pngjs/lib/filter-parse-sync.js +0 -21
- package/node_modules/pngjs/lib/filter-parse.js +0 -177
- package/node_modules/pngjs/lib/format-normaliser.js +0 -93
- package/node_modules/pngjs/lib/interlace.js +0 -95
- package/node_modules/pngjs/lib/packer-async.js +0 -50
- package/node_modules/pngjs/lib/packer-sync.js +0 -56
- package/node_modules/pngjs/lib/packer.js +0 -129
- package/node_modules/pngjs/lib/paeth-predictor.js +0 -16
- package/node_modules/pngjs/lib/parser-async.js +0 -165
- package/node_modules/pngjs/lib/parser-sync.js +0 -108
- package/node_modules/pngjs/lib/parser.js +0 -290
- package/node_modules/pngjs/lib/png-sync.js +0 -12
- package/node_modules/pngjs/lib/png.js +0 -194
- package/node_modules/pngjs/lib/sync-inflate.js +0 -168
- package/node_modules/pngjs/lib/sync-reader.js +0 -45
- package/node_modules/pngjs/package.json +0 -73
- package/node_modules/qrcode/README.md +0 -770
- package/node_modules/qrcode/bin/qrcode +0 -159
- package/node_modules/qrcode/helper/to-sjis-browser.js +0 -2
- package/node_modules/qrcode/helper/to-sjis.js +0 -105
- package/node_modules/qrcode/lib/browser.js +0 -76
- package/node_modules/qrcode/lib/can-promise.js +0 -7
- package/node_modules/qrcode/lib/core/alignment-pattern.js +0 -83
- package/node_modules/qrcode/lib/core/alphanumeric-data.js +0 -59
- package/node_modules/qrcode/lib/core/bit-buffer.js +0 -37
- package/node_modules/qrcode/lib/core/bit-matrix.js +0 -65
- package/node_modules/qrcode/lib/core/byte-data.js +0 -30
- package/node_modules/qrcode/lib/core/error-correction-code.js +0 -135
- package/node_modules/qrcode/lib/core/error-correction-level.js +0 -50
- package/node_modules/qrcode/lib/core/finder-pattern.js +0 -22
- package/node_modules/qrcode/lib/core/format-info.js +0 -29
- package/node_modules/qrcode/lib/core/galois-field.js +0 -69
- package/node_modules/qrcode/lib/core/kanji-data.js +0 -54
- package/node_modules/qrcode/lib/core/mask-pattern.js +0 -234
- package/node_modules/qrcode/lib/core/mode.js +0 -167
- package/node_modules/qrcode/lib/core/numeric-data.js +0 -43
- package/node_modules/qrcode/lib/core/polynomial.js +0 -62
- package/node_modules/qrcode/lib/core/qrcode.js +0 -495
- package/node_modules/qrcode/lib/core/reed-solomon-encoder.js +0 -56
- package/node_modules/qrcode/lib/core/regex.js +0 -31
- package/node_modules/qrcode/lib/core/segments.js +0 -330
- package/node_modules/qrcode/lib/core/utils.js +0 -63
- package/node_modules/qrcode/lib/core/version-check.js +0 -9
- package/node_modules/qrcode/lib/core/version.js +0 -163
- package/node_modules/qrcode/lib/index.js +0 -12
- package/node_modules/qrcode/lib/renderer/canvas.js +0 -63
- package/node_modules/qrcode/lib/renderer/png.js +0 -78
- package/node_modules/qrcode/lib/renderer/svg-tag.js +0 -81
- package/node_modules/qrcode/lib/renderer/svg.js +0 -19
- package/node_modules/qrcode/lib/renderer/terminal/terminal-small.js +0 -85
- package/node_modules/qrcode/lib/renderer/terminal/terminal.js +0 -49
- package/node_modules/qrcode/lib/renderer/terminal.js +0 -9
- package/node_modules/qrcode/lib/renderer/utf8.js +0 -71
- package/node_modules/qrcode/lib/renderer/utils.js +0 -99
- package/node_modules/qrcode/lib/server.js +0 -138
- package/node_modules/qrcode/license +0 -10
- package/node_modules/qrcode/package.json +0 -77
- package/node_modules/require-directory/.jshintrc +0 -67
- package/node_modules/require-directory/.npmignore +0 -1
- package/node_modules/require-directory/.travis.yml +0 -3
- package/node_modules/require-directory/LICENSE +0 -22
- package/node_modules/require-directory/README.markdown +0 -184
- package/node_modules/require-directory/index.js +0 -86
- package/node_modules/require-directory/package.json +0 -40
- package/node_modules/require-main-filename/CHANGELOG.md +0 -26
- package/node_modules/require-main-filename/LICENSE.txt +0 -14
- package/node_modules/require-main-filename/README.md +0 -26
- package/node_modules/require-main-filename/index.js +0 -18
- package/node_modules/require-main-filename/package.json +0 -35
- package/node_modules/semver/LICENSE +0 -15
- package/node_modules/semver/README.md +0 -680
- package/node_modules/semver/bin/semver.js +0 -195
- package/node_modules/semver/classes/comparator.js +0 -143
- package/node_modules/semver/classes/index.js +0 -7
- package/node_modules/semver/classes/range.js +0 -577
- package/node_modules/semver/classes/semver.js +0 -350
- package/node_modules/semver/functions/clean.js +0 -8
- package/node_modules/semver/functions/cmp.js +0 -54
- package/node_modules/semver/functions/coerce.js +0 -62
- package/node_modules/semver/functions/compare-build.js +0 -9
- package/node_modules/semver/functions/compare-loose.js +0 -5
- package/node_modules/semver/functions/compare.js +0 -7
- package/node_modules/semver/functions/diff.js +0 -60
- package/node_modules/semver/functions/eq.js +0 -5
- package/node_modules/semver/functions/gt.js +0 -5
- package/node_modules/semver/functions/gte.js +0 -5
- package/node_modules/semver/functions/inc.js +0 -21
- package/node_modules/semver/functions/lt.js +0 -5
- package/node_modules/semver/functions/lte.js +0 -5
- package/node_modules/semver/functions/major.js +0 -5
- package/node_modules/semver/functions/minor.js +0 -5
- package/node_modules/semver/functions/neq.js +0 -5
- package/node_modules/semver/functions/parse.js +0 -18
- package/node_modules/semver/functions/patch.js +0 -5
- package/node_modules/semver/functions/prerelease.js +0 -8
- package/node_modules/semver/functions/rcompare.js +0 -5
- package/node_modules/semver/functions/rsort.js +0 -5
- package/node_modules/semver/functions/satisfies.js +0 -12
- package/node_modules/semver/functions/sort.js +0 -5
- package/node_modules/semver/functions/truncate.js +0 -48
- package/node_modules/semver/functions/valid.js +0 -8
- package/node_modules/semver/index.js +0 -93
- package/node_modules/semver/internal/constants.js +0 -37
- package/node_modules/semver/internal/debug.js +0 -11
- package/node_modules/semver/internal/identifiers.js +0 -29
- package/node_modules/semver/internal/lrucache.js +0 -42
- package/node_modules/semver/internal/parse-options.js +0 -17
- package/node_modules/semver/internal/re.js +0 -223
- package/node_modules/semver/package.json +0 -78
- package/node_modules/semver/preload.js +0 -4
- package/node_modules/semver/range.bnf +0 -17
- package/node_modules/semver/ranges/gtr.js +0 -6
- package/node_modules/semver/ranges/intersects.js +0 -9
- package/node_modules/semver/ranges/ltr.js +0 -6
- package/node_modules/semver/ranges/max-satisfying.js +0 -27
- package/node_modules/semver/ranges/min-satisfying.js +0 -26
- package/node_modules/semver/ranges/min-version.js +0 -63
- package/node_modules/semver/ranges/outside.js +0 -82
- package/node_modules/semver/ranges/simplify.js +0 -49
- package/node_modules/semver/ranges/subset.js +0 -249
- package/node_modules/semver/ranges/to-comparators.js +0 -10
- package/node_modules/semver/ranges/valid.js +0 -13
- package/node_modules/set-blocking/CHANGELOG.md +0 -26
- package/node_modules/set-blocking/LICENSE.txt +0 -14
- package/node_modules/set-blocking/README.md +0 -31
- package/node_modules/set-blocking/index.js +0 -7
- package/node_modules/set-blocking/package.json +0 -42
- package/node_modules/sharp/LICENSE +0 -191
- package/node_modules/sharp/README.md +0 -112
- package/node_modules/sharp/dist/channel.cjs +0 -177
- package/node_modules/sharp/dist/channel.mjs +0 -177
- package/node_modules/sharp/dist/colour.cjs +0 -199
- package/node_modules/sharp/dist/colour.mjs +0 -199
- package/node_modules/sharp/dist/composite.cjs +0 -213
- package/node_modules/sharp/dist/composite.mjs +0 -213
- package/node_modules/sharp/dist/constructor.cjs +0 -511
- package/node_modules/sharp/dist/constructor.mjs +0 -511
- package/node_modules/sharp/dist/index.cjs +0 -25
- package/node_modules/sharp/dist/index.d.cts +0 -1999
- package/node_modules/sharp/dist/index.d.mts +0 -2046
- package/node_modules/sharp/dist/index.mjs +0 -25
- package/node_modules/sharp/dist/input.cjs +0 -819
- package/node_modules/sharp/dist/input.mjs +0 -819
- package/node_modules/sharp/dist/is.cjs +0 -143
- package/node_modules/sharp/dist/is.mjs +0 -143
- package/node_modules/sharp/dist/libvips.cjs +0 -212
- package/node_modules/sharp/dist/libvips.mjs +0 -212
- package/node_modules/sharp/dist/operation.cjs +0 -1002
- package/node_modules/sharp/dist/operation.mjs +0 -1002
- package/node_modules/sharp/dist/output.cjs +0 -1785
- package/node_modules/sharp/dist/output.mjs +0 -1785
- package/node_modules/sharp/dist/resize.cjs +0 -617
- package/node_modules/sharp/dist/resize.mjs +0 -617
- package/node_modules/sharp/dist/sharp.cjs +0 -174
- package/node_modules/sharp/dist/sharp.mjs +0 -174
- package/node_modules/sharp/dist/utility.cjs +0 -301
- package/node_modules/sharp/dist/utility.mjs +0 -301
- package/node_modules/sharp/install/build.js +0 -38
- package/node_modules/sharp/lib/index.d.ts +0 -1999
- package/node_modules/sharp/package.json +0 -227
- package/node_modules/sharp/src/binding.gyp +0 -303
- package/node_modules/sharp/src/common.cc +0 -1186
- package/node_modules/sharp/src/common.h +0 -421
- package/node_modules/sharp/src/metadata.cc +0 -404
- package/node_modules/sharp/src/metadata.h +0 -95
- package/node_modules/sharp/src/operations.cc +0 -516
- package/node_modules/sharp/src/operations.h +0 -137
- package/node_modules/sharp/src/pipeline.cc +0 -1948
- package/node_modules/sharp/src/pipeline.h +0 -422
- package/node_modules/sharp/src/sharp.cc +0 -43
- package/node_modules/sharp/src/stats.cc +0 -186
- package/node_modules/sharp/src/stats.h +0 -62
- package/node_modules/sharp/src/utilities.cc +0 -289
- package/node_modules/sharp/src/utilities.h +0 -22
- package/node_modules/string-width/index.d.ts +0 -29
- package/node_modules/string-width/index.js +0 -47
- package/node_modules/string-width/license +0 -9
- package/node_modules/string-width/package.json +0 -56
- package/node_modules/string-width/readme.md +0 -50
- package/node_modules/strip-ansi/index.d.ts +0 -17
- package/node_modules/strip-ansi/index.js +0 -4
- package/node_modules/strip-ansi/license +0 -9
- package/node_modules/strip-ansi/package.json +0 -54
- package/node_modules/strip-ansi/readme.md +0 -46
- package/node_modules/which-module/LICENSE +0 -13
- package/node_modules/which-module/README.md +0 -58
- package/node_modules/which-module/index.js +0 -9
- package/node_modules/which-module/package.json +0 -41
- package/node_modules/wrap-ansi/index.js +0 -186
- package/node_modules/wrap-ansi/license +0 -9
- package/node_modules/wrap-ansi/package.json +0 -61
- package/node_modules/wrap-ansi/readme.md +0 -97
- package/node_modules/ws/LICENSE +0 -20
- package/node_modules/ws/README.md +0 -548
- package/node_modules/ws/browser.js +0 -8
- package/node_modules/ws/index.js +0 -22
- package/node_modules/ws/lib/buffer-util.js +0 -131
- package/node_modules/ws/lib/constants.js +0 -19
- package/node_modules/ws/lib/event-target.js +0 -292
- package/node_modules/ws/lib/extension.js +0 -203
- package/node_modules/ws/lib/limiter.js +0 -55
- package/node_modules/ws/lib/permessage-deflate.js +0 -530
- package/node_modules/ws/lib/receiver.js +0 -743
- package/node_modules/ws/lib/sender.js +0 -607
- package/node_modules/ws/lib/stream.js +0 -161
- package/node_modules/ws/lib/subprotocol.js +0 -62
- package/node_modules/ws/lib/validation.js +0 -152
- package/node_modules/ws/lib/websocket-server.js +0 -562
- package/node_modules/ws/lib/websocket.js +0 -1407
- package/node_modules/ws/package.json +0 -74
- package/node_modules/ws/wrapper.mjs +0 -21
- package/node_modules/y18n/CHANGELOG.md +0 -35
- package/node_modules/y18n/LICENSE +0 -13
- package/node_modules/y18n/README.md +0 -109
- package/node_modules/y18n/index.js +0 -188
- package/node_modules/y18n/package.json +0 -39
- package/node_modules/yargs/CHANGELOG.md +0 -420
- package/node_modules/yargs/LICENSE +0 -21
- package/node_modules/yargs/README.md +0 -140
- package/node_modules/yargs/build/lib/apply-extends.d.ts +0 -2
- package/node_modules/yargs/build/lib/apply-extends.js +0 -65
- package/node_modules/yargs/build/lib/argsert.d.ts +0 -2
- package/node_modules/yargs/build/lib/argsert.js +0 -65
- package/node_modules/yargs/build/lib/command.d.ts +0 -64
- package/node_modules/yargs/build/lib/command.js +0 -416
- package/node_modules/yargs/build/lib/common-types.d.ts +0 -36
- package/node_modules/yargs/build/lib/common-types.js +0 -25
- package/node_modules/yargs/build/lib/completion-templates.d.ts +0 -2
- package/node_modules/yargs/build/lib/completion-templates.js +0 -50
- package/node_modules/yargs/build/lib/completion.d.ts +0 -21
- package/node_modules/yargs/build/lib/completion.js +0 -135
- package/node_modules/yargs/build/lib/is-promise.d.ts +0 -1
- package/node_modules/yargs/build/lib/is-promise.js +0 -9
- package/node_modules/yargs/build/lib/levenshtein.d.ts +0 -1
- package/node_modules/yargs/build/lib/levenshtein.js +0 -58
- package/node_modules/yargs/build/lib/middleware.d.ts +0 -10
- package/node_modules/yargs/build/lib/middleware.js +0 -57
- package/node_modules/yargs/build/lib/obj-filter.d.ts +0 -1
- package/node_modules/yargs/build/lib/obj-filter.js +0 -14
- package/node_modules/yargs/build/lib/parse-command.d.ts +0 -11
- package/node_modules/yargs/build/lib/parse-command.js +0 -36
- package/node_modules/yargs/build/lib/process-argv.d.ts +0 -2
- package/node_modules/yargs/build/lib/process-argv.js +0 -31
- package/node_modules/yargs/build/lib/usage.d.ts +0 -49
- package/node_modules/yargs/build/lib/usage.js +0 -540
- package/node_modules/yargs/build/lib/validation.d.ts +0 -34
- package/node_modules/yargs/build/lib/validation.js +0 -330
- package/node_modules/yargs/build/lib/yargs.d.ts +0 -274
- package/node_modules/yargs/build/lib/yargs.js +0 -1190
- package/node_modules/yargs/build/lib/yerror.d.ts +0 -4
- package/node_modules/yargs/build/lib/yerror.js +0 -11
- package/node_modules/yargs/index.js +0 -40
- package/node_modules/yargs/locales/be.json +0 -46
- package/node_modules/yargs/locales/de.json +0 -46
- package/node_modules/yargs/locales/en.json +0 -51
- package/node_modules/yargs/locales/es.json +0 -46
- package/node_modules/yargs/locales/fi.json +0 -49
- package/node_modules/yargs/locales/fr.json +0 -53
- package/node_modules/yargs/locales/hi.json +0 -49
- package/node_modules/yargs/locales/hu.json +0 -46
- package/node_modules/yargs/locales/id.json +0 -50
- package/node_modules/yargs/locales/it.json +0 -46
- package/node_modules/yargs/locales/ja.json +0 -51
- package/node_modules/yargs/locales/ko.json +0 -49
- package/node_modules/yargs/locales/nb.json +0 -44
- package/node_modules/yargs/locales/nl.json +0 -49
- package/node_modules/yargs/locales/nn.json +0 -44
- package/node_modules/yargs/locales/pirate.json +0 -13
- package/node_modules/yargs/locales/pl.json +0 -49
- package/node_modules/yargs/locales/pt.json +0 -45
- package/node_modules/yargs/locales/pt_BR.json +0 -48
- package/node_modules/yargs/locales/ru.json +0 -46
- package/node_modules/yargs/locales/th.json +0 -46
- package/node_modules/yargs/locales/tr.json +0 -48
- package/node_modules/yargs/locales/zh_CN.json +0 -48
- package/node_modules/yargs/locales/zh_TW.json +0 -47
- package/node_modules/yargs/package.json +0 -92
- package/node_modules/yargs/yargs.js +0 -14
- package/node_modules/yargs-parser/CHANGELOG.md +0 -601
- package/node_modules/yargs-parser/LICENSE.txt +0 -14
- package/node_modules/yargs-parser/README.md +0 -449
- package/node_modules/yargs-parser/index.js +0 -1032
- package/node_modules/yargs-parser/lib/tokenize-arg-string.js +0 -40
- package/node_modules/yargs-parser/package.json +0 -46
|
@@ -8,6 +8,17 @@
|
|
|
8
8
|
const elicitation = 'mcpServer/elicitation/request';
|
|
9
9
|
const equal = (a, b) => JSON.stringify(a) === JSON.stringify(b);
|
|
10
10
|
const approvalId = request => 'approval:' + (request.params.turnId || '') + ':' + typeof request.id + ':' + request.id;
|
|
11
|
+
function confirmation(request) {
|
|
12
|
+
const p = request.params || {}, value = p._meta?.['openai/confirmation'], schema = p.requestedSchema;
|
|
13
|
+
if (request.method !== elicitation || p.mode !== 'form' || value?.version !== 1
|
|
14
|
+
|| typeof value.field !== 'string' || schema?.type !== 'object'
|
|
15
|
+
|| Object.keys(schema.properties || {}).length !== 1 || schema.properties[value.field]?.type !== 'boolean'
|
|
16
|
+
|| schema.required?.length !== 1 || schema.required[0] !== value.field) return null;
|
|
17
|
+
return value;
|
|
18
|
+
}
|
|
19
|
+
function confirmationResult(request, decision) {
|
|
20
|
+
return { action: decision, content: decision === 'accept' ? { [confirmation(request).field]: true } : null, _meta: null };
|
|
21
|
+
}
|
|
11
22
|
function browserAccess(request) {
|
|
12
23
|
const p = request.params || {}, meta = p._meta || {};
|
|
13
24
|
if (request.method !== elicitation || p.mode !== 'form' || meta.tool_name !== 'access_browser_origin'
|
|
@@ -88,6 +99,7 @@
|
|
|
88
99
|
: decision === 'allowSession' ? { persist: 'session' } : null };
|
|
89
100
|
}
|
|
90
101
|
function decisions(request) {
|
|
102
|
+
if (confirmation(request)) return ['decline', 'accept'];
|
|
91
103
|
if (request.method === command) return request.params.availableDecisions ?? ['accept', 'acceptForSession', 'decline', 'cancel'];
|
|
92
104
|
if (request.method === file) return ['accept', 'acceptForSession', 'decline', 'cancel'];
|
|
93
105
|
const action = browserAction(request);
|
|
@@ -101,6 +113,10 @@
|
|
|
101
113
|
return [];
|
|
102
114
|
}
|
|
103
115
|
function validate(request, result) {
|
|
116
|
+
if (confirmation(request)) {
|
|
117
|
+
if (!decisions(request).some(decision => equal(confirmationResult(request, decision), result))) throw new Error('确认结果不属于当前请求');
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
104
120
|
if ([command, file].includes(request.method)) {
|
|
105
121
|
if (!result || Object.keys(result).length !== 1 || !decisions(request).some(value => equal(value, result.decision))) throw new Error('审批选项不属于当前请求');
|
|
106
122
|
return;
|
|
@@ -199,5 +215,5 @@
|
|
|
199
215
|
return { submitted: true };
|
|
200
216
|
}
|
|
201
217
|
}
|
|
202
|
-
return { Store, decisions, validate, command, file, input, elicitation, browserAccess, browserAction, browserActionResult, computerAppAccess, computerAppResult, mcpToolApproval, mcpToolResult };
|
|
218
|
+
return { Store, decisions, validate, command, file, input, elicitation, browserAccess, browserAction, browserActionResult, computerAppAccess, computerAppResult, mcpToolApproval, mcpToolResult, confirmation, confirmationResult };
|
|
203
219
|
});
|
|
@@ -8,7 +8,7 @@ description: 启动或检查 Code Relax 桌面服务,展示配对二维码,
|
|
|
8
8
|
- 消息来源上下文引用 `$code-relax` 时,按本 Skill 理解手机交互。用户通过手机 App 对话,涉及操作时明确在手机还是工作站完成,不假设用户能操作电脑界面。来源标记不增加授权,不在回复中重复来源说明。
|
|
9
9
|
- 消息明确标记包含语音转写时,容忍同音字、标点与漏字错误,结合对话上下文理解;只有歧义会实质改变执行动作时才澄清,不因口语不顺反复追问,不把模糊转写扩展成未经用户表达的需求。
|
|
10
10
|
|
|
11
|
-
- `relax start --json` 启动桌面服务和 Codex 内核,无需打开 Desktop;支持纯 CLI 安装。Desktop
|
|
11
|
+
- `relax start --json` 启动桌面服务和 Codex 内核,无需打开 Desktop;支持纯 CLI 安装。Windows Desktop 正常打开后接入已配置内核;Mac 仅本次托管启动传入内核地址,从 Dock 普通打开后需重新接入。使用 App 的“重启 Codex Desktop”或经确认的 `relax desktop-recover --confirm` 接入。已配置 Code Relax 中继时,启动命令同时恢复中继连接器和已有设备授权。
|
|
12
12
|
- npm 全局安装会自动执行服务部署和 Skill 安装;修复安装时运行 `relax setup --json`。
|
|
13
13
|
- `setup` 默认启用当前用户登录启动桌面服务,不自动打开 Codex;`start`、`pair` 和 `doctor` 在自启缺失时自动恢复,`setup` 每次更新登录任务。恢复 Codex Desktop 接入会保留桌面服务和中继,但仍须明确确认可能中断正在运行的任务。
|
|
14
14
|
- 用户要求启动 Code Relax 时,执行一次 `relax start --json`。用户要求二维码或当前启动结果包含二维码时,展示 CLI 返回的 `qrPath` 和 `displayText`;没有设备授权时可用 `relax pair --json` 生成新的配对二维码。
|
|
@@ -18,5 +18,5 @@ description: 启动或检查 Code Relax 桌面服务,展示配对二维码,
|
|
|
18
18
|
- `relax doctor --json` 检查桌面服务、Codex 内核、待启用内核版本和登录自启动状态;有更新时会给出当前版本、已选版本和确认重启命令。中继连接由桌面服务管理,不提供单独的中继 CLI 命令。
|
|
19
19
|
- 发现待启用内核更新且用户明确要求重启时,说明任务中断风险;得到确认后使用 `relax kernel-restart --confirm --json`,它与手机“重启并更新”使用同一内核流程并等待新内核就绪。不要用 `start`、`doctor` 或 `desktop-recover` 代替内核重启。
|
|
20
20
|
- 启动或配对成功后,将 `qrPath` 以 Markdown 图片嵌入回复,并逐字展示 `displayText`。不要把二维码内容、Token 或 Base64 写进消息。
|
|
21
|
-
-
|
|
22
|
-
- 服务位于用户 `Programs/CodexRemote/service`;配置在 `LocalAppData/CodexRemote`;附件在 `ProgramData/CodexRemote/attachments`。不要删除配置、附件或凭据来排障。
|
|
21
|
+
- CLI 负责安装、工作站服务和配对二维码;不以手机是否测试作为健康检查项,不自动修改防火墙或发送测试消息。
|
|
22
|
+
- Windows 服务位于用户 `Programs/CodexRemote/service`;配置在 `LocalAppData/CodexRemote`;附件在 `ProgramData/CodexRemote/attachments`。Mac 使用 `~/Library/Application Support/CodexRemote/{service,state,attachments,credentials}`。不要删除配置、附件或凭据来排障。
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import fs from 'node:fs';
|
|
2
|
-
import { spawn } from 'node:child_process';
|
|
3
|
-
import { startWindowsProcess } from './platform/windows/background-process.mjs';
|
|
4
|
-
|
|
5
|
-
export const processAlive = pid => {
|
|
6
|
-
try { process.kill(pid, 0); return true; }
|
|
7
|
-
catch (error) { if (error.code === 'ESRCH') return false; throw error; }
|
|
8
|
-
};
|
|
9
|
-
export async function startBackground(executable, args, environment, logs = []) {
|
|
10
|
-
if (process.platform === 'win32') return startWindowsProcess(executable, args, environment, logs);
|
|
11
|
-
const descriptors = logs.map(file => fs.openSync(file, 'a'));
|
|
12
|
-
try {
|
|
13
|
-
const child = spawn(executable, args, { detached: true, env: environment,
|
|
14
|
-
stdio: ['ignore', descriptors[0] ?? 'ignore', descriptors[1] ?? 'ignore'] });
|
|
15
|
-
await new Promise((resolve, reject) => { child.once('spawn', resolve); child.once('error', reject); });
|
|
16
|
-
child.unref(); return child.pid;
|
|
17
|
-
} finally { descriptors.forEach(fd => fs.closeSync(fd)); }
|
|
18
|
-
}
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import { spawn } from 'node:child_process';
|
|
3
|
+
import { startWindowsProcess } from './platform/windows/background-process.mjs';
|
|
4
|
+
|
|
5
|
+
export const processAlive = pid => {
|
|
6
|
+
try { process.kill(pid, 0); return true; }
|
|
7
|
+
catch (error) { if (error.code === 'ESRCH') return false; throw error; }
|
|
8
|
+
};
|
|
9
|
+
export async function startBackground(executable, args, environment, logs = []) {
|
|
10
|
+
if (process.platform === 'win32') return startWindowsProcess(executable, args, environment, logs);
|
|
11
|
+
const descriptors = logs.map(file => fs.openSync(file, 'a'));
|
|
12
|
+
try {
|
|
13
|
+
const child = spawn(executable, args, { detached: true, env: environment,
|
|
14
|
+
stdio: ['ignore', descriptors[0] ?? 'ignore', descriptors[1] ?? 'ignore'] });
|
|
15
|
+
await new Promise((resolve, reject) => { child.once('spawn', resolve); child.once('error', reject); });
|
|
16
|
+
child.unref(); return child.pid;
|
|
17
|
+
} finally { descriptors.forEach(fd => fs.closeSync(fd)); }
|
|
18
|
+
}
|
|
@@ -6,9 +6,7 @@ import { fileRange, fileRevision } from './file-transfer-range.mjs';
|
|
|
6
6
|
|
|
7
7
|
async function checkedPath(root, relative) {
|
|
8
8
|
const target = protocol.child(root, relative);
|
|
9
|
-
|
|
10
|
-
if (!protocol.inside(base, real)) protocol.fail('此链接指向项目目录之外,无法浏览。', 403);
|
|
11
|
-
return real;
|
|
9
|
+
return fs.realpath(target);
|
|
12
10
|
}
|
|
13
11
|
|
|
14
12
|
function git(cwd, args) {
|
|
@@ -23,10 +21,10 @@ function git(cwd, args) {
|
|
|
23
21
|
|
|
24
22
|
export async function browseCode(rpc, operation, query) {
|
|
25
23
|
if (operation === 'change') return protocol.change(rpc, query);
|
|
26
|
-
const context = await protocol.context(rpc, query);
|
|
27
|
-
if (operation === 'roots') return { ...context, workspaceDiff: true, sizeCheckedBeforeRead: true };
|
|
28
24
|
if (operation === 'changes') return protocol.changes(rpc, query);
|
|
29
|
-
|
|
25
|
+
if (operation === 'roots') return { ...await protocol.context(rpc, query), workspaceDiff: true, sizeCheckedBeforeRead: true };
|
|
26
|
+
const root = query.get('root');
|
|
27
|
+
if (typeof root !== 'string' || !path.isAbsolute(root)) protocol.fail('请输入电脑上的绝对目录路径。');
|
|
30
28
|
if (operation === 'workspace' || operation === 'workspace-file') {
|
|
31
29
|
const realRoot = await checkedPath(root, '');
|
|
32
30
|
const repository = (await git(realRoot, ['rev-parse', '--show-toplevel'])).trim();
|
|
@@ -82,7 +80,8 @@ export async function browseCode(rpc, operation, query) {
|
|
|
82
80
|
} finally { await handle.close(); }
|
|
83
81
|
}
|
|
84
82
|
if (operation === 'directory') {
|
|
85
|
-
const
|
|
83
|
+
const entries = await fs.readdir(target, { withFileTypes: true });
|
|
84
|
+
const result = { entries: entries.map(entry => ({ fileName: entry.name, isDirectory: entry.isDirectory(), isFile: entry.isFile() })) };
|
|
86
85
|
await checkedPath(root, relative);
|
|
87
86
|
return protocol.directory(result);
|
|
88
87
|
}
|
|
@@ -90,7 +89,7 @@ export async function browseCode(rpc, operation, query) {
|
|
|
90
89
|
const before = await fs.stat(target);
|
|
91
90
|
if (!before.isFile()) protocol.fail('请选择普通文件。', 415);
|
|
92
91
|
if (before.size > protocol.maxBytes) protocol.fail('文件超过只读预览上限(1 MiB)。', 413);
|
|
93
|
-
const result = await
|
|
92
|
+
const result = { dataBase64: (await fs.readFile(target)).toString('base64') };
|
|
94
93
|
const real = await checkedPath(root, relative), after = await fs.stat(real);
|
|
95
94
|
if (real !== target || before.size !== after.size || before.mtimeMs !== after.mtimeMs || before.ino !== after.ino) {
|
|
96
95
|
protocol.fail('读取期间文件发生变化,请刷新。', 409);
|
|
@@ -8,6 +8,7 @@ import { DotsApprovalTimeline } from './dots-approval-timeline.mjs';
|
|
|
8
8
|
import { dotsRoomTurns } from './dots-room-projection.mjs';
|
|
9
9
|
import { dotsChatRevision, dotsChatMessageRevision, projectDotsChatItem } from './dots-chat-projection.mjs';
|
|
10
10
|
import timelineSync from '../shared/timeline-sync.cjs';
|
|
11
|
+
import serverRequests from '../shared/server-requests.cjs';
|
|
11
12
|
|
|
12
13
|
const pageSize = 20;
|
|
13
14
|
const mergeTurns = (older, newer) => timelineSync.mergeOrderedEntries(older, newer, (old, fresh) => ({ ...fresh,
|
|
@@ -27,6 +28,7 @@ export class DotsChatServer extends HostedHistoryAppServer {
|
|
|
27
28
|
this.serverRequests = transport.serverRequests;
|
|
28
29
|
this.historyHeadKey = 'messaging-room-v1';
|
|
29
30
|
this.windowLoads = new Map(); this.historyLoads = new Map(); this.bindings = new Map();
|
|
31
|
+
this.roomApprovalResponses = new Map();
|
|
30
32
|
this.observedThreads = new Set(); this.reconnectAttempts = 0;
|
|
31
33
|
this.approvalTimeline = new DotsApprovalTimeline(this);
|
|
32
34
|
this.chatActivity = new DotsRoomActivity(this);
|
|
@@ -77,6 +79,7 @@ export class DotsChatServer extends HostedHistoryAppServer {
|
|
|
77
79
|
this.traceSync('invalidated', null, reason);
|
|
78
80
|
clearTimeout(this.reconnectTimer);
|
|
79
81
|
this.epoch = randomUUID(); this.chatActivity.close(); this.approvalTimeline.clear();
|
|
82
|
+
this.roomApprovalResponses.clear();
|
|
80
83
|
for (const record of this.threads.values()) { record.needsReload = true; record.tokens.clear(); record.refresh = null; }
|
|
81
84
|
for (const timer of this.windowSaves.values()) clearTimeout(timer); this.windowSaves.clear();
|
|
82
85
|
for (const slot of this.subscriptions.values()) clearTimeout(slot.expiry);
|
|
@@ -394,7 +397,53 @@ export class DotsChatServer extends HostedHistoryAppServer {
|
|
|
394
397
|
const turn = { id: `activity:${params.turnId}:${item.id}`, status: 'completed', items: [item] };
|
|
395
398
|
this.publish(params.threadId, record, mergeTurns(record.thread.turns, [turn]));
|
|
396
399
|
}
|
|
397
|
-
|
|
400
|
+
async inspectApproval(threadId, body) {
|
|
401
|
+
if (typeof body.roomMessageId !== 'string' || !body.roomMessageId || typeof body.id !== 'string' || !body.id) throw new Error('确认请求标识无效');
|
|
402
|
+
const epoch = this.epoch, room = this.bindings.get(threadId) || await this.room(threadId);
|
|
403
|
+
const route = `/messaging/rooms/${encodeURIComponent(room.id)}/messages/${encodeURIComponent(body.roomMessageId)}/elicitation`;
|
|
404
|
+
const current = await this.rooms.request(`${route}?inspect=true`), request = current.elicitation;
|
|
405
|
+
if (epoch !== this.epoch || this.bindings.get(threadId) !== room || request?.request_id !== body.id
|
|
406
|
+
|| request.params?.threadId !== request.thread_id || typeof current.request_fingerprint !== 'string') throw new Error('确认请求已变化,请重新核对。');
|
|
407
|
+
if (!serverRequests.confirmation({ method: serverRequests.elicitation, params: request.params })) throw new Error('此房间请求尚未支持');
|
|
408
|
+
const key = JSON.stringify([room.id, body.roomMessageId, body.id]);
|
|
409
|
+
return { requestId: request.request_id, params: request.params, fingerprint: current.request_fingerprint,
|
|
410
|
+
status: current.runtime_status, canRespond: current.can_respond === true && current.runtime_status === 'pending',
|
|
411
|
+
submissionStatus: this.roomApprovalResponses.get(key) || null };
|
|
412
|
+
}
|
|
413
|
+
async respondApproval(threadId, body) {
|
|
414
|
+
this.requireWritable(threadId);
|
|
415
|
+
if (!body.roomMessageId) return this.transport.respondApproval(threadId, body);
|
|
416
|
+
const epoch = this.epoch, room = this.bindings.get(threadId);
|
|
417
|
+
if (!room || typeof body.fingerprint !== 'string' || !body.fingerprint) throw new Error('请先核对确认请求。');
|
|
418
|
+
const key = JSON.stringify([room.id, body.roomMessageId, body.id]);
|
|
419
|
+
if (this.roomApprovalResponses.has(key)) throw new Error('此确认请求已提交,请核对结果。');
|
|
420
|
+
this.roomApprovalResponses.set(key, 'submitting');
|
|
421
|
+
let sent = false;
|
|
422
|
+
try {
|
|
423
|
+
const current = await this.inspectApproval(threadId, body);
|
|
424
|
+
if (epoch !== this.epoch || !current.canRespond || current.fingerprint !== body.fingerprint) throw new Error('确认请求已变化或结束,请重新核对。');
|
|
425
|
+
const request = { method: serverRequests.elicitation, params: current.params };
|
|
426
|
+
serverRequests.validate(request, body.result);
|
|
427
|
+
sent = true;
|
|
428
|
+
const route = `/messaging/rooms/${encodeURIComponent(room.id)}/messages/${encodeURIComponent(body.roomMessageId)}/elicitation/response`;
|
|
429
|
+
const result = await this.rooms.request(route, { method: 'POST', body: { request_fingerprint: current.fingerprint, result: body.result } });
|
|
430
|
+
if (epoch === this.epoch) this.roomApprovalResponses.set(key, result?.status === 'applied' ? 'applied' : 'unknown');
|
|
431
|
+
if (epoch === this.epoch && result?.status === 'applied') {
|
|
432
|
+
const record = this.threads.get(threadId);
|
|
433
|
+
const turns = record && structuredClone(record.thread.turns);
|
|
434
|
+
const applied = turns?.flatMap(turn => turn.items).find(item => item.roomMessageId === body.roomMessageId);
|
|
435
|
+
if (applied) { applied.status = 'resolved'; applied.result = body.result; this.publish(threadId, record, turns); }
|
|
436
|
+
}
|
|
437
|
+
return result;
|
|
438
|
+
} catch (error) {
|
|
439
|
+
if (!sent) error.deliveryUnknown = false;
|
|
440
|
+
if (epoch === this.epoch) {
|
|
441
|
+
if (error.deliveryUnknown === false) this.roomApprovalResponses.delete(key);
|
|
442
|
+
else this.roomApprovalResponses.set(key, 'unknown');
|
|
443
|
+
}
|
|
444
|
+
throw error;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
398
447
|
acquireActivity(threadId, listener) { return this.chatActivity.acquire(threadId, listener); }
|
|
399
448
|
acquirePanelActivity(threadId, listener) { return this.chatActivity.acquire(threadId, listener); }
|
|
400
449
|
isHistorySyncing() { return false; }
|
|
@@ -24,7 +24,7 @@ export class DotsRoomClient extends CelsiusClient {
|
|
|
24
24
|
'chatgpt-account-id': identity.accountId, 'user-agent': 'Code-Relax/0.1.0' } };
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
async request(route, { method = 'GET', body, contentType, signal, onEvent } = {}) {
|
|
27
|
+
async request(route, { method = 'GET', body, contentType, signal, onEvent, rawResponse = false } = {}) {
|
|
28
28
|
const auth = await this.authorization();
|
|
29
29
|
const controller = new AbortController(); this.controllers.add(controller);
|
|
30
30
|
const cancelled = () => controller.abort(signal.reason);
|
|
@@ -86,7 +86,7 @@ export class DotsRoomClient extends CelsiusClient {
|
|
|
86
86
|
request.on('error', error => finish(error));
|
|
87
87
|
request.on('end', () => {
|
|
88
88
|
if (!current()) { finish(new Error('点点账号已变化,请重新连接。')); return; }
|
|
89
|
-
try { finish(null, onEvent ? null : text ? JSON.parse(text) : null); } catch (error) { finish(error); }
|
|
89
|
+
try { finish(null, onEvent ? null : rawResponse ? text : text ? JSON.parse(text) : null); } catch (error) { finish(error); }
|
|
90
90
|
});
|
|
91
91
|
request.on('close', () => { if (!settled) finish(new Error('点点请求连接已断开。')); });
|
|
92
92
|
// end() can queue data before TLS connects. Only a ready HTTP/2 stream
|
|
@@ -2,6 +2,8 @@ import WebSocket from 'ws';
|
|
|
2
2
|
import { HostedHistoryAppServer } from './hosted-history-app-server.mjs';
|
|
3
3
|
import { createDotsAvatarReader } from './dots-avatar.mjs';
|
|
4
4
|
import { readDotsCatalog } from './dots-profile.mjs';
|
|
5
|
+
import { DotsRoomClient } from './dots-room-client.mjs';
|
|
6
|
+
import { uploadTaskFiles, taskFilePrompt } from './dots-task-files.mjs';
|
|
5
7
|
|
|
6
8
|
const hostedAppServerUrl = 'wss://codex-cloud-backend.chatgpt.com/';
|
|
7
9
|
export const dotsTaskRevision = turn => turn ? JSON.stringify([turn.id, turn.status]) : '';
|
|
@@ -9,10 +11,12 @@ export const dotsTaskRevision = turn => turn ? JSON.stringify([turn.id, turn.sta
|
|
|
9
11
|
// Dots delegated tasks live in Desktop's durable host. Reuse the app-server
|
|
10
12
|
// protocol client; only the authenticated transport differs from the local host.
|
|
11
13
|
export class DotsAppServer extends HostedHistoryAppServer {
|
|
12
|
-
constructor(localServer, readProfiles = async () => new Map(), historyCache = null) {
|
|
14
|
+
constructor(localServer, readProfiles = async () => new Map(), historyCache = null, { uploadsRoot } = {}) {
|
|
13
15
|
super(localServer.url, historyCache);
|
|
14
16
|
this.historySource = 'aeon_child';
|
|
15
17
|
this.localServer = localServer;
|
|
18
|
+
this.uploadsRoot = uploadsRoot;
|
|
19
|
+
this.filesClient = new DotsRoomClient(this);
|
|
16
20
|
this.url = hostedAppServerUrl;
|
|
17
21
|
this.threadSources = new Map();
|
|
18
22
|
this.catalogWatches = new Map();
|
|
@@ -30,6 +34,7 @@ export class DotsAppServer extends HostedHistoryAppServer {
|
|
|
30
34
|
this.saveHistoryWindow(thread.id);
|
|
31
35
|
});
|
|
32
36
|
this.on('disconnected', () => {
|
|
37
|
+
this.filesClient.close();
|
|
33
38
|
this.profileIdentity = null;
|
|
34
39
|
this.catalogPages.clear(); this.profileRefresh = null; this.profileAttemptAt = 0;
|
|
35
40
|
this.catalogWatches.clear();
|
|
@@ -94,7 +99,7 @@ export class DotsAppServer extends HostedHistoryAppServer {
|
|
|
94
99
|
nativeRequest(method, params, transform) {
|
|
95
100
|
const socket = this.socket;
|
|
96
101
|
return super.request(method, params, transform).catch(error => {
|
|
97
|
-
if (error.code === 'app_server_request_timeout' && this.ready && this.socket === socket && !this.resetting) {
|
|
102
|
+
if (error.code === 'app_server_request_timeout' && !error.deliveryResult && this.ready && this.socket === socket && !this.resetting) {
|
|
98
103
|
// An OPEN hosted socket can stop answering RPCs while still delivering
|
|
99
104
|
// notifications. Invalidate it once; reconnect through the existing
|
|
100
105
|
// observer lifecycle, never replay the request whose outcome is unknown.
|
|
@@ -244,12 +249,26 @@ export class DotsAppServer extends HostedHistoryAppServer {
|
|
|
244
249
|
}
|
|
245
250
|
|
|
246
251
|
async send(args) {
|
|
252
|
+
const { uploadFiles = [], ...turnArgs } = args;
|
|
253
|
+
let assertCurrent;
|
|
247
254
|
try {
|
|
248
255
|
await this.connect();
|
|
249
256
|
const record = this.threads.get(args.threadId);
|
|
250
257
|
if (!record || record.needsReload) await this.timeline(args.threadId);
|
|
258
|
+
if (uploadFiles.length) {
|
|
259
|
+
this.requireWritable(args.threadId);
|
|
260
|
+
const epoch = this.epoch, identity = this.profileIdentity;
|
|
261
|
+
const current = () => {
|
|
262
|
+
if (epoch !== this.epoch || identity !== this.profileIdentity || !this.ready) throw new Error('云端连接已变化,请核对后发送。');
|
|
263
|
+
};
|
|
264
|
+
assertCurrent = current;
|
|
265
|
+
const references = await uploadTaskFiles(uploadFiles, { uploadsRoot: this.uploadsRoot, client: this.filesClient, current });
|
|
266
|
+
current();
|
|
267
|
+
const text = turnArgs.input.filter(item => item.type === 'text').map(item => item.text).join('\n');
|
|
268
|
+
turnArgs.input = [{ type: 'text', text: taskFilePrompt(text, references) }, ...turnArgs.input.filter(item => item.type !== 'text')];
|
|
269
|
+
}
|
|
251
270
|
} catch (error) { error.deliveryUnknown = false; throw error; }
|
|
252
|
-
return super.send(
|
|
271
|
+
return super.send(turnArgs, { assertCurrent });
|
|
253
272
|
}
|
|
254
273
|
|
|
255
274
|
async interrupt(threadId) {
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { readMessageUploads } from './message-upload-files.mjs';
|
|
3
|
+
|
|
4
|
+
// Desktop 26.1007.9446.0 Dll/Uhn/pA: reserve, upload bytes, confirm,
|
|
5
|
+
// then include an Uploaded file sediment pointer in the user message.
|
|
6
|
+
export async function uploadTaskFiles(files, { uploadsRoot, client, current, fetchImpl = fetch }) {
|
|
7
|
+
const uploads = await readMessageUploads({ files }, uploadsRoot);
|
|
8
|
+
const references = [];
|
|
9
|
+
for (const file of uploads) {
|
|
10
|
+
current();
|
|
11
|
+
const reserved = await client.request('/files', { method: 'POST', body: {
|
|
12
|
+
file_name: file.name, file_size: file.bytes.length, mime_type: file.mimeType,
|
|
13
|
+
use_case: 'codex', store_in_library: false, timezone_offset_min: new Date().getTimezoneOffset(), reset_rate_limits: false,
|
|
14
|
+
} });
|
|
15
|
+
current();
|
|
16
|
+
if (reserved?.status === 'error' || !/^[A-Za-z0-9_-]{1,256}$/.test(reserved?.file_id || '')
|
|
17
|
+
|| typeof reserved.upload_url !== 'string') throw new Error('云端文件上传地址未确认。');
|
|
18
|
+
const url = new URL(reserved.upload_url, 'https://chatgpt.com');
|
|
19
|
+
if (url.protocol !== 'https:' || url.username || url.password || url.port || url.hash) throw new Error('云端文件上传地址无效。');
|
|
20
|
+
if (url.origin === 'https://chatgpt.com' && url.pathname === '/backend-api/estuary/upload_content_bytes') {
|
|
21
|
+
const uploadUrl = url.searchParams.get('upload_url');
|
|
22
|
+
if (!uploadUrl) throw new Error('云端文件上传地址缺少参数。');
|
|
23
|
+
const boundary = `relax-${randomUUID()}`;
|
|
24
|
+
const name = file.name.replaceAll('"', '%22').replaceAll('\\', '%5C');
|
|
25
|
+
const body = Buffer.concat([Buffer.from(`--${boundary}\r\nContent-Disposition: form-data; name="file"; filename="${name}"\r\nContent-Type: ${file.mimeType}\r\n\r\n`),
|
|
26
|
+
file.bytes, Buffer.from(`\r\n--${boundary}\r\nContent-Disposition: form-data; name="upload_url"\r\n\r\n${uploadUrl}\r\n--${boundary}--\r\n`)]);
|
|
27
|
+
await client.request(url.pathname.slice('/backend-api'.length) + url.search, {
|
|
28
|
+
method: 'POST', body, contentType: `multipart/form-data; boundary=${boundary}`, rawResponse: true,
|
|
29
|
+
});
|
|
30
|
+
} else {
|
|
31
|
+
if (!['.oaiusercontent.com', '.blob.core.windows.net', '.amazonaws.com'].some(suffix => url.hostname.endsWith(suffix))) {
|
|
32
|
+
throw new Error('云端文件上传地址不属于文件服务。');
|
|
33
|
+
}
|
|
34
|
+
const aws = [...url.searchParams.keys()].some(key => key.toLowerCase() === 'x-amz-algorithm');
|
|
35
|
+
const response = await fetchImpl(url, { method: 'PUT', body: file.bytes, redirect: 'error', signal: AbortSignal.timeout(60000),
|
|
36
|
+
headers: { 'Content-Type': file.mimeType, ...aws ? {} : { 'x-ms-blob-type': 'BlockBlob',
|
|
37
|
+
'x-ms-version': '2020-04-08', 'x-ms-blob-content-type': file.mimeType } } });
|
|
38
|
+
await response.body?.cancel();
|
|
39
|
+
if (!response.ok) throw new Error(`云端文件上传失败(${response.status})。`);
|
|
40
|
+
}
|
|
41
|
+
current();
|
|
42
|
+
await client.request(`/files/${encodeURIComponent(reserved.file_id)}/uploaded`, { method: 'POST', body: {} });
|
|
43
|
+
current();
|
|
44
|
+
references.push({ pointer: `sediment://${reserved.file_id}`, fileName: file.name });
|
|
45
|
+
}
|
|
46
|
+
return references;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function taskFilePrompt(text, references) {
|
|
50
|
+
if (!references.length) return text;
|
|
51
|
+
return `# Files mentioned by the user:\n${references.map(file => `\nUploaded file: ${JSON.stringify(file).replaceAll('#', '\\u0023')}\n`).join('')}\n## My request:\n${text || '请查看上述文件。'}`;
|
|
52
|
+
}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
// Execution availability is sampled in the background. Health requests may
|
|
2
|
-
// join the current sample so a reconnect cannot cache an initial false state.
|
|
3
|
-
// Only connections are retried, not work.
|
|
4
|
-
export class ExecutionHealth {
|
|
5
|
-
constructor(read, interval = 3000) { this.read = read; this.interval = interval; this.state = { state: 'checking', ready: false }; }
|
|
6
|
-
start() { this.stopped = false; void this.tick(); }
|
|
7
|
-
stop() { this.stopped = true; clearTimeout(this.timer); }
|
|
8
|
-
refresh() {
|
|
9
|
-
if (this.work) return this.work;
|
|
10
|
-
this.work = this.sample().finally(() => { this.work = null; });
|
|
11
|
-
return this.work;
|
|
12
|
-
}
|
|
13
|
-
async sample() {
|
|
14
|
-
try {
|
|
15
|
-
const result = await this.read();
|
|
16
|
-
this.state = result && typeof result === 'object'
|
|
17
|
-
? { ...result, ready: Boolean(result.ready), checkedAt: new Date().toISOString() }
|
|
18
|
-
: { state: result ? 'ready' : 'unavailable', ready: Boolean(result), checkedAt: new Date().toISOString() };
|
|
19
|
-
} catch (error) { this.state = { state: 'unavailable', ready: false, error: error.message, checkedAt: new Date().toISOString() }; }
|
|
20
|
-
return this.state;
|
|
21
|
-
}
|
|
22
|
-
async tick() {
|
|
23
|
-
await this.refresh();
|
|
24
|
-
if (!this.stopped) { this.timer = setTimeout(() => this.tick(), this.interval); this.timer.unref?.(); }
|
|
25
|
-
}
|
|
26
|
-
}
|
|
1
|
+
// Execution availability is sampled in the background. Health requests may
|
|
2
|
+
// join the current sample so a reconnect cannot cache an initial false state.
|
|
3
|
+
// Only connections are retried, not work.
|
|
4
|
+
export class ExecutionHealth {
|
|
5
|
+
constructor(read, interval = 3000) { this.read = read; this.interval = interval; this.state = { state: 'checking', ready: false }; }
|
|
6
|
+
start() { this.stopped = false; void this.tick(); }
|
|
7
|
+
stop() { this.stopped = true; clearTimeout(this.timer); }
|
|
8
|
+
refresh() {
|
|
9
|
+
if (this.work) return this.work;
|
|
10
|
+
this.work = this.sample().finally(() => { this.work = null; });
|
|
11
|
+
return this.work;
|
|
12
|
+
}
|
|
13
|
+
async sample() {
|
|
14
|
+
try {
|
|
15
|
+
const result = await this.read();
|
|
16
|
+
this.state = result && typeof result === 'object'
|
|
17
|
+
? { ...result, ready: Boolean(result.ready), checkedAt: new Date().toISOString() }
|
|
18
|
+
: { state: result ? 'ready' : 'unavailable', ready: Boolean(result), checkedAt: new Date().toISOString() };
|
|
19
|
+
} catch (error) { this.state = { state: 'unavailable', ready: false, error: error.message, checkedAt: new Date().toISOString() }; }
|
|
20
|
+
return this.state;
|
|
21
|
+
}
|
|
22
|
+
async tick() {
|
|
23
|
+
await this.refresh();
|
|
24
|
+
if (!this.stopped) { this.timer = setTimeout(() => this.tick(), this.interval); this.timer.unref?.(); }
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -93,7 +93,7 @@ export function attachLanSocket(server, { token, dispatch, authorizeDevice = ()
|
|
|
93
93
|
}
|
|
94
94
|
if (purpose === 'download') {
|
|
95
95
|
if (message.type !== 'read' || typeof message.path !== 'string' || message.path.length > 12000 ||
|
|
96
|
-
!/^\/api\/(?:images\/[a-f0-9]{64}|files\/[a-f0-9]{64}|code\/(?:image|binary))(?:\?|$)/.test(message.path) || message.path.includes('#')) throw new Error('无效的文件读取请求');
|
|
96
|
+
!/^\/api\/(?:images\/[a-f0-9]{64}|files\/(?:local|[a-f0-9]{64})|code\/(?:image|binary)|desktop\/frames\/[a-f0-9]{32})(?:\?|$)/.test(message.path) || message.path.includes('#')) throw new Error('无效的文件读取请求');
|
|
97
97
|
await dispatch({ method: 'GET', url: message.path, headers: {}, socketRequest: true, fileTransfer: true }, {
|
|
98
98
|
json(status, body) { reply({ type: 'error', status, error: body?.error || '文件读取失败' }); },
|
|
99
99
|
filePart(metadata, data) {
|
|
@@ -178,7 +178,7 @@ export function attachLanSocket(server, { token, dispatch, authorizeDevice = ()
|
|
|
178
178
|
}
|
|
179
179
|
if (typeof path !== 'string' || !path.startsWith('/api/') || path.includes('#') ||
|
|
180
180
|
path.startsWith('/api/attachments/') || path === '/api/socket' || path === '/api/uploads' ||
|
|
181
|
-
subscription !== isStream || !['GET', 'POST', 'DELETE'].includes(message.method || 'GET') ||
|
|
181
|
+
subscription !== isStream || !['GET', 'POST', 'PUT', 'DELETE'].includes(message.method || 'GET') ||
|
|
182
182
|
(subscription && message.method && message.method !== 'GET') ||
|
|
183
183
|
(message.body !== undefined && (!message.body || typeof message.body !== 'object' || Array.isArray(message.body)))) {
|
|
184
184
|
send({ type: 'response', id, status: 400, body: { error: '无效的连接请求' } }); return;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
|
+
import { executableKey } from './platform/path-identity.mjs';
|
|
2
3
|
import net from 'node:net';
|
|
3
4
|
import path from 'node:path';
|
|
4
5
|
import { EventEmitter } from 'node:events';
|
|
5
6
|
import { setTimeout as delay } from 'node:timers/promises';
|
|
6
7
|
import { readRecord, writeRecord } from './service-lifecycle.mjs';
|
|
7
8
|
import { SharedAppServer } from './shared-app-server.mjs';
|
|
8
|
-
import { pruneRetainedDesktopRuntimes, resolveCodexRuntime, runtimeFilesAvailable } from './platform/
|
|
9
|
+
import { pruneRetainedDesktopRuntimes, resolveCodexRuntime, runtimeFilesAvailable } from './platform/codex-runtime.mjs';
|
|
9
10
|
|
|
10
11
|
export const managedAppServerUrl = 'ws://127.0.0.1:45839';
|
|
11
12
|
export const managedAppServerReadyUrl = 'http://127.0.0.1:45839/readyz';
|
|
@@ -80,7 +81,7 @@ export class ManagedAppServer extends EventEmitter {
|
|
|
80
81
|
? savedRuntime
|
|
81
82
|
: await resolveCodexRuntime(this.stateRoot, { refresh: !actual, environment: this.environment });
|
|
82
83
|
if (actual && !runtimeFilesAvailable(actual.executable)) {
|
|
83
|
-
throw new Error(`运行中的 Codex
|
|
84
|
+
throw new Error(`运行中的 Codex 内核目录已被移除或缺少配套 code-mode-host:${actual.executable};已找到可用内核 ${runtime.executable},请确认重启内核。`);
|
|
84
85
|
}
|
|
85
86
|
if (!actual) {
|
|
86
87
|
if (!await this.available()) throw new Error('45839 被未识别进程占用,未启动或结束任何进程。');
|
|
@@ -108,11 +109,11 @@ export class ManagedAppServer extends EventEmitter {
|
|
|
108
109
|
await this.client.connect();
|
|
109
110
|
if (!this.client.ready) throw new Error('Codex 内核协议初始化未完成。');
|
|
110
111
|
if (startedHere) {
|
|
111
|
-
try { pruneRetainedDesktopRuntimes(this.stateRoot, actual.executable); }
|
|
112
|
+
try { await pruneRetainedDesktopRuntimes(this.stateRoot, actual.executable); }
|
|
112
113
|
catch (error) { console.error('旧版 Codex 内核文件清理失败:', error); }
|
|
113
114
|
}
|
|
114
115
|
const preferredExecutable = path.resolve(runtime.executable);
|
|
115
|
-
const updatePending =
|
|
116
|
+
const updatePending = executableKey(actual.executable) !== executableKey(preferredExecutable);
|
|
116
117
|
const launcherRevision = Number.isSafeInteger(record?.launcherRevision) ? record.launcherRevision : 0;
|
|
117
118
|
this.retryAttempt = 0;
|
|
118
119
|
this.retryAfter = 0;
|
|
@@ -171,7 +172,7 @@ export class ManagedAppServer extends EventEmitter {
|
|
|
171
172
|
const desktop = await this.host.prepareKernelRestart?.();
|
|
172
173
|
this.client.close();
|
|
173
174
|
if (actual) {
|
|
174
|
-
await this.host.stop(actual.pid);
|
|
175
|
+
await this.host.stop(actual.pid, actual);
|
|
175
176
|
await this.waitUntilStopped(actual);
|
|
176
177
|
} else if (!await this.available()) {
|
|
177
178
|
throw new Error('45839 被未识别进程占用,未结束任何进程。');
|
|
@@ -235,7 +236,9 @@ export class ManagedAppServer extends EventEmitter {
|
|
|
235
236
|
|
|
236
237
|
export function sameManagedProcess(record, actual) {
|
|
237
238
|
if (!record || !actual || record.pid !== actual.pid || record.created !== actual.created) return false;
|
|
238
|
-
if (
|
|
239
|
+
if (!record.executable || !actual.executable || executableKey(record.executable) !== executableKey(actual.executable)) return false;
|
|
240
|
+
if (Array.isArray(actual.args)) return JSON.stringify(record.args) === JSON.stringify(actual.args)
|
|
241
|
+
&& JSON.stringify(actual.args.slice(1)) === JSON.stringify(['app-server', '--listen', managedAppServerUrl]);
|
|
239
242
|
const command = String(actual.command || '').toLowerCase();
|
|
240
243
|
return command.includes('app-server') && command.includes(managedAppServerUrl);
|
|
241
244
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export function validateInlineImage(value) {
|
|
2
|
-
const data = typeof value === 'string' ? value.slice(value.indexOf(',') + 1) : '';
|
|
3
|
-
if (typeof value !== 'string' || value.length > Math.ceil(8 * 1024 * 1024 / 3) * 4 + 64 ||
|
|
4
|
-
!/^data:image\/(?:jpeg|png|webp);base64,/.test(value) || !data || data.length % 4 !== 0 ||
|
|
5
|
-
!/^[A-Za-z0-9+/]*={0,2}$/.test(data) || Buffer.byteLength(data, 'base64') > 8 * 1024 * 1024) {
|
|
6
|
-
throw new Error('图片必须是 JPEG、PNG 或 WebP 数据,且不超过 8 MiB。');
|
|
7
|
-
}
|
|
8
|
-
return value;
|
|
9
|
-
}
|
|
1
|
+
export function validateInlineImage(value) {
|
|
2
|
+
const data = typeof value === 'string' ? value.slice(value.indexOf(',') + 1) : '';
|
|
3
|
+
if (typeof value !== 'string' || value.length > Math.ceil(8 * 1024 * 1024 / 3) * 4 + 64 ||
|
|
4
|
+
!/^data:image\/(?:jpeg|png|webp);base64,/.test(value) || !data || data.length % 4 !== 0 ||
|
|
5
|
+
!/^[A-Za-z0-9+/]*={0,2}$/.test(data) || Buffer.byteLength(data, 'base64') > 8 * 1024 * 1024) {
|
|
6
|
+
throw new Error('图片必须是 JPEG、PNG 或 WebP 数据,且不超过 8 MiB。');
|
|
7
|
+
}
|
|
8
|
+
return value;
|
|
9
|
+
}
|
package/dist/src/onboarding.mjs
CHANGED
|
@@ -1,29 +1,12 @@
|
|
|
1
|
-
export
|
|
2
|
-
'
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export function phonePairingSteps(transportMode, paired = false) {
|
|
9
|
-
const mode = transportMode === 'lan-shared' ? '局域网 · Codex 内核已就绪' : '局域网(Codex 内核未就绪)';
|
|
10
|
-
return paired ? [
|
|
11
|
-
`已有移动设备授权。移动端可继续使用 Code Relax 中继;${mode} 会显示验证成功的当前网络和历史记录。`,
|
|
12
|
-
'添加另一台设备时执行 relax pair;每台设备只需扫码配对一次。',
|
|
13
|
-
] : [
|
|
14
|
-
'请先在移动端安装 Code Relax。当前为鸿蒙 HarmonyOS 7 私测版,调试 HAP 需通过 DevEco/调试设备安装,尚无商店下载入口。',
|
|
15
|
-
'使用 App 扫描配对二维码;每台移动设备只需配对一次。',
|
|
16
|
-
`配对后可直接使用 Code Relax 中继;${mode} 会接收并验证当前网络候选,也可手动输入 IP。`,
|
|
17
|
-
];
|
|
18
|
-
}
|
|
19
|
-
export const desktopSetupSteps = [
|
|
20
|
-
'Code Relax Skill 已随 npm 包自动安装。',
|
|
21
|
-
'安装完成后桌面服务和 Codex 内核已启动,并默认在当前用户登录时启动。',
|
|
22
|
-
'CLI 用户无需安装 Desktop;已安装 Desktop 时,安装器负责将运行中的 Desktop 接入同一内核。',
|
|
23
|
-
'尚无设备授权时执行 relax pair,打开并扫描配对二维码。',
|
|
24
|
-
'统一配对先建立电脑记录;进入该电脑后可另行完成 OpenAI 官方 Remote 配对。',
|
|
1
|
+
export function phonePairingSteps(_transportMode, paired = false) {
|
|
2
|
+
return paired ? ['已配对设备可直接连接。添加设备:relax pair']
|
|
3
|
+
: ['生成配对二维码:relax pair', '用 Code Relax App 扫码添加工作站。'];
|
|
4
|
+
}
|
|
5
|
+
export const desktopSetupSteps = [
|
|
6
|
+
'工作站服务和 Codex 内核已就绪,已启用登录自启。',
|
|
7
|
+
'生成配对二维码:relax pair',
|
|
25
8
|
];
|
|
26
9
|
|
|
27
|
-
export function pairingDisplayText(nextSteps
|
|
28
|
-
return ['
|
|
10
|
+
export function pairingDisplayText(nextSteps) {
|
|
11
|
+
return ['Code Relax 工作站已启动。', ...nextSteps].join('\n');
|
|
29
12
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import http2 from 'node:http2';
|
|
2
|
+
import pricing from '../shared/plan-pricing.cjs';
|
|
3
|
+
|
|
4
|
+
export async function readPlanPricing(client) {
|
|
5
|
+
await client.connect();
|
|
6
|
+
const token = async () => (await client.request('getAuthStatus', { includeToken: true, refreshToken: false })).authToken;
|
|
7
|
+
const authToken = await token();
|
|
8
|
+
if (!authToken) return null;
|
|
9
|
+
const identity = value => {
|
|
10
|
+
const auth = JSON.parse(Buffer.from(value.split('.')[1], 'base64url'))['https://api.openai.com/auth'];
|
|
11
|
+
return JSON.stringify([auth?.chatgpt_account_id, auth?.chatgpt_user_id]);
|
|
12
|
+
};
|
|
13
|
+
const initialIdentity = identity(authToken), accountId = JSON.parse(initialIdentity)[0];
|
|
14
|
+
if (!accountId) return null;
|
|
15
|
+
const session = http2.connect('https://chatgpt.com');
|
|
16
|
+
session.on('error', () => {}); // Each stream reports its own request error.
|
|
17
|
+
try {
|
|
18
|
+
const get = route => new Promise((resolve, reject) => {
|
|
19
|
+
const request = session.request({ ':method': 'GET', ':path': '/backend-api' + route,
|
|
20
|
+
authorization: `Bearer ${authToken}`, 'chatgpt-account-id': accountId,
|
|
21
|
+
'user-agent': 'Code-Relax/0.1.0', accept: 'application/json' });
|
|
22
|
+
let body = '', status, size = 0, ended = false;
|
|
23
|
+
const timer = setTimeout(() => request.destroy(new Error('套餐费用查询超时。')), 15000);
|
|
24
|
+
request.setEncoding('utf8');
|
|
25
|
+
request.on('response', headers => { status = headers[':status']; });
|
|
26
|
+
request.on('data', chunk => {
|
|
27
|
+
size += Buffer.byteLength(chunk);
|
|
28
|
+
if (size > 1024 * 1024) request.destroy(new Error('套餐费用响应过大。'));
|
|
29
|
+
else body += chunk;
|
|
30
|
+
});
|
|
31
|
+
request.on('error', reject);
|
|
32
|
+
request.on('close', () => { clearTimeout(timer); if (!ended) reject(new Error('套餐费用连接已断开。')); });
|
|
33
|
+
request.on('end', () => {
|
|
34
|
+
ended = true;
|
|
35
|
+
try {
|
|
36
|
+
if (status !== 200) throw new Error(`套餐费用查询失败(HTTP ${status})。`);
|
|
37
|
+
resolve(JSON.parse(body));
|
|
38
|
+
} catch (error) { reject(error); }
|
|
39
|
+
});
|
|
40
|
+
request.end();
|
|
41
|
+
});
|
|
42
|
+
const value = await pricing.read(accountId, get);
|
|
43
|
+
const current = await token();
|
|
44
|
+
if (!current || identity(current) !== initialIdentity) throw new Error('套餐查询期间账号已变化。');
|
|
45
|
+
return value;
|
|
46
|
+
} finally { session.destroy(); }
|
|
47
|
+
}
|