@takboo/dsh-coopanion 0.4.8 → 0.4.10
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 +60 -95
- package/desktop/display-controller.cjs +21 -0
- package/desktop/keyboard-activity-win.cs +52 -0
- package/desktop/keyboard-activity-x11.py +77 -0
- package/desktop/keyboard-activity.cjs +54 -0
- package/desktop/keyboard-activity.jxa +27 -0
- package/desktop/lifecycle-state-macos.jxa +16 -0
- package/desktop/lifecycle-state.cjs +21 -0
- package/desktop/main.cjs +110 -38
- package/desktop/preload.cjs +5 -0
- package/desktop/test-display-probe.cjs +13 -0
- package/desktop/tray-state.cjs +5 -4
- package/dist/bridge.js +53 -19
- package/dist/bridge.js.map +3 -3
- package/dist/build-info.json +6 -0
- package/dist/client.js +182 -14
- package/dist/companion-store.cjs +19907 -0
- package/dist/diagnostics.cjs +170 -0
- package/dist/figure-server.cjs +19725 -23
- package/dist/index.js +494 -85
- package/dist/index.js.map +4 -4
- package/dist/model.js +71 -4
- package/dist/model.js.map +3 -3
- package/docs/README.md +67 -0
- package/docs/archive/2026-10-m1-m6/roadmap.md +186 -0
- package/docs/{notification-implementation.md → archive/2026-10-notifications/notification-implementation.md} +3 -1
- package/docs/{notification-n0.md → archive/2026-10-notifications/notification-n0.md} +8 -6
- package/docs/{notification-n3.md → archive/2026-10-notifications/notification-n3.md} +2 -0
- package/docs/{notification-n4.md → archive/2026-10-notifications/notification-n4.md} +2 -0
- package/docs/{notification-plan.md → archive/2026-10-notifications/notification-plan.md} +4 -2
- package/docs/archive/2026-10-p1/roadmap-20261015.md +150 -0
- package/docs/archive/README.md +12 -0
- package/docs/archive/npm-bootstrap.md +18 -0
- package/docs/assets/README.md +16 -0
- package/docs/assets/showcase/appearance.png +0 -0
- package/docs/assets/showcase/companion.gif +0 -0
- package/docs/assets/showcase/conversation.png +0 -0
- package/docs/assets/showcase/inbox.png +0 -0
- package/docs/character-art-pipeline.md +122 -0
- package/docs/characters.md +10 -2
- package/docs/companionship-contract.md +70 -0
- package/docs/daily-rhythm-contract.md +31 -0
- package/docs/desktop-recovery-contract.md +21 -0
- package/docs/development.md +87 -0
- package/docs/diagnostics-contract.md +43 -0
- package/docs/evidence/AGENTS.md +5 -0
- package/docs/evidence/README.md +22 -0
- package/docs/evidence/m1/README.md +68 -0
- package/docs/evidence/m1/goal-host-0.2.0-rc.2.json +918 -0
- package/docs/evidence/m1/goal-host-0.2.1-alpha.1.json +918 -0
- package/docs/evidence/m1/install-0.2.0-rc.2.json +24 -0
- package/docs/evidence/m1/install-0.2.1-alpha.1.json +24 -0
- package/docs/evidence/m1/package-verification.json +7 -0
- package/docs/evidence/m1/runtime-lock-0.2.0-rc.2.json.gz +0 -0
- package/docs/evidence/m1/runtime-lock-0.2.1-alpha.1.json.gz +0 -0
- package/docs/evidence/m1/validation.json +94 -0
- package/docs/evidence/m2/README.md +77 -0
- package/docs/evidence/m2/controller-0.2.0-rc.2.json +1632 -0
- package/docs/evidence/m2/controller-0.2.1-alpha.1.json +1925 -0
- package/docs/evidence/m2/controller-probe.mjs +52 -0
- package/docs/evidence/m2/goal-host-0.2.0-rc.2.json +918 -0
- package/docs/evidence/m2/goal-host-0.2.1-alpha.1.json +918 -0
- package/docs/evidence/m2/install-0.2.0-rc.2.json +27 -0
- package/docs/evidence/m2/install-0.2.1-alpha.1.json +27 -0
- package/docs/evidence/m2/notification-host-0.2.0-rc.2.json +182 -0
- package/docs/evidence/m2/notification-host-0.2.1-alpha.1.json +182 -0
- package/docs/evidence/m2/notification-integration-0.2.0-rc.2.json +108 -0
- package/docs/evidence/m2/notification-integration-0.2.1-alpha.1.json +108 -0
- package/docs/evidence/m2/notification-source-0.2.0-rc.2.json +17 -0
- package/docs/evidence/m2/notification-source-0.2.1-alpha.1.json +17 -0
- package/docs/evidence/m2/package-source-content.json +18 -0
- package/docs/evidence/m2/package-verification.json +7 -0
- package/docs/evidence/m2/release-notes.md +12 -0
- package/docs/evidence/m2/runtime-lock-0.2.0-rc.2.json.gz +0 -0
- package/docs/evidence/m2/runtime-lock-0.2.1-alpha.1.json.gz +0 -0
- package/docs/evidence/m2/session-host-0.2.0-rc.2.json +3181 -0
- package/docs/evidence/m2/session-host-0.2.1-alpha.1.json +3767 -0
- package/docs/evidence/m2/session-native-0.2.0-rc.2.json +1161 -0
- package/docs/evidence/m2/session-native-0.2.1-alpha.1.json +1523 -0
- package/docs/evidence/m2/validation.json +187 -0
- package/docs/evidence/m3/README.md +64 -0
- package/docs/evidence/m3/build.log.gz +0 -0
- package/docs/evidence/m3/character-pack.log.gz +0 -0
- package/docs/evidence/m3/ci.log.gz +0 -0
- package/docs/evidence/m3/desktop-recovery-0.2.0-rc.2.json +392 -0
- package/docs/evidence/m3/desktop-recovery-0.2.1-alpha.1.json +394 -0
- package/docs/evidence/m3/desktop-recovery.json +615 -0
- package/docs/evidence/m3/desktop.log.gz +0 -0
- package/docs/evidence/m3/electron-setup.log.gz +0 -0
- package/docs/evidence/m3/goal-host-0.2.0-rc.2.json +918 -0
- package/docs/evidence/m3/goal-host-0.2.1-alpha.1.json +918 -0
- package/docs/evidence/m3/inbox-ui.log.gz +0 -0
- package/docs/evidence/m3/install-0.2.0-rc.2.json +28 -0
- package/docs/evidence/m3/install-0.2.1-alpha.1.json +28 -0
- package/docs/evidence/m3/install-alpha.log.gz +0 -0
- package/docs/evidence/m3/install-rc.log.gz +0 -0
- package/docs/evidence/m3/metadata.log.gz +0 -0
- package/docs/evidence/m3/notification-host-0.2.0-rc.2.json +182 -0
- package/docs/evidence/m3/notification-host-0.2.1-alpha.1.json +182 -0
- package/docs/evidence/m3/notification-integration-0.2.0-rc.2.json +108 -0
- package/docs/evidence/m3/notification-integration-0.2.1-alpha.1.json +108 -0
- package/docs/evidence/m3/notification-source-0.2.0-rc.2.json +17 -0
- package/docs/evidence/m3/notification-source-0.2.1-alpha.1.json +17 -0
- package/docs/evidence/m3/notification-ui.log.gz +0 -0
- package/docs/evidence/m3/package-source-content.json +3070 -0
- package/docs/evidence/m3/package-verification.json +7 -0
- package/docs/evidence/m3/package.log.gz +0 -0
- package/docs/evidence/m3/release-notes.md +12 -0
- package/docs/evidence/m3/runtime-lock-0.2.0-rc.2.json.gz +0 -0
- package/docs/evidence/m3/runtime-lock-0.2.1-alpha.1.json.gz +0 -0
- package/docs/evidence/m3/session-host-0.2.0-rc.2.json +3181 -0
- package/docs/evidence/m3/session-host-0.2.1-alpha.1.json +3767 -0
- package/docs/evidence/m3/session-native-0.2.0-rc.2.json +1131 -0
- package/docs/evidence/m3/session-native-0.2.1-alpha.1.json +1424 -0
- package/docs/evidence/m3/test.log.gz +0 -0
- package/docs/evidence/m3/typecheck.log.gz +0 -0
- package/docs/evidence/m3/ui.log.gz +0 -0
- package/docs/evidence/m3/validation.json +306 -0
- package/docs/evidence/m4/README.md +61 -0
- package/docs/evidence/m4/build.log.gz +0 -0
- package/docs/evidence/m4/character-pack.log.gz +0 -0
- package/docs/evidence/m4/ci.log.gz +0 -0
- package/docs/evidence/m4/desktop-recovery-0.2.0-rc.2.json +392 -0
- package/docs/evidence/m4/desktop-recovery-0.2.1-alpha.1.json +392 -0
- package/docs/evidence/m4/desktop-recovery.json +615 -0
- package/docs/evidence/m4/desktop.log.gz +0 -0
- package/docs/evidence/m4/electron-setup.log.gz +0 -0
- package/docs/evidence/m4/goal-host-0.2.0-rc.2.json +918 -0
- package/docs/evidence/m4/goal-host-0.2.1-alpha.1.json +918 -0
- package/docs/evidence/m4/inbox-ui.log.gz +0 -0
- package/docs/evidence/m4/install-0.2.0-rc.2.json +28 -0
- package/docs/evidence/m4/install-0.2.1-alpha.1.json +28 -0
- package/docs/evidence/m4/install-alpha.log.gz +0 -0
- package/docs/evidence/m4/install-rc.log.gz +0 -0
- package/docs/evidence/m4/metadata.log.gz +0 -0
- package/docs/evidence/m4/notification-host-0.2.0-rc.2.json +182 -0
- package/docs/evidence/m4/notification-host-0.2.1-alpha.1.json +182 -0
- package/docs/evidence/m4/notification-integration-0.2.0-rc.2.json +108 -0
- package/docs/evidence/m4/notification-integration-0.2.1-alpha.1.json +108 -0
- package/docs/evidence/m4/notification-source-0.2.0-rc.2.json +17 -0
- package/docs/evidence/m4/notification-source-0.2.1-alpha.1.json +17 -0
- package/docs/evidence/m4/notification-ui.log.gz +0 -0
- package/docs/evidence/m4/package-check.log.gz +0 -0
- package/docs/evidence/m4/package-negative-check.json +8 -0
- package/docs/evidence/m4/package-source-content.json +2638 -0
- package/docs/evidence/m4/package-verification.json +7 -0
- package/docs/evidence/m4/package.log.gz +0 -0
- package/docs/evidence/m4/release-notes.md +12 -0
- package/docs/evidence/m4/runtime-lock-0.2.0-rc.2.json.gz +0 -0
- package/docs/evidence/m4/runtime-lock-0.2.1-alpha.1.json.gz +0 -0
- package/docs/evidence/m4/session-host-0.2.0-rc.2.json +3181 -0
- package/docs/evidence/m4/session-host-0.2.1-alpha.1.json +3767 -0
- package/docs/evidence/m4/session-native-0.2.0-rc.2.json +1161 -0
- package/docs/evidence/m4/session-native-0.2.1-alpha.1.json +1454 -0
- package/docs/evidence/m4/test.log.gz +0 -0
- package/docs/evidence/m4/text-scale-chat-en-US.png +0 -0
- package/docs/evidence/m4/text-scale-chat-zh-CN.png +0 -0
- package/docs/evidence/m4/text-scale-en-US-240-1.25.png +0 -0
- package/docs/evidence/m4/text-scale-en-US-240-1.5.png +0 -0
- package/docs/evidence/m4/text-scale-en-US-240-1.png +0 -0
- package/docs/evidence/m4/text-scale-en-US-90-1.25.png +0 -0
- package/docs/evidence/m4/text-scale-en-US-90-1.5.png +0 -0
- package/docs/evidence/m4/text-scale-en-US-90-1.png +0 -0
- package/docs/evidence/m4/text-scale-en-US.json +50 -0
- package/docs/evidence/m4/text-scale-inbox-en-US.png +0 -0
- package/docs/evidence/m4/text-scale-inbox-zh-CN.png +0 -0
- package/docs/evidence/m4/text-scale-installed-0.2.0-rc.2.json +95 -0
- package/docs/evidence/m4/text-scale-installed-0.2.0-rc.2.png +0 -0
- package/docs/evidence/m4/text-scale-installed-0.2.1-alpha.1.json +95 -0
- package/docs/evidence/m4/text-scale-installed-0.2.1-alpha.1.png +0 -0
- package/docs/evidence/m4/text-scale-native.json +166 -0
- package/docs/evidence/m4/text-scale-native.png +0 -0
- package/docs/evidence/m4/text-scale-zh-CN-240-1.25.png +0 -0
- package/docs/evidence/m4/text-scale-zh-CN-240-1.5.png +0 -0
- package/docs/evidence/m4/text-scale-zh-CN-240-1.png +0 -0
- package/docs/evidence/m4/text-scale-zh-CN-90-1.25.png +0 -0
- package/docs/evidence/m4/text-scale-zh-CN-90-1.5.png +0 -0
- package/docs/evidence/m4/text-scale-zh-CN-90-1.png +0 -0
- package/docs/evidence/m4/text-scale-zh-CN.json +50 -0
- package/docs/evidence/m4/toolchain.log.gz +0 -0
- package/docs/evidence/m4/typecheck.log.gz +0 -0
- package/docs/evidence/m4/ui.log.gz +0 -0
- package/docs/evidence/m4/validation.json +407 -0
- package/docs/evidence/m5/README.md +87 -0
- package/docs/evidence/m5/active-drag-fixed.json +27 -0
- package/docs/evidence/m5/active-drag-fixed.log.gz +0 -0
- package/docs/evidence/m5/active-drag-reproduction.json +27 -0
- package/docs/evidence/m5/baseline-reproduction.json +88 -0
- package/docs/evidence/m5/build.log.gz +0 -0
- package/docs/evidence/m5/character-pack.log.gz +0 -0
- package/docs/evidence/m5/ci.log.gz +0 -0
- package/docs/evidence/m5/desktop-recovery-0.2.0-rc.2.json +394 -0
- package/docs/evidence/m5/desktop-recovery-0.2.1-alpha.1.json +392 -0
- package/docs/evidence/m5/desktop-recovery.json +615 -0
- package/docs/evidence/m5/desktop.log.gz +0 -0
- package/docs/evidence/m5/electron-setup.log.gz +0 -0
- package/docs/evidence/m5/evidence-identity.json +138 -0
- package/docs/evidence/m5/goal-host-0.2.0-rc.2.json +918 -0
- package/docs/evidence/m5/goal-host-0.2.1-alpha.1.json +918 -0
- package/docs/evidence/m5/inbox-ui.log.gz +0 -0
- package/docs/evidence/m5/install-0.2.0-rc.2.json +28 -0
- package/docs/evidence/m5/install-0.2.0-rc.2.log.gz +0 -0
- package/docs/evidence/m5/install-0.2.1-alpha.1.json +28 -0
- package/docs/evidence/m5/install-0.2.1-alpha.1.log.gz +0 -0
- package/docs/evidence/m5/metadata.log.gz +0 -0
- package/docs/evidence/m5/multi-display-installed-0.2.0-rc.2.json +557 -0
- package/docs/evidence/m5/multi-display-installed-0.2.1-alpha.1.json +557 -0
- package/docs/evidence/m5/multi-display-native.json +518 -0
- package/docs/evidence/m5/multi-display-native.png +0 -0
- package/docs/evidence/m5/multi-display-reader.png +0 -0
- package/docs/evidence/m5/multi-display-ui.json +133 -0
- package/docs/evidence/m5/native-input-failure.json +9 -0
- package/docs/evidence/m5/native-input-failure.redacted.log.gz +0 -0
- package/docs/evidence/m5/native-input-startup-loop.json +2197 -0
- package/docs/evidence/m5/native-input-startup-loop.log.gz +0 -0
- package/docs/evidence/m5/native-input-startup-loop.mjs.txt +23 -0
- package/docs/evidence/m5/native-pet.png +0 -0
- package/docs/evidence/m5/notification-host-0.2.0-rc.2.json +182 -0
- package/docs/evidence/m5/notification-host-0.2.1-alpha.1.json +182 -0
- package/docs/evidence/m5/notification-integration-0.2.0-rc.2.json +108 -0
- package/docs/evidence/m5/notification-integration-0.2.1-alpha.1.json +108 -0
- package/docs/evidence/m5/notification-source-0.2.0-rc.2.json +17 -0
- package/docs/evidence/m5/notification-source-0.2.1-alpha.1.json +17 -0
- package/docs/evidence/m5/notification-ui.log.gz +0 -0
- package/docs/evidence/m5/pack.log.gz +0 -0
- package/docs/evidence/m5/package-negative-check.json +8 -0
- package/docs/evidence/m5/package-source-content.json +2946 -0
- package/docs/evidence/m5/package-verification.json +7 -0
- package/docs/evidence/m5/package.log.gz +0 -0
- package/docs/evidence/m5/previous-milestones.json +36 -0
- package/docs/evidence/m5/release-notes.md +12 -0
- package/docs/evidence/m5/reproduce-active-drag.mjs +32 -0
- package/docs/evidence/m5/reproduce-baseline.mjs +23 -0
- package/docs/evidence/m5/runtime-lock-0.2.0-rc.2.json.gz +0 -0
- package/docs/evidence/m5/runtime-lock-0.2.1-alpha.1.json.gz +0 -0
- package/docs/evidence/m5/session-host-0.2.0-rc.2.json +3181 -0
- package/docs/evidence/m5/session-host-0.2.1-alpha.1.json +3767 -0
- package/docs/evidence/m5/session-native-0.2.0-rc.2.json +1131 -0
- package/docs/evidence/m5/session-native-0.2.1-alpha.1.json +1523 -0
- package/docs/evidence/m5/test.log.gz +0 -0
- package/docs/evidence/m5/text-scale-chat-en-US.png +0 -0
- package/docs/evidence/m5/text-scale-chat-zh-CN.png +0 -0
- package/docs/evidence/m5/text-scale-en-US-240-1.25.png +0 -0
- package/docs/evidence/m5/text-scale-en-US-240-1.5.png +0 -0
- package/docs/evidence/m5/text-scale-en-US-240-1.png +0 -0
- package/docs/evidence/m5/text-scale-en-US-90-1.25.png +0 -0
- package/docs/evidence/m5/text-scale-en-US-90-1.5.png +0 -0
- package/docs/evidence/m5/text-scale-en-US-90-1.png +0 -0
- package/docs/evidence/m5/text-scale-en-US.json +50 -0
- package/docs/evidence/m5/text-scale-inbox-en-US.png +0 -0
- package/docs/evidence/m5/text-scale-inbox-zh-CN.png +0 -0
- package/docs/evidence/m5/text-scale-installed-0.2.0-rc.2.json +629 -0
- package/docs/evidence/m5/text-scale-installed-0.2.0-rc.2.png +0 -0
- package/docs/evidence/m5/text-scale-installed-0.2.1-alpha.1.json +629 -0
- package/docs/evidence/m5/text-scale-installed-0.2.1-alpha.1.png +0 -0
- package/docs/evidence/m5/text-scale-native.json +1234 -0
- package/docs/evidence/m5/text-scale-native.png +0 -0
- package/docs/evidence/m5/text-scale-zh-CN-240-1.25.png +0 -0
- package/docs/evidence/m5/text-scale-zh-CN-240-1.5.png +0 -0
- package/docs/evidence/m5/text-scale-zh-CN-240-1.png +0 -0
- package/docs/evidence/m5/text-scale-zh-CN-90-1.25.png +0 -0
- package/docs/evidence/m5/text-scale-zh-CN-90-1.5.png +0 -0
- package/docs/evidence/m5/text-scale-zh-CN-90-1.png +0 -0
- package/docs/evidence/m5/text-scale-zh-CN.json +50 -0
- package/docs/evidence/m5/toolchain.log.gz +0 -0
- package/docs/evidence/m5/typecheck.log.gz +0 -0
- package/docs/evidence/m5/ui.log.gz +0 -0
- package/docs/evidence/m5/validation.json +542 -0
- package/docs/evidence/m6/README.md +110 -0
- package/docs/evidence/m6/baseline-identity.json +10 -0
- package/docs/evidence/m6/build.log.gz +0 -0
- package/docs/evidence/m6/character-pack.log.gz +0 -0
- package/docs/evidence/m6/daily-rhythm-installed-0.2.0-rc.2.json +14 -0
- package/docs/evidence/m6/daily-rhythm-installed-0.2.1-alpha.1.json +14 -0
- package/docs/evidence/m6/daily-rhythm-native.json +147 -0
- package/docs/evidence/m6/daily-rhythm-native.png +0 -0
- package/docs/evidence/m6/daily-rhythm-ui.json +119 -0
- package/docs/evidence/m6/daily-rhythm-ui.png +0 -0
- package/docs/evidence/m6/desktop-recovery-0.2.0-rc.2.json +403 -0
- package/docs/evidence/m6/desktop-recovery-0.2.1-alpha.1.json +403 -0
- package/docs/evidence/m6/desktop-recovery.json +615 -0
- package/docs/evidence/m6/desktop.log.gz +0 -0
- package/docs/evidence/m6/electron.log.gz +0 -0
- package/docs/evidence/m6/evidence-identity.json +151 -0
- package/docs/evidence/m6/goal-host-0.2.0-rc.2.json +918 -0
- package/docs/evidence/m6/goal-host-0.2.1-alpha.1.json +918 -0
- package/docs/evidence/m6/idle-baseline-controlled.json.gz +0 -0
- package/docs/evidence/m6/idle-baseline-controlled.log.gz +0 -0
- package/docs/evidence/m6/idle-baseline.json +7850 -0
- package/docs/evidence/m6/idle-day.json.gz +0 -0
- package/docs/evidence/m6/idle-day.log.gz +0 -0
- package/docs/evidence/m6/idle-night.json.gz +0 -0
- package/docs/evidence/m6/idle-night.log.gz +0 -0
- package/docs/evidence/m6/idle-off.json.gz +0 -0
- package/docs/evidence/m6/idle-off.log.gz +0 -0
- package/docs/evidence/m6/inbox-ui.log.gz +0 -0
- package/docs/evidence/m6/install-0.2.0-rc.2.json +28 -0
- package/docs/evidence/m6/install-0.2.0-rc.2.log.gz +0 -0
- package/docs/evidence/m6/install-0.2.1-alpha.1.json +28 -0
- package/docs/evidence/m6/install-0.2.1-alpha.1.log.gz +0 -0
- package/docs/evidence/m6/measure-isolated.mjs +42 -0
- package/docs/evidence/m6/metadata.log.gz +0 -0
- package/docs/evidence/m6/multi-display-installed-0.2.0-rc.2.json +557 -0
- package/docs/evidence/m6/multi-display-installed-0.2.1-alpha.1.json +557 -0
- package/docs/evidence/m6/multi-display-native.json +518 -0
- package/docs/evidence/m6/multi-display-native.png +0 -0
- package/docs/evidence/m6/multi-display-reader.png +0 -0
- package/docs/evidence/m6/multi-display-ui.json +133 -0
- package/docs/evidence/m6/native-pet.png +0 -0
- package/docs/evidence/m6/notification-host-0.2.0-rc.2.json +182 -0
- package/docs/evidence/m6/notification-host-0.2.1-alpha.1.json +182 -0
- package/docs/evidence/m6/notification-integration-0.2.0-rc.2.json +108 -0
- package/docs/evidence/m6/notification-integration-0.2.1-alpha.1.json +108 -0
- package/docs/evidence/m6/notification-source-0.2.0-rc.2.json +17 -0
- package/docs/evidence/m6/notification-source-0.2.1-alpha.1.json +17 -0
- package/docs/evidence/m6/notification-ui.log.gz +0 -0
- package/docs/evidence/m6/npm-ci.log.gz +0 -0
- package/docs/evidence/m6/pack.log.gz +0 -0
- package/docs/evidence/m6/package-negative-check.json +7 -0
- package/docs/evidence/m6/package-source-content.json +3310 -0
- package/docs/evidence/m6/package-verification.json +7 -0
- package/docs/evidence/m6/package.log.gz +0 -0
- package/docs/evidence/m6/previous-milestones.json +45 -0
- package/docs/evidence/m6/release-notes.md +12 -0
- package/docs/evidence/m6/resource-budget.json +12 -0
- package/docs/evidence/m6/resource-comparison.json +228 -0
- package/docs/evidence/m6/runtime-lock-0.2.0-rc.2.json.gz +0 -0
- package/docs/evidence/m6/runtime-lock-0.2.1-alpha.1.json.gz +0 -0
- package/docs/evidence/m6/session-host-0.2.0-rc.2.json +3181 -0
- package/docs/evidence/m6/session-host-0.2.1-alpha.1.json +3767 -0
- package/docs/evidence/m6/session-native-0.2.0-rc.2.json +1230 -0
- package/docs/evidence/m6/session-native-0.2.1-alpha.1.json +1424 -0
- package/docs/evidence/m6/settings-0.2.0-rc.2.png +0 -0
- package/docs/evidence/m6/settings-0.2.1-alpha.1.png +0 -0
- package/docs/evidence/m6/settings-dark-0.2.0-rc.2.png +0 -0
- package/docs/evidence/m6/settings-dark-0.2.1-alpha.1.png +0 -0
- package/docs/evidence/m6/settings-en-0.2.0-rc.2.png +0 -0
- package/docs/evidence/m6/settings-en-0.2.1-alpha.1.png +0 -0
- package/docs/evidence/m6/settings-system-en-US-0.2.0-rc.2.png +0 -0
- package/docs/evidence/m6/settings-system-en-US-0.2.1-alpha.1.png +0 -0
- package/docs/evidence/m6/settings-system-zh-CN-0.2.0-rc.2.png +0 -0
- package/docs/evidence/m6/settings-system-zh-CN-0.2.1-alpha.1.png +0 -0
- package/docs/evidence/m6/test.log.gz +0 -0
- package/docs/evidence/m6/text-scale-chat-en-US.png +0 -0
- package/docs/evidence/m6/text-scale-chat-zh-CN.png +0 -0
- package/docs/evidence/m6/text-scale-en-US-240-1.25.png +0 -0
- package/docs/evidence/m6/text-scale-en-US-240-1.5.png +0 -0
- package/docs/evidence/m6/text-scale-en-US-240-1.png +0 -0
- package/docs/evidence/m6/text-scale-en-US-90-1.25.png +0 -0
- package/docs/evidence/m6/text-scale-en-US-90-1.5.png +0 -0
- package/docs/evidence/m6/text-scale-en-US-90-1.png +0 -0
- package/docs/evidence/m6/text-scale-en-US.json +50 -0
- package/docs/evidence/m6/text-scale-inbox-en-US.png +0 -0
- package/docs/evidence/m6/text-scale-inbox-zh-CN.png +0 -0
- package/docs/evidence/m6/text-scale-installed-0.2.0-rc.2.json +629 -0
- package/docs/evidence/m6/text-scale-installed-0.2.0-rc.2.png +0 -0
- package/docs/evidence/m6/text-scale-installed-0.2.1-alpha.1.json +629 -0
- package/docs/evidence/m6/text-scale-installed-0.2.1-alpha.1.png +0 -0
- package/docs/evidence/m6/text-scale-native.json +1234 -0
- package/docs/evidence/m6/text-scale-native.png +0 -0
- package/docs/evidence/m6/text-scale-zh-CN-240-1.25.png +0 -0
- package/docs/evidence/m6/text-scale-zh-CN-240-1.5.png +0 -0
- package/docs/evidence/m6/text-scale-zh-CN-240-1.png +0 -0
- package/docs/evidence/m6/text-scale-zh-CN-90-1.25.png +0 -0
- package/docs/evidence/m6/text-scale-zh-CN-90-1.5.png +0 -0
- package/docs/evidence/m6/text-scale-zh-CN-90-1.png +0 -0
- package/docs/evidence/m6/text-scale-zh-CN.json +50 -0
- package/docs/evidence/m6/toolchain.log.gz +0 -0
- package/docs/evidence/m6/typecheck.log.gz +0 -0
- package/docs/evidence/m6/ui.log.gz +0 -0
- package/docs/evidence/m6/validation.json +852 -0
- package/docs/evidence/p1/README.md +86 -0
- package/docs/evidence/p1/baseline-idle.json +8030 -0
- package/docs/evidence/p1/baseline-inbox-ui-native-access.log +47 -0
- package/docs/evidence/p1/baseline-inbox-ui-rerun.log +41 -0
- package/docs/evidence/p1/baseline-inbox-ui.log +15 -0
- package/docs/evidence/p1/baseline-unit.log +62 -0
- package/docs/evidence/p1/cadence-day.json +8394 -0
- package/docs/evidence/p1/cadence-night.json +8394 -0
- package/docs/evidence/p1/cadence-off.json +8034 -0
- package/docs/evidence/p1/companionship-installed-0.2.0-rc.2.json +13 -0
- package/docs/evidence/p1/companionship-installed-0.2.1-alpha.1.json +13 -0
- package/docs/evidence/p1/companionship-installed-s3-0.2.0-rc.2.json +13 -0
- package/docs/evidence/p1/companionship-installed-s3-0.2.1-alpha.1.json +13 -0
- package/docs/evidence/p1/companionship-invitation-s3.png +0 -0
- package/docs/evidence/p1/companionship-invitation.png +0 -0
- package/docs/evidence/p1/companionship-native-s3.json +22 -0
- package/docs/evidence/p1/companionship-native.json +22 -0
- package/docs/evidence/p1/companionship-small-menu-s3.png +0 -0
- package/docs/evidence/p1/companionship-small-menu.png +0 -0
- package/docs/evidence/p1/diagnostics-20261016/README.md +44 -0
- package/docs/evidence/p1/diagnostics-20261016/build-info.json +6 -0
- package/docs/evidence/p1/diagnostics-20261016/candidate-verification.json +7 -0
- package/docs/evidence/p1/diagnostics-20261016/installed-alpha1.json +15 -0
- package/docs/evidence/p1/diagnostics-20261016/installed-rc2.json +15 -0
- package/docs/evidence/p1/diagnostics-20261016/local-collector-processes.json +24 -0
- package/docs/evidence/p1/diagnostics-20261016/local-daily-files.json +6 -0
- package/docs/evidence/p1/diagnostics-20261016/local-daily-install.json +73 -0
- package/docs/evidence/p1/diagnostics-20261016/local-profile-update.json +9 -0
- package/docs/evidence/p1/diagnostics-20261016/local-progress-at-handoff.json +119 -0
- package/docs/evidence/p1/diagnostics-20261016/local-sampler-metadata.json +18 -0
- package/docs/evidence/p1/diagnostics-20261016/local-seven-day-launch.json +11 -0
- package/docs/evidence/p1/diagnostics-20261016/sha256.json +18 -0
- package/docs/evidence/p1/diagnostics-20261016/validation.json +40 -0
- package/docs/evidence/p1/diagnostics-20261016/vm-smoke-metadata.json +102 -0
- package/docs/evidence/p1/diagnostics-20261016/vm-smoke-summary.json +134 -0
- package/docs/evidence/p1/diagnostics-20261016/vm-two-hour-progress-at-handoff.json +145 -0
- package/docs/evidence/p1/diagnostics-20261016/vm-two-hour-start-metadata.json +102 -0
- package/docs/evidence/p1/diagnostics-followup-20261016/README.md +27 -0
- package/docs/evidence/p1/diagnostics-followup-20261016/candidate-ci-check.json +1 -0
- package/docs/evidence/p1/diagnostics-followup-20261016/documentation-checks.json +28 -0
- package/docs/evidence/p1/diagnostics-followup-20261016/local-configuration-check.json +85 -0
- package/docs/evidence/p1/diagnostics-followup-20261016/local-controller-check.json +11 -0
- package/docs/evidence/p1/diagnostics-followup-20261016/local-metadata.json +18 -0
- package/docs/evidence/p1/diagnostics-followup-20261016/local-progress.json +126 -0
- package/docs/evidence/p1/diagnostics-followup-20261016/remote-delivery-check.json +21 -0
- package/docs/evidence/p1/diagnostics-followup-20261016/sha256.json +10 -0
- package/docs/evidence/p1/diagnostics-followup-20261016/vm-progress.json +145 -0
- package/docs/evidence/p1/experience-rejected-20261016/README.md +24 -0
- package/docs/evidence/p1/experience-rejected-20261016/feedback-and-decision.json +22 -0
- package/docs/evidence/p1/experience-rejected-20261016/local-controller-final.json +13 -0
- package/docs/evidence/p1/experience-rejected-20261016/local-events.ndjson +58 -0
- package/docs/evidence/p1/experience-rejected-20261016/local-metadata.json +18 -0
- package/docs/evidence/p1/experience-rejected-20261016/local-samples.ndjson +112 -0
- package/docs/evidence/p1/experience-rejected-20261016/local-summary.json +112 -0
- package/docs/evidence/p1/experience-rejected-20261016/sha256.json +8 -0
- package/docs/evidence/p1/final-day.json +8394 -0
- package/docs/evidence/p1/final-night.json +8394 -0
- package/docs/evidence/p1/final-off.json +8034 -0
- package/docs/evidence/p1/final-resource-comparison-s2.json +27 -0
- package/docs/evidence/p1/implementation-day.json +8586 -0
- package/docs/evidence/p1/implementation-night.json +8394 -0
- package/docs/evidence/p1/implementation-off.json +8034 -0
- package/docs/evidence/p1/implementation-s1.json +29 -0
- package/docs/evidence/p1/implementation-s2.json +41 -0
- package/docs/evidence/p1/implementation-s3.json +54 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/README.md +43 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/SHA256SUMS +28 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/build-info.json +6 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/initial-record-at-e820baf.md +39 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/install-0.2.0-rc.2.json +28 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/install-0.2.1-alpha.1.json +28 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/install-alpha.log +36 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/install-rc.log +36 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/invalid-attempts/README.md +11 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/invalid-attempts/physical-confirmed.json +42 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/invalid-attempts/physical-initial.json +40 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/invalid-attempts/physical-mouse-package.json +48 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/invalid-attempts/physical-panel-timeout.log +9 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/package-linux-arm64-helper.log +8 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/package-linux-keyboard.json +30 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/package-linux-keyboard.log +1 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/package-macos-keyboard.json +23 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/package-macos-keyboard.log +1 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/package-macos-npc.json +22 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/package-macos-npc.log +1 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/physical-acceptance-SHA256SUMS +4 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/physical-acceptance.json +50 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/physical-panel-focused-probe.mjs +45 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/physical-panel-package.json +71 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/physical-panel-probe.mjs +43 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/physical-panel-waiting.log +3 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/physical-panel.log +4 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/previous-packages.json +12 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/protected-bytes.json +5 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/protected-final.json +6 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/source-binding.json +13 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/unit.log +74 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/validation.json +40 -0
- package/docs/evidence/p1/keyboard-platforms-20261016/verification.json +7 -0
- package/docs/evidence/p1/keyboard-vm-20261016/README.md +51 -0
- package/docs/evidence/p1/keyboard-vm-20261016/SHA256SUMS +44 -0
- package/docs/evidence/p1/keyboard-vm-20261016/cleanup-vms.json +29 -0
- package/docs/evidence/p1/keyboard-vm-20261016/cleanup-vms.stderr +0 -0
- package/docs/evidence/p1/keyboard-vm-20261016/create-linux.log +14 -0
- package/docs/evidence/p1/keyboard-vm-20261016/create-windows.json +1 -0
- package/docs/evidence/p1/keyboard-vm-20261016/create-windows.stderr +0 -0
- package/docs/evidence/p1/keyboard-vm-20261016/dhcp-leases-after.stderr +2 -0
- package/docs/evidence/p1/keyboard-vm-20261016/dhcp-leases-after.txt +0 -0
- package/docs/evidence/p1/keyboard-vm-20261016/harness/cleanup-vms.py +49 -0
- package/docs/evidence/p1/keyboard-vm-20261016/harness/inject-vm.py +35 -0
- package/docs/evidence/p1/keyboard-vm-20261016/harness/install-linux.sh +17 -0
- package/docs/evidence/p1/keyboard-vm-20261016/harness/prepare-windows-console.ps1 +52 -0
- package/docs/evidence/p1/keyboard-vm-20261016/harness/retry-windows-validation.ps1 +17 -0
- package/docs/evidence/p1/keyboard-vm-20261016/harness/run-linux-package-probe.py +13 -0
- package/docs/evidence/p1/keyboard-vm-20261016/harness/run-linux-probe.py +13 -0
- package/docs/evidence/p1/keyboard-vm-20261016/harness/run-windows-probe.py +17 -0
- package/docs/evidence/p1/keyboard-vm-20261016/harness/setup-linux.sh +21 -0
- package/docs/evidence/p1/keyboard-vm-20261016/harness/setup-windows.ps1 +33 -0
- package/docs/evidence/p1/keyboard-vm-20261016/harness/start-windows-probe.ps1 +20 -0
- package/docs/evidence/p1/keyboard-vm-20261016/harness/vm-npc-probe-preflight.mjs +45 -0
- package/docs/evidence/p1/keyboard-vm-20261016/harness/vm-npc-probe.mjs +46 -0
- package/docs/evidence/p1/keyboard-vm-20261016/host-after-cleanup.txt +8 -0
- package/docs/evidence/p1/keyboard-vm-20261016/install-linux.log +8 -0
- package/docs/evidence/p1/keyboard-vm-20261016/linux-environment.txt +34 -0
- package/docs/evidence/p1/keyboard-vm-20261016/linux-keyboard-native.json +24 -0
- package/docs/evidence/p1/keyboard-vm-20261016/linux-qmp-npc.log +9 -0
- package/docs/evidence/p1/keyboard-vm-20261016/linux-qmp-package-npc.log +9 -0
- package/docs/evidence/p1/keyboard-vm-20261016/linux-rebuilt-preflight.json +100 -0
- package/docs/evidence/p1/keyboard-vm-20261016/linux-result.json +100 -0
- package/docs/evidence/p1/keyboard-vm-20261016/linux-validation.log +75 -0
- package/docs/evidence/p1/keyboard-vm-20261016/node-win-checksum.json +5 -0
- package/docs/evidence/p1/keyboard-vm-20261016/protected-bytes.json +6 -0
- package/docs/evidence/p1/keyboard-vm-20261016/setup-linux.log +765 -0
- package/docs/evidence/p1/keyboard-vm-20261016/setup-windows.log +92 -0
- package/docs/evidence/p1/keyboard-vm-20261016/summary.json +54 -0
- package/docs/evidence/p1/keyboard-vm-20261016/windows-autologin-cleanup.json +1 -0
- package/docs/evidence/p1/keyboard-vm-20261016/windows-console-preparation.json +6 -0
- package/docs/evidence/p1/keyboard-vm-20261016/windows-console-state-1.json +1 -0
- package/docs/evidence/p1/keyboard-vm-20261016/windows-final-state.txt +4 -0
- package/docs/evidence/p1/keyboard-vm-20261016/windows-keyboard-native.json +24 -0
- package/docs/evidence/p1/keyboard-vm-20261016/windows-keyboard-native.log +1 -0
- package/docs/evidence/p1/keyboard-vm-20261016/windows-qmp-console.log +110 -0
- package/docs/evidence/p1/keyboard-vm-20261016/windows-result.json +101 -0
- package/docs/evidence/p1/keyboard-vm-20261016/windows-validation-retry.log +90 -0
- package/docs/evidence/p1/keyboard-vm-20261016/windows-vm-raw.log +6 -0
- package/docs/evidence/p1/npc-capability-20261016/README.md +27 -0
- package/docs/evidence/p1/npc-capability-20261016/initial-probe.log +14 -0
- package/docs/evidence/p1/npc-capability-20261016/initial-probe.mjs +51 -0
- package/docs/evidence/p1/npc-capability-20261016/inventory.json +123 -0
- package/docs/evidence/p1/npc-capability-20261016/probe.log +1 -0
- package/docs/evidence/p1/npc-capability-20261016/probe.mjs +56 -0
- package/docs/evidence/p1/npc-capability-20261016/report.json +180 -0
- package/docs/evidence/p1/npc-capability-20261016/sha256.json +8 -0
- package/docs/evidence/p1/npc-life-20261016/README.md +56 -0
- package/docs/evidence/p1/npc-life-20261016/SHA256SUMS +47 -0
- package/docs/evidence/p1/npc-life-20261016/SHA256SUMS.initial +41 -0
- package/docs/evidence/p1/npc-life-20261016/actual-input.json +1069 -0
- package/docs/evidence/p1/npc-life-20261016/attempts/desktop-geometry-startup.log +96 -0
- package/docs/evidence/p1/npc-life-20261016/attempts/desktop-physical-cursor-interruption.log +19 -0
- package/docs/evidence/p1/npc-life-20261016/attempts/inbox-first.log +85 -0
- package/docs/evidence/p1/npc-life-20261016/attempts/initial-companion-ui.log +31 -0
- package/docs/evidence/p1/npc-life-20261016/attempts/install-rc-first.log +191 -0
- package/docs/evidence/p1/npc-life-20261016/attempts/native-first.log +11 -0
- package/docs/evidence/p1/npc-life-20261016/attempts/native-geometry-first.log +89 -0
- package/docs/evidence/p1/npc-life-20261016/baseline.json +1029 -0
- package/docs/evidence/p1/npc-life-20261016/build-info.json +6 -0
- package/docs/evidence/p1/npc-life-20261016/companionship-installed-0.2.0-rc.2.json +13 -0
- package/docs/evidence/p1/npc-life-20261016/companionship-installed-0.2.1-alpha.1.json +13 -0
- package/docs/evidence/p1/npc-life-20261016/controlled-idle.json +1069 -0
- package/docs/evidence/p1/npc-life-20261016/daily-rhythm-installed-0.2.0-rc.2.json +14 -0
- package/docs/evidence/p1/npc-life-20261016/daily-rhythm-installed-0.2.1-alpha.1.json +14 -0
- package/docs/evidence/p1/npc-life-20261016/desktop.log +12 -0
- package/docs/evidence/p1/npc-life-20261016/diagnostics-installed-0.2.0-rc.2.json +15 -0
- package/docs/evidence/p1/npc-life-20261016/diagnostics-installed-0.2.1-alpha.1.json +15 -0
- package/docs/evidence/p1/npc-life-20261016/final-integrity.json +12 -0
- package/docs/evidence/p1/npc-life-20261016/general-ui-source.log +24 -0
- package/docs/evidence/p1/npc-life-20261016/general-ui.log +24 -0
- package/docs/evidence/p1/npc-life-20261016/inbox-ui.log +67 -0
- package/docs/evidence/p1/npc-life-20261016/install-0.2.0-rc.2.json +28 -0
- package/docs/evidence/p1/npc-life-20261016/install-0.2.1-alpha.1.json +28 -0
- package/docs/evidence/p1/npc-life-20261016/install-alpha.log +36 -0
- package/docs/evidence/p1/npc-life-20261016/install-rc.log +36 -0
- package/docs/evidence/p1/npc-life-20261016/multi-display-installed-0.2.0-rc.2.json +581 -0
- package/docs/evidence/p1/npc-life-20261016/multi-display-installed-0.2.1-alpha.1.json +581 -0
- package/docs/evidence/p1/npc-life-20261016/notification-ui-source.log +5 -0
- package/docs/evidence/p1/npc-life-20261016/notification-ui.log +5 -0
- package/docs/evidence/p1/npc-life-20261016/npc-life-native-home.png +0 -0
- package/docs/evidence/p1/npc-life-20261016/npc-life-native.json +20 -0
- package/docs/evidence/p1/npc-life-20261016/npc-life-observe.png +0 -0
- package/docs/evidence/p1/npc-life-20261016/package-native.log +1 -0
- package/docs/evidence/p1/npc-life-20261016/preserved-originals.json +21 -0
- package/docs/evidence/p1/npc-life-20261016/resources.log +9 -0
- package/docs/evidence/p1/npc-life-20261016/source-binding.json +13 -0
- package/docs/evidence/p1/npc-life-20261016/source-verify.log +7 -0
- package/docs/evidence/p1/npc-life-20261016/text-scale-installed-0.2.0-rc.2.json +653 -0
- package/docs/evidence/p1/npc-life-20261016/text-scale-installed-0.2.1-alpha.1.json +653 -0
- package/docs/evidence/p1/npc-life-20261016/typecheck.log +4 -0
- package/docs/evidence/p1/npc-life-20261016/unit.log +69 -0
- package/docs/evidence/p1/npc-life-20261016/validation.json +33 -0
- package/docs/evidence/p1/npc-life-20261016/verification.json +7 -0
- package/docs/evidence/p1/npc-life-20261016/verify-source.py +22 -0
- package/docs/evidence/p1/p1-cadence-desktop.log +10 -0
- package/docs/evidence/p1/p1-cadence-inbox-ui.log +65 -0
- package/docs/evidence/p1/p1-cadence-notification-ui.log +5 -0
- package/docs/evidence/p1/p1-cadence-package-check.log +1 -0
- package/docs/evidence/p1/p1-cadence-ui-full.log +24 -0
- package/docs/evidence/p1/p1-final-desktop.log +10 -0
- package/docs/evidence/p1/p1-final-inbox-ui.log +63 -0
- package/docs/evidence/p1/p1-final-notification-ui.log +5 -0
- package/docs/evidence/p1/p1-final-typecheck.log +4 -0
- package/docs/evidence/p1/p1-final-ui.log +24 -0
- package/docs/evidence/p1/p1-final-unit.log +68 -0
- package/docs/evidence/p1/p1-s3-install-alpha1.redacted.log +34 -0
- package/docs/evidence/p1/p1-s3-install-rc2.redacted.log +34 -0
- package/docs/evidence/p1/p1-s3-metadata.log +5 -0
- package/docs/evidence/p1/p1-s3-resource.log +12 -0
- package/docs/evidence/p1/p1-s3-typecheck.log +4 -0
- package/docs/evidence/p1/p1-s3-unit.log +68 -0
- package/docs/evidence/p1/p1-verified-install-alpha1.redacted.log +35 -0
- package/docs/evidence/p1/p1-verified-install-rc2.redacted.log +35 -0
- package/docs/evidence/p1/p1-verified-package-check.log +1 -0
- package/docs/evidence/p1/paired-diagnostic-s2.json +61 -0
- package/docs/evidence/p1/paired-diagnostic-s3.json +61 -0
- package/docs/evidence/p1/resource-comparison-s3.json +33 -0
- package/docs/evidence/p1/resource-comparison.json +27 -0
- package/docs/evidence/p1/vm-20261016/README.md +43 -0
- package/docs/evidence/p1/vm-20261016/SHA256SUMS +6 -0
- package/docs/evidence/p1/vm-20261016/candidate-source-check.json +195 -0
- package/docs/evidence/p1/vm-20261016/environment-during-run.txt +70 -0
- package/docs/evidence/p1/vm-20261016/long-start-metadata.json +48 -0
- package/docs/evidence/p1/vm-20261016/observer-v1/observe-companion.mjs +279 -0
- package/docs/evidence/p1/vm-20261016/observer-v1/resource-observation.mjs +89 -0
- package/docs/evidence/p1/vm-20261016/observer-v1/run-resource-observation.sh +34 -0
- package/docs/evidence/p1/vm-20261016/observer-v1-SHA256SUMS +3 -0
- package/docs/evidence/p1/vm-20261016/old-run-partial-SHA256SUMS +3 -0
- package/docs/evidence/p1/vm-20261016/old-run-partial-samples.ndjson +554 -0
- package/docs/evidence/p1/vm-20261016/old-run-partial-summary.json +101 -0
- package/docs/evidence/p1/vm-20261016/old-run-stop.json +6 -0
- package/docs/evidence/p1/vm-20261016/smoke-metadata.json +48 -0
- package/docs/evidence/p1/vm-20261016/smoke-samples.ndjson +12 -0
- package/docs/evidence/p1/vm-20261016/smoke-summary.json +94 -0
- package/docs/evidence/releases/v0.4.9/README.md +18 -0
- package/docs/evidence/releases/v0.4.9/delivery-verification.json +480 -0
- package/docs/multi-display-contract.md +29 -0
- package/docs/notification-contract.md +32 -6
- package/docs/npc-daily-life-plan.md +80 -0
- package/docs/release-notes.md +32 -0
- package/docs/releasing.md +7 -16
- package/docs/roadmap.md +100 -0
- package/docs/session-chat-contract.md +44 -0
- package/docs/text-readability-contract.md +28 -0
- package/docs/usage.md +157 -0
- package/npm-shrinkwrap.json +32 -11
- package/package.json +19 -9
- package/scripts/build.mjs +22 -1
- package/scripts/capture-showcase.mjs +81 -0
- package/scripts/check-package.mjs +13 -2
- package/scripts/diagnostics-client.mjs +89 -0
- package/scripts/measure-idle.mjs +80 -0
- package/scripts/observe-companion.mjs +166 -0
- package/scripts/preview.mjs +2 -1
- package/scripts/resource-observation.mjs +117 -0
- package/scripts/run-resource-observation.sh +34 -0
- package/scripts/sample-companion.mjs +156 -0
- package/src/bridge.ts +40 -20
- package/src/chat.ts +72 -0
- package/src/client/Settings.tsx +20 -5
- package/src/client/locales.ts +12 -2
- package/src/client/notification-copy.ts +2 -2
- package/src/client/settings.css +2 -0
- package/src/companion-store.ts +149 -0
- package/src/completion.ts +66 -0
- package/src/controls.ts +90 -28
- package/src/desktop-lifecycle.ts +10 -0
- package/src/diagnostics.ts +98 -0
- package/src/figure-server.ts +18 -4
- package/src/index.ts +48 -28
- package/src/model.ts +21 -6
- package/src/notification-broker.ts +14 -7
- package/src/notification-contract.ts +4 -2
- package/tests/bridge.test.ts +123 -2
- package/tests/chat.test.ts +61 -0
- package/tests/companion-client.test.js +22 -0
- package/tests/companion-http.test.ts +24 -0
- package/tests/companion-store.test.ts +77 -0
- package/tests/companion-touch.test.js +20 -0
- package/tests/companionship-native.mjs +44 -0
- package/tests/companionship-ui.mjs +315 -0
- package/tests/companionship.test.js +57 -0
- package/tests/completion.test.ts +110 -0
- package/tests/controls.test.ts +132 -2
- package/tests/daily-rhythm-native.mjs +51 -0
- package/tests/daily-rhythm-ui.mjs +166 -0
- package/tests/daily-rhythm.test.js +83 -0
- package/tests/desktop.mjs +85 -4
- package/tests/diagnostics-native.mjs +82 -0
- package/tests/diagnostics.test.js +133 -0
- package/tests/display-geometry.test.js +55 -0
- package/tests/fixtures/desktop-recovery.ts +3 -0
- package/tests/fixtures/goal-host.mjs +104 -0
- package/tests/fixtures/host.mjs +40 -1
- package/tests/fixtures/session-host.mjs +119 -0
- package/tests/goal-host-contract.mjs +53 -0
- package/tests/helpers/body-startup.mjs +31 -0
- package/tests/helpers/companionship.mjs +25 -0
- package/tests/helpers/daily-rhythm.mjs +34 -0
- package/tests/helpers/desktop-recovery.mjs +25 -0
- package/tests/helpers/installed-notifications.mjs +1 -1
- package/tests/helpers/keyboard-x11-probe.py +60 -0
- package/tests/helpers/multi-display-native.mjs +19 -0
- package/tests/helpers/native-pointer.mjs +47 -9
- package/tests/helpers/npc-life.mjs +24 -0
- package/tests/helpers/text-scale-native.mjs +34 -0
- package/tests/inbox-ui.mjs +2 -1
- package/tests/install.mjs +178 -4
- package/tests/keyboard-activity-native.mjs +40 -0
- package/tests/keyboard-activity.test.js +102 -0
- package/tests/lifecycle-startup-native.mjs +47 -0
- package/tests/lifecycle-state.test.js +44 -0
- package/tests/model.test.ts +15 -4
- package/tests/multi-display-native.mjs +91 -0
- package/tests/multi-display-ui.mjs +95 -0
- package/tests/notification-broker.test.ts +1 -1
- package/tests/notification-client.test.ts +8 -1
- package/tests/notification-integration.test.ts +50 -2
- package/tests/notification-ui.mjs +18 -0
- package/tests/npc-life-native.mjs +52 -0
- package/tests/npc-life.test.js +77 -0
- package/tests/plugin.test.ts +85 -12
- package/tests/presentation.test.js +11 -0
- package/tests/render-cadence.test.js +20 -0
- package/tests/resource-observation.test.js +52 -0
- package/tests/session-host-contract.mjs +53 -0
- package/tests/session-recovery.test.ts +20 -0
- package/tests/session-replies-ui.mjs +75 -1
- package/tests/text-scale-ui.mjs +115 -0
- package/tests/text-scale.test.ts +7 -0
- package/tests/ui.mjs +2 -0
- package/web/chat-contract.d.ts +4 -0
- package/web/chat-contract.js +14 -0
- package/web/companion-client.js +32 -0
- package/web/companion-touch.js +15 -0
- package/web/companionship.d.ts +12 -0
- package/web/companionship.js +80 -0
- package/web/daily-rhythm.d.ts +6 -0
- package/web/daily-rhythm.js +38 -0
- package/web/diagnostics.js +13 -0
- package/web/display-geometry.js +30 -0
- package/web/index.html +10 -1
- package/web/locale.d.ts +2 -0
- package/web/locale.js +41 -9
- package/web/notification-ui.js +3 -3
- package/web/npc-life.js +91 -0
- package/web/pet.js +319 -50
- package/web/render-cadence.js +6 -0
- package/web/session-ui.js +29 -0
- package/web/style.css +90 -60
- package/web/text-scale.d.ts +4 -0
- package/web/text-scale.js +6 -0
- package/web/upstream/LICENSE +661 -0
- package/web/upstream/UPSTREAM.md +2 -0
package/desktop/main.cjs
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
const { app, BrowserWindow, ipcMain, powerMonitor, screen, Menu, Tray, nativeImage, shell } = require('electron');
|
|
2
2
|
const { join } = require('node:path');
|
|
3
|
+
const { homedir } = require('node:os');
|
|
4
|
+
const { readFileSync } = require('node:fs');
|
|
5
|
+
const { Diagnostics } = require('../dist/diagnostics.cjs');
|
|
6
|
+
const { z } = require('zod');
|
|
7
|
+
const diagnosticCount = z.number().int().min(0).max(1000000000);
|
|
8
|
+
const diagnosticCounts = z.object({ routines: z.object({ observe: diagnosticCount, play: diagnosticCount, rest: diagnosticCount, greeting: diagnosticCount }).strict(), invitationsShown: diagnosticCount, invitationsExpired: diagnosticCount, invitationsAccepted: diagnosticCount, invitationsLater: diagnosticCount, invitationsQuiet: diagnosticCount }).strict();
|
|
9
|
+
const diagnosticRenderer = z.object({ npc: z.object({ phase: z.enum(['home', 'prepare', 'outbound', 'observe', 'return', 'yield', 'resume']), reason: z.enum(['none', 'disabled', 'input', 'unknown', 'pointer', 'work', 'user', 'lifecycle', 'geometry', 'capability']), keyboard: z.enum(['active', 'idle', 'unknown']), keyboardBackend: z.enum(['macos', 'windows', 'x11', 'none']).optional(), keyboardStatus: z.enum(['disabled', 'starting', 'available', 'unsupported-platform', 'unsupported-session', 'missing-dependency', 'failed', 'stale', 'unavailable', 'protocol-error']).optional(), targetValid: z.boolean(), compact: z.boolean() }).strict().optional(), mode: z.enum(['off', 'quiet', 'interactive']), activity: z.enum(['idle', 'observe', 'play', 'rest', 'greeting']), invitation: z.enum(['none', 'pending', 'shown']), mood: z.string().regex(/^[a-z-]{1,24}$/), careUnavailable: z.boolean(), hidden: z.boolean(), hour: z.number().int().min(0).max(23), queues: z.object({ carePending: diagnosticCount, pendingInteractions: diagnosticCount, composerSessions: diagnosticCount, chatTimers: diagnosticCount, snoozing: diagnosticCount, shownResults: diagnosticCount, acknowledgedResults: diagnosticCount }).strict(), counts: diagnosticCounts, heapBytes: z.number().min(0).max(Number.MAX_SAFE_INTEGER), nodes: diagnosticCount }).strict();
|
|
3
10
|
const { randomBytes } = require('node:crypto');
|
|
4
11
|
const { once } = require('node:events');
|
|
12
|
+
const { CompanionStore, companionRequest } = require('../dist/companion-store.cjs');
|
|
5
13
|
const { CharacterStore } = require('../dist/character-store.cjs');
|
|
6
14
|
const { createPetServer } = require('../dist/figure-server.cjs');
|
|
7
15
|
const { trayState, trayLocale } = require('./tray-state.cjs');
|
|
16
|
+
const { createDisplayController } = require('./display-controller.cjs');
|
|
8
17
|
const { petCopy, petLanguage } = require('../web/locale.js');
|
|
9
18
|
app.setName(petCopy('en').defaultName);
|
|
10
19
|
if (process.env.DSH_PET_TEST_DATA_DIR) {
|
|
@@ -22,12 +31,34 @@ if (process.env.DSH_PET_TEST_DEBUG_PORT) {
|
|
|
22
31
|
app.commandLine.appendSwitch('remote-debugging-address', '127.0.0.1');
|
|
23
32
|
app.commandLine.appendSwitch('remote-debugging-port', process.env.DSH_PET_TEST_DEBUG_PORT);
|
|
24
33
|
}
|
|
25
|
-
|
|
34
|
+
const displayTest = process.env.DSH_PET_TEST_NO_SANDBOX === '1' && !!process.env.DSH_PET_TEST_DEBUG_PORT;
|
|
35
|
+
const keyboardActivity = require('./keyboard-activity.cjs').createKeyboardActivity();
|
|
36
|
+
const { initialLockState } = require('./lifecycle-state.cjs');
|
|
37
|
+
let win, tray, options, lastFrame, poll, assetServer, characters, companions, displays, diagnostics, diagnosticRead;
|
|
38
|
+
let lifecycle = { locks: 0, unlocks: 0, suspends: 0, resumes: 0 };
|
|
39
|
+
const configureDiagnostics = () => {
|
|
40
|
+
if (options?.diagnostics !== true) {
|
|
41
|
+
lifecycle = { locks: 0, unlocks: 0, suspends: 0, resumes: 0 };
|
|
42
|
+
if (diagnosticRead) { clearTimeout(diagnosticRead.timer); diagnosticRead.resolve(null); diagnosticRead = undefined; }
|
|
43
|
+
}
|
|
44
|
+
void diagnostics?.configure(options?.diagnostics === true).catch(() => console.error('Local diagnostics unavailable'));
|
|
45
|
+
};
|
|
46
|
+
function readRendererDiagnostics() {
|
|
47
|
+
if (options?.diagnostics !== true || !win || win.isDestroyed() || diagnosticRead) return Promise.resolve(null);
|
|
48
|
+
return new Promise(resolve => {
|
|
49
|
+
const requestId = randomBytes(16).toString('hex');
|
|
50
|
+
const timer = setTimeout(() => { if (diagnosticRead?.requestId === requestId) { diagnosticRead = undefined; resolve(null); } }, 1200);
|
|
51
|
+
diagnosticRead = { requestId, resolve, timer }; forward({ type: 'diagnostics-read', requestId });
|
|
52
|
+
});
|
|
53
|
+
}
|
|
26
54
|
let presentation = {}, lastTrayKey, lastIconKey, iconBase, iconAppearance;
|
|
27
55
|
let interactive = null;
|
|
28
56
|
const generation = Number(process.env.DSH_PET_GENERATION ?? 1);
|
|
29
|
-
let visibilityRevision = 0,
|
|
30
|
-
|
|
57
|
+
let visibilityRevision = 0, screenLocked = process.env.DSH_PET_SCREEN_LOCKED === '1', systemAsleep = process.env.DSH_PET_SYSTEM_ASLEEP === '1';
|
|
58
|
+
let lockStateKnown = false;
|
|
59
|
+
let suspended = true;
|
|
60
|
+
let desiredVisible = process.env.DSH_PET_VISIBLE !== '0', userClosed = false;
|
|
61
|
+
function visibility() { if (win && !win.isDestroyed()) { process.send?.({ type: 'visibility', generation, visibilityRevision: ++visibilityRevision, visible: win.isVisible(), desiredVisible, suspended, screenLocked, systemAsleep, lockStateKnown }); syncTray(); } }
|
|
31
62
|
function forward(message) { if (win && !win.isDestroyed()) win.webContents.send('pet:update', message); }
|
|
32
63
|
function hit(active) {
|
|
33
64
|
if (!win || win.isDestroyed()) return;
|
|
@@ -37,7 +68,8 @@ function hit(active) {
|
|
|
37
68
|
}
|
|
38
69
|
forward({ type: 'hit-state', active, focused: win.isFocused(), visible: win.isVisible() });
|
|
39
70
|
}
|
|
40
|
-
function show() { win?.showInactive();
|
|
71
|
+
function show() { desiredVisible = true; win?.showInactive(); visibility(); }
|
|
72
|
+
function hide() { desiredVisible = false; win?.hide(); visibility(); }
|
|
41
73
|
function act(action) { process.send?.({ type: 'action', action }); }
|
|
42
74
|
function syncTray() {
|
|
43
75
|
if (!tray || tray.isDestroyed()) return;
|
|
@@ -45,7 +77,8 @@ function syncTray() {
|
|
|
45
77
|
const state = trayState(lastFrame?.snapshot, presentation, { ...options, locale }, win?.isVisible());
|
|
46
78
|
const copy = petCopy(locale);
|
|
47
79
|
if (app.getName() !== copy.defaultName) app.setName(copy.defaultName);
|
|
48
|
-
const
|
|
80
|
+
const displayList = screen.getAllDisplays();
|
|
81
|
+
const key = JSON.stringify([state, displays?.state?.displayId, displayList.map(d => [d.id, d.label])]);
|
|
49
82
|
if (key === lastTrayKey) return;
|
|
50
83
|
lastTrayKey = key;
|
|
51
84
|
tray.setToolTip(state.tooltip);
|
|
@@ -59,13 +92,14 @@ function syncTray() {
|
|
|
59
92
|
{ type: 'separator' },
|
|
60
93
|
{ label: copy.trayChat, click: () => { show(); forward({ type: 'ui-control', command: 'chat' }); } },
|
|
61
94
|
{ label: copy.trayCharacters, click: () => { show(); forward({ type: 'characters' }); } },
|
|
95
|
+
{ label: copy.trayDisplay, submenu: displayList.map(d => ({ type: 'radio', label: `${d.label || copy.display} · ${d.id}`, checked: d.id === displays?.state?.displayId, click: () => displays.refresh({ displayId: d.id }) })) },
|
|
62
96
|
{ label: copy.trayRoam, type: 'checkbox', checked: state.roam, click: item => act({ type: 'preference', field: 'roam', value: item.checked }) },
|
|
63
97
|
{ label: copy.traySleep, type: 'checkbox', checked: state.sleeping, enabled: !state.active, click: () => forward({ type: 'ui-control', command: 'sleep' }) },
|
|
64
98
|
{ label: copy.trayNotices, type: 'checkbox', checked: state.notifications, click: item => act({ type: 'preference', field: 'notifications', value: item.checked }) },
|
|
65
99
|
{ label: copy.traySound, type: 'checkbox', checked: state.sound, click: () => forward({ type: 'ui-control', command: 'sound' }) },
|
|
66
100
|
{ type: 'separator' },
|
|
67
|
-
{ label: state.visible ? copy.hide : copy.trayShow, click: () => state.visible ?
|
|
68
|
-
{ label: copy.trayQuit, click: () => app.quit() },
|
|
101
|
+
{ label: state.visible ? copy.hide : copy.trayShow, click: () => state.visible ? hide() : show() },
|
|
102
|
+
{ label: copy.trayQuit, click: () => { userClosed = true; app.quit(); } },
|
|
69
103
|
]));
|
|
70
104
|
process.send?.({ type: 'tray-state', state });
|
|
71
105
|
const iconKey = `${state.characterId}:${state.scheme}:${state.iconReady}:${state.icon}`;
|
|
@@ -98,24 +132,20 @@ async function syncIcon(state, key) {
|
|
|
98
132
|
}
|
|
99
133
|
} catch { /* Keep the packaged icon when a pack thumbnail cannot be rendered. */ }
|
|
100
134
|
}
|
|
101
|
-
function bounds() {
|
|
102
|
-
const display = screen.getDisplayNearestPoint(screen.getCursorScreenPoint());
|
|
103
|
-
return display.workArea;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
135
|
process.on('message', message => {
|
|
107
136
|
if (!message || typeof message !== 'object') return;
|
|
108
137
|
if (message.type === 'quit') { app.quit(); return; }
|
|
109
|
-
if (message.type === 'init') { options = message.options; lastFrame = message; forward(message); syncTray(); }
|
|
110
|
-
if (message.type === 'configure') { options = message.options; if (lastFrame) lastFrame.options = options; forward(message); syncTray(); }
|
|
138
|
+
if (message.type === 'init') { options = message.options; configureDiagnostics(); lastFrame = message; forward(message); syncTray(); }
|
|
139
|
+
if (message.type === 'configure') { options = message.options; configureDiagnostics(); if (lastFrame) lastFrame.options = options; forward(message); syncTray(); }
|
|
111
140
|
if (message.type === 'control') {
|
|
112
|
-
if (message.command === 'hide')
|
|
141
|
+
if (message.command === 'hide') hide();
|
|
113
142
|
if (message.command === 'show' || message.command === 'characters') show();
|
|
114
143
|
if (message.command === 'characters') forward({ type: 'characters' });
|
|
115
144
|
// Fixed public Desktop protocol; no renderer-supplied URL or private shell IPC.
|
|
116
145
|
if (message.command === 'focus-harness' && process.env.DSH_PET_TEST_NO_SANDBOX !== '1') void shell.openExternal('dsh://open').catch(() => {});
|
|
117
146
|
}
|
|
118
|
-
if (message.type === 'snapshot') { lastFrame = { type: 'init', options, snapshot: { ...message.snapshot, results: message.snapshot.results ?? lastFrame?.snapshot?.results ?? [] } }; forward(message); syncTray(); }
|
|
147
|
+
if (message.type === 'snapshot') { lastFrame = { type: 'init', baseline: true, options, snapshot: { ...message.snapshot, results: message.snapshot.results ?? lastFrame?.snapshot?.results ?? [] } }; forward(message); syncTray(); }
|
|
148
|
+
if (message.type === 'chat-result') forward(message);
|
|
119
149
|
if (message.type === 'notification-state' || message.type === 'notification-snooze-result') forward(message);
|
|
120
150
|
if (message.type === 'notice') {
|
|
121
151
|
if (message.generation !== undefined && (message.generation !== generation || message.visibilityRevision !== visibilityRevision || !win?.isVisible() || suspended)) return;
|
|
@@ -126,9 +156,29 @@ process.on('disconnect', () => app.quit());
|
|
|
126
156
|
process.on('SIGTERM', () => app.quit());
|
|
127
157
|
|
|
128
158
|
app.whenReady().then(async () => {
|
|
159
|
+
const suspendState = key => { if (options?.diagnostics === true) lifecycle[key] = Math.min(Number.MAX_SAFE_INTEGER, lifecycle[key] + 1); suspended = screenLocked || systemAsleep || !lockStateKnown; visibility(); };
|
|
160
|
+
powerMonitor.on('suspend', () => { systemAsleep = true; suspendState('suspends'); });
|
|
161
|
+
powerMonitor.on('resume', () => { systemAsleep = false; suspendState('resumes'); });
|
|
162
|
+
powerMonitor.on('lock-screen', () => { screenLocked = true; lockStateKnown = true; suspendState('locks'); });
|
|
163
|
+
powerMonitor.on('unlock-screen', () => { screenLocked = false; lockStateKnown = true; suspendState('unlocks'); });
|
|
164
|
+
const initialState = initialLockState({ monitor: powerMonitor });
|
|
165
|
+
lockStateKnown = initialState !== 'unknown';
|
|
166
|
+
screenLocked ||= initialState === 'locked';
|
|
167
|
+
suspended = screenLocked || systemAsleep || !lockStateKnown;
|
|
168
|
+
const { chatRequest } = await import('../web/chat-contract.js');
|
|
129
169
|
const webRoot = join(__dirname, '../web');
|
|
130
170
|
characters = new CharacterStore(join(app.getPath('userData'), 'figures-v2'), join(webRoot, 'upstream/whale'));
|
|
131
171
|
const prefix = `/${randomBytes(24).toString('hex')}/`;
|
|
172
|
+
companions = new CompanionStore(join(app.getPath('userData'), 'companionship-v1'));
|
|
173
|
+
const manifest = JSON.parse(readFileSync(join(__dirname, '../package.json'), 'utf8'));
|
|
174
|
+
const build = JSON.parse(readFileSync(join(__dirname, '../dist/build-info.json'), 'utf8'));
|
|
175
|
+
diagnostics = new Diagnostics({ registry: process.env.DSH_PET_TEST_DIAGNOSTICS_DIR ?? join(homedir(), '.dsh-coopanion', 'diagnostics'),
|
|
176
|
+
profile: app.getPath('userData'), version: manifest.version, build,
|
|
177
|
+
read: async () => ({ runtime: { generation, visible: !!win && !win.isDestroyed() && win.isVisible(), suspended, screenLocked, systemAsleep, lockStateKnown, lifecycle: { ...lifecycle } },
|
|
178
|
+
store: companions.inspect(), renderer: await readRendererDiagnostics() }),
|
|
179
|
+
});
|
|
180
|
+
configureDiagnostics();
|
|
181
|
+
process.once('exit', () => { companions.release(); diagnostics.release(); });
|
|
132
182
|
assetServer = createPetServer({ webRoot, store: characters, prefix });
|
|
133
183
|
assetServer.listen(0, '127.0.0.1'); await once(assetServer, 'listening');
|
|
134
184
|
let characterOperation = Promise.resolve();
|
|
@@ -142,65 +192,87 @@ app.whenReady().then(async () => {
|
|
|
142
192
|
return result;
|
|
143
193
|
});
|
|
144
194
|
const characterId = value => { if (typeof value !== 'string') throw new Error('无效的角色 id'); return value; };
|
|
195
|
+
characterCall('pet:companionship', async value => {
|
|
196
|
+
const request = companionRequest.parse(value);
|
|
197
|
+
if (request.type === 'remove') throw new Error('Unsupported companionship request');
|
|
198
|
+
await characters.load(request.characterId);
|
|
199
|
+
return companions.request(request);
|
|
200
|
+
});
|
|
145
201
|
characterCall('pet:characters:list', () => characters.list());
|
|
146
202
|
characterCall('pet:characters:load', value => characters.load(characterId(value)));
|
|
147
203
|
characterCall('pet:characters:select', value => {
|
|
148
204
|
if (!value || typeof value.scheme !== 'string') throw new Error('无效的角色配色');
|
|
149
205
|
return characters.select(characterId(value.id), value.scheme);
|
|
150
206
|
});
|
|
151
|
-
characterCall('pet:characters:remove', value =>
|
|
207
|
+
characterCall('pet:characters:remove', async value => {
|
|
208
|
+
const id = characterId(value); if (id === 'whale') throw new Error('内置角色不能删除');
|
|
209
|
+
await characters.load(id);
|
|
210
|
+
const state = await companions.request({ type: 'read', characterId: id });
|
|
211
|
+
await companions.request({ type: 'remove', characterId: id, revision: state.revision, requestId: `remove-${id}-${Date.now()}` });
|
|
212
|
+
return characters.remove(id);
|
|
213
|
+
});
|
|
152
214
|
characterCall('pet:characters:import', value => {
|
|
153
215
|
if (!(value instanceof ArrayBuffer)) throw new Error('请选择 API 2 ZIP 角色包');
|
|
154
216
|
return characters.import(new Uint8Array(value));
|
|
155
217
|
});
|
|
156
|
-
win = new BrowserWindow({ ...screen.getPrimaryDisplay().workArea, transparent: true, frame: false, resizable: false, skipTaskbar: true, hasShadow: false, show: false, alwaysOnTop: true, backgroundColor: '#00000000', webPreferences: { preload: join(__dirname, 'preload.cjs'), sandbox: true, contextIsolation: true, nodeIntegration: false } });
|
|
218
|
+
win = new BrowserWindow({ ...screen.getPrimaryDisplay().workArea, transparent: true, frame: false, resizable: false, skipTaskbar: true, hasShadow: false, show: false, alwaysOnTop: true, backgroundColor: '#00000000', webPreferences: { additionalArguments: displayTest ? ['--dsh-pet-display-test'] : [], preload: join(__dirname, 'preload.cjs'), sandbox: true, contextIsolation: true, nodeIntegration: false } });
|
|
157
219
|
win.setAlwaysOnTop(true, 'floating');
|
|
158
220
|
win.on('show', visibility); win.on('hide', visibility);
|
|
159
|
-
|
|
160
|
-
powerMonitor.on('suspend', () => { systemAsleep = true; suspendState(); });
|
|
161
|
-
powerMonitor.on('resume', () => { systemAsleep = false; suspendState(); });
|
|
162
|
-
powerMonitor.on('lock-screen', () => { screenLocked = true; suspendState(); });
|
|
163
|
-
powerMonitor.on('unlock-screen', () => { screenLocked = false; suspendState(); });
|
|
221
|
+
win.webContents.on('render-process-gone', () => app.exit(1));
|
|
164
222
|
win.setVisibleOnAllWorkspaces(true, { visibleOnFullScreen: true });
|
|
165
223
|
if (process.platform === 'darwin') app.dock?.hide();
|
|
166
224
|
win.webContents.setWindowOpenHandler(() => ({ action: 'deny' }));
|
|
167
225
|
win.webContents.on('will-navigate', event => event.preventDefault());
|
|
168
226
|
win.webContents.session.setPermissionRequestHandler((_contents, _permission, callback) => callback(false));
|
|
169
|
-
|
|
227
|
+
displays = createDisplayController({ screen, win, send: forward, changed: syncTray });
|
|
228
|
+
displays.refresh();
|
|
229
|
+
if (displayTest) require('./test-display-probe.cjs').installDisplayProbe({ ipcMain, screen, win, displays });
|
|
230
|
+
for (const event of ['resize', 'move']) win.on(event, () => setImmediate(() => { if (!win.isDestroyed()) displays.refresh(); }));
|
|
231
|
+
win.webContents.on('did-finish-load', () => { if (lastFrame) forward(lastFrame); displays.publish(); });
|
|
232
|
+
ipcMain.on('pet:diagnostics-response', (event, message) => {
|
|
233
|
+
if (event.sender !== win.webContents || event.senderFrame !== win.webContents.mainFrame || options?.diagnostics !== true || !diagnosticRead || message?.requestId !== diagnosticRead.requestId) return;
|
|
234
|
+
const value = diagnosticRenderer.safeParse(message.value);
|
|
235
|
+
clearTimeout(diagnosticRead.timer); diagnosticRead.resolve(value.success ? value.data : null); diagnosticRead = undefined;
|
|
236
|
+
});
|
|
170
237
|
ipcMain.on('pet:hit', (event, active) => { if (event.sender === win.webContents && event.senderFrame === win.webContents.mainFrame && typeof active === 'boolean') hit(active); });
|
|
171
238
|
ipcMain.on('pet:action', (event, action) => {
|
|
172
239
|
if (event.sender !== win.webContents || event.senderFrame !== win.webContents.mainFrame || !action || typeof action !== 'object') return;
|
|
173
|
-
if (action.type === 'hide') {
|
|
174
|
-
if (action.type === 'move-display') {
|
|
240
|
+
if (action.type === 'hide') { hide(); return; }
|
|
241
|
+
if (action.type === 'move-display') { displays.moveToCursor(); return; }
|
|
175
242
|
if (action.type === 'presentation') {
|
|
176
243
|
if (typeof action.characterId !== 'string' || !/^[a-z0-9-]{1,32}$/.test(action.characterId) || typeof action.scheme !== 'string' || action.scheme.length > 200 || typeof action.name !== 'string' || action.name.length > 200 || typeof action.sleeping !== 'boolean' || typeof action.sound !== 'boolean') return;
|
|
177
244
|
presentation = { characterId: action.characterId, scheme: action.scheme, name: action.name, locale: typeof action.locale === 'string' ? petLanguage(action.locale) : undefined, sleeping: action.sleeping, sound: action.sound, ready: action.ready === true }; syncTray(); return;
|
|
178
245
|
}
|
|
179
246
|
if (action.type === 'notification-snooze') { if (typeof action.interactionId === 'string' && action.interactionId.length <= 2048 && Number.isSafeInteger(action.generation)) act(action); return; }
|
|
180
|
-
if (action.type
|
|
247
|
+
if (action.type === 'chat') { const request = chatRequest(action); if (request) act(request); return; }
|
|
248
|
+
if (action.type !== 'select' && action.type !== 'open-session' && action.type !== 'preference' && action.type !== 'read') return;
|
|
181
249
|
process.send?.({ type: 'action', action });
|
|
182
250
|
});
|
|
183
251
|
hit(false);
|
|
184
252
|
await win.loadURL(`http://127.0.0.1:${assetServer.address().port}${prefix}`);
|
|
185
|
-
show();
|
|
253
|
+
if (desiredVisible) show(); else visibility();
|
|
186
254
|
// Restore input when a click-through window misses movement, without repeatedly
|
|
187
255
|
// overriding the renderer's newer pointer event with a stationary OS cursor.
|
|
188
|
-
let lastCursor;
|
|
256
|
+
let lastCursor, keyboardSentAt = -Infinity;
|
|
189
257
|
const pollCursor = () => {
|
|
258
|
+
keyboardActivity.configure(!!options?.companionship && options.companionship !== 'off' && !!win && !win.isDestroyed() && win.isVisible() && !suspended);
|
|
259
|
+
if (performance.now() - keyboardSentAt >= 500) { keyboardSentAt = performance.now(); forward({ type: 'keyboard-activity', ...keyboardActivity.inspect() }); }
|
|
190
260
|
if (!win || win.isDestroyed() || !win.isVisible()) return;
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
lastCursor = next; forward({ type: 'cursor', ...next });
|
|
261
|
+
const next = displays.cursor();
|
|
262
|
+
if (!next || (next.x === lastCursor?.x && next.y === lastCursor?.y && next.revision === lastCursor?.revision)) return;
|
|
263
|
+
lastCursor = next; forward(next);
|
|
195
264
|
};
|
|
196
265
|
pollCursor(); poll = setInterval(pollCursor, 100);
|
|
197
266
|
const icon = nativeImage.createFromPath(join(__dirname, 'icon.png')).resize({ height: 24 });
|
|
198
267
|
tray = new Tray(icon); syncTray();
|
|
199
268
|
tray.on('click', show);
|
|
200
|
-
|
|
201
|
-
screen.on('display-metrics-changed', () => { const b = win.getBounds(); win.setBounds(screen.getDisplayMatching(b).workArea); forward({ type: 'display-changed' }); });
|
|
269
|
+
for (const event of ['display-added', 'display-removed', 'display-metrics-changed']) screen.on(event, () => { displays.refresh(); lastTrayKey = undefined; syncTray(); });
|
|
202
270
|
process.send?.({ type: 'ready' });
|
|
203
|
-
}).catch(error => {
|
|
271
|
+
}).catch(error => {
|
|
272
|
+
console.error(error);
|
|
273
|
+
const failure = { type: 'startup-error', error: String(error?.message ?? error).slice(0, 600), recoverable: ['EADDRINUSE', 'EAGAIN', 'ENOMEM'].includes(error?.code) };
|
|
274
|
+
if (process.connected) process.send(failure, () => app.exit(1)); else app.exit(1);
|
|
275
|
+
});
|
|
204
276
|
|
|
205
|
-
app.on('before-quit', () => { clearInterval(poll); assetServer?.close(); tray?.destroy(); });
|
|
206
|
-
app.on('window-all-closed', () => app.quit());
|
|
277
|
+
app.on('before-quit', () => { if (userClosed) process.send?.({ type: 'closed' }); clearInterval(poll); keyboardActivity.configure(false); if (diagnosticRead) { clearTimeout(diagnosticRead.timer); diagnosticRead.resolve(null); diagnosticRead = undefined; } diagnostics?.release(); void diagnostics?.close(); assetServer?.close(); tray?.destroy(); });
|
|
278
|
+
app.on('window-all-closed', () => { userClosed = true; app.quit(); });
|
package/desktop/preload.cjs
CHANGED
|
@@ -5,13 +5,18 @@ async function characterCall(channel, value) {
|
|
|
5
5
|
return result.value;
|
|
6
6
|
}
|
|
7
7
|
contextBridge.exposeInMainWorld('dshPetBridge', {
|
|
8
|
+
nativeGeometry: true,
|
|
9
|
+
...(process.argv.includes('--dsh-pet-display-test') ? { testScreenPoint: value => ipcRenderer.invoke('pet:test-screen-point', value) } : {}),
|
|
8
10
|
subscribe(callback) {
|
|
9
11
|
const listener = (_event, message) => callback(message);
|
|
10
12
|
ipcRenderer.on('pet:update', listener);
|
|
11
13
|
return () => ipcRenderer.removeListener('pet:update', listener);
|
|
12
14
|
},
|
|
15
|
+
// Chat carries its immutable target and client request identity unchanged.
|
|
13
16
|
action(value) { ipcRenderer.send('pet:action', value); },
|
|
14
17
|
hit(active) { ipcRenderer.send('pet:hit', active); },
|
|
18
|
+
diagnosticsRespond: value => ipcRenderer.send('pet:diagnostics-response', value),
|
|
19
|
+
companionship: value => characterCall('pet:companionship', value),
|
|
15
20
|
characters: {
|
|
16
21
|
list: () => characterCall('pet:characters:list'),
|
|
17
22
|
load: id => characterCall('pet:characters:load', id),
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Read-only native measurements for isolated test profiles. Never loaded by a normal install.
|
|
2
|
+
module.exports.installDisplayProbe = ({ ipcMain, screen, win, displays }) => {
|
|
3
|
+
ipcMain.handle('pet:test-screen-point', (event, value) => {
|
|
4
|
+
if (event.sender !== win.webContents || event.senderFrame !== win.webContents.mainFrame || !value || !['x', 'y', 'width', 'height'].every(k => Number.isFinite(value[k])) || value.width <= 0 || value.height <= 0) return null;
|
|
5
|
+
const b = win.getContentBounds();
|
|
6
|
+
const dip = { x: Math.round(b.x + value.x * b.width / value.width), y: Math.round(b.y + value.y * b.height / value.height) };
|
|
7
|
+
// CoreGraphics cursor points are logical global coordinates. X11/Win32 need
|
|
8
|
+
// the platform converter: global DIP * devicePixelRatio breaks mixed DPI.
|
|
9
|
+
const point = process.platform === 'darwin' ? dip : screen.dipToScreenPoint(dip);
|
|
10
|
+
return { point, dip, geometry: displays.state, contentBounds: b, cursor: screen.getCursorScreenPoint(),
|
|
11
|
+
displays: screen.getAllDisplays().map(d => ({id:d.id,label:d.label,bounds:d.bounds,workArea:d.workArea,scaleFactor:d.scaleFactor,rotation:d.rotation})), electron: process.versions.electron };
|
|
12
|
+
});
|
|
13
|
+
};
|
package/desktop/tray-state.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const { sessionActivity } = require('../web/session-ui.js');
|
|
2
|
-
const { petCopy, automaticPetLanguage } = require('../web/locale.js');
|
|
2
|
+
const { petCopy, automaticPetLanguage, sessionStateLabel } = require('../web/locale.js');
|
|
3
3
|
|
|
4
4
|
function trayLocale(options = {}, presentation = {}, languages = []) {
|
|
5
5
|
return options.locale ?? presentation.locale ?? automaticPetLanguage(languages);
|
|
@@ -7,15 +7,16 @@ function trayLocale(options = {}, presentation = {}, languages = []) {
|
|
|
7
7
|
|
|
8
8
|
/** Desktop and status bar project the same host snapshot and acknowledged preferences. */
|
|
9
9
|
function trayState(snapshot = {}, presentation = {}, options = {}, visible = false) {
|
|
10
|
-
const copy = petCopy(options.locale ?? presentation.locale)
|
|
10
|
+
const copy = petCopy(options.locale ?? presentation.locale);
|
|
11
11
|
const selected = snapshot.sessions?.find(session => session.id === snapshot.sessionId);
|
|
12
12
|
const activity = sessionActivity(snapshot), active = activity.active;
|
|
13
13
|
const mood = !active && !activity.waiting && !activity.errors && presentation.sleeping ? 'sleeping' : activity.mood;
|
|
14
|
+
const stateLabel = sessionStateLabel(selected, options.locale ?? presentation.locale, mood);
|
|
14
15
|
const name = presentation.name || copy.defaultName;
|
|
15
|
-
return { name, characterId: presentation.characterId || 'whale', scheme: presentation.scheme || '', iconReady: !!presentation.ready, icon: mood === 'sleeping' ? 'sleeping' : activity.icon, mood, stateLabel
|
|
16
|
+
return { name, characterId: presentation.characterId || 'whale', scheme: presentation.scheme || '', iconReady: !!presentation.ready, icon: mood === 'sleeping' ? 'sleeping' : activity.icon, mood, stateLabel, activity, active, sleeping: mood === 'sleeping', visible, roam: options.roam ?? true, notifications: options.notifications ?? true, sound: presentation.sound ?? true,
|
|
16
17
|
sessionId: snapshot.sessionId ?? null, sessionLabel: selected?.label ?? copy.noConversation,
|
|
17
18
|
sessions: [...(snapshot.sessions ?? [])].sort((a, b) => Number(b.id === snapshot.sessionId) - Number(a.id === snapshot.sessionId) || (b.updatedAt ?? 0) - (a.updatedAt ?? 0)).map(session => ({ id: session.id, label: session.label, project: session.project, selected: session.id === snapshot.sessionId, mood: session.mood, unread: Number(!!session.unread) })),
|
|
18
|
-
tooltip: copy.trayTooltip(name,
|
|
19
|
+
tooltip: copy.trayTooltip(name, stateLabel, selected?.label ?? copy.noConversation, activity.busy, activity.waiting + activity.errors, activity.unread),
|
|
19
20
|
title: '',
|
|
20
21
|
};
|
|
21
22
|
}
|
package/dist/bridge.js
CHANGED
|
@@ -3,39 +3,59 @@ import { spawn } from "node:child_process";
|
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
import { EventEmitter } from "node:events";
|
|
6
|
+
|
|
7
|
+
// src/desktop-lifecycle.ts
|
|
8
|
+
var NativeStartError = class extends Error {
|
|
9
|
+
constructor(message, recoverable) {
|
|
10
|
+
super(message);
|
|
11
|
+
this.recoverable = recoverable;
|
|
12
|
+
this.name = "NativeStartError";
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// src/bridge.ts
|
|
6
17
|
var ElectronBridge = class extends EventEmitter {
|
|
7
18
|
child;
|
|
8
19
|
latest;
|
|
20
|
+
latestOptions;
|
|
9
21
|
resultKey;
|
|
10
22
|
closing = false;
|
|
11
23
|
generation = 0;
|
|
12
24
|
visibilityRevision = 0;
|
|
13
25
|
nativeVisible = false;
|
|
14
26
|
suspended = false;
|
|
27
|
+
screenLocked = false;
|
|
28
|
+
systemAsleep = false;
|
|
15
29
|
lastNotificationState;
|
|
16
30
|
async start(options, lifetime) {
|
|
17
|
-
if (this.child) throw new
|
|
31
|
+
if (this.child) throw new NativeStartError("Desktop pet is already running", false);
|
|
18
32
|
if (lifetime?.signal.aborted) throw new Error("\u684C\u5BA0\u542F\u52A8\u5DF2\u53D6\u6D88");
|
|
33
|
+
this.latestOptions = { ...options };
|
|
19
34
|
this.closing = false;
|
|
20
35
|
this.generation = lifetime?.generation ?? this.generation + 1;
|
|
21
36
|
this.visibilityRevision = 0;
|
|
22
37
|
this.nativeVisible = false;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
38
|
+
if (process.platform === "linux" && !process.env.DISPLAY && !process.env.WAYLAND_DISPLAY) throw new NativeStartError("\u684C\u5BA0\u9700\u8981\u684C\u9762\u663E\u793A\u73AF\u5883\u3002", false);
|
|
39
|
+
let executable;
|
|
40
|
+
try {
|
|
41
|
+
executable = options.electronPath ?? createRequire(import.meta.url)("electron");
|
|
42
|
+
} catch (error) {
|
|
43
|
+
throw new NativeStartError(String(error).slice(0, 600), false);
|
|
44
|
+
}
|
|
45
|
+
const env = { ...process.env, DSH_PET_GENERATION: String(this.generation), DSH_PET_VISIBLE: lifetime?.visible === false ? "0" : "1", DSH_PET_SCREEN_LOCKED: this.screenLocked ? "1" : "0", DSH_PET_SYSTEM_ASLEEP: this.systemAsleep ? "1" : "0" };
|
|
27
46
|
delete env.ELECTRON_RUN_AS_NODE;
|
|
28
47
|
const args = [fileURLToPath(new URL("../desktop/main.cjs", import.meta.url))];
|
|
29
48
|
if (env.DSH_PET_TEST_NO_SANDBOX === "1") args.unshift("--no-sandbox");
|
|
30
49
|
const child = spawn(executable, args, { env, stdio: ["ignore", "pipe", "pipe", "ipc"] });
|
|
31
50
|
const generation = this.generation;
|
|
32
51
|
this.child = child;
|
|
33
|
-
let diagnostic = "";
|
|
52
|
+
let diagnostic = "", userClosed = false;
|
|
34
53
|
child.stderr?.on("data", (data) => {
|
|
35
54
|
diagnostic = (diagnostic + data.toString()).slice(-4e3);
|
|
36
55
|
});
|
|
37
56
|
child.on("message", (message) => {
|
|
38
|
-
if (this.child !== child || !isRecord(message)) return;
|
|
57
|
+
if (this.child !== child || this.closing || lifetime?.signal.aborted || !isRecord(message)) return;
|
|
58
|
+
if (message.type === "closed") userClosed = true;
|
|
39
59
|
if (message.type === "action") this.emit("action", message.action);
|
|
40
60
|
if (message.type === "tray-state") this.emit("tray-state", message.state);
|
|
41
61
|
if (message.type === "tray-icon") this.emit("tray-icon", message);
|
|
@@ -43,17 +63,23 @@ var ElectronBridge = class extends EventEmitter {
|
|
|
43
63
|
this.visibilityRevision = message.visibilityRevision;
|
|
44
64
|
this.nativeVisible = message.visible;
|
|
45
65
|
this.suspended = message.suspended === true;
|
|
46
|
-
|
|
66
|
+
if (typeof message.screenLocked === "boolean") this.screenLocked = message.screenLocked;
|
|
67
|
+
if (typeof message.systemAsleep === "boolean") this.systemAsleep = message.systemAsleep;
|
|
68
|
+
this.emit("lifecycle", { running: true, visible: this.nativeVisible, generation, visibilityRevision: this.visibilityRevision, suspended: this.suspended, ...typeof message.desiredVisible === "boolean" ? { desiredVisible: message.desiredVisible } : {} });
|
|
47
69
|
}
|
|
48
70
|
});
|
|
49
71
|
child.once("exit", (code, signal) => {
|
|
50
72
|
if (this.child !== child) return;
|
|
51
73
|
this.child = void 0;
|
|
52
74
|
this.nativeVisible = false;
|
|
53
|
-
const
|
|
54
|
-
|
|
75
|
+
const unexpected = !this.closing && !userClosed && !lifetime?.signal.aborted;
|
|
76
|
+
const error = unexpected ? `\u684C\u5BA0\u8FDB\u7A0B\u5DF2\u9000\u51FA (${signal ?? code}): ${diagnostic}`.slice(0, 600) : void 0;
|
|
77
|
+
this.emit("lifecycle", { running: false, visible: false, generation, visibilityRevision: ++this.visibilityRevision, suspended: false, unexpected, ...error ? { error } : {} });
|
|
55
78
|
if (error) this.emit("failure", new Error(error));
|
|
56
79
|
});
|
|
80
|
+
child.on("error", (error) => {
|
|
81
|
+
if (this.child === child && !this.closing && !lifetime?.signal.aborted) this.emit("failure", error);
|
|
82
|
+
});
|
|
57
83
|
await new Promise((resolve, reject) => {
|
|
58
84
|
let done = false;
|
|
59
85
|
const finish = (error) => {
|
|
@@ -70,25 +96,27 @@ var ElectronBridge = class extends EventEmitter {
|
|
|
70
96
|
} else resolve();
|
|
71
97
|
};
|
|
72
98
|
const ready = (message) => {
|
|
99
|
+
if (isRecord(message) && message.type === "startup-error" && this.child === child && typeof message.error === "string") {
|
|
100
|
+
finish(new NativeStartError(message.error.slice(0, 600), message.recoverable === true));
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
73
103
|
if (isRecord(message) && message.type === "ready" && this.child === child && !lifetime?.signal.aborted) {
|
|
74
|
-
this.
|
|
104
|
+
this.resultKey = void 0;
|
|
105
|
+
this.send({ type: "init", options: { ...this.latestOptions, locale: this.latestOptions?.locale ?? null }, baseline: true, snapshot: this.latest && desktopSnapshot(this.latest, true) });
|
|
75
106
|
if (this.lastNotificationState) this.notificationState(this.lastNotificationState);
|
|
76
107
|
finish();
|
|
77
108
|
}
|
|
78
109
|
};
|
|
79
|
-
const failed = (error) => finish(error);
|
|
80
|
-
const exited = (code, signal) => finish(new
|
|
110
|
+
const failed = (error) => finish(new NativeStartError(error.message.slice(0, 600), error.code === "EAGAIN" || error.code === "ENOMEM"));
|
|
111
|
+
const exited = (code, signal) => finish(new NativeStartError(`\u684C\u5BA0\u542F\u52A8\u5931\u8D25 (${signal ?? code}): ${diagnostic}`.slice(0, 600), true));
|
|
81
112
|
const aborted = () => finish(new Error("\u684C\u5BA0\u542F\u52A8\u5DF2\u53D6\u6D88"));
|
|
82
|
-
const timer = setTimeout(() => finish(new
|
|
113
|
+
const timer = setTimeout(() => finish(new NativeStartError(`\u684C\u5BA0\u672A\u80FD\u5728 20 \u79D2\u5185\u542F\u52A8: ${diagnostic}`.slice(0, 600), true)), 2e4);
|
|
83
114
|
child.on("message", ready);
|
|
84
115
|
child.once("error", failed);
|
|
85
116
|
child.once("exit", exited);
|
|
86
117
|
lifetime?.signal.addEventListener("abort", aborted, { once: true });
|
|
87
118
|
if (lifetime?.signal.aborted) aborted();
|
|
88
119
|
});
|
|
89
|
-
child.on("error", (error) => {
|
|
90
|
-
if (this.child === child && !this.closing) this.emit("failure", error);
|
|
91
|
-
});
|
|
92
120
|
}
|
|
93
121
|
update(snapshot) {
|
|
94
122
|
this.latest = snapshot;
|
|
@@ -111,6 +139,9 @@ var ElectronBridge = class extends EventEmitter {
|
|
|
111
139
|
this.send({ type: "notice", notice, generation: runtime.generation, visibilityRevision: runtime.visibilityRevision });
|
|
112
140
|
return true;
|
|
113
141
|
}
|
|
142
|
+
chatResult(receipt) {
|
|
143
|
+
this.send(receipt);
|
|
144
|
+
}
|
|
114
145
|
onAction(listener) {
|
|
115
146
|
this.on("action", listener);
|
|
116
147
|
}
|
|
@@ -121,6 +152,7 @@ var ElectronBridge = class extends EventEmitter {
|
|
|
121
152
|
// preference restore the renderer's automatic language instead of retaining
|
|
122
153
|
// its previous locale during a merged configuration update.
|
|
123
154
|
configure(options) {
|
|
155
|
+
this.latestOptions = { ...options };
|
|
124
156
|
this.send({ type: "configure", options: { ...options, locale: options.locale ?? null } });
|
|
125
157
|
}
|
|
126
158
|
control(command) {
|
|
@@ -136,8 +168,9 @@ var ElectronBridge = class extends EventEmitter {
|
|
|
136
168
|
this.off("lifecycle", listener);
|
|
137
169
|
}
|
|
138
170
|
send(message) {
|
|
139
|
-
|
|
140
|
-
|
|
171
|
+
const child = this.child;
|
|
172
|
+
if (child?.connected && !this.closing) child.send(message, (error) => {
|
|
173
|
+
if (error && this.child === child && !this.closing) this.emit("failure", error);
|
|
141
174
|
});
|
|
142
175
|
}
|
|
143
176
|
async dispose() {
|
|
@@ -184,6 +217,7 @@ function desktopSnapshot(snapshot, includeResults) {
|
|
|
184
217
|
}
|
|
185
218
|
export {
|
|
186
219
|
ElectronBridge,
|
|
220
|
+
NativeStartError,
|
|
187
221
|
isRecord
|
|
188
222
|
};
|
|
189
223
|
//# sourceMappingURL=bridge.js.map
|
package/dist/bridge.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/bridge.ts"],
|
|
4
|
-
"sourcesContent": ["import { spawn, type ChildProcess } from 'node:child_process';\nimport { createRequire } from 'node:module';\nimport { fileURLToPath } from 'node:url';\nimport { EventEmitter } from 'node:events';\nimport type { PetSnapshot, PetNotice } from './model.ts';\nimport type { NotificationRuntime, NotificationSnapshot, TaskNotice } from './notification-contract.ts';\n\nexport interface StartLifetime { signal: AbortSignal; generation: number; }\nexport interface NativeLifecycle { running: boolean; visible: boolean; error?: string; generation?: number; visibilityRevision?: number; suspended?: boolean; }\n\nexport interface DesktopOptions { size: number; roam: boolean; notifications: boolean; bubbleDurationMs: number; electronPath?: string; locale?: string; systemNotifications?: boolean; reminders?: boolean; reminderDelayMs?: number; }\nexport interface PetBridge {\n start(options: DesktopOptions, lifetime?: StartLifetime): Promise<void>;\n update(snapshot: PetSnapshot): void;\n notify(notice: PetNotice | TaskNotice): void;\n notificationState?(snapshot: NotificationSnapshot): void;\n snoozeResult?(interactionId: string, ok: boolean, error?: string): void;\n presentRole?(notice: TaskNotice, runtime: NotificationRuntime): boolean;\n onAction(listener: (action: unknown) => void): void;\n removeAction(listener: (action: unknown) => void): void;\n dispose(): Promise<void>;\n configure?(options: DesktopOptions): void;\n control?(command: 'show' | 'hide' | 'characters'): void;\n focusHarness?(): void;\n onLifecycle?(listener: (state: NativeLifecycle) => void): void;\n removeLifecycle?(listener: (state: NativeLifecycle) => void): void;\n}\n\n/** Owns a separate Electron window; no changes or private IPC in the Harness desktop shell are needed. */\nexport class ElectronBridge extends EventEmitter implements PetBridge {\n private child?: ChildProcess;\n private latest?: PetSnapshot;\n private resultKey?: string;\n private closing = false;\n\n private generation = 0;\n private visibilityRevision = 0;\n private nativeVisible = false;\n private suspended = false;\n private lastNotificationState?: NotificationSnapshot;\n\n async start(options: DesktopOptions, lifetime?: StartLifetime): Promise<void> {\n if (this.child) throw new Error('Desktop pet is already running');\n if (lifetime?.signal.aborted) throw new Error('\u684C\u5BA0\u542F\u52A8\u5DF2\u53D6\u6D88');\n this.closing = false;\n this.generation = lifetime?.generation ?? this.generation + 1;\n this.visibilityRevision = 0; this.nativeVisible = false; this.suspended = false;\n if (process.platform === 'linux' && !process.env.DISPLAY && !process.env.WAYLAND_DISPLAY) throw new Error('\u684C\u5BA0\u9700\u8981\u684C\u9762\u663E\u793A\u73AF\u5883\u3002');\n const executable: string = options.electronPath ?? createRequire(import.meta.url)('electron');\n const env: NodeJS.ProcessEnv = { ...process.env, DSH_PET_GENERATION: String(this.generation) };\n delete (env as NodeJS.ProcessEnv).ELECTRON_RUN_AS_NODE;\n const args = [fileURLToPath(new URL('../desktop/main.cjs', import.meta.url))];\n if (env.DSH_PET_TEST_NO_SANDBOX === '1') args.unshift('--no-sandbox');\n const child = spawn(executable, args, { env, stdio: ['ignore', 'pipe', 'pipe', 'ipc'] });\n const generation = this.generation; this.child = child;\n let diagnostic = '';\n child.stderr?.on('data', data => { diagnostic = (diagnostic + data.toString()).slice(-4000); });\n child.on('message', message => {\n if (this.child !== child || !isRecord(message)) return;\n if (message.type === 'action') this.emit('action', message.action);\n if (message.type === 'tray-state') this.emit('tray-state', message.state);\n if (message.type === 'tray-icon') this.emit('tray-icon', message);\n if (message.type === 'visibility' && message.generation === generation && typeof message.visible === 'boolean' && Number.isSafeInteger(message.visibilityRevision) && (message.visibilityRevision as number) > this.visibilityRevision) {\n this.visibilityRevision = message.visibilityRevision as number;\n this.nativeVisible = message.visible; this.suspended = message.suspended === true;\n this.emit('lifecycle', { running: true, visible: this.nativeVisible, generation, visibilityRevision: this.visibilityRevision, suspended: this.suspended });\n }\n });\n child.once('exit', (code, signal) => {\n if (this.child !== child) return;\n this.child = undefined; this.nativeVisible = false;\n const error = !this.closing && (code !== 0 || signal) ? `\u684C\u5BA0\u8FDB\u7A0B\u5DF2\u9000\u51FA (${signal ?? code})` : undefined;\n this.emit('lifecycle', { running: false, visible: false, generation, visibilityRevision: ++this.visibilityRevision, suspended: false, ...(error ? { error } : {}) });\n if (error) this.emit('failure', new Error(error));\n });\n await new Promise<void>((resolve, reject) => {\n let done = false;\n const finish = (error?: Error) => {\n if (done) return; done = true;\n clearTimeout(timer); child.off('message', ready); child.off('error', failed); child.off('exit', exited); lifetime?.signal.removeEventListener('abort', aborted);\n if (error) { child.kill(); reject(error); } else resolve();\n };\n const ready = (message: unknown) => {\n if (isRecord(message) && message.type === 'ready' && this.child === child && !lifetime?.signal.aborted) {\n this.send({ type: 'init', options, snapshot: this.latest && desktopSnapshot(this.latest, true) });\n if (this.lastNotificationState) this.notificationState(this.lastNotificationState);\n finish();\n }\n };\n const failed = (error: Error) => finish(error);\n const exited = (code: number | null, signal: string | null) => finish(new Error(`\u684C\u5BA0\u542F\u52A8\u5931\u8D25 (${signal ?? code}): ${diagnostic}`));\n const aborted = () => finish(new Error('\u684C\u5BA0\u542F\u52A8\u5DF2\u53D6\u6D88'));\n const timer = setTimeout(() => finish(new Error(`\u684C\u5BA0\u672A\u80FD\u5728 20 \u79D2\u5185\u542F\u52A8: ${diagnostic}`)), 20000);\n child.on('message', ready); child.once('error', failed); child.once('exit', exited);\n lifetime?.signal.addEventListener('abort', aborted, { once: true });\n if (lifetime?.signal.aborted) aborted();\n });\n child.on('error', error => { if (this.child === child && !this.closing) this.emit('failure', error); });\n }\n\n update(snapshot: PetSnapshot): void {\n this.latest = snapshot;\n const key = snapshot.results.map(result => `${result.id}:${result.read}`).join('|');\n this.send({ type: 'snapshot', snapshot: desktopSnapshot(snapshot, key !== this.resultKey) });\n this.resultKey = key;\n }\n notify(notice: PetNotice | TaskNotice): void { this.send({ type: 'notice', notice }); }\n notificationState(snapshot: NotificationSnapshot): void { this.lastNotificationState = structuredClone(snapshot); this.send({ type: 'notification-state', snapshot }); }\n snoozeResult(interactionId: string, ok: boolean, error?: string): void { this.send({ type: 'notification-snooze-result', interactionId, ok, ...(error ? { error: error.slice(0, 600) } : {}) }); }\n presentRole(notice: TaskNotice, runtime: NotificationRuntime): boolean {\n if (!this.child?.connected || this.closing || !this.nativeVisible || this.suspended || runtime.generation !== this.generation || runtime.visibilityRevision !== this.visibilityRevision || !runtime.visible) return false;\n this.send({ type: 'notice', notice, generation: runtime.generation, visibilityRevision: runtime.visibilityRevision }); return true;\n }\n onAction(listener: (action: unknown) => void): void { this.on('action', listener); }\n removeAction(listener: (action: unknown) => void): void { this.off('action', listener); }\n // JSON IPC omits undefined. An explicit null lets a cleared Harness\n // preference restore the renderer's automatic language instead of retaining\n // its previous locale during a merged configuration update.\n configure(options: DesktopOptions): void { this.send({ type: 'configure', options: { ...options, locale: options.locale ?? null } }); }\n control(command: 'show' | 'hide' | 'characters'): void { this.send({ type: 'control', command }); }\n focusHarness(): void { this.send({ type: 'control', command: 'focus-harness' }); }\n onLifecycle(listener: (state: NativeLifecycle) => void): void { this.on('lifecycle', listener); }\n removeLifecycle(listener: (state: NativeLifecycle) => void): void { this.off('lifecycle', listener); }\n private send(message: object): void {\n if (this.child?.connected) this.child.send(message, error => { if (error && !this.closing) this.emit('failure', error); });\n }\n\n async dispose(): Promise<void> {\n this.closing = true;\n const child = this.child;\n if (!child) return;\n if (child.pid === undefined || child.exitCode !== null || child.signalCode !== null) { if (this.child === child) this.child = undefined; return; }\n await new Promise<void>((resolve, reject) => {\n let deadline: ReturnType<typeof setTimeout>;\n const timer = setTimeout(() => { child.kill('SIGKILL'); deadline = setTimeout(() => { if (child.exitCode !== null || child.signalCode !== null) resolve(); else reject(new Error('\u684C\u5BA0\u8FDB\u7A0B\u672A\u786E\u8BA4\u9000\u51FA')); }, 1000); }, 3000);\n child.once('exit', () => { clearTimeout(timer); clearTimeout(deadline); resolve(); });\n if (child.connected) child.send({ type: 'quit' }, error => { if (error) child.kill(); }); else child.kill();\n });\n if (this.child === child) this.child = undefined;\n }\n}\n\nexport function isRecord(value: unknown): value is Record<string, unknown> { return typeof value === 'object' && value !== null && !Array.isArray(value); }\n\n/** Stream animation updates carry metadata; full result text crosses IPC only when it changes. */\nfunction desktopSnapshot(snapshot: PetSnapshot, includeResults: boolean) {\n const { results, ...state } = snapshot;\n return { ...state, text: state.mood === 'happy' ? '' : state.text,\n sessions: state.sessions.map(session => ({ ...session, text: session.mood === 'happy' ? '' : session.text, reply: '' })),\n ...(includeResults ? { results } : {}),\n };\n}\n"],
|
|
5
|
-
"mappings": ";AAAA,SAAS,aAAgC;AACzC,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;
|
|
3
|
+
"sources": ["../src/bridge.ts", "../src/desktop-lifecycle.ts"],
|
|
4
|
+
"sourcesContent": ["import { spawn, type ChildProcess } from 'node:child_process';\nimport { createRequire } from 'node:module';\nimport { fileURLToPath } from 'node:url';\nimport { EventEmitter } from 'node:events';\nimport type { ChatReceipt } from '../web/chat-contract.js';\nimport type { PetSnapshot, PetNotice } from './model.ts';\nimport type { NotificationRuntime, NotificationSnapshot, TaskNotice } from './notification-contract.ts';\nimport { NativeStartError, type StartLifetime, type NativeLifecycle } from './desktop-lifecycle.ts';\nexport { NativeStartError, type StartLifetime, type NativeLifecycle } from './desktop-lifecycle.ts';\n\nimport type { CompanionshipMode } from '../web/companionship.js';\nimport type { TextScale } from '../web/text-scale.js';\n\nexport interface DesktopOptions { size: number; npcHome?: number; npcRange?: number; textScale?: TextScale; roam: boolean; dailyRhythm?: boolean; diagnostics?: boolean; companionship?: CompanionshipMode; notifications: boolean; bubbleDurationMs: number; electronPath?: string; locale?: string; systemNotifications?: boolean; reminders?: boolean; reminderDelayMs?: number; }\nexport interface PetBridge {\n start(options: DesktopOptions, lifetime?: StartLifetime): Promise<void>;\n update(snapshot: PetSnapshot): void;\n chatResult?(receipt: ChatReceipt): void;\n notify(notice: PetNotice | TaskNotice): void;\n notificationState?(snapshot: NotificationSnapshot): void;\n snoozeResult?(interactionId: string, ok: boolean, error?: string): void;\n presentRole?(notice: TaskNotice, runtime: NotificationRuntime): boolean;\n onAction(listener: (action: unknown) => void): void;\n removeAction(listener: (action: unknown) => void): void;\n dispose(): Promise<void>;\n configure?(options: DesktopOptions): void;\n control?(command: 'show' | 'hide' | 'characters'): void;\n focusHarness?(): void;\n onLifecycle?(listener: (state: NativeLifecycle) => void): void;\n removeLifecycle?(listener: (state: NativeLifecycle) => void): void;\n}\n\n/** Owns a separate Electron window; no changes or private IPC in the Harness desktop shell are needed. */\nexport class ElectronBridge extends EventEmitter implements PetBridge {\n private child?: ChildProcess;\n private latest?: PetSnapshot;\n private latestOptions?: DesktopOptions;\n private resultKey?: string;\n private closing = false;\n\n private generation = 0;\n private visibilityRevision = 0;\n private nativeVisible = false;\n private suspended = false;\n private screenLocked = false;\n private systemAsleep = false;\n private lastNotificationState?: NotificationSnapshot;\n\n async start(options: DesktopOptions, lifetime?: StartLifetime): Promise<void> {\n if (this.child) throw new NativeStartError('Desktop pet is already running', false);\n if (lifetime?.signal.aborted) throw new Error('\u684C\u5BA0\u542F\u52A8\u5DF2\u53D6\u6D88');\n this.latestOptions = { ...options };\n this.closing = false;\n this.generation = lifetime?.generation ?? this.generation + 1;\n this.visibilityRevision = 0; this.nativeVisible = false;\n if (process.platform === 'linux' && !process.env.DISPLAY && !process.env.WAYLAND_DISPLAY) throw new NativeStartError('\u684C\u5BA0\u9700\u8981\u684C\u9762\u663E\u793A\u73AF\u5883\u3002', false);\n let executable: string;\n try { executable = options.electronPath ?? createRequire(import.meta.url)('electron'); }\n catch (error) { throw new NativeStartError(String(error).slice(0, 600), false); }\n const env: NodeJS.ProcessEnv = { ...process.env, DSH_PET_GENERATION: String(this.generation), DSH_PET_VISIBLE: lifetime?.visible === false ? '0' : '1', DSH_PET_SCREEN_LOCKED: this.screenLocked ? '1' : '0', DSH_PET_SYSTEM_ASLEEP: this.systemAsleep ? '1' : '0' };\n delete (env as NodeJS.ProcessEnv).ELECTRON_RUN_AS_NODE;\n const args = [fileURLToPath(new URL('../desktop/main.cjs', import.meta.url))];\n if (env.DSH_PET_TEST_NO_SANDBOX === '1') args.unshift('--no-sandbox');\n const child = spawn(executable, args, { env, stdio: ['ignore', 'pipe', 'pipe', 'ipc'] });\n const generation = this.generation; this.child = child;\n let diagnostic = '', userClosed = false;\n child.stderr?.on('data', data => { diagnostic = (diagnostic + data.toString()).slice(-4000); });\n child.on('message', message => {\n if (this.child !== child || this.closing || lifetime?.signal.aborted || !isRecord(message)) return;\n if (message.type === 'closed') userClosed = true;\n if (message.type === 'action') this.emit('action', message.action);\n if (message.type === 'tray-state') this.emit('tray-state', message.state);\n if (message.type === 'tray-icon') this.emit('tray-icon', message);\n if (message.type === 'visibility' && message.generation === generation && typeof message.visible === 'boolean' && Number.isSafeInteger(message.visibilityRevision) && (message.visibilityRevision as number) > this.visibilityRevision) {\n this.visibilityRevision = message.visibilityRevision as number;\n this.nativeVisible = message.visible; this.suspended = message.suspended === true;\n if (typeof message.screenLocked === 'boolean') this.screenLocked = message.screenLocked;\n if (typeof message.systemAsleep === 'boolean') this.systemAsleep = message.systemAsleep;\n this.emit('lifecycle', { running: true, visible: this.nativeVisible, generation, visibilityRevision: this.visibilityRevision, suspended: this.suspended, ...(typeof message.desiredVisible === 'boolean' ? { desiredVisible: message.desiredVisible } : {}) });\n }\n });\n child.once('exit', (code, signal) => {\n if (this.child !== child) return;\n this.child = undefined; this.nativeVisible = false;\n const unexpected = !this.closing && !userClosed && !lifetime?.signal.aborted;\n const error = unexpected ? `\u684C\u5BA0\u8FDB\u7A0B\u5DF2\u9000\u51FA (${signal ?? code}): ${diagnostic}`.slice(0, 600) : undefined;\n this.emit('lifecycle', { running: false, visible: false, generation, visibilityRevision: ++this.visibilityRevision, suspended: false, unexpected, ...(error ? { error } : {}) });\n if (error) this.emit('failure', new Error(error));\n });\n child.on('error', error => { if (this.child === child && !this.closing && !lifetime?.signal.aborted) this.emit('failure', error); });\n await new Promise<void>((resolve, reject) => {\n let done = false;\n const finish = (error?: Error) => {\n if (done) return; done = true;\n clearTimeout(timer); child.off('message', ready); child.off('error', failed); child.off('exit', exited); lifetime?.signal.removeEventListener('abort', aborted);\n if (error) { child.kill(); reject(error); } else resolve();\n };\n const ready = (message: unknown) => {\n if (isRecord(message) && message.type === 'startup-error' && this.child === child && typeof message.error === 'string') {\n finish(new NativeStartError(message.error.slice(0, 600), message.recoverable === true)); return;\n }\n if (isRecord(message) && message.type === 'ready' && this.child === child && !lifetime?.signal.aborted) {\n this.resultKey = undefined;\n this.send({ type: 'init', options: { ...this.latestOptions, locale: this.latestOptions?.locale ?? null }, baseline: true, snapshot: this.latest && desktopSnapshot(this.latest, true) });\n if (this.lastNotificationState) this.notificationState(this.lastNotificationState);\n finish();\n }\n };\n const failed = (error: NodeJS.ErrnoException) => finish(new NativeStartError(error.message.slice(0, 600), error.code === 'EAGAIN' || error.code === 'ENOMEM'));\n const exited = (code: number | null, signal: string | null) => finish(new NativeStartError(`\u684C\u5BA0\u542F\u52A8\u5931\u8D25 (${signal ?? code}): ${diagnostic}`.slice(0, 600), true));\n const aborted = () => finish(new Error('\u684C\u5BA0\u542F\u52A8\u5DF2\u53D6\u6D88'));\n const timer = setTimeout(() => finish(new NativeStartError(`\u684C\u5BA0\u672A\u80FD\u5728 20 \u79D2\u5185\u542F\u52A8: ${diagnostic}`.slice(0, 600), true)), 20000);\n child.on('message', ready); child.once('error', failed); child.once('exit', exited);\n lifetime?.signal.addEventListener('abort', aborted, { once: true });\n if (lifetime?.signal.aborted) aborted();\n });\n }\n\n update(snapshot: PetSnapshot): void {\n this.latest = snapshot;\n const key = snapshot.results.map(result => `${result.id}:${result.read}`).join('|');\n this.send({ type: 'snapshot', snapshot: desktopSnapshot(snapshot, key !== this.resultKey) });\n this.resultKey = key;\n }\n notify(notice: PetNotice | TaskNotice): void { this.send({ type: 'notice', notice }); }\n notificationState(snapshot: NotificationSnapshot): void { this.lastNotificationState = structuredClone(snapshot); this.send({ type: 'notification-state', snapshot }); }\n snoozeResult(interactionId: string, ok: boolean, error?: string): void { this.send({ type: 'notification-snooze-result', interactionId, ok, ...(error ? { error: error.slice(0, 600) } : {}) }); }\n presentRole(notice: TaskNotice, runtime: NotificationRuntime): boolean {\n if (!this.child?.connected || this.closing || !this.nativeVisible || this.suspended || runtime.generation !== this.generation || runtime.visibilityRevision !== this.visibilityRevision || !runtime.visible) return false;\n this.send({ type: 'notice', notice, generation: runtime.generation, visibilityRevision: runtime.visibilityRevision }); return true;\n }\n chatResult(receipt: ChatReceipt): void { this.send(receipt); }\n onAction(listener: (action: unknown) => void): void { this.on('action', listener); }\n removeAction(listener: (action: unknown) => void): void { this.off('action', listener); }\n // JSON IPC omits undefined. An explicit null lets a cleared Harness\n // preference restore the renderer's automatic language instead of retaining\n // its previous locale during a merged configuration update.\n configure(options: DesktopOptions): void { this.latestOptions = { ...options }; this.send({ type: 'configure', options: { ...options, locale: options.locale ?? null } }); }\n control(command: 'show' | 'hide' | 'characters'): void { this.send({ type: 'control', command }); }\n focusHarness(): void { this.send({ type: 'control', command: 'focus-harness' }); }\n onLifecycle(listener: (state: NativeLifecycle) => void): void { this.on('lifecycle', listener); }\n removeLifecycle(listener: (state: NativeLifecycle) => void): void { this.off('lifecycle', listener); }\n private send(message: object): void {\n const child = this.child;\n if (child?.connected && !this.closing) child.send(message, error => { if (error && this.child === child && !this.closing) this.emit('failure', error); });\n }\n\n async dispose(): Promise<void> {\n this.closing = true;\n const child = this.child;\n if (!child) return;\n if (child.pid === undefined || child.exitCode !== null || child.signalCode !== null) { if (this.child === child) this.child = undefined; return; }\n await new Promise<void>((resolve, reject) => {\n let deadline: ReturnType<typeof setTimeout>;\n const timer = setTimeout(() => { child.kill('SIGKILL'); deadline = setTimeout(() => { if (child.exitCode !== null || child.signalCode !== null) resolve(); else reject(new Error('\u684C\u5BA0\u8FDB\u7A0B\u672A\u786E\u8BA4\u9000\u51FA')); }, 1000); }, 3000);\n child.once('exit', () => { clearTimeout(timer); clearTimeout(deadline); resolve(); });\n if (child.connected) child.send({ type: 'quit' }, error => { if (error) child.kill(); }); else child.kill();\n });\n if (this.child === child) this.child = undefined;\n }\n}\n\nexport function isRecord(value: unknown): value is Record<string, unknown> { return typeof value === 'object' && value !== null && !Array.isArray(value); }\n\n/** Stream animation updates carry metadata; full result text crosses IPC only when it changes. */\nfunction desktopSnapshot(snapshot: PetSnapshot, includeResults: boolean) {\n const { results, ...state } = snapshot;\n return { ...state, text: state.mood === 'happy' ? '' : state.text,\n sessions: state.sessions.map(session => ({ ...session, text: session.mood === 'happy' ? '' : session.text, reply: '' })),\n ...(includeResults ? { results } : {}),\n };\n}\n", "/** Shared Host/native lifetime contract. Only explicitly recoverable failures retry. */\nexport interface StartLifetime { signal: AbortSignal; generation: number; visible?: boolean; }\nexport interface NativeLifecycle {\n running: boolean; visible: boolean; error?: string;\n generation?: number; visibilityRevision?: number; suspended?: boolean;\n desiredVisible?: boolean; unexpected?: boolean;\n}\nexport class NativeStartError extends Error {\n constructor(message: string, readonly recoverable: boolean) { super(message); this.name = 'NativeStartError'; }\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,aAAgC;AACzC,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;;;ACItB,IAAM,mBAAN,cAA+B,MAAM;AAAA,EAC1C,YAAY,SAA0B,aAAsB;AAAE,UAAM,OAAO;AAArC;AAAwC,SAAK,OAAO;AAAA,EAAoB;AAChH;;;ADwBO,IAAM,iBAAN,cAA6B,aAAkC;AAAA,EAC5D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EAEV,aAAa;AAAA,EACb,qBAAqB;AAAA,EACrB,gBAAgB;AAAA,EAChB,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,eAAe;AAAA,EACf;AAAA,EAER,MAAM,MAAM,SAAyB,UAAyC;AAC5E,QAAI,KAAK,MAAO,OAAM,IAAI,iBAAiB,kCAAkC,KAAK;AAClF,QAAI,UAAU,OAAO,QAAS,OAAM,IAAI,MAAM,4CAAS;AACvD,SAAK,gBAAgB,EAAE,GAAG,QAAQ;AAClC,SAAK,UAAU;AACf,SAAK,aAAa,UAAU,cAAc,KAAK,aAAa;AAC5D,SAAK,qBAAqB;AAAG,SAAK,gBAAgB;AAClD,QAAI,QAAQ,aAAa,WAAW,CAAC,QAAQ,IAAI,WAAW,CAAC,QAAQ,IAAI,gBAAiB,OAAM,IAAI,iBAAiB,sEAAe,KAAK;AACzI,QAAI;AACJ,QAAI;AAAE,mBAAa,QAAQ,gBAAgB,cAAc,YAAY,GAAG,EAAE,UAAU;AAAA,IAAG,SAChF,OAAO;AAAE,YAAM,IAAI,iBAAiB,OAAO,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,KAAK;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