@ekkos/cli 0.3.3 → 1.0.1
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 +57 -0
- package/dist/agent/daemon.d.ts +27 -0
- package/dist/agent/daemon.js +254 -29
- package/dist/agent/health-check.d.ts +35 -0
- package/dist/agent/health-check.js +243 -0
- package/dist/agent/pty-runner.d.ts +1 -0
- package/dist/agent/pty-runner.js +6 -1
- package/dist/capture/transcript-repair.d.ts +1 -0
- package/dist/capture/transcript-repair.js +12 -1
- package/dist/commands/agent.d.ts +6 -0
- package/dist/commands/agent.js +244 -0
- package/dist/commands/dashboard.d.ts +25 -0
- package/dist/commands/dashboard.js +1175 -0
- package/dist/commands/run.d.ts +3 -0
- package/dist/commands/run.js +503 -350
- package/dist/commands/setup-remote.js +146 -37
- package/dist/commands/swarm-dashboard.d.ts +20 -0
- package/dist/commands/swarm-dashboard.js +735 -0
- package/dist/commands/swarm-setup.d.ts +10 -0
- package/dist/commands/swarm-setup.js +956 -0
- package/dist/commands/swarm.d.ts +46 -0
- package/dist/commands/swarm.js +441 -0
- package/dist/commands/test-claude.d.ts +16 -0
- package/dist/commands/test-claude.js +156 -0
- package/dist/commands/usage/blocks.d.ts +8 -0
- package/dist/commands/usage/blocks.js +60 -0
- package/dist/commands/usage/daily.d.ts +9 -0
- package/dist/commands/usage/daily.js +96 -0
- package/dist/commands/usage/dashboard.d.ts +8 -0
- package/dist/commands/usage/dashboard.js +104 -0
- package/dist/commands/usage/formatters.d.ts +41 -0
- package/dist/commands/usage/formatters.js +147 -0
- package/dist/commands/usage/index.d.ts +13 -0
- package/dist/commands/usage/index.js +87 -0
- package/dist/commands/usage/monthly.d.ts +8 -0
- package/dist/commands/usage/monthly.js +66 -0
- package/dist/commands/usage/session.d.ts +11 -0
- package/dist/commands/usage/session.js +193 -0
- package/dist/commands/usage/weekly.d.ts +9 -0
- package/dist/commands/usage/weekly.js +61 -0
- package/dist/deploy/instructions.d.ts +5 -2
- package/dist/deploy/instructions.js +11 -8
- package/dist/index.js +256 -20
- package/dist/lib/tmux-scrollbar.d.ts +14 -0
- package/dist/lib/tmux-scrollbar.js +296 -0
- package/dist/lib/usage-parser.d.ts +95 -5
- package/dist/lib/usage-parser.js +416 -71
- package/dist/utils/log-rotate.d.ts +18 -0
- package/dist/utils/log-rotate.js +74 -0
- package/dist/utils/platform.d.ts +2 -0
- package/dist/utils/platform.js +3 -1
- package/dist/utils/session-binding.d.ts +5 -0
- package/dist/utils/session-binding.js +46 -0
- package/dist/utils/state.js +4 -0
- package/dist/utils/verify-remote-terminal.d.ts +10 -0
- package/dist/utils/verify-remote-terminal.js +415 -0
- package/package.json +16 -11
- package/templates/CLAUDE.md +135 -23
- package/templates/cursor-hooks/after-agent-response.sh +0 -0
- package/templates/cursor-hooks/before-submit-prompt.sh +0 -0
- package/templates/cursor-hooks/stop.sh +0 -0
- package/templates/ekkos-manifest.json +5 -5
- package/templates/hooks/assistant-response.sh +0 -0
- package/templates/hooks/lib/contract.sh +43 -31
- package/templates/hooks/lib/count-tokens.cjs +86 -0
- package/templates/hooks/lib/ekkos-reminders.sh +98 -0
- package/templates/hooks/lib/state.sh +53 -1
- package/templates/hooks/session-start.sh +0 -0
- package/templates/hooks/stop.sh +150 -388
- package/templates/hooks/user-prompt-submit.sh +353 -443
- package/templates/plan-template.md +0 -0
- package/templates/spec-template.md +0 -0
- package/templates/windsurf-hooks/README.md +212 -0
- package/templates/windsurf-hooks/hooks.json +9 -2
- package/templates/windsurf-hooks/install.sh +148 -0
- package/templates/windsurf-hooks/lib/contract.sh +2 -0
- package/templates/windsurf-hooks/post-cascade-response.sh +251 -0
- package/templates/windsurf-hooks/pre-user-prompt.sh +435 -0
- package/templates/windsurf-skills/ekkos-memory/SKILL.md +219 -0
- package/LICENSE +0 -21
- package/templates/windsurf-hooks/before-submit-prompt.sh +0 -238
|
@@ -20,25 +20,40 @@ mkdir -p "$STATE_DIR"
|
|
|
20
20
|
# State File Management
|
|
21
21
|
# ═══════════════════════════════════════════════════════════════════════════
|
|
22
22
|
|
|
23
|
-
# Save patterns for session
|
|
23
|
+
# Save patterns for session (with retrieval_token for verified tracking)
|
|
24
24
|
save_patterns() {
|
|
25
25
|
local session_id="$1"
|
|
26
26
|
local patterns="$2"
|
|
27
27
|
local model_used="$3"
|
|
28
|
+
local retrieval_token="${4:-}" # Optional retrieval_token for verified applications
|
|
28
29
|
|
|
29
30
|
local state_file="$STATE_DIR/patterns-${session_id}.json"
|
|
30
31
|
|
|
31
32
|
jq -n \
|
|
32
33
|
--argjson patterns "$patterns" \
|
|
33
34
|
--arg model "$model_used" \
|
|
35
|
+
--arg token "$retrieval_token" \
|
|
34
36
|
--arg timestamp "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
|
|
35
37
|
'{
|
|
36
38
|
patterns: $patterns,
|
|
37
39
|
model_used: $model,
|
|
40
|
+
retrieval_token: $token,
|
|
38
41
|
saved_at: $timestamp
|
|
39
42
|
}' > "$state_file"
|
|
40
43
|
}
|
|
41
44
|
|
|
45
|
+
# Get retrieval token from saved patterns
|
|
46
|
+
get_retrieval_token() {
|
|
47
|
+
local session_id="$1"
|
|
48
|
+
local state_file="$STATE_DIR/patterns-${session_id}.json"
|
|
49
|
+
|
|
50
|
+
if [ -f "$state_file" ]; then
|
|
51
|
+
jq -r '.retrieval_token // ""' "$state_file" 2>/dev/null
|
|
52
|
+
else
|
|
53
|
+
echo ""
|
|
54
|
+
fi
|
|
55
|
+
}
|
|
56
|
+
|
|
42
57
|
# Load patterns for session
|
|
43
58
|
load_patterns() {
|
|
44
59
|
local session_id="$1"
|
|
@@ -57,6 +72,43 @@ clear_patterns() {
|
|
|
57
72
|
rm -f "$STATE_DIR/patterns-${session_id}.json"
|
|
58
73
|
}
|
|
59
74
|
|
|
75
|
+
# ═══════════════════════════════════════════════════════════════════════════
|
|
76
|
+
# Conversation Context (for Golden Loop MEASURE phase)
|
|
77
|
+
# ═══════════════════════════════════════════════════════════════════════════
|
|
78
|
+
|
|
79
|
+
# Save current conversation context for pattern tracking
|
|
80
|
+
# Called by user-prompt-submit.sh when new query is submitted
|
|
81
|
+
save_conversation_context() {
|
|
82
|
+
local session_id="$1"
|
|
83
|
+
local user_query="$2"
|
|
84
|
+
local prev_response="$3"
|
|
85
|
+
|
|
86
|
+
local context_file="$STATE_DIR/conversation-${session_id}.json"
|
|
87
|
+
|
|
88
|
+
jq -n \
|
|
89
|
+
--arg query "$user_query" \
|
|
90
|
+
--arg response "$prev_response" \
|
|
91
|
+
--arg timestamp "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
|
|
92
|
+
'{
|
|
93
|
+
query: $query,
|
|
94
|
+
response: $response,
|
|
95
|
+
saved_at: $timestamp
|
|
96
|
+
}' > "$context_file" 2>/dev/null || true
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
# Load current conversation context
|
|
100
|
+
# Called by post-tool-use.sh when tracking pattern applications
|
|
101
|
+
load_conversation_context() {
|
|
102
|
+
local session_id="$1"
|
|
103
|
+
local context_file="$STATE_DIR/conversation-${session_id}.json"
|
|
104
|
+
|
|
105
|
+
if [ -f "$context_file" ]; then
|
|
106
|
+
cat "$context_file"
|
|
107
|
+
else
|
|
108
|
+
echo '{"query":"","response":""}'
|
|
109
|
+
fi
|
|
110
|
+
}
|
|
111
|
+
|
|
60
112
|
# ═══════════════════════════════════════════════════════════════════════════
|
|
61
113
|
# Capture Deduplication
|
|
62
114
|
# ═══════════════════════════════════════════════════════════════════════════
|
|
File without changes
|