@contextstream/mcp-server 0.3.37 → 0.3.39
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 +25 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4696,6 +4696,20 @@ var CacheKeys = {
|
|
|
4696
4696
|
};
|
|
4697
4697
|
var globalCache = new MemoryCache();
|
|
4698
4698
|
|
|
4699
|
+
// src/version.ts
|
|
4700
|
+
import { createRequire } from "module";
|
|
4701
|
+
function getVersion() {
|
|
4702
|
+
try {
|
|
4703
|
+
const require2 = createRequire(import.meta.url);
|
|
4704
|
+
const pkg = require2("../package.json");
|
|
4705
|
+
const version = pkg?.version;
|
|
4706
|
+
if (typeof version === "string" && version.trim()) return version.trim();
|
|
4707
|
+
} catch {
|
|
4708
|
+
}
|
|
4709
|
+
return "unknown";
|
|
4710
|
+
}
|
|
4711
|
+
var VERSION = getVersion();
|
|
4712
|
+
|
|
4699
4713
|
// src/client.ts
|
|
4700
4714
|
var uuidSchema = external_exports.string().uuid();
|
|
4701
4715
|
function unwrapApiResponse(result) {
|
|
@@ -5662,7 +5676,8 @@ var ContextStreamClient = class {
|
|
|
5662
5676
|
project_id: params.project_id,
|
|
5663
5677
|
session_id: params.session_id,
|
|
5664
5678
|
include_recent_memory: params.include_recent_memory ?? true,
|
|
5665
|
-
include_decisions: params.include_decisions ?? true
|
|
5679
|
+
include_decisions: params.include_decisions ?? true,
|
|
5680
|
+
client_version: VERSION
|
|
5666
5681
|
}
|
|
5667
5682
|
});
|
|
5668
5683
|
const contextData = "data" in result && result.data ? result.data : result;
|
|
@@ -6980,6 +6995,14 @@ If context still feels missing, increase \`max_tokens\` and/or call \`session_re
|
|
|
6980
6995
|
|
|
6981
6996
|
---
|
|
6982
6997
|
|
|
6998
|
+
### Search (ContextStream-first)
|
|
6999
|
+
|
|
7000
|
+
- Before scanning the repo or grepping, use \`session_smart_search\` to locate relevant files, patterns, and prior context.
|
|
7001
|
+
- Follow up with \`session_recall\` if you need deeper history on a specific topic.
|
|
7002
|
+
- Only fall back to raw file scans (\`rg\`, \`ls\`, \`find\`) when ContextStream search doesn't surface what you need.
|
|
7003
|
+
|
|
7004
|
+
---
|
|
7005
|
+
|
|
6983
7006
|
### Lesson Capture (MANDATORY)
|
|
6984
7007
|
|
|
6985
7008
|
When:
|
|
@@ -7054,6 +7077,7 @@ var CONTEXTSTREAM_RULES_MINIMAL = `
|
|
|
7054
7077
|
- Every user message: \`context_smart(user_message="<user_message>", format="minified", max_tokens=400)\` BEFORE answering.
|
|
7055
7078
|
- Use \`max_tokens=200\` for trivial/local edits, \`max_tokens=800\` for deep debugging/architecture.
|
|
7056
7079
|
- If prior context is missing or user asks past decisions: \`session_recall(query="<question>")\`, then answer.
|
|
7080
|
+
- For code/file discovery, use \`session_smart_search\` before raw repo scans (\`rg\`, \`ls\`, \`find\`); fall back only if needed.
|
|
7057
7081
|
- After meaningful work/decisions/preferences: \`session_capture(event_type=decision|preference|task|insight, title="\u2026", content="\u2026")\`.
|
|
7058
7082
|
- On frustration/corrections/tool mistakes: \`session_capture_lesson(...)\`.
|
|
7059
7083
|
`.trim();
|
|
@@ -7152,20 +7176,6 @@ ${options.workspaceId ? `# Workspace ID: ${options.workspaceId}` : ""}
|
|
|
7152
7176
|
};
|
|
7153
7177
|
}
|
|
7154
7178
|
|
|
7155
|
-
// src/version.ts
|
|
7156
|
-
import { createRequire } from "module";
|
|
7157
|
-
function getVersion() {
|
|
7158
|
-
try {
|
|
7159
|
-
const require2 = createRequire(import.meta.url);
|
|
7160
|
-
const pkg = require2("../package.json");
|
|
7161
|
-
const version = pkg?.version;
|
|
7162
|
-
if (typeof version === "string" && version.trim()) return version.trim();
|
|
7163
|
-
} catch {
|
|
7164
|
-
}
|
|
7165
|
-
return "unknown";
|
|
7166
|
-
}
|
|
7167
|
-
var VERSION = getVersion();
|
|
7168
|
-
|
|
7169
7179
|
// src/tools.ts
|
|
7170
7180
|
var LESSON_DEDUP_WINDOW_MS = 2 * 60 * 1e3;
|
|
7171
7181
|
var recentLessonCaptures = /* @__PURE__ */ new Map();
|
package/package.json
CHANGED