Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ test/**
tasks/**
resource/**
.agents/**
plugin/**
scripts/**
sample-book/**
dist/sidecar-server.cjs
dist/mcp-server.cjs
WORKSPACE.md
tsconfig.json
tsconfig.core.json
.gitignore
*.vsix
30 changes: 24 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ code --install-extension xhtml-reader-previewer-0.1.0.vsix
```
*Or via VS Code UI: Extensions View βž” Click `...` (More Actions) βž” **Install from VSIX...** βž” Select the downloaded file.*

### Option 3: Google Antigravity 2.0 Plugin (Autonomous Auxiliary Pane & MCP)
Install and activate directly as a native Antigravity 2.0 plugin:
```bash
npm run deploy:local-plugin
```
Once deployed to `~/.gemini/config/plugins/xhtml-reader-plugin`, Antigravity exposes:
- **Auxiliary Pane Sidecar**: Interactive reading panel accessible via pill links `[Buka XHTML Reader](sidecar://xhtml-reader-plugin/xhtml-previewer/)`.
- **MCP Server Tools (`xhtml_reader_mcp`)**: Autonomous inspection tools for agents (`xhtml_open_preview`, `xhtml_get_toc`, `xhtml_get_metadata`).
- **Autonomous Reading Rules**: Dedicated agent rule guiding AI assistants to preview publications interactively.

---

## ✨ Key Features
Expand Down Expand Up @@ -130,21 +140,29 @@ Double-click any `.epub` file in your workspace to open it immediately in the de

## πŸ› οΈ Development & Building

The repository features a unified **Dual-Target Build Pipeline** that generates both the VS Code extension and the Antigravity 2.0 plugin from a shared core:

```bash
# Install dependencies
npm install

# Type check
npm run check
npm run check # Full check
npm run check:core # Pure core check (verifies zero vscode dependency)

# Run unit tests
# Run test suite (all 67 unit and integration tests)
npm test

# Build extension bundles
npm run build
# Build all targets (VS Code extension + Antigravity sidecar & MCP)
npm run build:all

# Target 1: VS Code Extension
npm run build:vscode
npm run package:vsix # Outputs standalone lean .vsix package

# Package local VSIX
npx @vscode/vsce package
# Target 2: Antigravity 2.0 Plugin
npm run build:plugin # Builds sidecar-server.cjs & mcp-server.cjs
npm run deploy:local-plugin # Deploys bundle to ~/.gemini/config/plugins/xhtml-reader-plugin
```

---
Expand Down
14 changes: 11 additions & 3 deletions WORKSPACE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@
Workspace untuk pengembangan **XHTML Reader Previewer** (Mode: **Mode 1: Native / Lead (Root Git Repo)**).

## Projects
| Project | Stack | Repo | Status |
|---------|-------|------|--------|
| Root (Direct) | TypeScript, VS Code Extension API, esbuild | TBD | Active |
| Project | Stack | Repo | Status | Target |
|---------|-------|------|--------|--------|
| Root (Direct) | TypeScript, esbuild | https://github.com/intxdv/XHTML-Reader-Previewer | Active | Dual-Target (VS Code VSIX + Antigravity 2.0 Plugin) |

### Dual-Target Architecture
- **Pure Core (`src/core/`)**: Mesin parsing EPUB & XHTML, state manager, dan UI reader-shell terisolasi tanpa dependensi vendor.
- **VS Code Extension (`src/vscode/`)**: Adapter VS Code Webview Panel & CustomEditor (`dist/extension.js` -> `.vsix`).
- **Antigravity 2.0 Plugin (`src/antigravity/` & `plugin/`)**:
- Sidecar HTTP Server (`dist/sidecar-server.cjs`) untuk Auxiliary Pane.
- Model Context Protocol (MCP) Server (`dist/mcp-server.cjs`) untuk Autonomous Agent (`xhtml_open_preview`, `xhtml_get_toc`, `xhtml_get_metadata`).
- Declarative Plugin Manifests (`plugin/plugin.json`, `mcp_config.json`, `sidecars/`, `skills/`, `rules/`).

## Team & Stakeholders
- **Developer**: Developer
Expand Down
12 changes: 9 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,20 @@
]
},
"scripts": {
"build": "esbuild src/vscode/extension.ts --bundle --platform=node --format=cjs --external:vscode --outfile=dist/extension.js && esbuild src/core/xhtml.ts --bundle --platform=node --format=cjs --outfile=dist/xhtml.js && esbuild src/core/epub.ts --bundle --platform=node --format=cjs --external:vscode --outfile=dist/epub.js && esbuild src/core/state-manager.ts --bundle --platform=node --format=cjs --outfile=dist/state-manager.js && esbuild src/core/archive.ts --bundle --platform=node --format=cjs --outfile=dist/archive.js && npm run build:sidecar && npm run build:mcp",
"build": "npm run build:all",
"build:core": "tsc -p tsconfig.core.json --noEmit",
"build:vscode": "esbuild src/vscode/extension.ts --bundle --platform=node --format=cjs --external:vscode --outfile=dist/extension.js && esbuild src/core/xhtml.ts --bundle --platform=node --format=cjs --outfile=dist/xhtml.js && esbuild src/core/epub.ts --bundle --platform=node --format=cjs --external:vscode --outfile=dist/epub.js && esbuild src/core/state-manager.ts --bundle --platform=node --format=cjs --outfile=dist/state-manager.js && esbuild src/core/archive.ts --bundle --platform=node --format=cjs --outfile=dist/archive.js",
"build:sidecar": "esbuild src/antigravity/sidecar-server.ts --bundle --platform=node --format=cjs --outfile=dist/sidecar-server.cjs",
"build:mcp": "esbuild src/antigravity/mcp-server.ts --bundle --platform=node --format=cjs --outfile=dist/mcp-server.cjs",
"build:plugin": "npm run build:sidecar && npm run build:mcp",
"build:all": "npm run build:vscode && npm run build:plugin",
"package:vsix": "npx @vscode/vsce package --no-dependencies",
"install:plugin": "node scripts/install-plugin.js",
"deploy:local-plugin": "node scripts/install-plugin.js",
"check": "tsc --noEmit",
"check:core": "tsc -p tsconfig.core.json --noEmit",
"check:core": "npm run build:core",
"test": "npm run build && node --test test/*.test.mjs",
"watch": "npm run build -- --watch"
"watch": "npm run build:vscode -- --watch"
},
"devDependencies": {
"@types/node": "^22.13.0",
Expand Down
Loading