@contextstream/mcp-server 0.3.44 → 0.3.45
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 +26 -46
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5686,58 +5686,38 @@ var ContextStreamClient = class {
|
|
|
5686
5686
|
}
|
|
5687
5687
|
/**
|
|
5688
5688
|
* Fallback to individual API calls if batched endpoint is unavailable.
|
|
5689
|
+
* Uses Promise.allSettled for parallel execution (faster than sequential).
|
|
5689
5690
|
*/
|
|
5690
5691
|
async _fetchSessionContextFallback(context, workspaceId, projectId, params) {
|
|
5691
|
-
|
|
5692
|
-
|
|
5693
|
-
|
|
5694
|
-
|
|
5695
|
-
|
|
5696
|
-
|
|
5697
|
-
|
|
5698
|
-
|
|
5699
|
-
}
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
|
|
5703
|
-
|
|
5704
|
-
workspace_id: workspaceId,
|
|
5705
|
-
limit: 10
|
|
5706
|
-
});
|
|
5707
|
-
} catch {
|
|
5708
|
-
}
|
|
5709
|
-
}
|
|
5710
|
-
if (params.include_decisions !== false) {
|
|
5711
|
-
try {
|
|
5712
|
-
context.recent_decisions = await this.memoryDecisions({
|
|
5713
|
-
workspace_id: workspaceId,
|
|
5714
|
-
limit: 5
|
|
5715
|
-
});
|
|
5716
|
-
} catch {
|
|
5717
|
-
}
|
|
5718
|
-
}
|
|
5719
|
-
if (params.context_hint) {
|
|
5720
|
-
try {
|
|
5721
|
-
context.relevant_context = await this.memorySearch({
|
|
5722
|
-
query: params.context_hint,
|
|
5723
|
-
workspace_id: workspaceId,
|
|
5724
|
-
limit: 5
|
|
5725
|
-
});
|
|
5726
|
-
} catch {
|
|
5727
|
-
}
|
|
5728
|
-
}
|
|
5729
|
-
try {
|
|
5730
|
-
const lessons = await this.getHighPriorityLessons({
|
|
5692
|
+
const requests = [
|
|
5693
|
+
// 0: workspace overview
|
|
5694
|
+
this.workspaceOverview(workspaceId).catch(() => null),
|
|
5695
|
+
// 1: project overview (if projectId exists)
|
|
5696
|
+
projectId ? this.projectOverview(projectId).catch(() => null) : Promise.resolve(null),
|
|
5697
|
+
// 2: recent memory events
|
|
5698
|
+
params.include_recent_memory !== false ? this.listMemoryEvents({ workspace_id: workspaceId, limit: 10 }).catch(() => null) : Promise.resolve(null),
|
|
5699
|
+
// 3: recent decisions
|
|
5700
|
+
params.include_decisions !== false ? this.memoryDecisions({ workspace_id: workspaceId, limit: 5 }).catch(() => null) : Promise.resolve(null),
|
|
5701
|
+
// 4: relevant context from semantic search
|
|
5702
|
+
params.context_hint ? this.memorySearch({ query: params.context_hint, workspace_id: workspaceId, limit: 5 }).catch(() => null) : Promise.resolve(null),
|
|
5703
|
+
// 5: high-priority lessons
|
|
5704
|
+
this.getHighPriorityLessons({
|
|
5731
5705
|
workspace_id: workspaceId,
|
|
5732
5706
|
project_id: projectId,
|
|
5733
5707
|
context_hint: params.context_hint,
|
|
5734
5708
|
limit: 5
|
|
5735
|
-
})
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5709
|
+
}).catch(() => null)
|
|
5710
|
+
];
|
|
5711
|
+
const results = await Promise.all(requests);
|
|
5712
|
+
if (results[0]) context.workspace = results[0];
|
|
5713
|
+
if (results[1]) context.project = results[1];
|
|
5714
|
+
if (results[2]) context.recent_memory = results[2];
|
|
5715
|
+
if (results[3]) context.recent_decisions = results[3];
|
|
5716
|
+
if (results[4]) context.relevant_context = results[4];
|
|
5717
|
+
const lessons = results[5];
|
|
5718
|
+
if (lessons && Array.isArray(lessons) && lessons.length > 0) {
|
|
5719
|
+
context.lessons = lessons;
|
|
5720
|
+
context.lessons_warning = `\u26A0\uFE0F ${lessons.length} lesson(s) from past mistakes. Review before making changes.`;
|
|
5741
5721
|
}
|
|
5742
5722
|
}
|
|
5743
5723
|
/**
|
package/package.json
CHANGED