Skip to content

Commit c8409fc

Browse files
Amey Mandalikclaude
andcommitted
chore: rename npm scope to @sf-agentscript and add publish workflow
Migrate all packages from @agentscript/* to @sf-agentscript/* for publishing to the newly acquired npm namespace. Add a GitHub Actions workflow using changesets/action that creates version PRs and publishes to npm on merge. - Rename scope in all package.json files, source imports, and docs - Add publishConfig with public access to all 14 publishable packages - Add .github/workflows/publish.yml (changesets-based publish on main) - Fix changeset baseBranch from "master" to "main" - Regenerate pnpm-lock.yaml Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 342ea6b commit c8409fc

321 files changed

Lines changed: 1127 additions & 1010 deletions

File tree

Some content is hidden

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

.changeset/config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"fixed": [],
66
"linked": [],
77
"access": "public",
8-
"baseBranch": "master",
8+
"baseBranch": "main",
99
"updateInternalDependencies": "patch",
1010
"ignore": [
11-
"@agentscript/docs"
11+
"@sf-agentscript/docs"
1212
]
1313
}

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ jobs:
136136
run: pnpm install --frozen-lockfile
137137

138138
- name: Validate code blocks in docs
139-
run: pnpm --filter @agentscript/docs validate-code-blocks
139+
run: pnpm --filter @sf-agentscript/docs validate-code-blocks
140140
continue-on-error: true
141141

142142
build:

.github/workflows/publish.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Copyright (c) 2026, Salesforce, Inc.
2+
# All rights reserved.
3+
# SPDX-License-Identifier: Apache-2.0
4+
# For full license text, see the LICENSE file in the repo root or https://www.apache.org/licenses/LICENSE-2.0
5+
6+
name: Publish
7+
8+
on:
9+
push:
10+
branches: [main]
11+
12+
concurrency: ${{ github.workflow }}-${{ github.ref }}
13+
14+
env:
15+
TREE_SITTER_VERSION: '0.25.3'
16+
17+
jobs:
18+
publish:
19+
name: Publish to npm
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: write
23+
pull-requests: write
24+
id-token: write
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
28+
29+
- name: Setup pnpm
30+
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
31+
32+
- name: Setup Node.js
33+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
34+
with:
35+
node-version: '22'
36+
cache: 'pnpm'
37+
registry-url: 'https://registry.npmjs.org'
38+
39+
- name: Cache tree-sitter CLI
40+
id: cache-tree-sitter
41+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
42+
with:
43+
path: ~/.local/bin/tree-sitter
44+
key: tree-sitter-${{ env.TREE_SITTER_VERSION }}-linux-x64
45+
46+
- name: Install tree-sitter CLI
47+
if: steps.cache-tree-sitter.outputs.cache-hit != 'true'
48+
run: |
49+
mkdir -p ~/.local/bin
50+
curl -sSL "https://github.com/tree-sitter/tree-sitter/releases/download/v${TREE_SITTER_VERSION}/tree-sitter-linux-x64.gz" \
51+
| gunzip > ~/.local/bin/tree-sitter
52+
chmod +x ~/.local/bin/tree-sitter
53+
54+
- name: Add tree-sitter to PATH
55+
run: echo "$HOME/.local/bin" >> "$GITHUB_PATH"
56+
57+
- name: Install dependencies
58+
run: pnpm install --frozen-lockfile
59+
60+
- name: Build packages
61+
run: pnpm build
62+
63+
- name: Create Release Pull Request or Publish
64+
id: changesets
65+
uses: changesets/action@c8bada60c408975afd1a20b3db81d6eee6789308 # v1
66+
with:
67+
publish: pnpm changeset publish
68+
version: pnpm changeset version
69+
title: 'chore: version packages'
70+
commit: 'chore: version packages'
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
74+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ Opens the AgentScript playground at `http://localhost:27002`.
6060
### Use as a Library
6161

6262
```bash
63-
pnpm add @agentscript/agentforce
63+
pnpm add @sf-agentscript/agentforce
6464
```
6565

6666
```typescript
67-
import { parse } from '@agentscript/agentforce';
67+
import { parse } from '@sf-agentscript/agentforce';
6868

6969
const doc = parse(`
7070
system:
@@ -179,51 +179,51 @@ Each block has a **schema** defined by its dialect. A **dialect** is a collectio
179179

180180
| Package | Description |
181181
| --- | --- |
182-
| [`@agentscript/types`](packages/types/) | Shared types (`SyntaxNode`, `Diagnostic`, `Range`, etc.) used across all packages. Zero dependencies. |
183-
| [`@agentscript/parser-tree-sitter`](packages/parser-tree-sitter/) | Tree-sitter grammar and C parser. Generates Node.js native bindings and WASM for browser use. Zero internal dependencies. Must rebuild after grammar changes. |
184-
| [`@agentscript/parser-javascript`](packages/parser-javascript/) | Hand-written TypeScript parser. Error-tolerant recursive descent with Pratt expression parsing and CST output. Pure JS — no native dependencies. |
185-
| [`@agentscript/parser`](packages/parser/) | Parser abstraction layer. Resolves to `parser-javascript` by default; swap to `parser-tree-sitter` via conditional exports. |
182+
| [`@sf-agentscript/types`](packages/types/) | Shared types (`SyntaxNode`, `Diagnostic`, `Range`, etc.) used across all packages. Zero dependencies. |
183+
| [`@sf-agentscript/parser-tree-sitter`](packages/parser-tree-sitter/) | Tree-sitter grammar and C parser. Generates Node.js native bindings and WASM for browser use. Zero internal dependencies. Must rebuild after grammar changes. |
184+
| [`@sf-agentscript/parser-javascript`](packages/parser-javascript/) | Hand-written TypeScript parser. Error-tolerant recursive descent with Pratt expression parsing and CST output. Pure JS — no native dependencies. |
185+
| [`@sf-agentscript/parser`](packages/parser/) | Parser abstraction layer. Resolves to `parser-javascript` by default; swap to `parser-tree-sitter` via conditional exports. |
186186

187187
### Core Layer
188188

189189
| Package | Description |
190190
| --- | --- |
191-
| [`@agentscript/language`](packages/language/) | Language infrastructure and analysis engine. Provides AST types, scope/symbol resolution, linting framework (18+ passes), and the Language Service API. |
191+
| [`@sf-agentscript/language`](packages/language/) | Language infrastructure and analysis engine. Provides AST types, scope/symbol resolution, linting framework (18+ passes), and the Language Service API. |
192192

193193
### Dialect Layer
194194

195195
| Package | Description |
196196
| --- | --- |
197-
| [`@agentscript/agentscript-dialect`](dialect/agentscript/) | Base dialect — core language schema and lint rules. |
198-
| [`@agentscript/agentforce-dialect`](dialect/agentforce/) | Extends AgentScript with Salesforce Agentforce-specific blocks, fields, and compilation. |
199-
| [`@agentscript/agentfabric-dialect`](dialect/agentfabric/) | AgentFabric dialect — alternative schema, lint rules, and compiler. |
197+
| [`@sf-agentscript/agentscript-dialect`](dialect/agentscript/) | Base dialect — core language schema and lint rules. |
198+
| [`@sf-agentscript/agentforce-dialect`](dialect/agentforce/) | Extends AgentScript with Salesforce Agentforce-specific blocks, fields, and compilation. |
199+
| [`@sf-agentscript/agentfabric-dialect`](dialect/agentfabric/) | AgentFabric dialect — alternative schema, lint rules, and compiler. |
200200

201201
### Compiler
202202

203203
| Package | Description |
204204
| --- | --- |
205-
| [`@agentscript/compiler`](packages/compiler/) | Transforms parsed AgentScript AST into a Salesforce runtime specification with source-map support. |
205+
| [`@sf-agentscript/compiler`](packages/compiler/) | Transforms parsed AgentScript AST into a Salesforce runtime specification with source-map support. |
206206

207207
### SDK
208208

209209
| Package | Description |
210210
| --- | --- |
211-
| [`@agentscript/agentforce`](packages/agentforce/) | Batteries-included SDK. Combines parser, language, compiler, and dialects into a single import. Provides `parse()`, `Document` (with mutation/undo/redo), `parseComponent()`, `emitComponent()`, and `compileSource()`. Works in Node.js and browsers. |
211+
| [`@sf-agentscript/agentforce`](packages/agentforce/) | Batteries-included SDK. Combines parser, language, compiler, and dialects into a single import. Provides `parse()`, `Document` (with mutation/undo/redo), `parseComponent()`, `emitComponent()`, and `compileSource()`. Works in Node.js and browsers. |
212212

213213
### LSP Layer
214214

215215
| Package | Description |
216216
| --- | --- |
217-
| [`@agentscript/lsp`](packages/lsp/) | Dialect-agnostic LSP core. All providers (diagnostics, hover, completions, definition, references, rename, symbols, code actions, semantic tokens) live here. Parser and dialects are injected via config. |
218-
| [`@agentscript/lsp-server`](packages/lsp-server/) | Node.js LSP server. Thin stdio/IPC wrapper over `@agentscript/lsp`. Ships the `agentscript-lsp` CLI. |
219-
| [`@agentscript/lsp-browser`](packages/lsp-browser/) | Browser LSP server. Runs in a Web Worker with the TypeScript parser. Single-bundle output. |
217+
| [`@sf-agentscript/lsp`](packages/lsp/) | Dialect-agnostic LSP core. All providers (diagnostics, hover, completions, definition, references, rename, symbols, code actions, semantic tokens) live here. Parser and dialects are injected via config. |
218+
| [`@sf-agentscript/lsp-server`](packages/lsp-server/) | Node.js LSP server. Thin stdio/IPC wrapper over `@sf-agentscript/lsp`. Ships the `agentscript-lsp` CLI. |
219+
| [`@sf-agentscript/lsp-browser`](packages/lsp-browser/) | Browser LSP server. Runs in a Web Worker with the TypeScript parser. Single-bundle output. |
220220

221221
### Editor Integrations
222222

223223
| Package | Description |
224224
| --- | --- |
225-
| [`@agentscript/vscode`](packages/vscode/) | VS Code extension — syntax highlighting, diagnostics, completions, go-to-definition, rename, and more for `.agent` files. |
226-
| [`@agentscript/monaco`](packages/monaco/) | Monaco Editor integration — language registration, syntax highlighting, hover, and schema resolution. |
225+
| [`@sf-agentscript/vscode`](packages/vscode/) | VS Code extension — syntax highlighting, diagnostics, completions, go-to-definition, rename, and more for `.agent` files. |
226+
| [`@sf-agentscript/monaco`](packages/monaco/) | Monaco Editor integration — language registration, syntax highlighting, hover, and schema resolution. |
227227

228228
### UI Playground
229229

SPEC.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ Namespaces may have aliases — alternative names that resolve to the same scope
290290

291291
#### 4.1 Schema Management
292292

293-
Every block in Agent Script has a schema. Schemas are defined in TypeScript using factory functions from `@agentscript/language`. The schema for a block defines what keys are valid, what types their values must be, and whether fields are required or optional.
293+
Every block in Agent Script has a schema. Schemas are defined in TypeScript using factory functions from `@sf-agentscript/language`. The schema for a block defines what keys are valid, what types their values must be, and whether fields are required or optional.
294294

295295
The core factory functions are:
296296

apps/docs/docs/api/classes/WorkerParserManager.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Clear the crash cooldown (e.g., to force retry)
2828

2929
#### Defined in
3030

31-
[monaco/src/worker-parser.ts:317](https://github.com/salesforce/agentscript/blob/fbe864ab5fc4785e497a92e2c3f6f4575ef8510c/packages/monaco/src/worker-parser.ts#L317)
31+
[worker-parser.ts:317](https://github.com/salesforce/agentscript/blob/342ea6bbf27d5f033735278565b26eae7d72a5cd/packages/monaco/src/worker-parser.ts#L317)
3232

3333
***
3434

@@ -48,7 +48,7 @@ Get parse errors
4848

4949
#### Defined in
5050

51-
[monaco/src/worker-parser.ts:484](https://github.com/salesforce/agentscript/blob/fbe864ab5fc4785e497a92e2c3f6f4575ef8510c/packages/monaco/src/worker-parser.ts#L484)
51+
[worker-parser.ts:484](https://github.com/salesforce/agentscript/blob/342ea6bbf27d5f033735278565b26eae7d72a5cd/packages/monaco/src/worker-parser.ts#L484)
5252

5353
***
5454

@@ -68,7 +68,7 @@ Get syntax highlighting captures
6868

6969
#### Defined in
7070

71-
[monaco/src/worker-parser.ts:415](https://github.com/salesforce/agentscript/blob/fbe864ab5fc4785e497a92e2c3f6f4575ef8510c/packages/monaco/src/worker-parser.ts#L415)
71+
[worker-parser.ts:415](https://github.com/salesforce/agentscript/blob/342ea6bbf27d5f033735278565b26eae7d72a5cd/packages/monaco/src/worker-parser.ts#L415)
7272

7373
***
7474

@@ -84,7 +84,7 @@ Initialize the worker
8484

8585
#### Defined in
8686

87-
[monaco/src/worker-parser.ts:90](https://github.com/salesforce/agentscript/blob/fbe864ab5fc4785e497a92e2c3f6f4575ef8510c/packages/monaco/src/worker-parser.ts#L90)
87+
[worker-parser.ts:90](https://github.com/salesforce/agentscript/blob/342ea6bbf27d5f033735278565b26eae7d72a5cd/packages/monaco/src/worker-parser.ts#L90)
8888

8989
***
9090

@@ -100,7 +100,7 @@ Check if the worker is initialized
100100

101101
#### Defined in
102102

103-
[monaco/src/worker-parser.ts:79](https://github.com/salesforce/agentscript/blob/fbe864ab5fc4785e497a92e2c3f6f4575ef8510c/packages/monaco/src/worker-parser.ts#L79)
103+
[worker-parser.ts:79](https://github.com/salesforce/agentscript/blob/342ea6bbf27d5f033735278565b26eae7d72a5cd/packages/monaco/src/worker-parser.ts#L79)
104104

105105
***
106106

@@ -121,7 +121,7 @@ Uses versioning to skip stale requests - no blocking queue
121121

122122
#### Defined in
123123

124-
[monaco/src/worker-parser.ts:339](https://github.com/salesforce/agentscript/blob/fbe864ab5fc4785e497a92e2c3f6f4575ef8510c/packages/monaco/src/worker-parser.ts#L339)
124+
[worker-parser.ts:339](https://github.com/salesforce/agentscript/blob/342ea6bbf27d5f033735278565b26eae7d72a5cd/packages/monaco/src/worker-parser.ts#L339)
125125

126126
***
127127

@@ -137,7 +137,7 @@ Restart the worker after a crash
137137

138138
#### Defined in
139139

140-
[monaco/src/worker-parser.ts:233](https://github.com/salesforce/agentscript/blob/fbe864ab5fc4785e497a92e2c3f6f4575ef8510c/packages/monaco/src/worker-parser.ts#L233)
140+
[worker-parser.ts:233](https://github.com/salesforce/agentscript/blob/342ea6bbf27d5f033735278565b26eae7d72a5cd/packages/monaco/src/worker-parser.ts#L233)
141141

142142
***
143143

@@ -153,4 +153,4 @@ Terminate the worker
153153

154154
#### Defined in
155155

156-
[monaco/src/worker-parser.ts:553](https://github.com/salesforce/agentscript/blob/fbe864ab5fc4785e497a92e2c3f6f4575ef8510c/packages/monaco/src/worker-parser.ts#L553)
156+
[worker-parser.ts:553](https://github.com/salesforce/agentscript/blob/342ea6bbf27d5f033735278565b26eae7d72a5cd/packages/monaco/src/worker-parser.ts#L553)

apps/docs/docs/api/functions/buildMonacoRules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ Build Monaco theme rules from color definitions.
1818

1919
## Defined in
2020

21-
[monaco/src/theme.ts:85](https://github.com/salesforce/agentscript/blob/fbe864ab5fc4785e497a92e2c3f6f4575ef8510c/packages/monaco/src/theme.ts#L85)
21+
[theme.ts:81](https://github.com/salesforce/agentscript/blob/342ea6bbf27d5f033735278565b26eae7d72a5cd/packages/monaco/src/theme.ts#L81)

apps/docs/docs/api/functions/buildVscodeRules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616

1717
## Defined in
1818

19-
[monaco/src/theme.ts:114](https://github.com/salesforce/agentscript/blob/fbe864ab5fc4785e497a92e2c3f6f4575ef8510c/packages/monaco/src/theme.ts#L114)
19+
[theme.ts:110](https://github.com/salesforce/agentscript/blob/342ea6bbf27d5f033735278565b26eae7d72a5cd/packages/monaco/src/theme.ts#L110)

apps/docs/docs/api/functions/clearCrashCache.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ Call this when the user edits content to allow re-parsing
1515

1616
## Defined in
1717

18-
[monaco/src/parser-api.ts:177](https://github.com/salesforce/agentscript/blob/fbe864ab5fc4785e497a92e2c3f6f4575ef8510c/packages/monaco/src/parser-api.ts#L177)
18+
[parser-api.ts:177](https://github.com/salesforce/agentscript/blob/342ea6bbf27d5f033735278565b26eae7d72a5cd/packages/monaco/src/parser-api.ts#L177)

apps/docs/docs/api/functions/createDiagnosticMarkers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616

1717
## Defined in
1818

19-
[monaco/src/monaco-agentscript.ts:434](https://github.com/salesforce/agentscript/blob/fbe864ab5fc4785e497a92e2c3f6f4575ef8510c/packages/monaco/src/monaco-agentscript.ts#L434)
19+
[monaco-agentscript.ts:434](https://github.com/salesforce/agentscript/blob/342ea6bbf27d5f033735278565b26eae7d72a5cd/packages/monaco/src/monaco-agentscript.ts#L434)

0 commit comments

Comments
 (0)