Merge pull request #28 from CatJuly/fix/paper-theme-dialog-contrast
This commit is contained in:
commit
a3503e62ba
3 files changed
+6
-5
No files matched your search
+1
-1
@@ -174,7 +174,7 @@ Run anyway?`}[b]??b).replace(/\{(\w+)\}/g,(j,N)=>String(w?.[N]??`{${N}}`)));if(e
|
|||||||
`).trim()}function RC(e){const t=gv(e),n=PV(t),i=n.split(/\n{2,}/).map(r=>r.trim()).filter(Boolean);return i.length>1&&/^Verification:\s/i.test(i[i.length-1])?i.slice(0,-1).join(`
|
`).trim()}function RC(e){const t=gv(e),n=PV(t),i=n.split(/\n{2,}/).map(r=>r.trim()).filter(Boolean);return i.length>1&&/^Verification:\s/i.test(i[i.length-1])?i.slice(0,-1).join(`
|
||||||
|
|
||||||
`).trim():n}function PV(e){let t=String(e||"").trim();for(;;){const n=t.match(/^\*\*([^\r\n]{8,160}?)\*\*:(?:[ \t]+|\r?\n+)([\s\S]+)$/);if(!n)return t;const i=n[2].trim();if(i.length<80||i===t)return t;t=i}}function BV(e,t,n,i){if(!i)return n.content;const r=gv(e.content),o=gv(t.content);return!r||!o||r===o?n.content:r.endsWith(o)?e.content:o.endsWith(r)?t.content:n.content}function Il(e){const t=Or(e),n=new Set,i=typeof t.checkpoint_type=="string"?t.checkpoint_type.trim():"",r=typeof t.checkpoint_id=="string"?t.checkpoint_id.trim():"";for(const o of[e.id,typeof t.ui_message_id=="string"?t.ui_message_id:"",typeof t.result_delivery_id=="string"&&t.result_delivery_id.trim()?`delivery:${t.result_delivery_id.trim()}`:"",i&&r?`checkpoint:${i}:${r}`:""]){const a=String(o??"").trim();a&&n.add(a)}return n}function ll(e){return new Set([...Il(e)].map(t=>`${e.channelId}\0${t}`))}function $V(e){return e.startsWith("checkpoint:")||e.startsWith("delivery:")}function ci(e){return typeof e.timestamp=="number"?e.timestamp:0}function yv(e){return String(e.id??"").startsWith("msg-")}function JI(e){return!yv(e)}function AC(e){const t={};for(const n of e){if(!JI(n))continue;const i=ci(n);i>(t[n.channelId]??0)&&(t[n.channelId]=i)}return t}function HV(e,t,n){return n<=(e[t]??0)?e:{...e,[t]:n}}function FV(e,t){const n={};for(const i of e){if(!JI(i)||i.sender==="user")continue;const r=t[i.channelId]??0;ci(i)<=r||(n[i.channelId]=(n[i.channelId]??0)+1)}return n}function MC(e){const t=String(e.sender??"").trim().toLowerCase(),n=Or(e),i=typeof n.role=="string"?n.role.trim().toLowerCase():"";return t==="user"||i==="user"?"user":"assistant"}function DC(e){const t=Or(e),n=String(e.sender??"").trim().toLowerCase();let i=0;const r=eT(e);return r&&(i+=1e3+r),t.source==="engine"&&(i+=100),n&&n!=="system"&&(i+=20),n&&!["assistant","system","user"].includes(n)&&(i+=5),e.replyToId&&(i+=2),i+=Math.min(Object.keys(t).length,10),i}function OC(e){return String(Or(e).source??"").trim().toLowerCase()==="engine"}function eT(e){const t=Or(e),n=String(t.transcript_kind??"").trim();if(n)return TC[n]??0;const i=String(t.kind??"").trim();return TC[i]??0}function Tl(e){return eT(e)>0}function tT(e,t){if(e.channelId!==t.channelId)return!1;const n=Il(e),i=Il(t);for(const r of n)if(i.has(r))return!0;return!1}function mm(e,t){if(tT(e,t))return!0;if(e.channelId!==t.channelId||MC(e)!==MC(t)||RC(e.content)!==RC(t.content))return!1;const n=Tl(e)&&Tl(t);if(!n&&String(e.replyToId??"")!==String(t.replyToId??"")||!(OC(e)||OC(t)))return!1;const i=ci(e),r=ci(t);return!(!n&&i&&r&&Math.abs(i-r)>z0)}function pm(e,t,n=!1){let i=e,r=t;const o=yv(e),a=yv(t);o!==a?(i=o?t:e,r=o?e:t):(n||DC(t)>DC(e))&&(i=t,r=e);const c=[];for(const j of[r.mentions,i.mentions])for(const N of j??[])c.includes(N)||c.push(N);const d=Il(e),m=Il(t);let h=!1,p="";for(const j of d)m.has(j)&&($V(j)||(h=!0,p||(p=j)));const g=BV(e,t,i,h),x=String(Or(e).checkpoint_id??"").trim(),v=String(Or(t).checkpoint_id??"").trim(),b=!!x&&x===v,w=Tl(e)&&Tl(t),k=w?String(Or(e).ui_timeline_id??Or(t).ui_timeline_id??Uv(e)).trim():"",S={...Or(r),...Or(i)};return k&&(S.ui_timeline_id=k),{...r,...i,...p?{id:p}:{},content:g,metadata:S,mentions:c,timestamp:b||w?ci(e)||ci(t):ci(i)||ci(r)}}function LC(e){const t=[],n=new Map;for(const i of[...e].sort((r,o)=>ci(r)-ci(o))){const r=ll(i);let o=-1,a=!1;for(const d of r){const m=n.get(d);if(m!==void 0){o=m,a=t[m].id===i.id;break}}if(o===-1){const d=ci(i),m=Tl(i);for(let h=t.length-1;h>=0;h--){const p=ci(t[h]);if(!m&&d>0&&p>0&&d-p>z0)break;if(mm(t[h],i)){o=h;break}}}const c=o===-1?t.length:o;o===-1?t.push(i):t[o]=pm(t[o],i,a);for(const d of ll(t[c]))n.has(d)||n.set(d,c)}return t}function VV(e,t){const n=[...e],i=new Map;n.forEach((r,o)=>{for(const a of ll(r))i.set(a,o)});for(const r of[...t].sort((o,a)=>ci(o)-ci(a))){let o=-1;for(const a of ll(r)){const c=i.get(a);if(c!==void 0){o=c;break}}if(o<0){for(let a=n.length-1;a>=0;a-=1)if(mm(n[a],r)){o=a;break}}if(o<0)o=n.length,n.push(r);else{const a=n[o];n[o]=pm(a,r,a.id===r.id)}for(const a of ll(r))i.set(a,o);for(const a of ll(n[o]))i.set(a,o)}return n.sort((r,o)=>ci(r)===ci(o)?r.id.localeCompare(o.id):ci(r)-ci(o))}function UV(e,t){switch(t.type){case"SET":return t.channels;case"CLEAR":return[];case"ADD":return e.some(n=>n.id===t.channel.id)?e:[...e,t.channel];case"REMOVE":return e.filter(n=>n.id!==t.channelId);case"REMOVE_PARTICIPANT":return e.map(n=>({...n,participants:n.participants.filter(i=>i!==t.agentId)}));default:return e}}function GV(e,t){switch(t.type){case"SET":{const n=LC(t.messages);if(e.length===0)return n;const i=e.filter(r=>typeof r.id=="string"&&r.id.startsWith("msg-")&&!n.some(o=>mm(r,o)));return i.length===0?n:LC([...n,...i])}case"CLEAR":return[];case"ADD":{const n=ci(t.message);Il(t.message);let i=!1;for(let r=e.length-1;r>=0;r--){const o=ci(e[r]);if(!i&&n>0&&o>0&&n-o>z0&&(i=!0),tT(e[r],t.message)){const a=[...e];return a[r]=pm(e[r],t.message,e[r].id===t.message.id),a}if((Tl(t.message)||!i)&&mm(e[r],t.message)){const a=[
Line truncated
|
`).trim():n}function PV(e){let t=String(e||"").trim();for(;;){const n=t.match(/^\*\*([^\r\n]{8,160}?)\*\*:(?:[ \t]+|\r?\n+)([\s\S]+)$/);if(!n)return t;const i=n[2].trim();if(i.length<80||i===t)return t;t=i}}function BV(e,t,n,i){if(!i)return n.content;const r=gv(e.content),o=gv(t.content);return!r||!o||r===o?n.content:r.endsWith(o)?e.content:o.endsWith(r)?t.content:n.content}function Il(e){const t=Or(e),n=new Set,i=typeof t.checkpoint_type=="string"?t.checkpoint_type.trim():"",r=typeof t.checkpoint_id=="string"?t.checkpoint_id.trim():"";for(const o of[e.id,typeof t.ui_message_id=="string"?t.ui_message_id:"",typeof t.result_delivery_id=="string"&&t.result_delivery_id.trim()?`delivery:${t.result_delivery_id.trim()}`:"",i&&r?`checkpoint:${i}:${r}`:""]){const a=String(o??"").trim();a&&n.add(a)}return n}function ll(e){return new Set([...Il(e)].map(t=>`${e.channelId}\0${t}`))}function $V(e){return e.startsWith("checkpoint:")||e.startsWith("delivery:")}function ci(e){return typeof e.timestamp=="number"?e.timestamp:0}function yv(e){return String(e.id??"").startsWith("msg-")}function JI(e){return!yv(e)}function AC(e){const t={};for(const n of e){if(!JI(n))continue;const i=ci(n);i>(t[n.channelId]??0)&&(t[n.channelId]=i)}return t}function HV(e,t,n){return n<=(e[t]??0)?e:{...e,[t]:n}}function FV(e,t){const n={};for(const i of e){if(!JI(i)||i.sender==="user")continue;const r=t[i.channelId]??0;ci(i)<=r||(n[i.channelId]=(n[i.channelId]??0)+1)}return n}function MC(e){const t=String(e.sender??"").trim().toLowerCase(),n=Or(e),i=typeof n.role=="string"?n.role.trim().toLowerCase():"";return t==="user"||i==="user"?"user":"assistant"}function DC(e){const t=Or(e),n=String(e.sender??"").trim().toLowerCase();let i=0;const r=eT(e);return r&&(i+=1e3+r),t.source==="engine"&&(i+=100),n&&n!=="system"&&(i+=20),n&&!["assistant","system","user"].includes(n)&&(i+=5),e.replyToId&&(i+=2),i+=Math.min(Object.keys(t).length,10),i}function OC(e){return String(Or(e).source??"").trim().toLowerCase()==="engine"}function eT(e){const t=Or(e),n=String(t.transcript_kind??"").trim();if(n)return TC[n]??0;const i=String(t.kind??"").trim();return TC[i]??0}function Tl(e){return eT(e)>0}function tT(e,t){if(e.channelId!==t.channelId)return!1;const n=Il(e),i=Il(t);for(const r of n)if(i.has(r))return!0;return!1}function mm(e,t){if(tT(e,t))return!0;if(e.channelId!==t.channelId||MC(e)!==MC(t)||RC(e.content)!==RC(t.content))return!1;const n=Tl(e)&&Tl(t);if(!n&&String(e.replyToId??"")!==String(t.replyToId??"")||!(OC(e)||OC(t)))return!1;const i=ci(e),r=ci(t);return!(!n&&i&&r&&Math.abs(i-r)>z0)}function pm(e,t,n=!1){let i=e,r=t;const o=yv(e),a=yv(t);o!==a?(i=o?t:e,r=o?e:t):(n||DC(t)>DC(e))&&(i=t,r=e);const c=[];for(const j of[r.mentions,i.mentions])for(const N of j??[])c.includes(N)||c.push(N);const d=Il(e),m=Il(t);let h=!1,p="";for(const j of d)m.has(j)&&($V(j)||(h=!0,p||(p=j)));const g=BV(e,t,i,h),x=String(Or(e).checkpoint_id??"").trim(),v=String(Or(t).checkpoint_id??"").trim(),b=!!x&&x===v,w=Tl(e)&&Tl(t),k=w?String(Or(e).ui_timeline_id??Or(t).ui_timeline_id??Uv(e)).trim():"",S={...Or(r),...Or(i)};return k&&(S.ui_timeline_id=k),{...r,...i,...p?{id:p}:{},content:g,metadata:S,mentions:c,timestamp:b||w?ci(e)||ci(t):ci(i)||ci(r)}}function LC(e){const t=[],n=new Map;for(const i of[...e].sort((r,o)=>ci(r)-ci(o))){const r=ll(i);let o=-1,a=!1;for(const d of r){const m=n.get(d);if(m!==void 0){o=m,a=t[m].id===i.id;break}}if(o===-1){const d=ci(i),m=Tl(i);for(let h=t.length-1;h>=0;h--){const p=ci(t[h]);if(!m&&d>0&&p>0&&d-p>z0)break;if(mm(t[h],i)){o=h;break}}}const c=o===-1?t.length:o;o===-1?t.push(i):t[o]=pm(t[o],i,a);for(const d of ll(t[c]))n.has(d)||n.set(d,c)}return t}function VV(e,t){const n=[...e],i=new Map;n.forEach((r,o)=>{for(const a of ll(r))i.set(a,o)});for(const r of[...t].sort((o,a)=>ci(o)-ci(a))){let o=-1;for(const a of ll(r)){const c=i.get(a);if(c!==void 0){o=c;break}}if(o<0){for(let a=n.length-1;a>=0;a-=1)if(mm(n[a],r)){o=a;break}}if(o<0)o=n.length,n.push(r);else{const a=n[o];n[o]=pm(a,r,a.id===r.id)}for(const a of ll(r))i.set(a,o);for(const a of ll(n[o]))i.set(a,o)}return n.sort((r,o)=>ci(r)===ci(o)?r.id.localeCompare(o.id):ci(r)-ci(o))}function UV(e,t){switch(t.type){case"SET":return t.channels;case"CLEAR":return[];case"ADD":return e.some(n=>n.id===t.channel.id)?e:[...e,t.channel];case"REMOVE":return e.filter(n=>n.id!==t.channelId);case"REMOVE_PARTICIPANT":return e.map(n=>({...n,participants:n.participants.filter(i=>i!==t.agentId)}));default:return e}}function GV(e,t){switch(t.type){case"SET":{const n=LC(t.messages);if(e.length===0)return n;const i=e.filter(r=>typeof r.id=="string"&&r.id.startsWith("msg-")&&!n.some(o=>mm(r,o)));return i.length===0?n:LC([...n,...i])}case"CLEAR":return[];case"ADD":{const n=ci(t.message);Il(t.message);let i=!1;for(let r=e.length-1;r>=0;r--){const o=ci(e[r]);if(!i&&n>0&&o>0&&n-o>z0&&(i=!0),tT(e[r],t.message)){const a=[...e];return a[r]=pm(e[r],t.message,e[r].id===t.message.id),a}if((Tl(t.message)||!i)&&mm(e[r],t.message)){const a=[
Line truncated
|
||||||
${t}`:`${e}${t}`}function WV(e,t){const n=e.trim().replace(/\s+/g," ");return n?n.length>120?`${n.slice(0,120).trimEnd()}...`:n:t||"Thinking"}function YV(e){return{timestamp:Number.isFinite(e.timestamp)?e.timestamp:Date.now(),type:e.type,summary:typeof e.summary=="string"?e.summary:"",detail:typeof e.detail=="string"&&e.detail?e.detail:void 0,turnId:typeof e.turnId=="string"&&e.turnId?e.turnId:void 0,itemId:typeof e.itemId=="string"&&e.itemId?e.itemId:void 0,streamId:typeof e.streamId=="string"&&e.streamId?e.streamId:void 0,toolCallId:typeof e.toolCallId=="string"&&e.toolCallId?e.toolCallId:void 0,permissionGroupKey:typeof e.permissionGroupKey=="string"&&e.permissionGroupKey?e.permissionGroupKey:void 0,seq:typeof e.seq=="number"&&Number.isFinite(e.seq)?e.seq:void 0,executionMode:typeof e.executionMode=="string"&&e.executionMode?e.executionMode:void 0}}function hm(e){const t=e.itemId||e.streamId;return t?`${e.type}:${e.turnId??""}:${t}`:e.toolCallId&&(e.type==="tool_call"||e.type==="autonomy")?`${e.type}:${e.turnId??""}:${e.toolCallId}`:e.permissionGroupKey&&e.type==="autonomy"?`${e.type}:${e.turnId??""}:${e.permissionGroupKey}`:""}function XV(e,t){const n=hm(e),i=hm(t);return n&&i?n===i:t.timestamp-e.timestamp>Zm||e.type!==t.type?!1:e.type==="thinking"||e.type==="assistant"?!0:e.type==="tool_call"?e.summary===t.summary:!1}function KV(e,t){return t.timestamp-e.timestamp<=Zm&&e.type===t.type&&e.summary===t.summary&&(e.detail??"")===(t.detail??"")}function ZV(e,t){if(e.type==="thinking"||e.type==="assistant"){const n=xv(e.detail??"",t.detail??"","thinking");return{timestamp:e.timestamp,type:e.type,summary:WV(n,t.summary||e.summary),detail:n||void 0,turnId:t.turnId??e.turnId,itemId:t.itemId??e.itemId,streamId:t.streamId??e.streamId,toolCallId:t.toolCallId??e.toolCallId,permissionGroupKey:t.permissionGroupKey??e.permissionGroupKey,seq:t.seq??e.seq,executionMode:t.executionMode??e.executionMode}}if(e.type==="tool_call"){const n=xv(e.detail??"",t.detail??"","tool_call");return{timestamp:e.timestamp,type:"tool_call",summary:t.summary||e.summary,detail:n||void 0,turnId:t.turnId??e.turnId,itemId:t.itemId??e.itemId,streamId:t.streamId??e.streamId,toolCallId:t.toolCallId??e.toolCallId,permissionGroupKey:t.permissionGroupKey??e.permissionGroupKey,seq:t.seq??e.seq,executionMode:t.executionMode??e.executionMode}}return t}function nT(e,t,n=100){const i=YV(t),r=hm(i),o=r?[...e].reverse().findIndex(d=>hm(d)===r):-1,a=o>=0?e.length-1-o:e.length-1,c=e[a];return c?r&&o>=0&&typeof c.seq=="number"&&typeof i.seq=="number"&&i.seq<=c.seq?e:KV(c,i)?gl([...e.slice(0,a),c,...e.slice(a+1)],n):XV(c,i)?gl([...e.slice(0,a),ZV(c,i),...e.slice(a+1)],n):gl([...e,i],n):[i]}function iT(e,t=100){return(Array.isArray(e)?e:[]).reduce((n,i)=>nT(n,i,t),[])}function QV(e){return{timestamp:Number.isFinite(e.timestamp)?e.timestamp:Date.now(),type:e.type,workItemProjectionId:typeof e.workItemProjectionId=="string"&&e.workItemProjectionId?e.workItemProjectionId:void 0,workItemTurnType:typeof e.workItemTurnType=="string"&&e.workItemTurnType?e.workItemTurnType:void 0,workItemProjectionTitle:typeof e.workItemProjectionTitle=="string"&&e.workItemProjectionTitle?e.workItemProjectionTitle:void 0,runtimeTaskId:typeof e.runtimeTaskId=="string"&&e.runtimeTaskId?e.runtimeTaskId:void 0,executionTurnId:typeof e.executionTurnId=="string"&&e.executionTurnId?e.executionTurnId:void 0,roleName:typeof e.roleName=="string"&&e.roleName?e.roleName:void 0,detail:typeof e.detail=="string"&&e.detail?e.detail:void 0}}function rT(e,t){return e.type===t.type&&(e.workItemProjectionId??"")===(t.workItemProjectionId??"")&&(e.workItemTurnType??"")===(t.workItemTurnType??"")&&(e.workItemProjectionTitle??"")===(t.workItemProjectionTitle??"")&&(e.executionTurnId??e.runtimeTaskId??"")===(t.executionTurnId??t.runtimeTaskId??"")&&(e.roleName??"")===(t.roleName??"")}function JV(e,t){return t.timestamp-e.timestamp<=Zm&&rT(e,t)&&(e.type==="thinking"||e.type==="tool_call")}function eU(e,t){return rT(e,t)&&(e.detail??"")===(t.detail??"")&&t.timestamp-e.timestamp<=Zm}function tU(e,t){const n=t.type==="tool_call"?"tool_call":"thinking";return{...e,...t,timestamp:t.timestamp,detail:xv(e.detail??"",t.detail??"",n)||void 0}}function sT(e,t,n=100){const i=QV(t),r=e[e.length-1];return r?eU(r,i)?gl([...e.slice(0,-1),{...r,timestamp:i.timestamp}],n):JV(r,i)?gl([...e.slice(0,-1),tU(r,i)],n):gl([...e,i],n):[i]}function oT(e,t=100){return(Array.isArray(e)?e:[]).reduce((n,i)=>sT(n,i,t),[])}function vv(e){const t=String(e??"").trim().toLowerCase();return t==="company"?"company":t==="org"||t==="custom"?"org":"task"}function nU(e){return String(e??"").trim().toLowerCase()==="custom"?"custom":"corporate"}function aT(e){const t=String(e.execMode??"").trim().toLowerCase(),n=String(e.companyProfile??"").trim().toLowerCase(),i=String(e.orgId??"").trim(),o=t.length>0?vv(t):n==="custom"||i?"org":vv(t);return o==="org"?{...e,execMode:"org",companyProfile:"custom",orgId:i||void 0}:o==="company"?{...e,execMode:"company"
Line truncated
|
${t}`:`${e}${t}`}function WV(e,t){const n=e.trim().replace(/\s+/g," ");return n?n.length>120?`${n.slice(0,120).trimEnd()}...`:n:t||"Thinking"}function YV(e){return{timestamp:Number.isFinite(e.timestamp)?e.timestamp:Date.now(),type:e.type,summary:typeof e.summary=="string"?e.summary:"",detail:typeof e.detail=="string"&&e.detail?e.detail:void 0,turnId:typeof e.turnId=="string"&&e.turnId?e.turnId:void 0,itemId:typeof e.itemId=="string"&&e.itemId?e.itemId:void 0,streamId:typeof e.streamId=="string"&&e.streamId?e.streamId:void 0,toolCallId:typeof e.toolCallId=="string"&&e.toolCallId?e.toolCallId:void 0,permissionGroupKey:typeof e.permissionGroupKey=="string"&&e.permissionGroupKey?e.permissionGroupKey:void 0,seq:typeof e.seq=="number"&&Number.isFinite(e.seq)?e.seq:void 0,executionMode:typeof e.executionMode=="string"&&e.executionMode?e.executionMode:void 0}}function hm(e){const t=e.itemId||e.streamId;return t?`${e.type}:${e.turnId??""}:${t}`:e.toolCallId&&(e.type==="tool_call"||e.type==="autonomy")?`${e.type}:${e.turnId??""}:${e.toolCallId}`:e.permissionGroupKey&&e.type==="autonomy"?`${e.type}:${e.turnId??""}:${e.permissionGroupKey}`:""}function XV(e,t){const n=hm(e),i=hm(t);return n&&i?n===i:t.timestamp-e.timestamp>Zm||e.type!==t.type?!1:e.type==="thinking"||e.type==="assistant"?!0:e.type==="tool_call"?e.summary===t.summary:!1}function KV(e,t){return t.timestamp-e.timestamp<=Zm&&e.type===t.type&&e.summary===t.summary&&(e.detail??"")===(t.detail??"")}function ZV(e,t){if(e.type==="thinking"||e.type==="assistant"){const n=xv(e.detail??"",t.detail??"","thinking");return{timestamp:e.timestamp,type:e.type,summary:WV(n,t.summary||e.summary),detail:n||void 0,turnId:t.turnId??e.turnId,itemId:t.itemId??e.itemId,streamId:t.streamId??e.streamId,toolCallId:t.toolCallId??e.toolCallId,permissionGroupKey:t.permissionGroupKey??e.permissionGroupKey,seq:t.seq??e.seq,executionMode:t.executionMode??e.executionMode}}if(e.type==="tool_call"){const n=xv(e.detail??"",t.detail??"","tool_call");return{timestamp:e.timestamp,type:"tool_call",summary:t.summary||e.summary,detail:n||void 0,turnId:t.turnId??e.turnId,itemId:t.itemId??e.itemId,streamId:t.streamId??e.streamId,toolCallId:t.toolCallId??e.toolCallId,permissionGroupKey:t.permissionGroupKey??e.permissionGroupKey,seq:t.seq??e.seq,executionMode:t.executionMode??e.executionMode}}return t}function nT(e,t,n=100){const i=YV(t),r=hm(i),o=r?[...e].reverse().findIndex(d=>hm(d)===r):-1,a=o>=0?e.length-1-o:e.length-1,c=e[a];return c?r&&o>=0&&typeof c.seq=="number"&&typeof i.seq=="number"&&i.seq<=c.seq?e:KV(c,i)?gl([...e.slice(0,a),c,...e.slice(a+1)],n):XV(c,i)?gl([...e.slice(0,a),ZV(c,i),...e.slice(a+1)],n):gl([...e,i],n):[i]}function iT(e,t=100){return(Array.isArray(e)?e:[]).reduce((n,i)=>nT(n,i,t),[])}function QV(e){return{timestamp:Number.isFinite(e.timestamp)?e.timestamp:Date.now(),type:e.type,workItemProjectionId:typeof e.workItemProjectionId=="string"&&e.workItemProjectionId?e.workItemProjectionId:void 0,workItemTurnType:typeof e.workItemTurnType=="string"&&e.workItemTurnType?e.workItemTurnType:void 0,workItemProjectionTitle:typeof e.workItemProjectionTitle=="string"&&e.workItemProjectionTitle?e.workItemProjectionTitle:void 0,runtimeTaskId:typeof e.runtimeTaskId=="string"&&e.runtimeTaskId?e.runtimeTaskId:void 0,executionTurnId:typeof e.executionTurnId=="string"&&e.executionTurnId?e.executionTurnId:void 0,roleName:typeof e.roleName=="string"&&e.roleName?e.roleName:void 0,detail:typeof e.detail=="string"&&e.detail?e.detail:void 0}}function rT(e,t){return e.type===t.type&&(e.workItemProjectionId??"")===(t.workItemProjectionId??"")&&(e.workItemTurnType??"")===(t.workItemTurnType??"")&&(e.workItemProjectionTitle??"")===(t.workItemProjectionTitle??"")&&(e.executionTurnId??e.runtimeTaskId??"")===(t.executionTurnId??t.runtimeTaskId??"")&&(e.roleName??"")===(t.roleName??"")}function JV(e,t){return t.timestamp-e.timestamp<=Zm&&rT(e,t)&&(e.type==="thinking"||e.type==="tool_call")}function eU(e,t){return rT(e,t)&&(e.detail??"")===(t.detail??"")&&t.timestamp-e.timestamp<=Zm}function tU(e,t){const n=t.type==="tool_call"?"tool_call":"thinking";return{...e,...t,timestamp:t.timestamp,detail:xv(e.detail??"",t.detail??"",n)||void 0}}function sT(e,t,n=100){const i=QV(t),r=e[e.length-1];return r?eU(r,i)?gl([...e.slice(0,-1),{...r,timestamp:i.timestamp}],n):JV(r,i)?gl([...e.slice(0,-1),tU(r,i)],n):gl([...e,i],n):[i]}function oT(e,t=100){return(Array.isArray(e)?e:[]).reduce((n,i)=>sT(n,i,t),[])}function vv(e){const t=String(e??"").trim().toLowerCase();return t==="company"?"company":t==="org"||t==="custom"?"org":"task"}function nU(e){return String(e??"").trim().toLowerCase()==="custom"?"custom":"corporate"}function aT(e){const t=String(e.execMode??"").trim().toLowerCase(),n=String(e.companyProfile??"").trim().toLowerCase(),i=String(e.orgId??"").trim(),o=t.length>0?vv(t):n==="custom"||i?"org":vv(t);return o==="org"?{...e,execMode:"org",companyProfile:"custom",orgId:i||void 0}:o==="company"?{...e,execMode:"company"
Line truncated
|
||||||
`)),[T,M]=C.useState(!1),I=C.useRef(e.role_id);C.useEffect(()=>{I.current!==e.role_id&&(I.current=e.role_id,d(e.name),h(e.responsibility),g(e.reports_to),v(e.icon??null),w(new Set(e.can_spawn)),S(new Set(e.tools)),N(e.runtime_policy?.execution_strategy??"auto"),A(e.preferred_external_agent??null),O((e.prompt_refs??[]).join(`
|
`)),[T,M]=C.useState(!1),I=C.useRef(e.role_id);C.useEffect(()=>{I.current!==e.role_id&&(I.current=e.role_id,d(e.name),h(e.responsibility),g(e.reports_to),v(e.icon??null),w(new Set(e.can_spawn)),S(new Set(e.tools)),N(e.runtime_policy?.execution_strategy??"auto"),A(e.preferred_external_agent??null),O((e.prompt_refs??[]).join(`
|
||||||
`)),M(!1))},[e]);const H=C.useRef({}),Y=C.useRef(null),P=C.useRef(e.role_id);C.useEffect(()=>{P.current=e.role_id},[e.role_id]);const U=C.useCallback(()=>{Y.current&&(clearTimeout(Y.current),Y.current=null);const ie=H.current;H.current={},Object.keys(ie).length!==0&&r(P.current,ie)},[r]),$=C.useCallback(ie=>{i||(H.current={...H.current,...ie},Y.current&&clearTimeout(Y.current),Y.current=setTimeout(U,500))},[U,i]);C.useEffect(()=>()=>{Y.current&&(clearTimeout(Y.current),Y.current=null);const ie=H.current;Object.keys(ie).length>0&&(H.current={},r(P.current,ie))},[r]);const G=ie=>{d(ie),$({name:ie})},q=ie=>{h(ie),$({responsibility:ie})},K=ie=>{g(ie),$({reports_to:ie})},W=ie=>{v(ie),$({icon:ie})},V=ie=>{N(ie),$({execution_strategy:ie})},Q=ie=>{A(ie),$({preferred_external_agent:ie})},B=ie=>{O(ie);const je=ie.split(`
|
`)),M(!1))},[e]);const H=C.useRef({}),Y=C.useRef(null),P=C.useRef(e.role_id);C.useEffect(()=>{P.current=e.role_id},[e.role_id]);const U=C.useCallback(()=>{Y.current&&(clearTimeout(Y.current),Y.current=null);const ie=H.current;H.current={},Object.keys(ie).length!==0&&r(P.current,ie)},[r]),$=C.useCallback(ie=>{i||(H.current={...H.current,...ie},Y.current&&clearTimeout(Y.current),Y.current=setTimeout(U,500))},[U,i]);C.useEffect(()=>()=>{Y.current&&(clearTimeout(Y.current),Y.current=null);const ie=H.current;Object.keys(ie).length>0&&(H.current={},r(P.current,ie))},[r]);const G=ie=>{d(ie),$({name:ie})},q=ie=>{h(ie),$({responsibility:ie})},K=ie=>{g(ie),$({reports_to:ie})},W=ie=>{v(ie),$({icon:ie})},V=ie=>{N(ie),$({execution_strategy:ie})},Q=ie=>{A(ie),$({preferred_external_agent:ie})},B=ie=>{O(ie);const je=ie.split(`
|
||||||
`).map(we=>we.trim()).filter(Boolean);$({prompt_refs:je})},Z=ie=>{const je=new Set(b);je.has(ie)?je.delete(ie):je.add(ie),w(je),$({can_spawn:Array.from(je)})},te=ie=>{const je=new Set(k);je.has(ie)?je.delete(ie):je.add(ie),S(je),$({tools:Array.from(je)})},ee=C.useMemo(()=>t.filter(ie=>ie.role_id!==e.role_id),[t,e.role_id]),se=C.useMemo(()=>n.filter(ie=>(ie.role_ids?.length?ie.role_ids:[ie.role_id]).includes(e.role_id)).length,[n,e.role_id]),ae=C.useMemo(()=>D.split(`
|
`).map(we=>we.trim()).filter(Boolean);$({prompt_refs:je})},Z=ie=>{const je=new Set(b);je.has(ie)?je.delete(ie):je.add(ie),w(je),$({can_spawn:Array.from(je)})},te=ie=>{const je=new Set(k);je.has(ie)?je.delete(ie):je.add(ie),S(je),$({tools:Array.from(je)})},ee=C.useMemo(()=>t.filter(ie=>ie.role_id!==e.role_id),[t,e.role_id]),se=C.useMemo(()=>n.filter(ie=>(ie.role_ids?.length?ie.role_ids:[ie.role_id]).includes(e.role_id)).length,[n,e.role_id]),ae=C.useMemo(()=>D.split(`
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<link rel="icon" href="data:," />
|
<link rel="icon" href="data:," />
|
||||||
<title>OpenOPC Pixel Office</title>
|
<title>OpenOPC Pixel Office</title>
|
||||||
<script type="module" crossorigin src="./assets/index-Dw3OK9za.js"></script>
|
<script type="module" crossorigin src="./assets/index-Cdi_JV6w.js"></script>
|
||||||
<link rel="modulepreload" crossorigin href="./assets/phaser-DFK5Ua9d.js">
|
<link rel="modulepreload" crossorigin href="./assets/phaser-DFK5Ua9d.js">
|
||||||
<link rel="stylesheet" crossorigin href="./assets/index-B6-ikSHW.css">
|
<link rel="stylesheet" crossorigin href="./assets/index-B6-ikSHW.css">
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -87,13 +87,14 @@ export function ProjectSelector({ projects, activeId, onSelect, onCreate, onDele
|
|||||||
background: 'rgba(0,0,0,0.5)',
|
background: 'rgba(0,0,0,0.5)',
|
||||||
}}>
|
}}>
|
||||||
<div style={{
|
<div style={{
|
||||||
background: 'var(--bg-surface, #1e1e2e)', borderRadius: 12, padding: '24px 32px',
|
background: 'var(--bg-elevated)', borderRadius: 12, padding: '24px 32px',
|
||||||
|
border: '1px solid var(--border)', color: 'var(--text)',
|
||||||
maxWidth: 400, boxShadow: '0 8px 32px rgba(0,0,0,0.4)', textAlign: 'center',
|
maxWidth: 400, boxShadow: '0 8px 32px rgba(0,0,0,0.4)', textAlign: 'center',
|
||||||
}}>
|
}}>
|
||||||
<p style={{ margin: '0 0 8px', fontWeight: 600, fontSize: 15 }}>
|
<p style={{ margin: '0 0 8px', fontWeight: 600, fontSize: 15, color: 'var(--text)' }}>
|
||||||
{t('project.confirmTitle', { name: confirmDelete })}
|
{t('project.confirmTitle', { name: confirmDelete })}
|
||||||
</p>
|
</p>
|
||||||
<p style={{ margin: '0 0 20px', fontSize: 13, opacity: 0.7 }}>
|
<p style={{ margin: '0 0 20px', fontSize: 13, color: 'var(--text-secondary)' }}>
|
||||||
{t('project.confirmBody')}
|
{t('project.confirmBody')}
|
||||||
</p>
|
</p>
|
||||||
<div style={{ display: 'flex', gap: 8, justifyContent: 'center' }}>
|
<div style={{ display: 'flex', gap: 8, justifyContent: 'center' }}>
|
||||||
|
|||||||
Reference in new issue
Block a user