@aigne/doc-smith 0.8.15-beta.13 → 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,25 @@
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
+
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)
11
+
12
+
13
+ ### Features
14
+
15
+ * add reasoning effort configuration for customizable AI model settings ([#270](https://github.com/AIGNE-io/aigne-doc-smith/issues/270)) ([9f15638](https://github.com/AIGNE-io/aigne-doc-smith/commit/9f156387120e8705bf16cf611d7f8f39995c36b3))
16
+ * **cli:** enhance auth with short link responses and detailed error reporting for publishing ([#269](https://github.com/AIGNE-io/aigne-doc-smith/issues/269)) ([31cc252](https://github.com/AIGNE-io/aigne-doc-smith/commit/31cc25236667236dfe91543acdd7e8cccff659c5))
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * use default reasoning effort for existing config ([#272](https://github.com/AIGNE-io/aigne-doc-smith/issues/272)) ([2fc9c89](https://github.com/AIGNE-io/aigne-doc-smith/commit/2fc9c89e383c1c5446f2109a2846e831d1e1e871))
22
+
3
23
  ## [0.8.15-beta.13](https://github.com/AIGNE-io/aigne-doc-smith/compare/v0.8.15-beta.12...v0.8.15-beta.13) (2025-11-05)
4
24
 
5
25
 
@@ -7,8 +7,6 @@ skills:
7
7
  iterate_on: dataSources
8
8
  skills:
9
9
  - type: ai
10
- model:
11
- reasoning_effort: 500
12
10
  instructions:
13
11
  - role: system
14
12
  url: ../../prompts/structure/generate/system-prompt.md
@@ -82,8 +80,6 @@ skills:
82
80
 
83
81
  - type: ai
84
82
  name: refineStructure
85
- model:
86
- reasoning_effort: 500
87
83
  instructions:
88
84
  - role: system
89
85
  url: ../../prompts/structure/review/structure-review-system.md
@@ -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,6 +24,7 @@ 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
 
@@ -32,7 +35,23 @@ const _PRESS_ENTER_TO_FINISH = "Press Enter to finish";
32
35
  * @param {string} params.fileName - The name of the file.
33
36
  * @returns {Promise<Object>}
34
37
  */
35
- export default async function init(
38
+ export default async function init(input, options) {
39
+ const config = await _init(input, options);
40
+
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;
50
+
51
+ return config;
52
+ }
53
+
54
+ async function _init(
36
55
  {
37
56
  outputPath = ".aigne/doc-smith",
38
57
  fileName = "config.yaml",
@@ -438,6 +457,10 @@ export function generateYAML(input) {
438
457
  projectDesc: input.projectDesc || "",
439
458
  projectLogo: input.projectLogo || "",
440
459
 
460
+ thinking: {
461
+ effort: input.thinking?.effort || DEFAULT_THINKING_EFFORT_LEVEL,
462
+ },
463
+
441
464
  // Documentation configuration
442
465
  documentPurpose: input.documentPurpose || [],
443
466
  targetAudienceTypes: input.targetAudienceTypes || [],
@@ -473,6 +496,19 @@ export function generateYAML(input) {
473
496
 
474
497
  yaml += `${projectSection}\n\n`;
475
498
 
499
+ const modelSection = yamlStringify({
500
+ thinking: config.thinking,
501
+ }).trim();
502
+
503
+ yaml += `\
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
509
+ ${modelSection}
510
+ \n`;
511
+
476
512
  // Add documentation configuration with comments
477
513
  yaml += "# =============================================================================\n";
478
514
  yaml += "# Documentation Configuration\n";
@@ -263,10 +263,15 @@ export default async function publishDocs(
263
263
  await saveValueToConfig("shouldSyncBranding", "", "Should sync branding for documentation");
264
264
  } else {
265
265
  // If the error is 401 or 403, it means the access token is invalid
266
- if (error?.includes("401")) {
267
- message = `❌ Publishing failed due to an authorization error. Please run ${chalk.cyan("aigne doc clear")} to reset your credentials and try again.`;
268
- } else if (error?.includes("403")) {
269
- message = `❌ Publishing failed due to an authorization error. \n - Please confirm you have permission to modify this document [boardId: "${newBoardId || boardId}"]. \n - Or run ${chalk.cyan("aigne doc clear")} to reset your credentials and try again.`;
266
+ try {
267
+ const obj = JSON.parse(error);
268
+ message = `❌ Publishing failed with error: \n💡 ${obj.message || error}`;
269
+ } catch {
270
+ if (error?.includes("401")) {
271
+ message = `❌ Publishing failed due to an authorization error: \n💡 Please run ${chalk.cyan("aigne doc clear")} to reset your credentials and try again.`;
272
+ } else if (error?.includes("403")) {
273
+ message = `❌ Publishing failed due to an authorization error: \n💡 You’re not the creator of this document (Board ID: ${boardId}). You can change the board ID and try again. \n💡 Or run ${chalk.cyan("aigne doc clear")} to reset your credentials and try again.`;
274
+ }
270
275
  }
271
276
  }
272
277
 
@@ -1,7 +1,5 @@
1
1
  name: analyzeFeedbackIntent
2
2
  description: Analyze user feedback to determine if data sources are needed for content modifications
3
- model:
4
- reasoning_effort: 200
5
3
  task_render_mode: hide
6
4
  instructions:
7
5
  url: ../../prompts/utils/analyze-feedback-intent.md
@@ -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/aigne.yaml CHANGED
@@ -3,8 +3,8 @@
3
3
  model:
4
4
  model: aignehub/gemini-2.5-pro # reasoning_effort 128-32768
5
5
  # https://github.com/AIGNE-io/aigne-framework/blob/main/models/gemini/src/gemini-chat-model.ts#L115
6
- reasoning_effort: 502
7
- # name: gemini-2.5-flash
6
+ reasoning_effort:
7
+ $get: reasoningEffort
8
8
  temperature: 0.8
9
9
  agents:
10
10
  # Initialization
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/doc-smith",
3
- "version": "0.8.15-beta.13",
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"
@@ -30,8 +30,8 @@
30
30
  "@aigne/core": "^1.65.1-beta.3",
31
31
  "@aigne/gemini": "^0.14.5-beta.3",
32
32
  "@aigne/openai": "^0.16.5-beta.3",
33
- "@aigne/publish-docs": "^0.12.0",
34
- "@blocklet/payment-broker-client": "^1.22.7",
33
+ "@aigne/publish-docs": "^0.12.1",
34
+ "@blocklet/payment-broker-client": "^1.22.8",
35
35
  "@terrastruct/d2": "^0.1.33",
36
36
  "chalk": "^5.5.0",
37
37
  "cli-highlight": "^2.1.11",
@@ -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
+ };
package/utils/deploy.mjs CHANGED
@@ -31,6 +31,7 @@ export async function deploy(id, cachedUrl) {
31
31
  const result = await client.deploy({
32
32
  cachedCheckoutId: id,
33
33
  cachedPaymentUrl: cachedUrl,
34
+ needShortUrl: true,
34
35
  pageInfo: { successMessage: SUCCESS_MESSAGE },
35
36
  hooks: {
36
37
  [STEPS.PAYMENT_PENDING]: async ({ sessionId, paymentUrl, isResuming }) => {