Files
openclaw/scripts/lib/plugin-sdk-private-local-only-subpaths.json
T
Peter Steinberger 6192673da4 perf(doctor): delete the heavy doctor barrel and finish slimming enumeration (#120882)
* refactor(plugin-sdk): delete the heavy runtime-doctor barrel

Nothing may pull the state-db/kysely graph through a doctor barrel anymore.
The barrel's remaining heavy exports move to two narrow private-local
subpaths, each with a single purpose:

- doctor-repair-runtime: install-path diagnosis, plugin config removal, and
  state-database schema detect/repair (matrix doctor, voice-call lazy import)
- plugin-state-store-runtime: the sync keyed-store factory. It stays out of
  plugin-state-runtime because hot channel entrypoints import that at module
  load and opening a store pulls the state-database graph.

Doctor closures also stop pulling ssrf-runtime (fetch-guard + gateway net)
for two legacy private-network helpers that live in the lighter ssrf-policy
subpath: mattermost, nextcloud-talk, tlon, matrix.

The closure guard now forbids the two new heavy subpaths instead of the
deleted barrel, so the invariant keeps being enforced where it still applies.

* perf(doctor): keep heavy graphs out of every doctor closure

Doctor enumeration cold-loads each declaring plugin's contract closure, so
one heavy import in a closure is paid by the whole sweep. Four barrels were
still dragging unrelated graphs in for trivial helpers; each is repaired at
the leaf rather than by caching downstream:

- Legacy private-network config migration moves to a config leaf. It only
  reshapes records, but lived beside the SSRF runtime (DNS, proxy, logging),
  costing mattermost ~2.7s. ssrf-policy re-exports it, surface unchanged.
- Streaming config readers move to a leaf. They read two config keys, but
  streaming.ts also formats tool aggregates, pulling tool-display/logging/
  acp-core; that cost slack ~2.3s.
- signal took the channel-secret barrel for isRecord; the canonical plugin
  record guard is string-coerce-runtime (root AGENTS.md).
- llm-task took the provider-model barrel for parseModelRef, now a narrow
  model-ref-parse subpath.

Full doctor enumeration of all 42 declaring plugins, built mode:
legacy config rules 6668ms -> 1265ms, state migrations 184ms -> 127ms.
No plugin remains an outlier; the slowest is now ~380ms against a ~200ms floor.

Public export surfaces of every touched SDK subpath are byte-identical
(verified by diffing built module exports before/after); the API baseline
hashes move only because re-exported declarations emit differently.

The closure guard gains rules for each repaired barrel so the invariant
holds for future closures.

* fix(release): exclude new private-local declarations from the published package

Same pack-path rule as c41da3759f: private-local subpaths ship without d.ts.

* fix(doctor): repair the closure guard violations that break main

The landed guard fails on main: three closures import heavy barrels for one
symbol each. Two more surfaced once the guard learned about the provider-model
barrel. Each gets a narrow subpath at the leaf:

- telegram sent-message-cache + state-migrations took the session-store barrel
  (session accessor + state-db) for resolveStorePath -> session-store-paths
- discord thread-bindings.state took the channel-outbound barrel (reply
  pipeline + channel registry) for one identity write -> outbound-echo-runtime
- discord model-picker took the provider-model barrel for normalizeProviderId,
  which model-ref-parse now exposes beside parseModelRef

The guard also stops walking artifacts of plugins whose manifest declares no
doctor surface. Such a declaration gates the artifact off every enumeration
path exactly as resolvePluginDoctorContracts does, so its closure cost is never
paid; anthropic ("doctorContract": {}) was being held to a cost it cannot
incur. Absent declarations still load eagerly and stay enforced.

Side effect worth naming: discord's built doctor contract now loads again.
On main both discord and telegram fail to require in packaged builds (an
ESM-only transitive dep) and silently lose their repairs; this restores
discord and takes enumerated legacy config rules from 87 to 99. Telegram's
built artifact still pulls execa through dist chunking - a build-level defect
with a different owner, filed as follow-up.
2026-08-08 22:01:44 -07:00

190 lines
4.7 KiB
JSON

[
"access-groups",
"account-resolution-runtime",
"acp-binding-resolve-runtime",
"acp-binding-runtime",
"acp-runtime",
"acp-runtime-backend",
"agent-core",
"agent-harness-exec-review-runtime",
"agent-harness-task-runtime",
"agent-harness-tool-runtime",
"agent-runtime-test-contracts",
"agent-sessions",
"approval-reaction-runtime",
"approval-reference-runtime",
"async-lock-runtime",
"browser-config",
"bundled-channel-config-schema",
"channel-activity-runtime",
"channel-config-writes",
"channel-contract-testing",
"channel-mention-gating",
"channel-route",
"channel-secret-tts-runtime",
"channel-target-testing",
"channel-targets",
"channel-test-helpers",
"chat-channel-ids",
"cli-backend",
"cli-runtime",
"codex-mcp-projection",
"codex-session-transcript-runtime",
"command-status-runtime",
"command-surface",
"concurrency-runtime",
"context-visibility-runtime",
"conversation-binding-runtime",
"cron-store-runtime",
"dangerous-name-runtime",
"delivery-queue-runtime",
"direct-dm-guard-policy",
"directory-config-runtime",
"doctor-repair-runtime",
"document-extractor",
"embedding-providers",
"exec-approvals-runtime",
"expect-runtime",
"fetch-runtime",
"file-access-runtime",
"file-lock",
"global-singleton",
"group-activation",
"heartbeat-runtime",
"host-runtime",
"html-entity-runtime",
"image-generation",
"image-generation-core",
"image-generation-runtime",
"inline-image-data-url-runtime",
"json-schema-runtime",
"json-unsafe-integers",
"keyed-async-queue",
"llm",
"markdown-table-runtime",
"media-generation-runtime",
"memory-core-host-embedding-registry",
"memory-core-host-engine-curated",
"memory-core-host-engine-embeddings",
"memory-core-host-engine-fs",
"memory-core-host-engine-qmd",
"memory-core-host-engine-schema",
"memory-core-host-engine-storage",
"memory-core-host-runtime-cli",
"memory-core-host-runtime-core",
"memory-core-host-runtime-files",
"memory-core-host-secret",
"memory-core-host-status",
"memory-host-events",
"memory-host-markdown",
"memory-host-search",
"message-tool-delivery-hints",
"migration",
"migration-runtime",
"model-ref-parse",
"music-generation",
"node-host",
"number-runtime",
"outbound-echo-runtime",
"outbound-media",
"pair-loop-guard-runtime",
"plugin-state-runtime",
"plugin-state-store-runtime",
"plugin-state-test-runtime",
"plugin-test-api",
"plugin-test-contracts",
"plugin-test-runtime",
"poll-runtime",
"process-runtime",
"provider-auth-api-key",
"provider-auth-login-flow-runtime",
"provider-auth-result",
"provider-auth-runtime",
"provider-catalog-live-runtime",
"provider-catalog-shared",
"provider-entry",
"provider-env-vars",
"provider-http",
"provider-http-test-mocks",
"provider-model-shared",
"provider-model-types",
"provider-oauth-runtime",
"provider-onboard",
"provider-selection-runtime",
"provider-setup",
"provider-stream",
"provider-stream-family",
"provider-stream-shared",
"provider-test-contracts",
"provider-tools",
"provider-transport-runtime",
"provider-usage",
"provider-web-fetch",
"provider-web-fetch-contract",
"provider-web-search",
"provider-web-search-config-contract",
"provider-web-search-contract",
"qa-channel",
"qa-channel-protocol",
"qa-lab",
"qa-runner-runtime",
"qa-runtime",
"realtime-bootstrap-context",
"realtime-transcription",
"realtime-voice",
"realtime-voice-activation",
"realtime-voice-audio-queue",
"reply-payload-testing",
"reply-reference",
"request-url",
"response-limit-runtime",
"retry-runtime",
"runtime-doctor-migrations",
"runtime-fetch",
"sandbox",
"secret-file-runtime",
"secure-random-runtime",
"session-binding-runtime",
"session-catalog-runtime",
"session-key-runtime",
"session-store-paths",
"session-transcript-hit",
"session-transcript-runtime",
"session-visibility",
"simple-completion-runtime",
"speech",
"speech-core",
"sqlite-runtime",
"sqlite-runtime-testing",
"ssrf-dispatcher",
"ssrf-runtime-internal",
"string-normalization-runtime",
"system-event-runtime",
"talk-config-runtime",
"target-resolver-runtime",
"test-env",
"test-fixtures",
"test-live",
"test-live-auth",
"test-media-generation",
"test-media-understanding",
"test-node-mocks",
"test-state",
"text-autolink-runtime",
"text-utility-runtime",
"thread-bindings-runtime",
"thread-bindings-session-runtime",
"time-runtime",
"tool-payload",
"transcripts",
"transport-ready-runtime",
"tts-runtime",
"types",
"video-generation",
"video-generation-core",
"video-generation-runtime",
"web-content-extractor",
"webhook-targets",
"windows-spawn"
]