@ekkos/cli 0.2.0
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/cache/LocalSessionStore.d.ts +129 -0
- package/dist/cache/LocalSessionStore.js +688 -0
- package/dist/cache/capture.d.ts +26 -0
- package/dist/cache/capture.js +461 -0
- package/dist/cache/index.d.ts +7 -0
- package/dist/cache/index.js +23 -0
- package/dist/cache/types.d.ts +147 -0
- package/dist/cache/types.js +40 -0
- package/dist/commands/init.d.ts +9 -0
- package/dist/commands/init.js +478 -0
- package/dist/commands/run.d.ts +12 -0
- package/dist/commands/run.js +829 -0
- package/dist/commands/setup.d.ts +6 -0
- package/dist/commands/setup.js +658 -0
- package/dist/commands/status.d.ts +1 -0
- package/dist/commands/status.js +109 -0
- package/dist/commands/test.d.ts +1 -0
- package/dist/commands/test.js +157 -0
- package/dist/deploy/agents.d.ts +15 -0
- package/dist/deploy/agents.js +72 -0
- package/dist/deploy/hooks.d.ts +16 -0
- package/dist/deploy/hooks.js +121 -0
- package/dist/deploy/index.d.ts +7 -0
- package/dist/deploy/index.js +24 -0
- package/dist/deploy/instructions.d.ts +12 -0
- package/dist/deploy/instructions.js +36 -0
- package/dist/deploy/mcp.d.ts +19 -0
- package/dist/deploy/mcp.js +109 -0
- package/dist/deploy/plugins.d.ts +19 -0
- package/dist/deploy/plugins.js +62 -0
- package/dist/deploy/settings.d.ts +8 -0
- package/dist/deploy/settings.js +84 -0
- package/dist/deploy/skills.d.ts +19 -0
- package/dist/deploy/skills.js +60 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +71 -0
- package/dist/restore/RestoreOrchestrator.d.ts +48 -0
- package/dist/restore/RestoreOrchestrator.js +481 -0
- package/dist/restore/index.d.ts +4 -0
- package/dist/restore/index.js +20 -0
- package/dist/utils/platform.d.ts +29 -0
- package/dist/utils/platform.js +65 -0
- package/dist/utils/session-words.json +119 -0
- package/dist/utils/state.d.ts +57 -0
- package/dist/utils/state.js +186 -0
- package/dist/utils/templates.d.ts +24 -0
- package/dist/utils/templates.js +118 -0
- package/package.json +48 -0
- package/templates/CLAUDE.md +287 -0
- package/templates/README.md +378 -0
- 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/claude-plugins/PHASE2_COMPLETION.md +346 -0
- package/templates/claude-plugins/PLUGIN_PROPOSALS.md +1776 -0
- package/templates/claude-plugins/README.md +587 -0
- package/templates/claude-plugins/agents/code-reviewer.json +14 -0
- package/templates/claude-plugins/agents/debug-detective.json +15 -0
- package/templates/claude-plugins/agents/git-companion.json +14 -0
- package/templates/claude-plugins/blog-manager/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins/blog-manager/commands/blog.md +691 -0
- package/templates/claude-plugins/golden-loop-monitor/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins/golden-loop-monitor/commands/loop-status.md +434 -0
- package/templates/claude-plugins/learning-tracker/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins/learning-tracker/commands/my-patterns.md +282 -0
- package/templates/claude-plugins/memory-lens/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins/memory-lens/commands/memory-search.md +181 -0
- package/templates/claude-plugins/pattern-coach/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins/pattern-coach/commands/forge.md +365 -0
- package/templates/claude-plugins/project-schema-validator/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins/project-schema-validator/commands/validate-schema.md +582 -0
- package/templates/claude-plugins-admin/AGENT_TEAM_PROPOSALS.md +819 -0
- package/templates/claude-plugins-admin/README.md +446 -0
- package/templates/claude-plugins-admin/autonomous-admin-agent/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins-admin/autonomous-admin-agent/commands/agent.md +595 -0
- package/templates/claude-plugins-admin/backend-agent/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins-admin/backend-agent/commands/backend.md +798 -0
- package/templates/claude-plugins-admin/deploy-guardian/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins-admin/deploy-guardian/commands/deploy.md +554 -0
- package/templates/claude-plugins-admin/frontend-agent/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins-admin/frontend-agent/commands/frontend.md +881 -0
- package/templates/claude-plugins-admin/mcp-server-manager/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins-admin/mcp-server-manager/commands/mcp.md +85 -0
- package/templates/claude-plugins-admin/memory-system-monitor/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins-admin/memory-system-monitor/commands/memory-health.md +569 -0
- package/templates/claude-plugins-admin/qa-agent/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins-admin/qa-agent/commands/qa.md +863 -0
- package/templates/claude-plugins-admin/tech-lead-agent/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins-admin/tech-lead-agent/commands/lead.md +732 -0
- package/templates/commands/continue.md +47 -0
- package/templates/cursor-hooks/after-agent-response.sh +117 -0
- package/templates/cursor-hooks/before-submit-prompt.sh +419 -0
- package/templates/cursor-hooks/hooks.json +20 -0
- package/templates/cursor-hooks/lib/contract.sh +320 -0
- package/templates/cursor-hooks/stop.sh +75 -0
- package/templates/cursor-rules/ekkos-memory.md +187 -0
- package/templates/hooks/assistant-response.sh +96 -0
- package/templates/hooks/hooks.json +28 -0
- package/templates/hooks/lib/contract.sh +320 -0
- package/templates/hooks/lib/state.sh +158 -0
- package/templates/hooks/session-start.ps1 +41 -0
- package/templates/hooks/session-start.sh +318 -0
- package/templates/hooks/stop.ps1 +16 -0
- package/templates/hooks/stop.sh +989 -0
- package/templates/hooks/user-prompt-submit.ps1 +174 -0
- package/templates/hooks/user-prompt-submit.sh +587 -0
- package/templates/hooks-node/lib/state.js +187 -0
- package/templates/hooks-node/stop.js +416 -0
- package/templates/hooks-node/user-prompt-submit.js +337 -0
- package/templates/plan-template.md +306 -0
- package/templates/rules/00-hooks-contract.mdc +89 -0
- package/templates/rules/30-ekkos-core.mdc +188 -0
- package/templates/rules/31-ekkos-messages.mdc +78 -0
- package/templates/skills/continue/SKILL.md +169 -0
- package/templates/skills/ekkOS_Deep_Recall/Skill.md +282 -0
- package/templates/skills/ekkOS_Learn/Skill.md +265 -0
- package/templates/skills/ekkOS_Memory_First/Skill.md +206 -0
- package/templates/skills/ekkOS_Plan_Assist/Skill.md +302 -0
- package/templates/skills/ekkOS_Preferences/Skill.md +247 -0
- package/templates/skills/ekkOS_Reflect/Skill.md +257 -0
- package/templates/skills/ekkOS_Safety/Skill.md +265 -0
- package/templates/skills/ekkOS_Schema/Skill.md +251 -0
- package/templates/skills/ekkOS_Summary/Skill.md +257 -0
- package/templates/skills/ekkOS_Vault/Skill.md +287 -0
- package/templates/skills/permissions/Skill.md +322 -0
- package/templates/spec-template.md +159 -0
- package/templates/windsurf-hooks/before-submit-prompt.sh +238 -0
- package/templates/windsurf-hooks/hooks.json +10 -0
- package/templates/windsurf-hooks/lib/contract.sh +320 -0
- package/templates/windsurf-rules/ekkos-memory.md +129 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ekkOS Fast /continue - Local Session Store
|
|
3
|
+
*
|
|
4
|
+
* Tier 0 of the 3-tier restore chain.
|
|
5
|
+
* Provides ultra-low latency (<20ms) turn storage using append-only JSONL files.
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Atomic writes (write to .tmp, rename)
|
|
9
|
+
* - Crash recovery (handle partial JSONL lines)
|
|
10
|
+
* - ACK-based safe pruning
|
|
11
|
+
* - Multi-session support with LRU eviction
|
|
12
|
+
*/
|
|
13
|
+
import { Turn, SessionMeta, LocalCacheConfig, SessionListEntry, CacheResult } from './types.js';
|
|
14
|
+
/**
|
|
15
|
+
* LocalSessionStore - Fast local cache for conversation turns
|
|
16
|
+
*/
|
|
17
|
+
export declare class LocalSessionStore {
|
|
18
|
+
private config;
|
|
19
|
+
private sessionsDir;
|
|
20
|
+
private indexPath;
|
|
21
|
+
private indexCache;
|
|
22
|
+
private indexCacheTime;
|
|
23
|
+
private readonly INDEX_CACHE_TTL;
|
|
24
|
+
constructor(config?: Partial<LocalCacheConfig>);
|
|
25
|
+
/**
|
|
26
|
+
* Ensure cache directories exist
|
|
27
|
+
*/
|
|
28
|
+
private ensureDirectories;
|
|
29
|
+
/**
|
|
30
|
+
* Get the JSONL file path for a session
|
|
31
|
+
*/
|
|
32
|
+
private getTurnsPath;
|
|
33
|
+
/**
|
|
34
|
+
* Get the metadata file path for a session
|
|
35
|
+
*/
|
|
36
|
+
private getMetaPath;
|
|
37
|
+
/**
|
|
38
|
+
* Read the session index (with caching)
|
|
39
|
+
*/
|
|
40
|
+
private readIndex;
|
|
41
|
+
/**
|
|
42
|
+
* Write the session index atomically
|
|
43
|
+
*/
|
|
44
|
+
private writeIndex;
|
|
45
|
+
/**
|
|
46
|
+
* Update a single session in the index
|
|
47
|
+
*/
|
|
48
|
+
private updateIndexEntry;
|
|
49
|
+
/**
|
|
50
|
+
* Read session metadata
|
|
51
|
+
*/
|
|
52
|
+
getSessionMeta(sessionId: string): SessionMeta | null;
|
|
53
|
+
/**
|
|
54
|
+
* Write session metadata atomically
|
|
55
|
+
*/
|
|
56
|
+
private writeSessionMeta;
|
|
57
|
+
/**
|
|
58
|
+
* Append a turn to the session's JSONL file
|
|
59
|
+
* This is the hot path - must be fast
|
|
60
|
+
*/
|
|
61
|
+
appendTurn(sessionId: string, sessionName: string, turn: Turn, projectPath?: string): CacheResult<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Get the last N turns from a session
|
|
64
|
+
* Handles crash recovery (partial lines)
|
|
65
|
+
*/
|
|
66
|
+
getLastTurns(sessionId: string, n?: number): CacheResult<Turn[]>;
|
|
67
|
+
/**
|
|
68
|
+
* Get a specific turn by ID
|
|
69
|
+
*/
|
|
70
|
+
getTurn(sessionId: string, turnId: number): CacheResult<Turn>;
|
|
71
|
+
/**
|
|
72
|
+
* Update the assistant response for a pending turn
|
|
73
|
+
* (Called when Stop hook fires)
|
|
74
|
+
*/
|
|
75
|
+
updateTurnResponse(sessionId: string, turnId: number, response: string, toolsUsed?: string[], filesReferenced?: string[]): CacheResult<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Acknowledge that turns up to acked_turn_id have been flushed to Redis
|
|
78
|
+
*/
|
|
79
|
+
ack(sessionId: string, ackedTurnId: number): CacheResult<void>;
|
|
80
|
+
/**
|
|
81
|
+
* Acknowledge that turns up to ackedTurnId have been flushed to Supabase
|
|
82
|
+
* This is separate from Redis ACK - both must succeed before pruning
|
|
83
|
+
*/
|
|
84
|
+
ackSupabase(sessionId: string, ackedTurnId: number): CacheResult<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Prune turns that are safely ACKed to BOTH Redis AND Supabase
|
|
87
|
+
* Only removes turns where turn_id <= min(redis_ack, supabase_ack) - safety_margin
|
|
88
|
+
* This ensures data is persisted in both tiers before local pruning
|
|
89
|
+
*/
|
|
90
|
+
prune(sessionId: string): CacheResult<number>;
|
|
91
|
+
/**
|
|
92
|
+
* List all sessions, sorted by last active (newest first)
|
|
93
|
+
*/
|
|
94
|
+
listSessions(): SessionListEntry[];
|
|
95
|
+
/**
|
|
96
|
+
* Get session ID from session name
|
|
97
|
+
*/
|
|
98
|
+
getSessionId(sessionName: string): string | null;
|
|
99
|
+
/**
|
|
100
|
+
* Get session name from session ID
|
|
101
|
+
*/
|
|
102
|
+
getSessionName(sessionId: string): string | null;
|
|
103
|
+
/**
|
|
104
|
+
* Check if a session exists in local cache
|
|
105
|
+
*/
|
|
106
|
+
hasSession(sessionIdOrName: string): boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Delete a session from local cache
|
|
109
|
+
*/
|
|
110
|
+
deleteSession(sessionId: string): CacheResult<void>;
|
|
111
|
+
/**
|
|
112
|
+
* Evict oldest sessions to stay under max_sessions limit
|
|
113
|
+
* Only evicts sessions that are fully ACKed to Redis
|
|
114
|
+
*/
|
|
115
|
+
evictOldSessions(): number;
|
|
116
|
+
/**
|
|
117
|
+
* Get cache statistics
|
|
118
|
+
*/
|
|
119
|
+
getStats(): {
|
|
120
|
+
session_count: number;
|
|
121
|
+
total_turns: number;
|
|
122
|
+
cache_size_bytes: number;
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Clear all local cache (use with caution)
|
|
126
|
+
*/
|
|
127
|
+
clearAll(): void;
|
|
128
|
+
}
|
|
129
|
+
export declare const localCache: LocalSessionStore;
|