Skip to content

Docs: prototype generated plugin SDK reference#51877

Merged
vincentkoc merged 9 commits intoopenclaw:mainfrom
osolmaz:docs/plugin-sdk-generated-reference-recovery
Mar 22, 2026
Merged

Docs: prototype generated plugin SDK reference#51877
vincentkoc merged 9 commits intoopenclaw:mainfrom
osolmaz:docs/plugin-sdk-generated-reference-recovery

Conversation

@dutifulbob
Copy link
Copy Markdown
Contributor

Summary

  • preserve the existing plugin SDK docs plan and phase 1 scaffold on a dedicated branch after the earlier PR was closed
  • add a TypeScript-driven generator for curated plugin SDK module reference pages
  • check in the generated module pages plus the generated model and manifest artifacts

Validation

  • node --import tsx scripts/generate-plugin-sdk-docs.ts --check
  • pnpm check:docs

Notes

  • replacement for Docs: scaffold plugin SDK reference phase 1 #51700
  • the repo commit hook on latest main still hits the existing unrelated boundary failure in extensions/openai/media-understanding-provider.ts and extensions/openai/openai-codex-provider.ts, so the final preservation commit was created with --no-verify after the scoped docs checks above passed

@openclaw-barnacle openclaw-barnacle bot added docs Improvements or additions to documentation scripts Repository scripts size: XL labels Mar 21, 2026
@vincentkoc vincentkoc force-pushed the docs/plugin-sdk-generated-reference-recovery branch from 4a1b0c8 to 647eb8a Compare March 22, 2026 16:15
@vincentkoc vincentkoc marked this pull request as ready for review March 22, 2026 16:18
@vincentkoc vincentkoc merged commit 4f1e12a into openclaw:main Mar 22, 2026
39 of 40 checks passed
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 22, 2026

Greptile Summary

This PR establishes a TypeScript-driven generator (src/plugin-sdk/api-baseline.ts) that introspects the curated plugin SDK modules, serialises their public export surface to JSON and JSONL baseline artifacts under docs/.generated/, and wires a drift-check gate (pnpm plugin-sdk:api:check) into the CI pipeline and release checks — following the same pattern already used for config-schema drift.

  • CI and workflow-sanity jobs are extended cleanly, mirroring the config:docs:check pattern with consistent outcome-gating.
  • AGENTS.md guidance is concise and correctly points agents to the two command pairs.
  • Minor logic issue (generator): resolveSymbolAndDeclaration always resolves through re-export aliases to the original symbol, so printNode renders declarations using the underlying type name rather than the exported alias name. This causes the ClawdbotConfig baseline entry to show "declaration": "export type OpenClawConfig = OpenClawConfig;" — indistinguishable from the OpenClawConfig entry and tautological-looking. For pure drift detection the check still triggers on underlying type changes, but the artifact is misleading if consumed by downstream tooling or humans. Threading the public export name into printNode for type aliases would fix this.
  • Minor style issue (error message): Both lines of the --check failure message use the same "Expected current:" prefix; distinguishing them (e.g. "JSON path:" / "Statefile path:") would improve debuggability.
  • The PR notes the use of --no-verify for the final commit due to a pre-existing, unrelated hook failure on main in extensions/openai/. The author explicitly discloses this and scoped docs checks passed, which is consistent with the stated AGENTS.md policy for pre-existing unrelated failures.

Confidence Score: 4/5

  • Safe to merge; the drift-detection infrastructure works correctly and the alias-name issue is non-blocking for the baseline's primary purpose.
  • The PR delivers working drift-detection infrastructure that mirrors an established pattern. The ClawdbotConfig declaration mismatch is a real logic issue in the generator that produces misleading output in the baseline artifact, but it doesn't break the drift check itself (underlying type changes are still detected). Resolving it before using this baseline as input to human-facing docs would be advisable. The duplicate error-message prefix is purely cosmetic. No security, data-loss, or primary-path reliability concerns.
  • Pay close attention to src/plugin-sdk/api-baseline.ts — specifically the alias-resolution path in resolveSymbolAndDeclaration / printNode and the resulting ClawdbotConfig entry in the generated baseline.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: scripts/generate-plugin-sdk-api-baseline.ts
Line: 26-27

Comment:
**Duplicate "Expected current:" label in drift error**

Both lines of the drift-detected error message use the same `Expected current:` prefix, which makes the diagnostic harder to read when both file paths are shown.

```suggestion
        `JSON path:       ${path.relative(repoRoot, result.jsonPath)}`,
        `Statefile path:  ${path.relative(repoRoot, result.statefilePath)}`,
```

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: docs/.generated/plugin-sdk-api-baseline.json
Line: 344-350

Comment:
**Re-export alias shows wrong name in `declaration` field**

The `ClawdbotConfig` export entry has `exportName: "ClawdbotConfig"` but its `declaration` field reads `"export type OpenClawConfig = OpenClawConfig;"` — showing the underlying type's name instead of the alias name. Both `ClawdbotConfig` and `OpenClawConfig` end up with identical `declaration` strings, which is misleading.

This is caused by the generator in `src/plugin-sdk/api-baseline.ts`: `resolveSymbolAndDeclaration` resolves through the alias to the original `OpenClawConfig` symbol, and `printNode` then uses `declaration.name.text` (which is `"OpenClawConfig"`) rather than the public export name (`"ClawdbotConfig"`).

For the drift-detection use-case the check will still fire when the underlying type changes, but anyone reading the baseline (or building tooling on top of it) will see a confusing tautological declaration for `ClawdbotConfig`. Consider threading the `symbol.getName()` value through to `printNode` so that re-export aliases render as `export type ClawdbotConfig = OpenClawConfig;` instead.

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "Merge branch 'main' into docs/plugin-sdk..." | Re-trigger Greptile

Comment on lines +26 to +27
"Plugin SDK API baseline drift detected.",
`Expected current: ${path.relative(repoRoot, result.jsonPath)}`,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Duplicate "Expected current:" label in drift error

Both lines of the drift-detected error message use the same Expected current: prefix, which makes the diagnostic harder to read when both file paths are shown.

Suggested change
"Plugin SDK API baseline drift detected.",
`Expected current: ${path.relative(repoRoot, result.jsonPath)}`,
`JSON path: ${path.relative(repoRoot, result.jsonPath)}`,
`Statefile path: ${path.relative(repoRoot, result.statefilePath)}`,
Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/generate-plugin-sdk-api-baseline.ts
Line: 26-27

Comment:
**Duplicate "Expected current:" label in drift error**

Both lines of the drift-detected error message use the same `Expected current:` prefix, which makes the diagnostic harder to read when both file paths are shown.

```suggestion
        `JSON path:       ${path.relative(repoRoot, result.jsonPath)}`,
        `Statefile path:  ${path.relative(repoRoot, result.statefilePath)}`,
```

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +344 to +350
"kind": "type",
"source": {
"line": 47,
"path": "src/hooks/types.ts"
}
},
{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Re-export alias shows wrong name in declaration field

The ClawdbotConfig export entry has exportName: "ClawdbotConfig" but its declaration field reads "export type OpenClawConfig = OpenClawConfig;" — showing the underlying type's name instead of the alias name. Both ClawdbotConfig and OpenClawConfig end up with identical declaration strings, which is misleading.

This is caused by the generator in src/plugin-sdk/api-baseline.ts: resolveSymbolAndDeclaration resolves through the alias to the original OpenClawConfig symbol, and printNode then uses declaration.name.text (which is "OpenClawConfig") rather than the public export name ("ClawdbotConfig").

For the drift-detection use-case the check will still fire when the underlying type changes, but anyone reading the baseline (or building tooling on top of it) will see a confusing tautological declaration for ClawdbotConfig. Consider threading the symbol.getName() value through to printNode so that re-export aliases render as export type ClawdbotConfig = OpenClawConfig; instead.

Prompt To Fix With AI
This is a comment left during a code review.
Path: docs/.generated/plugin-sdk-api-baseline.json
Line: 344-350

Comment:
**Re-export alias shows wrong name in `declaration` field**

The `ClawdbotConfig` export entry has `exportName: "ClawdbotConfig"` but its `declaration` field reads `"export type OpenClawConfig = OpenClawConfig;"` — showing the underlying type's name instead of the alias name. Both `ClawdbotConfig` and `OpenClawConfig` end up with identical `declaration` strings, which is misleading.

This is caused by the generator in `src/plugin-sdk/api-baseline.ts`: `resolveSymbolAndDeclaration` resolves through the alias to the original `OpenClawConfig` symbol, and `printNode` then uses `declaration.name.text` (which is `"OpenClawConfig"`) rather than the public export name (`"ClawdbotConfig"`).

For the drift-detection use-case the check will still fire when the underlying type changes, but anyone reading the baseline (or building tooling on top of it) will see a confusing tautological declaration for `ClawdbotConfig`. Consider threading the `symbol.getName()` value through to `printNode` so that re-export aliases render as `export type ClawdbotConfig = OpenClawConfig;` instead.

How can I resolve this? If you propose a fix, please make it concise.

MaheshBhushan pushed a commit to MaheshBhushan/openclaw that referenced this pull request Mar 22, 2026
* Chore: unblock synced main checks

* Docs: add plugin SDK docs implementation plan

* Docs: scaffold plugin SDK reference phase 1

* Docs: mark plugin SDK reference surfaces unstable

* Docs: prototype generated plugin SDK reference

* docs(plugin-sdk): replace generated reference with api baseline

* docs(plugin-sdk): drop generated reference plan

* docs(plugin-sdk): align api baseline flow with config docs

---------

Co-authored-by: Onur <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
frankekn pushed a commit to artwalker/openclaw that referenced this pull request Mar 23, 2026
* Chore: unblock synced main checks

* Docs: add plugin SDK docs implementation plan

* Docs: scaffold plugin SDK reference phase 1

* Docs: mark plugin SDK reference surfaces unstable

* Docs: prototype generated plugin SDK reference

* docs(plugin-sdk): replace generated reference with api baseline

* docs(plugin-sdk): drop generated reference plan

* docs(plugin-sdk): align api baseline flow with config docs

---------

Co-authored-by: Onur <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
furaul pushed a commit to furaul/openclaw that referenced this pull request Mar 24, 2026
* Chore: unblock synced main checks

* Docs: add plugin SDK docs implementation plan

* Docs: scaffold plugin SDK reference phase 1

* Docs: mark plugin SDK reference surfaces unstable

* Docs: prototype generated plugin SDK reference

* docs(plugin-sdk): replace generated reference with api baseline

* docs(plugin-sdk): drop generated reference plan

* docs(plugin-sdk): align api baseline flow with config docs

---------

Co-authored-by: Onur <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
alexey-pelykh pushed a commit to remoteclaw/remoteclaw that referenced this pull request Mar 25, 2026
* Chore: unblock synced main checks

* Docs: add plugin SDK docs implementation plan

* Docs: scaffold plugin SDK reference phase 1

* Docs: mark plugin SDK reference surfaces unstable

* Docs: prototype generated plugin SDK reference

* docs(plugin-sdk): replace generated reference with api baseline

* docs(plugin-sdk): drop generated reference plan

* docs(plugin-sdk): align api baseline flow with config docs

---------

Co-authored-by: Onur <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
(cherry picked from commit 4f1e12a)
alexey-pelykh added a commit to remoteclaw/remoteclaw that referenced this pull request Mar 25, 2026
* fix(ci): stop serializing push workflow runs

(cherry picked from commit 0a20c5c)

* test: harden path resolution test helpers

(cherry picked from commit 1ad47b8)

* Fix launcher startup regressions (openclaw#48501)

* Fix launcher startup regressions

* Fix CI follow-up regressions

* Fix review follow-ups

* Fix workflow audit shell inputs

* Handle require resolve gaxios misses

(cherry picked from commit 313e5bb)

* refactor(scripts): move container setup entrypoints

(cherry picked from commit 46ccbac)

* perf(ci): gate install smoke on changed-smoke (openclaw#52458)

(cherry picked from commit 4bd90f2)

* Docs: prototype generated plugin SDK reference (openclaw#51877)

* Chore: unblock synced main checks

* Docs: add plugin SDK docs implementation plan

* Docs: scaffold plugin SDK reference phase 1

* Docs: mark plugin SDK reference surfaces unstable

* Docs: prototype generated plugin SDK reference

* docs(plugin-sdk): replace generated reference with api baseline

* docs(plugin-sdk): drop generated reference plan

* docs(plugin-sdk): align api baseline flow with config docs

---------

Co-authored-by: Onur <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
(cherry picked from commit 4f1e12a)

* fix(ci): harden docker builds and unblock config docs

(cherry picked from commit 9f08af1)

* Docs: add config drift baseline statefile (openclaw#45891)

* Docs: add config drift statefile generator

* Docs: generate config drift baseline

* CI: move config docs drift runner into workflow sanity

* Docs: emit config drift baseline json

* Docs: commit config drift baseline json

* Docs: wire config baseline into release checks

* Config: fix baseline drift walker coverage

* Docs: regenerate config drift baselines

(cherry picked from commit cbec476)

* Release: add plugin npm publish workflow (openclaw#47678)

* Release: add plugin npm publish workflow

* Release: make plugin publish scope explicit

(cherry picked from commit d41c9ad)

* build: default to Node 24 and keep Node 22 compat

(cherry picked from commit deada7e)

* ci(android): use explicit flavor debug tasks

(cherry picked from commit 0c2e6fe)

* ci: harden pnpm sticky cache on PRs

(cherry picked from commit 29b36f8)

* CI: add built plugin singleton smoke (openclaw#48710)

(cherry picked from commit 5a2a4ab)

* chore: add code owners for npm release paths

(cherry picked from commit 5c9fae5)

* test add extension plugin sdk boundary guards

(cherry picked from commit 77fb258)

* ci: tighten cache docs and node22 gate

(cherry picked from commit 797b6fe)

* ci: add npm release workflow and CalVer checks (openclaw#42414) (thanks @onutc)

(cherry picked from commit 8ba1b6e)

* CI: add CLI startup memory regression check

(cherry picked from commit c0e0115)

* Add bad-barnacle label to prevent barnacle closures. (openclaw#51945)

(cherry picked from commit c449a0a)

* ci: speed up scoped workflow lanes

(cherry picked from commit d17490f)

* ci: restore PR pnpm cache fallback

(cherry picked from commit e1d0545)

* CI: guard gateway watch against duplicate runtime regressions (openclaw#49048)

(cherry picked from commit f036ed2)

* fix: correct domain reference in docker setup script

* fix: adapt cherry-picks for fork TS strictness

* fix: adapt cherry-picked tests for fork structure

- Dockerfile test: OPENCLAW_ → REMOTECLAW_ ARG names
- ci-changed-scope test: add missing runChangedSmoke field
- doc-baseline test: rename to e2e (needs dist/ build artifacts)
- extension boundary test: update baselines and expectations for fork

* fix: adjust ci-changed-scope test for fork's narrower skills regex

---------

Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
Co-authored-by: Bob <[email protected]>
Co-authored-by: Onur <[email protected]>
Co-authored-by: Altay <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
Co-authored-by: Onur Solmaz <[email protected]>
Co-authored-by: Harold Hunt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation scripts Repository scripts size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants