@defai.digital/ax-cli 3.8.27 → 3.8.28

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/README.md CHANGED
@@ -381,7 +381,39 @@ Email: **security@defai.digital** (private disclosure)
381
381
 
382
382
  ## Changelog
383
383
 
384
- ### v3.8.23 (Latest)
384
+ ### v3.8.28 (Latest)
385
+
386
+ - **GLM-4.6 optimization: PRD generation** - Complete PRD template with all standard sections
387
+ - **GLM-4.6 optimization: Task planning** - Enhanced decomposition rules and complexity indicators
388
+ - **GLM-4.6 optimization: Code analysis** - Structured checklist with severity levels
389
+ - **GLM-4.6 optimization: Thinking mode detection** - Auto-detect tasks benefiting from extended reasoning
390
+ - **Enhanced specialized agents** - Workflow-driven prompts for testing, debugging, refactoring, and analysis
391
+ - **False positive prevention** - Extended bug review protocol in all analysis agents
392
+
393
+ ### v3.8.27
394
+
395
+ - **Enhanced Bug Review Protocol** - Classification system (CRITICAL/BUG/CODE_SMELL/STYLE/NOT_A_BUG)
396
+ - **False positive prevention** - Framework pattern library with concrete examples
397
+ - **Reporting gate** - Only report verified bugs, not style preferences
398
+
399
+ ### v3.8.26
400
+
401
+ - **Bug Review Protocol** - 4-step verification workflow for bug reports
402
+ - **Common false positive patterns** - Prevents incorrect bug reports
403
+
404
+ ### v3.8.25
405
+
406
+ - **Bug fix: Todo update validation** - Validates `id` field before processing updates
407
+ - **Improved error messages** - Better guidance when todo IDs are missing
408
+
409
+ ### v3.8.24
410
+
411
+ - **GLM 4.6 optimizations** - System prompt restructuring, max tokens increase
412
+ - **Cache savings display** - Shows token savings from context caching
413
+ - **Bug fix: Division by zero** - Cache hit rate calculation guard
414
+ - **Bug fix: Streaming cache tracking** - Extract cached tokens from streaming responses
415
+
416
+ ### v3.8.23
385
417
 
386
418
  - **Bug fix: Background task status** - Killed tasks now correctly show 'killed' instead of 'failed'
387
419
  - **Bug fix: Project settings corruption** - Now throws error instead of silent data loss
@@ -231,6 +231,144 @@ system_prompt:
231
231
  - "Cache understanding: Do not re-read files unnecessarily"
232
232
  - "Use regex in search for pattern matching"
233
233
 
234
+ # PRD (Product Requirements Document) generation
235
+ prd_generation:
236
+ title: "PRD GENERATION"
237
+ content: |
238
+ When asked to create a PRD, design doc, or specification:
239
+
240
+ === PRD TEMPLATE ===
241
+ # [Feature Name]
242
+
243
+ ## Overview
244
+ One paragraph summary of what this feature does and why it matters.
245
+
246
+ ## Problem Statement
247
+ - What problem does this solve?
248
+ - Who experiences this problem?
249
+ - What is the impact of not solving it?
250
+
251
+ ## Goals
252
+ - Primary goal (measurable)
253
+ - Secondary goals (if any)
254
+
255
+ ## Non-Goals (Out of Scope)
256
+ - What this feature explicitly does NOT do
257
+ - Features deferred to future iterations
258
+
259
+ ## User Stories
260
+ Format: "As a [user type], I want [action] so that [benefit]"
261
+ - User story 1
262
+ - User story 2
263
+
264
+ ## Technical Requirements
265
+ ### Architecture
266
+ - High-level architecture decisions
267
+ - Data flow description
268
+
269
+ ### API Design (if applicable)
270
+ - Endpoints or interfaces
271
+ - Request/response formats
272
+
273
+ ### Data Model
274
+ - Key entities and relationships
275
+ - Storage requirements
276
+
277
+ ## Implementation Plan
278
+ ### Phase 1: [Name] (MVP)
279
+ - Task 1
280
+ - Task 2
281
+
282
+ ### Phase 2: [Name] (Enhancement)
283
+ - Task 1
284
+
285
+ ## Success Metrics
286
+ - How do we measure success?
287
+ - What KPIs matter?
288
+
289
+ ## Risks and Mitigations
290
+ | Risk | Impact | Mitigation |
291
+ |------|--------|------------|
292
+ | Risk 1 | High/Med/Low | How to address |
293
+
294
+ ## Open Questions
295
+ - Unresolved decisions
296
+ === END TEMPLATE ===
297
+
298
+ RULES:
299
+ - Research codebase BEFORE writing PRD
300
+ - Be specific - no placeholder text
301
+ - Include technical constraints from actual codebase
302
+ - Estimate based on complexity, not time
303
+
304
+ # Task decomposition and planning
305
+ task_planning:
306
+ title: "TASK PLANNING"
307
+ content: |
308
+ For complex multi-step tasks:
309
+
310
+ DECOMPOSITION RULES:
311
+ 1. Break into independent, testable units
312
+ 2. Order by dependencies (what must exist first?)
313
+ 3. Identify blocking vs parallel tasks
314
+ 4. Each task should be completable in one tool round
315
+
316
+ COMPLEXITY INDICATORS (triggers deeper analysis):
317
+ - "refactor" + multiple files
318
+ - "implement" + "feature"
319
+ - "migrate" or "convert"
320
+ - Questions about architecture
321
+ - Tasks with 3+ distinct components
322
+
323
+ PLANNING FORMAT:
324
+ ```
325
+ Task: [Original request]
326
+ Complexity: Low/Medium/High
327
+
328
+ Steps:
329
+ 1. [Action] - [Files affected] - [Risk: low/med/high]
330
+ 2. ...
331
+
332
+ Validation:
333
+ - [ ] How to verify step 1
334
+ - [ ] How to verify step 2
335
+ ```
336
+
337
+ DO NOT plan for:
338
+ - Simple file reads/edits
339
+ - Single-command bash operations
340
+ - Informational questions
341
+
342
+ # Code review and analysis guidelines
343
+ code_analysis:
344
+ title: "CODE ANALYSIS"
345
+ content: |
346
+ When reviewing or analyzing code:
347
+
348
+ ANALYSIS CHECKLIST:
349
+ □ Correctness: Does it do what it claims?
350
+ □ Error Handling: Are edge cases covered?
351
+ □ Security: OWASP top 10 issues?
352
+ □ Performance: O(n) complexity issues?
353
+ □ Maintainability: Is it readable?
354
+
355
+ SEVERITY LEVELS:
356
+ - CRITICAL: Must fix before merge (security, data loss, crashes)
357
+ - MAJOR: Should fix (bugs, significant issues)
358
+ - MINOR: Nice to fix (code style, minor improvements)
359
+ - INFO: FYI only (observations, suggestions)
360
+
361
+ OUTPUT FORMAT:
362
+ ```
363
+ ## [File:Line] [SEVERITY] Title
364
+
365
+ **Issue**: What's wrong
366
+ **Impact**: Why it matters
367
+ **Fix**: How to resolve (with code if needed)
368
+ ```
369
+
370
+ AVOID FALSE POSITIVES - review the Bug Review Protocol above.
371
+
234
372
  closing: "Be direct. Be accurate. Be brief."
235
373
 
236
374
  # Custom instructions handling
@@ -243,11 +243,12 @@ export declare const DEFAULT_SUBAGENT_CONFIG: Record<SubagentRole, Partial<Subag
243
243
  /**
244
244
  * System prompts for each subagent role
245
245
  *
246
- * Guidelines:
246
+ * GLM-4.6 Optimized Guidelines:
247
247
  * - Be direct and professional, no pleasantries
248
248
  * - Keep responses brief unless detail is needed
249
249
  * - Match existing code style in the project
250
250
  * - Validate changes with lint/typecheck when applicable
251
+ * - Leverage large context for comprehensive analysis
251
252
  */
252
253
  export declare const SUBAGENT_SYSTEM_PROMPTS: Record<SubagentRole, string>;
253
254
  /**
@@ -90,50 +90,146 @@ export const DEFAULT_SUBAGENT_CONFIG = {
90
90
  /**
91
91
  * System prompts for each subagent role
92
92
  *
93
- * Guidelines:
93
+ * GLM-4.6 Optimized Guidelines:
94
94
  * - Be direct and professional, no pleasantries
95
95
  * - Keep responses brief unless detail is needed
96
96
  * - Match existing code style in the project
97
97
  * - Validate changes with lint/typecheck when applicable
98
+ * - Leverage large context for comprehensive analysis
98
99
  */
99
100
  export const SUBAGENT_SYSTEM_PROMPTS = {
100
- [SubagentRole.GENERAL]: `You are an AI coding assistant. Handle the assigned task directly.
101
+ [SubagentRole.GENERAL]: `AI coding assistant. Handle the assigned task directly.
101
102
  Be accurate and brief. Match existing code conventions. Validate your changes.`,
102
- [SubagentRole.TESTING]: `You are a testing agent. Write tests for the specified code.
103
- - Match existing test patterns and frameworks in the project
104
- - Cover happy path, edge cases, and error scenarios
105
- - Use clear test names that describe behavior
106
- - Run tests to verify they pass
103
+ [SubagentRole.TESTING]: `Testing agent. Write tests for the specified code.
104
+
105
+ WORKFLOW:
106
+ 1. READ existing tests to understand patterns/framework
107
+ 2. IDENTIFY test scenarios: happy path, edge cases, errors
108
+ 3. WRITE tests matching project conventions
109
+ 4. RUN tests to verify they pass
110
+
111
+ TEST QUALITY:
112
+ - Descriptive test names: "should [behavior] when [condition]"
113
+ - One assertion concept per test
114
+ - Mock external dependencies
115
+ - Cover: null/undefined, empty strings, boundary values
116
+
107
117
  Keep responses brief. Focus only on testing.`,
108
- [SubagentRole.DOCUMENTATION]: `You are a documentation agent. Document the specified code.
109
- - Match existing documentation style in the project
110
- - Include usage examples where helpful
111
- - Be concise - don't over-document obvious code
118
+ [SubagentRole.DOCUMENTATION]: `Documentation agent. Document the specified code.
119
+
120
+ WORKFLOW:
121
+ 1. READ the code thoroughly
122
+ 2. IDENTIFY public API, key concepts, edge cases
123
+ 3. WRITE docs matching project style
124
+
125
+ DOC TYPES:
126
+ - API: Parameters, return types, examples
127
+ - README: Setup, usage, configuration
128
+ - PRD: Use the PRD template for design docs
129
+
130
+ RULES:
131
+ - Include runnable examples
112
132
  - Document edge cases and limitations
133
+ - Don't over-document obvious code
134
+ - Be concise
135
+
113
136
  Keep responses brief. Focus only on documentation.`,
114
- [SubagentRole.REFACTORING]: `You are a refactoring agent. Improve the specified code structure.
115
- - Preserve existing functionality exactly
116
- - Match existing code conventions
117
- - Reduce duplication without over-abstracting
118
- - Run tests after changes to verify behavior
137
+ [SubagentRole.REFACTORING]: `Refactoring agent. Improve code structure.
138
+
139
+ WORKFLOW:
140
+ 1. UNDERSTAND current behavior fully
141
+ 2. IDENTIFY refactoring opportunities
142
+ 3. PLAN changes (what changes, what stays)
143
+ 4. EXECUTE one refactoring at a time
144
+ 5. VERIFY with tests after each change
145
+
146
+ REFACTORING TYPES:
147
+ - Extract: Pull repeated code into functions
148
+ - Rename: Improve clarity of names
149
+ - Simplify: Reduce nested conditionals
150
+ - Consolidate: Merge similar code paths
151
+
152
+ RULES:
153
+ - Preserve behavior exactly
154
+ - Match existing conventions
155
+ - Don't over-abstract
156
+ - Run tests after changes
157
+
119
158
  Keep responses brief. Focus only on refactoring.`,
120
- [SubagentRole.ANALYSIS]: `You are a code analysis agent. Analyze the specified code.
121
- - Identify bugs, security issues, and anti-patterns
122
- - Prioritize findings by severity
123
- - Provide actionable recommendations
124
- - Be specific about locations and fixes
159
+ [SubagentRole.ANALYSIS]: `Code analysis agent. Analyze the specified code.
160
+
161
+ WORKFLOW:
162
+ 1. SCAN for issues by category
163
+ 2. CLASSIFY by severity
164
+ 3. REPORT with actionable fixes
165
+
166
+ CATEGORIES:
167
+ □ Correctness: Logic errors, wrong behavior
168
+ □ Security: OWASP top 10 (injection, XSS, etc.)
169
+ □ Performance: O(n²) loops, memory leaks
170
+ □ Maintainability: Complexity, readability
171
+
172
+ SEVERITY:
173
+ - CRITICAL: Security, data loss, crashes
174
+ - MAJOR: Bugs, significant issues
175
+ - MINOR: Code style, small improvements
176
+ - INFO: Observations only
177
+
178
+ FALSE POSITIVE PREVENTION:
179
+ - catch (error: any) is VALID TypeScript
180
+ - let vs const is lint preference, not a bug
181
+ - setTimeout returns SYNCHRONOUSLY
182
+ - React useEffect closures are intentional
183
+
125
184
  Keep responses brief. Focus only on analysis.`,
126
- [SubagentRole.DEBUG]: `You are a debugging agent. Fix the specified bug.
127
- - Identify root cause before fixing
128
- - Make minimal changes to fix the issue
129
- - Add error handling if missing
130
- - Test the fix to verify it works
185
+ [SubagentRole.DEBUG]: `Debugging agent. Fix verified bugs only.
186
+
187
+ WORKFLOW:
188
+ 1. REPRODUCE: Confirm the bug exists
189
+ 2. ISOLATE: Find the exact line/condition
190
+ 3. UNDERSTAND: Why does this happen?
191
+ 4. FIX: Minimal change to resolve
192
+ 5. VERIFY: Test the fix works
193
+
194
+ CLASSIFICATION (required):
195
+ - CRITICAL: Crashes, data loss, security
196
+ - BUG: Incorrect behavior
197
+ - CODE_SMELL: Works but improvable (do NOT fix unless asked)
198
+ - NOT_A_BUG: False positive (do NOT report)
199
+
200
+ NOT A BUG (ignore these):
201
+ - catch (error: any) - valid TS pattern
202
+ - let vs const - lint preference
203
+ - Intentional type casts (as any)
204
+ - setTimeout/setInterval return IMMEDIATELY (sync)
205
+ - React useEffect local arrays - each effect has own closure
206
+
207
+ ONLY FIX if:
208
+ - Classification is CRITICAL or BUG
209
+ - You traced execution and confirmed issue
210
+ - You can describe exact error/behavior
211
+
131
212
  Keep responses brief. Focus only on debugging.`,
132
- [SubagentRole.PERFORMANCE]: `You are a performance optimization agent. Optimize the specified code.
133
- - Profile/benchmark before and after changes
134
- - Focus on measurable improvements
213
+ [SubagentRole.PERFORMANCE]: `Performance optimization agent. Optimize the specified code.
214
+
215
+ WORKFLOW:
216
+ 1. PROFILE: Identify actual bottlenecks (don't guess)
217
+ 2. MEASURE: Baseline performance numbers
218
+ 3. OPTIMIZE: Target biggest impact first
219
+ 4. VERIFY: Measure improvement
220
+
221
+ COMMON OPTIMIZATIONS:
222
+ - Algorithms: O(n²) → O(n log n)
223
+ - Caching: Memoize expensive computations
224
+ - Lazy loading: Defer work until needed
225
+ - Batching: Reduce I/O round trips
226
+
227
+ RULES:
228
+ - Don't optimize without measuring
135
229
  - Don't sacrifice readability for micro-optimizations
136
- - Document performance gains
230
+ - Document what was changed and why
231
+ - Include before/after metrics
232
+
137
233
  Keep responses brief. Focus only on performance.`,
138
234
  };
139
235
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"subagent-types.js","sourceRoot":"","sources":["../../src/agent/subagent-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH;;GAEG;AACH,MAAM,CAAN,IAAY,YAeX;AAfD,WAAY,YAAY;IACtB,yCAAyC;IACzC,mCAAmB,CAAA;IACnB,+CAA+C;IAC/C,mCAAmB,CAAA;IACnB,8CAA8C;IAC9C,+CAA+B,CAAA;IAC/B,sCAAsC;IACtC,2CAA2B,CAAA;IAC3B,qDAAqD;IACrD,qCAAqB,CAAA;IACrB,oDAAoD;IACpD,+BAAe,CAAA;IACf,8CAA8C;IAC9C,2CAA2B,CAAA;AAC7B,CAAC,EAfW,YAAY,KAAZ,YAAY,QAevB;AA8FD;;GAEG;AACH,MAAM,CAAN,IAAY,aAWX;AAXD,WAAY,aAAa;IACvB,4BAA4B;IAC5B,oCAAmB,CAAA;IACnB,0BAA0B;IAC1B,oCAAmB,CAAA;IACnB,6BAA6B;IAC7B,wCAAuB,CAAA;IACvB,wBAAwB;IACxB,kCAAiB,CAAA;IACjB,kCAAkC;IAClC,wCAAuB,CAAA;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CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,MAAM,OAAO,GAAiC;QAC5C,SAAS,EAAE,YAAY,CAAC,OAAO;QAC/B,eAAe,EAAE,YAAY,CAAC,aAAa;QAC3C,aAAa,EAAE,YAAY,CAAC,WAAW;QACvC,UAAU,EAAE,YAAY,CAAC,QAAQ;QACjC,OAAO,EAAE,YAAY,CAAC,KAAK;QAC3B,aAAa,EAAE,YAAY,CAAC,WAAW;QACvC,SAAS,EAAE,YAAY,CAAC,OAAO;KAChC,CAAC;IAEF,OAAO,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,IAAI,YAAY,CAAC,OAAO,CAAC;AAC7D,CAAC"}
@@ -9,4 +9,4 @@ export { DependencyResolver, getDependencyResolver, type ExecutionBatch, type De
9
9
  export { TokenEstimator, getTokenEstimator, } from "./token-estimator.js";
10
10
  export { PlanGenerator, getPlanGenerator, type PlanGeneratorOptions, type GenerationContext, } from "./plan-generator.js";
11
11
  export { TaskPlanner, getTaskPlanner, resetTaskPlanner, type TaskPlannerEvents, } from "./task-planner.js";
12
- export { PLANNING_SYSTEM_PROMPT, buildPlanningPrompt, buildPhaseExecutionPrompt, buildPlanSummaryPrompt, isComplexRequest, estimateMinPhases, COMPLEX_KEYWORDS, SIMPLE_KEYWORDS, } from "./prompts/planning-prompt.js";
12
+ export { PLANNING_SYSTEM_PROMPT, buildPlanningPrompt, buildPhaseExecutionPrompt, buildPlanSummaryPrompt, isComplexRequest, estimateMinPhases, shouldUseThinkingMode, getComplexityScore, THINKING_MODE_KEYWORDS, COMPLEX_KEYWORDS, SIMPLE_KEYWORDS, } from "./prompts/planning-prompt.js";
@@ -22,5 +22,7 @@ export { PlanGenerator, getPlanGenerator, } from "./plan-generator.js";
22
22
  // Task Planner (main orchestrator)
23
23
  export { TaskPlanner, getTaskPlanner, resetTaskPlanner, } from "./task-planner.js";
24
24
  // Prompts
25
- export { PLANNING_SYSTEM_PROMPT, buildPlanningPrompt, buildPhaseExecutionPrompt, buildPlanSummaryPrompt, isComplexRequest, estimateMinPhases, COMPLEX_KEYWORDS, SIMPLE_KEYWORDS, } from "./prompts/planning-prompt.js";
25
+ export { PLANNING_SYSTEM_PROMPT, buildPlanningPrompt, buildPhaseExecutionPrompt, buildPlanSummaryPrompt, isComplexRequest, estimateMinPhases,
26
+ // GLM-4.6 Optimizations
27
+ shouldUseThinkingMode, getComplexityScore, THINKING_MODE_KEYWORDS, COMPLEX_KEYWORDS, SIMPLE_KEYWORDS, } from "./prompts/planning-prompt.js";
26
28
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/planner/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,QAAQ;AACR,OAAO;AACL,QAAQ;AACR,SAAS,EACT,gBAAgB,EAChB,WAAW,EACX,UAAU;AAgBV,UAAU;AACV,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB;AAErB,oBAAoB;AACpB,WAAW,EACX,UAAU,EACV,6BAA6B,EAC7B,2BAA2B,GAC5B,MAAM,YAAY,CAAC;AAEpB,eAAe;AACf,OAAO,EACL,WAAW,EACX,cAAc,EACd,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAE3B,sBAAsB;AACtB,OAAO,EACL,kBAAkB,EAClB,qBAAqB,GAGtB,MAAM,0BAA0B,CAAC;AAElC,kBAAkB;AAClB,OAAO,EACL,cAAc,EACd,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAE9B,iBAAiB;AACjB,OAAO,EACL,aAAa,EACb,gBAAgB,GAGjB,MAAM,qBAAqB,CAAC;AAE7B,mCAAmC;AACnC,OAAO,EACL,WAAW,EACX,cAAc,EACd,gBAAgB,GAEjB,MAAM,mBAAmB,CAAC;AAE3B,UAAU;AACV,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,GAChB,MAAM,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/planner/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,QAAQ;AACR,OAAO;AACL,QAAQ;AACR,SAAS,EACT,gBAAgB,EAChB,WAAW,EACX,UAAU;AAgBV,UAAU;AACV,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB;AAErB,oBAAoB;AACpB,WAAW,EACX,UAAU,EACV,6BAA6B,EAC7B,2BAA2B,GAC5B,MAAM,YAAY,CAAC;AAEpB,eAAe;AACf,OAAO,EACL,WAAW,EACX,cAAc,EACd,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAE3B,sBAAsB;AACtB,OAAO,EACL,kBAAkB,EAClB,qBAAqB,GAGtB,MAAM,0BAA0B,CAAC;AAElC,kBAAkB;AAClB,OAAO,EACL,cAAc,EACd,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAE9B,iBAAiB;AACjB,OAAO,EACL,aAAa,EACb,gBAAgB,GAGjB,MAAM,qBAAqB,CAAC;AAE7B,mCAAmC;AACnC,OAAO,EACL,WAAW,EACX,cAAc,EACd,gBAAgB,GAEjB,MAAM,mBAAmB,CAAC;AAE3B,UAAU;AACV,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB;AACjB,wBAAwB;AACxB,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,GAChB,MAAM,8BAA8B,CAAC"}
@@ -23,6 +23,27 @@ export declare function buildPlanSummaryPrompt(results: Array<{
23
23
  success: boolean;
24
24
  output?: string;
25
25
  }>): string;
26
+ /**
27
+ * Keywords that indicate tasks benefiting from thinking/reasoning mode
28
+ * GLM-4.6 has a built-in thinking mode that provides extended reasoning
29
+ */
30
+ export declare const THINKING_MODE_KEYWORDS: string[];
31
+ /**
32
+ * Detect if a request would benefit from thinking/reasoning mode
33
+ * GLM-4.6's thinking mode provides extended chain-of-thought reasoning
34
+ *
35
+ * @param request - User's request text
36
+ * @returns true if thinking mode would improve response quality
37
+ */
38
+ export declare function shouldUseThinkingMode(request: string): boolean;
39
+ /**
40
+ * Get complexity score for a request (0-100)
41
+ * Higher scores indicate more complex tasks
42
+ *
43
+ * @param request - User's request text
44
+ * @returns Complexity score 0-100
45
+ */
46
+ export declare function getComplexityScore(request: string): number;
26
47
  /**
27
48
  * Keywords that indicate a complex request
28
49
  */
@@ -134,6 +134,131 @@ Provide:
134
134
  // ============================================================================
135
135
  // Complexity Detection
136
136
  // ============================================================================
137
+ /**
138
+ * Keywords that indicate tasks benefiting from thinking/reasoning mode
139
+ * GLM-4.6 has a built-in thinking mode that provides extended reasoning
140
+ */
141
+ export const THINKING_MODE_KEYWORDS = [
142
+ // Deep analysis tasks
143
+ "analyze",
144
+ "debug",
145
+ "investigate",
146
+ "diagnose",
147
+ "trace",
148
+ "root cause",
149
+ "why does",
150
+ "why is",
151
+ // Architecture and design
152
+ "architect",
153
+ "design",
154
+ "plan",
155
+ "strategy",
156
+ "approach",
157
+ "trade-off",
158
+ "pros and cons",
159
+ // Complex reasoning
160
+ "complex",
161
+ "complicated",
162
+ "difficult",
163
+ "tricky",
164
+ "subtle",
165
+ "edge case",
166
+ // Code review and security
167
+ "security audit",
168
+ "vulnerability",
169
+ "code review",
170
+ "review for bugs",
171
+ "find bugs",
172
+ // PRD and documentation
173
+ "prd",
174
+ "product requirements",
175
+ "specification",
176
+ "design doc",
177
+ "rfc",
178
+ // Refactoring decisions
179
+ "refactor strategy",
180
+ "best way to",
181
+ "how should",
182
+ "recommend",
183
+ // Performance analysis
184
+ "performance issue",
185
+ "bottleneck",
186
+ "optimize",
187
+ "memory leak",
188
+ // Multi-step reasoning
189
+ "step by step",
190
+ "think through",
191
+ "consider",
192
+ "evaluate",
193
+ ];
194
+ /**
195
+ * Detect if a request would benefit from thinking/reasoning mode
196
+ * GLM-4.6's thinking mode provides extended chain-of-thought reasoning
197
+ *
198
+ * @param request - User's request text
199
+ * @returns true if thinking mode would improve response quality
200
+ */
201
+ export function shouldUseThinkingMode(request) {
202
+ const lowerRequest = request.toLowerCase();
203
+ // Check for thinking mode indicators
204
+ const hasThinkingKeywords = THINKING_MODE_KEYWORDS.some((kw) => lowerRequest.includes(kw));
205
+ // Question patterns that benefit from reasoning
206
+ const hasReasoningQuestion = /\b(why|how|what if|should i|which|compare|difference|better)\b/i.test(lowerRequest);
207
+ // Requests for explanation or understanding
208
+ const wantsExplanation = lowerRequest.includes("explain") ||
209
+ lowerRequest.includes("understand") ||
210
+ lowerRequest.includes("help me understand") ||
211
+ lowerRequest.includes("walk through");
212
+ // Multiple options to consider
213
+ const hasMultipleOptions = lowerRequest.includes("or") ||
214
+ lowerRequest.includes("versus") ||
215
+ lowerRequest.includes("vs") ||
216
+ lowerRequest.includes("alternative");
217
+ // Check for debugging patterns
218
+ const isDebugging = lowerRequest.includes("not working") ||
219
+ lowerRequest.includes("doesn't work") ||
220
+ lowerRequest.includes("error") ||
221
+ lowerRequest.includes("bug") ||
222
+ lowerRequest.includes("broken");
223
+ // Skip thinking mode for simple tasks
224
+ const isSimpleTask = lowerRequest.length < 50 ||
225
+ lowerRequest.includes("just") ||
226
+ lowerRequest.includes("quick") ||
227
+ lowerRequest.includes("simple") ||
228
+ /^(show|list|get|read|view|print|cat)\s/i.test(lowerRequest.trim());
229
+ if (isSimpleTask) {
230
+ return false;
231
+ }
232
+ return hasThinkingKeywords || hasReasoningQuestion || wantsExplanation || hasMultipleOptions || isDebugging;
233
+ }
234
+ /**
235
+ * Get complexity score for a request (0-100)
236
+ * Higher scores indicate more complex tasks
237
+ *
238
+ * @param request - User's request text
239
+ * @returns Complexity score 0-100
240
+ */
241
+ export function getComplexityScore(request) {
242
+ const lowerRequest = request.toLowerCase();
243
+ let score = 0;
244
+ // Length-based scoring (longer requests often more complex)
245
+ score += Math.min(20, Math.floor(request.length / 50));
246
+ // Complex keywords
247
+ const complexCount = COMPLEX_KEYWORDS.filter((kw) => lowerRequest.includes(kw)).length;
248
+ score += Math.min(30, complexCount * 10);
249
+ // Thinking mode keywords
250
+ const thinkingCount = THINKING_MODE_KEYWORDS.filter((kw) => lowerRequest.includes(kw)).length;
251
+ score += Math.min(20, thinkingCount * 5);
252
+ // Multi-step indicators
253
+ const stepIndicators = ["first", "then", "next", "after", "finally", "and then"];
254
+ const stepCount = stepIndicators.filter((ind) => lowerRequest.includes(ind)).length;
255
+ score += Math.min(15, stepCount * 5);
256
+ // Multiple files/components
257
+ if (lowerRequest.includes("all files") || lowerRequest.includes("codebase")) {
258
+ score += 15;
259
+ }
260
+ return Math.min(100, score);
261
+ }
137
262
  /**
138
263
  * Keywords that indicate a complex request
139
264
  */
@@ -1 +1 @@
1
- {"version":3,"file":"planning-prompt.js","sourceRoot":"","sources":["../../../src/planner/prompts/planning-prompt.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,+EAA+E;AAC/E,yBAAyB;AACzB,+EAA+E;AAE/E,MAAM,CAAC,MAAM,sBAAsB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yEAgCmC,CAAC;AAE1E,+EAA+E;AAC/E,gCAAgC;AAChC,+EAA+E;AAE/E,MAAM,UAAU,mBAAmB,CACjC,WAAmB,EACnB,OAIC;IAED,IAAI,MAAM,GAAG;;;EAGb,WAAW;WACF,CAAC;IAEV,IAAI,OAAO,EAAE,WAAW,EAAE,CAAC;QACzB,MAAM,IAAI,qBAAqB,OAAO,CAAC,WAAW,EAAE,CAAC;IACvD,CAAC;IAED,IAAI,OAAO,EAAE,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/C,MAAM,IAAI,wBAAwB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAA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AC,CAAC,EAAE,eAAe,EAAE,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC;AAClE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defai.digital/ax-cli",
3
- "version": "3.8.27",
3
+ "version": "3.8.28",
4
4
  "sdkVersion": "1.2.0",
5
5
  "description": "Enterprise-Class AI Command Line Interface - Primary support for GLM (General Language Model) with multi-provider AI orchestration powered by AutomatosX.",
6
6
  "type": "module",