feat(dev-hub): custodian dev up and files-first local hub (CUST-WP-0054-T07)
Add dev_hub_up.sh, mcp_hub_profile.sh, Makefile targets, and custodian dev up subcommand for offline-capable local hub bootstrap.
This commit is contained in:
parent
931ebfb652
commit
2d6b5f0150
4 changed files with 250 additions and 1 deletions
|
|
@ -565,6 +565,27 @@ def cmd_outbox_cancel(args: argparse.Namespace) -> None:
|
|||
store.cancel(args.envelope_id)
|
||||
print(f"Cancelled {args.envelope_id}")
|
||||
|
||||
|
||||
def cmd_dev_up(args: argparse.Namespace) -> None:
|
||||
"""Start files-first local dev hub (compose path via dev_hub_up.sh)."""
|
||||
script = STATE_HUB_DIR / "scripts" / "dev_hub_up.sh"
|
||||
if not script.exists():
|
||||
print(f"ERROR: dev hub script not found at {script}")
|
||||
sys.exit(1)
|
||||
|
||||
env = os.environ.copy()
|
||||
if args.with_edge:
|
||||
env["WITH_EDGE"] = "1"
|
||||
if args.with_mcp:
|
||||
env["WITH_MCP"] = "1"
|
||||
if args.repo_root:
|
||||
env["REPO_ROOT"] = str(Path(args.repo_root).expanduser().resolve())
|
||||
|
||||
cmd = ["bash", str(script), args.profile]
|
||||
result = subprocess.run(cmd, env=env, cwd=STATE_HUB_DIR)
|
||||
sys.exit(result.returncode)
|
||||
|
||||
|
||||
# ── Entry point ────────────────────────────────────────────────────────────────
|
||||
|
||||
def main() -> None:
|
||||
|
|
@ -709,6 +730,25 @@ def main() -> None:
|
|||
# status
|
||||
sub.add_parser("status", help="Show State Hub health and summary totals")
|
||||
|
||||
# dev up — files-first local hub (CUST-WP-0054-T07)
|
||||
dev = sub.add_parser("dev", help="Local dev-hub commands")
|
||||
dev_sub = dev.add_subparsers(dest="dev_command", required=True)
|
||||
dev_up = dev_sub.add_parser("up", help="Start local dev hub from repo files")
|
||||
dev_up.add_argument(
|
||||
"--profile",
|
||||
choices=["dev", "fleet"],
|
||||
default="dev",
|
||||
help="dev=local :8000; fleet=prefer tunnel :18000 when reachable",
|
||||
)
|
||||
dev_up.add_argument("--with-edge", action="store_true", help="Start edge relay on :18080")
|
||||
dev_up.add_argument("--with-mcp", action="store_true", help="Register dev-hub MCP after API is up")
|
||||
dev_up.add_argument(
|
||||
"--repo-root",
|
||||
default=None,
|
||||
help="Parent directory for register-from-classification-all (default: $HOME)",
|
||||
)
|
||||
dev_up.set_defaults(func=cmd_dev_up)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
if hasattr(args, "func"):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue