@xrkseek/harness 0.4.8 → 0.4.9

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 (242) hide show
  1. package/node_modules/@xrkseek/cordis/LICENSE +21 -0
  2. package/node_modules/@xrkseek/cordis/README.md +14 -0
  3. package/node_modules/@xrkseek/cordis/bin.js +16 -0
  4. package/node_modules/@xrkseek/cordis/lib/index.js +1828 -0
  5. package/node_modules/@xrkseek/cordis/lib/types/context.d.ts +101 -0
  6. package/node_modules/@xrkseek/cordis/lib/types/context.d.ts.map +1 -0
  7. package/node_modules/@xrkseek/cordis/lib/types/events.d.ts +240 -0
  8. package/node_modules/@xrkseek/cordis/lib/types/events.d.ts.map +1 -0
  9. package/node_modules/@xrkseek/cordis/lib/types/fiber.d.ts +202 -0
  10. package/node_modules/@xrkseek/cordis/lib/types/fiber.d.ts.map +1 -0
  11. package/node_modules/@xrkseek/cordis/lib/types/index.d.ts +15 -0
  12. package/node_modules/@xrkseek/cordis/lib/types/index.d.ts.map +1 -0
  13. package/node_modules/@xrkseek/cordis/lib/types/logger.d.ts +105 -0
  14. package/node_modules/@xrkseek/cordis/lib/types/logger.d.ts.map +1 -0
  15. package/node_modules/@xrkseek/cordis/lib/types/reflect.d.ts +186 -0
  16. package/node_modules/@xrkseek/cordis/lib/types/reflect.d.ts.map +1 -0
  17. package/node_modules/@xrkseek/cordis/lib/types/registry.d.ts +201 -0
  18. package/node_modules/@xrkseek/cordis/lib/types/registry.d.ts.map +1 -0
  19. package/node_modules/@xrkseek/cordis/lib/types/service.d.ts +55 -0
  20. package/node_modules/@xrkseek/cordis/lib/types/service.d.ts.map +1 -0
  21. package/node_modules/@xrkseek/cordis/lib/types/utils.d.ts +62 -0
  22. package/node_modules/@xrkseek/cordis/lib/types/utils.d.ts.map +1 -0
  23. package/node_modules/@xrkseek/cordis/package.json +49 -0
  24. package/node_modules/@xrkseek/cordis/src/context.d.ts +101 -0
  25. package/node_modules/@xrkseek/cordis/src/context.d.ts.map +1 -0
  26. package/node_modules/@xrkseek/cordis/src/context.js +99 -0
  27. package/node_modules/@xrkseek/cordis/src/context.js.map +1 -0
  28. package/node_modules/@xrkseek/cordis/src/context.ts +146 -0
  29. package/node_modules/@xrkseek/cordis/src/events.d.ts +240 -0
  30. package/node_modules/@xrkseek/cordis/src/events.d.ts.map +1 -0
  31. package/node_modules/@xrkseek/cordis/src/events.js +199 -0
  32. package/node_modules/@xrkseek/cordis/src/events.js.map +1 -0
  33. package/node_modules/@xrkseek/cordis/src/events.ts +352 -0
  34. package/node_modules/@xrkseek/cordis/src/fiber.d.ts +202 -0
  35. package/node_modules/@xrkseek/cordis/src/fiber.d.ts.map +1 -0
  36. package/node_modules/@xrkseek/cordis/src/fiber.js +677 -0
  37. package/node_modules/@xrkseek/cordis/src/fiber.js.map +1 -0
  38. package/node_modules/@xrkseek/cordis/src/fiber.ts +754 -0
  39. package/node_modules/@xrkseek/cordis/src/index.d.ts +15 -0
  40. package/node_modules/@xrkseek/cordis/src/index.d.ts.map +1 -0
  41. package/node_modules/@xrkseek/cordis/src/index.js +15 -0
  42. package/node_modules/@xrkseek/cordis/src/index.js.map +1 -0
  43. package/node_modules/@xrkseek/cordis/src/index.ts +14 -0
  44. package/node_modules/@xrkseek/cordis/src/logger.d.ts +105 -0
  45. package/node_modules/@xrkseek/cordis/src/logger.d.ts.map +1 -0
  46. package/node_modules/@xrkseek/cordis/src/logger.js +193 -0
  47. package/node_modules/@xrkseek/cordis/src/logger.js.map +1 -0
  48. package/node_modules/@xrkseek/cordis/src/logger.ts +270 -0
  49. package/node_modules/@xrkseek/cordis/src/reflect.d.ts +186 -0
  50. package/node_modules/@xrkseek/cordis/src/reflect.d.ts.map +1 -0
  51. package/node_modules/@xrkseek/cordis/src/reflect.js +311 -0
  52. package/node_modules/@xrkseek/cordis/src/reflect.js.map +1 -0
  53. package/node_modules/@xrkseek/cordis/src/reflect.ts +418 -0
  54. package/node_modules/@xrkseek/cordis/src/registry.d.ts +201 -0
  55. package/node_modules/@xrkseek/cordis/src/registry.d.ts.map +1 -0
  56. package/node_modules/@xrkseek/cordis/src/registry.js +218 -0
  57. package/node_modules/@xrkseek/cordis/src/registry.js.map +1 -0
  58. package/node_modules/@xrkseek/cordis/src/registry.ts +337 -0
  59. package/node_modules/@xrkseek/cordis/src/service.d.ts +55 -0
  60. package/node_modules/@xrkseek/cordis/src/service.d.ts.map +1 -0
  61. package/node_modules/@xrkseek/cordis/src/service.js +113 -0
  62. package/node_modules/@xrkseek/cordis/src/service.js.map +1 -0
  63. package/node_modules/@xrkseek/cordis/src/service.ts +115 -0
  64. package/node_modules/@xrkseek/cordis/src/utils.d.ts +62 -0
  65. package/node_modules/@xrkseek/cordis/src/utils.d.ts.map +1 -0
  66. package/node_modules/@xrkseek/cordis/src/utils.js +271 -0
  67. package/node_modules/@xrkseek/cordis/src/utils.js.map +1 -0
  68. package/node_modules/@xrkseek/cordis/src/utils.ts +287 -0
  69. package/node_modules/@xrkseek/core-agent-loop/dist/index.d.ts.map +1 -1
  70. package/node_modules/@xrkseek/core-agent-loop/dist/index.js +39 -68
  71. package/node_modules/@xrkseek/core-agent-loop/dist/index.js.map +1 -1
  72. package/node_modules/@xrkseek/core-session/dist/compaction.d.ts +4 -3
  73. package/node_modules/@xrkseek/core-session/dist/compaction.d.ts.map +1 -1
  74. package/node_modules/@xrkseek/core-session/dist/compaction.js.map +1 -1
  75. package/node_modules/@xrkseek/core-tools/dist/subagent-prompt.d.ts.map +1 -1
  76. package/node_modules/@xrkseek/core-tools/dist/subagent-prompt.js +2 -1
  77. package/node_modules/@xrkseek/core-tools/dist/subagent-prompt.js.map +1 -1
  78. package/node_modules/@xrkseek/exec-image-gen/README.md +1 -1
  79. package/node_modules/@xrkseek/exec-image-gen/dist/catalog.d.ts +16 -0
  80. package/node_modules/@xrkseek/exec-image-gen/dist/catalog.d.ts.map +1 -0
  81. package/node_modules/@xrkseek/exec-image-gen/dist/catalog.js +152 -0
  82. package/node_modules/@xrkseek/exec-image-gen/dist/catalog.js.map +1 -0
  83. package/node_modules/@xrkseek/exec-image-gen/dist/deepinfra-http.d.ts +9 -0
  84. package/node_modules/@xrkseek/exec-image-gen/dist/deepinfra-http.d.ts.map +1 -0
  85. package/node_modules/@xrkseek/exec-image-gen/dist/deepinfra-http.js +21 -0
  86. package/node_modules/@xrkseek/exec-image-gen/dist/deepinfra-http.js.map +1 -0
  87. package/node_modules/@xrkseek/exec-image-gen/dist/fal-http.d.ts +16 -0
  88. package/node_modules/@xrkseek/exec-image-gen/dist/fal-http.d.ts.map +1 -0
  89. package/node_modules/@xrkseek/exec-image-gen/dist/fal-http.js +189 -0
  90. package/node_modules/@xrkseek/exec-image-gen/dist/fal-http.js.map +1 -0
  91. package/node_modules/@xrkseek/exec-image-gen/dist/index.d.ts +10 -5
  92. package/node_modules/@xrkseek/exec-image-gen/dist/index.d.ts.map +1 -1
  93. package/node_modules/@xrkseek/exec-image-gen/dist/index.js +174 -18
  94. package/node_modules/@xrkseek/exec-image-gen/dist/index.js.map +1 -1
  95. package/node_modules/@xrkseek/exec-image-gen/dist/krea-http.d.ts +16 -0
  96. package/node_modules/@xrkseek/exec-image-gen/dist/krea-http.d.ts.map +1 -0
  97. package/node_modules/@xrkseek/exec-image-gen/dist/krea-http.js +144 -0
  98. package/node_modules/@xrkseek/exec-image-gen/dist/krea-http.js.map +1 -0
  99. package/node_modules/@xrkseek/exec-image-gen/dist/meta-ai-http.d.ts +9 -0
  100. package/node_modules/@xrkseek/exec-image-gen/dist/meta-ai-http.d.ts.map +1 -0
  101. package/node_modules/@xrkseek/exec-image-gen/dist/meta-ai-http.js +21 -0
  102. package/node_modules/@xrkseek/exec-image-gen/dist/meta-ai-http.js.map +1 -0
  103. package/node_modules/@xrkseek/exec-image-gen/dist/openai-http.d.ts +4 -1
  104. package/node_modules/@xrkseek/exec-image-gen/dist/openai-http.d.ts.map +1 -1
  105. package/node_modules/@xrkseek/exec-image-gen/dist/openai-http.js +7 -5
  106. package/node_modules/@xrkseek/exec-image-gen/dist/openai-http.js.map +1 -1
  107. package/node_modules/@xrkseek/exec-image-gen/dist/openrouter-http.d.ts +14 -0
  108. package/node_modules/@xrkseek/exec-image-gen/dist/openrouter-http.d.ts.map +1 -0
  109. package/node_modules/@xrkseek/exec-image-gen/dist/openrouter-http.js +117 -0
  110. package/node_modules/@xrkseek/exec-image-gen/dist/openrouter-http.js.map +1 -0
  111. package/node_modules/@xrkseek/exec-image-gen/dist/tools.d.ts.map +1 -1
  112. package/node_modules/@xrkseek/exec-image-gen/dist/tools.js +43 -6
  113. package/node_modules/@xrkseek/exec-image-gen/dist/tools.js.map +1 -1
  114. package/node_modules/@xrkseek/exec-image-gen/dist/types.d.ts +1 -1
  115. package/node_modules/@xrkseek/exec-image-gen/dist/types.d.ts.map +1 -1
  116. package/node_modules/@xrkseek/exec-image-gen/dist/types.js.map +1 -1
  117. package/node_modules/@xrkseek/exec-image-gen/dist/xai-http.d.ts +16 -0
  118. package/node_modules/@xrkseek/exec-image-gen/dist/xai-http.d.ts.map +1 -0
  119. package/node_modules/@xrkseek/exec-image-gen/dist/xai-http.js +137 -0
  120. package/node_modules/@xrkseek/exec-image-gen/dist/xai-http.js.map +1 -0
  121. package/node_modules/@xrkseek/exec-memory/dist/consolidate-pipeline.d.ts +52 -0
  122. package/node_modules/@xrkseek/exec-memory/dist/consolidate-pipeline.d.ts.map +1 -0
  123. package/node_modules/@xrkseek/exec-memory/dist/consolidate-pipeline.js +216 -0
  124. package/node_modules/@xrkseek/exec-memory/dist/consolidate-pipeline.js.map +1 -0
  125. package/node_modules/@xrkseek/exec-memory/dist/index.d.ts +1 -0
  126. package/node_modules/@xrkseek/exec-memory/dist/index.d.ts.map +1 -1
  127. package/node_modules/@xrkseek/exec-memory/dist/index.js +1 -0
  128. package/node_modules/@xrkseek/exec-memory/dist/index.js.map +1 -1
  129. package/node_modules/@xrkseek/exec-memory/dist/tools.d.ts.map +1 -1
  130. package/node_modules/@xrkseek/exec-memory/dist/tools.js +20 -7
  131. package/node_modules/@xrkseek/exec-memory/dist/tools.js.map +1 -1
  132. package/node_modules/@xrkseek/exec-video-gen/README.md +1 -1
  133. package/node_modules/@xrkseek/exec-video-gen/dist/catalog.d.ts +14 -1
  134. package/node_modules/@xrkseek/exec-video-gen/dist/catalog.d.ts.map +1 -1
  135. package/node_modules/@xrkseek/exec-video-gen/dist/catalog.js +99 -1
  136. package/node_modules/@xrkseek/exec-video-gen/dist/catalog.js.map +1 -1
  137. package/node_modules/@xrkseek/exec-video-gen/dist/deepinfra-http.d.ts +9 -0
  138. package/node_modules/@xrkseek/exec-video-gen/dist/deepinfra-http.d.ts.map +1 -0
  139. package/node_modules/@xrkseek/exec-video-gen/dist/deepinfra-http.js +17 -0
  140. package/node_modules/@xrkseek/exec-video-gen/dist/deepinfra-http.js.map +1 -0
  141. package/node_modules/@xrkseek/exec-video-gen/dist/fal-http.d.ts +14 -0
  142. package/node_modules/@xrkseek/exec-video-gen/dist/fal-http.d.ts.map +1 -0
  143. package/node_modules/@xrkseek/exec-video-gen/dist/fal-http.js +342 -0
  144. package/node_modules/@xrkseek/exec-video-gen/dist/fal-http.js.map +1 -0
  145. package/node_modules/@xrkseek/exec-video-gen/dist/index.d.ts +8 -6
  146. package/node_modules/@xrkseek/exec-video-gen/dist/index.d.ts.map +1 -1
  147. package/node_modules/@xrkseek/exec-video-gen/dist/index.js +122 -19
  148. package/node_modules/@xrkseek/exec-video-gen/dist/index.js.map +1 -1
  149. package/node_modules/@xrkseek/exec-video-gen/dist/openai-http.d.ts +4 -1
  150. package/node_modules/@xrkseek/exec-video-gen/dist/openai-http.d.ts.map +1 -1
  151. package/node_modules/@xrkseek/exec-video-gen/dist/openai-http.js +21 -15
  152. package/node_modules/@xrkseek/exec-video-gen/dist/openai-http.js.map +1 -1
  153. package/node_modules/@xrkseek/exec-video-gen/dist/openrouter-http.d.ts +9 -0
  154. package/node_modules/@xrkseek/exec-video-gen/dist/openrouter-http.d.ts.map +1 -0
  155. package/node_modules/@xrkseek/exec-video-gen/dist/openrouter-http.js +18 -0
  156. package/node_modules/@xrkseek/exec-video-gen/dist/openrouter-http.js.map +1 -0
  157. package/node_modules/@xrkseek/exec-video-gen/dist/tools.d.ts.map +1 -1
  158. package/node_modules/@xrkseek/exec-video-gen/dist/tools.js +26 -6
  159. package/node_modules/@xrkseek/exec-video-gen/dist/tools.js.map +1 -1
  160. package/node_modules/@xrkseek/exec-video-gen/dist/types.d.ts +1 -1
  161. package/node_modules/@xrkseek/exec-video-gen/dist/types.d.ts.map +1 -1
  162. package/node_modules/@xrkseek/exec-video-gen/dist/types.js.map +1 -1
  163. package/node_modules/@xrkseek/exec-video-gen/dist/xai-http.d.ts +18 -0
  164. package/node_modules/@xrkseek/exec-video-gen/dist/xai-http.d.ts.map +1 -0
  165. package/node_modules/@xrkseek/exec-video-gen/dist/xai-http.js +263 -0
  166. package/node_modules/@xrkseek/exec-video-gen/dist/xai-http.js.map +1 -0
  167. package/node_modules/@xrkseek/preset-harness/dist/preset.d.ts.map +1 -1
  168. package/node_modules/@xrkseek/preset-harness/dist/preset.js +12 -3
  169. package/node_modules/@xrkseek/preset-harness/dist/preset.js.map +1 -1
  170. package/node_modules/@xrkseek/preset-harness/dist/tsconfig.tsbuildinfo +1 -1
  171. package/node_modules/@xrkseek/preset-minimal/dist/tsconfig.tsbuildinfo +1 -1
  172. package/node_modules/@xrkseek/preset-server/dist/tsconfig.tsbuildinfo +1 -1
  173. package/node_modules/@xrkseek/server-face/dist/agent-team-graph.d.ts +31 -0
  174. package/node_modules/@xrkseek/server-face/dist/agent-team-graph.d.ts.map +1 -1
  175. package/node_modules/@xrkseek/server-face/dist/agent-team-graph.js +125 -1
  176. package/node_modules/@xrkseek/server-face/dist/agent-team-graph.js.map +1 -1
  177. package/node_modules/@xrkseek/server-face/dist/context.d.ts +19 -1
  178. package/node_modules/@xrkseek/server-face/dist/context.d.ts.map +1 -1
  179. package/node_modules/@xrkseek/server-face/dist/index.d.ts +3 -3
  180. package/node_modules/@xrkseek/server-face/dist/index.d.ts.map +1 -1
  181. package/node_modules/@xrkseek/server-face/dist/index.js +1 -1
  182. package/node_modules/@xrkseek/server-face/dist/index.js.map +1 -1
  183. package/node_modules/@xrkseek/server-face/dist/mcp-oauth.d.ts.map +1 -1
  184. package/node_modules/@xrkseek/server-face/dist/mcp-oauth.js +25 -3
  185. package/node_modules/@xrkseek/server-face/dist/mcp-oauth.js.map +1 -1
  186. package/node_modules/@xrkseek/server-face/dist/ralph-tool.d.ts +2 -0
  187. package/node_modules/@xrkseek/server-face/dist/ralph-tool.d.ts.map +1 -1
  188. package/node_modules/@xrkseek/server-face/dist/ralph-tool.js +11 -5
  189. package/node_modules/@xrkseek/server-face/dist/ralph-tool.js.map +1 -1
  190. package/node_modules/@xrkseek/server-face/dist/runtime.d.ts.map +1 -1
  191. package/node_modules/@xrkseek/server-face/dist/runtime.js +1 -0
  192. package/node_modules/@xrkseek/server-face/dist/runtime.js.map +1 -1
  193. package/node_modules/@xrkseek/server-face/dist/session-status.d.ts +16 -0
  194. package/node_modules/@xrkseek/server-face/dist/session-status.d.ts.map +1 -1
  195. package/node_modules/@xrkseek/server-face/dist/session-status.js +44 -5
  196. package/node_modules/@xrkseek/server-face/dist/session-status.js.map +1 -1
  197. package/node_modules/@xrkseek/server-face/dist/settings-credentials.d.ts +9 -0
  198. package/node_modules/@xrkseek/server-face/dist/settings-credentials.d.ts.map +1 -1
  199. package/node_modules/@xrkseek/server-face/dist/settings-credentials.js +50 -0
  200. package/node_modules/@xrkseek/server-face/dist/settings-credentials.js.map +1 -1
  201. package/node_modules/@xrkseek/server-face/dist/settings-document.d.ts.map +1 -1
  202. package/node_modules/@xrkseek/server-face/dist/settings-document.js +40 -0
  203. package/node_modules/@xrkseek/server-face/dist/settings-document.js.map +1 -1
  204. package/node_modules/@xrkseek/server-face/dist/settings-schemas.d.ts.map +1 -1
  205. package/node_modules/@xrkseek/server-face/dist/settings-schemas.js +20 -4
  206. package/node_modules/@xrkseek/server-face/dist/settings-schemas.js.map +1 -1
  207. package/node_modules/@xrkseek/server-face/dist/subagent-tools.d.ts.map +1 -1
  208. package/node_modules/@xrkseek/server-face/dist/subagent-tools.js +191 -0
  209. package/node_modules/@xrkseek/server-face/dist/subagent-tools.js.map +1 -1
  210. package/node_modules/@xrkseek/server-face/dist/wire/rpc-error.d.ts.map +1 -1
  211. package/node_modules/@xrkseek/server-face/dist/wire/rpc-error.js +8 -0
  212. package/node_modules/@xrkseek/server-face/dist/wire/rpc-error.js.map +1 -1
  213. package/node_modules/@xrkseek/server-host/dist/index.d.ts.map +1 -1
  214. package/node_modules/@xrkseek/server-host/dist/index.js +135 -24
  215. package/node_modules/@xrkseek/server-host/dist/index.js.map +1 -1
  216. package/node_modules/@xrkseek/server-host/dist/sidebar-face-bridge.d.ts.map +1 -1
  217. package/node_modules/@xrkseek/server-host/dist/sidebar-face-bridge.js +6 -0
  218. package/node_modules/@xrkseek/server-host/dist/sidebar-face-bridge.js.map +1 -1
  219. package/node_modules/@xrkseek/server-host/dist/workflow-engine-mount.d.ts +32 -0
  220. package/node_modules/@xrkseek/server-host/dist/workflow-engine-mount.d.ts.map +1 -0
  221. package/node_modules/@xrkseek/server-host/dist/workflow-engine-mount.js +134 -0
  222. package/node_modules/@xrkseek/server-host/dist/workflow-engine-mount.js.map +1 -0
  223. package/node_modules/@xrkseek/server-host/package.json +2 -0
  224. package/node_modules/@xrkseek/server-http/dist/sidebar/sidebar-adapter.d.ts.map +1 -1
  225. package/node_modules/@xrkseek/server-http/dist/sidebar/sidebar-adapter.js +20 -0
  226. package/node_modules/@xrkseek/server-http/dist/sidebar/sidebar-adapter.js.map +1 -1
  227. package/node_modules/@xrkseek/server-http/dist/sidebar/sidebar-face-bridge.d.ts +10 -2
  228. package/node_modules/@xrkseek/server-http/dist/sidebar/sidebar-face-bridge.d.ts.map +1 -1
  229. package/node_modules/@xrkseek/xrk-workflow/README.i18n.yaml +6 -0
  230. package/node_modules/@xrkseek/xrk-workflow/README.md +73 -0
  231. package/node_modules/@xrkseek/xrk-workflow/README.zh.md +72 -0
  232. package/node_modules/@xrkseek/xrk-workflow/lib/types/index.d.ts +177 -0
  233. package/node_modules/@xrkseek/xrk-workflow/lib/types/index.js +730 -0
  234. package/node_modules/@xrkseek/xrk-workflow/lib/types/invariant.d.ts +13 -0
  235. package/node_modules/@xrkseek/xrk-workflow/lib/types/invariant.js +118 -0
  236. package/node_modules/@xrkseek/xrk-workflow/lib/types/runtime-types.d.ts +45 -0
  237. package/node_modules/@xrkseek/xrk-workflow/lib/types/runtime-types.js +9 -0
  238. package/node_modules/@xrkseek/xrk-workflow/lib/types/types.d.ts +118 -0
  239. package/node_modules/@xrkseek/xrk-workflow/lib/types/types.js +16 -0
  240. package/node_modules/@xrkseek/xrk-workflow/package.json +53 -0
  241. package/node_modules/@xrkseek/xrk-workflow/src/index.ts +947 -0
  242. package/package.json +5 -1
@@ -0,0 +1,186 @@
1
+ import type { Dict } from '@xrkseek/cosmokit';
2
+ import { Context } from './context.ts';
3
+ import { Fiber } from './fiber.ts';
4
+ declare module './context.ts' {
5
+ interface Context {
6
+ /**
7
+ * Read a service from the store without the inject requirement.
8
+ *
9
+ * @param name — the service name.
10
+ * @param strict — when `true` (default), only return implementations
11
+ * whose providing fiber is currently active.
12
+ * @returns the service value, or `undefined` when not (yet) provided.
13
+ */
14
+ get<K extends string & keyof this>(name: K, strict?: boolean): undefined | this[K];
15
+ /** Same as above for service names outside the typed `Context` surface. */
16
+ get(name: string, strict?: boolean): any;
17
+ /**
18
+ * Overwrite a provided service's value.
19
+ *
20
+ * Only the fiber that provided the service may set it; setting an
21
+ * unprovided name throws.
22
+ *
23
+ * @param name — the service name.
24
+ * @param value — the new service value.
25
+ */
26
+ set<K extends string & keyof this>(name: K, value: undefined | this[K]): void;
27
+ /** Same as above for service names outside the typed `Context` surface. */
28
+ set(name: string, value: any): void;
29
+ /**
30
+ * Register a service implementation owned by the current fiber.
31
+ *
32
+ * The service becomes visible to dependents in the same isolation scope
33
+ * once the fiber is active; it is unregistered (waking dependents) when
34
+ * the returned disposer runs or the fiber unloads. Throws if the name is
35
+ * already provided in this scope or declared as an accessor.
36
+ *
37
+ * @param name — the service name.
38
+ * @param value — the service value.
39
+ * @returns a disposer that unregisters the service.
40
+ */
41
+ provide<K extends string & keyof this>(name: K, value: undefined | this[K]): () => void;
42
+ /** Same as above for service names outside the typed `Context` surface. */
43
+ provide(name: string, value?: any): () => void;
44
+ /**
45
+ * Define a computed context property backed by get/set hooks.
46
+ *
47
+ * The accessor is removed when the current fiber unloads. Throws if the
48
+ * name is already declared.
49
+ *
50
+ * @param name — the context property name.
51
+ * @param options — the `get` hook and optional `set` hook.
52
+ */
53
+ accessor(name: string, options: Omit<Property.Accessor, 'type'>): void;
54
+ /**
55
+ * Expose selected members of a service directly on `ctx`.
56
+ *
57
+ * Each mixed-in key becomes an accessor that forwards to the service
58
+ * (binding methods to it), so e.g. `ctx.on` forwards to `ctx.events.on`.
59
+ * Mixins are removed when the current fiber unloads.
60
+ *
61
+ * @param name — the context property holding the source service.
62
+ * @param mixins — keys to forward, or a source-key → ctx-key map.
63
+ */
64
+ mixin<K extends string & keyof this>(name: K, mixins: (keyof this & keyof this[K])[] | Dict<string>): void;
65
+ /** Same as above with a source object instead of a context property name. */
66
+ mixin<T extends {}>(source: T, mixins: (keyof this & keyof T)[] | Dict<string>): void;
67
+ }
68
+ }
69
+ /** Context property definition known by the reflection service. */
70
+ export type Property = Property.Service | Property.Accessor;
71
+ /** Property definition variants understood by `ReflectService`. */
72
+ export declare namespace Property {
73
+ /** Service property backed by a provided implementation. */
74
+ interface Service {
75
+ /** Discriminator. */
76
+ type: 'service';
77
+ }
78
+ /** Computed context property backed by custom get/set hooks. */
79
+ interface Accessor {
80
+ /** Discriminator. */
81
+ type: 'accessor';
82
+ /** Compute the property value; `error` carries the caller stack for diagnostics. */
83
+ get: (this: Context, receiver: any, error: Error) => any;
84
+ /** Optional setter; return `false` to reject the write. */
85
+ set?: (this: Context, value: any, receiver: any, error: Error) => boolean;
86
+ }
87
+ }
88
+ /** Concrete service implementation record stored in the root reflect service. */
89
+ export interface Impl {
90
+ /** The service name. */
91
+ name: string;
92
+ /** The fiber that provided the service (owns its lifetime). */
93
+ fiber: Fiber;
94
+ /** The current service value. */
95
+ value?: any;
96
+ /** Optional availability predicate consulted before dependents may load. */
97
+ check?: () => boolean;
98
+ }
99
+ /**
100
+ * Reflection and service-resolution layer installed as `ctx.reflect`.
101
+ *
102
+ * This service powers the context proxy, service registration, accessors, and
103
+ * the mixins that expose core service methods directly on `ctx`.
104
+ */
105
+ export declare class ReflectService {
106
+ ctx: Context;
107
+ /** Proxy traps implementing service resolution for every context object. */
108
+ static handler: ProxyHandler<Context>;
109
+ /** Service implementations, keyed by isolation label. */
110
+ store: Dict<Impl, symbol>;
111
+ /** Declared context properties (services and accessors), by name. */
112
+ props: Dict<Property>;
113
+ constructor(ctx: Context);
114
+ /**
115
+ * Read a service from the store without the inject requirement.
116
+ *
117
+ * @param name — the service name.
118
+ * @param strict — when `true`, only return implementations whose providing
119
+ * fiber is currently active.
120
+ * @returns the service value, or `undefined` when not (yet) provided.
121
+ */
122
+ get(name: string, strict?: boolean): any;
123
+ _getImpl(name: string, strict?: boolean): Impl | undefined;
124
+ /**
125
+ * Overwrite a provided service's value.
126
+ *
127
+ * @param name — the service name.
128
+ * @param value — the new service value.
129
+ * @param error — carrier for the caller stack in diagnostics.
130
+ * @returns `true` on success.
131
+ * @throws when `name` was never provided, or was provided by another fiber.
132
+ */
133
+ set(name: string, value: any, error?: Error): boolean;
134
+ /**
135
+ * Register a service implementation owned by the current fiber.
136
+ *
137
+ * See the `ctx.provide()` overload above for the full contract.
138
+ *
139
+ * @param name — the service name.
140
+ * @param value — the service value.
141
+ * @param check — optional availability predicate for dependents.
142
+ * @returns a disposer that unregisters the service.
143
+ */
144
+ provide(name: string, value?: any, check?: () => boolean): import("@xrkseek/cordis").Disposable<Promise<void>>;
145
+ /**
146
+ * Re-evaluate every fiber that requires one of the given services.
147
+ *
148
+ * @param names — the service names that changed.
149
+ * @param filter — restricts notification to matching isolation scopes.
150
+ * @returns the fibers whose dependency state was refreshed.
151
+ */
152
+ notify(names: string[], filter?: (ctx: Context, name: string) => boolean): Fiber[];
153
+ /**
154
+ * Define a computed context property backed by get/set hooks.
155
+ *
156
+ * @param name — the context property name.
157
+ * @param options — the `get` hook and optional `set` hook.
158
+ * @returns a disposer that removes the accessor.
159
+ */
160
+ accessor(name: string, options: Omit<Property.Accessor, 'type'>): import("@xrkseek/cordis").Disposable<Promise<void>>;
161
+ /**
162
+ * Expose selected members of a service directly on `ctx`.
163
+ *
164
+ * See the `ctx.mixin()` overload above for the full contract.
165
+ *
166
+ * @param source — a context property name or a source object.
167
+ * @param mixins — keys to forward, or a source-key → ctx-key map.
168
+ * @returns a disposer that removes all created accessors.
169
+ */
170
+ mixin(source: any, mixins: string[] | Dict<string>): import("@xrkseek/cordis").Disposable<Promise<void>>;
171
+ /**
172
+ * Attach this context's tracing wrapper to a value.
173
+ *
174
+ * @param value — the value to wrap.
175
+ * @returns the traceable wrapper (or the value itself when not applicable).
176
+ */
177
+ trace<T>(value: T): T;
178
+ /**
179
+ * Wrap a callback so calls trace `this` and arguments to this context.
180
+ *
181
+ * @param callback — the function to wrap.
182
+ * @returns a proxy delegating to `callback` with traced values.
183
+ */
184
+ bind<T extends Function>(callback: T): T;
185
+ }
186
+ //# sourceMappingURL=reflect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reflect.d.ts","sourceRoot":"","sources":["reflect.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,OAAO,EAAE,KAAK,EAAc,MAAM,YAAY,CAAA;AAE9C,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,OAAO;QACf;;;;;;;WAOG;Q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,IAAI,CAAC,QAAQ,CAAC,CAAsB;gBAE/B,GAAG,EAAE,OAAO;IAY/B;;;;;;;OAOG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,UAAO;IAI/B,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,UAAO;IAQpC;;;;;;;;OAQG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,KAAK;IAa3C;;;;;;;;;OASG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,MAAM,OAAO;IA8BxD;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,MAAM,IAAI,KAAK,OAAO,EAAE,MAAM,MAAM,YAAmE;IAwB/H;;;;;;OAMG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAU/D;;;;;;;;OAQG;IACH,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC;IA4BlD;;;;;OAKG;IACH,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;IAIjB;;;;;OAKG;IACH,IAAI,CAAC,CAAC,SAAS,QAAQ,EAAE,QAAQ,EAAE,CAAC;CAUrC"}
@@ -0,0 +1,311 @@
1
+ import { defineProperty, isNullable } from '@xrkseek/cosmokit';
2
+ import { getTraceable, symbols, withProps } from "./utils.js";
3
+ import { FiberState } from "./fiber.js";
4
+ function enhanceError(error) {
5
+ const lines = error.stack.split('\n');
6
+ lines.splice(0, 2, `Error: ${error.message}`);
7
+ error.stack = lines.join('\n');
8
+ return error;
9
+ }
10
+ const RESERVED_WORDS = ['prototype', 'then'];
11
+ // - is a symbol
12
+ // - is a reserved word (prototype, then)
13
+ // - is a number string (0, 1, 2, ...)
14
+ // - starts with `_`
15
+ function isSpecialProperty(prop) {
16
+ return typeof prop === 'symbol'
17
+ || RESERVED_WORDS.includes(prop)
18
+ || parseInt(prop).toString() === prop
19
+ || prop.startsWith('_');
20
+ }
21
+ /**
22
+ * Reflection and service-resolution layer installed as `ctx.reflect`.
23
+ *
24
+ * This service powers the context proxy, service registration, accessors, and
25
+ * the mixins that expose core service methods directly on `ctx`.
26
+ */
27
+ export class ReflectService {
28
+ ctx;
29
+ /** Proxy traps implementing service resolution for every context object. */
30
+ static handler = {
31
+ get: (target, prop, ctx) => {
32
+ if (isSpecialProperty(prop)) {
33
+ return Reflect.get(target, prop, ctx);
34
+ }
35
+ if (Reflect.has(target, prop)) {
36
+ return getTraceable(ctx, Reflect.get(target, prop, ctx));
37
+ }
38
+ const error = new Error(`cannot get property "${prop}" without inject`);
39
+ try {
40
+ const def = target.reflect.props[prop];
41
+ if (def?.type === 'accessor') {
42
+ return def.get.call(ctx, ctx[symbols.receiver], error);
43
+ }
44
+ if (!ctx.fiber.runtime)
45
+ return ctx.reflect.get(prop, false);
46
+ return ctx.events.waterfall('internal/get', ctx, prop, error, () => {
47
+ const key = target[symbols.isolate][prop];
48
+ let fiber = (ctx[symbols.shadow] ?? ctx).fiber;
49
+ while (true) {
50
+ const impl = fiber.store?.[prop];
51
+ if (impl)
52
+ return getTraceable(ctx, impl.value);
53
+ if (prop in fiber.inject) {
54
+ error.message = `cannot get required service "${prop}" in inactive context`;
55
+ throw error;
56
+ }
57
+ if (!fiber.runtime)
58
+ throw error;
59
+ if (fiber.parent[symbols.isolate][prop] !== key)
60
+ throw error;
61
+ fiber = fiber.parent.fiber;
62
+ }
63
+ });
64
+ }
65
+ catch (e) {
66
+ throw e === error ? enhanceError(e) : e;
67
+ }
68
+ },
69
+ set: (target, prop, value, ctx) => {
70
+ if (isSpecialProperty(prop)) {
71
+ return Reflect.set(target, prop, value, ctx);
72
+ }
73
+ const error = new Error(`cannot set property "${prop}" without provide`);
74
+ const def = target.reflect.props[prop];
75
+ if (!def) {
76
+ if (!ctx.fiber.runtime)
77
+ return Reflect.set(target, prop, value, ctx);
78
+ throw enhanceError(error);
79
+ }
80
+ try {
81
+ if (def.type === 'accessor') {
82
+ if (!def.set)
83
+ return false;
84
+ return def.set.call(ctx, value, ctx[symbols.receiver], error);
85
+ }
86
+ return ctx.events.waterfall('internal/set', ctx, prop, value, error, () => {
87
+ return ctx.reflect.set(prop, value, error);
88
+ });
89
+ }
90
+ catch (e) {
91
+ throw e === error ? enhanceError(e) : e;
92
+ }
93
+ },
94
+ has: (target, prop) => {
95
+ if (isSpecialProperty(prop)) {
96
+ return Reflect.has(target, prop);
97
+ }
98
+ if (Reflect.has(target, prop))
99
+ return true;
100
+ return !!target.reflect.props[prop];
101
+ },
102
+ };
103
+ /** Service implementations, keyed by isolation label. */
104
+ store = Object.create(null);
105
+ /** Declared context properties (services and accessors), by name. */
106
+ props = Object.create(null);
107
+ constructor(ctx) {
108
+ this.ctx = ctx;
109
+ defineProperty(this, symbols.tracker, {
110
+ property: 'ctx',
111
+ noShadow: true,
112
+ });
113
+ this.mixin('reflect', ['get', 'set', 'provide', 'accessor', 'mixin']);
114
+ this.mixin('fiber', ['runtime', 'effect']);
115
+ this.mixin('registry', ['inject', 'plugin']);
116
+ this.mixin('events', ['on', 'once', 'parallel', 'emit', 'serial', 'bail', 'waterfall']);
117
+ }
118
+ /**
119
+ * Read a service from the store without the inject requirement.
120
+ *
121
+ * @param name — the service name.
122
+ * @param strict — when `true`, only return implementations whose providing
123
+ * fiber is currently active.
124
+ * @returns the service value, or `undefined` when not (yet) provided.
125
+ */
126
+ get(name, strict = true) {
127
+ return getTraceable(this.ctx, this._getImpl(name, strict)?.value);
128
+ }
129
+ _getImpl(name, strict = true) {
130
+ const key = this.ctx[symbols.isolate][name];
131
+ const impl = key && this.store[key];
132
+ if (!impl)
133
+ return;
134
+ if (strict && impl.fiber.state !== FiberState.ACTIVE)
135
+ return;
136
+ return impl;
137
+ }
138
+ /**
139
+ * Overwrite a provided service's value.
140
+ *
141
+ * @param name — the service name.
142
+ * @param value — the new service value.
143
+ * @param error — carrier for the caller stack in diagnostics.
144
+ * @returns `true` on success.
145
+ * @throws when `name` was never provided, or was provided by another fiber.
146
+ */
147
+ set(name, value, error) {
148
+ const key = this.ctx[symbols.isolate][name];
149
+ const impl = this.store[key];
150
+ if (!impl) {
151
+ throw new Error(`cannot set property "${name}" without provide`);
152
+ }
153
+ if (impl.fiber !== this.ctx.fiber) {
154
+ throw new Error(`cannot set property "${name}" in multiple fibers`);
155
+ }
156
+ impl.value = value;
157
+ return true;
158
+ }
159
+ /**
160
+ * Register a service implementation owned by the current fiber.
161
+ *
162
+ * See the `ctx.provide()` overload above for the full contract.
163
+ *
164
+ * @param name — the service name.
165
+ * @param value — the service value.
166
+ * @param check — optional availability predicate for dependents.
167
+ * @returns a disposer that unregisters the service.
168
+ */
169
+ provide(name, value, check) {
170
+ return this.ctx.fiber.effect(() => {
171
+ if (!this.props[name]) {
172
+ this.props[name] ??= { type: 'service' };
173
+ }
174
+ else if (this.props[name].type !== 'service') {
175
+ throw new Error(`property "${name}" is already declared as ${this.props[name].type}`);
176
+ }
177
+ this.props[name] = { type: 'service' };
178
+ this.ctx.root[symbols.isolate][name] ??= Symbol(name);
179
+ const key = this.ctx[symbols.isolate][name];
180
+ const impl = { name, value, fiber: this.ctx.fiber, check };
181
+ if (this.store[key]) {
182
+ throw new Error(`service "${name}" has been registered at <${this.store[key].fiber.name}>`);
183
+ }
184
+ this.store[key] = impl;
185
+ this.ctx.fiber.store[name] = impl;
186
+ if (this.ctx.fiber.state === FiberState.ACTIVE) {
187
+ this.notify([name]);
188
+ }
189
+ return async () => {
190
+ delete this.store[key];
191
+ const fibers = this.notify([name]);
192
+ await Promise.allSettled(fibers.map(fiber => fiber.await()));
193
+ // ensure self access before dependencies cleanup
194
+ delete this.ctx.fiber.store[name];
195
+ };
196
+ }, `ctx.provide(${JSON.stringify(name)})`);
197
+ }
198
+ /**
199
+ * Re-evaluate every fiber that requires one of the given services.
200
+ *
201
+ * @param names — the service names that changed.
202
+ * @param filter — restricts notification to matching isolation scopes.
203
+ * @returns the fibers whose dependency state was refreshed.
204
+ */
205
+ notify(names, filter = (ctx, name) => ctx[symbols.isolate][name] === this.ctx[symbols.isolate][name]) {
206
+ const fibers = [];
207
+ for (const runtime of this.ctx.registry.values()) {
208
+ for (const fiber of runtime.fibers) {
209
+ let hasUpdate = false;
210
+ for (const name of names) {
211
+ if (!(name in fiber.inject))
212
+ continue;
213
+ if (!filter(fiber.ctx, name))
214
+ continue;
215
+ hasUpdate = true;
216
+ fiber._checkImpl(name);
217
+ }
218
+ if (!hasUpdate)
219
+ continue;
220
+ fiber._refresh();
221
+ fibers.push(fiber);
222
+ }
223
+ }
224
+ for (const name of names) {
225
+ const self = Object.create(this.ctx);
226
+ self[symbols.filter] = (target) => filter(target, name);
227
+ this.ctx.events.emit(self, 'internal/service', name, this._getImpl(name, false)?.value);
228
+ }
229
+ return fibers;
230
+ }
231
+ /**
232
+ * Define a computed context property backed by get/set hooks.
233
+ *
234
+ * @param name — the context property name.
235
+ * @param options — the `get` hook and optional `set` hook.
236
+ * @returns a disposer that removes the accessor.
237
+ */
238
+ accessor(name, options) {
239
+ return this.ctx.fiber.effect(() => {
240
+ if (name in this.props) {
241
+ throw new Error(`property "${name}" is already declared as ${this.props[name].type}`);
242
+ }
243
+ this.props[name] = { type: 'accessor', ...options };
244
+ return () => delete this.props[name];
245
+ }, `ctx.accessor(${JSON.stringify(name)})`);
246
+ }
247
+ /**
248
+ * Expose selected members of a service directly on `ctx`.
249
+ *
250
+ * See the `ctx.mixin()` overload above for the full contract.
251
+ *
252
+ * @param source — a context property name or a source object.
253
+ * @param mixins — keys to forward, or a source-key → ctx-key map.
254
+ * @returns a disposer that removes all created accessors.
255
+ */
256
+ mixin(source, mixins) {
257
+ const self = this;
258
+ return this.ctx.fiber.effect(function* () {
259
+ const entries = Array.isArray(mixins) ? mixins.map(key => [key, key]) : Object.entries(mixins);
260
+ const getTarget = (ctx, error) => {
261
+ // TODO enhance error message
262
+ return ctx[source];
263
+ };
264
+ for (const [key, value] of entries) {
265
+ yield self.accessor(value, {
266
+ get(receiver, error) {
267
+ const service = getTarget(this, error);
268
+ if (isNullable(service))
269
+ return service;
270
+ const mixin = receiver ? withProps(receiver, service) : service;
271
+ const value = Reflect.get(service, key, mixin);
272
+ if (typeof value !== 'function')
273
+ return value;
274
+ return value.bind(mixin ?? service);
275
+ },
276
+ set(value, receiver, error) {
277
+ const service = getTarget(this, error);
278
+ const mixin = receiver ? withProps(receiver, service) : service;
279
+ return Reflect.set(service, key, value, mixin);
280
+ },
281
+ });
282
+ }
283
+ }, `ctx.mixin(${JSON.stringify(source)})`);
284
+ }
285
+ /**
286
+ * Attach this context's tracing wrapper to a value.
287
+ *
288
+ * @param value — the value to wrap.
289
+ * @returns the traceable wrapper (or the value itself when not applicable).
290
+ */
291
+ trace(value) {
292
+ return getTraceable(this.ctx, value);
293
+ }
294
+ /**
295
+ * Wrap a callback so calls trace `this` and arguments to this context.
296
+ *
297
+ * @param callback — the function to wrap.
298
+ * @returns a proxy delegating to `callback` with traced values.
299
+ */
300
+ bind(callback) {
301
+ return new Proxy(callback, {
302
+ apply: (target, thisArg, args) => {
303
+ return Reflect.apply(target, this.trace(thisArg), args.map(arg => this.trace(arg)));
304
+ },
305
+ construct: (target, args, newTarget) => {
306
+ return Reflect.construct(target, args.map(arg => this.trace(arg)), newTarget);
307
+ },
308
+ });
309
+ }
310
+ }
311
+ //# sourceMappingURL=reflect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reflect.js","sourceRoot":"","sources":["reflect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAG9D,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAC7D,OA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