@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.
- package/package.json +1 -1
- package/target/dts/adapters/fs/index.d.ts +2 -0
- package/target/dts/adapters/fs/lock.d.ts +1 -0
- package/target/dts/adapters/fs/write.d.ts +5 -0
- package/target/dts/adapters/host-posix/group-state.d.ts +7 -0
- package/target/dts/adapters/host-posix/groups.d.ts +1 -0
- package/target/dts/adapters/host-posix/index.d.ts +2 -0
- package/target/dts/adapters/host-posix/launch.d.ts +7 -0
- package/target/dts/adapters/host-posix/probes.d.ts +5 -0
- package/target/dts/adapters/host-posix/stats.d.ts +9 -0
- package/target/dts/adapters/keys-file/index.d.ts +2 -0
- package/target/dts/adapters/state-fs/index.d.ts +5 -0
- package/target/dts/adapters/tool-claude/index.d.ts +2 -0
- package/target/dts/adapters/tool-codex/index.d.ts +2 -0
- package/target/dts/adapters/tool-cursor/index.d.ts +2 -0
- package/target/dts/adapters/tool-traces/index.d.ts +3 -0
- package/target/dts/adapters/transport-git/branches.d.ts +43 -0
- package/target/dts/adapters/transport-git/files.d.ts +2 -0
- package/target/dts/adapters/transport-git/index.d.ts +32 -0
- package/target/dts/adapters/transport-git/marks.d.ts +20 -0
- package/target/dts/adapters/transport-git/remote/admit.d.ts +7 -0
- package/target/dts/adapters/transport-git/remote/alarms.d.ts +3 -0
- package/target/dts/adapters/transport-git/remote/bootstrap.d.ts +7 -0
- package/target/dts/adapters/transport-git/remote/branch-commit.d.ts +3 -0
- package/target/dts/adapters/transport-git/remote/branch-control.d.ts +15 -0
- package/target/dts/adapters/transport-git/remote/branch-scan.d.ts +2 -0
- package/target/dts/adapters/transport-git/remote/branch.d.ts +5 -0
- package/target/dts/adapters/transport-git/remote/cache.d.ts +3 -0
- package/target/dts/adapters/transport-git/remote/commits.d.ts +2 -0
- package/target/dts/adapters/transport-git/remote/forget.d.ts +2 -0
- package/target/dts/adapters/transport-git/remote/git.d.ts +26 -0
- package/target/dts/adapters/transport-git/remote/heartbeat-facts.d.ts +1 -0
- package/target/dts/adapters/transport-git/remote/heartbeat-name.d.ts +6 -0
- package/target/dts/adapters/transport-git/remote/heartbeat-object.d.ts +10 -0
- package/target/dts/adapters/transport-git/remote/heartbeat-push.d.ts +2 -0
- package/target/dts/adapters/transport-git/remote/heartbeat.d.ts +7 -0
- package/target/dts/adapters/transport-git/remote/keys.d.ts +13 -0
- package/target/dts/adapters/transport-git/remote/main.d.ts +11 -0
- package/target/dts/adapters/transport-git/remote/process.d.ts +20 -0
- package/target/dts/adapters/transport-git/remote/push-retry.d.ts +2 -0
- package/target/dts/adapters/transport-git/remote/push-validate.d.ts +2 -0
- package/target/dts/adapters/transport-git/remote/push.d.ts +16 -0
- package/target/dts/adapters/transport-git/remote/roster.d.ts +7 -0
- package/target/dts/adapters/transport-git/remote/signals.d.ts +15 -0
- package/target/dts/adapters/transport-git/remote/signature.d.ts +5 -0
- package/target/dts/adapters/transport-git/remote/sync-heartbeat.d.ts +2 -0
- package/target/dts/adapters/transport-git/remote/sync-rooms.d.ts +6 -0
- package/target/dts/adapters/transport-git/remote/sync-tags.d.ts +8 -0
- package/target/dts/adapters/transport-git/remote/sync.d.ts +2 -0
- package/target/dts/adapters/transport-git/remote/types.d.ts +64 -0
- package/target/dts/adapters/transport-git/remote.d.ts +17 -0
- package/target/dts/adapters/transport-git/repo.d.ts +31 -0
- package/target/dts/adapters/transport-git/run.d.ts +21 -0
- package/target/dts/adapters/transport-git/signing.d.ts +4 -0
- package/target/dts/adapters/transport-git/tags.d.ts +15 -0
- package/target/dts/adapters/transport-git/transport.d.ts +7 -0
- package/target/dts/adapters/transport-kafka/index.d.ts +2 -0
- package/target/dts/adapters/transport-temporal/index.d.ts +2 -0
- package/target/dts/cli.d.ts +2 -1
- package/target/dts/{cli/agent.d.ts → clients/cli/agent/index.d.ts} +3 -3
- package/target/dts/{cli → clients/cli/agent}/session.d.ts +2 -2
- package/target/dts/clients/cli/arg-parse.d.ts +2 -0
- package/target/dts/{cli → clients/cli}/args.d.ts +2 -2
- package/target/dts/clients/cli/commands.d.ts +2 -0
- package/target/dts/clients/cli/context.d.ts +4 -0
- package/target/dts/{cli/index.d.ts → clients/cli/help.d.ts} +1 -3
- package/target/dts/clients/cli/index.d.ts +4 -0
- package/target/dts/clients/cli/operator/heartbeat-format.d.ts +5 -0
- package/target/dts/clients/cli/operator/heartbeat.d.ts +3 -0
- package/target/dts/clients/cli/operator/hub-commands.d.ts +6 -0
- package/target/dts/clients/cli/operator/hub.d.ts +2 -0
- package/target/dts/clients/cli/operator/index.d.ts +5 -0
- package/target/dts/clients/cli/operator/room-lifecycle.d.ts +5 -0
- package/target/dts/clients/cli/operator/room-list.d.ts +5 -0
- package/target/dts/clients/cli/operator/room-members.d.ts +4 -0
- package/target/dts/clients/cli/operator/room.d.ts +2 -0
- package/target/dts/clients/cli/operator/sessions.d.ts +5 -0
- package/target/dts/clients/cli/operator/watch.d.ts +2 -0
- package/target/dts/clients/cli/operator/where-format.d.ts +7 -0
- package/target/dts/clients/cli/operator/where.d.ts +2 -0
- package/target/dts/clients/cli/shared/budget.d.ts +7 -0
- package/target/dts/clients/cli/shared/files.d.ts +4 -0
- package/target/dts/clients/cli/shared/index.d.ts +7 -0
- package/target/dts/clients/cli/shared/messages.d.ts +7 -0
- package/target/dts/clients/cli/shared/profile.d.ts +4 -0
- package/target/dts/clients/cli/shared/session.d.ts +6 -0
- package/target/dts/clients/cli/shared/signals.d.ts +3 -0
- package/target/dts/clients/cli/shared/work.d.ts +6 -0
- package/target/dts/clients/cli/skill/index.d.ts +3 -0
- package/target/dts/{cli/skill.d.ts → clients/cli/skill/targets.d.ts} +1 -2
- package/target/dts/composition/index.d.ts +2 -0
- package/target/dts/{heartbeat → core/agents/heartbeat}/index.d.ts +2 -4
- package/target/dts/{app/heartbeat.d.ts → core/agents/heartbeat/pulse.d.ts} +5 -6
- package/target/dts/core/agents/heartbeat/singleton.d.ts +3 -0
- package/target/dts/core/agents/heartbeat/tools.d.ts +6 -0
- package/target/dts/{app → core/agents}/overview.d.ts +12 -6
- package/target/dts/core/agents/ports/host.d.ts +47 -0
- package/target/dts/core/agents/ports/index.d.ts +9 -0
- package/target/dts/core/agents/ports/tools.d.ts +18 -0
- package/target/dts/core/agents/sessions/agent.d.ts +70 -0
- package/target/dts/core/agents/sessions/binding.d.ts +9 -0
- package/target/dts/core/agents/sessions/context.d.ts +8 -0
- package/target/dts/{runtime/session.d.ts → core/agents/sessions/index.d.ts} +2 -9
- package/target/dts/core/agents/sessions/join.d.ts +20 -0
- package/target/dts/core/agents/sessions/resume.d.ts +2 -0
- package/target/dts/core/agents/sessions/session.d.ts +46 -0
- package/target/dts/core/agents/sessions/wait.d.ts +38 -0
- package/target/dts/core/agents/turns/budgets.d.ts +5 -0
- package/target/dts/core/agents/turns/dispatch.d.ts +9 -0
- package/target/dts/core/agents/turns/exhaustion.d.ts +11 -0
- package/target/dts/core/agents/turns/grants.d.ts +4 -0
- package/target/dts/core/agents/turns/index.d.ts +4 -0
- package/target/dts/core/agents/turns/limits.d.ts +2 -0
- package/target/dts/core/agents/turns/messages.d.ts +10 -0
- package/target/dts/core/agents/turns/pings.d.ts +5 -0
- package/target/dts/core/agents/turns/plan.d.ts +3 -0
- package/target/dts/core/agents/turns/poll.d.ts +8 -0
- package/target/dts/core/agents/turns/results.d.ts +3 -0
- package/target/dts/core/agents/turns/seat.d.ts +2 -0
- package/target/dts/core/agents/turns/types.d.ts +59 -0
- package/target/dts/core/hub/decisions/budget.d.ts +15 -0
- package/target/dts/core/hub/decisions/check.d.ts +6 -0
- package/target/dts/core/hub/decisions/index.d.ts +5 -0
- package/target/dts/core/hub/decisions/proposal.d.ts +38 -0
- package/target/dts/core/hub/decisions/usage.d.ts +12 -0
- package/target/dts/{runtime/reader.d.ts → core/hub/history/index.d.ts} +12 -6
- package/target/dts/core/hub/ports/index.d.ts +16 -0
- package/target/dts/core/hub/ports/state.d.ts +12 -0
- package/target/dts/{store/index.d.ts → core/hub/ports/store.d.ts} +48 -18
- package/target/dts/core/hub/protocol/index.d.ts +5 -0
- package/target/dts/{protocol/index.d.ts → core/hub/protocol/model.d.ts} +0 -25
- package/target/dts/core/hub/protocol/order.d.ts +2 -0
- package/target/dts/core/hub/protocol/reading.d.ts +8 -0
- package/target/dts/core/hub/protocol/text.d.ts +11 -0
- package/target/dts/core/hub/protocol/threads.d.ts +5 -0
- package/target/dts/core/hub/rooms/compat.d.ts +5 -0
- package/target/dts/core/hub/rooms/hubs.d.ts +14 -0
- package/target/dts/core/hub/rooms/index.d.ts +53 -0
- package/target/dts/core/hub/rooms/messages.d.ts +8 -0
- package/target/dts/core/hub/rooms/rooms.d.ts +10 -0
- package/target/dts/core/hub/signals/check.d.ts +3 -0
- package/target/dts/core/hub/signals/effective.d.ts +3 -0
- package/target/dts/core/hub/signals/index.d.ts +5 -0
- package/target/dts/core/hub/signals/marks.d.ts +4 -0
- package/target/dts/core/hub/signals/model.d.ts +28 -0
- package/target/dts/core/hub/signals/pins.d.ts +5 -0
- package/target/dts/{hub/signals.d.ts → core/hub/signals/write.d.ts} +1 -1
- package/target/dts/core/hub/usecases/actor.d.ts +6 -0
- package/target/dts/{app → core/hub/usecases}/budget.d.ts +5 -18
- package/target/dts/core/hub/usecases/config.d.ts +6 -0
- package/target/dts/{app → core/hub/usecases}/context.d.ts +3 -8
- package/target/dts/{app → core/hub/usecases}/hubs.d.ts +1 -1
- package/target/dts/core/hub/usecases/propose.d.ts +17 -0
- package/target/dts/{app → core/hub/usecases}/room.d.ts +8 -34
- package/target/dts/{app → core/hub/usecases}/rooms.d.ts +2 -6
- package/target/dts/core/hub/usecases/roster.d.ts +5 -0
- package/target/dts/core/hub/usecases/send.d.ts +21 -0
- package/target/dts/core/hub/usecases/staging.d.ts +8 -0
- package/target/dts/{app → core/hub/usecases}/view.d.ts +4 -4
- package/target/dts/{domain/profiles.d.ts → core/hub/work/index.d.ts} +3 -7
- package/target/dts/core/hub/work/parse.d.ts +2 -0
- package/target/dts/core/hub/work/task.d.ts +6 -0
- package/target/dts/core/signing/index.d.ts +35 -0
- package/target/dts/index.d.ts +8 -8
- package/target/dts/lib/fail.d.ts +8 -0
- package/target/dts/lib/index.d.ts +3 -11
- package/target/dts/lib/json.d.ts +1 -0
- package/target/esm/adapters/fs/index.js +5 -0
- package/target/esm/adapters/fs/lock.js +83 -0
- package/target/esm/adapters/fs/write.js +25 -0
- package/target/esm/adapters/host-posix/group-state.js +24 -0
- package/target/esm/adapters/host-posix/groups.js +43 -0
- package/target/esm/adapters/host-posix/index.js +35 -0
- package/target/esm/adapters/host-posix/launch.js +80 -0
- package/target/esm/adapters/host-posix/probes.js +66 -0
- package/target/esm/adapters/host-posix/stats.js +27 -0
- package/target/esm/adapters/keys-file/index.js +68 -0
- package/target/esm/adapters/state-fs/index.js +79 -0
- package/target/esm/adapters/tool-claude/index.js +32 -0
- package/target/esm/adapters/tool-codex/index.js +38 -0
- package/target/esm/adapters/tool-cursor/index.js +8 -0
- package/target/esm/adapters/tool-traces/index.js +18 -0
- package/target/esm/adapters/transport-git/branches.js +155 -0
- package/target/esm/adapters/transport-git/files.js +48 -0
- package/target/esm/adapters/transport-git/index.js +128 -0
- package/target/esm/adapters/transport-git/marks.js +88 -0
- package/target/esm/adapters/transport-git/remote/admit.js +71 -0
- package/target/esm/adapters/transport-git/remote/alarms.js +30 -0
- package/target/esm/adapters/transport-git/remote/bootstrap.js +47 -0
- package/target/esm/adapters/transport-git/remote/branch-commit.js +36 -0
- package/target/esm/adapters/transport-git/remote/branch-control.js +37 -0
- package/target/esm/adapters/transport-git/remote/branch-scan.js +28 -0
- package/target/esm/adapters/transport-git/remote/branch.js +37 -0
- package/target/esm/adapters/transport-git/remote/cache.js +23 -0
- package/target/esm/adapters/transport-git/remote/commits.js +25 -0
- package/target/esm/adapters/transport-git/remote/forget.js +35 -0
- package/target/esm/adapters/transport-git/remote/git.js +58 -0
- package/target/esm/adapters/transport-git/remote/heartbeat-facts.js +35 -0
- package/target/esm/adapters/transport-git/remote/heartbeat-name.js +19 -0
- package/target/esm/adapters/transport-git/remote/heartbeat-object.js +40 -0
- package/target/esm/adapters/transport-git/remote/heartbeat-push.js +44 -0
- package/target/esm/adapters/transport-git/remote/heartbeat.js +44 -0
- package/target/esm/adapters/transport-git/remote/keys.js +75 -0
- package/target/esm/adapters/transport-git/remote/main.js +41 -0
- package/target/esm/adapters/transport-git/remote/process.js +37 -0
- package/target/esm/adapters/transport-git/remote/push-retry.js +46 -0
- package/target/esm/adapters/transport-git/remote/push-validate.js +39 -0
- package/target/esm/adapters/transport-git/remote/push.js +62 -0
- package/target/esm/adapters/transport-git/remote/roster.js +48 -0
- package/target/esm/adapters/transport-git/remote/signals.js +63 -0
- package/target/esm/adapters/transport-git/remote/signature.js +56 -0
- package/target/esm/adapters/transport-git/remote/sync-heartbeat.js +26 -0
- package/target/esm/adapters/transport-git/remote/sync-rooms.js +38 -0
- package/target/esm/adapters/transport-git/remote/sync-tags.js +48 -0
- package/target/esm/adapters/transport-git/remote/sync.js +38 -0
- package/target/esm/adapters/transport-git/remote/types.js +10 -0
- package/target/esm/adapters/transport-git/remote.js +17 -0
- package/target/esm/adapters/transport-git/repo.js +115 -0
- package/target/esm/adapters/transport-git/run.js +57 -0
- package/target/esm/adapters/transport-git/signing.js +44 -0
- package/target/esm/adapters/transport-git/tags.js +21 -0
- package/target/esm/adapters/transport-git/transport.js +29 -0
- package/target/esm/adapters/transport-kafka/index.js +4 -0
- package/target/esm/adapters/transport-temporal/index.js +4 -0
- package/target/esm/cli.js +5 -4
- package/target/esm/{cli/agent.js → clients/cli/agent/index.js} +8 -7
- package/target/esm/{cli → clients/cli/agent}/session.js +7 -7
- package/target/esm/clients/cli/arg-parse.js +41 -0
- package/target/esm/{cli → clients/cli}/args.js +3 -36
- package/target/esm/clients/cli/commands.js +45 -0
- package/target/esm/clients/cli/context.js +6 -0
- package/target/esm/{cli/index.js → clients/cli/help.js} +4 -77
- package/target/esm/clients/cli/index.js +27 -0
- package/target/esm/clients/cli/operator/heartbeat-format.js +8 -0
- package/target/esm/clients/cli/operator/heartbeat.js +35 -0
- package/target/esm/clients/cli/operator/hub-commands.js +37 -0
- package/target/esm/clients/cli/operator/hub.js +10 -0
- package/target/esm/clients/cli/operator/index.js +8 -0
- package/target/esm/clients/cli/operator/room-lifecycle.js +23 -0
- package/target/esm/clients/cli/operator/room-list.js +27 -0
- package/target/esm/clients/cli/operator/room-members.js +15 -0
- package/target/esm/clients/cli/operator/room.js +15 -0
- package/target/esm/clients/cli/operator/sessions.js +32 -0
- package/target/esm/clients/cli/operator/watch.js +15 -0
- package/target/esm/clients/cli/operator/where-format.js +24 -0
- package/target/esm/clients/cli/operator/where.js +32 -0
- package/target/esm/clients/cli/shared/budget.js +50 -0
- package/target/esm/clients/cli/shared/files.js +26 -0
- package/target/esm/clients/cli/shared/index.js +10 -0
- package/target/esm/clients/cli/shared/messages.js +41 -0
- package/target/esm/clients/cli/shared/profile.js +17 -0
- package/target/esm/clients/cli/shared/session.js +8 -0
- package/target/esm/clients/cli/shared/signals.js +21 -0
- package/target/esm/clients/cli/shared/work.js +26 -0
- package/target/esm/clients/cli/skill/index.js +40 -0
- package/target/esm/clients/cli/skill/targets.js +20 -0
- package/target/esm/composition/index.js +34 -0
- package/target/esm/{heartbeat → core/agents/heartbeat}/index.js +14 -12
- package/target/esm/{app/heartbeat.js → core/agents/heartbeat/pulse.js} +31 -55
- package/target/esm/core/agents/heartbeat/singleton.js +38 -0
- package/target/esm/core/agents/heartbeat/tools.js +24 -0
- package/target/esm/{app → core/agents}/overview.js +15 -9
- package/target/esm/core/agents/ports/host.js +4 -0
- package/target/esm/core/agents/ports/index.js +7 -0
- package/target/esm/core/agents/ports/tools.js +5 -0
- package/target/esm/{app → core/agents/sessions}/agent.js +11 -43
- package/target/esm/core/agents/sessions/binding.js +43 -0
- package/target/esm/core/agents/sessions/context.js +11 -0
- package/target/esm/core/agents/sessions/index.js +59 -0
- package/target/esm/core/agents/sessions/join.js +55 -0
- package/target/esm/core/agents/sessions/resume.js +54 -0
- package/target/esm/core/agents/sessions/session.js +28 -0
- package/target/esm/core/agents/sessions/wait.js +47 -0
- package/target/esm/core/agents/turns/budgets.js +48 -0
- package/target/esm/core/agents/turns/dispatch.js +40 -0
- package/target/esm/core/agents/turns/exhaustion.js +16 -0
- package/target/esm/core/agents/turns/grants.js +36 -0
- package/target/esm/core/agents/turns/index.js +33 -0
- package/target/esm/core/agents/turns/limits.js +11 -0
- package/target/esm/core/agents/turns/messages.js +32 -0
- package/target/esm/core/agents/turns/pings.js +30 -0
- package/target/esm/core/agents/turns/plan.js +29 -0
- package/target/esm/core/agents/turns/poll.js +48 -0
- package/target/esm/core/agents/turns/results.js +40 -0
- package/target/esm/core/agents/turns/seat.js +44 -0
- package/target/esm/core/agents/turns/types.js +3 -0
- package/target/esm/{domain/index.js → core/hub/capabilities.js} +3 -3
- package/target/esm/core/hub/decisions/budget.js +40 -0
- package/target/esm/core/hub/decisions/check.js +43 -0
- package/target/esm/core/hub/decisions/index.js +10 -0
- package/target/esm/core/hub/decisions/proposal.js +73 -0
- package/target/esm/core/hub/decisions/usage.js +39 -0
- package/target/esm/core/hub/history/index.js +90 -0
- package/target/esm/core/hub/ports/index.js +10 -0
- package/target/esm/core/hub/ports/state.js +5 -0
- package/target/esm/core/hub/ports/store.js +10 -0
- package/target/esm/{protocol → core/hub/protocol}/files.js +4 -2
- package/target/esm/core/hub/protocol/index.js +9 -0
- package/target/esm/core/hub/protocol/model.js +15 -0
- package/target/esm/core/hub/protocol/order.js +39 -0
- package/target/esm/core/hub/protocol/reading.js +29 -0
- package/target/esm/core/hub/protocol/text.js +95 -0
- package/target/esm/core/hub/protocol/threads.js +52 -0
- package/target/esm/core/hub/rooms/compat.js +42 -0
- package/target/esm/core/hub/rooms/hubs.js +92 -0
- package/target/esm/core/hub/rooms/index.js +23 -0
- package/target/esm/core/hub/rooms/messages.js +47 -0
- package/target/esm/core/hub/rooms/rooms.js +84 -0
- package/target/esm/core/hub/signals/check.js +33 -0
- package/target/esm/core/hub/signals/effective.js +31 -0
- package/target/esm/core/hub/signals/index.js +23 -0
- package/target/esm/core/hub/signals/marks.js +30 -0
- package/target/esm/core/hub/signals/model.js +5 -0
- package/target/esm/core/hub/signals/pins.js +21 -0
- package/target/esm/{hub/signals.js → core/hub/signals/write.js} +4 -4
- package/target/esm/core/hub/usecases/actor.js +3 -0
- package/target/esm/core/hub/usecases/budget.js +78 -0
- package/target/esm/core/hub/usecases/config.js +5 -0
- package/target/esm/core/hub/usecases/context.js +13 -0
- package/target/esm/core/hub/usecases/hubs.js +95 -0
- package/target/esm/core/hub/usecases/propose.js +39 -0
- package/target/esm/core/hub/usecases/room.js +82 -0
- package/target/esm/{app → core/hub/usecases}/rooms.js +11 -63
- package/target/esm/core/hub/usecases/roster.js +47 -0
- package/target/esm/core/hub/usecases/send.js +78 -0
- package/target/esm/core/hub/usecases/staging.js +60 -0
- package/target/esm/{app → core/hub/usecases}/view.js +33 -33
- package/target/esm/core/hub/work/index.js +13 -0
- package/target/esm/core/hub/work/parse.js +37 -0
- package/target/esm/core/hub/work/task.js +68 -0
- package/target/esm/core/signing/index.js +4 -0
- package/target/esm/index.js +7 -6
- package/target/esm/lib/fail.js +18 -0
- package/target/esm/lib/index.js +20 -195
- package/target/esm/lib/json.js +81 -0
- package/target/dts/app/agent.d.ts +0 -109
- package/target/dts/app/session.d.ts +0 -65
- package/target/dts/cli/context.d.ts +0 -6
- package/target/dts/cli/operator.d.ts +0 -10
- package/target/dts/cli/shared.d.ts +0 -27
- package/target/dts/domain/decisions.d.ts +0 -65
- package/target/dts/domain/signals.d.ts +0 -37
- package/target/dts/heartbeat/platform.d.ts +0 -15
- package/target/dts/heartbeat/tools.d.ts +0 -11
- package/target/dts/home/index.d.ts +0 -21
- package/target/dts/hub/index.d.ts +0 -72
- package/target/dts/runtime/watch.d.ts +0 -17
- package/target/dts/store/git/index.d.ts +0 -92
- package/target/dts/store/git/remote.d.ts +0 -95
- package/target/dts/store/kafka/index.d.ts +0 -2
- package/target/dts/store/temporal/index.d.ts +0 -2
- package/target/esm/app/budget.js +0 -95
- package/target/esm/app/context.js +0 -16
- package/target/esm/app/hubs.js +0 -76
- package/target/esm/app/room.js +0 -181
- package/target/esm/app/session.js +0 -99
- package/target/esm/cli/context.js +0 -8
- package/target/esm/cli/operator.js +0 -185
- package/target/esm/cli/shared.js +0 -159
- package/target/esm/cli/skill.js +0 -54
- package/target/esm/domain/decisions.js +0 -178
- package/target/esm/domain/profiles.js +0 -96
- package/target/esm/domain/signals.js +0 -134
- package/target/esm/heartbeat/platform.js +0 -83
- package/target/esm/heartbeat/tools.js +0 -68
- package/target/esm/home/index.js +0 -88
- package/target/esm/hub/index.js +0 -224
- package/target/esm/protocol/index.js +0 -219
- package/target/esm/runtime/reader.js +0 -65
- package/target/esm/runtime/session.js +0 -116
- package/target/esm/runtime/watch.js +0 -321
- package/target/esm/store/git/index.js +0 -719
- package/target/esm/store/git/remote.js +0 -928
- package/target/esm/store/index.js +0 -15
- package/target/esm/store/kafka/index.js +0 -3
- package/target/esm/store/temporal/index.js +0 -3
- /package/target/dts/{domain/index.d.ts → core/hub/capabilities.d.ts} +0 -0
- /package/target/dts/{protocol → core/hub/protocol}/files.d.ts +0 -0
|
@@ -1,321 +0,0 @@
|
|
|
1
|
-
// watch: headless turns for one agent of one room (core-1 §7). It holds that agent's seat, answers heartbeats in
|
|
2
|
-
// code, and spends only within a grant (decisions-1) or its own run budget. Usage receipts are written here, by the
|
|
3
|
-
// runner, never by the model.
|
|
4
|
-
import { spawn } from 'node:child_process';
|
|
5
|
-
import * as D from '../domain/decisions.js';
|
|
6
|
-
import { HOME, OPERATOR, config, locked } from '../home/index.js';
|
|
7
|
-
import { HIDDEN, append, openHub, openRoom, pongText, start } from '../hub/index.js';
|
|
8
|
-
import { loadRoomUnlocked, loadState, readerLock, saveState } from './reader.js';
|
|
9
|
-
import { isOpen, taskFor, taskOf } from '../domain/profiles.js';
|
|
10
|
-
import { compose, link, unread, wakes } from '../protocol/index.js';
|
|
11
|
-
import { dropSession, liveness, parseSelector, pidAlive, readSession, saveSession, seatHolder, whoAmI } from './session.js';
|
|
12
|
-
import { fail, note, short, sleep, stamp } from '../lib/index.js';
|
|
13
|
-
// One turn: the command runs in a process group of its own (POSIX). At the deadline, or when the command itself
|
|
14
|
-
// ends, whatever is left of the group is asked to stop and, after a grace, killed; the turn ends when the group is
|
|
15
|
-
// empty, so no descendant outlives the run it was counted as.
|
|
16
|
-
const GRACE = 5000;
|
|
17
|
-
const groupAlive = (pid) => {
|
|
18
|
-
try {
|
|
19
|
-
process.kill(-pid, 0);
|
|
20
|
-
return true;
|
|
21
|
-
}
|
|
22
|
-
catch (e) {
|
|
23
|
-
return e.code === 'EPERM';
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
const signalGroup = (pid, sig) => {
|
|
27
|
-
try {
|
|
28
|
-
process.kill(-pid, sig);
|
|
29
|
-
}
|
|
30
|
-
catch { }
|
|
31
|
-
};
|
|
32
|
-
const turn = (cmd, seconds, env) => new Promise(resolve => {
|
|
33
|
-
const t0 = Date.now();
|
|
34
|
-
const child = spawn('sh', ['-c', cmd], { stdio: 'inherit', env, detached: true });
|
|
35
|
-
const pid = child.pid;
|
|
36
|
-
let timedOut = false;
|
|
37
|
-
let exit = null;
|
|
38
|
-
const end = async () => {
|
|
39
|
-
signalGroup(pid, 'SIGTERM');
|
|
40
|
-
const until = Date.now() + GRACE;
|
|
41
|
-
while (groupAlive(pid) && Date.now() < until)
|
|
42
|
-
await sleep(50);
|
|
43
|
-
if (groupAlive(pid))
|
|
44
|
-
signalGroup(pid, 'SIGKILL');
|
|
45
|
-
while (groupAlive(pid))
|
|
46
|
-
await sleep(50);
|
|
47
|
-
resolve({ code: exit?.code ?? null, signal: exit?.signal ?? null, timedOut, seconds: Math.round((Date.now() - t0) / 1000) });
|
|
48
|
-
};
|
|
49
|
-
// At the deadline: SIGTERM to the group, and SIGKILL after the grace even if the shell ignores it.
|
|
50
|
-
let hard;
|
|
51
|
-
const timer = seconds ? setTimeout(() => {
|
|
52
|
-
timedOut = true;
|
|
53
|
-
signalGroup(pid, 'SIGTERM');
|
|
54
|
-
hard = setTimeout(() => signalGroup(pid, 'SIGKILL'), GRACE);
|
|
55
|
-
}, seconds * 1000) : undefined;
|
|
56
|
-
const stopAll = () => signalGroup(pid, 'SIGTERM');
|
|
57
|
-
process.once('SIGINT', stopAll);
|
|
58
|
-
process.once('SIGTERM', stopAll);
|
|
59
|
-
child.on('exit', (code, signal) => {
|
|
60
|
-
exit = { code, signal };
|
|
61
|
-
clearTimeout(timer);
|
|
62
|
-
clearTimeout(hard);
|
|
63
|
-
process.removeListener('SIGINT', stopAll);
|
|
64
|
-
process.removeListener('SIGTERM', stopAll);
|
|
65
|
-
void end();
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
export const watch = async (w, log = note) => {
|
|
69
|
-
for (const [name, value] of [['interval', w.interval], ['window', w.window]])
|
|
70
|
-
if (value !== undefined && (!Number.isFinite(value) || value <= 0))
|
|
71
|
-
fail(`watch ${name} must be positive seconds`);
|
|
72
|
-
for (const [name, value] of [['max-runs', w.maxRuns], ['max-hop', w.maxHop]])
|
|
73
|
-
if (value !== undefined && (!Number.isSafeInteger(value) || value < 0))
|
|
74
|
-
fail(`watch ${name} must be a nonnegative integer`);
|
|
75
|
-
const sel = parseSelector(w.seat);
|
|
76
|
-
const cmd = w.exec;
|
|
77
|
-
const H0 = openHub(sel.hub ?? w.hub ?? config().hub);
|
|
78
|
-
const R0 = openRoom(H0, sel.room);
|
|
79
|
-
const me = sel.agent;
|
|
80
|
-
if (R0.archived)
|
|
81
|
-
fail(`${R0.name} is archived`);
|
|
82
|
-
if (!R0.members[me])
|
|
83
|
-
fail(`${me} is not a member of ${R0.name}; the operator adds it with a join, or watch another agent`);
|
|
84
|
-
// Each watcher process is its own session, so two of them can never share one seat record.
|
|
85
|
-
const raw = `watch-${H0.name}-${R0.genesis.slice(0, 8)}-${me}-${process.pid}`;
|
|
86
|
-
const handle = `env:${raw}`;
|
|
87
|
-
locked('sessions', () => {
|
|
88
|
-
const holder = seatHolder(H0.name, R0.genesis, me, handle);
|
|
89
|
-
const handoff = w.handoff && holder?.product !== 'watch' && holder?.handle === whoAmI().handle;
|
|
90
|
-
if (w.handoff && !handoff)
|
|
91
|
-
fail('watch --handoff needs the invoking chat to own this seat');
|
|
92
|
-
if (handoff && holder.state === 'stopped')
|
|
93
|
-
fail('this chat is stopped; continue it before a handoff');
|
|
94
|
-
if (holder && !handoff && (holder.product !== 'watch' || (holder.pid && pidAlive(holder.pid))))
|
|
95
|
-
fail(`${R0.name}/${me} is held by session ${holder.handle} (${liveness(holder)}); one seat per agent. Its chat may use watch --handoff`);
|
|
96
|
-
if (holder)
|
|
97
|
-
dropSession(holder.handle);
|
|
98
|
-
saveSession({ handle, product: 'watch', hub: H0.name, room: R0.name, genesis: R0.genesis, agent: me, scope: w.scope ?? holder?.scope ?? null,
|
|
99
|
-
state: holder?.state === 'stopped' ? 'stopped' : 'active', since: stamp(), lastSeen: stamp(), pid: process.pid,
|
|
100
|
-
takenFrom: handoff ? holder.handle : holder?.takenFrom });
|
|
101
|
-
});
|
|
102
|
-
const interval = (w.interval ?? 5) * 1000;
|
|
103
|
-
const allow = w.from ? new Set(w.from) : null;
|
|
104
|
-
const maxHop = w.maxHop ?? 8;
|
|
105
|
-
const maxRuns = w.maxRuns ?? 10;
|
|
106
|
-
const span = w.window ?? 86400;
|
|
107
|
-
let runSeq = 0;
|
|
108
|
-
for (;;) {
|
|
109
|
-
const s = locked('sessions', () => {
|
|
110
|
-
const cur = readSession(handle);
|
|
111
|
-
if (cur?.state === 'active')
|
|
112
|
-
saveSession({ ...cur, lastSeen: stamp(), pid: process.pid });
|
|
113
|
-
return cur;
|
|
114
|
-
});
|
|
115
|
-
if (!s) {
|
|
116
|
-
log(`watch: the seat of ${me} was released or taken over; stopping`);
|
|
117
|
-
return 0;
|
|
118
|
-
}
|
|
119
|
-
if (s.state === 'stopped') {
|
|
120
|
-
if (w.once) {
|
|
121
|
-
log('watch: stopped by the operator');
|
|
122
|
-
return 0;
|
|
123
|
-
}
|
|
124
|
-
await sleep(interval);
|
|
125
|
-
continue;
|
|
126
|
-
}
|
|
127
|
-
const H = openHub(H0.name, { refresh: true });
|
|
128
|
-
const R = openRoom(H, R0.name, { quiet: true });
|
|
129
|
-
if (!R || R.genesis !== R0.genesis) {
|
|
130
|
-
// The room's branch is gone: the watcher leaves its seat (a hub it cannot reach fails above and leaves nothing).
|
|
131
|
-
locked('sessions', () => { if (readSession(handle)?.genesis === R0.genesis)
|
|
132
|
-
dropSession(handle); });
|
|
133
|
-
log(`watch: ${R0.name} is gone, recreated or archived; ${me} left it`);
|
|
134
|
-
return 0;
|
|
135
|
-
}
|
|
136
|
-
if (!R.members[me]) {
|
|
137
|
-
log(`watch: ${me} was removed from ${R0.name}; stopping`);
|
|
138
|
-
return 0;
|
|
139
|
-
}
|
|
140
|
-
// A room waiting for its quorum runs no turn yet.
|
|
141
|
-
const st = start(R);
|
|
142
|
-
if (!st.started) {
|
|
143
|
-
if (w.once) {
|
|
144
|
-
log(`watch: ${R0.name} waits for a quorum of ${st.quorum} agents and has ${st.agents}; nothing to do yet`);
|
|
145
|
-
return 0;
|
|
146
|
-
}
|
|
147
|
-
await sleep(interval);
|
|
148
|
-
continue;
|
|
149
|
-
}
|
|
150
|
-
const P = R.profile;
|
|
151
|
-
// Lock order throughout planning and dispatch: grant, reader, sessions (then the store's own writes).
|
|
152
|
-
const plan = locked(`grant-${H.name}`, () => readerLock(R, me, () => {
|
|
153
|
-
const { logs, st } = loadRoomUnlocked(R, me);
|
|
154
|
-
if (st.inflight) {
|
|
155
|
-
st.seen = st.inflight.seen;
|
|
156
|
-
st.inflight = undefined;
|
|
157
|
-
saveState(R, me, st);
|
|
158
|
-
}
|
|
159
|
-
const all = link(logs);
|
|
160
|
-
// Heartbeats: one pong per allowed ping, in code; a separate durable cursor, never a model run.
|
|
161
|
-
const heartbeatSeen = { ...st.heartbeatSeen };
|
|
162
|
-
const answered = new Set((logs.get(me) ?? []).filter(m => m.kind === 'pong').map(m => m.reId));
|
|
163
|
-
for (const [id, msgs] of logs) {
|
|
164
|
-
if (id === me)
|
|
165
|
-
continue;
|
|
166
|
-
const at = msgs.findIndex(m => m.id === heartbeatSeen[id]);
|
|
167
|
-
for (const m of msgs.slice(at + 1)) {
|
|
168
|
-
if (m.bad || m.kind !== 'ping' || !m.to.includes(me) || answered.has(m.id) || m.hopEff >= maxHop || (allow && !allow.has(m.from)))
|
|
169
|
-
continue;
|
|
170
|
-
append(R, me, pongText(me, m, 'has a watcher'));
|
|
171
|
-
note(`watch: answered heartbeat ${short(m.id)} from ${m.from}`);
|
|
172
|
-
}
|
|
173
|
-
if (msgs.length)
|
|
174
|
-
heartbeatSeen[id] = msgs.at(-1).id;
|
|
175
|
-
}
|
|
176
|
-
const { msgs: fresh, cursors } = unread(logs, me, st.watched ?? st.seen ?? {}, Infinity, HIDDEN);
|
|
177
|
-
const retry = (st.pending ?? []).flatMap(id => {
|
|
178
|
-
const m = all.get(id);
|
|
179
|
-
if (!m)
|
|
180
|
-
return [];
|
|
181
|
-
const task = taskFor(all, m, P);
|
|
182
|
-
return !task || isOpen(taskOf(all, task, P), P) ? [m] : [];
|
|
183
|
-
});
|
|
184
|
-
const msgs = [...new Map([...retry, ...fresh].map(m => [m.id, m])).values()];
|
|
185
|
-
const go = msgs.filter(m => wakes(m, me, HIDDEN) && m.hopEff < maxHop && (!allow || allow.has(m.from)));
|
|
186
|
-
for (const m of msgs)
|
|
187
|
-
if (!go.includes(m))
|
|
188
|
-
note(`watch: not waking for ${short(m.id)} from ${m.from} (to ${m.to.join(',')}, hop ${m.hopEff})`);
|
|
189
|
-
// Group by the grant of each message's work; a message outside a grant spends the watcher's own budget.
|
|
190
|
-
const groups = new Map();
|
|
191
|
-
for (const m of go) {
|
|
192
|
-
const task = taskFor(all, m, P);
|
|
193
|
-
const g = task ? taskOf(all, task, P).grant : null;
|
|
194
|
-
if (!groups.has(g))
|
|
195
|
-
groups.set(g, { grant: g, msgs: [], task });
|
|
196
|
-
groups.get(g).msgs.push(m);
|
|
197
|
-
}
|
|
198
|
-
const runs = [];
|
|
199
|
-
let hold = false;
|
|
200
|
-
const now = Date.now() / 1000;
|
|
201
|
-
let ownRuns = (st.runs ?? []).filter(t => t > now - span);
|
|
202
|
-
const exhausted = { ...st.exhausted };
|
|
203
|
-
for (const grp of groups.values()) {
|
|
204
|
-
if (!grp.grant) {
|
|
205
|
-
if (w.requireGrant) {
|
|
206
|
-
for (const m of grp.msgs)
|
|
207
|
-
note(`watch: ${short(m.id)} is outside any grant; --require-grant: not starting a turn`);
|
|
208
|
-
continue;
|
|
209
|
-
}
|
|
210
|
-
if (ownRuns.length >= maxRuns) {
|
|
211
|
-
hold = true;
|
|
212
|
-
note(`watch: own run budget spent (${maxRuns} per ${span}s); ${grp.msgs.length} message(s) wait`);
|
|
213
|
-
continue;
|
|
214
|
-
}
|
|
215
|
-
ownRuns = [...ownRuns, now];
|
|
216
|
-
runs.push({ ...grp, timeout: null });
|
|
217
|
-
continue;
|
|
218
|
-
}
|
|
219
|
-
// The grant lock covers reservation and decisions on this machine.
|
|
220
|
-
const r = (() => {
|
|
221
|
-
// Fence: only the watcher that holds the seat reserves.
|
|
222
|
-
if (readSession(handle)?.pid !== process.pid)
|
|
223
|
-
return { why: 'this watcher no longer holds the seat', lost: true };
|
|
224
|
-
const gr = D.grantOf(all, R.authorityAt, grp.grant);
|
|
225
|
-
if (!gr)
|
|
226
|
-
return { why: `grant ${short(grp.grant)} is not an approved decision with a budget` };
|
|
227
|
-
if (gr.revoked)
|
|
228
|
-
return { why: `grant ${short(gr.id)} was revoked`, exhausted: true, gr };
|
|
229
|
-
const u = D.usageOf(all, gr);
|
|
230
|
-
if (u.left <= 0)
|
|
231
|
-
return { why: `grant ${short(gr.id)} is spent: ${u.runs}/${gr.budget.runs} runs`, exhausted: true, gr };
|
|
232
|
-
if (u.open >= gr.budget.concurrency)
|
|
233
|
-
return { why: `grant ${short(gr.id)} has ${u.open} run(s) open, concurrency ${gr.budget.concurrency}`, wait: true };
|
|
234
|
-
const run = `${raw}.${process.pid}.${Date.now().toString(36)}.${runSeq++}`;
|
|
235
|
-
append(R, me, compose(`usage: reserve a run of ${me}`, [['To', OPERATOR], ['Kind', 'usage'], ['Grant', gr.id], ['Usage', 'reserve'], ['Run', run]]));
|
|
236
|
-
return { gr, run };
|
|
237
|
-
})();
|
|
238
|
-
if (r.lost)
|
|
239
|
-
return { runs: [], hold: true, lost: true };
|
|
240
|
-
if (r.wait) {
|
|
241
|
-
hold = true;
|
|
242
|
-
note(`watch: ${r.why}; waiting`);
|
|
243
|
-
continue;
|
|
244
|
-
}
|
|
245
|
-
if (r.why) {
|
|
246
|
-
note(`watch: ${r.why}`);
|
|
247
|
-
const key = `${grp.task?.id}/${grp.grant}`;
|
|
248
|
-
if (r.exhausted && grp.task && !exhausted[key]) {
|
|
249
|
-
exhausted[key] = true;
|
|
250
|
-
const t = taskOf(all, grp.task, P);
|
|
251
|
-
const last = grp.msgs.at(-1);
|
|
252
|
-
// The profile names its waiting state, if it has one; otherwise the answer carries no state.
|
|
253
|
-
if (isOpen(t, P))
|
|
254
|
-
append(R, me, compose(`${r.why}; waiting for a new grant`, [['To', [...new Set([t.requester, OPERATOR])].join(', ')], ['Re', last.id], ['State', P.waiting], ['Hop', String(last.hopEff + 1)]]));
|
|
255
|
-
}
|
|
256
|
-
continue;
|
|
257
|
-
}
|
|
258
|
-
runs.push({ ...grp, run: r.run, timeout: r.gr.budget['run-seconds'] });
|
|
259
|
-
}
|
|
260
|
-
const pending = [...new Set([...retry.map(m => m.id), ...runs.flatMap(r => r.msgs.map(m => m.id))])];
|
|
261
|
-
saveState(R, me, { ...loadState(R, me), heartbeatSeen, exhausted, pending, runs: ownRuns,
|
|
262
|
-
...(hold ? {} : { watched: cursors }) });
|
|
263
|
-
return { runs, hold, lost: false };
|
|
264
|
-
}));
|
|
265
|
-
if (plan.lost) {
|
|
266
|
-
log(`watch: the seat of ${me} was taken over; stopping`);
|
|
267
|
-
return 0;
|
|
268
|
-
}
|
|
269
|
-
let exitCode = 0;
|
|
270
|
-
const settle = (run, seconds, exit, why) => append(R, me, compose(`usage: settle a run of ${me}${why ? ` (${why})` : ''}`, [['To', OPERATOR], ['Kind', 'usage'], ['Grant', run.grant], ['Usage', 'settle'], ['Run', run.run], ['Seconds', String(seconds)], ['Exit', String(exit)]]));
|
|
271
|
-
for (const run of plan.runs) {
|
|
272
|
-
// Spawn under the same locks as revocation and stop; wait for the turn after releasing them.
|
|
273
|
-
const next = locked(`grant-${H.name}`, () => {
|
|
274
|
-
if (run.grant) {
|
|
275
|
-
const { logs } = readerLock(R, me, () => loadRoomUnlocked(R, me));
|
|
276
|
-
const gr = D.grantOf(link(logs), R.authorityAt, run.grant);
|
|
277
|
-
if (!gr || gr.revoked)
|
|
278
|
-
return { why: !gr ? 'its grant is no longer valid' : 'its grant was revoked' };
|
|
279
|
-
}
|
|
280
|
-
readerLock(R, me, () => {
|
|
281
|
-
const st = loadState(R, me);
|
|
282
|
-
saveState(R, me, { ...st, inflight: { seen: st.seen ?? {} } });
|
|
283
|
-
});
|
|
284
|
-
return locked('sessions', () => {
|
|
285
|
-
const cur = readSession(handle);
|
|
286
|
-
if (!cur || cur.pid !== process.pid)
|
|
287
|
-
return { why: 'the seat was taken over' };
|
|
288
|
-
if (cur.state !== 'active')
|
|
289
|
-
return { why: 'the watcher was stopped' };
|
|
290
|
-
note(`watch: ${run.msgs.length} new${run.grant ? ` under grant ${short(run.grant)}` : ''}: ${cmd}`);
|
|
291
|
-
return { done: turn(cmd, run.timeout, { ...process.env, RINGI_HOME: HOME, RINGI_SESSION: raw, RINGI_MSGS: run.msgs.map(m => m.id).join('\n'), RINGI_GRANT: run.grant ?? '' }) };
|
|
292
|
-
});
|
|
293
|
-
});
|
|
294
|
-
if (next.why) {
|
|
295
|
-
note(`watch: not starting the next turn: ${next.why}`);
|
|
296
|
-
if (run.run)
|
|
297
|
-
settle(run, 0, 125, `not started: ${next.why}`);
|
|
298
|
-
continue;
|
|
299
|
-
}
|
|
300
|
-
const r = await next.done;
|
|
301
|
-
note(`watch: exit ${r.code ?? r.signal}${r.timedOut ? ' (stopped at the grant\'s run-seconds)' : ''} after ${r.seconds}s`);
|
|
302
|
-
// Settled only once the whole turn, descendants included, has ended.
|
|
303
|
-
if (run.run)
|
|
304
|
-
settle(run, r.seconds, r.code ?? 128);
|
|
305
|
-
readerLock(R, me, () => {
|
|
306
|
-
const st = loadState(R, me), delivered = new Set(run.msgs.map(m => m.id));
|
|
307
|
-
// A deadline is an intentional budget stop, not a delivery failure to spend another run on.
|
|
308
|
-
const deliveredTurn = r.code === 0 || r.timedOut;
|
|
309
|
-
saveState(R, me, { ...st, inflight: undefined, ...(deliveredTurn
|
|
310
|
-
? { pending: (st.pending ?? []).filter(id => !delivered.has(id)) }
|
|
311
|
-
: { seen: st.inflight?.seen ?? st.seen }) });
|
|
312
|
-
});
|
|
313
|
-
if (r.code !== 0 || r.timedOut)
|
|
314
|
-
exitCode ||= r.code || 128;
|
|
315
|
-
}
|
|
316
|
-
if (w.once)
|
|
317
|
-
return exitCode || (plan.hold ? 4 : 0);
|
|
318
|
-
await sleep(interval);
|
|
319
|
-
}
|
|
320
|
-
};
|
|
321
|
-
//# sourceMappingURL=watch.js.map
|