@idleware/ringi 0.5.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 (378) hide show
  1. package/package.json +1 -1
  2. package/target/dts/adapters/fs/index.d.ts +2 -0
  3. package/target/dts/adapters/fs/lock.d.ts +1 -0
  4. package/target/dts/adapters/fs/write.d.ts +5 -0
  5. package/target/dts/adapters/host-posix/group-state.d.ts +7 -0
  6. package/target/dts/adapters/host-posix/groups.d.ts +1 -0
  7. package/target/dts/adapters/host-posix/index.d.ts +2 -0
  8. package/target/dts/adapters/host-posix/launch.d.ts +7 -0
  9. package/target/dts/adapters/host-posix/probes.d.ts +5 -0
  10. package/target/dts/adapters/host-posix/stats.d.ts +9 -0
  11. package/target/dts/adapters/keys-file/index.d.ts +2 -0
  12. package/target/dts/adapters/state-fs/index.d.ts +5 -0
  13. package/target/dts/adapters/tool-claude/index.d.ts +2 -0
  14. package/target/dts/adapters/tool-codex/index.d.ts +2 -0
  15. package/target/dts/adapters/tool-cursor/index.d.ts +2 -0
  16. package/target/dts/adapters/tool-traces/index.d.ts +3 -0
  17. package/target/dts/adapters/transport-git/branches.d.ts +43 -0
  18. package/target/dts/adapters/transport-git/files.d.ts +2 -0
  19. package/target/dts/adapters/transport-git/index.d.ts +32 -0
  20. package/target/dts/adapters/transport-git/marks.d.ts +20 -0
  21. package/target/dts/adapters/transport-git/remote/admit.d.ts +7 -0
  22. package/target/dts/adapters/transport-git/remote/alarms.d.ts +3 -0
  23. package/target/dts/adapters/transport-git/remote/bootstrap.d.ts +7 -0
  24. package/target/dts/adapters/transport-git/remote/branch-commit.d.ts +3 -0
  25. package/target/dts/adapters/transport-git/remote/branch-control.d.ts +15 -0
  26. package/target/dts/adapters/transport-git/remote/branch-scan.d.ts +2 -0
  27. package/target/dts/adapters/transport-git/remote/branch.d.ts +5 -0
  28. package/target/dts/adapters/transport-git/remote/cache.d.ts +3 -0
  29. package/target/dts/adapters/transport-git/remote/commits.d.ts +2 -0
  30. package/target/dts/adapters/transport-git/remote/forget.d.ts +2 -0
  31. package/target/dts/adapters/transport-git/remote/git.d.ts +26 -0
  32. package/target/dts/adapters/transport-git/remote/heartbeat-facts.d.ts +1 -0
  33. package/target/dts/adapters/transport-git/remote/heartbeat-name.d.ts +6 -0
  34. package/target/dts/adapters/transport-git/remote/heartbeat-object.d.ts +10 -0
  35. package/target/dts/adapters/transport-git/remote/heartbeat-push.d.ts +2 -0
  36. package/target/dts/adapters/transport-git/remote/heartbeat.d.ts +7 -0
  37. package/target/dts/adapters/transport-git/remote/keys.d.ts +13 -0
  38. package/target/dts/adapters/transport-git/remote/main.d.ts +11 -0
  39. package/target/dts/adapters/transport-git/remote/process.d.ts +20 -0
  40. package/target/dts/adapters/transport-git/remote/push-retry.d.ts +2 -0
  41. package/target/dts/adapters/transport-git/remote/push-validate.d.ts +2 -0
  42. package/target/dts/adapters/transport-git/remote/push.d.ts +16 -0
  43. package/target/dts/adapters/transport-git/remote/roster.d.ts +7 -0
  44. package/target/dts/adapters/transport-git/remote/signals.d.ts +15 -0
  45. package/target/dts/adapters/transport-git/remote/signature.d.ts +5 -0
  46. package/target/dts/adapters/transport-git/remote/sync-heartbeat.d.ts +2 -0
  47. package/target/dts/adapters/transport-git/remote/sync-rooms.d.ts +6 -0
  48. package/target/dts/adapters/transport-git/remote/sync-tags.d.ts +8 -0
  49. package/target/dts/adapters/transport-git/remote/sync.d.ts +2 -0
  50. package/target/dts/adapters/transport-git/remote/types.d.ts +64 -0
  51. package/target/dts/adapters/transport-git/remote.d.ts +17 -0
  52. package/target/dts/adapters/transport-git/repo.d.ts +31 -0
  53. package/target/dts/adapters/transport-git/run.d.ts +21 -0
  54. package/target/dts/adapters/transport-git/signing.d.ts +4 -0
  55. package/target/dts/adapters/transport-git/tags.d.ts +15 -0
  56. package/target/dts/adapters/transport-git/transport.d.ts +7 -0
  57. package/target/dts/adapters/transport-kafka/index.d.ts +2 -0
  58. package/target/dts/adapters/transport-temporal/index.d.ts +2 -0
  59. package/target/dts/cli.d.ts +2 -1
  60. package/target/dts/{cli/agent.d.ts → clients/cli/agent/index.d.ts} +3 -3
  61. package/target/dts/{cli → clients/cli/agent}/session.d.ts +2 -2
  62. package/target/dts/clients/cli/arg-parse.d.ts +2 -0
  63. package/target/dts/{cli → clients/cli}/args.d.ts +2 -2
  64. package/target/dts/clients/cli/commands.d.ts +2 -0
  65. package/target/dts/clients/cli/context.d.ts +4 -0
  66. package/target/dts/{cli/index.d.ts → clients/cli/help.d.ts} +1 -3
  67. package/target/dts/clients/cli/index.d.ts +4 -0
  68. package/target/dts/clients/cli/operator/heartbeat-format.d.ts +5 -0
  69. package/target/dts/clients/cli/operator/heartbeat.d.ts +3 -0
  70. package/target/dts/clients/cli/operator/hub-commands.d.ts +6 -0
  71. package/target/dts/clients/cli/operator/hub.d.ts +2 -0
  72. package/target/dts/clients/cli/operator/index.d.ts +5 -0
  73. package/target/dts/clients/cli/operator/room-lifecycle.d.ts +5 -0
  74. package/target/dts/clients/cli/operator/room-list.d.ts +5 -0
  75. package/target/dts/clients/cli/operator/room-members.d.ts +4 -0
  76. package/target/dts/clients/cli/operator/room.d.ts +2 -0
  77. package/target/dts/clients/cli/operator/sessions.d.ts +5 -0
  78. package/target/dts/clients/cli/operator/watch.d.ts +2 -0
  79. package/target/dts/clients/cli/operator/where-format.d.ts +7 -0
  80. package/target/dts/clients/cli/operator/where.d.ts +2 -0
  81. package/target/dts/clients/cli/shared/budget.d.ts +7 -0
  82. package/target/dts/clients/cli/shared/files.d.ts +4 -0
  83. package/target/dts/clients/cli/shared/index.d.ts +7 -0
  84. package/target/dts/clients/cli/shared/messages.d.ts +7 -0
  85. package/target/dts/clients/cli/shared/profile.d.ts +4 -0
  86. package/target/dts/clients/cli/shared/session.d.ts +6 -0
  87. package/target/dts/clients/cli/shared/signals.d.ts +3 -0
  88. package/target/dts/clients/cli/shared/work.d.ts +6 -0
  89. package/target/dts/clients/cli/skill/index.d.ts +3 -0
  90. package/target/dts/{cli/skill.d.ts → clients/cli/skill/targets.d.ts} +1 -2
  91. package/target/dts/composition/index.d.ts +2 -0
  92. package/target/dts/{heartbeat → core/agents/heartbeat}/index.d.ts +2 -4
  93. package/target/dts/{app/heartbeat.d.ts → core/agents/heartbeat/pulse.d.ts} +5 -6
  94. package/target/dts/core/agents/heartbeat/singleton.d.ts +3 -0
  95. package/target/dts/core/agents/heartbeat/tools.d.ts +6 -0
  96. package/target/dts/{app → core/agents}/overview.d.ts +12 -6
  97. package/target/dts/core/agents/ports/host.d.ts +47 -0
  98. package/target/dts/core/agents/ports/index.d.ts +9 -0
  99. package/target/dts/core/agents/ports/tools.d.ts +18 -0
  100. package/target/dts/core/agents/sessions/agent.d.ts +70 -0
  101. package/target/dts/core/agents/sessions/binding.d.ts +9 -0
  102. package/target/dts/core/agents/sessions/context.d.ts +8 -0
  103. package/target/dts/{runtime/session.d.ts → core/agents/sessions/index.d.ts} +2 -9
  104. package/target/dts/core/agents/sessions/join.d.ts +20 -0
  105. package/target/dts/core/agents/sessions/resume.d.ts +2 -0
  106. package/target/dts/core/agents/sessions/session.d.ts +46 -0
  107. package/target/dts/core/agents/sessions/wait.d.ts +38 -0
  108. package/target/dts/core/agents/turns/budgets.d.ts +5 -0
  109. package/target/dts/core/agents/turns/dispatch.d.ts +9 -0
  110. package/target/dts/core/agents/turns/exhaustion.d.ts +11 -0
  111. package/target/dts/core/agents/turns/grants.d.ts +4 -0
  112. package/target/dts/core/agents/turns/index.d.ts +4 -0
  113. package/target/dts/core/agents/turns/limits.d.ts +2 -0
  114. package/target/dts/core/agents/turns/messages.d.ts +10 -0
  115. package/target/dts/core/agents/turns/pings.d.ts +5 -0
  116. package/target/dts/core/agents/turns/plan.d.ts +3 -0
  117. package/target/dts/core/agents/turns/poll.d.ts +8 -0
  118. package/target/dts/core/agents/turns/results.d.ts +3 -0
  119. package/target/dts/core/agents/turns/seat.d.ts +2 -0
  120. package/target/dts/core/agents/turns/types.d.ts +59 -0
  121. package/target/dts/core/hub/decisions/budget.d.ts +15 -0
  122. package/target/dts/core/hub/decisions/check.d.ts +6 -0
  123. package/target/dts/core/hub/decisions/index.d.ts +5 -0
  124. package/target/dts/core/hub/decisions/proposal.d.ts +38 -0
  125. package/target/dts/core/hub/decisions/usage.d.ts +12 -0
  126. package/target/dts/{runtime/reader.d.ts → core/hub/history/index.d.ts} +12 -6
  127. package/target/dts/core/hub/ports/index.d.ts +16 -0
  128. package/target/dts/core/hub/ports/state.d.ts +12 -0
  129. package/target/dts/{store/index.d.ts → core/hub/ports/store.d.ts} +48 -18
  130. package/target/dts/core/hub/protocol/index.d.ts +5 -0
  131. package/target/dts/{protocol/index.d.ts → core/hub/protocol/model.d.ts} +0 -25
  132. package/target/dts/core/hub/protocol/order.d.ts +2 -0
  133. package/target/dts/core/hub/protocol/reading.d.ts +8 -0
  134. package/target/dts/core/hub/protocol/text.d.ts +11 -0
  135. package/target/dts/core/hub/protocol/threads.d.ts +5 -0
  136. package/target/dts/core/hub/rooms/compat.d.ts +5 -0
  137. package/target/dts/core/hub/rooms/hubs.d.ts +14 -0
  138. package/target/dts/core/hub/rooms/index.d.ts +53 -0
  139. package/target/dts/core/hub/rooms/messages.d.ts +8 -0
  140. package/target/dts/core/hub/rooms/rooms.d.ts +10 -0
  141. package/target/dts/core/hub/signals/check.d.ts +3 -0
  142. package/target/dts/core/hub/signals/effective.d.ts +3 -0
  143. package/target/dts/core/hub/signals/index.d.ts +5 -0
  144. package/target/dts/core/hub/signals/marks.d.ts +4 -0
  145. package/target/dts/core/hub/signals/model.d.ts +28 -0
  146. package/target/dts/core/hub/signals/pins.d.ts +5 -0
  147. package/target/dts/{hub/signals.d.ts → core/hub/signals/write.d.ts} +1 -1
  148. package/target/dts/core/hub/usecases/actor.d.ts +6 -0
  149. package/target/dts/{app → core/hub/usecases}/budget.d.ts +5 -18
  150. package/target/dts/core/hub/usecases/config.d.ts +6 -0
  151. package/target/dts/{app → core/hub/usecases}/context.d.ts +3 -8
  152. package/target/dts/{app → core/hub/usecases}/hubs.d.ts +1 -1
  153. package/target/dts/core/hub/usecases/propose.d.ts +17 -0
  154. package/target/dts/{app → core/hub/usecases}/room.d.ts +8 -34
  155. package/target/dts/{app → core/hub/usecases}/rooms.d.ts +2 -6
  156. package/target/dts/core/hub/usecases/roster.d.ts +5 -0
  157. package/target/dts/core/hub/usecases/send.d.ts +21 -0
  158. package/target/dts/core/hub/usecases/staging.d.ts +8 -0
  159. package/target/dts/{app → core/hub/usecases}/view.d.ts +4 -4
  160. package/target/dts/{domain/profiles.d.ts → core/hub/work/index.d.ts} +3 -7
  161. package/target/dts/core/hub/work/parse.d.ts +2 -0
  162. package/target/dts/core/hub/work/task.d.ts +6 -0
  163. package/target/dts/core/signing/index.d.ts +35 -0
  164. package/target/dts/index.d.ts +8 -8
  165. package/target/dts/lib/fail.d.ts +8 -0
  166. package/target/dts/lib/index.d.ts +3 -11
  167. package/target/dts/lib/json.d.ts +1 -0
  168. package/target/esm/adapters/fs/index.js +5 -0
  169. package/target/esm/adapters/fs/lock.js +83 -0
  170. package/target/esm/adapters/fs/write.js +25 -0
  171. package/target/esm/adapters/host-posix/group-state.js +24 -0
  172. package/target/esm/adapters/host-posix/groups.js +43 -0
  173. package/target/esm/adapters/host-posix/index.js +35 -0
  174. package/target/esm/adapters/host-posix/launch.js +80 -0
  175. package/target/esm/adapters/host-posix/probes.js +66 -0
  176. package/target/esm/adapters/host-posix/stats.js +27 -0
  177. package/target/esm/adapters/keys-file/index.js +68 -0
  178. package/target/esm/adapters/state-fs/index.js +79 -0
  179. package/target/esm/adapters/tool-claude/index.js +32 -0
  180. package/target/esm/adapters/tool-codex/index.js +38 -0
  181. package/target/esm/adapters/tool-cursor/index.js +8 -0
  182. package/target/esm/adapters/tool-traces/index.js +18 -0
  183. package/target/esm/adapters/transport-git/branches.js +155 -0
  184. package/target/esm/adapters/transport-git/files.js +48 -0
  185. package/target/esm/adapters/transport-git/index.js +128 -0
  186. package/target/esm/adapters/transport-git/marks.js +88 -0
  187. package/target/esm/adapters/transport-git/remote/admit.js +71 -0
  188. package/target/esm/adapters/transport-git/remote/alarms.js +30 -0
  189. package/target/esm/adapters/transport-git/remote/bootstrap.js +47 -0
  190. package/target/esm/adapters/transport-git/remote/branch-commit.js +36 -0
  191. package/target/esm/adapters/transport-git/remote/branch-control.js +37 -0
  192. package/target/esm/adapters/transport-git/remote/branch-scan.js +28 -0
  193. package/target/esm/adapters/transport-git/remote/branch.js +37 -0
  194. package/target/esm/adapters/transport-git/remote/cache.js +23 -0
  195. package/target/esm/adapters/transport-git/remote/commits.js +25 -0
  196. package/target/esm/adapters/transport-git/remote/forget.js +35 -0
  197. package/target/esm/adapters/transport-git/remote/git.js +58 -0
  198. package/target/esm/adapters/transport-git/remote/heartbeat-facts.js +35 -0
  199. package/target/esm/adapters/transport-git/remote/heartbeat-name.js +19 -0
  200. package/target/esm/adapters/transport-git/remote/heartbeat-object.js +40 -0
  201. package/target/esm/adapters/transport-git/remote/heartbeat-push.js +44 -0
  202. package/target/esm/adapters/transport-git/remote/heartbeat.js +44 -0
  203. package/target/esm/adapters/transport-git/remote/keys.js +75 -0
  204. package/target/esm/adapters/transport-git/remote/main.js +41 -0
  205. package/target/esm/adapters/transport-git/remote/process.js +37 -0
  206. package/target/esm/adapters/transport-git/remote/push-retry.js +46 -0
  207. package/target/esm/adapters/transport-git/remote/push-validate.js +39 -0
  208. package/target/esm/adapters/transport-git/remote/push.js +62 -0
  209. package/target/esm/adapters/transport-git/remote/roster.js +48 -0
  210. package/target/esm/adapters/transport-git/remote/signals.js +63 -0
  211. package/target/esm/adapters/transport-git/remote/signature.js +56 -0
  212. package/target/esm/adapters/transport-git/remote/sync-heartbeat.js +26 -0
  213. package/target/esm/adapters/transport-git/remote/sync-rooms.js +38 -0
  214. package/target/esm/adapters/transport-git/remote/sync-tags.js +48 -0
  215. package/target/esm/adapters/transport-git/remote/sync.js +38 -0
  216. package/target/esm/adapters/transport-git/remote/types.js +10 -0
  217. package/target/esm/adapters/transport-git/remote.js +17 -0
  218. package/target/esm/adapters/transport-git/repo.js +115 -0
  219. package/target/esm/adapters/transport-git/run.js +57 -0
  220. package/target/esm/adapters/transport-git/signing.js +44 -0
  221. package/target/esm/adapters/transport-git/tags.js +21 -0
  222. package/target/esm/adapters/transport-git/transport.js +29 -0
  223. package/target/esm/adapters/transport-kafka/index.js +4 -0
  224. package/target/esm/adapters/transport-temporal/index.js +4 -0
  225. package/target/esm/cli.js +5 -4
  226. package/target/esm/{cli/agent.js → clients/cli/agent/index.js} +8 -7
  227. package/target/esm/{cli → clients/cli/agent}/session.js +7 -7
  228. package/target/esm/clients/cli/arg-parse.js +41 -0
  229. package/target/esm/{cli → clients/cli}/args.js +3 -36
  230. package/target/esm/clients/cli/commands.js +45 -0
  231. package/target/esm/clients/cli/context.js +6 -0
  232. package/target/esm/{cli/index.js → clients/cli/help.js} +4 -77
  233. package/target/esm/clients/cli/index.js +27 -0
  234. package/target/esm/clients/cli/operator/heartbeat-format.js +8 -0
  235. package/target/esm/clients/cli/operator/heartbeat.js +35 -0
  236. package/target/esm/clients/cli/operator/hub-commands.js +37 -0
  237. package/target/esm/clients/cli/operator/hub.js +10 -0
  238. package/target/esm/clients/cli/operator/index.js +8 -0
  239. package/target/esm/clients/cli/operator/room-lifecycle.js +23 -0
  240. package/target/esm/clients/cli/operator/room-list.js +27 -0
  241. package/target/esm/clients/cli/operator/room-members.js +15 -0
  242. package/target/esm/clients/cli/operator/room.js +15 -0
  243. package/target/esm/clients/cli/operator/sessions.js +32 -0
  244. package/target/esm/clients/cli/operator/watch.js +15 -0
  245. package/target/esm/clients/cli/operator/where-format.js +24 -0
  246. package/target/esm/clients/cli/operator/where.js +32 -0
  247. package/target/esm/clients/cli/shared/budget.js +50 -0
  248. package/target/esm/clients/cli/shared/files.js +26 -0
  249. package/target/esm/clients/cli/shared/index.js +10 -0
  250. package/target/esm/clients/cli/shared/messages.js +41 -0
  251. package/target/esm/clients/cli/shared/profile.js +17 -0
  252. package/target/esm/clients/cli/shared/session.js +8 -0
  253. package/target/esm/clients/cli/shared/signals.js +21 -0
  254. package/target/esm/clients/cli/shared/work.js +26 -0
  255. package/target/esm/clients/cli/skill/index.js +40 -0
  256. package/target/esm/clients/cli/skill/targets.js +20 -0
  257. package/target/esm/composition/index.js +34 -0
  258. package/target/esm/{heartbeat → core/agents/heartbeat}/index.js +14 -12
  259. package/target/esm/{app/heartbeat.js → core/agents/heartbeat/pulse.js} +31 -55
  260. package/target/esm/core/agents/heartbeat/singleton.js +38 -0
  261. package/target/esm/core/agents/heartbeat/tools.js +24 -0
  262. package/target/esm/{app → core/agents}/overview.js +15 -9
  263. package/target/esm/core/agents/ports/host.js +4 -0
  264. package/target/esm/core/agents/ports/index.js +7 -0
  265. package/target/esm/core/agents/ports/tools.js +5 -0
  266. package/target/esm/{app → core/agents/sessions}/agent.js +11 -43
  267. package/target/esm/core/agents/sessions/binding.js +43 -0
  268. package/target/esm/core/agents/sessions/context.js +11 -0
  269. package/target/esm/core/agents/sessions/index.js +59 -0
  270. package/target/esm/core/agents/sessions/join.js +55 -0
  271. package/target/esm/core/agents/sessions/resume.js +54 -0
  272. package/target/esm/core/agents/sessions/session.js +28 -0
  273. package/target/esm/core/agents/sessions/wait.js +47 -0
  274. package/target/esm/core/agents/turns/budgets.js +48 -0
  275. package/target/esm/core/agents/turns/dispatch.js +40 -0
  276. package/target/esm/core/agents/turns/exhaustion.js +16 -0
  277. package/target/esm/core/agents/turns/grants.js +36 -0
  278. package/target/esm/core/agents/turns/index.js +33 -0
  279. package/target/esm/core/agents/turns/limits.js +11 -0
  280. package/target/esm/core/agents/turns/messages.js +32 -0
  281. package/target/esm/core/agents/turns/pings.js +30 -0
  282. package/target/esm/core/agents/turns/plan.js +29 -0
  283. package/target/esm/core/agents/turns/poll.js +48 -0
  284. package/target/esm/core/agents/turns/results.js +40 -0
  285. package/target/esm/core/agents/turns/seat.js +44 -0
  286. package/target/esm/core/agents/turns/types.js +3 -0
  287. package/target/esm/{domain/index.js → core/hub/capabilities.js} +3 -3
  288. package/target/esm/core/hub/decisions/budget.js +40 -0
  289. package/target/esm/core/hub/decisions/check.js +43 -0
  290. package/target/esm/core/hub/decisions/index.js +10 -0
  291. package/target/esm/core/hub/decisions/proposal.js +73 -0
  292. package/target/esm/core/hub/decisions/usage.js +39 -0
  293. package/target/esm/core/hub/history/index.js +90 -0
  294. package/target/esm/core/hub/ports/index.js +10 -0
  295. package/target/esm/core/hub/ports/state.js +5 -0
  296. package/target/esm/core/hub/ports/store.js +10 -0
  297. package/target/esm/{protocol → core/hub/protocol}/files.js +4 -2
  298. package/target/esm/core/hub/protocol/index.js +9 -0
  299. package/target/esm/core/hub/protocol/model.js +15 -0
  300. package/target/esm/core/hub/protocol/order.js +39 -0
  301. package/target/esm/core/hub/protocol/reading.js +29 -0
  302. package/target/esm/core/hub/protocol/text.js +95 -0
  303. package/target/esm/core/hub/protocol/threads.js +52 -0
  304. package/target/esm/core/hub/rooms/compat.js +42 -0
  305. package/target/esm/core/hub/rooms/hubs.js +92 -0
  306. package/target/esm/core/hub/rooms/index.js +23 -0
  307. package/target/esm/core/hub/rooms/messages.js +47 -0
  308. package/target/esm/core/hub/rooms/rooms.js +84 -0
  309. package/target/esm/core/hub/signals/check.js +33 -0
  310. package/target/esm/core/hub/signals/effective.js +31 -0
  311. package/target/esm/core/hub/signals/index.js +23 -0
  312. package/target/esm/core/hub/signals/marks.js +30 -0
  313. package/target/esm/core/hub/signals/model.js +5 -0
  314. package/target/esm/core/hub/signals/pins.js +21 -0
  315. package/target/esm/{hub/signals.js → core/hub/signals/write.js} +4 -4
  316. package/target/esm/core/hub/usecases/actor.js +3 -0
  317. package/target/esm/core/hub/usecases/budget.js +78 -0
  318. package/target/esm/core/hub/usecases/config.js +5 -0
  319. package/target/esm/core/hub/usecases/context.js +13 -0
  320. package/target/esm/core/hub/usecases/hubs.js +95 -0
  321. package/target/esm/core/hub/usecases/propose.js +39 -0
  322. package/target/esm/core/hub/usecases/room.js +82 -0
  323. package/target/esm/{app → core/hub/usecases}/rooms.js +11 -63
  324. package/target/esm/core/hub/usecases/roster.js +47 -0
  325. package/target/esm/core/hub/usecases/send.js +78 -0
  326. package/target/esm/core/hub/usecases/staging.js +60 -0
  327. package/target/esm/{app → core/hub/usecases}/view.js +33 -33
  328. package/target/esm/core/hub/work/index.js +13 -0
  329. package/target/esm/core/hub/work/parse.js +37 -0
  330. package/target/esm/core/hub/work/task.js +68 -0
  331. package/target/esm/core/signing/index.js +4 -0
  332. package/target/esm/index.js +7 -6
  333. package/target/esm/lib/fail.js +18 -0
  334. package/target/esm/lib/index.js +20 -195
  335. package/target/esm/lib/json.js +81 -0
  336. package/target/dts/app/agent.d.ts +0 -109
  337. package/target/dts/app/session.d.ts +0 -65
  338. package/target/dts/cli/context.d.ts +0 -6
  339. package/target/dts/cli/operator.d.ts +0 -10
  340. package/target/dts/cli/shared.d.ts +0 -27
  341. package/target/dts/domain/decisions.d.ts +0 -65
  342. package/target/dts/domain/signals.d.ts +0 -37
  343. package/target/dts/heartbeat/platform.d.ts +0 -15
  344. package/target/dts/heartbeat/tools.d.ts +0 -11
  345. package/target/dts/home/index.d.ts +0 -21
  346. package/target/dts/hub/index.d.ts +0 -72
  347. package/target/dts/runtime/watch.d.ts +0 -17
  348. package/target/dts/store/git/index.d.ts +0 -92
  349. package/target/dts/store/git/remote.d.ts +0 -95
  350. package/target/dts/store/kafka/index.d.ts +0 -2
  351. package/target/dts/store/temporal/index.d.ts +0 -2
  352. package/target/esm/app/budget.js +0 -95
  353. package/target/esm/app/context.js +0 -16
  354. package/target/esm/app/hubs.js +0 -76
  355. package/target/esm/app/room.js +0 -181
  356. package/target/esm/app/session.js +0 -99
  357. package/target/esm/cli/context.js +0 -8
  358. package/target/esm/cli/operator.js +0 -185
  359. package/target/esm/cli/shared.js +0 -159
  360. package/target/esm/cli/skill.js +0 -54
  361. package/target/esm/domain/decisions.js +0 -178
  362. package/target/esm/domain/profiles.js +0 -96
  363. package/target/esm/domain/signals.js +0 -134
  364. package/target/esm/heartbeat/platform.js +0 -83
  365. package/target/esm/heartbeat/tools.js +0 -68
  366. package/target/esm/home/index.js +0 -88
  367. package/target/esm/hub/index.js +0 -224
  368. package/target/esm/protocol/index.js +0 -219
  369. package/target/esm/runtime/reader.js +0 -65
  370. package/target/esm/runtime/session.js +0 -116
  371. package/target/esm/runtime/watch.js +0 -321
  372. package/target/esm/store/git/index.js +0 -719
  373. package/target/esm/store/git/remote.js +0 -928
  374. package/target/esm/store/index.js +0 -15
  375. package/target/esm/store/kafka/index.js +0 -3
  376. package/target/esm/store/temporal/index.js +0 -3
  377. /package/target/dts/{domain/index.d.ts → core/hub/capabilities.d.ts} +0 -0
  378. /package/target/dts/{protocol → core/hub/protocol}/files.d.ts +0 -0
@@ -1,65 +0,0 @@
1
- import type { Session } from '../runtime/session.ts';
2
- import type { JoinKey } from '../store/index.ts';
3
- export { bound } from '../runtime/session.ts';
4
- export type { Session } from '../runtime/session.ts';
5
- export declare const briefing: (s: Session) => {
6
- session: Session;
7
- actor: import("../runtime/session.ts").Bound;
8
- start: {
9
- quorum: number | null;
10
- agents: number;
11
- started: boolean;
12
- };
13
- tasks: import("./view.ts").TaskView[];
14
- inbox: {
15
- rest: number;
16
- cursors: {
17
- [x: string]: string;
18
- };
19
- all: import("../protocol/index.ts").All;
20
- msgs: {
21
- id: string;
22
- from: string;
23
- trust: 'asserted' | 'verified';
24
- time: number;
25
- seq: number;
26
- invalid: string | null;
27
- subject: string;
28
- body: string;
29
- to: string[];
30
- re: string | null;
31
- kind: string | null;
32
- state: string | null;
33
- assign: string[] | null;
34
- roles: Record<string, string> | null;
35
- hop: number;
36
- bad: string | null;
37
- trailers: import("../protocol/index.ts").Trailers;
38
- refused: import("../protocol/index.ts").Refused[];
39
- reId: string | null;
40
- hopEff: number;
41
- files: import("../protocol/index.ts").FileRef[];
42
- }[];
43
- } | null;
44
- };
45
- export type JoinInput = {
46
- hub: string;
47
- room: string;
48
- agent?: string;
49
- scope?: string;
50
- };
51
- export type JoinResult = {
52
- agent: string;
53
- hub: string;
54
- room: string;
55
- } & ({
56
- session: Session;
57
- key: null;
58
- } | {
59
- session: null;
60
- key: JoinKey;
61
- });
62
- export declare const join: ({ hub, room, agent: id, scope }: JoinInput) => JoinResult;
63
- export declare const resume: (selector?: string) => Session;
64
- export declare const stop: () => Session;
65
- export declare const leave: () => Session;
@@ -1,6 +0,0 @@
1
- import * as Context from '../app/context.ts';
2
- import type { Opts } from './args.ts';
3
- export type { Ctx } from '../app/context.ts';
4
- export { isRef } from '../app/room.ts';
5
- export declare const parseTo: (v: unknown) => string[];
6
- export declare const operatorCtx: (o: Opts) => Context.Ctx;
@@ -1,10 +0,0 @@
1
- import type { SessionView } from '../app/overview.ts';
2
- import type { Opts } from './args.ts';
3
- export declare const sessionLine: (s: SessionView) => string;
4
- export declare const where: (o: Opts) => Promise<void>;
5
- export declare const heartbeats: (o: Opts) => Promise<void>;
6
- export declare const pulse: (o: Opts) => Promise<void>;
7
- export declare const sessions: (o: Opts) => void;
8
- export declare const forget: (o: Opts) => void;
9
- export declare const hub: (o: Opts) => void;
10
- export declare const roomCmd: (o: Opts) => void;
@@ -1,27 +0,0 @@
1
- import type { TaskView } from '../app/view.ts';
2
- import type { Opts } from './args.ts';
3
- import type { Ctx } from './context.ts';
4
- import type { Session } from '../app/session.ts';
5
- export declare const add: (a: Ctx, o: Opts) => void;
6
- export declare const send: (a: Ctx, o: Opts) => void;
7
- export declare const reply: (a: Ctx, o: Opts) => void;
8
- export declare const read: (a: Ctx, o: Opts) => void;
9
- export declare const thread: (a: Ctx, o: Opts) => void;
10
- export declare const taskLine: (t: TaskView) => string;
11
- export declare const tasks: (a: Ctx, o: Opts) => void;
12
- export declare const log: (a: Ctx, o: Opts) => void;
13
- export declare const cat: (a: Ctx, o: Opts) => void;
14
- export declare const get: (a: Ctx, o: Opts) => void;
15
- export declare const who: (a: Ctx) => void;
16
- export declare const signals: (a: Ctx, o: Opts) => void;
17
- export declare const profileCmd: ({ R }: Ctx, o: Opts) => void;
18
- export declare const propose: (a: Ctx, o: Opts) => void;
19
- export declare const stamp_: (a: Ctx, o: Opts) => void;
20
- export declare const decide: (a: Ctx, o: Opts) => void;
21
- export declare const proposals: (a: Ctx, o: Opts) => void;
22
- export declare const grants: (a: Ctx, o: Opts) => void;
23
- export declare const scopeLine: (s: Session, quorum?: boolean) => string;
24
- export declare const waiting: (room: string, st: {
25
- quorum: number | null;
26
- agents: number;
27
- }) => string;
@@ -1,65 +0,0 @@
1
- import type { All, Message, Parsed } from '../protocol/index.ts';
2
- export declare const CAPABILITY = "decisions/1";
3
- export declare const ROOT = "operator";
4
- export declare const BUDGET_KEYS: readonly ['runs', 'run-seconds', 'concurrency'];
5
- export type Budget = {
6
- runs: number;
7
- 'run-seconds': number;
8
- concurrency: number;
9
- };
10
- export declare const STAMPS: string[];
11
- export declare const DECISIONS: string[];
12
- export type Authority = {
13
- decide?: Record<string, Partial<Budget>>;
14
- };
15
- export type AuthorityAt = (control: string | null) => Authority | null;
16
- export declare const parseBudget: (s: string | null | undefined) => Budget | null | undefined;
17
- export declare const budgetText: (b: Budget) => string;
18
- export declare const parseDue: (s: string) => string;
19
- export declare const check: (m: Parsed, isRef: (s: string) => boolean) => string | null;
20
- export declare const mayDecide: (authority: Authority | null, decider: string, proposer: string, budget: Budget | null) => boolean;
21
- export type Grant = {
22
- id: string;
23
- budget: Budget;
24
- proposal: Message;
25
- revoked: boolean;
26
- };
27
- export type Proposal = {
28
- proposal: Message;
29
- decider: string;
30
- reviewers: string[];
31
- budget: Budget | null;
32
- due: number | null;
33
- stamps: Record<string, {
34
- stamp: string;
35
- id: string;
36
- reason: string;
37
- }>;
38
- missing: string[];
39
- decision: {
40
- decision: string;
41
- id: string;
42
- by: string;
43
- time: number;
44
- } | null;
45
- revoked: {
46
- id: string;
47
- by: string;
48
- time: number;
49
- } | null;
50
- superseded: Message | null;
51
- state: string;
52
- grant: Grant | null;
53
- };
54
- export declare const proposalOf: (all: All, p: Message, authorityAt: AuthorityAt, now?: number) => Proposal;
55
- export declare const proposals: (all: All, authorityAt: AuthorityAt) => Proposal[];
56
- export declare const grantOf: (all: All, authorityAt: AuthorityAt, id: string) => Grant | null;
57
- export type Usage = {
58
- runs: number;
59
- open: number;
60
- uncertain: number;
61
- seconds: number;
62
- left: number;
63
- };
64
- export declare const counted: (all: All, authorityAt: AuthorityAt, m: Message) => boolean;
65
- export declare const usageOf: (all: All, grant: Grant, now?: number) => Usage;
@@ -1,37 +0,0 @@
1
- import * as D from './decisions.ts';
2
- import type { Profile } from './profiles.ts';
3
- import type { All, Message } from '../protocol/index.ts';
4
- export type RoomModel = {
5
- name: string;
6
- genesis: string;
7
- profile: Profile;
8
- members: Record<string, unknown>;
9
- authorityAt: D.AuthorityAt;
10
- };
11
- export type SignalRecord = {
12
- ref: string;
13
- object: string;
14
- name: string;
15
- actor: string;
16
- target: string;
17
- tagger: string;
18
- text: string;
19
- };
20
- export declare const MARKS: string[];
21
- export declare const signalName: (id: string, signal: string) => string;
22
- export declare const markWhy: (R: RoomModel, actor: string, m: Message, mark: string) => string | undefined;
23
- export declare const marksOn: (checked: Checked[]) => Map<string, Record<string, string[]>>;
24
- export declare const effective: (R: RoomModel, all: All, m: Message) => string[];
25
- export type Checked = {
26
- ref: string;
27
- actor: string;
28
- signal: string;
29
- target: string;
30
- ok: boolean;
31
- why?: string;
32
- };
33
- export declare const check: (R: RoomModel, all: All, records: SignalRecord[]) => Checked[];
34
- export declare const pins: (records: SignalRecord[], checked: Checked[], accepted?: Record<string, string>) => {
35
- accepted: Record<string, string>;
36
- alarms: string[];
37
- };
@@ -1,15 +0,0 @@
1
- export declare const SUPPORTED: boolean;
2
- export declare const alive: (pid: number) => boolean;
3
- export declare const seconds: (time: string) => number;
4
- export declare const procStat: (line: string) => {
5
- ppid: number;
6
- cpu: number;
7
- } | null;
8
- export declare const table: () => Map<number, {
9
- ppid: number;
10
- cpu: number;
11
- }> | null;
12
- export declare const treeCpu: (pid: number, rows?: Map<number, {
13
- ppid: number;
14
- cpu: number;
15
- }> | null) => number | null;
@@ -1,11 +0,0 @@
1
- export declare const toolOf: (s: {
2
- handle: string;
3
- product: string | null;
4
- }) => {
5
- tool: 'claude' | 'codex';
6
- id: string;
7
- } | null;
8
- export declare const traceTime: (s: {
9
- handle: string;
10
- product: string | null;
11
- }) => number | null;
@@ -1,21 +0,0 @@
1
- export declare const ROOT: string;
2
- export declare const RESOURCES: string;
3
- export declare const VERSION: string;
4
- export declare const HOME: string;
5
- export declare const HOME_VERSION = 3;
6
- export declare const OPERATOR = "operator";
7
- export declare const guard: <T>(fn: () => T) => T;
8
- export declare const mkdir: (d: string) => void;
9
- export declare const writeJson: (f: string, v: unknown) => void;
10
- export declare const readJson: <T>(f: string, dflt: T) => T;
11
- export declare const hubsDir: () => string;
12
- export declare const hubHome: (name: string) => string;
13
- export declare const ensureHome: () => void;
14
- export declare const locked: <T>(name: string, fn: () => T) => T;
15
- export type Config = {
16
- hub: string;
17
- room: string | null;
18
- };
19
- export declare const configFile: () => string;
20
- export declare const config: () => Config;
21
- export declare const setConfig: (patch: Partial<Config>) => void;
@@ -1,72 +0,0 @@
1
- import * as D from '../domain/decisions.ts';
2
- import { OPERATOR } from '../home/index.ts';
3
- import type { Profile } from '../domain/profiles.ts';
4
- import { HIDDEN } from '../protocol/index.ts';
5
- import type { All, FileRef, Message } from '../protocol/index.ts';
6
- import type { Descriptor, Member, Rev, Store, StoredMessage, StoredRoom } from '../store/index.ts';
7
- import type { Entry } from '../protocol/files.ts';
8
- export declare const HUB_MAJOR = 1;
9
- export declare const CAPS: Set<string>;
10
- export declare const RESERVED_ROOMS: Set<string>;
11
- export type Contract = {
12
- schema: 'ringi-hub';
13
- version: string;
14
- protocol: number;
15
- trust: 'asserted' | 'signed';
16
- capabilities?: string[];
17
- profile?: string;
18
- root?: string;
19
- authority: D.Authority;
20
- };
21
- export type Hub = {
22
- name: string;
23
- dir: string;
24
- d: Descriptor;
25
- store: Store;
26
- main: Rev;
27
- contract: Contract;
28
- signed: boolean;
29
- };
30
- export type Room = {
31
- hub: Hub;
32
- s: StoredRoom;
33
- name: string;
34
- archived: boolean;
35
- head: Rev;
36
- genesis: Rev;
37
- contractRev: Rev;
38
- contract: Contract;
39
- authorityAt: D.AuthorityAt;
40
- profile: Profile;
41
- members: Record<string, Member>;
42
- quorum: number | null;
43
- };
44
- export declare const start: (R: Pick<Room, 'members' | 'quorum'>) => {
45
- quorum: number | null;
46
- agents: number;
47
- started: boolean;
48
- };
49
- export declare const hubNames: () => string[];
50
- export declare const createHub: (name: string, { signed, url }?: {
51
- signed?: boolean;
52
- url?: string;
53
- }) => void;
54
- export declare const readDescriptor: (name: string) => Descriptor;
55
- export declare const contractAt: (store: Store, name: string, rev: Rev) => Contract;
56
- export declare const openHub: (name: string, { refresh }?: {
57
- refresh?: boolean;
58
- }) => Hub;
59
- export declare const roomNames: (H: Hub, archived?: boolean) => string[];
60
- export declare const openRoom: (H: Hub, name: string | null | undefined, { quiet }?: {
61
- quiet?: boolean;
62
- }) => Room | null;
63
- export declare const room: (H: Hub, name: string | null | undefined) => Room;
64
- export declare const ROOM_MD: (name: string) => string;
65
- export declare const profileText: (H: Hub, name: string) => string | null;
66
- export declare const controlChange: (R: Room, who: string, subject: string, mutate: (m: Record<string, Member>) => void, extra?: Array<[string, string]>) => void;
67
- export declare const toMessage: (R: Room, from: string, x: StoredMessage, seq: number) => Message;
68
- export declare const asStored: (R: Room) => All;
69
- export declare const append: (R: Room, who: string, text: string, entries?: Entry[]) => Rev;
70
- export declare const withSizes: (R: Room, m: Message) => FileRef[];
71
- export declare const pongText: (me: string, m: Message, what: string) => string;
72
- export { OPERATOR, HIDDEN };
@@ -1,17 +0,0 @@
1
- import type { Room } from '../hub/index.ts';
2
- export type WatchOptions = {
3
- seat: string;
4
- exec: string;
5
- hub?: string;
6
- scope?: string;
7
- handoff?: boolean;
8
- once?: boolean;
9
- requireGrant?: boolean;
10
- interval?: number;
11
- from?: string[];
12
- maxHop?: number;
13
- maxRuns?: number;
14
- window?: number;
15
- };
16
- export declare const watch: (w: WatchOptions, log?: (line: string) => void) => Promise<number>;
17
- export type { Room };
@@ -1,92 +0,0 @@
1
- import * as Remote from './remote.ts';
2
- import type { Descriptor, JoinKey, Roster, SignalRecord, Store, StoredMessage, StoredRoom } from '../index.ts';
3
- import type { Entry } from '../../protocol/files.ts';
4
- type GitOpt = {
5
- input?: string | Buffer;
6
- env?: Record<string, string>;
7
- where?: string;
8
- };
9
- export declare const runGit: (args: string[], o?: GitOpt) => string;
10
- export declare class GitStore implements Store {
11
- readonly type = "git";
12
- readonly trust: 'asserted' | 'signed';
13
- readonly dir: string;
14
- readonly d: Descriptor;
15
- readonly home: string;
16
- readonly h: Remote.Handle;
17
- constructor(hubDir: string, d: Descriptor, home: string);
18
- private openable;
19
- private checkout;
20
- private args;
21
- private git;
22
- private gitOk;
23
- rev(ref: string): string | null;
24
- isAncestor(a: string, b: string): boolean;
25
- isRef(s: string): boolean;
26
- extends(older: string, newer: string): boolean;
27
- private tree;
28
- private commit;
29
- private advance;
30
- static create(hubDir: string, d: Descriptor, home: string, contract: Record<string, string>, text: string): GitStore;
31
- static rootFor(hubDir: string, d: Descriptor, home: string): string;
32
- sync(): void;
33
- contractHead(): string;
34
- contractFile(rev: string, name: string): string | null;
35
- contractFiles(rev: string): string[];
36
- amendContract(who: string, text: string, files: Record<string, string | Buffer>): string;
37
- private ref;
38
- private transition;
39
- private tip;
40
- roomNames(archived: boolean): string[];
41
- private isControl;
42
- private scanned;
43
- private entries;
44
- private judged;
45
- private scan;
46
- room(name: string): StoredRoom | null;
47
- controlFile(room: StoredRoom, name: string, rev?: string): string | null;
48
- createRoom(name: string, who: string, text: string, files: Record<string, string>): string;
49
- migrateRoom(name: string): string;
50
- private migrateSignals;
51
- updateControl(room: StoredRoom, who: string, text: string, files: Record<string, string>): string;
52
- private refsUnder;
53
- archiveRoom(room: StoredRoom, as: string): void;
54
- deleteRoom(room: StoredRoom): void;
55
- private remote;
56
- roster(room: StoredRoom): Roster | null;
57
- private live;
58
- alarms(room: StoredRoom): string[];
59
- logIds(room: StoredRoom): string[];
60
- logHead(room: StoredRoom, id: string): string | null;
61
- messages(room: StoredRoom, id: string, head: string): StoredMessage[];
62
- blob(file: string): {
63
- id: string;
64
- size: number;
65
- };
66
- retain(room: StoredRoom, who: string, entries: Entry[]): void;
67
- append(room: StoredRoom, who: string, text: string, entries: Entry[]): string;
68
- private onTop;
69
- verifyLog(room: StoredRoom, id: string, head: string): string | null;
70
- pin(room: StoredRoom, reader: string, id: string, rev: string): void;
71
- unpin(room: StoredRoom, reader: string, id: string): void;
72
- file(rev: string, p: string): Buffer;
73
- sizes(rev: string, paths: string[]): Map<string, number>;
74
- heartbeat(room: StoredRoom, who: string, target: string, text: string): string;
75
- heartbeats(room: StoredRoom): Array<{
76
- agent: string;
77
- target: string;
78
- time: number;
79
- text: string;
80
- }>;
81
- signal(room: StoredRoom, who: string, target: string, name: string): void;
82
- private tags;
83
- private tagObjects;
84
- private commitsOf;
85
- signals(room: StoredRoom): SignalRecord[];
86
- admit(room: StoredRoom, who: string, key: string): string;
87
- joinKey(room: StoredRoom, who: string): JoinKey;
88
- forgetLog(room: StoredRoom, _id: string): void;
89
- rootKey(): string;
90
- rootRoster(): string;
91
- }
92
- export {};
@@ -1,95 +0,0 @@
1
- import * as C from '../../lib/index.ts';
2
- import type { Descriptor, Member } from '../index.ts';
3
- export type Handle = {
4
- name: string;
5
- dir: string;
6
- d: Descriptor;
7
- main?: string;
8
- remoteAlarms?: Record<string, string>;
9
- heartbeatErrors?: Record<string, string>;
10
- bootstrap?: boolean;
11
- };
12
- export type Room = {
13
- name: string;
14
- ref: string;
15
- head: string;
16
- genesis: string;
17
- archived?: boolean;
18
- members?: Record<string, Member>;
19
- };
20
- type Key = {
21
- line: string;
22
- fp: string;
23
- };
24
- type Signer = {
25
- principal: string;
26
- key: Key;
27
- };
28
- type VerifiedRoom = {
29
- genesis: string;
30
- entries: Signer[];
31
- members: Record<string, Member>;
32
- };
33
- export type Branch = VerifiedRoom & {
34
- subject: string;
35
- control: string[];
36
- authors: Map<string, string>;
37
- skipped: Map<string, string>;
38
- };
39
- export declare const withVerification: <T>(H: Handle, fn: () => T) => T;
40
- declare const strictJson: typeof C.strictJson;
41
- export { strictJson };
42
- export declare const gitEnv: (extra?: NodeJS.ProcessEnv) => NodeJS.ProcessEnv;
43
- export declare const gitTimeout: () => number;
44
- export declare const checkGitTimeout: (error?: NodeJS.ErrnoException) => void;
45
- export declare const isRemote: (H: Handle) => boolean;
46
- export declare const parseKey: (value: unknown) => Key;
47
- export declare const setupSigned: (H: Handle, home: string, url?: string) => {
48
- root: string;
49
- allowedSigners: string;
50
- };
51
- export declare const sign: (H: Handle, who: string, home: string) => string[];
52
- export declare const rootRoster: (H: Handle) => string;
53
- export declare const verifyHub: (H: Handle) => {
54
- head: string;
55
- genesis: string;
56
- commits: string[];
57
- } | null;
58
- type Raw = {
59
- sha: string;
60
- parents: string[];
61
- author: string;
62
- text: string;
63
- body: Buffer;
64
- };
65
- export declare const readCommits: (H: Handle, shas: string[]) => Raw[];
66
- export declare const branch: (H: Handle, R: Pick<Room, 'name' | 'ref' | 'genesis'>, tip: string) => Branch;
67
- export declare const verifyRoom: (H: Handle, R: Room) => VerifiedRoom;
68
- export declare const verify: (H: Handle, R: Room, who: string, head: string) => string | null;
69
- export declare const heartbeatName: (ref: string) => {
70
- actor: string;
71
- genesis12: string;
72
- } | null;
73
- export declare const heartbeatRef: (who: string, genesis: string) => string;
74
- export declare const verifyHeartbeat: (H: Handle, R: Room, ref: string, sha: string) => string | null;
75
- export declare const makeHeartbeat: (H: Handle, R: Room, who: string, target: string, text: string, home: string) => string;
76
- export declare const verifySignal: (H: Handle, R: Room, ref: string, sha: string) => string | null;
77
- export declare const sync: (H: Handle) => Handle;
78
- export declare const hubAdd: ({ home, name, url, root, genesis }: {
79
- home: string;
80
- name: string;
81
- url: string;
82
- root?: string;
83
- genesis?: string;
84
- }) => string;
85
- export declare const join: (H: Handle, R: Room, who: string, home: string) => {
86
- publicKey: string;
87
- fingerprint: string;
88
- admitted: boolean;
89
- };
90
- export declare const roomAdmit: (H: Handle, R: Room, who: string, publicKey: string, home: string) => string;
91
- export declare const push: (H: Handle, ref: string, { behind }?: {
92
- behind?: boolean;
93
- }) => boolean;
94
- export declare const pushHeartbeat: (H: Handle, R: Room, who: string, sha: string, expected: string | null) => boolean;
95
- export declare const forget: (H: Handle, R: Room) => void;
@@ -1,2 +0,0 @@
1
- import type { StoreFactory } from '../index.ts';
2
- export declare const kafka: StoreFactory;
@@ -1,2 +0,0 @@
1
- import type { StoreFactory } from '../index.ts';
2
- export declare const temporal: StoreFactory;
@@ -1,95 +0,0 @@
1
- // budget: proposals, reviewers' stamps, the decider's decision, and the grants it makes (decisions/1). Each operation
2
- // takes who acts and typed input, and returns data; interfaces print it.
3
- import * as D from '../domain/decisions.js';
4
- import { OPERATOR, locked } from '../home/index.js';
5
- import { append } from '../hub/index.js';
6
- import { fail, note, short } from '../lib/index.js';
7
- import { ID_RE, checkOutgoing, compose, lookup } from '../protocol/index.js';
8
- import { linked } from '../runtime/reader.js';
9
- import { isRef } from './room.js';
10
- import { grantView, proposalView } from './view.js';
11
- export const propose = ({ R, me }, x) => {
12
- const { all } = linked(R, me);
13
- if (!ID_RE.test(x.decider))
14
- fail(`bad decider ${x.decider}`);
15
- const reviewers = [...new Set(x.reviewers ?? [])].filter(r => r !== me);
16
- for (const r of reviewers)
17
- if (!ID_RE.test(r))
18
- fail(`bad reviewer ${r}`);
19
- const budget = x.budget ? D.parseBudget(x.budget) ?? fail('--budget takes runs=<n>[, run-seconds=<n>][, concurrency=<n>]') : null;
20
- const sup = x.supersedes ? lookup(all, x.supersedes) : null;
21
- if (sup && (sup.kind !== 'proposal' || (sup.from !== me && me !== OPERATOR)))
22
- fail(`${short(sup.id)} is not your proposal`);
23
- if (budget && !D.mayDecide(R.contract.authority, x.decider, me, budget))
24
- note(`${x.decider} has no authority for this budget in hub ${R.hub.name}; only operator could approve it`);
25
- const to = [...new Set([...reviewers, x.decider])].filter(t => t !== me);
26
- const text = compose(x.text, [['To', to.join(', ') || '*'], ['Kind', 'proposal'], ['Decider', x.decider], ['Reviewers', reviewers.join(', ')],
27
- ['Due', x.due && D.parseDue(x.due)], ['Budget', budget && D.budgetText(budget)], ['Supersedes', sup?.id]]);
28
- const bad = D.check(checkOutgoing(text, isRef(R)), isRef(R));
29
- if (bad)
30
- fail(`refusing to send: ${bad}`);
31
- return { id: append(R, me, text, x.files ?? []), to, budget };
32
- };
33
- const proposalAt = (all, ref) => {
34
- const p = lookup(all, ref);
35
- if (p.kind !== 'proposal' || p.bad)
36
- fail(`${short(p.id)} is not a proposal`);
37
- return p;
38
- };
39
- export const stamp = ({ R, me }, ref, s, text) => {
40
- const { all } = linked(R, me);
41
- const p = proposalAt(all, ref);
42
- if (!D.STAMPS.includes(s))
43
- fail(`usage: stamp <proposal> ${D.STAMPS.join('|')} -m <reason>`);
44
- const info = D.proposalOf(all, p, R.authorityAt);
45
- if (!info.reviewers.includes(me))
46
- fail(`you are not a named reviewer of ${short(p.id)} (reviewers: ${info.reviewers.join(', ') || 'none'})`);
47
- if (info.decision)
48
- fail(`${short(p.id)} is already ${info.decision.decision}`);
49
- const out = compose(text, [['To', [...new Set([p.from, info.decider])].filter(x => x !== me).join(', ') || p.from], ['Re', p.id], ['Kind', 'stamp'], ['Stamp', s], ['Hop', String(p.hopEff + 1)]]);
50
- checkOutgoing(out, isRef(R));
51
- return { proposal: p, id: append(R, me, out) };
52
- };
53
- // The decision names the control entry, and so the authority, it was made under (decisions/1).
54
- export const decide = ({ R, me }, ref, d, text) => locked(`grant-${R.hub.name}`, () => {
55
- const { all } = linked(R, me);
56
- const p = proposalAt(all, ref);
57
- if (!D.DECISIONS.includes(d))
58
- fail(`usage: decide <proposal> ${D.DECISIONS.join('|')} -m <reason>`);
59
- const info = D.proposalOf(all, p, R.authorityAt);
60
- if (d === 'revoked') {
61
- if (info.state !== 'approved')
62
- fail(`${short(p.id)} is ${info.state}; only an approval can be revoked`);
63
- if (me !== info.decider && me !== OPERATOR)
64
- fail(`only ${info.decider} or the operator revokes it`);
65
- }
66
- else {
67
- if (me !== info.decider)
68
- fail(`only the named decider, ${info.decider}, decides ${short(p.id)}`);
69
- if (!D.mayDecide(R.contract.authority, me, p.from, info.budget))
70
- fail(`${me} has no authority to decide this${info.budget ? ` budget (${D.budgetText(info.budget)})` : ''} in hub ${R.hub.name}, or it is your own proposal`);
71
- if (info.decision)
72
- fail(`${short(p.id)} is already ${info.decision.decision}`);
73
- if (info.superseded)
74
- fail(`${short(p.id)} was superseded by ${short(info.superseded.id)}; decide that revision`);
75
- }
76
- const to = [...new Set([p.from, ...info.reviewers])].filter(x => x !== me);
77
- const out = compose(text, [['To', to.join(', ') || '*'], ['Re', p.id], ['Kind', 'decision'], ['Decision', d], ['Control', R.head], ['Hop', String(p.hopEff + 1)]]);
78
- checkOutgoing(out, isRef(R));
79
- const id = append(R, me, out);
80
- if (d === 'approved' && info.missing.length)
81
- note(`decided without stamps from ${info.missing.join(', ')}`);
82
- return { proposal: p, id, budget: d === 'approved' ? info.budget : null };
83
- });
84
- // Open proposals (with `all`, every one).
85
- export const proposals = ({ R, me }, { all: everything = false } = {}) => {
86
- const { all } = linked(R, me);
87
- const ps = D.proposals(all, R.authorityAt).filter(x => everything || ['open', 'overdue'].includes(x.state));
88
- return { proposals: ps, views: ps.map(proposalView) };
89
- };
90
- export const grants = ({ R, me }) => {
91
- const { all } = linked(R, me);
92
- return D.proposals(all, R.authorityAt).filter(x => x.grant).map(x => grantView(x, D.usageOf(all, x.grant)));
93
- };
94
- export { DECISIONS, STAMPS, budgetText } from '../domain/decisions.js';
95
- //# sourceMappingURL=budget.js.map
@@ -1,16 +0,0 @@
1
- // context: who acts and where, as an interface asks for it (the operator in its terminal context, an agent through its
2
- // session's binding), and what this build is.
3
- import { HOME, OPERATOR, RESOURCES, VERSION, config } from '../home/index.js';
4
- import { CAPS, HUB_MAJOR, openHub, room as roomOf } from '../hub/index.js';
5
- import { bound } from '../runtime/session.js';
6
- // The operator, in the named hub and room, else in the terminal's current ones.
7
- export const operator = ({ hub, room } = {}) => {
8
- const H = openHub(hub ?? config().hub);
9
- const name = room ?? (hub && hub !== config().hub ? null : config().room);
10
- return { R: roomOf(H, name), me: OPERATOR };
11
- };
12
- // The agent this session is bound to; refuses when it is not joined, is stopped, or its room is gone.
13
- export const agent = () => bound();
14
- export const about = () => ({ version: VERSION, home: HOME, resources: RESOURCES, contract: `${HUB_MAJOR}.x`, capabilities: [...CAPS] });
15
- export { config };
16
- //# sourceMappingURL=context.js.map