从来文到可核对的公文
- 通过“附件”上传来文,选择“公文写作”数字员工。
- 选择制度、模板知识库,在“公文要求”中填写文种、主送、发文单位和时限。
- 生成后在“成果与引用”核对事实、引用和待确认项,修改并确认后下载文档。
/* Skill catalog, explicit context and paginated chunk-level diagnostics. */ /* The guide stays in the top-right toolbar, independent of the current chat. */ (()=>{ const guide=document.createElement('dialog');guide.id='guideDialog';guide.setAttribute('aria-labelledby','guideTitle'); guide.innerHTML=`
按步骤准备材料,再交给数字员工处理。开始实践只会填入示例,你可以修改后再发送。
例如:把“责任人|任务|截止日期”的文本转换成行动项 JSON。发布前仍需人工审查。
选择“技能程序员”描述小需求。生成代码经过受限解释器检查与测试后,可试验并申请发布为新节点。运行范围:纯文本 / JSON 转换。
${result.items.map(p=>`${esc(p.description)}
${p.status==='pending_review'?'发布申请待管理员审核,通过后进入工具目录。
':''}${esc(p.code)}${esc(JSON.stringify(p.report,null,2))}已成为数字员工画布中的可复用节点。
':''}暂无技能。选择数字员工“技能程序员”开始建设。
'}`);} document.getElementById('programCatalog').onclick=()=>programs().catch(e=>toast(e.message)); const originalRun=renderRun;renderRun=function(){originalRun();if(!S.run)return;const title=document.querySelector('#runProgress b');if(title)title.textContent='♙ '+(S.employees.find(x=>x.employee_id===S.run.employee_id)?.name||'数字员工');if(S.run.program)document.getElementById('runProgress').insertAdjacentHTML('beforeend','');if(document.getElementById('openGeneratedProgram'))document.getElementById('openGeneratedProgram').onclick=programs;for(const file of S.run.files||[]){const b=document.createElement('button');b.type='button';b.textContent='下载 PDF';b.onclick=()=>downloadFile('/generated-files/'+file.file_id,file.filename);document.getElementById('runProgress').append(b)}}; const originalUpdate=updateRun;updateRun=async function(...args){await originalUpdate(...args);if(S.wid&&S.run&&['succeeded','failed'].includes(S.run.status)){S.messages=await loadMessages(S.wid);renderMessages()}}; async function downloadFile(path,name){try{const response=await fetch('/api/v1'+path,{headers:{Authorization:'Bearer '+S.token}});if(!response.ok)throw new Error('文件下载失败');const url=URL.createObjectURL(await response.blob()),a=document.createElement('a');a.href=url;a.download=name;a.click();setTimeout(()=>URL.revokeObjectURL(url),1000)}catch(e){toast(e.message)}} const pdf=document.createElement('button');pdf.id='downloadPdf';pdf.textContent='下载 PDF';pdf.onclick=()=>{if(S.artifact)downloadFile('/artifacts/'+S.artifact.artifact_id+'/export.pdf','workos-document.pdf');else toast('当前尚无成果。')};document.getElementById('downloadArtifact').after(pdf); const chunkPages=new Map(),chunkLoading=new Set(); function chunkHtml(c){return `块 ID:${esc(c.chunk_id)}
版本 ${esc(c.document_version)} · ${esc(c.locator)}
原文 SHA256:${esc(c.content_hash)}
${esc(c.snippet)}已加载全部当前获授权的知识块。
'}