dsh-form-fill-agent 0.2.10 → 0.2.11
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 +2 -2
- package/lib/brand.css +1 -0
- package/lib/ui.html +5 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@ dsh plugin --profile web add dsh-form-fill-agent@latest
|
|
|
43
43
|
|
|
44
44
|
## 使用边界与数据保存
|
|
45
45
|
|
|
46
|
-
补充要求为模型可读文本;字段或工作表范围请通过向导/工作台修改,不能仅改文字后假定执行范围已同步。任务 schema 5 可读取 schema 1–5;回退旧版本请使用升级前目录副本或独立任务目录。主包为 0.2.
|
|
46
|
+
补充要求为模型可读文本;字段或工作表范围请通过向导/工作台修改,不能仅改文字后假定执行范围已同步。任务 schema 5 可读取 schema 1–5;回退旧版本请使用升级前目录副本或独立任务目录。主包为 0.2.11,共享内核为 0.2.8,Provider 保持 0.2.0。
|
|
47
47
|
|
|
48
48
|
支持企业完整登记名称或 18 位信用代码;简称、主体不一致或多候选不会自动猜选。仅有信用代码的表格也可作为查询锚点。连接候选检索工具时可检索简称,仍需人工确认;缺少工具时降级人工输入。字段映射采用确定性规则及人工确认,不让模型编造事实。支持普通内部公式、固定区域下拉、基础条件格式和普通表格对象;复杂 Excel 结构和 Word 暂不支持,保真边界见下方安全说明。
|
|
49
49
|
|
|
@@ -51,7 +51,7 @@ dsh plugin --profile web add dsh-form-fill-agent@latest
|
|
|
51
51
|
|
|
52
52
|
显式设置 DSH_HOME 时,任务保存至其 form-fill-tasks 目录,默认 24 小时过期;未设置时使用内存。任务保存输入表格和归一化预览,不持久化原始 MCP 响应,可主动删除任务。模型及 MCP 凭据由宿主管理。
|
|
53
53
|
|
|
54
|
-
0.2.
|
|
54
|
+
0.2.11 保存任务 schema 5,兼容读取旧 schema 1–4;回退旧版本须使用升级前任务目录副本或新目录,防止丢失已确认的字段/主体设置。
|
|
55
55
|
|
|
56
56
|
## 文档与反馈
|
|
57
57
|
|
package/lib/brand.css
CHANGED
|
@@ -47,3 +47,4 @@
|
|
|
47
47
|
.ff-ui .ff-field-picker{position:relative;width:100%;min-width:0}.ff-ui .ff-field-picker>summary{padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:var(--surface);cursor:pointer;overflow-wrap:anywhere}.ff-ui .ff-field-picker[open]>summary{border-color:var(--blue)}.ff-ui .ff-field-panel{padding:12px;border:1px solid var(--line);border-radius:8px;background:var(--surface);margin-top:4px;min-width:0}.ff-ui .ff-field-panel select[data-column]{width:100%;height:auto;max-width:100%}.ff-ui .ff-field-panel optgroup{font-weight:600}.ff-ui .ff-field-panel option{padding:7px;font-weight:400}
|
|
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
|
+
.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}}
|
package/lib/ui.html
CHANGED
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
<details><summary>体验合成模板</summary><p>下面模板只使用合成数据,不查询真实企业。</p><div class="controls" id="samples"><button class="secondary" data-name="客户台账">客户台账</button><button class="secondary" data-name="供应商准入表">供应商准入表</button><button class="secondary" data-name="合同主体信息表">合同主体信息表</button></div></details></div>
|
|
17
17
|
<section id="preview" hidden>
|
|
18
18
|
<div class="card" data-pane="rules"><h2>字段与规则</h2><p id="structure"></p><p id="anchor-alert" role="status"></p><p>默认只填空白。可选择工作表、修正表头行及字段;应用设置会清除旧预览和主体确认,请重新核验。</p><label>搜索字段 <input id="mapping-search" type="search" placeholder="按原表字段名称筛选"></label><p class="muted">未识别字段可手动选择;没有数据来源的字段选择“不填写”。规则只保存表头与映射,不含记录。</p><button id="mapping-save">保存字段规则</button><button id="mapping-load">复用字段规则</button><div id="mapping"></div><button id="configure" class="primary">应用字段设置</button><div id="mapping-next" hidden role="status"><p>设置已保存。下一步核验企业主体,确认填写范围后生成指令并发送,查询结果会进入填写预览。</p><button id="mapping-continue" class="primary">下一步:主体核验</button></div></div>
|
|
19
|
-
<div class="card" data-pane="identity"><h2>主体核验与查询</h2><p id="connection"></p><p>候选不自动选择。查询返回歧义后,可选择返回候选或填写已核验的完整登记名称/信用代码;原表主体文字不覆盖,选择仅用于后续查询。</p><div id="entities"></div><div id="direct-scope" role="status"></div><label id="direct-ack-label" hidden><input id="direct-ack" type="checkbox">确认仅填写已纳入的原表字段</label><textarea id="direct-command" aria-label="填写指令" readonly hidden></textarea><button id="wizard-open">生成填写指令</button><p class="muted">查询不会自动发送;回填后可在原生对话框修改并发送。</p></div>
|
|
19
|
+
<div class="card" data-pane="identity"><h2>主体核验与查询</h2><p id="connection"></p><p>候选不自动选择。查询返回歧义后,可选择返回候选或填写已核验的完整登记名称/信用代码;原表主体文字不覆盖,选择仅用于后续查询。</p><div id="entities"></div><div id="direct-scope" role="status"></div><details id="scope-omissions" hidden><summary>查看未纳入字段</summary><p id="scope-omissions-list"></p></details><label id="direct-ack-label" hidden><input id="direct-ack" type="checkbox">确认仅填写已纳入的原表字段</label><textarea id="direct-command" aria-label="填写指令" readonly hidden></textarea><button id="wizard-open" class="primary">生成填写指令</button><p class="muted">查询不会自动发送;回填后可在原生对话框修改并发送。</p></div>
|
|
20
20
|
<div class="card" data-pane="preview"><h2>填写预览</h2><p id="summary"></p><details><summary>逐列填写结果</summary><p class="muted">按单元格统计;整行缺少主体标识的情况另见下方原因分类。</p><div class="scroll"><table><thead><tr><th>原表字段</th><th>映射字段</th><th>预览可填写格数</th><th>未完成项</th></tr></thead><tbody id="field-results"></tbody></table></div></details><p class="muted">每格显示原值、准备填写值和来源。取消勾选后点击“应用选择”,再确认新的预览。</p>
|
|
21
21
|
<div class="toolbar"><label>筛选单元格 <input id="result-search" type="search" placeholder="位置、字段或值"></label><span id="result-count" class="muted"></span></div>
|
|
22
22
|
<div class="scroll"><table><thead><tr><th>位置</th><th>字段</th><th>原值</th><th>准备填写</th><th>依据与来源</th><th>填写</th></tr></thead><tbody id="changes"></tbody></table></div><button id="selection">应用选择</button></div>
|
|
23
23
|
<div class="card" data-pane="preview"><h2>未完成项</h2><p id="reason-summary"></p><div class="scroll"><table><thead><tr><th>位置</th><th>字段</th><th>原因</th></tr></thead><tbody id="incomplete"></tbody></table></div></div>
|
|
24
24
|
<div class="card" data-pane="download"><h2>确认并下载</h2><p>原文件不会被覆盖。下载包含全部已确认填写及完整清单,不受当前筛选影响。</p><button id="confirm" class="primary">确认这些填写,生成新副本</button><div id="downloads"></div></div>
|
|
25
|
-
<div class="controls"><button id="refresh" class="secondary">刷新任务</button><button id="discard" class="secondary">删除任务</button></div>
|
|
25
|
+
<details class="ff-task-more"><summary>更多任务操作</summary><div class="controls"><button id="refresh" class="secondary">刷新任务</button><button id="discard" class="secondary">删除任务</button></div></details><div class="ff-next-action" data-pane="preview" hidden><span>核验填充值后继续,下一步生成副本。</span><button id="preview-continue" class="primary">下一步:确认下载</button></div>
|
|
26
26
|
</section></main>
|
|
27
27
|
<dialog id="wizard" aria-labelledby="wizard-title"><header class="dialog-head"><div><h2 id="wizard-title">生成 AI填表任务</h2><p class="muted">上传原表、确认填写范围,使用企查查 MCP 核验企业信息并填写空白单元格。</p></div><button id="wizard-close" aria-label="关闭提示词向导">×</button></header>
|
|
28
28
|
<nav class="ff-wizard-nav" aria-label="提示词向导步骤"><button data-wizard-step="0"><span class="ff-step-number">1</span> 数据来源</button><button data-wizard-step="1"><span class="ff-step-number">2</span> 填写规则</button><button data-wizard-step="2"><span class="ff-step-number">3</span> 填写字段</button><button data-wizard-step="3"><span class="ff-step-number">4</span> 确认描述</button></nav>
|
|
@@ -139,7 +139,8 @@ function directScope(){
|
|
|
139
139
|
wizardFields=new Set(current?.selectedFields||current?.analysis.tables.flatMap(t=>t.mappings.filter(m=>m.field&&!t.anchors.includes(m.field)).map(m=>m.field))||[]);
|
|
140
140
|
const review=scopeReview(),signature=mappingVersion();
|
|
141
141
|
if($('direct-ack').dataset.signature!==signature){$('direct-ack').checked=false;$('direct-ack').dataset.signature=signature}
|
|
142
|
-
$('direct-scope').textContent=review.problem||'将填写 '+wizardFields.size+' 个已确认字段。'+(review.omitted.length?'
|
|
142
|
+
$('direct-scope').textContent=review.problem||'将填写 '+wizardFields.size+' 个已确认字段。'+(review.omitted.length?'另有 '+review.omitted.length+' 列未纳入,可展开查看。':'');
|
|
143
|
+
$('scope-omissions').hidden=!review.omitted.length;$('scope-omissions-list').textContent=review.omitted.join('、');
|
|
143
144
|
$('direct-ack-label').hidden=!review.omitted.length;
|
|
144
145
|
return review;
|
|
145
146
|
}
|
|
@@ -285,6 +286,7 @@ $('mapping-search').oninput=()=>{const query=$('mapping-search').value.trim().to
|
|
|
285
286
|
$('result-search').oninput=filterResults;$('changes').onchange=filterResults;
|
|
286
287
|
window.addEventListener('message',e=>{if(e.origin!==location.origin||e.source!==parent)return;if(e.data?.type==='ff-theme'&&['light','dark'].includes(e.data.theme))document.body.dataset.ffTheme=e.data.theme;if(e.data?.type==='ff-draft-conflict'){expectedDraft=e.data.draft;if(!$('draft-conflict').open)$('draft-conflict').showModal()}if(e.data?.type==='ff-draft-result'){$('status').textContent=e.data.ok?'已回填,请在对话框修改或发送。':'回填失败,任务已保留。';if(e.data.ok)closeWizard(true)}if(e.data?.type==='ff-navigate'){if(!current&&location.hash)pendingNavigation=e.data.step;if(e.data.step==='history')$('history-tab').click();else navigate(e.data.step)}});
|
|
287
288
|
api('/health').then(s=>{$('connection').textContent=s.qccAvailable?'已发现企查查工商工具,可在对话中执行。':'尚未发现企查查工商工具;请先连接 MCP。合成模板仍可体验。'}).catch(()=>{});
|
|
289
|
+
$('preview-continue').onclick=async()=>{if(busy||!current)return;controls(true);try{const ids=[...$('changes').querySelectorAll('input:checked')].map(x=>x.value);if(!current.confirmed&&JSON.stringify([...ids].sort())!==JSON.stringify([...(current.selectedIds||[])].sort()))render(await api('/select',{id:current.id,selectedIds:ids}));navigate('download');$('confirm').scrollIntoView({block:'center'});$('confirm').focus();$('status').textContent=current.confirmed?'副本已生成,请点击下载。':'请确认填写结果,点击蓝色按钮生成新副本。'}catch(e){$('status').textContent=e.message}finally{controls(false)}};
|
|
288
290
|
$('mapping-continue').onclick=()=>{if(busy||!current)return;navigate('identity');$('wizard-open').focus()};
|
|
289
291
|
$('mapping').addEventListener('change',()=>{$('mapping-next').hidden=true});
|
|
290
292
|
navigate('import');restore();setInterval(()=>{if(!document.hidden&¤t&&!busy&&!$('wizard').open)restore(true)},2000);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-form-fill-agent",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.11",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "AI填表智能体:XLSX blank-cell preview, QCC enrichment and persistent tasks for DSH.",
|
|
6
6
|
"repository": { "type": "git", "url": "git+https://github.com/duhu2000/dsh-form-fill-agent.git", "directory": "packages/dsh-form-fill-agent" },
|