silvermoon 0.3.0-rc.2 → 0.4.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 (812) hide show
  1. package/README.md +28 -28
  2. package/README.zh-CN.md +26 -24
  3. package/dist/bin/build-npm-tarball.d.ts +28 -0
  4. package/dist/bin/build-npm-tarball.d.ts.map +1 -0
  5. package/dist/bin/build-npm-tarball.js +200 -0
  6. package/dist/bin/build-npm-tarball.js.map +1 -0
  7. package/dist/bin/check-pack.d.ts +2 -0
  8. package/dist/bin/check-pack.d.ts.map +1 -0
  9. package/dist/bin/check-pack.js +421 -0
  10. package/dist/bin/check-pack.js.map +1 -0
  11. package/dist/bin/ci-package-risk.d.ts +19 -0
  12. package/dist/bin/ci-package-risk.d.ts.map +1 -0
  13. package/dist/bin/ci-package-risk.js +78 -0
  14. package/dist/bin/ci-package-risk.js.map +1 -0
  15. package/dist/bin/generate-npm-readme.d.ts +7 -0
  16. package/dist/bin/generate-npm-readme.d.ts.map +1 -0
  17. package/dist/bin/generate-npm-readme.js +232 -0
  18. package/dist/bin/generate-npm-readme.js.map +1 -0
  19. package/dist/bin/migrate-v1-to-v2.d.ts +3 -0
  20. package/dist/bin/migrate-v1-to-v2.d.ts.map +1 -0
  21. package/dist/bin/migrate-v1-to-v2.js +25 -0
  22. package/dist/bin/migrate-v1-to-v2.js.map +1 -0
  23. package/dist/bin/prepare-npm-release.d.ts +46 -0
  24. package/dist/bin/prepare-npm-release.d.ts.map +1 -0
  25. package/dist/bin/prepare-npm-release.js +210 -0
  26. package/dist/bin/prepare-npm-release.js.map +1 -0
  27. package/dist/bin/pure-check.d.ts +15 -0
  28. package/dist/bin/pure-check.d.ts.map +1 -0
  29. package/dist/bin/pure-check.js +448 -0
  30. package/dist/bin/pure-check.js.map +1 -0
  31. package/dist/bin/run-checks.d.ts +34 -0
  32. package/dist/bin/run-checks.d.ts.map +1 -0
  33. package/dist/bin/run-checks.js +149 -0
  34. package/dist/bin/run-checks.js.map +1 -0
  35. package/dist/bin/silvermoon.d.ts +76 -0
  36. package/dist/bin/silvermoon.d.ts.map +1 -0
  37. package/dist/bin/silvermoon.js +401 -0
  38. package/dist/bin/silvermoon.js.map +1 -0
  39. package/dist/bin/sync-skills.d.ts +2 -0
  40. package/dist/bin/sync-skills.d.ts.map +1 -0
  41. package/dist/bin/sync-skills.js +78 -0
  42. package/dist/bin/sync-skills.js.map +1 -0
  43. package/dist/bin/verify-npm-release.d.ts +55 -0
  44. package/dist/bin/verify-npm-release.d.ts.map +1 -0
  45. package/dist/bin/verify-npm-release.js +418 -0
  46. package/dist/bin/verify-npm-release.js.map +1 -0
  47. package/dist/src/business/agent-copilot.d.ts +82 -0
  48. package/dist/src/business/agent-copilot.d.ts.map +1 -0
  49. package/dist/src/business/agent-copilot.js +330 -0
  50. package/dist/src/business/agent-copilot.js.map +1 -0
  51. package/dist/src/business/agent-project-registry.d.ts +22 -0
  52. package/dist/src/business/agent-project-registry.d.ts.map +1 -0
  53. package/dist/src/business/agent-project-registry.js +239 -0
  54. package/dist/src/business/agent-project-registry.js.map +1 -0
  55. package/dist/src/business/agent-project-runtime.d.ts +37 -0
  56. package/dist/src/business/agent-project-runtime.d.ts.map +1 -0
  57. package/dist/src/business/agent-project-runtime.js +198 -0
  58. package/dist/src/business/agent-project-runtime.js.map +1 -0
  59. package/dist/src/business/append-event-history.d.ts +21 -0
  60. package/dist/src/business/append-event-history.d.ts.map +1 -0
  61. package/dist/src/business/append-event-history.js +138 -0
  62. package/dist/src/business/append-event-history.js.map +1 -0
  63. package/dist/src/business/append-event.d.ts +140 -0
  64. package/dist/src/business/append-event.d.ts.map +1 -0
  65. package/dist/src/business/append-event.js +292 -0
  66. package/dist/src/business/append-event.js.map +1 -0
  67. package/dist/src/business/check-repository.d.ts +109 -0
  68. package/dist/src/business/check-repository.d.ts.map +1 -0
  69. package/dist/src/business/check-repository.js +379 -0
  70. package/dist/src/business/check-repository.js.map +1 -0
  71. package/dist/src/business/create-idea.d.ts +100 -0
  72. package/dist/src/business/create-idea.d.ts.map +1 -0
  73. package/dist/src/business/create-idea.js +224 -0
  74. package/dist/src/business/create-idea.js.map +1 -0
  75. package/dist/src/business/event-command.d.ts +111 -0
  76. package/dist/src/business/event-command.d.ts.map +1 -0
  77. package/dist/src/business/event-command.js +239 -0
  78. package/dist/src/business/event-command.js.map +1 -0
  79. package/dist/src/business/index.d.ts +7 -0
  80. package/dist/src/business/index.d.ts.map +1 -0
  81. package/dist/src/business/index.js +7 -0
  82. package/dist/src/business/index.js.map +1 -0
  83. package/dist/src/business/list-ideas.d.ts +97 -0
  84. package/dist/src/business/list-ideas.d.ts.map +1 -0
  85. package/dist/src/business/list-ideas.js +177 -0
  86. package/dist/src/business/list-ideas.js.map +1 -0
  87. package/dist/src/business/migrate-v1-to-v2.d.ts +23 -0
  88. package/dist/src/business/migrate-v1-to-v2.d.ts.map +1 -0
  89. package/dist/src/business/migrate-v1-to-v2.js +152 -0
  90. package/dist/src/business/migrate-v1-to-v2.js.map +1 -0
  91. package/dist/src/business/replay-events.d.ts +20 -0
  92. package/dist/src/business/replay-events.d.ts.map +1 -0
  93. package/dist/src/business/replay-events.js +27 -0
  94. package/dist/src/business/replay-events.js.map +1 -0
  95. package/dist/src/business/schema-migration.d.ts +19 -0
  96. package/dist/src/business/schema-migration.d.ts.map +1 -0
  97. package/dist/src/business/schema-migration.js +23 -0
  98. package/dist/src/business/schema-migration.js.map +1 -0
  99. package/dist/src/business/shared/assess-idea-creation-readiness.d.ts +3 -0
  100. package/dist/src/business/shared/assess-idea-creation-readiness.d.ts.map +1 -0
  101. package/dist/src/business/shared/assess-idea-creation-readiness.js +9 -0
  102. package/dist/src/business/shared/assess-idea-creation-readiness.js.map +1 -0
  103. package/dist/src/business/shared/assess-repository-readiness-with.d.ts +18 -0
  104. package/dist/src/business/shared/assess-repository-readiness-with.d.ts.map +1 -0
  105. package/dist/src/business/shared/assess-repository-readiness-with.js +125 -0
  106. package/dist/src/business/shared/assess-repository-readiness-with.js.map +1 -0
  107. package/dist/src/business/shared/assess-repository-readiness.d.ts +3 -0
  108. package/dist/src/business/shared/assess-repository-readiness.d.ts.map +1 -0
  109. package/dist/src/business/shared/assess-repository-readiness.js +6 -0
  110. package/dist/src/business/shared/assess-repository-readiness.js.map +1 -0
  111. package/dist/src/business/shared/business-types.d.ts +151 -0
  112. package/dist/src/business/shared/business-types.d.ts.map +1 -0
  113. package/dist/src/business/shared/business-types.js +83 -0
  114. package/dist/src/business/shared/business-types.js.map +1 -0
  115. package/dist/src/business/shared/evaluate-local-readiness.d.ts +9 -0
  116. package/dist/src/business/shared/evaluate-local-readiness.d.ts.map +1 -0
  117. package/dist/src/business/shared/evaluate-local-readiness.js +97 -0
  118. package/dist/src/business/shared/evaluate-local-readiness.js.map +1 -0
  119. package/dist/src/business/shared/evaluate-primary-relation.d.ts +12 -0
  120. package/dist/src/business/shared/evaluate-primary-relation.d.ts.map +1 -0
  121. package/dist/src/business/shared/evaluate-primary-relation.js +40 -0
  122. package/dist/src/business/shared/evaluate-primary-relation.js.map +1 -0
  123. package/dist/src/business/shared/idea-layout.d.ts +55 -0
  124. package/dist/src/business/shared/idea-layout.d.ts.map +1 -0
  125. package/dist/src/business/shared/idea-layout.js +434 -0
  126. package/dist/src/business/shared/idea-layout.js.map +1 -0
  127. package/dist/src/business/shared/index.d.ts +18 -0
  128. package/dist/src/business/shared/index.d.ts.map +1 -0
  129. package/dist/src/business/shared/index.js +17 -0
  130. package/dist/src/business/shared/index.js.map +1 -0
  131. package/dist/src/business/shared/inspect-candidate.d.ts +5 -0
  132. package/dist/src/business/shared/inspect-candidate.d.ts.map +1 -0
  133. package/dist/src/business/shared/inspect-candidate.js +57 -0
  134. package/dist/src/business/shared/inspect-candidate.js.map +1 -0
  135. package/dist/src/business/shared/metadata-failure-observation.d.ts +21 -0
  136. package/dist/src/business/shared/metadata-failure-observation.d.ts.map +1 -0
  137. package/dist/src/business/shared/metadata-failure-observation.js +30 -0
  138. package/dist/src/business/shared/metadata-failure-observation.js.map +1 -0
  139. package/dist/src/business/shared/observe-device.d.ts +150 -0
  140. package/dist/src/business/shared/observe-device.d.ts.map +1 -0
  141. package/dist/src/business/shared/observe-device.js +71 -0
  142. package/dist/src/business/shared/observe-device.js.map +1 -0
  143. package/dist/src/business/shared/observe-idea.d.ts +14 -0
  144. package/dist/src/business/shared/observe-idea.d.ts.map +1 -0
  145. package/dist/src/business/shared/observe-idea.js +14 -0
  146. package/dist/src/business/shared/observe-idea.js.map +1 -0
  147. package/dist/src/business/shared/observe-project.d.ts +39 -0
  148. package/dist/src/business/shared/observe-project.d.ts.map +1 -0
  149. package/dist/src/business/shared/observe-project.js +11 -0
  150. package/dist/src/business/shared/observe-project.js.map +1 -0
  151. package/dist/src/business/shared/observe-snapshot.d.ts +35 -0
  152. package/dist/src/business/shared/observe-snapshot.d.ts.map +1 -0
  153. package/dist/src/business/shared/observe-snapshot.js +518 -0
  154. package/dist/src/business/shared/observe-snapshot.js.map +1 -0
  155. package/dist/src/business/shared/read-idea-inventory-item.d.ts +13 -0
  156. package/dist/src/business/shared/read-idea-inventory-item.d.ts.map +1 -0
  157. package/dist/src/business/shared/read-idea-inventory-item.js +18 -0
  158. package/dist/src/business/shared/read-idea-inventory-item.js.map +1 -0
  159. package/dist/src/business/shared/resolve-idea.d.ts +7 -0
  160. package/dist/src/business/shared/resolve-idea.d.ts.map +1 -0
  161. package/dist/src/business/shared/resolve-idea.js +14 -0
  162. package/dist/src/business/shared/resolve-idea.js.map +1 -0
  163. package/dist/src/business/shared/with-observation-language.d.ts +3 -0
  164. package/dist/src/business/shared/with-observation-language.d.ts.map +1 -0
  165. package/dist/src/business/shared/with-observation-language.js +20 -0
  166. package/dist/src/business/shared/with-observation-language.js.map +1 -0
  167. package/dist/src/business/whats-next.d.ts +94 -0
  168. package/dist/src/business/whats-next.d.ts.map +1 -0
  169. package/dist/src/business/whats-next.js +208 -0
  170. package/dist/src/business/whats-next.js.map +1 -0
  171. package/dist/src/foundation/command-message/index.d.ts +3 -0
  172. package/dist/src/foundation/command-message/index.d.ts.map +1 -0
  173. package/dist/src/foundation/command-message/index.js +3 -0
  174. package/dist/src/foundation/command-message/index.js.map +1 -0
  175. package/dist/src/foundation/command-message/observation.d.ts +223 -0
  176. package/dist/src/foundation/command-message/observation.d.ts.map +1 -0
  177. package/dist/src/foundation/command-message/observation.js +364 -0
  178. package/dist/src/foundation/command-message/observation.js.map +1 -0
  179. package/dist/src/foundation/command-message/runtime.d.ts +214 -0
  180. package/dist/src/foundation/command-message/runtime.d.ts.map +1 -0
  181. package/dist/src/foundation/command-message/runtime.js +215 -0
  182. package/dist/src/foundation/command-message/runtime.js.map +1 -0
  183. package/dist/src/foundation/coordinates/index.d.ts +3 -0
  184. package/dist/src/foundation/coordinates/index.d.ts.map +1 -0
  185. package/dist/src/foundation/coordinates/index.js +3 -0
  186. package/dist/src/foundation/coordinates/index.js.map +1 -0
  187. package/dist/src/foundation/coordinates/layout.d.ts +27 -0
  188. package/dist/src/foundation/coordinates/layout.d.ts.map +1 -0
  189. package/dist/src/foundation/coordinates/layout.js +41 -0
  190. package/dist/src/foundation/coordinates/layout.js.map +1 -0
  191. package/dist/src/foundation/coordinates/repository.d.ts +16 -0
  192. package/dist/src/foundation/coordinates/repository.d.ts.map +1 -0
  193. package/dist/src/foundation/coordinates/repository.js +75 -0
  194. package/dist/src/foundation/coordinates/repository.js.map +1 -0
  195. package/dist/src/foundation/device-config/index.d.ts +2 -0
  196. package/dist/src/foundation/device-config/index.d.ts.map +1 -0
  197. package/dist/src/foundation/device-config/index.js +2 -0
  198. package/dist/src/foundation/device-config/index.js.map +1 -0
  199. package/dist/src/foundation/device-config/user-config.d.ts +19 -0
  200. package/dist/src/foundation/device-config/user-config.d.ts.map +1 -0
  201. package/dist/src/foundation/device-config/user-config.js +94 -0
  202. package/dist/src/foundation/device-config/user-config.js.map +1 -0
  203. package/dist/src/foundation/event-codec/grammar.d.ts +172 -0
  204. package/dist/src/foundation/event-codec/grammar.d.ts.map +1 -0
  205. package/dist/src/foundation/event-codec/grammar.js +383 -0
  206. package/dist/src/foundation/event-codec/grammar.js.map +1 -0
  207. package/dist/src/foundation/event-codec/index.d.ts +3 -0
  208. package/dist/src/foundation/event-codec/index.d.ts.map +1 -0
  209. package/dist/src/foundation/event-codec/index.js +2 -0
  210. package/dist/src/foundation/event-codec/index.js.map +1 -0
  211. package/dist/src/foundation/event-cursor/cursor.d.ts +40 -0
  212. package/dist/src/foundation/event-cursor/cursor.d.ts.map +1 -0
  213. package/dist/src/foundation/event-cursor/cursor.js +42 -0
  214. package/dist/src/foundation/event-cursor/cursor.js.map +1 -0
  215. package/dist/src/foundation/event-cursor/index.d.ts +2 -0
  216. package/dist/src/foundation/event-cursor/index.d.ts.map +1 -0
  217. package/dist/src/foundation/event-cursor/index.js +2 -0
  218. package/dist/src/foundation/event-cursor/index.js.map +1 -0
  219. package/dist/src/foundation/event-history/digest.d.ts +2 -0
  220. package/dist/src/foundation/event-history/digest.d.ts.map +1 -0
  221. package/dist/src/foundation/event-history/digest.js +2 -0
  222. package/dist/src/foundation/event-history/digest.js.map +1 -0
  223. package/dist/src/foundation/event-history/history.d.ts +86 -0
  224. package/dist/src/foundation/event-history/history.d.ts.map +1 -0
  225. package/dist/src/foundation/event-history/history.js +481 -0
  226. package/dist/src/foundation/event-history/history.js.map +1 -0
  227. package/dist/src/foundation/event-history/index.d.ts +3 -0
  228. package/dist/src/foundation/event-history/index.d.ts.map +1 -0
  229. package/dist/src/foundation/event-history/index.js +3 -0
  230. package/dist/src/foundation/event-history/index.js.map +1 -0
  231. package/dist/src/foundation/event-reducer/index.d.ts +2 -0
  232. package/dist/src/foundation/event-reducer/index.d.ts.map +1 -0
  233. package/dist/src/foundation/event-reducer/index.js +2 -0
  234. package/dist/src/foundation/event-reducer/index.js.map +1 -0
  235. package/dist/src/foundation/event-reducer/policy.d.ts +69 -0
  236. package/dist/src/foundation/event-reducer/policy.d.ts.map +1 -0
  237. package/dist/src/foundation/event-reducer/policy.js +138 -0
  238. package/dist/src/foundation/event-reducer/policy.js.map +1 -0
  239. package/dist/src/foundation/event-store/digest.d.ts +11 -0
  240. package/dist/src/foundation/event-store/digest.d.ts.map +1 -0
  241. package/dist/src/foundation/event-store/digest.js +38 -0
  242. package/dist/src/foundation/event-store/digest.js.map +1 -0
  243. package/dist/src/foundation/event-store/index.d.ts +3 -0
  244. package/dist/src/foundation/event-store/index.d.ts.map +1 -0
  245. package/dist/src/foundation/event-store/index.js +3 -0
  246. package/dist/src/foundation/event-store/index.js.map +1 -0
  247. package/dist/src/foundation/event-store/storage.d.ts +50 -0
  248. package/dist/src/foundation/event-store/storage.d.ts.map +1 -0
  249. package/dist/src/foundation/event-store/storage.js +109 -0
  250. package/dist/src/foundation/event-store/storage.js.map +1 -0
  251. package/dist/src/foundation/git/derived-cache.d.ts +5 -0
  252. package/dist/src/foundation/git/derived-cache.d.ts.map +1 -0
  253. package/dist/src/foundation/git/derived-cache.js +117 -0
  254. package/dist/src/foundation/git/derived-cache.js.map +1 -0
  255. package/dist/src/foundation/git/git.d.ts +100 -0
  256. package/dist/src/foundation/git/git.d.ts.map +1 -0
  257. package/dist/src/foundation/git/git.js +677 -0
  258. package/dist/src/foundation/git/git.js.map +1 -0
  259. package/dist/src/foundation/git/index.d.ts +3 -0
  260. package/dist/src/foundation/git/index.d.ts.map +1 -0
  261. package/dist/src/foundation/git/index.js +3 -0
  262. package/dist/src/foundation/git/index.js.map +1 -0
  263. package/dist/src/foundation/guidance/guidance.d.ts +36 -0
  264. package/dist/src/foundation/guidance/guidance.d.ts.map +1 -0
  265. package/dist/src/foundation/guidance/guidance.js +198 -0
  266. package/dist/src/foundation/guidance/guidance.js.map +1 -0
  267. package/dist/src/foundation/guidance/index.d.ts +3 -0
  268. package/dist/src/foundation/guidance/index.d.ts.map +1 -0
  269. package/dist/src/foundation/guidance/index.js +3 -0
  270. package/dist/src/foundation/guidance/index.js.map +1 -0
  271. package/dist/src/foundation/guidance/rules.d.ts +36 -0
  272. package/dist/src/foundation/guidance/rules.d.ts.map +1 -0
  273. package/dist/src/foundation/guidance/rules.js +65 -0
  274. package/dist/src/foundation/guidance/rules.js.map +1 -0
  275. package/dist/src/foundation/idea-model/index.d.ts +3 -0
  276. package/dist/src/foundation/idea-model/index.d.ts.map +1 -0
  277. package/dist/src/foundation/idea-model/index.js +3 -0
  278. package/dist/src/foundation/idea-model/index.js.map +1 -0
  279. package/dist/src/foundation/idea-model/status.d.ts +28 -0
  280. package/dist/src/foundation/idea-model/status.d.ts.map +1 -0
  281. package/dist/src/foundation/idea-model/status.js +192 -0
  282. package/dist/src/foundation/idea-model/status.js.map +1 -0
  283. package/dist/src/foundation/idea-model/ulid.d.ts +6 -0
  284. package/dist/src/foundation/idea-model/ulid.d.ts.map +1 -0
  285. package/dist/src/foundation/idea-model/ulid.js +16 -0
  286. package/dist/src/foundation/idea-model/ulid.js.map +1 -0
  287. package/dist/src/foundation/idea-query/index.d.ts +3 -0
  288. package/dist/src/foundation/idea-query/index.d.ts.map +1 -0
  289. package/dist/src/foundation/idea-query/index.js +3 -0
  290. package/dist/src/foundation/idea-query/index.js.map +1 -0
  291. package/dist/src/foundation/idea-query/query.d.ts +13 -0
  292. package/dist/src/foundation/idea-query/query.d.ts.map +1 -0
  293. package/dist/src/foundation/idea-query/query.js +17 -0
  294. package/dist/src/foundation/idea-query/query.js.map +1 -0
  295. package/dist/src/foundation/idea-query/rules.d.ts +55 -0
  296. package/dist/src/foundation/idea-query/rules.d.ts.map +1 -0
  297. package/dist/src/foundation/idea-query/rules.js +223 -0
  298. package/dist/src/foundation/idea-query/rules.js.map +1 -0
  299. package/dist/src/foundation/idea-template/index.d.ts +2 -0
  300. package/dist/src/foundation/idea-template/index.d.ts.map +1 -0
  301. package/dist/src/foundation/idea-template/index.js +2 -0
  302. package/dist/src/foundation/idea-template/index.js.map +1 -0
  303. package/dist/src/foundation/idea-template/templates.d.ts +21 -0
  304. package/dist/src/foundation/idea-template/templates.d.ts.map +1 -0
  305. package/dist/src/foundation/idea-template/templates.js +265 -0
  306. package/dist/src/foundation/idea-template/templates.js.map +1 -0
  307. package/dist/src/foundation/installation/device-readiness.d.ts +94 -0
  308. package/dist/src/foundation/installation/device-readiness.d.ts.map +1 -0
  309. package/dist/src/foundation/installation/device-readiness.js +274 -0
  310. package/dist/src/foundation/installation/device-readiness.js.map +1 -0
  311. package/dist/src/foundation/installation/index.d.ts +4 -0
  312. package/dist/src/foundation/installation/index.d.ts.map +1 -0
  313. package/dist/src/foundation/installation/index.js +4 -0
  314. package/dist/src/foundation/installation/index.js.map +1 -0
  315. package/dist/src/foundation/installation/installation.d.ts +25 -0
  316. package/dist/src/foundation/installation/installation.d.ts.map +1 -0
  317. package/dist/src/foundation/installation/installation.js +125 -0
  318. package/dist/src/foundation/installation/installation.js.map +1 -0
  319. package/dist/src/foundation/installation/rules.d.ts +12 -0
  320. package/dist/src/foundation/installation/rules.d.ts.map +1 -0
  321. package/dist/src/foundation/installation/rules.js +63 -0
  322. package/dist/src/foundation/installation/rules.js.map +1 -0
  323. package/dist/src/foundation/language/index.d.ts +3 -0
  324. package/dist/src/foundation/language/index.d.ts.map +1 -0
  325. package/dist/src/foundation/language/index.js +2 -0
  326. package/dist/src/foundation/language/index.js.map +1 -0
  327. package/dist/src/foundation/language/language.d.ts +36 -0
  328. package/dist/src/foundation/language/language.d.ts.map +1 -0
  329. package/dist/src/foundation/language/language.js +94 -0
  330. package/dist/src/foundation/language/language.js.map +1 -0
  331. package/dist/src/foundation/owned-write/index.d.ts +2 -0
  332. package/dist/src/foundation/owned-write/index.d.ts.map +1 -0
  333. package/dist/src/foundation/owned-write/index.js +2 -0
  334. package/dist/src/foundation/owned-write/index.js.map +1 -0
  335. package/dist/src/foundation/owned-write/writer.d.ts +86 -0
  336. package/dist/src/foundation/owned-write/writer.d.ts.map +1 -0
  337. package/dist/src/foundation/owned-write/writer.js +244 -0
  338. package/dist/src/foundation/owned-write/writer.js.map +1 -0
  339. package/dist/src/foundation/package-resource/index.d.ts +2 -0
  340. package/dist/src/foundation/package-resource/index.d.ts.map +1 -0
  341. package/dist/src/foundation/package-resource/index.js +2 -0
  342. package/dist/src/foundation/package-resource/index.js.map +1 -0
  343. package/dist/src/foundation/package-resource/npm-tarball.d.ts +15 -0
  344. package/dist/src/foundation/package-resource/npm-tarball.d.ts.map +1 -0
  345. package/dist/src/foundation/package-resource/npm-tarball.js +124 -0
  346. package/dist/src/foundation/package-resource/npm-tarball.js.map +1 -0
  347. package/dist/src/foundation/process/index.d.ts +3 -0
  348. package/dist/src/foundation/process/index.d.ts.map +1 -0
  349. package/dist/src/foundation/process/index.js +3 -0
  350. package/dist/src/foundation/process/index.js.map +1 -0
  351. package/dist/src/foundation/process/npm-command.d.ts +9 -0
  352. package/dist/src/foundation/process/npm-command.d.ts.map +1 -0
  353. package/dist/src/foundation/process/npm-command.js +11 -0
  354. package/dist/src/foundation/process/npm-command.js.map +1 -0
  355. package/dist/src/foundation/process/subprocess.d.ts +8 -0
  356. package/dist/src/foundation/process/subprocess.d.ts.map +1 -0
  357. package/dist/src/foundation/process/subprocess.js +12 -0
  358. package/dist/src/foundation/process/subprocess.js.map +1 -0
  359. package/dist/src/foundation/project-config/config.d.ts +30 -0
  360. package/dist/src/foundation/project-config/config.d.ts.map +1 -0
  361. package/dist/src/foundation/project-config/config.js +112 -0
  362. package/dist/src/foundation/project-config/config.js.map +1 -0
  363. package/dist/src/foundation/project-config/index.d.ts +3 -0
  364. package/dist/src/foundation/project-config/index.d.ts.map +1 -0
  365. package/dist/src/foundation/project-config/index.js +3 -0
  366. package/dist/src/foundation/project-config/index.js.map +1 -0
  367. package/dist/src/foundation/project-config/rules.d.ts +32 -0
  368. package/dist/src/foundation/project-config/rules.d.ts.map +1 -0
  369. package/dist/src/foundation/project-config/rules.js +119 -0
  370. package/dist/src/foundation/project-config/rules.js.map +1 -0
  371. package/dist/src/foundation/projection-cache/index.d.ts +2 -0
  372. package/dist/src/foundation/projection-cache/index.d.ts.map +1 -0
  373. package/dist/src/foundation/projection-cache/index.js +2 -0
  374. package/dist/src/foundation/projection-cache/index.js.map +1 -0
  375. package/dist/src/foundation/projection-cache/projection.d.ts +36 -0
  376. package/dist/src/foundation/projection-cache/projection.d.ts.map +1 -0
  377. package/dist/src/foundation/projection-cache/projection.js +105 -0
  378. package/dist/src/foundation/projection-cache/projection.js.map +1 -0
  379. package/dist/src/foundation/renderer/index.d.ts +3 -0
  380. package/dist/src/foundation/renderer/index.d.ts.map +1 -0
  381. package/dist/src/foundation/renderer/index.js +3 -0
  382. package/dist/src/foundation/renderer/index.js.map +1 -0
  383. package/dist/src/foundation/renderer/markdown.d.ts +7 -0
  384. package/dist/src/foundation/renderer/markdown.d.ts.map +1 -0
  385. package/dist/src/foundation/renderer/markdown.js +355 -0
  386. package/dist/src/foundation/renderer/markdown.js.map +1 -0
  387. package/dist/src/foundation/renderer/render.d.ts +6 -0
  388. package/dist/src/foundation/renderer/render.d.ts.map +1 -0
  389. package/dist/src/foundation/renderer/render.js +23 -0
  390. package/dist/src/foundation/renderer/render.js.map +1 -0
  391. package/dist/src/foundation/report/dialogue.d.ts +37 -0
  392. package/dist/src/foundation/report/dialogue.d.ts.map +1 -0
  393. package/dist/src/foundation/report/dialogue.js +59 -0
  394. package/dist/src/foundation/report/dialogue.js.map +1 -0
  395. package/dist/src/foundation/report/index.d.ts +6 -0
  396. package/dist/src/foundation/report/index.d.ts.map +1 -0
  397. package/dist/src/foundation/report/index.js +6 -0
  398. package/dist/src/foundation/report/index.js.map +1 -0
  399. package/dist/src/foundation/report/instructions.d.ts +77 -0
  400. package/dist/src/foundation/report/instructions.d.ts.map +1 -0
  401. package/dist/src/foundation/report/instructions.js +374 -0
  402. package/dist/src/foundation/report/instructions.js.map +1 -0
  403. package/dist/src/foundation/report/observation.d.ts +31 -0
  404. package/dist/src/foundation/report/observation.d.ts.map +1 -0
  405. package/dist/src/foundation/report/observation.js +83 -0
  406. package/dist/src/foundation/report/observation.js.map +1 -0
  407. package/dist/src/foundation/report/projection.d.ts +7 -0
  408. package/dist/src/foundation/report/projection.d.ts.map +1 -0
  409. package/dist/src/foundation/report/projection.js +199 -0
  410. package/dist/src/foundation/report/projection.js.map +1 -0
  411. package/dist/src/foundation/report/templates/whats-next/contract.d.ts +148 -0
  412. package/dist/src/foundation/report/templates/whats-next/contract.d.ts.map +1 -0
  413. package/dist/src/foundation/report/templates/whats-next/contract.js +34 -0
  414. package/dist/src/foundation/report/templates/whats-next/contract.js.map +1 -0
  415. package/dist/src/foundation/report/templates/whats-next/en-US/content-language.d.ts +9 -0
  416. package/dist/src/foundation/report/templates/whats-next/en-US/content-language.d.ts.map +1 -0
  417. package/dist/src/foundation/report/templates/whats-next/en-US/content-language.js +5 -0
  418. package/dist/src/foundation/report/templates/whats-next/en-US/content-language.js.map +1 -0
  419. package/dist/src/foundation/report/templates/whats-next/en-US/detached-head.d.ts +9 -0
  420. package/dist/src/foundation/report/templates/whats-next/en-US/detached-head.d.ts.map +1 -0
  421. package/dist/src/foundation/report/templates/whats-next/en-US/detached-head.js +10 -0
  422. package/dist/src/foundation/report/templates/whats-next/en-US/detached-head.js.map +1 -0
  423. package/dist/src/foundation/report/templates/whats-next/en-US/event-history-invalid.d.ts +9 -0
  424. package/dist/src/foundation/report/templates/whats-next/en-US/event-history-invalid.d.ts.map +1 -0
  425. package/dist/src/foundation/report/templates/whats-next/en-US/event-history-invalid.js +5 -0
  426. package/dist/src/foundation/report/templates/whats-next/en-US/event-history-invalid.js.map +1 -0
  427. package/dist/src/foundation/report/templates/whats-next/en-US/head-missing.d.ts +9 -0
  428. package/dist/src/foundation/report/templates/whats-next/en-US/head-missing.d.ts.map +1 -0
  429. package/dist/src/foundation/report/templates/whats-next/en-US/head-missing.js +8 -0
  430. package/dist/src/foundation/report/templates/whats-next/en-US/head-missing.js.map +1 -0
  431. package/dist/src/foundation/report/templates/whats-next/en-US/idea-metadata-unavailable.d.ts +12 -0
  432. package/dist/src/foundation/report/templates/whats-next/en-US/idea-metadata-unavailable.d.ts.map +1 -0
  433. package/dist/src/foundation/report/templates/whats-next/en-US/idea-metadata-unavailable.js +8 -0
  434. package/dist/src/foundation/report/templates/whats-next/en-US/idea-metadata-unavailable.js.map +1 -0
  435. package/dist/src/foundation/report/templates/whats-next/en-US/idea-not-found.d.ts +9 -0
  436. package/dist/src/foundation/report/templates/whats-next/en-US/idea-not-found.d.ts.map +1 -0
  437. package/dist/src/foundation/report/templates/whats-next/en-US/idea-not-found.js +5 -0
  438. package/dist/src/foundation/report/templates/whats-next/en-US/idea-not-found.js.map +1 -0
  439. package/dist/src/foundation/report/templates/whats-next/en-US/index.d.ts +63 -0
  440. package/dist/src/foundation/report/templates/whats-next/en-US/index.d.ts.map +1 -0
  441. package/dist/src/foundation/report/templates/whats-next/en-US/index.js +63 -0
  442. package/dist/src/foundation/report/templates/whats-next/en-US/index.js.map +1 -0
  443. package/dist/src/foundation/report/templates/whats-next/en-US/lifecycle-deploying.d.ts +9 -0
  444. package/dist/src/foundation/report/templates/whats-next/en-US/lifecycle-deploying.d.ts.map +1 -0
  445. package/dist/src/foundation/report/templates/whats-next/en-US/lifecycle-deploying.js +13 -0
  446. package/dist/src/foundation/report/templates/whats-next/en-US/lifecycle-deploying.js.map +1 -0
  447. package/dist/src/foundation/report/templates/whats-next/en-US/lifecycle-implementing.d.ts +9 -0
  448. package/dist/src/foundation/report/templates/whats-next/en-US/lifecycle-implementing.d.ts.map +1 -0
  449. package/dist/src/foundation/report/templates/whats-next/en-US/lifecycle-implementing.js +13 -0
  450. package/dist/src/foundation/report/templates/whats-next/en-US/lifecycle-implementing.js.map +1 -0
  451. package/dist/src/foundation/report/templates/whats-next/en-US/lifecycle-inactive.d.ts +9 -0
  452. package/dist/src/foundation/report/templates/whats-next/en-US/lifecycle-inactive.d.ts.map +1 -0
  453. package/dist/src/foundation/report/templates/whats-next/en-US/lifecycle-inactive.js +11 -0
  454. package/dist/src/foundation/report/templates/whats-next/en-US/lifecycle-inactive.js.map +1 -0
  455. package/dist/src/foundation/report/templates/whats-next/en-US/lifecycle-preparing.d.ts +9 -0
  456. package/dist/src/foundation/report/templates/whats-next/en-US/lifecycle-preparing.d.ts.map +1 -0
  457. package/dist/src/foundation/report/templates/whats-next/en-US/lifecycle-preparing.js +13 -0
  458. package/dist/src/foundation/report/templates/whats-next/en-US/lifecycle-preparing.js.map +1 -0
  459. package/dist/src/foundation/report/templates/whats-next/en-US/navigation-ready.d.ts +9 -0
  460. package/dist/src/foundation/report/templates/whats-next/en-US/navigation-ready.d.ts.map +1 -0
  461. package/dist/src/foundation/report/templates/whats-next/en-US/navigation-ready.js +9 -0
  462. package/dist/src/foundation/report/templates/whats-next/en-US/navigation-ready.js.map +1 -0
  463. package/dist/src/foundation/report/templates/whats-next/en-US/phase-guidance-invalid.d.ts +9 -0
  464. package/dist/src/foundation/report/templates/whats-next/en-US/phase-guidance-invalid.d.ts.map +1 -0
  465. package/dist/src/foundation/report/templates/whats-next/en-US/phase-guidance-invalid.js +5 -0
  466. package/dist/src/foundation/report/templates/whats-next/en-US/phase-guidance-invalid.js.map +1 -0
  467. package/dist/src/foundation/report/templates/whats-next/en-US/preparation-seed.d.ts +9 -0
  468. package/dist/src/foundation/report/templates/whats-next/en-US/preparation-seed.d.ts.map +1 -0
  469. package/dist/src/foundation/report/templates/whats-next/en-US/preparation-seed.js +5 -0
  470. package/dist/src/foundation/report/templates/whats-next/en-US/preparation-seed.js.map +1 -0
  471. package/dist/src/foundation/report/templates/whats-next/en-US/primary-ahead.d.ts +9 -0
  472. package/dist/src/foundation/report/templates/whats-next/en-US/primary-ahead.d.ts.map +1 -0
  473. package/dist/src/foundation/report/templates/whats-next/en-US/primary-ahead.js +8 -0
  474. package/dist/src/foundation/report/templates/whats-next/en-US/primary-ahead.js.map +1 -0
  475. package/dist/src/foundation/report/templates/whats-next/en-US/primary-ancestry-inspection-failed.d.ts +9 -0
  476. package/dist/src/foundation/report/templates/whats-next/en-US/primary-ancestry-inspection-failed.d.ts.map +1 -0
  477. package/dist/src/foundation/report/templates/whats-next/en-US/primary-ancestry-inspection-failed.js +5 -0
  478. package/dist/src/foundation/report/templates/whats-next/en-US/primary-ancestry-inspection-failed.js.map +1 -0
  479. package/dist/src/foundation/report/templates/whats-next/en-US/primary-behind.d.ts +9 -0
  480. package/dist/src/foundation/report/templates/whats-next/en-US/primary-behind.d.ts.map +1 -0
  481. package/dist/src/foundation/report/templates/whats-next/en-US/primary-behind.js +8 -0
  482. package/dist/src/foundation/report/templates/whats-next/en-US/primary-behind.js.map +1 -0
  483. package/dist/src/foundation/report/templates/whats-next/en-US/primary-diverged.d.ts +9 -0
  484. package/dist/src/foundation/report/templates/whats-next/en-US/primary-diverged.d.ts.map +1 -0
  485. package/dist/src/foundation/report/templates/whats-next/en-US/primary-diverged.js +8 -0
  486. package/dist/src/foundation/report/templates/whats-next/en-US/primary-diverged.js.map +1 -0
  487. package/dist/src/foundation/report/templates/whats-next/en-US/primary-fetch-failed.d.ts +9 -0
  488. package/dist/src/foundation/report/templates/whats-next/en-US/primary-fetch-failed.d.ts.map +1 -0
  489. package/dist/src/foundation/report/templates/whats-next/en-US/primary-fetch-failed.js +5 -0
  490. package/dist/src/foundation/report/templates/whats-next/en-US/primary-fetch-failed.js.map +1 -0
  491. package/dist/src/foundation/report/templates/whats-next/en-US/primary-history-incomplete.d.ts +9 -0
  492. package/dist/src/foundation/report/templates/whats-next/en-US/primary-history-incomplete.d.ts.map +1 -0
  493. package/dist/src/foundation/report/templates/whats-next/en-US/primary-history-incomplete.js +8 -0
  494. package/dist/src/foundation/report/templates/whats-next/en-US/primary-history-incomplete.js.map +1 -0
  495. package/dist/src/foundation/report/templates/whats-next/en-US/primary-upstream-mismatch.d.ts +9 -0
  496. package/dist/src/foundation/report/templates/whats-next/en-US/primary-upstream-mismatch.d.ts.map +1 -0
  497. package/dist/src/foundation/report/templates/whats-next/en-US/primary-upstream-mismatch.js +11 -0
  498. package/dist/src/foundation/report/templates/whats-next/en-US/primary-upstream-mismatch.js.map +1 -0
  499. package/dist/src/foundation/report/templates/whats-next/en-US/project-recheck.d.ts +9 -0
  500. package/dist/src/foundation/report/templates/whats-next/en-US/project-recheck.d.ts.map +1 -0
  501. package/dist/src/foundation/report/templates/whats-next/en-US/project-recheck.js +5 -0
  502. package/dist/src/foundation/report/templates/whats-next/en-US/project-recheck.js.map +1 -0
  503. package/dist/src/foundation/report/templates/whats-next/en-US/repository-recheck.d.ts +9 -0
  504. package/dist/src/foundation/report/templates/whats-next/en-US/repository-recheck.d.ts.map +1 -0
  505. package/dist/src/foundation/report/templates/whats-next/en-US/repository-recheck.js +5 -0
  506. package/dist/src/foundation/report/templates/whats-next/en-US/repository-recheck.js.map +1 -0
  507. package/dist/src/foundation/report/templates/whats-next/en-US/review-presentation-instruction.d.ts +8 -0
  508. package/dist/src/foundation/report/templates/whats-next/en-US/review-presentation-instruction.d.ts.map +1 -0
  509. package/dist/src/foundation/report/templates/whats-next/en-US/review-presentation-instruction.js +10 -0
  510. package/dist/src/foundation/report/templates/whats-next/en-US/review-presentation-instruction.js.map +1 -0
  511. package/dist/src/foundation/report/templates/whats-next/en-US/review-presentation.d.ts +9 -0
  512. package/dist/src/foundation/report/templates/whats-next/en-US/review-presentation.d.ts.map +1 -0
  513. package/dist/src/foundation/report/templates/whats-next/en-US/review-presentation.js +39 -0
  514. package/dist/src/foundation/report/templates/whats-next/en-US/review-presentation.js.map +1 -0
  515. package/dist/src/foundation/report/templates/whats-next/en-US/worktree-changes-step.d.ts +8 -0
  516. package/dist/src/foundation/report/templates/whats-next/en-US/worktree-changes-step.d.ts.map +1 -0
  517. package/dist/src/foundation/report/templates/whats-next/en-US/worktree-changes-step.js +10 -0
  518. package/dist/src/foundation/report/templates/whats-next/en-US/worktree-changes-step.js.map +1 -0
  519. package/dist/src/foundation/report/templates/whats-next/en-US/worktree-conflict-step.d.ts +8 -0
  520. package/dist/src/foundation/report/templates/whats-next/en-US/worktree-conflict-step.d.ts.map +1 -0
  521. package/dist/src/foundation/report/templates/whats-next/en-US/worktree-conflict-step.js +10 -0
  522. package/dist/src/foundation/report/templates/whats-next/en-US/worktree-conflict-step.js.map +1 -0
  523. package/dist/src/foundation/report/templates/whats-next/en-US/worktree-conflicts.d.ts +9 -0
  524. package/dist/src/foundation/report/templates/whats-next/en-US/worktree-conflicts.d.ts.map +1 -0
  525. package/dist/src/foundation/report/templates/whats-next/en-US/worktree-conflicts.js +5 -0
  526. package/dist/src/foundation/report/templates/whats-next/en-US/worktree-conflicts.js.map +1 -0
  527. package/dist/src/foundation/report/templates/whats-next/en-US/worktree-inspection-failed.d.ts +9 -0
  528. package/dist/src/foundation/report/templates/whats-next/en-US/worktree-inspection-failed.d.ts.map +1 -0
  529. package/dist/src/foundation/report/templates/whats-next/en-US/worktree-inspection-failed.js +5 -0
  530. package/dist/src/foundation/report/templates/whats-next/en-US/worktree-inspection-failed.js.map +1 -0
  531. package/dist/src/foundation/report/templates/whats-next/en-US/worktree-summary.d.ts +9 -0
  532. package/dist/src/foundation/report/templates/whats-next/en-US/worktree-summary.d.ts.map +1 -0
  533. package/dist/src/foundation/report/templates/whats-next/en-US/worktree-summary.js +12 -0
  534. package/dist/src/foundation/report/templates/whats-next/en-US/worktree-summary.js.map +1 -0
  535. package/dist/src/foundation/report/templates/whats-next/index.d.ts +5 -0
  536. package/dist/src/foundation/report/templates/whats-next/index.d.ts.map +1 -0
  537. package/dist/src/foundation/report/templates/whats-next/index.js +4 -0
  538. package/dist/src/foundation/report/templates/whats-next/index.js.map +1 -0
  539. package/dist/src/foundation/report/templates/whats-next/registry.d.ts +4 -0
  540. package/dist/src/foundation/report/templates/whats-next/registry.d.ts.map +1 -0
  541. package/dist/src/foundation/report/templates/whats-next/registry.js +14 -0
  542. package/dist/src/foundation/report/templates/whats-next/registry.js.map +1 -0
  543. package/dist/src/foundation/report/templates/whats-next/renderers.d.ts +63 -0
  544. package/dist/src/foundation/report/templates/whats-next/renderers.d.ts.map +1 -0
  545. package/dist/src/foundation/report/templates/whats-next/renderers.js +176 -0
  546. package/dist/src/foundation/report/templates/whats-next/renderers.js.map +1 -0
  547. package/dist/src/foundation/report/templates/whats-next/zh-CN/content-language.d.ts +9 -0
  548. package/dist/src/foundation/report/templates/whats-next/zh-CN/content-language.d.ts.map +1 -0
  549. package/dist/src/foundation/report/templates/whats-next/zh-CN/content-language.js +5 -0
  550. package/dist/src/foundation/report/templates/whats-next/zh-CN/content-language.js.map +1 -0
  551. package/dist/src/foundation/report/templates/whats-next/zh-CN/detached-head.d.ts +9 -0
  552. package/dist/src/foundation/report/templates/whats-next/zh-CN/detached-head.d.ts.map +1 -0
  553. package/dist/src/foundation/report/templates/whats-next/zh-CN/detached-head.js +10 -0
  554. package/dist/src/foundation/report/templates/whats-next/zh-CN/detached-head.js.map +1 -0
  555. package/dist/src/foundation/report/templates/whats-next/zh-CN/event-history-invalid.d.ts +9 -0
  556. package/dist/src/foundation/report/templates/whats-next/zh-CN/event-history-invalid.d.ts.map +1 -0
  557. package/dist/src/foundation/report/templates/whats-next/zh-CN/event-history-invalid.js +5 -0
  558. package/dist/src/foundation/report/templates/whats-next/zh-CN/event-history-invalid.js.map +1 -0
  559. package/dist/src/foundation/report/templates/whats-next/zh-CN/head-missing.d.ts +9 -0
  560. package/dist/src/foundation/report/templates/whats-next/zh-CN/head-missing.d.ts.map +1 -0
  561. package/dist/src/foundation/report/templates/whats-next/zh-CN/head-missing.js +8 -0
  562. package/dist/src/foundation/report/templates/whats-next/zh-CN/head-missing.js.map +1 -0
  563. package/dist/src/foundation/report/templates/whats-next/zh-CN/idea-metadata-unavailable.d.ts +12 -0
  564. package/dist/src/foundation/report/templates/whats-next/zh-CN/idea-metadata-unavailable.d.ts.map +1 -0
  565. package/dist/src/foundation/report/templates/whats-next/zh-CN/idea-metadata-unavailable.js +8 -0
  566. package/dist/src/foundation/report/templates/whats-next/zh-CN/idea-metadata-unavailable.js.map +1 -0
  567. package/dist/src/foundation/report/templates/whats-next/zh-CN/idea-not-found.d.ts +9 -0
  568. package/dist/src/foundation/report/templates/whats-next/zh-CN/idea-not-found.d.ts.map +1 -0
  569. package/dist/src/foundation/report/templates/whats-next/zh-CN/idea-not-found.js +5 -0
  570. package/dist/src/foundation/report/templates/whats-next/zh-CN/idea-not-found.js.map +1 -0
  571. package/dist/src/foundation/report/templates/whats-next/zh-CN/index.d.ts +63 -0
  572. package/dist/src/foundation/report/templates/whats-next/zh-CN/index.d.ts.map +1 -0
  573. package/dist/src/foundation/report/templates/whats-next/zh-CN/index.js +63 -0
  574. package/dist/src/foundation/report/templates/whats-next/zh-CN/index.js.map +1 -0
  575. package/dist/src/foundation/report/templates/whats-next/zh-CN/lifecycle-deploying.d.ts +9 -0
  576. package/dist/src/foundation/report/templates/whats-next/zh-CN/lifecycle-deploying.d.ts.map +1 -0
  577. package/dist/src/foundation/report/templates/whats-next/zh-CN/lifecycle-deploying.js +13 -0
  578. package/dist/src/foundation/report/templates/whats-next/zh-CN/lifecycle-deploying.js.map +1 -0
  579. package/dist/src/foundation/report/templates/whats-next/zh-CN/lifecycle-implementing.d.ts +9 -0
  580. package/dist/src/foundation/report/templates/whats-next/zh-CN/lifecycle-implementing.d.ts.map +1 -0
  581. package/dist/src/foundation/report/templates/whats-next/zh-CN/lifecycle-implementing.js +13 -0
  582. package/dist/src/foundation/report/templates/whats-next/zh-CN/lifecycle-implementing.js.map +1 -0
  583. package/dist/src/foundation/report/templates/whats-next/zh-CN/lifecycle-inactive.d.ts +9 -0
  584. package/dist/src/foundation/report/templates/whats-next/zh-CN/lifecycle-inactive.d.ts.map +1 -0
  585. package/dist/src/foundation/report/templates/whats-next/zh-CN/lifecycle-inactive.js +11 -0
  586. package/dist/src/foundation/report/templates/whats-next/zh-CN/lifecycle-inactive.js.map +1 -0
  587. package/dist/src/foundation/report/templates/whats-next/zh-CN/lifecycle-preparing.d.ts +9 -0
  588. package/dist/src/foundation/report/templates/whats-next/zh-CN/lifecycle-preparing.d.ts.map +1 -0
  589. package/dist/src/foundation/report/templates/whats-next/zh-CN/lifecycle-preparing.js +13 -0
  590. package/dist/src/foundation/report/templates/whats-next/zh-CN/lifecycle-preparing.js.map +1 -0
  591. package/dist/src/foundation/report/templates/whats-next/zh-CN/navigation-ready.d.ts +9 -0
  592. package/dist/src/foundation/report/templates/whats-next/zh-CN/navigation-ready.d.ts.map +1 -0
  593. package/dist/src/foundation/report/templates/whats-next/zh-CN/navigation-ready.js +9 -0
  594. package/dist/src/foundation/report/templates/whats-next/zh-CN/navigation-ready.js.map +1 -0
  595. package/dist/src/foundation/report/templates/whats-next/zh-CN/phase-guidance-invalid.d.ts +9 -0
  596. package/dist/src/foundation/report/templates/whats-next/zh-CN/phase-guidance-invalid.d.ts.map +1 -0
  597. package/dist/src/foundation/report/templates/whats-next/zh-CN/phase-guidance-invalid.js +5 -0
  598. package/dist/src/foundation/report/templates/whats-next/zh-CN/phase-guidance-invalid.js.map +1 -0
  599. package/dist/src/foundation/report/templates/whats-next/zh-CN/preparation-seed.d.ts +9 -0
  600. package/dist/src/foundation/report/templates/whats-next/zh-CN/preparation-seed.d.ts.map +1 -0
  601. package/dist/src/foundation/report/templates/whats-next/zh-CN/preparation-seed.js +5 -0
  602. package/dist/src/foundation/report/templates/whats-next/zh-CN/preparation-seed.js.map +1 -0
  603. package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-ahead.d.ts +9 -0
  604. package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-ahead.d.ts.map +1 -0
  605. package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-ahead.js +8 -0
  606. package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-ahead.js.map +1 -0
  607. package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-ancestry-inspection-failed.d.ts +9 -0
  608. package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-ancestry-inspection-failed.d.ts.map +1 -0
  609. package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-ancestry-inspection-failed.js +5 -0
  610. package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-ancestry-inspection-failed.js.map +1 -0
  611. package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-behind.d.ts +9 -0
  612. package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-behind.d.ts.map +1 -0
  613. package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-behind.js +8 -0
  614. package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-behind.js.map +1 -0
  615. package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-diverged.d.ts +9 -0
  616. package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-diverged.d.ts.map +1 -0
  617. package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-diverged.js +8 -0
  618. package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-diverged.js.map +1 -0
  619. package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-fetch-failed.d.ts +9 -0
  620. package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-fetch-failed.d.ts.map +1 -0
  621. package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-fetch-failed.js +5 -0
  622. package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-fetch-failed.js.map +1 -0
  623. package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-history-incomplete.d.ts +9 -0
  624. package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-history-incomplete.d.ts.map +1 -0
  625. package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-history-incomplete.js +8 -0
  626. package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-history-incomplete.js.map +1 -0
  627. package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-upstream-mismatch.d.ts +9 -0
  628. package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-upstream-mismatch.d.ts.map +1 -0
  629. package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-upstream-mismatch.js +11 -0
  630. package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-upstream-mismatch.js.map +1 -0
  631. package/dist/src/foundation/report/templates/whats-next/zh-CN/project-recheck.d.ts +9 -0
  632. package/dist/src/foundation/report/templates/whats-next/zh-CN/project-recheck.d.ts.map +1 -0
  633. package/dist/src/foundation/report/templates/whats-next/zh-CN/project-recheck.js +5 -0
  634. package/dist/src/foundation/report/templates/whats-next/zh-CN/project-recheck.js.map +1 -0
  635. package/dist/src/foundation/report/templates/whats-next/zh-CN/repository-recheck.d.ts +9 -0
  636. package/dist/src/foundation/report/templates/whats-next/zh-CN/repository-recheck.d.ts.map +1 -0
  637. package/dist/src/foundation/report/templates/whats-next/zh-CN/repository-recheck.js +5 -0
  638. package/dist/src/foundation/report/templates/whats-next/zh-CN/repository-recheck.js.map +1 -0
  639. package/dist/src/foundation/report/templates/whats-next/zh-CN/review-presentation-instruction.d.ts +8 -0
  640. package/dist/src/foundation/report/templates/whats-next/zh-CN/review-presentation-instruction.d.ts.map +1 -0
  641. package/dist/src/foundation/report/templates/whats-next/zh-CN/review-presentation-instruction.js +10 -0
  642. package/dist/src/foundation/report/templates/whats-next/zh-CN/review-presentation-instruction.js.map +1 -0
  643. package/dist/src/foundation/report/templates/whats-next/zh-CN/review-presentation.d.ts +9 -0
  644. package/dist/src/foundation/report/templates/whats-next/zh-CN/review-presentation.d.ts.map +1 -0
  645. package/dist/src/foundation/report/templates/whats-next/zh-CN/review-presentation.js +39 -0
  646. package/dist/src/foundation/report/templates/whats-next/zh-CN/review-presentation.js.map +1 -0
  647. package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-changes-step.d.ts +8 -0
  648. package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-changes-step.d.ts.map +1 -0
  649. package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-changes-step.js +10 -0
  650. package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-changes-step.js.map +1 -0
  651. package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-conflict-step.d.ts +8 -0
  652. package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-conflict-step.d.ts.map +1 -0
  653. package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-conflict-step.js +10 -0
  654. package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-conflict-step.js.map +1 -0
  655. package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-conflicts.d.ts +9 -0
  656. package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-conflicts.d.ts.map +1 -0
  657. package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-conflicts.js +5 -0
  658. package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-conflicts.js.map +1 -0
  659. package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-inspection-failed.d.ts +9 -0
  660. package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-inspection-failed.d.ts.map +1 -0
  661. package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-inspection-failed.js +5 -0
  662. package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-inspection-failed.js.map +1 -0
  663. package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-summary.d.ts +9 -0
  664. package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-summary.d.ts.map +1 -0
  665. package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-summary.js +12 -0
  666. package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-summary.js.map +1 -0
  667. package/dist/src/foundation/report/types.d.ts +321 -0
  668. package/dist/src/foundation/report/types.d.ts.map +1 -0
  669. package/dist/src/foundation/report/types.js +2 -0
  670. package/dist/src/foundation/report/types.js.map +1 -0
  671. package/dist/src/foundation/scaffold-plan/index.d.ts +2 -0
  672. package/dist/src/foundation/scaffold-plan/index.d.ts.map +1 -0
  673. package/dist/src/foundation/scaffold-plan/index.js +2 -0
  674. package/dist/src/foundation/scaffold-plan/index.js.map +1 -0
  675. package/dist/src/foundation/scaffold-plan/scaffold-plan.d.ts +11 -0
  676. package/dist/src/foundation/scaffold-plan/scaffold-plan.d.ts.map +1 -0
  677. package/dist/src/foundation/scaffold-plan/scaffold-plan.js +36 -0
  678. package/dist/src/foundation/scaffold-plan/scaffold-plan.js.map +1 -0
  679. package/dist/src/foundation/schema/index.d.ts +3 -0
  680. package/dist/src/foundation/schema/index.d.ts.map +1 -0
  681. package/dist/src/foundation/schema/index.js +3 -0
  682. package/dist/src/foundation/schema/index.js.map +1 -0
  683. package/dist/src/foundation/schema/schema.d.ts +3 -0
  684. package/dist/src/foundation/schema/schema.d.ts.map +1 -0
  685. package/dist/src/foundation/schema/schema.js +10 -0
  686. package/dist/src/foundation/schema/schema.js.map +1 -0
  687. package/dist/src/foundation/schema/yaml.d.ts +10 -0
  688. package/dist/src/foundation/schema/yaml.d.ts.map +1 -0
  689. package/dist/src/foundation/schema/yaml.js +60 -0
  690. package/dist/src/foundation/schema/yaml.js.map +1 -0
  691. package/dist/src/foundation/schema-capability/index.d.ts +6 -0
  692. package/dist/src/foundation/schema-capability/index.d.ts.map +1 -0
  693. package/dist/src/foundation/schema-capability/index.js +4 -0
  694. package/dist/src/foundation/schema-capability/index.js.map +1 -0
  695. package/dist/src/foundation/schema-capability/inspection.d.ts +38 -0
  696. package/dist/src/foundation/schema-capability/inspection.d.ts.map +1 -0
  697. package/dist/src/foundation/schema-capability/inspection.js +249 -0
  698. package/dist/src/foundation/schema-capability/inspection.js.map +1 -0
  699. package/dist/src/foundation/schema-capability/manifest.d.ts +6 -0
  700. package/dist/src/foundation/schema-capability/manifest.d.ts.map +1 -0
  701. package/dist/src/foundation/schema-capability/manifest.js +17 -0
  702. package/dist/src/foundation/schema-capability/manifest.js.map +1 -0
  703. package/dist/src/foundation/schema-capability/rules.d.ts +38 -0
  704. package/dist/src/foundation/schema-capability/rules.d.ts.map +1 -0
  705. package/dist/src/foundation/schema-capability/rules.js +297 -0
  706. package/dist/src/foundation/schema-capability/rules.js.map +1 -0
  707. package/dist/src/foundation/skill-registration/adoption.d.ts +40 -0
  708. package/dist/src/foundation/skill-registration/adoption.d.ts.map +1 -0
  709. package/dist/src/foundation/skill-registration/adoption.js +63 -0
  710. package/dist/src/foundation/skill-registration/adoption.js.map +1 -0
  711. package/dist/src/foundation/skill-registration/index.d.ts +2 -0
  712. package/dist/src/foundation/skill-registration/index.d.ts.map +1 -0
  713. package/dist/src/foundation/skill-registration/index.js +2 -0
  714. package/dist/src/foundation/skill-registration/index.js.map +1 -0
  715. package/dist/src/foundation/skill-registration/rules.d.ts +2 -0
  716. package/dist/src/foundation/skill-registration/rules.d.ts.map +1 -0
  717. package/dist/src/foundation/skill-registration/rules.js +2 -0
  718. package/dist/src/foundation/skill-registration/rules.js.map +1 -0
  719. package/dist/src/foundation/snapshot/git-snapshot.d.ts +40 -0
  720. package/dist/src/foundation/snapshot/git-snapshot.d.ts.map +1 -0
  721. package/dist/src/foundation/snapshot/git-snapshot.js +168 -0
  722. package/dist/src/foundation/snapshot/git-snapshot.js.map +1 -0
  723. package/dist/src/foundation/snapshot/index.d.ts +2 -0
  724. package/dist/src/foundation/snapshot/index.d.ts.map +1 -0
  725. package/dist/src/foundation/snapshot/index.js +2 -0
  726. package/dist/src/foundation/snapshot/index.js.map +1 -0
  727. package/dist/src/foundation/state-transaction/index.d.ts +2 -0
  728. package/dist/src/foundation/state-transaction/index.d.ts.map +1 -0
  729. package/dist/src/foundation/state-transaction/index.js +2 -0
  730. package/dist/src/foundation/state-transaction/index.js.map +1 -0
  731. package/dist/src/foundation/state-transaction/state-transaction.d.ts +48 -0
  732. package/dist/src/foundation/state-transaction/state-transaction.d.ts.map +1 -0
  733. package/dist/src/foundation/state-transaction/state-transaction.js +364 -0
  734. package/dist/src/foundation/state-transaction/state-transaction.js.map +1 -0
  735. package/dist/src/foundation/terminal/index.d.ts +2 -0
  736. package/dist/src/foundation/terminal/index.d.ts.map +1 -0
  737. package/dist/src/foundation/terminal/index.js +2 -0
  738. package/dist/src/foundation/terminal/index.js.map +1 -0
  739. package/dist/src/foundation/terminal/terminal.d.ts +17 -0
  740. package/dist/src/foundation/terminal/terminal.d.ts.map +1 -0
  741. package/dist/src/foundation/terminal/terminal.js +12 -0
  742. package/dist/src/foundation/terminal/terminal.js.map +1 -0
  743. package/dist/src/foundation/trace/index.d.ts +2 -0
  744. package/dist/src/foundation/trace/index.d.ts.map +1 -0
  745. package/dist/src/foundation/trace/index.js +2 -0
  746. package/dist/src/foundation/trace/index.js.map +1 -0
  747. package/dist/src/foundation/trace/trace.d.ts +12 -0
  748. package/dist/src/foundation/trace/trace.d.ts.map +1 -0
  749. package/dist/src/foundation/trace/trace.js +299 -0
  750. package/dist/src/foundation/trace/trace.js.map +1 -0
  751. package/dist/src/foundation/tui/index.d.ts +3 -0
  752. package/dist/src/foundation/tui/index.d.ts.map +1 -0
  753. package/dist/src/foundation/tui/index.js +3 -0
  754. package/dist/src/foundation/tui/index.js.map +1 -0
  755. package/dist/src/foundation/tui/table.d.ts +10 -0
  756. package/dist/src/foundation/tui/table.d.ts.map +1 -0
  757. package/dist/src/foundation/tui/table.js +91 -0
  758. package/dist/src/foundation/tui/table.js.map +1 -0
  759. package/dist/src/foundation/tui/tui.d.ts +33 -0
  760. package/dist/src/foundation/tui/tui.d.ts.map +1 -0
  761. package/dist/src/foundation/tui/tui.js +157 -0
  762. package/dist/src/foundation/tui/tui.js.map +1 -0
  763. package/dist/src/index.d.ts +17 -0
  764. package/dist/src/index.d.ts.map +1 -0
  765. package/dist/src/index.js +16 -0
  766. package/dist/src/index.js.map +1 -0
  767. package/docs/core-concepts.md +48 -7
  768. package/docs/getting-started.md +60 -45
  769. package/docs/maintaining.md +132 -9
  770. package/docs/npm-package-releases.md +38 -9
  771. package/docs/operations.md +109 -35
  772. package/docs/reference.md +304 -35
  773. package/docs/repository-tasks.md +61 -20
  774. package/package.json +53 -27
  775. package/schema/capabilities.json +95 -0
  776. package/schema/capability-manifest.schema.json +139 -0
  777. package/schema/v1/command-report.schema.json +4 -2
  778. package/schema/v1/domain-message.schema.json +2 -1
  779. package/schema/v2/config.schema.json +14 -0
  780. package/schema/v2/idea-event.schema.json +121 -0
  781. package/skills/silvermoon/SKILL.md +204 -112
  782. package/skills/silvermoon/references/adoption.md +55 -24
  783. package/skills/silvermoon/references/events.md +296 -0
  784. package/bin/silvermoon.js +0 -10
  785. package/src/adoption.js +0 -559
  786. package/src/cli.js +0 -377
  787. package/src/config.js +0 -253
  788. package/src/create-idea.js +0 -497
  789. package/src/dialogue.js +0 -69
  790. package/src/domain.js +0 -592
  791. package/src/git-snapshot.js +0 -212
  792. package/src/git.js +0 -624
  793. package/src/guidance.js +0 -281
  794. package/src/idea-layout.js +0 -411
  795. package/src/idea-metadata.js +0 -48
  796. package/src/idea-query.js +0 -230
  797. package/src/idea-templates.js +0 -242
  798. package/src/ideas.js +0 -142
  799. package/src/index.js +0 -386
  800. package/src/language.js +0 -78
  801. package/src/layout.js +0 -38
  802. package/src/list-ideas.js +0 -196
  803. package/src/observation.js +0 -370
  804. package/src/repository.js +0 -82
  805. package/src/response.js +0 -492
  806. package/src/subprocess.js +0 -27
  807. package/src/trace.js +0 -292
  808. package/src/tui-table.js +0 -71
  809. package/src/tui.js +0 -205
  810. package/src/user-config.js +0 -135
  811. package/src/whatsnext.js +0 -726
  812. package/src/yaml.js +0 -66
@@ -0,0 +1,42 @@
1
+ import { gitContentDigest, snapshotEventFileHead, validateEventRecordSizes, } from "../event-store/index.js";
2
+ import { parseIdeaEvents } from "../event-codec/index.js";
3
+ export async function readEventDelta(root, paths, options, filesystem, cursor) {
4
+ if (!Number.isSafeInteger(cursor?.length) || cursor.length < 0
5
+ || !new RegExp(`^[0-9a-f]{${options.objectIdLength}}$`).test(cursor.digest ?? "")) {
6
+ throw new Error("Incremental replay requires an exact prior length and file digest.");
7
+ }
8
+ const head = await snapshotEventFileHead(root, paths, options, filesystem);
9
+ const bytes = await filesystem.snapshotFile(paths.eventsPath);
10
+ validateEventRecordSizes(bytes);
11
+ if (cursor.length > bytes.length) {
12
+ throw new Error("Stale cursor length; reobserve without replaying the old intent.");
13
+ }
14
+ const prefix = bytes.subarray(0, cursor.length);
15
+ let prefixEvents;
16
+ try {
17
+ prefixEvents = parseIdeaEvents(prefix, options);
18
+ }
19
+ catch (cause) {
20
+ throw new Error("Cursor length is not an event boundary.", { cause });
21
+ }
22
+ const prefixDigest = gitContentDigest("blob", prefix, options);
23
+ if (prefixDigest !== cursor.digest) {
24
+ throw new Error("Stale cursor digest; historical content changed. Reobserve before deciding a new intent.");
25
+ }
26
+ const events = parseIdeaEvents(bytes.subarray(cursor.length), options);
27
+ for (const [index, event] of [...prefixEvents, ...events].entries()) {
28
+ if (event.sequence !== index + 1) {
29
+ throw new Error(`Event sequence is not continuous at record ${index + 1}.`);
30
+ }
31
+ }
32
+ const cursorSequence = prefixEvents.at(-1)?.sequence ?? 0;
33
+ return {
34
+ outcome: "delta-observed",
35
+ length: bytes.length,
36
+ digest: head,
37
+ after: { length: cursor.length, digest: cursor.digest },
38
+ events,
39
+ sequence: events.at(-1)?.sequence ?? cursorSequence,
40
+ };
41
+ }
42
+ //# sourceMappingURL=cursor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../../../src/foundation/event-cursor/cursor.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAuB1D,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,IAAY,EACZ,KAA6B,EAC7B,OAAqD,EACrD,UAA8B,EAC9B,MAA0C;IAE1C,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC;WACzD,CAAC,IAAI,MAAM,CAAC,aAAa,OAAO,CAAC,cAAc,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,EAAE,CAAC;QACpF,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAC;IACxF,CAAC;IACD,MAAM,IAAI,GAAG,MAAM,qBAAqB,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;IAC3E,MAAM,KAAK,GAAG,MAAM,UAAU,CAAC,YAAY,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAC9D,wBAAwB,CAAC,KAAK,CAAC,CAAC;IAChC,IAAI,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC;IACtF,CAAC;IACD,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IAChD,IAAI,YAAgD,CAAC;IACrD,IAAI,CAAC;QACH,YAAY,GAAG,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,yCAAyC,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACxE,CAAC;IACD,MAAM,YAAY,GAAG,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/D,IAAI,YAAY,KAAK,MAAM,CAAC,MAAM,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CACb,0FAA0F,CAC3F,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAG,eAAe,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC;IACvE,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,YAAY,EAAE,GAAG,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;QACpE,IAAI,KAAK,CAAC,QAAQ,KAAK,KAAK,GAAG,CAAC,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CACb,8CAA8C,KAAK,GAAG,CAAC,GAAG,CAC3D,CAAC;QACJ,CAAC;IACH,CAAC;IACD,MAAM,cAAc,GAAG,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,IAAI,CAAC,CAAC;IAC1D,OAAO;QACL,OAAO,EAAE,gBAAgB;QACzB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;QACvD,MAAM;QACN,QAAQ,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,IAAI,cAAc;KACpD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { readEventDelta, } from "./cursor.ts";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/foundation/event-cursor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,GACf,MAAM,aAAa,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { readEventDelta, } from "./cursor.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/foundation/event-cursor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,GACf,MAAM,aAAa,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { MAX_EVENT_BYTES, algorithm, gitContentDigest, validateEventRecordSizes, } from "../event-store/index.ts";
2
+ //# sourceMappingURL=digest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"digest.d.ts","sourceRoot":"","sources":["../../../../src/foundation/event-history/digest.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,SAAS,EACT,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { MAX_EVENT_BYTES, algorithm, gitContentDigest, validateEventRecordSizes, } from "../event-store/index.js";
2
+ //# sourceMappingURL=digest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"digest.js","sourceRoot":"","sources":["../../../../src/foundation/event-history/digest.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,SAAS,EACT,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,86 @@
1
+ export declare const SOURCE_REPOSITORY = "https://github.com/shazhou-ww/silvermoon.git";
2
+ type EventFormat = "legacy" | "final";
3
+ interface ProjectConfig {
4
+ version: 1 | 2;
5
+ primaryRepository: string;
6
+ primaryBranch: string;
7
+ }
8
+ export interface HistoryBaseline {
9
+ commit: string;
10
+ source: string;
11
+ ref: string | null;
12
+ }
13
+ interface InspectHistoryOptions {
14
+ root: string;
15
+ tree: string;
16
+ config: ProjectConfig;
17
+ commit?: string;
18
+ primary?: string;
19
+ overrides?: ReadonlyMap<string, Buffer>;
20
+ }
21
+ export declare function localPrimary(root: string, config: ProjectConfig): HistoryBaseline;
22
+ export declare function detectEventFormat({ root, tree, overrides, }: Pick<InspectHistoryOptions, "root" | "tree" | "overrides">): Promise<EventFormat>;
23
+ export declare function inspectEventHistory(options: InspectHistoryOptions): Promise<{
24
+ results: ({
25
+ id: string;
26
+ mode: string;
27
+ candidate: {
28
+ ok: true;
29
+ state: import("../event-codec/grammar.ts").IdeaEventState;
30
+ };
31
+ } | {
32
+ ok: unknown;
33
+ mode: unknown;
34
+ id: string;
35
+ candidate?: never;
36
+ })[];
37
+ parent?: string | null;
38
+ valid: boolean;
39
+ baseline: HistoryBaseline;
40
+ target: string;
41
+ }>;
42
+ export declare function inspectProjectedEventHistory({ root, tree, primary, }: {
43
+ root: string;
44
+ tree: string;
45
+ primary: string;
46
+ }): Promise<{
47
+ supported: boolean;
48
+ reason: string;
49
+ id?: never;
50
+ reduction?: never;
51
+ valid?: never;
52
+ detail?: never;
53
+ target?: never;
54
+ baseline?: never;
55
+ results?: never;
56
+ } | {
57
+ supported: boolean;
58
+ reason: string;
59
+ id: string;
60
+ reduction: {
61
+ ok: false;
62
+ code: string;
63
+ sequence: number;
64
+ } | undefined;
65
+ valid?: never;
66
+ detail?: never;
67
+ target?: never;
68
+ baseline?: never;
69
+ results?: never;
70
+ } | {
71
+ supported: boolean;
72
+ valid: boolean;
73
+ detail: string;
74
+ target: string;
75
+ baseline: {
76
+ commit: string;
77
+ source: string;
78
+ ref: null;
79
+ };
80
+ results: Record<string, unknown>[];
81
+ reason?: never;
82
+ id?: never;
83
+ reduction?: never;
84
+ }>;
85
+ export {};
86
+ //# sourceMappingURL=history.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../../src/foundation/event-history/history.ts"],"names":[],"mappings":"AAyBA,eAAO,MAAM,iBAAiB,iDAAiD,CAAC;AAEhF,KAAK,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEtC,UAAU,aAAa;IACrB,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;IACf,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;CACvB;AA0BD,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACpB;AAED,UAAU,qBAAqB;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,aAAa,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACzC;AAgED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,eAAe,CAkBjF;AAyFD,wBAAsB,iBAAiB,CAAC,EACtC,IAAI,EACJ,IAAI,EACJ,SAAS,GACV,EAAE,IAAI,CAAC,qBAAqB,EAAE,MAAM,GAAG,MAAM,GAAG,WAAW,CAAC,wBAY5D;AA8LD,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,qBAAqB;;;;;;;;;;;;;;;;;;GAUvE;AA2DD,wBAAsB,4BAA4B,CAAC,EACjD,IAAI,EACJ,IAAI,EACJ,OAAO,GACR,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4EA"}
@@ -0,0 +1,481 @@
1
+ import { isDeepStrictEqual } from "node:util";
2
+ import { loadConfigSnapshot } from "../project-config/index.js";
3
+ import { EVENT_RENAMES, checkEventChange, eventsFromStatus, parseIdeaEvents, renameLegacyEvents, replayIdeaEvents, serializeIdeaEvents, } from "../event-codec/index.js";
4
+ import { isValidUlid, parseIdeaStatus } from "../idea-model/index.js";
5
+ import { inspectTreeLineage, readGitBlob, readGitBlobs, resolveCommit, runGit, } from "../git/index.js";
6
+ import { CONFIG_PATH, IDEAS_ROOT, ideaPaths } from "../coordinates/index.js";
7
+ import { snapshotEventPrefix, validateEventRecordSizes } from "../event-store/index.js";
8
+ import { createGitSnapshotFileSystem } from "../snapshot/index.js";
9
+ import { projectEventSnapshot, ProjectedReductionError } from "../projection-cache/index.js";
10
+ export const SOURCE_REPOSITORY = "https://github.com/shazhou-ww/silvermoon.git";
11
+ function errorMessage(error) {
12
+ return error instanceof Error ? error.message : String(error);
13
+ }
14
+ function requireBuffer(value, label) {
15
+ if (!Buffer.isBuffer(value))
16
+ throw new TypeError(`${label} must provide raw bytes.`);
17
+ return value;
18
+ }
19
+ function requireTreeEntries(value) {
20
+ if (!Array.isArray(value))
21
+ throw new TypeError("Git tree inspection must return entries.");
22
+ return value.map((entry) => {
23
+ if (entry === null || typeof entry !== "object"
24
+ || !("mode" in entry) || typeof entry.mode !== "string"
25
+ || !("type" in entry) || typeof entry.type !== "string"
26
+ || !("object" in entry) || typeof entry.object !== "string"
27
+ || !("name" in entry) || typeof entry.name !== "string"
28
+ || !("size" in entry)
29
+ || (entry.size !== null && typeof entry.size !== "number")) {
30
+ throw new TypeError("Git tree inspection returned an invalid entry.");
31
+ }
32
+ return {
33
+ mode: entry.mode,
34
+ type: entry.type,
35
+ object: entry.object,
36
+ size: entry.size,
37
+ name: entry.name,
38
+ };
39
+ });
40
+ }
41
+ function treeEntries(root, tree, path) {
42
+ return requireTreeEntries(inspectTreeLineage(root, tree, path));
43
+ }
44
+ function parsedEventType(bytes, id) {
45
+ let first;
46
+ try {
47
+ first = JSON.parse(bytes.toString("utf8").split("\n", 1)[0] ?? "");
48
+ }
49
+ catch (cause) {
50
+ throw new Error(`${id}: cannot identify historical event format: ${errorMessage(cause)}`, { cause });
51
+ }
52
+ if (first === null || typeof first !== "object"
53
+ || !("type" in first) || typeof first.type !== "string") {
54
+ throw new Error(`${id}: cannot identify historical event format: first event type is invalid`);
55
+ }
56
+ return first.type;
57
+ }
58
+ function git(root, args) {
59
+ const result = runGit(root, args);
60
+ if (!result.ok)
61
+ throw new Error(`Event history unavailable: ${result.stderr}`);
62
+ return result.stdout;
63
+ }
64
+ export function localPrimary(root, config) {
65
+ const refs = [];
66
+ for (const remote of git(root, ["remote"]).split("\n").filter(Boolean)) {
67
+ const url = git(root, ["config", "--get", `remote.${remote}.url`]);
68
+ if (url !== config.primaryRepository)
69
+ continue;
70
+ const ref = `refs/remotes/${remote}/${config.primaryBranch}`;
71
+ const result = runGit(root, ["rev-parse", "--verify", `${ref}^{commit}`]);
72
+ if (result.ok)
73
+ refs.push({ ref, commit: result.stdout });
74
+ }
75
+ if (!refs.length) {
76
+ throw new Error("Primary tracking ref unavailable; fetch the configured primary into its named remote.");
77
+ }
78
+ if (new Set(refs.map(({ commit }) => commit)).size !== 1) {
79
+ throw new Error("Primary tracking refs disagree; refresh them before checking.");
80
+ }
81
+ const first = refs[0];
82
+ if (!first)
83
+ throw new Error("Primary tracking ref unavailable.");
84
+ return { ...first, source: "local-tracking-ref-not-fetched" };
85
+ }
86
+ async function snapshot(root, tree, overrides, commit, blobs) {
87
+ const configEntry = treeEntries(root, tree, CONFIG_PATH)
88
+ .find(({ name }) => name === CONFIG_PATH);
89
+ const entries = treeEntries(root, tree, IDEAS_ROOT);
90
+ const stateBlobs = blobs ?? new Map();
91
+ if (!configEntry) {
92
+ if (entries.length)
93
+ throw new Error("Historical ideas exist without project configuration.");
94
+ return {
95
+ version: null,
96
+ entries,
97
+ ids: [],
98
+ sourceProject: false,
99
+ overrides,
100
+ commit,
101
+ blobs: stateBlobs,
102
+ format: null,
103
+ };
104
+ }
105
+ const loaded = await loadConfigSnapshot({ gitRoot: root, tree });
106
+ if (!loaded.config) {
107
+ throw new Error(`Invalid historical configuration: ${loaded.diagnostics.map((diagnostic) => diagnostic.message).join("; ")}`);
108
+ }
109
+ if (loaded.config.version !== 1 && loaded.config.version !== 2) {
110
+ throw new Error("Invalid historical configuration version.");
111
+ }
112
+ const config = loaded.config;
113
+ const ids = entries
114
+ .filter(({ type, name }) => type === "tree" && name.split("/").length === 3)
115
+ .map(({ name }) => name.split("/")[2])
116
+ .filter((id) => id !== undefined);
117
+ if (ids.some((id) => !isValidUlid(id))) {
118
+ throw new Error("Historical idea identity is invalid.");
119
+ }
120
+ const sourceProject = config.primaryRepository === SOURCE_REPOSITORY;
121
+ const stateFile = config.version === 2 ? "events.jsonl" : "status.yaml";
122
+ const stateObjects = entries
123
+ .filter(({ name, object, type }) => type === "blob"
124
+ && name.endsWith(`/${stateFile}`)
125
+ && !overrides?.has(name)
126
+ && !stateBlobs.has(object))
127
+ .map(({ object }) => object);
128
+ for (const [object, contents] of readGitBlobs(root, stateObjects)) {
129
+ if (typeof object !== "string")
130
+ throw new TypeError("Git batch returned an invalid object ID.");
131
+ stateBlobs.set(object, requireBuffer(contents, `Git object ${object}`));
132
+ }
133
+ const state = {
134
+ version: config.version,
135
+ entries,
136
+ ids,
137
+ sourceProject,
138
+ overrides,
139
+ commit,
140
+ blobs: stateBlobs,
141
+ format: null,
142
+ };
143
+ if (state.version !== 2)
144
+ return state;
145
+ const formats = new Set();
146
+ for (const id of ids) {
147
+ const bytes = source(root, state, id, "events.jsonl");
148
+ if (!bytes.length)
149
+ continue;
150
+ const format = Object.hasOwn(EVENT_RENAMES, parsedEventType(bytes, id))
151
+ ? "legacy"
152
+ : "final";
153
+ if (format === "legacy" && !sourceProject) {
154
+ throw new Error(`${id}: legacy dotted event history is only supported in the Silvermoon source repository`);
155
+ }
156
+ parseIdeaEvents(bytes, { legacy: format === "legacy", objectIdLength: tree.length });
157
+ formats.add(format);
158
+ }
159
+ if (formats.size > 1) {
160
+ throw new Error("Mixed legacy and final idea logs in one snapshot; migrate every idea together.");
161
+ }
162
+ state.format = formats.values().next().value ?? null;
163
+ return state;
164
+ }
165
+ export async function detectEventFormat({ root, tree, overrides, }) {
166
+ const state = await snapshot(root, tree, overrides);
167
+ if (state.format)
168
+ return state.format;
169
+ if (!state.sourceProject || state.version !== 2)
170
+ return "final";
171
+ let commit = resolveCommit(root, "HEAD");
172
+ while (commit) {
173
+ const previous = await snapshot(root, commit);
174
+ if (previous.version !== 2)
175
+ break;
176
+ if (previous.format)
177
+ return previous.format;
178
+ commit = firstParent(root, commit);
179
+ }
180
+ return "legacy";
181
+ }
182
+ function source(root, state, id, name) {
183
+ const paths = ideaPaths(id);
184
+ const path = `${paths.ideaPath}/${name}`;
185
+ const override = state.overrides?.get(path);
186
+ if (override !== undefined) {
187
+ const bytes = requireBuffer(override, `Historical override ${path}`);
188
+ if (name === "events.jsonl")
189
+ validateEventRecordSizes(bytes);
190
+ return bytes;
191
+ }
192
+ const entry = state.entries.find(({ name: entryName }) => entryName === path);
193
+ if (!entry || entry.type !== "blob" || !["100644", "100755"].includes(entry.mode)) {
194
+ throw new Error(`Historical state file missing or irregular: ${path}`);
195
+ }
196
+ const cached = state.blobs.get(entry.object);
197
+ if (cached !== undefined) {
198
+ if (name === "events.jsonl")
199
+ validateEventRecordSizes(cached);
200
+ return cached;
201
+ }
202
+ const bytes = requireBuffer(readGitBlob(root, entry.object), `Git object ${entry.object}`);
203
+ state.blobs.set(entry.object, bytes);
204
+ if (name === "events.jsonl")
205
+ validateEventRecordSizes(bytes);
206
+ return bytes;
207
+ }
208
+ function reductionFailure(result) {
209
+ return {
210
+ code: "code" in result ? result.code : "missing-code",
211
+ sequence: "sequence" in result ? result.sequence : "unknown",
212
+ };
213
+ }
214
+ function transition(root, base, candidate, id, options) {
215
+ const next = source(root, candidate, id, "events.jsonl");
216
+ const candidateOptions = { ...options, legacy: candidate.format === "legacy" };
217
+ if (!base.ids.includes(id)) {
218
+ const result = replayIdeaEvents(id, parseIdeaEvents(next, candidateOptions), candidateOptions);
219
+ if (!result.ok || !("state" in result)) {
220
+ const failure = reductionFailure(result);
221
+ throw new Error(`${id}: candidate ${String(failure.code)} at ${String(failure.sequence)}`);
222
+ }
223
+ return { id, mode: "initialization", candidate: result };
224
+ }
225
+ if (base.version === 1) {
226
+ const legacy = parseIdeaStatus(source(root, base, id, "status.yaml").toString("utf8"), options);
227
+ const result = replayIdeaEvents(id, parseIdeaEvents(next, candidateOptions), candidateOptions);
228
+ const { version: _version, ...facts } = legacy;
229
+ const migrationEvents = Reflect.apply(eventsFromStatus, undefined, [legacy, candidateOptions]);
230
+ if (!Array.isArray(migrationEvents)) {
231
+ throw new TypeError("Status migration did not produce an event list.");
232
+ }
233
+ if (legacy.id !== id || !result.ok || !("state" in result)
234
+ || !isDeepStrictEqual(facts, result.state.status)
235
+ || (!candidateOptions.legacy
236
+ && !isDeepStrictEqual(result.state.interaction, { messages: [] }))
237
+ || !next.equals(Buffer.from(serializeIdeaEvents(migrationEvents, candidateOptions)))) {
238
+ throw new Error(`${id}: migration must preserve every primary v1 fact exactly`);
239
+ }
240
+ return { id, mode: "migration", candidate: result };
241
+ }
242
+ const previous = source(root, base, id, "events.jsonl");
243
+ if (base.format === "legacy" && candidate.format === "final") {
244
+ if (base.ids.length !== candidate.ids.length) {
245
+ throw new Error("Legacy event migration must convert every existing idea without changing inventory.");
246
+ }
247
+ const legacyOptions = { ...options, legacy: true };
248
+ const oldEvents = parseIdeaEvents(previous, legacyOptions);
249
+ const old = replayIdeaEvents(id, oldEvents, legacyOptions);
250
+ if (!old.ok || !("state" in old)) {
251
+ const failure = reductionFailure(old);
252
+ throw new Error(`${id}: cannot migrate invalid legacy event ${String(failure.sequence)}: ${String(failure.code)}`);
253
+ }
254
+ const newEvents = parseIdeaEvents(next, candidateOptions);
255
+ if (!isDeepStrictEqual(newEvents, renameLegacyEvents(oldEvents))) {
256
+ throw new Error(`${id}: internal migration must preserve every legacy record, sequence and payload with only the exact type rename`);
257
+ }
258
+ const result = replayIdeaEvents(id, newEvents, candidateOptions);
259
+ if (!result.ok || !("state" in result) || !isDeepStrictEqual({ status: result.state.status, sequence: result.state.sequence }, old.state) || !isDeepStrictEqual(result.state.interaction, { messages: [] })) {
260
+ throw new Error(`${id}: internal migration changes historical facts or contains an invalid abandoned window`);
261
+ }
262
+ return { id, mode: "migration-final", candidate: result };
263
+ }
264
+ if (base.format === "final" && candidate.format === "legacy") {
265
+ throw new Error(`${id}: final event history cannot return to legacy dotted events`);
266
+ }
267
+ const checked = Reflect.apply(checkEventChange, undefined, [
268
+ id,
269
+ previous,
270
+ next,
271
+ { ...options, legacy: (candidate.format ?? base.format) === "legacy" },
272
+ ]);
273
+ if (checked === null || typeof checked !== "object"
274
+ || !("ok" in checked) || typeof checked.ok !== "boolean"
275
+ || !("mode" in checked) || typeof checked.mode !== "string") {
276
+ throw new TypeError("Event change inspection returned an invalid result.");
277
+ }
278
+ if (base.sourceProject && base.format === "final" && checked.mode === "repair"
279
+ && hasLegacyAncestor(root, base.commit ?? null)) {
280
+ throw new Error(`${id}: final event history must remain append-only after the migration boundary`);
281
+ }
282
+ if (!checked.ok) {
283
+ const failure = reductionFailure(checked);
284
+ throw Object.assign(new Error(`${id}: ${String(failure.code)} (${checked.mode})`), { eventCheck: { id, ...checked } });
285
+ }
286
+ return { id, ...checked };
287
+ }
288
+ function noDeletion(base, candidate) {
289
+ for (const id of base.ids) {
290
+ if (!candidate.ids.includes(id)) {
291
+ throw new Error(`${id}: removing an integrated idea is not an event repair`);
292
+ }
293
+ }
294
+ if (base.version !== null && candidate.version !== null
295
+ && base.version >= 2 && candidate.version < base.version) {
296
+ throw new Error("An event project cannot be downgraded to an earlier version.");
297
+ }
298
+ if (base.format === "legacy" && candidate.format === "final"
299
+ && (base.ids.length !== candidate.ids.length
300
+ || base.ids.some((id) => !candidate.ids.includes(id)))) {
301
+ throw new Error("Legacy event migration must convert every existing idea without changing inventory.");
302
+ }
303
+ }
304
+ function firstParent(root, commit) {
305
+ const body = git(root, ["cat-file", "-p", commit]);
306
+ return /^parent ([0-9a-f]+)$/m.exec(body.split("\n\n")[0] ?? "")?.[1] ?? null;
307
+ }
308
+ function hasLegacyAncestor(root, initialCommit) {
309
+ let commit = initialCommit;
310
+ while (commit) {
311
+ const state = snapshotFormat(root, commit);
312
+ if (state === "legacy")
313
+ return true;
314
+ if (state !== "final")
315
+ return false;
316
+ commit = firstParent(root, commit);
317
+ }
318
+ return false;
319
+ }
320
+ function snapshotFormat(root, commit) {
321
+ const entries = treeEntries(root, commit, IDEAS_ROOT);
322
+ for (const { name, type, object } of entries) {
323
+ if (type !== "blob" || !name.endsWith("/events.jsonl"))
324
+ continue;
325
+ const bytes = requireBuffer(readGitBlob(root, object), `Git object ${object}`);
326
+ if (!bytes.length)
327
+ continue;
328
+ return Object.hasOwn(EVENT_RENAMES, parsedEventType(bytes, name)) ? "legacy" : "final";
329
+ }
330
+ return treeEntries(root, commit, CONFIG_PATH).some(({ name }) => name === CONFIG_PATH)
331
+ ? "final"
332
+ : null;
333
+ }
334
+ export async function inspectEventHistory(options) {
335
+ const baseline = options.primary
336
+ ? { commit: options.primary, source: "fetched-primary", ref: null }
337
+ : localPrimary(options.root, options.config);
338
+ try {
339
+ return await inspectBoundHistory({ ...options, baseline });
340
+ }
341
+ catch (cause) {
342
+ if (cause instanceof Error)
343
+ throw Object.assign(cause, { eventBaseline: baseline });
344
+ throw Object.assign(new Error(errorMessage(cause), { cause }), { eventBaseline: baseline });
345
+ }
346
+ }
347
+ function snapshotInventory(filesystem) {
348
+ const entries = requireTreeEntries(filesystem.snapshotEntries(IDEAS_ROOT));
349
+ return entries
350
+ .filter(({ type }) => type === "tree")
351
+ .map(({ name }) => name.slice(IDEAS_ROOT.length + 1));
352
+ }
353
+ function withPreciseReaddir(filesystem) {
354
+ async function readdir(path, options) {
355
+ if (options?.withFileTypes === true) {
356
+ const entries = await filesystem.readdir(path, options);
357
+ if (entries.every((entry) => typeof entry !== "string")) {
358
+ return entries;
359
+ }
360
+ throw new TypeError("Snapshot directory entry metadata is invalid.");
361
+ }
362
+ const entries = await filesystem.readdir(path);
363
+ if (entries.every((entry) => typeof entry === "string")) {
364
+ return entries;
365
+ }
366
+ throw new TypeError("Snapshot directory names are invalid.");
367
+ }
368
+ return { ...filesystem, readdir };
369
+ }
370
+ function projectedSummary(projected) {
371
+ if (projected === null || typeof projected !== "object"
372
+ || !("digest" in projected) || typeof projected.digest !== "string"
373
+ || !("length" in projected) || typeof projected.length !== "number"
374
+ || !("state" in projected) || projected.state === null
375
+ || typeof projected.state !== "object" || !("sequence" in projected.state)) {
376
+ throw new TypeError("Projected event snapshot returned an invalid summary.");
377
+ }
378
+ return {
379
+ length: projected.length,
380
+ digest: projected.digest,
381
+ sequence: projected.state.sequence,
382
+ };
383
+ }
384
+ export async function inspectProjectedEventHistory({ root, tree, primary, }) {
385
+ const loaded = await loadConfigSnapshot({ gitRoot: root, tree: primary });
386
+ if (!loaded.config) {
387
+ throw new Error(`Invalid primary configuration: ${loaded.diagnostics.map((item) => item.message).join("; ")}`);
388
+ }
389
+ if (loaded.config.version !== 2) {
390
+ return { supported: false, reason: "version-transition" };
391
+ }
392
+ const baseline = withPreciseReaddir(createGitSnapshotFileSystem({ gitRoot: root, tree: primary }));
393
+ const candidate = withPreciseReaddir(createGitSnapshotFileSystem({ gitRoot: root, tree }));
394
+ const previousIds = snapshotInventory(baseline);
395
+ const ids = snapshotInventory(candidate);
396
+ if ([...previousIds, ...ids].some((id) => !isValidUlid(id))) {
397
+ throw new Error("Historical idea identity is invalid.");
398
+ }
399
+ if (previousIds.some((id) => !ids.includes(id))) {
400
+ throw new Error("Removing an integrated idea is not an event repair.");
401
+ }
402
+ if (previousIds.some((id) => baseline.snapshotEntry(ideaPaths(id).eventsPath)?.type !== "blob")
403
+ || ids.some((id) => candidate.snapshotEntry(ideaPaths(id).eventsPath)?.type !== "blob")) {
404
+ return { supported: false, reason: "storage-transition" };
405
+ }
406
+ const options = { objectIdLength: primary.length };
407
+ const results = [];
408
+ for (const id of ids) {
409
+ const paths = ideaPaths(id);
410
+ const next = await projectEventSnapshot(root, id, paths, options, candidate);
411
+ if (!previousIds.includes(id)) {
412
+ results.push({ id, mode: "initialization", candidate: projectedSummary(next) });
413
+ continue;
414
+ }
415
+ let previous;
416
+ try {
417
+ previous = await projectEventSnapshot(root, id, paths, options, baseline);
418
+ }
419
+ catch (cause) {
420
+ if (!(cause instanceof ProjectedReductionError))
421
+ throw cause;
422
+ const reduction = "result" in cause ? cause.result : undefined;
423
+ return {
424
+ supported: false,
425
+ reason: "primary-reduction-failed",
426
+ id,
427
+ reduction,
428
+ };
429
+ }
430
+ if (await snapshotEventPrefix(root, paths, options, candidate, previous.length) !== previous.digest) {
431
+ throw new Error(`${id}: not-append-only (append)`);
432
+ }
433
+ results.push({
434
+ id,
435
+ mode: "append",
436
+ base: projectedSummary(previous),
437
+ candidate: projectedSummary(next),
438
+ });
439
+ }
440
+ return {
441
+ supported: true,
442
+ valid: true,
443
+ detail: "summary",
444
+ target: "candidate",
445
+ baseline: { commit: primary, source: "fetched-primary", ref: null },
446
+ results,
447
+ };
448
+ }
449
+ async function inspectBoundHistory({ root, tree, commit, overrides, baseline, }) {
450
+ const blobs = new Map();
451
+ const primaryCommit = resolveCommit(root, baseline.commit);
452
+ const target = await snapshot(root, tree, overrides, commit, blobs);
453
+ const options = { objectIdLength: primaryCommit.length };
454
+ const results = [];
455
+ const targetCommit = commit === undefined ? null : resolveCommit(root, commit);
456
+ const parent = targetCommit ? firstParent(root, targetCommit) : null;
457
+ const baseCommit = targetCommit ? parent : primaryCommit;
458
+ const base = baseCommit
459
+ ? await snapshot(root, baseCommit, undefined, baseCommit, blobs)
460
+ : await snapshot(root, tree, undefined, undefined, blobs);
461
+ if (!baseCommit) {
462
+ base.version = null;
463
+ base.ids = [];
464
+ base.entries = [];
465
+ base.format = null;
466
+ }
467
+ noDeletion(base, target);
468
+ if (target.version === 2) {
469
+ for (const id of target.ids) {
470
+ results.push(transition(root, base, target, id, options));
471
+ }
472
+ }
473
+ return {
474
+ valid: true,
475
+ baseline,
476
+ target: targetCommit ? "commit" : "candidate",
477
+ ...(targetCommit ? { parent: baseCommit } : {}),
478
+ results,
479
+ };
480
+ }
481
+ //# sourceMappingURL=history.js.map