blastcode 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- blastcode-0.3.0/.agents/docs-cache/frontend-sfc.md +69 -0
- blastcode-0.3.0/.github/workflows/ci.yml +38 -0
- blastcode-0.3.0/.github/workflows/release.yml +68 -0
- blastcode-0.3.0/.gitignore +14 -0
- blastcode-0.3.0/CHANGELOG.md +89 -0
- blastcode-0.3.0/Cargo.lock +860 -0
- blastcode-0.3.0/Cargo.toml +68 -0
- blastcode-0.3.0/LICENSE +21 -0
- blastcode-0.3.0/PKG-INFO +233 -0
- blastcode-0.3.0/README.md +210 -0
- blastcode-0.3.0/assets/banner.png +0 -0
- blastcode-0.3.0/assets/banner.svg +136 -0
- blastcode-0.3.0/assets/demo_caretaker.png +0 -0
- blastcode-0.3.0/assets/demo_impact.png +0 -0
- blastcode-0.3.0/assets/demo_skeleton.png +0 -0
- blastcode-0.3.0/assets/logo.png +0 -0
- blastcode-0.3.0/assets/logo.svg +128 -0
- blastcode-0.3.0/extension/CHANGELOG.md +36 -0
- blastcode-0.3.0/extension/LICENSE +21 -0
- blastcode-0.3.0/extension/README.md +210 -0
- blastcode-0.3.0/extension/blastcode-vscode-0.1.0.vsix +0 -0
- blastcode-0.3.0/extension/blastcode-vscode-0.1.1.vsix +0 -0
- blastcode-0.3.0/extension/blastcode-vscode-0.1.2.vsix +0 -0
- blastcode-0.3.0/extension/extension.js +40 -0
- blastcode-0.3.0/extension/logo.png +0 -0
- blastcode-0.3.0/extension/logo.svg +128 -0
- blastcode-0.3.0/extension/package.json +41 -0
- blastcode-0.3.0/npm/LICENSE +21 -0
- blastcode-0.3.0/npm/README.md +210 -0
- blastcode-0.3.0/npm/bin/blast.js +21 -0
- blastcode-0.3.0/npm/package.json +34 -0
- blastcode-0.3.0/npm/scripts/install.js +84 -0
- blastcode-0.3.0/pyproject.toml +31 -0
- blastcode-0.3.0/smithery.yaml +13 -0
- blastcode-0.3.0/src/extract.rs +2740 -0
- blastcode-0.3.0/src/git.rs +172 -0
- blastcode-0.3.0/src/grep.rs +124 -0
- blastcode-0.3.0/src/impact.rs +277 -0
- blastcode-0.3.0/src/indexer.rs +452 -0
- blastcode-0.3.0/src/lang.rs +212 -0
- blastcode-0.3.0/src/lib.rs +14 -0
- blastcode-0.3.0/src/main.rs +299 -0
- blastcode-0.3.0/src/mcp.rs +120 -0
- blastcode-0.3.0/src/model.rs +104 -0
- blastcode-0.3.0/src/query.rs +933 -0
- blastcode-0.3.0/src/resolve.rs +943 -0
- blastcode-0.3.0/src/store.rs +325 -0
- blastcode-0.3.0/src/tools.rs +591 -0
- blastcode-0.3.0/src/verify.rs +197 -0
- blastcode-0.3.0/tests/e2e.rs +887 -0
- blastcode-0.3.0/tests/mcp.rs +77 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Frontend SFC & Web Technologies Stack Digest
|
|
2
|
+
|
|
3
|
+
## 1. tree-sitter-html (v0.23.2)
|
|
4
|
+
- **Crate**: `tree-sitter-html = "0.23.2"`
|
|
5
|
+
- **API**: `tree_sitter_html::language()` -> `tree_sitter::Language`
|
|
6
|
+
- **Grammar Root**: `fragment` / `document`
|
|
7
|
+
- **Key Nodes**:
|
|
8
|
+
- `element`: contains `start_tag`, child elements, `end_tag`
|
|
9
|
+
- `script_element`: contains `start_tag`, `raw_text`, `end_tag`
|
|
10
|
+
- `style_element`: contains `start_tag`, `raw_text`, `end_tag`
|
|
11
|
+
- `tag_name`: identifier for element tag
|
|
12
|
+
- `attribute`: contains `attribute_name` and optional `quoted_attribute_value`
|
|
13
|
+
|
|
14
|
+
## 2. tree-sitter-css (v0.23.1)
|
|
15
|
+
- **Crate**: `tree-sitter-css = "=0.23.1"` (pinned to ABI 13/14 for tree-sitter 0.24)
|
|
16
|
+
- **API**: `tree_sitter_css::language()` -> `tree_sitter::Language`
|
|
17
|
+
- **Grammar Root**: `stylesheet`
|
|
18
|
+
- **Key Nodes**:
|
|
19
|
+
- `rule_set`: `selectors` and `block`
|
|
20
|
+
- `class_selector`: `class_name`
|
|
21
|
+
- `id_selector`: `id_name`
|
|
22
|
+
- `declaration`: `property_name` (e.g. `--custom-var`) and `value`
|
|
23
|
+
- `at_rule`: `@keyframes`, `@media`, `@mixin`, `@include`, `@import`
|
|
24
|
+
- `keyframes_statement`: `@keyframes <name>`
|
|
25
|
+
|
|
26
|
+
## 3. Svelte (.svelte)
|
|
27
|
+
- **File Structure**:
|
|
28
|
+
- `<script>` or `<script lang="ts">` or `<script context="module">`: TypeScript / JavaScript
|
|
29
|
+
- Svelte 3/4 Props: `export let foo: string;`
|
|
30
|
+
- Svelte 5 Runes: `let { x, y } = $props();`, `let count = $state(0);`, `let double = $derived(...)`
|
|
31
|
+
- Template: Subcomponents `<Header />`, event bindings `on:click={handleClick}`, snippets `{#snippet}`
|
|
32
|
+
- `<style>`: Scoped CSS
|
|
33
|
+
- **Indexing Strategy**:
|
|
34
|
+
- Extract TypeScript/JS from script blocks with virtual line-matched buffer into Tree-sitter TSX.
|
|
35
|
+
- Component-level symbol from file basename (e.g. `App.svelte` -> `App` component).
|
|
36
|
+
- Extract template component references (`<Header>`, `<Modal>`) for cross-file call/dependency graph.
|
|
37
|
+
- Extract CSS classes and variables from `<style>`.
|
|
38
|
+
|
|
39
|
+
## 4. Vue (.vue)
|
|
40
|
+
- **File Structure**:
|
|
41
|
+
- `<script setup lang="ts">` or `<script lang="ts">` or `<script>`: TypeScript / JavaScript
|
|
42
|
+
- Options API: `export default { props, data, methods }`
|
|
43
|
+
- Composition API / script setup: `defineProps<Props>()`, `defineEmits()`, `ref()`, `computed()`, functions
|
|
44
|
+
- `<template>`: Subcomponents `<UserCard>`, `<el-button>`, event handlers `@click="save"`
|
|
45
|
+
- `<style scoped>`: Scoped CSS
|
|
46
|
+
- **Indexing Strategy**:
|
|
47
|
+
- Extract TypeScript/JS from script blocks with virtual line-matched buffer into Tree-sitter TSX.
|
|
48
|
+
- Component-level symbol from file basename.
|
|
49
|
+
- Extract template component references and event bindings into call-graph.
|
|
50
|
+
- Extract CSS classes and variables from `<style>`.
|
|
51
|
+
|
|
52
|
+
## 5. Astro (.astro)
|
|
53
|
+
- **File Structure**:
|
|
54
|
+
- Frontmatter fences `---` ... `---`: pure TypeScript/JavaScript!
|
|
55
|
+
- `interface Props { ... }`, `const { title } = Astro.props;`
|
|
56
|
+
- Client scripts: `<script>`
|
|
57
|
+
- Template markup: `<Layout>`, `<Header>`
|
|
58
|
+
- `<style>`: Scoped CSS
|
|
59
|
+
- **Indexing Strategy**:
|
|
60
|
+
- Extract frontmatter into Tree-sitter TSX.
|
|
61
|
+
- Component-level symbol from file basename.
|
|
62
|
+
- Template component references.
|
|
63
|
+
- CSS from `<style>`.
|
|
64
|
+
|
|
65
|
+
## 6. HTML (.html, .htm)
|
|
66
|
+
- **File Structure**:
|
|
67
|
+
- `<script>` blocks: JavaScript/TypeScript functions, imports, variables.
|
|
68
|
+
- `<style>` blocks: CSS.
|
|
69
|
+
- Elements with `id="..."`: IDs as anchor symbols.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
name: Test (${{ matrix.os }})
|
|
12
|
+
runs-on: ${{ matrix.os }}
|
|
13
|
+
strategy:
|
|
14
|
+
fail-fast: false
|
|
15
|
+
matrix:
|
|
16
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout code
|
|
19
|
+
uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Setup Rust toolchain
|
|
22
|
+
uses: dtolnay/rust-toolchain@stable
|
|
23
|
+
|
|
24
|
+
- name: Cargo Cache
|
|
25
|
+
uses: actions/cache@v4
|
|
26
|
+
with:
|
|
27
|
+
path: |
|
|
28
|
+
~/.cargo/bin/
|
|
29
|
+
~/.cargo/registry/index/
|
|
30
|
+
~/.cargo/registry/cache/
|
|
31
|
+
~/.cargo/git/db/
|
|
32
|
+
target/
|
|
33
|
+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
34
|
+
restore-keys: |
|
|
35
|
+
${{ runner.os }}-cargo-
|
|
36
|
+
|
|
37
|
+
- name: Run Tests
|
|
38
|
+
run: cargo test --verbose
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build-and-release:
|
|
13
|
+
name: Build (${{ matrix.target }})
|
|
14
|
+
runs-on: ${{ matrix.os }}
|
|
15
|
+
strategy:
|
|
16
|
+
fail-fast: false
|
|
17
|
+
matrix:
|
|
18
|
+
include:
|
|
19
|
+
- os: ubuntu-latest
|
|
20
|
+
target: x86_64-unknown-linux-gnu
|
|
21
|
+
binary_name: blast
|
|
22
|
+
asset_name: blast-linux-x86_64.tar.gz
|
|
23
|
+
- os: macos-latest
|
|
24
|
+
target: aarch64-apple-darwin
|
|
25
|
+
binary_name: blast
|
|
26
|
+
asset_name: blast-macos-arm64.tar.gz
|
|
27
|
+
- os: macos-13
|
|
28
|
+
target: x86_64-apple-darwin
|
|
29
|
+
binary_name: blast
|
|
30
|
+
asset_name: blast-macos-x86_64.tar.gz
|
|
31
|
+
- os: windows-latest
|
|
32
|
+
target: x86_64-pc-windows-msvc
|
|
33
|
+
binary_name: blast.exe
|
|
34
|
+
asset_name: blast-windows-x64.zip
|
|
35
|
+
|
|
36
|
+
steps:
|
|
37
|
+
- name: Checkout code
|
|
38
|
+
uses: actions/checkout@v4
|
|
39
|
+
|
|
40
|
+
- name: Setup Rust toolchain
|
|
41
|
+
uses: dtolnay/rust-toolchain@stable
|
|
42
|
+
with:
|
|
43
|
+
targets: ${{ matrix.target }}
|
|
44
|
+
|
|
45
|
+
- name: Build Release Binary
|
|
46
|
+
run: cargo build --release --target ${{ matrix.target }}
|
|
47
|
+
|
|
48
|
+
- name: Package Assets (Unix)
|
|
49
|
+
if: matrix.os != 'windows-latest'
|
|
50
|
+
run: |
|
|
51
|
+
cd target/${{ matrix.target }}/release
|
|
52
|
+
tar -czf ../../../${{ matrix.asset_name }} ${{ matrix.binary_name }}
|
|
53
|
+
cd ../../..
|
|
54
|
+
|
|
55
|
+
- name: Package Assets (Windows)
|
|
56
|
+
if: matrix.os == 'windows-latest'
|
|
57
|
+
shell: bash
|
|
58
|
+
run: |
|
|
59
|
+
cd target/${{ matrix.target }}/release
|
|
60
|
+
7z a ../../../${{ matrix.asset_name }} ${{ matrix.binary_name }}
|
|
61
|
+
cd ../../..
|
|
62
|
+
|
|
63
|
+
- name: Upload Release Asset
|
|
64
|
+
uses: softprops/action-gh-release@v2
|
|
65
|
+
with:
|
|
66
|
+
files: ${{ matrix.asset_name }}
|
|
67
|
+
env:
|
|
68
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to **BlastCode** will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## [0.3.0] - 2026-10-11
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- **Frontend Single-File Component (SFC) & Web Template Engine**:
|
|
14
|
+
- **Svelte (`.svelte`)**: First-class support for Svelte 3, 4, and 5 runes (`$props()`, `$state()`, `$derived()`, `export let`). Extracts component definitions, props, reactive state, script functions, template component tags (`<Header />`), and event bindings (`on:click`, `onclick`).
|
|
15
|
+
- **Vue (`.vue`)**: Full support for Vue 2 & 3 SFCs (`<script setup>`, `defineProps`, `defineEmits`, `ref`, `computed`, and Options API). Extracts template component instances and event directives (`@click`, `v-on:`).
|
|
16
|
+
- **Astro (`.astro`)**: Native parsing of component frontmatter fences (`---` ... `---`), `interface Props`, `Astro.props`, client scripts, and layout/component tags.
|
|
17
|
+
- **HTML (`.html`, `.htm`)**: Extracts embedded `<script>` blocks (functions, variables, imports), embedded `<style>` blocks, and DOM element anchor IDs (`id="..."`).
|
|
18
|
+
- **CSS / SCSS (`.css`, `.scss`, `.sass`, `.less`)**: Multi-rule AST indexing via `tree-sitter-css`. Extracts class selectors (`.btn-primary`), ID selectors (`#app`), CSS custom variables (`--primary-color`), `@keyframes` animations, and SCSS `@mixin` blocks.
|
|
19
|
+
- **Cross-Component Call-Graph & Blast-Radius Tracing**:
|
|
20
|
+
- Component usages in templates (`<ChildComponent />`) are automatically indexed as call-graph edges.
|
|
21
|
+
- When a component is modified, `blast impact` and `blast trace` immediately identify all parent components that instantiate it.
|
|
22
|
+
- **Token-Lean Web Skeletons**:
|
|
23
|
+
- Replaces massive 500-1500 line template files and thousands of lines of CSS with 20-50 token architectural skeletons with exact line numbers, saving massive agent context and token budgets.
|
|
24
|
+
|
|
25
|
+
## [0.2.1] - 2026-10-09
|
|
26
|
+
|
|
27
|
+
### Added
|
|
28
|
+
- **High-Speed Workspace Grep Engine (`grep_workspace`)**:
|
|
29
|
+
- Multi-threaded regex and token search across workspace files powered by `ignore` and `regex`.
|
|
30
|
+
- Automatically respects `.gitignore`, skips binary files, and filters hidden paths.
|
|
31
|
+
- New CLI subcommand: `blast grep <pattern> [--path <glob>] [--case-sensitive] [--limit <n>] [--json]`.
|
|
32
|
+
- **Struct Field, Enum Variant, Const & Static Extraction**:
|
|
33
|
+
- Extracted struct fields (e.g. `pub trailer_override: ...`), enum variants, consts, and statics into the symbol index across Rust, Go, TypeScript/JS, and Python.
|
|
34
|
+
- Field members are now fully searchable via `blast search` and extractable via `blast source`.
|
|
35
|
+
- **Resilient Path Normalization & Fuzzy Fallback**:
|
|
36
|
+
- Language path syntax normalization (`::` converted to `.`) for seamless lookup of scoped items (e.g. `Document::trailer` -> `Document.trailer`).
|
|
37
|
+
- Substring fallback matching in `find_defs` so partial names (e.g. `trailer` for `trailer_override`) resolve to the exact symbol definition.
|
|
38
|
+
|
|
39
|
+
## [0.2.0] - 2026-10-09
|
|
40
|
+
|
|
41
|
+
### Added
|
|
42
|
+
- **Affected Test Discovery & Runner Generation (`get_affected_tests`)**:
|
|
43
|
+
- Automatically identifies all unit and integration test files & test functions covering any modified file or symbol across 10 programming languages.
|
|
44
|
+
- Generates the exact language-specific CLI test runner command (`cargo test`, `pytest`, `go test`, `npm test`, `mvn test`, `dotnet test`, `phpunit`, `rspec`).
|
|
45
|
+
- **Pre-Flight AST & Arity Patch Validator (`verify_patch`)**:
|
|
46
|
+
- In-memory validation of proposed code edits before writing to disk.
|
|
47
|
+
- Tree-sitter syntax parsing catches broken syntax tokens without disk I/O.
|
|
48
|
+
- Call-site arity checks against indexed SQLite signatures flag incorrect parameter counts before code is saved.
|
|
49
|
+
- **Git Commit Co-Change Coupling Intelligence (`get_co_changed_files`)**:
|
|
50
|
+
- Mines Git commit history to discover files that frequently change together.
|
|
51
|
+
- Discovers implicit, non-syntactic dependencies (e.g. schema migrations, paired types, documentation).
|
|
52
|
+
- **Dead & Orphaned Symbol Graph Analysis (`find_dead_code`)**:
|
|
53
|
+
- Detects unreferenced functions, classes, and structs with zero callers, type usages, and imports across the entire workspace.
|
|
54
|
+
- Categorizes confidence levels (`probable` for internal symbols, `heuristic` for exported symbols).
|
|
55
|
+
- **Official Smithery Registry Manifest (`smithery.yaml`)**:
|
|
56
|
+
- Standardized configuration manifest enabling zero-install startup via `@smithery/cli` and PulseMCP.
|
|
57
|
+
- **New CLI Subcommands**:
|
|
58
|
+
- `blast tests <file> [--symbol <name>]`
|
|
59
|
+
- `blast verify <file> [--stdin]`
|
|
60
|
+
- `blast coupled <file> [--depth <n>]`
|
|
61
|
+
- `blast dead [--prefix <dir>]`
|
|
62
|
+
|
|
63
|
+
## [0.1.0] - 2026-10-08
|
|
64
|
+
|
|
65
|
+
### Added
|
|
66
|
+
- **10 Language Parsers**:
|
|
67
|
+
- Core: Python, TypeScript / JavaScript (TSX/JSX), Rust, Go.
|
|
68
|
+
- Extended: Java, C#, C, C++, PHP, Ruby.
|
|
69
|
+
- **Incremental AST-Derived SQLite Indexer**:
|
|
70
|
+
- Blake3 content-hash caching; only changed files re-indexed.
|
|
71
|
+
- Parallel AST extraction using Rayon thread pools.
|
|
72
|
+
- **Workspace Caretaker**:
|
|
73
|
+
- Continuous background file watcher and symbol-level diff engine.
|
|
74
|
+
- Bounded change journal reporting exact diffs once as separate response blocks.
|
|
75
|
+
- Live terminal event streamer via `blast watch`.
|
|
76
|
+
- **Read-Less Structural Tools for AI Agents**:
|
|
77
|
+
- `get_file_context`: File skeleton, classified imports (internal vs external), dependents, and recent modifications in a single call.
|
|
78
|
+
- `get_symbol_source`: Surgical extraction of a single symbol/function definition by line range.
|
|
79
|
+
- `get_file_skeleton`: Outline of declarations without function bodies.
|
|
80
|
+
- `search_symbols`: Fast multi-word fuzzy symbol lookup.
|
|
81
|
+
- `trace_symbol`: Definition, callers, callees, and type usages tagged with confidence (`exact`, `probable`, `heuristic`).
|
|
82
|
+
- `get_impact_radius`: Static blast-radius calculation for proposed signature edits before and after code changes.
|
|
83
|
+
- `get_workspace_map`: Structural workspace overview annotated with exported symbols.
|
|
84
|
+
- `query_graph`: Graph querying with structural filters.
|
|
85
|
+
- **Model Context Protocol (MCP)**:
|
|
86
|
+
- Full JSON-RPC 2.0 stdio server (`blast serve`).
|
|
87
|
+
- Compatible with Claude Code, Cursor, Windsurf, Cline, and custom agent loops.
|
|
88
|
+
- **CLI Commands**:
|
|
89
|
+
- `blast index`, `blast map`, `blast stats`, `blast search`, `blast trace`, `blast impact`, `blast watch`.
|