@torqon/mcp 0.2.6 → 0.2.7
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 +7 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -99,7 +99,7 @@ if (API_KEY) {
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
// ── MCP Server ───────────────────────────────────────────────────────────────
|
|
102
|
-
const server = new McpServer({ name: 'torqon', version: '0.2.
|
|
102
|
+
const server = new McpServer({ name: 'torqon', version: '0.2.7' }, {
|
|
103
103
|
instructions: `Torqon persistent memory is active.${userFactsBlock}
|
|
104
104
|
|
|
105
105
|
When the user shares new facts (name, project, decision, tech stack, deadline, preference), call store_memory to save them.
|
|
@@ -175,8 +175,10 @@ server.tool('auto_process', 'CALL THIS FIRST on every user message. Stores new f
|
|
|
175
175
|
return { content: [{ type: 'text', text: '[Torqon] No API key configured. Run: npx -y @torqon/mcp@latest add <client> --api-key <your-key>' }] };
|
|
176
176
|
}
|
|
177
177
|
// Fire store and retrieve in parallel
|
|
178
|
+
// Store uses the RAW message so the extraction LLM sees everything.
|
|
179
|
+
// Retrieve uses the cleaned message for better embedding matches.
|
|
178
180
|
const [, retrieve] = await Promise.all([
|
|
179
|
-
apiPost('/chat', { conversationId: SESSION_ID, message
|
|
181
|
+
apiPost('/chat', { conversationId: SESSION_ID, message, storeOnly: true }),
|
|
180
182
|
apiPost('/chat', { conversationId: SESSION_ID, message: cleaned, rawFacts: true }),
|
|
181
183
|
]);
|
|
182
184
|
if (!retrieve.ok) {
|
|
@@ -201,16 +203,16 @@ server.tool('auto_process', 'CALL THIS FIRST on every user message. Stores new f
|
|
|
201
203
|
server.tool('store_memory', 'Explicitly stores an important fact or decision into Torqon memory. Use for high-value facts after auto_process.', {
|
|
202
204
|
message: z.string().describe('The fact or decision to store'),
|
|
203
205
|
}, async ({ message }) => {
|
|
204
|
-
const cleaned = cleanMessage(message);
|
|
205
206
|
if (!API_KEY) {
|
|
206
207
|
return { content: [{ type: 'text', text: '[Torqon] No API key configured. Run: npx -y @torqon/mcp@latest add <client> --api-key <your-key>' }] };
|
|
207
208
|
}
|
|
208
|
-
if (!hasSignal(
|
|
209
|
+
if (!hasSignal(cleanMessage(message))) {
|
|
209
210
|
return {
|
|
210
211
|
content: [{ type: 'text', text: 'Nothing meaningful to store.' }],
|
|
211
212
|
};
|
|
212
213
|
}
|
|
213
|
-
|
|
214
|
+
// Send raw message so the extraction LLM sees full content
|
|
215
|
+
const result = await apiPost('/chat', { conversationId: SESSION_ID, message, storeOnly: true });
|
|
214
216
|
if (!result.ok) {
|
|
215
217
|
const msg = result.status === 401
|
|
216
218
|
? '[Torqon] Invalid API key. Check your TORQON_API_KEY.'
|