Goal
Use cargo-hauler as a reference consumer of Agent Bundle's #592 architecture rather than preserving workarounds that exist only because current framework surfaces are split.
This is an umbrella migration issue. Do not rewrite working behavior before the relevant upstream capability lands.
1. Composite plugin root / distribution
Blocked on ScriptedAlchemy/agent-bundle#555.
Current cargo-hauler still encodes the old per-target artifact model in:
agent-bundle.config.ts comments (artifact/<target>);
README.md and docs/install.md (artifact/<host>);
AGENTS.md;
src/cli/dashboard.ts path heuristics;
tests/version-consistency.test.ts;
- packed/route tests that open
artifact/cursor, etc.;
- package
files/installation prose.
After #555:
- one
artifact/ root should contain selected Claude/Codex/Cursor/portable projections;
- install/doctor should point at the root, not
artifact/<host>;
- tests should inspect
agent-bundle.manifest.json / host manifest pointers instead of hard-coded partition paths;
- npm/Git/local delivery should describe the same plugin root.
Do not preserve compatibility path logic in cargo-hauler itself; Agent Bundle owns any legacy artifact probing.
2. Delete duplicated CLI schema contracts
Blocked on ScriptedAlchemy/agent-bundle#593.
src/cli/status.tsx re-declares statusInputSchema inline because static argv extraction cannot follow the canonical imported schema. tests/schema-compat.test.ts then pins the copy to src/lib/protocol-schemas.ts.
Once #593 lands:
import { statusInputSchema, statusResultSchema } from '../lib/protocol-schemas.js';
export const inputSchema = statusInputSchema;
export const resultSchema = statusResultSchema;
Delete compatibility tests whose only purpose is preventing framework-forced schema drift.
Audit the remaining CLI/MCP pairs (request, result, await, kill, last, log) for the same duplication and share contracts/domain execution wherever the presentation semantics permit it.
3. Delete the hand-written MCP App transport/protocol layer
Blocked on ScriptedAlchemy/agent-bundle#594.
src/mcp/hauler/apps/dashboard.tsx currently owns a local JSON-RPC client over window.parent.postMessage('*'), request ids/timeouts, tools/call envelopes, structured-result unwrapping, and many unknown protocol interfaces that duplicate the route result schemas.
Once #594 lands, the App should consume the generated typed route client and keep only dashboard state/view logic.
Desired shape:
const status = await client.tools.hauler.hauler_status({ limit: 40 });
const detail = await client.tools.hauler.hauler_result({ ticket });
No local knowledge of JSON-RPC ids, structuredContent envelope shape, parent bridge semantics, or manually mirrored server protocol types.
4. Replace checkout-only hauler dashboard
Blocked on ScriptedAlchemy/agent-bundle#564 and #594.
src/cli/dashboard.ts is ~framework integration glue:
- locate checkout/artifact by relative paths;
- crawl
node_modules for Agent Bundle's package manifest;
- spawn
agent-bundle serve-app;
- parse its human stdout with a regex to recover the URL;
- manually relay abort to SIGTERM;
- cannot run from the npm package or installed plugin.
After #564, delete this implementation and use the framework-generated production browser command/host. hauler dashboard should work from the same installed composite plugin root as the MCP server and routed CLI, with no Agent Bundle checkout dependency.
The application should configure/expose hauler/dashboard; Agent Bundle owns serving, browser opening, lifecycle and URL/result protocol.
5. Bring fast shell hooks back into the canonical event model
Blocked on ScriptedAlchemy/agent-bundle#595.
cargo-hauler #90 correctly moved high-frequency shell hooks to hooks.beforeTool.handler / hooks.afterTool.handler: rendered event routes cost ~0.2 s per shell command pair before they could reject unrelated commands.
This workaround should remain until #595 can emit a physically cheap preflight gate.
Afterward:
6. Provider cost
src/providers/hauler-daemon.ts probes daemon health on every non-event route request. This is acceptable today but should be revisited once #595 supports lazy provider materialization/declared provider needs.
Routes that only need static/help/render information should not probe the daemon merely because the provider exists globally. Keep the probe where domain semantics require a fresh health snapshot.
7. Keep domain/runtime boundaries
Do not move cargo orchestration into Agent Bundle. cargo-hauler should continue to own:
- daemon/broker scheduling;
- lane/admission/folding semantics;
- ledger/protocol domain schemas;
- Cargo parsing/rewrite policy;
- metrics/savings calculations;
- dashboard domain view models.
Agent Bundle should own:
- route discovery/contracts;
- host projection;
- execution context;
- event envelope/projection;
- App transport;
- browser serving;
- artifact/package/install mechanics.
Acceptance
Goal
Use cargo-hauler as a reference consumer of Agent Bundle's #592 architecture rather than preserving workarounds that exist only because current framework surfaces are split.
This is an umbrella migration issue. Do not rewrite working behavior before the relevant upstream capability lands.
1. Composite plugin root / distribution
Blocked on
ScriptedAlchemy/agent-bundle#555.Current cargo-hauler still encodes the old per-target artifact model in:
agent-bundle.config.tscomments (artifact/<target>);README.mdanddocs/install.md(artifact/<host>);AGENTS.md;src/cli/dashboard.tspath heuristics;tests/version-consistency.test.ts;artifact/cursor, etc.;files/installation prose.After #555:
artifact/root should contain selected Claude/Codex/Cursor/portable projections;artifact/<host>;agent-bundle.manifest.json/ host manifest pointers instead of hard-coded partition paths;Do not preserve compatibility path logic in cargo-hauler itself; Agent Bundle owns any legacy artifact probing.
2. Delete duplicated CLI schema contracts
Blocked on
ScriptedAlchemy/agent-bundle#593.src/cli/status.tsxre-declaresstatusInputSchemainline because static argv extraction cannot follow the canonical imported schema.tests/schema-compat.test.tsthen pins the copy tosrc/lib/protocol-schemas.ts.Once #593 lands:
Delete compatibility tests whose only purpose is preventing framework-forced schema drift.
Audit the remaining CLI/MCP pairs (
request,result,await,kill,last,log) for the same duplication and share contracts/domain execution wherever the presentation semantics permit it.3. Delete the hand-written MCP App transport/protocol layer
Blocked on
ScriptedAlchemy/agent-bundle#594.src/mcp/hauler/apps/dashboard.tsxcurrently owns a local JSON-RPC client overwindow.parent.postMessage('*'), request ids/timeouts,tools/callenvelopes, structured-result unwrapping, and manyunknownprotocol interfaces that duplicate the route result schemas.Once #594 lands, the App should consume the generated typed route client and keep only dashboard state/view logic.
Desired shape:
No local knowledge of JSON-RPC ids,
structuredContentenvelope shape, parent bridge semantics, or manually mirrored server protocol types.4. Replace checkout-only
hauler dashboardBlocked on
ScriptedAlchemy/agent-bundle#564and #594.src/cli/dashboard.tsis ~framework integration glue:node_modulesfor Agent Bundle's package manifest;agent-bundle serve-app;After #564, delete this implementation and use the framework-generated production browser command/host.
hauler dashboardshould work from the same installed composite plugin root as the MCP server and routed CLI, with no Agent Bundle checkout dependency.The application should configure/expose
hauler/dashboard; Agent Bundle owns serving, browser opening, lifecycle and URL/result protocol.5. Bring fast shell hooks back into the canonical event model
Blocked on
ScriptedAlchemy/agent-bundle#595.cargo-hauler #90 correctly moved high-frequency shell hooks to
hooks.beforeTool.handler/hooks.afterTool.handler: rendered event routes cost ~0.2 s per shell command pair before they could reject unrelated commands.This workaround should remain until #595 can emit a physically cheap preflight gate.
Afterward:
src/events/tool/{before,after}semantics;src/hooks/fast-path/**if no host-native escape hatch remains necessary;6. Provider cost
src/providers/hauler-daemon.tsprobes daemon health on every non-event route request. This is acceptable today but should be revisited once #595 supports lazy provider materialization/declared provider needs.Routes that only need static/help/render information should not probe the daemon merely because the provider exists globally. Keep the probe where domain semantics require a fresh health snapshot.
7. Keep domain/runtime boundaries
Do not move cargo orchestration into Agent Bundle. cargo-hauler should continue to own:
Agent Bundle should own:
Acceptance
artifact/<host>after #555 adoption.hauler dashboardworks from the installed/npm plugin root without a framework checkout after #564.