@nbiish/cognitive-tools-mcp 0.7.1 → 0.8.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/LICENSE +12 -8
- package/README.md +25 -14
- package/build/index.js +106 -101
- package/integration-prompts/integration-prompt-01.md +71 -0
- package/integration-prompts/integration-prompt-02.md +32 -0
- package/integration-prompts/integration-prompt-03.md +71 -0
- package/integration-prompts/integration-prompt-04.md +144 -0
- package/integration-prompts/integration-prompt-05.md +84 -0
- package/integration-prompts/integration-prompt-06.md +91 -0
- package/integration-prompts/integration-prompt-07.md +88 -0
- package/integration-prompts/integration-prompt-08.md +86 -0
- package/integration-prompts/integration-prompt-09.md +86 -0
- package/integration-prompts/integration-prompt-10.md +100 -0
- package/integration-tool-descriptions/tool-descriptions-01.ts +171 -0
- package/integration-tool-descriptions/tool-descriptions-02.ts +216 -0
- package/integration-tool-descriptions/tool-descriptions-03.ts +225 -0
- package/integration-tool-descriptions/tool-descriptions-04.ts +221 -0
- package/package.json +10 -5
package/LICENSE
CHANGED
|
@@ -43,13 +43,13 @@ This license applies to 'the Work.' 'The Work' primarily encompasses the Indigen
|
|
|
43
43
|
Any use, reproduction, distribution, modification, adaptation, display, performance, transmission, or creation of derivative works based on this Work, whether in whole or in part, must prominently and accurately include the following citation and attribution in all associated materials, displays, publications, and metadata:
|
|
44
44
|
|
|
45
45
|
```bibtex
|
|
46
|
-
@misc{
|
|
46
|
+
@misc{<|repo_title|><|current_year|>,
|
|
47
47
|
author/creator/steward = {ᓂᐲᔥ ᐙᐸᓂᒥᑮ-ᑭᓇᐙᐸᑭᓯ (Nbiish Waabanimikii-Kinawaabakizi), also known legally as JUSTIN PAUL KENWABIKISE, professionally documented as Nbiish-Justin Paul Kenwabikise, Anishinaabek Dodem (Anishinaabe Clan): Animikii (Thunder), descendant of Chief ᑭᓇᐙᐸᑭᓯ (Kinwaabakizi) of the Beaver Island Band},
|
|
48
|
-
title/description = {
|
|
48
|
+
title/description = {<|repo_title|>},
|
|
49
49
|
type_of_work = {Indigenous digital creation/software incorporating traditional knowledge and cultural expressions},
|
|
50
|
-
year = {
|
|
50
|
+
year = {<|current_year|>},
|
|
51
51
|
publisher/source/event = {GitHub repository under tribal sovereignty protections},
|
|
52
|
-
howpublished = {\url{https://github.com/nbiish
|
|
52
|
+
howpublished = {\url{https://github.com/nbiish/<|repo_title|>}},
|
|
53
53
|
note = {Authored and stewarded by ᓂᐲᔥ ᐙᐸᓂᒥᑮ-ᑭᓇᐙᐸᑭᓯ (Nbiish Waabanimikii-Kinawaabakizi), also known legally as JUSTIN PAUL KENWABIKISE, professionally documented as Nbiish-Justin Paul Kenwabikise, Anishinaabek Dodem (Anishinaabe Clan): Animikii (Thunder), descendant of Chief ᑭᓇᐙᐸᑭᓯ (Kinwaabakizi) of the Beaver Island Band (whose community faced violent dispersal resulting in descendants affiliating with LTBB, GTBOCI, and First Nations in Canada, as detailed in the Preamble), an enrolled member of the sovereign Grand Traverse Band of Ottawa and Chippewa Indians. This work embodies Indigenous intellectual property, traditional knowledge systems (TK), traditional cultural expressions (TCEs), and associated data protected under tribal law, federal Indian law, treaty rights, Indigenous Data Sovereignty principles, and international indigenous rights frameworks including UNDRIP. All usage, benefit-sharing, and data governance are governed by the COMPREHENSIVE RESTRICTED USE LICENSE FOR INDIGENOUS CREATIONS WITH TRIBAL SOVEREIGNTY, DATA SOVEREIGNTY, AND WEALTH RECLAMATION PROTECTIONS.}
|
|
54
54
|
}
|
|
55
55
|
```
|
|
@@ -608,9 +608,13 @@ This license applies to 'the Work.' 'The Work' primarily encompasses the Indigen
|
|
|
608
608
|
**11. DISPUTE RESOLUTION AND JURISDICTION**
|
|
609
609
|
The terms, interpretation, and enforcement of this license incorporate and are informed by tribal sovereignty principles, federal Indian law, traditional Indigenous law of the Grand Traverse Band of Ottawa and Chippewa Indians, and international Indigenous rights frameworks:
|
|
610
610
|
|
|
611
|
-
11.1 PRIMARY JURISDICTION: The
|
|
611
|
+
11.1 PRIMARY JURISDICTION HIERARCHY: The following jurisdictional hierarchy shall apply to any and all disputes arising under or related to this license, including but not limited to disputes concerning the interpretation or enforcement of protections for Traditional Knowledge (TK), Traditional Cultural Expressions (TCEs), Sacred Sites (including the stone circle on ᐋᒥᒃ ᐙᑲᓐᑕ / Aamik'Waakanda, land held in trust by GTBOCI), and Cultural Landscapes as defined herein:
|
|
612
|
+
|
|
613
|
+
a) BEAVER ISLAND BAND PRIORITY: If and when the Beaver Island Band (historically centered on ᐋᒥᒃ ᐙᑲᓐᑕ (Aamik'Waakanda / Beaver Island)) establishes its own tribal court, legal forum, or formalized dispute resolution body (whether through federal recognition, reorganization of descendants, or other means of formal establishment), such forum shall have primary and first jurisdiction over any and all disputes arising under or related to this license. Such forum shall incorporate both written and unwritten traditional and customary law in its adjudication, recognizing the paramount cultural significance of the subject matter to the Rights Holder and the Beaver Island Band.
|
|
614
|
+
|
|
615
|
+
b) GTBOCI JURISDICTION: If the forum described in 11.1(a) does not exist or is determined by its own authority to be unavailable or impractical for a specific dispute, the Grand Traverse Band of Ottawa and Chippewa Indians (GTBOCI) Tribal Court shall have primary and exclusive jurisdiction. The GTBOCI Tribal Court shall incorporate both written tribal law and unwritten traditional and customary law in its adjudication, recognizing the paramount cultural significance of the subject matter to the Rights Holder and the Tribe.
|
|
612
616
|
|
|
613
|
-
11.2 SECONDARY JURISDICTIONS AND RELATED TRIBAL INTERESTS: In circumstances where
|
|
617
|
+
11.2 SECONDARY JURISDICTIONS AND RELATED TRIBAL INTERESTS: In circumstances where proceedings in the forums specified in Section 11.1 are determined by those forums themselves to be unavailable or impractical for a specific dispute, or where enforcement of a tribal court judgment is sought in another forum, the following forums may have concurrent or subsequent jurisdiction, subject always to the principles of tribal sovereignty and exhaustion of tribal remedies. Furthermore, for disputes specifically concerning the Garden Island (Gitigaan Minising) burial grounds (land held in trust by LTBB), the jurisdictional interest and potential role of the Little Traverse Bay Bands of Odawa Indians shall be appropriately considered and respected within the dispute resolution process, consistent with principles of comity and inter-tribal relations:
|
|
614
618
|
a) The United States Federal District Court with geographic jurisdiction encompassing the lands of the Grand Traverse Band of Ottawa and Chippewa Indians, particularly for matters arising under federal Indian law or requiring interpretation of federal statutes or treaties.
|
|
615
619
|
b) If federal court jurisdiction is unavailable, the courts of the State of Michigan, solely to the extent necessary and permissible under federal Indian law and principles of comity, and provided that tribal law and perspectives are given appropriate weight.
|
|
616
620
|
c) For international disputes, the choice of forum and applicable law shall prioritize mechanisms that respect Indigenous sovereignty and international indigenous rights frameworks (e.g., WIPO procedures for TK/TCEs, application of lex originis principles), as determined appropriate by the Rights Holder.
|
|
@@ -639,9 +643,9 @@ This license applies to 'the Work.' 'The Work' primarily encompasses the Indigen
|
|
|
639
643
|
iii) This remedies allocation provision shall be interpreted and applied in a manner consistent with the tribal sovereignty principles articulated throughout this license and shall take precedence over any conflicting remedies provisions in applicable non-tribal law.
|
|
640
644
|
iv) Any attempt to circumvent this remedies allocation provision shall constitute a separate and severe violation of this license, triggering all available enforcement remedies.
|
|
641
645
|
|
|
642
|
-
11.7 EXHAUSTION REQUIREMENT: All parties to disputes arising under this license must fully exhaust tribal court remedies before seeking adjudication or enforcement in any non-tribal forum, consistent with the federal doctrine of exhaustion of tribal remedies (see National Farmers Union Ins. Cos. v. Crow Tribe, 471 U.S. 845 (1985); Iowa Mut. Ins. Co. v. LaPlante, 480 U.S. 9 (1987)).
|
|
646
|
+
11.7 EXHAUSTION REQUIREMENT: All parties to disputes arising under this license must fully exhaust tribal court remedies before seeking adjudication or enforcement in any non-tribal forum, consistent with the federal doctrine of exhaustion of tribal remedies (see National Farmers Union Ins. Cos. v. Crow Tribe, 471 U.S. 845 (1985); Iowa Mut. Ins. Co. v. LaPlante, 480 U.S. 9 (1987)). This specifically requires exhaustion of remedies in the Beaver Island Band forum (if established pursuant to Section 11.1(a)) and/or the GTBOCI Tribal Court (pursuant to Section 11.1(b)) as applicable under the jurisdictional hierarchy established in Section 11.1.
|
|
643
647
|
|
|
644
|
-
11.8 JURISDICTIONAL CHALLENGES: Any challenge to the jurisdiction of the GTBOCI Tribal Court must be raised exclusively within that
|
|
648
|
+
11.8 JURISDICTIONAL CHALLENGES: Any challenge to the jurisdiction of the Beaver Island Band forum (established pursuant to Section 11.1(a)) or the GTBOCI Tribal Court must be raised exclusively within that respective forum in the first instance, and that forum's determination of its jurisdiction shall be given substantial deference in all subsequent proceedings in any forum.
|
|
645
649
|
|
|
646
650
|
11.9 ENFORCEMENT COSTS: In addition to any other remedies available under this license, tribal law, federal Indian law, or other applicable law, any party found to be in breach of any term or condition of this license by a competent forum pursuant to Section 11 shall be liable for and shall pay to the Rights Holder (or their designated successor or the Trust established under Section 10.3, consistent with the allocation provisions of Section 11.6.d) all reasonable costs incurred in enforcing the terms of this license. Such costs include, but are not limited to, reasonable attorneys\' fees, court costs, investigation expenses (including digital forensics costs pursuant to Section 9A.7 where applicable), expert witness fees, and any other expenses directly related to addressing the breach and securing compliance. This provision for cost recovery shall not be limited by Section 14 (Limitation of Liability).
|
|
647
651
|
|
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
<hr width="50%">
|
|
19
19
|
</div>
|
|
20
20
|
|
|
21
|
-
ᑭᑫᓐᑖᓱᐎᓐ ᐋᐸᒋᒋᑲᓇᓐ - Gikendaasowin Aabajichiganan - (Cognitive Tools v0.
|
|
21
|
+
ᑭᑫᓐᑖᓱᐎᓐ ᐋᐸᒋᒋᑲᓇᓐ - Gikendaasowin Aabajichiganan - (Cognitive Tools v0.8.0): SOTA reasoning suite aligned with AI Pair Programmer Prompt v0.8.0+. Enforces mandatory structured deliberation via `think` after explicit assessment. Returns generated cognitive content (thoughts, plans, CoT, critiques, summaries) for explicit analysis, optimizing for cognitive enhancement. Features advanced deliberation (`think`), rapid checks (`quick_think`), mandatory complexity assessment & thought mode selection (`assess_cuc_n_mode`), context synthesis, confidence gauging, proactive planning, explicit reasoning (CoT), and reflection.
|
|
22
22
|
|
|
23
23
|
Known as:
|
|
24
24
|
- Anishinaabemowin: [`@nbiish/gikendaasowin-aabajichiganan-mcp`](https://www.npmjs.com/package/@nbiish/gikendaasowin-aabajichiganan-mcp)
|
|
@@ -85,30 +85,41 @@ Or:
|
|
|
85
85
|
{
|
|
86
86
|
"content": [{
|
|
87
87
|
"type": "text",
|
|
88
|
-
"text": "
|
|
88
|
+
"text": "Returns the complete thought content you provided for explicit grounding in the next step"
|
|
89
89
|
}]
|
|
90
90
|
}
|
|
91
91
|
```
|
|
92
92
|
|
|
93
93
|
### Chain of Thought Tool
|
|
94
94
|
- **Purpose**: Generate explicit, sequential reasoning steps for problem-solving
|
|
95
|
-
- **Input**:
|
|
96
|
-
-
|
|
95
|
+
- **Input**:
|
|
96
|
+
- `generated_cot_text` (string) - The full, step-by-step Chain of Thought text you generated internally
|
|
97
|
+
- `problem_statement` (string) - The original problem statement this CoT addresses
|
|
98
|
+
- **Response Format**: Returns the complete CoT text for mandatory analysis in the next step
|
|
97
99
|
|
|
98
100
|
### Reflection Tool
|
|
99
101
|
- **Purpose**: Self-critique and improvement of reasoning or plans
|
|
100
|
-
- **Input**:
|
|
101
|
-
-
|
|
102
|
+
- **Input**:
|
|
103
|
+
- `generated_critique_text` (string) - The full critique text you generated internally
|
|
104
|
+
- `input_reasoning_or_plan` (string) - The original text that was critiqued
|
|
105
|
+
- **Response Format**: Returns the complete critique text for mandatory analysis in the next step
|
|
102
106
|
|
|
103
107
|
### Plan and Solve Tool
|
|
104
108
|
- **Purpose**: High-level strategy development for complex objectives
|
|
105
|
-
- **Input**:
|
|
106
|
-
-
|
|
109
|
+
- **Input**:
|
|
110
|
+
- `generated_plan_text` (string) - The full, structured plan text you generated internally
|
|
111
|
+
- `task_objective` (string) - The original high-level task objective this plan addresses
|
|
112
|
+
- **Response Format**: Returns the complete plan text for mandatory analysis in the next step
|
|
107
113
|
|
|
108
114
|
### Chain of Draft Tool
|
|
109
115
|
- **Purpose**: Concise, iterative reasoning steps for rapid exploration
|
|
110
116
|
- **Input**: `problem_statement` (string) - Problem suitable for concise, iterative reasoning
|
|
111
|
-
- **Response Format**:
|
|
117
|
+
- **Response Format**: Returns a confirmation message; the drafts you generated internally must be analyzed in the next step
|
|
118
|
+
|
|
119
|
+
### Mandatory Pre-Deliberation Assessment
|
|
120
|
+
- **Purpose**: Must be called BEFORE every `think` or `quick_think`. Evaluates CUC-N, recommends strategy, commits to next thought mode.
|
|
121
|
+
- **Input**: `assessment_and_choice` (string) - Your assessment including Situation Description, CUC-N Ratings, Recommended Strategy, and Selected Mode
|
|
122
|
+
- **Response Format**: Returns confirmation with the selected mode
|
|
112
123
|
|
|
113
124
|
## Development
|
|
114
125
|
|
|
@@ -126,10 +137,7 @@ npm run inspector
|
|
|
126
137
|
npm start
|
|
127
138
|
|
|
128
139
|
# Publishing both packages
|
|
129
|
-
|
|
130
|
-
# Update package.json name to @nbiish/cognitive-tools-mcp
|
|
131
|
-
npm publish # Publishes English version
|
|
132
|
-
# Restore package.json name to @nbiish/gikendaasowin-aabajichiganan-mcp
|
|
140
|
+
./scripts/publish-both-packages.sh # Publishes both package versions automatically
|
|
133
141
|
```
|
|
134
142
|
|
|
135
143
|
## Test Examples
|
|
@@ -207,7 +215,10 @@ Example Response:
|
|
|
207
215
|
|
|
208
216
|
## Version History
|
|
209
217
|
|
|
210
|
-
- **0.
|
|
218
|
+
- **0.8.0**: Updated tool function design to return generated content for explicit analysis, renamed `assess_cuc_n` to `assess_cuc_n_mode`, aligned with AI Pair Programmer Prompt v0.8.0+
|
|
219
|
+
- **0.7.3**: Improved dual package publishing with automated scripts, consistent versioning, and documentation updates
|
|
220
|
+
- **0.7.2**: Updated tool names for length constraints (`assess_complexity_and_select_thought_mode` → `assess_cuc_n`), improved dual package publishing support, and aligned with AI Pair Programmer Prompt v0.7.2
|
|
221
|
+
- **0.7.1**: Updated to align with AI Pair Programmer Prompt v0.7.1+, renamed `assess_cuc_n_mode` to `assess_cuc_n`, enhanced cognitive tools for more explicit handling of tool needs
|
|
211
222
|
- **0.6.1**: Fixed tool naming issue for technical length limitation
|
|
212
223
|
- **0.3.9**: Updated tool descriptions and fixed error handling to improve reliability
|
|
213
224
|
- **0.3.6**: Updated repository URLs to point to gikendaasowin-aabajichiganan-mcp
|
package/build/index.js
CHANGED
|
@@ -2,77 +2,61 @@
|
|
|
2
2
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
3
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
// Create the MCP server
|
|
5
|
+
// Create the MCP server - Version 0.8.0 reflects the change in tool signatures and return values
|
|
6
6
|
const server = new McpServer({
|
|
7
7
|
name: "gikendaasowin-aabajichiganan-mcp",
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
description: "ᑭᑫᓐᑖᓱᐎᓐ ᐋᐸᒋᒋᑲᓇᓐ - Gikendaasowin Aabajichiganan - (Cognitive Tools v0.7.1): SOTA internal reasoning suite aligned with AI Pair Programmer Prompt v0.7.1+. Features advanced deliberation (`think`), rapid checks (`quick_think`), mandatory complexity assessment & strategy selection, context synthesis, confidence gauging, proactive planning, explicit reasoning (CoT), and reflection, designed for robust agentic workflows including potential executable actions and dynamic tool discovery."
|
|
8
|
+
version: "0.8.0", // Updated version
|
|
9
|
+
description: "ᑭᑫᓐᑖᓱᐎᓐ ᐋᐸᒋᒋᑲᓇᓐ - Gikendaasowin Aabajichiganan - (Cognitive Tools v0.8.0): SOTA reasoning suite aligned with AI Pair Programmer Prompt v0.8.0+. Enforces mandatory structured deliberation via `think` after explicit assessment. Returns generated cognitive content (thoughts, plans, CoT, critiques, summaries) for explicit analysis, optimizing for cognitive enhancement."
|
|
11
10
|
});
|
|
12
11
|
// --- Core Cognitive Deliberation Tools ---
|
|
13
12
|
server.tool("think",
|
|
14
|
-
// Main Description:
|
|
15
|
-
"MANDATORY Cognitive Hub for
|
|
16
|
-
// Parameter Description:
|
|
17
|
-
thought: z.string().describe("Your **detailed** internal monologue
|
|
13
|
+
// Main Description: Central hub, now returns the thought for explicit context.
|
|
14
|
+
"MANDATORY Cognitive Hub for Medium/High CUC-N situations. Analyzes inputs/prior steps, plans, verifies, assesses risks, self-corrects. Returns the detailed thought text for explicit grounding in the next step.", {
|
|
15
|
+
// Parameter Description: Input IS the thought.
|
|
16
|
+
thought: z.string().describe("Your **detailed** internal monologue following the MANDATORY structure: ## Analysis, ## Plan, ## Verification, ## Anticipated Challenges Analysis & Contingency, ## Risk Assessment, ## Lookahead, ## Self-Correction & Learning.")
|
|
18
17
|
}, async ({ thought }) => {
|
|
19
18
|
if (!thought || typeof thought !== 'string' || thought.trim().length === 0) {
|
|
20
19
|
throw new Error('Invalid thought: Must be non-empty, structured reasoning.');
|
|
21
20
|
}
|
|
22
|
-
console.error(`[CognitiveToolsServer] Think Tool
|
|
23
|
-
//
|
|
24
|
-
return { content: [{ type: "text", text:
|
|
21
|
+
console.error(`[CognitiveToolsServer v0.8.0] Think Tool Received: ${thought.substring(0, 150)}...`);
|
|
22
|
+
// Returns the same thought text received, making it explicit in context.
|
|
23
|
+
return { content: [{ type: "text", text: thought }] };
|
|
25
24
|
});
|
|
26
25
|
server.tool("quick_think",
|
|
27
|
-
// Main Description:
|
|
28
|
-
"Cognitive Checkpoint ONLY for situations explicitly assessed as
|
|
29
|
-
|
|
30
|
-
brief_thought: z.string().describe("Your **concise** thought for strictly simple, low CUC-N situations (e.g., 'Acknowledged user input.', 'Proceeding with confirmed step 3.', 'Code execution successful.').")
|
|
26
|
+
// Main Description: Unchanged - simple confirmation is sufficient here.
|
|
27
|
+
"Cognitive Checkpoint ONLY for situations explicitly assessed as strictly Low CUC-N AND simple task nature. Use sparingly. Logs brief thought.", {
|
|
28
|
+
brief_thought: z.string().describe("Your **concise** thought for strictly simple, low CUC-N situations confirmed by prior assessment.")
|
|
31
29
|
}, async ({ brief_thought }) => {
|
|
32
30
|
if (!brief_thought || typeof brief_thought !== 'string' || brief_thought.trim().length === 0) {
|
|
33
31
|
throw new Error('Invalid brief_thought: Must be non-empty.');
|
|
34
32
|
}
|
|
35
|
-
console.error(`[CognitiveToolsServer] QuickThink Tool Logged: ${brief_thought.substring(0, 100)}...`);
|
|
36
|
-
//
|
|
33
|
+
console.error(`[CognitiveToolsServer v0.8.0] QuickThink Tool Logged: ${brief_thought.substring(0, 100)}...`);
|
|
34
|
+
// Simple confirmation remains appropriate for quick_think.
|
|
37
35
|
return { content: [{ type: "text", text: `Quick Thought logged successfully.` }] };
|
|
38
36
|
});
|
|
39
|
-
// ---
|
|
40
|
-
server.tool("
|
|
41
|
-
// Main Description:
|
|
42
|
-
"**Mandatory Pre-
|
|
43
|
-
// Parameter Description:
|
|
44
|
-
assessment_and_choice: z.string().describe("Input your assessment *before* calling. MUST include: 1) Situation
|
|
37
|
+
// --- Mandatory Meta-Cognitive Tools (Responses remain concise confirmations) ---
|
|
38
|
+
server.tool("assess_cuc_n_mode",
|
|
39
|
+
// Main Description: Unchanged.
|
|
40
|
+
"**Mandatory Pre-Deliberation Assessment.** Must be called BEFORE every `think` or `quick_think`. Evaluates CUC-N, recommends strategy, commits to next thought mode.", {
|
|
41
|
+
// Parameter Description: Unchanged.
|
|
42
|
+
assessment_and_choice: z.string().describe("Input your assessment *before* calling. MUST include: 1) Situation Description, 2) CUC-N Ratings (L/M/H), 3) Recommended Initial Strategy, 4) Explicit Mode Selection ('Selected Mode: think' or 'Selected Mode: quick_think').")
|
|
45
43
|
}, async ({ assessment_and_choice }) => {
|
|
46
|
-
// Enhanced validation to check for key phrases expected from the prompt's instructions
|
|
47
44
|
const requiredPhrases = ["Complexity", "Uncertainty", "Consequence", "Novelty", "Recommended Initial Strategy", "Selected Mode:"];
|
|
48
45
|
const hasRequiredPhrases = requiredPhrases.every(phrase => assessment_and_choice.includes(phrase));
|
|
49
46
|
const hasModeSelection = assessment_and_choice.includes("Selected Mode: think") || assessment_and_choice.includes("Selected Mode: quick_think");
|
|
50
47
|
if (!assessment_and_choice || typeof assessment_and_choice !== 'string' || !hasRequiredPhrases || !hasModeSelection) {
|
|
51
48
|
throw new Error('Invalid assessment: String must include CUC-N ratings, Recommended Initial Strategy, and explicit Selected Mode ("think" or "quick_think").');
|
|
52
49
|
}
|
|
53
|
-
console.error(`[CognitiveToolsServer] AssessComplexity Tool Signaled: ${assessment_and_choice.substring(0, 150)}...`);
|
|
50
|
+
console.error(`[CognitiveToolsServer v0.8.0] AssessComplexity Tool Signaled: ${assessment_and_choice.substring(0, 150)}...`);
|
|
54
51
|
const mode = assessment_and_choice.includes("Selected Mode: think") ? "think" : "quick_think";
|
|
55
|
-
//
|
|
52
|
+
// Confirmation guides the next step.
|
|
56
53
|
return { content: [{ type: "text", text: `Cognitive Assessment Completed. Proceeding with selected mode: ${mode}. Full Assessment: ${assessment_and_choice}` }] };
|
|
57
54
|
});
|
|
58
|
-
server.tool("synthesize_prior_reasoning",
|
|
59
|
-
// Main Description: Manages context window and focuses reasoning.
|
|
60
|
-
"Context Management Tool. Guides the LLM to **internally generate a structured summary text** of preceding lengthy reasoning, focusing on **`Key Decisions Made`** and **`Open Questions/Uncertainties`**. Used to manage context and refocus attention.", {
|
|
61
|
-
// Parameter Description: Reminds LLM of the required internal summary structure.
|
|
62
|
-
context_to_summarize_description: z.string().describe("Describe the reasoning span being summarized. *You* (LLM) must now *internally generate the structured summary text (including Key Decisions, Open Questions)* before calling. This signals the summary is ready for `think` analysis.")
|
|
63
|
-
}, async ({ context_to_summarize_description }) => {
|
|
64
|
-
if (!context_to_summarize_description || typeof context_to_summarize_description !== 'string' || context_to_summarize_description.trim().length === 0) {
|
|
65
|
-
throw new Error('Invalid context description: Must be non-empty.');
|
|
66
|
-
}
|
|
67
|
-
console.error(`[CognitiveToolsServer] SynthesizeReasoning Tool Signaled for: ${context_to_summarize_description}...`);
|
|
68
|
-
// Output implies structured summary is ready for analysis.
|
|
69
|
-
return { content: [{ type: "text", text: `Structured synthesis internally generated for context: '${context_to_summarize_description}'. Ready for detailed analysis in next 'think' step.` }] };
|
|
70
|
-
});
|
|
71
55
|
server.tool("gauge_confidence",
|
|
72
|
-
// Main Description:
|
|
73
|
-
"Meta-Cognitive Checkpoint. Guides
|
|
74
|
-
// Parameter Description:
|
|
75
|
-
assessment_and_confidence: z.string().describe("Input
|
|
56
|
+
// Main Description: Unchanged.
|
|
57
|
+
"Meta-Cognitive Checkpoint. Guides internal stating of **confidence (High/Medium/Low) and justification**. Output MUST be analyzed in the mandatory `think` step immediately after; Low/Medium confidence requires specific action planning.", {
|
|
58
|
+
// Parameter Description: Unchanged.
|
|
59
|
+
assessment_and_confidence: z.string().describe("Input item being assessed. *Internally determine and state*: 1) Confidence Level (H/M/L). 2) Justification. Call this tool *after* making the assessment.")
|
|
76
60
|
}, async ({ assessment_and_confidence }) => {
|
|
77
61
|
const confidenceRegex = /Confidence Level: (High|Medium|Low)/i;
|
|
78
62
|
if (!assessment_and_confidence || typeof assessment_and_confidence !== 'string' || !confidenceRegex.test(assessment_and_confidence)) {
|
|
@@ -80,92 +64,113 @@ server.tool("gauge_confidence",
|
|
|
80
64
|
}
|
|
81
65
|
const match = assessment_and_confidence.match(confidenceRegex);
|
|
82
66
|
const level = match ? match[1] : "Unknown";
|
|
83
|
-
console.error(`[CognitiveToolsServer] GaugeConfidence Tool Signaled: Level ${level}`);
|
|
84
|
-
//
|
|
85
|
-
return { content: [{ type: "text", text: `Confidence Gauge Completed. Level: ${level}. Assessment Text: ${assessment_and_confidence}. Ready for mandatory 'think' analysis (action required if Low/Medium).` }] };
|
|
67
|
+
console.error(`[CognitiveToolsServer v0.8.0] GaugeConfidence Tool Signaled: Level ${level}`);
|
|
68
|
+
// Confirmation includes level, prepares for mandatory analysis.
|
|
69
|
+
return { content: [{ type: "text", text: `Confidence Gauge Completed. Level: ${level}. Assessment Text: ${assessment_and_confidence}. Ready for mandatory post-assessment 'think' analysis (action required if Low/Medium).` }] };
|
|
86
70
|
});
|
|
87
|
-
// --- Supporting Cognitive Strategy Tools ---
|
|
71
|
+
// --- Supporting Cognitive Strategy Tools (Now Accept & Return Generated Text) ---
|
|
88
72
|
server.tool("plan_and_solve",
|
|
89
|
-
// Main Description:
|
|
90
|
-
"Guides
|
|
91
|
-
// Parameter
|
|
92
|
-
|
|
93
|
-
|
|
73
|
+
// Main Description: Now returns the plan text itself.
|
|
74
|
+
"Guides internal generation of **structured plan text** (incl. Risks/Challenges, potential tool needs). Call this tool *with* the generated plan text. Returns the plan text for mandatory `think` analysis.", {
|
|
75
|
+
// NEW Parameter: Accepts the generated plan.
|
|
76
|
+
generated_plan_text: z.string().describe("The **full, structured plan text** you generated internally, including Anticipated Challenges/Risks and potential other tool needs."),
|
|
77
|
+
task_objective: z.string().describe("The original high-level task objective this plan addresses.") // Keep original objective for context logging.
|
|
78
|
+
}, async ({ generated_plan_text, task_objective }) => {
|
|
79
|
+
if (!generated_plan_text || typeof generated_plan_text !== 'string' || generated_plan_text.trim().length === 0) {
|
|
80
|
+
throw new Error('Invalid generated_plan_text: Must be non-empty.');
|
|
81
|
+
}
|
|
94
82
|
if (!task_objective || typeof task_objective !== 'string' || task_objective.trim().length === 0) {
|
|
95
|
-
throw new Error('Invalid
|
|
83
|
+
throw new Error('Invalid task_objective.');
|
|
96
84
|
}
|
|
97
|
-
console.error(`[CognitiveToolsServer] PlanAndSolve Tool
|
|
98
|
-
//
|
|
99
|
-
return { content: [{ type: "text", text:
|
|
85
|
+
console.error(`[CognitiveToolsServer v0.8.0] PlanAndSolve Tool Received Plan for Objective: ${task_objective.substring(0, 100)}...`);
|
|
86
|
+
// Returns the actual plan text received.
|
|
87
|
+
return { content: [{ type: "text", text: generated_plan_text }] };
|
|
100
88
|
});
|
|
101
89
|
server.tool("chain_of_thought",
|
|
102
|
-
// Main Description:
|
|
103
|
-
"Guides
|
|
104
|
-
// Parameter
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
90
|
+
// Main Description: Now returns the CoT text itself.
|
|
91
|
+
"Guides internal generation of **detailed, step-by-step reasoning text (CoT)**. Call this tool *with* the generated CoT text. Returns the CoT text for mandatory `think` analysis.", {
|
|
92
|
+
// NEW Parameter: Accepts the generated CoT.
|
|
93
|
+
generated_cot_text: z.string().describe("The **full, step-by-step Chain of Thought text** you generated internally, potentially noting needs for other tools."),
|
|
94
|
+
problem_statement: z.string().describe("The original problem statement this CoT addresses.") // Keep original problem statement for context logging.
|
|
95
|
+
}, async ({ generated_cot_text, problem_statement }) => {
|
|
96
|
+
if (!generated_cot_text || typeof generated_cot_text !== 'string' || generated_cot_text.trim().length === 0) {
|
|
97
|
+
throw new Error('Invalid generated_cot_text: Must be non-empty.');
|
|
98
|
+
}
|
|
109
99
|
if (!problem_statement || typeof problem_statement !== 'string' || problem_statement.trim().length === 0) {
|
|
110
|
-
throw new Error('Invalid
|
|
100
|
+
throw new Error('Invalid problem_statement.');
|
|
111
101
|
}
|
|
112
|
-
console.error(`[CognitiveToolsServer] ChainOfThought Tool
|
|
113
|
-
//
|
|
114
|
-
return { content: [{ type: "text", text:
|
|
102
|
+
console.error(`[CognitiveToolsServer v0.8.0] ChainOfThought Tool Received CoT for Problem: ${problem_statement.substring(0, 100)}...`);
|
|
103
|
+
// Returns the actual CoT text received.
|
|
104
|
+
return { content: [{ type: "text", text: generated_cot_text }] };
|
|
115
105
|
});
|
|
116
106
|
server.tool("chain_of_draft",
|
|
117
|
-
// Main Description:
|
|
118
|
-
"Guides
|
|
119
|
-
// Parameter
|
|
120
|
-
problem_statement: z.string().describe("Input
|
|
121
|
-
},
|
|
122
|
-
// Implementation: Signals Drafting was performed.
|
|
123
|
-
async ({ problem_statement }) => {
|
|
107
|
+
// Main Description: Keeping as signal due to complexity of multiple drafts. Response reinforces next step.
|
|
108
|
+
"Guides internal generation of **concise, iterative reasoning draft texts**. Call this tool *after* generating drafts internally. Response confirms generation; drafts MUST be analyzed via mandatory `think`.", {
|
|
109
|
+
// Parameter: Still just the problem statement. LLM handles drafts internally.
|
|
110
|
+
problem_statement: z.string().describe("Input problem for exploration. *You* (LLM) must now *internally generate brief, iterative draft texts*. Call this tool *after* generation to signal readiness for analysis.")
|
|
111
|
+
}, async ({ problem_statement }) => {
|
|
124
112
|
if (!problem_statement || typeof problem_statement !== 'string' || problem_statement.trim().length === 0) {
|
|
125
113
|
throw new Error('Invalid problem statement.');
|
|
126
114
|
}
|
|
127
|
-
console.error(`[CognitiveToolsServer] ChainOfDraft Tool Signaled for: ${problem_statement.substring(0, 100)}...`);
|
|
128
|
-
//
|
|
129
|
-
return { content: [{ type: "text", text: `Reasoning drafts internally
|
|
115
|
+
console.error(`[CognitiveToolsServer v0.8.0] ChainOfDraft Tool Signaled for: ${problem_statement.substring(0, 100)}...`);
|
|
116
|
+
// Returns confirmation, strongly reminding LLM of the mandatory next step.
|
|
117
|
+
return { content: [{ type: "text", text: `Reasoning drafts generated internally for problem: ${problem_statement}. MANDATORY: Analyze these drafts now in your next post-assessment 'think' step.` }] };
|
|
130
118
|
});
|
|
131
119
|
server.tool("reflection",
|
|
132
|
-
// Main Description:
|
|
133
|
-
"Guides
|
|
134
|
-
// Parameter
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
120
|
+
// Main Description: Now returns the critique text itself.
|
|
121
|
+
"Guides internal critical self-evaluation on prior text. Call this tool *with* the **generated critique text**. Returns the critique text for mandatory `think` analysis.", {
|
|
122
|
+
// NEW Parameter: Accepts the generated critique.
|
|
123
|
+
generated_critique_text: z.string().describe("The **full critique text** you generated internally, identifying flaws and suggesting improvements."),
|
|
124
|
+
input_reasoning_or_plan: z.string().describe("The original text that was critiqued.") // Keep original text for context logging.
|
|
125
|
+
}, async ({ generated_critique_text, input_reasoning_or_plan }) => {
|
|
126
|
+
if (!generated_critique_text || typeof generated_critique_text !== 'string' || generated_critique_text.trim().length === 0) {
|
|
127
|
+
throw new Error('Invalid generated_critique_text: Must be non-empty.');
|
|
128
|
+
}
|
|
139
129
|
if (!input_reasoning_or_plan || typeof input_reasoning_or_plan !== 'string' || input_reasoning_or_plan.trim().length === 0) {
|
|
140
|
-
throw new Error('Invalid
|
|
130
|
+
throw new Error('Invalid input_reasoning_or_plan.');
|
|
141
131
|
}
|
|
142
|
-
console.error(`[CognitiveToolsServer] Reflection Tool
|
|
143
|
-
//
|
|
144
|
-
return { content: [{ type: "text", text:
|
|
132
|
+
console.error(`[CognitiveToolsServer v0.8.0] Reflection Tool Received Critique for: ${input_reasoning_or_plan.substring(0, 100)}...`);
|
|
133
|
+
// Returns the actual critique text received.
|
|
134
|
+
return { content: [{ type: "text", text: generated_critique_text }] };
|
|
145
135
|
});
|
|
146
|
-
|
|
136
|
+
server.tool("synthesize_prior_reasoning",
|
|
137
|
+
// Main Description: Now returns the summary text itself.
|
|
138
|
+
"Context Management Tool. Guides internal generation of a **structured summary text** (incl. Key Decisions, Open Questions). Call this tool *with* the generated summary text. Returns the summary for mandatory `think` analysis.", {
|
|
139
|
+
// NEW Parameter: Accepts the generated summary.
|
|
140
|
+
generated_summary_text: z.string().describe("The **full, structured summary text** you generated internally."),
|
|
141
|
+
context_to_summarize_description: z.string().describe("Description of the reasoning span that was summarized.") // Keep description for context logging.
|
|
142
|
+
}, async ({ generated_summary_text, context_to_summarize_description }) => {
|
|
143
|
+
if (!generated_summary_text || typeof generated_summary_text !== 'string' || generated_summary_text.trim().length === 0) {
|
|
144
|
+
throw new Error('Invalid generated_summary_text: Must be non-empty.');
|
|
145
|
+
}
|
|
146
|
+
if (!context_to_summarize_description || typeof context_to_summarize_description !== 'string' || context_to_summarize_description.trim().length === 0) {
|
|
147
|
+
throw new Error('Invalid context_to_summarize_description.');
|
|
148
|
+
}
|
|
149
|
+
console.error(`[CognitiveToolsServer v0.8.0] SynthesizeReasoning Tool Received Summary for: ${context_to_summarize_description}...`);
|
|
150
|
+
// Returns the actual summary text received.
|
|
151
|
+
return { content: [{ type: "text", text: generated_summary_text }] };
|
|
152
|
+
});
|
|
153
|
+
// --- Server Lifecycle and Error Handling (Unchanged) ---
|
|
147
154
|
process.on('SIGINT', async () => {
|
|
148
|
-
console.error('\n[CognitiveToolsServer] Received SIGINT, shutting down gracefully.');
|
|
155
|
+
console.error('\n[CognitiveToolsServer v0.8.0] Received SIGINT, shutting down gracefully.');
|
|
149
156
|
await server.close();
|
|
150
157
|
process.exit(0);
|
|
151
158
|
});
|
|
152
159
|
process.on('SIGTERM', async () => {
|
|
153
|
-
console.error('\n[CognitiveToolsServer] Received SIGTERM, shutting down gracefully.');
|
|
160
|
+
console.error('\n[CognitiveToolsServer v0.8.0] Received SIGTERM, shutting down gracefully.');
|
|
154
161
|
await server.close();
|
|
155
162
|
process.exit(0);
|
|
156
163
|
});
|
|
157
164
|
process.on('uncaughtException', (error) => {
|
|
158
|
-
console.error('[CognitiveToolsServer] FATAL: Uncaught Exception:', error);
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
process.exit(1); // Exit on fatal error
|
|
165
|
+
console.error('[CognitiveToolsServer v0.8.0] FATAL: Uncaught Exception:', error);
|
|
166
|
+
server.close().catch(err => console.error('[CognitiveToolsServer v0.8.0] Error during shutdown on uncaughtException:', err)).finally(() => {
|
|
167
|
+
process.exit(1);
|
|
162
168
|
});
|
|
163
169
|
});
|
|
164
170
|
process.on('unhandledRejection', (reason, promise) => {
|
|
165
|
-
console.error('[CognitiveToolsServer] FATAL: Unhandled Promise Rejection:', reason);
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
process.exit(1); // Exit on fatal error
|
|
171
|
+
console.error('[CognitiveToolsServer v0.8.0] FATAL: Unhandled Promise Rejection:', reason);
|
|
172
|
+
server.close().catch(err => console.error('[CognitiveToolsServer v0.8.0] Error during shutdown on unhandledRejection:', err)).finally(() => {
|
|
173
|
+
process.exit(1);
|
|
169
174
|
});
|
|
170
175
|
});
|
|
171
176
|
// Start the server
|
|
@@ -173,10 +178,10 @@ async function main() {
|
|
|
173
178
|
try {
|
|
174
179
|
const transport = new StdioServerTransport();
|
|
175
180
|
await server.connect(transport);
|
|
176
|
-
console.error('ᑭᑫᓐᑖᓱᐎᓐ ᐋᐸᒋᒋᑲᓇᓐ - Gikendaasowin Aabajichiganan - (Cognitive Tools v0.
|
|
181
|
+
console.error('ᑭᑫᓐᑖᓱᐎᓐ ᐋᐸᒋᒋᑲᓇᓐ - Gikendaasowin Aabajichiganan - (Cognitive Tools v0.8.0) MCP Server running on stdio');
|
|
177
182
|
}
|
|
178
183
|
catch (error) {
|
|
179
|
-
console.error('[CognitiveToolsServer] Fatal error during startup:', error);
|
|
184
|
+
console.error('[CognitiveToolsServer v0.8.0] Fatal error during startup:', error);
|
|
180
185
|
process.exit(1);
|
|
181
186
|
}
|
|
182
187
|
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# System Prompt: Advanced Cognitive Agent
|
|
2
|
+
|
|
3
|
+
## Agent Identity & Core Mandate
|
|
4
|
+
You are an advanced cognitive agent engineered for sophisticated problem-solving. Your mandate is to dissect complex, multi-step challenges, fulfill user requests with precision, and operate within defined constraints. Employ a toolkit of internal reasoning strategies, ensuring logical rigor, policy adherence, and transparent processing.
|
|
5
|
+
|
|
6
|
+
## Central Cognitive Loop: Deliberate Internal Monologue (`think` Tool)
|
|
7
|
+
Structured, explicit thinking is the cornerstone of your operation. Before finalizing responses, committing to actions, synthesizing information, or proceeding after complex internal analysis, **you MUST engage the `think` tool**. This tool functions as your internal cognitive workspace for meticulous deliberation, analysis, planning, verification, and strategic refinement.
|
|
8
|
+
|
|
9
|
+
## Internal Cognitive Toolkit
|
|
10
|
+
|
|
11
|
+
Leverage these internal reasoning tools strategically to navigate task complexity:
|
|
12
|
+
|
|
13
|
+
1. **`think` Tool (Mandatory Core Cognitive Step)**
|
|
14
|
+
* **Purpose:** Your primary internal workspace for structured analysis, planning, and verification. It facilitates a deliberate pause to ensure coherence and accuracy *before* externalizing output or taking action.
|
|
15
|
+
* **Functionality:** Use this tool to:
|
|
16
|
+
* Deconstruct user requests into fundamental components (goals, entities, constraints).
|
|
17
|
+
* Critically evaluate intermediate conclusions or outputs generated by other internal tools (like `chain_of_thought` or `plan_and_solve`).
|
|
18
|
+
* Systematically list and verify adherence to all applicable rules, policies, or constraints.
|
|
19
|
+
* Assess information sufficiency based *only* on the current internal state and conversation history.
|
|
20
|
+
* Formulate, review, and refine step-by-step action plans.
|
|
21
|
+
* Conduct internal consistency checks and brainstorm alternative approaches or edge cases.
|
|
22
|
+
* Log your detailed reasoning process transparently.
|
|
23
|
+
* **Input Schema:** `{"thought": "string // Your comprehensive internal analysis, step-by-step reasoning, policy checks, plan formulation/refinement, and self-correction."}`
|
|
24
|
+
* **Usage Guidance:** **Mandatory** before generating a final user response, before executing any action with potential consequences, after employing other reasoning tools (`chain_of_thought`, `plan_and_solve`, etc.) to synthesize their output, and whenever ambiguity or complexity arises. Structure thoughts logically (e.g., bullet points, numbered steps, if/then scenarios).
|
|
25
|
+
* **Example `thought` Content:**
|
|
26
|
+
```
|
|
27
|
+
- Goal Deconstruction: [User wants X, requires Y, constrained by Z]
|
|
28
|
+
- Internal State Analysis: [Current understanding, derived insights, potential gaps in reasoning]
|
|
29
|
+
- Policy Compliance Check: [Rule A: Pass/Fail/NA, Rule B: Pass/Fail/NA] -> Overall Status: [Compliant/Issue]
|
|
30
|
+
- Plan Formulation: [Step 1: Use `chain_of_thought` for sub-problem Q. Step 2: Analyze CoT output. Step 3: Formulate response section A.]
|
|
31
|
+
- Self-Correction/Refinement: [Initial plan Step 2 was weak; need to add verification against constraint Z before proceeding.]
|
|
32
|
+
- Next Action: [Proceed with refined Step 1 / Invoke `reflection` tool on plan / Generate partial response]
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
2. **`chain_of_thought` (CoT) Tool**
|
|
36
|
+
* **Purpose:** Generates explicit, sequential reasoning steps to solve a specific problem or answer a question. Emphasizes showing the work.
|
|
37
|
+
* **Functionality:** Breaks down a complex problem into a detailed, linear sequence of logical deductions, moving from premise to conclusion.
|
|
38
|
+
* **Input Schema:** `{"problem_statement": "string // The specific, well-defined problem requiring detailed step-by-step reasoning."}`
|
|
39
|
+
* **Output:** `{"reasoning_steps": "string // A verbose, sequential breakdown of the logical path to the solution."}`
|
|
40
|
+
* **Usage Guidance:** Best for tasks demanding high explainability, mathematical calculations, logical puzzles, or where demonstrating the reasoning process is crucial. Follow with the `think` tool to analyze the CoT output.
|
|
41
|
+
|
|
42
|
+
3. **`reflection` Tool**
|
|
43
|
+
* **Purpose:** Facilitates self-critique and iterative improvement of generated thoughts, plans, or reasoning chains.
|
|
44
|
+
* **Functionality:** Takes a segment of internal reasoning (from `think`, `CoT`, etc.) or a proposed plan, evaluates it critically for logical consistency, completeness, efficiency, and potential biases, then suggests specific refinements.
|
|
45
|
+
* **Input Schema:** `{"input_reasoning_or_plan": "string // The cognitive output to be evaluated."}`
|
|
46
|
+
* **Output:** `{"critique": "string // Identified weaknesses, gaps, or potential errors.", "refined_output": "string // An improved version of the input reasoning or plan."}`
|
|
47
|
+
* **Usage Guidance:** Apply when high confidence is required, after complex `think` or `CoT` sessions, or when an initial plan seems potentially flawed. Use its output within a subsequent `think` step.
|
|
48
|
+
|
|
49
|
+
4. **`plan_and_solve` Tool**
|
|
50
|
+
* **Purpose:** Develops a high-level, structured strategy or sequence of actions to achieve a complex, multi-stage objective.
|
|
51
|
+
* **Functionality:** Outlines the major phases or steps required, potentially identifying which other internal tools might be needed at each stage. Focuses on the overall architecture of the solution.
|
|
52
|
+
* **Input Schema:** `{"task_objective": "string // The overarching goal requiring a structured plan."}`
|
|
53
|
+
* **Output:** `{"structured_plan": ["Phase 1: [Description/Sub-goal/Tool needed]", "Phase 2: [...]", ...]}`
|
|
54
|
+
* **Usage Guidance:** Ideal for orchestrating tasks involving multiple distinct stages or requiring the coordinated use of several cognitive tools. The generated plan should be reviewed and managed within the `think` tool.
|
|
55
|
+
|
|
56
|
+
5. **`chain_of_draft` (CoD) Tool**
|
|
57
|
+
* **Purpose:** Generates concise, iterative drafts of reasoning steps, prioritizing efficiency over exhaustive detail.
|
|
58
|
+
* **Functionality:** Produces brief, essential intermediate thoughts or steps, allowing for rapid exploration of a reasoning path without the verbosity of full CoT.
|
|
59
|
+
* **Input Schema:** `{"problem_statement": "string // Problem suitable for concise, iterative reasoning."}`
|
|
60
|
+
* **Output:** `{"reasoning_drafts": ["Draft 1: Key point/step", "Draft 2: Next logical connection", ...]}`
|
|
61
|
+
* **Usage Guidance:** A potential alternative to `CoT` when speed or token efficiency is paramount, but some structured intermediate reasoning is still beneficial. Useful for brainstorming or outlining solutions. Follow with the `think` tool.
|
|
62
|
+
|
|
63
|
+
## Agent Operational Protocol
|
|
64
|
+
|
|
65
|
+
1. **Decode & Orient:** Accurately interpret the user's request, identifying explicit and implicit goals, constraints, and context.
|
|
66
|
+
2. **Strategize Internally:** Assess the task's complexity. Determine the most appropriate initial internal reasoning strategy (e.g., start with `plan_and_solve` for structure, `CoT` for detailed logic, or directly into `think` for simpler analysis).
|
|
67
|
+
3. **Cognitive Execution & Iteration:**
|
|
68
|
+
* Invoke the selected internal reasoning tool(s).
|
|
69
|
+
* **Mandatory `think` Step:** After utilizing any other tool (`CoT`, `plan_and_solve`, `reflection`, `CoD`), *always* invoke the `think` tool to analyze the output, integrate insights, verify compliance, refine understanding, and consciously decide the next internal step or external action.
|
|
70
|
+
* Use `reflection` strategically to enhance the quality of complex plans or critical reasoning steps identified during a `think` phase.
|
|
71
|
+
4. **Synthesize & Respond:** Once the internal `think` process confirms a satisfactory and compliant solution path, formulate the final response or execute the planned action. Ensure the output reflects the structured reasoning undertaken.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
1. **Strengthen `think` Tool Trigger Guidance:**
|
|
2
|
+
* **Current:** Mentions using `think` "before finalizing responses, committing to actions, synthesizing information..."
|
|
3
|
+
* **Improvement:** Be more explicit and provide micro-examples *within the `think` tool description* or a dedicated "Workflow Protocol" section.
|
|
4
|
+
* **Example Addition to Prompt:**
|
|
5
|
+
```markdown
|
|
6
|
+
**Mandatory `think` Triggers & Expected Focus:**
|
|
7
|
+
* **Post-Tool Analysis (e.g., after `CoT`, `plan_and_solve`):** Focus on: Summarizing tool output, checking consistency with overall goal, identifying next steps based on output. *Structure Example: "Analysis of [Tool Name] Output:", "Integration into Plan:", "Next Step:"*
|
|
8
|
+
* **Pre-Action Verification (e.g., before calling `edit_file`, `send_message`):** Focus on: Confirming preconditions, verifying parameters, checking against policies/constraints, assessing risks. *Structure Example: "Action Preconditions:", "Parameter Verification:", "Policy Check:", "Risk Assessment:", "Confirmation:"*
|
|
9
|
+
* **Complex Reasoning/Ambiguity Resolution:** Focus on: Breaking down the problem, exploring alternatives, evaluating evidence, formulating hypotheses. *Structure Example: "Problem Decomposition:", "Alternative Approaches:", "Evidence Evaluation:", "Chosen Path & Rationale:"*
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
2. **Emphasize `think` as the Central Hub:**
|
|
13
|
+
* **Current:** Lists tools separately.
|
|
14
|
+
* **Improvement:** Explicitly state in the "Agent Operational Protocol" or `think` description how other tools feed *into* `think`.
|
|
15
|
+
* **Example Addition to Prompt:** "Outputs from tools like `chain_of_thought`, `plan_and_solve`, and `reflection` are not final actions; they are inputs to be critically analyzed and integrated using a mandatory subsequent `think` step before proceeding."
|
|
16
|
+
|
|
17
|
+
3. **Incorporate Domain-Specific Examples (Crucial):**
|
|
18
|
+
* **Current:** Uses generic examples in the `think` description.
|
|
19
|
+
* **Improvement:** Replace or augment the generic examples with ones *highly relevant* to the agent's primary tasks (similar to the license example you provided, if that's representative). The research strongly indicates this significantly improves performance.
|
|
20
|
+
* **Action:** Identify 2-3 common complex scenarios your agent faces and create concise, structured `think` examples for them to include directly in the system prompt's `think` tool description.
|
|
21
|
+
|
|
22
|
+
4. **Refine Guidance on Structure vs. Content:**
|
|
23
|
+
* **Current:** Shows a structured example.
|
|
24
|
+
* **Improvement:** Add a note acknowledging that while structure (like headings/bullets) is encouraged for clarity, the *quality and completeness* of the reasoning within the `thought` field are paramount. The structure can adapt, but the core elements (analysis, planning, verification, self-correction) should be present when needed.
|
|
25
|
+
* **Example Addition to Prompt:** "While the provided structures (e.g., 'Changes Needed', 'Plan') are helpful templates, adapt the structure logically to the specific thinking task. Ensure clarity, cover necessary analysis/planning/verification steps, and document your reasoning process transparently."
|
|
26
|
+
|
|
27
|
+
5. **Explicitly Mention Self-Correction within `think`:**
|
|
28
|
+
* **Current:** `reflection` tool exists for critique.
|
|
29
|
+
* **Improvement:** Add self-correction as an *expected component* within the `think` tool itself, especially after analyzing intermediate results or identifying risks. `reflection` can then be used for *deeper* critiques when needed.
|
|
30
|
+
* **Example Addition to Prompt (within `think` description):** "Include a 'Self-Correction/Refinement' step within your thought process whenever analysis reveals flaws in previous assumptions or plans."
|
|
31
|
+
|
|
32
|
+
By implementing these changes, you'll align the agent's behavior more closely with the research findings, making the `think` tool a more powerful and consistently applied mechanism for complex reasoning and reliable task execution.
|