You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[bug]: @sf-agentscript/[email protected] (latest) still unusable — dist/ compiled against a newer @sf-agentscript/language than package.json pins (missing export nullLiteralValidationPass) #71
@sf-agentscript/[email protected] (current latest) cannot be imported after a clean npm install. The package's dist/ is compiled against a newer @sf-agentscript/language than the version its own package.json pins, so the import fails immediately.
This looks like a sibling of #35 (and PR #40): the scope-rewrite part appears fixed in 2.5.34 — dist/index.js now correctly imports from @sf-agentscript/language — but the same publish pipeline still emits dependency pins that don't match what dist/ was built against. Net effect is the same: the published package is broken end-to-end, just with a different error.
SyntaxError: The requested module '@sf-agentscript/language' does not provide
an export named 'nullLiteralValidationPass'
at .../node_modules/@sf-agentscript/agentforce/dist/index.js:354
So the compiled output requires a newer language than the manifest allows. Installing @sf-agentscript/[email protected] alongside it makes the import succeed, which confirms the diagnosis.
Workaround for anyone blocked: @sf-agentscript/parser is unaffected and can be used directly if you only need the AST — that is what I ended up doing. I am building a static authority analyzer that reads .agent authoring bundles and resolves each action's apex:// / flow:// target straight from the file.
Happy to send a PR for the smoke test if that approach is acceptable.
Two updates: a correction to my own report, and a wider impact — it is not just agentforce.
Correction
This line in the issue is wrong, and I should not have written it without testing it:
Installing @sf-agentscript/[email protected] alongside it makes the import succeed, which confirms the diagnosis.
It does not. Because the pin is exact ("2.5.4"), npm nests that copy under the dependent, and the nested copy wins regardless of what is hoisted at the top:
import still fails with the same SyntaxError. I had only verified that [email protected]contains the symbol and inferred the rest. Apologies — the diagnosis below is what I actually reproduced.
The fix, verified
Forcing @sf-agentscript/[email protected] across the whole tree (npm overrides) does fix it:
The important consequence: the pin has to be corrected in every dependent, not just one. A partial bump only moves the error to the next package that still pins 2.5.4.
Wider impact: 3 public packages are broken, one root cause
I installed every publicly importable @sf-agentscript/* package from npm into a clean directory and did a bare import of each default entry point.
With language overridden to 2.18.0 across the tree:agentforce, compiler and lsp all import cleanly.
(@sf-agentscript/lsp-server is excluded from the table: with the stale pin it fails inside compiler, but once that is fixed a bare import throws Connection input stream is not set… — that is the server entry doing its job, not a packaging defect. Worth knowing for anyone writing an import check: it needs to be skipped or invoked with --stdio.)
agentforce fails at link time (missing named export); compiler fails at runtime the moment the module body calls .variantMatch(), which takes lsp (and lsp-server) down with it.
Inside the repo none of this is visible: packages/*/package.json correctly use workspace:*, and the workspace language is 2.18.0 and does export both symbols. The mismatch only exists in the published artifact — a language release that added API without a matching version bump for the dependents packed against it.
Why a guard, not just a bump
Bumping the pins fixes today. But this is the second release to ship an artifact that cannot be imported (#35 was the first, for a different reason in the same pipeline), and unit tests cannot see it: inside the workspace pnpm resolves siblings from source, so the packed manifest is never exercised.
One check catches the whole class: pack the packages, install the tarballs into a clean directory the way a consumer does, and import each public entry point. It fails loudly on ERR_MODULE_NOT_FOUND (#35), on a missing named export, and on a runtime TypeError from a stale sibling — i.e. on everything above.
I'm putting that together as a publish-time gate in scripts/publish.mjs (after the scope rewrite, before changeset publish) and will open a PR. Two notes I ran into while building it, in case you have a preference: it has to run after the rewrite (before it, the tarballs still reference the unpublished @agentscript/* scope), and it needs a documented skip for entries that are not bare-importable by design (lsp-server, monaco's TS source entry, the native parser-tree-sitter binding, browser bundles).
Resolved in the current releases. A fresh npm install @sf-agentscript/agentforce (2.16.1) gets dependency pins that match what dist/ was built against ([email protected], [email protected], [email protected]), and import { parse } from '@sf-agentscript/agentforce' works. Thanks for the report and the follow-up correction.
Activity
aksumustafa1625 commentedon Jul 14, 2026
Two updates: a correction to my own report, and a wider impact — it is not just
agentforce.Correction
This line in the issue is wrong, and I should not have written it without testing it:
It does not. Because the pin is exact (
"2.5.4"), npm nests that copy under the dependent, and the nested copy wins regardless of what is hoisted at the top:importstill fails with the sameSyntaxError. I had only verified that[email protected]contains the symbol and inferred the rest. Apologies — the diagnosis below is what I actually reproduced.The fix, verified
Forcing
@sf-agentscript/[email protected]across the whole tree (npmoverrides) does fix it:{ "dependencies": { "@sf-agentscript/agentforce": "2.5.34" }, "overrides": { "@sf-agentscript/language": "2.18.0" } }→
import('@sf-agentscript/agentforce')succeeds.The important consequence: the pin has to be corrected in every dependent, not just one. A partial bump only moves the error to the next package that still pins
2.5.4.Wider impact: 3 public packages are broken, one root cause
I installed every publicly importable
@sf-agentscript/*package from npm into a clean directory and did a bareimportof each default entry point.As published today:
latest)import@sf-agentscript/[email protected]SyntaxError: ... does not provide an export named 'nullLiteralValidationPass'@sf-agentscript/[email protected]TypeError: NamedBlock(...).describe(...).discriminant(...).variant(...).variantMatch is not a function@sf-agentscript/[email protected]TypeError(viacompiler)@sf-agentscript/[email protected]@sf-agentscript/[email protected]@sf-agentscript/[email protected]@sf-agentscript/[email protected]With
languageoverridden to2.18.0across the tree:agentforce,compilerandlspall import cleanly.(
@sf-agentscript/lsp-serveris excluded from the table: with the stale pin it fails insidecompiler, but once that is fixed a bareimportthrowsConnection input stream is not set…— that is the server entry doing its job, not a packaging defect. Worth knowing for anyone writing an import check: it needs to be skipped or invoked with--stdio.)Root cause (same for all three)
[email protected],[email protected]and[email protected]each pin:but their
dist/is compiled against a newerlanguage. Both missing symbols are defined inpackages/language/src:nullLiteralValidationPass—[email protected]exports it: no (2.18.0: yes)variantMatch— occurrences in[email protected]dist/: 0agentforcefails at link time (missing named export);compilerfails at runtime the moment the module body calls.variantMatch(), which takeslsp(andlsp-server) down with it.Inside the repo none of this is visible:
packages/*/package.jsoncorrectly useworkspace:*, and the workspacelanguageis2.18.0and does export both symbols. The mismatch only exists in the published artifact — alanguagerelease that added API without a matching version bump for the dependents packed against it.Why a guard, not just a bump
Bumping the pins fixes today. But this is the second release to ship an artifact that cannot be imported (#35 was the first, for a different reason in the same pipeline), and unit tests cannot see it: inside the workspace pnpm resolves siblings from source, so the packed manifest is never exercised.
One check catches the whole class: pack the packages, install the tarballs into a clean directory the way a consumer does, and
importeach public entry point. It fails loudly onERR_MODULE_NOT_FOUND(#35), on a missing named export, and on a runtimeTypeErrorfrom a stale sibling — i.e. on everything above.I'm putting that together as a publish-time gate in
scripts/publish.mjs(after the scope rewrite, beforechangeset publish) and will open a PR. Two notes I ran into while building it, in case you have a preference: it has to run after the rewrite (before it, the tarballs still reference the unpublished@agentscript/*scope), and it needs a documented skip for entries that are not bare-importable by design (lsp-server,monaco's TS source entry, the nativeparser-tree-sitterbinding, browser bundles).ci(publish): fail the release if a published package cannot be imported
setu4993 commentedon Nov 14, 2026
Resolved in the current releases. A fresh
npm install @sf-agentscript/agentforce(2.16.1) gets dependency pins that match whatdist/was built against ([email protected],[email protected],[email protected]), andimport { parse } from '@sf-agentscript/agentforce'works. Thanks for the report and the follow-up correction.