@enbox/gitd 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (502) hide show
  1. package/LICENSE +177 -0
  2. package/README.md +134 -0
  3. package/dist/esm/ci.js +76 -0
  4. package/dist/esm/ci.js.map +1 -0
  5. package/dist/esm/cli/agent.js +86 -0
  6. package/dist/esm/cli/agent.js.map +1 -0
  7. package/dist/esm/cli/commands/ci.js +278 -0
  8. package/dist/esm/cli/commands/ci.js.map +1 -0
  9. package/dist/esm/cli/commands/clone.js +77 -0
  10. package/dist/esm/cli/commands/clone.js.map +1 -0
  11. package/dist/esm/cli/commands/daemon.js +132 -0
  12. package/dist/esm/cli/commands/daemon.js.map +1 -0
  13. package/dist/esm/cli/commands/github-api.js +36 -0
  14. package/dist/esm/cli/commands/github-api.js.map +1 -0
  15. package/dist/esm/cli/commands/init.js +69 -0
  16. package/dist/esm/cli/commands/init.js.map +1 -0
  17. package/dist/esm/cli/commands/issue.js +293 -0
  18. package/dist/esm/cli/commands/issue.js.map +1 -0
  19. package/dist/esm/cli/commands/log.js +90 -0
  20. package/dist/esm/cli/commands/log.js.map +1 -0
  21. package/dist/esm/cli/commands/migrate.js +444 -0
  22. package/dist/esm/cli/commands/migrate.js.map +1 -0
  23. package/dist/esm/cli/commands/notification.js +141 -0
  24. package/dist/esm/cli/commands/notification.js.map +1 -0
  25. package/dist/esm/cli/commands/org.js +353 -0
  26. package/dist/esm/cli/commands/org.js.map +1 -0
  27. package/dist/esm/cli/commands/patch.js +375 -0
  28. package/dist/esm/cli/commands/patch.js.map +1 -0
  29. package/dist/esm/cli/commands/registry.js +501 -0
  30. package/dist/esm/cli/commands/registry.js.map +1 -0
  31. package/dist/esm/cli/commands/release.js +197 -0
  32. package/dist/esm/cli/commands/release.js.map +1 -0
  33. package/dist/esm/cli/commands/repo.js +148 -0
  34. package/dist/esm/cli/commands/repo.js.map +1 -0
  35. package/dist/esm/cli/commands/serve.js +148 -0
  36. package/dist/esm/cli/commands/serve.js.map +1 -0
  37. package/dist/esm/cli/commands/setup.js +92 -0
  38. package/dist/esm/cli/commands/setup.js.map +1 -0
  39. package/dist/esm/cli/commands/shim.js +75 -0
  40. package/dist/esm/cli/commands/shim.js.map +1 -0
  41. package/dist/esm/cli/commands/social.js +206 -0
  42. package/dist/esm/cli/commands/social.js.map +1 -0
  43. package/dist/esm/cli/commands/web.js +36 -0
  44. package/dist/esm/cli/commands/web.js.map +1 -0
  45. package/dist/esm/cli/commands/wiki.js +185 -0
  46. package/dist/esm/cli/commands/wiki.js.map +1 -0
  47. package/dist/esm/cli/flags.js +29 -0
  48. package/dist/esm/cli/flags.js.map +1 -0
  49. package/dist/esm/cli/main.js +331 -0
  50. package/dist/esm/cli/main.js.map +1 -0
  51. package/dist/esm/cli/repo-context.js +53 -0
  52. package/dist/esm/cli/repo-context.js.map +1 -0
  53. package/dist/esm/daemon/adapter.js +18 -0
  54. package/dist/esm/daemon/adapter.js.map +1 -0
  55. package/dist/esm/daemon/adapters/github.js +112 -0
  56. package/dist/esm/daemon/adapters/github.js.map +1 -0
  57. package/dist/esm/daemon/adapters/go.js +51 -0
  58. package/dist/esm/daemon/adapters/go.js.map +1 -0
  59. package/dist/esm/daemon/adapters/index.js +32 -0
  60. package/dist/esm/daemon/adapters/index.js.map +1 -0
  61. package/dist/esm/daemon/adapters/npm.js +51 -0
  62. package/dist/esm/daemon/adapters/npm.js.map +1 -0
  63. package/dist/esm/daemon/adapters/oci.js +62 -0
  64. package/dist/esm/daemon/adapters/oci.js.map +1 -0
  65. package/dist/esm/daemon/index.js +12 -0
  66. package/dist/esm/daemon/index.js.map +1 -0
  67. package/dist/esm/daemon/server.js +167 -0
  68. package/dist/esm/daemon/server.js.map +1 -0
  69. package/dist/esm/git-remote/credential-helper.js +106 -0
  70. package/dist/esm/git-remote/credential-helper.js.map +1 -0
  71. package/dist/esm/git-remote/credential-main.js +109 -0
  72. package/dist/esm/git-remote/credential-main.js.map +1 -0
  73. package/dist/esm/git-remote/index.js +10 -0
  74. package/dist/esm/git-remote/index.js.map +1 -0
  75. package/dist/esm/git-remote/main.js +78 -0
  76. package/dist/esm/git-remote/main.js.map +1 -0
  77. package/dist/esm/git-remote/parse-url.js +60 -0
  78. package/dist/esm/git-remote/parse-url.js.map +1 -0
  79. package/dist/esm/git-remote/resolve.js +175 -0
  80. package/dist/esm/git-remote/resolve.js.map +1 -0
  81. package/dist/esm/git-remote/service.js +82 -0
  82. package/dist/esm/git-remote/service.js.map +1 -0
  83. package/dist/esm/git-server/auth.js +211 -0
  84. package/dist/esm/git-server/auth.js.map +1 -0
  85. package/dist/esm/git-server/bundle-restore.js +180 -0
  86. package/dist/esm/git-server/bundle-restore.js.map +1 -0
  87. package/dist/esm/git-server/bundle-sync.js +233 -0
  88. package/dist/esm/git-server/bundle-sync.js.map +1 -0
  89. package/dist/esm/git-server/did-service.js +73 -0
  90. package/dist/esm/git-server/did-service.js.map +1 -0
  91. package/dist/esm/git-server/git-backend.js +186 -0
  92. package/dist/esm/git-server/git-backend.js.map +1 -0
  93. package/dist/esm/git-server/http-handler.js +295 -0
  94. package/dist/esm/git-server/http-handler.js.map +1 -0
  95. package/dist/esm/git-server/index.js +16 -0
  96. package/dist/esm/git-server/index.js.map +1 -0
  97. package/dist/esm/git-server/push-authorizer.js +62 -0
  98. package/dist/esm/git-server/push-authorizer.js.map +1 -0
  99. package/dist/esm/git-server/ref-sync.js +132 -0
  100. package/dist/esm/git-server/ref-sync.js.map +1 -0
  101. package/dist/esm/git-server/server.js +185 -0
  102. package/dist/esm/git-server/server.js.map +1 -0
  103. package/dist/esm/git-server/verify.js +109 -0
  104. package/dist/esm/git-server/verify.js.map +1 -0
  105. package/dist/esm/github-shim/helpers.js +273 -0
  106. package/dist/esm/github-shim/helpers.js.map +1 -0
  107. package/dist/esm/github-shim/index.js +13 -0
  108. package/dist/esm/github-shim/index.js.map +1 -0
  109. package/dist/esm/github-shim/issues.js +318 -0
  110. package/dist/esm/github-shim/issues.js.map +1 -0
  111. package/dist/esm/github-shim/pulls.js +423 -0
  112. package/dist/esm/github-shim/pulls.js.map +1 -0
  113. package/dist/esm/github-shim/releases.js +154 -0
  114. package/dist/esm/github-shim/releases.js.map +1 -0
  115. package/dist/esm/github-shim/repos.js +86 -0
  116. package/dist/esm/github-shim/repos.js.map +1 -0
  117. package/dist/esm/github-shim/server.js +351 -0
  118. package/dist/esm/github-shim/server.js.map +1 -0
  119. package/dist/esm/github-shim/users.js +61 -0
  120. package/dist/esm/github-shim/users.js.map +1 -0
  121. package/dist/esm/index.js +26 -0
  122. package/dist/esm/index.js.map +1 -0
  123. package/dist/esm/indexer/api.js +132 -0
  124. package/dist/esm/indexer/api.js.map +1 -0
  125. package/dist/esm/indexer/crawler.js +256 -0
  126. package/dist/esm/indexer/crawler.js.map +1 -0
  127. package/dist/esm/indexer/index.js +9 -0
  128. package/dist/esm/indexer/index.js.map +1 -0
  129. package/dist/esm/indexer/main.js +76 -0
  130. package/dist/esm/indexer/main.js.map +1 -0
  131. package/dist/esm/indexer/store.js +334 -0
  132. package/dist/esm/indexer/store.js.map +1 -0
  133. package/dist/esm/issues.js +133 -0
  134. package/dist/esm/issues.js.map +1 -0
  135. package/dist/esm/notifications.js +47 -0
  136. package/dist/esm/notifications.js.map +1 -0
  137. package/dist/esm/org.js +90 -0
  138. package/dist/esm/org.js.map +1 -0
  139. package/dist/esm/patches.js +136 -0
  140. package/dist/esm/patches.js.map +1 -0
  141. package/dist/esm/refs.js +54 -0
  142. package/dist/esm/refs.js.map +1 -0
  143. package/dist/esm/registry.js +81 -0
  144. package/dist/esm/registry.js.map +1 -0
  145. package/dist/esm/releases.js +78 -0
  146. package/dist/esm/releases.js.map +1 -0
  147. package/dist/esm/repo.js +150 -0
  148. package/dist/esm/repo.js.map +1 -0
  149. package/dist/esm/resolver/index.js +10 -0
  150. package/dist/esm/resolver/index.js.map +1 -0
  151. package/dist/esm/resolver/resolve.js +189 -0
  152. package/dist/esm/resolver/resolve.js.map +1 -0
  153. package/dist/esm/resolver/trust-chain.js +155 -0
  154. package/dist/esm/resolver/trust-chain.js.map +1 -0
  155. package/dist/esm/resolver/verify.js +186 -0
  156. package/dist/esm/resolver/verify.js.map +1 -0
  157. package/dist/esm/shims/go/index.js +9 -0
  158. package/dist/esm/shims/go/index.js.map +1 -0
  159. package/dist/esm/shims/go/proxy.js +275 -0
  160. package/dist/esm/shims/go/proxy.js.map +1 -0
  161. package/dist/esm/shims/go/server.js +70 -0
  162. package/dist/esm/shims/go/server.js.map +1 -0
  163. package/dist/esm/shims/index.js +15 -0
  164. package/dist/esm/shims/index.js.map +1 -0
  165. package/dist/esm/shims/npm/index.js +9 -0
  166. package/dist/esm/shims/npm/index.js.map +1 -0
  167. package/dist/esm/shims/npm/registry.js +234 -0
  168. package/dist/esm/shims/npm/registry.js.map +1 -0
  169. package/dist/esm/shims/npm/server.js +72 -0
  170. package/dist/esm/shims/npm/server.js.map +1 -0
  171. package/dist/esm/shims/oci/index.js +9 -0
  172. package/dist/esm/shims/oci/index.js.map +1 -0
  173. package/dist/esm/shims/oci/registry.js +276 -0
  174. package/dist/esm/shims/oci/registry.js.map +1 -0
  175. package/dist/esm/shims/oci/server.js +82 -0
  176. package/dist/esm/shims/oci/server.js.map +1 -0
  177. package/dist/esm/social.js +70 -0
  178. package/dist/esm/social.js.map +1 -0
  179. package/dist/esm/web/html.js +123 -0
  180. package/dist/esm/web/html.js.map +1 -0
  181. package/dist/esm/web/index.js +7 -0
  182. package/dist/esm/web/index.js.map +1 -0
  183. package/dist/esm/web/routes.js +420 -0
  184. package/dist/esm/web/routes.js.map +1 -0
  185. package/dist/esm/web/server.js +225 -0
  186. package/dist/esm/web/server.js.map +1 -0
  187. package/dist/esm/wiki.js +63 -0
  188. package/dist/esm/wiki.js.map +1 -0
  189. package/dist/types/ci.d.ts +203 -0
  190. package/dist/types/ci.d.ts.map +1 -0
  191. package/dist/types/cli/agent.d.ts +59 -0
  192. package/dist/types/cli/agent.d.ts.map +1 -0
  193. package/dist/types/cli/commands/ci.d.ts +16 -0
  194. package/dist/types/cli/commands/ci.d.ts.map +1 -0
  195. package/dist/types/cli/commands/clone.d.ts +13 -0
  196. package/dist/types/cli/commands/clone.d.ts.map +1 -0
  197. package/dist/types/cli/commands/daemon.d.ts +29 -0
  198. package/dist/types/cli/commands/daemon.d.ts.map +1 -0
  199. package/dist/types/cli/commands/github-api.d.ts +14 -0
  200. package/dist/types/cli/commands/github-api.d.ts.map +1 -0
  201. package/dist/types/cli/commands/init.d.ts +11 -0
  202. package/dist/types/cli/commands/init.d.ts.map +1 -0
  203. package/dist/types/cli/commands/issue.d.ts +16 -0
  204. package/dist/types/cli/commands/issue.d.ts.map +1 -0
  205. package/dist/types/cli/commands/log.d.ts +13 -0
  206. package/dist/types/cli/commands/log.d.ts.map +1 -0
  207. package/dist/types/cli/commands/migrate.d.ts +19 -0
  208. package/dist/types/cli/commands/migrate.d.ts.map +1 -0
  209. package/dist/types/cli/commands/notification.d.ts +16 -0
  210. package/dist/types/cli/commands/notification.d.ts.map +1 -0
  211. package/dist/types/cli/commands/org.d.ts +19 -0
  212. package/dist/types/cli/commands/org.d.ts.map +1 -0
  213. package/dist/types/cli/commands/patch.d.ts +17 -0
  214. package/dist/types/cli/commands/patch.d.ts.map +1 -0
  215. package/dist/types/cli/commands/registry.d.ts +25 -0
  216. package/dist/types/cli/commands/registry.d.ts.map +1 -0
  217. package/dist/types/cli/commands/release.d.ts +13 -0
  218. package/dist/types/cli/commands/release.d.ts.map +1 -0
  219. package/dist/types/cli/commands/repo.d.ts +15 -0
  220. package/dist/types/cli/commands/repo.d.ts.map +1 -0
  221. package/dist/types/cli/commands/serve.d.ts +22 -0
  222. package/dist/types/cli/commands/serve.d.ts.map +1 -0
  223. package/dist/types/cli/commands/setup.d.ts +16 -0
  224. package/dist/types/cli/commands/setup.d.ts.map +1 -0
  225. package/dist/types/cli/commands/shim.d.ts +16 -0
  226. package/dist/types/cli/commands/shim.d.ts.map +1 -0
  227. package/dist/types/cli/commands/social.d.ts +19 -0
  228. package/dist/types/cli/commands/social.d.ts.map +1 -0
  229. package/dist/types/cli/commands/web.d.ts +14 -0
  230. package/dist/types/cli/commands/web.d.ts.map +1 -0
  231. package/dist/types/cli/commands/wiki.d.ts +14 -0
  232. package/dist/types/cli/commands/wiki.d.ts.map +1 -0
  233. package/dist/types/cli/flags.d.ts +16 -0
  234. package/dist/types/cli/flags.d.ts.map +1 -0
  235. package/dist/types/cli/main.d.ts +69 -0
  236. package/dist/types/cli/main.d.ts.map +1 -0
  237. package/dist/types/cli/repo-context.d.ts +30 -0
  238. package/dist/types/cli/repo-context.d.ts.map +1 -0
  239. package/dist/types/daemon/adapter.d.ts +74 -0
  240. package/dist/types/daemon/adapter.d.ts.map +1 -0
  241. package/dist/types/daemon/adapters/github.d.ts +10 -0
  242. package/dist/types/daemon/adapters/github.d.ts.map +1 -0
  243. package/dist/types/daemon/adapters/go.d.ts +10 -0
  244. package/dist/types/daemon/adapters/go.d.ts.map +1 -0
  245. package/dist/types/daemon/adapters/index.d.ts +22 -0
  246. package/dist/types/daemon/adapters/index.d.ts.map +1 -0
  247. package/dist/types/daemon/adapters/npm.d.ts +10 -0
  248. package/dist/types/daemon/adapters/npm.d.ts.map +1 -0
  249. package/dist/types/daemon/adapters/oci.d.ts +10 -0
  250. package/dist/types/daemon/adapters/oci.d.ts.map +1 -0
  251. package/dist/types/daemon/index.d.ts +14 -0
  252. package/dist/types/daemon/index.d.ts.map +1 -0
  253. package/dist/types/daemon/server.d.ts +55 -0
  254. package/dist/types/daemon/server.d.ts.map +1 -0
  255. package/dist/types/git-remote/credential-helper.d.ts +49 -0
  256. package/dist/types/git-remote/credential-helper.d.ts.map +1 -0
  257. package/dist/types/git-remote/credential-main.d.ts +24 -0
  258. package/dist/types/git-remote/credential-main.d.ts.map +1 -0
  259. package/dist/types/git-remote/index.d.ts +10 -0
  260. package/dist/types/git-remote/index.d.ts.map +1 -0
  261. package/dist/types/git-remote/main.d.ts +23 -0
  262. package/dist/types/git-remote/main.d.ts.map +1 -0
  263. package/dist/types/git-remote/parse-url.d.ts +32 -0
  264. package/dist/types/git-remote/parse-url.d.ts.map +1 -0
  265. package/dist/types/git-remote/resolve.d.ts +30 -0
  266. package/dist/types/git-remote/resolve.d.ts.map +1 -0
  267. package/dist/types/git-remote/service.d.ts +75 -0
  268. package/dist/types/git-remote/service.d.ts.map +1 -0
  269. package/dist/types/git-server/auth.d.ts +129 -0
  270. package/dist/types/git-server/auth.d.ts.map +1 -0
  271. package/dist/types/git-server/bundle-restore.d.ts +48 -0
  272. package/dist/types/git-server/bundle-restore.d.ts.map +1 -0
  273. package/dist/types/git-server/bundle-sync.d.ts +90 -0
  274. package/dist/types/git-server/bundle-sync.d.ts.map +1 -0
  275. package/dist/types/git-server/did-service.d.ts +26 -0
  276. package/dist/types/git-server/did-service.d.ts.map +1 -0
  277. package/dist/types/git-server/git-backend.d.ts +84 -0
  278. package/dist/types/git-server/git-backend.d.ts.map +1 -0
  279. package/dist/types/git-server/http-handler.d.ts +73 -0
  280. package/dist/types/git-server/http-handler.d.ts.map +1 -0
  281. package/dist/types/git-server/index.d.ts +16 -0
  282. package/dist/types/git-server/index.d.ts.map +1 -0
  283. package/dist/types/git-server/push-authorizer.d.ts +38 -0
  284. package/dist/types/git-server/push-authorizer.d.ts.map +1 -0
  285. package/dist/types/git-server/ref-sync.d.ts +52 -0
  286. package/dist/types/git-server/ref-sync.d.ts.map +1 -0
  287. package/dist/types/git-server/server.d.ts +70 -0
  288. package/dist/types/git-server/server.d.ts.map +1 -0
  289. package/dist/types/git-server/verify.d.ts +12 -0
  290. package/dist/types/git-server/verify.d.ts.map +1 -0
  291. package/dist/types/github-shim/helpers.d.ts +108 -0
  292. package/dist/types/github-shim/helpers.d.ts.map +1 -0
  293. package/dist/types/github-shim/index.d.ts +15 -0
  294. package/dist/types/github-shim/index.d.ts.map +1 -0
  295. package/dist/types/github-shim/issues.d.ts +24 -0
  296. package/dist/types/github-shim/issues.d.ts.map +1 -0
  297. package/dist/types/github-shim/pulls.d.ts +31 -0
  298. package/dist/types/github-shim/pulls.d.ts.map +1 -0
  299. package/dist/types/github-shim/releases.d.ts +18 -0
  300. package/dist/types/github-shim/releases.d.ts.map +1 -0
  301. package/dist/types/github-shim/repos.d.ts +21 -0
  302. package/dist/types/github-shim/repos.d.ts.map +1 -0
  303. package/dist/types/github-shim/server.d.ts +53 -0
  304. package/dist/types/github-shim/server.d.ts.map +1 -0
  305. package/dist/types/github-shim/users.d.ts +17 -0
  306. package/dist/types/github-shim/users.d.ts.map +1 -0
  307. package/dist/types/index.d.ts +26 -0
  308. package/dist/types/index.d.ts.map +1 -0
  309. package/dist/types/indexer/api.d.ts +32 -0
  310. package/dist/types/indexer/api.d.ts.map +1 -0
  311. package/dist/types/indexer/crawler.d.ts +72 -0
  312. package/dist/types/indexer/crawler.d.ts.map +1 -0
  313. package/dist/types/indexer/index.d.ts +12 -0
  314. package/dist/types/indexer/index.d.ts.map +1 -0
  315. package/dist/types/indexer/main.d.ts +21 -0
  316. package/dist/types/indexer/main.d.ts.map +1 -0
  317. package/dist/types/indexer/store.d.ts +168 -0
  318. package/dist/types/indexer/store.d.ts.map +1 -0
  319. package/dist/types/issues.d.ts +395 -0
  320. package/dist/types/issues.d.ts.map +1 -0
  321. package/dist/types/notifications.d.ts +93 -0
  322. package/dist/types/notifications.d.ts.map +1 -0
  323. package/dist/types/org.d.ts +232 -0
  324. package/dist/types/org.d.ts.map +1 -0
  325. package/dist/types/patches.d.ts +410 -0
  326. package/dist/types/patches.d.ts.map +1 -0
  327. package/dist/types/refs.d.ts +114 -0
  328. package/dist/types/refs.d.ts.map +1 -0
  329. package/dist/types/registry.d.ts +212 -0
  330. package/dist/types/registry.d.ts.map +1 -0
  331. package/dist/types/releases.d.ts +204 -0
  332. package/dist/types/releases.d.ts.map +1 -0
  333. package/dist/types/repo.d.ts +450 -0
  334. package/dist/types/repo.d.ts.map +1 -0
  335. package/dist/types/resolver/index.d.ts +13 -0
  336. package/dist/types/resolver/index.d.ts.map +1 -0
  337. package/dist/types/resolver/resolve.d.ts +80 -0
  338. package/dist/types/resolver/resolve.d.ts.map +1 -0
  339. package/dist/types/resolver/trust-chain.d.ts +54 -0
  340. package/dist/types/resolver/trust-chain.d.ts.map +1 -0
  341. package/dist/types/resolver/verify.d.ts +62 -0
  342. package/dist/types/resolver/verify.d.ts.map +1 -0
  343. package/dist/types/shims/go/index.d.ts +11 -0
  344. package/dist/types/shims/go/index.d.ts.map +1 -0
  345. package/dist/types/shims/go/proxy.d.ts +51 -0
  346. package/dist/types/shims/go/proxy.d.ts.map +1 -0
  347. package/dist/types/shims/go/server.d.ts +23 -0
  348. package/dist/types/shims/go/server.d.ts.map +1 -0
  349. package/dist/types/shims/index.d.ts +18 -0
  350. package/dist/types/shims/index.d.ts.map +1 -0
  351. package/dist/types/shims/npm/index.d.ts +11 -0
  352. package/dist/types/shims/npm/index.d.ts.map +1 -0
  353. package/dist/types/shims/npm/registry.d.ts +46 -0
  354. package/dist/types/shims/npm/registry.d.ts.map +1 -0
  355. package/dist/types/shims/npm/server.d.ts +23 -0
  356. package/dist/types/shims/npm/server.d.ts.map +1 -0
  357. package/dist/types/shims/oci/index.d.ts +11 -0
  358. package/dist/types/shims/oci/index.d.ts.map +1 -0
  359. package/dist/types/shims/oci/registry.d.ts +56 -0
  360. package/dist/types/shims/oci/registry.d.ts.map +1 -0
  361. package/dist/types/shims/oci/server.d.ts +23 -0
  362. package/dist/types/shims/oci/server.d.ts.map +1 -0
  363. package/dist/types/social.d.ts +162 -0
  364. package/dist/types/social.d.ts.map +1 -0
  365. package/dist/types/web/html.d.ts +23 -0
  366. package/dist/types/web/html.d.ts.map +1 -0
  367. package/dist/types/web/index.d.ts +8 -0
  368. package/dist/types/web/index.d.ts.map +1 -0
  369. package/dist/types/web/routes.d.ts +21 -0
  370. package/dist/types/web/routes.d.ts.map +1 -0
  371. package/dist/types/web/server.d.ts +38 -0
  372. package/dist/types/web/server.d.ts.map +1 -0
  373. package/dist/types/wiki.d.ts +143 -0
  374. package/dist/types/wiki.d.ts.map +1 -0
  375. package/package.json +108 -0
  376. package/schemas/ci/check-run.json +23 -0
  377. package/schemas/ci/check-suite.json +23 -0
  378. package/schemas/issues/assignment.json +17 -0
  379. package/schemas/issues/comment.json +14 -0
  380. package/schemas/issues/issue.json +20 -0
  381. package/schemas/issues/label.json +17 -0
  382. package/schemas/issues/reaction.json +14 -0
  383. package/schemas/issues/status-change.json +14 -0
  384. package/schemas/notifications/notification.json +20 -0
  385. package/schemas/org/org-member.json +17 -0
  386. package/schemas/org/org.json +26 -0
  387. package/schemas/org/team-member.json +17 -0
  388. package/schemas/org/team.json +17 -0
  389. package/schemas/patches/merge-result.json +14 -0
  390. package/schemas/patches/patch-status-change.json +14 -0
  391. package/schemas/patches/patch.json +20 -0
  392. package/schemas/patches/review-comment.json +17 -0
  393. package/schemas/patches/review.json +14 -0
  394. package/schemas/patches/revision.json +30 -0
  395. package/schemas/refs/git-ref.json +32 -0
  396. package/schemas/registry/attestation.json +23 -0
  397. package/schemas/registry/package-version.json +23 -0
  398. package/schemas/registry/package.json +32 -0
  399. package/schemas/releases/release.json +17 -0
  400. package/schemas/repo/collaborator.json +17 -0
  401. package/schemas/repo/repo.json +35 -0
  402. package/schemas/repo/settings.json +39 -0
  403. package/schemas/repo/topic.json +14 -0
  404. package/schemas/repo/webhook.json +26 -0
  405. package/schemas/social/activity.json +23 -0
  406. package/schemas/social/follow.json +17 -0
  407. package/schemas/social/star.json +20 -0
  408. package/schemas/wiki/wiki-history.json +20 -0
  409. package/schemas/wiki/wiki-page.json +17 -0
  410. package/src/ci.ts +118 -0
  411. package/src/cli/agent.ts +117 -0
  412. package/src/cli/commands/ci.ts +300 -0
  413. package/src/cli/commands/clone.ts +78 -0
  414. package/src/cli/commands/daemon.ts +129 -0
  415. package/src/cli/commands/github-api.ts +30 -0
  416. package/src/cli/commands/init.ts +69 -0
  417. package/src/cli/commands/issue.ts +321 -0
  418. package/src/cli/commands/log.ts +106 -0
  419. package/src/cli/commands/migrate.ts +525 -0
  420. package/src/cli/commands/notification.ts +148 -0
  421. package/src/cli/commands/org.ts +381 -0
  422. package/src/cli/commands/patch.ts +413 -0
  423. package/src/cli/commands/registry.ts +542 -0
  424. package/src/cli/commands/release.ts +189 -0
  425. package/src/cli/commands/repo.ts +160 -0
  426. package/src/cli/commands/serve.ts +153 -0
  427. package/src/cli/commands/setup.ts +97 -0
  428. package/src/cli/commands/shim.ts +79 -0
  429. package/src/cli/commands/social.ts +221 -0
  430. package/src/cli/commands/web.ts +30 -0
  431. package/src/cli/commands/wiki.ts +199 -0
  432. package/src/cli/flags.ts +28 -0
  433. package/src/cli/main.ts +350 -0
  434. package/src/cli/repo-context.ts +55 -0
  435. package/src/daemon/adapter.ts +95 -0
  436. package/src/daemon/adapters/github.ts +86 -0
  437. package/src/daemon/adapters/go.ts +47 -0
  438. package/src/daemon/adapters/index.ts +36 -0
  439. package/src/daemon/adapters/npm.ts +47 -0
  440. package/src/daemon/adapters/oci.ts +59 -0
  441. package/src/daemon/index.ts +16 -0
  442. package/src/daemon/server.ts +204 -0
  443. package/src/git-remote/credential-helper.ts +114 -0
  444. package/src/git-remote/credential-main.ts +118 -0
  445. package/src/git-remote/index.ts +10 -0
  446. package/src/git-remote/main.ts +74 -0
  447. package/src/git-remote/parse-url.ts +81 -0
  448. package/src/git-remote/resolve.ts +207 -0
  449. package/src/git-remote/service.ts +126 -0
  450. package/src/git-server/auth.ts +308 -0
  451. package/src/git-server/bundle-restore.ts +217 -0
  452. package/src/git-server/bundle-sync.ts +300 -0
  453. package/src/git-server/did-service.ts +77 -0
  454. package/src/git-server/git-backend.ts +222 -0
  455. package/src/git-server/http-handler.ts +386 -0
  456. package/src/git-server/index.ts +16 -0
  457. package/src/git-server/push-authorizer.ts +77 -0
  458. package/src/git-server/ref-sync.ts +166 -0
  459. package/src/git-server/server.ts +236 -0
  460. package/src/git-server/verify.ts +116 -0
  461. package/src/github-shim/helpers.ts +311 -0
  462. package/src/github-shim/index.ts +35 -0
  463. package/src/github-shim/issues.ts +389 -0
  464. package/src/github-shim/pulls.ts +500 -0
  465. package/src/github-shim/releases.ts +185 -0
  466. package/src/github-shim/repos.ts +95 -0
  467. package/src/github-shim/server.ts +334 -0
  468. package/src/github-shim/users.ts +63 -0
  469. package/src/index.ts +26 -0
  470. package/src/indexer/api.ts +162 -0
  471. package/src/indexer/crawler.ts +290 -0
  472. package/src/indexer/index.ts +22 -0
  473. package/src/indexer/main.ts +83 -0
  474. package/src/indexer/store.ts +408 -0
  475. package/src/issues.ts +200 -0
  476. package/src/notifications.ts +80 -0
  477. package/src/org.ts +147 -0
  478. package/src/patches.ts +203 -0
  479. package/src/refs.ts +94 -0
  480. package/src/registry.ts +132 -0
  481. package/src/releases.ts +124 -0
  482. package/src/repo.ts +234 -0
  483. package/src/resolver/index.ts +42 -0
  484. package/src/resolver/resolve.ts +244 -0
  485. package/src/resolver/trust-chain.ts +217 -0
  486. package/src/resolver/verify.ts +237 -0
  487. package/src/shims/go/index.ts +14 -0
  488. package/src/shims/go/proxy.ts +336 -0
  489. package/src/shims/go/server.ts +82 -0
  490. package/src/shims/index.ts +20 -0
  491. package/src/shims/npm/index.ts +14 -0
  492. package/src/shims/npm/registry.ts +288 -0
  493. package/src/shims/npm/server.ts +84 -0
  494. package/src/shims/oci/index.ts +14 -0
  495. package/src/shims/oci/registry.ts +334 -0
  496. package/src/shims/oci/server.ts +94 -0
  497. package/src/social.ts +116 -0
  498. package/src/web/html.ts +120 -0
  499. package/src/web/index.ts +8 -0
  500. package/src/web/routes.ts +449 -0
  501. package/src/web/server.ts +256 -0
  502. package/src/wiki.ts +102 -0
@@ -0,0 +1,408 @@
1
+ /**
2
+ * In-memory indexer store — maintains materialized views of data
3
+ * crawled from distributed DWN records.
4
+ *
5
+ * Each entity is keyed by a unique composite identifier (DID + recordId
6
+ * or similar) and stored in a Map. Aggregation methods compute star
7
+ * counts, trending scores, search results, etc. on the fly.
8
+ *
9
+ * A production deployment would back this with PostgreSQL or similar,
10
+ * but the in-memory implementation keeps the MVP dependency-free and
11
+ * testable.
12
+ *
13
+ * @module
14
+ */
15
+
16
+ // ---------------------------------------------------------------------------
17
+ // Types
18
+ // ---------------------------------------------------------------------------
19
+
20
+ /** Indexed repo metadata. */
21
+ export type IndexedRepo = {
22
+ did : string;
23
+ recordId : string;
24
+ contextId : string;
25
+ name : string;
26
+ description : string;
27
+ defaultBranch : string;
28
+ visibility : string;
29
+ language : string;
30
+ topics : string[];
31
+ openIssues : number;
32
+ openPatches : number;
33
+ releaseCount : number;
34
+ lastUpdated : string;
35
+ indexedAt : string;
36
+ };
37
+
38
+ /** Indexed star record. */
39
+ export type IndexedStar = {
40
+ starrerDid : string;
41
+ repoDid : string;
42
+ repoRecordId : string;
43
+ dateCreated : string;
44
+ };
45
+
46
+ /** Indexed follow record. */
47
+ export type IndexedFollow = {
48
+ followerDid : string;
49
+ targetDid : string;
50
+ dateCreated : string;
51
+ };
52
+
53
+ /** Crawl cursor — tracks progress per DID for incremental crawling. */
54
+ export type CrawlCursor = {
55
+ did : string;
56
+ lastCrawled : string;
57
+ };
58
+
59
+ /** Aggregated repo view with star count. */
60
+ export type RepoWithStars = IndexedRepo & { starCount: number };
61
+
62
+ /** Search result with relevance score. */
63
+ export type SearchResult = RepoWithStars & { score: number };
64
+
65
+ /** User profile summary. */
66
+ export type UserProfile = {
67
+ did : string;
68
+ repoCount : number;
69
+ starCount : number;
70
+ followerCount : number;
71
+ followingCount : number;
72
+ };
73
+
74
+ // ---------------------------------------------------------------------------
75
+ // Size limits
76
+ // ---------------------------------------------------------------------------
77
+
78
+ /** Configurable size limits for the in-memory store. */
79
+ export type IndexerStoreLimits = {
80
+ /** Maximum number of tracked DIDs. @default 100_000 */
81
+ maxDids? : number;
82
+ /** Maximum number of indexed repos. @default 100_000 */
83
+ maxRepos? : number;
84
+ /** Maximum number of indexed stars. @default 500_000 */
85
+ maxStars? : number;
86
+ /** Maximum number of indexed follows. @default 500_000 */
87
+ maxFollows? : number;
88
+ };
89
+
90
+ const DEFAULT_LIMITS: Required<IndexerStoreLimits> = {
91
+ maxDids : 100_000,
92
+ maxRepos : 100_000,
93
+ maxStars : 500_000,
94
+ maxFollows : 500_000,
95
+ };
96
+
97
+ // ---------------------------------------------------------------------------
98
+ // Store
99
+ // ---------------------------------------------------------------------------
100
+
101
+ /** In-memory indexer store with configurable size limits. */
102
+ export class IndexerStore {
103
+ /** Repos keyed by `did:recordId`. */
104
+ private _repos = new Map<string, IndexedRepo>();
105
+
106
+ /** Stars keyed by `starrerDid:repoDid:repoRecordId`. */
107
+ private _stars = new Map<string, IndexedStar>();
108
+
109
+ /** Follows keyed by `followerDid:targetDid`. */
110
+ private _follows = new Map<string, IndexedFollow>();
111
+
112
+ /** Known DIDs to crawl. */
113
+ private _dids = new Set<string>();
114
+
115
+ /** Per-DID crawl cursors. */
116
+ private _cursors = new Map<string, CrawlCursor>();
117
+
118
+ /** Size limits for LRU-style eviction. */
119
+ private _limits: Required<IndexerStoreLimits>;
120
+
121
+ public constructor(limits?: IndexerStoreLimits) {
122
+ this._limits = { ...DEFAULT_LIMITS, ...limits };
123
+ }
124
+
125
+ // -----------------------------------------------------------------------
126
+ // DID management
127
+ // -----------------------------------------------------------------------
128
+
129
+ /** Register a DID for crawling. Evicts oldest entry if at capacity. */
130
+ public addDid(did: string): void {
131
+ if (this._dids.has(did)) { this._dids.add(did); return; }
132
+ if (this._dids.size >= this._limits.maxDids) {
133
+ const oldest = this._dids.values().next().value;
134
+ if (oldest !== undefined) { this._dids.delete(oldest); }
135
+ }
136
+ this._dids.add(did);
137
+ }
138
+
139
+ /** Remove a DID from the crawl list. */
140
+ public removeDid(did: string): void {
141
+ this._dids.delete(did);
142
+ }
143
+
144
+ /** Get all registered DIDs. */
145
+ public getDids(): string[] {
146
+ return [...this._dids];
147
+ }
148
+
149
+ /** Get the crawl cursor for a DID. */
150
+ public getCursor(did: string): CrawlCursor | undefined {
151
+ return this._cursors.get(did);
152
+ }
153
+
154
+ /** Update the crawl cursor for a DID. */
155
+ public setCursor(did: string, lastCrawled: string): void {
156
+ this._cursors.set(did, { did, lastCrawled });
157
+ }
158
+
159
+ // -----------------------------------------------------------------------
160
+ // Repo operations
161
+ // -----------------------------------------------------------------------
162
+
163
+ /** Upsert an indexed repo. Evicts oldest entry if at capacity. */
164
+ public putRepo(repo: IndexedRepo): void {
165
+ const key = `${repo.did}:${repo.recordId}`;
166
+ if (!this._repos.has(key) && this._repos.size >= this._limits.maxRepos) {
167
+ const oldest = this._repos.keys().next().value;
168
+ if (oldest !== undefined) { this._repos.delete(oldest); }
169
+ }
170
+ this._repos.set(key, repo);
171
+ this.addDid(repo.did);
172
+ }
173
+
174
+ /** Get an indexed repo by DID (returns first match). */
175
+ public getRepo(did: string): IndexedRepo | undefined {
176
+ for (const repo of this._repos.values()) {
177
+ if (repo.did === did) { return repo; }
178
+ }
179
+ return undefined;
180
+ }
181
+
182
+ /** Get all indexed repos. */
183
+ public getAllRepos(): IndexedRepo[] {
184
+ return [...this._repos.values()];
185
+ }
186
+
187
+ // -----------------------------------------------------------------------
188
+ // Star operations
189
+ // -----------------------------------------------------------------------
190
+
191
+ /** Upsert an indexed star. Evicts oldest entry if at capacity. */
192
+ public putStar(star: IndexedStar): void {
193
+ const key = `${star.starrerDid}:${star.repoDid}:${star.repoRecordId}`;
194
+ if (!this._stars.has(key) && this._stars.size >= this._limits.maxStars) {
195
+ const oldest = this._stars.keys().next().value;
196
+ if (oldest !== undefined) { this._stars.delete(oldest); }
197
+ }
198
+ this._stars.set(key, star);
199
+ this.addDid(star.starrerDid);
200
+ }
201
+
202
+ /** Remove a star. */
203
+ public removeStar(starrerDid: string, repoDid: string, repoRecordId: string): void {
204
+ this._stars.delete(`${starrerDid}:${repoDid}:${repoRecordId}`);
205
+ }
206
+
207
+ /** Get star count for a repo. */
208
+ public getStarCount(repoDid: string, repoRecordId: string): number {
209
+ let count = 0;
210
+ for (const star of this._stars.values()) {
211
+ if (star.repoDid === repoDid && star.repoRecordId === repoRecordId) { count++; }
212
+ }
213
+ return count;
214
+ }
215
+
216
+ /** Get all stars for a repo. */
217
+ public getStarsForRepo(repoDid: string, repoRecordId: string): IndexedStar[] {
218
+ const result: IndexedStar[] = [];
219
+ for (const star of this._stars.values()) {
220
+ if (star.repoDid === repoDid && star.repoRecordId === repoRecordId) { result.push(star); }
221
+ }
222
+ return result;
223
+ }
224
+
225
+ /** Get all repos starred by a user. */
226
+ public getStarredByUser(did: string): IndexedStar[] {
227
+ const result: IndexedStar[] = [];
228
+ for (const star of this._stars.values()) {
229
+ if (star.starrerDid === did) { result.push(star); }
230
+ }
231
+ return result;
232
+ }
233
+
234
+ // -----------------------------------------------------------------------
235
+ // Follow operations
236
+ // -----------------------------------------------------------------------
237
+
238
+ /** Upsert an indexed follow. Evicts oldest entry if at capacity. */
239
+ public putFollow(follow: IndexedFollow): void {
240
+ const key = `${follow.followerDid}:${follow.targetDid}`;
241
+ if (!this._follows.has(key) && this._follows.size >= this._limits.maxFollows) {
242
+ const oldest = this._follows.keys().next().value;
243
+ if (oldest !== undefined) { this._follows.delete(oldest); }
244
+ }
245
+ this._follows.set(key, follow);
246
+ this.addDid(follow.followerDid);
247
+ this.addDid(follow.targetDid);
248
+ }
249
+
250
+ /** Remove a follow. */
251
+ public removeFollow(followerDid: string, targetDid: string): void {
252
+ this._follows.delete(`${followerDid}:${targetDid}`);
253
+ }
254
+
255
+ /** Get follower count for a user. */
256
+ public getFollowerCount(did: string): number {
257
+ let count = 0;
258
+ for (const f of this._follows.values()) {
259
+ if (f.targetDid === did) { count++; }
260
+ }
261
+ return count;
262
+ }
263
+
264
+ /** Get following count for a user. */
265
+ public getFollowingCount(did: string): number {
266
+ let count = 0;
267
+ for (const f of this._follows.values()) {
268
+ if (f.followerDid === did) { count++; }
269
+ }
270
+ return count;
271
+ }
272
+
273
+ // -----------------------------------------------------------------------
274
+ // Aggregation queries
275
+ // -----------------------------------------------------------------------
276
+
277
+ /** Get repos with star counts, sorted by star count descending. */
278
+ public getReposWithStars(): RepoWithStars[] {
279
+ return this.getAllRepos()
280
+ .map((r) => ({ ...r, starCount: this.getStarCount(r.did, r.recordId) }))
281
+ .sort((a, b) => b.starCount - a.starCount);
282
+ }
283
+
284
+ /**
285
+ * Trending repos — sorted by recent star activity.
286
+ *
287
+ * Trending is computed as the number of stars received within
288
+ * `windowMs` (default: 7 days), weighted by recency.
289
+ */
290
+ public getTrending(limit: number = 20, windowMs: number = 7 * 24 * 60 * 60 * 1000): RepoWithStars[] {
291
+ const now = Date.now();
292
+ const cutoff = new Date(now - windowMs).toISOString();
293
+
294
+ // Count recent stars per repo.
295
+ const recentStars = new Map<string, number>();
296
+ for (const star of this._stars.values()) {
297
+ if (star.dateCreated >= cutoff) {
298
+ const key = `${star.repoDid}:${star.repoRecordId}`;
299
+ recentStars.set(key, (recentStars.get(key) ?? 0) + 1);
300
+ }
301
+ }
302
+
303
+ return this.getReposWithStars()
304
+ .map((r) => {
305
+ const key = `${r.did}:${r.recordId}`;
306
+ const recent = recentStars.get(key) ?? 0;
307
+ return { ...r, _trending: recent };
308
+ })
309
+ .sort((a, b) => (b as any)._trending - (a as any)._trending || b.starCount - a.starCount)
310
+ .slice(0, limit)
311
+ .map(({ ...r }) => { delete (r as any)._trending; return r; });
312
+ }
313
+
314
+ /**
315
+ * Search repos by name, description, topics, or language.
316
+ *
317
+ * Returns results sorted by relevance score. Scoring:
318
+ * - Name exact match: 10
319
+ * - Name prefix match: 5
320
+ * - Name substring match: 3
321
+ * - Topic match: 4
322
+ * - Language match: 2
323
+ * - Description substring match: 1
324
+ * - Star count bonus: 0.1 per star (capped at 5)
325
+ */
326
+ public search(query: string, limit: number = 50): SearchResult[] {
327
+ const q = query.toLowerCase();
328
+ const results: SearchResult[] = [];
329
+
330
+ for (const r of this.getReposWithStars()) {
331
+ let score = 0;
332
+ const name = r.name.toLowerCase();
333
+ const desc = r.description.toLowerCase();
334
+
335
+ if (name === q) { score += 10; }
336
+ else if (name.startsWith(q)) { score += 5; }
337
+ else if (name.includes(q)) { score += 3; }
338
+
339
+ if (r.topics.some((t) => t.toLowerCase() === q)) { score += 4; }
340
+ if (r.language.toLowerCase() === q) { score += 2; }
341
+ if (desc.includes(q)) { score += 1; }
342
+
343
+ // Star bonus.
344
+ score += Math.min(r.starCount * 0.1, 5);
345
+
346
+ if (score > 0) {
347
+ results.push({ ...r, score });
348
+ }
349
+ }
350
+
351
+ return results
352
+ .sort((a, b) => b.score - a.score)
353
+ .slice(0, limit);
354
+ }
355
+
356
+ /** Get user profile summary. */
357
+ public getUserProfile(did: string): UserProfile {
358
+ const repos = this.getAllRepos().filter((r) => r.did === did);
359
+ let totalStars = 0;
360
+ for (const r of repos) {
361
+ totalStars += this.getStarCount(r.did, r.recordId);
362
+ }
363
+ return {
364
+ did,
365
+ repoCount : repos.length,
366
+ starCount : totalStars,
367
+ followerCount : this.getFollowerCount(did),
368
+ followingCount : this.getFollowingCount(did),
369
+ };
370
+ }
371
+
372
+ /**
373
+ * List repos by language, sorted by star count.
374
+ */
375
+ public getReposByLanguage(language: string): RepoWithStars[] {
376
+ const lang = language.toLowerCase();
377
+ return this.getReposWithStars()
378
+ .filter((r) => r.language.toLowerCase() === lang);
379
+ }
380
+
381
+ /**
382
+ * List repos by topic, sorted by star count.
383
+ */
384
+ public getReposByTopic(topic: string): RepoWithStars[] {
385
+ const t = topic.toLowerCase();
386
+ return this.getReposWithStars()
387
+ .filter((r) => r.topics.some((tp) => tp.toLowerCase() === t));
388
+ }
389
+
390
+ /** Get store statistics. */
391
+ public getStats(): { dids: number; repos: number; stars: number; follows: number } {
392
+ return {
393
+ dids : this._dids.size,
394
+ repos : this._repos.size,
395
+ stars : this._stars.size,
396
+ follows : this._follows.size,
397
+ };
398
+ }
399
+
400
+ /** Clear all data. */
401
+ public clear(): void {
402
+ this._repos.clear();
403
+ this._stars.clear();
404
+ this._follows.clear();
405
+ this._dids.clear();
406
+ this._cursors.clear();
407
+ }
408
+ }
package/src/issues.ts ADDED
@@ -0,0 +1,200 @@
1
+ /**
2
+ * Forge Issues Protocol — issue tracking with comments, labels, and status changes.
3
+ *
4
+ * Composes with the Forge Repo protocol via `uses` for role-based authorization.
5
+ * Only users with a contributor, triager, or maintainer role can create issues
6
+ * directly on the repo owner's DWN. External issue reports live on the reporter's
7
+ * own DWN and are surfaced via indexers.
8
+ *
9
+ * @module
10
+ */
11
+
12
+ import type { ProtocolDefinition } from '@enbox/dwn-sdk-js';
13
+
14
+ import { defineProtocol } from '@enbox/api';
15
+
16
+ // ---------------------------------------------------------------------------
17
+ // Data types
18
+ // ---------------------------------------------------------------------------
19
+
20
+ /** Data shape for an issue record. */
21
+ export type IssueData = {
22
+ title : string;
23
+ body : string;
24
+ number? : number;
25
+ };
26
+
27
+ /** Data shape for a comment on an issue. */
28
+ export type CommentData = {
29
+ body: string;
30
+ };
31
+
32
+ /** Data shape for a reaction on a comment. */
33
+ export type ReactionData = {
34
+ emoji: string;
35
+ };
36
+
37
+ /** Data shape for a label application on an issue. */
38
+ export type LabelData = {
39
+ name : string;
40
+ color : string;
41
+ };
42
+
43
+ /** Data shape for an issue status change event. */
44
+ export type StatusChangeData = {
45
+ reason?: string;
46
+ };
47
+
48
+ /** Data shape for an issue assignment. */
49
+ export type AssignmentData = {
50
+ assigneeDid : string;
51
+ alias? : string;
52
+ };
53
+
54
+ // ---------------------------------------------------------------------------
55
+ // Schema map
56
+ // ---------------------------------------------------------------------------
57
+
58
+ /** Maps protocol type names to their TypeScript data shapes. */
59
+ export type ForgeIssuesSchemaMap = {
60
+ issue : IssueData;
61
+ comment : CommentData;
62
+ reaction : ReactionData;
63
+ label : LabelData;
64
+ statusChange : StatusChangeData;
65
+ assignment : AssignmentData;
66
+ };
67
+
68
+ // ---------------------------------------------------------------------------
69
+ // Protocol definition
70
+ // ---------------------------------------------------------------------------
71
+
72
+ export const ForgeIssuesDefinition = {
73
+ protocol : 'https://enbox.org/protocols/forge/issues',
74
+ published : true,
75
+ uses : {
76
+ repo: 'https://enbox.org/protocols/forge/repo',
77
+ },
78
+ types: {
79
+ issue: {
80
+ schema : 'https://enbox.org/schemas/forge/issue',
81
+ dataFormats : ['application/json'],
82
+ },
83
+ comment: {
84
+ schema : 'https://enbox.org/schemas/forge/comment',
85
+ dataFormats : ['application/json'],
86
+ },
87
+ reaction: {
88
+ schema : 'https://enbox.org/schemas/forge/reaction',
89
+ dataFormats : ['application/json'],
90
+ },
91
+ label: {
92
+ schema : 'https://enbox.org/schemas/forge/label',
93
+ dataFormats : ['application/json'],
94
+ },
95
+ statusChange: {
96
+ schema : 'https://enbox.org/schemas/forge/status-change',
97
+ dataFormats : ['application/json'],
98
+ },
99
+ assignment: {
100
+ schema : 'https://enbox.org/schemas/forge/assignment',
101
+ dataFormats : ['application/json'],
102
+ },
103
+ },
104
+ structure: {
105
+ repo: {
106
+ $ref: 'repo:repo',
107
+
108
+ issue: {
109
+ $actions: [
110
+ { role: 'repo:repo/contributor', can: ['create', 'read'] },
111
+ { role: 'repo:repo/maintainer', can: ['create', 'read', 'update', 'delete'] },
112
+ { role: 'repo:repo/triager', can: ['create', 'read', 'co-update'] },
113
+ { who: 'author', of: 'repo/issue', can: ['create', 'update'] },
114
+ ],
115
+ $tags: {
116
+ $requiredTags : ['status'],
117
+ $allowUndefinedTags : false,
118
+ status : { type: 'string', enum: ['open', 'closed'] },
119
+ number : { type: 'string' },
120
+ priority : { type: 'string', enum: ['low', 'medium', 'high', 'critical'] },
121
+ milestone : { type: 'string' },
122
+ },
123
+
124
+ comment: {
125
+ $actions: [
126
+ { role: 'repo:repo/contributor', can: ['create', 'read'] },
127
+ { role: 'repo:repo/maintainer', can: ['create', 'read', 'delete'] },
128
+ { who: 'author', of: 'repo/issue/comment', can: ['create', 'update', 'delete'] },
129
+ ],
130
+
131
+ reaction: {
132
+ $actions: [
133
+ { role: 'repo:repo/contributor', can: ['create', 'read', 'delete'] },
134
+ { role: 'repo:repo/maintainer', can: ['create', 'read', 'delete'] },
135
+ ],
136
+ $tags: {
137
+ $requiredTags : ['emoji'],
138
+ $allowUndefinedTags : false,
139
+ emoji : { type: 'string', maxLength: 10 },
140
+ },
141
+ },
142
+ },
143
+
144
+ label: {
145
+ $immutable : true,
146
+ $actions : [
147
+ { role: 'repo:repo/contributor', can: ['read'] },
148
+ { role: 'repo:repo/maintainer', can: ['create', 'delete'] },
149
+ { role: 'repo:repo/triager', can: ['create', 'delete'] },
150
+ ],
151
+ $tags: {
152
+ $requiredTags : ['name', 'color'],
153
+ $allowUndefinedTags : false,
154
+ name : { type: 'string' },
155
+ color : { type: 'string' },
156
+ },
157
+ },
158
+
159
+ statusChange: {
160
+ $immutable : true,
161
+ $actions : [
162
+ { role: 'repo:repo/contributor', can: ['read'] },
163
+ { role: 'repo:repo/maintainer', can: ['create'] },
164
+ { role: 'repo:repo/triager', can: ['create'] },
165
+ { who: 'author', of: 'repo/issue', can: ['create'] },
166
+ ],
167
+ $tags: {
168
+ $requiredTags : ['from', 'to'],
169
+ $allowUndefinedTags : false,
170
+ from : { type: 'string', enum: ['open', 'closed'] },
171
+ to : { type: 'string', enum: ['open', 'closed'] },
172
+ },
173
+ },
174
+
175
+ assignment: {
176
+ $actions: [
177
+ { role: 'repo:repo/contributor', can: ['read'] },
178
+ { role: 'repo:repo/maintainer', can: ['create', 'delete'] },
179
+ { role: 'repo:repo/triager', can: ['create', 'delete'] },
180
+ ],
181
+ $tags: {
182
+ $requiredTags : ['assigneeDid'],
183
+ $allowUndefinedTags : false,
184
+ assigneeDid : { type: 'string' },
185
+ },
186
+ },
187
+ },
188
+ },
189
+ },
190
+ } as const satisfies ProtocolDefinition;
191
+
192
+ // ---------------------------------------------------------------------------
193
+ // Typed protocol export
194
+ // ---------------------------------------------------------------------------
195
+
196
+ /** Typed Forge Issues protocol for use with `dwn.using()`. */
197
+ export const ForgeIssuesProtocol = defineProtocol(
198
+ ForgeIssuesDefinition,
199
+ {} as ForgeIssuesSchemaMap,
200
+ );
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Forge Notifications Protocol — private notification inbox.
3
+ *
4
+ * Notifications are private (`published: false`). Only the DWN owner can
5
+ * read, update (mark as read), or delete. Notification senders (e.g., repo
6
+ * maintainers, CI bots) need a scoped permission grant to create.
7
+ *
8
+ * @module
9
+ */
10
+
11
+ import type { ProtocolDefinition } from '@enbox/dwn-sdk-js';
12
+
13
+ import { defineProtocol } from '@enbox/api';
14
+
15
+ // ---------------------------------------------------------------------------
16
+ // Data types
17
+ // ---------------------------------------------------------------------------
18
+
19
+ /** Data shape for a notification record. */
20
+ export type NotificationData = {
21
+ type : string;
22
+ title : string;
23
+ body? : string;
24
+ repoDid? : string;
25
+ repoRecordId? : string;
26
+ sourceRecordId?: string;
27
+ url? : string;
28
+ };
29
+
30
+ // ---------------------------------------------------------------------------
31
+ // Schema map
32
+ // ---------------------------------------------------------------------------
33
+
34
+ /** Maps protocol type names to their TypeScript data shapes. */
35
+ export type ForgeNotificationsSchemaMap = {
36
+ notification: NotificationData;
37
+ };
38
+
39
+ // ---------------------------------------------------------------------------
40
+ // Protocol definition
41
+ // ---------------------------------------------------------------------------
42
+
43
+ export const ForgeNotificationsDefinition = {
44
+ protocol : 'https://enbox.org/protocols/forge/notifications',
45
+ published : false,
46
+ types : {
47
+ notification: {
48
+ schema : 'https://enbox.org/schemas/forge/notification',
49
+ dataFormats : ['application/json'],
50
+ },
51
+ },
52
+ structure: {
53
+ notification: {
54
+ // Owner-only read/update/delete.
55
+ // Senders need a permission grant to create.
56
+ $tags: {
57
+ $requiredTags : ['type', 'read'],
58
+ $allowUndefinedTags : true,
59
+ type : {
60
+ type : 'string',
61
+ enum : ['mention', 'review_request', 'assignment', 'ci_failure', 'patch_merged', 'issue_comment', 'review'],
62
+ },
63
+ read : { type: 'boolean' },
64
+ repoDid : { type: 'string' },
65
+ repoRecordId : { type: 'string' },
66
+ sourceRecordId : { type: 'string' },
67
+ },
68
+ },
69
+ },
70
+ } as const satisfies ProtocolDefinition;
71
+
72
+ // ---------------------------------------------------------------------------
73
+ // Typed protocol export
74
+ // ---------------------------------------------------------------------------
75
+
76
+ /** Typed Forge Notifications protocol for use with `dwn.using()`. */
77
+ export const ForgeNotificationsProtocol = defineProtocol(
78
+ ForgeNotificationsDefinition,
79
+ {} as ForgeNotificationsSchemaMap,
80
+ );