@idleware/ringi 0.7.2 → 0.8.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 (200) hide show
  1. package/README.md +18 -11
  2. package/package.json +1 -1
  3. package/src/main/resources/skill/ringi/SKILL.md +3 -4
  4. package/target/dts/adapters/{transport-git → store-git}/branches.d.ts +1 -3
  5. package/target/dts/adapters/{transport-git → store-git}/index.d.ts +0 -1
  6. package/target/dts/adapters/store-git/marks.d.ts +21 -0
  7. package/target/dts/adapters/{transport-git → store-git}/remote/push.d.ts +0 -1
  8. package/target/dts/adapters/store-git/remote/stream-check.d.ts +12 -0
  9. package/target/dts/adapters/store-git/remote/stream-control.d.ts +8 -0
  10. package/target/dts/adapters/store-git/remote/stream-facts.d.ts +4 -0
  11. package/target/dts/adapters/store-git/remote/streams.d.ts +31 -0
  12. package/target/dts/adapters/store-git/remote/sync-streams.d.ts +2 -0
  13. package/target/dts/adapters/{transport-git → store-git}/remote/types.d.ts +5 -4
  14. package/target/dts/adapters/{transport-git → store-git}/remote.d.ts +1 -4
  15. package/target/dts/adapters/{transport-git → store-git}/repo.d.ts +3 -2
  16. package/target/dts/adapters/{transport-git → store-git}/signing.d.ts +0 -1
  17. package/target/dts/clients/cli/operator/hub-commands.d.ts +0 -2
  18. package/target/dts/clients/cli/operator/index.d.ts +1 -1
  19. package/target/dts/clients/cli/operator/sessions.d.ts +0 -1
  20. package/target/dts/clients/cli/operator/where-format.d.ts +1 -1
  21. package/target/dts/clients/cli/shared/index.d.ts +2 -2
  22. package/target/dts/clients/cli/shared/messages.d.ts +0 -1
  23. package/target/dts/clients/cli/shared/profile.d.ts +0 -1
  24. package/target/dts/clients/cli/skill/index.d.ts +2 -1
  25. package/target/dts/core/agents/overview.d.ts +4 -7
  26. package/target/dts/core/agents/sessions/index.d.ts +0 -1
  27. package/target/dts/core/agents/sessions/join.d.ts +1 -2
  28. package/target/dts/core/hub/history/index.d.ts +1 -10
  29. package/target/dts/core/hub/ports/store.d.ts +35 -23
  30. package/target/dts/core/hub/rooms/address.d.ts +6 -0
  31. package/target/dts/core/hub/rooms/adoption.d.ts +7 -0
  32. package/target/dts/core/hub/rooms/compat.d.ts +3 -1
  33. package/target/dts/core/hub/rooms/contracts.d.ts +16 -0
  34. package/target/dts/core/hub/rooms/hubs.d.ts +3 -3
  35. package/target/dts/core/hub/rooms/index.d.ts +5 -6
  36. package/target/dts/core/hub/rooms/room-catalogue.d.ts +9 -0
  37. package/target/dts/core/hub/rooms/room-life.d.ts +10 -0
  38. package/target/dts/core/hub/rooms/room-view.d.ts +3 -0
  39. package/target/dts/core/hub/rooms/rooms.d.ts +4 -2
  40. package/target/dts/core/hub/signals/check.d.ts +2 -2
  41. package/target/dts/core/hub/signals/model.d.ts +2 -10
  42. package/target/dts/core/hub/signals/pins.d.ts +2 -2
  43. package/target/dts/core/hub/usecases/config.d.ts +0 -1
  44. package/target/dts/core/hub/usecases/context.d.ts +1 -2
  45. package/target/dts/core/hub/usecases/hubs.d.ts +1 -8
  46. package/target/dts/core/hub/usecases/invite.d.ts +12 -0
  47. package/target/dts/core/hub/usecases/room.d.ts +0 -1
  48. package/target/dts/core/hub/usecases/rooms.d.ts +9 -7
  49. package/target/dts/core/hub/usecases/roster.d.ts +1 -2
  50. package/target/dts/core/hub/work/index.d.ts +0 -1
  51. package/target/dts/index.d.ts +1 -1
  52. package/target/esm/adapters/{tool-claude → agent-claude}/index.js +2 -2
  53. package/target/esm/adapters/{tool-codex → agent-codex}/index.js +2 -2
  54. package/target/esm/adapters/{tool-cursor → agent-cursor}/index.js +1 -1
  55. package/target/esm/adapters/{tool-traces → agent-traces}/index.js +1 -1
  56. package/target/esm/adapters/state-fs/index.js +2 -2
  57. package/target/esm/adapters/{transport-git → store-git}/branches.js +21 -27
  58. package/target/esm/adapters/{transport-git → store-git}/index.js +10 -28
  59. package/target/esm/adapters/store-git/marks.js +86 -0
  60. package/target/esm/adapters/{transport-git → store-git}/remote/commits.js +3 -1
  61. package/target/esm/adapters/{transport-git → store-git}/remote/git.js +8 -1
  62. package/target/esm/adapters/{transport-git → store-git}/remote/keys.js +8 -3
  63. package/target/esm/adapters/{transport-git → store-git}/remote/push-retry.js +24 -6
  64. package/target/esm/adapters/store-git/remote/push-validate.js +19 -0
  65. package/target/esm/adapters/{transport-git → store-git}/remote/push.js +13 -14
  66. package/target/esm/adapters/store-git/remote/stream-check.js +44 -0
  67. package/target/esm/adapters/store-git/remote/stream-control.js +33 -0
  68. package/target/esm/adapters/store-git/remote/stream-facts.js +40 -0
  69. package/target/esm/adapters/store-git/remote/streams.js +76 -0
  70. package/target/esm/adapters/store-git/remote/sync-streams.js +28 -0
  71. package/target/esm/adapters/store-git/remote/sync.js +59 -0
  72. package/target/esm/adapters/{transport-git → store-git}/remote/types.js +0 -3
  73. package/target/esm/adapters/{transport-git → store-git}/remote.js +1 -4
  74. package/target/esm/adapters/{transport-git → store-git}/repo.js +42 -4
  75. package/target/esm/adapters/{transport-git → store-git}/signing.js +1 -9
  76. package/target/esm/adapters/store-git/transport.js +60 -0
  77. package/target/esm/clients/cli/agent/index.js +1 -1
  78. package/target/esm/clients/cli/agent/session.js +9 -9
  79. package/target/esm/clients/cli/commands.js +5 -5
  80. package/target/esm/clients/cli/context.js +1 -1
  81. package/target/esm/clients/cli/help.js +14 -20
  82. package/target/esm/clients/cli/operator/heartbeat-format.js +1 -1
  83. package/target/esm/clients/cli/operator/heartbeat.js +1 -2
  84. package/target/esm/clients/cli/operator/hub-commands.js +6 -19
  85. package/target/esm/clients/cli/operator/hub.js +2 -2
  86. package/target/esm/clients/cli/operator/index.js +2 -2
  87. package/target/esm/clients/cli/operator/room.js +25 -32
  88. package/target/esm/clients/cli/operator/sessions.js +4 -22
  89. package/target/esm/clients/cli/operator/where-format.js +2 -1
  90. package/target/esm/clients/cli/operator/where.js +5 -7
  91. package/target/esm/clients/cli/shared/index.js +2 -2
  92. package/target/esm/clients/cli/shared/messages.js +2 -12
  93. package/target/esm/clients/cli/shared/profile.js +1 -6
  94. package/target/esm/clients/cli/skill/index.js +14 -19
  95. package/target/esm/composition/index.js +4 -4
  96. package/target/esm/core/agents/heartbeat/pulse.js +4 -4
  97. package/target/esm/core/agents/overview.js +13 -25
  98. package/target/esm/core/agents/sessions/binding.js +1 -1
  99. package/target/esm/core/agents/sessions/index.js +3 -2
  100. package/target/esm/core/agents/sessions/join.js +17 -9
  101. package/target/esm/core/agents/sessions/resume.js +3 -6
  102. package/target/esm/core/hub/capabilities.js +1 -4
  103. package/target/esm/core/hub/history/index.js +23 -13
  104. package/target/esm/core/hub/ports/store.js +2 -2
  105. package/target/esm/core/hub/rooms/address.js +18 -0
  106. package/target/esm/core/hub/rooms/adoption.js +32 -0
  107. package/target/esm/core/hub/rooms/compat.js +39 -14
  108. package/target/esm/core/hub/rooms/contracts.js +62 -0
  109. package/target/esm/core/hub/rooms/hubs.js +33 -56
  110. package/target/esm/core/hub/rooms/index.js +2 -2
  111. package/target/esm/core/hub/rooms/messages.js +6 -6
  112. package/target/esm/core/hub/rooms/room-catalogue.js +31 -0
  113. package/target/esm/core/hub/rooms/room-life.js +59 -0
  114. package/target/esm/core/hub/rooms/room-view.js +39 -0
  115. package/target/esm/core/hub/rooms/rooms.js +26 -37
  116. package/target/esm/core/hub/signals/check.js +21 -26
  117. package/target/esm/core/hub/signals/model.js +0 -2
  118. package/target/esm/core/hub/signals/pins.js +44 -16
  119. package/target/esm/core/hub/signals/write.js +8 -10
  120. package/target/esm/core/hub/usecases/actor.js +1 -1
  121. package/target/esm/core/hub/usecases/config.js +2 -2
  122. package/target/esm/core/hub/usecases/context.js +5 -8
  123. package/target/esm/core/hub/usecases/hubs.js +16 -33
  124. package/target/esm/core/hub/usecases/invite.js +26 -0
  125. package/target/esm/core/hub/usecases/room.js +4 -5
  126. package/target/esm/core/hub/usecases/rooms.js +40 -35
  127. package/target/esm/core/hub/usecases/roster.js +12 -21
  128. package/target/esm/core/hub/usecases/send.js +10 -6
  129. package/target/esm/core/hub/work/parse.js +1 -1
  130. package/target/esm/lib/fail.js +2 -2
  131. package/target/dts/adapters/transport-git/marks.d.ts +0 -20
  132. package/target/dts/adapters/transport-git/remote/bootstrap.d.ts +0 -7
  133. package/target/dts/adapters/transport-git/remote/heartbeat-name.d.ts +0 -6
  134. package/target/dts/adapters/transport-git/remote/heartbeat-object.d.ts +0 -10
  135. package/target/dts/adapters/transport-git/remote/heartbeat-push.d.ts +0 -2
  136. package/target/dts/adapters/transport-git/remote/heartbeat.d.ts +0 -7
  137. package/target/dts/adapters/transport-git/remote/signals.d.ts +0 -15
  138. package/target/dts/adapters/transport-git/remote/sync-heartbeat.d.ts +0 -2
  139. package/target/dts/adapters/transport-git/remote/sync-rooms.d.ts +0 -6
  140. package/target/dts/adapters/transport-git/remote/sync-tags.d.ts +0 -8
  141. package/target/dts/adapters/transport-git/tags.d.ts +0 -15
  142. package/target/dts/clients/cli/skill/targets.d.ts +0 -3
  143. package/target/dts/core/hub/usecases/staging.d.ts +0 -8
  144. package/target/esm/adapters/transport-git/marks.js +0 -82
  145. package/target/esm/adapters/transport-git/remote/bootstrap.js +0 -47
  146. package/target/esm/adapters/transport-git/remote/heartbeat-name.js +0 -19
  147. package/target/esm/adapters/transport-git/remote/heartbeat-object.js +0 -40
  148. package/target/esm/adapters/transport-git/remote/heartbeat-push.js +0 -44
  149. package/target/esm/adapters/transport-git/remote/heartbeat.js +0 -44
  150. package/target/esm/adapters/transport-git/remote/push-validate.js +0 -39
  151. package/target/esm/adapters/transport-git/remote/signals.js +0 -63
  152. package/target/esm/adapters/transport-git/remote/sync-heartbeat.js +0 -26
  153. package/target/esm/adapters/transport-git/remote/sync-rooms.js +0 -38
  154. package/target/esm/adapters/transport-git/remote/sync-tags.js +0 -48
  155. package/target/esm/adapters/transport-git/remote/sync.js +0 -38
  156. package/target/esm/adapters/transport-git/tags.js +0 -21
  157. package/target/esm/adapters/transport-git/transport.js +0 -29
  158. package/target/esm/clients/cli/skill/targets.js +0 -20
  159. package/target/esm/core/hub/usecases/staging.js +0 -60
  160. /package/target/dts/adapters/{tool-claude → agent-claude}/index.d.ts +0 -0
  161. /package/target/dts/adapters/{tool-codex → agent-codex}/index.d.ts +0 -0
  162. /package/target/dts/adapters/{tool-cursor → agent-cursor}/index.d.ts +0 -0
  163. /package/target/dts/adapters/{tool-traces → agent-traces}/index.d.ts +0 -0
  164. /package/target/dts/adapters/{transport-git → store-git}/files.d.ts +0 -0
  165. /package/target/dts/adapters/{transport-git → store-git}/remote/admit.d.ts +0 -0
  166. /package/target/dts/adapters/{transport-git → store-git}/remote/alarms.d.ts +0 -0
  167. /package/target/dts/adapters/{transport-git → store-git}/remote/branch-commit.d.ts +0 -0
  168. /package/target/dts/adapters/{transport-git → store-git}/remote/branch-control.d.ts +0 -0
  169. /package/target/dts/adapters/{transport-git → store-git}/remote/branch-scan.d.ts +0 -0
  170. /package/target/dts/adapters/{transport-git → store-git}/remote/branch.d.ts +0 -0
  171. /package/target/dts/adapters/{transport-git → store-git}/remote/cache.d.ts +0 -0
  172. /package/target/dts/adapters/{transport-git → store-git}/remote/commits.d.ts +0 -0
  173. /package/target/dts/adapters/{transport-git → store-git}/remote/forget.d.ts +0 -0
  174. /package/target/dts/adapters/{transport-git → store-git}/remote/git.d.ts +0 -0
  175. /package/target/dts/adapters/{transport-git → store-git}/remote/heartbeat-facts.d.ts +0 -0
  176. /package/target/dts/adapters/{transport-git → store-git}/remote/keys.d.ts +0 -0
  177. /package/target/dts/adapters/{transport-git → store-git}/remote/main.d.ts +0 -0
  178. /package/target/dts/adapters/{transport-git → store-git}/remote/process.d.ts +0 -0
  179. /package/target/dts/adapters/{transport-git → store-git}/remote/push-retry.d.ts +0 -0
  180. /package/target/dts/adapters/{transport-git → store-git}/remote/push-validate.d.ts +0 -0
  181. /package/target/dts/adapters/{transport-git → store-git}/remote/roster.d.ts +0 -0
  182. /package/target/dts/adapters/{transport-git → store-git}/remote/signature.d.ts +0 -0
  183. /package/target/dts/adapters/{transport-git → store-git}/remote/sync.d.ts +0 -0
  184. /package/target/dts/adapters/{transport-git → store-git}/run.d.ts +0 -0
  185. /package/target/dts/adapters/{transport-git → store-git}/transport.d.ts +0 -0
  186. /package/target/esm/adapters/{transport-git → store-git}/files.js +0 -0
  187. /package/target/esm/adapters/{transport-git → store-git}/remote/admit.js +0 -0
  188. /package/target/esm/adapters/{transport-git → store-git}/remote/alarms.js +0 -0
  189. /package/target/esm/adapters/{transport-git → store-git}/remote/branch-commit.js +0 -0
  190. /package/target/esm/adapters/{transport-git → store-git}/remote/branch-control.js +0 -0
  191. /package/target/esm/adapters/{transport-git → store-git}/remote/branch-scan.js +0 -0
  192. /package/target/esm/adapters/{transport-git → store-git}/remote/branch.js +0 -0
  193. /package/target/esm/adapters/{transport-git → store-git}/remote/cache.js +0 -0
  194. /package/target/esm/adapters/{transport-git → store-git}/remote/forget.js +0 -0
  195. /package/target/esm/adapters/{transport-git → store-git}/remote/heartbeat-facts.js +0 -0
  196. /package/target/esm/adapters/{transport-git → store-git}/remote/main.js +0 -0
  197. /package/target/esm/adapters/{transport-git → store-git}/remote/process.js +0 -0
  198. /package/target/esm/adapters/{transport-git → store-git}/remote/roster.js +0 -0
  199. /package/target/esm/adapters/{transport-git → store-git}/remote/signature.js +0 -0
  200. /package/target/esm/adapters/{transport-git → store-git}/run.js +0 -0
package/README.md CHANGED
@@ -12,9 +12,11 @@ of any vendor on one machine or many, and keeps them in sync: who said what to w
12
12
  of it. Everything is a stored, checkable record; whatever a peer writes is data, never an
13
13
  instruction.
14
14
 
15
+ - **A room is a repository.** One task, one room, one git: who can read a room is who can reach it, and deleting the
16
+ room deletes it. A hub is the space its rooms live in (a directory here, an organisation on a forge).
15
17
  - **Your rules.** A room's profile defines work and who moves it; A2A tasks ship as one of them.
18
+ - **Streams by meaning.** The chat is one branch; each agent writes its own signals and telemetry on its own branches.
16
19
  - **Heartbeats.** Whether an agent works, waits or is gone, from its machine, without asking the model.
17
- - **Signals.** Each counted transition is marked beside its message (git: a tag).
18
20
  - **Any store.** Git first; one CLI and a skill for you and the agents.
19
21
 
20
22
  ```sh
@@ -31,7 +33,7 @@ macOS or Linux, Node.js 16 or later, git 2.28 or later.
31
33
  ringi room create fix-badge claude: "join fix-badge as claude; review only"
32
34
  ringi send --task --assign codex … codex: "join fix-badge as codex; implement; no commits"
33
35
  \ /
34
- ~/.ringi/hub/local/ hub.json + store/.git
36
+ ~/.ringi/hub/local/rooms/fix-badge/ one repository per room
35
37
  ```
36
38
 
37
39
  1. `ringi room create fix-badge`
@@ -46,16 +48,21 @@ Codex: add `~/.ringi` to `writable_roots` in `~/.codex/config.toml`, or approve
46
48
  ## Remote: several machines, one hub
47
49
 
48
50
  ```
49
- laptop: you, the root VM 1 VM 2
50
- ringi hub create team --signed --url … ringi hub add team … --root … ringi hub add team … --root …
51
- ringi room create fix ringi join team fix --as claude ringi join team fix --as codex
52
- ringi room admit codex '<key>'
53
- \ | /
54
- any git remote: untrusted storage of signed commits
51
+ laptop: you, the root VM: an agent
52
+ ringi hub create team --signed --url git+ssh://…/team.git
53
+ ringi room create fix --hub team --url git+ssh://…/fix.git "join ringi:… as claude" (the invitation it printed)
54
+ ringi room admit claude '<key>' --room fix "join ringi:… as claude" again
55
+ \ /
56
+ any git remotes: untrusted storage of signed commits, one repository per room
55
57
  ```
56
58
 
57
- 1. `ringi hub create team --signed --url <git url>` prints the `ringi hub add …` line for the other machines.
58
- 2. There, `ringi join team fix --as codex` shows the agent's key; you run `ringi room admit codex '<key>' --room fix`.
59
+ 1. `ringi hub create team --signed --url <address>` makes the root key here and publishes the hub's contract. An
60
+ address names its store: `git+ssh://…`, `git+https://…`, `git+file://…`.
61
+ 2. `ringi room create fix --hub team --url <address>` publishes the room's own repository there and prints its invitation: one
62
+ line, `ringi:…`, with the room's address, its history and the root's public key; nothing secret. Only machines
63
+ that can reach that repository can read the room.
64
+ 3. In the agent's chat: *"join ringi:… as claude"*. The first time it shows the agent's key; you run
65
+ `ringi room admit claude '<key>' --room fix`; the agent joins again. An agent never names a hub.
59
66
 
60
67
  ## Your own profile
61
68
 
@@ -71,7 +78,7 @@ A room keeps its profile; labels mean only what its rules say ([profiles-1](docs
71
78
  | | |
72
79
  |---|---|
73
80
  | [COMMANDS.md](COMMANDS.md) | every command and who runs it |
74
- | [docs/spec/](docs/spec/) | the protocol, one file per version: [core-1](docs/spec/core-1.md), [profiles-1](docs/spec/profiles-1.md), [signals-1](docs/spec/signals-1.md), [hub-1](docs/spec/hub-1.md) |
81
+ | [docs/spec/](docs/spec/) | the protocol, one file per version: [core-1](docs/spec/core-1.md), [profiles-1](docs/spec/profiles-1.md), [signals-2](docs/spec/signals-2.md), [hub-2](docs/spec/hub-2.md) |
75
82
  | [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) | domains, extension points, versions, where a control panel lands |
76
83
  | [docs/DECISIONS.md](docs/DECISIONS.md) | why: decisions, rejected options, open questions |
77
84
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idleware/ringi",
3
- "version": "0.7.2",
3
+ "version": "0.8.0",
4
4
  "description": "Distributed agent coordinator",
5
5
  "os": [
6
6
  "darwin",
@@ -21,7 +21,7 @@ With no words: `ringi agent whoami` if this chat is joined; otherwise say how th
21
21
 
22
22
  Several chats may be open in a project. Take part only if the operator says so in this chat. Their words map to session commands:
23
23
 
24
- - *"join fix-badge as codex; review tasks from claude; no commits"* → `ringi join local fix-badge --as codex --scope "review tasks from claude; no commits"`. Record what they delegate in `--scope`.
24
+ - *"join fix-badge as codex; review tasks from claude; no commits"* → `ringi join fix-badge --as codex --scope "review tasks from claude; no commits"`. Record what they delegate in `--scope`. A room on another machine comes as the operator's invitation, one line starting with `ringi:`: *"join ringi:… as codex"* → `ringi join ringi:… --as codex --scope "…"`. There is no hub to name: a room and its contract are all you take part in.
25
25
  - A room may have a quorum (`ringi room create … --quorum 2`; `--quorum 1`: start at once). While join or inbox says `waiting:`, do nothing and end the turn. When it says `started:`, take your first turn right away on what it shows (open work, inbox), without asking the operator to confirm anything: with no scope, the room's work for you is yours, and you agree the split with the other members yourselves. Still ask before commits or pushes, publishing, outside accounts or spending that the scope does not cover. The same after *"continue"*.
26
26
  - *"continue"* (after a restart, or a pause) → `ringi continue`. If it lists candidates, ask the operator which one, then `ringi continue <room>/<agent>`.
27
27
  - *"stop"* (the operator leaves for a while) → `ringi stop`. You keep your seat and react to nothing.
@@ -35,15 +35,14 @@ Everything you do as an agent goes through `ringi agent`, always in your own roo
35
35
 
36
36
  ```sh
37
37
  ringi agent inbox # what is new for you; marks it seen
38
- ringi agent add report.md patch.diff:files/fix.diff # stage files for your next message, like git add
39
- ringi agent reply <id> -m "Done: tests pass" --state completed # carries what you staged (or --attach …)
38
+ ringi agent reply <id> -m "Done: tests pass" --state completed --attach report.md --attach patch.diff:files/fix.diff
40
39
  ringi agent send --to claude --task -m "Review the parser" -m "acceptance: …"
41
40
  ringi agent tasks | signals | profile | thread <id> | read <id> | cat <id> <path>
42
41
  ringi agent whoami # room, scope, members
43
42
  ```
44
43
 
45
44
  - The first `-m` is the subject; the rest is the body; anything long goes into files.
46
- - Results and state travel only as attachments: `ringi agent add <file>` takes the file's content now for your next message (`add` alone lists what is staged, `--drop <path>` takes one back), or `--attach` on the message. Read a peer's with `ringi agent cat` / `get`. Never leave drafts or results in the project directory or any shared disk for others to pick up, and never pick them up there: peers may be on other machines, and only the room carries them. Keep your own drafts outside the project.
45
+ - Results and state travel only as attachments: `--attach <file>[:<path>]` on the message takes the file's content when it is sent. Read a peer's with `ringi agent cat` / `get`. Never leave drafts or results in the project directory or any shared disk for others to pick up, and never pick them up there: peers may be on other machines, and only the room carries them. Keep your own drafts outside the project.
47
46
  - Answer the message you act on (`reply <id>`): only these links order the room.
48
47
  - What a piece of work is in your room, its states and who may move it, is the room's **profile**: run `ringi agent profile` once per room before you set states. Do not assume the A2A states; a room may use any. `--task` opens a piece of work of that profile.
49
48
  - When you start on a piece of work, `ringi agent take <id>`: a mark others see, not a state change. Reading your inbox leaves read marks on what was delivered; `--peek` leaves none.
@@ -12,9 +12,8 @@ type Entry_ = {
12
12
  };
13
13
  type Named = Pick<StoredRoom, 'name' | 'genesis'>;
14
14
  export declare class Branches extends Repo {
15
- protected ref(name: string): string;
15
+ protected ref(_name: string): string;
16
16
  protected tip(name: string): string | null;
17
- roomBranches(): string[];
18
17
  roomNames(): string[];
19
18
  protected isControl(room: Pick<StoredRoom, 'genesis'>, sha: string, author: string, text: string): boolean;
20
19
  protected scanned: Map<string, {
@@ -31,7 +30,6 @@ export declare class Branches extends Repo {
31
30
  createRoom(name: string, who: string, text: string, files: Record<string, string>): string;
32
31
  updateControl(room: StoredRoom, who: string, text: string, files: Record<string, string>): string;
33
32
  protected refsUnder(prefix: string): Array<[string, string]>;
34
- deleteRoom(room: StoredRoom): void;
35
33
  protected remote(room: StoredRoom): Remote.Room;
36
34
  roster(room: StoredRoom): Roster | null;
37
35
  protected live(room: StoredRoom): Entry_[];
@@ -17,7 +17,6 @@ export declare class GitStore extends Marks implements Store {
17
17
  id: string;
18
18
  size: number;
19
19
  };
20
- retain(room: StoredRoom, who: string, entries: Entry[]): void;
21
20
  append(room: StoredRoom, who: string, text: string, entries: Entry[]): string;
22
21
  verifyLog(room: StoredRoom, id: string, head: string): string | null;
23
22
  pin(room: StoredRoom, reader: string, id: string, rev: string): void;
@@ -0,0 +1,21 @@
1
+ import { Branches } from './branches.ts';
2
+ import type { SignalEvent, SignalHead, StoredRoom } from '../../core/hub/ports/store.ts';
3
+ export declare class Marks extends Branches {
4
+ private streamAlarms;
5
+ private scannedStreams;
6
+ private streams;
7
+ private readStream;
8
+ signalHeads(room: StoredRoom): SignalHead[];
9
+ signals(room: StoredRoom): SignalEvent[];
10
+ pinSignals(room: StoredRoom, reader: string, actor: string, head: string): void;
11
+ alarms(room: StoredRoom): string[];
12
+ private appendStream;
13
+ signal(room: StoredRoom, who: string, target: string, signal: string): void;
14
+ heartbeat(room: StoredRoom, who: string, target: string, text: string): string;
15
+ heartbeats(room: StoredRoom): Array<{
16
+ agent: string;
17
+ target: string;
18
+ time: number;
19
+ text: string;
20
+ }>;
21
+ }
@@ -4,7 +4,6 @@ export type Publication = {
4
4
  H: Handle;
5
5
  ref: string;
6
6
  alarms: Record<string, string>;
7
- tag: boolean;
8
7
  pin: string;
9
8
  track: string;
10
9
  sha: string;
@@ -0,0 +1,12 @@
1
+ import type { Facts, StreamKind } from './stream-facts.ts';
2
+ import type { Dependencies } from './stream-control.ts';
3
+ import type { Handle, Raw, Room } from './types.ts';
4
+ export type CheckContext = {
5
+ H: Handle;
6
+ R: Room;
7
+ actor: string;
8
+ kind: StreamKind;
9
+ parent: string;
10
+ dep: Dependencies;
11
+ };
12
+ export declare const checkStreamRecord: (ctx: CheckContext, c: Raw) => Facts | null;
@@ -0,0 +1,8 @@
1
+ import type { Handle, Room } from './types.ts';
2
+ export type Dependencies = {
3
+ controls: Set<string>;
4
+ messages: Set<string>;
5
+ skipped: Set<string>;
6
+ };
7
+ export declare const streamDependencies: (H: Handle, R: Room) => Dependencies;
8
+ export declare const streamAdmission: (H: Handle, control: string, actor: string, sha: string) => void;
@@ -0,0 +1,4 @@
1
+ import type { Raw } from './types.ts';
2
+ export type StreamKind = 'signals' | 'telemetry';
3
+ export type Facts = Map<string, string>;
4
+ export declare const streamFacts: (c: Raw, kind: StreamKind) => Facts;
@@ -0,0 +1,31 @@
1
+ import type { Facts, StreamKind } from './stream-facts.ts';
2
+ export type { StreamKind } from './stream-facts.ts';
3
+ import type { SignalEvent } from '../../../core/hub/ports/store.ts';
4
+ import type { Handle, Raw, Room } from './types.ts';
5
+ export declare const streamRoom: (H: Handle) => Room;
6
+ export declare const streamName: (ref: string) => {
7
+ actor: string;
8
+ kind: StreamKind;
9
+ } | null;
10
+ export declare const streamRef: (actor: string, kind: StreamKind) => string;
11
+ type Record_ = {
12
+ raw: Raw;
13
+ fields: Facts;
14
+ };
15
+ export type Stream = {
16
+ head: string;
17
+ records: Record_[];
18
+ pending?: string;
19
+ why?: string;
20
+ };
21
+ export type ScanInput = {
22
+ H: Handle;
23
+ R: Room;
24
+ actor: string;
25
+ kind: StreamKind;
26
+ head: string;
27
+ prefix?: Stream;
28
+ };
29
+ export declare const scanStream: ({ H, R, actor, kind, head, prefix }: ScanInput) => Stream;
30
+ export declare const signalEvents: (R: Room, actor: string, s: Stream) => SignalEvent[];
31
+ export declare const validateStream: (H: Handle, R: Room, ref: string, head: string) => void;
@@ -0,0 +1,2 @@
1
+ import type { Handle } from './types.ts';
2
+ export declare const syncStreams: (H: Handle, fetched: Map<string, string>) => void;
@@ -1,9 +1,10 @@
1
- import type { Descriptor, Member } from '../../../core/hub/ports/store.ts';
1
+ import type { Descriptor, Member, RoomEndpoint } from '../../../core/hub/ports/store.ts';
2
2
  import type { SigningContext } from '../../../core/signing/index.ts';
3
3
  export type Handle = {
4
4
  name: string;
5
5
  dir: string;
6
6
  d: Descriptor;
7
+ endpoint?: RoomEndpoint;
7
8
  signing?: SigningContext;
8
9
  main?: string;
9
10
  remoteAlarms?: Record<string, string>;
@@ -47,9 +48,6 @@ export declare const SHA: RegExp;
47
48
  export declare const ROOT = "operator";
48
49
  export declare const TRACK = "refs/remotes/origin/";
49
50
  export declare const ACCEPT = "refs/ringi/remote-accepted/";
50
- export declare const TAGS = "refs/tags/";
51
- export declare const TAG_TRACK = "refs/ringi/remote-tags/";
52
- export declare const TAG_ACCEPT = "refs/ringi/remote-accepted-tags/";
53
51
  export type Commit = {
54
52
  sha: string;
55
53
  parents: string[];
@@ -58,6 +56,9 @@ export type Raw = {
58
56
  sha: string;
59
57
  parents: string[];
60
58
  author: string;
59
+ committer: string;
60
+ tree: string;
61
+ time: number;
61
62
  text: string;
62
63
  body: Buffer;
63
64
  };
@@ -6,12 +6,9 @@ export { parseKey, setupSigned, rootRoster } from './remote/keys.ts';
6
6
  export { verifyHub } from './remote/main.ts';
7
7
  export { readCommits } from './remote/commits.ts';
8
8
  export { branch, verifyRoom, verify } from './remote/branch.ts';
9
- export { heartbeatName, heartbeatRef, verifyHeartbeat, makeHeartbeat } from './remote/heartbeat.ts';
10
- export { verifySignal } from './remote/signals.ts';
11
9
  export { sync } from './remote/sync.ts';
12
- export { hubAdd } from './remote/bootstrap.ts';
13
10
  export { join, roomAdmit } from './remote/admit.ts';
14
11
  export { push } from './remote/push.ts';
15
- export { pushHeartbeat } from './remote/heartbeat-push.ts';
16
12
  export { forget } from './remote/forget.ts';
17
13
  export { strictJson } from '../../lib/index.ts';
14
+ export { scanStream, streamName, streamRef, streamRoom, validateStream } from './remote/streams.ts';
@@ -1,6 +1,6 @@
1
1
  import * as Remote from './remote.ts';
2
2
  import type { GitOpt } from './run.ts';
3
- import type { Descriptor } from '../../core/hub/ports/store.ts';
3
+ import type { Descriptor, RoomEndpoint } from '../../core/hub/ports/store.ts';
4
4
  import type { Entry } from '../../core/hub/protocol/files.ts';
5
5
  import type { SigningContext } from '../../core/signing/index.ts';
6
6
  export declare const init: (dir: string, home: string) => string;
@@ -10,7 +10,7 @@ export declare class Repo {
10
10
  readonly d: Descriptor;
11
11
  readonly home: string;
12
12
  readonly h: Remote.Handle;
13
- constructor(hubDir: string, d: Descriptor, home: string, signing?: SigningContext);
13
+ constructor(hubDir: string, d: Descriptor, home: string, signing?: SigningContext, endpoint?: RoomEndpoint);
14
14
  protected openable(): void;
15
15
  protected checkout(): void;
16
16
  protected args(a: string[]): string[];
@@ -26,5 +26,6 @@ export declare class Repo {
26
26
  sync(): void;
27
27
  contractHead(): string;
28
28
  contractFile(rev: string, name: string): string | null;
29
+ seedContract(source: Repo): string;
29
30
  amendContract(who: string, text: string, files: Record<string, string | Buffer>): string;
30
31
  }
@@ -1,4 +1,3 @@
1
1
  import type { Handle } from './remote/types.ts';
2
2
  export declare const signBytes: (H: Handle, who: string, payload: Buffer | string) => string;
3
3
  export declare const signCommit: (H: Handle, who: string, sha: string) => string;
4
- export declare const signedTag: (H: Handle, who: string, tag: string, target: string) => string;
@@ -1,6 +1,4 @@
1
1
  import type { Opts } from '../args.ts';
2
2
  export declare const listHub: (_: Opts) => void;
3
3
  export declare const createHub: (o: Opts) => void;
4
- export declare const switchHub: (o: Opts) => void;
5
- export declare const addHub: (o: Opts) => void;
6
4
  export declare const amendHub: (o: Opts) => void;
@@ -1,5 +1,5 @@
1
1
  export { heartbeats, pulse } from './heartbeat.ts';
2
2
  export { hub } from './hub.ts';
3
3
  export { roomCmd } from './room.ts';
4
- export { forget, sessionLine, sessions } from './sessions.ts';
4
+ export { forget, sessionLine } from './sessions.ts';
5
5
  export { where } from './where.ts';
@@ -1,5 +1,4 @@
1
1
  import type { SessionView } from '../../../core/agents/overview.ts';
2
2
  import type { Opts } from '../args.ts';
3
3
  export declare const sessionLine: (s: SessionView) => string;
4
- export declare const sessions: (o: Opts) => void;
5
4
  export declare const forget: (o: Opts) => void;
@@ -2,6 +2,6 @@ import type { Where } from '../../../core/agents/overview.ts';
2
2
  import type { Room } from '../../../core/hub/rooms/index.ts';
3
3
  import type { All, Message } from '../../../core/hub/protocol/index.ts';
4
4
  import type { Opts } from '../args.ts';
5
- export declare const hubLine: (H: Where['hub']) => string;
5
+ export declare const hubLine: (R: Room) => string;
6
6
  export declare const printOverview: (w: Where, R: Room) => void;
7
7
  export declare const showMessage: (R: Room, o: Opts, all: All, m: Message) => void;
@@ -1,6 +1,6 @@
1
1
  export { cat, get } from './files.ts';
2
- export { add, read, reply, send, thread } from './messages.ts';
3
- export { profileCmd, who } from './profile.ts';
2
+ export { read, reply, send, thread } from './messages.ts';
3
+ export { profileCmd } from './profile.ts';
4
4
  export { scopeLine, waiting } from './session.ts';
5
5
  export { signals } from './signals.ts';
6
6
  export { log, taskLine, tasks } from './work.ts';
@@ -1,6 +1,5 @@
1
1
  import type { Opts } from '../args.ts';
2
2
  import type { Ctx } from '../context.ts';
3
- export declare const add: (a: Ctx, o: Opts) => void;
4
3
  export declare const send: (a: Ctx, o: Opts) => void;
5
4
  export declare const reply: (a: Ctx, o: Opts) => void;
6
5
  export declare const read: (a: Ctx, o: Opts) => void;
@@ -1,4 +1,3 @@
1
1
  import type { Opts } from '../args.ts';
2
2
  import type { Ctx } from '../context.ts';
3
3
  export declare const profileCmd: ({ R }: Ctx, o: Opts) => void;
4
- export declare const who: (a: Ctx) => void;
@@ -1,3 +1,4 @@
1
1
  import type { Opts } from '../args.ts';
2
- export { SKILL, skillTargets } from './targets.ts';
2
+ export declare const SKILL: string;
3
+ export declare const skillTargets: () => string[];
3
4
  export declare const skill: (o: Opts) => void;
@@ -1,4 +1,4 @@
1
- import type { Hub, Room } from '../hub/rooms/index.ts';
1
+ import type { Room } from '../hub/rooms/index.ts';
2
2
  import type { All, Message } from '../hub/protocol/index.ts';
3
3
  import { liveness } from './sessions/index.ts';
4
4
  import type { Session } from './sessions/index.ts';
@@ -8,20 +8,17 @@ export type SessionView = Session & {
8
8
  liveness: ReturnType<typeof liveness>;
9
9
  };
10
10
  export type Where = {
11
- hub: Hub;
12
11
  room: Room | null;
13
12
  sessions: SessionView[];
14
13
  work: TaskView[];
15
14
  all: All;
16
15
  messages: Message[];
17
16
  };
18
- export declare const where: (H: Hub, name: string | null) => Where;
19
- export declare const arrived: (H: Hub, R: Room, seen: Set<string>) => {
17
+ export declare const where: (name: string | null) => Where;
18
+ export declare const arrived: (R: Room, seen: Set<string>) => {
20
19
  all: All;
21
20
  messages: Message[];
22
21
  };
23
- export declare const roomsActive: (H: Hub) => Array<RoomView & {
22
+ export declare const roomsActive: () => Array<RoomView & {
24
23
  active: number;
25
24
  }>;
26
- export declare const sessions: () => SessionView[];
27
- export declare const forgetSession: (handle: string) => void;
@@ -28,7 +28,6 @@ export declare const liveness: (s: Session) => 'active' | 'stopped' | 'gone';
28
28
  export declare const seatHolder: (hub: string, genesis: string, agent: string, except: string) => Session | undefined;
29
29
  export declare const ownSession: (handle: string) => Session | null;
30
30
  export declare const parseSelector: (sel: string | undefined) => {
31
- hub: string | null;
32
31
  room: string;
33
32
  agent: string;
34
33
  };
@@ -1,7 +1,6 @@
1
1
  import type { Session } from './index.ts';
2
2
  import type { JoinKey } from '../../hub/ports/store.ts';
3
3
  export type JoinInput = {
4
- hub: string;
5
4
  room: string;
6
5
  agent?: string;
7
6
  scope?: string;
@@ -17,4 +16,4 @@ export type JoinResult = {
17
16
  session: null;
18
17
  key: JoinKey;
19
18
  });
20
- export declare const join: ({ hub, room, agent: id, scope }: JoinInput) => JoinResult;
19
+ export declare const join: ({ room: target, agent: id, scope }: JoinInput) => JoinResult;
@@ -10,16 +10,7 @@ export type Accepted = {
10
10
  export type Delivered = {
11
11
  seen?: Record<string, string>;
12
12
  };
13
- export type Outgoing = {
14
- staged?: Staged[];
15
- };
16
- export type ReaderState = Accepted & Delivered & Outgoing;
17
- export type Staged = {
18
- path: string;
19
- blob: string;
20
- mode: string;
21
- size: number;
22
- };
13
+ export type ReaderState = Accepted & Delivered;
23
14
  export declare const readerLock: <T>(R: Room, reader: string, fn: () => T) => T;
24
15
  export declare const loadState: (R: Room, reader: string) => ReaderState;
25
16
  export declare const saveState: (R: Room, reader: string, st: ReaderState) => void;
@@ -31,15 +31,6 @@ export type StoredRoom = {
31
31
  tip: Rev;
32
32
  control: ControlRecord[];
33
33
  };
34
- export type SignalRecord = {
35
- ref: string;
36
- object: Rev;
37
- name: string;
38
- actor: string;
39
- target: Rev;
40
- tagger: string;
41
- text: string;
42
- };
43
34
  export type Roster = {
44
35
  members: Record<string, Member>;
45
36
  signers: Array<{
@@ -75,21 +66,19 @@ export interface Attachments {
75
66
  id: Rev;
76
67
  size: number;
77
68
  };
78
- retain(room: StoredRoom, who: string, entries: Entry[]): void;
79
69
  file(rev: Rev, path: string): Buffer;
80
70
  sizes(rev: Rev, paths: string[]): Map<string, number>;
81
71
  }
82
72
  export interface Signals {
83
73
  signal(room: StoredRoom, who: string, target: Rev, name: string): void;
84
- signals(room: StoredRoom): SignalRecord[];
74
+ signals(room: StoredRoom): SignalEvent[];
75
+ signalHeads(room: StoredRoom): SignalHead[];
76
+ pinSignals(room: StoredRoom, reader: string, actor: string, head: Rev): void;
85
77
  }
86
78
  export interface Evidence {
87
79
  pin(room: StoredRoom, reader: string, id: string, rev: Rev): void;
88
80
  unpin(room: StoredRoom, reader: string, id: string): void;
89
81
  }
90
- export interface Administration {
91
- deleteRoom(room: StoredRoom): void;
92
- }
93
82
  export interface Verification {
94
83
  roster(room: StoredRoom): Roster | null;
95
84
  verifyLog(room: StoredRoom, id: string, head: Rev): string | null;
@@ -110,19 +99,45 @@ export interface Signed {
110
99
  forgetLog(room: StoredRoom, id: string): void;
111
100
  rootRoster(): string;
112
101
  }
113
- export interface Store extends Log, Attachments, Signals, Evidence, Administration, Verification, Partial<Presence>, Partial<Signed> {
102
+ export interface Store extends Log, Attachments, Signals, Evidence, Verification, Partial<Presence>, Partial<Signed> {
114
103
  }
115
104
  export type Descriptor = {
116
- schema: 'ringi-hub/2';
105
+ schema: 'ringi-hub/3';
117
106
  name: string;
118
107
  trust: 'asserted' | 'signed';
119
108
  root?: string;
120
- genesis?: string;
109
+ genesis: Rev;
121
110
  store: {
122
111
  type: string;
112
+ };
113
+ contract?: {
114
+ path: string;
115
+ remote?: string;
116
+ };
117
+ };
118
+ export type RoomEndpoint = {
119
+ schema: 'ringi-room/1';
120
+ name: string;
121
+ hubGenesis: Rev;
122
+ genesis: Rev;
123
+ store: {
123
124
  path: string;
124
125
  remote?: string;
125
126
  };
127
+ authRef?: string;
128
+ };
129
+ export type SignalEvent = {
130
+ id: Rev;
131
+ parent: Rev;
132
+ roomGenesis: Rev;
133
+ control: Rev;
134
+ actor: string;
135
+ target: Rev;
136
+ signal: string;
137
+ };
138
+ export type SignalHead = {
139
+ actor: string;
140
+ head: Rev;
126
141
  };
127
142
  export type Genesis = (d: Descriptor) => {
128
143
  files: Record<string, string>;
@@ -130,14 +145,11 @@ export type Genesis = (d: Descriptor) => {
130
145
  };
131
146
  export interface Transport {
132
147
  readonly layout: string;
133
- layoutOf?(store: Store): string;
134
- open(at: string, d: Descriptor): Store;
148
+ open(at: string, d: Descriptor, endpoint?: RoomEndpoint): Store;
135
149
  create(at: string, d: Descriptor, genesis: Genesis): {
136
150
  store: Store;
137
151
  custody: string | null;
138
152
  };
139
- attach?(name: string, url: string, pins: {
140
- root?: string;
141
- genesis?: string;
142
- }): void;
153
+ fork(at: string, d: Descriptor, source: Store, endpoint: RoomEndpoint): Store;
154
+ attachRoom(at: string, d: Descriptor, endpoint: RoomEndpoint): Store;
143
155
  }
@@ -0,0 +1,6 @@
1
+ import type { Transport } from '../ports/store.ts';
2
+ export declare const storeOf: (address: string) => {
3
+ type: string;
4
+ locator: string;
5
+ };
6
+ export declare const transportOf: (name: string, type: string) => Transport;
@@ -0,0 +1,7 @@
1
+ import type { Descriptor, Rev } from '../ports/store.ts';
2
+ import type { Hub } from './index.ts';
3
+ export declare const adoptHub: ({ trust, root, genesis }: {
4
+ trust: Descriptor['trust'];
5
+ root?: string;
6
+ genesis: Rev;
7
+ }) => Hub;
@@ -1,5 +1,7 @@
1
- import type { Descriptor, Rev, Store } from '../ports/store.ts';
1
+ import type { Descriptor, Rev, RoomEndpoint, Store } from '../ports/store.ts';
2
2
  import type { Contract } from './index.ts';
3
3
  export declare const descriptorRefusal: (d: Descriptor, name: string) => string | null;
4
+ export declare const contractRefusal: (c: Contract, name: string) => string | null;
5
+ export declare const endpointRefusal: (d: Descriptor, name: string, e: RoomEndpoint) => string | null;
4
6
  export declare const contractAt: (store: Store, name: string, rev: Rev) => Contract;
5
7
  export declare const layoutRefusal: (name: string, shown: string, reads: string) => string | null;
@@ -0,0 +1,16 @@
1
+ import type { Descriptor, Rev, Store } from '../ports/store.ts';
2
+ import type { Contract, Hub } from './index.ts';
3
+ export declare const readProfileResource: (name: string) => string;
4
+ export declare const genesisFiles: (d: Descriptor, layout: string) => Record<string, string>;
5
+ export declare const checkedContract: (H: Hub, store: Store) => {
6
+ main: Rev;
7
+ contract: Contract;
8
+ };
9
+ export declare const openContract: (H: Hub, { refresh }?: {
10
+ refresh?: boolean;
11
+ }) => {
12
+ store: Store;
13
+ main: Rev;
14
+ contract: Contract;
15
+ };
16
+ export declare const amendContract: (H: Hub, who: string, text: string, files: Record<string, string | Buffer>) => Rev;
@@ -1,8 +1,7 @@
1
- import type { Transport } from '../ports/store.ts';
1
+ export { storeOf, transportOf } from './address.ts';
2
+ export { checkedContract, openContract, amendContract, readProfileResource } from './contracts.ts';
2
3
  import type { Hub } from './index.ts';
3
4
  export declare const hubNames: () => string[];
4
- export declare const readProfileResource: (name: string) => string;
5
- export declare const transportOf: (name: string, type: string) => Transport;
6
5
  export declare const createHub: (name: string, { signed, url }?: {
7
6
  signed?: boolean;
8
7
  url?: string;
@@ -12,3 +11,4 @@ export declare const createHub: (name: string, { signed, url }?: {
12
11
  export declare const openHub: (name: string, { refresh }?: {
13
12
  refresh?: boolean;
14
13
  }) => Hub;
14
+ export { adoptHub } from './adoption.ts';