@eventmodelers/cli 0.0.7 → 0.0.9

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 (48) hide show
  1. package/README.md +42 -9
  2. package/cli.js +614 -149
  3. package/package.json +1 -1
  4. package/{stacks/node/templates → shared}/build-kit/README.md +3 -3
  5. package/{stacks/axon/templates → shared}/build-kit/lib/ralph.js +10 -3
  6. package/shared/build-kit/ralph-ollama.js +2 -2
  7. package/{stacks/node/templates → shared}/build-kit/ralph.sh +1 -1
  8. package/shared/build-kit/realtime-agent.js +1 -1
  9. package/{stacks/supabase/templates/.claude → shared}/skills/connect/SKILL.md +10 -5
  10. package/stacks/cratis-csharp/templates/build-kit/lib/AGENT.md +1 -0
  11. package/stacks/modeling-kit/templates/kit/README.md +79 -0
  12. package/stacks/modeling-kit/templates/kit/lib/ralph.js +9 -2
  13. package/stacks/modeling-kit/templates/kit/ralph.sh +1 -1
  14. package/stacks/node/templates/build-kit/lib/backend-prompt.md +1 -1
  15. package/stacks/supabase/templates/build-kit/lib/backend-prompt.md +1 -1
  16. package/stacks/axon/templates/.claude/skills/connect/SKILL.md +0 -178
  17. package/stacks/axon/templates/.claude/skills/learn-eventmodelers-api/SKILL.md +0 -611
  18. package/stacks/axon/templates/.claude/skills/update-slice-status/SKILL.md +0 -105
  19. package/stacks/axon/templates/build-kit/ralph.sh +0 -98
  20. package/stacks/cratis-csharp/templates/.claude/skills/connect/SKILL.md +0 -178
  21. package/stacks/cratis-csharp/templates/.claude/skills/learn-eventmodelers-api/SKILL.md +0 -609
  22. package/stacks/cratis-csharp/templates/.claude/skills/update-slice-status/SKILL.md +0 -105
  23. package/stacks/cratis-csharp/templates/build-kit/lib/agent.sh +0 -20
  24. package/stacks/cratis-csharp/templates/build-kit/lib/ralph.js +0 -302
  25. package/stacks/cratis-csharp/templates/build-kit/ralph-claude.js +0 -37
  26. package/stacks/cratis-csharp/templates/build-kit/ralph.sh +0 -98
  27. package/stacks/modeling-kit/templates/.claude/skills/connect/SKILL.md +0 -178
  28. package/stacks/modeling-kit/templates/.claude/skills/learn-eventmodelers-api/SKILL.md +0 -441
  29. package/stacks/modeling-kit/templates/.claude/skills/update-slice-status/SKILL.md +0 -110
  30. package/stacks/modeling-kit/templates/kit/lib/agent.sh +0 -20
  31. package/stacks/modeling-kit/templates/kit/lib/ollama-agent.js +0 -147
  32. package/stacks/modeling-kit/templates/kit/ralph-ollama.js +0 -38
  33. package/stacks/modeling-kit/templates/kit/realtime-agent.js +0 -18
  34. package/stacks/node/templates/.claude/skills/connect/SKILL.md +0 -178
  35. package/stacks/node/templates/build-kit/lib/agent.sh +0 -20
  36. package/stacks/node/templates/build-kit/lib/ralph.js +0 -369
  37. package/stacks/node/templates/build-kit/ralph-claude.js +0 -44
  38. package/stacks/supabase/templates/.claude/skills/learn-eventmodelers-api/SKILL.md +0 -628
  39. package/stacks/supabase/templates/.claude/skills/update-slice-status/SKILL.md +0 -110
  40. package/stacks/supabase/templates/build-kit/README.md +0 -86
  41. package/stacks/supabase/templates/build-kit/lib/agent.sh +0 -20
  42. package/stacks/supabase/templates/build-kit/lib/ralph.js +0 -369
  43. package/stacks/supabase/templates/build-kit/ralph-claude.js +0 -44
  44. package/stacks/supabase/templates/build-kit/ralph.sh +0 -98
  45. /package/{stacks/axon/templates → shared}/build-kit/lib/agent.sh +0 -0
  46. /package/{stacks/axon/templates → shared}/build-kit/ralph-claude.js +0 -0
  47. /package/{stacks/node/templates/.claude → shared}/skills/learn-eventmodelers-api/SKILL.md +0 -0
  48. /package/{stacks/node/templates/.claude → shared}/skills/update-slice-status/SKILL.md +0 -0
@@ -1,98 +0,0 @@
1
- #!/bin/bash
2
- # Ralph agent loop — two independent loops, each triggered by their own condition
3
- #
4
- # onTask: tasks.json has entries → load slice from board, update .build-kit/.slices/
5
- # onPlannedSlice: .build-kit/.slices/ has a "Planned" slice → build it
6
- #
7
- # The loops are NOT causally linked — either can trigger on its own.
8
- #
9
- # Usage: ./ralph.sh [iterations] [project_dir]
10
- # iterations — number of loop cycles to run; 0 or omitted means run forever
11
- # project_dir — path to the project root; defaults to the parent of .build-kit
12
-
13
- set -euo pipefail
14
-
15
- KIT_DIR="$(cd "$(dirname "$0")" && pwd)"
16
- ITERATIONS="${1:-0}"
17
- PROJECT_DIR="${2:-"$KIT_DIR/.."}"
18
- TASKS_FILE="$KIT_DIR/tasks.json"
19
- PROMPT_FILE="$KIT_DIR/lib/prompt.md"
20
- BACKEND_PROMPT_FILE="$KIT_DIR/lib/backend-prompt.md"
21
- AGENT_SCRIPT="$KIT_DIR/lib/agent.sh"
22
-
23
- HAS_CREDENTIALS=true
24
- if [[ ! -f "$KIT_DIR/.eventmodelers/config.json" ]]; then
25
- echo "[ralph] Note: no .eventmodelers/config.json found — platform sync disabled." >&2
26
- echo " To enable board sync, follow: https://app.eventmodelers.ai/documentation#build-supabase" >&2
27
- echo " Code generation from local slice definitions will still run." >&2
28
- HAS_CREDENTIALS=false
29
- fi
30
-
31
- echo "Ralph — kit: $KIT_DIR project: $PROJECT_DIR"
32
-
33
- # Returns 0 if tasks.json has at least one task
34
- has_pending_tasks() {
35
- [[ -f "$TASKS_FILE" ]] || return 1
36
- local content
37
- content=$(cat "$TASKS_FILE")
38
- [[ "$content" != "[]" && -n "$content" ]]
39
- }
40
-
41
- # Returns 0 if any JSON under .build-kit/.slices/ contains a "Planned" status
42
- has_planned_slices() {
43
- grep -rqi '"status"[[:space:]]*:[[:space:]]*"planned"' "$KIT_DIR/.slices/" --include='index.json' 2>/dev/null
44
- }
45
-
46
- # Returns the title of the first "Planned" slice, or empty string
47
- get_planned_slice_title() {
48
- for index_file in "$KIT_DIR/.slices/"*/index.json; do
49
- [[ -f "$index_file" ]] || continue
50
- local title
51
- title=$(node -e "
52
- try {
53
- const d = JSON.parse(require('fs').readFileSync(process.argv[1], 'utf-8'));
54
- const s = (d.slices||[]).find(s => (s.status||'').toLowerCase() === 'planned');
55
- if (s) process.stdout.write(s.slice || s.id || '');
56
- } catch(e) {}
57
- " "$index_file" 2>/dev/null)
58
- if [[ -n "$title" ]]; then
59
- echo "$title"
60
- return
61
- fi
62
- done
63
- }
64
-
65
- # Runs agent.sh with the given prompt; retries on non-zero exit
66
- run_agent() {
67
- local label="$1"
68
- local prompt="$2"
69
- while true; do
70
- echo "[$(date -u +%H:%M:%S)] $label"
71
- (cd "$PROJECT_DIR" && bash "$AGENT_SCRIPT" "$prompt") 2>&1 && return 0
72
- echo "[$(date -u +%H:%M:%S)] Agent error — retrying in 60s..."
73
- sleep 60
74
- done
75
- }
76
-
77
- cycle=0
78
- while [[ "$ITERATIONS" -eq 0 || "$cycle" -lt "$ITERATIONS" ]]; do
79
- ran_something=false
80
-
81
- if [[ "$HAS_CREDENTIALS" == true ]] && has_pending_tasks; then
82
- run_agent "onTask: loading slice from board..." "$(cat "$PROMPT_FILE")"
83
- ran_something=true
84
- fi
85
-
86
- if has_planned_slices; then
87
- slice_title=$(get_planned_slice_title)
88
- run_agent "onPlannedSlice: building \"$slice_title\"..." "$(cat "$BACKEND_PROMPT_FILE")"
89
- echo "[$(date -u +%H:%M:%S)] Slice \"$slice_title\" build complete — waiting for next slice"
90
- ran_something=true
91
- fi
92
-
93
- if [[ "$ran_something" == false ]]; then
94
- sleep 3
95
- fi
96
-
97
- (( cycle++ )) || true
98
- done