Files

1 line
10 KiB
JSON

{"repo": "anandb/nb-complete", "files": {"README.md": {"948342e9785a7b8462dc38dbae18c2b77ec3ae62": {"t": 1785596374.8274791, "n": 9808, "h": "3d7dd4e9e954d3d6", "c": "# Coding Assistant\n\n[![Version](https://img.shields.io/badge/version-1.12.9-blue.svg)](pom.xml)\n[![Build Status](https://img.shields.io/badge/build-success-brightgreen.svg)](https://github.com/anandb/nb-complete)\n[![Maven Central](https://img.shields.io/maven-central/v/io.github.anandb/beanbot)](https://central.sonatype.com/artifact/io.github.anandb/beanbot/versions)\n[![NetBeans](https://img.shields.io/badge/NetBeans-RELEASE220-blue.svg)](https://netbeans.apache.org/download/index.html)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)\n[![Support this project](https://img.shields.io/badge/OpenCode-Referral-FF6C37?style=flat&logo=openai&logoColor=white)](https://opencode.ai/go?ref=DWTNHGN9KX)\n\nCoding Assistant is a NetBeans IDE plugin designed to provide integrated AI capabilities through the Agent Client Protocol (ACP). It offers a structured chat interface for technical assistance, including code generation, project analysis, and automated task execution.\n\n| | | |\n| :---: | :---: | :---: |\n| ![UI Screenshot 1](screenshots/Screenshot_20260705_235605.png) | ![UI Screenshot 2](screenshots/Screenshot_20260705_235904.png) | ![UI Screenshot 3](screenshots/Screenshot_20260706_000132.png) |\n\n---\n\n## Getting Started\n\nSee the [Quickstart Guide](QUICKSTART.md) for setup, feature details, and usage instructions.\n\n### Test Configuration\n\nDue to time constraints, testing is primarily done on this configuration. The plugin\nshould work on other versions/operating systems, but your experience may vary.\n\n| Component | Details |\n| --- | --- |\n| **OS** | openSUSE Tumbleweed-Slowroll |\n| **NetBeans** | RELEASE220 |\n| **Java** | JDK 17+ |\n| **Opencode** | 1.17.17 |\n| **Opencode plugins** | `@franzmoca/opencode-lombok`, `true-mem` |\n| **LLMs** | Big Pickle; GPT 5.4-mini, GPT 5.4-nano; GLM 5.1, GLM 5.2; DeepSeek V4 Pro, DeepSeek V4 Flash; Kimi K2.5, Kimi K2.6; Mimo V2.5; Qwen3.5, Qwen3.6; Gemma4 |\n\nNote: Qwen models require `--think=false` if using Ollama, and a `\"reasoningEffort\": \"none\"`\nconfiguration in `opencode.json`\n\n### Installation from Source\n1. Clone the repository:\n ```bash\n git clone https://github.com/anandb/nb-complete.git\n cd nb-complete\n ```\n2. Build the package:\n ```bash\n mvn package -DskipTests\n ```\n3. The generated NBM will be located in the `./target/nbm/` directory.\n4. Install the plugin through the NetBeans Plugin Manager.\n\n---\n\n## Architecture\n\nThe project follows a hexagonal (ports & adapters) architecture integrated into the NetBeans Platform:\n\n- **`model/`**: ACP-compliant data records (sessions, messages, updates, config options). Zero dependencies on upper layers.\n- **`contract/`**: Service interfaces that define ports for session control, process management, and UI callbacks. `manager/` implements; `ui/` consumes.\n- **`manager/`**: Core orchestration — protocol client (JSON-RPC over stdin/stdout), session state machine, process lifecycle, and SSE strategy dispatch.\n- **`mcp/`**: MCP server integration — hosts a local server that registers IDE tools (`get_tabs`, `open_pos`, `rename_session`) so that the AI client can inspect open tabs and control editor navigation.\n- **`support/`**: Pure utilities — logging, JSON mapping, text scanning, constants, browser helpers. Zero dependencies on upper layers.\n- **`ui/`**: All Swing components — chat window, message bubbles, streaming animation, theming, options panel, stash diff viewer. Depends only on `contract/` interfaces.\n\n---\n\n## Source Organization\n\nAll source lives under `src/main/java/github/anandb/netbeans/`:\n\n| Package | Files | Role |\n| --- | --- | --- |\n| `contract/` | 19 | Service interfaces (UI callbacks, session & process control, permission & request handlers, pinned message control) |\n| `manager/` | 18 | Core orchestration, protocol clients, session management, process lifecycle (includes `strategy/`, file cache, VCS ignore) |\n| `mcp/` | 13 | MCP server integration (editor tools, tool definitions, message servlet) |\n| `model/` | 15 | ACP-compliant data models (session, messages, updates, config options, color tokens) |\n| `project/` | 12 | NetBeans lifecycle hooks, project manager, markdown project support |\n| `support/` | 18 | Utilities (logging, JSON mapping, text scanning, constants, browser helpers, pinned message store, shortcut utils) |\n| `ui/` | 97 | Swing components, platform integration, markdown project UI (chat, bubbles, theming, options, stash diff, file search) |\n\n---\n\n## Code Reading Path\n\nFor a guided walkthrough mapped to the plugin's execution flow, read files in this order:\n\n### Phase 1: Entry & Lifecycle\n1. [`project/ACPStartup.java`](src/main/java/github/anandb/netbeans/project/ACPStartup.java) — NetBeans `@OnStart` hook\n2. [`project/ACPShutdown.java`](src/main/java/github/anandb/netbeans/project/ACPShutdown.java) — `@OnStop` cleanup\n3. [`src/main/resources/github/anandb/netbeans/ui/layer.xml`](src/main/resources/github/anandb/netbeans/ui/layer.xml) — NetBeans registration (window, shortcut, options, Git toolbar)\n\n### Phase 2: Server Process\n4. [`manager/ProcessManager.java`](src/main/java/github/anandb/netbeans/manager/ProcessManager.java) — Spawns/owns the `opencode acp` subprocess; central request dispatch\n5. [`support/BinaryResolver.java`](src/main/java/github/anandb/netbeans/support/BinaryResolver.java) — Locates the binary on PATH\n6. [`manager/AcpProtocolClient.java`](src/main/java/github/anandb/netbeans/manager/AcpProtocolClient.java) — JSON-RPC over stdin/stdout, SSE read loop, pending request tracking\n\n### Phase 3: Session Management\n7. [`manager/SessionManager.java`](src/main/java/github/anandb/netbeans/manager/SessionManager.java) — Session CRUD, state machine, SSE routing\n8. [`manager/SessionStateMachine.java`](src/main/java/github/anandb/netbeans/manager/SessionStateMachine.java) — Finite-state machine for session lifecycle\n9. [`model/Session.java`](src/main/java/github/anandb/netbeans/model/Session.java) — Session data record\n10. [`model/SessionUpdate.java`](src/main/java/github/anandb/netbeans/model/SessionUpdate.java) — SSE notification payload model\n11. [`model/Message.java`](src/main/java/github/anandb/netbeans/model/Message.java) — Message model (prompts, tool calls, results)\n\n### Phase 4: Strategy Dispatch (SSE handler chain)\n13. [`contract/UIHandler.java`](src/main/java/github/anandb/netbeans/contract/UIHandler.java) — Callback interface for rendering\n14. [`manager/strategy/StrategyRegistry.java`](src/main/java/github/anandb/netbeans/manager/strategy/StrategyRegistry.java) — Sole dispatch class: type switch routes `SessionUpdate` → extraction logic, eliminating the strategy interface hierarchy\n\n### Phase 5: UI Rendering\n15. [`ui/AssistantTopComponent.java`](src/main/java/github/anandb/netbeans/ui/AssistantTopComponent.java) — Main chat window (NetBeans TopComponent)\n16. [`ui/ComponentLifecycleHandler.java`](src/main/java/github/anandb/netbeans/ui/ComponentLifecycleHandler.java) — Wires lifecycle events → managers\n17. [`ui/SessionLifecycleHandler.java`](src/main/java/github/anandb/netbeans/ui/SessionLifecycleHandler.java) — Glue: receives SSE updates, calls `StrategyRegistry.handle()`, invokes UI\n18. [`ui/ChatThreadPanel.java`](src/main/java/github/anandb/netbeans/ui/ChatThreadPanel.java) — Thread of message bubbles with streaming animation\n19. [`ui/MessageBubble.java`](src/main/java/github/anandb/netbeans/ui/MessageBubble.java) — Individual message turn (thought, tool, code segments)\n20. [`ui/MessageSender.java`](src/main/java/github/anandb/netbeans/ui/MessageSender.java) — Send/cancel logic\n\n### Phase 6: Supporting\n21. [`model/ProcessedMessage.java`](src/main/java/github/anandb/netbeans/model/ProcessedMessage.java) — The rendered output model consumed by UI\n22. [`mcp/McpManager.java`](src/main/java/github/anandb/netbeans/mcp/McpManager.java) — MCP server integration layer\n23. [`contract/RequestHandler.java`](src/main/java/github/anandb/netbeans/contract/RequestHandler.java) — Interface for incoming RPC requests from the server\n\n---\n\n## System Properties\n\nThe plugin reads the following system properties and environment variables:\n\n| Property | System | Description |\n|---|---|---|\n| `user.dir` | System | Working directory for session/project (`SessionManager`) |\n| `user.home` | System | Default folder for Markdown Project creation (`MdProjectPanelVisual`) |\n| `java.io.tmpdir` | System | Temp directory for pasted images (`ImagePasteTransferHandler`) |\n| `os.name` | System | Detect Windows for binary resolution (`BinaryResolver`) |\n| `netbeans.codingassistant.roundedPanels` | System (`true`) | Toggle rounded panel corners (`RoundedPanel`) |\n| `netbeans.codingassistant.color.*` | System (varies) | Override any UI color (`ColorTheme`) |\n| `nb.dark.theme` | UIManager | Detect dark theme for icon resolution (`IconResourceManager`) |\n| `ACP_WIRE_LOG` | Env | Path for ACP wire protocol log file (`WireLogger`) |\n| `OPENCODE_MODEL` | Env | Default model override in config (`ConfigPanelController`) |\n| `PATH` | Env | Search path for opencode binary (`BinaryResolver`) |\n\nThe color properties are declared in [`colors.json`](src/main/resources/github/anandb/netbeans/ui/colors.json) and cover: background, foreground, selection, accent, sunken background, bubble (user/assistant), code, table, header, thinking, tool, permission, and error colors — each with light and dark variants.\n\n---\n\n## Contributing\n\nDevelopment follows standard NetBeans Platform patterns. Contributors are expected to maintain consistency with existing styling and logging conventions. New components must be validated against both light and dark IDE themes.\n\n---\n\n## License\n\nThis software is released under the Apache License, Version 2.0. Further details can be found in the LICENSE file.\n\n"}}}}