agroute 0.1.0__tar.gz

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 (54) hide show
  1. agroute-0.1.0/.agents/plugins/marketplace.json +11 -0
  2. agroute-0.1.0/.antigravity-plugin/plugin.json +9 -0
  3. agroute-0.1.0/.claude-plugin/marketplace.json +12 -0
  4. agroute-0.1.0/.claude-plugin/plugin.json +7 -0
  5. agroute-0.1.0/.readthedocs.yaml +13 -0
  6. agroute-0.1.0/AGENTS.md +39 -0
  7. agroute-0.1.0/CHANGELOG.md +20 -0
  8. agroute-0.1.0/LICENSE +21 -0
  9. agroute-0.1.0/MANIFEST.in +11 -0
  10. agroute-0.1.0/PKG-INFO +129 -0
  11. agroute-0.1.0/README.md +95 -0
  12. agroute-0.1.0/docs/changelog.md +2 -0
  13. agroute-0.1.0/docs/conf.py +10 -0
  14. agroute-0.1.0/docs/configuration.md +100 -0
  15. agroute-0.1.0/docs/contributing.md +31 -0
  16. agroute-0.1.0/docs/index.md +32 -0
  17. agroute-0.1.0/docs/quickstart.md +82 -0
  18. agroute-0.1.0/docs/reference.md +78 -0
  19. agroute-0.1.0/docs/releasing.md +22 -0
  20. agroute-0.1.0/docs/requirements.txt +3 -0
  21. agroute-0.1.0/docs/session_handoff_format.md +15 -0
  22. agroute-0.1.0/docs/skills.md +48 -0
  23. agroute-0.1.0/plugin.json +8 -0
  24. agroute-0.1.0/pyproject.toml +64 -0
  25. agroute-0.1.0/scripts/check +6 -0
  26. agroute-0.1.0/scripts/check-plugins.py +35 -0
  27. agroute-0.1.0/scripts/verify-wheel.py +211 -0
  28. agroute-0.1.0/setup.cfg +4 -0
  29. agroute-0.1.0/skills/agroute/SKILL.md +44 -0
  30. agroute-0.1.0/skills/agroute/references/hosts.md +27 -0
  31. agroute-0.1.0/skills/agroute/references/usage.md +49 -0
  32. agroute-0.1.0/skills/agroute/references/workflow.md +69 -0
  33. agroute-0.1.0/src/agroute/__init__.py +9 -0
  34. agroute-0.1.0/src/agroute/__main__.py +3 -0
  35. agroute-0.1.0/src/agroute/cli.py +249 -0
  36. agroute-0.1.0/src/agroute/config.py +272 -0
  37. agroute-0.1.0/src/agroute/data/default_config.toml +103 -0
  38. agroute-0.1.0/src/agroute/files.py +23 -0
  39. agroute-0.1.0/src/agroute/py.typed +0 -0
  40. agroute-0.1.0/src/agroute/router.py +539 -0
  41. agroute-0.1.0/src/agroute/state.py +137 -0
  42. agroute-0.1.0/src/agroute/usage.py +513 -0
  43. agroute-0.1.0/src/agroute/validation.py +100 -0
  44. agroute-0.1.0/src/agroute.egg-info/PKG-INFO +129 -0
  45. agroute-0.1.0/src/agroute.egg-info/SOURCES.txt +52 -0
  46. agroute-0.1.0/src/agroute.egg-info/dependency_links.txt +1 -0
  47. agroute-0.1.0/src/agroute.egg-info/entry_points.txt +2 -0
  48. agroute-0.1.0/src/agroute.egg-info/requires.txt +10 -0
  49. agroute-0.1.0/src/agroute.egg-info/top_level.txt +1 -0
  50. agroute-0.1.0/tests/conftest.py +12 -0
  51. agroute-0.1.0/tests/test_cli.py +157 -0
  52. agroute-0.1.0/tests/test_config_and_state.py +141 -0
  53. agroute-0.1.0/tests/test_router_and_howhard.py +217 -0
  54. agroute-0.1.0/tests/test_usage.py +108 -0
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "agroute",
3
+ "plugins": [
4
+ {
5
+ "name": "agroute",
6
+ "source": {"source": "local", "path": "./"},
7
+ "policy": {"installation": "AVAILABLE", "authentication": "ON_INSTALL"},
8
+ "category": "Productivity"
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema": "https://antigravity.google/schemas/v1/plugin.json",
3
+ "name": "agroute",
4
+ "displayName": "agroute",
5
+ "version": "0.1.0",
6
+ "description": "Route delegated tasks across Codex, Claude Code, and Antigravity within live usage limits using howhard.",
7
+ "author": {"name": "agroute contributors"},
8
+ "repository": "https://github.com/xu-hao/agroute"
9
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "agroute",
3
+ "description": "The agroute skill for usage-limit-aware local agent routing with howhard.",
4
+ "owner": {"name": "agroute contributors"},
5
+ "plugins": [
6
+ {
7
+ "name": "agroute",
8
+ "source": "./",
9
+ "description": "Usage-limit-aware local agent routing across Codex, Claude Code, and Antigravity with howhard."
10
+ }
11
+ ]
12
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "agroute",
3
+ "version": "0.1.0",
4
+ "description": "Route delegated tasks across Codex, Claude Code, and Antigravity within live usage limits using howhard.",
5
+ "author": {"name": "agroute contributors"},
6
+ "repository": "https://github.com/xu-hao/agroute"
7
+ }
@@ -0,0 +1,13 @@
1
+ version: 2
2
+ build:
3
+ os: ubuntu-24.04
4
+ tools:
5
+ python: "3.12"
6
+ sphinx:
7
+ configuration: docs/conf.py
8
+ fail_on_warning: true
9
+ python:
10
+ install:
11
+ - requirements: docs/requirements.txt
12
+ - method: pip
13
+ path: .
@@ -0,0 +1,39 @@
1
+ # agroute contributor instructions
2
+
3
+ Keep this file limited to repository-wide guardrails. Follow the canonical contracts and
4
+ procedures listed in [docs/index.md](docs/index.md). These guardrails adopt AGCoord's
5
+ contributor workflow for this repository.
6
+
7
+ - Track every code, test, documentation, or packaging change with a descriptive issue.
8
+ Pair every issue number with a sentence explaining the work it tracks. Do not file an
9
+ issue solely for machine-local installation, deployment, configuration, service
10
+ lifecycle, or other operator state; create one only when that work also requires a
11
+ repository change or the user explicitly requests an issue.
12
+ - Develop and validate only in an issue-specific Git worktree branched from `main`.
13
+ Preserve unrelated work and do not develop in the primary checkout.
14
+ - Verify behavior at public boundaries. Start bug fixes with a failing behavioral test;
15
+ accompany runtime changes with focused tests, affected canonical documentation, and a
16
+ `CHANGELOG.md` entry when the change is user-facing.
17
+ - A documentation-only change needs no tests or AGCoord gate. It qualifies only when every
18
+ changed path is `README.md`, `CHANGELOG.md`, `AGENTS.md`, Markdown below `docs/`, or a
19
+ `.png` or `.svg` image below `docs/assets/` whose provenance is recorded in
20
+ `docs/assets/README.md`. Verify the exact pull-request file list and diff, then merge it
21
+ through the forge; the issue, worktree, branch, pull-request, and no-direct-target-push
22
+ rules still apply.
23
+ - Tests own and stop every process, repository, and temporary state they create.
24
+ Never inspect or clean another agent's state.
25
+ - Keep the package independent of a parent application or sibling checkout.
26
+ Put project-specific assumptions in optional configuration; the ordinary workflow
27
+ must work with packaged defaults and explicit CLI/API inputs.
28
+ - For every other change after bootstrap, route checks and publication through the local
29
+ coordinator, declare every scarce resource, and never submit coordinated work from an
30
+ admitted job. Gate and publish through one `agc land` request; never bypass or separate
31
+ its verdict from publication.
32
+ - Never upload an agroute distribution to PyPI unless the user explicitly requests it.
33
+ Permission to implement, test, commit, push, merge, tag, or create a GitHub release
34
+ does not authorize an upload.
35
+ - End changed work with the four-part [session handoff](docs/session_handoff_format.md);
36
+ answer read-only questions directly without an empty handoff shell.
37
+ - Follow the [contributor workflow](docs/contributing.md) for commands, bootstrap,
38
+ recovery, and cleanup. The [routing and storage contracts](docs/reference.md) and
39
+ [release guide](docs/releasing.md) define the corresponding component contracts.
@@ -0,0 +1,20 @@
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ ## 0.1.0 — 2026-11-08
6
+
7
+ - Build `agroute` (`agroute` CLI, Python `Router` API, and native plugin manifests for
8
+ Codex, Claude Code, and Antigravity) to route delegated tasks across local coding agents
9
+ within live usage limits.
10
+ - Track per-agent (`codex`, `claude`, `agy`) quota windows (`session_5h`, `weekly_7d`, and
11
+ model-tier limits) and rate-limit cooldowns from native command and event-stream outputs
12
+ (`agroute usage show|set|ingest|probe|clear`) with automatic reset-window expiration.
13
+ - Emit `howhard` 2.1+-compatible candidate lists (`agroute candidates`) and named
14
+ `[inventories]` (`agroute inventory`) with provider-qualified `<agent>/<model>` identities,
15
+ separating `native_candidates` (when `target == host`) from `cli_candidates` (when
16
+ `target != host`).
17
+ - Resolve `howhard` decision receipts (`agroute plan`) into deterministic
18
+ `agroute-execution-plan-v1` payloads (`invoke_subagent`, `Agent`, or `spawn_agent` when
19
+ `target == host`; `codex exec`, `claude -p`, or `agy -p` when `target != host`), with
20
+ configurable `host_affinity_epsilon` and explicit `howhard observe` feedback guidance.
agroute-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 agroute contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,11 @@
1
+ include AGENTS.md CHANGELOG.md LICENSE
2
+ include .readthedocs.yaml
3
+ include plugin.json
4
+ include .agents/plugins/marketplace.json
5
+ include .claude-plugin/plugin.json .claude-plugin/marketplace.json
6
+ include .antigravity-plugin/plugin.json
7
+ recursive-include docs *.md *.py *.txt
8
+ recursive-exclude docs/_build *
9
+ recursive-include scripts *
10
+ recursive-include skills *.md
11
+ recursive-include tests *.py
agroute-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,129 @@
1
+ Metadata-Version: 2.4
2
+ Name: agroute
3
+ Version: 0.1.0
4
+ Summary: Configurable local agent router across Codex, Claude Code, and Antigravity with native usage-limit filtering and howhard integration.
5
+ License-Expression: MIT
6
+ Project-URL: Homepage, https://github.com/xu-hao/agroute
7
+ Project-URL: Repository, https://github.com/xu-hao/agroute
8
+ Project-URL: Issues, https://github.com/xu-hao/agroute/issues
9
+ Project-URL: Changelog, https://github.com/xu-hao/agroute/blob/main/CHANGELOG.md
10
+ Keywords: coding-agents,claude-code,codex,antigravity,agent-router,howhard,rate-limits
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: POSIX :: Linux
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3 :: Only
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Classifier: Typing :: Typed
22
+ Requires-Python: >=3.11
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Provides-Extra: test
26
+ Requires-Dist: pytest>=8; extra == "test"
27
+ Requires-Dist: build>=1.2; extra == "test"
28
+ Requires-Dist: twine>=5; extra == "test"
29
+ Provides-Extra: docs
30
+ Requires-Dist: sphinx>=8; extra == "docs"
31
+ Requires-Dist: myst-parser>=4; extra == "docs"
32
+ Requires-Dist: furo; extra == "docs"
33
+ Dynamic: license-file
34
+
35
+ # agroute
36
+
37
+ *Route delegated agent tasks across local coding agents within live usage limits.*
38
+
39
+ `agroute` is a configurable, **plan-only** local task router for coding agents (`codex`,
40
+ `claude`, and `agy`). Given a host agent and native quota/rate-limit state, it filters
41
+ available `(agent, model, effort)` candidate routes, emits a [`howhard` 2.1+](https://github.com/xu-hao/howhard)
42
+ candidate inventory with provider-qualified model identities (`<agent>/<model>`), and
43
+ resolves a `howhard` decision into a deterministic execution plan:
44
+
45
+ - **Native host delegation** (`target_agent == host_agent`): emits a structured native
46
+ subagent tool directive for the current host (`invoke_subagent` in Antigravity,
47
+ `Agent` in Claude Code, or `spawn_agent` in Codex).
48
+ - **Cross-agent CLI execution** (`target_agent != host_agent`): emits a non-interactive
49
+ CLI execution plan (`codex exec --json`, `claude -p --verbose --output-format stream-json`,
50
+ or `agy -p --output-format stream-json`) with exact model, effort, and output-capture
51
+ adapter metadata.
52
+
53
+ `agroute` never spawns worker processes itself. Model/effort selection, outcome observation,
54
+ portable execution accounting, and writable semantic memory remain in `howhard`.
55
+
56
+ ## Quickstart
57
+
58
+ You need Python 3.11+, a POSIX shell, Git, [`howhard` 2.1+](https://pypi.org/project/howhard/2.1.0/),
59
+ and a current Codex, Claude Code, or Antigravity client with native plugin support.
60
+
61
+ Install `agroute` and `howhard` in your project environment:
62
+
63
+ ```sh
64
+ python3 -m venv .venv-agroute
65
+ . .venv-agroute/bin/activate
66
+ python -m pip install "agroute==0.1.0" "howhard>=2.1.0"
67
+ agroute --version
68
+ ```
69
+
70
+ Expect `agroute 0.1.0`. Keep the environment active and start your coding agent from the
71
+ same shell so it can find `agroute` and `howhard`.
72
+
73
+ Install the native plugin for your host:
74
+
75
+ ```sh
76
+ # Codex
77
+ codex plugin marketplace add xu-hao/agroute
78
+ codex plugin add agroute@agroute
79
+ ```
80
+
81
+ ```sh
82
+ # Claude Code
83
+ claude plugin marketplace add xu-hao/agroute
84
+ claude plugin install agroute@agroute
85
+ ```
86
+
87
+ ```sh
88
+ # Antigravity
89
+ agy plugin install https://github.com/xu-hao/agroute
90
+ agy plugin list
91
+ ```
92
+
93
+ Invoke the skill explicitly with `$agroute` or `/skills` in Codex, `/agroute:agroute` in
94
+ Claude Code, or `/agroute` in Antigravity.
95
+
96
+ ## Core workflow
97
+
98
+ 1. **Inspect or update native quota state**:
99
+
100
+ ```sh
101
+ agroute usage show --json
102
+ agroute usage ingest --agent codex --file /tmp/codex-status.jsonl --json
103
+ agroute usage set --agent claude --session-used-pct 92 --session-reset-at 2026-11-08T21:00:00Z --json
104
+ ```
105
+
106
+ 2. **Emit filtered `howhard` candidates for the current host**:
107
+
108
+ ```sh
109
+ agroute candidates --host agy --output /tmp/task-candidates.json --json
110
+ ```
111
+
112
+ 3. **Select a cell with `howhard`** (calling-agent `context`/`retrieve`/`decide` or `pick`)
113
+ and **resolve the decision into an execution plan**:
114
+
115
+ ```sh
116
+ agroute plan --host agy --decision /tmp/task-decision.json --prompt-file /tmp/task.txt --json
117
+ ```
118
+
119
+ 4. **Execute the returned plan** (native tool call when `target_agent == host_agent`, or
120
+ CLI command when `target_agent != host_agent`) and **record the outcome in `howhard`**:
121
+
122
+ ```sh
123
+ howhard observe DECISION_ID clean --id EXECUTION_ID --json
124
+ ```
125
+
126
+ See the [quickstart](docs/quickstart.md), [documentation index](docs/index.md),
127
+ [routing and storage contracts](docs/reference.md), [configuration guide](docs/configuration.md),
128
+ [skill guide](docs/skills.md), and [changelog](CHANGELOG.md). Contributors use
129
+ [AGCoord and isolated worktrees](docs/contributing.md).
@@ -0,0 +1,95 @@
1
+ # agroute
2
+
3
+ *Route delegated agent tasks across local coding agents within live usage limits.*
4
+
5
+ `agroute` is a configurable, **plan-only** local task router for coding agents (`codex`,
6
+ `claude`, and `agy`). Given a host agent and native quota/rate-limit state, it filters
7
+ available `(agent, model, effort)` candidate routes, emits a [`howhard` 2.1+](https://github.com/xu-hao/howhard)
8
+ candidate inventory with provider-qualified model identities (`<agent>/<model>`), and
9
+ resolves a `howhard` decision into a deterministic execution plan:
10
+
11
+ - **Native host delegation** (`target_agent == host_agent`): emits a structured native
12
+ subagent tool directive for the current host (`invoke_subagent` in Antigravity,
13
+ `Agent` in Claude Code, or `spawn_agent` in Codex).
14
+ - **Cross-agent CLI execution** (`target_agent != host_agent`): emits a non-interactive
15
+ CLI execution plan (`codex exec --json`, `claude -p --verbose --output-format stream-json`,
16
+ or `agy -p --output-format stream-json`) with exact model, effort, and output-capture
17
+ adapter metadata.
18
+
19
+ `agroute` never spawns worker processes itself. Model/effort selection, outcome observation,
20
+ portable execution accounting, and writable semantic memory remain in `howhard`.
21
+
22
+ ## Quickstart
23
+
24
+ You need Python 3.11+, a POSIX shell, Git, [`howhard` 2.1+](https://pypi.org/project/howhard/2.1.0/),
25
+ and a current Codex, Claude Code, or Antigravity client with native plugin support.
26
+
27
+ Install `agroute` and `howhard` in your project environment:
28
+
29
+ ```sh
30
+ python3 -m venv .venv-agroute
31
+ . .venv-agroute/bin/activate
32
+ python -m pip install "agroute==0.1.0" "howhard>=2.1.0"
33
+ agroute --version
34
+ ```
35
+
36
+ Expect `agroute 0.1.0`. Keep the environment active and start your coding agent from the
37
+ same shell so it can find `agroute` and `howhard`.
38
+
39
+ Install the native plugin for your host:
40
+
41
+ ```sh
42
+ # Codex
43
+ codex plugin marketplace add xu-hao/agroute
44
+ codex plugin add agroute@agroute
45
+ ```
46
+
47
+ ```sh
48
+ # Claude Code
49
+ claude plugin marketplace add xu-hao/agroute
50
+ claude plugin install agroute@agroute
51
+ ```
52
+
53
+ ```sh
54
+ # Antigravity
55
+ agy plugin install https://github.com/xu-hao/agroute
56
+ agy plugin list
57
+ ```
58
+
59
+ Invoke the skill explicitly with `$agroute` or `/skills` in Codex, `/agroute:agroute` in
60
+ Claude Code, or `/agroute` in Antigravity.
61
+
62
+ ## Core workflow
63
+
64
+ 1. **Inspect or update native quota state**:
65
+
66
+ ```sh
67
+ agroute usage show --json
68
+ agroute usage ingest --agent codex --file /tmp/codex-status.jsonl --json
69
+ agroute usage set --agent claude --session-used-pct 92 --session-reset-at 2026-11-08T21:00:00Z --json
70
+ ```
71
+
72
+ 2. **Emit filtered `howhard` candidates for the current host**:
73
+
74
+ ```sh
75
+ agroute candidates --host agy --output /tmp/task-candidates.json --json
76
+ ```
77
+
78
+ 3. **Select a cell with `howhard`** (calling-agent `context`/`retrieve`/`decide` or `pick`)
79
+ and **resolve the decision into an execution plan**:
80
+
81
+ ```sh
82
+ agroute plan --host agy --decision /tmp/task-decision.json --prompt-file /tmp/task.txt --json
83
+ ```
84
+
85
+ 4. **Execute the returned plan** (native tool call when `target_agent == host_agent`, or
86
+ CLI command when `target_agent != host_agent`) and **record the outcome in `howhard`**:
87
+
88
+ ```sh
89
+ howhard observe DECISION_ID clean --id EXECUTION_ID --json
90
+ ```
91
+
92
+ See the [quickstart](docs/quickstart.md), [documentation index](docs/index.md),
93
+ [routing and storage contracts](docs/reference.md), [configuration guide](docs/configuration.md),
94
+ [skill guide](docs/skills.md), and [changelog](CHANGELOG.md). Contributors use
95
+ [AGCoord and isolated worktrees](docs/contributing.md).
@@ -0,0 +1,2 @@
1
+ ```{include} ../CHANGELOG.md
2
+ ```
@@ -0,0 +1,10 @@
1
+ from importlib.metadata import version as distribution_version
2
+
3
+ project = "agroute"
4
+ release = distribution_version("agroute")
5
+ version = release
6
+ extensions = ["myst_parser"]
7
+ source_suffix = {".md": "markdown"}
8
+ master_doc = "index"
9
+ html_theme = "furo"
10
+ exclude_patterns = ["_build"]
@@ -0,0 +1,100 @@
1
+ # Configuration
2
+
3
+ `agroute` layers three configuration sources in order:
4
+
5
+ 1. Packaged defaults (`agroute/data/default_config.toml`).
6
+ 2. Optional user configuration at `${XDG_CONFIG_HOME:-~/.config}/agroute/config.toml`
7
+ (or `AGROUTE_USER_CONFIG`; disable with `--no-user-config`).
8
+ 3. Project `agroute.toml` in the current directory, or `--config PATH`.
9
+
10
+ Unknown keys, out-of-range percentages, negative `host_affinity_epsilon`, bare models containing
11
+ `/` or `:`, and `model_default` effort strings are refused before any state is modified.
12
+
13
+ ## Example `agroute.toml`
14
+
15
+ ```toml
16
+ [routing]
17
+ default_host = "agy"
18
+ host_affinity_epsilon = 0.0
19
+ namespace_separator = "/"
20
+
21
+ [agents.agy]
22
+ enabled = true
23
+ max_session_used_pct = 90.0
24
+ max_weekly_used_pct = 95.0
25
+ max_tier_used_pct = 95.0
26
+ host_reserve_pct = 5.0
27
+ usage_probe_cmd = []
28
+
29
+ [[agents.agy.native_candidates]]
30
+ model = "pro"
31
+ effort = "standard"
32
+ tier = "pro"
33
+
34
+ [[agents.agy.native_candidates]]
35
+ model = "flash"
36
+ effort = "standard"
37
+ tier = "flash"
38
+
39
+ [[agents.agy.cli_candidates]]
40
+ model = "gemini-2.5-pro"
41
+ effort = "high"
42
+ tier = "pro"
43
+
44
+ [agents.codex]
45
+ enabled = true
46
+ max_session_used_pct = 90.0
47
+ max_weekly_used_pct = 95.0
48
+ max_tier_used_pct = 95.0
49
+ host_reserve_pct = 0.0
50
+ usage_probe_cmd = []
51
+
52
+ [[agents.codex.native_candidates]]
53
+ model = "gpt-5.4"
54
+ effort = "high"
55
+
56
+ [[agents.codex.cli_candidates]]
57
+ model = "gpt-5.4"
58
+ effort = "high"
59
+
60
+ [[agents.codex.cli_candidates]]
61
+ model = "gpt-5.4"
62
+ effort = "medium"
63
+
64
+ [agents.claude]
65
+ enabled = true
66
+ max_session_used_pct = 90.0
67
+ max_weekly_used_pct = 95.0
68
+ max_tier_used_pct = 95.0
69
+ host_reserve_pct = 0.0
70
+ usage_probe_cmd = []
71
+
72
+ [[agents.claude.native_candidates]]
73
+ model = "claude-sonnet-4-6"
74
+ effort = "high"
75
+ tier = "sonnet"
76
+
77
+ [[agents.claude.cli_candidates]]
78
+ model = "claude-opus-4-6"
79
+ effort = "high"
80
+ tier = "opus"
81
+
82
+ [[agents.claude.cli_candidates]]
83
+ model = "claude-sonnet-4-6"
84
+ effort = "high"
85
+ tier = "sonnet"
86
+ ```
87
+
88
+ (howhard-inventories)=
89
+ ## Generating `[inventories]` for `howhard.toml`
90
+
91
+ `howhard` 2.1+ accepts explicitly named `[inventories]` in `howhard.toml` selected via
92
+ `howhard ... --inventory NAME` or Python `inventory="NAME"`. Generate a filtered inventory
93
+ table for the current host with:
94
+
95
+ ```sh
96
+ agroute inventory --host agy --name router
97
+ ```
98
+
99
+ When availability changes dynamically with live usage windows, pass the fresh candidate list
100
+ from `agroute candidates --host HOST --output FILE` to `howhard ... --candidates FILE`.
@@ -0,0 +1,31 @@
1
+ # Contributor workflow
2
+
3
+ Track every repository change with a descriptive issue, and report its number with a
4
+ sentence describing the work. Develop and validate in an issue-specific worktree from
5
+ `main`, preserving unrelated changes. Issue #1 specifies the multi-agent router and
6
+ `howhard` integration; issues #2–#7 specify its package skeleton, native quota tracking,
7
+ candidate emission, execution plan resolution, native plugin manifests, and behavioral
8
+ acceptance tests.
9
+
10
+ ```sh
11
+ git worktree add -b issue-N-description ../agroute-issue-N main
12
+ cd ../agroute-issue-N
13
+ python -m venv .venv
14
+ .venv/bin/python -m pip install -e '.[test,docs]'
15
+ agc run --label "agroute tests" --resource cpu=1 -- .venv/bin/python -m pytest
16
+ ```
17
+
18
+ Use the local AGCoord installation for checks and declare resources. Do not submit nested
19
+ coordinator commands from admitted jobs. Tests use synthetic configs and state directories
20
+ in their own temporary directories, exercise public behavior, and own all state they create.
21
+
22
+ Update the affected canonical documents, list new documents in the index, and record
23
+ user-facing changes in `CHANGELOG.md`. `AGENTS.md` is the canonical instruction source;
24
+ `CLAUDE.md` is its relative symlink.
25
+
26
+ The complete validation command is `scripts/check`. It runs tests, builds both distributions,
27
+ verifies wheel and sdist contents/versions in a clean environment, and builds Sphinx with
28
+ warnings treated as errors. Gate and publish through a single `agc land` request using that
29
+ command when a change is ready to land. Never push directly to the target branch or bypass
30
+ the coordinator verdict. Documentation-only changes follow the narrower exemption in the
31
+ root guardrails. End changed work with the [session handoff](session_handoff_format.md).
@@ -0,0 +1,32 @@
1
+ # agroute documentation
2
+
3
+ `agroute` routes delegated coding-agent tasks across Codex (`codex`), Claude Code (`claude`),
4
+ and Antigravity (`agy`) within live usage limits, integrating with `howhard` 2.1+ for
5
+ model/effort selection and learning.
6
+
7
+ ```{toctree}
8
+ :maxdepth: 2
9
+
10
+ quickstart
11
+ reference
12
+ configuration
13
+ skills
14
+ contributing
15
+ releasing
16
+ session_handoff_format
17
+ changelog
18
+ ```
19
+
20
+ - [Quickstart](quickstart.md) — install the Python backend and native plugin, filter candidates,
21
+ resolve a `howhard` decision, and record feedback.
22
+ - [Routing and storage contracts](reference.md) — candidate qualification, native vs. CLI
23
+ execution plans, quota window expiry, `host_affinity_epsilon`, and worktree state.
24
+ - [Configuration](configuration.md) — layered `agroute.toml`, `native_candidates` vs.
25
+ `cli_candidates`, quota limits, and `howhard.toml` `[inventories]` generation.
26
+ - [Native skill installation](skills.md) — Codex, Claude Code, and Antigravity plugin
27
+ installation and coordinating-agent instructions.
28
+ - [Contributor workflow](contributing.md) — issue-tracked Git worktrees and `agc` gates.
29
+ - [Packaging and release](releasing.md) — version synchronization, wheel verification, and PyPI
30
+ release checklist.
31
+ - [Session handoff format](session_handoff_format.md) — four-part closing summary contract.
32
+ - [Changelog](changelog.md) — release history.
@@ -0,0 +1,82 @@
1
+ # Quickstart
2
+
3
+ You need Python 3.11+, a POSIX shell, Git, `howhard` 2.1+, and a current Codex, Claude Code,
4
+ or Antigravity client with native plugin support.
5
+
6
+ ## Install the backend
7
+
8
+ Run these commands from the project where you want to use `agroute`:
9
+
10
+ ```sh
11
+ python3 -m venv .venv-agroute
12
+ . .venv-agroute/bin/activate
13
+ python -m pip install "agroute==0.1.0" "howhard>=2.1.0"
14
+ agroute --version
15
+ ```
16
+
17
+ Expect `agroute 0.1.0`. Keep this environment active and start your coding agent from the
18
+ same shell so it can find `agroute` and `howhard`.
19
+
20
+ ## Install the native plugin
21
+
22
+ The Python package supplies the backend. The native plugin supplies the `agroute` skill.
23
+ Install the plugin through your agent's own plugin manager.
24
+
25
+ Codex:
26
+
27
+ ```sh
28
+ codex plugin marketplace add xu-hao/agroute
29
+ codex plugin add agroute@agroute
30
+ ```
31
+
32
+ Claude Code:
33
+
34
+ ```sh
35
+ claude plugin marketplace add xu-hao/agroute
36
+ claude plugin install agroute@agroute
37
+ ```
38
+
39
+ Antigravity:
40
+
41
+ ```sh
42
+ agy plugin install https://github.com/xu-hao/agroute
43
+ agy plugin list
44
+ ```
45
+
46
+ See [native installation and lifecycle](skills.md) for scope and update commands.
47
+
48
+ ## Route a task within live usage limits
49
+
50
+ 1. **Inspect or update native quota state**:
51
+
52
+ ```sh
53
+ agroute usage show --json
54
+ agroute usage ingest --agent codex --file /tmp/codex-status.jsonl --json
55
+ ```
56
+
57
+ 2. **Emit filtered `howhard` candidates for the current host**:
58
+
59
+ ```sh
60
+ agroute candidates --host agy --output /tmp/task-candidates.json --json
61
+ ```
62
+
63
+ `--output` writes the 1–32 cell JSON array expected by `howhard` (`<agent>/<model>` and
64
+ `<effort>`). When `target == host`, `agroute` uses `native_candidates` supported by the
65
+ host's native subagent tool; when `target != host`, `agroute` uses `cli_candidates`
66
+ supported by the target's non-interactive CLI.
67
+
68
+ 3. **Select a cell with `howhard` and resolve the execution plan**:
69
+
70
+ ```sh
71
+ howhard context task --text-file /tmp/task.txt --candidates /tmp/task-candidates.json --llm off --json
72
+ # After independent baseline forecast, optional retrieval, and decide:
73
+ agroute plan --host agy --decision /tmp/task-decision.json --prompt-file /tmp/task.txt --json
74
+ ```
75
+
76
+ 4. **Execute and record feedback**:
77
+
78
+ - If `execution_mode == "native"`, invoke the host's native delegation tool
79
+ (`invoke_subagent`, `Agent`, or `spawn_agent`) with `invocation.parameters`.
80
+ - If `execution_mode == "cli"`, execute `invocation.argv` and capture the output stream.
81
+ - Follow `feedback` in the returned plan to record the outcome via `howhard observe`,
82
+ attach measured usage via `howhard usage collect` / `attach`, and update `howhard` memory.