@bitefoundry/retrieviewer 0.0.17 → 0.0.19

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.
Files changed (62) hide show
  1. package/ASSET-PROVENANCE.md +11 -0
  2. package/ASSETS-LICENSE.md +6 -0
  3. package/ATTRIBUTION.md +8 -0
  4. package/DESKTOP-PLATFORMS.md +1 -1
  5. package/INSTALLING.md +2 -1
  6. package/LICENSE +16 -16
  7. package/NATIVE-RUNTIME.md +95 -0
  8. package/PREREQUISITES.md +7 -0
  9. package/PUPPY-MEMORY.md +22 -0
  10. package/README.ko.md +17 -1
  11. package/README.md +19 -1
  12. package/RELEASING.md +35 -0
  13. package/SPARSE-PAINT.md +66 -0
  14. package/THIRD-PARTY-NOTICES.md +8 -0
  15. package/WINDOWS-COMPANION.md +15 -6
  16. package/braille.mjs +2 -2
  17. package/integrations/native-windows/CMakeLists.txt +15 -0
  18. package/integrations/native-windows/THIRD-PARTY-LICENSES.txt +77 -0
  19. package/integrations/native-windows/application.manifest +8 -0
  20. package/integrations/native-windows/bin/win32-x64/retrieviewer-native.exe +0 -0
  21. package/integrations/native-windows/desktop.mjs +48 -0
  22. package/integrations/native-windows/host.cpp +85 -0
  23. package/integrations/native-windows/manifest.json +14 -0
  24. package/integrations/native-windows/native-control.hpp +41 -0
  25. package/integrations/native-windows/native-paint.hpp +86 -0
  26. package/integrations/native-windows/native-window.hpp +107 -0
  27. package/integrations/native-windows/paint-regions.hpp +55 -0
  28. package/integrations/native-windows/runtime.bundle.mjs +4694 -0
  29. package/integrations/native-windows/runtime.mjs +55 -0
  30. package/integrations/native-windows/sources.json +23 -0
  31. package/integrations/purrviewer/ART.md +289 -0
  32. package/integrations/purrviewer/ASSETS-LICENSE.md +21 -0
  33. package/integrations/purrviewer/LICENSE +24 -0
  34. package/integrations/purrviewer/art/ginger.bin.gz +0 -0
  35. package/integrations/purrviewer/art/ginger.json +1707 -0
  36. package/integrations/purrviewer/art/ginger.rvz +0 -0
  37. package/integrations/purrviewer/src/contact.mjs +63 -0
  38. package/integrations/purrviewer/src/habitat.mjs +41 -0
  39. package/integrations/purrviewer/src/life.mjs +280 -0
  40. package/integrations/purrviewer/src/purrviewer-core.mjs +130 -0
  41. package/integrations/purrviewer/src/purrviewer.mjs +37 -0
  42. package/integrations/purrviewer/src/walk-cycle.mjs +3 -0
  43. package/integrations/purrviewer/src/world.mjs +216 -0
  44. package/integrations/purrviewer/vendor/retrieviewer/LICENSE-CODE +21 -0
  45. package/integrations/purrviewer/vendor/retrieviewer/braille.mjs +73 -0
  46. package/integrations/purrviewer/vendor/retrieviewer/puppy-frame-file.mjs +15 -0
  47. package/integrations/purrviewer/vendor/retrieviewer/puppy-frame-indexed.mjs +78 -0
  48. package/integrations/purrviewer/vendor/retrieviewer/puppy-frame-predictive.mjs +170 -0
  49. package/integrations/purrviewer/vendor/retrieviewer/puppy-frame-store.mjs +114 -0
  50. package/integrations/windows-overlay/desktop.mjs +11 -3
  51. package/integrations/windows-overlay/worker.mjs +9 -2
  52. package/package.json +42 -4
  53. package/puppy-clean.mjs +2 -2
  54. package/puppy-companion-sprites.mjs +2 -2
  55. package/puppy-frame-indexed.mjs +2 -2
  56. package/puppy-paper-actions.mjs +2 -2
  57. package/puppy-paper-behaviors.mjs +1 -1
  58. package/puppy-paper-contact.mjs +2 -2
  59. package/puppy-paper-seat.mjs +2 -2
  60. package/puppy-paper.mjs +12 -12
  61. package/retrieviewer-cli.mjs +10 -6
  62. package/retrieviewer.mjs +13 -4
@@ -121,3 +121,14 @@ domestic trademark research records possible similar marks; owning an npm scope
121
121
  does not resolve them. No trademark filing or legal service is part of this
122
122
  release. The review records provenance, compatible release terms and exclusions;
123
123
  it must not be advertised as comprehensive IP clearance.
124
+
125
+ ## Ginger cat release · 2026-10-25
126
+
127
+ The owner explicitly selected CC BY-SA4.0 for the approved ginger cat and
128
+ authorized including it in this npm/website release. Code stays MIT.
129
+ Purrviewer source commit5452da3569623b26f1ea87f1097735a1606c5c67 records
130
+ the65-key artwork and code. The included ART.md records source-sheet hashes,
131
+ registration and approved extensions; research photos were observation only,
132
+ not generation inputs or bundled runtime assets. Original source sheets,
133
+ research media and the unused tuxedo prototype are excluded. Alternative RVZ5
134
+ encoding preserves every decoded Q5 pixel. See the cat ASSETS-LICENSE.md.
package/ASSETS-LICENSE.md CHANGED
@@ -57,3 +57,9 @@ unrestricted. No warranty or legal-clearance certification is supplied.
57
57
  사용·수정·재배포도 가능하며, 변경한 그림을 배포할 때는 동일조건을 지켜야
58
58
  합니다. 코드에는 별도의 MIT 라이선스가 적용됩니다. 사진 참고 출처와 가공
59
59
  경위는 ATTRIBUTION.md에 포함되며, 원본 사진은 패키지에 포함하지 않습니다.
60
+
61
+ ## Ginger cat (0.0.18)
62
+
63
+ The included Purrviewer ginger-cat artwork and metadata also use CC BY-SA 4.0,
64
+ explicitly selected by the owner on 2026-10-25. See
65
+ [integrations/purrviewer/ASSETS-LICENSE.md](integrations/purrviewer/ASSETS-LICENSE.md).
package/ATTRIBUTION.md CHANGED
@@ -57,3 +57,11 @@ Reference photo collections, YouTube footage, experimental Meshy models,
57
57
  noncommercial motion research/datasets, interpolation tools/model weights and
58
58
  worker logs are not distributed in this package. No exclusive copyright in
59
59
  otherwise unprotected AI output is claimed. Code has its own MIT license.
60
+
61
+ ## Purrviewer ginger cat
62
+
63
+ Ginger-cat artwork and motion assembly: BiteFoundry project maintainer, 2026.
64
+ AI-generated poses, registered and quantized into grayscale Q5 crops.
65
+ CC BY-SA 4.0; attribution and creation record in
66
+ [integrations/purrviewer/ASSETS-LICENSE.md](integrations/purrviewer/ASSETS-LICENSE.md)
67
+ and [ART.md](integrations/purrviewer/ART.md).
@@ -14,7 +14,7 @@ earlier0.0.3 baseline. macOS remains experimental.
14
14
 
15
15
  | Platform | Adapter | Current verification boundary |
16
16
  | --- | --- | --- |
17
- | Windows10/11 | .NET Framework/Win32 layered window | Live verified; shared-adapter regression checks passed on this host |
17
+ | Windows10/11 | QuickJS/Win32 basic; Node/.NET optional watching | Live verified; shared-adapter regression checks passed on this host |
18
18
  | macOS | Built-in osascript/JXA AppKit, no Python/Xcode/browser runtime | Experimental; no macOS runtime available on this Windows host |
19
19
  | Linux X11 | Python3.6+ stdlib ctypes + X11/Xrender/Xext | AlmaLinux8 GLIBC2.28/Python3.6.8/Node22.23.4 live checks passed on owned Xvfb + Openbox + xcompmgr |
20
20
  | Linux native Wayland | No arbitrary-window tracking adapter | Refused, including sessions exposing an Xwayland DISPLAY; no insecure compositor workaround |
package/INSTALLING.md CHANGED
@@ -13,7 +13,8 @@ mask and native painter, without new color sprites or screen capture.
13
13
  Windows and AlmaLinux8/GLIBC2.28 X11 have live test evidence. macOS support is
14
14
  experimental and not runtime verified; native Wayland is unsupported. Linux needs
15
15
  system Python3.6+, X11/Xrender/Xext and a compositor; Windows needs the .NET
16
- Framework4 compiler. See [Windows controls and removal](WINDOWS-COMPANION.md).
16
+ Framework4 compiler only for the optional compatibility engine. Windows x64
17
+ basic mode uses the bundled native engine. See [Windows controls and removal](WINDOWS-COMPANION.md).
17
18
 
18
19
  ## Optional native OpenCode integration
19
20
 
package/LICENSE CHANGED
@@ -1,16 +1,16 @@
1
- Retrieviewer licensing
2
-
3
- Software source code: MIT License, see LICENSE-CODE.
4
- Bundled puppy artwork/frame data: Creative Commons Attribution-ShareAlike 4.0
5
- International (CC-BY-SA-4.0), see ASSETS-LICENSE.md and ATTRIBUTION.md.
6
- https://creativecommons.org/licenses/by-sa/4.0/legalcode.en
7
-
8
- The complete package is not MIT-only. Commercial use is allowed under the
9
- applicable terms. Artwork adaptations retain ShareAlike obligations; the
10
- separately licensed software does not become CC-licensed merely by bundling it.
11
-
12
- Third-party components retain their original notices, including the MIT license
13
- under vendor/procedural-animals. See THIRD-PARTY-NOTICES.md.
14
-
15
- No exclusive copyright in AI-generated output, registered trademark status,
16
- third-party endorsement or comprehensive legal clearance is claimed.
1
+ Retrieviewer licensing
2
+
3
+ Software source code: MIT License, see LICENSE-CODE.
4
+ Bundled puppy and ginger-cat artwork/frame data: Creative Commons Attribution-ShareAlike 4.0
5
+ International (CC-BY-SA-4.0), see ASSETS-LICENSE.md and ATTRIBUTION.md.
6
+ https://creativecommons.org/licenses/by-sa/4.0/legalcode.en
7
+
8
+ The complete package is not MIT-only. Commercial use is allowed under the
9
+ applicable terms. Artwork adaptations retain ShareAlike obligations; the
10
+ separately licensed software does not become CC-licensed merely by bundling it.
11
+
12
+ Third-party components retain their original notices, including the MIT license
13
+ under vendor/procedural-animals. See THIRD-PARTY-NOTICES.md.
14
+
15
+ No exclusive copyright in AI-generated output, registered trademark status,
16
+ third-party endorsement or comprehensive legal clearance is claimed.
@@ -0,0 +1,95 @@
1
+ # Lightweight desktop runtime · 0.0.19
2
+
3
+ Windows x64 basic desktop mode runs the existing JavaScript pet behavior in
4
+ QuickJS-NG, inside the same native process that paints the transparent window.
5
+ Node/npm launches it and exits. There is no persistent Node worker, CLR runtime,
6
+ browser, Electron, extra npm dependency or install-time compiler in this mode.
7
+
8
+ ```sh
9
+ retrieviewer desktop
10
+ retrieviewer desktop --pet cat
11
+ retrieviewer desktop-status --json
12
+ retrieviewer desktop-stop
13
+ ```
14
+
15
+ Choose Retriever or Ginger cat in the picker/control strip, or run the second
16
+ command to switch a running native companion. Only the selected pet is loaded.
17
+ Switching disposes its assets before creating the other one. No startup service,
18
+ agent patch or wrapper is installed. Removal is `retrieviewer desktop-remove --yes`
19
+ followed by `npm uninstall -g @bitefoundry/retrieviewer`.
20
+
21
+ ## Artwork and behavior
22
+
23
+ The same pure dog/cat factories own motion, perspective, contacts, actions and
24
+ autonomy. The native host supplies gzip, Q5 reconstruction, grayscale raster and
25
+ stable Braille kernels. Individually compressed crops are read from indexed
26
+ files, with two borrowed decoded frames per store. The 256 Braille-mask stamp
27
+ atlas replaces thousands of GDI+ ellipse calls and preserves the original dots.
28
+
29
+ The actual native kernels were compared to portable Node across 64 dog and 128
30
+ cat output frames at 160×72 and 480×135 cells, including movement, eating,
31
+ attention, stretching, greeting, company, tower and wheel. All 234,455,040 RGBA
32
+ bytes matched. Tests retain SHA-256 results; no resampling or lossier art was
33
+ introduced. Code is MIT. Dog and cat artwork is CC BY-SA 4.0.
34
+
35
+ ## Measured memory
36
+
37
+ On this Windows10/11 x64 host, one native process rendered an owned off-screen
38
+ 3840×2160 window for150seconds per species, sampled twice per second. The
39
+ ordinary runtime used its diagnostic target, real GDI+ painter and scheduled
40
+ play/treat/attention or tower/wheel actions. No forced GC or working-set trimming.
41
+
42
+ | Pet | Median RSS | Sampled maximum | OS lifetime peak |
43
+ |---|---:|---:|---:|
44
+ | Retriever |22.6MiB|35.3MiB|36.5MiB|
45
+ | Ginger cat with tower/wheel |29.5MiB|34.6MiB|39.1MiB|
46
+
47
+ Version0.0.19 uses up to8 disjoint cell-aligned paint regions inside the same
48
+ process, reclaiming oversized/hidden surfaces. The preceding0.0.18 final run
49
+ had medians29.4/44.2MiB and OS peaks40.3/65.4MiB for dog/cat respectively.
50
+ See [sparse surface measurements](SPARSE-PAINT.md) for the matching workloads,
51
+ pixel comparisons and CPU tradeoff. This is not a universal50MiB memory cap.
52
+ Raw local evidence: dist/sparse-paint-memory/{dog,cat,report}.json.
53
+
54
+ ## Scope
55
+
56
+ This default native runtime is **Windows x64**. `--watch stackbite` and
57
+ `--brain openrouter` retain the Node/.NET compatibility path on Windows;
58
+ `--engine node` explicitly selects it. Their memory use is higher. Linux X11
59
+ keeps Node + system Python; macOS keeps its experimental Node/JXA path. Both
60
+ species work through those adapters, with the existing three controls mapped
61
+ to toy/greeting, treat and company for the cat. Tower/wheel controls are in the
62
+ Windows native bar and website. Browser previews keep their portable loader.
63
+ The native memory figures do not describe optional watching, other operating
64
+ systems or browser tabs. No blanket memory ceiling is promised for every window.
65
+
66
+ ## Build and lifecycle
67
+
68
+ Maintainers run `npm run build:native` on Windows x64 with Visual Studio 2022 C++
69
+ Build Tools, CMake and Bun. It bundles the ordinary factories without source
70
+ rewriting, verifies pinned QuickJS/zlib commits, statically links the CRT, and
71
+ writes a size/SHA-256 manifest for the shipped binary and bundle. Only Windows
72
+ system DLLs are required. Sources, source pins and upstream license texts ship
73
+ with the package. End users receive the prebuilt executable.
74
+
75
+ The short-lived launcher sends configuration over stdin, waits for readiness,
76
+ then acknowledges detach. EOF before detach stops the native process. A local
77
+ owner-only named pipe with a per-launch random token supports status, species
78
+ switching and stop; remote pipe clients are rejected. The process removes only
79
+ its own session file on exit. The picker follows one explicitly selected app;
80
+ it hides and freezes when that app is not foreground. It reads window geometry
81
+ and titles, not screen content or keyboard input. Watch/brain remain opt-in.
82
+
83
+ QA: `node --test native-desktop.test.mjs`, `npm run check:native-pixels`, and
84
+ `node tools/measure-native-pet.mjs 150`. These use isolated state and owned
85
+ off-screen diagnostic windows, preserving an already-running user companion.
86
+
87
+ The executable embeds the Windows UTF-8 process code-page manifest (Windows10
88
+ 1903+ /11) so QuickJS stdio also reads Korean/non-ASCII installation paths.
89
+ A regression test launches both species from Korean bundle, art and state paths.
90
+
91
+ ## Sparse paint surfaces
92
+
93
+ [Sparse paint regions](SPARSE-PAINT.md) preserve final masks while reducing
94
+ empty bitmap space. Their HWNDs remain click-through and non-activating; no
95
+ extra pet process, runtime dependency or animation asset is introduced.
package/PREREQUISITES.md CHANGED
@@ -93,3 +93,10 @@ npx --yes --package @bitefoundry/retrieviewer@latest retrieviewer desktop
93
93
 
94
94
  `npx` still needs Node/npm and a compatible GUI desktop, and may download the
95
95
  package into npm's cache. It does not create a permanent global command.
96
+
97
+ ## Windows native basic mode (0.0.18)
98
+
99
+ Windows10/11 x64 + Node20+ for npm/launch. The shipped QuickJS/Win32 runtime
100
+ needs no compiler, CLR or additional runtime download. Node exits after launch.
101
+ Optional StackBite/LLM watching or --engine node keeps the existing .NET helper
102
+ and Node worker; that compatibility mode needs the Windows Framework4 compiler.
package/PUPPY-MEMORY.md CHANGED
@@ -1,3 +1,25 @@
1
+ # 0.0.19 sparse painter result
2
+
3
+ Windows x64 basic mode retains one native process and splits sparse content
4
+ into bounded cropped surfaces. In the same real4K150s schedule, dog median RSS
5
+ was22.6MiB (OS peak36.5MiB); cat with tower/wheel29.5MiB (peak39.1MiB).
6
+ Final masks and behavior are unchanged. No forced GC/trim; optional watching,
7
+ other OS hosts and browser tabs are outside this memory claim. See
8
+ [sparse paint evidence](SPARSE-PAINT.md) and [runtime scope](NATIVE-RUNTIME.md).
9
+
10
+ ## Previous0.0.18 native result (historical)
11
+
12
+ # 0.0.18 native desktop result
13
+
14
+ Windows x64 basic mode now uses a single QuickJS/Win32 process. In real4K
15
+ 150second tests the dog median RSS was29.4MiB (OS lifetime peak39.9MiB),
16
+ and cat median44.2MiB (peak65.3MiB). Same artwork/motion; no forced GC/trim.
17
+ The cat typically fits50MiB here but peaks exceed it. These figures exclude
18
+ optional StackBite/LLM watching, other OS hosts and browser tabs.
19
+ See [method, architecture and compatibility scope](NATIVE-RUNTIME.md).
20
+
21
+ ## Earlier Node measurements (historical)
22
+
1
23
  # Runtime weight and performance
2
24
 
3
25
  ## Indexed local art (local candidate, 2026-10-25)
package/README.ko.md CHANGED
@@ -80,7 +80,7 @@ PATH에 넣어야 해요. [bash·csh/tcsh·Windows별 안내](PREREQUISITES.md#c
80
80
 
81
81
  | 환경 | 상태와 필요 조건 |
82
82
  | --- | --- |
83
- | Windows10/11 x64 | 실제 실행 검증. Node + .NET Framework4 컴파일러. 처음 실행 시 헬퍼 자동 빌드. |
83
+ | Windows10/11 x64 | 실제 실행 검증. Node20+. 기본 실행은 포함된 네이티브 엔진, 선택형 감시는 .NET 호환 엔진. |
84
84
  | Linux X11 | AlmaLinux8 / GLIBC2.28 / Python3.6.8 / Node22.23.4를 격리된 GUI에서 검증. Python3.6+, X11/Xrender/Xext, compositor 필요. |
85
85
  | macOS | **실험적 지원. 실제 Mac 실행 미검증.** 기본 osascript/AppKit 사용. |
86
86
  | 네이티브 Wayland·화면 없는 SSH | 데스크톱 오버레이 미지원. 세션·보안 설정을 자동 변경하지 않아요. |
@@ -147,3 +147,19 @@ JS 플러그인과 JSONL 브리지를 제공해요. 화면·입력·시간 제
147
147
 
148
148
  AI로 생성한 그림에 자세 정렬·접지·프레임 처리를 적용한 애니메이션입니다.
149
149
  실제 모션 캡처나 자의식이 있는 강아지라고 주장하지 않아요.
150
+
151
+ ## 0.0.19
152
+
153
+ Windows 기본 실행에서 표시 영역을 나누고 불필요하게 커진 버퍼를 회수해요.
154
+ 그림과 동작은 그대로예요. 실제4K150초 측정에서 강아지는 중앙값22.6MiB·최고36.5MiB,
155
+ 가구가 있는 고양이는29.5MiB·39.1MiB였어요. 선택형 감시·다른OS·브라우저는
156
+ 별도 범위예요. [측정과 검증 기록](SPARSE-PAINT.md)을 참고하세요.
157
+
158
+ ## 0.0.18
159
+
160
+ Windows x64 기본 실행은 네이티브 프로세스 하나만 남고 Node는 종료돼요.
161
+ 그림과 움직임은 그대로예요. `retrieviewer desktop --pet cat` 또는 창 선택창에서
162
+ 치즈 고양이를 고를 수 있어요. 둘 중 선택한 펫만 불러옵니다.
163
+ StackBite·LLM 감시는 메모리를 더 쓰는 기존 Node 호환 엔진을 유지해요.
164
+ Linux·macOS·브라우저의 호스트 구조는 그대로이며, 로컬 그림은 두 펫 모두
165
+ 필요한 프레임만 파일에서 읽어요. [지원 범위와 측정](NATIVE-RUNTIME.md).
package/README.md CHANGED
@@ -77,7 +77,7 @@ Do not use `sudo npm install -g` as a blanket workaround.
77
77
 
78
78
  | Desktop | Status / requirements |
79
79
  | --- | --- |
80
- | Windows 10/11 x64 | Live tested. Node + Windows .NET Framework 4 compiler; helper builds on first launch. |
80
+ | Windows 10/11 x64 | Live tested. Node20+; bundled native engine for basic mode. Optional watching uses the .NET compatibility helper. |
81
81
  | Linux X11 | AlmaLinux 8 / GLIBC 2.28 / Python 3.6.8 / Node 22.23.4 tested in an isolated composited X11 desktop. Requires system Python 3.6+, X11/Xrender/Xext and a compositor. |
82
82
  | macOS | **Experimental; no Mac runtime verification yet.** Uses built-in osascript/AppKit. |
83
83
  | Native Wayland / headless SSH | Not supported by the desktop overlay. No session/privacy workaround is installed. |
@@ -188,3 +188,21 @@ the complete package is **not MIT-only**.
188
188
  The puppy artwork was developed with AI-generated imagery and programmatic pose,
189
189
  grounding and frame processing. It is authored animation, not motion capture or
190
190
  a claim of sentience.
191
+
192
+ ## 0.0.19
193
+
194
+ Windows basic mode now splits distant content into small paint regions and
195
+ reclaims oversized/hidden surfaces. Same pets, artwork and behavior. In real4K
196
+ 150s tests: dog median22.6MiB / OS peak36.5MiB; cat with tower/wheel29.5 /39.1MiB.
197
+ Optional watching and other OS/browser hosts keep their separate memory scope.
198
+ See [measurements and verification](SPARSE-PAINT.md).
199
+
200
+ ## 0.0.18
201
+
202
+ Windows x64 basic mode now runs one native process; Node exits after launch.
203
+ The existing artwork and behavior stay the same. Use `retrieviewer desktop --pet cat`
204
+ for the ginger cat, or select it in the window picker. Only one pet is loaded.
205
+ Optional StackBite/LLM watching retains the higher-memory Node compatibility
206
+ engine. Linux/macOS and browser previews retain their existing host architecture.
207
+ Both species use indexed crops for local loading.
208
+ See [runtime scope and measurements](NATIVE-RUNTIME.md).
package/RELEASING.md CHANGED
@@ -1,3 +1,38 @@
1
+ # Retrieviewer 0.0.19 release process
2
+
3
+ Current target: `@bitefoundry/retrieviewer@0.0.19`, public `latest`.
4
+ The owner explicitly authorized npm and website deployment on2026-10-25.
5
+ Ship the verified sparse Windows painter: bounded disjoint final-mask regions,
6
+ reclaimable buffers, preserved artwork/behavior and existing compatibility modes.
7
+ Keep code MIT and both artworks CC BY-SA4.0; no new generation inputs or assets.
8
+
9
+ Existing evidence covers300 exact native paint frames,56 partition cases,
10
+ real4K150s operating memory and owned-window shrink/hide/restore/switch/teardown.
11
+ Run the suite/release gate, build and install a fresh exact tarball, exercise its
12
+ actual native resources/picker, then publish that same artifact after CI.
13
+ Verify registry integrity, fresh registry installation and production website.
14
+ Keep website figures scoped to Windows basic mode; update EN/KO copy and cache
15
+ keys together. Preserve old releases, the user's running pet and privacy setup.
16
+
17
+ ## Previous0.0.18 scope (historical)
18
+
19
+ Current target: `@bitefoundry/retrieviewer@0.0.18`, public `latest`.
20
+ The owner authorized immediate npm and website deployment of the lightweight
21
+ shared engine on2026-10-25, and explicitly selected CC BY-SA4.0 for cat artwork.
22
+ Code remains MIT. Ship the real native Windows x64 basic runtime, ginger cat and
23
+ portable compatibility paths. Preserve approved artwork, physics, autonomy,
24
+ optional watcher/brain behavior and the user's already-running pet.
25
+
26
+ Validate exact native-vs-portable rendered pixels, authenticated control,
27
+ species switching, startup EOF cleanup, real picker lifecycle and real4K memory.
28
+ Build/install a fresh exact tarball, compare every shipped byte, run the full
29
+ suite and owned Windows checks, then publish that artifact. Verify registry
30
+ integrity, a fresh public-registry consumer and the deployed bilingual website.
31
+ Native low-memory figures apply only to Windows x64 basic mode; watch/brain,
32
+ other operating systems and browser previews keep their documented scope.
33
+
34
+ ## Previous 0.0.17 scope (historical)
35
+
1
36
  # Retrieviewer 0.0.17 release process
2
37
 
3
38
  Current target: `@bitefoundry/retrieviewer@0.0.17`, public `latest`.
@@ -0,0 +1,66 @@
1
+ # Sparse Windows paint surfaces · 0.0.19
2
+
3
+ Version0.0.19 builds on0.0.18. JavaScript behavior, Q5 art, world/contact math, colors and
4
+ Braille masks are unchanged; the native painter allocates less empty space.
5
+
6
+ ## Change
7
+
8
+ The old painter kept one bitmap spanning every nonempty cell. The cat, tower
9
+ and wheel therefore retained a large transparent rectangle between objects.
10
+ Its width and height only grew until species switch/exit. A held-pose ablation
11
+ at3840×2160 measured cat+furniture38.6MiB versus cat alone17.6MiB; the equivalent
12
+ single DIB capacities were12.22MiB and1.63MiB respectively.
13
+
14
+ The new painter partitions the FINAL cell mask into up to8 disjoint cropped
15
+ regions. Greedy splits account for64px allocation rounding and must save at
16
+ least256KiB of bitmap space. No glyph is resampled, dropped, drawn twice or
17
+ recolored; geometry and palette still share the original stamp atlas. A dense
18
+ scene can remain a single region. This is a bounded native composition change,
19
+ not extra animal simulations or one process per region.
20
+
21
+ Each surface reuses capacity while it is within2× its current rounded target
22
+ area. Oversized capacity is reclaimed on repaint; unused regions are destroyed.
23
+ Hidden/minimized/retargeted scenes release their surfaces and overlay windows.
24
+ Resume repaints from the current simulation state. Windows system/compositor
25
+ allocations remain separate from the reported `paintSurfaceBytes` DIB counter.
26
+
27
+ ## Measurement
28
+
29
+ Same Windows11 x64 host, real native painter and an owned off-screen physical
30
+ 3840×2160 scene. Seed731; the existing150s diagnostic action schedule and300
31
+ roughly0.5s samples per pet. No forced GC/working-set trimming. Watch/brain off;
32
+ harness and external DWM/GPU memory excluded. Baseline is the tested0.0.18
33
+ installed-artifact run. These finite runs do not establish a universal RAM cap.
34
+
35
+ | Scene |0.0.18 median RSS|0.0.19 median RSS|0.0.18 OS peak|0.0.19 OS peak|
36
+ |---|---:|---:|---:|---:|
37
+ |Dog|29.35MiB|22.63MiB|40.34MiB|36.45MiB|
38
+ |Cat with tower/wheel|44.22MiB|29.46MiB|65.45MiB|39.13MiB|
39
+
40
+ The short fixed-pose cat+furniture comparison fell from38.6 to27.3MiB. This is
41
+ a different workload from the moving150s runs above, not a replacement for them.
42
+ Actual resize testing reduced allocated DIBs from6.52 to1.66MiB. Minimizing
43
+ reported0 DIB bytes and0 overlay HWNDs; restore and dog/cat switching recovered.
44
+
45
+ A paired16s cat timing check had92 paints/340 rendered calls in both variants.
46
+ Mean render time changed3.06→3.94ms, P95 12.42→16.68ms. Partitioning trades some
47
+ CPU for memory; these timings are not a constant-FPS guarantee.
48
+
49
+ ## Verification
50
+
51
+ - Native self-test:56 grids across7 cell sizes. Occupied masks covered once,
52
+ all regions disjoint/in bounds, partition plans no larger than one crop,
53
+ at most8 regions, and real DIB shrink/release verified.
54
+ - Real painter:300 moving frames across dog/cream and cat/gold/dark compared
55
+ against the old monolithic GDI+ ellipse output, byte-for-byte including alpha.
56
+ This tests per-frame paint pixels, not atomicity of compositor presentation.
57
+ - Real owned windows: pick/reselect,4K→small→4K, minimize/restore, species
58
+ switching, bootstrap detach, startup EOF, stop and Korean paths passed.
59
+ - Local full suite:243 passed,2 macOS-only tests skipped on this Windows host.
60
+
61
+ Reproduce with `node --test native-desktop.test.mjs`,
62
+ `node tools/check-native-paint.mjs`, `node tools/check-native-resources.mjs`,
63
+ and `node tools/measure-native-pet.mjs 150` after `npm run build:native`.
64
+ Local evidence is under dist/sparse-paint-memory, dist/paint-parity-HlzSTl,
65
+ dist/paint-resource-m3dMB1 and dist/sparse-timing-REFNLe. QA output is not
66
+ packaged. Linux/macOS/browser and optional Node/CLR watching paths are unchanged.
@@ -17,3 +17,11 @@ photographers (Scott, CC BY 2.0; Stefan Bauer, CC BY-SA 2.5) and adaptation hist
17
17
  are credited in ATTRIBUTION.md. Original photographs are not bundled. See LICENSE,
18
18
  LICENSE-CODE, ASSETS-LICENSE.md and the bounded ASSET-PROVENANCE.md review. No
19
19
  comprehensive legal-clearance or exclusive AI-output ownership claim is made.
20
+
21
+ ## Native Windows runtime
22
+
23
+ The prebuilt Windows x64 engine includes QuickJS-NG 0.17.0 (MIT) and zlib
24
+ 1.3.2 (Zlib). Exact source commits and complete license notices are in
25
+ `integrations/native-windows/sources.json` and `THIRD-PARTY-LICENSES.txt`.
26
+ The optimized kernels and host are MIT. No downloaded runtime is installed
27
+ at launch; no additional npm runtime dependency was added.
@@ -9,9 +9,10 @@ wrapper. Version0.0.2 includes it; version0.0.1 does not. Setup is two steps:
9
9
  Choose a supported ordinary Windows app window (including a terminal containing
10
10
  Codex). Then use your app normally, without a
11
11
  wrapper, shell alias, patched binary, changed credentials, or agent configuration.
12
- The helper uses native Windows/.NET Framework facilities and the existing Node
13
- pet engine. No Electron, Chromium, downloaded helper binary or new npm dependency.
14
- Windows10/11 x64 with Node20+ and the .NET Framework4 compiler is required. Other
12
+ Basic mode uses the bundled QuickJS/Win32 engine in one process; Node exits
13
+ after launch. No Electron, Chromium, extra npm dependency or compiler is needed.
14
+ Windows10/11 x64 with Node20+ is required. Optional watch/brain or --engine node
15
+ keeps the existing Node/.NET compatibility path and its Framework4 compiler. Other
15
16
  desktop platforms and exclusive fullscreen/security surfaces are not certified.
16
17
  Launch reports
17
18
  that the picker is ready, **not** that the user has selected a window or visually
@@ -35,8 +36,8 @@ approved the pet.
35
36
  The picker locally reads window titles/process names; tracking reads window
36
37
  geometry, foreground state, visibility and owning process ID.
37
38
  - No automatic startup, background scheduled task, registry entry or MCP is added.
38
- Exit stops both the painter and engine. If either process closes, its counterpart
39
- exits too. Losing the target hides the pet; tray selection can attach another.
39
+ Exit stops the native process. The compatibility path stops both painter and engine;
40
+ if either closes, its counterpart exits too. Losing the target hides the pet; tray selection can attach another.
40
41
 
41
42
  ## Stop, remove, and recover
42
43
 
@@ -52,7 +53,8 @@ One-command companion removal (stop, wait for exit, remove only its cache):
52
53
  retrieviewer desktop-remove --yes
53
54
  ```
54
55
 
55
- The tray icon also provides window selection, hide/resume and exit. `desktop-stop`
56
+ The control strip provides window selection, pause/resume and exit. The older
57
+ compatibility helper also has a tray menu. `desktop-stop`
56
58
  asks the companion to exit through an authenticated local named pipe; it never
57
59
  kills a PID from a stale file. The worker may terminate only its own stuck child
58
60
  painter after a graceful timeout. Cache cleanup refuses a live/unreachable worker,
@@ -111,3 +113,10 @@ check (not total app memory or a4K performance claim). A Windows GUI startup bug
111
113
  was fixed by building a GUI-subsystem helper and not applying SW_HIDE to it; the
112
114
  real user picker was verified in Windows' visible main-window list. User visual
113
115
  approval after selecting a terminal remains separate.
116
+
117
+ ## Pet selection
118
+
119
+ Use retrieviewer desktop --pet cat, or select Ginger cat in the native picker
120
+ or control strip. Only one pet is loaded; the previous asset lease is disposed
121
+ on switch. Cat controls include greeting, treat, company, tower and wheel.
122
+ See [native runtime](NATIVE-RUNTIME.md) for measurements and scope.
package/braille.mjs CHANGED
@@ -37,10 +37,10 @@ function stableBraille(rgba,width,height,brightness,contrast){
37
37
  for(let y=0;y<rows;y++){for(let x=0;x<columns;x++)cells[x]=GLYPHS[masks[y*columns+x]];lines[y]=cells.join('');}
38
38
  return{text:lines.join('\n'),columns,rows,dots};
39
39
  }
40
- export function rgbaToBraille(rgba,width,height,{brightness=1,contrast=1,method='floyd'}={}){
40
+ export function rgbaToBraille(rgba,width,height,{brightness=1,contrast=1,method='floyd',kernel=null}={}){
41
41
  if(!Number.isInteger(width)||!Number.isInteger(height)||width<1||height<1||width*height>1_000_000||rgba.length!==width*height*4)throw Error('Invalid RGBA image');
42
42
  if(!Number.isFinite(brightness)||brightness<=0||brightness>4||!Number.isFinite(contrast)||contrast<=0||contrast>4||!['floyd','bayer','stable'].includes(method))throw Error('Invalid dithering options');
43
- if(method==='stable')return stableBraille(rgba,width,height,brightness,contrast);
43
+ if(method==='stable')return kernel?.braille?kernel.braille(rgba,width,height,brightness,contrast):stableBraille(rgba,width,height,brightness,contrast);
44
44
  const values=new Float32Array(width*height),bits=new Uint8Array(width*height);
45
45
  for(let i=0;i<values.length;i++){
46
46
  const p=i*4,luma=(.2126*rgba[p]+.7152*rgba[p+1]+.0722*rgba[p+2])/255*(rgba[p+3]/255);
@@ -0,0 +1,15 @@
1
+ cmake_minimum_required(VERSION 3.21)
2
+ project(retrieviewer_native LANGUAGES C CXX)
3
+ set(CMAKE_CXX_STANDARD 17)
4
+ set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
5
+ set(QJS_ENABLE_INSTALL OFF CACHE BOOL "" FORCE)
6
+ get_filename_component(PET_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../.." ABSOLUTE)
7
+ add_subdirectory("${PET_ROOT}/dist/native-memory/quickjs-src" quickjs-build EXCLUDE_FROM_ALL)
8
+ set(ZLIB_BUILD_TESTING OFF CACHE BOOL "" FORCE)
9
+ set(ZLIB_BUILD_SHARED OFF CACHE BOOL "" FORCE)
10
+ set(ZLIB_INSTALL OFF CACHE BOOL "" FORCE)
11
+ add_subdirectory("${PET_ROOT}/dist/native-memory/zlib-src" zlib-build EXCLUDE_FROM_ALL)
12
+ add_executable(retrieviewer-native host.cpp)
13
+ target_link_options(retrieviewer-native PRIVATE "/MANIFEST:EMBED" "/MANIFESTINPUT:${CMAKE_CURRENT_SOURCE_DIR}/application.manifest")
14
+ target_link_libraries(retrieviewer-native PRIVATE qjs qjs-libc zlibstatic gdiplus user32 gdi32 advapi32 psapi)
15
+ target_compile_definitions(retrieviewer-native PRIVATE _CRT_SECURE_NO_WARNINGS NOMINMAX UNICODE _UNICODE)
@@ -0,0 +1,77 @@
1
+ QuickJS-NG
2
+
3
+ The MIT License (MIT)
4
+
5
+ Copyright (c) 2017-2026 Fabrice Bellard
6
+ Copyright (c) 2017-2024 Charlie Gordon
7
+ Copyright (c) 2023-2026 Ben Noordhuis
8
+ Copyright (c) 2023-2026 Saúl Ibarra Corretgé
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in
18
+ all copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26
+ THE SOFTWARE.
27
+
28
+
29
+ zlib
30
+
31
+ Copyright notice:
32
+
33
+ (C) 1995-2026 Jean-loup Gailly and Mark Adler
34
+
35
+ This software is provided 'as-is', without any express or implied
36
+ warranty. In no event will the authors be held liable for any damages
37
+ arising from the use of this software.
38
+
39
+ Permission is granted to anyone to use this software for any purpose,
40
+ including commercial applications, and to alter it and redistribute it
41
+ freely, subject to the following restrictions:
42
+
43
+ 1. The origin of this software must not be misrepresented; you must not
44
+ claim that you wrote the original software. If you use this software
45
+ in a product, an acknowledgment in the product documentation would be
46
+ appreciated but is not required.
47
+ 2. Altered source versions must be plainly marked as such, and must not be
48
+ misrepresented as being the original software.
49
+ 3. This notice may not be removed or altered from any source distribution.
50
+
51
+ Jean-loup Gailly Mark Adler
52
+ jloup@gzip.org madler@alumni.caltech.edu
53
+
54
+
55
+ fflate
56
+
57
+ MIT License
58
+
59
+ Copyright (c) 2026 Arjun Barrett
60
+
61
+ Permission is hereby granted, free of charge, to any person obtaining a copy
62
+ of this software and associated documentation files (the "Software"), to deal
63
+ in the Software without restriction, including without limitation the rights
64
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
65
+ copies of the Software, and to permit persons to whom the Software is
66
+ furnished to do so, subject to the following conditions:
67
+
68
+ The above copyright notice and this permission notice shall be included in all
69
+ copies or substantial portions of the Software.
70
+
71
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
72
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
73
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
74
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
75
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
76
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
77
+ SOFTWARE.
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
+ <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
3
+ <application xmlns="urn:schemas-microsoft-com:asm.v3">
4
+ <windowsSettings>
5
+ <activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage>
6
+ </windowsSettings>
7
+ </application>
8
+ </assembly>
@@ -0,0 +1,48 @@
1
+ // Short-lived bootstrap only. The native process owns the pet, UI and control pipe.
2
+ import {spawn} from 'node:child_process';
3
+ import {readFile,open,unlink,stat} from 'node:fs/promises';
4
+ import {createHash,randomBytes,randomUUID} from 'node:crypto';
5
+ import {fileURLToPath} from 'node:url';
6
+ import {prepareRoot,noLink,requestSession,readSession} from '../windows-overlay/desktop.mjs';
7
+ import {controlAddress} from '../desktop/platform.mjs';
8
+ const root=new URL('./',import.meta.url),bundle=new URL('./runtime.bundle.mjs',root),binary=new URL('./bin/win32-x64/retrieviewer-native.exe',root);
9
+ export async function verifyNativeArtifact(){
10
+ const manifest=JSON.parse(await readFile(new URL('manifest.json',root),'utf8'));
11
+ if(manifest.version!==1||manifest.platform!=='win32-x64')throw Error('Invalid native runtime manifest');
12
+ for(const name of ['runtime.bundle.mjs','bin/win32-x64/retrieviewer-native.exe']){
13
+ const expected=manifest.files[name],url=new URL(name,root),info=await stat(url);
14
+ if(!expected||info.size!==expected.bytes||info.size>16*1024*1024)throw Error('Native runtime size mismatch: '+name);
15
+ const bytes=await readFile(url);if(createHash('sha256').update(bytes).digest('hex')!==expected.sha256)throw Error('Native runtime checksum mismatch: '+name);
16
+ }
17
+ return manifest;
18
+ }
19
+ export async function switchNativePet(options,session,pet){
20
+ await requestSession(session,'pet-'+pet);
21
+ for(let i=0;i<40;i++){const status=await requestSession(session,'status');if(status.pet===pet)return {...status,alreadyRunning:true,switchedPet:true};await new Promise(r=>setTimeout(r,50));}
22
+ throw Error('The native companion did not finish switching pets');
23
+ }
24
+ export async function startNativeDesktop(options={}){
25
+ if(process.platform!=='win32'||process.arch!=='x64')throw Error('Native desktop currently requires Windows x64');
26
+ await verifyNativeArtifact();const paths=await prepareRoot(options);await noLink(paths.session);
27
+ const pipe=controlAddress({uuid:randomUUID()}),token=randomBytes(32).toString('hex');
28
+ const args=[fileURLToPath(bundle),fileURLToPath(new URL('../../',root)),'--production'];
29
+ if(options.nativeDiagnostic&&options.nativeVerifyPaint)args.push('--verify-regions');
30
+ if(options.nativeDiagnostic&&options.nativeProofPath)args.push('--proof='+options.nativeProofPath);
31
+ const child=spawn(fileURLToPath(binary),args,{detached:true,windowsHide:true,stdio:['pipe','pipe','pipe'],env:{...process.env,OPENROUTER_API_KEY:undefined}});
32
+ let owns=false,complete=false,stderr='';const session={owner:'bitefoundry-retrieviewer-overlay-v1',pid:child.pid,pipe,token};
33
+ child.stderr.on('data',b=>stderr=(stderr+b.toString('utf8')).slice(-2048));child.stdin.on('error',()=>{});
34
+ try{
35
+ if(!Number.isInteger(child.pid))throw Error('Cannot start native companion');
36
+ const file=await open(paths.session,'wx',0o600);owns=true;try{await file.writeFile(JSON.stringify(session)+'\n');}finally{await file.close();}
37
+ await new Promise((resolve,reject)=>{
38
+ let buffer='',ready=false,settled=false;const finish=(error)=>{if(settled)return;settled=true;clearTimeout(timer);error?reject(error):resolve();};
39
+ const timer=setTimeout(()=>finish(Error('Native companion startup timed out')),15000);
40
+ child.once('error',error=>finish(error));child.once('exit',code=>finish(Error('Native companion exited before ready ('+code+'): '+stderr)));
41
+ child.stdout.on('data',bytes=>{buffer+=bytes.toString('utf8');if(buffer.length>65536)return finish(Error('Oversized native startup response'));let at;while((at=buffer.indexOf('\n'))>=0){const line=buffer.slice(0,at);buffer=buffer.slice(at+1);let message;try{message=JSON.parse(line);}catch{return finish(Error('Invalid native startup response'));}if(message.ready===true&&!ready){ready=true;child.stdin.end('DETACH\n');}else if(message.detached===true&&ready)finish();}});
42
+ const pet=options.pet??'dog';child.stdin.write(JSON.stringify({pet,seed:options.nativeDiagnostic?731:randomBytes(4).readUInt32LE(),ink:options.ink??(pet==='cat'?'gold':'cream'),inkExplicit:!!options.ink,returnStyle:options.returnStyle??'auto',diagnostic:options.nativeDiagnostic===true,testPicker:options.nativePickerTest===true,pipe,token,sessionFile:paths.session})+'\n');
43
+ });
44
+ const status=await requestSession(session,'status');complete=true;child.unref();child.stdout.destroy();child.stderr.destroy();return {...status,detached:true};
45
+ }finally{
46
+ if(!complete){child.stdin.destroy();if(child.exitCode===null)child.kill();if(owns){const current=await readSession(options).catch(()=>null);if(current?.token===token)await unlink(paths.session).catch(()=>{});}}
47
+ }
48
+ }