@idleware/ringi 0.4.0 → 0.6.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 (375) hide show
  1. package/README.md +1 -1
  2. package/package.json +5 -1
  3. package/target/dts/adapters/fs/index.d.ts +2 -0
  4. package/target/dts/adapters/fs/lock.d.ts +1 -0
  5. package/target/dts/adapters/fs/write.d.ts +5 -0
  6. package/target/dts/adapters/host-posix/group-state.d.ts +7 -0
  7. package/target/dts/adapters/host-posix/groups.d.ts +1 -0
  8. package/target/dts/adapters/host-posix/index.d.ts +2 -0
  9. package/target/dts/adapters/host-posix/launch.d.ts +7 -0
  10. package/target/dts/adapters/host-posix/probes.d.ts +5 -0
  11. package/target/dts/adapters/host-posix/stats.d.ts +9 -0
  12. package/target/dts/adapters/keys-file/index.d.ts +2 -0
  13. package/target/dts/adapters/state-fs/index.d.ts +5 -0
  14. package/target/dts/adapters/tool-claude/index.d.ts +2 -0
  15. package/target/dts/adapters/tool-codex/index.d.ts +2 -0
  16. package/target/dts/adapters/tool-cursor/index.d.ts +2 -0
  17. package/target/dts/adapters/tool-traces/index.d.ts +3 -0
  18. package/target/dts/adapters/transport-git/branches.d.ts +43 -0
  19. package/target/dts/adapters/transport-git/files.d.ts +2 -0
  20. package/target/dts/adapters/transport-git/index.d.ts +32 -0
  21. package/target/dts/adapters/transport-git/marks.d.ts +20 -0
  22. package/target/dts/adapters/transport-git/remote/admit.d.ts +7 -0
  23. package/target/dts/adapters/transport-git/remote/alarms.d.ts +3 -0
  24. package/target/dts/adapters/transport-git/remote/bootstrap.d.ts +7 -0
  25. package/target/dts/adapters/transport-git/remote/branch-commit.d.ts +3 -0
  26. package/target/dts/adapters/transport-git/remote/branch-control.d.ts +15 -0
  27. package/target/dts/adapters/transport-git/remote/branch-scan.d.ts +2 -0
  28. package/target/dts/adapters/transport-git/remote/branch.d.ts +5 -0
  29. package/target/dts/adapters/transport-git/remote/cache.d.ts +3 -0
  30. package/target/dts/adapters/transport-git/remote/commits.d.ts +2 -0
  31. package/target/dts/adapters/transport-git/remote/forget.d.ts +2 -0
  32. package/target/dts/adapters/transport-git/remote/git.d.ts +26 -0
  33. package/target/dts/adapters/transport-git/remote/heartbeat-facts.d.ts +1 -0
  34. package/target/dts/adapters/transport-git/remote/heartbeat-name.d.ts +6 -0
  35. package/target/dts/adapters/transport-git/remote/heartbeat-object.d.ts +10 -0
  36. package/target/dts/adapters/transport-git/remote/heartbeat-push.d.ts +2 -0
  37. package/target/dts/adapters/transport-git/remote/heartbeat.d.ts +7 -0
  38. package/target/dts/adapters/transport-git/remote/keys.d.ts +13 -0
  39. package/target/dts/adapters/transport-git/remote/main.d.ts +11 -0
  40. package/target/dts/adapters/transport-git/remote/process.d.ts +20 -0
  41. package/target/dts/adapters/transport-git/remote/push-retry.d.ts +2 -0
  42. package/target/dts/adapters/transport-git/remote/push-validate.d.ts +2 -0
  43. package/target/dts/adapters/transport-git/remote/push.d.ts +16 -0
  44. package/target/dts/adapters/transport-git/remote/roster.d.ts +7 -0
  45. package/target/dts/adapters/transport-git/remote/signals.d.ts +15 -0
  46. package/target/dts/adapters/transport-git/remote/signature.d.ts +5 -0
  47. package/target/dts/adapters/transport-git/remote/sync-heartbeat.d.ts +2 -0
  48. package/target/dts/adapters/transport-git/remote/sync-rooms.d.ts +6 -0
  49. package/target/dts/adapters/transport-git/remote/sync-tags.d.ts +8 -0
  50. package/target/dts/adapters/transport-git/remote/sync.d.ts +2 -0
  51. package/target/dts/adapters/transport-git/remote/types.d.ts +64 -0
  52. package/target/dts/adapters/transport-git/remote.d.ts +17 -0
  53. package/target/dts/adapters/transport-git/repo.d.ts +31 -0
  54. package/target/dts/adapters/transport-git/run.d.ts +21 -0
  55. package/target/dts/adapters/transport-git/signing.d.ts +4 -0
  56. package/target/dts/adapters/transport-git/tags.d.ts +15 -0
  57. package/target/dts/adapters/transport-git/transport.d.ts +7 -0
  58. package/target/dts/adapters/transport-kafka/index.d.ts +2 -0
  59. package/target/dts/adapters/transport-temporal/index.d.ts +2 -0
  60. package/target/dts/cli.d.ts +2 -1
  61. package/target/dts/{cli/agent.d.ts → clients/cli/agent/index.d.ts} +3 -3
  62. package/target/dts/{cli → clients/cli/agent}/session.d.ts +2 -2
  63. package/target/dts/clients/cli/arg-parse.d.ts +2 -0
  64. package/target/dts/{cli → clients/cli}/args.d.ts +2 -2
  65. package/target/dts/clients/cli/commands.d.ts +2 -0
  66. package/target/dts/clients/cli/context.d.ts +4 -0
  67. package/target/dts/{cli/index.d.ts → clients/cli/help.d.ts} +1 -3
  68. package/target/dts/clients/cli/index.d.ts +4 -0
  69. package/target/dts/clients/cli/operator/heartbeat-format.d.ts +5 -0
  70. package/target/dts/clients/cli/operator/heartbeat.d.ts +3 -0
  71. package/target/dts/clients/cli/operator/hub-commands.d.ts +6 -0
  72. package/target/dts/clients/cli/operator/hub.d.ts +2 -0
  73. package/target/dts/clients/cli/operator/index.d.ts +5 -0
  74. package/target/dts/clients/cli/operator/room-lifecycle.d.ts +5 -0
  75. package/target/dts/clients/cli/operator/room-list.d.ts +5 -0
  76. package/target/dts/clients/cli/operator/room-members.d.ts +4 -0
  77. package/target/dts/clients/cli/operator/room.d.ts +2 -0
  78. package/target/dts/clients/cli/operator/sessions.d.ts +5 -0
  79. package/target/dts/clients/cli/operator/watch.d.ts +2 -0
  80. package/target/dts/clients/cli/operator/where-format.d.ts +7 -0
  81. package/target/dts/clients/cli/operator/where.d.ts +2 -0
  82. package/target/dts/clients/cli/shared/budget.d.ts +7 -0
  83. package/target/dts/clients/cli/shared/files.d.ts +4 -0
  84. package/target/dts/clients/cli/shared/index.d.ts +7 -0
  85. package/target/dts/clients/cli/shared/messages.d.ts +7 -0
  86. package/target/dts/clients/cli/shared/profile.d.ts +4 -0
  87. package/target/dts/clients/cli/shared/session.d.ts +6 -0
  88. package/target/dts/clients/cli/shared/signals.d.ts +3 -0
  89. package/target/dts/clients/cli/shared/work.d.ts +6 -0
  90. package/target/dts/clients/cli/skill/index.d.ts +3 -0
  91. package/target/dts/{cli/skill.d.ts → clients/cli/skill/targets.d.ts} +1 -2
  92. package/target/dts/composition/index.d.ts +2 -0
  93. package/target/dts/core/agents/heartbeat/index.d.ts +33 -0
  94. package/target/dts/core/agents/heartbeat/pulse.d.ts +32 -0
  95. package/target/dts/core/agents/heartbeat/singleton.d.ts +3 -0
  96. package/target/dts/core/agents/heartbeat/tools.d.ts +6 -0
  97. package/target/dts/{app → core/agents}/overview.d.ts +12 -6
  98. package/target/dts/core/agents/ports/host.d.ts +47 -0
  99. package/target/dts/core/agents/ports/index.d.ts +9 -0
  100. package/target/dts/core/agents/ports/tools.d.ts +18 -0
  101. package/target/dts/core/agents/sessions/agent.d.ts +70 -0
  102. package/target/dts/core/agents/sessions/binding.d.ts +9 -0
  103. package/target/dts/core/agents/sessions/context.d.ts +8 -0
  104. package/target/dts/{runtime/session.d.ts → core/agents/sessions/index.d.ts} +2 -9
  105. package/target/dts/core/agents/sessions/join.d.ts +20 -0
  106. package/target/dts/core/agents/sessions/resume.d.ts +2 -0
  107. package/target/dts/core/agents/sessions/session.d.ts +46 -0
  108. package/target/dts/core/agents/sessions/wait.d.ts +38 -0
  109. package/target/dts/core/agents/turns/budgets.d.ts +5 -0
  110. package/target/dts/core/agents/turns/dispatch.d.ts +9 -0
  111. package/target/dts/core/agents/turns/exhaustion.d.ts +11 -0
  112. package/target/dts/core/agents/turns/grants.d.ts +4 -0
  113. package/target/dts/core/agents/turns/index.d.ts +4 -0
  114. package/target/dts/core/agents/turns/limits.d.ts +2 -0
  115. package/target/dts/core/agents/turns/messages.d.ts +10 -0
  116. package/target/dts/core/agents/turns/pings.d.ts +5 -0
  117. package/target/dts/core/agents/turns/plan.d.ts +3 -0
  118. package/target/dts/core/agents/turns/poll.d.ts +8 -0
  119. package/target/dts/core/agents/turns/results.d.ts +3 -0
  120. package/target/dts/core/agents/turns/seat.d.ts +2 -0
  121. package/target/dts/core/agents/turns/types.d.ts +59 -0
  122. package/target/dts/core/hub/decisions/budget.d.ts +15 -0
  123. package/target/dts/core/hub/decisions/check.d.ts +6 -0
  124. package/target/dts/core/hub/decisions/index.d.ts +5 -0
  125. package/target/dts/core/hub/decisions/proposal.d.ts +38 -0
  126. package/target/dts/core/hub/decisions/usage.d.ts +12 -0
  127. package/target/dts/{runtime/reader.d.ts → core/hub/history/index.d.ts} +12 -6
  128. package/target/dts/core/hub/ports/index.d.ts +16 -0
  129. package/target/dts/core/hub/ports/state.d.ts +12 -0
  130. package/target/dts/{store/index.d.ts → core/hub/ports/store.d.ts} +58 -17
  131. package/target/dts/core/hub/protocol/index.d.ts +5 -0
  132. package/target/dts/{protocol/index.d.ts → core/hub/protocol/model.d.ts} +0 -25
  133. package/target/dts/core/hub/protocol/order.d.ts +2 -0
  134. package/target/dts/core/hub/protocol/reading.d.ts +8 -0
  135. package/target/dts/core/hub/protocol/text.d.ts +11 -0
  136. package/target/dts/core/hub/protocol/threads.d.ts +5 -0
  137. package/target/dts/core/hub/rooms/compat.d.ts +5 -0
  138. package/target/dts/core/hub/rooms/hubs.d.ts +14 -0
  139. package/target/dts/core/hub/rooms/index.d.ts +53 -0
  140. package/target/dts/core/hub/rooms/messages.d.ts +8 -0
  141. package/target/dts/core/hub/rooms/rooms.d.ts +10 -0
  142. package/target/dts/core/hub/signals/check.d.ts +3 -0
  143. package/target/dts/core/hub/signals/effective.d.ts +3 -0
  144. package/target/dts/core/hub/signals/index.d.ts +5 -0
  145. package/target/dts/core/hub/signals/marks.d.ts +4 -0
  146. package/target/dts/core/hub/signals/model.d.ts +28 -0
  147. package/target/dts/core/hub/signals/pins.d.ts +5 -0
  148. package/target/dts/{hub/signals.d.ts → core/hub/signals/write.d.ts} +1 -1
  149. package/target/dts/core/hub/usecases/actor.d.ts +6 -0
  150. package/target/dts/{app → core/hub/usecases}/budget.d.ts +5 -18
  151. package/target/dts/core/hub/usecases/config.d.ts +6 -0
  152. package/target/dts/{app → core/hub/usecases}/context.d.ts +3 -8
  153. package/target/dts/{app → core/hub/usecases}/hubs.d.ts +1 -1
  154. package/target/dts/core/hub/usecases/propose.d.ts +17 -0
  155. package/target/dts/{app → core/hub/usecases}/room.d.ts +8 -33
  156. package/target/dts/{app → core/hub/usecases}/rooms.d.ts +2 -6
  157. package/target/dts/core/hub/usecases/roster.d.ts +5 -0
  158. package/target/dts/core/hub/usecases/send.d.ts +21 -0
  159. package/target/dts/core/hub/usecases/staging.d.ts +8 -0
  160. package/target/dts/{app → core/hub/usecases}/view.d.ts +4 -4
  161. package/target/dts/{domain/profiles.d.ts → core/hub/work/index.d.ts} +3 -7
  162. package/target/dts/core/hub/work/parse.d.ts +2 -0
  163. package/target/dts/core/hub/work/task.d.ts +6 -0
  164. package/target/dts/core/signing/index.d.ts +35 -0
  165. package/target/dts/index.d.ts +8 -8
  166. package/target/dts/lib/fail.d.ts +8 -0
  167. package/target/dts/lib/index.d.ts +3 -11
  168. package/target/dts/lib/json.d.ts +1 -0
  169. package/target/esm/adapters/fs/index.js +5 -0
  170. package/target/esm/adapters/fs/lock.js +83 -0
  171. package/target/esm/adapters/fs/write.js +25 -0
  172. package/target/esm/adapters/host-posix/group-state.js +24 -0
  173. package/target/esm/adapters/host-posix/groups.js +43 -0
  174. package/target/esm/adapters/host-posix/index.js +35 -0
  175. package/target/esm/adapters/host-posix/launch.js +80 -0
  176. package/target/esm/adapters/host-posix/probes.js +66 -0
  177. package/target/esm/adapters/host-posix/stats.js +27 -0
  178. package/target/esm/adapters/keys-file/index.js +68 -0
  179. package/target/esm/adapters/state-fs/index.js +79 -0
  180. package/target/esm/adapters/tool-claude/index.js +32 -0
  181. package/target/esm/adapters/tool-codex/index.js +38 -0
  182. package/target/esm/adapters/tool-cursor/index.js +8 -0
  183. package/target/esm/adapters/tool-traces/index.js +18 -0
  184. package/target/esm/adapters/transport-git/branches.js +155 -0
  185. package/target/esm/adapters/transport-git/files.js +48 -0
  186. package/target/esm/adapters/transport-git/index.js +128 -0
  187. package/target/esm/adapters/transport-git/marks.js +88 -0
  188. package/target/esm/adapters/transport-git/remote/admit.js +71 -0
  189. package/target/esm/adapters/transport-git/remote/alarms.js +30 -0
  190. package/target/esm/adapters/transport-git/remote/bootstrap.js +47 -0
  191. package/target/esm/adapters/transport-git/remote/branch-commit.js +36 -0
  192. package/target/esm/adapters/transport-git/remote/branch-control.js +37 -0
  193. package/target/esm/adapters/transport-git/remote/branch-scan.js +28 -0
  194. package/target/esm/adapters/transport-git/remote/branch.js +37 -0
  195. package/target/esm/adapters/transport-git/remote/cache.js +23 -0
  196. package/target/esm/adapters/transport-git/remote/commits.js +25 -0
  197. package/target/esm/adapters/transport-git/remote/forget.js +35 -0
  198. package/target/esm/adapters/transport-git/remote/git.js +58 -0
  199. package/target/esm/adapters/transport-git/remote/heartbeat-facts.js +35 -0
  200. package/target/esm/adapters/transport-git/remote/heartbeat-name.js +19 -0
  201. package/target/esm/adapters/transport-git/remote/heartbeat-object.js +40 -0
  202. package/target/esm/adapters/transport-git/remote/heartbeat-push.js +44 -0
  203. package/target/esm/adapters/transport-git/remote/heartbeat.js +44 -0
  204. package/target/esm/adapters/transport-git/remote/keys.js +75 -0
  205. package/target/esm/adapters/transport-git/remote/main.js +41 -0
  206. package/target/esm/adapters/transport-git/remote/process.js +37 -0
  207. package/target/esm/adapters/transport-git/remote/push-retry.js +46 -0
  208. package/target/esm/adapters/transport-git/remote/push-validate.js +39 -0
  209. package/target/esm/adapters/transport-git/remote/push.js +62 -0
  210. package/target/esm/adapters/transport-git/remote/roster.js +48 -0
  211. package/target/esm/adapters/transport-git/remote/signals.js +63 -0
  212. package/target/esm/adapters/transport-git/remote/signature.js +56 -0
  213. package/target/esm/adapters/transport-git/remote/sync-heartbeat.js +26 -0
  214. package/target/esm/adapters/transport-git/remote/sync-rooms.js +38 -0
  215. package/target/esm/adapters/transport-git/remote/sync-tags.js +48 -0
  216. package/target/esm/adapters/transport-git/remote/sync.js +38 -0
  217. package/target/esm/adapters/transport-git/remote/types.js +10 -0
  218. package/target/esm/adapters/transport-git/remote.js +17 -0
  219. package/target/esm/adapters/transport-git/repo.js +115 -0
  220. package/target/esm/adapters/transport-git/run.js +57 -0
  221. package/target/esm/adapters/transport-git/signing.js +44 -0
  222. package/target/esm/adapters/transport-git/tags.js +21 -0
  223. package/target/esm/adapters/transport-git/transport.js +29 -0
  224. package/target/esm/adapters/transport-kafka/index.js +4 -0
  225. package/target/esm/adapters/transport-temporal/index.js +4 -0
  226. package/target/esm/cli.js +5 -4
  227. package/target/esm/{cli/agent.js → clients/cli/agent/index.js} +8 -7
  228. package/target/esm/{cli → clients/cli/agent}/session.js +13 -7
  229. package/target/esm/clients/cli/arg-parse.js +41 -0
  230. package/target/esm/{cli → clients/cli}/args.js +3 -36
  231. package/target/esm/clients/cli/commands.js +45 -0
  232. package/target/esm/clients/cli/context.js +6 -0
  233. package/target/esm/{cli/index.js → clients/cli/help.js} +6 -73
  234. package/target/esm/clients/cli/index.js +27 -0
  235. package/target/esm/clients/cli/operator/heartbeat-format.js +8 -0
  236. package/target/esm/clients/cli/operator/heartbeat.js +35 -0
  237. package/target/esm/clients/cli/operator/hub-commands.js +37 -0
  238. package/target/esm/clients/cli/operator/hub.js +10 -0
  239. package/target/esm/clients/cli/operator/index.js +8 -0
  240. package/target/esm/clients/cli/operator/room-lifecycle.js +23 -0
  241. package/target/esm/clients/cli/operator/room-list.js +27 -0
  242. package/target/esm/clients/cli/operator/room-members.js +15 -0
  243. package/target/esm/clients/cli/operator/room.js +15 -0
  244. package/target/esm/clients/cli/operator/sessions.js +32 -0
  245. package/target/esm/clients/cli/operator/watch.js +15 -0
  246. package/target/esm/clients/cli/operator/where-format.js +24 -0
  247. package/target/esm/clients/cli/operator/where.js +32 -0
  248. package/target/esm/clients/cli/shared/budget.js +50 -0
  249. package/target/esm/clients/cli/shared/files.js +26 -0
  250. package/target/esm/clients/cli/shared/index.js +10 -0
  251. package/target/esm/clients/cli/shared/messages.js +41 -0
  252. package/target/esm/clients/cli/shared/profile.js +17 -0
  253. package/target/esm/clients/cli/shared/session.js +8 -0
  254. package/target/esm/clients/cli/shared/signals.js +21 -0
  255. package/target/esm/clients/cli/shared/work.js +26 -0
  256. package/target/esm/clients/cli/skill/index.js +40 -0
  257. package/target/esm/clients/cli/skill/targets.js +20 -0
  258. package/target/esm/composition/index.js +34 -0
  259. package/target/esm/core/agents/heartbeat/index.js +43 -0
  260. package/target/esm/core/agents/heartbeat/pulse.js +86 -0
  261. package/target/esm/core/agents/heartbeat/singleton.js +38 -0
  262. package/target/esm/core/agents/heartbeat/tools.js +24 -0
  263. package/target/esm/{app → core/agents}/overview.js +15 -9
  264. package/target/esm/core/agents/ports/host.js +4 -0
  265. package/target/esm/core/agents/ports/index.js +7 -0
  266. package/target/esm/core/agents/ports/tools.js +5 -0
  267. package/target/esm/{app → core/agents/sessions}/agent.js +11 -43
  268. package/target/esm/core/agents/sessions/binding.js +43 -0
  269. package/target/esm/core/agents/sessions/context.js +11 -0
  270. package/target/esm/core/agents/sessions/index.js +59 -0
  271. package/target/esm/core/agents/sessions/join.js +55 -0
  272. package/target/esm/core/agents/sessions/resume.js +54 -0
  273. package/target/esm/core/agents/sessions/session.js +28 -0
  274. package/target/esm/core/agents/sessions/wait.js +47 -0
  275. package/target/esm/core/agents/turns/budgets.js +48 -0
  276. package/target/esm/core/agents/turns/dispatch.js +40 -0
  277. package/target/esm/core/agents/turns/exhaustion.js +16 -0
  278. package/target/esm/core/agents/turns/grants.js +36 -0
  279. package/target/esm/core/agents/turns/index.js +33 -0
  280. package/target/esm/core/agents/turns/limits.js +11 -0
  281. package/target/esm/core/agents/turns/messages.js +32 -0
  282. package/target/esm/core/agents/turns/pings.js +30 -0
  283. package/target/esm/core/agents/turns/plan.js +29 -0
  284. package/target/esm/core/agents/turns/poll.js +48 -0
  285. package/target/esm/core/agents/turns/results.js +40 -0
  286. package/target/esm/core/agents/turns/seat.js +44 -0
  287. package/target/esm/core/agents/turns/types.js +3 -0
  288. package/target/esm/{domain/index.js → core/hub/capabilities.js} +3 -3
  289. package/target/esm/core/hub/decisions/budget.js +40 -0
  290. package/target/esm/core/hub/decisions/check.js +43 -0
  291. package/target/esm/core/hub/decisions/index.js +10 -0
  292. package/target/esm/core/hub/decisions/proposal.js +73 -0
  293. package/target/esm/core/hub/decisions/usage.js +39 -0
  294. package/target/esm/core/hub/history/index.js +90 -0
  295. package/target/esm/core/hub/ports/index.js +10 -0
  296. package/target/esm/core/hub/ports/state.js +5 -0
  297. package/target/esm/core/hub/ports/store.js +10 -0
  298. package/target/esm/{protocol → core/hub/protocol}/files.js +4 -2
  299. package/target/esm/core/hub/protocol/index.js +9 -0
  300. package/target/esm/core/hub/protocol/model.js +15 -0
  301. package/target/esm/core/hub/protocol/order.js +39 -0
  302. package/target/esm/core/hub/protocol/reading.js +29 -0
  303. package/target/esm/core/hub/protocol/text.js +95 -0
  304. package/target/esm/core/hub/protocol/threads.js +52 -0
  305. package/target/esm/core/hub/rooms/compat.js +42 -0
  306. package/target/esm/core/hub/rooms/hubs.js +92 -0
  307. package/target/esm/core/hub/rooms/index.js +23 -0
  308. package/target/esm/core/hub/rooms/messages.js +47 -0
  309. package/target/esm/core/hub/rooms/rooms.js +84 -0
  310. package/target/esm/core/hub/signals/check.js +33 -0
  311. package/target/esm/core/hub/signals/effective.js +31 -0
  312. package/target/esm/core/hub/signals/index.js +23 -0
  313. package/target/esm/core/hub/signals/marks.js +30 -0
  314. package/target/esm/core/hub/signals/model.js +5 -0
  315. package/target/esm/core/hub/signals/pins.js +21 -0
  316. package/target/esm/{hub/signals.js → core/hub/signals/write.js} +4 -4
  317. package/target/esm/core/hub/usecases/actor.js +3 -0
  318. package/target/esm/core/hub/usecases/budget.js +78 -0
  319. package/target/esm/core/hub/usecases/config.js +5 -0
  320. package/target/esm/core/hub/usecases/context.js +13 -0
  321. package/target/esm/core/hub/usecases/hubs.js +95 -0
  322. package/target/esm/core/hub/usecases/propose.js +39 -0
  323. package/target/esm/core/hub/usecases/room.js +82 -0
  324. package/target/esm/{app → core/hub/usecases}/rooms.js +11 -63
  325. package/target/esm/core/hub/usecases/roster.js +47 -0
  326. package/target/esm/core/hub/usecases/send.js +78 -0
  327. package/target/esm/core/hub/usecases/staging.js +60 -0
  328. package/target/esm/{app → core/hub/usecases}/view.js +33 -33
  329. package/target/esm/core/hub/work/index.js +13 -0
  330. package/target/esm/core/hub/work/parse.js +37 -0
  331. package/target/esm/core/hub/work/task.js +68 -0
  332. package/target/esm/core/signing/index.js +4 -0
  333. package/target/esm/index.js +7 -6
  334. package/target/esm/lib/fail.js +18 -0
  335. package/target/esm/lib/index.js +20 -195
  336. package/target/esm/lib/json.js +81 -0
  337. package/target/dts/app/agent.d.ts +0 -109
  338. package/target/dts/app/session.d.ts +0 -65
  339. package/target/dts/cli/context.d.ts +0 -6
  340. package/target/dts/cli/operator.d.ts +0 -8
  341. package/target/dts/cli/shared.d.ts +0 -27
  342. package/target/dts/domain/decisions.d.ts +0 -65
  343. package/target/dts/domain/signals.d.ts +0 -37
  344. package/target/dts/home/index.d.ts +0 -21
  345. package/target/dts/hub/index.d.ts +0 -72
  346. package/target/dts/runtime/watch.d.ts +0 -17
  347. package/target/dts/store/git/index.d.ts +0 -79
  348. package/target/dts/store/git/remote.d.ts +0 -86
  349. package/target/dts/store/kafka/index.d.ts +0 -2
  350. package/target/dts/store/temporal/index.d.ts +0 -2
  351. package/target/esm/app/budget.js +0 -95
  352. package/target/esm/app/context.js +0 -16
  353. package/target/esm/app/hubs.js +0 -76
  354. package/target/esm/app/room.js +0 -163
  355. package/target/esm/app/session.js +0 -99
  356. package/target/esm/cli/context.js +0 -8
  357. package/target/esm/cli/operator.js +0 -157
  358. package/target/esm/cli/shared.js +0 -159
  359. package/target/esm/cli/skill.js +0 -54
  360. package/target/esm/domain/decisions.js +0 -178
  361. package/target/esm/domain/profiles.js +0 -96
  362. package/target/esm/domain/signals.js +0 -134
  363. package/target/esm/home/index.js +0 -88
  364. package/target/esm/hub/index.js +0 -224
  365. package/target/esm/protocol/index.js +0 -219
  366. package/target/esm/runtime/reader.js +0 -65
  367. package/target/esm/runtime/session.js +0 -116
  368. package/target/esm/runtime/watch.js +0 -321
  369. package/target/esm/store/git/index.js +0 -644
  370. package/target/esm/store/git/remote.js +0 -758
  371. package/target/esm/store/index.js +0 -15
  372. package/target/esm/store/kafka/index.js +0 -3
  373. package/target/esm/store/temporal/index.js +0 -3
  374. /package/target/dts/{domain/index.d.ts → core/hub/capabilities.d.ts} +0 -0
  375. /package/target/dts/{protocol → core/hub/protocol}/files.d.ts +0 -0
@@ -0,0 +1,38 @@
1
+ import type { InboxOptions } from './agent.ts';
2
+ import type { Actor } from '../../hub/usecases/room.ts';
3
+ export declare const wait: (a: Actor, { max, ...options }?: InboxOptions & {
4
+ max?: number;
5
+ }) => Promise<{
6
+ inbox: {
7
+ rest: number;
8
+ cursors: Record<string, string>;
9
+ all: import("../../hub/protocol/model.ts").All;
10
+ msgs: {
11
+ id: string;
12
+ from: string;
13
+ trust: 'asserted' | 'verified';
14
+ time: number;
15
+ seq: number;
16
+ invalid: string | null;
17
+ subject: string;
18
+ body: string;
19
+ to: string[];
20
+ re: string | null;
21
+ kind: string | null;
22
+ state: string | null;
23
+ assign: string[] | null;
24
+ roles: Record<string, string> | null;
25
+ hop: number;
26
+ bad: string | null;
27
+ trailers: import("../../hub/protocol/model.ts").Trailers;
28
+ refused: import("../../hub/protocol/model.ts").Refused[];
29
+ reId: string | null;
30
+ hopEff: number;
31
+ files: import("../../hub/protocol/model.ts").FileRef[];
32
+ }[];
33
+ };
34
+ seconds: number;
35
+ } | {
36
+ inbox: null;
37
+ seconds: number;
38
+ }>;
@@ -0,0 +1,5 @@
1
+ import type { Room } from '../../hub/rooms/index.ts';
2
+ import type { All } from '../../hub/protocol/index.ts';
3
+ import type { ReaderState } from '../../hub/history/index.ts';
4
+ import type { Group, Planning, WatchContext } from './types.ts';
5
+ export declare const reserveGroups: (c: WatchContext, R: Room, all: All, groups: Map<string | null, Group>, st: ReaderState) => Planning;
@@ -0,0 +1,9 @@
1
+ import type { Room } from '../../hub/rooms/index.ts';
2
+ import type { Ended } from '../ports/host.ts';
3
+ import type { Run, WatchContext } from './types.ts';
4
+ type Dispatch = {
5
+ why?: string;
6
+ done?: Promise<Ended>;
7
+ };
8
+ export declare const dispatch: (c: WatchContext, R: Room, run: Run) => Dispatch;
9
+ export {};
@@ -0,0 +1,11 @@
1
+ import type { Room } from '../../hub/rooms/index.ts';
2
+ import type { All } from '../../hub/protocol/index.ts';
3
+ import type { Group, Planning, Reserve, WatchContext } from './types.ts';
4
+ export declare const reportExhausted: ({ c, R, all, grp, r, p }: {
5
+ c: WatchContext;
6
+ R: Room;
7
+ all: All;
8
+ grp: Group;
9
+ r: Reserve;
10
+ p: Planning;
11
+ }) => void;
@@ -0,0 +1,4 @@
1
+ import type { Room } from '../../hub/rooms/index.ts';
2
+ import type { All } from '../../hub/protocol/index.ts';
3
+ import type { Group, Reserve, WatchContext } from './types.ts';
4
+ export declare const reserveGrant: (c: WatchContext, R: Room, all: All, grp: Group) => Reserve;
@@ -0,0 +1,4 @@
1
+ import type { WatchOptions } from './types.ts';
2
+ export type { Room } from '../../hub/rooms/index.ts';
3
+ export type { WatchOptions } from './types.ts';
4
+ export declare const watch: (w: WatchOptions, log?: (line: string) => void) => Promise<number>;
@@ -0,0 +1,2 @@
1
+ import type { WatchOptions } from './types.ts';
2
+ export declare const validateWatch: (w: WatchOptions) => void;
@@ -0,0 +1,10 @@
1
+ import type { Room } from '../../hub/rooms/index.ts';
2
+ import type { All, Logs, Message } from '../../hub/protocol/index.ts';
3
+ import type { ReaderState } from '../../hub/history/index.ts';
4
+ import type { Group, WatchContext } from './types.ts';
5
+ export declare const collectMessages: (c: WatchContext, R: Room, logs: Logs, st: ReaderState, all: All) => {
6
+ retry: Message[];
7
+ cursors: Record<string, string>;
8
+ go: Message[];
9
+ };
10
+ export declare const groupMessages: (R: Room, all: All, go: Message[]) => Map<string | null, Group>;
@@ -0,0 +1,5 @@
1
+ import type { Room } from '../../hub/rooms/index.ts';
2
+ import type { Logs } from '../../hub/protocol/index.ts';
3
+ import type { ReaderState } from '../../hub/history/index.ts';
4
+ import type { WatchContext } from './types.ts';
5
+ export declare const answerWatchPings: (c: WatchContext, R: Room, logs: Logs, st: ReaderState) => Record<string, string>;
@@ -0,0 +1,3 @@
1
+ import type { Room } from '../../hub/rooms/index.ts';
2
+ import type { Plan, WatchContext } from './types.ts';
3
+ export declare const planTurns: (c: WatchContext, R: Room) => Plan;
@@ -0,0 +1,8 @@
1
+ import type { Room } from '../../hub/rooms/index.ts';
2
+ import type { WatchContext } from './types.ts';
3
+ type Poll = {
4
+ done: boolean;
5
+ R?: Room;
6
+ };
7
+ export declare const pollWatcher: (c: WatchContext) => Poll;
8
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { Room } from '../../hub/rooms/index.ts';
2
+ import type { Run, WatchContext } from './types.ts';
3
+ export declare const runTurns: (c: WatchContext, R: Room, runs: Run[]) => Promise<number>;
@@ -0,0 +1,2 @@
1
+ import type { WatchContext, WatchOptions } from './types.ts';
2
+ export declare const createWatcher: (w: WatchOptions, log: (line: string) => void) => WatchContext;
@@ -0,0 +1,59 @@
1
+ import type * as D from '../../hub/decisions/index.ts';
2
+ import type { Hub, Room } from '../../hub/rooms/index.ts';
3
+ import type { Message } from '../../hub/protocol/index.ts';
4
+ export type WatchOptions = {
5
+ seat: string;
6
+ exec: string;
7
+ hub?: string;
8
+ scope?: string;
9
+ handoff?: boolean;
10
+ once?: boolean;
11
+ requireGrant?: boolean;
12
+ interval?: number;
13
+ from?: string[];
14
+ maxHop?: number;
15
+ maxRuns?: number;
16
+ window?: number;
17
+ };
18
+ export type WatchContext = {
19
+ w: WatchOptions;
20
+ H0: Hub;
21
+ R0: Room;
22
+ me: string;
23
+ raw: string;
24
+ handle: string;
25
+ cmd: string;
26
+ interval: number;
27
+ allow: Set<string> | null;
28
+ maxHop: number;
29
+ maxRuns: number;
30
+ span: number;
31
+ runSeq: number;
32
+ log: (line: string) => void;
33
+ };
34
+ export type Group = {
35
+ grant: string | null;
36
+ msgs: Message[];
37
+ task: Message | null;
38
+ };
39
+ export type Run = Group & {
40
+ run?: string;
41
+ timeout: number | null;
42
+ };
43
+ export type Reserve = {
44
+ why?: string;
45
+ lost?: boolean;
46
+ wait?: boolean;
47
+ exhausted?: boolean;
48
+ gr?: D.Grant;
49
+ run?: string;
50
+ };
51
+ export type Plan = {
52
+ runs: Run[];
53
+ hold: boolean;
54
+ lost: boolean;
55
+ };
56
+ export type Planning = Plan & {
57
+ ownRuns: number[];
58
+ exhausted: Record<string, boolean>;
59
+ };
@@ -0,0 +1,15 @@
1
+ export declare const ROOT = "operator";
2
+ export type Budget = {
3
+ runs: number;
4
+ 'run-seconds': number;
5
+ concurrency: number;
6
+ };
7
+ export type Authority = {
8
+ decide?: Record<string, Partial<Budget>>;
9
+ };
10
+ export type AuthorityAt = (control: string | null) => Authority | null;
11
+ export declare const ids: (v: string | null) => string[];
12
+ export declare const parseBudget: (s: string | null | undefined) => Budget | null | undefined;
13
+ export declare const budgetText: (b: Budget) => string;
14
+ export declare const parseDue: (s: string) => string;
15
+ export declare const mayDecide: (authority: Authority | null, decider: string, proposer: string, budget: Budget | null) => boolean;
@@ -0,0 +1,6 @@
1
+ import type { Parsed } from '../protocol/index.ts';
2
+ export declare const STAMPS: string[];
3
+ export declare const DECISIONS: string[];
4
+ type Ref = (s: string) => boolean;
5
+ export declare const check: (m: Parsed, isRef: Ref) => string | null;
6
+ export {};
@@ -0,0 +1,5 @@
1
+ export declare const CAPABILITY = "decisions/1";
2
+ export * from './budget.ts';
3
+ export * from './check.ts';
4
+ export * from './proposal.ts';
5
+ export * from './usage.ts';
@@ -0,0 +1,38 @@
1
+ import type { All, Message } from '../protocol/index.ts';
2
+ import type { AuthorityAt, Budget } from './budget.ts';
3
+ export type Grant = {
4
+ id: string;
5
+ budget: Budget;
6
+ proposal: Message;
7
+ revoked: boolean;
8
+ };
9
+ export type Proposal = {
10
+ proposal: Message;
11
+ decider: string;
12
+ reviewers: string[];
13
+ budget: Budget | null;
14
+ due: number | null;
15
+ stamps: Record<string, {
16
+ stamp: string;
17
+ id: string;
18
+ reason: string;
19
+ }>;
20
+ missing: string[];
21
+ decision: {
22
+ decision: string;
23
+ id: string;
24
+ by: string;
25
+ time: number;
26
+ } | null;
27
+ revoked: {
28
+ id: string;
29
+ by: string;
30
+ time: number;
31
+ } | null;
32
+ superseded: Message | null;
33
+ state: string;
34
+ grant: Grant | null;
35
+ };
36
+ export declare const proposalOf: (all: All, p: Message, authorityAt: AuthorityAt, now?: number) => Proposal;
37
+ export declare const proposals: (all: All, authorityAt: AuthorityAt) => Proposal[];
38
+ export declare const grantOf: (all: All, authorityAt: AuthorityAt, id: string) => Grant | null;
@@ -0,0 +1,12 @@
1
+ import type { All, Message } from '../protocol/index.ts';
2
+ import type { AuthorityAt } from './budget.ts';
3
+ import type { Grant } from './proposal.ts';
4
+ export type Usage = {
5
+ runs: number;
6
+ open: number;
7
+ uncertain: number;
8
+ seconds: number;
9
+ left: number;
10
+ };
11
+ export declare const counted: (all: All, authorityAt: AuthorityAt, m: Message) => boolean;
12
+ export declare const usageOf: (all: All, grant: Grant, now?: number) => Usage;
@@ -1,29 +1,35 @@
1
- import type { Room } from '../hub/index.ts';
1
+ import type { Room } from '../rooms/index.ts';
2
2
  import type { All, Logs } from '../protocol/index.ts';
3
- import type { Rev } from '../store/index.ts';
4
- export type ReaderState = {
3
+ import type { Rev } from '../ports/store.ts';
4
+ export type Accepted = {
5
5
  control?: Rev;
6
6
  heads?: Record<string, Rev>;
7
+ signals?: Record<string, string>;
7
8
  alarms?: string[];
9
+ };
10
+ export type Delivered = {
8
11
  seen?: Record<string, string>;
12
+ };
13
+ export type Turns = {
9
14
  watched?: Record<string, string>;
10
15
  pending?: string[];
11
16
  inflight?: {
12
17
  seen: Record<string, string>;
13
18
  };
14
- heartbeatSeen?: Record<string, string>;
15
19
  runs?: number[];
16
20
  exhausted?: Record<string, boolean>;
17
- signals?: Record<string, string>;
21
+ heartbeatSeen?: Record<string, string>;
22
+ };
23
+ export type Outgoing = {
18
24
  staged?: Staged[];
19
25
  };
26
+ export type ReaderState = Accepted & Delivered & Turns & Outgoing;
20
27
  export type Staged = {
21
28
  path: string;
22
29
  blob: string;
23
30
  mode: string;
24
31
  size: number;
25
32
  };
26
- export declare const readerFile: (R: Room, reader: string) => string;
27
33
  export declare const readerLock: <T>(R: Room, reader: string, fn: () => T) => T;
28
34
  export declare const loadState: (R: Room, reader: string) => ReaderState;
29
35
  export declare const saveState: (R: Room, reader: string, st: ReaderState) => void;
@@ -0,0 +1,16 @@
1
+ import type { LocalState } from './state.ts';
2
+ import type { Transport } from './store.ts';
3
+ export type { Key, LocalState } from './state.ts';
4
+ export type Build = {
5
+ version: string;
6
+ resources: string;
7
+ };
8
+ export type HubPorts = {
9
+ build: Build;
10
+ state: LocalState;
11
+ transports: Record<string, Transport>;
12
+ store: string;
13
+ };
14
+ export declare const wireHub: (p: HubPorts) => void;
15
+ export declare const hubPorts: () => HubPorts;
16
+ export declare const locked: <T>(name: string, fn: () => T) => T;
@@ -0,0 +1,12 @@
1
+ export type Key = readonly string[];
2
+ export interface LocalState {
3
+ readonly root: string;
4
+ present(): boolean;
5
+ ensure(): void;
6
+ locked<T>(name: string, fn: () => T): T;
7
+ read<T>(key: Key, dflt: T): T;
8
+ write(key: Key, value: unknown): void;
9
+ remove(key: Key): void;
10
+ list(key: Key): string[];
11
+ place(key: Key): string;
12
+ }
@@ -52,7 +52,7 @@ export type JoinKey = {
52
52
  fingerprint: string;
53
53
  admitted: boolean;
54
54
  };
55
- export interface Store {
55
+ export interface Log {
56
56
  readonly type: string;
57
57
  readonly trust: 'asserted' | 'signed';
58
58
  isRef(s: string): boolean;
@@ -66,29 +66,55 @@ export interface Store {
66
66
  controlFile(room: StoredRoom, name: string, rev?: Rev): string | null;
67
67
  createRoom(name: string, who: string, text: string, files: Record<string, string>): Rev;
68
68
  updateControl(room: StoredRoom, who: string, text: string, files: Record<string, string>): Rev;
69
- archiveRoom(room: StoredRoom, as: string): void;
70
- deleteRoom(room: StoredRoom): void;
71
- migrateRoom?(name: string): Rev;
72
- roster(room: StoredRoom): Roster | null;
73
69
  logIds(room: StoredRoom): string[];
74
70
  logHead(room: StoredRoom, id: string): Rev | null;
75
71
  extends(older: Rev, newer: Rev): boolean;
76
72
  messages(room: StoredRoom, id: string, head: Rev): StoredMessage[];
77
73
  append(room: StoredRoom, who: string, text: string, entries: Entry[]): Rev;
78
- blob(file: string): Rev;
79
- alarms?(room: StoredRoom): string[];
80
- verifyLog(room: StoredRoom, id: string, head: Rev): string | null;
81
- pin(room: StoredRoom, reader: string, id: string, rev: Rev): void;
82
- unpin(room: StoredRoom, reader: string, id: string): void;
74
+ }
75
+ export interface Attachments {
76
+ blob(file: string): {
77
+ id: Rev;
78
+ size: number;
79
+ };
80
+ retain(room: StoredRoom, who: string, entries: Entry[]): void;
83
81
  file(rev: Rev, path: string): Buffer;
84
82
  sizes(rev: Rev, paths: string[]): Map<string, number>;
83
+ }
84
+ export interface Signals {
85
85
  signal(room: StoredRoom, who: string, target: Rev, name: string): void;
86
86
  signals(room: StoredRoom): SignalRecord[];
87
- admit?(room: StoredRoom, who: string, key: string): Rev;
88
- joinKey?(room: StoredRoom, who: string): JoinKey;
89
- forgetLog?(room: StoredRoom, id: string): void;
90
- rootKey?(): string;
91
- rootRoster?(): string;
87
+ }
88
+ export interface Evidence {
89
+ pin(room: StoredRoom, reader: string, id: string, rev: Rev): void;
90
+ unpin(room: StoredRoom, reader: string, id: string): void;
91
+ }
92
+ export interface Administration {
93
+ archiveRoom(room: StoredRoom, as: string): void;
94
+ deleteRoom(room: StoredRoom): void;
95
+ }
96
+ export interface Verification {
97
+ roster(room: StoredRoom): Roster | null;
98
+ verifyLog(room: StoredRoom, id: string, head: Rev): string | null;
99
+ alarms?(room: StoredRoom): string[];
100
+ }
101
+ export interface Presence {
102
+ heartbeat(room: StoredRoom, who: string, target: Rev, text: string): Rev;
103
+ heartbeats(room: StoredRoom): Array<{
104
+ agent: string;
105
+ target: Rev;
106
+ time: number;
107
+ text: string;
108
+ }>;
109
+ }
110
+ export interface Signed {
111
+ admit(room: StoredRoom, who: string, key: string): Rev;
112
+ joinKey(room: StoredRoom, who: string): JoinKey;
113
+ forgetLog(room: StoredRoom, id: string): void;
114
+ rootKey(): string;
115
+ rootRoster(): string;
116
+ }
117
+ export interface Store extends Log, Attachments, Signals, Evidence, Administration, Verification, Partial<Presence>, Partial<Signed> {
92
118
  }
93
119
  export type Descriptor = {
94
120
  schema: 'ringi-hub/2';
@@ -102,5 +128,20 @@ export type Descriptor = {
102
128
  remote?: string;
103
129
  };
104
130
  };
105
- export type StoreFactory = (dir: string, d: Descriptor, home: string) => Store;
106
- export declare const STORES: Record<string, StoreFactory>;
131
+ export type Genesis = (d: Descriptor) => {
132
+ files: Record<string, string>;
133
+ text: string;
134
+ };
135
+ export interface Transport {
136
+ readonly layout: string;
137
+ layoutOf?(store: Store): string;
138
+ open(at: string, d: Descriptor): Store;
139
+ create(at: string, d: Descriptor, genesis: Genesis): {
140
+ store: Store;
141
+ custody: string | null;
142
+ };
143
+ attach?(name: string, url: string, pins: {
144
+ root?: string;
145
+ genesis?: string;
146
+ }): void;
147
+ }
@@ -0,0 +1,5 @@
1
+ export * from './model.ts';
2
+ export * from './text.ts';
3
+ export * from './threads.ts';
4
+ export * from './order.ts';
5
+ export * from './reading.ts';
@@ -46,28 +46,3 @@ export type Parsed = Pick<Message, 'subject' | 'body' | 'to' | 're' | 'kind' | '
46
46
  export declare const one: (m: {
47
47
  trailers: Trailers;
48
48
  }, k: string) => string | null;
49
- export declare const decodeText: (buf: Uint8Array) => {
50
- text: string;
51
- invalid?: undefined;
52
- } | {
53
- invalid: string;
54
- text?: undefined;
55
- };
56
- export declare const parse: (raw: string, isRef: (s: string) => boolean) => Parsed;
57
- export declare const compose: (text: string, trailers: Array<[string, string | null | undefined | false]>) => string;
58
- export declare const checkOutgoing: (text: string, isRef: (s: string) => boolean) => Parsed;
59
- export declare const link: (logs: Logs) => All;
60
- export declare const ordered: (list: Message[]) => Message[];
61
- export declare const chainHas: (all: All, m: Message, top: Message) => boolean;
62
- export declare const rootOf: (all: All, m: Message) => Message;
63
- export declare const under: (all: All, top: Message) => Message[];
64
- export declare const lookup: (all: All, ref: string) => Message;
65
- export declare const visible: (m: Message, id: string, hidden: Set<string>) => boolean;
66
- export declare const wakes: (m: Message, id: string, hidden: Set<string>) => boolean;
67
- export declare const unread: (logs: Logs, id: string, cursors: Record<string, string>, limit: number | undefined, hidden: Set<string>) => {
68
- msgs: Message[];
69
- rest: number;
70
- cursors: {
71
- [x: string]: string;
72
- };
73
- };
@@ -0,0 +1,2 @@
1
+ import type { Message } from './model.ts';
2
+ export declare const ordered: (list: Message[]) => Message[];
@@ -0,0 +1,8 @@
1
+ import type { Logs, Message } from './model.ts';
2
+ export declare const visible: (m: Message, id: string, hidden: Set<string>) => boolean;
3
+ export declare const wakes: (m: Message, id: string, hidden: Set<string>) => boolean;
4
+ export declare const unread: (logs: Logs, id: string, cursors: Record<string, string>, limit: number | undefined, hidden: Set<string>) => {
5
+ msgs: Message[];
6
+ rest: number;
7
+ cursors: Record<string, string>;
8
+ };
@@ -0,0 +1,11 @@
1
+ import type { Parsed } from './model.ts';
2
+ export declare const decodeText: (buf: Uint8Array) => {
3
+ text: string;
4
+ invalid?: undefined;
5
+ } | {
6
+ invalid: string;
7
+ text?: undefined;
8
+ };
9
+ export declare const parse: (raw: string, isRef: (s: string) => boolean) => Parsed;
10
+ export declare const compose: (text: string, trailers: Array<[string, string | null | undefined | false]>) => string;
11
+ export declare const checkOutgoing: (text: string, isRef: (s: string) => boolean) => Parsed;
@@ -0,0 +1,5 @@
1
+ import type { All, Logs, Message } from './model.ts';
2
+ export declare const link: (logs: Logs) => All;
3
+ export declare const rootOf: (all: All, m: Message) => Message;
4
+ export declare const under: (all: All, top: Message) => Message[];
5
+ export declare const lookup: (all: All, ref: string) => Message;
@@ -0,0 +1,5 @@
1
+ import type { Descriptor, Rev, Store } from '../ports/store.ts';
2
+ import type { Contract } from './index.ts';
3
+ export declare const descriptorRefusal: (d: Descriptor, name: string) => string | null;
4
+ export declare const contractAt: (store: Store, name: string, rev: Rev) => Contract;
5
+ export declare const layoutRefusal: (name: string, shown: string, reads: string) => string | null;
@@ -0,0 +1,14 @@
1
+ import type { Transport } from '../ports/store.ts';
2
+ import type { Hub } from './index.ts';
3
+ export declare const hubNames: () => string[];
4
+ export declare const readProfileResource: (name: string) => string;
5
+ export declare const transportOf: (name: string, type: string) => Transport;
6
+ export declare const createHub: (name: string, { signed, url }?: {
7
+ signed?: boolean;
8
+ url?: string;
9
+ }) => {
10
+ custody: string | null;
11
+ };
12
+ export declare const openHub: (name: string, { refresh }?: {
13
+ refresh?: boolean;
14
+ }) => Hub;
@@ -0,0 +1,53 @@
1
+ import type * as D from '../decisions/index.ts';
2
+ import type { Profile } from '../work/index.ts';
3
+ import type { Descriptor, Member, Rev, Store, StoredRoom } from '../ports/store.ts';
4
+ export declare const OPERATOR = "operator";
5
+ export declare const HUB_MAJOR = 1;
6
+ export declare const PROTOCOL_MAJOR = 1;
7
+ export declare const CAPS: Set<string>;
8
+ export declare const RESERVED_ROOMS: Set<string>;
9
+ export type Contract = {
10
+ schema: 'ringi-hub';
11
+ version: string;
12
+ protocol: number;
13
+ trust: 'asserted' | 'signed';
14
+ capabilities?: string[];
15
+ store?: string;
16
+ profile?: string;
17
+ root?: string;
18
+ authority: D.Authority;
19
+ };
20
+ export type Hub = {
21
+ name: string;
22
+ dir: string;
23
+ d: Descriptor;
24
+ store: Store;
25
+ main: Rev;
26
+ contract: Contract;
27
+ signed: boolean;
28
+ };
29
+ export type Room = {
30
+ hub: Hub;
31
+ s: StoredRoom;
32
+ name: string;
33
+ archived: boolean;
34
+ head: Rev;
35
+ genesis: Rev;
36
+ contractRev: Rev;
37
+ contract: Contract;
38
+ authorityAt: D.AuthorityAt;
39
+ profile: Profile;
40
+ members: Record<string, Member>;
41
+ quorum: number | null;
42
+ };
43
+ export declare const start: (R: Pick<Room, 'members' | 'quorum'>) => {
44
+ quorum: number | null;
45
+ agents: number;
46
+ started: boolean;
47
+ };
48
+ export * from './hubs.ts';
49
+ export * from './compat.ts';
50
+ export * from './rooms.ts';
51
+ export * from './messages.ts';
52
+ export * from '../usecases/config.ts';
53
+ export { HIDDEN } from '../protocol/index.ts';
@@ -0,0 +1,8 @@
1
+ import type { FileRef, Message } from '../protocol/index.ts';
2
+ import type { Entry } from '../protocol/files.ts';
3
+ import type { Rev, StoredMessage } from '../ports/store.ts';
4
+ import type { Room } from './index.ts';
5
+ export declare const toMessage: (R: Room, from: string, x: StoredMessage, seq: number) => Message;
6
+ export declare const append: (R: Room, who: string, text: string, entries?: Entry[]) => Rev;
7
+ export declare const withSizes: (R: Room, m: Message) => FileRef[];
8
+ export declare const pongText: (me: string, m: Message, what: string) => string;
@@ -0,0 +1,10 @@
1
+ import type { Member } from '../ports/store.ts';
2
+ import type { Hub, Room } from './index.ts';
3
+ export declare const roomNames: (H: Hub, archived?: boolean) => string[];
4
+ export declare const openRoom: (H: Hub, name: string | null | undefined, { quiet }?: {
5
+ quiet?: boolean;
6
+ }) => Room | null;
7
+ export declare const room: (H: Hub, name: string | null | undefined) => Room;
8
+ export declare const ROOM_MD: (name: string) => string;
9
+ export declare const profileText: (H: Hub, name: string) => string | null;
10
+ export declare const controlChange: (R: Room, who: string, subject: string, mutate: (m: Record<string, Member>) => void, extra?: Array<[string, string]>) => void;
@@ -0,0 +1,3 @@
1
+ import type { All } from '../protocol/index.ts';
2
+ import type { Checked, RoomModel, SignalRecord } from './model.ts';
3
+ export declare const check: (R: RoomModel, all: All, records: SignalRecord[]) => Checked[];
@@ -0,0 +1,3 @@
1
+ import type { All, Message } from '../protocol/index.ts';
2
+ import type { RoomModel } from './model.ts';
3
+ export declare const effective: (R: RoomModel, all: All, m: Message) => string[];
@@ -0,0 +1,5 @@
1
+ export * from './model.ts';
2
+ export * from './marks.ts';
3
+ export * from './effective.ts';
4
+ export * from './check.ts';
5
+ export * from './pins.ts';
@@ -0,0 +1,4 @@
1
+ import type { Message } from '../protocol/index.ts';
2
+ import type { Checked, RoomModel } from './model.ts';
3
+ export declare const markWhy: (R: RoomModel, actor: string, m: Message, mark: string) => string | undefined;
4
+ export declare const marksOn: (checked: Checked[]) => Map<string, Record<string, string[]>>;