@bosun-sh/logbook 1.1.0 → 2.0.1

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 (461) hide show
  1. package/CHANGELOG.md +145 -0
  2. package/README.md +249 -318
  3. package/bin/logbook.cjs +18 -0
  4. package/dist/context/attachments.d.ts +55 -0
  5. package/dist/context/attachments.d.ts.map +1 -0
  6. package/dist/context/attachments.js +329 -0
  7. package/dist/context/attachments.js.map +1 -0
  8. package/dist/context/create.d.ts +31 -0
  9. package/dist/context/create.d.ts.map +1 -0
  10. package/dist/context/create.js +101 -0
  11. package/dist/context/create.js.map +1 -0
  12. package/dist/context/delete.d.ts +20 -0
  13. package/dist/context/delete.d.ts.map +1 -0
  14. package/dist/context/delete.js +55 -0
  15. package/dist/context/delete.js.map +1 -0
  16. package/dist/context/get.d.ts +20 -0
  17. package/dist/context/get.d.ts.map +1 -0
  18. package/dist/context/get.js +55 -0
  19. package/dist/context/get.js.map +1 -0
  20. package/dist/context/list.d.ts +30 -0
  21. package/dist/context/list.d.ts.map +1 -0
  22. package/dist/context/list.js +172 -0
  23. package/dist/context/list.js.map +1 -0
  24. package/dist/context/schema.d.ts +156 -0
  25. package/dist/context/schema.d.ts.map +1 -0
  26. package/dist/context/schema.js +34 -0
  27. package/dist/context/schema.js.map +1 -0
  28. package/dist/context/search.d.ts +27 -0
  29. package/dist/context/search.d.ts.map +1 -0
  30. package/dist/context/search.js +266 -0
  31. package/dist/context/search.js.map +1 -0
  32. package/dist/context/topics.d.ts +4 -0
  33. package/dist/context/topics.d.ts.map +1 -0
  34. package/dist/context/topics.js +54 -0
  35. package/dist/context/topics.js.map +1 -0
  36. package/dist/context/update.d.ts +29 -0
  37. package/dist/context/update.d.ts.map +1 -0
  38. package/dist/context/update.js +134 -0
  39. package/dist/context/update.js.map +1 -0
  40. package/dist/epic/cascade-delete.d.ts +30 -0
  41. package/dist/epic/cascade-delete.d.ts.map +1 -0
  42. package/dist/epic/cascade-delete.js +173 -0
  43. package/dist/epic/cascade-delete.js.map +1 -0
  44. package/dist/epic/create.d.ts +24 -0
  45. package/dist/epic/create.d.ts.map +1 -0
  46. package/dist/epic/create.js +54 -0
  47. package/dist/epic/create.js.map +1 -0
  48. package/dist/epic/delete.d.ts +21 -0
  49. package/dist/epic/delete.d.ts.map +1 -0
  50. package/dist/epic/delete.js +42 -0
  51. package/dist/epic/delete.js.map +1 -0
  52. package/dist/epic/get.d.ts +19 -0
  53. package/dist/epic/get.d.ts.map +1 -0
  54. package/dist/epic/get.js +31 -0
  55. package/dist/epic/get.js.map +1 -0
  56. package/dist/epic/list.d.ts +25 -0
  57. package/dist/epic/list.d.ts.map +1 -0
  58. package/dist/epic/list.js +114 -0
  59. package/dist/epic/list.js.map +1 -0
  60. package/dist/epic/rules.d.ts +34 -0
  61. package/dist/epic/rules.d.ts.map +1 -0
  62. package/dist/epic/rules.js +127 -0
  63. package/dist/epic/rules.js.map +1 -0
  64. package/dist/epic/schema.d.ts +85 -0
  65. package/dist/epic/schema.d.ts.map +1 -0
  66. package/dist/epic/schema.js +14 -0
  67. package/dist/epic/schema.js.map +1 -0
  68. package/dist/epic/update.d.ts +25 -0
  69. package/dist/epic/update.d.ts.map +1 -0
  70. package/dist/epic/update.js +69 -0
  71. package/dist/epic/update.js.map +1 -0
  72. package/dist/hook/list.d.ts +71 -0
  73. package/dist/hook/list.d.ts.map +1 -0
  74. package/dist/hook/list.js +364 -0
  75. package/dist/hook/list.js.map +1 -0
  76. package/dist/hook/ports.d.ts +16 -0
  77. package/dist/hook/ports.d.ts.map +1 -0
  78. package/dist/hook/ports.js +3 -0
  79. package/dist/hook/ports.js.map +1 -0
  80. package/dist/hook/run.d.ts +24 -0
  81. package/dist/hook/run.d.ts.map +1 -0
  82. package/dist/hook/run.js +185 -0
  83. package/dist/hook/run.js.map +1 -0
  84. package/dist/index.d.ts +31 -0
  85. package/dist/index.d.ts.map +1 -0
  86. package/dist/index.js +31 -0
  87. package/dist/index.js.map +1 -0
  88. package/dist/plugin/hook-tools.d.ts +8 -0
  89. package/dist/plugin/hook-tools.d.ts.map +1 -0
  90. package/dist/plugin/hook-tools.js +31 -0
  91. package/dist/plugin/hook-tools.js.map +1 -0
  92. package/dist/plugin/linear-pull-tool.d.ts +20 -0
  93. package/dist/plugin/linear-pull-tool.d.ts.map +1 -0
  94. package/dist/plugin/linear-pull-tool.js +19 -0
  95. package/dist/plugin/linear-pull-tool.js.map +1 -0
  96. package/dist/plugin/linear-push-tool.d.ts +20 -0
  97. package/dist/plugin/linear-push-tool.d.ts.map +1 -0
  98. package/dist/plugin/linear-push-tool.js +27 -0
  99. package/dist/plugin/linear-push-tool.js.map +1 -0
  100. package/dist/plugin/linear-setup-tool.d.ts +2 -0
  101. package/dist/plugin/linear-setup-tool.d.ts.map +1 -0
  102. package/dist/plugin/linear-setup-tool.js +22 -0
  103. package/dist/plugin/linear-setup-tool.js.map +1 -0
  104. package/dist/plugin/linear-status-tool.d.ts +10 -0
  105. package/dist/plugin/linear-status-tool.d.ts.map +1 -0
  106. package/dist/plugin/linear-status-tool.js +10 -0
  107. package/dist/plugin/linear-status-tool.js.map +1 -0
  108. package/dist/plugin/list.d.ts +15 -0
  109. package/dist/plugin/list.d.ts.map +1 -0
  110. package/dist/plugin/list.js +87 -0
  111. package/dist/plugin/list.js.map +1 -0
  112. package/dist/plugin/public-schemas.d.ts +42 -0
  113. package/dist/plugin/public-schemas.d.ts.map +1 -0
  114. package/dist/plugin/public-schemas.js +577 -0
  115. package/dist/plugin/public-schemas.js.map +1 -0
  116. package/dist/plugin/registry.d.ts +3 -0
  117. package/dist/plugin/registry.d.ts.map +1 -0
  118. package/dist/plugin/registry.js +3 -0
  119. package/dist/plugin/registry.js.map +1 -0
  120. package/dist/plugin/results.d.ts +8 -0
  121. package/dist/plugin/results.d.ts.map +1 -0
  122. package/dist/plugin/results.js +114 -0
  123. package/dist/plugin/results.js.map +1 -0
  124. package/dist/plugin/sync-conflict-tools.d.ts +2 -0
  125. package/dist/plugin/sync-conflict-tools.d.ts.map +1 -0
  126. package/dist/plugin/sync-conflict-tools.js +5 -0
  127. package/dist/plugin/sync-conflict-tools.js.map +1 -0
  128. package/dist/plugin/tool-registry.d.ts +23 -0
  129. package/dist/plugin/tool-registry.d.ts.map +1 -0
  130. package/dist/plugin/tool-registry.js +251 -0
  131. package/dist/plugin/tool-registry.js.map +1 -0
  132. package/dist/plugin/workspace-init-tool.d.ts +2 -0
  133. package/dist/plugin/workspace-init-tool.d.ts.map +1 -0
  134. package/dist/plugin/workspace-init-tool.js +16 -0
  135. package/dist/plugin/workspace-init-tool.js.map +1 -0
  136. package/dist/plugin/workspace-status-tool.d.ts +2 -0
  137. package/dist/plugin/workspace-status-tool.d.ts.map +1 -0
  138. package/dist/plugin/workspace-status-tool.js +15 -0
  139. package/dist/plugin/workspace-status-tool.js.map +1 -0
  140. package/dist/shared/ids.d.ts +3 -0
  141. package/dist/shared/ids.d.ts.map +1 -0
  142. package/dist/shared/ids.js +15 -0
  143. package/dist/shared/ids.js.map +1 -0
  144. package/dist/shared/pagination.d.ts +19 -0
  145. package/dist/shared/pagination.d.ts.map +1 -0
  146. package/dist/shared/pagination.js +110 -0
  147. package/dist/shared/pagination.js.map +1 -0
  148. package/dist/shared/result.d.ts +20 -0
  149. package/dist/shared/result.d.ts.map +1 -0
  150. package/dist/shared/result.js +6 -0
  151. package/dist/shared/result.js.map +1 -0
  152. package/dist/shared/schema/value-objects.d.ts +363 -0
  153. package/dist/shared/schema/value-objects.d.ts.map +1 -0
  154. package/dist/shared/schema/value-objects.js +112 -0
  155. package/dist/shared/schema/value-objects.js.map +1 -0
  156. package/dist/shared/storage/atomic-write.d.ts +25 -0
  157. package/dist/shared/storage/atomic-write.d.ts.map +1 -0
  158. package/dist/shared/storage/atomic-write.js +71 -0
  159. package/dist/shared/storage/atomic-write.js.map +1 -0
  160. package/dist/shared/storage/jsonl-repository.d.ts +85 -0
  161. package/dist/shared/storage/jsonl-repository.d.ts.map +1 -0
  162. package/dist/shared/storage/jsonl-repository.js +278 -0
  163. package/dist/shared/storage/jsonl-repository.js.map +1 -0
  164. package/dist/shared/storage/transaction.d.ts +3 -0
  165. package/dist/shared/storage/transaction.d.ts.map +1 -0
  166. package/dist/shared/storage/transaction.js +22 -0
  167. package/dist/shared/storage/transaction.js.map +1 -0
  168. package/dist/shared/time.d.ts +3 -0
  169. package/dist/shared/time.d.ts.map +1 -0
  170. package/dist/shared/time.js +3 -0
  171. package/dist/shared/time.js.map +1 -0
  172. package/dist/shared/version.d.ts +2 -0
  173. package/dist/shared/version.d.ts.map +1 -0
  174. package/dist/shared/version.js +2 -0
  175. package/dist/shared/version.js.map +1 -0
  176. package/dist/story/cascade-delete.d.ts +22 -0
  177. package/dist/story/cascade-delete.d.ts.map +1 -0
  178. package/dist/story/cascade-delete.js +117 -0
  179. package/dist/story/cascade-delete.js.map +1 -0
  180. package/dist/story/create.d.ts +30 -0
  181. package/dist/story/create.d.ts.map +1 -0
  182. package/dist/story/create.js +69 -0
  183. package/dist/story/create.js.map +1 -0
  184. package/dist/story/delete.d.ts +21 -0
  185. package/dist/story/delete.d.ts.map +1 -0
  186. package/dist/story/delete.js +42 -0
  187. package/dist/story/delete.js.map +1 -0
  188. package/dist/story/get.d.ts +19 -0
  189. package/dist/story/get.d.ts.map +1 -0
  190. package/dist/story/get.js +31 -0
  191. package/dist/story/get.js.map +1 -0
  192. package/dist/story/hierarchy.d.ts +20 -0
  193. package/dist/story/hierarchy.d.ts.map +1 -0
  194. package/dist/story/hierarchy.js +30 -0
  195. package/dist/story/hierarchy.js.map +1 -0
  196. package/dist/story/list.d.ts +25 -0
  197. package/dist/story/list.d.ts.map +1 -0
  198. package/dist/story/list.js +118 -0
  199. package/dist/story/list.js.map +1 -0
  200. package/dist/story/rules.d.ts +34 -0
  201. package/dist/story/rules.d.ts.map +1 -0
  202. package/dist/story/rules.js +100 -0
  203. package/dist/story/rules.js.map +1 -0
  204. package/dist/story/schema.d.ts +65 -0
  205. package/dist/story/schema.d.ts.map +1 -0
  206. package/dist/story/schema.js +14 -0
  207. package/dist/story/schema.js.map +1 -0
  208. package/dist/story/update.d.ts +23 -0
  209. package/dist/story/update.d.ts.map +1 -0
  210. package/dist/story/update.js +67 -0
  211. package/dist/story/update.js.map +1 -0
  212. package/dist/sync/base-snapshot.d.ts +38 -0
  213. package/dist/sync/base-snapshot.d.ts.map +1 -0
  214. package/dist/sync/base-snapshot.js +86 -0
  215. package/dist/sync/base-snapshot.js.map +1 -0
  216. package/dist/sync/conflict-tools.d.ts +75 -0
  217. package/dist/sync/conflict-tools.d.ts.map +1 -0
  218. package/dist/sync/conflict-tools.js +53 -0
  219. package/dist/sync/conflict-tools.js.map +1 -0
  220. package/dist/sync/conflicts.d.ts +201 -0
  221. package/dist/sync/conflicts.d.ts.map +1 -0
  222. package/dist/sync/conflicts.js +526 -0
  223. package/dist/sync/conflicts.js.map +1 -0
  224. package/dist/sync/deferred-providers.d.ts +2 -0
  225. package/dist/sync/deferred-providers.d.ts.map +1 -0
  226. package/dist/sync/deferred-providers.js +6 -0
  227. package/dist/sync/deferred-providers.js.map +1 -0
  228. package/dist/sync/events.d.ts +401 -0
  229. package/dist/sync/events.d.ts.map +1 -0
  230. package/dist/sync/events.js +357 -0
  231. package/dist/sync/events.js.map +1 -0
  232. package/dist/sync/external-links.d.ts +154 -0
  233. package/dist/sync/external-links.d.ts.map +1 -0
  234. package/dist/sync/external-links.js +306 -0
  235. package/dist/sync/external-links.js.map +1 -0
  236. package/dist/sync/linear/config.d.ts +60 -0
  237. package/dist/sync/linear/config.d.ts.map +1 -0
  238. package/dist/sync/linear/config.js +302 -0
  239. package/dist/sync/linear/config.js.map +1 -0
  240. package/dist/sync/linear/mapping.d.ts +115 -0
  241. package/dist/sync/linear/mapping.d.ts.map +1 -0
  242. package/dist/sync/linear/mapping.js +159 -0
  243. package/dist/sync/linear/mapping.js.map +1 -0
  244. package/dist/sync/linear/pull.d.ts +33 -0
  245. package/dist/sync/linear/pull.d.ts.map +1 -0
  246. package/dist/sync/linear/pull.js +376 -0
  247. package/dist/sync/linear/pull.js.map +1 -0
  248. package/dist/sync/linear/push.d.ts +34 -0
  249. package/dist/sync/linear/push.d.ts.map +1 -0
  250. package/dist/sync/linear/push.js +681 -0
  251. package/dist/sync/linear/push.js.map +1 -0
  252. package/dist/sync/linear/setup.d.ts +33 -0
  253. package/dist/sync/linear/setup.d.ts.map +1 -0
  254. package/dist/sync/linear/setup.js +129 -0
  255. package/dist/sync/linear/setup.js.map +1 -0
  256. package/dist/sync/linear/status.d.ts +35 -0
  257. package/dist/sync/linear/status.d.ts.map +1 -0
  258. package/dist/sync/linear/status.js +138 -0
  259. package/dist/sync/linear/status.js.map +1 -0
  260. package/dist/sync/linear/transport.d.ts +47 -0
  261. package/dist/sync/linear/transport.d.ts.map +1 -0
  262. package/dist/sync/linear/transport.js +249 -0
  263. package/dist/sync/linear/transport.js.map +1 -0
  264. package/dist/sync/provider-port.d.ts +81 -0
  265. package/dist/sync/provider-port.d.ts.map +1 -0
  266. package/dist/sync/provider-port.js +16 -0
  267. package/dist/sync/provider-port.js.map +1 -0
  268. package/dist/sync/provider-registry.d.ts +38 -0
  269. package/dist/sync/provider-registry.d.ts.map +1 -0
  270. package/dist/sync/provider-registry.js +115 -0
  271. package/dist/sync/provider-registry.js.map +1 -0
  272. package/dist/sync/schema.d.ts +147 -0
  273. package/dist/sync/schema.d.ts.map +1 -0
  274. package/dist/sync/schema.js +28 -0
  275. package/dist/sync/schema.js.map +1 -0
  276. package/dist/task/comments.d.ts +9 -0
  277. package/dist/task/comments.d.ts.map +1 -0
  278. package/dist/task/comments.js +79 -0
  279. package/dist/task/comments.js.map +1 -0
  280. package/dist/task/create.d.ts +34 -0
  281. package/dist/task/create.d.ts.map +1 -0
  282. package/dist/task/create.js +126 -0
  283. package/dist/task/create.js.map +1 -0
  284. package/dist/task/current.d.ts +18 -0
  285. package/dist/task/current.d.ts.map +1 -0
  286. package/dist/task/current.js +105 -0
  287. package/dist/task/current.js.map +1 -0
  288. package/dist/task/edit.d.ts +22 -0
  289. package/dist/task/edit.d.ts.map +1 -0
  290. package/dist/task/edit.js +105 -0
  291. package/dist/task/edit.js.map +1 -0
  292. package/dist/task/estimate.d.ts +20 -0
  293. package/dist/task/estimate.d.ts.map +1 -0
  294. package/dist/task/estimate.js +141 -0
  295. package/dist/task/estimate.js.map +1 -0
  296. package/dist/task/get.d.ts +13 -0
  297. package/dist/task/get.d.ts.map +1 -0
  298. package/dist/task/get.js +29 -0
  299. package/dist/task/get.js.map +1 -0
  300. package/dist/task/hierarchy.d.ts +18 -0
  301. package/dist/task/hierarchy.d.ts.map +1 -0
  302. package/dist/task/hierarchy.js +56 -0
  303. package/dist/task/hierarchy.js.map +1 -0
  304. package/dist/task/lifecycle.d.ts +14 -0
  305. package/dist/task/lifecycle.d.ts.map +1 -0
  306. package/dist/task/lifecycle.js +80 -0
  307. package/dist/task/lifecycle.js.map +1 -0
  308. package/dist/task/list.d.ts +24 -0
  309. package/dist/task/list.d.ts.map +1 -0
  310. package/dist/task/list.js +116 -0
  311. package/dist/task/list.js.map +1 -0
  312. package/dist/task/model-assignment.d.ts +33 -0
  313. package/dist/task/model-assignment.d.ts.map +1 -0
  314. package/dist/task/model-assignment.js +145 -0
  315. package/dist/task/model-assignment.js.map +1 -0
  316. package/dist/task/ordering.d.ts +4 -0
  317. package/dist/task/ordering.d.ts.map +1 -0
  318. package/dist/task/ordering.js +14 -0
  319. package/dist/task/ordering.js.map +1 -0
  320. package/dist/task/ports.d.ts +37 -0
  321. package/dist/task/ports.d.ts.map +1 -0
  322. package/dist/task/ports.js +3 -0
  323. package/dist/task/ports.js.map +1 -0
  324. package/dist/task/schema.d.ts +447 -0
  325. package/dist/task/schema.d.ts.map +1 -0
  326. package/dist/task/schema.js +35 -0
  327. package/dist/task/schema.js.map +1 -0
  328. package/dist/task/session-assignment.d.ts +23 -0
  329. package/dist/task/session-assignment.d.ts.map +1 -0
  330. package/dist/task/session-assignment.js +197 -0
  331. package/dist/task/session-assignment.js.map +1 -0
  332. package/dist/task/session-registry.d.ts +8 -0
  333. package/dist/task/session-registry.d.ts.map +1 -0
  334. package/dist/task/session-registry.js +3 -0
  335. package/dist/task/session-registry.js.map +1 -0
  336. package/dist/task/update.d.ts +23 -0
  337. package/dist/task/update.d.ts.map +1 -0
  338. package/dist/task/update.js +92 -0
  339. package/dist/task/update.js.map +1 -0
  340. package/dist/task/v1-compat.d.ts +94 -0
  341. package/dist/task/v1-compat.d.ts.map +1 -0
  342. package/dist/task/v1-compat.js +181 -0
  343. package/dist/task/v1-compat.js.map +1 -0
  344. package/dist/workspace/bin-cli.d.ts +2 -0
  345. package/dist/workspace/bin-cli.d.ts.map +1 -0
  346. package/dist/workspace/bin-cli.js +36 -0
  347. package/dist/workspace/bin-cli.js.map +1 -0
  348. package/dist/workspace/cli-adapter.d.ts +17 -0
  349. package/dist/workspace/cli-adapter.d.ts.map +1 -0
  350. package/dist/workspace/cli-adapter.js +230 -0
  351. package/dist/workspace/cli-adapter.js.map +1 -0
  352. package/dist/workspace/cli-commands.d.ts +11 -0
  353. package/dist/workspace/cli-commands.d.ts.map +1 -0
  354. package/dist/workspace/cli-commands.js +12 -0
  355. package/dist/workspace/cli-commands.js.map +1 -0
  356. package/dist/workspace/duckdb-index.d.ts +56 -0
  357. package/dist/workspace/duckdb-index.d.ts.map +1 -0
  358. package/dist/workspace/duckdb-index.js +178 -0
  359. package/dist/workspace/duckdb-index.js.map +1 -0
  360. package/dist/workspace/hook-templates/need-info-notify/config.json +10 -0
  361. package/dist/workspace/hook-templates/need-info-notify/script.mjs +68 -0
  362. package/dist/workspace/hook-templates/review-spawn/config.json +10 -0
  363. package/dist/workspace/hook-templates/review-spawn/script.mjs +100 -0
  364. package/dist/workspace/init-onboarding.d.ts +9 -0
  365. package/dist/workspace/init-onboarding.d.ts.map +1 -0
  366. package/dist/workspace/init-onboarding.js +335 -0
  367. package/dist/workspace/init-onboarding.js.map +1 -0
  368. package/dist/workspace/init.d.ts +20 -0
  369. package/dist/workspace/init.d.ts.map +1 -0
  370. package/dist/workspace/init.js +288 -0
  371. package/dist/workspace/init.js.map +1 -0
  372. package/dist/workspace/layers.d.ts +127 -0
  373. package/dist/workspace/layers.d.ts.map +1 -0
  374. package/dist/workspace/layers.js +50 -0
  375. package/dist/workspace/layers.js.map +1 -0
  376. package/dist/workspace/mcp-server.d.ts +28 -0
  377. package/dist/workspace/mcp-server.d.ts.map +1 -0
  378. package/dist/workspace/mcp-server.js +191 -0
  379. package/dist/workspace/mcp-server.js.map +1 -0
  380. package/dist/workspace/mcp-stdio.d.ts +2 -0
  381. package/dist/workspace/mcp-stdio.d.ts.map +1 -0
  382. package/dist/workspace/mcp-stdio.js +66 -0
  383. package/dist/workspace/mcp-stdio.js.map +1 -0
  384. package/dist/workspace/mcp-tools.d.ts +24 -0
  385. package/dist/workspace/mcp-tools.d.ts.map +1 -0
  386. package/dist/workspace/mcp-tools.js +43 -0
  387. package/dist/workspace/mcp-tools.js.map +1 -0
  388. package/dist/workspace/migrate-v1.d.ts +12 -0
  389. package/dist/workspace/migrate-v1.d.ts.map +1 -0
  390. package/dist/workspace/migrate-v1.js +301 -0
  391. package/dist/workspace/migrate-v1.js.map +1 -0
  392. package/dist/workspace/ohtools-app.d.ts +3 -0
  393. package/dist/workspace/ohtools-app.d.ts.map +1 -0
  394. package/dist/workspace/ohtools-app.js +10 -0
  395. package/dist/workspace/ohtools-app.js.map +1 -0
  396. package/dist/workspace/repositories.d.ts +25 -0
  397. package/dist/workspace/repositories.d.ts.map +1 -0
  398. package/dist/workspace/repositories.js +76 -0
  399. package/dist/workspace/repositories.js.map +1 -0
  400. package/dist/workspace/runtime.d.ts +123 -0
  401. package/dist/workspace/runtime.d.ts.map +1 -0
  402. package/dist/workspace/runtime.js +4 -0
  403. package/dist/workspace/runtime.js.map +1 -0
  404. package/dist/workspace/session-liveness.d.ts +6 -0
  405. package/dist/workspace/session-liveness.d.ts.map +1 -0
  406. package/dist/workspace/session-liveness.js +3 -0
  407. package/dist/workspace/session-liveness.js.map +1 -0
  408. package/dist/workspace/status.d.ts +46 -0
  409. package/dist/workspace/status.d.ts.map +1 -0
  410. package/dist/workspace/status.js +345 -0
  411. package/dist/workspace/status.js.map +1 -0
  412. package/dist/workspace/storage-layout.d.ts +19 -0
  413. package/dist/workspace/storage-layout.d.ts.map +1 -0
  414. package/dist/workspace/storage-layout.js +55 -0
  415. package/dist/workspace/storage-layout.js.map +1 -0
  416. package/dist/workspace/storage-paths.d.ts +16 -0
  417. package/dist/workspace/storage-paths.d.ts.map +1 -0
  418. package/dist/workspace/storage-paths.js +15 -0
  419. package/dist/workspace/storage-paths.js.map +1 -0
  420. package/dist/workspace/v1-cli-aliases.d.ts +18 -0
  421. package/dist/workspace/v1-cli-aliases.d.ts.map +1 -0
  422. package/dist/workspace/v1-cli-aliases.js +223 -0
  423. package/dist/workspace/v1-cli-aliases.js.map +1 -0
  424. package/dist/workspace/v1-cli-task.d.ts +2 -0
  425. package/dist/workspace/v1-cli-task.d.ts.map +1 -0
  426. package/dist/workspace/v1-cli-task.js +53 -0
  427. package/dist/workspace/v1-cli-task.js.map +1 -0
  428. package/package.json +29 -12
  429. package/quickstart.md +174 -0
  430. package/hooks/need-info-notify/config.yml +0 -3
  431. package/hooks/need-info-notify/script.ts +0 -69
  432. package/hooks/review-spawn/config.yml +0 -3
  433. package/hooks/review-spawn/script.ts +0 -96
  434. package/src/cli/cli.ts +0 -489
  435. package/src/cli/init.ts +0 -230
  436. package/src/domain/fibonacci.ts +0 -39
  437. package/src/domain/kTokens.ts +0 -65
  438. package/src/domain/status-machine.ts +0 -49
  439. package/src/domain/types.ts +0 -66
  440. package/src/hook/hook-executor.ts +0 -70
  441. package/src/hook/ports.ts +0 -16
  442. package/src/infra/hook-config-loader.ts +0 -111
  443. package/src/infra/jsonl-task-repository.ts +0 -157
  444. package/src/infra/layer.ts +0 -34
  445. package/src/infra/logger.ts +0 -40
  446. package/src/infra/pid-session-registry.ts +0 -67
  447. package/src/mcp/error-codes.ts +0 -213
  448. package/src/mcp/server.ts +0 -396
  449. package/src/mcp/session.ts +0 -1
  450. package/src/mcp/tool-create-task.ts +0 -28
  451. package/src/mcp/tool-current-task.ts +0 -19
  452. package/src/mcp/tool-edit-task.ts +0 -40
  453. package/src/mcp/tool-list-tasks.ts +0 -34
  454. package/src/mcp/tool-update-task.ts +0 -55
  455. package/src/task/create-task.ts +0 -67
  456. package/src/task/current-task.ts +0 -111
  457. package/src/task/edit-task.ts +0 -59
  458. package/src/task/list-tasks.ts +0 -35
  459. package/src/task/ports.ts +0 -15
  460. package/src/task/session-registry.ts +0 -9
  461. package/src/task/update-task.ts +0 -160
@@ -1,111 +0,0 @@
1
- import { Effect } from "effect"
2
- import type { Agent, Task, TaskError } from "../domain/types.js"
3
- import type { TaskRepository as TaskRepositoryType } from "./ports.js"
4
- import { TaskRepository } from "./ports.js"
5
- import { SessionRegistry } from "./session-registry.js"
6
-
7
- /**
8
- * Returns the best available task for the given session, claiming it if needed.
9
- *
10
- * Priority chain:
11
- * 1. Own in_progress — already assigned to this session → return highest-priority
12
- * 2. Unassigned in_progress — no assignee → claim highest-priority, return
13
- * 3. Orphaned in_progress — dead-session assignee → claim highest-priority, return
14
- * 4. Highest-priority todo — auto-transition to in_progress, claim, return
15
- * 5. Nothing → fail `no_current_task`
16
- *
17
- * Ties in priority are broken by in_progress_since ASC (oldest first).
18
- * Claiming is a direct repo.update — no hooks, no HookRunner dependency.
19
- */
20
- export const currentTask = (
21
- sessionId: string
22
- ): Effect.Effect<Task, TaskError, TaskRepository | SessionRegistry> =>
23
- Effect.flatMap(TaskRepository, (repo) =>
24
- Effect.flatMap(repo.findByStatus("in_progress"), (inProgress) => {
25
- const own = inProgress.filter((t) => t.assignee?.id === sessionId)
26
- if (own.length > 0) return Effect.succeed(pickHighestPriority(own))
27
-
28
- return stepUnassigned(inProgress, sessionId, repo).pipe(
29
- Effect.catchTag("no_current_task", () =>
30
- stepOrphan(sessionId, inProgress, repo).pipe(
31
- Effect.catchTag("no_current_task", () => stepTodo(sessionId, repo))
32
- )
33
- )
34
- )
35
- })
36
- )
37
-
38
- const pickHighestPriority = <T extends Task>(tasks: readonly T[]): T => {
39
- const sorted = [...tasks].sort((a, b) => {
40
- if (b.priority !== a.priority) return b.priority - a.priority
41
- const aTime = a.in_progress_since?.getTime() ?? Infinity
42
- const bTime = b.in_progress_since?.getTime() ?? Infinity
43
- return aTime - bTime
44
- })
45
- // biome-ignore lint/style/noNonNullAssertion: caller guarantees non-empty
46
- return sorted[0]!
47
- }
48
-
49
- const claimTask = (
50
- task: Task,
51
- newAssignee: Agent,
52
- repo: TaskRepositoryType
53
- ): Effect.Effect<Task, TaskError, never> => {
54
- const claimed = { ...task, assignee: newAssignee }
55
- return Effect.map(repo.update(claimed), () => claimed)
56
- }
57
-
58
- const stepUnassigned = (
59
- inProgress: readonly Task[],
60
- sessionId: string,
61
- repo: TaskRepositoryType
62
- ): Effect.Effect<Task, TaskError, never> => {
63
- const unassigned = inProgress.filter((t) => t.assignee === undefined)
64
- if (unassigned.length === 0) return Effect.fail({ _tag: "no_current_task" as const })
65
- const oldest = pickHighestPriority(unassigned)
66
- return claimTask(oldest, { id: sessionId, title: "Agent", description: "" }, repo)
67
- }
68
-
69
- const stepOrphan = (
70
- sessionId: string,
71
- candidates: readonly Task[],
72
- repo: TaskRepositoryType
73
- ): Effect.Effect<Task, TaskError, SessionRegistry> => {
74
- const foreign = candidates.filter(
75
- (t): t is Task & { assignee: Agent } => t.assignee !== undefined && t.assignee.id !== sessionId
76
- )
77
- if (foreign.length === 0) return Effect.fail({ _tag: "no_current_task" as const })
78
- return Effect.flatMap(SessionRegistry, (registry) =>
79
- Effect.flatMap(
80
- Effect.forEach(foreign, (t) =>
81
- registry.isAlive(t.assignee.id).pipe(Effect.map((alive) => ({ task: t, alive })))
82
- ),
83
- (results) => {
84
- const orphans = results.filter((r) => !r.alive).map((r) => r.task)
85
- if (orphans.length === 0) return Effect.fail({ _tag: "no_current_task" as const })
86
- const oldest = pickHighestPriority(orphans)
87
- return claimTask(oldest, { ...oldest.assignee, id: sessionId }, repo)
88
- }
89
- )
90
- )
91
- }
92
-
93
- const stepTodo = (
94
- sessionId: string,
95
- repo: TaskRepositoryType
96
- ): Effect.Effect<Task, TaskError, never> =>
97
- Effect.flatMap(repo.findByStatus("todo"), (todos) => {
98
- if (todos.length === 0) return Effect.fail({ _tag: "no_current_task" as const })
99
- // biome-ignore lint/style/noNonNullAssertion: length guard above
100
- const best = [...todos].sort((a, b) => b.priority - a.priority)[0]!
101
- const claimed: Task = {
102
- ...best,
103
- status: "in_progress",
104
- assignee: {
105
- ...(best.assignee ?? { title: "Agent", description: "" }),
106
- id: sessionId,
107
- },
108
- in_progress_since: new Date(),
109
- }
110
- return Effect.map(repo.update(claimed), () => claimed)
111
- })
@@ -1,59 +0,0 @@
1
- import { Effect } from "effect"
2
- import { estimateFromKTokens } from "../domain/kTokens.js"
3
- import type { Task, TaskError } from "../domain/types.js"
4
- import { TaskRepository } from "./ports.js"
5
-
6
- export interface EditTaskInput {
7
- title?: string
8
- description?: string
9
- definition_of_done?: string
10
- predictedKTokens?: number
11
- priority?: number
12
- }
13
-
14
- /**
15
- * Edits mutable fields of an existing task without changing its status.
16
- * Derives Fibonacci estimation from predictedKTokens when provided.
17
- * Fails with `not_found` for unknown id.
18
- * Fails with `validation_error` when a `status` field is attempted via EditTaskInput.
19
- */
20
- export const editTask = (
21
- id: string,
22
- updates: EditTaskInput
23
- ): Effect.Effect<Task, TaskError, TaskRepository> => {
24
- // Check for attempted status modification (runtime guard against type system bypass)
25
- if ("status" in updates) {
26
- return Effect.fail({
27
- _tag: "validation_error" as const,
28
- message: "status field cannot be edited",
29
- })
30
- }
31
-
32
- // Derive estimation from predictedKTokens if present
33
- if (updates.predictedKTokens !== undefined) {
34
- return Effect.flatMap(estimateFromKTokens(updates.predictedKTokens), (estimation) =>
35
- Effect.flatMap(TaskRepository, (repo) =>
36
- Effect.flatMap(repo.findById(id), (task) => {
37
- const { predictedKTokens: _, ...rest } = updates
38
- const updatedTask: Task = {
39
- ...task,
40
- ...rest,
41
- estimation,
42
- }
43
- return Effect.flatMap(repo.update(updatedTask), () => Effect.succeed(updatedTask))
44
- })
45
- )
46
- )
47
- }
48
-
49
- // No estimation to derive, proceed directly with find and update
50
- return Effect.flatMap(TaskRepository, (repo) =>
51
- Effect.flatMap(repo.findById(id), (task) => {
52
- const updatedTask: Task = {
53
- ...task,
54
- ...updates,
55
- }
56
- return Effect.flatMap(repo.update(updatedTask), () => Effect.succeed(updatedTask))
57
- })
58
- )
59
- }
@@ -1,35 +0,0 @@
1
- import { Effect } from "effect"
2
- import type { Status, Task, TaskError } from "../domain/types.js"
3
- import { TaskRepository } from "./ports.js"
4
-
5
- type ListTasksOptions = {
6
- status: Status | "*"
7
- project?: string
8
- milestone?: string
9
- }
10
-
11
- const applyFilters = (tasks: readonly Task[], options: ListTasksOptions): readonly Task[] => {
12
- let result = tasks
13
- if (options.project !== undefined) {
14
- result = result.filter((t) => t.project === options.project)
15
- }
16
- if (options.milestone !== undefined) {
17
- result = result.filter((t) => t.milestone === options.milestone)
18
- }
19
- return result
20
- }
21
-
22
- /**
23
- * Returns tasks matching the given status (and optional project/milestone), or all tasks when status is '*'.
24
- * Filters compose: all provided filters must match.
25
- * Results are ordered by priority DESC.
26
- * Fails with `validation_error` when the underlying data is malformed.
27
- */
28
- export const listTasks = (
29
- options: ListTasksOptions
30
- ): Effect.Effect<readonly Task[], TaskError, TaskRepository> =>
31
- Effect.flatMap(TaskRepository, (repo) =>
32
- Effect.map(repo.findByStatus(options.status), (tasks) =>
33
- [...applyFilters(tasks, options)].sort((a, b) => b.priority - a.priority)
34
- )
35
- )
package/src/task/ports.ts DELETED
@@ -1,15 +0,0 @@
1
- import { Context, type Effect } from "effect"
2
- import type { Status, Task, TaskError } from "../domain/types.js"
3
-
4
- export interface TaskRepository {
5
- /** Fails with `not_found` if id is absent. */
6
- findById(id: string): Effect.Effect<Task, TaskError>
7
- /** Returns empty array when nothing matches; fails with `validation_error` on malformed data. */
8
- findByStatus(status: Status | "*"): Effect.Effect<readonly Task[], TaskError>
9
- /** Fails with `conflict` if a task with the same id already exists. */
10
- save(task: Task): Effect.Effect<void, TaskError>
11
- /** Fails with `not_found` if id is absent. */
12
- update(task: Task): Effect.Effect<void, TaskError>
13
- }
14
-
15
- export const TaskRepository = Context.GenericTag<TaskRepository>("TaskRepository")
@@ -1,9 +0,0 @@
1
- import { Context, type Effect } from "effect"
2
-
3
- export interface SessionRegistry {
4
- isAlive(sessionId: string): Effect.Effect<boolean, never>
5
- register(sessionId: string, pid: number): Effect.Effect<void, never>
6
- deregister(sessionId: string): Effect.Effect<void, never>
7
- }
8
-
9
- export const SessionRegistry = Context.GenericTag<SessionRegistry>("SessionRegistry")
@@ -1,160 +0,0 @@
1
- import { Effect } from "effect"
2
- import { guardTransition } from "../domain/status-machine.js"
3
- import type { Comment, Status, TaskError } from "../domain/types.js"
4
- import { HookRunner } from "../hook/ports.js"
5
- import { TaskRepository } from "./ports.js"
6
- import { SessionRegistry } from "./session-registry.js"
7
-
8
- /**
9
- * Transitions a task to a new status, optionally attaching or replying to a comment.
10
- * Enforces transition rules, comment requirements, need_info reply cycle,
11
- * and concurrent in_progress justification.
12
- * Fires HookRunner after a successful status change.
13
- */
14
- export const updateTask = (
15
- id: string,
16
- newStatus: Status,
17
- comment: Comment | null,
18
- sessionId: string
19
- ): Effect.Effect<void, TaskError, TaskRepository | HookRunner | SessionRegistry> =>
20
- Effect.gen(function* () {
21
- const repo = yield* TaskRepository
22
- const hookRunner = yield* HookRunner
23
-
24
- // Step 1: find task or fail with not_found
25
- const task = yield* repo.findById(id)
26
-
27
- // Step 2: guard transition (same→same is allowed by guardTransition too)
28
- // Pass task id so review tasks can skip pending_review and go directly to done
29
- yield* guardTransition(task.status, newStatus, task.id)
30
-
31
- // Step 4: reply handling — comment id matches an existing comment
32
- // Must run before the no-op check because a reply update is meaningful
33
- // even when the status is not changing.
34
- if (comment !== null) {
35
- const existing = task.comments.find((c) => c.id === comment.id)
36
- if (existing !== undefined) {
37
- if (existing.kind === "regular") {
38
- return yield* Effect.fail<TaskError>({
39
- _tag: "validation_error",
40
- message: "reply is only valid on need_info comments",
41
- context: { commentId: existing.id, commentKind: existing.kind },
42
- })
43
- }
44
- // existing.kind === 'need_info': merge reply and persist, no hook, no status change
45
- const updatedComments = task.comments.map((c) =>
46
- c.id === comment.id ? { ...c, reply: comment.reply } : c
47
- )
48
- const updatedTask = { ...task, comments: updatedComments }
49
- yield* repo.update(updatedTask)
50
- return
51
- }
52
- }
53
-
54
- // Step 3: no-op when status unchanged (and no reply was handled above)
55
- if (task.status === newStatus) return
56
-
57
- // Step 5: need_info requires a comment
58
- if (newStatus === "need_info" && comment === null) {
59
- return yield* Effect.fail<TaskError>({
60
- _tag: "missing_comment",
61
- from: task.status,
62
- to: newStatus,
63
- })
64
- }
65
-
66
- // Step 6: blocked requires a non-empty comment
67
- if (newStatus === "blocked") {
68
- if (comment === null) {
69
- return yield* Effect.fail<TaskError>({
70
- _tag: "missing_comment",
71
- from: task.status,
72
- to: newStatus,
73
- })
74
- }
75
- if (comment.content.trim() === "") {
76
- return yield* Effect.fail<TaskError>({
77
- _tag: "validation_error",
78
- message: "blocked requires a non-empty comment",
79
- context: { from: task.status, to: newStatus },
80
- })
81
- }
82
- }
83
-
84
- // Step 7: transitioning FROM need_info — all need_info comments must have a reply
85
- if (task.status === "need_info") {
86
- const blocking = task.comments.find((c) => c.kind === "need_info" && c.reply === "")
87
- if (blocking !== undefined) {
88
- return yield* Effect.fail<TaskError>({
89
- _tag: "validation_error",
90
- message: `blocking comment ${blocking.id} has no reply`,
91
- context: {
92
- commentId: blocking.id,
93
- commentTitle: blocking.title,
94
- commentContent: blocking.content,
95
- commentTimestamp: blocking.timestamp,
96
- },
97
- })
98
- }
99
- }
100
-
101
- // Step 8b: ownership check — reject if a live foreign session owns this task
102
- if (
103
- newStatus === "in_progress" &&
104
- task.assignee !== undefined &&
105
- task.assignee.id !== sessionId
106
- ) {
107
- const registry = yield* SessionRegistry
108
- const alive = yield* registry.isAlive(task.assignee.id)
109
- if (alive) {
110
- return yield* Effect.fail<TaskError>({
111
- _tag: "validation_error",
112
- message: `task is owned by an active session (${task.assignee.id})`,
113
- context: { task },
114
- })
115
- }
116
- // dead session — fall through and let step 9 reassign
117
- }
118
-
119
- // Step 8: concurrent in_progress — second task for same session requires justification
120
- if (newStatus === "in_progress") {
121
- const inProgressTasks = yield* repo.findByStatus("in_progress")
122
- const sessionInProgress = inProgressTasks.filter(
123
- (t) => t.assignee?.id === sessionId && t.id !== task.id
124
- )
125
- if (sessionInProgress.length > 0) {
126
- if (comment === null || comment.content.trim() === "") {
127
- return yield* Effect.fail<TaskError>({
128
- _tag: "validation_error",
129
- message: "moving a second task to in_progress requires a justification comment",
130
- context: {
131
- inProgressTasks: sessionInProgress.map((t) => ({ id: t.id, title: t.title })),
132
- },
133
- })
134
- }
135
- }
136
- }
137
-
138
- // Step 9: apply changes
139
- const oldStatus = task.status
140
- const updatedComments = comment !== null ? [...task.comments, comment] : task.comments
141
- const updatedTask = {
142
- ...task,
143
- status: newStatus,
144
- comments: updatedComments,
145
- ...(newStatus === "in_progress"
146
- ? {
147
- in_progress_since: new Date(),
148
- assignee: { id: sessionId, title: "Agent", description: "" },
149
- }
150
- : {}),
151
- }
152
- yield* repo.update(updatedTask)
153
- yield* hookRunner.run({
154
- task_id: id,
155
- old_status: oldStatus,
156
- new_status: newStatus,
157
- comment,
158
- session_id: sessionId,
159
- })
160
- })