@delorenj/pjangler 1.2.18 → 1.2.21

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 (57) hide show
  1. package/dist/index.js +884 -295
  2. package/dist/mcp-server.js +892 -303
  3. package/package.json +8 -2
  4. package/templates/commonproject/AGENTS.md +3 -3
  5. package/templates/commonproject/README.md +11 -12
  6. package/templates/commonproject/copier.yml +11 -31
  7. package/templates/commonproject/template/.agents/hooks/README.md +13 -26
  8. package/templates/commonproject/template/.agents/hooks/lib/local-config.sh +4 -14
  9. package/templates/commonproject/template/.agents/hooks/sync.py +5 -6
  10. package/templates/commonproject/template/.agents/local.example.json +2 -8
  11. package/templates/commonproject/template/.agents/skills.json +6 -0
  12. package/templates/commonproject/template/.project.json.jinja +9 -13
  13. package/templates/commonproject/template/mise.toml.jinja +9 -16
  14. package/templates/hermes-agent/README.md +9 -9
  15. package/templates/hermes-agent/config.example.toml +1 -66
  16. package/templates/hermes-agent/copier.yml +4 -3
  17. package/templates/hermes-agent/docs/architecture.md +9 -12
  18. package/templates/hermes-agent/docs/fleet-control-plane/README.md +1 -1
  19. package/templates/hermes-agent/docs/operations.md +6 -5
  20. package/templates/hermes-agent/docs/sentinel/README.md +9 -7
  21. package/templates/hermes-agent/docs/sentinel/architecture.md +1 -2
  22. package/templates/hermes-agent/docs/sentinel/development.md +12 -13
  23. package/templates/hermes-agent/docs/sentinel/providers.md +34 -15
  24. package/templates/hermes-agent/install-local.sh +15 -14
  25. package/templates/hermes-agent/runtime-scaffold/README.md +1 -1
  26. package/templates/hermes-agent/runtime-scaffold/bloodbank-consumer.py +46 -14
  27. package/templates/hermes-agent/runtime-scaffold/memories/MEMORY.md +2 -2
  28. package/templates/hermes-agent/scripts/fleet-sync.sh +1 -64
  29. package/templates/hermes-agent/template/.gitignore.jinja +0 -2
  30. package/templates/hermes-agent/template/.runtime-scaffold/README.md +1 -1
  31. package/templates/hermes-agent/template/.runtime-scaffold/bloodbank-consumer.py +43 -9
  32. package/templates/hermes-agent/template/.runtime-scaffold/memories/MEMORY.md +2 -2
  33. package/templates/hermes-agent/template/.scripts/01-config.sh +0 -1
  34. package/templates/hermes-agent/template/.scripts/05-fleet-env.sh +0 -9
  35. package/templates/hermes-agent/template/.scripts/10-hermes-profile.sh +3 -22
  36. package/templates/hermes-agent/template/.scripts/20-runtime-repo.sh +0 -22
  37. package/templates/hermes-agent/template/.scripts/40-plane.sh +51 -0
  38. package/templates/hermes-agent/template/.scripts/42-ticket-provider.sh +59 -21
  39. package/templates/hermes-agent/template/.scripts/60-bloodbank.sh +2 -1
  40. package/templates/hermes-agent/template/.scripts/70-systemd.sh +1 -10
  41. package/templates/hermes-agent/template/.scripts/_lib.sh +3 -61
  42. package/templates/hermes-agent/template/.scripts/config.example.toml +0 -5
  43. package/templates/hermes-agent/template/.scripts/heartbeat.sh +33 -66
  44. package/templates/hermes-agent/template/.scripts/lib/ticket-provider.sh +5 -9
  45. package/templates/hermes-agent/template/.scripts/momo-wip-lock.py +137 -0
  46. package/templates/hermes-agent/template/.scripts/providers/linear.sh +176 -0
  47. package/templates/hermes-agent/template/.scripts/providers/plane.sh +9 -29
  48. package/templates/hermes-agent/template/.scripts/sentinel/docs/autonomous-delegated-review.md +2 -2
  49. package/templates/hermes-agent/template/.scripts/sentinel/docs/continuous-ticket-orchestration.md +1 -33
  50. package/templates/hermes-agent/template/.scripts/sentinel.prompt.md.jinja +22 -27
  51. package/templates/hermes-agent/template/SOUL.md.jinja +49 -30
  52. package/templates/hermes-agent/template/role.yaml.jinja +35 -4
  53. package/templates/hermes-agent/tests/test_bloodbank_consumer_contract.py +138 -0
  54. package/templates/commonproject/template/.mise/scripts/link-project-skills-to-clis.sh +0 -110
  55. package/templates/commonproject/template/.mise/scripts/unlink-project-skills-from-clis.sh +0 -45
  56. package/templates/hermes-agent/docs/bloodbank-gateway.md +0 -57
  57. package/templates/hermes-agent/docs/fleet-control-plane/n8n-service-hub.md +0 -60
@@ -1,45 +0,0 @@
1
- #!/bin/bash
2
- # Remove this project's skill symlinks from shared (global-scope) per-CLI dirs on
3
- # leave, so other projects / your global setup aren't polluted. Project-scoped
4
- # (local-scope) mirrors like ./.kimi-code/skills are left in place — they belong
5
- # to the repo and cost nothing to keep.
6
- #
7
- # Mirrors the SKILL_TARGETS table in link-project-skills-to-clis.sh.
8
- set -euo pipefail
9
-
10
- script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
11
- project_root="$(cd "${script_dir}/../.." && pwd)"
12
- agents_skills="${project_root}/.agents/skills"
13
-
14
- SKILL_TARGETS=(
15
- "${CODEX_HOME:-$HOME/.codex}/skills|global"
16
- "${project_root}/.kimi-code/skills|local"
17
- )
18
-
19
- [ -d "$agents_skills" ] || exit 0
20
-
21
- _readlink_norm() {
22
- local l; l="$(readlink "$1" 2>/dev/null || echo "")"
23
- printf '%s' "${l%/}"
24
- }
25
-
26
- for entry in "${SKILL_TARGETS[@]}"; do
27
- dir="${entry%%|*}"
28
- scope="${entry##*|}"
29
- [ "$scope" = "global" ] || continue
30
- [ -d "$dir" ] || continue
31
-
32
- unlinked=0
33
- for skill_path in "$agents_skills"/*; do
34
- [ -e "$skill_path" ] || continue
35
- name="$(basename "$skill_path")"
36
- [[ "$name" == ".system" ]] && continue
37
- target="${dir}/${name}"
38
- if [ -L "$target" ] && [ "$(_readlink_norm "$target")" = "$skill_path" ]; then
39
- rm "$target"
40
- unlinked=$((unlinked + 1))
41
- fi
42
- done
43
- [ "$unlinked" -gt 0 ] && echo "Unlinked ${unlinked} project skill(s) from ${dir}"
44
- done
45
- exit 0
@@ -1,57 +0,0 @@
1
- # Bloodbank Gateway
2
-
3
- Bloodbank command events should be a first-class Hermes gateway, not an inbox
4
- directory that a later heartbeat drains.
5
-
6
- ## Goal
7
-
8
- Make this true:
9
-
10
- ```
11
- Telegram message -> Hermes gateway -> agent turn queue -> agent acts
12
- Bloodbank command -> Hermes gateway -> agent turn queue -> agent acts
13
- Web message -> Hermes gateway -> agent turn queue -> agent acts
14
- ```
15
-
16
- The transport changes; the agent turn contract does not.
17
-
18
- ## Current State
19
-
20
- `runtime-scaffold/bloodbank-consumer.py` subscribes to NATS subjects and writes
21
- JSON files under `bloodbank-inbox/`. That proves subscription, envelope parsing,
22
- and durable audit capture, but it is not command execution. It can accumulate
23
- files while the agent never acts.
24
-
25
- ## Target Contract
26
-
27
- - The Bloodbank gateway subscribes to `bloodbank.cmd.v1.agent.<agent_id>.>`.
28
- - Each command event is converted into the same internal Hermes message/turn
29
- shape used by Telegram and web gateways.
30
- - Hermes owns backpressure: if the agent is busy, the command waits in the
31
- message queue until the agent can act.
32
- - The gateway emits lifecycle events:
33
- - received
34
- - accepted or rejected
35
- - turn_started
36
- - turn_completed or turn_failed
37
- - Replies use the incoming `correlationid` and `reply_to`/reply subject when
38
- present.
39
- - Idempotency uses the CloudEvent `id`; duplicate events do not create duplicate
40
- turns.
41
-
42
- ## Required Work
43
-
44
- 1. Add a Hermes transport adapter for Bloodbank/NATS.
45
- 2. Define a command payload schema that maps cleanly to a user prompt plus
46
- metadata (`actor`, `source`, `priority`, `correlationid`, `reply_to`).
47
- 3. Replace the file-inbox consumer service with `hermes gateway bloodbank run`
48
- or equivalent.
49
- 4. Keep optional audit persistence, but make it observational only.
50
- 5. Add smoke tests that publish a NATS command and assert that a Hermes turn is
51
- created, processed, and acknowledged.
52
-
53
- ## Non-Goals
54
-
55
- - No heartbeat inbox drain.
56
- - No polling directory as the command execution mechanism.
57
- - No per-agent one-off consumer logic.
@@ -1,60 +0,0 @@
1
- # n8n Service Hub
2
-
3
- n8n should become the visible service hub for fleet operations while systemd
4
- remains the local survival layer.
5
-
6
- ## Shape
7
-
8
- - systemd owns process supervision on each host.
9
- - n8n owns visibility, operator controls, scheduling, and multi-service flows.
10
- - pjangler owns deterministic generation and reconciliation of both sides.
11
-
12
- ## Service Model
13
-
14
- Each installed Hermes agent service is represented as an n8n node/workflow item:
15
-
16
- - gateway service
17
- - Bloodbank gateway or transitional consumer
18
- - heartbeat timer/service
19
- - runtime checkpoint status
20
- - ticket-provider health check
21
-
22
- The node does not replace systemd. It calls stable commands such as:
23
-
24
- ```
25
- systemctl --user status hermes-<agent>-heartbeat.timer
26
- systemctl --user restart hermes-<agent>-gateway.service
27
- pj fleet status --agent <agent_id> --json
28
- pj fleet reconcile --agent <agent_id> --apply
29
- ```
30
-
31
- ## Heartbeat v2
32
-
33
- Checkpoint era means the only recurring task was an hourly runtime
34
- commit/push. It preserved state but did not manage work.
35
-
36
- Heartbeat v2 is a frequent, cheap tick:
37
-
38
- - always performs a gated runtime checkpoint
39
- - optionally performs autonomous board reconciliation when
40
- `.project.json automation.reconcile.enabled` is true
41
- - records status in runtime state files for fleet status readers
42
- - can be triggered by systemd locally or by n8n centrally
43
-
44
- ## First Implementation Pass
45
-
46
- 1. Extend `pj fleet status --json` to include service unit state, last heartbeat,
47
- last checkpoint, and ticket-provider resolution.
48
- 2. Generate an n8n workflow from `~/.hermes/agents-registry.yaml`.
49
- 3. Add n8n actions for status, restart, reconcile dry-run, reconcile apply, and
50
- log tail.
51
- 4. Keep systemd timers installed and enabled as fallback.
52
- 5. Add drift detection when n8n and systemd disagree about an agent.
53
-
54
- ## Open Questions
55
-
56
- - Whether n8n should invoke local commands through SSH, an agent-side webhook,
57
- or a small host-local control API.
58
- - How much service history should live in n8n versus Hermes runtime state.
59
- - Whether Bloodbank gateway events should also drive n8n workflows for visible
60
- operator traces.