@gotza02/sequential-thinking 2026.2.44 → 2026.2.46
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/tools/thinking.js +3 -3
- package/dist/utils.js +8 -3
- package/package.json +1 -1
package/dist/tools/thinking.js
CHANGED
|
@@ -74,14 +74,14 @@ If you have tried to fix the same problem 3 times and failed:
|
|
|
74
74
|
2. Do not attempt a 4th fix in the same chain.
|
|
75
75
|
3. Branch back to the analysis phase before the first fix attempt.`, {
|
|
76
76
|
thought: z.string().describe("Your current thinking step"),
|
|
77
|
-
thoughtType: z.enum([
|
|
77
|
+
thoughtType: z.preprocess((val) => (typeof val === 'string' && val.toLowerCase() === 'reflection' ? 'reflexion' : val), z.enum([
|
|
78
78
|
'analysis', 'planning', 'execution', 'observation',
|
|
79
79
|
'hypothesis', 'reflexion', 'solution',
|
|
80
80
|
'generation', 'evaluation', 'selection'
|
|
81
|
-
]).describe("The structural role of this thought (see THOUGHT TYPES above)"),
|
|
81
|
+
])).describe("The structural role of this thought (see THOUGHT TYPES above)"),
|
|
82
82
|
thoughtNumber: z.number().int().min(1).describe("Current thought number (e.g., 1, 2, 3)"),
|
|
83
83
|
totalThoughts: z.number().int().min(1).describe("Estimated total thoughts needed (can be adjusted)"),
|
|
84
|
-
nextThoughtNeeded: z.boolean().describe("True if more thinking/action is needed"),
|
|
84
|
+
nextThoughtNeeded: z.boolean().optional().default(true).describe("True if more thinking/action is needed"),
|
|
85
85
|
// New Interleaved Fields
|
|
86
86
|
blockId: z.string().optional().describe("ID for the current topic block (e.g., 'auth-debug', 'api-research'). Keep same ID to stay in context."),
|
|
87
87
|
relatedToolCall: z.string().optional().describe("If type='execution', specify the tool name here (e.g., 'read_file', 'edit_file')"),
|
package/dist/utils.js
CHANGED
|
@@ -136,9 +136,14 @@ function validateCommand(command) {
|
|
|
136
136
|
* @throws Error if command contains shell metacharacters or is not whitelisted
|
|
137
137
|
*/
|
|
138
138
|
export function execAsync(command, options = {}) {
|
|
139
|
-
// Validate command for security
|
|
140
|
-
validateCommand(command);
|
|
141
139
|
return new Promise((resolve, reject) => {
|
|
140
|
+
try {
|
|
141
|
+
// Validate command for security
|
|
142
|
+
validateCommand(command);
|
|
143
|
+
}
|
|
144
|
+
catch (error) {
|
|
145
|
+
return reject(error);
|
|
146
|
+
}
|
|
142
147
|
const timeout = options.timeout || 60000; // Default 60s timeout
|
|
143
148
|
const maxBuffer = options.maxBuffer || 1024 * 1024 * 5; // Default 5MB buffer
|
|
144
149
|
// Parse command into parts
|
|
@@ -213,7 +218,7 @@ export function validatePath(requestedPath) {
|
|
|
213
218
|
absolutePath = resolvedPath;
|
|
214
219
|
rootDir = path.resolve(process.cwd());
|
|
215
220
|
}
|
|
216
|
-
if (!absolutePath.startsWith(rootDir)) {
|
|
221
|
+
if (!absolutePath.startsWith(rootDir) || (absolutePath.length > rootDir.length && absolutePath[rootDir.length] !== path.sep)) {
|
|
217
222
|
throw new Error(`Access denied: Path '${requestedPath}' (resolved to '${absolutePath}') is outside the project root '${rootDir}'.`);
|
|
218
223
|
}
|
|
219
224
|
return absolutePath;
|