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":"hash.js","sourceRoot":"","sources":["../../src/core/hash.ts"],"names":[],"mappings":"A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C;IAED,iDAAiD;IACjD,MAAM,OAAO,GAAG,MAAM,CAAC,WAAW,CAChC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAChE,CAAC;IAEF,mCAAmC;IACnC,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;IAC/C,MAAM,UAAU,GAA4B,EAAE,CAAC;IAC/C,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;QAC7B,UAAU,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;AAC5C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,CAAa,EAAE,CAAa;IACvD,OAAO,kBAAkB,CAAC,CAAC,CAAC,KAAK,kBAAkB,CAAC,CAAC,CAAC,CAAC;AACzD,CAAC"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * ID generation for OpenTasks
3
+ *
4
+ * Uses hash-based IDs with type prefixes for collision resistance
5
+ * in multi-agent/multi-threaded environments.
6
+ */
7
+ /**
8
+ * Node type for ID generation
9
+ */
10
+ export type IdNodeType = 'context' | 'task' | 'feedback' | 'external' | 'edge';
11
+ /**
12
+ * Convert a hex string to base36
13
+ */
14
+ export declare function hexToBase36(hex: string): string;
15
+ /**
16
+ * Get the type prefix for a node type
17
+ */
18
+ export declare function typePrefix(type: IdNodeType | string): string;
19
+ /**
20
+ * Calculate adaptive ID length based on entity count
21
+ *
22
+ * Uses birthday paradox to target <1% collision probability.
23
+ *
24
+ * For base36 (36 characters):
25
+ * - 4 chars: 36^4 = 1,679,616 possibilities → safe up to ~980 entities
26
+ * - 5 chars: 36^5 = 60,466,176 possibilities → safe up to ~5,900 entities
27
+ * - 6 chars: 36^6 = 2,176,782,336 possibilities → safe up to ~35,000 entities
28
+ * - 7 chars: 36^7 = 78,364,164,096 possibilities → safe up to ~212,000 entities
29
+ * - 8 chars: 36^8 = 2,821,109,907,456 possibilities → safe up to ~1.3M entities
30
+ */
31
+ export declare function adaptiveLength(count: number): number;
32
+ /**
33
+ * Result of ID generation
34
+ */
35
+ export interface GeneratedId {
36
+ /** Short hash-based ID (e.g., "s-a2b3") */
37
+ id: string;
38
+ /** Full UUID v4 */
39
+ uuid: string;
40
+ }
41
+ /**
42
+ * Generate a new ID for a node
43
+ *
44
+ * @param type - The node type (determines prefix)
45
+ * @param existingCount - Number of existing entities (for adaptive length)
46
+ * @returns Object with short id and full uuid
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const { id, uuid } = generateId('task')
51
+ * // id: "t-x7k9"
52
+ * // uuid: "550e8400-e29b-41d4-a716-446655440000"
53
+ * ```
54
+ */
55
+ export declare function generateId(type: IdNodeType | string, existingCount?: number): GeneratedId;
56
+ /**
57
+ * Generate an ID from a specific UUID (for deterministic testing)
58
+ *
59
+ * @param type - The node type
60
+ * @param uuid - The UUID to use
61
+ * @param existingCount - Number of existing entities
62
+ * @returns Object with short id and the provided uuid
63
+ */
64
+ export declare function generateIdFromUuid(type: IdNodeType | string, uuid: string, existingCount?: number): GeneratedId;
65
+ /**
66
+ * Parse an ID to extract its type prefix
67
+ *
68
+ * @param id - The ID to parse (e.g., "s-a2b3")
69
+ * @returns The type prefix or null if invalid format
70
+ */
71
+ export declare function parseIdPrefix(id: string): string | null;
72
+ /**
73
+ * Infer node type from ID prefix
74
+ *
75
+ * @param id - The ID to check
76
+ * @returns The inferred node type or null if unknown
77
+ */
78
+ export declare function inferTypeFromId(id: string): IdNodeType | null;
79
+ //# sourceMappingURL=id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../src/core/id.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC;AAkB/E;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAe/C;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAE5D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMpD;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,2CAA2C;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,EAAE,aAAa,GAAE,MAAU,GAAG,WAAW,CAkB5F;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,UAAU,GAAG,MAAM,EACzB,IAAI,EAAE,MAAM,EACZ,aAAa,GAAE,MAAU,GACxB,WAAW,CAQb;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGvD;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAa7D"}
@@ -0,0 +1,141 @@
1
+ /**
2
+ * ID generation for OpenTasks
3
+ *
4
+ * Uses hash-based IDs with type prefixes for collision resistance
5
+ * in multi-agent/multi-threaded environments.
6
+ */
7
+ import { createHash, randomUUID } from 'node:crypto';
8
+ /**
9
+ * ID prefixes by type
10
+ */
11
+ const TYPE_PREFIXES = {
12
+ context: 'c',
13
+ task: 't',
14
+ feedback: 'f',
15
+ external: 'e',
16
+ edge: 'x',
17
+ };
18
+ /**
19
+ * Base36 character set (0-9, a-z)
20
+ */
21
+ const BASE36_CHARS = '0123456789abcdefghijklmnopqrstuvwxyz';
22
+ /**
23
+ * Convert a hex string to base36
24
+ */
25
+ export function hexToBase36(hex) {
26
+ // Convert hex to BigInt, then to base36
27
+ const num = BigInt('0x' + hex);
28
+ let result = '';
29
+ let remaining = num;
30
+ if (remaining === 0n)
31
+ return '0';
32
+ while (remaining > 0n) {
33
+ const digit = Number(remaining % 36n);
34
+ result = BASE36_CHARS[digit] + result;
35
+ remaining = remaining / 36n;
36
+ }
37
+ return result;
38
+ }
39
+ /**
40
+ * Get the type prefix for a node type
41
+ */
42
+ export function typePrefix(type) {
43
+ return TYPE_PREFIXES[type] || 'n';
44
+ }
45
+ /**
46
+ * Calculate adaptive ID length based on entity count
47
+ *
48
+ * Uses birthday paradox to target <1% collision probability.
49
+ *
50
+ * For base36 (36 characters):
51
+ * - 4 chars: 36^4 = 1,679,616 possibilities → safe up to ~980 entities
52
+ * - 5 chars: 36^5 = 60,466,176 possibilities → safe up to ~5,900 entities
53
+ * - 6 chars: 36^6 = 2,176,782,336 possibilities → safe up to ~35,000 entities
54
+ * - 7 chars: 36^7 = 78,364,164,096 possibilities → safe up to ~212,000 entities
55
+ * - 8 chars: 36^8 = 2,821,109,907,456 possibilities → safe up to ~1.3M entities
56
+ */
57
+ export function adaptiveLength(count) {
58
+ if (count < 980)
59
+ return 4;
60
+ if (count < 5900)
61
+ return 5;
62
+ if (count < 35000)
63
+ return 6;
64
+ if (count < 212000)
65
+ return 7;
66
+ return 8;
67
+ }
68
+ /**
69
+ * Generate a new ID for a node
70
+ *
71
+ * @param type - The node type (determines prefix)
72
+ * @param existingCount - Number of existing entities (for adaptive length)
73
+ * @returns Object with short id and full uuid
74
+ *
75
+ * @example
76
+ * ```ts
77
+ * const { id, uuid } = generateId('task')
78
+ * // id: "t-x7k9"
79
+ * // uuid: "550e8400-e29b-41d4-a716-446655440000"
80
+ * ```
81
+ */
82
+ export function generateId(type, existingCount = 0) {
83
+ // 1. Generate UUID v4
84
+ const uuid = randomUUID();
85
+ // 2. SHA256 hash the UUID
86
+ const hash = createHash('sha256').update(uuid).digest('hex');
87
+ // 3. Convert to base36
88
+ const base36 = hexToBase36(hash);
89
+ // 4. Get adaptive length
90
+ const length = adaptiveLength(existingCount);
91
+ // 5. Prepend type prefix
92
+ const prefix = typePrefix(type);
93
+ const id = `${prefix}-${base36.slice(0, length)}`;
94
+ return { id, uuid };
95
+ }
96
+ /**
97
+ * Generate an ID from a specific UUID (for deterministic testing)
98
+ *
99
+ * @param type - The node type
100
+ * @param uuid - The UUID to use
101
+ * @param existingCount - Number of existing entities
102
+ * @returns Object with short id and the provided uuid
103
+ */
104
+ export function generateIdFromUuid(type, uuid, existingCount = 0) {
105
+ const hash = createHash('sha256').update(uuid).digest('hex');
106
+ const base36 = hexToBase36(hash);
107
+ const length = adaptiveLength(existingCount);
108
+ const prefix = typePrefix(type);
109
+ const id = `${prefix}-${base36.slice(0, length)}`;
110
+ return { id, uuid };
111
+ }
112
+ /**
113
+ * Parse an ID to extract its type prefix
114
+ *
115
+ * @param id - The ID to parse (e.g., "s-a2b3")
116
+ * @returns The type prefix or null if invalid format
117
+ */
118
+ export function parseIdPrefix(id) {
119
+ const match = id.match(/^([a-z])-/);
120
+ return match ? match[1] : null;
121
+ }
122
+ /**
123
+ * Infer node type from ID prefix
124
+ *
125
+ * @param id - The ID to check
126
+ * @returns The inferred node type or null if unknown
127
+ */
128
+ export function inferTypeFromId(id) {
129
+ const prefix = parseIdPrefix(id);
130
+ if (!prefix)
131
+ return null;
132
+ const prefixToType = {
133
+ c: 'context',
134
+ t: 'task',
135
+ f: 'feedback',
136
+ e: 'external',
137
+ x: 'edge',
138
+ };
139
+ return prefixToType[prefix] || null;
140
+ }
141
+ //# sourceMappingURL=id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"id.js","sourceRoot":"","sources":["../../src/core/id.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAE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,KAAK,GAAG,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IACpC,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACjC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,EAAU;IACxC,MAAM,MAAM,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC;IACjC,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IAEzB,MAAM,YAAY,GAA+B;QAC/C,CAAC,EAAE,SAAS;QACZ,CAAC,EAAE,MAAM;QACT,CAAC,EAAE,UAAU;QACb,CAAC,EAAE,UAAU;QACb,CAAC,EAAE,MAAM;KACV,CAAC;IAEF,OAAO,YAAY,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC;AACtC,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Core utilities for OpenTasks
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+ export { generateId, generateIdFromUuid, typePrefix, adaptiveLength, hexToBase36, parseIdPrefix, inferTypeFromId, type IdNodeType, type GeneratedId, } from './id.js';
7
+ export { sha256, computeContentHash, contentEqual } from './hash.js';
8
+ export { generateLocationHash, generateLocationHashFallback, generateLocationIdentity, getGitRemoteUrl, getGitRoot, isValidLocationHash, type LocationIdentity, } from './location.js';
9
+ export { parseOpentasksUri, resolveLocationTarget, resolveOpentasksUri, isOpentasksUri, buildOpentasksUri, buildLocalUri, type ParsedOpentasksUri, type ResolvedLocationTarget, type ResolvedLocation, } from './uri.js';
10
+ export { createConnection, checkConnectionHealth, addConnection, removeConnection, findConnection, checkAllConnectionHealth, type Connection, type ConnectionRole, type ConnectionHealth, type ConnectionStatus, } from './connections.js';
11
+ export { matchPattern, findRedirectRule, resolveRedirect, resolveOperationRedirect, type RedirectOperation, type RedirectRule, type RedirectResult, } from './redirects.js';
12
+ export { evaluateConditions, findConditionalRedirectRule, type RedirectCondition, type ConditionalRedirectRule, type RedirectContext, } from './conditional-redirects.js';
13
+ export { worktreeSetup, worktreeTeardown, registerWorktree, unregisterWorktree, findWorktree, listWorktrees, readWorktreeRegistry, writeWorktreeRegistry, getGitCommonDir, getCurrentBranch, getRegistryPath, type WorktreeEntry, type WorktreeRegistry, type WorktreeSetupOptions, type WorktreeTeardownOptions, } from './worktree.js';
14
+ export { mergeJsonl, parseJsonlToMap, writeJsonlFromMap, fieldLevelMerge, deepEqual, installMergeDriver, } from './merge-driver.js';
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,cAAc,EACd,WAAW,EACX,aAAa,EACb,eAAe,EACf,KAAK,UAAU,EACf,KAAK,WAAW,GACjB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGrE,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,wBAAwB,EACxB,eAAe,EACf,UAAU,EACV,mBAAmB,EACnB,KAAK,gBAAgB,GACtB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,GACtB,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,wBAAwB,EACxB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACtB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,wBAAwB,EACxB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,cAAc,GACpB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,kBAAkB,EAClB,2BAA2B,EAC3B,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,eAAe,GACrB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,GAC7B,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,SAAS,EACT,kBAAkB,GACnB,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Core utilities for OpenTasks
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+ // ID generation
7
+ export { generateId, generateIdFromUuid, typePrefix, adaptiveLength, hexToBase36, parseIdPrefix, inferTypeFromId, } from './id.js';
8
+ // Content hashing
9
+ export { sha256, computeContentHash, contentEqual } from './hash.js';
10
+ // Location identity (Phase 2)
11
+ export { generateLocationHash, generateLocationHashFallback, generateLocationIdentity, getGitRemoteUrl, getGitRoot, isValidLocationHash, } from './location.js';
12
+ // URI scheme (Phase 2)
13
+ export { parseOpentasksUri, resolveLocationTarget, resolveOpentasksUri, isOpentasksUri, buildOpentasksUri, buildLocalUri, } from './uri.js';
14
+ // Connections (Phase 2)
15
+ export { createConnection, checkConnectionHealth, addConnection, removeConnection, findConnection, checkAllConnectionHealth, } from './connections.js';
16
+ // Redirects (Phase 2)
17
+ export { matchPattern, findRedirectRule, resolveRedirect, resolveOperationRedirect, } from './redirects.js';
18
+ // Conditional Redirects (Phase 3)
19
+ export { evaluateConditions, findConditionalRedirectRule, } from './conditional-redirects.js';
20
+ // Worktree Management (Phase 3)
21
+ export { worktreeSetup, worktreeTeardown, registerWorktree, unregisterWorktree, findWorktree, listWorktrees, readWorktreeRegistry, writeWorktreeRegistry, getGitCommonDir, getCurrentBranch, getRegistryPath, } from './worktree.js';
22
+ // Merge Driver (Phase 3)
23
+ export { mergeJsonl, parseJsonlToMap, writeJsonlFromMap, fieldLevelMerge, deepEqual, installMergeDriver, } from './merge-driver.js';
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,gBAAgB;AAChB,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,cAAc,EACd,WAAW,EACX,aAAa,EACb,eAAe,GAGhB,MAAM,SAAS,CAAC;AAEjB,kBAAkB;AAClB,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAErE,8BAA8B;AAC9B,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,wBAAwB,EACxB,eAAe,EACf,UAAU,EACV,mBAAmB,GAEpB,MAAM,eAAe,CAAC;AAEvB,uBAAuB;AACvB,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,aAAa,GAId,MAAM,UAAU,CAAC;AAElB,wBAAwB;AACxB,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,wBAAwB,GAKzB,MAAM,kBAAkB,CAAC;AAE1B,sBAAsB;AACtB,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,wBAAwB,GAIzB,MAAM,gBAAgB,CAAC;AAExB,kCAAkC;AAClC,OAAO,EACL,kBAAkB,EAClB,2BAA2B,GAI5B,MAAM,4BAA4B,CAAC;AAEpC,gCAAgC;AAChC,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,eAAe,GAKhB,MAAM,eAAe,CAAC;AAEvB,yBAAyB;AACzB,OAAO,EACL,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,SAAS,EACT,kBAAkB,GACnB,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Location Identity for OpenTasks (Phase 2)
3
+ *
4
+ * Generates deterministic location hashes from git remote URL + path.
5
+ * Used for cross-location references in opentasks:// URIs.
6
+ */
7
+ /**
8
+ * Location identity stored in config.json
9
+ */
10
+ export interface LocationIdentity {
11
+ /** 8-char base36 hash (deterministic from git remote + path) */
12
+ hash: string;
13
+ /** UUID v4 (uniqueness guarantee) */
14
+ uuid: string;
15
+ /** Human-readable name */
16
+ name: string;
17
+ }
18
+ /**
19
+ * Get the git remote URL for a repository
20
+ *
21
+ * @param repoRoot - Path to the repository root
22
+ * @returns The remote URL or null if no remote is configured
23
+ */
24
+ export declare function getGitRemoteUrl(repoRoot: string): string | null;
25
+ /**
26
+ * Get the git repository root directory
27
+ *
28
+ * @param cwd - Working directory to start from
29
+ * @returns The repository root or null if not in a git repo
30
+ */
31
+ export declare function getGitRoot(cwd: string): string | null;
32
+ /**
33
+ * Generate a deterministic location hash from git remote URL and relative path
34
+ *
35
+ * The hash is stable across machines for the same repo + path combination.
36
+ *
37
+ * @param remoteUrl - Git remote URL (e.g., "git@github.com:user/repo.git")
38
+ * @param relativePath - Path relative to repo root (e.g., "." or "packages/app")
39
+ * @returns 8-character base36 hash
40
+ */
41
+ export declare function generateLocationHash(remoteUrl: string, relativePath: string): string;
42
+ /**
43
+ * Generate a fallback location hash from an absolute path
44
+ *
45
+ * Used when the repository has no remote configured.
46
+ * NOT stable across machines.
47
+ *
48
+ * @param absolutePath - Absolute path to the .opentasks directory
49
+ * @returns 8-character base36 hash
50
+ */
51
+ export declare function generateLocationHashFallback(absolutePath: string): string;
52
+ /**
53
+ * Generate a complete location identity
54
+ *
55
+ * Attempts deterministic hash from git remote URL first,
56
+ * falls back to absolute path hash if no remote is available.
57
+ *
58
+ * @param opentasksDir - Path to the .opentasks directory
59
+ * @param name - Optional human-readable name (defaults to directory name)
60
+ * @returns Location identity object
61
+ */
62
+ export declare function generateLocationIdentity(opentasksDir: string, name?: string): LocationIdentity;
63
+ /**
64
+ * Validate a location hash format
65
+ *
66
+ * @param hash - The hash to validate
67
+ * @returns true if the hash is a valid 8-char base36 string
68
+ */
69
+ export declare function isValidLocationHash(hash: string): boolean;
70
+ //# sourceMappingURL=location.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../../src/core/location.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAW/D;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAWrD;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAKpF;AAED;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAGzE;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,gBAAgB,CA0B9F;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEzD"}
@@ -0,0 +1,121 @@
1
+ /**
2
+ * Location Identity for OpenTasks (Phase 2)
3
+ *
4
+ * Generates deterministic location hashes from git remote URL + path.
5
+ * Used for cross-location references in opentasks:// URIs.
6
+ */
7
+ import { createHash, randomUUID } from 'node:crypto';
8
+ import { execSync } from 'node:child_process';
9
+ import * as path from 'node:path';
10
+ import { hexToBase36 } from './id.js';
11
+ /**
12
+ * Get the git remote URL for a repository
13
+ *
14
+ * @param repoRoot - Path to the repository root
15
+ * @returns The remote URL or null if no remote is configured
16
+ */
17
+ export function getGitRemoteUrl(repoRoot) {
18
+ try {
19
+ const url = execSync('git remote get-url origin', {
20
+ cwd: repoRoot,
21
+ encoding: 'utf-8',
22
+ stdio: ['pipe', 'pipe', 'pipe'],
23
+ }).trim();
24
+ return url || null;
25
+ }
26
+ catch {
27
+ return null;
28
+ }
29
+ }
30
+ /**
31
+ * Get the git repository root directory
32
+ *
33
+ * @param cwd - Working directory to start from
34
+ * @returns The repository root or null if not in a git repo
35
+ */
36
+ export function getGitRoot(cwd) {
37
+ try {
38
+ const root = execSync('git rev-parse --show-toplevel', {
39
+ cwd,
40
+ encoding: 'utf-8',
41
+ stdio: ['pipe', 'pipe', 'pipe'],
42
+ }).trim();
43
+ return root || null;
44
+ }
45
+ catch {
46
+ return null;
47
+ }
48
+ }
49
+ /**
50
+ * Generate a deterministic location hash from git remote URL and relative path
51
+ *
52
+ * The hash is stable across machines for the same repo + path combination.
53
+ *
54
+ * @param remoteUrl - Git remote URL (e.g., "git@github.com:user/repo.git")
55
+ * @param relativePath - Path relative to repo root (e.g., "." or "packages/app")
56
+ * @returns 8-character base36 hash
57
+ */
58
+ export function generateLocationHash(remoteUrl, relativePath) {
59
+ const normalized = relativePath === '.' ? '' : relativePath;
60
+ const input = `${remoteUrl}:${normalized}`;
61
+ const hash = createHash('sha256').update(input).digest('hex');
62
+ return hexToBase36(hash).slice(0, 8);
63
+ }
64
+ /**
65
+ * Generate a fallback location hash from an absolute path
66
+ *
67
+ * Used when the repository has no remote configured.
68
+ * NOT stable across machines.
69
+ *
70
+ * @param absolutePath - Absolute path to the .opentasks directory
71
+ * @returns 8-character base36 hash
72
+ */
73
+ export function generateLocationHashFallback(absolutePath) {
74
+ const hash = createHash('sha256').update(absolutePath).digest('hex');
75
+ return hexToBase36(hash).slice(0, 8);
76
+ }
77
+ /**
78
+ * Generate a complete location identity
79
+ *
80
+ * Attempts deterministic hash from git remote URL first,
81
+ * falls back to absolute path hash if no remote is available.
82
+ *
83
+ * @param opentasksDir - Path to the .opentasks directory
84
+ * @param name - Optional human-readable name (defaults to directory name)
85
+ * @returns Location identity object
86
+ */
87
+ export function generateLocationIdentity(opentasksDir, name) {
88
+ const parentDir = path.dirname(opentasksDir);
89
+ const resolvedDir = path.resolve(parentDir);
90
+ const gitRoot = getGitRoot(resolvedDir);
91
+ let hash;
92
+ if (gitRoot) {
93
+ const remoteUrl = getGitRemoteUrl(gitRoot);
94
+ if (remoteUrl) {
95
+ const relativePath = path.relative(gitRoot, resolvedDir);
96
+ hash = generateLocationHash(remoteUrl, relativePath || '.');
97
+ }
98
+ else {
99
+ hash = generateLocationHashFallback(path.resolve(opentasksDir));
100
+ }
101
+ }
102
+ else {
103
+ hash = generateLocationHashFallback(path.resolve(opentasksDir));
104
+ }
105
+ const locationName = name || path.basename(resolvedDir);
106
+ return {
107
+ hash,
108
+ uuid: randomUUID(),
109
+ name: locationName,
110
+ };
111
+ }
112
+ /**
113
+ * Validate a location hash format
114
+ *
115
+ * @param hash - The hash to validate
116
+ * @returns true if the hash is a valid 8-char base36 string
117
+ */
118
+ export function isValidLocationHash(hash) {
119
+ return /^[a-z0-9]{8}$/.test(hash);
120
+ }
121
+ //# sourceMappingURL=location.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"location.js","sourceRoot":"","sources":["../../src/core/location.ts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E,CAAC;IAED,MAAM,YAAY,GAAG,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAExD,OAAO;QACL,IAAI;QACJ,IAAI,EAAE,UAAU,EAAE;QAClB,IAAI,EAAE,YAAY;KACnB,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,OAAO,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACpC,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Custom JSONL Merge Driver for OpenTasks (Phase 3)
3
+ *
4
+ * Three-way merge for graph.jsonl files with field-level resolution.
5
+ * Registered as a git merge driver via .gitattributes.
6
+ */
7
+ /**
8
+ * A parsed JSONL line as a record
9
+ */
10
+ type JsonLine = Record<string, unknown>;
11
+ /**
12
+ * Parse a JSONL file into a Map keyed by ID
13
+ *
14
+ * For entries with the same ID, keeps the one with the latest updated_at.
15
+ */
16
+ export declare function parseJsonlToMap(filePath: string): Map<string, JsonLine>;
17
+ /**
18
+ * Write a map of entries back to a JSONL file
19
+ */
20
+ export declare function writeJsonlFromMap(filePath: string, entries: Map<string, JsonLine>): void;
21
+ /**
22
+ * Deep equality check for JSON values
23
+ */
24
+ export declare function deepEqual(a: unknown, b: unknown): boolean;
25
+ /**
26
+ * Field-level three-way merge
27
+ *
28
+ * For each field:
29
+ * - Both sides agree → use that value
30
+ * - Only one side changed → use the changed value
31
+ * - Both changed differently → last-writer-wins by updated_at
32
+ */
33
+ export declare function fieldLevelMerge(base: JsonLine, ours: JsonLine, theirs: JsonLine): JsonLine;
34
+ /**
35
+ * Three-way merge of JSONL files
36
+ *
37
+ * @param basePath - Base version (common ancestor)
38
+ * @param oursPath - Our version (current branch)
39
+ * @param theirsPath - Their version (merging branch)
40
+ * @returns 0 on success, 1 on conflict (should not happen with this algorithm)
41
+ */
42
+ export declare function mergeJsonl(basePath: string, oursPath: string, theirsPath: string): number;
43
+ /**
44
+ * Install the merge driver in git config and .gitattributes
45
+ *
46
+ * @param worktreePath - Path to the worktree root
47
+ */
48
+ export declare function installMergeDriver(worktreePath: string): void;
49
+ export {};
50
+ //# sourceMappingURL=merge-driver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merge-driver.d.ts","sourceRoot":"","sources":["../../src/core/merge-driver.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH;;GAEG;AACH,KAAK,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAExC;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CA6BvE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,IAAI,CAoBxF;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,CAsBzD;AAWD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAmD1F;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CA0DzF;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CA6B7D"}