Skip to content

Commit 961256f

Browse files
jlantzclaude
andauthored
Prepare 0.0.2 Release: sf agency enhancements, parser fixes and 10x faster parsing (#25)
This pull request introduces significant improvements and restructuring to the CI and release workflows, along with the addition of a comprehensive `CHANGELOG.md`. The changes focus on streamlining build and release processes, improving multi-platform support, and making publishing to npm and other registries more robust and consistent. **Salesforce CLI Plugin Enhancements** - New commands `agents list` and `agents select` for filtering which agents get scanned - New commands `impact` and `paths - `query` command changed to path based queries or dot for direct AST querying **Rust Parser and Graph Enhancements** - 10x faster, benches ~5.9MB/s for single files, faster in parallel - Added support for object variables - Added support for `...` placeholder values **CI Workflow Enhancements:** * Added dedicated build jobs for the SF plugin (`sf-plugin-build`) and Zed extension (`zed-build`), enabling targeted builds for these components with proper WASM and Node.js environment setup. [[1]](diffhunk://#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03fR135-R177) [[2]](diffhunk://#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03fR195-R210) * Removed the umbrella test job and updated dependencies for coverage and completion jobs to reflect the new build structure. [[1]](diffhunk://#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03fL69-L80) [[2]](diffhunk://#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03fL130-R118) [[3]](diffhunk://#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03fL190-R244) **Release Workflow Improvements:** * Unified and simplified WASM build jobs, replacing separate parser and graph builds with a single job, and introduced a Zed extension build job for release artifacts. * Improved npm publishing logic to support pre-releases and stable releases, including dynamic npm tags and waiting for WASM package availability before publishing the SF plugin. [[1]](diffhunk://#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34L6-R11) F4f30113L29R29, [[2]](diffhunk://#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34L42-R74) [[3]](diffhunk://#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34L270-R352) * Updated platform matrix and build steps for LSP and VS Code extension packaging, removing unused targets and switching to the correct marketplace token. [[1]](diffhunk://#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34L81-L93) [[2]](diffhunk://#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34L104-L112) [[3]](diffhunk://#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34L194-L199) [[4]](diffhunk://#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34L244-R251) **Documentation:** * Added a new `CHANGELOG.md` following Keep a Changelog and Semantic Versioning, documenting all notable changes, new features, and API adjustments across releases. **Other Notable Changes:** * Improved artifact packaging for releases, including zipped WASM and Zed extension artifacts. * Renamed jobs and commands for clarity and consistency, e.g., tree-sitter npm publish and SF plugin npm publish. These updates provide a more maintainable and extensible workflow for building, testing, and releasing all components of the project. --- **References:** [[1]](diffhunk://#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03fR135-R177) [[2]](diffhunk://#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03fR195-R210) [[3]](diffhunk://#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03fL69-L80) [[4]](diffhunk://#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03fL130-R118) [[5]](diffhunk://#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03fL190-R244) [[6]](diffhunk://#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34L139-R193) [[7]](diffhunk://#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34L6-R11) F4f30113L29R29, [[8]](diffhunk://#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34L42-R74) [[9]](diffhunk://#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34L270-R352) [[10]](diffhunk://#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34L81-L93) [[11]](diffhunk://#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34L104-L112) [[12]](diffhunk://#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34L194-L199) [[13]](diffhunk://#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34L244-R251) [[14]](diffhunk://#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4edR1-R71) [[15]](diffhunk://#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34L296-R369) [[16]](diffhunk://#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34L254-R261) --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 60255d6 commit 961256f

83 files changed

Lines changed: 18361 additions & 1489 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,24 +153,28 @@ jobs:
153153
cargo install wasm-bindgen-cli --version "$VERSION" --locked
154154
- name: Build WASM package
155155
run: |
156+
WASM_VERSION=$(grep '^version' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
156157
cargo build --lib --release --target wasm32-unknown-unknown --features wasm,graph
157158
mkdir -p pkg
158159
wasm-bindgen --target web --out-dir pkg \
159160
target/wasm32-unknown-unknown/release/busbar_sf_agentscript.wasm
160161
node -e "
161162
const fs = require('fs');
162163
fs.writeFileSync('pkg/package.json', JSON.stringify({
163-
name: 'busbar-sf-agentscript',
164-
version: '0.0.1',
164+
name: '@muselab/busbar-sf-agentscript',
165+
version: '$WASM_VERSION',
165166
files: ['busbar_sf_agentscript_bg.wasm','busbar_sf_agentscript.js','busbar_sf_agentscript.d.ts','busbar_sf_agentscript_bg.wasm.d.ts'],
166167
main: 'busbar_sf_agentscript.js',
167168
types: 'busbar_sf_agentscript.d.ts',
168169
sideEffects: false
169170
}, null, 2));
170171
"
171172
- name: Install plugin dependencies
172-
working-directory: plugin-agency/
173-
run: npm install
173+
run: |
174+
# Link the locally built WASM into npm's global registry so
175+
# plugin-agency can install it by name+version without modifying package.json
176+
(cd pkg && npm link)
177+
(cd plugin-agency && npm link @muselab/busbar-sf-agentscript && npm install)
174178
- name: Build SF plugin
175179
working-directory: plugin-agency/
176180
run: npm run build

.github/workflows/release.yml

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ name: Release
33
on:
44
push:
55
tags:
6-
- "v[0-9]+.[0-9]+.[0-9]+"
6+
- "v[0-9]+.[0-9]+.[0-9]+" # stable: v0.1.0
7+
- "v[0-9]+.[0-9]+.[0-9]+-*" # pre-release: v0.1.0-beta.3
78
workflow_dispatch:
89
inputs:
910
tag:
10-
description: "Tag to release (e.g. v0.0.1)"
11+
description: "Tag to release (e.g. v0.0.1 or v0.0.1-beta.3)"
1112
required: false
1213

1314
concurrency:
@@ -28,6 +29,8 @@ jobs:
2829
runs-on: ubuntu-latest
2930
outputs:
3031
version: ${{ steps.version.outputs.version }}
32+
is_prerelease: ${{ steps.version.outputs.is_prerelease }}
33+
npm_tag: ${{ steps.version.outputs.npm_tag }}
3134
steps:
3235
- uses: actions/checkout@v4
3336
- name: Extract version
@@ -39,12 +42,22 @@ jobs:
3942
fi
4043
VERSION="${TAG#v}"
4144
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
42-
echo "Releasing version $VERSION"
45+
if [[ "$VERSION" == *-* ]]; then
46+
echo "is_prerelease=true" >> "$GITHUB_OUTPUT"
47+
NPM_TAG="${VERSION#*-}" # e.g. beta.3
48+
NPM_TAG="${NPM_TAG%%.*}" # e.g. beta
49+
echo "npm_tag=$NPM_TAG" >> "$GITHUB_OUTPUT"
50+
else
51+
echo "is_prerelease=false" >> "$GITHUB_OUTPUT"
52+
echo "npm_tag=latest" >> "$GITHUB_OUTPUT"
53+
fi
54+
echo "Releasing version $VERSION (npm tag: ${NPM_TAG:-latest})"
4355
4456
publish-crates:
4557
name: Publish crates to crates.io
4658
runs-on: ubuntu-latest
4759
needs: [validate]
60+
if: needs.validate.outputs.is_prerelease == 'false'
4861
steps:
4962
- uses: actions/checkout@v4
5063
with:
@@ -166,7 +179,7 @@ jobs:
166179
node -e "
167180
const fs = require('fs');
168181
fs.writeFileSync('dist/wasm/package.json', JSON.stringify({
169-
name: 'busbar-sf-agentscript',
182+
name: '@muselab/busbar-sf-agentscript',
170183
version: '${{ needs.validate.outputs.version }}',
171184
files: ['busbar_sf_agentscript_bg.wasm','busbar_sf_agentscript.js','busbar_sf_agentscript.d.ts','busbar_sf_agentscript_bg.wasm.d.ts'],
172185
main: 'busbar_sf_agentscript.js',
@@ -261,9 +274,7 @@ jobs:
261274
cache-dependency-path: tree-sitter-agentscript/package-lock.json
262275
- run: npm ci
263276
- run: npm run build
264-
- run: npm publish --access public
265-
env:
266-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
277+
- run: npm publish --access public --tag ${{ needs.validate.outputs.npm_tag }}
267278

268279
publish-wasm-npm:
269280
name: Publish WASM to npm
@@ -281,9 +292,7 @@ jobs:
281292
path: dist/wasm/
282293
- name: Publish to npm
283294
working-directory: dist/wasm/
284-
run: npm publish --access public
285-
env:
286-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
295+
run: npm publish --access public --tag ${{ needs.validate.outputs.npm_tag }}
287296

288297
publish-sf-plugin-npm:
289298
name: Publish SF plugin to npm
@@ -304,32 +313,30 @@ jobs:
304313
timeout=120
305314
interval=5
306315
elapsed=0
307-
until npm view busbar-sf-agentscript@$VERSION version 2>/dev/null; do
316+
until npm view @muselab/busbar-sf-agentscript@$VERSION version 2>/dev/null; do
308317
if [ $elapsed -ge $timeout ]; then
309-
echo "Timed out waiting for busbar-sf-agentscript@$VERSION on npm"
318+
echo "Timed out waiting for @muselab/busbar-sf-agentscript@$VERSION on npm"
310319
exit 1
311320
fi
312-
echo "Waiting for busbar-sf-agentscript@$VERSION... (${elapsed}s / ${timeout}s)"
321+
echo "Waiting for @muselab/busbar-sf-agentscript@$VERSION... (${elapsed}s / ${timeout}s)"
313322
sleep $interval
314323
elapsed=$((elapsed + interval))
315324
done
316-
echo "busbar-sf-agentscript@$VERSION is available"
325+
echo "@muselab/busbar-sf-agentscript@$VERSION is available"
317326
- name: Update WASM dependency to published npm version
318327
run: |
319328
node -e "
320329
const fs = require('fs');
321330
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
322-
pkg.dependencies['busbar-sf-agentscript'] = '${{ needs.validate.outputs.version }}';
331+
pkg.dependencies['@muselab/busbar-sf-agentscript'] = '${{ needs.validate.outputs.version }}';
323332
fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n');
324333
"
325334
- name: Install dependencies
326335
run: npm install
327336
- name: Build
328337
run: npm run build
329338
- name: Publish to npm
330-
run: npm publish --access public
331-
env:
332-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
339+
run: npm publish --access public --tag ${{ needs.validate.outputs.npm_tag }}
333340

334341
github-release:
335342
name: Create GitHub Release

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ node_modules/
1313
build/
1414
*.wasm
1515

16+
# Reports
17+
agents-report.html
18+
1619
# macOS
1720
.DS_Store
1821

CHANGELOG.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). This project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
---
8+
9+
## [0.0.2] — 2026-03-02
10+
11+
### SF CLI Plugin (`@muselab/sf-plugin-busbar-agency`)
12+
13+
#### Added
14+
- **`sf agency agents list`** — List all `.agent` files in a directory with their parsed agent names and current selection state.
15+
- **`sf agency agents select`** — Interactively select (or `--all` / `--none`) which agent files subsequent commands should target. Selection is persisted and used automatically by all commands.
16+
- **Multi-file support for all commands** — Every command now accepts `--path <dir>` (recursive `.agent` scan) in addition to `--file`. A saved agent selection (from `sf agency agents select`) is used automatically when neither flag is provided.
17+
- **`file` field in JSON output** — When running against multiple files, every result object now includes a `file` field so consumers can identify which agent file each result came from.
18+
- **`sf agency deps --group dependency`** — New `--group` flag (`file` | `dependency`). `--group dependency` inverts the view: instead of deps per agent, shows each unique dependency with the list of agent files that use it.
19+
- **`sf agency query <path>` unified command** — Replaces the three separate `sf agency query topic`, `sf agency query variable`, and `sf agency query action` subcommands with a single path-based interface:
20+
- `/topics/<name>` — incoming references and outgoing transitions for a topic
21+
- `/variables/<name>` — readers and writers for a variable
22+
- `/actions/<name>` — action definition and the reasoning steps that invoke it
23+
- `dot.notation.path` — raw AST traversal (unchanged)
24+
25+
#### Changed
26+
- `sf agency parse` JSON output is now `{ file, ast }` instead of the raw AST object, so the source file is always identifiable.
27+
- `sf agency impact` flag renamed: `--dir``--path` for consistency with other commands.
28+
- `sf agency query` now uses a positional argument for the query path instead of `--path`, and `--path` is now the directory scan flag (consistent with all other commands).
29+
30+
#### Removed
31+
- `sf agency query topic <name>` subcommand (use `sf agency query /topics/<name>`)
32+
- `sf agency query variable <name>` subcommand (use `sf agency query /variables/<name>`)
33+
- `sf agency query action <name>` subcommand (use `sf agency query /actions/<name>`)
34+
35+
#### Docs
36+
- Rewrote `plugin-agency/README.md` to focus entirely on the SF CLI plugin with a full command reference.
37+
- Added `plugin-agency/CONTRIBUTING.md` covering local build setup, linking to `sf` CLI, and conventions for adding new commands.
38+
39+
---
40+
41+
## [0.0.1-beta.3] — 2025-12-01
42+
43+
### SF CLI Plugin
44+
45+
#### Added
46+
- `sf agency graph` — ASCII, GraphML, Mermaid, and HTML topic flow graph export with optional `--stats`.
47+
- `sf agency paths` — DFS enumeration of all execution paths through the topic graph, with cycle detection.
48+
- `sf agency impact` — Scan a directory for agents that depend on a specific Salesforce resource.
49+
- `sf agency deps --retrieve` — Retrieve dependent metadata from a target org after extracting dependencies.
50+
- `sf agency query topic`, `sf agency query variable`, `sf agency query action` — Semantic queries for specific AST constructs.
51+
52+
### Core Parser (`busbar-sf-agentscript`)
53+
54+
#### Added
55+
- WASM build published to npm as `@muselab/busbar-sf-agentscript`.
56+
- Graph analysis functions: `export_graph_json`, `export_graphml`, `render_graph`, `get_graph_stats`.
57+
- Semantic query functions: `find_topic_usages`, `find_topic_transitions`, `find_variable_usages`.
58+
- Dependency extraction: `extract_dependencies`.
59+
60+
---
61+
62+
## [0.0.1] — 2025-11-01
63+
64+
Initial public release.
65+
66+
### Added
67+
- AgentScript parser (Rust + WASM).
68+
- `sf agency parse`, `sf agency validate`, `sf agency list`, `sf agency query`, `sf agency actions`, `sf agency deps`.
69+
- VS Code extension with syntax highlighting and real-time diagnostics.
70+
- LSP server for Neovim, Helix, and other editors.
71+
- Tree-sitter grammar (`@muselab/tree-sitter-agentscript`).

Cargo.lock

Lines changed: 25 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)