Skip to content

fix(plugin-sdk): ship documented public typings - #116345

Merged
vincentkoc merged 2 commits into
mainfrom
fix/plugin-sdk-tool-results-types
Jul 30, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix/plugin-sdk-tool-results-types

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

Related: #111718

What Problem This Solves

Fixes an issue where external plugin authors importing the documented openclaw/plugin-sdk/session-catalog or openclaw/plugin-sdk/tool-results entrypoints would receive JavaScript exports without shipped TypeScript declarations.

Why This Change Was Made

Restores both documented entrypoints to the typed public SDK surface, includes their declarations in the npm package, and adds a contract guard so imports advertised by the SDK entrypoint guide cannot silently lose public typings again.

User Impact

External plugins can compile against the documented session catalog and tool result helpers without local shims or unpublished OpenClaw source types.

Evidence

  • node scripts/run-vitest.mjs src/plugins/contracts/plugin-sdk-package-contract-guardrails.test.ts (22 tests passed)
  • node scripts/plugin-sdk-surface-report.mjs --check
  • node scripts/sync-plugin-sdk-exports.mjs --check
  • node scripts/docs-list.js
  • targeted oxfmt check and git diff --check
  • structured autoreview: clean, no actionable findings

AI-assisted: yes. I reviewed the implementation and validation results.

@vincentkoc vincentkoc self-assigned this Jul 30, 2026
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts size: S maintainer Maintainer-authored PR labels Jul 30, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review July 30, 2026 10:03
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 30, 2026
@clawsweeper

clawsweeper Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 30, 2026, 6:13 AM ET / 10:13 UTC.

ClawSweeper review

What this changes

The PR makes session-catalog and tool-results typed, publishable plugin SDK subpaths and adds a contract test tying documented SDK entrypoints to shipped declarations.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep this PR open for maintainer review. The patch consistently restores declarations for two documentation-listed SDK imports, but a related open documentation PR still classifies tool-results as private-local, so the intended external SDK boundary needs an explicit owner decision before this public contract is expanded again.

Priority: P2
Reviewed head: 7569ec61d7d96d0611f597162f490736c9ddabec
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is focused and internally aligned, but its merge readiness depends on resolving the conflicting public-versus-private SDK contract direction.
Proof confidence 🌊 off-meta tidepool Not applicable: This member-authored SDK contract repair is covered by targeted package-contract checks in the PR body; no external-contributor real-behavior-proof gate applies.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This member-authored SDK contract repair is covered by targeted package-contract checks in the PR body; no external-contributor real-behavior-proof gate applies.
Evidence reviewed 5 items Two documented subpaths are restored as typed package exports: The patch adds types conditions for plugin-sdk/session-catalog and plugin-sdk/tool-results, while removing their declaration exclusions from the npm package file list.
Documentation is updated to describe the two paths as external contracts: The PR adds public descriptions for session catalog contracts and typed tool-result builders in the SDK subpath catalog.
A related open PR describes a conflicting API classification: The related open PR #111718 lists tool-results as “Private-local after July 2026”; this PR instead restores it as a typed public package export, so the intended SDK boundary is not yet unambiguous.
Findings None None.
Security None None.

How this fits together

External plugins consume OpenClaw through openclaw/plugin-sdk/* package subpaths. The SDK documentation advertises imports, while package.json, the npm publish allowlist, and generated baselines determine whether plugin authors receive both runtime JavaScript and TypeScript declarations.

flowchart LR
  PluginAuthors[External plugin authors] --> Docs[SDK entrypoint documentation]
  Docs --> Imports[Documented SDK imports]
  Imports --> Exports[Package export map]
  Exports --> PackageFiles[Published JavaScript and declarations]
  PackageFiles --> PluginCompile[External plugin compilation]
  Guardrails[SDK contract guardrails] --> Docs
  Guardrails --> Exports
Loading

Decision needed

Question Recommendation
Should plugin-sdk/session-catalog and plugin-sdk/tool-results remain supported typed external plugin SDK entrypoints, rather than private-local implementation surfaces? Restore both as public SDK: Merge this PR after confirming both declarations are intended supported plugin APIs and align the related documentation work with that decision.

Why: The PR’s implementation is internally consistent, but the related open documentation work explicitly treats at least tool-results as private-local; only SDK owners can choose the durable external compatibility contract.

Before merge

  • Resolve merge risk (P1) - Merging makes two subpaths an explicit typed external plugin SDK contract; removing or materially changing either later would become a compatibility obligation.
  • Resolve merge risk (P1) - The related open documentation PR docs(plugin-sdk): catalog remaining private-local subpaths from #111451 #111718 calls tool-results private-local, so landing both directions would give plugin authors contradictory guidance.
Agent review details

Security

None.

PR surface

Source -6, Tests +50, Docs +2, Config -6, Generated +2, Other +1. Total +43 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 1 0 6 -6
Tests 1 52 2 +50
Docs 1 2 0 +2
Config 2 2 8 -6
Generated 1 2 0 +2
Other 2 6 5 +1
Total 8 64 21 +43

Review metrics

Metric Value Why it matters
Typed SDK subpaths 2 restored These changes affect two external package entrypoints and therefore define a compatibility commitment for plugin authors.

Stored data model

Persistent data-model change detected: serialized state: src/plugins/contracts/plugin-sdk-package-contract-guardrails.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Confirm and align the public contract (recommended)
    Confirm that both subpaths are supported external SDK APIs, then reconcile the conflicting private-local documentation before merging.
  2. Retain private-local-only status
    Keep the previous boundary and remove the proposed public declaration and export changes rather than introducing a conflicting SDK contract.

Technical review

Best possible solution:

Resolve the public-versus-private classification for both subpaths, then keep one canonical package export, private-local manifest, documentation, and contract-test position; merge this restoration only if typed external support is the chosen contract.

Do we have a high-confidence way to reproduce the issue?

Yes, from source with medium confidence: the prior manifest exported JavaScript for the documented subpaths while excluding their .d.ts files from the package and omitting types export conditions. A package-consumer compile or packed-artifact import would provide the strongest direct reproduction.

Is this the best way to solve the issue?

Unclear: restoring declarations is the narrowest technical repair if these paths are intended public, but the conflicting private-local documentation means maintainers must first choose the permanent SDK boundary.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against a4c6efc998f1.

Labels

Label changes:

  • add P2: This is a bounded external-plugin SDK contract repair with meaningful but non-emergency compatibility impact.
  • add merge-risk: 🚨 compatibility: The patch restores two typed public package subpaths, expanding the supported import contract for external plugins.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This member-authored SDK contract repair is covered by targeted package-contract checks in the PR body; no external-contributor real-behavior-proof gate applies.

Label justifications:

  • P2: This is a bounded external-plugin SDK contract repair with meaningful but non-emergency compatibility impact.
  • merge-risk: 🚨 compatibility: The patch restores two typed public package subpaths, expanding the supported import contract for external plugins.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This member-authored SDK contract repair is covered by targeted package-contract checks in the PR body; no external-contributor real-behavior-proof gate applies.

Evidence

What I checked:

Likely related people:

  • vincentkoc: A repository member authored both commits in this PR and assigned the item, making them the clearest available routing contact from the supplied evidence; broader current-main ownership history could not be established in this read-only review environment. (role: current SDK contract contributor; confidence: low; commits: abed0bb776cc, 7569ec61d7d9; files: package.json, src/plugins/contracts/plugin-sdk-package-contract-guardrails.test.ts, docs/plugins/sdk-subpaths.md)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@vincentkoc

Copy link
Copy Markdown
Member Author

Maintainer SDK decision: openclaw/plugin-sdk/session-catalog and openclaw/plugin-sdk/tool-results remain supported typed public entrypoints.

Reason: both are already documented as public SDK imports, and external plugin compatibility depends on the shipped declarations matching those docs. The durable contract is the public export plus declaration, not the accidental July packaging demotion.

ClawSweeper rank-up moves:

@vincentkoc

Copy link
Copy Markdown
Member Author

Final merge check: all exact-head CI checks completed successfully on 7569ec61d7d96d0611f597162f490736c9ddabec.

Both ClawSweeper rank-up moves are satisfied: the SDK owner decision is recorded and PR #111718 is reconciled; the reviewed-head checks are green.

@vincentkoc
vincentkoc merged commit 8a3f5c8 into main Jul 30, 2026
129 of 134 checks passed
@vincentkoc
vincentkoc deleted the fix/plugin-sdk-tool-results-types branch July 30, 2026 10:20
xydt-tanshanshan added a commit to xydt-tanshanshan/openclaw that referenced this pull request Jul 30, 2026
…penclaw#111451

Add docs rows for 7 subpaths demoted to private-local-only by openclaw#111451
but whose docs sync was missed alongside `text-utility-runtime`:

- agent-core, agent-sessions, document-extractor, llm,
  time-runtime, types, windows-spawn

Each row mirrors the "Private-local after July 2026; ..." prefix openclaw#111451
applied to `text-utility-runtime`, placed in the same "Runtime and
storage subpaths" Accordion. Completes the docs half of the 4-file
alignment for these demotes so plugin authors no longer reasonably
assume the subpaths are public SDK seams — the same ambiguous-state
class reported in openclaw#111660 for `simple-completion-runtime`.

`tool-results` is excluded: it remains a supported typed public SDK
entrypoint per maintainer decision on openclaw#111718; openclaw#116345 restores its
declaration packaging and adds a contract guard.

Related to openclaw#111451
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 31, 2026
* fix(plugin-sdk): ship documented public typings

* fix(plugin-sdk): refresh public contract artifacts
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 extensions: xai maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant