monday-cli 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (596) hide show
  1. package/CHANGELOG.md +439 -0
  2. package/LICENSE +21 -0
  3. package/README.md +431 -0
  4. package/dist/api/board-child-finder.d.ts +95 -0
  5. package/dist/api/board-child-finder.d.ts.map +1 -0
  6. package/dist/api/board-child-finder.js +89 -0
  7. package/dist/api/board-child-finder.js.map +1 -0
  8. package/dist/api/board-metadata.d.ts +162 -0
  9. package/dist/api/board-metadata.d.ts.map +1 -0
  10. package/dist/api/board-metadata.js +238 -0
  11. package/dist/api/board-metadata.js.map +1 -0
  12. package/dist/api/board-mutation-invalidation.d.ts +153 -0
  13. package/dist/api/board-mutation-invalidation.d.ts.map +1 -0
  14. package/dist/api/board-mutation-invalidation.js +136 -0
  15. package/dist/api/board-mutation-invalidation.js.map +1 -0
  16. package/dist/api/board-mutation-result.d.ts +97 -0
  17. package/dist/api/board-mutation-result.d.ts.map +1 -0
  18. package/dist/api/board-mutation-result.js +99 -0
  19. package/dist/api/board-mutation-result.js.map +1 -0
  20. package/dist/api/board-projection.d.ts +68 -0
  21. package/dist/api/board-projection.d.ts.map +1 -0
  22. package/dist/api/board-projection.js +79 -0
  23. package/dist/api/board-projection.js.map +1 -0
  24. package/dist/api/cache.d.ts +150 -0
  25. package/dist/api/cache.d.ts.map +1 -0
  26. package/dist/api/cache.js +418 -0
  27. package/dist/api/cache.js.map +1 -0
  28. package/dist/api/client.d.ts +162 -0
  29. package/dist/api/client.d.ts.map +1 -0
  30. package/dist/api/client.js +205 -0
  31. package/dist/api/client.js.map +1 -0
  32. package/dist/api/column-mapping.d.ts +68 -0
  33. package/dist/api/column-mapping.d.ts.map +1 -0
  34. package/dist/api/column-mapping.js +117 -0
  35. package/dist/api/column-mapping.js.map +1 -0
  36. package/dist/api/column-mutation-result.d.ts +136 -0
  37. package/dist/api/column-mutation-result.d.ts.map +1 -0
  38. package/dist/api/column-mutation-result.js +130 -0
  39. package/dist/api/column-mutation-result.js.map +1 -0
  40. package/dist/api/column-types.d.ts +215 -0
  41. package/dist/api/column-types.d.ts.map +1 -0
  42. package/dist/api/column-types.js +195 -0
  43. package/dist/api/column-types.js.map +1 -0
  44. package/dist/api/column-values.d.ts +446 -0
  45. package/dist/api/column-values.d.ts.map +1 -0
  46. package/dist/api/column-values.js +795 -0
  47. package/dist/api/column-values.js.map +1 -0
  48. package/dist/api/columns.d.ts +205 -0
  49. package/dist/api/columns.d.ts.map +1 -0
  50. package/dist/api/columns.js +343 -0
  51. package/dist/api/columns.js.map +1 -0
  52. package/dist/api/complexity.d.ts +90 -0
  53. package/dist/api/complexity.d.ts.map +1 -0
  54. package/dist/api/complexity.js +194 -0
  55. package/dist/api/complexity.js.map +1 -0
  56. package/dist/api/dates.d.ts +150 -0
  57. package/dist/api/dates.d.ts.map +1 -0
  58. package/dist/api/dates.js +490 -0
  59. package/dist/api/dates.js.map +1 -0
  60. package/dist/api/destructive-gate.d.ts +107 -0
  61. package/dist/api/destructive-gate.d.ts.map +1 -0
  62. package/dist/api/destructive-gate.js +19 -0
  63. package/dist/api/destructive-gate.js.map +1 -0
  64. package/dist/api/dry-run.d.ts +338 -0
  65. package/dist/api/dry-run.d.ts.map +1 -0
  66. package/dist/api/dry-run.js +607 -0
  67. package/dist/api/dry-run.js.map +1 -0
  68. package/dist/api/emails.d.ts +60 -0
  69. package/dist/api/emails.d.ts.map +1 -0
  70. package/dist/api/emails.js +113 -0
  71. package/dist/api/emails.js.map +1 -0
  72. package/dist/api/errors.d.ts +82 -0
  73. package/dist/api/errors.d.ts.map +1 -0
  74. package/dist/api/errors.js +434 -0
  75. package/dist/api/errors.js.map +1 -0
  76. package/dist/api/filters.d.ts +198 -0
  77. package/dist/api/filters.d.ts.map +1 -0
  78. package/dist/api/filters.js +328 -0
  79. package/dist/api/filters.js.map +1 -0
  80. package/dist/api/group-color.d.ts +33 -0
  81. package/dist/api/group-color.d.ts.map +1 -0
  82. package/dist/api/group-color.js +80 -0
  83. package/dist/api/group-color.js.map +1 -0
  84. package/dist/api/group-mutation-result.d.ts +150 -0
  85. package/dist/api/group-mutation-result.d.ts.map +1 -0
  86. package/dist/api/group-mutation-result.js +141 -0
  87. package/dist/api/group-mutation-result.js.map +1 -0
  88. package/dist/api/iso-country-codes.d.ts +45 -0
  89. package/dist/api/iso-country-codes.d.ts.map +1 -0
  90. package/dist/api/iso-country-codes.js +71 -0
  91. package/dist/api/iso-country-codes.js.map +1 -0
  92. package/dist/api/item-board-lookup.d.ts +86 -0
  93. package/dist/api/item-board-lookup.d.ts.map +1 -0
  94. package/dist/api/item-board-lookup.js +140 -0
  95. package/dist/api/item-board-lookup.js.map +1 -0
  96. package/dist/api/item-helpers.d.ts +133 -0
  97. package/dist/api/item-helpers.d.ts.map +1 -0
  98. package/dist/api/item-helpers.js +139 -0
  99. package/dist/api/item-helpers.js.map +1 -0
  100. package/dist/api/item-mutation-result.d.ts +60 -0
  101. package/dist/api/item-mutation-result.d.ts.map +1 -0
  102. package/dist/api/item-mutation-result.js +63 -0
  103. package/dist/api/item-mutation-result.js.map +1 -0
  104. package/dist/api/item-projection.d.ts +165 -0
  105. package/dist/api/item-projection.d.ts.map +1 -0
  106. package/dist/api/item-projection.js +235 -0
  107. package/dist/api/item-projection.js.map +1 -0
  108. package/dist/api/item-source-read.d.ts +45 -0
  109. package/dist/api/item-source-read.d.ts.map +1 -0
  110. package/dist/api/item-source-read.js +57 -0
  111. package/dist/api/item-source-read.js.map +1 -0
  112. package/dist/api/items-page-walker.d.ts +126 -0
  113. package/dist/api/items-page-walker.d.ts.map +1 -0
  114. package/dist/api/items-page-walker.js +256 -0
  115. package/dist/api/items-page-walker.js.map +1 -0
  116. package/dist/api/links.d.ts +70 -0
  117. package/dist/api/links.d.ts.map +1 -0
  118. package/dist/api/links.js +128 -0
  119. package/dist/api/links.js.map +1 -0
  120. package/dist/api/me-token.d.ts +52 -0
  121. package/dist/api/me-token.d.ts.map +1 -0
  122. package/dist/api/me-token.js +55 -0
  123. package/dist/api/me-token.js.map +1 -0
  124. package/dist/api/pagination.d.ts +201 -0
  125. package/dist/api/pagination.d.ts.map +1 -0
  126. package/dist/api/pagination.js +223 -0
  127. package/dist/api/pagination.js.map +1 -0
  128. package/dist/api/partial-success-mutation.d.ts +28 -0
  129. package/dist/api/partial-success-mutation.d.ts.map +1 -0
  130. package/dist/api/partial-success-mutation.js +68 -0
  131. package/dist/api/partial-success-mutation.js.map +1 -0
  132. package/dist/api/people.d.ts +182 -0
  133. package/dist/api/people.d.ts.map +1 -0
  134. package/dist/api/people.js +260 -0
  135. package/dist/api/people.js.map +1 -0
  136. package/dist/api/phones.d.ts +74 -0
  137. package/dist/api/phones.d.ts.map +1 -0
  138. package/dist/api/phones.js +167 -0
  139. package/dist/api/phones.js.map +1 -0
  140. package/dist/api/raw-document.d.ts +53 -0
  141. package/dist/api/raw-document.d.ts.map +1 -0
  142. package/dist/api/raw-document.js +177 -0
  143. package/dist/api/raw-document.js.map +1 -0
  144. package/dist/api/raw-write.d.ts +127 -0
  145. package/dist/api/raw-write.d.ts.map +1 -0
  146. package/dist/api/raw-write.js +233 -0
  147. package/dist/api/raw-write.js.map +1 -0
  148. package/dist/api/resolution-context.d.ts +32 -0
  149. package/dist/api/resolution-context.d.ts.map +1 -0
  150. package/dist/api/resolution-context.js +42 -0
  151. package/dist/api/resolution-context.js.map +1 -0
  152. package/dist/api/resolution-pass.d.ts +163 -0
  153. package/dist/api/resolution-pass.d.ts.map +1 -0
  154. package/dist/api/resolution-pass.js +254 -0
  155. package/dist/api/resolution-pass.js.map +1 -0
  156. package/dist/api/resolve-client.d.ts +69 -0
  157. package/dist/api/resolve-client.d.ts.map +1 -0
  158. package/dist/api/resolve-client.js +70 -0
  159. package/dist/api/resolve-client.js.map +1 -0
  160. package/dist/api/resolver-error-fold.d.ts +176 -0
  161. package/dist/api/resolver-error-fold.d.ts.map +1 -0
  162. package/dist/api/resolver-error-fold.js +230 -0
  163. package/dist/api/resolver-error-fold.js.map +1 -0
  164. package/dist/api/resolvers.d.ts +131 -0
  165. package/dist/api/resolvers.d.ts.map +1 -0
  166. package/dist/api/resolvers.js +262 -0
  167. package/dist/api/resolvers.js.map +1 -0
  168. package/dist/api/response-root.d.ts +65 -0
  169. package/dist/api/response-root.d.ts.map +1 -0
  170. package/dist/api/response-root.js +61 -0
  171. package/dist/api/response-root.js.map +1 -0
  172. package/dist/api/retry.d.ts +112 -0
  173. package/dist/api/retry.d.ts.map +1 -0
  174. package/dist/api/retry.js +181 -0
  175. package/dist/api/retry.js.map +1 -0
  176. package/dist/api/set-expression.d.ts +23 -0
  177. package/dist/api/set-expression.d.ts.map +1 -0
  178. package/dist/api/set-expression.js +31 -0
  179. package/dist/api/set-expression.js.map +1 -0
  180. package/dist/api/sort.d.ts +59 -0
  181. package/dist/api/sort.d.ts.map +1 -0
  182. package/dist/api/sort.js +73 -0
  183. package/dist/api/sort.js.map +1 -0
  184. package/dist/api/source-aggregator.d.ts +94 -0
  185. package/dist/api/source-aggregator.d.ts.map +1 -0
  186. package/dist/api/source-aggregator.js +111 -0
  187. package/dist/api/source-aggregator.js.map +1 -0
  188. package/dist/api/transport.d.ts +58 -0
  189. package/dist/api/transport.d.ts.map +1 -0
  190. package/dist/api/transport.js +190 -0
  191. package/dist/api/transport.js.map +1 -0
  192. package/dist/api/update-mutation-result.d.ts +133 -0
  193. package/dist/api/update-mutation-result.d.ts.map +1 -0
  194. package/dist/api/update-mutation-result.js +145 -0
  195. package/dist/api/update-mutation-result.js.map +1 -0
  196. package/dist/api/users-fan-out-mutation.d.ts +124 -0
  197. package/dist/api/users-fan-out-mutation.d.ts.map +1 -0
  198. package/dist/api/users-fan-out-mutation.js +331 -0
  199. package/dist/api/users-fan-out-mutation.js.map +1 -0
  200. package/dist/api/walk-pages.d.ts +91 -0
  201. package/dist/api/walk-pages.d.ts.map +1 -0
  202. package/dist/api/walk-pages.js +84 -0
  203. package/dist/api/walk-pages.js.map +1 -0
  204. package/dist/api/workspace-projection.d.ts +64 -0
  205. package/dist/api/workspace-projection.d.ts.map +1 -0
  206. package/dist/api/workspace-projection.js +83 -0
  207. package/dist/api/workspace-projection.js.map +1 -0
  208. package/dist/cli/envelope-out.d.ts +128 -0
  209. package/dist/cli/envelope-out.d.ts.map +1 -0
  210. package/dist/cli/envelope-out.js +146 -0
  211. package/dist/cli/envelope-out.js.map +1 -0
  212. package/dist/cli/index.d.ts +3 -0
  213. package/dist/cli/index.d.ts.map +1 -0
  214. package/dist/cli/index.js +27 -0
  215. package/dist/cli/index.js.map +1 -0
  216. package/dist/cli/program.d.ts +29 -0
  217. package/dist/cli/program.d.ts.map +1 -0
  218. package/dist/cli/program.js +109 -0
  219. package/dist/cli/program.js.map +1 -0
  220. package/dist/cli/run.d.ts +108 -0
  221. package/dist/cli/run.d.ts.map +1 -0
  222. package/dist/cli/run.js +105 -0
  223. package/dist/cli/run.js.map +1 -0
  224. package/dist/commands/account/client-helper.d.ts +37 -0
  225. package/dist/commands/account/client-helper.d.ts.map +1 -0
  226. package/dist/commands/account/client-helper.js +55 -0
  227. package/dist/commands/account/client-helper.js.map +1 -0
  228. package/dist/commands/account/complexity.d.ts +29 -0
  229. package/dist/commands/account/complexity.d.ts.map +1 -0
  230. package/dist/commands/account/complexity.js +70 -0
  231. package/dist/commands/account/complexity.js.map +1 -0
  232. package/dist/commands/account/info.d.ts +36 -0
  233. package/dist/commands/account/info.d.ts.map +1 -0
  234. package/dist/commands/account/info.js +74 -0
  235. package/dist/commands/account/info.js.map +1 -0
  236. package/dist/commands/account/version.d.ts +44 -0
  237. package/dist/commands/account/version.d.ts.map +1 -0
  238. package/dist/commands/account/version.js +98 -0
  239. package/dist/commands/account/version.js.map +1 -0
  240. package/dist/commands/account/whoami.d.ts +34 -0
  241. package/dist/commands/account/whoami.d.ts.map +1 -0
  242. package/dist/commands/account/whoami.js +77 -0
  243. package/dist/commands/account/whoami.js.map +1 -0
  244. package/dist/commands/board/add-users.d.ts +60 -0
  245. package/dist/commands/board/add-users.d.ts.map +1 -0
  246. package/dist/commands/board/add-users.js +133 -0
  247. package/dist/commands/board/add-users.js.map +1 -0
  248. package/dist/commands/board/archive.d.ts +64 -0
  249. package/dist/commands/board/archive.d.ts.map +1 -0
  250. package/dist/commands/board/archive.js +226 -0
  251. package/dist/commands/board/archive.js.map +1 -0
  252. package/dist/commands/board/column-create.d.ts +146 -0
  253. package/dist/commands/board/column-create.d.ts.map +1 -0
  254. package/dist/commands/board/column-create.js +564 -0
  255. package/dist/commands/board/column-create.js.map +1 -0
  256. package/dist/commands/board/column-delete.d.ts +76 -0
  257. package/dist/commands/board/column-delete.d.ts.map +1 -0
  258. package/dist/commands/board/column-delete.js +224 -0
  259. package/dist/commands/board/column-delete.js.map +1 -0
  260. package/dist/commands/board/column-update.d.ts +92 -0
  261. package/dist/commands/board/column-update.d.ts.map +1 -0
  262. package/dist/commands/board/column-update.js +364 -0
  263. package/dist/commands/board/column-update.js.map +1 -0
  264. package/dist/commands/board/columns.d.ts +30 -0
  265. package/dist/commands/board/columns.d.ts.map +1 -0
  266. package/dist/commands/board/columns.js +102 -0
  267. package/dist/commands/board/columns.js.map +1 -0
  268. package/dist/commands/board/create.d.ts +67 -0
  269. package/dist/commands/board/create.d.ts.map +1 -0
  270. package/dist/commands/board/create.js +226 -0
  271. package/dist/commands/board/create.js.map +1 -0
  272. package/dist/commands/board/delete.d.ts +60 -0
  273. package/dist/commands/board/delete.d.ts.map +1 -0
  274. package/dist/commands/board/delete.js +192 -0
  275. package/dist/commands/board/delete.js.map +1 -0
  276. package/dist/commands/board/describe.d.ts +68 -0
  277. package/dist/commands/board/describe.d.ts.map +1 -0
  278. package/dist/commands/board/describe.js +241 -0
  279. package/dist/commands/board/describe.js.map +1 -0
  280. package/dist/commands/board/doctor.d.ts +108 -0
  281. package/dist/commands/board/doctor.d.ts.map +1 -0
  282. package/dist/commands/board/doctor.js +417 -0
  283. package/dist/commands/board/doctor.js.map +1 -0
  284. package/dist/commands/board/duplicate.d.ts +85 -0
  285. package/dist/commands/board/duplicate.d.ts.map +1 -0
  286. package/dist/commands/board/duplicate.js +281 -0
  287. package/dist/commands/board/duplicate.js.map +1 -0
  288. package/dist/commands/board/find.d.ts +47 -0
  289. package/dist/commands/board/find.d.ts.map +1 -0
  290. package/dist/commands/board/find.js +153 -0
  291. package/dist/commands/board/find.js.map +1 -0
  292. package/dist/commands/board/get.d.ts +41 -0
  293. package/dist/commands/board/get.d.ts.map +1 -0
  294. package/dist/commands/board/get.js +66 -0
  295. package/dist/commands/board/get.js.map +1 -0
  296. package/dist/commands/board/group-archive.d.ts +83 -0
  297. package/dist/commands/board/group-archive.d.ts.map +1 -0
  298. package/dist/commands/board/group-archive.js +264 -0
  299. package/dist/commands/board/group-archive.js.map +1 -0
  300. package/dist/commands/board/group-create.d.ts +118 -0
  301. package/dist/commands/board/group-create.d.ts.map +1 -0
  302. package/dist/commands/board/group-create.js +239 -0
  303. package/dist/commands/board/group-create.js.map +1 -0
  304. package/dist/commands/board/group-delete.d.ts +79 -0
  305. package/dist/commands/board/group-delete.d.ts.map +1 -0
  306. package/dist/commands/board/group-delete.js +222 -0
  307. package/dist/commands/board/group-delete.js.map +1 -0
  308. package/dist/commands/board/group-duplicate.d.ts +70 -0
  309. package/dist/commands/board/group-duplicate.d.ts.map +1 -0
  310. package/dist/commands/board/group-duplicate.js +219 -0
  311. package/dist/commands/board/group-duplicate.js.map +1 -0
  312. package/dist/commands/board/group-update.d.ts +145 -0
  313. package/dist/commands/board/group-update.d.ts.map +1 -0
  314. package/dist/commands/board/group-update.js +341 -0
  315. package/dist/commands/board/group-update.js.map +1 -0
  316. package/dist/commands/board/groups.d.ts +28 -0
  317. package/dist/commands/board/groups.d.ts.map +1 -0
  318. package/dist/commands/board/groups.js +85 -0
  319. package/dist/commands/board/groups.js.map +1 -0
  320. package/dist/commands/board/list.d.ts +39 -0
  321. package/dist/commands/board/list.d.ts.map +1 -0
  322. package/dist/commands/board/list.js +135 -0
  323. package/dist/commands/board/list.js.map +1 -0
  324. package/dist/commands/board/subscribers.d.ts +24 -0
  325. package/dist/commands/board/subscribers.d.ts.map +1 -0
  326. package/dist/commands/board/subscribers.js +89 -0
  327. package/dist/commands/board/subscribers.js.map +1 -0
  328. package/dist/commands/board/update.d.ts +82 -0
  329. package/dist/commands/board/update.d.ts.map +1 -0
  330. package/dist/commands/board/update.js +328 -0
  331. package/dist/commands/board/update.js.map +1 -0
  332. package/dist/commands/cache/clear.d.ts +34 -0
  333. package/dist/commands/cache/clear.d.ts.map +1 -0
  334. package/dist/commands/cache/clear.js +113 -0
  335. package/dist/commands/cache/clear.js.map +1 -0
  336. package/dist/commands/cache/list.d.ts +50 -0
  337. package/dist/commands/cache/list.d.ts.map +1 -0
  338. package/dist/commands/cache/list.js +77 -0
  339. package/dist/commands/cache/list.js.map +1 -0
  340. package/dist/commands/cache/stats.d.ts +22 -0
  341. package/dist/commands/cache/stats.d.ts.map +1 -0
  342. package/dist/commands/cache/stats.js +56 -0
  343. package/dist/commands/cache/stats.js.map +1 -0
  344. package/dist/commands/config/path.d.ts +22 -0
  345. package/dist/commands/config/path.d.ts.map +1 -0
  346. package/dist/commands/config/path.js +74 -0
  347. package/dist/commands/config/path.js.map +1 -0
  348. package/dist/commands/config/show.d.ts +61 -0
  349. package/dist/commands/config/show.d.ts.map +1 -0
  350. package/dist/commands/config/show.js +137 -0
  351. package/dist/commands/config/show.js.map +1 -0
  352. package/dist/commands/emit.d.ts +156 -0
  353. package/dist/commands/emit.d.ts.map +1 -0
  354. package/dist/commands/emit.js +212 -0
  355. package/dist/commands/emit.js.map +1 -0
  356. package/dist/commands/index.d.ts +5 -0
  357. package/dist/commands/index.d.ts.map +1 -0
  358. package/dist/commands/index.js +195 -0
  359. package/dist/commands/index.js.map +1 -0
  360. package/dist/commands/item/archive.d.ts +81 -0
  361. package/dist/commands/item/archive.d.ts.map +1 -0
  362. package/dist/commands/item/archive.js +187 -0
  363. package/dist/commands/item/archive.js.map +1 -0
  364. package/dist/commands/item/clear.d.ts +140 -0
  365. package/dist/commands/item/clear.d.ts.map +1 -0
  366. package/dist/commands/item/clear.js +748 -0
  367. package/dist/commands/item/clear.js.map +1 -0
  368. package/dist/commands/item/create.d.ts +77 -0
  369. package/dist/commands/item/create.d.ts.map +1 -0
  370. package/dist/commands/item/create.js +802 -0
  371. package/dist/commands/item/create.js.map +1 -0
  372. package/dist/commands/item/delete.d.ts +82 -0
  373. package/dist/commands/item/delete.d.ts.map +1 -0
  374. package/dist/commands/item/delete.js +179 -0
  375. package/dist/commands/item/delete.js.map +1 -0
  376. package/dist/commands/item/duplicate.d.ts +117 -0
  377. package/dist/commands/item/duplicate.d.ts.map +1 -0
  378. package/dist/commands/item/duplicate.js +238 -0
  379. package/dist/commands/item/duplicate.js.map +1 -0
  380. package/dist/commands/item/find.d.ts +55 -0
  381. package/dist/commands/item/find.d.ts.map +1 -0
  382. package/dist/commands/item/find.js +231 -0
  383. package/dist/commands/item/find.js.map +1 -0
  384. package/dist/commands/item/get.d.ts +47 -0
  385. package/dist/commands/item/get.d.ts.map +1 -0
  386. package/dist/commands/item/get.js +66 -0
  387. package/dist/commands/item/get.js.map +1 -0
  388. package/dist/commands/item/list.d.ts +73 -0
  389. package/dist/commands/item/list.d.ts.map +1 -0
  390. package/dist/commands/item/list.js +284 -0
  391. package/dist/commands/item/list.js.map +1 -0
  392. package/dist/commands/item/move.d.ts +181 -0
  393. package/dist/commands/item/move.d.ts.map +1 -0
  394. package/dist/commands/item/move.js +560 -0
  395. package/dist/commands/item/move.js.map +1 -0
  396. package/dist/commands/item/search.d.ts +67 -0
  397. package/dist/commands/item/search.d.ts.map +1 -0
  398. package/dist/commands/item/search.js +322 -0
  399. package/dist/commands/item/search.js.map +1 -0
  400. package/dist/commands/item/set.d.ts +88 -0
  401. package/dist/commands/item/set.d.ts.map +1 -0
  402. package/dist/commands/item/set.js +387 -0
  403. package/dist/commands/item/set.js.map +1 -0
  404. package/dist/commands/item/subitems.d.ts +50 -0
  405. package/dist/commands/item/subitems.d.ts.map +1 -0
  406. package/dist/commands/item/subitems.js +86 -0
  407. package/dist/commands/item/subitems.js.map +1 -0
  408. package/dist/commands/item/update.d.ts +99 -0
  409. package/dist/commands/item/update.d.ts.map +1 -0
  410. package/dist/commands/item/update.js +884 -0
  411. package/dist/commands/item/update.js.map +1 -0
  412. package/dist/commands/item/upsert.d.ts +105 -0
  413. package/dist/commands/item/upsert.d.ts.map +1 -0
  414. package/dist/commands/item/upsert.js +998 -0
  415. package/dist/commands/item/upsert.js.map +1 -0
  416. package/dist/commands/parse-argv.d.ts +20 -0
  417. package/dist/commands/parse-argv.d.ts.map +1 -0
  418. package/dist/commands/parse-argv.js +40 -0
  419. package/dist/commands/parse-argv.js.map +1 -0
  420. package/dist/commands/raw/index.d.ts +23 -0
  421. package/dist/commands/raw/index.d.ts.map +1 -0
  422. package/dist/commands/raw/index.js +416 -0
  423. package/dist/commands/raw/index.js.map +1 -0
  424. package/dist/commands/run-by-id-lookup.d.ts +72 -0
  425. package/dist/commands/run-by-id-lookup.d.ts.map +1 -0
  426. package/dist/commands/run-by-id-lookup.js +58 -0
  427. package/dist/commands/run-by-id-lookup.js.map +1 -0
  428. package/dist/commands/schema/index.d.ts +104 -0
  429. package/dist/commands/schema/index.d.ts.map +1 -0
  430. package/dist/commands/schema/index.js +183 -0
  431. package/dist/commands/schema/index.js.map +1 -0
  432. package/dist/commands/types.d.ts +66 -0
  433. package/dist/commands/types.d.ts.map +1 -0
  434. package/dist/commands/types.js +15 -0
  435. package/dist/commands/types.js.map +1 -0
  436. package/dist/commands/update/body-source.d.ts +38 -0
  437. package/dist/commands/update/body-source.d.ts.map +1 -0
  438. package/dist/commands/update/body-source.js +80 -0
  439. package/dist/commands/update/body-source.js.map +1 -0
  440. package/dist/commands/update/clear-all.d.ts +67 -0
  441. package/dist/commands/update/clear-all.d.ts.map +1 -0
  442. package/dist/commands/update/clear-all.js +281 -0
  443. package/dist/commands/update/clear-all.js.map +1 -0
  444. package/dist/commands/update/create.d.ts +51 -0
  445. package/dist/commands/update/create.d.ts.map +1 -0
  446. package/dist/commands/update/create.js +167 -0
  447. package/dist/commands/update/create.js.map +1 -0
  448. package/dist/commands/update/delete.d.ts +53 -0
  449. package/dist/commands/update/delete.d.ts.map +1 -0
  450. package/dist/commands/update/delete.js +148 -0
  451. package/dist/commands/update/delete.js.map +1 -0
  452. package/dist/commands/update/edit.d.ts +37 -0
  453. package/dist/commands/update/edit.d.ts.map +1 -0
  454. package/dist/commands/update/edit.js +129 -0
  455. package/dist/commands/update/edit.js.map +1 -0
  456. package/dist/commands/update/get.d.ts +37 -0
  457. package/dist/commands/update/get.d.ts.map +1 -0
  458. package/dist/commands/update/get.js +92 -0
  459. package/dist/commands/update/get.js.map +1 -0
  460. package/dist/commands/update/like.d.ts +17 -0
  461. package/dist/commands/update/like.d.ts.map +1 -0
  462. package/dist/commands/update/like.js +23 -0
  463. package/dist/commands/update/like.js.map +1 -0
  464. package/dist/commands/update/list.d.ts +58 -0
  465. package/dist/commands/update/list.d.ts.map +1 -0
  466. package/dist/commands/update/list.js +322 -0
  467. package/dist/commands/update/list.js.map +1 -0
  468. package/dist/commands/update/pin.d.ts +17 -0
  469. package/dist/commands/update/pin.d.ts.map +1 -0
  470. package/dist/commands/update/pin.js +23 -0
  471. package/dist/commands/update/pin.js.map +1 -0
  472. package/dist/commands/update/reply.d.ts +47 -0
  473. package/dist/commands/update/reply.d.ts.map +1 -0
  474. package/dist/commands/update/reply.js +149 -0
  475. package/dist/commands/update/reply.js.map +1 -0
  476. package/dist/commands/update/toggle.d.ts +70 -0
  477. package/dist/commands/update/toggle.d.ts.map +1 -0
  478. package/dist/commands/update/toggle.js +118 -0
  479. package/dist/commands/update/toggle.js.map +1 -0
  480. package/dist/commands/update/unlike.d.ts +17 -0
  481. package/dist/commands/update/unlike.d.ts.map +1 -0
  482. package/dist/commands/update/unlike.js +22 -0
  483. package/dist/commands/update/unlike.js.map +1 -0
  484. package/dist/commands/update/unpin.d.ts +17 -0
  485. package/dist/commands/update/unpin.d.ts.map +1 -0
  486. package/dist/commands/update/unpin.js +21 -0
  487. package/dist/commands/update/unpin.js.map +1 -0
  488. package/dist/commands/user/get.d.ts +31 -0
  489. package/dist/commands/user/get.d.ts.map +1 -0
  490. package/dist/commands/user/get.js +81 -0
  491. package/dist/commands/user/get.js.map +1 -0
  492. package/dist/commands/user/list.d.ts +61 -0
  493. package/dist/commands/user/list.d.ts.map +1 -0
  494. package/dist/commands/user/list.js +148 -0
  495. package/dist/commands/user/list.js.map +1 -0
  496. package/dist/commands/user/me.d.ts +17 -0
  497. package/dist/commands/user/me.d.ts.map +1 -0
  498. package/dist/commands/user/me.js +49 -0
  499. package/dist/commands/user/me.js.map +1 -0
  500. package/dist/commands/workspace/add-users.d.ts +76 -0
  501. package/dist/commands/workspace/add-users.d.ts.map +1 -0
  502. package/dist/commands/workspace/add-users.js +154 -0
  503. package/dist/commands/workspace/add-users.js.map +1 -0
  504. package/dist/commands/workspace/create.d.ts +59 -0
  505. package/dist/commands/workspace/create.d.ts.map +1 -0
  506. package/dist/commands/workspace/create.js +163 -0
  507. package/dist/commands/workspace/create.js.map +1 -0
  508. package/dist/commands/workspace/delete.d.ts +67 -0
  509. package/dist/commands/workspace/delete.d.ts.map +1 -0
  510. package/dist/commands/workspace/delete.js +182 -0
  511. package/dist/commands/workspace/delete.js.map +1 -0
  512. package/dist/commands/workspace/folders.d.ts +40 -0
  513. package/dist/commands/workspace/folders.d.ts.map +1 -0
  514. package/dist/commands/workspace/folders.js +124 -0
  515. package/dist/commands/workspace/folders.js.map +1 -0
  516. package/dist/commands/workspace/get.d.ts +35 -0
  517. package/dist/commands/workspace/get.d.ts.map +1 -0
  518. package/dist/commands/workspace/get.js +62 -0
  519. package/dist/commands/workspace/get.js.map +1 -0
  520. package/dist/commands/workspace/list.d.ts +57 -0
  521. package/dist/commands/workspace/list.d.ts.map +1 -0
  522. package/dist/commands/workspace/list.js +125 -0
  523. package/dist/commands/workspace/list.js.map +1 -0
  524. package/dist/commands/workspace/remove-users.d.ts +47 -0
  525. package/dist/commands/workspace/remove-users.d.ts.map +1 -0
  526. package/dist/commands/workspace/remove-users.js +122 -0
  527. package/dist/commands/workspace/remove-users.js.map +1 -0
  528. package/dist/commands/workspace/update.d.ts +68 -0
  529. package/dist/commands/workspace/update.d.ts.map +1 -0
  530. package/dist/commands/workspace/update.js +237 -0
  531. package/dist/commands/workspace/update.js.map +1 -0
  532. package/dist/config/load.d.ts +33 -0
  533. package/dist/config/load.d.ts.map +1 -0
  534. package/dist/config/load.js +81 -0
  535. package/dist/config/load.js.map +1 -0
  536. package/dist/index.d.ts +3 -0
  537. package/dist/index.d.ts.map +1 -0
  538. package/dist/index.js +4 -0
  539. package/dist/index.js.map +1 -0
  540. package/dist/types/global-flags.d.ts +69 -0
  541. package/dist/types/global-flags.d.ts.map +1 -0
  542. package/dist/types/global-flags.js +170 -0
  543. package/dist/types/global-flags.js.map +1 -0
  544. package/dist/types/ids.d.ts +38 -0
  545. package/dist/types/ids.d.ts.map +1 -0
  546. package/dist/types/ids.js +51 -0
  547. package/dist/types/ids.js.map +1 -0
  548. package/dist/types/json.d.ts +60 -0
  549. package/dist/types/json.d.ts.map +1 -0
  550. package/dist/types/json.js +33 -0
  551. package/dist/types/json.js.map +1 -0
  552. package/dist/utils/errors.d.ts +121 -0
  553. package/dist/utils/errors.d.ts.map +1 -0
  554. package/dist/utils/errors.js +264 -0
  555. package/dist/utils/errors.js.map +1 -0
  556. package/dist/utils/logger.d.ts +39 -0
  557. package/dist/utils/logger.d.ts.map +1 -0
  558. package/dist/utils/logger.js +49 -0
  559. package/dist/utils/logger.js.map +1 -0
  560. package/dist/utils/output/envelope.d.ts +140 -0
  561. package/dist/utils/output/envelope.d.ts.map +1 -0
  562. package/dist/utils/output/envelope.js +120 -0
  563. package/dist/utils/output/envelope.js.map +1 -0
  564. package/dist/utils/output/json.d.ts +10 -0
  565. package/dist/utils/output/json.d.ts.map +1 -0
  566. package/dist/utils/output/json.js +12 -0
  567. package/dist/utils/output/json.js.map +1 -0
  568. package/dist/utils/output/ndjson.d.ts +92 -0
  569. package/dist/utils/output/ndjson.d.ts.map +1 -0
  570. package/dist/utils/output/ndjson.js +33 -0
  571. package/dist/utils/output/ndjson.js.map +1 -0
  572. package/dist/utils/output/select.d.ts +22 -0
  573. package/dist/utils/output/select.d.ts.map +1 -0
  574. package/dist/utils/output/select.js +47 -0
  575. package/dist/utils/output/select.js.map +1 -0
  576. package/dist/utils/output/table.d.ts +32 -0
  577. package/dist/utils/output/table.d.ts.map +1 -0
  578. package/dist/utils/output/table.js +133 -0
  579. package/dist/utils/output/table.js.map +1 -0
  580. package/dist/utils/output/text.d.ts +5 -0
  581. package/dist/utils/output/text.d.ts.map +1 -0
  582. package/dist/utils/output/text.js +32 -0
  583. package/dist/utils/output/text.js.map +1 -0
  584. package/dist/utils/parse-boundary.d.ts +53 -0
  585. package/dist/utils/parse-boundary.d.ts.map +1 -0
  586. package/dist/utils/parse-boundary.js +62 -0
  587. package/dist/utils/parse-boundary.js.map +1 -0
  588. package/dist/utils/redact.d.ts +54 -0
  589. package/dist/utils/redact.d.ts.map +1 -0
  590. package/dist/utils/redact.js +154 -0
  591. package/dist/utils/redact.js.map +1 -0
  592. package/dist/utils/request-id.d.ts +17 -0
  593. package/dist/utils/request-id.d.ts.map +1 -0
  594. package/dist/utils/request-id.js +26 -0
  595. package/dist/utils/request-id.js.map +1 -0
  596. package/package.json +87 -0
@@ -0,0 +1,136 @@
1
+ /**
2
+ * Eager-invalidation post-success projection wrappers for board-
3
+ * structure mutations (`v0.2-plan.md` §22 R46 lift).
4
+ *
5
+ * Lifts the cli-design §8 eager-invalidation timing rule from six
6
+ * inline call sites into two helpers that pin the timing in the
7
+ * type system. The §8 contract splits by leg-count:
8
+ *
9
+ * - **Single-leg verbs** (`column-create` / `column-delete` +
10
+ * M15-retrofit `board archive` / `board delete`). Invalidate
11
+ * AFTER the success envelope's `data` projection completes,
12
+ * never before the wire mutation, never between mutation and
13
+ * projection. Skip on the error path — a failed single-leg
14
+ * call didn't change board state.
15
+ * - **Fan-out verbs** (`column-update` per-attribute +
16
+ * M15-retrofit `board update` per-attribute). Issue all per-
17
+ * attribute wire calls first; AFTER the loop ends, invalidate
18
+ * IF at least one per-attribute call succeeded (the wire-
19
+ * state high-water mark). On whole-call success this is the
20
+ * same trigger as the single-leg case (every leg succeeded);
21
+ * on whole-call partial-application failure (call N+1 fails
22
+ * after call N succeeded) invalidation still fires because
23
+ * the cache must reflect partially-applied server state.
24
+ * Zero-legs-succeeded skips invalidation — server state didn't
25
+ * change.
26
+ *
27
+ * Both helpers order invalidation BEFORE returning so the consumer's
28
+ * `emitMutation` lands AFTER the cache is invalidated; a cache-unlink
29
+ * failure (permission flip, disk loss) surfaces through the runner's
30
+ * catch-all error envelope rather than double-emitting after a
31
+ * success envelope already hit stdout (Codex M16 round-1 F1 ordering
32
+ * pin).
33
+ *
34
+ * **Why a `recordLegSuccess()` callback rather than a returned
35
+ * `{succeededLegs, ...}` object** (the §22 R46 spec's draft shape).
36
+ * The fan-out's high-water-mark counter MUST survive a thrown
37
+ * `runFanOut` — if the closure throws partway through the loop,
38
+ * the helper still needs to know how many legs landed before the
39
+ * throw to decide on partial-application invalidation. Returning
40
+ * the counter would force every consumer to wrap its own
41
+ * try/catch to push the count out before re-throwing; routing it
42
+ * through a closure-captured callback owned by the helper hides
43
+ * the counter from the consumer's data flow entirely. The
44
+ * consumer just calls `recordLegSuccess()` after each successful
45
+ * leg; the helper owns the counter, the catch boundary, and the
46
+ * §8 invalidation gate.
47
+ *
48
+ * **Why a single `perform` callback for single-leg rather than a
49
+ * split `{runMutation, projectData}` (the §22 R46 spec draft).**
50
+ * Splitting "fire the wire call" from "project the response" was
51
+ * artificial in practice — the missing-root-key check + null-
52
+ * payload guard sit between the two and don't belong cleanly to
53
+ * either side. A single callback that owns wire-call + parse +
54
+ * missing-root + projection lets each consumer keep its existing
55
+ * structure, returning whatever shape it needs (typically
56
+ * `{data, response}` so `emitMutation` can take both `data` and
57
+ * `toEmit(response)` post-helper).
58
+ *
59
+ * **Six consumer sites (4 single-leg + 2 fan-out):**
60
+ * - `commands/board/column-create.ts` — single-leg.
61
+ * - `commands/board/column-delete.ts` — single-leg.
62
+ * - `commands/board/archive.ts` — single-leg (M15 retrofit).
63
+ * - `commands/board/delete.ts` — single-leg (M15 retrofit).
64
+ * - `commands/board/column-update.ts` — fan-out (per-attribute
65
+ * across two wire surfaces; trailing per-attribute response
66
+ * is authoritative).
67
+ * - `commands/board/update.ts` — fan-out (M15 retrofit; per-
68
+ * attribute loop + final force-live read; final-read response
69
+ * is authoritative). The `runFanOut` closure wraps loop +
70
+ * final read + projection so a final-read failure with
71
+ * succeededLegs > 0 still triggers invalidation per §8.
72
+ *
73
+ * **M17 trajectory.** The §8 contract is leg-count-shaped, not
74
+ * noun-shaped — M17's five group verbs (`group-create` /
75
+ * `group-update` / `group-archive` / `group-duplicate` /
76
+ * `group-delete`) adopt the helpers verbatim from day one
77
+ * (mirrors R29's M14-close-then-M15-adopts pattern). Site count
78
+ * projects to 9 by M17 close (4 + 5), well above the typical
79
+ * 3-consumer trigger threshold.
80
+ */
81
+ import { invalidateBoard } from './cache.js';
82
+ /**
83
+ * Single-leg eager-invalidation wrapper per cli-design §8. Runs
84
+ * `perform()` to completion, then calls `invalidateBoard(boardId,
85
+ * env)` before returning the perform result. On the error path
86
+ * (perform throws) invalidation is skipped — bypass-by-throw is
87
+ * the timing contract: a failed single-leg call didn't change
88
+ * server state, so the cache stays valid.
89
+ */
90
+ export const withBoardInvalidationSingleLeg = async ({ boardId, env, perform, }) => {
91
+ const result = await perform();
92
+ await invalidateBoard(boardId, env);
93
+ return result;
94
+ };
95
+ /**
96
+ * Fan-out eager-invalidation wrapper per cli-design §8. Runs
97
+ * `runFanOut(tracker)` and applies the high-water-mark rule:
98
+ *
99
+ * - Whole-call success → invalidate iff any leg succeeded
100
+ * (recordLegSuccess called at least once); return the result.
101
+ * - Whole-call partial-application failure → catch the throw;
102
+ * invalidate iff any leg succeeded; re-throw.
103
+ * - Whole-call zero-legs-succeeded failure (the very first leg
104
+ * threw before recordLegSuccess fired) → skip invalidation;
105
+ * re-throw. Server state didn't change, so the cache stays
106
+ * valid.
107
+ *
108
+ * The counter lives in this helper's closure — `runFanOut` cannot
109
+ * read or write it directly, only signal increments via
110
+ * `tracker.recordLegSuccess()`. This pins the §8 contract in the
111
+ * type system (the consumer can't accidentally invalidate before
112
+ * the wire call or skip invalidation on partial-application
113
+ * failure).
114
+ */
115
+ export const withBoardInvalidationFanOut = async ({ boardId, env, runFanOut, }) => {
116
+ let succeededLegs = 0;
117
+ const tracker = {
118
+ recordLegSuccess: () => {
119
+ succeededLegs += 1;
120
+ },
121
+ };
122
+ try {
123
+ const result = await runFanOut(tracker);
124
+ if (succeededLegs > 0) {
125
+ await invalidateBoard(boardId, env);
126
+ }
127
+ return result;
128
+ }
129
+ catch (err) {
130
+ if (succeededLegs > 0) {
131
+ await invalidateBoard(boardId, env);
132
+ }
133
+ throw err;
134
+ }
135
+ };
136
+ //# sourceMappingURL=board-mutation-invalidation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"board-mutation-invalidation.js","sourceRoot":"","sources":["../../src/api/board-mutation-invalidation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+EG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AA+B7C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,KAAK,EAAK,EACtD,OAAO,EACP,GAAG,EACH,OAAO,GACiC,EAAc,EAAE;IACxD,MAAM,MAAM,GAAG,MAAM,OAAO,EAAE,CAAC;IAC/B,MAAM,eAAe,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IACpC,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAkBF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,KAAK,EAAK,EACnD,OAAO,EACP,GAAG,EACH,SAAS,GAC4B,EAAc,EAAE;IACrD,IAAI,aAAa,GAAG,CAAC,CAAC;IACtB,MAAM,OAAO,GAAuB;QAClC,gBAAgB,EAAE,GAAG,EAAE;YACrB,aAAa,IAAI,CAAC,CAAC;QACrB,CAAC;KACF,CAAC;IACF,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,CAAC;QACxC,IAAI,aAAa,GAAG,CAAC,EAAE,CAAC;YACtB,MAAM,eAAe,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QACtC,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,aAAa,GAAG,CAAC,EAAE,CAAC;YACtB,MAAM,eAAe,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QACtC,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC,CAAC"}
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Live-mutation null-result projection for the M15 board lifecycle
3
+ * cluster (`v0.2-plan.md` §22 R43 lift). Five verbs share a near-
4
+ * verbatim shape: null-check the wire payload, throw a typed
5
+ * ApiError on null carrying `details.board_id` (or `details.
6
+ * board_name` for create), then parse through `boardProjection
7
+ * Schema` to surface the §6.4 mutation envelope's
8
+ * `data: <projected snapshot>`.
9
+ *
10
+ * Lifted from five sites — see v0.2-plan §22 R43:
11
+ * - `commands/board/create.ts` (M15 — local `projectCreatedBoard`,
12
+ * `errorCode: 'internal_error'`, `detailKey: 'board_name'`).
13
+ * - `commands/board/archive.ts` (M15 — local
14
+ * `projectArchivedBoard`, `errorCode: 'not_found'`,
15
+ * `detailKey: 'board_id'`).
16
+ * - `commands/board/delete.ts` (M15 — local `projectDeletedBoard`,
17
+ * `errorCode: 'not_found'`, `detailKey: 'board_id'`).
18
+ * - `commands/board/update.ts` (M15 — inline final-read parse,
19
+ * `errorCode: 'internal_error'` for the defensive empty-`boards`
20
+ * guard).
21
+ * - `commands/board/duplicate.ts` (M15 — inline wrapped-board
22
+ * parse, `errorCode: 'internal_error'` for the inner-board
23
+ * null guard; the outer `BoardDuplication { board, is_async }`
24
+ * wrapper parse stays at the call site since R43 only covers
25
+ * the inner-board projection, not the wrapped-envelope shape
26
+ * unique to duplicate).
27
+ *
28
+ * **Why parameterised on `errorCode` + `errorMessage`.** The five
29
+ * sites diverge in error semantics. Create (every successful call
30
+ * returns a Board) + update's defensive final-read guard +
31
+ * duplicate's inner-board guard chose `internal_error` (the
32
+ * mutation succeeded server-side but Monday returned an empty
33
+ * payload — server-side glitch, abnormal). Archive + delete chose
34
+ * `not_found` (Monday's idiomatic null-for-missing-or-no-access
35
+ * response — a typed agent-recovery story). Both are correct for
36
+ * their semantics, both are pinned by integration tests
37
+ * (`tests/integration/commands/board.test.ts` asserts on
38
+ * `error.code`), and both must survive the lift byte-for-byte.
39
+ * The helper owns the boilerplate (null check, `details: {
40
+ * [detailKey]: detailValue }` envelope, the `unwrapOrThrow`
41
+ * schema parse); each call site supplies its own typed error parts.
42
+ *
43
+ * **Why `detailKey` is parameterised.** Create's mutation runs
44
+ * before the new board has an id, so the typed-error envelope
45
+ * carries `details.board_name` (the agent-supplied name) instead.
46
+ * Every other verb operates on an existing `boardId` and carries
47
+ * `details.board_id`. Mirrors R28's `projectMutationItem` keying
48
+ * on `details.item_id` uniformly because every item-mutation
49
+ * surface knows the id ahead of the call.
50
+ *
51
+ * **Mirrors R28** (`projectMutationItem` in
52
+ * `src/api/item-mutation-result.ts`, four consumers) and **R37**
53
+ * (`projectMutationUpdate` in `src/api/update-mutation-result.ts`,
54
+ * five consumers) — both per-noun helpers landed at the same 4–5
55
+ * consumer trigger. R43 ships the third per-noun helper at the
56
+ * same threshold.
57
+ *
58
+ * **What stays at the call site.** The wire-shape parse of the
59
+ * full mutation response (`responseSchema.safeParse(response.data)`)
60
+ * stays inline because each verb's response root key
61
+ * (`create_board` / `archive_board` / etc.) is per-verb. The
62
+ * missing-root-key check (schema-drift → `internal_error` with
63
+ * a `hint`) stays inline too — that's Codex M15 implementation
64
+ * round-2 F1's distinction between schema-drift and null-payload,
65
+ * deliberately preserved at each site. R42 would unify the
66
+ * missing-root-key check across all pre-M14 mutation verbs once
67
+ * scheduled.
68
+ */
69
+ import { type ErrorCode } from '../utils/errors.js';
70
+ import { type BoardProjection } from './board-projection.js';
71
+ export type BoardMutationDetailKey = 'board_id' | 'board_name';
72
+ export interface ProjectMutationBoardInputs {
73
+ readonly raw: unknown;
74
+ readonly errorCode: ErrorCode;
75
+ /** Full caller-formatted message for the null-payload throw —
76
+ * e.g. `"Monday returned no board payload from archive_board for
77
+ * id 12345"`. Per-verb phrasing is preserved verbatim because
78
+ * agents key off the message text in error logs. */
79
+ readonly errorMessage: string;
80
+ readonly detailKey: BoardMutationDetailKey;
81
+ readonly detailValue: string;
82
+ }
83
+ /**
84
+ * Parses + projects a live-mutation `Board` payload, throwing the
85
+ * supplied typed error on null/undefined. Caller owns the error code +
86
+ * message so create's `internal_error` / "no board payload from
87
+ * create_board for name <X>" and archive/delete's `not_found` /
88
+ * "no board payload from <op> for id <X>" both survive the lift
89
+ * byte-for-byte.
90
+ *
91
+ * `details: { [detailKey]: detailValue }` is supplied by the
92
+ * helper so every consumer carries the same envelope shape — agents
93
+ * key off `details.board_id` (or `details.board_name` on create's
94
+ * pre-id path) regardless of which verb threw (cli-design §6.5).
95
+ */
96
+ export declare const projectMutationBoard: ({ raw, errorCode, errorMessage, detailKey, detailValue, }: ProjectMutationBoardInputs) => BoardProjection;
97
+ //# sourceMappingURL=board-mutation-result.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"board-mutation-result.d.ts","sourceRoot":"","sources":["../../src/api/board-mutation-result.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AAEH,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE9D,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAEpF,MAAM,MAAM,sBAAsB,GAAG,UAAU,GAAG,YAAY,CAAC;AAE/D,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B;;;wDAGoD;IACpD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,sBAAsB,CAAC;IAC3C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,oBAAoB,GAAI,2DAMlC,0BAA0B,KAAG,eAc/B,CAAC"}
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Live-mutation null-result projection for the M15 board lifecycle
3
+ * cluster (`v0.2-plan.md` §22 R43 lift). Five verbs share a near-
4
+ * verbatim shape: null-check the wire payload, throw a typed
5
+ * ApiError on null carrying `details.board_id` (or `details.
6
+ * board_name` for create), then parse through `boardProjection
7
+ * Schema` to surface the §6.4 mutation envelope's
8
+ * `data: <projected snapshot>`.
9
+ *
10
+ * Lifted from five sites — see v0.2-plan §22 R43:
11
+ * - `commands/board/create.ts` (M15 — local `projectCreatedBoard`,
12
+ * `errorCode: 'internal_error'`, `detailKey: 'board_name'`).
13
+ * - `commands/board/archive.ts` (M15 — local
14
+ * `projectArchivedBoard`, `errorCode: 'not_found'`,
15
+ * `detailKey: 'board_id'`).
16
+ * - `commands/board/delete.ts` (M15 — local `projectDeletedBoard`,
17
+ * `errorCode: 'not_found'`, `detailKey: 'board_id'`).
18
+ * - `commands/board/update.ts` (M15 — inline final-read parse,
19
+ * `errorCode: 'internal_error'` for the defensive empty-`boards`
20
+ * guard).
21
+ * - `commands/board/duplicate.ts` (M15 — inline wrapped-board
22
+ * parse, `errorCode: 'internal_error'` for the inner-board
23
+ * null guard; the outer `BoardDuplication { board, is_async }`
24
+ * wrapper parse stays at the call site since R43 only covers
25
+ * the inner-board projection, not the wrapped-envelope shape
26
+ * unique to duplicate).
27
+ *
28
+ * **Why parameterised on `errorCode` + `errorMessage`.** The five
29
+ * sites diverge in error semantics. Create (every successful call
30
+ * returns a Board) + update's defensive final-read guard +
31
+ * duplicate's inner-board guard chose `internal_error` (the
32
+ * mutation succeeded server-side but Monday returned an empty
33
+ * payload — server-side glitch, abnormal). Archive + delete chose
34
+ * `not_found` (Monday's idiomatic null-for-missing-or-no-access
35
+ * response — a typed agent-recovery story). Both are correct for
36
+ * their semantics, both are pinned by integration tests
37
+ * (`tests/integration/commands/board.test.ts` asserts on
38
+ * `error.code`), and both must survive the lift byte-for-byte.
39
+ * The helper owns the boilerplate (null check, `details: {
40
+ * [detailKey]: detailValue }` envelope, the `unwrapOrThrow`
41
+ * schema parse); each call site supplies its own typed error parts.
42
+ *
43
+ * **Why `detailKey` is parameterised.** Create's mutation runs
44
+ * before the new board has an id, so the typed-error envelope
45
+ * carries `details.board_name` (the agent-supplied name) instead.
46
+ * Every other verb operates on an existing `boardId` and carries
47
+ * `details.board_id`. Mirrors R28's `projectMutationItem` keying
48
+ * on `details.item_id` uniformly because every item-mutation
49
+ * surface knows the id ahead of the call.
50
+ *
51
+ * **Mirrors R28** (`projectMutationItem` in
52
+ * `src/api/item-mutation-result.ts`, four consumers) and **R37**
53
+ * (`projectMutationUpdate` in `src/api/update-mutation-result.ts`,
54
+ * five consumers) — both per-noun helpers landed at the same 4–5
55
+ * consumer trigger. R43 ships the third per-noun helper at the
56
+ * same threshold.
57
+ *
58
+ * **What stays at the call site.** The wire-shape parse of the
59
+ * full mutation response (`responseSchema.safeParse(response.data)`)
60
+ * stays inline because each verb's response root key
61
+ * (`create_board` / `archive_board` / etc.) is per-verb. The
62
+ * missing-root-key check (schema-drift → `internal_error` with
63
+ * a `hint`) stays inline too — that's Codex M15 implementation
64
+ * round-2 F1's distinction between schema-drift and null-payload,
65
+ * deliberately preserved at each site. R42 would unify the
66
+ * missing-root-key check across all pre-M14 mutation verbs once
67
+ * scheduled.
68
+ */
69
+ import { ApiError } from '../utils/errors.js';
70
+ import { unwrapOrThrow } from '../utils/parse-boundary.js';
71
+ import { boardProjectionSchema } from './board-projection.js';
72
+ /**
73
+ * Parses + projects a live-mutation `Board` payload, throwing the
74
+ * supplied typed error on null/undefined. Caller owns the error code +
75
+ * message so create's `internal_error` / "no board payload from
76
+ * create_board for name <X>" and archive/delete's `not_found` /
77
+ * "no board payload from <op> for id <X>" both survive the lift
78
+ * byte-for-byte.
79
+ *
80
+ * `details: { [detailKey]: detailValue }` is supplied by the
81
+ * helper so every consumer carries the same envelope shape — agents
82
+ * key off `details.board_id` (or `details.board_name` on create's
83
+ * pre-id path) regardless of which verb threw (cli-design §6.5).
84
+ */
85
+ export const projectMutationBoard = ({ raw, errorCode, errorMessage, detailKey, detailValue, }) => {
86
+ if (raw === null || raw === undefined) {
87
+ throw new ApiError(errorCode, errorMessage, {
88
+ details: { [detailKey]: detailValue },
89
+ });
90
+ }
91
+ const subjectPhrase = detailKey === 'board_name'
92
+ ? `name ${JSON.stringify(detailValue)}`
93
+ : `id ${detailValue}`;
94
+ return unwrapOrThrow(boardProjectionSchema.safeParse(raw), {
95
+ context: `Monday returned a malformed board payload for ${subjectPhrase}`,
96
+ details: { [detailKey]: detailValue },
97
+ });
98
+ };
99
+ //# sourceMappingURL=board-mutation-result.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"board-mutation-result.js","sourceRoot":"","sources":["../../src/api/board-mutation-result.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AAEH,OAAO,EAAE,QAAQ,EAAkB,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAwB,MAAM,uBAAuB,CAAC;AAgBpF;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,EACnC,GAAG,EACH,SAAS,EACT,YAAY,EACZ,SAAS,EACT,WAAW,GACgB,EAAmB,EAAE;IAChD,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACtC,MAAM,IAAI,QAAQ,CAAC,SAAS,EAAE,YAAY,EAAE;YAC1C,OAAO,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,WAAW,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IACD,MAAM,aAAa,GACjB,SAAS,KAAK,YAAY;QACxB,CAAC,CAAC,QAAQ,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE;QACvC,CAAC,CAAC,MAAM,WAAW,EAAE,CAAC;IAC1B,OAAO,aAAa,CAAC,qBAAqB,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE;QACzD,OAAO,EAAE,iDAAiD,aAAa,EAAE;QACzE,OAAO,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,WAAW,EAAE;KACtC,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Board projection schema + GraphQL field-fragment for the M15 board
3
+ * lifecycle cluster (`v0.2-plan.md` §3 M15, mirrors R39's
4
+ * workspace-projection lift).
5
+ *
6
+ * **`BOARD_FIELDS_FRAGMENT`.** The shared GraphQL selection set
7
+ * every M15 board-shape verb uses. `board create` / `update` /
8
+ * `archive` / `duplicate` all return the full Board projection;
9
+ * `update`'s preflight read uses the same fragment too. Five of
10
+ * the M15 cluster's GraphQL strings interpolate this fragment.
11
+ * 6-space continuation indent matches the column every consumer
12
+ * interpolates `${BOARD_FIELDS_FRAGMENT}` at, so rendered query
13
+ * bytes stay stable across consumers. Mirrors
14
+ * `WORKSPACE_FIELDS_FRAGMENT` (R39 workspace-projection lift) and
15
+ * `ITEM_FIELDS_FRAGMENT` (M5b item-helpers lift).
16
+ *
17
+ * **`boardProjectionSchema`.** The matching strict zod projection
18
+ * schema. The field set matches `board/get.ts`'s
19
+ * `boardGetOutputSchema` so a successful `board create` /
20
+ * `update` / `duplicate` returns the exact JSON shape a follow-
21
+ * up `board get <bid>` would return — agents see one canonical
22
+ * Board shape across read and mutation envelopes. `board get`
23
+ * itself migrates to this fragment + schema in this M15 commit
24
+ * so the projection stays single-sourced from day one (the same
25
+ * R39-pattern bundling the §22 recommendation calls out: ship
26
+ * the projection helper alongside the first new mutation rather
27
+ * than as a follow-up R-class).
28
+ *
29
+ * **Distinct from `boardMetadataSchema`.** `board describe` /
30
+ * column-resolution paths use the heavier `boardMetadataSchema`
31
+ * in `api/board-metadata.ts` (carries `groups: [...]` and
32
+ * `columns: [...]`). The lifecycle cluster doesn't need those
33
+ * arrays — `board describe` stays the documented path for
34
+ * column / group inspection, and the cache layer in
35
+ * board-metadata is kept untouched by M15 (the eager-
36
+ * invalidation contract that ties post-mutation cache state to
37
+ * the metadata cache is M16's scope).
38
+ */
39
+ import { z } from 'zod';
40
+ /**
41
+ * Shared GraphQL selection set for the M15 board lifecycle
42
+ * projection. 6-space continuation indent matches the column
43
+ * every consumer interpolates `${BOARD_FIELDS_FRAGMENT}` at, so
44
+ * rendered query bytes are unchanged post-lift.
45
+ */
46
+ export declare const BOARD_FIELDS_FRAGMENT = "id\n name\n description\n state\n board_kind\n board_folder_id\n workspace_id\n url\n items_count\n updated_at\n permissions";
47
+ /**
48
+ * Strict zod schema for the board projection — the exact shape
49
+ * `BOARD_FIELDS_FRAGMENT` selects from the wire. Shared by
50
+ * `board get` / `create` / `update` / `archive` / `duplicate`;
51
+ * each verb's `CommandModule.outputSchema` aliases this so the
52
+ * schema-export pipeline emits one canonical shape.
53
+ */
54
+ export declare const boardProjectionSchema: z.ZodObject<{
55
+ id: z.ZodString;
56
+ name: z.ZodString;
57
+ description: z.ZodNullable<z.ZodString>;
58
+ state: z.ZodNullable<z.ZodString>;
59
+ board_kind: z.ZodNullable<z.ZodString>;
60
+ board_folder_id: z.ZodNullable<z.ZodString>;
61
+ workspace_id: z.ZodNullable<z.ZodString>;
62
+ url: z.ZodNullable<z.ZodString>;
63
+ items_count: z.ZodNullable<z.ZodNumber>;
64
+ updated_at: z.ZodNullable<z.ZodString>;
65
+ permissions: z.ZodNullable<z.ZodString>;
66
+ }, z.core.$strict>;
67
+ export type BoardProjection = z.infer<typeof boardProjectionSchema>;
68
+ //# sourceMappingURL=board-projection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"board-projection.d.ts","sourceRoot":"","sources":["../../src/api/board-projection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,mLAUhB,CAAC;AAEnB;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;kBAcvB,CAAC;AAEZ,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Board projection schema + GraphQL field-fragment for the M15 board
3
+ * lifecycle cluster (`v0.2-plan.md` §3 M15, mirrors R39's
4
+ * workspace-projection lift).
5
+ *
6
+ * **`BOARD_FIELDS_FRAGMENT`.** The shared GraphQL selection set
7
+ * every M15 board-shape verb uses. `board create` / `update` /
8
+ * `archive` / `duplicate` all return the full Board projection;
9
+ * `update`'s preflight read uses the same fragment too. Five of
10
+ * the M15 cluster's GraphQL strings interpolate this fragment.
11
+ * 6-space continuation indent matches the column every consumer
12
+ * interpolates `${BOARD_FIELDS_FRAGMENT}` at, so rendered query
13
+ * bytes stay stable across consumers. Mirrors
14
+ * `WORKSPACE_FIELDS_FRAGMENT` (R39 workspace-projection lift) and
15
+ * `ITEM_FIELDS_FRAGMENT` (M5b item-helpers lift).
16
+ *
17
+ * **`boardProjectionSchema`.** The matching strict zod projection
18
+ * schema. The field set matches `board/get.ts`'s
19
+ * `boardGetOutputSchema` so a successful `board create` /
20
+ * `update` / `duplicate` returns the exact JSON shape a follow-
21
+ * up `board get <bid>` would return — agents see one canonical
22
+ * Board shape across read and mutation envelopes. `board get`
23
+ * itself migrates to this fragment + schema in this M15 commit
24
+ * so the projection stays single-sourced from day one (the same
25
+ * R39-pattern bundling the §22 recommendation calls out: ship
26
+ * the projection helper alongside the first new mutation rather
27
+ * than as a follow-up R-class).
28
+ *
29
+ * **Distinct from `boardMetadataSchema`.** `board describe` /
30
+ * column-resolution paths use the heavier `boardMetadataSchema`
31
+ * in `api/board-metadata.ts` (carries `groups: [...]` and
32
+ * `columns: [...]`). The lifecycle cluster doesn't need those
33
+ * arrays — `board describe` stays the documented path for
34
+ * column / group inspection, and the cache layer in
35
+ * board-metadata is kept untouched by M15 (the eager-
36
+ * invalidation contract that ties post-mutation cache state to
37
+ * the metadata cache is M16's scope).
38
+ */
39
+ import { z } from 'zod';
40
+ /**
41
+ * Shared GraphQL selection set for the M15 board lifecycle
42
+ * projection. 6-space continuation indent matches the column
43
+ * every consumer interpolates `${BOARD_FIELDS_FRAGMENT}` at, so
44
+ * rendered query bytes are unchanged post-lift.
45
+ */
46
+ export const BOARD_FIELDS_FRAGMENT = `id
47
+ name
48
+ description
49
+ state
50
+ board_kind
51
+ board_folder_id
52
+ workspace_id
53
+ url
54
+ items_count
55
+ updated_at
56
+ permissions`;
57
+ /**
58
+ * Strict zod schema for the board projection — the exact shape
59
+ * `BOARD_FIELDS_FRAGMENT` selects from the wire. Shared by
60
+ * `board get` / `create` / `update` / `archive` / `duplicate`;
61
+ * each verb's `CommandModule.outputSchema` aliases this so the
62
+ * schema-export pipeline emits one canonical shape.
63
+ */
64
+ export const boardProjectionSchema = z
65
+ .object({
66
+ id: z.string().min(1),
67
+ name: z.string(),
68
+ description: z.string().nullable(),
69
+ state: z.string().nullable(),
70
+ board_kind: z.string().nullable(),
71
+ board_folder_id: z.string().nullable(),
72
+ workspace_id: z.string().nullable(),
73
+ url: z.string().nullable(),
74
+ items_count: z.number().int().nullable(),
75
+ updated_at: z.string().nullable(),
76
+ permissions: z.string().nullable(),
77
+ })
78
+ .strict();
79
+ //# sourceMappingURL=board-projection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"board-projection.js","sourceRoot":"","sources":["../../src/api/board-projection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;;;;;;;kBAUnB,CAAC;AAEnB;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC;KACnC,MAAM,CAAC;IACN,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACtC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACxC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC;KACD,MAAM,EAAE,CAAC"}
@@ -0,0 +1,150 @@
1
+ export declare const CACHE_FILE_MODE = 384;
2
+ export declare const DEFAULT_CACHE_TTL_SECONDS = 300;
3
+ export type CacheKey = {
4
+ readonly kind: 'board';
5
+ readonly boardId: string;
6
+ } | {
7
+ readonly kind: 'users';
8
+ } | {
9
+ readonly kind: 'schemaVersion';
10
+ };
11
+ export interface CacheRootOptions {
12
+ readonly env?: NodeJS.ProcessEnv;
13
+ readonly home?: string;
14
+ }
15
+ /**
16
+ * Resolves the cache root per `cli-design.md` §8 and the XDG Base
17
+ * Directory spec. Order:
18
+ * 1. `$XDG_CACHE_HOME/monday-cli` when set and non-empty.
19
+ * 2. `<home>/.cache/monday-cli` otherwise.
20
+ *
21
+ * The return is always absolute. We don't create the directory here —
22
+ * `writeEntry` does that lazily so a read-only path (`cache list` on a
23
+ * fresh install) doesn't side-effect.
24
+ */
25
+ export declare const resolveCacheRoot: (options?: CacheRootOptions) => string;
26
+ /**
27
+ * Maps a typed cache key to its on-disk relative path. Centralised so
28
+ * every consumer (read/write/clear, plus the M1 commands) agrees on
29
+ * the layout.
30
+ */
31
+ export declare const cacheKeyToRelativePath: (key: CacheKey) => string;
32
+ export interface CacheReadResult<T> {
33
+ readonly data: T;
34
+ readonly ageSeconds: number;
35
+ readonly path: string;
36
+ readonly sizeBytes: number;
37
+ }
38
+ export interface CacheReadOptions {
39
+ /** Override the default 5-minute TTL. */
40
+ readonly ttlSeconds?: number;
41
+ /**
42
+ * Source of "now" for age calculation. Injectable so tests can
43
+ * advance time deterministically without `vi.useFakeTimers()`
44
+ * spreading into other tests.
45
+ */
46
+ readonly now?: () => Date;
47
+ }
48
+ /**
49
+ * Reads and parses a cache entry. Returns `undefined` on cache miss
50
+ * (file not present or expired). Throws `CacheError` on any other
51
+ * failure (permission too loose, malformed JSON, decode mismatch).
52
+ */
53
+ export declare const readEntry: <T>(root: string, key: CacheKey, parse: (raw: unknown) => T, options?: CacheReadOptions) => Promise<CacheReadResult<T> | undefined>;
54
+ /**
55
+ * Writes a cache entry atomically. Sequence:
56
+ * 1. Ensure the parent directory exists with mode `0700`.
57
+ * 2. Write to a tmp sibling with mode `0600`.
58
+ * 3. `rename` over the final path. Atomic on the same filesystem.
59
+ *
60
+ * On any failure the tmp file is best-effort cleaned up so a half-
61
+ * written `.tmp` doesn't accumulate on the next call.
62
+ */
63
+ export declare const writeEntry: (root: string, key: CacheKey, data: unknown) => Promise<{
64
+ readonly path: string;
65
+ readonly sizeBytes: number;
66
+ }>;
67
+ export interface CacheEntryInfo {
68
+ readonly path: string;
69
+ readonly relativePath: string;
70
+ readonly sizeBytes: number;
71
+ readonly modifiedAt: string;
72
+ readonly ageSeconds: number;
73
+ /**
74
+ * Best-effort kind classification. `boards`/`users`/`schema` reflect
75
+ * the layout in §8; an entry that doesn't match any known prefix is
76
+ * surfaced as `other` rather than dropped — agents see exactly what
77
+ * `cache clear` would remove.
78
+ */
79
+ readonly kind: 'boards' | 'users' | 'schema' | 'other';
80
+ readonly id: string | undefined;
81
+ }
82
+ interface ListOptions {
83
+ readonly now?: () => Date;
84
+ }
85
+ /**
86
+ * Walks the cache root and reports every JSON entry. Returns an empty
87
+ * array (not an error) when the root doesn't exist — `cache list` on
88
+ * a fresh install is a normal state, not a failure.
89
+ */
90
+ export declare const listEntries: (root: string, options?: ListOptions) => Promise<readonly CacheEntryInfo[]>;
91
+ export interface ClearResult {
92
+ readonly removed: number;
93
+ readonly bytesFreed: number;
94
+ }
95
+ /**
96
+ * Removes a single entry. Missing → no-op; reports zero removals so
97
+ * `cache clear --board <bid>` against an unknown board doesn't fail.
98
+ */
99
+ export declare const clearEntry: (root: string, key: CacheKey) => Promise<ClearResult>;
100
+ /**
101
+ * Eager invalidation of a board's metadata cache entry per
102
+ * `cli-design.md` §8 eager-invalidation contract (M16). Thin wrapper
103
+ * over `clearEntry(root, { kind: 'board', boardId })` that owns the
104
+ * cache-root resolution so call sites — every M16 column-mutation
105
+ * verb plus the M15 retrofit cluster (`board update` / `archive` /
106
+ * `delete`) — read as `invalidateBoard(boardId)` rather than
107
+ * `clearEntry(resolveCacheRoot({env}), {kind:'board',boardId})`.
108
+ *
109
+ * **Idempotent.** Invalidating an already-absent entry is a no-op
110
+ * (matches `clearEntry`'s missing-file semantics) — callers don't
111
+ * need to gate the call on "is this board cached?". Errors during
112
+ * unlink (permission flip, disk loss) bubble as `CacheError` per the
113
+ * underlying primitive.
114
+ *
115
+ * **Process-local.** The on-disk cache file IS shared across
116
+ * processes (same `$XDG_CACHE_HOME/monday-cli/boards/<bid>.json`
117
+ * path), so this `unlink` does remove peer processes' cache entries;
118
+ * the missing primitive is inter-process locking. Cross-process
119
+ * coordination is explicitly deferred to v0.3 per cli-design §8 —
120
+ * this helper does NOT add inter-process locking.
121
+ *
122
+ * Mirrors `evictBoardMetadata` in `board-metadata.ts` (the M3-era
123
+ * helper that predates the eager-invalidation contract); the two
124
+ * helpers are intentionally parallel — `evictBoardMetadata` lives
125
+ * next to the metadata loader and is consumed by tests + potential
126
+ * future `cache clear --board <bid>` flows; `invalidateBoard` lives
127
+ * here next to the underlying `clearEntry` primitive and is consumed
128
+ * by every M16+ board-structure mutation per the §8 contract. Lifting
129
+ * one over the other was rejected during M16 pre-flight to keep the
130
+ * existing test surface unchanged.
131
+ */
132
+ export declare const invalidateBoard: (boardId: string, env?: NodeJS.ProcessEnv) => Promise<ClearResult>;
133
+ /**
134
+ * Removes the entire cache root. Used by `monday cache clear` (no
135
+ * flag) and tests. Counts removed JSON files for reporting; the
136
+ * directory tree itself goes too so a follow-up `cache list` reports
137
+ * an empty cache, not phantom directories.
138
+ */
139
+ export declare const clearAll: (root: string) => Promise<ClearResult>;
140
+ export interface CacheStats {
141
+ readonly root: string;
142
+ readonly exists: boolean;
143
+ readonly entries: number;
144
+ readonly bytes: number;
145
+ readonly oldestAgeSeconds: number | null;
146
+ readonly newestAgeSeconds: number | null;
147
+ }
148
+ export declare const stats: (root: string, options?: ListOptions) => Promise<CacheStats>;
149
+ export {};
150
+ //# sourceMappingURL=cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/api/cache.ts"],"names":[],"mappings":"AA4CA,eAAO,MAAM,eAAe,MAAY,CAAC;AACzC,eAAO,MAAM,yBAAyB,MAAsB,CAAC;AAE7D,MAAM,MAAM,QAAQ,GAChB;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACpD;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;CAAE,GAC1B;IAAE,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAA;CAAE,CAAC;AAEvC,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACjC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,GAAI,UAAS,gBAAqB,KAAG,MAOjE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GAAI,KAAK,QAAQ,KAAG,MAUtD,CAAC;AAqCF,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IACjB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAC/B,yCAAyC;IACzC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B;AAgCD;;;;GAIG;AACH,eAAO,MAAM,SAAS,GAAU,CAAC,EAC/B,MAAM,MAAM,EACZ,KAAK,QAAQ,EACb,OAAO,CAAC,GAAG,EAAE,OAAO,KAAK,CAAC,EAC1B,UAAS,gBAAqB,KAC7B,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,GAAG,SAAS,CA+DxC,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,GACrB,MAAM,MAAM,EACZ,KAAK,QAAQ,EACb,MAAM,OAAO,KACZ,OAAO,CAAC;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CA8B/D,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACvD,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC;CACjC;AAuBD,UAAU,WAAW;IACnB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW,GACtB,MAAM,MAAM,EACZ,UAAS,WAAgB,KACxB,OAAO,CAAC,SAAS,cAAc,EAAE,CAoBnC,CAAC;AAqDF,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED;;;GAGG;AACH,eAAO,MAAM,UAAU,GACrB,MAAM,MAAM,EACZ,KAAK,QAAQ,KACZ,OAAO,CAAC,WAAW,CAqBrB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,eAAe,GAC1B,SAAS,MAAM,EAEf,MAAK,MAAM,CAAC,UAAwB,KACnC,OAAO,CAAC,WAAW,CAGrB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GAAU,MAAM,MAAM,KAAG,OAAO,CAAC,WAAW,CAehE,CAAC;AAEF,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1C;AAED,eAAO,MAAM,KAAK,GAChB,MAAM,MAAM,EACZ,UAAS,WAAgB,KACxB,OAAO,CAAC,UAAU,CA6BpB,CAAC"}