k0ntext 3.0.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 (239) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +623 -0
  3. package/bin/k0ntext.js +12 -0
  4. package/dist/agents/cleanup-agent.d.ts +39 -0
  5. package/dist/agents/cleanup-agent.d.ts.map +1 -0
  6. package/dist/agents/cleanup-agent.js +56 -0
  7. package/dist/agents/cleanup-agent.js.map +1 -0
  8. package/dist/agents/performance-agent.d.ts +37 -0
  9. package/dist/agents/performance-agent.d.ts.map +1 -0
  10. package/dist/agents/performance-agent.js +91 -0
  11. package/dist/agents/performance-agent.js.map +1 -0
  12. package/dist/analyzer/index.d.ts +5 -0
  13. package/dist/analyzer/index.d.ts.map +1 -0
  14. package/dist/analyzer/index.js +5 -0
  15. package/dist/analyzer/index.js.map +1 -0
  16. package/dist/analyzer/intelligent-analyzer.d.ts +111 -0
  17. package/dist/analyzer/intelligent-analyzer.d.ts.map +1 -0
  18. package/dist/analyzer/intelligent-analyzer.js +537 -0
  19. package/dist/analyzer/intelligent-analyzer.js.map +1 -0
  20. package/dist/cli/commands/cleanup.d.ts +3 -0
  21. package/dist/cli/commands/cleanup.d.ts.map +1 -0
  22. package/dist/cli/commands/cleanup.js +24 -0
  23. package/dist/cli/commands/cleanup.js.map +1 -0
  24. package/dist/cli/commands/export.d.ts +9 -0
  25. package/dist/cli/commands/export.d.ts.map +1 -0
  26. package/dist/cli/commands/export.js +72 -0
  27. package/dist/cli/commands/export.js.map +1 -0
  28. package/dist/cli/commands/import.d.ts +9 -0
  29. package/dist/cli/commands/import.d.ts.map +1 -0
  30. package/dist/cli/commands/import.js +62 -0
  31. package/dist/cli/commands/import.js.map +1 -0
  32. package/dist/cli/commands/performance.d.ts +9 -0
  33. package/dist/cli/commands/performance.d.ts.map +1 -0
  34. package/dist/cli/commands/performance.js +36 -0
  35. package/dist/cli/commands/performance.js.map +1 -0
  36. package/dist/cli/commands/validate.d.ts +9 -0
  37. package/dist/cli/commands/validate.d.ts.map +1 -0
  38. package/dist/cli/commands/validate.js +82 -0
  39. package/dist/cli/commands/validate.js.map +1 -0
  40. package/dist/cli/commands/watch.d.ts +9 -0
  41. package/dist/cli/commands/watch.d.ts.map +1 -0
  42. package/dist/cli/commands/watch.js +72 -0
  43. package/dist/cli/commands/watch.js.map +1 -0
  44. package/dist/cli/generate.d.ts +3 -0
  45. package/dist/cli/generate.d.ts.map +1 -0
  46. package/dist/cli/generate.js +194 -0
  47. package/dist/cli/generate.js.map +1 -0
  48. package/dist/cli/index.d.ts +9 -0
  49. package/dist/cli/index.d.ts.map +1 -0
  50. package/dist/cli/index.js +448 -0
  51. package/dist/cli/index.js.map +1 -0
  52. package/dist/cli/sync.d.ts +26 -0
  53. package/dist/cli/sync.d.ts.map +1 -0
  54. package/dist/cli/sync.js +163 -0
  55. package/dist/cli/sync.js.map +1 -0
  56. package/dist/config/cleanup-config.d.ts +26 -0
  57. package/dist/config/cleanup-config.d.ts.map +1 -0
  58. package/dist/config/cleanup-config.js +21 -0
  59. package/dist/config/cleanup-config.js.map +1 -0
  60. package/dist/db/client.d.ts +284 -0
  61. package/dist/db/client.d.ts.map +1 -0
  62. package/dist/db/client.js +688 -0
  63. package/dist/db/client.js.map +1 -0
  64. package/dist/db/index.d.ts +6 -0
  65. package/dist/db/index.d.ts.map +1 -0
  66. package/dist/db/index.js +6 -0
  67. package/dist/db/index.js.map +1 -0
  68. package/dist/db/schema.d.ts +41 -0
  69. package/dist/db/schema.d.ts.map +1 -0
  70. package/dist/db/schema.js +226 -0
  71. package/dist/db/schema.js.map +1 -0
  72. package/dist/embeddings/index.d.ts +5 -0
  73. package/dist/embeddings/index.d.ts.map +1 -0
  74. package/dist/embeddings/index.js +5 -0
  75. package/dist/embeddings/index.js.map +1 -0
  76. package/dist/embeddings/openrouter.d.ts +133 -0
  77. package/dist/embeddings/openrouter.d.ts.map +1 -0
  78. package/dist/embeddings/openrouter.js +455 -0
  79. package/dist/embeddings/openrouter.js.map +1 -0
  80. package/dist/index.d.ts +14 -0
  81. package/dist/index.d.ts.map +1 -0
  82. package/dist/index.js +18 -0
  83. package/dist/index.js.map +1 -0
  84. package/dist/mcp.d.ts +29 -0
  85. package/dist/mcp.d.ts.map +1 -0
  86. package/dist/mcp.js +257 -0
  87. package/dist/mcp.js.map +1 -0
  88. package/docs/ARCHIVE/MIGRATE_TO_NEW_REPO.md +222 -0
  89. package/docs/ARCHIVE/MIGRATE_TO_UNIFIED.md +220 -0
  90. package/docs/CLEANUP.md +76 -0
  91. package/docs/MCP_QUICKSTART.md +219 -0
  92. package/docs/QUICKSTART.md +119 -0
  93. package/docs/TROUBLESHOOTING.md +611 -0
  94. package/package.json +100 -0
  95. package/skills/context-optimize/SKILL.md +86 -0
  96. package/skills/implement/SKILL.md +150 -0
  97. package/skills/plan/SKILL.md +143 -0
  98. package/skills/research/SKILL.md +103 -0
  99. package/skills/validate/SKILL.md +62 -0
  100. package/skills/verify-docs/SKILL.md +77 -0
  101. package/src/agents/cleanup-agent.ts +96 -0
  102. package/src/agents/performance-agent.ts +117 -0
  103. package/src/analyzer/index.ts +10 -0
  104. package/src/analyzer/intelligent-analyzer.ts +640 -0
  105. package/src/cli/commands/cleanup.ts +26 -0
  106. package/src/cli/commands/export.ts +82 -0
  107. package/src/cli/commands/import.ts +73 -0
  108. package/src/cli/commands/performance.ts +40 -0
  109. package/src/cli/commands/validate.ts +98 -0
  110. package/src/cli/commands/watch.ts +83 -0
  111. package/src/cli/generate.ts +219 -0
  112. package/src/cli/index.ts +510 -0
  113. package/src/cli/sync.ts +194 -0
  114. package/src/config/cleanup-config.ts +42 -0
  115. package/src/db/client.ts +949 -0
  116. package/src/db/index.ts +19 -0
  117. package/src/db/schema.ts +241 -0
  118. package/src/embeddings/index.ts +11 -0
  119. package/src/embeddings/openrouter.ts +592 -0
  120. package/src/index.ts +57 -0
  121. package/src/mcp.ts +354 -0
  122. package/templates/AI_CONTEXT.md.template +245 -0
  123. package/templates/base/README.md +260 -0
  124. package/templates/base/RPI_WORKFLOW_PLAN.md +325 -0
  125. package/templates/base/agents/api-developer.md +76 -0
  126. package/templates/base/agents/context-engineer.md +525 -0
  127. package/templates/base/agents/core-architect.md +76 -0
  128. package/templates/base/agents/database-ops.md +76 -0
  129. package/templates/base/agents/deployment-ops.md +76 -0
  130. package/templates/base/agents/integration-hub.md +76 -0
  131. package/templates/base/analytics/README.md +114 -0
  132. package/templates/base/automation/config.json +58 -0
  133. package/templates/base/automation/generators/code-mapper.js +308 -0
  134. package/templates/base/automation/generators/index-builder.js +321 -0
  135. package/templates/base/automation/hooks/post-commit.sh +83 -0
  136. package/templates/base/automation/hooks/pre-commit.sh +103 -0
  137. package/templates/base/ci-templates/README.md +108 -0
  138. package/templates/base/ci-templates/github-actions/context-check.yml +144 -0
  139. package/templates/base/ci-templates/github-actions/validate-docs.yml +105 -0
  140. package/templates/base/commands/analytics.md +238 -0
  141. package/templates/base/commands/auto-sync.md +172 -0
  142. package/templates/base/commands/collab.md +194 -0
  143. package/templates/base/commands/context-optimize.md +226 -0
  144. package/templates/base/commands/help.md +485 -0
  145. package/templates/base/commands/rpi-implement.md +164 -0
  146. package/templates/base/commands/rpi-plan.md +147 -0
  147. package/templates/base/commands/rpi-research.md +145 -0
  148. package/templates/base/commands/session-resume.md +144 -0
  149. package/templates/base/commands/session-save.md +112 -0
  150. package/templates/base/commands/validate-all.md +77 -0
  151. package/templates/base/commands/verify-docs-current.md +86 -0
  152. package/templates/base/config/base.json +57 -0
  153. package/templates/base/config/environments/development.json +13 -0
  154. package/templates/base/config/environments/production.json +17 -0
  155. package/templates/base/config/environments/staging.json +13 -0
  156. package/templates/base/config/local.json.example +21 -0
  157. package/templates/base/context/.meta/generated-at.json +18 -0
  158. package/templates/base/context/ARCHITECTURE_SNAPSHOT.md +156 -0
  159. package/templates/base/context/CODE_TO_WORKFLOW_MAP.md +94 -0
  160. package/templates/base/context/FILE_OWNERSHIP.md +57 -0
  161. package/templates/base/context/INTEGRATION_POINTS.md +92 -0
  162. package/templates/base/context/KNOWN_GOTCHAS.md +195 -0
  163. package/templates/base/context/TESTING_MAP.md +95 -0
  164. package/templates/base/context/WORKFLOW_INDEX.md +129 -0
  165. package/templates/base/context/workflows/WORKFLOW_TEMPLATE.md +294 -0
  166. package/templates/base/indexes/agents/CAPABILITY_MATRIX.md +255 -0
  167. package/templates/base/indexes/agents/CATEGORY_INDEX.md +44 -0
  168. package/templates/base/indexes/code/CATEGORY_INDEX.md +38 -0
  169. package/templates/base/indexes/routing/CATEGORY_INDEX.md +39 -0
  170. package/templates/base/indexes/search/CATEGORY_INDEX.md +39 -0
  171. package/templates/base/indexes/workflows/CATEGORY_INDEX.md +38 -0
  172. package/templates/base/knowledge/README.md +98 -0
  173. package/templates/base/knowledge/sessions/README.md +88 -0
  174. package/templates/base/knowledge/sessions/TEMPLATE.md +150 -0
  175. package/templates/base/knowledge/shared/decisions/0001-adopt-context-engineering.md +144 -0
  176. package/templates/base/knowledge/shared/decisions/README.md +49 -0
  177. package/templates/base/knowledge/shared/decisions/TEMPLATE.md +123 -0
  178. package/templates/base/knowledge/shared/patterns/README.md +62 -0
  179. package/templates/base/knowledge/shared/patterns/TEMPLATE.md +120 -0
  180. package/templates/base/plans/PLAN_TEMPLATE.md +316 -0
  181. package/templates/base/plans/active/.gitkeep +0 -0
  182. package/templates/base/plans/completed/.gitkeep +0 -0
  183. package/templates/base/research/RESEARCH_TEMPLATE.md +245 -0
  184. package/templates/base/research/active/.gitkeep +0 -0
  185. package/templates/base/research/completed/.gitkeep +0 -0
  186. package/templates/base/schemas/agent.schema.json +141 -0
  187. package/templates/base/schemas/anchors.schema.json +54 -0
  188. package/templates/base/schemas/automation.schema.json +93 -0
  189. package/templates/base/schemas/command.schema.json +134 -0
  190. package/templates/base/schemas/hashes.schema.json +40 -0
  191. package/templates/base/schemas/manifest.schema.json +117 -0
  192. package/templates/base/schemas/plan.schema.json +136 -0
  193. package/templates/base/schemas/research.schema.json +115 -0
  194. package/templates/base/schemas/roles.schema.json +34 -0
  195. package/templates/base/schemas/session.schema.json +77 -0
  196. package/templates/base/schemas/settings.schema.json +244 -0
  197. package/templates/base/schemas/staleness.schema.json +53 -0
  198. package/templates/base/schemas/team-config.schema.json +42 -0
  199. package/templates/base/schemas/workflow.schema.json +126 -0
  200. package/templates/base/session/checkpoints/.gitkeep +2 -0
  201. package/templates/base/session/current/state.json +20 -0
  202. package/templates/base/session/history/.gitkeep +2 -0
  203. package/templates/base/settings.json +3 -0
  204. package/templates/base/standards/COMPATIBILITY.md +219 -0
  205. package/templates/base/standards/EXTENSION_GUIDELINES.md +280 -0
  206. package/templates/base/standards/QUALITY_CHECKLIST.md +211 -0
  207. package/templates/base/standards/README.md +66 -0
  208. package/templates/base/sync/anchors.json +6 -0
  209. package/templates/base/sync/hashes.json +6 -0
  210. package/templates/base/sync/staleness.json +10 -0
  211. package/templates/base/team/README.md +168 -0
  212. package/templates/base/team/config.json +79 -0
  213. package/templates/base/team/roles.json +145 -0
  214. package/templates/base/tools/bin/claude-context.js +151 -0
  215. package/templates/base/tools/lib/anchor-resolver.js +276 -0
  216. package/templates/base/tools/lib/config-loader.js +363 -0
  217. package/templates/base/tools/lib/detector.js +350 -0
  218. package/templates/base/tools/lib/diagnose.js +206 -0
  219. package/templates/base/tools/lib/drift-detector.js +373 -0
  220. package/templates/base/tools/lib/errors.js +199 -0
  221. package/templates/base/tools/lib/index.js +36 -0
  222. package/templates/base/tools/lib/init.js +192 -0
  223. package/templates/base/tools/lib/logger.js +230 -0
  224. package/templates/base/tools/lib/placeholder.js +201 -0
  225. package/templates/base/tools/lib/session-manager.js +354 -0
  226. package/templates/base/tools/lib/validate.js +521 -0
  227. package/templates/base/tools/package.json +49 -0
  228. package/templates/handlebars/aider-config.hbs +146 -0
  229. package/templates/handlebars/antigravity.hbs +377 -0
  230. package/templates/handlebars/claude.hbs +183 -0
  231. package/templates/handlebars/cline.hbs +62 -0
  232. package/templates/handlebars/continue-config.hbs +116 -0
  233. package/templates/handlebars/copilot.hbs +130 -0
  234. package/templates/handlebars/partials/gotcha-list.hbs +11 -0
  235. package/templates/handlebars/partials/header.hbs +3 -0
  236. package/templates/handlebars/partials/workflow-summary.hbs +16 -0
  237. package/templates/handlebars/windsurf-rules.hbs +69 -0
  238. package/templates/hooks/post-commit.hbs +28 -0
  239. package/templates/hooks/pre-commit.hbs +46 -0
package/dist/mcp.js ADDED
@@ -0,0 +1,257 @@
1
+ /**
2
+ * MCP Server
3
+ *
4
+ * Model Context Protocol server for AI context.
5
+ * Provides tools, resources, and prompts for AI coding assistants.
6
+ */
7
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
8
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
9
+ import { z } from 'zod';
10
+ import { DatabaseClient } from './db/client.js';
11
+ import { createOpenRouterClient, hasOpenRouterKey } from './embeddings/openrouter.js';
12
+ import { createIntelligentAnalyzer } from './analyzer/intelligent-analyzer.js';
13
+ /**
14
+ * Create and start the MCP server
15
+ */
16
+ export async function createServer(config) {
17
+ const { projectRoot, dbPath = '.ai-context.db', name = 'k0ntext', version = '1.0.0' } = config;
18
+ // Initialize database
19
+ const db = new DatabaseClient(projectRoot, dbPath);
20
+ // Initialize OpenRouter client (optional)
21
+ let openrouter = null;
22
+ if (hasOpenRouterKey()) {
23
+ try {
24
+ openrouter = createOpenRouterClient();
25
+ }
26
+ catch (error) {
27
+ console.error('Warning: OpenRouter unavailable:', error);
28
+ }
29
+ }
30
+ // Create context for handlers
31
+ const ctx = { db, openrouter, projectRoot };
32
+ // Create MCP server
33
+ const server = new McpServer({ name, version }, {
34
+ capabilities: {
35
+ tools: {},
36
+ resources: {},
37
+ prompts: {}
38
+ }
39
+ });
40
+ // ==================== Register Tools ====================
41
+ // search_context - Semantic search across indexed content
42
+ server.registerTool('search_context', {
43
+ description: 'Semantic search across all indexed content (workflows, agents, code, commits, docs)',
44
+ inputSchema: {
45
+ query: z.string().describe('Natural language search query'),
46
+ type: z.enum(['workflow', 'agent', 'command', 'code', 'commit', 'knowledge', 'config', 'doc', 'tool_config']).optional().describe('Filter by content type'),
47
+ limit: z.number().optional().describe('Maximum results (default: 10)')
48
+ }
49
+ }, async (args) => {
50
+ const { query, type, limit = 10 } = args;
51
+ // Text search (semantic search requires embeddings)
52
+ const results = ctx.db.searchText(query, type);
53
+ return {
54
+ content: [{
55
+ type: 'text',
56
+ text: JSON.stringify(results.slice(0, limit), null, 2)
57
+ }]
58
+ };
59
+ });
60
+ // get_item - Get a specific context item
61
+ server.registerTool('get_item', {
62
+ description: 'Get a specific context item by ID or path',
63
+ inputSchema: {
64
+ id: z.string().optional().describe('Context item ID'),
65
+ path: z.string().optional().describe('File path to look up')
66
+ }
67
+ }, async (args) => {
68
+ const { id, path: filePath } = args;
69
+ let item = null;
70
+ if (id) {
71
+ item = ctx.db.getItem(id);
72
+ }
73
+ else if (filePath) {
74
+ const items = ctx.db.getAllItems().filter(i => i.filePath === filePath);
75
+ item = items[0] || null;
76
+ }
77
+ return {
78
+ content: [{
79
+ type: 'text',
80
+ text: item ? JSON.stringify(item, null, 2) : 'Item not found'
81
+ }]
82
+ };
83
+ });
84
+ // add_knowledge - Store new knowledge
85
+ server.registerTool('add_knowledge', {
86
+ description: 'Store a new insight or fact about the codebase',
87
+ inputSchema: {
88
+ name: z.string().describe('Short name for the knowledge item'),
89
+ content: z.string().describe('The knowledge content'),
90
+ relatedTo: z.array(z.string()).optional().describe('IDs of related items')
91
+ }
92
+ }, async (args) => {
93
+ const { name, content, relatedTo } = args;
94
+ const item = ctx.db.upsertItem({
95
+ type: 'knowledge',
96
+ name,
97
+ content,
98
+ metadata: { relatedTo }
99
+ });
100
+ // Add relations if specified
101
+ if (relatedTo) {
102
+ for (const targetId of relatedTo) {
103
+ ctx.db.addRelation({
104
+ sourceId: item.id,
105
+ targetId,
106
+ relationType: 'references'
107
+ });
108
+ }
109
+ }
110
+ return {
111
+ content: [{
112
+ type: 'text',
113
+ text: `Knowledge item created: ${item.id}`
114
+ }]
115
+ };
116
+ });
117
+ // analyze - Run intelligent analysis
118
+ server.registerTool('analyze', {
119
+ description: 'Run intelligent analysis on the codebase using OpenRouter',
120
+ inputSchema: {
121
+ type: z.enum(['full', 'docs', 'code', 'tools']).optional().describe('Analysis type')
122
+ }
123
+ }, async (_args) => {
124
+ const analyzer = createIntelligentAnalyzer(ctx.projectRoot);
125
+ const analysis = await analyzer.analyze();
126
+ return {
127
+ content: [{
128
+ type: 'text',
129
+ text: JSON.stringify(analysis, null, 2)
130
+ }]
131
+ };
132
+ });
133
+ // get_tool_configs - Get AI tool configurations
134
+ server.registerTool('get_tool_configs', {
135
+ description: 'Get configurations for AI tools (Claude, Copilot, Cline, etc.)',
136
+ inputSchema: {
137
+ tool: z.enum(['claude', 'copilot', 'cline', 'antigravity', 'windsurf', 'aider', 'continue', 'cursor', 'gemini']).optional().describe('Specific tool to get configs for')
138
+ }
139
+ }, async (args) => {
140
+ const { tool } = args;
141
+ const configs = tool
142
+ ? ctx.db.getToolConfigs(tool)
143
+ : ctx.db.getAllToolConfigs();
144
+ return {
145
+ content: [{
146
+ type: 'text',
147
+ text: JSON.stringify(configs, null, 2)
148
+ }]
149
+ };
150
+ });
151
+ // query_graph - Traverse knowledge graph
152
+ server.registerTool('query_graph', {
153
+ description: 'Traverse the knowledge graph from a starting point',
154
+ inputSchema: {
155
+ startId: z.string().describe('Starting context item ID'),
156
+ direction: z.enum(['outgoing', 'incoming', 'both']).optional().describe('Traversal direction'),
157
+ maxDepth: z.number().optional().describe('Maximum depth (default: 3)')
158
+ }
159
+ }, async (args) => {
160
+ const { startId, maxDepth = 3 } = args;
161
+ const results = ctx.db.traverseGraph(startId, maxDepth);
162
+ return {
163
+ content: [{
164
+ type: 'text',
165
+ text: JSON.stringify(Array.from(results.entries()), null, 2)
166
+ }]
167
+ };
168
+ });
169
+ // get_stats - Database statistics
170
+ server.registerTool('get_stats', {
171
+ description: 'Get database and indexing statistics',
172
+ inputSchema: {}
173
+ }, async () => {
174
+ const stats = ctx.db.getStats();
175
+ return {
176
+ content: [{
177
+ type: 'text',
178
+ text: JSON.stringify(stats, null, 2)
179
+ }]
180
+ };
181
+ });
182
+ // ==================== Register Prompts ====================
183
+ // context-engineer prompt
184
+ server.registerPrompt('context-engineer', {
185
+ description: 'Initialize and configure the AI context system',
186
+ argsSchema: {
187
+ projectType: z.string().optional().describe('Type of project')
188
+ }
189
+ }, () => {
190
+ return {
191
+ messages: [{
192
+ role: 'user',
193
+ content: {
194
+ type: 'text',
195
+ text: `You are a Context Engineer specializing in setting up AI context systems.
196
+
197
+ Your goal is to analyze the current codebase and set up optimal AI context configuration.
198
+
199
+ Available tools:
200
+ - search_context: Search indexed content
201
+ - get_item: Get specific items
202
+ - add_knowledge: Store new insights
203
+ - analyze: Run intelligent analysis
204
+ - get_tool_configs: View AI tool configurations
205
+ - get_stats: View database statistics
206
+
207
+ Start by running 'analyze' to understand the codebase, then use 'add_knowledge' to capture important insights.`
208
+ }
209
+ }]
210
+ };
211
+ });
212
+ // core-architect prompt
213
+ server.registerPrompt('core-architect', {
214
+ description: 'Design system architecture',
215
+ argsSchema: {
216
+ focus: z.string().optional().describe('Area to focus on')
217
+ }
218
+ }, (args) => {
219
+ const { focus } = args;
220
+ return {
221
+ messages: [{
222
+ role: 'user',
223
+ content: {
224
+ type: 'text',
225
+ text: `You are a Core Architect designing system architecture.
226
+ ${focus ? `Focus area: ${focus}` : ''}
227
+
228
+ Use the context tools to understand the existing architecture and propose improvements.`
229
+ }
230
+ }]
231
+ };
232
+ });
233
+ return server;
234
+ }
235
+ /**
236
+ * Start the server with stdio transport
237
+ */
238
+ export async function startServer(config) {
239
+ const server = await createServer(config);
240
+ const transport = new StdioServerTransport();
241
+ await server.connect(transport);
242
+ console.error(`K0NTEXT MCP Server started`);
243
+ console.error(`Project root: ${config.projectRoot}`);
244
+ console.error(`Database: ${config.dbPath || '.ai-context.db'}`);
245
+ }
246
+ /**
247
+ * Main entry point
248
+ */
249
+ export async function main() {
250
+ const projectRoot = process.env.K0NTEXT_PROJECT_ROOT || process.cwd();
251
+ const dbPath = process.env.K0NTEXT_DB_PATH;
252
+ await startServer({
253
+ projectRoot,
254
+ dbPath
255
+ });
256
+ }
257
+ //# sourceMappingURL=mcp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.js","sourceRoot":"","sources":["../src/mcp.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAoB,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACxG,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAqB/E;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,MAAoB;IACrD,MAAM,EACJ,WAAW,EACX,MAAM,GAAG,gBAAgB,EACzB,IAAI,GAAG,SAAS,EAChB,OAAO,GAAG,OAAO,EAClB,GAAG,MAAM,CAAC;IAEX,sBAAsB;IACtB,MAAM,EAAE,GAAG,IAAI,cAAc,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAEnD,0CAA0C;IAC1C,IAAI,UAAU,GAA4B,IAAI,CAAC;IAC/C,IAAI,gBAAgB,EAAE,EAAE,CAAC;QACvB,IAAI,CAAC;YACH,UAAU,GAAG,sBAAsB,EAAE,CAAC;QACxC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,KAAK,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;IAED,8BAA8B;IAC9B,MAAM,GAAG,GAAgB,EAAE,EAAE,EA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AAgB,EAAE,CAAC,CAAC;AAClE,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI;IACxB,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IACtE,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;IAE3C,MAAM,WAAW,CAAC;QAChB,WAAW;QACX,MAAM;KACP,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,222 @@
1
+ # Migrating to the New AI Context Repository
2
+
3
+ This guide helps you migrate from the old `claude-context-engineering-template` repository to the new `ai-context` repository.
4
+
5
+ ## For Users
6
+
7
+ ### Update Your Installation
8
+
9
+ ```bash
10
+ # Uninstall old package
11
+ npm uninstall -g create-universal-ai-context
12
+
13
+ # Install new package
14
+ npm install -g ai-context
15
+
16
+ # Verify installation
17
+ ai-context --help
18
+ ```
19
+
20
+ ### Update Your Projects
21
+
22
+ If you have the old package installed in a project:
23
+
24
+ ```bash
25
+ # Remove old package
26
+ npm uninstall create-universal-ai-context
27
+
28
+ # Install new package
29
+ npm install ai-context
30
+
31
+ # Re-initialize (your context will be preserved)
32
+ ai-context init
33
+ ```
34
+
35
+ ### What Changed?
36
+
37
+ | Old | New |
38
+ |-----|-----|
39
+ | Repository | `claude-context-engineering-template` | `ai-context` |
40
+ | Package | `create-universal-ai-context` | `ai-context` |
41
+ | Command | `create-ai-context` | `ai-context` |
42
+ | Structure | Monorepo (4 packages) | Single package |
43
+
44
+ ### Features
45
+
46
+ The new `ai-context` package includes all features from the previous packages:
47
+
48
+ - ✅ Intelligent codebase analysis (OpenRouter-powered)
49
+ - ✅ Semantic search with vector embeddings
50
+ - ✅ MCP server (10 tools + 6 prompts)
51
+ - ✅ Cross-tool synchronization (9 AI tools)
52
+ - ✅ Complete CLI (7 commands)
53
+
54
+ ## For Contributors
55
+
56
+ ### Update Your Local Repository
57
+
58
+ If you have a fork or clone of the old repository:
59
+
60
+ ```bash
61
+ # 1. Note your current branch
62
+ git branch --show-current
63
+
64
+ # 2. Add new remote
65
+ git remote add new-origin https://github.com/SireJeff/ai-context
66
+
67
+ # 3. Fetch from new repository
68
+ git fetch new-origin
69
+
70
+ # 4. Switch to tracking new repository
71
+ git branch --set-upstream-to=new-origin/main main
72
+
73
+ # 5. Remove old remote
74
+ git remote remove origin
75
+ git remote rename new-origin origin
76
+ ```
77
+
78
+ ### Update Your Fork
79
+
80
+ If you have a forked repository:
81
+
82
+ 1. Visit https://github.com/SireJeff/ai-context
83
+ 2. Click "Fork" to create a new fork
84
+ 3. Update your local remote to point to your new fork
85
+ 4. Delete your old fork from GitHub
86
+
87
+ ### Update CI/CD
88
+
89
+ Update any GitHub Actions or CI/CD pipelines:
90
+
91
+ ```yaml
92
+ # Old
93
+ - uses: actions/checkout@v3
94
+ with:
95
+ repository: SireJeff/claude-context-engineering-template
96
+
97
+ # New
98
+ - uses: actions/checkout@v3
99
+ with:
100
+ repository: SireJeff/ai-context
101
+ ```
102
+
103
+ ### Update npm Scripts
104
+
105
+ If you reference the package in npm scripts:
106
+
107
+ ```json
108
+ {
109
+ "scripts": {
110
+ "old": "create-ai-context generate",
111
+ "new": "ai-context generate"
112
+ }
113
+ }
114
+ ```
115
+
116
+ ## For Developers Using the MCP Server
117
+
118
+ ### Update Claude Desktop Config
119
+
120
+ Edit your `claude_desktop_config.json`:
121
+
122
+ ```json
123
+ {
124
+ "mcpServers": {
125
+ "ai-context": {
126
+ "command": "npx",
127
+ "args": ["-y", "ai-context", "mcp"],
128
+ "cwd": "/path/to/your/project"
129
+ }
130
+ }
131
+ }
132
+ ```
133
+
134
+ The MCP server is now built into `ai-context` — no separate package needed.
135
+
136
+ ## Legacy Packages Reference
137
+
138
+ ### create-universal-ai-context → ai-context
139
+
140
+ All functionality has been preserved:
141
+
142
+ ```bash
143
+ # Old command
144
+ create-ai-context init
145
+ create-ai-context generate
146
+ create-ai-context sync:all
147
+
148
+ # New command
149
+ ai-context init
150
+ ai-context generate
151
+ ai-context sync
152
+ ```
153
+
154
+ ### @ai-context/mcp-server → Built-in
155
+
156
+ The MCP server is now part of `ai-context`:
157
+
158
+ ```bash
159
+ # Old
160
+ npx @ai-context/mcp-server
161
+
162
+ # New
163
+ ai-context mcp
164
+ ```
165
+
166
+ ### claude-context-plugin → Skills
167
+
168
+ Plugin functionality is now available as RPI workflow skills in `ai-context`:
169
+
170
+ - `.claude/skills/` contains skill definitions
171
+ - Use with `/skill-name` commands in Claude Code
172
+
173
+ ## Data Migration
174
+
175
+ ### Database Compatibility
176
+
177
+ Your existing `.ai-context.db` is **fully compatible** with the new package. No migration needed!
178
+
179
+ ### Context Files
180
+
181
+ Existing context files (`.ai-context/`, `.clinerules`, etc.) will be updated when you run:
182
+ ```bash
183
+ ai-context generate
184
+ ```
185
+
186
+ ## Breaking Changes
187
+
188
+ There are **no breaking changes** to the core functionality. The consolidation was designed to be a drop-in replacement.
189
+
190
+ ### Minor Differences
191
+
192
+ 1. **Command name:** `create-ai-context` → `ai-context`
193
+ 2. **Package name:** `create-universal-ai-context` → `ai-context`
194
+ 3. **Repository:** Monorepo → Single package
195
+
196
+ ## Rollback
197
+
198
+ If you need to rollback to the old package:
199
+
200
+ ```bash
201
+ npm uninstall ai-context
202
+ npm install -g create-universal-ai-context@2.5.0
203
+ ```
204
+
205
+ However, we strongly recommend using the new package as the old one is deprecated.
206
+
207
+ ## Support
208
+
209
+ - **New Repository:** https://github.com/SireJeff/ai-context
210
+ - **Issues:** https://github.com/SireJeff/ai-context/issues
211
+ - **Discussions:** https://github.com/SireJeff/ai-context/discussions
212
+ - **Documentation:** https://github.com/SireJeff/ai-context#readme
213
+
214
+ ## Timeline
215
+
216
+ - **2026-02-05:** New repository launched
217
+ - **2026-03-01:** Old repository archived
218
+ - **2026-06-01:** Legacy packages deprecated on npm
219
+
220
+ ---
221
+
222
+ **Questions?** Please open an issue on the new repository: https://github.com/SireJeff/ai-context/issues
@@ -0,0 +1,220 @@
1
+ # Migration Guide: Legacy Packages → Unified `ai-context`
2
+
3
+ **Version:** 3.0.0
4
+ **Date:** February 5, 2026
5
+
6
+ ---
7
+
8
+ ## Overview
9
+
10
+ The AI Context Engineering project has consolidated three separate packages into one unified `ai-context` package. This guide helps you migrate from the legacy packages.
11
+
12
+ ## What Changed?
13
+
14
+ | Legacy Package | New Home | Status |
15
+ |---------------|----------|--------|
16
+ | `create-universal-ai-context` | `ai-context` | ⚠️ Deprecated |
17
+ | `@ai-context/mcp-server` | `ai-context` (included) | ⚠️ Deprecated |
18
+ | `claude-context-plugin` | `ai-context` skills | ⚠️ Deprecated |
19
+
20
+ ---
21
+
22
+ ## Migration Paths
23
+
24
+ ### From `create-universal-ai-context`
25
+
26
+ **Old Commands:**
27
+ ```bash
28
+ npx create-universal-ai-context init
29
+ npx create-universal-ai-context generate
30
+ ```
31
+
32
+ **New Commands:**
33
+ ```bash
34
+ # Install the unified package
35
+ npm install -g ai-context
36
+
37
+ # Initialize (same functionality)
38
+ ai-context init
39
+
40
+ # Generate context (same functionality)
41
+ ai-context generate
42
+ ```
43
+
44
+ ### From `@ai-context/mcp-server`
45
+
46
+ **Old Commands:**
47
+ ```bash
48
+ npx create-ai-context mcp:start
49
+ npx create-ai-context mcp:init
50
+ npx create-ai-context mcp:status
51
+ ```
52
+
53
+ **New Commands:**
54
+ ```bash
55
+ # The MCP server is now included in ai-context
56
+ ai-context mcp
57
+
58
+ # All MCP functionality is now built-in
59
+ ai-context stats # Equivalent to mcp:status
60
+ ```
61
+
62
+ ### From `claude-context-plugin`
63
+
64
+ **Old Commands:**
65
+ ```bash
66
+ /context-optimize
67
+ /rpi-research
68
+ /rpi-plan
69
+ /rpi-implement
70
+ ```
71
+
72
+ **New Usage:**
73
+ ```bash
74
+ # Commands are now part of ai-context
75
+ # The same commands work - they're now in the unified package
76
+ ```
77
+
78
+ ---
79
+
80
+ ## Step-by-Step Migration
81
+
82
+ ### 1. Uninstall Legacy Packages
83
+
84
+ ```bash
85
+ # Remove legacy packages
86
+ npm uninstall -g create-universal-ai-context
87
+
88
+ # Note: @ai-context/mcp-server and claude-context-plugin
89
+ # were typically not installed globally, but if you did:
90
+ npm uninstall -g @ai-context/mcp-server
91
+ npm uninstall -g claude-context-plugin
92
+ ```
93
+
94
+ ### 2. Install Unified Package
95
+
96
+ ```bash
97
+ npm install -g ai-context
98
+ ```
99
+
100
+ ### 3. Update Configuration Files
101
+
102
+ **Claude Desktop Config:**
103
+ ```json
104
+ {
105
+ "mcpServers": {
106
+ "ai-context": {
107
+ "command": "node",
108
+ "args": ["C:\\Users\\YourName\\AppData\\Roaming\\npm\\node_modules\\ai-context\\dist\\mcp.js"],
109
+ "env": {
110
+ "OPENROUTER_API_KEY": "your-api-key"
111
+ }
112
+ }
113
+ }
114
+ }
115
+ ```
116
+
117
+ ### 4. Migrate Existing Context
118
+
119
+ ```bash
120
+ # In your project directory
121
+ ai-context init
122
+
123
+ # Your existing context will be preserved and migrated
124
+ # to the new database format
125
+ ```
126
+
127
+ ### 5. Verify Migration
128
+
129
+ ```bash
130
+ # Check status
131
+ ai-context stats
132
+
133
+ # Test commands
134
+ ai-context generate
135
+ ai-context sync
136
+
137
+ # Test MCP server
138
+ ai-context mcp
139
+ ```
140
+
141
+ ---
142
+
143
+ ## Feature Mapping
144
+
145
+ | Legacy Feature | New Location | Notes |
146
+ |----------------|--------------|-------|
147
+ | `create-ai-context init` | `ai-context init` | Same functionality |
148
+ | `create-ai-context generate` | `ai-context generate` | Same functionality |
149
+ | `create-ai-context sync:*` | `ai-context sync` | Same functionality |
150
+ | `create-ai-context status` | `ai-context stats` | Same functionality |
151
+ | `mcp-server start` | `ai-context mcp` | Included in unified package |
152
+ | `mcp-server init` | Included in `ai-context init` | Automatic |
153
+ | Plugin skills | `ai-context` skills | Built-in commands |
154
+ | Plugin commands | `ai-context` commands | Built-in commands |
155
+
156
+ ---
157
+
158
+ ## Breaking Changes
159
+
160
+ ### 1. Package Name
161
+
162
+ **Old:** `create-universal-ai-context`
163
+ **New:** `ai-context`
164
+
165
+ ### 2. Command Prefix
166
+
167
+ **Old:** `create-ai-context`
168
+ **New:** `ai-context`
169
+
170
+ ### 3. MCP Server
171
+
172
+ **Old:** Separate package `@ai-context/mcp-server`
173
+ **New:** Included in `ai-context`
174
+
175
+ ### 4. Plugin
176
+
177
+ **Old:** Claude Code plugin
178
+ **New:** Built-in commands and skills
179
+
180
+ ---
181
+
182
+ ## Rollback
183
+
184
+ If you need to rollback:
185
+
186
+ ```bash
187
+ # Uninstall new package
188
+ npm uninstall -g ai-context
189
+
190
+ # Reinstall legacy packages
191
+ npm install -g create-universal-ai-context@2.5.0
192
+ ```
193
+
194
+ ---
195
+
196
+ ## Support
197
+
198
+ - **Legacy Support:** Security updates until 2026-06-01
199
+ - **Migration Issues:** [GitHub Issues](https://github.com/SireJeff/claude-context-engineering-template/issues)
200
+ - **Documentation:** [README](../README.md)
201
+
202
+ ---
203
+
204
+ ## FAQ
205
+
206
+ **Q: Do I need to migrate immediately?**
207
+ A: No, legacy packages will receive security updates until 2026-06-01.
208
+
209
+ **Q: Will my existing configurations work?**
210
+ A: Yes, most configurations are compatible. See the feature mapping table above.
211
+
212
+ **Q: What happens to my existing context files?**
213
+ A: They will be automatically migrated when you run `ai-context init`.
214
+
215
+ **Q: Is the unified package backward compatible?**
216
+ A: Yes, it supports all legacy workflows and configurations.
217
+
218
+ ---
219
+
220
+ **Need Help?** Open an issue or join our community discussions.