Skip to content

refactor: zero-footprint architecture — no workspace files#1

Open
j0ntz wants to merge 9 commits intomainfrom
feat/zero-footprint-refactor
Open

refactor: zero-footprint architecture — no workspace files#1
j0ntz wants to merge 9 commits intomainfrom
feat/zero-footprint-refactor

Conversation

@j0ntz
Copy link
Copy Markdown
Owner

@j0ntz j0ntz commented Feb 18, 2026

Summary

  • Zero-footprint: All extension artifacts (Cursor rule, companion send script, env vars) now live in the user home directory — nothing is created in the workspace/repo
  • Env var routing: Replaced routing.json with per-window terminal environment variables (AUTOPILOT_TG_TOKEN, AUTOPILOT_TG_CHAT_ID), enabling per-workspace Telegram bots without file collisions
  • Stdin piping: Outbound messages are piped directly to telegram-send.py via stdin instead of writing intermediate files to an outbox directory
  • Enabled flag: autopilot.enabled now properly gates all behavior — rule/script are only deployed when enabled
  • Owner migration: Updated all GitHub URLs from heyzgj to j0ntz and fixed stale cursor-auto-send repo references

Commits

  • 60c12b8 refactor: zero-footprint config — move all artifacts out of workspace
  • 878809a feat: companion script for chunked Telegram sends + XML-structured rule
  • c9c32c8 docs: update README and setup guide for zero-footprint architecture
  • b8af812 refactor: replace routing.json with env vars for per-workspace Telegram credentials
  • e16f9b7 chore: untrack build artifacts and workspace settings
  • 14d5476 perf: stdin piping replaces file-based outbox for outbound messages
  • f995fe2 fix: auto-focus window before injecting inbound Telegram messages
  • d8c9448 fix: enabled flag now gates behavior, clean up stale artifacts
  • 7fbca41 chore: update GitHub URLs from heyzgj to j0ntz

Test plan

  • Install extension from source, verify ~/.cursor/rules/after_each_chat.mdc and ~/.cursor-autopilot/telegram-send.py are created on activation
  • Verify no files are created in the workspace directory
  • Test outbound: AI response appears in Telegram as chunked messages
  • Test inbound: Telegram replies inject into Cursor chat
  • Test per-workspace: two Cursor windows with different bot tokens route correctly
  • Disable autopilot.enabled and verify rule/script are cleaned up

- Config now read from VS Code settings (contributes.configuration)
  instead of .autopilot.json in repo root
- Cursor rule moves to ~/.cursor/rules/after_each_chat.mdc (user-level)
- New ~/.cursor-autopilot/routing.json maps workspace folder names
  to adapter credentials for agent-direct Telegram curl
- Outbound summaries sent by AI agent via curl (no more tmp/ files)
- Watcher and dispatcher deleted (no file-based outbound pipeline)
- Adapter interface simplified to inbound-only (onReply + dispose)
- Supports multi-root workspaces and per-workspace Telegram bots
- Reacts to onDidChangeConfiguration and onDidChangeWorkspaceFolders
- Cursor rule rewritten per /author conventions (XML tags, prescriptive)
- Agent now sends full response content, not abbreviated summaries
- New telegram-send.sh companion script at ~/.cursor-autopilot/:
  splits messages at paragraph boundaries respecting 4096-char limit,
  sends chunks sequentially with rate-limit delays
- Extension ensures send script + outbox directory on activation
- Remove all references to .autopilot.json and workspace-level files
- Document VS Code settings configuration with per-workspace support
- Document companion script, routing.json, and outbox directory
- Update directory layout and architecture sections
- Remove references to deleted dispatcher and watcher modules
…am credentials

Use VS Code's environmentVariableCollection API to inject AUTOPILOT_TG_TOKEN
and AUTOPILOT_TG_CHAT_ID into the integrated terminal per-window. The send
script falls back to ~/.cursor-autopilot/env for shell sessions that predate
extension activation. Eliminates routing.json and folder-name keying entirely.

- Rename extension to cursor-autopilot-local (v0.1.0) to avoid marketplace collision
- Remove all routing.json types, functions, and file management from store.ts
- Add syncEnvVars() that sets env vars + writes fallback env file
- Update send script to read from env vars with env file fallback
- Update cursor rule to single-argument invocation
- Update docs to reflect env var architecture
Remove out/, .vscode/settings.json from git tracking — these are
already in .gitignore but were committed previously. Add tmp/ to
.gitignore for old summary JSONs.
Switch from write-file-then-invoke to direct stdin piping. The agent
now pipes its response to telegram-send.py via heredoc in a single
Shell command — no intermediate files, no date call, no outbox dir.

- Replace telegram-send.sh (bash+heredoc) with telegram-send.py (pure Python)
- Script reads from stdin, resolves credentials from env vars / fallback file
- Update cursor rule to single-step heredoc piping with explicit constraints
- Update README and setup guide
When the window is unfocused, use AppleScript (macOS) or wmctrl
(Linux) to raise the specific Cursor window by workspace name before
injecting the message. This fixes the issue where paste succeeded but
submit silently failed in background windows.
- ensureCursorRule accepts enabled param to toggle alwaysApply in the
  managed cursor rule; when disabled the rule persists on disk but
  Cursor will not apply it
- Adapter initialization and inbound polling skipped when disabled
- onDidChangeConfiguration re-evaluates enabled and updates the rule
- Deactivation sets alwaysApply: false so the rule is inert without
  the extension running
- Remove stale OUTBOX_DIR constant and directory creation
- Fix comments and log messages referencing bash/telegram-send.sh
- Remove unused sendToChat import from extension.ts
Replace upstream author references with the new fork owner account
across package.json, README.md, and SETUP_GUIDE.md. Also fix stale
repo name cursor-auto-send → cursor-autopilot in package.json URLs.
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