#!/usr/bin/env bash # Watch what the agents on this machine are doing, in the foreground. # # Sits where a plugin looks by default and narrates every record. On its own # that is all it does: it mints nothing, so nothing gets an identity. # # With didbot's daemon behind it, all three parts run at once — the plugin # talks to this, this narrates and passes each record on, and whatever the # daemon answers goes back untouched. Start the daemon on the path this one # forwards to: # # DIDBOT_SOCK="${XDG_RUNTIME_DIR:-/tmp}/didbot-agent/daemon.sock" \ # ./scripts/dev-agentd.sh # in the didbot checkout set -euo pipefail cd "$(dirname "$0")/.." RUN="${XDG_RUNTIME_DIR:-/tmp}/didbot-agent" SOCK="${DIDBOT_SOCK:-$RUN/agent.sock}" FORWARD="${DIDBOT_FORWARD:-$RUN/daemon.sock}" say() { printf '\033[1m%s\033[0m\n' "$*"; } ARGS=(--socket "$SOCK") if [ -S "$FORWARD" ]; then say "feed on ${SOCK}, forwarding to ${FORWARD}" echo " contexts will be given identities by whatever is behind that socket" ARGS+=(--forward "$FORWARD") else say "feed on ${SOCK}" echo " nothing is listening on ${FORWARD}, so this narrates and hands out no" echo " identities. Start didbot's daemon there and restart this to relay:" echo " DIDBOT_SOCK=\"$FORWARD\" ./scripts/dev-agentd.sh" fi echo exec ./tools/echo-receiver.py "${ARGS[@]}" "$@"