@ai-setting/roy-agent-core 1.7.51 → 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 (337) 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 +4 -4
  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 +6 -6
  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 +2 -2
  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/index.js +2 -2
  263. package/dist/env/workflow/plugins/lark-cli-workflow-notify-plugin.d.ts +107 -0
  264. package/dist/env/workflow/plugins/workflow-json-output-plugin.d.ts +166 -0
  265. package/dist/env/workflow/runtime/runtime-cancellation-scope.d.ts +121 -0
  266. package/dist/env/workflow/service/index.d.ts +9 -0
  267. package/dist/env/workflow/service/registry.d.ts +37 -0
  268. package/dist/env/workflow/service/workflow-service.d.ts +422 -0
  269. package/dist/env/workflow/storage/index.d.ts +11 -0
  270. package/dist/env/workflow/storage/mock-repositories.d.ts +106 -0
  271. package/dist/env/workflow/storage/safe-json.d.ts +62 -0
  272. package/dist/env/workflow/storage/sqlite.d.ts +57 -0
  273. package/dist/env/workflow/storage/tag-repo.d.ts +65 -0
  274. package/dist/env/workflow/storage/workflow-repo.d.ts +161 -0
  275. package/dist/env/workflow/tools/ask-user-tool.d.ts +35 -0
  276. package/dist/env/workflow/tools/index.d.ts +16 -0
  277. package/dist/env/workflow/tools/run-workflow.d.ts +130 -0
  278. package/dist/env/workflow/tools/submit-json-output-tool.d.ts +38 -0
  279. package/dist/env/workflow/tools/workflow-add-tool.d.ts +47 -0
  280. package/dist/env/workflow/tools/workflow-get-tool.d.ts +29 -0
  281. package/dist/env/workflow/tools/workflow-list-tool.d.ts +55 -0
  282. package/dist/env/workflow/tools/workflow-run-status-tool.d.ts +26 -0
  283. package/dist/env/workflow/tools/workflow-run-stop-tool.d.ts +29 -0
  284. package/dist/env/workflow/tools/workflow-search-tool.d.ts +33 -0
  285. package/dist/env/workflow/tools/workflow-tag-list-tool.d.ts +59 -0
  286. package/dist/env/workflow/tools/workflow-validate-tool.d.ts +60 -0
  287. package/dist/env/workflow/types/context.d.ts +17 -0
  288. package/dist/env/workflow/types/decorators-types.d.ts +182 -0
  289. package/dist/env/workflow/types/edge.d.ts +33 -0
  290. package/dist/env/workflow/types/event.d.ts +869 -0
  291. package/dist/env/workflow/types/index.d.ts +16 -0
  292. package/dist/env/workflow/types/run.d.ts +235 -0
  293. package/dist/env/workflow/types/workflow-error.d.ts +79 -0
  294. package/dist/env/workflow/types/workflow-hil.d.ts +57 -0
  295. package/dist/env/workflow/types/workflow-message.d.ts +193 -0
  296. package/dist/env/workflow/types/workflow-session.d.ts +17 -0
  297. package/dist/env/workflow/types/workflow.d.ts +654 -0
  298. package/dist/env/workflow/types_compat.d.ts +10 -0
  299. package/dist/env/workflow/utils/agent-session-metadata.d.ts +35 -0
  300. package/dist/env/workflow/utils/build-agent-node-output.d.ts +11 -0
  301. package/dist/env/workflow/utils/create-workflow.d.ts +35 -0
  302. package/dist/env/workflow/utils/dependency-prescan.d.ts +67 -0
  303. package/dist/env/workflow/utils/execution-state.d.ts +46 -0
  304. package/dist/env/workflow/utils/extract-agent-json-output.d.ts +6 -0
  305. package/dist/env/workflow/utils/index.d.ts +14 -0
  306. package/dist/env/workflow/utils/json-schema-to-zod.d.ts +23 -0
  307. package/dist/env/workflow/utils/node-id-utils.d.ts +20 -0
  308. package/dist/env/workflow/utils/node-output-contracts.d.ts +137 -0
  309. package/dist/env/workflow/utils/node-registry-helper.d.ts +36 -0
  310. package/dist/env/workflow/utils/output-schema-hint.d.ts +7 -0
  311. package/dist/env/workflow/utils/parse-agent-output-config.d.ts +9 -0
  312. package/dist/env/workflow/utils/recovery-validator.d.ts +30 -0
  313. package/dist/env/workflow/utils/sensitive-redact.d.ts +37 -0
  314. package/dist/env/workflow/utils/session-parser.d.ts +23 -0
  315. package/dist/env/workflow/utils/session-recovery.d.ts +122 -0
  316. package/dist/env/workflow/utils/template-contract-validator.d.ts +87 -0
  317. package/dist/env/workflow/utils/template-resolver.d.ts +285 -0
  318. package/dist/env/workflow/utils/validate-workflow-definition.d.ts +57 -0
  319. package/dist/env/workflow/utils/validation-rules.d.ts +103 -0
  320. package/dist/env/workflow/utils/workflow-message-metadata.d.ts +20 -0
  321. package/dist/env/workflow/utils/workflow-sanitize.d.ts +51 -0
  322. package/dist/env/workflow/workflow-component.d.ts +138 -0
  323. package/dist/index.d.ts +59 -0
  324. package/dist/index.js +7 -7
  325. package/dist/shared/@ai-setting/{roy-agent-core-9faekt5n.js → roy-agent-core-4sx6sdb2.js} +1 -1
  326. package/dist/shared/@ai-setting/{roy-agent-core-wxsgay02.js → roy-agent-core-brwzs8wf.js} +1 -1
  327. package/dist/shared/@ai-setting/{roy-agent-core-kyasfzeh.js → roy-agent-core-hch2geta.js} +45 -14
  328. package/dist/shared/@ai-setting/{roy-agent-core-zd077w51.js → roy-agent-core-j8e92gj8.js} +43 -1
  329. package/dist/shared/@ai-setting/{roy-agent-core-wwytg8rv.js → roy-agent-core-ph5qbqcx.js} +566 -78
  330. package/dist/util/process/process-tree-killer.d.ts +67 -0
  331. package/dist/utils/id.d.ts +11 -0
  332. package/dist/utils/loose-json.d.ts +30 -0
  333. package/dist/utils/media.d.ts +70 -0
  334. package/dist/utils/temp-file-manager/index.d.ts +99 -0
  335. package/package.json +4 -2
  336. /package/dist/shared/@ai-setting/{roy-agent-core-s214vmmd.js → roy-agent-core-4vpk40ss.js} +0 -0
  337. /package/dist/shared/@ai-setting/{roy-agent-core-0cfaqnz9.js → roy-agent-core-k25gv86p.js} +0 -0
@@ -0,0 +1,160 @@
1
+ /**
2
+ * @fileoverview Debug Component
3
+ *
4
+ * Provides debugging capabilities for roy-agent applications by parsing
5
+ * trace logs and presenting formatted output.
6
+ */
7
+ import { BaseComponent, type ComponentConfig } from '../component';
8
+ import { LogReader } from './reader/log-reader';
9
+ import { SpanDbReader } from './reader/span-db-reader';
10
+ import { RegexParser } from './parser/regex-parser';
11
+ import { SpanBuilder } from './parser/span-builder';
12
+ import { TraceFormatter, TreeFormatter } from './formatters';
13
+ import type { ParserOptions, TraceEntry, TraceTreeNode, TraceSummary, FormatOptions } from './types';
14
+ /**
15
+ * Data source type for trace retrieval
16
+ */
17
+ export type TraceDataSource = 'log' | 'sqlite';
18
+ /**
19
+ * Extended parser options with data source support
20
+ */
21
+ export interface TraceParserOptions extends ParserOptions {
22
+ /** Data source type: 'log' (default) or 'sqlite' */
23
+ source?: TraceDataSource;
24
+ /** SQLite database path (required when source is 'sqlite') */
25
+ dbPath?: string;
26
+ }
27
+ /**
28
+ * DebugComponent configuration options
29
+ */
30
+ export interface DebugComponentOptions {
31
+ /** Log directory path */
32
+ logDir?: string;
33
+ /** Default log file */
34
+ defaultLogFile?: string;
35
+ }
36
+ /**
37
+ * Debug Component for trace analysis and debugging
38
+ */
39
+ export declare class DebugComponent extends BaseComponent {
40
+ name: string;
41
+ version: string;
42
+ private reader;
43
+ private spanDbReader;
44
+ private parser;
45
+ private spanBuilder;
46
+ private traceFormatter;
47
+ private treeFormatter;
48
+ private options;
49
+ constructor(options?: DebugComponentOptions);
50
+ /**
51
+ * Initialize the span database reader
52
+ */
53
+ initSpanDbReader(dbPath?: string): Promise<void>;
54
+ /**
55
+ * Get the span database reader
56
+ */
57
+ getSpanDbReader(): SpanDbReader | null;
58
+ /**
59
+ * Get trace by ID from live Tracer storage
60
+ *
61
+ * This method retrieves traces directly from the Tracer's span storage,
62
+ * which includes spans from the current session that may not yet be persisted
63
+ * to log files.
64
+ */
65
+ getLiveTrace(traceId: string): Promise<any | null>;
66
+ /**
67
+ * List all available traces from live Tracer storage
68
+ */
69
+ listLiveTraces(limit?: number): Promise<any>;
70
+ /**
71
+ * Format a live trace for display
72
+ */
73
+ formatLiveTrace(traceId: string): Promise<string>;
74
+ /**
75
+ * Initialize the component
76
+ */
77
+ init(config?: ComponentConfig): Promise<void>;
78
+ /**
79
+ * Stop the component
80
+ */
81
+ stop(): Promise<void>;
82
+ /**
83
+ * Get traces matching the options
84
+ */
85
+ getTraces(options?: TraceParserOptions): Promise<TraceEntry[]>;
86
+ /**
87
+ * Get traces from SQLite database
88
+ */
89
+ private getTracesFromSqlite;
90
+ /**
91
+ * List available trace IDs
92
+ */
93
+ listTraceIds(options?: TraceParserOptions & {
94
+ limit?: number;
95
+ }): Promise<TraceSummary>;
96
+ /**
97
+ * List trace IDs from SQLite database
98
+ */
99
+ private listTraceIdsFromSqlite;
100
+ /**
101
+ * Get call tree for a specific trace
102
+ */
103
+ getCallTree(options?: TraceParserOptions): Promise<TraceTreeNode | null>;
104
+ /**
105
+ * Get the log reader instance
106
+ */
107
+ getReader(): LogReader;
108
+ /**
109
+ * Get the parser instance
110
+ */
111
+ getParser(): RegexParser;
112
+ /**
113
+ * Get the span builder instance
114
+ */
115
+ getSpanBuilder(): SpanBuilder;
116
+ /**
117
+ * Get the trace formatter instance
118
+ */
119
+ getTraceFormatter(): TraceFormatter;
120
+ /**
121
+ * Get the tree formatter instance
122
+ */
123
+ getTreeFormatter(): TreeFormatter;
124
+ /**
125
+ * Format traces for display
126
+ */
127
+ formatTraces(entries: TraceEntry[], options?: FormatOptions): string;
128
+ /**
129
+ * Format a single trace entry
130
+ */
131
+ formatTraceEntry(entry: TraceEntry, options?: FormatOptions): string;
132
+ /**
133
+ * Format traces as JSON
134
+ */
135
+ tracesToJSON(entries: TraceEntry[]): string;
136
+ /**
137
+ * Format traces as summary
138
+ */
139
+ tracesToSummary(entries: TraceEntry[]): string;
140
+ /**
141
+ * Format call tree for display
142
+ */
143
+ formatTree(node: TraceTreeNode): string;
144
+ /**
145
+ * Format multiple call trees
146
+ */
147
+ formatTrees(trees: TraceTreeNode[]): string;
148
+ /**
149
+ * Format trees as JSON
150
+ */
151
+ treesToJSON(trees: TraceTreeNode[]): string;
152
+ /**
153
+ * Format tree summary (sorted by duration)
154
+ */
155
+ formatTreeSummary(node: TraceTreeNode): string;
156
+ /**
157
+ * Format tree with timeline visualization
158
+ */
159
+ formatTreeTimeline(node: TraceTreeNode): string;
160
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @fileoverview Debug Formatters
3
+ *
4
+ * Export all formatters for trace and tree visualization
5
+ */
6
+ export { TraceFormatter } from './trace-formatter';
7
+ export { TreeFormatter } from './tree-formatter';
8
+ export { ReplFormatter } from './repl-formatter';
@@ -0,0 +1,80 @@
1
+ /**
2
+ * @fileoverview REPL Formatter for Interactive Debugging
3
+ *
4
+ * Provides an interactive REPL interface for debugging with:
5
+ * - Command parsing
6
+ * - Output formatting
7
+ * - Help text generation
8
+ */
9
+ export interface ReplContext {
10
+ traceId?: string;
11
+ function?: string;
12
+ limit?: number;
13
+ }
14
+ export interface ParsedCommand {
15
+ command: string;
16
+ args: Record<string, string>;
17
+ }
18
+ /**
19
+ * Formats output for REPL interface and provides command parsing
20
+ */
21
+ export declare class ReplFormatter {
22
+ private context;
23
+ private history;
24
+ /**
25
+ * Get welcome message for REPL
26
+ */
27
+ getWelcomeMessage(): string;
28
+ /**
29
+ * Format prompt with current context
30
+ */
31
+ formatPrompt(context?: Partial<ReplContext>): string;
32
+ /**
33
+ * Get help text
34
+ */
35
+ getHelpText(): string;
36
+ /**
37
+ * Format command result
38
+ */
39
+ formatCommandResult(command: string, data: unknown): string;
40
+ /**
41
+ * Format list command result
42
+ */
43
+ private formatListResult;
44
+ /**
45
+ * Format trace command result
46
+ */
47
+ private formatTraceResult;
48
+ /**
49
+ * Format tree command result
50
+ */
51
+ private formatTreeResult;
52
+ /**
53
+ * Format a single tree node recursively
54
+ */
55
+ private formatTreeNode;
56
+ /**
57
+ * Format JSON in compact form
58
+ */
59
+ private formatJsonCompact;
60
+ /**
61
+ * Parse command string
62
+ */
63
+ parseCommand(input: string): ParsedCommand;
64
+ /**
65
+ * Update context
66
+ */
67
+ setContext(context: Partial<ReplContext>): void;
68
+ /**
69
+ * Get current context
70
+ */
71
+ getContext(): ReplContext;
72
+ /**
73
+ * Add to history
74
+ */
75
+ addToHistory(command: string): void;
76
+ /**
77
+ * Get history
78
+ */
79
+ getHistory(): string[];
80
+ }
@@ -0,0 +1,43 @@
1
+ /**
2
+ * @fileoverview Trace Formatter
3
+ *
4
+ * Formats trace entries for console output with support for:
5
+ * - Pretty printing with indentation
6
+ * - Multi-line content handling
7
+ * - JSON output
8
+ * - Depth-limited nested object display
9
+ */
10
+ import type { TraceEntry, FormatOptions } from '../types';
11
+ /**
12
+ * Formats trace entries for human-readable output
13
+ */
14
+ export declare class TraceFormatter {
15
+ /**
16
+ * Format a single trace entry
17
+ */
18
+ formatEntry(entry: TraceEntry, options?: FormatOptions): string;
19
+ /**
20
+ * Indent all lines after the first one
21
+ */
22
+ private indentMultilineContent;
23
+ /**
24
+ * Format multiple trace entries
25
+ */
26
+ formatEntries(entries: TraceEntry[], options?: FormatOptions): string;
27
+ /**
28
+ * Format data with proper indentation for multi-line content
29
+ */
30
+ private formatData;
31
+ /**
32
+ * Format data with pretty printing and indentation
33
+ */
34
+ private formatPretty;
35
+ /**
36
+ * Output as JSON
37
+ */
38
+ toJSON(entries: TraceEntry[]): string;
39
+ /**
40
+ * Generate a summary of trace entries
41
+ */
42
+ toSummary(entries: TraceEntry[]): string;
43
+ }
@@ -0,0 +1,72 @@
1
+ /**
2
+ * @fileoverview Tree Formatter
3
+ *
4
+ * Formats trace call trees for console output with:
5
+ * - ANSI color support
6
+ * - Duration display with percentage
7
+ * - Time bar visualization
8
+ * - Proper indentation
9
+ */
10
+ import type { TraceTreeNode } from '../types';
11
+ /**
12
+ * Options for tree formatting
13
+ */
14
+ export interface TreeFormatOptions {
15
+ /** Show duration percentage (default: true) */
16
+ showPercent?: boolean;
17
+ /** Show time bar (default: false) */
18
+ showTimeBar?: boolean;
19
+ /** Width of time bar (default: 10) */
20
+ barWidth?: number;
21
+ }
22
+ /**
23
+ * Formats trace call trees for human-readable output
24
+ */
25
+ export declare class TreeFormatter {
26
+ private options;
27
+ constructor(options?: TreeFormatOptions);
28
+ /**
29
+ * Color function based on percentage
30
+ */
31
+ private colorByPercent;
32
+ /**
33
+ * Format a single trace tree
34
+ */
35
+ formatTree(node: TraceTreeNode): string;
36
+ /**
37
+ * Format a single node
38
+ */
39
+ private formatNode;
40
+ /**
41
+ * Recursively format children
42
+ */
43
+ private formatChildren;
44
+ /**
45
+ * Render a time bar showing relative duration
46
+ */
47
+ private renderTimeBar;
48
+ /**
49
+ * Format duration in human-readable form
50
+ */
51
+ private formatDuration;
52
+ /**
53
+ * Format multiple trace trees
54
+ */
55
+ formatTrees(trees: TraceTreeNode[]): string;
56
+ /**
57
+ * Output as JSON
58
+ */
59
+ toJSON(trees: TraceTreeNode[]): string;
60
+ /**
61
+ * Generate a summary table of all spans sorted by duration
62
+ */
63
+ formatSummary(node: TraceTreeNode): string;
64
+ /**
65
+ * Format tree with timeline visualization
66
+ */
67
+ formatTimeline(node: TraceTreeNode): string;
68
+ /**
69
+ * Build timeline visualization with absolute positioning
70
+ */
71
+ private buildTimeline;
72
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @fileoverview Debug Component Index
3
+ *
4
+ * Export all debug-related types and classes.
5
+ */
6
+ export type { TraceEntry, TraceTreeNode, ParserOptions, LogDiscoveryOptions, ParsedLogLine, TraceIdInfo, TraceSummary, FormatOptions, TraceAction, LogLevel, } from './types';
7
+ export type { TraceDataSource, TraceParserOptions } from './debug-component';
8
+ export { DebugComponent } from './debug-component';
9
+ export { LogReader } from './reader/log-reader';
10
+ export { SpanDbReader } from './reader/span-db-reader';
11
+ export { RegexParser } from './parser/regex-parser';
12
+ export { SpanBuilder } from './parser/span-builder';
13
+ export { TraceFormatter } from './formatters/trace-formatter';
14
+ export { TreeFormatter } from './formatters/tree-formatter';
15
+ export { ReplFormatter } from './formatters/repl-formatter';
@@ -4,7 +4,7 @@ import {
4
4
  RegexParser,
5
5
  SpanBuilder,
6
6
  SpanDbReader
7
- } from "../../shared/@ai-setting/roy-agent-core-0cfaqnz9.js";
7
+ } from "../../shared/@ai-setting/roy-agent-core-k25gv86p.js";
8
8
  import {
9
9
  ReplFormatter,
10
10
  TraceFormatter,
@@ -0,0 +1,49 @@
1
+ /**
2
+ * @fileoverview Regex Parser for Log Lines
3
+ *
4
+ * Parses log files with trace format:
5
+ * [TRACE] >>> {method} enter: {args}
6
+ * [TRACE] <<< {method} quit: {result}
7
+ * [TRACE] !!! {method} error: {error}
8
+ */
9
+ import type { ParsedLogLine, LogLevel } from '../types';
10
+ /**
11
+ * Regex Parser for trace log lines
12
+ */
13
+ export declare class RegexParser {
14
+ /**
15
+ * Parse a single log line
16
+ */
17
+ parseLogLine(line: string): ParsedLogLine | null;
18
+ /**
19
+ * Parse arguments from raw args string
20
+ */
21
+ parseArgs(raw: string): unknown | unknown[] | null;
22
+ /**
23
+ * Check if a line is a trace line
24
+ */
25
+ isTraceLine(line: string): boolean;
26
+ /**
27
+ * Filter lines by log level
28
+ */
29
+ filterByLevel(lines: string[], level?: LogLevel): string[];
30
+ /**
31
+ * Filter lines by function name
32
+ */
33
+ filterByFunction(lines: string[], functionName?: string): string[];
34
+ /**
35
+ * Extract trace ID from log line
36
+ * Checks for requestId in two places:
37
+ * 1. Category field: [source][requestId=req_123]
38
+ * 2. After method name: [requestId=req_abc]
39
+ */
40
+ extractTraceId(line: string): string | null;
41
+ /**
42
+ * Extract trace IDs from multiple lines
43
+ */
44
+ extractTraceIds(lines: string[]): Map<string, string[]>;
45
+ /**
46
+ * Parse multiple lines
47
+ */
48
+ parseLines(lines: string[]): ParsedLogLine[];
49
+ }
@@ -0,0 +1,79 @@
1
+ /**
2
+ * @fileoverview Span Builder
3
+ *
4
+ * Builds TraceEntry objects from parsed log lines and constructs call trees.
5
+ */
6
+ import type { ParsedLogLine, TraceEntry, TraceTreeNode } from '../types';
7
+ /**
8
+ * Paired enter/quit entries
9
+ */
10
+ interface PairedSpan {
11
+ enter: TraceEntry;
12
+ quit: TraceEntry;
13
+ durationMs: number;
14
+ }
15
+ /**
16
+ * Span Builder for constructing trace entries and call trees
17
+ */
18
+ export declare class SpanBuilder {
19
+ private parser;
20
+ constructor();
21
+ /**
22
+ * Build trace entries from parsed log lines
23
+ */
24
+ buildTraceEntries(lines: ParsedLogLine[]): TraceEntry[];
25
+ /**
26
+ * Build a single trace entry from a parsed log line
27
+ */
28
+ private buildTraceEntry;
29
+ /**
30
+ * Generate a virtual trace ID when no real traceId is present
31
+ * Uses function name and timestamp to create a pseudo-traceId
32
+ */
33
+ generateVirtualTraceId(functionName: string, timestamp: string): string;
34
+ /**
35
+ * Extract trace ID from log line
36
+ */
37
+ private extractTraceId;
38
+ /**
39
+ * Calculate duration between enter and quit entries
40
+ */
41
+ calculateDuration(enter: TraceEntry, quit: TraceEntry): number;
42
+ /**
43
+ * Pair enter and quit entries
44
+ */
45
+ pairEnterQuit(entries: TraceEntry[]): PairedSpan[];
46
+ /**
47
+ * Build a call tree from trace entries using call stack tracking
48
+ *
49
+ * Enhanced to support both:
50
+ * 1. Traditional enter/quit pair-based tree building (from log files)
51
+ * 2. Parent-child hierarchy-based tree building (from SQLite spans)
52
+ */
53
+ buildCallTree(entries: TraceEntry[]): TraceTreeNode | null;
54
+ /**
55
+ * Build call tree from parent-child span hierarchy (for SQLite spans)
56
+ */
57
+ buildCallTreeFromHierarchy(entries: TraceEntry[]): TraceTreeNode | null;
58
+ /**
59
+ * Build call tree from traditional enter/quit pairs (for log files)
60
+ */
61
+ buildCallTreeFromPairs(entries: TraceEntry[]): TraceTreeNode | null;
62
+ /**
63
+ * Build a tree node from a paired span
64
+ */
65
+ private buildNodeFromPaired;
66
+ /**
67
+ * Merge entries from multiple functions into a single call tree
68
+ */
69
+ buildMergedTree(entriesByFunction: Map<string, TraceEntry[]>): TraceTreeNode | null;
70
+ /**
71
+ * Get duration summary for entries
72
+ */
73
+ getDurationSummary(entries: TraceEntry[]): Map<string, {
74
+ count: number;
75
+ totalMs: number;
76
+ avgMs: number;
77
+ }>;
78
+ }
79
+ export {};
@@ -0,0 +1,55 @@
1
+ /**
2
+ * @fileoverview Log Reader
3
+ *
4
+ * Reads log files with support for streaming and filtering.
5
+ */
6
+ import type { ParserOptions } from '../types';
7
+ /**
8
+ * Get XDG data home directory
9
+ */
10
+ export declare function getXDGDataHome(): string;
11
+ /**
12
+ * Log Reader for reading and parsing log files
13
+ */
14
+ export declare class LogReader {
15
+ private logDir;
16
+ constructor(options?: {
17
+ logDir?: string;
18
+ });
19
+ /**
20
+ * Get the full path to a log file
21
+ */
22
+ getLogPath(filename?: string): string;
23
+ /**
24
+ * Find log files matching a pattern
25
+ *
26
+ * Uses forward slashes for glob patterns to ensure cross-platform compatibility.
27
+ * The glob library requires forward slashes regardless of OS.
28
+ */
29
+ findLogFiles(pattern?: string): Promise<string[]>;
30
+ /**
31
+ * Get default log directory
32
+ */
33
+ getDefaultLogDir(): string;
34
+ /**
35
+ * Read lines from a log file with optional filtering
36
+ */
37
+ readLines(filepath: string, options?: ParserOptions): AsyncGenerator<string>;
38
+ /**
39
+ * Extract timestamp from a log line
40
+ */
41
+ extractTimestamp(line: string): number | null;
42
+ /**
43
+ * Parse time string to timestamp
44
+ * Supports ISO format and relative time like "1h", "30m"
45
+ */
46
+ parseTime(timeStr: string): number;
47
+ /**
48
+ * Read file content directly (for small files)
49
+ */
50
+ readFile(filepath: string): Promise<string>;
51
+ /**
52
+ * Check if a log file exists
53
+ */
54
+ exists(filepath: string): boolean;
55
+ }
@@ -0,0 +1,70 @@
1
+ /**
2
+ * @fileoverview Span DB Reader - Read spans from SQLite database
3
+ *
4
+ * This reader fetches trace data directly from SQLite span storage,
5
+ * which is used for persisting spans in production environments.
6
+ */
7
+ import type { TraceEntry, TraceSummary } from '../types';
8
+ import type { SpanStorage } from '../../log-trace/types';
9
+ /**
10
+ * Options for SpanDbReader
11
+ */
12
+ export interface SpanDbReaderOptions {
13
+ /** Database path (for file-based SQLite) */
14
+ dbPath?: string;
15
+ /** Storage instance to use directly */
16
+ storage?: SpanStorage;
17
+ }
18
+ /**
19
+ * Span Database Reader
20
+ *
21
+ * Reads span data from SQLite storage for trace debugging and analysis.
22
+ */
23
+ export declare class SpanDbReader {
24
+ private storage;
25
+ private dbPath;
26
+ private sqliteDb;
27
+ constructor(options?: SpanDbReaderOptions);
28
+ /**
29
+ * Initialize the reader with storage
30
+ */
31
+ initialize(): Promise<void>;
32
+ /**
33
+ * Initialize SQLite storage directly
34
+ */
35
+ private initSqliteStorage;
36
+ /**
37
+ * Get trace entries for a specific traceId
38
+ */
39
+ getTraceEntries(traceId: string): Promise<TraceEntry[]>;
40
+ /**
41
+ * List all trace IDs
42
+ */
43
+ listTraceIds(limit?: number): Promise<TraceSummary>;
44
+ /**
45
+ * Convert spans to TraceEntry format
46
+ *
47
+ * Now properly extracts spanId and parentSpanId for tree building
48
+ */
49
+ private spansToEntries;
50
+ /**
51
+ * Convert span attributes to params format
52
+ */
53
+ private attributesToParams;
54
+ /**
55
+ * Get the underlying storage
56
+ */
57
+ getStorage(): SpanStorage | null;
58
+ /**
59
+ * Close the reader and cleanup resources
60
+ */
61
+ close(): void;
62
+ }
63
+ /**
64
+ * Create a SpanDbReader from a database path
65
+ */
66
+ export declare function createSpanDbReader(dbPath: string): Promise<SpanDbReader>;
67
+ /**
68
+ * Create a SpanDbReader from an existing storage instance
69
+ */
70
+ export declare function createSpanDbReaderFromStorage(storage: SpanStorage): SpanDbReader;