dsh-plugin-dev-kb 1.8.0 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. package/CHANGELOG.md +186 -178
  2. package/README.en.md +172 -172
  3. package/README.md +183 -183
  4. package/kb/INDEX.md +236 -234
  5. package/kb/README.md +88 -88
  6. package/kb/extra/AGENTS.md +77 -77
  7. package/kb/extra/deepseek-llm-api-wire-extensions.md +162 -162
  8. package/kb/extra/deepseek-llm-api-wire-extensions.zh.md +162 -162
  9. package/kb/extra/defensive-patterns/package-surface.md +233 -232
  10. package/kb/extra/defensive-patterns/package-surface.zh.md +233 -232
  11. package/kb/extra/defensive-patterns/remote-and-api.md +117 -117
  12. package/kb/extra/defensive-patterns/remote-and-api.zh.md +117 -117
  13. package/kb/extra/development.md +221 -221
  14. package/kb/extra/development.zh.md +228 -228
  15. package/kb/extra/event-producer-consumer.md +133 -123
  16. package/kb/extra/event-producer-consumer.zh.md +135 -125
  17. package/kb/extra/module-graph.md +1961 -1888
  18. package/kb/extra/module-graph.zh.md +1963 -1890
  19. package/kb/extra/persistence-changes/2026-11-05-timeline-priority-notice.md +60 -0
  20. package/kb/extra/persistence-changes/2026-11-05-timeline-priority-notice.zh.md +60 -0
  21. package/kb/extra/persistence-changes/README.md +92 -92
  22. package/kb/extra/persistence-changes/README.zh.md +92 -92
  23. package/kb/extra/persistence-changes/historical-formats/README.md +75 -75
  24. package/kb/extra/persistence-changes/historical-formats/README.zh.md +75 -75
  25. package/kb/extra/persistence-changes/releases/README.md +103 -103
  26. package/kb/extra/persistence-changes/releases/README.zh.md +103 -103
  27. package/kb/extra/rescope.md +55 -55
  28. package/kb/extra/rescope.zh.md +55 -55
  29. package/kb/extra/subsystems/boot.md +631 -621
  30. package/kb/extra/subsystems/boot.zh.md +631 -621
  31. package/kb/extra/subsystems/computer-use.md +179 -137
  32. package/kb/extra/subsystems/computer-use.zh.md +179 -137
  33. package/kb/extra/subsystems/extensions.md +387 -384
  34. package/kb/extra/subsystems/extensions.zh.md +387 -384
  35. package/kb/extra/subsystems/feedback.md +418 -400
  36. package/kb/extra/subsystems/feedback.zh.md +418 -400
  37. package/kb/extra/subsystems/forge.md +2169 -1226
  38. package/kb/extra/subsystems/forge.zh.md +2171 -1226
  39. package/kb/extra/subsystems/liveshare.md +167 -158
  40. package/kb/extra/subsystems/liveshare.zh.md +167 -158
  41. package/kb/extra/subsystems/mcp.md +237 -234
  42. package/kb/extra/subsystems/mcp.zh.md +237 -234
  43. package/kb/extra/subsystems/office-kit.md +122 -0
  44. package/kb/extra/subsystems/office-kit.zh.md +122 -0
  45. package/kb/extra/subsystems/working-directory.md +95 -64
  46. package/kb/extra/subsystems/working-directory.zh.md +95 -64
  47. package/kb/extra/subsystems/worktrees.md +187 -127
  48. package/kb/extra/subsystems/worktrees.zh.md +187 -127
  49. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/python-ptc-sandbox/guide.md +21 -21
  50. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/python-ptc-sandbox/guide.zh.md +21 -21
  51. package/kb/extra/upgrade-guide/v0.2.1-rc.4/sandbox-unsupported-policy-error/guide.md +18 -0
  52. package/kb/extra/upgrade-guide/v0.2.1-rc.4/sandbox-unsupported-policy-error/guide.zh.md +18 -0
  53. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/llm-error-builtin-codes/guide.md +18 -0
  54. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/llm-error-builtin-codes/guide.zh.md +18 -0
  55. package/kb/extra/upgrade-guide/v0.2.2-alpha.3/office-kit-package/guide.md +34 -0
  56. package/kb/extra/upgrade-guide/v0.2.2-alpha.3/office-kit-package/guide.zh.md +34 -0
  57. package/kb/extra/upgrade-guide/v0.2.2-alpha.3/office-operation-tools/guide.md +49 -0
  58. package/kb/extra/upgrade-guide/v0.2.2-alpha.3/office-operation-tools/guide.zh.md +49 -0
  59. package/kb/extra/upgrade-guide/v0.2.2-alpha.3/office-skill-resources/guide.md +36 -0
  60. package/kb/extra/upgrade-guide/v0.2.2-alpha.3/office-skill-resources/guide.zh.md +36 -0
  61. package/kb/extra/upgrade-guide/v0.2.2-rc.1/account-notification-fields/guide.md +26 -0
  62. package/kb/extra/upgrade-guide/v0.2.2-rc.1/account-notification-fields/guide.zh.md +26 -0
  63. package/kb/extra/upgrade-guide/v0.2.2-rc.1/account-remote-provider/guide.md +22 -0
  64. package/kb/extra/upgrade-guide/v0.2.2-rc.1/account-remote-provider/guide.zh.md +22 -0
  65. package/kb/extra/upgrade-guide/v0.2.2-rc.1/archive-worktrees/guide.md +21 -0
  66. package/kb/extra/upgrade-guide/v0.2.2-rc.1/archive-worktrees/guide.zh.md +21 -0
  67. package/kb/extra/upgrade-guide/v0.2.2-rc.1/attachment-error-codes/guide.md +23 -0
  68. package/kb/extra/upgrade-guide/v0.2.2-rc.1/attachment-error-codes/guide.zh.md +23 -0
  69. package/kb/extra/upgrade-guide/v0.2.2-rc.1/cua-ax-read-limits/guide.md +20 -0
  70. package/kb/extra/upgrade-guide/v0.2.2-rc.1/cua-ax-read-limits/guide.zh.md +20 -0
  71. package/kb/extra/upgrade-guide/v0.2.2-rc.1/cua-hover-ax-only/guide.md +18 -0
  72. package/kb/extra/upgrade-guide/v0.2.2-rc.1/cua-hover-ax-only/guide.zh.md +18 -0
  73. package/kb/extra/upgrade-guide/v0.2.2-rc.1/cua-native-platform/guide.md +23 -0
  74. package/kb/extra/upgrade-guide/v0.2.2-rc.1/cua-native-platform/guide.zh.md +23 -0
  75. package/kb/extra/upgrade-guide/v0.2.2-rc.1/dsh-doc-skill/guide.md +35 -0
  76. package/kb/extra/upgrade-guide/v0.2.2-rc.1/dsh-doc-skill/guide.zh.md +35 -0
  77. package/kb/extra/upgrade-guide/v0.2.2-rc.1/forge-change-request-overview/guide.md +26 -0
  78. package/kb/extra/upgrade-guide/v0.2.2-rc.1/forge-change-request-overview/guide.zh.md +26 -0
  79. package/kb/extra/upgrade-guide/v0.2.2-rc.1/forge-pinned-diff/guide.md +26 -0
  80. package/kb/extra/upgrade-guide/v0.2.2-rc.1/forge-pinned-diff/guide.zh.md +26 -0
  81. package/kb/extra/upgrade-guide/v0.2.2-rc.1/forge-review-reads/guide.md +19 -0
  82. package/kb/extra/upgrade-guide/v0.2.2-rc.1/forge-review-reads/guide.zh.md +19 -0
  83. package/kb/extra/upgrade-guide/v0.2.2-rc.1/package-export-cleanup/guide.md +26 -0
  84. package/kb/extra/upgrade-guide/v0.2.2-rc.1/package-export-cleanup/guide.zh.md +26 -0
  85. package/kb/extra/upgrade-guide/v0.2.2-rc.1/plugin-update-method/guide.md +22 -0
  86. package/kb/extra/upgrade-guide/v0.2.2-rc.1/plugin-update-method/guide.zh.md +22 -0
  87. package/kb/extra/upgrade-guide/v0.2.2-rc.1/ptc-bootstrap-protocol/guide.md +25 -0
  88. package/kb/extra/upgrade-guide/v0.2.2-rc.1/ptc-bootstrap-protocol/guide.zh.md +25 -0
  89. package/kb/extra/upgrade-guide/v0.2.2-rc.1/ptc-inspect-output/guide.md +48 -0
  90. package/kb/extra/upgrade-guide/v0.2.2-rc.1/ptc-inspect-output/guide.zh.md +48 -0
  91. package/kb/extra/upgrade-guide/v0.2.2-rc.1/ptc-scoped-repl-default/guide.md +45 -0
  92. package/kb/extra/upgrade-guide/v0.2.2-rc.1/ptc-scoped-repl-default/guide.zh.md +45 -0
  93. package/kb/extra/upgrade-guide/v0.2.2-rc.1/runtime-context-reminders/guide.md +19 -0
  94. package/kb/extra/upgrade-guide/v0.2.2-rc.1/runtime-context-reminders/guide.zh.md +19 -0
  95. package/kb/extra/upgrade-guide/v0.2.2-rc.1/session-append-overloads/guide.md +17 -0
  96. package/kb/extra/upgrade-guide/v0.2.2-rc.1/session-append-overloads/guide.zh.md +17 -0
  97. package/kb/extra/upgrade-guide/v0.2.2-rc.1/subagent-interrupt-default/guide.md +27 -0
  98. package/kb/extra/upgrade-guide/v0.2.2-rc.1/subagent-interrupt-default/guide.zh.md +27 -0
  99. package/kb/extra/upgrade-guide/v0.2.2-rc.1/terminal-backend-cleanup-error/guide.md +20 -0
  100. package/kb/extra/upgrade-guide/v0.2.2-rc.1/terminal-backend-cleanup-error/guide.zh.md +20 -0
  101. package/kb/extra/upgrade-guide/v0.2.2-rc.1/terminal-bundle-sidebar-backend/guide.md +19 -0
  102. package/kb/extra/upgrade-guide/v0.2.2-rc.1/terminal-bundle-sidebar-backend/guide.zh.md +19 -0
  103. package/kb/extra/upgrade-guide/v0.2.2-rc.1/web-fetch-transport-error-codes/guide.md +18 -0
  104. package/kb/extra/upgrade-guide/v0.2.2-rc.1/web-fetch-transport-error-codes/guide.zh.md +18 -0
  105. package/kb/extra/upgrade-guide/v0.2.2-rc.1/web-search-billing/guide.md +41 -0
  106. package/kb/extra/upgrade-guide/v0.2.2-rc.1/web-search-billing/guide.zh.md +41 -0
  107. package/kb/extra/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.md +21 -0
  108. package/kb/extra/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.zh.md +21 -0
  109. package/kb/extra/upgrade-guide/v0.2.2-rc.2/client-module-metadata/guide.md +29 -0
  110. package/kb/extra/upgrade-guide/v0.2.2-rc.2/client-module-metadata/guide.zh.md +29 -0
  111. package/kb/extra/upgrade-guide/v0.2.2-rc.2/connection-page-peer/guide.md +25 -0
  112. package/kb/extra/upgrade-guide/v0.2.2-rc.2/connection-page-peer/guide.zh.md +25 -0
  113. package/kb/extra/upgrade-guide/v0.2.2-rc.2/cordis-root-and-intercept-metadata/guide.md +31 -0
  114. package/kb/extra/upgrade-guide/v0.2.2-rc.2/cordis-root-and-intercept-metadata/guide.zh.md +31 -0
  115. package/kb/extra/upgrade-guide/v0.2.2-rc.2/cua-agents-without-preset/guide.md +24 -0
  116. package/kb/extra/upgrade-guide/v0.2.2-rc.2/cua-agents-without-preset/guide.zh.md +24 -0
  117. package/kb/extra/upgrade-guide/v0.2.2-rc.2/cua-macos-provider/guide.md +24 -0
  118. package/kb/extra/upgrade-guide/v0.2.2-rc.2/cua-macos-provider/guide.zh.md +24 -0
  119. package/kb/extra/upgrade-guide/v0.2.2-rc.2/cua-partial-observations/guide.md +19 -0
  120. package/kb/extra/upgrade-guide/v0.2.2-rc.2/cua-partial-observations/guide.zh.md +19 -0
  121. package/kb/extra/upgrade-guide/v0.2.2-rc.2/deepseek-files-timeout/guide.md +15 -0
  122. package/kb/extra/upgrade-guide/v0.2.2-rc.2/deepseek-files-timeout/guide.zh.md +15 -0
  123. package/kb/extra/upgrade-guide/v0.2.2-rc.2/experimental-tool-error-codes/guide.md +28 -0
  124. package/kb/extra/upgrade-guide/v0.2.2-rc.2/experimental-tool-error-codes/guide.zh.md +28 -0
  125. package/kb/extra/upgrade-guide/v0.2.2-rc.2/package-export-cleanup/guide.md +36 -0
  126. package/kb/extra/upgrade-guide/v0.2.2-rc.2/package-export-cleanup/guide.zh.md +36 -0
  127. package/kb/extra/upgrade-guide/v0.2.2-rc.2/python-ptc-removal/guide.md +22 -0
  128. package/kb/extra/upgrade-guide/v0.2.2-rc.2/python-ptc-removal/guide.zh.md +22 -0
  129. package/kb/extra/upgrade-guide/v0.2.2-rc.2/session-status-package/guide.md +31 -0
  130. package/kb/extra/upgrade-guide/v0.2.2-rc.2/session-status-package/guide.zh.md +31 -0
  131. package/kb/extra/upgrade-guide/v0.2.2-rc.2/shared-search-filter/guide.md +18 -0
  132. package/kb/extra/upgrade-guide/v0.2.2-rc.2/shared-search-filter/guide.zh.md +18 -0
  133. package/kb/extra/upgrade-guide/v0.2.2-rc.2/shell-fs-tool-error-codes/guide.md +30 -0
  134. package/kb/extra/upgrade-guide/v0.2.2-rc.2/shell-fs-tool-error-codes/guide.zh.md +30 -0
  135. package/kb/extra/web-styling.md +57 -57
  136. package/kb/extra/web-styling.zh.md +57 -57
  137. package/kb/meta/search-index.json +4508 -3980
  138. package/kb/meta/source.json +18 -18
  139. package/kb/site/develop/practice/llm-adapter.md +192 -192
  140. package/kb/site/en/develop/practice/llm-adapter.md +192 -192
  141. package/kb/site/en/guide/desktop-uninstall-cleanup.md +63 -0
  142. package/kb/site/en/guide/plugin-market.md +153 -151
  143. package/kb/site/en/guide/providers.md +234 -234
  144. package/kb/site/en/guide/quickstart.md +35 -34
  145. package/kb/site/en/reference/capability-seams.md +789 -767
  146. package/kb/site/en/reference/config-catalog.md +5432 -5128
  147. package/kb/site/en/reference/cookbook/adding-a-package.md +175 -175
  148. package/kb/site/en/reference/cookbook/adding-a-tool.md +105 -104
  149. package/kb/site/en/reference/cookbook/extension-cookbook.md +178 -135
  150. package/kb/site/en/reference/cordis-api/context.md +373 -369
  151. package/kb/site/en/reference/cordis-api/fiber.md +457 -433
  152. package/kb/site/en/reference/cordis-api/inherited.md +44 -44
  153. package/kb/site/en/reference/cordis-api/service.md +118 -107
  154. package/kb/site/en/reference/experimental-persistence-catalog.md +36 -23
  155. package/kb/site/en/reference/index.md +174 -174
  156. package/kb/site/en/reference/persistence-catalog.md +9453 -9432
  157. package/kb/site/en/reference/subsystems/compaction.md +288 -288
  158. package/kb/site/en/reference/subsystems/core.md +1172 -1171
  159. package/kb/site/en/reference/subsystems/credentials.md +526 -497
  160. package/kb/site/en/reference/subsystems/filesystem.md +708 -708
  161. package/kb/site/en/reference/subsystems/index.md +82 -82
  162. package/kb/site/en/reference/subsystems/llm-streaming.md +1290 -1288
  163. package/kb/site/en/reference/subsystems/lsp.md +230 -206
  164. package/kb/site/en/reference/subsystems/persistence.md +451 -432
  165. package/kb/site/en/reference/subsystems/plan.md +91 -91
  166. package/kb/site/en/reference/subsystems/ptc-runtime.md +295 -261
  167. package/kb/site/en/reference/subsystems/sandbox.md +250 -232
  168. package/kb/site/en/reference/subsystems/session-query.md +525 -515
  169. package/kb/site/en/reference/subsystems/session-reference.md +231 -229
  170. package/kb/site/en/reference/subsystems/session.md +1478 -1431
  171. package/kb/site/en/reference/subsystems/sidebar-right.md +165 -165
  172. package/kb/site/en/reference/subsystems/skills.md +356 -356
  173. package/kb/site/en/reference/subsystems/slots.md +235 -231
  174. package/kb/site/en/reference/subsystems/terminal.md +188 -188
  175. package/kb/site/en/reference/subsystems/tools.md +902 -891
  176. package/kb/site/en/reference/subsystems/user-questions.md +330 -327
  177. package/kb/site/en/reference/subsystems/web-client.md +161 -104
  178. package/kb/site/en/reference/subsystems/web-server.md +434 -351
  179. package/kb/site/en/reference/subsystems/web.md +268 -268
  180. package/kb/site/en/reference/subsystems/workflow.md +287 -282
  181. package/kb/site/en/reference/subsystems/workspace.md +743 -651
  182. package/kb/site/en/reference/tool-catalog.md +2867 -2704
  183. package/kb/site/guide/desktop-uninstall-cleanup.md +63 -0
  184. package/kb/site/guide/plugin-market.md +153 -151
  185. package/kb/site/guide/providers.md +234 -234
  186. package/kb/site/guide/quickstart.md +35 -34
  187. package/kb/site/reference/capability-seams.md +789 -767
  188. package/kb/site/reference/config-catalog.md +5432 -5128
  189. package/kb/site/reference/cookbook/adding-a-package.md +175 -175
  190. package/kb/site/reference/cookbook/adding-a-tool.md +107 -106
  191. package/kb/site/reference/cookbook/extension-cookbook.md +182 -139
  192. package/kb/site/reference/cordis-api/context.md +373 -369
  193. package/kb/site/reference/cordis-api/fiber.md +459 -435
  194. package/kb/site/reference/cordis-api/inherited.md +44 -44
  195. package/kb/site/reference/cordis-api/service.md +118 -107
  196. package/kb/site/reference/experimental-persistence-catalog.md +36 -23
  197. package/kb/site/reference/index.md +178 -178
  198. package/kb/site/reference/persistence-catalog.md +9453 -9432
  199. package/kb/site/reference/subsystems/compaction.md +288 -288
  200. package/kb/site/reference/subsystems/core.md +1184 -1183
  201. package/kb/site/reference/subsystems/credentials.md +526 -497
  202. package/kb/site/reference/subsystems/filesystem.md +708 -708
  203. package/kb/site/reference/subsystems/index.md +82 -82
  204. package/kb/site/reference/subsystems/llm-streaming.md +1296 -1294
  205. package/kb/site/reference/subsystems/lsp.md +230 -206
  206. package/kb/site/reference/subsystems/persistence.md +451 -432
  207. package/kb/site/reference/subsystems/plan.md +91 -91
  208. package/kb/site/reference/subsystems/ptc-runtime.md +295 -261
  209. package/kb/site/reference/subsystems/sandbox.md +250 -232
  210. package/kb/site/reference/subsystems/session-query.md +525 -515
  211. package/kb/site/reference/subsystems/session-reference.md +231 -229
  212. package/kb/site/reference/subsystems/session.md +1482 -1435
  213. package/kb/site/reference/subsystems/sidebar-right.md +165 -165
  214. package/kb/site/reference/subsystems/skills.md +356 -356
  215. package/kb/site/reference/subsystems/slots.md +239 -235
  216. package/kb/site/reference/subsystems/terminal.md +188 -188
  217. package/kb/site/reference/subsystems/tools.md +902 -891
  218. package/kb/site/reference/subsystems/user-questions.md +330 -327
  219. package/kb/site/reference/subsystems/web-client.md +161 -104
  220. package/kb/site/reference/subsystems/web-server.md +434 -351
  221. package/kb/site/reference/subsystems/web.md +268 -268
  222. package/kb/site/reference/subsystems/workflow.md +287 -282
  223. package/kb/site/reference/subsystems/workspace.md +743 -651
  224. package/kb/site/reference/tool-catalog.md +2872 -2709
  225. package/lib/index.js +359 -359
  226. package/package.json +68 -68
  227. package/skills/dsh-plugin-dev-kb.md +71 -70
  228. package/kb/extra/subsystems/office-to-pdf.md +0 -87
  229. package/kb/extra/subsystems/office-to-pdf.zh.md +0 -87
@@ -1,621 +1,631 @@
1
- # Profile management
2
-
3
- English | [中文](boot.zh.md)
4
-
5
- The [boot package group](../../packages/boot/README.md) owns launcher-provided profile access and the plugin manager. [Plugin Manager](../../packages/boot/plugin-manager/README.md) documents persistence, reload and package-operation behavior.
6
-
7
- ## Management records
8
-
9
- `PluginEntryId` identifies one Loader entry; callers obtain it from `listPlugins` rather than constructing a patch id.
10
-
11
- `PluginInfo` carries module identity, effective enablement, fiber phase and optional display `meta`, plus a unique `patchId` or a `readOnlyReason`.
12
-
13
- `BundleInfo.official` identifies project-maintained shipped optional bundles and on-demand catalog entries independently of installation. `availability` identifies a readable installation-provided or profile package, or `missing`; on-demand catalog entries exclude undeclared transitive copies. `installed` records the profile dependency declaration. An on-demand `installTarget` carries the host-derived exact spec and version. `BundleInfo` also carries the package name, optional installed version, selected enablement, removal availability, update eligibility (`updatable`), optional resolution or unsupported-platform error, and, for a bundle the profile's own dependency supplies and the installation does not, `source`: that dependency as a spec `pnpm add` accepts. Its optional `meta` and each `BundleRowInfo.meta` contain display text or a metadata diagnostic; Clients select a language at render time.
14
-
15
- `InstallBundleOptions.saveExact` passes `--save-exact` to the shared package installer. `InstallBundleOptions.enabled` defaults to true. False installs without selecting the bundle layer. `approvedBuilds` grants persistent script permission to the supplied pending package names before installation. `registry` names the registry asked first; absent, the configured one.
16
-
17
- `BundleDetail` is a profile bundle's long description: `{ status: 'found' }` with its `origin` (`locale` or `readme`), its `path` inside the package, and its `markdown`, or `{ status: 'none' }`; [`readBundleDetail`](../../packages/boot/plugin-manager/README.md#bundle-detail-documents) documents the order and the image route. `NpmFileSource` names a public npm file CDN, `jsdelivr`, `unpkg`, or `npmmirror`; a read's `npmFileSources` lists the ones to ask first.
18
-
19
- `PluginRegistries` carries the configured first registry, `null` for the one pnpm's own configuration names, the fallbacks asked after it, and `resolved`, the URL pnpm's own configuration names or `null` while unread. `InspectOptions.registry` names the registry a lookup asks first.
20
-
21
- `ChangeResult.changed` reports a disk edit independently of `application`: `applied`, `restart-required`, `overridden` or `failed`. Optional `error` carries a localizable code and external diagnostic. `packageResult` records the run's exit status, bounded output, truncation flag and complete diagnostic log path, plus `timedOut` when the manager terminated a run that stopped printing or the GitHub connection check hit its deadline; a terminated run records the coerced status 1 because its process returned none. A terminated run is classified `timeout` whatever exit status the signal left behind, so installation and removal report failure instead of success and no further registry is asked. `pendingBuilds` lists undecided packages across the profile; `approvedBuilds` records the names granted permission by this operation; `registries` lists the registries an installation asked, in order; `bundle` and `version` name the package a finished installation added and its manifest version; `failedAt` says whether the last failed run could not reach the registry it asked or the host a git or tarball spec is fetched from.
22
-
23
- ## Market records
24
-
25
- [Plugin Market](../../packages/boot/plugin-market/README.md) reads index format 1, validated by [`dsh-plugin-market-index`](../../packages/util/plugin-market-index/README.md).
26
-
27
- `MarketIndexSummary` carries one configured index URL with the `title` and `description` of its last successful read and, when the last read failed, its `error`.
28
-
29
- `MarketQuery` selects one page of an index: fuzzy `text`, a `category`, `labels` that must all be present, a `MarketSort`, `offset`, `limit` up to 100, `refresh` to fetch again instead of using a cached document, and `fetchedAt` to continue the pages of one document. `MarketSearchResult` carries the index URL, `title`, optional `description`, market `metadata`, the document's `fetchedAt`, the page's `entries`, the `total` number of matches, and the `nextOffset`. Each `MarketListingEntry` adds `defaultVersion`, the version installed by default, and `installation`, the profile's status for the package name; each of its `versions` adds `install`, the exact spec and optional first registry for `installBundle`, and `compatibility`, the evaluation of its `engines.dsh` including a version exemption.
30
-
31
- `PluginDetail` is a market entry's long description: `{ status: 'found' }` with its `origin` (`locale`, `readme`, or `repository`), its `markdown`, and a `document` id whose images `GET /api/plugin-market/detail-file` serves, or `{ status: 'none' }`. The [plugin market documents the order](../../packages/boot/plugin-market/README.md#plugin-detail-documents) its sources are read in.
32
-
33
- ## Profile reconciliation
34
-
35
- <a id="profile-reconciliation"></a>
36
-
37
- ```ts type-equiv
38
- /** Outcome of {@link Hmr.reconcileProfile}. */
39
- interface ProfileReconciliation {
40
- /** Diagnostics for Loader entries left inactive. */
41
- warnings: string[]
42
- /** Loaded modules whose files changed on disk and whose previous code keeps running until a restart. */
43
- pending: PendingModule[]
44
- /**
45
- * Why every change waits for a restart: `module-comparison` when module caches cannot be inspected or their files
46
- * compared, even when no URLs are known; `package-moved` when the runtime resolution cannot publish a moved package.
47
- */
48
- restartReason?: 'module-comparison' | 'package-moved'
49
- }
50
- ```
51
-
52
- ```ts type-equiv
53
- /** A changed module that loads only after a restart. */
54
- interface PendingModule {
55
- url: string
56
- /**
57
- * `host-module`: the process entry point's static graph imports it. `unmanaged-plugin`: it is imported by a plugin
58
- * that runs outside a traversable Loader entry. `module-comparison`: loaded modules could not be compared with disk.
59
- */
60
- reason: 'host-module' | 'unmanaged-plugin' | 'module-comparison'
61
- }
62
- ```
63
-
64
- <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
65
-
66
- <a id="cordis-surface"></a>
67
-
68
- ## Cordis API
69
-
70
- Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) — the language sides differ only in locale-specific paired document paths. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
71
-
72
- <a id="ctxactioncards--actioncards"></a>
73
-
74
- ### `ctx.actionCards` — `ActionCards`
75
-
76
- Card tool, kind registry, Session projection, user actions and status notices.
77
-
78
- ```ts cordis-catalog
79
- /**
80
- * Register one action kind for the caller's lifetime.
81
- * @param kind - the kind's skill, details schema, verbs and handler.
82
- * @returns disposer removing the kind; actions on its cards are then unavailable.
83
- * @throws when another kind already registered the same action.
84
- */
85
- register<Details>(kind: ActionCardKind<Details>): () => void
86
-
87
- /**
88
- * Record a card decision in the Session log; the next model request reports it.
89
- * @param agent - agent whose Session owns the card.
90
- * @param decision - the card's new state.
91
- * @throws when no kind ever registered the decision's action with this service, or its phase is one the projection derives.
92
- */
93
- record(agent: Agent, decision: ActionCardDecision): void
94
-
95
- /**
96
- * Read the cards of one Session.
97
- * @param session - a Session whose projections are prepared.
98
- * @returns proposals and decisions by call id.
99
- */
100
- view(session: Session): ActionCardView
101
-
102
- /**
103
- * Apply a user action to a logged card. Shared checks run first, then the kind reconciles the card; `dismiss` is
104
- * recorded here and every other verb goes to the card's kind. `dismiss` also works on an unstarted card whose kind
105
- * is no longer registered. Concurrent actions on one card share one operation.
106
- * @param agent - live root resolved from the displayed Session.
107
- * @param callId - the card's `propose_action` call id.
108
- * @param verb - `dismiss` or one of the kind's verbs.
109
- * @param payload - kind-defined fields such as a chosen location.
110
- * @returns acceptance of background work, the decision in effect, or a refusal.
111
- */
112
- @Remote act(agent: Agent, callId: ToolCallId, verb: string, payload?: Record<string, JsonValue>): Promise<ActionCardResult>
113
- ```
114
-
115
- Types: [Agent](core.md) · [Session](session.md) · [ToolCallId](core.md)
116
-
117
- Source: [`packages/experimental/action-cards/src/index.ts`](../../packages/experimental/action-cards/src/index.ts)
118
-
119
- <a id="ctxconfigeditor--configeditor"></a>
120
-
121
- ### `ctx.configEditor` — `ConfigEditor`
122
-
123
- Persist complete raw configs and apply them through the normal Loader path.
124
-
125
- ```ts cordis-catalog
126
- /** Addressable profile rows; nested Includes have independent configuration ownership.
127
- * @returns Active entries with unique profile patch ids.
128
- */
129
- entries(): Entry[]
130
-
131
- /** Read inherited and explicit profile values for the active entries.
132
- * @returns Detached layer values alongside their Loader entries.
133
- */
134
- configuration(): Array<{ entry: Entry; inherited: Record<string, unknown>; override: Record<string, unknown> }>
135
-
136
- /** Validate, persist, and reconcile a plugin's next config; ordinary fields keep normal lifecycle rules.
137
- * @param entry Current Loader entry, also used to detect replacement during the write.
138
- * @param change Derive a raw config from the current entry and its inherited layer.
139
- * @returns Fulfillment after Loader reconciliation completes.
140
- */
141
- async edit( entry: Entry, change: (current: Record<string, unknown>, inherited: Record<string, unknown>) => Record<string, unknown>, ): Promise<void>
142
- ```
143
-
144
- Source: [`packages/boot/config-editor/src/index.ts`](../../packages/boot/config-editor/src/index.ts)
145
-
146
- <a id="ctxheadlessstartup--headlessstartupvalues"></a>
147
-
148
- ### `ctx.headlessStartup` — `HeadlessStartupValues`
149
-
150
- What the runner row reads from HEADLESS_STARTUP_SERVICE.
151
-
152
- Source: [`packages/bundle/headless/src/startup.ts`](../../packages/bundle/headless/src/startup.ts)
153
-
154
- <a id="ctxhmr--hmr"></a>
155
-
156
- ### `ctx.hmr` — `Hmr`
157
-
158
- Hot reload service with Cordis-compatible module configuration and events.
159
-
160
- ```ts cordis-catalog
161
- /** Serialize a caller-owned mutation with all automatic reload paths.
162
- * @param operation Work that must not overlap module or configuration replacement.
163
- * @returns The operation result after its asynchronous work completes.
164
- */
165
- runExclusive<T>(operation: () => Promise<T>): Promise<T>
166
-
167
- /** Watch a configuration path through the same queue as module replacement.
168
- * @param filename Absolute path, which may not exist yet.
169
- * @param refresh Rebuilds configuration from its current files and awaits Loader completion.
170
- * @returns Disposer closing this registration and waiting for its pending refresh.
171
- */
172
- async watchConfig(filename: string, refresh: () => Promise<void>): Promise<() => Promise<void>>
173
-
174
- /** Read direct module dependency URLs from the active Node loader.
175
- * @param url Module URL.
176
- * @returns Linked module URLs, or an empty list for an uncached module.
177
- */
178
- async getLinked(url: string): Promise<string[]>
179
-
180
- /**
181
- * Recompose the profile from its manifest and patch files, replacing running plugins whose loaded files below the
182
- * profile directory or its linked package targets changed on disk, and publishing its runtime resolution. Changed
183
- * modules are evicted and the Loader entries running them stop; app-boot's {@link recomposeProfile} then publishes the
184
- * resolution, applies the generation, starts the stopped entries with the current files and configuration,
185
- * imports entries whose import failed again, and judges activation. Afterwards the modules below the mappings the
186
- * recomposition dropped are evicted, so a removed or deselected package is imported afresh when it returns. Callers run
187
- * inside {@link runExclusive}.
188
- * @param requiredIds Entry ids whose inactive state is reported as a failure even when it predates this call.
189
- * @returns Inactive-entry diagnostics, the changed modules that load after a restart, and a profile-wide restart reason.
190
- * @throws The patch read, publication, preparation, apply, or activation failure of the recomposition, including a
191
- * replacement plugin that fails to load or start, whose previous code no longer runs.
192
- */
193
- async reconcileProfile(requiredIds: readonly string[] = []): Promise<ProfileReconciliation>
194
- ```
195
-
196
- Source: [`packages/boot/hmr/src/index.ts`](../../packages/boot/hmr/src/index.ts)
197
-
198
- <a id="ctxpluginmanager--pluginmanager"></a>
199
-
200
- ### `ctx.pluginManager` — `PluginManager`
201
-
202
- Manage profile files and apply their declared reload lifecycle.
203
-
204
- ```ts cordis-catalog
205
- /**
206
- * Read a bundle's long description: the Markdown file its locale `meta.detail` names in `language`, otherwise its
207
- * README. An installed bundle is read from its directory without network access; an official bundle the installation
208
- * offers before it is installed is read from the npm file CDNs at its offered version. Nothing is cached.
209
- * @param name - the bundle's package name, as `listBundles()` lists it.
210
- * @param language - the display language, such as `zh-CN`; documents fall back through its prefixes to English.
211
- * @param options - `npmFileSources` names npm file CDNs to ask first for an offered bundle, in order, such as the one
212
- * a Client measured as fastest; configured CDNs it omits follow, and CDNs that are not configured are not asked.
213
- * @returns the document with its origin and path, or `none`.
214
- * @throws {RemoteError} `plugin-manager/unknown-bundle`, `plugin-manager/invalid-language`, or
215
- * `plugin-manager/detail-unavailable`.
216
- */
217
- @Remote async readBundleDetail(name: string, language: string, options?: { npmFileSources?: NpmFileSource[] }): Promise<BundleDetail>
218
-
219
- /** Read exact plugin-version exemptions saved in this profile.
220
- * @returns Accepted package-name@version keys with the runtime versions they may run on, and any
221
- * record or file problem the reader rejected, which the caller reports instead of failing.
222
- */
223
- @Remote listVersionExemptions(): { exemptions: Record<string, string[]>; warnings: string[] }
224
-
225
- /** Grant or revoke one exact plugin/runtime exemption and reevaluate live plugins.
226
- * @param packageVersion Exact manifest package name followed by @ and its version; never an installation spec or alias.
227
- * @param runtimeVersion Exact current DSH version for grants; revocation may name a previous runtime.
228
- * @param enabled Whether to grant rather than revoke the exemption.
229
- * @param acceptRisk Required true for grants after the user accepts possible crashes and data loss.
230
- * @returns Saved and runtime outcomes. Startup-only profiles require restart.
231
- */
232
- @Remote setVersionExemption(packageVersion: string, runtimeVersion: string, enabled: boolean, acceptRisk?: boolean): Promise<ChangeResult>
233
-
234
- /** Read current plugins, including why a row cannot be changed through the profile patch.
235
- * @returns Current runtime entries with persistent patch targets.
236
- */
237
- @Remote async listPlugins(): Promise<PluginInfo[]>
238
-
239
- /** Read installed, installation-provided, and offline Official catalog bundles, plus selected non-bundle names.
240
- * A dependency without a bundle patch is listed, as a `not-bundle` problem, only while it is selected.
241
- * @returns Package versions, manifest descriptions, the installable spec of profile dependencies, rows, optional
242
- * display metadata, activation selections, whether the installation offers the bundle, and removal availability.
243
- */
244
- @Remote listBundles(): Promise<BundleInfo[]>
245
-
246
- /** Read the registries this manager asks: the configured first one, its fallbacks in order, and what pnpm's own configuration names.
247
- * @returns The registries in pnpm's comparison form; null is the one pnpm's own configuration names, `resolved` as pnpm reads it now.
248
- */
249
- @Remote async registries(): Promise<PluginRegistries>
250
-
251
- /** Read what a spec names before installing it.
252
- * @param spec One package spec: a registry name, an absolute path, a git address, or a tarball.
253
- * @param options The registry asked first.
254
- * @param signal Ends a registry lookup early.
255
- * @returns The package the spec names, or why it is refused.
256
- */
257
- @Remote async inspect(spec: string, options?: InspectOptions, signal?: AbortSignal): Promise<PluginSpecInspection>
258
-
259
- /** Read the published versions newer than an installed registry package's version, from the first registry that answers.
260
- * Official bundles follow the DSH version and are not listed.
261
- * @param name Installed profile dependency name.
262
- * @param options The registry asked first; absent, the one the package was installed from in this process, else the configured one.
263
- * @param signal Ends the lookups early.
264
- * @returns At most `versionListLimit` newer versions, newest first, with their tags, deprecation, bundle declaration,
265
- * and DSH compatibility, and the registry that answered; or why no list could be read, with every registry asked.
266
- */
267
- @Remote async listVersions(name: string, options?: ListVersionsOptions, signal?: AbortSignal): Promise<PluginVersionList>
268
-
269
- /**
270
- * Replace an installed registry bundle with a newer published version. The target is checked on the registry first:
271
- * it must exist, declare a bundle, and accept the running DSH version, or nothing changes. With HMR the installed
272
- * version is removed, so its plugins stop, and the target is installed with the same selection; when that
273
- * installation fails or is cancelled, the removed version is installed again from the registry it came from.
274
- * Without HMR the target is installed over the running version and the result reports the restart.
275
- * @param name Installed profile dependency name.
276
- * @param version Exact published version newer than the installed one.
277
- * @param options The registry asked first, as for `listVersions`, and the request id naming the progress and the
278
- * target installation's logs and cancellation.
279
- * @returns The versions, the last step that ran with its result, and the reinstallation when one ran.
280
- */
281
- @Remote async updateBundle(name: string, version: string, options?: UpdateBundleOptions): Promise<PluginUpdateResult>
282
-
283
- /** Persist a plugin entry's desired enablement and apply it on live profiles.
284
- * @param id Loader entry identity returned by listPlugins.
285
- * @param enabled Whether the plugin should run.
286
- * @returns Saved and runtime outcomes, including higher-priority overrides.
287
- */
288
- @Remote setPluginEnabled(id: PluginEntryId, enabled: boolean): Promise<ChangeResult>
289
-
290
- /** Select or remove a bundle layer while retaining installed dependencies.
291
- * @param name Bundle package name.
292
- * @param enabled Whether the bundle contributes its patch layer.
293
- * @returns Persisted and runtime outcomes.
294
- */
295
- @Remote setBundleEnabled(name: string, enabled: boolean): Promise<ChangeResult>
296
-
297
- /**
298
- * Install a package using the same pnpm implementation as dsh plugin. GitHub
299
- * repositories get a connection check bounded by githubConnectionTimeoutMs before pnpm starts;
300
- * only network failures or timeouts stop installation, and a stop streams the check's diagnostic
301
- * as the installation's install-log run under its request id, while pnpm owns authentication and transport fallback. An
302
- * HTTP(S) Git URL on another host is installed over SSH instead when access probes bounded by gitTransportTimeoutMs
303
- * find that only SSH can read it. A run
304
- * that fails, is cancelled, or adds a package without a bundle patch restores
305
- * `package.json` and `pnpm-lock.yaml` as they were; downloaded files can stay.
306
- * @param spec One package spec, including local paths relative to the invocation directory.
307
- * @param options Whether to activate the installed bundle (defaults to true), the request id a cancellation names,
308
- * the pending build scripts to allow, whether to save an exact dependency, and the registry asked first.
309
- * @returns Package-manager diagnostics, the registries asked, and the observed activation outcome.
310
- */
311
- @Remote installBundle(spec: string, options?: InstallBundleOptions): Promise<ChangeResult>
312
-
313
- /** Recover the result of an active installation without cancelling it.
314
- * @param requestId The id supplied when installation started.
315
- * @returns The installation's outcome after it settles, or null if no active request has that id.
316
- * Completed results are not retained; null establishes neither success nor cancellation.
317
- */
318
- @Remote async waitForInstall(requestId: PluginInstallRequestId): Promise<ChangeResult | null>
319
-
320
- /** Stop an installation this manager owns and wait until its files are back.
321
- * @param requestId The id the installation was started with.
322
- * @returns `cancelled` once the Git check or pnpm exited and the files are restored, `too-late` once the bundle is being
323
- * applied, `not-running` for any other id.
324
- */
325
- @Remote async cancelInstall(requestId: PluginInstallRequestId): Promise<PluginInstallCancellation>
326
-
327
- /** Unload and remove a profile-owned bundle dependency through dsh plugin's pnpm path; a selected name no
328
- * dependency holds is only deselected.
329
- * @param name Installed dependency or selected bundle name.
330
- * @returns Removal diagnostics and the remaining profile state.
331
- */
332
- @Remote removeBundle(name: string): Promise<ChangeResult>
333
- ```
334
-
335
- Source: [`packages/boot/plugin-manager/src/index.ts`](../../packages/boot/plugin-manager/src/index.ts)
336
-
337
- <a id="ctxpluginmarket--pluginmarket"></a>
338
-
339
- ### `ctx.pluginMarket` — `PluginMarket`
340
-
341
- Fetches, validates, and caches configured market indexes; annotates entries with the profile's installation facts.
342
-
343
- ```ts cordis-catalog
344
- /**
345
- * List the configured index sources without fetching them.
346
- * @returns every source in order, with the title of its last successful read and, when the last read failed, its error.
347
- */
348
- @Remote listIndexes(): MarketIndexSummary[]
349
-
350
- /**
351
- * Replace the configured index sources through Settings, without remounting this service.
352
- * `plugin-market/changed` announces the committed list. A URL already configured is kept as written, so a client can
353
- * add or remove sources beside one that `listIndexes` reports as unusable.
354
- * @param urls - index URLs in display order.
355
- * @throws {RemoteError} `plugin-market/invalid-index-url` for an invalid new URL or a repeated URL;
356
- * `plugin-market/settings-unavailable` without Settings or a profile entry.
357
- */
358
- @Remote async setIndexes(urls: string[]): Promise<void>
359
-
360
- /**
361
- * Return one page of the plugins of a configured index that match a query. Concurrent reads of a URL share one
362
- * fetch; a successful document is reused for `cacheTtlMs` unless `refresh` is set. Matching and ordering read only
363
- * the document; installation status and compatibility are computed for the returned page on every call.
364
- * @param url - a configured index URL.
365
- * @param query - text, filters, order, page, and whether to bypass the cached document.
366
- * @returns the index header, the page's plugins with each plugin's default version and installation status and each
367
- * version's compatibility and install arguments, the number of matches, and the next page's offset.
368
- * @throws {RemoteError} `plugin-market/invalid-query`, `plugin-market/unknown-index`, `plugin-market/invalid-index-url`,
369
- * `plugin-market/fetch-failed`, or `plugin-market/invalid-index`.
370
- */
371
- @Remote async search(url: string, query: MarketQuery): Promise<MarketSearchResult>
372
-
373
- /**
374
- * Read one plugin of a configured index, using the cached document as `search` does.
375
- * @param url - a configured index URL.
376
- * @param name - the plugin's package name.
377
- * @returns the plugin with its default version, installation status, and annotated versions; undefined when the
378
- * index does not list it.
379
- * @throws {RemoteError} `plugin-market/unknown-index`, `plugin-market/invalid-index-url`, `plugin-market/fetch-failed`,
380
- * or `plugin-market/invalid-index`.
381
- */
382
- async entry(url: string, name: string): Promise<MarketListingEntry | undefined>
383
-
384
- /**
385
- * Read the long description of one listed version of a plugin market entry, from the version's source: the npm file
386
- * CDNs for a public npm version, or its pinned Git commit. The Markdown file the package's locale `meta.detail` names
387
- * in `language` comes first, then the package's README, then the README of the entry's `repository`, or for an npm
388
- * version without one, of its `package.json` `repository`, at the default branch. An npm version from another
389
- * registry has no readable package files, so only the entry's `repository` is read.
390
- * @param url - a configured index URL.
391
- * @param name - the plugin's package name.
392
- * @param version - one listed version.
393
- * @param language - the display language, such as `zh-CN`; documents fall back through its prefixes to English.
394
- * @param options - `refresh` reads again instead of reusing a result cached for `cacheTtlMs`; `npmFileSources` names
395
- * npm file CDNs to ask first for an npm version, in order; configured CDNs it omits follow, and CDNs that are not
396
- * configured are not asked.
397
- * @returns the document with its origin and image document id, or `none`.
398
- * @throws {RemoteError} the failures of `search`, `plugin-market/unknown-plugin` for an unlisted plugin or version,
399
- * `plugin-market/invalid-query`, or `plugin-market/detail-unavailable`.
400
- */
401
- @Remote async readEntryDetail( url: string, name: string, version: string, language: string, options?: { refresh?: boolean; npmFileSources?: NpmFileSource[] }, ): Promise<PluginDetail>
402
- ```
403
-
404
- Source: [`packages/boot/plugin-market/src/index.ts`](../../packages/boot/plugin-market/src/index.ts)
405
-
406
- <a id="ctxpluginrecommendations--pluginrecommendations"></a>
407
-
408
- ### `ctx.pluginRecommendations` — `PluginRecommendations`
409
-
410
- Catalog lookups for card text and the enabling behind the `enable_official_plugin` card.
411
-
412
- ```ts cordis-catalog
413
- /**
414
- * Read the current catalog text for a logged card.
415
- * @param agent - Exact live root resolved by the Gateway from the Session id.
416
- * @param callId - The card's `propose_action` call id, never a package supplied by the browser.
417
- * @returns the plugin's title, description and selection, or a refusal when the card names no available official plugin.
418
- */
419
- @Remote async describe(agent: Agent, callId: ToolCallId): Promise<RecommendationDetails>
420
- ```
421
-
422
- Types: [Agent](core.md) · [ToolCallId](core.md)
423
-
424
- Source: [`packages/experimental/plugin-recommendations/src/index.ts`](../../packages/experimental/plugin-recommendations/src/index.ts)
425
-
426
- <a id="ctxpluginregistryprobe--pluginregistryprobe"></a>
427
-
428
- ### `ctx.pluginRegistryProbe` — `PluginRegistryProbe`
429
-
430
- Compares public registry responses on the Host; the Client owns the initial selection.
431
-
432
- ```ts cordis-catalog
433
- /**
434
- * Race npm and npmmirror HTTPS ping responses through the Host's fetch proxy.
435
- * Concurrent readers share a probe; a winner cancels and awaits the other request.
436
- * @returns the first registry with a successful response, or null when disabled or neither responds successfully; results are cached.
437
- * @throws rejects when the service has been unloaded.
438
- */
439
- @Remote async fastest(): Promise<string | null>
440
- ```
441
-
442
- Source: [`packages/client/ui-plugin-manager/src/index.ts`](../../packages/client/ui-plugin-manager/src/index.ts)
443
-
444
- <a id="ctxprofilecontext--profilecontext"></a>
445
-
446
- ### `ctx.profileContext` — `ProfileContext`
447
-
448
- Current profile facts; scheduling and mutation belong to their callers.
449
-
450
- Source: [`packages/boot/app-boot/src/profile-context.ts`](../../packages/boot/app-boot/src/profile-context.ts)
451
-
452
- <a id="app-boot-events"></a>
453
-
454
- ### `app-boot/*` events
455
-
456
- <a id="app-bootconfig-reload--emit"></a>
457
-
458
- #### `app-boot/config-reload` — emit
459
-
460
- Profile patches were reconciled into the running Loader tree: every entry update settled and no new inactive entry was introduced. Carries no diff; listeners re-read Loader entries.
461
-
462
- ```ts cordis-catalog
463
- /**
464
- * Profile patches were reconciled into the running Loader tree: every entry update settled and no new
465
- * inactive entry was introduced. Carries no diff; listeners re-read Loader entries.
466
- * @mode emit
467
- */
468
- 'app-boot/config-reload'(): void
469
- ```
470
-
471
- Source: [`packages/boot/app-boot/src/index.ts`](../../packages/boot/app-boot/src/index.ts)
472
-
473
- <a id="hmr-events"></a>
474
-
475
- ### `hmr/*` events
476
-
477
- <a id="hmrchange--emit"></a>
478
-
479
- #### `hmr/change` — emit
480
-
481
- A watched file has no module or configuration handler.
482
-
483
- ```ts cordis-catalog
484
- /** A watched file has no module or configuration handler.
485
- * @mode emit
486
- * @param url Canonical file URL.
487
- */
488
- 'hmr/change'(url: string): void
489
- ```
490
-
491
- Source: [`packages/boot/hmr/src/index.ts`](../../packages/boot/hmr/src/index.ts)
492
-
493
- <a id="hmrreload--emit"></a>
494
-
495
- #### `hmr/reload` — emit
496
-
497
- Module replacements have finished loading.
498
-
499
- ```ts cordis-catalog
500
- /** Module replacements have finished loading.
501
- * @mode emit
502
- * @param reloads Replaced plugins and their module locations.
503
- */
504
- 'hmr/reload'(reloads: Map<Plugin, Reload>): void
505
- ```
506
-
507
- Source: [`packages/boot/hmr/src/index.ts`](../../packages/boot/hmr/src/index.ts)
508
-
509
- <a id="plugin-manager-events"></a>
510
-
511
- ### `plugin-manager/*` events
512
-
513
- <a id="plugin-managerchanged--emit"></a>
514
-
515
- #### `plugin-manager/changed` — emit
516
-
517
- The profile's plugins, bundles, or composition changed: a manager operation completed. A patch generation applied outside the manager, by HMR's watcher after a CLI or hand edit, announces nothing here.
518
-
519
- ```ts cordis-catalog
520
- /**
521
- * The profile's plugins, bundles, or composition changed: a manager
522
- * operation completed. A patch generation applied outside the manager,
523
- * by HMR's watcher after a CLI or hand edit, announces nothing here.
524
- * @mode emit
525
- * @param change - what changed.
526
- */
527
- 'plugin-manager/changed'(change: PluginChange): void
528
- ```
529
-
530
- Source: [`packages/boot/plugin-manager/src/types.ts`](../../packages/boot/plugin-manager/src/types.ts)
531
-
532
- <a id="plugin-managerinstall-log--emit"></a>
533
-
534
- #### `plugin-manager/install-log` — emit
535
-
536
- One chunk of an installation run's output, streamed as the run produces it.
537
-
538
- ```ts cordis-catalog
539
- /**
540
- * One chunk of an installation run's output, streamed as the run produces it.
541
- * @mode emit
542
- * @param chunk - the chunk and the run it belongs to.
543
- */
544
- 'plugin-manager/install-log'(chunk: PluginInstallLogChunk): void
545
- ```
546
-
547
- Source: [`packages/boot/plugin-manager/src/types.ts`](../../packages/boot/plugin-manager/src/types.ts)
548
-
549
- <a id="plugin-managerinstall-state--emit"></a>
550
-
551
- #### `plugin-manager/install-state` — emit
552
-
553
- An installation moved between its Host phases. `installing` is announced once per registry the installation asks, with the attempt's registry and position; `cancelling` and `applying` once.
554
-
555
- ```ts cordis-catalog
556
- /**
557
- * An installation moved between its Host phases. `installing` is announced once per registry the
558
- * installation asks, with the attempt's registry and position; `cancelling` and `applying` once.
559
- * @mode emit
560
- * @param progress - the installation's request id and phase, with the attempt while installing.
561
- */
562
- 'plugin-manager/install-state'(progress: PluginInstallProgress): void
563
- ```
564
-
565
- Source: [`packages/boot/plugin-manager/src/types.ts`](../../packages/boot/plugin-manager/src/types.ts)
566
-
567
- <a id="plugin-manageroperation--parallel"></a>
568
-
569
- #### `plugin-manager/operation` — parallel
570
-
571
- One manager invocation started or ended; subscribers run independently without delaying management.
572
-
573
- ```ts cordis-catalog
574
- /**
575
- * One manager invocation started or ended; subscribers run independently without delaying management.
576
- * @mode parallel
577
- * @param operation - Correlated operation facts; a start without an end has an unknown outcome.
578
- */
579
- 'plugin-manager/operation'(operation: PluginOperation): void | Promise<void>
580
- ```
581
-
582
- Source: [`packages/boot/plugin-manager/src/types.ts`](../../packages/boot/plugin-manager/src/types.ts)
583
-
584
- <a id="plugin-managerupdate-state--emit"></a>
585
-
586
- #### `plugin-manager/update-state` — emit
587
-
588
- An update moved to its next step: checking the target, removing the installed version, installing the target, or reinstalling the removed version after the target failed. Announced once per step.
589
-
590
- ```ts cordis-catalog
591
- /**
592
- * An update moved to its next step: checking the target, removing the installed version, installing the target,
593
- * or reinstalling the removed version after the target failed. Announced once per step.
594
- * @mode emit
595
- * @param progress - the update's request id and step.
596
- */
597
- 'plugin-manager/update-state'(progress: PluginUpdateProgress): void
598
- ```
599
-
600
- Source: [`packages/boot/plugin-manager/src/types.ts`](../../packages/boot/plugin-manager/src/types.ts)
601
-
602
- <a id="plugin-market-events"></a>
603
-
604
- ### `plugin-market/*` events
605
-
606
- <a id="plugin-marketchanged--emit"></a>
607
-
608
- #### `plugin-market/changed` — emit
609
-
610
- The configured index sources changed.
611
-
612
- ```ts cordis-catalog
613
- /**
614
- * The configured index sources changed.
615
- * @mode emit
616
- */
617
- 'plugin-market/changed'(): void
618
- ```
619
-
620
- Source: [`packages/boot/plugin-market/src/types.ts`](../../packages/boot/plugin-market/src/types.ts)
621
- <!-- END GENERATED cordis-surface -->
1
+ # Profile management
2
+
3
+ English | [中文](boot.zh.md)
4
+
5
+ The [boot package group](../../packages/boot/README.md) owns launcher-provided profile access and the plugin manager. [Plugin Manager](../../packages/boot/plugin-manager/README.md) documents persistence, reload and package-operation behavior.
6
+
7
+ ## Management records
8
+
9
+ `PluginEntryId` identifies one Loader entry; callers obtain it from `listPlugins` rather than constructing a patch id.
10
+
11
+ `PluginInfo` carries module identity, effective enablement, fiber phase and optional display `meta`, plus a unique `patchId` or a `readOnlyReason`.
12
+
13
+ `BundleInfo.official` identifies project-maintained shipped optional bundles and on-demand catalog entries independently of installation. `availability` identifies a readable installation-provided or profile package, or `missing`; on-demand catalog entries exclude undeclared transitive copies. `installed` records the profile dependency declaration. An on-demand `installTarget` carries the host-derived exact spec and version. `BundleInfo` also carries the package name, optional installed version, selected enablement, removal availability, update method (`update`: `registry` or `git`, absent when the bundle cannot be updated), optional resolution or unsupported-platform error, and, for a bundle the profile's own dependency supplies and the installation does not, `source`: that dependency as a spec `pnpm add` accepts. Its optional `meta` and each `BundleRowInfo.meta` contain display text or a metadata diagnostic; Clients select a language at render time.
14
+
15
+ `InstallBundleOptions.saveExact` passes `--save-exact` to the shared package installer. `InstallBundleOptions.enabled` defaults to true. False installs without selecting the bundle layer. `approvedBuilds` grants persistent script permission to the supplied pending package names before installation. `registry` names the registry asked first; absent, the configured one. `expected` names the package and manifest version the spec must install; a run that installs anything else is undone with its profile files and modules and fails with `unexpected-package`, one whose package declares no bundle fails with `not-bundle`, and one whose bundle patches cannot load fails as an operation error.
16
+
17
+ `BundleDetail` is a profile bundle's long description: `{ status: 'found' }` with its `origin` (`locale` or `readme`), its `path` inside the package, and its `markdown`, or `{ status: 'none' }`; [`readBundleDetail`](../../packages/boot/plugin-manager/README.md#bundle-detail-documents) documents the order and the image route. `NpmFileSource` names a public npm file CDN, `jsdelivr`, `unpkg`, or `npmmirror`; a read's `npmFileSources` lists the ones to ask first.
18
+
19
+ `PluginRegistries` carries the configured first registry, `null` for the one pnpm's own configuration names, the fallbacks asked after it, and `resolved`, the URL pnpm's own configuration names or `null` while unread. `InspectOptions.registry` names the registry a lookup asks first.
20
+
21
+ `ChangeResult.changed` reports a disk edit independently of `application`: `applied`, `restart-required`, `overridden` or `failed`. Optional `error` carries a localizable code and external diagnostic. `packageResult` records the run's exit status, bounded output, truncation flag and complete diagnostic log path, plus `timedOut` when the manager terminated a run that stopped printing or the GitHub connection check hit its deadline; a terminated run records the coerced status 1 because its process returned none. A terminated run is classified `timeout` whatever exit status the signal left behind, so installation and removal report failure instead of success and no further registry is asked. `pendingBuilds` lists undecided packages across the profile; `approvedBuilds` records the names granted permission by this operation; `registries` lists the registries an installation asked, in order; `bundle` and `version` name the package a finished installation added and its manifest version; `failedAt` says whether the last failed run could not reach the registry it asked or the host a git or tarball spec is fetched from.
22
+
23
+ ## Market records
24
+
25
+ [Plugin Market](../../packages/boot/plugin-market/README.md) reads index format 1, validated by [`dsh-plugin-market-index`](../../packages/util/plugin-market-index/README.md).
26
+
27
+ `MarketIndexSummary` carries one configured index URL with the `title` and `description` of its last successful read and, when the last read failed, its `error`.
28
+
29
+ `MarketQuery` selects one page of an index: fuzzy `text`, a `category`, `labels` that must all be present, a `MarketSort`, `offset`, `limit` up to 100, `refresh` to fetch again instead of using a cached document, and `fetchedAt` to continue the pages of one document. `MarketSearchResult` carries the index URL, `title`, optional `description`, market `metadata`, the document's `fetchedAt`, the page's `entries`, the `total` number of matches, and the `nextOffset`. Each `MarketListingEntry` adds `defaultVersion`, the version installed by default, and `installation`, the profile's status for the package name; each of its `versions` adds `install`, the exact spec and optional first registry for `installBundle`, `compatibility`, the evaluation of its `engines.dsh` including a version exemption, and `update`, whether the version can replace an installed Git copy through `updateBundle`: it is newer and pins a commit of the repository directory that copy came from.
30
+
31
+ `PluginDetail` is a market entry's long description: `{ status: 'found' }` with its `origin` (`locale`, `readme`, or `repository`), its `markdown`, and a `document` id whose images `GET /api/plugin-market/detail-file` serves, or `{ status: 'none' }`. The [plugin market documents the order](../../packages/boot/plugin-market/README.md#plugin-detail-documents) its sources are read in.
32
+
33
+ ## Profile reconciliation
34
+
35
+ <a id="profile-reconciliation"></a>
36
+
37
+ ```ts type-equiv
38
+ /** Outcome of {@link Hmr.reconcileProfile}. */
39
+ interface ProfileReconciliation {
40
+ /** Diagnostics for Loader entries left inactive. */
41
+ warnings: string[]
42
+ /** Loaded modules whose files changed on disk and whose previous code keeps running until a restart. */
43
+ pending: PendingModule[]
44
+ /**
45
+ * Why every change waits for a restart: `module-comparison` when module caches cannot be inspected or their files
46
+ * compared, even when no URLs are known; `package-moved` when the runtime resolution cannot publish a moved package.
47
+ */
48
+ restartReason?: 'module-comparison' | 'package-moved'
49
+ }
50
+ ```
51
+
52
+ ```ts type-equiv
53
+ /** A changed module that loads only after a restart. */
54
+ interface PendingModule {
55
+ url: string
56
+ /**
57
+ * `host-module`: the process entry point's static graph imports it. `unmanaged-plugin`: it is imported by a plugin
58
+ * that runs outside a traversable Loader entry. `module-comparison`: loaded modules could not be compared with disk.
59
+ */
60
+ reason: 'host-module' | 'unmanaged-plugin' | 'module-comparison'
61
+ }
62
+ ```
63
+
64
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
65
+
66
+ <a id="cordis-surface"></a>
67
+
68
+ ## Cordis API
69
+
70
+ Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) — the language sides differ only in locale-specific paired document paths. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
71
+
72
+ <a id="ctxactioncards--actioncards"></a>
73
+
74
+ ### `ctx.actionCards` — `ActionCards`
75
+
76
+ Card tool, kind registry, Session projection, user actions and status notices.
77
+
78
+ ```ts cordis-catalog
79
+ /**
80
+ * Register one action kind for the caller's lifetime.
81
+ * @param kind - the kind's skill, details schema, verbs and handler.
82
+ * @returns disposer removing the kind; actions on its cards are then unavailable.
83
+ * @throws when another kind already registered the same action.
84
+ */
85
+ register<Details>(kind: ActionCardKind<Details>): () => void
86
+
87
+ /**
88
+ * Record a card decision in the Session log; the next model request reports it.
89
+ * @param agent - agent whose Session owns the card.
90
+ * @param decision - the card's new state.
91
+ * @throws when no kind ever registered the decision's action with this service, or its phase is one the projection derives.
92
+ */
93
+ record(agent: Agent, decision: ActionCardDecision): void
94
+
95
+ /**
96
+ * Read the cards of one Session.
97
+ * @param session - a Session whose projections are prepared.
98
+ * @returns proposals and decisions by call id.
99
+ */
100
+ view(session: Session): ActionCardView
101
+
102
+ /**
103
+ * Apply a user action to a logged card. Shared checks run first, then the kind reconciles the card; `dismiss` is
104
+ * recorded here and every other verb goes to the card's kind. `dismiss` also works on an unstarted card whose kind
105
+ * is no longer registered. Concurrent actions on one card share one operation.
106
+ * @param agent - live root resolved from the displayed Session.
107
+ * @param callId - the card's `propose_action` call id.
108
+ * @param verb - `dismiss` or one of the kind's verbs.
109
+ * @param payload - kind-defined fields such as a chosen location.
110
+ * @returns acceptance of background work, the decision in effect, or a refusal.
111
+ */
112
+ @Remote act(agent: Agent, callId: ToolCallId, verb: string, payload?: Record<string, JsonValue>): Promise<ActionCardResult>
113
+ ```
114
+
115
+ Types: [Agent](core.md) · [Session](session.md) · [ToolCallId](core.md)
116
+
117
+ Source: [`packages/experimental/action-cards/src/index.ts`](../../packages/experimental/action-cards/src/index.ts)
118
+
119
+ <a id="ctxconfigeditor--configeditor"></a>
120
+
121
+ ### `ctx.configEditor` — `ConfigEditor`
122
+
123
+ Persist complete raw configs and apply them through the normal Loader path.
124
+
125
+ ```ts cordis-catalog
126
+ /** Addressable profile rows; nested Includes have independent configuration ownership.
127
+ * @returns Active entries with unique profile patch ids.
128
+ */
129
+ entries(): Entry[]
130
+
131
+ /** Read inherited and explicit profile values for the active entries.
132
+ * @returns Detached layer values alongside their Loader entries.
133
+ */
134
+ configuration(): Array<{ entry: Entry; inherited: Record<string, unknown>; override: Record<string, unknown> }>
135
+
136
+ /** Validate, persist, and reconcile a plugin's next config; ordinary fields keep normal lifecycle rules.
137
+ * @param entry Current Loader entry, also used to detect replacement during the write.
138
+ * @param change Derive a raw config from the current entry and its inherited layer.
139
+ * @returns Fulfillment after Loader reconciliation completes.
140
+ */
141
+ async edit( entry: Entry, change: (current: Record<string, unknown>, inherited: Record<string, unknown>) => Record<string, unknown>, ): Promise<void>
142
+ ```
143
+
144
+ Source: [`packages/boot/config-editor/src/index.ts`](../../packages/boot/config-editor/src/index.ts)
145
+
146
+ <a id="ctxheadlessstartup--headlessstartupvalues"></a>
147
+
148
+ ### `ctx.headlessStartup` — `HeadlessStartupValues`
149
+
150
+ What the runner row reads from HEADLESS_STARTUP_SERVICE.
151
+
152
+ Source: [`packages/bundle/headless/src/startup.ts`](../../packages/bundle/headless/src/startup.ts)
153
+
154
+ <a id="ctxhmr--hmr"></a>
155
+
156
+ ### `ctx.hmr` — `Hmr`
157
+
158
+ Hot reload service with Cordis-compatible module configuration and events.
159
+
160
+ ```ts cordis-catalog
161
+ /** Serialize a caller-owned mutation with all automatic reload paths.
162
+ * @param operation Work that must not overlap module or configuration replacement.
163
+ * @returns The operation result after its asynchronous work completes.
164
+ */
165
+ runExclusive<T>(operation: () => Promise<T>): Promise<T>
166
+
167
+ /** Watch a configuration path through the same queue as module replacement.
168
+ * @param filename Absolute path, which may not exist yet.
169
+ * @param refresh Rebuilds configuration from its current files and awaits Loader completion.
170
+ * @returns Disposer closing this registration and waiting for its pending refresh.
171
+ */
172
+ async watchConfig(filename: string, refresh: () => Promise<void>): Promise<() => Promise<void>>
173
+
174
+ /** Read direct module dependency URLs from the active Node loader.
175
+ * @param url Module URL.
176
+ * @returns Linked module URLs, or an empty list for an uncached module.
177
+ */
178
+ async getLinked(url: string): Promise<string[]>
179
+
180
+ /**
181
+ * Recompose the profile from its manifest and patch files, replacing running plugins whose loaded files below the
182
+ * profile directory or its linked package targets changed on disk, and publishing its runtime resolution. Changed
183
+ * modules are evicted and the Loader entries running them stop; app-boot's {@link recomposeProfile} then publishes the
184
+ * resolution, applies the generation, starts the stopped entries with the current files and configuration,
185
+ * imports entries whose import failed again, and judges activation. Afterwards the modules below the mappings the
186
+ * recomposition dropped are evicted, so a removed or deselected package is imported afresh when it returns. Callers run
187
+ * inside {@link runExclusive}.
188
+ * @param requiredIds Entry ids whose inactive state is reported as a failure even when it predates this call.
189
+ * @returns Inactive-entry diagnostics, the changed modules that load after a restart, and a profile-wide restart reason.
190
+ * @throws The patch read, publication, preparation, apply, or activation failure of the recomposition, including a
191
+ * replacement plugin that fails to load or start, whose previous code no longer runs.
192
+ */
193
+ async reconcileProfile(requiredIds: readonly string[] = []): Promise<ProfileReconciliation>
194
+ ```
195
+
196
+ Source: [`packages/boot/hmr/src/index.ts`](../../packages/boot/hmr/src/index.ts)
197
+
198
+ <a id="ctxpluginmanager--pluginmanager"></a>
199
+
200
+ ### `ctx.pluginManager` — `PluginManager`
201
+
202
+ Manage profile files and apply their declared reload lifecycle.
203
+
204
+ ```ts cordis-catalog
205
+ /**
206
+ * Read a bundle's long description: the Markdown file its locale `meta.detail` names in `language`, otherwise its
207
+ * README. An installed bundle is read from its directory without network access; an official bundle the installation
208
+ * offers before it is installed is read from the npm file CDNs at its offered version. Nothing is cached.
209
+ * @param name - the bundle's package name, as `listBundles()` lists it.
210
+ * @param language - the display language, such as `zh-CN`; documents fall back through its prefixes to English.
211
+ * @param options - `npmFileSources` names npm file CDNs to ask first for an offered bundle, in order, such as the one
212
+ * a Client measured as fastest; configured CDNs it omits follow, and CDNs that are not configured are not asked.
213
+ * @returns the document with its origin and path, or `none`.
214
+ * @throws {RemoteError} `plugin-manager/unknown-bundle`, `plugin-manager/invalid-language`, or
215
+ * `plugin-manager/detail-unavailable`.
216
+ */
217
+ @Remote async readBundleDetail(name: string, language: string, options?: { npmFileSources?: NpmFileSource[] }): Promise<BundleDetail>
218
+
219
+ /** Read exact plugin-version exemptions saved in this profile.
220
+ * @returns Accepted package-name@version keys with the runtime versions they may run on, and any
221
+ * record or file problem the reader rejected, which the caller reports instead of failing.
222
+ */
223
+ @Remote listVersionExemptions(): { exemptions: Record<string, string[]>; warnings: string[] }
224
+
225
+ /** Grant or revoke one exact plugin/runtime exemption and reevaluate live plugins.
226
+ * @param packageVersion Exact manifest package name followed by @ and its version; never an installation spec or alias.
227
+ * @param runtimeVersion Exact current DSH version for grants; revocation may name a previous runtime.
228
+ * @param enabled Whether to grant rather than revoke the exemption.
229
+ * @param acceptRisk Required true for grants after the user accepts possible crashes and data loss.
230
+ * @returns Saved and runtime outcomes. Startup-only profiles require restart.
231
+ */
232
+ @Remote setVersionExemption(packageVersion: string, runtimeVersion: string, enabled: boolean, acceptRisk?: boolean): Promise<ChangeResult>
233
+
234
+ /** Read current plugins, including why a row cannot be changed through the profile patch.
235
+ * @returns Current runtime entries with persistent patch targets.
236
+ * @throws {PluginManagerError} `PLUGIN_MANAGER_PROFILE_READ_FAILED` to in-process callers when the profile patches
237
+ * cannot be read; Remote callers receive `gateway/internal`.
238
+ */
239
+ @Remote async listPlugins(): Promise<PluginInfo[]>
240
+
241
+ /** Read installed, installation-provided, and offline Official catalog bundles, plus selected non-bundle names.
242
+ * A dependency without a bundle patch is listed, as a `not-bundle` problem, only while it is selected.
243
+ * @returns Package versions, manifest descriptions, the installable spec of profile dependencies, rows, optional
244
+ * display metadata, activation selections, whether the installation offers the bundle, and removal availability.
245
+ * @throws {PluginManagerError} `PLUGIN_MANAGER_PROFILE_READ_FAILED` to in-process callers when a profile or
246
+ * installation manifest cannot be read; Remote callers receive `gateway/internal`.
247
+ */
248
+ @Remote listBundles(): Promise<BundleInfo[]>
249
+
250
+ /** Read the registries this manager asks: the configured first one, its fallbacks in order, and what pnpm's own configuration names.
251
+ * @returns The registries in pnpm's comparison form; null is the one pnpm's own configuration names, `resolved` as pnpm reads it now.
252
+ */
253
+ @Remote async registries(): Promise<PluginRegistries>
254
+
255
+ /** Read what a spec names before installing it.
256
+ * @param spec One package spec: a registry name, an absolute path, a git address, or a tarball.
257
+ * @param options The registry asked first.
258
+ * @param signal Ends a registry lookup early.
259
+ * @returns The package the spec names, or why it is refused.
260
+ */
261
+ @Remote async inspect(spec: string, options?: InspectOptions, signal?: AbortSignal): Promise<PluginSpecInspection>
262
+
263
+ /** Read the published versions newer than an installed registry package's version, from the first registry that answers.
264
+ * Official bundles follow the DSH version and are not listed.
265
+ * @param name Installed profile dependency name.
266
+ * @param options The registry asked first; absent, the one the package was installed from in this process, else the configured one.
267
+ * @param signal Ends the lookups early.
268
+ * @returns At most `versionListLimit` newer versions, newest first, with their tags, deprecation, bundle declaration,
269
+ * and DSH compatibility, and the registry that answered; or why no list could be read, with every registry asked.
270
+ */
271
+ @Remote async listVersions(name: string, options?: ListVersionsOptions, signal?: AbortSignal): Promise<PluginVersionList>
272
+
273
+ /**
274
+ * Replace an installed bundle with a newer version. A registry copy updates to `name@version`, checked on the registry
275
+ * first: it must exist, declare a bundle, and accept the running DSH version, or nothing changes. A Git copy updates
276
+ * to the Git spec `options.spec` names, which must pin a full commit of the repository directory the copy came from;
277
+ * with HMR, a network failure or timeout reaching its repository stops the update before anything changes. pnpm reads
278
+ * a Git package only while installing it, so its bundle and compatibility are checked then. Either target
279
+ * installation is undone, profile files and modules included, before its bundle loads unless it installs `name` at
280
+ * `version`. With HMR the installed version is removed, so its plugins stop, and the target is installed with the same
281
+ * selection; when that installation fails or is cancelled, the removed version is installed again: a registry copy
282
+ * from the registry it came from, a Git copy from its saved spec. Without HMR the target is installed over the running
283
+ * version and the result reports the restart.
284
+ * @param name Installed profile dependency name.
285
+ * @param version Exact version newer than the installed one.
286
+ * @param options The registry asked first, as for `listVersions`; the Git spec of `version`, required for and accepted
287
+ * only by a bundle `listBundles` lists with `update: 'git'`; and the request id naming the progress and the target
288
+ * installation's logs and cancellation.
289
+ * @returns The versions, the last step that ran with its result, and the reinstallation when one ran.
290
+ */
291
+ @Remote async updateBundle(name: string, version: string, options?: UpdateBundleOptions): Promise<PluginUpdateResult>
292
+
293
+ /** Persist a plugin entry's desired enablement and apply it on live profiles.
294
+ * @param id Loader entry identity returned by listPlugins.
295
+ * @param enabled Whether the plugin should run.
296
+ * @returns Saved and runtime outcomes, including higher-priority overrides.
297
+ */
298
+ @Remote setPluginEnabled(id: PluginEntryId, enabled: boolean): Promise<ChangeResult>
299
+
300
+ /** Select or remove a bundle layer while retaining installed dependencies.
301
+ * @param name Bundle package name.
302
+ * @param enabled Whether the bundle contributes its patch layer.
303
+ * @returns Persisted and runtime outcomes.
304
+ */
305
+ @Remote setBundleEnabled(name: string, enabled: boolean): Promise<ChangeResult>
306
+
307
+ /**
308
+ * Install a package using the same pnpm implementation as dsh plugin. GitHub
309
+ * repositories get a connection check bounded by githubConnectionTimeoutMs before pnpm starts;
310
+ * only network failures or timeouts stop installation, and a stop streams the check's diagnostic
311
+ * as the installation's install-log run under its request id, while pnpm owns authentication and transport fallback. An
312
+ * HTTP(S) Git URL on another host is installed over SSH instead when access probes bounded by gitTransportTimeoutMs
313
+ * find that only SSH can read it. A run
314
+ * that fails, is cancelled, or adds a package without a bundle patch restores
315
+ * `package.json` and `pnpm-lock.yaml` as they were; downloaded files can stay.
316
+ * @param spec One package spec, including local paths relative to the invocation directory.
317
+ * @param options Whether to activate the installed bundle (defaults to true), the request id a cancellation names,
318
+ * the pending build scripts to allow, whether to save an exact dependency, and the registry asked first.
319
+ * @returns Package-manager diagnostics, the registries asked, and the observed activation outcome.
320
+ */
321
+ @Remote installBundle(spec: string, options?: InstallBundleOptions): Promise<ChangeResult>
322
+
323
+ /** Recover the result of an active installation without cancelling it.
324
+ * @param requestId The id supplied when installation started.
325
+ * @returns The installation's outcome after it settles, or null if no active request has that id.
326
+ * Completed results are not retained; null establishes neither success nor cancellation.
327
+ */
328
+ @Remote async waitForInstall(requestId: PluginInstallRequestId): Promise<ChangeResult | null>
329
+
330
+ /** Stop an installation this manager owns and wait until its files are back.
331
+ * @param requestId The id the installation was started with.
332
+ * @returns `cancelled` once the Git check or pnpm exited and the files are restored, `too-late` once the bundle is being
333
+ * applied, `not-running` for any other id.
334
+ */
335
+ @Remote async cancelInstall(requestId: PluginInstallRequestId): Promise<PluginInstallCancellation>
336
+
337
+ /** Unload and remove a profile-owned bundle dependency through dsh plugin's pnpm path; a selected name no
338
+ * dependency holds is only deselected.
339
+ * @param name Installed dependency or selected bundle name.
340
+ * @returns Removal diagnostics and the remaining profile state.
341
+ */
342
+ @Remote removeBundle(name: string): Promise<ChangeResult>
343
+ ```
344
+
345
+ Source: [`packages/boot/plugin-manager/src/index.ts`](../../packages/boot/plugin-manager/src/index.ts)
346
+
347
+ <a id="ctxpluginmarket--pluginmarket"></a>
348
+
349
+ ### `ctx.pluginMarket` — `PluginMarket`
350
+
351
+ Fetches, validates, and caches configured market indexes; annotates entries with the profile's installation facts.
352
+
353
+ ```ts cordis-catalog
354
+ /**
355
+ * List the configured index sources without fetching them.
356
+ * @returns every source in order, with the title of its last successful read and, when the last read failed, its error.
357
+ */
358
+ @Remote listIndexes(): MarketIndexSummary[]
359
+
360
+ /**
361
+ * Replace the configured index sources through Settings, without remounting this service.
362
+ * `plugin-market/changed` announces the committed list. A URL already configured is kept as written, so a client can
363
+ * add or remove sources beside one that `listIndexes` reports as unusable.
364
+ * @param urls - index URLs in display order.
365
+ * @throws {RemoteError} `plugin-market/invalid-index-url` for an invalid new URL or a repeated URL;
366
+ * `plugin-market/settings-unavailable` without Settings or a profile entry.
367
+ */
368
+ @Remote async setIndexes(urls: string[]): Promise<void>
369
+
370
+ /**
371
+ * Return one page of the plugins of a configured index that match a query. Concurrent reads of a URL share one
372
+ * fetch; a successful document is reused for `cacheTtlMs` unless `refresh` is set. Matching and ordering read only
373
+ * the document; installation status and compatibility are computed for the returned page on every call.
374
+ * @param url - a configured index URL.
375
+ * @param query - text, filters, order, page, and whether to bypass the cached document.
376
+ * @returns the index header, the page's plugins with each plugin's default version and installation status and each
377
+ * version's compatibility and install arguments, the number of matches, and the next page's offset.
378
+ * @throws {RemoteError} `plugin-market/invalid-query`, `plugin-market/unknown-index`, `plugin-market/invalid-index-url`,
379
+ * `plugin-market/fetch-failed`, or `plugin-market/invalid-index`.
380
+ */
381
+ @Remote async search(url: string, query: MarketQuery): Promise<MarketSearchResult>
382
+
383
+ /**
384
+ * Read one plugin of a configured index, using the cached document as `search` does.
385
+ * @param url - a configured index URL.
386
+ * @param name - the plugin's package name.
387
+ * @returns the plugin with its default version, installation status, and annotated versions; undefined when the
388
+ * index does not list it.
389
+ * @throws {RemoteError} `plugin-market/unknown-index`, `plugin-market/invalid-index-url`, `plugin-market/fetch-failed`,
390
+ * or `plugin-market/invalid-index`.
391
+ */
392
+ async entry(url: string, name: string): Promise<MarketListingEntry | undefined>
393
+
394
+ /**
395
+ * Read the long description of one listed version of a plugin market entry, from the version's source: the npm file
396
+ * CDNs for a public npm version, or its pinned Git commit. The Markdown file the package's locale `meta.detail` names
397
+ * in `language` comes first, then the package's README, then the README of the entry's `repository`, or for an npm
398
+ * version without one, of its `package.json` `repository`, at the default branch. An npm version from another
399
+ * registry has no readable package files, so only the entry's `repository` is read.
400
+ * @param url - a configured index URL.
401
+ * @param name - the plugin's package name.
402
+ * @param version - one listed version.
403
+ * @param language - the display language, such as `zh-CN`; documents fall back through its prefixes to English.
404
+ * @param options - `refresh` reads again instead of reusing a result cached for `cacheTtlMs`; `npmFileSources` names
405
+ * npm file CDNs to ask first for an npm version, in order; configured CDNs it omits follow, and CDNs that are not
406
+ * configured are not asked.
407
+ * @returns the document with its origin and image document id, or `none`.
408
+ * @throws {RemoteError} the failures of `search`, `plugin-market/unknown-plugin` for an unlisted plugin or version,
409
+ * `plugin-market/invalid-query`, or `plugin-market/detail-unavailable`.
410
+ */
411
+ @Remote async readEntryDetail( url: string, name: string, version: string, language: string, options?: { refresh?: boolean; npmFileSources?: NpmFileSource[] }, ): Promise<PluginDetail>
412
+ ```
413
+
414
+ Source: [`packages/boot/plugin-market/src/index.ts`](../../packages/boot/plugin-market/src/index.ts)
415
+
416
+ <a id="ctxpluginrecommendations--pluginrecommendations"></a>
417
+
418
+ ### `ctx.pluginRecommendations` — `PluginRecommendations`
419
+
420
+ Catalog lookups for card text and the enabling behind the `enable_official_plugin` card.
421
+
422
+ ```ts cordis-catalog
423
+ /**
424
+ * Read the current catalog text for a logged card.
425
+ * @param agent - Exact live root resolved by the Gateway from the Session id.
426
+ * @param callId - The card's `propose_action` call id, never a package supplied by the browser.
427
+ * @returns the plugin's title, description and selection, or a refusal when the card names no available official plugin.
428
+ */
429
+ @Remote async describe(agent: Agent, callId: ToolCallId): Promise<RecommendationDetails>
430
+ ```
431
+
432
+ Types: [Agent](core.md) · [ToolCallId](core.md)
433
+
434
+ Source: [`packages/experimental/plugin-recommendations/src/index.ts`](../../packages/experimental/plugin-recommendations/src/index.ts)
435
+
436
+ <a id="ctxpluginregistryprobe--pluginregistryprobe"></a>
437
+
438
+ ### `ctx.pluginRegistryProbe` — `PluginRegistryProbe`
439
+
440
+ Compares public registry responses on the Host; the Client owns the initial selection.
441
+
442
+ ```ts cordis-catalog
443
+ /**
444
+ * Race npm and npmmirror HTTPS ping responses through the Host's fetch proxy.
445
+ * Concurrent readers share a probe; a winner cancels and awaits the other request.
446
+ * @returns the first registry with a successful response, or null when disabled or neither responds successfully; results are cached.
447
+ * @throws rejects when the service has been unloaded.
448
+ */
449
+ @Remote async fastest(): Promise<string | null>
450
+ ```
451
+
452
+ Source: [`packages/client/ui-plugin-manager/src/index.ts`](../../packages/client/ui-plugin-manager/src/index.ts)
453
+
454
+ <a id="ctxprofilecontext--profilecontext"></a>
455
+
456
+ ### `ctx.profileContext` — `ProfileContext`
457
+
458
+ Current profile facts; scheduling and mutation belong to their callers.
459
+
460
+ Source: [`packages/boot/app-boot/src/profile-context.ts`](../../packages/boot/app-boot/src/profile-context.ts)
461
+
462
+ <a id="app-boot-events"></a>
463
+
464
+ ### `app-boot/*` events
465
+
466
+ <a id="app-bootconfig-reload--emit"></a>
467
+
468
+ #### `app-boot/config-reload` — emit
469
+
470
+ Profile patches were reconciled into the running Loader tree: every entry update settled and no new inactive entry was introduced. Carries no diff; listeners re-read Loader entries.
471
+
472
+ ```ts cordis-catalog
473
+ /**
474
+ * Profile patches were reconciled into the running Loader tree: every entry update settled and no new
475
+ * inactive entry was introduced. Carries no diff; listeners re-read Loader entries.
476
+ * @mode emit
477
+ */
478
+ 'app-boot/config-reload'(): void
479
+ ```
480
+
481
+ Source: [`packages/boot/app-boot/src/index.ts`](../../packages/boot/app-boot/src/index.ts)
482
+
483
+ <a id="hmr-events"></a>
484
+
485
+ ### `hmr/*` events
486
+
487
+ <a id="hmrchange--emit"></a>
488
+
489
+ #### `hmr/change` — emit
490
+
491
+ A watched file has no module or configuration handler.
492
+
493
+ ```ts cordis-catalog
494
+ /** A watched file has no module or configuration handler.
495
+ * @mode emit
496
+ * @param url Canonical file URL.
497
+ */
498
+ 'hmr/change'(url: string): void
499
+ ```
500
+
501
+ Source: [`packages/boot/hmr/src/index.ts`](../../packages/boot/hmr/src/index.ts)
502
+
503
+ <a id="hmrreload--emit"></a>
504
+
505
+ #### `hmr/reload` — emit
506
+
507
+ Module replacements have finished loading.
508
+
509
+ ```ts cordis-catalog
510
+ /** Module replacements have finished loading.
511
+ * @mode emit
512
+ * @param reloads Replaced plugins and their module locations.
513
+ */
514
+ 'hmr/reload'(reloads: Map<Plugin, Reload>): void
515
+ ```
516
+
517
+ Source: [`packages/boot/hmr/src/index.ts`](../../packages/boot/hmr/src/index.ts)
518
+
519
+ <a id="plugin-manager-events"></a>
520
+
521
+ ### `plugin-manager/*` events
522
+
523
+ <a id="plugin-managerchanged--emit"></a>
524
+
525
+ #### `plugin-manager/changed` — emit
526
+
527
+ The profile's plugins, bundles, or composition changed: a manager operation completed. A patch generation applied outside the manager, by HMR's watcher after a CLI or hand edit, announces nothing here.
528
+
529
+ ```ts cordis-catalog
530
+ /**
531
+ * The profile's plugins, bundles, or composition changed: a manager
532
+ * operation completed. A patch generation applied outside the manager,
533
+ * by HMR's watcher after a CLI or hand edit, announces nothing here.
534
+ * @mode emit
535
+ * @param change - what changed.
536
+ */
537
+ 'plugin-manager/changed'(change: PluginChange): void
538
+ ```
539
+
540
+ Source: [`packages/boot/plugin-manager/src/types.ts`](../../packages/boot/plugin-manager/src/types.ts)
541
+
542
+ <a id="plugin-managerinstall-log--emit"></a>
543
+
544
+ #### `plugin-manager/install-log` — emit
545
+
546
+ One chunk of an installation run's output, streamed as the run produces it.
547
+
548
+ ```ts cordis-catalog
549
+ /**
550
+ * One chunk of an installation run's output, streamed as the run produces it.
551
+ * @mode emit
552
+ * @param chunk - the chunk and the run it belongs to.
553
+ */
554
+ 'plugin-manager/install-log'(chunk: PluginInstallLogChunk): void
555
+ ```
556
+
557
+ Source: [`packages/boot/plugin-manager/src/types.ts`](../../packages/boot/plugin-manager/src/types.ts)
558
+
559
+ <a id="plugin-managerinstall-state--emit"></a>
560
+
561
+ #### `plugin-manager/install-state` — emit
562
+
563
+ An installation moved between its Host phases. `installing` is announced once per registry the installation asks, with the attempt's registry and position; `cancelling` and `applying` once.
564
+
565
+ ```ts cordis-catalog
566
+ /**
567
+ * An installation moved between its Host phases. `installing` is announced once per registry the
568
+ * installation asks, with the attempt's registry and position; `cancelling` and `applying` once.
569
+ * @mode emit
570
+ * @param progress - the installation's request id and phase, with the attempt while installing.
571
+ */
572
+ 'plugin-manager/install-state'(progress: PluginInstallProgress): void
573
+ ```
574
+
575
+ Source: [`packages/boot/plugin-manager/src/types.ts`](../../packages/boot/plugin-manager/src/types.ts)
576
+
577
+ <a id="plugin-manageroperation--parallel"></a>
578
+
579
+ #### `plugin-manager/operation` — parallel
580
+
581
+ One manager invocation started or ended; subscribers run independently without delaying management.
582
+
583
+ ```ts cordis-catalog
584
+ /**
585
+ * One manager invocation started or ended; subscribers run independently without delaying management.
586
+ * @mode parallel
587
+ * @param operation - Correlated operation facts; a start without an end has an unknown outcome.
588
+ */
589
+ 'plugin-manager/operation'(operation: PluginOperation): void | Promise<void>
590
+ ```
591
+
592
+ Source: [`packages/boot/plugin-manager/src/types.ts`](../../packages/boot/plugin-manager/src/types.ts)
593
+
594
+ <a id="plugin-managerupdate-state--emit"></a>
595
+
596
+ #### `plugin-manager/update-state` — emit
597
+
598
+ An update moved to its next step: checking the target, removing the installed version, installing the target, or reinstalling the removed version after the target failed. Announced once per step.
599
+
600
+ ```ts cordis-catalog
601
+ /**
602
+ * An update moved to its next step: checking the target, removing the installed version, installing the target,
603
+ * or reinstalling the removed version after the target failed. Announced once per step.
604
+ * @mode emit
605
+ * @param progress - the update's request id and step.
606
+ */
607
+ 'plugin-manager/update-state'(progress: PluginUpdateProgress): void
608
+ ```
609
+
610
+ Source: [`packages/boot/plugin-manager/src/types.ts`](../../packages/boot/plugin-manager/src/types.ts)
611
+
612
+ <a id="plugin-market-events"></a>
613
+
614
+ ### `plugin-market/*` events
615
+
616
+ <a id="plugin-marketchanged--emit"></a>
617
+
618
+ #### `plugin-market/changed` — emit
619
+
620
+ The configured index sources changed.
621
+
622
+ ```ts cordis-catalog
623
+ /**
624
+ * The configured index sources changed.
625
+ * @mode emit
626
+ */
627
+ 'plugin-market/changed'(): void
628
+ ```
629
+
630
+ Source: [`packages/boot/plugin-market/src/types.ts`](../../packages/boot/plugin-market/src/types.ts)
631
+ <!-- END GENERATED cordis-surface -->