ai: blocktank lsp api plugin + agent control interface#860
ai: blocktank lsp api plugin + agent control interface#860
Conversation
916f93c to
c3fc52e
Compare
142abce to
eb2fe0d
Compare
66285e8 to
2e069ad
Compare
.claude/plugins/blocktank-api/skills/lsp/scripts/pay-invoices.sh
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
|
@claude explain me from this PR how the agent can communicate with the app |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
jvsena42
left a comment
There was a problem hiding this comment.
the terminal commands worked but the the Claude didn't. I'm investigating
❯ pay 4 invoices of 100 sats using lsp skill
⏺ Skill(lsp)
⎿ Initializing…
⎿ Error: Unknown skill: lsp
⏺ There is no "lsp" skill available. The available skills are:
- /pr — Create a PR on GitHub
- /release — Create a new release
- /simplify — Review changed code for quality
- /loop — Run a command on a recurring interval
- /schedule — Manage scheduled remote agents
- /claude-api — Build apps with Claude API
- /update-config — Configure Claude Code settings
- /keybindings-help — Customize keyboard shortcuts
- /plannotator-review — Interactive code review
- /plannotator-annotate — Annotate markdown files
- /plannotator-last — Annotate last assistant message
- /plannotator-archive — Browse saved plan decisions
| @@ -0,0 +1,29 @@ | |||
| # Blocktank API Plugin | |||
There was a problem hiding this comment.
suggestion: The plugin needs to be manually enabled in .claude/settings.local.json before it shows up as a /lsp skill in Claude Code:
"enabledPlugins": {
"blocktank-api@blocktank-api": true
}Without this, Claude can't discover the skill and falls back to "Unknown skill: lsp". Could we add this setup step to the README or the PR description QA notes? It would save other devs from hitting the same issue.
Also worth noting that a Claude Code restart is needed after enabling the plugin.
There was a problem hiding this comment.
@claude address this concern and update the PR.
There was a problem hiding this comment.
Claude finished @ovitrif's task in 2m 0s —— View job
Addressing plugin setup documentation concern
- Gather context
- Read current README
- Identify required change
- Apply change (blocked — see below)
The .claude/ directory requires interactive approval that isn't available in the CI context. Here is the exact change to apply to .claude/plugins/blocktank-api/README.md:
Add a Setup section after the intro paragraph and before Usage:
## Setup
Enable the plugin in `.claude/settings.local.json`:
```json
{
"enabledPlugins": {
"blocktank-api@blocktank-api": true
}
}Then restart Claude Code. After restart the /lsp skill will be available.
The full updated README would be:
<details>
<summary>Full README content</summary>
```markdown
# Blocktank API Plugin
A Claude Code plugin that gives Claude knowledge of the full Blocktank LSP API, enabling it to autonomously create channels, fund them, mine blocks, pay invoices, and close channels during Blocktank LSP testing.
## Setup
Enable the plugin in `.claude/settings.local.json`:
```json
{
"enabledPlugins": {
"blocktank-api@blocktank-api": true
}
}
Then restart Claude Code. After restart the /lsp skill will be available.
Usage
Once installed, the skill auto-triggers when you mention things like:
- "mine blocks", "deposit sats", "pay invoice", "force close"
- "channel order", "CJIT", "blocktank", "LSP"
Claude will use the ./lsp wrapper at the repo root to make API calls directly.
Configuration
The default API base URL is https://api.stag0.blocktank.to/blocktank/api/v2 (staging).
To override (e.g., for a local instance):
export BLOCKTANK_API_URL=http://localhost:9000/apiCross-project reuse
To use this plugin from another repo (e.g. bitkit-ios), symlink it into that project's .claude/plugins/:
ln -s /path/to/bitkit-android/.claude/plugins/blocktank-api /path/to/other-repo/.claude/plugins/blocktank-api
</details>
To allow me to apply changes to `.claude/plugins/` automatically in CI, add it to the allowed paths in the GitHub Actions workflow config.
This PR:
./lspCLI wrapper for calling the Blocktank API from the repo rootDevToolsProviderContentProvider (debug builds only) for programmatic invoice creation viaadb shell content callpay-invoices.shautomation script for bulk invoice creation, payment, and block miningDescription
Blocktank LSP API Plugin for Claude Code - 142abce
Introduces a Claude Code plugin at
.claude/plugins/blocktank-api/that gives Claude knowledge of the Blocktank LSP REST API (18 endpoints) and provides shell scripts for calling it. The plugin includes a skill with endpoint tables, common workflows (channel purchase, CJIT, force close), and state machine documentation.Agent Control Interface (ACI) - 142abce
A debug-only
DevToolsProviderContentProvider allows creating bolt11 invoices on the app's LDK node viaadb shell content call, returning the result synchronously as JSON in a Bundle. Commands accept typed JSON args via--arg, with each command defining its own@Serializabledata class for type-safe deserialization with defaults.This MVP provides the basis for demonstrating 2-way communication between AI dev agents and the Bitkit Android App. Future implementations could expand the set of supported methods through this command interface, as the internals of the implementation were designed with extensibility in mind.
A potential 2nd layer could provide agent-to-app control by deep-linking directly to different routes within the app, optionally passing args to fill-in screen details such as route params or values for form inputs.
Preview
lsp_1.5x.mp4
QA Notes
1. Verify
./lspwrapper2. Verify invoice creation via claude code
prerequisite: debug build with wallet + open channel actively running on emulator
3. Verify full automation
prerequisite: open channel with inbound capacity