@ai-setting/roy-agent-core 1.7.52 → 1.7.53

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 (334) hide show
  1. package/dist/config/config-component.d.ts +346 -0
  2. package/dist/config/config-parser.d.ts +45 -0
  3. package/dist/config/env-key.d.ts +97 -0
  4. package/dist/config/env-source.d.ts +113 -0
  5. package/dist/config/file-source.d.ts +90 -0
  6. package/dist/config/index.d.ts +4 -0
  7. package/dist/config/protocol-resolver.d.ts +94 -0
  8. package/dist/env/agent/agent-component.d.ts +646 -0
  9. package/dist/env/agent/agent-config-registration.d.ts +18 -0
  10. package/dist/env/agent/agent-registry.d.ts +500 -0
  11. package/dist/env/agent/index.d.ts +9 -0
  12. package/dist/env/agent/summary-agent.d.ts +44 -0
  13. package/dist/env/agent/types.d.ts +503 -0
  14. package/dist/env/commands/commands-component.d.ts +97 -0
  15. package/dist/env/commands/commands-config-registration.d.ts +19 -0
  16. package/dist/env/commands/index.d.ts +7 -0
  17. package/dist/env/commands/parser.d.ts +18 -0
  18. package/dist/env/commands/types.d.ts +133 -0
  19. package/dist/env/component.d.ts +186 -0
  20. package/dist/env/constants.d.ts +112 -0
  21. package/dist/env/context/env-context.d.ts +420 -0
  22. package/dist/env/context/env-event.d.ts +144 -0
  23. package/dist/env/context/index.d.ts +13 -0
  24. package/dist/env/debug/debug-component.d.ts +160 -0
  25. package/dist/env/debug/formatters/index.d.ts +8 -0
  26. package/dist/env/debug/formatters/repl-formatter.d.ts +80 -0
  27. package/dist/env/debug/formatters/trace-formatter.d.ts +43 -0
  28. package/dist/env/debug/formatters/tree-formatter.d.ts +72 -0
  29. package/dist/env/debug/index.d.ts +15 -0
  30. package/dist/env/debug/index.js +1 -1
  31. package/dist/env/debug/parser/regex-parser.d.ts +49 -0
  32. package/dist/env/debug/parser/span-builder.d.ts +79 -0
  33. package/dist/env/debug/reader/log-reader.d.ts +55 -0
  34. package/dist/env/debug/reader/span-db-reader.d.ts +70 -0
  35. package/dist/env/debug/types.d.ts +145 -0
  36. package/dist/env/environment.d.ts +185 -0
  37. package/dist/env/errors.d.ts +120 -0
  38. package/dist/env/event-source/bounty-cli-handler.d.ts +42 -0
  39. package/dist/env/event-source/bounty-im-handler.d.ts +232 -0
  40. package/dist/env/event-source/event-source-component.d.ts +177 -0
  41. package/dist/env/event-source/event-source-config-registration.d.ts +18 -0
  42. package/dist/env/event-source/event-source-handlers.d.ts +486 -0
  43. package/dist/env/event-source/event-store.d.ts +110 -0
  44. package/dist/env/event-source/idempotency-key.d.ts +19 -0
  45. package/dist/env/event-source/index.d.ts +15 -0
  46. package/dist/env/event-source/index.js +2 -2
  47. package/dist/env/event-source/timer-handler.d.ts +74 -0
  48. package/dist/env/event-source/types.d.ts +803 -0
  49. package/dist/env/hook/global-hook-manager.d.ts +73 -0
  50. package/dist/env/hook/hook-manager.d.ts +139 -0
  51. package/dist/env/hook/index.d.ts +9 -0
  52. package/dist/env/hook/types.d.ts +107 -0
  53. package/dist/env/index.d.ts +24 -0
  54. package/dist/env/index.js +4 -4
  55. package/dist/env/interface.d.ts +156 -0
  56. package/dist/env/lark-mention-utils.d.ts +59 -0
  57. package/dist/env/llm/adapter-ai-sdk.d.ts +10 -0
  58. package/dist/env/llm/adapter-pi-ai.d.ts +39 -0
  59. package/dist/env/llm/adapter.d.ts +80 -0
  60. package/dist/env/llm/factory.d.ts +13 -0
  61. package/dist/env/llm/hooks.d.ts +150 -0
  62. package/dist/env/llm/index.d.ts +16 -0
  63. package/dist/env/llm/invoke.d.ts +264 -0
  64. package/dist/env/llm/llm-cache.d.ts +38 -0
  65. package/dist/env/llm/llm.d.ts +238 -0
  66. package/dist/env/llm/opencode-session.d.ts +79 -0
  67. package/dist/env/llm/provider.d.ts +40 -0
  68. package/dist/env/llm/tool-args-parser.d.ts +77 -0
  69. package/dist/env/llm/tool-schema.d.ts +54 -0
  70. package/dist/env/llm/transform.d.ts +57 -0
  71. package/dist/env/llm/types.d.ts +818 -0
  72. package/dist/env/log-trace/decorator.d.ts +88 -0
  73. package/dist/env/log-trace/index.d.ts +14 -0
  74. package/dist/env/log-trace/log-trace-component.d.ts +268 -0
  75. package/dist/env/log-trace/log-trace-config-registration.d.ts +25 -0
  76. package/dist/env/log-trace/logger.d.ts +83 -0
  77. package/dist/env/log-trace/opentelemetry/cli-propagation.d.ts +105 -0
  78. package/dist/env/log-trace/opentelemetry/mod.d.ts +24 -0
  79. package/dist/env/log-trace/opentelemetry/propagation-env.d.ts +81 -0
  80. package/dist/env/log-trace/opentelemetry/propagation.d.ts +79 -0
  81. package/dist/env/log-trace/opentelemetry/tracer-provider.d.ts +157 -0
  82. package/dist/env/log-trace/span-storage.d.ts +37 -0
  83. package/dist/env/log-trace/trace-context.d.ts +28 -0
  84. package/dist/env/log-trace/types.d.ts +127 -0
  85. package/dist/env/mcp/command-resolver.d.ts +12 -0
  86. package/dist/env/mcp/config.d.ts +103 -0
  87. package/dist/env/mcp/index.d.ts +13 -0
  88. package/dist/env/mcp/loader.d.ts +78 -0
  89. package/dist/env/mcp/mcp-component.d.ts +54 -0
  90. package/dist/env/mcp/mcp-config-registration.d.ts +19 -0
  91. package/dist/env/mcp/npm-prefix/index.d.ts +17 -0
  92. package/dist/env/mcp/scanner.d.ts +38 -0
  93. package/dist/env/mcp/tool/adapter.d.ts +32 -0
  94. package/dist/env/mcp/tool/index.d.ts +4 -0
  95. package/dist/env/mcp/types.d.ts +131 -0
  96. package/dist/env/memory/built-in/index.d.ts +41 -0
  97. package/dist/env/memory/built-in/recall-memory.d.ts +29 -0
  98. package/dist/env/memory/built-in/record-memory.d.ts +44 -0
  99. package/dist/env/memory/index.d.ts +10 -0
  100. package/dist/env/memory/memory-component.d.ts +114 -0
  101. package/dist/env/memory/memory-config-registration.d.ts +18 -0
  102. package/dist/env/memory/memory-config.d.ts +18 -0
  103. package/dist/env/memory/plugin/index.d.ts +16 -0
  104. package/dist/env/memory/plugin/memory-agent.d.ts +126 -0
  105. package/dist/env/memory/plugin/memory-manager.d.ts +71 -0
  106. package/dist/env/memory/plugin/memory-plugin.d.ts +103 -0
  107. package/dist/env/memory/plugin/recall-memory.d.ts +16 -0
  108. package/dist/env/memory/plugin/types.d.ts +75 -0
  109. package/dist/env/memory/tools/memory-agent-tools.d.ts +109 -0
  110. package/dist/env/memory/types.d.ts +80 -0
  111. package/dist/env/paths.d.ts +46 -0
  112. package/dist/env/plugin/bounty-cli-notification-channel.d.ts +60 -0
  113. package/dist/env/plugin/event-bus-notification-channel.d.ts +50 -0
  114. package/dist/env/plugin/index.d.ts +13 -0
  115. package/dist/env/plugin/lark-cli-notification-channel.d.ts +61 -0
  116. package/dist/env/plugin/notification-channel.d.ts +143 -0
  117. package/dist/env/plugin/plugin-component.d.ts +232 -0
  118. package/dist/env/plugin/types.d.ts +146 -0
  119. package/dist/env/prompt/index.d.ts +7 -0
  120. package/dist/env/prompt/prompt-component.d.ts +194 -0
  121. package/dist/env/prompt/prompt-config-registration.d.ts +18 -0
  122. package/dist/env/prompt/prompt-store.d.ts +26 -0
  123. package/dist/env/prompt/prompts-index.d.ts +146 -0
  124. package/dist/env/prompt/renderer.d.ts +21 -0
  125. package/dist/env/prompt/types.d.ts +176 -0
  126. package/dist/env/session/hooks.d.ts +14 -0
  127. package/dist/env/session/index.d.ts +19 -0
  128. package/dist/env/session/search-query-parser.d.ts +41 -0
  129. package/dist/env/session/session-component.d.ts +464 -0
  130. package/dist/env/session/session-config-registration.d.ts +18 -0
  131. package/dist/env/session/session-id.d.ts +26 -0
  132. package/dist/env/session/session-message-converter.d.ts +142 -0
  133. package/dist/env/session/session-store.d.ts +188 -0
  134. package/dist/env/session/storage/index.d.ts +5 -0
  135. package/dist/env/session/storage/memory.d.ts +119 -0
  136. package/dist/env/session/storage/sqlite.d.ts +108 -0
  137. package/dist/env/session/types.d.ts +705 -0
  138. package/dist/env/session-tree-stopper.d.ts +79 -0
  139. package/dist/env/skill/config.d.ts +13 -0
  140. package/dist/env/skill/index.d.ts +6 -0
  141. package/dist/env/skill/parser.d.ts +9 -0
  142. package/dist/env/skill/scanner.d.ts +25 -0
  143. package/dist/env/skill/skill-component.d.ts +89 -0
  144. package/dist/env/skill/skill-config-registration.d.ts +18 -0
  145. package/dist/env/skill/tool/index.d.ts +1 -0
  146. package/dist/env/skill/tool/skill-tool.d.ts +15 -0
  147. package/dist/env/skill/types.d.ts +61 -0
  148. package/dist/env/task/backend/index.d.ts +24 -0
  149. package/dist/env/task/backend/index.js +704 -0
  150. package/dist/env/task/backend/roy-sidecar-task-port.d.ts +148 -0
  151. package/dist/env/task/backend/sqlite-task-port.d.ts +28 -0
  152. package/dist/env/task/backend/task-store-backend.d.ts +107 -0
  153. package/dist/env/task/backend/types.d.ts +293 -0
  154. package/dist/env/task/delegate/bg-task-id-storage.d.ts +9 -0
  155. package/dist/env/task/delegate/delegate-tool.d.ts +681 -0
  156. package/dist/env/task/delegate/index.d.ts +8 -0
  157. package/dist/env/task/delegate/process-registry.d.ts +58 -0
  158. package/dist/env/task/delegate/stop-tool.d.ts +12 -0
  159. package/dist/env/task/delegate/subagent-resolver.d.ts +25 -0
  160. package/dist/env/task/events/index.d.ts +7 -0
  161. package/dist/env/task/events/task-event-payloads.d.ts +101 -0
  162. package/dist/env/task/events/task-event-types.d.ts +23 -0
  163. package/dist/env/task/hooks/contexts.d.ts +191 -0
  164. package/dist/env/task/hooks/index.d.ts +7 -0
  165. package/dist/env/task/hooks/task-hook-points.d.ts +42 -0
  166. package/dist/env/task/index.d.ts +7 -0
  167. package/dist/env/task/plugins/auto-task-plugin.d.ts +38 -0
  168. package/dist/env/task/plugins/card-chat-routing.d.ts +135 -0
  169. package/dist/env/task/plugins/fake-user-message-helper.d.ts +90 -0
  170. package/dist/env/task/plugins/index.d.ts +8 -0
  171. package/dist/env/task/plugins/index.js +1 -1
  172. package/dist/env/task/plugins/lark-card-action-handler.d.ts +166 -0
  173. package/dist/env/task/plugins/lark-card-patch-notifier.d.ts +651 -0
  174. package/dist/env/task/plugins/lark-cli-task-notify-plugin.d.ts +248 -0
  175. package/dist/env/task/plugins/max-iteration-reminder-plugin.d.ts +112 -0
  176. package/dist/env/task/plugins/per-task-group-chat-plugin.d.ts +561 -0
  177. package/dist/env/task/plugins/task-tag-plugin.d.ts +70 -0
  178. package/dist/env/task/plugins/workflow-extractor-agent.d.ts +43 -0
  179. package/dist/env/task/registry-hook-installer.d.ts +43 -0
  180. package/dist/env/task/storage/index.d.ts +5 -0
  181. package/dist/env/task/storage/migrations/001_add_project_path_context.d.ts +14 -0
  182. package/dist/env/task/storage/migrations/002_add_task_type.d.ts +14 -0
  183. package/dist/env/task/storage/migrations/003_add_process_description.d.ts +20 -0
  184. package/dist/env/task/storage/migrations/004_rename_action_to_milestone.d.ts +37 -0
  185. package/dist/env/task/storage/migrations/005_convert_blob_description_to_text.d.ts +51 -0
  186. package/dist/env/task/storage/sqlite-task-store.d.ts +241 -0
  187. package/dist/env/task/tag-service.d.ts +138 -0
  188. package/dist/env/task/task-child-context.d.ts +70 -0
  189. package/dist/env/task/task-component.d.ts +270 -0
  190. package/dist/env/task/task-config-registration.d.ts +19 -0
  191. package/dist/env/task/task-creation-registry.d.ts +181 -0
  192. package/dist/env/task/task-reuse-context.d.ts +52 -0
  193. package/dist/env/task/task-reuse-registry.d.ts +31 -0
  194. package/dist/env/task/tools/batch-archive-tool.d.ts +9 -0
  195. package/dist/env/task/tools/batch-delete-tool.d.ts +9 -0
  196. package/dist/env/task/tools/complete-tool.d.ts +12 -0
  197. package/dist/env/task/tools/create-tool.d.ts +6 -0
  198. package/dist/env/task/tools/delete-tool.d.ts +6 -0
  199. package/dist/env/task/tools/get-tool.d.ts +6 -0
  200. package/dist/env/task/tools/index.d.ts +13 -0
  201. package/dist/env/task/tools/list-tool.d.ts +6 -0
  202. package/dist/env/task/tools/operation/create-tool.d.ts +12 -0
  203. package/dist/env/task/tools/operation/delete-tool.d.ts +6 -0
  204. package/dist/env/task/tools/operation/get-tool.d.ts +6 -0
  205. package/dist/env/task/tools/operation/index.d.ts +8 -0
  206. package/dist/env/task/tools/operation/list-tool.d.ts +6 -0
  207. package/dist/env/task/tools/operation/operation-types.d.ts +225 -0
  208. package/dist/env/task/tools/operation/update-tool.d.ts +6 -0
  209. package/dist/env/task/tools/search-tool.d.ts +9 -0
  210. package/dist/env/task/tools/task-tree-tool.d.ts +65 -0
  211. package/dist/env/task/tools/task-types.d.ts +255 -0
  212. package/dist/env/task/tools/update-tool.d.ts +6 -0
  213. package/dist/env/task/types.d.ts +290 -0
  214. package/dist/env/tool/built-in/bash-effect.d.ts +36 -0
  215. package/dist/env/tool/built-in/bash.d.ts +16 -0
  216. package/dist/env/tool/built-in/echo.d.ts +7 -0
  217. package/dist/env/tool/built-in/edit-file.d.ts +6 -0
  218. package/dist/env/tool/built-in/glob.d.ts +6 -0
  219. package/dist/env/tool/built-in/grep.d.ts +6 -0
  220. package/dist/env/tool/built-in/index.d.ts +39 -0
  221. package/dist/env/tool/built-in/query-background-process-tool.d.ts +113 -0
  222. package/dist/env/tool/built-in/read-file.d.ts +5 -0
  223. package/dist/env/tool/built-in/understand-image.d.ts +59 -0
  224. package/dist/env/tool/built-in/write-file.d.ts +5 -0
  225. package/dist/env/tool/index.d.ts +16 -0
  226. package/dist/env/tool/registry.d.ts +61 -0
  227. package/dist/env/tool/tool-component.d.ts +242 -0
  228. package/dist/env/tool/tool-config-registration.d.ts +18 -0
  229. package/dist/env/tool/types.d.ts +274 -0
  230. package/dist/env/tool/validator.d.ts +14 -0
  231. package/dist/env/types.d.ts +184 -0
  232. package/dist/env/workflow/decorators/decorator-node.d.ts +76 -0
  233. package/dist/env/workflow/decorators/edge.d.ts +42 -0
  234. package/dist/env/workflow/decorators/index.d.ts +13 -0
  235. package/dist/env/workflow/decorators/node-as.d.ts +40 -0
  236. package/dist/env/workflow/decorators/workflow.d.ts +30 -0
  237. package/dist/env/workflow/engine/dag-manager.d.ts +176 -0
  238. package/dist/env/workflow/engine/engine.d.ts +375 -0
  239. package/dist/env/workflow/engine/event-bus.d.ts +54 -0
  240. package/dist/env/workflow/engine/executor.d.ts +122 -0
  241. package/dist/env/workflow/engine/index.d.ts +15 -0
  242. package/dist/env/workflow/engine/node-registry.d.ts +159 -0
  243. package/dist/env/workflow/engine/scheduler.d.ts +164 -0
  244. package/dist/env/workflow/extractor/workflow-converter.d.ts +55 -0
  245. package/dist/env/workflow/fixtures.d.ts +401 -0
  246. package/dist/env/workflow/hooks/index.d.ts +4 -0
  247. package/dist/env/workflow/hooks/workflow-hook-points.d.ts +161 -0
  248. package/dist/env/workflow/index.d.ts +30 -0
  249. package/dist/env/workflow/index.js +1 -1
  250. package/dist/env/workflow/metadata/keys.d.ts +6 -0
  251. package/dist/env/workflow/nodes/agent-component-adapter.d.ts +175 -0
  252. package/dist/env/workflow/nodes/agent-node.d.ts +206 -0
  253. package/dist/env/workflow/nodes/ask-user-node.d.ts +66 -0
  254. package/dist/env/workflow/nodes/condition-node.d.ts +39 -0
  255. package/dist/env/workflow/nodes/index.d.ts +8 -0
  256. package/dist/env/workflow/nodes/merge-node.d.ts +40 -0
  257. package/dist/env/workflow/nodes/python-call-node.d.ts +95 -0
  258. package/dist/env/workflow/nodes/skill-node.d.ts +29 -0
  259. package/dist/env/workflow/nodes/tool-node.d.ts +58 -0
  260. package/dist/env/workflow/nodes/workflow-node.d.ts +118 -0
  261. package/dist/env/workflow/plugins/index.d.ts +6 -0
  262. package/dist/env/workflow/plugins/lark-cli-workflow-notify-plugin.d.ts +107 -0
  263. package/dist/env/workflow/plugins/workflow-json-output-plugin.d.ts +166 -0
  264. package/dist/env/workflow/runtime/runtime-cancellation-scope.d.ts +121 -0
  265. package/dist/env/workflow/service/index.d.ts +9 -0
  266. package/dist/env/workflow/service/registry.d.ts +37 -0
  267. package/dist/env/workflow/service/workflow-service.d.ts +422 -0
  268. package/dist/env/workflow/storage/index.d.ts +11 -0
  269. package/dist/env/workflow/storage/mock-repositories.d.ts +106 -0
  270. package/dist/env/workflow/storage/safe-json.d.ts +62 -0
  271. package/dist/env/workflow/storage/sqlite.d.ts +57 -0
  272. package/dist/env/workflow/storage/tag-repo.d.ts +65 -0
  273. package/dist/env/workflow/storage/workflow-repo.d.ts +161 -0
  274. package/dist/env/workflow/tools/ask-user-tool.d.ts +35 -0
  275. package/dist/env/workflow/tools/index.d.ts +16 -0
  276. package/dist/env/workflow/tools/run-workflow.d.ts +130 -0
  277. package/dist/env/workflow/tools/submit-json-output-tool.d.ts +38 -0
  278. package/dist/env/workflow/tools/workflow-add-tool.d.ts +47 -0
  279. package/dist/env/workflow/tools/workflow-get-tool.d.ts +29 -0
  280. package/dist/env/workflow/tools/workflow-list-tool.d.ts +55 -0
  281. package/dist/env/workflow/tools/workflow-run-status-tool.d.ts +26 -0
  282. package/dist/env/workflow/tools/workflow-run-stop-tool.d.ts +29 -0
  283. package/dist/env/workflow/tools/workflow-search-tool.d.ts +33 -0
  284. package/dist/env/workflow/tools/workflow-tag-list-tool.d.ts +59 -0
  285. package/dist/env/workflow/tools/workflow-validate-tool.d.ts +60 -0
  286. package/dist/env/workflow/types/context.d.ts +17 -0
  287. package/dist/env/workflow/types/decorators-types.d.ts +182 -0
  288. package/dist/env/workflow/types/edge.d.ts +33 -0
  289. package/dist/env/workflow/types/event.d.ts +869 -0
  290. package/dist/env/workflow/types/index.d.ts +16 -0
  291. package/dist/env/workflow/types/run.d.ts +235 -0
  292. package/dist/env/workflow/types/workflow-error.d.ts +79 -0
  293. package/dist/env/workflow/types/workflow-hil.d.ts +57 -0
  294. package/dist/env/workflow/types/workflow-message.d.ts +193 -0
  295. package/dist/env/workflow/types/workflow-session.d.ts +17 -0
  296. package/dist/env/workflow/types/workflow.d.ts +654 -0
  297. package/dist/env/workflow/types_compat.d.ts +10 -0
  298. package/dist/env/workflow/utils/agent-session-metadata.d.ts +35 -0
  299. package/dist/env/workflow/utils/build-agent-node-output.d.ts +11 -0
  300. package/dist/env/workflow/utils/create-workflow.d.ts +35 -0
  301. package/dist/env/workflow/utils/dependency-prescan.d.ts +67 -0
  302. package/dist/env/workflow/utils/execution-state.d.ts +46 -0
  303. package/dist/env/workflow/utils/extract-agent-json-output.d.ts +6 -0
  304. package/dist/env/workflow/utils/index.d.ts +14 -0
  305. package/dist/env/workflow/utils/json-schema-to-zod.d.ts +23 -0
  306. package/dist/env/workflow/utils/node-id-utils.d.ts +20 -0
  307. package/dist/env/workflow/utils/node-output-contracts.d.ts +137 -0
  308. package/dist/env/workflow/utils/node-registry-helper.d.ts +36 -0
  309. package/dist/env/workflow/utils/output-schema-hint.d.ts +7 -0
  310. package/dist/env/workflow/utils/parse-agent-output-config.d.ts +9 -0
  311. package/dist/env/workflow/utils/recovery-validator.d.ts +30 -0
  312. package/dist/env/workflow/utils/sensitive-redact.d.ts +37 -0
  313. package/dist/env/workflow/utils/session-parser.d.ts +23 -0
  314. package/dist/env/workflow/utils/session-recovery.d.ts +122 -0
  315. package/dist/env/workflow/utils/template-contract-validator.d.ts +87 -0
  316. package/dist/env/workflow/utils/template-resolver.d.ts +285 -0
  317. package/dist/env/workflow/utils/validate-workflow-definition.d.ts +57 -0
  318. package/dist/env/workflow/utils/validation-rules.d.ts +103 -0
  319. package/dist/env/workflow/utils/workflow-message-metadata.d.ts +20 -0
  320. package/dist/env/workflow/utils/workflow-sanitize.d.ts +51 -0
  321. package/dist/env/workflow/workflow-component.d.ts +138 -0
  322. package/dist/index.d.ts +59 -0
  323. package/dist/index.js +5 -5
  324. package/dist/shared/@ai-setting/{roy-agent-core-rcfewbzr.js → roy-agent-core-4sx6sdb2.js} +1 -1
  325. package/dist/shared/@ai-setting/{roy-agent-core-ezgsem94.js → roy-agent-core-ph5qbqcx.js} +1 -1
  326. package/dist/util/process/process-tree-killer.d.ts +67 -0
  327. package/dist/utils/id.d.ts +11 -0
  328. package/dist/utils/loose-json.d.ts +30 -0
  329. package/dist/utils/media.d.ts +70 -0
  330. package/dist/utils/temp-file-manager/index.d.ts +99 -0
  331. package/package.json +4 -2
  332. /package/dist/shared/@ai-setting/{roy-agent-core-s214vmmd.js → roy-agent-core-4vpk40ss.js} +0 -0
  333. /package/dist/shared/@ai-setting/{roy-agent-core-pkpkctvf.js → roy-agent-core-hch2geta.js} +0 -0
  334. /package/dist/shared/@ai-setting/{roy-agent-core-0cfaqnz9.js → roy-agent-core-k25gv86p.js} +0 -0
@@ -0,0 +1,503 @@
1
+ /**
2
+ * @fileoverview AgentComponent Types
3
+ *
4
+ * 基于 roy-agent docs/agent-component-design.md
5
+ *
6
+ * 注意:Tool 相关类型从 ToolComponent 复用,保持统一
7
+ */
8
+ import type { ModelMessage } from "ai";
9
+ import type { Tool, ToolResult } from "../tool/types";
10
+ import type { LLMOutput } from "../llm/types";
11
+ type AbortSignalType = AbortSignal;
12
+ export { Tool, ToolResult };
13
+ export interface ProjectSummary {
14
+ projectPath: string;
15
+ projectName: string;
16
+ lastUpdated: number;
17
+ summary: string;
18
+ shortSummary: string;
19
+ draftCount: number;
20
+ memoryMdPath: string;
21
+ draftsDir: string;
22
+ detailsDir: string;
23
+ }
24
+ /**
25
+ * Agent 执行上下文
26
+ */
27
+ export interface AgentContext {
28
+ /** 会话 ID */
29
+ sessionId?: string;
30
+ /** 消息 ID */
31
+ messageId?: string;
32
+ /** Trace ID(每次 query 唯一,用于 per-query 去重和追踪) */
33
+ traceId?: string;
34
+ /** 中断信号 */
35
+ abort?: AbortSignalType;
36
+ /** 额外的上下文信息(会添加到 system prompt) */
37
+ additionInfo?: string;
38
+ /** 元数据 */
39
+ metadata?: Record<string, unknown>;
40
+ /** Agent 类型(用于选择 Behavior Spec) */
41
+ agentType?: string;
42
+ /** 使用的模型 */
43
+ model?: string;
44
+ /** 允许的工具列表(上下文级别,会覆盖 agent 配置) */
45
+ allowedTools?: string[];
46
+ /** 拒绝的工具列表(上下文级别,会覆盖 agent 配置) */
47
+ deniedTools?: string[];
48
+ /** 是否过滤 history 中的 tool 消息(上下文级别,会覆盖 agent 配置) */
49
+ filterHistory?: boolean;
50
+ /**
51
+ * Task #2590 follow-up — caller-provided run id.
52
+ *
53
+ * If provided, the agent run uses this id instead of an internally generated
54
+ * one (AgentComponent.runCounter). The caller is responsible for ensuring
55
+ * the id is unique within the AgentComponent instance and stable for the
56
+ * lifetime of the run. Run id is used to key `aborted` / `abortControllers`
57
+ * maps inside AgentComponent, so callers wanting run-scoped abort
58
+ * (e.g. BackgroundTaskManager.executeWithAbort) should pre-allocate an id
59
+ * and pass it in. This eliminates the need for an onRunStarted callback
60
+ * and lets the caller record (runId, taskRecord) BEFORE the run actually
61
+ * starts.
62
+ *
63
+ * Validation:
64
+ * - Must not be empty / whitespace-only (AgentComponent._run rejects explicitly)
65
+ * - Must not already be in `aborted` / `abortControllers` Maps
66
+ *
67
+ * If not provided, AgentComponent allocates a new id from its internal
68
+ * `runCounter` (preserves backward compatibility with existing callers).
69
+ */
70
+ runId?: string;
71
+ /**
72
+ * Issue #1694 Layer 1: override message history for this run.
73
+ *
74
+ * RESERVED FOR FUTURE USE: When provided (non-empty), AgentComponent._run()
75
+ * will use this array INSTEAD of loading history from the session DB.
76
+ *
77
+ * Current callers (as of Task #1694 commit c6c10707):
78
+ * - workflow-json-output-plugin does NOT yet pass `messages`
79
+ * - json-extract sub-agent still reads session DB history
80
+ *
81
+ * Future use cases:
82
+ * - Caller wants to inject SANITIZED history (strip main agent pollution)
83
+ * - Caller wants to inject SYNTHETIC history (e.g., for testing)
84
+ * - Caller wants to share history across multiple sub-agent runs
85
+ *
86
+ * Behavior when set:
87
+ * - effectiveContext.messages.length > 0 → use as hookCtx.messages
88
+ * - effectiveContext.messages is undefined or empty → fallback to session DB
89
+ *
90
+ * Only ModelMessage[] is accepted (matches the format the LLM expects).
91
+ * The first message, if any, MAY be a system message.
92
+ */
93
+ messages?: ModelMessage[];
94
+ /**
95
+ * Issue #1694 root-cause fix: Force LLM to call a specific tool (or any
96
+ * tool) when this context is used.
97
+ *
98
+ * - `"required"` — force LLM to call at least one tool
99
+ * - `{ type: "function", function: { name: "..." } }` — force a specific tool
100
+ * - undefined / "auto" — let LLM choose (default)
101
+ *
102
+ * Primary use case: workflow-json-output-plugin forces json-extract
103
+ * sub-agent to call `workflow_submit_output`, eliminating the
104
+ * non-deterministic failure where sub-agent sees the parent's markdown
105
+ * JSON output and decides "already done" (finishReason=stop, no tool call).
106
+ *
107
+ * Propagated by AgentComponent.invokeLLM to llmComponent.invoke, then to
108
+ * AI SDK streamText's `toolChoice`.
109
+ */
110
+ toolChoice?: "auto" | "none" | "required" | {
111
+ type: "function";
112
+ function: {
113
+ name: string;
114
+ };
115
+ };
116
+ /** 处理事件的 agent 名称(EventSource 指定) */
117
+ agentName?: string;
118
+ /** 启用的插件列表(EventSource 指定) */
119
+ plugins?: string[];
120
+ /** 关联的 EnvEvent(EventSource 事件) */
121
+ envEvent?: import("../types").EnvEvent;
122
+ /** Plugin 启用标记 { "sourceId:pluginName": true } */
123
+ pluginEnabled?: Record<string, boolean>;
124
+ /** 额外工具列表(上下文级别,会追加到可用工具列表末尾) */
125
+ extraTools?: import("../tool/types").Tool[];
126
+ /** 是否将 ReAct 消息持久化到 session DB(默认 true)。
127
+ * 设为 false 时,agent run 仍会读取 session history,但不会写入新消息。
128
+ * 用于子 agent 复用父 session 的 history 但不污染 session DB。 */
129
+ persistSession?: boolean;
130
+ }
131
+ /**
132
+ * 工具调用(内部使用)
133
+ */
134
+ export interface ToolCall {
135
+ /** 调用 ID */
136
+ id: string;
137
+ /** 工具名称 */
138
+ name: string;
139
+ /** 调用参数 */
140
+ arguments: Record<string, unknown>;
141
+ }
142
+ /**
143
+ * 工具调用结果
144
+ */
145
+ export interface ToolCallResult {
146
+ /** 调用 ID */
147
+ id: string;
148
+ /** 工具名称 */
149
+ name: string;
150
+ /** 调用结果 */
151
+ result: ToolResult;
152
+ /** 是否成功 */
153
+ success: boolean;
154
+ }
155
+ /**
156
+ * Hook 点枚举(带 component 前缀)
157
+ */
158
+ export type HookPoint = "agent:before.start" | "agent:before.llm" | "agent:after.llm" | "agent:before.tool" | "agent:after.tool" | "agent:on.iteration" | "agent:on.threshold" | "agent:after.complete" | "agent:on.error" | "agent:after.react" | "on.error";
159
+ /**
160
+ * Context data for agent:after.react hook
161
+ */
162
+ export interface AgentReactContext {
163
+ /** Current messages for memory extraction */
164
+ messages: ModelMessage[];
165
+ /** Current session ID */
166
+ sessionId?: string;
167
+ /** Execution summary */
168
+ summary?: string;
169
+ }
170
+ /**
171
+ * Hook 上下文(Agent 特有版本)
172
+ *
173
+ * 注意:这是 AgentComponent 使用的 HookContext 扩展版本
174
+ * 包含 iteration, maxIterations, messages 等 Agent 特有字段
175
+ */
176
+ export interface HookContext {
177
+ /** 当前 LLM 输出(after.llm hook 可用) */
178
+ llmOutput?: AgentLLMOutput;
179
+ /** 当前工具调用(before.tool/after.tool hook 可用) */
180
+ currentToolCall?: ToolCall;
181
+ /** 工具执行结果(after.tool hook 可用) */
182
+ toolResult?: ToolCallResult;
183
+ /** 阈值信息(on.threshold hook 可用) */
184
+ threshold?: {
185
+ type: "tokens" | "turns" | "iterations" | "custom";
186
+ value: number;
187
+ limit?: number;
188
+ };
189
+ /** 当前错误(on.error hook 可用) */
190
+ error?: Error;
191
+ /** 当前 Agent 实例 */
192
+ agent: AgentInstance;
193
+ /** 当前迭代次数(可修改) */
194
+ iteration: number;
195
+ /** 最大迭代次数限制(before.llm hook 可用) */
196
+ maxIterations: number;
197
+ /** 消息列表(可直接修改) */
198
+ messages: ModelMessage[];
199
+ /** 可用工具列表(可直接修改) */
200
+ tools: Tool[];
201
+ /** 当前 system prompt(可直接修改) */
202
+ systemPrompt: string;
203
+ /** 额外的上下文信息(可直接修改) */
204
+ additionInfo?: string;
205
+ /**
206
+ * Task #2744: session-scope cache snapshot (internal use)
207
+ *
208
+ * 持久化在 session.metadata.cacheSnapshot,由 AgentComponent._run 在 first-run
209
+ * 创建并透传给 buildMessages。buildMessages 使用 snapshot 的 additionInfo(而非
210
+ * 每轮重读 ctx.context.additionInfo)以保证 system prompt 字节级一致 → LLM
211
+ * prompt cache 命中。
212
+ *
213
+ * - systemPrompt: 含 {{memory}} 替换后的最终字符串
214
+ * - additionInfo: first-run 时的 additionInfo(冻结)
215
+ * - snapshotAt: 持久化时间戳
216
+ *
217
+ * 第三方代码不应直接修改此字段。如需强制重建 snapshot,可通过
218
+ * sessionComponent.update(sessionId, { metadata: { cacheSnapshot: null } }) 清除。
219
+ */
220
+ _cacheSnapshot?: {
221
+ systemPrompt: string;
222
+ additionInfo: string;
223
+ snapshotAt: number;
224
+ };
225
+ /** 执行上下文(可直接修改属性) */
226
+ context: AgentContext;
227
+ /** 是否已停止 */
228
+ _stopped?: boolean;
229
+ /** 停止原因 */
230
+ _stopReason?: string;
231
+ /** 待执行的干预动作 */
232
+ _pendingAction?: {
233
+ type: HookActionType;
234
+ payload?: unknown;
235
+ };
236
+ /** 错误列表 */
237
+ _errors?: Array<{
238
+ plugin: string;
239
+ error: string;
240
+ }>;
241
+ /** Structured JSON extracted by workflow plugin after ReAct (agent:after.react) */
242
+ structuredOutputExtracted?: Record<string, unknown>;
243
+ /** Project Memory Agent 生成的摘要列表(由 Project Agent 写入,Global Agent 读取) */
244
+ projectSummaries?: ProjectSummary[];
245
+ }
246
+ /**
247
+ * Hook 干预动作
248
+ */
249
+ export type HookActionType = "stop" | "retry" | "compress" | "extract_memory" | "inject_message" | "skip_tool";
250
+ /**
251
+ * Hook 返回结果
252
+ */
253
+ export interface HookResult {
254
+ /** 是否继续执行(false = 停止 Agent) */
255
+ continue: boolean;
256
+ /** 干预动作(可选) */
257
+ action?: {
258
+ type: HookActionType;
259
+ payload?: unknown;
260
+ };
261
+ }
262
+ /**
263
+ * Plugin 定义
264
+ */
265
+ export interface Plugin {
266
+ /** Plugin 唯一名称 */
267
+ name: string;
268
+ /** Plugin 版本 */
269
+ version: string;
270
+ /** Plugin 描述 */
271
+ description?: string;
272
+ /** 订阅的 Hook 点及优先级 */
273
+ hooks: Array<{
274
+ point: HookPoint;
275
+ /** 优先级,默认 0,数字越大越先执行 */
276
+ priority?: number;
277
+ }>;
278
+ /** 执行函数 */
279
+ execute: (ctx: HookContext) => HookResult | Promise<HookResult>;
280
+ }
281
+ /**
282
+ * Agent 类型
283
+ */
284
+ export type AgentType = "primary" | "sub" | "summary";
285
+ /**
286
+ * Agent 状态
287
+ */
288
+ export type AgentStatus = "idle" | "running" | "paused" | "stopped" | "error";
289
+ /**
290
+ * Agent 实例配置
291
+ */
292
+ export interface AgentInstanceConfig {
293
+ /** Agent 类型 */
294
+ type: AgentType;
295
+ /** Agent 名称 */
296
+ name?: string;
297
+ /** System Prompt */
298
+ systemPrompt?: string;
299
+ /** System Prompt 引用(指向 PromptComponent 中的 prompt) */
300
+ systemPromptRef?: string;
301
+ /** Behavior Spec ID */
302
+ behaviorSpecId?: string;
303
+ /** 使用的模型 */
304
+ model?: string;
305
+ /** 最大迭代次数 */
306
+ maxIterations?: number;
307
+ /** 最大错误重试次数 */
308
+ maxErrorRetries?: number;
309
+ /** 死循环检测阈值 */
310
+ doomLoopThreshold?: number;
311
+ /** 允许的工具列表 */
312
+ allowedTools?: string[];
313
+ /** 拒绝的工具列表 */
314
+ deniedTools?: string[];
315
+ /** 工具超时(毫秒) */
316
+ toolTimeout?: number;
317
+ /** 工具重试次数 */
318
+ toolRetries?: number;
319
+ /** 是否过滤 history 中的 tool 消息(默认过滤,避免上下文过长) */
320
+ filterHistory?: boolean;
321
+ }
322
+ /**
323
+ * Agent 实例
324
+ */
325
+ export interface AgentInstance {
326
+ /** Agent 名称 */
327
+ name: string;
328
+ /** Agent 配置 */
329
+ config: Required<AgentInstanceConfig>;
330
+ /** 当前状态 */
331
+ status: AgentStatus;
332
+ /** 注册的 Plugins */
333
+ plugins: Map<string, Plugin>;
334
+ }
335
+ /**
336
+ * Agent 执行结果
337
+ */
338
+ export interface AgentRunResult {
339
+ /** 最终文本响应 */
340
+ finalText?: string;
341
+ /** 是否被 hook 停止 */
342
+ stopped?: boolean;
343
+ /** 停止原因 */
344
+ stopReason?: string;
345
+ /** 执行的迭代次数 */
346
+ iterations: number;
347
+ /** 工具调用列表 */
348
+ toolCalls: ToolCall[];
349
+ /** 错误信息(如有) */
350
+ error?: string;
351
+ /** 原始错误对象(用于保留 ContextError 等类型信息) */
352
+ originalError?: Error;
353
+ /** Structured JSON output (populated by workflow plugin after ReAct) */
354
+ structuredOutput?: Record<string, unknown>;
355
+ }
356
+ /**
357
+ * LLM 调用结果
358
+ *
359
+ * 复用 LLMComponent 的 LLMOutput,并扩展 Agent 特有字段
360
+ */
361
+ export interface LLMCallResult {
362
+ /** 成功 */
363
+ success: boolean;
364
+ /** 输出 */
365
+ output?: LLMOutput;
366
+ /** 错误信息 */
367
+ error?: string;
368
+ /** Usage 信息 */
369
+ usage?: {
370
+ promptTokens: number;
371
+ completionTokens: number;
372
+ totalTokens: number;
373
+ };
374
+ }
375
+ /**
376
+ * Agent 内部使用的 LLM 输出
377
+ * 独立定义以避免与 LLMOutput 的类型冲突
378
+ */
379
+ export interface AgentLLMOutput {
380
+ /** 生成的内容 */
381
+ content: string;
382
+ /** 完成原因 */
383
+ finishReason: "stop" | "length" | "content-filter" | "tool-calls" | "function-call";
384
+ /** 工具调用(兼容格式) */
385
+ toolCalls?: Array<{
386
+ id: string;
387
+ function?: {
388
+ name: string;
389
+ arguments: string;
390
+ };
391
+ name?: string;
392
+ arguments?: string;
393
+ }>;
394
+ /** Usage 信息 */
395
+ usage?: {
396
+ promptTokens: number;
397
+ completionTokens: number;
398
+ totalTokens: number;
399
+ };
400
+ /** 生成模型 */
401
+ model?: string;
402
+ /** 推理内容(思考过程) */
403
+ reasoning?: string;
404
+ }
405
+ /**
406
+ * Summary Agent 配置
407
+ *
408
+ * 专门用于生成 session checkpoint 的 Agent
409
+ */
410
+ export interface SummaryAgentConfig extends AgentInstanceConfig {
411
+ /** Agent 类型 */
412
+ type: "summary";
413
+ /** 使用的 prompt */
414
+ promptName: "session/compact";
415
+ /** 默认模型 */
416
+ model?: string;
417
+ /** 最大迭代次数(summary 任务只需 1 次) */
418
+ maxIterations: 1;
419
+ }
420
+ /**
421
+ * Summary Agent 运行选项
422
+ */
423
+ export interface SummaryAgentRunOptions {
424
+ /** 消息列表 */
425
+ messages: Array<{
426
+ role: string;
427
+ content: string;
428
+ }>;
429
+ /** 用户提供的上下文/提示 */
430
+ userContext?: string;
431
+ /** 期望的输出格式 */
432
+ outputFormat: "json";
433
+ /**
434
+ * 场景化提示 (Scenario Hint)
435
+ *
436
+ * 用于指导 checkpoint 生成的重点方向。
437
+ * 当提供此参数时,会在系统提示中添加场景上下文,
438
+ * 帮助 LLM 生成更符合当前场景的 checkpoint。
439
+ */
440
+ scenarioHint?: string;
441
+ }
442
+ /**
443
+ * Summary Agent 运行结果
444
+ */
445
+ export interface SummaryAgentResult {
446
+ /** Checkpoint 标题 */
447
+ title: string;
448
+ /** 过程要点 */
449
+ processKeyPoints: string[];
450
+ /** 当前状态 */
451
+ currentState: string;
452
+ /** 后续待跟进 */
453
+ nextSteps: string[];
454
+ /** 用户意图列表 - 从对话中提取的用户相关意图 */
455
+ userIntents: string[];
456
+ /** 原始 LLM 响应 */
457
+ rawResponse?: string;
458
+ }
459
+ /**
460
+ * Compact Hint 生成选项
461
+ *
462
+ * 用于两阶段自动压缩流程中的第一阶段:
463
+ * 根据会话历史生成场景化的压缩提示
464
+ */
465
+ export interface CompactHintGenerationOptions {
466
+ /** 消息列表 */
467
+ messages: Array<{
468
+ role: string;
469
+ content: string;
470
+ }>;
471
+ /**
472
+ * 会话上下文信息(可选)
473
+ *
474
+ * 包含会话相关的额外信息,如:
475
+ * - 当前活跃任务信息
476
+ * - 工作目录
477
+ * - 最近的操作记录等
478
+ */
479
+ sessionContext?: {
480
+ activeTaskId?: string;
481
+ activeTaskTitle?: string;
482
+ workingDirectory?: string;
483
+ recentActions?: string[];
484
+ };
485
+ }
486
+ /**
487
+ * Compact Hint 生成结果
488
+ */
489
+ export interface CompactHintGenerationResult {
490
+ /**
491
+ * 场景化压缩指导提示(自然语言)
492
+ *
493
+ * 这是一段"压缩指导 Prompt",用于告诉 Compact 阶段:
494
+ * "在当前这个场景/目标/任务下,生成 checkpoint 时应该重点关注什么"
495
+ *
496
+ * 示例:
497
+ * "Feature development. User is implementing JWT authentication for auth-service.
498
+ * Focus on: auth flow decisions, token refresh progress, middleware implementation."
499
+ */
500
+ hint: string;
501
+ /** 原始 LLM 响应 */
502
+ rawResponse?: string;
503
+ }
@@ -0,0 +1,97 @@
1
+ /**
2
+ * @fileoverview CommandsComponent
3
+ *
4
+ * 命令管理核心组件(收藏式)
5
+ *
6
+ * 功能:
7
+ * - 管理 user/project 多路径命令目录
8
+ * - 提供命令发现、添加、移除、执行能力
9
+ * - 支持 File/Env/Object 三种配置来源
10
+ */
11
+ import { BaseComponent, type ComponentConfig } from "../component";
12
+ import type { CommandIndex, CommandMeta, ScanResult, DiscoverOptions, AddCommandOptions, RemoveCommandOptions, ExecutionResult } from "./types";
13
+ export declare class CommandsComponent extends BaseComponent {
14
+ readonly name = "commands";
15
+ readonly version = "2.0.0";
16
+ private config?;
17
+ private configComponent?;
18
+ private userCommandsDir;
19
+ private projectCommandsDir;
20
+ private descriptionCache;
21
+ private descriptionCacheFile;
22
+ constructor();
23
+ private initDefaultDirs;
24
+ /**
25
+ * 初始化组件
26
+ *
27
+ * 配置加载顺序(优先级从低到高):
28
+ * 1. File - 配置文件
29
+ * 2. Env - 环境变量
30
+ * 3. Object - 直接传入的 config 对象
31
+ */
32
+ init(config?: ComponentConfig): Promise<void>;
33
+ /**
34
+ * 注册配置到 ConfigComponent
35
+ *
36
+ * 使用 SessionComponent 的正确模式:
37
+ * 1. 使用 registerComponent() 注册配置(包含 sources、keys、defaults)
38
+ * 2. 使用 load("command") 加载配置值
39
+ * 3. 处理环境变量后备方案
40
+ * 4. 处理 config 对象(最高优先级)
41
+ */
42
+ private registerConfig;
43
+ /**
44
+ * 将嵌套配置扁平化
45
+ */
46
+ private flattenConfig;
47
+ /**
48
+ * 从 ConfigComponent 应用配置
49
+ */
50
+ private applyConfig;
51
+ start(): Promise<void>;
52
+ stop(): Promise<void>;
53
+ /**
54
+ * 获取命令目录列表
55
+ */
56
+ getCommandDirs(): Promise<{
57
+ user: string;
58
+ project: string;
59
+ }>;
60
+ /**
61
+ * 发现命令
62
+ */
63
+ discover(options?: DiscoverOptions): Promise<ScanResult>;
64
+ /**
65
+ * 添加命令
66
+ */
67
+ add(options: AddCommandOptions): Promise<void>;
68
+ /**
69
+ * 创建命令的 meta.md 文件
70
+ */
71
+ private createCommandMeta;
72
+ /**
73
+ * 获取所有收藏命令的元信息(用于 Prompt 注入)
74
+ */
75
+ getCommandsMeta(): Promise<CommandMeta[]>;
76
+ /**
77
+ * 移除命令
78
+ */
79
+ remove(options: RemoveCommandOptions): Promise<void>;
80
+ /**
81
+ * 获取命令信息
82
+ */
83
+ getInfo(name: string): Promise<CommandIndex | null>;
84
+ /**
85
+ * 执行命令
86
+ */
87
+ exec(options: {
88
+ name: string;
89
+ args?: string[];
90
+ cwd?: string;
91
+ }): Promise<ExecutionResult>;
92
+ private scanDir;
93
+ private matchPattern;
94
+ private getDescription;
95
+ private loadDescriptionCache;
96
+ private saveDescriptionCache;
97
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @fileoverview Commands Component 配置注册
3
+ *
4
+ * 使用 ConfigComponent.registerComponent() 机制统一管理配置
5
+ */
6
+ import type { ComponentRegistration } from "../../config/config-component";
7
+ /**
8
+ * Commands Component 默认配置值(占位,实际值在 registerConfig 中动态设置)
9
+ *
10
+ * 注意:这些默认值在 CommandsComponent.registerConfig() 中
11
+ * 通过 configComponent.set() 设置到 ConfigComponent,使用基于 HOME 的绝对路径
12
+ */
13
+ export declare const COMMANDS_DEFAULTS: Record<string, unknown>;
14
+ /**
15
+ * Commands Component 配置注册常量
16
+ *
17
+ * 定义了所有 Commands 相关的配置项和来源
18
+ */
19
+ export declare const COMMANDS_CONFIG_REGISTRATION: ComponentRegistration;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @fileoverview Commands Component Module
3
+ *
4
+ * 导出 CommandsComponent 及其类型
5
+ */
6
+ export { CommandsComponent } from "./commands-component";
7
+ export type { CommandsComponentOptions, CommandsComponentConfig, CommandSource, CommandIndex, ScanResult, DiscoverOptions, AddCommandOptions, RemoveCommandOptions, ExecutionResult, } from "./types";
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @fileoverview Command Meta.md Parser
3
+ *
4
+ * 解析命令目录下的 meta.md 文件,提取 Frontmatter 元信息
5
+ */
6
+ import type { CommandMeta, CommandSource } from "./types";
7
+ /**
8
+ * 解析 frontmatter 文本
9
+ */
10
+ export declare function parseFrontmatter(text: string): Record<string, string>;
11
+ /**
12
+ * 解析单个 meta.md 文件
13
+ */
14
+ export declare function parseMetaFile(filePath: string, source: CommandSource): Promise<CommandMeta | null>;
15
+ /**
16
+ * 扫描目录下的所有 meta.md 文件
17
+ */
18
+ export declare function scanMetaFiles(dirPath: string, source: CommandSource): Promise<CommandMeta[]>;