dknowc-dsh 2.2.1 → 2.3.1

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 (142) hide show
  1. package/README.md +10 -38
  2. package/package.json +2 -2
  3. package/skills/dknowc-official-doc-writer/README.md +34 -31
  4. package/skills/dknowc-official-doc-writer/SKILL.md +87 -373
  5. package/skills/dknowc-official-doc-writer/reference/anti_ai_patterns.md +1 -1
  6. package/skills/dknowc-official-doc-writer/reference/fact_discipline.md +17 -2
  7. package/skills/dknowc-official-doc-writer/reference/genre_writing_notes.md +116 -0
  8. package/skills/dknowc-official-doc-writer/reference/initialization.md +69 -0
  9. package/skills/dknowc-official-doc-writer/reference/local_memory_guide.md +7 -7
  10. package/skills/dknowc-official-doc-writer/reference/material_usage_guidance.md +7 -0
  11. package/skills/dknowc-official-doc-writer/reference/materials_pipeline.md +42 -0
  12. package/skills/dknowc-official-doc-writer/reference/onboarding_scripts.md +44 -33
  13. package/skills/dknowc-official-doc-writer/reference/outline_rules.md +36 -0
  14. package/skills/dknowc-official-doc-writer/reference/output_guide.md +80 -12
  15. package/skills/dknowc-official-doc-writer/reference/research_notes.md +6 -4
  16. package/skills/dknowc-official-doc-writer/reference/review_checklist.md +24 -0
  17. package/skills/dknowc-official-doc-writer/reference/revision_workflow.md +2 -2
  18. package/skills/dknowc-official-doc-writer/reference/sample_trace_report.html +3 -3
  19. package/skills/dknowc-official-doc-writer/reference/search_guide.md +35 -33
  20. package/skills/dknowc-official-doc-writer/reference/search_intro.md +4 -4
  21. package/skills/dknowc-official-doc-writer/reference/search_policy.md +27 -19
  22. package/skills/dknowc-official-doc-writer/reference/standards/00_index.md +64 -78
  23. package/skills/dknowc-official-doc-writer/reference/standards/29_research.md +7 -0
  24. package/skills/dknowc-official-doc-writer/reference/standards/99_expressions.md +3 -2
  25. package/skills/dknowc-official-doc-writer/reference/task_router.md +3 -3
  26. package/skills/dknowc-official-doc-writer/reference/working_principles.md +32 -0
  27. package/skills/dknowc-official-doc-writer/reference/writing_rules.md +83 -0
  28. package/skills/dknowc-official-doc-writer/scripts/api_key.py +9 -2
  29. package/skills/dknowc-official-doc-writer/scripts/attribution.py +1 -1
  30. package/skills/dknowc-official-doc-writer/scripts/build_trace_json.py +43 -11
  31. package/skills/dknowc-official-doc-writer/scripts/check_materials.py +123 -14
  32. package/skills/dknowc-official-doc-writer/scripts/deep_convert.py +17 -14
  33. package/skills/dknowc-official-doc-writer/scripts/deep_query.py +3 -3
  34. package/skills/dknowc-official-doc-writer/scripts/dkag_search.py +133 -55
  35. package/skills/dknowc-official-doc-writer/scripts/extract_reference.py +1 -1
  36. package/skills/dknowc-official-doc-writer/scripts/format_document.py +43 -23
  37. package/skills/dknowc-official-doc-writer/scripts/initialize.py +15 -7
  38. package/skills/dknowc-official-doc-writer/scripts/mcp_direct.py +2 -3
  39. package/skills/dknowc-official-doc-writer/scripts/merge_search_results.py +36 -13
  40. package/skills/dknowc-official-doc-writer/scripts/outline_reference.py +1 -1
  41. package/skills/dknowc-official-doc-writer/scripts/prose_lint.py +7 -2
  42. package/skills/dknowc-official-doc-writer/scripts/register.mjs +540 -207
  43. package/skills/dknowc-official-doc-writer/scripts/render_trace_html.py +247 -44
  44. package/skills/dknowc-official-doc-writer/scripts/review_document.py +1 -1
  45. package/skills/dknowc-official-doc-writer/scripts/source_note_html.py +20 -8
  46. package/skills/dknowc-official-doc-writer/scripts/template_generator.py +1 -1
  47. package/skills/dknowc-ppt-assistant/README.md +21 -6
  48. package/skills/dknowc-ppt-assistant/SKILL.md +23 -68
  49. package/skills/dknowc-ppt-assistant/THIRD_PARTY_NOTICES.md +3 -2
  50. package/skills/dknowc-ppt-assistant/references/initialization.md +106 -0
  51. package/skills/dknowc-ppt-assistant/references/material_usage.md +12 -8
  52. package/skills/dknowc-ppt-assistant/references/onboarding_scripts.md +48 -17
  53. package/skills/dknowc-ppt-assistant/references/svg-authoring.md +3 -3
  54. package/skills/dknowc-ppt-assistant/references/upstream-example/README.md +2 -0
  55. package/skills/dknowc-ppt-assistant/scripts/api_key.py +7 -0
  56. package/skills/dknowc-ppt-assistant/scripts/attribution.py +2 -2
  57. package/skills/dknowc-ppt-assistant/scripts/compact_svg_coordinates.py +1 -1
  58. package/skills/dknowc-ppt-assistant/scripts/config.py +9 -9
  59. package/skills/dknowc-ppt-assistant/scripts/console_encoding.py +1 -2
  60. package/skills/dknowc-ppt-assistant/scripts/error_helper.py +3 -3
  61. package/skills/dknowc-ppt-assistant/scripts/hyperlink_contract.py +1 -1
  62. package/skills/dknowc-ppt-assistant/scripts/initialize.py +11 -13
  63. package/skills/dknowc-ppt-assistant/scripts/language_tags.py +1 -1
  64. package/skills/dknowc-ppt-assistant/scripts/mcp_convert.py +17 -15
  65. package/skills/dknowc-ppt-assistant/scripts/mcp_direct.py +3 -2
  66. package/skills/dknowc-ppt-assistant/scripts/native_payloads.py +1 -1
  67. package/skills/dknowc-ppt-assistant/scripts/pptx_animations.py +1 -1
  68. package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/__init__.py +1 -1
  69. package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/errors.py +1 -1
  70. package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/formula.py +1 -1
  71. package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/loader.py +1 -1
  72. package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/models.py +1 -1
  73. package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/registry.py +2 -2
  74. package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/semantic_hash.py +1 -1
  75. package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/semantics.py +3 -3
  76. package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/animation_import.py +1 -1
  77. package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/formula_import.py +1 -1
  78. package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/hyperlinks.py +2 -2
  79. package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/preset_authoring.py +2 -2
  80. package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/preset_registry_to_svg.py +2 -2
  81. package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/preset_svg_markup.py +2 -2
  82. package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/slide_to_svg.py +1 -1
  83. package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/transition_import.py +1 -1
  84. package/skills/dknowc-ppt-assistant/scripts/pptx_transitions.py +2 -2
  85. package/skills/dknowc-ppt-assistant/scripts/preset_shape_svg.py +2 -2
  86. package/skills/dknowc-ppt-assistant/scripts/preview_slide_html.py +2 -2
  87. package/skills/dknowc-ppt-assistant/scripts/project_utils.py +2 -2
  88. package/skills/dknowc-ppt-assistant/scripts/register_key.mjs +710 -322
  89. package/skills/dknowc-ppt-assistant/scripts/render_trace_html.py +207 -40
  90. package/skills/dknowc-ppt-assistant/scripts/resource_paths.py +1 -1
  91. package/skills/dknowc-ppt-assistant/scripts/shape_boolean_svg.py +2 -2
  92. package/skills/dknowc-ppt-assistant/scripts/slide_roster.py +1 -1
  93. package/skills/dknowc-ppt-assistant/scripts/svg_finalize/__init__.py +2 -9
  94. package/skills/dknowc-ppt-assistant/scripts/svg_finalize/align_embed_images.py +1 -1
  95. package/skills/dknowc-ppt-assistant/scripts/svg_finalize/crop_images.py +3 -3
  96. package/skills/dknowc-ppt-assistant/scripts/svg_quality/__init__.py +2 -2
  97. package/skills/dknowc-ppt-assistant/scripts/svg_quality/checker.py +9 -10
  98. package/skills/dknowc-ppt-assistant/scripts/svg_quality/cli.py +4 -4
  99. package/skills/dknowc-ppt-assistant/scripts/svg_quality/svg_contracts.py +2 -2
  100. package/skills/dknowc-ppt-assistant/scripts/svg_quality/xml_support.py +1 -1
  101. package/skills/dknowc-ppt-assistant/scripts/svg_quality_checker.py +1 -1
  102. package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/drawingml/hyperlinks.py +2 -2
  103. package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/drawingml/theme_colors.py +1 -1
  104. package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/drawingml/theme_fonts.py +1 -1
  105. package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/geometry_properties.py +1 -1
  106. package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/formula.py +2 -2
  107. package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/formula_ast.py +1 -1
  108. package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/formula_compiler.py +2 -2
  109. package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/formula_omml.py +2 -2
  110. package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/formula_parser.py +2 -2
  111. package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/formula_profile.py +1 -1
  112. package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/formula_run_properties.py +1 -1
  113. package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/inline_formula.py +2 -2
  114. package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/pptx_package/builder.py +9 -11
  115. package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/pptx_package/cli.py +7 -5
  116. package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/pptx_package/template_structure.py +1 -1
  117. package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/pptx_package/template_validation.py +1 -1
  118. package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/semantic_markers.py +1 -1
  119. package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/shape_boolean.py +2 -2
  120. package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/text_outline.py +2 -2
  121. package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx.py +1 -1
  122. package/skills/dknowc-ppt-assistant/scripts/trusted_search.py +63 -11
  123. package/skills/dknowc-ppt-assistant/scripts/update_spec.py +25 -1
  124. package/skills/dknowc-ppt-assistant/workflows/generate-pptx.md +30 -16
  125. package/skills/dknowc-ppt-assistant/workflows/routing.md +1 -1
  126. package/skills/dknowc-trusted-search/README.md +13 -13
  127. package/skills/dknowc-trusted-search/SKILL.md +96 -56
  128. package/skills/dknowc-trusted-search/reference/onboarding_scripts.md +40 -15
  129. package/skills/dknowc-trusted-search/scripts/api_key.py +11 -26
  130. package/skills/dknowc-trusted-search/scripts/attribution.py +1 -1
  131. package/skills/dknowc-trusted-search/scripts/deep_query.py +4 -2
  132. package/skills/dknowc-trusted-search/scripts/initialize.py +10 -10
  133. package/skills/dknowc-trusted-search/scripts/mcp_direct.py +3 -2
  134. package/skills/dknowc-trusted-search/scripts/merge_search_results.py +68 -10
  135. package/skills/dknowc-trusted-search/scripts/register_key.mjs +617 -275
  136. package/skills/dknowc-trusted-search/scripts/render_trace_html.py +87 -19
  137. package/skills/dknowc-trusted-search/scripts/trusted_search.py +109 -44
  138. package/skills/dknowc-official-doc-writer/scripts/mcp_convert.py +0 -272
  139. package/skills/dknowc-ppt-assistant/references/upstream-docs/svg-pipeline.md +0 -842
  140. package/skills/dknowc-ppt-assistant/scripts/finalize_svg.py +0 -507
  141. package/skills/dknowc-ppt-assistant/scripts/svg_finalize/svg_rect_to_path.py +0 -346
  142. package/skills/dknowc-trusted-search/scripts/mcp_convert.py +0 -198
@@ -14,7 +14,7 @@
14
14
  | 格式 | viewBox | 适用 |
15
15
  | --- | --- | --- |
16
16
  | `ppt169`(默认) | `0 0 1280 720` | 标准汇报演示 |
17
- | `ppt43` | `0 0 960 720` | 传统投影 |
17
+ | `ppt43` | `0 0 1024 768` | 传统投影 |
18
18
  | `xiaohongshu` | 小红书 3:4 | 图文帖 |
19
19
  | `moments` | 1:1 | 方形海报 |
20
20
  | `story` | 9:16 | 竖版故事/短视频封面 |
@@ -72,10 +72,10 @@
72
72
 
73
73
  ```bash
74
74
  # 质检(quick 模式:无锁检查;--stage final --json 生成导出所需的正式报告)
75
- python3 {skillDir}/scripts/svg_quality_checker.py dknowc-projects/<项目名> --quick-generate --stage final --json
75
+ python3 {skillDir}/scripts/svg_quality_checker.py projects/<项目名> --quick-generate --stage final --json
76
76
 
77
77
  # 编译导出(quick 模式)
78
- uv run --with python-pptx --with XlsxWriter python3 {skillDir}/scripts/svg_to_pptx.py dknowc-projects/<项目名> --quick-generate
78
+ uv run --with python-pptx --with XlsxWriter python3 {skillDir}/scripts/svg_to_pptx.py projects/<项目名> --quick-generate
79
79
  ```
80
80
 
81
81
  质检 errors(exit 1)必须修复后重新导出;warnings 可评估后放行。导出成功后 `.pptx` 写入项目 `exports/`。
@@ -13,3 +13,5 @@
13
13
  - `sources/`: source materials and normalized markdown
14
14
  - `exports/`: native editable PPTX exports (timestamped)
15
15
  - `backup/<timestamp>/`: svg_output/ archive (always written in default-flow mode; safe to delete old timestamps)
16
+
17
+ > 说明:本目录为**结构与写法参照**,仅含示例 SVG、`design_spec.md` 与 `spec_lock.md`;示例 SVG 中引用的配图(`../images/…`)与模板资源不在包内,直接拿来跑质检会报图片缺失,参照其结构自行编写即可。
@@ -55,6 +55,13 @@ def resolve_api_key() -> tuple[str, str]:
55
55
  if value:
56
56
  return value, "environment"
57
57
 
58
+ # dsh:插件 shell-env 注入的 DSH_DKNOWC_API_KEY(与 MCP Bearer 同源;dsh 的安全机制
59
+ # 会清理名字含 KEY 的隐式环境变量,该 DSH_ 前缀变量是官方显式注入通道)。
60
+ # 取数脚本与 initialize 门禁同源解析,避免"门禁显示已配置、检索脚本取不到 Key"。
61
+ value = os.environ.get("DSH_DKNOWC_API_KEY", "").strip()
62
+ if value:
63
+ return value, "environment"
64
+
58
65
  try:
59
66
  value = api_key_file_path().read_text(encoding="utf-8", errors="ignore").strip()
60
67
  except OSError:
@@ -3,9 +3,9 @@
3
3
 
4
4
  依据与 MaaS 平台方约定的调用来源统计方案:
5
5
 
6
- - 声明格式(单行纯 ASCII):`kind=skill;agentSource=dknowc-ppt-assistant;version=1.3.6;channel=skillhub`
6
+ - 声明格式(单行纯 ASCII):`kind=skill;agentSource=dknowc-ppt-assistant;version=<SKILL.md 版本>;channel=<渠道>`
7
7
  (头内键名为 agentSource——2026-10-09 平台方改名,区别于注册 body 的 `source="agent"` 合同标记)
8
- - kind/source/channel 读自**包根 `attribution.json`**(渠道差异由打包期改这一个文件表达);
8
+ - kind/source/channel 读自**包根 `attribution.json`**;
9
9
  - **version 运行时从 SKILL.md frontmatter 解析**(单一事实源,不硬编码);
10
10
  - 声明为调用方自报,**仅用于统计、不参与鉴权、不作安全凭证**;
11
11
  读取失败时返回 None,调用方不加该头、**不阻断请求**(服务端归"未声明"桶)。
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env python3
2
2
  """
3
- PPT Master - SVG Coordinate Compactor
3
+ 深知可信PPT - SVG Coordinate Compactor
4
4
 
5
5
  Compact model-facing page-space SVG coordinates to at most two decimal places
6
6
  without rounding normalized crop ratios or transform linear coefficients.
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env python3
2
2
  """
3
- PPT Master - Unified Configuration Management Module
3
+ 深知可信PPT - Unified Configuration Management Module
4
4
 
5
5
  Centrally manages all project configuration items to ensure consistency and maintainability.
6
6
 
@@ -51,7 +51,7 @@ CHART_TEMPLATES_DIR = TEMPLATES_DIR / 'charts'
51
51
  # Environment Configuration
52
52
  # ============================================================
53
53
 
54
- USER_CONFIG_DIR = Path.home() / '.ppt-master'
54
+ USER_CONFIG_DIR = Path.home() / '.dknowc-ppt'
55
55
  USER_ENV_FILE = USER_CONFIG_DIR / '.env'
56
56
 
57
57
 
@@ -494,14 +494,14 @@ LAYOUT_MARGINS = {
494
494
  # Keep the exported authority key as the compatibility router for existing
495
495
  # config consumers.
496
496
  SVG_CONSTRAINTS = {
497
- 'authority': 'skills/ppt-master/references/shared-standards.md',
498
- 'core_authority': 'skills/ppt-master/references/shared-standards-core.md',
497
+ 'authority': 'references/svg-authoring.md',
498
+ 'core_authority': 'references/svg-authoring.md',
499
499
  'conditional_authorities': {
500
- 'effects': 'skills/ppt-master/references/svg-effects.md',
501
- 'native_data': 'skills/ppt-master/references/native-data-interface.md',
502
- 'pptx_structure': 'skills/ppt-master/references/pptx-structure-interface.md',
500
+ 'effects': 'references/svg-authoring.md',
501
+ 'native_data': 'references/svg-authoring.md',
502
+ 'pptx_structure': 'references/svg-authoring.md',
503
503
  },
504
- 'validator': 'skills/ppt-master/scripts/svg_quality_checker.py',
504
+ 'validator': 'scripts/svg_quality_checker.py',
505
505
  }
506
506
 
507
507
 
@@ -645,7 +645,7 @@ class Config:
645
645
  def build_parser() -> argparse.ArgumentParser:
646
646
  """Build the command-line parser."""
647
647
  parser = argparse.ArgumentParser(
648
- description="PPT Master configuration management tool.",
648
+ description="深知可信PPT configuration management tool.",
649
649
  )
650
650
  subparsers = parser.add_subparsers(dest="command", required=True)
651
651
  subparsers.add_parser("list-formats", help="List all canvas formats")
@@ -2,8 +2,7 @@
2
2
  """Console encoding helpers for dknowc PPT assistant CLI scripts.
3
3
 
4
4
  Adapted from ppt-master (MIT, Copyright (c) 2025-2026 Hugo He):
5
- UTF-8 stdio configuration only. The upstream official-distribution identity
6
- gates are intentionally removed for this extracted subset; MIT attribution is
5
+ UTF-8 stdio configuration only. This is an extracted subset; MIT attribution is
7
6
  preserved in THIRD_PARTY_NOTICES.md at the skill root.
8
7
  """
9
8
 
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env python3
2
2
  """
3
- PPT Master - Error Message Helper
3
+ 深知可信PPT - Error Message Helper
4
4
 
5
5
  Provides user-friendly error messages and specific fix suggestions.
6
6
  """
@@ -377,7 +377,7 @@ class ErrorHelper:
377
377
  @classmethod
378
378
  def print_help(cls):
379
379
  """Print all error types and solutions."""
380
- print("PPT Master - Error Types and Solutions\n")
380
+ print("深知可信PPT - Error Types and Solutions\n")
381
381
  print("=" * 80)
382
382
 
383
383
  for error_type, info in cls.ERROR_SOLUTIONS.items():
@@ -393,7 +393,7 @@ class ErrorHelper:
393
393
  def build_parser() -> argparse.ArgumentParser:
394
394
  """Build the command-line parser."""
395
395
  parser = argparse.ArgumentParser(
396
- description="Look up PPT Master error messages and suggested fixes.",
396
+ description="Look up 深知可信PPT error messages and suggested fixes.",
397
397
  )
398
398
  parser.add_argument(
399
399
  "error_type",
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env python3
2
2
  """
3
- PPT Master - Hyperlink Contract
3
+ 深知可信PPT - Hyperlink Contract
4
4
 
5
5
  Parse and validate the shared SVG hyperlink surface used by quality checks,
6
6
  SVG-to-PPTX export, and PPTX-to-SVG round-trip conversion.
@@ -5,9 +5,9 @@ Public 版统一只从环境变量 DKNOWC_API_KEY 读取 API Key。
5
5
 
6
6
  职责划分:
7
7
  - 本脚本只报告环境状态,不自行决定是否阻断任务。
8
- - `ready` 只表示基础运行环境(python3、requests)就绪。
9
- - `search_ready` 表示可调用深知可信检索(API Key 已配置且 requests 可用)。
10
- - `pptx_ready` 表示可直接执行 SVG→PPTX 编译导出(python-pptx + XlsxWriter 可用)。
8
+ - `ready` 只表示基础运行环境(python3)就绪。
9
+ - `search_ready` 表示可调用深知可信检索(API Key 已配置;检索走标准库 urllib,不依赖 requests)。
10
+ - `pptx_ready` 表示可直接执行 SVG→PPTX 编译导出(python-pptx 可用;XlsxWriter 为可选增强)。
11
11
  依赖缺失时可用 `uv run --with python-pptx --with XlsxWriter python3 ...` 隔离提供,
12
12
  此时素材检索与 SVG 创作不受影响。
13
13
  """
@@ -55,7 +55,7 @@ def _in_dsh() -> bool:
55
55
  def check_api_key_config():
56
56
  if _in_dsh():
57
57
  # dsh:优先 DSH_DKNOWC_API_KEY(与 MCP Bearer 同源);缺失时 resolve_api_key 兜底
58
- # (环境变量 → 专用配置文件 → 历史 zshrc)。配置文件读取不受 dsh 环境清理影响,
58
+ # (环境变量 → 专用配置文件)。配置文件读取不受 dsh 环境清理影响,
59
59
  # 注册后本会话脚本立即可用。无 Key 仅暂停检索,不阻断纯生成。
60
60
  api_key = os.environ.get("DSH_DKNOWC_API_KEY", "").strip()
61
61
  source = "environment"
@@ -70,11 +70,11 @@ def check_api_key_config():
70
70
  if _looks_like_key(api_key):
71
71
  return {"api_key_configured": True, "api_key_env": API_KEY_ENV, "api_key_source": source, "api_key_hint": None}
72
72
  return {"api_key_configured": False, "api_key_env": API_KEY_ENV, "api_key_source": None,
73
- "api_key_hint": f"未检测到可用的 {API_KEY_ENV}(环境变量、专用配置文件与历史 zshrc 均未找到)。运行注册脚本开通后 Key 自动写入 ~/.config/dknowc/api_key,本会话立即可用。仅检索任务受影响,不涉及检索的生成任务可继续。"}
73
+ "api_key_hint": f"未检测到可用的 {API_KEY_ENV}(环境变量与专用配置文件均未找到)。运行注册脚本开通后 Key 自动写入 ~/.config/dknowc/api_key,本会话立即可用。仅检索任务受影响,不涉及检索的生成任务可继续。"}
74
74
 
75
75
 
76
76
  # 环境变量优先,缺失时从 ~/.zshrc 兜底解析(宿主进程早于 key 写入启动、
77
- # 或宿主不再加载 ~/.zshrc 导出变量时不误报缺失,与公文写作同源方案)
77
+ # 或宿主不再加载 ~/.zshrc 导出变量时不误报缺失,与同源方案)
78
78
  try:
79
79
  from api_key import resolve_api_key
80
80
  api_key, source = resolve_api_key()
@@ -118,20 +118,18 @@ def check_environment():
118
118
  python3_available = shutil.which("python3") is not None
119
119
  requests_available = _module_available("requests")
120
120
  python_pptx_available = _module_available("pptx")
121
- xlsxwriter_available = _module_available("XlsxWriter")
121
+ xlsxwriter_available = _module_available("xlsxwriter") # 实际 import 名为小写
122
122
  config_status = check_api_key_config()
123
123
 
124
124
  blocking_issues = []
125
125
  if not python3_available:
126
126
  blocking_issues.append("python3_missing")
127
- if not requests_available:
128
- blocking_issues.append("requests_missing")
127
+ # requests 仅作可选依赖提示:检索走标准库 urllib,不因缺少 requests 阻断任何能力
129
128
 
130
129
  pptx_blocking_issues = []
131
130
  if not python_pptx_available:
132
131
  pptx_blocking_issues.append("python_pptx_missing")
133
- if not xlsxwriter_available:
134
- pptx_blocking_issues.append("xlsxwriter_missing")
132
+ # XlsxWriter 为可选增强(无它时走 openpyxl / 内置回退,默认导出不生成 workbook),不作阻断项
135
133
 
136
134
  search_blocking_issues = []
137
135
  if not config_status["api_key_configured"]:
@@ -172,10 +170,10 @@ def check_environment():
172
170
  "api_key_env": API_KEY_ENV,
173
171
  "api_key_source": config_status["api_key_source"],
174
172
  "api_key_hint": config_status["api_key_hint"],
175
- "search_ready": config_status["api_key_configured"] and requests_available,
173
+ "search_ready": config_status["api_key_configured"] and python3_available,
176
174
  "search_blocking_issues": search_blocking_issues,
177
175
  # PPT 编译依赖缺失不阻断其他环节:可用 uv run --with 隔离提供。
178
- "pptx_ready": python3_available and python_pptx_available and xlsxwriter_available,
176
+ "pptx_ready": python3_available and python_pptx_available,
179
177
  "pptx_blocking_issues": pptx_blocking_issues,
180
178
  "pptx_hint": (
181
179
  "SVG 编译导出可用 `uv run --with python-pptx --with XlsxWriter python3 ...` 隔离提供依赖;"
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env python3
2
2
  """
3
- PPT Master - Language Tag Helpers
3
+ 深知可信PPT - Language Tag Helpers
4
4
 
5
5
  Normalize and inspect the project primary-language tag shared by confirmation
6
6
  and export tooling.
@@ -1,14 +1,12 @@
1
1
  #!/usr/bin/env python3
2
- """把 MCP「深知可信工作台」trusted_search(include_details=true 形态)的返回
2
+ """历史工具:把 MCP「深知可信工作台」trusted_search(include_details=true 形态)的返回
3
3
  转换成深知可信搜索 REST 接口的原始响应形态,供深知可信PPT 全部下游流程复用。
4
4
 
5
- 背景(3.7.3):检测到宿主已连接 MCP「深知可信工作台」时,搜索走 MCP 通道
6
- (免 API Key)。模型在对话层调用 MCP 工具后,把完整返回 JSON 保存到
7
- official-docs/search-results/,再运行本脚本转换——转换产物与 trusted_search.py
8
- 直调 REST 的输出同构(content.data.检索文章 / policyFiles / knowledgeBase /
9
- search_meta),内容包、合并 JSON 整理与溯源核验报告生成全部按现有流程执行。
5
+ 当前状态:素材检索统一走 trusted_search.py 脚本通道,本脚本随包保留、规则层不引用。
6
+ 宿主 MCP 工具结果存在过期清理机制,大结果在对话层中转的可靠性不足,因此不作为检索通道;
7
+ 若后续宿主工具能力升级,可由技术侧评估后重新启用。
10
8
 
11
- 字段映射:
9
+ 字段映射(通道启用时适用):
12
10
  title → 文章标题 source → 数据源 date → 发布日期
13
11
  url → 源网址 date_confidence → 发布日期可信度
14
12
  snapshot → screenShotPath
@@ -17,11 +15,6 @@ search_meta),内容包、合并 JSON 整理与溯源核验报告生成全部
17
15
  doc_number → 同时写入文章级「文号」与反向构造 policyFiles[{title, writtenText}]
18
16
  (渲染器直接读文章级文号;MCP 侧已完成变体匹配,直接复用其结果)
19
17
  内容中的 &lt;/&gt;/&amp;/&quot; HTML 实体顺手反转义(MCP 透传未清洗)。
20
-
21
- 用法:
22
- python3 scripts/mcp_convert.py official-docs/search-results/mcp_raw.json \
23
- --area 北京市 --purpose "搜索目的" \
24
- --output official-docs/search-results/result_xxx.json
25
18
  """
26
19
 
27
20
  from __future__ import annotations
@@ -33,7 +26,16 @@ import unicodedata
33
26
  from pathlib import Path
34
27
 
35
28
  SKILL_ROOT = Path(__file__).resolve().parent.parent
36
- SEARCH_RESULTS_DIR = SKILL_ROOT / "official-docs" / "search-results"
29
+ # 工作区根:dsh 场景通过环境变量 DKNWOC_WS_ROOT 指向会话工作区,未设置时回退到 cwd
30
+ import os as _os
31
+ _ws = _os.environ.get("DKNWOC_WS_ROOT")
32
+ if not _ws:
33
+ # dsh 会话隔离:每会话独立产物目录 <工作区>/dknowc-output/<DSH_SESSION_ID前8位>/,
34
+ # 多会话共用同一工作区时互不混杂;非 dsh 环境回退为工作区本身。
35
+ _sid = _os.environ.get("DSH_SESSION_ID", "")
36
+ _ws = str(Path(_os.getcwd()) / "dknowc-output" / (_sid[:8] if _sid else "_default"))
37
+ WS_ROOT = Path(_ws).resolve()
38
+ SEARCH_RESULTS_DIR = WS_ROOT / "official-docs" / "search-results"
37
39
 
38
40
  HTML_ENTITIES = (("&lt;", "<"), ("&gt;", ">"), ("&amp;", "&"), ("&quot;", '"'),
39
41
  ("&lt;", "<"), ("&gt;", ">"), ("&amp;", "&"), ("&quot;", '"'))
@@ -103,8 +105,8 @@ def convert(data: dict, area: str, purpose: str) -> dict:
103
105
  article["screenShotPath"] = snapshot
104
106
  doc_number = clean_text(first_value(material, "doc_number", "文号"))
105
107
  if doc_number:
106
- # 文号同时写入文章级(整理合并 JSON 时直接复制,免跨文件翻 policyFiles——
107
- # 实测模型做跨文件标题匹配会跳过,2026-09-21 中医药轮 34 条现成文号取 0)
108
+ # 文号同时写入文章级(整理合并 JSON 时直接复制,免跨文件回查 policyFiles——
109
+ # 跨文件标题匹配易被跳过,文章级字段最稳定)
108
110
  article["文号"] = doc_number
109
111
  if purpose:
110
112
  # 搜索条件写文章级:合并 JSON 时材料自带检索分组(专库 tabs 数据源)
@@ -120,8 +120,9 @@ def main() -> int:
120
120
 
121
121
  api_key = os.environ.get(API_KEY_ENV, "").strip()
122
122
  if not api_key:
123
- # dsh 兜底:注册成功后 Key 已自动写入 ~/.zshrc(register_key.mjs 持久化),
124
- # 本进程环境变量可能未注入——从 ~/.zshrc 解析(api_key.py 同源逻辑)。
123
+ # dsh 兜底:注册成功后 Key 自动写入本机专用配置文件
124
+ # (~/.config/dknowc/api_key),本进程环境变量可能未注入——
125
+ # 经 api_key.py 同源解析(含 dsh 注入的 DSH_DKNOWC_API_KEY)。
125
126
  try:
126
127
  from api_key import resolve_api_key
127
128
  api_key, _src = resolve_api_key()
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env python3
2
2
  """
3
- PPT Master - Native SVG Metadata Store
3
+ 深知可信PPT - Native SVG Metadata Store
4
4
 
5
5
  Deduplicate opaque PowerPoint-native payloads and repeated restoration
6
6
  attributes into one deterministic gzip-compressed workspace store, then
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env python3
2
2
  """
3
- PPT Master - PPTX Animation Module
3
+ 深知可信PPT - PPTX Animation Module
4
4
 
5
5
  Provides one strict object-animation registry plus OOXML read/write helpers.
6
6
 
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env python3
2
2
  """
3
- PPT Master - DrawingML Preset Shapes
3
+ 深知可信PPT - DrawingML Preset Shapes
4
4
 
5
5
  Shared full-catalog loader, registry, and formula evaluator for PPTX shapes.
6
6
 
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env python3
2
2
  """
3
- PPT Master - PPTX Shape Errors
3
+ 深知可信PPT - PPTX Shape Errors
4
4
 
5
5
  Shared exception types for the DrawingML preset-geometry package.
6
6
 
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env python3
2
2
  """
3
- PPT Master - DrawingML Formula Evaluator
3
+ 深知可信PPT - DrawingML Formula Evaluator
4
4
 
5
5
  Evaluate DrawingML geometry guide formulas and standard built-in guides.
6
6
 
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env python3
2
2
  """
3
- PPT Master - Preset Shape Data Loader
3
+ 深知可信PPT - Preset Shape Data Loader
4
4
 
5
5
  Load and validate the bundled DrawingML preset geometry catalog.
6
6
 
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env python3
2
2
  """
3
- PPT Master - PPTX Shape Models
3
+ 深知可信PPT - PPTX Shape Models
4
4
 
5
5
  Immutable value objects shared by the preset catalog loader and evaluator.
6
6
 
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env python3
2
2
  """
3
- PPT Master - Preset Shape Registry
3
+ 深知可信PPT - Preset Shape Registry
4
4
 
5
5
  Expose the complete preset catalog and evaluate shape geometry instances.
6
6
 
@@ -83,7 +83,7 @@ class PresetShapeRegistry:
83
83
 
84
84
  @classmethod
85
85
  def bundled(cls) -> PresetShapeRegistry:
86
- """Load the hash-locked catalog shipped with PPT Master."""
86
+ """Load the hash-locked catalog shipped with 深知可信PPT."""
87
87
 
88
88
  names = load_shape_type_values()
89
89
  definitions = load_preset_shape_definitions(expected_names=names)
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env python3
2
2
  """
3
- PPT Master - Native Shape Semantic Fingerprints
3
+ 深知可信PPT - Native Shape Semantic Fingerprints
4
4
 
5
5
  Build stable hashes for visible SVG text, generated preset previews, and
6
6
  native chart/table fallback subtrees.
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env python3
2
2
  """
3
- PPT Master - DrawingML Preset Shape Semantics
3
+ 深知可信PPT - DrawingML Preset Shape Semantics
4
4
 
5
5
  Load and validate the bundled Office-category and authoring-use catalog for
6
6
  DrawingML preset shapes.
@@ -13,7 +13,7 @@ Examples:
13
13
  arrow = catalog.describe("rightArrow")
14
14
 
15
15
  Dependencies:
16
- None (only uses standard library and local PPT Master modules)
16
+ None (only uses standard library and local 深知可信PPT modules)
17
17
  """
18
18
 
19
19
  from __future__ import annotations
@@ -183,7 +183,7 @@ class PresetShapeSemantics:
183
183
 
184
184
  @classmethod
185
185
  def bundled(cls) -> PresetShapeSemantics:
186
- """Load the semantic catalog shipped with PPT Master."""
186
+ """Load the semantic catalog shipped with 深知可信PPT."""
187
187
 
188
188
  try:
189
189
  payload = json.loads(BUNDLED_SEMANTICS_PATH.read_text(encoding="utf-8"))
@@ -1,4 +1,4 @@
1
- """Import the finite PPT Master-owned object-animation contract.
1
+ """Import the finite 深知可信PPT-owned object-animation contract.
2
2
 
3
3
  The importer deliberately projects only canonical effect identity, pane order,
4
4
  Start trigger, duration, relative delay, and one top-level SVG group target.
@@ -1,4 +1,4 @@
1
- """Import PPT Master-owned Office Math into canonical SVG formula markers.
1
+ """Import 深知可信PPT-owned Office Math into canonical SVG formula markers.
2
2
 
3
3
  The reverse contract is deliberately narrow: accept only the closed OMML
4
4
  vocabulary already validated by the native formula compiler, serialize that
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env python3
2
2
  """
3
- PPT Master - PPTX Hyperlink Resolver
3
+ 深知可信PPT - PPTX Hyperlink Resolver
4
4
 
5
5
  Resolve native DrawingML click actions into the canonical SVG ``href`` form
6
6
  used by the authoring and round-trip pipelines.
@@ -12,7 +12,7 @@ Examples:
12
12
  result = resolve_click_hyperlink(rels, "rId3", "", slide_index_by_part=roster)
13
13
 
14
14
  Dependencies:
15
- PPT Master hyperlink contract.
15
+ 深知可信PPT hyperlink contract.
16
16
  """
17
17
 
18
18
  from __future__ import annotations
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env python3
2
2
  """
3
- PPT Master - Authored Preset Shape Contract
3
+ 深知可信PPT - Authored Preset Shape Contract
4
4
 
5
5
  Build and validate compact canonical SVG groups for newly authored PowerPoint
6
6
  preset shapes while retaining expanded authored input compatibility.
@@ -17,7 +17,7 @@ Examples:
17
17
  )
18
18
 
19
19
  Dependencies:
20
- None (only uses standard library and local PPT Master modules)
20
+ None (only uses standard library and local 深知可信PPT modules)
21
21
  """
22
22
 
23
23
  from __future__ import annotations
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env python3
2
2
  """
3
- PPT Master - Preset Geometry SVG Adapter
3
+ 深知可信PPT - Preset Geometry SVG Adapter
4
4
 
5
5
  Render evaluated DrawingML preset geometry as absolute SVG path layers.
6
6
 
@@ -11,7 +11,7 @@ Examples:
11
11
  geometry = render_preset_geometry("rightArrow", xfrm)
12
12
 
13
13
  Dependencies:
14
- None (only uses standard library and local PPT Master modules)
14
+ None (only uses standard library and local 深知可信PPT modules)
15
15
  """
16
16
 
17
17
  from __future__ import annotations
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env python3
2
2
  """
3
- PPT Master - Preset Shape SVG Markup
3
+ 深知可信PPT - Preset Shape SVG Markup
4
4
 
5
5
  Serialize evaluated DrawingML preset layers for lossless transport or compact
6
6
  project authoring.
@@ -12,7 +12,7 @@ Examples:
12
12
  markup = serialize_preset_layers(layers, semantic_attrs, style_attrs)
13
13
 
14
14
  Dependencies:
15
- None (only uses standard library and local PPT Master modules)
15
+ None (only uses standard library and local 深知可信PPT modules)
16
16
  """
17
17
 
18
18
  from __future__ import annotations
@@ -228,7 +228,7 @@ def assemble_slide(
228
228
  source ``showMasterSp`` flags. This view is used for round-trip
229
229
  fidelity with svg_to_pptx.
230
230
  - "layered": skip inherited shapes entirely. The slide SVG contains
231
- only its own shapes. Callers (e.g. /create-template's PPTX import)
231
+ only its own shapes. Callers (e.g. the PPTX import path)
232
232
  render master/layout once each as separate SVGs and record the
233
233
  inheritance graph in inheritance.json.
234
234
  """
@@ -1,4 +1,4 @@
1
- """Import PPT Master-owned slide transitions into animations.json rows.
1
+ """Import 深知可信PPT-owned slide transitions into animations.json rows.
2
2
 
3
3
  The reverse contract accepts only source XML that passes the existing
4
4
  generated-transition read-back validator. Unknown third-party carriers remain
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env python3
2
2
  """
3
- PPT Master - PPTX Transition Core
3
+ 深知可信PPT - PPTX Transition Core
4
4
 
5
5
  Provide one strict PowerPoint-native transition registry, a compatibility input
6
6
  map, and shared OOXML read/write helpers for generated slides, template-filled
@@ -9,7 +9,7 @@ See references/animations.md for the public workflow and
9
9
  scripts/docs/pptx-transitions.md for the OOXML contract.
10
10
 
11
11
  Usage:
12
- Import from PPT Master PPTX builders and direct-package workflows.
12
+ Import from 深知可信PPT PPTX builders and direct-package workflows.
13
13
 
14
14
  Examples:
15
15
  from pptx_transitions import AdvanceUpdate, EnterUpdate, apply_slide_motion
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env python3
2
2
  """
3
- PPT Master - Preset Shape SVG Fragment Tool
3
+ 深知可信PPT - Preset Shape SVG Fragment Tool
4
4
 
5
5
  Browse and inspect DrawingML presets, or print compact canonical native-preset
6
6
  SVG groups to stdout for manual insertion into a hand-authored page or
@@ -20,7 +20,7 @@ Examples:
20
20
  python3 scripts/preset_shape_svg.py render-batch --input shapes.json
21
21
 
22
22
  Dependencies:
23
- None (only uses standard library and local PPT Master modules)
23
+ None (only uses standard library and local 深知可信PPT modules)
24
24
  """
25
25
 
26
26
  from __future__ import annotations
@@ -9,7 +9,7 @@ svg_output/ 下全部(或指定)页面以 data URI 内嵌到单个 HTML—
9
9
  用法:
10
10
  python3 scripts/preview_slide_html.py <项目名> [--output <文件名>] [--title <标题>]
11
11
  项目须位于 projects/<项目名>/svg_output/;输出默认 official-docs/output/<项目名>_pages_preview.html,
12
- 生成后用 deliver_outputs.py 复制到宿主工作区再向用户展示。
12
+ 生成后直接向用户展示脚本打印的路径(dsh 产物天然在会话工作区)。
13
13
  """
14
14
 
15
15
  from __future__ import annotations
@@ -92,7 +92,7 @@ def main() -> int:
92
92
  out.parent.mkdir(parents=True, exist_ok=True)
93
93
  out.write_text(_page_html(title, len(svgs), "\n".join(sections)), encoding="utf-8")
94
94
  print(f"已生成预览页({len(svgs)} 页):{out}")
95
- print("提示:宿主环境请接着运行 deliver_outputs.py 把预览页复制到工作区再向用户展示。")
95
+ print("提示:直接向用户展示上面的预览页路径即可。")
96
96
  return 0
97
97
 
98
98
 
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env python3
2
2
  """
3
- PPT Master - Project Utilities Module
3
+ 深知可信PPT - Project Utilities Module
4
4
 
5
5
  Provides common functions for project information parsing and validation,
6
6
  reusable by other tools.
@@ -601,7 +601,7 @@ def get_project_stats(project_path: str) -> Dict:
601
601
 
602
602
  def build_parser() -> argparse.ArgumentParser:
603
603
  """Build the command-line parser for the diagnostic entry point."""
604
- parser = argparse.ArgumentParser(description="Inspect and validate a PPT Master project.")
604
+ parser = argparse.ArgumentParser(description="Inspect and validate a 深知可信PPT project.")
605
605
  parser.add_argument("project_path", help="Project directory")
606
606
  return parser
607
607