Skip to content

Repack Wallpaper Engine items into .kpk, and play .kpk files - #14

Merged
beingsuz merged 2 commits into
mainfrom
claude/project-thread-41d0cm
Oct 9, 2026
Merged

beingsuz merged 2 commits into
mainfrom
claude/project-thread-41d0cm

Conversation

@beingsuz

@beingsuz beingsuz commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Requested by beingsuz · project thread

What this changes

Before: kirie could build and inspect a .kpk but not play one, and there was no way to turn a Wallpaper Engine item into one.

After: kirie convert <item folder> repacks a Wallpaper Engine item into we-<workshop id>.kpk, and kirie plays any .kpk passed as --bg or over the socket's bg, converted items included. Wallpaper Engine support is unchanged: a converted item runs through the same code as its folder.

How:

  • New kind. wallpaper_engine holds the item's files as they are. Its entry must be project.json and its provenance must be converted, so it can never be published.
  • Convert. kirie convert fills the manifest from project.json (title, description, preview, tags, mature rating, Workshop id). It refuses assets and application wallpapers.
  • Play. A package is unpacked once into kirie/packages/<fingerprint> in the user's cache. Every entry is checked against its hash on the way. The unpacked folder then goes to the existing folder or file loaders. The same package starts from that copy next time, and only the four most recently unpacked packages are kept. The reserved scene kind is refused.
  • Writer memory. The writer now reads files only when the package is written, one at a time. Files that are already compressed or larger than 64 MiB are copied through in 1 MiB blocks, so packing large videos no longer holds them all in memory.
  • Docs. docs/PACKAGE.md and docs/COMMANDS.md describe kirie convert and playing a .kpk.

How it was tested

  • cargo fmt --all --check and cargo clippy --workspace --all-targets -D warnings are clean.
  • cargo test -p kirie-pack passes (9 unit and 12 integration tests). New tests cover entries added by path, unpacking, and a damaged entry failing to unpack.
  • kirie's pack, package and resolve tests pass. New tests cover converting an item, refusing an asset, unpacking once and finding the copy again, and keeping only the latest four.
  • By hand: converted a small web item, kirie pack --inspect showed it with all hashes matching, and kirie check we-1234567.kpk unpacked it into the cache.

Not tested: actually drawing a converted scene, video or web item. There is no GPU, display or Wallpaper Engine install here. Windows and macOS were not run, and the Windows-only cache path is only type-checked by CI's existing jobs, which do not build this crate.

Checklist

  • cargo fmt --all and workspace clippy -D warnings are clean
  • cargo test --workspace passes (only the package-related tests were run)
  • Touched a render path? No; the loaders are unchanged, packages are unpacked to a folder first

🤖 Generated with Claude Code

https://claude.ai/code/session_01Kg1KotRgE7Ws6DQwhsgTpj


Generated by Claude Code

`kirie convert <item>` repacks a Wallpaper Engine item, every file as it
is, into a package of the new `wallpaper_engine` kind: its entry is the
item's project.json and its provenance is `converted` with the Workshop
id, so it can never be published. Assets and application wallpapers are
refused.

kirie now plays a `.kpk` wherever it takes a wallpaper. A package is
unpacked once, every entry checked against its hash, into
`kirie/packages/<fingerprint>` in the user's cache and played from
there, so Wallpaper Engine items run through exactly the code that runs
their folders today. The four most recently unpacked packages are kept.
The reserved `scene` kind is refused.

The writer now reads files when the package is written, one at a time,
and copies large or already-compressed ones through in blocks, so packing
a folder of videos no longer holds them all in memory.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kg1KotRgE7Ws6DQwhsgTpj
@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ba4f86cf-4d6b-4460-8c12-021f3d5a2000

📥 Commits

Reviewing files that changed from the base of the PR and between 0706402 and c1990f6.


📒 Files selected for processing (12)
  • crates/kirie-pack/src/lib.rs
  • crates/kirie-pack/src/manifest.rs
  • crates/kirie-pack/src/read.rs
  • crates/kirie-pack/src/write.rs
  • crates/kirie-pack/tests/roundtrip.rs
  • crates/kirie/src/compat/mod.rs
  • crates/kirie/src/compat/package.rs
  • crates/kirie/src/compat/resolve.rs
  • crates/kirie/src/lib.rs
  • crates/kirie/src/pack.rs
  • docs/COMMANDS.md
  • docs/PACKAGE.md

 _________________________________
< Pvt. Rabbit reporting for duty! >
 ---------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kg1KotRgE7Ws6DQwhsgTpj
@beingsuz
beingsuz marked this pull request as ready for review October 9, 2026 11:45
@beingsuz
beingsuz merged commit e6fa67a into main Oct 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants