@delorenj/pjangler 1.4.2 → 1.4.4

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.
Files changed (39) hide show
  1. package/README.md +528 -0
  2. package/contracts/fleet-contract.yaml +513 -0
  3. package/dist/index.js +9333 -1509
  4. package/dist/mcp-server.js +6634 -1096
  5. package/dist/prompt.js +2 -1
  6. package/package.json +10 -4
  7. package/templates/hermes-agent/copier.yml +16 -3
  8. package/templates/hermes-agent/template/.runtime-scaffold/memories/MEMORY.md +7 -4
  9. package/templates/hermes-agent/template/.scripts/10-hermes-profile.sh +88 -94
  10. package/templates/hermes-agent/template/.scripts/20-runtime-repo.sh +44 -21
  11. package/templates/hermes-agent/template/.scripts/30-telegram.sh +182 -171
  12. package/templates/hermes-agent/template/.scripts/31-slack.sh +260 -165
  13. package/templates/hermes-agent/template/.scripts/40-plane.sh +45 -36
  14. package/templates/hermes-agent/template/.scripts/42-ticket-provider.sh +210 -41
  15. package/templates/hermes-agent/template/.scripts/70-systemd.sh +129 -15
  16. package/templates/hermes-agent/template/.scripts/80-registry.sh +42 -6
  17. package/templates/hermes-agent/template/.scripts/99-summary.sh +69 -16
  18. package/templates/hermes-agent/template/.scripts/_lib.sh +773 -0
  19. package/templates/hermes-agent/template/.scripts/channel-transaction.py +2340 -0
  20. package/templates/hermes-agent/template/.scripts/config.example.toml +8 -2
  21. package/templates/hermes-agent/template/.scripts/credential-launch.sh +5 -1
  22. package/templates/hermes-agent/template/.scripts/heartbeat.sh +2 -3
  23. package/templates/hermes-agent/template/.scripts/lib/profile-config-lock.py +182 -0
  24. package/templates/hermes-agent/template/.scripts/lib/profile-config-seed.py +108 -0
  25. package/templates/hermes-agent/template/.scripts/lib/ticket-provider.sh +93 -4
  26. package/templates/hermes-agent/template/.scripts/lib/voice-config.py +546 -0
  27. package/templates/hermes-agent/template/.scripts/providers/linear.sh +138 -25
  28. package/templates/hermes-agent/template/.scripts/providers/plane.sh +408 -51
  29. package/templates/hermes-agent/template/.scripts/providers/trello.sh +54 -6
  30. package/templates/hermes-agent/template/.scripts/sentinel/bin/issue-autonomous-review.sh +257 -43
  31. package/templates/hermes-agent/template/.scripts/sentinel/bin/issue-close-gate.sh +142 -25
  32. package/templates/hermes-agent/template/.scripts/sentinel/docs/autonomous-delegated-review.md +13 -19
  33. package/templates/hermes-agent/template/.scripts/sentinel/docs/bloodbank-events.md +29 -36
  34. package/templates/hermes-agent/template/.scripts/sentinel/docs/continuous-ticket-orchestration.md +3 -1
  35. package/templates/hermes-agent/template/.scripts/sentinel.prompt.md.jinja +7 -8
  36. package/templates/hermes-agent/template/.scripts/store-onepassword-secret.py +260 -0
  37. package/templates/hermes-agent/template/SOUL.md.jinja +14 -16
  38. package/templates/hermes-agent/template/hermes.jinja +1 -1
  39. package/templates/hermes-agent/template/role.yaml.jinja +15 -4
@@ -1,32 +1,85 @@
1
1
  #!/usr/bin/env bash
2
- # Print the final summary and next steps.
2
+ # Print a reconciliation summary derived from durable role/service state.
3
3
  # shellcheck source=_lib.sh
4
4
  source "$(dirname "$0")/_lib.sh"
5
5
  load_role_env
6
6
 
7
7
  GW_UNIT="hermes-${AGENT_ID}-gateway.service"
8
8
  HB_TIMER="hermes-${AGENT_ID}-heartbeat.timer"
9
+ GW_STATE="$(yaml_get service_state.gateway)"
10
+ HB_STATE="$(yaml_get service_state.heartbeat)"
11
+ TELEGRAM_STATE="$(yaml_get telegram.provisioning_status)"
12
+ SLACK_STATE="$(yaml_get slack.provisioning_status)"
13
+ RECONCILE_STATE="$(yaml_get reconcile.enabled)"
14
+ RECONCILE_OPT_OUT="$(yaml_get reconcile.explicit_opt_out)"
15
+ BOARD_ID="$(yaml_get ticket_provider.board_id)"
16
+
17
+ # Reconcile durable claims with live unit truth at presentation time. A stale
18
+ # role.yaml must never turn an exited launcher or failed heartbeat into an
19
+ # operational summary.
20
+ if [[ "$HB_STATE" == "active" || "$GW_STATE" =~ ^(active|deferred)$ ]]; then
21
+ if systemd_user_available; then
22
+ if [[ "$HB_STATE" == "active" ]]; then
23
+ hb_live="$(systemd_timer_health_snapshot "$HB_TIMER" "hermes-${AGENT_ID}-heartbeat.service")"
24
+ [[ "$hb_live" == ok\|* ]] || HB_STATE="error (stale active claim)"
25
+ fi
26
+ if [[ "$GW_STATE" == "active" ]]; then
27
+ gw_live="$(systemd_service_health_snapshot "$GW_UNIT" running)"
28
+ [[ "$gw_live" == ok\|* ]] || GW_STATE="error (stale active claim)"
29
+ elif [[ "$GW_STATE" == "deferred" ]]; then
30
+ gw_live="$(systemd_gateway_deferred_snapshot "$GW_UNIT")"
31
+ [[ "$gw_live" == "ok|deferred" ]] || GW_STATE="error (stale deferred claim)"
32
+ fi
33
+ else
34
+ [[ "$HB_STATE" != "active" ]] || HB_STATE="unverified (user manager unavailable)"
35
+ [[ "$GW_STATE" != "active" && "$GW_STATE" != "deferred" ]] \
36
+ || GW_STATE="unverified (user manager unavailable)"
37
+ fi
38
+ fi
39
+
40
+ case "$HB_STATE:$GW_STATE" in
41
+ active:active) MODE="OPERATIONAL" ;;
42
+ active:deferred) MODE="OPERATIONAL_WITH_GATEWAY_DEFERRED" ;;
43
+ installed:installed|installed:deferred) MODE="INSTALLED_NOT_ACTIVE" ;;
44
+ *) MODE="INCOMPLETE" ;;
45
+ esac
9
46
 
10
47
  cat >&2 <<EOF
11
48
 
12
- ╭─ Provisioned: $AGENT_ID ───────────────────────────────────────────────╮
49
+ ╭─ Hermes deployment: $AGENT_ID ───────────────────────────────────────╮
13
50
 
14
- Talk: @$BOT_HANDLE (Telegram DM)
15
- Shell: $ROLE_DIR/hermes chat "status"
16
- Board: $PLANE_BASE/$PLANE_WORKSPACE/projects/$(cat "$ROLE_DIR/.scripts/.plane-project-id" 2>/dev/null || echo "(skipped)")
17
- Runtime: $ROLE_DIR/runtime (pure-local, ignored)
18
- Hermes bin: $HERMES_BIN
19
- Fleet env: $FLEET_ENV
51
+ Mode: $MODE
52
+ Gateway: $GW_STATE ($GW_UNIT)
53
+ Heartbeat: $HB_STATE ($HB_TIMER)
54
+ Reconciliation: $RECONCILE_STATE (explicit opt-out: ${RECONCILE_OPT_OUT:-false})
55
+ Telegram: $TELEGRAM_STATE
56
+ Slack: $SLACK_STATE
57
+ │ Board: ${BOARD_ID:-deferred}
58
+ │ Runtime: $ROLE_DIR/runtime (pure-local, ignored)
59
+ │ Hermes bin: $HERMES_BIN
60
+ │ Fleet env: $FLEET_ENV
20
61
 
21
- │ Start fleet daemons:
22
- │ systemctl --user start $GW_UNIT
23
- │ systemctl --user start $HB_TIMER
24
-
25
- │ Tail logs:
26
- │ journalctl --user -fu $GW_UNIT
62
+ EOF
63
+
64
+ if [[ "$TELEGRAM_STATE" == "verified" ]]; then
65
+ printf ' Talk: @%s (Telegram DM)\n' "$BOT_HANDLE" >&2
66
+ fi
67
+ if [[ "$SLACK_STATE" == "verified" ]]; then
68
+ printf '│ Slack bot: %s\n' "$(yaml_get slack.bot_username)" >&2
69
+ fi
70
+ printf '│ Shell: %s/hermes chat "status"\n' "$ROLE_DIR" >&2
71
+
72
+ if [[ "$GW_STATE" == "deferred" ]]; then
73
+ cat >&2 <<EOF
27
74
 
28
- Fleet status:
29
- python3 -c "import yaml,pathlib; print(yaml.safe_dump(yaml.safe_load(pathlib.Path('$REGISTRY_FILE').read_text())['agents']))"
75
+ Gateway activation is deferred. Store and verify a dedicated Telegram or
76
+ Slack credential through the provisioner; do not start $GW_UNIT manually.
77
+ EOF
78
+ elif [[ "$GW_STATE" == "active" ]]; then
79
+ printf '│ Gateway log: journalctl --user -fu %s\n' "$GW_UNIT" >&2
80
+ fi
81
+
82
+ cat >&2 <<'EOF'
30
83
 
31
84
  ╰────────────────────────────────────────────────────────────────────────╯
32
85