dsh-form-fill-agent 0.2.13 → 0.2.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # AI填表智能体
2
2
 
3
+ ## 安装与三分钟上手
4
+
5
+ AI填表智能体:支持自动填表、表格填充、表格补全、Excel填表与 Excel回填;使用企查查 MCP 填写 XLSX 空白字段,预览确认后导出新副本。
6
+
7
+ ```sh
8
+ dsh plugin --profile web add dsh-form-fill-agent@0.2.15
9
+ ```
10
+
11
+ 请先满足下文的 DSH、连接器及侧边栏依赖要求;安装后完整停止并重启对应 Profile。
12
+
13
+ 打开“AI填表”并展开合成演示,选择客户台账模板,检查工作表、企业主体和空白字段。需要真实补全时确认数据来源及范围并手动发送指令;核对单元格预览后下载新 XLSX 副本。
14
+
15
+ **流程样例(示意,非真实调用结果):** 合成客户台账的空白字段 → 字段映射和主体核验 → 单元格级事实/来源预览 → 人工确认 → 新 XLSX 与变更清单。
16
+
17
+ **能力边界:** 仅支持当前文件安全规则允许的 XLSX;不支持 Word、宏、图片和复杂布局。默认只填空白,不用模型猜值;查询使用用户已授权 MCP 账号额度。
18
+
19
+ **升级与回滚:** 升级前停止 Profile 并备份任务目录,记录当前精确版本;使用上面的固定版本命令升级,再完整重启。回滚时将版本号替换为升级前记录的版本,并使用升级前任务目录副本;不以旧版直接读取已迁移任务目录。
20
+
21
+ 相关智能体:[数据清洗补全](https://github.com/duhu2000/dsh-data-cleaning-agent) · [AI填表](https://github.com/duhu2000/dsh-form-fill-agent) · [访前尽调](https://github.com/duhu2000/dsh-pre-duediligence) · [招投标](https://github.com/duhu2000/dsh-tender-workbench)
22
+
23
+
3
24
  [![npm](https://img.shields.io/npm/v/dsh-form-fill-agent)](https://www.npmjs.com/package/dsh-form-fill-agent)
4
25
  [![GitHub release](https://img.shields.io/github/v/release/duhu2000/dsh-form-fill-agent)](https://github.com/duhu2000/dsh-form-fill-agent/releases)
5
26
 
@@ -43,7 +64,7 @@ dsh plugin --profile web add dsh-form-fill-agent@latest
43
64
 
44
65
  ## 使用边界与数据保存
45
66
 
46
- 补充要求为模型可读文本;字段或工作表范围请通过向导/工作台修改,不能仅改文字后假定执行范围已同步。任务 schema 5 可读取 schema 1–5;回退旧版本请使用升级前目录副本或独立任务目录。主包为 0.2.13,共享内核为 0.2.9,Provider 为 0.2.1,共享字段契约为 0.1.0。
67
+ 补充要求为模型可读文本;字段或工作表范围请通过向导/工作台修改,不能仅改文字后假定执行范围已同步。任务 schema 5 可读取 schema 1–5;回退旧版本请使用升级前目录副本或独立任务目录。主包为 0.2.14,共享内核为 0.2.9,Provider 为 0.2.1,共享字段契约为 0.1.0。
47
68
 
48
69
  支持企业完整登记名称或 18 位信用代码;简称、主体不一致或多候选不会自动猜选。仅有信用代码的表格也可作为查询锚点。连接候选检索工具时可检索简称,仍需人工确认;缺少工具时降级人工输入。字段映射采用确定性规则及人工确认,不让模型编造事实。支持普通内部公式、固定区域下拉、基础条件格式和普通表格对象;复杂 Excel 结构和 Word 暂不支持,保真边界见下方安全说明。
49
70
 
@@ -51,7 +72,7 @@ dsh plugin --profile web add dsh-form-fill-agent@latest
51
72
 
52
73
  显式设置 DSH_HOME 时,任务保存至其 form-fill-tasks 目录,默认 24 小时过期;未设置时使用内存。任务保存输入表格和归一化预览,不持久化原始 MCP 响应,可主动删除任务。模型及 MCP 凭据由宿主管理。
53
74
 
54
- 0.2.13 保存任务 schema 5,兼容读取旧 schema 1–4;回退旧版本须使用升级前任务目录副本或新目录,防止丢失已确认的字段/主体设置。
75
+ 0.2.14 保存任务 schema 5,兼容读取旧 schema 1–4;回退旧版本须使用升级前任务目录副本或新目录,防止丢失已确认的字段/主体设置。
55
76
 
56
77
  ## 文档与反馈
57
78
 
package/lib/brand.css CHANGED
@@ -48,3 +48,4 @@
48
48
  .ff-ui #wizard .dialog-head{align-items:flex-start;border-bottom:0;padding:24px 24px 12px}.ff-ui #wizard .dialog-head h2{margin:0;font-size:22px}.ff-ui #wizard .dialog-head p{margin:8px 0 0;line-height:1.6}.ff-ui #wizard-close{border-radius:50%;width:44px;height:44px;min-width:44px;padding:0;font-size:26px;line-height:1}.ff-ui .ff-wizard-nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;padding:8px 24px 12px;flex-shrink:0}.ff-ui .ff-wizard-nav button{display:flex;align-items:center;gap:8px;min-height:52px;padding:10px;font-size:14px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--text);text-align:left}.ff-ui .ff-step-number{display:inline-flex;align-items:center;justify-content:center;flex:0 0 28px;height:28px;border-radius:50%;background:var(--line);color:var(--muted);font-weight:600}.ff-ui .ff-wizard-nav button[aria-current=true]{border-color:var(--action);background:var(--soft);color:var(--action)}.ff-ui .ff-wizard-nav button[aria-current=true] .ff-step-number{background:var(--action);color:white}.ff-ui #wizard .dialog-body{padding:16px 24px 24px}.ff-ui #wizard h3{font-size:18px;margin:0 0 12px}.ff-ui #wizard p{line-height:1.65}.ff-ui .ff-upload-zone{padding:18px;background:var(--page);border:1px dashed var(--line);border-radius:8px}.ff-ui .ff-upload-zone label{display:grid;gap:12px;font-weight:600}.ff-ui .ff-service-note{padding:12px 16px;border-radius:8px;background:var(--page);color:var(--muted)}.ff-ui #wizard .dialog-footer{padding:16px 24px}.ff-ui #wizard .dialog-footer button{min-height:44px}
49
49
  @media(max-width:640px){.ff-ui .ff-wizard-nav{grid-template-columns:repeat(2,minmax(0,1fr));padding:8px 14px;gap:6px}.ff-ui .ff-wizard-nav button{min-height:44px;padding:6px 8px}.ff-ui #wizard .dialog-head{padding:16px 14px 8px}.ff-ui #wizard .dialog-head h2{font-size:20px}.ff-ui #wizard .dialog-head p{font-size:13px}.ff-ui #wizard .dialog-body{padding:14px}.ff-ui #wizard .dialog-footer{padding:12px 14px}}
50
50
  .ff-ui .ff-next-action{position:fixed;bottom:0;left:0;right:0;z-index:20;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 20px;background:var(--surface);border-top:1px solid var(--line);box-shadow:0 -3px 12px #0001}.ff-ui .ff-next-action[hidden]{display:none}.ff-ui main{padding-bottom:100px}.ff-ui #direct-ack-label{display:block;padding:14px;margin:16px 0;background:var(--soft);border:1px solid var(--action);border-radius:8px}.ff-ui #direct-ack-label[hidden]{display:none}.ff-ui #wizard-open{display:block;min-height:44px;margin-top:12px}.ff-ui #scope-omissions-list{max-height:180px;overflow:auto;overflow-wrap:anywhere}.ff-ui .ff-task-more{margin:20px;color:var(--muted)}@media(max-width:480px){.ff-ui .ff-next-action{flex-direction:column;align-items:stretch;padding:10px 14px}.ff-ui .ff-next-action span{font-size:12px}}
51
+ .ff-ui #anchor-alert:not(:empty){padding:16px;border:1px solid var(--error);border-left:5px solid var(--error);border-radius:8px;background:color-mix(in srgb,var(--error) 10%,var(--surface));color:var(--error);font-weight:600;overflow-wrap:anywhere}.ff-ui .ff-mapping-conflict{border:2px solid var(--error);border-radius:8px;padding:12px;background:color-mix(in srgb,var(--error) 6%,var(--surface))}.ff-ui .ff-mapping-conflict .ff-mapping-status{color:var(--error);font-weight:600}
package/lib/ui.html CHANGED
@@ -153,6 +153,12 @@ async function directDraft(){
153
153
  if(parent===window){$('direct-command').hidden=false;$('direct-command').value=command();$('direct-command').focus();$('direct-command').select();$('status').textContent='指令已生成,请复制到 DSH 对话框发送。';return}
154
154
  $('status').textContent='正在回填到对话框…';await sendDraft();
155
155
  }
156
+ function highlightMappingConflicts(){
157
+ for(const section of $('mapping').querySelectorAll('fieldset')){
158
+ const fields=[...section.querySelectorAll('select[data-column]')];
159
+ for(const field of fields){const conflict=!!field.value&&fields.some(other=>other!==field&&other.value===field.value);field.setAttribute('aria-invalid',String(conflict));const row=field.closest('.ff-mapping-row');row.classList.toggle('ff-mapping-conflict',conflict);if(conflict){const message=row.querySelector('.ff-mapping-status');message.textContent='映射冲突:另一列也选择了此字段。请保留其中一列,或为本列选择其他字段。';}}
160
+ }
161
+ }
156
162
  function filterResults(){const query=$('result-search').value.trim().toLowerCase(),rows=[...$('changes').rows];let shown=0;for(const tr of rows){tr.hidden=!!query&&!tr.textContent.toLowerCase().includes(query);if(!tr.hidden)shown++}const selected=rows.filter(tr=>tr.querySelector('input')?.checked).length;$('result-count').textContent=rows.length?'显示 '+shown+' / '+rows.length+' 格 · 已选 '+selected+' 格'+(!shown?' · 无匹配结果':''):'暂无可填写单元格'}
157
163
  function renderSettings(data){
158
164
  $('mapping').replaceChildren();$('entities').replaceChildren();
@@ -262,7 +268,7 @@ function readMapping(){const configuration={sheets:[],headers:[],mappings:[]};fo
262
268
  function mappingSignature(configuration){return JSON.stringify(configuration.headers.map(h=>({sheet:h.sheet,row:h.row,cells:current.structure.find(s=>s.name===h.sheet)?.rows.find(r=>r.number===h.row)?.cells}))) }
263
269
  $('mapping-save').onclick=()=>{try{if(!current||busy)return;const configuration=readMapping();localStorage.setItem('ff-mapping:'+owner,JSON.stringify({schema:1,signature:mappingSignature(configuration),configuration}));$('status').textContent='字段规则已保存在本浏览器。'}catch{$('status').textContent='浏览器无法保存字段规则。'}};
264
270
  $('mapping-load').onclick=async()=>{if(!current||busy)return;controls(true);try{const saved=JSON.parse(localStorage.getItem('ff-mapping:'+owner)||'null');if(saved?.schema!==1||saved.signature!==mappingSignature(saved.configuration))throw Error('没有与当前工作表及表头一致的规则,请手动设置。');render(await api('/configure',{id:current.id,configuration:saved.configuration}));$('status').textContent='字段规则已复用,请检查后重新核验。'}catch(e){$('status').textContent=e.message}finally{controls(false)}};
265
- $('configure').onclick=async()=>{if(!current||busy)return;const configuration=readMapping();controls(true);$('mapping-next').hidden=true;try{render(await api('/configure',{id:current.id,configuration}));const review=directScope();$('status').textContent=review.blocked?'设置已保存,但尚不能执行。'+review.problem:'字段设置已应用,旧预览已清除,请重新核验。';$('mapping-next').hidden=review.blocked;if(review.blocked){$('anchor-alert').textContent=review.problem;$('anchor-alert').scrollIntoView({block:'center'})}else $('mapping-next').scrollIntoView({block:'nearest'});}catch(e){$('status').textContent=e.message}finally{controls(false)}};
271
+ $('configure').onclick=async()=>{if(!current||busy)return;const configuration=readMapping();controls(true);$('mapping-next').hidden=true;try{render(await api('/configure',{id:current.id,configuration}));const review=directScope();$('status').textContent=review.blocked?'设置已保存,但尚不能执行。'+review.problem:'字段设置已应用,旧预览已清除,请重新核验。';if(review.blocked){$('anchor-alert').textContent='请完善字段设置:'+review.problem;highlightMappingConflicts();$('anchor-alert').scrollIntoView({block:'center'})}else{navigate('identity');$('wizard-open').scrollIntoView({block:'center'});$('wizard-open').focus()}}catch(e){$('status').textContent=e.message;$('anchor-alert').textContent='字段设置未能应用:'+e.message;$('anchor-alert').scrollIntoView({block:'center'})}finally{controls(false)}};
266
272
  $('samples').onclick=async e=>{if(!e.target.dataset.name||busy)return;const name=e.target.dataset.name;try{const response=await fetch(basePath+'/fixture/'+encodeURIComponent(name));if(!response.ok)throw Error('模板读取失败');await preview(await response.arrayBuffer(),name+'.xlsx',true)}catch(e){$('status').textContent=e.message}};
267
273
  $('confirm').onclick=async()=>{if(!current||busy)return;controls(true);try{await api('/confirm',{id:current.id,confirmChangeSetId:current.changeSet.changeSetId});current=await api('/task/'+current.id);render(current);downloads();$('status').textContent='副本已生成,原文件保持不变。'}catch(e){$('status').textContent=e.message}finally{controls(false)}};
268
274
  $('selection').onclick=async()=>{if(!current||busy)return;controls(true);try{render(await api('/select',{id:current.id,selectedIds:[...$('changes').querySelectorAll('input:checked')].map(x=>x.value)}));$('status').textContent='选择已应用,请核对新的预览。'}catch(e){$('status').textContent=e.message}finally{controls(false)}};
package/package.json CHANGED
@@ -1,10 +1,18 @@
1
1
  {
2
2
  "name": "dsh-form-fill-agent",
3
- "version": "0.2.13",
3
+ "version": "0.2.15",
4
4
  "private": false,
5
- "description": "AI填表智能体:XLSX blank-cell preview, QCC enrichment and persistent tasks for DSH.",
6
- "repository": { "type": "git", "url": "git+https://github.com/duhu2000/dsh-form-fill-agent.git", "directory": "packages/dsh-form-fill-agent" },
7
- "publishConfig": { "access": "public", "tag": "latest", "registry": "https://registry.npmjs.org/" },
5
+ "description": "AI form filling and spreadsheet autofill for XLSX in DeepSeek Harness, using authorized Qichacha MCP facts with cell previews, user confirmation and export to a new copy.",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/duhu2000/dsh-form-fill-agent.git",
9
+ "directory": "packages/dsh-form-fill-agent"
10
+ },
11
+ "publishConfig": {
12
+ "access": "public",
13
+ "tag": "latest",
14
+ "registry": "https://registry.npmjs.org/"
15
+ },
8
16
  "type": "module",
9
17
  "main": "lib/index.js",
10
18
  "exports": {
@@ -28,9 +36,32 @@
28
36
  "qcc-form-fill-provider": "0.2.1"
29
37
  },
30
38
  "dsh": {
31
- "client": { "inject": ["@deepseek-ai/dsh-client-ui-layout", "@deepseek-ai/dsh-client-ui-conversation"], "platform": "web" },
39
+ "client": {
40
+ "inject": [
41
+ "@deepseek-ai/dsh-client-ui-layout",
42
+ "@deepseek-ai/dsh-client-ui-conversation"
43
+ ],
44
+ "platform": "web"
45
+ },
32
46
  "bundle": {
33
47
  "patch": "./cordis.patch.yml"
34
48
  }
35
- }
49
+ },
50
+ "keywords": [
51
+ "AI填表",
52
+ "AI 填表",
53
+ "自动填表",
54
+ "表格填充",
55
+ "表格补全",
56
+ "Excel填表",
57
+ "Excel回填",
58
+ "form filling",
59
+ "spreadsheet autofill",
60
+ "企查查MCP",
61
+ "企查查 MCP",
62
+ "form-filling",
63
+ "spreadsheet-autofill",
64
+ "xlsx",
65
+ "enterprise-data"
66
+ ]
36
67
  }