model-orchestrator 0.1.6 → 0.1.7

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/CHANGELOG.md CHANGED
@@ -4,6 +4,16 @@ All notable changes to this project are documented here. The format follows [Kee
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.1.7] - 2026-09-05
8
+
9
+ ### Fixed
10
+
11
+ - Preserve unrelated subagents in uninstall guidance and explain manual activation cleanup.
12
+ - Provide a chat activation block below 1,500 characters and explain protocol uploads.
13
+ - Warn about zero-lane setups; doctor reports inactive with exit 13, including with --run.
14
+ - Add a first-task walkthrough and clarify agent-directed routing, connection checks and output contracts.
15
+ - Correct the contributor exit-code reference.
16
+
7
17
  ## [0.1.6] - 2026-09-05
8
18
 
9
19
  Issues #16 to #19, filed against 0.1.5. Each reproduced before the fix; each fix has a test.
@@ -111,7 +121,8 @@ First release.
111
121
  - Tests: a case per fix, judges proven to go red, mutation checks; `npm test` prints the current count.
112
122
  - Adversarial audit: two Codex rounds plus a two-engine review (Codex, Antigravity); findings and fixes in `docs/audit-brief.md`. After the review: subagents go to the project root (`--project`), snippet paths computed from `--dir`, lane sections rendered from the selection, a primary agent required, level 3 asks for API keys separately from CLIs, images and CLI installs pinned, an activation summary at the end of every install.
113
123
 
114
- [Unreleased]: https://github.com/aunysillyme/model-orchestrator/compare/v0.1.6...HEAD
124
+ [Unreleased]: https://github.com/aunysillyme/model-orchestrator/compare/v0.1.7...HEAD
125
+ [0.1.7]: https://github.com/aunysillyme/model-orchestrator/compare/v0.1.6...v0.1.7
115
126
  [0.1.6]: https://github.com/aunysillyme/model-orchestrator/compare/v0.1.5...v0.1.6
116
127
  [0.1.5]: https://github.com/aunysillyme/model-orchestrator/compare/v0.1.4...v0.1.5
117
128
  [0.1.4]: https://github.com/aunysillyme/model-orchestrator/compare/v0.1.3...v0.1.4
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![npm](https://img.shields.io/npm/v/model-orchestrator.svg)](https://www.npmjs.com/package/model-orchestrator) [![test](https://github.com/aunysillyme/model-orchestrator/actions/workflows/test.yml/badge.svg)](https://github.com/aunysillyme/model-orchestrator/actions/workflows/test.yml) [![license: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![node >=18](https://img.shields.io/badge/node-%3E%3D18-brightgreen.svg)](package.json)
4
4
 
5
- **A model orchestrator you can `npm run`.** Route every task to the cheapest AI that does it well, whether you have one chat app, five agent CLIs, or a virtual machine running them unattended. One installer asks what you have access to and writes only what fits.
5
+ **Routing instructions and a CLI runner for your AI tools.** One installer asks what you have access to and generates a matching setup, from one chat app to several agent CLIs or a virtual machine. Your primary agent follows the instructions to choose a tier or lane; the runner executes the lane it is given. It does not automatically compare prices or select models.
6
6
 
7
7
  Built from a working system, not a diagram: the routing rules, the protocols and the lane runner here run in production, generalized so they transfer to any stack.
8
8
 
@@ -10,7 +10,7 @@ Built from a working system, not a diagram: the routing rules, the protocols and
10
10
  npx model-orchestrator
11
11
  ```
12
12
 
13
- That runs the latest published release from the npm registry. To run a specific release or the current main straight from GitHub: `npx github:aunysillyme/model-orchestrator#v0.1.6` (drop `#v0.1.6` for main).
13
+ That runs the latest published release from the npm registry. To run a specific release or the current main straight from GitHub: `npx github:aunysillyme/model-orchestrator#v0.1.7` (drop `#v0.1.7` for main).
14
14
 
15
15
  The installer asks a few things, then writes a folder:
16
16
 
@@ -18,7 +18,7 @@ The installer asks a few things, then writes a folder:
18
18
  2. **Which AIs do you have access to?** (it marks the ones already on your PATH)
19
19
  3. **Which one is your primary agent?** (the one that runs the system)
20
20
 
21
- It never writes a secret, never runs a vendor shell script for you, and never overwrites a document you already have unless you pass `--force`. Two exceptions, both stated when they happen: `MANIFEST.json` and `bin/lanes.json` are machine-owned and rewritten on every run so a changed selection applies; runtime files (`cli-run`, the audit job, compose, gateway config, setup script) are upgraded when the installed copy matches the hash a previous run recorded, kept and reported as a conflict when you edited them, and kept as unverifiable when no manifest exists (`--upgrade-runtime` replaces runtime files only). The same hash rule is available for documents on request: `--update-docs` regenerates the documents a previous run wrote and nobody edited, so a changed selection reaches `ROUTING.md` and the delegation matrix without `--force`; edited documents are kept and named. Docs and protocols go to `--dir` (default `./ai-orchestrator`); subagent definitions go to the project root your agent runs from (`--project`, default the current directory), because that is the only place Claude Code and Antigravity read them. It ends with an activation summary: what to copy where, which sign-ins, and one smoke command. Uninstall: delete the folder, the subagent folder it named, and `~/.ai-orchestrator/cli-run.log.jsonl` if you used `cli-run`.
21
+ It never writes a secret, never runs a vendor shell script for you, and never overwrites a document you already have unless you pass `--force`. Two exceptions, both stated when they happen: `MANIFEST.json` and `bin/lanes.json` are machine-owned and rewritten on every run so a changed selection applies; runtime files (`cli-run`, the audit job, compose, gateway config, setup script) are upgraded when the installed copy matches the hash a previous run recorded, kept and reported as a conflict when you edited them, and kept as unverifiable when no manifest exists (`--upgrade-runtime` replaces runtime files only). The same hash rule is available for documents on request: `--update-docs` regenerates the documents a previous run wrote and nobody edited, so a changed selection reaches `ROUTING.md` and the delegation matrix without `--force`; edited documents are kept and named. Docs and protocols go to `--dir` (default `./ai-orchestrator`); subagent definitions go to the project root your agent runs from (`--project`, default the current directory), because that is the only place Claude Code and Antigravity read them. It ends with an activation summary: what to copy where, which sign-ins, and one smoke command. Uninstall: follow the generated README. Inspect the manifest and remove only the individual managed subagent files you no longer need, preserve edited or pre-existing files, and remove your manually pasted activation block. Never delete a shared subagent folder.
22
22
 
23
23
  ## The three levels
24
24
 
package/bin/cli-run.mjs CHANGED
@@ -424,7 +424,11 @@ export async function doctor(run) {
424
424
  let bad = 0;
425
425
  console.log(`doctor: ${enabled.length} enabled lane(s): ${enabled.join(', ') || 'none'}`);
426
426
  const primary = installedPrimary();
427
- if (primary && !enabled.includes(primary)) console.log(` note: ${primary} is the primary agent; it calls cli-run and is not a lane`);
427
+ if (primary && !enabled.includes(primary)) console.log(` note: ${primary} is the primary agent and is not an executable lane`);
428
+ if (!enabled.length) {
429
+ console.error('doctor: inactive: no executable lanes enabled. Use level 1 for a single-agent setup, or re-run the installer with a supported CLI selected.');
430
+ return UNAVAILABLE;
431
+ }
428
432
  for (const lane of LANES) {
429
433
  const on = enabled.includes(lane);
430
434
  const bin = which(lane);
package/bin/cli.js CHANGED
@@ -253,6 +253,9 @@ async function main() {
253
253
  const lvl = LEVELS.find((l) => l.id === level);
254
254
  const agentFiles = files.filter((f) => f.root === 'project');
255
255
  console.log(`\nPlan\n level ${lvl.id} ${lvl.name}\n access ${selected.map((a) => a.id).join(', ')}\n primary ${primary ? primary.id : 'none'}\n tools ${tools.map((t) => t.id).join(', ') || 'none'}` + (level >= 3 ? `\n api keys ${apis.map((p) => p.id).join(', ') || 'none'}` : '') + `\n folder ${dir}\n project ${project}${agentFiles.length ? ' (' + agentFiles.length + ' subagent files go here)' : ''}\n files ${files.length}`);
256
+ if (level >= 2 && !selected.some((a) => a.cliRun)) {
257
+ console.log('\nWarning: no executable lanes selected; delegation is inactive. Use level 1 for a single-agent setup, or add a supported CLI. Doctor will exit 13 until a lane is enabled.');
258
+ }
256
259
  if (flag('dry') || flag('dry-run')) {
257
260
  for (const f of files) console.log(' - ' + (f.root === 'project' ? '[project] ' : '') + f.rel);
258
261
  console.log('\n--dry: nothing written.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "model-orchestrator",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "A model orchestrator you can npm run: route every task to the cheapest AI that does it well, across one agent, many CLIs, or a whole virtual machine. Three levels, one installer that asks what you have access to.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -3,23 +3,13 @@
3
3
  {{PRIMARY_NAME}} has no project instructions file, so the rules travel by paste. Put the block below into the custom instructions, a Project, a Gem, or the first message of a working session.
4
4
 
5
5
  ```
6
- You are running a model orchestrator inside one agent.
7
-
8
- TIERS (capability, not model names): deep = ambiguous planning, architecture, root-cause debugging, anything expensive to get wrong. standard = writing, review, executing a known plan, research synthesis. fast = classification, extraction, formatting, bulk summaries. Think hardest on deep, least on fast. Default down, escalate on evidence, and never silently retry a failed attempt at the same level.
9
-
10
- ROUTE, first match wins: bulk and mechanical -> fast. Needs live data -> standard with tools; anything a search returns is a lead, not a fact. Review without changing -> standard, read-only, findings ranked by severity. Ambiguous or expensive to get wrong -> deep, then hand the plan down. Everything else -> do it directly at standard.
11
-
12
- EVERY BUILD: (1) map what it touches and what could break, in writing. (2) Ask at deep level: simplest way? single biggest risk? where is the request wrong? A named risk and a named flaw, or it does not pass. (3) Build, then check it against the real thing. (4) In a fresh turn, attack it: bad input, failing dependency, drift from the plan. CLEAN is a valid answer. (5) Before anything irreversible, name the rollback and get an explicit yes. (6) After: re-check the old name everywhere and expect zero.
13
-
14
- EVERY HAND-OFF to a fresh context carries a brief: purpose, task class (read_only / draft_only / mutating), granted scope, capabilities, denied actions, conventions it does not have, report contract (what was NOT done, what is unverified), exit parameters. Absence is denial.
15
-
16
- AFTER ANY COMPREHENSIVE TASK: a second pass in a fresh turn that hunts for what is MISSING, not what is present.
17
-
18
- NUMBERS AND LOGIC: any figure someone will act on, any comparison you state, any complexity or equivalence claim is computed with a tool (a code interpreter, a calculator), never estimated. Give the exact form and the decimal and name the tool. Trivial single-digit sums are exempt; nothing else is.
19
-
20
- MEMORY AND RECORD: before writing anything durable, search for it; after writing, correct the index that lists it; one writer per session; mark inferred content as inferred.
21
-
22
- A gate you cannot fail is not a gate. Exit 0 is not a deliverable.
6
+ You follow a model-orchestrator workflow inside this chat. Tiers describe effort, not automatic model switching or cost savings.
7
+ Route first: bulk/formatting -> fast; live data -> standard with tools; review -> standard, read-only; ambiguous/high-risk -> deep; otherwise standard. State the tier. Escalate on failure instead of silently retrying.
8
+ For builds: map affected parts; identify the biggest risk and any flaw in the request (none is valid with reasons); build and verify; use a fresh turn to challenge the result. Before irreversible actions, explain rollback and ask for approval.
9
+ For hand-offs: include purpose, scope, allowed and denied actions, required output, and stopping conditions. A fresh context has none of these instructions.
10
+ After comprehensive work, check for omissions. Compute consequential numbers and comparisons with a tool; report what was checked and what remains unverified.
11
+ Before durable writes, search existing records, update their index, use one writer, and label inferences.
12
+ Check the actual deliverable; exit 0 alone is not evidence of completion. Do not claim to have read local files that were not uploaded or pasted.
23
13
  ```
24
14
 
25
- The full text of each rule is in this folder: `ORCHESTRATOR.md`, `TASK_BUNDLE.md`, `protocols/`.
15
+ This compact block fits within 1,500 characters. For the full workflow, upload or paste the following files into your Project or working session; a local path alone does not give a chat access to them: `ORCHESTRATOR.md`, `TASK_BUNDLE.md`, `protocols/`.
@@ -11,7 +11,15 @@ Companion tools:
11
11
 
12
12
  ## The idea in one line
13
13
 
14
- Every task goes to the cheapest AI that does it well, and every gate on the way is a question that can be answered wrong.
14
+ This folder gives your agent routing instructions and, at level 2+, a runner for explicitly selected CLI lanes. The agent chooses the tier or lane; the runner does not automatically compare prices or choose a model.
15
+
16
+ ## Your first task
17
+
18
+ 1. Activate the snippet using the instructions below. For a chat app, paste the block in `PASTE-INTO-YOUR-AGENT.md`; upload any full protocols you want it to read because local paths alone do not share files.
19
+ 2. Start a fresh agent session and ask: "Read the orchestrator instructions. Quote the routing rule you will use, then sort pear, apple, banana alphabetically. Name the tier and whether you delegated."
20
+ 3. Expect the fast tier and `apple, banana, pear`. If the agent cannot quote the routing rule, check the snippet location or chat instructions before continuing. This is a manual activation check, not proof that every future task follows the rules.
21
+ 4. At level 2+, run `node bin/cli-run.mjs --doctor` from this folder. It checks binary presence, not authentication or loaded instructions. `--doctor --run` additionally uses a little quota to test live responses. No enabled lanes means delegation is inactive.
22
+ 5. To test a real output contract, choose an enabled lane from `bin/lanes.json` and run `node bin/cli-run.mjs <lane> 'Return only {"sorted":["apple","banana","pear"]}' --expect-json`. This uses quota. Expect JSON and exit 0; inspect the array yourself. A non-JSON response exits 10, a missing binary exits 13, and an authentication failure reports the vendor error. The explicit lane tests execution; your primary agent still makes delegation decisions.
15
23
 
16
24
  ## What is in this folder
17
25
 
@@ -32,7 +40,7 @@ Level 2 adds `ROUTING.md`, `TIERS.md`, `DELEGATION_MATRIX.md`, `RESEARCH_TRIAGE.
32
40
 
33
41
  ## Load it into your agent
34
42
 
35
- Your primary agent reads `{{PRIMARY_RULES_FILE}}` from a project root. The installer wrote a snippet file next to this README (`*.snippet.md`, or `PASTE-INTO-YOUR-AGENT.md` for a chat app). Copy its contents into that file, or paste it into the agent's custom instructions. Nothing was appended to a file you already had.
43
+ For a CLI primary, the project rules file is `{{PRIMARY_RULES_FILE}}`. Chat apps use pasted instructions instead. The installer wrote a snippet file next to this README (`*.snippet.md`, or `PASTE-INTO-YOUR-AGENT.md` for a chat app). Copy its contents into that file, or paste it into the agent's custom instructions. Nothing was appended to a file you already had.
36
44
 
37
45
  ## The three rules that carry everything
38
46
 
@@ -49,4 +57,4 @@ Your primary agent reads `{{PRIMARY_RULES_FILE}}` from a project root. The insta
49
57
 
50
58
  ## Uninstall
51
59
 
52
- Delete this folder and the subagent folder named above. `cli-run` keeps one log at `~/.ai-orchestrator/cli-run.log.jsonl`; delete that too if you used it.
60
+ Before deleting anything, inspect `MANIFEST.json`: entries beginning with `[project] ` identify the subagent files managed by this installation. Review those individual files and remove only the ones you no longer want, preserving edited or pre-existing files. Never delete the shared `.claude/agents` or `.agents/agents` folder; it may contain unrelated agents. If the manifest is missing, inspect files individually rather than deleting a folder. Remove the orchestrator block you manually copied into your project rules file or chat instructions. Then delete this generated docs folder only after preserving any work you added to it. The optional log at `~/.ai-orchestrator/cli-run.log.jsonl` is shared across installations; remove it only if you no longer need that history.
@@ -30,6 +30,8 @@ node bin/cli-run.mjs --doctor # which lanes are enabled and which binar
30
30
  node bin/cli-run.mjs --doctor --run # also sends each enabled lane one tiny prompt and judges the reply (uses a little quota)
31
31
  ```
32
32
 
33
+ With zero enabled lanes, doctor reports inactive and exits 13. Use level 1 or select a supported CLI. Binary presence does not verify authentication or that your primary loaded its instructions.
34
+
33
35
  A lane that is enabled but not on PATH, or that answers with no deliverable, shows up here before it shows up mid-task.
34
36
 
35
37
  ## Why it exists