@intrect/openswarm 0.2.0

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 (437) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +544 -0
  3. package/config.example.yaml +107 -0
  4. package/dist/adapters/base.d.ts +8 -0
  5. package/dist/adapters/base.d.ts.map +1 -0
  6. package/dist/adapters/base.js +104 -0
  7. package/dist/adapters/base.js.map +1 -0
  8. package/dist/adapters/claude.d.ts +13 -0
  9. package/dist/adapters/claude.d.ts.map +1 -0
  10. package/dist/adapters/claude.js +318 -0
  11. package/dist/adapters/claude.js.map +1 -0
  12. package/dist/adapters/codex.d.ts +14 -0
  13. package/dist/adapters/codex.d.ts.map +1 -0
  14. package/dist/adapters/codex.js +366 -0
  15. package/dist/adapters/codex.js.map +1 -0
  16. package/dist/adapters/cryptoQuantAdapter.d.ts +85 -0
  17. package/dist/adapters/cryptoQuantAdapter.d.ts.map +1 -0
  18. package/dist/adapters/cryptoQuantAdapter.js +238 -0
  19. package/dist/adapters/cryptoQuantAdapter.js.map +1 -0
  20. package/dist/adapters/index.d.ts +17 -0
  21. package/dist/adapters/index.d.ts.map +1 -0
  22. package/dist/adapters/index.js +47 -0
  23. package/dist/adapters/index.js.map +1 -0
  24. package/dist/adapters/processRegistry.d.ts +38 -0
  25. package/dist/adapters/processRegistry.d.ts.map +1 -0
  26. package/dist/adapters/processRegistry.js +147 -0
  27. package/dist/adapters/processRegistry.js.map +1 -0
  28. package/dist/adapters/streamBuffer.d.ts +59 -0
  29. package/dist/adapters/streamBuffer.d.ts.map +1 -0
  30. package/dist/adapters/streamBuffer.js +123 -0
  31. package/dist/adapters/streamBuffer.js.map +1 -0
  32. package/dist/adapters/types.d.ts +65 -0
  33. package/dist/adapters/types.d.ts.map +1 -0
  34. package/dist/adapters/types.js +6 -0
  35. package/dist/adapters/types.js.map +1 -0
  36. package/dist/agents/agentBus.d.ts +160 -0
  37. package/dist/agents/agentBus.d.ts.map +1 -0
  38. package/dist/agents/agentBus.js +350 -0
  39. package/dist/agents/agentBus.js.map +1 -0
  40. package/dist/agents/agentPair.d.ts +210 -0
  41. package/dist/agents/agentPair.d.ts.map +1 -0
  42. package/dist/agents/agentPair.js +420 -0
  43. package/dist/agents/agentPair.js.map +1 -0
  44. package/dist/agents/auditor.d.ts +27 -0
  45. package/dist/agents/auditor.d.ts.map +1 -0
  46. package/dist/agents/auditor.js +237 -0
  47. package/dist/agents/auditor.js.map +1 -0
  48. package/dist/agents/cliStreamParser.d.ts +18 -0
  49. package/dist/agents/cliStreamParser.d.ts.map +1 -0
  50. package/dist/agents/cliStreamParser.js +156 -0
  51. package/dist/agents/cliStreamParser.js.map +1 -0
  52. package/dist/agents/documenter.d.ts +31 -0
  53. package/dist/agents/documenter.d.ts.map +1 -0
  54. package/dist/agents/documenter.js +285 -0
  55. package/dist/agents/documenter.js.map +1 -0
  56. package/dist/agents/index.d.ts +10 -0
  57. package/dist/agents/index.d.ts.map +1 -0
  58. package/dist/agents/index.js +10 -0
  59. package/dist/agents/index.js.map +1 -0
  60. package/dist/agents/pairMetrics.d.ts +63 -0
  61. package/dist/agents/pairMetrics.d.ts.map +1 -0
  62. package/dist/agents/pairMetrics.js +231 -0
  63. package/dist/agents/pairMetrics.js.map +1 -0
  64. package/dist/agents/pairPipeline.d.ts +155 -0
  65. package/dist/agents/pairPipeline.d.ts.map +1 -0
  66. package/dist/agents/pairPipeline.js +793 -0
  67. package/dist/agents/pairPipeline.js.map +1 -0
  68. package/dist/agents/pairWebhook.d.ts +59 -0
  69. package/dist/agents/pairWebhook.d.ts.map +1 -0
  70. package/dist/agents/pairWebhook.js +242 -0
  71. package/dist/agents/pairWebhook.js.map +1 -0
  72. package/dist/agents/pipelineFormat.d.ts +11 -0
  73. package/dist/agents/pipelineFormat.d.ts.map +1 -0
  74. package/dist/agents/pipelineFormat.js +164 -0
  75. package/dist/agents/pipelineFormat.js.map +1 -0
  76. package/dist/agents/pipelineGuards.d.ts +23 -0
  77. package/dist/agents/pipelineGuards.d.ts.map +1 -0
  78. package/dist/agents/pipelineGuards.js +175 -0
  79. package/dist/agents/pipelineGuards.js.map +1 -0
  80. package/dist/agents/reviewer.d.ts +37 -0
  81. package/dist/agents/reviewer.d.ts.map +1 -0
  82. package/dist/agents/reviewer.js +213 -0
  83. package/dist/agents/reviewer.js.map +1 -0
  84. package/dist/agents/skillDocumenter.d.ts +23 -0
  85. package/dist/agents/skillDocumenter.d.ts.map +1 -0
  86. package/dist/agents/skillDocumenter.js +218 -0
  87. package/dist/agents/skillDocumenter.js.map +1 -0
  88. package/dist/agents/tester.d.ts +37 -0
  89. package/dist/agents/tester.d.ts.map +1 -0
  90. package/dist/agents/tester.js +308 -0
  91. package/dist/agents/tester.js.map +1 -0
  92. package/dist/agents/worker.d.ts +30 -0
  93. package/dist/agents/worker.d.ts.map +1 -0
  94. package/dist/agents/worker.js +128 -0
  95. package/dist/agents/worker.js.map +1 -0
  96. package/dist/automation/autonomousRunner.d.ts +123 -0
  97. package/dist/automation/autonomousRunner.d.ts.map +1 -0
  98. package/dist/automation/autonomousRunner.js +1082 -0
  99. package/dist/automation/autonomousRunner.js.map +1 -0
  100. package/dist/automation/ciWorker.d.ts +51 -0
  101. package/dist/automation/ciWorker.d.ts.map +1 -0
  102. package/dist/automation/ciWorker.js +282 -0
  103. package/dist/automation/ciWorker.js.map +1 -0
  104. package/dist/automation/conflictResolver.d.ts +29 -0
  105. package/dist/automation/conflictResolver.d.ts.map +1 -0
  106. package/dist/automation/conflictResolver.js +261 -0
  107. package/dist/automation/conflictResolver.js.map +1 -0
  108. package/dist/automation/dailyReporter.d.ts +26 -0
  109. package/dist/automation/dailyReporter.d.ts.map +1 -0
  110. package/dist/automation/dailyReporter.js +132 -0
  111. package/dist/automation/dailyReporter.js.map +1 -0
  112. package/dist/automation/index.d.ts +7 -0
  113. package/dist/automation/index.d.ts.map +1 -0
  114. package/dist/automation/index.js +7 -0
  115. package/dist/automation/index.js.map +1 -0
  116. package/dist/automation/longRunningMonitor.d.ts +26 -0
  117. package/dist/automation/longRunningMonitor.d.ts.map +1 -0
  118. package/dist/automation/longRunningMonitor.js +231 -0
  119. package/dist/automation/longRunningMonitor.js.map +1 -0
  120. package/dist/automation/prOwnership.d.ts +18 -0
  121. package/dist/automation/prOwnership.d.ts.map +1 -0
  122. package/dist/automation/prOwnership.js +61 -0
  123. package/dist/automation/prOwnership.js.map +1 -0
  124. package/dist/automation/prProcessor.d.ts +62 -0
  125. package/dist/automation/prProcessor.d.ts.map +1 -0
  126. package/dist/automation/prProcessor.js +700 -0
  127. package/dist/automation/prProcessor.js.map +1 -0
  128. package/dist/automation/runnerExecution.d.ts +49 -0
  129. package/dist/automation/runnerExecution.d.ts.map +1 -0
  130. package/dist/automation/runnerExecution.js +663 -0
  131. package/dist/automation/runnerExecution.js.map +1 -0
  132. package/dist/automation/runnerState.d.ts +170 -0
  133. package/dist/automation/runnerState.d.ts.map +1 -0
  134. package/dist/automation/runnerState.js +495 -0
  135. package/dist/automation/runnerState.js.map +1 -0
  136. package/dist/automation/runnerTypes.d.ts +46 -0
  137. package/dist/automation/runnerTypes.d.ts.map +1 -0
  138. package/dist/automation/runnerTypes.js +5 -0
  139. package/dist/automation/runnerTypes.js.map +1 -0
  140. package/dist/automation/scheduler.d.ts +75 -0
  141. package/dist/automation/scheduler.d.ts.map +1 -0
  142. package/dist/automation/scheduler.js +394 -0
  143. package/dist/automation/scheduler.js.map +1 -0
  144. package/dist/cli/promptHandler.d.ts +13 -0
  145. package/dist/cli/promptHandler.d.ts.map +1 -0
  146. package/dist/cli/promptHandler.js +189 -0
  147. package/dist/cli/promptHandler.js.map +1 -0
  148. package/dist/cli.d.ts +3 -0
  149. package/dist/cli.d.ts.map +1 -0
  150. package/dist/cli.js +138 -0
  151. package/dist/cli.js.map +1 -0
  152. package/dist/core/config.d.ts +308 -0
  153. package/dist/core/config.d.ts.map +1 -0
  154. package/dist/core/config.js +529 -0
  155. package/dist/core/config.js.map +1 -0
  156. package/dist/core/eventHub.d.ts +194 -0
  157. package/dist/core/eventHub.d.ts.map +1 -0
  158. package/dist/core/eventHub.js +136 -0
  159. package/dist/core/eventHub.js.map +1 -0
  160. package/dist/core/index.d.ts +6 -0
  161. package/dist/core/index.d.ts.map +1 -0
  162. package/dist/core/index.js +6 -0
  163. package/dist/core/index.js.map +1 -0
  164. package/dist/core/service.d.ts +27 -0
  165. package/dist/core/service.d.ts.map +1 -0
  166. package/dist/core/service.js +438 -0
  167. package/dist/core/service.js.map +1 -0
  168. package/dist/core/traceCollector.d.ts +105 -0
  169. package/dist/core/traceCollector.d.ts.map +1 -0
  170. package/dist/core/traceCollector.js +141 -0
  171. package/dist/core/traceCollector.js.map +1 -0
  172. package/dist/core/types.d.ts +413 -0
  173. package/dist/core/types.d.ts.map +1 -0
  174. package/dist/core/types.js +5 -0
  175. package/dist/core/types.js.map +1 -0
  176. package/dist/discord/discordCore.d.ts +104 -0
  177. package/dist/discord/discordCore.d.ts.map +1 -0
  178. package/dist/discord/discordCore.js +698 -0
  179. package/dist/discord/discordCore.js.map +1 -0
  180. package/dist/discord/discordHandlers.d.ts +86 -0
  181. package/dist/discord/discordHandlers.d.ts.map +1 -0
  182. package/dist/discord/discordHandlers.js +849 -0
  183. package/dist/discord/discordHandlers.js.map +1 -0
  184. package/dist/discord/discordPair.d.ts +6 -0
  185. package/dist/discord/discordPair.d.ts.map +1 -0
  186. package/dist/discord/discordPair.js +567 -0
  187. package/dist/discord/discordPair.js.map +1 -0
  188. package/dist/discord/index.d.ts +4 -0
  189. package/dist/discord/index.d.ts.map +1 -0
  190. package/dist/discord/index.js +11 -0
  191. package/dist/discord/index.js.map +1 -0
  192. package/dist/github/github.d.ts +236 -0
  193. package/dist/github/github.d.ts.map +1 -0
  194. package/dist/github/github.js +535 -0
  195. package/dist/github/github.js.map +1 -0
  196. package/dist/github/index.d.ts +2 -0
  197. package/dist/github/index.d.ts.map +1 -0
  198. package/dist/github/index.js +2 -0
  199. package/dist/github/index.js.map +1 -0
  200. package/dist/index.d.ts +3 -0
  201. package/dist/index.d.ts.map +1 -0
  202. package/dist/index.js +60 -0
  203. package/dist/index.js.map +1 -0
  204. package/dist/knowledge/analyzer.d.ts +36 -0
  205. package/dist/knowledge/analyzer.d.ts.map +1 -0
  206. package/dist/knowledge/analyzer.js +170 -0
  207. package/dist/knowledge/analyzer.js.map +1 -0
  208. package/dist/knowledge/gitInfo.d.ts +10 -0
  209. package/dist/knowledge/gitInfo.d.ts.map +1 -0
  210. package/dist/knowledge/gitInfo.js +134 -0
  211. package/dist/knowledge/gitInfo.js.map +1 -0
  212. package/dist/knowledge/graph.d.ts +45 -0
  213. package/dist/knowledge/graph.d.ts.map +1 -0
  214. package/dist/knowledge/graph.js +262 -0
  215. package/dist/knowledge/graph.js.map +1 -0
  216. package/dist/knowledge/graphqlExporter.d.ts +64 -0
  217. package/dist/knowledge/graphqlExporter.d.ts.map +1 -0
  218. package/dist/knowledge/graphqlExporter.js +333 -0
  219. package/dist/knowledge/graphqlExporter.js.map +1 -0
  220. package/dist/knowledge/index.d.ts +58 -0
  221. package/dist/knowledge/index.d.ts.map +1 -0
  222. package/dist/knowledge/index.js +212 -0
  223. package/dist/knowledge/index.js.map +1 -0
  224. package/dist/knowledge/repository.d.ts +64 -0
  225. package/dist/knowledge/repository.d.ts.map +1 -0
  226. package/dist/knowledge/repository.js +250 -0
  227. package/dist/knowledge/repository.js.map +1 -0
  228. package/dist/knowledge/riskOnAnalyzer.d.ts +79 -0
  229. package/dist/knowledge/riskOnAnalyzer.d.ts.map +1 -0
  230. package/dist/knowledge/riskOnAnalyzer.js +243 -0
  231. package/dist/knowledge/riskOnAnalyzer.js.map +1 -0
  232. package/dist/knowledge/scanner.d.ts +14 -0
  233. package/dist/knowledge/scanner.d.ts.map +1 -0
  234. package/dist/knowledge/scanner.js +350 -0
  235. package/dist/knowledge/scanner.js.map +1 -0
  236. package/dist/knowledge/store.d.ts +23 -0
  237. package/dist/knowledge/store.d.ts.map +1 -0
  238. package/dist/knowledge/store.js +86 -0
  239. package/dist/knowledge/store.js.map +1 -0
  240. package/dist/knowledge/types.d.ts +288 -0
  241. package/dist/knowledge/types.d.ts.map +1 -0
  242. package/dist/knowledge/types.js +111 -0
  243. package/dist/knowledge/types.js.map +1 -0
  244. package/dist/linear/index.d.ts +3 -0
  245. package/dist/linear/index.d.ts.map +1 -0
  246. package/dist/linear/index.js +3 -0
  247. package/dist/linear/index.js.map +1 -0
  248. package/dist/linear/linear.d.ts +160 -0
  249. package/dist/linear/linear.d.ts.map +1 -0
  250. package/dist/linear/linear.js +983 -0
  251. package/dist/linear/linear.js.map +1 -0
  252. package/dist/linear/projectUpdater.d.ts +23 -0
  253. package/dist/linear/projectUpdater.d.ts.map +1 -0
  254. package/dist/linear/projectUpdater.js +347 -0
  255. package/dist/linear/projectUpdater.js.map +1 -0
  256. package/dist/locale/en.d.ts +3 -0
  257. package/dist/locale/en.d.ts.map +1 -0
  258. package/dist/locale/en.js +436 -0
  259. package/dist/locale/en.js.map +1 -0
  260. package/dist/locale/index.d.ts +28 -0
  261. package/dist/locale/index.d.ts.map +1 -0
  262. package/dist/locale/index.js +89 -0
  263. package/dist/locale/index.js.map +1 -0
  264. package/dist/locale/ko.d.ts +3 -0
  265. package/dist/locale/ko.d.ts.map +1 -0
  266. package/dist/locale/ko.js +436 -0
  267. package/dist/locale/ko.js.map +1 -0
  268. package/dist/locale/prompts/en.d.ts +3 -0
  269. package/dist/locale/prompts/en.d.ts.map +1 -0
  270. package/dist/locale/prompts/en.js +278 -0
  271. package/dist/locale/prompts/en.js.map +1 -0
  272. package/dist/locale/prompts/ko.d.ts +3 -0
  273. package/dist/locale/prompts/ko.d.ts.map +1 -0
  274. package/dist/locale/prompts/ko.js +279 -0
  275. package/dist/locale/prompts/ko.js.map +1 -0
  276. package/dist/locale/types.d.ts +407 -0
  277. package/dist/locale/types.d.ts.map +1 -0
  278. package/dist/locale/types.js +5 -0
  279. package/dist/locale/types.js.map +1 -0
  280. package/dist/memory/codex.d.ts +93 -0
  281. package/dist/memory/codex.d.ts.map +1 -0
  282. package/dist/memory/codex.js +366 -0
  283. package/dist/memory/codex.js.map +1 -0
  284. package/dist/memory/compaction.d.ts +21 -0
  285. package/dist/memory/compaction.d.ts.map +1 -0
  286. package/dist/memory/compaction.js +205 -0
  287. package/dist/memory/compaction.js.map +1 -0
  288. package/dist/memory/index.d.ts +13 -0
  289. package/dist/memory/index.d.ts.map +1 -0
  290. package/dist/memory/index.js +13 -0
  291. package/dist/memory/index.js.map +1 -0
  292. package/dist/memory/memoryCore.d.ts +178 -0
  293. package/dist/memory/memoryCore.d.ts.map +1 -0
  294. package/dist/memory/memoryCore.js +623 -0
  295. package/dist/memory/memoryCore.js.map +1 -0
  296. package/dist/memory/memoryOps.d.ts +90 -0
  297. package/dist/memory/memoryOps.d.ts.map +1 -0
  298. package/dist/memory/memoryOps.js +606 -0
  299. package/dist/memory/memoryOps.js.map +1 -0
  300. package/dist/orchestration/conflictDetector.d.ts +15 -0
  301. package/dist/orchestration/conflictDetector.d.ts.map +1 -0
  302. package/dist/orchestration/conflictDetector.js +130 -0
  303. package/dist/orchestration/conflictDetector.js.map +1 -0
  304. package/dist/orchestration/decisionEngine.d.ts +177 -0
  305. package/dist/orchestration/decisionEngine.d.ts.map +1 -0
  306. package/dist/orchestration/decisionEngine.js +496 -0
  307. package/dist/orchestration/decisionEngine.js.map +1 -0
  308. package/dist/orchestration/index.d.ts +5 -0
  309. package/dist/orchestration/index.d.ts.map +1 -0
  310. package/dist/orchestration/index.js +5 -0
  311. package/dist/orchestration/index.js.map +1 -0
  312. package/dist/orchestration/taskParser.d.ts +67 -0
  313. package/dist/orchestration/taskParser.d.ts.map +1 -0
  314. package/dist/orchestration/taskParser.js +542 -0
  315. package/dist/orchestration/taskParser.js.map +1 -0
  316. package/dist/orchestration/taskScheduler.d.ts +141 -0
  317. package/dist/orchestration/taskScheduler.d.ts.map +1 -0
  318. package/dist/orchestration/taskScheduler.js +317 -0
  319. package/dist/orchestration/taskScheduler.js.map +1 -0
  320. package/dist/orchestration/workflow.d.ts +145 -0
  321. package/dist/orchestration/workflow.d.ts.map +1 -0
  322. package/dist/orchestration/workflow.js +301 -0
  323. package/dist/orchestration/workflow.js.map +1 -0
  324. package/dist/runners/cliRunner.d.ts +11 -0
  325. package/dist/runners/cliRunner.d.ts.map +1 -0
  326. package/dist/runners/cliRunner.js +194 -0
  327. package/dist/runners/cliRunner.js.map +1 -0
  328. package/dist/support/apiCache.d.ts +85 -0
  329. package/dist/support/apiCache.d.ts.map +1 -0
  330. package/dist/support/apiCache.js +163 -0
  331. package/dist/support/apiCache.js.map +1 -0
  332. package/dist/support/chat.d.ts +3 -0
  333. package/dist/support/chat.d.ts.map +1 -0
  334. package/dist/support/chat.js +304 -0
  335. package/dist/support/chat.js.map +1 -0
  336. package/dist/support/chatBackend.d.ts +25 -0
  337. package/dist/support/chatBackend.d.ts.map +1 -0
  338. package/dist/support/chatBackend.js +235 -0
  339. package/dist/support/chatBackend.js.map +1 -0
  340. package/dist/support/chatMemory.d.ts +71 -0
  341. package/dist/support/chatMemory.d.ts.map +1 -0
  342. package/dist/support/chatMemory.js +119 -0
  343. package/dist/support/chatMemory.js.map +1 -0
  344. package/dist/support/chatTui.d.ts +3 -0
  345. package/dist/support/chatTui.d.ts.map +1 -0
  346. package/dist/support/chatTui.js +998 -0
  347. package/dist/support/chatTui.js.map +1 -0
  348. package/dist/support/costTracker.d.ts +29 -0
  349. package/dist/support/costTracker.d.ts.map +1 -0
  350. package/dist/support/costTracker.js +113 -0
  351. package/dist/support/costTracker.js.map +1 -0
  352. package/dist/support/dashboardHtml.d.ts +3 -0
  353. package/dist/support/dashboardHtml.d.ts.map +1 -0
  354. package/dist/support/dashboardHtml.js +2070 -0
  355. package/dist/support/dashboardHtml.js.map +1 -0
  356. package/dist/support/delete-beliefs.d.ts +2 -0
  357. package/dist/support/delete-beliefs.d.ts.map +1 -0
  358. package/dist/support/delete-beliefs.js +34 -0
  359. package/dist/support/delete-beliefs.js.map +1 -0
  360. package/dist/support/dev.d.ts +55 -0
  361. package/dist/support/dev.d.ts.map +1 -0
  362. package/dist/support/dev.js +298 -0
  363. package/dist/support/dev.js.map +1 -0
  364. package/dist/support/editParser.d.ts +37 -0
  365. package/dist/support/editParser.d.ts.map +1 -0
  366. package/dist/support/editParser.js +365 -0
  367. package/dist/support/editParser.js.map +1 -0
  368. package/dist/support/gitStatus.d.ts +21 -0
  369. package/dist/support/gitStatus.d.ts.map +1 -0
  370. package/dist/support/gitStatus.js +108 -0
  371. package/dist/support/gitStatus.js.map +1 -0
  372. package/dist/support/gitTracker.d.ts +30 -0
  373. package/dist/support/gitTracker.d.ts.map +1 -0
  374. package/dist/support/gitTracker.js +143 -0
  375. package/dist/support/gitTracker.js.map +1 -0
  376. package/dist/support/index.d.ts +13 -0
  377. package/dist/support/index.d.ts.map +1 -0
  378. package/dist/support/index.js +13 -0
  379. package/dist/support/index.js.map +1 -0
  380. package/dist/support/planner.d.ts +58 -0
  381. package/dist/support/planner.d.ts.map +1 -0
  382. package/dist/support/planner.js +395 -0
  383. package/dist/support/planner.js.map +1 -0
  384. package/dist/support/projectMapper.d.ts +46 -0
  385. package/dist/support/projectMapper.d.ts.map +1 -0
  386. package/dist/support/projectMapper.js +259 -0
  387. package/dist/support/projectMapper.js.map +1 -0
  388. package/dist/support/quotaTracker.d.ts +29 -0
  389. package/dist/support/quotaTracker.d.ts.map +1 -0
  390. package/dist/support/quotaTracker.js +89 -0
  391. package/dist/support/quotaTracker.js.map +1 -0
  392. package/dist/support/rateLimiter.d.ts +101 -0
  393. package/dist/support/rateLimiter.d.ts.map +1 -0
  394. package/dist/support/rateLimiter.js +219 -0
  395. package/dist/support/rateLimiter.js.map +1 -0
  396. package/dist/support/rollback.d.ts +61 -0
  397. package/dist/support/rollback.d.ts.map +1 -0
  398. package/dist/support/rollback.js +328 -0
  399. package/dist/support/rollback.js.map +1 -0
  400. package/dist/support/stuckDetector.d.ts +68 -0
  401. package/dist/support/stuckDetector.d.ts.map +1 -0
  402. package/dist/support/stuckDetector.js +174 -0
  403. package/dist/support/stuckDetector.js.map +1 -0
  404. package/dist/support/timeWindow.d.ts +60 -0
  405. package/dist/support/timeWindow.d.ts.map +1 -0
  406. package/dist/support/timeWindow.js +236 -0
  407. package/dist/support/timeWindow.js.map +1 -0
  408. package/dist/support/web.d.ts +11 -0
  409. package/dist/support/web.d.ts.map +1 -0
  410. package/dist/support/web.js +938 -0
  411. package/dist/support/web.js.map +1 -0
  412. package/dist/support/workflowLinear.d.ts +99 -0
  413. package/dist/support/workflowLinear.d.ts.map +1 -0
  414. package/dist/support/workflowLinear.js +257 -0
  415. package/dist/support/workflowLinear.js.map +1 -0
  416. package/dist/support/worktreeManager.d.ts +20 -0
  417. package/dist/support/worktreeManager.d.ts.map +1 -0
  418. package/dist/support/worktreeManager.js +144 -0
  419. package/dist/support/worktreeManager.js.map +1 -0
  420. package/dist/taskState/store.d.ts +101 -0
  421. package/dist/taskState/store.d.ts.map +1 -0
  422. package/dist/taskState/store.js +346 -0
  423. package/dist/taskState/store.js.map +1 -0
  424. package/package.json +70 -0
  425. package/templates/AGENTS.md +432 -0
  426. package/templates/BOOT.md +25 -0
  427. package/templates/BOOTSTRAP.md +50 -0
  428. package/templates/CHANGELOG_AUDIT.md +74 -0
  429. package/templates/HEARTBEAT.md +86 -0
  430. package/templates/IDENTITY.md +27 -0
  431. package/templates/ISSUE_ANALYSIS.md +31 -0
  432. package/templates/PR_LAND.md +75 -0
  433. package/templates/PR_REVIEW.md +97 -0
  434. package/templates/SOUL.dev.md +52 -0
  435. package/templates/SOUL.md +81 -0
  436. package/templates/TOOLS.md +52 -0
  437. package/templates/USER.md +22 -0
@@ -0,0 +1,68 @@
1
+ export interface StuckThresholds {
2
+ sameOutputRepeat: number;
3
+ sameErrorRepeat: number;
4
+ revisionLoop: number;
5
+ monologue: number;
6
+ }
7
+ export interface HistoryEntry {
8
+ stage: string;
9
+ success: boolean;
10
+ output?: string;
11
+ error?: string;
12
+ decision?: string;
13
+ timestamp: number;
14
+ }
15
+ export interface StuckResult {
16
+ isStuck: boolean;
17
+ reason?: string;
18
+ suggestion?: string;
19
+ }
20
+ /**
21
+ * Stuck Detection main class
22
+ */
23
+ export declare class StuckDetector {
24
+ private history;
25
+ private thresholds;
26
+ constructor(thresholds?: Partial<StuckThresholds>);
27
+ /**
28
+ * Add entry to history
29
+ */
30
+ addEntry(entry: HistoryEntry): void;
31
+ /**
32
+ * Check for stuck state
33
+ */
34
+ check(): StuckResult;
35
+ /**
36
+ * Detect same error loop
37
+ */
38
+ private detectErrorLoop;
39
+ /**
40
+ * Detect REVISE infinite loop
41
+ */
42
+ private detectRevisionLoop;
43
+ /**
44
+ * Detect same output repeat
45
+ */
46
+ private detectOutputRepeat;
47
+ /**
48
+ * Detect monologue (single stage executing repeatedly)
49
+ */
50
+ private detectMonologue;
51
+ /**
52
+ * Output hash (for simple comparison)
53
+ */
54
+ private hashOutput;
55
+ /**
56
+ * Reset history
57
+ */
58
+ reset(): void;
59
+ /**
60
+ * Get current history
61
+ */
62
+ getHistory(): HistoryEntry[];
63
+ }
64
+ /**
65
+ * Create detector instance (can be created per session)
66
+ */
67
+ export declare function createStuckDetector(thresholds?: Partial<StuckThresholds>): StuckDetector;
68
+ //# sourceMappingURL=stuckDetector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stuckDetector.d.ts","sourceRoot":"","sources":["../../src/support/stuckDetector.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,eAAe;IAC9B,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AASD;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,OAAO,CAAsB;IACrC,OAAO,CAAC,UAAU,CAAkB;gBAExB,UAAU,GAAE,OAAO,CAAC,eAAe,CAAM;IAIrD;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IASnC;;OAEG;IACH,KAAK,IAAI,WAAW;IAwBpB;;OAEG;IACH,OAAO,CAAC,eAAe;IA0BvB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IA2B1B;;OAEG;IACH,OAAO,CAAC,kBAAkB;IA0B1B;;OAEG;IACH,OAAO,CAAC,eAAe;IAsBvB;;OAEG;IACH,OAAO,CAAC,UAAU;IAWlB;;OAEG;IACH,KAAK,IAAI,IAAI;IAIb;;OAEG;IACH,UAAU,IAAI,YAAY,EAAE;CAG7B;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GACpC,aAAa,CAEf"}
@@ -0,0 +1,174 @@
1
+ // ============================================
2
+ // OpenSwarm - Stuck Detector
3
+ // OpenHands-style infinite loop detection
4
+ // ============================================
5
+ const DEFAULT_THRESHOLDS = {
6
+ sameOutputRepeat: 3,
7
+ sameErrorRepeat: 2,
8
+ revisionLoop: 4,
9
+ monologue: 6,
10
+ };
11
+ /**
12
+ * Stuck Detection main class
13
+ */
14
+ export class StuckDetector {
15
+ history = [];
16
+ thresholds;
17
+ constructor(thresholds = {}) {
18
+ this.thresholds = { ...DEFAULT_THRESHOLDS, ...thresholds };
19
+ }
20
+ /**
21
+ * Add entry to history
22
+ */
23
+ addEntry(entry) {
24
+ this.history.push(entry);
25
+ // Keep only the last 20 entries
26
+ if (this.history.length > 20) {
27
+ this.history = this.history.slice(-20);
28
+ }
29
+ }
30
+ /**
31
+ * Check for stuck state
32
+ */
33
+ check() {
34
+ if (this.history.length < 2) {
35
+ return { isStuck: false };
36
+ }
37
+ // 1. Detect same error loop
38
+ const errorLoop = this.detectErrorLoop();
39
+ if (errorLoop.isStuck)
40
+ return errorLoop;
41
+ // 2. Detect REVISE infinite loop
42
+ const revisionLoop = this.detectRevisionLoop();
43
+ if (revisionLoop.isStuck)
44
+ return revisionLoop;
45
+ // 3. Detect same output repeat
46
+ const outputRepeat = this.detectOutputRepeat();
47
+ if (outputRepeat.isStuck)
48
+ return outputRepeat;
49
+ // 4. Detect Worker monologue (continuous execution without Reviewer)
50
+ const monologue = this.detectMonologue();
51
+ if (monologue.isStuck)
52
+ return monologue;
53
+ return { isStuck: false };
54
+ }
55
+ /**
56
+ * Detect same error loop
57
+ */
58
+ detectErrorLoop() {
59
+ const recentErrors = this.history
60
+ .filter(e => !e.success && e.error)
61
+ .slice(-this.thresholds.sameErrorRepeat);
62
+ if (recentErrors.length < this.thresholds.sameErrorRepeat) {
63
+ return { isStuck: false };
64
+ }
65
+ // Check if all errors are the same (compare first 100 chars)
66
+ const firstError = recentErrors[0].error?.slice(0, 100);
67
+ const allSame = recentErrors.every(e => e.error?.slice(0, 100) === firstError);
68
+ if (allSame) {
69
+ return {
70
+ isStuck: true,
71
+ reason: `Same error repeated ${recentErrors.length} times`,
72
+ suggestion: 'Task may require manual intervention or different approach',
73
+ };
74
+ }
75
+ return { isStuck: false };
76
+ }
77
+ /**
78
+ * Detect REVISE infinite loop
79
+ */
80
+ detectRevisionLoop() {
81
+ const recentReviews = this.history
82
+ .filter(e => e.stage === 'reviewer' && e.decision)
83
+ .slice(-this.thresholds.revisionLoop);
84
+ if (recentReviews.length < this.thresholds.revisionLoop) {
85
+ return { isStuck: false };
86
+ }
87
+ // Check if all are REVISE
88
+ const allRevise = recentReviews.every(e => e.decision?.toUpperCase() === 'REVISE' ||
89
+ e.decision?.toUpperCase() === 'REVISION_NEEDED' ||
90
+ e.decision?.toUpperCase() === 'REVISION NEEDED');
91
+ if (allRevise) {
92
+ return {
93
+ isStuck: true,
94
+ reason: `Reviewer requested revision ${recentReviews.length} times consecutively`,
95
+ suggestion: 'Task may be too complex or requirements unclear. Consider breaking down or clarifying.',
96
+ };
97
+ }
98
+ return { isStuck: false };
99
+ }
100
+ /**
101
+ * Detect same output repeat
102
+ */
103
+ detectOutputRepeat() {
104
+ const recentOutputs = this.history
105
+ .filter(e => e.output)
106
+ .slice(-this.thresholds.sameOutputRepeat);
107
+ if (recentOutputs.length < this.thresholds.sameOutputRepeat) {
108
+ return { isStuck: false };
109
+ }
110
+ // Compare output hash (first 500 chars)
111
+ const firstHash = this.hashOutput(recentOutputs[0].output);
112
+ const allSame = recentOutputs.every(e => this.hashOutput(e.output) === firstHash);
113
+ if (allSame) {
114
+ return {
115
+ isStuck: true,
116
+ reason: `Same output produced ${recentOutputs.length} times`,
117
+ suggestion: 'Agent may be stuck in a loop. Consider resetting context.',
118
+ };
119
+ }
120
+ return { isStuck: false };
121
+ }
122
+ /**
123
+ * Detect monologue (single stage executing repeatedly)
124
+ */
125
+ detectMonologue() {
126
+ const recent = this.history.slice(-this.thresholds.monologue);
127
+ if (recent.length < this.thresholds.monologue) {
128
+ return { isStuck: false };
129
+ }
130
+ // Check if all are the same stage
131
+ const firstStage = recent[0].stage;
132
+ const allSameStage = recent.every(e => e.stage === firstStage);
133
+ if (allSameStage) {
134
+ return {
135
+ isStuck: true,
136
+ reason: `Stage "${firstStage}" executed ${recent.length} times without progression`,
137
+ suggestion: 'Pipeline may be stuck. Check stage transitions.',
138
+ };
139
+ }
140
+ return { isStuck: false };
141
+ }
142
+ /**
143
+ * Output hash (for simple comparison)
144
+ */
145
+ hashOutput(output) {
146
+ const normalized = output.slice(0, 500).toLowerCase().replace(/\s+/g, ' ');
147
+ let hash = 0;
148
+ for (let i = 0; i < normalized.length; i++) {
149
+ const char = normalized.charCodeAt(i);
150
+ hash = ((hash << 5) - hash) + char;
151
+ hash = hash & hash;
152
+ }
153
+ return hash.toString(16);
154
+ }
155
+ /**
156
+ * Reset history
157
+ */
158
+ reset() {
159
+ this.history = [];
160
+ }
161
+ /**
162
+ * Get current history
163
+ */
164
+ getHistory() {
165
+ return [...this.history];
166
+ }
167
+ }
168
+ /**
169
+ * Create detector instance (can be created per session)
170
+ */
171
+ export function createStuckDetector(thresholds) {
172
+ return new StuckDetector(thresholds);
173
+ }
174
+ //# sourceMappingURL=stuckDetector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stuckDetector.js","sourceRoot":"","sources":["../../src/support/stuckDetector.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,6BAA6B;AAC7B,0CAA0C;AAC1C,+CAA+C;AAwB/C,MAAM,kBAAkB,GAAoB;IAC1C,gBAAgB,EAAE,CAAC;IACnB,eAAe,EAAE,CAAC;IAClB,YAAY,EAAE,CAAC;IACf,SAAS,EAAE,CAAC;CACb,CAAC;AAEF;;GAEG;AACH,MAAM,OAAO,aAAa;IAChB,OAAO,GAAmB,EAAE,CAAC;IAC7B,UAAU,CAAkB;IAEpC,YAAY,aAAuC,EAAE;QACnD,IAAI,CAAC,UAAU,GAAG,EAAE,GAAG,kBAAkB,EAAE,GAAG,UAAU,EAAE,CAAC;IAC7D,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,KAAmB;QAC1B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAEzB,gCAAgC;QAChC,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,EAAE,EAAE,CAAC;YAC7B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;QACzC,CAAC;IACH,CAAC;IAED;;OAEG;IACH,KAAK;QACH,IAAI,IAAI,C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export interface TimeRange {
6
+ start: string;
7
+ end: string;
8
+ }
9
+ /**
10
+ * Time window configuration
11
+ */
12
+ export interface TimeWindowConfig {
13
+ /** Whether time restrictions are enabled */
14
+ enabled: boolean;
15
+ /** Allowed work time ranges (OR condition) */
16
+ allowedWindows: TimeRange[];
17
+ /** Blocked time ranges (e.g. market hours) - takes priority over allowedWindows */
18
+ blockedWindows: TimeRange[];
19
+ /** Restricted days only (0=Sun, 1=Mon, ..., 6=Sat) */
20
+ restrictedDays?: number[];
21
+ /** Timezone (default: Asia/Seoul) */
22
+ timezone?: string;
23
+ }
24
+ /**
25
+ * Default config: allow only off-hours, block during market hours
26
+ */
27
+ export declare const DEFAULT_TIME_WINDOW: TimeWindowConfig;
28
+ /**
29
+ * Check if work is allowed at the current time
30
+ */
31
+ export declare function isWorkAllowed(config?: TimeWindowConfig): {
32
+ allowed: boolean;
33
+ reason: string;
34
+ currentTime: string;
35
+ nextAllowedTime?: string;
36
+ };
37
+ /**
38
+ * Get current market status
39
+ */
40
+ export declare function getMarketStatus(): {
41
+ status: 'pre_market' | 'regular' | 'post_market' | 'closed';
42
+ description: string;
43
+ canWork: boolean;
44
+ };
45
+ /**
46
+ * Pre-work time check (guard function)
47
+ * Throws error if blocked
48
+ */
49
+ export declare function assertWorkAllowed(taskName?: string): void;
50
+ /**
51
+ * Time window status summary (for Discord reporting)
52
+ */
53
+ export declare function getTimeWindowSummary(): string;
54
+ export declare function setTimeWindowConfig(config: Partial<TimeWindowConfig>): void;
55
+ export declare function getTimeWindowConfig(): TimeWindowConfig;
56
+ /**
57
+ * Run isWorkAllowed with current configuration
58
+ */
59
+ export declare function checkWorkAllowed(): ReturnType<typeof isWorkAllowed>;
60
+ //# sourceMappingURL=timeWindow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeWindow.d.ts","sourceRoot":"","sources":["../../src/support/timeWindow.ts"],"names":[],"mappings":"AAOA;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,4CAA4C;IAC5C,OAAO,EAAE,OAAO,CAAC;IAEjB,8CAA8C;IAC9C,cAAc,EAAE,SAAS,EAAE,CAAC;IAE5B,mFAAmF;IACnF,cAAc,EAAE,SAAS,EAAE,CAAC;IAE5B,sDAAsD;IACtD,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAE1B,qCAAqC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,gBAcjC,CAAC;AA0CF;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,GAAE,gBAAsC,GAAG;IAC7E,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CA+DA;AA6CD;;GAEG;AACH,wBAAgB,eAAe,IAAI;IACjC,MAAM,EAAE,YAAY,GAAG,SAAS,GAAG,aAAa,GAAG,QAAQ,CAAC;IAC5D,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;CAClB,CAuCA;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAczD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAW7C;AAOD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAE3E;AAED,wBAAgB,mBAAmB,IAAI,gBAAgB,CAEtD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,UAAU,CAAC,OAAO,aAAa,CAAC,CAEnE"}
@@ -0,0 +1,236 @@
1
+ // ============================================
2
+ // OpenSwarm - Time Window Management
3
+ // Agent work time restriction module
4
+ // ============================================
5
+ import { t } from '../locale/index.js';
6
+ /**
7
+ * Default config: allow only off-hours, block during market hours
8
+ */
9
+ export const DEFAULT_TIME_WINDOW = {
10
+ enabled: true,
11
+ // Allow evening/night work: 18:30 ~ 08:00
12
+ allowedWindows: [
13
+ { start: '18:30', end: '23:59' },
14
+ { start: '00:00', end: '08:00' },
15
+ ],
16
+ // Explicitly block market hours (08:30 ~ 18:00)
17
+ blockedWindows: [
18
+ { start: '08:30', end: '18:00' },
19
+ ],
20
+ // Restrict weekdays only (Mon-Fri)
21
+ restrictedDays: [1, 2, 3, 4, 5],
22
+ timezone: 'Asia/Seoul',
23
+ };
24
+ /**
25
+ * Convert time string to minutes
26
+ * "09:30" -> 570
27
+ */
28
+ function timeToMinutes(time) {
29
+ const [hours, minutes] = time.split(':').map(Number);
30
+ return hours * 60 + minutes;
31
+ }
32
+ /**
33
+ * Check if current time is within a specific range
34
+ */
35
+ function isInTimeRange(currentMinutes, range) {
36
+ const start = timeToMinutes(range.start);
37
+ const end = timeToMinutes(range.end);
38
+ // Handle midnight crossing (e.g. 22:00 ~ 06:00)
39
+ if (start > end) {
40
+ return currentMinutes >= start || currentMinutes <= end;
41
+ }
42
+ return currentMinutes >= start && currentMinutes <= end;
43
+ }
44
+ /**
45
+ * Get current KST time
46
+ */
47
+ function _getKSTTime() {
48
+ const now = new Date();
49
+ // Convert UTC to KST (UTC+9)
50
+ const kstOffset = 9 * 60; // in minutes
51
+ const utcMinutes = now.getUTCHours() * 60 + now.getUTCMinutes();
52
+ const kstMinutes = (utcMinutes + kstOffset) % (24 * 60);
53
+ const kstDate = new Date(now);
54
+ kstDate.setUTCHours(Math.floor(kstMinutes / 60), kstMinutes % 60, 0, 0);
55
+ return kstDate;
56
+ }
57
+ /**
58
+ * Check if work is allowed at the current time
59
+ */
60
+ export function isWorkAllowed(config = DEFAULT_TIME_WINDOW) {
61
+ // Always allow if disabled
62
+ if (!config.enabled) {
63
+ return {
64
+ allowed: true,
65
+ reason: t('timeWindow.disabled'),
66
+ currentTime: formatCurrentTime(),
67
+ };
68
+ }
69
+ const now = new Date();
70
+ const kstOffset = 9 * 60;
71
+ const utcMinutes = now.getUTCHours() * 60 + now.getUTCMinutes();
72
+ const kstMinutes = (utcMinutes + kstOffset) % (24 * 60);
73
+ // Calculate day of week (KST-based)
74
+ // Calculate day of week (KST-based)
75
+ const kstDay = (now.getUTCDay() + (utcMinutes + kstOffset >= 24 * 60 ? 1 : 0)) % 7;
76
+ const currentTimeStr = `${String(Math.floor(kstMinutes / 60)).padStart(2, '0')}:${String(kstMinutes % 60).padStart(2, '0')}`;
77
+ // Check day-of-week restrictions
78
+ if (config.restrictedDays && config.restrictedDays.length > 0) {
79
+ if (!config.restrictedDays.includes(kstDay)) {
80
+ return {
81
+ allowed: true,
82
+ reason: t('timeWindow.weekendOrUnrestricted'),
83
+ currentTime: currentTimeStr,
84
+ };
85
+ }
86
+ }
87
+ // Check blocked time ranges (highest priority)
88
+ for (const blocked of config.blockedWindows) {
89
+ if (isInTimeRange(kstMinutes, blocked)) {
90
+ return {
91
+ allowed: false,
92
+ reason: t('timeWindow.blockedWindow', { start: blocked.start, end: blocked.end }),
93
+ currentTime: currentTimeStr,
94
+ nextAllowedTime: blocked.end,
95
+ };
96
+ }
97
+ }
98
+ // Check allowed time ranges
99
+ for (const allowed of config.allowedWindows) {
100
+ if (isInTimeRange(kstMinutes, allowed)) {
101
+ return {
102
+ allowed: true,
103
+ reason: t('timeWindow.allowedWindow', { start: allowed.start, end: allowed.end }),
104
+ currentTime: currentTimeStr,
105
+ };
106
+ }
107
+ }
108
+ // Not in any allowed time range
109
+ const nextWindow = findNextAllowedWindow(kstMinutes, config.allowedWindows);
110
+ return {
111
+ allowed: false,
112
+ reason: t('timeWindow.outsideAllowed'),
113
+ currentTime: currentTimeStr,
114
+ nextAllowedTime: nextWindow,
115
+ };
116
+ }
117
+ /**
118
+ * Find next allowed time window
119
+ */
120
+ function findNextAllowedWindow(currentMinutes, windows) {
121
+ // Find the nearest start time after current time
122
+ let nearestStart = null;
123
+ for (const window of windows) {
124
+ const start = timeToMinutes(window.start);
125
+ if (start > currentMinutes) {
126
+ if (nearestStart === null || start < nearestStart) {
127
+ nearestStart = start;
128
+ }
129
+ }
130
+ }
131
+ // If no start time after today, use tomorrow's first window
132
+ if (nearestStart === null && windows.length > 0) {
133
+ nearestStart = timeToMinutes(windows[0].start);
134
+ // Indicate "tomorrow" with +24h (display only)
135
+ return t('timeWindow.tomorrowAt', { time: windows[0].start });
136
+ }
137
+ if (nearestStart !== null) {
138
+ return `${String(Math.floor(nearestStart / 60)).padStart(2, '0')}:${String(nearestStart % 60).padStart(2, '0')}`;
139
+ }
140
+ return undefined;
141
+ }
142
+ /**
143
+ * Format current time
144
+ */
145
+ function formatCurrentTime() {
146
+ const now = new Date();
147
+ const kstOffset = 9 * 60;
148
+ const utcMinutes = now.getUTCHours() * 60 + now.getUTCMinutes();
149
+ const kstMinutes = (utcMinutes + kstOffset) % (24 * 60);
150
+ return `${String(Math.floor(kstMinutes / 60)).padStart(2, '0')}:${String(kstMinutes % 60).padStart(2, '0')} KST`;
151
+ }
152
+ /**
153
+ * Get current market status
154
+ */
155
+ export function getMarketStatus() {
156
+ const result = isWorkAllowed();
157
+ const time = result.currentTime;
158
+ const [hours, minutes] = time.split(':').map(Number);
159
+ const totalMinutes = hours * 60 + minutes;
160
+ // Pre-market hours: 08:30 ~ 09:00
161
+ if (totalMinutes >= 510 && totalMinutes < 540) {
162
+ return {
163
+ status: 'pre_market',
164
+ description: t('timeWindow.marketStatus.preMarket'),
165
+ canWork: false,
166
+ };
167
+ }
168
+ // Regular market hours: 09:00 ~ 15:30
169
+ if (totalMinutes >= 540 && totalMinutes < 930) {
170
+ return {
171
+ status: 'regular',
172
+ description: t('timeWindow.marketStatus.regular'),
173
+ canWork: false,
174
+ };
175
+ }
176
+ // Post-market hours: 15:40 ~ 18:00
177
+ if (totalMinutes >= 940 && totalMinutes < 1080) {
178
+ return {
179
+ status: 'post_market',
180
+ description: t('timeWindow.marketStatus.postMarket'),
181
+ canWork: false,
182
+ };
183
+ }
184
+ // Market closed
185
+ return {
186
+ status: 'closed',
187
+ description: t('timeWindow.marketStatus.closed'),
188
+ canWork: true,
189
+ };
190
+ }
191
+ /**
192
+ * Pre-work time check (guard function)
193
+ * Throws error if blocked
194
+ */
195
+ export function assertWorkAllowed(taskName) {
196
+ const result = isWorkAllowed();
197
+ if (!result.allowed) {
198
+ const msg = taskName
199
+ ? t('timeWindow.taskBlocked', { task: taskName, reason: result.reason, time: result.currentTime })
200
+ : t('timeWindow.taskBlockedNoName', { reason: result.reason, time: result.currentTime });
201
+ const nextTime = result.nextAllowedTime
202
+ ? t('timeWindow.nextAllowedTime', { time: result.nextAllowedTime })
203
+ : '';
204
+ throw new Error(msg + nextTime);
205
+ }
206
+ }
207
+ /**
208
+ * Time window status summary (for Discord reporting)
209
+ */
210
+ export function getTimeWindowSummary() {
211
+ const work = isWorkAllowed();
212
+ const market = getMarketStatus();
213
+ const icon = work.allowed ? '🟢' : '🔴';
214
+ const status = work.allowed ? t('timeWindow.workAllowed') : t('timeWindow.workBlocked');
215
+ return `${icon} **${status}**
216
+ ${t('timeWindow.currentTime', { time: work.currentTime })}
217
+ ${t('timeWindow.status', { description: market.description })}
218
+ ${!work.allowed && work.nextAllowedTime ? t('timeWindow.nextAllowed', { time: work.nextAllowedTime }) : ''}`.trim();
219
+ }
220
+ /**
221
+ * Allow external configuration updates
222
+ */
223
+ let currentConfig = { ...DEFAULT_TIME_WINDOW };
224
+ export function setTimeWindowConfig(config) {
225
+ currentConfig = { ...currentConfig, ...config };
226
+ }
227
+ export function getTimeWindowConfig() {
228
+ return { ...currentConfig };
229
+ }
230
+ /**
231
+ * Run isWorkAllowed with current configuration
232
+ */
233
+ export function checkWorkAllowed() {
234
+ return isWorkAllowed(currentConfig);
235
+ }
236
+ //# sourceMappingURL=timeWindow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeWindow.js","sourceRoot":"","sources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a,CAAC,CAAC;AACtC,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { AutonomousRunner } from '../automation/autonomousRunner.js';
2
+ /**
3
+ * Set runner reference (call after autonomous runner is initialized)
4
+ */
5
+ export declare function setWebRunner(runner: AutonomousRunner): void;
6
+ export declare function startWebServer(port?: number): Promise<void>;
7
+ /**
8
+ * Stop the web server
9
+ */
10
+ export declare function stopWebServer(): Promise<void>;
11
+ //# sourceMappingURL=web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web.d.ts","sourceRoot":"","sources":["../../src/support/web.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AA8E1E;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAoB3D;AAYD,wBAAsB,cAAc,CAAC,IAAI,GAAE,MAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CA40BvE;AAED;;GAEG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAKnD"}