Skip to content

docs(runtime): document subpath-only public API and shared composition entry - #5200

Merged
me2seeks merged 2 commits into
apache:mainfrom
UncertaintyDeterminesYou4ndMe:fix/issue-5141-runtime-readme
Sep 12, 2026
Merged

docs(runtime): document subpath-only public API and shared composition entry#5200
me2seeks merged 2 commits into
apache:mainfrom
UncertaintyDeterminesYou4ndMe:fix/issue-5141-runtime-readme

Conversation

@UncertaintyDeterminesYou4ndMe

Copy link
Copy Markdown
Contributor

Summary

packages/runtime/README.md advertised two things that no longer hold on main:

  1. The package root as a supported public API — but packages/runtime/package.json exports only named subpaths, so import('@maka/runtime') fails with ERR_PACKAGE_PATH_NOT_EXPORTED.
  2. apps/desktop/src/main/main.ts as the place where Runtime is composed — but the shared execution composition now lives in the Runtime Host.

Changes

  • Public seam: state that the supported public API is the set of subpaths declared in the package.json exports map, say explicitly that the package root is not exported, and add concrete subpath import examples (SessionManager, BackendRegistry, AiSdkBackend, buildBuiltinTools — the same subpaths the shared composition imports).
  • Composition pointer: point contributors to packages/runtime-host/src/server/execution-composition.ts — where BackendRegistry and SessionManager are constructed — via a relative link, following the cross-package README convention (packages/eval, packages/computer-use).
  • Extension rules: replace "through the root barrel or a declared package.json subpath" with the subpath-only rule.

Verification

  • Reproduced on main from packages/runtime:
    node --input-type=module -e "import('@maka/runtime')"ERR_PACKAGE_PATH_NOT_EXPORTED ("No exports main defined").
  • Verified each example import resolves to a declared subpath whose source module actually exports the named symbol (session-manager.ts, ai-sdk-backend.ts, builtin-tools.ts), matching how execution-composition.ts consumes the package.
  • Adversarial diff review before submission caught a broken relative link (missing packages/ segment) — fixed and re-verified on disk.
  • Checked the rest of the repo for the same stale claims: remaining "package root"/"root barrel" hits are only in historical material (docs/archive/, versioned design docs), untouched here.

Fixes #5141

…n entry

- State that the public API is the declared package.json exports subpaths;
  the package root is not exported (import('@maka/runtime') fails with
  ERR_PACKAGE_PATH_NOT_EXPORTED)
- Add explicit subpath import examples for SessionManager, BackendRegistry,
  AiSdkBackend, and buildBuiltinTools
- Point contributors to the shared Runtime Host execution composition
  instead of the stale apps/desktop/src/main/main.ts entry

Fixes apache#5141

@me2seeks me2seeks left a comment

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.

PR 5200 Review

结论

APPROVE
Docs-only:packages/runtime/README.md 的 root-barrel 误述已修正,补 subpath 导入示例,并把 composition 指针换到 Runtime Host。是四个竞争 PR 里改动最克制的一个。

发现

[P3] 与 #5142#5165 修同一缺陷、同一文件(issue #5141),三者不能同时合并

  • 文件: packages/runtime/README.md
  • 问题:本 PR、#5142#5165 都只改 packages/runtime/README.md 的 "Public seam" 段,修的是同一个 root-barrel 误述(同一 issue #5141)。三个 PR 不能同时合并,后合者会因同段改动产生 diff 冲突。
  • 建议:维护者三选一合并,其余关闭即可。本 PR 改动最小、最贴近奥卡姆剃刀,若求最小 diff 可优先它。纯流程提示,不影响技术正确性。
  • 另:PR 描述称"follow the cross-package README convention (packages/eval, packages/computer-use)",但 eval/README.md 对同 packages 下文件用单层 ../computer-use../../ 是因其指向 repo 根 docs/。本 PR 指向同 packages 下的 runtime-host,却用了 ../../packages/...(多绕一层)。两种写法都能正确解析,仅与"同 packages 引用用 ../"的惯例略不一致,若想统一可改 ../runtime-host/src/server/execution-composition.ts(与 #5165 一致)。可改可不改。

验证

  • package.json#exports'.' 键 → root 确实不导出,原文档说法确为缺陷。
  • 示例导入的 SessionManager/BackendRegistry@maka/runtime/session-manager)、AiSdkBackend@maka/runtime/ai-sdk-backend)、buildBuiltinTools@maka/runtime/builtin-tools @196)三者均真实导出。
  • 相对链接 ../../packages/runtime-host/src/server/execution-composition.tspackages/runtime/ 出发能正确解析到目标文件。

…e path

Review feedback on apache#5200: a reference into a sibling package uses one
'../' hop (packages/runtime/ -> packages/runtime-host/...), matching the
convention in packages/eval's README.
@UncertaintyDeterminesYou4ndMe

Copy link
Copy Markdown
Contributor Author

Adopted the review suggestion: the composition link now uses the same-packages relative path (../runtime-host/src/server/execution-composition.ts, one hop like packages/eval's README) in 4776e8f→042774410. Understood on the competing PRs — leaving the merge choice to the maintainers.

@me2seeks me2seeks left a comment

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.

Maka auto review

Approved after comparing #5142, #5165, and #5200 against their latest heads. This version preserves the README structure, supplies four useful named-import examples, and clearly points Desktop contributors to the shared Runtime Host composition. The requested relative-link adjustment is present in 0427744.

Verified the package-root import rejection, declared subpaths and named source exports, the relative composition link, and the BackendRegistry/SessionManager construction sites. Diff whitespace checks pass; current CI is successful. This is documentation-only; no runtime behavior changes.

中文说明

比较三个竞争 PR 后选择本 PR:保留原文结构,提供四个常用导入示例,明确 Desktop 通过 Runtime Host 执行,并已落实相对链接建议。已核对根路径导入错误、子路径声明与命名导出、文档链接和实际组装位置;差异检查与当前 CI 通过。本次只修改文档。

@me2seeks
me2seeks merged commit c05e85e into apache:main Sep 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/S Under 100 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs(runtime): README advertises an unexported package root and stale composition entry point

2 participants