dknowc-dsh 2.3.0 → 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.
- package/README.md +3 -47
- package/package.json +2 -2
- package/skills/dknowc-official-doc-writer/README.md +23 -14
- package/skills/dknowc-official-doc-writer/SKILL.md +4 -3
- package/skills/dknowc-official-doc-writer/reference/anti_ai_patterns.md +1 -1
- package/skills/dknowc-official-doc-writer/reference/initialization.md +19 -16
- package/skills/dknowc-official-doc-writer/reference/local_memory_guide.md +7 -7
- package/skills/dknowc-official-doc-writer/reference/materials_pipeline.md +1 -1
- package/skills/dknowc-official-doc-writer/reference/onboarding_scripts.md +42 -31
- package/skills/dknowc-official-doc-writer/reference/output_guide.md +10 -11
- package/skills/dknowc-official-doc-writer/reference/research_notes.md +1 -1
- package/skills/dknowc-official-doc-writer/reference/review_checklist.md +2 -2
- package/skills/dknowc-official-doc-writer/reference/revision_workflow.md +2 -2
- package/skills/dknowc-official-doc-writer/reference/search_guide.md +7 -7
- package/skills/dknowc-official-doc-writer/reference/search_intro.md +4 -4
- package/skills/dknowc-official-doc-writer/reference/standards/00_index.md +63 -77
- package/skills/dknowc-official-doc-writer/reference/standards/99_expressions.md +0 -1
- package/skills/dknowc-official-doc-writer/reference/task_router.md +2 -2
- package/skills/dknowc-official-doc-writer/reference/working_principles.md +1 -1
- package/skills/dknowc-official-doc-writer/reference/writing_rules.md +1 -1
- package/skills/dknowc-official-doc-writer/scripts/api_key.py +9 -2
- package/skills/dknowc-official-doc-writer/scripts/attribution.py +1 -1
- package/skills/dknowc-official-doc-writer/scripts/build_trace_json.py +11 -9
- package/skills/dknowc-official-doc-writer/scripts/check_materials.py +8 -5
- package/skills/dknowc-official-doc-writer/scripts/deep_convert.py +4 -4
- package/skills/dknowc-official-doc-writer/scripts/deep_query.py +1 -1
- package/skills/dknowc-official-doc-writer/scripts/dkag_search.py +3 -2
- package/skills/dknowc-official-doc-writer/scripts/extract_reference.py +1 -1
- package/skills/dknowc-official-doc-writer/scripts/format_document.py +30 -13
- package/skills/dknowc-official-doc-writer/scripts/initialize.py +15 -7
- package/skills/dknowc-official-doc-writer/scripts/mcp_direct.py +2 -3
- package/skills/dknowc-official-doc-writer/scripts/merge_search_results.py +13 -6
- package/skills/dknowc-official-doc-writer/scripts/outline_reference.py +1 -1
- package/skills/dknowc-official-doc-writer/scripts/prose_lint.py +7 -2
- package/skills/dknowc-official-doc-writer/scripts/register.mjs +538 -205
- package/skills/dknowc-official-doc-writer/scripts/render_trace_html.py +10 -10
- package/skills/dknowc-official-doc-writer/scripts/review_document.py +1 -1
- package/skills/dknowc-official-doc-writer/scripts/source_note_html.py +3 -3
- package/skills/dknowc-official-doc-writer/scripts/template_generator.py +1 -1
- package/skills/dknowc-ppt-assistant/README.md +21 -7
- package/skills/dknowc-ppt-assistant/SKILL.md +5 -5
- package/skills/dknowc-ppt-assistant/THIRD_PARTY_NOTICES.md +3 -2
- package/skills/dknowc-ppt-assistant/references/initialization.md +45 -6
- package/skills/dknowc-ppt-assistant/references/material_usage.md +7 -7
- package/skills/dknowc-ppt-assistant/references/onboarding_scripts.md +48 -17
- package/skills/dknowc-ppt-assistant/references/svg-authoring.md +1 -1
- package/skills/dknowc-ppt-assistant/references/upstream-example/README.md +2 -0
- package/skills/dknowc-ppt-assistant/scripts/api_key.py +7 -0
- package/skills/dknowc-ppt-assistant/scripts/attribution.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/compact_svg_coordinates.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/config.py +9 -9
- package/skills/dknowc-ppt-assistant/scripts/console_encoding.py +1 -2
- package/skills/dknowc-ppt-assistant/scripts/error_helper.py +3 -3
- package/skills/dknowc-ppt-assistant/scripts/hyperlink_contract.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/initialize.py +11 -13
- package/skills/dknowc-ppt-assistant/scripts/language_tags.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/mcp_convert.py +17 -15
- package/skills/dknowc-ppt-assistant/scripts/mcp_direct.py +3 -2
- package/skills/dknowc-ppt-assistant/scripts/native_payloads.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/pptx_animations.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/__init__.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/errors.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/formula.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/loader.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/models.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/registry.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/semantic_hash.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/semantics.py +3 -3
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/animation_import.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/formula_import.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/hyperlinks.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/preset_authoring.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/preset_registry_to_svg.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/preset_svg_markup.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/slide_to_svg.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/transition_import.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/pptx_transitions.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/preset_shape_svg.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/project_utils.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/register_key.mjs +710 -322
- package/skills/dknowc-ppt-assistant/scripts/render_trace_html.py +9 -9
- package/skills/dknowc-ppt-assistant/scripts/resource_paths.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/shape_boolean_svg.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/slide_roster.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/svg_finalize/__init__.py +2 -9
- package/skills/dknowc-ppt-assistant/scripts/svg_finalize/align_embed_images.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/svg_finalize/crop_images.py +3 -3
- package/skills/dknowc-ppt-assistant/scripts/svg_quality/__init__.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/svg_quality/checker.py +9 -10
- package/skills/dknowc-ppt-assistant/scripts/svg_quality/cli.py +4 -4
- package/skills/dknowc-ppt-assistant/scripts/svg_quality/svg_contracts.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/svg_quality/xml_support.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/svg_quality_checker.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/drawingml/hyperlinks.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/drawingml/theme_colors.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/drawingml/theme_fonts.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/geometry_properties.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/formula.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/formula_ast.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/formula_compiler.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/formula_omml.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/formula_parser.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/formula_profile.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/formula_run_properties.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/inline_formula.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/pptx_package/builder.py +9 -11
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/pptx_package/cli.py +7 -5
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/pptx_package/template_structure.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/pptx_package/template_validation.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/semantic_markers.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/shape_boolean.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/text_outline.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/trusted_search.py +22 -5
- package/skills/dknowc-ppt-assistant/scripts/update_spec.py +25 -1
- package/skills/dknowc-ppt-assistant/workflows/generate-pptx.md +11 -9
- package/skills/dknowc-ppt-assistant/workflows/routing.md +1 -1
- package/skills/dknowc-trusted-search/README.md +8 -8
- package/skills/dknowc-trusted-search/SKILL.md +74 -56
- package/skills/dknowc-trusted-search/reference/onboarding_scripts.md +40 -15
- package/skills/dknowc-trusted-search/scripts/api_key.py +11 -26
- package/skills/dknowc-trusted-search/scripts/attribution.py +1 -1
- package/skills/dknowc-trusted-search/scripts/deep_query.py +1 -1
- package/skills/dknowc-trusted-search/scripts/initialize.py +10 -10
- package/skills/dknowc-trusted-search/scripts/mcp_direct.py +3 -2
- package/skills/dknowc-trusted-search/scripts/register_key.mjs +617 -275
- package/skills/dknowc-trusted-search/scripts/render_trace_html.py +4 -4
- package/skills/dknowc-trusted-search/scripts/trusted_search.py +2 -2
- package/skills/dknowc-official-doc-writer/scripts/mcp_convert.py +0 -287
- package/skills/dknowc-ppt-assistant/references/upstream-docs/svg-pipeline.md +0 -842
- package/skills/dknowc-ppt-assistant/scripts/finalize_svg.py +0 -507
- package/skills/dknowc-ppt-assistant/scripts/svg_finalize/svg_rect_to_path.py +0 -346
- package/skills/dknowc-trusted-search/scripts/mcp_convert.py +0 -198
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
- outline 提纲版:结构方案确认门前的提纲答案文件(页面规划表 + 口径事项清单)→ 事前核验
|
|
6
6
|
- final 成稿版:交付时的页面级结论文本 → 事后溯源
|
|
7
7
|
|
|
8
|
-
3.7.x
|
|
8
|
+
3.7.x 同源架构(参考深知晓交互原型,数据口径保持自有与真实):
|
|
9
9
|
- 顶栏:身份章 + 标题 + 工具组(只看正文 / 复制全文 / 打印归档)+ 阅读进度条
|
|
10
10
|
- Hero:大标题 + 真实统计(N 次检索 · M 条材料 · K 处引用)+ 双视图切换
|
|
11
11
|
- 过程回顾条:检索 → 入库 → 逐条比对 → 核验完成(静态回放,数字全部真实计算)
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
接口提供存档快照(screenShotPath)时作为**附加回看入口**与原文链接并存
|
|
16
16
|
(路径容错补 /A/、纯本地格式校验)
|
|
17
17
|
|
|
18
|
-
PPT
|
|
18
|
+
PPT 特有口径(与同源版本的既定差异):
|
|
19
19
|
- 提醒制:数据缺口(缺原文链接/缺摘录)不判不通过、指标恒绿附温和提醒;只有无素材/
|
|
20
20
|
正文无角标/角标未绑定三种真实错误才判不通过
|
|
21
21
|
- 双版 stage:提纲版(事前核验)与成稿版(事后溯源)同脚本同形式,标题与身份章带版本后缀
|
|
@@ -352,7 +352,7 @@ def source_from_article(item: Dict[str, Any], index: int, segment: Optional[Dict
|
|
|
352
352
|
source["doc_section"] = " › ".join(first_chain)
|
|
353
353
|
source["chain_full"] = " › ".join(segments[0]["chain"]) if segments else ""
|
|
354
354
|
# 发文字号:必须是标准格式(〔年份〕序号号);描述性文字("XX印发"类自造
|
|
355
|
-
#
|
|
355
|
+
# 描述)不显示、当无文号处理(模型把文号写成
|
|
356
356
|
# "中办、国办 2026 年印发"类描述导致关键性行失真)。
|
|
357
357
|
_dn = first_str(item.get("文号"), item.get("发文字号"), item.get("doc_number"))
|
|
358
358
|
source["doc_number"] = _dn if re.search(r"〔\d{4}〕\s*\d+\s*号", _dn) else ""
|
|
@@ -439,7 +439,7 @@ def collect_raw_articles(payload: Dict[str, Any]) -> List[Dict[str, Any]]:
|
|
|
439
439
|
|
|
440
440
|
|
|
441
441
|
def _dedupe_key(source: Dict[str, Any]) -> tuple:
|
|
442
|
-
"""归一去重键:标题 +
|
|
442
|
+
"""归一去重键:标题 + 原网址(同款修复)。
|
|
443
443
|
|
|
444
444
|
旧键含 id(材料编号),而 id 要么是位置兜底序号、要么是角标号——同一篇文章被
|
|
445
445
|
多路召回或按段落返回多条片段时,各条 id 不同,含 id 的键**等于从不去重**,
|
|
@@ -574,7 +574,7 @@ def classify_check_value(raw: Any) -> Tuple[str, str]:
|
|
|
574
574
|
兼容多种写法:`pass` / `true` / `通过` / `通过:说明文字` / `✓` 等;
|
|
575
575
|
值后面的说明文字保留下来供核验单展示。红项(fail)只给显式声明的
|
|
576
576
|
"未通过";无法识别的描述性文本按"未记录"(none)处理不判红——
|
|
577
|
-
|
|
577
|
+
自检书写格式走样不应被放大成核验红项(实测
|
|
578
578
|
模型写入"备注"等额外键导致交付前检查误判红)。
|
|
579
579
|
"""
|
|
580
580
|
text = str(raw or "").strip()
|
|
@@ -630,7 +630,7 @@ def compute_verification(answer: str, sources: List[Dict[str, str]], payload: Di
|
|
|
630
630
|
no_citation = bool(sources) and not cited
|
|
631
631
|
|
|
632
632
|
# ③ 时效检查:材料日期范围与历史材料计数
|
|
633
|
-
#
|
|
633
|
+
# 统计口径:③材料新旧/④材料构成只算正文引用的来源文章——
|
|
634
634
|
# sources 含未引用召回,其未来日期/类型会把时效范围与构成写歪。
|
|
635
635
|
dated = [parse_year_month(s.get("date")) for s in cited_sources]
|
|
636
636
|
dated = [d for d in dated if d]
|
|
@@ -1263,7 +1263,7 @@ def render_verify_panel(v: Dict[str, Any], stage: str = "final") -> str:
|
|
|
1263
1263
|
f'<span class="d">检索 JSON 没写入 self_check(默认查:{esc(default_names)})</span></div>')
|
|
1264
1264
|
|
|
1265
1265
|
# 3.7.2 起「现行效力」提示行移除:该提示对用户无操作价值,policy_count
|
|
1266
|
-
#
|
|
1266
|
+
# 保留在计算层不再展示(口径)。
|
|
1267
1267
|
|
|
1268
1268
|
what = "提纲页面规划" if stage == "outline" else "页面级结论"
|
|
1269
1269
|
return f"""
|
|
@@ -1363,7 +1363,7 @@ def strip_leading_chain(text: str, chain: List[str]) -> str:
|
|
|
1363
1363
|
def render_crumb(chain: List[str]) -> str:
|
|
1364
1364
|
"""面包屑标题链:文章 › 章 › 节(标题链是模型生成的结构化位置,核验核心抓手)。
|
|
1365
1365
|
|
|
1366
|
-
|
|
1366
|
+
降级规则:段落本身无章节层级(链上只有文章名)时不显示
|
|
1367
1367
|
标题链行——材料卡标题已是文章名,单独一行重复文章名对定位无增量。
|
|
1368
1368
|
"""
|
|
1369
1369
|
parts = [esc(level) for level in chain if level]
|
|
@@ -2416,7 +2416,7 @@ def render_html(payload: Dict[str, Any], title: str, answer_override: str = "",
|
|
|
2416
2416
|
s["used"] = False
|
|
2417
2417
|
# 3.7.2 起知识专库原始召回存档(kb_zone)移除:并行检索下接口返回的
|
|
2418
2418
|
# knowledgeBase 链接会错乱不可靠,且未引用召回材料已在专库全量展示,
|
|
2419
|
-
#
|
|
2419
|
+
# 「知识专库链接不进报告」的前提(检索并行化的前置)。
|
|
2420
2420
|
generated_at = generated_at or datetime.now()
|
|
2421
2421
|
generated = generated_at.strftime("%Y-%m-%d %H:%M")
|
|
2422
2422
|
stage_label = STAGE_LABELS.get(stage, "成稿版")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
"""
|
|
3
|
-
PPT
|
|
3
|
+
深知可信PPT - Shape Boolean SVG Fragment Tool
|
|
4
4
|
|
|
5
5
|
Combine closed SVG shapes or resolvable text outlines and print the resulting
|
|
6
6
|
canonical SVG path fragment to stdout. Result geometry is in SVG-root coordinate
|
|
@@ -22,7 +22,7 @@ Examples:
|
|
|
22
22
|
--operation subtract --source scrim --source chapter-number --id reveal
|
|
23
23
|
|
|
24
24
|
Dependencies:
|
|
25
|
-
skia-pathops, local PPT
|
|
25
|
+
skia-pathops, local 深知可信PPT modules, and uharfbuzz for text operands
|
|
26
26
|
"""
|
|
27
27
|
|
|
28
28
|
from __future__ import annotations
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
"""svg_finalize — shared self-containment + DrawingML-compat utilities.
|
|
2
2
|
|
|
3
|
-
Used by
|
|
4
|
-
|
|
5
|
-
1. finalize_svg.py — writes svg_output/ → svg_final/ on disk
|
|
6
|
-
2. svg_to_pptx (use_expander, tspan_flattener) — reuses these modules
|
|
7
|
-
in memory during native pptx conversion
|
|
8
|
-
|
|
9
|
-
Deleting any module here is likely to break native pptx output, not just
|
|
10
|
-
svg_final/. See scripts/docs/svg-pipeline.md for the full per-module consumer
|
|
11
|
-
table.
|
|
3
|
+
Used by svg_to_pptx (use_expander, tspan_flattener) in memory during native pptx
|
|
4
|
+
conversion.
|
|
12
5
|
"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
"""
|
|
3
|
-
PPT
|
|
3
|
+
深知可信PPT - Smart Image Cropping Tool
|
|
4
4
|
|
|
5
5
|
Smartly crops images based on the preserveAspectRatio attribute of <image> elements in SVG:
|
|
6
6
|
- slice: Crop to fill (similar to CSS object-fit: cover)
|
|
@@ -325,7 +325,7 @@ def process_directory(directory: str, dry_run: bool = False, verbose: bool = Tru
|
|
|
325
325
|
def main() -> None:
|
|
326
326
|
"""Run the CLI entry point."""
|
|
327
327
|
parser = argparse.ArgumentParser(
|
|
328
|
-
description='PPT
|
|
328
|
+
description='深知可信PPT - Smart Image Cropping Tool',
|
|
329
329
|
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
330
330
|
epilog='''
|
|
331
331
|
Examples:
|
|
@@ -352,7 +352,7 @@ preserveAspectRatio usage:
|
|
|
352
352
|
print(f"[ERROR] Path not found: {args.path}")
|
|
353
353
|
sys.exit(1)
|
|
354
354
|
|
|
355
|
-
print("PPT
|
|
355
|
+
print("深知可信PPT - Smart Image Cropping")
|
|
356
356
|
print("=" * 50)
|
|
357
357
|
|
|
358
358
|
if args.path.is_file():
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
-
"""PPT
|
|
2
|
+
"""深知可信PPT SVG quality-check internals.
|
|
3
3
|
|
|
4
4
|
Use the stable ``scripts/svg_quality_checker.py`` entry point for CLI execution
|
|
5
5
|
and compatibility imports.
|
|
@@ -11,5 +11,5 @@ Examples:
|
|
|
11
11
|
from svg_quality_checker import SVGQualityChecker
|
|
12
12
|
|
|
13
13
|
Dependencies:
|
|
14
|
-
Local PPT
|
|
14
|
+
Local 深知可信PPT validation modules.
|
|
15
15
|
"""
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
-
"""PPT
|
|
2
|
+
"""深知可信PPT SVG quality-check implementation.
|
|
3
3
|
|
|
4
4
|
Owns SVG, project-contract, template, and report validation. The stable CLI and
|
|
5
5
|
compatibility import surface remain in ``scripts/svg_quality_checker.py``.
|
|
@@ -11,7 +11,7 @@ Examples:
|
|
|
11
11
|
from svg_quality_checker import SVGQualityChecker
|
|
12
12
|
|
|
13
13
|
Dependencies:
|
|
14
|
-
Standard library plus local PPT
|
|
14
|
+
Standard library plus local 深知可信PPT validation modules.
|
|
15
15
|
"""
|
|
16
16
|
|
|
17
17
|
import copy
|
|
@@ -5516,8 +5516,8 @@ class SVGQualityChecker:
|
|
|
5516
5516
|
'release SVG projects require an explicit spec_lock.md '
|
|
5517
5517
|
'pptx_structure.mode: flat (free design / brand-only) or '
|
|
5518
5518
|
f'structured (deck/layout template); found {label}. New '
|
|
5519
|
-
'free-design projects use mode: flat;
|
|
5520
|
-
'
|
|
5519
|
+
'free-design projects use mode: flat; follow the SVG authoring contract '
|
|
5520
|
+
'in references/svg-authoring.md, '
|
|
5521
5521
|
'then generate new structured SVG pages before export. Existing '
|
|
5522
5522
|
'PPTX/SVG files are not upgraded in place.',
|
|
5523
5523
|
))
|
|
@@ -6775,7 +6775,7 @@ class SVGQualityChecker:
|
|
|
6775
6775
|
- **Explicit structure gaps** are errors when positive structure checks
|
|
6776
6776
|
are enabled: every current reusable SVG declares its Master and Layout
|
|
6777
6777
|
identity. Zero-placeholder Layouts are valid. Legacy template-mode
|
|
6778
|
-
packages fail and must be
|
|
6778
|
+
packages fail and must be migrated to a structured workspace.
|
|
6779
6779
|
- **Placeholder gaps** are reported as *warnings*. Templates may
|
|
6780
6780
|
legitimately omit conventional placeholders or swap them out (e.g.
|
|
6781
6781
|
``{{CLOSING_MESSAGE}}`` instead of ``{{THANK_YOU}}``), and a content
|
|
@@ -6797,7 +6797,7 @@ class SVGQualityChecker:
|
|
|
6797
6797
|
'explicit_structure_mode',
|
|
6798
6798
|
"design_spec.md frontmatter must declare "
|
|
6799
6799
|
"native_structure_mode: structured; legacy template-mode "
|
|
6800
|
-
"workspaces must be re-created
|
|
6800
|
+
"workspaces must be re-created as structured workspaces",
|
|
6801
6801
|
))
|
|
6802
6802
|
if check_structure:
|
|
6803
6803
|
native_contract_path = dir_path / 'native_structure.json'
|
|
@@ -6874,7 +6874,7 @@ class SVGQualityChecker:
|
|
|
6874
6874
|
'legacy_native_structure_pair',
|
|
6875
6875
|
"legacy native_structure.json/source_template.pptx template "
|
|
6876
6876
|
"contracts must be replaced through "
|
|
6877
|
-
"
|
|
6877
|
+
"references/svg-authoring.md",
|
|
6878
6878
|
))
|
|
6879
6879
|
|
|
6880
6880
|
if declared_structure_mode != 'structured':
|
|
@@ -6891,8 +6891,7 @@ class SVGQualityChecker:
|
|
|
6891
6891
|
'error',
|
|
6892
6892
|
'legacy_structure_contract',
|
|
6893
6893
|
"legacy template structure detected; create a new current "
|
|
6894
|
-
"workspace
|
|
6895
|
-
"create-template.md before Step 3 consumption",
|
|
6894
|
+
"workspace per references/svg-authoring.md before Step 3 consumption",
|
|
6896
6895
|
))
|
|
6897
6896
|
spec_pages = self._extract_spec_roster(spec_text) if spec_text else []
|
|
6898
6897
|
custom_contract = self._extract_frontmatter_placeholders(spec_text) if spec_text else {}
|
|
@@ -7578,7 +7577,7 @@ class SVGQualityChecker:
|
|
|
7578
7577
|
def export_report(self, output_file: str = 'svg_quality_report.txt'):
|
|
7579
7578
|
"""Export check report"""
|
|
7580
7579
|
with open(output_file, 'w', encoding='utf-8') as f:
|
|
7581
|
-
f.write("PPT
|
|
7580
|
+
f.write("深知可信PPT SVG Quality Check Report\n")
|
|
7582
7581
|
f.write("=" * 80 + "\n\n")
|
|
7583
7582
|
|
|
7584
7583
|
for result in self.results:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
-
"""PPT
|
|
2
|
+
"""深知可信PPT SVG quality-check CLI implementation.
|
|
3
3
|
|
|
4
4
|
Parses the legacy command-line contract and delegates validation to the checker.
|
|
5
5
|
|
|
@@ -10,7 +10,7 @@ Examples:
|
|
|
10
10
|
python3 scripts/svg_quality_checker.py projects/demo --stage final --json
|
|
11
11
|
|
|
12
12
|
Dependencies:
|
|
13
|
-
Standard library plus local PPT
|
|
13
|
+
Standard library plus local 深知可信PPT validation modules.
|
|
14
14
|
"""
|
|
15
15
|
|
|
16
16
|
import sys
|
|
@@ -55,7 +55,7 @@ def _default_json_report_path(
|
|
|
55
55
|
|
|
56
56
|
def print_usage() -> None:
|
|
57
57
|
"""Print CLI usage information."""
|
|
58
|
-
print("PPT
|
|
58
|
+
print("深知可信PPT - SVG Quality Check Tool\n")
|
|
59
59
|
print("Usage:")
|
|
60
60
|
print(" python3 scripts/svg_quality_checker.py <svg_file>")
|
|
61
61
|
print(" python3 scripts/svg_quality_checker.py <directory>")
|
|
@@ -85,7 +85,7 @@ def print_usage() -> None:
|
|
|
85
85
|
print(" native_structure_mode: structured also enables complete")
|
|
86
86
|
print(" per-file and cross-page structure validation. Legacy")
|
|
87
87
|
print(" native_structure_mode: template fails and must be")
|
|
88
|
-
print(" re-created
|
|
88
|
+
print(" re-created as a structured workspace before validation.")
|
|
89
89
|
print(" Warnings are advisory: they require no modification and do not affect exit status;")
|
|
90
90
|
print(" only errors make the command exit with status 1.")
|
|
91
91
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
-
"""PPT
|
|
2
|
+
"""深知可信PPT stateless SVG contract checks.
|
|
3
3
|
|
|
4
4
|
Validates the SVG property surface shared with the native DrawingML exporter.
|
|
5
5
|
Each check receives an explicit XML root or source string and appends findings
|
|
@@ -12,7 +12,7 @@ Examples:
|
|
|
12
12
|
from svg_quality.svg_contracts import check_paint_compatibility
|
|
13
13
|
|
|
14
14
|
Dependencies:
|
|
15
|
-
Standard library plus local PPT
|
|
15
|
+
Standard library plus local 深知可信PPT SVG-to-PPTX modules.
|
|
16
16
|
"""
|
|
17
17
|
|
|
18
18
|
import copy
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
"""
|
|
3
|
-
PPT
|
|
3
|
+
深知可信PPT - DrawingML Hyperlink Lowering
|
|
4
4
|
|
|
5
5
|
Register native PowerPoint hyperlink relationships and attach click actions to
|
|
6
6
|
text runs or clickable leaf shapes produced by the SVG converter.
|
|
@@ -13,7 +13,7 @@ Examples:
|
|
|
13
13
|
linked = apply_shape_hyperlink(result, ctx, "#slide-2")
|
|
14
14
|
|
|
15
15
|
Dependencies:
|
|
16
|
-
PPT
|
|
16
|
+
深知可信PPT hyperlink contract and DrawingML conversion context.
|
|
17
17
|
"""
|
|
18
18
|
|
|
19
19
|
from __future__ import annotations
|
|
@@ -250,7 +250,7 @@ def apply_theme_color_spec(extract_dir: Path, spec: ThemeColorSpec) -> None:
|
|
|
250
250
|
color_scheme = tree.getroot().find(f".//{{{DML_NS}}}clrScheme")
|
|
251
251
|
if color_scheme is None:
|
|
252
252
|
raise ThemeColorError(f"Theme has no clrScheme: {theme_path}")
|
|
253
|
-
color_scheme.set("name", "PPT
|
|
253
|
+
color_scheme.set("name", "深知可信PPT")
|
|
254
254
|
for slot, color in spec.slots.items():
|
|
255
255
|
_set_scheme_color(color_scheme, slot, color)
|
|
256
256
|
tree.write(theme_path, encoding="utf-8", xml_declaration=True)
|
|
@@ -204,7 +204,7 @@ def apply_theme_font_spec(extract_dir: Path, spec: ThemeFontSpec) -> None:
|
|
|
204
204
|
minor = font_scheme.find(f"{{{DML_NS}}}minorFont")
|
|
205
205
|
if major is None or minor is None:
|
|
206
206
|
raise ThemeFontError(f"Theme has no major/minor font collection: {theme_path}")
|
|
207
|
-
font_scheme.set("name", "PPT
|
|
207
|
+
font_scheme.set("name", "深知可信PPT")
|
|
208
208
|
_patch_font_collection(major, spec.major)
|
|
209
209
|
_patch_font_collection(minor, spec.minor)
|
|
210
210
|
tree.write(theme_path, encoding="utf-8", xml_declaration=True)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Materialize the supported inline SVG geometry-property subset.
|
|
2
2
|
|
|
3
|
-
SVG 2 lets selected geometry values participate in CSS. PPT
|
|
3
|
+
SVG 2 lets selected geometry values participate in CSS. 深知可信PPT does not
|
|
4
4
|
run a CSS engine, but it can safely compile literal per-element ``style``
|
|
5
5
|
declarations into the equivalent XML geometry attributes before any existing
|
|
6
6
|
SVG post-processing or DrawingML conversion runs.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
"""
|
|
3
|
-
PPT
|
|
3
|
+
深知可信PPT - Native Formula Shape Builder
|
|
4
4
|
|
|
5
5
|
Build editable PowerPoint formula shapes from explicit LaTeX markers.
|
|
6
6
|
|
|
@@ -13,7 +13,7 @@ Examples:
|
|
|
13
13
|
from svg_to_pptx.native_objects.formula import build_native_formula
|
|
14
14
|
|
|
15
15
|
Dependencies:
|
|
16
|
-
None (only uses standard library and local PPT
|
|
16
|
+
None (only uses standard library and local 深知可信PPT modules)
|
|
17
17
|
"""
|
|
18
18
|
|
|
19
19
|
from __future__ import annotations
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
r"""
|
|
3
|
-
PPT
|
|
3
|
+
深知可信PPT - Native Formula Compiler
|
|
4
4
|
|
|
5
5
|
Compile the documented Microsoft 365 LaTeX input profile into editable block
|
|
6
6
|
or inline Office Math XML.
|
|
@@ -15,7 +15,7 @@ Examples:
|
|
|
15
15
|
compile_latex_to_omml(r"\frac{-b \pm \sqrt{b^2-4ac}}{2a}")
|
|
16
16
|
|
|
17
17
|
Dependencies:
|
|
18
|
-
None (only uses standard library and local PPT
|
|
18
|
+
None (only uses standard library and local 深知可信PPT modules)
|
|
19
19
|
"""
|
|
20
20
|
|
|
21
21
|
from __future__ import annotations
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
"""
|
|
3
|
-
PPT
|
|
3
|
+
深知可信PPT - Native Formula OMML Emitter
|
|
4
4
|
|
|
5
5
|
Emit the Microsoft 365 LaTeX profile AST as editable Office Math XML and
|
|
6
6
|
validate the narrow XML vocabulary produced by this module.
|
|
@@ -14,7 +14,7 @@ Examples:
|
|
|
14
14
|
emit_omml(expression, display=True)
|
|
15
15
|
|
|
16
16
|
Dependencies:
|
|
17
|
-
None (only uses standard library and local PPT
|
|
17
|
+
None (only uses standard library and local 深知可信PPT modules)
|
|
18
18
|
"""
|
|
19
19
|
|
|
20
20
|
from __future__ import annotations
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
r"""
|
|
3
|
-
PPT
|
|
3
|
+
深知可信PPT - Microsoft 365 LaTeX Formula Parser
|
|
4
4
|
|
|
5
5
|
Parse the documented Microsoft 365 LaTeX import profile into the internal
|
|
6
6
|
native-formula AST. Unknown commands remain fail-closed.
|
|
@@ -14,7 +14,7 @@ Examples:
|
|
|
14
14
|
parse_latex_formula(r"\binom{n}{k}", display=True)
|
|
15
15
|
|
|
16
16
|
Dependencies:
|
|
17
|
-
None (only uses standard library and local PPT
|
|
17
|
+
None (only uses standard library and local 深知可信PPT modules)
|
|
18
18
|
"""
|
|
19
19
|
|
|
20
20
|
from __future__ import annotations
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
"""
|
|
3
|
-
PPT
|
|
3
|
+
深知可信PPT - Native Inline Formula Contract
|
|
4
4
|
|
|
5
5
|
Validate SVG inline-formula markers and build editable PowerPoint math runs.
|
|
6
6
|
|
|
@@ -13,7 +13,7 @@ Examples:
|
|
|
13
13
|
<tspan data-pptx-inline-formula="x_i^2">xᵢ²</tspan>
|
|
14
14
|
|
|
15
15
|
Dependencies:
|
|
16
|
-
None (only uses standard library and local PPT
|
|
16
|
+
None (only uses standard library and local 深知可信PPT modules)
|
|
17
17
|
"""
|
|
18
18
|
|
|
19
19
|
from __future__ import annotations
|
|
@@ -3948,20 +3948,18 @@ def _create_writable_work_dir(output_path: Path) -> Path:
|
|
|
3948
3948
|
)
|
|
3949
3949
|
|
|
3950
3950
|
|
|
3951
|
-
def
|
|
3952
|
-
"""
|
|
3951
|
+
def _restrict_output_permissions(output_path: Path) -> list[str]:
|
|
3952
|
+
"""Restrict exported files to the owner (no group/other access)."""
|
|
3953
3953
|
warnings: list[str] = []
|
|
3954
3954
|
|
|
3955
3955
|
try:
|
|
3956
3956
|
current_mode = output_path.stat().st_mode
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
| stat.S_IRUSR
|
|
3960
|
-
| stat.
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
)
|
|
3964
|
-
os.chmod(output_path, readable_mode)
|
|
3957
|
+
# 显式清除组/其他读位:umask 决定创建权限(常见 644),仅"不追加"不足以收紧
|
|
3958
|
+
owner_only_mode = (
|
|
3959
|
+
(current_mode | stat.S_IRUSR | stat.S_IWUSR)
|
|
3960
|
+
& ~(stat.S_IRGRP | stat.S_IROTH | stat.S_IWGRP | stat.S_IWOTH)
|
|
3961
|
+
)
|
|
3962
|
+
os.chmod(output_path, owner_only_mode)
|
|
3965
3963
|
except OSError as exc:
|
|
3966
3964
|
warnings.append(f"chmod skipped for {output_path}: {exc}")
|
|
3967
3965
|
|
|
@@ -6233,7 +6231,7 @@ def create_pptx_with_native_svg(
|
|
|
6233
6231
|
f'PPTX animation package validation failed: {exc}'
|
|
6234
6232
|
) from exc
|
|
6235
6233
|
shutil.move(str(temp_output_path), str(output_path))
|
|
6236
|
-
permission_warnings =
|
|
6234
|
+
permission_warnings = _restrict_output_permissions(output_path)
|
|
6237
6235
|
|
|
6238
6236
|
if conversion_trace_path and conversion_trace is not None:
|
|
6239
6237
|
conversion_trace_path.parent.mkdir(parents=True, exist_ok=True)
|
|
@@ -633,7 +633,7 @@ def _print_structure_contract_error(
|
|
|
633
633
|
print(
|
|
634
634
|
" A legacy lock without pptx_structure.mode defaults only to flat. "
|
|
635
635
|
"Mirror/layout reuse must first create a current template workspace "
|
|
636
|
-
"
|
|
636
|
+
"following references/svg-authoring.md, then generate "
|
|
637
637
|
"new structured SVG pages.",
|
|
638
638
|
file=sys.stderr,
|
|
639
639
|
)
|
|
@@ -648,7 +648,7 @@ def _print_structure_contract_error(
|
|
|
648
648
|
" A legacy lock with no pptx_structure.mode defaults to flat. "
|
|
649
649
|
"Explicit legacy or unknown values are not inferred. Mirror/layout reuse "
|
|
650
650
|
"must first create a current template workspace "
|
|
651
|
-
"
|
|
651
|
+
"following references/svg-authoring.md, then generate "
|
|
652
652
|
"new structured SVG pages.",
|
|
653
653
|
file=sys.stderr,
|
|
654
654
|
)
|
|
@@ -811,7 +811,7 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
811
811
|
animation_choices = ['none', *ANIMATIONS, 'auto', 'mixed', 'random']
|
|
812
812
|
|
|
813
813
|
parser = argparse.ArgumentParser(
|
|
814
|
-
description='PPT
|
|
814
|
+
description='深知可信PPT - SVG to native DrawingML PPTX Tool',
|
|
815
815
|
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
816
816
|
epilog=f'''
|
|
817
817
|
Examples:
|
|
@@ -1346,7 +1346,7 @@ Recorded narration:
|
|
|
1346
1346
|
)
|
|
1347
1347
|
quick_flag = ' --quick-generate' if args.quick_generate else ''
|
|
1348
1348
|
print(
|
|
1349
|
-
"Run: python3
|
|
1349
|
+
"Run: python3 scripts/svg_quality_checker.py "
|
|
1350
1350
|
f'"{project_path}"{quick_flag} --stage final --json',
|
|
1351
1351
|
file=sys.stderr,
|
|
1352
1352
|
)
|
|
@@ -1453,7 +1453,9 @@ Recorded narration:
|
|
|
1453
1453
|
|
|
1454
1454
|
backup_dir: Path | None = None
|
|
1455
1455
|
if args.output:
|
|
1456
|
+
# 显式 -o:使用调用方给定的固定文件名,同时保留 svg_output 备份(与默认分支一致)
|
|
1456
1457
|
native_path = Path(args.output)
|
|
1458
|
+
backup_dir = project_path / "backup" / timestamp
|
|
1457
1459
|
else:
|
|
1458
1460
|
exports_dir = project_path / "exports"
|
|
1459
1461
|
exports_dir.mkdir(parents=True, exist_ok=True)
|
|
@@ -1954,7 +1956,7 @@ Recorded narration:
|
|
|
1954
1956
|
)
|
|
1955
1957
|
|
|
1956
1958
|
if verbose:
|
|
1957
|
-
print("PPT
|
|
1959
|
+
print("深知可信PPT - SVG to native DrawingML PPTX Tool")
|
|
1958
1960
|
print("=" * 50)
|
|
1959
1961
|
print(f" Project path: {project_path}")
|
|
1960
1962
|
print(f" SVG directory: {native_source_dir}")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
"""
|
|
3
|
-
PPT
|
|
3
|
+
深知可信PPT - Shape Boolean Core
|
|
4
4
|
|
|
5
5
|
Resolve closed SVG or text-outline operands into SVG-root-coordinate paths and
|
|
6
6
|
apply PowerPoint-compatible merge-shapes operations without mutating the source.
|
|
@@ -19,7 +19,7 @@ Examples:
|
|
|
19
19
|
)
|
|
20
20
|
|
|
21
21
|
Dependencies:
|
|
22
|
-
skia-pathops, local PPT
|
|
22
|
+
skia-pathops, local 深知可信PPT modules, and uharfbuzz for text operands
|
|
23
23
|
"""
|
|
24
24
|
|
|
25
25
|
from __future__ import annotations
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
"""
|
|
3
|
-
PPT
|
|
3
|
+
深知可信PPT - Text Outline Materialization
|
|
4
4
|
|
|
5
5
|
Resolve one supported SVG ``<text>`` operand into closed glyph-outline path
|
|
6
6
|
commands for the Shape Boolean geometry pipeline.
|
|
@@ -9,7 +9,7 @@ Usage:
|
|
|
9
9
|
Import text_element_to_path_commands from svg_to_pptx.text_outline.
|
|
10
10
|
|
|
11
11
|
Dependencies:
|
|
12
|
-
uharfbuzz and local PPT
|
|
12
|
+
uharfbuzz and local 深知可信PPT modules
|
|
13
13
|
"""
|
|
14
14
|
|
|
15
15
|
from __future__ import annotations
|