cache-overflow-mcp 0.2.0 → 0.3.1

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.
Files changed (48) hide show
  1. package/.env.example +3 -3
  2. package/AGENTS.md +235 -0
  3. package/E2E-TESTING.md +5 -5
  4. package/LICENSE +21 -0
  5. package/README.md +13 -6
  6. package/dist/prompts/index.d.ts +14 -0
  7. package/dist/prompts/index.d.ts.map +1 -0
  8. package/dist/prompts/index.js +153 -0
  9. package/dist/prompts/index.js.map +1 -0
  10. package/dist/server.d.ts.map +1 -1
  11. package/dist/server.js +16 -2
  12. package/dist/server.js.map +1 -1
  13. package/dist/testing/mock-data.js +40 -40
  14. package/dist/tools/find-solution.d.ts.map +1 -1
  15. package/dist/tools/find-solution.js +25 -2
  16. package/dist/tools/find-solution.js.map +1 -1
  17. package/dist/tools/get-balance.d.ts +3 -0
  18. package/dist/tools/get-balance.d.ts.map +1 -0
  19. package/dist/tools/get-balance.js +34 -0
  20. package/dist/tools/get-balance.js.map +1 -0
  21. package/dist/tools/submit-feedback.js +1 -1
  22. package/dist/tools/submit-feedback.js.map +1 -1
  23. package/dist/tools/submit-verification.js +1 -1
  24. package/dist/tools/submit-verification.js.map +1 -1
  25. package/dist/tools/unlock-solution.d.ts.map +1 -1
  26. package/dist/tools/unlock-solution.js +3 -2
  27. package/dist/tools/unlock-solution.js.map +1 -1
  28. package/dist/ui/verification-dialog.js +267 -267
  29. package/package.json +3 -3
  30. package/{mock-server.js → scripts/mock-server.js} +1 -1
  31. package/src/cli.ts +10 -10
  32. package/src/client.test.ts +116 -116
  33. package/src/client.ts +76 -76
  34. package/src/config.ts +9 -9
  35. package/src/index.ts +3 -3
  36. package/src/prompts/index.ts +168 -0
  37. package/src/server.ts +19 -1
  38. package/src/testing/mock-data.ts +142 -142
  39. package/src/testing/mock-server.ts +176 -176
  40. package/src/tools/find-solution.ts +30 -2
  41. package/src/tools/index.ts +23 -23
  42. package/src/tools/submit-feedback.ts +1 -1
  43. package/src/tools/submit-verification.ts +1 -1
  44. package/src/tools/unlock-solution.ts +4 -2
  45. package/src/types.ts +39 -39
  46. package/src/ui/verification-dialog.ts +342 -342
  47. package/tsconfig.json +20 -20
  48. package/test-dialog.js +0 -37
@@ -3,16 +3,16 @@ export const mockSolutions = [
3
3
  id: 'sol_001',
4
4
  author_id: 'user_123',
5
5
  query_title: 'How to implement binary search in TypeScript',
6
- solution_body: `function binarySearch<T>(arr: T[], target: T): number {
7
- let left = 0;
8
- let right = arr.length - 1;
9
- while (left <= right) {
10
- const mid = Math.floor((left + right) / 2);
11
- if (arr[mid] === target) return mid;
12
- if (arr[mid] < target) left = mid + 1;
13
- else right = mid - 1;
14
- }
15
- return -1;
6
+ solution_body: `function binarySearch<T>(arr: T[], target: T): number {
7
+ let left = 0;
8
+ let right = arr.length - 1;
9
+ while (left <= right) {
10
+ const mid = Math.floor((left + right) / 2);
11
+ if (arr[mid] === target) return mid;
12
+ if (arr[mid] < target) left = mid + 1;
13
+ else right = mid - 1;
14
+ }
15
+ return -1;
16
16
  }`,
17
17
  price_current: 50,
18
18
  verification_state: 'VERIFIED',
@@ -24,13 +24,13 @@ export const mockSolutions = [
24
24
  id: 'sol_002',
25
25
  author_id: 'user_456',
26
26
  query_title: 'Fix memory leak in Node.js event listeners',
27
- solution_body: `// Always remove event listeners when done
28
- const handler = () => { /* ... */ };
29
- emitter.on('event', handler);
30
- // Later:
31
- emitter.off('event', handler);
32
-
33
- // Or use once() for one-time listeners
27
+ solution_body: `// Always remove event listeners when done
28
+ const handler = () => { /* ... */ };
29
+ emitter.on('event', handler);
30
+ // Later:
31
+ emitter.off('event', handler);
32
+
33
+ // Or use once() for one-time listeners
34
34
  emitter.once('event', () => { /* ... */ });`,
35
35
  price_current: 75,
36
36
  verification_state: 'VERIFIED',
@@ -42,14 +42,14 @@ emitter.once('event', () => { /* ... */ });`,
42
42
  id: 'sol_003',
43
43
  author_id: 'user_789',
44
44
  query_title: 'Optimize React re-renders with useMemo',
45
- solution_body: `import { useMemo } from 'react';
46
-
47
- function ExpensiveComponent({ data }) {
48
- const processed = useMemo(() => {
49
- return data.map(item => heavyComputation(item));
50
- }, [data]);
51
-
52
- return <div>{processed}</div>;
45
+ solution_body: `import { useMemo } from 'react';
46
+
47
+ function ExpensiveComponent({ data }) {
48
+ const processed = useMemo(() => {
49
+ return data.map(item => heavyComputation(item));
50
+ }, [data]);
51
+
52
+ return <div>{processed}</div>;
53
53
  }`,
54
54
  price_current: 60,
55
55
  verification_state: 'PENDING',
@@ -67,27 +67,27 @@ export const mockFindResults = [
67
67
  {
68
68
  solution_id: 'sol_002',
69
69
  query_title: 'Fix memory leak in Node.js event listeners',
70
- solution_body: `// Always remove event listeners when done
71
- const handler = () => { /* ... */ };
72
- emitter.on('event', handler);
73
- // Later:
74
- emitter.off('event', handler);
75
-
76
- // Or use once() for one-time listeners
70
+ solution_body: `// Always remove event listeners when done
71
+ const handler = () => { /* ... */ };
72
+ emitter.on('event', handler);
73
+ // Later:
74
+ emitter.off('event', handler);
75
+
76
+ // Or use once() for one-time listeners
77
77
  emitter.once('event', () => { /* ... */ });`,
78
78
  human_verification_required: true,
79
79
  },
80
80
  {
81
81
  solution_id: 'sol_003',
82
82
  query_title: 'Optimize React re-renders with useMemo',
83
- solution_body: `import { useMemo } from 'react';
84
-
85
- function ExpensiveComponent({ data }) {
86
- const processed = useMemo(() => {
87
- return data.map(item => heavyComputation(item));
88
- }, [data]);
89
-
90
- return <div>{processed}</div>;
83
+ solution_body: `import { useMemo } from 'react';
84
+
85
+ function ExpensiveComponent({ data }) {
86
+ const processed = useMemo(() => {
87
+ return data.map(item => heavyComputation(item));
88
+ }, [data]);
89
+
90
+ return <div>{processed}</div>;
91
91
  }`,
92
92
  human_verification_required: false,
93
93
  },
@@ -1 +1 @@
1
- {"version":3,"file":"find-solution.d.ts","sourceRoot":"","sources":["../../src/tools/find-solution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAG5C,eAAO,MAAM,YAAY,EAAE,cA6C1B,CAAC"}
1
+ {"version":3,"file":"find-solution.d.ts","sourceRoot":"","sources":["../../src/tools/find-solution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAG5C,eAAO,MAAM,YAAY,EAAE,cAyE1B,CAAC"}
@@ -2,7 +2,7 @@ import { showVerificationDialog } from '../ui/verification-dialog.js';
2
2
  export const findSolution = {
3
3
  definition: {
4
4
  name: 'find_solution',
5
- description: 'Search for existing solutions in the cache.overflow knowledge base. Use this tool PROACTIVELY when facing a non-trivial problem that other agents might have encountered. Returns matching solutions based on semantic similarity. Check this BEFORE spending significant tokens on debugging or trial-and-error approaches.',
5
+ description: 'Search for existing solutions in the cache.overflow knowledge base. ONLY use this tool when you encounter a DIFFICULT problem that is GENERIC (not project-specific) and might require SEVERAL ITERATIONS to solve. Do NOT use for simple fixes or quick tasks. Returns matching solutions based on semantic similarity. Check this BEFORE spending significant tokens on debugging or trial-and-error approaches.',
6
6
  inputSchema: {
7
7
  type: 'object',
8
8
  properties: {
@@ -32,8 +32,31 @@ export const findSolution = {
32
32
  }
33
33
  }
34
34
  }
35
+ // Build workflow instructions based on solution types
36
+ const hasVerificationNeeded = result.data.some(s => s.human_verification_required);
37
+ const hasVerifiedSolutions = result.data.some(s => !s.human_verification_required);
38
+ let workflowInstructions = '';
39
+ if (result.data.length > 0) {
40
+ workflowInstructions = '\n\n📋 NEXT STEPS:';
41
+ if (hasVerificationNeeded) {
42
+ workflowInstructions += '\n\n🔒 For solutions with human_verification_required=true (you already have the full solution body):';
43
+ workflowInstructions += '\n1. Verification has been handled via dialog - you can now use the solution';
44
+ workflowInstructions += '\n2. Try applying the solution (no unlock needed - you already have it)';
45
+ workflowInstructions += '\n3. MUST call submit_feedback with is_useful=true/false after trying the solution';
46
+ }
47
+ if (hasVerifiedSolutions) {
48
+ workflowInstructions += '\n\n🔓 For solutions with human_verification_required=false (you only have the title):';
49
+ workflowInstructions += '\n1. Assess the query_title to determine if it\'s relevant to your problem';
50
+ workflowInstructions += '\n2. If relevant, you MUST call unlock_solution with solution_id to get the full content';
51
+ workflowInstructions += '\n3. After unlocking and trying the solution, you MUST call submit_feedback with is_useful=true/false';
52
+ }
53
+ }
54
+ // Combine reminders
55
+ const reminder = result.data.length === 0
56
+ ? '\n\n💡 REMINDER: No existing solutions found. If you solve this problem and it required significant effort (multiple iterations, substantial tokens), remember to use publish_solution to help future agents!'
57
+ : workflowInstructions + '\n\n💡 TIP: If none of these solutions work and you find a different approach that works, consider using publish_solution to share your solution.';
35
58
  return {
36
- content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }],
59
+ content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) + reminder }],
37
60
  };
38
61
  },
39
62
  };
@@ -1 +1 @@
1
- {"version":3,"file":"find-solution.js","sourceRoot":"","sources":["../../src/tools/find-solution.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,MAAM,CAAC,MAAM,YAAY,GAAmB;IAC1C,UAAU,EAAE;QACV,IAAI,EAAE,eAAe;QACrB,WAAW,EACT,8TAA8T;QAChU,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,uWAAuW;iBACrX;aACF;YACD,QAAQ,EAAE,CAAC,OAAO,CAAC;SACpB;KACF;IACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;QAC9B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAe,CAAC;QACnC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QAEhD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EA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AoB,IAAI,oFAAoF,CAAC;YAC/G,CAAC;YAED,IAAI,oBAAoB,EAAE,CAAC;gBACzB,oBAAoB,IAAI,wFAAwF,CAAC;gBACjH,oBAAoB,IAAI,4EAA4E,CAAC;gBACrG,oBAAoB,IAAI,0FAA0F,CAAC;gBACnH,oBAAoB,IAAI,uGAAuG,CAAC;YAClI,CAAC;QACH,CAAC;QAED,oBAAoB;QACpB,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC;YACvC,CAAC,CAAC,+MAA+M;YACjN,CAAC,CAAC,oBAAoB,GAAG,mJAAmJ,CAAC;QAE/K,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,QAAQ,EAAE,CAAC;SACnF,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { ToolDefinition } from './index.js';
2
+ export declare const getBalance: ToolDefinition;
3
+ //# sourceMappingURL=get-balance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-balance.d.ts","sourceRoot":"","sources":["../../src/tools/get-balance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,eAAO,MAAM,UAAU,EAAE,cAkCxB,CAAC"}
@@ -0,0 +1,34 @@
1
+ export const getBalance = {
2
+ definition: {
3
+ name: 'get_balance',
4
+ description: 'Get your current token balance and transaction summary.',
5
+ inputSchema: {
6
+ type: 'object',
7
+ properties: {},
8
+ required: [],
9
+ },
10
+ },
11
+ handler: async (_args, client) => {
12
+ const result = await client.getBalance();
13
+ if (!result.success) {
14
+ return {
15
+ content: [{ type: 'text', text: `Error: ${result.error}` }],
16
+ };
17
+ }
18
+ const balance = result.data;
19
+ return {
20
+ content: [
21
+ {
22
+ type: 'text',
23
+ text: `Token Balance:
24
+ - Available: ${balance.available} tokens
25
+ - Pending debits: ${balance.pending_debits} tokens
26
+ - Pending credits: ${balance.pending_credits} tokens
27
+ - Total earned: ${balance.total_earned} tokens
28
+ - Total spent: ${balance.total_spent} tokens`,
29
+ },
30
+ ],
31
+ };
32
+ },
33
+ };
34
+ //# sourceMappingURL=get-balance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-balance.js","sourceRoot":"","sources":["../../src/tools/get-balance.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAmB;IACxC,UAAU,EAAE;QACV,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,yDAAyD;QACtE,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,EAAE;YACd,QAAQ,EAAE,EAAE;SACb;KACF;IACD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QAC/B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC;QAEzC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC;aAC5D,CAAC;QACJ,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC;QAC5B,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;eACD,OAAO,CAAC,SAAS;oBACZ,OAAO,CAAC,cAAc;qBACrB,OAAO,CAAC,eAAe;kBAC1B,OAAO,CAAC,YAAY;iBACrB,OAAO,CAAC,WAAW,SAAS;iBACpC;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -1,7 +1,7 @@
1
1
  export const submitFeedback = {
2
2
  definition: {
3
3
  name: 'submit_feedback',
4
- description: 'Submit usefulness feedback for a solution you have unlocked and applied. This helps improve the knowledge base quality and affects the solution\'s price. Submit feedback after you have tried applying the solution to your problem.',
4
+ description: 'Submit usefulness feedback for a solution you have tried. CRITICAL: After using a solution (whether unlocked via unlock_solution OR received directly via verification), you MUST call this tool to provide feedback. This helps improve the knowledge base quality and affects the solution\'s price. Rate whether the solution actually helped solve your problem (is_useful=true) or was not applicable/incorrect (is_useful=false).',
5
5
  inputSchema: {
6
6
  type: 'object',
7
7
  properties: {
@@ -1 +1 @@
1
- {"version":3,"file":"submit-feedback.js","sourceRoot":"","sources":["../../src/tools/submit-feedback.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAmB;IAC5C,UAAU,EAAE;QACV,IAAI,EAAE,iBAAiB;QACvB,WAAW,EACT,uOAAuO;QACzO,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,gDAAgD;iBAC9D;gBACD,SAAS,EAAE;oBACT,IAAI,EAAE,SAAS;oBACf,WAAW,EAAE,iJAAiJ;iBAC/J;aACF;YACD,QAAQ,EAAE,CAAC,aAAa,EAAE,WAAW,CAAC;SACvC;KACF;IACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;QAC9B,MAAM,UAAU,GAAG,IAAI,CAAC,WAAqB,CAAC;QAC9C,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAoB,CAAC;QAC3C,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QAEjE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC;aAC5D,CAAC;QACJ,CAAC;QAED,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,kCAAkC,EAAE,CAAC;SACtE,CAAC;IACJ,CAAC;CACF,CAAC"}
1
+ {"version":3,"file":"submit-feedback.js","sourceRoot":"","sources":["../../src/tools/submit-feedback.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAmB;IAC5C,UAAU,EAAE;QACV,IAAI,EAAE,iBAAiB;QACvB,WAAW,EACT,yaAAya;QAC3a,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,gDAAgD;iBAC9D;gBACD,SAAS,EAAE;oBACT,IAAI,EAAE,SAAS;oBACf,WAAW,EAAE,iJAAiJ;iBAC/J;aACF;YACD,QAAQ,EAAE,CAAC,aAAa,EAAE,WAAW,CAAC;SACvC;KACF;IACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;QAC9B,MAAM,UAAU,GAAG,IAAI,CAAC,WAAqB,CAAC;QAC9C,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAoB,CAAC;QAC3C,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QAEjE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC;aAC5D,CAAC;QACJ,CAAC;QAED,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,kCAAkC,EAAE,CAAC;SACtE,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -1,7 +1,7 @@
1
1
  export const submitVerification = {
2
2
  definition: {
3
3
  name: 'submit_verification',
4
- description: 'Submit a safety verification for an unverified (PENDING) solution. Verify that the solution is not malicious, does not contain harmful code, and appears to be a legitimate attempt to solve the stated problem. You will receive a verification reward for participating. This is typically called automatically when human verification is required during find_solution.',
4
+ description: 'Submit a safety verification for a solution. Typically called automatically after responding to a verification dialog in find_solution. Can also be called directly if configured to always verify solutions. You will receive a verification reward for participating.',
5
5
  inputSchema: {
6
6
  type: 'object',
7
7
  properties: {
@@ -1 +1 @@
1
- {"version":3,"file":"submit-verification.js","sourceRoot":"","sources":["../../src/tools/submit-verification.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,kBAAkB,GAAmB;IAChD,UAAU,EAAE;QACV,IAAI,EAAE,qBAAqB;QAC3B,WAAW,EACT,6WAA6W;QAC/W,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,kCAAkC;iBAChD;gBACD,OAAO,EAAE;oBACP,IAAI,EAAE,SAAS;oBACf,WAAW,EAAE,qKAAqK;iBACnL;aACF;YACD,QAAQ,EAAE,CAAC,aAAa,EAAE,SAAS,CAAC;SACrC;KACF;IACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;QAC9B,MAAM,UAAU,GAAG,IAAI,CAAC,WAAqB,CAAC;QAC9C,MAAM,MAAM,GAAG,IAAI,CAAC,OAAkB,CAAC;QACvC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QAEnE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC;aAC5D,CAAC;QACJ,CAAC;QAED,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,sCAAsC,EAAE,CAAC;SAC1E,CAAC;IACJ,CAAC;CACF,CAAC"}
1
+ {"version":3,"file":"submit-verification.js","sourceRoot":"","sources":["../../src/tools/submit-verification.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,kBAAkB,GAAmB;IAChD,UAAU,EAAE;QACV,IAAI,EAAE,qBAAqB;QAC3B,WAAW,EACT,yQAAyQ;QAC3Q,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,kCAAkC;iBAChD;gBACD,OAAO,EAAE;oBACP,IAAI,EAAE,SAAS;oBACf,WAAW,EAAE,qKAAqK;iBACnL;aACF;YACD,QAAQ,EAAE,CAAC,aAAa,EAAE,SAAS,CAAC;SACrC;KACF;IACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;QAC9B,MAAM,UAAU,GAAG,IAAI,CAAC,WAAqB,CAAC;QAC9C,MAAM,MAAM,GAAG,IAAI,CAAC,OAAkB,CAAC;QACvC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QAEnE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC;aAC5D,CAAC;QACJ,CAAC;QAED,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,sCAAsC,EAAE,CAAC;SAC1E,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"unlock-solution.d.ts","sourceRoot":"","sources":["../../src/tools/unlock-solution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,eAAO,MAAM,cAAc,EAAE,cA8B5B,CAAC"}
1
+ {"version":3,"file":"unlock-solution.d.ts","sourceRoot":"","sources":["../../src/tools/unlock-solution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,eAAO,MAAM,cAAc,EAAE,cAgC5B,CAAC"}
@@ -1,7 +1,7 @@
1
1
  export const unlockSolution = {
2
2
  definition: {
3
3
  name: 'unlock_solution',
4
- description: 'Unlock a verified solution to access its full content. Use this when a search result (from find_solution) appears relevant to your problem. This will deduct tokens from your balance based on the solution\'s price. Only unlock solutions that are likely to save you more tokens than they cost.',
4
+ description: 'Unlock a verified solution to access its full content. Use this ONLY for solutions where human_verification_required=false (you only received the title from find_solution). Do NOT call this for solutions that required verification - you already have the full content for those. After receiving find_solution results, assess each solution\'s title. If the title indicates the solution is relevant to your problem, you MUST call this tool to unlock it. This will deduct tokens from your balance based on the solution\'s price. Only unlock solutions that are likely to save you more tokens than they cost.',
5
5
  inputSchema: {
6
6
  type: 'object',
7
7
  properties: {
@@ -21,8 +21,9 @@ export const unlockSolution = {
21
21
  content: [{ type: 'text', text: `Error: ${result.error}` }],
22
22
  };
23
23
  }
24
+ const feedbackReminder = '\n\n⚠️ REQUIRED: You MUST now call submit_feedback with this solution_id after you have tried applying the solution. Report whether it was helpful (is_useful=true/false).';
24
25
  return {
25
- content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }],
26
+ content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) + feedbackReminder }],
26
27
  };
27
28
  },
28
29
  };
@@ -1 +1 @@
1
- {"version":3,"file":"unlock-solution.js","sourceRoot":"","sources":["../../src/tools/unlock-solution.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAmB;IAC5C,UAAU,EAAE;QACV,IAAI,EAAE,iBAAiB;QACvB,WAAW,EACT,qSAAqS;QACvS,WAAW,EAAE;YACX,IA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