quota-boss 0.1.0 → 0.1.1

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.
@@ -0,0 +1,7 @@
1
+ version: 2
2
+ updates:
3
+ # The package has no dependencies, so only the pinned GitHub Actions need updates.
4
+ - package-ecosystem: github-actions
5
+ directory: /
6
+ schedule:
7
+ interval: weekly
@@ -14,10 +14,13 @@ jobs:
14
14
  os: [ubuntu-latest, windows-latest, macos-latest]
15
15
  node: [18, 22]
16
16
  steps:
17
- - uses: actions/checkout@v4
18
- - uses: actions/setup-node@v4
17
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
18
+ with:
19
+ persist-credentials: false
20
+ - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
19
21
  with:
20
22
  node-version: ${{ matrix.node }}
23
+ package-manager-cache: false
21
24
  - name: Check syntax
22
25
  shell: bash
23
26
  run: for f in bin/*.js install.js scripts/*.js test/*.js; do node --check "$f" || exit 1; done
@@ -38,9 +41,10 @@ jobs:
38
41
  secrets:
39
42
  runs-on: ubuntu-latest
40
43
  steps:
41
- - uses: actions/checkout@v4
44
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
42
45
  with:
43
46
  fetch-depth: 0
47
+ persist-credentials: false
44
48
  - name: Install Gitleaks
45
49
  env:
46
50
  GITLEAKS_VERSION: 8.30.1
@@ -0,0 +1,70 @@
1
+ name: Release
2
+
3
+ # Publishes to npm when a version tag is pushed. It uses npm trusted publishing (OIDC), so no npm token is stored:
4
+ # the package settings on npmjs.com name this repository, this workflow file and the "npm" environment as the trusted
5
+ # publisher. The environment only accepts v* tags, so a changed copy of this file on a branch cannot publish.
6
+ on:
7
+ push:
8
+ tags: ['v*']
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ concurrency:
14
+ group: release
15
+ cancel-in-progress: false
16
+
17
+ jobs:
18
+ publish:
19
+ if: github.repository == 'CrazyToto/quota-boss'
20
+ runs-on: ubuntu-latest
21
+ environment: npm
22
+ permissions:
23
+ contents: read
24
+ id-token: write
25
+ steps:
26
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
27
+ with:
28
+ fetch-depth: 0
29
+ persist-credentials: false
30
+ - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
31
+ with:
32
+ node-version: 24
33
+ registry-url: https://registry.npmjs.org
34
+ package-manager-cache: false
35
+ - name: Check tag, version and branch
36
+ shell: bash
37
+ run: |
38
+ version="$(node -p 'require("./package.json").version')"
39
+ if [ "v$version" != "$GITHUB_REF_NAME" ]; then
40
+ echo "Tag $GITHUB_REF_NAME does not match package.json version $version." >&2
41
+ exit 1
42
+ fi
43
+ if ! git merge-base --is-ancestor "$GITHUB_SHA" origin/main; then
44
+ echo "The tagged commit is not on main." >&2
45
+ exit 1
46
+ fi
47
+ if ! grep -q "^## \[\?$version\b" CHANGELOG.md; then
48
+ echo "CHANGELOG.md has no section for $version." >&2
49
+ exit 1
50
+ fi
51
+ - name: Check npm supports trusted publishing
52
+ shell: bash
53
+ run: |
54
+ node -e '
55
+ const [major, minor, patch] = process.argv[1].split(".").map(Number);
56
+ const ok = major > 11 || (major === 11 && (minor > 5 || (minor === 5 && patch >= 1)));
57
+ if (!ok) { console.error("npm " + process.argv[1] + " is older than 11.5.1."); process.exit(1); }
58
+ ' "$(npm --version)"
59
+ - name: Check syntax
60
+ shell: bash
61
+ run: for f in bin/*.js install.js scripts/*.js test/*.js; do node --check "$f" || exit 1; done
62
+ - run: node --test
63
+ - name: Publish
64
+ shell: bash
65
+ run: |
66
+ version="$(node -p 'require("./package.json").version')"
67
+ case "$version" in
68
+ *-*) npm publish --access public --tag next ;;
69
+ *) npm publish --access public ;;
70
+ esac
package/CHANGELOG.md CHANGED
@@ -1,84 +1,106 @@
1
- # Changelog
2
-
3
- This format follows Keep a Changelog, and the project uses Semantic Versioning.
4
-
5
- ## [0.1.0] - 2026-11-12
6
-
7
- ### Changed
8
-
9
- - One `set <name> <value>` command replaces `profile`, `terse`, `consensus`, `allow-training`, `workers`, `statusline` and `context <value>`; `use <id> on|off` replaces `providers enable|disable`. The old forms are gone.
10
- - `settings` shows the command that changes each value, and `help` lists the commands by group with one line each.
11
- - `context` shows how large sessions are at their start, because every step reads that part again.
12
-
13
- ### Added
14
-
15
- - Stop a prompt once after an hour or more away from a large Claude Code session, with cheaper options before paying for its expired cache.
16
- - Show project session start sizes and loaded MCP servers, skills, plugins and CLAUDE.md sizes in `quota-boss doctor`.
17
-
18
- - `bench/effort.js` measures how the reasoning level changes usage, and the routing table uses measured values for seven models instead of one estimate for all.
19
-
20
- - Add `use` and `only` to choose which subscriptions and single models receive delegated work, globally or for one project.
21
- `only` is a filter, so `only off` brings back the earlier choices.
22
- - Add `verify [--fresh] -- <command...>` to reuse passing test evidence on an unchanged Git revision.
23
- - Gate documentation-only providers behind real file-write self-tests and verified task probation; report readiness in providers and doctor.
24
- - Route tasks across Claude, ChatGPT/Codex and Perplexity subscriptions by task importance, model quality and remaining quota.
25
- - Read live Claude and Codex quota from the Claude status line and Codex session logs.
26
- - Escalate difficult work through a model ladder and learn from verified outcomes.
27
- - Enable routing per project with `/boss on`; unregistered projects stay off.
28
- - Delegate work through Codex and other worker adapters, with a manual Perplexity research handoff.
29
- - Set up providers step by step with `/boss-setup` and add APIs with `/boss-add-api`.
30
- - Choose optional free offers during setup or later; they start off, show limits and data warnings first, and their limits may change.
31
- - Keep API keys in OpenCode for added API providers.
32
- - Enable an installed Ollama model through `/boss-local`.
33
- - Check local setup and provider readiness with `doctor`.
34
- - Install and uninstall with a reversible installer that preserves existing settings.
35
- - Run with Node.js built-ins and zero runtime dependencies.
36
- - Suggest `/compact` inside a task and a handoff between tasks when the context grows large.
37
- - Add the boss on/off benchmark harness in `bench/` with small, medium and mixed tasks and hidden checks (not part of the package).
38
- - Haiku and Sonnet can now do real work through the new `haiku-worker` and `sonnet-worker` agents.
39
- - The boss picks a model for each job, and workers ask it for advice instead of guessing.
40
- - Routing counts the Claude usage of CLI relays, and a failed route escalates one step at a time.
41
- - A Codex boss can hand work to cheaper Codex models through native subagents, each with its own model and reasoning effort.
42
- - Reasoning effort now covers Claude workers and counts toward the cost of a route.
43
- - `opus-worker` takes work that is beyond a boss running on a weaker model.
44
- - Grok, Antigravity and pinned Copilot models have several tiers, and their CLI templates take a model and a reasoning level.
45
- - `self-worker` runs a job on the boss's own model in a separate context, for large or parallel work.
46
- - Setup builds the Graphify code graph locally, without Claude usage, and keeps its output out of Git. A stale graph refreshes in the background at session start.
47
- - A delegation gate prices the handover (spec, waiting turns, report, review, rework) and the boss's own effort, so small jobs stay with the boss; `route --size small|large` re-checks a job.
48
- - Workers get one fixed handover form and answer in at most 10 lines, and they query the code graph with `quota-boss graph explain|affected|path`.
49
- - Other skills, plugins and slash commands keep their own workflow; boss mode only picks who does the work they leave open.
50
- - `quota-boss savings` reports usage per pool, cost units per worker type and job times from local transcripts.
51
- - `doctor` checks what the project's host needs and prints one `Problem: ... Fix: ...` line per issue.
52
- - Install with one `npx` command from the packed tarball.
53
-
54
- ### Changed
55
-
56
- - Each host now reads only its own worker list in the rules.
57
- - The status line and the prompt line say how old the Codex numbers are instead of "codex data stale".
58
- - Limit recent quota pace to a configurable horizon and discount models with thin evidence.
59
- - Suggest a handoff from 100,000 tokens instead of 150,000.
60
- - `consensus off` also removes the consensus instruction from the session rules.
61
- - CRITICAL work gets one counter-review from the other model family, no longer two.
62
- - After a failed worker the boss routes again, and a structural error such as HTTP 422 is never retried on the same model.
63
- - Antigravity runs in auto mode, so it can edit files without a manual settings change.
64
- - Apply a category effort floor and learn effort from verified feedback recorded with `--effort`.
65
- - `route` is read-only, and an unknown boss model maps to the newest registered model of its family with a note.
66
- - Claude and Codex model costs in the registry follow current list prices, and scores use published benchmarks (`docs/MODELS.md`).
67
- - Only the model the boss actually runs on counts as its own work.
68
- - `quota-boss boss` takes the cheaper of two near-equal models and names the best choice on the other host.
69
- - Upgrades keep only your real registry edits, so new prices reach you.
70
- - TRIVIAL and NORMAL worker results are checked by the boss itself, with tests and a read of the diff, also when the worker ran the boss's own model at a lower effort. Only CRITICAL work gets review agents.
71
-
72
- ### Fixed
73
-
74
- - Installation paths behind a system link, such as `/var` on macOS or a linked `/home` on Linux, are accepted.
75
-
76
- - Keep the session start under Claude Code's 10,000-character limit for hook output. Above it only a 2 kB preview reached
77
- the boss, which happened after every `/clear` with a handoff. The routing table and the notes now arrive with the first
78
- message when they do not fit beside the rules.
79
- - Codex works without Claude Code: the installer points to the terminal setup, the setup asks whether Claude should be a worker, and `on --host codex` turns Claude off when its CLI is missing instead of routing work to it.
80
- - A Codex boss on Windows retries a refused command launch with `cmd.exe` instead of working around the sandbox. On the medium benchmark boss mode went from about 2.1 times the cost of boss off to 1.2 times.
81
- - Doctor resolves OpenCode model templates through their default model.
82
- - `--uninstall --scan` no longer aborts on Windows junctions under Node 18.
83
- - A stale lock recovered right at its deadline no longer drops the update.
84
- - `codex-worker` runs Codex in the foreground, so a job is never handed to a second worker while the first still writes.
1
+ # Changelog
2
+
3
+ This format follows Keep a Changelog, and the project uses Semantic Versioning.
4
+
5
+ ## Unreleased
6
+
7
+ ## [0.1.1] - 2026-11-12
8
+
9
+ ### Added
10
+
11
+ - Codex SessionStart hook attaches routing and limits for enabled Codex projects, with safe user-hook merging and a `/hooks` trust reminder. On Windows the entry also carries `commandWindows`, because Codex runs hooks in PowerShell there.
12
+
13
+ ### Changed
14
+
15
+ - The status line names the pool a mode belongs to: `mode claude-save` and `mode claude-emergency` instead of `mode save` and `mode emergency`, so a Codex boss no longer reads a Claude limit as its own.
16
+
17
+ ### Fixed
18
+
19
+ - Windows: taking a lock no longer fails with `EPERM` while another process is still letting go of the deleted lock file; the attempt is repeated for a few milliseconds.
20
+
21
+ ## [0.1.1-rc.0] - 2026-11-12
22
+
23
+ ### Changed
24
+
25
+ - Releases are published by a GitHub workflow through npm trusted publishing, without a stored npm token. This pre-release is the first one made that way; the package content is the same as 0.1.0.
26
+
27
+ ## [0.1.0] - 2026-11-12
28
+
29
+ ### Changed
30
+
31
+ - One `set <name> <value>` command replaces `profile`, `terse`, `consensus`, `allow-training`, `workers`, `statusline` and `context <value>`; `use <id> on|off` replaces `providers enable|disable`. The old forms are gone.
32
+ - `settings` shows the command that changes each value, and `help` lists the commands by group with one line each.
33
+ - `context` shows how large sessions are at their start, because every step reads that part again.
34
+
35
+ ### Added
36
+
37
+ - Stop a prompt once after an hour or more away from a large Claude Code session, with cheaper options before paying for its expired cache.
38
+ - Show project session start sizes and loaded MCP servers, skills, plugins and CLAUDE.md sizes in `quota-boss doctor`.
39
+
40
+ - `bench/effort.js` measures how the reasoning level changes usage, and the routing table uses measured values for seven models instead of one estimate for all.
41
+
42
+ - Add `use` and `only` to choose which subscriptions and single models receive delegated work, globally or for one project.
43
+ `only` is a filter, so `only off` brings back the earlier choices.
44
+ - Add `verify [--fresh] -- <command...>` to reuse passing test evidence on an unchanged Git revision.
45
+ - Gate documentation-only providers behind real file-write self-tests and verified task probation; report readiness in providers and doctor.
46
+ - Route tasks across Claude, ChatGPT/Codex and Perplexity subscriptions by task importance, model quality and remaining quota.
47
+ - Read live Claude and Codex quota from the Claude status line and Codex session logs.
48
+ - Escalate difficult work through a model ladder and learn from verified outcomes.
49
+ - Enable routing per project with `/boss on`; unregistered projects stay off.
50
+ - Delegate work through Codex and other worker adapters, with a manual Perplexity research handoff.
51
+ - Set up providers step by step with `/boss-setup` and add APIs with `/boss-add-api`.
52
+ - Choose optional free offers during setup or later; they start off, show limits and data warnings first, and their limits may change.
53
+ - Keep API keys in OpenCode for added API providers.
54
+ - Enable an installed Ollama model through `/boss-local`.
55
+ - Check local setup and provider readiness with `doctor`.
56
+ - Install and uninstall with a reversible installer that preserves existing settings.
57
+ - Run with Node.js built-ins and zero runtime dependencies.
58
+ - Suggest `/compact` inside a task and a handoff between tasks when the context grows large.
59
+ - Add the boss on/off benchmark harness in `bench/` with small, medium and mixed tasks and hidden checks (not part of the package).
60
+ - Haiku and Sonnet can now do real work through the new `haiku-worker` and `sonnet-worker` agents.
61
+ - The boss picks a model for each job, and workers ask it for advice instead of guessing.
62
+ - Routing counts the Claude usage of CLI relays, and a failed route escalates one step at a time.
63
+ - A Codex boss can hand work to cheaper Codex models through native subagents, each with its own model and reasoning effort.
64
+ - Reasoning effort now covers Claude workers and counts toward the cost of a route.
65
+ - `opus-worker` takes work that is beyond a boss running on a weaker model.
66
+ - Grok, Antigravity and pinned Copilot models have several tiers, and their CLI templates take a model and a reasoning level.
67
+ - `self-worker` runs a job on the boss's own model in a separate context, for large or parallel work.
68
+ - Setup builds the Graphify code graph locally, without Claude usage, and keeps its output out of Git. A stale graph refreshes in the background at session start.
69
+ - A delegation gate prices the handover (spec, waiting turns, report, review, rework) and the boss's own effort, so small jobs stay with the boss; `route --size small|large` re-checks a job.
70
+ - Workers get one fixed handover form and answer in at most 10 lines, and they query the code graph with `quota-boss graph explain|affected|path`.
71
+ - Other skills, plugins and slash commands keep their own workflow; boss mode only picks who does the work they leave open.
72
+ - `quota-boss savings` reports usage per pool, cost units per worker type and job times from local transcripts.
73
+ - `doctor` checks what the project's host needs and prints one `Problem: ... Fix: ...` line per issue.
74
+ - Install with one `npx` command from the packed tarball.
75
+
76
+ ### Changed
77
+
78
+ - Each host now reads only its own worker list in the rules.
79
+ - The status line and the prompt line say how old the Codex numbers are instead of "codex data stale".
80
+ - Limit recent quota pace to a configurable horizon and discount models with thin evidence.
81
+ - Suggest a handoff from 100,000 tokens instead of 150,000.
82
+ - `consensus off` also removes the consensus instruction from the session rules.
83
+ - CRITICAL work gets one counter-review from the other model family, no longer two.
84
+ - After a failed worker the boss routes again, and a structural error such as HTTP 422 is never retried on the same model.
85
+ - Antigravity runs in auto mode, so it can edit files without a manual settings change.
86
+ - Apply a category effort floor and learn effort from verified feedback recorded with `--effort`.
87
+ - `route` is read-only, and an unknown boss model maps to the newest registered model of its family with a note.
88
+ - Claude and Codex model costs in the registry follow current list prices, and scores use published benchmarks (`docs/MODELS.md`).
89
+ - Only the model the boss actually runs on counts as its own work.
90
+ - `quota-boss boss` takes the cheaper of two near-equal models and names the best choice on the other host.
91
+ - Upgrades keep only your real registry edits, so new prices reach you.
92
+ - TRIVIAL and NORMAL worker results are checked by the boss itself, with tests and a read of the diff, also when the worker ran the boss's own model at a lower effort. Only CRITICAL work gets review agents.
93
+
94
+ ### Fixed
95
+
96
+ - Installation paths behind a system link, such as `/var` on macOS or a linked `/home` on Linux, are accepted.
97
+
98
+ - Keep the session start under Claude Code's 10,000-character limit for hook output. Above it only a 2 kB preview reached
99
+ the boss, which happened after every `/clear` with a handoff. The routing table and the notes now arrive with the first
100
+ message when they do not fit beside the rules.
101
+ - Codex works without Claude Code: the installer points to the terminal setup, the setup asks whether Claude should be a worker, and `on --host codex` turns Claude off when its CLI is missing instead of routing work to it.
102
+ - A Codex boss on Windows retries a refused command launch with `cmd.exe` instead of working around the sandbox. On the medium benchmark boss mode went from about 2.1 times the cost of boss off to 1.2 times.
103
+ - Doctor resolves OpenCode model templates through their default model.
104
+ - `--uninstall --scan` no longer aborts on Windows junctions under Node 18.
105
+ - A stale lock recovered right at its deadline no longer drops the update.
106
+ - `codex-worker` runs Codex in the foreground, so a job is never handed to a second worker while the first still writes.
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  <div align="center">
2
2
 
3
+ <img src="docs/assets/logo.svg" alt="" width="88" height="88">
4
+
3
5
  # Quota Boss
4
6
 
5
7
  **A multi-model orchestrator for your coding agent: a boss that hands each sub-task to the cheapest model that can
@@ -1,106 +1,106 @@
1
- {
2
- "enabled": {
3
- "title": "Boss mode",
4
- "what": "Turn task routing on or off for this project.",
5
- "quality": "same",
6
- "quota": "saves",
7
- "when": "Turn it on when you want the boss to share work across your available tools.",
8
- "advanced": false
9
- },
10
- "profile": {
11
- "title": "Quality versus quota",
12
- "what": "Quality favors stronger answers, balanced shares the trade-off, and frugal favors lower quota use.",
13
- "quality": "up",
14
- "quota": "costs",
15
- "when": "Choose quality for difficult work, balanced for everyday work, or frugal when quota is scarce.",
16
- "advanced": false
17
- },
18
- "host": {
19
- "title": "Your main coding assistant",
20
- "what": "Choose the assistant you talk to: Claude Code, Codex, or another tool using generic instructions.",
21
- "quality": "same",
22
- "quota": "same",
23
- "when": "Choose the tool where you are working; this changes how routing instructions and workers are delivered.",
24
- "advanced": false
25
- },
26
- "codex-tasks": {
27
- "title": "Codex task worker",
28
- "what": "Allow Codex to carry out delegated coding tasks using your ChatGPT quota.",
29
- "quality": "same",
30
- "quota": "costs",
31
- "when": "Enable it to share coding work with Codex; turn it off to reserve ChatGPT quota.",
32
- "advanced": false
33
- },
34
- "gpt-reviews": {
35
- "title": "GPT second opinions",
36
- "what": "Allow read-only GPT reviews, research and critical consensus through Codex using your ChatGPT quota.",
37
- "quality": "up",
38
- "quota": "costs",
39
- "when": "Enable it when an independent review or research answer is useful.",
40
- "advanced": false
41
- },
42
- "perplexity": {
43
- "title": "Perplexity research bridge",
44
- "what": "Offer a research prompt for you to paste into Perplexity and bring back manually.",
45
- "quality": "up",
46
- "quota": "costs",
47
- "when": "Enable it for source-heavy research when you are willing to copy and paste.",
48
- "advanced": false
49
- },
50
- "training": {
51
- "title": "Allow providers that train on data",
52
- "what": "Permit enabled providers marked as training on your data to receive project tasks.",
53
- "quality": "same",
54
- "quota": "saves",
55
- "when": "Leave it off unless you accept those providers using the project prompts and code for training.",
56
- "advanced": false
57
- },
58
- "short-answers": {
59
- "title": "Shorter answers",
60
- "what": "Ask the boss for a brief verdict, changed files, verification, and open issues.",
61
- "quality": "same",
62
- "quota": "saves",
63
- "when": "Enable it when you want shorter replies and fewer output tokens.",
64
- "advanced": false
65
- },
66
- "providers.enabled": {
67
- "title": "Available providers",
68
- "what": "Enable or disable a provider globally so its models can enter project routing.",
69
- "quality": "same",
70
- "quota": "same",
71
- "when": "Enable only providers you have configured and accept; training providers also need project permission.",
72
- "advanced": true
73
- },
74
- "caps": {
75
- "title": "Provider usage caps",
76
- "what": "Limit the percentage of each provider window available for delegation and raise its routing price as usage approaches that cap.",
77
- "quality": "same",
78
- "quota": "saves",
79
- "when": "Set a lower cap to reserve quota for other work; project off preserves any global cap.",
80
- "advanced": true
81
- },
82
- "consensus": {
83
- "title": "Independent critical decisions",
84
- "what": "Offer an independent read-only Codex answer before critical architecture or security decisions with real trade-offs.",
85
- "quality": "up",
86
- "quota": "costs",
87
- "when": "Keep it on for important trade-offs; it uses an extra GPT answer and never edits files.",
88
- "advanced": true
89
- },
90
- "statusline": {
91
- "title": "Status line visibility",
92
- "what": "Show quota numbers everywhere or only with boss mode.",
93
- "quality": "same",
94
- "quota": "same",
95
- "when": "Show quota numbers everywhere or only with boss mode.",
96
- "advanced": true
97
- },
98
- "context": {
99
- "title": "Context handoff threshold",
100
- "what": "Suggest a handoff from this token count; also stops a message once after a pause of an hour or more in a large session, before the expired cache is paid for. Turn both checks off with context off.",
101
- "quality": "same",
102
- "quota": "same",
103
- "when": "Suggest a handoff from this token count; also stops a message once after a pause of an hour or more in a large session, before the expired cache is paid for. Turn both checks off with context off.",
104
- "advanced": true
105
- }
106
- }
1
+ {
2
+ "enabled": {
3
+ "title": "Boss mode",
4
+ "what": "Turn task routing on or off for this project.",
5
+ "quality": "same",
6
+ "quota": "saves",
7
+ "when": "Turn it on when you want the boss to share work across your available tools.",
8
+ "advanced": false
9
+ },
10
+ "profile": {
11
+ "title": "Quality versus quota",
12
+ "what": "Quality favors stronger answers, balanced shares the trade-off, and frugal favors lower quota use.",
13
+ "quality": "up",
14
+ "quota": "costs",
15
+ "when": "Choose quality for difficult work, balanced for everyday work, or frugal when quota is scarce.",
16
+ "advanced": false
17
+ },
18
+ "host": {
19
+ "title": "Your main coding assistant",
20
+ "what": "Choose the assistant you talk to: Claude Code, Codex, or another tool using generic instructions.",
21
+ "quality": "same",
22
+ "quota": "same",
23
+ "when": "Choose the tool where you are working; this changes how routing instructions and workers are delivered.",
24
+ "advanced": false
25
+ },
26
+ "codex-tasks": {
27
+ "title": "Codex task worker",
28
+ "what": "Allow Codex to carry out delegated coding tasks using your ChatGPT quota.",
29
+ "quality": "same",
30
+ "quota": "costs",
31
+ "when": "Enable it to share coding work with Codex; turn it off to reserve ChatGPT quota.",
32
+ "advanced": false
33
+ },
34
+ "gpt-reviews": {
35
+ "title": "GPT second opinions",
36
+ "what": "Allow read-only GPT reviews, research and critical consensus through Codex using your ChatGPT quota.",
37
+ "quality": "up",
38
+ "quota": "costs",
39
+ "when": "Enable it when an independent review or research answer is useful.",
40
+ "advanced": false
41
+ },
42
+ "perplexity": {
43
+ "title": "Perplexity research bridge",
44
+ "what": "Offer a research prompt for you to paste into Perplexity and bring back manually.",
45
+ "quality": "up",
46
+ "quota": "costs",
47
+ "when": "Enable it for source-heavy research when you are willing to copy and paste.",
48
+ "advanced": false
49
+ },
50
+ "training": {
51
+ "title": "Allow providers that train on data",
52
+ "what": "Permit enabled providers marked as training on your data to receive project tasks.",
53
+ "quality": "same",
54
+ "quota": "saves",
55
+ "when": "Leave it off unless you accept those providers using the project prompts and code for training.",
56
+ "advanced": false
57
+ },
58
+ "short-answers": {
59
+ "title": "Shorter answers",
60
+ "what": "Ask the boss for a brief verdict, changed files, verification, and open issues.",
61
+ "quality": "same",
62
+ "quota": "saves",
63
+ "when": "Enable it when you want shorter replies and fewer output tokens.",
64
+ "advanced": false
65
+ },
66
+ "providers.enabled": {
67
+ "title": "Available providers",
68
+ "what": "Enable or disable a provider globally so its models can enter project routing.",
69
+ "quality": "same",
70
+ "quota": "same",
71
+ "when": "Enable only providers you have configured and accept; training providers also need project permission.",
72
+ "advanced": true
73
+ },
74
+ "caps": {
75
+ "title": "Provider usage caps",
76
+ "what": "Limit the percentage of each provider window available for delegation and raise its routing price as usage approaches that cap.",
77
+ "quality": "same",
78
+ "quota": "saves",
79
+ "when": "Set a lower cap to reserve quota for other work; project off preserves any global cap.",
80
+ "advanced": true
81
+ },
82
+ "consensus": {
83
+ "title": "Independent critical decisions",
84
+ "what": "Offer an independent read-only Codex answer before critical architecture or security decisions with real trade-offs.",
85
+ "quality": "up",
86
+ "quota": "costs",
87
+ "when": "Keep it on for important trade-offs; it uses an extra GPT answer and never edits files.",
88
+ "advanced": true
89
+ },
90
+ "statusline": {
91
+ "title": "Status line visibility",
92
+ "what": "Show quota numbers everywhere or only with boss mode.",
93
+ "quality": "same",
94
+ "quota": "same",
95
+ "when": "Show quota numbers everywhere or only with boss mode.",
96
+ "advanced": true
97
+ },
98
+ "context": {
99
+ "title": "Context handoff threshold",
100
+ "what": "Suggest a handoff from this token count; also stops a message once after a pause of an hour or more in a large session, before the expired cache is paid for. Turn both checks off with context off.",
101
+ "quality": "same",
102
+ "quota": "same",
103
+ "when": "Suggest a handoff from this token count; also stops a message once after a pause of an hour or more in a large session, before the expired cache is paid for. Turn both checks off with context off.",
104
+ "advanced": true
105
+ }
106
+ }
@@ -136,7 +136,8 @@ Max ~6 lines total.
136
136
  |---|---|
137
137
  | `scripts/lib.js` | paths, safe JSON read, atomic write, config loading/merge, project config lookup, state read/write, `readCodexLimits()`, `readCodexModels()`, `computeModes()`, `sanitizeLabel()`, `formatReset(epochSec)` (local `HH:MM`, or `Mon HH:MM` if > 24h away) |
138
138
  | `scripts/statusline.js` | read stdin JSON, persist Claude limits, print one line: `C 5h 4% ↻01:20 · wk 49% │ X 5h 0% · wk 2% │ boss on:balanced`. When boss mode is off for the project, nothing of ours is printed, unless `quota-boss set statusline always` saved `showWithoutBoss` in `QUOTA_BOSS_HOME/config/statusline.json`; then only the Claude and Codex numbers are shown. ANSI colours: green < save, yellow < emergency, red >=. If `QUOTA_BOSS_HOME/wrapped-statusline.json` has `{command}`, run it with the same stdin (`spawnSync`, `shell: true`, timeout 2000 ms - the documented exception: it is the user's own previous status line command) and print its output first, then ours on the next line. |
139
- | `scripts/hook-session.js` | SessionStart hook. Stdin JSON (`cwd`, `session_id`, `source`). If project enabled: print `templates/RULES.md` with the installed home placeholder substituted (from `path.join(__dirname,'..','templates','RULES.md')`) + `formatTable(route(...))` + the limits line. Else print nothing. |
139
+ | `scripts/hook-session.js` | With `--host codex`, enabled Codex projects receive only the table and limits line (8,000-byte cap, otherwise a `route` command), using stdin `model` before host fallbacks. Without that flag: Claude Code SessionStart hook. Stdin JSON (`cwd`, `session_id`, `source`). If project enabled: print `templates/RULES.md` with the installed home placeholder substituted (from `path.join(__dirname,'..','templates','RULES.md')`) + `formatTable(route(...))` + the limits line. Else print nothing. |
140
+ | `scripts/codex-hooks.js` | Locked, bounded, atomic merge/removal of our SessionStart entry in `CODEX_DIR/hooks.json`; `on --host codex` adds it, `/hooks` trust is required in Codex, `off` keeps it, uninstall removes it. Foreign entries survive; empty files are retained. |
140
141
  | `scripts/hook-prompt.js` | UserPromptSubmit hook. If enabled: print ONE line `[quota-boss] Claude 5h 4% wk 49% | Codex 5h 0% wk 2% | profile balanced | mode normal`. If mode changed since the last prompt of this `session_id` (stored in state `sessions[session_id].mode`, keep max 50 sessions, drop oldest), also print `[quota-boss] mode changed -> <mode>. New routing:` + table. |
141
142
  | `scripts/quota-boss.js` | CLI used by the `/boss` slash command: `on [profile]`, `off`, `status`, `settings`, `set <name> <value>`, `explain <setting>`, `help`, `route`, `models` (registry vs Codex cache: lists rated, unrated, and stale entries). Operates on `process.cwd()` project (registers the current real path in user-owned `projects.json`). Human-readable output. Exit 1 with a message on bad input. |
142
143
  | `scripts/pplx.js` | Perplexity manual bridge. `ask [--model <hint>] <prompt...>` (or prompt from stdin): writes `QUOTA_BOSS_HOME/pplx/pending.md`, copies prompt to clipboard (`clip` on win32, `pbcopy` darwin, `wl-copy` then `xclip -selection clipboard` linux; spawn with argument arrays + stdin, no shell), prints instructions. `result` reads answer from stdin, saves to `QUOTA_BOSS_HOME/pplx/<timestamp>.md`, clears pending, prints the saved path. |
@@ -177,7 +178,8 @@ Max ~6 lines total.
177
178
  Every spawned child has a trusted QUOTA_BOSS_HOME or os.homedir() cwd. On win32 every child also gets
178
179
  `NoDefaultCurrentDirectoryInExePath=1`, including the shell wrapper and clipboard tools.
179
180
  7. Idempotent: running twice changes nothing the second time (except the backup).
180
- 8. `--uninstall`: using the manifest, remove our hook entries and status line (restore wrapped one), remove
181
+ 8. `--uninstall`: remove our Codex SessionStart entry from `CODEX_DIR/hooks.json`, keeping foreign hooks and
182
+ retaining empty files. Using the manifest, remove our Claude hook entries and status line (restore wrapped one), remove
181
183
  managed agent/command files, `claude mcp remove codex --scope user` only if we added it. Keep `QUOTA_BOSS_HOME`
182
184
  config and state unless `--force`. Scan all projects.json entries for AGENTS.md markers, including
183
185
  entries without managedAgents tracking. With `--scan <dir>`, also search below that root (max depth 6,
@@ -23,6 +23,10 @@ Without Claude Code, run `node "<home>/scripts/quota-boss.js" setup` in your pro
23
23
  the assistant; the installer prints the exact path. Claude then is an optional worker through the `claude` CLI, off
24
24
  when that CLI is missing.
25
25
 
26
+ For a Codex boss, run `quota-boss on --host codex` with the Codex home directory present, then review and trust
27
+ the new SessionStart hook with `/hooks` in Codex. It attaches the routing table and limits; until trusted,
28
+ the boss runs `route` before delegating.
29
+
26
30
  Nothing changes until the summary at the end, which lists every choice and the exact install commands with their
27
31
  sources. You answer once, then it:
28
32