@eventmodelers/cli 0.0.6 → 0.0.8
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.
- package/README.md +42 -9
- package/cli.js +633 -175
- package/package.json +1 -1
- package/{stacks/node/templates → shared}/build-kit/README.md +3 -3
- package/{stacks/axon/templates → shared}/build-kit/lib/ralph.js +10 -3
- package/shared/build-kit/ralph-ollama.js +2 -2
- package/{stacks/node/templates → shared}/build-kit/ralph.sh +1 -1
- package/shared/build-kit/realtime-agent.js +1 -1
- package/{stacks/supabase/templates/.claude → shared}/skills/connect/SKILL.md +10 -5
- package/stacks/cratis-csharp/templates/build-kit/lib/AGENT.md +1 -0
- package/stacks/modeling-kit/templates/kit/README.md +79 -0
- package/stacks/modeling-kit/templates/kit/lib/ralph.js +9 -2
- package/stacks/modeling-kit/templates/kit/ralph.sh +1 -1
- package/stacks/node/templates/build-kit/lib/backend-prompt.md +1 -1
- package/stacks/supabase/templates/build-kit/lib/backend-prompt.md +1 -1
- package/stacks/axon/templates/.claude/skills/connect/SKILL.md +0 -178
- package/stacks/axon/templates/.claude/skills/learn-eventmodelers-api/SKILL.md +0 -611
- package/stacks/axon/templates/.claude/skills/update-slice-status/SKILL.md +0 -105
- package/stacks/axon/templates/build-kit/ralph.sh +0 -98
- package/stacks/cratis-csharp/templates/.claude/skills/connect/SKILL.md +0 -178
- package/stacks/cratis-csharp/templates/.claude/skills/learn-eventmodelers-api/SKILL.md +0 -609
- package/stacks/cratis-csharp/templates/.claude/skills/update-slice-status/SKILL.md +0 -105
- package/stacks/cratis-csharp/templates/build-kit/lib/agent.sh +0 -20
- package/stacks/cratis-csharp/templates/build-kit/lib/ralph.js +0 -302
- package/stacks/cratis-csharp/templates/build-kit/ralph-claude.js +0 -37
- package/stacks/cratis-csharp/templates/build-kit/ralph.sh +0 -98
- package/stacks/modeling-kit/templates/.claude/skills/connect/SKILL.md +0 -178
- package/stacks/modeling-kit/templates/.claude/skills/learn-eventmodelers-api/SKILL.md +0 -441
- package/stacks/modeling-kit/templates/.claude/skills/update-slice-status/SKILL.md +0 -110
- package/stacks/modeling-kit/templates/kit/lib/agent.sh +0 -20
- package/stacks/modeling-kit/templates/kit/lib/ollama-agent.js +0 -147
- package/stacks/modeling-kit/templates/kit/ralph-ollama.js +0 -38
- package/stacks/modeling-kit/templates/kit/realtime-agent.js +0 -18
- package/stacks/node/templates/.claude/skills/connect/SKILL.md +0 -178
- package/stacks/node/templates/build-kit/lib/agent.sh +0 -20
- package/stacks/node/templates/build-kit/lib/ralph.js +0 -369
- package/stacks/node/templates/build-kit/ralph-claude.js +0 -44
- package/stacks/supabase/templates/.claude/skills/learn-eventmodelers-api/SKILL.md +0 -628
- package/stacks/supabase/templates/.claude/skills/update-slice-status/SKILL.md +0 -110
- package/stacks/supabase/templates/build-kit/README.md +0 -86
- package/stacks/supabase/templates/build-kit/lib/agent.sh +0 -20
- package/stacks/supabase/templates/build-kit/lib/ralph.js +0 -369
- package/stacks/supabase/templates/build-kit/ralph-claude.js +0 -44
- package/stacks/supabase/templates/build-kit/ralph.sh +0 -98
- /package/{stacks/axon/templates → shared}/build-kit/lib/agent.sh +0 -0
- /package/{stacks/axon/templates → shared}/build-kit/ralph-claude.js +0 -0
- /package/{stacks/node/templates/.claude → shared}/skills/learn-eventmodelers-api/SKILL.md +0 -0
- /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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|