dsh-knowhub 0.9.1 → 0.10.0

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 (192) hide show
  1. package/README.md +10 -1
  2. package/cordis.patch.yml +10 -0
  3. package/lib/host/pipeline/initialize.js +144 -27
  4. package/package.json +3 -2
  5. package/skills/archify/LICENSE +202 -0
  6. package/skills/archify/LICENSE-MIT +22 -0
  7. package/skills/archify/NOTICE +26 -0
  8. package/skills/archify/SKILL.md +137 -0
  9. package/skills/archify/THIRD_PARTY_NOTICES.md +78 -0
  10. package/skills/archify/assets/JetBrainsMono-OFL.txt +93 -0
  11. package/skills/archify/assets/template.html +14768 -0
  12. package/skills/archify/bin/archify.mjs +7289 -0
  13. package/skills/archify/bin/delivery-update.mjs +92 -0
  14. package/skills/archify/bin/finalize.mjs +1055 -0
  15. package/skills/archify/bin/open-artifact.mjs +146 -0
  16. package/skills/archify/bin/preview.mjs +970 -0
  17. package/skills/archify/bin/recover-output.mjs +41 -0
  18. package/skills/archify/bin/visual-check.mjs +2780 -0
  19. package/skills/archify/brand-marks/README.md +31 -0
  20. package/skills/archify/brand-marks/catalog.json +131 -0
  21. package/skills/archify/delta/architecture-delta.mjs +1318 -0
  22. package/skills/archify/examples/agent-run.lifecycle.json +55 -0
  23. package/skills/archify/examples/agent-tool-call.workflow.json +74 -0
  24. package/skills/archify/examples/archify-dev-activity.timeline.json +176 -0
  25. package/skills/archify/examples/archify-repository.tree.json +197 -0
  26. package/skills/archify/examples/async-job-roundtrip.sequence.json +56 -0
  27. package/skills/archify/examples/brand-aware-delivery.architecture.json +34 -0
  28. package/skills/archify/examples/cache-miss-request.sequence.json +77 -0
  29. package/skills/archify/examples/checkout-platform.base.architecture.json +32 -0
  30. package/skills/archify/examples/checkout-platform.head.architecture.json +32 -0
  31. package/skills/archify/examples/checkout-request.waterfall.json +20 -0
  32. package/skills/archify/examples/delivery.explainer.json +155 -0
  33. package/skills/archify/examples/deployment-release.lifecycle.json +72 -0
  34. package/skills/archify/examples/event-stream.dataflow.json +52 -0
  35. package/skills/archify/examples/example-rebuild.waterfall.json +212 -0
  36. package/skills/archify/examples/holiday-planning.workflow.json +143 -0
  37. package/skills/archify/examples/incident-response.workflow.json +59 -0
  38. package/skills/archify/examples/locales/de.json +463 -0
  39. package/skills/archify/examples/locales/fr.json +463 -0
  40. package/skills/archify/examples/locales/fr.partial.json +22 -0
  41. package/skills/archify/examples/locales/it.json +463 -0
  42. package/skills/archify/examples/locales/ja.json +463 -0
  43. package/skills/archify/examples/locales/pt.json +463 -0
  44. package/skills/archify/examples/locales/ru.json +463 -0
  45. package/skills/archify/examples/orders.erd.json +337 -0
  46. package/skills/archify/examples/payment-incident.timeline.json +24 -0
  47. package/skills/archify/examples/payment-platform.tree.json +22 -0
  48. package/skills/archify/examples/payment-processors.class.json +177 -0
  49. package/skills/archify/examples/payments.class.json +85 -0
  50. package/skills/archify/examples/product-analytics.dataflow.json +71 -0
  51. package/skills/archify/examples/production-deployment.architecture.json +51 -0
  52. package/skills/archify/examples/release-delivery.workflow.json +57 -0
  53. package/skills/archify/examples/subscription-billing.erd.json +548 -0
  54. package/skills/archify/examples/web-app.architecture.json +41 -0
  55. package/skills/archify/explainer/browser-check.mjs +208 -0
  56. package/skills/archify/explainer/charts.mjs +70 -0
  57. package/skills/archify/explainer/check.mjs +167 -0
  58. package/skills/archify/explainer/diagrams.mjs +517 -0
  59. package/skills/archify/explainer/diff.mjs +124 -0
  60. package/skills/archify/explainer/inline.mjs +155 -0
  61. package/skills/archify/explainer/layout.mjs +35 -0
  62. package/skills/archify/explainer/page-bundle.mjs +16 -0
  63. package/skills/archify/explainer/parse.mjs +300 -0
  64. package/skills/archify/explainer/patch.mjs +117 -0
  65. package/skills/archify/explainer/prepare.mjs +131 -0
  66. package/skills/archify/explainer/reader.css +472 -0
  67. package/skills/archify/explainer/reader.js +666 -0
  68. package/skills/archify/explainer/render.mjs +224 -0
  69. package/skills/archify/explainer/revision.mjs +20 -0
  70. package/skills/archify/explainer/sources.mjs +318 -0
  71. package/skills/archify/explainer/validate.mjs +138 -0
  72. package/skills/archify/explainer/vendor/pele/LICENSE +40 -0
  73. package/skills/archify/explainer/vendor/pele/README.md +5 -0
  74. package/skills/archify/explainer/vendor/pele/chunks/3DKXF73K.js +4 -0
  75. package/skills/archify/explainer/vendor/pele/chunks/42UTT654.js +3 -0
  76. package/skills/archify/explainer/vendor/pele/chunks/DKTLEL5E.js +1 -0
  77. package/skills/archify/explainer/vendor/pele/chunks/EEIX5ZYH.js +2 -0
  78. package/skills/archify/explainer/vendor/pele/chunks/EJ5KOXYD.js +25 -0
  79. package/skills/archify/explainer/vendor/pele/chunks/GUJTEFZK.js +1 -0
  80. package/skills/archify/explainer/vendor/pele/chunks/IZOKQ2GT.js +4 -0
  81. package/skills/archify/explainer/vendor/pele/chunks/L4LY553T.js +3 -0
  82. package/skills/archify/explainer/vendor/pele/chunks/MSKIJHB2.js +2 -0
  83. package/skills/archify/explainer/vendor/pele/chunks/RVARI57O.js +1 -0
  84. package/skills/archify/explainer/vendor/pele/chunks/UKSIWDDN.js +2 -0
  85. package/skills/archify/explainer/vendor/pele/chunks/UPTXNAXN.js +2 -0
  86. package/skills/archify/explainer/vendor/pele/chunks/XTDUIGUI.js +9 -0
  87. package/skills/archify/explainer/vendor/pele/chunks/YAYTP6L5.js +9 -0
  88. package/skills/archify/explainer/vendor/pele/core.js +1 -0
  89. package/skills/archify/explainer/vendor/pele/diagrams/pie.js +1 -0
  90. package/skills/archify/explainer/vendor/pele/diagrams/quadrantChart.js +1 -0
  91. package/skills/archify/explainer/vendor/pele/diagrams/radar.js +1 -0
  92. package/skills/archify/explainer/vendor/pele/diagrams/sankey.js +1 -0
  93. package/skills/archify/explainer/vendor/pele/diagrams/venn.js +1 -0
  94. package/skills/archify/explainer/vendor/pele/diagrams/xychart.js +1 -0
  95. package/skills/archify/explainer/writing.mjs +139 -0
  96. package/skills/archify/locales/README.md +40 -0
  97. package/skills/archify/locales/ar.json +488 -0
  98. package/skills/archify/locales/en.json +488 -0
  99. package/skills/archify/locales/es.json +488 -0
  100. package/skills/archify/locales/ko.json +488 -0
  101. package/skills/archify/locales/manifest.json +10 -0
  102. package/skills/archify/locales/zh-CN.json +488 -0
  103. package/skills/archify/locales/zh-TW.json +488 -0
  104. package/skills/archify/migrations/workflow-v2.mjs +280 -0
  105. package/skills/archify/package.json +17 -0
  106. package/skills/archify/recipes/scenarios.mjs +455 -0
  107. package/skills/archify/references/architecture-layout-repair.md +18 -0
  108. package/skills/archify/references/authoring-contract.md +645 -0
  109. package/skills/archify/references/authoring-defaults.md +57 -0
  110. package/skills/archify/references/brand-marks.md +119 -0
  111. package/skills/archify/references/delivery-contract.md +665 -0
  112. package/skills/archify/references/explainer-authoring.md +274 -0
  113. package/skills/archify/references/repository-authoring.md +126 -0
  114. package/skills/archify/references/update-awareness.md +13 -0
  115. package/skills/archify/references/viewer-runtime.md +52 -0
  116. package/skills/archify/renderers/architecture/grid.mjs +62 -0
  117. package/skills/archify/renderers/architecture/labels.mjs +2 -0
  118. package/skills/archify/renderers/architecture/render-architecture.mjs +1204 -0
  119. package/skills/archify/renderers/architecture/routing.mjs +1469 -0
  120. package/skills/archify/renderers/class/README.md +130 -0
  121. package/skills/archify/renderers/class/render-class.mjs +1095 -0
  122. package/skills/archify/renderers/dataflow/README.md +176 -0
  123. package/skills/archify/renderers/dataflow/dataflow-compiler.mjs +1605 -0
  124. package/skills/archify/renderers/dataflow/joint-label-routing.mjs +165 -0
  125. package/skills/archify/renderers/dataflow/label-capacity.mjs +81 -0
  126. package/skills/archify/renderers/dataflow/render-dataflow.mjs +23 -0
  127. package/skills/archify/renderers/erd/README.md +246 -0
  128. package/skills/archify/renderers/erd/grid.mjs +150 -0
  129. package/skills/archify/renderers/erd/render-erd.mjs +1588 -0
  130. package/skills/archify/renderers/explainer/render-explainer.mjs +42 -0
  131. package/skills/archify/renderers/lifecycle/README.md +104 -0
  132. package/skills/archify/renderers/lifecycle/render-lifecycle.mjs +1134 -0
  133. package/skills/archify/renderers/sequence/README.md +146 -0
  134. package/skills/archify/renderers/sequence/render-sequence.mjs +1105 -0
  135. package/skills/archify/renderers/shared/atomic-output.mjs +1982 -0
  136. package/skills/archify/renderers/shared/automatic-labels.mjs +290 -0
  137. package/skills/archify/renderers/shared/brand-marks.mjs +706 -0
  138. package/skills/archify/renderers/shared/cli.mjs +430 -0
  139. package/skills/archify/renderers/shared/desktop-readability.mjs +132 -0
  140. package/skills/archify/renderers/shared/diagnostics.mjs +0 -0
  141. package/skills/archify/renderers/shared/engineering-profiles.mjs +157 -0
  142. package/skills/archify/renderers/shared/generated-brand-marks.mjs +2003 -0
  143. package/skills/archify/renderers/shared/generated-validators.mjs +279 -0
  144. package/skills/archify/renderers/shared/geometry.mjs +2073 -0
  145. package/skills/archify/renderers/shared/i18n.mjs +328 -0
  146. package/skills/archify/renderers/shared/layout-report.mjs +57 -0
  147. package/skills/archify/renderers/shared/legend.mjs +227 -0
  148. package/skills/archify/renderers/shared/node-card-style.mjs +32 -0
  149. package/skills/archify/renderers/shared/output-path.mjs +440 -0
  150. package/skills/archify/renderers/shared/owned-temp-directory.mjs +82 -0
  151. package/skills/archify/renderers/shared/path-semantics.mjs +1017 -0
  152. package/skills/archify/renderers/shared/portable-path.mjs +408 -0
  153. package/skills/archify/renderers/shared/repository-evidence.mjs +394 -0
  154. package/skills/archify/renderers/shared/repository-location.mjs +71 -0
  155. package/skills/archify/renderers/shared/route-quality.mjs +670 -0
  156. package/skills/archify/renderers/shared/sidecar-path.mjs +38 -0
  157. package/skills/archify/renderers/shared/software-notices.mjs +6 -0
  158. package/skills/archify/renderers/shared/spatial-grid.mjs +66 -0
  159. package/skills/archify/renderers/shared/svg-path-analysis.mjs +135 -0
  160. package/skills/archify/renderers/shared/text-fit.mjs +105 -0
  161. package/skills/archify/renderers/shared/utils.mjs +260 -0
  162. package/skills/archify/renderers/shared/validator.mjs +83 -0
  163. package/skills/archify/renderers/timeline/README.md +76 -0
  164. package/skills/archify/renderers/timeline/render-timeline.mjs +576 -0
  165. package/skills/archify/renderers/tree/README.md +96 -0
  166. package/skills/archify/renderers/tree/render-tree.mjs +573 -0
  167. package/skills/archify/renderers/waterfall/README.md +73 -0
  168. package/skills/archify/renderers/waterfall/render-waterfall.mjs +413 -0
  169. package/skills/archify/renderers/workflow/README.md +337 -0
  170. package/skills/archify/renderers/workflow/render-workflow.mjs +47 -0
  171. package/skills/archify/renderers/workflow/workflow-compiler.mjs +5920 -0
  172. package/skills/archify/renderers/workflow/workflow-migration-geometry.mjs +161 -0
  173. package/skills/archify/renderers/workflow/workflow-placement-repair.mjs +94 -0
  174. package/skills/archify/schemas/README.md +258 -0
  175. package/skills/archify/schemas/architecture.schema.json +152 -0
  176. package/skills/archify/schemas/class.schema.json +345 -0
  177. package/skills/archify/schemas/common.schema.json +181 -0
  178. package/skills/archify/schemas/dataflow.schema.json +254 -0
  179. package/skills/archify/schemas/erd.schema.json +381 -0
  180. package/skills/archify/schemas/explainer.schema.json +927 -0
  181. package/skills/archify/schemas/lifecycle.schema.json +179 -0
  182. package/skills/archify/schemas/sequence.schema.json +234 -0
  183. package/skills/archify/schemas/timeline.schema.json +160 -0
  184. package/skills/archify/schemas/tree.schema.json +141 -0
  185. package/skills/archify/schemas/waterfall.schema.json +147 -0
  186. package/skills/archify/schemas/workflow.schema.json +439 -0
  187. package/skills/archify/scripts/check-render-output.mjs +1469 -0
  188. package/skills/archify/scripts/check-update.mjs +1717 -0
  189. package/skills/archify/scripts/delivery-update-child.mjs +26 -0
  190. package/skills/archify/scripts/render-examples.mjs +36 -0
  191. package/skills/archify/scripts/update-contract.mjs +187 -0
  192. package/skills/archify/skill-release.json +10 -0
package/README.md CHANGED
@@ -106,7 +106,7 @@ cmd /c mklink /J "$env:USERPROFILE\.dsh\profiles\knowhub\node_modules\dsh-knowhu
106
106
  ## 使用流程
107
107
 
108
108
  1. **新建知识库**:左侧栏「知枢」→「知识库」→「+ 新建」,选择生效范围(用户级 / 工作区级)、模型与策略。
109
- 2. **初始化 Wiki**:在知识库详情点「初始化」,扫描工作区并生成候选草稿。
109
+ 2. **初始化知识**:在知识库详情点「初始化」,扫描工作区并按 Repo Wiki / 知识卡片 / 长期记忆三条线生成候选草稿。
110
110
  3. **审核**:右上「待审核」里逐条或批量审批;内容有改动可用「编辑后批准」,冲突可人工合并。
111
111
  4. **增量更新**:初始化完成后点「增量更新」,只对变更文件影响到的知识生成候选。
112
112
  5. **记忆与卡片**:会话中由 Agent 工具提议,或开启自动提炼;结果都在待审核里确认。
@@ -131,6 +131,15 @@ cmd /c mklink /J "$env:USERPROFILE\.dsh\profiles\knowhub\node_modules\dsh-knowhu
131
131
  - 弹窗统一使用 DSH 视觉规范:半透明遮罩 + 背景模糊、层级阴影、进出场动画;打开时锁定页面滚动,Esc 或点击遮罩关闭。
132
132
  - 表单内的字段校验仍在输入框旁就地提示;接口错误既进入浮层提示,也在受影响的区域给出定位。
133
133
 
134
+ ## 捆绑技能:Archify 绘图
135
+
136
+ 本包捆绑了 [Archify](https://github.com/tt-a1i/archify) 3.2.0 技能(位于 `skills/archify/`),安装 KnowHub 后 DSH 的技能系统即可加载它,用一句话让 Agent 绘制可交互的图:架构图(architecture)、流程图(workflow)、时序图(sequence)、数据流图(dataflow)、状态机(lifecycle)、ER 图(erd)、类图(class)、树形知识图谱(tree)、时间线(timeline)与瀑布图(waterfall),产出为独立 HTML 文件落在工作区(默认 `.archify/` 目录)。
137
+
138
+ - 用法示例:在 DSH 对话中点名技能,如「Use the archify skill to map this repository's runtime architecture」或「用 archify 把这个项目的模块关系画成 tree 图」。
139
+ - 捆绑机制与上游官方适配包 `@tt-a1i/archify-dsh` 一致(通过 `cordis.patch.yml` 注册文件系统技能提供方);**不要再同时安装 `@tt-a1i/archify-dsh`**,功能重复。同名个人/项目技能的优先级高于本捆绑版本。
140
+ - 为控制包体积,捆绑时仅剔除了 `examples/` 下 15 个已渲染的示例 HTML(约 13MB,技能文档与运行均不引用它们);其余文件与上游 3.2.0 保持一致。
141
+ - 许可:Archify 技能为 Apache-2.0,其 `LICENSE`、`LICENSE-MIT`、`NOTICE`、`THIRD_PARTY_NOTICES.md` 均随附在 `skills/archify/` 内;KnowHub 本体仍为 MIT。
142
+
134
143
  ## 常见问题
135
144
 
136
145
  **初始化或增量任务失败,提示模型调用失败怎么办?**
package/cordis.patch.yml CHANGED
@@ -13,3 +13,13 @@
13
13
  # 客户端半边(node 侧为空壳):dsh.client 声明让客户端模块系统把它编入 window.__DSH_BOOT__
14
14
  - id: knowhub-ui
15
15
  name: dsh-knowhub
16
+
17
+ # 捆绑 Archify 技能(架构图 / 流程图 / 时序图 / 树形知识图谱等,Archify 3.2.0,Apache-2.0):
18
+ # 技能文件随本包分发在 skills/archify,机制与上游 @tt-a1i/archify-dsh 适配包一致;
19
+ # bundledSkillDir 锚定本包的安装位置解析,不拼宿主路径。与 @tt-a1i/archify-dsh 二选一安装,不要同装。
20
+ - id: knowhub-archify-skill
21
+ name: '@deepseek-ai/dsh-skill-filesystem'
22
+ config:
23
+ providerName: archify-plugin
24
+ includeDefaultRoots: true
25
+ bundledSkillDir: !!js process.getBuiltinModule('node:path').join(process.getBuiltinModule('node:path').dirname(process.getBuiltinModule('node:module').createRequire(baseUrl).resolve('dsh-knowhub/package.json')), 'skills')
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 初始化流水线(M2):真实扫描 → 文件索引 → 用知识库绑定模型生成 Wiki 候选 → 存为待审核草稿。
2
+ * 初始化流水线(M2):真实扫描 → 文件索引 → 用知识库绑定模型按内容区(Repo Wiki / 知识卡片 / 长期记忆)生成知识候选 → 存为待审核草稿。
3
3
  *
4
4
  * 硬约束(对应规范 §4 / §14.2 / §14.3):
5
5
  * - 模型只用 knowledge_base.model_provider + model_id,绝不回退到全局默认;目录里找不到即报错;
@@ -33,19 +33,29 @@ export class InitError extends Error {
33
33
  }
34
34
  const DOC_KINDS = new Set(['wiki', 'decision', 'issue', 'todo', 'memory', 'convention', 'preference']);
35
35
  const STRATEGY_LIMITS = {
36
- economy: { maxFiles: 12000, maxHashes: 1500, maxContextChars: 12000, maxTokens: 10000, wikiPages: 2 },
37
- balanced: { maxFiles: 20000, maxHashes: 3000, maxContextChars: 20000, maxTokens: 20000, wikiPages: 4 },
38
- quality: { maxFiles: 30000, maxHashes: 6000, maxContextChars: 30000, maxTokens: 50000, wikiPages: 7 },
36
+ economy: { maxFiles: 12000, maxHashes: 1500, maxContextChars: 20000, maxTokens: 10000, wikiPages: 2 },
37
+ balanced: { maxFiles: 20000, maxHashes: 3000, maxContextChars: 40000, maxTokens: 20000, wikiPages: 4 },
38
+ quality: { maxFiles: 30000, maxHashes: 6000, maxContextChars: 60000, maxTokens: 50000, wikiPages: 7 },
39
39
  };
40
40
  function planCalls(strategy) {
41
- const base = [{ purpose: 'wiki-overview', topics: ['项目总览', '技术栈与依赖'] }];
41
+ const overview = { purpose: 'wiki-overview', area: 'wiki', topics: ['项目总览', '技术栈与依赖'] };
42
+ const cardsCore = { purpose: 'cards-core', area: 'cards', topics: ['技术选型与决策', '已知问题与风险'] };
42
43
  if (strategy === 'economy')
43
- return base;
44
- const second = { purpose: 'wiki-architecture', topics: ['系统架构', '核心模块'] };
44
+ return [overview, cardsCore];
45
+ const architecture = { purpose: 'wiki-architecture', area: 'wiki', topics: ['系统架构', '核心模块'] };
46
+ const memoryCore = { purpose: 'memory-core', area: 'memory', topics: ['项目背景与长期事实', '项目约定与协作偏好'] };
45
47
  if (strategy === 'balanced')
46
- return [...base, second];
47
- return [...base, second, { purpose: 'wiki-interfaces', topics: ['关键接口与数据流', '技术选型与决策记录', '已知问题与待确认事项'] }];
48
+ return [overview, architecture, cardsCore, memoryCore];
49
+ return [
50
+ overview,
51
+ architecture,
52
+ { purpose: 'wiki-interfaces', area: 'wiki', topics: ['关键接口与数据流'] },
53
+ cardsCore,
54
+ { purpose: 'cards-actions', area: 'cards', topics: ['待办事项与待确认问题'] },
55
+ memoryCore,
56
+ ];
48
57
  }
58
+ const AREA_LABELS = { wiki: 'Repo Wiki', cards: '知识卡片', memory: '长期记忆' };
49
59
  function updateKbStatus(db, kbId, status, detail) {
50
60
  run(db, 'UPDATE knowledge_bases SET status = ?, status_detail = ?, updated_at = ? WHERE id = ?', [status, JSON.stringify(detail).slice(0, 4000), Date.now(), kbId]);
51
61
  }
@@ -74,7 +84,30 @@ export function sanitizeModelText(text, secrets) {
74
84
  function escapeRegex(value) {
75
85
  return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
76
86
  }
77
- function buildContext(index, strategy) {
87
+ /** 读取关键文件摘录补强上下文:README 优先、其次入口文件;只读已进入索引的文件(敏感文件已被索引排除),读不到就跳过。 */
88
+ async function readKeyFileSnippets(root, index) {
89
+ const known = new Set(index.files.map((file) => file.path));
90
+ const picks = [];
91
+ const readme = index.files.find((file) => /^readme(\.[a-z-]+)?\.md$/i.test(file.path));
92
+ if (readme)
93
+ picks.push({ path: readme.path, cap: 6000 });
94
+ for (const hint of index.stack.entryHints.slice(0, 2)) {
95
+ if (known.has(hint) && hint !== readme?.path)
96
+ picks.push({ path: hint, cap: 2500 });
97
+ }
98
+ const snippets = [];
99
+ for (const pick of picks) {
100
+ try {
101
+ const text = await fs.readFile(join(root, pick.path), 'utf8');
102
+ snippets.push({ path: pick.path, text: text.slice(0, pick.cap) });
103
+ }
104
+ catch {
105
+ // 读不到就跳过,不阻断初始化。
106
+ }
107
+ }
108
+ return snippets;
109
+ }
110
+ function buildContext(index, strategy, keySnippets = []) {
78
111
  const limits = STRATEGY_LIMITS[strategy];
79
112
  const parts = [];
80
113
  parts.push('项目根:<项目根>');
@@ -94,6 +127,13 @@ function buildContext(index, strategy) {
94
127
  parts.push(index.files.slice(0, fileLimit).map((file) => file.path).join('\n'));
95
128
  if (index.files.length > fileLimit)
96
129
  parts.push('…(其余 ' + (index.files.length - fileLimit) + ' 个文件未列出)');
130
+ if (keySnippets.length > 0) {
131
+ parts.push('关键文件内容摘录:');
132
+ for (const snippet of keySnippets) {
133
+ parts.push('--- ' + snippet.path + ' ---');
134
+ parts.push(snippet.text);
135
+ }
136
+ }
97
137
  if (index.configSnippets.length > 0) {
98
138
  parts.push('关键配置摘要:');
99
139
  for (const snippet of index.configSnippets) {
@@ -104,20 +144,65 @@ function buildContext(index, strategy) {
104
144
  const text = parts.join('\n');
105
145
  return text.length > limits.maxContextChars ? text.slice(0, limits.maxContextChars) + '\n…(上下文已按策略截断)' : text;
106
146
  }
107
- function buildPrompt(topics, context) {
147
+ function strictRules() {
108
148
  return [
109
- '你是知枢 KnowHub 的项目文档分析器。请只依据下面提供的仓库事实,生成 Repo Wiki 候选文档。',
110
149
  '严格要求:',
111
150
  '1. 只输出一个 JSON 对象,不要输出任何解释、前后缀或 Markdown 代码围栏之外的文字。',
112
- '2. 不得编造未在上下文中出现的模块职责、接口、依赖或决策;无法确认的内容写入 uncertain 数组。',
113
- '3. 文档正文使用简体中文 Markdown;涉及文件时使用相对路径(如 src/host/tasks.ts)。',
114
- '4. 每条文档必须给出 sources,值为上方文件清单中真实存在的相对路径;没有可引用文件时 sources 为空数组。',
151
+ '2. 不得编造未在上下文中出现的模块职责、接口、依赖、决策或事实;无法确认的内容写入 uncertain 数组,证据不足的条目宁可不写。',
152
+ '3. 正文使用简体中文 Markdown;涉及文件时使用相对路径(如 src/host/tasks.ts)。',
153
+ '4. 每条必须给出 sources,值为上方文件清单中真实存在的相对路径;没有可引用文件时 sources 为空数组。',
115
154
  '5. 不得输出密钥、凭据、绝对路径或完整环境变量值。',
155
+ '6. 不要写「该模块负责相关功能」这类空话;每句话都要落到上下文中可核对的事实上。',
156
+ ];
157
+ }
158
+ function buildPrompt(planned, context) {
159
+ if (planned.area === 'cards') {
160
+ return [
161
+ '你是知枢 KnowHub 的项目知识分析器。请只依据下面提供的仓库事实,提炼「知识卡片」候选:结论先行、短小具体的卡片,而不是长篇文档。',
162
+ ...strictRules(),
163
+ '',
164
+ '需要提炼的主题:' + planned.topics.join('、'),
165
+ '每个主题提炼 1-3 张卡片;没有足够证据的主题直接跳过,不要硬凑。',
166
+ 'kind 只能是 decision / issue / todo / convention 之一:',
167
+ '- decision(技术选型与决策):正文写清选了什么、为什么、代价或替代方案;',
168
+ '- issue(已知问题与风险):正文写清现象、影响范围与证据文件;',
169
+ '- todo(待办与待确认):正文写清待办或待确认什么、为什么重要;',
170
+ '- convention(项目约定):正文写清约定内容与适用范围(如目录组织、命名、提交或测试约定)。',
171
+ '每张卡片正文 80-400 字,第一句就是结论。',
172
+ '输出 JSON 结构:',
173
+ '{"documents":[{"title":"卡片标题","kind":"decision","tags":["标签"],"confidence":0.6,"sources":["相对路径"],"body":"Markdown 正文","uncertain":["待确认事项"]}]}',
174
+ '',
175
+ '仓库事实:',
176
+ context,
177
+ ].join('\n');
178
+ }
179
+ if (planned.area === 'memory') {
180
+ return [
181
+ '你是知枢 KnowHub 的长期记忆分析器。请只依据下面提供的仓库事实,提炼值得长期保存、跨会话复用的「长期记忆」候选。',
182
+ ...strictRules(),
183
+ '',
184
+ '需要提炼的主题:' + planned.topics.join('、'),
185
+ 'kind 只能是 memory / preference 之一:',
186
+ '- memory(长期事实):项目目标与背景、当前阶段与里程碑、稳定的技术事实与边界——只记长期有效的内容,不记一次性细节;',
187
+ '- preference(偏好与约定倾向):从文档与配置中能明确看出的协作或工程偏好;看不出就不要写这一类。',
188
+ '每个主题提炼 1-2 条;每条正文 2-6 句完整中文,先给事实,再给一句理由或来源说明。',
189
+ '输出 JSON 结构:',
190
+ '{"documents":[{"title":"记忆标题","kind":"memory","tags":["标签"],"confidence":0.6,"sources":["相对路径"],"body":"Markdown 正文","uncertain":["待确认事项"]}]}',
191
+ '',
192
+ '仓库事实:',
193
+ context,
194
+ ].join('\n');
195
+ }
196
+ return [
197
+ '你是知枢 KnowHub 的项目文档分析器。请只依据下面提供的仓库事实,生成 Repo Wiki 候选文档。',
198
+ ...strictRules(),
116
199
  '',
117
- '需要生成的文档主题:' + topics.join('、'),
200
+ '需要生成的文档主题:' + planned.topics.join('、'),
201
+ '每个主题必须恰好生成一篇文档,标题与主题对应。',
202
+ '正文结构建议:先一段概述,再用小标题展开结构与要点;每篇 300-1200 字。',
118
203
  '输出 JSON 结构:',
119
204
  '{"documents":[{"title":"文档标题","kind":"wiki","tags":["标签"],"confidence":0.6,"sources":["相对路径"],"body":"Markdown 正文","uncertain":["待确认事项"]}]}',
120
- 'kind 只能是 wiki / decision / issue / todo 之一:架构、模块、总览、技术栈用 wiki;技术选型理由用 decision;已知问题用 issue;待确认事项用 todo。',
205
+ 'kind 只能是 wiki:本轮只生成 Repo Wiki 文档。',
121
206
  '',
122
207
  '仓库事实:',
123
208
  context,
@@ -216,29 +301,34 @@ export async function runInitialize(deps) {
216
301
  if (!modelAvailable)
217
302
  throw new InitError('MODEL_NOT_AVAILABLE', '知识库绑定的模型已不可用(提供方 ' + kb.modelProvider + ' / 模型 ' + kb.modelId + ')。请在知识库设置中重新选择模型;插件不会自动改用其它模型。');
218
303
  log('info', '使用知识库绑定模型:' + kb.modelProvider + ' / ' + kb.modelId);
219
- // 4) 按策略调用模型生成候选
304
+ // 4) 按策略调用模型生成候选(三条线分别规划,单线失败不拖垮整轮)
220
305
  const calls = planCalls(strategy);
221
- const context = buildContext(index, strategy);
306
+ const keySnippets = await readKeyFileSnippets(root, index);
307
+ if (keySnippets.length > 0)
308
+ log('info', '已读取 ' + keySnippets.length + ' 个关键文件的内容摘录补强上下文');
309
+ const context = buildContext(index, strategy, keySnippets);
222
310
  const knownPaths = new Set(index.files.map((file) => file.path));
223
311
  const created = [];
224
312
  const conflicts = [];
225
313
  const rejected = [];
314
+ const callFailures = [];
226
315
  let documentsSeen = 0;
227
316
  const callSummaries = [];
228
317
  const secrets = { root, storageRoot };
229
- currentStage = '生成 Wiki 候选';
318
+ currentStage = '生成知识候选';
230
319
  for (let position = 0; position < calls.length; position += 1) {
231
320
  const planned = calls[position];
232
321
  if (!planned)
233
322
  continue;
234
323
  ensureNotAborted(signal);
235
324
  const percent = 40 + Math.round((position / calls.length) * 45);
236
- progress(percent, '调用模型生成:' + planned.topics.join('、'));
237
- const prompt = buildPrompt(planned.topics, context);
325
+ progress(percent, '调用模型生成' + AREA_LABELS[planned.area] + ':' + planned.topics.join('、'));
326
+ const prompt = buildPrompt(planned, context);
238
327
  log('info', '调用模型(' + planned.purpose + ',主题:' + planned.topics.join('、') + ',提示长度 ' + prompt.length + ' 字符)');
239
328
  // 推理模型可能把 token 预算耗在思考上导致输出被截断:识别出来并加倍预算重试一次。
240
329
  let budget = limits.maxTokens;
241
330
  let parsed = null;
331
+ let callFailure = null;
242
332
  for (let attempt = 1;; attempt += 1) {
243
333
  ensureNotAborted(signal);
244
334
  const result = await runModelCall(ctx, {
@@ -279,9 +369,28 @@ export async function runInitialize(deps) {
279
369
  budget = nextBudget;
280
370
  continue;
281
371
  }
282
- throw new InitError(output.code, output.message);
372
+ // 单条线的输出问题(截断重试后仍失败 / 结构不合法)只跳过本条线,其余线继续;
373
+ // 全部线都失败时在收尾处按优先级抛出最可操作的错误(见下方收尾判断)。
374
+ callFailure = { code: output.code, message: output.message };
375
+ break;
376
+ }
377
+ if (callFailure) {
378
+ callFailures.push({ purpose: planned.purpose, code: callFailure.code, message: callFailure.message });
379
+ log('warn', '本轮生成失败,已跳过(' + planned.purpose + ',' + callFailure.code + '):' + callFailure.message);
380
+ continue;
381
+ }
382
+ let validated;
383
+ try {
384
+ validated = validateDocuments(parsed, knownPaths, secrets);
385
+ }
386
+ catch (validationError) {
387
+ if (validationError instanceof InitError && validationError.code === 'MODEL_OUTPUT_INVALID') {
388
+ callFailures.push({ purpose: planned.purpose, code: validationError.code, message: validationError.message });
389
+ log('warn', '本轮生成失败,已跳过(' + planned.purpose + ',' + validationError.code + '):' + validationError.message);
390
+ continue;
391
+ }
392
+ throw validationError;
283
393
  }
284
- const validated = validateDocuments(parsed, knownPaths, secrets);
285
394
  rejected.push(...validated.rejected);
286
395
  documentsSeen += validated.documents.length;
287
396
  if (validated.rejected.length > 0)
@@ -322,11 +431,18 @@ export async function runInitialize(deps) {
322
431
  run(db, 'INSERT INTO sources (id, doc_id, candidate_id, kind, ref, locator, excerpt_hash, verified, created_at) VALUES (?, ?, NULL, ?, ?, ?, ?, 1, ?)', [newId('src'), doc.id, 'file', source, candidate.title, contentHash(source).slice(0, 16), Date.now()]);
323
432
  }
324
433
  created.push({ id: doc.id, title: doc.title });
325
- log('info', '已创建 Wiki 候选草稿「' + doc.title + '」(来源文件 ' + candidate.sources.length + ' 个,可信度 ' + candidate.confidence.toFixed(2) + ')');
434
+ log('info', '已创建候选草稿「' + doc.title + '」(来源文件 ' + candidate.sources.length + ' 个,可信度 ' + candidate.confidence.toFixed(2) + ')');
326
435
  }
327
436
  }
328
437
  if (created.length === 0 && conflicts.length === 0) {
329
- throw new InitError('NO_DOCUMENT_CREATED', '本次没有创建任何 Wiki 候选(模型输出未通过校验)');
438
+ // 全部线都失败:优先报截断(有明确的换模型/升档建议),其次报输出不合法,最后才是无产出。
439
+ const truncatedFailure = callFailures.find((failure) => failure.code === 'MODEL_OUTPUT_TRUNCATED');
440
+ if (truncatedFailure)
441
+ throw new InitError('MODEL_OUTPUT_TRUNCATED', truncatedFailure.message);
442
+ const invalidFailure = callFailures.find((failure) => failure.code === 'MODEL_OUTPUT_INVALID');
443
+ if (invalidFailure)
444
+ throw new InitError('MODEL_OUTPUT_INVALID', invalidFailure.message);
445
+ throw new InitError('NO_DOCUMENT_CREATED', '本次没有创建任何知识候选(模型输出未通过校验)');
330
446
  }
331
447
  if (created.length === 0) {
332
448
  // 幂等重跑:模型给出的主题都已在库中(草稿或已批准)。不视为失败,也不覆盖任何已有知识。
@@ -343,6 +459,7 @@ export async function runInitialize(deps) {
343
459
  documents: created,
344
460
  conflicts,
345
461
  rejected,
462
+ failures: callFailures,
346
463
  index: { fileCount: index.fileCount, textFileCount: index.textFileCount, byLanguage: index.byLanguage.slice(0, 8), excludedDirs: index.excludedDirs, skippedSensitive: index.skippedSensitive, skippedSymlinks: index.skippedSymlinks, truncated: index.truncated },
347
464
  workspace: { id: workspace.id, title: workspace.title, path: root },
348
465
  finishedAt: new Date().toISOString(),
@@ -360,7 +477,7 @@ export async function runInitialize(deps) {
360
477
  updatedAt: summary.finishedAt,
361
478
  }, null, 2) + '\n');
362
479
  progress(100, '完成');
363
- log('info', '初始化完成:候选文档 ' + created.length + ' 篇,冲突 ' + conflicts.length + ' 条,模型调用 ' + calls.length + ' 次');
480
+ log('info', '初始化完成:候选文档 ' + created.length + ' 篇,冲突 ' + conflicts.length + ' 条,模型调用 ' + calls.length + ' 次' + (callFailures.length > 0 ? ',其中 ' + callFailures.length + ' 条线生成失败已跳过' : ''));
364
481
  return { documents: created.length, conflicts: conflicts.length, files: index.fileCount, calls: calls.length, model: summary.model, purposes: calls.map((call) => call.purpose) };
365
482
  }
366
483
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-knowhub",
3
- "version": "0.9.1",
3
+ "version": "0.10.0",
4
4
  "description": "知枢 KnowHub — DSH 全局知识中心与项目长期记忆:知识库、Repo Wiki、审核与版本、增量更新、检索与上下文注入、自动提炼、备份恢复、中文面板",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -52,7 +52,8 @@
52
52
  "cordis.patch.yml",
53
53
  "README.md",
54
54
  "LICENSE",
55
- "assets"
55
+ "assets",
56
+ "skills"
56
57
  ],
57
58
  "devDependencies": {
58
59
  "@types/node": "^22.19.0",
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 tt-a1i (Archify)
4
+ Copyright (c) 2025 Cocoon AI
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
@@ -0,0 +1,26 @@
1
+ Archify
2
+ Copyright (c) 2026 tt-a1i (Archify)
3
+ Copyright (c) 2025 Cocoon AI
4
+
5
+ Archify is distributed under the Apache License, Version 2.0 (LICENSE),
6
+ except where a file, package manifest, or third-party notice specifies otherwise.
7
+ The separately versioned DeepSeek Harness adapter remains MIT; its bundled
8
+ Skill retains the license of the immutable source selected in release.json.
9
+
10
+ Code and contributions received under the MIT License through pre-transition
11
+ commit 25cf37080fc8b1dbe758a4efc3935b55f3327083 remain available under their
12
+ original terms. Previously published releases keep their existing licenses. The complete historical MIT
13
+ copyright and permission notice is preserved in LICENSE-MIT. This transition
14
+ does not revoke existing MIT grants or assert a new patent grant on behalf
15
+ of historical contributors.
16
+
17
+ Archify originated from Cocoon-AI/architecture-diagram-generator:
18
+ https://github.com/Cocoon-AI/architecture-diagram-generator
19
+
20
+ Third-party components retain their own licenses; see THIRD_PARTY_NOTICES.md
21
+ and the license files beside those components. Names and logos do not imply
22
+ official endorsement, and the software license grants no general trademark
23
+ permission.
24
+
25
+ These software licenses cover Archify's embedded runtime and templates, not
26
+ ownership of a user's authored content, business data, or source repository.