@ekkos/cli 1.0.33 → 1.0.35
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/dist/capture/jsonl-rewriter.js +72 -7
- package/dist/commands/dashboard.js +186 -557
- package/dist/commands/init.js +3 -15
- package/dist/commands/run.js +221 -259
- package/dist/commands/setup.js +0 -47
- package/dist/commands/swarm-dashboard.js +4 -13
- package/dist/deploy/instructions.d.ts +2 -5
- package/dist/deploy/instructions.js +8 -11
- package/dist/deploy/settings.js +21 -15
- package/dist/deploy/skills.d.ts +0 -8
- package/dist/deploy/skills.js +0 -26
- package/dist/index.js +2 -2
- package/dist/lib/usage-parser.js +1 -2
- package/dist/utils/platform.d.ts +0 -3
- package/dist/utils/platform.js +1 -4
- package/dist/utils/session-binding.d.ts +1 -1
- package/dist/utils/session-binding.js +2 -3
- package/package.json +4 -2
- package/templates/CLAUDE.md +23 -135
- package/templates/agents/README.md +182 -0
- package/templates/agents/code-reviewer.md +166 -0
- package/templates/agents/debug-detective.md +169 -0
- package/templates/agents/ekkOS_Vercel.md +99 -0
- package/templates/agents/extension-manager.md +229 -0
- package/templates/agents/git-companion.md +185 -0
- package/templates/agents/github-test-agent.md +321 -0
- package/templates/agents/railway-manager.md +179 -0
- package/templates/ekkos-manifest.json +8 -8
- package/templates/hooks/assistant-response.ps1 +160 -256
- package/templates/hooks/assistant-response.sh +66 -130
- package/templates/hooks/hooks.json +0 -6
- package/templates/hooks/lib/contract.sh +31 -43
- package/templates/hooks/lib/count-tokens.cjs +0 -0
- package/templates/hooks/lib/ekkos-reminders.sh +0 -0
- package/templates/hooks/lib/state.sh +1 -53
- package/templates/hooks/session-start.ps1 +391 -91
- package/templates/hooks/session-start.sh +166 -201
- package/templates/hooks/stop.ps1 +341 -202
- package/templates/hooks/stop.sh +948 -275
- package/templates/hooks/user-prompt-submit.ps1 +548 -224
- package/templates/hooks/user-prompt-submit.sh +456 -382
- package/templates/plan-template.md +0 -0
- package/templates/spec-template.md +0 -0
- package/templates/windsurf-hooks/before-submit-prompt.sh +238 -0
- package/templates/windsurf-hooks/hooks.json +2 -9
- package/templates/windsurf-hooks/install.sh +0 -0
- package/templates/windsurf-hooks/lib/contract.sh +0 -2
- package/templates/windsurf-hooks/post-cascade-response.sh +0 -0
- package/templates/windsurf-hooks/pre-user-prompt.sh +0 -0
- package/templates/windsurf-skills/ekkos-memory/SKILL.md +219 -0
- package/README.md +0 -57
|
@@ -283,8 +283,9 @@ function truncateToolResult(line) {
|
|
|
283
283
|
return line;
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
|
-
//
|
|
286
|
+
// Evicted content store (for retrieval by ccDNA)
|
|
287
287
|
const EVICTED_STORE = path.join(os.homedir(), '.ekkos', 'evicted-context.jsonl');
|
|
288
|
+
const EKKOS_CAPTURE_ENDPOINT = 'https://mcp.ekkos.dev/api/v1/context/evict';
|
|
288
289
|
const EKKOS_API_URL = process.env.EKKOS_API_URL || 'https://mcp.ekkos.dev';
|
|
289
290
|
/**
|
|
290
291
|
* Evict messages using the Handshake Protocol (two-phase commit)
|
|
@@ -405,16 +406,80 @@ async function isHandshakeEvictionAvailable() {
|
|
|
405
406
|
}
|
|
406
407
|
return (0, eviction_client_js_1.checkEvictionHealth)(EKKOS_API_URL, authToken);
|
|
407
408
|
}
|
|
409
|
+
/**
|
|
410
|
+
* Send evicted content to ekkOS cloud for later retrieval (async, non-blocking)
|
|
411
|
+
*/
|
|
412
|
+
async function captureEvictedToCloud(lines, sessionId) {
|
|
413
|
+
try {
|
|
414
|
+
// Get auth token from environment
|
|
415
|
+
const authToken = process.env.EKKOS_AUTH_TOKEN || process.env.SUPABASE_AUTH_TOKEN;
|
|
416
|
+
if (!authToken) {
|
|
417
|
+
debugLog('CLOUD_CAPTURE_SKIP', 'No auth token available');
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
// Parse messages from JSONL lines
|
|
421
|
+
const messages = [];
|
|
422
|
+
for (const line of lines) {
|
|
423
|
+
try {
|
|
424
|
+
const parsed = JSON.parse(line);
|
|
425
|
+
if (parsed.message) {
|
|
426
|
+
messages.push({
|
|
427
|
+
role: parsed.message.role || 'unknown',
|
|
428
|
+
content: parsed.message.content,
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
catch {
|
|
433
|
+
// Skip unparseable lines
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
if (messages.length === 0)
|
|
437
|
+
return;
|
|
438
|
+
// Estimate tokens (rough: 1 token ≈ 4 chars)
|
|
439
|
+
const totalChars = lines.reduce((sum, l) => sum + l.length, 0);
|
|
440
|
+
const estimatedTokens = Math.ceil(totalChars / 4);
|
|
441
|
+
const payload = {
|
|
442
|
+
session_id: sessionId || 'unknown',
|
|
443
|
+
chunk_index: Date.now(), // Use timestamp as unique chunk index
|
|
444
|
+
messages,
|
|
445
|
+
token_count: estimatedTokens,
|
|
446
|
+
eviction_reason: 'sliding_window',
|
|
447
|
+
};
|
|
448
|
+
// Non-blocking fetch - don't await, let it happen in background
|
|
449
|
+
// 10s timeout to prevent lingering connections from burning resources
|
|
450
|
+
fetch(EKKOS_CAPTURE_ENDPOINT, {
|
|
451
|
+
method: 'POST',
|
|
452
|
+
headers: {
|
|
453
|
+
'Content-Type': 'application/json',
|
|
454
|
+
'Authorization': `Bearer ${authToken}`,
|
|
455
|
+
},
|
|
456
|
+
body: JSON.stringify(payload),
|
|
457
|
+
signal: AbortSignal.timeout(10000),
|
|
458
|
+
}).then(res => {
|
|
459
|
+
if (res.ok) {
|
|
460
|
+
debugLog('CLOUD_CAPTURE_OK', `Sent ${messages.length} msgs to cloud`);
|
|
461
|
+
}
|
|
462
|
+
else {
|
|
463
|
+
debugLog('CLOUD_CAPTURE_FAIL', `HTTP ${res.status}`);
|
|
464
|
+
}
|
|
465
|
+
}).catch(err => {
|
|
466
|
+
debugLog('CLOUD_CAPTURE_ERROR', err.message);
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
catch (err) {
|
|
470
|
+
debugLog('CLOUD_CAPTURE_ERROR', err.message);
|
|
471
|
+
}
|
|
472
|
+
}
|
|
408
473
|
/**
|
|
409
474
|
* Save evicted content for later retrieval
|
|
410
475
|
* Now supports handshake eviction when available
|
|
411
476
|
*
|
|
412
477
|
* @param lines - JSONL lines being evicted
|
|
413
|
-
* @param
|
|
414
|
-
* @param
|
|
415
|
-
* @param
|
|
478
|
+
* @param sessionId - Session ID (for legacy capture)
|
|
479
|
+
* @param sessionName - Session name (for handshake eviction)
|
|
480
|
+
* @param indices - Original indices of evicted lines
|
|
416
481
|
*/
|
|
417
|
-
function saveEvictedContent(lines,
|
|
482
|
+
function saveEvictedContent(lines, sessionId, sessionName, indices) {
|
|
418
483
|
if (lines.length === 0)
|
|
419
484
|
return;
|
|
420
485
|
try {
|
|
@@ -451,8 +516,8 @@ function saveEvictedContent(lines, _sessionId, _sessionName, _indices) {
|
|
|
451
516
|
const entries = content.split('\n').filter(l => l.trim());
|
|
452
517
|
fs.writeFileSync(EVICTED_STORE, entries.slice(-100).join('\n') + '\n');
|
|
453
518
|
}
|
|
454
|
-
//
|
|
455
|
-
|
|
519
|
+
// Send to cloud for cross-session retrieval (non-blocking)
|
|
520
|
+
captureEvictedToCloud(lines, sessionId);
|
|
456
521
|
}
|
|
457
522
|
catch {
|
|
458
523
|
// Silent fail
|