@xrkseek/harness 0.6.21 → 0.7.0-rc.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 (677) hide show
  1. package/node_modules/@xrkseek/a2a/README.md +45 -45
  2. package/node_modules/@xrkseek/attachment/README.md +23 -23
  3. package/node_modules/@xrkseek/attachment-local/README.md +6 -6
  4. package/node_modules/@xrkseek/attachment-local/package.json +26 -26
  5. package/node_modules/@xrkseek/checkpoint/README.md +90 -90
  6. package/node_modules/@xrkseek/checkpoint/dist/store.d.ts +21 -0
  7. package/node_modules/@xrkseek/checkpoint/dist/store.d.ts.map +1 -1
  8. package/node_modules/@xrkseek/checkpoint/dist/store.js +33 -0
  9. package/node_modules/@xrkseek/checkpoint/dist/store.js.map +1 -1
  10. package/node_modules/@xrkseek/checkpoint/package.json +26 -26
  11. package/node_modules/@xrkseek/claude-code-mods/README.md +152 -0
  12. package/node_modules/@xrkseek/claude-code-mods/README.zh.md +172 -0
  13. package/node_modules/@xrkseek/claude-code-mods/dist/api.d.ts +36 -0
  14. package/node_modules/@xrkseek/claude-code-mods/dist/api.d.ts.map +1 -0
  15. package/node_modules/@xrkseek/claude-code-mods/dist/api.js +215 -0
  16. package/node_modules/@xrkseek/claude-code-mods/dist/api.js.map +1 -0
  17. package/node_modules/@xrkseek/claude-code-mods/dist/attach.d.ts +92 -0
  18. package/node_modules/@xrkseek/claude-code-mods/dist/attach.d.ts.map +1 -0
  19. package/node_modules/@xrkseek/claude-code-mods/dist/attach.js +106 -0
  20. package/node_modules/@xrkseek/claude-code-mods/dist/attach.js.map +1 -0
  21. package/node_modules/@xrkseek/claude-code-mods/dist/chain.d.ts +105 -0
  22. package/node_modules/@xrkseek/claude-code-mods/dist/chain.d.ts.map +1 -0
  23. package/node_modules/@xrkseek/claude-code-mods/dist/chain.js +324 -0
  24. package/node_modules/@xrkseek/claude-code-mods/dist/chain.js.map +1 -0
  25. package/node_modules/@xrkseek/claude-code-mods/dist/define-mod.d.ts +39 -0
  26. package/node_modules/@xrkseek/claude-code-mods/dist/define-mod.d.ts.map +1 -0
  27. package/node_modules/@xrkseek/claude-code-mods/dist/define-mod.js +39 -0
  28. package/node_modules/@xrkseek/claude-code-mods/dist/define-mod.js.map +1 -0
  29. package/node_modules/@xrkseek/claude-code-mods/dist/elements.d.ts +96 -0
  30. package/node_modules/@xrkseek/claude-code-mods/dist/elements.d.ts.map +1 -0
  31. package/node_modules/@xrkseek/claude-code-mods/dist/elements.js +171 -0
  32. package/node_modules/@xrkseek/claude-code-mods/dist/elements.js.map +1 -0
  33. package/node_modules/@xrkseek/claude-code-mods/dist/engine.d.ts +155 -0
  34. package/node_modules/@xrkseek/claude-code-mods/dist/engine.d.ts.map +1 -0
  35. package/node_modules/@xrkseek/claude-code-mods/dist/engine.js +356 -0
  36. package/node_modules/@xrkseek/claude-code-mods/dist/engine.js.map +1 -0
  37. package/node_modules/@xrkseek/claude-code-mods/dist/host-ops.d.ts +72 -0
  38. package/node_modules/@xrkseek/claude-code-mods/dist/host-ops.d.ts.map +1 -0
  39. package/node_modules/@xrkseek/claude-code-mods/dist/host-ops.js +603 -0
  40. package/node_modules/@xrkseek/claude-code-mods/dist/host-ops.js.map +1 -0
  41. package/node_modules/@xrkseek/claude-code-mods/dist/index.d.ts +112 -0
  42. package/node_modules/@xrkseek/claude-code-mods/dist/index.d.ts.map +1 -0
  43. package/node_modules/@xrkseek/claude-code-mods/dist/index.js +654 -0
  44. package/node_modules/@xrkseek/claude-code-mods/dist/index.js.map +1 -0
  45. package/node_modules/@xrkseek/claude-code-mods/dist/matcher.d.ts +45 -0
  46. package/node_modules/@xrkseek/claude-code-mods/dist/matcher.d.ts.map +1 -0
  47. package/node_modules/@xrkseek/claude-code-mods/dist/matcher.js +195 -0
  48. package/node_modules/@xrkseek/claude-code-mods/dist/matcher.js.map +1 -0
  49. package/node_modules/@xrkseek/claude-code-mods/dist/module.d.ts +74 -0
  50. package/node_modules/@xrkseek/claude-code-mods/dist/module.d.ts.map +1 -0
  51. package/node_modules/@xrkseek/claude-code-mods/dist/module.js +167 -0
  52. package/node_modules/@xrkseek/claude-code-mods/dist/module.js.map +1 -0
  53. package/node_modules/@xrkseek/claude-code-mods/dist/native-import.d.ts +31 -0
  54. package/node_modules/@xrkseek/claude-code-mods/dist/native-import.d.ts.map +1 -0
  55. package/node_modules/@xrkseek/claude-code-mods/dist/native-import.js +32 -0
  56. package/node_modules/@xrkseek/claude-code-mods/dist/native-import.js.map +1 -0
  57. package/node_modules/@xrkseek/claude-code-mods/dist/plugin-dir.d.ts +70 -0
  58. package/node_modules/@xrkseek/claude-code-mods/dist/plugin-dir.d.ts.map +1 -0
  59. package/node_modules/@xrkseek/claude-code-mods/dist/plugin-dir.js +167 -0
  60. package/node_modules/@xrkseek/claude-code-mods/dist/plugin-dir.js.map +1 -0
  61. package/node_modules/@xrkseek/claude-code-mods/dist/product-agent.d.ts +57 -0
  62. package/node_modules/@xrkseek/claude-code-mods/dist/product-agent.d.ts.map +1 -0
  63. package/node_modules/@xrkseek/claude-code-mods/dist/product-agent.js +85 -0
  64. package/node_modules/@xrkseek/claude-code-mods/dist/product-agent.js.map +1 -0
  65. package/node_modules/@xrkseek/claude-code-mods/dist/runtime.d.ts +117 -0
  66. package/node_modules/@xrkseek/claude-code-mods/dist/runtime.d.ts.map +1 -0
  67. package/node_modules/@xrkseek/claude-code-mods/dist/runtime.js +252 -0
  68. package/node_modules/@xrkseek/claude-code-mods/dist/runtime.js.map +1 -0
  69. package/node_modules/@xrkseek/claude-code-mods/dist/storage-domain.d.ts +68 -0
  70. package/node_modules/@xrkseek/claude-code-mods/dist/storage-domain.d.ts.map +1 -0
  71. package/node_modules/@xrkseek/claude-code-mods/dist/storage-domain.js +104 -0
  72. package/node_modules/@xrkseek/claude-code-mods/dist/storage-domain.js.map +1 -0
  73. package/node_modules/@xrkseek/claude-code-mods/dist/surfaces.d.ts +82 -0
  74. package/node_modules/@xrkseek/claude-code-mods/dist/surfaces.d.ts.map +1 -0
  75. package/node_modules/@xrkseek/claude-code-mods/dist/surfaces.js +243 -0
  76. package/node_modules/@xrkseek/claude-code-mods/dist/surfaces.js.map +1 -0
  77. package/node_modules/@xrkseek/claude-code-mods/dist/testing.d.ts +157 -0
  78. package/node_modules/@xrkseek/claude-code-mods/dist/testing.d.ts.map +1 -0
  79. package/node_modules/@xrkseek/claude-code-mods/dist/testing.js +266 -0
  80. package/node_modules/@xrkseek/claude-code-mods/dist/testing.js.map +1 -0
  81. package/node_modules/@xrkseek/claude-code-mods/dist/tool-names.d.ts +21 -0
  82. package/node_modules/@xrkseek/claude-code-mods/dist/tool-names.d.ts.map +1 -0
  83. package/node_modules/@xrkseek/claude-code-mods/dist/tool-names.js +37 -0
  84. package/node_modules/@xrkseek/claude-code-mods/dist/tool-names.js.map +1 -0
  85. package/node_modules/@xrkseek/claude-code-mods/dist/types.d.ts +592 -0
  86. package/node_modules/@xrkseek/claude-code-mods/dist/types.d.ts.map +1 -0
  87. package/node_modules/@xrkseek/claude-code-mods/dist/types.js +10 -0
  88. package/node_modules/@xrkseek/claude-code-mods/dist/types.js.map +1 -0
  89. package/node_modules/@xrkseek/claude-code-mods/dist/values.d.ts +58 -0
  90. package/node_modules/@xrkseek/claude-code-mods/dist/values.d.ts.map +1 -0
  91. package/node_modules/@xrkseek/claude-code-mods/dist/values.js +75 -0
  92. package/node_modules/@xrkseek/claude-code-mods/dist/values.js.map +1 -0
  93. package/node_modules/@xrkseek/claude-code-mods/dist/working-directory.d.ts +45 -0
  94. package/node_modules/@xrkseek/claude-code-mods/dist/working-directory.d.ts.map +1 -0
  95. package/node_modules/@xrkseek/claude-code-mods/dist/working-directory.js +29 -0
  96. package/node_modules/@xrkseek/claude-code-mods/dist/working-directory.js.map +1 -0
  97. package/node_modules/@xrkseek/claude-code-mods/package.json +47 -0
  98. package/node_modules/@xrkseek/code-runtime/README.md +20 -20
  99. package/node_modules/@xrkseek/core-agent/dist/index.d.ts +87 -0
  100. package/node_modules/@xrkseek/core-agent/dist/index.d.ts.map +1 -1
  101. package/node_modules/@xrkseek/core-agent/dist/index.js.map +1 -1
  102. package/node_modules/@xrkseek/core-agent-loop/dist/index.d.ts.map +1 -1
  103. package/node_modules/@xrkseek/core-agent-loop/dist/index.js +9 -1
  104. package/node_modules/@xrkseek/core-agent-loop/dist/index.js.map +1 -1
  105. package/node_modules/@xrkseek/core-agent-loop/package.json +42 -42
  106. package/node_modules/@xrkseek/core-session/README.md +35 -35
  107. package/node_modules/@xrkseek/core-session/dist/compaction.d.ts.map +1 -1
  108. package/node_modules/@xrkseek/core-session/dist/compaction.js +62 -37
  109. package/node_modules/@xrkseek/core-session/dist/compaction.js.map +1 -1
  110. package/node_modules/@xrkseek/core-session/dist/freeze.d.ts +6 -0
  111. package/node_modules/@xrkseek/core-session/dist/freeze.d.ts.map +1 -1
  112. package/node_modules/@xrkseek/core-session/dist/freeze.js +9 -0
  113. package/node_modules/@xrkseek/core-session/dist/freeze.js.map +1 -1
  114. package/node_modules/@xrkseek/core-session/dist/index.d.ts +18 -2
  115. package/node_modules/@xrkseek/core-session/dist/index.d.ts.map +1 -1
  116. package/node_modules/@xrkseek/core-session/dist/index.js +53 -12
  117. package/node_modules/@xrkseek/core-session/dist/index.js.map +1 -1
  118. package/node_modules/@xrkseek/core-session/dist/list-hints.d.ts.map +1 -1
  119. package/node_modules/@xrkseek/core-session/dist/list-hints.js +14 -4
  120. package/node_modules/@xrkseek/core-session/dist/list-hints.js.map +1 -1
  121. package/node_modules/@xrkseek/core-session/dist/repair-open-turn.d.ts +8 -1
  122. package/node_modules/@xrkseek/core-session/dist/repair-open-turn.d.ts.map +1 -1
  123. package/node_modules/@xrkseek/core-session/dist/repair-open-turn.js +14 -4
  124. package/node_modules/@xrkseek/core-session/dist/repair-open-turn.js.map +1 -1
  125. package/node_modules/@xrkseek/core-session/dist/sqlite-store.d.ts +55 -0
  126. package/node_modules/@xrkseek/core-session/dist/sqlite-store.d.ts.map +1 -1
  127. package/node_modules/@xrkseek/core-session/dist/sqlite-store.js +670 -92
  128. package/node_modules/@xrkseek/core-session/dist/sqlite-store.js.map +1 -1
  129. package/node_modules/@xrkseek/core-session/dist/store.d.ts +38 -0
  130. package/node_modules/@xrkseek/core-session/dist/store.d.ts.map +1 -1
  131. package/node_modules/@xrkseek/core-session/package.json +34 -34
  132. package/node_modules/@xrkseek/core-system-prompt/README.md +14 -14
  133. package/node_modules/@xrkseek/core-tools/dist/session-query-prompt.d.ts.map +1 -1
  134. package/node_modules/@xrkseek/core-tools/dist/session-query-prompt.js +3 -2
  135. package/node_modules/@xrkseek/core-tools/dist/session-query-prompt.js.map +1 -1
  136. package/node_modules/@xrkseek/core-tools/dist/std-tools.d.ts.map +1 -1
  137. package/node_modules/@xrkseek/core-tools/dist/std-tools.js +1 -13
  138. package/node_modules/@xrkseek/core-tools/dist/std-tools.js.map +1 -1
  139. package/node_modules/@xrkseek/exec-computer-use/README.md +14 -14
  140. package/node_modules/@xrkseek/exec-computer-use/dist/windows-uia.js +402 -402
  141. package/node_modules/@xrkseek/exec-computer-use/package.json +26 -26
  142. package/node_modules/@xrkseek/exec-fs/README.md +12 -12
  143. package/node_modules/@xrkseek/exec-fs/dist/read-image.js +4 -4
  144. package/node_modules/@xrkseek/exec-image-gen/README.md +13 -13
  145. package/node_modules/@xrkseek/exec-image-gen/package.json +28 -28
  146. package/node_modules/@xrkseek/exec-memory/README.md +14 -14
  147. package/node_modules/@xrkseek/exec-memory/dist/live-fragment.d.ts +11 -0
  148. package/node_modules/@xrkseek/exec-memory/dist/live-fragment.d.ts.map +1 -0
  149. package/node_modules/@xrkseek/exec-memory/dist/live-fragment.js +40 -0
  150. package/node_modules/@xrkseek/exec-memory/dist/live-fragment.js.map +1 -0
  151. package/node_modules/@xrkseek/exec-memory/package.json +28 -28
  152. package/node_modules/@xrkseek/exec-sandbox/README.md +15 -15
  153. package/node_modules/@xrkseek/exec-ssh/README.md +19 -19
  154. package/node_modules/@xrkseek/exec-subprocess/README.md +10 -10
  155. package/node_modules/@xrkseek/exec-video-analyze/README.md +11 -11
  156. package/node_modules/@xrkseek/exec-video-analyze/package.json +26 -26
  157. package/node_modules/@xrkseek/exec-video-gen/README.md +26 -26
  158. package/node_modules/@xrkseek/exec-voice/README.md +25 -25
  159. package/node_modules/@xrkseek/exec-web/README.md +11 -11
  160. package/node_modules/@xrkseek/llm-deepseek/README.md +22 -22
  161. package/node_modules/@xrkseek/llm-deepseek/package.json +30 -30
  162. package/node_modules/@xrkseek/llm-registry/dist/index.d.ts +2 -2
  163. package/node_modules/@xrkseek/llm-registry/dist/index.d.ts.map +1 -1
  164. package/node_modules/@xrkseek/llm-registry/dist/index.js +1 -1
  165. package/node_modules/@xrkseek/llm-registry/dist/index.js.map +1 -1
  166. package/node_modules/@xrkseek/llm-registry/dist/types.d.ts +29 -0
  167. package/node_modules/@xrkseek/llm-registry/dist/types.d.ts.map +1 -1
  168. package/node_modules/@xrkseek/llm-registry/dist/types.js +21 -0
  169. package/node_modules/@xrkseek/llm-registry/dist/types.js.map +1 -1
  170. package/node_modules/@xrkseek/mcp/README.md +78 -78
  171. package/node_modules/@xrkseek/policy/README.md +18 -18
  172. package/node_modules/@xrkseek/policy/package.json +31 -31
  173. package/node_modules/@xrkseek/preset-harness/README.md +7 -7
  174. package/node_modules/@xrkseek/preset-harness/dist/mods.d.ts +68 -0
  175. package/node_modules/@xrkseek/preset-harness/dist/mods.d.ts.map +1 -0
  176. package/node_modules/@xrkseek/preset-harness/dist/mods.js +510 -0
  177. package/node_modules/@xrkseek/preset-harness/dist/mods.js.map +1 -0
  178. package/node_modules/@xrkseek/preset-harness/dist/preset.d.ts +12 -1
  179. package/node_modules/@xrkseek/preset-harness/dist/preset.d.ts.map +1 -1
  180. package/node_modules/@xrkseek/preset-harness/dist/preset.js +73 -26
  181. package/node_modules/@xrkseek/preset-harness/dist/preset.js.map +1 -1
  182. package/node_modules/@xrkseek/preset-harness/dist/tsconfig.tsbuildinfo +1 -1
  183. package/node_modules/@xrkseek/preset-harness/package.json +9 -8
  184. package/node_modules/@xrkseek/preset-minimal/README.md +6 -6
  185. package/node_modules/@xrkseek/preset-minimal/dist/preset.d.ts.map +1 -1
  186. package/node_modules/@xrkseek/preset-minimal/dist/preset.js +9 -3
  187. package/node_modules/@xrkseek/preset-minimal/dist/preset.js.map +1 -1
  188. package/node_modules/@xrkseek/preset-minimal/dist/tsconfig.tsbuildinfo +1 -1
  189. package/node_modules/@xrkseek/preset-server/README.md +4 -4
  190. package/node_modules/@xrkseek/preset-server/dist/preset.d.ts.map +1 -1
  191. package/node_modules/@xrkseek/preset-server/dist/preset.js +2 -1
  192. package/node_modules/@xrkseek/preset-server/dist/preset.js.map +1 -1
  193. package/node_modules/@xrkseek/preset-server/dist/tsconfig.tsbuildinfo +1 -1
  194. package/node_modules/@xrkseek/protocol/README.md +34 -34
  195. package/node_modules/@xrkseek/protocol/dist/index.d.ts +3 -2
  196. package/node_modules/@xrkseek/protocol/dist/index.d.ts.map +1 -1
  197. package/node_modules/@xrkseek/protocol/dist/index.js +1 -0
  198. package/node_modules/@xrkseek/protocol/dist/index.js.map +1 -1
  199. package/node_modules/@xrkseek/protocol/dist/json-schema.d.ts +12 -0
  200. package/node_modules/@xrkseek/protocol/dist/json-schema.d.ts.map +1 -1
  201. package/node_modules/@xrkseek/protocol/dist/json-schema.js +9 -0
  202. package/node_modules/@xrkseek/protocol/dist/json-schema.js.map +1 -1
  203. package/node_modules/@xrkseek/protocol/dist/json-value.d.ts +25 -0
  204. package/node_modules/@xrkseek/protocol/dist/json-value.d.ts.map +1 -0
  205. package/node_modules/@xrkseek/protocol/dist/json-value.js +181 -0
  206. package/node_modules/@xrkseek/protocol/dist/json-value.js.map +1 -0
  207. package/node_modules/@xrkseek/protocol/dist/session-events.d.ts +21 -1
  208. package/node_modules/@xrkseek/protocol/dist/session-events.d.ts.map +1 -1
  209. package/node_modules/@xrkseek/protocol/dist/session-events.js +1 -0
  210. package/node_modules/@xrkseek/protocol/dist/session-events.js.map +1 -1
  211. package/node_modules/@xrkseek/protocol/dist/validate.d.ts +4 -1
  212. package/node_modules/@xrkseek/protocol/dist/validate.d.ts.map +1 -1
  213. package/node_modules/@xrkseek/protocol/dist/validate.js +28 -2
  214. package/node_modules/@xrkseek/protocol/dist/validate.js.map +1 -1
  215. package/node_modules/@xrkseek/schemastery/lib/index.cjs +597 -597
  216. package/node_modules/@xrkseek/schemastery/lib/index.mjs +597 -597
  217. package/node_modules/@xrkseek/schemastery/lib/types/index.d.ts +203 -203
  218. package/node_modules/@xrkseek/schemastery/src/index.d.ts +203 -203
  219. package/node_modules/@xrkseek/schemastery/src/index.ts +906 -906
  220. package/node_modules/@xrkseek/server-config/package.json +28 -28
  221. package/node_modules/@xrkseek/server-cron/README.md +12 -12
  222. package/node_modules/@xrkseek/server-cron/package.json +26 -26
  223. package/node_modules/@xrkseek/server-face/dist/adapt/history-paginate.d.ts +22 -0
  224. package/node_modules/@xrkseek/server-face/dist/adapt/history-paginate.d.ts.map +1 -1
  225. package/node_modules/@xrkseek/server-face/dist/adapt/history-paginate.js +40 -3
  226. package/node_modules/@xrkseek/server-face/dist/adapt/history-paginate.js.map +1 -1
  227. package/node_modules/@xrkseek/server-face/dist/adapt/subagent-notice.d.ts.map +1 -1
  228. package/node_modules/@xrkseek/server-face/dist/adapt/subagent-notice.js +2 -0
  229. package/node_modules/@xrkseek/server-face/dist/adapt/subagent-notice.js.map +1 -1
  230. package/node_modules/@xrkseek/server-face/dist/adapt/wire-event.d.ts +1 -0
  231. package/node_modules/@xrkseek/server-face/dist/adapt/wire-event.d.ts.map +1 -1
  232. package/node_modules/@xrkseek/server-face/dist/adapt/wire-event.js +2 -0
  233. package/node_modules/@xrkseek/server-face/dist/adapt/wire-event.js.map +1 -1
  234. package/node_modules/@xrkseek/server-face/dist/adapt/wire-ids.d.ts +5 -0
  235. package/node_modules/@xrkseek/server-face/dist/adapt/wire-ids.d.ts.map +1 -1
  236. package/node_modules/@xrkseek/server-face/dist/adapt/wire-ids.js +7 -0
  237. package/node_modules/@xrkseek/server-face/dist/adapt/wire-ids.js.map +1 -1
  238. package/node_modules/@xrkseek/server-face/dist/agent-home-boundary.d.ts +31 -0
  239. package/node_modules/@xrkseek/server-face/dist/agent-home-boundary.d.ts.map +1 -0
  240. package/node_modules/@xrkseek/server-face/dist/agent-home-boundary.js +71 -0
  241. package/node_modules/@xrkseek/server-face/dist/agent-home-boundary.js.map +1 -0
  242. package/node_modules/@xrkseek/server-face/dist/agent-home.d.ts +18 -0
  243. package/node_modules/@xrkseek/server-face/dist/agent-home.d.ts.map +1 -0
  244. package/node_modules/@xrkseek/server-face/dist/agent-home.js +64 -0
  245. package/node_modules/@xrkseek/server-face/dist/agent-home.js.map +1 -0
  246. package/node_modules/@xrkseek/server-face/dist/agent-roster-store.d.ts +41 -2
  247. package/node_modules/@xrkseek/server-face/dist/agent-roster-store.d.ts.map +1 -1
  248. package/node_modules/@xrkseek/server-face/dist/agent-roster-store.js +200 -28
  249. package/node_modules/@xrkseek/server-face/dist/agent-roster-store.js.map +1 -1
  250. package/node_modules/@xrkseek/server-face/dist/agent-team-roles.js +1 -1
  251. package/node_modules/@xrkseek/server-face/dist/agent-team-roles.js.map +1 -1
  252. package/node_modules/@xrkseek/server-face/dist/attach-http.d.ts.map +1 -1
  253. package/node_modules/@xrkseek/server-face/dist/attach-http.js +9 -0
  254. package/node_modules/@xrkseek/server-face/dist/attach-http.js.map +1 -1
  255. package/node_modules/@xrkseek/server-face/dist/boss-status-broadcast.d.ts +55 -0
  256. package/node_modules/@xrkseek/server-face/dist/boss-status-broadcast.d.ts.map +1 -0
  257. package/node_modules/@xrkseek/server-face/dist/boss-status-broadcast.js +167 -0
  258. package/node_modules/@xrkseek/server-face/dist/boss-status-broadcast.js.map +1 -0
  259. package/node_modules/@xrkseek/server-face/dist/collab-board.d.ts +12 -0
  260. package/node_modules/@xrkseek/server-face/dist/collab-board.d.ts.map +1 -1
  261. package/node_modules/@xrkseek/server-face/dist/collab-board.js +101 -19
  262. package/node_modules/@xrkseek/server-face/dist/collab-board.js.map +1 -1
  263. package/node_modules/@xrkseek/server-face/dist/context.d.ts +25 -2
  264. package/node_modules/@xrkseek/server-face/dist/context.d.ts.map +1 -1
  265. package/node_modules/@xrkseek/server-face/dist/dispatch.d.ts.map +1 -1
  266. package/node_modules/@xrkseek/server-face/dist/dispatch.js +6 -2
  267. package/node_modules/@xrkseek/server-face/dist/dispatch.js.map +1 -1
  268. package/node_modules/@xrkseek/server-face/dist/face-schema.d.ts.map +1 -1
  269. package/node_modules/@xrkseek/server-face/dist/face-schema.js +2 -1
  270. package/node_modules/@xrkseek/server-face/dist/face-schema.js.map +1 -1
  271. package/node_modules/@xrkseek/server-face/dist/fork-cut.d.ts.map +1 -1
  272. package/node_modules/@xrkseek/server-face/dist/fork-cut.js +15 -3
  273. package/node_modules/@xrkseek/server-face/dist/fork-cut.js.map +1 -1
  274. package/node_modules/@xrkseek/server-face/dist/fork-lineage.d.ts +7 -0
  275. package/node_modules/@xrkseek/server-face/dist/fork-lineage.d.ts.map +1 -1
  276. package/node_modules/@xrkseek/server-face/dist/fork-lineage.js +23 -8
  277. package/node_modules/@xrkseek/server-face/dist/fork-lineage.js.map +1 -1
  278. package/node_modules/@xrkseek/server-face/dist/handlers/band.d.ts +7 -0
  279. package/node_modules/@xrkseek/server-face/dist/handlers/band.d.ts.map +1 -0
  280. package/node_modules/@xrkseek/server-face/dist/handlers/band.js +40 -0
  281. package/node_modules/@xrkseek/server-face/dist/handlers/band.js.map +1 -0
  282. package/node_modules/@xrkseek/server-face/dist/handlers/checkpoint.d.ts.map +1 -1
  283. package/node_modules/@xrkseek/server-face/dist/handlers/checkpoint.js +81 -3
  284. package/node_modules/@xrkseek/server-face/dist/handlers/checkpoint.js.map +1 -1
  285. package/node_modules/@xrkseek/server-face/dist/handlers/remotes.d.ts.map +1 -1
  286. package/node_modules/@xrkseek/server-face/dist/handlers/remotes.js +4 -1
  287. package/node_modules/@xrkseek/server-face/dist/handlers/remotes.js.map +1 -1
  288. package/node_modules/@xrkseek/server-face/dist/handlers/session.d.ts +2 -0
  289. package/node_modules/@xrkseek/server-face/dist/handlers/session.d.ts.map +1 -1
  290. package/node_modules/@xrkseek/server-face/dist/handlers/session.js +236 -62
  291. package/node_modules/@xrkseek/server-face/dist/handlers/session.js.map +1 -1
  292. package/node_modules/@xrkseek/server-face/dist/handlers/team.d.ts.map +1 -1
  293. package/node_modules/@xrkseek/server-face/dist/handlers/team.js +100 -9
  294. package/node_modules/@xrkseek/server-face/dist/handlers/team.js.map +1 -1
  295. package/node_modules/@xrkseek/server-face/dist/handlers/worktree.d.ts +8 -1
  296. package/node_modules/@xrkseek/server-face/dist/handlers/worktree.d.ts.map +1 -1
  297. package/node_modules/@xrkseek/server-face/dist/handlers/worktree.js +15 -1
  298. package/node_modules/@xrkseek/server-face/dist/handlers/worktree.js.map +1 -1
  299. package/node_modules/@xrkseek/server-face/dist/index.d.ts +5 -1
  300. package/node_modules/@xrkseek/server-face/dist/index.d.ts.map +1 -1
  301. package/node_modules/@xrkseek/server-face/dist/index.js +5 -1
  302. package/node_modules/@xrkseek/server-face/dist/index.js.map +1 -1
  303. package/node_modules/@xrkseek/server-face/dist/instruction-authority-fragment.d.ts +19 -0
  304. package/node_modules/@xrkseek/server-face/dist/instruction-authority-fragment.d.ts.map +1 -0
  305. package/node_modules/@xrkseek/server-face/dist/instruction-authority-fragment.js +28 -0
  306. package/node_modules/@xrkseek/server-face/dist/instruction-authority-fragment.js.map +1 -0
  307. package/node_modules/@xrkseek/server-face/dist/log-cut-reset.d.ts +3 -0
  308. package/node_modules/@xrkseek/server-face/dist/log-cut-reset.d.ts.map +1 -0
  309. package/node_modules/@xrkseek/server-face/dist/log-cut-reset.js +22 -0
  310. package/node_modules/@xrkseek/server-face/dist/log-cut-reset.js.map +1 -0
  311. package/node_modules/@xrkseek/server-face/dist/managed-worktree.d.ts +66 -4
  312. package/node_modules/@xrkseek/server-face/dist/managed-worktree.d.ts.map +1 -1
  313. package/node_modules/@xrkseek/server-face/dist/managed-worktree.js +147 -5
  314. package/node_modules/@xrkseek/server-face/dist/managed-worktree.js.map +1 -1
  315. package/node_modules/@xrkseek/server-face/dist/model-catalog.d.ts.map +1 -1
  316. package/node_modules/@xrkseek/server-face/dist/model-catalog.js +60 -5
  317. package/node_modules/@xrkseek/server-face/dist/model-catalog.js.map +1 -1
  318. package/node_modules/@xrkseek/server-face/dist/projections/index.d.ts +2 -2
  319. package/node_modules/@xrkseek/server-face/dist/projections/index.d.ts.map +1 -1
  320. package/node_modules/@xrkseek/server-face/dist/projections/index.js +2 -2
  321. package/node_modules/@xrkseek/server-face/dist/projections/index.js.map +1 -1
  322. package/node_modules/@xrkseek/server-face/dist/projections/list-checkpoint-cache.d.ts +50 -4
  323. package/node_modules/@xrkseek/server-face/dist/projections/list-checkpoint-cache.d.ts.map +1 -1
  324. package/node_modules/@xrkseek/server-face/dist/projections/list-checkpoint-cache.js +167 -19
  325. package/node_modules/@xrkseek/server-face/dist/projections/list-checkpoint-cache.js.map +1 -1
  326. package/node_modules/@xrkseek/server-face/dist/projections/snapshot-keys.d.ts +21 -1
  327. package/node_modules/@xrkseek/server-face/dist/projections/snapshot-keys.d.ts.map +1 -1
  328. package/node_modules/@xrkseek/server-face/dist/projections/snapshot-keys.js +21 -1
  329. package/node_modules/@xrkseek/server-face/dist/projections/snapshot-keys.js.map +1 -1
  330. package/node_modules/@xrkseek/server-face/dist/projections/units/context-timeline.d.ts.map +1 -1
  331. package/node_modules/@xrkseek/server-face/dist/projections/units/context-timeline.js +58 -0
  332. package/node_modules/@xrkseek/server-face/dist/projections/units/context-timeline.js.map +1 -1
  333. package/node_modules/@xrkseek/server-face/dist/projections/units/cost-usage.d.ts.map +1 -1
  334. package/node_modules/@xrkseek/server-face/dist/projections/units/cost-usage.js +85 -0
  335. package/node_modules/@xrkseek/server-face/dist/projections/units/cost-usage.js.map +1 -1
  336. package/node_modules/@xrkseek/server-face/dist/projections/units/session-list-metadata.d.ts.map +1 -1
  337. package/node_modules/@xrkseek/server-face/dist/projections/units/session-list-metadata.js +14 -0
  338. package/node_modules/@xrkseek/server-face/dist/projections/units/session-list-metadata.js.map +1 -1
  339. package/node_modules/@xrkseek/server-face/dist/projections/units/title.d.ts.map +1 -1
  340. package/node_modules/@xrkseek/server-face/dist/projections/units/title.js +14 -0
  341. package/node_modules/@xrkseek/server-face/dist/projections/units/title.js.map +1 -1
  342. package/node_modules/@xrkseek/server-face/dist/projections/units/turn-outline.d.ts.map +1 -1
  343. package/node_modules/@xrkseek/server-face/dist/projections/units/turn-outline.js +24 -0
  344. package/node_modules/@xrkseek/server-face/dist/projections/units/turn-outline.js.map +1 -1
  345. package/node_modules/@xrkseek/server-face/dist/runtime.d.ts +4 -2
  346. package/node_modules/@xrkseek/server-face/dist/runtime.d.ts.map +1 -1
  347. package/node_modules/@xrkseek/server-face/dist/runtime.js +127 -17
  348. package/node_modules/@xrkseek/server-face/dist/runtime.js.map +1 -1
  349. package/node_modules/@xrkseek/server-face/dist/seat-identity.d.ts +26 -0
  350. package/node_modules/@xrkseek/server-face/dist/seat-identity.d.ts.map +1 -0
  351. package/node_modules/@xrkseek/server-face/dist/seat-identity.js +137 -0
  352. package/node_modules/@xrkseek/server-face/dist/seat-identity.js.map +1 -0
  353. package/node_modules/@xrkseek/server-face/dist/seat-titles.d.ts +29 -0
  354. package/node_modules/@xrkseek/server-face/dist/seat-titles.d.ts.map +1 -0
  355. package/node_modules/@xrkseek/server-face/dist/seat-titles.js +74 -0
  356. package/node_modules/@xrkseek/server-face/dist/seat-titles.js.map +1 -0
  357. package/node_modules/@xrkseek/server-face/dist/session-capability.d.ts.map +1 -1
  358. package/node_modules/@xrkseek/server-face/dist/session-capability.js +9 -6
  359. package/node_modules/@xrkseek/server-face/dist/session-capability.js.map +1 -1
  360. package/node_modules/@xrkseek/server-face/dist/session-cwd.d.ts.map +1 -1
  361. package/node_modules/@xrkseek/server-face/dist/session-cwd.js +3 -1
  362. package/node_modules/@xrkseek/server-face/dist/session-cwd.js.map +1 -1
  363. package/node_modules/@xrkseek/server-face/dist/session-event-window.d.ts +37 -0
  364. package/node_modules/@xrkseek/server-face/dist/session-event-window.d.ts.map +1 -0
  365. package/node_modules/@xrkseek/server-face/dist/session-event-window.js +88 -0
  366. package/node_modules/@xrkseek/server-face/dist/session-event-window.js.map +1 -0
  367. package/node_modules/@xrkseek/server-face/dist/session-identity-store.d.ts +20 -0
  368. package/node_modules/@xrkseek/server-face/dist/session-identity-store.d.ts.map +1 -0
  369. package/node_modules/@xrkseek/server-face/dist/session-identity-store.js +82 -0
  370. package/node_modules/@xrkseek/server-face/dist/session-identity-store.js.map +1 -0
  371. package/node_modules/@xrkseek/server-face/dist/session-posture.d.ts +1 -1
  372. package/node_modules/@xrkseek/server-face/dist/session-posture.d.ts.map +1 -1
  373. package/node_modules/@xrkseek/server-face/dist/session-posture.js +20 -5
  374. package/node_modules/@xrkseek/server-face/dist/session-posture.js.map +1 -1
  375. package/node_modules/@xrkseek/server-face/dist/session-query-tools.d.ts +1 -0
  376. package/node_modules/@xrkseek/server-face/dist/session-query-tools.d.ts.map +1 -1
  377. package/node_modules/@xrkseek/server-face/dist/session-query-tools.js +172 -25
  378. package/node_modules/@xrkseek/server-face/dist/session-query-tools.js.map +1 -1
  379. package/node_modules/@xrkseek/server-face/dist/session-search.d.ts +20 -2
  380. package/node_modules/@xrkseek/server-face/dist/session-search.d.ts.map +1 -1
  381. package/node_modules/@xrkseek/server-face/dist/session-search.js +125 -19
  382. package/node_modules/@xrkseek/server-face/dist/session-search.js.map +1 -1
  383. package/node_modules/@xrkseek/server-face/dist/session-status.d.ts +1 -1
  384. package/node_modules/@xrkseek/server-face/dist/session-status.d.ts.map +1 -1
  385. package/node_modules/@xrkseek/server-face/dist/session-status.js +143 -21
  386. package/node_modules/@xrkseek/server-face/dist/session-status.js.map +1 -1
  387. package/node_modules/@xrkseek/server-face/dist/session-thread-tools.d.ts.map +1 -1
  388. package/node_modules/@xrkseek/server-face/dist/session-thread-tools.js +5 -0
  389. package/node_modules/@xrkseek/server-face/dist/session-thread-tools.js.map +1 -1
  390. package/node_modules/@xrkseek/server-face/dist/session-tool-copy.d.ts.map +1 -1
  391. package/node_modules/@xrkseek/server-face/dist/session-tool-copy.js +2 -1
  392. package/node_modules/@xrkseek/server-face/dist/session-tool-copy.js.map +1 -1
  393. package/node_modules/@xrkseek/server-face/dist/settings-credentials.d.ts.map +1 -1
  394. package/node_modules/@xrkseek/server-face/dist/settings-credentials.js +10 -2
  395. package/node_modules/@xrkseek/server-face/dist/settings-credentials.js.map +1 -1
  396. package/node_modules/@xrkseek/server-face/dist/settings-schemas.d.ts.map +1 -1
  397. package/node_modules/@xrkseek/server-face/dist/settings-schemas.js +48 -10
  398. package/node_modules/@xrkseek/server-face/dist/settings-schemas.js.map +1 -1
  399. package/node_modules/@xrkseek/server-face/dist/skill-documents.d.ts.map +1 -1
  400. package/node_modules/@xrkseek/server-face/dist/skill-documents.js +14 -4
  401. package/node_modules/@xrkseek/server-face/dist/skill-documents.js.map +1 -1
  402. package/node_modules/@xrkseek/server-face/dist/skill-list.d.ts +4 -2
  403. package/node_modules/@xrkseek/server-face/dist/skill-list.d.ts.map +1 -1
  404. package/node_modules/@xrkseek/server-face/dist/skill-list.js +10 -4
  405. package/node_modules/@xrkseek/server-face/dist/skill-list.js.map +1 -1
  406. package/node_modules/@xrkseek/server-face/dist/skill-read.d.ts.map +1 -1
  407. package/node_modules/@xrkseek/server-face/dist/skill-read.js +9 -2
  408. package/node_modules/@xrkseek/server-face/dist/skill-read.js.map +1 -1
  409. package/node_modules/@xrkseek/server-face/dist/skill-source.d.ts +2 -1
  410. package/node_modules/@xrkseek/server-face/dist/skill-source.d.ts.map +1 -1
  411. package/node_modules/@xrkseek/server-face/dist/skill-source.js +12 -2
  412. package/node_modules/@xrkseek/server-face/dist/skill-source.js.map +1 -1
  413. package/node_modules/@xrkseek/server-face/dist/slash.d.ts +10 -1
  414. package/node_modules/@xrkseek/server-face/dist/slash.d.ts.map +1 -1
  415. package/node_modules/@xrkseek/server-face/dist/slash.js +97 -22
  416. package/node_modules/@xrkseek/server-face/dist/slash.js.map +1 -1
  417. package/node_modules/@xrkseek/server-face/dist/status-snapshot-cache.d.ts.map +1 -1
  418. package/node_modules/@xrkseek/server-face/dist/status-snapshot-cache.js +53 -0
  419. package/node_modules/@xrkseek/server-face/dist/status-snapshot-cache.js.map +1 -1
  420. package/node_modules/@xrkseek/server-face/dist/subagent-tools.d.ts.map +1 -1
  421. package/node_modules/@xrkseek/server-face/dist/subagent-tools.js +10 -5
  422. package/node_modules/@xrkseek/server-face/dist/subagent-tools.js.map +1 -1
  423. package/node_modules/@xrkseek/server-face/dist/types.d.ts +23 -0
  424. package/node_modules/@xrkseek/server-face/dist/types.d.ts.map +1 -1
  425. package/node_modules/@xrkseek/server-face/dist/workspace-checkpoint.d.ts +6 -1
  426. package/node_modules/@xrkseek/server-face/dist/workspace-checkpoint.d.ts.map +1 -1
  427. package/node_modules/@xrkseek/server-face/dist/workspace-checkpoint.js +17 -1
  428. package/node_modules/@xrkseek/server-face/dist/workspace-checkpoint.js.map +1 -1
  429. package/node_modules/@xrkseek/server-face/dist/workspace-face.d.ts.map +1 -1
  430. package/node_modules/@xrkseek/server-face/dist/workspace-face.js +19 -14
  431. package/node_modules/@xrkseek/server-face/dist/workspace-face.js.map +1 -1
  432. package/node_modules/@xrkseek/server-face/dist/workspace-member-look.d.ts +22 -0
  433. package/node_modules/@xrkseek/server-face/dist/workspace-member-look.d.ts.map +1 -0
  434. package/node_modules/@xrkseek/server-face/dist/workspace-member-look.js +35 -0
  435. package/node_modules/@xrkseek/server-face/dist/workspace-member-look.js.map +1 -0
  436. package/node_modules/@xrkseek/server-face/dist/workspace-orchestrate-tools.d.ts +3 -2
  437. package/node_modules/@xrkseek/server-face/dist/workspace-orchestrate-tools.d.ts.map +1 -1
  438. package/node_modules/@xrkseek/server-face/dist/workspace-orchestrate-tools.js +74 -57
  439. package/node_modules/@xrkseek/server-face/dist/workspace-orchestrate-tools.js.map +1 -1
  440. package/node_modules/@xrkseek/server-face/dist/workspace-registry.d.ts +31 -0
  441. package/node_modules/@xrkseek/server-face/dist/workspace-registry.d.ts.map +1 -1
  442. package/node_modules/@xrkseek/server-face/dist/workspace-registry.js +109 -0
  443. package/node_modules/@xrkseek/server-face/dist/workspace-registry.js.map +1 -1
  444. package/node_modules/@xrkseek/server-face/dist/workspace-store.d.ts +2 -0
  445. package/node_modules/@xrkseek/server-face/dist/workspace-store.d.ts.map +1 -1
  446. package/node_modules/@xrkseek/server-face/dist/workspace-store.js +7 -0
  447. package/node_modules/@xrkseek/server-face/dist/workspace-store.js.map +1 -1
  448. package/node_modules/@xrkseek/server-face/package.json +60 -60
  449. package/node_modules/@xrkseek/server-host/dist/agent-cache.d.ts +16 -2
  450. package/node_modules/@xrkseek/server-host/dist/agent-cache.d.ts.map +1 -1
  451. package/node_modules/@xrkseek/server-host/dist/agent-cache.js +84 -36
  452. package/node_modules/@xrkseek/server-host/dist/agent-cache.js.map +1 -1
  453. package/node_modules/@xrkseek/server-host/dist/index.d.ts +37 -6
  454. package/node_modules/@xrkseek/server-host/dist/index.d.ts.map +1 -1
  455. package/node_modules/@xrkseek/server-host/dist/index.js +124 -27
  456. package/node_modules/@xrkseek/server-host/dist/index.js.map +1 -1
  457. package/node_modules/@xrkseek/server-host/dist/log.d.ts +6 -0
  458. package/node_modules/@xrkseek/server-host/dist/log.d.ts.map +1 -1
  459. package/node_modules/@xrkseek/server-host/dist/sidebar-face-bridge.d.ts.map +1 -1
  460. package/node_modules/@xrkseek/server-host/dist/sidebar-face-bridge.js +17 -2
  461. package/node_modules/@xrkseek/server-host/dist/sidebar-face-bridge.js.map +1 -1
  462. package/node_modules/@xrkseek/server-host/dist/standing-tools.d.ts.map +1 -1
  463. package/node_modules/@xrkseek/server-host/dist/standing-tools.js +3 -3
  464. package/node_modules/@xrkseek/server-host/dist/standing-tools.js.map +1 -1
  465. package/node_modules/@xrkseek/server-host/package.json +75 -75
  466. package/node_modules/@xrkseek/server-http/dist/dsh-compat/adapter-types.d.ts +5 -0
  467. package/node_modules/@xrkseek/server-http/dist/dsh-compat/adapter-types.d.ts.map +1 -1
  468. package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-tool-pre.d.ts +1 -1
  469. package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-tool-pre.d.ts.map +1 -1
  470. package/node_modules/@xrkseek/server-http/dist/dsh-compat/generic-plugin-http.d.ts.map +1 -1
  471. package/node_modules/@xrkseek/server-http/dist/dsh-compat/generic-plugin-http.js +41 -6
  472. package/node_modules/@xrkseek/server-http/dist/dsh-compat/generic-plugin-http.js.map +1 -1
  473. package/node_modules/@xrkseek/server-http/dist/dsh-compat/genui-browser-runtime.js +188 -188
  474. package/node_modules/@xrkseek/server-http/dist/dsh-compat/index.d.ts +1 -1
  475. package/node_modules/@xrkseek/server-http/dist/dsh-compat/index.d.ts.map +1 -1
  476. package/node_modules/@xrkseek/server-http/dist/dsh-compat/index.js +1 -1
  477. package/node_modules/@xrkseek/server-http/dist/dsh-compat/index.js.map +1 -1
  478. package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-auth.d.ts.map +1 -1
  479. package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-auth.js +292 -24
  480. package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-auth.js.map +1 -1
  481. package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-gate.d.ts.map +1 -1
  482. package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-gate.js +12 -1
  483. package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-gate.js.map +1 -1
  484. package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access.d.ts +16 -1
  485. package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access.d.ts.map +1 -1
  486. package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access.js +47 -2
  487. package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access.js.map +1 -1
  488. package/node_modules/@xrkseek/server-http/dist/dsh-compat/skin-center.d.ts +1 -1
  489. package/node_modules/@xrkseek/server-http/dist/dsh-compat/token-usage-stats-dash.js +53 -53
  490. package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/mobile-gate-kit.d.ts +9 -4
  491. package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/mobile-gate-kit.d.ts.map +1 -1
  492. package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/mobile-gate-kit.js +39 -20
  493. package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/mobile-gate-kit.js.map +1 -1
  494. package/node_modules/@xrkseek/server-http/dist/index.d.ts +2 -1
  495. package/node_modules/@xrkseek/server-http/dist/index.d.ts.map +1 -1
  496. package/node_modules/@xrkseek/server-http/dist/index.js +2 -1
  497. package/node_modules/@xrkseek/server-http/dist/index.js.map +1 -1
  498. package/node_modules/@xrkseek/server-http/dist/sunflower-free/ensure.d.ts +11 -0
  499. package/node_modules/@xrkseek/server-http/dist/sunflower-free/ensure.d.ts.map +1 -0
  500. package/node_modules/@xrkseek/server-http/dist/sunflower-free/ensure.js +85 -0
  501. package/node_modules/@xrkseek/server-http/dist/sunflower-free/ensure.js.map +1 -0
  502. package/node_modules/@xrkseek/server-http/package.json +72 -72
  503. package/node_modules/@xrkseek/server-loader/dist/load.d.ts.map +1 -1
  504. package/node_modules/@xrkseek/server-loader/dist/load.js +132 -0
  505. package/node_modules/@xrkseek/server-loader/dist/load.js.map +1 -1
  506. package/node_modules/@xrkseek/session-projection/README.md +26 -26
  507. package/node_modules/@xrkseek/session-projection/dist/index.d.ts +31 -2
  508. package/node_modules/@xrkseek/session-projection/dist/index.d.ts.map +1 -1
  509. package/node_modules/@xrkseek/session-projection/dist/index.js +135 -19
  510. package/node_modules/@xrkseek/session-projection/dist/index.js.map +1 -1
  511. package/node_modules/@xrkseek/session-telemetry/README.md +11 -11
  512. package/node_modules/@xrkseek/session-telemetry/dist/index.d.ts +1 -0
  513. package/node_modules/@xrkseek/session-telemetry/dist/index.d.ts.map +1 -1
  514. package/node_modules/@xrkseek/session-telemetry/dist/index.js +1 -0
  515. package/node_modules/@xrkseek/session-telemetry/dist/index.js.map +1 -1
  516. package/node_modules/@xrkseek/session-telemetry/dist/redact.d.ts +14 -0
  517. package/node_modules/@xrkseek/session-telemetry/dist/redact.d.ts.map +1 -0
  518. package/node_modules/@xrkseek/session-telemetry/dist/redact.js +58 -0
  519. package/node_modules/@xrkseek/session-telemetry/dist/redact.js.map +1 -0
  520. package/node_modules/@xrkseek/session-telemetry/dist/wrap-store.d.ts +7 -0
  521. package/node_modules/@xrkseek/session-telemetry/dist/wrap-store.d.ts.map +1 -1
  522. package/node_modules/@xrkseek/session-telemetry/dist/wrap-store.js +43 -12
  523. package/node_modules/@xrkseek/session-telemetry/dist/wrap-store.js.map +1 -1
  524. package/node_modules/@xrkseek/session-telemetry/package.json +27 -27
  525. package/node_modules/@xrkseek/workspace/dist/durable-inject.d.ts +13 -0
  526. package/node_modules/@xrkseek/workspace/dist/durable-inject.d.ts.map +1 -1
  527. package/node_modules/@xrkseek/workspace/dist/durable-inject.js +40 -4
  528. package/node_modules/@xrkseek/workspace/dist/durable-inject.js.map +1 -1
  529. package/node_modules/@xrkseek/workspace/dist/ecosystem-instructions.d.ts +10 -9
  530. package/node_modules/@xrkseek/workspace/dist/ecosystem-instructions.d.ts.map +1 -1
  531. package/node_modules/@xrkseek/workspace/dist/ecosystem-instructions.js +67 -19
  532. package/node_modules/@xrkseek/workspace/dist/ecosystem-instructions.js.map +1 -1
  533. package/node_modules/@xrkseek/workspace/dist/index.d.ts +19 -20
  534. package/node_modules/@xrkseek/workspace/dist/index.d.ts.map +1 -1
  535. package/node_modules/@xrkseek/workspace/dist/index.js +43 -20
  536. package/node_modules/@xrkseek/workspace/dist/index.js.map +1 -1
  537. package/node_modules/@xrkseek/workspace/dist/inject-fingerprint.d.ts +2 -0
  538. package/node_modules/@xrkseek/workspace/dist/inject-fingerprint.d.ts.map +1 -1
  539. package/node_modules/@xrkseek/workspace/dist/inject-fingerprint.js +23 -12
  540. package/node_modules/@xrkseek/workspace/dist/inject-fingerprint.js.map +1 -1
  541. package/node_modules/@xrkseek/workspace/dist/inject-sources.d.ts +7 -4
  542. package/node_modules/@xrkseek/workspace/dist/inject-sources.d.ts.map +1 -1
  543. package/node_modules/@xrkseek/workspace/dist/inject-sources.js +10 -0
  544. package/node_modules/@xrkseek/workspace/dist/inject-sources.js.map +1 -1
  545. package/node_modules/@xrkseek/workspace/dist/instruction-authority.d.ts +27 -0
  546. package/node_modules/@xrkseek/workspace/dist/instruction-authority.d.ts.map +1 -0
  547. package/node_modules/@xrkseek/workspace/dist/instruction-authority.js +78 -0
  548. package/node_modules/@xrkseek/workspace/dist/instruction-authority.js.map +1 -0
  549. package/node_modules/@xrkseek/workspace/dist/skill-dirs.d.ts +7 -0
  550. package/node_modules/@xrkseek/workspace/dist/skill-dirs.d.ts.map +1 -1
  551. package/node_modules/@xrkseek/workspace/dist/skill-dirs.js +4 -2
  552. package/node_modules/@xrkseek/workspace/dist/skill-dirs.js.map +1 -1
  553. package/node_modules/@xrkseek/workspace/dist/skill-tools.js +1 -1
  554. package/node_modules/@xrkseek/workspace/dist/skill-tools.js.map +1 -1
  555. package/node_modules/@xrkseek/workspace/dist/skills.d.ts +13 -1
  556. package/node_modules/@xrkseek/workspace/dist/skills.d.ts.map +1 -1
  557. package/node_modules/@xrkseek/workspace/dist/skills.js +45 -5
  558. package/node_modules/@xrkseek/workspace/dist/skills.js.map +1 -1
  559. package/node_modules/@xrkseek/workspace/dist/standing-skill-dirs.d.ts +26 -0
  560. package/node_modules/@xrkseek/workspace/dist/standing-skill-dirs.d.ts.map +1 -0
  561. package/node_modules/@xrkseek/workspace/dist/standing-skill-dirs.js +80 -0
  562. package/node_modules/@xrkseek/workspace/dist/standing-skill-dirs.js.map +1 -0
  563. package/node_modules/@xrkseek/workspace/dist/workspace-anchor.d.ts +7 -1
  564. package/node_modules/@xrkseek/workspace/dist/workspace-anchor.d.ts.map +1 -1
  565. package/node_modules/@xrkseek/workspace/dist/workspace-anchor.js +21 -1
  566. package/node_modules/@xrkseek/workspace/dist/workspace-anchor.js.map +1 -1
  567. package/node_modules/@xrkseek/workspace/package.json +28 -28
  568. package/node_modules/@xrkseek/xrk-agent/lib/index.js +1 -793
  569. package/node_modules/@xrkseek/xrk-agent/lib/invariant.js +1 -23
  570. package/node_modules/@xrkseek/xrk-attachment/lib/index.js +1 -1
  571. package/node_modules/@xrkseek/xrk-attachment/lib/invariant.js +1 -0
  572. package/node_modules/@xrkseek/xrk-attachment/lib/types/brand.js +10 -0
  573. package/node_modules/@xrkseek/xrk-attachment/lib/types/error.js +48 -0
  574. package/node_modules/@xrkseek/xrk-attachment/lib/types/index.js +42 -0
  575. package/node_modules/@xrkseek/xrk-attachment/lib/types/invariant.js +16 -0
  576. package/node_modules/@xrkseek/xrk-attachment/lib/types/types.d.ts +6 -0
  577. package/node_modules/@xrkseek/xrk-attachment/lib/types/types.js +3 -0
  578. package/node_modules/@xrkseek/xrk-attachment/package.json +1 -0
  579. package/node_modules/@xrkseek/xrk-brand/lib/index.js +1 -1
  580. package/node_modules/@xrkseek/xrk-brand/lib/invariant.js +1 -0
  581. package/node_modules/@xrkseek/xrk-brand/lib/types/index.js +24 -0
  582. package/node_modules/@xrkseek/xrk-brand/lib/types/invariant.js +22 -0
  583. package/node_modules/@xrkseek/xrk-brand/package.json +1 -0
  584. package/node_modules/@xrkseek/xrk-commands/lib/index.js +1 -1
  585. package/node_modules/@xrkseek/xrk-commands/lib/invariant.js +1 -0
  586. package/node_modules/@xrkseek/xrk-file-reference-local/README.md +46 -46
  587. package/node_modules/@xrkseek/xrk-file-reference-local/README.zh.md +46 -46
  588. package/node_modules/@xrkseek/xrk-file-reference-local/package.json +30 -30
  589. package/node_modules/@xrkseek/xrk-invariants/lib/index.js +1 -1
  590. package/node_modules/@xrkseek/xrk-invariants/lib/invariant.js +1 -0
  591. package/node_modules/@xrkseek/xrk-invariants/lib/types/index.js +148 -0
  592. package/node_modules/@xrkseek/xrk-invariants/lib/types/invariant.js +22 -0
  593. package/node_modules/@xrkseek/xrk-invariants/package.json +1 -0
  594. package/node_modules/@xrkseek/xrk-llm/lib/index.js +1 -1
  595. package/node_modules/@xrkseek/xrk-llm/lib/invariant.js +1 -0
  596. package/node_modules/@xrkseek/xrk-llm/lib/types/index.js +4 -0
  597. package/node_modules/@xrkseek/xrk-llm/lib/types/types.d.ts +11 -0
  598. package/node_modules/@xrkseek/xrk-permission-presets/lib/index.js +1 -1
  599. package/node_modules/@xrkseek/xrk-permission-presets/lib/invariant.js +1 -0
  600. package/node_modules/@xrkseek/xrk-scope/lib/index.js +1 -0
  601. package/node_modules/@xrkseek/xrk-scope/lib/types/index.d.ts +129 -0
  602. package/node_modules/@xrkseek/xrk-scope/lib/types/index.js +243 -0
  603. package/node_modules/@xrkseek/xrk-scope/package.json +34 -0
  604. package/node_modules/@xrkseek/xrk-session/lib/index.js +1 -1
  605. package/node_modules/@xrkseek/xrk-session/lib/invariant.js +1 -0
  606. package/node_modules/@xrkseek/xrk-session-projection/lib/index.js +1 -1
  607. package/node_modules/@xrkseek/xrk-session-projection/lib/invariant.js +1 -0
  608. package/node_modules/@xrkseek/xrk-session-reference/README.md +50 -50
  609. package/node_modules/@xrkseek/xrk-session-reference/README.zh.md +50 -50
  610. package/node_modules/@xrkseek/xrk-session-reference/dist/prepare-face.js +13 -13
  611. package/node_modules/@xrkseek/xrk-session-reference/dist/spill.js +2 -2
  612. package/node_modules/@xrkseek/xrk-session-reference/package.json +56 -56
  613. package/node_modules/@xrkseek/xrk-settings/lib/index.js +1 -638
  614. package/node_modules/@xrkseek/xrk-settings/lib/invariant.js +1 -67
  615. package/node_modules/@xrkseek/xrk-system-prompt/package.json +15 -15
  616. package/node_modules/@xrkseek/xrk-system-prompt/src/index.ts +144 -144
  617. package/node_modules/@xrkseek/xrk-token-meter/README.i18n.yaml +6 -0
  618. package/node_modules/@xrkseek/xrk-token-meter/README.md +68 -0
  619. package/node_modules/@xrkseek/xrk-token-meter/README.zh.md +68 -0
  620. package/node_modules/@xrkseek/xrk-token-meter/lib/index.js +1 -0
  621. package/node_modules/@xrkseek/xrk-token-meter/lib/invariant.js +1 -0
  622. package/node_modules/@xrkseek/xrk-token-meter/lib/types/breakdown-projection.d.ts +29 -0
  623. package/node_modules/@xrkseek/xrk-token-meter/lib/types/breakdown-projection.js +56 -0
  624. package/node_modules/@xrkseek/xrk-token-meter/lib/types/client.d.ts +9 -0
  625. package/node_modules/@xrkseek/xrk-token-meter/lib/types/client.js +7 -0
  626. package/node_modules/@xrkseek/xrk-token-meter/lib/types/estimate.d.ts +42 -0
  627. package/node_modules/@xrkseek/xrk-token-meter/lib/types/estimate.js +79 -0
  628. package/node_modules/@xrkseek/xrk-token-meter/lib/types/index.d.ts +62 -0
  629. package/node_modules/@xrkseek/xrk-token-meter/lib/types/index.js +250 -0
  630. package/node_modules/@xrkseek/xrk-token-meter/lib/types/invariant.d.ts +16 -0
  631. package/node_modules/@xrkseek/xrk-token-meter/lib/types/invariant.js +30 -0
  632. package/node_modules/@xrkseek/xrk-token-meter/lib/types/projection.d.ts +74 -0
  633. package/node_modules/@xrkseek/xrk-token-meter/lib/types/projection.js +7 -0
  634. package/node_modules/@xrkseek/xrk-token-meter/lib/types/surface-fold.d.ts +38 -0
  635. package/node_modules/@xrkseek/xrk-token-meter/lib/types/surface-fold.js +47 -0
  636. package/node_modules/@xrkseek/xrk-token-meter/lib/types/surface-projection.d.ts +59 -0
  637. package/node_modules/@xrkseek/xrk-token-meter/lib/types/surface-projection.js +66 -0
  638. package/node_modules/@xrkseek/xrk-token-meter/lib/types/turn-usage.d.ts +33 -0
  639. package/node_modules/@xrkseek/xrk-token-meter/lib/types/turn-usage.js +247 -0
  640. package/node_modules/@xrkseek/xrk-token-meter/lib/types/types.d.ts +44 -0
  641. package/node_modules/@xrkseek/xrk-token-meter/lib/types/types.js +7 -0
  642. package/node_modules/@xrkseek/xrk-token-meter/lib/types/usage-projection.d.ts +64 -0
  643. package/node_modules/@xrkseek/xrk-token-meter/lib/types/usage-projection.js +161 -0
  644. package/node_modules/@xrkseek/xrk-token-meter/package.json +57 -0
  645. package/node_modules/@xrkseek/xrk-tools/lib/index.js +1 -1
  646. package/node_modules/@xrkseek/xrk-tools/lib/invariant.js +1 -1
  647. package/node_modules/@xrkseek/xrk-tools/src/presentation.ts +39 -39
  648. package/node_modules/@xrkseek/xrk-typert-protocol/lib/index.js +1 -1
  649. package/node_modules/@xrkseek/xrk-typert-protocol/lib/invariant.js +1 -0
  650. package/node_modules/@xrkseek/xrk-workflow/README.md +73 -73
  651. package/node_modules/@xrkseek/xrk-workflow/README.zh.md +72 -72
  652. package/node_modules/@xrkseek/xrk-workflow/lib/types/index.js +118 -118
  653. package/package.json +7 -1
  654. package/node_modules/@xrkseek/llm/dist/reasoning-effort.d.ts +0 -14
  655. package/node_modules/@xrkseek/llm/dist/reasoning-effort.d.ts.map +0 -1
  656. package/node_modules/@xrkseek/llm/dist/reasoning-effort.js +0 -21
  657. package/node_modules/@xrkseek/llm/dist/reasoning-effort.js.map +0 -1
  658. package/node_modules/@xrkseek/server-face/dist/index.d.mts +0 -3734
  659. package/node_modules/@xrkseek/server-face/dist/index.d.mts.map +0 -1
  660. package/node_modules/@xrkseek/server-face/dist/index.mjs +0 -22085
  661. package/node_modules/@xrkseek/server-face/dist/index.mjs.map +0 -1
  662. package/node_modules/@xrkseek/server-face/dist/model-reasoning.d.ts +0 -51
  663. package/node_modules/@xrkseek/server-face/dist/model-reasoning.d.ts.map +0 -1
  664. package/node_modules/@xrkseek/server-face/dist/model-reasoning.js +0 -104
  665. package/node_modules/@xrkseek/server-face/dist/model-reasoning.js.map +0 -1
  666. package/node_modules/@xrkseek/server-host/dist/sidebar-pty-agent.d.ts +0 -2
  667. package/node_modules/@xrkseek/server-host/dist/sidebar-pty-agent.d.ts.map +0 -1
  668. package/node_modules/@xrkseek/server-host/dist/sidebar-pty-agent.js +0 -98
  669. package/node_modules/@xrkseek/server-host/dist/sidebar-pty-agent.js.map +0 -1
  670. package/node_modules/@xrkseek/server-host/dist/sidebar-pty-worker.d.ts +0 -18
  671. package/node_modules/@xrkseek/server-host/dist/sidebar-pty-worker.d.ts.map +0 -1
  672. package/node_modules/@xrkseek/server-host/dist/sidebar-pty-worker.js +0 -141
  673. package/node_modules/@xrkseek/server-host/dist/sidebar-pty-worker.js.map +0 -1
  674. package/node_modules/@xrkseek/server-host/dist/win-fd-inherit.d.ts +0 -30
  675. package/node_modules/@xrkseek/server-host/dist/win-fd-inherit.d.ts.map +0 -1
  676. package/node_modules/@xrkseek/server-host/dist/win-fd-inherit.js +0 -96
  677. package/node_modules/@xrkseek/server-host/dist/win-fd-inherit.js.map +0 -1
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Load a Claude Code plugin **directory** — the on-disk shape a published
3
+ * plugin actually ships as:
4
+ *
5
+ * ```
6
+ * my-plugin/
7
+ * .claude-plugin/plugin.json { "name": "my-plugin", "version": "0.1.0" }
8
+ * hooks/hooks.json { "modules": ["./my-plugin.mjs"] }
9
+ * hooks/my-plugin.mjs export function register(on) { … }
10
+ * ```
11
+ *
12
+ * `defineMod` (and the bridge generally) takes a `register` function because a
13
+ * Cordis composition mounts behaviour, not directories. This module is the seam
14
+ * between those two: it reads the manifests, imports each hook module with the
15
+ * native loader, and hands the bridge one `register` that runs them in manifest
16
+ * order. The result is a normal `ModPlugin`, so it composes like any other mod:
17
+ *
18
+ * ```ts
19
+ * await ctx.plugin(await definePluginDir('/path/to/my-plugin'), { history: 12 })
20
+ * ```
21
+ *
22
+ * Ordering matters and is preserved: the first module in `hooks.json` is the
23
+ * outermost layer of the chain, because `on(...)` registrations append and the
24
+ * chain runs registration order outside-in.
25
+ * @module
26
+ */
27
+ import { type ModPlugin } from "./define-mod.js";
28
+ import type { PluginOptions } from "./types.js";
29
+ /** A plugin directory as its manifests describe it. */
30
+ export interface PluginDirInfo {
31
+ /** Absolute plugin root. */
32
+ readonly root: string;
33
+ /** `plugin.json` `name`. */
34
+ readonly name: string;
35
+ readonly version?: string;
36
+ readonly description?: string;
37
+ /** Absolute hook-module paths, in `hooks.json` order. */
38
+ readonly modules: readonly string[];
39
+ }
40
+ export interface LoadPluginDirOptions {
41
+ /** Override for tests or a CSP-locked host; defaults to the native loader. */
42
+ readonly importModule?: (url: string) => Promise<unknown>;
43
+ /** `options` a module's `register(on, options)` receives. */
44
+ readonly options?: PluginOptions;
45
+ }
46
+ /** Thrown for a directory that is not a well-formed Claude Code plugin. */
47
+ export declare class PluginDirError extends Error {
48
+ readonly dir: string;
49
+ constructor(dir: string, message: string);
50
+ }
51
+ /**
52
+ * Read `.claude-plugin/plugin.json` and, when present, `hooks/hooks.json`.
53
+ *
54
+ * A missing `hooks.json` is legal (an identity-only plugin with no behaviour),
55
+ * but a malformed one is not: silently ignoring it would load a plugin whose
56
+ * author believes it is active. Hook-module paths are relative to
57
+ * `hooks/hooks.json` itself and must stay inside the plugin root — a manifest is
58
+ * third-party data, and `../` traversal would otherwise let it load arbitrary
59
+ * code with the host's privileges.
60
+ */
61
+ export declare function readPluginDir(dir: string): Promise<PluginDirInfo>;
62
+ /**
63
+ * Wrap a plugin directory as a mountable mod plugin.
64
+ *
65
+ * Manifest order is chain order: the first module listed is the outermost hook
66
+ * layer. A module that exports no `register` fails the whole load by name rather
67
+ * than mounting a plugin that can never answer an event.
68
+ */
69
+ export declare function definePluginDir(dir: string, options?: LoadPluginDirOptions): Promise<ModPlugin>;
70
+ //# sourceMappingURL=plugin-dir.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-dir.d.ts","sourceRoot":"","sources":["../src/plugin-dir.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAMH,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5D,OAAO,KAAK,EAAS,aAAa,EAAE,MAAM,YAAY,CAAC;AAEvD,uDAAuD;AACvD,MAAM,WAAW,aAAa;IAC5B,4BAA4B;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4BAA4B;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,yDAAyD;IACzD,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED,MAAM,WAAW,oBAAoB;IACnC,8EAA8E;IAC9E,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1D,6DAA6D;IAC7D,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC;CAClC;AAED,2EAA2E;AAC3E,qBAAa,cAAe,SAAQ,KAAK;IAErC,QAAQ,CAAC,GAAG,EAAE,MAAM;gBAAX,GAAG,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM;CAKlB;AAyBD;;;;;;;;;GASG;AACH,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAwEvE;AAgBD;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,SAAS,CAAC,CA2BpB"}
@@ -0,0 +1,167 @@
1
+ /**
2
+ * Load a Claude Code plugin **directory** — the on-disk shape a published
3
+ * plugin actually ships as:
4
+ *
5
+ * ```
6
+ * my-plugin/
7
+ * .claude-plugin/plugin.json { "name": "my-plugin", "version": "0.1.0" }
8
+ * hooks/hooks.json { "modules": ["./my-plugin.mjs"] }
9
+ * hooks/my-plugin.mjs export function register(on) { … }
10
+ * ```
11
+ *
12
+ * `defineMod` (and the bridge generally) takes a `register` function because a
13
+ * Cordis composition mounts behaviour, not directories. This module is the seam
14
+ * between those two: it reads the manifests, imports each hook module with the
15
+ * native loader, and hands the bridge one `register` that runs them in manifest
16
+ * order. The result is a normal `ModPlugin`, so it composes like any other mod:
17
+ *
18
+ * ```ts
19
+ * await ctx.plugin(await definePluginDir('/path/to/my-plugin'), { history: 12 })
20
+ * ```
21
+ *
22
+ * Ordering matters and is preserved: the first module in `hooks.json` is the
23
+ * outermost layer of the chain, because `on(...)` registrations append and the
24
+ * chain runs registration order outside-in.
25
+ * @module
26
+ */
27
+ import { readFile } from "node:fs/promises";
28
+ import path from "node:path";
29
+ import { pathToFileURL } from "node:url";
30
+ import { defineMod } from "./define-mod.js";
31
+ import { nativeImport } from "./native-import.js";
32
+ /** Thrown for a directory that is not a well-formed Claude Code plugin. */
33
+ export class PluginDirError extends Error {
34
+ dir;
35
+ constructor(dir, message) {
36
+ super(`${message} (${dir})`);
37
+ this.dir = dir;
38
+ this.name = "PluginDirError";
39
+ }
40
+ }
41
+ /** Plugin names Claude Code accepts: letters, digits, `_` and `-`. */
42
+ const PLUGIN_NAME = /^[A-Za-z0-9_-]{1,64}$/u;
43
+ function isRecord(value) {
44
+ return typeof value === "object" && value !== null && !Array.isArray(value);
45
+ }
46
+ async function readJson(dir, file, label) {
47
+ let text;
48
+ try {
49
+ text = await readFile(file, "utf8");
50
+ }
51
+ catch (error) {
52
+ const code = error.code;
53
+ if (code === "ENOENT")
54
+ throw new PluginDirError(dir, `missing ${label}`);
55
+ throw error;
56
+ }
57
+ try {
58
+ return JSON.parse(text);
59
+ }
60
+ catch {
61
+ throw new PluginDirError(dir, `${label} is not valid JSON`);
62
+ }
63
+ }
64
+ /**
65
+ * Read `.claude-plugin/plugin.json` and, when present, `hooks/hooks.json`.
66
+ *
67
+ * A missing `hooks.json` is legal (an identity-only plugin with no behaviour),
68
+ * but a malformed one is not: silently ignoring it would load a plugin whose
69
+ * author believes it is active. Hook-module paths are relative to
70
+ * `hooks/hooks.json` itself and must stay inside the plugin root — a manifest is
71
+ * third-party data, and `../` traversal would otherwise let it load arbitrary
72
+ * code with the host's privileges.
73
+ */
74
+ export async function readPluginDir(dir) {
75
+ const root = path.resolve(dir);
76
+ const raw = await readJson(root, path.join(root, ".claude-plugin", "plugin.json"), ".claude-plugin/plugin.json");
77
+ if (!isRecord(raw))
78
+ throw new PluginDirError(root, "plugin.json must be an object");
79
+ const name = raw["name"];
80
+ if (typeof name !== "string" || !PLUGIN_NAME.test(name.trim())) {
81
+ throw new PluginDirError(root, 'plugin.json needs a "name" of letters, digits, _ and - only');
82
+ }
83
+ const version = typeof raw["version"] === "string" ? raw["version"] : undefined;
84
+ const description = typeof raw["description"] === "string" ? raw["description"] : undefined;
85
+ const hooksPath = path.join(root, "hooks", "hooks.json");
86
+ const hooksDir = path.dirname(hooksPath);
87
+ let declared = [];
88
+ try {
89
+ const hooksRaw = await readJson(root, hooksPath, "hooks/hooks.json");
90
+ if (!isRecord(hooksRaw))
91
+ throw new PluginDirError(root, "hooks.json must be an object");
92
+ const modules = hooksRaw["modules"];
93
+ if (modules !== undefined) {
94
+ if (!Array.isArray(modules))
95
+ throw new PluginDirError(root, 'hooks.json "modules" must be an array of paths');
96
+ declared = modules.map((entry) => {
97
+ if (typeof entry !== "string" || entry.trim() === "") {
98
+ throw new PluginDirError(root, 'hooks.json "modules" entries must be non-empty strings');
99
+ }
100
+ return entry.trim();
101
+ });
102
+ }
103
+ }
104
+ catch (error) {
105
+ // Only "there is no hooks/hooks.json" is tolerable; anything else is the author's bug.
106
+ if (!(error instanceof PluginDirError) ||
107
+ !/missing hooks\/hooks\.json/u.test(error.message))
108
+ throw error;
109
+ }
110
+ const modules = declared.map((relative) => {
111
+ const absolute = path.resolve(hooksDir, relative);
112
+ const inside = path.relative(root, absolute);
113
+ if (inside.startsWith("..") || path.isAbsolute(inside)) {
114
+ throw new PluginDirError(root, `hook module escapes the plugin root: ${relative}`);
115
+ }
116
+ return absolute;
117
+ });
118
+ return {
119
+ root,
120
+ name: name.trim(),
121
+ ...(version === undefined ? {} : { version }),
122
+ ...(description === undefined ? {} : { description }),
123
+ modules,
124
+ };
125
+ }
126
+ function pickRegister(namespace) {
127
+ if (!isRecord(namespace))
128
+ return undefined;
129
+ if (typeof namespace["register"] === "function") {
130
+ return namespace["register"];
131
+ }
132
+ const nested = namespace["default"];
133
+ if (isRecord(nested) && typeof nested["register"] === "function") {
134
+ return nested["register"];
135
+ }
136
+ return undefined;
137
+ }
138
+ /**
139
+ * Wrap a plugin directory as a mountable mod plugin.
140
+ *
141
+ * Manifest order is chain order: the first module listed is the outermost hook
142
+ * layer. A module that exports no `register` fails the whole load by name rather
143
+ * than mounting a plugin that can never answer an event.
144
+ */
145
+ export async function definePluginDir(dir, options = {}) {
146
+ const info = await readPluginDir(dir);
147
+ const importModule = options.importModule ?? nativeImport;
148
+ const registerOptions = options.options;
149
+ return defineMod({
150
+ name: info.name,
151
+ ...(info.version === undefined ? {} : { version: info.version }),
152
+ root: info.root,
153
+ ...(registerOptions === undefined ? {} : { userConfig: registerOptions }),
154
+ register: async (on, modOptions) => {
155
+ for (const modulePath of info.modules) {
156
+ const label = path.relative(info.root, modulePath);
157
+ const namespace = await importModule(pathToFileURL(modulePath).href);
158
+ const register = pickRegister(namespace);
159
+ if (register === undefined) {
160
+ throw new Error(`${info.name}: hook module "${label}" exports no register(on)`);
161
+ }
162
+ await register(on, registerOptions === undefined ? modOptions : registerOptions);
163
+ }
164
+ },
165
+ });
166
+ }
167
+ //# sourceMappingURL=plugin-dir.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-dir.js","sourceRoot":"","sources":["../src/plugin-dir.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,O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AO,EAAE,CAAC;QAChE,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,GAAG,CAAC,eAAe,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,eAAe,EAAE,CAAC;QACzE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE;YACjC,KAAK,MAAM,UAAU,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;gBACtC,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;gBACnD,MAAM,SAAS,GAAG,MAAM,YAAY,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC;gBACrE,MAAM,QAAQ,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;gBACzC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;oBAC3B,MAAM,IAAI,KAAK,CACb,GAAG,IAAI,CAAC,IAAI,kBAAkB,KAAK,2BAA2B,CAC/D,CAAC;gBACJ,CAAC;gBACD,MAAM,QAAQ,CACZ,EAAE,EACF,eAAe,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,eAAe,CAC7D,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Product-side adapters: what the bridge needs from a host that runs
3
+ * `core-agent` rather than the DSH agent service.
4
+ *
5
+ * Two jobs:
6
+ *
7
+ * 1. {@link createProductAgent} — present a product handle as the structural
8
+ * `ModAgent` the `$` implementation reads. Every member it cannot supply is
9
+ * left absent so the one `$` call that needs it fails with a named reason
10
+ * rather than reading `undefined`.
11
+ * 2. {@link discoverClaudeCodePluginDirs} — find installed Claude Code plugins
12
+ * under a root, accepting both "a root of plugin directories" and "a root
13
+ * that is itself one plugin".
14
+ * @module
15
+ */
16
+ import type { ModAgent } from "./types.js";
17
+ export interface ProductAgentInput {
18
+ /** Session identity, used for `$.session.id` and the `$.state` scope. */
19
+ readonly sessionId: string;
20
+ /** Committed working directory for `$.session.cwd` and `$.fs` resolution. */
21
+ readonly cwd: string;
22
+ /** Session creation time in epoch milliseconds, when the host knows it. */
23
+ readonly createdAt?: number;
24
+ readonly model?: string;
25
+ /** Messages the model currently sees; omit when the host has no derivation. */
26
+ readonly messages?: () => readonly {
27
+ readonly role: string;
28
+ }[];
29
+ /** Submit a prompt as the user (`$.prompt.submit`). */
30
+ readonly followup?: (message: unknown) => void;
31
+ /** Seed model-facing context (`$.tool.call` guidance). */
32
+ readonly inject?: (message: unknown) => void;
33
+ }
34
+ /**
35
+ * Adapt a product session handle to {@link ModAgent}.
36
+ *
37
+ * The result is a plain object, not a live agent: it reads the session facts the
38
+ * bridge asks for and nothing else. A `$` call that needs a member the host did
39
+ * not supply throws with that member named.
40
+ */
41
+ export declare function createProductAgent(input: ProductAgentInput): ModAgent;
42
+ /**
43
+ * Find Claude Code plugin directories under `root`.
44
+ *
45
+ * Layouts accepted:
46
+ *
47
+ * - `root/<plugin>/.claude-plugin/plugin.json` — a directory of installed
48
+ * plugins (what a plugin manager writes).
49
+ * - `root/.claude-plugin/plugin.json` — `root` is one plugin.
50
+ *
51
+ * A missing root is an empty list, not an error: a host with no plugins
52
+ * installed is the normal state, and it must not fail composition. Results are
53
+ * sorted by directory name so plugin load order (and therefore chain order) is
54
+ * stable across filesystems.
55
+ */
56
+ export declare function discoverClaudeCodePluginDirs(root: string): Promise<readonly string[]>;
57
+ //# sourceMappingURL=product-agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product-agent.d.ts","sourceRoot":"","sources":["../src/product-agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,WAAW,iBAAiB;IAChC,yEAAyE;IACzE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,6EAA6E;IAC7E,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,2EAA2E;IAC3E,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,+EAA+E;IAC/E,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,SAAS;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC/D,uDAAuD;IACvD,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,0DAA0D;IAC1D,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9C;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,GAAG,QAAQ,CAerE;AAiBD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,4BAA4B,CAChD,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAc5B"}
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Product-side adapters: what the bridge needs from a host that runs
3
+ * `core-agent` rather than the DSH agent service.
4
+ *
5
+ * Two jobs:
6
+ *
7
+ * 1. {@link createProductAgent} — present a product handle as the structural
8
+ * `ModAgent` the `$` implementation reads. Every member it cannot supply is
9
+ * left absent so the one `$` call that needs it fails with a named reason
10
+ * rather than reading `undefined`.
11
+ * 2. {@link discoverClaudeCodePluginDirs} — find installed Claude Code plugins
12
+ * under a root, accepting both "a root of plugin directories" and "a root
13
+ * that is itself one plugin".
14
+ * @module
15
+ */
16
+ import { readdir, stat } from "node:fs/promises";
17
+ import path from "node:path";
18
+ /**
19
+ * Adapt a product session handle to {@link ModAgent}.
20
+ *
21
+ * The result is a plain object, not a live agent: it reads the session facts the
22
+ * bridge asks for and nothing else. A `$` call that needs a member the host did
23
+ * not supply throws with that member named.
24
+ */
25
+ export function createProductAgent(input) {
26
+ return {
27
+ id: input.sessionId,
28
+ ...(input.model === undefined ? {} : { options: { model: input.model } }),
29
+ session: {
30
+ id: input.sessionId,
31
+ header: {
32
+ cwd: input.cwd,
33
+ ...(input.createdAt === undefined ? {} : { createdAt: input.createdAt }),
34
+ },
35
+ ...(input.messages === undefined ? {} : { deriveMessages: input.messages }),
36
+ },
37
+ ...(input.followup === undefined ? {} : { followup: input.followup }),
38
+ ...(input.inject === undefined ? {} : { inject: input.inject }),
39
+ };
40
+ }
41
+ async function isDirectory(target) {
42
+ try {
43
+ return (await stat(target)).isDirectory();
44
+ }
45
+ catch {
46
+ return false;
47
+ }
48
+ }
49
+ async function isPluginDir(target) {
50
+ return stat(path.join(target, ".claude-plugin", "plugin.json")).then((info) => info.isFile(), () => false);
51
+ }
52
+ /**
53
+ * Find Claude Code plugin directories under `root`.
54
+ *
55
+ * Layouts accepted:
56
+ *
57
+ * - `root/<plugin>/.claude-plugin/plugin.json` — a directory of installed
58
+ * plugins (what a plugin manager writes).
59
+ * - `root/.claude-plugin/plugin.json` — `root` is one plugin.
60
+ *
61
+ * A missing root is an empty list, not an error: a host with no plugins
62
+ * installed is the normal state, and it must not fail composition. Results are
63
+ * sorted by directory name so plugin load order (and therefore chain order) is
64
+ * stable across filesystems.
65
+ */
66
+ export async function discoverClaudeCodePluginDirs(root) {
67
+ if (await isPluginDir(root))
68
+ return [root];
69
+ if (!(await isDirectory(root)))
70
+ return [];
71
+ const entries = await readdir(root, { withFileTypes: true }).catch(() => []);
72
+ const found = [];
73
+ for (const entry of entries) {
74
+ if (!entry.isDirectory() || entry.name.startsWith("."))
75
+ continue;
76
+ if (entry.name === "node_modules")
77
+ continue;
78
+ const candidate = path.join(root, entry.name);
79
+ if (await isPluginDir(candidate))
80
+ found.push(candidate);
81
+ }
82
+ found.sort();
83
+ return found;
84
+ }
85
+ //# sourceMappingURL=product-agent.js.map
@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,CAAC;IACD,KAAK,CAAC,IAAI,EAAE,CAAC;IACb,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,117 @@
1
+ /**
2
+ * The bridge without Cordis.
3
+ *
4
+ * `ClaudeCodeMods` is a Cordis service because upstream that is how a
5
+ * composition mounts behaviour. Our shipped runtime drives `core-agent` /
6
+ * `core-tools` directly and has no Cordis container in the request path, so this
7
+ * module assembles the same engine over a small service bag the host hands in.
8
+ *
9
+ * The Cordis-shaped pieces the engine actually touches are three: `ctx.get(name)`
10
+ * for the services `$` reaches, `ctx.logger` for diagnostics, and `ctx.effect`
11
+ * for teardown. `createServiceContext` supplies exactly those, so the engine,
12
+ * chain, module and `$` code stay byte-identical to the Cordis path.
13
+ *
14
+ * ```ts
15
+ * const mods = createModsRuntime({
16
+ * services: { fs, subprocess, commands, tools, workingDirectory, storageDomain },
17
+ * pipeline,
18
+ * dirs: ['~/.xrk/plugins/claude-code/my-plugin'],
19
+ * })
20
+ * ```
21
+ * @module
22
+ */
23
+ import type { ToolPipeline, ToolPipelineContext } from "@xrkseek/core-tools";
24
+ import type { LoadedMod } from "./chain.js";
25
+ import type { ModAgent, ModDefinition, SurfaceSnapshot, TokenMeterService, UserQuestionsService } from "./types.js";
26
+ import type { StorageDomainService } from "./storage-domain.js";
27
+ import type { WorkingDirectoryService } from "./working-directory.js";
28
+ /** Diagnostic sink the runtime writes through. */
29
+ export interface ModsLogger {
30
+ debug(line: string): void;
31
+ info(line: string): void;
32
+ warn(line: string): void;
33
+ error(line: string): void;
34
+ }
35
+ /**
36
+ * Host capability `$` reaches by name.
37
+ *
38
+ * Every field is optional: a deployment composes what it has, and a `$` call
39
+ * that needs an absent service fails with that service's name instead of
40
+ * returning `undefined` into a plugin's arithmetic.
41
+ */
42
+ export interface ModsHostServices {
43
+ readonly fs?: unknown;
44
+ readonly subprocess?: unknown;
45
+ readonly commands?: unknown;
46
+ readonly tools?: unknown;
47
+ readonly userQuestions?: UserQuestionsService;
48
+ readonly tokenMeter?: TokenMeterService;
49
+ readonly storageDomain?: StorageDomainService;
50
+ readonly workingDirectory?: WorkingDirectoryService;
51
+ }
52
+ export interface ModsRuntimeConfig {
53
+ readonly hookTimeoutMs?: number;
54
+ readonly catchTimeoutMs?: number;
55
+ readonly processTimeoutMs?: number;
56
+ readonly toolAliases?: Readonly<Record<string, string>>;
57
+ /** Columns the AbovePrompt band reports to `ui.render`. */
58
+ readonly bandColumns?: number;
59
+ /** Rows the band reports as `maxRows`. */
60
+ readonly bandRows?: number;
61
+ }
62
+ export interface CreateModsRuntimeOptions {
63
+ readonly services: ModsHostServices;
64
+ readonly logger?: ModsLogger;
65
+ readonly config?: ModsRuntimeConfig;
66
+ /** Tool interceptor install point; omit for a runtime without interception. */
67
+ readonly pipeline?: ToolPipeline;
68
+ /** Which agent a tool call belongs to (our `ToolCall` carries no session). */
69
+ readonly agentOf?: (context: ToolPipelineContext) => ModAgent | undefined;
70
+ /**
71
+ * Resolve the agent for a band render / button press by session id.
72
+ * The product composition has one agent per runtime; the Cordis path uses
73
+ * the agents registry instead.
74
+ */
75
+ readonly agentOfSession?: (sessionId: string) => ModAgent | undefined;
76
+ /** Plugin directories to load at startup, in chain order. */
77
+ readonly dirs?: readonly string[];
78
+ /** Extra diagnostics (the Cordis service logs through `ctx.logger`). */
79
+ readonly report?: (line: string) => void;
80
+ }
81
+ export interface ModsRuntime {
82
+ /** Loaded mods in chain order. */
83
+ readonly mods: readonly LoadedMod[];
84
+ /** Names of commands mods registered (for the host's inventory). */
85
+ readonly modCommands: ReadonlySet<string>;
86
+ /** Full names of tools mods registered. */
87
+ readonly modTools: ReadonlySet<string>;
88
+ /** Raise one engine event from a host seam. */
89
+ dispatch<I, R>(event: string, input: I, fallback: (input: I) => R, options?: {
90
+ readonly agent?: ModAgent;
91
+ readonly signal?: AbortSignal;
92
+ }): Promise<R>;
93
+ /** Latest AbovePrompt snapshot (draws once when nothing was drawn yet). */
94
+ currentBand(sessionId: string): Promise<SurfaceSnapshot>;
95
+ /** Watch the AbovePrompt band until the signal aborts. */
96
+ watchBand(sessionId: string, signal: AbortSignal): AsyncIterable<SurfaceSnapshot>;
97
+ /** Run a button's `onPress` and redraw. */
98
+ pressBand(sessionId: string, generation: number, actionId: string): Promise<SurfaceSnapshot>;
99
+ /** Ask the band to redraw through `ui.render` hooks. */
100
+ refreshBand(sessionId: string): Promise<void>;
101
+ /** Drop a session's band (session end / agent dispose). */
102
+ forgetBand(sessionId: string): void;
103
+ /** Load one plugin directory into the running runtime. */
104
+ loadDir(dir: string): Promise<LoadedMod>;
105
+ /** Add a mod defined in code (the `defineMod` path). */
106
+ add(definition: ModDefinition): Promise<LoadedMod>;
107
+ /** Remove every pipeline handler and mod. */
108
+ dispose(): Promise<void>;
109
+ }
110
+ /**
111
+ * Build a bridge runtime over the host's own services and tool pipeline.
112
+ *
113
+ * Loading is awaited: a plugin whose `register` throws surfaces here, at
114
+ * composition time, rather than half-loading and becoming hooks that never fire.
115
+ */
116
+ export declare function createModsRuntime(options: CreateModsRuntimeOptions): Promise<ModsRuntime>;
117
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EAEpB,MAAM,qBAAqB,CAAC;AAI7B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAI5C,OAAO,KAAK,EACV,QAAQ,EACR,aAAa,EACb,eAAe,EACf,iBAAiB,EAKjB,oBAAoB,EACrB,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,kDAAkD;AAClD,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,IAAI,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