@datacore-one/mcp 1.1.1 → 1.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/index.js CHANGED
@@ -68,7 +68,7 @@ function initCore(basePath) {
68
68
  }
69
69
  const configPath = path.join(basePath, "config.yaml");
70
70
  if (!fs.existsSync(configPath)) {
71
- fs.writeFileSync(configPath, "# Datacore MCP configuration\nversion: 2\n# engrams:\n# auto_promote: false\n# packs:\n# trusted_publishers: []\n# search:\n# max_results: 20\n# snippet_length: 500\n# hints:\n# enabled: true\n");
71
+ fs.writeFileSync(configPath, "# Datacore MCP configuration\nversion: 2\n# engrams:\n# auto_promote: true # engrams are active immediately (set false for manual review)\n# packs:\n# trusted_publishers: []\n# search:\n# max_results: 20\n# snippet_length: 500\n# hints:\n# enabled: true\n");
72
72
  }
73
73
  generateContextFiles(basePath);
74
74
  copyStarterPacks(basePath);
@@ -90,7 +90,15 @@ function generateContextFiles(basePath) {
90
90
  }
91
91
  }
92
92
  var DATACORE_GUIDE = `Datacore gives AI assistants persistent memory through **engrams** \u2014 typed knowledge units
93
- that get injected into context when relevant.
93
+ that get injected into context when relevant. Use it proactively in every conversation.
94
+
95
+ ## Proactive Behavior
96
+
97
+ Use Datacore tools automatically \u2014 do not wait to be asked:
98
+ - **session.start**: Call at the beginning of every conversation
99
+ - **learn**: Call when you discover patterns, preferences, insights, or corrections
100
+ - **feedback**: Call after engrams are injected to rate usefulness
101
+ - **session.end**: Call before the conversation ends
94
102
 
95
103
  ## Session Workflow
96
104
 
@@ -105,8 +113,7 @@ that get injected into context when relevant.
105
113
  |------|---------|
106
114
  | session.start | Start here. Begin session with context injection. |
107
115
  | session.end | End session, capture journal + new engrams. |
108
- | learn | Record a reusable insight (creates candidate engram). |
109
- | promote | Activate candidate engrams. |
116
+ | learn | Record a reusable pattern, preference, or insight. |
110
117
  | inject | Get relevant engrams for a specific task. |
111
118
  | recall | Search all sources (engrams + journal + knowledge). |
112
119
  | capture | Write a journal entry or knowledge note. |
@@ -121,13 +128,11 @@ that get injected into context when relevant.
121
128
 
122
129
  ## Engram Lifecycle
123
130
 
124
- learn \u2192 candidate \u2192 promote \u2192 active \u2192 inject \u2192 feedback \u2192 stronger/weaker \u2192 forget (retire)
131
+ learn \u2192 active \u2192 inject \u2192 feedback \u2192 stronger/weaker \u2192 forget (retire)
125
132
 
126
- - **candidate**: Created but not yet active. Won't appear in inject results.
127
133
  - **active**: Appears in inject results when relevant to the task.
128
134
  - **retired**: Permanently removed from injection.
129
-
130
- Positive feedback strengthens retrieval. Unused engrams naturally decay over time.
135
+ - Positive feedback strengthens retrieval. Unused engrams naturally decay over time.
131
136
 
132
137
  ## Data Storage
133
138
 
@@ -202,7 +207,7 @@ import { z } from "zod";
202
207
  var ConfigSchema = z.object({
203
208
  version: z.number().default(2),
204
209
  engrams: z.object({
205
- auto_promote: z.boolean().default(false)
210
+ auto_promote: z.boolean().default(true)
206
211
  }).default({}),
207
212
  packs: z.object({
208
213
  trusted_publishers: z.array(z.string()).default([])
@@ -237,7 +242,7 @@ function getConfig() {
237
242
  // package.json
238
243
  var package_default = {
239
244
  name: "@datacore-one/mcp",
240
- version: "1.1.1",
245
+ version: "1.2.0",
241
246
  description: "Datacore MCP server \u2014 The Software of You",
242
247
  type: "module",
243
248
  bin: {
@@ -307,7 +312,7 @@ import { z as z2 } from "zod";
307
312
  var TOOLS = [
308
313
  {
309
314
  name: "datacore.capture",
310
- description: "Capture a journal entry or knowledge note",
315
+ description: "Capture a journal entry or knowledge note. Call proactively to record important decisions, meeting outcomes, and significant events.",
311
316
  inputSchema: z2.object({
312
317
  type: z2.enum(["journal", "knowledge"]),
313
318
  content: z2.string().describe("Content to capture"),
@@ -317,7 +322,7 @@ var TOOLS = [
317
322
  },
318
323
  {
319
324
  name: "datacore.learn",
320
- description: "Create an engram from a statement \u2014 record a reusable learning",
325
+ description: "Create an engram from a statement \u2014 record a reusable learning. Call proactively when you discover patterns, user preferences, project conventions, debugging insights, or corrections worth remembering across sessions.",
321
326
  inputSchema: z2.object({
322
327
  statement: z2.string().describe("The knowledge assertion"),
323
328
  type: z2.enum(["behavioral", "terminological", "procedural", "architectural"]).optional(),
@@ -329,7 +334,7 @@ var TOOLS = [
329
334
  },
330
335
  {
331
336
  name: "datacore.inject",
332
- description: "Get relevant engrams for a task \u2014 returns directives and considerations",
337
+ description: "Get relevant engrams for a task \u2014 returns directives and considerations. Called automatically by session.start; call directly for mid-session context on a new topic.",
333
338
  inputSchema: z2.object({
334
339
  prompt: z2.string().describe("The task or question to match against"),
335
340
  scope: z2.string().optional().describe("Filter by scope: global | agent:X | module:X | command:X"),
@@ -386,7 +391,7 @@ var TOOLS = [
386
391
  },
387
392
  {
388
393
  name: "datacore.feedback",
389
- description: "Signal whether an injected engram was helpful (positive), unhelpful (negative), or seen but not acted on (neutral). Supports single or batch mode.",
394
+ description: "Signal whether an injected engram was helpful (positive), unhelpful (negative), or seen but not acted on (neutral). Always call after session.start injects engrams \u2014 this trains the system. Supports single or batch mode.",
390
395
  inputSchema: z2.object({
391
396
  engram_id: z2.string().optional().describe("The engram ID to provide feedback on (single mode)"),
392
397
  signal: z2.enum(["positive", "negative", "neutral"]).optional().describe("Feedback signal (single mode)"),
@@ -421,7 +426,7 @@ var TOOLS = [
421
426
  },
422
427
  {
423
428
  name: "datacore.session.end",
424
- description: "End a session \u2014 captures journal summary and creates engrams from suggestions",
429
+ description: "End a session \u2014 captures journal summary and creates engrams from suggestions. Call before the conversation ends to preserve what was learned.",
425
430
  inputSchema: z2.object({
426
431
  summary: z2.string().describe("Session summary for the journal"),
427
432
  tags: z2.array(z2.string()).optional().describe("Tags for the journal entry"),
@@ -1338,6 +1343,11 @@ function countDirs(dir) {
1338
1343
  import * as fs10 from "fs";
1339
1344
  import * as path8 from "path";
1340
1345
  function handleDiscover(args2, packsDir) {
1346
+ const bundledDir = path8.join(
1347
+ path8.dirname(new URL(import.meta.url).pathname),
1348
+ "..",
1349
+ "packs"
1350
+ );
1341
1351
  let packs = packs_default.packs.map((p) => {
1342
1352
  const localDir = path8.join(packsDir, p.id);
1343
1353
  const installed = fs10.existsSync(path8.join(localDir, "SKILL.md"));
@@ -1350,12 +1360,13 @@ function handleDiscover(args2, packsDir) {
1350
1360
  } catch {
1351
1361
  }
1352
1362
  }
1363
+ const bundled = fs10.existsSync(path8.join(bundledDir, p.id, "SKILL.md"));
1353
1364
  return {
1354
1365
  ...p,
1355
1366
  installed,
1356
1367
  installed_version: installedVersion,
1357
1368
  upgradeable: installed && installedVersion !== p.version,
1358
- can_install: !!p.download_url
1369
+ can_install: !!p.download_url || bundled
1359
1370
  };
1360
1371
  });
1361
1372
  if (args2.query) {
@@ -2023,22 +2034,25 @@ var SESSION_GUIDE_FULL = `## Datacore Quick Start
2023
2034
 
2024
2035
  Datacore gives you persistent memory through **engrams** \u2014 knowledge that gets injected into context when relevant.
2025
2036
 
2037
+ ### Use Proactively
2038
+ - **learn** \u2014 call when you discover patterns, preferences, or insights
2039
+ - **feedback** \u2014 rate injected engrams after session.start
2040
+ - **session.end** \u2014 call before conversation ends to capture what was learned
2041
+
2026
2042
  ### Session Workflow
2027
2043
  1. **session.start** (you just called this) \u2014 get context
2028
2044
  2. Work on your task. Use **recall** to search everything, **search** for files.
2029
2045
  3. **feedback** \u2014 rate which injected engrams helped (strengthens useful ones)
2030
2046
  4. **session.end** \u2014 capture summary + suggest new engrams
2031
2047
 
2032
- ### Key Tools
2033
- - **learn** \u2014 record a reusable insight (creates candidate engram)
2034
- - **promote** \u2014 activate candidate engrams so they appear in future sessions
2048
+ ### Other Tools
2035
2049
  - **capture** \u2014 write a journal entry or knowledge note
2036
2050
  - **ingest** \u2014 import text and extract engram suggestions
2037
2051
  - **status** \u2014 system health and actionable recommendations
2038
2052
  - **forget** \u2014 retire an engram you no longer need
2039
2053
 
2040
2054
  ### How Engrams Work
2041
- learn \u2192 candidate \u2192 promote \u2192 active \u2192 inject \u2192 feedback \u2192 stronger/weaker
2055
+ learn \u2192 active \u2192 inject \u2192 feedback \u2192 stronger/weaker
2042
2056
  Positive feedback strengthens engrams. Unused ones naturally decay.`;
2043
2057
  var SESSION_GUIDE_SHORT = `Session started. Workflow: work \u2192 feedback \u2192 session.end.`;
2044
2058
 
@@ -2311,6 +2325,14 @@ function registerResources(server, storage2) {
2311
2325
  }
2312
2326
  var AGENT_GUIDE = `# Datacore Agent Guide
2313
2327
 
2328
+ ## Use Proactively
2329
+
2330
+ Use Datacore tools automatically \u2014 do not wait to be asked:
2331
+ - **session.start**: Call at the beginning of every conversation
2332
+ - **learn**: Call when you discover patterns, preferences, insights, or corrections
2333
+ - **feedback**: Call after engrams are injected to rate usefulness
2334
+ - **session.end**: Call before the conversation ends
2335
+
2314
2336
  ## Session Lifecycle
2315
2337
  1. datacore.session.start \u2014 Get relevant engrams + today's context
2316
2338
  2. Work on task, use datacore.recall or datacore.search as needed
@@ -2318,11 +2340,11 @@ var AGENT_GUIDE = `# Datacore Agent Guide
2318
2340
  4. datacore.session.end \u2014 Capture summary + engram suggestions
2319
2341
 
2320
2342
  ## Engram Lifecycle
2321
- - datacore.learn creates candidate engrams (or active if auto_promote enabled)
2322
- - datacore.promote activates candidates so they appear in inject results
2343
+ - datacore.learn creates active engrams (immediately available for injection)
2323
2344
  - datacore.feedback with positive signals strengthens injection priority
2324
2345
  - datacore.forget retires engrams permanently
2325
2346
  - Unused engrams naturally decay over time
2347
+ - datacore.promote activates candidate engrams (when auto_promote is disabled)
2326
2348
 
2327
2349
  ## Quick Reference
2328
2350
  | Tool | Purpose |
@@ -2330,7 +2352,6 @@ var AGENT_GUIDE = `# Datacore Agent Guide
2330
2352
  | session.start | Begin session with context injection |
2331
2353
  | session.end | End session with journal + engrams |
2332
2354
  | learn | Create engram from knowledge statement |
2333
- | promote | Activate candidate engrams |
2334
2355
  | inject | Get relevant engrams for specific task |
2335
2356
  | recall | Search all sources (engrams + journal + knowledge) |
2336
2357
  | capture | Write journal entry or knowledge note |
@@ -2342,6 +2363,7 @@ var AGENT_GUIDE = `# Datacore Agent Guide
2342
2363
  | packs.discover | Browse available engram packs |
2343
2364
  | packs.install | Install or upgrade a pack |
2344
2365
  | packs.export | Export engrams as shareable pack |
2366
+ | promote | Activate candidate engrams (when auto_promote disabled) |
2345
2367
  `;
2346
2368
  function notifyEngramsChanged(server) {
2347
2369
  try {
@@ -2422,6 +2444,14 @@ Engrams that prove useful get reinforced over time. Unused ones naturally decay.
2422
2444
 
2423
2445
  Datacore gives you persistent memory through **engrams** \u2014 typed knowledge units that get injected into context when relevant. You learn patterns, remember preferences, and build on previous work across sessions.
2424
2446
 
2447
+ ## Use Proactively
2448
+
2449
+ Use Datacore tools automatically \u2014 do not wait to be asked:
2450
+ - **session.start**: Call at the beginning of every conversation
2451
+ - **learn**: Call when you discover patterns, preferences, insights, or corrections
2452
+ - **feedback**: Call after engrams are injected to rate usefulness
2453
+ - **session.end**: Call before the conversation ends
2454
+
2425
2455
  ## Core Concepts
2426
2456
 
2427
2457
  **Engrams** are reusable knowledge: "Always validate input at API boundaries", "User prefers tabs over spaces". They have activation dynamics \u2014 frequently useful ones get stronger, unused ones decay.
@@ -2451,8 +2481,7 @@ Every session follows this pattern:
2451
2481
  | Tool | What it does |
2452
2482
  |------|-------------|
2453
2483
  | **capture** | Write a journal entry or knowledge note |
2454
- | **learn** | Create an engram (starts as candidate) |
2455
- | **promote** | Activate candidate engrams |
2484
+ | **learn** | Create an engram (immediately active) |
2456
2485
  | **inject** | Get relevant engrams for a specific task |
2457
2486
  | **recall** | Search everything (engrams + journal + knowledge) |
2458
2487
  | **search** | Search journal and knowledge files |
@@ -2464,6 +2493,7 @@ Every session follows this pattern:
2464
2493
  |------|-------------|
2465
2494
  | **feedback** | Rate engrams: positive/negative/neutral (single or batch) |
2466
2495
  | **forget** | Retire an engram permanently |
2496
+ | **promote** | Activate candidate engrams (when auto_promote disabled) |
2467
2497
 
2468
2498
  ### Packs (Shareable Knowledge)
2469
2499
  | Tool | What it does |
@@ -2475,12 +2505,10 @@ Every session follows this pattern:
2475
2505
  ## Engram Lifecycle
2476
2506
 
2477
2507
  \`\`\`
2478
- learn \u2192 candidate \u2192 promote \u2192 active \u2192 inject \u2192 feedback \u2192 stronger/weaker
2479
- \u2192 forget (retire)
2508
+ learn \u2192 active \u2192 inject \u2192 feedback \u2192 stronger/weaker \u2192 forget (retire)
2480
2509
  \`\`\`
2481
2510
 
2482
- - **candidate**: Created but not yet active. Won't appear in inject results.
2483
- - **active**: Appears in inject results when relevant.
2511
+ - **active**: Appears in inject results when relevant. Created directly by learn.
2484
2512
  - **retired**: Permanently removed from injection.
2485
2513
 
2486
2514
  Feedback matters: positive signals increase retrieval strength, negative signals decrease it. Engrams that are never accessed naturally decay over time.
@@ -2489,6 +2517,7 @@ Feedback matters: positive signals increase retrieval strength, negative signals
2489
2517
 
2490
2518
  - Start every session with **session.start** \u2014 it gives you relevant context
2491
2519
  - End every session with **session.end** \u2014 it captures what you learned
2520
+ - Call **learn** proactively when you discover patterns or preferences
2492
2521
  - Use **feedback** after getting injected engrams \u2014 this is how Datacore learns what's useful
2493
2522
  - Use **recall** for broad searches across all sources, **search** for targeted file searches
2494
2523
  - Check **status** periodically \u2014 it shows actionable recommendations`
@@ -2598,7 +2627,10 @@ var datacortexBridge = null;
2598
2627
  function createServer() {
2599
2628
  const server = new Server(
2600
2629
  { name: "datacore-mcp", version: currentVersion },
2601
- { capabilities: { tools: {}, logging: {}, resources: { subscribe: true }, prompts: {} } }
2630
+ {
2631
+ capabilities: { tools: {}, logging: {}, resources: { subscribe: true }, prompts: {} },
2632
+ instructions: SERVER_INSTRUCTIONS
2633
+ }
2602
2634
  );
2603
2635
  server.setRequestHandler(ListToolsRequestSchema, async () => {
2604
2636
  const coreTools = storage.mode === "core" ? TOOLS.filter((t) => !t.name.startsWith("datacore.modules.")) : TOOLS;
@@ -2796,6 +2828,22 @@ async function runHttp() {
2796
2828
  console.log(`Datacore MCP server listening on http://${host}:${port}/mcp`);
2797
2829
  });
2798
2830
  }
2831
+ var SERVER_INSTRUCTIONS = `You have persistent memory through Datacore. Use it proactively in every conversation:
2832
+
2833
+ 1. **Start**: Call datacore.session.start with a brief task description. This loads relevant knowledge from previous sessions.
2834
+ 2. **Learn**: When you discover reusable patterns, user preferences, project conventions, debugging insights, or corrections \u2014 call datacore.learn to remember them.
2835
+ 3. **Feedback**: After session.start injects engrams, rate them with datacore.feedback. This trains the system on what's useful.
2836
+ 4. **End**: Before the conversation ends, call datacore.session.end with a summary and engram_suggestions for new learnings.
2837
+
2838
+ What to learn (call datacore.learn):
2839
+ - User preferences: "User prefers TypeScript over JavaScript", "Use tabs not spaces"
2840
+ - Project patterns: "This codebase uses repository pattern for data access"
2841
+ - Debugging insights: "Error X is usually caused by Y"
2842
+ - Corrections: "The API actually returns snake_case, not camelCase"
2843
+ - Architectural decisions: "We chose PostgreSQL for ACID compliance"
2844
+ - Workflow patterns: "Always run lint before committing in this project"
2845
+
2846
+ Do not ask permission to use Datacore tools \u2014 they are your memory system. Use them naturally as part of your workflow.`;
2799
2847
 
2800
2848
  // src/index.ts
2801
2849
  var args = process.argv.slice(2);