clearai-dsh 0.5.6 → 0.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/README.md +33 -19
- package/README.zh-CN.md +31 -17
- package/lib/client.js +529 -163
- package/lib/fold.js +60 -15
- package/package.json +4 -3
- package/presets/clearai/agent.cordis.yml +0 -3
- package/presets/clearai/clearai.patch.yml +0 -3
- package/presets/clearai/plugins/audit-evidence.js +31 -0
- package/presets/clearai/plugins/audit-material.js +32 -16
- package/presets/clearai/plugins/clearai-kernel.js +137 -128
- package/presets/clearai/plugins/integrity.js +70 -0
- package/presets/clearai/plugins/rerun-copy.js +41 -0
- package/presets/clearai/plugins/tool-argument-stream.js +32 -0
- package/presets/clearai/plugins/workspace-path.js +23 -0
package/lib/client.js
CHANGED
|
@@ -185,8 +185,8 @@ window.__ModuleLoader__.load({
|
|
|
185
185
|
|
|
186
186
|
/** 语言命名空间。表按**源文**索引:键就是中文原文,所以漏翻译一条只会退回中文,不会把 key 显示给人。 */
|
|
187
187
|
const LOCALE_NS = 'clearai'
|
|
188
|
-
const LOCALE_ZH = {"待执行":"待执行","已交付":"已交付","已作废":"已作废","支持":"支持","推翻":"推翻","不确定":"不确定","第 n 步":"第 n 步","判据:":"判据:","判据":"判据"," · 已修订 ":" · 已修订 "," 次":" 次"," · 最近一次修订的独立裁决:":" · 最近一次修订的独立裁决:","打开目标文档(原生预览)":"打开目标文档(原生预览)","全文在 ":"全文在 ","背景(不参与判定):":"背景(不参与判定):","目标":"目标","命题":"命题","计划":"计划","验证":"验证","观测":"观测","评估":"评估","证据":"证据","事实":"事实","批准":"批准","未解释":"未解释","评估卡":"评估卡","查看评估者":"查看评估者","审批记录":"审批记录","产物":"产物","已验证":"已验证","待核验":"待核验","验证中":"验证中","已推翻":"已推翻","已替换":"已替换","自行检验":"自行检验","独立核验":"独立核验","人工批准":"人工批准","判断":"判断","检验":"检验","纳入本体":"纳入本体","下一步:安排步骤对其进行检验":"下一步:安排步骤对其进行检验","下一步:通过独立核验后标记为已验证":"下一步:通过独立核验后标记为已验证","下一步:改用其他方法重新检验":"下一步:改用其他方法重新检验","下一步:结案时写入长期知识":"下一步:结案时写入长期知识","陈述":"陈述","数值":"数值","公式":"公式","代码":"代码","引用":"引用","概念":"概念","取值形态":"取值形态","实例":"实例","取值":"取值","关系":"关系","在检验阶段被推翻,不再推进。":"在检验阶段被推翻,不再推进。","已被替换,不再推进。":"已被替换,不再推进。","提出":"提出","单步检验":"单步检验",":":":","写入长期知识":"写入长期知识","人工撤回":"人工撤回","进度":"进度","可信度变化":"可信度变化","补充说明":"补充说明","依据":"依据","查看核验":"查看核验","查看记录":"查看记录","范围":"范围","推翻条件":"推翻条件","相关":"相关","在图中定位":"在图中定位","来源":"来源","收起":"收起","点击查看进度与来源":"点击查看进度与来源","暂无结论。模型提出判断后,将在此逐条列出。":"暂无结论。模型提出判断后,将在此逐条列出。","尚未设立目标":"尚未设立目标","暂无内容。发送第一条消息后,此处将显示本体图与结论。":"暂无内容。发送第一条消息后,此处将显示本体图与结论。","仅显示与「":"仅显示与「","」相关的内容":"」相关的内容","清除":"清除","已确立的事实":"已确立的事实","暂无已确立的事实。判断经检验与独立核验后,将在此列出;检验过程见探索货架。":"暂无已确立的事实。判断经检验与独立核验后,将在此列出;检验过程见探索货架。","经验(":"经验(",")":")","广度调研":"广度调研","定向求解":"定向求解","先调研后求解":"先调研后求解","考察中":"考察中","已排除":"已排除","已采纳":"已采纳","暂不考察":"暂不考察","未开始":"未开始","调研中":"调研中","已厘清":"已厘清","常见误区":"常见误区","前置核查":"前置核查","不可取的捷径":"不可取的捷径","先验知识":"先验知识","提出依据":"提出依据","未注明(直觉)":"未注明(直觉)","直觉":"直觉","本体关系「":"本体关系「","」":"」","主张":"主张","预测":"预测","排除依据":"排除依据","采纳依据":"采纳依据","关联记录":"关联记录","支持 ":"支持 "," 条 · 推翻 ":" 条 · 推翻 "," 条 · 无法判定 ":" 条 · 无法判定 "," 条":" 条","在本体货架中展开此结论":"在本体货架中展开此结论","已得出结论 · 查看结论":"已得出结论 · 查看结论","已暂缓":"已暂缓","新发现,待您决定":"新发现,待您决定","尚无候选假设":"尚无候选假设","候选假设 ":"候选假设 "," 个:":" 个:","问题 ":"问题 ","候选假设":"候选假设","展开":"展开","已请求立为问题,待模型修订立题后生效。":"已请求立为问题,待模型修订立题后生效。","已请求暂缓,结案时列入「尚未确定的事项」。":"已请求暂缓,结案时列入「尚未确定的事项」。","无法自动发送,请在对话中说明。":"无法自动发送,请在对话中说明。","新发现的问题":"新发现的问题","请将新发现的问题「":"请将新发现的问题「","」立为问题深入研究(问题 ":"」立为问题深入研究(问题 ",")。":")。","立为问题":"立为问题","请暂缓问题「":"请暂缓问题「","」(问题 ":"」(问题 ","),结案时列入「尚未确定的事项」。":"),结案时列入「尚未确定的事项」。","暂缓":"暂缓","调研板块":"调研板块","判断 ":"判断 "," 条 · 已采纳 ":" 条 · 已采纳 ","未解释的现象 ":"未解释的现象 "," 项":" 项","下一步":"下一步","预测:":"预测:","若「":"若「","」成立,预测":"」成立,预测","各候选假设的预测相同,此步骤无法区分它们。":"各候选假设的预测相同,此步骤无法区分它们。","如需调整计划,请在对话中说明。":"如需调整计划,请在对话中说明。","未解释的现象(":"未解释的现象(","结案前须解释、排除或写入「尚未确定的事项」":"结案前须解释、排除或写入「尚未确定的事项」","独立评估发现":"独立评估发现","涉及:":"涉及:","、":"、","暂无内容。发送第一条消息后,此处将显示问题、候选假设与下一步。":"暂无内容。发送第一条消息后,此处将显示问题、候选假设与下一步。","尚未设立目标。模型立题后,此处将显示问题、候选假设与下一步。":"尚未设立目标。模型立题后,此处将显示问题、候选假设与下一步。","阶段 · ":"阶段 · ","调研板块 ":"调研板块 "," 个 · 已厘清 ":" 个 · 已厘清 "," 个":" 个","当前问题 ":"当前问题 "," / 共 ":" / 共 ","计划 已完成 ":"计划 已完成 "," / ":" / "," 步":" 步","独立评估 ":"独立评估 ","计划共 ":"计划共 ","(":"(","进行中)":"进行中)","课题":"课题","待您处理(":"待您处理(","过程记录":"过程记录","结论":"结论","未能回答:":"未能回答:","查看探索记录":"查看探索记录","尚未确定的事项":"尚未确定的事项","待您决策":"待您决策","不适用:":"不适用:","暂无计划。建立计划后,此处将显示计划的步骤与闸门。":"暂无计划。建立计划后,此处将显示计划的步骤与闸门。","切换到以前的计划(计划均保留,文档归档在 clear/goals/plans/)":"切换到以前的计划(计划均保留,文档归档在 clear/goals/plans/)","计划 ":"计划 ","已完成 · 可查看存档":"已完成 · 可查看存档","步 ":"步 ","打开计划文档(原生预览)":"打开计划文档(原生预览)","计划文档":"计划文档","点击查看详情":"点击查看详情","查看步骤详情":"查看步骤详情"," 轮":" 轮","已派出评估者 ":"已派出评估者 ","收起详情":"收起详情","任务内容":"任务内容","状态":"状态","未声明":"未声明","磁盘上未找到该文件":"磁盘上未找到该文件","(缺失)":"(缺失)","在原生预览中打开":"在原生预览中打开","在原生预览中打开(计划声明的产物)":"在原生预览中打开(计划声明的产物)","查看此步骤的证据":"查看此步骤的证据","检验结果:":"检验结果:","独立核验:":"独立核验:","正在裁决":"正在裁决"," 查看核验过程":" 查看核验过程"," 查看核验记录":" 查看核验记录","待处理":"待处理","板块 ":"板块 "," · ":" · "," 个问题待您决定":" 个问题待您决定"," · 待检验假设 ":" · 待检验假设 ","计划受阻,待人工处理":"计划受阻,待人工处理","计划已收尾(":"计划已收尾("," 步)":" 步)","计划已交付 ":"计划已交付 ","待处理 ":"待处理 ","(点击打开探索货架)":"(点击打开探索货架)","仅显示相关项":"仅显示相关项","关闭":"关闭","正在加载…":"正在加载…","无法获取":"无法获取","该项已不在当前词表中(可能已被废止)。":"该项已不在当前词表中(可能已被废止)。","释义":"释义","上位":"上位","下位":"下位","主体":"主体","类型":"类型","该术语已废止,既有结论中的用法仍可查看。":"该术语已废止,既有结论中的用法仍可查看。","引用此项的结论":"引用此项的结论","有矛盾":"有矛盾","范围:":"范围:","展开下一层":"展开下一层","收起下一层":"收起下一层","共 ":"共 "," 条断言的主体尚未建立实体文件。":" 条断言的主体尚未建立实体文件。","实体图暂无内容。":"实体图暂无内容。","clear/ontology/entities/ 下的实体文件与写入长期知识的断言将在此显示。":"clear/ontology/entities/ 下的实体文件与写入长期知识的断言将在此显示。","本体图暂无内容。模型在 clear/ontology/concepts/ 与 relations/ 下建立概念与关系文件后,将在此显示。":"本体图暂无内容。模型在 clear/ontology/concepts/ 与 relations/ 下建立概念与关系文件后,将在此显示。","本体图":"本体图","实体图":"实体图","矛盾":"矛盾","适配":"适配","退出全屏":"退出全屏","全屏":"全屏","图组件不可用":"图组件不可用","结论仍可正常查看。":"结论仍可正常查看。","本体文件有 ":"本体文件有 "," 项问题(不纳入图中)":" 项问题(不纳入图中)","已提出":"已提出","探索":"探索","本体":"本体","clearai-loop: 席位跟着会话预设进出":"clearai-loop: 席位跟着会话预设进出","适用":"适用","超出适用范围":"超出适用范围","超出取值范围":"超出取值范围","本次条件未声明":"本次条件未声明","条目未声明适用范围":"条目未声明适用范围","口径已变更":"口径已变更","已撤回":"已撤回","本次不能直接沿用,需重新检验":"本次不能直接沿用,需重新检验","补充本次条件后重新判定":"补充本次条件后重新判定","沿用时需自行确认":"沿用时需自行确认","按新口径换算或重新检验":"按新口径换算或重新检验","先复检再沿用":"先复检再沿用","不得沿用":"不得沿用","已确立":"已确立","初步排除":"初步排除","测量或方法缺陷":"测量或方法缺陷","已解释":"已解释","已判定无关":"已判定无关","已提交您处理":"已提交您处理","请求复检":"请求复检","请复检条目「":"请复检条目「","」(":"」(","请求撤回":"请求撤回","请撤回条目「":"请撤回条目「","),并说明对已有结论的影响。":"),并说明对已有结论的影响。","请求修改适用范围":"请求修改适用范围","请与我确认条目「":"请与我确认条目「",")的适用范围应如何修改。":")的适用范围应如何修改。","推翻证据 ":"推翻证据 "," · 独立核验 ":" · 独立核验 ","受质疑":"受质疑","已发送请求,由模型处理后更新。":"已发送请求,由模型处理后更新。","适用边界":"适用边界","测量与口径":"测量与口径","校准关系":"校准关系","未解释的现象":"未解释的现象","经验":"经验","该实体暂无沉淀的知识。":"该实体暂无沉淀的知识。","引用的已有知识(":"引用的已有知识(","引用的已有知识":"引用的已有知识","引用者:":"引用者:","将沉淀的内容":"将沉淀的内容","已写入的排除与未解释项;结案时待独立核验的结论":"已写入的排除与未解释项;结案时待独立核验的结论","待独立核验":"待独立核验","已确立 ":"已确立 ","已排除 ":"已排除 ","未解释 ":"未解释 ","经验 ":"经验 ","本次沉淀":"本次沉淀","点击查看可发出的请求":"点击查看可发出的请求","初步排除(":"初步排除(","测量或方法缺陷 ":"测量或方法缺陷 "}
|
|
189
|
-
const LOCALE_EN = {"待执行":"to do","已交付":"delivered","已作废":"voided","支持":"Support","推翻":"Refute","不确定":"Uncertain","第 n 步":"Step n","判据:":"Criterion: ","判据":"Criterion"," · 已修订 ":" · revised "," 次":" times"," · 最近一次修订的独立裁决:":" · latest revision decided by an independent verdict: ","打开目标文档(原生预览)":"Open the goal document (native preview)","全文在 ":"Full text at ","背景(不参与判定):":"Background (not part of the verdict): ","目标":"Goal","命题":"Propositions","计划":"Plan","验证":"Verification","观测":"Observation","评估":"Evaluation","证据":"Evidence","事实":"Facts","批准":"approval","未解释":"Unexplained","评估卡":"evaluation card","查看评估者":"view evaluator","审批记录":"approval record","产物":"Deliverables","已验证":"Verified","待核验":"Awaiting check","验证中":"Testing","已推翻":"Refuted","已替换":"Replaced","自行检验":"Self-tested","独立核验":"Independent check","人工批准":"Approved by a person","判断":"Judgment","检验":"Test","纳入本体":"In ontology","下一步:安排步骤对其进行检验":"Next: schedule a step to test it","下一步:通过独立核验后标记为已验证":"Next: marked Verified after an independent check","下一步:改用其他方法重新检验":"Next: test it again by another method","下一步:结案时写入长期知识":"Next: written to long-term knowledge at close","陈述":"Statement","数值":"Quantity","公式":"Formula","代码":"Code","引用":"Reference","概念":"concepts","取值形态":"Value form","实例":"Instances","取值":"Value","关系":"Relation","在检验阶段被推翻,不再推进。":"Refuted at the test stage; it goes no further.","已被替换,不再推进。":"Replaced; it goes no further.","提出":"Proposed","单步检验":"A single test",":":": ","写入长期知识":"Written to long-term knowledge","人工撤回":"Withdrawn by a person","进度":"Progress","可信度变化":"Trust history","补充说明":"Details","依据":"Basis","查看核验":"View check","查看记录":"View record","范围":"Scope","推翻条件":"Refuted if","相关":"Related","在图中定位":"Locate on the graph","来源":"Source","收起":"Collapse","点击查看进度与来源":"Click to view progress and source","暂无结论。模型提出判断后,将在此逐条列出。":"No judgments yet. Each judgment the model proposes is listed here.","尚未设立目标":"No goal set yet","暂无内容。发送第一条消息后,此处将显示本体图与结论。":"Nothing yet. After the first message, the ontology graph and conclusions appear here.","仅显示与「":"Showing only items related to \"","」相关的内容":"\"","清除":"Clear","已确立的事实":"ESTABLISHED FACTS","暂无已确立的事实。判断经检验与独立核验后,将在此列出;检验过程见探索货架。":"No established facts yet. Judgments appear here once tested and independently checked; the testing process is in the Explore shelf.","经验(":"LESSONS (",")":")","广度调研":"Broad survey","定向求解":"Targeted solving","先调研后求解":"Survey, then solve","考察中":"Being examined","已排除":"Excluded","已采纳":"Adopted","暂不考察":"Set aside","未开始":"Not started","调研中":"In progress","已厘清":"Clarified","常见误区":"Common pitfall","前置核查":"Check first","不可取的捷径":"Misleading shortcut","先验知识":"Prior knowledge","提出依据":"Proposed from","未注明(直觉)":"Not stated (intuition)","直觉":"Intuition","本体关系「":"Ontology relation \"","」":"\"","主张":"Claim","预测":"Prediction","排除依据":"Grounds for exclusion","采纳依据":"Grounds for adoption","关联记录":"Related records","支持 ":"Support "," 条 · 推翻 ":" · refute "," 条 · 无法判定 ":" · inconclusive "," 条":"","在本体货架中展开此结论":"Expand this conclusion in the Ontology shelf","已得出结论 · 查看结论":"Concluded · view the conclusion","已暂缓":"Parked","新发现,待您决定":"Newly found, awaiting your decision","尚无候选假设":"No candidate hypotheses yet","候选假设 ":"Candidate hypotheses: "," 个:":" — ","问题 ":"Question ","候选假设":"Candidate hypotheses","展开":"Expand","已请求立为问题,待模型修订立题后生效。":"Requested as a question; it takes effect once the model revises the framing.","已请求暂缓,结案时列入「尚未确定的事项」。":"Requested to park; it will be listed under open points at conclusion.","无法自动发送,请在对话中说明。":"Could not send automatically; please say it in the conversation.","新发现的问题":"Newly found question","请将新发现的问题「":"Please make the newly found question \"","」立为问题深入研究(问题 ":"\" a question to pursue (question ",")。":").","立为问题":"Make it a question","请暂缓问题「":"Please park the question \"","」(问题 ":"\" (question ","),结案时列入「尚未确定的事项」。":") and list it under open points at conclusion.","暂缓":"Park","调研板块":"Survey areas","判断 ":"Judgments: "," 条 · 已采纳 ":" · adopted ","未解释的现象 ":"Unexplained observations: "," 项":"","下一步":"Next step","预测:":"Prediction: ","若「":"If \"","」成立,预测":"\" holds, the prediction is","各候选假设的预测相同,此步骤无法区分它们。":"All candidate hypotheses predict the same result, so this step cannot tell them apart.","如需调整计划,请在对话中说明。":"To change the plan, say so in the conversation.","未解释的现象(":"Unexplained observations (","结案前须解释、排除或写入「尚未确定的事项」":"Before concluding, each must be explained, ruled out, or written into the open points","独立评估发现":"Found by the independent evaluator","涉及:":"Concerns: ","、":", ","暂无内容。发送第一条消息后,此处将显示问题、候选假设与下一步。":"Nothing yet. After the first message, questions, candidate hypotheses and the next step appear here.","尚未设立目标。模型立题后,此处将显示问题、候选假设与下一步。":"No goal set yet. Once the model frames the goal, questions, candidate hypotheses and the next step appear here.","阶段 · ":"Mode · ","调研板块 ":"Survey areas: "," 个 · 已厘清 ":" · clarified "," 个":"","当前问题 ":"Current question "," / 共 ":" of ","计划 已完成 ":"Plan: completed "," / ":" / "," 步":" steps","独立评估 ":"Independent evaluations: ","计划共 ":"Plan: ","(":" (","进行中)":" in progress)","课题":"Topic","待您处理(":"Awaiting you (","过程记录":"Process record","结论":"Conclusion","未能回答:":"Could not be answered: ","查看探索记录":"View the exploration record","尚未确定的事项":"Open points","待您决策":"For you to decide","不适用:":"Does not apply: ","暂无计划。建立计划后,此处将显示计划的步骤与闸门。":"No plan yet. Once a plan is created, its steps and gates appear here.","切换到以前的计划(计划均保留,文档归档在 clear/goals/plans/)":"Switch to an earlier plan (all plans are kept; documents are archived under clear/goals/plans/)","计划 ":"Plan ","已完成 · 可查看存档":"closed · archive available","步 ":"step ","打开计划文档(原生预览)":"Open the plan document (native preview)","计划文档":"Plan document","点击查看详情":"click for details","查看步骤详情":"view step details"," 轮":" rounds","已派出评估者 ":"Evaluators dispatched: ","收起详情":"Collapse details","任务内容":"Task","状态":"Status","未声明":"not declared","磁盘上未找到该文件":"this file was not found on disk","(缺失)":" (missing)","在原生预览中打开":"Open in the native preview","在原生预览中打开(计划声明的产物)":"Open in the native preview (an artifact declared by the plan)","查看此步骤的证据":"see the evidence for this step","检验结果:":"Result: ","独立核验:":"Independent check: ","正在裁决":"Deciding"," 查看核验过程":" View the review"," 查看核验记录":" View the review record","待处理":"To handle","板块 ":"Areas "," · ":" · "," 个问题待您决定":" question(s) awaiting your decision"," · 待检验假设 ":" · hypotheses to test: ","计划受阻,待人工处理":"plan blocked, awaiting a person","计划已收尾(":"Plan closed ("," 步)":" steps)","计划已交付 ":"Plan delivered ","待处理 ":"to handle ","(点击打开探索货架)":" (click to open the Explore shelf)","仅显示相关项":"Related only","关闭":"Close","正在加载…":"Loading…","无法获取":"Unavailable","该项已不在当前词表中(可能已被废止)。":"This item is no longer in the vocabulary (it may have been deprecated).","释义":"Gloss","上位":"Broader","下位":"Narrower","主体":"Subject","类型":"Type","该术语已废止,既有结论中的用法仍可查看。":"This term is deprecated; its use in existing conclusions remains readable.","引用此项的结论":"Conclusions citing it","有矛盾":"Conflicting","范围:":"Scope: ","展开下一层":"Expand the next level","收起下一层":"Collapse the next level","共 ":""," 条断言的主体尚未建立实体文件。":" assertion subjects have no entity file yet. ","实体图暂无内容。":"The entity graph is empty. ","clear/ontology/entities/ 下的实体文件与写入长期知识的断言将在此显示。":"Entity files under clear/ontology/entities/ and assertions in long-term knowledge appear here.","本体图暂无内容。模型在 clear/ontology/concepts/ 与 relations/ 下建立概念与关系文件后,将在此显示。":"The ontology graph is empty. Concepts and relations appear once the model creates files under clear/ontology/concepts/ and relations/.","本体图":"Ontology graph","实体图":"Entity graph","矛盾":"Conflicts","适配":"Fit","退出全屏":"Exit full screen","全屏":"Full screen","图组件不可用":"The graph component is unavailable","结论仍可正常查看。":"conclusions remain readable.","本体文件有 ":"Ontology files have "," 项问题(不纳入图中)":" problems (kept off the graph)","已提出":"proposed","探索":"Explore","本体":"Ontology","clearai-loop: 席位跟着会话预设进出":"clearai-loop: seats come and go with the session's preset","适用":"Applies","超出适用范围":"Outside its scope","超出取值范围":"Outside its value range","本次条件未声明":"Conditions of this run not declared","条目未声明适用范围":"Item declares no scope","口径已变更":"Definition changed","已撤回":"Retracted","本次不能直接沿用,需重新检验":"Cannot be reused as is here; test it again","补充本次条件后重新判定":"Declare this run's conditions, then judge again","沿用时需自行确认":"Confirm it applies before reusing it","按新口径换算或重新检验":"Convert to the new definition or test it again","先复检再沿用":"Re-check it before reusing it","不得沿用":"Must not be reused","已确立":"Established","初步排除":"Preliminarily excluded","测量或方法缺陷":"Measurement or method defect","已解释":"Explained","已判定无关":"Ruled irrelevant","已提交您处理":"Handed to you","请求复检":"Request a re-check","请复检条目「":"Please re-check the item \"","」(":"\" (","请求撤回":"Request retraction","请撤回条目「":"Please retract the item \"","),并说明对已有结论的影响。":") and state the effect on existing conclusions.","请求修改适用范围":"Request a scope change","请与我确认条目「":"Please confirm with me how the scope of the item \"",")的适用范围应如何修改。":") should be changed.","推翻证据 ":"Refuting evidence: "," · 独立核验 ":" · independently checked: ","受质疑":"Challenged","已发送请求,由模型处理后更新。":"Request sent; it updates once the model handles it.","适用边界":"Limits of applicability","测量与口径":"Measurement and definitions","校准关系":"Calibration","未解释的现象":"Unexplained observations","经验":"Lessons","该实体暂无沉淀的知识。":"No knowledge has been recorded for this entity yet.","引用的已有知识(":"Existing knowledge cited (","引用的已有知识":"Existing knowledge cited","引用者:":"Cited by: ","将沉淀的内容":"To be recorded","已写入的排除与未解释项;结案时待独立核验的结论":"Exclusions and unexplained items already written; conclusions awaiting an independent check at close","待独立核验":"Awaiting independent check","已确立 ":"Established: ","已排除 ":"Excluded: ","未解释 ":"Unexplained: ","经验 ":"Lessons: ","本次沉淀":"Recorded this time","点击查看可发出的请求":"Click to see the requests you can send","初步排除(":"Preliminarily excluded (","测量或方法缺陷 ":"Measurement or method defects: "}
|
|
188
|
+
const LOCALE_ZH = {"待执行":"待执行","已交付":"已交付","已作废":"已作废","支持":"支持","推翻":"推翻","不确定":"不确定","第 n 步":"第 n 步","判据:":"判据:","判据":"判据"," · 已修订 ":" · 已修订 "," 次":" 次"," · 最近一次修订的独立裁决:":" · 最近一次修订的独立裁决:","打开目标文档(原生预览)":"打开目标文档(原生预览)","全文在 ":"全文在 ","背景(不参与判定):":"背景(不参与判定):","目标":"目标","命题":"命题","计划":"计划","验证":"验证","观测":"观测","评估":"评估","证据":"证据","事实":"事实","批准":"批准","未解释":"未解释","评估卡":"评估卡","查看评估者":"查看评估者","审批记录":"审批记录","产物":"产物","已验证":"已验证","待核验":"待核验","验证中":"验证中","已推翻":"已推翻","已替换":"已替换","自行检验":"自行检验","独立核验":"独立核验","人工批准":"人工批准","判断":"判断","检验":"检验","纳入本体":"纳入本体","下一步:安排步骤对其进行检验":"下一步:安排步骤对其进行检验","下一步:通过独立核验后标记为已验证":"下一步:通过独立核验后标记为已验证","下一步:改用其他方法重新检验":"下一步:改用其他方法重新检验","下一步:结案时写入长期知识":"下一步:结案时写入长期知识","陈述":"陈述","数值":"数值","公式":"公式","代码":"代码","引用":"引用","概念":"概念","取值形态":"取值形态","实例":"实例","取值":"取值","关系":"关系","在检验阶段被推翻,不再推进。":"在检验阶段被推翻,不再推进。","已被替换,不再推进。":"已被替换,不再推进。","提出":"提出","单步检验":"单步检验",":":":","写入长期知识":"写入长期知识","人工撤回":"人工撤回","进度":"进度","可信度变化":"可信度变化","补充说明":"补充说明","依据":"依据","查看核验":"查看核验","查看记录":"查看记录","范围":"范围","推翻条件":"推翻条件","相关":"相关","在图中定位":"在图中定位","来源":"来源","收起":"收起","点击查看进度与来源":"点击查看进度与来源","暂无结论。模型提出判断后,将在此逐条列出。":"暂无结论。模型提出判断后,将在此逐条列出。","尚未设立目标":"尚未设立目标","暂无内容。发送第一条消息后,此处将显示本体图与结论。":"暂无内容。发送第一条消息后,此处将显示本体图与结论。","仅显示与「":"仅显示与「","」相关的内容":"」相关的内容","清除":"清除","已确立的事实":"已确立的事实","暂无已确立的事实。判断经检验与独立核验后,将在此列出;检验过程见探索货架。":"暂无已确立的事实。判断经检验与独立核验后,将在此列出;检验过程见探索货架。","经验(":"经验(",")":")","广度调研":"广度调研","定向求解":"定向求解","先调研后求解":"先调研后求解","考察中":"考察中","已排除":"已排除","已采纳":"已采纳","暂不考察":"暂不考察","未开始":"未开始","调研中":"调研中","已厘清":"已厘清","常见误区":"常见误区","前置核查":"前置核查","不可取的捷径":"不可取的捷径","先验知识":"先验知识","提出依据":"提出依据","未注明(直觉)":"未注明(直觉)","直觉":"直觉","本体关系「":"本体关系「","」":"」","主张":"主张","预测":"预测","排除依据":"排除依据","采纳依据":"采纳依据","关联记录":"关联记录","支持 ":"支持 "," 条 · 推翻 ":" 条 · 推翻 "," 条 · 无法判定 ":" 条 · 无法判定 "," 条":" 条","在本体货架中展开此结论":"在本体货架中展开此结论","已得出结论 · 查看结论":"已得出结论 · 查看结论","已暂缓":"已暂缓","新发现,待您决定":"新发现,待您决定","尚无候选假设":"尚无候选假设","候选假设 ":"候选假设 "," 个:":" 个:","问题 ":"问题 ","候选假设":"候选假设","展开":"展开","已请求立为问题,待模型修订立题后生效。":"已请求立为问题,待模型修订立题后生效。","已请求暂缓,结案时列入「尚未确定的事项」。":"已请求暂缓,结案时列入「尚未确定的事项」。","无法自动发送,请在对话中说明。":"无法自动发送,请在对话中说明。","新发现的问题":"新发现的问题","请将新发现的问题「":"请将新发现的问题「","」立为问题深入研究(问题 ":"」立为问题深入研究(问题 ",")。":")。","立为问题":"立为问题","请暂缓问题「":"请暂缓问题「","」(问题 ":"」(问题 ","),结案时列入「尚未确定的事项」。":"),结案时列入「尚未确定的事项」。","暂缓":"暂缓","调研板块":"调研板块","判断 ":"判断 "," 条 · 已采纳 ":" 条 · 已采纳 ","未解释的现象 ":"未解释的现象 "," 项":" 项","下一步":"下一步","预测:":"预测:","若「":"若「","」成立,预测":"」成立,预测","各候选假设的预测相同,此步骤无法区分它们。":"各候选假设的预测相同,此步骤无法区分它们。","如需调整计划,请在对话中说明。":"如需调整计划,请在对话中说明。","未解释的现象(":"未解释的现象(","结案前须解释、排除或写入「尚未确定的事项」":"结案前须解释、排除或写入「尚未确定的事项」","独立评估发现":"独立评估发现","涉及:":"涉及:","、":"、","暂无内容。发送第一条消息后,此处将显示问题、候选假设与下一步。":"暂无内容。发送第一条消息后,此处将显示问题、候选假设与下一步。","尚未设立目标。模型立题后,此处将显示问题、候选假设与下一步。":"尚未设立目标。模型立题后,此处将显示问题、候选假设与下一步。","阶段 · ":"阶段 · ","调研板块 ":"调研板块 "," 个 · 已厘清 ":" 个 · 已厘清 "," 个":" 个","当前问题 ":"当前问题 "," / 共 ":" / 共 ","计划 已完成 ":"计划 已完成 "," / ":" / "," 步":" 步","独立评估 ":"独立评估 ","计划共 ":"计划共 ","(":"(","进行中)":"进行中)","课题":"课题","待您处理(":"待您处理(","过程记录":"过程记录","结论":"结论","未能回答:":"未能回答:","查看探索记录":"查看探索记录","尚未确定的事项":"尚未确定的事项","待您决策":"待您决策","不适用:":"不适用:","暂无计划。建立计划后,此处将显示计划的步骤与闸门。":"暂无计划。建立计划后,此处将显示计划的步骤与闸门。","切换到以前的计划(计划均保留,文档归档在 clear/goals/plans/)":"切换到以前的计划(计划均保留,文档归档在 clear/goals/plans/)","计划 ":"计划 ","已完成 · 可查看存档":"已完成 · 可查看存档","步 ":"步 ","打开计划文档(原生预览)":"打开计划文档(原生预览)","计划文档":"计划文档","点击查看详情":"点击查看详情","查看步骤详情":"查看步骤详情"," 轮":" 轮","已派出评估者 ":"已派出评估者 ","收起详情":"收起详情","任务内容":"任务内容","状态":"状态","未声明":"未声明","磁盘上未找到该文件":"磁盘上未找到该文件","(缺失)":"(缺失)","在原生预览中打开":"在原生预览中打开","在原生预览中打开(计划声明的产物)":"在原生预览中打开(计划声明的产物)","查看此步骤的证据":"查看此步骤的证据","检验结果:":"检验结果:","独立核验:":"独立核验:","正在裁决":"正在裁决"," 查看核验过程":" 查看核验过程"," 查看核验记录":" 查看核验记录","待处理":"待处理","板块 ":"板块 "," · ":" · "," 个问题待您决定":" 个问题待您决定"," · 待检验假设 ":" · 待检验假设 ","计划受阻,待人工处理":"计划受阻,待人工处理","计划已收尾(":"计划已收尾("," 步)":" 步)","计划已交付 ":"计划已交付 ","待处理 ":"待处理 ","(点击打开探索货架)":"(点击打开探索货架)","仅显示相关项":"仅显示相关项","关闭":"关闭","正在加载…":"正在加载…","无法获取":"无法获取","该项已不在当前词表中(可能已被废止)。":"该项已不在当前词表中(可能已被废止)。","释义":"释义","上位":"上位","下位":"下位","主体":"主体","类型":"类型","该术语已废止,既有结论中的用法仍可查看。":"该术语已废止,既有结论中的用法仍可查看。","引用此项的结论":"引用此项的结论","有矛盾":"有矛盾","范围:":"范围:","展开下一层":"展开下一层","收起下一层":"收起下一层","共 ":"共 "," 条断言的主体尚未建立实体文件。":" 条断言的主体尚未建立实体文件。","实体图暂无内容。":"实体图暂无内容。","clear/ontology/entities/ 下的实体文件与写入长期知识的断言将在此显示。":"clear/ontology/entities/ 下的实体文件与写入长期知识的断言将在此显示。","本体图暂无内容。模型在 clear/ontology/concepts/ 与 relations/ 下建立概念与关系文件后,将在此显示。":"本体图暂无内容。模型在 clear/ontology/concepts/ 与 relations/ 下建立概念与关系文件后,将在此显示。","本体图":"本体图","实体图":"实体图","矛盾":"矛盾","适配":"适配","退出全屏":"退出全屏","全屏":"全屏","图组件不可用":"图组件不可用","结论仍可正常查看。":"结论仍可正常查看。","本体文件有 ":"本体文件有 "," 项问题(不纳入图中)":" 项问题(不纳入图中)","已提出":"已提出","探索":"探索","本体":"本体","clearai-loop: 席位跟着会话预设进出":"clearai-loop: 席位跟着会话预设进出","适用":"适用","超出适用范围":"超出适用范围","超出取值范围":"超出取值范围","本次条件未声明":"本次条件未声明","条目未声明适用范围":"条目未声明适用范围","口径已变更":"口径已变更","已撤回":"已撤回","本次不能直接沿用,需重新检验":"本次不能直接沿用,需重新检验","补充本次条件后重新判定":"补充本次条件后重新判定","沿用时需自行确认":"沿用时需自行确认","按新口径换算或重新检验":"按新口径换算或重新检验","先复检再沿用":"先复检再沿用","不得沿用":"不得沿用","已确立":"已确立","初步排除":"初步排除","测量或方法缺陷":"测量或方法缺陷","已解释":"已解释","已判定无关":"已判定无关","已提交您处理":"已提交您处理","请求复检":"请求复检","请复检条目「":"请复检条目「","」(":"」(","请求撤回":"请求撤回","请撤回条目「":"请撤回条目「","),并说明对已有结论的影响。":"),并说明对已有结论的影响。","请求修改适用范围":"请求修改适用范围","请与我确认条目「":"请与我确认条目「",")的适用范围应如何修改。":")的适用范围应如何修改。","推翻证据 ":"推翻证据 "," · 独立核验 ":" · 独立核验 ","受质疑":"受质疑","已发送请求,由模型处理后更新。":"已发送请求,由模型处理后更新。","适用边界":"适用边界","测量与口径":"测量与口径","校准关系":"校准关系","未解释的现象":"未解释的现象","经验":"经验","该实体暂无沉淀的知识。":"该实体暂无沉淀的知识。","引用的已有知识(":"引用的已有知识(","引用的已有知识":"引用的已有知识","引用者:":"引用者:","将沉淀的内容":"将沉淀的内容","已写入的排除与未解释项;结案时待独立核验的结论":"已写入的排除与未解释项;结案时待独立核验的结论","待独立核验":"待独立核验","已确立 ":"已确立 ","已排除 ":"已排除 ","未解释 ":"未解释 ","经验 ":"经验 ","本次沉淀":"本次沉淀","点击查看可发出的请求":"点击查看可发出的请求","初步排除(":"初步排除(","测量或方法缺陷 ":"测量或方法缺陷 ","研究":"研究","研究工作台":"研究工作台","知识地图":"知识地图","从问题到证据,逐步推进。":"从问题到证据,逐步推进。","连接概念,理解已形成的知识。":"连接概念,理解已形成的知识。","概念与关系定义,不代表事实已验证。":"概念与关系定义,不代表事实已验证。","对象与断言,核验状态以证据记录为准。":"对象与断言,核验状态以证据记录为准。","结构定义":"结构定义","层级关系":"层级关系","搜索名称或标识…":"搜索名称或标识…","搜索图谱":"搜索图谱","图谱":"图谱","列表":"列表","邻域":"邻域","聚焦所选":"聚焦所选","恢复视图":"恢复视图","概览":"概览","没有匹配的对象":"没有匹配的对象","选择对象查看定义、关系与证据。":"选择对象查看定义、关系与证据。","拖动平移 · 滚轮缩放":"拖动平移 · 滚轮缩放","可读视图":"可读视图","个对象":"个对象","条连接":"条连接","图谱目录":"图谱目录","打开对象详情":"打开对象详情","在图中打开":"在图中打开","知识概览":"知识概览","研究进展":"研究进展","当前焦点":"当前焦点","相关连接":"相关连接","按 Enter 或空格查看详情,方向键移动节点。":"按 Enter 或空格查看详情,方向键移动节点。","按 Enter 或空格查看关系详情。":"按 Enter 或空格查看关系详情。","缩小":"缩小","放大":"放大","对象":"对象","知识文件需要复核":"知识文件需要复核","以下文件未登记或内容已变化,暂不作为可信知识使用。":"以下文件未登记或内容已变化,暂不作为可信知识使用。","复跑不可用":"复跑不可用","复跑副本未能建立;相关裁决不能据此通过。":"复跑副本未能建立;相关裁决不能据此通过。"}
|
|
189
|
+
const LOCALE_EN = {"待执行":"to do","已交付":"delivered","已作废":"voided","支持":"Support","推翻":"Refute","不确定":"Uncertain","第 n 步":"Step n","判据:":"Criterion: ","判据":"Criterion"," · 已修订 ":" · revised "," 次":" times"," · 最近一次修订的独立裁决:":" · latest revision decided by an independent verdict: ","打开目标文档(原生预览)":"Open the goal document (native preview)","全文在 ":"Full text at ","背景(不参与判定):":"Background (not part of the verdict): ","目标":"Goal","命题":"Propositions","计划":"Plan","验证":"Verification","观测":"Observation","评估":"Evaluation","证据":"Evidence","事实":"Facts","批准":"approval","未解释":"Unexplained","评估卡":"evaluation card","查看评估者":"view evaluator","审批记录":"approval record","产物":"Deliverables","已验证":"Verified","待核验":"Awaiting check","验证中":"Testing","已推翻":"Refuted","已替换":"Replaced","自行检验":"Self-tested","独立核验":"Independent check","人工批准":"Approved by a person","判断":"Judgment","检验":"Test","纳入本体":"In ontology","下一步:安排步骤对其进行检验":"Next: schedule a step to test it","下一步:通过独立核验后标记为已验证":"Next: marked Verified after an independent check","下一步:改用其他方法重新检验":"Next: test it again by another method","下一步:结案时写入长期知识":"Next: written to long-term knowledge at close","陈述":"Statement","数值":"Quantity","公式":"Formula","代码":"Code","引用":"Reference","概念":"concepts","取值形态":"Value form","实例":"Instances","取值":"Value","关系":"Relation","在检验阶段被推翻,不再推进。":"Refuted at the test stage; it goes no further.","已被替换,不再推进。":"Replaced; it goes no further.","提出":"Proposed","单步检验":"A single test",":":": ","写入长期知识":"Written to long-term knowledge","人工撤回":"Withdrawn by a person","进度":"Progress","可信度变化":"Trust history","补充说明":"Details","依据":"Basis","查看核验":"View check","查看记录":"View record","范围":"Scope","推翻条件":"Refuted if","相关":"Related","在图中定位":"Locate on the graph","来源":"Source","收起":"Collapse","点击查看进度与来源":"Click to view progress and source","暂无结论。模型提出判断后,将在此逐条列出。":"No judgments yet. Each judgment the model proposes is listed here.","尚未设立目标":"No goal set yet","暂无内容。发送第一条消息后,此处将显示本体图与结论。":"Nothing yet. After the first message, the ontology graph and conclusions appear here.","仅显示与「":"Showing only items related to \"","」相关的内容":"\"","清除":"Clear","已确立的事实":"ESTABLISHED FACTS","暂无已确立的事实。判断经检验与独立核验后,将在此列出;检验过程见探索货架。":"No established facts yet. Judgments appear here once tested and independently checked; the testing process is in the Explore shelf.","经验(":"LESSONS (",")":")","广度调研":"Broad survey","定向求解":"Targeted solving","先调研后求解":"Survey, then solve","考察中":"Being examined","已排除":"Excluded","已采纳":"Adopted","暂不考察":"Set aside","未开始":"Not started","调研中":"In progress","已厘清":"Clarified","常见误区":"Common pitfall","前置核查":"Check first","不可取的捷径":"Misleading shortcut","先验知识":"Prior knowledge","提出依据":"Proposed from","未注明(直觉)":"Not stated (intuition)","直觉":"Intuition","本体关系「":"Ontology relation \"","」":"\"","主张":"Claim","预测":"Prediction","排除依据":"Grounds for exclusion","采纳依据":"Grounds for adoption","关联记录":"Related records","支持 ":"Support "," 条 · 推翻 ":" · refute "," 条 · 无法判定 ":" · inconclusive "," 条":"","在本体货架中展开此结论":"Expand this conclusion in the Ontology shelf","已得出结论 · 查看结论":"Concluded · view the conclusion","已暂缓":"Parked","新发现,待您决定":"Newly found, awaiting your decision","尚无候选假设":"No candidate hypotheses yet","候选假设 ":"Candidate hypotheses: "," 个:":" — ","问题 ":"Question ","候选假设":"Candidate hypotheses","展开":"Expand","已请求立为问题,待模型修订立题后生效。":"Requested as a question; it takes effect once the model revises the framing.","已请求暂缓,结案时列入「尚未确定的事项」。":"Requested to park; it will be listed under open points at conclusion.","无法自动发送,请在对话中说明。":"Could not send automatically; please say it in the conversation.","新发现的问题":"Newly found question","请将新发现的问题「":"Please make the newly found question \"","」立为问题深入研究(问题 ":"\" a question to pursue (question ",")。":").","立为问题":"Make it a question","请暂缓问题「":"Please park the question \"","」(问题 ":"\" (question ","),结案时列入「尚未确定的事项」。":") and list it under open points at conclusion.","暂缓":"Park","调研板块":"Survey areas","判断 ":"Judgments: "," 条 · 已采纳 ":" · adopted ","未解释的现象 ":"Unexplained observations: "," 项":"","下一步":"Next step","预测:":"Prediction: ","若「":"If \"","」成立,预测":"\" holds, the prediction is","各候选假设的预测相同,此步骤无法区分它们。":"All candidate hypotheses predict the same result, so this step cannot tell them apart.","如需调整计划,请在对话中说明。":"To change the plan, say so in the conversation.","未解释的现象(":"Unexplained observations (","结案前须解释、排除或写入「尚未确定的事项」":"Before concluding, each must be explained, ruled out, or written into the open points","独立评估发现":"Found by the independent evaluator","涉及:":"Concerns: ","、":", ","暂无内容。发送第一条消息后,此处将显示问题、候选假设与下一步。":"Nothing yet. After the first message, questions, candidate hypotheses and the next step appear here.","尚未设立目标。模型立题后,此处将显示问题、候选假设与下一步。":"No goal set yet. Once the model frames the goal, questions, candidate hypotheses and the next step appear here.","阶段 · ":"Mode · ","调研板块 ":"Survey areas: "," 个 · 已厘清 ":" · clarified "," 个":"","当前问题 ":"Current question "," / 共 ":" of ","计划 已完成 ":"Plan: completed "," / ":" / "," 步":" steps","独立评估 ":"Independent evaluations: ","计划共 ":"Plan: ","(":" (","进行中)":" in progress)","课题":"Topic","待您处理(":"Awaiting you (","过程记录":"Process record","结论":"Conclusion","未能回答:":"Could not be answered: ","查看探索记录":"View the exploration record","尚未确定的事项":"Open points","待您决策":"For you to decide","不适用:":"Does not apply: ","暂无计划。建立计划后,此处将显示计划的步骤与闸门。":"No plan yet. Once a plan is created, its steps and gates appear here.","切换到以前的计划(计划均保留,文档归档在 clear/goals/plans/)":"Switch to an earlier plan (all plans are kept; documents are archived under clear/goals/plans/)","计划 ":"Plan ","已完成 · 可查看存档":"closed · archive available","步 ":"step ","打开计划文档(原生预览)":"Open the plan document (native preview)","计划文档":"Plan document","点击查看详情":"click for details","查看步骤详情":"view step details"," 轮":" rounds","已派出评估者 ":"Evaluators dispatched: ","收起详情":"Collapse details","任务内容":"Task","状态":"Status","未声明":"not declared","磁盘上未找到该文件":"this file was not found on disk","(缺失)":" (missing)","在原生预览中打开":"Open in the native preview","在原生预览中打开(计划声明的产物)":"Open in the native preview (an artifact declared by the plan)","查看此步骤的证据":"see the evidence for this step","检验结果:":"Result: ","独立核验:":"Independent check: ","正在裁决":"Deciding"," 查看核验过程":" View the review"," 查看核验记录":" View the review record","待处理":"To handle","板块 ":"Areas "," · ":" · "," 个问题待您决定":" question(s) awaiting your decision"," · 待检验假设 ":" · hypotheses to test: ","计划受阻,待人工处理":"plan blocked, awaiting a person","计划已收尾(":"Plan closed ("," 步)":" steps)","计划已交付 ":"Plan delivered ","待处理 ":"to handle ","(点击打开探索货架)":" (click to open the Explore shelf)","仅显示相关项":"Related only","关闭":"Close","正在加载…":"Loading…","无法获取":"Unavailable","该项已不在当前词表中(可能已被废止)。":"This item is no longer in the vocabulary (it may have been deprecated).","释义":"Gloss","上位":"Broader","下位":"Narrower","主体":"Subject","类型":"Type","该术语已废止,既有结论中的用法仍可查看。":"This term is deprecated; its use in existing conclusions remains readable.","引用此项的结论":"Conclusions citing it","有矛盾":"Conflicting","范围:":"Scope: ","展开下一层":"Expand the next level","收起下一层":"Collapse the next level","共 ":""," 条断言的主体尚未建立实体文件。":" assertion subjects have no entity file yet. ","实体图暂无内容。":"The entity graph is empty. ","clear/ontology/entities/ 下的实体文件与写入长期知识的断言将在此显示。":"Entity files under clear/ontology/entities/ and assertions in long-term knowledge appear here.","本体图暂无内容。模型在 clear/ontology/concepts/ 与 relations/ 下建立概念与关系文件后,将在此显示。":"The ontology graph is empty. Concepts and relations appear once the model creates files under clear/ontology/concepts/ and relations/.","本体图":"Ontology graph","实体图":"Entity graph","矛盾":"Conflicts","适配":"Fit","退出全屏":"Exit full screen","全屏":"Full screen","图组件不可用":"The graph component is unavailable","结论仍可正常查看。":"conclusions remain readable.","本体文件有 ":"Ontology files have "," 项问题(不纳入图中)":" problems (kept off the graph)","已提出":"proposed","探索":"Explore","本体":"Ontology","clearai-loop: 席位跟着会话预设进出":"clearai-loop: seats come and go with the session's preset","适用":"Applies","超出适用范围":"Outside its scope","超出取值范围":"Outside its value range","本次条件未声明":"Conditions of this run not declared","条目未声明适用范围":"Item declares no scope","口径已变更":"Definition changed","已撤回":"Retracted","本次不能直接沿用,需重新检验":"Cannot be reused as is here; test it again","补充本次条件后重新判定":"Declare this run's conditions, then judge again","沿用时需自行确认":"Confirm it applies before reusing it","按新口径换算或重新检验":"Convert to the new definition or test it again","先复检再沿用":"Re-check it before reusing it","不得沿用":"Must not be reused","已确立":"Established","初步排除":"Preliminarily excluded","测量或方法缺陷":"Measurement or method defect","已解释":"Explained","已判定无关":"Ruled irrelevant","已提交您处理":"Handed to you","请求复检":"Request a re-check","请复检条目「":"Please re-check the item \"","」(":"\" (","请求撤回":"Request retraction","请撤回条目「":"Please retract the item \"","),并说明对已有结论的影响。":") and state the effect on existing conclusions.","请求修改适用范围":"Request a scope change","请与我确认条目「":"Please confirm with me how the scope of the item \"",")的适用范围应如何修改。":") should be changed.","推翻证据 ":"Refuting evidence: "," · 独立核验 ":" · independently checked: ","受质疑":"Challenged","已发送请求,由模型处理后更新。":"Request sent; it updates once the model handles it.","适用边界":"Limits of applicability","测量与口径":"Measurement and definitions","校准关系":"Calibration","未解释的现象":"Unexplained observations","经验":"Lessons","该实体暂无沉淀的知识。":"No knowledge has been recorded for this entity yet.","引用的已有知识(":"Existing knowledge cited (","引用的已有知识":"Existing knowledge cited","引用者:":"Cited by: ","将沉淀的内容":"To be recorded","已写入的排除与未解释项;结案时待独立核验的结论":"Exclusions and unexplained items already written; conclusions awaiting an independent check at close","待独立核验":"Awaiting independent check","已确立 ":"Established: ","已排除 ":"Excluded: ","未解释 ":"Unexplained: ","经验 ":"Lessons: ","本次沉淀":"Recorded this time","点击查看可发出的请求":"Click to see the requests you can send","初步排除(":"Preliminarily excluded (","测量或方法缺陷 ":"Measurement or method defects: ","研究":"Research","研究工作台":"Research workspace","知识地图":"Knowledge map","从问题到证据,逐步推进。":"Follow the question. Build the evidence.","连接概念,理解已形成的知识。":"Connect concepts. Explore what is known.","概念与关系定义,不代表事实已验证。":"Concepts and relation definitions; not verified facts.","对象与断言,核验状态以证据记录为准。":"Objects and assertions, with evidence-based review status.","结构定义":"Definition","层级关系":"Hierarchy","搜索名称或标识…":"Search names or IDs…","搜索图谱":"Search the graph","图谱":"Graph","列表":"List","邻域":"Neighborhood","聚焦所选":"Focus selection","恢复视图":"Reset view","概览":"Overview","没有匹配的对象":"No matching objects","选择对象查看定义、关系与证据。":"Select an object to inspect its definition, relationships and evidence.","拖动平移 · 滚轮缩放":"Drag to pan · Scroll to zoom","可读视图":"Readable view","个对象":"objects","条连接":"connections","图谱目录":"Graph directory","打开对象详情":"Open object details","在图中打开":"Open in graph","知识概览":"Knowledge overview","研究进展":"Research progress","当前焦点":"Current focus","相关连接":"Related connections","按 Enter 或空格查看详情,方向键移动节点。":"Press Enter or Space for details. Use arrow keys to move the node.","按 Enter 或空格查看关系详情。":"Press Enter or Space for relationship details.","缩小":"Zoom out","放大":"Zoom in","对象":"Object","知识文件需要复核":"Knowledge files need review","以下文件未登记或内容已变化,暂不作为可信知识使用。":"These files are unregistered or changed and are excluded from trusted knowledge.","复跑不可用":"Re-run unavailable","复跑副本未能建立;相关裁决不能据此通过。":"The re-run copy could not be created; affected criteria cannot pass on this basis."}
|
|
190
190
|
|
|
191
191
|
/**
|
|
192
192
|
* 翻译函数:**由原生 locale 座位绑定**(`ctx.locale.bind`),不是我们自建的一套 i18n。
|
|
@@ -255,7 +255,7 @@ window.__ModuleLoader__.load({
|
|
|
255
255
|
* 颜色**只用主题令牌**,不写死色值——深色/浅色跟着宿主走。
|
|
256
256
|
*/
|
|
257
257
|
const CSS = `
|
|
258
|
-
.clearai-btn{box-sizing:border-box;display:inline-flex;align-items:center;gap:4px;height:26px;
|
|
258
|
+
.clearai-btn{box-sizing:border-box;display:inline-flex;align-items:center;gap:4px;height:26px;line-height:18px;white-space:nowrap}
|
|
259
259
|
.clearai-btn:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}
|
|
260
260
|
.clearai-btn:disabled{color:var(--dsw-alias-label-secondary);opacity:.5;cursor:default}
|
|
261
261
|
.clearai-btn[data-tone="warn"]{border-color:var(--dsw-alias-state-warn-primary)}
|
|
@@ -265,8 +265,8 @@ window.__ModuleLoader__.load({
|
|
|
265
265
|
.clearai-chip:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}
|
|
266
266
|
.clearai-tag{display:inline-block;padding:0 6px;border:.5px solid var(--dsw-alias-border-l3);border-radius:999px;color:var(--dsw-alias-label-secondary);font-size:11px;line-height:16px;white-space:nowrap}
|
|
267
267
|
.clearai-tag[data-strong="1"]{color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-primary)}
|
|
268
|
-
.clearai-link{
|
|
269
|
-
.clearai-link:hover{
|
|
268
|
+
.clearai-link{text-underline-offset:2px}
|
|
269
|
+
.clearai-link:hover{}
|
|
270
270
|
/* 世界树的**唯一**活性惯用法(照抄 ClearAI PlanTree 的 globals.css):
|
|
271
271
|
节点外的柔光环一呼一吸 = 这东西此刻在动;步骤与世界线共用它——两种闪法并存的话,
|
|
272
272
|
读者得学两次「什么在动」。透明度区间刻意压在 0.22–0.07:光环是底噪级的存在感,
|
|
@@ -283,10 +283,10 @@ window.__ModuleLoader__.load({
|
|
|
283
283
|
.clearai-treerow:hover{background:var(--dsw-alias-interactive-bg-hover)}
|
|
284
284
|
.clearai-treerow[data-sel="1"]{background:var(--dsw-alias-interactive-bg-active, var(--dsw-alias-interactive-bg-hover))}
|
|
285
285
|
/* ── 本体格(第六阶段):期刊式排版 + 进度轨。颜色只用主题令牌,深浅色跟着宿主走。 ── */
|
|
286
|
-
.clearai-atlas{height:100%;overflow-y:auto;box-sizing:border-box;
|
|
287
|
-
.clearai-serif,.clearai-question,.clearai-row-title,.clearai-card-title,.clearai-star>span{
|
|
288
|
-
.clearai-head{display:flex;flex-direction:column;
|
|
289
|
-
.clearai-question{
|
|
286
|
+
.clearai-atlas{height:100%;overflow-y:auto;box-sizing:border-box;font-size:13px;line-height:1.6;color:var(--dsw-alias-label-primary)}
|
|
287
|
+
.clearai-serif,.clearai-question,.clearai-row-title,.clearai-card-title,.clearai-star>span{}
|
|
288
|
+
.clearai-head{display:flex;flex-direction:column;padding-bottom:16px}
|
|
289
|
+
.clearai-question{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;}
|
|
290
290
|
.clearai-counts{font-size:12px;color:var(--dsw-alias-label-secondary)}
|
|
291
291
|
.clearai-need{display:flex;gap:8px;align-items:baseline;font-size:12.5px;padding:4px 10px;border-left:2px solid var(--dsw-alias-state-warn-primary);background:var(--dsw-alias-bg-layer-1);border-radius:0 6px 6px 0}
|
|
292
292
|
.clearai-need b{font-weight:600;color:var(--dsw-alias-state-warn-primary);white-space:nowrap}
|
|
@@ -298,21 +298,30 @@ window.__ModuleLoader__.load({
|
|
|
298
298
|
.clearai-track-line{flex:1 1 18px;max-width:56px;height:1px;background:var(--dsw-alias-border-l2)}
|
|
299
299
|
.clearai-track-line[data-on="1"]{background:var(--dsw-alias-label-secondary)}
|
|
300
300
|
/* 图 */
|
|
301
|
-
.clearai-graph{
|
|
302
|
-
.clearai-graph[data-full="1"]{position:fixed;inset:0;
|
|
303
|
-
.clearai-graph-bar{
|
|
304
|
-
.clearai-seg{
|
|
301
|
+
.clearai-graph{}
|
|
302
|
+
.clearai-graph[data-full="1"]{position:fixed;inset:0;background:var(--dsw-alias-bg-base);display:flex;flex-direction:column;margin:0}
|
|
303
|
+
.clearai-graph-bar{align-items:center;margin-bottom:8px;font-size:12px;position:relative;z-index:2}
|
|
304
|
+
.clearai-seg{}
|
|
305
305
|
.clearai-seg>span{padding:2px 12px;border-radius:999px;cursor:pointer;color:var(--dsw-alias-label-secondary);white-space:nowrap}
|
|
306
306
|
.clearai-seg>span[data-on="1"]{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-label-primary-inverted)}
|
|
307
|
-
.clearai-legend{display:inline-flex;
|
|
307
|
+
.clearai-legend{display:inline-flex;color:var(--dsw-alias-label-tertiary)}
|
|
308
308
|
.clearai-legend>span{display:inline-flex;align-items:center;gap:5px}
|
|
309
309
|
.clearai-legend>span::before{content:"";width:16px;border-top:1.3px solid var(--dsw-alias-label-secondary)}
|
|
310
310
|
.clearai-legend>span[data-l="dash"]::before{border-top-style:dashed;border-top-color:var(--dsw-alias-label-tertiary)}
|
|
311
311
|
.clearai-legend>span[data-l="warn"]::before{border-top-color:var(--dsw-alias-state-warn-primary)}
|
|
312
|
-
.clearai-graph-body{display:flex;flex-direction:column;
|
|
313
|
-
.clearai-graph[data-full="1"] .clearai-graph-body{
|
|
314
|
-
.clearai-graph-body[data-side="1"]{
|
|
315
|
-
.clearai-graph-canvas{
|
|
312
|
+
.clearai-graph-body{display:flex;flex-direction:column;min-height:0}
|
|
313
|
+
.clearai-graph[data-full="1"] .clearai-graph-body{}
|
|
314
|
+
.clearai-graph-body[data-side="1"]{}
|
|
315
|
+
.clearai-graph-canvas{overflow:hidden}
|
|
316
|
+
/**
|
|
317
|
+
* **缩放/适配控件跟着宿主主题走**(暗色下原来白底白图标,对比度 1.04:1)。
|
|
318
|
+
*
|
|
319
|
+
* React Flow 的 Controls 默认是它自己的浅色主题:按钮底色 #fefefe,而按钮颜色是 inherit ——
|
|
320
|
+
* 暗色宿主把文字色设成近白,图标就继承成近白,于是白底上的白图标看不见。
|
|
321
|
+
* 这里不传 colorMode(那会把整张图切到库自带的暗色板,和宿主令牌未必同色),
|
|
322
|
+
* 只把控件用到的那几个库变量接到宿主令牌上:深浅色都跟着宿主走,不写死色值。
|
|
323
|
+
*/
|
|
324
|
+
.clearai-graph-canvas .react-flow{--xy-controls-button-background-color:var(--dsw-alias-bg-layer-1);--xy-controls-button-background-color-hover:var(--dsw-alias-interactive-bg-hover);--xy-controls-button-color:var(--dsw-alias-label-primary);--xy-controls-button-color-hover:var(--dsw-alias-label-primary);--xy-controls-button-border-color:var(--dsw-alias-border-l2)}
|
|
316
325
|
.clearai-graph[data-full="1"] .clearai-graph-canvas{height:auto;flex:1 1 auto;min-width:0}
|
|
317
326
|
/**
|
|
318
327
|
* 全屏是自画的覆盖层(fixed / inset:0 / z-index:40),画布与右下角抽屉都长在它里面。
|
|
@@ -323,15 +332,15 @@ window.__ModuleLoader__.load({
|
|
|
323
332
|
.clearai-graph[data-full="1"] .clearai-link[data-exit="1"]{position:fixed;top:12px;right:20px;z-index:41;padding:3px 10px;border:.5px solid var(--dsw-alias-border-l3);border-radius:8px;background:var(--dsw-alias-bg-base);text-decoration:none}
|
|
324
333
|
.clearai-graph[data-full="1"] .clearai-link[data-exit="1"]:hover{border-color:var(--dsw-alias-label-secondary)}
|
|
325
334
|
.clearai-graph-side{flex:0 0 auto}
|
|
326
|
-
.clearai-graph-body[data-side="1"] .clearai-graph-side{
|
|
335
|
+
.clearai-graph-body[data-side="1"] .clearai-graph-side{overflow-y:auto}
|
|
327
336
|
.clearai-graph-problems{margin-top:6px;font-size:11.5px;color:var(--dsw-alias-label-secondary)}.clearai-graph-problems summary{cursor:pointer;color:var(--dsw-alias-state-warn-primary)}.clearai-graph-problems>div{padding:2px 0 2px 12px;line-height:1.5}.clearai-graph-problems>div[data-sev=info]{opacity:.7}.clearai-graph-problems code{font-size:11px}
|
|
328
|
-
.clearai-fold{
|
|
337
|
+
.clearai-fold{padding:0 4px;font-weight:500;cursor:pointer}
|
|
329
338
|
.clearai-graph-empty{height:150px;display:flex;align-items:center;justify-content:center;text-align:center;padding:0 24px;border:.5px dashed var(--dsw-alias-border-l3);border-radius:10px;color:var(--dsw-alias-label-secondary);font-size:12.5px}
|
|
330
|
-
.react-flow__node.clearai-star-node .react-flow__handle{opacity:0;pointer-events:none;
|
|
339
|
+
.react-flow__node.clearai-star-node .react-flow__handle{opacity:0;pointer-events:none;min-width:0;min-height:0;width:1px;height:1px;border:0}
|
|
331
340
|
.react-flow__node.clearai-star-node.selected,.react-flow__node.clearai-star-node:focus{box-shadow:none;outline:none}
|
|
332
|
-
.clearai-star{
|
|
333
|
-
.clearai-star>i{flex:0 0 auto;
|
|
334
|
-
.clearai-star[data-kind="instance"]>i{
|
|
341
|
+
.clearai-star{color:var(--dsw-alias-label-primary);cursor:pointer}
|
|
342
|
+
.clearai-star>i{flex:0 0 auto;box-sizing:border-box;border:1.4px solid var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-base)}
|
|
343
|
+
.clearai-star[data-kind="instance"]>i{}
|
|
335
344
|
.clearai-star[data-kind="literal"]>i{width:6px;height:6px;border:0;background:var(--dsw-alias-label-secondary)}
|
|
336
345
|
.clearai-star[data-kind="literal"]{color:var(--dsw-alias-label-secondary);font-size:11.5px}
|
|
337
346
|
.clearai-star[data-kind="value_type"]>i{border-radius:2px;width:8px;height:8px;border-color:var(--dsw-alias-label-tertiary)}
|
|
@@ -343,14 +352,14 @@ window.__ModuleLoader__.load({
|
|
|
343
352
|
.clearai-star[data-sel="1"]>i{box-shadow:0 0 0 4px var(--dsw-alias-interactive-bg-hover)}
|
|
344
353
|
.clearai-star[data-sel="1"]>span{font-weight:600}
|
|
345
354
|
/* 小卡 */
|
|
346
|
-
.clearai-card{display:flex;flex-direction:column;gap:8px;
|
|
347
|
-
.clearai-card-head{display:flex;align-items:baseline;
|
|
355
|
+
.clearai-card{display:flex;flex-direction:column;gap:8px;background:var(--dsw-alias-bg-layer-1)}
|
|
356
|
+
.clearai-card-head{display:flex;align-items:baseline;font-size:12px}
|
|
348
357
|
.clearai-card-kind{font-size:11px;color:var(--dsw-alias-label-tertiary);letter-spacing:.06em}
|
|
349
|
-
.clearai-card-title{font-
|
|
358
|
+
.clearai-card-title{font-weight:600}
|
|
350
359
|
.clearai-card-facts{display:flex;flex-direction:column;gap:4px}
|
|
351
360
|
.clearai-card-fact{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;font-size:12.5px}
|
|
352
361
|
/* 结论 */
|
|
353
|
-
.clearai-section-head{
|
|
362
|
+
.clearai-section-head{color:var(--dsw-alias-label-tertiary);margin:4px 0 4px}
|
|
354
363
|
.clearai-filter{display:flex;gap:10px;align-items:baseline;font-size:12px;color:var(--dsw-alias-label-secondary);margin:-8px 0 12px}
|
|
355
364
|
.clearai-list{display:flex;flex-direction:column;gap:10px}
|
|
356
365
|
.clearai-group-head{display:flex;gap:6px;align-items:baseline;font-size:11.5px;color:var(--dsw-alias-label-secondary);margin:6px 0 2px}
|
|
@@ -400,28 +409,28 @@ window.__ModuleLoader__.load({
|
|
|
400
409
|
.clearai-quiet{color:var(--dsw-alias-label-secondary);font-size:12.5px;padding:6px 0}
|
|
401
410
|
/* ── 探索货架:问题 → 候选假设 → 下一步;过程记录默认折叠。颜色只用主题令牌。 ── */
|
|
402
411
|
.clearai-head-kind{font-size:11.5px;color:var(--dsw-alias-label-tertiary)}
|
|
403
|
-
.clearai-pills{display:flex;flex-wrap:wrap;
|
|
404
|
-
.clearai-pill{
|
|
405
|
-
.clearai-waiting{display:flex;flex-wrap:wrap;gap:6px 12px;align-items:baseline;
|
|
412
|
+
.clearai-pills{display:flex;flex-wrap:wrap;font-size:12px}
|
|
413
|
+
.clearai-pill{background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary)}
|
|
414
|
+
.clearai-waiting{display:flex;flex-wrap:wrap;gap:6px 12px;align-items:baseline;margin-bottom:14px;border:.5px solid var(--dsw-alias-state-warn-primary);background:var(--dsw-alias-bg-layer-1);font-size:12.5px}
|
|
406
415
|
.clearai-waiting b{color:var(--dsw-alias-state-warn-primary);font-weight:600}
|
|
407
|
-
.clearai-box{display:flex;flex-direction:column;
|
|
408
|
-
.clearai-box-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 14px
|
|
416
|
+
.clearai-box{display:flex;flex-direction:column;overflow:hidden}
|
|
417
|
+
.clearai-box-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 14px}
|
|
409
418
|
.clearai-box[data-compact="1"] .clearai-box-head{background:transparent}
|
|
410
|
-
.clearai-box-kind{
|
|
411
|
-
.clearai-box-title{flex:1 1 220px;font-
|
|
419
|
+
.clearai-box-kind{color:var(--dsw-alias-label-tertiary)}
|
|
420
|
+
.clearai-box-title{flex:1 1 220px;font-weight:600}
|
|
412
421
|
.clearai-box-note{font-size:12px;color:var(--dsw-alias-label-secondary)}
|
|
413
422
|
.clearai-box-foot{display:flex;flex-direction:column;gap:4px;padding:8px 14px;font-size:12px;color:var(--dsw-alias-label-tertiary);border-top:.5px solid var(--dsw-alias-border-l1)}
|
|
414
423
|
.clearai-parked{display:inline-flex;gap:8px;align-items:baseline}
|
|
415
424
|
.clearai-cand{border-top:.5px solid var(--dsw-alias-border-l1)}
|
|
416
|
-
.clearai-cand-head{width:100%;display:flex;flex-wrap:wrap;align-items:center;gap:4px 12px;
|
|
425
|
+
.clearai-cand-head{width:100%;display:flex;flex-wrap:wrap;align-items:center;gap:4px 12px;border:0;background:transparent;text-align:left;font:inherit;color:inherit;cursor:pointer}
|
|
417
426
|
.clearai-cand-head[data-static="1"]{cursor:default}
|
|
418
427
|
.clearai-cand-head:not([data-static="1"]):hover{background:var(--dsw-alias-interactive-bg-hover)}
|
|
419
428
|
.clearai-cand-name{font-weight:500}
|
|
420
429
|
.clearai-cand[data-s="excluded"] .clearai-cand-name{text-decoration:line-through;color:var(--dsw-alias-label-tertiary)}
|
|
421
430
|
.clearai-cand-note{flex:1 1 220px;min-width:0;font-size:12px;color:var(--dsw-alias-label-secondary)}
|
|
422
431
|
.clearai-cand-chevron{margin-left:auto;font-size:11.5px;color:var(--dsw-alias-label-tertiary)}
|
|
423
|
-
.clearai-cand-detail{display:flex;flex-direction:column;gap:3px
|
|
424
|
-
.clearai-kvrow{display:grid;
|
|
432
|
+
.clearai-cand-detail{display:flex;flex-direction:column;gap:3px}
|
|
433
|
+
.clearai-kvrow{display:grid;gap:10px;font-size:12.5px}
|
|
425
434
|
.clearai-kvrow>span:first-child{color:var(--dsw-alias-label-tertiary)}
|
|
426
435
|
.clearai-state{flex:0 0 auto;display:inline-block;font-size:11px;line-height:16px;padding:0 7px;border-radius:6px;border:.5px solid var(--dsw-alias-border-l3);color:var(--dsw-alias-label-secondary);white-space:nowrap}
|
|
427
436
|
.clearai-state[data-s="examining"],.clearai-state[data-s="in_progress"]{border-color:var(--dsw-alias-brand-primary);color:var(--dsw-alias-brand-primary)}
|
|
@@ -433,37 +442,37 @@ window.__ModuleLoader__.load({
|
|
|
433
442
|
.clearai-emergent-text{flex:1 1 200px;font-weight:500}
|
|
434
443
|
.clearai-emergent-actions{display:inline-flex;gap:8px}
|
|
435
444
|
.clearai-emergent-done{margin:0 14px 10px;font-size:12px;color:var(--dsw-alias-label-secondary)}
|
|
436
|
-
.clearai-btn{
|
|
445
|
+
.clearai-btn{border:.5px solid var(--dsw-alias-border-l3);background:var(--dsw-alias-bg-base);color:var(--dsw-alias-label-primary);font:inherit;cursor:pointer}
|
|
437
446
|
.clearai-btn[data-primary="1"]{background:var(--dsw-alias-brand-primary);border-color:var(--dsw-alias-brand-primary);color:#fff}
|
|
438
|
-
.clearai-next{display:flex;flex-direction:column;
|
|
447
|
+
.clearai-next{display:flex;flex-direction:column;margin-bottom:14px}
|
|
439
448
|
.clearai-next-head{display:flex;flex-wrap:wrap;gap:4px 12px;align-items:baseline}
|
|
440
|
-
.clearai-next-kind{font-
|
|
441
|
-
.clearai-next-title{
|
|
442
|
-
.clearai-preds{display:grid;
|
|
443
|
-
.clearai-pred{
|
|
449
|
+
.clearai-next-kind{font-weight:600;color:var(--dsw-alias-brand-primary)}
|
|
450
|
+
.clearai-next-title{}
|
|
451
|
+
.clearai-preds{display:grid;gap:8px}
|
|
452
|
+
.clearai-pred{border:.5px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base)}
|
|
444
453
|
.clearai-pred-if{font-size:11.5px;color:var(--dsw-alias-label-secondary)}
|
|
445
454
|
.clearai-pred-value{font-size:13.5px;font-weight:600}
|
|
446
455
|
.clearai-next-note{font-size:12px;color:var(--dsw-alias-label-secondary)}
|
|
447
456
|
.clearai-next-warn{font-size:12px;color:var(--dsw-alias-state-warn-primary);font-weight:600}
|
|
448
457
|
.clearai-anomaly{display:flex;flex-wrap:wrap;gap:4px 12px;padding:7px 14px;border-top:.5px solid var(--dsw-alias-border-l1);font-size:12.5px}
|
|
449
458
|
.clearai-anomaly-meta{font-size:11.5px;color:var(--dsw-alias-label-tertiary)}
|
|
450
|
-
.clearai-process{border-top:.5px solid var(--dsw-alias-border-l2)
|
|
451
|
-
.clearai-process-head{width:100%;
|
|
459
|
+
.clearai-process{border-top:.5px solid var(--dsw-alias-border-l2)}
|
|
460
|
+
.clearai-process-head{width:100%;display:flex;flex-wrap:wrap;align-items:center;gap:4px 12px;padding:0;border:0;background:transparent;text-align:left;font:inherit;color:inherit;cursor:pointer}
|
|
452
461
|
.clearai-process-head span{font-size:12px;color:var(--dsw-alias-label-secondary)}
|
|
453
462
|
.clearai-process-body{display:flex;flex-direction:column;gap:14px;padding:6px 0}
|
|
454
463
|
.clearai-judgments-head{display:flex;flex-direction:column;gap:4px}
|
|
455
464
|
/* 本体货架的结论卡:四部分 */
|
|
456
|
-
.clearai-answers{display:flex;flex-direction:column
|
|
457
|
-
.clearai-qtab{
|
|
465
|
+
.clearai-answers{display:flex;flex-direction:column}
|
|
466
|
+
.clearai-qtab{padding:0 12px;border:.5px solid var(--dsw-alias-border-l3);background:var(--dsw-alias-bg-base);color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;cursor:pointer}
|
|
458
467
|
.clearai-qtab[aria-pressed="true"]{background:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-primary);color:var(--dsw-alias-label-primary-inverted)}
|
|
459
|
-
.clearai-answer{display:flex;flex-direction:column;
|
|
460
|
-
.clearai-answer-part{display:flex;flex-direction:column;
|
|
468
|
+
.clearai-answer{display:flex;flex-direction:column;overflow:hidden}
|
|
469
|
+
.clearai-answer-part{display:flex;flex-direction:column;border-top:.5px solid var(--dsw-alias-border-l1)}
|
|
461
470
|
.clearai-answer-part:first-child{border-top:0}
|
|
462
471
|
.clearai-answer-part[data-warm="1"]{background:var(--dsw-alias-bg-layer-1)}
|
|
463
|
-
.clearai-answer-label{font-
|
|
472
|
+
.clearai-answer-label{font-weight:600;color:var(--dsw-alias-label-tertiary)}
|
|
464
473
|
.clearai-answer-part[data-warm="1"] .clearai-answer-label{color:var(--dsw-alias-state-warn-primary)}
|
|
465
|
-
.clearai-answer-main{
|
|
466
|
-
.clearai-answer-lines{display:flex;flex-direction:column;gap:3px
|
|
474
|
+
.clearai-answer-main{}
|
|
475
|
+
.clearai-answer-lines{display:flex;flex-direction:column;gap:3px}
|
|
467
476
|
.clearai-lesson{display:flex;flex-wrap:wrap;gap:4px 10px;align-items:baseline;font-size:12.5px}
|
|
468
477
|
.clearai-lesson-kind{font-size:11px;padding:0 7px;border-radius:6px;border:.5px solid var(--dsw-alias-border-l3);color:var(--dsw-alias-label-secondary)}
|
|
469
478
|
.clearai-lesson-meta{font-size:11.5px;color:var(--dsw-alias-label-tertiary)}
|
|
@@ -498,6 +507,109 @@ window.__ModuleLoader__.load({
|
|
|
498
507
|
.clearai-kcount-legend em[data-b="pending"]{border-style:dashed}
|
|
499
508
|
.clearai-kcount-legend em[data-b="unresolved"]{border-color:var(--dsw-alias-brand-primary)}
|
|
500
509
|
.clearai-settled{display:flex;flex-wrap:wrap;gap:4px 10px;align-items:baseline;padding:2px 2px 0;font-size:12.5px}
|
|
510
|
+
/* Research and knowledge share one quiet, responsive reading surface. */
|
|
511
|
+
.clearai-atlas{container-type:inline-size;padding:36px clamp(18px,4vw,52px) 100px;font:14px/1.65 ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans SC",sans-serif;scrollbar-gutter:stable}
|
|
512
|
+
.clearai-atlas> *{max-width:1120px;margin-left:auto;margin-right:auto;min-width:0}
|
|
513
|
+
.clearai-serif,.clearai-question,.clearai-row-title,.clearai-card-title,.clearai-star>span{font-family:inherit}
|
|
514
|
+
.clearai-head{gap:10px;padding:0 0 28px;margin-bottom:28px;border-bottom:1px solid var(--dsw-alias-border-l1)}
|
|
515
|
+
.clearai-eyebrow{display:flex;align-items:center;gap:9px;color:var(--dsw-alias-label-secondary);font-size:12px;font-weight:600;letter-spacing:.04em}
|
|
516
|
+
.clearai-page-note{color:var(--dsw-alias-label-tertiary);font-size:13px}
|
|
517
|
+
.clearai-question{font-size:clamp(22px,2.3vw,30px);font-weight:600;line-height:1.4;letter-spacing:-.025em;max-width:30em;text-wrap:balance;overflow-wrap:anywhere}
|
|
518
|
+
.clearai-pills{gap:8px;margin-top:8px}.clearai-pill{border-radius:6px;padding:3px 9px;font-size:11px}
|
|
519
|
+
.clearai-atlas button,.clearai-graph button,.clearai-graph input{font-family:inherit}
|
|
520
|
+
.clearai-link{border:0;background:none;padding:5px 2px;font:inherit;font-size:12px;color:var(--dsw-alias-label-secondary);cursor:pointer;text-decoration:none}
|
|
521
|
+
.clearai-link:hover{color:var(--dsw-alias-label-primary);text-decoration:underline;text-underline-offset:4px}
|
|
522
|
+
.clearai-link[aria-pressed="true"]{color:var(--dsw-alias-brand-primary);font-weight:600}
|
|
523
|
+
.clearai-atlas :focus-visible,.clearai-graph :focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:3px}
|
|
524
|
+
.clearai-btn{min-height:36px;border-radius:9px;padding:0 12px;font-size:12px;transition:background .15s,border-color .15s}
|
|
525
|
+
.clearai-btn:hover{background:var(--dsw-alias-interactive-bg-hover)}
|
|
526
|
+
.clearai-row-head{width:100%;border:0;background:none;color:inherit;font:inherit;text-align:left}
|
|
527
|
+
.clearai-box{border-radius:14px;margin-bottom:18px;border:1px solid var(--dsw-alias-border-l1)}
|
|
528
|
+
.clearai-box-head{padding:16px 18px;background:var(--dsw-alias-bg-base)}
|
|
529
|
+
.clearai-box-title{font-size:16px;letter-spacing:-.015em}.clearai-box-kind{font-size:11px;letter-spacing:.035em}
|
|
530
|
+
.clearai-cand-head{padding:13px 18px}.clearai-cand-detail{padding:0 18px 16px}
|
|
531
|
+
.clearai-research-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:20px;margin-bottom:12px}
|
|
532
|
+
.clearai-research-main,.clearai-research-next{min-width:0}
|
|
533
|
+
.clearai-next{padding:20px;border:1px solid var(--dsw-alias-border-l2);border-radius:14px;gap:14px;background:var(--dsw-alias-bg-layer-1)}
|
|
534
|
+
.clearai-next-title{font-size:16px;font-weight:550;line-height:1.5}.clearai-next-kind{font-size:11px;letter-spacing:.05em}
|
|
535
|
+
.clearai-preds{grid-template-columns:repeat(auto-fit,minmax(min(180px,100%),1fr))}.clearai-pred{padding:12px;border-radius:10px}
|
|
536
|
+
.clearai-answer{border-radius:14px;border:1px solid var(--dsw-alias-border-l1)}
|
|
537
|
+
.clearai-answers{margin-top:28px;margin-bottom:28px;gap:12px}.clearai-answer-part{padding:18px 20px;gap:8px}
|
|
538
|
+
.clearai-answer-main{font-size:18px;line-height:1.6;font-weight:550}.clearai-answer-label{font-size:11px;letter-spacing:.04em}
|
|
539
|
+
.clearai-answer-lines{font-size:13px;line-height:1.8}.clearai-qtab{min-height:34px;border-radius:8px}
|
|
540
|
+
.clearai-section-head{font-size:15px;font-weight:600;margin-top:28px;margin-bottom:12px;letter-spacing:-.015em}
|
|
541
|
+
.clearai-process{margin-top:24px;padding-top:12px}.clearai-process-head{min-height:48px}
|
|
542
|
+
.clearai-waiting{padding:14px 18px;border-radius:12px;border-color:var(--dsw-alias-border-l2);border-left:3px solid var(--dsw-alias-state-warn-primary)}
|
|
543
|
+
.clearai-kvrow{grid-template-columns:80px minmax(0,1fr)}
|
|
544
|
+
@container (min-width:850px){.clearai-research-grid{grid-template-columns:minmax(0,1.7fr) minmax(270px,1fr);gap:24px}.clearai-research-next{align-self:start;position:sticky;top:12px}}
|
|
545
|
+
/* A map is a workspace: heading, tools, canvas, then interpretation. */
|
|
546
|
+
.clearai-graph{container-type:inline-size;border:1px solid var(--dsw-alias-border-l2);border-radius:18px;background:var(--dsw-alias-bg-base);overflow:hidden;margin-bottom:28px;color:var(--dsw-alias-label-primary);font:13px/1.5 ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-sizing:border-box}
|
|
547
|
+
.clearai-map-heading{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:22px 22px 16px}
|
|
548
|
+
.clearai-map-heading h2{font-size:18px;font-weight:600;letter-spacing:-.02em;margin:0 0 4px}
|
|
549
|
+
.clearai-map-heading p{font-size:12px;color:var(--dsw-alias-label-secondary);margin:0;max-width:56em}.clearai-map-heading .clearai-btn{flex-shrink:0}
|
|
550
|
+
.clearai-graph-bar{display:flex;flex-wrap:wrap;gap:10px;padding:0 20px 16px;margin:0}
|
|
551
|
+
.clearai-seg{display:inline-flex;align-items:center;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l1);border-radius:10px;padding:3px;gap:2px}
|
|
552
|
+
.clearai-seg>button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:32px;padding:0 11px;border:0;border-radius:7px;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;white-space:nowrap;cursor:pointer}
|
|
553
|
+
.clearai-seg>button[data-on="1"]{background:var(--dsw-alias-bg-base);color:var(--dsw-alias-label-primary);box-shadow:0 1px 4px #00000012;font-weight:600}
|
|
554
|
+
.clearai-seg-count{font-size:10px;font-variant-numeric:tabular-nums;opacity:.6}
|
|
555
|
+
.clearai-graph-search{display:flex;align-items:center;gap:8px;flex:1 1 150px;min-width:120px;min-height:38px;border:1px solid var(--dsw-alias-border-l2);border-radius:10px;padding:0 10px;color:var(--dsw-alias-label-tertiary)}
|
|
556
|
+
.clearai-graph-search input{border:0;outline:none;background:transparent;min-width:0;width:100%;color:var(--dsw-alias-label-primary);font-size:12px}
|
|
557
|
+
.clearai-graph-search:focus-within{border-color:var(--dsw-alias-brand-primary)}
|
|
558
|
+
.clearai-graph-search button{border:0;background:none;color:inherit;font-size:20px;cursor:pointer}
|
|
559
|
+
.clearai-graph-body{position:relative;gap:0;min-width:0}
|
|
560
|
+
.clearai-graph-canvas{height:460px;border:0;border-radius:0;border-top:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);min-width:0}
|
|
561
|
+
.clearai-graph-body[data-side="1"]{flex-direction:row}
|
|
562
|
+
.clearai-graph-side{box-sizing:border-box;max-height:380px;overflow:auto;border-top:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base)}
|
|
563
|
+
.clearai-graph-body[data-side="1"] .clearai-graph-side{width:320px;max-width:40%;max-height:none;border-left:1px solid var(--dsw-alias-border-l2);border-top:0}
|
|
564
|
+
.clearai-card{border:0;border-radius:0;margin:0;padding:18px}.clearai-card-head{gap:9px;flex-wrap:wrap;margin-bottom:14px}.clearai-card-title{font-size:17px;overflow-wrap:anywhere}
|
|
565
|
+
.clearai-card .clearai-kv{grid-template-columns:60px minmax(0,1fr);font-size:13px;gap:10px}.clearai-card .clearai-kv>span{overflow-wrap:anywhere}
|
|
566
|
+
.clearai-map-footer{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:12px 20px;border-top:1px solid var(--dsw-alias-border-l1);font-size:11px;color:var(--dsw-alias-label-tertiary)}
|
|
567
|
+
.clearai-legend{gap:12px;font-size:11px;flex-wrap:wrap}.clearai-map-size{margin-left:auto;font-variant-numeric:tabular-nums}.clearai-map-actions{display:flex;align-items:center;gap:12px}.clearai-map-zoom{font-size:11px;font-variant-numeric:tabular-nums}
|
|
568
|
+
.clearai-map-directory{max-height:360px;overflow:auto;padding:8px 18px;border-top:1px solid var(--dsw-alias-border-l1)}
|
|
569
|
+
.clearai-directory-row{display:flex;width:100%;align-items:center;gap:12px;min-height:58px;padding:10px 8px;border:0;border-bottom:1px solid var(--dsw-alias-border-l1);background:none;text-align:left;color:inherit;cursor:pointer}
|
|
570
|
+
.clearai-directory-row:hover{background:var(--dsw-alias-interactive-bg-hover)}.clearai-directory-row strong{font-size:13px;font-weight:550;overflow-wrap:anywhere}.clearai-directory-row small{display:block;font-size:11px;color:var(--dsw-alias-label-tertiary);margin-top:2px}.clearai-directory-arrow{margin-left:auto;color:var(--dsw-alias-label-tertiary)}
|
|
571
|
+
.clearai-directory-dot{width:9px;height:9px;border:1.5px solid var(--dsw-alias-label-secondary);border-radius:3px;flex-shrink:0}.clearai-directory-dot[data-kind="instance"]{border-radius:50%;background:var(--dsw-alias-label-secondary)}
|
|
572
|
+
/* Concepts have an open glyph; concrete entities a filled one. Labels stay legible. */
|
|
573
|
+
.clearai-star{display:inline-flex;align-items:center;gap:10px;box-sizing:border-box;width:180px;min-width:180px;max-width:180px;border:1px solid var(--dsw-alias-border-l3);background:var(--dsw-alias-bg-base);font-size:14px;line-height:1.35;white-space:normal}
|
|
574
|
+
.clearai-star>i{width:12px;height:12px;border-radius:4px;border-width:1.5px}.clearai-star[data-kind="instance"]>i{border-radius:50%;background:var(--dsw-alias-brand-primary);border-color:var(--dsw-alias-brand-primary)}
|
|
575
|
+
.clearai-star[data-kind="literal"],.clearai-star[data-kind="value_type"]{width:140px;min-width:140px;font-size:12px;box-shadow:none}
|
|
576
|
+
.clearai-node-copy{display:flex;flex-direction:column;gap:3px;min-width:0}.clearai-node-copy small{font-weight:500}.clearai-node-copy>span{overflow-wrap:anywhere}
|
|
577
|
+
.clearai-star[data-sel="1"]{}
|
|
578
|
+
.clearai-star[data-state="conflict"]{border-color:var(--dsw-alias-state-warn-primary)}.clearai-star[data-state="pending"]{border-style:dashed}
|
|
579
|
+
.react-flow__node.clearai-star-node:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:4px;border-radius:12px}
|
|
580
|
+
.clearai-fold{border:0;font:inherit;font-size:11px}
|
|
581
|
+
.clearai-graph-canvas .react-flow__controls{border:1px solid var(--dsw-alias-border-l2);border-radius:9px;overflow:hidden;box-shadow:0 2px 8px #00000008}
|
|
582
|
+
.clearai-graph-canvas .react-flow__controls-button{width:30px;height:30px}.clearai-graph-canvas .react-flow__edge.selected path{stroke:var(--dsw-alias-brand-primary)}
|
|
583
|
+
.clearai-graph[data-full="1"]{border:0;border-radius:0;padding:0;max-width:none;z-index:100;overflow:hidden;box-sizing:border-box}
|
|
584
|
+
.clearai-graph[data-full="1"] .clearai-map-heading{padding:20px 24px 12px}.clearai-graph[data-full="1"] .clearai-graph-bar{padding:0 24px 16px}
|
|
585
|
+
.clearai-graph[data-full="1"] .clearai-graph-body{flex:1;min-height:0}.clearai-graph[data-full="1"] .clearai-graph-canvas{min-height:180px}
|
|
586
|
+
.clearai-graph[data-full="1"] .clearai-map-directory{max-height:45vh}.clearai-graph-problems{padding:8px 20px;margin:0}
|
|
587
|
+
@container (max-width:600px){.clearai-map-heading{padding:16px;gap:12px;align-items:flex-start}.clearai-map-heading h2{font-size:16px}.clearai-map-heading p{font-size:11px}.clearai-graph-bar{padding:0 14px 14px;gap:8px}.clearai-graph-search{order:3;flex-basis:100%}.clearai-seg>button{padding:0 9px}.clearai-graph-canvas{height:380px}.clearai-graph-body[data-side="1"] .clearai-graph-side{position:absolute;z-index:5;bottom:0;left:0;right:0;width:100%;max-width:100%;max-height:52%;border:1px solid var(--dsw-alias-border-l2);border-radius:16px 16px 0 0;box-shadow:0 -6px 30px #00000014}.clearai-map-footer{padding:10px 14px;gap:8px}.clearai-map-size{margin-left:0}.clearai-map-actions{margin-left:auto}.clearai-card{padding:16px}}
|
|
588
|
+
@container (max-width:480px){.clearai-question{font-size:23px}.clearai-head{margin-bottom:22px;padding-bottom:22px}.clearai-answer-part{padding:15px}.clearai-answer-main{font-size:16px}.clearai-track{flex-wrap:wrap}.clearai-graph-bar>.clearai-seg:last-child{margin-left:auto}.clearai-pills{gap:5px}}
|
|
589
|
+
@media (prefers-reduced-motion:reduce){.clearai-atlas *,.clearai-graph *{scroll-behavior:auto;transition:none!important}}
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
/* Detail belongs to the focal relationship; the rest supplies quiet context. */
|
|
593
|
+
.clearai-star{border-radius:10px;box-shadow:0 1px 3px #00000005,0 4px 12px #00000003;border-color:var(--dsw-alias-border-l2);padding:11px 14px;transition:border-color .15s,box-shadow .15s}
|
|
594
|
+
.clearai-star:hover{border-color:var(--dsw-alias-border-l3);box-shadow:0 3px 14px #0000000c}
|
|
595
|
+
.clearai-star[data-kind="concept"]>i{width:10px;height:10px;transform:rotate(45deg);border-radius:3px;border-color:var(--dsw-alias-label-secondary)}
|
|
596
|
+
.clearai-root-node .clearai-star{border-color:var(--dsw-alias-border-l3);background:var(--dsw-alias-bg-base)}
|
|
597
|
+
.clearai-root-node .clearai-node-copy>span{font-size:15px;font-weight:650;letter-spacing:-.02em}
|
|
598
|
+
.clearai-root-node .clearai-star>i{border-color:var(--dsw-alias-brand-primary);background:color-mix(in srgb,var(--dsw-alias-brand-primary) 10%,transparent)}
|
|
599
|
+
.clearai-node-copy small{font-size:9px;letter-spacing:.08em;color:var(--dsw-alias-label-tertiary)}
|
|
600
|
+
.clearai-node-copy>span{font-size:13px;font-weight:550;line-height:1.45;text-align:left;letter-spacing:.005em}
|
|
601
|
+
.clearai-star[data-kind="instance"]>i{width:9px;height:9px;box-shadow:0 0 0 4px color-mix(in srgb,var(--dsw-alias-brand-primary) 9%,transparent)}
|
|
602
|
+
.clearai-star[data-kind="literal"],.clearai-star[data-kind="value_type"]{border-style:solid;background:var(--dsw-alias-bg-layer-1);border-color:transparent;border-radius:8px}
|
|
603
|
+
.clearai-star[data-sel="1"]{border-color:var(--dsw-alias-brand-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--dsw-alias-brand-primary) 12%,transparent),0 4px 16px #00000009}
|
|
604
|
+
.clearai-fold{margin-left:auto;border-radius:5px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);min-width:20px;min-height:20px}
|
|
605
|
+
.clearai-star>.clearai-kcount{display:none}.clearai-star:hover>.clearai-kcount,.clearai-star[data-sel="1"]>.clearai-kcount{display:inline-flex}
|
|
606
|
+
.clearai-graph-canvas .react-flow__edge path{stroke-linecap:round;stroke-linejoin:round}
|
|
607
|
+
.clearai-graph-canvas .react-flow__edge-textbg{stroke:var(--dsw-alias-border-l1);stroke-width:.7}
|
|
608
|
+
.clearai-graph-canvas .react-flow__edge:hover path{stroke:var(--dsw-alias-brand-primary);stroke-width:1.8}
|
|
609
|
+
.clearai-edge-quiet .react-flow__edge-textwrapper{opacity:0;pointer-events:none}
|
|
610
|
+
.clearai-edge-quiet:hover .react-flow__edge-textwrapper,.clearai-edge-quiet:focus .react-flow__edge-textwrapper{opacity:1}
|
|
611
|
+
.clearai-graph[data-detail="overview"] .react-flow__edge-textwrapper{display:none}
|
|
612
|
+
|
|
501
613
|
`
|
|
502
614
|
/** 把上面那段 CSS 挂进页面(带 data-plugin 标记,宿主按包名记账,卸载时收掉)。 */
|
|
503
615
|
function installStyles() {
|
|
@@ -603,7 +715,7 @@ window.__ModuleLoader__.load({
|
|
|
603
715
|
}
|
|
604
716
|
/** 可点的文本(替代裸下划线 span)。 */
|
|
605
717
|
function Link(props) {
|
|
606
|
-
return h('
|
|
718
|
+
return h('button', { type: 'button', className: 'clearai-link', title: props.title, onClick: props.onClick }, props.children)
|
|
607
719
|
}
|
|
608
720
|
|
|
609
721
|
|
|
@@ -1059,8 +1171,8 @@ window.__ModuleLoader__.load({
|
|
|
1059
1171
|
'div',
|
|
1060
1172
|
{ className: 'clearai-row', 'data-open': open ? '1' : '0', 'data-trust': row.trust },
|
|
1061
1173
|
h(
|
|
1062
|
-
'
|
|
1063
|
-
{ className: 'clearai-row-head', onClick: () => props.onToggle(row.key), title: open ? t('收起') : t('点击查看进度与来源') },
|
|
1174
|
+
'button',
|
|
1175
|
+
{ type: 'button', 'aria-expanded': open, className: 'clearai-row-head', onClick: () => props.onToggle(row.key), title: open ? t('收起') : t('点击查看进度与来源') },
|
|
1064
1176
|
h(TrustTag, { trust: row.trust }),
|
|
1065
1177
|
h('span', { className: 'clearai-row-title' }, title),
|
|
1066
1178
|
sub === null ? null : h('span', { className: 'clearai-row-sub' }, sub),
|
|
@@ -1096,6 +1208,8 @@ window.__ModuleLoader__.load({
|
|
|
1096
1208
|
return h(
|
|
1097
1209
|
'div',
|
|
1098
1210
|
{ className: 'clearai-head' },
|
|
1211
|
+
h('div', { className: 'clearai-eyebrow' }, h(ClearAIMark, { size: 16 }), t('知识概览')),
|
|
1212
|
+
h('div', { className: 'clearai-page-note' }, t('连接概念,理解已形成的知识。')),
|
|
1099
1213
|
h('div', { className: 'clearai-question', title: String(data?.goal?.claim ?? '') }, data?.goal ? String(data.knowledgeView?.goal?.headline ?? data.goal.claim ?? '') : t('尚未设立目标')),
|
|
1100
1214
|
)
|
|
1101
1215
|
}
|
|
@@ -1106,6 +1220,16 @@ window.__ModuleLoader__.load({
|
|
|
1106
1220
|
* 取数与从前一样:宿主半的会话投影单元 `clearai` 由插座作为 `useProjection` 交下来。
|
|
1107
1221
|
* 界面状态(图层、全屏、选中、展开哪条、只看哪个词)全是界面的事,一个字节都不进账本。
|
|
1108
1222
|
*/
|
|
1223
|
+
function IntegrityNotice({ data }) {
|
|
1224
|
+
const issues = data.integrity ?? []
|
|
1225
|
+
const copies = (data.auditCopies ?? []).filter(copy => copy.status === 'unavailable')
|
|
1226
|
+
if (!issues.length && !copies.length) return null
|
|
1227
|
+
return h('section', { className: 'clearai-waiting', role: 'status' },
|
|
1228
|
+
issues.length ? h('div', null, h('strong', null, t('知识文件需要复核')), h('p', null, t('以下文件未登记或内容已变化,暂不作为可信知识使用。')),
|
|
1229
|
+
h('details', null, h('summary', null, t('查看记录')), ...issues.map(item => h('div', { key: item.path }, h(Link, { onClick: () => data.openPreview?.(item.path) }, item.path), ' · ', item.code)))) : null,
|
|
1230
|
+
copies.length ? h('div', null, h('strong', null, t('复跑不可用')), h('p', null, t('复跑副本未能建立;相关裁决不能据此通过。'))) : null)
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1109
1233
|
function Atlas(props) {
|
|
1110
1234
|
const projected = typeof props.useProjection === 'function' ? props.useProjection('clearai') : undefined
|
|
1111
1235
|
const [manual, setManual] = React.useState(null)
|
|
@@ -1136,8 +1260,8 @@ window.__ModuleLoader__.load({
|
|
|
1136
1260
|
'div',
|
|
1137
1261
|
{ className: 'clearai-atlas' },
|
|
1138
1262
|
h(AtlasHeader, { data }),
|
|
1139
|
-
|
|
1140
|
-
|
|
1263
|
+
h(IntegrityNotice, { data }),
|
|
1264
|
+
h(GraphBand, {
|
|
1141
1265
|
lexicon,
|
|
1142
1266
|
data,
|
|
1143
1267
|
send: props.send,
|
|
@@ -1150,13 +1274,14 @@ window.__ModuleLoader__.load({
|
|
|
1150
1274
|
fullscreen: workspace,
|
|
1151
1275
|
onToggleFullscreen: () => setWorkspace(workspace !== true),
|
|
1152
1276
|
}),
|
|
1277
|
+
h(AnswerCards, { data, openExplore: props.openExplore }),
|
|
1153
1278
|
filterTerm === null
|
|
1154
1279
|
? null
|
|
1155
1280
|
: h(
|
|
1156
1281
|
'div',
|
|
1157
1282
|
{ className: 'clearai-filter' },
|
|
1158
1283
|
`${t('仅显示与「')}${String(filterTerm.label ?? filterTerm.id)}${t('」相关的内容')}${t(':')}${shown.length}/${rows.length}`,
|
|
1159
|
-
h('
|
|
1284
|
+
h('button', { type: 'button', className: 'clearai-link', onClick: () => setFilter(null) }, t('清除')),
|
|
1160
1285
|
),
|
|
1161
1286
|
h('div', { className: 'clearai-section-head' }, t('已确立的事实')),
|
|
1162
1287
|
h(ConclusionList, {
|
|
@@ -1236,7 +1361,7 @@ window.__ModuleLoader__.load({
|
|
|
1236
1361
|
const predictionOf = (id) => (next?.predictions ?? []).find((item) => item.hypothesis === id)?.expect ?? null
|
|
1237
1362
|
const status =
|
|
1238
1363
|
question.status === 'answered'
|
|
1239
|
-
? h('
|
|
1364
|
+
? h('button', { type: 'button', className: 'clearai-link', onClick: () => props.openFacts?.(), title: t('在本体货架中展开此结论') }, t('已得出结论 · 查看结论'))
|
|
1240
1365
|
: question.status === 'parked'
|
|
1241
1366
|
? h('span', null, t('已暂缓'))
|
|
1242
1367
|
: question.status === 'emergent'
|
|
@@ -1450,11 +1575,13 @@ window.__ModuleLoader__.load({
|
|
|
1450
1575
|
h(
|
|
1451
1576
|
'div',
|
|
1452
1577
|
{ className: 'clearai-head' },
|
|
1453
|
-
h('div', { className: 'clearai-
|
|
1578
|
+
h('div', { className: 'clearai-eyebrow' }, h(ClearAIMark, { size: 16 }), t('研究工作台')),
|
|
1579
|
+
h('div', { className: 'clearai-page-note' }, t('从问题到证据,逐步推进。')),
|
|
1454
1580
|
h('div', { className: 'clearai-question', title: String(goal.claim ?? '') }, String(goal.headline ?? data.knowledgeView?.goal?.headline ?? goal.claim ?? '')),
|
|
1455
1581
|
chips.length === 0 ? null : h('div', { className: 'clearai-pills' }, ...chips.map((chip, index) => h('span', { key: `c-${index}`, className: 'clearai-pill' }, chip))),
|
|
1456
1582
|
),
|
|
1457
|
-
|
|
1583
|
+
h(IntegrityNotice, { data }),
|
|
1584
|
+
needYou.length === 0
|
|
1458
1585
|
? null
|
|
1459
1586
|
: h(
|
|
1460
1587
|
'section',
|
|
@@ -1462,10 +1589,16 @@ window.__ModuleLoader__.load({
|
|
|
1462
1589
|
h('b', null, `${t('待您处理(')}${needYou.length}${t(')')}`),
|
|
1463
1590
|
...needYou.map((item, index) => h('span', { key: `need-${index}` }, String(item?.text ?? ''))),
|
|
1464
1591
|
),
|
|
1592
|
+
h('div', { className: 'clearai-research-grid' },
|
|
1593
|
+
h('div', { className: 'clearai-research-main' },
|
|
1465
1594
|
areas.length > 0 ? h(AreaBox, { exploration, send: props.send, sent, onSent }) : null,
|
|
1466
1595
|
...questionList.map((question) => h(QuestionBox, { key: question.id, data, question, index: declared.indexOf(question), current: question.id === exploration?.current, next: exploration?.next ?? null, open, onToggle: setOpen, openFacts, send: props.send, sent, onSent })),
|
|
1596
|
+
),
|
|
1597
|
+
h('aside', { className: 'clearai-research-next', 'aria-label': t('当前焦点') },
|
|
1467
1598
|
h(NextBox, { next: exploration?.next ?? null }),
|
|
1468
1599
|
h(AnomalyBox, { data }),
|
|
1600
|
+
),
|
|
1601
|
+
),
|
|
1469
1602
|
h(KnowledgeFlowBox, { data, openPreview: props.openPreview }),
|
|
1470
1603
|
h(
|
|
1471
1604
|
'section',
|
|
@@ -1543,10 +1676,10 @@ window.__ModuleLoader__.load({
|
|
|
1543
1676
|
return h(
|
|
1544
1677
|
'div',
|
|
1545
1678
|
{ className: 'clearai-kitem', 'data-open': open ? '1' : '0' },
|
|
1546
|
-
h('div', { className: 'clearai-kitem-head'
|
|
1679
|
+
h('div', { className: 'clearai-kitem-head' }, h(StateTag, { state: item.status }, item.kind === 'lesson' ? (LESSON_WORD[item.status] ?? item.status) : (ITEM_WORD[item.status] ?? item.status)), canAsk ? h('button', { type: 'button', className: 'clearai-link', 'aria-expanded': open, title: open ? t('收起') : t('点击查看可发出的请求'), onClick: () => setOpen(!open) }, item.text) : h('span', null, item.text), item.path ? h('button', { type: 'button', className: 'clearai-link', onClick: () => props.openPreview?.(item.path), title: item.path }, t('查看记录')) : null),
|
|
1547
1680
|
meta.length === 0 ? null : h('div', { className: 'clearai-kitem-meta' }, meta.join(' · ')),
|
|
1548
|
-
...(item.rechecks ?? []).filter((reason) => reason.evidence).map((reason) => h('
|
|
1549
|
-
...(item.evidencePaths ?? []).map((path) => h('
|
|
1681
|
+
...(item.rechecks ?? []).filter((reason) => reason.evidence).map((reason) => h('button', { type: 'button', className: 'clearai-link', onClick: () => props.openPreview?.(reason.evidence), title: reason.evidence }, t('查看核验'))),
|
|
1682
|
+
...(item.evidencePaths ?? []).map((path) => h('button', { type: 'button', className: 'clearai-link', onClick: () => props.openPreview?.(path), title: path }, t('查看核验'))),
|
|
1550
1683
|
asks.length === 0
|
|
1551
1684
|
? null
|
|
1552
1685
|
: done !== undefined
|
|
@@ -1628,7 +1761,7 @@ window.__ModuleLoader__.load({
|
|
|
1628
1761
|
h(
|
|
1629
1762
|
'div',
|
|
1630
1763
|
{ key: `${item.id}|${item.verdict}`, className: 'clearai-kitem' },
|
|
1631
|
-
h('div', { className: 'clearai-kitem-head' }, h(StateTag, { state: item.verdict }, VERDICT_WORD[item.verdict] ?? item.verdict), h('span', null, item.text ?? item.id), item.path ? h('
|
|
1764
|
+
h('div', { className: 'clearai-kitem-head' }, h(StateTag, { state: item.verdict }, VERDICT_WORD[item.verdict] ?? item.verdict), h('span', null, item.text ?? item.id), item.path ? h('button', { type: 'button', className: 'clearai-link', onClick: () => props.openPreview?.(item.path), title: item.path }, t('查看记录')) : null),
|
|
1632
1765
|
h('div', { className: 'clearai-kitem-meta' }, [`${t('引用者:')}${item.by.join(t('、'))}`, VERDICT_NEXT[item.verdict] ?? null].filter((line) => line !== null).join(' · ')),
|
|
1633
1766
|
),
|
|
1634
1767
|
),
|
|
@@ -1692,7 +1825,7 @@ window.__ModuleLoader__.load({
|
|
|
1692
1825
|
'section',
|
|
1693
1826
|
{ className: 'clearai-answer' },
|
|
1694
1827
|
part(t('结论'), h('span', { className: 'clearai-answer-main' }, chosen.conclusion || `${t('未能回答:')}${chosen.unanswered ?? ''}`)),
|
|
1695
|
-
basis.length === 0 ? null : part(t('依据'), h('div', { className: 'clearai-answer-lines' }, ...basis.map((line, index) => h('div', { key: `b-${index}` }, h('span', null, line), ' ', h('
|
|
1828
|
+
basis.length === 0 ? null : part(t('依据'), h('div', { className: 'clearai-answer-lines' }, ...basis.map((line, index) => h('div', { key: `b-${index}` }, h('span', null, line), ' ', h('button', { type: 'button', className: 'clearai-link', onClick: () => props.openExplore?.() }, t('查看探索记录')))))),
|
|
1696
1829
|
open.length === 0 ? null : part(t('尚未确定的事项'), h('div', { className: 'clearai-answer-lines' }, ...open.map((entry, index) => h('div', { key: `o-${index}` }, entry.effect)))),
|
|
1697
1830
|
decide.length === 0 ? null : part(t('待您决策'), h('div', { className: 'clearai-answer-lines' }, ...decide.map((line, index) => h('div', { key: `d-${index}` }, line))), true),
|
|
1698
1831
|
),
|
|
@@ -2322,7 +2455,7 @@ window.__ModuleLoader__.load({
|
|
|
2322
2455
|
if (Force === null || nodes.length < 2) return nodes
|
|
2323
2456
|
try {
|
|
2324
2457
|
const graph = new Force.Graph({ multi: true, type: 'directed' })
|
|
2325
|
-
for (const node of nodes) graph.addNode(node.id, { x: node.position.x, y: node.position.y, size:
|
|
2458
|
+
for (const node of nodes) graph.addNode(node.id, { x: node.position.x, y: node.position.y, size: 110 })
|
|
2326
2459
|
for (const edge of edges) {
|
|
2327
2460
|
if (edge.source === edge.target) continue
|
|
2328
2461
|
if (!graph.hasNode(edge.source) || !graph.hasNode(edge.target)) continue
|
|
@@ -2378,9 +2511,10 @@ window.__ModuleLoader__.load({
|
|
|
2378
2511
|
if (injected !== undefined) return undefined
|
|
2379
2512
|
if (key === '' || typeof sessionId !== 'string' || sessionId === '') return undefined
|
|
2380
2513
|
let live = true
|
|
2381
|
-
|
|
2514
|
+
const abort = new AbortController()
|
|
2515
|
+
setState({ inspector: null, loading: true, error: null })
|
|
2382
2516
|
const url = `/api/clearai/inspector?sessionId=${encodeURIComponent(sessionId)}&kind=${encodeURIComponent(selection.kind)}&id=${encodeURIComponent(selection.id)}`
|
|
2383
|
-
fetch(url)
|
|
2517
|
+
fetch(url, { signal: abort.signal })
|
|
2384
2518
|
.then((response) => response.json())
|
|
2385
2519
|
.then((result) => {
|
|
2386
2520
|
if (!live) return
|
|
@@ -2392,8 +2526,9 @@ window.__ModuleLoader__.load({
|
|
|
2392
2526
|
})
|
|
2393
2527
|
return () => {
|
|
2394
2528
|
live = false
|
|
2529
|
+
abort.abort()
|
|
2395
2530
|
}
|
|
2396
|
-
}, [key, injected])
|
|
2531
|
+
}, [key, injected, sessionId])
|
|
2397
2532
|
if (selection === null) return null
|
|
2398
2533
|
const data = injected === undefined ? state.inspector : injected
|
|
2399
2534
|
const busy = injected === undefined && state.loading === true
|
|
@@ -2417,10 +2552,12 @@ window.__ModuleLoader__.load({
|
|
|
2417
2552
|
h('span', { className: 'clearai-card-kind' }, KIND_WORD[selection.kind] ?? t('关系')),
|
|
2418
2553
|
h('span', { className: 'clearai-card-title' }, title),
|
|
2419
2554
|
h('span', { style: { flex: '1 1 auto' } }),
|
|
2420
|
-
h('
|
|
2421
|
-
h('
|
|
2555
|
+
h('button', { type: 'button', className: 'clearai-link', onClick: onFilter }, t('仅显示相关项')),
|
|
2556
|
+
h('button', { type: 'button', className: 'clearai-link', onClick: onClose }, t('关闭')),
|
|
2422
2557
|
),
|
|
2423
2558
|
busy === true ? h('div', { className: 'clearai-quiet' }, t('正在加载…')) : null,
|
|
2559
|
+
definition.status === 'asserted' ? h('div', { className: 'clearai-quiet' }, t('对象与断言,核验状态以证据记录为准。')) : null,
|
|
2560
|
+
definition.status === 'definition' ? h('div', { className: 'clearai-quiet' }, t('结构定义')) : null,
|
|
2424
2561
|
failure !== null ? h('div', { className: 'clearai-quiet' }, `${t('无法获取')}${t(':')}${failure}`) : null,
|
|
2425
2562
|
busy === false && failure === null && data === null ? h('div', { className: 'clearai-quiet' }, t('该项已不在当前词表中(可能已被废止)。')) : null,
|
|
2426
2563
|
data === null
|
|
@@ -2469,16 +2606,24 @@ window.__ModuleLoader__.load({
|
|
|
2469
2606
|
* · **点击语义**:点节点 / 边 = 打开小卡;「只看相关」是卡上的显式动作。
|
|
2470
2607
|
* · **全屏**:position: fixed 的真 overlay,打开时自动适配。
|
|
2471
2608
|
*/
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2609
|
+
/** 空投影:常量,免得每次渲染造一个新对象。 */
|
|
2610
|
+
const EMPTY_GRAPH = { nodes: [], edges: [], bounds: { width: 0, height: 0 } }
|
|
2611
|
+
|
|
2612
|
+
/**
|
|
2613
|
+
* 投影 → React Flow 的 nodes / edges(纯计算;GraphBand 用 useMemo 把它钉住)。
|
|
2614
|
+
*
|
|
2615
|
+
* 为什么必须稳定:会话在跑时中栏会跟着高频重渲染。每次重渲染都新造 node/edge 对象的话,
|
|
2616
|
+
* React Flow 会把它们当成新节点重新 adopt:`measured` 归零 → 边被卸载重挂 →
|
|
2617
|
+
* 边标签(要等 useEffect 里的 getBBox 才量出尺寸)先 hidden 再 visible,肉眼就是「字在闪」。
|
|
2618
|
+
* 同一份投影 + 同一个选中态 = 同一组对象;选中一个点也只换那一个节点对象(按签名缓存)。
|
|
2619
|
+
*/
|
|
2620
|
+
function graphViewOf({ lexicon, layer, toggled, dragged, selectedId, entityKnowledge, nodeCache, setToggled }) {
|
|
2621
|
+
const graph = lexicon?.graph ?? EMPTY_GRAPH
|
|
2476
2622
|
const conflicts = Array.isArray(lexicon?.conflicts) ? lexicon.conflicts : []
|
|
2477
2623
|
const conflicted = new Set(conflicts.flatMap((item) => item.sides.map((side) => side.fact)).filter((id) => typeof id === 'string'))
|
|
2478
2624
|
const layerNodes = graph.nodes.filter((node) => node.layer === layer)
|
|
2479
2625
|
const layerEdges = graph.edges.filter((edge) => edge.layer === layer && typeof edge.from === 'string' && typeof edge.to === 'string')
|
|
2480
2626
|
const nodeById = new Map(layerNodes.map((node) => [node.id, node]))
|
|
2481
|
-
const problems = Array.isArray(lexicon?.problems) ? lexicon.problems : []
|
|
2482
2627
|
|
|
2483
2628
|
/**
|
|
2484
2629
|
* **目录嵌套就是子图**:概念的父是 `node.parent`(is_a),实体的父是 `node.container`(组成)。
|
|
@@ -2501,10 +2646,6 @@ window.__ModuleLoader__.load({
|
|
|
2501
2646
|
}
|
|
2502
2647
|
return depth
|
|
2503
2648
|
}
|
|
2504
|
-
const [toggled, setToggled] = React.useState({})
|
|
2505
|
-
React.useEffect(() => {
|
|
2506
|
-
setToggled({})
|
|
2507
|
-
}, [layer])
|
|
2508
2649
|
const crowded = layerNodes.length > 40
|
|
2509
2650
|
const isCollapsed = (id) => (childCount.get(id) ?? 0) > 0 && (toggled[id] ?? (crowded && depthOfNode(id) >= 1))
|
|
2510
2651
|
/** 往上找第一个没被收起的祖先挡住的点:自己可见就是自己。 */
|
|
@@ -2529,7 +2670,7 @@ window.__ModuleLoader__.load({
|
|
|
2529
2670
|
for (const edge of layerEdges) {
|
|
2530
2671
|
const from = nodeById.has(edge.from) ? shownAs(edge.from) : edge.from
|
|
2531
2672
|
const to = nodeById.has(edge.to) ? shownAs(edge.to) : edge.to
|
|
2532
|
-
if (from === to) continue
|
|
2673
|
+
if (from === to && edge.from !== edge.to) continue
|
|
2533
2674
|
if (from === edge.from && to === edge.to) {
|
|
2534
2675
|
out.push(edge)
|
|
2535
2676
|
continue
|
|
@@ -2541,7 +2682,14 @@ window.__ModuleLoader__.load({
|
|
|
2541
2682
|
}
|
|
2542
2683
|
return out
|
|
2543
2684
|
})()
|
|
2544
|
-
|
|
2685
|
+
/**
|
|
2686
|
+
* 收起/展开用**函数式更新**读当下的 `toggled`:节点对象会被缓存复用,
|
|
2687
|
+
* 闭包里存旧状态的话,复用节点的折叠按钮会按上一帧的状态去翻。
|
|
2688
|
+
*/
|
|
2689
|
+
const toggle = (id) => setToggled((current) => {
|
|
2690
|
+
const collapsed = (childCount.get(id) ?? 0) > 0 && (current[id] ?? (crowded && depthOfNode(id) >= 1))
|
|
2691
|
+
return { ...current, [id]: !collapsed }
|
|
2692
|
+
})
|
|
2545
2693
|
const countOf = (name) => graph.nodes.filter((node) => node.layer === name).length
|
|
2546
2694
|
const entityNames = new Map(graph.nodes.filter((node) => node.kind === 'instance' && typeof node.ref === 'string' && node.ref !== '' && node.label !== node.ref).map((node) => [String(node.ref), String(node.label)]))
|
|
2547
2695
|
|
|
@@ -2550,28 +2698,6 @@ window.__ModuleLoader__.load({
|
|
|
2550
2698
|
const value = String(text ?? '')
|
|
2551
2699
|
return value.length <= limit ? value : `${value.slice(0, limit - 1)}…`
|
|
2552
2700
|
}
|
|
2553
|
-
|
|
2554
|
-
/**
|
|
2555
|
-
* **节点位置是受控的,所以必须自己接住拖动**:不给 `onNodesChange`,
|
|
2556
|
-
* React Flow 内部的拖动没有地方落地,节点根本拖不动。位置是界面状态,换层或图变了就清掉。
|
|
2557
|
-
*/
|
|
2558
|
-
const [dragged, setDragged] = React.useState({})
|
|
2559
|
-
const graphKey = `${layer}|${layerNodes.length}|${layerEdges.length}`
|
|
2560
|
-
React.useEffect(() => {
|
|
2561
|
-
setDragged({})
|
|
2562
|
-
}, [graphKey])
|
|
2563
|
-
const onNodesChange = React.useCallback((changes) => {
|
|
2564
|
-
setDragged((current) => {
|
|
2565
|
-
let next = current
|
|
2566
|
-
for (const change of changes) {
|
|
2567
|
-
if (change?.type !== 'position' || change.position === undefined) continue
|
|
2568
|
-
if (next === current) next = { ...current }
|
|
2569
|
-
next[change.id] = change.position
|
|
2570
|
-
}
|
|
2571
|
-
return next
|
|
2572
|
-
})
|
|
2573
|
-
}, [])
|
|
2574
|
-
|
|
2575
2701
|
/** 一个点的状态:矛盾 > 废止 > 待核验(只登记、没有写进长期知识的事实)> 平常。 */
|
|
2576
2702
|
const nodeState = (node) => {
|
|
2577
2703
|
if (Array.isArray(node.facts) && node.facts.some((id) => conflicted.has(id))) return 'conflict'
|
|
@@ -2579,12 +2705,7 @@ window.__ModuleLoader__.load({
|
|
|
2579
2705
|
if (node.kind !== 'concept' && node.kind !== 'value_type' && node.source === 'asserted' && (node.facts ?? []).length === 0) return 'pending'
|
|
2580
2706
|
return 'on'
|
|
2581
2707
|
}
|
|
2582
|
-
const selectedId = picked?.kind === 'node' ? picked.node.id : (focus ?? null)
|
|
2583
2708
|
|
|
2584
|
-
/**
|
|
2585
|
-
* 投影节点 → React Flow 节点。坐标 = 力导向松弛过的投影坐标(起点确定 ⇒ 同一份账本同一张图)。
|
|
2586
|
-
* 尺寸显式给:只写在 style 里的话,React Flow 要等测量完成才知道它多大。
|
|
2587
|
-
*/
|
|
2588
2709
|
/**
|
|
2589
2710
|
* 小图(十来个点)不跑力导向:几个点、几条边时它常常把点排成一条线。
|
|
2590
2711
|
* 改成一圈:连得最多的那个点居中(它是这张图的主语),其余按投影顺序绕一圈——确定、好读。
|
|
@@ -2609,64 +2730,218 @@ window.__ModuleLoader__.load({
|
|
|
2609
2730
|
})
|
|
2610
2731
|
return out
|
|
2611
2732
|
})()
|
|
2612
|
-
const
|
|
2613
|
-
|
|
2614
|
-
|
|
2733
|
+
const basePosition = (node) => dragged[node.id] ?? ring?.get(node.id) ?? { x: node.x ?? 0, y: node.y ?? 0 }
|
|
2734
|
+
/**
|
|
2735
|
+
* 坐标 = 力导向松弛过的投影坐标(起点确定 ⇒ 同一份账本同一张图)。
|
|
2736
|
+
* 力导向会把它收到的节点整个换成新对象,所以**先算坐标、后建节点对象**;
|
|
2737
|
+
* 反过来的话缓存下来的节点身份会在布局那一步丢掉。
|
|
2738
|
+
*/
|
|
2739
|
+
const hierarchy = layer === 'ontology' && [...parentById.values()].some(value => value !== null)
|
|
2740
|
+
const lanes = new Map()
|
|
2741
|
+
const hierarchyPositions = new Map(allNodes.map(node => {
|
|
2742
|
+
const depth = depthOfNode(node.id)
|
|
2743
|
+
const lane = lanes.get(depth) ?? 0
|
|
2744
|
+
lanes.set(depth, lane + 1)
|
|
2745
|
+
return [node.id, dragged[node.id] ?? { x: depth * 290, y: lane * 125 }]
|
|
2746
|
+
}))
|
|
2747
|
+
const positions = hierarchy ? hierarchyPositions : small
|
|
2748
|
+
? new Map(allNodes.map((node) => [node.id, basePosition(node)]))
|
|
2749
|
+
: (() => {
|
|
2750
|
+
const laidOut = forceLayout(
|
|
2751
|
+
allNodes.map((node) => ({ id: node.id, position: basePosition(node) })),
|
|
2752
|
+
allEdges.map((edge) => ({ source: edge.from, target: edge.to })),
|
|
2753
|
+
)
|
|
2754
|
+
const out = new Map(allNodes.map((node) => [node.id, basePosition(node)]))
|
|
2755
|
+
for (const node of laidOut) {
|
|
2756
|
+
const x = node?.position?.x
|
|
2757
|
+
const y = node?.position?.y
|
|
2758
|
+
if (Number.isFinite(x) && Number.isFinite(y)) out.set(node.id, dragged[node.id] ?? { x, y })
|
|
2759
|
+
}
|
|
2760
|
+
return out
|
|
2761
|
+
})()
|
|
2762
|
+
|
|
2763
|
+
/**
|
|
2764
|
+
* 投影节点 → React Flow 节点。坐标 = 上面算好的位置。
|
|
2765
|
+
* 尺寸显式给:只写在 style 里的话,React Flow 要等测量完成才知道它多大。
|
|
2766
|
+
* 对象身份按**签名**守:内容没变就复用上一次那个对象,内容真变了才重建。
|
|
2767
|
+
*/
|
|
2768
|
+
const cache = nodeCache.current ?? new Map()
|
|
2769
|
+
const rfNodes = allNodes.map((node) => {
|
|
2770
|
+
const position = positions.get(node.id) ?? { x: 0, y: 0 }
|
|
2771
|
+
const state = nodeState(node)
|
|
2772
|
+
const selected = node.id === selectedId
|
|
2773
|
+
const labelText = trimLabel(node.kind === 'value_type' ? (FORM_WORD[node.ref] ?? node.label ?? node.ref) : (node.label ?? node.ref ?? node.id), 16)
|
|
2774
|
+
const counts = node.layer === 'entity' ? entityKnowledge?.[node.id]?.counts : undefined
|
|
2775
|
+
const children = childCount.get(node.id) ?? 0
|
|
2776
|
+
const collapsed = children > 0 ? isCollapsed(node.id) : false
|
|
2777
|
+
const foldText = children > 0 ? (collapsed ? `+${hiddenUnder.get(node.id) ?? 0}` : '−') : ''
|
|
2778
|
+
const signature = [node.id, node.kind, node.ref ?? '', position.x, position.y, selected ? 1 : 0, state, labelText, foldText, counts === undefined ? '' : JSON.stringify(counts)].join('\u0001')
|
|
2779
|
+
const cached = cache.get(node.id)
|
|
2780
|
+
if (cached !== undefined && cached.signature === signature) return cached.node
|
|
2781
|
+
const rfNode = {
|
|
2615
2782
|
id: node.id,
|
|
2616
2783
|
type: 'default',
|
|
2617
|
-
position
|
|
2618
|
-
initialWidth:
|
|
2619
|
-
initialHeight:
|
|
2620
|
-
|
|
2784
|
+
position,
|
|
2785
|
+
initialWidth: 180,
|
|
2786
|
+
initialHeight: 54,
|
|
2787
|
+
sourcePosition: layer === 'ontology' ? 'right' : 'bottom',
|
|
2788
|
+
targetPosition: layer === 'ontology' ? 'left' : 'top',
|
|
2789
|
+
ariaLabel: String(node.label ?? node.ref ?? node.id),
|
|
2790
|
+
selected,
|
|
2621
2791
|
data: {
|
|
2622
2792
|
label: h(
|
|
2623
2793
|
'span',
|
|
2624
|
-
{ className: 'clearai-star', 'data-kind': node.kind, 'data-state':
|
|
2794
|
+
{ className: 'clearai-star', 'data-kind': node.kind, 'data-state': state, 'data-sel': selected ? '1' : '0' },
|
|
2625
2795
|
h('i', null),
|
|
2626
|
-
h('span',
|
|
2627
|
-
node.layer === 'entity' ? h(CountMarks, { counts
|
|
2628
|
-
|
|
2796
|
+
h('span', { className: 'clearai-node-copy', title: String(node.label ?? node.ref ?? node.id) }, h('small', null, KIND_WORD[node.kind] ?? t('对象')), h('span', null, labelText)),
|
|
2797
|
+
node.layer === 'entity' ? h(CountMarks, { counts }) : null,
|
|
2798
|
+
children > 0
|
|
2629
2799
|
? h(
|
|
2630
|
-
'
|
|
2800
|
+
'button',
|
|
2631
2801
|
{
|
|
2632
|
-
|
|
2633
|
-
|
|
2802
|
+
type: 'button', 'aria-expanded': !collapsed,
|
|
2803
|
+
className: 'clearai-fold nodrag',
|
|
2804
|
+
title: collapsed ? t('展开下一层') : t('收起下一层'),
|
|
2634
2805
|
onClick: (event) => {
|
|
2635
2806
|
event.stopPropagation()
|
|
2636
2807
|
toggle(node.id)
|
|
2637
2808
|
},
|
|
2638
2809
|
},
|
|
2639
|
-
|
|
2810
|
+
foldText,
|
|
2640
2811
|
)
|
|
2641
2812
|
: null,
|
|
2642
2813
|
),
|
|
2643
2814
|
},
|
|
2644
|
-
className:
|
|
2815
|
+
className: `clearai-star-node${node.kind === 'concept' && parentOf(node) === null ? ' clearai-root-node' : ''}`,
|
|
2645
2816
|
style: { background: 'transparent', border: 0, padding: 0, width: 'auto', boxShadow: 'none' },
|
|
2646
|
-
}
|
|
2647
|
-
|
|
2648
|
-
|
|
2817
|
+
}
|
|
2818
|
+
cache.set(node.id, { signature, node: rfNode })
|
|
2819
|
+
return rfNode
|
|
2820
|
+
})
|
|
2821
|
+
/** 塌掉/移除的分支不在图上了:缓存里只留当前层还认识的点。 */
|
|
2822
|
+
for (const id of [...cache.keys()]) if (!nodeById.has(id)) cache.delete(id)
|
|
2649
2823
|
|
|
2650
2824
|
/** 投影边 → React Flow 边:实线已验证、虚线待核验、淡线上下位、告警色是矛盾。 */
|
|
2651
2825
|
const edgeTone = (edge) => {
|
|
2652
2826
|
if (edge.kind === 'assertion' && conflicted.has(edge.fact)) return { stroke: 'var(--dsw-alias-state-warn-primary)', strokeWidth: 1.4 }
|
|
2653
|
-
if (edge.kind === 'is_a') return { stroke: 'var(--dsw-alias-
|
|
2827
|
+
if (edge.kind === 'is_a') return { stroke: 'var(--dsw-alias-label-tertiary)', strokeWidth: 1.2, strokeDasharray: '4 5' }
|
|
2654
2828
|
if (edge.status === 'retracted') return { stroke: 'var(--dsw-alias-border-l2)', strokeWidth: 1, strokeDasharray: '2 4' }
|
|
2655
2829
|
if (edge.kind === 'assertion' && edge.status !== 'live') return { stroke: 'var(--dsw-alias-label-tertiary)', strokeWidth: 1.1, strokeDasharray: '5 4' }
|
|
2656
2830
|
return { stroke: edge.kind === 'assertion' ? 'var(--dsw-alias-label-secondary)' : 'var(--dsw-alias-label-tertiary)', strokeWidth: edge.kind === 'assertion' ? 1.3 : 1 }
|
|
2657
2831
|
}
|
|
2658
|
-
const
|
|
2832
|
+
const edgeGroups = new Map()
|
|
2833
|
+
for (const edge of allEdges) {
|
|
2834
|
+
const key = [edge.from, edge.to].sort().join('\u0001')
|
|
2835
|
+
if (!edgeGroups.has(key)) edgeGroups.set(key, [])
|
|
2836
|
+
edgeGroups.get(key).push(edge.id)
|
|
2837
|
+
}
|
|
2838
|
+
for (const group of edgeGroups.values()) group.sort()
|
|
2839
|
+
const groupOf = edge => edgeGroups.get([edge.from, edge.to].sort().join('\u0001'))
|
|
2840
|
+
const rfEdges = allEdges.map((edge) => ({
|
|
2659
2841
|
id: edge.id,
|
|
2660
2842
|
source: edge.from,
|
|
2661
2843
|
target: edge.to,
|
|
2662
|
-
type: '
|
|
2844
|
+
type: edge.from === edge.to || groupOf(edge).length > 1 ? 'relationship' : layer === 'ontology' ? 'smoothstep' : 'default',
|
|
2845
|
+
data: { index: groupOf(edge).indexOf(edge.id), count: groupOf(edge).length },
|
|
2846
|
+
pathOptions: { borderRadius: 20, offset: 28 },
|
|
2847
|
+
className: allEdges.length > 24 && edge.from !== selectedId && edge.to !== selectedId ? 'clearai-edge-quiet' : '',
|
|
2848
|
+
interactionWidth: 24,
|
|
2849
|
+
ariaLabel: String(edge.label ?? edge.kind),
|
|
2663
2850
|
label: edge.kind === 'is_a' ? '' : (edge.label ?? ''),
|
|
2664
|
-
labelStyle: { fontSize:
|
|
2851
|
+
labelStyle: { fontSize: 11.5, fontWeight: 500, fill: 'var(--dsw-alias-label-secondary)' },
|
|
2665
2852
|
labelBgStyle: { fill: 'var(--dsw-alias-bg-base)', fillOpacity: 0.9 },
|
|
2666
|
-
labelBgPadding: [
|
|
2853
|
+
labelBgPadding: [8, 5],
|
|
2854
|
+
labelBgBorderRadius: 5,
|
|
2855
|
+
markerEnd: { type: 'arrowclosed', width: 14, height: 14, color: edgeTone(edge).stroke },
|
|
2667
2856
|
style: edgeTone(edge),
|
|
2668
2857
|
}))
|
|
2669
2858
|
|
|
2859
|
+
return {
|
|
2860
|
+
rfNodes,
|
|
2861
|
+
rfEdges,
|
|
2862
|
+
allNodes,
|
|
2863
|
+
allEdges,
|
|
2864
|
+
nodeById,
|
|
2865
|
+
entityNames,
|
|
2866
|
+
countOf,
|
|
2867
|
+
conflicts,
|
|
2868
|
+
graphKey: `${layer}|${layerNodes.length}|${layerEdges.length}`,
|
|
2869
|
+
}
|
|
2870
|
+
}
|
|
2871
|
+
|
|
2872
|
+
const RelationshipEdge = props => {
|
|
2873
|
+
const { sourceX: sx, sourceY: sy, targetX: tx, targetY: ty, data = {} } = props
|
|
2874
|
+
let path, labelX, labelY
|
|
2875
|
+
if (props.source === props.target) {
|
|
2876
|
+
const reach = 110 + data.index * 36
|
|
2877
|
+
path = `M ${sx} ${sy} C ${sx + reach} ${sy + 80}, ${tx + reach} ${ty - 80}, ${tx} ${ty}`
|
|
2878
|
+
labelX = (sx + tx) / 2 + reach * .75; labelY = (sy + ty) / 2
|
|
2879
|
+
} else {
|
|
2880
|
+
const dx = tx - sx, dy = ty - sy, distance = Math.max(1, Math.hypot(dx, dy))
|
|
2881
|
+
const offset = (data.index - (data.count - 1) / 2) * 58 * (props.source < props.target ? 1 : -1)
|
|
2882
|
+
const ox = -dy / distance * offset, oy = dx / distance * offset
|
|
2883
|
+
path = `M ${sx} ${sy} C ${sx + dx / 3 + ox} ${sy + dy / 3 + oy}, ${sx + dx * 2 / 3 + ox} ${sy + dy * 2 / 3 + oy}, ${tx} ${ty}`
|
|
2884
|
+
labelX = (sx + tx) / 2 + ox * .75; labelY = (sy + ty) / 2 + oy * .75
|
|
2885
|
+
}
|
|
2886
|
+
return h(XYFlow.BaseEdge, { ...props, path, labelX, labelY })
|
|
2887
|
+
}
|
|
2888
|
+
const relationshipEdgeTypes = { relationship: RelationshipEdge }
|
|
2889
|
+
|
|
2890
|
+
const GraphBand = ({ lexicon, data, send, layer, onLayer, fullscreen, onToggleFullscreen, onFilter, sessionId, unlanded, focus }) => {
|
|
2891
|
+
const [picked, setPicked] = React.useState(null)
|
|
2892
|
+
const [asked, setAsked] = React.useState({})
|
|
2893
|
+
const [query, setQuery] = React.useState('')
|
|
2894
|
+
const [display, setDisplay] = React.useState('graph')
|
|
2895
|
+
const [neighbors, setNeighbors] = React.useState(false)
|
|
2896
|
+
const [zoom, setZoom] = React.useState(1)
|
|
2897
|
+
const [jump, setJump] = React.useState(null)
|
|
2898
|
+
const graphElement = React.useRef(null)
|
|
2899
|
+
const [toggled, setToggled] = React.useState({})
|
|
2900
|
+
const [dragged, setDragged] = React.useState({})
|
|
2901
|
+
/** 节点对象缓存:见 graphViewOf。父级重渲染一个都不换,选中只换选中那个。 */
|
|
2902
|
+
const nodeCache = React.useRef(new Map())
|
|
2903
|
+
const selectedId = picked?.kind === 'node' ? picked.node.id : (focus ?? null)
|
|
2904
|
+
const previousLayer = React.useRef(layer)
|
|
2905
|
+
React.useEffect(() => {
|
|
2906
|
+
// Initial state is already empty; resetting it would lay out the graph twice.
|
|
2907
|
+
if (previousLayer.current === layer) return
|
|
2908
|
+
previousLayer.current = layer
|
|
2909
|
+
setToggled({})
|
|
2910
|
+
setQuery('')
|
|
2911
|
+
setNeighbors(false)
|
|
2912
|
+
setJump(null)
|
|
2913
|
+
setDragged({})
|
|
2914
|
+
setPicked(null)
|
|
2915
|
+
}, [layer])
|
|
2916
|
+
|
|
2917
|
+
/**
|
|
2918
|
+
* **同一份投影只产出一组 nodes/edges**。会话在跑时中栏会被高频重渲染;
|
|
2919
|
+
* 每次重造对象会让 React Flow 重新 adopt、边被卸载重挂,边标签因此闪。
|
|
2920
|
+
*/
|
|
2921
|
+
const view = React.useMemo(
|
|
2922
|
+
() => graphViewOf({ lexicon, layer, toggled, dragged, selectedId, entityKnowledge: data?.entityKnowledge, nodeCache, setToggled }),
|
|
2923
|
+
[lexicon?.graph, lexicon?.conflicts, layer, toggled, dragged, selectedId, data?.entityKnowledge],
|
|
2924
|
+
)
|
|
2925
|
+
const { rfNodes, rfEdges, allNodes, allEdges, nodeById, entityNames, countOf, conflicts, graphKey } = view
|
|
2926
|
+
/** 读时的跨文件检查只标不拦:有问题的那一份不进图,这里说清是哪个文件、哪里不对。 */
|
|
2927
|
+
const problems = Array.isArray(lexicon?.problems) ? lexicon.problems : []
|
|
2928
|
+
|
|
2929
|
+
/**
|
|
2930
|
+
* **节点位置是受控的,所以必须自己接住拖动**:不给 `onNodesChange`,
|
|
2931
|
+
* React Flow 内部的拖动没有地方落地,节点根本拖不动。位置是界面状态,换层或图变了就清掉。
|
|
2932
|
+
*/
|
|
2933
|
+
const onNodesChange = React.useCallback((changes) => {
|
|
2934
|
+
setDragged((current) => {
|
|
2935
|
+
let next = current
|
|
2936
|
+
for (const change of changes) {
|
|
2937
|
+
if (change?.type !== 'position' || change.position === undefined) continue
|
|
2938
|
+
if (next === current) next = { ...current }
|
|
2939
|
+
next[change.id] = change.position
|
|
2940
|
+
}
|
|
2941
|
+
return next
|
|
2942
|
+
})
|
|
2943
|
+
}, [])
|
|
2944
|
+
|
|
2670
2945
|
const onNodeClick = (_event, node) => {
|
|
2671
2946
|
const original = nodeById.get(node.id)
|
|
2672
2947
|
if (original !== undefined) setPicked({ kind: 'node', node: original })
|
|
@@ -2679,7 +2954,7 @@ window.__ModuleLoader__.load({
|
|
|
2679
2954
|
React.useEffect(() => {
|
|
2680
2955
|
if (focus === null || focus === undefined) return
|
|
2681
2956
|
const original = nodeById.get(focus)
|
|
2682
|
-
if (original !== undefined) setPicked({ kind: 'node', node: original })
|
|
2957
|
+
if (original !== undefined) { setPicked({ kind: 'node', node: original }); setJump({ id: focus }) }
|
|
2683
2958
|
}, [focus])
|
|
2684
2959
|
|
|
2685
2960
|
const inspection =
|
|
@@ -2697,9 +2972,22 @@ window.__ModuleLoader__.load({
|
|
|
2697
2972
|
*/
|
|
2698
2973
|
const rfRef = React.useRef(null)
|
|
2699
2974
|
React.useEffect(() => {
|
|
2700
|
-
const timer = setTimeout(() => rfRef.current?.fitView?.({ padding: 0.18, duration:
|
|
2975
|
+
const timer = setTimeout(() => rfRef.current?.fitView?.({ padding: 0.18, minZoom: 0.8, maxZoom: 1.1, duration: 0 }), 60)
|
|
2701
2976
|
return () => clearTimeout(timer)
|
|
2702
|
-
}, [fullscreen, layer
|
|
2977
|
+
}, [fullscreen, layer])
|
|
2978
|
+
|
|
2979
|
+
React.useEffect(() => {
|
|
2980
|
+
const element = graphElement.current
|
|
2981
|
+
if (!element || typeof ResizeObserver === 'undefined') return
|
|
2982
|
+
let width = element.clientWidth
|
|
2983
|
+
const observer = new ResizeObserver(() => {
|
|
2984
|
+
if (element.clientWidth === width) return
|
|
2985
|
+
width = element.clientWidth
|
|
2986
|
+
rfRef.current?.fitView?.({ padding: 0.18, minZoom: 0.8, maxZoom: 1.1, duration: 0 })
|
|
2987
|
+
})
|
|
2988
|
+
observer.observe(element)
|
|
2989
|
+
return () => observer.disconnect()
|
|
2990
|
+
}, [])
|
|
2703
2991
|
|
|
2704
2992
|
/**
|
|
2705
2993
|
* **Escape 退出全屏**(issue #33)。
|
|
@@ -2716,44 +3004,102 @@ window.__ModuleLoader__.load({
|
|
|
2716
3004
|
return () => window.removeEventListener('keydown', onKey)
|
|
2717
3005
|
}, [fullscreen, onToggleFullscreen])
|
|
2718
3006
|
|
|
3007
|
+
React.useEffect(() => {
|
|
3008
|
+
if (!fullscreen || typeof document === 'undefined') return
|
|
3009
|
+
const previous = document.activeElement
|
|
3010
|
+
const element = graphElement.current
|
|
3011
|
+
element?.querySelector('[data-exit]')?.focus()
|
|
3012
|
+
const trap = (event) => {
|
|
3013
|
+
if (event.key !== 'Tab') return
|
|
3014
|
+
const controls = [...element.querySelectorAll('button,input,[tabindex="0"]')].filter(item => !item.disabled && item.getClientRects().length)
|
|
3015
|
+
const first = controls[0], last = controls.at(-1)
|
|
3016
|
+
if (event.shiftKey && document.activeElement === first) { event.preventDefault(); last?.focus() }
|
|
3017
|
+
else if (!event.shiftKey && document.activeElement === last) { event.preventDefault(); first?.focus() }
|
|
3018
|
+
}
|
|
3019
|
+
element?.addEventListener('keydown', trap)
|
|
3020
|
+
return () => { element?.removeEventListener('keydown', trap); if (previous?.isConnected) previous.focus?.() }
|
|
3021
|
+
}, [fullscreen])
|
|
3022
|
+
|
|
2719
3023
|
/** 全屏时小卡走右侧抽屉:摆在画布下方会把画布压矮,刚点开的那个点直接掉出可视区。 */
|
|
2720
3024
|
const sideBySide = fullscreen === true
|
|
2721
3025
|
const empty =
|
|
2722
3026
|
layer === 'entity'
|
|
2723
3027
|
? `${typeof unlanded === 'number' && unlanded > 0 ? `${t('共 ')}${unlanded}${t(' 条断言的主体尚未建立实体文件。')}` : t('实体图暂无内容。')}${t('clear/ontology/entities/ 下的实体文件与写入长期知识的断言将在此显示。')}`
|
|
2724
3028
|
: t('本体图暂无内容。模型在 clear/ontology/concepts/ 与 relations/ 下建立概念与关系文件后,将在此显示。')
|
|
3029
|
+
const layerItems = (lexicon?.graph?.nodes ?? []).filter(node => node.layer === layer)
|
|
3030
|
+
const matches = layerItems.filter(node => `${node.label ?? ''} ${node.ref ?? ''}`.toLocaleLowerCase().includes(query.trim().toLocaleLowerCase()))
|
|
3031
|
+
const { visibleNodes, visibleEdges } = React.useMemo(() => {
|
|
3032
|
+
const connected = new Set(selectedId ? [selectedId] : [])
|
|
3033
|
+
for (const edge of allEdges) if (edge.from === selectedId || edge.to === selectedId) { connected.add(edge.from); connected.add(edge.to) }
|
|
3034
|
+
const visibleNodes = neighbors && selectedId ? rfNodes.filter(node => connected.has(node.id)) : rfNodes
|
|
3035
|
+
const visibleIds = new Set(visibleNodes.map(node => node.id))
|
|
3036
|
+
const visibleEdges = rfEdges.filter(edge => visibleIds.has(edge.source) && visibleIds.has(edge.target)).map(edge => ({ ...edge,
|
|
3037
|
+
style: { ...edge.style, opacity: !selectedId || edge.source === selectedId || edge.target === selectedId ? 1 : 0.18 },
|
|
3038
|
+
label: selectedId && edge.source !== selectedId && edge.target !== selectedId ? '' : edge.label,
|
|
3039
|
+
}))
|
|
3040
|
+
return { visibleNodes, visibleEdges }
|
|
3041
|
+
}, [rfNodes, rfEdges, allEdges, neighbors, selectedId])
|
|
3042
|
+
React.useEffect(() => {
|
|
3043
|
+
if (picked?.kind === 'node' && !nodeById.has(picked.node.id)) setPicked(null)
|
|
3044
|
+
if (picked?.kind === 'edge' && !allEdges.some(edge => edge.id === picked.edge.id)) setPicked(null)
|
|
3045
|
+
}, [lexicon, layer])
|
|
3046
|
+
|
|
3047
|
+
const centerNode = (node) => {
|
|
3048
|
+
setPicked({ kind: 'node', node })
|
|
3049
|
+
setDisplay('graph')
|
|
3050
|
+
setQuery('')
|
|
3051
|
+
setJump({ id: node.id })
|
|
3052
|
+
// Reveal collapsed ancestors before locating a search result.
|
|
3053
|
+
setToggled(Object.fromEntries(layerItems.map(item => [item.id, false])))
|
|
3054
|
+
}
|
|
3055
|
+
React.useEffect(() => {
|
|
3056
|
+
if (!jump || !nodeById.has(jump.id)) return
|
|
3057
|
+
const timer = setTimeout(() => rfRef.current?.fitView?.({ nodes: [{ id: jump.id }], minZoom: 1, maxZoom: 1.15, padding: 0.4, duration: 0 }), 80)
|
|
3058
|
+
return () => clearTimeout(timer)
|
|
3059
|
+
}, [jump, layer])
|
|
3060
|
+
const fit = () => rfRef.current?.fitView?.({ padding: 0.18, minZoom: 0.25, maxZoom: 1.1, duration: 0 })
|
|
3061
|
+
const focusPicked = () => selectedId && rfRef.current?.fitView?.({ nodes: [{ id: selectedId }], minZoom: 1, maxZoom: 1.15, duration: 0 })
|
|
3062
|
+
|
|
2725
3063
|
return h(
|
|
2726
3064
|
'div',
|
|
2727
3065
|
{
|
|
2728
|
-
className: 'clearai-graph',
|
|
3066
|
+
className: 'clearai-graph', ref: graphElement, role: fullscreen ? 'dialog' : 'region', 'aria-modal': fullscreen ? true : undefined, 'aria-label': t('知识地图'),
|
|
2729
3067
|
'data-full': fullscreen === true ? '1' : '0',
|
|
3068
|
+
'data-detail': zoom < 0.65 ? 'overview' : 'readable',
|
|
2730
3069
|
/** 覆盖层内也认 Escape(见上面的 window 监听):两条一起,焦点在哪都能退。 */
|
|
2731
|
-
onKeyDown:
|
|
3070
|
+
onKeyDown: (event) => {
|
|
3071
|
+
if (fullscreen && event?.key === 'Escape') { event.stopPropagation?.(); onToggleFullscreen(); return }
|
|
3072
|
+
if (event.key !== 'Enter' && event.key !== ' ') return
|
|
3073
|
+
const edge = event.target?.closest?.('.react-flow__edge')
|
|
3074
|
+
if (edge && event.target === edge) { event.preventDefault(); onEdgeClick(event, { id: edge.getAttribute('data-id') }) }
|
|
3075
|
+
},
|
|
2732
3076
|
},
|
|
2733
|
-
h(
|
|
2734
|
-
'div',
|
|
2735
|
-
{ className: 'clearai-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
h('
|
|
2740
|
-
|
|
3077
|
+
h('div', { className: 'clearai-map-heading' },
|
|
3078
|
+
h('div', null, h('h2', null, t('知识地图')), h('p', null, layer === 'ontology' ? t('概念与关系定义,不代表事实已验证。') : t('对象与断言,核验状态以证据记录为准。'))),
|
|
3079
|
+
h('button', { type: 'button', className: 'clearai-btn', 'data-exit': '1', onClick: onToggleFullscreen }, fullscreen ? `${t('退出全屏')} (Esc)` : t('全屏')),
|
|
3080
|
+
),
|
|
3081
|
+
h('div', { className: 'clearai-graph-bar' },
|
|
3082
|
+
h('div', { className: 'clearai-seg', role: 'group', 'aria-label': t('知识地图') },
|
|
3083
|
+
...['ontology', 'entity'].map(value => h('button', { key: value, type: 'button', 'data-on': layer === value ? '1' : '0', 'aria-pressed': layer === value, onClick: () => { setPicked(null); onLayer(value) } },
|
|
3084
|
+
t(value === 'ontology' ? '本体图' : '实体图'), ' ', h('span', { className: 'clearai-seg-count' }, countOf(value)))),
|
|
2741
3085
|
),
|
|
2742
|
-
h(
|
|
2743
|
-
'
|
|
2744
|
-
{
|
|
2745
|
-
h('
|
|
2746
|
-
h('span', { 'data-l': 'dash' }, t('待核验')),
|
|
2747
|
-
layer === 'entity' ? h('span', { className: 'clearai-kcount-legend' }, ...COUNT_ORDER.map((key) => h('span', { key }, h('em', { 'data-b': key }), COUNT_WORD[key]))) : null,
|
|
2748
|
-
conflicts.length > 0 ? h('span', { 'data-l': 'warn' }, `${t('矛盾')} ${conflicts.length}`) : null,
|
|
3086
|
+
h('label', { className: 'clearai-graph-search' },
|
|
3087
|
+
h('svg', { width: 16, height: 16, viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', strokeWidth: 1.6, 'aria-hidden': true }, h('circle', { cx: 10.5, cy: 10.5, r: 6.5 }), h('path', { d: 'M16 16l5 5' })),
|
|
3088
|
+
h('input', { value: query, 'aria-label': t('搜索图谱'), placeholder: t('搜索名称或标识…'), onChange: event => setQuery(event.target.value) }),
|
|
3089
|
+
query ? h('button', { type: 'button', 'aria-label': t('清除'), onClick: () => setQuery('') }, '×') : null,
|
|
2749
3090
|
),
|
|
2750
|
-
h('
|
|
2751
|
-
allNodes.length === 0 ? null : h('span', { className: 'clearai-link', onClick: () => rfRef.current?.fitView?.({ padding: 0.18, duration: 200 }) }, t('适配')),
|
|
2752
|
-
h('span', { className: 'clearai-link', 'data-exit': '1', onClick: onToggleFullscreen }, fullscreen === true ? `${t('退出全屏')} (Esc)` : t('全屏')),
|
|
3091
|
+
h('div', { className: 'clearai-seg', role: 'group', 'aria-label': t('图谱目录') }, ...['graph', 'list'].map(value => h('button', { key: value, type: 'button', 'aria-pressed': display === value, 'data-on': display === value ? '1' : '0', onClick: () => setDisplay(value) }, t(value === 'graph' ? '图谱' : '列表')))),
|
|
2753
3092
|
),
|
|
3093
|
+
query.trim() || display === 'list' ? h('div', { className: 'clearai-map-directory', 'aria-label': t('图谱目录') },
|
|
3094
|
+
matches.length === 0 ? h('div', { className: 'clearai-quiet', role: 'status' }, t('没有匹配的对象')) : matches.map(node => h('button', { key: node.id, type: 'button', className: 'clearai-directory-row', onClick: () => centerNode(node) },
|
|
3095
|
+
h('span', { className: 'clearai-directory-dot', 'data-kind': node.kind }),
|
|
3096
|
+
h('span', null, h('strong', null, String(node.label ?? node.ref ?? node.id)), h('small', null, KIND_WORD[node.kind] ?? node.kind)),
|
|
3097
|
+
h('span', { className: 'clearai-directory-arrow', 'aria-hidden': true }, '↗'))),
|
|
3098
|
+
) : null,
|
|
3099
|
+
|
|
2754
3100
|
h(
|
|
2755
3101
|
'div',
|
|
2756
|
-
{ className: 'clearai-graph-body', 'data-side': sideBySide ? '1' : '0' },
|
|
3102
|
+
{ className: 'clearai-graph-body', 'data-side': sideBySide ? '1' : '0', style: display === 'list' ? { display: 'none' } : undefined },
|
|
2757
3103
|
XYFlow === null || XYFlow.ReactFlow === undefined || XYFlow.ReactFlow === null
|
|
2758
3104
|
? h('div', { className: 'clearai-graph-empty' }, `${t('图组件不可用')}(${String(XYFLOW_LOAD.reason ?? '')}):${t('结论仍可正常查看。')}`)
|
|
2759
3105
|
: allNodes.length === 0
|
|
@@ -2768,12 +3114,18 @@ window.__ModuleLoader__.load({
|
|
|
2768
3114
|
rfRef.current = instance
|
|
2769
3115
|
},
|
|
2770
3116
|
onNodesChange,
|
|
2771
|
-
nodes:
|
|
2772
|
-
edges:
|
|
3117
|
+
nodes: visibleNodes,
|
|
3118
|
+
edges: visibleEdges,
|
|
3119
|
+
edgeTypes: relationshipEdgeTypes,
|
|
2773
3120
|
onNodeClick,
|
|
2774
3121
|
onEdgeClick,
|
|
2775
3122
|
onPaneClick: () => setPicked(null),
|
|
2776
3123
|
fitView: true,
|
|
3124
|
+
fitViewOptions: { minZoom: 0.8, maxZoom: 1.1, padding: 0.18 },
|
|
3125
|
+
deleteKeyCode: null,
|
|
3126
|
+
onMoveEnd: (_event, viewport) => setZoom(viewport.zoom),
|
|
3127
|
+
onNodeKeyDown: (event, node) => { if (event.key === 'Enter' || event.key === ' ') { event.preventDefault(); onNodeClick(event, node) } },
|
|
3128
|
+
ariaLabelConfig: { 'node.a11yDescription.default': t('按 Enter 或空格查看详情,方向键移动节点。'), 'edge.a11yDescription.default': t('按 Enter 或空格查看关系详情。'), 'controls.zoomIn.ariaLabel': t('放大'), 'controls.zoomOut.ariaLabel': t('缩小'), 'controls.fitView.ariaLabel': t('适配') },
|
|
2777
3129
|
minZoom: 0.2,
|
|
2778
3130
|
maxZoom: 3,
|
|
2779
3131
|
proOptions: { hideAttribution: true },
|
|
@@ -2785,7 +3137,7 @@ window.__ModuleLoader__.load({
|
|
|
2785
3137
|
zoomOnScroll: true,
|
|
2786
3138
|
zoomOnDoubleClick: false,
|
|
2787
3139
|
},
|
|
2788
|
-
h(XYFlow.Controls, { showInteractive: false }),
|
|
3140
|
+
h(XYFlow.Controls, { showInteractive: false, showFitView: false }),
|
|
2789
3141
|
h(XYFlow.Background, { variant: 'dots', gap: 22, size: 1, color: 'var(--dsw-alias-border-l2)' }),
|
|
2790
3142
|
),
|
|
2791
3143
|
),
|
|
@@ -2795,9 +3147,23 @@ window.__ModuleLoader__.load({
|
|
|
2795
3147
|
'div',
|
|
2796
3148
|
{ className: 'clearai-graph-side' },
|
|
2797
3149
|
picked.kind === 'node' && picked.node.layer === 'entity' && picked.node.kind === 'instance' ? h(EntityCard, { node: picked.node, data, send, sent: asked, onSent: (key, kind) => setAsked({ ...asked, [key]: kind }) }) : null,
|
|
2798
|
-
h(GraphInspector, { selection: inspection, sessionId, names: entityNames, onFilter: () => onFilter(filterTarget), onClose: () => setPicked(null) }),
|
|
3150
|
+
h(GraphInspector, { selection: inspection, sessionId, names: entityNames, onFilter: () => { if (filterTarget) onFilter?.(filterTarget) }, onClose: () => setPicked(null) }),
|
|
2799
3151
|
),
|
|
2800
3152
|
),
|
|
3153
|
+
h('div', { className: 'clearai-map-footer' },
|
|
3154
|
+
h('div', { className: 'clearai-legend' },
|
|
3155
|
+
h('span', { 'data-l': 'solid' }, t(layer === 'ontology' ? '结构定义' : '已验证')),
|
|
3156
|
+
h('span', { 'data-l': 'dash' }, t(layer === 'ontology' ? '层级关系' : '待核验')),
|
|
3157
|
+
conflicts.length ? h('span', { 'data-l': 'warn' }, `${t('矛盾')} ${conflicts.length}`) : null),
|
|
3158
|
+
h('span', { className: 'clearai-map-size' }, `${visibleNodes.length} ${t('个对象')} · ${visibleEdges.length} ${t('条连接')}`),
|
|
3159
|
+
h('div', { className: 'clearai-map-actions' },
|
|
3160
|
+
selectedId ? h('button', { type: 'button', className: 'clearai-link', 'aria-pressed': neighbors, onClick: () => setNeighbors(!neighbors) }, t('邻域')) : null,
|
|
3161
|
+
selectedId ? h('button', { type: 'button', className: 'clearai-link', onClick: focusPicked }, t('聚焦所选')) : null,
|
|
3162
|
+
h('span', { className: 'clearai-map-zoom' }, `${Math.round(zoom * 100)}%`),
|
|
3163
|
+
h('button', { type: 'button', className: 'clearai-link', onClick: fit }, t('概览')),
|
|
3164
|
+
),
|
|
3165
|
+
),
|
|
3166
|
+
|
|
2801
3167
|
/** 读时的跨文件检查只标不拦:有问题的那一份不进图,这里说清是哪个文件、哪里不对。 */
|
|
2802
3168
|
problems.length === 0
|
|
2803
3169
|
? null
|