Add ty-llmtrim extension + plugin-architecture discussion#626
Open
bborn wants to merge 1 commit into
Open
Conversation
Today task event hooks are one script per event in a shared dir, so two integrations that both want e.g. task.done collide on the same file. This adds plugins: a plugin is a self-contained directory under ~/.config/task/plugins/ with a plugin.yaml manifest declaring which events it handles. Drop it in and it's active — any number of plugins can handle the same event and all run. - internal/hooks/plugins.go: manifest schema + forgiving discovery/validation (a bad community plugin is skipped, not fatal). - internal/hooks: Runner fans out each event to the legacy single-script hook plus every matching plugin, in the background. Plugin hooks get TASK_PLUGIN_NAME/TASK_PLUGIN_DIR and run with cwd set to the plugin dir. - Move the 30s hook timeout into the background goroutine so the hook isn't cancelled the instant Run() returns. - cmd/task: `ty plugins list` / `ty plugins dir` to inspect what's installed. - examples/plugins/desktop-notify: a complete, copy-pasteable plugin. - docs/plugins.md + README: manifest format and authoring guide. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
8389ed4 to
046ce06
Compare
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.
What
Adds
extensions/ty-llmtrim— the TaskYou analog of thellmtrim-herdrplugin — and a design doc that answers the second half of the ask: discuss herdr's plugin architecture and make sure TaskYou supports the same kind of extensibility.ty-llmtrim (the extension)
llmtrim is a local proxy that compresses LLM requests (upstream measures −31% input / −74% output tokens, no quality change). This extension wires it into TaskYou executors and surfaces savings. It's a self-contained Go sidecar, consistent with the existing
extensions/pattern (ty-qmd,ty-email,ty-web,ty-chrome):ty-llmtrim upbootstrap.sh/workspace.createdty-llmtrim checkcheck-routing.sh/pane.agent_detectedty-llmtrim watch/badge-31%/--/off) —savings-annotate.shty-llmtrim downstop-annotate.sh/workspace.closedty-llmtrim envHTTPS_PROXY/CA lines that route executors through the proxyty-llmtrim status/doctorllmtrim is a transparent HTTPS proxy (routes via
HTTPS_PROXY+ a local CA), so agents launched by the daemon inherit routing from the shell profilellmtrim setupwrites;ty-llmtrim envexposes the same values for explicit per-task injection.docs/extensions.md (the discussion)
ty-extension.toml.Decision for review
This PR deliberately does not touch the executor launch path. The recommendation in the doc is to land the loader (esp. executor-env injection) as a separate, reviewed change — it's near the
claudeEnvPrefix/BuildCommanddivergence that caused past "lost executor pane" regressions, so it deserves its own PR. Want me to follow up with that host-side change, or keep extensions on the existing inherited-env seam?Test plan
cd extensions/ty-llmtrim && go test ./...— passing (status parsing, badge semantics, env rendering, graceful "off" when daemon down).go vet ./...clean,gofmtclean.status/badge/checkwith no llmtrim installed → degrades tooff/ non-zero exit as designed.go.mod); root CI (go test ./..., golangci-lint, govulncheck) is unaffected — same as the other extensions.🤖 Generated with Claude Code