@xrkseek/harness 0.4.7 → 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 (342) hide show
  1. package/node_modules/@xrkseek/attachment/dist/error.d.ts +1 -1
  2. package/node_modules/@xrkseek/attachment/dist/error.d.ts.map +1 -1
  3. package/node_modules/@xrkseek/attachment/dist/error.js.map +1 -1
  4. package/node_modules/@xrkseek/attachment/dist/image-region.d.ts +45 -0
  5. package/node_modules/@xrkseek/attachment/dist/image-region.d.ts.map +1 -0
  6. package/node_modules/@xrkseek/attachment/dist/image-region.js +64 -0
  7. package/node_modules/@xrkseek/attachment/dist/image-region.js.map +1 -0
  8. package/node_modules/@xrkseek/attachment/dist/index.d.ts +1 -0
  9. package/node_modules/@xrkseek/attachment/dist/index.d.ts.map +1 -1
  10. package/node_modules/@xrkseek/attachment/dist/index.js +1 -0
  11. package/node_modules/@xrkseek/attachment/dist/index.js.map +1 -1
  12. package/node_modules/@xrkseek/attachment/dist/store.d.ts +7 -0
  13. package/node_modules/@xrkseek/attachment/dist/store.d.ts.map +1 -1
  14. package/node_modules/@xrkseek/attachment-local/dist/crop-region.d.ts +10 -0
  15. package/node_modules/@xrkseek/attachment-local/dist/crop-region.d.ts.map +1 -0
  16. package/node_modules/@xrkseek/attachment-local/dist/crop-region.js +53 -0
  17. package/node_modules/@xrkseek/attachment-local/dist/crop-region.js.map +1 -0
  18. package/node_modules/@xrkseek/attachment-local/dist/index.d.ts +1 -0
  19. package/node_modules/@xrkseek/attachment-local/dist/index.d.ts.map +1 -1
  20. package/node_modules/@xrkseek/attachment-local/dist/index.js +3 -0
  21. package/node_modules/@xrkseek/attachment-local/dist/index.js.map +1 -1
  22. package/node_modules/@xrkseek/cordis/LICENSE +21 -0
  23. package/node_modules/@xrkseek/cordis/README.md +14 -0
  24. package/node_modules/@xrkseek/cordis/bin.js +16 -0
  25. package/node_modules/@xrkseek/cordis/lib/index.js +1828 -0
  26. package/node_modules/@xrkseek/cordis/lib/types/context.d.ts +101 -0
  27. package/node_modules/@xrkseek/cordis/lib/types/context.d.ts.map +1 -0
  28. package/node_modules/@xrkseek/cordis/lib/types/events.d.ts +240 -0
  29. package/node_modules/@xrkseek/cordis/lib/types/events.d.ts.map +1 -0
  30. package/node_modules/@xrkseek/cordis/lib/types/fiber.d.ts +202 -0
  31. package/node_modules/@xrkseek/cordis/lib/types/fiber.d.ts.map +1 -0
  32. package/node_modules/@xrkseek/cordis/lib/types/index.d.ts +15 -0
  33. package/node_modules/@xrkseek/cordis/lib/types/index.d.ts.map +1 -0
  34. package/node_modules/@xrkseek/cordis/lib/types/logger.d.ts +105 -0
  35. package/node_modules/@xrkseek/cordis/lib/types/logger.d.ts.map +1 -0
  36. package/node_modules/@xrkseek/cordis/lib/types/reflect.d.ts +186 -0
  37. package/node_modules/@xrkseek/cordis/lib/types/reflect.d.ts.map +1 -0
  38. package/node_modules/@xrkseek/cordis/lib/types/registry.d.ts +201 -0
  39. package/node_modules/@xrkseek/cordis/lib/types/registry.d.ts.map +1 -0
  40. package/node_modules/@xrkseek/cordis/lib/types/service.d.ts +55 -0
  41. package/node_modules/@xrkseek/cordis/lib/types/service.d.ts.map +1 -0
  42. package/node_modules/@xrkseek/cordis/lib/types/utils.d.ts +62 -0
  43. package/node_modules/@xrkseek/cordis/lib/types/utils.d.ts.map +1 -0
  44. package/node_modules/@xrkseek/cordis/package.json +49 -0
  45. package/node_modules/@xrkseek/cordis/src/context.d.ts +101 -0
  46. package/node_modules/@xrkseek/cordis/src/context.d.ts.map +1 -0
  47. package/node_modules/@xrkseek/cordis/src/context.js +99 -0
  48. package/node_modules/@xrkseek/cordis/src/context.js.map +1 -0
  49. package/node_modules/@xrkseek/cordis/src/context.ts +146 -0
  50. package/node_modules/@xrkseek/cordis/src/events.d.ts +240 -0
  51. package/node_modules/@xrkseek/cordis/src/events.d.ts.map +1 -0
  52. package/node_modules/@xrkseek/cordis/src/events.js +199 -0
  53. package/node_modules/@xrkseek/cordis/src/events.js.map +1 -0
  54. package/node_modules/@xrkseek/cordis/src/events.ts +352 -0
  55. package/node_modules/@xrkseek/cordis/src/fiber.d.ts +202 -0
  56. package/node_modules/@xrkseek/cordis/src/fiber.d.ts.map +1 -0
  57. package/node_modules/@xrkseek/cordis/src/fiber.js +677 -0
  58. package/node_modules/@xrkseek/cordis/src/fiber.js.map +1 -0
  59. package/node_modules/@xrkseek/cordis/src/fiber.ts +754 -0
  60. package/node_modules/@xrkseek/cordis/src/index.d.ts +15 -0
  61. package/node_modules/@xrkseek/cordis/src/index.d.ts.map +1 -0
  62. package/node_modules/@xrkseek/cordis/src/index.js +15 -0
  63. package/node_modules/@xrkseek/cordis/src/index.js.map +1 -0
  64. package/node_modules/@xrkseek/cordis/src/index.ts +14 -0
  65. package/node_modules/@xrkseek/cordis/src/logger.d.ts +105 -0
  66. package/node_modules/@xrkseek/cordis/src/logger.d.ts.map +1 -0
  67. package/node_modules/@xrkseek/cordis/src/logger.js +193 -0
  68. package/node_modules/@xrkseek/cordis/src/logger.js.map +1 -0
  69. package/node_modules/@xrkseek/cordis/src/logger.ts +270 -0
  70. package/node_modules/@xrkseek/cordis/src/reflect.d.ts +186 -0
  71. package/node_modules/@xrkseek/cordis/src/reflect.d.ts.map +1 -0
  72. package/node_modules/@xrkseek/cordis/src/reflect.js +311 -0
  73. package/node_modules/@xrkseek/cordis/src/reflect.js.map +1 -0
  74. package/node_modules/@xrkseek/cordis/src/reflect.ts +418 -0
  75. package/node_modules/@xrkseek/cordis/src/registry.d.ts +201 -0
  76. package/node_modules/@xrkseek/cordis/src/registry.d.ts.map +1 -0
  77. package/node_modules/@xrkseek/cordis/src/registry.js +218 -0
  78. package/node_modules/@xrkseek/cordis/src/registry.js.map +1 -0
  79. package/node_modules/@xrkseek/cordis/src/registry.ts +337 -0
  80. package/node_modules/@xrkseek/cordis/src/service.d.ts +55 -0
  81. package/node_modules/@xrkseek/cordis/src/service.d.ts.map +1 -0
  82. package/node_modules/@xrkseek/cordis/src/service.js +113 -0
  83. package/node_modules/@xrkseek/cordis/src/service.js.map +1 -0
  84. package/node_modules/@xrkseek/cordis/src/service.ts +115 -0
  85. package/node_modules/@xrkseek/cordis/src/utils.d.ts +62 -0
  86. package/node_modules/@xrkseek/cordis/src/utils.d.ts.map +1 -0
  87. package/node_modules/@xrkseek/cordis/src/utils.js +271 -0
  88. package/node_modules/@xrkseek/cordis/src/utils.js.map +1 -0
  89. package/node_modules/@xrkseek/cordis/src/utils.ts +287 -0
  90. package/node_modules/@xrkseek/core-agent-loop/dist/index.d.ts.map +1 -1
  91. package/node_modules/@xrkseek/core-agent-loop/dist/index.js +52 -73
  92. package/node_modules/@xrkseek/core-agent-loop/dist/index.js.map +1 -1
  93. package/node_modules/@xrkseek/core-session/dist/compaction.d.ts +4 -3
  94. package/node_modules/@xrkseek/core-session/dist/compaction.d.ts.map +1 -1
  95. package/node_modules/@xrkseek/core-session/dist/compaction.js.map +1 -1
  96. package/node_modules/@xrkseek/core-tools/dist/subagent-prompt.d.ts.map +1 -1
  97. package/node_modules/@xrkseek/core-tools/dist/subagent-prompt.js +2 -1
  98. package/node_modules/@xrkseek/core-tools/dist/subagent-prompt.js.map +1 -1
  99. package/node_modules/@xrkseek/exec-fs/dist/index.d.ts +1 -0
  100. package/node_modules/@xrkseek/exec-fs/dist/index.d.ts.map +1 -1
  101. package/node_modules/@xrkseek/exec-fs/dist/index.js +3 -0
  102. package/node_modules/@xrkseek/exec-fs/dist/index.js.map +1 -1
  103. package/node_modules/@xrkseek/exec-fs/dist/present-deliverable.d.ts +25 -0
  104. package/node_modules/@xrkseek/exec-fs/dist/present-deliverable.d.ts.map +1 -0
  105. package/node_modules/@xrkseek/exec-fs/dist/present-deliverable.js +107 -0
  106. package/node_modules/@xrkseek/exec-fs/dist/present-deliverable.js.map +1 -0
  107. package/node_modules/@xrkseek/exec-fs/dist/read-image.d.ts +5 -0
  108. package/node_modules/@xrkseek/exec-fs/dist/read-image.d.ts.map +1 -1
  109. package/node_modules/@xrkseek/exec-fs/dist/read-image.js +55 -7
  110. package/node_modules/@xrkseek/exec-fs/dist/read-image.js.map +1 -1
  111. package/node_modules/@xrkseek/exec-image-gen/README.md +3 -3
  112. package/node_modules/@xrkseek/exec-image-gen/dist/catalog.d.ts +16 -0
  113. package/node_modules/@xrkseek/exec-image-gen/dist/catalog.d.ts.map +1 -0
  114. package/node_modules/@xrkseek/exec-image-gen/dist/catalog.js +152 -0
  115. package/node_modules/@xrkseek/exec-image-gen/dist/catalog.js.map +1 -0
  116. package/node_modules/@xrkseek/exec-image-gen/dist/deepinfra-http.d.ts +9 -0
  117. package/node_modules/@xrkseek/exec-image-gen/dist/deepinfra-http.d.ts.map +1 -0
  118. package/node_modules/@xrkseek/exec-image-gen/dist/deepinfra-http.js +21 -0
  119. package/node_modules/@xrkseek/exec-image-gen/dist/deepinfra-http.js.map +1 -0
  120. package/node_modules/@xrkseek/exec-image-gen/dist/fal-http.d.ts +16 -0
  121. package/node_modules/@xrkseek/exec-image-gen/dist/fal-http.d.ts.map +1 -0
  122. package/node_modules/@xrkseek/exec-image-gen/dist/fal-http.js +189 -0
  123. package/node_modules/@xrkseek/exec-image-gen/dist/fal-http.js.map +1 -0
  124. package/node_modules/@xrkseek/exec-image-gen/dist/index.d.ts +10 -5
  125. package/node_modules/@xrkseek/exec-image-gen/dist/index.d.ts.map +1 -1
  126. package/node_modules/@xrkseek/exec-image-gen/dist/index.js +174 -18
  127. package/node_modules/@xrkseek/exec-image-gen/dist/index.js.map +1 -1
  128. package/node_modules/@xrkseek/exec-image-gen/dist/krea-http.d.ts +16 -0
  129. package/node_modules/@xrkseek/exec-image-gen/dist/krea-http.d.ts.map +1 -0
  130. package/node_modules/@xrkseek/exec-image-gen/dist/krea-http.js +144 -0
  131. package/node_modules/@xrkseek/exec-image-gen/dist/krea-http.js.map +1 -0
  132. package/node_modules/@xrkseek/exec-image-gen/dist/meta-ai-http.d.ts +9 -0
  133. package/node_modules/@xrkseek/exec-image-gen/dist/meta-ai-http.d.ts.map +1 -0
  134. package/node_modules/@xrkseek/exec-image-gen/dist/meta-ai-http.js +21 -0
  135. package/node_modules/@xrkseek/exec-image-gen/dist/meta-ai-http.js.map +1 -0
  136. package/node_modules/@xrkseek/exec-image-gen/dist/openai-http.d.ts +4 -1
  137. package/node_modules/@xrkseek/exec-image-gen/dist/openai-http.d.ts.map +1 -1
  138. package/node_modules/@xrkseek/exec-image-gen/dist/openai-http.js +7 -5
  139. package/node_modules/@xrkseek/exec-image-gen/dist/openai-http.js.map +1 -1
  140. package/node_modules/@xrkseek/exec-image-gen/dist/openrouter-http.d.ts +14 -0
  141. package/node_modules/@xrkseek/exec-image-gen/dist/openrouter-http.d.ts.map +1 -0
  142. package/node_modules/@xrkseek/exec-image-gen/dist/openrouter-http.js +117 -0
  143. package/node_modules/@xrkseek/exec-image-gen/dist/openrouter-http.js.map +1 -0
  144. package/node_modules/@xrkseek/exec-image-gen/dist/tools.d.ts.map +1 -1
  145. package/node_modules/@xrkseek/exec-image-gen/dist/tools.js +43 -6
  146. package/node_modules/@xrkseek/exec-image-gen/dist/tools.js.map +1 -1
  147. package/node_modules/@xrkseek/exec-image-gen/dist/types.d.ts +1 -1
  148. package/node_modules/@xrkseek/exec-image-gen/dist/types.d.ts.map +1 -1
  149. package/node_modules/@xrkseek/exec-image-gen/dist/types.js.map +1 -1
  150. package/node_modules/@xrkseek/exec-image-gen/dist/xai-http.d.ts +16 -0
  151. package/node_modules/@xrkseek/exec-image-gen/dist/xai-http.d.ts.map +1 -0
  152. package/node_modules/@xrkseek/exec-image-gen/dist/xai-http.js +137 -0
  153. package/node_modules/@xrkseek/exec-image-gen/dist/xai-http.js.map +1 -0
  154. package/node_modules/@xrkseek/exec-memory/dist/consolidate-pipeline.d.ts +52 -0
  155. package/node_modules/@xrkseek/exec-memory/dist/consolidate-pipeline.d.ts.map +1 -0
  156. package/node_modules/@xrkseek/exec-memory/dist/consolidate-pipeline.js +216 -0
  157. package/node_modules/@xrkseek/exec-memory/dist/consolidate-pipeline.js.map +1 -0
  158. package/node_modules/@xrkseek/exec-memory/dist/index.d.ts +1 -0
  159. package/node_modules/@xrkseek/exec-memory/dist/index.d.ts.map +1 -1
  160. package/node_modules/@xrkseek/exec-memory/dist/index.js +1 -0
  161. package/node_modules/@xrkseek/exec-memory/dist/index.js.map +1 -1
  162. package/node_modules/@xrkseek/exec-memory/dist/tools.d.ts.map +1 -1
  163. package/node_modules/@xrkseek/exec-memory/dist/tools.js +20 -7
  164. package/node_modules/@xrkseek/exec-memory/dist/tools.js.map +1 -1
  165. package/node_modules/@xrkseek/exec-video-analyze/README.md +11 -0
  166. package/node_modules/@xrkseek/exec-video-analyze/dist/format.d.ts +3 -0
  167. package/node_modules/@xrkseek/exec-video-analyze/dist/format.d.ts.map +1 -0
  168. package/node_modules/@xrkseek/exec-video-analyze/dist/format.js +10 -0
  169. package/node_modules/@xrkseek/exec-video-analyze/dist/format.js.map +1 -0
  170. package/node_modules/@xrkseek/exec-video-analyze/dist/index.d.ts +39 -0
  171. package/node_modules/@xrkseek/exec-video-analyze/dist/index.d.ts.map +1 -0
  172. package/node_modules/@xrkseek/exec-video-analyze/dist/index.js +64 -0
  173. package/node_modules/@xrkseek/exec-video-analyze/dist/index.js.map +1 -0
  174. package/node_modules/@xrkseek/exec-video-analyze/dist/materialize.d.ts +22 -0
  175. package/node_modules/@xrkseek/exec-video-analyze/dist/materialize.d.ts.map +1 -0
  176. package/node_modules/@xrkseek/exec-video-analyze/dist/materialize.js +70 -0
  177. package/node_modules/@xrkseek/exec-video-analyze/dist/materialize.js.map +1 -0
  178. package/node_modules/@xrkseek/exec-video-analyze/dist/memory.d.ts +8 -0
  179. package/node_modules/@xrkseek/exec-video-analyze/dist/memory.d.ts.map +1 -0
  180. package/node_modules/@xrkseek/exec-video-analyze/dist/memory.js +21 -0
  181. package/node_modules/@xrkseek/exec-video-analyze/dist/memory.js.map +1 -0
  182. package/node_modules/@xrkseek/exec-video-analyze/dist/mime.d.ts +13 -0
  183. package/node_modules/@xrkseek/exec-video-analyze/dist/mime.d.ts.map +1 -0
  184. package/node_modules/@xrkseek/exec-video-analyze/dist/mime.js +44 -0
  185. package/node_modules/@xrkseek/exec-video-analyze/dist/mime.js.map +1 -0
  186. package/node_modules/@xrkseek/exec-video-analyze/dist/openai-http.d.ts +15 -0
  187. package/node_modules/@xrkseek/exec-video-analyze/dist/openai-http.d.ts.map +1 -0
  188. package/node_modules/@xrkseek/exec-video-analyze/dist/openai-http.js +102 -0
  189. package/node_modules/@xrkseek/exec-video-analyze/dist/openai-http.js.map +1 -0
  190. package/node_modules/@xrkseek/exec-video-analyze/dist/tools.d.ts +24 -0
  191. package/node_modules/@xrkseek/exec-video-analyze/dist/tools.d.ts.map +1 -0
  192. package/node_modules/@xrkseek/exec-video-analyze/dist/tools.js +120 -0
  193. package/node_modules/@xrkseek/exec-video-analyze/dist/tools.js.map +1 -0
  194. package/node_modules/@xrkseek/exec-video-analyze/dist/types.d.ts +30 -0
  195. package/node_modules/@xrkseek/exec-video-analyze/dist/types.d.ts.map +1 -0
  196. package/node_modules/@xrkseek/exec-video-analyze/dist/types.js +16 -0
  197. package/node_modules/@xrkseek/exec-video-analyze/dist/types.js.map +1 -0
  198. package/node_modules/@xrkseek/exec-video-analyze/package.json +26 -0
  199. package/node_modules/@xrkseek/exec-video-gen/README.md +3 -4
  200. package/node_modules/@xrkseek/exec-video-gen/dist/catalog.d.ts +14 -1
  201. package/node_modules/@xrkseek/exec-video-gen/dist/catalog.d.ts.map +1 -1
  202. package/node_modules/@xrkseek/exec-video-gen/dist/catalog.js +99 -1
  203. package/node_modules/@xrkseek/exec-video-gen/dist/catalog.js.map +1 -1
  204. package/node_modules/@xrkseek/exec-video-gen/dist/deepinfra-http.d.ts +9 -0
  205. package/node_modules/@xrkseek/exec-video-gen/dist/deepinfra-http.d.ts.map +1 -0
  206. package/node_modules/@xrkseek/exec-video-gen/dist/deepinfra-http.js +17 -0
  207. package/node_modules/@xrkseek/exec-video-gen/dist/deepinfra-http.js.map +1 -0
  208. package/node_modules/@xrkseek/exec-video-gen/dist/fal-http.d.ts +14 -0
  209. package/node_modules/@xrkseek/exec-video-gen/dist/fal-http.d.ts.map +1 -0
  210. package/node_modules/@xrkseek/exec-video-gen/dist/fal-http.js +342 -0
  211. package/node_modules/@xrkseek/exec-video-gen/dist/fal-http.js.map +1 -0
  212. package/node_modules/@xrkseek/exec-video-gen/dist/index.d.ts +8 -6
  213. package/node_modules/@xrkseek/exec-video-gen/dist/index.d.ts.map +1 -1
  214. package/node_modules/@xrkseek/exec-video-gen/dist/index.js +122 -19
  215. package/node_modules/@xrkseek/exec-video-gen/dist/index.js.map +1 -1
  216. package/node_modules/@xrkseek/exec-video-gen/dist/openai-http.d.ts +4 -1
  217. package/node_modules/@xrkseek/exec-video-gen/dist/openai-http.d.ts.map +1 -1
  218. package/node_modules/@xrkseek/exec-video-gen/dist/openai-http.js +21 -15
  219. package/node_modules/@xrkseek/exec-video-gen/dist/openai-http.js.map +1 -1
  220. package/node_modules/@xrkseek/exec-video-gen/dist/openrouter-http.d.ts +9 -0
  221. package/node_modules/@xrkseek/exec-video-gen/dist/openrouter-http.d.ts.map +1 -0
  222. package/node_modules/@xrkseek/exec-video-gen/dist/openrouter-http.js +18 -0
  223. package/node_modules/@xrkseek/exec-video-gen/dist/openrouter-http.js.map +1 -0
  224. package/node_modules/@xrkseek/exec-video-gen/dist/tools.d.ts.map +1 -1
  225. package/node_modules/@xrkseek/exec-video-gen/dist/tools.js +26 -6
  226. package/node_modules/@xrkseek/exec-video-gen/dist/tools.js.map +1 -1
  227. package/node_modules/@xrkseek/exec-video-gen/dist/types.d.ts +1 -1
  228. package/node_modules/@xrkseek/exec-video-gen/dist/types.d.ts.map +1 -1
  229. package/node_modules/@xrkseek/exec-video-gen/dist/types.js.map +1 -1
  230. package/node_modules/@xrkseek/exec-video-gen/dist/xai-http.d.ts +18 -0
  231. package/node_modules/@xrkseek/exec-video-gen/dist/xai-http.d.ts.map +1 -0
  232. package/node_modules/@xrkseek/exec-video-gen/dist/xai-http.js +263 -0
  233. package/node_modules/@xrkseek/exec-video-gen/dist/xai-http.js.map +1 -0
  234. package/node_modules/@xrkseek/preset-harness/dist/preset.d.ts +14 -0
  235. package/node_modules/@xrkseek/preset-harness/dist/preset.d.ts.map +1 -1
  236. package/node_modules/@xrkseek/preset-harness/dist/preset.js +48 -3
  237. package/node_modules/@xrkseek/preset-harness/dist/preset.js.map +1 -1
  238. package/node_modules/@xrkseek/preset-harness/dist/tsconfig.tsbuildinfo +1 -1
  239. package/node_modules/@xrkseek/preset-harness/package.json +1 -0
  240. package/node_modules/@xrkseek/preset-minimal/dist/tsconfig.tsbuildinfo +1 -1
  241. package/node_modules/@xrkseek/preset-server/dist/tsconfig.tsbuildinfo +1 -1
  242. package/node_modules/@xrkseek/protocol/dist/index.d.ts +1 -1
  243. package/node_modules/@xrkseek/protocol/dist/index.d.ts.map +1 -1
  244. package/node_modules/@xrkseek/protocol/dist/index.js +1 -1
  245. package/node_modules/@xrkseek/protocol/dist/index.js.map +1 -1
  246. package/node_modules/@xrkseek/protocol/dist/json-schema.d.ts +12 -0
  247. package/node_modules/@xrkseek/protocol/dist/json-schema.d.ts.map +1 -1
  248. package/node_modules/@xrkseek/protocol/dist/json-schema.js +23 -0
  249. package/node_modules/@xrkseek/protocol/dist/json-schema.js.map +1 -1
  250. package/node_modules/@xrkseek/protocol/dist/session-events.d.ts +24 -1
  251. package/node_modules/@xrkseek/protocol/dist/session-events.d.ts.map +1 -1
  252. package/node_modules/@xrkseek/protocol/dist/session-events.js +12 -0
  253. package/node_modules/@xrkseek/protocol/dist/session-events.js.map +1 -1
  254. package/node_modules/@xrkseek/protocol/dist/validate.d.ts.map +1 -1
  255. package/node_modules/@xrkseek/protocol/dist/validate.js +32 -0
  256. package/node_modules/@xrkseek/protocol/dist/validate.js.map +1 -1
  257. package/node_modules/@xrkseek/server-face/dist/adapt/tool-view.d.ts +6 -0
  258. package/node_modules/@xrkseek/server-face/dist/adapt/tool-view.d.ts.map +1 -1
  259. package/node_modules/@xrkseek/server-face/dist/adapt/tool-view.js +8 -0
  260. package/node_modules/@xrkseek/server-face/dist/adapt/tool-view.js.map +1 -1
  261. package/node_modules/@xrkseek/server-face/dist/adapt/wire-event.d.ts +1 -0
  262. package/node_modules/@xrkseek/server-face/dist/adapt/wire-event.d.ts.map +1 -1
  263. package/node_modules/@xrkseek/server-face/dist/adapt/wire-event.js +15 -0
  264. package/node_modules/@xrkseek/server-face/dist/adapt/wire-event.js.map +1 -1
  265. package/node_modules/@xrkseek/server-face/dist/adapt/wire-ids.d.ts +6 -0
  266. package/node_modules/@xrkseek/server-face/dist/adapt/wire-ids.d.ts.map +1 -1
  267. package/node_modules/@xrkseek/server-face/dist/adapt/wire-ids.js +16 -0
  268. package/node_modules/@xrkseek/server-face/dist/adapt/wire-ids.js.map +1 -1
  269. package/node_modules/@xrkseek/server-face/dist/agent-team-graph.d.ts +31 -0
  270. package/node_modules/@xrkseek/server-face/dist/agent-team-graph.d.ts.map +1 -1
  271. package/node_modules/@xrkseek/server-face/dist/agent-team-graph.js +125 -1
  272. package/node_modules/@xrkseek/server-face/dist/agent-team-graph.js.map +1 -1
  273. package/node_modules/@xrkseek/server-face/dist/approval-category.d.ts.map +1 -1
  274. package/node_modules/@xrkseek/server-face/dist/approval-category.js +2 -1
  275. package/node_modules/@xrkseek/server-face/dist/approval-category.js.map +1 -1
  276. package/node_modules/@xrkseek/server-face/dist/context.d.ts +19 -1
  277. package/node_modules/@xrkseek/server-face/dist/context.d.ts.map +1 -1
  278. package/node_modules/@xrkseek/server-face/dist/index.d.ts +3 -3
  279. package/node_modules/@xrkseek/server-face/dist/index.d.ts.map +1 -1
  280. package/node_modules/@xrkseek/server-face/dist/index.js +1 -1
  281. package/node_modules/@xrkseek/server-face/dist/index.js.map +1 -1
  282. package/node_modules/@xrkseek/server-face/dist/mcp-oauth.d.ts.map +1 -1
  283. package/node_modules/@xrkseek/server-face/dist/mcp-oauth.js +25 -3
  284. package/node_modules/@xrkseek/server-face/dist/mcp-oauth.js.map +1 -1
  285. package/node_modules/@xrkseek/server-face/dist/ralph-tool.d.ts +2 -0
  286. package/node_modules/@xrkseek/server-face/dist/ralph-tool.d.ts.map +1 -1
  287. package/node_modules/@xrkseek/server-face/dist/ralph-tool.js +11 -5
  288. package/node_modules/@xrkseek/server-face/dist/ralph-tool.js.map +1 -1
  289. package/node_modules/@xrkseek/server-face/dist/runtime.d.ts.map +1 -1
  290. package/node_modules/@xrkseek/server-face/dist/runtime.js +8 -2
  291. package/node_modules/@xrkseek/server-face/dist/runtime.js.map +1 -1
  292. package/node_modules/@xrkseek/server-face/dist/session-status.d.ts +16 -0
  293. package/node_modules/@xrkseek/server-face/dist/session-status.d.ts.map +1 -1
  294. package/node_modules/@xrkseek/server-face/dist/session-status.js +44 -5
  295. package/node_modules/@xrkseek/server-face/dist/session-status.js.map +1 -1
  296. package/node_modules/@xrkseek/server-face/dist/settings-credentials.d.ts +9 -0
  297. package/node_modules/@xrkseek/server-face/dist/settings-credentials.d.ts.map +1 -1
  298. package/node_modules/@xrkseek/server-face/dist/settings-credentials.js +55 -0
  299. package/node_modules/@xrkseek/server-face/dist/settings-credentials.js.map +1 -1
  300. package/node_modules/@xrkseek/server-face/dist/settings-document.d.ts.map +1 -1
  301. package/node_modules/@xrkseek/server-face/dist/settings-document.js +44 -0
  302. package/node_modules/@xrkseek/server-face/dist/settings-document.js.map +1 -1
  303. package/node_modules/@xrkseek/server-face/dist/settings-schemas.d.ts.map +1 -1
  304. package/node_modules/@xrkseek/server-face/dist/settings-schemas.js +34 -3
  305. package/node_modules/@xrkseek/server-face/dist/settings-schemas.js.map +1 -1
  306. package/node_modules/@xrkseek/server-face/dist/subagent-tools.d.ts.map +1 -1
  307. package/node_modules/@xrkseek/server-face/dist/subagent-tools.js +191 -0
  308. package/node_modules/@xrkseek/server-face/dist/subagent-tools.js.map +1 -1
  309. package/node_modules/@xrkseek/server-face/dist/wire/rpc-error.d.ts.map +1 -1
  310. package/node_modules/@xrkseek/server-face/dist/wire/rpc-error.js +8 -0
  311. package/node_modules/@xrkseek/server-face/dist/wire/rpc-error.js.map +1 -1
  312. package/node_modules/@xrkseek/server-host/dist/index.d.ts +7 -0
  313. package/node_modules/@xrkseek/server-host/dist/index.d.ts.map +1 -1
  314. package/node_modules/@xrkseek/server-host/dist/index.js +165 -23
  315. package/node_modules/@xrkseek/server-host/dist/index.js.map +1 -1
  316. package/node_modules/@xrkseek/server-host/dist/sidebar-face-bridge.d.ts.map +1 -1
  317. package/node_modules/@xrkseek/server-host/dist/sidebar-face-bridge.js +6 -0
  318. package/node_modules/@xrkseek/server-host/dist/sidebar-face-bridge.js.map +1 -1
  319. package/node_modules/@xrkseek/server-host/dist/workflow-engine-mount.d.ts +32 -0
  320. package/node_modules/@xrkseek/server-host/dist/workflow-engine-mount.d.ts.map +1 -0
  321. package/node_modules/@xrkseek/server-host/dist/workflow-engine-mount.js +134 -0
  322. package/node_modules/@xrkseek/server-host/dist/workflow-engine-mount.js.map +1 -0
  323. package/node_modules/@xrkseek/server-host/package.json +3 -0
  324. package/node_modules/@xrkseek/server-http/dist/sidebar/sidebar-adapter.d.ts.map +1 -1
  325. package/node_modules/@xrkseek/server-http/dist/sidebar/sidebar-adapter.js +20 -0
  326. package/node_modules/@xrkseek/server-http/dist/sidebar/sidebar-adapter.js.map +1 -1
  327. package/node_modules/@xrkseek/server-http/dist/sidebar/sidebar-face-bridge.d.ts +10 -2
  328. package/node_modules/@xrkseek/server-http/dist/sidebar/sidebar-face-bridge.d.ts.map +1 -1
  329. package/node_modules/@xrkseek/xrk-workflow/README.i18n.yaml +6 -0
  330. package/node_modules/@xrkseek/xrk-workflow/README.md +73 -0
  331. package/node_modules/@xrkseek/xrk-workflow/README.zh.md +72 -0
  332. package/node_modules/@xrkseek/xrk-workflow/lib/types/index.d.ts +177 -0
  333. package/node_modules/@xrkseek/xrk-workflow/lib/types/index.js +730 -0
  334. package/node_modules/@xrkseek/xrk-workflow/lib/types/invariant.d.ts +13 -0
  335. package/node_modules/@xrkseek/xrk-workflow/lib/types/invariant.js +118 -0
  336. package/node_modules/@xrkseek/xrk-workflow/lib/types/runtime-types.d.ts +45 -0
  337. package/node_modules/@xrkseek/xrk-workflow/lib/types/runtime-types.js +9 -0
  338. package/node_modules/@xrkseek/xrk-workflow/lib/types/types.d.ts +118 -0
  339. package/node_modules/@xrkseek/xrk-workflow/lib/types/types.js +16 -0
  340. package/node_modules/@xrkseek/xrk-workflow/package.json +53 -0
  341. package/node_modules/@xrkseek/xrk-workflow/src/index.ts +947 -0
  342. package/package.json +7 -1
@@ -0,0 +1,113 @@
1
+ import { defineProperty } from '@xrkseek/cosmokit';
2
+ import { Context } from "./context.js";
3
+ import { createCallable, joinPrototype, symbols } from "./utils.js";
4
+ /**
5
+ * Base class for services that expose a named API on `ctx`.
6
+ *
7
+ * Subclasses call `super(ctx, name)` from their constructor. The service is
8
+ * registered immediately and is automatically removed with the owning fiber.
9
+ */
10
+ export class Service {
11
+ ctx;
12
+ /** Symbol key of an instance method run after construction (class plugins). */
13
+ static init = symbols.init;
14
+ /** Symbol key of the availability predicate passed to `ctx.provide()`. */
15
+ static check = symbols.check;
16
+ /** Symbol key of the phantom intercept-config type parameter. */
17
+ static config = symbols.config;
18
+ /** Symbol key of the call body making a service callable (e.g. `ctx.logger()`). */
19
+ static invoke = symbols.invoke;
20
+ /** Symbol key of the helper deriving an extended service instance. */
21
+ static extend = symbols.extend;
22
+ /** Symbol key of the tracker metadata used for context tracing. */
23
+ static tracker = symbols.tracker;
24
+ /** Symbol key of the intercept-config resolution helper below. */
25
+ static resolveConfig = symbols.resolveConfig;
26
+ /** The service name this instance is registered under. */
27
+ name;
28
+ /**
29
+ * Register this instance as `name` in the current context.
30
+ *
31
+ * Calls `ctx.reflect.provide(name, this, this[Service.check])`, so the
32
+ * service is unregistered automatically when the owning fiber unloads.
33
+ * Services with a `[Service.invoke]` body return a callable instance.
34
+ *
35
+ * @param ctx — the context to register in (stored as `this.ctx`).
36
+ * @param name — the service name; defaults to the static `provide` field.
37
+ */
38
+ constructor(ctx, name) {
39
+ this.ctx = ctx;
40
+ name ??= this.constructor['provide'];
41
+ let self = this;
42
+ const tracker = {
43
+ associate: name,
44
+ property: 'ctx',
45
+ };
46
+ if (self[symbols.invoke]) {
47
+ self = createCallable(name, joinPrototype(Object.getPrototypeOf(this), Function.prototype), tracker);
48
+ }
49
+ self.ctx = ctx;
50
+ self.name = name;
51
+ defineProperty(self, symbols.tracker, tracker);
52
+ self.ctx.reflect.provide(name, self, this[symbols.check]);
53
+ return self;
54
+ }
55
+ [symbols.filter](ctx) {
56
+ return ctx[symbols.isolate][this.name] === this.ctx[symbols.isolate][this.name];
57
+ }
58
+ [symbols.extend](props) {
59
+ let self;
60
+ if (this[Service.invoke]) {
61
+ self = createCallable(this.name, this, this[symbols.tracker]);
62
+ }
63
+ else {
64
+ self = Object.create(this);
65
+ }
66
+ return Object.assign(self, props);
67
+ }
68
+ /**
69
+ * Merge intercept config from ancestors with optional base and head values.
70
+ *
71
+ * Entries added closer to the root apply first; `base` is prepended and
72
+ * `head` appended. Uses `Config.merge` when the service declares one,
73
+ * otherwise a shallow `Object.assign`.
74
+ *
75
+ * @param base — lowest-precedence config merged before all intercepts.
76
+ * @param head — highest-precedence config merged after all intercepts.
77
+ * @returns the merged config.
78
+ */
79
+ [symbols.resolveConfig](base, head) {
80
+ let intercept = this.ctx[Context.intercept];
81
+ const configs = [];
82
+ while (this.name in intercept) {
83
+ if (Object.hasOwn(intercept, this.name)) {
84
+ configs.unshift(intercept[this.name]);
85
+ }
86
+ intercept = Object.getPrototypeOf(intercept);
87
+ }
88
+ if (base)
89
+ configs.unshift(base);
90
+ if (head)
91
+ configs.push(head);
92
+ if (this['Config']?.merge) {
93
+ return this['Config'].merge(...configs);
94
+ }
95
+ else {
96
+ return Object.assign({}, ...configs);
97
+ }
98
+ }
99
+ static [Symbol.hasInstance](instance) {
100
+ if (!instance)
101
+ return false;
102
+ let constructor = instance.constructor;
103
+ while (constructor) {
104
+ // constructor may be a proxy
105
+ constructor = constructor.prototype?.constructor;
106
+ if (constructor === this)
107
+ return true;
108
+ constructor &&= Object.getPrototypeOf(constructor);
109
+ }
110
+ return false;
111
+ }
112
+ }
113
+ //# sourceMappingURL=service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.js","sourceRoot":"","sources":["service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,OAAO,EAAgB,MAAM,YAAY,CAAA;AAEjF;;;;;GAKG;AACH,MAAM,OAAgB,OAAO;IA+BL;IA9BtB,+EAA+E;IAC/E,MAAM,CAAU,IAAI,GAAkB,OAAO,CAAC,IAAI,CAAA;IAClD,0EAA0E;IAC1E,MAAM,CAAU,KAAK,GAAkB,OAAO,CAAC,KAAK,CAAA;IACpD,iEAAiE;IACjE,MAAM,CAAU,MAAM,GAAkB,OAAO,CAAC,MAAM,CAAA;IACtD,mFAAmF;IACnF,MAAM,CAAU,MAAM,GAAkB,OAAO,CAAC,MAAM,CAAA;IACtD,sEAAsE;IACtE,MAAM,CAAU,MAAM,GAAkB,OAAO,CAAC,MAAM,CAAA;IACtD,mEAAmE;IACnE,MAAM,CAAU,OAAO,GAAkB,OAAO,CAAC,OAAO,CAAA;IACxD,kEAAkE;IAClE,MAAM,CAAU,aAAa,GAAkB,OAAO,CAAC,aAAa,CAAA;IAIpE,0DAA0D;IACnD,IAAI,CAAS;IAEpB;;;;;;;;;OASG;IACH,YAAsB,GAAY,EAAE,IAAY;QAA1B,QAAG,GAAH,GAAG,CAAS;QAChC,IAAI,KAAK,IAAI,CAAC,WAAW,CAAC,SAAS,CAAW,CAAA;QAE9C,IAAI,IAAI,GAAG,IAAI,CAAA;QACf,MAAM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rC,WAAW,KAAK,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,CAAA;QACpD,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC"}
@@ -0,0 +1,115 @@
1
+ import { defineProperty } from '@xrkseek/cosmokit'
2
+ import { Context } from './context.ts'
3
+ import { createCallable, joinPrototype, symbols, type Tracker } from './utils.ts'
4
+
5
+ /**
6
+ * Base class for services that expose a named API on `ctx`.
7
+ *
8
+ * Subclasses call `super(ctx, name)` from their constructor. The service is
9
+ * registered immediately and is automatically removed with the owning fiber.
10
+ */
11
+ export abstract class Service<out T = never> {
12
+ /** Symbol key of an instance method run after construction (class plugins). */
13
+ static readonly init: unique symbol = symbols.init
14
+ /** Symbol key of the availability predicate passed to `ctx.provide()`. */
15
+ static readonly check: unique symbol = symbols.check
16
+ /** Symbol key of the phantom intercept-config type parameter. */
17
+ static readonly config: unique symbol = symbols.config
18
+ /** Symbol key of the call body making a service callable (e.g. `ctx.logger()`). */
19
+ static readonly invoke: unique symbol = symbols.invoke
20
+ /** Symbol key of the helper deriving an extended service instance. */
21
+ static readonly extend: unique symbol = symbols.extend
22
+ /** Symbol key of the tracker metadata used for context tracing. */
23
+ static readonly tracker: unique symbol = symbols.tracker
24
+ /** Symbol key of the intercept-config resolution helper below. */
25
+ static readonly resolveConfig: unique symbol = symbols.resolveConfig
26
+
27
+ declare [symbols.config]: T
28
+
29
+ /** The service name this instance is registered under. */
30
+ public name!: string
31
+
32
+ /**
33
+ * Register this instance as `name` in the current context.
34
+ *
35
+ * Calls `ctx.reflect.provide(name, this, this[Service.check])`, so the
36
+ * service is unregistered automatically when the owning fiber unloads.
37
+ * Services with a `[Service.invoke]` body return a callable instance.
38
+ *
39
+ * @param ctx — the context to register in (stored as `this.ctx`).
40
+ * @param name — the service name; defaults to the static `provide` field.
41
+ */
42
+ constructor(protected ctx: Context, name: string) {
43
+ name ??= this.constructor['provide'] as string
44
+
45
+ let self = this
46
+ const tracker: Tracker = {
47
+ associate: name,
48
+ property: 'ctx',
49
+ }
50
+ if (self[symbols.invoke]) {
51
+ self = createCallable(name, joinPrototype(Object.getPrototypeOf(this), Function.prototype), tracker)
52
+ }
53
+ self.ctx = ctx
54
+ self.name = name
55
+ defineProperty(self, symbols.tracker, tracker)
56
+
57
+ self.ctx.reflect.provide(name, self, this[symbols.check])
58
+ return self
59
+ }
60
+
61
+ protected [symbols.filter](ctx: Context) {
62
+ return ctx[symbols.isolate][this.name] === this.ctx[symbols.isolate][this.name]
63
+ }
64
+
65
+ protected [symbols.extend](props?: any) {
66
+ let self: any
67
+ if (this[Service.invoke]) {
68
+ self = createCallable(this.name, this, this[symbols.tracker])
69
+ } else {
70
+ self = Object.create(this)
71
+ }
72
+ return Object.assign(self, props)
73
+ }
74
+
75
+ /**
76
+ * Merge intercept config from ancestors with optional base and head values.
77
+ *
78
+ * Entries added closer to the root apply first; `base` is prepended and
79
+ * `head` appended. Uses `Config.merge` when the service declares one,
80
+ * otherwise a shallow `Object.assign`.
81
+ *
82
+ * @param base — lowest-precedence config merged before all intercepts.
83
+ * @param head — highest-precedence config merged after all intercepts.
84
+ * @returns the merged config.
85
+ */
86
+ [symbols.resolveConfig](base?: T, head?: T): T {
87
+ let intercept = this.ctx[Context.intercept]
88
+ const configs: any[] = []
89
+ while (this.name in intercept) {
90
+ if (Object.hasOwn(intercept, this.name)) {
91
+ configs.unshift(intercept[this.name])
92
+ }
93
+ intercept = Object.getPrototypeOf(intercept)
94
+ }
95
+ if (base) configs.unshift(base)
96
+ if (head) configs.push(head)
97
+ if (this['Config']?.merge) {
98
+ return this['Config'].merge(...configs)
99
+ } else {
100
+ return Object.assign({}, ...configs)
101
+ }
102
+ }
103
+
104
+ static [Symbol.hasInstance](instance: any) {
105
+ if (!instance) return false
106
+ let constructor = instance.constructor
107
+ while (constructor) {
108
+ // constructor may be a proxy
109
+ constructor = constructor.prototype?.constructor
110
+ if (constructor === this) return true
111
+ constructor &&= Object.getPrototypeOf(constructor)
112
+ }
113
+ return false
114
+ }
115
+ }
@@ -0,0 +1,62 @@
1
+ import type { Context, Service } from './index.ts';
2
+ /** Ordered collection of disposable values with O(1) deletion by value. */
3
+ export declare class DisposableList<T extends WeakKey> {
4
+ private sn;
5
+ private map;
6
+ private weak;
7
+ get length(): number;
8
+ push(value: T): () => boolean;
9
+ delete(value: T): boolean;
10
+ clear(): T[];
11
+ [Symbol.iterator](): MapIterator<T>;
12
+ }
13
+ /** Metadata used by traceable proxies to rebind `ctx` and associated services. */
14
+ export interface Tracker {
15
+ associate?: string;
16
+ property?: string;
17
+ noShadow?: boolean;
18
+ }
19
+ /** Shared symbols used to avoid public property-name collisions. */
20
+ export declare const symbols: {
21
+ shadow: symbol;
22
+ receiver: symbol;
23
+ original: symbol;
24
+ metadata: symbol;
25
+ initHooks: symbol;
26
+ checkProto: symbol;
27
+ effect: typeof Context.effect;
28
+ filter: typeof Context.filter;
29
+ isolate: typeof Context.isolate;
30
+ intercept: typeof Context.intercept;
31
+ init: typeof Service.init;
32
+ check: typeof Service.check;
33
+ config: typeof Service.config;
34
+ invoke: typeof Service.invoke;
35
+ extend: typeof Service.extend;
36
+ tracker: typeof Service.tracker;
37
+ resolveConfig: typeof Service.resolveConfig;
38
+ };
39
+ /** Return true when a plugin callback should be constructed with `new`. */
40
+ export declare function isConstructor(func: any): func is new (...args: any) => any;
41
+ /** Merge two prototype chains while preserving descriptors from `proto1`. */
42
+ export declare function joinPrototype(proto1: {}, proto2: {}): any;
43
+ /** Return true for non-null objects and functions. */
44
+ export declare function isObject(value: any): value is {};
45
+ /** Find a property descriptor by walking an object's prototype chain. */
46
+ export declare function getPropertyDescriptor(target: any, prop: string | symbol): TypedPropertyDescriptor<any> | undefined;
47
+ /** Wrap services/functions so method calls see the caller's active context. */
48
+ export declare function getTraceable<T>(ctx: Context, value: T): T;
49
+ /** Return a proxy that overlays readonly or writable properties onto a target. */
50
+ export declare function withProps(target: any, props?: {}): any;
51
+ /** Create a callable service object that dispatches through `symbols.invoke`. */
52
+ export declare function createCallable(name: string, proto: {}, tracker: Tracker): any;
53
+ interface StackInfo {
54
+ offset: number;
55
+ error: Error;
56
+ }
57
+ /** Run a callback and splice outer call-site frames into thrown async errors. */
58
+ export declare function composeError<T>(callback: (info: StackInfo) => T, getOuterStack?: () => string[]): T;
59
+ /** Capture a lazy stack-frame supplier for later error composition. */
60
+ export declare function buildOuterStack(offset?: number): () => string[];
61
+ export {};
62
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAElD,2EAA2E;AAC3E,qBAAa,cAAc,CAAC,CAAC,SAAS,OAAO;IAC3C,OAAO,CAAC,EAAE,CAAI;IACd,OAAO,CAAC,GAAG,CAAuB;IAClC,OAAO,CAAC,IAAI,CAA2B;IAEvC,IAAI,MAAM,WAET;IAED,IAAI,CAAC,KAAK,EAAE,CAAC;IAOb,MAAM,CAAC,KAAK,EAAE,CAAC;IAMf,KAAK;IAML,CAAC,MAAM,CAAC,QAAQ,CAAC;CAOlB;AAED,kFAAkF;AAClF,MAAM,WAAW,OAAO;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,oEAAoE;AACpE,eAAO,MAAM,OAAO;;;;;;;YAUqB,OAAO,OAAO,CAAC,MAAM;YACrB,OAAO,OAAO,CAAC,MAAM;aACnB,OAAO,OAAO,CAAC,OAAO;eAClB,OAAO,OAAO,CAAC,SAAS;UAGlC,OAAO,OAAO,CAAC,IAAI;WACjB,OAAO,OAAO,CAAC,KAAK;YAClB,OAAO,OAAO,CAAC,MAAM;YACrB,OAAO,OAAO,CAAC,MAAM;YACrB,OAAO,OAAO,CAAC,MAAM;aACnB,OAAO,OAAO,CAAC,OAAO;mBACV,OAAO,OAAO,CAAC,aAAa;CAClF,CAAA;AAKD,2EAA2E;AAC3E,wBAAgB,aAAa,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,CAU1E;AAED,6EAA6E;AAC7E,wBAAgB,aAAa,CAAC,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,OAOnD;AAED,sDAAsD;AACtD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,EAAE,CAEhD;AAED,yEAAyE;AACzE,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,4CAOvE;AAED,+EAA+E;AAC/E,wBAAgB,YAAY,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAQzD;AAED,kFAAkF;AAClF,wBAAgB,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,OAYhD;AAqFD,iFAAiF;AACjF,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,OAOvE;AAED,UAAU,SAAS;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,KAAK,CAAA;CACb;AA6BD,iFAAiF;AACjF,wBAAgB,YAAY,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,CAAC,EAAE,aAAa,iBAAoB,GAAG,CAAC,CAatG;AAED,uEAAuE;AACvE,wBAAgB,eAAe,CAAC,MAAM,SAAI,kBAGzC"}
@@ -0,0 +1,271 @@
1
+ import { defineProperty } from '@xrkseek/cosmokit';
2
+ /** Ordered collection of disposable values with O(1) deletion by value. */
3
+ export class DisposableList {
4
+ sn = 0;
5
+ map = new Map();
6
+ weak = new WeakMap();
7
+ get length() {
8
+ return this.map.size;
9
+ }
10
+ push(value) {
11
+ const sn = ++this.sn;
12
+ this.map.set(sn, value);
13
+ this.weak.set(value, sn);
14
+ return () => this.map.delete(sn);
15
+ }
16
+ delete(value) {
17
+ const sn = this.weak.get(value);
18
+ if (!sn)
19
+ return false;
20
+ return this.map.delete(sn);
21
+ }
22
+ clear() {
23
+ const values = [...this.map.values()];
24
+ this.map.clear();
25
+ return values.reverse();
26
+ }
27
+ [Symbol.iterator]() {
28
+ return this.map.values();
29
+ }
30
+ [Symbol.for('nodejs.util.inspect.custom')]() {
31
+ return [...this];
32
+ }
33
+ }
34
+ /** Shared symbols used to avoid public property-name collisions. */
35
+ export const symbols = {
36
+ // internal symbols
37
+ shadow: Symbol.for('cordis.shadow'),
38
+ receiver: Symbol.for('cordis.receiver'),
39
+ original: Symbol.for('cordis.original'),
40
+ metadata: Symbol.for('cordis.metadata'),
41
+ initHooks: Symbol.for('cordis.initHooks'),
42
+ checkProto: Symbol.for('cordis.checkProto'),
43
+ // context symbols
44
+ effect: Symbol.for('cordis.effect'),
45
+ filter: Symbol.for('cordis.filter'),
46
+ isolate: Symbol.for('cordis.isolate'),
47
+ intercept: Symbol.for('cordis.intercept'),
48
+ // service symbols
49
+ init: Symbol.for('cordis.init'),
50
+ check: Symbol.for('cordis.check'),
51
+ config: Symbol.for('cordis.config'),
52
+ invoke: Symbol.for('cordis.invoke'),
53
+ extend: Symbol.for('cordis.extend'),
54
+ tracker: Symbol.for('cordis.tracker'),
55
+ resolveConfig: Symbol.for('cordis.resolveConfig'),
56
+ };
57
+ const GeneratorFunction = function* () { }.constructor;
58
+ const AsyncGeneratorFunction = async function* () { }.constructor;
59
+ /** Return true when a plugin callback should be constructed with `new`. */
60
+ export function isConstructor(func) {
61
+ // async function or arrow function
62
+ if (!func.prototype)
63
+ return false;
64
+ // generator function or malformed definition
65
+ // we cannot use below check because `mock.fn()` is proxied
66
+ // if (func.prototype.constructor !== func) return false
67
+ if (func instanceof GeneratorFunction)
68
+ return false;
69
+ // polyfilled AsyncGeneratorFunction === Function
70
+ if (AsyncGeneratorFunction !== Function && func instanceof AsyncGeneratorFunction)
71
+ return false;
72
+ return true;
73
+ }
74
+ /** Merge two prototype chains while preserving descriptors from `proto1`. */
75
+ export function joinPrototype(proto1, proto2) {
76
+ if (proto1 === Object.prototype)
77
+ return proto2;
78
+ const result = Object.create(joinPrototype(Object.getPrototypeOf(proto1), proto2));
79
+ for (const key of Reflect.ownKeys(proto1)) {
80
+ Object.defineProperty(result, key, Object.getOwnPropertyDescriptor(proto1, key));
81
+ }
82
+ return result;
83
+ }
84
+ /** Return true for non-null objects and functions. */
85
+ export function isObject(value) {
86
+ return value && (typeof value === 'object' || typeof value === 'function');
87
+ }
88
+ /** Find a property descriptor by walking an object's prototype chain. */
89
+ export function getPropertyDescriptor(target, prop) {
90
+ let proto = target;
91
+ while (proto) {
92
+ const desc = Reflect.getOwnPropertyDescriptor(proto, prop);
93
+ if (desc)
94
+ return desc;
95
+ proto = Object.getPrototypeOf(proto);
96
+ }
97
+ }
98
+ /** Wrap services/functions so method calls see the caller's active context. */
99
+ export function getTraceable(ctx, value) {
100
+ if (!isObject(value))
101
+ return value;
102
+ if (Object.hasOwn(value, symbols.shadow)) {
103
+ return Object.getPrototypeOf(value);
104
+ }
105
+ const tracker = value[symbols.tracker];
106
+ if (!tracker)
107
+ return value;
108
+ return createTraceable(ctx, value, tracker);
109
+ }
110
+ /** Return a proxy that overlays readonly or writable properties onto a target. */
111
+ export function withProps(target, props) {
112
+ if (!props)
113
+ return target;
114
+ return new Proxy(target, {
115
+ get: (target, prop, receiver) => {
116
+ if (prop in props && prop !== 'constructor')
117
+ return Reflect.get(props, prop, receiver);
118
+ return Reflect.get(target, prop, receiver);
119
+ },
120
+ set: (target, prop, value, receiver) => {
121
+ if (prop in props && prop !== 'constructor')
122
+ return Reflect.set(props, prop, value, receiver);
123
+ return Reflect.set(target, prop, value, receiver);
124
+ },
125
+ });
126
+ }
127
+ function withProp(target, prop, value) {
128
+ return withProps(target, Object.defineProperty(Object.create(null), prop, {
129
+ value,
130
+ writable: false,
131
+ }));
132
+ }
133
+ function createShadow(ctx, target, property, receiver) {
134
+ if (!property)
135
+ return receiver;
136
+ const origin = Reflect.getOwnPropertyDescriptor(target, property)?.value;
137
+ if (!origin)
138
+ return receiver;
139
+ return withProp(receiver, property, ctx.extend({ [symbols.shadow]: origin }));
140
+ }
141
+ function createShadowMethod(ctx, value, outer, shadow) {
142
+ return new Proxy(value, {
143
+ apply: (target, thisArg, args) => {
144
+ if (thisArg === outer)
145
+ thisArg = shadow;
146
+ return getTraceable(ctx, Reflect.apply(target, thisArg, args));
147
+ },
148
+ });
149
+ }
150
+ function createTraceable(ctx, value, tracker) {
151
+ // noShadow services are identity-aware (e.g. logger uses the origin fiber to
152
+ // derive its name): keep the shadow ctx so they can read [symbols.shadow]
153
+ // and resolve the origin. Non-noShadow services strip — their side effects
154
+ // bind to caller, not origin.
155
+ if (ctx[symbols.shadow] && !tracker.noShadow) {
156
+ ctx = Object.getPrototypeOf(ctx);
157
+ }
158
+ const proxy = new Proxy(value, {
159
+ get: (target, prop, receiver) => {
160
+ if (prop === symbols.original)
161
+ return target;
162
+ if (prop === tracker.property)
163
+ return ctx;
164
+ if (typeof prop === 'symbol') {
165
+ return Reflect.get(target, prop, receiver);
166
+ }
167
+ if (tracker.associate && ctx.reflect.props[`${tracker.associate}.${prop}`]) {
168
+ return Reflect.get(ctx, `${tracker.associate}.${prop}`, withProp(ctx, symbols.receiver, receiver));
169
+ }
170
+ let shadow, innerValue;
171
+ const desc = getPropertyDescriptor(target, prop);
172
+ if (desc && 'value' in desc) {
173
+ innerValue = desc.value;
174
+ }
175
+ else {
176
+ shadow = createShadow(ctx, target, tracker.property, receiver);
177
+ innerValue = Reflect.get(target, prop, shadow);
178
+ }
179
+ const innerTracker = innerValue?.[symbols.tracker];
180
+ if (innerTracker) {
181
+ return createTraceable(ctx, innerValue, innerTracker);
182
+ }
183
+ else if (!tracker.noShadow && typeof innerValue === 'function') {
184
+ shadow ??= createShadow(ctx, target, tracker.property, receiver);
185
+ return createShadowMethod(ctx, innerValue, receiver, shadow);
186
+ }
187
+ else {
188
+ return innerValue;
189
+ }
190
+ },
191
+ set: (target, prop, value, receiver) => {
192
+ if (prop === symbols.original)
193
+ return false;
194
+ if (prop === tracker.property)
195
+ return false;
196
+ if (typeof prop === 'symbol') {
197
+ return Reflect.set(target, prop, value, receiver);
198
+ }
199
+ if (tracker.associate && ctx.reflect.props[`${tracker.associate}.${prop}`]) {
200
+ return Reflect.set(ctx, `${tracker.associate}.${prop}`, value, withProp(ctx, symbols.receiver, receiver));
201
+ }
202
+ const shadow = createShadow(ctx, target, tracker.property, receiver);
203
+ return Reflect.set(target, prop, value, shadow);
204
+ },
205
+ apply: (target, thisArg, args) => {
206
+ return applyTraceable(proxy, target, thisArg, args);
207
+ },
208
+ });
209
+ return proxy;
210
+ }
211
+ function applyTraceable(proxy, value, thisArg, args) {
212
+ if (!value[symbols.invoke])
213
+ return Reflect.apply(value, thisArg, args);
214
+ return value[symbols.invoke].apply(proxy, args);
215
+ }
216
+ /** Create a callable service object that dispatches through `symbols.invoke`. */
217
+ export function createCallable(name, proto, tracker) {
218
+ const self = function (...args) {
219
+ const proxy = createTraceable(self['ctx'], self, tracker);
220
+ return applyTraceable(proxy, self, this, args);
221
+ };
222
+ defineProperty(self, 'name', name);
223
+ return Object.setPrototypeOf(self, proto);
224
+ }
225
+ function handleError(info, reason, getOuterStack) {
226
+ const innerLines = info.error.stack.split('\n');
227
+ // malformed error
228
+ if (typeof reason?.stack !== 'string') {
229
+ const outerError = new Error(reason);
230
+ const lines = outerError.stack.split('\n');
231
+ lines.splice(1, Infinity, ...getOuterStack());
232
+ outerError.stack = lines.join('\n');
233
+ throw outerError;
234
+ }
235
+ // long stack trace
236
+ const lines = reason.stack.split('\n');
237
+ let index = lines.indexOf(innerLines[2]);
238
+ if (index === -1)
239
+ throw reason;
240
+ index -= info.offset;
241
+ while (index > 0) {
242
+ if (!lines[index - 1].endsWith(' (<anonymous>)'))
243
+ break;
244
+ index -= 1;
245
+ }
246
+ lines.splice(index, Infinity, ...getOuterStack());
247
+ reason.stack = lines.join('\n');
248
+ throw reason;
249
+ }
250
+ /** Run a callback and splice outer call-site frames into thrown async errors. */
251
+ export function composeError(callback, getOuterStack = buildOuterStack()) {
252
+ const info = { offset: 1, error: new Error() };
253
+ try {
254
+ const result = callback(info);
255
+ if (isObject(result) && 'then' in result) {
256
+ return result.then(undefined, (reason) => handleError(info, reason, getOuterStack));
257
+ }
258
+ else {
259
+ return result;
260
+ }
261
+ }
262
+ catch (reason) {
263
+ handleError(info, reason, getOuterStack);
264
+ }
265
+ }
266
+ /** Capture a lazy stack-frame supplier for later error composition. */
267
+ export function buildOuterStack(offset = 0) {
268
+ const outerError = new Error();
269
+ return () => outerError.stack.split('\n').slice(3 + offset);
270
+ }
271
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAGlD,2EAA2E;AAC3E,MAAM,OAAO,cAAc;IACjB,EAAE,GAAG,CAAC,CAAA;IACN,GAAG,GAAG,IAAI,GAAG,EAAa,CAAA;IAC1B,IAAI,GAAG,IAAI,OAAO,EAAa,CAAA;IAEvC,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAA;IACtB,CAAC;IAED,IAAI,CAAC,KAAQ;QACX,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,CAAA;QACpB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAA;QACvB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;QACxB,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,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