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

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,26 @@
1
1
  # Changelog
2
2
 
3
+ ## [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
+
5
+
6
+ ### Features
7
+
8
+ * 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))
9
+ * **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))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * 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))
15
+
16
+ ## [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)
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * make paid deployment more smooth stable ([#266](https://github.com/AIGNE-io/aigne-doc-smith/issues/266)) ([ce8c00a](https://github.com/AIGNE-io/aigne-doc-smith/commit/ce8c00ab3eb045c482e07dc3c4e3bd149e754a06))
22
+ * validate docsDir on init and ensure latest doc on view after publish ([#267](https://github.com/AIGNE-io/aigne-doc-smith/issues/267)) ([e45864d](https://github.com/AIGNE-io/aigne-doc-smith/commit/e45864da4a7fb5b09af2bbffdb7ca93abd74397c))
23
+
3
24
  ## [0.8.15-beta.12](https://github.com/AIGNE-io/aigne-doc-smith/compare/v0.8.15-beta.11...v0.8.15-beta.12) (2025-11-05)
4
25
 
5
26
 
@@ -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
@@ -21,9 +21,12 @@ import {
21
21
  validatePath,
22
22
  } from "../../utils/utils.mjs";
23
23
  import { isRemoteFile } from "../../utils/file-utils.mjs";
24
+ import { validateDocDir } from "./validate.mjs";
24
25
 
25
26
  const _PRESS_ENTER_TO_FINISH = "Press Enter to finish";
26
27
 
28
+ const DEFAULT_REASONING_EFFORT = 502;
29
+
27
30
  /**
28
31
  * Guides the user through a multi-turn dialog to generate a YAML configuration file.
29
32
  * @param {Object} params
@@ -31,7 +34,15 @@ const _PRESS_ENTER_TO_FINISH = "Press Enter to finish";
31
34
  * @param {string} params.fileName - The name of the file.
32
35
  * @returns {Promise<Object>}
33
36
  */
34
- export default async function init(
37
+ export default async function init(input, options) {
38
+ const config = await _init(input, options);
39
+
40
+ options.context.userContext.reasoningEffort = config.reasoningEffort || DEFAULT_REASONING_EFFORT;
41
+
42
+ return config;
43
+ }
44
+
45
+ async function _init(
35
46
  {
36
47
  outputPath = ".aigne/doc-smith",
37
48
  fileName = "config.yaml",
@@ -64,7 +75,19 @@ export default async function init(
64
75
  // Only skip if file exists AND has non-empty content
65
76
  if (configContent && configContent.trim() !== "") {
66
77
  // load config from file
67
- return loadConfig({ config: filePath, appUrl });
78
+ const config = await loadConfig({ config: filePath, appUrl });
79
+ const isValid = validateDocDir(config.docsDir);
80
+ if (typeof isValid === "string") {
81
+ console.log(
82
+ `${chalk.red("Invalid docsDir")}: ${isValid}\nPlease check your configuration.`,
83
+ );
84
+ process.exit(1);
85
+ }
86
+ if (!isValid) {
87
+ console.log(`${chalk.red("Invalid docsDir")}, please check your configuration.`);
88
+ process.exit(1);
89
+ }
90
+ return config;
68
91
  }
69
92
  }
70
93
 
@@ -241,6 +264,7 @@ export default async function init(
241
264
  const docsDirInput = await options.prompts.input({
242
265
  message: `📁 [7/9]: Where should we save your documentation?`,
243
266
  default: `${outputPath}/docs`,
267
+ validate: validateDocDir,
244
268
  });
245
269
  input.docsDir = docsDirInput.trim() || `${outputPath}/docs`;
246
270
 
@@ -374,6 +398,8 @@ export default async function init(
374
398
  input.projectDesc = projectInfo.description;
375
399
  input.projectLogo = projectInfo.icon;
376
400
 
401
+ input.reasoningEffort = DEFAULT_REASONING_EFFORT;
402
+
377
403
  // Generate YAML content
378
404
  const yamlContent = generateYAML(input, outputPath);
379
405
 
@@ -424,6 +450,8 @@ export function generateYAML(input) {
424
450
  projectDesc: input.projectDesc || "",
425
451
  projectLogo: input.projectLogo || "",
426
452
 
453
+ reasoningEffort: input.reasoningEffort || 502,
454
+
427
455
  // Documentation configuration
428
456
  documentPurpose: input.documentPurpose || [],
429
457
  targetAudienceTypes: input.targetAudienceTypes || [],
@@ -459,6 +487,18 @@ export function generateYAML(input) {
459
487
 
460
488
  yaml += `${projectSection}\n\n`;
461
489
 
490
+ const modelSection = yamlStringify({
491
+ reasoningEffort: config.reasoningEffort,
492
+ }).trim();
493
+
494
+ 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.
499
+ ${modelSection}
500
+ \n`;
501
+
462
502
  // Add documentation configuration with comments
463
503
  yaml += "# =============================================================================\n";
464
504
  yaml += "# Documentation Configuration\n";
@@ -0,0 +1,16 @@
1
+ import path from "node:path";
2
+ export function validateDocDir(input) {
3
+ const currentDir = process.cwd();
4
+ const targetDir = path.resolve(input);
5
+ const relativePath = path.relative(currentDir, targetDir);
6
+ if (relativePath.length === 0) {
7
+ return `Can't use current directory: ${targetDir}`;
8
+ }
9
+ if (relativePath.startsWith("..")) {
10
+ return `Can't use directory outside current directory: ${targetDir}`;
11
+ }
12
+ if (path.isAbsolute(relativePath)) {
13
+ return `Can't use absolute path: ${targetDir}`;
14
+ }
15
+ return true;
16
+ }
@@ -163,8 +163,13 @@ export default async function publishDocs(
163
163
  } else {
164
164
  console.log(`\nCreating a new website for your documentation...`);
165
165
  }
166
- const { appUrl: homeUrl, token: ltToken } = (await deploy(id, paymentLink)) || {};
166
+ const {
167
+ appUrl: homeUrl,
168
+ token: ltToken,
169
+ sessionId: newSessionId,
170
+ } = (await deploy(id, paymentLink)) || {};
167
171
 
172
+ sessionId = newSessionId;
168
173
  appUrl = homeUrl;
169
174
  token = ltToken;
170
175
  } catch (error) {
@@ -174,13 +179,7 @@ export default async function publishDocs(
174
179
  }
175
180
  }
176
181
 
177
- if (sessionId) {
178
- authToken = await getOfficialAccessToken(BASE_URL, false);
179
- client = client || new BrokerClient({ baseUrl: BASE_URL, authToken });
180
-
181
- const { vendors } = await client.getSessionDetail(sessionId, false);
182
- token = vendors?.find((vendor) => vendor.vendorType === "launcher" && vendor.token)?.token;
183
- }
182
+ appUrl = appUrl ?? CLOUD_SERVICE_URL_PROD;
184
183
 
185
184
  console.log(`\nPublishing your documentation to ${chalk.cyan(appUrl)}\n`);
186
185
 
@@ -264,8 +263,15 @@ export default async function publishDocs(
264
263
  await saveValueToConfig("shouldSyncBranding", "", "Should sync branding for documentation");
265
264
  } else {
266
265
  // If the error is 401 or 403, it means the access token is invalid
267
- if (error?.includes("401") || error?.includes("403")) {
268
- message = `❌ Publishing failed due to an authorization error. Please 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
+ }
269
275
  }
270
276
  }
271
277
 
@@ -208,13 +208,14 @@ export default async function userReviewDocument({ content, description, ...rest
208
208
 
209
209
  try {
210
210
  // Call updateDocument agent with feedback
211
- await options.context.invoke(updateAgent, {
211
+ const result = await options.context.invoke(updateAgent, {
212
212
  ...rest,
213
213
  originalContent: options.context.userContext.currentContent,
214
214
  feedback: feedback.trim(),
215
215
  userPreferences,
216
216
  title,
217
217
  });
218
+ options.context.userContext.currentContent = result.content;
218
219
 
219
220
  // Check if feedback should be saved as user preference
220
221
  const feedbackRefinerAgent = options.context.agents["checkFeedbackRefiner"];
@@ -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
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.12",
3
+ "version": "0.8.15-beta.14",
4
4
  "description": "AI-driven documentation generation tool built on the AIGNE Framework",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -24,14 +24,14 @@
24
24
  "author": "Arcblock <blocklet@arcblock.io> https://github.com/blocklet",
25
25
  "license": "Elastic-2.0",
26
26
  "dependencies": {
27
- "@aigne/aigne-hub": "^0.10.0",
28
- "@aigne/anthropic": "^0.14.0",
29
- "@aigne/cli": "^1.49.1",
30
- "@aigne/core": "^1.61.0",
31
- "@aigne/gemini": "^0.14.0",
32
- "@aigne/openai": "^0.16.0",
33
- "@aigne/publish-docs": "^0.12.0",
34
- "@blocklet/payment-broker-client": "^1.21.10",
27
+ "@aigne/aigne-hub": "^0.10.5-beta.3",
28
+ "@aigne/anthropic": "^0.14.5-beta.3",
29
+ "@aigne/cli": "^1.53.1-beta.4",
30
+ "@aigne/core": "^1.65.1-beta.3",
31
+ "@aigne/gemini": "^0.14.5-beta.3",
32
+ "@aigne/openai": "^0.16.5-beta.3",
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",
@@ -18,6 +18,11 @@ The following are the available enhanced attributes and their descriptions:
18
18
  * `language` and `title` are written directly after \`\`\`, separated by spaces.
19
19
  * Other attributes (`icon`) must be provided in **key=value** format, separated by spaces.
20
20
 
21
+ ### Special Rules
22
+ - If the language is a shell (includes `sh`, `bash`, `zsh`, etc.):
23
+ - Executable shell code blocks must be a single-line command to make copying and running easier.
24
+ - Do not include comments inside executable shell code blocks; place explanatory comments outside the code block.
25
+
21
26
  ### Examples
22
27
 
23
28
  <code_block_good_examples>
@@ -70,9 +75,26 @@ class ShoppingCart {
70
75
  }
71
76
  }
72
77
  ```
78
+
79
+ **Example 5: Shell code block should in one line**
80
+
81
+ ```sh Install aigne deps icon=lucide:terminal
82
+ npm i -g @aigne/cli @aigne/doc-smith @aigne/websmith-smith
83
+ ```
84
+
85
+ **Example 6: Shell code block use `\` to split multiple lines**
86
+ ```bash Deploying with Access Keys icon=lucide:terminal
87
+ blocklet deploy . \
88
+ --endpoint https://my-server.arcblock.io \
89
+ --access-key 'your_access_key_id' \
90
+ --access-secret 'your_access_key_secret' \
91
+ --app-id z2qa9sD2tFAP8gM7C1i8iETg3a1T3A3aT3bQ
92
+ ```
93
+
73
94
  </code_block_good_examples>
74
95
 
75
96
  <code_block_bad_examples>
97
+
76
98
  **Example 1**
77
99
 
78
100
  There are two errors in this example:
@@ -97,5 +119,18 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
97
119
  }
98
120
  ```
99
121
 
122
+ **Example 2: shell code block have multiple lines**
123
+ ```sh
124
+ npm i -g @aigne/cli
125
+ npm i -g @aigne/doc-smith
126
+ npm i -g @aigne/websmith-smith
127
+ ```
128
+
129
+ **Example 3: shell code block comments**
130
+ ```sh
131
+ # add aigne deps
132
+ npm i -g @aigne/cli
133
+ ```
134
+
100
135
  </code_block_bad_examples>
101
- </enhanced_code_block_rules>
136
+ </enhanced_code_block_rules>
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 }) => {
@@ -71,7 +72,7 @@ export async function deploy(id, cachedUrl) {
71
72
  },
72
73
  });
73
74
 
74
- const { appUrl, homeUrl, subscriptionUrl, dashboardUrl, vendors } = result;
75
+ const { appUrl, homeUrl, subscriptionUrl, dashboardUrl, vendors, sessionId } = result;
75
76
  const token = vendors?.[0]?.token;
76
77
 
77
78
  return {
@@ -80,5 +81,6 @@ export async function deploy(id, cachedUrl) {
80
81
  dashboardUrl,
81
82
  subscriptionUrl,
82
83
  token,
84
+ sessionId,
83
85
  };
84
86
  }