@xrkseek/harness-cli 0.1.3 → 0.1.5
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 +41 -22
- package/dist/commands/plugin.js +16 -16
- package/dist/commands/plugin.js.map +1 -1
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/serve.js +34 -3
- package/dist/commands/serve.js.map +1 -1
- package/dist/log.d.ts +6 -1
- package/dist/log.d.ts.map +1 -1
- package/dist/log.js +20 -6
- package/dist/log.js.map +1 -1
- package/dist/parse-args.js +8 -8
- package/dist/plugin/index.js +5 -5
- package/dist/plugin/index.js.map +1 -1
- package/dist/plugin/remap-inject.d.ts.map +1 -1
- package/dist/plugin/remap-inject.js +1 -0
- package/dist/plugin/remap-inject.js.map +1 -1
- package/node_modules/@xrkseek/preset-server/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@xrkseek/server-face/dist/auto-review-slash.d.ts +11 -0
- package/node_modules/@xrkseek/server-face/dist/auto-review-slash.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/auto-review-slash.js +13 -0
- package/node_modules/@xrkseek/server-face/dist/auto-review-slash.js.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/handlers/cost-meter.d.ts +15 -22
- package/node_modules/@xrkseek/server-face/dist/handlers/cost-meter.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/cost-meter.js +19 -16
- package/node_modules/@xrkseek/server-face/dist/handlers/cost-meter.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/index.d.ts +2 -1
- package/node_modules/@xrkseek/server-face/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/index.js +2 -1
- package/node_modules/@xrkseek/server-face/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/registry.d.ts +1 -0
- package/node_modules/@xrkseek/server-face/dist/projections/registry.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/registry.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/auto-review.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/auto-review.js +9 -13
- package/node_modules/@xrkseek/server-face/dist/projections/units/auto-review.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/context-headers.d.ts +22 -5
- package/node_modules/@xrkseek/server-face/dist/projections/units/context-headers.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/context-headers.js +31 -5
- package/node_modules/@xrkseek/server-face/dist/projections/units/context-headers.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/context-timeline.d.ts +42 -7
- package/node_modules/@xrkseek/server-face/dist/projections/units/context-timeline.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/context-timeline.js +182 -24
- package/node_modules/@xrkseek/server-face/dist/projections/units/context-timeline.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/cost-usage.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/cost-usage.js +26 -8
- package/node_modules/@xrkseek/server-face/dist/projections/units/cost-usage.js.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/index.js +12 -4
- package/node_modules/@xrkseek/server-host/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/sidebar-face-bridge.d.ts +10 -0
- package/node_modules/@xrkseek/server-host/dist/sidebar-face-bridge.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-host/dist/sidebar-face-bridge.js +192 -0
- package/node_modules/@xrkseek/server-host/dist/sidebar-face-bridge.js.map +1 -0
- package/node_modules/@xrkseek/server-host/dist/wallet-bridge.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/wallet-bridge.js +29 -1
- package/node_modules/@xrkseek/server-host/dist/wallet-bridge.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/adapter-providers.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/adapter-providers.js +3 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/adapter-providers.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/adapter-types.d.ts +4 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/adapter-types.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-http.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-http.js +9 -10
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-http.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-slash.d.ts +11 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-slash.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-slash.js +13 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-slash.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/chat-import-discovery.d.ts +41 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/chat-import-discovery.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/chat-import-discovery.js +422 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/chat-import-discovery.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/chat-import-registry.d.ts +21 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/chat-import-registry.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/chat-import-registry.js +34 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/chat-import-registry.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/chat-import.d.ts +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/chat-import.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/chat-import.js +277 -23
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/chat-import.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/community-root-http.d.ts +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/community-root-http.js +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/community-root-http.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/cordis-registry.d.ts +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/cordis-registry.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/cordis-registry.js +2 -2
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/cordis-registry.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-community-infer.js +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-community-infer.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-compat-matrix.d.ts +4 -4
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-compat-matrix.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-compat-matrix.js +52 -27
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-compat-matrix.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-envelope.js +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-envelope.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/generic-dsh-http.d.ts +2 -2
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/generic-dsh-http.js +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/generic-dsh-http.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/generic-plugin-http.js +3 -3
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/generic-plugin-http.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/genui.js +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/genui.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/honest-http-catchall.js +3 -3
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/honest-http-catchall.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/im-messaging-bridge.d.ts +2 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/im-messaging-bridge.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/im-messaging-bridge.js +53 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/im-messaging-bridge.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/index.d.ts +21 -18
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/index.js +28 -15
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/index.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/market.js +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/market.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/memento.d.ts +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/memento.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/memento.js +77 -24
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/memento.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mnemon.d.ts +24 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mnemon.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mnemon.js +39 -10
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mnemon.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-auth.d.ts +71 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-auth.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-auth.js +349 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-auth.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-cpolar-component.d.ts +53 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-cpolar-component.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-cpolar-component.js +233 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-cpolar-component.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-funnel-sidecar.d.ts +4 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-funnel-sidecar.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-funnel-sidecar.js +86 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-funnel-sidecar.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-gate.d.ts +15 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-gate.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-gate.js +41 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-gate.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-local-gateway.d.ts +22 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-local-gateway.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-local-gateway.js +183 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-local-gateway.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-remote-controllers.d.ts +68 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-remote-controllers.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-remote-controllers.js +511 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-remote-controllers.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-remote-runtime.d.ts +34 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-remote-runtime.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-remote-runtime.js +179 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-remote-runtime.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-remote.d.ts +19 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-remote.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-remote.js +102 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-remote.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access.d.ts +31 -4
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access.js +698 -33
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/modlens.js +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/modlens.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/modsearch.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/modsearch.js +4 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/modsearch.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/noema.js +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/noema.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/pocket-qrcode.d.ts +3 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/pocket-qrcode.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/pocket-qrcode.js +18 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/pocket-qrcode.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/pocket.d.ts +6 -3
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/pocket.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/pocket.js +204 -54
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/pocket.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/releases.js +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/releases.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/sidebar-adapter.d.ts +3 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/sidebar-adapter.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/sidebar-adapter.js +194 -22
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/sidebar-adapter.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/sidebar-browser.d.ts +3 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/sidebar-browser.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/sidebar-browser.js +82 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/sidebar-browser.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/sidebar-face-bridge.d.ts +51 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/sidebar-face-bridge.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/sidebar-face-bridge.js +2 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/sidebar-face-bridge.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/sidebar-git.d.ts +47 -13
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/sidebar-git.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/sidebar-git.js +146 -27
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/sidebar-git.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/skin-market.js +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/skin-market.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/tokenledger.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/tokenledger.js +22 -4
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/tokenledger.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/tongflow.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/tongflow.js +21 -2
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/tongflow.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/turn-rewind-workspace.js +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/turn-rewind-workspace.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/turn-rewind.d.ts +2 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/turn-rewind.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/turn-rewind.js +42 -3
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/turn-rewind.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/contracts/wallet-port.d.ts +25 -7
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/contracts/wallet-port.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/contracts/wallet-port.js +2 -2
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/doc-store.d.ts +2 -2
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/doc-store.js +2 -2
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/http-json.d.ts +12 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/http-json.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/http-json.js +40 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/http-json.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/http-kit.d.ts +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/http-kit.js +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/http-kit.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/index.d.ts +7 -12
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/index.js +5 -8
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/index.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/json-store.d.ts +5 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/json-store.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/json-store.js +31 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/json-store.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/mobile-gate-kit.d.ts +37 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/mobile-gate-kit.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/mobile-gate-kit.js +96 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/mobile-gate-kit.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/public-handler.d.ts +6 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/public-handler.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/public-handler.js +2 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/public-handler.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/wallet-service.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/wallet-service.js +66 -4
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/wallet-service.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/undo.js +2 -2
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/undo.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/usage-stats.js +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/usage-stats.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/vision.js +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/vision.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/wallet.d.ts +2 -2
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/wallet.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/wallet.js +2 -2
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/wallet.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/wallpaper.js +2 -2
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/wallpaper.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/wire/settings-provider.d.ts +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/wire/stub-handlers.js +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/wire/stub-handlers.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/xrk-json-store.js +3 -3
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/xrk-json-store.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/index.d.ts +1 -1
- package/node_modules/@xrkseek/server-http/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/index.js +1 -1
- package/node_modules/@xrkseek/server-http/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/server-http/package.json +7 -1
- package/node_modules/qrcode-generator/README.md +101 -0
- package/node_modules/qrcode-generator/package.json +30 -0
- package/node_modules/qrcode-generator/qrcode.d.ts +57 -0
- package/node_modules/qrcode-generator/qrcode.js +2297 -0
- package/node_modules/qrcode-generator/qrcode_SJIS.js +30 -0
- package/node_modules/qrcode-generator/qrcode_UTF8.js +26 -0
- package/node_modules/qrcode-generator/sample.html +49 -0
- package/node_modules/qrcode-generator/sample.js +49 -0
- package/node_modules/qrcode-generator/test/qrcode.js +118 -0
- package/package.json +4 -2
- package/product-web/assets/index-BNGm-t1O.js +112 -0
- package/product-web/assets/index-BNGm-t1O.js.map +1 -0
- package/product-web/boot.json +1 -1
- package/product-web/index.html +1 -1
- package/product-web/plugins/@xrkseek/client-locale/client.js +3 -3
- package/product-web/plugins/@xrkseek/client-modules/client.js +7 -6
- package/product-web/plugins/@xrkseek/client-runtime/client.js +7 -0
- package/product-web/plugins/@xrkseek/client-ui-agent-preset/client.js +38 -38
- package/product-web/plugins/@xrkseek/client-ui-attachment/client.js +8 -8
- package/product-web/plugins/@xrkseek/client-ui-commands/client.js +7 -7
- package/product-web/plugins/@xrkseek/client-ui-conversation/client.js +178 -185
- package/product-web/plugins/@xrkseek/client-ui-deliverables/client.js +5 -5
- package/product-web/plugins/@xrkseek/client-ui-directory-picker-browse/client.js +26 -26
- package/product-web/plugins/@xrkseek/client-ui-goal/client.js +8 -8
- package/product-web/plugins/@xrkseek/client-ui-input-trigger/client.js +7 -7
- package/product-web/plugins/@xrkseek/client-ui-jobs/client.js +9 -9
- package/product-web/plugins/@xrkseek/client-ui-layout/client.js +4 -4
- package/product-web/plugins/@xrkseek/client-ui-message-feedback/client.js +5 -5
- package/product-web/plugins/@xrkseek/client-ui-model-selection/client.js +18 -18
- package/product-web/plugins/@xrkseek/client-ui-permission-presets/client.js +4 -4
- package/product-web/plugins/@xrkseek/client-ui-plan/client.js +3 -3
- package/product-web/plugins/@xrkseek/client-ui-settings-general/client.js +27 -19
- package/product-web/plugins/@xrkseek/client-ui-settings-models/client.js +57 -57
- package/product-web/plugins/@xrkseek/client-ui-settings-plugin-inventory/client.js +12 -12
- package/product-web/plugins/@xrkseek/client-ui-settings-plugins/client.js +45 -45
- package/product-web/plugins/@xrkseek/client-ui-sidebar/client.js +15 -15
- package/product-web/plugins/@xrkseek/client-ui-skill/client.js +13 -13
- package/product-web/plugins/@xrkseek/client-ui-subagent/client.js +21 -21
- package/product-web/plugins/@xrkseek/client-ui-theme/client.js +3 -3
- package/product-web/plugins/@xrkseek/client-ui-tool/client.js +38 -38
- package/product-web/plugins/@xrkseek/client-ui-trajectory/client.js +142 -142
- package/product-web/plugins/@xrkseek/client-ui-user-questions/client.js +27 -27
- package/product-web/plugins/@xrkseek/client-ui-workflow-run/client.js +15 -15
- package/product-web/plugins/@xrkseek/client-ui-workspace/client.js +55 -55
- package/product-web/assets/index-C_NG-17x.js +0 -112
- package/product-web/assets/index-C_NG-17x.js.map +0 -1
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
* @anionex/dsh-turn-rewind — checkpoint preview/restore (file-backed index).
|
|
3
3
|
*/
|
|
4
4
|
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
5
|
+
import type { SidebarFaceBridge } from "./sidebar-face-bridge.js";
|
|
5
6
|
export interface TurnRewindOptions {
|
|
6
7
|
readonly xrkHome?: string;
|
|
7
8
|
readonly workspaceRoot?: string;
|
|
8
9
|
readonly defaultCwd?: string;
|
|
9
10
|
readonly resolveSessionCwd?: (sessionId: string) => string | undefined;
|
|
11
|
+
readonly sidebarFace?: SidebarFaceBridge;
|
|
10
12
|
}
|
|
11
13
|
export type { RewindMarker } from "./turn-rewind-store.js";
|
|
12
14
|
export { upsertRewindMarker, findRewindMarker } from "./turn-rewind-store.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"turn-rewind.d.ts","sourceRoot":"","sources":["../../src/dsh-compat/turn-rewind.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"turn-rewind.d.ts","sourceRoot":"","sources":["../../src/dsh-compat/turn-rewind.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAIjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAOlE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IACvE,QAAQ,CAAC,WAAW,CAAC,EAAE,iBAAiB,CAAC;CAC1C;AAED,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAoCzF,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,OAAO,CAAC,CAwGlB;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAE1D"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { sendJson } from "
|
|
1
|
+
import { sendJson } from "./underlying/http-json.js";
|
|
2
2
|
import { DSH_COMPAT_ADAPTER } from "./meta.js";
|
|
3
3
|
import { parseJsonBody } from "./underlying/http-kit.js";
|
|
4
4
|
import { findRewindMarker, } from "./turn-rewind-store.js";
|
|
@@ -74,17 +74,56 @@ export async function handleTurnRewindHttp(req, res, pathname, options) {
|
|
|
74
74
|
return true;
|
|
75
75
|
}
|
|
76
76
|
const mode = typeof body.mode === "string" ? body.mode : "code";
|
|
77
|
+
const bodyPlanId = typeof body.planId === "string" ? body.planId : undefined;
|
|
78
|
+
const bodyConfirmation = typeof body.confirmation === "string" ? body.confirmation : undefined;
|
|
79
|
+
if ((marker.planId && bodyPlanId !== marker.planId) ||
|
|
80
|
+
(marker.confirmation && bodyConfirmation !== marker.confirmation)) {
|
|
81
|
+
sendJson(res, 409, {
|
|
82
|
+
code: "PLAN_STALE",
|
|
83
|
+
error: "checkpoint plan is stale; refresh preview",
|
|
84
|
+
adapter: DSH_COMPAT_ADAPTER,
|
|
85
|
+
});
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
77
88
|
const cwd = (typeof body.cwd === "string" && body.cwd.trim()
|
|
78
89
|
? body.cwd.trim()
|
|
79
90
|
: undefined) ??
|
|
80
91
|
options.workspaceRoot ??
|
|
81
92
|
options.defaultCwd ??
|
|
82
93
|
process.cwd();
|
|
83
|
-
const
|
|
94
|
+
const shouldRestore = mode === "code" || mode === "both";
|
|
95
|
+
const shouldFork = mode === "chat" || mode === "both";
|
|
96
|
+
const restored = shouldRestore
|
|
97
|
+
? restoreRewindWorkspace(marker, cwd, options.xrkHome)
|
|
98
|
+
: false;
|
|
99
|
+
let resultSessionId = sid;
|
|
100
|
+
if (shouldFork) {
|
|
101
|
+
const bridge = options.sidebarFace;
|
|
102
|
+
if (!bridge?.forkSessionAt) {
|
|
103
|
+
sendJson(res, 503, {
|
|
104
|
+
code: "FORK_UNAVAILABLE",
|
|
105
|
+
error: "session fork requires XRK Host Face bridge",
|
|
106
|
+
adapter: DSH_COMPAT_ADAPTER,
|
|
107
|
+
});
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
try {
|
|
111
|
+
const forked = await bridge.forkSessionAt(sid, marker.messageSeq);
|
|
112
|
+
resultSessionId = forked.sessionId;
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
sendJson(res, 409, {
|
|
116
|
+
code: "FORK_FAILED",
|
|
117
|
+
error: error instanceof Error ? error.message : "session.fork failed",
|
|
118
|
+
adapter: DSH_COMPAT_ADAPTER,
|
|
119
|
+
});
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
84
123
|
sendJson(res, 200, {
|
|
85
124
|
mode,
|
|
86
125
|
rescuePointId: marker.checkpointId,
|
|
87
|
-
sessionId:
|
|
126
|
+
sessionId: resultSessionId,
|
|
88
127
|
restored,
|
|
89
128
|
adapter: DSH_COMPAT_ADAPTER,
|
|
90
129
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"turn-rewind.js","sourceRoot":"","sources":["../../src/dsh-compat/turn-rewind.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"turn-rewind.js","sourceRoot":"","sources":["../../src/dsh-compat/turn-rewind.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EACL,gBAAgB,GAEjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAWpE,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEzF,SAAS,YAAY,CACnB,MAAoB,EACpB,MAAM,GAAG,CAAC;IAEV,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1C,MAAM,MA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AAG,MAAM,MAAM,CAAC,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;gBAClE,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC;YACrC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE;oBACjB,IAAI,EAAE,aAAa;oBACnB,KAAK,EACH,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,qBAAqB;oBAChE,OAAO,EAAE,kBAAkB;iBAC5B,CAAC,CAAC;gBACH,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;QACD,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE;YACjB,IAAI;YACJ,aAAa,EAAE,MAAM,CAAC,YAAY;YAClC,SAAS,EAAE,eAAe;YAC1B,QAAQ;YACR,OAAO,EAAE,kBAAkB;SAC5B,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;IAED,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAE,CAAC,CAAC;IACpD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,QAAgB;IAC/C,OAAO,QAAQ,KAAK,cAAc,CAAC;AACrC,CAAC"}
|
package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/contracts/wallet-port.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* XRK
|
|
3
|
-
* Adapter
|
|
2
|
+
* XRK wallet port ↔ community wallet client HTTP shapes.
|
|
3
|
+
* Adapter forwards; bridge maps fields; service persists + Face data.
|
|
4
4
|
*/
|
|
5
|
-
/**
|
|
5
|
+
/** Community wallet client `GET /wallet/api/balance`. */
|
|
6
6
|
export interface DshWalletBalanceView {
|
|
7
7
|
readonly available?: boolean;
|
|
8
8
|
readonly error?: string;
|
|
@@ -17,7 +17,7 @@ export interface DshWalletBalanceView {
|
|
|
17
17
|
total: number;
|
|
18
18
|
}>;
|
|
19
19
|
}
|
|
20
|
-
/**
|
|
20
|
+
/** Community wallet client `GET /wallet/api/cost`. */
|
|
21
21
|
export interface DshWalletCostView {
|
|
22
22
|
readonly ok: boolean;
|
|
23
23
|
readonly cost?: number;
|
|
@@ -33,7 +33,7 @@ export interface DshWalletCostView {
|
|
|
33
33
|
readonly band?: "base" | "peak" | "offPeak";
|
|
34
34
|
readonly sessionId?: string;
|
|
35
35
|
}
|
|
36
|
-
/**
|
|
36
|
+
/** Community wallet client `GET /wallet/api/usage`. */
|
|
37
37
|
export interface DshWalletUsageView {
|
|
38
38
|
readonly ok: boolean;
|
|
39
39
|
readonly ready?: boolean;
|
|
@@ -47,7 +47,7 @@ export interface DshWalletUsageView {
|
|
|
47
47
|
readonly cost: number;
|
|
48
48
|
}>;
|
|
49
49
|
}
|
|
50
|
-
/** Face / cost-meter
|
|
50
|
+
/** Face / cost-meter injection — XRK source of truth (shape-agnostic). */
|
|
51
51
|
export interface WalletFaceBridge {
|
|
52
52
|
getSessionCost(sessionId?: string): Promise<{
|
|
53
53
|
readonly uncachedInputTokens: number;
|
|
@@ -72,10 +72,28 @@ export interface WalletFaceBridge {
|
|
|
72
72
|
readonly ready: boolean;
|
|
73
73
|
readonly degraded: boolean;
|
|
74
74
|
}>;
|
|
75
|
+
/** Official balance cache from cost-meter (e.g. DeepSeek `/user/balance`). */
|
|
76
|
+
getOfficialBalance(): Promise<{
|
|
77
|
+
readonly status: "ok" | "err" | "off";
|
|
78
|
+
readonly currency: string;
|
|
79
|
+
readonly totalBalance: number;
|
|
80
|
+
readonly fetchedAt?: number;
|
|
81
|
+
readonly message?: string;
|
|
82
|
+
} | null>;
|
|
83
|
+
/** Refresh official balance and return the latest cache. */
|
|
84
|
+
refreshOfficialBalance(): Promise<{
|
|
85
|
+
readonly status: "ok" | "err" | "off";
|
|
86
|
+
readonly currency: string;
|
|
87
|
+
readonly totalBalance: number;
|
|
88
|
+
readonly fetchedAt?: number;
|
|
89
|
+
readonly message?: string;
|
|
90
|
+
} | null>;
|
|
75
91
|
}
|
|
76
|
-
/** XRK
|
|
92
|
+
/** XRK wallet port — HTTP adapter calls only this interface. */
|
|
77
93
|
export interface XrkWalletPort {
|
|
78
94
|
getBalanceView(): Promise<DshWalletBalanceView>;
|
|
95
|
+
/** Refresh official balance cache, then read (wallet refresh button). */
|
|
96
|
+
refreshBalanceView(): Promise<DshWalletBalanceView>;
|
|
79
97
|
getCostView(sessionId?: string): Promise<DshWalletCostView>;
|
|
80
98
|
getUsageView(): Promise<DshWalletUsageView>;
|
|
81
99
|
setCostThreshold(threshold: number): Promise<number>;
|
package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/contracts/wallet-port.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallet-port.d.ts","sourceRoot":"","sources":["../../../../src/dsh-compat/underlying/contracts/wallet-port.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,
|
|
1
|
+
{"version":3,"file":"wallet-port.d.ts","sourceRoot":"","sources":["../../../../src/dsh-compat/underlying/contracts/wallet-port.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,yDAAyD;AACzD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvE,QAAQ,CAAC,GAAG,CAAC,EAAE,aAAa,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QA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,CAAC;CAC1C;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,cAAc,EAAE,OAAO,EAAE,CAAC;IAC1B,QAAQ,EAAE,gBAAgB,EAAE,CAAC;CAC9B"}
|
package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/contracts/wallet-port.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* XRK
|
|
3
|
-
* Adapter
|
|
2
|
+
* XRK wallet port ↔ community wallet client HTTP shapes.
|
|
3
|
+
* Adapter forwards; bridge maps fields; service persists + Face data.
|
|
4
4
|
*/
|
|
5
5
|
export {};
|
|
6
6
|
//# sourceMappingURL=wallet-port.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Named revisioned JSON doc store (`~/.xrk/<parts>` + revision envelope).
|
|
3
|
+
* Feature modules declare `parts` + defaults; adapters only wire routes.
|
|
4
4
|
*/
|
|
5
5
|
import { type XrkRevisionedDoc } from "../xrk-json-store.js";
|
|
6
6
|
export interface XrkDocStore<T> {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Named revisioned JSON doc store (`~/.xrk/<parts>` + revision envelope).
|
|
3
|
+
* Feature modules declare `parts` + defaults; adapters only wire routes.
|
|
4
4
|
*/
|
|
5
5
|
import { patchRevisionedDoc, readRevisionedDoc, } from "../xrk-json-store.js";
|
|
6
6
|
export function createXrkDocStore(parts, defaultData) {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP JSON helpers for dsh-compat (first-party; travels with `underlying/` on extract).
|
|
3
|
+
*/
|
|
4
|
+
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
5
|
+
export type Json = null | boolean | number | string | Json[] | {
|
|
6
|
+
readonly [k: string]: Json;
|
|
7
|
+
};
|
|
8
|
+
export declare function sendJson(res: ServerResponse, status: number, body: unknown, extra?: Record<string, string>): void;
|
|
9
|
+
export declare function readBody(req: IncomingMessage): Promise<string>;
|
|
10
|
+
export declare function rpcOk(rpcId: string, value: unknown): unknown;
|
|
11
|
+
export declare function rpcErr(rpcId: string, code: string, message: string, details?: Record<string, unknown>): unknown;
|
|
12
|
+
//# sourceMappingURL=http-json.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-json.d.ts","sourceRoot":"","sources":["../../../src/dsh-compat/underlying/http-json.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEjE,MAAM,MAAM,IAAI,GACZ,IAAI,GACJ,OAAO,GACP,MAAM,GACN,MAAM,GACN,IAAI,EAAE,GACN;IAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAEnC,wBAAgB,QAAQ,CACtB,GAAG,EAAE,cAAc,EACnB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,OAAO,EACb,KAAK,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GACjC,IAAI,CASN;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAO9D;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAM5D;AAED,wBAAgB,MAAM,CACpB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,OAAO,CAaT"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export function sendJson(res, status, body, extra = {}) {
|
|
2
|
+
const data = JSON.stringify(body);
|
|
3
|
+
res.writeHead(status, {
|
|
4
|
+
"content-type": "application/json; charset=utf-8",
|
|
5
|
+
"cache-control": "no-store",
|
|
6
|
+
"content-length": Buffer.byteLength(data),
|
|
7
|
+
...extra,
|
|
8
|
+
});
|
|
9
|
+
res.end(data);
|
|
10
|
+
}
|
|
11
|
+
export function readBody(req) {
|
|
12
|
+
return new Promise((resolve, reject) => {
|
|
13
|
+
const chunks = [];
|
|
14
|
+
req.on("data", (c) => chunks.push(Buffer.from(c)));
|
|
15
|
+
req.on("end", () => resolve(Buffer.concat(chunks).toString("utf8")));
|
|
16
|
+
req.on("error", reject);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
export function rpcOk(rpcId, value) {
|
|
20
|
+
return {
|
|
21
|
+
type: "server-response",
|
|
22
|
+
rpcId,
|
|
23
|
+
result: { ok: true, value },
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export function rpcErr(rpcId, code, message, details) {
|
|
27
|
+
return {
|
|
28
|
+
type: "server-response",
|
|
29
|
+
rpcId,
|
|
30
|
+
result: {
|
|
31
|
+
ok: false,
|
|
32
|
+
error: {
|
|
33
|
+
code,
|
|
34
|
+
message,
|
|
35
|
+
details: { adapter: "xrk-dsh-compat", ...details },
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=http-json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-json.js","sourceRoot":"","sources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AEjC,OAAO;QACL,IAAI,EAAE,iBAAiB;QACvB,KAAK;QACL,MAAM,EAAE;YACN,EAAE,EAAE,KAAK;YACT,KAAK,EAAE;gBACL,IAAI;gBACJ,OAAO;gBACP,OAAO,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE,GAAG,OAAO,EAAE;aACnD;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-kit.js","sourceRoot":"","sources":["../../../src/dsh-compat/underlying/http-kit.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"http-kit.js","sourceRoot":"","sources":["../../../src/dsh-compat/underlying/http-kit.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,MAAM,UAAU,UAAU,CAAC,GAAoB;IAC7C,OAAO,CAAC,GAAG,CAAC,MAAM,IAAI,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,MAAc;IAC7C,OAAO,MAAM,KAAK,MAAM,IAAI,MAAM,KAAK,KAAK,IAAI,MAAM,KAAK,OAAO,CAAC;AACrE,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,GAAoB;IAEpB,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAC;IAChC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,CAA4B,CAAC;IAC5D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,GAAoB;IAC1D,IAAI,gBAAgB,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;QACtC,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAC;IACtB,CAAC;AACH,CAAC"}
|
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* | Primitive | 用途 |
|
|
5
|
-
* |-----------|------|
|
|
6
|
-
* | `createXrkDocStore` | 具名 revision 文档(wallet、memento、IM…) |
|
|
7
|
-
* | `parseJsonBody` / `httpMethod` | HTTP 路由只读一次 body |
|
|
8
|
-
* | `honest-envelope` | 诚实 `*-host` / ready JSON |
|
|
9
|
-
* | `persisted-settings-store` | Cordis `*-settings` RPC |
|
|
2
|
+
* Underlying primitives for the community Host adapter.
|
|
3
|
+
* Self-contained: extract this folder with zero imports from server-http root.
|
|
10
4
|
*/
|
|
5
|
+
export { dataPath, ensureDir, readJsonFile, writeJsonFile, } from "./json-store.js";
|
|
11
6
|
export { createXrkDocStore, type XrkDocStore, } from "./doc-store.js";
|
|
7
|
+
export { readBody, rpcErr, rpcOk, sendJson, type Json, } from "./http-json.js";
|
|
12
8
|
export { drainMutatingBody, httpMethod, isMutatingMethod, parseJsonBody, } from "./http-kit.js";
|
|
13
|
-
|
|
9
|
+
export { applyMobileGateDecision, classifyRequestHost, effectiveRequestHost, evaluateMobileGate, hostOnly, isMobileGateExemptPath, type MobileGateCredentials, type MobileGateDecision, type MobileGateMode, type MobileGateSnapshot, type RequestHostClass, } from "./mobile-gate-kit.js";
|
|
10
|
+
export type { PublicRouteHandlerFn } from "./public-handler.js";
|
|
11
|
+
/** Module contract for docs (not enforced at runtime). */
|
|
14
12
|
export interface DshUnderlyingModule {
|
|
15
|
-
/** 稳定 id,对齐 `dsh-compat-matrix` genericModule */
|
|
16
13
|
readonly id: string;
|
|
17
|
-
/** `~/.xrk` 下相对路径段(可多个 doc) */
|
|
18
14
|
readonly storageParts: readonly (readonly string[])[];
|
|
19
|
-
/** HTTP 能力表前缀或 RPC channel(由 adapter-providers 挂载) */
|
|
20
15
|
readonly surfaces: readonly string[];
|
|
21
16
|
}
|
|
22
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dsh-compat/underlying/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dsh-compat/underlying/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,iBAAiB,EACjB,KAAK,WAAW,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,QAAQ,EACR,MAAM,EACN,KAAK,EACL,QAAQ,EACR,KAAK,IAAI,GACV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,iBAAiB,EACjB,UAAU,EACV,gBAAgB,EAChB,aAAa,GACd,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,QAAQ,EACR,sBAAsB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAEhE,0DAA0D;AAC1D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,YAAY,EAAE,SAAS,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAC;IACtD,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* | Primitive | 用途 |
|
|
5
|
-
* |-----------|------|
|
|
6
|
-
* | `createXrkDocStore` | 具名 revision 文档(wallet、memento、IM…) |
|
|
7
|
-
* | `parseJsonBody` / `httpMethod` | HTTP 路由只读一次 body |
|
|
8
|
-
* | `honest-envelope` | 诚实 `*-host` / ready JSON |
|
|
9
|
-
* | `persisted-settings-store` | Cordis `*-settings` RPC |
|
|
2
|
+
* Underlying primitives for the community Host adapter.
|
|
3
|
+
* Self-contained: extract this folder with zero imports from server-http root.
|
|
10
4
|
*/
|
|
5
|
+
export { dataPath, ensureDir, readJsonFile, writeJsonFile, } from "./json-store.js";
|
|
11
6
|
export { createXrkDocStore, } from "./doc-store.js";
|
|
7
|
+
export { readBody, rpcErr, rpcOk, sendJson, } from "./http-json.js";
|
|
12
8
|
export { drainMutatingBody, httpMethod, isMutatingMethod, parseJsonBody, } from "./http-kit.js";
|
|
9
|
+
export { applyMobileGateDecision, classifyRequestHost, effectiveRequestHost, evaluateMobileGate, hostOnly, isMobileGateExemptPath, } from "./mobile-gate-kit.js";
|
|
13
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dsh-compat/underlying/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dsh-compat/underlying/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,iBAAiB,GAElB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,QAAQ,EACR,MAAM,EACN,KAAK,EACL,QAAQ,GAET,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,iBAAiB,EACjB,UAAU,EACV,gBAAgB,EAChB,aAAa,GACd,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,QAAQ,EACR,sBAAsB,GAMvB,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function ensureDir(dir: string): void;
|
|
2
|
+
export declare function readJsonFile<T>(file: string, fallback: T): T;
|
|
3
|
+
export declare function writeJsonFile(file: string, data: unknown): void;
|
|
4
|
+
export declare function dataPath(xrkHome: string | undefined, ...parts: string[]): string;
|
|
5
|
+
//# sourceMappingURL=json-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-store.d.ts","sourceRoot":"","sources":["../../../src/dsh-compat/underlying/json-store.ts"],"names":[],"mappings":"AAOA,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE3C;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,CAO5D;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,CAG/D;AAED,wBAAgB,QAAQ,CACtB,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,GAAG,KAAK,EAAE,MAAM,EAAE,GACjB,MAAM,CAMR"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path + JSON file primitives (`XRK_HOME` / `~/.xrk`).
|
|
3
|
+
*/
|
|
4
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
5
|
+
import { homedir } from "node:os";
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
export function ensureDir(dir) {
|
|
8
|
+
if (!existsSync(dir))
|
|
9
|
+
mkdirSync(dir, { recursive: true });
|
|
10
|
+
}
|
|
11
|
+
export function readJsonFile(file, fallback) {
|
|
12
|
+
try {
|
|
13
|
+
if (!existsSync(file))
|
|
14
|
+
return fallback;
|
|
15
|
+
return JSON.parse(readFileSync(file, "utf8"));
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
return fallback;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export function writeJsonFile(file, data) {
|
|
22
|
+
ensureDir(path.dirname(file));
|
|
23
|
+
writeFileSync(file, `${JSON.stringify(data, null, 2)}\n`, "utf8");
|
|
24
|
+
}
|
|
25
|
+
export function dataPath(xrkHome, ...parts) {
|
|
26
|
+
const home = xrkHome?.trim() ||
|
|
27
|
+
process.env.XRK_HOME?.trim() ||
|
|
28
|
+
path.join(homedir(), ".xrk");
|
|
29
|
+
return path.join(path.resolve(home), ...parts);
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=json-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-store.js","sourceRoot":"","sources":["../../../src/dsh-compat/underlying/json-store.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,UAAU,SAAS,CAAC,GAAW;IACnC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAC5D,CAAC;AAED,MAAM,UAAU,YAAY,CAAI,IAAY,EAAE,QAAW;IACvD,IAAI,CAAC;QACH,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;YAAE,OAAO,QAAQ,CAAC;QACvC,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAM,CAAC;IACrD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAY,EAAE,IAAa;IACvD,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9B,aAAa,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACpE,CAAC;AAED,MAAM,UAAU,QAAQ,CACtB,OAA2B,EAC3B,GAAG,KAAe;IAElB,MAAM,IAAI,GACR,OAAO,EAAE,IAAI,EAAE;QACf,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,EAAE;QAC5B,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,CAAC,CAAC;IAC/B,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mobile-access gate primitives — network class + PIN / session checks.
|
|
3
|
+
* Shared by any client using LAN or public origins.
|
|
4
|
+
*/
|
|
5
|
+
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
6
|
+
export type RequestHostClass = "loopback" | "lan" | "wan";
|
|
7
|
+
export type MobileGateMode = "none" | "lan" | "wan";
|
|
8
|
+
export interface MobileGateSnapshot {
|
|
9
|
+
readonly running: boolean;
|
|
10
|
+
readonly lanAuthEnabled: boolean;
|
|
11
|
+
readonly lanToken: string;
|
|
12
|
+
readonly wanToken: string;
|
|
13
|
+
readonly instanceId: string;
|
|
14
|
+
}
|
|
15
|
+
export interface MobileGateDecision {
|
|
16
|
+
readonly mode: MobileGateMode;
|
|
17
|
+
readonly allowed: boolean;
|
|
18
|
+
readonly pinPath?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface MobileGateCredentials {
|
|
21
|
+
readonly hasDeviceSession: boolean;
|
|
22
|
+
readonly hasLanPin: boolean;
|
|
23
|
+
readonly hasWanPin: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare function hostOnly(hostHeader: string | undefined): string;
|
|
26
|
+
/** Prefer X-Forwarded-Host (tunnel / reverse proxy) over Host. */
|
|
27
|
+
export declare function effectiveRequestHost(req: IncomingMessage): string;
|
|
28
|
+
export declare function classifyRequestHost(host: string): RequestHostClass;
|
|
29
|
+
export declare function isMobileGateExemptPath(pathname: string): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Loopback free; public Host → wan PIN/session;
|
|
32
|
+
* private LAN Host → lan PIN/session when lanAuthEnabled.
|
|
33
|
+
*/
|
|
34
|
+
export declare function evaluateMobileGate(pathname: string, host: string, snapshot: MobileGateSnapshot, credentials: MobileGateCredentials): MobileGateDecision;
|
|
35
|
+
/** Apply a gate decision to the HTTP response; true = response finished. */
|
|
36
|
+
export declare function applyMobileGateDecision(req: IncomingMessage, res: ServerResponse, decision: MobileGateDecision): boolean;
|
|
37
|
+
//# sourceMappingURL=mobile-gate-kit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobile-gate-kit.d.ts","sourceRoot":"","sources":["../../../src/dsh-compat/underlying/mobile-gate-kit.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAGjE,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,KAAK,GAAG,KAAK,CAAC;AAC1D,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,CAAC;AAEpD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B;AAID,wBAAgB,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAQ/D;AAED,kEAAkE;AAClE,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,CAMjE;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAWlE;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEhE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,kBAAkB,EAC5B,WAAW,EAAE,qBAAqB,GACjC,kBAAkB,CA6BpB;AAWD,4EAA4E;AAC5E,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,QAAQ,EAAE,kBAAkB,GAC3B,OAAO,CAiBT"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { sendJson } from "./http-json.js";
|
|
2
|
+
const LOOPBACK = new Set(["127.0.0.1", "localhost", "::1"]);
|
|
3
|
+
export function hostOnly(hostHeader) {
|
|
4
|
+
const raw = (hostHeader ?? "").trim().toLowerCase();
|
|
5
|
+
if (!raw)
|
|
6
|
+
return "";
|
|
7
|
+
if (raw.startsWith("[")) {
|
|
8
|
+
const end = raw.indexOf("]");
|
|
9
|
+
return end >= 0 ? raw.slice(1, end) : raw;
|
|
10
|
+
}
|
|
11
|
+
return raw.split(":")[0] ?? raw;
|
|
12
|
+
}
|
|
13
|
+
/** Prefer X-Forwarded-Host (tunnel / reverse proxy) over Host. */
|
|
14
|
+
export function effectiveRequestHost(req) {
|
|
15
|
+
const forwarded = req.headers["x-forwarded-host"];
|
|
16
|
+
if (typeof forwarded === "string" && forwarded.trim()) {
|
|
17
|
+
return hostOnly(forwarded.split(",")[0].trim());
|
|
18
|
+
}
|
|
19
|
+
return hostOnly(req.headers.host);
|
|
20
|
+
}
|
|
21
|
+
export function classifyRequestHost(host) {
|
|
22
|
+
if (!host || LOOPBACK.has(host))
|
|
23
|
+
return "loopback";
|
|
24
|
+
const m = /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/.exec(host);
|
|
25
|
+
if (m) {
|
|
26
|
+
const a = Number(m[1]);
|
|
27
|
+
const b = Number(m[2]);
|
|
28
|
+
if (a === 10)
|
|
29
|
+
return "lan";
|
|
30
|
+
if (a === 192 && b === 168)
|
|
31
|
+
return "lan";
|
|
32
|
+
if (a === 172 && b >= 16 && b <= 31)
|
|
33
|
+
return "lan";
|
|
34
|
+
}
|
|
35
|
+
return "wan";
|
|
36
|
+
}
|
|
37
|
+
export function isMobileGateExemptPath(pathname) {
|
|
38
|
+
return pathname === "/health" || pathname.startsWith("/mobile-access/");
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Loopback free; public Host → wan PIN/session;
|
|
42
|
+
* private LAN Host → lan PIN/session when lanAuthEnabled.
|
|
43
|
+
*/
|
|
44
|
+
export function evaluateMobileGate(pathname, host, snapshot, credentials) {
|
|
45
|
+
if (isMobileGateExemptPath(pathname) || !snapshot.running) {
|
|
46
|
+
return { mode: "none", allowed: true };
|
|
47
|
+
}
|
|
48
|
+
const hostClass = classifyRequestHost(host);
|
|
49
|
+
if (hostClass === "loopback") {
|
|
50
|
+
return { mode: "none", allowed: true };
|
|
51
|
+
}
|
|
52
|
+
if (hostClass === "wan") {
|
|
53
|
+
const allowed = credentials.hasDeviceSession ||
|
|
54
|
+
(Boolean(snapshot.wanToken) && credentials.hasWanPin);
|
|
55
|
+
return {
|
|
56
|
+
mode: "wan",
|
|
57
|
+
allowed,
|
|
58
|
+
pinPath: "/mobile-access/wan-pin",
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
if (snapshot.lanAuthEnabled === false) {
|
|
62
|
+
return { mode: "none", allowed: true };
|
|
63
|
+
}
|
|
64
|
+
const allowed = credentials.hasDeviceSession ||
|
|
65
|
+
(Boolean(snapshot.lanToken) && credentials.hasLanPin);
|
|
66
|
+
return {
|
|
67
|
+
mode: "lan",
|
|
68
|
+
allowed,
|
|
69
|
+
pinPath: "/mobile-access/lan-pin",
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function wantsHtml(req) {
|
|
73
|
+
const accept = req.headers.accept ?? "";
|
|
74
|
+
const method = (req.method ?? "GET").toUpperCase();
|
|
75
|
+
return ((method === "GET" || method === "HEAD") &&
|
|
76
|
+
(accept.includes("text/html") || accept === "" || accept.includes("*/*")));
|
|
77
|
+
}
|
|
78
|
+
/** Apply a gate decision to the HTTP response; true = response finished. */
|
|
79
|
+
export function applyMobileGateDecision(req, res, decision) {
|
|
80
|
+
if (decision.allowed)
|
|
81
|
+
return false;
|
|
82
|
+
const returnTo = encodeURIComponent((req.url ?? "/").startsWith("/") ? (req.url ?? "/") : `/${req.url ?? ""}`);
|
|
83
|
+
const pinUrl = `${decision.pinPath ?? "/mobile-access/wan-pin"}?return=${returnTo}`;
|
|
84
|
+
if (wantsHtml(req)) {
|
|
85
|
+
res.writeHead(302, { location: pinUrl });
|
|
86
|
+
res.end();
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
sendJson(res, 401, {
|
|
90
|
+
error: "mobile_access_authentication_required",
|
|
91
|
+
mode: decision.mode,
|
|
92
|
+
pinUrl: decision.pinPath,
|
|
93
|
+
});
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=mobile-gate-kit.js.map
|
|
@@ -0,0 +1 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AAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,GAAG,IAAI,EAAE,EAAE,CAC1E,CAAC;IACF,MAAM,MAAM,GAAG,GAAG,QAAQ,CAAC,OAAO,IAAI,wBAAwB,WAAW,QAAQ,EAAE,CAAC;IACpF,IAAI,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC;QACnB,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;QACzC,GAAG,CAAC,GAAG,EAAE,CAAC;QACV,OAAO,IAAI,CAAC;IACd,CAAC;IACD,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE;QACjB,KAAK,EAAE,uCAAuC;QAC9C,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,MAAM,EAAE,QAAQ,CAAC,OAAO;KACzB,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public HTTP claim handler shape (local type; not coupled to server-http root).
|
|
3
|
+
*/
|
|
4
|
+
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
5
|
+
export type PublicRouteHandlerFn = (req: IncomingMessage, res: ServerResponse) => boolean | Promise<boolean>;
|
|
6
|
+
//# sourceMappingURL=public-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-handler.d.ts","sourceRoot":"","sources":["../../../src/dsh-compat/underlying/public-handler.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEjE,MAAM,MAAM,oBAAoB,GAAG,CACjC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,KAChB,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-handler.js","sourceRoot":"","sources":["../../../src/dsh-compat/underlying/public-handler.ts"],"names":[],"mappings":""}
|
package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/wallet-service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallet-service.d.ts","sourceRoot":"","sources":["../../../src/dsh-compat/underlying/wallet-service.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAKV,gBAAgB,EAEhB,aAAa,EACd,MAAM,4BAA4B,CAAC;AA2CpC,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAC;CAClC;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,uBAAuB,GAC/B,aAAa,
|
|
1
|
+
{"version":3,"file":"wallet-service.d.ts","sourceRoot":"","sources":["../../../src/dsh-compat/underlying/wallet-service.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAKV,gBAAgB,EAEhB,aAAa,EACd,MAAM,4BAA4B,CAAC;AA2CpC,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAC;CAClC;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,uBAAuB,GAC/B,aAAa,CAkOf;AAED,iEAAiE;AACjE,wBAAgB,mBAAmB,CACjC,MAAM,EAAE;IACN,mBAAmB,EAAE,MAAM,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;CACjB,EACD,YAAY,EAAE,MAAM,GACnB;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;CACpE,CAWA"}
|