Skip to content

Switch to wasm modules for TS#1

Merged
FeiyouG merged 7 commits intomainfrom
dev/wasm
Feb 19, 2026
Merged

Switch to wasm modules for TS#1
FeiyouG merged 7 commits intomainfrom
dev/wasm

Conversation

@FeiyouG
Copy link
Copy Markdown
Owner

@FeiyouG FeiyouG commented Feb 18, 2026

  • Switch from .node to wasm TS modules
  • Added support for configuration files
  • Supported Sarif output

Replaced @ast-grep/napi and native .so sidecars with a fully WASM based architecture using @ast-grep/wasm and web-tree-sitter grammars.

- Core changes
  - Single cross platform binary,
    no wrapper script,
    no resources/ast-grep directory
  - Grammars are downloaded on first use to XDG cache ~/.cache/skill-lab/grammars/
  - Introduced a shared grammar registry at treesitter/registry.ts
    used by both AstGrepClient and TreesitterClient
- Analyzer updates
  - AstGrepClient
    - Async lazy initialization using Approach B
    - Uses @ast-grep/wasm from pinned vendor build
  - TreesitterClient
    - Uses web-tree-sitter 0.25.4 WASM
    - Loads grammars via Parser.Language.load(wasmPath)
- Build and CI
  - scripts/setup_wasm.ts
  - Builds @ast-grep/wasm from the ast-grep wasm branch
- Documentation
  - Added docs/development/wasm-build.md
  - Added docs/cli/configuration.md
  - Updated CONTRIBUTING.md
  - Documented Rust and wasm-pack prerequisites
  - Documented deno task setup step
- Add @deno-library/progress and @logtape/logtape to analyzer and CLI packages
- Add AnalyzerLogger/AnalyzerLogLevel types; thread logger+logLevel through runAnalysis and AnalyzerContext
- Step 001: MultiProgressBar with spinner row + grammar download row (coordinated, no clobbering)
- Step 002: determinate scan bar per file processed
- Step 003: determinate finalizing bar per finding processed
- Grammar download: onDownloadProgress callback for coordinated rendering during step 001; standalone ProgressBar fallback for step 002 cache misses
- CLI --verbose/--warn/--silence flags; logtape configured to stderr with clean minimal format (no timestamp/category)
- Exit codes: safe=0, caution/attention/risky=1, avoid=2
- Fix log message 'undefined' bug: inline lang directly in string rather than passing props object
…lass

- Introduce SkillAnalyzerResult wrapping AnalyzerState directly,
  exposing toString(), toJson(), and async toSarif(toolVersion) methods.
- Remove the plain AnalyzerResult type and delete the separate output.ts formatter.
- Add --sarif flag to `slab analyze`;
  all output modes (default, --json, --sarif) now exit 0.
- Log level is suppressed to warn for --json/--sarif.
@FeiyouG FeiyouG merged commit c19bae7 into main Feb 19, 2026
12 checks passed
@FeiyouG FeiyouG deleted the dev/wasm branch February 19, 2026 08:48
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.

1 participant