Skip to content

Commit b345c1b

Browse files
authored
Delegate AgentRegistryGrant resolver from bootstrap CLI
Continues #51 after #50 and #52. Adds bootstrap `agent-machine registry resolve` usage text and delegates that command to the standalone `agent_machine.agent_registry` module. Python CLI grant-store integration and package validator import/check remain tracked in #51. Validated on PR head e054968 with validate and Trust Surface passing.
1 parent a60ee5d commit b345c1b

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

bin/agent-machine

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ delegate_python_cli() {
4444
return 127
4545
}
4646

47+
delegate_registry_resolver() {
48+
ROOT="$(repo_root_guess || true)"
49+
if [ -n "${ROOT:-}" ] && [ -d "$ROOT/src/agent_machine" ]; then
50+
PYTHONPATH="$ROOT/src${PYTHONPATH:+:$PYTHONPATH}" python3 -m agent_machine.agent_registry "$@"
51+
return $?
52+
fi
53+
printf '%s\n' "agent-machine: Agent Registry resolver unavailable; repository package sources not found." >&2
54+
return 127
55+
}
56+
4757
print_help() {
4858
cat <<'EOF'
4959
agent-machine: SourceOS Agent Machine local node substrate CLI
@@ -59,6 +69,7 @@ Usage:
5969
agent-machine render quadlet <agentpod.json> [--compare <file>]
6070
agent-machine render k8s <agentpod.json> [--compare <file>]
6171
agent-machine policy resolve <agentpod.json> --policy-dir <dir> --deployment-receipt-id <id> [--expected-status allowed]
72+
agent-machine registry resolve <agentpod.json> --grant-dir <dir> --requested-agent-identity-ref <ref> --session-ref <ref> [--expected-status active]
6273
agent-machine activate evaluate <agentpod.json> [policy.json] <grant.json> --deployment-receipt-id <id> [--policy-dir <dir>] [--storage-receipt-dir <dir>] [--pretty]
6374
agent-machine steer stub-response <request.json> [--status not_configured|noop] [--pretty]
6475
agent-machine steer serve-stub [--host 127.0.0.1] [--port 8080] [--status not_configured|noop]
@@ -282,6 +293,16 @@ case "$COMMAND" in
282293
shift || true
283294
delegate_python_cli policy "$@"
284295
;;
296+
registry)
297+
shift || true
298+
if [ "${1:-}" = "resolve" ]; then
299+
shift || true
300+
delegate_registry_resolver "$@"
301+
else
302+
printf '%s\n' "agent-machine: unsupported registry subcommand: ${1:-<missing>}" >&2
303+
exit 2
304+
fi
305+
;;
285306
activate)
286307
shift || true
287308
delegate_python_cli activate "$@"

0 commit comments

Comments
 (0)