@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.
Files changed (135) hide show
  1. package/dist/cache/LocalSessionStore.d.ts +129 -0
  2. package/dist/cache/LocalSessionStore.js +688 -0
  3. package/dist/cache/capture.d.ts +26 -0
  4. package/dist/cache/capture.js +461 -0
  5. package/dist/cache/index.d.ts +7 -0
  6. package/dist/cache/index.js +23 -0
  7. package/dist/cache/types.d.ts +147 -0
  8. package/dist/cache/types.js +40 -0
  9. package/dist/commands/init.d.ts +9 -0
  10. package/dist/commands/init.js +478 -0
  11. package/dist/commands/run.d.ts +12 -0
  12. package/dist/commands/run.js +829 -0
  13. package/dist/commands/setup.d.ts +6 -0
  14. package/dist/commands/setup.js +658 -0
  15. package/dist/commands/status.d.ts +1 -0
  16. package/dist/commands/status.js +109 -0
  17. package/dist/commands/test.d.ts +1 -0
  18. package/dist/commands/test.js +157 -0
  19. package/dist/deploy/agents.d.ts +15 -0
  20. package/dist/deploy/agents.js +72 -0
  21. package/dist/deploy/hooks.d.ts +16 -0
  22. package/dist/deploy/hooks.js +121 -0
  23. package/dist/deploy/index.d.ts +7 -0
  24. package/dist/deploy/index.js +24 -0
  25. package/dist/deploy/instructions.d.ts +12 -0
  26. package/dist/deploy/instructions.js +36 -0
  27. package/dist/deploy/mcp.d.ts +19 -0
  28. package/dist/deploy/mcp.js +109 -0
  29. package/dist/deploy/plugins.d.ts +19 -0
  30. package/dist/deploy/plugins.js +62 -0
  31. package/dist/deploy/settings.d.ts +8 -0
  32. package/dist/deploy/settings.js +84 -0
  33. package/dist/deploy/skills.d.ts +19 -0
  34. package/dist/deploy/skills.js +60 -0
  35. package/dist/index.d.ts +2 -0
  36. package/dist/index.js +71 -0
  37. package/dist/restore/RestoreOrchestrator.d.ts +48 -0
  38. package/dist/restore/RestoreOrchestrator.js +481 -0
  39. package/dist/restore/index.d.ts +4 -0
  40. package/dist/restore/index.js +20 -0
  41. package/dist/utils/platform.d.ts +29 -0
  42. package/dist/utils/platform.js +65 -0
  43. package/dist/utils/session-words.json +119 -0
  44. package/dist/utils/state.d.ts +57 -0
  45. package/dist/utils/state.js +186 -0
  46. package/dist/utils/templates.d.ts +24 -0
  47. package/dist/utils/templates.js +118 -0
  48. package/package.json +48 -0
  49. package/templates/CLAUDE.md +287 -0
  50. package/templates/README.md +378 -0
  51. package/templates/agents/README.md +182 -0
  52. package/templates/agents/code-reviewer.md +166 -0
  53. package/templates/agents/debug-detective.md +169 -0
  54. package/templates/agents/ekkOS_Vercel.md +99 -0
  55. package/templates/agents/extension-manager.md +229 -0
  56. package/templates/agents/git-companion.md +185 -0
  57. package/templates/agents/github-test-agent.md +321 -0
  58. package/templates/agents/railway-manager.md +179 -0
  59. package/templates/claude-plugins/PHASE2_COMPLETION.md +346 -0
  60. package/templates/claude-plugins/PLUGIN_PROPOSALS.md +1776 -0
  61. package/templates/claude-plugins/README.md +587 -0
  62. package/templates/claude-plugins/agents/code-reviewer.json +14 -0
  63. package/templates/claude-plugins/agents/debug-detective.json +15 -0
  64. package/templates/claude-plugins/agents/git-companion.json +14 -0
  65. package/templates/claude-plugins/blog-manager/.claude-plugin/plugin.json +8 -0
  66. package/templates/claude-plugins/blog-manager/commands/blog.md +691 -0
  67. package/templates/claude-plugins/golden-loop-monitor/.claude-plugin/plugin.json +8 -0
  68. package/templates/claude-plugins/golden-loop-monitor/commands/loop-status.md +434 -0
  69. package/templates/claude-plugins/learning-tracker/.claude-plugin/plugin.json +8 -0
  70. package/templates/claude-plugins/learning-tracker/commands/my-patterns.md +282 -0
  71. package/templates/claude-plugins/memory-lens/.claude-plugin/plugin.json +8 -0
  72. package/templates/claude-plugins/memory-lens/commands/memory-search.md +181 -0
  73. package/templates/claude-plugins/pattern-coach/.claude-plugin/plugin.json +8 -0
  74. package/templates/claude-plugins/pattern-coach/commands/forge.md +365 -0
  75. package/templates/claude-plugins/project-schema-validator/.claude-plugin/plugin.json +8 -0
  76. package/templates/claude-plugins/project-schema-validator/commands/validate-schema.md +582 -0
  77. package/templates/claude-plugins-admin/AGENT_TEAM_PROPOSALS.md +819 -0
  78. package/templates/claude-plugins-admin/README.md +446 -0
  79. package/templates/claude-plugins-admin/autonomous-admin-agent/.claude-plugin/plugin.json +8 -0
  80. package/templates/claude-plugins-admin/autonomous-admin-agent/commands/agent.md +595 -0
  81. package/templates/claude-plugins-admin/backend-agent/.claude-plugin/plugin.json +8 -0
  82. package/templates/claude-plugins-admin/backend-agent/commands/backend.md +798 -0
  83. package/templates/claude-plugins-admin/deploy-guardian/.claude-plugin/plugin.json +8 -0
  84. package/templates/claude-plugins-admin/deploy-guardian/commands/deploy.md +554 -0
  85. package/templates/claude-plugins-admin/frontend-agent/.claude-plugin/plugin.json +8 -0
  86. package/templates/claude-plugins-admin/frontend-agent/commands/frontend.md +881 -0
  87. package/templates/claude-plugins-admin/mcp-server-manager/.claude-plugin/plugin.json +8 -0
  88. package/templates/claude-plugins-admin/mcp-server-manager/commands/mcp.md +85 -0
  89. package/templates/claude-plugins-admin/memory-system-monitor/.claude-plugin/plugin.json +8 -0
  90. package/templates/claude-plugins-admin/memory-system-monitor/commands/memory-health.md +569 -0
  91. package/templates/claude-plugins-admin/qa-agent/.claude-plugin/plugin.json +8 -0
  92. package/templates/claude-plugins-admin/qa-agent/commands/qa.md +863 -0
  93. package/templates/claude-plugins-admin/tech-lead-agent/.claude-plugin/plugin.json +8 -0
  94. package/templates/claude-plugins-admin/tech-lead-agent/commands/lead.md +732 -0
  95. package/templates/commands/continue.md +47 -0
  96. package/templates/cursor-hooks/after-agent-response.sh +117 -0
  97. package/templates/cursor-hooks/before-submit-prompt.sh +419 -0
  98. package/templates/cursor-hooks/hooks.json +20 -0
  99. package/templates/cursor-hooks/lib/contract.sh +320 -0
  100. package/templates/cursor-hooks/stop.sh +75 -0
  101. package/templates/cursor-rules/ekkos-memory.md +187 -0
  102. package/templates/hooks/assistant-response.sh +96 -0
  103. package/templates/hooks/hooks.json +28 -0
  104. package/templates/hooks/lib/contract.sh +320 -0
  105. package/templates/hooks/lib/state.sh +158 -0
  106. package/templates/hooks/session-start.ps1 +41 -0
  107. package/templates/hooks/session-start.sh +318 -0
  108. package/templates/hooks/stop.ps1 +16 -0
  109. package/templates/hooks/stop.sh +989 -0
  110. package/templates/hooks/user-prompt-submit.ps1 +174 -0
  111. package/templates/hooks/user-prompt-submit.sh +587 -0
  112. package/templates/hooks-node/lib/state.js +187 -0
  113. package/templates/hooks-node/stop.js +416 -0
  114. package/templates/hooks-node/user-prompt-submit.js +337 -0
  115. package/templates/plan-template.md +306 -0
  116. package/templates/rules/00-hooks-contract.mdc +89 -0
  117. package/templates/rules/30-ekkos-core.mdc +188 -0
  118. package/templates/rules/31-ekkos-messages.mdc +78 -0
  119. package/templates/skills/continue/SKILL.md +169 -0
  120. package/templates/skills/ekkOS_Deep_Recall/Skill.md +282 -0
  121. package/templates/skills/ekkOS_Learn/Skill.md +265 -0
  122. package/templates/skills/ekkOS_Memory_First/Skill.md +206 -0
  123. package/templates/skills/ekkOS_Plan_Assist/Skill.md +302 -0
  124. package/templates/skills/ekkOS_Preferences/Skill.md +247 -0
  125. package/templates/skills/ekkOS_Reflect/Skill.md +257 -0
  126. package/templates/skills/ekkOS_Safety/Skill.md +265 -0
  127. package/templates/skills/ekkOS_Schema/Skill.md +251 -0
  128. package/templates/skills/ekkOS_Summary/Skill.md +257 -0
  129. package/templates/skills/ekkOS_Vault/Skill.md +287 -0
  130. package/templates/skills/permissions/Skill.md +322 -0
  131. package/templates/spec-template.md +159 -0
  132. package/templates/windsurf-hooks/before-submit-prompt.sh +238 -0
  133. package/templates/windsurf-hooks/hooks.json +10 -0
  134. package/templates/windsurf-hooks/lib/contract.sh +320 -0
  135. 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;