@aigne/doc-smith 0.8.14-beta → 0.8.14-beta.2
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 +15 -0
- package/agents/generate/check-diagram.mjs +4 -4
- package/agents/generate/draw-diagram.yaml +1 -1
- package/agents/generate/wrap-diagram-code.mjs +4 -4
- package/agents/publish/publish-docs.mjs +60 -31
- package/agents/update/generate-document.yaml +1 -1
- package/agents/utils/update-branding.mjs +14 -2
- package/package.json +1 -1
- package/prompts/detail/d2-diagram/guide.md +26 -22
- package/prompts/detail/d2-diagram/role-and-personality.md +1 -1
- package/prompts/detail/d2-diagram/rules.md +25 -20
- package/prompts/detail/d2-diagram/system-prompt.md +6 -4
- package/prompts/detail/d2-diagram/user-prompt.md +1 -1
- package/prompts/detail/generate/system-prompt.md +5 -0
- package/prompts/detail/generate/user-prompt.md +1 -1
- package/utils/deploy.mjs +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.8.14-beta.2](https://github.com/AIGNE-io/aigne-doc-smith/compare/v0.8.14-beta.1...v0.8.14-beta.2) (2025-10-19)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* polish d2-diagram insert result ([#205](https://github.com/AIGNE-io/aigne-doc-smith/issues/205)) ([0098ff0](https://github.com/AIGNE-io/aigne-doc-smith/commit/0098ff08609e0bfe930a1b733b68299d356f73ed))
|
|
9
|
+
|
|
10
|
+
## [0.8.14-beta.1](https://github.com/AIGNE-io/aigne-doc-smith/compare/v0.8.14-beta...v0.8.14-beta.1) (2025-10-17)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* doc review and update ([#199](https://github.com/AIGNE-io/aigne-doc-smith/issues/199)) ([0061323](https://github.com/AIGNE-io/aigne-doc-smith/commit/006132345a17a7fae10a803656b731144ecc54c9))
|
|
16
|
+
* respect env vars for publish and improve reliability ([#204](https://github.com/AIGNE-io/aigne-doc-smith/issues/204)) ([bd14c2a](https://github.com/AIGNE-io/aigne-doc-smith/commit/bd14c2af54ebca89c8edb5861e3b1a6e3f76e92e))
|
|
17
|
+
|
|
3
18
|
## [0.8.14-beta](https://github.com/AIGNE-io/aigne-doc-smith/compare/v0.8.13...v0.8.14-beta) (2025-10-16)
|
|
4
19
|
|
|
5
20
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { checkContent } from "../../utils/d2-utils.mjs";
|
|
2
2
|
|
|
3
|
-
export default async function checkD2DiagramIsValid({
|
|
3
|
+
export default async function checkD2DiagramIsValid({ diagramSourceCode }) {
|
|
4
4
|
try {
|
|
5
|
-
await checkContent({ content:
|
|
5
|
+
await checkContent({ content: diagramSourceCode });
|
|
6
6
|
return {
|
|
7
7
|
isValid: true,
|
|
8
8
|
};
|
|
@@ -17,12 +17,12 @@ export default async function checkD2DiagramIsValid({ output }) {
|
|
|
17
17
|
checkD2DiagramIsValid.input_schema = {
|
|
18
18
|
type: "object",
|
|
19
19
|
properties: {
|
|
20
|
-
|
|
20
|
+
diagramSourceCode: {
|
|
21
21
|
type: "string",
|
|
22
22
|
description: "Source code of d2 diagram",
|
|
23
23
|
},
|
|
24
24
|
},
|
|
25
|
-
required: ["
|
|
25
|
+
required: ["diagramSourceCode"],
|
|
26
26
|
};
|
|
27
27
|
checkD2DiagramIsValid.output_schema = {
|
|
28
28
|
type: "object",
|
|
@@ -10,7 +10,7 @@ input_schema:
|
|
|
10
10
|
properties:
|
|
11
11
|
documentContent:
|
|
12
12
|
type: string
|
|
13
|
-
description: The **raw text content** of the current document. (**Note:** This is the original document and **does not include** any
|
|
13
|
+
description: The **raw text content** of the current document. (**Note:** This is the original document and **does not include** any diagram source code.)
|
|
14
14
|
required:
|
|
15
15
|
- documentContent
|
|
16
16
|
output_schema:
|
|
@@ -4,11 +4,11 @@ export default async function wrapDiagramCode({ diagramSourceCode }) {
|
|
|
4
4
|
try {
|
|
5
5
|
const result = await wrapCode({ content: diagramSourceCode });
|
|
6
6
|
return {
|
|
7
|
-
|
|
7
|
+
diagramSourceCode: result,
|
|
8
8
|
};
|
|
9
9
|
} catch {
|
|
10
10
|
return {
|
|
11
|
-
|
|
11
|
+
diagramSourceCode,
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -26,10 +26,10 @@ wrapDiagramCode.input_schema = {
|
|
|
26
26
|
wrapDiagramCode.output_schema = {
|
|
27
27
|
type: "object",
|
|
28
28
|
properties: {
|
|
29
|
-
|
|
29
|
+
diagramSourceCode: {
|
|
30
30
|
type: "string",
|
|
31
31
|
description: "Source code of d2 diagram",
|
|
32
32
|
},
|
|
33
33
|
},
|
|
34
|
-
required: ["
|
|
34
|
+
required: ["diagramSourceCode"],
|
|
35
35
|
};
|
|
@@ -57,29 +57,27 @@ export default async function publishDocs(
|
|
|
57
57
|
|
|
58
58
|
// ----------------- main publish process flow -----------------------------
|
|
59
59
|
// Check if DOC_DISCUSS_KIT_URL is set in environment variables
|
|
60
|
-
const
|
|
61
|
-
const useEnvAppUrl = !!envAppUrl;
|
|
62
|
-
|
|
63
|
-
// Use environment variable if available, otherwise use the provided appUrl
|
|
64
|
-
if (useEnvAppUrl) {
|
|
65
|
-
appUrl = envAppUrl;
|
|
66
|
-
}
|
|
60
|
+
const useEnvAppUrl = !!(process.env.DOC_DISCUSS_KIT_URL || appUrl);
|
|
67
61
|
|
|
68
62
|
// Check if appUrl is default and not saved in config (only when not using env variable)
|
|
69
63
|
const config = await loadConfigFromFile();
|
|
70
|
-
|
|
71
|
-
const
|
|
64
|
+
appUrl = process.env.DOC_DISCUSS_KIT_URL || appUrl || config?.appUrl;
|
|
65
|
+
const hasInputAppUrl = !!appUrl;
|
|
72
66
|
|
|
67
|
+
let shouldSyncBranding = void 0;
|
|
73
68
|
let token = "";
|
|
69
|
+
let client = null;
|
|
70
|
+
let authToken = null;
|
|
71
|
+
let sessionId = null;
|
|
74
72
|
|
|
75
|
-
if (!
|
|
76
|
-
|
|
73
|
+
if (!hasInputAppUrl) {
|
|
74
|
+
authToken = await getOfficialAccessToken(BASE_URL, false);
|
|
77
75
|
|
|
78
|
-
|
|
76
|
+
sessionId = "";
|
|
79
77
|
let paymentLink = "";
|
|
80
78
|
|
|
81
79
|
if (authToken) {
|
|
82
|
-
|
|
80
|
+
client = new BrokerClient({ baseUrl: BASE_URL, authToken });
|
|
83
81
|
const info = await client.checkCacheSession({
|
|
84
82
|
needShortUrl: true,
|
|
85
83
|
sessionId: config?.checkoutId,
|
|
@@ -135,29 +133,60 @@ export default async function publishDocs(
|
|
|
135
133
|
// Ensure appUrl has protocol
|
|
136
134
|
appUrl = userInput.includes("://") ? userInput : `https://${userInput}`;
|
|
137
135
|
} else if (["new-instance", "new-instance-continue"].includes(choice)) {
|
|
138
|
-
|
|
139
|
-
shouldWithBranding = await options.prompts.confirm({
|
|
140
|
-
message: "Would you like to update the project branding (title, description, logo)?",
|
|
141
|
-
default: true,
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
// Deploy a new Discuss Kit service
|
|
145
|
-
let id = "";
|
|
146
|
-
let paymentUrl = "";
|
|
136
|
+
// resume previous website setup
|
|
147
137
|
if (choice === "new-instance-continue") {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
console.log(`\nCreating a new website for your documentation...`);
|
|
138
|
+
shouldSyncBranding = config?.shouldSyncBranding ?? void 0;
|
|
139
|
+
if (shouldSyncBranding !== void 0) {
|
|
140
|
+
shouldWithBranding = shouldWithBranding ?? shouldSyncBranding;
|
|
141
|
+
}
|
|
153
142
|
}
|
|
154
|
-
const { appUrl: homeUrl, token: ltToken } = (await deploy(id, paymentUrl)) || {};
|
|
155
143
|
|
|
156
|
-
|
|
157
|
-
|
|
144
|
+
if (options?.prompts?.confirm) {
|
|
145
|
+
if (shouldSyncBranding === void 0) {
|
|
146
|
+
shouldSyncBranding = await options.prompts.confirm({
|
|
147
|
+
message: "Would you like to update the project branding (title, description, logo)?",
|
|
148
|
+
default: true,
|
|
149
|
+
});
|
|
150
|
+
await saveValueToConfig(
|
|
151
|
+
"shouldSyncBranding",
|
|
152
|
+
shouldSyncBranding,
|
|
153
|
+
"Should sync branding for documentation",
|
|
154
|
+
);
|
|
155
|
+
shouldWithBranding = shouldSyncBranding;
|
|
156
|
+
} else {
|
|
157
|
+
console.log(
|
|
158
|
+
`Would you like to update the project branding (title, description, logo)? ${chalk.cyan(shouldSyncBranding ? "Yes" : "No")}`,
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
try {
|
|
164
|
+
let id = "";
|
|
165
|
+
if (choice === "new-instance-continue") {
|
|
166
|
+
id = sessionId;
|
|
167
|
+
console.log(`\nResuming your previous website setup...`);
|
|
168
|
+
} else {
|
|
169
|
+
console.log(`\nCreating a new website for your documentation...`);
|
|
170
|
+
}
|
|
171
|
+
const { appUrl: homeUrl, token: ltToken } = (await deploy(id, paymentLink)) || {};
|
|
172
|
+
|
|
173
|
+
appUrl = homeUrl;
|
|
174
|
+
token = ltToken;
|
|
175
|
+
} catch (error) {
|
|
176
|
+
const errorMsg = error?.message || "Unknown error occurred";
|
|
177
|
+
return { message: `${chalk.red("❌ Failed to create website:")} ${errorMsg}` };
|
|
178
|
+
}
|
|
158
179
|
}
|
|
159
180
|
}
|
|
160
181
|
|
|
182
|
+
if (sessionId) {
|
|
183
|
+
authToken = await getOfficialAccessToken(BASE_URL, false);
|
|
184
|
+
client = client || new BrokerClient({ baseUrl: BASE_URL, authToken });
|
|
185
|
+
|
|
186
|
+
const { vendors } = await client.getSessionDetail(sessionId, false);
|
|
187
|
+
token = vendors?.find((vendor) => vendor.vendorType === "launcher" && vendor.token)?.token;
|
|
188
|
+
}
|
|
189
|
+
|
|
161
190
|
console.log(`\nPublishing your documentation to ${chalk.cyan(appUrl)}\n`);
|
|
162
191
|
|
|
163
192
|
const accessToken = await getAccessToken(appUrl, token);
|
|
@@ -237,6 +266,7 @@ export default async function publishDocs(
|
|
|
237
266
|
}
|
|
238
267
|
message = `✅ Documentation published successfully!`;
|
|
239
268
|
await saveValueToConfig("checkoutId", "", "Checkout ID for document deployment service");
|
|
269
|
+
await saveValueToConfig("shouldSyncBranding", "", "Should sync branding for documentation");
|
|
240
270
|
} else {
|
|
241
271
|
// If the error is 401 or 403, it means the access token is invalid
|
|
242
272
|
if (error?.includes("401") || error?.includes("403")) {
|
|
@@ -271,7 +301,6 @@ publishDocs.input_schema = {
|
|
|
271
301
|
appUrl: {
|
|
272
302
|
type: "string",
|
|
273
303
|
description: "The URL of the app.",
|
|
274
|
-
default: CLOUD_SERVICE_URL_PROD,
|
|
275
304
|
},
|
|
276
305
|
boardId: {
|
|
277
306
|
type: "string",
|
|
@@ -75,7 +75,7 @@ skills:
|
|
|
75
75
|
properties:
|
|
76
76
|
documentContent:
|
|
77
77
|
type: string
|
|
78
|
-
description: The **raw text content** of the current document. (**Note:** This is the original document and **does not include** any
|
|
78
|
+
description: The **raw text content** of the current document. (**Note:** This is the original document and **does not include** any diagram source code.)
|
|
79
79
|
required:
|
|
80
80
|
- documentContent
|
|
81
81
|
output_schema:
|
|
@@ -25,6 +25,18 @@ export default async function updateBranding({ appUrl, projectInfo, accessToken,
|
|
|
25
25
|
const componentInfo = await getComponentInfoWithMountPoint(origin, DISCUSS_KIT_DID);
|
|
26
26
|
const mountPoint = componentInfo.mountPoint || "/";
|
|
27
27
|
|
|
28
|
+
if (projectInfo.name.length > 40) {
|
|
29
|
+
console.warn(
|
|
30
|
+
`⚠️ Name is too long, it should be less than 40 characters\nWill be truncated to 40 characters`,
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (projectInfo.description.length > 160) {
|
|
35
|
+
console.warn(
|
|
36
|
+
`⚠️ Description is too long, it should be less than 160 characters\nWill be truncated to 160 characters`,
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
28
40
|
const res = await requestWithAuthToken(
|
|
29
41
|
joinURL(origin, mountPoint, "/api/branding"),
|
|
30
42
|
{
|
|
@@ -33,8 +45,8 @@ export default async function updateBranding({ appUrl, projectInfo, accessToken,
|
|
|
33
45
|
"Content-Type": "application/json",
|
|
34
46
|
},
|
|
35
47
|
body: JSON.stringify({
|
|
36
|
-
appName: projectInfo.name,
|
|
37
|
-
appDescription: projectInfo.description,
|
|
48
|
+
appName: projectInfo.name.slice(0, 40),
|
|
49
|
+
appDescription: projectInfo.description.slice(0, 160),
|
|
38
50
|
}),
|
|
39
51
|
},
|
|
40
52
|
accessToken,
|
package/package.json
CHANGED
|
@@ -1,25 +1,29 @@
|
|
|
1
1
|
<diagram_generation_guide>
|
|
2
|
-
1. Diagram Triggers and Types: Use the following guidelines to determine when to generate a diagram and which type to use.
|
|
3
|
-
- Rule for Skipping Diagrams:
|
|
4
|
-
- Trigger: Do not generate diagrams for purely textual, reference, or short note documents that describe abstract concepts, simple definitions, or FAQs.
|
|
5
|
-
- Action: Skip diagram generation entirely.
|
|
6
|
-
- Architecture Diagram (High-Level)
|
|
7
|
-
- Trigger: When generating a document that serves as a high-level overview of a system, project, or the entire documentation set.
|
|
8
|
-
- Action: Create a system architecture diagram.
|
|
9
|
-
- Content: The diagram should illustrate the main components, their relationships, and the overall structure.
|
|
10
|
-
- Structural Diagram (Module-Level)
|
|
11
|
-
- Trigger: When generating the introductory document for a major section or module.
|
|
12
|
-
- Action: Create a structural diagram (e.g., a block diagram or mind map).
|
|
13
|
-
- Content: The diagram should show the key sub-components, files, or concepts within that specific module.
|
|
14
|
-
- Process and Interaction Diagrams (Detailed)
|
|
15
|
-
- Trigger: When the document describes a workflow, a sequence of events, user interactions, or data flow.
|
|
16
|
-
- Action: Create the most appropriate diagram type:
|
|
17
|
-
- Flowchart: Use for step-by-step processes, algorithms, or decision-making logic.
|
|
18
|
-
- Sequence Diagram: Use for time-ordered interactions between different components or actors (e.g., API calls).
|
|
19
|
-
NOTE: For documents not skipped by the first rule but not clearly fitting the above categories, you should always attempt to generate at least one Diagram whenever possible to visually represent key structures, relationships, or processes in the content.
|
|
20
2
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
3
|
+
1. Core Principles and Mandatory Constraints
|
|
4
|
+
- **Absolute Constraint (Mandatory)**: You **must only** call the `generateDiagram` tool to generate a diagram.
|
|
5
|
+
- **Do not** generate mermaid diagram.
|
|
6
|
+
- **Do not** generate base64 image.
|
|
7
|
+
- **Do not** generate fake image url.
|
|
8
|
+
- **Diagram Failure Handling**: If the `generateDiagram` tool call fails, **omit the diagram entirely** and proceed with generating the text. **Do not** attempt to describe the diagram in words as a replacement.
|
|
9
|
+
|
|
10
|
+
2. Diagram Triggers and Types: Call `generateDiagram` and select the most appropriate type when describing the following specific content
|
|
11
|
+
- Architecture Diagram (High-Level)
|
|
12
|
+
- **Trigger**: When the document provides a high-level overview of a system, project, or the overall documentation set.
|
|
13
|
+
- **Content**: Must illustrate the main components, their relationships, and the overall structure.
|
|
14
|
+
- Structural Diagram (Module-Level)
|
|
15
|
+
- **Trigger**: When generating the introductory document for a major section or module.
|
|
16
|
+
- **Content**: Must show the key sub-components, files, or core concepts within that specific module.
|
|
17
|
+
- Process and Interaction Diagrams (Detailed)
|
|
18
|
+
- **Trigger**: When the document describes a workflow, a sequence of events, user interactions, or data flow.
|
|
19
|
+
- **Diagram Type Selection**:
|
|
20
|
+
- **Flowchart**: Use for step-by-step processes, algorithms, or decision-making logic.
|
|
21
|
+
- **Sequence Diagram**: Use for time-ordered interactions between different components or actors (e.g., API calls).
|
|
22
|
+
3. Constraints and Best Practices
|
|
23
|
+
- **Quantity Limit**: Generate a maximum of **three** diagrams per document.
|
|
24
|
+
- **Relevance**: Ensure every diagram **directly** illustrates a concept explained in the surrounding text. Avoid generating diagrams for simple concepts that are easily understood through text alone.
|
|
25
|
+
4. Tool result using rules
|
|
26
|
+
- If the `generateDiagram` tool's result (`diagramSourceCode`) is present, insert the value of `diagramSourceCode` directly into the document as a string.
|
|
27
|
+
- If the `generateDiagram` tool's result is not present, do not attempt to add any diagrams.
|
|
28
|
+
|
|
25
29
|
</diagram_generation_guide>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
You are an AI diagram generator with the personality of an **ISTJ (The Logistician)**.
|
|
2
|
-
You are reliable, rule-abiding, and methodical. Your goal is to produce **clear, precise, and logically structured d2
|
|
2
|
+
You are reliable, rule-abiding, and methodical. Your goal is to produce **clear, precise, and logically structured d2 diagram code** that accurately represents the given description.
|
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
<diagram_generation_guide>
|
|
2
|
-
1. Core Principle: Tool Use is Mandatory
|
|
3
|
-
- You MUST use the drawDiagram tool to generate and embed all diagrams.
|
|
4
|
-
- NEVER write raw diagram code (e.g., Mermaid syntax) directly into the document.
|
|
5
|
-
- If a drawDiagram tool call fails, omit the diagram entirely and proceed with generating the text. Do not attempt to describe the diagram in words as a replacement.
|
|
6
2
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
3
|
+
1. Core Principles and Mandatory Constraints
|
|
4
|
+
- **Absolute Constraint (Mandatory)**: You **must only** call the `generateDiagram` tool to generate a diagram.
|
|
5
|
+
- **Do not** generate mermaid diagram.
|
|
6
|
+
- **Do not** generate base64 image.
|
|
7
|
+
- **Do not** generate fake image url.
|
|
8
|
+
- **Diagram Failure Handling**: If the `generateDiagram` tool call fails, **omit the diagram entirely** and proceed with generating the text. **Do not** attempt to describe the diagram in words as a replacement.
|
|
9
|
+
|
|
10
|
+
2. Diagram Triggers and Types: Call `generateDiagram` and select the most appropriate type when describing the following specific content
|
|
11
|
+
- Architecture Diagram (High-Level)
|
|
12
|
+
- **Trigger**: When the document provides a high-level overview of a system, project, or the overall documentation set.
|
|
13
|
+
- **Content**: Must illustrate the main components, their relationships, and the overall structure.
|
|
14
|
+
- Structural Diagram (Module-Level)
|
|
15
|
+
- **Trigger**: When generating the introductory document for a major section or module.
|
|
16
|
+
- **Content**: Must show the key sub-components, files, or core concepts within that specific module.
|
|
17
|
+
- Process and Interaction Diagrams (Detailed)
|
|
18
|
+
- **Trigger**: When the document describes a workflow, a sequence of events, user interactions, or data flow.
|
|
19
|
+
- **Diagram Type Selection**:
|
|
20
|
+
- **Flowchart**: Use for step-by-step processes, algorithms, or decision-making logic.
|
|
21
|
+
- **Sequence Diagram**: Use for time-ordered interactions between different components or actors (e.g., API calls).
|
|
21
22
|
3. Constraints and Best Practices
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
- **Quantity Limit**: Generate a maximum of **three** diagrams per document.
|
|
24
|
+
- **Relevance**: Ensure every diagram **directly** illustrates a concept explained in the surrounding text. Avoid generating diagrams for simple concepts that are easily understood through text alone.
|
|
25
|
+
4. Tool result using rules
|
|
26
|
+
- If the `generateDiagram` tool's result (`diagramSourceCode`) is present, insert the value of `diagramSourceCode` directly into the document as a string.
|
|
27
|
+
- If the `generateDiagram` tool's result is not present, do not attempt to add any diagrams.
|
|
28
|
+
|
|
24
29
|
</diagram_generation_guide>
|
|
@@ -35,7 +35,7 @@ Your diagrams should focus on **readability, structural correctness, and practic
|
|
|
35
35
|
- Avoid unnecessary stylistic complexity that may hinder future maintenance.
|
|
36
36
|
|
|
37
37
|
**Output Requirements:**
|
|
38
|
-
- Output only valid d2
|
|
38
|
+
- Output only valid d2 diagram code.
|
|
39
39
|
- Do not include explanatory text outside of the code block.
|
|
40
40
|
- Ensure the diagram reflects a clean, professional, technical drawing.
|
|
41
41
|
|
|
@@ -1006,7 +1006,9 @@ Ensure that the shape names used in connections are accurate and match the actua
|
|
|
1006
1006
|
User -> CLI: "blocklet init"
|
|
1007
1007
|
```
|
|
1008
1008
|
|
|
1009
|
-
####
|
|
1009
|
+
#### Don't forget to add `shape: sequence_diagram` to sequence diagram
|
|
1010
|
+
|
|
1011
|
+
> Don't use alt as shape name
|
|
1010
1012
|
|
|
1011
1013
|
- **Bad Practice:**
|
|
1012
1014
|
```d2
|
|
@@ -1084,12 +1086,12 @@ Ensure that the shape names used in connections are accurate and match the actua
|
|
|
1084
1086
|
Blocklet-Service -> Application.Auth-Middleware: "4. Return permissions"
|
|
1085
1087
|
Application.Auth-Middleware -> Application.Auth-Middleware: "5. Evaluate all rules"
|
|
1086
1088
|
|
|
1087
|
-
|
|
1089
|
+
"If Authorized" {
|
|
1088
1090
|
Application.Auth-Middleware -> Application.Protected-Route: "6a. next()"
|
|
1089
1091
|
Application.Protected-Route -> Client: "7a. 200 OK Response"
|
|
1090
1092
|
}
|
|
1091
1093
|
|
|
1092
|
-
|
|
1094
|
+
"If Forbidden" {
|
|
1093
1095
|
Application.Auth-Middleware -> Client: "6b. 403 Forbidden Response"
|
|
1094
1096
|
}
|
|
1095
1097
|
```
|
|
@@ -45,6 +45,10 @@ Custom code block generation rules:
|
|
|
45
45
|
|
|
46
46
|
{% include "../d2-diagram/guide.md" %}
|
|
47
47
|
|
|
48
|
+
Tool result usage rules:
|
|
49
|
+
- Only use the `"role": "tool"` result as the datasource for document enhancement.
|
|
50
|
+
- Do not include `"role": "agent"` content in the final output.
|
|
51
|
+
|
|
48
52
|
</content_generation_rules>
|
|
49
53
|
|
|
50
54
|
|
|
@@ -54,5 +58,6 @@ Custom code block generation rules:
|
|
|
54
58
|
1. Output the complete Markdown content for {{nodeName}}, only the content itself—no explanations or extra information.
|
|
55
59
|
2. Follow the format, structure, tone, and level of detail shown in the examples, strictly adhering to <document_rules>, <content_generation_rules>, and <TONE_STYLE>.
|
|
56
60
|
3. Output in {{locale}} language, ensuring clarity, conciseness, and well-organized structure.
|
|
61
|
+
4. Do not include any self-introduction or conversational text. Output only the documentation content itself.
|
|
57
62
|
|
|
58
63
|
</output_constraints>
|
|
@@ -59,7 +59,7 @@ Generate detailed and well-structured document for the current {{nodeName}} base
|
|
|
59
59
|
|
|
60
60
|
YOU SHOULD:
|
|
61
61
|
- Use AFS tools `afs_list` `afs_search` or `afs_read` to gather relevant and accurate information to enhance the content.
|
|
62
|
-
- Follow rules in
|
|
62
|
+
- Follow rules in `<diagram_generation_guide>`: use `generateDiagram` tool to create and embed a diagram when appropriate, following the diagram generation guidelines.
|
|
63
63
|
|
|
64
64
|
<steps>
|
|
65
65
|
1. Analyze the provided document structure and user requirements to plan the content.
|
package/utils/deploy.mjs
CHANGED
|
@@ -42,11 +42,6 @@ export async function deploy(id, cachedUrl) {
|
|
|
42
42
|
sessionId,
|
|
43
43
|
"Checkout ID for document deployment website",
|
|
44
44
|
);
|
|
45
|
-
await saveValueToConfig(
|
|
46
|
-
"paymentUrl",
|
|
47
|
-
paymentUrl,
|
|
48
|
-
"Payment URL for document deployment website",
|
|
49
|
-
);
|
|
50
45
|
|
|
51
46
|
if (!isResuming) {
|
|
52
47
|
await open(paymentUrl);
|