opentasks 0.0.1 → 0.0.2

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 (662) hide show
  1. package/README.md +344 -1
  2. package/dist/__tests__/cli-tools.test.d.ts +8 -0
  3. package/dist/__tests__/cli-tools.test.d.ts.map +1 -0
  4. package/dist/__tests__/cli-tools.test.js +546 -0
  5. package/dist/__tests__/cli-tools.test.js.map +1 -0
  6. package/dist/__tests__/cli.test.d.ts +5 -0
  7. package/dist/__tests__/cli.test.d.ts.map +1 -0
  8. package/dist/__tests__/cli.test.js +77 -0
  9. package/dist/__tests__/cli.test.js.map +1 -0
  10. package/dist/__tests__/p1-p3-gaps.test.d.ts +2 -0
  11. package/dist/__tests__/p1-p3-gaps.test.d.ts.map +1 -0
  12. package/dist/__tests__/p1-p3-gaps.test.js +463 -0
  13. package/dist/__tests__/p1-p3-gaps.test.js.map +1 -0
  14. package/dist/cli.d.ts +19 -1
  15. package/dist/cli.d.ts.map +1 -1
  16. package/dist/cli.js +702 -23
  17. package/dist/cli.js.map +1 -1
  18. package/dist/client/__tests__/client-crud.test.d.ts +7 -0
  19. package/dist/client/__tests__/client-crud.test.d.ts.map +1 -0
  20. package/dist/client/__tests__/client-crud.test.js +404 -0
  21. package/dist/client/__tests__/client-crud.test.js.map +1 -0
  22. package/dist/client/__tests__/client.test.d.ts +5 -0
  23. package/dist/client/__tests__/client.test.d.ts.map +1 -0
  24. package/dist/client/__tests__/client.test.js +518 -0
  25. package/dist/client/__tests__/client.test.js.map +1 -0
  26. package/dist/client/client.d.ts +228 -0
  27. package/dist/client/client.d.ts.map +1 -0
  28. package/dist/client/client.js +393 -0
  29. package/dist/client/client.js.map +1 -0
  30. package/dist/client/index.d.ts +11 -0
  31. package/dist/client/index.d.ts.map +1 -0
  32. package/dist/client/index.js +9 -0
  33. package/dist/client/index.js.map +1 -0
  34. package/dist/config/__tests__/defaults.test.d.ts +2 -0
  35. package/dist/config/__tests__/defaults.test.d.ts.map +1 -0
  36. package/dist/config/__tests__/defaults.test.js +57 -0
  37. package/dist/config/__tests__/defaults.test.js.map +1 -0
  38. package/dist/config/__tests__/env.test.d.ts +2 -0
  39. package/dist/config/__tests__/env.test.d.ts.map +1 -0
  40. package/dist/config/__tests__/env.test.js +136 -0
  41. package/dist/config/__tests__/env.test.js.map +1 -0
  42. package/dist/config/__tests__/index.test.d.ts +2 -0
  43. package/dist/config/__tests__/index.test.d.ts.map +1 -0
  44. package/dist/config/__tests__/index.test.js +113 -0
  45. package/dist/config/__tests__/index.test.js.map +1 -0
  46. package/dist/config/__tests__/loader.test.d.ts +2 -0
  47. package/dist/config/__tests__/loader.test.d.ts.map +1 -0
  48. package/dist/config/__tests__/loader.test.js +128 -0
  49. package/dist/config/__tests__/loader.test.js.map +1 -0
  50. package/dist/config/__tests__/merge.test.d.ts +2 -0
  51. package/dist/config/__tests__/merge.test.d.ts.map +1 -0
  52. package/dist/config/__tests__/merge.test.js +79 -0
  53. package/dist/config/__tests__/merge.test.js.map +1 -0
  54. package/dist/config/__tests__/schema.test.d.ts +2 -0
  55. package/dist/config/__tests__/schema.test.d.ts.map +1 -0
  56. package/dist/config/__tests__/schema.test.js +300 -0
  57. package/dist/config/__tests__/schema.test.js.map +1 -0
  58. package/dist/config/defaults.d.ts +13 -0
  59. package/dist/config/defaults.d.ts.map +1 -0
  60. package/dist/config/defaults.js +15 -0
  61. package/dist/config/defaults.js.map +1 -0
  62. package/dist/config/env.d.ts +14 -0
  63. package/dist/config/env.d.ts.map +1 -0
  64. package/dist/config/env.js +130 -0
  65. package/dist/config/env.js.map +1 -0
  66. package/dist/config/errors.d.ts +21 -0
  67. package/dist/config/errors.d.ts.map +1 -0
  68. package/dist/config/errors.js +30 -0
  69. package/dist/config/errors.js.map +1 -0
  70. package/dist/config/index.d.ts +21 -0
  71. package/dist/config/index.d.ts.map +1 -0
  72. package/dist/config/index.js +41 -0
  73. package/dist/config/index.js.map +1 -0
  74. package/dist/config/loader.d.ts +8 -0
  75. package/dist/config/loader.d.ts.map +1 -0
  76. package/dist/config/loader.js +87 -0
  77. package/dist/config/loader.js.map +1 -0
  78. package/dist/config/merge.d.ts +12 -0
  79. package/dist/config/merge.d.ts.map +1 -0
  80. package/dist/config/merge.js +54 -0
  81. package/dist/config/merge.js.map +1 -0
  82. package/dist/config/schema.d.ts +644 -0
  83. package/dist/config/schema.d.ts.map +1 -0
  84. package/dist/config/schema.js +491 -0
  85. package/dist/config/schema.js.map +1 -0
  86. package/dist/core/__tests__/conditional-redirects.test.d.ts +2 -0
  87. package/dist/core/__tests__/conditional-redirects.test.d.ts.map +1 -0
  88. package/dist/core/__tests__/conditional-redirects.test.js +83 -0
  89. package/dist/core/__tests__/conditional-redirects.test.js.map +1 -0
  90. package/dist/core/__tests__/connections.test.d.ts +2 -0
  91. package/dist/core/__tests__/connections.test.d.ts.map +1 -0
  92. package/dist/core/__tests__/connections.test.js +158 -0
  93. package/dist/core/__tests__/connections.test.js.map +1 -0
  94. package/dist/core/__tests__/hash.test.d.ts +2 -0
  95. package/dist/core/__tests__/hash.test.d.ts.map +1 -0
  96. package/dist/core/__tests__/hash.test.js +139 -0
  97. package/dist/core/__tests__/hash.test.js.map +1 -0
  98. package/dist/core/__tests__/id.test.d.ts +2 -0
  99. package/dist/core/__tests__/id.test.d.ts.map +1 -0
  100. package/dist/core/__tests__/id.test.js +142 -0
  101. package/dist/core/__tests__/id.test.js.map +1 -0
  102. package/dist/core/__tests__/location.test.d.ts +2 -0
  103. package/dist/core/__tests__/location.test.d.ts.map +1 -0
  104. package/dist/core/__tests__/location.test.js +77 -0
  105. package/dist/core/__tests__/location.test.js.map +1 -0
  106. package/dist/core/__tests__/merge-driver.test.d.ts +2 -0
  107. package/dist/core/__tests__/merge-driver.test.d.ts.map +1 -0
  108. package/dist/core/__tests__/merge-driver.test.js +218 -0
  109. package/dist/core/__tests__/merge-driver.test.js.map +1 -0
  110. package/dist/core/__tests__/redirects.test.d.ts +2 -0
  111. package/dist/core/__tests__/redirects.test.d.ts.map +1 -0
  112. package/dist/core/__tests__/redirects.test.js +123 -0
  113. package/dist/core/__tests__/redirects.test.js.map +1 -0
  114. package/dist/core/__tests__/resolve-location-target.test.d.ts +8 -0
  115. package/dist/core/__tests__/resolve-location-target.test.d.ts.map +1 -0
  116. package/dist/core/__tests__/resolve-location-target.test.js +303 -0
  117. package/dist/core/__tests__/resolve-location-target.test.js.map +1 -0
  118. package/dist/core/__tests__/uri.test.d.ts +2 -0
  119. package/dist/core/__tests__/uri.test.d.ts.map +1 -0
  120. package/dist/core/__tests__/uri.test.js +159 -0
  121. package/dist/core/__tests__/uri.test.js.map +1 -0
  122. package/dist/core/__tests__/worktree.test.d.ts +2 -0
  123. package/dist/core/__tests__/worktree.test.d.ts.map +1 -0
  124. package/dist/core/__tests__/worktree.test.js +120 -0
  125. package/dist/core/__tests__/worktree.test.js.map +1 -0
  126. package/dist/core/conditional-redirects.d.ts +42 -0
  127. package/dist/core/conditional-redirects.d.ts.map +1 -0
  128. package/dist/core/conditional-redirects.js +59 -0
  129. package/dist/core/conditional-redirects.js.map +1 -0
  130. package/dist/core/connections.d.ts +87 -0
  131. package/dist/core/connections.d.ts.map +1 -0
  132. package/dist/core/connections.js +160 -0
  133. package/dist/core/connections.js.map +1 -0
  134. package/dist/core/discover.d.ts +39 -0
  135. package/dist/core/discover.d.ts.map +1 -0
  136. package/dist/core/discover.js +136 -0
  137. package/dist/core/discover.js.map +1 -0
  138. package/dist/core/hash.d.ts +25 -0
  139. package/dist/core/hash.d.ts.map +1 -0
  140. package/dist/core/hash.js +62 -0
  141. package/dist/core/hash.js.map +1 -0
  142. package/dist/core/id.d.ts +79 -0
  143. package/dist/core/id.d.ts.map +1 -0
  144. package/dist/core/id.js +141 -0
  145. package/dist/core/id.js.map +1 -0
  146. package/dist/core/index.d.ts +15 -0
  147. package/dist/core/index.d.ts.map +1 -0
  148. package/dist/core/index.js +24 -0
  149. package/dist/core/index.js.map +1 -0
  150. package/dist/core/location.d.ts +70 -0
  151. package/dist/core/location.d.ts.map +1 -0
  152. package/dist/core/location.js +121 -0
  153. package/dist/core/location.js.map +1 -0
  154. package/dist/core/merge-driver.d.ts +50 -0
  155. package/dist/core/merge-driver.d.ts.map +1 -0
  156. package/dist/core/merge-driver.js +258 -0
  157. package/dist/core/merge-driver.js.map +1 -0
  158. package/dist/core/redirects.d.ts +91 -0
  159. package/dist/core/redirects.d.ts.map +1 -0
  160. package/dist/core/redirects.js +113 -0
  161. package/dist/core/redirects.js.map +1 -0
  162. package/dist/core/uri.d.ts +105 -0
  163. package/dist/core/uri.d.ts.map +1 -0
  164. package/dist/core/uri.js +190 -0
  165. package/dist/core/uri.js.map +1 -0
  166. package/dist/core/worktree.d.ts +106 -0
  167. package/dist/core/worktree.d.ts.map +1 -0
  168. package/dist/core/worktree.js +394 -0
  169. package/dist/core/worktree.js.map +1 -0
  170. package/dist/daemon/__tests__/flush.test.d.ts +5 -0
  171. package/dist/daemon/__tests__/flush.test.d.ts.map +1 -0
  172. package/dist/daemon/__tests__/flush.test.js +213 -0
  173. package/dist/daemon/__tests__/flush.test.js.map +1 -0
  174. package/dist/daemon/__tests__/integration.test.d.ts +7 -0
  175. package/dist/daemon/__tests__/integration.test.d.ts.map +1 -0
  176. package/dist/daemon/__tests__/integration.test.js +276 -0
  177. package/dist/daemon/__tests__/integration.test.js.map +1 -0
  178. package/dist/daemon/__tests__/ipc.test.d.ts +5 -0
  179. package/dist/daemon/__tests__/ipc.test.d.ts.map +1 -0
  180. package/dist/daemon/__tests__/ipc.test.js +314 -0
  181. package/dist/daemon/__tests__/ipc.test.js.map +1 -0
  182. package/dist/daemon/__tests__/lifecycle.test.d.ts +5 -0
  183. package/dist/daemon/__tests__/lifecycle.test.d.ts.map +1 -0
  184. package/dist/daemon/__tests__/lifecycle.test.js +301 -0
  185. package/dist/daemon/__tests__/lifecycle.test.js.map +1 -0
  186. package/dist/daemon/__tests__/lock.test.d.ts +5 -0
  187. package/dist/daemon/__tests__/lock.test.d.ts.map +1 -0
  188. package/dist/daemon/__tests__/lock.test.js +192 -0
  189. package/dist/daemon/__tests__/lock.test.js.map +1 -0
  190. package/dist/daemon/__tests__/methods/graph.test.d.ts +5 -0
  191. package/dist/daemon/__tests__/methods/graph.test.d.ts.map +1 -0
  192. package/dist/daemon/__tests__/methods/graph.test.js +309 -0
  193. package/dist/daemon/__tests__/methods/graph.test.js.map +1 -0
  194. package/dist/daemon/__tests__/methods/provider.test.d.ts +7 -0
  195. package/dist/daemon/__tests__/methods/provider.test.d.ts.map +1 -0
  196. package/dist/daemon/__tests__/methods/provider.test.js +181 -0
  197. package/dist/daemon/__tests__/methods/provider.test.js.map +1 -0
  198. package/dist/daemon/__tests__/methods/tools.test.d.ts +5 -0
  199. package/dist/daemon/__tests__/methods/tools.test.d.ts.map +1 -0
  200. package/dist/daemon/__tests__/methods/tools.test.js +587 -0
  201. package/dist/daemon/__tests__/methods/tools.test.js.map +1 -0
  202. package/dist/daemon/__tests__/multi-location.test.d.ts +8 -0
  203. package/dist/daemon/__tests__/multi-location.test.d.ts.map +1 -0
  204. package/dist/daemon/__tests__/multi-location.test.js +669 -0
  205. package/dist/daemon/__tests__/multi-location.test.js.map +1 -0
  206. package/dist/daemon/__tests__/registry.test.d.ts +5 -0
  207. package/dist/daemon/__tests__/registry.test.d.ts.map +1 -0
  208. package/dist/daemon/__tests__/registry.test.js +208 -0
  209. package/dist/daemon/__tests__/registry.test.js.map +1 -0
  210. package/dist/daemon/__tests__/watcher.test.d.ts +5 -0
  211. package/dist/daemon/__tests__/watcher.test.d.ts.map +1 -0
  212. package/dist/daemon/__tests__/watcher.test.js +234 -0
  213. package/dist/daemon/__tests__/watcher.test.js.map +1 -0
  214. package/dist/daemon/entire-linker.d.ts +68 -0
  215. package/dist/daemon/entire-linker.d.ts.map +1 -0
  216. package/dist/daemon/entire-linker.js +439 -0
  217. package/dist/daemon/entire-linker.js.map +1 -0
  218. package/dist/daemon/entire-watcher.d.ts +66 -0
  219. package/dist/daemon/entire-watcher.d.ts.map +1 -0
  220. package/dist/daemon/entire-watcher.js +258 -0
  221. package/dist/daemon/entire-watcher.js.map +1 -0
  222. package/dist/daemon/factory.d.ts +59 -0
  223. package/dist/daemon/factory.d.ts.map +1 -0
  224. package/dist/daemon/factory.js +72 -0
  225. package/dist/daemon/factory.js.map +1 -0
  226. package/dist/daemon/flush.d.ts +51 -0
  227. package/dist/daemon/flush.d.ts.map +1 -0
  228. package/dist/daemon/flush.js +89 -0
  229. package/dist/daemon/flush.js.map +1 -0
  230. package/dist/daemon/index.d.ts +39 -0
  231. package/dist/daemon/index.d.ts.map +1 -0
  232. package/dist/daemon/index.js +24 -0
  233. package/dist/daemon/index.js.map +1 -0
  234. package/dist/daemon/ipc.d.ts +97 -0
  235. package/dist/daemon/ipc.d.ts.map +1 -0
  236. package/dist/daemon/ipc.js +304 -0
  237. package/dist/daemon/ipc.js.map +1 -0
  238. package/dist/daemon/lifecycle.d.ts +85 -0
  239. package/dist/daemon/lifecycle.d.ts.map +1 -0
  240. package/dist/daemon/lifecycle.js +754 -0
  241. package/dist/daemon/lifecycle.js.map +1 -0
  242. package/dist/daemon/location-state.d.ts +85 -0
  243. package/dist/daemon/location-state.d.ts.map +1 -0
  244. package/dist/daemon/location-state.js +291 -0
  245. package/dist/daemon/location-state.js.map +1 -0
  246. package/dist/daemon/lock.d.ts +29 -0
  247. package/dist/daemon/lock.d.ts.map +1 -0
  248. package/dist/daemon/lock.js +131 -0
  249. package/dist/daemon/lock.js.map +1 -0
  250. package/dist/daemon/methods/__tests__/graph.test.d.ts +5 -0
  251. package/dist/daemon/methods/__tests__/graph.test.d.ts.map +1 -0
  252. package/dist/daemon/methods/__tests__/graph.test.js +274 -0
  253. package/dist/daemon/methods/__tests__/graph.test.js.map +1 -0
  254. package/dist/daemon/methods/__tests__/provider.test.d.ts +5 -0
  255. package/dist/daemon/methods/__tests__/provider.test.d.ts.map +1 -0
  256. package/dist/daemon/methods/__tests__/provider.test.js +184 -0
  257. package/dist/daemon/methods/__tests__/provider.test.js.map +1 -0
  258. package/dist/daemon/methods/__tests__/tools.test.d.ts +5 -0
  259. package/dist/daemon/methods/__tests__/tools.test.d.ts.map +1 -0
  260. package/dist/daemon/methods/__tests__/tools.test.js +295 -0
  261. package/dist/daemon/methods/__tests__/tools.test.js.map +1 -0
  262. package/dist/daemon/methods/archive.d.ts +22 -0
  263. package/dist/daemon/methods/archive.d.ts.map +1 -0
  264. package/dist/daemon/methods/archive.js +107 -0
  265. package/dist/daemon/methods/archive.js.map +1 -0
  266. package/dist/daemon/methods/graph.d.ts +26 -0
  267. package/dist/daemon/methods/graph.d.ts.map +1 -0
  268. package/dist/daemon/methods/graph.js +157 -0
  269. package/dist/daemon/methods/graph.js.map +1 -0
  270. package/dist/daemon/methods/lifecycle.d.ts +54 -0
  271. package/dist/daemon/methods/lifecycle.d.ts.map +1 -0
  272. package/dist/daemon/methods/lifecycle.js +46 -0
  273. package/dist/daemon/methods/lifecycle.js.map +1 -0
  274. package/dist/daemon/methods/location.d.ts +24 -0
  275. package/dist/daemon/methods/location.d.ts.map +1 -0
  276. package/dist/daemon/methods/location.js +72 -0
  277. package/dist/daemon/methods/location.js.map +1 -0
  278. package/dist/daemon/methods/provider.d.ts +22 -0
  279. package/dist/daemon/methods/provider.d.ts.map +1 -0
  280. package/dist/daemon/methods/provider.js +72 -0
  281. package/dist/daemon/methods/provider.js.map +1 -0
  282. package/dist/daemon/methods/tools.d.ts +23 -0
  283. package/dist/daemon/methods/tools.d.ts.map +1 -0
  284. package/dist/daemon/methods/tools.js +111 -0
  285. package/dist/daemon/methods/tools.js.map +1 -0
  286. package/dist/daemon/registry.d.ts +35 -0
  287. package/dist/daemon/registry.d.ts.map +1 -0
  288. package/dist/daemon/registry.js +189 -0
  289. package/dist/daemon/registry.js.map +1 -0
  290. package/dist/daemon/types.d.ts +101 -0
  291. package/dist/daemon/types.d.ts.map +1 -0
  292. package/dist/daemon/types.js +19 -0
  293. package/dist/daemon/types.js.map +1 -0
  294. package/dist/daemon/watcher.d.ts +62 -0
  295. package/dist/daemon/watcher.d.ts.map +1 -0
  296. package/dist/daemon/watcher.js +142 -0
  297. package/dist/daemon/watcher.js.map +1 -0
  298. package/dist/graph/EdgeTypeRegistry.d.ts +134 -0
  299. package/dist/graph/EdgeTypeRegistry.d.ts.map +1 -0
  300. package/dist/graph/EdgeTypeRegistry.js +255 -0
  301. package/dist/graph/EdgeTypeRegistry.js.map +1 -0
  302. package/dist/graph/FederatedGraph.d.ts +296 -0
  303. package/dist/graph/FederatedGraph.d.ts.map +1 -0
  304. package/dist/graph/FederatedGraph.js +406 -0
  305. package/dist/graph/FederatedGraph.js.map +1 -0
  306. package/dist/graph/GraphologyAdapter.d.ts +151 -0
  307. package/dist/graph/GraphologyAdapter.d.ts.map +1 -0
  308. package/dist/graph/GraphologyAdapter.js +209 -0
  309. package/dist/graph/GraphologyAdapter.js.map +1 -0
  310. package/dist/graph/HydratingFederatedGraph.d.ts +151 -0
  311. package/dist/graph/HydratingFederatedGraph.d.ts.map +1 -0
  312. package/dist/graph/HydratingFederatedGraph.js +327 -0
  313. package/dist/graph/HydratingFederatedGraph.js.map +1 -0
  314. package/dist/graph/__tests__/EdgeTypeRegistry.test.d.ts +2 -0
  315. package/dist/graph/__tests__/EdgeTypeRegistry.test.d.ts.map +1 -0
  316. package/dist/graph/__tests__/EdgeTypeRegistry.test.js +212 -0
  317. package/dist/graph/__tests__/EdgeTypeRegistry.test.js.map +1 -0
  318. package/dist/graph/__tests__/FederatedGraph.test.d.ts +2 -0
  319. package/dist/graph/__tests__/FederatedGraph.test.d.ts.map +1 -0
  320. package/dist/graph/__tests__/FederatedGraph.test.js +661 -0
  321. package/dist/graph/__tests__/FederatedGraph.test.js.map +1 -0
  322. package/dist/graph/__tests__/GraphologyAdapter.test.d.ts +2 -0
  323. package/dist/graph/__tests__/GraphologyAdapter.test.d.ts.map +1 -0
  324. package/dist/graph/__tests__/GraphologyAdapter.test.js +326 -0
  325. package/dist/graph/__tests__/GraphologyAdapter.test.js.map +1 -0
  326. package/dist/graph/__tests__/HydratingFederatedGraph.test.d.ts +2 -0
  327. package/dist/graph/__tests__/HydratingFederatedGraph.test.d.ts.map +1 -0
  328. package/dist/graph/__tests__/HydratingFederatedGraph.test.js +587 -0
  329. package/dist/graph/__tests__/HydratingFederatedGraph.test.js.map +1 -0
  330. package/dist/graph/__tests__/debounce.test.d.ts +5 -0
  331. package/dist/graph/__tests__/debounce.test.d.ts.map +1 -0
  332. package/dist/graph/__tests__/debounce.test.js +195 -0
  333. package/dist/graph/__tests__/debounce.test.js.map +1 -0
  334. package/dist/graph/__tests__/edge-cases.test.d.ts +8 -0
  335. package/dist/graph/__tests__/edge-cases.test.d.ts.map +1 -0
  336. package/dist/graph/__tests__/edge-cases.test.js +472 -0
  337. package/dist/graph/__tests__/edge-cases.test.js.map +1 -0
  338. package/dist/graph/__tests__/expansion.test.d.ts +2 -0
  339. package/dist/graph/__tests__/expansion.test.d.ts.map +1 -0
  340. package/dist/graph/__tests__/expansion.test.js +105 -0
  341. package/dist/graph/__tests__/expansion.test.js.map +1 -0
  342. package/dist/graph/__tests__/provider-store.test.d.ts +5 -0
  343. package/dist/graph/__tests__/provider-store.test.d.ts.map +1 -0
  344. package/dist/graph/__tests__/provider-store.test.js +791 -0
  345. package/dist/graph/__tests__/provider-store.test.js.map +1 -0
  346. package/dist/graph/__tests__/query.test.d.ts +5 -0
  347. package/dist/graph/__tests__/query.test.d.ts.map +1 -0
  348. package/dist/graph/__tests__/query.test.js +774 -0
  349. package/dist/graph/__tests__/query.test.js.map +1 -0
  350. package/dist/graph/__tests__/store.test.d.ts +5 -0
  351. package/dist/graph/__tests__/store.test.d.ts.map +1 -0
  352. package/dist/graph/__tests__/store.test.js +489 -0
  353. package/dist/graph/__tests__/store.test.js.map +1 -0
  354. package/dist/graph/__tests__/sync.test.d.ts +5 -0
  355. package/dist/graph/__tests__/sync.test.d.ts.map +1 -0
  356. package/dist/graph/__tests__/sync.test.js +129 -0
  357. package/dist/graph/__tests__/sync.test.js.map +1 -0
  358. package/dist/graph/__tests__/validation.test.d.ts +2 -0
  359. package/dist/graph/__tests__/validation.test.d.ts.map +1 -0
  360. package/dist/graph/__tests__/validation.test.js +521 -0
  361. package/dist/graph/__tests__/validation.test.js.map +1 -0
  362. package/dist/graph/coordination.d.ts +190 -0
  363. package/dist/graph/coordination.d.ts.map +1 -0
  364. package/dist/graph/coordination.js +180 -0
  365. package/dist/graph/coordination.js.map +1 -0
  366. package/dist/graph/debounce.d.ts +47 -0
  367. package/dist/graph/debounce.d.ts.map +1 -0
  368. package/dist/graph/debounce.js +95 -0
  369. package/dist/graph/debounce.js.map +1 -0
  370. package/dist/graph/expansion.d.ts +64 -0
  371. package/dist/graph/expansion.d.ts.map +1 -0
  372. package/dist/graph/expansion.js +205 -0
  373. package/dist/graph/expansion.js.map +1 -0
  374. package/dist/graph/history.d.ts +186 -0
  375. package/dist/graph/history.d.ts.map +1 -0
  376. package/dist/graph/history.js +155 -0
  377. package/dist/graph/history.js.map +1 -0
  378. package/dist/graph/index.d.ts +35 -0
  379. package/dist/graph/index.d.ts.map +1 -0
  380. package/dist/graph/index.js +22 -0
  381. package/dist/graph/index.js.map +1 -0
  382. package/dist/graph/provider-store.d.ts +211 -0
  383. package/dist/graph/provider-store.d.ts.map +1 -0
  384. package/dist/graph/provider-store.js +568 -0
  385. package/dist/graph/provider-store.js.map +1 -0
  386. package/dist/graph/query.d.ts +90 -0
  387. package/dist/graph/query.d.ts.map +1 -0
  388. package/dist/graph/query.js +463 -0
  389. package/dist/graph/query.js.map +1 -0
  390. package/dist/graph/store.d.ts +71 -0
  391. package/dist/graph/store.d.ts.map +1 -0
  392. package/dist/graph/store.js +530 -0
  393. package/dist/graph/store.js.map +1 -0
  394. package/dist/graph/sync.d.ts +48 -0
  395. package/dist/graph/sync.d.ts.map +1 -0
  396. package/dist/graph/sync.js +60 -0
  397. package/dist/graph/sync.js.map +1 -0
  398. package/dist/graph/types.d.ts +289 -0
  399. package/dist/graph/types.d.ts.map +1 -0
  400. package/dist/graph/types.js +19 -0
  401. package/dist/graph/types.js.map +1 -0
  402. package/dist/graph/validation.d.ts +26 -0
  403. package/dist/graph/validation.d.ts.map +1 -0
  404. package/dist/graph/validation.js +338 -0
  405. package/dist/graph/validation.js.map +1 -0
  406. package/dist/index.d.ts +25 -14
  407. package/dist/index.d.ts.map +1 -1
  408. package/dist/index.js +22 -25
  409. package/dist/index.js.map +1 -1
  410. package/dist/materialization/archiver.d.ts +12 -0
  411. package/dist/materialization/archiver.d.ts.map +1 -0
  412. package/dist/materialization/archiver.js +273 -0
  413. package/dist/materialization/archiver.js.map +1 -0
  414. package/dist/materialization/git-archive-store.d.ts +17 -0
  415. package/dist/materialization/git-archive-store.d.ts.map +1 -0
  416. package/dist/materialization/git-archive-store.js +509 -0
  417. package/dist/materialization/git-archive-store.js.map +1 -0
  418. package/dist/materialization/git-remote-store.d.ts +22 -0
  419. package/dist/materialization/git-remote-store.d.ts.map +1 -0
  420. package/dist/materialization/git-remote-store.js +448 -0
  421. package/dist/materialization/git-remote-store.js.map +1 -0
  422. package/dist/materialization/graph-id.d.ts +53 -0
  423. package/dist/materialization/graph-id.d.ts.map +1 -0
  424. package/dist/materialization/graph-id.js +163 -0
  425. package/dist/materialization/graph-id.js.map +1 -0
  426. package/dist/materialization/http-remote-store.d.ts +12 -0
  427. package/dist/materialization/http-remote-store.d.ts.map +1 -0
  428. package/dist/materialization/http-remote-store.js +143 -0
  429. package/dist/materialization/http-remote-store.js.map +1 -0
  430. package/dist/materialization/index.d.ts +15 -0
  431. package/dist/materialization/index.d.ts.map +1 -0
  432. package/dist/materialization/index.js +17 -0
  433. package/dist/materialization/index.js.map +1 -0
  434. package/dist/materialization/remote-store-factory.d.ts +17 -0
  435. package/dist/materialization/remote-store-factory.d.ts.map +1 -0
  436. package/dist/materialization/remote-store-factory.js +46 -0
  437. package/dist/materialization/remote-store-factory.js.map +1 -0
  438. package/dist/materialization/snapshot.d.ts +34 -0
  439. package/dist/materialization/snapshot.d.ts.map +1 -0
  440. package/dist/materialization/snapshot.js +177 -0
  441. package/dist/materialization/snapshot.js.map +1 -0
  442. package/dist/materialization/types.d.ts +300 -0
  443. package/dist/materialization/types.d.ts.map +1 -0
  444. package/dist/materialization/types.js +17 -0
  445. package/dist/materialization/types.js.map +1 -0
  446. package/dist/providers/__tests__/beads.test.d.ts +5 -0
  447. package/dist/providers/__tests__/beads.test.d.ts.map +1 -0
  448. package/dist/providers/__tests__/beads.test.js +591 -0
  449. package/dist/providers/__tests__/beads.test.js.map +1 -0
  450. package/dist/providers/__tests__/claude-tasks.test.d.ts +5 -0
  451. package/dist/providers/__tests__/claude-tasks.test.d.ts.map +1 -0
  452. package/dist/providers/__tests__/claude-tasks.test.js +392 -0
  453. package/dist/providers/__tests__/claude-tasks.test.js.map +1 -0
  454. package/dist/providers/__tests__/from-config.test.d.ts +5 -0
  455. package/dist/providers/__tests__/from-config.test.d.ts.map +1 -0
  456. package/dist/providers/__tests__/from-config.test.js +152 -0
  457. package/dist/providers/__tests__/from-config.test.js.map +1 -0
  458. package/dist/providers/__tests__/materialization.test.d.ts +5 -0
  459. package/dist/providers/__tests__/materialization.test.d.ts.map +1 -0
  460. package/dist/providers/__tests__/materialization.test.js +407 -0
  461. package/dist/providers/__tests__/materialization.test.js.map +1 -0
  462. package/dist/providers/__tests__/native.test.d.ts +5 -0
  463. package/dist/providers/__tests__/native.test.d.ts.map +1 -0
  464. package/dist/providers/__tests__/native.test.js +566 -0
  465. package/dist/providers/__tests__/native.test.js.map +1 -0
  466. package/dist/providers/__tests__/registry.test.d.ts +5 -0
  467. package/dist/providers/__tests__/registry.test.d.ts.map +1 -0
  468. package/dist/providers/__tests__/registry.test.js +183 -0
  469. package/dist/providers/__tests__/registry.test.js.map +1 -0
  470. package/dist/providers/beads.d.ts +46 -0
  471. package/dist/providers/beads.d.ts.map +1 -0
  472. package/dist/providers/beads.js +865 -0
  473. package/dist/providers/beads.js.map +1 -0
  474. package/dist/providers/claude-tasks.d.ts +56 -0
  475. package/dist/providers/claude-tasks.d.ts.map +1 -0
  476. package/dist/providers/claude-tasks.js +282 -0
  477. package/dist/providers/claude-tasks.js.map +1 -0
  478. package/dist/providers/entire.d.ts +88 -0
  479. package/dist/providers/entire.d.ts.map +1 -0
  480. package/dist/providers/entire.js +409 -0
  481. package/dist/providers/entire.js.map +1 -0
  482. package/dist/providers/from-config.d.ts +47 -0
  483. package/dist/providers/from-config.d.ts.map +1 -0
  484. package/dist/providers/from-config.js +150 -0
  485. package/dist/providers/from-config.js.map +1 -0
  486. package/dist/providers/index.d.ts +26 -0
  487. package/dist/providers/index.d.ts.map +1 -0
  488. package/dist/providers/index.js +29 -0
  489. package/dist/providers/index.js.map +1 -0
  490. package/dist/providers/location.d.ts +44 -0
  491. package/dist/providers/location.d.ts.map +1 -0
  492. package/dist/providers/location.js +157 -0
  493. package/dist/providers/location.js.map +1 -0
  494. package/dist/providers/materialization.d.ts +46 -0
  495. package/dist/providers/materialization.d.ts.map +1 -0
  496. package/dist/providers/materialization.js +237 -0
  497. package/dist/providers/materialization.js.map +1 -0
  498. package/dist/providers/native.d.ts +32 -0
  499. package/dist/providers/native.d.ts.map +1 -0
  500. package/dist/providers/native.js +552 -0
  501. package/dist/providers/native.js.map +1 -0
  502. package/dist/providers/registry.d.ts +11 -0
  503. package/dist/providers/registry.d.ts.map +1 -0
  504. package/dist/providers/registry.js +97 -0
  505. package/dist/providers/registry.js.map +1 -0
  506. package/dist/providers/sudocode.d.ts +49 -0
  507. package/dist/providers/sudocode.d.ts.map +1 -0
  508. package/dist/providers/sudocode.js +945 -0
  509. package/dist/providers/sudocode.js.map +1 -0
  510. package/dist/providers/sync.d.ts +299 -0
  511. package/dist/providers/sync.d.ts.map +1 -0
  512. package/dist/providers/sync.js +93 -0
  513. package/dist/providers/sync.js.map +1 -0
  514. package/dist/providers/traits/RelationshipQueryable.d.ts +129 -0
  515. package/dist/providers/traits/RelationshipQueryable.d.ts.map +1 -0
  516. package/dist/providers/traits/RelationshipQueryable.js +68 -0
  517. package/dist/providers/traits/RelationshipQueryable.js.map +1 -0
  518. package/dist/providers/traits/TaskManageable.d.ts +157 -0
  519. package/dist/providers/traits/TaskManageable.d.ts.map +1 -0
  520. package/dist/providers/traits/TaskManageable.js +37 -0
  521. package/dist/providers/traits/TaskManageable.js.map +1 -0
  522. package/dist/providers/traits/Watchable.d.ts +216 -0
  523. package/dist/providers/traits/Watchable.d.ts.map +1 -0
  524. package/dist/providers/traits/Watchable.js +37 -0
  525. package/dist/providers/traits/Watchable.js.map +1 -0
  526. package/dist/providers/traits/__tests__/RelationshipQueryable.test.d.ts +2 -0
  527. package/dist/providers/traits/__tests__/RelationshipQueryable.test.d.ts.map +1 -0
  528. package/dist/providers/traits/__tests__/RelationshipQueryable.test.js +169 -0
  529. package/dist/providers/traits/__tests__/RelationshipQueryable.test.js.map +1 -0
  530. package/dist/providers/traits/__tests__/TaskManageable.test.d.ts +2 -0
  531. package/dist/providers/traits/__tests__/TaskManageable.test.d.ts.map +1 -0
  532. package/dist/providers/traits/__tests__/TaskManageable.test.js +172 -0
  533. package/dist/providers/traits/__tests__/TaskManageable.test.js.map +1 -0
  534. package/dist/providers/traits/index.d.ts +13 -0
  535. package/dist/providers/traits/index.d.ts.map +1 -0
  536. package/dist/providers/traits/index.js +10 -0
  537. package/dist/providers/traits/index.js.map +1 -0
  538. package/dist/providers/types.d.ts +284 -0
  539. package/dist/providers/types.d.ts.map +1 -0
  540. package/dist/providers/types.js +30 -0
  541. package/dist/providers/types.js.map +1 -0
  542. package/dist/schema/__tests__/validation.test.d.ts +2 -0
  543. package/dist/schema/__tests__/validation.test.d.ts.map +1 -0
  544. package/dist/schema/__tests__/validation.test.js +241 -0
  545. package/dist/schema/__tests__/validation.test.js.map +1 -0
  546. package/dist/schema/base.d.ts +68 -0
  547. package/dist/schema/base.d.ts.map +1 -0
  548. package/dist/schema/base.js +5 -0
  549. package/dist/schema/base.js.map +1 -0
  550. package/dist/schema/edges.d.ts +49 -0
  551. package/dist/schema/edges.d.ts.map +1 -0
  552. package/dist/schema/edges.js +9 -0
  553. package/dist/schema/edges.js.map +1 -0
  554. package/dist/schema/index.d.ts +11 -0
  555. package/dist/schema/index.d.ts.map +1 -0
  556. package/dist/schema/index.js +8 -0
  557. package/dist/schema/index.js.map +1 -0
  558. package/dist/schema/nodes.d.ts +97 -0
  559. package/dist/schema/nodes.d.ts.map +1 -0
  560. package/dist/schema/nodes.js +5 -0
  561. package/dist/schema/nodes.js.map +1 -0
  562. package/dist/schema/storage.d.ts +107 -0
  563. package/dist/schema/storage.d.ts.map +1 -0
  564. package/dist/schema/storage.js +10 -0
  565. package/dist/schema/storage.js.map +1 -0
  566. package/dist/schema/validation.d.ts +61 -0
  567. package/dist/schema/validation.d.ts.map +1 -0
  568. package/dist/schema/validation.js +170 -0
  569. package/dist/schema/validation.js.map +1 -0
  570. package/dist/storage/__tests__/atomic-write.test.d.ts +5 -0
  571. package/dist/storage/__tests__/atomic-write.test.d.ts.map +1 -0
  572. package/dist/storage/__tests__/atomic-write.test.js +170 -0
  573. package/dist/storage/__tests__/atomic-write.test.js.map +1 -0
  574. package/dist/storage/__tests__/file-lock.test.d.ts +2 -0
  575. package/dist/storage/__tests__/file-lock.test.d.ts.map +1 -0
  576. package/dist/storage/__tests__/file-lock.test.js +89 -0
  577. package/dist/storage/__tests__/file-lock.test.js.map +1 -0
  578. package/dist/storage/__tests__/jsonl.test.d.ts +2 -0
  579. package/dist/storage/__tests__/jsonl.test.d.ts.map +1 -0
  580. package/dist/storage/__tests__/jsonl.test.js +228 -0
  581. package/dist/storage/__tests__/jsonl.test.js.map +1 -0
  582. package/dist/storage/__tests__/locked-writer.test.d.ts +2 -0
  583. package/dist/storage/__tests__/locked-writer.test.d.ts.map +1 -0
  584. package/dist/storage/__tests__/locked-writer.test.js +109 -0
  585. package/dist/storage/__tests__/locked-writer.test.js.map +1 -0
  586. package/dist/storage/__tests__/sqlite.test.d.ts +2 -0
  587. package/dist/storage/__tests__/sqlite.test.d.ts.map +1 -0
  588. package/dist/storage/__tests__/sqlite.test.js +470 -0
  589. package/dist/storage/__tests__/sqlite.test.js.map +1 -0
  590. package/dist/storage/atomic-write.d.ts +38 -0
  591. package/dist/storage/atomic-write.d.ts.map +1 -0
  592. package/dist/storage/atomic-write.js +83 -0
  593. package/dist/storage/atomic-write.js.map +1 -0
  594. package/dist/storage/file-lock.d.ts +66 -0
  595. package/dist/storage/file-lock.d.ts.map +1 -0
  596. package/dist/storage/file-lock.js +176 -0
  597. package/dist/storage/file-lock.js.map +1 -0
  598. package/dist/storage/index.d.ts +11 -0
  599. package/dist/storage/index.d.ts.map +1 -0
  600. package/dist/storage/index.js +13 -0
  601. package/dist/storage/index.js.map +1 -0
  602. package/dist/storage/interface.d.ts +219 -0
  603. package/dist/storage/interface.d.ts.map +1 -0
  604. package/dist/storage/interface.js +22 -0
  605. package/dist/storage/interface.js.map +1 -0
  606. package/dist/storage/jsonl.d.ts +106 -0
  607. package/dist/storage/jsonl.d.ts.map +1 -0
  608. package/dist/storage/jsonl.js +218 -0
  609. package/dist/storage/jsonl.js.map +1 -0
  610. package/dist/storage/locked-writer.d.ts +67 -0
  611. package/dist/storage/locked-writer.d.ts.map +1 -0
  612. package/dist/storage/locked-writer.js +105 -0
  613. package/dist/storage/locked-writer.js.map +1 -0
  614. package/dist/storage/sqlite-schema.d.ts +48 -0
  615. package/dist/storage/sqlite-schema.d.ts.map +1 -0
  616. package/dist/storage/sqlite-schema.js +169 -0
  617. package/dist/storage/sqlite-schema.js.map +1 -0
  618. package/dist/storage/sqlite.d.ts +73 -0
  619. package/dist/storage/sqlite.d.ts.map +1 -0
  620. package/dist/storage/sqlite.js +698 -0
  621. package/dist/storage/sqlite.js.map +1 -0
  622. package/dist/tools/__tests__/annotate.test.d.ts +5 -0
  623. package/dist/tools/__tests__/annotate.test.d.ts.map +1 -0
  624. package/dist/tools/__tests__/annotate.test.js +314 -0
  625. package/dist/tools/__tests__/annotate.test.js.map +1 -0
  626. package/dist/tools/__tests__/link.test.d.ts +5 -0
  627. package/dist/tools/__tests__/link.test.d.ts.map +1 -0
  628. package/dist/tools/__tests__/link.test.js +245 -0
  629. package/dist/tools/__tests__/link.test.js.map +1 -0
  630. package/dist/tools/__tests__/query.test.d.ts +5 -0
  631. package/dist/tools/__tests__/query.test.d.ts.map +1 -0
  632. package/dist/tools/__tests__/query.test.js +288 -0
  633. package/dist/tools/__tests__/query.test.js.map +1 -0
  634. package/dist/tools/__tests__/task.test.d.ts +5 -0
  635. package/dist/tools/__tests__/task.test.d.ts.map +1 -0
  636. package/dist/tools/__tests__/task.test.js +178 -0
  637. package/dist/tools/__tests__/task.test.js.map +1 -0
  638. package/dist/tools/annotate.d.ts +17 -0
  639. package/dist/tools/annotate.d.ts.map +1 -0
  640. package/dist/tools/annotate.js +218 -0
  641. package/dist/tools/annotate.js.map +1 -0
  642. package/dist/tools/index.d.ts +14 -0
  643. package/dist/tools/index.d.ts.map +1 -0
  644. package/dist/tools/index.js +14 -0
  645. package/dist/tools/index.js.map +1 -0
  646. package/dist/tools/link.d.ts +17 -0
  647. package/dist/tools/link.d.ts.map +1 -0
  648. package/dist/tools/link.js +127 -0
  649. package/dist/tools/link.js.map +1 -0
  650. package/dist/tools/query.d.ts +17 -0
  651. package/dist/tools/query.d.ts.map +1 -0
  652. package/dist/tools/query.js +342 -0
  653. package/dist/tools/query.js.map +1 -0
  654. package/dist/tools/task.d.ts +20 -0
  655. package/dist/tools/task.d.ts.map +1 -0
  656. package/dist/tools/task.js +161 -0
  657. package/dist/tools/task.js.map +1 -0
  658. package/dist/tools/types.d.ts +334 -0
  659. package/dist/tools/types.d.ts.map +1 -0
  660. package/dist/tools/types.js +19 -0
  661. package/dist/tools/types.js.map +1 -0
  662. package/package.json +40 -5
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worktree.test.js","sourceRoot":"","sources":["../../../src/core/__tests__/worktree.test.ts"],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AI,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA;QAE5B,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,CAAA;QACvD,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,CAAA;QAEzD,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QACxC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;IACjD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Conditional Redirect Rules for OpenTasks (Phase 3)
3
+ *
4
+ * Extends Phase 2 redirect rules with role and branch conditions.
5
+ */
6
+ import type { RedirectRule, RedirectOperation } from './redirects.js';
7
+ /**
8
+ * Conditions for when a redirect rule applies
9
+ */
10
+ export interface RedirectCondition {
11
+ /** Role condition (exact match) */
12
+ role?: string;
13
+ /** Branch condition (glob pattern) */
14
+ branch?: string;
15
+ }
16
+ /**
17
+ * Extended redirect rule with conditions
18
+ */
19
+ export interface ConditionalRedirectRule extends RedirectRule {
20
+ /** Conditions that must be met for this rule to apply */
21
+ when?: RedirectCondition;
22
+ }
23
+ /**
24
+ * Runtime context for evaluating redirect conditions
25
+ */
26
+ export interface RedirectContext {
27
+ /** Current location role */
28
+ role: string;
29
+ /** Current git branch (cached) */
30
+ branch?: string;
31
+ }
32
+ /**
33
+ * Check if conditions are met
34
+ */
35
+ export declare function evaluateConditions(conditions: RedirectCondition | undefined, context: RedirectContext): boolean;
36
+ /**
37
+ * Find the first matching conditional redirect rule
38
+ *
39
+ * Extends findRedirectRule with condition evaluation.
40
+ */
41
+ export declare function findConditionalRedirectRule(operation: RedirectOperation, nodeId: string, rules: ConditionalRedirectRule[], context: RedirectContext): ConditionalRedirectRule | null;
42
+ //# sourceMappingURL=conditional-redirects.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conditional-redirects.d.ts","sourceRoot":"","sources":["../../src/core/conditional-redirects.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGtE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,YAAY;IAC3D,yDAAyD;IACzD,IAAI,CAAC,EAAE,iBAAiB,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAqBD;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,iBAAiB,GAAG,SAAS,EACzC,OAAO,EAAE,eAAe,GACvB,OAAO,CAaT;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,iBAAiB,EAC5B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,uBAAuB,EAAE,EAChC,OAAO,EAAE,eAAe,GACvB,uBAAuB,GAAG,IAAI,CAYhC"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Conditional Redirect Rules for OpenTasks (Phase 3)
3
+ *
4
+ * Extends Phase 2 redirect rules with role and branch conditions.
5
+ */
6
+ import { matchPattern } from './redirects.js';
7
+ /**
8
+ * Simple glob match for branch patterns
9
+ *
10
+ * Supports: "feature-*", "main", "*"
11
+ */
12
+ function branchMatch(pattern, branch) {
13
+ if (pattern === '*')
14
+ return true;
15
+ if (pattern.endsWith('*')) {
16
+ return branch.startsWith(pattern.slice(0, -1));
17
+ }
18
+ if (pattern.startsWith('*')) {
19
+ return branch.endsWith(pattern.slice(1));
20
+ }
21
+ return pattern === branch;
22
+ }
23
+ /**
24
+ * Check if conditions are met
25
+ */
26
+ export function evaluateConditions(conditions, context) {
27
+ if (!conditions)
28
+ return true;
29
+ if (conditions.role && conditions.role !== context.role) {
30
+ return false;
31
+ }
32
+ if (conditions.branch) {
33
+ if (!context.branch)
34
+ return false;
35
+ if (!branchMatch(conditions.branch, context.branch))
36
+ return false;
37
+ }
38
+ return true;
39
+ }
40
+ /**
41
+ * Find the first matching conditional redirect rule
42
+ *
43
+ * Extends findRedirectRule with condition evaluation.
44
+ */
45
+ export function findConditionalRedirectRule(operation, nodeId, rules, context) {
46
+ // Sort by priority (ascending — lower = higher priority)
47
+ const sorted = [...rules].sort((a, b) => a.priority - b.priority);
48
+ for (const rule of sorted) {
49
+ if (!rule.operations.includes(operation))
50
+ continue;
51
+ if (!matchPattern(rule.pattern, nodeId))
52
+ continue;
53
+ if (!evaluateConditions(rule.when, context))
54
+ continue;
55
+ return rule;
56
+ }
57
+ return null;
58
+ }
59
+ //# sourceMappingURL=conditional-redirects.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conditional-redirects.js","sourceRoot":"","sources":["../../src/core/conditional-redirects.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AA8B9C;;;;GAIG;AACH,SAAS,WAAW,CAAC,OAAe,EAAE,MAAc;IAClD,IAAI,OAAO,KAAK,GAAG;QAAE,OAAO,IAAI,CAAC;IAEjC,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC1B,OAAO,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACjD,CAAC;IAED,IAAI,OAAO,CAA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QACtD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Connection Management for OpenTasks (Phase 2)
3
+ *
4
+ * Manages explicit connections between OpenTasks locations.
5
+ * No filesystem discovery — all connections are declared in config.json.
6
+ */
7
+ /**
8
+ * Connection role
9
+ */
10
+ export type ConnectionRole = 'peer' | 'parent' | 'child';
11
+ /**
12
+ * Connection to another OpenTasks location
13
+ */
14
+ export interface Connection {
15
+ /** Location hash of the target */
16
+ hash: string;
17
+ /** Path to the target .opentasks directory (relative or absolute) */
18
+ path: string;
19
+ /** Relationship role */
20
+ role: ConnectionRole;
21
+ /** Human-readable name */
22
+ name: string;
23
+ }
24
+ /**
25
+ * Health status of a connection
26
+ */
27
+ export type ConnectionHealth = 'reachable' | 'unreachable' | 'hash-mismatch';
28
+ /**
29
+ * Connection with health information
30
+ */
31
+ export interface ConnectionStatus {
32
+ connection: Connection;
33
+ health: ConnectionHealth;
34
+ error?: string;
35
+ }
36
+ /**
37
+ * Create a connection to another OpenTasks location
38
+ *
39
+ * Reads the target's config.json to get its hash and name.
40
+ *
41
+ * @param targetPath - Path to the target .opentasks directory
42
+ * @param role - Relationship role (default: 'peer')
43
+ * @param basePath - Base path for computing relative paths
44
+ * @returns New connection, or throws on error
45
+ */
46
+ export declare function createConnection(targetPath: string, role?: ConnectionRole, basePath?: string): Connection;
47
+ /**
48
+ * Check the health of a connection
49
+ *
50
+ * @param connection - The connection to check
51
+ * @param basePath - Base path for resolving relative paths
52
+ * @returns Connection status with health information
53
+ */
54
+ export declare function checkConnectionHealth(connection: Connection, basePath?: string): ConnectionStatus;
55
+ /**
56
+ * Add a connection to a list, replacing any existing connection with the same hash
57
+ *
58
+ * @param connections - Existing connections
59
+ * @param newConnection - Connection to add
60
+ * @returns Updated connections list
61
+ */
62
+ export declare function addConnection(connections: Connection[], newConnection: Connection): Connection[];
63
+ /**
64
+ * Remove a connection by hash
65
+ *
66
+ * @param connections - Existing connections
67
+ * @param hash - Hash of the connection to remove
68
+ * @returns Updated connections list
69
+ */
70
+ export declare function removeConnection(connections: Connection[], hash: string): Connection[];
71
+ /**
72
+ * Find a connection by hash
73
+ *
74
+ * @param connections - Connections to search
75
+ * @param hash - Location hash to find
76
+ * @returns The connection or undefined
77
+ */
78
+ export declare function findConnection(connections: Connection[], hash: string): Connection | undefined;
79
+ /**
80
+ * Get health status for all connections
81
+ *
82
+ * @param connections - Connections to check
83
+ * @param basePath - Base path for resolving relative paths
84
+ * @returns Array of connection statuses
85
+ */
86
+ export declare function checkAllConnectionHealth(connections: Connection[], basePath?: string): ConnectionStatus[];
87
+ //# sourceMappingURL=connections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connections.d.ts","sourceRoot":"","sources":["../../src/core/connections.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,wBAAwB;IACxB,IAAI,EAAE,cAAc,CAAC;IACrB,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,aAAa,GAAG,eAAe,CAAC;AAE7E;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,UAAU,CAAC;IACvB,MAAM,EAAE,gBAAgB,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAiCD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,MAAM,EAClB,IAAI,GAAE,cAAuB,EAC7B,QAAQ,CAAC,EAAE,MAAM,GAChB,UAAU,CAuBZ;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,gBAAgB,CA8CjG;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,aAAa,EAAE,UAAU,GAAG,UAAU,EAAE,CAIhG;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE,CAEtF;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAE9F;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,WAAW,EAAE,UAAU,EAAE,EACzB,QAAQ,CAAC,EAAE,MAAM,GAChB,gBAAgB,EAAE,CAEpB"}
@@ -0,0 +1,160 @@
1
+ /**
2
+ * Connection Management for OpenTasks (Phase 2)
3
+ *
4
+ * Manages explicit connections between OpenTasks locations.
5
+ * No filesystem discovery — all connections are declared in config.json.
6
+ */
7
+ import * as fs from 'node:fs';
8
+ import * as path from 'node:path';
9
+ /**
10
+ * Read the config.json of a target location
11
+ *
12
+ * @param opentasksPath - Path to the target .opentasks directory
13
+ * @returns The parsed config or null if not readable
14
+ */
15
+ function readTargetConfig(opentasksPath) {
16
+ try {
17
+ const configPath = path.join(opentasksPath, 'config.json');
18
+ const content = fs.readFileSync(configPath, 'utf-8');
19
+ return JSON.parse(content);
20
+ }
21
+ catch {
22
+ return null;
23
+ }
24
+ }
25
+ /**
26
+ * Extract location identity from a config object
27
+ */
28
+ function extractLocation(config) {
29
+ const loc = config.location;
30
+ if (!loc || typeof loc.hash !== 'string' || typeof loc.uuid !== 'string') {
31
+ return null;
32
+ }
33
+ return {
34
+ hash: loc.hash,
35
+ uuid: loc.uuid,
36
+ name: loc.name || '',
37
+ };
38
+ }
39
+ /**
40
+ * Create a connection to another OpenTasks location
41
+ *
42
+ * Reads the target's config.json to get its hash and name.
43
+ *
44
+ * @param targetPath - Path to the target .opentasks directory
45
+ * @param role - Relationship role (default: 'peer')
46
+ * @param basePath - Base path for computing relative paths
47
+ * @returns New connection, or throws on error
48
+ */
49
+ export function createConnection(targetPath, role = 'peer', basePath) {
50
+ const resolvedTarget = path.resolve(targetPath);
51
+ // Read target config
52
+ const config = readTargetConfig(resolvedTarget);
53
+ if (!config) {
54
+ throw new Error(`Cannot read config at: ${resolvedTarget}/config.json`);
55
+ }
56
+ const location = extractLocation(config);
57
+ if (!location) {
58
+ throw new Error(`No valid location identity in: ${resolvedTarget}/config.json`);
59
+ }
60
+ // Compute relative path if base is provided
61
+ const connectionPath = basePath ? path.relative(basePath, resolvedTarget) : resolvedTarget;
62
+ return {
63
+ hash: location.hash,
64
+ path: connectionPath,
65
+ role,
66
+ name: location.name,
67
+ };
68
+ }
69
+ /**
70
+ * Check the health of a connection
71
+ *
72
+ * @param connection - The connection to check
73
+ * @param basePath - Base path for resolving relative paths
74
+ * @returns Connection status with health information
75
+ */
76
+ export function checkConnectionHealth(connection, basePath) {
77
+ const resolvedPath = basePath
78
+ ? path.resolve(basePath, connection.path)
79
+ : path.resolve(connection.path);
80
+ // 1. Does the path exist?
81
+ if (!fs.existsSync(resolvedPath)) {
82
+ return {
83
+ connection,
84
+ health: 'unreachable',
85
+ error: `Path does not exist: ${resolvedPath}`,
86
+ };
87
+ }
88
+ // 2. Is there a valid config.json?
89
+ const config = readTargetConfig(resolvedPath);
90
+ if (!config) {
91
+ return {
92
+ connection,
93
+ health: 'unreachable',
94
+ error: `Cannot read config.json at: ${resolvedPath}`,
95
+ };
96
+ }
97
+ // 3. Does the hash match?
98
+ const location = extractLocation(config);
99
+ if (!location) {
100
+ return {
101
+ connection,
102
+ health: 'unreachable',
103
+ error: `No valid location identity in config.json`,
104
+ };
105
+ }
106
+ if (location.hash !== connection.hash) {
107
+ return {
108
+ connection,
109
+ health: 'hash-mismatch',
110
+ error: `Expected hash ${connection.hash}, found ${location.hash}`,
111
+ };
112
+ }
113
+ return {
114
+ connection,
115
+ health: 'reachable',
116
+ };
117
+ }
118
+ /**
119
+ * Add a connection to a list, replacing any existing connection with the same hash
120
+ *
121
+ * @param connections - Existing connections
122
+ * @param newConnection - Connection to add
123
+ * @returns Updated connections list
124
+ */
125
+ export function addConnection(connections, newConnection) {
126
+ // Remove existing with same hash
127
+ const filtered = connections.filter((c) => c.hash !== newConnection.hash);
128
+ return [...filtered, newConnection];
129
+ }
130
+ /**
131
+ * Remove a connection by hash
132
+ *
133
+ * @param connections - Existing connections
134
+ * @param hash - Hash of the connection to remove
135
+ * @returns Updated connections list
136
+ */
137
+ export function removeConnection(connections, hash) {
138
+ return connections.filter((c) => c.hash !== hash);
139
+ }
140
+ /**
141
+ * Find a connection by hash
142
+ *
143
+ * @param connections - Connections to search
144
+ * @param hash - Location hash to find
145
+ * @returns The connection or undefined
146
+ */
147
+ export function findConnection(connections, hash) {
148
+ return connections.find((c) => c.hash === hash);
149
+ }
150
+ /**
151
+ * Get health status for all connections
152
+ *
153
+ * @param connections - Connections to check
154
+ * @param basePath - Base path for resolving relative paths
155
+ * @returns Array of connection statuses
156
+ */
157
+ export function checkAllConnectionHealth(connections, basePath) {
158
+ return connections.map((c) => checkConnectionHealth(c, basePath));
159
+ }
160
+ //# sourceMappingURL=connections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connections.js","sourceRoot":"","sources":["../../src/core/connections.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAoClC;;;;;GAKG;AACH,SAAS,gBAAgB,CAAC,aAAqB;IAC7C,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;QAC3D,MAAM,OAA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CAAC;IAED,OAAO;QACL,UAAU;QACV,MAAM,EAAE,WAAW;KACpB,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,WAAyB,EAAE,aAAyB;IAChF,iCAAiC;IACjC,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,aAAa,CAAC,IAAI,CAAC,CAAC;IAC1E,OAAO,CAAC,GAAG,QAAQ,EAAE,aAAa,CAAC,CAAC;AACtC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,WAAyB,EAAE,IAAY;IACtE,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACpD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,WAAyB,EAAE,IAAY;IACpE,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AAClD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CACtC,WAAyB,EACzB,QAAiB;IAEjB,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,qBAAqB,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC;AACpE,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Location Discovery for OpenTasks (Phase 3)
3
+ *
4
+ * Finds nearby OpenTasks locations by walking the filesystem
5
+ * in configurable directions from the current working directory.
6
+ */
7
+ /**
8
+ * Discovered OpenTasks location
9
+ */
10
+ export interface DiscoveredLocation {
11
+ /** Absolute path to the .opentasks directory */
12
+ opentasksPath: string;
13
+ /** Location hash (from config.json) */
14
+ hash: string;
15
+ /** Human-readable name */
16
+ name: string;
17
+ /** Relative direction from search origin */
18
+ direction: 'up' | 'down' | 'self';
19
+ /** Filesystem depth from search origin */
20
+ depth: number;
21
+ }
22
+ /**
23
+ * Discovery options
24
+ */
25
+ export interface DiscoverOptions {
26
+ /** Search direction: 'up' (parents), 'down' (children), 'both' */
27
+ direction?: 'up' | 'down' | 'both';
28
+ /** Maximum depth to traverse (default: 5) */
29
+ maxDepth?: number;
30
+ }
31
+ /**
32
+ * Discover OpenTasks locations near the given directory
33
+ *
34
+ * @param startDir - Directory to start searching from
35
+ * @param options - Discovery options
36
+ * @returns Array of discovered locations
37
+ */
38
+ export declare function discoverLocations(startDir: string, options?: DiscoverOptions): DiscoveredLocation[];
39
+ //# sourceMappingURL=discover.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discover.d.ts","sourceRoot":"","sources":["../../src/core/discover.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,gDAAgD;IAChD,aAAa,EAAE,MAAM,CAAC;IACtB,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,SAAS,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;IAClC,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,kEAAkE;IAClE,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;IACnC,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAsGD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,eAAoB,GAC5B,kBAAkB,EAAE,CA+BtB"}
@@ -0,0 +1,136 @@
1
+ /**
2
+ * Location Discovery for OpenTasks (Phase 3)
3
+ *
4
+ * Finds nearby OpenTasks locations by walking the filesystem
5
+ * in configurable directions from the current working directory.
6
+ */
7
+ import * as fs from 'node:fs';
8
+ import * as path from 'node:path';
9
+ /**
10
+ * Read location identity from a .opentasks/config.json file
11
+ */
12
+ function readLocationConfig(opentasksDir) {
13
+ const configPath = path.join(opentasksDir, 'config.json');
14
+ try {
15
+ const content = fs.readFileSync(configPath, 'utf-8');
16
+ const config = JSON.parse(content);
17
+ if (config.location?.hash) {
18
+ return {
19
+ hash: config.location.hash,
20
+ name: config.location.name || '',
21
+ };
22
+ }
23
+ return null;
24
+ }
25
+ catch {
26
+ return null;
27
+ }
28
+ }
29
+ /**
30
+ * Walk upward from a directory looking for .opentasks locations
31
+ */
32
+ function discoverUp(startDir, maxDepth) {
33
+ const results = [];
34
+ let currentDir = path.dirname(startDir); // Start from parent
35
+ let depth = 1;
36
+ while (depth <= maxDepth) {
37
+ // Check if this directory has a .opentasks
38
+ const opentasksDir = path.join(currentDir, '.opentasks');
39
+ if (fs.existsSync(opentasksDir)) {
40
+ const config = readLocationConfig(opentasksDir);
41
+ if (config) {
42
+ results.push({
43
+ opentasksPath: opentasksDir,
44
+ hash: config.hash,
45
+ name: config.name,
46
+ direction: 'up',
47
+ depth,
48
+ });
49
+ }
50
+ }
51
+ // Move to parent
52
+ const parentDir = path.dirname(currentDir);
53
+ if (parentDir === currentDir)
54
+ break; // Reached filesystem root
55
+ currentDir = parentDir;
56
+ depth++;
57
+ }
58
+ return results;
59
+ }
60
+ /**
61
+ * Walk downward from a directory looking for .opentasks locations
62
+ */
63
+ function discoverDown(startDir, maxDepth) {
64
+ const results = [];
65
+ function walk(dir, depth) {
66
+ if (depth > maxDepth)
67
+ return;
68
+ let entries;
69
+ try {
70
+ entries = fs.readdirSync(dir, { withFileTypes: true });
71
+ }
72
+ catch {
73
+ return;
74
+ }
75
+ for (const entry of entries) {
76
+ if (!entry.isDirectory())
77
+ continue;
78
+ // Skip hidden directories (except .opentasks itself) and node_modules
79
+ if (entry.name.startsWith('.') || entry.name === 'node_modules')
80
+ continue;
81
+ const childDir = path.join(dir, entry.name);
82
+ const opentasksDir = path.join(childDir, '.opentasks');
83
+ if (fs.existsSync(opentasksDir)) {
84
+ const config = readLocationConfig(opentasksDir);
85
+ if (config) {
86
+ results.push({
87
+ opentasksPath: opentasksDir,
88
+ hash: config.hash,
89
+ name: config.name,
90
+ direction: 'down',
91
+ depth,
92
+ });
93
+ }
94
+ }
95
+ // Continue walking into subdirectories
96
+ walk(childDir, depth + 1);
97
+ }
98
+ }
99
+ walk(startDir, 1);
100
+ return results;
101
+ }
102
+ /**
103
+ * Discover OpenTasks locations near the given directory
104
+ *
105
+ * @param startDir - Directory to start searching from
106
+ * @param options - Discovery options
107
+ * @returns Array of discovered locations
108
+ */
109
+ export function discoverLocations(startDir, options = {}) {
110
+ const direction = options.direction ?? 'both';
111
+ const maxDepth = options.maxDepth ?? 5;
112
+ const resolvedStart = path.resolve(startDir);
113
+ const results = [];
114
+ // Check self first
115
+ const selfOpentasks = path.join(resolvedStart, '.opentasks');
116
+ if (fs.existsSync(selfOpentasks)) {
117
+ const config = readLocationConfig(selfOpentasks);
118
+ if (config) {
119
+ results.push({
120
+ opentasksPath: selfOpentasks,
121
+ hash: config.hash,
122
+ name: config.name,
123
+ direction: 'self',
124
+ depth: 0,
125
+ });
126
+ }
127
+ }
128
+ if (direction === 'up' || direction === 'both') {
129
+ results.push(...discoverUp(resolvedStart, maxDepth));
130
+ }
131
+ if (direction === 'down' || direction === 'both') {
132
+ results.push(...discoverDown(resolvedStart, maxDepth));
133
+ }
134
+ return results;
135
+ }
136
+ //# sourceMappingURL=discover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discover.js","sourceRoot":"","sources":["../../src/core/discover.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AA4BlC;;GAEG;AACH,SAAS,kBAAkB,CAAC,YAAoB;IAC9C,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,CAAC,CAAC;IACvD,CAAC;IAED,IAAI,SAAS,KAAK,MAAM,IAAI,SAAS,KAAK,MAAM,EAAE,CAAC;QACjD,OAAO,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAC;IACzD,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Content hashing for OpenTasks
3
+ *
4
+ * Used for deduplication during merge and change detection.
5
+ */
6
+ import type { StoredNode } from '../schema/storage.js';
7
+ /**
8
+ * Compute SHA256 hash of a string
9
+ */
10
+ export declare function sha256(input: string): string;
11
+ /**
12
+ * Compute content hash for a node
13
+ *
14
+ * Only includes substantive fields (content that affects semantics).
15
+ * Excludes: id, uuid, timestamps, coordination fields, metadata.
16
+ *
17
+ * @param node - The node to hash
18
+ * @returns SHA256 hash as hex string
19
+ */
20
+ export declare function computeContentHash(node: StoredNode): string;
21
+ /**
22
+ * Check if two nodes have the same content (ignoring non-substantive fields)
23
+ */
24
+ export declare function contentEqual(a: StoredNode, b: StoredNode): boolean;
25
+ //# sourceMappingURL=hash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../src/core/hash.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;GAEG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAyC3D;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAAG,OAAO,CAElE"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Content hashing for OpenTasks
3
+ *
4
+ * Used for deduplication during merge and change detection.
5
+ */
6
+ import { createHash } from 'node:crypto';
7
+ /**
8
+ * Compute SHA256 hash of a string
9
+ */
10
+ export function sha256(input) {
11
+ return createHash('sha256').update(input).digest('hex');
12
+ }
13
+ /**
14
+ * Compute content hash for a node
15
+ *
16
+ * Only includes substantive fields (content that affects semantics).
17
+ * Excludes: id, uuid, timestamps, coordination fields, metadata.
18
+ *
19
+ * @param node - The node to hash
20
+ * @returns SHA256 hash as hex string
21
+ */
22
+ export function computeContentHash(node) {
23
+ // Build object with only substantive fields
24
+ const substantive = {
25
+ type: node.type,
26
+ title: node.title,
27
+ content: node.content,
28
+ status: node.status,
29
+ priority: node.priority,
30
+ tags: node.tags ? [...node.tags].sort() : undefined,
31
+ parent_id: node.parent_id,
32
+ };
33
+ // Add type-specific substantive fields
34
+ if (node.type === 'task') {
35
+ substantive.assignee = node.assignee;
36
+ }
37
+ if (node.type === 'feedback') {
38
+ substantive.target_id = node.target_id;
39
+ substantive.feedback_type = node.feedback_type;
40
+ substantive.target_anchor = node.target_anchor;
41
+ }
42
+ if (node.type === 'external') {
43
+ substantive.uri = node.uri;
44
+ substantive.source = node.source;
45
+ }
46
+ // Remove undefined values for consistent hashing
47
+ const cleaned = Object.fromEntries(Object.entries(substantive).filter(([_, v]) => v !== undefined));
48
+ // Sort keys for deterministic JSON
49
+ const sortedKeys = Object.keys(cleaned).sort();
50
+ const orderedObj = {};
51
+ for (const key of sortedKeys) {
52
+ orderedObj[key] = cleaned[key];
53
+ }
54
+ return sha256(JSON.stringify(orderedObj));
55
+ }
56
+ /**
57
+ * Check if two nodes have the same content (ignoring non-substantive fields)
58
+ */
59
+ export function contentEqual(a, b) {
60
+ return computeContentHash(a) === computeContentHash(b);
61
+ }
62
+ //# sourceMappingURL=hash.js.map