@marktrue/dsh-mobile-remote 3.3.1-alpha.5 → 3.3.1-rc.1-app
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/DSH-Remote-v3.3.1.apk +4 -0
- package/README.md +6 -256
- package/manifest.json +21 -0
- package/package.json +12 -68
- package/CHANGELOG.md +0 -2168
- package/CONTRIBUTING.md +0 -114
- package/FAQ.md +0 -111
- package/cordis.patch.yml +0 -14
- package/docs/00-/345/274/200/345/217/221/346/200/273/347/272/262.md +0 -125
- package/docs/01-PRD.md +0 -148
- package/docs/02-architecture.md +0 -249
- package/docs/03-api.md +0 -1683
- package/docs/04-security.md +0 -195
- package/docs/05-test-cases.md +0 -405
- package/docs/06-install-run.md +0 -342
- package/docs/07-user-manual.md +0 -70
- package/docs/08-/346/211/251/345/261/225/345/274/200/345/217/221/346/214/207/345/215/227.md +0 -86
- package/docs/09-compatibility.md +0 -261
- package/docs/10-release.md +0 -1032
- package/docs/11-notification-reliability.md +0 -45
- package/docs/12-implementation-status.md +0 -41
- package/docs/20-dsh-022-compatibility-2026-11-05.md +0 -32
- package/docs/README.md +0 -109
- package/docs/history/13-device-acceptance-2026-11-03.md +0 -37
- package/docs/history/16-next-window-handoff-2026-11-04.md +0 -44
- package/docs/history/17-remaining-work-review-2026-11-04.md +0 -53
- package/docs/history/18-device-reliability-acceptance-2026-11-04.md +0 -63
- package/docs/history/19-issue-followup-2026-11-04.md +0 -39
- package/docs/screenshots/01-home.png +0 -0
- package/docs/screenshots/02-notifications.png +0 -0
- package/docs/screenshots/03-sessions.png +0 -0
- package/docs/screenshots/04-chat.png +0 -0
- package/docs/screenshots/05-settings.png +0 -0
- package/docs/screenshots/06-new-session.png +0 -0
- package/docs/screenshots/pgy-appstore.jpg +0 -0
- package/docs/screenshots/pgy-mobile-app.jpg +0 -0
- package/docs/screenshots/pgy-pc-client.jpg +0 -0
- package/lib/account-usage.js +0 -145
- package/lib/app-alignment.js +0 -112
- package/lib/app-carrier-store.js +0 -1972
- package/lib/app-carrier.js +0 -609
- package/lib/client.js +0 -1196
- package/lib/desktop-form.js +0 -738
- package/lib/endpoint-registry.js +0 -210
- package/lib/experimental-bundles.js +0 -121
- package/lib/git-read-bundled-provider.js +0 -480
- package/lib/git-read-service.js +0 -901
- package/lib/host-manager-update.js +0 -222
- package/lib/host-settings-whitelist.js +0 -207
- package/lib/host-settings.js +0 -695
- package/lib/host-update-capabilities.js +0 -209
- package/lib/index.js +0 -15808
- package/lib/npm-update-source.js +0 -226
- package/lib/plugin-content-digest.js +0 -80
- package/lib/plugin-self-update.js +0 -1112
- package/lib/plugin-update-check.js +0 -268
- package/lib/plugin-update-controller.js +0 -416
- package/lib/plugin-update-log.js +0 -164
- package/lib/plugin-update-transaction.js +0 -358
- package/lib/plugin-update.js +0 -309
- package/lib/runtime-dependency-snapshot.js +0 -345
- package/lib/session-title-cache.js +0 -123
- package/lib/session-title-refresh.js +0 -261
- package/lib/sse-connections.js +0 -172
- package/lib/tool-process.js +0 -20
- package/lib/update-fetch.js +0 -24
- package/lib/update-lock-arbiter.js +0 -210
- package/lib/update-supervisor.js +0 -379
- 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/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/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/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/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/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
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
// 通过宿主原生插件管理器执行更新(DSH 0.2.2+):不重启宿主。
|
|
2
|
-
//
|
|
3
|
-
// 与 `plugin-self-update.js` 那条「改依赖 → pnpm install → 重启 → 健康确认」的传统
|
|
4
|
-
// 通道并列;本模块只在宿主提供 `pluginManager.updateBundle()` 时使用。
|
|
5
|
-
//
|
|
6
|
-
// 为什么优先用它:
|
|
7
|
-
// 1. **不重启**:宿主在 HMR 可用时移除旧版本、装新版本并在进程内重新组合 profile,
|
|
8
|
-
// 插件被重新加载而宿主进程不变——手机与桌面都不掉连接。
|
|
9
|
-
// 2. **判定权交给宿主**:registry 选择、pnpm 配置、凭据、兼容性豁免、构建脚本批准
|
|
10
|
-
// 全部由宿主那一套既有实现决定,我们不重复实现、也不绕过它的安全检查。
|
|
11
|
-
// 3. **失败即回滚**:宿主在装新版本失败/取消时会把旧版本装回去,并把结果如实报出来。
|
|
12
|
-
//
|
|
13
|
-
// 本模块不做的事:不自己跑 pnpm、不改 profile 文件、不做健康判定(宿主的
|
|
14
|
-
// `application` 字段就是结论)。
|
|
15
|
-
import { compareVersion, parseVersion } from "./plugin-update.js";
|
|
16
|
-
import { HOST_MANAGER_REASON, UPDATE_CHANNEL } from "./host-update-capabilities.js";
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* 宿主拒绝后的**稳定动作枚举**(issue #116,对外契约;只有 5 个值)。
|
|
20
|
-
*
|
|
21
|
-
* 由宿主 `error.code` 白名单映射而来,App 据此给出可执行提示(例如“先重启 DSH”);
|
|
22
|
-
* 未知 code 保留原码并落到 `diagnose`,绝不因为不认识就丢弃。
|
|
23
|
-
*/
|
|
24
|
-
export const HOST_MANAGER_NEXT_ACTION = {
|
|
25
|
-
/** 另有插件变更待重启(`stop-profile` / `bundle-in-use`)——重启宿主后重试。 */
|
|
26
|
-
RESTART_HOST: "restart-host",
|
|
27
|
-
/** 目标版本与当前宿主不兼容。 */
|
|
28
|
-
VERSION_INCOMPATIBLE: "version-incompatible",
|
|
29
|
-
/** 目标不是可更新的 bundle / 版本非法。 */
|
|
30
|
-
INVALID_TARGET: "invalid-target",
|
|
31
|
-
/** 宿主执行失败,可重试或看诊断。 */
|
|
32
|
-
RETRY_OR_DIAGNOSE: "retry-or-diagnose",
|
|
33
|
-
/** 未知原因,只能给诊断信息(保留 `hostErrorCode` 原码)。 */
|
|
34
|
-
DIAGNOSE: "diagnose",
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
/** 宿主 `error.code` → `nextAction` 的**唯一映射点**(白名单;未知 code → diagnose)。 */
|
|
38
|
-
const HOST_ERROR_NEXT_ACTION = new Map([
|
|
39
|
-
["stop-profile", HOST_MANAGER_NEXT_ACTION.RESTART_HOST],
|
|
40
|
-
["bundle-in-use", HOST_MANAGER_NEXT_ACTION.RESTART_HOST],
|
|
41
|
-
["incompatible-version", HOST_MANAGER_NEXT_ACTION.VERSION_INCOMPATIBLE],
|
|
42
|
-
["not-bundle", HOST_MANAGER_NEXT_ACTION.INVALID_TARGET],
|
|
43
|
-
["invalid-spec", HOST_MANAGER_NEXT_ACTION.INVALID_TARGET],
|
|
44
|
-
["operation-error", HOST_MANAGER_NEXT_ACTION.RETRY_OR_DIAGNOSE],
|
|
45
|
-
]);
|
|
46
|
-
|
|
47
|
-
/** 把宿主错误码映射为稳定动作;空码返回空串(不是一次宿主拒绝),未知非空码 → diagnose。 */
|
|
48
|
-
export function nextActionForHostError(code) {
|
|
49
|
-
const value = typeof code === "string" ? code : "";
|
|
50
|
-
if (value === "") return "";
|
|
51
|
-
return HOST_ERROR_NEXT_ACTION.get(value) ?? HOST_MANAGER_NEXT_ACTION.DIAGNOSE;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/** 宿主更新失败的稳定原因码(对外只暴露这一类,不含宿主异常原文)。 */
|
|
55
|
-
export const HOST_MANAGER_ERROR = {
|
|
56
|
-
/** 探测阶段就不可用。 */
|
|
57
|
-
UNAVAILABLE: "host-manager-unavailable",
|
|
58
|
-
/** 目标版本不是合法 semver。 */
|
|
59
|
-
VERSION_INVALID: "host-manager-version-invalid",
|
|
60
|
-
/** 目标版本不高于已安装版本(宿主会拒绝,这里提前挡)。 */
|
|
61
|
-
VERSION_NOT_NEWER: "host-manager-version-not-newer",
|
|
62
|
-
/** 宿主拒绝(`ChangeResult.application === 'failed'`)。 */
|
|
63
|
-
REJECTED: "host-manager-rejected",
|
|
64
|
-
/** 用户/调用方取消。 */
|
|
65
|
-
CANCELLED: "host-manager-cancelled",
|
|
66
|
-
/** 装上了但需要重启才生效。 */
|
|
67
|
-
RESTART_REQUIRED: "host-manager-restart-required",
|
|
68
|
-
/** 调用 itself 抛错。 */
|
|
69
|
-
CALL_FAILED: "host-manager-call-failed",
|
|
70
|
-
/** 被替代/覆盖(同一插件条目上有更高优先级的覆盖)。 */
|
|
71
|
-
OVERRIDDEN: "host-manager-overridden",
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* 把宿主的 `ChangeResult`(以及 `updateBundle` 外层结果)压成我们自己的稳定结论。
|
|
76
|
-
*
|
|
77
|
-
* 宿主字段语义(见 dsh-plugin-manager 的 `ChangeResult` / `PluginUpdateResult`):
|
|
78
|
-
* - `application: 'applied'` → 已生效,无需重启;
|
|
79
|
-
* - `application: 'restart-required'` → 装了但下次启动才生效;
|
|
80
|
-
* - `application: 'failed' | 'cancelled'` → 未生效(`restore` 存在时表示旧版本已装回);
|
|
81
|
-
* - `application: 'overridden'` → 被其它条目覆盖。
|
|
82
|
-
*
|
|
83
|
-
* @param {object|undefined} outcome - `updateBundle()` 的返回值。
|
|
84
|
-
* @returns {{ok: boolean, reason: string, restored: boolean, from: string, to: string, step: string,
|
|
85
|
-
* detail: string, hostErrorCode: string, nextAction: string}}
|
|
86
|
-
*/
|
|
87
|
-
export function interpretHostManagerUpdate(outcome) {
|
|
88
|
-
const from = typeof outcome?.from === "string" ? outcome.from : "";
|
|
89
|
-
const to = typeof outcome?.to === "string" ? outcome.to : "";
|
|
90
|
-
const step = typeof outcome?.step === "string" ? outcome.step : "";
|
|
91
|
-
const base = { from, to, step, restored: Boolean(outcome?.restore) };
|
|
92
|
-
// `updateBundle` 在「检查阶段就拒绝」时也可能没有 result。
|
|
93
|
-
const result = outcome?.result;
|
|
94
|
-
if (!result || typeof result !== "object") {
|
|
95
|
-
const reason = typeof result === "string" ? result : "";
|
|
96
|
-
return { ...base, ok: false, reason: HOST_MANAGER_ERROR.REJECTED, detail: reason,
|
|
97
|
-
hostErrorCode: "", nextAction: "" };
|
|
98
|
-
}
|
|
99
|
-
switch (result.application) {
|
|
100
|
-
case "applied":
|
|
101
|
-
return { ...base, ok: true, reason: "", detail: "" };
|
|
102
|
-
case "restart-required":
|
|
103
|
-
return { ...base, ok: false, reason: HOST_MANAGER_ERROR.RESTART_REQUIRED, detail: String(result.restartReason ?? ""),
|
|
104
|
-
hostErrorCode: "", nextAction: "" };
|
|
105
|
-
case "cancelled":
|
|
106
|
-
return { ...base, ok: false, reason: HOST_MANAGER_ERROR.CANCELLED, detail: "",
|
|
107
|
-
hostErrorCode: "", nextAction: "" };
|
|
108
|
-
case "overridden":
|
|
109
|
-
return { ...base, ok: false, reason: HOST_MANAGER_ERROR.OVERRIDDEN, detail: "",
|
|
110
|
-
hostErrorCode: "", nextAction: "" };
|
|
111
|
-
case "failed":
|
|
112
|
-
default: {
|
|
113
|
-
// 宿主的 error 是结构化对象(code/diagnostic);只取 code,绝不透传 diagnostic 原文
|
|
114
|
-
// (可能含 registry URL、凭据或缺路径)。
|
|
115
|
-
const code = typeof result.error?.code === "string" ? result.error.code : "";
|
|
116
|
-
return { ...base, ok: false, reason: HOST_MANAGER_ERROR.REJECTED, detail: code,
|
|
117
|
-
hostErrorCode: code, nextAction: nextActionForHostError(code) };
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* 校验目标版本可以交给宿主更新。
|
|
124
|
-
*
|
|
125
|
-
* 宿主自己也会校验(`semver.gt`),这里提前挡是为了给出**我们自己的稳定原因码**,
|
|
126
|
-
* 而不是把宿主的英文 diagnostic 抛给手机。
|
|
127
|
-
*
|
|
128
|
-
* @param {object} input
|
|
129
|
-
* @param {string} input.targetVersion - 目标版本。
|
|
130
|
-
* @param {string} input.installedVersion - 当前已安装版本。
|
|
131
|
-
* @returns {{ok: boolean, reason: string}}
|
|
132
|
-
*/
|
|
133
|
-
export function validateHostManagerTarget({ targetVersion, installedVersion } = {}) {
|
|
134
|
-
if (!parseVersion(targetVersion)) return { ok: false, reason: HOST_MANAGER_ERROR.VERSION_INVALID };
|
|
135
|
-
if (installedVersion) {
|
|
136
|
-
const comparison = compareVersion(targetVersion, installedVersion);
|
|
137
|
-
// 比较不出来时放行给宿主判定:我们的比较器只认 `X.Y.Z[-pre][+N]`,
|
|
138
|
-
// 而宿主用的是完整 semver——不因为我们的解析面更窄就误拒。
|
|
139
|
-
if (comparison !== null && comparison <= 0) {
|
|
140
|
-
return { ok: false, reason: HOST_MANAGER_ERROR.VERSION_NOT_NEWER };
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
return { ok: true, reason: "" };
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* 通过宿主插件管理器更新本插件。
|
|
148
|
-
*
|
|
149
|
-
* 执行顺序刻意固定:
|
|
150
|
-
* 1. 探测结论必须可用(`probe.channel === host-manager`),否则直接拒绝;
|
|
151
|
-
* 2. 校验目标版本;
|
|
152
|
-
* 3. 调 `updateBundle(name, version, { registry?, requestId? })`;
|
|
153
|
-
* 4. 把结果压成稳定结论。
|
|
154
|
-
*
|
|
155
|
-
* 不在这里做重试:宿主的 `updateBundle` 内部已经处理了 registry 回退与失败回滚,
|
|
156
|
-
* 我们外加一层重试只会让「已经回滚过的事」再发生一次。
|
|
157
|
-
*
|
|
158
|
-
* @param {object} input
|
|
159
|
-
* @param {object} input.service - `pluginManager` 服务实例。
|
|
160
|
-
* @param {string} input.packageName - 本插件包名。
|
|
161
|
-
* @param {string} input.targetVersion - 目标版本。
|
|
162
|
-
* @param {string} [input.installedVersion] - 当前版本(用于提前挡降级)。
|
|
163
|
-
* @param {string} [input.registry] - 指定 registry;缺省由宿主按配置决定。
|
|
164
|
-
* @param {string} [input.requestId] - 宿主用它关联进度与日志。
|
|
165
|
-
* @param {(progress: object) => void} [input.onProgress] - 宿主 `update-state` 事件的转发。
|
|
166
|
-
* @param {object} [input.log] - 结构化日志(注入以便测试)。
|
|
167
|
-
* @returns {Promise<object>} 稳定结论。
|
|
168
|
-
*/
|
|
169
|
-
export async function runHostManagerUpdate({
|
|
170
|
-
service,
|
|
171
|
-
packageName,
|
|
172
|
-
targetVersion,
|
|
173
|
-
installedVersion = "",
|
|
174
|
-
registry,
|
|
175
|
-
requestId,
|
|
176
|
-
onProgress,
|
|
177
|
-
log = {},
|
|
178
|
-
} = {}) {
|
|
179
|
-
if (!service || typeof service.updateBundle !== "function") {
|
|
180
|
-
return { ok: false, channel: UPDATE_CHANNEL.HOST_MANAGER, reason: HOST_MANAGER_REASON.SERVICE_MISSING, from: "", to: String(targetVersion ?? ""), step: "", restored: false };
|
|
181
|
-
}
|
|
182
|
-
if (typeof packageName !== "string" || packageName === "") {
|
|
183
|
-
return { ok: false, channel: UPDATE_CHANNEL.HOST_MANAGER, reason: HOST_MANAGER_REASON.NOT_UPDATABLE, from: "", to: String(targetVersion ?? ""), step: "", restored: false };
|
|
184
|
-
}
|
|
185
|
-
const validated = validateHostManagerTarget({ targetVersion, installedVersion });
|
|
186
|
-
if (!validated.ok) {
|
|
187
|
-
return { ok: false, channel: UPDATE_CHANNEL.HOST_MANAGER, reason: validated.reason, from: String(installedVersion ?? ""), to: String(targetVersion ?? ""), step: "check", restored: false };
|
|
188
|
-
}
|
|
189
|
-
const options = {};
|
|
190
|
-
// 只在调用方明确给了 registry 时才传:缺省要比「传 undefined」更明确地走宿主配置。
|
|
191
|
-
if (typeof registry === "string" && registry !== "") options.registry = registry;
|
|
192
|
-
if (typeof requestId === "string" && requestId !== "") options.requestId = requestId;
|
|
193
|
-
let outcome;
|
|
194
|
-
try {
|
|
195
|
-
log.stage?.("host-manager", `Updating ${packageName} to ${targetVersion} through the host plugin manager`);
|
|
196
|
-
outcome = await service.updateBundle(packageName, targetVersion, Object.keys(options).length > 0 ? options : undefined);
|
|
197
|
-
} catch (error) {
|
|
198
|
-
// 宿主在锁超时/服务销毁时是 reject 而不是返回失败结果;这仍然是一次失败结论。
|
|
199
|
-
log.fail?.("host-manager", "Host plugin manager update call rejected");
|
|
200
|
-
return {
|
|
201
|
-
ok: false,
|
|
202
|
-
channel: UPDATE_CHANNEL.HOST_MANAGER,
|
|
203
|
-
reason: HOST_MANAGER_ERROR.CALL_FAILED,
|
|
204
|
-
from: String(installedVersion ?? ""),
|
|
205
|
-
to: String(targetVersion ?? ""),
|
|
206
|
-
step: "",
|
|
207
|
-
restored: false,
|
|
208
|
-
detail: typeof error?.code === "string" ? error.code : "",
|
|
209
|
-
hostErrorCode: typeof error?.code === "string" ? error.code : "",
|
|
210
|
-
nextAction: nextActionForHostError(typeof error?.code === "string" ? error.code : ""),
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
const interpreted = interpretHostManagerUpdate(outcome);
|
|
214
|
-
if (typeof onProgress === "function") {
|
|
215
|
-
try {
|
|
216
|
-
onProgress({ step: interpreted.step, from: interpreted.from, to: interpreted.to });
|
|
217
|
-
} catch {
|
|
218
|
-
// 进度回调不应影响更新结论
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
return { ...interpreted, channel: UPDATE_CHANNEL.HOST_MANAGER };
|
|
222
|
-
}
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
// issue #106:手机端「电脑端设置(只读)」的**固定白名单**。
|
|
2
|
-
//
|
|
3
|
-
// 安全契约(不可妥协):
|
|
4
|
-
// - 白名单只在宿主侧冻结;App **不保存副本、不拼路径、不接受运行时扩展**。
|
|
5
|
-
// - 投影只走这里列出的 `namespace + field path`;**没列出的项一律不返回**,
|
|
6
|
-
// 响应里没有的项在 UI 上就是不可见(不补默认、不猜 schema、不显示原始 JSON)。
|
|
7
|
-
// - 这里只放**无凭据、无文件系统路径、无会话正文**的配置字段。
|
|
8
|
-
//
|
|
9
|
-
// ## 冻结依据(2026-11-23,DSH 0.2.2-rc.5 `settings.describe()` 实测口径)
|
|
10
|
-
//
|
|
11
|
-
// 1. **只有 volatile 字段可达**:`dsh-settings` 的 `describe()` 先用 `volatileForm()`
|
|
12
|
-
// 过滤 schema,再用 `projectForm()` 投影值;非 volatile 字段既不进 `schema`,
|
|
13
|
-
// 也不进 `value`/`base`/`user`。因此白名单**只能**选 volatile 节点下的字段,
|
|
14
|
-
// 否则永远是"可见 0 项"(等于白列)。例:`agent-preset-registry.default` 与
|
|
15
|
-
// `permission.presets.*` 都**不是** volatile,故不列;列 `selectedDefault` / `defaultPreset`。
|
|
16
|
-
// 2. **secret 只以槽位出现**:`role('secret')`(密文本身)与 `role('credential-ref')`
|
|
17
|
-
// (凭据引用名,常内嵌账号 id)一律只作为 `kind:"secret"` 的「已设置/未设置」出现,
|
|
18
|
-
// 或干脆不列。`llm-pi-ai.providers.*.apiKeyEnv` 即属后者:引用名无展示价值,不列。
|
|
19
|
-
// 3. **一律不列**(宿主也不会替我们剥):
|
|
20
|
-
// - `headers` / `requestHeaders` / `accountRequestHeaders`(值可能是令牌);
|
|
21
|
-
// - `baseURL` / `proxyUrl` / `platformOrigin` / `inferenceOrigin`(可能内嵌 userinfo
|
|
22
|
-
// 或暴露主机拓扑);
|
|
23
|
-
// - `cwd` / `path` / `updateDir` / `documentPath` 等一切文件系统路径;
|
|
24
|
-
// - 自由文本(`description`、prompt 类)与会话正文、工具参数/结果。
|
|
25
|
-
// 4. **不按第三方插件猜**:只列 DSH 内置插件自带 schema 中语义稳定的字段;插件自由
|
|
26
|
-
// `object`/`dict`(形状会随版本漂移、无法逐字段断言脱敏)整段不列。
|
|
27
|
-
//
|
|
28
|
-
// ## 更新方式
|
|
29
|
-
// 改本文件后必跑 `node --test test/host-settings*.test.mjs`(含嵌套 secret / 默认值旁路 /
|
|
30
|
-
// 凭据 / 路径负例)。`HOST_SETTINGS_WHITELIST_VERSION` 只在**字段语义变化**时递增,
|
|
31
|
-
// 供诊断与后续契约迁移(App 不据此推断字段是否存在)。
|
|
32
|
-
//
|
|
33
|
-
// 路径里的 `*` 只表示「dict 的键 / 数组元素」,由宿主按实际值展开成具体键,
|
|
34
|
-
// 展开数量有上限(`lib/host-settings.js` 的 `MAX_WILDCARD_ITEMS`);超限即 fail-closed。
|
|
35
|
-
|
|
36
|
-
/** 白名单契约版本(字段语义变化时递增)。 */
|
|
37
|
-
export const HOST_SETTINGS_WHITELIST_VERSION = 1;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* 视觉分组(只分组,不新增可展示 key)。顺序即 UI 顺序。
|
|
41
|
-
*
|
|
42
|
-
* 按 /tmp/3.3.1-ui-design.md §2.3 的四组收敛掉「连接与宿主」:主机名/DSH 版本/运行模式
|
|
43
|
-
* **不是设置项**,由响应顶部的 `host` 段(及 App 本地连接档案名)承载,不进 `namespaces`,
|
|
44
|
-
* 避免把"宿主事实"混进"设置字段"里造成来源/默认值语义不清。
|
|
45
|
-
*/
|
|
46
|
-
export const HOST_SETTINGS_GROUPS = Object.freeze([
|
|
47
|
-
Object.freeze({ id: "model-routing", title: "模型与路由", titleEn: "Model & routing" }),
|
|
48
|
-
Object.freeze({ id: "permissions", title: "权限与审批", titleEn: "Permissions & approval" }),
|
|
49
|
-
Object.freeze({ id: "session-agent", title: "会话与代理", titleEn: "Sessions & agents" }),
|
|
50
|
-
]);
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* 固定白名单。每条 = 一个 namespace 下的一个 field path(`path` 中的 `*` 为 dict 键)。
|
|
54
|
-
* `title` / `titleEn` 是该行的固定标题(宿主算好,App 不再猜 schema 标题)。
|
|
55
|
-
*/
|
|
56
|
-
export const HOST_SETTINGS_WHITELIST = Object.freeze([
|
|
57
|
-
// ── 模型与路由 ────────────────────────────────────────────────
|
|
58
|
-
// agent-default-model:三者都 `.volatile()`,是纯标识串,不含密钥
|
|
59
|
-
// (密钥在各自 llm-* 命名空间,已从白名单排除)。
|
|
60
|
-
Object.freeze({
|
|
61
|
-
ns: "agent-default-model",
|
|
62
|
-
group: "model-routing",
|
|
63
|
-
namespaceTitle: "默认模型",
|
|
64
|
-
namespaceTitleEn: "Default model",
|
|
65
|
-
path: Object.freeze(["provider"]),
|
|
66
|
-
title: "默认提供商",
|
|
67
|
-
titleEn: "Default provider",
|
|
68
|
-
}),
|
|
69
|
-
Object.freeze({
|
|
70
|
-
ns: "agent-default-model",
|
|
71
|
-
group: "model-routing",
|
|
72
|
-
namespaceTitle: "默认模型",
|
|
73
|
-
namespaceTitleEn: "Default model",
|
|
74
|
-
path: Object.freeze(["model"]),
|
|
75
|
-
title: "默认模型",
|
|
76
|
-
titleEn: "Default model",
|
|
77
|
-
}),
|
|
78
|
-
Object.freeze({
|
|
79
|
-
ns: "agent-default-model",
|
|
80
|
-
group: "model-routing",
|
|
81
|
-
namespaceTitle: "默认模型",
|
|
82
|
-
namespaceTitleEn: "Default model",
|
|
83
|
-
path: Object.freeze(["reasoningEffort"]),
|
|
84
|
-
title: "推理强度",
|
|
85
|
-
titleEn: "Reasoning effort",
|
|
86
|
-
}),
|
|
87
|
-
// llm-pi-ai:`providers` 整棵子树是 volatile dict,可按 route 展开。
|
|
88
|
-
// 只取显示名与默认上下文窗口;`apiKeyEnv`(credential-ref)、`baseURL`、`headers`、
|
|
89
|
-
// `models` / `modelOverrides`(含端点与自由形状)**都不列**。
|
|
90
|
-
Object.freeze({
|
|
91
|
-
ns: "llm-pi-ai",
|
|
92
|
-
group: "model-routing",
|
|
93
|
-
namespaceTitle: "提供商路由",
|
|
94
|
-
namespaceTitleEn: "Provider routes",
|
|
95
|
-
path: Object.freeze(["providers", "*", "displayName"]),
|
|
96
|
-
title: "提供商名称",
|
|
97
|
-
titleEn: "Provider name",
|
|
98
|
-
}),
|
|
99
|
-
Object.freeze({
|
|
100
|
-
ns: "llm-pi-ai",
|
|
101
|
-
group: "model-routing",
|
|
102
|
-
namespaceTitle: "提供商路由",
|
|
103
|
-
namespaceTitleEn: "Provider routes",
|
|
104
|
-
path: Object.freeze(["providers", "*", "defaultContextWindow"]),
|
|
105
|
-
title: "上下文窗口",
|
|
106
|
-
titleEn: "Context window",
|
|
107
|
-
}),
|
|
108
|
-
// web-search-deepseek:联网搜索的模型与配额。`apiKey` 是 `role('secret')`,
|
|
109
|
-
// 只作为 secret 槽位(已设置/未设置),永不带值/长度/前缀。
|
|
110
|
-
// `baseURL` / `apiKeyEnv` / `apiVersion` 不列。
|
|
111
|
-
Object.freeze({
|
|
112
|
-
ns: "web-search-deepseek",
|
|
113
|
-
group: "model-routing",
|
|
114
|
-
namespaceTitle: "联网搜索",
|
|
115
|
-
namespaceTitleEn: "Web search",
|
|
116
|
-
path: Object.freeze(["model"]),
|
|
117
|
-
title: "搜索模型",
|
|
118
|
-
titleEn: "Search model",
|
|
119
|
-
}),
|
|
120
|
-
Object.freeze({
|
|
121
|
-
ns: "web-search-deepseek",
|
|
122
|
-
group: "model-routing",
|
|
123
|
-
namespaceTitle: "联网搜索",
|
|
124
|
-
namespaceTitleEn: "Web search",
|
|
125
|
-
path: Object.freeze(["maxUses"]),
|
|
126
|
-
title: "单次最多搜索次数",
|
|
127
|
-
titleEn: "Max searches per request",
|
|
128
|
-
}),
|
|
129
|
-
Object.freeze({
|
|
130
|
-
ns: "web-search-deepseek",
|
|
131
|
-
group: "model-routing",
|
|
132
|
-
namespaceTitle: "联网搜索",
|
|
133
|
-
namespaceTitleEn: "Web search",
|
|
134
|
-
path: Object.freeze(["maxTokens"]),
|
|
135
|
-
title: "回复 token 上限",
|
|
136
|
-
titleEn: "Max reply tokens",
|
|
137
|
-
}),
|
|
138
|
-
Object.freeze({
|
|
139
|
-
ns: "web-search-deepseek",
|
|
140
|
-
group: "model-routing",
|
|
141
|
-
namespaceTitle: "联网搜索",
|
|
142
|
-
namespaceTitleEn: "Web search",
|
|
143
|
-
path: Object.freeze(["apiKey"]),
|
|
144
|
-
title: "API 密钥",
|
|
145
|
-
titleEn: "API key",
|
|
146
|
-
}),
|
|
147
|
-
|
|
148
|
-
// ── 权限与审批 ────────────────────────────────────────────────
|
|
149
|
-
// permission:`defaultPreset` 是唯一的 volatile 字段。`presets` 表**不是** volatile,
|
|
150
|
-
// describe() 里根本不存在,故不列(不制造"永远 0 项"的假字段)。
|
|
151
|
-
Object.freeze({
|
|
152
|
-
ns: "permission",
|
|
153
|
-
group: "permissions",
|
|
154
|
-
namespaceTitle: "权限预设",
|
|
155
|
-
namespaceTitleEn: "Permission presets",
|
|
156
|
-
path: Object.freeze(["defaultPreset"]),
|
|
157
|
-
title: "默认权限预设",
|
|
158
|
-
titleEn: "Default permission preset",
|
|
159
|
-
}),
|
|
160
|
-
|
|
161
|
-
// ── 会话与代理 ────────────────────────────────────────────────
|
|
162
|
-
// agent-preset-registry:`default` 非 volatile(describe 不可见),只有
|
|
163
|
-
// `selectedDefault` 可见;如实只列后者,标题也按"当前选中"而非"默认",
|
|
164
|
-
// 不让 UI 把运行态覆盖误标成默认值。
|
|
165
|
-
Object.freeze({
|
|
166
|
-
ns: "agent-preset-registry",
|
|
167
|
-
group: "session-agent",
|
|
168
|
-
namespaceTitle: "Agent 预设",
|
|
169
|
-
namespaceTitleEn: "Agent presets",
|
|
170
|
-
path: Object.freeze(["selectedDefault"]),
|
|
171
|
-
title: "当前选中的预设",
|
|
172
|
-
titleEn: "Selected preset",
|
|
173
|
-
}),
|
|
174
|
-
// subagent:子代理深度与并发上限,两个数字字段,无路径/正文。
|
|
175
|
-
Object.freeze({
|
|
176
|
-
ns: "subagent",
|
|
177
|
-
group: "session-agent",
|
|
178
|
-
namespaceTitle: "子代理",
|
|
179
|
-
namespaceTitleEn: "Subagents",
|
|
180
|
-
path: Object.freeze(["maxDepth"]),
|
|
181
|
-
title: "最大层级",
|
|
182
|
-
titleEn: "Max depth",
|
|
183
|
-
}),
|
|
184
|
-
Object.freeze({
|
|
185
|
-
ns: "subagent",
|
|
186
|
-
group: "session-agent",
|
|
187
|
-
namespaceTitle: "子代理",
|
|
188
|
-
namespaceTitleEn: "Subagents",
|
|
189
|
-
path: Object.freeze(["maxActiveSubagents"]),
|
|
190
|
-
title: "最大并发子代理",
|
|
191
|
-
titleEn: "Max active subagents",
|
|
192
|
-
}),
|
|
193
|
-
// agent-loop:并发工具上限。`agents[]` 含 `cwd`(绝对路径)与 resumeSessionId,
|
|
194
|
-
// **整段不列**,只列这一个数字。
|
|
195
|
-
Object.freeze({
|
|
196
|
-
ns: "agent-loop",
|
|
197
|
-
group: "session-agent",
|
|
198
|
-
namespaceTitle: "Agent 循环",
|
|
199
|
-
namespaceTitleEn: "Agent loop",
|
|
200
|
-
path: Object.freeze(["maxParallelToolCalls"]),
|
|
201
|
-
title: "最大并行工具调用",
|
|
202
|
-
titleEn: "Max parallel tool calls",
|
|
203
|
-
}),
|
|
204
|
-
]);
|
|
205
|
-
|
|
206
|
-
/** 白名单是否为空(fail-closed 判据之一)。 */
|
|
207
|
-
export const hostSettingsWhitelistIsEmpty = () => HOST_SETTINGS_WHITELIST.length === 0;
|