@takboo/dsh-coopanion 0.4.9 → 0.4.12
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 -105
- 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 +73 -13
- package/desktop/preload.cjs +3 -0
- package/dist/bridge.js.map +2 -2
- package/dist/build-info.json +6 -0
- package/dist/client.js +72 -1
- package/dist/companion-store.cjs +19907 -0
- package/dist/diagnostics.cjs +170 -0
- package/dist/figure-server.cjs +19725 -23
- package/dist/index.js +48 -3
- package/dist/index.js.map +3 -3
- package/docs/README.md +71 -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 +4 -2
- package/docs/desktop-recovery-contract.md +4 -0
- package/docs/development.md +87 -0
- package/docs/diagnostics-contract.md +45 -0
- package/docs/evidence/AGENTS.md +5 -0
- package/docs/evidence/README.md +26 -0
- package/docs/evidence/p1/README.md +90 -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.10/README.md +31 -0
- package/docs/evidence/releases/v0.4.10/published-20261016/SHA256SUMS +3 -0
- package/docs/evidence/releases/v0.4.10/published-20261016/delivery-verification.json +871 -0
- package/docs/evidence/releases/v0.4.10/published-20261016/installation-reports.zip +0 -0
- package/docs/evidence/releases/v0.4.10/published-20261016/verification.json +7 -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 +4 -4
- package/docs/notification-contract.md +8 -6
- package/docs/npc-daily-life-plan.md +80 -0
- package/docs/release-notes.md +42 -0
- package/docs/releasing.md +7 -18
- package/docs/roadmap.md +69 -153
- package/docs/session-chat-contract.md +1 -1
- package/docs/text-readability-contract.md +2 -2
- package/docs/usage.md +159 -0
- package/npm-shrinkwrap.json +22 -21
- package/package.json +23 -21
- package/scripts/build.mjs +22 -1
- package/scripts/capture-showcase.mjs +81 -0
- package/scripts/check-package.mjs +8 -0
- package/scripts/diagnostics-client.mjs +98 -0
- package/scripts/measure-idle.mjs +11 -7
- 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 +2 -1
- package/src/client/Settings.tsx +9 -3
- package/src/client/locales.ts +4 -0
- package/src/companion-store.ts +149 -0
- package/src/diagnostics.ts +98 -0
- package/src/figure-server.ts +18 -4
- package/src/index.ts +12 -7
- package/tests/bridge.test.ts +3 -3
- 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 +330 -0
- package/tests/companionship.test.js +57 -0
- package/tests/desktop.mjs +4 -0
- package/tests/diagnostics-discovery.test.js +52 -0
- package/tests/diagnostics-native.mjs +82 -0
- package/tests/diagnostics.test.js +133 -0
- package/tests/fixtures/host.mjs +15 -2
- package/tests/helpers/body-startup.mjs +31 -0
- package/tests/helpers/companionship.mjs +25 -0
- package/tests/helpers/keyboard-x11-probe.py +60 -0
- package/tests/helpers/native-pointer.mjs +10 -0
- package/tests/helpers/npc-life.mjs +24 -0
- package/tests/install.mjs +59 -6
- package/tests/keyboard-activity-native.mjs +40 -0
- package/tests/keyboard-activity.test.js +102 -0
- package/tests/lifecycle-startup-native.mjs +57 -0
- package/tests/lifecycle-state.test.js +44 -0
- package/tests/npc-life-native.mjs +52 -0
- package/tests/npc-life.test.js +77 -0
- package/tests/plugin.test.ts +28 -0
- package/tests/render-cadence.test.js +20 -0
- package/tests/resource-observation.test.js +52 -0
- package/tests/session-replies-ui.mjs +3 -1
- package/tests/text-scale-ui.mjs +3 -1
- 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/diagnostics.js +13 -0
- package/web/index.html +9 -0
- package/web/locale.js +2 -0
- package/web/npc-life.js +91 -0
- package/web/pet.js +186 -20
- package/web/render-cadence.js +6 -0
- package/web/style.css +13 -1
- package/web/upstream/LICENSE +661 -0
- package/web/upstream/UPSTREAM.md +2 -0
package/desktop/main.cjs
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
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');
|
|
@@ -24,14 +32,33 @@ if (process.env.DSH_PET_TEST_DEBUG_PORT) {
|
|
|
24
32
|
app.commandLine.appendSwitch('remote-debugging-port', process.env.DSH_PET_TEST_DEBUG_PORT);
|
|
25
33
|
}
|
|
26
34
|
const displayTest = process.env.DSH_PET_TEST_NO_SANDBOX === '1' && !!process.env.DSH_PET_TEST_DEBUG_PORT;
|
|
27
|
-
|
|
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
|
+
}
|
|
28
54
|
let presentation = {}, lastTrayKey, lastIconKey, iconBase, iconAppearance;
|
|
29
55
|
let interactive = null;
|
|
30
56
|
const generation = Number(process.env.DSH_PET_GENERATION ?? 1);
|
|
31
57
|
let visibilityRevision = 0, screenLocked = process.env.DSH_PET_SCREEN_LOCKED === '1', systemAsleep = process.env.DSH_PET_SYSTEM_ASLEEP === '1';
|
|
32
|
-
let
|
|
58
|
+
let lockStateKnown = false;
|
|
59
|
+
let suspended = true;
|
|
33
60
|
let desiredVisible = process.env.DSH_PET_VISIBLE !== '0', userClosed = false;
|
|
34
|
-
function visibility() { if (win && !win.isDestroyed()) { process.send?.({ type: 'visibility', generation, visibilityRevision: ++visibilityRevision, visible: win.isVisible(), desiredVisible, suspended, screenLocked, systemAsleep }); syncTray(); } }
|
|
61
|
+
function visibility() { if (win && !win.isDestroyed()) { process.send?.({ type: 'visibility', generation, visibilityRevision: ++visibilityRevision, visible: win.isVisible(), desiredVisible, suspended, screenLocked, systemAsleep, lockStateKnown }); syncTray(); } }
|
|
35
62
|
function forward(message) { if (win && !win.isDestroyed()) win.webContents.send('pet:update', message); }
|
|
36
63
|
function hit(active) {
|
|
37
64
|
if (!win || win.isDestroyed()) return;
|
|
@@ -108,8 +135,8 @@ async function syncIcon(state, key) {
|
|
|
108
135
|
process.on('message', message => {
|
|
109
136
|
if (!message || typeof message !== 'object') return;
|
|
110
137
|
if (message.type === 'quit') { app.quit(); return; }
|
|
111
|
-
if (message.type === 'init') { options = message.options; lastFrame = message; forward(message); syncTray(); }
|
|
112
|
-
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(); }
|
|
113
140
|
if (message.type === 'control') {
|
|
114
141
|
if (message.command === 'hide') hide();
|
|
115
142
|
if (message.command === 'show' || message.command === 'characters') show();
|
|
@@ -129,10 +156,29 @@ process.on('disconnect', () => app.quit());
|
|
|
129
156
|
process.on('SIGTERM', () => app.quit());
|
|
130
157
|
|
|
131
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;
|
|
132
168
|
const { chatRequest } = await import('../web/chat-contract.js');
|
|
133
169
|
const webRoot = join(__dirname, '../web');
|
|
134
170
|
characters = new CharacterStore(join(app.getPath('userData'), 'figures-v2'), join(webRoot, 'upstream/whale'));
|
|
135
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(); });
|
|
136
182
|
assetServer = createPetServer({ webRoot, store: characters, prefix });
|
|
137
183
|
assetServer.listen(0, '127.0.0.1'); await once(assetServer, 'listening');
|
|
138
184
|
let characterOperation = Promise.resolve();
|
|
@@ -146,13 +192,25 @@ app.whenReady().then(async () => {
|
|
|
146
192
|
return result;
|
|
147
193
|
});
|
|
148
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
|
+
});
|
|
149
201
|
characterCall('pet:characters:list', () => characters.list());
|
|
150
202
|
characterCall('pet:characters:load', value => characters.load(characterId(value)));
|
|
151
203
|
characterCall('pet:characters:select', value => {
|
|
152
204
|
if (!value || typeof value.scheme !== 'string') throw new Error('无效的角色配色');
|
|
153
205
|
return characters.select(characterId(value.id), value.scheme);
|
|
154
206
|
});
|
|
155
|
-
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
|
+
});
|
|
156
214
|
characterCall('pet:characters:import', value => {
|
|
157
215
|
if (!(value instanceof ArrayBuffer)) throw new Error('请选择 API 2 ZIP 角色包');
|
|
158
216
|
return characters.import(new Uint8Array(value));
|
|
@@ -161,11 +219,6 @@ app.whenReady().then(async () => {
|
|
|
161
219
|
win.setAlwaysOnTop(true, 'floating');
|
|
162
220
|
win.on('show', visibility); win.on('hide', visibility);
|
|
163
221
|
win.webContents.on('render-process-gone', () => app.exit(1));
|
|
164
|
-
const suspendState = () => { suspended = screenLocked || systemAsleep; visibility(); };
|
|
165
|
-
powerMonitor.on('suspend', () => { systemAsleep = true; suspendState(); });
|
|
166
|
-
powerMonitor.on('resume', () => { systemAsleep = false; suspendState(); });
|
|
167
|
-
powerMonitor.on('lock-screen', () => { screenLocked = true; suspendState(); });
|
|
168
|
-
powerMonitor.on('unlock-screen', () => { screenLocked = false; suspendState(); });
|
|
169
222
|
win.setVisibleOnAllWorkspaces(true, { visibleOnFullScreen: true });
|
|
170
223
|
if (process.platform === 'darwin') app.dock?.hide();
|
|
171
224
|
win.webContents.setWindowOpenHandler(() => ({ action: 'deny' }));
|
|
@@ -176,6 +229,11 @@ app.whenReady().then(async () => {
|
|
|
176
229
|
if (displayTest) require('./test-display-probe.cjs').installDisplayProbe({ ipcMain, screen, win, displays });
|
|
177
230
|
for (const event of ['resize', 'move']) win.on(event, () => setImmediate(() => { if (!win.isDestroyed()) displays.refresh(); }));
|
|
178
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
|
+
});
|
|
179
237
|
ipcMain.on('pet:hit', (event, active) => { if (event.sender === win.webContents && event.senderFrame === win.webContents.mainFrame && typeof active === 'boolean') hit(active); });
|
|
180
238
|
ipcMain.on('pet:action', (event, action) => {
|
|
181
239
|
if (event.sender !== win.webContents || event.senderFrame !== win.webContents.mainFrame || !action || typeof action !== 'object') return;
|
|
@@ -195,8 +253,10 @@ app.whenReady().then(async () => {
|
|
|
195
253
|
if (desiredVisible) show(); else visibility();
|
|
196
254
|
// Restore input when a click-through window misses movement, without repeatedly
|
|
197
255
|
// overriding the renderer's newer pointer event with a stationary OS cursor.
|
|
198
|
-
let lastCursor;
|
|
256
|
+
let lastCursor, keyboardSentAt = -Infinity;
|
|
199
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() }); }
|
|
200
260
|
if (!win || win.isDestroyed() || !win.isVisible()) return;
|
|
201
261
|
const next = displays.cursor();
|
|
202
262
|
if (!next || (next.x === lastCursor?.x && next.y === lastCursor?.y && next.revision === lastCursor?.revision)) return;
|
|
@@ -214,5 +274,5 @@ app.whenReady().then(async () => {
|
|
|
214
274
|
if (process.connected) process.send(failure, () => app.exit(1)); else app.exit(1);
|
|
215
275
|
});
|
|
216
276
|
|
|
217
|
-
app.on('before-quit', () => { if (userClosed) process.send?.({ type: 'closed' }); clearInterval(poll); assetServer?.close(); tray?.destroy(); });
|
|
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(); });
|
|
218
278
|
app.on('window-all-closed', () => { userClosed = true; app.quit(); });
|
package/desktop/preload.cjs
CHANGED
|
@@ -5,6 +5,7 @@ async function characterCall(channel, value) {
|
|
|
5
5
|
return result.value;
|
|
6
6
|
}
|
|
7
7
|
contextBridge.exposeInMainWorld('dshPetBridge', {
|
|
8
|
+
nativeGeometry: true,
|
|
8
9
|
...(process.argv.includes('--dsh-pet-display-test') ? { testScreenPoint: value => ipcRenderer.invoke('pet:test-screen-point', value) } : {}),
|
|
9
10
|
subscribe(callback) {
|
|
10
11
|
const listener = (_event, message) => callback(message);
|
|
@@ -14,6 +15,8 @@ contextBridge.exposeInMainWorld('dshPetBridge', {
|
|
|
14
15
|
// Chat carries its immutable target and client request identity unchanged.
|
|
15
16
|
action(value) { ipcRenderer.send('pet:action', value); },
|
|
16
17
|
hit(active) { ipcRenderer.send('pet:hit', active); },
|
|
18
|
+
diagnosticsRespond: value => ipcRenderer.send('pet:diagnostics-response', value),
|
|
19
|
+
companionship: value => characterCall('pet:companionship', value),
|
|
17
20
|
characters: {
|
|
18
21
|
list: () => characterCall('pet:characters:list'),
|
|
19
22
|
load: id => characterCall('pet:characters:load', id),
|
package/dist/bridge.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
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 { TextScale } from '../web/text-scale.js';\n\nexport interface DesktopOptions { size: number; textScale?: TextScale; roam: boolean; dailyRhythm?: 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 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;;;
|
|
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;AA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,MAAM,QAAQ,KAAK;AAAG;AAG1J,SAAS,gBAAgB,UAAuB,gBAAyB;AACvE,QAAM,EAAE,SAAS,GAAG,MAAM,IAAI;AAC9B,SAAO;AAAA,IAAE,GAAG;AAAA,IAAO,MAAM,MAAM,SAAS,UAAU,KAAK,MAAM;AAAA,IAC3D,UAAU,MAAM,SAAS,IAAI,cAAY,EAAE,GAAG,SAAS,MAAM,QAAQ,SAAS,UAAU,KAAK,QAAQ,MAAM,OAAO,GAAG,EAAE;AAAA,IACvH,GAAI,iBAAiB,EAAE,QAAQ,IAAI,CAAC;AAAA,EACtC;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/client.js
CHANGED
|
@@ -30,6 +30,9 @@ module.exports = __toCommonJS(index_exports);
|
|
|
30
30
|
var import_react = require("react");
|
|
31
31
|
var import_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
32
32
|
|
|
33
|
+
// web/companionship.js
|
|
34
|
+
var COMPANIONSHIP_MODES = ["off", "quiet", "interactive"];
|
|
35
|
+
|
|
33
36
|
// web/text-scale.js
|
|
34
37
|
var TEXT_SCALES = Object.freeze([1, 1.25, 1.5]);
|
|
35
38
|
var DEFAULT_TEXT_SCALE = 1;
|
|
@@ -203,7 +206,7 @@ function Settings({ form, call, local, notifier, t }) {
|
|
|
203
206
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "pet-card", "aria-label": t("preferences"), children: [
|
|
204
207
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { children: t("preferences") }),
|
|
205
208
|
!accepted.writable || !local ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: t("unavailable") }) : null,
|
|
206
|
-
["autoStart", "roam", "dailyRhythm", "notifications"].map((field) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pet-row", children: [
|
|
209
|
+
["autoStart", "roam", "dailyRhythm", "notifications", "diagnostics"].map((field) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pet-row", children: [
|
|
207
210
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pet-label", children: [
|
|
208
211
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: t(field) }),
|
|
209
212
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: t(`${field}Hint`) })
|
|
@@ -211,6 +214,14 @@ function Settings({ form, call, local, notifier, t }) {
|
|
|
211
214
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Switch, { checked: prefs?.[field] ?? false, disabled: !ready || !local, label: t(field), onChange: (value) => void save(field, value) })
|
|
212
215
|
] }, field)),
|
|
213
216
|
prefs ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
217
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pet-row", children: [
|
|
218
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pet-label", children: [
|
|
219
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { htmlFor: "coopanion-companionship", children: t("companionship") }),
|
|
220
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { id: "coopanion-companionship-hint", children: t("companionshipHint") })
|
|
221
|
+
] }),
|
|
222
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("select", { id: "coopanion-companionship", className: "pet-number", "aria-describedby": "coopanion-companionship-hint", value: prefs.companionship ?? "off", disabled: !ready || !local, onChange: (event) => void save("companionship", event.target.value), children: COMPANIONSHIP_MODES.map((value) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value, children: t(`companionship_${value}`) }, value)) })
|
|
223
|
+
] }),
|
|
224
|
+
["npcHome", "npcRange"].map((field) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NumberPreference, { id: `coopanion-${field}`, label: t(field), hint: t(`${field}Hint`), invalidHint: t("invalid"), value: Math.round((prefs[field] ?? (field === "npcHome" ? 0.85 : 0.3)) * 100), min: field === "npcHome" ? 5 : 10, max: field === "npcHome" ? 95 : 60, disabled: !ready || !local, save: (value) => void save(field, value / 100) }, field)),
|
|
214
225
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(NumberPreference, { id: "coopanion-size", label: t("size"), hint: t("sizeHint"), invalidHint: t("invalid"), value: prefs.size, min: 90, max: 240, disabled: !ready || !local, save: (value) => void save("size", value) }),
|
|
215
226
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pet-row", children: [
|
|
216
227
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pet-label", children: [
|
|
@@ -309,6 +320,17 @@ var zh = {
|
|
|
309
320
|
roamHint: "\u684C\u5BA0\u7A7A\u95F2\u65F6\u5728\u5F53\u524D\u5C4F\u5E55\u4E0A\u7F13\u6162\u79FB\u52A8\u3002",
|
|
310
321
|
notifications: "\u4EFB\u52A1\u901A\u77E5",
|
|
311
322
|
notificationsHint: "\u4EFB\u52A1\u5B8C\u6210\u3001\u51FA\u9519\u3001\u5BA1\u6279\u548C AI \u63D0\u95EE\u65F6\u63D0\u9192\u4F60\u3002",
|
|
323
|
+
diagnostics: "\u672C\u5730\u8BCA\u65AD",
|
|
324
|
+
diagnosticsHint: "\u9ED8\u8BA4\u5173\u95ED\u3002\u5141\u8BB8\u672C\u673A\u72EC\u7ACB\u91C7\u6837\u5668\u8BFB\u53D6\u8D44\u6E90\u548C\u6D3B\u52A8\u8BA1\u6570\uFF0C\u4E0D\u8BB0\u5F55\u804A\u5929\u5185\u5BB9\uFF1B\u5173\u95ED\u540E\u505C\u6B62\u63D0\u4F9B\u6570\u636E\u3002",
|
|
325
|
+
npcHome: "\u5C0F\u7A9D\u6A2A\u5411\u4F4D\u7F6E\uFF08%\uFF09",
|
|
326
|
+
npcHomeHint: "\u76F8\u5BF9\u5F53\u524D\u663E\u793A\u5668\u5DE5\u4F5C\u533A\uFF1B\u5B9E\u9645\u89D2\u8272\u8FB9\u754C\u4F1A\u9650\u5236\u5B89\u5168\u4F4D\u7F6E\u3002",
|
|
327
|
+
npcRange: "\u63A2\u7D22\u8303\u56F4\uFF08%\uFF09",
|
|
328
|
+
npcRangeHint: "\u4EC5\u5728\u5F53\u524D\u5C4F\u5E55\u5E95\u90E8\u63A2\u7D22\u3002\u81EA\u52A8\u6D3B\u52A8\u603B\u8BB8\u53EF\u4ECD\u63A7\u5236\u662F\u5426\u51FA\u53D1\u3002",
|
|
329
|
+
companionship: "\u81EA\u4E3B\u966A\u4F34",
|
|
330
|
+
companionshipHint: "\u5B89\u9759\u966A\u4F34\u4F1A\u81EA\u5DF1\u6D3B\u52A8\uFF1B\u4E92\u52A8\u966A\u4F34\u5076\u5C14\u9080\u8BF7\u4F60\u3002\u76F8\u5904\u4F1A\u89E3\u9501\u719F\u6089\u62DB\u547C\uFF0C\u5DE5\u4F5C\u4E0E\u9605\u8BFB\u59CB\u7EC8\u4F18\u5148\u3002",
|
|
331
|
+
companionship_off: "\u5173\u95ED\uFF08\u6CBF\u7528\u539F\u8282\u594F\uFF09",
|
|
332
|
+
companionship_quiet: "\u5B89\u9759\u966A\u4F34",
|
|
333
|
+
companionship_interactive: "\u4E92\u52A8\u966A\u4F34",
|
|
312
334
|
dailyRhythm: "\u65E5\u5E38\u966A\u4F34\u8282\u594F",
|
|
313
335
|
dailyRhythmHint: "\u9ED8\u8BA4\u5173\u95ED\u3002\u5F00\u542F\u95F2\u65F6\u8D70\u52A8\u540E\uFF0C\u767D\u5929\u6BCF 45\u201390 \u79D2\u6D3B\u52A8\uFF0C22:00\u201307:00 \u6BCF 2\u20134 \u5206\u949F\u8F7B\u52A8\uFF1B\u5DE5\u4F5C\u3001\u9605\u8BFB\u3001\u8F93\u5165\u3001\u4F11\u606F\u548C\u51CF\u5C11\u52A8\u6001\u6548\u679C\u4F18\u5148\u3002",
|
|
314
336
|
notificationSettings: "\u63D0\u9192\u4E0E\u901A\u77E5",
|
|
@@ -378,6 +400,17 @@ var en = {
|
|
|
378
400
|
roamHint: "Move slowly across the current screen while idle.",
|
|
379
401
|
notifications: "Task notifications",
|
|
380
402
|
notificationsHint: "Remind you about completion, errors, approvals and AI questions.",
|
|
403
|
+
diagnostics: "Local diagnostics",
|
|
404
|
+
diagnosticsHint: "Off by default. Allow a separate local sampler to read resource and activity counts without chat content. Turn off to stop providing data.",
|
|
405
|
+
npcHome: "Home position (%)",
|
|
406
|
+
npcHomeHint: "Relative to the current work area, constrained by actual body bounds.",
|
|
407
|
+
npcRange: "Exploration range (%)",
|
|
408
|
+
npcRangeHint: "Explore along the bottom of this display. Automatic activity permission still controls departures.",
|
|
409
|
+
companionship: "Companionship",
|
|
410
|
+
companionshipHint: "Quiet companionship adds daily routines; interactive companionship occasionally invites you. Shared activities unlock a familiar greeting. Work and reading take priority.",
|
|
411
|
+
companionship_off: "Off (legacy rhythm)",
|
|
412
|
+
companionship_quiet: "Quiet",
|
|
413
|
+
companionship_interactive: "Interactive",
|
|
381
414
|
dailyRhythm: "Daily rhythm",
|
|
382
415
|
dailyRhythmHint: "Off by default. With idle roaming on, act every 45\u201390 seconds by day, gently every 2\u20134 minutes at 22:00\u201307:00 local time. Work, reading, input, rest and reduced motion take priority.",
|
|
383
416
|
notificationSettings: "Reminders and notifications",
|
|
@@ -20169,6 +20202,25 @@ function petLanguage(locale = "en") {
|
|
|
20169
20202
|
return /^zh(?:-|$)/i.test(locale) ? "zh" : "en";
|
|
20170
20203
|
}
|
|
20171
20204
|
var zh2 = {
|
|
20205
|
+
companionPetThanks: "\u8C22\u8C22\u6478\u6478",
|
|
20206
|
+
companionNoActivity: "\u8FD9\u4E2A\u6A21\u6837\u6682\u65F6\u6CA1\u6709\u4E00\u8D77\u6D3B\u52A8\u7684\u52A8\u4F5C",
|
|
20207
|
+
companionInvite: "\u966A\u6211\u6D3B\u52A8\u4E00\u4E0B\uFF1F",
|
|
20208
|
+
companionTogether: "\u4E00\u8D77\u6D3B\u52A8",
|
|
20209
|
+
companionLater: "\u7A0D\u540E",
|
|
20210
|
+
companionQuietToday: "\u4ECA\u5929\u5B89\u9759",
|
|
20211
|
+
companionMode: "\u81EA\u4E3B\u966A\u4F34",
|
|
20212
|
+
companionOff: "\u5173\u95ED\uFF08\u539F\u6709\u8282\u594F\uFF09",
|
|
20213
|
+
companionQuiet: "\u5B89\u9759\u966A\u4F34",
|
|
20214
|
+
companionInteractive: "\u4E92\u52A8\u966A\u4F34",
|
|
20215
|
+
companionResume: "\u6062\u590D\u9080\u8BF7",
|
|
20216
|
+
companionNew: "\u6162\u6162\u719F\u6089\u4F60",
|
|
20217
|
+
companionFamiliar: "\u719F\u6089\u62DB\u547C\u5DF2\u89E3\u9501",
|
|
20218
|
+
companionProgress: (n) => `\u4E00\u8D77\u76F8\u5904\u4E86 ${n} \u6B21`,
|
|
20219
|
+
companionUnavailable: "\u76F8\u5904\u8FDB\u5EA6\u6682\u65F6\u65E0\u6CD5\u4FDD\u5B58",
|
|
20220
|
+
companionDisabled: "\u5F00\u542F\u966A\u4F34\uFF0C\u7559\u4E0B\u76F8\u5904\u7684\u8BB0\u5FC6",
|
|
20221
|
+
companionBusy: "\u7B49\u5FD9\u5B8C\u518D\u4E00\u8D77\u73A9",
|
|
20222
|
+
companionPlaying: "\u966A\u4F60\u6D3B\u52A8\u4E00\u4F1A\u513F",
|
|
20223
|
+
companionPlayed: "\u4E00\u8D77\u6D3B\u52A8\uFF0C\u771F\u5F00\u5FC3",
|
|
20172
20224
|
defaultName: "DeepSeek \u5927\u80A5\u9C7C",
|
|
20173
20225
|
title: "DeepSeek \u5927\u80A5\u9C7C \xB7 Harness",
|
|
20174
20226
|
words: { neutral: "\u5E73\u9759", happy: "\u5F00\u5FC3", wink: "\u7728\u773C", love: "\u559C\u6B22", shy: "\u5BB3\u7F9E", surprised: "\u60CA\u8BB6", angry: "\u751F\u6C14", sad: "\u96BE\u8FC7", sleepy: "\u72AF\u56F0", thinking: "\u601D\u8003", smug: "\u5F97\u610F", pout: "\u561F\u5634", worried: "\u62C5\u5FC3", determined: "\u8BA4\u771F", flustered: "\u614C\u5F20", scared: "\u5BB3\u6015", excited: "\u671F\u5F85", cry: "\u5927\u54ED", confused: "\u7591\u60D1", stand: "\u7AD9\u8D77", jump: "\u8DF3", hop: "\u5C0F\u8DF3", look: "\u5F20\u671B", turn: "\u8F6C\u8EAB", nod: "\u70B9\u5934", shake: "\u6447\u5934", spin: "\u8F6C\u5708", sit: "\u5750\u4E0B", sleep: "\u7761\u89C9", dizzy: "\u6655", walk: "\u6563\u6B65", run: "\u8DD1", wave: "\u62DB\u624B", bow: "\u97A0\u8EAC", shiver: "\u53D1\u6296", flap: "\u6251\u817E", dance: "\u8DF3\u821E" },
|
|
@@ -20323,6 +20375,25 @@ var zh2 = {
|
|
|
20323
20375
|
${busy} \u6BB5\u8FDB\u884C\u4E2D \xB7 ${pending} \u6BB5\u9700\u8981\u4F60 \xB7 ${unread} \u4EFD\u672A\u8BFB\u56DE\u590D`
|
|
20324
20376
|
};
|
|
20325
20377
|
var en2 = {
|
|
20378
|
+
companionPetThanks: "Thanks for the gentle stroke",
|
|
20379
|
+
companionNoActivity: "This character has no shared activity yet",
|
|
20380
|
+
companionInvite: "Shall we play for a moment?",
|
|
20381
|
+
companionTogether: "Play together",
|
|
20382
|
+
companionLater: "Later",
|
|
20383
|
+
companionQuietToday: "Quiet today",
|
|
20384
|
+
companionMode: "Companionship",
|
|
20385
|
+
companionOff: "Off (legacy rhythm)",
|
|
20386
|
+
companionQuiet: "Quiet",
|
|
20387
|
+
companionInteractive: "Interactive",
|
|
20388
|
+
companionResume: "Resume invitations",
|
|
20389
|
+
companionNew: "Getting to know you",
|
|
20390
|
+
companionFamiliar: "Familiar greeting unlocked",
|
|
20391
|
+
companionProgress: (n) => `${n} shared moments`,
|
|
20392
|
+
companionUnavailable: "Shared moments cannot be saved right now",
|
|
20393
|
+
companionDisabled: "Enable companionship to remember shared moments",
|
|
20394
|
+
companionBusy: "Let\u2019s play after work",
|
|
20395
|
+
companionPlaying: "Playing together",
|
|
20396
|
+
companionPlayed: "That was fun together",
|
|
20326
20397
|
defaultName: "DeepSeek Whale",
|
|
20327
20398
|
title: "DeepSeek Whale \xB7 Harness",
|
|
20328
20399
|
words: { neutral: "Neutral", happy: "Happy", wink: "Wink", love: "Love", shy: "Shy", surprised: "Surprised", angry: "Angry", sad: "Sad", sleepy: "Sleepy", thinking: "Thinking", smug: "Smug", pout: "Pout", worried: "Worried", determined: "Determined", flustered: "Flustered", scared: "Scared", excited: "Excited", cry: "Cry", confused: "Confused", stand: "Stand", jump: "Jump", hop: "Hop", look: "Look around", turn: "Turn", nod: "Nod", shake: "Shake head", spin: "Spin", sit: "Sit", sleep: "Sleep", dizzy: "Dizzy", walk: "Walk", run: "Run", wave: "Wave", bow: "Bow", shiver: "Shiver", flap: "Flap", dance: "Dance" },
|