Expose run API for downstream workflows#14
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughThis PR exposes two new public functions to enable downstream pi.nvim workflows. Sequence Diagram(s)sequenceDiagram
participant User
participant M_run as require("pi").run()
participant Session
participant UI
participant ContextBuilder as build_context
participant Runner as runner.start
User->>M_run: call run(opts)
M_run->>Session: create session + snapshot buffers
M_run->>Session: set skip_reload and on_done
M_run->>UI: open UI
M_run->>Session: set status "collecting_context"
M_run->>ContextBuilder: invoke build_context()
ContextBuilder-->>M_run: returns context
M_run->>Runner: start(session, cmd, payload with Context)
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
|
hey @nhlmg93 ! thanks for the PR, I like the approach and I might even use this myself 🌝 One small thing, could you keep the README more minimal? The API docs are fine but the |
6e55907 to
825029c
Compare
825029c to
3b9d9cf
Compare
Summary
This keeps pi.nvim's built-in feature set small while exposing a reusable engine API for downstream workflows.
Core still only registers:
:PiAsk:PiAskSelection:PiCancel:PiLogNew public API:
require("pi").get_cmd()returns the configured pi command tablerequire("pi").run({ ... })starts a session with custom context/behaviormessagebuild_contextbufnrcmdskip_reloadon_done(session)This should let users implement things like
PiSearchorPiTutorialin their own config/plugin without making those commands part of pi.nvim core.Closes #13.
Tests
make test— 30/30 passingSummary by CodeRabbit
Documentation
New Features
Tests