@customize-agent/server 4.60.33 → 4.60.34
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/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/required-server-files.json +1 -1
- package/.next/server/chunks/7848.js +1 -1
- package/.next/server/chunks/9666.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/pages/api/health.js +1 -1
- package/.next/server/pages/canvas/[id].html +1 -1
- package/.next/server/pages/canvas.html +1 -1
- package/.next/server/pages/documents.html +1 -1
- package/.next/server/pages/guide.html +1 -1
- package/.next/server/pages/index.html +1 -1
- package/.next/server/pages/jobs.html +1 -1
- package/.next/server/pages/knowledge/file-detail.html +1 -1
- package/.next/server/pages/knowledge/files.html +1 -1
- package/.next/server/pages/knowledge/manage.html +1 -1
- package/.next/server/pages/knowledge/source-preview.html +1 -1
- package/.next/server/pages/knowledge.html +1 -1
- package/.next/server/pages/models.html +1 -1
- package/.next/server/pages/overview.html +1 -1
- package/.next/server/pages/prompt.html +1 -1
- package/.next/server/pages/settings.html +1 -1
- package/.next/server/pages/skills/[id]/edit.html +1 -1
- package/.next/server/pages/skills/[id].html +1 -1
- package/.next/server/pages/skills/new.html +1 -1
- package/.next/server/pages/skills.html +1 -1
- package/.next/server/pages/system/logs.html +1 -1
- package/.next/server/pages-manifest.json +38 -38
- package/.next/static/{84adacede7ff442362a497aa3e621351f0c7ab051b72c5c491f09a03bf4751e3 → 0e37797d2ec62d17ca5f253c10b385fa939228f353538722f095755edce292af}/_buildManifest.js +1 -1
- package/package.json +2 -2
- /package/.next/static/{84adacede7ff442362a497aa3e621351f0c7ab051b72c5c491f09a03bf4751e3 → 0e37797d2ec62d17ca5f253c10b385fa939228f353538722f095755edce292af}/_ssgManifest.js +0 -0
|
@@ -123,7 +123,7 @@ semanticKind:本项目自身的设计、条件与施工要求为 project-desig
|
|
|
123
123
|
只返回JSON:{"confirmed":true或false,"reason":"整体复核理由","sourceResults":[{"sourceDictionaryIndex":0,"complete":true,"caseIds":["case-a"],"reason":"逐源理由"}],"sourceCases":[{"id":"case-a","sourceDictionaryIndex":0,"quote":"该原文中真实连续原字","objectScope":"实际对象","condition":"适用工况","semanticKind":"project-condition","versionDomain":"unmeasured","applicability":"applicable","variantIds":[],"reason":"用途依据"}],"variantResults":[],"controlsResults":[],"uncoveredSourceCases":[]}。
|
|
124
124
|
|
|
125
125
|
【sourceDictionary】${JSON.stringify(h)}`,k=a.reviewer?async(b,c)=>{let d=await a.reviewer(b,c);return"string"==typeof d?d:void 0===d?void 0:JSON.stringify(d)}:void 0,l=await (0,e.v7)("你是独立来源用途评审者。只对给定任务将实际引用的完整原文逐条核定来源用途、版本用途域与适用性;不新增事实、不授予采用许可、不检查未提供的资料。",i,{diagnostics:a.diagnostics,signal:a.signal,callKind:"planning-review",taskKind:(0,e.TO)(),temperature:0,maxTokens:Math.max(4e3,Math.ceil(.6*JSON.stringify(h).length)),schema:(0,p.q1)([],g),validateProtocol:b=>{try{let c=(0,p.lH)(b,{variants:[],sourceDictionary:d,requiredSourceDictionaryIndices:g});return w(a.project,c,{sourceDictionary:d,facts:[],variants:[]}),[]}catch(a){return[a instanceof Error?a.message:String(a)]}}},k);if(!l)continue;let m=(0,p.lH)(l,{variants:[],sourceDictionary:d,requiredSourceDictionaryIndices:g});w(a.project,m,{sourceDictionary:d,facts:[],variants:[]}),f[b]={sourceDictionaryIds:d.map(a=>(0,j.vg)(a)),receipt:m,taskIds:[...c.taskIds]}}catch(b){if(a.signal?.aborted)throw b}}})),f.filter(Boolean).flatMap(a=>a.taskIds.map(b=>({taskId:b,sourceDictionaryIds:a.sourceDictionaryIds,receipt:a.receipt})))}function B(a){let{quantityPackageIndices:b,crewId:c,crewProfile:d,...e}=a;return e}function C(a,b,c){let d,e=z(a,b.sections.length),f=function(a){let b=a&&"object"==typeof a?a.crewProfiles:void 0;if(!Array.isArray(b))throw Error("全工程拓扑缺少crewProfiles完整单班人员编制;不能只登记班组编号再由各阶段换人");let c=new Map;for(let a of b){if(!a||"object"!=typeof a||Object.keys(a).some(a=>!["crewId","workers","basis"].includes(a))||"string"!=typeof a.crewId||!a.crewId.trim()||c.has(a.crewId)||"string"!=typeof a.basis||!a.basis.trim()||!Array.isArray(a.workers)||a.workers.some(a=>!a||"object"!=typeof a||Object.keys(a).some(a=>!["trade","countPerCrew"].includes(a))||"string"!=typeof a.trade||!a.trade.trim()||!Number.isSafeInteger(a.countPerCrew)||0>=Number(a.countPerCrew))||new Set(a.workers.map(a=>a.trade)).size!==a.workers.length)throw Error("crewProfiles须逐组给出唯一crewId、完整工种及正整数countPerCrew和实际拟定编制依据;不能重复工种或用活动编号冒充人员编制");c.set(a.crewId,structuredClone(a))}return c}(a),h=a.activities;if(!Array.isArray(h)||h.some(a=>!a||"object"!=typeof a||Reflect.ownKeys(a).some(a=>!["id","phaseId","objectScope","workfront","taskIndices","predecessors","quantityPackageIndices","crewId"].includes(String(a)))))throw Error("施工拓扑只允许完整活动身份、对象、工作面、任务、依赖、原清单包路由和全工程班组身份;生产输入在分阶段详情填写");let i=[],j=(c.workPackages??[]).length;for(let[a,b]of h.entries())null===b.crewId||"string"==typeof b.crewId&&b.crewId.trim()?null===b.crewId||f.has(b.crewId)||i.push(`activities[${a}](${b.id}).crewId=${JSON.stringify(b.crewId)}没有真实crewProfiles人员编制`):i.push(`activities[${a}](${b.id}).crewId:必须显式给出全工程稳定crewId;无需人员投入的实际等待活动才能填null`);let k=new Set(h.flatMap(a=>null===a.crewId?[]:[a.crewId])),l=[...f.keys()].filter(a=>!k.has(a));for(let[a,b]of(l.length&&i.push(`crewProfiles含未分配实际施工活动的虚增班组[${l.join(",")}],须明确真实用途或删除对应未用编制;不能删除已有活动来绕过核验`),h.entries()))(!Array.isArray(b.quantityPackageIndices)||new Set(b.quantityPackageIndices).size!==b.quantityPackageIndices.length||b.quantityPackageIndices.some(a=>!Number.isSafeInteger(a)||0>Number(a)||Number(a)>=j))&&i.push(`activities[${a}](${b.id}).quantityPackageIndices:必须显式选择无重复的真实原清单包索引[0,${j-1}];无工程量明确填[],不以管理任务的宽泛职责替代施工对象来源范围`);let m=new Set(h.flatMap(a=>Array.isArray(a.quantityPackageIndices)?a.quantityPackageIndices:[])),n=(c.workPackages??[]).flatMap((a,b)=>a.members?.length&&!m.has(b)?[b]:[]);n.length&&i.push(`施工拓扑漏路由原清单包${n.join(",")};全部真实成员必须保留归属,按原清单包实际对象补充对应活动路由,不授予安装或合量用途`);try{d=(0,g.SZ)(h.map(a=>({...B(a),quantity:null,production:null,duration:null,waits:[]})),e.map(a=>a.id),b.sections.length)}catch(a){i.push(a instanceof Error?a.message:String(a))}if(d)for(let[a,b]of d.entries()){let c=e.find(a=>a.id===b.phaseId),d=b.taskIndices.filter(a=>!c.taskIndices.includes(a));d.length&&i.push(`activities[${a}](${b.id}).taskIndices=[${b.taskIndices.join(",")}]不属于已声明阶段${c.id}(${c.scope});越域任务[${d.join(",")}];phases[${e.indexOf(c)}].taskIndices=[${c.taskIndices.join(",")}]。按实际施工对象和作者职责决定修正活动的phaseId/taskIndices或阶段委派;不能删去实际方法、资源、质量安全及交接职责来通过校验`)}let o=new Set,p=new Set,q=a=>{if(o.has(a))throw Error(`施工活动依赖成环:${[...o,a].join("→")},不能进入分阶段生产核定`);if(!p.has(a)){for(let b of(o.add(a),d.find(b=>b.id===a).predecessors))q(b.activityId);o.delete(a),p.add(a)}};if(d)try{d.forEach(a=>q(a.id))}catch(a){i.push(a instanceof Error?a.message:String(a))}if(i.length)throw Error(i.join(";"));if(!d)throw Error("施工拓扑活动尚未完成同源校验");return d.map(({id:a,phaseId:b,objectScope:c,workfront:d,taskIndices:e,predecessors:g},i)=>({id:a,phaseId:b,objectScope:c,workfront:d,taskIndices:e,predecessors:g,quantityPackageIndices:[...h[i].quantityPackageIndices],crewId:h[i].crewId,crewProfile:null===h[i].crewId?null:f.get(h[i].crewId)}))}function D(a,b,c,d,e,f){let h;if(!a||"object"!=typeof a||Reflect.ownKeys(a).some(a=>"activities"!==a)||!Array.isArray(a.activities))throw Error("阶段生产详情仅返回activities");let i=a.activities,j=[];if(i.length!==c.length||new Set(i.map(a=>a?.activityIndex)).size!==c.length||i.some(a=>!a||!c.includes(Number(a.activityIndex))||!Number.isSafeInteger(a.activityIndex)))throw Error(`阶段详情含重复、缺失或越域活动;activityIndex必须恰好为[${c.join(",")}]各一次`);for(let a of i){let b=Reflect.ownKeys(a).filter(a=>!["activityIndex","quantity","production","duration","waits"].includes(String(a)));b.length&&j.push(`activityIndex=${a.activityIndex}含禁止字段[${b.join(",")}]:仅填写activityIndex/quantity/production/duration/waits;id/phaseId/objectScope/workfront/taskIndices/predecessors由冻结拓扑提供,不复制或改写`)}let k=new Map(i.map(({activityIndex:a,...b})=>[Number(a),b])),l=b.map((a,b)=>({...B(a),...k.get(b)??{quantity:null,production:null,duration:null,waits:[]}})),m=(0,g.BI)(f),n=[...j];try{h=(0,g.SZ)(l,d.map(a=>a.id),e.sections.length)}catch(a){n.push(a instanceof Error?a.message:String(a))}for(let a of c){let c=l[a],d=c.quantity,e=b[a].crewId;if(c.production&&c.production.crewId!==e&&n.push(`activityIndex=${a}(${c.id}).production.crewId:必须使用冻结全工程班组${JSON.stringify(e)},不能改名为${JSON.stringify(c.production.crewId)}规避同期占用校核;需要真实增配由全工程冲突修正说明依据`),c.production||null===e||n.push(`activityIndex=${a}(${c.id}).production:冻结班组${JSON.stringify(e)}缺少实际人员和机具安排`),c.production&&Array.isArray(c.production.workers)&&b[a].crewProfile){let d=a=>JSON.stringify([...a].sort((a,b)=>a.trade.localeCompare(b.trade)));c.production.workers.every(a=>a&&"string"==typeof a.trade)&&d(c.production.workers)!==d(b[a].crewProfile.workers)&&n.push(`activityIndex=${a}(${c.id}).production.workers:必须保持班组${e}的完整单班编制${JSON.stringify(b[a].crewProfile.workers)};不同工种或人数不得挂在同一身份下,局部阶段不能换人或扩编`)}if(d&&"object"==typeof d&&Array.isArray(d.memberIndices)&&d.memberIndices.every(a=>Number.isSafeInteger(a)&&a>=0)&&"string"==typeof d.unit)try{n.push(...(0,g.NH)(c,m).map(b=>`activityIndex=${a}(${c.id}).quantity:${b}`))}catch(b){n.push(`activityIndex=${a}(${c.id}).quantity:${b instanceof Error?b.message:String(b)}`)}}if(n.length)throw Error(n.join(";"));if(!h)throw Error("阶段输入尚未完成同源校验");for(let a of c){let c=new Set(b[a].quantityPackageIndices.flatMap(a=>f.workPackages?.[a].members?.map(a=>a.id)??[]));if(h[a].quantity?.memberIndices.some(a=>!c.has(m[a]?.memberId)))throw Error(`活动${a}引用所属冻结清单包之外的原来源索引;不能借其他阶段数量或猜测序号`)}return(0,g.yP)({contract:e,project:f,phaseIds:d.map(a=>a.id),activities:h}),c.map(a=>h[a])}async function E(a){let b,c,{contract:d,project:m}=a;if(x(m),d.projectSnapshotId!==m.snapshotId)throw Error("共享施工计划与项目合同不一致");let n=[...new Map(d.sections.flatMap(a=>(0,i.tb)(m,a)).filter(k.j).map(a=>[(0,j.vg)(a),a])).values()],o=d.sections.map((a,b)=>({taskIndex:b,title:a.title,responsibility:a.responsibility})),p=[(0,l.V2)(d.writingKnowledge?.projectType),"先形成全体作者共用的完整施工阶段与活动依赖网络;本次只写专业拓扑,资源、产率、数量和时长在冻结拓扑之后按阶段独立填写,不在一个巨型JSON里同时输出。不得漏工作范围或为缩短响应合并不同对象和工况。","tasks是投标文件作者的成文职责,只用于映射实际工程活动,不是施工任务清单。工程概况、编制依据、章节编审、重难点分析等成文工作不能列为施工活动,不能据此占用合同施工工期或配置施工人材机。相关作者任务通过真实施工对象、现场准备、管理检查和移交活动承接,不为凑齐taskIndices新造章节活动。确需施工方案审批、测量放线、临设施工或现场交底时,写出实际工作对象、作业动作及放行结果;安全质量资源管理按其真实实施阶段承接,不全放在开工前编写管理文件。","阶段按真实对象、工作面和移交条件安排,不套固定五阶段。不同计量单位、不同工法、不同工作面或不能共用产率的设备必须分别建立活动,不能把AP、RCU、机柜、UPS等混成一个计件活动,也不能把室内强电保护管与室外外接电缆混合归量。方法和接口是当前工程决定,不能猜设计参数或用按图、后续审批代替。实际楼层、区段与阶段名称可正常表述;数值引用仍须对应真实来源,工程生产输入单独结构化登记,拓扑文本不授予数值事实或采用资格。",'只返回{"crewProfiles":[{crewId,workers:[{trade,countPerCrew}],basis:"实际拟定编制依据"}],"phases":[{id,scope,method,predecessors:[],releaseCondition,interfaces:[],taskIndices:[]}],"activities":[{id,phaseId,objectScope,workfront,crewId:"全工程实际拟定班组身份"或null,taskIndices:[],quantityPackageIndices:[原清单包packageIndex],predecessors:[{activityId,relation:"finish-start"或"start-start",lagDays:0}]}]}。本次activities不含quantity/production/duration/waits。活动ID、全工程班组完整单班编制和跨阶段依赖一次确定,后续阶段不得各自重命名活动或换一批工种人数。真实等待仅以明确有依据的依赖lagDays登记,不编未知等待数。',"crewProfiles先以实际工法及岗位分工拟定完整单班编制,不要求资料预先规定施工方人数;数量、产率、班组数和轮班安排再在阶段详情及全工程计算中校核。项目管理班子、测量班组、临设作业及安全防护搭设班组是不同实际人员编制,分别登记,不能以“综合准备组”编号把完全不同人员先后换入。班组复用时所有工种与countPerCrew保持同一编制;只调配部分人员或确需扩编须在全工程组织修正中明确实际人员来源及所有相关活动,不能悄悄在局部换人。","crewId表示实际拟配置的同一组人员,不是活动序号、章节序号或工种名称。同一班组跨活动、跨阶段及跨工作面复用时保持相同crewId并安排真实转场与先后;确需并行的不同班组使用不同身份,不能默认每个活动另加一组人员。项目管理班子跨质量、安全、进度等管理职责复用,不为每项管理计划各造一名项目经理或技术负责人。无需人员投入的实际等待才用crewId=null;拟定班组数量及工效在阶段详情填写,全工程计算再核对同期资源与工期。","quantityPackageIndices按活动的实际施工对象从workPackageDirectory选择;组织、准备和交接活动无需工程量时明确为空数组。每个非空原清单包至少归属一个实际活动;采购、计价、措施条目按真实用途路由,不授予安装或合量许可。阶段详情仅提供所属活动路由包的完整成员,不按管理章节的宽泛职责装入全工程清单。","逐活动核对phaseId对应阶段的taskIndices:活动内每个作者任务索引都必须已在该阶段登记。管理、安全、质量及资源职责按实际活动承接;活动确需这些职责时先核定该阶段委派,不能活动引用而阶段遗漏,也不能为了满足索引关系删掉实际职责或把桩基活动塞入土方阶段。返回前同时检查未使用班组、全部清单包路由、阶段与活动任务子集及无环依赖;校验会一次列出所有可核错误及具体路径,纠错只修改这些错误及其必要关联,正确活动与来源路由原样保留。施工依赖不代表作者串行写作。",JSON.stringify({tasks:o,projectConstraints:n,workPackageDirectory:(m.workPackages??[]).map((a,b)=>({packageIndex:b,name:a.name,memberCount:a.members?.length??0,objects:[...new Map((a.members??[]).map(({entry:a})=>[JSON.stringify([a.name,a.section,a.subsection,a.unit]),{name:a.name,scope:a.section,part:a.subsection,unit:a.unit}])).values()]}))})].join("\n\n"),q=Date.now(),t=[],u=a.signal,v=[],w=new Map,y="同一工程组织与生产网络已形成;拟定工况及实际正文待专业评价";a.onReceipt?.("shared-construction-start",{startedAt:q,inputHash:s(p),protocol:"topology-then-phase-details"});let E=0,F=new Set,G=a.planner?async(b,c)=>{let d=Promise.resolve().then(()=>a.planner(b,c));F.add(d),d.then(()=>F.delete(d),()=>F.delete(d));let e=await d;return"string"==typeof e?e:void 0===e?void 0:JSON.stringify(e)}:void 0,H=async(b,c,d,f,g)=>{let h=s({protocol:"native-engineering-request-v1",stage:b,system:c,prompt:d,taskKind:"reasoning",temperature:0,sourceIdentity:s(m.sourceVersionPolicy.sources)});try{let c=a.responseCache?.load(h);if(c){let d=[...(0,e.Jx)(c.response,f),...g(structuredClone(c.response))];if(!d.length)return a.onReceipt?.(`shared-construction-${b}-cache-hit`,{requestKey:h,...c.receipt,raw:c.response}),structuredClone(c.response);a.onReceipt?.(`shared-construction-${b}-cache-rejected`,{requestKey:h,errors:d})}}catch(c){if(a.signal?.aborted)throw c;a.onReceipt?.(`shared-construction-${b}-cache-rejected`,{requestKey:h,errors:[c instanceof Error?c.message:String(c)]})}let i={},j=await (0,e.v7)(c,d,{diagnostics:a.diagnostics,signal:u,callKind:"planning-review",taskKind:"reasoning",temperature:0,schema:f,outFailure:i,validateProtocol:g,onAttempt:c=>{E+=1,a.onReceipt?.(`shared-construction-${b}-attempt-${c.ordinal}`,c)}},G);if(!j)throw Error(`${b}完整尝试及协议失败:${i.value??"未收到可用响应"}`);return a.responseCache?.save(h,j),j};try{let i=await H("topology","你是施工组织设计主智能体,先固定完整施工活动与接口拓扑。",p,{type:"object",required:["crewProfiles","phases","activities"],additionalProperties:!1,properties:{crewProfiles:{type:"array",items:{type:"object"}},phases:{type:"array",items:{type:"object"}},activities:{type:"array",items:{type:"object"}}}},a=>{try{return C(a,d,m),[]}catch(a){return[a instanceof Error?a.message:String(a)]}}),j=C(i,d,m);t=z(i,d.sections.length),v=j,a.onReceipt?.("shared-construction-topology",{raw:i});let k=(0,g.i)(m),l=t.map(a=>({phase:a,indices:j.flatMap((b,c)=>b.phaseId===a.id?[c]:[])})).filter(a=>a.indices.length),q=Array(l.length),r=0,s=new AbortController;u=AbortSignal.any(a.signal?[a.signal,s.signal]:[s.signal]);let x=await Promise.allSettled(Array.from({length:Math.min(l.length,(0,e.jW)(),2)},async()=>{try{for(;r<l.length;){u?.throwIfAborted();let b=r++,c=l[b],e=new Set(c.indices.flatMap(a=>j[a].quantityPackageIndices).flatMap(a=>m.workPackages?.[a].members?.map(a=>a.id)??[])),f=function(a){let b=[],c=new Map,d=new Map;for(let e of a){let a=c.get(e.description);void 0===a&&(a=b.length,c.set(e.description,a),b.push(e.description));let f=JSON.stringify([e.sourceFile,e.section,e.subsection]),g=d.get(f)??{sourceFile:e.sourceFile,section:e.section,subsection:e.subsection,rows:[]};g.rows.push([e.index,e.name,a,e.quantity,e.unit]),d.set(f,g)}return{quantityRole:"original-source-quantity-not-installation-permission",columns:["index","name","descriptionIndex","quantity","unit"],descriptions:b,groups:[...d.values()]}}(k.filter(a=>e.has(a.memberId))),g=["只为本阶段已有活动填写实际工程量用途、拟定产率/班组/设备、必要等待或非生产性活动时长。活动身份、对象、工作面、委派任务和依赖由主控已冻结;不得复制或改变它们,不新造活动。","production.crewId必须逐活动使用拓扑提供的全工程crewId,同一实际班组不得因活动或阶段不同换名。同一管理班子不能在并行活动中重复配置;需要多人分工须说明真实拟配置人员与组织依据,不把文档编审当施工或为每章各加项目经理。全工程计算会校核资源重叠;确需增配通过后续全工程冲突修正明确依据,不在局部阶段逃避校核。","production.workers必须完整保留crewProfiles对应班组的工种与countPerCrew,不在本阶段换人、删人、增人或另起工种名称;同一编制的班组数量、班次、产率和机具按实际工况拟定。无受控作业量、按组织时长控制的准备活动,不为填表补“常规台班产能”;没有实际工况推导或确切依据的机械capacityPerMachineShift及unit明确为null。","每项必须明确包含activityIndex、quantity、production、duration、waits这五个字段,不含其他字段。waits始终是数组,没有等待填[],不能填null。按工作量与班产率计算的活动令duration=null;措施/采购/计价数量只保留在原清单来源,组织活动令quantity=null、productivityPerCrewShift=null、production.unit=null,duration采用实际组织依据。不能用0.05项/班等假产率换算“项/包干”措施量。",'只返回{"activities":[{activityIndex,quantity:null或{memberIndices:[原来源index],use:"workload"|"installation"|"procurement"|"pricing"|"measure",unit,reason},production:null或{crewId,crews,productivityPerCrewShift:null或每班组每班产率,unit:null或作业量单位,shiftsPerDay,hoursPerShift,workers:[{trade,countPerCrew}],equipment:[{resourceId,name,spec,countPerCrew,capacityPerMachineShift:null或数值,unit:null或容量的计量单位,basis}],basis},duration:null或{days,basis},waits:[{kind:"approval"|"delivery"|"curing"|"testing"|"handover"|"calendar",days,basis}]}]}。duration.days及等待days均为连续组织的日历日;资料写工作日时须有真实作业日历换算依据,不把工作日直接当日历日。shiftsPerDay表示每日不同人员轮班数,countPerCrew为单班单组人数,不安排同一人员连续承担多个完整班;机械可跨班复用。本阶段activityIndex恰好各返回一次;目录序号不因选源或分阶段重排。',"不同对象、部位、单位或数量用途不得合量。相同作业对象、部位和计量单位的不同规格,只有采用相同施工方法与产率且reason逐项说明工况可比时,才能为工作量计算归组;逐源规格始终保留,不能据此统一设计或采购规格。安装量、采购消耗量、计价量及施工工作量分开;不能把计价小数取整为安装台套。产率、班组、班次、工种与机械须是有工况依据的明确拟定选择,basis说明依据和条件。设计未知保留null,不能填默认定额或平摊人数;施工方拟定班组与产率不需要资料预先给出,应依据实际工法、作业面、搬运距离和设备能力做出明确且可复核的配置选择,不能把可策划的输入全部留null;明确由时长控制的准备、协调、验收活动用duration及依据,仍应在production中保留实际拟配置人员和机具。辅助/检测仪器未声明生产能力时capacityPerMachineShift和unit可以为null;不得为通过协议给仪器虚构产能单位。production.unit是作业量单位(如m3),不重复附加“/班”;每班语义已由productivityPerCrewShift表达。可核施工工作量和安装作业量可按同单位产率计算时长。相同来源、工程对象和部位中不同构件名称不自动禁止同工法作业归量,reason说明共同工法、产率及工况,并保留各源规格;采购/计价/措施数量不得直接转为安装工作量。use=measure只表示措施计量,不表示试验检测;试压、闭水、冲洗等已明确试验长度的实际作业,用use=workload并说明试验工作量性质,不能写成安装总数。不同计量单位必须分活动,台/套/个不能擅自统一成个。明确由组织时长控制的临设搭建、测量准备、协调和验收可同时拟定班组/设备,productivityPerCrewShift与unit为null,duration说明实际组织依据。以产率计算的生产活动不同时填duration,不反摊合同天数或调整产率凑工期。",JSON.stringify({projectConstraints:n,dependencyDirectory:j.map((a,b)=>({activityIndex:b,id:a.id,phaseId:a.phaseId,objectScope:a.objectScope}))}),"quantitySources是无损清单表:groups保留原文件和工程/分部,rows按columns解释;descriptionIndex只查descriptions中的完整原字。memberIndices必须取行内index(全工程原来源序号),不是数组位置、组序号或descriptionIndex。相同描述仅共享文字,不合并任何条目或数量。",JSON.stringify({quantitySources:f}),JSON.stringify({phase:c.phase,tasks:o.filter(a=>c.phase.taskIndices.includes(a.taskIndex)),crewProfiles:[...new Map(c.indices.flatMap(a=>j[a].crewProfile?[[j[a].crewId,j[a].crewProfile]]:[])).values()],activities:c.indices.map(a=>{let{crewProfile:b,...c}=j[a];return{activityIndex:a,...c}})})].join("\n\n"),h={type:"object",required:["activities"],additionalProperties:!1,properties:{activities:{type:"array",minItems:c.indices.length,maxItems:c.indices.length,items:{type:"object"}}}},i=await H(`details-${b}`,"你是施工组织设计主智能体,为已经固定的本阶段活动核定有依据的生产输入。",g,h,a=>{try{return D(a,j,c.indices,t,d,m),[]}catch(a){return[a instanceof Error?a.message:String(a)]}});for(let a of(q[b]=D(i,j,c.indices,t,d,m),q[b]))w.set(a.id,a);a.onReceipt?.(`shared-construction-details-${b}`,{phaseId:c.phase.id,raw:i})}}catch(a){throw s.abort(a),a}}));await Promise.allSettled([...F]),u=a.signal;let y=x.find(a=>"rejected"===a.status);if(y?.status==="rejected")throw y.reason;b=j.map((a,b)=>q.flat().find(b=>b.id===a.id)??(()=>{throw Error(`共同生产计划缺少活动${b}的实际输入`)})());let A={phases:t,activities:b},B=function(a,b,c){let d,e,f=[];try{d=z(a,b.sections.length)}catch(a){f.push(a instanceof Error?a.message:String(a))}if(!d)return f;try{e=(0,g.SZ)(a.activities,d.map(a=>a.id),b.sections.length)}catch(a){f.push(a instanceof Error?a.message:String(a))}if(!e)return f;let h=e.filter(a=>a.taskIndices.some(b=>!d.find(b=>b.id===a.phaseId).taskIndices.includes(b)));if(h.length)return f.push(`活动任务不属于该实际阶段委派:活动「${h.map(a=>a.id).join("、")}」的 taskIndices 必须取自其 phaseId 对应阶段的 taskIndices,不得引用其他阶段或未委派任务`),f;try{(0,g.yP)({contract:b,project:c,phaseIds:d.map(a=>a.id),activities:e})}catch(a){f.push(`生产计划不成立:${a instanceof Error?a.message:String(a)}`)}return f}(A,d,m);if(B.length)throw Error(B.join(";"));if(a.onReceipt?.("shared-construction-candidate",{raw:A}),(c=(0,g.yP)({contract:d,project:m,phaseIds:t.map(a=>a.id),activities:b})).inputs.length&&c.issues.length){var I;let e=c;a.onReceipt?.("shared-construction-calculated-conflicts",{planId:e.id,calendar:e.calendar,issues:e.issues});let g=(I=t,["当前共同工程候选在同源计算中存在真实冲突。作者尚未启动。只修正所需的组织输入,重新计算无冲突且符合合同工期后才冻结。",'返回{"changes":[{activityIndex,reason,production?:完整原结构,duration?:完整原结构或null,waits?:完整原结构数组,predecessors?:完整原结构数组}]}。省略字段保持原值;填写字段须给完整内容。不得改活动ID、对象、工作面、任务、原数量或来源序号,不删除活动,不复制全工程计划。每项reason明确调整前后和实际工况/交接依据。',"同一crewId表示同一组实际人员,同期不得重复占用。不能仅换ID掩盖同一班组冲突;独立班组必须有可同时展开的实际作业面及完整人员/机具配置和调配依据。减少班组时相应调整真实活动关系;增加班组必须核实现场可用作业面、供料与机械能力。不得改产率凑工期,不取消养护/试验/验收等必要等待。","predecessors可在冻结前按真实分区移交或分段流水修正,但reason必须说明后序启动的具体放行条件及其与前序开始/完成的关系;不能仅将finish-start改成start-start或编lagDays来压缩工期。缺少可核移交依据时保留完整先后关系,通过明确资源安排调整。当前工法、对象及源数量保持不变。","所有计算使用真实数量、明确拟定产率/设备能力和完整依赖。数值与日历边界在candidate中可核;calendar.totalDays是合同约束,不是反摊各阶段的分配数。只调整确有问题的活动,其余有效输入复用;既有未知来源不得改为已知。",(0,f.D)({phases:I,candidate:{calendar:e.calendar,activities:e.activities.map((a,b)=>({activityIndex:b,...a.input,quantityValue:a.quantity,workDays:a.workDays,durationDays:a.durationDays,timeWindow:a.timeWindow,workTimeWindow:a.workTimeWindow,critical:a.critical,reasons:a.reasons})),issues:e.issues}})].join("\n\n")),i=await H("reconciliation","你是施工组织设计主智能体,依据实际计算冲突修正同一候选的组织安排,完整验证后才委派作者。",g,{type:"object",required:["changes"],additionalProperties:!1,properties:{changes:{type:"array",minItems:1,items:{type:"object"}}}},a=>{try{return h(a,e,t,d,m),[]}catch(a){return[a instanceof Error?a.message:String(a)]}});for(let a of b=(c=h(i,e,t,d,m)).inputs)w.set(a.id,a);a.onReceipt?.("shared-construction-reconciliation",{originalPlanId:e.id,raw:i,planId:c.id,calendar:c.calendar,issues:c.issues})}}catch(e){if(a.signal?.aborted)throw e;b=v.map(a=>w.get(a.id)??{...B(a),quantity:null,production:null,duration:null,waits:[]}),c=(0,g.yP)({contract:d,project:m,phaseIds:t.map(a=>a.id),activities:b}),y=`共同工程计划仍有未核事项:${e instanceof Error?e.message:String(e)};已保留${w.size}/${v.length}项实际生产输入;未测活动不授予完成时间、全工程峰值或工期可行性`}let J=d.sections.map((a,b)=>{let c=t.filter(a=>a.taskIndices.includes(b));return{taskId:a.id,status:c.length?"planned":"unmeasured",phaseIds:c.map(a=>a.id),objectScope:a.responsibility,approach:c.map(a=>a.method).join(";"),handoffs:[...new Set(c.flatMap(a=>a.interfaces))],boundary:a.responsibility}}),K=a.sourcePurposeReviewer||void 0===a.planner?await A({contract:d,project:m,diagnostics:a.diagnostics,signal:a.signal,reviewer:a.sourcePurposeReviewer}):[],L={version:r,contractId:d.id,projectSnapshotId:m.snapshotId,phases:t,tasks:J,production:c,taskSourceReviews:K,review:{status:"unmeasured",reason:y}},M={...L,id:s(L)};return a.onReceipt?.("shared-construction-end",{startedAt:q,elapsedMs:Date.now()-q,attempts:E,status:t.length?"planned":"unmeasured",taskSourceReviewCount:K.length,reason:y,planId:M.id}),M}function F(a,b,c){x(c);let{id:d,...e}=a;if(a.version!==r||s(e)!==d||a.contractId!==b.id||a.projectSnapshotId!==c.snapshotId)throw Error("共同施工组织骨架与当前冻结项目或合同身份不一致");let f=b.sections.map(a=>a.id);if(a.tasks.length!==f.length||new Set(a.tasks.map(a=>a.taskId)).size!==f.length||a.tasks.some(a=>!f.includes(a.taskId)||!["planned","unmeasured"].includes(a.status??"")))throw Error("共同施工组织骨架的任务集合缺项、重复或状态无效");if(a.phases.length&&z({phases:a.phases},b.sections.length),(0,g.SZ)(a.production.inputs,a.phases.map(a=>a.id),b.sections.length),s(a.production.phaseIds)!==s(a.phases.map(a=>a.id))||a.production.inputs.some(b=>b.taskIndices.some(c=>!a.phases.find(a=>a.id===b.phaseId).taskIndices.includes(c))))throw Error("生产网络与实际阶段及任务委派不一致");if((0,g.Q4)(a.production,b,c),"unmeasured"!==a.review.status||!a.review.reason.trim())throw Error("组织候选不能冒充已完成的专业工程复核");let h=["id","version","contractId","projectSnapshotId","phases","tasks","production","taskSourceReviews","review"],i=["taskId","status","phaseIds","objectScope","approach","handoffs","boundary"];if(Reflect.ownKeys(a).some(a=>!h.includes(String(a)))||a.tasks.some(a=>Reflect.ownKeys(a).some(a=>!i.includes(String(a)))))throw Error("组织骨架不能携带旧字段或未经实际工程核定的采用许可");if(!Array.isArray(a.taskSourceReviews))throw Error("共享计划缺少每任务来源用途核定集合");let k=new Set;for(let b of a.taskSourceReviews){if(!b||Reflect.ownKeys(b).some(a=>!["taskId","sourceDictionaryIds","receipt"].includes(String(a)))||k.has(b.taskId)||!f.includes(b.taskId)||!Array.isArray(b.sourceDictionaryIds)||!b.sourceDictionaryIds.length||new Set(b.sourceDictionaryIds).size!==b.sourceDictionaryIds.length)throw Error("任务来源用途核定缺项、重复或身份无效");k.add(b.taskId);let a=b.sourceDictionaryIds.map(a=>[...c.sourceControls??[],...c.facts].find(b=>(0,j.vg)(b)===a));if(a.some(a=>!a))throw Error("任务来源用途核定缺少当前冻结原文");(0,p.lH)(b.receipt,{variants:[],sourceDictionary:a,requiredSourceDictionaryIndices:a.map((a,b)=>b)})}for(let[c,d]of a.tasks.entries()){let e=a.phases.filter(a=>a.taskIndices.includes(c));if(d.taskId!==f[c]||s(d.phaseIds)!==s(e.map(a=>a.id))||d.status!==(e.length?"planned":"unmeasured")||d.approach!==e.map(a=>a.method).join(";")||s(d.handoffs)!==s([...new Set(e.flatMap(a=>a.interfaces))])||d.objectScope!==b.sections[c].responsibility||d.boundary!==b.sections[c].responsibility)throw Error("共享组织委派与实际阶段及冻结任务职责不一致")}}function G(a){if(a.production.issues.length)throw Error(`共同工程计划未通过写前计算校验,暂停作者调度。仍有${a.production.issues.length}项工程输入、班组、资源或工期问题;${a.review.reason}。完整候选及逐项计算回执已保留,须由主控修正后重新核验。`)}function H(a,b,c){x(b);let{id:d,...e}=a;if(a.version!==r||s(e)!==d||a.projectSnapshotId!==b.snapshotId)throw Error("作者权限底座与当前组织骨架/项目身份不同");if(!a.tasks.some(a=>a.taskId===c))throw Error("作者权限底座没有当前任务");let f=a.taskSourceReviews.find(a=>a.taskId===c);if(!f)return{planId:a.id,taskId:c,sourceCases:[],controls:[]};let g=f.sourceDictionaryIds.map(a=>[...b.sourceControls??[],...b.facts].find(b=>(0,j.vg)(b)===a));if(g.some(a=>!a))throw Error("来源用途核定缺少当前冻结原文");let h=(0,p.lH)(f.receipt,{variants:[],sourceDictionary:g,requiredSourceDictionaryIndices:g.map((a,b)=>b)}).sourceCases.map(a=>{let c=g[a.sourceDictionaryIndex],d=b.sources[c.sourceFile]?.sha256;if(!d)throw Error("来源用途核定引用了未冻结来源文件");return{...a,sourceId:(0,j.vg)(c),sourceFile:c.sourceFile,sourceFingerprint:d,chunkIndex:c.sourceRef?.chunkIndex}});return{planId:a.id,taskId:c,sourceCases:h,controls:[]}}},27284:(a,b,c)=>{function d(a){let b=new Map,c=a=>{"string"==typeof a&&a.length>=40?b.set(a,(b.get(a)??0)+1):Array.isArray(a)?a.forEach(c):a&&"object"==typeof a&&Object.values(a).forEach(c)},d=JSON.parse(JSON.stringify(a));if(d&&"object"==typeof d&&!Array.isArray(d))for(let[a,b]of Object.entries(d))["scope","task","interfaces"].includes(a)||c(b);else c(d);let e=[...b].filter(([,a])=>a>1).map(([a])=>a),f=new Map(e.map((a,b)=>[a,b])),g=a=>{if("string"==typeof a&&f.has(a))return{$text:f.get(a)};if(Array.isArray(a)){if(a.length>1&&a.every(a=>a&&"object"==typeof a&&!Array.isArray(a))){let b=new Map,c=a.map(a=>g(a));a.forEach((a,d)=>{let e=Object.keys(a).sort(),f=JSON.stringify(e),g=b.get(f)??{columns:e,positions:[],rows:[]};g.positions.push(d),g.rows.push(e.map(a=>c[d][a])),b.set(f,g)});let d={$records:{length:a.length,groups:[...b.values()].map(a=>1===b.size?{columns:a.columns,rows:a.rows}:a)}};return JSON.stringify(d).length<JSON.stringify(c).length?d:c}return a.map(g)}return a&&"object"==typeof a?Object.fromEntries(Object.entries(a).map(([a,b])=>[a,g(b)])):a};return JSON.stringify({format:"lossless-record-tables-v1",meaning:"$records是完整记录数组:每行按columns逐列解释;多组按positions恢复原数组顺序,单组按行序。字段缺失与null保持区别。$text只引用texts中的完整原字。所有index保持原全局序号,不是表行位置;表和字典不合量、不裁字、不改变采用资格。",data:g(d),texts:e})}c.d(b,{D:()=>d,x:()=>e});let e="【全体子作者共用的主控组织部署与本任务委派】"},27939:(a,b,c)=>{c.d(b,{G0:()=>h,HU:()=>f,RM:()=>i,lY:()=>e,n5:()=>g,yD:()=>d});let d="content-first-technical-bid-v1",e=["写成可据以组织施工的技术方案:明确工程对象和部位、施工前提、工序、接口、控制值、岗位、验收与异常处理;定性管理无需凑参数。","正文直接陈述已经核定的技术条件和措施,不写“按设计图例”“图纸要求”“对照清单”,不说明某个工程或工法来自哪个图纸;规范名称与适用版本可在编制依据中正常列明。出处、原句和推导保存在引用审计中。","不得用“以经审批的专项施工方案及设计文件为准,本节不另行设定”等话把本节技术决定推给后续。审批程序可以写,但必须同时说明当前方案的实际方法、参数和控制要求。","直接用于施工的尺寸、标高、深度、规格和配置须按明确对象与部位给出已核定值;不使用“约”“左右”或笼统范围代替控制值。不同部位确有不同值时逐部位说明,不能取范围端点、平均数或统一最大值冒充所有部位的值。","分层厚度、坑底高程、支护桩长与基坑总深度是不同属性。存在多种设计工况时说明适用工况,偏差允许值与合理施工条件区间也须明确用途,不能混成工程实体的未决范围。","有完整依据才能作技术判断。资料冲突或对象关系尚未解决时,在写作前向主智能体提出具体问题,保留内部未决项;不把“待核定”“以文件为准”塞进成稿,也不编造确定值。","每段提供新的工程信息、必要理由或执行动作。删去重复承诺、空泛口号、泛化制度和无实际作用的过渡语,避免各任务重复工程概况;不得为凑字数增加内容。","项目针对性由本节适用的部位、作业条件、工序接口、资源安排、风险和验收关系体现,不以标题新奇或同义改写体现。行业专业标题、术语、工艺的固定名称与同一项目已核定事实可以稳定复用;不得为避开历史文档而改名、删职责、换正确参数或重新编造方案。","每轮依据当前合格资料、已确认方案和冻结职责独立成稿。表达调整须保持对象、条件、因果顺序、控制值和责任接口不变;必要事实或接口承接的重复不是套话,只有不增加有效信息的重复叙述才需要在其实际作用域内处理。","正文不生成封面,封面不属于专业内容评审评分项;目录由系统按实际正文标题统一生成,作者无需编写目录或虚构页码。","本轮以专业内容验收,页数仅用于排版参考,后续投标由人工二次排版;不能为压到50页删去必需技术信息。"],f="本节形成精简、实际、有效且可执行的专业技术方案,工程对象、工况、方法、控制值与职责明确;无重复套话、空话或泛化说明,不以资料出处或未来审批替代当前技术决定。工程实体参数按具体部位核定,笼统约数或范围不能替代施工控制值;不同部位的真实差异与允许偏差应明确其适用条件和用途。项目针对性按本节真实对象、条件及其实施关系判断;标准术语、专业标题和必要事实承接可稳定复用,不以跨文档词面相似度或表述新奇程度判分。";function g(a){let b=[/按设计图例/gu,/(?:按|遵照|依据)?图纸要求/gu,/对照清单/gu,/按(?:照)?(?:施工)?图(?:纸)?(?:要求|施工|实施|设置)?/gu,/(?:以|依据|参照|详见)[^。;\n]{0,60}(?:图|图集|设计文件|专项(?:施工)?方案)[^。;\n]{0,25}(?:为准|执行|实施|施工)/gu,/(?:按|依据|参照)[^。;\n]{0,35}图[^。;\n]{0,20}(?:标注|所示|示出|指定)(?:[^。;\n]{0,10}(?:距离|值|尺寸|做法))?/gu,/以[^。;\n]{0,80}(?:专项施工方案|设计文件)[^。;\n]{0,30}为准[^。;\n]{0,30}(?:本节|本方案)?不另行设定/gu].flatMap(b=>[...a.matchAll(b)].map(a=>({text:a[0],start:a.index,end:a.index+a[0].length}))).sort((a,b)=>b.text.length-a.text.length),c=[];for(let a of b)c.some(b=>a.start<b.end&&a.end>b.start)||c.push(a);return c.sort((a,b)=>a.start-b.start).map(a=>`正文用出处或后续文件替代当前技术决定:${a.text}`)}function h(a){let b=g(a);for(let c of a.split(/[。;\n]/u))/(?:设计|图纸)[^。;]*不(?:一致|符)[^。;]*(?:按|依照|根据)现场实际(?:情况)?施工/u.test(c)&&!/(?:不得|禁止|不能|不可)[^。;]{0,12}(?:按|依照|根据)现场实际/u.test(c)&&b.push("设计与现场不符时不能擅自按现场改变设计施工;须明确停止影响范围、记录差异、处理责任及变更后复核放行条件");return[...new Set(b)]}let i="【从来源到施工决定】来源原句用于识别工程对象、合同责任、条件和约束,不直接粘贴成正文。先判断本节实际需决定的工法、资源、检查或接口,再依据已给事实和工程知识写行动、控制、停止与放行。无需为管理段添加参数或重复检查全项目资料。\n合同说“由总包承担”“按图实施”只说明责任或引用,不等于本节已完成技术决定。把责任落实为本方案的具体动作与接口;真实设计/规格未知只就这个问题查证并交主控,其他可完成内容先成文,未决留任务元数据。\n现场与设计发生差异时,禁止擅自按现场改变设计。例如接口条件不一致:停止该接口的开挖和接驳,记录实测位置、标高及影响范围,由项目技术负责人协调设计处理,取得明确变更后交底、复核并放行。这是异常处置,不能替代正常施工方法,不在无此问题的小节机械复制。\n图件必须承载对应专业信息:工序或接口关系用关系图,场地布置用实际相对位置、设施区域及通行/管线线路的平面示意;图内相对坐标不是现场尺寸。需要测量尺度或真实定位时以已核事实支持,数据缺失进入主控问题,不把流程图冒称真实场地平面图。"},29327:(a,b,c)=>{c.d(b,{chiefDecisionWritingContext:()=>M,w:()=>O});var d=c(77598),e=c(63327),f=c(10170),g=c(63007),h=c(48825),i=c(9848),j=c(16752),k=c(44616),l=c(5518),m=c(73123);function n(a,b){if(!b.query?.trim()||b.query.length>300||!Number.isSafeInteger(b.offset??0)||(b.offset??0)<0||!Number.isSafeInteger(b.limit??4)||(b.limit??4)<1||(b.limit??4)>8||void 0!==b.filePath&&!Object.hasOwn(a.sources,b.filePath))throw Error("原文查询条件或冻结文件身份无效");let c=b.query.trim().split(/\s+/u).map(a=>a.toLowerCase()),d=(a.sourceControls??[]).filter(d=>"verified-source-excerpt"===d.roleId&&d.factId&&Object.hasOwn(a.sources,d.sourceFile)&&(void 0===b.filePath||d.sourceFile===b.filePath)&&c.every(a=>d.value.toLowerCase().includes(a))).sort((a,b)=>a.sourceFile.localeCompare(b.sourceFile)||Number(a.sourceRef?.chunkIndex??0)-Number(b.sourceRef?.chunkIndex??0)),e=b.offset??0,f=d.slice(e,e+(b.limit??4)),g=e+f.length;return{kind:"frozen-original-source",projectSnapshotId:a.snapshotId,query:b.query,matchedCount:d.length,offset:e,complete:g>=d.length,...g<d.length?{nextOffset:g}:{},sources:f.map(b=>({sourceId:b.factId,...(0,k.mk)(a,void 0,b.factId),filePath:b.sourceFile,sourceHash:a.sources[b.sourceFile].sha256,chunkIndex:b.sourceRef?.chunkIndex,sectionTitle:b.sourceRef?.sectionTitle,text:b.value,sourceVersionEligibility:a.sourceVersionPolicy?(0,m.bz)(a,{sourceFile:b.sourceFile,usage:"source-reference",quote:b.value}):{status:"unmeasured",decisionIds:[],reason:"原文可供只读追溯;缺少来源版本用途账,不能作为本次准入或设计采用证明"},sourceSemantics:b.sourceSemantics??(0,l.Q)(b.sourceRef?.roleId??b.roleId,b.sourceRef?.processingType??b.processingType)})),interpretation:"冻结原文候选;须结合对象、条件及已裁决事实判断适用性,查询零命中不证明全部资料没有该内容"}}var o=c(68417),p=c(15254),q=c(66620),r=c(23009),s=c(27939),t=c(5968),u=c(9236);let v=a=>"string"==typeof a&&!!a.trim();async function w(a,b){if(b.signal?.throwIfAborted(),!Array.isArray(a)||!a.length)throw Error("工程裁决须提供非空的实际对象控制项");let c=a.map(a=>{if(!a||"object"!=typeof a||Object.keys(a).some(a=>!["objectName","attribute","condition","value","instruction","evidence","derivation"].includes(a))||!["objectName","attribute","condition","value","instruction"].every(b=>v(a[b])&&a[b].length<=1500)||!Array.isArray(a.evidence)||!a.evidence.length||a.evidence.length>8)throw Error("工程控制项的对象、属性、工况、值或依据不完整");let c=a.evidence.map(a=>{if(!a||Object.keys(a).some(a=>!["sourceId","quote"].includes(a))||!v(a.sourceId)||!v(a.quote))throw Error("工程裁决的原文定位无效");let c=b.sources.find(b=>b.sourceId===a.sourceId);if(!c||!(0,p.dP)(c.text,a.quote))throw Error("工程裁决引用未查询的来源或改写了原文");return{sourceId:a.sourceId,quote:a.quote}}),d=(0,q.ei)(a.value);if((0,s.n5)(a.instruction).length)throw Error("工程控制执行指引仍将施工决定转交图示、设计文件或审批,须先核定具体执行要求");if(1!==d.length||/\d\s*(?:~|~|至|到|–|—)\s*[+−-]?\d|(?:约|左右|大致)/u.test(a.value))throw Error("控制值须为明确数值及单位;范围和约数只能保留为概况");if((0,q.ei)(a.instruction).some(a=>!d.includes(a)))throw Error("执行指引包含控制项之外未核定的参数");if(void 0!==a.derivation){let c=a.derivation;if(!c||Object.keys(c).some(a=>!["formula","inputFactIds","basis"].includes(a))||!v(c.formula)||!v(c.basis)||!Array.isArray(c.inputFactIds)||!c.inputFactIds.length||c.inputFactIds.some(a=>!b.facts.some(b=>b.factId===a)))throw Error("工程推导须使用本次提供的可靠事实与有限算式");(0,q.Db)([{unitId:"chief-control",quote:a.value,source:{kind:"derived",...c}}],{units:[{id:"chief-control",kind:"paragraph",criterionIds:[],text:a.value}],project:b.project,factBindings:[],required:!0})}else if(!c.some(a=>(0,q.ei)(a.quote).includes(d[0])))throw Error("控制值与单位没有得到实际引文支持");return{objectName:a.objectName,attribute:a.attribute,condition:a.condition,value:a.value,instruction:a.instruction,evidence:c,...a.derivation?{derivation:a.derivation}:{}}}),d=(0,t.TR)(b.project,c,b.sources,b.taskId),e=JSON.stringify({task:b.task,criteria:b.criteria,effectiveFacts:b.facts,controls:c,cadReadings:b.cadReadings,sourceContext:d,sources:b.sources}),f=Math.max(8e3,Math.ceil(.6*JSON.stringify({controls:c,variants:d.variants,sources:d.sourceDictionary.map(a=>({value:a.value,objectName:a.objectName}))}).length)+1200*c.length),g=b.reviewer?await b.reviewer(e):await (0,r.bb)('你是独立工程适用性评审者。核对主智能体的控制项与完整原文、已裁决事实和本任务职责。须明确同一对象、部位、施工阶段、基准、适用条件和数值属性;存在无关图框/详图/材料串用、取概况范围端点或平均值、把计价量当实测量、分层厚度当总深度、引用已被更正资料、未经确认的范围扩大或推导输入基准不一致时拒绝。原文引用与算术正确不等于工程适用性正确。未核出部位关系保持unmeasured,不能以通常经验补造。每个控制项按零起始index返回status=confirmed/rejected/unmeasured与reason。同时对sourceContext中每份完整原文、每个实际variant及control返回完整sourceReview。sourceCases语义分为project-design/project-condition/normative-rule/reference-option/reference-method/unmeasured;每个case必须填写versionDomain,按完整原文的实际用途选择boq-quantity、procurement-brand、procurement-specification、construction-method,尚未确认填unmeasured。一个清单表引用A材料品牌,不扩大为它所有数量或工序均受A版本限制;同句同时断言数量与品牌须分别核定实际用途,不能只核数量而漏核产品选择。reference-method只用于已独立核定的非定量参考工序,versionDomain只能construction-method,不承接任何产品选型、规格或清单量控制。不把冻结出处或工艺推导正确当项目采用证明;图集参考选项须真实项目selector与option原文的同selectionKey桥,不能凭通常采用或reason确认。规范约束只登记normative-constraint,本工程设计或项目已选参数为project-property。derived输出只核公式、对象及基准关系,不变成原文已给的项目值;sourceContext中其输入control仍逐项核真实输入来源用途。逐源完整解释、逐variant覆盖,未知保留unmeasured,不新增省略字段。只返回JSON {"results":[{"index":0,"status":"confirmed|rejected|unmeasured","reason":"对象条件及推导关系核验"}],"sourceReview":{"confirmed":true,"reason":"整体复核理由","sourceResults":[{"sourceDictionaryIndex":0,"complete":true,"caseIds":["case-a"],"reason":"完整原文解释"}],"sourceCases":[{"id":"case-a","sourceDictionaryIndex":0,"quote":"该源真实连续原文","objectScope":"实际对象","condition":"适用工况","semanticKind":"project-condition","versionDomain":"unmeasured","applicability":"applicable","variantIds":["从sourceContext选择"],"reason":"项目用途依据"}],"variantResults":[{"variantId":"从sourceContext选择","status":"confirmed|rejected|unmeasured","sourceCaseIds":["case-a"],"reason":"来源与工况关系"}],"controlsResults":[{"variantId":"从sourceContext选择","controlId":"从sourceContext选择","status":"confirmed|rejected|unmeasured","usage":"project-property|normative-constraint","sourceCaseIds":["case-a"],"selectionEvidence":[{"selectorSourceCaseId":"真实项目选择case","optionSourceCaseId":"参考选项case","selectionKey":"两份原文逐字共同标识"}],"reason":"用途核验理由"}],"uncoveredSourceCases":[]}}。没有选项时selectionEvidence为空数组。',e,{diagnostics:b.diagnostics,signal:b.signal,taskKind:(0,r.TO)(),callKind:"supervisor-decision",maxTokens:f,temperature:0,schema:{type:"object",required:["results","sourceReview"],properties:{results:{type:"array",minItems:c.length,maxItems:c.length,items:{type:"object",properties:{index:{type:"integer",required:!0},status:{type:"string",required:!0,enum:["confirmed","rejected","unmeasured"]},reason:{type:"string",required:!0,minLength:1}}}},sourceReview:(0,u.q1)(d.variants,d.sourceDictionary.map((a,b)=>b))}}});b.signal?.throwIfAborted();let h=g&&"object"==typeof g&&Array.isArray(g.results)?g.results:[];for(let[a]of c.entries()){let b=h.filter(b=>b&&"object"==typeof b&&b.index===a),c=b[0];if(1!==b.length||c?.status!=="confirmed"||!v(c.reason))throw Error(`工程适用性未确认:控制项${a},${v(c?.reason)?c.reason:"评审缺项或无效"}`)}let i=(0,t.XJ)({project:b.project,planId:b.planId,taskId:b.taskId,decisionId:b.decisionId,controls:c,sources:b.sources,review:g});return{controls:c.map(a=>{let{derivation:c,...d}=a;return{...d,evidence:a.evidence.map(a=>({...a,...(0,k.mk)(b.project,void 0,a.sourceId)})),...c?{derivation:{...c,inputFactIndices:c.inputFactIds.map(a=>{let c=(0,k.mk)(b.project,a).factIndex;if(void 0===c)throw Error("推导输入没有本轮冻结属性序号");return c})}}:{}}}),review:g,sourceApplicationReceipt:i}}var x=c(45455);function y(a,b){let c=new Map,d=(a.sourceControls??[]).filter(b=>"verified-source-excerpt"===b.roleId&&Object.hasOwn(a.sources,b.sourceFile)),f=b=>{let f=d.find(a=>(0,e.vg)(a)===b);f&&c.set(b,{sourceId:b,...(0,k.mk)(a,void 0,b),filePath:f.sourceFile,sourceHash:a.sources[f.sourceFile].sha256,chunkIndex:f.sourceRef?.chunkIndex,sectionTitle:f.sourceRef?.sectionTitle,text:f.value,sourceVersionEligibility:{status:"unmeasured",decisionIds:[],reason:"真实读取仅恢复冻结原文身份;来源用途、版本及工程采用须独立复核"},sourceSemantics:f.sourceSemantics??(0,l.Q)(f.roleId,f.processingType)})};for(let g of b)if(!g.error&&g.result&&g.result.projectSnapshotId===a.snapshotId)if("source"===g.kind)for(let b of g.result.sources){let f=d.find(a=>(0,e.vg)(a)===b.sourceId);f&&b.filePath===f.sourceFile&&b.sourceHash===a.sources[f.sourceFile].sha256&&b.chunkIndex===f.sourceRef?.chunkIndex&&b.text===f.value&&c.set(b.sourceId,b)}else if("cad"===g.kind){let b=g.result;if("annotations"!==b.kind||a.sources[b.filePath]?.sha256!==b.parsedIdentity)continue;for(let a of b.records){let c=a.payload.text;if("string"==typeof c&&c.trim()&&a.payload.source&&"string"==typeof a.payload.id)for(let a of d.filter(a=>a.sourceFile===b.filePath&&a.value.replace(/\s/gu,"").includes(c.replace(/\s/gu,""))))f((0,e.vg)(a))}}else for(let b of g.result.items){let c=a.workPackages?.flatMap(a=>a.members??[]).find(a=>a.id===b.id);c&&JSON.stringify(c.entry)===JSON.stringify(b.entry)&&b.sourceEvidenceId&&a.sources[b.entry.sourceFile]?.sha256===b.sourceFingerprint&&f(b.sourceEvidenceId)}return[...c.values()]}function z(a){return a.flatMap(a=>{if(a.error||!a.result)return[];if("source"===a.kind){let b=a.result;return(0,x.xj)([{toolName:"read_source",ok:!0,data:{...b,chunks:b.sources.map(a=>({filePath:a.filePath,chunkIndex:a.chunkIndex,sourceId:a.sourceId,sourceHash:a.sourceHash,content:a.text}))}}])}return(0,x.xj)([{toolName:"cad"===a.kind?"query_cad_context":"query_work_packages",ok:!0,data:a.result}])})}async function A(a){let b=a.initialSourceQueries.map(b=>({kind:"source",query:b,result:n(a.project,b)})),c=[],d=[],e=new Set(z(b)),f=!1;for(;;){let g=await a.ask([a.prompt,'需要继续查证时返回 {"action":"read","sourceQueries":[{query,filePath?,offset?,limit?}],"cadQueries":[{filePath,kind:"frames"|"annotations"|"geometry"|"instances",frameId?,entityId?,rootInstanceId?,query?,offset?,limit?}]}。按真实对象读取,nextOffset继续分页;新证据或实际游标有进展即可继续,没有总次数配额。重复同页、空结果和改query不代表新证据。先定位图框;读取身份、单位文字、坐标均不自动成为已核定工程参数。没有新证据时具体说明未核事项,不编造施工值。',...a.readCad?[]:["本次未提供CAD结构读取能力,cadQueries不可使用。"],JSON.stringify({readingReceipts:b,protocolErrors:d})].join("\n"));if(c.push(g),a.onProgress?.(b,c,d),!g||"object"!=typeof g||"read"!==g.action)return{raw:g,attempts:c,reads:b,protocolErrors:d,sources:y(a.project,b)};if(Object.keys(g).some(a=>!["action","sourceQueries","cadQueries"].includes(a))||void 0!==g.sourceQueries&&!Array.isArray(g.sourceQueries)||void 0!==g.cadQueries&&!Array.isArray(g.cadQueries))throw Error("主控追加读取协议无效");let h=[...(g.sourceQueries??[]).map(a=>({kind:"source",query:a})),...(g.cadQueries??[]).map(a=>({kind:"cad",query:a}))];if(!h.length){if(d.push("读取请求为空,未取得新证据;请返回具体裁决或实际定位条件。"),a.onProgress?.(b,c,d),f)throw Error("主控重复无进展,未形成已核定裁决");f=!0;continue}let i=b.length;for(let e of h){try{let c="source"===e.kind?["query","filePath","offset","limit"]:["filePath","kind","frameId","entityId","rootInstanceId","query","offset","limit","placement","textOnly","order","detail"];if(!e.query||"object"!=typeof e.query||Object.keys(e.query).some(a=>!c.includes(a)))throw Error("读取定位字段无效");if("cad"===e.kind&&!a.readCad)throw Error("本次主控未提供CAD读取能力");let d="source"===e.kind?n(a.project,e.query):a.readCad(e.query);b.push({...e,result:d})}catch(a){b.push({...e,error:a instanceof Error?a.message:String(a)})}a.onProgress?.(b,c,d)}let j=z(b.slice(i)),k=j.some(a=>!e.has(a));if(j.forEach(a=>e.add(a)),k)f=!1;else{if(d.push("实际读取没有新的证据或分页进展;不能以改查询词或重复第一页声称完成查证。"),a.onProgress?.(b,c,d),f)throw Error("主控重复无进展,未形成已核定裁决");f=!0}}}var B=c(24481);let C={type:"object",properties:{query:{type:"string",description:"以空格分隔的每个词均须出现在同一原文片段中;不是多个问题或备选词。换查询须从offset=0开始。"},filePath:{type:"string"},offset:{type:"integer",minimum:0,description:"同一查询的下一页必须使用回执nextOffset;不能沿用其他查询的偏移。"},limit:{type:"integer",minimum:1,maximum:8}},required:["query"],additionalProperties:!1},D={type:"object",properties:{filePath:{type:"string"},kind:{type:"string",enum:["frames","annotations","geometry","instances"]},frameId:{type:"string",description:"annotations/geometry须提供本次frames实际返回的图框ID、entityId或instances返回的rootInstanceId。"},entityId:{type:"string"},rootInstanceId:{type:"string",description:"instances目录实际返回的源根身份,用于annotations或geometry;根handle或ordinal不是工程部位,readingSourceIds只读身份不是已核定事实。"},query:{type:"string",description:"单条标注或图名中的实际字面子串。不是语义检索,不支持空格分隔的多词。数字标注常只有数值,建议先不填query读取所选图框或实际根标注,再按真实文字定位。图框可用剖面等实际图名定位。"},offset:{type:"integer",minimum:0,description:"回执nextOffset为实际分页边界;不按请求limit自行累加。换图框、实际根或关键词须从0开始。"},limit:{type:"integer",minimum:1,maximum:24},placement:{type:"string",enum:["all","drawing-space","frame-instance"],description:"在所选图框内按实际块路径筛选;drawing-space排除图框实例及其ATTRIB(常为图签),frame-instance仅查看这部分;不是语义删除,不证明另一部分没有工程说明。剖面主体标注宜先读drawing-space。"},textOnly:{type:"boolean",description:"仅返回有实际文字的标注,过滤空DIMENSION;其尺寸印刷字仍按实际图形块引用返回。"},order:{type:"string",enum:["source","position"],description:"position按实际世界坐标从上到下、从左到右阅读;只是绘图位置,不据此判断工程标高和对象。"},detail:{type:"string",enum:["full","catalog"],description:"frames默认catalog提供实际图框身份、图名和图号;需要真实边界和块变换时按entityId读取full。annotations/geometry始终full。"}},required:["filePath"],additionalProperties:!1},E={type:"object",properties:{action:{type:"string",enum:["use-facts","use-sources","engineering-controls","qualitative-controls","guidance","request-human"]},answer:{type:"string"},reason:{type:"string"},factIds:{type:"array",items:{type:"string"}},sourceIds:{type:"array",items:{type:"string"}},controls:{type:"array",minItems:1,items:{type:"object",properties:{objectName:{type:"string"},attribute:{type:"string"},condition:{type:"string"},value:{type:"string"},instruction:{type:"string"},evidence:{type:"array",items:{type:"object",properties:{sourceId:{type:"string"},quote:{type:"string"}},required:["sourceId","quote"],additionalProperties:!1}},derivation:{type:"object",properties:{formula:{type:"string"},inputFactIds:{type:"array",items:{type:"string"}},basis:{type:"string"}},required:["formula","inputFactIds","basis"],additionalProperties:!1}},required:["objectName","attribute","condition","value","instruction","evidence"],additionalProperties:!1}},qualitativeControls:{type:"array",minItems:1,items:{type:"object",properties:{category:{type:"string",enum:["conditional-duty","project-adoption"]},objectName:{type:"string"},attribute:{type:"string"},condition:{type:"string"},value:{type:"string"},instruction:{type:"string"},evidence:{type:"array",minItems:1,items:{type:"object",properties:{sourceId:{type:"string"},quote:{type:"string"}},required:["sourceId","quote"],additionalProperties:!1}}},required:["category","objectName","attribute","condition","value","instruction","evidence"],additionalProperties:!1}}},required:["action","answer","reason","factIds","sourceIds"],additionalProperties:!1},F={type:"object",properties:{query:{type:"string",description:"工程、分部或清单项目的实际字面子串;*列出本轮全部成员,不使用空格拼接多个备选词。"},offset:{type:"integer",minimum:0,description:"使用同一查询回执nextOffset继续分页;换查询从0开始。"},limit:{type:"integer",minimum:1,maximum:8}},required:["query"],additionalProperties:!1};class G extends Error{constructor(a,b,c,d){super(b,{cause:d}),this.code=a,this.name="OPERATION_TIMEOUT"===a?"TimeoutError":"OPERATION_ABORTED"===a?"AbortError":"ChiefReadingOperationError",this.reads=[...c.reads],this.attempts=[...c.attempts],this.errors=[...c.errors]}}let H={name:"finish_source_reading",description:"结束本次普通目录及原文定位阶段;可说明已提供的真实资料足够,避免无必要重复读。这里只结束准备,不能确认工法或宣称方案已核定,后续独立进行专业推理提交。",parameters:{type:"object",properties:{reason:{type:"string",minLength:1}},required:["reason"],additionalProperties:!1}};async function I(a){a=(0,B.DQ)(a);let b=[],c=[],d=[],e={reads:b,attempts:c,errors:d},f=a.signal??new AbortController().signal,g=()=>{if(f.aborted){let g=f.reason,h=g?.name==="TimeoutError",i=void 0===g||g?.name==="AbortError",j=h?"OPERATION_TIMEOUT":i?"OPERATION_ABORTED":"OPERATION_FAILED",k=h?"本地主控查证操作期限已到达;保留已读回执,方案保持未测状态":i?"用户中止主控查证;未采用后续读取或提交结果":g instanceof Error?g.message:`外部运行信号终止主控查证:${String(g)}`,l=`${j}: ${k}`;throw d.includes(l)||(d.push(l),a.onProgress(b,c,d)),new G(j,k,e,f.reason)}};try{return await (0,B.Uq)({diagnostics:a.diagnostics,signal:f,callKind:a.callOptions?.callKind??"supervisor-decision"},async()=>{let h=a.submission??{name:"submit_chief_decision",description:"查证完毕后提交本任务裁决。工程控制继续接受来源、量纲、算术和独立适用性审查;guidance只提供定性指引。",parameters:E};if(!/^[A-Za-z0-9_-]{1,64}$/u.test(h.name)||["read_frozen_source","read_frozen_cad","read_frozen_work_packages",H.name].includes(h.name)||!h.description.trim()||!h.parameters||"object"!=typeof h.parameters||Array.isArray(h.parameters))throw Error("主控提交工具声明无效或与读取工具重名");g(),b.push(...a.initialSourceQueries.map(b=>({kind:"source",query:b,result:n(a.project,b)})));let i=!1,j=!a.readingCallOptions,k=new Set(z(b)),l=b.length,m=new Set,o=a=>{let c=z(b.slice(l));l=b.length;let d=c.some(a=>!k.has(a));if(c.forEach(a=>k.add(a)),d)return void m.clear();if(m.has(a))throw new G(i?"PLAN_VALIDATION_FAILED":"READING_NO_PROGRESS",`主控重复无进展,未发布裁决:${a}。保留已读证据与实际错误,未决不代表没有要求`,e);m.add(a)},p=[],q=[{name:"read_frozen_source",description:"读取本轮冻结的完整解析原文,保留条件与真实来源,可继续nextOffset;零命中不证明工程资料没有。",parameters:C},...a.readCad?[{name:"read_frozen_cad",description:"读取本轮真实CAD图框、标注或几何。无图框时annotations可用非空实际字面query定位候选,再按rootBindings中真实rootInstanceId读annotations或geometry,也可从instances目录定位;源handle和裸坐标不自动成为工程部位或施工参数,空query不全图返回。",parameters:D}]:[],...a.readWorkPackages?[{name:"read_frozen_work_packages",description:"读取本轮冻结的原始清单成员,保留对象、完整特征、数量单位和真实来源。按nextOffset继续完整记录;清单计价量不自动成为施工控制值,零命中不证明工程资料没有。",parameters:F}]:[],h],s=[{role:"user",content:[a.prompt,...a.readingCallOptions?["当前先执行普通源查证阶段,只定位实际目录、清单成员与完整原文,不在此阶段确认工法。已有真实提供的资料足够时可用finish_source_reading说明理由结束准备;之后才使用专业推理提交完整方案。"]:[],a.submission?`通过实际工具查证,禁止把尚未读到的资料、清单成员、图框、单位或部位关系当作已确认。真实证据或分页游标有进展即可继续;重复空结果、失败或同一控制反馈后具体保留未决,不编造已核定关系。最终通过${h.name}提交;读取和提交不放在同一轮。`:"通过实际工具查证,禁止把尚未读到的图框、单位或部位关系当作已确认。真实证据或分页游标有进展即可继续;反复没有新证据时具体保留未决,不代写含糊施工正文。最终裁决通过submit_chief_decision提交;读取和提交不放在同一轮。",JSON.stringify({initialReadingReceipts:b})].join("\n")}],t=new Set,u=()=>{let c=y(a.project,b).filter(a=>!t.has(a.sourceId));c.forEach(a=>t.add(a.sourceId)),c.length&&s.push({role:"user",content:`【实际读取恢复的冻结原文来源】${JSON.stringify(c)}。提交sourceIds和evidence.sourceId只能选择这些sourceId;cad-read、图框、实体和清单成员ID只作读取定位。完整原文可读不代表工程采用许可,仍须独立核对象、条件、版本和用途。`});let d=a.readingContext?.(b);d?.trim()&&s.push({role:"user",content:`【冻结读取后的真实只读上下文】
|
|
126
|
-
${d}`})};for(b.length&&(a.onProgress(b,c,d),u());;){g();let e=j?a.callOptions:a.readingCallOptions,k=j?q:[...q.filter(a=>a.name!==h.name&&"read_frozen_cad"!==a.name),H],l=await (0,r.Qf)(()=>(a.caller??r._v)({system:a.system??"你是负责专业边界、资料口径和作者协作的主智能体,使用实际工具查清工程对象及工况后裁决。",messages:s,tools:k,requireToolCall:!1,taskKind:e?.taskKind??"reasoning",diagnostics:a.diagnostics,signal:f,callKind:e?.callKind??"supervisor-decision",maxTokens:e?.maxTokens??12e3,temperature:0}),f);if(c.push(l??null),a.onProgress(b,c,d),g(),!l)throw Error("主控模型未返回有效响应,未执行读取或裁决");if(s.push({role:"assistant",content:l.content,toolCalls:l.toolCalls,...void 0!==l.thinkingContent?{thinkingContent:l.thinkingContent}:{}}),l.responseMetadata?.completed===!1){let e="本轮模型响应被截断,读取或提交均未执行;须根据实际响应容量返回完整工具请求,未闭合内容不执行";for(let a of(d.push(e),l.toolCalls))s.push({role:"tool",toolCallId:a.id,content:JSON.stringify({accepted:!1,performed:!1,error:e})});s.push({role:"user",content:e}),a.onProgress(b,c,d),o(e);continue}if(!l.toolCalls.length){d.push("本轮仅返回普通文本,未执行读取或裁决"),s.push({role:"user",content:`本轮普通文字未作为工程裁决执行。请调用已提供的读取工具继续查证,或调用${h.name}提交有实际依据的裁决。`}),a.onProgress(b,c,d),o("普通文字未执行工具裁决");continue}let t=l.toolCalls.filter(a=>a.name===H.name);if(!j&&(t.length||l.toolCalls.some(a=>a.name===h.name))){let e;if(1!==t.length||1!==l.toolCalls.length)e="普通源查证阶段不执行方案提交;结束准备与读取须分轮,之后用专业推理完整提交";else try{let a=JSON.parse(t[0].arguments);if(!a||"object"!=typeof a||Array.isArray(a)||Object.keys(a).some(a=>"reason"!==a)||"string"!=typeof a.reason||!a.reason.trim())throw Error("结束源查证须说明实际资料是否已足够及剩余未核事项");j=!0,m.clear(),p.push({reason:a.reason,engineeringDecision:"not-evaluated"})}catch(a){e=a instanceof Error?a.message:String(a)}for(let a of(e&&d.push(e),l.toolCalls))s.push({role:"tool",toolCallId:a.id,content:JSON.stringify(e?{performed:!1,accepted:!1,error:e}:{performed:!0,stage:"source-reading-finished",engineeringDecision:"not-evaluated",instruction:`准备阶段已结束;下一轮按专业推理调用${h.name}完整提交,当前没有采用任何工法候选`})});a.onProgress(b,c,d),u(),e&&o(e);continue}let v=l.toolCalls.filter(a=>a.name===h.name);if(1===v.length&&1===l.toolCalls.length){let e=y(a.project,b);try{let d=JSON.parse(v[0].arguments);return await (0,r.Qf)(()=>Promise.resolve(a.validateSubmission?.(d,e,b)),f),g(),{raw:d,reads:b,attempts:c,sources:e,...p.length?{preparationReceipts:p}:{}}}catch(h){g(),i=!0;let e=h instanceof Error?h.message:String(h);d.push(e);let f=e.includes("图纸泛指")||e.includes("转交图示")||e.includes("后续审批")?"把 instruction 改写成「对象+部位+工序动作+控制要求」的可执行句;删除“按图/按设计图/按审批/以…为准/待深化/报审后执行”等指向语,来源证明仍保留在 evidence 中。":e.includes("控制值须为明确数值及单位")?"单一工程控制值只能是明确数值+单位;来源原文是范围或约数时不得作为工程控制值——若它是源内条件义务,改用 action=qualitative-controls 的 conditional-duty 原样保留范围与完整条件;若只需正文引用原文,改用 action=use-sources。":e.includes("缺逐项独立用途复核")?"提交须逐项覆盖全部 controls:results 的 index 依次覆盖 0..controls.length-1,每项 status 与 reason 完整;漏项或重复即整次退回。":e.includes("非定性决定不能附加未核定采用许可")?"qualitativeControls 只能与 action=qualitative-controls 同时出现;engineering-controls 只提交 controls 数组,不得附带 qualitativeControls。":e.includes("工程适用性未确认")?"全部控制项必须逐项 confirmed;证据不足的部位关系保持 unmeasured 会导致整次退回——只提交已读证据足以支撑同一对象、工况、基准与适用条件的控制,其余以 use-sources 或 request-human 保留。":e.includes("未查询的来源")||e.includes("改写了原文")?"quote 必须是本次实际读取原文中的连续原字,sourceId 只能选择已返回的 sourceId。":"";s.push({role:"tool",toolCallId:v[0].id,content:JSON.stringify({accepted:!1,performed:!1,error:e,instruction:`${a.submission?"本次提交未采用;根据真实读取回执与本次校验错误纠正当前提案,不能把缺证据的关系宣称已核定或扩大提交范围。":"本次裁决未采用;只根据已读证据纠正当前提案,不用含数字的guidance或图示指向语绕过工程控制校验。"}${f?`纠正方向:${f}`:""}`})}),a.onProgress(b,c,d),u(),o(`裁决未通过独立校验:${e}`);continue}}for(let e of l.toolCalls){let f,h;g();try{if(v.length)throw Error("读取与提交须分轮;本轮混合请求全部未执行,请先完成查证");let b=JSON.parse(e.arguments),c="read_frozen_source"===e.name?"source":"read_frozen_cad"===e.name&&a.readCad?"cad":"read_frozen_work_packages"===e.name&&a.readWorkPackages?"work-package":void 0;if(!c)throw Error("主控请求了未提供的能力");let d=Object.keys(("source"===c?C:"cad"===c?D:F).properties);if(!b||"object"!=typeof b||Object.keys(b).some(a=>!d.includes(a)))throw Error("读取定位字段无效");let g="cad"!==c||b.kind&&"frames"!==b.kind?b:{limit:24,detail:"catalog",...b};(f={kind:c,query:g}).result="source"===c?n(a.project,g):"cad"===c?a.readCad(g):a.readWorkPackages(g),h=f.result}catch(b){let a=b instanceof Error?b.message:String(b);f?f.error=a:d.push(a),h={error:a,performed:!1}}f&&b.push(f),s.push({role:"tool",toolCallId:e.id,content:JSON.stringify(h)}),a.onProgress(b,c,d)}u(),o("实际读取没有新的源材料或游标"),s.push({role:"user",content:"已保留本轮实际读取;使用nextOffset继续真实未完成分页。重复同页或空结果不表示新增证据,不凭查证动作扩大用途。"})}})}catch(a){if(a instanceof G)throw a;throw g(),new G("OPERATION_FAILED",a instanceof Error?a.message:String(a),e,a)}}var J=c(41240),K=c(68959),L=c(9090);function M(a){let{controls:b,qualitativeControls:c,...d}=a;return{...d,...a.writingControls?{controls:a.writingControls}:{},...a.writingQualitativeControls?{qualitativeControls:a.writingQualitativeControls}:{}}}let N=a=>(0,d.createHash)("sha256").update(JSON.stringify(a)).digest("hex");function O(a){let b=new Map;return c=>({ask:async d=>{let l=a.contract.sections.find(a=>a.id===c);if(!l||"string"!=typeof d.question||!d.question.trim()||d.question.length>4e3||!Array.isArray(d.criterionIds)||!d.criterionIds.length||new Set(d.criterionIds).size!==d.criterionIds.length||d.criterionIds.some(a=>!l.criterionIds.includes(a))||void 0!==d.factQueries&&(!Array.isArray(d.factQueries)||d.factQueries.some(a=>!a||"string"!=typeof a.attribute||!a.attribute.trim()||Object.keys(a).some(a=>!["attribute","objectName"].includes(a))||void 0!==a.objectName&&"string"!=typeof a.objectName)))throw Error("主控问题必须指向当前作者的具体职责");if(void 0!==d.sourceQueries&&(!Array.isArray(d.sourceQueries)||d.sourceQueries.some(a=>Object.keys(a).some(a=>!["query","filePath","offset","limit"].includes(a)))))throw Error("原文查询须明确实际定位条件");let m=(d.sourceQueries??[]).map(b=>n(a.project,b)),r=N([c,d]),s=b.get(r);if(s)return s;let t=(async()=>{var b,n;let s,t,u,v,x,y,z,B,C=a.contract.criteria.filter(a=>d.criterionIds.includes(a.id)),D=new Set(C.flatMap(a=>a.factIds??[])),E=(d.factQueries??[]).map(b=>(0,g.j)(a.project,b));for(let a of E)if("resolved"===a.status)for(let b of a.candidates)D.add(String(b.factId));let F=a.project.facts.filter(b=>D.has((0,e.vg)(b))&&(0,f.j)(b)&&Object.hasOwn(a.project.sources,b.sourceFile)).filter(a=>!(0,i.p)(a).requiresTechnicalDecision).filter(b=>!b.resolutionRef||!!(b.resolutionRef.winnerSourceFile&&Object.hasOwn(a.project.sources,b.resolutionRef.winnerSourceFile))).map(b=>({...(0,j.YL)(a.project,b),factId:(0,e.vg)(b),sourceFile:b.resolutionRef?.winnerSourceFile??b.sourceFile,sourceRef:b.resolutionRef?b.resolutionRef.winnerSourceRef??null:b.sourceRef??null})),G=["你是专业文档的主智能体,回答作者在正式提交首稿前遇到的具体问题。",...a.sharedPlan?[`【本轮共同组织候选与真实任务接口】${JSON.stringify((0,J.E6)(a.sharedPlan,a.contract.sections,l.id))}。在既有对象、阶段与接口内裁决,发现来源冲突须说明具体冲突,不能让作者独自另换工序或把未决值写成正文。`]:[],...a.contract.deliveryPolicy?[(0,h.Jf)({projectType:a.contract.writingKnowledge?.projectType,title:l.title,responsibility:l.responsibility,contentTypes:l.contentTypes}).text]:[],"可选择 use-facts(指向给定可靠事实)、use-sources(提供已查询的完整原文)、engineering-controls(真实定量控制及推导)、qualitative-controls(实际方法/定性采用或原源条件义务,独立复核后只授指定任务用途)、guidance(定性方法与职责指引)、request-human(资料或合同需改变)。","不得编造项目数值或标准限值,guidance只给方法建议,不构成任何数值或选型采用许可。已有原文的工程决定应提交具体controls或qualitativeControls独立核定,不以笼统组织词代替。先通过明确原文查询定位条件与方法;原文可用时提供完整来源,不因尚未抽成属性就直接交回人。确需外部资料或更改合同才保留未决。数值范围仍须按对象与阶段解析,不能任选端点。不要代写整节正文。",'只返回{"action":"guidance","answer":"可执行的回答","factIds":[],"sourceIds":[],"reason":"为何这样裁决"}。use-sources的sourceIds必须选择本次原文查询实际返回的来源身份。',"engineering-controls的factIds仅为controls中实际derivation.inputFactIds的去重并集;直接引用原文、没有算式时必须返回factIds:[]。读过的候选不等于采用的推导输入,不能把待核定范围放入factIds。每项工程控制的实质决定全部写入controls,answer只解释状态,不能用图示指向语替代控制项。","engineering-controls另须controls数组,每项为{objectName,attribute,condition,value,instruction,evidence:[{sourceId,quote}],derivation?:{formula,inputFactIds,basis}}。quote须来自已查询原文的真实连续引文,value须有数值及单位,condition明确适用部位与阶段,不泛化全工程;优先使用原文明确的控制标高等可执行属性,无须强行生成统一总深度。只有已提供的可靠单值事实可作推导输入,算式用$0、$1及四则括号,服务端核量纲与算术。sourceIds为全部实际用到的原文身份,factIds为全部推导输入;执行指引不添加未经核定的参数。裁决不会改写冻结项目事实或证明整篇合格。",'qualitative-controls另须qualitativeControls:[{category:"conditional-duty|project-adoption",objectName,attribute,condition,value,instruction,evidence:[{sourceId,quote}]}]。保持源内真实承担主体、触发、例外、适用对象。conditional-duty只能忠实履行源义务,不批准候选目录参数为当前选型。project-adoption须真实当前项目采用关系,参考选项须真实selector桥,未决A不批准采用。真正定量控制仍用engineering-controls。sourceIds为实际证据身份全集,factIds为[]。',"事实查询结果含完整口径状态;ambiguous/unbound/unmeasured/needs-technical-decision不能通过任选一个候选变成已确认施工值。概况范围不得取端点或平均值冒充各部位深度,分层厚度不能当坑深。分页未完成时不能声称已核完整集合。",JSON.stringify({task:l,criteria:C,facts:F,factQueries:E,question:d,sourceFiles:[...new Set([...F.map(a=>a.sourceFile),...m.flatMap(a=>a.sources.map(a=>a.filePath)),...Object.keys(a.project.sources).filter(a=>/\.(?:dwg|dxf)$/iu.test(a))])]})].join("\n"),H=`chief:${r.slice(0,28)}`,M=async(b,d,f)=>{if(!b||!["use-facts","use-sources","engineering-controls","qualitative-controls","guidance","request-human"].includes(b.action??"")||"string"!=typeof b.answer||!b.answer.trim()||b.answer.length>3e3||"string"!=typeof b.reason||!b.reason.trim()||!Array.isArray(b.factIds)||new Set(b.factIds).size!==b.factIds.length||b.factIds.some(a=>!F.some(b=>b.factId===a))||"use-facts"===b.action&&!b.factIds.length||"guidance"===b.action&&((0,q.ei)(b.answer).length||b.factIds.length))throw Error("主智能体裁决越过事实或职责边界,未执行");let g=b.sourceIds??[];if("request-human"===b.action&&function(a){let b=new Map,c=new Map;for(let d of a){if(d.error)return!0;if("cad"===d.kind){if(!d.result)return!0;let a=d.query,b=d.result;if(!Array.isArray(b.records)||!Number.isSafeInteger(b.offset)||b.offset<0||"string"!=typeof b.parsedIdentity||"string"!=typeof b.projectSnapshotId)return!0;let e=JSON.stringify([a.filePath,a.kind??"frames",a.rootInstanceId??null,a.frameId??null,a.entityId??null,a.query??"",a.placement??"all",a.textOnly??!1,a.order??"source",a.detail??"full"]),f=c.get(e)??[];f.push({query:a,page:b}),c.set(e,f);continue}if("work-package"===d.kind&&d.result){let a=d.result;if(!0!==a.complete||a.items.length!==a.total)return!0;continue}if("source"!==d.kind||!d.result)continue;let a=d.query,e=JSON.stringify([a.filePath??null,a.query]),f=b.get(e)??[];f.push(d.result),b.set(e,f)}for(let b of c.values()){if(b.some(({page:a})=>a.parsedIdentity!==b[0].page.parsedIdentity||a.projectSnapshotId!==b[0].page.projectSnapshotId))return!0;let c=b.find(({page:a})=>null===a.nextOffset&&null!==a.total);if(["instances","frames"].includes(b[0].query.kind??"frames")&&!b[0].query.entityId&&!b[0].query.query&&b.some(({query:b,page:c})=>a.some(a=>{if("cad"!==a.kind||!a.result)return!1;let d=a.query;return d.filePath===b.filePath&&["annotations","geometry"].includes(d.kind??"")&&c.records.some(a=>void 0!==d.rootInstanceId&&a.payload.rootInstanceId===d.rootInstanceId||void 0!==d.frameId&&a.payload.id===d.frameId)})))continue;if(!c||null===c.page.total)return!0;let d=c.page.total,e=new Set;for(let{page:a}of b)for(let b=0;b<a.records.length;b+=1)e.add(a.offset+b);if(e.size!==d||[...e].some(a=>a>=d)||d>0&&!e.has(0))return!0}for(let a of b.values()){let b=a[0]?.matchedCount??0,c=new Set;for(let b of a)for(let a=0;a<b.sources.length;a+=1)c.add(b.offset+a);if(c.size!==b)return!0}return!1}(f))throw Error("相关冻结原文尚未完整定位,不能把未完成查询当作需要用户提供资料");if(!Array.isArray(g)||new Set(g).size!==g.length||g.some(a=>!d.some(b=>b.sourceId===a))||["use-sources","engineering-controls","qualitative-controls"].includes(b.action??"")&&!g.length||!["use-sources","engineering-controls","qualitative-controls","guidance"].includes(b.action??"")&&g.length)throw Error("主智能体原文选择没有冻结来源支持");if(["engineering-controls","qualitative-controls"].includes(b.action??"")&&!a.sharedPlan)throw Error("工程控制缺少本轮同版共享计划,不能声明新来源已经可以写入");let h="qualitative-controls"===b.action?await (0,L.lj)(b.qualitativeControls,{project:a.project,sources:d,task:l,criteria:C,taskId:c,planId:a.sharedPlan.id,decisionId:H,diagnostics:a.diagnostics,signal:a.signal,reviewer:a.engineeringReviewer}):void 0;if(h){let a=new Set(h.controls.flatMap(a=>a.evidence.map(a=>a.sourceId)));if(b.factIds.length||a.size!==g.length||g.some(b=>!a.has(b)))throw Error("定性决定来源清单与实际证据不一致");v=h.sourceApplicationReceipt,u=h.review}else if(void 0!==b.qualitativeControls)throw Error("非定性决定不能附加未核定采用许可");let i="engineering-controls"===b.action?await w(b.controls,{project:a.project,sources:d,task:l,taskId:c,planId:a.sharedPlan.id,decisionId:H,criteria:C,facts:F,diagnostics:a.diagnostics,signal:a.signal,reviewer:a.engineeringReviewer,cadReadings:f.filter(a=>"cad"===a.kind)}):void 0;if(i){let a=new Set(i.controls.flatMap(a=>a.evidence.map(a=>a.sourceId))),c=new Set(i.controls.flatMap(a=>a.derivation?.inputFactIds??[]));if(g.length!==a.size||g.some(b=>!a.has(b))||b.factIds.length!==c.size||b.factIds.some(a=>!c.has(a)))throw Error("工程裁决来源清单与实际控制项不一致");u=i.review}else if(void 0!==b.controls)throw Error("非工程裁决不能附加未经复核的控制项");let j=i?.controls.map(b=>{let{objectName:c,attribute:d,condition:f,value:g,instruction:h}=b,i=b.derivation,j=i?.inputFactIds.length===1&&"$0"===i.formula.replace(/\s/gu,"")?a.project.facts.find(a=>(0,e.vg)(a)===i.inputFactIds[0]&&a.objectName===c&&[a.fieldId,a.fieldName,a.key,(0,e.nD)(a)?.key,(0,e.nD)(a)?.label,...(0,e.nD)(a)?.aliases??[]].some(a=>a&&(0,p.K3)(a)===(0,p.K3)(d))&&(0,p.K3)(a.value)===(0,p.K3)(g)):void 0,l=j&&(0,k.mk)(a.project,(0,e.vg)(j)).factIndex;return{objectName:c,attribute:d,condition:f,value:g,instruction:h,authorReferences:"number"==typeof l?{factIndices:[l]}:i?{derivedNumbers:[{formula:i.formula,inputFactIndices:i.inputFactIds.map(b=>(0,k.mk)(a.project,b).factIndex),basis:i.basis}]}:{sourceIndices:[...new Set(b.evidence.map(a=>a.sourceIndex))]}}}),m=h?.controls.map(({evidence:b,...c})=>{let d=b.map(b=>(0,k.mk)(a.project,void 0,b.sourceId).sourceIndex);if(d.some(a=>"number"!=typeof a))throw Error("定性决定来源没有本轮完整原文序号");return{...c,authorReferences:{sourceIndices:[...new Set(d)]}}}),n=i?`以下控制已独立复核,只用于指定对象及工况。按authorReferences在实际正文片段登记对应类型:factIndices引用既定事实,derivedNumbers登记算式,sourceIndices仅用于原文直接控制。证明中的范围句不支持派生或既定单值,不能给它们另挂原文索引;不把裁决身份当作新事实来源:${JSON.stringify(j)}`:h?`以下具体定性决定已经独立核定,严格保持各自category与适用对象条件;source-obligation-only不授当前选型或施工量。实际正文仍登记sourceIndices并逐次终评,不把许可当事实:${JSON.stringify(h.controls.map(b=>({...b,evidence:b.evidence.map(b=>({...b,...(0,k.mk)(a.project,void 0,b.sourceId)}))})))}`:"use-sources"===b.action?`以下是完整冻结原文,保留条件与来源,须判断适用性后编写;不自动转为已确认的项目单值:${JSON.stringify(d.filter(a=>g.includes(a.sourceId)))}`:"use-facts"===b.action?`采用冻结模型中的下列事实及其适用对象,不扩大其范围:${JSON.stringify(F.filter(a=>b.factIds.includes(a.factId)))}`:b.answer;return i&&(v=i.sourceApplicationReceipt),{decisionId:H,taskId:c,action:b.action,answer:n,factIds:b.factIds,...g.length?{sourceIds:g}:{},...i?{controls:i.controls,writingControls:j}:{},...h?{qualitativeControls:h.controls,writingQualitativeControls:m}:{},reason:b.reason,source:"model"}};try{let b=(a,b,c)=>{x=a,y=b,z=c,s=b.at(-1)},c=a.reviewer?await A({project:a.project,prompt:G,initialSourceQueries:d.sourceQueries??[],readCad:a.readCad,onProgress:b,ask:a.reviewer}):await I({project:a.project,prompt:G,initialSourceQueries:d.sourceQueries??[],readCad:a.readCad,readWorkPackages:b=>(0,o.HV)(a.project,b),onProgress:b,diagnostics:a.diagnostics,signal:a.signal,validateSubmission:async(a,b,c)=>{B=await M(a,b,c)}});if(s=c.raw,x=c.reads,y=c.attempts,t=B??await M(s,c.sources,c.reads),a.signal?.throwIfAborted(),["engineering-controls","qualitative-controls"].includes(t.action)){if(!v)throw Error("本次工程控制没有同版来源用途证明,未执行");(0,K.WI)(a.project,v)}}catch(b){if(a.signal?.aborted)throw b;t={decisionId:H,taskId:c,action:"unmeasured",answer:"本次主控裁决未通过,未核定新的事实或技术决定;不能据此认定需要用户确认。实质技术问题须具体说明对象和工况后重新查询;已完成的正文交submit_author_task,不能以本回执代替内容验收。",factIds:[],reason:b instanceof Error?b.message:String(b),source:"model-rejected"}}return a.onReceipt({decision:t,question:d,inputHash:N(G),raw:s??null,...x?{reads:x,attempts:y,readingProtocolErrors:z}:{},...void 0===u?{}:{engineeringReview:u},...["engineering-controls","qualitative-controls"].includes(t.action)&&v?{sourceApplicationReceipt:v}:{}}),b=a.diagnostics,n={at:c,decisionId:H,action:t.action,reason:t.reason,readings:d.question,source:t.source,execution:"model-rejected"===t.source?"unlanded":"performed",executionNote:"model-rejected"===t.source?"模型裁决未通过,未执行新的技术决定,不登记为人工资料缺口":"通过工具回执返回当前作者;正文是否采用由候选与合同评价核对"},b&&(b.supervisorDecisionLog??=[]).push(n),t})();return b.set(r,t),t}})}},31859:(a,b,c)=>{c.d(b,{IS:()=>i});var d=c(96770);c(29021),c(33873);var e=c(19668),f=c(43967);let g=globalThis,h=g.__customizeConfigStores??=new Map;function i(){(0,f.jF)();let a=(0,e.J0)();return h.has(a)||h.set(a,new d.ConfigStore(a)),h.get(a)}},33972:(a,b,c)=>{function d(a,b){return a.criteria.filter(a=>a.sectionId===b&&a.applicable)}function e(a,b){if(!Array.isArray(b)||b.some(b=>!Number.isSafeInteger(b)||b<0||b>=a.length)||new Set(b).size!==b.length)throw Error("职责序号必须唯一且属于当前委派任务");return b.map(b=>a[b])}c.d(b,{C:()=>d,resolveAuthorCriterionIndices:()=>e})},34027:(a,b,c)=>{c.d(b,{RT:()=>g,Ri:()=>f,zV:()=>h});var d=c(77598),e=c(73123);function f(a,b){return(0,e.gM)(a),Object.fromEntries(Object.entries(b).map(([b,c])=>{let e=a.sources[b],f=a.documents.find(a=>a.sourceFile===b);if(!e||!f||e.sourceSha256!==c.sourceSha256||e.parsedSha256!==c.parsedSha256)throw Error(`一致性来源上下文与冻结解析/源身份不一致:${b}`);let g=a.decisions.filter(a=>a.currentSourceFiles.includes(b)||a.candidateSourceFiles.includes(b)||f.domainDependencies.some(b=>b.family===a.family&&b.domain===a.domain)),h=a.declarations.filter(a=>a.sources.some(a=>a.sourceFile===b)||g.some(b=>b.declarationIds.includes(a.id))),i={version:"tender-source-context-v3",policyVersion:a.version,policyId:a.policyId,assetFingerprint:a.assetFingerprint,sourceIdentity:structuredClone(e),document:structuredClone(f),declarations:structuredClone(h),decisions:structuredClone(g),applicability:g.map(a=>({family:a.family,domain:a.domain,status:a.status,current:a.currentSourceFiles.includes(b),candidate:a.candidateSourceFiles.includes(b)}))};return[b,{...i,contextFingerprint:(0,d.createHash)("sha256").update(JSON.stringify(i)).digest("hex")}]}))}function g(a){let{contextFingerprint:b,...c}=a;if("tender-source-context-v3"!==c.version||c.policyVersion!==e.xg||b!==(0,d.createHash)("sha256").update(JSON.stringify(c)).digest("hex")||![c.policyId,c.assetFingerprint,c.sourceIdentity?.sourceSha256,c.sourceIdentity?.parsedSha256].every(a=>/^[a-f0-9]{64}$/u.test(a))||!c.document?.sourceFile?.trim()||!Array.isArray(c.document.editionScopes)||!Array.isArray(c.document.scopeEvidenceChunks)||c.document.families.some(a=>!c.document.editionScopes.some(b=>b.family===a))||c.document.scopeEvidenceChunks.some(a=>a.sha256!==(0,d.createHash)("sha256").update(a.text).digest("hex")))throw Error("职责来源适用资格缺少当前冻结源/解析/版本上下文身份或发行作用范围,或被改写")}function h(a){g(a);let b=a.document;return{document:{sourceFile:b.sourceFile,title:b.title,isClarification:b.isClarification,projectIdentifier:b.projectIdentifier,issuedAt:b.issuedAt,families:b.families,editionScopes:b.editionScopes.map(a=>({family:a.family,mode:a.mode,heading:a.heading})),domainDependencies:b.domainDependencies.map(a=>({family:a.family,domain:a.domain,quote:a.quote,authoritySources:a.authoritySources.map(a=>({sourceFile:a.sourceFile,quote:a.quote}))}))},declarations:a.declarations.map(a=>({id:a.id,family:a.family,domains:a.domains,quote:a.quote,issuedAt:a.issuedAt,projectIdentifier:a.projectIdentifier,title:a.title,sources:a.sources.map(a=>({sourceFile:a.sourceFile}))})),applicability:a.applicability,decisions:a.decisions.map(a=>({id:a.id,declarationId:a.declarationId,declarationIds:a.declarationIds,family:a.family,domain:a.domain,status:a.status,reason:a.reason,current:a.currentSourceFiles.includes(b.sourceFile),candidate:a.candidateSourceFiles.includes(b.sourceFile)}))}}},35821:(a,b,c)=>{c.d(b,{Eh:()=>f,Mv:()=>o,VN:()=>h,Iu:()=>i});var d=c(19898),e=c(73055);let f=.6,g=null;function h(){return g||(g=new d.LocalTransformersEmbeddingProvider({})),g}async function i(){if("1"!==process.env.DOCUMENT_SKIP_EMBED_PREFLIGHT)try{await h().embedQuery("生成前置检查")}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`本地语义模型预热失败(生成前置检查,可用 DOCUMENT_SKIP_EMBED_PREFLIGHT=1 跳过):${a}`,{cause:b})}}let j=new Map,k=0,l=0;async function m(a,b){let c=b?await b(a):await h().embedDocuments(a);if(c.length!==a.length)throw Error(`本地语义模型嵌入数量不一致:期望 ${a.length} 条,实际 ${c.length} 条`);return c}async function n(a,b){if("0"===process.env.DOCUMENT_EMBED_CACHE)return m(a,b);let c=Array(a.length),d=[],e=new Map;for(let b=0;b<a.length;b+=1){let f=a[b];if(f.length<=2e3){let a=j.get(f);if(a){c[b]=a,k+=1,j.delete(f),j.set(f,a);continue}}let g=e.get(f);g?g.push(b):(e.set(f,[b]),d.push(f))}if(0===d.length)return c;let f=await m(d,b),g=function(){let a=Number(process.env.DOCUMENT_EMBED_CACHE_SIZE||4e4);return Number.isFinite(a)&&a>0?a:4e4}();for(let a=0;a<d.length;a+=1){let b=d[a],h=f[a],i=e.get(b);for(let a of i)c[a]=h;if(b.length<=2e3&&(l+=i.length,j.set(b,h),j.size>g)){let a=j.keys().next().value;void 0!==a&&j.delete(a)}}return c}async function o(a,b,c){if(0===a.length||0===b.length)return()=>0;let d=[...a,...b],f=await n(d,c),g=new Map;for(let a=0;a<d.length;a++)g.has(d[a])||g.set(d[a],f[a]);return(a,b)=>{let c=g.get(a),d=g.get(b);return c&&d?(0,e.Om)(c,d):0}}},36372:(a,b,c)=>{c.d(b,{M8:()=>l,a0:()=>k,hM:()=>j});var d=c(35821),e=c(86697);let f=["对与评标活动有关的工作人员的纪律要求","评标委员会成员与投标人接触的限制","评标纪律与廉洁从业承诺要求","评审争议处理与投标澄清配合程序","评审结果确认与中标公示流程","评标办法与分值构成说明","异常低价评审与计算方式说明","清单计量与报价口径约定","投标文件实质性响应要求","投标保证金缴纳与退还程序","开标程序与投标文件递交截止时间","评标期间行为管控与资料闭环","预付款与进度款支付比例约定","履约担保与保证金缴纳退还约定","价格波动与合同价款调整约定","暂列金额与暂估价使用约定","税费计取与发票结算约定","违约责任与罚款赔偿条款"],g=["劳动力配置计划与高峰期人数安排","施工质量保证措施与验收标准","安全生产管理与教育培训要求","施工进度计划与关键线路安排","材料设备采购进场计划与检验要求","施工现场文明施工与环境保护管理","劳动纪律与班组作业管理制度","施工机械设备配置与维护保养计划","农民工工资支付保障与劳务实名制管理","材料采购质量证明与进场验收管理","工期承诺与进度考核奖惩管理"],h=/评标|投标|行贿|打招呼|递条子|廉洁|串标|围标|弄虚作假|干扰评标|纪律|澄清|中标|报价|清单计量|评审|保证金|开标|递交|争议|异常低价|评标基准价|预付款|进度款|担保|价格波动|材料调差|暂列金额|暂估价|计税|税金|发票|违约|业绩证明|类似(?:工程)?业绩|获奖|荣获|协会颁发|营业执照|资质证书|安全生产许可证|认证证书|管理体系认证|审计报告|信用等级|信用评价|社保证明|无行贿犯罪|中标查询|中标公示|中标结果|电子交易系统|公共资源交易|质疑投诉|评标委员会/u;function i(a){let b=a.sectionTitle?.trim()||"",c=(a.content||"").replace(/\s+/gu," ").slice(0,400);return b?`${b}。${c}`:c}function j(a){let b=a.sectionTitle?.trim()||a.content.replace(/\s+/gu,"").slice(0,60);return`${a.filePath}::${b}`}async function k(a,b){if(0===a.length)return{safe:[],excluded:[]};let c=a.filter(a=>h.test(i(a)));if(0===c.length)return{safe:[...a],excluded:[]};let e=c.map(i),j=await (0,d.Mv)(e,[...f],b),k=await (0,d.Mv)(e,[...g],b),l=new Set;for(let a of c){let b=i(a),c=Math.max(...f.map(a=>j(b,a))),d=Math.max(...g.map(a=>k(b,a)));c>=.6&&c>d&&l.add(a)}return{safe:a.filter(a=>!l.has(a)),excluded:[...l]}}async function l(a){return(0,e.A)({prototypes:[...f],negativePrototypes:[...g],threshold:.6,embedDocuments:a})}},36594:(a,b,c)=>{c.d(b,{LA:()=>k,Yn:()=>i,ZB:()=>j,eW:()=>l});var d=c(77598),e=c(97979),f=c(83653),g=c(57268);let h=a=>(0,d.createHash)("sha256").update(a).digest("hex");function i(a,b){let c=new Map;for(let b of a){let a=[...b.content.matchAll(/(?:发布日期|发布于|出具日期|印发日期)\s*[::]?\s*(20\d{2})\s*年\s*(\d{1,2})\s*月\s*(\d{1,2})\s*日/gu)].map(a=>`${a[1]}-${a[2].padStart(2,"0")}-${a[3].padStart(2,"0")}`);a.length&&c.set(b.filePath,[...c.get(b.filePath)??[],...a])}let g=a.flatMap(a=>{if(!["tender_document","addendum","tender","clarification","tender_text"].includes(a.roleId??""))return[];let d=b.sources[a.filePath];if(!d||void 0===a.chunkIndex)return[];let f=b.documents.find(b=>b.sourceFile===a.filePath),g=c.get(a.filePath)??[];return(0,e.Su)([{text:a.content,source:`${a.filePath} ${a.sectionTitle??""}`}]).filter(a=>a.openingDate&&"reference"!==a.openingDate.role).map(b=>({candidate:b,item:a,source:d,projectIdentifier:f?.projectIdentifier??null,issuedAt:1===new Set(g).size?g[0]:null,isClarification:f?.isClarification??!1}))}),i=new Map;for(let a of g){let b=a.candidate.openingDate,c=JSON.stringify([a.projectIdentifier,b.objectName,b.kind]),d=i.get(c)??[];d.push(a),i.set(c,d)}return[...i.values()].flatMap(a=>{let b,c=a.filter(a=>"current"===a.candidate.openingDate.role);if(!c.length)return[];let e=c.filter(a=>a.candidate.clarified),g=e.length&&c.every(a=>a.candidate.clarified||!a.isClarification)?e:c;if(new Set(g.map(a=>a.candidate.value)).size>1&&g.every(a=>a.issuedAt)){let a=[...g.map(a=>a.issuedAt)].sort().at(-1);g=g.filter(b=>b.issuedAt===a)}let i=(0,f.iC)({facts:[],overrides:[],labeledValues:g.map(a=>a.candidate)}).resolved.find(a=>"开工日期"===a.attribute);if(!i)return[];let j=g.find(a=>a.candidate.value===i.value&&i.evidence.some(b=>b.source===a.candidate.source));if(!j)return[];let k=j.candidate.openingDate,l=new Set(g.map(a=>a.candidate.value)).size>1||new Set(g.map(a=>(a.candidate.openingDate.condition??"").replace(/\s+/gu,""))).size>1,m=k.kind,n="planned"===m?"planned_start_date":"actual"===m?"actual_start_date":"construction_start_date",o="planned"===m?"计划开工日期":"actual"===m?"实际开工日期":"开工日期",p=[...new Set(l?a.filter(a=>"superseded"===a.candidate.openingDate.role).map(a=>a.candidate.value):[...i.superseded,...a.filter(a=>!g.includes(a)).map(a=>a.candidate.value)])].filter(a=>a!==i.value),q=a.map(a=>({value:a.candidate.value,sourceFile:a.item.filePath,chunkIndex:a.item.chunkIndex,quote:a.candidate.openingDate.quote}));return[{factId:`temporal:${(b=[n,k.objectName,j.item.filePath,j.item.chunkIndex,k.quote,i.value],(0,d.createHash)("sha256").update(JSON.stringify(b)).digest("hex")).slice(0,24)}`,fieldId:n,key:o,fieldName:o,objectName:k.objectName,value:i.value,confidence:l?.5:.95,sourceFile:j.item.filePath,roleId:j.item.roleId,processingType:j.item.processingType,sourceRef:{filePath:j.item.filePath,roleId:j.item.roleId,processingType:j.item.processingType,chunkIndex:j.item.chunkIndex,sectionTitle:j.item.sectionTitle,sourceSpan:k.quote,contextSpan:j.item.content},temporalConstraint:{event:"construction-start",kind:m,status:l?"unmeasured":"resolved",date:i.value,...k.condition?{condition:k.condition}:{},superseded:p,sourceSha256:j.source.sourceSha256,parsedSha256:j.source.parsedSha256,chunkSha256:h(j.item.content),quoteSha256:h(k.quote),history:q}}]})}function j(a,b){let c=b.filter(a=>a.temporalConstraint?.event==="construction-start"&&"planned"===a.temporalConstraint.kind&&"resolved"===a.temporalConstraint.status&&"项目主体"===a.objectName),d=1===new Set(c.map(a=>a.value)).size?c.slice(0,1):[];return{...a,facts:[...a.facts.filter(a=>"开工日期"!==(0,f.hf)(String(a.key??""),a.label)),...d.flatMap(a=>a.temporalConstraint.history.filter(b=>a.temporalConstraint.superseded.includes(b.value)).map(a=>({key:"开工日期",value:a.value,sourceFile:a.sourceFile})))],overrides:(a.overrides??[]).filter(a=>"date"!==(0,e.dm)(a.superseded)&&"date"!==(0,e.dm)(a.effective)),labeledValues:[...(a.labeledValues??[]).filter(a=>"开工日期"!==a.attribute),...d.map(a=>({attribute:"开工日期",value:a.value,source:`${a.sourceFile} ${a.sourceRef?.sectionTitle??""}`,clarified:!0,supersedesPriorMaterials:!1}))]}}function k(a){return a.filter(a=>a.temporalConstraint).map(a=>{let b=a.temporalConstraint,c="unmeasured"===b.status?"同一事件日期尚有未决值,须依据完整原文核定,不能任选一个日期或宣称已确定":`${a.fieldName}为${b.date};${"planned"===b.kind?"仅作进度计划起点,不得写成已确定的实际开工日":"保持该事件的原文性质"}`;return(0,g.v7)(`进度安排必须承接${a.objectName}的开工事件:${c}${b.condition?`;触发条件完整保留:${b.condition.replace(/\s+/gu,"")}`:""};仅采用现行事件口径,不新增工期或把通知条件删成固定日历承诺。`,JSON.stringify({type:"source-bound-temporal-fact",factId:a.factId,sourceFile:a.sourceFile,sourceRef:a.sourceRef,temporalConstraint:b}))})}function l(a,b){let c=(0,e.Su)([{text:a.text,source:"reviewed-duty"}]).filter(a=>a.openingDate).flatMap(c=>b.filter(b=>{let d=b.temporalConstraint,e=c.openingDate;return d?.status==="resolved"&&d.superseded.includes(c.value)&&b.objectName===e.objectName&&("unspecified"===e.kind||e.kind===d.kind)&&d.history.some(b=>b.value===c.value&&a.sources.some(a=>a.file===b.sourceFile))}).map(a=>({label:c,fact:a}))),d=new Map;for(let a of c){let b=a.label.openingDate,c=`${b.dateStartChar}:${b.dateEndChar}`,e=d.get(c)??[];e.push(a),d.set(c,e)}let f=a.text,g=[];for(let a of[...d.values()].sort((a,b)=>b[0].label.openingDate.dateStartChar-a[0].label.openingDate.dateStartChar)){if(1!==new Set(a.map(a=>a.fact.value)).size)continue;let{label:b,fact:c}=a[0],d=b.openingDate;f=f.slice(0,d.dateStartChar)+c.value+f.slice(d.dateEndChar),g.push(c)}let h=[...new Map(g.map(a=>[a.factId,a])).values()];return h.length&&(f+=`;该日期控制已经由当前完整来源更正,${h.map(a=>`${a.fieldName}仅采用${a.value}${"planned"===a.temporalConstraint.kind?"作为计划基准,不能转成实际固定开工日":""}${a.temporalConstraint.condition?`,保留${a.temporalConstraint.condition.replace(/\s+/gu,"")}`:""}`).join(";")}`),{text:f,factIds:h.map(a=>a.factId),sources:h.map(a=>({factId:a.factId,sourceFile:a.sourceFile,sourceRef:a.sourceRef,temporalConstraint:a.temporalConstraint}))}}},41240:(a,b,c)=>{c.d(b,{E6:()=>f,Zw:()=>e});var d=c(76875);let e=["task","organization","labor","equipment","materials","schedule","deployment"];function f(a,b,c,g={}){let h=b.find(a=>a.id===c),i=a.tasks.find(a=>a.taskId===c);if(!h||!i)throw Error("共享工程计划查询不属于当前实际任务");let j=g.view??(/工资|实名|检验|储存|保管|安全管理|应急保障|管理制度/u.test(h.title)?"organization":/工期|进度|网络计划/u.test(h.title)?"schedule":/劳动力|工种|班组配置/u.test(h.title)?"labor":/机械|机具|设备配置/u.test(h.title)?"equipment":/材料|物资/u.test(h.title)?"materials":/部署|总体安排|组织安排/u.test(h.title)?"deployment":h.contentTypes.includes("schedule")?"schedule":"task");if(!e.includes(j))throw Error("共享工程计划查询视图无效");if(g.activityIds&&(!Array.isArray(g.activityIds)||!g.activityIds.length||g.activityIds.some(b=>!a.production.activities.some(a=>a.input.id===b))))throw Error("须使用共享计划目录中的真实活动身份");let k=a.production.activities.filter(b=>g.activityIds?g.activityIds.includes(b.input.id):"task"!==j||b.input.taskIndices.some(b=>a.tasks[b]?.taskId===c)),l=new Set(k.map(a=>a.input.id)),m=a.production.plannedResources.filter(a=>l.has(a.activityId)),n=[],o=new Map,p=(0,d.wp)(a.production,b.map(a=>a.id)).filter(a=>(!a.activityId||l.has(a.activityId))&&("task"===j||"organization"===j||"materials"===j?"task"===j:"window"===a.purpose||"organization"===a.purpose||a.purpose===j||"deployment"===j&&!a.activityId)).map(({taskIds:a,inputMemberIds:b,objectScope:c,basis:d,...e})=>{let f=o.get(d);return f||(f=`basis-${n.length}`,o.set(d,f),n.push({id:f,text:d})),{...e,basisId:f,...!e.activityId?{objectScope:c}:{}}}),q=k.map(a=>{if("task"===j)return a;let{input:b,status:c,startDay:d,endDay:e,startDate:f,endDate:g,durationDays:h,timeWindow:i,workTimeWindow:k,critical:l,floatDays:m}=a,n={id:b.id,phaseId:b.phaseId,objectScope:b.objectScope,workfront:b.workfront,status:c};return"organization"===j||"materials"===j?n:{...n,predecessors:b.predecessors,startDay:d,endDay:e,startDate:f,endDate:g,durationDays:h,timeWindow:i,workTimeWindow:k,critical:l,floatDays:m}}),r=m.map(a=>{let{activityId:b,phaseId:c,objectScope:d,workfront:e,basis:f}=a,g={activityId:b,phaseId:c,objectScope:d,workfront:e,basis:f};return"task"===j?a:"organization"===j||"materials"===j?{...g,trades:a.workers.map(a=>a.trade),equipment:a.equipment.map(({name:a,spec:b})=>({name:a,spec:b}))}:"labor"===j?{...g,crewId:a.crewId,crews:a.crews,shiftsPerDay:a.shiftsPerDay,workers:a.workers,countMeaning:"每日配置含不同轮班人员,非同时在岗峰值"}:"equipment"===j?{...g,crewId:a.crewId,crews:a.crews,equipment:a.equipment}:{...g,crewId:a.crewId,crews:a.crews,shiftsPerDay:a.shiftsPerDay,trades:a.workers.map(a=>a.trade),equipment:a.equipment.map(({name:a,spec:b})=>({name:a,spec:b}))}});return{id:a.id,contractId:a.contractId,projectSnapshotId:a.projectSnapshotId,phases:a.phases,activityDirectory:a.production.activities.map(({input:a})=>({id:a.id,phaseId:a.phaseId,objectScope:a.objectScope,workfront:a.workfront})),view:j,activities:q,plannedResources:r,numbers:p,bases:n,numberMeaning:"index指向同源完整数记录;活动对象见activityId对应活动,basisId见bases原文。对象与依据只存一份,不裁字;组织管理视图不要求数量。",..."schedule"===j||"deployment"===j||"task"===j?{calendar:a.production.calendar}:{},..."labor"===j?{labor:a.production.labor}:{},..."equipment"===j?{equipment:a.production.equipment}:{},..."materials"===j?{materials:a.production.materials.filter(a=>l.has(a.activityId)),materialStatus:"逐源用途记录,不等于已采用采购总量"}:{},issues:a.production.issues.filter(a=>!a.activityId||l.has(a.activityId)),scope:{taskId:c,activityIds:[...l],completeSelectedView:!0},task:i,interfaces:a.tasks.filter(a=>a.taskId!==c&&a.phaseIds.some(a=>i.phaseIds.includes(a))).map(({taskId:a,objectScope:b,boundary:c,handoffs:d})=>({taskId:a,objectScope:b,boundary:c,handoffs:d}))}}},42948:(a,b,c)=>{c.d(b,{Fr:()=>k,HM:()=>l,Hf:()=>n,tv:()=>m,wE:()=>o,yW:()=>p});var d=c(73024),e=c.n(d),f=c(76760),g=c.n(f),h=c(77598);let i=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u,j=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u;function k(a,b){return b?`run:${b}:${a}`:a}function l(a,b,c){if(!j.test(b))throw Error("非法运行资产文件名");if(void 0!==c&&!i.test(c))throw Error("非法运行 ID");return c?g().join(a,"runs",c,"artifacts",b):g().join(a,"assets",b)}function m(a,b,c,d){let f=l(a,b,d),i=JSON.stringify(c);if(void 0===i)throw Error("运行资产不能是 undefined");e().mkdirSync(g().dirname(f),{recursive:!0});let j=`${f}.${(0,h.randomUUID)()}.tmp`;e().writeFileSync(j,i,{encoding:"utf8",flag:"wx"});try{if(d)try{e().linkSync(j,f)}catch(a){if("EEXIST"!==a.code)throw a;if(e().readFileSync(f,"utf8")!==i)throw Error(`运行资产已存在且内容不同:${d}/${b}`,{cause:a})}else e().renameSync(j,f)}finally{e().rmSync(j,{force:!0})}return{assetPath:f,bytes:Buffer.byteLength(i),sha256:(0,h.createHash)("sha256").update(i).digest("hex")}}function n(a){if(!a.runId)throw Error("实时模型进度必须绑定当前运行 ID");let b=l(a.generatedDir,"llm-live-progress.json",a.runId),c=JSON.stringify({...a.snapshot,version:1,runId:a.runId,documentId:a.documentId});e().mkdirSync(g().dirname(b),{recursive:!0});let d=`${b}.${(0,h.randomUUID)()}.tmp`;e().writeFileSync(d,c,{encoding:"utf8",flag:"wx"});try{e().renameSync(d,b)}finally{e().rmSync(d,{force:!0})}}function o(a,b){return b?[["run-start","run-start.json","本轮启动身份"],["run-inputs","run-inputs.json","本轮已准备输入快照"],["project-model","project-model.json","本轮写作与终检共用的项目事实快照"],["tender-requirements","tender-requirements.json","本轮原始招标条款、技术职责拆分、商务归宿及未裁决台账"],["document-contract","document-contract.json","本轮写作前冻结的职责、义务与七维评价合同"],["contract-ownership-plan","contract-ownership-plan.json","主控逐项确认事实、表格与交付义务的唯一主要责任小节"],["content-type-plan","content-type-plan.json","本轮主控对各节具体内容职责与适用类型的确认回执"],["contract-quality","contract-quality.json","本轮固定合同、项目快照和正文版本的七维评价回执"],["writing-task-hierarchy","writing-task-hierarchy.json","锁定交付小节与专业作者子任务之间的固定层级"],["chapter-writing-structures","chapter-writing-structures.json","本轮作者任务开始前的固定结构和内容职责"],["author-task-executions","author-task-executions.json","实际作者实例、委派任务、完整输入身份、执行终态与共用章节预算"],["author-accounting-final","author-accounting-final.json","同一合同跨续跑累计的调用、token、成本与章节预算消耗"],["author-candidates","author-candidates.json","本轮工具执行、自检、清理及重试前的原始模型返回索引"],["document-token-anomaly","document-token-anomaly.json","本轮无有效进展的重复模型消费与整份暂停回执;缺usage和供应商结算保持未知"],["document-model-final","document-model-final.json","本轮统一文档模型的最终版本与全部累计修改记录"],["contract-quality-c0","contract-quality-c0.json","固定首稿的完整七维评价,后续修改不能覆盖"],["contract-light-repair","contract-light-repair.json","统一预算内轻修的预检、提交结果与首稿通过读数"],["document-model-author","document-model-author.json","本轮固定任务的结构化作者模型、初始候选与累计修改账"],["blueprint","blueprint.json","本轮写作蓝图"],["requirement-assignments","requirement-assignments.json","本轮要求责任分配"],["structure-assignments","structure-assignments.json","本轮呈现要求分配"],["before-global-review","before-global-review.json","全文审查前章节快照(含章内重试,不等于原始首稿)"],["before-finalize","before-finalize.json","收口前章节快照"],["final-document","final-document.json","本轮最终内容快照"],["run-summary","run-summary.json","本轮阶段墙钟、调用用途与历史评分读数"]].flatMap(([c,d,f])=>{let g=l(a,d,b);if(!e().existsSync(g))return[];let i=(0,h.createHash)("sha256").update(e().readFileSync(g)).digest("hex");return[{id:k(c,b),artifactKind:c,type:"file",role:"attachment",path:g,sha256:i,runId:b,status:"generated",message:f}]}):[]}function p(a){if(!a.runId)return;let b=a.chapters.map(a=>({id:a.id,title:a.title,content:a.content,contentHash:(0,h.createHash)("sha256").update(a.content).digest("hex")}));m(a.generatedDir,`${a.stage}.json`,{version:1,runId:a.runId,documentId:a.documentId??null,stage:a.stage,capturedAt:Date.now(),chapters:b,...void 0!==a.markdown?{markdown:a.markdown}:{},rawFirstCandidate:!1},a.runId)}},43255:(a,b,c)=>{c.d(b,{X4:()=>j,Yn:()=>i});var d=c(77598),e=c(16646),f=c(55422);function g(a,b){let c=a.trim();if(/^其他$|^其他工程$/u.test(c)){let a=b.map(a=>a.name);return a.some(a=>/彩绘|护栏|围栏|小品|标识|标牌|墙面|整治/u.test(a))?"环境整治工程":a.some(a=>/绿化|栽植|铺装|种植/u.test(a))?"景观附属工程":a.some(a=>/拆除|清理|清淤|清运/u.test(a))?"清理整治工程":"零星工程"}return/^其他装饰/u.test(c)?"零星装饰工程":/^措施项目$/u.test(c)?b.map(a=>a.name).some(a=>/化粪池|吊装|安装/u.test(a))?"模板、脚手架及化粪池安装工程":"模板与脚手架工程":/墙[、,]?柱面装饰/u.test(c)?b.some(a=>/幕墙|隔断/u.test(a.name))?c:"墙柱面装饰工程":c}function h(a,b,c=!1){let d=new Map;for(let b of a.entries){if(!b.section)continue;let a=c?JSON.stringify([b.sourceFile,b.villageGroup,b.section]):b.section,e=d.get(a)||[];e.push(b),d.set(a,e)}let e=[],f=0;for(let a of d.values()){let c=g(a[0].section,a),d=a.some(a=>"unit-project"===a.sectionKind),h=[];if(d){let b=new Map;for(let d of a){let a=d.subsection||c,e=b.get(a)||[];e.push(d),b.set(a,e)}for(let[a,c]of b)h.push(k(g(a,c),c))}else h.push(k(c,a));f+=1,e.push({id:`${b}.${f}`,title:c,requiredParams:h.flatMap(a=>Object.keys(a.quantities).slice(0,5).map(a=>({path:`data.quantities.${a}`,mode:"must_cite",strict:!0}))),tablePlans:[],workPackages:h})}return e}function i(a){let{chapterTitles:b,boq:c}=a,d=b.map((b,d)=>{var e;let f=String(d+1),g=/主要分部分项|施工方案|施工方法/u.test(b)?h(c,f):[];return{id:f,title:b,isActive:(e=a.docType,!(/专项施工方案|专项方案|危大/u.test(e)&&/总平面|平面布置|施工部署|总体部署/u.test(b))),requiredParams:[],subSections:g}}),e=h(c,"project",!0).flatMap(a=>a.workPackages),f=c.entries.filter(a=>!a.section);return f.length&&e.push(k("未分部清单记录",f)),{chapters:d,projectWorkPackages:e}}function j(a){return(0,d.createHash)("sha256").update(JSON.stringify([a.sourceFile,a.villageGroup,a.section,a.subsection,a.seq,a.code,a.name,a.description,a.unit,a.quantity,a.chunkIndex])).digest("hex")}function k(a,b){let c=[...b].sort((a,b)=>a.seq-b.seq),d={},g=new Map;for(let a of c){if(!a.name)continue;let b=g.get(a.name)??new Map;b.set(a.unit,(b.get(a.unit)??0)+a.quantity),g.set(a.name,b)}for(let[a,b]of g)for(let[c,e]of b)d[b.size>1?`${a}(${c||"未注明单位"})`:a]={value:Math.round(1e3*e)/1e3,unit:c};let h=[...new Set(c.map(a=>a.name).filter(Boolean))],i=(0,f.lh)(c),k=[],l=new Set;for(let a of c){for(let b of(0,f.QU)(a.description)){let a=`${b.key}=${b.value}`;if(!l.has(a)&&(l.add(a),k.push({key:b.key,value:b.value,source:"boq"}),k.length>=24))break}if(k.length>=24)break}let m=[];for(let a of c)for(let b of(0,f.QU)(a.description))/压实|试验|检测|验收|闭水|合格/u.test(`${b.key}${b.value}`)&&m.length<12&&!m.includes(b.value)&&m.push(b.value);let n=(0,e.cn)(c.map(a=>a.name)),o=[];for(let a of(0===m.length&&n.length>0&&m.push(...n[0].acceptance.slice(0,6).map(a=>`${a}(知识卡)`)),n.slice(0,2)))for(let b of a.standards)o.includes(b)||o.push(b);return{name:a,kind:"major",quantities:d,objectNames:h,methods:i,params:k,acceptance:m,standards:o,source:"boq",coveredSeqs:c.map(a=>a.seq),members:c.map(a=>({id:j(a),entry:{...a}}))}}},43967:(a,b,c)=>{c.d(b,{b:()=>g,jF:()=>h});let d=globalThis,e=d.__customizeStorageMaintenance??={active:!1};d.__customizeStorageApiWriters??=new Set;class f extends Error{constructor(){super("系统清空正在执行,暂不接收新的存储访问"),this.name="StorageMaintenanceError"}}function g(){return e.active}function h(){if(e.active)throw new f}},44616:(a,b,c)=>{c.d(b,{bV:()=>f,lu:()=>h,mk:()=>g});var d=c(63327);let e=new WeakMap;function f(a){let b=e.get(a);if(!b){let c=[...a.facts,...a.sourceControls??[]],f=[...new Set(c.filter(a=>"verified-source-excerpt"!==a.roleId).map(d.vg))].sort(),g=[...new Set(c.filter(a=>"verified-source-excerpt"===a.roleId).map(d.vg))].sort();b={facts:f,sources:g,factIndices:new Map(f.map((a,b)=>[a,b])),sourceIndices:new Map(g.map((a,b)=>[a,b]))},e.set(a,b)}return b}function g(a,b,c){let d=f(a);return{...b&&d.factIndices.has(b)?{factIndex:d.factIndices.get(b)}:{},...c&&d.sourceIndices.has(c)?{sourceIndex:d.sourceIndices.get(c)}:{}}}function h(a,b,c){let d="fact"===b?f(a).facts:f(a).sources;if(!Number.isSafeInteger(c)||0>Number(c)||Number(c)>=d.length)throw Error(`${"fact"===b?"属性":"原文"}引用序号不属于当前冻结项目`);return d[Number(c)]}},44736:(a,b,c)=>{c.d(b,{FP:()=>q,H0:()=>k,U2:()=>j,_e:()=>z,eb:()=>A,fN:()=>m,hg:()=>l,oN:()=>r});var d=c(77598),e=c(19898),f=c(70247);let g=a=>(0,d.createHash)("sha256").update(JSON.stringify(a)).digest("hex"),h=a=>{let{rowSha256:b,...c}=a;return b===g(c)},i=a=>a.replace(/\s/gu,"");function j(a){let b=a.trim();if(!b.startsWith("|")||!b.endsWith("|"))return;let c=[],d="",e=!1;for(let a=1;a<b.length-1;a++){let f=b[a];"|"!==f||e?d+=f:(c.push(d.trim()),d=""),e="\\"===f&&!e}return c.push(d.trim()),c.length>=2?c:void 0}function k(a){let b=a[0]?.trim()??"";return/^(?:\d{1,3}(?:[..]\d{1,3}){1,4}|第[零一二三四五六七八九十百千\d]+[条款项])$/u.test(b)?b:void 0}function l(a,b,c){let{sha256:d,...f}=a;if("tender-native-file-proof-v1"!==a.version||a.file!==b||a.sourceChunkCount!==c||a.nativeLayoutVersion!==e.PDF_NATIVE_LAYOUT_VERSION||!/^[a-f0-9]{64}$/u.test(a.sourceSha256)||!/^[a-f0-9]{64}$/u.test(a.metadataSha256)||d!==g(f))throw Error("原生PDF表格文件证据身份不一致");return a.pages.flatMap(c=>{if(c.glyphSha256!==g(c.glyphs))throw Error("原生PDF字形回执不属于实际文件");if("fallback"===c.strategy)return[];if("ruled-cells"!==c.strategy)throw Error("原生PDF页面没有明确layout策略");let d=new Map(c.glyphs.map(a=>[a.id,a])),e=new Map,f=new Map;for(let a of c.cells){if(!Number.isSafeInteger(a.columnIndex)||a.columnIndex<0||!Number.isSafeInteger(a.columnSpan)||a.columnSpan<1||4!==a.bounds.length||!a.bounds.every(Number.isFinite)||a.bounds[0]>=a.bounds[2]||a.bounds[1]>=a.bounds[3])throw Error("原生表格物理合并单元格身份无效");for(let[b,c]of[[a.columnIndex,a.bounds[0]],[a.columnIndex+a.columnSpan,a.bounds[2]]]){let a=f.get(b);if(void 0!==a&&Math.abs(a-c)>1.5)throw Error("原生表格逻辑列与物理边界不一致");f.set(b,c)}let b=`${a.bounds[1]}:${a.bounds[3]}`;e.set(b,[...e.get(b)??[],a])}let h=[...e.values()].sort((a,b)=>b[0].bounds[3]-a[0].bounds[3]),i=Math.max(...c.cells.map(a=>a.columnIndex+a.columnSpan)),j=h.map(a=>{let b=Array(i).fill(""),c=0,e;for(let f of a.sort((a,b)=>a.columnIndex-b.columnIndex)){if(f.columnIndex!==c||void 0!==e&&Math.abs(f.bounds[0]-e)>1.5)throw Error("原生表格列范围重叠或缺失");c+=f.columnSpan,e=f.bounds[2],b[f.columnIndex]=f.glyphIds.map(a=>{let b=d.get(a);if(!b)throw Error("原生表格字形ID缺失");return b}).sort((a,b)=>2>=Math.abs(a.y-b.y)?a.x-b.x:b.y-a.y).map(a=>a.str).join("").replace(/\|/gu,"\\|")}if(c!==i)throw Error("原生表格列范围不完整");return b}),k=j[0]??[];return j.map((d,e)=>{let f={file:b,sourceSha256:a.sourceSha256,nativeProofSha256:a.sha256,page:c.page,row:e,rowCount:j.length,cells:d,bounds:h[e].map(a=>a.bounds),physicalCells:h[e],headers:k};return{...f,rowSha256:g(f)}})})}function m(a,b,c){let d=a.filter(a=>(void 0===c||a.page===c)&&a.cells.length===b.length&&a.cells.every((a,c)=>i(a)===i(b[c])));return 1===d.length?d[0]:void 0}let n=(a,b)=>{let c=j(b.rawText);return b.file===a.file&&!!c&&c.length===a.cells.length&&c.every((b,c)=>i(b)===i(a.cells[c]))},o=a=>(0,f.y)(a.map(({sourceGapBefore:a,sourceTableBridgeBefore:b,sourceNativeTextBridgeBefore:c,...d})=>d));function p(a,b){return h(a)&&h(b)&&a.file===b.file&&a.sourceSha256===b.sourceSha256&&a.nativeProofSha256===b.nativeProofSha256&&b.page===a.page+1&&a.row===a.rowCount-1&&1===b.row&&a.cells.length===b.cells.length&&a.cells.length>=2&&a.bounds.length===a.cells.length&&b.bounds.length===b.cells.length&&a.physicalCells.every((a,b)=>a.columnIndex===b&&1===a.columnSpan)&&b.physicalCells.every((a,b)=>a.columnIndex===b&&1===a.columnSpan)&&a.headers.length===b.headers.length&&a.headers.every((a,c)=>i(a)===i(b.headers[c]))&&a.bounds.every((a,c)=>1.5>Math.abs(a[0]-b.bounds[c][0])&&1.5>Math.abs(a[2]-b.bounds[c][2]))&&b.cells.slice(0,-1).every(a=>!i(a))&&!!i(b.cells.at(-1)??"")&&!!i(a.cells.at(-1)??"")&&!/[。!?!?;;][))】」》”’"']*$/u.test(a.cells.at(-1).trim())}function q(a,b,c,d){let{witnessSha256:e,...f}=a,h=d.flatMap((b,c)=>o([b])===a.fromSpanSha256?[c]:[]),i=d.flatMap((b,c)=>o([b])===a.toSpanSha256?[c]:[]),j=1===h.length&&1===i.length&&i[0]>=h[0]?d.slice(h[0],i[0]+1):[];if(!b||"native-table-page-bridge-v2"!==a.version||a.file!==c.file||a.file!==b.file||e!==g(f)||!p(a.from,a.to)||!j[0]||!j.at(-1)||!n(a.from,j[0])||!n(a.to,j.at(-1))||a.spansSha256!==o(j)||!j.includes(b)||!j.includes(c)||!a.transitions.some(a=>a.fromChunkIndex===b.chunkIndex&&a.toChunkIndex===c.chunkIndex&&a.fromChunkSha256===b.chunkSha256&&a.toChunkSha256===c.chunkSha256&&a.fromEnd===b.end&&a.toStart===c.start))throw Error("原生表格续行与完整layout/source spans证据不一致")}function r(a,b){let c=[...a];for(let a=0;a<c.length;a++){let d,e=c[a]?.nativeTableRow;if(!e)continue;let h=c.findIndex((b,c)=>c>a&&!!b.nativeTableRow&&0!==b.nativeTableRow.row&&b.file===e.file);if(h<0)continue;let k=c[h].nativeTableRow;if(!p(e,k)||c.slice(a+1,h).some(a=>a.nativeTableRow&&(0!==a.nativeTableRow.row||a.nativeTableRow.page!==k.page||a.nativeTableRow.nativeProofSha256!==e.nativeProofSha256)))continue;let l=a=>a.split(/\r?\n/u).filter(a=>a.trim()).every(a=>{let b=a.trim(),c=j(b);return/^#{1,6}\s+(?:PDF 第\s*\d+\s*页|PDF 原生网格表格区域|-?\d+-?)$/u.test(b)||"|"===b||!!c&&(c.every(a=>/^:?-{3,}:?$/u.test(a))||c.every((a,b)=>a===`列${b+1}`)||c.every((a,b)=>i(a)===i(k.headers[b]??"")))});if(c.slice(a+1,h).some(a=>!l(a.sourceSpans?.map(a=>a.rawText).join("\n")??a.text)))continue;let m=c[a],q=c[h],r=m.sourceSpans?.at(-1),s=q.sourceSpans?.[0];if(!r||!s||void 0===r.chunkIndex||void 0===s.chunkIndex)continue;let t=b.filter(a=>a.file===e.file&&a.chunkIndex>r.chunkIndex&&a.chunkIndex<s.chunkIndex).sort((a,b)=>a.chunkIndex-b.chunkIndex);if(t.length!==s.chunkIndex-r.chunkIndex-1)continue;let u=b.find(a=>a.file===e.file&&a.chunkIndex===r.chunkIndex),v=b.find(a=>a.file===e.file&&a.chunkIndex===s.chunkIndex);if(!u||!v)continue;let w=[{chunk:u,start:r.end,end:u.text.length},...t.map(a=>({chunk:a,start:0,end:a.text.length})),{chunk:v,start:0,end:s.start}];if(w.some(a=>!l(a.chunk.text.slice(a.start,a.end))))continue;let x=[r,...w.filter(a=>a.chunk.text.slice(a.start,a.end).trim()).map(({chunk:a,start:b,end:c})=>({file:e.file,chunkIndex:a.chunkIndex,section:"PDF表格页间原始布局",chunkSha256:a.sha256,sourceStartChar:a.startChar,sourceEndChar:a.endChar,start:b,end:c,rawText:a.text.slice(b,c),text:a.text.slice(b,c)})),...q.sourceSpans];try{d=function(a,b,c){if(!p(a,b)||!c[0]||!c.at(-1)||!n(a,c[0])||!n(b,c.at(-1)))throw Error("没有相邻页同表同列续行证据");let d=[];for(let a=1;a<c.length;a++){let b=c[a-1],e=c[a];if(b.chunkIndex!==e.chunkIndex){if(void 0===b.chunkIndex||e.chunkIndex!==b.chunkIndex+1)throw Error("表格续行不能跳过未保全的parse chunk");d.push({fromChunkIndex:b.chunkIndex,toChunkIndex:e.chunkIndex,fromChunkSha256:b.chunkSha256,toChunkSha256:e.chunkSha256,fromEnd:b.end,toStart:e.start})}}let e={version:"native-table-page-bridge-v2",file:a.file,sourceSha256:a.sourceSha256,nativeProofSha256:a.nativeProofSha256,from:a,to:b,fromSpanSha256:o([c[0]]),toSpanSha256:o([c.at(-1)]),spansSha256:o(c),transitions:d};return{...e,witnessSha256:g(e)}}(e,k,x)}catch{continue}let y=[...m.sourceSpans,...x.slice(1).map((a,b)=>a.chunkIndex!==x[b].chunkIndex?{...a,sourceTableBridgeBefore:d}:a)];c.splice(a,h-a+1,{...m,text:y.map(a=>a.text).join("\n"),nativeTableRow:k,sourceSpans:y,sourceSpansSha256:(0,f.y)(y)}),a--}return c}let s=a=>/^-?\d{1,4}-?$/u.test(i(a)),t=a=>{let{lineSha256:b,...c}=a;return b===g(c)};function u(a){let{sha256:b,...c}=a;if(a.nativeLayoutVersion!==e.PDF_NATIVE_LAYOUT_VERSION||b!==g(c))throw Error("原生普通页文件证据身份不一致");return a.pages.flatMap(b=>{if(b.glyphSha256!==g(b.glyphs))throw Error("原生普通页glyph指纹不一致");let c=[];for(let a of[...b.glyphs].filter(a=>a.str.trim()).sort((a,b)=>b.y-a.y||a.x-b.x)){let b=c.find(b=>Math.abs(b.y-a.y)<=Math.max(2,.45*a.height));b?b.glyphs.push(a):c.push({y:a.y,glyphs:[a]})}return c.map((d,e)=>{d.glyphs.sort((a,b)=>a.x-b.x);let f=d.glyphs.filter(a=>/[A-Za-z\p{Script=Han}]/u.test(a.str)),h={file:a.file,sourceSha256:a.sourceSha256,nativeProofSha256:a.sha256,page:b.page,pageGlyphSha256:b.glyphSha256,line:e,lineCount:c.length,text:d.glyphs.map(a=>a.str).join("").replace(/\|/gu,"\\|"),glyphIds:d.glyphs.map(a=>a.id),x:d.glyphs[0].x,xEnd:Math.max(...d.glyphs.map(a=>a.x+a.width)),y:d.y,height:Math.max(...d.glyphs.map(a=>a.height)),columnGap:d.glyphs.some((a,b)=>b>0&&a.x-d.glyphs[b-1].x-d.glyphs[b-1].width>2*Math.max(a.height,d.glyphs[b-1].height)),fontNames:[...new Set((f.length?f:d.glyphs).flatMap(a=>a.fontName?[a.fontName]:[]))].sort()};return{...h,lineSha256:g(h)}})})}let v=(a,b,c)=>{let d=(a=>{let b=j(a.rawText);if(b){if(!b.slice(0,-1).every(a=>!i(a)))return;return b.at(-1)}return a.rawText.trim().replace(/^#{1,6}\s+/u,"")})(b);if(b.file!==a.file||void 0===d)return!1;let e=i(d),f=i(a.text);return!!f&&("start"===c?e.startsWith(f):e.endsWith(f))};function w(a,b){let c=a[0],d=b[0];return c&&d&&i(c.text)===i(d.text)&&1.5>Math.abs(c.x-d.x)&&1.5>Math.abs(c.y-d.y)&&1.5>Math.abs(c.height-d.height)&&c.fontNames.join("|")===d.fontNames.join("|")?i(c.text):void 0}function x(a,b,c,d,e){let f,g=w(c,d),j=c.filter(a=>!s(a.text)&&i(a.text)!==g),k=d.filter(a=>!s(a.text)&&i(a.text)!==g),l=1.5>Math.abs(a.xEnd-b.xEnd)&&a.x>b.x&&j.some(c=>c.line<a.line&&1.5>Math.abs(c.x-b.x)&&c.fontNames.join("|")===b.fontNames.join("|")),m=1.5>Math.abs(a.x-b.x)||l,n=!!e&&h(e)&&e.file===b.file&&e.sourceSha256===b.sourceSha256&&e.nativeProofSha256===b.nativeProofSha256&&e.page===b.page&&1===e.row&&e.cells.slice(0,-1).every(a=>!i(a))&&i(e.cells.at(-1)??"").startsWith(i(b.text));return t(a)&&t(b)&&a.file===b.file&&a.sourceSha256===b.sourceSha256&&a.nativeProofSha256===b.nativeProofSha256&&b.page===a.page+1&&a.line===j.at(-1)?.line&&b.line===k[0]?.line&&m&&2>Math.abs(a.height-b.height)&&!a.columnGap&&!b.columnGap&&(n||l||!j.some(a=>a.columnGap)&&!k.some(a=>a.columnGap))&&a.fontNames.join("|")===b.fontNames.join("|")&&(f=b.text,!/^(?:第[零一二三四五六七八九十百\d]+[章条节]|[((]?[一二三四五六七八九十百\d]+[))]|[一二三四五六七八九十百\d]+[..、])/u.test(f.trim()))&&!!i(a.text)&&!!i(b.text)&&!/[。!?!?;;::][))】」》”’"']*$/u.test(a.text.trim())}function y(a,b){let c=new Set([...b.fromPageLines,...b.toPageLines].filter(a=>s(a.text)).map(a=>i(a.text)));return a.split(/\r?\n/u).filter(a=>a.trim()).every(a=>{let d=a.trim(),e=i(d.replace(/^#{1,6}\s+/u,"")),f=/^#{1,6}\s+PDF 第\s*(\d+)\s*页$/u.exec(d),g=j(d);return f?Number(f[1])===b.from.page||Number(f[1])===b.to.page:!!c.has(e)||!!b.repeatedHeader&&e===b.repeatedHeader||!!b.toGridRow&&(/^#{1,6}\s+PDF 原生网格表格区域$/u.test(d)||"|"===d||!!g&&g.length===b.toGridRow.cells.length&&(g.every(a=>/^:?-{3,}:?$/u.test(a))||g.every((a,b)=>a===`列${b+1}`)||g.every((a,c)=>i(a)===i(b.toGridRow.headers[c]??""))))})}function z(a,b,c,d){let{witnessSha256:e,...f}=a,h=function(a,b){let c=b.flatMap((b,c)=>o([b])===a.fromSpanSha256?[c]:[]),d=b.flatMap((b,c)=>o([b])===a.toSpanSha256?[c]:[]);return 1===c.length&&1===d.length&&d[0]>=c[0]?b.slice(c[0],d[0]+1):[]}(a,d);if(!b||"native-text-page-bridge-v1"!==a.version||a.file!==c.file||a.file!==b.file||e!==g(f)||!t(a.from)||!t(a.to)||a.to.page!==a.from.page+1||a.from.file!==a.file||a.to.file!==a.file||!a.fromPageLines.every(t)||!a.toPageLines.every(t)||a.repeatedHeader!==w(a.fromPageLines,a.toPageLines)||!x(a.from,a.to,a.fromPageLines,a.toPageLines,a.toGridRow)||a.from.sourceSha256!==a.sourceSha256||a.to.sourceSha256!==a.sourceSha256||a.from.nativeProofSha256!==a.nativeProofSha256||a.to.nativeProofSha256!==a.nativeProofSha256||!h[0]||!h.at(-1)||!v(a.from,h[0],"end")||!v(a.to,h.at(-1),"start")||a.toGridRow&&!n(a.toGridRow,h.at(-1))||a.spansSha256!==o(h)||!function(a,b,c,d){let e=d.indexOf(b);return!(e<0)&&d[e+1]===c&&void 0!==b.chunkIndex&&void 0!==c.chunkIndex&&!(c.chunkIndex<b.chunkIndex)&&!(c.chunkIndex>b.chunkIndex+1)&&(b.chunkIndex!==c.chunkIndex||b.chunkSha256===c.chunkSha256&&!(b.end>c.start))&&a.transitions.some(a=>a.fromChunkIndex===b.chunkIndex&&a.toChunkIndex===c.chunkIndex&&a.fromChunkSha256===b.chunkSha256&&a.toChunkSha256===c.chunkSha256&&a.fromEnd===b.end&&a.toStart===c.start)}(a,b,c,h)||h[0].chunkIndex===h.at(-1).chunkIndex&&(h.some(a=>a.chunkIndex!==h[0].chunkIndex||a.chunkSha256!==h[0].chunkSha256)||h.slice(1,-1).some(b=>!y(b.rawText,a))))throw Error("原生普通页续行与实际glyph/layout/source spans证据不一致")}function A(a,b,c,d){let e=c.flatMap(u),h=[...a],k=new Map,l=new Map,m=new Map,p=(a,b)=>JSON.stringify([a,b]);for(let a of e){let b=p(a.file,a.page);k.set(b,[...k.get(b)??[],a])}for(let a of[...b].sort((a,b)=>(a.file??"").localeCompare(b.file??"")||(a.chunkIndex??-1)-(b.chunkIndex??-1))){let b=a.file??"",c=[...a.text.matchAll(/^#{1,6}\s+PDF 第\s*(\d+)\s*页/gmu)].map(a=>({start:a.index,page:Number(a[1])}));l.set(p(b,a.chunkIndex),{initial:m.get(b),markers:c}),c.length&&m.set(b,c.at(-1).page)}let q=a=>{let b=l.get(p(a.file,a.chunkIndex));return b?.markers.filter(b=>b.start<a.start).at(-1)?.page??b?.initial},r=(a,b)=>(k.get(p(a.file,q(a)))??[]).filter(c=>v(c,a,b));for(let a=0;a<h.length;a++){let c=h[a],e=c.sourceSpans;if(!e)continue;let l=-1,m;for(let a=e.length-1;a>=0;a--){let b=r(e[a],"end").filter(a=>!s(a.text));if(1===b.length){l=a,m=b[0];break}}if(!m)continue;let t=k.get(p(m.file,m.page))??[],u=k.get(p(m.file,m.page+1))??[],z=w(t,u),A=u.find(a=>!s(a.text)&&i(a.text)!==z);if(!A)continue;let B=h.findIndex((b,c)=>c>a&&b.file===m.file&&b.sourceSpans?.[0]&&v(A,b.sourceSpans[0],"start")&&q(b.sourceSpans[0])===A.page);if(B<0)continue;let C=h[B],D=C.nativeTableRow,E=D&&1===D.row&&D.cells.slice(0,-1).every(a=>!i(a))&&C.sourceSpans?.[0]&&n(D,C.sourceSpans[0])?D:void 0;if(!x(m,A,t,u,E)||!E&&(C.clauseNo||C.sourceSpans?.[0]?.logicalBoundaryBefore||/^[^::,,。;;“”"'()()]{1,40}[::]/u.test(A.text)||d&&!d(c,C)))continue;let F=a=>a.split(/\r?\n/u).filter(a=>a.trim()).every(a=>{let b=a.trim(),c=j(b),d=i(b.replace(/^#{1,6}\s+/u,""));return/^#{1,6}\s+(?:PDF 第\s*\d+\s*页|PDF 原生网格表格区域|-?\d+-?)$/u.test(b)||s(d)||!!z&&d===z||!!E&&"|"===b||!!c&&(c.every(a=>/^:?-{3,}:?$/u.test(a))||c.every((a,b)=>a===`列${b+1}`)||!!z&&i(c.join(""))===z)});if(h.slice(a+1,B).some(a=>!F(a.sourceSpans?.map(a=>a.rawText).join("\n")??a.text))||e.slice(l+1).some(a=>!F(a.rawText)))continue;let G=h[B],H=G.sourceSpans?.[0],I=e.at(-1);if(!H||!I||void 0===H.chunkIndex||void 0===I.chunkIndex||H.chunkIndex<I.chunkIndex)continue;let J=b.filter(a=>a.file===m.file&&a.chunkIndex>I.chunkIndex&&a.chunkIndex<H.chunkIndex).sort((a,b)=>a.chunkIndex-b.chunkIndex);if(J.length!==Math.max(0,H.chunkIndex-I.chunkIndex-1))continue;let K=b.find(a=>a.file===m.file&&a.chunkIndex===I.chunkIndex),L=b.find(a=>a.file===m.file&&a.chunkIndex===H.chunkIndex);if(!K||!L)continue;let M=I.chunkIndex===H.chunkIndex?[{chunk:K,start:I.end,end:H.start}]:[{chunk:K,start:I.end,end:K.text.length},...J.map(a=>({chunk:a,start:0,end:a.text.length})),{chunk:L,start:0,end:H.start}];if(M.some(a=>a.end<a.start||!F(a.chunk.text.slice(a.start,a.end))))continue;let N=M.filter(a=>a.chunk.text.slice(a.start,a.end).trim()).map(({chunk:a,start:b,end:c})=>({file:m.file,chunkIndex:a.chunkIndex,section:"PDF普通页间原始布局",chunkSha256:a.sha256,sourceStartChar:a.startChar,sourceEndChar:a.endChar,start:b,end:c,rawText:a.text.slice(b,c),text:a.text.slice(b,c)})),O=[...e.slice(l),...N,H],P=[],Q=!0,R=I.chunkIndex===H.chunkIndex;for(let a=1;a<O.length;a++){let b=O[a-1],c=O[a];if(b.chunkIndex!==c.chunkIndex||R){if(void 0===b.chunkIndex||void 0===c.chunkIndex||c.chunkIndex<b.chunkIndex||c.chunkIndex>b.chunkIndex+1||b.chunkIndex===c.chunkIndex&&(b.chunkSha256!==c.chunkSha256||b.end>c.start)){Q=!1;break}P.push({fromChunkIndex:b.chunkIndex,toChunkIndex:c.chunkIndex,fromChunkSha256:b.chunkSha256,toChunkSha256:c.chunkSha256,fromEnd:b.end,toStart:c.start})}}if(!Q)continue;let S={version:"native-text-page-bridge-v1",file:m.file,sourceSha256:m.sourceSha256,nativeProofSha256:m.nativeProofSha256,from:m,to:A,fromPageLines:t,toPageLines:u,...E?{toGridRow:E}:{},...z?{repeatedHeader:z}:{},fromSpanSha256:o([O[0]]),toSpanSha256:o([O.at(-1)]),spansSha256:o(O),transitions:P},T={...S,witnessSha256:g(S)};if(R&&O.slice(1,-1).some(a=>!y(a.rawText,T)))continue;let U=[...N,H],V=[...e,...U.map((a,b)=>R||a.chunkIndex!==(b?U[b-1]:I).chunkIndex?{...a,sourceNativeTextBridgeBefore:T}:a),...G.sourceSpans.slice(1)];h.splice(a,B-a+1,{...c,text:V.map(a=>a.text).join("\n"),sourceSpans:V,sourceSpansSha256:(0,f.y)(V)}),a--}return h}},45455:(a,b,c)=>{c.d(b,{Bj:()=>j,xj:()=>i});var d=c(77598);let e=new Set(["decisionId","requestId","toolCallId","capturedAt","recordedAt","startedAt","endedAt","finishedAt","elapsedMs","durMs","queryTimeMs"]);function f(a){return Array.isArray(a)?a.map(f):a&&"object"==typeof a?Object.fromEntries(Object.entries(a).filter(([a])=>!e.has(a)).sort(([a],[b])=>a.localeCompare(b)).map(([a,b])=>[a,f(b)])):a}let g=a=>(0,d.createHash)("sha256").update(JSON.stringify(f(a))).digest("hex"),h=a=>a&&"object"==typeof a&&!Array.isArray(a)?a:void 0;function i(a){return a.flatMap(a=>{let b=h(a.data);if(!a.ok||!b)return[];let c=h(b.directoryState);if("query_cad_context"===a.toolName&&["frames","instances"].includes(String(b.kind))&&c?.scope==="indexed-cad-directory"&&!0===c.complete&&0===c.recordCount&&"string"==typeof b.parsedIdentity&&"string"==typeof b.filePath)return[g(["empty-cad-directory",b.projectSnapshotId,b.filePath,b.parsedIdentity,b.kind])];if("ask_chief"===a.toolName){if("model"!==b.source)return[];let a=Object.fromEntries(("use-facts"===b.action?["factIds"]:"use-sources"===b.action?["sourceIds"]:"engineering-controls"===b.action?["controls","writingControls"]:"qualitative-controls"===b.action?["qualitativeControls"]:[]).filter(a=>Array.isArray(b[a])&&b[a].length>0).map(a=>[a,b[a]]));return Object.keys(a).length?[g(["chief-decision",b.taskId,b.action,a])]:[]}let d=Object.fromEntries(("query_construction_plan"===a.toolName?["activities","plannedResources","numbers","materials"]:"query_project_facts"===a.toolName?["candidates","sourceEvidence"]:"query_cad_context"===a.toolName?["records"]:"query_source_units"===a.toolName?["units"]:"read_source"===a.toolName?["chunks"]:["search_evidence","query_work_packages","discover_files"].includes(a.toolName)?["items"]:"list_skills"===a.toolName?["skills"]:"match_skills"===a.toolName?["matched"]:[]).flatMap(c=>{if(!Array.isArray(b[c]))return[];let d=b[c].filter(b=>{let c=h(f(b));return!!c&&!!Object.keys(c).length&&("read_source"!==a.toolName&&"search_evidence"!==a.toolName||"string"==typeof c.content&&!!c.content.trim())}),e="search_evidence"===a.toolName?d.map(a=>Object.fromEntries(Object.entries(h(a)).filter(([a])=>!["score","rank","retrievalRank","retrievalScore"].includes(a)))):d;return e.length?[[c,e]]:[]}));"load_skill"===a.toolName&&h(b.skill)&&(d.skill=b.skill);let e=Object.fromEntries(["snapshotId","projectSnapshotId","contractId",..."query_construction_plan"===a.toolName?["id"]:[],"filePath","relativePath","parsedIdentity","sceneVersion","kind","frameId","rootInstanceId","units","metadata","sourceVersionEligibility"].filter(a=>void 0!==b[a]).map(c=>[c,"metadata"===c&&"read_source"===a.toolName&&h(b[c])?Object.fromEntries(Object.entries(h(b[c])).filter(([a])=>!["mtime","indexedAt"].includes(a))):b[c]])),i=Object.entries(d).flatMap(([c,d])=>(Array.isArray(d)?d:[d]).map(d=>{let f=h(d);if("query_project_facts"===a.toolName&&f?.factId&&"verified-source-excerpt"!==f.roleId)return g(["project-fact",b.snapshotId??b.projectSnapshotId,f.factId,f.value,f.controlContext??null,h(f.sourceVersionEligibility)?.status??null]);if("query_project_facts"===a.toolName&&f&&(f.sourceEvidenceId||"verified-source-excerpt"===f.roleId))return g(["source-excerpt",b.snapshotId??b.projectSnapshotId,f.sourceEvidenceId??f.factId,f.value]);let i="query_construction_plan"===a.toolName&&"numbers"===c&&f?Object.fromEntries(Object.entries(f).filter(([a])=>"basisId"!==a)):d;return g(["source-material",a.toolName,e,c,i])}));return Number.isSafeInteger(b.offset)&&Number.isSafeInteger(b.nextOffset)&&Number(b.nextOffset)>Number(b.offset)&&i.push(g(["source-cursor",a.toolName,e,{offset:b.offset,nextOffset:b.nextOffset}])),i})}async function j(a){let b,{budget:c}=a,e=[...a.initialMessages],f=0,h=0,j="模型未产出可用正文",k="turns-exhausted",l=new Set(i(a.initialEvidence??[])),m=new Set,n=0,o=!1;for(let p=1;void 0===c.maxTurnsPerBlock||p<=c.maxTurnsPerBlock;p+=1){if(void 0!==c.maxToolCallsPerBlock&&f>=c.maxToolCallsPerBlock){j=`显式工具调用预算耗尽(${f}/${c.maxToolCallsPerBlock})`,k="tool-budget-exhausted";break}let q=await a.runTurn({system:a.system,messages:e,turn:p,...void 0!==c.maxToolCallsPerBlock?{toolCallLimit:Math.max(0,c.maxToolCallsPerBlock-f)}:{}});if(h=p,f+=q.toolCalls.length,q.refused)return a.onTurn?.({turn:p,residual:b?.residual??0,toolCalls:f,action:"unfixable"}),b?{kind:"unfixable",content:b.content,turn:p,residual:b.residual,toolCalls:f,reason:q.refused.message,issues:[],cause:"budget-refused"}:{kind:"budget_refused",turn:p,reason:q.refused.message,refused:q.refused};let r=i(q.toolResults??[]);q.protocolRecovery?.sentOutputBudget!==null&&q.protocolRecovery?.sentOutputBudget!==void 0&&r.push(g(["protocol-recovery",q.protocolRecovery.sentOutputBudget])),!o&&q.protocolRecovery?.kind==="invalid-tool-arguments"&&q.toolMessages?.some(a=>"assistant"===a.role&&a.toolCalls?.some(a=>"submit_author_task"===a.name))&&q.toolMessages.some(a=>"tool"===a.role&&a.content)&&(o=!0,r.push(g(["first-author-submission-syntax-feedback"])));let s=r.some(a=>!l.has(a));r.forEach(a=>l.add(a)),s&&(n=0);let t=q.committed||q.text;if(t?.trim()){let c=await a.check(t),g=c.issues.filter(a=>"error"===a.level||"blocker"===a.severity).length;if(c.degraded.length>0&&!c.executed.length)return a.onTurn?.({turn:p,residual:g,toolCalls:f,action:"unfixable"}),{kind:"unfixable",content:t,turn:p,residual:g,toolCalls:f,reason:`自查维度全部降级(${c.degraded.join("、")}),本块未做自查,保留当前草稿`,issues:c.issues,cause:"checks-degraded"};if(0===g&&!c.degraded.length)return a.onTurn?.({turn:p,residual:g,toolCalls:f,action:"commit"}),{kind:"passed",content:t,turn:p,residual:g,toolCalls:f};let h=(0,d.createHash)("sha256").update(JSON.stringify([t,c])).digest("hex"),i=m.has(h);if(m.add(h),(!b||g<b.residual)&&(b={content:t,residual:g}),i&&!s){j="相同候选与裁决重复,未取得新证据或改善",k="no-progress";break}a.onTurn?.({turn:p,residual:g,toolCalls:f,action:"regenerate"}),e=[...e,...q.toolMessages??[],{role:"assistant",content:t},{role:"user",content:function(a){let b=a.filter(a=>"error"===a.level||"blocker"===a.severity),c=b.slice(0,12).map((a,b)=>`${b+1}. ${a.detectorId?`[${a.detectorId}] `:""}${a.message}`),d=b.slice(12),e=new Map;for(let a of d){let b=a.detectorId||"(未标注判据)";e.set(b,(e.get(b)||0)+1)}return["【自查裁决】本稿未通过判据,下列问题必须修正后重新输出完整本节正文:",...c,d.length>0?`${d.length} 条未逐条列出,按判据分布:${[...e.entries()].map(([a,b])=>`${a} ${b} 条`).join("、")}`:"","修正要求:直接输出修正后的**完整**本节正文(不要只输出改动片段、不要解说改动过程);保留原有事实、数值与结论,不得以删除内容的方式规避问题。"].filter(Boolean).join("\n")}(c.issues)}];continue}let u=q.toolMessages??[];if(s)e=[...e,...u];else{let a=++n;if(a>=3){j="相同无进展状态在具体反馈后仍未取得新证据、游标或主控决定",k="no-progress";break}e=[...e,...u,{role:"user",content:1===a?"本轮没有新增可用来源、分页游标或已接受的主控决定。原始工具回执已保留;空结果或失败不证明资料缺失,也不能用改查询词、调用ID或再报缺来冒充进展。请依据已取得的资料换用有实际依据的工具/继续真实nextOffset,或向已接线的主控说明具体对象、已查范围与失败;若仍无法核定,保留真实decisionRequests并提交已能完成的正文,不编造参数或条件。":"再次没有新增证据。立即停止重复取证:把已能完成的正文按协议提交(未决事项写入decisionRequests保留),拟定配置按工程经验带依据给出(正文标“拟定”并登记plannedNumbers);继续同类工具调用不会产生新证据。"}]}void 0!==c.maxTurnsPerBlock&&p>=c.maxTurnsPerBlock&&(j="显式轮次预算耗尽,模型尚未提交正文")}return b?(a.onTurn?.({turn:h,residual:b.residual,toolCalls:f,action:"unfixable"}),{kind:"unfixable",content:b.content,turn:h,residual:b.residual,toolCalls:f,reason:j,issues:[],cause:k}):{kind:"no_content",turn:h,toolCalls:f,reason:j,cause:k}}},47262:(a,b,c)=>{function d(a){let b=e()?.semanticFingerprints?.[a];return"string"==typeof b&&/^[a-f0-9]{64}$/u.test(b)?b:void 0}function e(){let a='{"version":1,"sourceFingerprint":"84adacede7ff442362a497aa3e621351f0c7ab051b72c5c491f09a03bf4751e3","semanticFingerprints":{"projectFacts":"aaf475c58692b51c52eb3c2d12f8f33fe5661a174c7f39a4d67c3e4f0d2c4721","documentGeneration":"0ea0fed70e2feff4fa6ffd05476f93f24e7d242eff6bd5a62d2f909ebe36a529"},"gitCommit":"f53db51b3de6374762fb08393b39385f24100893","serverVersion":"4.60.33","sourceFiles":754,"capturedAt":"2026-10-14T16:56:54.927Z"}';if(a)try{let b=JSON.parse(a);if(1!==b.version||!/^[a-f0-9]{64}$/u.test(b.sourceFingerprint??"")||"string"!=typeof b.serverVersion||"number"!=typeof b.sourceFiles||"string"!=typeof b.capturedAt||null!==b.gitCommit&&"string"!=typeof b.gitCommit)return;return b}catch{return}}c.d(b,{C:()=>d,S:()=>e})},48825:(a,b,c)=>{c.d(b,{Jf:()=>j,V2:()=>i,bp:()=>d,wJ:()=>e});let d="professional-writing-guidance-v4-responsibility-titles-2026-10-13",e={building:{fileName:"施工组织设计章节写作分析与编制规范(建筑).docx",sha256:"9313607509897e9a252cdefd671c4c72025d2727411972788bfa61b9835a0ff2",pages:12},municipal:{fileName:"施工组织设计章节写作分析与编制规范(市政).docx",sha256:"8e36d97e7084464ab04776093550e10984d3ac4a2a64ac37d5ca74a13a3ccc82",pages:13},bidWriting:{fileName:"技术标写作指南(合肥AI评标).docx",sha256:"3f36e67531da8ac9ffb1847694403ec4246457e445612767b3a82acf02894d0e"},bidReview:{fileName:"青天大模型AI评标规则考证(2026-10-11).docx",sha256:"de976918a1a0f1486cb07e1c2fd4a72a3b86fa480cbd46353f4c1af372badc69"}},f=["先形成工程对象、工作包、部署、资源及时间的共同推演,再按交付目录组织成文。事实、数量、工作面、部位、班组、节点在各章共用稳定身份,作者不各自编数字。","功能职责不等于固定章节:概况解释条件与影响,部署决定空间和顺序,方法说明实施,质量说明检查,安全说明风险与处置,进度说明时间,平面说明现场组织,移交说明最终闭环。推荐母目录不覆盖招标或用户锁定结构。","工作包数量与方法连通,方法与资源连通,资源与工期迭代校核;材料到货早于使用,检测和必要等待进入转序与时间逻辑。同一机械或班组同期不能在不同工作面重复占用。","施工方法、部署、真正重难点与进度应充分展开;人材机重点算准,管理计划重点完成执行闭环,概况与编制依据保持准确简洁。详略按职责和风险,不按统一字数、参数密度或固定图表数量。","表格按真实数据形态选择:单项目多属性用“信息项—内容”纵向或按属性含义分组;多对象在相同指标下比较、配置或排程时才横向展开。字段宽度应容纳完整对象、控制数值和单位,不能把大量无比较目的的属性铺成十几列单行,或把长范围原文挤进窄格。真实阶段或对象矩阵需要宽表时保留全部字段与对应关系,按职责合理分组,不设置固定列数上限、不强制各章制表,不删表行、数值或对象迎合评价。","项目事实依据与技术规范依据分别治理;前者确定实际工程,后者核验控制与验收。核验规范编号、名称、实施日期、状态、替代及局部废止和对象范围;参考文件列出的编号不等于本次已验证有效。","计算、产能假设和规范查证保留内部审计,正文交付核定的配置与控制结果及必要实施条件,不堆算式和来源说明。引用规范仅限确有技术参数、验收或强制边界需要的地方。","首稿采用专业短句和必要分点:条件决定方法,动作达到可检状态,状态放行下一工序。正文工序名不以箭头串替代实施方法;实际流程图和活动网络保留其关系,图后不逐节点逐连线重复全文。","技能主题是规划参考,不是必须照抄的交付标题。主控按本工程对象及被委派职责拟定正式小节名称,避免把“候选、核验责任、适用性”这类内部判断任务直接当目录;真正承担辨识、核查职责时使用完整专业名称。专业标题说明工程对象、方法或组织职责,不拼接关键词、不照抄内部评审标签。正常技术名称重复不导致丢弃、换名或重写;同项目再次编制仍以实际条件和方案质量为准。","写作指南中的样本统计只提供观察线索,不构成评分算法;图片数、箭头数、元数据软件、标题关键词和入围差值不授予质量或真实性。项目实际要求与专业适用规则优先,不为低频统计删去必要风险和接口。"],g={building:"建筑工程按实际楼栋、楼层、流水段和专业接口组织;地下结构、主体、围护装修、机电与室外的先后和移交要一致。不能把房建通用专业强行加入实际没有的工程。",municipal:"市政按真实路线、桩号、区段和工作面组织,明确起点、推进方向、地下与地上转序;涉及社会交通时,导改、围挡、施工阶段、居民出行与施工车辆路线联动。场内便道与场外交通分开。"},h=[{id:"overview",label:"项目理解",match:/概况|项目理解|整体理解|现场条件|工程清单|专业构成/u,buildingPages:[2],municipalPages:[2],guidance:"给出事实及其对施工组织的影响,按专业呈现必要工程量;不复制设计说明、不提前展开工艺,不以无来源地质、距离或道路数据制造针对性。"},{id:"deployment",label:"总体部署",match:/总体部署|施工部署|流水段|工作面|施工区段|施工顺序/u,buildingPages:[2,3],municipalPages:[2,3],guidance:"明确区段和工作面对应哪些任务及工程量、划分理由、起点、方向、先后与穿插、专业移交条件。后续方法、资源和进度必须能从部署找到组织依据。"},{id:"difficulties",label:"重难点",match:/重难点|重点难点|项目特点|制约因素/u,buildingPages:[3,4],municipalPages:[3,4],guidance:"由真实项目证据辨识制约因素,解释原因和后果,给出技术组织、资源、检查及异常处置;只深写真正核心问题,并在相关方法、质量、安全或工期中闭合。"},{id:"method",label:"施工方法",match:/工艺|工法|施工方法|施工技术|浇筑|开挖|吊装|安装|支模/u,buildingPages:[4,5],municipalPages:[4,5],guidance:"对本节实际承担的分项写清对象和工作量、前提、顺序、步骤、材料机具工种、控制、接口、检查、异常和转序。普通工序可组织可检查,核心工序达到必要技术策划深度;不把施组全文变成专项计算书。"},{id:"materials",label:"材料供应",match:/材料|物资|永久设备|供应|采购|人材机/u,buildingPages:[5],municipalPages:[5],guidance:"数量由实际工程量或可靠换算取得,供应与工作面及使用窗口衔接;长周期构件设备串联确认、采购、到货和安装。区分施工机械与永久设备、产品标准与验收标准;不能可靠换算时不假算。"},{id:"equipment",label:"机械与仪器",match:/机械|机具|检测仪器|人材机|确保机/u,buildingPages:[5,6],municipalPages:[5,6],guidance:"关键机械以工作量、可用作业窗口、实际单机或机组能力核定数量,检查同期占用和转场。检测仪器服务实际检验。运距未知不能虚构运输循环时间;算式留审计,不抄经验台数。"},{id:"labor",label:"劳动力",match:/劳动力|班组|工种|人材机|确保人/u,buildingPages:[6,7],municipalPages:[6],guidance:"以班组、工作面、阶段和工种组织投入,核算工作量、工日和持续时间;峰值由实际同期工种矩阵求得,不能相加各专业独立峰值。配置与特种作业必须符合真实任务。"},{id:"quality",label:"质量控制",match:/质量|检验|检测|隐蔽验收|复试|样板|三检/u,buildingPages:[7],municipalPages:[6,7],guidance:"围绕真实实体写检查对象、指标、方法、适用频次、岗位、记录、不合格处置、复验和销项;合格后才转序。方法章写实施,质量章写核验,避免再抄一遍工艺。"},{id:"safety",label:"风险安全与应急",match:/危大|危险源|风险|安全|应急|专项方案|论证/u,buildingPages:[7,8],municipalPages:[7,8],guidance:"实际作业、实体参数和影响对象支撑风险与危大判定,不能靠关键词。承担现场控制时给出作业条件、停止触发、监测和处置;辨识或审核子任务只承担其边界,完整应急由被委派任务负责。"},{id:"schedule",label:"进度组织",match:/进度|工期|节点|施工计划|施工窗口|确保人|确保机/u,buildingPages:[8,9],municipalPages:[8,9],guidance:"共同任务网络连接工作量、工作面、综合能力、材料到货、必要等待、检测与转序。开始结束和搭接可复核,关键路线由逻辑计算,不将箭头示意当网络计划。进度、正文与资源共用同一时间数据。"},{id:"environment",label:"环境与外部运行",match:/文明|环境|环保|扬尘|噪声|校园秩序|交通|既有|保护/u,buildingPages:[9],municipalPages:[9],guidance:"针对实际居民、校园、生产、交通、水体或既有设施说明影响、控制、检查责任及恢复;地方措施需按属地核验,不无条件复制某城市标准。涉及既有设施先调查再分析保护监测。"},{id:"site-layout",label:"现场空间组织",match:/总平面|平面布置|临时设施|临设|运输路线|便道|便桥/u,buildingPages:[9,10],municipalPages:[9,10],guidance:"按实际场地边界和阶段部署布置物流、堆场、机具、水电排水、消防及出入口,检查真实可通行与转场条件。缺尺寸不编坐标;必要实体决定未完成时由主控解决,不用模糊正文冒充已落地。"},{id:"handover",label:"验收恢复移交",match:/竣工|移交|交付|保修|缺陷责任|退场|恢复/u,buildingPages:[10],municipalPages:[10,11],guidance:"从已施工实体与系统反推检查、调试、整改复验、资料、培训和移交。市政还核对道路、交通、绿化及临设恢复;过程隐蔽验收不重复承担整套竣工移交。"}];function i(a){let b="building"===a||"municipal"===a?g[a]:"工程类型未确认时只使用共同写作原则,不能默认套用市政或房建专业条件。";return`【编制规范萃取 ${d},是写作方法先验,不是项目事实或已核现行标准】
|
|
126
|
+
${d}`})};for(b.length&&(a.onProgress(b,c,d),u());;){g();let e=j?a.callOptions:a.readingCallOptions,k=j?q:[...q.filter(a=>a.name!==h.name&&"read_frozen_cad"!==a.name),H],l=await (0,r.Qf)(()=>(a.caller??r._v)({system:a.system??"你是负责专业边界、资料口径和作者协作的主智能体,使用实际工具查清工程对象及工况后裁决。",messages:s,tools:k,requireToolCall:!1,taskKind:e?.taskKind??"reasoning",diagnostics:a.diagnostics,signal:f,callKind:e?.callKind??"supervisor-decision",maxTokens:e?.maxTokens??12e3,temperature:0}),f);if(c.push(l??null),a.onProgress(b,c,d),g(),!l)throw Error("主控模型未返回有效响应,未执行读取或裁决");if(s.push({role:"assistant",content:l.content,toolCalls:l.toolCalls,...void 0!==l.thinkingContent?{thinkingContent:l.thinkingContent}:{}}),l.responseMetadata?.completed===!1){let e="本轮模型响应被截断,读取或提交均未执行;须根据实际响应容量返回完整工具请求,未闭合内容不执行";for(let a of(d.push(e),l.toolCalls))s.push({role:"tool",toolCallId:a.id,content:JSON.stringify({accepted:!1,performed:!1,error:e})});s.push({role:"user",content:e}),a.onProgress(b,c,d),o(e);continue}if(!l.toolCalls.length){d.push("本轮仅返回普通文本,未执行读取或裁决"),s.push({role:"user",content:`本轮普通文字未作为工程裁决执行。请调用已提供的读取工具继续查证,或调用${h.name}提交有实际依据的裁决。`}),a.onProgress(b,c,d),o("普通文字未执行工具裁决");continue}let t=l.toolCalls.filter(a=>a.name===H.name);if(!j&&(t.length||l.toolCalls.some(a=>a.name===h.name))){let e;if(1!==t.length||1!==l.toolCalls.length)e="普通源查证阶段不执行方案提交;结束准备与读取须分轮,之后用专业推理完整提交";else try{let a=JSON.parse(t[0].arguments);if(!a||"object"!=typeof a||Array.isArray(a)||Object.keys(a).some(a=>"reason"!==a)||"string"!=typeof a.reason||!a.reason.trim())throw Error("结束源查证须说明实际资料是否已足够及剩余未核事项");j=!0,m.clear(),p.push({reason:a.reason,engineeringDecision:"not-evaluated"})}catch(a){e=a instanceof Error?a.message:String(a)}for(let a of(e&&d.push(e),l.toolCalls))s.push({role:"tool",toolCallId:a.id,content:JSON.stringify(e?{performed:!1,accepted:!1,error:e}:{performed:!0,stage:"source-reading-finished",engineeringDecision:"not-evaluated",instruction:`准备阶段已结束;下一轮按专业推理调用${h.name}完整提交,当前没有采用任何工法候选`})});a.onProgress(b,c,d),u(),e&&o(e);continue}let v=l.toolCalls.filter(a=>a.name===h.name);if(1===v.length&&1===l.toolCalls.length){let e=y(a.project,b);try{let d=JSON.parse(v[0].arguments);return await (0,r.Qf)(()=>Promise.resolve(a.validateSubmission?.(d,e,b)),f),g(),{raw:d,reads:b,attempts:c,sources:e,...p.length?{preparationReceipts:p}:{}}}catch(h){g(),i=!0;let e=h instanceof Error?h.message:String(h);d.push(e);let f=e.includes("图纸泛指")||e.includes("转交图示")||e.includes("后续审批")?"把 instruction 改写成「对象+部位+工序动作+控制要求」的可执行句;删除“按图/按设计图/按审批/以…为准/待深化/报审后执行”等指向语,来源证明仍保留在 evidence 中。":e.includes("控制值须为明确数值及单位")?"单一工程控制值只能是明确数值+单位;来源原文是范围或约数时不得作为工程控制值——若它是源内条件义务,改用 action=qualitative-controls 的 conditional-duty 原样保留范围与完整条件;若只需正文引用原文,改用 action=use-sources。":e.includes("缺逐项独立用途复核")?"提交须逐项覆盖全部 controls:results 的 index 依次覆盖 0..controls.length-1,每项 status 与 reason 完整;漏项或重复即整次退回。":e.includes("非定性决定不能附加未核定采用许可")?"qualitativeControls 只能与 action=qualitative-controls 同时出现;engineering-controls 只提交 controls 数组,不得附带 qualitativeControls。":e.includes("工程适用性未确认")?"全部控制项必须逐项 confirmed;证据不足的部位关系保持 unmeasured 会导致整次退回——只提交已读证据足以支撑同一对象、工况、基准与适用条件的控制,其余以 use-sources 或 request-human 保留。":e.includes("未查询的来源")||e.includes("改写了原文")?"quote 必须是本次实际读取原文中的连续原字,sourceId 只能选择已返回的 sourceId。":"";s.push({role:"tool",toolCallId:v[0].id,content:JSON.stringify({accepted:!1,performed:!1,error:e,instruction:`${a.submission?"本次提交未采用;根据真实读取回执与本次校验错误纠正当前提案,不能把缺证据的关系宣称已核定或扩大提交范围。":"本次裁决未采用;只根据已读证据纠正当前提案,不用含数字的guidance或图示指向语绕过工程控制校验。"}${f?`纠正方向:${f}`:""}`})}),a.onProgress(b,c,d),u(),o(`裁决未通过独立校验:${e}`);continue}}for(let e of l.toolCalls){let f,h;g();try{if(v.length)throw Error("读取与提交须分轮;本轮混合请求全部未执行,请先完成查证");let b=JSON.parse(e.arguments),c="read_frozen_source"===e.name?"source":"read_frozen_cad"===e.name&&a.readCad?"cad":"read_frozen_work_packages"===e.name&&a.readWorkPackages?"work-package":void 0;if(!c)throw Error("主控请求了未提供的能力");let d=Object.keys(("source"===c?C:"cad"===c?D:F).properties);if(!b||"object"!=typeof b||Object.keys(b).some(a=>!d.includes(a)))throw Error("读取定位字段无效");let g="cad"!==c||b.kind&&"frames"!==b.kind?b:{limit:24,detail:"catalog",...b};(f={kind:c,query:g}).result="source"===c?n(a.project,g):"cad"===c?a.readCad(g):a.readWorkPackages(g),h=f.result}catch(b){let a=b instanceof Error?b.message:String(b);f?f.error=a:d.push(a),h={error:a,performed:!1}}f&&b.push(f),s.push({role:"tool",toolCallId:e.id,content:JSON.stringify(h)}),a.onProgress(b,c,d)}u(),o("实际读取没有新的源材料或游标"),s.push({role:"user",content:"已保留本轮实际读取;使用nextOffset继续真实未完成分页。重复同页或空结果不表示新增证据,不凭查证动作扩大用途。"})}})}catch(a){if(a instanceof G)throw a;throw g(),new G("OPERATION_FAILED",a instanceof Error?a.message:String(a),e,a)}}var J=c(41240),K=c(68959),L=c(9090);function M(a){let{controls:b,qualitativeControls:c,...d}=a;return{...d,...a.writingControls?{controls:a.writingControls}:{},...a.writingQualitativeControls?{qualitativeControls:a.writingQualitativeControls}:{}}}let N=a=>(0,d.createHash)("sha256").update(JSON.stringify(a)).digest("hex");function O(a){let b=new Map;return c=>({ask:async d=>{let l=a.contract.sections.find(a=>a.id===c);if(!l||"string"!=typeof d.question||!d.question.trim()||d.question.length>4e3||!Array.isArray(d.criterionIds)||!d.criterionIds.length||new Set(d.criterionIds).size!==d.criterionIds.length||d.criterionIds.some(a=>!l.criterionIds.includes(a))||void 0!==d.factQueries&&(!Array.isArray(d.factQueries)||d.factQueries.some(a=>!a||"string"!=typeof a.attribute||!a.attribute.trim()||Object.keys(a).some(a=>!["attribute","objectName"].includes(a))||void 0!==a.objectName&&"string"!=typeof a.objectName)))throw Error("主控问题必须指向当前作者的具体职责");if(void 0!==d.sourceQueries&&(!Array.isArray(d.sourceQueries)||d.sourceQueries.some(a=>Object.keys(a).some(a=>!["query","filePath","offset","limit"].includes(a)))))throw Error("原文查询须明确实际定位条件");let m=(d.sourceQueries??[]).map(b=>n(a.project,b)),r=N([c,d]),s=b.get(r);if(s)return s;let t=(async()=>{var b,n;let s,t,u,v,x,y,z,B,C=a.contract.criteria.filter(a=>d.criterionIds.includes(a.id)),D=new Set(C.flatMap(a=>a.factIds??[])),E=(d.factQueries??[]).map(b=>(0,g.j)(a.project,b));for(let a of E)if("resolved"===a.status)for(let b of a.candidates)D.add(String(b.factId));let F=a.project.facts.filter(b=>D.has((0,e.vg)(b))&&(0,f.j)(b)&&Object.hasOwn(a.project.sources,b.sourceFile)).filter(a=>!(0,i.p)(a).requiresTechnicalDecision).filter(b=>!b.resolutionRef||!!(b.resolutionRef.winnerSourceFile&&Object.hasOwn(a.project.sources,b.resolutionRef.winnerSourceFile))).map(b=>({...(0,j.YL)(a.project,b),factId:(0,e.vg)(b),sourceFile:b.resolutionRef?.winnerSourceFile??b.sourceFile,sourceRef:b.resolutionRef?b.resolutionRef.winnerSourceRef??null:b.sourceRef??null})),G=["你是专业文档的主智能体,回答作者在正式提交首稿前遇到的具体问题。",...a.sharedPlan?[`【本轮共同组织候选与真实任务接口】${JSON.stringify((0,J.E6)(a.sharedPlan,a.contract.sections,l.id))}。在既有对象、阶段与接口内裁决,发现来源冲突须说明具体冲突,不能让作者独自另换工序或把未决值写成正文。`]:[],...a.contract.deliveryPolicy?[(0,h.Jf)({projectType:a.contract.writingKnowledge?.projectType,title:l.title,responsibility:l.responsibility,contentTypes:l.contentTypes}).text]:[],"可选择 use-facts(指向给定可靠事实)、use-sources(提供已查询的完整原文)、engineering-controls(真实定量控制及推导)、qualitative-controls(实际方法/定性采用或原源条件义务,独立复核后只授指定任务用途)、guidance(定性方法与职责指引)、request-human(资料或合同需改变)。","不得编造项目数值或标准限值,guidance只给方法建议,不构成任何数值或选型采用许可。已有原文的工程决定应提交具体controls或qualitativeControls独立核定,不以笼统组织词代替。先通过明确原文查询定位条件与方法;原文可用时提供完整来源,不因尚未抽成属性就直接交回人。确需外部资料或更改合同才保留未决。数值范围仍须按对象与阶段解析,不能任选端点。不要代写整节正文。",'只返回{"action":"guidance","answer":"可执行的回答","factIds":[],"sourceIds":[],"reason":"为何这样裁决"}。use-sources的sourceIds必须选择本次原文查询实际返回的来源身份。',"engineering-controls的factIds仅为controls中实际derivation.inputFactIds的去重并集;直接引用原文、没有算式时必须返回factIds:[]。读过的候选不等于采用的推导输入,不能把待核定范围放入factIds。每项工程控制的实质决定全部写入controls,answer只解释状态,不能用图示指向语替代控制项。","engineering-controls另须controls数组,每项为{objectName,attribute,condition,value,instruction,evidence:[{sourceId,quote}],derivation?:{formula,inputFactIds,basis}}。quote须来自已查询原文的真实连续引文,value须有数值及单位,condition明确适用部位与阶段,不泛化全工程;优先使用原文明确的控制标高等可执行属性,无须强行生成统一总深度。只有已提供的可靠单值事实可作推导输入,算式用$0、$1及四则括号,服务端核量纲与算术。sourceIds为全部实际用到的原文身份,factIds为全部推导输入;执行指引不添加未经核定的参数。裁决不会改写冻结项目事实或证明整篇合格。",'qualitative-controls另须qualitativeControls:[{category:"conditional-duty|project-adoption",objectName,attribute,condition,value,instruction,evidence:[{sourceId,quote}]}]。保持源内真实承担主体、触发、例外、适用对象。conditional-duty只能忠实履行源义务,不批准候选目录参数为当前选型。project-adoption须真实当前项目采用关系,参考选项须真实selector桥,未决A不批准采用。真正定量控制仍用engineering-controls。sourceIds为实际证据身份全集,factIds为[]。',"事实查询结果含完整口径状态;ambiguous/unbound/unmeasured/needs-technical-decision不能通过任选一个候选变成已确认施工值。概况范围不得取端点或平均值冒充各部位深度,分层厚度不能当坑深。分页未完成时不能声称已核完整集合。",JSON.stringify({task:l,criteria:C,facts:F,factQueries:E,question:d,sourceFiles:[...new Set([...F.map(a=>a.sourceFile),...m.flatMap(a=>a.sources.map(a=>a.filePath)),...Object.keys(a.project.sources).filter(a=>/\.(?:dwg|dxf)$/iu.test(a))])]})].join("\n"),H=`chief:${r.slice(0,28)}`,M=async(b,d,f)=>{if(!b||!["use-facts","use-sources","engineering-controls","qualitative-controls","guidance","request-human"].includes(b.action??"")||"string"!=typeof b.answer||!b.answer.trim()||b.answer.length>3e3||"string"!=typeof b.reason||!b.reason.trim()||!Array.isArray(b.factIds)||new Set(b.factIds).size!==b.factIds.length||b.factIds.some(a=>!F.some(b=>b.factId===a))||"use-facts"===b.action&&!b.factIds.length||"guidance"===b.action&&((0,q.ei)(b.answer).length||b.factIds.length))throw Error("主智能体裁决越过事实或职责边界,未执行");let g=b.sourceIds??[];if("request-human"===b.action&&function(a){let b=new Map,c=new Map;for(let d of a){if(d.error)return!0;if("cad"===d.kind){if(!d.result)return!0;let a=d.query,b=d.result;if(!Array.isArray(b.records)||!Number.isSafeInteger(b.offset)||b.offset<0||"string"!=typeof b.parsedIdentity||"string"!=typeof b.projectSnapshotId)return!0;let e=JSON.stringify([a.filePath,a.kind??"frames",a.rootInstanceId??null,a.frameId??null,a.entityId??null,a.query??"",a.placement??"all",a.textOnly??!1,a.order??"source",a.detail??"full"]),f=c.get(e)??[];f.push({query:a,page:b}),c.set(e,f);continue}if("work-package"===d.kind&&d.result){let a=d.result;if(!0!==a.complete||a.items.length!==a.total)return!0;continue}if("source"!==d.kind||!d.result)continue;let a=d.query,e=JSON.stringify([a.filePath??null,a.query]),f=b.get(e)??[];f.push(d.result),b.set(e,f)}for(let b of c.values()){if(b.some(({page:a})=>a.parsedIdentity!==b[0].page.parsedIdentity||a.projectSnapshotId!==b[0].page.projectSnapshotId))return!0;let c=b.find(({page:a})=>null===a.nextOffset&&null!==a.total);if(["instances","frames"].includes(b[0].query.kind??"frames")&&!b[0].query.entityId&&!b[0].query.query&&b.some(({query:b,page:c})=>a.some(a=>{if("cad"!==a.kind||!a.result)return!1;let d=a.query;return d.filePath===b.filePath&&["annotations","geometry"].includes(d.kind??"")&&c.records.some(a=>void 0!==d.rootInstanceId&&a.payload.rootInstanceId===d.rootInstanceId||void 0!==d.frameId&&a.payload.id===d.frameId)})))continue;if(!c||null===c.page.total)return!0;let d=c.page.total,e=new Set;for(let{page:a}of b)for(let b=0;b<a.records.length;b+=1)e.add(a.offset+b);if(e.size!==d||[...e].some(a=>a>=d)||d>0&&!e.has(0))return!0}for(let a of b.values()){let b=a[0]?.matchedCount??0,c=new Set;for(let b of a)for(let a=0;a<b.sources.length;a+=1)c.add(b.offset+a);if(c.size!==b)return!0}return!1}(f))throw Error("相关冻结原文尚未完整定位,不能把未完成查询当作需要用户提供资料");if(!Array.isArray(g)||new Set(g).size!==g.length||g.some(a=>!d.some(b=>b.sourceId===a))||["use-sources","engineering-controls","qualitative-controls"].includes(b.action??"")&&!g.length||!["use-sources","engineering-controls","qualitative-controls","guidance"].includes(b.action??"")&&g.length)throw Error("主智能体原文选择没有冻结来源支持");if(["engineering-controls","qualitative-controls"].includes(b.action??"")&&!a.sharedPlan)throw Error("工程控制缺少本轮同版共享计划,不能声明新来源已经可以写入");let h="qualitative-controls"===b.action?await (0,L.lj)(b.qualitativeControls,{project:a.project,sources:d,task:l,criteria:C,taskId:c,planId:a.sharedPlan.id,decisionId:H,diagnostics:a.diagnostics,signal:a.signal,reviewer:a.engineeringReviewer}):void 0;if(h){let a=new Set(h.controls.flatMap(a=>a.evidence.map(a=>a.sourceId)));if(b.factIds.length||a.size!==g.length||g.some(b=>!a.has(b)))throw Error("定性决定来源清单与实际证据不一致");v=h.sourceApplicationReceipt,u=h.review}else if(void 0!==b.qualitativeControls)throw Error("非定性决定不能附加未核定采用许可");let i="engineering-controls"===b.action?await w(b.controls,{project:a.project,sources:d,task:l,taskId:c,planId:a.sharedPlan.id,decisionId:H,criteria:C,facts:F,diagnostics:a.diagnostics,signal:a.signal,reviewer:a.engineeringReviewer,cadReadings:f.filter(a=>"cad"===a.kind)}):void 0;if(i){let a=new Set(i.controls.flatMap(a=>a.evidence.map(a=>a.sourceId))),c=new Set(i.controls.flatMap(a=>a.derivation?.inputFactIds??[]));if(g.length!==a.size||g.some(b=>!a.has(b))||b.factIds.length!==c.size||b.factIds.some(a=>!c.has(a)))throw Error("工程裁决来源清单与实际控制项不一致");u=i.review}else if(void 0!==b.controls)throw Error("非工程裁决不能附加未经复核的控制项");let j=i?.controls.map(b=>{let{objectName:c,attribute:d,condition:f,value:g,instruction:h}=b,i=b.derivation,j=i?.inputFactIds.length===1&&"$0"===i.formula.replace(/\s/gu,"")?a.project.facts.find(a=>(0,e.vg)(a)===i.inputFactIds[0]&&a.objectName===c&&[a.fieldId,a.fieldName,a.key,(0,e.nD)(a)?.key,(0,e.nD)(a)?.label,...(0,e.nD)(a)?.aliases??[]].some(a=>a&&(0,p.K3)(a)===(0,p.K3)(d))&&(0,p.K3)(a.value)===(0,p.K3)(g)):void 0,l=j&&(0,k.mk)(a.project,(0,e.vg)(j)).factIndex;return{objectName:c,attribute:d,condition:f,value:g,instruction:h,authorReferences:"number"==typeof l?{factIndices:[l]}:i?{derivedNumbers:[{formula:i.formula,inputFactIndices:i.inputFactIds.map(b=>(0,k.mk)(a.project,b).factIndex),basis:i.basis}]}:{sourceIndices:[...new Set(b.evidence.map(a=>a.sourceIndex))]}}}),m=h?.controls.map(({evidence:b,...c})=>{let d=b.map(b=>(0,k.mk)(a.project,void 0,b.sourceId).sourceIndex);if(d.some(a=>"number"!=typeof a))throw Error("定性决定来源没有本轮完整原文序号");return{...c,authorReferences:{sourceIndices:[...new Set(d)]}}}),n=i?`以下控制已独立复核,只用于指定对象及工况。按authorReferences在实际正文片段登记对应类型:factIndices引用既定事实,derivedNumbers登记算式,sourceIndices仅用于原文直接控制。证明中的范围句不支持派生或既定单值,不能给它们另挂原文索引;不把裁决身份当作新事实来源:${JSON.stringify(j)}`:h?`以下具体定性决定已经独立核定,严格保持各自category与适用对象条件;source-obligation-only不授当前选型或施工量。实际正文仍登记sourceIndices并逐次终评,不把许可当事实:${JSON.stringify(h.controls.map(b=>({...b,evidence:b.evidence.map(b=>({...b,...(0,k.mk)(a.project,void 0,b.sourceId)}))})))}`:"use-sources"===b.action?`以下是完整冻结原文,保留条件与来源,须判断适用性后编写;不自动转为已确认的项目单值:${JSON.stringify(d.filter(a=>g.includes(a.sourceId)))}`:"use-facts"===b.action?`采用冻结模型中的下列事实及其适用对象,不扩大其范围:${JSON.stringify(F.filter(a=>b.factIds.includes(a.factId)))}`:b.answer;return i&&(v=i.sourceApplicationReceipt),{decisionId:H,taskId:c,action:b.action,answer:n,factIds:b.factIds,...g.length?{sourceIds:g}:{},...i?{controls:i.controls,writingControls:j}:{},...h?{qualitativeControls:h.controls,writingQualitativeControls:m}:{},reason:b.reason,source:"model"}};try{let b=(a,b,c)=>{x=a,y=b,z=c,s=b.at(-1)},c=a.reviewer?await A({project:a.project,prompt:G,initialSourceQueries:d.sourceQueries??[],readCad:a.readCad,onProgress:b,ask:a.reviewer}):await I({project:a.project,prompt:G,initialSourceQueries:d.sourceQueries??[],readCad:a.readCad,readWorkPackages:b=>(0,o.HV)(a.project,b),onProgress:b,diagnostics:a.diagnostics,signal:a.signal,validateSubmission:async(a,b,c)=>{B=await M(a,b,c)}});if(s=c.raw,x=c.reads,y=c.attempts,t=B??await M(s,c.sources,c.reads),a.signal?.throwIfAborted(),["engineering-controls","qualitative-controls"].includes(t.action)){if(!v)throw Error("本次工程控制没有同版来源用途证明,未执行");(0,K.WI)(a.project,v)}}catch(b){if(a.signal?.aborted)throw b;t={decisionId:H,taskId:c,action:"unmeasured",answer:"本次主控裁决未通过,未核定新的事实或技术决定;不能据此认定需要用户确认。实质技术问题须具体说明对象和工况后重新查询;已完成的正文交submit_author_task,不能以本回执代替内容验收。",factIds:[],reason:b instanceof Error?b.message:String(b),source:"model-rejected"}}return a.onReceipt({decision:t,question:d,inputHash:N(G),raw:s??null,...x?{reads:x,attempts:y,readingProtocolErrors:z}:{},...void 0===u?{}:{engineeringReview:u},...["engineering-controls","qualitative-controls"].includes(t.action)&&v?{sourceApplicationReceipt:v}:{}}),b=a.diagnostics,n={at:c,decisionId:H,action:t.action,reason:t.reason,readings:d.question,source:t.source,execution:"model-rejected"===t.source?"unlanded":"performed",executionNote:"model-rejected"===t.source?"模型裁决未通过,未执行新的技术决定,不登记为人工资料缺口":"通过工具回执返回当前作者;正文是否采用由候选与合同评价核对"},b&&(b.supervisorDecisionLog??=[]).push(n),t})();return b.set(r,t),t}})}},31859:(a,b,c)=>{c.d(b,{IS:()=>i});var d=c(96770);c(29021),c(33873);var e=c(19668),f=c(43967);let g=globalThis,h=g.__customizeConfigStores??=new Map;function i(){(0,f.jF)();let a=(0,e.J0)();return h.has(a)||h.set(a,new d.ConfigStore(a)),h.get(a)}},33972:(a,b,c)=>{function d(a,b){return a.criteria.filter(a=>a.sectionId===b&&a.applicable)}function e(a,b){if(!Array.isArray(b)||b.some(b=>!Number.isSafeInteger(b)||b<0||b>=a.length)||new Set(b).size!==b.length)throw Error("职责序号必须唯一且属于当前委派任务");return b.map(b=>a[b])}c.d(b,{C:()=>d,resolveAuthorCriterionIndices:()=>e})},34027:(a,b,c)=>{c.d(b,{RT:()=>g,Ri:()=>f,zV:()=>h});var d=c(77598),e=c(73123);function f(a,b){return(0,e.gM)(a),Object.fromEntries(Object.entries(b).map(([b,c])=>{let e=a.sources[b],f=a.documents.find(a=>a.sourceFile===b);if(!e||!f||e.sourceSha256!==c.sourceSha256||e.parsedSha256!==c.parsedSha256)throw Error(`一致性来源上下文与冻结解析/源身份不一致:${b}`);let g=a.decisions.filter(a=>a.currentSourceFiles.includes(b)||a.candidateSourceFiles.includes(b)||f.domainDependencies.some(b=>b.family===a.family&&b.domain===a.domain)),h=a.declarations.filter(a=>a.sources.some(a=>a.sourceFile===b)||g.some(b=>b.declarationIds.includes(a.id))),i={version:"tender-source-context-v3",policyVersion:a.version,policyId:a.policyId,assetFingerprint:a.assetFingerprint,sourceIdentity:structuredClone(e),document:structuredClone(f),declarations:structuredClone(h),decisions:structuredClone(g),applicability:g.map(a=>({family:a.family,domain:a.domain,status:a.status,current:a.currentSourceFiles.includes(b),candidate:a.candidateSourceFiles.includes(b)}))};return[b,{...i,contextFingerprint:(0,d.createHash)("sha256").update(JSON.stringify(i)).digest("hex")}]}))}function g(a){let{contextFingerprint:b,...c}=a;if("tender-source-context-v3"!==c.version||c.policyVersion!==e.xg||b!==(0,d.createHash)("sha256").update(JSON.stringify(c)).digest("hex")||![c.policyId,c.assetFingerprint,c.sourceIdentity?.sourceSha256,c.sourceIdentity?.parsedSha256].every(a=>/^[a-f0-9]{64}$/u.test(a))||!c.document?.sourceFile?.trim()||!Array.isArray(c.document.editionScopes)||!Array.isArray(c.document.scopeEvidenceChunks)||c.document.families.some(a=>!c.document.editionScopes.some(b=>b.family===a))||c.document.scopeEvidenceChunks.some(a=>a.sha256!==(0,d.createHash)("sha256").update(a.text).digest("hex")))throw Error("职责来源适用资格缺少当前冻结源/解析/版本上下文身份或发行作用范围,或被改写")}function h(a){g(a);let b=a.document;return{document:{sourceFile:b.sourceFile,title:b.title,isClarification:b.isClarification,projectIdentifier:b.projectIdentifier,issuedAt:b.issuedAt,families:b.families,editionScopes:b.editionScopes.map(a=>({family:a.family,mode:a.mode,heading:a.heading})),domainDependencies:b.domainDependencies.map(a=>({family:a.family,domain:a.domain,quote:a.quote,authoritySources:a.authoritySources.map(a=>({sourceFile:a.sourceFile,quote:a.quote}))}))},declarations:a.declarations.map(a=>({id:a.id,family:a.family,domains:a.domains,quote:a.quote,issuedAt:a.issuedAt,projectIdentifier:a.projectIdentifier,title:a.title,sources:a.sources.map(a=>({sourceFile:a.sourceFile}))})),applicability:a.applicability,decisions:a.decisions.map(a=>({id:a.id,declarationId:a.declarationId,declarationIds:a.declarationIds,family:a.family,domain:a.domain,status:a.status,reason:a.reason,current:a.currentSourceFiles.includes(b.sourceFile),candidate:a.candidateSourceFiles.includes(b.sourceFile)}))}}},35821:(a,b,c)=>{c.d(b,{Eh:()=>f,Mv:()=>o,VN:()=>h,Iu:()=>i});var d=c(19898),e=c(73055);let f=.6,g=null;function h(){return g||(g=new d.LocalTransformersEmbeddingProvider({})),g}async function i(){if("1"!==process.env.DOCUMENT_SKIP_EMBED_PREFLIGHT)try{await h().embedQuery("生成前置检查")}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`本地语义模型预热失败(生成前置检查,可用 DOCUMENT_SKIP_EMBED_PREFLIGHT=1 跳过):${a}`,{cause:b})}}let j=new Map,k=0,l=0;async function m(a,b){let c=b?await b(a):await h().embedDocuments(a);if(c.length!==a.length)throw Error(`本地语义模型嵌入数量不一致:期望 ${a.length} 条,实际 ${c.length} 条`);return c}async function n(a,b){if("0"===process.env.DOCUMENT_EMBED_CACHE)return m(a,b);let c=Array(a.length),d=[],e=new Map;for(let b=0;b<a.length;b+=1){let f=a[b];if(f.length<=2e3){let a=j.get(f);if(a){c[b]=a,k+=1,j.delete(f),j.set(f,a);continue}}let g=e.get(f);g?g.push(b):(e.set(f,[b]),d.push(f))}if(0===d.length)return c;let f=await m(d,b),g=function(){let a=Number(process.env.DOCUMENT_EMBED_CACHE_SIZE||4e4);return Number.isFinite(a)&&a>0?a:4e4}();for(let a=0;a<d.length;a+=1){let b=d[a],h=f[a],i=e.get(b);for(let a of i)c[a]=h;if(b.length<=2e3&&(l+=i.length,j.set(b,h),j.size>g)){let a=j.keys().next().value;void 0!==a&&j.delete(a)}}return c}async function o(a,b,c){if(0===a.length||0===b.length)return()=>0;let d=[...a,...b],f=await n(d,c),g=new Map;for(let a=0;a<d.length;a++)g.has(d[a])||g.set(d[a],f[a]);return(a,b)=>{let c=g.get(a),d=g.get(b);return c&&d?(0,e.Om)(c,d):0}}},36372:(a,b,c)=>{c.d(b,{M8:()=>l,a0:()=>k,hM:()=>j});var d=c(35821),e=c(86697);let f=["对与评标活动有关的工作人员的纪律要求","评标委员会成员与投标人接触的限制","评标纪律与廉洁从业承诺要求","评审争议处理与投标澄清配合程序","评审结果确认与中标公示流程","评标办法与分值构成说明","异常低价评审与计算方式说明","清单计量与报价口径约定","投标文件实质性响应要求","投标保证金缴纳与退还程序","开标程序与投标文件递交截止时间","评标期间行为管控与资料闭环","预付款与进度款支付比例约定","履约担保与保证金缴纳退还约定","价格波动与合同价款调整约定","暂列金额与暂估价使用约定","税费计取与发票结算约定","违约责任与罚款赔偿条款"],g=["劳动力配置计划与高峰期人数安排","施工质量保证措施与验收标准","安全生产管理与教育培训要求","施工进度计划与关键线路安排","材料设备采购进场计划与检验要求","施工现场文明施工与环境保护管理","劳动纪律与班组作业管理制度","施工机械设备配置与维护保养计划","农民工工资支付保障与劳务实名制管理","材料采购质量证明与进场验收管理","工期承诺与进度考核奖惩管理"],h=/评标|投标|行贿|打招呼|递条子|廉洁|串标|围标|弄虚作假|干扰评标|纪律|澄清|中标|报价|清单计量|评审|保证金|开标|递交|争议|异常低价|评标基准价|预付款|进度款|担保|价格波动|材料调差|暂列金额|暂估价|计税|税金|发票|违约|业绩证明|类似(?:工程)?业绩|获奖|荣获|协会颁发|营业执照|资质证书|安全生产许可证|认证证书|管理体系认证|审计报告|信用等级|信用评价|社保证明|无行贿犯罪|中标查询|中标公示|中标结果|电子交易系统|公共资源交易|质疑投诉|评标委员会/u;function i(a){let b=a.sectionTitle?.trim()||"",c=(a.content||"").replace(/\s+/gu," ").slice(0,400);return b?`${b}。${c}`:c}function j(a){let b=a.sectionTitle?.trim()||a.content.replace(/\s+/gu,"").slice(0,60);return`${a.filePath}::${b}`}async function k(a,b){if(0===a.length)return{safe:[],excluded:[]};let c=a.filter(a=>h.test(i(a)));if(0===c.length)return{safe:[...a],excluded:[]};let e=c.map(i),j=await (0,d.Mv)(e,[...f],b),k=await (0,d.Mv)(e,[...g],b),l=new Set;for(let a of c){let b=i(a),c=Math.max(...f.map(a=>j(b,a))),d=Math.max(...g.map(a=>k(b,a)));c>=.6&&c>d&&l.add(a)}return{safe:a.filter(a=>!l.has(a)),excluded:[...l]}}async function l(a){return(0,e.A)({prototypes:[...f],negativePrototypes:[...g],threshold:.6,embedDocuments:a})}},36594:(a,b,c)=>{c.d(b,{LA:()=>k,Yn:()=>i,ZB:()=>j,eW:()=>l});var d=c(77598),e=c(97979),f=c(83653),g=c(57268);let h=a=>(0,d.createHash)("sha256").update(a).digest("hex");function i(a,b){let c=new Map;for(let b of a){let a=[...b.content.matchAll(/(?:发布日期|发布于|出具日期|印发日期)\s*[::]?\s*(20\d{2})\s*年\s*(\d{1,2})\s*月\s*(\d{1,2})\s*日/gu)].map(a=>`${a[1]}-${a[2].padStart(2,"0")}-${a[3].padStart(2,"0")}`);a.length&&c.set(b.filePath,[...c.get(b.filePath)??[],...a])}let g=a.flatMap(a=>{if(!["tender_document","addendum","tender","clarification","tender_text"].includes(a.roleId??""))return[];let d=b.sources[a.filePath];if(!d||void 0===a.chunkIndex)return[];let f=b.documents.find(b=>b.sourceFile===a.filePath),g=c.get(a.filePath)??[];return(0,e.Su)([{text:a.content,source:`${a.filePath} ${a.sectionTitle??""}`}]).filter(a=>a.openingDate&&"reference"!==a.openingDate.role).map(b=>({candidate:b,item:a,source:d,projectIdentifier:f?.projectIdentifier??null,issuedAt:1===new Set(g).size?g[0]:null,isClarification:f?.isClarification??!1}))}),i=new Map;for(let a of g){let b=a.candidate.openingDate,c=JSON.stringify([a.projectIdentifier,b.objectName,b.kind]),d=i.get(c)??[];d.push(a),i.set(c,d)}return[...i.values()].flatMap(a=>{let b,c=a.filter(a=>"current"===a.candidate.openingDate.role);if(!c.length)return[];let e=c.filter(a=>a.candidate.clarified),g=e.length&&c.every(a=>a.candidate.clarified||!a.isClarification)?e:c;if(new Set(g.map(a=>a.candidate.value)).size>1&&g.every(a=>a.issuedAt)){let a=[...g.map(a=>a.issuedAt)].sort().at(-1);g=g.filter(b=>b.issuedAt===a)}let i=(0,f.iC)({facts:[],overrides:[],labeledValues:g.map(a=>a.candidate)}).resolved.find(a=>"开工日期"===a.attribute);if(!i)return[];let j=g.find(a=>a.candidate.value===i.value&&i.evidence.some(b=>b.source===a.candidate.source));if(!j)return[];let k=j.candidate.openingDate,l=new Set(g.map(a=>a.candidate.value)).size>1||new Set(g.map(a=>(a.candidate.openingDate.condition??"").replace(/\s+/gu,""))).size>1,m=k.kind,n="planned"===m?"planned_start_date":"actual"===m?"actual_start_date":"construction_start_date",o="planned"===m?"计划开工日期":"actual"===m?"实际开工日期":"开工日期",p=[...new Set(l?a.filter(a=>"superseded"===a.candidate.openingDate.role).map(a=>a.candidate.value):[...i.superseded,...a.filter(a=>!g.includes(a)).map(a=>a.candidate.value)])].filter(a=>a!==i.value),q=a.map(a=>({value:a.candidate.value,sourceFile:a.item.filePath,chunkIndex:a.item.chunkIndex,quote:a.candidate.openingDate.quote}));return[{factId:`temporal:${(b=[n,k.objectName,j.item.filePath,j.item.chunkIndex,k.quote,i.value],(0,d.createHash)("sha256").update(JSON.stringify(b)).digest("hex")).slice(0,24)}`,fieldId:n,key:o,fieldName:o,objectName:k.objectName,value:i.value,confidence:l?.5:.95,sourceFile:j.item.filePath,roleId:j.item.roleId,processingType:j.item.processingType,sourceRef:{filePath:j.item.filePath,roleId:j.item.roleId,processingType:j.item.processingType,chunkIndex:j.item.chunkIndex,sectionTitle:j.item.sectionTitle,sourceSpan:k.quote,contextSpan:j.item.content},temporalConstraint:{event:"construction-start",kind:m,status:l?"unmeasured":"resolved",date:i.value,...k.condition?{condition:k.condition}:{},superseded:p,sourceSha256:j.source.sourceSha256,parsedSha256:j.source.parsedSha256,chunkSha256:h(j.item.content),quoteSha256:h(k.quote),history:q}}]})}function j(a,b){let c=b.filter(a=>a.temporalConstraint?.event==="construction-start"&&"planned"===a.temporalConstraint.kind&&"resolved"===a.temporalConstraint.status&&"项目主体"===a.objectName),d=1===new Set(c.map(a=>a.value)).size?c.slice(0,1):[];return{...a,facts:[...a.facts.filter(a=>"开工日期"!==(0,f.hf)(String(a.key??""),a.label)),...d.flatMap(a=>a.temporalConstraint.history.filter(b=>a.temporalConstraint.superseded.includes(b.value)).map(a=>({key:"开工日期",value:a.value,sourceFile:a.sourceFile})))],overrides:(a.overrides??[]).filter(a=>"date"!==(0,e.dm)(a.superseded)&&"date"!==(0,e.dm)(a.effective)),labeledValues:[...(a.labeledValues??[]).filter(a=>"开工日期"!==a.attribute),...d.map(a=>({attribute:"开工日期",value:a.value,source:`${a.sourceFile} ${a.sourceRef?.sectionTitle??""}`,clarified:!0,supersedesPriorMaterials:!1}))]}}function k(a){return a.filter(a=>a.temporalConstraint).map(a=>{let b=a.temporalConstraint,c="unmeasured"===b.status?"同一事件日期尚有未决值,须依据完整原文核定,不能任选一个日期或宣称已确定":`${a.fieldName}为${b.date};${"planned"===b.kind?"仅作进度计划起点,不得写成已确定的实际开工日":"保持该事件的原文性质"}`;return(0,g.v7)(`进度安排必须承接${a.objectName}的开工事件:${c}${b.condition?`;触发条件完整保留:${b.condition.replace(/\s+/gu,"")}`:""};仅采用现行事件口径,不新增工期或把通知条件删成固定日历承诺。`,JSON.stringify({type:"source-bound-temporal-fact",factId:a.factId,sourceFile:a.sourceFile,sourceRef:a.sourceRef,temporalConstraint:b}))})}function l(a,b){let c=(0,e.Su)([{text:a.text,source:"reviewed-duty"}]).filter(a=>a.openingDate).flatMap(c=>b.filter(b=>{let d=b.temporalConstraint,e=c.openingDate;return d?.status==="resolved"&&d.superseded.includes(c.value)&&b.objectName===e.objectName&&("unspecified"===e.kind||e.kind===d.kind)&&d.history.some(b=>b.value===c.value&&a.sources.some(a=>a.file===b.sourceFile))}).map(a=>({label:c,fact:a}))),d=new Map;for(let a of c){let b=a.label.openingDate,c=`${b.dateStartChar}:${b.dateEndChar}`,e=d.get(c)??[];e.push(a),d.set(c,e)}let f=a.text,g=[];for(let a of[...d.values()].sort((a,b)=>b[0].label.openingDate.dateStartChar-a[0].label.openingDate.dateStartChar)){if(1!==new Set(a.map(a=>a.fact.value)).size)continue;let{label:b,fact:c}=a[0],d=b.openingDate;f=f.slice(0,d.dateStartChar)+c.value+f.slice(d.dateEndChar),g.push(c)}let h=[...new Map(g.map(a=>[a.factId,a])).values()];return h.length&&(f+=`;该日期控制已经由当前完整来源更正,${h.map(a=>`${a.fieldName}仅采用${a.value}${"planned"===a.temporalConstraint.kind?"作为计划基准,不能转成实际固定开工日":""}${a.temporalConstraint.condition?`,保留${a.temporalConstraint.condition.replace(/\s+/gu,"")}`:""}`).join(";")}`),{text:f,factIds:h.map(a=>a.factId),sources:h.map(a=>({factId:a.factId,sourceFile:a.sourceFile,sourceRef:a.sourceRef,temporalConstraint:a.temporalConstraint}))}}},41240:(a,b,c)=>{c.d(b,{E6:()=>f,Zw:()=>e});var d=c(76875);let e=["task","organization","labor","equipment","materials","schedule","deployment"];function f(a,b,c,g={}){let h=b.find(a=>a.id===c),i=a.tasks.find(a=>a.taskId===c);if(!h||!i)throw Error("共享工程计划查询不属于当前实际任务");let j=g.view??(/工资|实名|检验|储存|保管|安全管理|应急保障|管理制度/u.test(h.title)?"organization":/工期|进度|网络计划/u.test(h.title)?"schedule":/劳动力|工种|班组配置/u.test(h.title)?"labor":/机械|机具|设备配置/u.test(h.title)?"equipment":/材料|物资/u.test(h.title)?"materials":/部署|总体安排|组织安排/u.test(h.title)?"deployment":h.contentTypes.includes("schedule")?"schedule":"task");if(!e.includes(j))throw Error("共享工程计划查询视图无效");if(g.activityIds&&(!Array.isArray(g.activityIds)||!g.activityIds.length||g.activityIds.some(b=>!a.production.activities.some(a=>a.input.id===b))))throw Error("须使用共享计划目录中的真实活动身份");let k=a.production.activities.filter(b=>g.activityIds?g.activityIds.includes(b.input.id):"task"!==j||b.input.taskIndices.some(b=>a.tasks[b]?.taskId===c)),l=new Set(k.map(a=>a.input.id)),m=a.production.plannedResources.filter(a=>l.has(a.activityId)),n=[],o=new Map,p=(0,d.wp)(a.production,b.map(a=>a.id)).filter(a=>(!a.activityId||l.has(a.activityId))&&("task"===j||"organization"===j||"materials"===j?"task"===j:"window"===a.purpose||"organization"===a.purpose||a.purpose===j||"deployment"===j&&!a.activityId)).map(({taskIds:a,inputMemberIds:b,objectScope:c,basis:d,...e})=>{let f=o.get(d);return f||(f=`basis-${n.length}`,o.set(d,f),n.push({id:f,text:d})),{...e,basisId:f,...!e.activityId?{objectScope:c}:{}}}),q=k.map(a=>{if("task"===j)return a;let{input:b,status:c,startDay:d,endDay:e,startDate:f,endDate:g,durationDays:h,timeWindow:i,workTimeWindow:k,critical:l,floatDays:m}=a,n={id:b.id,phaseId:b.phaseId,objectScope:b.objectScope,workfront:b.workfront,status:c};return"organization"===j||"materials"===j?n:{...n,predecessors:b.predecessors,startDay:d,endDay:e,startDate:f,endDate:g,durationDays:h,timeWindow:i,workTimeWindow:k,critical:l,floatDays:m}}),r=m.map(a=>{let{activityId:b,phaseId:c,objectScope:d,workfront:e,basis:f}=a,g={activityId:b,phaseId:c,objectScope:d,workfront:e,basis:f};return"task"===j?a:"organization"===j||"materials"===j?{...g,trades:a.workers.map(a=>a.trade),equipment:a.equipment.map(({name:a,spec:b})=>({name:a,spec:b}))}:"labor"===j?{...g,crewId:a.crewId,crews:a.crews,shiftsPerDay:a.shiftsPerDay,workers:a.workers,countMeaning:"每日配置含不同轮班人员,非同时在岗峰值"}:"equipment"===j?{...g,crewId:a.crewId,crews:a.crews,equipment:a.equipment}:{...g,crewId:a.crewId,crews:a.crews,shiftsPerDay:a.shiftsPerDay,trades:a.workers.map(a=>a.trade),equipment:a.equipment.map(({name:a,spec:b})=>({name:a,spec:b}))}});return{id:a.id,contractId:a.contractId,projectSnapshotId:a.projectSnapshotId,phases:a.phases,activityDirectory:a.production.activities.map(({input:a})=>({id:a.id,phaseId:a.phaseId,objectScope:a.objectScope,workfront:a.workfront})),view:j,activities:q,plannedResources:r,numbers:p,bases:n,numberMeaning:"index指向同源完整数记录;活动对象见activityId对应活动,basisId见bases原文。对象与依据只存一份,不裁字;组织管理视图不要求数量。",..."schedule"===j||"deployment"===j||"task"===j?{calendar:a.production.calendar}:{},..."labor"===j?{labor:a.production.labor}:{},..."equipment"===j?{equipment:a.production.equipment}:{},..."materials"===j?{materials:a.production.materials.filter(a=>l.has(a.activityId)),materialStatus:"逐源用途记录,不等于已采用采购总量"}:{},issues:a.production.issues.filter(a=>!a.activityId||l.has(a.activityId)),scope:{taskId:c,activityIds:[...l],completeSelectedView:!0},task:i,interfaces:a.tasks.filter(a=>a.taskId!==c&&a.phaseIds.some(a=>i.phaseIds.includes(a))).map(({taskId:a,objectScope:b,boundary:c,handoffs:d})=>({taskId:a,objectScope:b,boundary:c,handoffs:d}))}}},42948:(a,b,c)=>{c.d(b,{Fr:()=>k,HM:()=>l,Hf:()=>n,tv:()=>m,wE:()=>o,yW:()=>p});var d=c(73024),e=c.n(d),f=c(76760),g=c.n(f),h=c(77598);let i=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u,j=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u;function k(a,b){return b?`run:${b}:${a}`:a}function l(a,b,c){if(!j.test(b))throw Error("非法运行资产文件名");if(void 0!==c&&!i.test(c))throw Error("非法运行 ID");return c?g().join(a,"runs",c,"artifacts",b):g().join(a,"assets",b)}function m(a,b,c,d){let f=l(a,b,d),i=JSON.stringify(c);if(void 0===i)throw Error("运行资产不能是 undefined");e().mkdirSync(g().dirname(f),{recursive:!0});let j=`${f}.${(0,h.randomUUID)()}.tmp`;e().writeFileSync(j,i,{encoding:"utf8",flag:"wx"});try{if(d)try{e().linkSync(j,f)}catch(a){if("EEXIST"!==a.code)throw a;if(e().readFileSync(f,"utf8")!==i)throw Error(`运行资产已存在且内容不同:${d}/${b}`,{cause:a})}else e().renameSync(j,f)}finally{e().rmSync(j,{force:!0})}return{assetPath:f,bytes:Buffer.byteLength(i),sha256:(0,h.createHash)("sha256").update(i).digest("hex")}}function n(a){if(!a.runId)throw Error("实时模型进度必须绑定当前运行 ID");let b=l(a.generatedDir,"llm-live-progress.json",a.runId),c=JSON.stringify({...a.snapshot,version:1,runId:a.runId,documentId:a.documentId});e().mkdirSync(g().dirname(b),{recursive:!0});let d=`${b}.${(0,h.randomUUID)()}.tmp`;e().writeFileSync(d,c,{encoding:"utf8",flag:"wx"});try{e().renameSync(d,b)}finally{e().rmSync(d,{force:!0})}}function o(a,b){return b?[["run-start","run-start.json","本轮启动身份"],["run-inputs","run-inputs.json","本轮已准备输入快照"],["project-model","project-model.json","本轮写作与终检共用的项目事实快照"],["tender-requirements","tender-requirements.json","本轮原始招标条款、技术职责拆分、商务归宿及未裁决台账"],["document-contract","document-contract.json","本轮写作前冻结的职责、义务与七维评价合同"],["contract-ownership-plan","contract-ownership-plan.json","主控逐项确认事实、表格与交付义务的唯一主要责任小节"],["content-type-plan","content-type-plan.json","本轮主控对各节具体内容职责与适用类型的确认回执"],["contract-quality","contract-quality.json","本轮固定合同、项目快照和正文版本的七维评价回执"],["writing-task-hierarchy","writing-task-hierarchy.json","锁定交付小节与专业作者子任务之间的固定层级"],["chapter-writing-structures","chapter-writing-structures.json","本轮作者任务开始前的固定结构和内容职责"],["author-task-executions","author-task-executions.json","实际作者实例、委派任务、完整输入身份、执行终态与共用章节预算"],["author-accounting-final","author-accounting-final.json","同一合同跨续跑累计的调用、token、成本与章节预算消耗"],["author-candidates","author-candidates.json","本轮工具执行、自检、清理及重试前的原始模型返回索引"],["document-token-anomaly","document-token-anomaly.json","本轮无有效进展的重复模型消费与整份暂停回执;缺usage和供应商结算保持未知"],["document-model-final","document-model-final.json","本轮统一文档模型的最终版本与全部累计修改记录"],["contract-quality-c0","contract-quality-c0.json","固定首稿的完整七维评价,后续修改不能覆盖"],["contract-light-repair","contract-light-repair.json","统一预算内轻修的预检、提交结果与首稿通过读数"],["document-model-author","document-model-author.json","本轮固定任务的结构化作者模型、初始候选与累计修改账"],["blueprint","blueprint.json","本轮写作蓝图"],["requirement-assignments","requirement-assignments.json","本轮要求责任分配"],["structure-assignments","structure-assignments.json","本轮呈现要求分配"],["before-global-review","before-global-review.json","全文审查前章节快照(含章内重试,不等于原始首稿)"],["before-finalize","before-finalize.json","收口前章节快照"],["final-document","final-document.json","本轮最终内容快照"],["run-summary","run-summary.json","本轮阶段墙钟、调用用途与历史评分读数"]].flatMap(([c,d,f])=>{let g=l(a,d,b);if(!e().existsSync(g))return[];let i=(0,h.createHash)("sha256").update(e().readFileSync(g)).digest("hex");return[{id:k(c,b),artifactKind:c,type:"file",role:"attachment",path:g,sha256:i,runId:b,status:"generated",message:f}]}):[]}function p(a){if(!a.runId)return;let b=a.chapters.map(a=>({id:a.id,title:a.title,content:a.content,contentHash:(0,h.createHash)("sha256").update(a.content).digest("hex")}));m(a.generatedDir,`${a.stage}.json`,{version:1,runId:a.runId,documentId:a.documentId??null,stage:a.stage,capturedAt:Date.now(),chapters:b,...void 0!==a.markdown?{markdown:a.markdown}:{},rawFirstCandidate:!1},a.runId)}},43255:(a,b,c)=>{c.d(b,{X4:()=>j,Yn:()=>i});var d=c(77598),e=c(16646),f=c(55422);function g(a,b){let c=a.trim();if(/^其他$|^其他工程$/u.test(c)){let a=b.map(a=>a.name);return a.some(a=>/彩绘|护栏|围栏|小品|标识|标牌|墙面|整治/u.test(a))?"环境整治工程":a.some(a=>/绿化|栽植|铺装|种植/u.test(a))?"景观附属工程":a.some(a=>/拆除|清理|清淤|清运/u.test(a))?"清理整治工程":"零星工程"}return/^其他装饰/u.test(c)?"零星装饰工程":/^措施项目$/u.test(c)?b.map(a=>a.name).some(a=>/化粪池|吊装|安装/u.test(a))?"模板、脚手架及化粪池安装工程":"模板与脚手架工程":/墙[、,]?柱面装饰/u.test(c)?b.some(a=>/幕墙|隔断/u.test(a.name))?c:"墙柱面装饰工程":c}function h(a,b,c=!1){let d=new Map;for(let b of a.entries){if(!b.section)continue;let a=c?JSON.stringify([b.sourceFile,b.villageGroup,b.section]):b.section,e=d.get(a)||[];e.push(b),d.set(a,e)}let e=[],f=0;for(let a of d.values()){let c=g(a[0].section,a),d=a.some(a=>"unit-project"===a.sectionKind),h=[];if(d){let b=new Map;for(let d of a){let a=d.subsection||c,e=b.get(a)||[];e.push(d),b.set(a,e)}for(let[a,c]of b)h.push(k(g(a,c),c))}else h.push(k(c,a));f+=1,e.push({id:`${b}.${f}`,title:c,requiredParams:h.flatMap(a=>Object.keys(a.quantities).slice(0,5).map(a=>({path:`data.quantities.${a}`,mode:"must_cite",strict:!0}))),tablePlans:[],workPackages:h})}return e}function i(a){let{chapterTitles:b,boq:c}=a,d=b.map((b,d)=>{var e;let f=String(d+1),g=/主要分部分项|施工方案|施工方法/u.test(b)?h(c,f):[];return{id:f,title:b,isActive:(e=a.docType,!(/专项施工方案|专项方案|危大/u.test(e)&&/总平面|平面布置|施工部署|总体部署/u.test(b))),requiredParams:[],subSections:g}}),e=h(c,"project",!0).flatMap(a=>a.workPackages),f=c.entries.filter(a=>!a.section);return f.length&&e.push(k("未分部清单记录",f)),{chapters:d,projectWorkPackages:e}}function j(a){return(0,d.createHash)("sha256").update(JSON.stringify([a.sourceFile,a.villageGroup,a.section,a.subsection,a.seq,a.code,a.name,a.description,a.unit,a.quantity,a.chunkIndex])).digest("hex")}function k(a,b){let c=[...b].sort((a,b)=>a.seq-b.seq),d={},g=new Map;for(let a of c){if(!a.name)continue;let b=g.get(a.name)??new Map;b.set(a.unit,(b.get(a.unit)??0)+a.quantity),g.set(a.name,b)}for(let[a,b]of g)for(let[c,e]of b)d[b.size>1?`${a}(${c||"未注明单位"})`:a]={value:Math.round(1e3*e)/1e3,unit:c};let h=[...new Set(c.map(a=>a.name).filter(Boolean))],i=(0,f.lh)(c),k=[],l=new Set;for(let a of c){for(let b of(0,f.QU)(a.description)){let a=`${b.key}=${b.value}`;if(!l.has(a)&&(l.add(a),k.push({key:b.key,value:b.value,source:"boq"}),k.length>=24))break}if(k.length>=24)break}let m=[];for(let a of c)for(let b of(0,f.QU)(a.description))/压实|试验|检测|验收|闭水|合格/u.test(`${b.key}${b.value}`)&&m.length<12&&!m.includes(b.value)&&m.push(b.value);let n=(0,e.cn)(c.map(a=>a.name)),o=[];for(let a of(0===m.length&&n.length>0&&m.push(...n[0].acceptance.slice(0,6).map(a=>`${a}(知识卡)`)),n.slice(0,2)))for(let b of a.standards)o.includes(b)||o.push(b);return{name:a,kind:"major",quantities:d,objectNames:h,methods:i,params:k,acceptance:m,standards:o,source:"boq",coveredSeqs:c.map(a=>a.seq),members:c.map(a=>({id:j(a),entry:{...a}}))}}},43967:(a,b,c)=>{c.d(b,{b:()=>g,jF:()=>h});let d=globalThis,e=d.__customizeStorageMaintenance??={active:!1};d.__customizeStorageApiWriters??=new Set;class f extends Error{constructor(){super("系统清空正在执行,暂不接收新的存储访问"),this.name="StorageMaintenanceError"}}function g(){return e.active}function h(){if(e.active)throw new f}},44616:(a,b,c)=>{c.d(b,{bV:()=>f,lu:()=>h,mk:()=>g});var d=c(63327);let e=new WeakMap;function f(a){let b=e.get(a);if(!b){let c=[...a.facts,...a.sourceControls??[]],f=[...new Set(c.filter(a=>"verified-source-excerpt"!==a.roleId).map(d.vg))].sort(),g=[...new Set(c.filter(a=>"verified-source-excerpt"===a.roleId).map(d.vg))].sort();b={facts:f,sources:g,factIndices:new Map(f.map((a,b)=>[a,b])),sourceIndices:new Map(g.map((a,b)=>[a,b]))},e.set(a,b)}return b}function g(a,b,c){let d=f(a);return{...b&&d.factIndices.has(b)?{factIndex:d.factIndices.get(b)}:{},...c&&d.sourceIndices.has(c)?{sourceIndex:d.sourceIndices.get(c)}:{}}}function h(a,b,c){let d="fact"===b?f(a).facts:f(a).sources;if(!Number.isSafeInteger(c)||0>Number(c)||Number(c)>=d.length)throw Error(`${"fact"===b?"属性":"原文"}引用序号不属于当前冻结项目`);return d[Number(c)]}},44736:(a,b,c)=>{c.d(b,{FP:()=>q,H0:()=>k,U2:()=>j,_e:()=>z,eb:()=>A,fN:()=>m,hg:()=>l,oN:()=>r});var d=c(77598),e=c(19898),f=c(70247);let g=a=>(0,d.createHash)("sha256").update(JSON.stringify(a)).digest("hex"),h=a=>{let{rowSha256:b,...c}=a;return b===g(c)},i=a=>a.replace(/\s/gu,"");function j(a){let b=a.trim();if(!b.startsWith("|")||!b.endsWith("|"))return;let c=[],d="",e=!1;for(let a=1;a<b.length-1;a++){let f=b[a];"|"!==f||e?d+=f:(c.push(d.trim()),d=""),e="\\"===f&&!e}return c.push(d.trim()),c.length>=2?c:void 0}function k(a){let b=a[0]?.trim()??"";return/^(?:\d{1,3}(?:[..]\d{1,3}){1,4}|第[零一二三四五六七八九十百千\d]+[条款项])$/u.test(b)?b:void 0}function l(a,b,c){let{sha256:d,...f}=a;if("tender-native-file-proof-v1"!==a.version||a.file!==b||a.sourceChunkCount!==c||a.nativeLayoutVersion!==e.PDF_NATIVE_LAYOUT_VERSION||!/^[a-f0-9]{64}$/u.test(a.sourceSha256)||!/^[a-f0-9]{64}$/u.test(a.metadataSha256)||d!==g(f))throw Error("原生PDF表格文件证据身份不一致");return a.pages.flatMap(c=>{if(c.glyphSha256!==g(c.glyphs))throw Error("原生PDF字形回执不属于实际文件");if("fallback"===c.strategy)return[];if("ruled-cells"!==c.strategy)throw Error("原生PDF页面没有明确layout策略");let d=new Map(c.glyphs.map(a=>[a.id,a])),e=new Map,f=new Map;for(let a of c.cells){if(!Number.isSafeInteger(a.columnIndex)||a.columnIndex<0||!Number.isSafeInteger(a.columnSpan)||a.columnSpan<1||4!==a.bounds.length||!a.bounds.every(Number.isFinite)||a.bounds[0]>=a.bounds[2]||a.bounds[1]>=a.bounds[3])throw Error("原生表格物理合并单元格身份无效");for(let[b,c]of[[a.columnIndex,a.bounds[0]],[a.columnIndex+a.columnSpan,a.bounds[2]]]){let a=f.get(b);if(void 0!==a&&Math.abs(a-c)>1.5)throw Error("原生表格逻辑列与物理边界不一致");f.set(b,c)}let b=`${a.bounds[1]}:${a.bounds[3]}`;e.set(b,[...e.get(b)??[],a])}let h=[...e.values()].sort((a,b)=>b[0].bounds[3]-a[0].bounds[3]),i=Math.max(...c.cells.map(a=>a.columnIndex+a.columnSpan)),j=h.map(a=>{let b=Array(i).fill(""),c=0,e;for(let f of a.sort((a,b)=>a.columnIndex-b.columnIndex)){if(f.columnIndex!==c||void 0!==e&&Math.abs(f.bounds[0]-e)>1.5)throw Error("原生表格列范围重叠或缺失");c+=f.columnSpan,e=f.bounds[2],b[f.columnIndex]=f.glyphIds.map(a=>{let b=d.get(a);if(!b)throw Error("原生表格字形ID缺失");return b}).sort((a,b)=>2>=Math.abs(a.y-b.y)?a.x-b.x:b.y-a.y).map(a=>a.str).join("").replace(/\|/gu,"\\|")}if(c!==i)throw Error("原生表格列范围不完整");return b}),k=j[0]??[];return j.map((d,e)=>{let f={file:b,sourceSha256:a.sourceSha256,nativeProofSha256:a.sha256,page:c.page,row:e,rowCount:j.length,cells:d,bounds:h[e].map(a=>a.bounds),physicalCells:h[e],headers:k};return{...f,rowSha256:g(f)}})})}function m(a,b,c){let d=a.filter(a=>(void 0===c||a.page===c)&&a.cells.length===b.length&&a.cells.every((a,c)=>i(a)===i(b[c])));return 1===d.length?d[0]:void 0}let n=(a,b)=>{let c=j(b.rawText);return b.file===a.file&&!!c&&c.length===a.cells.length&&c.every((b,c)=>i(b)===i(a.cells[c]))},o=a=>(0,f.y)(a.map(({sourceGapBefore:a,sourceTableBridgeBefore:b,sourceNativeTextBridgeBefore:c,...d})=>d));function p(a,b){return h(a)&&h(b)&&a.file===b.file&&a.sourceSha256===b.sourceSha256&&a.nativeProofSha256===b.nativeProofSha256&&b.page===a.page+1&&a.row===a.rowCount-1&&1===b.row&&a.cells.length===b.cells.length&&a.cells.length>=2&&a.bounds.length===a.cells.length&&b.bounds.length===b.cells.length&&a.physicalCells.every((a,b)=>a.columnIndex===b&&1===a.columnSpan)&&b.physicalCells.every((a,b)=>a.columnIndex===b&&1===a.columnSpan)&&a.headers.length===b.headers.length&&a.headers.every((a,c)=>i(a)===i(b.headers[c]))&&a.bounds.every((a,c)=>1.5>Math.abs(a[0]-b.bounds[c][0])&&1.5>Math.abs(a[2]-b.bounds[c][2]))&&b.cells.slice(0,-1).every(a=>!i(a))&&!!i(b.cells.at(-1)??"")&&!!i(a.cells.at(-1)??"")&&!/[。!?!?;;][))】」》”’"']*$/u.test(a.cells.at(-1).trim())}function q(a,b,c,d){let{witnessSha256:e,...f}=a,h=d.flatMap((b,c)=>o([b])===a.fromSpanSha256?[c]:[]),i=d.flatMap((b,c)=>o([b])===a.toSpanSha256?[c]:[]),j=1===h.length&&1===i.length&&i[0]>=h[0]?d.slice(h[0],i[0]+1):[];if(!b||"native-table-page-bridge-v2"!==a.version||a.file!==c.file||a.file!==b.file||e!==g(f)||!p(a.from,a.to)||!j[0]||!j.at(-1)||!n(a.from,j[0])||!n(a.to,j.at(-1))||a.spansSha256!==o(j)||!j.includes(b)||!j.includes(c)||!a.transitions.some(a=>a.fromChunkIndex===b.chunkIndex&&a.toChunkIndex===c.chunkIndex&&a.fromChunkSha256===b.chunkSha256&&a.toChunkSha256===c.chunkSha256&&a.fromEnd===b.end&&a.toStart===c.start))throw Error("原生表格续行与完整layout/source spans证据不一致")}function r(a,b){let c=[...a];for(let a=0;a<c.length;a++){let d,e=c[a]?.nativeTableRow;if(!e)continue;let h=c.findIndex((b,c)=>c>a&&!!b.nativeTableRow&&0!==b.nativeTableRow.row&&b.file===e.file);if(h<0)continue;let k=c[h].nativeTableRow;if(!p(e,k)||c.slice(a+1,h).some(a=>a.nativeTableRow&&(0!==a.nativeTableRow.row||a.nativeTableRow.page!==k.page||a.nativeTableRow.nativeProofSha256!==e.nativeProofSha256)))continue;let l=a=>a.split(/\r?\n/u).filter(a=>a.trim()).every(a=>{let b=a.trim(),c=j(b);return/^#{1,6}\s+(?:PDF 第\s*\d+\s*页|PDF 原生网格表格区域|-?\d+-?)$/u.test(b)||"|"===b||!!c&&(c.every(a=>/^:?-{3,}:?$/u.test(a))||c.every((a,b)=>a===`列${b+1}`)||c.every((a,b)=>i(a)===i(k.headers[b]??"")))});if(c.slice(a+1,h).some(a=>!l(a.sourceSpans?.map(a=>a.rawText).join("\n")??a.text)))continue;let m=c[a],q=c[h],r=m.sourceSpans?.at(-1),s=q.sourceSpans?.[0];if(!r||!s||void 0===r.chunkIndex||void 0===s.chunkIndex)continue;let t=b.filter(a=>a.file===e.file&&a.chunkIndex>r.chunkIndex&&a.chunkIndex<s.chunkIndex).sort((a,b)=>a.chunkIndex-b.chunkIndex);if(t.length!==s.chunkIndex-r.chunkIndex-1)continue;let u=b.find(a=>a.file===e.file&&a.chunkIndex===r.chunkIndex),v=b.find(a=>a.file===e.file&&a.chunkIndex===s.chunkIndex);if(!u||!v)continue;let w=[{chunk:u,start:r.end,end:u.text.length},...t.map(a=>({chunk:a,start:0,end:a.text.length})),{chunk:v,start:0,end:s.start}];if(w.some(a=>!l(a.chunk.text.slice(a.start,a.end))))continue;let x=[r,...w.filter(a=>a.chunk.text.slice(a.start,a.end).trim()).map(({chunk:a,start:b,end:c})=>({file:e.file,chunkIndex:a.chunkIndex,section:"PDF表格页间原始布局",chunkSha256:a.sha256,sourceStartChar:a.startChar,sourceEndChar:a.endChar,start:b,end:c,rawText:a.text.slice(b,c),text:a.text.slice(b,c)})),...q.sourceSpans];try{d=function(a,b,c){if(!p(a,b)||!c[0]||!c.at(-1)||!n(a,c[0])||!n(b,c.at(-1)))throw Error("没有相邻页同表同列续行证据");let d=[];for(let a=1;a<c.length;a++){let b=c[a-1],e=c[a];if(b.chunkIndex!==e.chunkIndex){if(void 0===b.chunkIndex||e.chunkIndex!==b.chunkIndex+1)throw Error("表格续行不能跳过未保全的parse chunk");d.push({fromChunkIndex:b.chunkIndex,toChunkIndex:e.chunkIndex,fromChunkSha256:b.chunkSha256,toChunkSha256:e.chunkSha256,fromEnd:b.end,toStart:e.start})}}let e={version:"native-table-page-bridge-v2",file:a.file,sourceSha256:a.sourceSha256,nativeProofSha256:a.nativeProofSha256,from:a,to:b,fromSpanSha256:o([c[0]]),toSpanSha256:o([c.at(-1)]),spansSha256:o(c),transitions:d};return{...e,witnessSha256:g(e)}}(e,k,x)}catch{continue}let y=[...m.sourceSpans,...x.slice(1).map((a,b)=>a.chunkIndex!==x[b].chunkIndex?{...a,sourceTableBridgeBefore:d}:a)];c.splice(a,h-a+1,{...m,text:y.map(a=>a.text).join("\n"),nativeTableRow:k,sourceSpans:y,sourceSpansSha256:(0,f.y)(y)}),a--}return c}let s=a=>/^-?\d{1,4}-?$/u.test(i(a)),t=a=>{let{lineSha256:b,...c}=a;return b===g(c)};function u(a){let{sha256:b,...c}=a;if(a.nativeLayoutVersion!==e.PDF_NATIVE_LAYOUT_VERSION||b!==g(c))throw Error("原生普通页文件证据身份不一致");return a.pages.flatMap(b=>{if(b.glyphSha256!==g(b.glyphs))throw Error("原生普通页glyph指纹不一致");let c=[];for(let a of[...b.glyphs].filter(a=>a.str.trim()).sort((a,b)=>b.y-a.y||a.x-b.x)){let b=c.find(b=>Math.abs(b.y-a.y)<=Math.max(2,.45*a.height));b?b.glyphs.push(a):c.push({y:a.y,glyphs:[a]})}return c.map((d,e)=>{d.glyphs.sort((a,b)=>a.x-b.x);let f=d.glyphs.filter(a=>/[A-Za-z\p{Script=Han}]/u.test(a.str)),h={file:a.file,sourceSha256:a.sourceSha256,nativeProofSha256:a.sha256,page:b.page,pageGlyphSha256:b.glyphSha256,line:e,lineCount:c.length,text:d.glyphs.map(a=>a.str).join("").replace(/\|/gu,"\\|"),glyphIds:d.glyphs.map(a=>a.id),x:d.glyphs[0].x,xEnd:Math.max(...d.glyphs.map(a=>a.x+a.width)),y:d.y,height:Math.max(...d.glyphs.map(a=>a.height)),columnGap:d.glyphs.some((a,b)=>b>0&&a.x-d.glyphs[b-1].x-d.glyphs[b-1].width>2*Math.max(a.height,d.glyphs[b-1].height)),fontNames:[...new Set((f.length?f:d.glyphs).flatMap(a=>a.fontName?[a.fontName]:[]))].sort()};return{...h,lineSha256:g(h)}})})}let v=(a,b,c)=>{let d=(a=>{let b=j(a.rawText);if(b){if(!b.slice(0,-1).every(a=>!i(a)))return;return b.at(-1)}return a.rawText.trim().replace(/^#{1,6}\s+/u,"")})(b);if(b.file!==a.file||void 0===d)return!1;let e=i(d),f=i(a.text);return!!f&&("start"===c?e.startsWith(f):e.endsWith(f))};function w(a,b){let c=a[0],d=b[0];return c&&d&&i(c.text)===i(d.text)&&1.5>Math.abs(c.x-d.x)&&1.5>Math.abs(c.y-d.y)&&1.5>Math.abs(c.height-d.height)&&c.fontNames.join("|")===d.fontNames.join("|")?i(c.text):void 0}function x(a,b,c,d,e){let f,g=w(c,d),j=c.filter(a=>!s(a.text)&&i(a.text)!==g),k=d.filter(a=>!s(a.text)&&i(a.text)!==g),l=1.5>Math.abs(a.xEnd-b.xEnd)&&a.x>b.x&&j.some(c=>c.line<a.line&&1.5>Math.abs(c.x-b.x)&&c.fontNames.join("|")===b.fontNames.join("|")),m=1.5>Math.abs(a.x-b.x)||l,n=!!e&&h(e)&&e.file===b.file&&e.sourceSha256===b.sourceSha256&&e.nativeProofSha256===b.nativeProofSha256&&e.page===b.page&&1===e.row&&e.cells.slice(0,-1).every(a=>!i(a))&&i(e.cells.at(-1)??"").startsWith(i(b.text));return t(a)&&t(b)&&a.file===b.file&&a.sourceSha256===b.sourceSha256&&a.nativeProofSha256===b.nativeProofSha256&&b.page===a.page+1&&a.line===j.at(-1)?.line&&b.line===k[0]?.line&&m&&2>Math.abs(a.height-b.height)&&!a.columnGap&&!b.columnGap&&(n||l||!j.some(a=>a.columnGap)&&!k.some(a=>a.columnGap))&&a.fontNames.join("|")===b.fontNames.join("|")&&(f=b.text,!/^(?:第[零一二三四五六七八九十百\d]+[章条节]|[((]?[一二三四五六七八九十百\d]+[))]|[一二三四五六七八九十百\d]+[..、])/u.test(f.trim()))&&!!i(a.text)&&!!i(b.text)&&!/[。!?!?;;::][))】」》”’"']*$/u.test(a.text.trim())}function y(a,b){let c=new Set([...b.fromPageLines,...b.toPageLines].filter(a=>s(a.text)).map(a=>i(a.text)));return a.split(/\r?\n/u).filter(a=>a.trim()).every(a=>{let d=a.trim(),e=i(d.replace(/^#{1,6}\s+/u,"")),f=/^#{1,6}\s+PDF 第\s*(\d+)\s*页$/u.exec(d),g=j(d);return f?Number(f[1])===b.from.page||Number(f[1])===b.to.page:!!c.has(e)||!!b.repeatedHeader&&e===b.repeatedHeader||!!b.toGridRow&&(/^#{1,6}\s+PDF 原生网格表格区域$/u.test(d)||"|"===d||!!g&&g.length===b.toGridRow.cells.length&&(g.every(a=>/^:?-{3,}:?$/u.test(a))||g.every((a,b)=>a===`列${b+1}`)||g.every((a,c)=>i(a)===i(b.toGridRow.headers[c]??""))))})}function z(a,b,c,d){let{witnessSha256:e,...f}=a,h=function(a,b){let c=b.flatMap((b,c)=>o([b])===a.fromSpanSha256?[c]:[]),d=b.flatMap((b,c)=>o([b])===a.toSpanSha256?[c]:[]);return 1===c.length&&1===d.length&&d[0]>=c[0]?b.slice(c[0],d[0]+1):[]}(a,d);if(!b||"native-text-page-bridge-v1"!==a.version||a.file!==c.file||a.file!==b.file||e!==g(f)||!t(a.from)||!t(a.to)||a.to.page!==a.from.page+1||a.from.file!==a.file||a.to.file!==a.file||!a.fromPageLines.every(t)||!a.toPageLines.every(t)||a.repeatedHeader!==w(a.fromPageLines,a.toPageLines)||!x(a.from,a.to,a.fromPageLines,a.toPageLines,a.toGridRow)||a.from.sourceSha256!==a.sourceSha256||a.to.sourceSha256!==a.sourceSha256||a.from.nativeProofSha256!==a.nativeProofSha256||a.to.nativeProofSha256!==a.nativeProofSha256||!h[0]||!h.at(-1)||!v(a.from,h[0],"end")||!v(a.to,h.at(-1),"start")||a.toGridRow&&!n(a.toGridRow,h.at(-1))||a.spansSha256!==o(h)||!function(a,b,c,d){let e=d.indexOf(b);return!(e<0)&&d[e+1]===c&&void 0!==b.chunkIndex&&void 0!==c.chunkIndex&&!(c.chunkIndex<b.chunkIndex)&&!(c.chunkIndex>b.chunkIndex+1)&&(b.chunkIndex!==c.chunkIndex||b.chunkSha256===c.chunkSha256&&!(b.end>c.start))&&a.transitions.some(a=>a.fromChunkIndex===b.chunkIndex&&a.toChunkIndex===c.chunkIndex&&a.fromChunkSha256===b.chunkSha256&&a.toChunkSha256===c.chunkSha256&&a.fromEnd===b.end&&a.toStart===c.start)}(a,b,c,h)||h[0].chunkIndex===h.at(-1).chunkIndex&&(h.some(a=>a.chunkIndex!==h[0].chunkIndex||a.chunkSha256!==h[0].chunkSha256)||h.slice(1,-1).some(b=>!y(b.rawText,a))))throw Error("原生普通页续行与实际glyph/layout/source spans证据不一致")}function A(a,b,c,d){let e=c.flatMap(u),h=[...a],k=new Map,l=new Map,m=new Map,p=(a,b)=>JSON.stringify([a,b]);for(let a of e){let b=p(a.file,a.page);k.set(b,[...k.get(b)??[],a])}for(let a of[...b].sort((a,b)=>(a.file??"").localeCompare(b.file??"")||(a.chunkIndex??-1)-(b.chunkIndex??-1))){let b=a.file??"",c=[...a.text.matchAll(/^#{1,6}\s+PDF 第\s*(\d+)\s*页/gmu)].map(a=>({start:a.index,page:Number(a[1])}));l.set(p(b,a.chunkIndex),{initial:m.get(b),markers:c}),c.length&&m.set(b,c.at(-1).page)}let q=a=>{let b=l.get(p(a.file,a.chunkIndex));return b?.markers.filter(b=>b.start<a.start).at(-1)?.page??b?.initial},r=(a,b)=>(k.get(p(a.file,q(a)))??[]).filter(c=>v(c,a,b));for(let a=0;a<h.length;a++){let c=h[a],e=c.sourceSpans;if(!e)continue;let l=-1,m;for(let a=e.length-1;a>=0;a--){let b=r(e[a],"end").filter(a=>!s(a.text));if(1===b.length){l=a,m=b[0];break}}if(!m)continue;let t=k.get(p(m.file,m.page))??[],u=k.get(p(m.file,m.page+1))??[],z=w(t,u),A=u.find(a=>!s(a.text)&&i(a.text)!==z);if(!A)continue;let B=h.findIndex((b,c)=>c>a&&b.file===m.file&&b.sourceSpans?.[0]&&v(A,b.sourceSpans[0],"start")&&q(b.sourceSpans[0])===A.page);if(B<0)continue;let C=h[B],D=C.nativeTableRow,E=D&&1===D.row&&D.cells.slice(0,-1).every(a=>!i(a))&&C.sourceSpans?.[0]&&n(D,C.sourceSpans[0])?D:void 0;if(!x(m,A,t,u,E)||!E&&(C.clauseNo||C.sourceSpans?.[0]?.logicalBoundaryBefore||/^[^::,,。;;“”"'()()]{1,40}[::]/u.test(A.text)||d&&!d(c,C)))continue;let F=a=>a.split(/\r?\n/u).filter(a=>a.trim()).every(a=>{let b=a.trim(),c=j(b),d=i(b.replace(/^#{1,6}\s+/u,""));return/^#{1,6}\s+(?:PDF 第\s*\d+\s*页|PDF 原生网格表格区域|-?\d+-?)$/u.test(b)||s(d)||!!z&&d===z||!!E&&"|"===b||!!c&&(c.every(a=>/^:?-{3,}:?$/u.test(a))||c.every((a,b)=>a===`列${b+1}`)||!!z&&i(c.join(""))===z)});if(h.slice(a+1,B).some(a=>!F(a.sourceSpans?.map(a=>a.rawText).join("\n")??a.text))||e.slice(l+1).some(a=>!F(a.rawText)))continue;let G=h[B],H=G.sourceSpans?.[0],I=e.at(-1);if(!H||!I||void 0===H.chunkIndex||void 0===I.chunkIndex||H.chunkIndex<I.chunkIndex)continue;let J=b.filter(a=>a.file===m.file&&a.chunkIndex>I.chunkIndex&&a.chunkIndex<H.chunkIndex).sort((a,b)=>a.chunkIndex-b.chunkIndex);if(J.length!==Math.max(0,H.chunkIndex-I.chunkIndex-1))continue;let K=b.find(a=>a.file===m.file&&a.chunkIndex===I.chunkIndex),L=b.find(a=>a.file===m.file&&a.chunkIndex===H.chunkIndex);if(!K||!L)continue;let M=I.chunkIndex===H.chunkIndex?[{chunk:K,start:I.end,end:H.start}]:[{chunk:K,start:I.end,end:K.text.length},...J.map(a=>({chunk:a,start:0,end:a.text.length})),{chunk:L,start:0,end:H.start}];if(M.some(a=>a.end<a.start||!F(a.chunk.text.slice(a.start,a.end))))continue;let N=M.filter(a=>a.chunk.text.slice(a.start,a.end).trim()).map(({chunk:a,start:b,end:c})=>({file:m.file,chunkIndex:a.chunkIndex,section:"PDF普通页间原始布局",chunkSha256:a.sha256,sourceStartChar:a.startChar,sourceEndChar:a.endChar,start:b,end:c,rawText:a.text.slice(b,c),text:a.text.slice(b,c)})),O=[...e.slice(l),...N,H],P=[],Q=!0,R=I.chunkIndex===H.chunkIndex;for(let a=1;a<O.length;a++){let b=O[a-1],c=O[a];if(b.chunkIndex!==c.chunkIndex||R){if(void 0===b.chunkIndex||void 0===c.chunkIndex||c.chunkIndex<b.chunkIndex||c.chunkIndex>b.chunkIndex+1||b.chunkIndex===c.chunkIndex&&(b.chunkSha256!==c.chunkSha256||b.end>c.start)){Q=!1;break}P.push({fromChunkIndex:b.chunkIndex,toChunkIndex:c.chunkIndex,fromChunkSha256:b.chunkSha256,toChunkSha256:c.chunkSha256,fromEnd:b.end,toStart:c.start})}}if(!Q)continue;let S={version:"native-text-page-bridge-v1",file:m.file,sourceSha256:m.sourceSha256,nativeProofSha256:m.nativeProofSha256,from:m,to:A,fromPageLines:t,toPageLines:u,...E?{toGridRow:E}:{},...z?{repeatedHeader:z}:{},fromSpanSha256:o([O[0]]),toSpanSha256:o([O.at(-1)]),spansSha256:o(O),transitions:P},T={...S,witnessSha256:g(S)};if(R&&O.slice(1,-1).some(a=>!y(a.rawText,T)))continue;let U=[...N,H],V=[...e,...U.map((a,b)=>R||a.chunkIndex!==(b?U[b-1]:I).chunkIndex?{...a,sourceNativeTextBridgeBefore:T}:a),...G.sourceSpans.slice(1)];h.splice(a,B-a+1,{...c,text:V.map(a=>a.text).join("\n"),sourceSpans:V,sourceSpansSha256:(0,f.y)(V)}),a--}return h}},45455:(a,b,c)=>{c.d(b,{Bj:()=>j,xj:()=>i});var d=c(77598);let e=new Set(["decisionId","requestId","toolCallId","capturedAt","recordedAt","startedAt","endedAt","finishedAt","elapsedMs","durMs","queryTimeMs"]);function f(a){return Array.isArray(a)?a.map(f):a&&"object"==typeof a?Object.fromEntries(Object.entries(a).filter(([a])=>!e.has(a)).sort(([a],[b])=>a.localeCompare(b)).map(([a,b])=>[a,f(b)])):a}let g=a=>(0,d.createHash)("sha256").update(JSON.stringify(f(a))).digest("hex"),h=a=>a&&"object"==typeof a&&!Array.isArray(a)?a:void 0;function i(a){return a.flatMap(a=>{let b=h(a.data);if(!a.ok||!b)return[];let c=h(b.directoryState);if("query_cad_context"===a.toolName&&["frames","instances"].includes(String(b.kind))&&c?.scope==="indexed-cad-directory"&&!0===c.complete&&0===c.recordCount&&"string"==typeof b.parsedIdentity&&"string"==typeof b.filePath)return[g(["empty-cad-directory",b.projectSnapshotId,b.filePath,b.parsedIdentity,b.kind])];if("ask_chief"===a.toolName){if("model"!==b.source)return[];let a=Object.fromEntries(("use-facts"===b.action?["factIds"]:"use-sources"===b.action?["sourceIds"]:"engineering-controls"===b.action?["controls","writingControls"]:"qualitative-controls"===b.action?["qualitativeControls"]:[]).filter(a=>Array.isArray(b[a])&&b[a].length>0).map(a=>[a,b[a]]));return Object.keys(a).length?[g(["chief-decision",b.taskId,b.action,a])]:[]}let d=Object.fromEntries(("query_construction_plan"===a.toolName?["activities","plannedResources","numbers","materials"]:"query_project_facts"===a.toolName?["candidates","sourceEvidence"]:"query_cad_context"===a.toolName?["records"]:"query_source_units"===a.toolName?["units"]:"read_source"===a.toolName?["chunks"]:["search_evidence","query_work_packages","discover_files"].includes(a.toolName)?["items"]:"list_skills"===a.toolName?["skills"]:"match_skills"===a.toolName?["matched"]:[]).flatMap(c=>{if(!Array.isArray(b[c]))return[];let d=b[c].filter(b=>{let c=h(f(b));return!!c&&!!Object.keys(c).length&&("read_source"!==a.toolName&&"search_evidence"!==a.toolName||"string"==typeof c.content&&!!c.content.trim())}),e="search_evidence"===a.toolName?d.map(a=>Object.fromEntries(Object.entries(h(a)).filter(([a])=>!["score","rank","retrievalRank","retrievalScore"].includes(a)))):d;return e.length?[[c,e]]:[]}));"load_skill"===a.toolName&&h(b.skill)&&(d.skill=b.skill);let e=Object.fromEntries(["snapshotId","projectSnapshotId","contractId",..."query_construction_plan"===a.toolName?["id"]:[],"filePath","relativePath","parsedIdentity","sceneVersion","kind","frameId","rootInstanceId","units","metadata","sourceVersionEligibility"].filter(a=>void 0!==b[a]).map(c=>[c,"metadata"===c&&"read_source"===a.toolName&&h(b[c])?Object.fromEntries(Object.entries(h(b[c])).filter(([a])=>!["mtime","indexedAt"].includes(a))):b[c]])),i=Object.entries(d).flatMap(([c,d])=>(Array.isArray(d)?d:[d]).map(d=>{let f=h(d);if("query_project_facts"===a.toolName&&f?.factId&&"verified-source-excerpt"!==f.roleId)return g(["project-fact",b.snapshotId??b.projectSnapshotId,f.factId,f.value,f.controlContext??null,h(f.sourceVersionEligibility)?.status??null]);if("query_project_facts"===a.toolName&&f&&(f.sourceEvidenceId||"verified-source-excerpt"===f.roleId))return g(["source-excerpt",b.snapshotId??b.projectSnapshotId,f.sourceEvidenceId??f.factId,f.value]);let i="query_construction_plan"===a.toolName&&"numbers"===c&&f?Object.fromEntries(Object.entries(f).filter(([a])=>"basisId"!==a)):d;return g(["source-material",a.toolName,e,c,i])}));return Number.isSafeInteger(b.offset)&&Number.isSafeInteger(b.nextOffset)&&Number(b.nextOffset)>Number(b.offset)&&i.push(g(["source-cursor",a.toolName,e,{offset:b.offset,nextOffset:b.nextOffset}])),i})}async function j(a){let b,{budget:c}=a,e=[...a.initialMessages],f=0,h=0,j="模型未产出可用正文",k="turns-exhausted",l=new Set(i(a.initialEvidence??[])),m=new Set,n=0,o=!1;for(let p=1;void 0===c.maxTurnsPerBlock||p<=c.maxTurnsPerBlock;p+=1){if(void 0!==c.maxToolCallsPerBlock&&f>=c.maxToolCallsPerBlock){j=`显式工具调用预算耗尽(${f}/${c.maxToolCallsPerBlock})`,k="tool-budget-exhausted";break}let q=await a.runTurn({system:a.system,messages:e,turn:p,...void 0!==c.maxToolCallsPerBlock?{toolCallLimit:Math.max(0,c.maxToolCallsPerBlock-f)}:{}});if(h=p,f+=q.toolCalls.length,q.refused)return a.onTurn?.({turn:p,residual:b?.residual??0,toolCalls:f,action:"unfixable"}),b?{kind:"unfixable",content:b.content,turn:p,residual:b.residual,toolCalls:f,reason:q.refused.message,issues:[],cause:"budget-refused"}:{kind:"budget_refused",turn:p,reason:q.refused.message,refused:q.refused};let r=i(q.toolResults??[]);q.protocolRecovery?.sentOutputBudget!==null&&q.protocolRecovery?.sentOutputBudget!==void 0&&r.push(g(["protocol-recovery",q.protocolRecovery.sentOutputBudget])),!o&&q.protocolRecovery?.kind==="invalid-tool-arguments"&&q.toolMessages?.some(a=>"assistant"===a.role&&a.toolCalls?.some(a=>"submit_author_task"===a.name))&&q.toolMessages.some(a=>"tool"===a.role&&a.content)&&(o=!0,r.push(g(["first-author-submission-syntax-feedback"])));let s=r.some(a=>!l.has(a));r.forEach(a=>l.add(a)),s&&(n=0);let t=q.committed||q.text;if(t?.trim()){let c=await a.check(t),g=c.issues.filter(a=>"error"===a.level||"blocker"===a.severity).length;if(c.degraded.length>0&&!c.executed.length)return a.onTurn?.({turn:p,residual:g,toolCalls:f,action:"unfixable"}),{kind:"unfixable",content:t,turn:p,residual:g,toolCalls:f,reason:`自查维度全部降级(${c.degraded.join("、")}),本块未做自查,保留当前草稿`,issues:c.issues,cause:"checks-degraded"};if(0===g&&!c.degraded.length)return a.onTurn?.({turn:p,residual:g,toolCalls:f,action:"commit"}),{kind:"passed",content:t,turn:p,residual:g,toolCalls:f};let h=(0,d.createHash)("sha256").update(JSON.stringify([t,c])).digest("hex"),i=m.has(h);if(m.add(h),(!b||g<b.residual)&&(b={content:t,residual:g}),i&&!s){j="相同候选与裁决重复,未取得新证据或改善",k="no-progress";break}a.onTurn?.({turn:p,residual:g,toolCalls:f,action:"regenerate"}),e=[...e,...q.toolMessages??[],{role:"assistant",content:t},{role:"user",content:function(a){let b=a.filter(a=>"error"===a.level||"blocker"===a.severity),c=b.slice(0,12).map((a,b)=>`${b+1}. ${a.detectorId?`[${a.detectorId}] `:""}${a.message}`),d=b.slice(12),e=new Map;for(let a of d){let b=a.detectorId||"(未标注判据)";e.set(b,(e.get(b)||0)+1)}return["【自查裁决】本稿未通过判据,下列问题必须修正后重新输出完整本节正文:",...c,d.length>0?`${d.length} 条未逐条列出,按判据分布:${[...e.entries()].map(([a,b])=>`${a} ${b} 条`).join("、")}`:"","修正要求:直接输出修正后的**完整**本节正文(不要只输出改动片段、不要解说改动过程);保留原有事实、数值与结论,不得以删除内容的方式规避问题。"].filter(Boolean).join("\n")}(c.issues)}];continue}let u=q.toolMessages??[];if(s)e=[...e,...u];else{let a=++n;if(a>=3){j="相同无进展状态在具体反馈后仍未取得新证据、游标或主控决定",k="no-progress";break}e=[...e,...u,{role:"user",content:1===a?"本轮没有新增可用来源、分页游标或已接受的主控决定。原始工具回执已保留;空结果或失败不证明资料缺失,也不能用改查询词、调用ID或再报缺来冒充进展。请依据已取得的资料换用有实际依据的工具/继续真实nextOffset,或向已接线的主控说明具体对象、已查范围与失败;若仍无法核定,保留真实decisionRequests并提交已能完成的正文,不编造参数或条件。":"再次没有新增证据。立即停止重复取证:把已能完成的正文按协议提交(未决事项写入decisionRequests保留),拟定配置按工程经验带依据给出(正文标“拟定”并登记plannedNumbers);继续同类工具调用不会产生新证据。"}]}void 0!==c.maxTurnsPerBlock&&p>=c.maxTurnsPerBlock&&(j="显式轮次预算耗尽,模型尚未提交正文")}return b?(a.onTurn?.({turn:h,residual:b.residual,toolCalls:f,action:"unfixable"}),{kind:"unfixable",content:b.content,turn:h,residual:b.residual,toolCalls:f,reason:j,issues:[],cause:k}):{kind:"no_content",turn:h,toolCalls:f,reason:j,cause:k}}},47262:(a,b,c)=>{function d(a){let b=e()?.semanticFingerprints?.[a];return"string"==typeof b&&/^[a-f0-9]{64}$/u.test(b)?b:void 0}function e(){let a='{"version":1,"sourceFingerprint":"0e37797d2ec62d17ca5f253c10b385fa939228f353538722f095755edce292af","semanticFingerprints":{"projectFacts":"d1dcb751e86666c34ebe80b1f5fdb7639a148125638ecb6622928256ff2387d7","documentGeneration":"63d0c3032939d80b866967933b8fe8e9c8e3acfae2cd053110a0bc4788f4faed"},"gitCommit":"f53db51b3de6374762fb08393b39385f24100893","serverVersion":"4.60.34","sourceFiles":754,"capturedAt":"2026-10-14T17:30:15.393Z"}';if(a)try{let b=JSON.parse(a);if(1!==b.version||!/^[a-f0-9]{64}$/u.test(b.sourceFingerprint??"")||"string"!=typeof b.serverVersion||"number"!=typeof b.sourceFiles||"string"!=typeof b.capturedAt||null!==b.gitCommit&&"string"!=typeof b.gitCommit)return;return b}catch{return}}c.d(b,{C:()=>d,S:()=>e})},48825:(a,b,c)=>{c.d(b,{Jf:()=>j,V2:()=>i,bp:()=>d,wJ:()=>e});let d="professional-writing-guidance-v4-responsibility-titles-2026-10-13",e={building:{fileName:"施工组织设计章节写作分析与编制规范(建筑).docx",sha256:"9313607509897e9a252cdefd671c4c72025d2727411972788bfa61b9835a0ff2",pages:12},municipal:{fileName:"施工组织设计章节写作分析与编制规范(市政).docx",sha256:"8e36d97e7084464ab04776093550e10984d3ac4a2a64ac37d5ca74a13a3ccc82",pages:13},bidWriting:{fileName:"技术标写作指南(合肥AI评标).docx",sha256:"3f36e67531da8ac9ffb1847694403ec4246457e445612767b3a82acf02894d0e"},bidReview:{fileName:"青天大模型AI评标规则考证(2026-10-11).docx",sha256:"de976918a1a0f1486cb07e1c2fd4a72a3b86fa480cbd46353f4c1af372badc69"}},f=["先形成工程对象、工作包、部署、资源及时间的共同推演,再按交付目录组织成文。事实、数量、工作面、部位、班组、节点在各章共用稳定身份,作者不各自编数字。","功能职责不等于固定章节:概况解释条件与影响,部署决定空间和顺序,方法说明实施,质量说明检查,安全说明风险与处置,进度说明时间,平面说明现场组织,移交说明最终闭环。推荐母目录不覆盖招标或用户锁定结构。","工作包数量与方法连通,方法与资源连通,资源与工期迭代校核;材料到货早于使用,检测和必要等待进入转序与时间逻辑。同一机械或班组同期不能在不同工作面重复占用。","施工方法、部署、真正重难点与进度应充分展开;人材机重点算准,管理计划重点完成执行闭环,概况与编制依据保持准确简洁。详略按职责和风险,不按统一字数、参数密度或固定图表数量。","表格按真实数据形态选择:单项目多属性用“信息项—内容”纵向或按属性含义分组;多对象在相同指标下比较、配置或排程时才横向展开。字段宽度应容纳完整对象、控制数值和单位,不能把大量无比较目的的属性铺成十几列单行,或把长范围原文挤进窄格。真实阶段或对象矩阵需要宽表时保留全部字段与对应关系,按职责合理分组,不设置固定列数上限、不强制各章制表,不删表行、数值或对象迎合评价。","项目事实依据与技术规范依据分别治理;前者确定实际工程,后者核验控制与验收。核验规范编号、名称、实施日期、状态、替代及局部废止和对象范围;参考文件列出的编号不等于本次已验证有效。","计算、产能假设和规范查证保留内部审计,正文交付核定的配置与控制结果及必要实施条件,不堆算式和来源说明。引用规范仅限确有技术参数、验收或强制边界需要的地方。","首稿采用专业短句和必要分点:条件决定方法,动作达到可检状态,状态放行下一工序。正文工序名不以箭头串替代实施方法;实际流程图和活动网络保留其关系,图后不逐节点逐连线重复全文。","技能主题是规划参考,不是必须照抄的交付标题。主控按本工程对象及被委派职责拟定正式小节名称,避免把“候选、核验责任、适用性”这类内部判断任务直接当目录;真正承担辨识、核查职责时使用完整专业名称。专业标题说明工程对象、方法或组织职责,不拼接关键词、不照抄内部评审标签。正常技术名称重复不导致丢弃、换名或重写;同项目再次编制仍以实际条件和方案质量为准。","写作指南中的样本统计只提供观察线索,不构成评分算法;图片数、箭头数、元数据软件、标题关键词和入围差值不授予质量或真实性。项目实际要求与专业适用规则优先,不为低频统计删去必要风险和接口。"],g={building:"建筑工程按实际楼栋、楼层、流水段和专业接口组织;地下结构、主体、围护装修、机电与室外的先后和移交要一致。不能把房建通用专业强行加入实际没有的工程。",municipal:"市政按真实路线、桩号、区段和工作面组织,明确起点、推进方向、地下与地上转序;涉及社会交通时,导改、围挡、施工阶段、居民出行与施工车辆路线联动。场内便道与场外交通分开。"},h=[{id:"overview",label:"项目理解",match:/概况|项目理解|整体理解|现场条件|工程清单|专业构成/u,buildingPages:[2],municipalPages:[2],guidance:"给出事实及其对施工组织的影响,按专业呈现必要工程量;不复制设计说明、不提前展开工艺,不以无来源地质、距离或道路数据制造针对性。"},{id:"deployment",label:"总体部署",match:/总体部署|施工部署|流水段|工作面|施工区段|施工顺序/u,buildingPages:[2,3],municipalPages:[2,3],guidance:"明确区段和工作面对应哪些任务及工程量、划分理由、起点、方向、先后与穿插、专业移交条件。后续方法、资源和进度必须能从部署找到组织依据。"},{id:"difficulties",label:"重难点",match:/重难点|重点难点|项目特点|制约因素/u,buildingPages:[3,4],municipalPages:[3,4],guidance:"由真实项目证据辨识制约因素,解释原因和后果,给出技术组织、资源、检查及异常处置;只深写真正核心问题,并在相关方法、质量、安全或工期中闭合。"},{id:"method",label:"施工方法",match:/工艺|工法|施工方法|施工技术|浇筑|开挖|吊装|安装|支模/u,buildingPages:[4,5],municipalPages:[4,5],guidance:"对本节实际承担的分项写清对象和工作量、前提、顺序、步骤、材料机具工种、控制、接口、检查、异常和转序。普通工序可组织可检查,核心工序达到必要技术策划深度;不把施组全文变成专项计算书。"},{id:"materials",label:"材料供应",match:/材料|物资|永久设备|供应|采购|人材机/u,buildingPages:[5],municipalPages:[5],guidance:"数量由实际工程量或可靠换算取得,供应与工作面及使用窗口衔接;长周期构件设备串联确认、采购、到货和安装。区分施工机械与永久设备、产品标准与验收标准;不能可靠换算时不假算。"},{id:"equipment",label:"机械与仪器",match:/机械|机具|检测仪器|人材机|确保机/u,buildingPages:[5,6],municipalPages:[5,6],guidance:"关键机械以工作量、可用作业窗口、实际单机或机组能力核定数量,检查同期占用和转场。检测仪器服务实际检验。运距未知不能虚构运输循环时间;算式留审计,不抄经验台数。"},{id:"labor",label:"劳动力",match:/劳动力|班组|工种|人材机|确保人/u,buildingPages:[6,7],municipalPages:[6],guidance:"以班组、工作面、阶段和工种组织投入,核算工作量、工日和持续时间;峰值由实际同期工种矩阵求得,不能相加各专业独立峰值。配置与特种作业必须符合真实任务。"},{id:"quality",label:"质量控制",match:/质量|检验|检测|隐蔽验收|复试|样板|三检/u,buildingPages:[7],municipalPages:[6,7],guidance:"围绕真实实体写检查对象、指标、方法、适用频次、岗位、记录、不合格处置、复验和销项;合格后才转序。方法章写实施,质量章写核验,避免再抄一遍工艺。"},{id:"safety",label:"风险安全与应急",match:/危大|危险源|风险|安全|应急|专项方案|论证/u,buildingPages:[7,8],municipalPages:[7,8],guidance:"实际作业、实体参数和影响对象支撑风险与危大判定,不能靠关键词。承担现场控制时给出作业条件、停止触发、监测和处置;辨识或审核子任务只承担其边界,完整应急由被委派任务负责。"},{id:"schedule",label:"进度组织",match:/进度|工期|节点|施工计划|施工窗口|确保人|确保机/u,buildingPages:[8,9],municipalPages:[8,9],guidance:"共同任务网络连接工作量、工作面、综合能力、材料到货、必要等待、检测与转序。开始结束和搭接可复核,关键路线由逻辑计算,不将箭头示意当网络计划。进度、正文与资源共用同一时间数据。"},{id:"environment",label:"环境与外部运行",match:/文明|环境|环保|扬尘|噪声|校园秩序|交通|既有|保护/u,buildingPages:[9],municipalPages:[9],guidance:"针对实际居民、校园、生产、交通、水体或既有设施说明影响、控制、检查责任及恢复;地方措施需按属地核验,不无条件复制某城市标准。涉及既有设施先调查再分析保护监测。"},{id:"site-layout",label:"现场空间组织",match:/总平面|平面布置|临时设施|临设|运输路线|便道|便桥/u,buildingPages:[9,10],municipalPages:[9,10],guidance:"按实际场地边界和阶段部署布置物流、堆场、机具、水电排水、消防及出入口,检查真实可通行与转场条件。缺尺寸不编坐标;必要实体决定未完成时由主控解决,不用模糊正文冒充已落地。"},{id:"handover",label:"验收恢复移交",match:/竣工|移交|交付|保修|缺陷责任|退场|恢复/u,buildingPages:[10],municipalPages:[10,11],guidance:"从已施工实体与系统反推检查、调试、整改复验、资料、培训和移交。市政还核对道路、交通、绿化及临设恢复;过程隐蔽验收不重复承担整套竣工移交。"}];function i(a){let b="building"===a||"municipal"===a?g[a]:"工程类型未确认时只使用共同写作原则,不能默认套用市政或房建专业条件。";return`【编制规范萃取 ${d},是写作方法先验,不是项目事实或已核现行标准】
|
|
127
127
|
${f.join("\n")}
|
|
128
128
|
${b}`}function j(a){let b=h.map(b=>({role:b,score:4*!!b.match.test(a.title)+2*!!b.match.test(a.responsibility)+("method"===b.id&&a.contentTypes.includes("method")?1:0)})).filter(a=>a.score>0).sort((a,b)=>b.score-a.score).map(a=>a.role);return{version:d,source:("building"===a.projectType||"municipal"===a.projectType?e[a.projectType]:void 0)??null,roles:b.map(b=>({id:b.id,label:b.label,pages:"building"===a.projectType?b.buildingPages:"municipal"===a.projectType?b.municipalPages:[],guidance:b.guidance})),omitted:[],text:`${i(a.projectType)}
|
|
129
129
|
本任务相关功能指引仅在其被委派的职责内采用:
|