@aigne/doc-smith 0.8.12-beta.7 → 0.8.12-beta.8

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.
Files changed (47) hide show
  1. package/.aigne/doc-smith/config.yaml +1 -1
  2. package/.aigne/doc-smith/media-description.yaml +91 -0
  3. package/.aigne/doc-smith/upload-cache.yaml +6 -69
  4. package/.release-please-manifest.json +1 -1
  5. package/CHANGELOG.md +12 -0
  6. package/agents/clear/choose-contents.mjs +14 -1
  7. package/agents/clear/clear-media-description.mjs +129 -0
  8. package/agents/clear/index.yaml +3 -1
  9. package/agents/evaluate/code-snippet.mjs +28 -24
  10. package/agents/evaluate/document-structure.yaml +0 -4
  11. package/agents/evaluate/document.yaml +1 -5
  12. package/agents/generate/index.yaml +1 -0
  13. package/agents/init/index.mjs +10 -0
  14. package/agents/media/batch-generate-media-description.yaml +44 -0
  15. package/agents/media/generate-media-description.yaml +47 -0
  16. package/agents/media/load-media-description.mjs +238 -0
  17. package/agents/update/index.yaml +1 -0
  18. package/agents/utils/load-sources.mjs +103 -53
  19. package/aigne.yaml +6 -0
  20. package/assets/report-template/report.html +34 -34
  21. package/docs/configuration-initial-setup.md +74 -55
  22. package/docs/configuration.ja.md +59 -86
  23. package/docs/configuration.md +59 -86
  24. package/docs/configuration.zh-TW.md +59 -86
  25. package/docs/configuration.zh.md +59 -86
  26. package/docs/getting-started.ja.md +43 -24
  27. package/docs/getting-started.md +29 -10
  28. package/docs/getting-started.zh-TW.md +42 -23
  29. package/docs/getting-started.zh.md +39 -20
  30. package/docs/guides-cleaning-up.md +19 -18
  31. package/docs/guides-evaluating-documents.md +70 -29
  32. package/docs/guides-generating-documentation.md +59 -121
  33. package/docs/guides-interactive-chat.md +34 -26
  34. package/docs/guides-managing-history.md +18 -13
  35. package/docs/guides-publishing-your-docs.md +40 -35
  36. package/docs/guides-translating-documentation.md +39 -34
  37. package/docs/guides-updating-documentation.md +11 -9
  38. package/docs/overview.md +2 -2
  39. package/docs/release-notes.md +60 -27
  40. package/package.json +2 -1
  41. package/prompts/evaluate/document-structure.md +6 -7
  42. package/prompts/evaluate/document.md +16 -25
  43. package/prompts/media/media-description/system-prompt.md +35 -0
  44. package/prompts/media/media-description/user-prompt.md +8 -0
  45. package/utils/constants/index.mjs +0 -107
  46. package/utils/file-utils.mjs +41 -0
  47. package/media.md +0 -19
@@ -548,110 +548,3 @@ export const DOC_SMITH_DIR = ".aigne/doc-smith";
548
548
  export const TMP_DIR = ".tmp";
549
549
  export const TMP_DOCS_DIR = "docs";
550
550
  export const TMP_ASSETS_DIR = "assets";
551
-
552
- // Default evaluation scoring weights
553
- export const DEFAULT_EVALUATION_WEIGHTS = {
554
- evaluationConfig: {
555
- accuracy: {
556
- weight: 0.35,
557
- description: "Technical correctness of the documentation.",
558
- subDimensions: {
559
- signatureConsistency: {
560
- weight: 0.5,
561
- description:
562
- "Function signatures match the source code (e.g., OpenAPI spec, TypeScript types).",
563
- },
564
- linkValidity: {
565
- weight: 0.25,
566
- description: "No broken internal links or invalid cross-references.",
567
- },
568
- codeExampleIntegrity: {
569
- weight: 0.25,
570
- description:
571
- "All code blocks are syntactically valid and labeled with the correct language.",
572
- },
573
- },
574
- },
575
- coverage: {
576
- weight: 0.35,
577
- description: "Completeness of documentation for all public components.",
578
- subDimensions: {
579
- apiCoverage: {
580
- weight: 0.4,
581
- description: "Percentage of exported functions/classes documented.",
582
- },
583
- paramReturnCoverage: {
584
- weight: 0.3,
585
- description: "Percentage of function parameters and return values described.",
586
- },
587
- changeTracking: {
588
- weight: 0.3,
589
- description:
590
- "All new or modified code since the last commit is reflected in the documentation.",
591
- },
592
- },
593
- },
594
- readability: {
595
- weight: 0.15,
596
- description: "Ease of understanding for human readers.",
597
- subDimensions: {
598
- clarityScore: {
599
- weight: 0.28,
600
- description:
601
- "Overall clarity including reading coherence, logical flow and translation quality.",
602
- },
603
- consistency: {
604
- weight: 0.12,
605
- description: "Terminology, style and formatting are unified and professional.",
606
- },
607
- contentQuality: {
608
- weight: 0.24,
609
- description:
610
- "Accurate and complete content that adds value with sufficient detail and examples.",
611
- },
612
- purposeAlignment: {
613
- weight: 0.14,
614
- description:
615
- "Content matches the intended purpose such as quick start, API reference or troubleshooting.",
616
- },
617
- audienceAlignment: {
618
- weight: 0.12,
619
- description:
620
- "Language and examples match the target audience (e.g., developers, non-technical users).",
621
- },
622
- knowledgeLevelAlignment: {
623
- weight: 0.1,
624
- description: "Depth and difficulty fit the readers' knowledge level.",
625
- },
626
- },
627
- },
628
- structure: {
629
- weight: 0.15,
630
- description: "Organization and navigability of the documentation.",
631
- subDimensions: {
632
- navigability: {
633
- weight: 0.2,
634
- description: "Table of contents entries correctly link to headings.",
635
- },
636
- informationScent: {
637
- weight: 0.2,
638
- description:
639
- "Key pages such as Quick Start can be reached within three clicks from the homepage.",
640
- },
641
- purposeCoverage: {
642
- weight: 0.25,
643
- description:
644
- "Structure covers all selected documentation goals without forcing them into a single page.",
645
- },
646
- audienceCoverage: {
647
- weight: 0.2,
648
- description: "Structure covers the main intended audience groups.",
649
- },
650
- coverageDepthAlignment: {
651
- weight: 0.15,
652
- description: "Overall balance of conciseness, depth and breadth meets user expectations.",
653
- },
654
- },
655
- },
656
- },
657
- };
@@ -558,3 +558,44 @@ export function getStructurePlanPath(workDir) {
558
558
  const cwd = workDir || process.cwd();
559
559
  return path.join(cwd, ".aigne", "doc-smith", "output", "structure-plan.json");
560
560
  }
561
+
562
+ /**
563
+ * Get MIME type from file path based on extension
564
+ * @param {string} filePath - File path
565
+ * @returns {string} MIME type
566
+ */
567
+ export function getMimeType(filePath) {
568
+ const ext = path.extname(filePath).toLowerCase();
569
+ const mimeTypes = {
570
+ ".jpg": "image/jpeg",
571
+ ".jpeg": "image/jpeg",
572
+ ".png": "image/png",
573
+ ".gif": "image/gif",
574
+ ".bmp": "image/bmp",
575
+ ".webp": "image/webp",
576
+ ".svg": "image/svg+xml",
577
+ ".heic": "image/heic",
578
+ ".heif": "image/heif",
579
+ ".mp4": "video/mp4",
580
+ ".mpeg": "video/mpeg",
581
+ ".mpg": "video/mpg",
582
+ ".mov": "video/mov",
583
+ ".avi": "video/avi",
584
+ ".flv": "video/x-flv",
585
+ ".mkv": "video/x-matroska",
586
+ ".webm": "video/webm",
587
+ ".wmv": "video/wmv",
588
+ ".m4v": "video/x-m4v",
589
+ ".3gpp": "video/3gpp",
590
+ };
591
+ return mimeTypes[ext] || "application/octet-stream";
592
+ }
593
+
594
+ /**
595
+ * Get media description cache file path
596
+ * @returns {string} Absolute path to media-description.yaml
597
+ */
598
+ export function getMediaDescriptionCachePath() {
599
+ const cwd = process.cwd();
600
+ return path.join(cwd, ".aigne", "doc-smith", "media-description.yaml");
601
+ }
package/media.md DELETED
@@ -1,19 +0,0 @@
1
- # 提供在文档中可使用的媒体素材
2
-
3
- ![运行 generate 命令,智能执行初始化](./assets/screenshots/doc-generate.png)
4
-
5
- ![回答问题完成项目设置](./assets/screenshots/doc-complete-setup.png)
6
-
7
- ![执行结构规划和生成文档](./assets/screenshots/doc-generate-docs.png)
8
-
9
- ![文档生成成功](./assets/screenshots/doc-generated-successfully.png)
10
-
11
- ![智能检测,只重新生成需要的文档](./assets/screenshots/doc-regenerate.png)
12
-
13
- ![交互式选择需要更新文档](./assets/screenshots/doc-update.png)
14
-
15
- ![发布文档到官方平台或自部署平台](./assets/screenshots/doc-publish.png)
16
-
17
- ![选择需要翻译的文档](./assets/screenshots/doc-translate.png)
18
-
19
- ![选择需要翻译的语言](./assets/screenshots/doc-translate-langs.png)