feat: add .recur app bundles (install, pack, startup auto-register)#17
Merged
Conversation
Introduce app bundles: a .recur zip archive containing a recurfile (the single YAML at its root) plus any local scripts an app needs. - appbundle package: traversal-safe zip pack/unpack; relaxed root-YAML recurfile selection (conventional recurfile.* breaks ties). - `recur app install <bundle|URL>`: resolve source (URL downloads gated by allowed_hosts), unpack to ~/.config/recur/app/<name>/ via a staging dir, derive name (yaml stem -> bundle stem, --name overrides), prompt on collision, then register with the daemon. Daemon-down installs just unpack. - `recur app list` / `remove` / `pack` for the rest of the lifecycle. - Daemon startup scan registers apps installed while it was stopped (idempotent via registry.hasRecurfilePath), so no manual register is needed. - Shared configyaml.AppDir() as the single source of truth for the path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Binary Size Report
|
- requirements/app-bundles.md: spec with bundle format, install/list/remove/pack behavior, daemon startup scan, and acceptance criteria. - requirements/cli-commands.md: add `recur app` commands to the hierarchy and per-command detail blocks. - requirements/daemon-lifecycle.md: note the startup app-folder scan. - docs: user guide (configuration/app-bundles.md) and CLI reference section for installing, managing, and creating .recur bundles. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds app bundles: a
.recurzip archive containing a recurfile (the single YAML file at its root) plus any local scripts an app needs, so an app travels as one file. Installing unpacks the bundle into~/.config/recur/app/<name>/and registers its recurfile; apps installed while the daemon is stopped are auto-registered on next start.This is Part 1 of a two-part effort. The optional bundle dependency check (Part 2) is intentionally deferred pending a decision on approach, and nothing here depends on it.
recur appsubcommands)Changes
appbundlepackage (src/infra/fs/appbundle/): traversal-safe zip pack/unpack preserving layout and file modes; relaxed root-YAML recurfile selection (any single root YAML is the recurfile; a conventionalrecurfile.*breaks ties when several are present).recur app install <bundle.recur | URL>: resolves the source (URL downloads reuse the plugin path'sallowed_hostsgate), unpacks via a staging dir so a bad bundle never clobbers an installed app, derives the name (recurfile stem → bundle stem,--nameoverrides), prompts overwrite/abandon on collision (--forceto skip), then registers with the daemon. Daemon-down installs just unpack and defer registration.recur app list/remove/pack: the rest of the lifecycle, incl. an authoring command to build bundles.scanAppFolder, hooked intoRun()after state replay): registers apps under~/.config/recur/app/not already registered, idempotent via newregistry.hasRecurfilePath.configyaml.AppDir(): single source of truth for the app directory path, shared by CLI and daemon.requirements/app-bundles.md(spec + acceptance criteria),recur appcommands added torequirements/cli-commands.md, startup scan noted inrequirements/daemon-lifecycle.md, a user guide atdocs/content/docs/configuration/app-bundles.md, and a CLI reference section.Test plan
task test) — new tests for bundle round-trip/mode-preservation/traversal/selection, CLI install/name-resolution/overwrite-abort/force/list/remove/pack, and daemon scan register/idempotent/skip-non-app.task test:plugins) — n/a, no plugin changes.task test:e2e) — formal suite not run; manual e2e performed: installed a bundle with the daemon down → started the daemon → app auto-registered (app listshows "registered", daemon lists 1 group/1 trigger/1 action);list/remove/packverified.task lint:goreports 0 issues.Checklist
requirements/updated —requirements/app-bundles.mdplus cli-commands/daemon-lifecycle updatesdocs/content/docs/configuration/app-bundles.mdand the CLI referenceBreaking changes
None.