{"id":50415278,"url":"https://github.com/aibtcdev/agent-runtime","last_synced_at":"2026-05-31T05:30:35.815Z","repository":{"id":354221709,"uuid":"1210867961","full_name":"aibtcdev/agent-runtime","owner":"aibtcdev","description":"Reusable single-VM agent runtime extracted from Arc/Loom/Forge lessons","archived":false,"fork":false,"pushed_at":"2026-05-28T20:32:52.000Z","size":412,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-28T22:16:37.699Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aibtcdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-14T20:51:19.000Z","updated_at":"2026-05-28T20:32:57.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/aibtcdev/agent-runtime","commit_stats":null,"previous_names":["aibtcdev/agent-runtime"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aibtcdev/agent-runtime","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aibtcdev%2Fagent-runtime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aibtcdev%2Fagent-runtime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aibtcdev%2Fagent-runtime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aibtcdev%2Fagent-runtime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aibtcdev","download_url":"https://codeload.github.com/aibtcdev/agent-runtime/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aibtcdev%2Fagent-runtime/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33720897,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-31T05:30:34.359Z","updated_at":"2026-05-31T05:30:35.807Z","avatar_url":"https://github.com/aibtcdev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# agent-runtime\n\nMinimum runnable shared runtime extracted from the Phase 2 contract.\n\nThis proof keeps the runtime intentionally small:\n\n- explicit task intake\n- deterministic context assembly\n- adapter-based execution\n- SQLite persistence\n- dispatch lock plus retry handling\n- CLI operator controls\n- LAN web/API operator visibility\n\nShared `agent-cli` driver support now exists for `codex`, `claude-code`, and `hermes-agent`. The current live Lumen proving config still enables only `ollama-generate` plus `codex` until the Claude and Hermes launch contracts are pinned per host.\nThe `script` adapter mode is also first-class for deterministic work such as AIBTC heartbeat, so those checks flow through the same task, attempt, SQLite, and audit-artifact path as model-backed dispatch.\n\nThe CLI is the primary agent execution surface: dispatch cycles, health checks, workflow transitions, and bridge intake run through `src/cli.ts`. The web server is the v1 LAN coordination surface for humans and sibling agents on the same private network. It exposes runtime state, tasks, events, artifacts, snapshots, and a bounded operator task queue endpoint.\n\n## Lumen Status\n\nLumen is now live as a proving runtime on `dev@192.168.1.16` under `deploy/lumen/runtime.lumen.json`. The real host exit condition in `deploy/lumen/DEPLOY.md` has been satisfied:\n\n- manual `github-story` bring-up passed\n- manual `discord-reply` bring-up passed\n- `agent-runtime-operator@lumen.service` is enabled and active\n- `agent-runtime-dispatch@lumen.timer` is enabled and active\n- the operator UI is reachable on `127.0.0.1:4314`\n- Hermes remains intact beside the proving runtime\n\nCurrent intended use is narrow and operator-facing:\n\n- GitHub merge/PR story summaries\n- Discord explanation/reply tasks\n- small proving queues observed through the UI, LAN API, systemd logs, and runtime JSONL logs\n\nFor the live host, start with these paths and surfaces:\n\n- runtime config: `deploy/lumen/runtime.lumen.json`\n- host override example: `deploy/lumen/runtime.lumen.host.example.json`\n- bring-up and host evidence: `deploy/lumen/DEPLOY.md`\n- adapter contracts: `deploy/ADAPTER_CONTRACTS.md`\n- clone contract: `deploy/CLONE_CONTRACT.md`\n- agent package template: `templates/agent-package/`\n- operator UI: `http://127.0.0.1:4314/`\n- services: `agent-runtime-operator@lumen.service`, `agent-runtime-dispatch@lumen.timer`, `agent-runtime-run-once@lumen.service`\n\n\n## Commands\n\nInstall a local config first:\n\n```bash\ncp config/runtime.example.json config/runtime.json\n```\n\nQueue a task:\n\n```bash\nbun run src/cli.ts intake --json '{\n  \"kind\": \"github-story\",\n  \"source\": \"github\",\n  \"priority\": 5,\n  \"payload\": {\n    \"repo\": \"aibtcdev/agent-runtime\",\n    \"summary\": \"Summarize what this PR means for operators\"\n  },\n  \"requested_profile\": \"lumen\"\n}'\n```\n\nQueue a task for the future:\n\n```bash\nbun run src/cli.ts intake --json '{\n  \"kind\": \"aibtc-checkin\",\n  \"source\": \"operator:future-checkin\",\n  \"subject\": \"AIBTC check-in\",\n  \"payload\": { \"check\": \"heartbeat\" },\n  \"requested_adapter\": \"aibtc-heartbeat\",\n  \"schedule\": { \"delay_minutes\": 30 }\n}'\n```\n\nCreate a recurring schedule. Dispatch cycles run due schedules before workflow evaluation, and `schedule-tick` is available when operators want to enqueue due work explicitly.\n\n```bash\nbun run src/cli.ts schedule-create --json '{\n  \"name\": \"aibtc-checkin\",\n  \"interval_seconds\": 305,\n  \"task\": {\n    \"kind\": \"aibtc-checkin\",\n    \"source\": \"schedule:aibtc-checkin\",\n    \"subject\": \"AIBTC check-in\",\n    \"payload\": { \"check\": \"heartbeat\" },\n    \"requested_adapter\": \"aibtc-heartbeat\"\n  }\n}'\n\nbun run src/cli.ts schedule-tick\n```\n\nThe built-in fleet heartbeat target is 305 seconds, which is 5 minutes and 5 seconds.\n\nFleet heartbeat check-ins should be produced by this recurring schedule only. Do not run a separate heartbeat sensor or sidecar timer for the same task; duplicate producers can hit the AIBTC rate limit and obscure the task history.\n\nCatch-up policy is coalesced by default: each schedule evaluation creates at most one task for a due schedule, then advances `next_run_at` by one interval from the evaluation time. This preserves evidence that a check was missed without flooding the queue after downtime or replaying stale heartbeat slots into a rate limit.\n\nIngest a sensor event. Sensor events are deduped by `dedupe_key` and may enqueue a task, create or reuse a workflow, or both.\n\n```bash\nbun run src/cli.ts sensor-event --json '{\n  \"sensor_id\": \"discord-mentions\",\n  \"event_id\": \"message-123\",\n  \"source_ref\": \"discord://channel/message-123\",\n  \"dedupe_key\": \"discord:message-123\",\n  \"payload\": { \"summary\": \"external request\" },\n  \"proposed_workflow\": {\n    \"template\": \"goal-loop\",\n    \"instance_key\": \"discord-message-123\",\n    \"context\": {\n      \"summary\": \"Respond to Discord request\",\n      \"objective\": \"Investigate and respond with evidence\"\n    }\n  }\n}'\n```\n\nRun one dispatch cycle:\n\n```bash\nbun run src/cli.ts run-once\n```\n\nInspect runtime status:\n\n```bash\nbun run src/cli.ts status\n```\n\nRun health checks:\n\n```bash\nbun run src/cli.ts healthcheck\n```\n\nRun tests:\n\n```bash\nbun test\n```\n\nUpdate a remote agent runtime from this repo:\n\n```bash\nscripts/update-agent-runtime.sh --agent spark --host dev@192.168.1.12 --port 4314\nscripts/update-agent-runtime.sh --agent forge --host dev@192.168.1.15 --port 4314\nscripts/update-agent-runtime.sh --agent lumen --host dev@192.168.1.16 --port 4314\n```\n\nThe update script stops dispatch, backs up the agent DB, fast-forwards the remote repo from `origin/main`, runs install/typecheck/tests/healthcheck, applies schema migrations through `status`, restarts services, and optionally probes the LAN API.\n\nCreate a workflow:\n\n```bash\nbun run src/cli.ts workflow-create \\\n  --template community-research \\\n  --instance_key lumen-community-wiki \\\n  --context '{\"slug\":\"lumen-community-wiki\",\"topic\":\"AIBTC community wiki\",\"output_path\":\"community-wiki/aibtc-basics.md\"}'\n```\n\nInspect workflows:\n\n```bash\nbun run src/cli.ts workflow-list\nbun run src/cli.ts workflow-show --instance_key lumen-community-wiki\n```\n\nAdvance a workflow explicitly:\n\n```bash\nbun run src/cli.ts workflow-transition --id 1 --state draft-community-wiki-outline\n```\n\nLumen proving deploy artifacts:\n\n```text\ndeploy/lumen/runtime.lumen.json\ndeploy/lumen/DEPLOY.md\ndeploy/BASE_AGENT_CHECKLIST.md\ndeploy/systemd/agent-runtime-run-once@.service\ndeploy/systemd/agent-runtime-dispatch@.timer\ndeploy/systemd/agent-runtime-operator@.service\n```\n\nUse `deploy/lumen/DEPLOY.md` as the bring-up checklist. The current Lumen proving contract is intentionally narrow: GitHub-story runs are summary-only and should complete with `artifact_paths: []` unless Lumen explicitly writes managed artifacts.\n\nFor host-specific adapter wiring, keep the repo-safe base config unchanged and create a local sibling override that `extends` it. `deploy/lumen/runtime.lumen.host.example.json` shows the intended pattern for Claude and Hermes on Lumen.\n\nIf you deploy with `rsync --delete`, keep the real host override outside the synced repo tree, for example under `~/.config/agent-runtime/`, and use an absolute `extends` path back to the checked-in base config.\n\nRun the operator UI and LAN API:\n\n```bash\nbun run src/web.ts --config config/runtime.json --host 127.0.0.1 --port 4314\n```\n\nLAN API surfaces:\n\n- `/` static operator view\n- `/api/state` runtime state, task counts, and last event\n- `/api/heartbeat` lightweight liveness check\n- `/api/workflows`, `/api/tasks`, `/api/events`\n- `/api/schedules` list or upsert recurring schedules\n- `POST /api/schedules/tick` enqueue due scheduled work\n- `/api/sensors/events` list or ingest deduped sensor events\n- `POST /api/tasks/queue` queue a bounded operator task with a JSON `message`\n- `POST /api/tasks/:task_id/cancel` cancel a non-running task as `operator_canceled`\n- `/api/pause` read or set runtime-owned dispatch pause state; paused dispatchers do not claim new work\n- `/api/artifacts`, `/api/artifact`\n- `/api/snapshots`, `/api/snapshot`, `/api/report`, `/api/report/latest`\n- `/api/stream` live SSE updates\n- `/artifacts`, `/snapshots` browser-readable JSON views for runtime inspection\n\nOptional LAN fleet UI lives in the separate `aibtcdev/agent-runtime-ui` repo and can proxy multiple hosts that expose this API:\n\n```bash\n# git clone git@github.com:aibtcdev/agent-runtime-ui.git ~/agent-runtime-ui\n# cd ~/agent-runtime-ui\n# cp config/fleet.example.json config/fleet.json\n# cp deploy/systemd/agent-runtime-ui.service ~/.config/systemd/user/\n# systemctl --user daemon-reload\n# systemctl --user enable --now agent-runtime-ui.service\n```\n\nQueue a Lumen GitHub task through the thin bridge:\n\n```bash\nbun run src/cli.ts bridge-github --file fixtures/github-pr-merged.json\n```\n\nQueue a Lumen Discord task through the thin bridge:\n\n```bash\nbun run src/cli.ts bridge-discord --file fixtures/discord-mention.json\n```\n\n## Layout\n\n```text\nagent-runtime/\n  config/\n  profiles/\n  src/\n  state/\n```\n\nThe runtime does not include Discord business logic, GitHub polling, Arc identity, Loom publishing, or Forge fleet UI work. Those belong in thin bridges or later migrations.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faibtcdev%2Fagent-runtime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faibtcdev%2Fagent-runtime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faibtcdev%2Fagent-runtime/lists"}