dsh-form-fill-agent 0.2.29 → 0.2.30
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 +3 -3
- package/lib/client.js +31 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# AI填表智能体
|
|
2
2
|
|
|
3
|
-
> 0.2.
|
|
3
|
+
> 0.2.30:统一简洁首页、稳定菜单与可恢复品牌标题,明确任务状态;侧栏仍为可选依赖。
|
|
4
4
|
|
|
5
5
|
> 统一侧栏适配需要 Better Sidebar `>=0.17.1 <0.19.0`。五个流程入口打开同一 Session Tab;侧栏展开、收起和关闭由宿主管理。缺少依赖时会显示安装升级提示。
|
|
6
6
|
|
|
@@ -11,7 +11,7 @@ AI填表智能体:支持自动填表、表格填充、表格补全、Excel填
|
|
|
11
11
|
### 基础安装(不需要侧栏)
|
|
12
12
|
|
|
13
13
|
```sh
|
|
14
|
-
dsh plugin --profile web add dsh-form-fill-agent@0.2.
|
|
14
|
+
dsh plugin --profile web add dsh-form-fill-agent@0.2.30
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
只需 Node.js >=22、完整 DSH 与主包自动安装的内核/Provider。Better Sidebar 和 dsh-context 都是可选项,不会由基础安装强装。
|
|
@@ -102,7 +102,7 @@ dsh plugin --profile web add dsh-form-fill-agent@latest
|
|
|
102
102
|
|
|
103
103
|
## 使用边界与数据保存
|
|
104
104
|
|
|
105
|
-
补充要求为模型可读文本;字段或工作表范围请通过向导/工作台修改,不能仅改文字后假定执行范围已同步。任务 schema 5 可读取 schema 1–5;回退旧版本请使用升级前目录副本或独立任务目录。主包为 0.2.
|
|
105
|
+
补充要求为模型可读文本;字段或工作表范围请通过向导/工作台修改,不能仅改文字后假定执行范围已同步。任务 schema 5 可读取 schema 1–5;回退旧版本请使用升级前目录副本或独立任务目录。主包为 0.2.30,共享内核为 0.2.10,Provider 为 0.2.2,共享字段契约为 0.1.0。
|
|
106
106
|
|
|
107
107
|
支持企业完整登记名称或 18 位信用代码;简称、主体不一致或多候选不会自动猜选。仅有信用代码的表格也可作为查询锚点。连接候选检索工具时可检索简称,仍需人工确认;缺少工具时降级人工输入。字段映射采用确定性规则及人工确认,不让模型编造事实。支持普通内部公式、固定区域下拉、基础条件格式和普通表格对象;复杂 Excel 结构和 Word 暂不支持,保真边界见下方安全说明。
|
|
108
108
|
|
package/lib/client.js
CHANGED
|
@@ -28,6 +28,35 @@ window.__ModuleLoader__.load({
|
|
|
28
28
|
dispose(){if(disposed)return;disposed=true;unsubscribe();pending.clear();targets.clear();for(const scope of opened.values())service.closeTab(SIDEBAR_TAB,scope);opened.clear();unregister();}
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
+
// Admission, not draft changes or runtime polling, owns automatic reveal.
|
|
32
|
+
function installSubmittedWorkbenchBridge(sessions,reveal){
|
|
33
|
+
let active,activeFace,stop=()=>{},disposed=false;const seen=new Set();
|
|
34
|
+
const owned=id=>typeof id==='string'&&id.startsWith('session-dsh-form-fill-agent-');
|
|
35
|
+
const admitted=(id,text,identity)=>{
|
|
36
|
+
if(disposed||!owned(id))return;
|
|
37
|
+
const task=String(text||'').match(/taskId=([a-f0-9-]{36})/i)?.[1];
|
|
38
|
+
const revision=String(text||'').match(/expectedRevision=(\d+)/)?.[1];
|
|
39
|
+
const key=task&&revision?`${id}:${task}:${revision}`:identity;
|
|
40
|
+
if(seen.has(key))return;seen.add(key);
|
|
41
|
+
if(sessions.list.getSnapshot().current!==id)return;
|
|
42
|
+
// openPanel reports companion errors through the visible manual fallback.
|
|
43
|
+
try{reveal(id,'preview')}catch{}
|
|
44
|
+
};
|
|
45
|
+
const connect=()=>{
|
|
46
|
+
const id=sessions?.list?.getSnapshot?.()?.current,face=owned(id)?sessions.binding?.(id)?.session:undefined;
|
|
47
|
+
if(id===active&&face===activeFace)return;
|
|
48
|
+
stop();stop=()=>{};active=id;activeFace=face;if(!owned(id))return;
|
|
49
|
+
if(typeof face?.beginSubmission==='function'){
|
|
50
|
+
const original=face.beginSubmission;
|
|
51
|
+
const wrapped=function(input){const identity={};return original.call(this,{...input,onRetire:settlement=>{
|
|
52
|
+
try{input.onRetire?.(settlement)}finally{if(settlement.reason==='observed')admitted(id,input.text,identity)}
|
|
53
|
+
}})};
|
|
54
|
+
face.beginSubmission=wrapped;stop=()=>{if(face.beginSubmission===wrapped)face.beginSubmission=original};
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
connect();const unsubscribe=sessions?.list?.subscribe?.(connect);
|
|
58
|
+
return()=>{disposed=true;stop();unsubscribe?.();seen.clear()};
|
|
59
|
+
}
|
|
31
60
|
function apply(ctx) {
|
|
32
61
|
let React, portal;
|
|
33
62
|
try { React=require('react');portal=require('react-dom').createPortal; } catch {}
|
|
@@ -205,10 +234,11 @@ window.__ModuleLoader__.load({
|
|
|
205
234
|
try{const adapter=createSidebarAdapter(scope.betterSidebar,props=>h(WorkbenchTab,{...props,key:props.scope.sessionId}),icon());sidebar=adapter;sidebarError='';const disconnect=()=>{if(sidebar===adapter)sidebar=undefined;adapter.dispose()};scope.effect?.(()=>disconnect);disposers.push(disconnect)}catch(error){sidebarError=error.message}
|
|
206
235
|
};
|
|
207
236
|
if(ctx.inject)ctx.inject(['betterSidebar'],connect);else if(ctx.betterSidebar)connect(ctx);
|
|
237
|
+
disposers.push(installSubmittedWorkbenchBridge(ctx.sessions,openPanel));
|
|
208
238
|
register('conversation.input.dock',Menu);
|
|
209
239
|
register('conversation.input.overlay',props=>owned(props.sessionId)?h('div',{className:'ff-ui','data-ff-theme':theme()},h('button',{className:'ff-prompt',type:'button',onClick:()=>openPanel(props.sessionId,'wizard')},icon('spark'),'提示词生成')):null);
|
|
210
240
|
ctx.effect?.(()=>()=>{activePlugin=false;for(const dispose of disposers)dispose();viewListeners.clear();views.clear();sessionTasks.clear();lastDrafts.clear()});
|
|
211
241
|
}
|
|
212
|
-
return {createSidebarAdapter,name:'form-fill-agent',inject:['slots','sessions','workspaces','conversation'],apply};
|
|
242
|
+
return {createSidebarAdapter,installSubmittedWorkbenchBridge,name:'form-fill-agent',inject:['slots','sessions','workspaces','conversation'],apply};
|
|
213
243
|
}
|
|
214
244
|
});
|
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.30",
|
|
4
4
|
"private": false,
|
|
5
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
6
|
"repository": {
|