Skip to content

ai: blocktank lsp api plugin + agent control interface#860

Open
ovitrif wants to merge 3 commits intomasterfrom
ai/lsp-skill
Open

ai: blocktank lsp api plugin + agent control interface#860
ovitrif wants to merge 3 commits intomasterfrom
ai/lsp-skill

Conversation

@ovitrif
Copy link
Collaborator

@ovitrif ovitrif commented Mar 23, 2026

This PR:

  1. Adds a Blocktank LSP API Claude Code plugin with full endpoint reference, workflows, and state machines
  2. Adds a ./lsp CLI wrapper for calling the Blocktank API from the repo root
  3. Adds a DevToolsProvider ContentProvider (debug builds only) for programmatic invoice creation via adb shell content call
  4. Adds a pay-invoices.sh automation script for bulk invoice creation, payment, and block mining

Description

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 DevToolsProvider ContentProvider allows creating bolt11 invoices on the app's LDK node via adb 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 @Serializable data 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 ./lsp wrapper

# 1. run:
./lsp GET /info | jq

# 2. Should return JSON with LSP node info and channel limits.

2. Verify invoice creation via claude code

prerequisite: debug build with wallet + open channel actively running on emulator

# 1. run:
adb shell "content call --uri content://to.bitkit.dev.devtools \
  --method createInvoice --arg '{\"amount\":1000,\"description\":\"test\"}'"

# 2. Should print `Result: Bundle[{result={"type":"...Invoice","bolt11":"lnbcrt..."}}]`.

# 3. Pay the returned invoice:
./lsp POST /regtest/channel/pay '{"invoice":"__paste_bolt11_here__"}'

# 4. Should trigger receive sheet in app

3. Verify full automation

prerequisite: open channel with inbound capacity

# 1. run:
INVOICE_COUNT=3 MINE_TOTAL=10 MINE_BATCH=10 \
  .claude/plugins/blocktank-api/skills/lsp/scripts/pay-invoices.sh
  
# 2. Should create 3 invoices (1, 2, 3 sats), pay each, mine 10 blocks.
# 3. App should show all 3 payments in activity list.

@ovitrif ovitrif changed the title ai: blocktank lsp api plugin and dev invoice deep link ai: blocktank lsp api agent skill Mar 23, 2026
@ovitrif ovitrif self-assigned this Mar 23, 2026
@ovitrif ovitrif force-pushed the ai/lsp-skill branch 2 times, most recently from 916f93c to c3fc52e Compare March 24, 2026 20:22
@ovitrif ovitrif changed the title ai: blocktank lsp api agent skill ai: blocktank lsp api plugin and dev tools content provider Mar 24, 2026
@ovitrif ovitrif added this to the 2.2.0 milestone Mar 24, 2026
@ovitrif ovitrif changed the title ai: blocktank lsp api plugin and dev tools content provider ai: blocktank lsp api plugin + agent control interface Mar 24, 2026
@ovitrif ovitrif marked this pull request as ready for review March 24, 2026 23:02
@ovitrif ovitrif force-pushed the ai/lsp-skill branch 2 times, most recently from 142abce to eb2fe0d Compare March 25, 2026 15:53
@ovitrif ovitrif force-pushed the ai/lsp-skill branch 2 times, most recently from 66285e8 to 2e069ad Compare March 25, 2026 21:38
@synonymdev synonymdev deleted a comment from claude bot Mar 25, 2026
@ovitrif ovitrif enabled auto-merge March 25, 2026 22:04
@claude

This comment has been minimized.

@jvsena42
Copy link
Member

@claude explain me from this PR how the agent can communicate with the app

@claude

This comment has been minimized.

@claude

This comment has been minimized.

@claude

This comment has been minimized.

Copy link

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review test

Copy link

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review

Found 1 issue.

Copy link
Member

@jvsena42 jvsena42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 

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