@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,19 @@
1
+ /**
2
+ * @fileoverview MCP Component 配置注册
3
+ *
4
+ * 使用 ConfigComponent.registerComponent() 机制统一管理配置
5
+ */
6
+ import type { ComponentRegistration } from "../../config/config-component";
7
+ /**
8
+ * MCP Component 默认配置值
9
+ *
10
+ * 注意:这些默认值需要在 McpComponent.registerConfig() 中
11
+ * 通过 configComponent.set() 设置到 ConfigComponent
12
+ */
13
+ export declare const MCP_DEFAULTS: Record<string, unknown>;
14
+ /**
15
+ * MCP Component 配置注册常量
16
+ *
17
+ * 定义了所有 MCP 相关的配置项和来源
18
+ */
19
+ export declare const MCP_CONFIG_REGISTRATION: ComponentRegistration;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Shared npm prefix resolution for MCP and LSP tooling.
3
+ *
4
+ * Cursor remote environments often set npm prefix to a path without lib/.
5
+ */
6
+ export declare function getFallbackNpmPrefixPath(): string;
7
+ /** Prefix is usable when either lib/ or bin/ exists (some installs only have bin). */
8
+ export declare function isUsableNpmPrefix(prefix: string): boolean;
9
+ export declare function ensureNpmPrefixDirs(prefix: string): void;
10
+ export declare function ensureFallbackNpmPrefix(): string;
11
+ export declare function readNpmConfigPrefix(): string | undefined;
12
+ /**
13
+ * Return a writable npm prefix, creating the roy-agent fallback when needed.
14
+ */
15
+ export declare function resolveNpmPrefix(): string;
16
+ export declare function resolveGlobalNodeModulesPath(): string;
17
+ export declare function resolveGlobalBinPath(): string;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * @fileoverview MCP 服务器路径扫描器
3
+ *
4
+ * 扫描 mcpPaths 目录,发现所有 MCP 服务器
5
+ * 每个子目录视为一个 MCP 服务器
6
+ */
7
+ import type { McpPath } from "./config";
8
+ import type { DiscoveredMcpServer } from "./types";
9
+ /**
10
+ * MCP 服务器扫描器
11
+ *
12
+ * 扫描多个路径下的 MCP 服务器子目录
13
+ */
14
+ export declare class McpScanner {
15
+ private mcpPaths;
16
+ private serversMap;
17
+ constructor(mcpPaths: McpPath[]);
18
+ /**
19
+ * 扫描所有 mcpPaths
20
+ */
21
+ scan(): Promise<Map<string, DiscoveredMcpServer>>;
22
+ /**
23
+ * 扫描单个路径
24
+ */
25
+ private scanPath;
26
+ /**
27
+ * 发现单个 MCP 服务器
28
+ */
29
+ private discoverServer;
30
+ /**
31
+ * 查找入口脚本
32
+ */
33
+ private findEntryScript;
34
+ /**
35
+ * 获取扫描结果
36
+ */
37
+ getServers(): Map<string, DiscoveredMcpServer>;
38
+ }
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @fileoverview MCP Tool 适配器
3
+ *
4
+ * 将 MCP 工具转换为 Environment Tool
5
+ * 完整保留参数描述等信息,供 LLM 正确调用
6
+ */
7
+ import { z } from "zod";
8
+ import type { Tool as McpTool } from "@modelcontextprotocol/sdk/types.js";
9
+ import type { Client } from "@modelcontextprotocol/sdk/client/index.js";
10
+ import type { ToolInfo } from "../../tool/types";
11
+ /**
12
+ * 将 MCP 工具转换为 Environment Tool
13
+ *
14
+ * 命名策略: mcp_{serverName}_{toolName}
15
+ */
16
+ export declare function adaptMcpTool(mcpTool: McpTool, mcpClient: Client, serverName: string): ToolInfo;
17
+ /**
18
+ * 转换 MCP inputSchema 为 Zod schema
19
+ *
20
+ * 关键:保留参数描述,让 LLM 知道每个参数的用途
21
+ */
22
+ export declare function convertInputSchemaToZod(inputSchema: McpTool["inputSchema"]): z.ZodType<unknown>;
23
+ /**
24
+ * 创建 MCP 工具描述
25
+ */
26
+ export declare function createMcpToolsDescription(tools: ToolInfo[]): string;
27
+ /**
28
+ * 获取工具的完整参数描述(供 LLM 使用)
29
+ *
30
+ * 从 Zod schema 中提取参数描述
31
+ */
32
+ export declare function getToolParamDescriptions(tool: ToolInfo): Record<string, string>;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @fileoverview MCP Tool 适配器导出
3
+ */
4
+ export { adaptMcpTool, convertInputSchemaToZod, createMcpToolsDescription } from "./adapter";
@@ -0,0 +1,131 @@
1
+ /**
2
+ * @fileoverview MCP 类型定义
3
+ */
4
+ import { z } from "zod";
5
+ /**
6
+ * Local MCP Server 配置(stdio 传输)
7
+ */
8
+ export declare const McpServerLocalConfigSchema: z.ZodObject<{
9
+ type: z.ZodLiteral<"local">;
10
+ command: z.ZodArray<z.ZodString, "many">;
11
+ /** Working directory for the MCP server process */
12
+ cwd: z.ZodOptional<z.ZodString>;
13
+ environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
14
+ enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
15
+ timeout: z.ZodOptional<z.ZodNumber>;
16
+ }, "strip", z.ZodTypeAny, {
17
+ type: "local";
18
+ enabled: boolean;
19
+ command: string[];
20
+ timeout?: number | undefined;
21
+ cwd?: string | undefined;
22
+ environment?: Record<string, string> | undefined;
23
+ }, {
24
+ type: "local";
25
+ command: string[];
26
+ enabled?: boolean | undefined;
27
+ timeout?: number | undefined;
28
+ cwd?: string | undefined;
29
+ environment?: Record<string, string> | undefined;
30
+ }>;
31
+ export type McpServerLocalConfig = z.infer<typeof McpServerLocalConfigSchema>;
32
+ /**
33
+ * Remote MCP Server 配置(HTTP 传输)
34
+ */
35
+ export declare const McpServerRemoteConfigSchema: z.ZodObject<{
36
+ type: z.ZodLiteral<"remote">;
37
+ url: z.ZodString;
38
+ enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
39
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
40
+ timeout: z.ZodOptional<z.ZodNumber>;
41
+ }, "strip", z.ZodTypeAny, {
42
+ type: "remote";
43
+ enabled: boolean;
44
+ url: string;
45
+ timeout?: number | undefined;
46
+ headers?: Record<string, string> | undefined;
47
+ }, {
48
+ type: "remote";
49
+ url: string;
50
+ enabled?: boolean | undefined;
51
+ timeout?: number | undefined;
52
+ headers?: Record<string, string> | undefined;
53
+ }>;
54
+ export type McpServerRemoteConfig = z.infer<typeof McpServerRemoteConfigSchema>;
55
+ /**
56
+ * MCP Server 配置(联合类型)
57
+ */
58
+ export declare const McpServerConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
59
+ type: z.ZodLiteral<"local">;
60
+ command: z.ZodArray<z.ZodString, "many">;
61
+ /** Working directory for the MCP server process */
62
+ cwd: z.ZodOptional<z.ZodString>;
63
+ environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
64
+ enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
65
+ timeout: z.ZodOptional<z.ZodNumber>;
66
+ }, "strip", z.ZodTypeAny, {
67
+ type: "local";
68
+ enabled: boolean;
69
+ command: string[];
70
+ timeout?: number | undefined;
71
+ cwd?: string | undefined;
72
+ environment?: Record<string, string> | undefined;
73
+ }, {
74
+ type: "local";
75
+ command: string[];
76
+ enabled?: boolean | undefined;
77
+ timeout?: number | undefined;
78
+ cwd?: string | undefined;
79
+ environment?: Record<string, string> | undefined;
80
+ }>, z.ZodObject<{
81
+ type: z.ZodLiteral<"remote">;
82
+ url: z.ZodString;
83
+ enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
84
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
85
+ timeout: z.ZodOptional<z.ZodNumber>;
86
+ }, "strip", z.ZodTypeAny, {
87
+ type: "remote";
88
+ enabled: boolean;
89
+ url: string;
90
+ timeout?: number | undefined;
91
+ headers?: Record<string, string> | undefined;
92
+ }, {
93
+ type: "remote";
94
+ url: string;
95
+ enabled?: boolean | undefined;
96
+ timeout?: number | undefined;
97
+ headers?: Record<string, string> | undefined;
98
+ }>]>;
99
+ export type McpServerConfig = z.infer<typeof McpServerConfigSchema>;
100
+ /**
101
+ * 扫描发现的 MCP 服务器信息
102
+ */
103
+ export interface DiscoveredMcpServer {
104
+ /** 服务器名称(目录名) */
105
+ name: string;
106
+ /** MCP 服务器根目录 */
107
+ serverDir?: string;
108
+ /** 入口脚本路径 */
109
+ entryPath?: string;
110
+ /** 配置文件路径 */
111
+ configPath?: string;
112
+ /** package.json 路径 */
113
+ packagePath?: string;
114
+ /** 目录中的配置 */
115
+ directoryConfig?: Record<string, unknown>;
116
+ /** 解析后的默认命令(兼容不同路径) */
117
+ defaultCommand?: string[];
118
+ }
119
+ /**
120
+ * MCP 服务器状态
121
+ */
122
+ export interface McpServerStatus {
123
+ /** 服务器名称 */
124
+ name: string;
125
+ /** 连接状态 */
126
+ status: "connecting" | "connected" | "disconnected" | "error";
127
+ /** 错误信息 */
128
+ error?: string;
129
+ /** 工具数量 */
130
+ toolsCount?: number;
131
+ }
@@ -0,0 +1,41 @@
1
+ /**
2
+ * @fileoverview Memory Built-in Tools Index
3
+ *
4
+ * 简化的记忆工具导出
5
+ *
6
+ * 只暴露两个工具:
7
+ * - record_memory: 统一的记忆写入工具
8
+ * - recall_memory: 统一的记忆读取工具
9
+ */
10
+ import type { Tool } from "../../tool/types";
11
+ import type { MemoryPath, RecordMemoryResult } from "../types";
12
+ /**
13
+ * record_memory 工具操作接口
14
+ */
15
+ export interface RecordMemoryOperations {
16
+ (args: {
17
+ scope: "project" | "global";
18
+ mode: "append" | "prepend" | "overwrite" | "delete";
19
+ content?: string;
20
+ title?: string;
21
+ }): Promise<RecordMemoryResult | null>;
22
+ }
23
+ /**
24
+ * recall_memory 工具操作接口
25
+ */
26
+ export interface RecallMemoryOperations {
27
+ (scope?: "project" | "global"): Promise<string>;
28
+ }
29
+ /**
30
+ * MemoryToolConfig
31
+ */
32
+ export interface MemoryToolConfig {
33
+ getMemoryPaths: () => MemoryPath[];
34
+ getMemoryFile: () => string;
35
+ }
36
+ /**
37
+ * 创建所有记忆工具
38
+ */
39
+ export declare function createMemoryTools(recordMemory: RecordMemoryOperations, recallMemory: RecallMemoryOperations, config: MemoryToolConfig): Tool[];
40
+ export { RecordMemorySchema, type RecordMemoryParams } from "./record-memory";
41
+ export { RecallMemorySchema, type RecallMemoryParams } from "./recall-memory";
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @fileoverview recall_memory Tool
3
+ *
4
+ * 统一的记忆读取工具
5
+ */
6
+ import type { Tool } from "../../tool/types";
7
+ import { z } from "zod";
8
+ import type { MemoryPath } from "../types";
9
+ /**
10
+ * recall_memory 工具参数
11
+ */
12
+ export declare const RecallMemorySchema: z.ZodObject<{
13
+ /** 作用域 (可选,不传则读取所有 scope) */
14
+ scope: z.ZodOptional<z.ZodEnum<["project", "global"]>>;
15
+ }, "strip", z.ZodTypeAny, {
16
+ scope?: "project" | "global" | undefined;
17
+ }, {
18
+ scope?: "project" | "global" | undefined;
19
+ }>;
20
+ export type RecallMemoryParams = z.infer<typeof RecallMemorySchema>;
21
+ export interface RecallMemoryOptions {
22
+ scope?: "project" | "global";
23
+ }
24
+ /**
25
+ * 创建 recall_memory 工具
26
+ */
27
+ export declare function createRecallMemoryTool(recallMemory: (scope?: "project" | "global") => Promise<string>, getMemoryPaths: () => MemoryPath[], getMemoryFile: () => string): Tool;
28
+ export { RecallMemorySchema as UnifiedRecallMemorySchema };
29
+ export type { RecallMemoryParams as UnifiedRecallMemoryParams };
@@ -0,0 +1,44 @@
1
+ /**
2
+ * @fileoverview record_memory Tool
3
+ *
4
+ * 统一的记忆记录工具
5
+ */
6
+ import type { Tool } from "../../tool/types";
7
+ import { z } from "zod";
8
+ import type { MemoryPath, RecordMemoryResult } from "../types";
9
+ /**
10
+ * record_memory 工具参数
11
+ */
12
+ export declare const RecordMemorySchema: z.ZodObject<{
13
+ /** 作用域 (必填) */
14
+ scope: z.ZodEnum<["project", "global"]>;
15
+ /** 操作模式 */
16
+ mode: z.ZodEnum<["append", "prepend", "overwrite", "delete"]>;
17
+ /** 记忆内容 (delete 模式不需要) */
18
+ content: z.ZodOptional<z.ZodString>;
19
+ /** 章节标题 (可选,用于生成 ## title 章节) */
20
+ title: z.ZodOptional<z.ZodString>;
21
+ }, "strip", z.ZodTypeAny, {
22
+ scope: "project" | "global";
23
+ mode: "append" | "prepend" | "overwrite" | "delete";
24
+ title?: string | undefined;
25
+ content?: string | undefined;
26
+ }, {
27
+ scope: "project" | "global";
28
+ mode: "append" | "prepend" | "overwrite" | "delete";
29
+ title?: string | undefined;
30
+ content?: string | undefined;
31
+ }>;
32
+ export type RecordMemoryParams = z.infer<typeof RecordMemorySchema>;
33
+ export interface RecordMemoryOptions {
34
+ scope: "project" | "global";
35
+ mode: "append" | "prepend" | "overwrite" | "delete";
36
+ content?: string;
37
+ title?: string;
38
+ }
39
+ /**
40
+ * 创建 record_memory 工具
41
+ */
42
+ export declare function createRecordMemoryTool(recordMemory: (args: RecordMemoryOptions) => Promise<RecordMemoryResult | null>, getMemoryPaths: () => MemoryPath[], getMemoryFile: () => string): Tool;
43
+ export { RecordMemorySchema as UnifiedRecordMemorySchema };
44
+ export type { RecordMemoryParams as UnifiedRecordMemoryParams };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @fileoverview Memory Component Index
3
+ *
4
+ * 导出 Memory 组件及相关类型
5
+ */
6
+ export * from "./types";
7
+ export { DEFAULT_MEMORY_CONFIG, SOURCE_PRIORITY, getSourcePriority } from "./memory-config";
8
+ export { MemoryComponent, type MemoryComponentOptions } from "./memory-component";
9
+ export { RecordMemorySchema, RecallMemorySchema } from "./built-in";
10
+ export * from "./plugin";
@@ -0,0 +1,114 @@
1
+ /**
2
+ * @fileoverview MemoryComponent - Simplified
3
+ *
4
+ * 记忆管理核心组件
5
+ *
6
+ * 简化设计:
7
+ * - 移除 DraftManager、MemoryOrganizer、AccessLog 依赖
8
+ * - 只保留核心的 memory 文件操作
9
+ * - 提供 recallMemory(scope) 方法支持 project/global scope
10
+ */
11
+ import { BaseComponent, type ComponentConfig } from "../component";
12
+ import type { MemoryConfig, MemoryPath, RecordMemoryMode, RecordMemoryResult } from "./types";
13
+ import type { ConfigComponent } from "../../config/config-component";
14
+ /**
15
+ * MemoryComponent 配置选项(通过 options 传递)
16
+ */
17
+ export interface MemoryComponentOptions {
18
+ /** ConfigComponent 实例(必填) */
19
+ configComponent: ConfigComponent;
20
+ /** 配置文件相对路径(可选,基于 XDG_DATA_HOME) */
21
+ configPath?: string;
22
+ /** 环境变量前缀(可选,默认 "MEMORY") */
23
+ envPrefix?: string;
24
+ /** 直接传入的配置对象(可选,优先级最高) */
25
+ config?: Partial<MemoryConfig>;
26
+ }
27
+ /**
28
+ * MemoryComponent - Simplified
29
+ *
30
+ * 简化的记忆管理组件,只负责:
31
+ * - 管理本地文件系统记忆存储
32
+ * - 注册记忆操作工具
33
+ * - 提供目录扫描和缓存
34
+ *
35
+ * 复杂功能已移除:
36
+ * - DraftManager(草稿管理)
37
+ * - MemoryOrganizer(记忆整理)
38
+ * - AccessLog(访问日志)
39
+ */
40
+ export declare class MemoryComponent extends BaseComponent {
41
+ name: string;
42
+ version: string;
43
+ private config;
44
+ private toolComponent?;
45
+ private configComponent?;
46
+ private cache;
47
+ /** 配置变更 watcher 清理函数 */
48
+ private configWatcher?;
49
+ init(config?: ComponentConfig): Promise<void>;
50
+ /**
51
+ * 注册配置到 ConfigComponent
52
+ */
53
+ private registerConfig;
54
+ /**
55
+ * 构建最终配置对象
56
+ */
57
+ private buildConfig;
58
+ /**
59
+ * 将配置对象展平为点号路径
60
+ */
61
+ private flattenConfig;
62
+ /**
63
+ * 注册配置热更新监听
64
+ */
65
+ private registerConfigWatcher;
66
+ /**
67
+ * 处理配置变更
68
+ */
69
+ protected onConfigChange(event: {
70
+ key: string;
71
+ oldValue?: unknown;
72
+ newValue?: unknown;
73
+ }): void;
74
+ start(): Promise<void>;
75
+ stop(): Promise<void>;
76
+ private registerTools;
77
+ /**
78
+ * 获取所有配置的 memory 路径
79
+ */
80
+ getMemoryPaths(): MemoryPath[];
81
+ /**
82
+ * 更新 memory paths
83
+ */
84
+ updateMemoryPaths(paths: MemoryPath[]): void;
85
+ /**
86
+ * 获取记忆文件名
87
+ */
88
+ getMemoryFile(): string;
89
+ /**
90
+ * 记录记忆
91
+ *
92
+ * @param args.mode 操作模式
93
+ * @param args.content 记忆内容
94
+ * @param args.title 标题
95
+ * @param args.filename 文件名
96
+ * @param args.scope 作用域 (project/global),用于选择正确的 memory path
97
+ */
98
+ recordMemory(args: {
99
+ mode: RecordMemoryMode;
100
+ content?: string;
101
+ title?: string;
102
+ filename?: string;
103
+ scope?: "project" | "global";
104
+ }): Promise<RecordMemoryResult | null>;
105
+ /**
106
+ * 回忆记忆 - 读取所有记忆文件内容
107
+ *
108
+ * @param scope 可选:project 或 global,默认读取所有
109
+ */
110
+ recallMemory(scope?: "project" | "global"): Promise<string>;
111
+ private clearCache;
112
+ private getCache;
113
+ private setCache;
114
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @fileoverview Memory Component 配置注册
3
+ *
4
+ * 使用 ConfigComponent.registerComponent() 机制统一管理配置
5
+ */
6
+ import type { ComponentRegistration } from "../../config/config-component";
7
+ /**
8
+ * Memory Component 默认配置值
9
+ *
10
+ * 注意:键使用完整格式(带 "memory." 前缀),在 registerConfig 中手动设置
11
+ */
12
+ export declare const MEMORY_DEFAULTS: Record<string, unknown>;
13
+ /**
14
+ * Memory Component 配置注册常量
15
+ *
16
+ * 定义了所有 Memory 相关的配置项和来源
17
+ */
18
+ export declare const MEMORY_CONFIG_REGISTRATION: ComponentRegistration;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @fileoverview Memory Component Configuration
3
+ *
4
+ * 定义 Memory 组件的默认配置
5
+ */
6
+ import { type MemoryConfig } from "./types";
7
+ /**
8
+ * 默认配置
9
+ */
10
+ export declare const DEFAULT_MEMORY_CONFIG: MemoryConfig;
11
+ /**
12
+ * 优先级映射(后面的优先级更高)
13
+ */
14
+ export declare const SOURCE_PRIORITY: Record<string, number>;
15
+ /**
16
+ * 获取来源优先级
17
+ */
18
+ export declare function getSourcePriority(source: string): number;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @fileoverview Memory Plugin Index - Simplified
3
+ *
4
+ * 简化后的导出 - 只保留核心组件
5
+ *
6
+ * 移除的组件(已被简化设计替代):
7
+ * - DraftManager -> 使用 write_memory tool
8
+ * - MemoryOrganizer -> 使用 recall --extract 命令
9
+ * - AccessLog -> 不再需要
10
+ */
11
+ export type { MemoryPluginConfig, MemoryTask, MemoryTaskType, ExtractMemoryPayload, SessionMessage, MemoryHookContext, } from "./types";
12
+ export { MemoryManager } from "./memory-manager";
13
+ export { MemoryPlugin, createMemoryPlugin } from "./memory-plugin";
14
+ export { recallMemory } from "./recall-memory";
15
+ export type { MemoryScope, ProjectSummary, MemoryAgentInput, MemoryAgentResult, MemoryAgentConfig, } from "./memory-agent";
16
+ export { createMemoryAgent, formatMemoryInput, parseMemoryAgentOutput, createEmptyResult, buildProjectInput, buildGlobalInput, applyMemoryResult, generateProjectSummary, PROJECT_MEMORY_AGENT_PROMPT, GLOBAL_MEMORY_AGENT_PROMPT, } from "./memory-agent";
@@ -0,0 +1,126 @@
1
+ /**
2
+ * @fileoverview Memory Agent 核心逻辑 (Simplified)
3
+ *
4
+ * 简化设计:
5
+ * - 移除 DraftManager(草稿管理已废弃)
6
+ * - 移除 AccessLog(访问日志已废弃)
7
+ * - 只保留核心的 Agent 类型和格式化逻辑
8
+ */
9
+ import type { ModelMessage } from "ai";
10
+ /**
11
+ * Memory 作用域类型
12
+ */
13
+ export type MemoryScope = "project" | "global";
14
+ /**
15
+ * 项目摘要信息
16
+ */
17
+ export interface ProjectSummary {
18
+ /** 项目根目录路径 */
19
+ projectPath: string;
20
+ /** 项目名称 */
21
+ projectName: string;
22
+ /** 最后更新时间戳 */
23
+ lastUpdated: number;
24
+ /** 项目 memory.md 摘要(一段话) */
25
+ summary: string;
26
+ /** 简短摘要(几个词) */
27
+ shortSummary: string;
28
+ /** 项目 memory.md 路径 */
29
+ memoryMdPath: string;
30
+ }
31
+ /**
32
+ * Memory Agent 输入
33
+ */
34
+ export interface MemoryAgentInput {
35
+ /** 作用域 */
36
+ scope: MemoryScope;
37
+ /** 基础目录(project: .roy/memory, global: ~/.config/roy-agent/memory) */
38
+ baseDir: string;
39
+ /** 当前 memory.md 内容 */
40
+ currentMemoryMd: string;
41
+ /** 当前对话消息 */
42
+ messages: ModelMessage[];
43
+ /** 项目摘要列表(仅 global scope 使用) */
44
+ projectSummaries?: ProjectSummary[];
45
+ }
46
+ /**
47
+ * Memory Agent 输出结果
48
+ */
49
+ export interface MemoryAgentResult {
50
+ /** 作用域 */
51
+ scope: MemoryScope;
52
+ /** 新的 memory.md 内容(全文) */
53
+ memoryMdContent: string;
54
+ /** 项目摘要(仅 project scope 输出) */
55
+ projectSummary?: ProjectSummary;
56
+ /** 是否有更新 */
57
+ hasUpdates: boolean;
58
+ }
59
+ /**
60
+ * Memory Agent 配置
61
+ */
62
+ export interface MemoryAgentConfig {
63
+ /** Agent 名称 */
64
+ name: string;
65
+ /** System prompt */
66
+ systemPrompt: string;
67
+ /** 最大迭代次数 */
68
+ maxIterations: number;
69
+ }
70
+ /**
71
+ * Project Memory Agent System Prompt
72
+ */
73
+ export declare const PROJECT_MEMORY_AGENT_PROMPT = "\u4F60\u662F\u9879\u76EE\u7EA7 Memory Agent\uFF0C\u8D1F\u8D23\u6574\u7406\u548C\u66F4\u65B0\u5F53\u524D\u9879\u76EE\u7684\u8BB0\u5FC6\u3002\n\n## \u4F60\u7684\u804C\u8D23\n\n1. **\u4FE1\u606F\u6536\u96C6**\uFF1A\u5728\u63D0\u53D6\u8BB0\u5FC6\u524D\uFF0C\u5148\u6536\u96C6\u9879\u76EE\u4E0A\u4E0B\u6587\u4FE1\u606F\n2. **\u4ECE\u5BF9\u8BDD\u4E2D\u63D0\u53D6\u8BB0\u5FC6**\uFF1A\u5206\u6790 messages\uFF0C\u63D0\u53D6\u4E0E\u9879\u76EE\u76F8\u5173\u7684\u77E5\u8BC6\u3001\u51B3\u7B56\u3001\u89E3\u51B3\u65B9\u6848\n3. **\u751F\u6210 memory.md**\uFF1A\u66F4\u65B0\u9879\u76EE\u8BB0\u5FC6\u7D22\u5F15\n\n## \u4FE1\u606F\u6536\u96C6\u6B65\u9AA4\uFF08\u91CD\u8981\uFF01\uFF09\n\n\u5728\u63D0\u53D6\u8BB0\u5FC6\u4E4B\u524D\uFF0C\u8BF7\u5148\u4F7F\u7528\u53EF\u7528\u5DE5\u5177\u6536\u96C6\u9879\u76EE\u4E0A\u4E0B\u6587\uFF1A\n\n1. **\u9605\u8BFB\u9879\u76EE README**\uFF1A\u4E86\u89E3\u9879\u76EE\u6982\u8FF0\u3001\u529F\u80FD\u3001\u4F7F\u7528\u65B9\u6CD5\n - \u8DEF\u5F84\u793A\u4F8B\uFF1AREADME.md, README.zh-CN.md, docs/README.md\n\n2. **\u68C0\u67E5\u8BBE\u8BA1\u6587\u6863**\uFF1A\u4E86\u89E3\u9879\u76EE\u67B6\u6784\u548C\u8BBE\u8BA1\u51B3\u7B56\n - \u8DEF\u5F84\u793A\u4F8B\uFF1Adocs/design.md, docs/ARCHITECTURE.md, docs/superpowers/specs/*.md\n\n3. **\u67E5\u770B\u4EE3\u7801\u5B9E\u73B0**\uFF1A\u4E86\u89E3\u5173\u952E\u6A21\u5757\u548C\u5B9E\u73B0\u7EC6\u8282\n - \u8DEF\u5F84\u793A\u4F8B\uFF1Asrc/**/*.ts, packages/*/src/**/*.ts\n\n4. **\u56DE\u987E\u73B0\u6709 memory**\uFF1A\u4E86\u89E3\u5DF2\u6709\u7684\u9879\u76EE\u8BB0\u5FC6\n - \u8DEF\u5F84\uFF1A\u5F53\u524D\u76EE\u5F55\u4E0B\u7684 .roy/memory/memory.md\n\n## \u8F93\u5165\u4FE1\u606F\n\n- \u5F53\u524D\u9879\u76EE\u7684 memory.md \u5185\u5BB9\n- \u5F53\u524D\u5BF9\u8BDD\u6D88\u606F\n\n## \u8F93\u51FA\u8981\u6C42\n\n\u8BF7\u4EE5 JSON \u683C\u5F0F\u8F93\u51FA\u7ED3\u679C\uFF0C\u5305\u542B\u4EE5\u4E0B\u5B57\u6BB5\uFF1A\n- memoryMdContent: \u65B0\u7684 memory.md \u5185\u5BB9\n- projectSummary: \u9879\u76EE\u6458\u8981\uFF08\u5305\u542B summary, shortSummary \u7B49\uFF09\n- hasUpdates: \u662F\u5426\u6709\u66F4\u65B0\n\n## \u8BB0\u5FC6\u7EC4\u7EC7\u539F\u5219\n\n- \u4F18\u5148\u8BB0\u5F55\u5177\u4F53\u3001\u53EF\u64CD\u4F5C\u7684\u8BB0\u5FC6\uFF08\u4EE3\u7801\u4F4D\u7F6E\u3001\u914D\u7F6E\u9879\u3001\u547D\u4EE4\uFF09\n- \u907F\u514D\u8FC7\u4E8E\u62BD\u8C61\u6216\u901A\u7528\u7684\u63CF\u8FF0\n- \u8BB0\u5F55\u8BBE\u8BA1\u51B3\u7B56\u53CA\u5176\u7406\u7531";
74
+ /**
75
+ * Global Memory Agent System Prompt
76
+ */
77
+ export declare const GLOBAL_MEMORY_AGENT_PROMPT = "\u4F60\u662F\u5168\u5C40 Memory Agent\uFF0C\u8D1F\u8D23\u6574\u7406\u8DE8\u9879\u76EE\u7684\u901A\u7528\u8BB0\u5FC6\u3002\n\n## \u4F60\u7684\u804C\u8D23\n\n1. **\u805A\u5408\u9879\u76EE\u6458\u8981**\uFF1A\u5206\u6790 projectSummaries\uFF0C\u63D0\u53D6\u5171\u6027\u77E5\u8BC6\n2. **\u7EF4\u62A4\u5168\u5C40\u8BB0\u5FC6**\uFF1A\u66F4\u65B0\u5168\u5C40 memory.md\n3. **\u7EF4\u62A4\u9879\u76EE\u7D22\u5F15**\uFF1A\u5728 memory.md \u4E2D\u7EF4\u62A4\u9879\u76EE\u5217\u8868\n4. **\u63D0\u53D6\u5171\u6027\u7ECF\u9A8C**\uFF1A\u5C06\u9879\u76EE\u7ECF\u9A8C\u63D0\u70BC\u4E3A\u901A\u7528\u6700\u4F73\u5B9E\u8DF5\n\n## \u8F93\u5165\u4FE1\u606F\n\n- \u5168\u5C40 memory.md \u5185\u5BB9\n- \u5F53\u524D\u5BF9\u8BDD\u6D88\u606F\n- \u9879\u76EE\u6458\u8981\u5217\u8868\uFF08projectSummaries\uFF09\n\n## \u8F93\u51FA\u8981\u6C42\n\n\u8BF7\u4EE5 JSON \u683C\u5F0F\u8F93\u51FA\u7ED3\u679C\uFF0C\u5305\u542B\u4EE5\u4E0B\u5B57\u6BB5\uFF1A\n- memoryMdContent: \u65B0\u7684 memory.md \u5185\u5BB9\n- hasUpdates: \u662F\u5426\u6709\u66F4\u65B0\n\n## \u8BB0\u5FC6\u7EC4\u7EC7\u539F\u5219\n\n- \u5173\u6CE8\u8DE8\u9879\u76EE\u5171\u6027\uFF08\u5DE5\u4F5C\u6D41\u3001\u89C4\u8303\u3001\u504F\u597D\uFF09\n- \u9879\u76EE\u7D22\u5F15\u53EA\u8BB0\u5F55\u6458\u8981\u548C\u8DEF\u5F84\uFF0C\u4E0D\u590D\u5236\u5185\u5BB9\n- \u7528\u6237\u4E2A\u4EBA\u504F\u597D\uFF08\u996E\u98DF\u3001\u5DE5\u4F5C\u4E60\u60EF\uFF09\u4F18\u5148\u8BB0\u5F55";
78
+ /**
79
+ * 创建 Memory Agent 配置
80
+ */
81
+ export declare function createMemoryAgent(scope: MemoryScope): MemoryAgentConfig;
82
+ /**
83
+ * 格式化 Memory Agent 输入为字符串
84
+ */
85
+ export declare function formatMemoryInput(input: MemoryAgentInput): string;
86
+ /**
87
+ * 解析 Memory Agent 输出
88
+ */
89
+ export declare function parseMemoryAgentOutput(output: string, scope: MemoryScope): MemoryAgentResult;
90
+ /**
91
+ * 创建默认的 MemoryAgentResult
92
+ */
93
+ export declare function createEmptyResult(scope: MemoryScope): MemoryAgentResult;
94
+ /**
95
+ * 构建 Project Memory Agent 输入
96
+ */
97
+ export declare function buildProjectInput(params: {
98
+ projectPath: string;
99
+ currentMemoryMd: string;
100
+ messages: ModelMessage[];
101
+ }): Promise<MemoryAgentInput>;
102
+ /**
103
+ * 构建 Global Memory Agent 输入
104
+ */
105
+ export declare function buildGlobalInput(params: {
106
+ baseDir: string;
107
+ currentMemoryMd: string;
108
+ messages: ModelMessage[];
109
+ projectSummaries?: ProjectSummary[];
110
+ }): MemoryAgentInput;
111
+ /**
112
+ * 应用 Memory Agent 结果到文件系统
113
+ *
114
+ * @param result MemoryAgent 结果
115
+ * @param baseDir 基础目录
116
+ */
117
+ export declare function applyMemoryResult(result: MemoryAgentResult, baseDir: string): Promise<void>;
118
+ /**
119
+ * 生成项目摘要
120
+ */
121
+ export declare function generateProjectSummary(params: {
122
+ projectPath: string;
123
+ projectName: string;
124
+ memoryMdContent: string;
125
+ memoryMdPath: string;
126
+ }): ProjectSummary;