clearai-dsh 0.5.0 → 0.5.2
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 +54 -0
- package/README.md +36 -11
- package/README.zh-CN.md +36 -11
- package/brand/README.md +4 -0
- package/lib/client.js +774 -206
- package/lib/domain-language.js +52 -5
- package/lib/fold.js +432 -11
- package/lib/knowledge-view.js +57 -28
- package/lib/scope.js +128 -0
- package/package.json +1 -1
- package/presets/clearai/agent.cordis.yml +3 -5
- package/presets/clearai/clearai.patch.yml +3 -5
- package/presets/clearai/plugins/audit-material.js +59 -0
- package/presets/clearai/plugins/audit-schema.js +25 -0
- package/presets/clearai/plugins/clearai-kernel.js +1220 -282
- package/presets/clearai/plugins/knowledge-items.js +178 -0
- package/presets/clearai/plugins/models.js +77 -0
- package/presets/clearai/plugins/prompts.js +34 -48
- package/presets/clearai/plugins/scope.js +128 -0
- package/presets/clearai/skills/clearai-loop/SKILL.md +1 -1
package/lib/client.js
CHANGED
|
@@ -82,11 +82,11 @@ var Wt=Object.create;var Le=Object.defineProperty;var Pt=Object.getOwnPropertyDe
|
|
|
82
82
|
* clearai-dsh —— 浏览器半(ClearAI 的面板)。
|
|
83
83
|
*
|
|
84
84
|
* 它注册三个座位:
|
|
85
|
-
* 中栏 `conversation.view`
|
|
86
|
-
*
|
|
87
|
-
* 输入框 `conversation.input` 计划芯片(
|
|
85
|
+
* 中栏 `conversation.view` 探索(问题 → 候选假设 → 下一步;过程记录里有判断列表与计划的世界树)
|
|
86
|
+
* 中栏 `conversation.view` 本体(结论四部分 + 本体图 / 实体图 + 已确立的事实 + 经验)
|
|
87
|
+
* 输入框 `conversation.input` 计划芯片(「问题 1/2 · 待检验假设 N 个」+ 「待处理 N」,点击打开探索货架)
|
|
88
88
|
* 交付与文件改动走 DSH 原生的卡片,技能走原生技能目录,这里都不另做一份。
|
|
89
|
-
*
|
|
89
|
+
* 面板**只读**:没有写入口。要人拍板的事由开门的那次工具调用当场问人;「立为问题 / 暂缓」只替人往对话里发一句话。
|
|
90
90
|
*
|
|
91
91
|
* 面板自己不取数、不重算:宿主半注册的**会话投影单元** `clearai`(见 `lib/index.js`)把算好的
|
|
92
92
|
* 视图推下来,`useProjection('clearai')` 读它。投影为空(`undefined`)时渲染平静的空态,
|
|
@@ -185,8 +185,8 @@ window.__ModuleLoader__.load({
|
|
|
185
185
|
|
|
186
186
|
/** 语言命名空间。表按**源文**索引:键就是中文原文,所以漏翻译一条只会退回中文,不会把 key 显示给人。 */
|
|
187
187
|
const LOCALE_NS = 'clearai'
|
|
188
|
-
const LOCALE_ZH = {":":":","
|
|
189
|
-
const LOCALE_EN = {":":": "," ·
|
|
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: "}
|
|
190
190
|
|
|
191
191
|
/**
|
|
192
192
|
* 翻译函数:**由原生 locale 座位绑定**(`ctx.locale.bind`),不是我们自建的一套 i18n。
|
|
@@ -220,7 +220,7 @@ window.__ModuleLoader__.load({
|
|
|
220
220
|
* 依赖的客户端服务,**必须全部声明在这里**。
|
|
221
221
|
*
|
|
222
222
|
* 这不是洁癖,是行为约束:客户端模块在 `slots` 一出现就被激活
|
|
223
|
-
* (`slots` 是平台 seed,启动时就有),而 `sessions` / `
|
|
223
|
+
* (`slots` 是平台 seed,启动时就有),而 `sessions` / `sidebarRight` 是**后来**
|
|
224
224
|
* 才由各自的插件 `provide` 的。只声明 `slots` 的话,我们的 `apply()` 会在它们之前跑,
|
|
225
225
|
* 读不到会话服务 → 早退 → **一个插座都不注册**,而且不报错:右栏只剩宿主自带的「文件」,
|
|
226
226
|
* 中栏没有「产物」。宿主那侧一切正常(模块图里有我们、bundle 正常送达),
|
|
@@ -229,9 +229,9 @@ window.__ModuleLoader__.load({
|
|
|
229
229
|
* 声明之后 Cordis 会把插件**挂起**到这些服务就位再激活(原生插件同样是这么写的,
|
|
230
230
|
* 例如 `dsh-client-ui-sidebar-files` 声明 slots + sidebarRightTabs + remote + locale)。
|
|
231
231
|
*/
|
|
232
|
-
const inject = ['slots', 'sessions', '
|
|
232
|
+
const inject = ['slots', 'sessions', 'sidebarRight']
|
|
233
233
|
|
|
234
|
-
const STEP = lazyTable(() => ({ open: t('
|
|
234
|
+
const STEP = lazyTable(() => ({ open: t('待执行'), advanced: t('已交付'), void: t('已作废') }))
|
|
235
235
|
const VERDICT = lazyTable(() => ({ support: t('支持'), refute: t('推翻'), inconclusive: t('不确定') }))
|
|
236
236
|
|
|
237
237
|
/** 「第 n 步」:整句做一个词条,英文才排得成 Step n。 */
|
|
@@ -392,6 +392,106 @@ window.__ModuleLoader__.load({
|
|
|
392
392
|
.clearai-kv>span:nth-child(odd){color:var(--dsw-alias-label-tertiary)}
|
|
393
393
|
.clearai-chips{display:inline-flex;gap:6px;flex-wrap:wrap}
|
|
394
394
|
.clearai-quiet{color:var(--dsw-alias-label-secondary);font-size:12.5px;padding:6px 0}
|
|
395
|
+
/* ── 探索货架:问题 → 候选假设 → 下一步;过程记录默认折叠。颜色只用主题令牌。 ── */
|
|
396
|
+
.clearai-head-kind{font-size:11.5px;color:var(--dsw-alias-label-tertiary)}
|
|
397
|
+
.clearai-pills{display:flex;flex-wrap:wrap;gap:6px;font-size:12px}
|
|
398
|
+
.clearai-pill{padding:1px 10px;border-radius:999px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary)}
|
|
399
|
+
.clearai-waiting{display:flex;flex-wrap:wrap;gap:6px 12px;align-items:baseline;padding:8px 12px;margin-bottom:14px;border-radius:8px;border:.5px solid var(--dsw-alias-state-warn-primary);background:var(--dsw-alias-bg-layer-1);font-size:12.5px}
|
|
400
|
+
.clearai-waiting b{color:var(--dsw-alias-state-warn-primary);font-weight:600}
|
|
401
|
+
.clearai-box{display:flex;flex-direction:column;margin-bottom:14px;border:.5px solid var(--dsw-alias-border-l2);border-radius:10px;overflow:hidden}
|
|
402
|
+
.clearai-box-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 14px;padding:10px 14px;background:var(--dsw-alias-bg-layer-1)}
|
|
403
|
+
.clearai-box[data-compact="1"] .clearai-box-head{background:transparent}
|
|
404
|
+
.clearai-box-kind{font-size:11.5px;color:var(--dsw-alias-label-tertiary)}
|
|
405
|
+
.clearai-box-title{flex:1 1 220px;font-size:14px;font-weight:600}
|
|
406
|
+
.clearai-box-note{font-size:12px;color:var(--dsw-alias-label-secondary)}
|
|
407
|
+
.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)}
|
|
408
|
+
.clearai-parked{display:inline-flex;gap:8px;align-items:baseline}
|
|
409
|
+
.clearai-cand{border-top:.5px solid var(--dsw-alias-border-l1)}
|
|
410
|
+
.clearai-cand-head{width:100%;display:flex;flex-wrap:wrap;align-items:center;gap:4px 12px;padding:9px 14px;border:0;background:transparent;text-align:left;font:inherit;color:inherit;cursor:pointer}
|
|
411
|
+
.clearai-cand-head[data-static="1"]{cursor:default}
|
|
412
|
+
.clearai-cand-head:not([data-static="1"]):hover{background:var(--dsw-alias-interactive-bg-hover)}
|
|
413
|
+
.clearai-cand-name{font-weight:500}
|
|
414
|
+
.clearai-cand[data-s="excluded"] .clearai-cand-name{text-decoration:line-through;color:var(--dsw-alias-label-tertiary)}
|
|
415
|
+
.clearai-cand-note{flex:1 1 220px;min-width:0;font-size:12px;color:var(--dsw-alias-label-secondary)}
|
|
416
|
+
.clearai-cand-chevron{margin-left:auto;font-size:11.5px;color:var(--dsw-alias-label-tertiary)}
|
|
417
|
+
.clearai-cand-detail{display:flex;flex-direction:column;gap:3px;padding:0 14px 12px}
|
|
418
|
+
.clearai-kvrow{display:grid;grid-template-columns:64px 1fr;gap:10px;font-size:12.5px}
|
|
419
|
+
.clearai-kvrow>span:first-child{color:var(--dsw-alias-label-tertiary)}
|
|
420
|
+
.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}
|
|
421
|
+
.clearai-state[data-s="examining"],.clearai-state[data-s="in_progress"]{border-color:var(--dsw-alias-brand-primary);color:var(--dsw-alias-brand-primary)}
|
|
422
|
+
.clearai-state[data-s="excluded"]{border-color:var(--dsw-alias-state-error-primary);color:var(--dsw-alias-state-error-primary)}
|
|
423
|
+
.clearai-state[data-s="adopted"],.clearai-state[data-s="clear"]{background:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-primary);color:var(--dsw-alias-label-primary-inverted)}
|
|
424
|
+
.clearai-state[data-s="set_aside"]{border-style:dashed}
|
|
425
|
+
.clearai-emergent{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;margin:0 14px 10px;padding:8px 10px;border-radius:8px;border:.5px solid var(--dsw-alias-brand-primary);background:var(--dsw-alias-bg-layer-1)}
|
|
426
|
+
.clearai-emergent-kind{font-size:11.5px;font-weight:600;color:var(--dsw-alias-brand-primary)}
|
|
427
|
+
.clearai-emergent-text{flex:1 1 200px;font-weight:500}
|
|
428
|
+
.clearai-emergent-actions{display:inline-flex;gap:8px}
|
|
429
|
+
.clearai-emergent-done{margin:0 14px 10px;font-size:12px;color:var(--dsw-alias-label-secondary)}
|
|
430
|
+
.clearai-btn{min-height:30px;padding:0 12px;border-radius:8px;border:.5px solid var(--dsw-alias-border-l3);background:var(--dsw-alias-bg-base);color:var(--dsw-alias-label-primary);font:inherit;font-size:12.5px;cursor:pointer}
|
|
431
|
+
.clearai-btn[data-primary="1"]{background:var(--dsw-alias-brand-primary);border-color:var(--dsw-alias-brand-primary);color:#fff}
|
|
432
|
+
.clearai-next{display:flex;flex-direction:column;gap:8px;margin-bottom:14px;padding:12px 14px;border-radius:10px;border:.5px solid var(--dsw-alias-brand-primary);background:var(--dsw-alias-bg-layer-1)}
|
|
433
|
+
.clearai-next-head{display:flex;flex-wrap:wrap;gap:4px 12px;align-items:baseline}
|
|
434
|
+
.clearai-next-kind{font-size:11.5px;font-weight:600;color:var(--dsw-alias-brand-primary)}
|
|
435
|
+
.clearai-next-title{font-size:14px;font-weight:600}
|
|
436
|
+
.clearai-preds{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:8px}
|
|
437
|
+
.clearai-pred{padding:8px 10px;border-radius:8px;border:.5px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base)}
|
|
438
|
+
.clearai-pred-if{font-size:11.5px;color:var(--dsw-alias-label-secondary)}
|
|
439
|
+
.clearai-pred-value{font-size:13.5px;font-weight:600}
|
|
440
|
+
.clearai-next-note{font-size:12px;color:var(--dsw-alias-label-secondary)}
|
|
441
|
+
.clearai-next-warn{font-size:12px;color:var(--dsw-alias-state-warn-primary);font-weight:600}
|
|
442
|
+
.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}
|
|
443
|
+
.clearai-anomaly-meta{font-size:11.5px;color:var(--dsw-alias-label-tertiary)}
|
|
444
|
+
.clearai-process{border-top:.5px solid var(--dsw-alias-border-l2);padding-top:4px}
|
|
445
|
+
.clearai-process-head{width:100%;min-height:38px;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}
|
|
446
|
+
.clearai-process-head span{font-size:12px;color:var(--dsw-alias-label-secondary)}
|
|
447
|
+
.clearai-process-body{display:flex;flex-direction:column;gap:14px;padding:6px 0}
|
|
448
|
+
.clearai-judgments-head{display:flex;flex-direction:column;gap:4px}
|
|
449
|
+
/* 本体货架的结论卡:四部分 */
|
|
450
|
+
.clearai-answers{display:flex;flex-direction:column;gap:8px;margin-bottom:18px}
|
|
451
|
+
.clearai-qtab{min-height:28px;padding:0 12px;border-radius:999px;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}
|
|
452
|
+
.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)}
|
|
453
|
+
.clearai-answer{display:flex;flex-direction:column;border:.5px solid var(--dsw-alias-border-l2);border-radius:10px;overflow:hidden}
|
|
454
|
+
.clearai-answer-part{display:flex;flex-direction:column;gap:4px;padding:10px 14px;border-top:.5px solid var(--dsw-alias-border-l1)}
|
|
455
|
+
.clearai-answer-part:first-child{border-top:0}
|
|
456
|
+
.clearai-answer-part[data-warm="1"]{background:var(--dsw-alias-bg-layer-1)}
|
|
457
|
+
.clearai-answer-label{font-size:11.5px;font-weight:600;color:var(--dsw-alias-label-tertiary)}
|
|
458
|
+
.clearai-answer-part[data-warm="1"] .clearai-answer-label{color:var(--dsw-alias-state-warn-primary)}
|
|
459
|
+
.clearai-answer-main{font-size:15px;font-weight:600}
|
|
460
|
+
.clearai-answer-lines{display:flex;flex-direction:column;gap:3px;font-size:12.5px}
|
|
461
|
+
.clearai-lesson{display:flex;flex-wrap:wrap;gap:4px 10px;align-items:baseline;font-size:12.5px}
|
|
462
|
+
.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)}
|
|
463
|
+
.clearai-lesson-meta{font-size:11.5px;color:var(--dsw-alias-label-tertiary)}
|
|
464
|
+
/* 沉淀与取用:条目、实体卡、图上的计数 */
|
|
465
|
+
.clearai-kitem{display:flex;flex-direction:column;gap:3px;padding:7px 14px;border-top:.5px solid var(--dsw-alias-border-l1);font-size:12.5px}
|
|
466
|
+
.clearai-kitem-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px}
|
|
467
|
+
.clearai-kitem-meta{font-size:11.5px;color:var(--dsw-alias-label-tertiary)}
|
|
468
|
+
.clearai-kitem-asks{display:flex;flex-wrap:wrap;gap:6px}
|
|
469
|
+
.clearai-btn[data-small="1"]{min-height:24px;padding:0 9px;font-size:11.5px}
|
|
470
|
+
.clearai-state[data-s="preliminary_excluded"]{border-style:dashed;border-color:var(--dsw-alias-state-error-primary);color:var(--dsw-alias-state-error-primary)}
|
|
471
|
+
.clearai-state[data-s="established"],.clearai-state[data-s="applies"]{border-color:var(--dsw-alias-label-secondary);color:var(--dsw-alias-label-primary)}
|
|
472
|
+
.clearai-state[data-s="pending"],.clearai-state[data-s="undeclared"],.clearai-state[data-s="unscoped"]{border-style:dashed}
|
|
473
|
+
.clearai-state[data-s="bounded"],.clearai-state[data-s="out_of_scope"],.clearai-state[data-s="out_of_range"],.clearai-state[data-s="definition_changed"],.clearai-state[data-s="defect"]{border-color:var(--dsw-alias-state-warn-primary);color:var(--dsw-alias-state-warn-primary)}
|
|
474
|
+
.clearai-state[data-s="retracted"]{border-color:var(--dsw-alias-state-error-primary);color:var(--dsw-alias-state-error-primary)}
|
|
475
|
+
.clearai-state[data-s="unresolved"],.clearai-state[data-s="escalated"]{border-color:var(--dsw-alias-brand-primary);color:var(--dsw-alias-brand-primary)}
|
|
476
|
+
.clearai-ecard{display:flex;flex-direction:column;gap:6px;margin-bottom:10px;border:.5px solid var(--dsw-alias-border-l2);border-radius:10px;padding:10px 0 4px}
|
|
477
|
+
.clearai-ecard-title{display:flex;align-items:center;gap:8px;padding:0 14px;font-size:14px;font-weight:600}
|
|
478
|
+
.clearai-ecard-head{padding:4px 14px 2px;font-size:11.5px;font-weight:600;color:var(--dsw-alias-label-tertiary)}
|
|
479
|
+
.clearai-kcount{display:inline-flex;gap:2px;font-family:ui-sans-serif,system-ui,sans-serif}
|
|
480
|
+
.clearai-kcount>em{font-style:normal;font-size:10px;line-height:13px;padding:0 4px;border-radius:4px;border:.5px solid var(--dsw-alias-border-l3);color:var(--dsw-alias-label-secondary)}
|
|
481
|
+
.clearai-kcount>em[data-b="excluded"]{border-color:var(--dsw-alias-state-error-primary);color:var(--dsw-alias-state-error-primary)}
|
|
482
|
+
.clearai-kcount>em[data-b="bounded"]{border-color:var(--dsw-alias-state-warn-primary);color:var(--dsw-alias-state-warn-primary)}
|
|
483
|
+
.clearai-kcount>em[data-b="pending"]{border-style:dashed}
|
|
484
|
+
.clearai-kcount>em[data-b="unresolved"]{border-color:var(--dsw-alias-brand-primary);color:var(--dsw-alias-brand-primary)}
|
|
485
|
+
.clearai-kitem-head[data-click="1"]{cursor:pointer}
|
|
486
|
+
.clearai-ecard-fold>summary{padding:4px 14px;font-size:12px;color:var(--dsw-alias-label-secondary);cursor:pointer}
|
|
487
|
+
.clearai-kcount-legend{display:inline-flex;gap:8px;margin-left:6px}
|
|
488
|
+
.clearai-kcount-legend>span{display:inline-flex;align-items:center;gap:3px}
|
|
489
|
+
.clearai-kcount-legend em{display:inline-block;width:8px;height:8px;border-radius:2px;border:.5px solid var(--dsw-alias-border-l3)}
|
|
490
|
+
.clearai-kcount-legend em[data-b="excluded"]{border-color:var(--dsw-alias-state-error-primary)}
|
|
491
|
+
.clearai-kcount-legend em[data-b="bounded"]{border-color:var(--dsw-alias-state-warn-primary)}
|
|
492
|
+
.clearai-kcount-legend em[data-b="pending"]{border-style:dashed}
|
|
493
|
+
.clearai-kcount-legend em[data-b="unresolved"]{border-color:var(--dsw-alias-brand-primary)}
|
|
494
|
+
.clearai-settled{display:flex;flex-wrap:wrap;gap:4px 10px;align-items:baseline;padding:2px 2px 0;font-size:12.5px}
|
|
395
495
|
`
|
|
396
496
|
/** 把上面那段 CSS 挂进页面(带 data-plugin 标记,宿主按包名记账,卸载时收掉)。 */
|
|
397
497
|
function installStyles() {
|
|
@@ -583,7 +683,7 @@ window.__ModuleLoader__.load({
|
|
|
583
683
|
h(
|
|
584
684
|
'div',
|
|
585
685
|
{ style: S.head },
|
|
586
|
-
`${t('判据')} · ${criteriaLines.length}${history.length === 0 ? '' : `${t(' ·
|
|
686
|
+
`${t('判据')} · ${criteriaLines.length}${history.length === 0 ? '' : `${t(' · 已修订 ')}${history.length}${t(' 次')}${lastAudit === null || lastAudit === undefined ? '' : `${t(' · 最近一次修订的独立裁决:')}${String(lastAudit)}`}`}`,
|
|
587
687
|
),
|
|
588
688
|
...criteriaLines.map((line, index) => h('div', { key: `criteria-${index}`, style: S.criteriaRow }, `${index + 1}. ${line}`)),
|
|
589
689
|
// 全文的家与卡上那句指针是同一个路径(不各自拼一遍);沿用计划文档那条既有做法
|
|
@@ -606,7 +706,7 @@ window.__ModuleLoader__.load({
|
|
|
606
706
|
evaluation: t('评估'),
|
|
607
707
|
evidence: t('证据'),
|
|
608
708
|
fact: t('事实'),
|
|
609
|
-
release: t('
|
|
709
|
+
release: t('批准'),
|
|
610
710
|
anomaly: t('未解释'),
|
|
611
711
|
}))
|
|
612
712
|
|
|
@@ -748,22 +848,22 @@ window.__ModuleLoader__.load({
|
|
|
748
848
|
*/
|
|
749
849
|
const TRUST_ORDER = ['credible', 'pending', 'testing', 'unclear', 'refuted', 'replaced']
|
|
750
850
|
const TRUST_WORD = lazyTable(() => ({ credible: t('已验证'), pending: t('待核验'), testing: t('验证中'), unclear: t('不确定'), refuted: t('已推翻'), replaced: t('已替换') }))
|
|
751
|
-
const LEVEL_WORD = lazyTable(() => ({ L0: t('
|
|
851
|
+
const LEVEL_WORD = lazyTable(() => ({ L0: t('自行检验'), L1: t('自行检验'), L2: t('自行检验'), L3: t('独立核验'), L4: t('人工批准') }))
|
|
752
852
|
/** 进度轨的四站。顺序即一条结论要走的路。 */
|
|
753
|
-
const STATIONS = () => [t('判断'), t('检验'), t('已验证'), t('
|
|
853
|
+
const STATIONS = () => [t('判断'), t('检验'), t('已验证'), t('纳入本体')]
|
|
754
854
|
/** 还没走完时,下一步是什么(时间线末尾那条虚点)。 */
|
|
755
855
|
const NEXT_STEP = lazyTable(() => ({
|
|
756
|
-
testing: t('
|
|
757
|
-
pending: t('
|
|
758
|
-
unclear: t('
|
|
759
|
-
credible: t('
|
|
856
|
+
testing: t('下一步:安排步骤对其进行检验'),
|
|
857
|
+
pending: t('下一步:通过独立核验后标记为已验证'),
|
|
858
|
+
unclear: t('下一步:改用其他方法重新检验'),
|
|
859
|
+
credible: t('下一步:结案时写入长期知识'),
|
|
760
860
|
}))
|
|
761
861
|
/** 值的形态(本体图上的小方块):内部词换成人话。 */
|
|
762
|
-
const FORM_WORD = lazyTable(() => ({ statement: t('
|
|
763
|
-
const KIND_WORD = lazyTable(() => ({ concept: t('概念'), value_type: t('
|
|
862
|
+
const FORM_WORD = lazyTable(() => ({ statement: t('陈述'), quantity: t('数值'), formula: t('公式'), code: t('代码'), reference: t('引用') }))
|
|
863
|
+
const KIND_WORD = lazyTable(() => ({ concept: t('概念'), value_type: t('取值形态'), instance: t('实例'), literal: t('取值'), edge: t('关系') }))
|
|
764
864
|
|
|
765
865
|
/** 一步检验是怎么做的:独立核验直接说;自己做的,说到了哪一级(可复算 / 引用材料 / 推了一遍)。 */
|
|
766
|
-
const howOf = (row) => (row.evaluator === 'independent' ? t('独立核验') : (LEVEL_WORD[row.level] ?? t('
|
|
866
|
+
const howOf = (row) => (row.evaluator === 'independent' ? t('独立核验') : (LEVEL_WORD[row.level] ?? t('自行检验')))
|
|
767
867
|
|
|
768
868
|
/**
|
|
769
869
|
* **结论行的模型**(纯函数,导出给测试)。
|
|
@@ -856,7 +956,7 @@ window.__ModuleLoader__.load({
|
|
|
856
956
|
...names.map((_, index) => h('span', { key: `seg-${index}`, 'data-state': index < reached ? (stopped && index === reached - 1 ? 'broken' : 'done') : index === reached && !stopped ? 'next' : 'todo' })),
|
|
857
957
|
),
|
|
858
958
|
h('div', { className: 'clearai-stations-names' }, ...names.map((name, index) => h('span', { key: `name-${index}`, 'data-now': index === reached - 1 ? '1' : '0' }, name))),
|
|
859
|
-
stopped ? h('div', { className: 'clearai-stations-note' }, props.trust === 'refuted' ? t('
|
|
959
|
+
stopped ? h('div', { className: 'clearai-stations-note' }, props.trust === 'refuted' ? t('在检验阶段被推翻,不再推进。') : t('已被替换,不再推进。')) : null,
|
|
860
960
|
)
|
|
861
961
|
}
|
|
862
962
|
|
|
@@ -866,9 +966,9 @@ window.__ModuleLoader__.load({
|
|
|
866
966
|
const lines = rows.map((row, index) => {
|
|
867
967
|
let text = ''
|
|
868
968
|
if (row.kind === 'proposed') text = t('提出')
|
|
869
|
-
else if (row.kind === 'evidence') text = `${row.ordinal === null || row.ordinal === undefined ? t('
|
|
870
|
-
else if (row.kind === 'promoted') text = t('
|
|
871
|
-
else if (row.kind === 'retracted') text = `${t('
|
|
969
|
+
else if (row.kind === 'evidence') text = `${row.ordinal === null || row.ordinal === undefined ? t('单步检验') : `${nth(row.ordinal)}`}${t(':')}${VERDICT[row.verdict] ?? row.verdict} · ${howOf(row)}`
|
|
970
|
+
else if (row.kind === 'promoted') text = t('写入长期知识')
|
|
971
|
+
else if (row.kind === 'retracted') text = `${t('人工撤回')}${row.reason ? `:${brief(row.reason, 40)}` : ''}`
|
|
872
972
|
const moved = row.from !== undefined && row.from !== row.to
|
|
873
973
|
return h(
|
|
874
974
|
'div',
|
|
@@ -895,10 +995,10 @@ window.__ModuleLoader__.load({
|
|
|
895
995
|
'div',
|
|
896
996
|
{ className: 'clearai-detail' },
|
|
897
997
|
part(1, t('进度'), h(StationBar, { station: row.station, trust: row.trust })),
|
|
898
|
-
part(2, t('
|
|
998
|
+
part(2, t('可信度变化'), h(TrustTimeline, { history: row.history, station: row.station, trust: row.trust })),
|
|
899
999
|
part(
|
|
900
1000
|
3,
|
|
901
|
-
t('
|
|
1001
|
+
t('补充说明'),
|
|
902
1002
|
h(
|
|
903
1003
|
'div',
|
|
904
1004
|
{ className: 'clearai-kv' },
|
|
@@ -923,20 +1023,20 @@ window.__ModuleLoader__.load({
|
|
|
923
1023
|
onClick: () => (origin.session !== null && origin.kind === 'evaluator-session' ? data.openSpectator?.(origin.session) : data.openPreview?.(origin.path)),
|
|
924
1024
|
title: origin.path ?? '',
|
|
925
1025
|
},
|
|
926
|
-
origin.kind === 'audit-card' || origin.kind === 'evaluator-session' ? t('
|
|
1026
|
+
origin.kind === 'audit-card' || origin.kind === 'evaluator-session' ? t('查看核验') : t('查看记录'),
|
|
927
1027
|
),
|
|
928
1028
|
),
|
|
929
1029
|
),
|
|
930
1030
|
),
|
|
931
1031
|
...kv(t('范围'), row.scope === row.refuteWhen ? null : row.scope),
|
|
932
|
-
...kv(t('
|
|
1032
|
+
...kv(t('推翻条件'), row.refuteWhen),
|
|
933
1033
|
...kv(
|
|
934
1034
|
t('相关'),
|
|
935
1035
|
subjects.length === 0
|
|
936
1036
|
? null
|
|
937
|
-
: h('span', { className: 'clearai-chips' }, ...subjects.map((id) => h('span', { key: id, className: 'clearai-chip', onClick: () => props.onFocus?.(id), title: t('
|
|
1037
|
+
: h('span', { className: 'clearai-chips' }, ...subjects.map((id) => h('span', { key: id, className: 'clearai-chip', onClick: () => props.onFocus?.(id), title: t('在图中定位') }, labelOfEntity(data, id)))),
|
|
938
1038
|
),
|
|
939
|
-
...kv(t('
|
|
1039
|
+
...kv(t('来源'), row.step === null ? null : `${nth(row.step)}`),
|
|
940
1040
|
),
|
|
941
1041
|
),
|
|
942
1042
|
)
|
|
@@ -954,7 +1054,7 @@ window.__ModuleLoader__.load({
|
|
|
954
1054
|
{ className: 'clearai-row', 'data-open': open ? '1' : '0', 'data-trust': row.trust },
|
|
955
1055
|
h(
|
|
956
1056
|
'div',
|
|
957
|
-
{ className: 'clearai-row-head', onClick: () => props.onToggle(row.key), title: open ? t('收起') : t('
|
|
1057
|
+
{ className: 'clearai-row-head', onClick: () => props.onToggle(row.key), title: open ? t('收起') : t('点击查看进度与来源') },
|
|
958
1058
|
h(TrustTag, { trust: row.trust }),
|
|
959
1059
|
h('span', { className: 'clearai-row-title' }, title),
|
|
960
1060
|
sub === null ? null : h('span', { className: 'clearai-row-sub' }, sub),
|
|
@@ -967,7 +1067,7 @@ window.__ModuleLoader__.load({
|
|
|
967
1067
|
/** 结论列表:按可信度分组,空组不出现。 */
|
|
968
1068
|
function ConclusionList(props) {
|
|
969
1069
|
const rows = props.rows
|
|
970
|
-
if (rows.length === 0) return h('div', { className: 'clearai-quiet' }, t('
|
|
1070
|
+
if (rows.length === 0) return h('div', { className: 'clearai-quiet' }, props.empty ?? t('暂无结论。模型提出判断后,将在此逐条列出。'))
|
|
971
1071
|
return h(
|
|
972
1072
|
'div',
|
|
973
1073
|
{ className: 'clearai-list' },
|
|
@@ -984,31 +1084,13 @@ window.__ModuleLoader__.load({
|
|
|
984
1084
|
)
|
|
985
1085
|
}
|
|
986
1086
|
|
|
987
|
-
/** 页眉:在回答什么
|
|
1087
|
+
/** 页眉:在回答什么(计数、待处理与进度轨归探索货架)。 */
|
|
988
1088
|
function AtlasHeader(props) {
|
|
989
|
-
const { data
|
|
990
|
-
const live = rows.filter((row) => row.trust !== 'replaced')
|
|
991
|
-
const counts = TRUST_ORDER.filter((trust) => trust !== 'replaced')
|
|
992
|
-
.map((trust) => [trust, rows.filter((row) => row.trust === trust).length])
|
|
993
|
-
.filter(([, count]) => count > 0)
|
|
994
|
-
const stations = STATIONS().map((name, index) => [name, live.filter((row) => row.station >= index + 1).length])
|
|
995
|
-
const needYou = Array.isArray(data?.needYou) ? data.needYou : []
|
|
1089
|
+
const { data } = props
|
|
996
1090
|
return h(
|
|
997
1091
|
'div',
|
|
998
1092
|
{ className: 'clearai-head' },
|
|
999
|
-
h('div', { className: 'clearai-question', title: String(data?.goal?.claim ?? '') }, data?.goal ? String(data.knowledgeView?.goal?.headline ?? data.goal.claim ?? '') : t('
|
|
1000
|
-
counts.length === 0 ? null : h('div', { className: 'clearai-counts' }, counts.map(([trust, count]) => `${TRUST_WORD[trust]} ${count}`).join(' · ')),
|
|
1001
|
-
...needYou.map((item, index) => h('div', { key: `need-${index}`, className: 'clearai-need' }, h('b', null, t('待处理')), String(item?.text ?? ''))),
|
|
1002
|
-
live.length === 0
|
|
1003
|
-
? null
|
|
1004
|
-
: h(
|
|
1005
|
-
'div',
|
|
1006
|
-
{ className: 'clearai-track' },
|
|
1007
|
-
...stations.flatMap(([name, count], index) => [
|
|
1008
|
-
index === 0 ? null : h('span', { key: `line-${index}`, className: 'clearai-track-line', 'data-on': count > 0 ? '1' : '0' }),
|
|
1009
|
-
h('span', { key: `st-${index}`, className: 'clearai-track-stop', 'data-on': count > 0 ? '1' : '0' }, h('i', null), `${name} ${count}`),
|
|
1010
|
-
]),
|
|
1011
|
-
),
|
|
1093
|
+
h('div', { className: 'clearai-question', title: String(data?.goal?.claim ?? '') }, data?.goal ? String(data.knowledgeView?.goal?.headline ?? data.goal.claim ?? '') : t('尚未设立目标')),
|
|
1012
1094
|
)
|
|
1013
1095
|
}
|
|
1014
1096
|
|
|
@@ -1031,10 +1113,11 @@ window.__ModuleLoader__.load({
|
|
|
1031
1113
|
installStyles()
|
|
1032
1114
|
}, [])
|
|
1033
1115
|
if (projected === undefined || projected === null) {
|
|
1034
|
-
return h('div', { className: 'clearai-atlas' }, h(Empty, null, t('
|
|
1116
|
+
return h('div', { className: 'clearai-atlas' }, h(Empty, null, t('暂无内容。发送第一条消息后,此处将显示本体图与结论。')))
|
|
1035
1117
|
}
|
|
1036
|
-
const data = { ...projected, openPreview: props.openPreview,
|
|
1037
|
-
|
|
1118
|
+
const data = { ...projected, openPreview: props.openPreview, openSpectator: props.openSpectator }
|
|
1119
|
+
/** 本体货架只放结果:已确立的事实(判断的全部过程在探索货架的「过程记录」里)。 */
|
|
1120
|
+
const rows = conclusionsOf(data).filter((row) => row.trust === 'credible')
|
|
1038
1121
|
const lexicon = data.lexicon ?? null
|
|
1039
1122
|
/** 世界树那边点进来的聚焦优先;手动点行仍然有效。 */
|
|
1040
1123
|
const focused = incoming === null || incoming === undefined ? null : propositionForStep(data, incoming.step)
|
|
@@ -1046,9 +1129,12 @@ window.__ModuleLoader__.load({
|
|
|
1046
1129
|
return h(
|
|
1047
1130
|
'div',
|
|
1048
1131
|
{ className: 'clearai-atlas' },
|
|
1049
|
-
h(AtlasHeader, { data
|
|
1132
|
+
h(AtlasHeader, { data }),
|
|
1133
|
+
h(AnswerCards, { data, openExplore: props.openExplore }),
|
|
1050
1134
|
h(GraphBand, {
|
|
1051
1135
|
lexicon,
|
|
1136
|
+
data,
|
|
1137
|
+
send: props.send,
|
|
1052
1138
|
layer,
|
|
1053
1139
|
unlanded: typeof unlandedRow?.count === 'number' ? unlandedRow.count : null,
|
|
1054
1140
|
onLayer: setLayer,
|
|
@@ -1063,12 +1149,13 @@ window.__ModuleLoader__.load({
|
|
|
1063
1149
|
: h(
|
|
1064
1150
|
'div',
|
|
1065
1151
|
{ className: 'clearai-filter' },
|
|
1066
|
-
`${t('
|
|
1152
|
+
`${t('仅显示与「')}${String(filterTerm.label ?? filterTerm.id)}${t('」相关的内容')}${t(':')}${shown.length}/${rows.length}`,
|
|
1067
1153
|
h('span', { className: 'clearai-link', onClick: () => setFilter(null) }, t('清除')),
|
|
1068
1154
|
),
|
|
1069
|
-
h('div', { className: 'clearai-section-head' }, t('
|
|
1155
|
+
h('div', { className: 'clearai-section-head' }, t('已确立的事实')),
|
|
1070
1156
|
h(ConclusionList, {
|
|
1071
1157
|
rows: shown,
|
|
1158
|
+
empty: t('暂无已确立的事实。判断经检验与独立核验后,将在此列出;检验过程见探索货架。'),
|
|
1072
1159
|
open,
|
|
1073
1160
|
data,
|
|
1074
1161
|
onToggle: (key) => {
|
|
@@ -1083,6 +1170,540 @@ window.__ModuleLoader__.load({
|
|
|
1083
1170
|
}
|
|
1084
1171
|
},
|
|
1085
1172
|
}),
|
|
1173
|
+
(data.lessons ?? []).length === 0 ? null : h('div', { className: 'clearai-section-head' }, `${t('经验(')}${data.lessons.length}${t(')')}`),
|
|
1174
|
+
h(LessonList, { data }),
|
|
1175
|
+
)
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
/**
|
|
1179
|
+
* **探索货架**(中栏视图,紧挨「本体」):过程在这里,结果在本体货架。
|
|
1180
|
+
*
|
|
1181
|
+
* 主轴是 问题 → 候选假设(定向求解)或 调研板块 → 新发现的问题(广度调研),
|
|
1182
|
+
* 读的是宿主算好的 `exploration`(与运行态卡上「当前位置」同一份派生)。
|
|
1183
|
+
* 候选的状态只从证据来;界面不写任何状态。「立为问题 / 暂缓」两个按钮只是**替人发一句话**
|
|
1184
|
+
* 给模型,由模型用 Frame 修订落账——与「要改什么就在对话里说」是同一条路。
|
|
1185
|
+
*/
|
|
1186
|
+
const MODE_WORD = lazyTable(() => ({ survey: t('广度调研'), solve: t('定向求解'), survey_then_solve: t('先调研后求解') }))
|
|
1187
|
+
const CANDIDATE_WORD = lazyTable(() => ({ examining: t('考察中'), excluded: t('已排除'), adopted: t('已采纳'), set_aside: t('暂不考察') }))
|
|
1188
|
+
const AREA_WORD = lazyTable(() => ({ not_started: t('未开始'), in_progress: t('调研中'), clear: t('已厘清') }))
|
|
1189
|
+
const LESSON_WORD = lazyTable(() => ({ trap: t('常见误区'), check: t('前置核查'), shortcut: t('不可取的捷径'), prior: t('先验知识') }))
|
|
1190
|
+
|
|
1191
|
+
|
|
1192
|
+
/** 一条候选最近一条某种结论的依据(排除依据 / 采纳依据都从证据里来)。 */
|
|
1193
|
+
const latestBasis = (data, hypothesis, verdict) => {
|
|
1194
|
+
const rows = (Array.isArray(data?.evidence) ? data.evidence : []).filter((item) => item.hypothesis === hypothesis && item.verdict === verdict)
|
|
1195
|
+
return rows.length === 0 ? null : String(rows[rows.length - 1].basis ?? '') || null
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
/** 候选假设展开后的几行(标签按界面用语规范:引用的已有知识 / 主张 / 推翻条件 / 预测 / 排除依据 / 采纳依据 / 关联记录)。 */
|
|
1199
|
+
function candidateDetail(data, candidate, prediction) {
|
|
1200
|
+
const rows = []
|
|
1201
|
+
const push = (label, value) => {
|
|
1202
|
+
if (value !== null && value !== undefined && value !== '') rows.push([label, value])
|
|
1203
|
+
}
|
|
1204
|
+
/** 引用的已有条目与系统的判定(取代原来的「提出依据」):判断写了 `uses` 才有。 */
|
|
1205
|
+
const hypothesis = (Array.isArray(data?.goal?.hypotheses) ? data.goal.hypotheses : []).find((item) => item.id === candidate.id)
|
|
1206
|
+
const uses = Array.isArray(hypothesis?.uses) ? hypothesis.uses : []
|
|
1207
|
+
const byKey = itemsByKey(data)
|
|
1208
|
+
push(t('引用的已有知识'), uses.length === 0 ? null : uses.map((use) => `${byKey.get(`${use.kind}:${use.id}`)?.text ? brief(byKey.get(`${use.kind}:${use.id}`).text, 40) : use.id}(${VERDICT_WORD[use.verdict] ?? use.verdict})`).join(t('、')))
|
|
1209
|
+
push(t('主张'), candidate.claim !== candidate.name ? candidate.claim : null)
|
|
1210
|
+
push(t('推翻条件'), candidate.refuteWhen)
|
|
1211
|
+
push(t('预测'), prediction)
|
|
1212
|
+
if (candidate.state === 'excluded') push(t('排除依据'), latestBasis(data, candidate.id, 'refute'))
|
|
1213
|
+
if (candidate.state === 'adopted') push(t('采纳依据'), latestBasis(data, candidate.id, 'support'))
|
|
1214
|
+
const support = (Array.isArray(data?.evidence) ? data.evidence : []).filter((item) => item.hypothesis === candidate.id && item.verdict === 'support').length
|
|
1215
|
+
push(t('关联记录'), `${t('支持 ')}${support}${t(' 条 · 推翻 ')}${candidate.refutations}${t(' 条 · 无法判定 ')}${candidate.inconclusive}${t(' 条')}`)
|
|
1216
|
+
return rows
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
/** 状态小签:候选与板块各用自己的一套词,颜色按状态族走(进行中 / 否定 / 肯定 / 搁置)。 */
|
|
1220
|
+
function StateTag(props) {
|
|
1221
|
+
return h('span', { className: 'clearai-state', 'data-s': props.state }, props.children)
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
/** 一个问题:标题、计数、候选列表(可展开)、暂不考察的放在页脚。 */
|
|
1225
|
+
function QuestionBox(props) {
|
|
1226
|
+
const { data, question, index, next, open, onToggle } = props
|
|
1227
|
+
const shown = question.candidates.filter((candidate) => candidate.state !== 'set_aside')
|
|
1228
|
+
const parked = question.candidates.filter((candidate) => candidate.state === 'set_aside')
|
|
1229
|
+
const counts = ['examining', 'excluded', 'adopted'].filter((key) => (question.counts?.[key] ?? 0) > 0).map((key) => `${CANDIDATE_WORD[key]} ${question.counts[key]}`)
|
|
1230
|
+
const predictionOf = (id) => (next?.predictions ?? []).find((item) => item.hypothesis === id)?.expect ?? null
|
|
1231
|
+
const status =
|
|
1232
|
+
question.status === 'answered'
|
|
1233
|
+
? h('span', { className: 'clearai-link', onClick: () => props.openFacts?.(), title: t('在本体货架中展开此结论') }, t('已得出结论 · 查看结论'))
|
|
1234
|
+
: question.status === 'parked'
|
|
1235
|
+
? h('span', null, t('已暂缓'))
|
|
1236
|
+
: question.status === 'emergent'
|
|
1237
|
+
? h('span', null, t('新发现,待您决定'))
|
|
1238
|
+
: h('span', null, shown.length === 0 ? t('尚无候选假设') : `${t('候选假设 ')}${question.candidates.length}${t(' 个:')}${counts.join(' · ')}`)
|
|
1239
|
+
const compact = shown.length === 0 && question.status !== 'emergent'
|
|
1240
|
+
return h(
|
|
1241
|
+
'section',
|
|
1242
|
+
{ className: 'clearai-box', 'data-compact': compact ? '1' : '0', 'data-current': props.current ? '1' : '0' },
|
|
1243
|
+
h(
|
|
1244
|
+
'div',
|
|
1245
|
+
{ className: 'clearai-box-head' },
|
|
1246
|
+
question.implicit ? null : h('span', { className: 'clearai-box-kind' }, `${t('问题 ')}${index + 1}`),
|
|
1247
|
+
h('span', { className: 'clearai-box-title' }, question.implicit ? t('候选假设') : question.text),
|
|
1248
|
+
h('span', { className: 'clearai-box-note' }, status),
|
|
1249
|
+
),
|
|
1250
|
+
question.status === 'emergent' ? h(EmergentActions, { question, send: props.send, sent: props.sent, onSent: props.onSent }) : null,
|
|
1251
|
+
...shown.map((candidate) => {
|
|
1252
|
+
const isOpen = open === candidate.id
|
|
1253
|
+
return h(
|
|
1254
|
+
'div',
|
|
1255
|
+
{ key: candidate.id, className: 'clearai-cand', 'data-open': isOpen ? '1' : '0', 'data-s': candidate.state },
|
|
1256
|
+
h(
|
|
1257
|
+
'button',
|
|
1258
|
+
{ type: 'button', className: 'clearai-cand-head', 'aria-expanded': isOpen ? 'true' : 'false', onClick: () => onToggle(isOpen ? null : candidate.id) },
|
|
1259
|
+
h(StateTag, { state: candidate.state }, CANDIDATE_WORD[candidate.state] ?? candidate.state),
|
|
1260
|
+
h('span', { className: 'clearai-cand-name' }, candidate.name),
|
|
1261
|
+
candidate.claim !== candidate.name ? h('span', { className: 'clearai-cand-note' }, brief(candidate.claim, 80)) : null,
|
|
1262
|
+
h('span', { className: 'clearai-cand-chevron', 'aria-hidden': 'true' }, isOpen ? t('收起') : t('展开')),
|
|
1263
|
+
),
|
|
1264
|
+
isOpen
|
|
1265
|
+
? h(
|
|
1266
|
+
'div',
|
|
1267
|
+
{ className: 'clearai-cand-detail' },
|
|
1268
|
+
...candidateDetail(data, candidate, predictionOf(candidate.id)).map(([label, value]) => h('div', { key: label, className: 'clearai-kvrow' }, h('span', null, label), h('span', null, value))),
|
|
1269
|
+
)
|
|
1270
|
+
: null,
|
|
1271
|
+
)
|
|
1272
|
+
}),
|
|
1273
|
+
parked.length === 0
|
|
1274
|
+
? null
|
|
1275
|
+
: h(
|
|
1276
|
+
'div',
|
|
1277
|
+
{ className: 'clearai-box-foot' },
|
|
1278
|
+
...parked.map((candidate) => h('span', { key: candidate.id, className: 'clearai-parked' }, h(StateTag, { state: 'set_aside' }, CANDIDATE_WORD.set_aside), h('s', null, candidate.name))),
|
|
1279
|
+
),
|
|
1280
|
+
)
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
/**
|
|
1284
|
+
* 「立为问题 / 暂缓」:替人发一句话给模型(模型用 Frame 修订落账),界面自己不写状态。
|
|
1285
|
+
* 发不出去(拿不到会话的对话服务)就如实说请在对话中说明,不假装发了。
|
|
1286
|
+
*/
|
|
1287
|
+
function EmergentActions(props) {
|
|
1288
|
+
const { question } = props
|
|
1289
|
+
const sent = props.sent?.[question.id] ?? null
|
|
1290
|
+
if (sent === 'pursue') return h('div', { className: 'clearai-emergent-done' }, t('已请求立为问题,待模型修订立题后生效。'))
|
|
1291
|
+
if (sent === 'park') return h('div', { className: 'clearai-emergent-done' }, t('已请求暂缓,结案时列入「尚未确定的事项」。'))
|
|
1292
|
+
if (sent === 'failed') return h('div', { className: 'clearai-emergent-done' }, t('无法自动发送,请在对话中说明。'))
|
|
1293
|
+
const ask = (kind, text) => props.onSent?.(question.id, typeof props.send === 'function' && props.send(text) === true ? kind : 'failed')
|
|
1294
|
+
return h(
|
|
1295
|
+
'div',
|
|
1296
|
+
{ className: 'clearai-emergent' },
|
|
1297
|
+
h('span', { className: 'clearai-emergent-kind' }, t('新发现的问题')),
|
|
1298
|
+
h('span', { className: 'clearai-emergent-text' }, question.text),
|
|
1299
|
+
h(
|
|
1300
|
+
'span',
|
|
1301
|
+
{ className: 'clearai-emergent-actions' },
|
|
1302
|
+
h('button', { type: 'button', className: 'clearai-btn', 'data-primary': '1', onClick: () => ask('pursue', `${t('请将新发现的问题「')}${question.text}${t('」立为问题深入研究(问题 ')}${question.id}${t(')。')}`) }, t('立为问题')),
|
|
1303
|
+
h('button', { type: 'button', className: 'clearai-btn', onClick: () => ask('park', `${t('请暂缓问题「')}${question.text}${t('」(问题 ')}${question.id}${t('),结案时列入「尚未确定的事项」。')}`) }, t('暂缓')),
|
|
1304
|
+
),
|
|
1305
|
+
)
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
/** 广度调研:调研板块一行一个,板块下挂新发现的问题。 */
|
|
1309
|
+
function AreaBox(props) {
|
|
1310
|
+
const { exploration } = props
|
|
1311
|
+
const areas = exploration.areas ?? []
|
|
1312
|
+
const counts = ['clear', 'in_progress', 'not_started'].map((key) => [key, areas.filter((area) => area.state === key).length]).filter(([, count]) => count > 0)
|
|
1313
|
+
return h(
|
|
1314
|
+
'section',
|
|
1315
|
+
{ className: 'clearai-box' },
|
|
1316
|
+
h('div', { className: 'clearai-box-head' }, h('span', { className: 'clearai-box-title' }, t('调研板块')), h('span', { className: 'clearai-box-note' }, counts.map(([key, count]) => `${AREA_WORD[key]} ${count}`).join(' · '))),
|
|
1317
|
+
...areas.map((area) => {
|
|
1318
|
+
const emergent = (exploration.questions ?? []).filter((question) => question.area === area.id && question.status === 'emergent')
|
|
1319
|
+
const note = [`${t('判断 ')}${area.judgments}${t(' 条 · 已采纳 ')}${area.verified}${t(' 条')}`, area.openAnomalies > 0 ? `${t('未解释的现象 ')}${area.openAnomalies}${t(' 项')}` : null].filter((item) => item !== null).join(' · ')
|
|
1320
|
+
return h(
|
|
1321
|
+
'div',
|
|
1322
|
+
{ key: area.id, className: 'clearai-cand', 'data-s': area.state },
|
|
1323
|
+
h('div', { className: 'clearai-cand-head', 'data-static': '1' }, h(StateTag, { state: area.state }, AREA_WORD[area.state] ?? area.state), h('span', { className: 'clearai-cand-name' }, area.name), h('span', { className: 'clearai-cand-note' }, note)),
|
|
1324
|
+
...emergent.map((question) => h(EmergentActions, { key: question.id, question, send: props.send, sent: props.sent, onSent: props.onSent })),
|
|
1325
|
+
)
|
|
1326
|
+
}),
|
|
1327
|
+
)
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
/** 下一步:做什么,以及各候选的预测;预测相同就如实说这一步区分不了。 */
|
|
1331
|
+
function NextBox(props) {
|
|
1332
|
+
const next = props.next
|
|
1333
|
+
if (next === null || next === undefined) return null
|
|
1334
|
+
const predictions = Array.isArray(next.predictions) ? next.predictions : []
|
|
1335
|
+
return h(
|
|
1336
|
+
'section',
|
|
1337
|
+
{ className: 'clearai-next' },
|
|
1338
|
+
h('div', { className: 'clearai-next-head' }, h('span', { className: 'clearai-next-kind' }, t('下一步')), h('span', { className: 'clearai-next-title' }, `${nth(next.ordinal)}${t(':')}${next.do}`)),
|
|
1339
|
+
predictions.length === 0
|
|
1340
|
+
? next.expect
|
|
1341
|
+
? h('div', { className: 'clearai-next-note' }, `${t('预测:')}${next.expect}`)
|
|
1342
|
+
: null
|
|
1343
|
+
: h(
|
|
1344
|
+
'div',
|
|
1345
|
+
{ className: 'clearai-preds' },
|
|
1346
|
+
...predictions.map((item, index) => h('div', { key: `p-${index}`, className: 'clearai-pred' }, h('div', { className: 'clearai-pred-if' }, `${t('若「')}${item.name}${t('」成立,预测')}`), h('div', { className: 'clearai-pred-value' }, item.expect))),
|
|
1347
|
+
),
|
|
1348
|
+
next.indistinct === true
|
|
1349
|
+
? h('div', { className: 'clearai-next-warn' }, t('各候选假设的预测相同,此步骤无法区分它们。'))
|
|
1350
|
+
: h('div', { className: 'clearai-next-note' }, t('如需调整计划,请在对话中说明。')),
|
|
1351
|
+
)
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
/** 未解释的现象:开着的逐条列出(结案时必须写进「尚未确定的事项」或先有去处)。 */
|
|
1355
|
+
function AnomalyBox(props) {
|
|
1356
|
+
const open = (Array.isArray(props.data?.anomalies) ? props.data.anomalies : []).filter((item) => item.status === 'open')
|
|
1357
|
+
if (open.length === 0) return null
|
|
1358
|
+
return h(
|
|
1359
|
+
'section',
|
|
1360
|
+
{ className: 'clearai-box' },
|
|
1361
|
+
h('div', { className: 'clearai-box-head' }, h('span', { className: 'clearai-box-title' }, `${t('未解释的现象(')}${open.length}${t(')')}`), h('span', { className: 'clearai-box-note' }, t('结案前须解释、排除或写入「尚未确定的事项」'))),
|
|
1362
|
+
...open.map((item) =>
|
|
1363
|
+
h(
|
|
1364
|
+
'div',
|
|
1365
|
+
{ key: item.id, className: 'clearai-anomaly' },
|
|
1366
|
+
h('span', null, item.what),
|
|
1367
|
+
item.by === 'evaluator' ? h('span', { className: 'clearai-anomaly-meta' }, t('独立评估发现')) : null,
|
|
1368
|
+
(item.touches ?? []).length > 0 ? h('span', { className: 'clearai-anomaly-meta' }, `${t('涉及:')}${item.touches.join(t('、'))}`) : null,
|
|
1369
|
+
),
|
|
1370
|
+
),
|
|
1371
|
+
)
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
/** 判断的计数与四站进度轨(原在本体货架页眉;过程信息归探索货架)。 */
|
|
1375
|
+
function JudgmentSummary(props) {
|
|
1376
|
+
const rows = props.rows
|
|
1377
|
+
const live = rows.filter((row) => row.trust !== 'replaced')
|
|
1378
|
+
const counts = TRUST_ORDER.filter((trust) => trust !== 'replaced')
|
|
1379
|
+
.map((trust) => [trust, rows.filter((row) => row.trust === trust).length])
|
|
1380
|
+
.filter(([, count]) => count > 0)
|
|
1381
|
+
const stations = STATIONS().map((name, index) => [name, live.filter((row) => row.station >= index + 1).length])
|
|
1382
|
+
return h(
|
|
1383
|
+
'div',
|
|
1384
|
+
{ className: 'clearai-judgments-head' },
|
|
1385
|
+
counts.length === 0 ? null : h('div', { className: 'clearai-counts' }, counts.map(([trust, count]) => `${TRUST_WORD[trust]} ${count}`).join(' · ')),
|
|
1386
|
+
live.length === 0
|
|
1387
|
+
? null
|
|
1388
|
+
: h(
|
|
1389
|
+
'div',
|
|
1390
|
+
{ className: 'clearai-track' },
|
|
1391
|
+
...stations.flatMap(([name, count], index) => [
|
|
1392
|
+
index === 0 ? null : h('span', { key: `line-${index}`, className: 'clearai-track-line', 'data-on': count > 0 ? '1' : '0' }),
|
|
1393
|
+
h('span', { key: `st-${index}`, className: 'clearai-track-stop', 'data-on': count > 0 ? '1' : '0' }, h('i', null), `${name} ${count}`),
|
|
1394
|
+
]),
|
|
1395
|
+
),
|
|
1396
|
+
)
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
function ExploreView(props) {
|
|
1400
|
+
const projected = typeof props.useProjection === 'function' ? props.useProjection('clearai') : undefined
|
|
1401
|
+
const [open, setOpen] = React.useState(null)
|
|
1402
|
+
const [processOpen, setProcessOpen] = React.useState(false)
|
|
1403
|
+
const [manual, setManual] = React.useState(null)
|
|
1404
|
+
const [sent, setSent] = React.useState({})
|
|
1405
|
+
const incoming = useFocus(factsFocus)
|
|
1406
|
+
React.useEffect(() => {
|
|
1407
|
+
installStyles()
|
|
1408
|
+
}, [])
|
|
1409
|
+
if (projected === undefined || projected === null) return h('div', { className: 'clearai-atlas' }, h(Empty, null, t('暂无内容。发送第一条消息后,此处将显示问题、候选假设与下一步。')))
|
|
1410
|
+
const data = { ...projected, openPreview: props.openPreview, openSpectator: props.openSpectator }
|
|
1411
|
+
const exploration = data.exploration ?? null
|
|
1412
|
+
const goal = data.goal ?? null
|
|
1413
|
+
const rows = conclusionsOf(data)
|
|
1414
|
+
const openFacts = () => props.openFacts?.()
|
|
1415
|
+
const onSent = (id, kind) => setSent({ ...sent, [id]: kind })
|
|
1416
|
+
const focused = incoming === null || incoming === undefined ? null : propositionForStep(data, incoming.step)
|
|
1417
|
+
const opened = focused ?? manual
|
|
1418
|
+
const showProcess = processOpen || focused !== null
|
|
1419
|
+
if (goal === null) {
|
|
1420
|
+
return h('div', { className: 'clearai-atlas' }, h(Empty, null, t('尚未设立目标。模型立题后,此处将显示问题、候选假设与下一步。')))
|
|
1421
|
+
}
|
|
1422
|
+
const questions = Array.isArray(exploration?.questions) ? exploration.questions : []
|
|
1423
|
+
const declared = questions.filter((question) => !question.implicit)
|
|
1424
|
+
const areas = Array.isArray(exploration?.areas) ? exploration.areas : []
|
|
1425
|
+
const currentIndex = declared.findIndex((question) => question.id === exploration?.current)
|
|
1426
|
+
const plan = data.plan ?? null
|
|
1427
|
+
const steps = plan === null ? [] : (plan.steps ?? []).filter((step) => step.status !== 'void')
|
|
1428
|
+
const doneSteps = steps.filter((step) => step.status === 'advanced').length
|
|
1429
|
+
const chips = [
|
|
1430
|
+
exploration?.mode ? `${t('阶段 · ')}${MODE_WORD[exploration.mode] ?? exploration.mode}` : null,
|
|
1431
|
+
areas.length > 0 ? `${t('调研板块 ')}${areas.length}${t(' 个 · 已厘清 ')}${areas.filter((area) => area.state === 'clear').length}${t(' 个')}` : null,
|
|
1432
|
+
declared.length > 0 && currentIndex >= 0 ? `${t('当前问题 ')}${currentIndex + 1}${t(' / 共 ')}${declared.length}` : null,
|
|
1433
|
+
steps.length > 0 ? `${t('计划 已完成 ')}${doneSteps}${t(' / ')}${steps.length}${t(' 步')}` : null,
|
|
1434
|
+
].filter((item) => item !== null)
|
|
1435
|
+
const needYou = Array.isArray(data.needYou) ? data.needYou : []
|
|
1436
|
+
const audits = (Array.isArray(data.audits) ? data.audits : []).length
|
|
1437
|
+
const openAnomalies = (Array.isArray(data.anomalies) ? data.anomalies : []).filter((item) => item.status === 'open').length
|
|
1438
|
+
const running = steps.find((step) => step.status === 'open') ?? null
|
|
1439
|
+
const summary = [`${t('判断 ')}${rows.length}${t(' 条')}`, `${t('独立评估 ')}${audits}${t(' 次')}`, `${t('未解释的现象 ')}${openAnomalies}${t(' 项')}`, steps.length > 0 ? `${t('计划共 ')}${steps.length}${t(' 步')}${running === null ? '' : `${t('(')}${nth(running.ordinal)}${t('进行中)')}`}` : null].filter((item) => item !== null).join(' · ')
|
|
1440
|
+
const questionList = questions.filter((question) => question.implicit || question.area === null || question.area === undefined || question.status !== 'emergent')
|
|
1441
|
+
return h(
|
|
1442
|
+
'div',
|
|
1443
|
+
{ className: 'clearai-atlas' },
|
|
1444
|
+
h(
|
|
1445
|
+
'div',
|
|
1446
|
+
{ className: 'clearai-head' },
|
|
1447
|
+
h('div', { className: 'clearai-head-kind' }, t('课题')),
|
|
1448
|
+
h('div', { className: 'clearai-question', title: String(goal.claim ?? '') }, String(goal.headline ?? data.knowledgeView?.goal?.headline ?? goal.claim ?? '')),
|
|
1449
|
+
chips.length === 0 ? null : h('div', { className: 'clearai-pills' }, ...chips.map((chip, index) => h('span', { key: `c-${index}`, className: 'clearai-pill' }, chip))),
|
|
1450
|
+
),
|
|
1451
|
+
needYou.length === 0
|
|
1452
|
+
? null
|
|
1453
|
+
: h(
|
|
1454
|
+
'section',
|
|
1455
|
+
{ className: 'clearai-waiting' },
|
|
1456
|
+
h('b', null, `${t('待您处理(')}${needYou.length}${t(')')}`),
|
|
1457
|
+
...needYou.map((item, index) => h('span', { key: `need-${index}` }, String(item?.text ?? ''))),
|
|
1458
|
+
),
|
|
1459
|
+
areas.length > 0 ? h(AreaBox, { exploration, send: props.send, sent, onSent }) : null,
|
|
1460
|
+
...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 })),
|
|
1461
|
+
h(NextBox, { next: exploration?.next ?? null }),
|
|
1462
|
+
h(AnomalyBox, { data }),
|
|
1463
|
+
h(KnowledgeFlowBox, { data, openPreview: props.openPreview }),
|
|
1464
|
+
h(
|
|
1465
|
+
'section',
|
|
1466
|
+
{ className: 'clearai-process' },
|
|
1467
|
+
h(
|
|
1468
|
+
'button',
|
|
1469
|
+
{ type: 'button', className: 'clearai-process-head', 'aria-expanded': showProcess ? 'true' : 'false', onClick: () => {
|
|
1470
|
+
factsFocus.set(null)
|
|
1471
|
+
setProcessOpen(!showProcess)
|
|
1472
|
+
} },
|
|
1473
|
+
h('b', null, t('过程记录')),
|
|
1474
|
+
h('span', null, summary),
|
|
1475
|
+
h('span', { className: 'clearai-cand-chevron', 'aria-hidden': 'true' }, showProcess ? t('收起') : t('展开')),
|
|
1476
|
+
),
|
|
1477
|
+
showProcess
|
|
1478
|
+
? h(
|
|
1479
|
+
'div',
|
|
1480
|
+
{ className: 'clearai-process-body' },
|
|
1481
|
+
h(JudgmentSummary, { rows }),
|
|
1482
|
+
h(ConclusionList, {
|
|
1483
|
+
rows,
|
|
1484
|
+
open: opened,
|
|
1485
|
+
data,
|
|
1486
|
+
onToggle: (key) => {
|
|
1487
|
+
factsFocus.set(null)
|
|
1488
|
+
setManual(opened === key ? null : key)
|
|
1489
|
+
},
|
|
1490
|
+
onFocus: () => openFacts(),
|
|
1491
|
+
}),
|
|
1492
|
+
h(WorldTree, { data, openPreview: props.openPreview, openSpectator: props.openSpectator, openFacts: (stepId) => factsFocus.set({ step: stepId }) }),
|
|
1493
|
+
)
|
|
1494
|
+
: null,
|
|
1495
|
+
),
|
|
1496
|
+
)
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
/**
|
|
1500
|
+
* **沉淀与取用**(0.5.2):条目、它在这次情形下是否适用、这次会留下什么。
|
|
1501
|
+
* 读的是投影算好的 `knowledgeItems` / `entityKnowledge` / `knowledgeFlow`;界面不判定适用性,
|
|
1502
|
+
* 条目上的按钮只替人向模型发一句话,由模型复检、撤回或修改后落账。
|
|
1503
|
+
*/
|
|
1504
|
+
const VERDICT_WORD = lazyTable(() => ({ applies: t('适用'), out_of_scope: t('超出适用范围'), out_of_range: t('超出取值范围'), undeclared: t('本次条件未声明'), unscoped: t('条目未声明适用范围'), definition_changed: t('口径已变更'), pending: t('待核验'), retracted: t('已撤回') }))
|
|
1505
|
+
const VERDICT_NEXT = lazyTable(() => ({ out_of_scope: t('本次不能直接沿用,需重新检验'), out_of_range: t('本次不能直接沿用,需重新检验'), undeclared: t('补充本次条件后重新判定'), unscoped: t('沿用时需自行确认'), definition_changed: t('按新口径换算或重新检验'), pending: t('先复检再沿用'), retracted: t('不得沿用') }))
|
|
1506
|
+
const ITEM_WORD = lazyTable(() => ({ established: t('已确立'), pending: t('待核验'), excluded: t('已排除'), preliminary_excluded: t('初步排除'), unresolved: t('未解释'), defect: t('测量或方法缺陷'), explained: t('已解释'), ruled_out: t('已判定无关'), escalated: t('已提交您处理') }))
|
|
1507
|
+
const COUNT_WORD = lazyTable(() => ({ established: t('已确立'), excluded: t('已排除'), bounded: t('超出适用范围'), pending: t('待核验'), unresolved: t('未解释') }))
|
|
1508
|
+
const COUNT_ORDER = ['established', 'excluded', 'bounded', 'pending', 'unresolved']
|
|
1509
|
+
|
|
1510
|
+
/** 条目键(`kind:id`)→ 条目。 */
|
|
1511
|
+
const itemsByKey = (data) => new Map((Array.isArray(data?.knowledgeItems) ? data.knowledgeItems : []).map((item) => [`${item.kind}:${item.id}`, item]))
|
|
1512
|
+
|
|
1513
|
+
/** 一条条目的出处:文件路径,没有就是 id。发给模型的话里用它,模型据此找到文件。 */
|
|
1514
|
+
const itemRef = (item) => String(item.path ?? item.id)
|
|
1515
|
+
|
|
1516
|
+
/** 条目上的三个请求:只发一句话,不写任何状态。 */
|
|
1517
|
+
const ITEM_ASKS = () => [
|
|
1518
|
+
['retest', t('请求复检'), (item) => `${t('请复检条目「')}${item.text}${t('」(')}${itemRef(item)}${t(')。')}`],
|
|
1519
|
+
['retract', t('请求撤回'), (item) => `${t('请撤回条目「')}${item.text}${t('」(')}${itemRef(item)}${t('),并说明对已有结论的影响。')}`],
|
|
1520
|
+
['rescope', t('请求修改适用范围'), (item) => `${t('请与我确认条目「')}${item.text}${t('」(')}${itemRef(item)}${t(')的适用范围应如何修改。')}`],
|
|
1521
|
+
]
|
|
1522
|
+
|
|
1523
|
+
function KnowledgeItemRow(props) {
|
|
1524
|
+
const { item } = props
|
|
1525
|
+
const meta = []
|
|
1526
|
+
if (item.scope) meta.push(`${t('范围:')}${item.scope}`)
|
|
1527
|
+
if (item.kind === 'negative' && item.strength && typeof item.strength.count === 'number') meta.push(`${t('推翻证据 ')}${item.strength.count}${t(' 条')}${item.strength.independent > 0 ? `${t(' · 独立核验 ')}${item.strength.independent}${t(' 条')}` : ''}`)
|
|
1528
|
+
if (item.basis) meta.push(`${t('依据')}${t(':')}${brief(item.basis, 80)}`)
|
|
1529
|
+
if (item.challenged === true) meta.push(t('受质疑'))
|
|
1530
|
+
for (const reason of item.rechecks ?? []) meta.push(`${reason.kind}: ${reason.detail ?? reason.model ?? ''}`)
|
|
1531
|
+
if ((item.rechecks ?? []).length) meta.push(item.recovery)
|
|
1532
|
+
const sent = props.sent ?? {}
|
|
1533
|
+
const [open, setOpen] = React.useState(false)
|
|
1534
|
+
const asks = props.asks === true && typeof props.send === 'function' && (open || props.open === true) ? ITEM_ASKS() : []
|
|
1535
|
+
const canAsk = props.asks === true && typeof props.send === 'function'
|
|
1536
|
+
const done = asks.find(([key]) => sent[`${item.kind}:${item.id}:${key}`] !== undefined)
|
|
1537
|
+
return h(
|
|
1538
|
+
'div',
|
|
1539
|
+
{ className: 'clearai-kitem', 'data-open': open ? '1' : '0' },
|
|
1540
|
+
h('div', { className: 'clearai-kitem-head', 'data-click': canAsk ? '1' : '0', title: canAsk ? (open ? t('收起') : t('点击查看可发出的请求')) : undefined, onClick: canAsk ? () => setOpen(!open) : undefined }, h(StateTag, { state: item.status }, item.kind === 'lesson' ? (LESSON_WORD[item.status] ?? item.status) : (ITEM_WORD[item.status] ?? item.status)), h('span', null, item.text), item.path ? h('span', { className: 'clearai-link', onClick: () => props.openPreview?.(item.path), title: item.path }, t('查看记录')) : null),
|
|
1541
|
+
meta.length === 0 ? null : h('div', { className: 'clearai-kitem-meta' }, meta.join(' · ')),
|
|
1542
|
+
...(item.rechecks ?? []).filter((reason) => reason.evidence).map((reason) => h('span', { className: 'clearai-link', onClick: () => props.openPreview?.(reason.evidence), title: reason.evidence }, t('查看核验'))),
|
|
1543
|
+
...(item.evidencePaths ?? []).map((path) => h('span', { className: 'clearai-link', onClick: () => props.openPreview?.(path), title: path }, t('查看核验'))),
|
|
1544
|
+
asks.length === 0
|
|
1545
|
+
? null
|
|
1546
|
+
: done !== undefined
|
|
1547
|
+
? h('div', { className: 'clearai-kitem-meta' }, sent[`${item.kind}:${item.id}:${done[0]}`] === 'failed' ? t('无法自动发送,请在对话中说明。') : t('已发送请求,由模型处理后更新。'))
|
|
1548
|
+
: h('div', { className: 'clearai-kitem-asks' }, ...asks.map(([key, label, say]) => h('button', { key, type: 'button', className: 'clearai-btn', 'data-small': '1', onClick: () => props.onSent?.(`${item.kind}:${item.id}:${key}`, props.send(say(item)) === true ? 'sent' : 'failed') }, label))),
|
|
1549
|
+
)
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
/** 图上实体旁的条目计数(只列非零的格)。 */
|
|
1553
|
+
function CountMarks(props) {
|
|
1554
|
+
const counts = props.counts ?? {}
|
|
1555
|
+
const shown = COUNT_ORDER.filter((key) => (counts[key] ?? 0) > 0)
|
|
1556
|
+
if (shown.length === 0) return null
|
|
1557
|
+
return h('span', { className: 'clearai-kcount', title: shown.map((key) => `${COUNT_WORD[key]} ${counts[key]}`).join(' · ') }, ...shown.map((key) => h('em', { key, 'data-b': key }, String(counts[key]))))
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
/**
|
|
1561
|
+
* **实体卡**:点实体图上的实例打开。六栏:已确立的事实 / 已排除 / 适用边界 / 测量与口径 / 未解释的现象 / 经验。
|
|
1562
|
+
* 空栏不出现;全空就如实说还没有沉淀。
|
|
1563
|
+
*/
|
|
1564
|
+
function EntityCard(props) {
|
|
1565
|
+
const { node, data } = props
|
|
1566
|
+
const byKey = itemsByKey(data)
|
|
1567
|
+
const items = (data?.entityKnowledge?.[node.id]?.items ?? []).map((key) => byKey.get(key)).filter((item) => item !== undefined)
|
|
1568
|
+
const facts = items.filter((item) => item.kind === 'fact')
|
|
1569
|
+
const excluded = items.filter((item) => item.kind === 'negative' && (item.status === 'excluded' || item.status === 'preliminary_excluded'))
|
|
1570
|
+
const bounds = facts.flatMap((item) => item.boundaries.map((bound, index) => ({ key: `${item.id}#${index}`, text: item.text, bound })))
|
|
1571
|
+
const defects = items.filter((item) => item.kind === 'negative' && item.status === 'defect')
|
|
1572
|
+
const measures = (Array.isArray(data?.lexicon?.predicates) ? data.lexicon.predicates : []).filter((predicate) => predicate.kind === 'measures' && node.type !== null && (predicate.domain === node.type || predicate.range?.term === node.type))
|
|
1573
|
+
const unresolved = items.filter((item) => item.kind === 'negative' && (item.status === 'unresolved' || item.status === 'escalated'))
|
|
1574
|
+
const lessons = items.filter((item) => item.kind === 'lesson')
|
|
1575
|
+
const row = (item) => h(KnowledgeItemRow, { key: `${item.kind}:${item.id}`, item, asks: item.kind !== 'lesson', send: props.send, sent: props.sent, onSent: props.onSent, openPreview: data?.openPreview })
|
|
1576
|
+
const section = (title, children, count = children.length) => (children.length === 0 ? null : h('div', { className: 'clearai-ecard-sec' }, h('div', { className: 'clearai-ecard-head' }, `${title}(${count})`), ...children))
|
|
1577
|
+
const sections = [
|
|
1578
|
+
section(t('已确立的事实'), facts.map(row)),
|
|
1579
|
+
section(t('已排除'), [
|
|
1580
|
+
...excluded.filter((item) => item.status === 'excluded').map(row),
|
|
1581
|
+
...(excluded.some((item) => item.status === 'preliminary_excluded')
|
|
1582
|
+
? [h('details', { key: 'preliminary', className: 'clearai-ecard-fold' }, h('summary', null, `${t('初步排除(')}${excluded.filter((item) => item.status === 'preliminary_excluded').length}${t(')')}`), ...excluded.filter((item) => item.status === 'preliminary_excluded').map(row))]
|
|
1583
|
+
: []),
|
|
1584
|
+
], excluded.length),
|
|
1585
|
+
section(
|
|
1586
|
+
t('适用边界'),
|
|
1587
|
+
bounds.map(({ key, text, bound }) => h('div', { key, className: 'clearai-kitem' }, h('div', { className: 'clearai-kitem-head' }, h(StateTag, { state: 'bounded' }, VERDICT_WORD[bound.verdict] ?? bound.verdict), h('span', null, text)), bound.basis ? h('div', { className: 'clearai-kitem-meta' }, brief(bound.basis, 120)) : null)),
|
|
1588
|
+
),
|
|
1589
|
+
section(t('测量与口径'), [
|
|
1590
|
+
...measures.map((predicate) => h('div', { key: `m-${predicate.id}`, className: 'clearai-kitem' }, h('div', { className: 'clearai-kitem-head' }, h('span', null, String(predicate.label ?? predicate.id))), predicate.check ? h('div', { className: 'clearai-kitem-meta' }, `${t('校准关系')}${t(':')}${predicate.check}`) : null)),
|
|
1591
|
+
...defects.map(row),
|
|
1592
|
+
]),
|
|
1593
|
+
section(t('未解释的现象'), unresolved.map(row)),
|
|
1594
|
+
section(t('经验'), lessons.map(row)),
|
|
1595
|
+
].filter((item) => item !== null)
|
|
1596
|
+
return h(
|
|
1597
|
+
'div',
|
|
1598
|
+
{ className: 'clearai-ecard' },
|
|
1599
|
+
h('div', { className: 'clearai-ecard-title' }, String(node.label ?? node.ref ?? node.id), h(CountMarks, { counts: data?.entityKnowledge?.[node.id]?.counts })),
|
|
1600
|
+
sections.length === 0 ? h('div', { className: 'clearai-quiet' }, t('该实体暂无沉淀的知识。')) : null,
|
|
1601
|
+
...sections,
|
|
1602
|
+
)
|
|
1603
|
+
}
|
|
1604
|
+
|
|
1605
|
+
/** 探索货架:引用的已有知识(系统判定)与将沉淀的内容。两节都空就不出现。 */
|
|
1606
|
+
function KnowledgeFlowBox(props) {
|
|
1607
|
+
const flow = props.data?.knowledgeFlow ?? null
|
|
1608
|
+
if (flow === null) return null
|
|
1609
|
+
const cited = Array.isArray(flow.cited) ? flow.cited : []
|
|
1610
|
+
const negatives = Array.isArray(flow.settling?.negatives) ? flow.settling.negatives : []
|
|
1611
|
+
const awaiting = Array.isArray(flow.settling?.awaiting) ? flow.settling.awaiting : []
|
|
1612
|
+
return h(
|
|
1613
|
+
React.Fragment,
|
|
1614
|
+
null,
|
|
1615
|
+
cited.length === 0
|
|
1616
|
+
? null
|
|
1617
|
+
: h(
|
|
1618
|
+
'section',
|
|
1619
|
+
{ className: 'clearai-box' },
|
|
1620
|
+
h('div', { className: 'clearai-box-head' }, h('span', { className: 'clearai-box-title' }, `${t('引用的已有知识(')}${cited.length}${t(')')}`)),
|
|
1621
|
+
...cited.map((item) =>
|
|
1622
|
+
h(
|
|
1623
|
+
'div',
|
|
1624
|
+
{ key: `${item.id}|${item.verdict}`, className: 'clearai-kitem' },
|
|
1625
|
+
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('span', { className: 'clearai-link', onClick: () => props.openPreview?.(item.path), title: item.path }, t('查看记录')) : null),
|
|
1626
|
+
h('div', { className: 'clearai-kitem-meta' }, [`${t('引用者:')}${item.by.join(t('、'))}`, VERDICT_NEXT[item.verdict] ?? null].filter((line) => line !== null).join(' · ')),
|
|
1627
|
+
),
|
|
1628
|
+
),
|
|
1629
|
+
),
|
|
1630
|
+
negatives.length === 0 && awaiting.length === 0
|
|
1631
|
+
? null
|
|
1632
|
+
: h(
|
|
1633
|
+
'section',
|
|
1634
|
+
{ className: 'clearai-box' },
|
|
1635
|
+
h('div', { className: 'clearai-box-head' }, h('span', { className: 'clearai-box-title' }, t('将沉淀的内容')), h('span', { className: 'clearai-box-note' }, t('已写入的排除与未解释项;结案时待独立核验的结论'))),
|
|
1636
|
+
...negatives.map((item) => h(KnowledgeItemRow, { key: item.id, item, openPreview: props.openPreview })),
|
|
1637
|
+
...awaiting.map((item) => h('div', { key: item.id, className: 'clearai-kitem' }, h('div', { className: 'clearai-kitem-head' }, h(StateTag, { state: 'examining' }, t('待独立核验')), h('span', null, item.name), item.claim !== item.name ? h('span', { className: 'clearai-kitem-meta' }, brief(item.claim, 80)) : null))),
|
|
1638
|
+
),
|
|
1639
|
+
)
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
/** 结论卡底部:本目标已沉淀的条数。 */
|
|
1643
|
+
function SettledLine(props) {
|
|
1644
|
+
const settled = props.data?.knowledgeFlow?.settled ?? null
|
|
1645
|
+
if (settled === null) return null
|
|
1646
|
+
const parts = [
|
|
1647
|
+
settled.established > 0 ? `${t('已确立 ')}${settled.established}${t(' 条')}` : null,
|
|
1648
|
+
settled.excluded > 0 ? `${t('已排除 ')}${settled.excluded}${t(' 条')}` : null,
|
|
1649
|
+
settled.unresolved > 0 ? `${t('未解释 ')}${settled.unresolved}${t(' 项')}` : null,
|
|
1650
|
+
(settled.defects ?? 0) > 0 ? `${t('测量或方法缺陷 ')}${settled.defects}${t(' 项')}` : null,
|
|
1651
|
+
settled.lessons > 0 ? `${t('经验 ')}${settled.lessons}${t(' 条')}` : null,
|
|
1652
|
+
].filter((item) => item !== null)
|
|
1653
|
+
if (parts.length === 0) return null
|
|
1654
|
+
return h('div', { className: 'clearai-settled' }, h('span', { className: 'clearai-answer-label' }, t('本次沉淀')), h('span', null, parts.join(' · ')))
|
|
1655
|
+
}
|
|
1656
|
+
|
|
1657
|
+
/** 本体货架的结论卡:按问题切换,四部分(结论 / 依据 / 尚未确定的事项 / 待您决策)。 */
|
|
1658
|
+
function AnswerCards(props) {
|
|
1659
|
+
const answers = Array.isArray(props.data?.goal?.answers) ? props.data.goal.answers : []
|
|
1660
|
+
const [picked, setPicked] = React.useState(null)
|
|
1661
|
+
if (answers.length === 0) return null
|
|
1662
|
+
const questions = Array.isArray(props.data?.exploration?.questions) ? props.data.exploration.questions : []
|
|
1663
|
+
const textOf = (id) => questions.find((question) => question.id === id && !question.implicit)?.text ?? null
|
|
1664
|
+
const chosen = answers.find((answer) => answer.question === picked) ?? answers[0]
|
|
1665
|
+
const part = (label, body, warm = false) => h('div', { className: 'clearai-answer-part', 'data-warm': warm ? '1' : '0' }, h('span', { className: 'clearai-answer-label' }, label), body)
|
|
1666
|
+
const open = Array.isArray(chosen.open) ? chosen.open : []
|
|
1667
|
+
const decide = Array.isArray(chosen.decide) ? chosen.decide : []
|
|
1668
|
+
const basis = Array.isArray(chosen.basis) ? chosen.basis : []
|
|
1669
|
+
return h(
|
|
1670
|
+
'div',
|
|
1671
|
+
{ className: 'clearai-answers' },
|
|
1672
|
+
answers.length < 2
|
|
1673
|
+
? null
|
|
1674
|
+
: h(
|
|
1675
|
+
'div',
|
|
1676
|
+
{ className: 'clearai-pills' },
|
|
1677
|
+
...answers.map((answer, index) =>
|
|
1678
|
+
h(
|
|
1679
|
+
'button',
|
|
1680
|
+
{ key: `q-${index}`, type: 'button', className: 'clearai-qtab', 'aria-pressed': answer === chosen ? 'true' : 'false', onClick: () => setPicked(answer.question) },
|
|
1681
|
+
`${t('问题 ')}${index + 1}${textOf(answer.question) ? ` · ${brief(textOf(answer.question), 16)}` : ''}`,
|
|
1682
|
+
),
|
|
1683
|
+
),
|
|
1684
|
+
),
|
|
1685
|
+
h(
|
|
1686
|
+
'section',
|
|
1687
|
+
{ className: 'clearai-answer' },
|
|
1688
|
+
part(t('结论'), h('span', { className: 'clearai-answer-main' }, chosen.conclusion || `${t('未能回答:')}${chosen.unanswered ?? ''}`)),
|
|
1689
|
+
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('span', { className: 'clearai-link', onClick: () => props.openExplore?.() }, t('查看探索记录')))))),
|
|
1690
|
+
open.length === 0 ? null : part(t('尚未确定的事项'), h('div', { className: 'clearai-answer-lines' }, ...open.map((entry, index) => h('div', { key: `o-${index}` }, entry.effect)))),
|
|
1691
|
+
decide.length === 0 ? null : part(t('待您决策'), h('div', { className: 'clearai-answer-lines' }, ...decide.map((line, index) => h('div', { key: `d-${index}` }, line))), true),
|
|
1692
|
+
),
|
|
1693
|
+
h(SettledLine, { data: props.data }),
|
|
1694
|
+
)
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1697
|
+
/** 经验:以前结案时核过的「下次怎么做」(含别的会话留下的)。 */
|
|
1698
|
+
function LessonList(props) {
|
|
1699
|
+
const lessons = Array.isArray(props.data?.lessons) ? props.data.lessons : []
|
|
1700
|
+
if (lessons.length === 0) return null
|
|
1701
|
+
return h(
|
|
1702
|
+
'div',
|
|
1703
|
+
{ className: 'clearai-list' },
|
|
1704
|
+
...lessons.map((lesson) =>
|
|
1705
|
+
h('div', { key: lesson.id, className: 'clearai-lesson' }, h('span', { className: 'clearai-lesson-kind' }, LESSON_WORD[lesson.kind] ?? lesson.kind), h('span', null, lesson.text), lesson.boundary ? h('span', { className: 'clearai-lesson-meta' }, `${t('不适用:')}${lesson.boundary}`) : null),
|
|
1706
|
+
),
|
|
1086
1707
|
)
|
|
1087
1708
|
}
|
|
1088
1709
|
|
|
@@ -1293,10 +1914,13 @@ window.__ModuleLoader__.load({
|
|
|
1293
1914
|
function WorldTree(props) {
|
|
1294
1915
|
const sessions = props.useSessions
|
|
1295
1916
|
const sessionId = props.sessionId
|
|
1917
|
+
/** 探索货架里直接把投影交下来(`data`);旧的独立挂法仍按会话快照取。 */
|
|
1296
1918
|
const data =
|
|
1297
|
-
|
|
1298
|
-
?
|
|
1299
|
-
:
|
|
1919
|
+
props.data !== undefined
|
|
1920
|
+
? props.data
|
|
1921
|
+
: typeof sessions === 'function' && typeof sessionId === 'string'
|
|
1922
|
+
? sessions((snapshot) => snapshot?.byId?.[sessionId]?.projectionValues?.clearai)
|
|
1923
|
+
: undefined
|
|
1300
1924
|
const [manual, setManual] = React.useState(null)
|
|
1301
1925
|
const [picked, setPicked] = React.useState(null)
|
|
1302
1926
|
const focus = useFocus(treeFocus)
|
|
@@ -1310,7 +1934,7 @@ window.__ModuleLoader__.load({
|
|
|
1310
1934
|
const chosen = wanted === null ? null : plans.find((item) => item.id === wanted) ?? null
|
|
1311
1935
|
const plan = chosen ?? (data === null || data === undefined ? null : data.plan)
|
|
1312
1936
|
if (plan === null || plan === undefined) {
|
|
1313
|
-
return h('div', { style: S.wrap }, h('div', { style: S.bar }, h('span', { style: S.title }, t('
|
|
1937
|
+
return h('div', { style: S.wrap }, h('div', { style: S.bar }, h('span', { style: S.title }, t('计划'))), h(Empty, null, t('暂无计划。建立计划后,此处将显示计划的步骤与闸门。')))
|
|
1314
1938
|
}
|
|
1315
1939
|
const rows = treeRows(plan)
|
|
1316
1940
|
/** 页眉那一句:计划的首个非空行,过长再截(整篇在 tooltip 与「计划文档」里)。 */
|
|
@@ -1383,7 +2007,7 @@ window.__ModuleLoader__.load({
|
|
|
1383
2007
|
h(
|
|
1384
2008
|
'div',
|
|
1385
2009
|
{ style: S.bar },
|
|
1386
|
-
h('span', { style: S.title }, t('
|
|
2010
|
+
h('span', { style: S.title }, t('计划')),
|
|
1387
2011
|
/**
|
|
1388
2012
|
* 页眉只放**一句话**:`brief` 常常是整篇 markdown 计划(真数据里这一行渲染出 1794 字 ✗),
|
|
1389
2013
|
* 全文进 tooltip,要读整篇点「打开计划」(原生预览 `clear/goals/plans/<id>.md`)——
|
|
@@ -1405,7 +2029,7 @@ window.__ModuleLoader__.load({
|
|
|
1405
2029
|
setPicked(event.target.value)
|
|
1406
2030
|
setManual(null)
|
|
1407
2031
|
},
|
|
1408
|
-
title: t('
|
|
2032
|
+
title: t('切换到以前的计划(计划均保留,文档归档在 clear/goals/plans/)'),
|
|
1409
2033
|
style: { font: 'inherit', fontSize: 11.5, color: 'var(--dsw-alias-label-secondary)', background: 'transparent', border: '.5px solid var(--dsw-alias-border-l2)', borderRadius: 6, padding: '1px 4px' },
|
|
1410
2034
|
},
|
|
1411
2035
|
...plans.map((item, index) =>
|
|
@@ -1414,7 +2038,7 @@ window.__ModuleLoader__.load({
|
|
|
1414
2038
|
),
|
|
1415
2039
|
chosen === null
|
|
1416
2040
|
? null
|
|
1417
|
-
: h('span', { style: { ...S.faint, opacity: 0.8 } }, t('
|
|
2041
|
+
: h('span', { style: { ...S.faint, opacity: 0.8 } }, t('已完成 · 可查看存档')),
|
|
1418
2042
|
h(
|
|
1419
2043
|
'span',
|
|
1420
2044
|
{ style: S.faint },
|
|
@@ -1483,7 +2107,7 @@ window.__ModuleLoader__.load({
|
|
|
1483
2107
|
stat.marks.loops.rounds > 1
|
|
1484
2108
|
? h('span', { title: `${stat.marks.loops.rounds}${t(' 轮')}${stat.marks.loops.fails > 0 ? ` · 其中 ${stat.marks.loops.fails} 次被驳回` : ''}` }, `${stat.marks.loops.rounds}${t(' 轮')}`)
|
|
1485
2109
|
: null,
|
|
1486
|
-
stat.judges > 0 ? h('span', { title: `${t('
|
|
2110
|
+
stat.judges > 0 ? h('span', { title: `${t('已派出评估者 ')}${stat.judges}${t(' 次')}` }, t('独立核验')) : null,
|
|
1487
2111
|
),
|
|
1488
2112
|
)
|
|
1489
2113
|
}),
|
|
@@ -1514,7 +2138,7 @@ window.__ModuleLoader__.load({
|
|
|
1514
2138
|
: h(
|
|
1515
2139
|
'div',
|
|
1516
2140
|
{ style: S.kv },
|
|
1517
|
-
h('span', { style: S.faint }, t('
|
|
2141
|
+
h('span', { style: S.faint }, t('任务内容')), h('span', null, step.do),
|
|
1518
2142
|
h('span', { style: S.faint }, t('判据')), h('span', null, `${step.doneCriteria}${step.voidReason === null || step.voidReason === undefined ? '' : `(作废:${step.voidReason})`}`),
|
|
1519
2143
|
h('span', { style: S.faint }, t('状态')), h('span', null, `${gloss(STEP, step.status)}${step.level === null || step.level === undefined ? '' : ` · ${step.level}`}`),
|
|
1520
2144
|
h(
|
|
@@ -1540,8 +2164,8 @@ window.__ModuleLoader__.load({
|
|
|
1540
2164
|
'span',
|
|
1541
2165
|
{ key: `${path}-${index}`, style: { marginRight: 8 } },
|
|
1542
2166
|
exists === false
|
|
1543
|
-
? h('span', { style: { ...S.mono, opacity: 0.6 }, title: t('
|
|
1544
|
-
: h(Link, { onClick: () => props.openPreview?.(path), title: exists === true ? t('
|
|
2167
|
+
? h('span', { style: { ...S.mono, opacity: 0.6 }, title: t('磁盘上未找到该文件') }, `${path}${t('(缺失)')}`)
|
|
2168
|
+
: h(Link, { onClick: () => props.openPreview?.(path), title: exists === true ? t('在原生预览中打开') : t('在原生预览中打开(计划声明的产物)') }, h('span', { style: S.mono }, path)),
|
|
1545
2169
|
)
|
|
1546
2170
|
}),
|
|
1547
2171
|
),
|
|
@@ -1562,7 +2186,7 @@ window.__ModuleLoader__.load({
|
|
|
1562
2186
|
Link,
|
|
1563
2187
|
{
|
|
1564
2188
|
onClick: () => props.openFacts(step.id),
|
|
1565
|
-
title: t('
|
|
2189
|
+
title: t('在本体货架中展开此结论'),
|
|
1566
2190
|
},
|
|
1567
2191
|
t('查看此步骤的证据'),
|
|
1568
2192
|
),
|
|
@@ -1579,8 +2203,8 @@ window.__ModuleLoader__.load({
|
|
|
1579
2203
|
'div',
|
|
1580
2204
|
{ key: item.id, style: S.faint },
|
|
1581
2205
|
`${t('独立核验:')}${item.verdict === null || item.verdict === undefined ? t('正在裁决') : (VERDICT[item.verdict] ?? item.verdict)}`,
|
|
1582
|
-
item.evaluatorSession === null || item.evaluatorSession === undefined ? null : h(Link, { onClick: () => props.openSpectator?.(item.evaluatorSession) }, h('span', null, t('
|
|
1583
|
-
item.cardPath === null || item.cardPath === undefined ? null : h(Link, { onClick: () => props.openPreview?.(item.cardPath) }, h('span', null, t('
|
|
2206
|
+
item.evaluatorSession === null || item.evaluatorSession === undefined ? null : h(Link, { onClick: () => props.openSpectator?.(item.evaluatorSession) }, h('span', null, t(' 查看核验过程'))),
|
|
2207
|
+
item.cardPath === null || item.cardPath === undefined ? null : h(Link, { onClick: () => props.openPreview?.(item.cardPath) }, h('span', null, t(' 查看核验记录'))),
|
|
1584
2208
|
),
|
|
1585
2209
|
),
|
|
1586
2210
|
),
|
|
@@ -1653,9 +2277,24 @@ window.__ModuleLoader__.load({
|
|
|
1653
2277
|
* 「待处理 N」就在这一格(`waiting`):门开着是**事实面**上最要紧的一句,
|
|
1654
2278
|
* 而它可点——点一下开世界树,那里才看得到要裁什么。
|
|
1655
2279
|
*/
|
|
1656
|
-
|
|
2280
|
+
/**
|
|
2281
|
+
* 符号说**探索到了哪**:调研时是「板块 已厘清/总数」,求解时是「问题 当前/总数 · 待检验假设 N 个」;
|
|
2282
|
+
* 没列问题也没列板块的目标(旧会话、单问题)退回步数 `N/M`。
|
|
2283
|
+
*/
|
|
2284
|
+
const exploration = data?.exploration ?? null
|
|
2285
|
+
const areas = Array.isArray(exploration?.areas) ? exploration.areas : []
|
|
2286
|
+
const declared = (Array.isArray(exploration?.questions) ? exploration.questions : []).filter((question) => !question.implicit)
|
|
2287
|
+
const current = (Array.isArray(exploration?.questions) ? exploration.questions : []).find((question) => question.id === exploration?.current) ?? null
|
|
2288
|
+
const emergent = declared.filter((question) => question.status === 'emergent').length
|
|
2289
|
+
const examining = current === null ? 0 : (current.counts?.examining ?? 0)
|
|
2290
|
+
const symbol =
|
|
2291
|
+
areas.length > 0
|
|
2292
|
+
? `${t('板块 ')}${areas.filter((area) => area.state === 'clear').length}/${areas.length}${emergent > 0 ? `${t(' · ')}${emergent}${t(' 个问题待您决定')}` : ''}`
|
|
2293
|
+
: declared.length > 0 && current !== null
|
|
2294
|
+
? `${t('问题 ')}${declared.indexOf(current) + 1}/${declared.length}${t(' · 待检验假设 ')}${examining}${t(' 个')}`
|
|
2295
|
+
: `${done}/${total}`
|
|
1657
2296
|
const brief = typeof plan.brief === 'string' && plan.brief.trim() !== '' ? plan.brief.trim() : null
|
|
1658
|
-
const meaning = blocked ? t('
|
|
2297
|
+
const meaning = blocked ? t('计划受阻,待人工处理') : plan.status === 'closed' ? `${t('计划已收尾(')}${done}/${total}${t(' 步)')}` : `${t('计划已交付 ')}${done}/${total}${t(' 步')}`
|
|
1659
2298
|
/**
|
|
1660
2299
|
* 等人时**只说一句**:先「待处理 N」(人门计数),没有门才说续跑停着的原因。
|
|
1661
2300
|
* 两者是同一根轴(为什么在等人)⇒ 一格只放一个,不并列。
|
|
@@ -1668,11 +2307,11 @@ window.__ModuleLoader__.load({
|
|
|
1668
2307
|
type: 'button',
|
|
1669
2308
|
className: 'clearai-toolctl',
|
|
1670
2309
|
disabled: props.locked === true,
|
|
1671
|
-
title: `${meaning}${waiting === null ? '' : ` · ${waiting}`} · ${plan.id}${brief === null ? '' : ` · ${brief}`}${t('(
|
|
1672
|
-
'aria-label': `${meaning}${waiting === null ? '' : ` · ${waiting}`}${t('(
|
|
2310
|
+
title: `${meaning}${waiting === null ? '' : ` · ${waiting}`} · ${plan.id}${brief === null ? '' : ` · ${brief}`}${t('(点击打开探索货架)')}`,
|
|
2311
|
+
'aria-label': `${meaning}${waiting === null ? '' : ` · ${waiting}`}${t('(点击打开探索货架)')}`,
|
|
1673
2312
|
// 「要人注意」用与世界树同一族的琥珀(同一套主题令牌,不新造颜色)。
|
|
1674
2313
|
style: attentionNow ? { color: 'rgb(var(--dsw-color-warning, 245 158 11))', fontWeight: 600 } : undefined,
|
|
1675
|
-
onClick: () => props.
|
|
2314
|
+
onClick: () => props.openExplore?.(),
|
|
1676
2315
|
},
|
|
1677
2316
|
h(PlanGlyph, null),
|
|
1678
2317
|
h('span', { style: { minWidth: 14, textAlign: 'center' } }, symbol),
|
|
@@ -1860,12 +2499,12 @@ window.__ModuleLoader__.load({
|
|
|
1860
2499
|
h('span', { className: 'clearai-card-kind' }, KIND_WORD[selection.kind] ?? t('关系')),
|
|
1861
2500
|
h('span', { className: 'clearai-card-title' }, title),
|
|
1862
2501
|
h('span', { style: { flex: '1 1 auto' } }),
|
|
1863
|
-
h('span', { className: 'clearai-link', onClick: onFilter }, t('
|
|
2502
|
+
h('span', { className: 'clearai-link', onClick: onFilter }, t('仅显示相关项')),
|
|
1864
2503
|
h('span', { className: 'clearai-link', onClick: onClose }, t('关闭')),
|
|
1865
2504
|
),
|
|
1866
|
-
busy === true ? h('div', { className: 'clearai-quiet' }, t('
|
|
1867
|
-
failure !== null ? h('div', { className: 'clearai-quiet' }, `${t('
|
|
1868
|
-
busy === false && failure === null && data === null ? h('div', { className: 'clearai-quiet' }, t('
|
|
2505
|
+
busy === true ? h('div', { className: 'clearai-quiet' }, t('正在加载…')) : null,
|
|
2506
|
+
failure !== null ? h('div', { className: 'clearai-quiet' }, `${t('无法获取')}${t(':')}${failure}`) : null,
|
|
2507
|
+
busy === false && failure === null && data === null ? h('div', { className: 'clearai-quiet' }, t('该项已不在当前词表中(可能已被废止)。')) : null,
|
|
1869
2508
|
data === null
|
|
1870
2509
|
? null
|
|
1871
2510
|
: h(
|
|
@@ -1874,20 +2513,20 @@ window.__ModuleLoader__.load({
|
|
|
1874
2513
|
...kv(t('释义'), definition.gloss),
|
|
1875
2514
|
...kv(t('上位'), definition.parentLabel ?? definition.parent),
|
|
1876
2515
|
...kv(t('下位'), (relations.children ?? []).map((item) => item.label).join('、')),
|
|
1877
|
-
...kv(t('
|
|
2516
|
+
...kv(t('主体'), definition.domainLabel ?? definition.domain),
|
|
1878
2517
|
...kv(t('类型'), definition.typeLabel ?? definition.type),
|
|
1879
2518
|
...kv(t('取值'), value),
|
|
1880
2519
|
...kv(t('依据'), definition.basis),
|
|
1881
2520
|
...kv(t('关系'), (relations.edges ?? []).slice(0, 6).map((edge) => named(edge.chip)).join('、')),
|
|
1882
2521
|
...kv(t('实例'), (relations.instances ?? []).slice(0, 6).map((item) => item.label).join('、')),
|
|
1883
|
-
definition.status === 'deprecated' ? h('span', { key: 'dep', style: { gridColumn: '1 / -1' }, className: 'clearai-quiet' }, t('
|
|
2522
|
+
definition.status === 'deprecated' ? h('span', { key: 'dep', style: { gridColumn: '1 / -1' }, className: 'clearai-quiet' }, t('该术语已废止,既有结论中的用法仍可查看。')) : null,
|
|
1884
2523
|
),
|
|
1885
2524
|
facts.length === 0
|
|
1886
2525
|
? null
|
|
1887
2526
|
: h(
|
|
1888
2527
|
'div',
|
|
1889
2528
|
{ className: 'clearai-card-facts' },
|
|
1890
|
-
h('div', { className: 'clearai-group-head' }, t('
|
|
2529
|
+
h('div', { className: 'clearai-group-head' }, t('引用此项的结论'), h('span', null, `${facts.length}${data.factsTruncated > 0 ? '+' : ''}`)),
|
|
1891
2530
|
...facts.slice(0, 4).map((fact, index) =>
|
|
1892
2531
|
h(
|
|
1893
2532
|
'div',
|
|
@@ -1912,8 +2551,9 @@ window.__ModuleLoader__.load({
|
|
|
1912
2551
|
* · **点击语义**:点节点 / 边 = 打开小卡;「只看相关」是卡上的显式动作。
|
|
1913
2552
|
* · **全屏**:position: fixed 的真 overlay,打开时自动适配。
|
|
1914
2553
|
*/
|
|
1915
|
-
const GraphBand = ({ lexicon, layer, onLayer, fullscreen, onToggleFullscreen, onFilter, sessionId, unlanded, focus }) => {
|
|
2554
|
+
const GraphBand = ({ lexicon, data, send, layer, onLayer, fullscreen, onToggleFullscreen, onFilter, sessionId, unlanded, focus }) => {
|
|
1916
2555
|
const [picked, setPicked] = React.useState(null)
|
|
2556
|
+
const [asked, setAsked] = React.useState({})
|
|
1917
2557
|
const graph = lexicon?.graph ?? { nodes: [], edges: [], bounds: { width: 0, height: 0 } }
|
|
1918
2558
|
const conflicts = Array.isArray(lexicon?.conflicts) ? lexicon.conflicts : []
|
|
1919
2559
|
const conflicted = new Set(conflicts.flatMap((item) => item.sides.map((side) => side.fact)).filter((id) => typeof id === 'string'))
|
|
@@ -2066,6 +2706,7 @@ window.__ModuleLoader__.load({
|
|
|
2066
2706
|
{ className: 'clearai-star', 'data-kind': node.kind, 'data-state': nodeState(node), 'data-sel': node.id === selectedId ? '1' : '0' },
|
|
2067
2707
|
h('i', null),
|
|
2068
2708
|
h('span', null, trimLabel(node.kind === 'value_type' ? (FORM_WORD[node.ref] ?? node.label ?? node.ref) : (node.label ?? node.ref ?? node.id), 16)),
|
|
2709
|
+
node.layer === 'entity' ? h(CountMarks, { counts: data?.entityKnowledge?.[node.id]?.counts }) : null,
|
|
2069
2710
|
(childCount.get(node.id) ?? 0) > 0
|
|
2070
2711
|
? h(
|
|
2071
2712
|
'b',
|
|
@@ -2146,8 +2787,8 @@ window.__ModuleLoader__.load({
|
|
|
2146
2787
|
const sideBySide = fullscreen === true
|
|
2147
2788
|
const empty =
|
|
2148
2789
|
layer === 'entity'
|
|
2149
|
-
? `${typeof unlanded === 'number' && unlanded > 0 ? `${t('
|
|
2150
|
-
: t('
|
|
2790
|
+
? `${typeof unlanded === 'number' && unlanded > 0 ? `${t('共 ')}${unlanded}${t(' 条断言的主体尚未建立实体文件。')}` : t('实体图暂无内容。')}${t('clear/ontology/entities/ 下的实体文件与写入长期知识的断言将在此显示。')}`
|
|
2791
|
+
: t('本体图暂无内容。模型在 clear/ontology/concepts/ 与 relations/ 下建立概念与关系文件后,将在此显示。')
|
|
2151
2792
|
return h(
|
|
2152
2793
|
'div',
|
|
2153
2794
|
{ className: 'clearai-graph', 'data-full': fullscreen === true ? '1' : '0' },
|
|
@@ -2165,6 +2806,7 @@ window.__ModuleLoader__.load({
|
|
|
2165
2806
|
{ className: 'clearai-legend' },
|
|
2166
2807
|
h('span', { 'data-l': 'solid' }, t('已验证')),
|
|
2167
2808
|
h('span', { 'data-l': 'dash' }, t('待核验')),
|
|
2809
|
+
layer === 'entity' ? h('span', { className: 'clearai-kcount-legend' }, ...COUNT_ORDER.map((key) => h('span', { key }, h('em', { 'data-b': key }), COUNT_WORD[key]))) : null,
|
|
2168
2810
|
conflicts.length > 0 ? h('span', { 'data-l': 'warn' }, `${t('矛盾')} ${conflicts.length}`) : null,
|
|
2169
2811
|
),
|
|
2170
2812
|
h('span', { style: { flex: '1 1 auto' } }),
|
|
@@ -2175,7 +2817,7 @@ window.__ModuleLoader__.load({
|
|
|
2175
2817
|
'div',
|
|
2176
2818
|
{ className: 'clearai-graph-body', 'data-side': sideBySide ? '1' : '0' },
|
|
2177
2819
|
XYFlow === null || XYFlow.ReactFlow === undefined || XYFlow.ReactFlow === null
|
|
2178
|
-
? h('div', { className: 'clearai-graph-empty' }, `${t('图组件不可用')}(${String(XYFLOW_LOAD.reason ?? '')}):${t('
|
|
2820
|
+
? h('div', { className: 'clearai-graph-empty' }, `${t('图组件不可用')}(${String(XYFLOW_LOAD.reason ?? '')}):${t('结论仍可正常查看。')}`)
|
|
2179
2821
|
: allNodes.length === 0
|
|
2180
2822
|
? h('div', { className: 'clearai-graph-empty' }, empty)
|
|
2181
2823
|
: h(
|
|
@@ -2214,6 +2856,7 @@ window.__ModuleLoader__.load({
|
|
|
2214
2856
|
: h(
|
|
2215
2857
|
'div',
|
|
2216
2858
|
{ className: 'clearai-graph-side' },
|
|
2859
|
+
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,
|
|
2217
2860
|
h(GraphInspector, { selection: inspection, sessionId, names: entityNames, onFilter: () => onFilter(filterTarget), onClose: () => setPicked(null) }),
|
|
2218
2861
|
),
|
|
2219
2862
|
),
|
|
@@ -2223,7 +2866,7 @@ window.__ModuleLoader__.load({
|
|
|
2223
2866
|
: h(
|
|
2224
2867
|
'details',
|
|
2225
2868
|
{ className: 'clearai-graph-problems' },
|
|
2226
|
-
h('summary', null, `${t('本体文件有 ')}${problems.length}${t('
|
|
2869
|
+
h('summary', null, `${t('本体文件有 ')}${problems.length}${t(' 项问题(不纳入图中)')}`),
|
|
2227
2870
|
...problems.slice(0, 12).map((item, index) =>
|
|
2228
2871
|
h('div', { key: `${item.path ?? ''}#${index}`, 'data-sev': item.severity === 'error' ? 'error' : item.severity === 'info' ? 'info' : 'warning' }, h('code', null, String(item.path ?? '')), ` ${String(item.detail ?? item.code ?? '')}`),
|
|
2229
2872
|
),
|
|
@@ -2233,7 +2876,7 @@ window.__ModuleLoader__.load({
|
|
|
2233
2876
|
}
|
|
2234
2877
|
|
|
2235
2878
|
const LocalizedFacts = withLocale(Atlas)
|
|
2236
|
-
const
|
|
2879
|
+
const LocalizedExplore = withLocale(ExploreView)
|
|
2237
2880
|
|
|
2238
2881
|
/** 会话预设的 id:面板只在这个模式的会话里出现。 */
|
|
2239
2882
|
const PRESET_ID = 'clearai'
|
|
@@ -2241,7 +2884,7 @@ window.__ModuleLoader__.load({
|
|
|
2241
2884
|
function apply(ctx) {
|
|
2242
2885
|
// 这四个服务都声明在 `inject` 里,所以这里直接用属性读(Cordis 保证就位);
|
|
2243
2886
|
// 用 `ctx.get()` 也读得到,但属性形式同时受 inject 的「服务重载后重新激活」保护。
|
|
2244
|
-
const { slots, sessions,
|
|
2887
|
+
const { slots, sessions, sidebarRight } = ctx
|
|
2245
2888
|
/**
|
|
2246
2889
|
* 语言:接 DSH 原生的 locale 座位(可选 —— 老宿主或测试桩里没有它,面板退化成中文)。
|
|
2247
2890
|
* 词典以**源文**为键注册进那个座位,于是 `t('已提出')` 走的是宿主那条查找链:
|
|
@@ -2344,113 +2987,43 @@ window.__ModuleLoader__.load({
|
|
|
2344
2987
|
}
|
|
2345
2988
|
|
|
2346
2989
|
/**
|
|
2347
|
-
*
|
|
2990
|
+
* **右栏不再注册页签**:世界树(计划的步骤与闸门)并入探索货架的「过程记录」。
|
|
2991
|
+
* 过程与结果各占中栏一格(探索 / 本体),人不必在右栏与中栏之间来回找。
|
|
2348
2992
|
*
|
|
2349
|
-
*
|
|
2350
|
-
*
|
|
2351
|
-
*
|
|
2352
|
-
* 注册契约(照抄 `dsh-client-ui-sidebar-files` 的写法):
|
|
2353
|
-
* · `sidebarRightTabs.register({id, kind, title, guide})` 注册**页签类型**;
|
|
2354
|
-
* · 体与标题各自注册在 `sidebar.right.pane.tab` / `sidebar.right.pane.tab.title`(keyed,钥匙是类型 id);
|
|
2355
|
-
* · `sidebarRight.openTab(kind)` 程序化打开(跨面跳转靠它)。
|
|
2356
|
-
*/
|
|
2357
|
-
/**
|
|
2358
|
-
* 图标挑法(原生那 75 个里选,语义要对得上):
|
|
2359
|
-
* · 世界树 = `IconBranchOutline16`(计划拓扑与分叉,原生就用它画分支)
|
|
2360
|
-
* · 技能 · 记忆 = `IconSkillOutline16`(原生专门有一枚技能图标)
|
|
2361
|
-
* 拿不到就留空 ⇒ 原生默认字形。
|
|
2993
|
+
* 切中栏视图走原生正门 `layout.selectPanel`;座位自己的 props 里有 `openView` 时优先用它。
|
|
2994
|
+
* `selectPanel` 对未注册的 key 会抛 ⇒ 包起来,点不动也不把面板带下水。
|
|
2362
2995
|
*/
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
* 与 **技能 · 记忆**(外脑)。
|
|
2366
|
-
*
|
|
2367
|
-
* 「进展」撤了:它原先装的四段各有归宿——计划与世界线的行归世界树,
|
|
2368
|
-
* 假设/观测/证据/事实归中栏「事实」,目标与判据归世界树的页眉,
|
|
2369
|
-
* 而"当下什么状态"由工具行那颗**计划芯片**回答(它一直在,不用切页签)。
|
|
2370
|
-
* 页签越少,越不需要向人解释每个页签该在什么时候看。
|
|
2371
|
-
*/
|
|
2372
|
-
/**
|
|
2373
|
-
* 标签与说明必须是**函数**:页签类型只在预设生效时注册一次,而语言座位是**随后**才切到
|
|
2374
|
-
* 用户偏好的——写成 `label: t('世界树')` 就把注册那一刻的语言固化了(界面中文、
|
|
2375
|
-
* 右栏页签却是 Worldlines)。惰性取值让原生每次渲染现问一次,切换语言立刻跟上。
|
|
2376
|
-
*/
|
|
2377
|
-
const rightRail = [
|
|
2378
|
-
{ id: 'clearai-worldtree', kind: 'clearai-worldtree', label: () => t('世界树'), order: 15, description: () => t('计划的步骤与闸门'), icon: NATIVE_ICONS.IconBranchOutline16 },
|
|
2379
|
-
]
|
|
2380
|
-
const shown = new Set()
|
|
2381
|
-
const syncRail = () => {
|
|
2382
|
-
const wanted = isCurrentPreset()
|
|
2383
|
-
if (!wanted) {
|
|
2384
|
-
for (const id of [...shown]) {
|
|
2385
|
-
const entry = railDisposers.get(id)
|
|
2386
|
-
if (entry !== undefined) entry()
|
|
2387
|
-
railDisposers.delete(id)
|
|
2388
|
-
shown.delete(id)
|
|
2389
|
-
}
|
|
2390
|
-
return
|
|
2391
|
-
}
|
|
2392
|
-
for (const tab of rightRail) {
|
|
2393
|
-
if (shown.has(tab.id)) continue
|
|
2394
|
-
shown.add(tab.id)
|
|
2395
|
-
const own = []
|
|
2996
|
+
const openPanel = (props, id) => {
|
|
2997
|
+
if (typeof props?.openView === 'function') {
|
|
2396
2998
|
try {
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
guide: [{ order: tab.order, title: tab.label, description: tab.description, icon: tab.icon }],
|
|
2402
|
-
}), `clearai: rail type ${tab.id}`))
|
|
2403
|
-
} catch (error) {
|
|
2404
|
-
// 类型已注册(同名同 layer)不是致命:如实记一笔,继续。
|
|
2405
|
-
console.warn?.(`${t('clearai 面板:右栏页签类型注册失败 ')}${String(error?.message ?? error)}`)
|
|
2999
|
+
props.openView(id)
|
|
3000
|
+
return true
|
|
3001
|
+
} catch {
|
|
3002
|
+
/* 退到 layout 那一路 */
|
|
2406
3003
|
}
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
* 反向跳:记住要展开哪条命题,再用**原生正门**切中栏视图。
|
|
2416
|
-
* `layout` 走可选读法(契约里就给了 `ctx.get('layout')` 这一路);
|
|
2417
|
-
* `selectPanel` 对未注册的 key 会抛 ⇒ 包起来,别把整棵树带下水。
|
|
2418
|
-
*/
|
|
2419
|
-
openFacts: (stepId) => {
|
|
2420
|
-
factsFocus.set({ step: stepId })
|
|
2421
|
-
const layout = ctx.get('layout')
|
|
2422
|
-
if (layout === undefined || typeof layout.selectPanel !== 'function') return false
|
|
2423
|
-
try {
|
|
2424
|
-
layout.selectPanel('clearai-facts')
|
|
2425
|
-
return true
|
|
2426
|
-
} catch {
|
|
2427
|
-
return false
|
|
2428
|
-
}
|
|
2429
|
-
},
|
|
2430
|
-
}))
|
|
2431
|
-
own.push(ctx.effect(() => slots.inject('sidebar.right.pane.tab', () => slots.register({ name: 'sidebar.right.pane.tab', key: tab.id }, body)), `clearai: rail body ${tab.id}`))
|
|
2432
|
-
own.push(ctx.effect(() => slots.inject('sidebar.right.pane.tab.title', () => slots.register({ name: 'sidebar.right.pane.tab.title', key: tab.id }, () => tab.label)), `clearai: rail title ${tab.id}`))
|
|
2433
|
-
railDisposers.set(tab.id, () => {
|
|
2434
|
-
for (const dispose of own) {
|
|
2435
|
-
try {
|
|
2436
|
-
dispose()
|
|
2437
|
-
} catch {
|
|
2438
|
-
/* 已经放过的不重复处理 */
|
|
2439
|
-
}
|
|
2440
|
-
}
|
|
2441
|
-
})
|
|
3004
|
+
}
|
|
3005
|
+
const layout = ctx.get('layout')
|
|
3006
|
+
if (layout === undefined || typeof layout.selectPanel !== 'function') return false
|
|
3007
|
+
try {
|
|
3008
|
+
layout.selectPanel(id)
|
|
3009
|
+
return true
|
|
3010
|
+
} catch {
|
|
3011
|
+
return false
|
|
2442
3012
|
}
|
|
2443
3013
|
}
|
|
2444
|
-
const railDisposers = new Map()
|
|
2445
|
-
|
|
2446
3014
|
/**
|
|
2447
|
-
*
|
|
2448
|
-
*
|
|
2449
|
-
*
|
|
3015
|
+
* 「立为问题 / 暂缓」:替人往这个会话里发一句话(与人在输入框里打字同一条路)。
|
|
3016
|
+
* 对话服务按会话作用域取(`sessions.scope(id)` 上的 `conversation`);拿不到就返回 false,
|
|
3017
|
+
* 界面如实说「请在对话中说明」。这里不写任何账:状态由模型的 Frame 修订落下。
|
|
2450
3018
|
*/
|
|
2451
|
-
const
|
|
3019
|
+
const sendFor = (props) => (text) => {
|
|
3020
|
+
const id = sessionIdFor(props)
|
|
3021
|
+
if (typeof id !== 'string' || typeof sessions.scope !== 'function') return false
|
|
2452
3022
|
try {
|
|
2453
|
-
|
|
3023
|
+
const scoped = sessions.scope(id)
|
|
3024
|
+
const conversation = typeof scoped?.get === 'function' ? scoped.get('conversation') : scoped?.conversation
|
|
3025
|
+
if (conversation === undefined || conversation === null || typeof conversation.send !== 'function') return false
|
|
3026
|
+
Promise.resolve(conversation.send(text)).catch(() => {})
|
|
2454
3027
|
return true
|
|
2455
3028
|
} catch {
|
|
2456
3029
|
return false
|
|
@@ -2483,19 +3056,16 @@ window.__ModuleLoader__.load({
|
|
|
2483
3056
|
const openPreviewFor = (props) => (path) => openNativePreview(sidebarRight, sessionIdFor(props), path)
|
|
2484
3057
|
|
|
2485
3058
|
/**
|
|
2486
|
-
*
|
|
2487
|
-
*
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
* 注册时必须把**打开器**交下去:这一格的证据出处、事实原件、跳世界树
|
|
2491
|
-
* 全靠这两个回调。漏了它们,界面看着能点、点了什么也不会发生——
|
|
2492
|
-
* 漏了它,「点击证据没反应」。
|
|
2493
|
-
*/
|
|
2494
|
-
/**
|
|
2495
|
-
* 注册时必须把**打开器**都交下去:证据的四类出处、事实原件、跳世界树全靠它们。
|
|
3059
|
+
* 中栏两格:**探索**(过程:问题、候选假设、下一步、过程记录)与**本体**(结果:结论、本体图、
|
|
3060
|
+
* 已确立的事实、经验)。本体货架与模型读的 `clear/knowledge/facts/INDEX.md` 是**同一张表**。
|
|
3061
|
+
*
|
|
3062
|
+
* 注册时必须把**打开器**都交下去:证据的出处、事实原件、两格之间的跳转全靠它们。
|
|
2496
3063
|
* 漏了它们,界面看着能点、点了什么也不会发生。
|
|
2497
3064
|
*/
|
|
2498
|
-
occupy('conversation.view', () => ({ id: 'clearai-
|
|
3065
|
+
occupy('conversation.view', () => ({ id: 'clearai-explore', order: 19, label: t('探索') }), (props) =>
|
|
3066
|
+
h(LocalizedExplore, { ...props, openSpectator, openPreview: openPreviewFor(props), send: sendFor(props), openFacts: () => openPanel(props, 'clearai-facts') }),
|
|
3067
|
+
)
|
|
3068
|
+
occupy('conversation.view', () => ({ id: 'clearai-facts', order: 20, label: t('本体') }), (props) => h(LocalizedFacts, { ...props, openSpectator, openPreview: openPreviewFor(props), send: sendFor(props), openExplore: () => openPanel(props, 'clearai-explore') }))
|
|
2499
3069
|
/**
|
|
2500
3070
|
* **计划面坐在原生 plan 那个座位上**。
|
|
2501
3071
|
*
|
|
@@ -2512,18 +3082,16 @@ window.__ModuleLoader__.load({
|
|
|
2512
3082
|
* · 遮蔽的代价是零——原生那个 occupant 在本模式下本来 `return null`。
|
|
2513
3083
|
* 而我们只在**当前会话是本预设**时占座(`occupy`),会话切走就还给它。
|
|
2514
3084
|
*/
|
|
2515
|
-
occupy('conversation.input.plan', { priority: -1 }, (props) => h(PlanChip, { ...props,
|
|
3085
|
+
occupy('conversation.input.plan', { priority: -1 }, (props) => h(PlanChip, { ...props, openExplore: () => openPanel(props, 'clearai-explore') }))
|
|
2516
3086
|
// 输入框下方的常驻派生条(运行态卡在人这一侧的对应物)
|
|
2517
3087
|
/**
|
|
2518
3088
|
* **输入框下那一条不再注册**:它说的话(阶段 / 完成度 / 当前步)与原生目标提示、
|
|
2519
3089
|
* 与工具行那颗计划 chip 重复 ✗,却**独占一行把输入框顶上去** ✗。
|
|
2520
|
-
* 唯一可点、且只有我们知道的那件事(「待处理 N」)已经并进计划 chip(
|
|
3090
|
+
* 唯一可点、且只有我们知道的那件事(「待处理 N」)已经并进计划 chip(同一行,一点直达探索货架)。
|
|
2521
3091
|
*/
|
|
2522
3092
|
ctx.effect(() => sessions.list.subscribe(() => {
|
|
2523
3093
|
for (const sync of seats) sync()
|
|
2524
|
-
syncRail()
|
|
2525
3094
|
}), t('clearai-loop: 席位跟着会话预设进出'))
|
|
2526
|
-
syncRail()
|
|
2527
3095
|
}
|
|
2528
3096
|
|
|
2529
3097
|
exports.apply = apply
|
|
@@ -2539,7 +3107,7 @@ window.__ModuleLoader__.load({
|
|
|
2539
3107
|
* 真的跑一遍渲染路径(捕 undefined 字段访问这类只有渲染时才炸的错)。
|
|
2540
3108
|
* 仍然不是给别的包用的接口。
|
|
2541
3109
|
*/
|
|
2542
|
-
exports.__components = { PlanChip, WorldTree, GraphBand, GraphInspector, NeedYou, TreeDetail, Atlas, AtlasHeader, ConclusionList, ConclusionRow, ConclusionDetail, StationBar, TrustTimeline, ClearAIMark, LOOP_LABEL }
|
|
3110
|
+
exports.__components = { PlanChip, WorldTree, ExploreView, AnswerCards, QuestionBox, NextBox, EmergentActions, GraphBand, GraphInspector, NeedYou, TreeDetail, Atlas, AtlasHeader, ConclusionList, ConclusionRow, ConclusionDetail, StationBar, TrustTimeline, ClearAIMark, LOOP_LABEL, EntityCard, KnowledgeFlowBox, KnowledgeItemRow, SettledLine, CountMarks }
|
|
2543
3111
|
/**
|
|
2544
3112
|
* 测试缝之三:命题那一列的**派生**是纯函数(分组、处境、来路、证据链),
|
|
2545
3113
|
* 渲染本身没法在没浏览器的地方细究——把它导出去,让测试直接断言派生结果。
|