@datacore-one/mcp 1.1.2 → 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.2",
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"),
@@ -2029,22 +2034,25 @@ var SESSION_GUIDE_FULL = `## Datacore Quick Start
2029
2034
 
2030
2035
  Datacore gives you persistent memory through **engrams** \u2014 knowledge that gets injected into context when relevant.
2031
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
+
2032
2042
  ### Session Workflow
2033
2043
  1. **session.start** (you just called this) \u2014 get context
2034
2044
  2. Work on your task. Use **recall** to search everything, **search** for files.
2035
2045
  3. **feedback** \u2014 rate which injected engrams helped (strengthens useful ones)
2036
2046
  4. **session.end** \u2014 capture summary + suggest new engrams
2037
2047
 
2038
- ### Key Tools
2039
- - **learn** \u2014 record a reusable insight (creates candidate engram)
2040
- - **promote** \u2014 activate candidate engrams so they appear in future sessions
2048
+ ### Other Tools
2041
2049
  - **capture** \u2014 write a journal entry or knowledge note
2042
2050
  - **ingest** \u2014 import text and extract engram suggestions
2043
2051
  - **status** \u2014 system health and actionable recommendations
2044
2052
  - **forget** \u2014 retire an engram you no longer need
2045
2053
 
2046
2054
  ### How Engrams Work
2047
- 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
2048
2056
  Positive feedback strengthens engrams. Unused ones naturally decay.`;
2049
2057
  var SESSION_GUIDE_SHORT = `Session started. Workflow: work \u2192 feedback \u2192 session.end.`;
2050
2058
 
@@ -2317,6 +2325,14 @@ function registerResources(server, storage2) {
2317
2325
  }
2318
2326
  var AGENT_GUIDE = `# Datacore Agent Guide
2319
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
+
2320
2336
  ## Session Lifecycle
2321
2337
  1. datacore.session.start \u2014 Get relevant engrams + today's context
2322
2338
  2. Work on task, use datacore.recall or datacore.search as needed
@@ -2324,11 +2340,11 @@ var AGENT_GUIDE = `# Datacore Agent Guide
2324
2340
  4. datacore.session.end \u2014 Capture summary + engram suggestions
2325
2341
 
2326
2342
  ## Engram Lifecycle
2327
- - datacore.learn creates candidate engrams (or active if auto_promote enabled)
2328
- - datacore.promote activates candidates so they appear in inject results
2343
+ - datacore.learn creates active engrams (immediately available for injection)
2329
2344
  - datacore.feedback with positive signals strengthens injection priority
2330
2345
  - datacore.forget retires engrams permanently
2331
2346
  - Unused engrams naturally decay over time
2347
+ - datacore.promote activates candidate engrams (when auto_promote is disabled)
2332
2348
 
2333
2349
  ## Quick Reference
2334
2350
  | Tool | Purpose |
@@ -2336,7 +2352,6 @@ var AGENT_GUIDE = `# Datacore Agent Guide
2336
2352
  | session.start | Begin session with context injection |
2337
2353
  | session.end | End session with journal + engrams |
2338
2354
  | learn | Create engram from knowledge statement |
2339
- | promote | Activate candidate engrams |
2340
2355
  | inject | Get relevant engrams for specific task |
2341
2356
  | recall | Search all sources (engrams + journal + knowledge) |
2342
2357
  | capture | Write journal entry or knowledge note |
@@ -2348,6 +2363,7 @@ var AGENT_GUIDE = `# Datacore Agent Guide
2348
2363
  | packs.discover | Browse available engram packs |
2349
2364
  | packs.install | Install or upgrade a pack |
2350
2365
  | packs.export | Export engrams as shareable pack |
2366
+ | promote | Activate candidate engrams (when auto_promote disabled) |
2351
2367
  `;
2352
2368
  function notifyEngramsChanged(server) {
2353
2369
  try {
@@ -2428,6 +2444,14 @@ Engrams that prove useful get reinforced over time. Unused ones naturally decay.
2428
2444
 
2429
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.
2430
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
+
2431
2455
  ## Core Concepts
2432
2456
 
2433
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.
@@ -2457,8 +2481,7 @@ Every session follows this pattern:
2457
2481
  | Tool | What it does |
2458
2482
  |------|-------------|
2459
2483
  | **capture** | Write a journal entry or knowledge note |
2460
- | **learn** | Create an engram (starts as candidate) |
2461
- | **promote** | Activate candidate engrams |
2484
+ | **learn** | Create an engram (immediately active) |
2462
2485
  | **inject** | Get relevant engrams for a specific task |
2463
2486
  | **recall** | Search everything (engrams + journal + knowledge) |
2464
2487
  | **search** | Search journal and knowledge files |
@@ -2470,6 +2493,7 @@ Every session follows this pattern:
2470
2493
  |------|-------------|
2471
2494
  | **feedback** | Rate engrams: positive/negative/neutral (single or batch) |
2472
2495
  | **forget** | Retire an engram permanently |
2496
+ | **promote** | Activate candidate engrams (when auto_promote disabled) |
2473
2497
 
2474
2498
  ### Packs (Shareable Knowledge)
2475
2499
  | Tool | What it does |
@@ -2481,12 +2505,10 @@ Every session follows this pattern:
2481
2505
  ## Engram Lifecycle
2482
2506
 
2483
2507
  \`\`\`
2484
- learn \u2192 candidate \u2192 promote \u2192 active \u2192 inject \u2192 feedback \u2192 stronger/weaker
2485
- \u2192 forget (retire)
2508
+ learn \u2192 active \u2192 inject \u2192 feedback \u2192 stronger/weaker \u2192 forget (retire)
2486
2509
  \`\`\`
2487
2510
 
2488
- - **candidate**: Created but not yet active. Won't appear in inject results.
2489
- - **active**: Appears in inject results when relevant.
2511
+ - **active**: Appears in inject results when relevant. Created directly by learn.
2490
2512
  - **retired**: Permanently removed from injection.
2491
2513
 
2492
2514
  Feedback matters: positive signals increase retrieval strength, negative signals decrease it. Engrams that are never accessed naturally decay over time.
@@ -2495,6 +2517,7 @@ Feedback matters: positive signals increase retrieval strength, negative signals
2495
2517
 
2496
2518
  - Start every session with **session.start** \u2014 it gives you relevant context
2497
2519
  - End every session with **session.end** \u2014 it captures what you learned
2520
+ - Call **learn** proactively when you discover patterns or preferences
2498
2521
  - Use **feedback** after getting injected engrams \u2014 this is how Datacore learns what's useful
2499
2522
  - Use **recall** for broad searches across all sources, **search** for targeted file searches
2500
2523
  - Check **status** periodically \u2014 it shows actionable recommendations`
@@ -2604,7 +2627,10 @@ var datacortexBridge = null;
2604
2627
  function createServer() {
2605
2628
  const server = new Server(
2606
2629
  { name: "datacore-mcp", version: currentVersion },
2607
- { capabilities: { tools: {}, logging: {}, resources: { subscribe: true }, prompts: {} } }
2630
+ {
2631
+ capabilities: { tools: {}, logging: {}, resources: { subscribe: true }, prompts: {} },
2632
+ instructions: SERVER_INSTRUCTIONS
2633
+ }
2608
2634
  );
2609
2635
  server.setRequestHandler(ListToolsRequestSchema, async () => {
2610
2636
  const coreTools = storage.mode === "core" ? TOOLS.filter((t) => !t.name.startsWith("datacore.modules.")) : TOOLS;
@@ -2802,6 +2828,22 @@ async function runHttp() {
2802
2828
  console.log(`Datacore MCP server listening on http://${host}:${port}/mcp`);
2803
2829
  });
2804
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.`;
2805
2847
 
2806
2848
  // src/index.ts
2807
2849
  var args = process.argv.slice(2);