# 高通用性功能:格式与限制 插件0.4.0。所有新组件使用 `dsh-ui` 围栏,`type` 决定类型,也支持对应 `dsh-table` 等标签。DSH隐藏语言时识别明确类型,普通json代码块不改。单块源内容最多40000字符。数据、评分、引用和公式来自模型回复;插件不联网补造。 ## 交互表格(table) Interactive table: columns 1–12 {id,label,type:text|number,editable?:boolean,expression?:string}; rows 0–200 {id,values:{columnId:value}}. Supply every raw cell; formula columns are read-only number columns and may reference only raw numeric column IDs, no formula chains. Search, header sorting, column visibility and CSV export are built in. Optional chart {type:bar|line,category:columnId,series:[numericColumnId]} uses the same edited/filtered rows; at most24 rows are graphed, otherwise asks to filter. Do not invent data. Common: emit complete fenced dsh-ui JSON with type table, title and optional description. IDs letter-led ASCII letters/digits/underscore/hyphen, unique within the specified scope; numeric expression IDs cannot contain hyphens or reserved constants/function names. Numeric values finite abs<=1e12; texts are literal. All interactions are local; copy and send results explicitly to continue. Original source always available. Example (sample data/assumptions, not factual claims): ```dsh-ui {"type":"table","title":"数量与成本","columns":[{"id":"item","label":"项目","type":"text"},{"id":"qty","label":"数量","type":"number","editable":true},{"id":"price","label":"单价","type":"number","editable":true},{"id":"total","label":"总价","type":"number","expression":"qty*price"}],"rows":[{"id":"a","values":{"item":"甲","qty":2,"price":30}},{"id":"b","values":{"item":"乙","qty":3,"price":20}}],"chart":{"type":"bar","category":"item","series":["total"]}} ``` ## 计算器(calculator) Calculator/unit conversion: fields 1–12 {id,label,min,max,value,step?,unit?}, results 1–12 {label,expression,unit?}. Input min=start; total span<=366days; dependencies must exist and cannot cycle. Built-in three-view switch, month navigation, progress and dependency labels. No automatic rescheduling, critical-path computation or external calendar writes. Common: emit complete fenced dsh-ui JSON with type schedule, title and optional description. IDs letter-led ASCII letters/digits/underscore/hyphen, unique within the specified scope; numeric expression IDs cannot contain hyphens or reserved constants/function names. Numeric values finite abs<=1e12; texts are literal. All interactions are local; copy and send results explicitly to continue. Original source always available. Example (sample data/assumptions, not factual claims): ```dsh-ui {"type":"schedule","title":"交付排期示例","view":"gantt","items":[{"id":"a","title":"整理需求","start":"2026-10-19","end":"2026-10-20","progress":100},{"id":"b","title":"实施","start":"2026-10-21","end":"2026-10-23","progress":40,"dependsOn":["a"]},{"id":"c","title":"验收","start":"2026-10-24","dependsOn":["b"]}]} ``` ## 清单和看板(board) Task list/kanban: columns 1–8 {id,label}, items 0–100 {id,label,column:columnId,done?:boolean}. User may check completion, move with a select or drag across columns, and switch list/board. Column and completion are independent (moving does not secretly mark done). Local display only; no changes to the DSH task system. Common: emit complete fenced dsh-ui JSON with type board, title and optional description. IDs letter-led ASCII letters/digits/underscore/hyphen, unique within the specified scope; numeric expression IDs cannot contain hyphens or reserved constants/function names. Numeric values finite abs<=1e12; texts are literal. All interactions are local; copy and send results explicitly to continue. Original source always available. Example (sample data/assumptions, not factual claims): ```dsh-ui {"type":"board","title":"交付清单","columns":[{"id":"todo","label":"待办"},{"id":"doing","label":"进行中"},{"id":"done","label":"已完成"}],"items":[{"id":"a","label":"整理需求","column":"done","done":true},{"id":"b","label":"实现功能","column":"doing"},{"id":"c","label":"验收结果","column":"todo"}]} ``` ## 层级、思维导图和折叠阅读(tree) Hierarchy/reading: view tree|mindmap|accordion, nodes [{id,label,body?,children?:[same]}], total<=80nodes and depth<=7; body<=4000chars. IDs unique across whole tree. Built-in view switch, search, expand/collapse all, local expansion state. Accordion is suitable for progressively revealing long answers. Content is text, not executable HTML or Markdown. Common: emit complete fenced dsh-ui JSON with type tree, title and optional description. IDs letter-led ASCII letters/digits/underscore/hyphen, unique within the specified scope; numeric expression IDs cannot contain hyphens or reserved constants/function names. Numeric values finite abs<=1e12; texts are literal. All interactions are local; copy and send results explicitly to continue. Original source always available. Example (sample data/assumptions, not factual claims): ```dsh-ui {"type":"tree","title":"报告结构","view":"tree","nodes":[{"id":"root","label":"项目报告","body":"选择视图可切换层级树、思维导图和折叠阅读。","children":[{"id":"goal","label":"目标","body":"说明要解决的问题。"},{"id":"plan","label":"计划","children":[{"id":"step","label":"执行步骤","body":"列出步骤与验收条件。"}]}]}]} ``` ## 分步播放(steps) Step playback: scene 1–40 [{id,label}] (optional, defaults to step IDs/titles), steps 1–40 {id,title,body,active?:[sceneId]}, interval?:700..10000ms. Explicit active scene nodes are highlighted at each step. Built-in play, pause, back, next and direct jump; timer stops on unmount/disable. This is a discrete explanation, not an invented physics/network simulation. Common: emit complete fenced dsh-ui JSON with type steps, title and optional description. IDs letter-led ASCII letters/digits/underscore/hyphen, unique within the specified scope; numeric expression IDs cannot contain hyphens or reserved constants/function names. Numeric values finite abs<=1e12; texts are literal. All interactions are local; copy and send results explicitly to continue. Original source always available. Example (sample data/assumptions, not factual claims): ```dsh-ui {"type":"steps","title":"从需求到交付","interval":1500,"scene":[{"id":"input","label":"需求"},{"id":"work","label":"实施"},{"id":"check","label":"验收"}],"steps":[{"id":"one","title":"整理需求","body":"明确输入、输出和约束。","active":["input"]},{"id":"two","title":"执行方案","body":"依据已经确认的目标实施。","active":["work"]},{"id":"three","title":"检查交付","body":"根据验收条件逐项检查。","active":["check"]}]} ``` ## 分支向导(wizard) Branching guide: start:nodeId, nodes 1–24 {id,title,body?,options?:[{id,label,next:nodeId}]}. A node with no options is terminal; choice nodes have2–10 options. Unique node/option IDs, references valid, no cycles. Next follows selected branch; back/restart/copy path are local. Does not submit decisions or execute operations. Common: emit complete fenced dsh-ui JSON with type wizard, title and optional description. IDs letter-led ASCII letters/digits/underscore/hyphen, unique within the specified scope; numeric expression IDs cannot contain hyphens or reserved constants/function names. Numeric values finite abs<=1e12; texts are literal. All interactions are local; copy and send results explicitly to continue. Original source always available. Example (sample data/assumptions, not factual claims): ```dsh-ui {"type":"wizard","title":"选择计划形式","start":"goal","nodes":[{"id":"goal","title":"你想先处理什么?","options":[{"id":"a","label":"快速执行","next":"quick"},{"id":"b","label":"梳理问题","next":"detail"}]},{"id":"quick","title":"执行清单","body":"先列出三个最小可执行步骤,再逐项检查。"},{"id":"detail","title":"澄清需求","options":[{"id":"a","label":"目标不明确","next":"target"},{"id":"b","label":"约束不明确","next":"limits"}]},{"id":"target","title":"确定目标","body":"先写下希望得到的结果。"},{"id":"limits","title":"确定约束","body":"先列出时间、资源及边界。"}]} ``` ## 修订对照(diff) Text/code revision: before:string, after:string (each<=12000chars/300lines), notes?:[{afterLine:positiveLineNumber,text}]. Built-in side-by-side/unified toggle, changes-only toggle and copy-after. Source text must be exact; this does not edit files. Line diff is local LCS and original line numbers remain visible. Common: emit complete fenced dsh-ui JSON with type diff, title and optional description. IDs letter-led ASCII letters/digits/underscore/hyphen, unique within the specified scope; numeric expression IDs cannot contain hyphens or reserved constants/function names. Numeric values finite abs<=1e12; texts are literal. All interactions are local; copy and send results explicitly to continue. Original source always available. Example (sample data/assumptions, not factual claims): ```dsh-ui {"type":"diff","title":"修订对照","before":"整理需求\n执行方案\n交付","after":"整理并确认需求\n执行方案\n检查结果\n交付","notes":[{"afterLine":1,"text":"增加确认,避免目标含糊。"},{"afterLine":3,"text":"交付前增加检查。"}]} ``` ## 证据和来源(sources) Evidence/source cards: sources 1–30 {id,title,url:http(s),excerpt?}, claims 1–50 {id,text,sourceIds:[sourceId]}. Only use sources actually known/provided; no invented quotes or verification claims. Source filters/search link claims to cited material; clicking a source link opens externally, no automatic network fetch. URL credentials, javascript/file/data URLs are rejected. Common: emit complete fenced dsh-ui JSON with type sources, title and optional description. IDs letter-led ASCII letters/digits/underscore/hyphen, unique within the specified scope; numeric expression IDs cannot contain hyphens or reserved constants/function names. Numeric values finite abs<=1e12; texts are literal. All interactions are local; copy and send results explicitly to continue. Original source always available. Example (sample data/assumptions, not factual claims): ```dsh-ui {"type":"sources","title":"来源展示示例","description":"仅演示引用关系;示例链接不表示结论已核实。","sources":[{"id":"a","title":"示例资料A","url":"https://example.com/reference-a","excerpt":"这是占位摘录,不是真实证据。"},{"id":"b","title":"示例资料B","url":"https://example.com/reference-b","excerpt":"第二段占位摘录。"}],"claims":[{"id":"one","text":"示例结论一关联资料A。","sourceIds":["a"]},{"id":"two","text":"示例结论二关联资料A和B。","sourceIds":["a","b"]}]} ``` ## 联动报告(dashboard) Shared-data report: data uses table columns/rows (read-only dashboard), optional filterColumn:columnId, views1–8 {id,title,kind:table|chart|metrics}. Chart view: chartType:bar|line|pie|donut|stacked,category:columnId,series:[numericColumnId]; pie/donut require exactly one nonnegative series. Metrics view: metrics [{label,op:sum|mean|count,column?}], sum/mean require numeric column; empty mean/sum undefined, count0. Global search/category filter feeds ALL views; tabs switch views. No duplicated unrelated datasets; counts and totals derive from shared rows. Chart limits24rows; narrow with filters if larger. Common: emit complete fenced dsh-ui JSON with type dashboard, title and optional description. IDs letter-led ASCII letters/digits/underscore/hyphen, unique within the specified scope; numeric expression IDs cannot contain hyphens or reserved constants/function names. Numeric values finite abs<=1e12; texts are literal. All interactions are local; copy and send results explicitly to continue. Original source always available. Example (sample data/assumptions, not factual claims): ```dsh-ui {"type":"dashboard","title":"预算与实际联动报告","filterColumn":"team","data":{"columns":[{"id":"item","label":"项目","type":"text"},{"id":"team","label":"分组","type":"text"},{"id":"budget","label":"预算","type":"number"},{"id":"actual","label":"实际","type":"number"}],"rows":[{"id":"a","values":{"item":"甲","team":"一组","budget":12,"actual":10}},{"id":"b","values":{"item":"乙","team":"一组","budget":18,"actual":20}},{"id":"c","values":{"item":"丙","team":"二组","budget":9,"actual":8}}]},"views":[{"id":"metrics","title":"汇总","kind":"metrics","metrics":[{"label":"预算合计","column":"budget","op":"sum"},{"label":"实际合计","column":"actual","op":"sum"},{"label":"项目数","op":"count"}]},{"id":"chart","title":"项目对比","kind":"chart","chartType":"bar","category":"item","series":["budget","actual"]},{"id":"table","title":"明细","kind":"table"}]} ``` ## 图表与参数探索 `dsh-chart`支持bar、line、stacked、pie、donut,最多24标签、4系列。pie/donut只允许一组非负且总和大于零的数据。系列开关、起止范围、坐标图拖选、鼠标/键盘读数、表图高亮、当前SVG导出均在本地运行;不修改原始数据。堆叠图分别累计正负值。图表缩放是分类范围缩放,不是任意连续坐标平移。 `dsh-explorer`沿用第四阶段格式,额外提供最多3个命名参数快照、载入/移除及比较。一次叠加比较选定的一条曲线,当前加快照最多4条,使用相同坐标轴;另列各项指标。快照仅保存参数,不复制采样数组。SVG工具栏导出主图,快照结果可用复制获取。 ## 本地边界 所有操作默认留在本机,不自动发消息、修改文件或创建外部任务/日历事件。数据与偏好最多保留80块、约280000字符,旧记录可能淘汰;本地存储失败时界面提示临时状态。来源卡片仅在用户点击链接时打开外部页面。思维导图与排期等使用DOM/CSS绘制,并非所有组件都可导出SVG;图表与原流程图可以导出SVG,表格/报告可导出CSV。 0.4阶段未加入低通用性专用组件(散点/直方/箱线/热力/误差图、专项系统图、练习题扩展、图片热点、几何、地图等)。0.5阶段另增加了通用隔离作品页面,复杂小应用可按作品格式实现,见第五阶段作品格式说明;这不代表已有上述各类专用组件。