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
Commit 9f61247
Browse filesBrowse the repository at this point in the historyBrowse files
fix(skills): serve agent-bundle/meta to rendered skills and compile their JSX without the consumer react runtime (#527)
* fix(skills): serve agent-bundle/meta to rendered skills and compile their JSX against the loader's element factory
Rendered SKILL.tsx modules evaluate through jiti during discovery, outside the
compiler's specifier replacement, so 'agent-bundle/meta' fell through to the
published module and threw AB4760 inside AB3003 (#440). The loader now aliases
the specifier to the same generated identity module the build stamps, fed from
one pluginIdentity() derivation normalization also uses for model.metadata.
The skill's JSX compiled against the consumer's react/jsx-runtime, which jiti
resolves without the process's --conditions while React's own inner
require('react') honours them; under the route-unit pool's react-server
condition the client jsx runtime met the server React and threw
(recentlyCreatedOwnerStacks) so inspectWorkbenchSurface failed with AB3005
(#441). The loader now aliases react/jsx-runtime and react/jsx-dev-runtime to
its own plain element factory: the Markdown renderer never needed React.
Fixes#440Fixes#441
* chore: reference PR number in changeset
* fix(config): keep a malformed plugin block the validator's AB4000 when discovery derives the skill identity
Review: discovery dereferenced config.plugin.name before validateSource ran,
turning {} or plugin: null into a generic AB7000. declaredPluginIdentity()
returns undefined for an unusable plugin.name; the rendered skill then gets
no identity (AB3003) and validation reports AB4000 as before.
Let a rendered Skill (`src/skills/<name>/SKILL.tsx`) import `agent-bundle/meta` and evaluate independently of the process's `react` resolution. The skill loader now aliases `agent-bundle/meta` to the same generated identity module the compiler stamps into every built surface — `{ name, packageName, packageVersion, version }` derived from `plugin.name`, `package.json`, and the resolved plugin version — under `validate`, `build`, `inspect`, dev, the Workbench's source Skill documents, and `inspectWorkbenchSurface`, instead of failing with `AB3003` wrapping `AB4760`. The skill's JSX compiles against the loader's own element factory rather than the project's `react/jsx-runtime`, so `inspectWorkbenchSurface` no longer fails with `AB3005` (`recentlyCreatedOwnerStacks`) on a project with a rendered skill when the test runs under the `react-server` condition the `agentBundleRstest()` route-unit pool sets. Fixes #440 and #441 (#527)
Copy file name to clipboardExpand all lines: docs/diagnostics.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -439,6 +439,15 @@ aliased module throws the same `AB4760` naming the compiler diagnostics and
439
439
the recovery "fix them, then rerun Rstest" — the manifest's placeholder
440
440
identity is never served as a real one.
441
441
442
+
Rendered skills (`src/skills/<name>/SKILL.tsx`) evaluate during discovery,
443
+
and the skill loader aliases the specifier to the same generated module fed
444
+
from the identity normalization stamps into the model, so a skill importing
445
+
`agent-bundle/meta` compiles under `validate`, `build`, `inspect`, dev, and
446
+
`inspectWorkbenchSurface` (#440). Only a direct `parseSkill` call without a
447
+
project identity leaves the specifier to resolve as the project resolves
448
+
`agent-bundle`; the published module then raises this diagnostic inside the
449
+
skill's `AB3003`.
450
+
442
451
| Code | Severity | Trigger | Recovery |
443
452
| --- | --- | --- | --- |
444
453
|`AB4760`| error | A module evaluated the published `agent-bundle/meta` outside a surface Agent Bundle compiles — typically a unit test pool not built from the Rstest preset, or a hand-run script importing plugin source. | Run the test under `agentBundleRstest()` or `agentBundleBrowserRstest()` from `agent-bundle/rstest` (pass `include` to cover a plain unit pool), or compile the surface with `agent-bundle build`. In a custom test runner, alias `agent-bundle/meta` (`resolve.alias`, exact match) to a module with the named exports `{ name, packageName, packageVersion, version, meta }` — `meta` the frozen object of the other four, exported as both the named binding and the default export — computed from the project's `agent-bundle.config.ts` plugin name and `package.json` version; the `.agent-bundle/test/meta.mjs` module `agentBundleRstest()` writes is that module. |
0 commit comments