@aigne/doc-smith 0.8.15-beta.14 → 0.8.15-beta.15

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.8.15-beta.15](https://github.com/AIGNE-io/aigne-doc-smith/compare/v0.8.15-beta.14...v0.8.15-beta.15) (2025-11-07)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * add two-tier thinking effort configuration system ([#273](https://github.com/AIGNE-io/aigne-doc-smith/issues/273)) ([b72d066](https://github.com/AIGNE-io/aigne-doc-smith/commit/b72d066698bae253a9ee2dfa231bf73cd59d7529))
9
+
3
10
  ## [0.8.15-beta.14](https://github.com/AIGNE-io/aigne-doc-smith/compare/v0.8.15-beta.13...v0.8.15-beta.14) (2025-11-06)
4
11
 
5
12
 
@@ -4,6 +4,8 @@ import chalk from "chalk";
4
4
  import { stringify as yamlStringify } from "yaml";
5
5
  import { getFilteredOptions } from "../../utils/conflict-detector.mjs";
6
6
  import {
7
+ DEFAULT_REASONING_EFFORT_LEVEL,
8
+ DEFAULT_THINKING_EFFORT_LEVEL,
7
9
  DEPTH_RECOMMENDATION_LOGIC,
8
10
  DOCUMENT_STYLES,
9
11
  DOCUMENTATION_DEPTH,
@@ -22,11 +24,10 @@ import {
22
24
  } from "../../utils/utils.mjs";
23
25
  import { isRemoteFile } from "../../utils/file-utils.mjs";
24
26
  import { validateDocDir } from "./validate.mjs";
27
+ import mapReasoningEffortLevel from "../utils/map-reasoning-effort-level.mjs";
25
28
 
26
29
  const _PRESS_ENTER_TO_FINISH = "Press Enter to finish";
27
30
 
28
- const DEFAULT_REASONING_EFFORT = 502;
29
-
30
31
  /**
31
32
  * Guides the user through a multi-turn dialog to generate a YAML configuration file.
32
33
  * @param {Object} params
@@ -37,7 +38,15 @@ const DEFAULT_REASONING_EFFORT = 502;
37
38
  export default async function init(input, options) {
38
39
  const config = await _init(input, options);
39
40
 
40
- options.context.userContext.reasoningEffort = config.reasoningEffort || DEFAULT_REASONING_EFFORT;
41
+ // Set thinking effort (lite/standard/pro) and map to reasoningEffort
42
+ options.context.userContext.thinkingEffort =
43
+ config.thinking?.effort || DEFAULT_THINKING_EFFORT_LEVEL;
44
+
45
+ // Set global reasoningEffort based on thinkingEffort
46
+ options.context.userContext.reasoningEffort = mapReasoningEffortLevel(
47
+ { level: DEFAULT_REASONING_EFFORT_LEVEL },
48
+ options,
49
+ )?.reasoningEffort;
41
50
 
42
51
  return config;
43
52
  }
@@ -398,8 +407,6 @@ async function _init(
398
407
  input.projectDesc = projectInfo.description;
399
408
  input.projectLogo = projectInfo.icon;
400
409
 
401
- input.reasoningEffort = DEFAULT_REASONING_EFFORT;
402
-
403
410
  // Generate YAML content
404
411
  const yamlContent = generateYAML(input, outputPath);
405
412
 
@@ -450,7 +457,9 @@ export function generateYAML(input) {
450
457
  projectDesc: input.projectDesc || "",
451
458
  projectLogo: input.projectLogo || "",
452
459
 
453
- reasoningEffort: input.reasoningEffort || 502,
460
+ thinking: {
461
+ effort: input.thinking?.effort || DEFAULT_THINKING_EFFORT_LEVEL,
462
+ },
454
463
 
455
464
  // Documentation configuration
456
465
  documentPurpose: input.documentPurpose || [],
@@ -488,14 +497,15 @@ export function generateYAML(input) {
488
497
  yaml += `${projectSection}\n\n`;
489
498
 
490
499
  const modelSection = yamlStringify({
491
- reasoningEffort: config.reasoningEffort,
500
+ thinking: config.thinking,
492
501
  }).trim();
493
502
 
494
503
  yaml += `\
495
- # Model Configuration
496
-
497
- # Reasoning Effort: Level of reasoning effort for AI model, lower is faster but less thorough.
498
- # Options: minimal, low, medium, high, or numeric values 128-32768.
504
+ # AI Thinking Configuration
505
+ # thinking.effort: Determines the depth of reasoning and cognitive effort the AI uses when responding, available options:
506
+ # - lite: Fast responses with basic reasoning
507
+ # - standard: Balanced speed and reasoning capability
508
+ # - pro: In-depth reasoning with longer response times
499
509
  ${modelSection}
500
510
  \n`;
501
511
 
@@ -0,0 +1,15 @@
1
+ import {
2
+ DEFAULT_REASONING_EFFORT_LEVEL,
3
+ DEFAULT_REASONING_EFFORT_VALUE,
4
+ REASONING_EFFORT_LEVELS,
5
+ } from "../../utils/constants/index.mjs";
6
+
7
+ export default function mapReasoningEffortLevel({ level }, options) {
8
+ const g =
9
+ REASONING_EFFORT_LEVELS[level] || REASONING_EFFORT_LEVELS[DEFAULT_REASONING_EFFORT_LEVEL];
10
+
11
+ return {
12
+ reasoningEffort:
13
+ g[options.context.userContext.thinkingEffort] ?? DEFAULT_REASONING_EFFORT_VALUE,
14
+ };
15
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/doc-smith",
3
- "version": "0.8.15-beta.14",
3
+ "version": "0.8.15-beta.15",
4
4
  "description": "AI-driven documentation generation tool built on the AIGNE Framework",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -555,3 +555,35 @@ export const DOC_ACTION = {
555
555
  update: "update",
556
556
  clear: "clear",
557
557
  };
558
+
559
+ // Default thinking effort level, available options: 'lite', 'standard', 'pro'
560
+ // This level can be defined by the user in the config file to influence reasoning effort mapping
561
+ export const DEFAULT_THINKING_EFFORT_LEVEL = "standard";
562
+
563
+ // Default reasoning effort level, available options: 'minimal', 'low', 'medium', 'high'
564
+ export const DEFAULT_REASONING_EFFORT_LEVEL = "low";
565
+
566
+ export const DEFAULT_REASONING_EFFORT_VALUE = 500;
567
+
568
+ export const REASONING_EFFORT_LEVELS = {
569
+ minimal: {
570
+ lite: 100,
571
+ standard: 300,
572
+ pro: 500,
573
+ },
574
+ low: {
575
+ lite: 200,
576
+ standard: 500,
577
+ pro: 1000,
578
+ },
579
+ medium: {
580
+ lite: 300,
581
+ standard: 800,
582
+ pro: 1500,
583
+ },
584
+ high: {
585
+ lite: 500,
586
+ standard: 1000,
587
+ pro: 2000,
588
+ },
589
+ };