@whoz-oss/coday-client 0.137.4 → 0.138.0
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/3rdpartylicenses.txt +26 -26
- package/browser/{chunk-SDLTQWY6.js → chunk-24VYLV4I.js} +4 -4
- package/browser/{chunk-Q74LPU7S.js → chunk-2NXSUKWO.js} +1 -1
- package/browser/{chunk-I75FDNMK.js → chunk-2PCZ45ML.js} +1 -1
- package/browser/{chunk-ROKVODMP.js → chunk-3VFQEECC.js} +1 -1
- package/browser/{chunk-FDCPX2YT.js → chunk-47EXVHLI.js} +1 -1
- package/browser/chunk-4A4ATZKZ.js +1 -0
- package/browser/chunk-4EW3L5UH.js +3 -0
- package/browser/{chunk-TTT2KKF5.js → chunk-5DNF6SKR.js} +1 -1
- package/browser/{chunk-J3VSV47Q.js → chunk-5XGLZABC.js} +1 -1
- package/browser/chunk-6BPAEX7H.js +1 -0
- package/browser/chunk-6XGUFYZM.js +1 -0
- package/browser/{chunk-HY7OYHZF.js → chunk-75DAJTMO.js} +1 -1
- package/browser/{chunk-4BPXGK4G.js → chunk-7Q3PMYN7.js} +1 -1
- package/browser/{chunk-WUEY672C.js → chunk-A73TNAB2.js} +1 -1
- package/browser/chunk-APQFC6DT.js +270 -0
- package/browser/chunk-AZTZWTQC.js +2 -0
- package/browser/chunk-BOMZXZNH.js +6 -0
- package/browser/chunk-C6OO5XU6.js +2 -0
- package/browser/chunk-CC5AKB2A.js +7 -0
- package/browser/chunk-CR7BT2S7.js +1 -0
- package/browser/{chunk-4XDVIAH5.js → chunk-D7NRPJD7.js} +1 -1
- package/browser/chunk-DAJYRGSI.js +1 -0
- package/browser/{chunk-3KLCJN7J.js → chunk-DM4I6DXV.js} +1 -1
- package/browser/{chunk-JKYQ6SGT.js → chunk-E6S4EPGE.js} +1 -1
- package/browser/chunk-EYNAABQ3.js +1 -0
- package/browser/{chunk-DKMOSMNT.js → chunk-FCTNZTP7.js} +1 -1
- package/browser/{chunk-YUJVXWXY.js → chunk-GMUVYHLH.js} +1 -1
- package/browser/chunk-HUPOU57K.js +1 -0
- package/browser/{chunk-CND4W2V5.js → chunk-IF2A56UI.js} +1 -1
- package/browser/chunk-IMBKNOTP.js +1 -0
- package/browser/{chunk-UQNMPA5Y.js → chunk-J4KEKL2K.js} +1 -1
- package/browser/{chunk-DPFJ6LFY.js → chunk-JPVNXEXU.js} +1 -1
- package/browser/chunk-JRNOMFVU.js +7 -0
- package/browser/chunk-KLUNVGJU.js +1 -0
- package/browser/{chunk-LY4NJEIC.js → chunk-KURIGU2H.js} +1 -1
- package/browser/{chunk-3NO4PSNB.js → chunk-KX4UWHBC.js} +1 -1
- package/browser/{chunk-BYSD3PVJ.js → chunk-M7DIJJQG.js} +1 -1
- package/browser/{chunk-QFSZDRP2.js → chunk-MMKBNIVO.js} +1 -1
- package/browser/chunk-NYB2GRO2.js +1 -0
- package/browser/chunk-O7ALTLRI.js +1 -0
- package/browser/{chunk-BZJFZW26.js → chunk-OI3PIKFL.js} +1 -1
- package/browser/{chunk-DBCN2VJG.js → chunk-PDKEETOZ.js} +1 -1
- package/browser/{chunk-L57EAIK5.js → chunk-PLDORJDZ.js} +1 -1
- package/browser/{chunk-IGI6JYHL.js → chunk-Q6BUPFSX.js} +1 -1
- package/browser/chunk-QVW2GZXC.js +1 -0
- package/browser/chunk-QZJHI2KP.js +1 -0
- package/browser/chunk-R66QC5NO.js +1 -0
- package/browser/chunk-RU54IW5P.js +1 -0
- package/browser/chunk-SODYVTNM.js +1 -0
- package/browser/chunk-SUT4HFT6.js +1 -0
- package/browser/chunk-TCZAQN3J.js +1 -0
- package/browser/chunk-TPSIRGLZ.js +91 -0
- package/browser/chunk-UZAJQI6M.js +1 -0
- package/browser/chunk-VCBYXOEX.js +1 -0
- package/browser/{chunk-L3AZBL32.js → chunk-VIM5JYUA.js} +1 -1
- package/browser/{chunk-6DNANWSF.js → chunk-YXC5ZRFS.js} +1 -1
- package/browser/{chunk-W6TV6QXT.js → chunk-ZW5WSB7W.js} +1 -1
- package/browser/chunk-ZYFM3FQS.js +1 -0
- package/browser/index.html +1 -1
- package/browser/{main-Q7LBNC4Q.js → main-MM7I2UT5.js} +1 -1
- package/package.json +1 -1
- package/browser/chunk-2TT2VS4Q.js +0 -1
- package/browser/chunk-2YPR6RKN.js +0 -1
- package/browser/chunk-3DDLKUVJ.js +0 -3
- package/browser/chunk-6JH2UGTU.js +0 -5
- package/browser/chunk-6SMZDP3D.js +0 -1
- package/browser/chunk-ADDNFR54.js +0 -1
- package/browser/chunk-CNH5D5Q6.js +0 -1
- package/browser/chunk-CXN4NTRD.js +0 -91
- package/browser/chunk-FJR6WCPX.js +0 -270
- package/browser/chunk-HKKMIUP4.js +0 -1
- package/browser/chunk-HYNHL5RY.js +0 -4
- package/browser/chunk-ITQYGRG4.js +0 -1
- package/browser/chunk-J4KRGI3B.js +0 -1
- package/browser/chunk-J6NHAJP2.js +0 -2
- package/browser/chunk-K27ORZBT.js +0 -1
- package/browser/chunk-KNY6WJUH.js +0 -2
- package/browser/chunk-MEDB5TPW.js +0 -1
- package/browser/chunk-MLNEYB77.js +0 -3
- package/browser/chunk-OBMXZUQM.js +0 -1
- package/browser/chunk-OHLGZXEO.js +0 -1
- package/browser/chunk-R5ARTV5U.js +0 -1
- package/browser/chunk-RAJZGLER.js +0 -1
- package/browser/chunk-RE6LVN6R.js +0 -1
- package/browser/chunk-SHWW6WRB.js +0 -1
- package/browser/chunk-SI36SMXC.js +0 -5
- package/browser/chunk-SS4F7GDL.js +0 -1
- package/browser/chunk-T2JHUF63.js +0 -5
- package/browser/chunk-UCBFJ7MC.js +0 -1
- package/browser/chunk-W7SPWNUX.js +0 -1
- package/browser/chunk-WC5DQJKZ.js +0 -1
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import{a as de,b as w}from"./chunk-G4QDBE4F.js";import{D as $,J as se,P as ce,R as re,Rc as E,S as ie,V as g,Z as c,a as T,b as C,ca as a,d,h as j,i as r,m as D,n as k,pa as le,t as te,u as ne}from"./chunk-RNXBUYHW.js";var N=class n{http=a(E);projectState=a(w);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/threads`}listThreads(){return this.http.get(this.getBaseUrl())}listAllThreads(){return this.http.get("/api/threads")}getThread(e){return this.http.get(`${this.getBaseUrl()}/${e}`)}createThread(e){let t=e?{name:e}:{};return this.http.post(this.getBaseUrl(),t)}updateThread(e,t){return this.http.put(`${this.getBaseUrl()}/${e}`,{name:t})}updateThreadUsers(e,t){return this.http.put(`${this.getBaseUrl()}/${e}`,{users:t})}starThread(e){return this.http.post(`${this.getBaseUrl()}/${e}/star`,{})}unstarThread(e){return this.http.delete(`${this.getBaseUrl()}/${e}/star`)}deleteThread(e){return this.http.delete(`${this.getBaseUrl()}/${e}`)}stopThread(e){return this.http.post(`${this.getBaseUrl()}/${e}/stop`,{})}getThreadMessages(e){return this.http.get(`${this.getBaseUrl()}/${e}/messages`)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};var U=class n{selectedThreadIdSubject=new r(null);isLoadingSubject=new r(!1);isLoadingThreadListSubject=new r(!1);refreshThreadListSubject=new j;threadListSubject=new r([]);hasLoadedOncePerProject=new Map;currentProjectName=null;isLoading$=this.isLoadingSubject.asObservable();isLoadingThreadList$=this.isLoadingThreadListSubject.asObservable();threadApi=a(N);projectStateService=a(w);projectApi=a(de);projectName$=this.projectStateService.selectedProject$.pipe(te(e=>e?.name),se());constructor(){ne([this.projectName$,this.refreshThreadListSubject.asObservable().pipe(re(void 0))]).pipe(g(([e])=>{e!==this.currentProjectName&&(console.log("[THREAD_STATE] Project changed, clearing thread list"),this.threadListSubject.next([]),this.currentProjectName=e),e?this.hasLoadedOncePerProject.get(e)?console.log("[THREAD_STATE] Refreshing thread list for project",e,"(no spinner)"):(console.log("[THREAD_STATE] Initial load for project",e,"- showing spinner"),this.isLoadingThreadListSubject.next(!0)):(console.log("[THREAD_STATE] No project selected, hiding spinner"),this.isLoadingThreadListSubject.next(!1))}),ie(([e])=>e?(console.log("[THREAD_STATE] Fetching threads for project:",e),this.threadApi.listThreads().pipe(te(t=>({threads:t,projectName:e})),$(t=>(console.error("[THREAD_STATE] Error loading thread list:",t),D({threads:[],projectName:e}))))):(console.log("[THREAD_STATE] No project selected, returning empty list"),D({threads:[],projectName:null}))),g(({threads:e,projectName:t})=>{console.log("[THREAD_STATE] Thread list loaded:",e.length,"threads for project",t),t&&this.hasLoadedOncePerProject.set(t,!0),this.isLoadingThreadListSubject.next(!1),this.threadListSubject.next(e)})).subscribe()}threadList$=this.threadListSubject.asObservable();refreshSelectedThreadSubject=new j;selectedThread$=ne([this.projectName$,this.selectedThreadIdSubject.pipe(se()),this.refreshSelectedThreadSubject.pipe(re(void 0))]).pipe(ie(([e,t])=>!e||!t?D(null):(this.isLoadingSubject.next(!0),this.threadApi.getThread(t).pipe(ce({bufferSize:1,refCount:!0})))),g(()=>{this.isLoadingSubject.next(!1)}));selectThread(e){this.selectedThreadIdSubject.next(e)}getSelectedThreadId(){return this.selectedThreadIdSubject.value}getSelectedThreadIdOrThrow(){let e=this.selectedThreadIdSubject.value;if(!e)throw new Error("[THREAD_STATE] No thread selected");return e}clearSelection(){this.selectedThreadIdSubject.next(null)}stop(){let e=this.selectedThreadIdSubject.value;if(!e){console.error("[THREAD_STATE] Cannot stop: no thread selected");return}console.log("[THREAD_STATE] Stopping thread:",e),this.threadApi.stopThread(e).subscribe({next:t=>console.log("[THREAD_STATE] Stop signal sent:",t.message),error:t=>console.error("[THREAD_STATE] Error stopping thread:",t)})}refreshThreadList(){console.log("[THREAD_STATE] Manually refreshing thread list"),this.refreshThreadListSubject.next()}updateStarLocal(e,t,s){let P=this.threadListSubject.value.map(l=>{if(l.id!==e)return l;let p=l.starring||[];return t&&!p.includes(s)?C(T({},l),{starring:[...p,s]}):!t&&p.includes(s)?C(T({},l),{starring:p.filter(I=>I!==s)}):l});this.threadListSubject.next(P)}refreshSelectedThread(){this.refreshSelectedThreadSubject.next()}updateThreadUsers(e,t){return this.threadApi.updateThreadUsers(e,t).pipe(g(()=>{this.refreshThreadList()}),$(s=>(console.error("[THREAD_STATE] Error updating thread users:",s),k(()=>s))))}markDone(e){let t=this.projectStateService.getSelectedProjectId();if(!t){console.error("[THREAD_STATE] Cannot mark done: no project selected");return}this.projectApi.markThreadDone(t,e).subscribe({next:()=>this.refreshThreadList(),error:s=>console.error("[THREAD_STATE] Failed to mark thread as done:",s)})}markActive(e){let t=this.projectStateService.getSelectedProjectId();if(!t){console.error("[THREAD_STATE] Cannot mark active: no project selected");return}this.projectApi.markThreadActive(t,e).subscribe({next:()=>this.refreshThreadList(),error:s=>console.error("[THREAD_STATE] Failed to mark thread as active:",s)})}renameThread(e,t){let s=t.trim();return!s||s.length===0?(console.error("[THREAD_STATE] Cannot rename thread: name is empty after trimming"),k(()=>new Error("Thread name cannot be empty"))):(console.log("[THREAD_STATE] Renaming thread:",e,"to:",s),this.threadApi.updateThread(e,s).pipe(g(i=>{console.log("[THREAD_STATE] Thread renamed successfully:",i),this.refreshThreadList()}),$(i=>(console.error("[THREAD_STATE] Error renaming thread:",i),k(()=>i)))))}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};var ue=class n{http=a(E);usernameSubject=new r(null);authEnabledSubject=new r(!1);username$=this.usernameSubject.asObservable();authEnabled$=this.authEnabledSubject.asObservable();fetchCurrentUser(){return this.http.get("/api/user/me").pipe(g(e=>{this.usernameSubject.next(e.username),this.authEnabledSubject.next(e.authEnabled)}))}getUsername(){return this.usernameSubject.value}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};function oe(n,e=80){if(n.length<=e)return n;try{if(n.trim().startsWith("{")||n.trim().startsWith("[")){let t=JSON.parse(n),s=JSON.stringify(t);return s.length<=e?s:s.substring(0,e)+`...(${s.length} chars)`}}catch(t){}return n.substring(0,e)+"..."}var o=class{constructor(e,t){this.type=t;if(e.timestamp)this.timestamp=e.timestamp;else{let s=Math.random().toString(36).substring(2,7);this.timestamp=`${new Date().toISOString()}-${s}`}this.parentKey=e.parentKey,this.threadId=e.threadId,this.length=0}timestamp;parentKey;static type;length;threadId;get date(){let e=this.timestamp.lastIndexOf("-");if(e>0){let t=this.timestamp.substring(e+1);if(t.length===5&&/^[a-z0-9]+$/.test(t))return new Date(this.timestamp.substring(0,e))}return new Date(this.timestamp)}},L=class extends o{invite;constructor(e,t){super(e,t),this.invite=e.invite}buildAnswer(e){return new u({answer:e,parentKey:this.timestamp,invite:this.invite})}},q=class n extends o{static type="heartbeat";constructor(e){super(e,n.type)}},f=class n extends L{defaultValue;static type="invite";constructor(e){super(e,n.type),this.defaultValue=e.defaultValue}},Be="InviteEventDefault",u=class n extends o{answer;invite;name;silent;static type="answer";constructor(e){super(e,n.type),this.answer=e.answer??"No answer",this.invite=e.invite,this.name=e.name,this.silent=e.silent}},A=class n extends o{speaker;text;static type="text";constructor(e){super(e,n.type),this.speaker=e.speaker,this.text=e.text}},F=class n extends o{chunk;static type="text_chunk";constructor(e){super(e,n.type),this.chunk=e.chunk,this.length=this.chunk.length}},M=class n extends o{warning;static type="warn";constructor(e){super(e,n.type),this.warning=e.warning}},h=class n extends o{error;static type="error";constructor(e){super(e,n.type),this.error=e.error}},b=class n extends L{options;optionalQuestion;allowFreeText;static type="choice";constructor(e){super(e,n.type),this.options=Array.isArray(e.options)?e.options:[],this.optionalQuestion=e.optionalQuestion,this.allowFreeText=e.allowFreeText??!1}},v=class n extends o{toolRequestId;name;args;static type="tool_request";constructor(e){super(e,n.type),this.toolRequestId=e.toolRequestId??this.timestamp,this.name=e.name,this.args=e.args,this.length=this.args.length+this.name.length+this.toolRequestId.length+20}buildResponse(e){return new m({output:e,toolRequestId:this.toolRequestId,parentKey:this.timestamp})}toSingleLineString(e=50){let t=oe(this.args,e);return`\u{1F527} ${this.name}(${t})`}},m=class n extends o{toolRequestId;output;static type="tool_response";constructor(e){if(super(e,n.type),this.toolRequestId=e.toolRequestId||this.timestamp||new Date().toISOString(),this.output=e.output,typeof this.output=="string")this.length=this.output.length+this.toolRequestId.length+20;else if(this.output.type==="text")this.length=this.output.content.length+this.toolRequestId.length+20;else if(this.output.type==="image"){let t=(this.output.width??0)*(this.output.height??0)/750;this.length=(t?t*3.5:this.output.content.length)+this.toolRequestId.length+20}else this.length=this.toolRequestId.length+20}getTextOutput(){return typeof this.output=="string"?this.output:this.output.type==="text"?this.output.content:this.output.type==="image"?`[Image: ${this.output.mimeType}]`:""}toSingleLineString(e=50){let t=this.getTextOutput(),s=oe(t,e),i=typeof this.output!="string"&&this.output.type==="image"?" [image]":"";return`\u2B91 ${s}${i}`}},O=class n extends o{static type="thinking";static debounce=5e3;constructor(e){super(e,n.type)}},y=class n extends o{summary;static type="summary";constructor(e){super(e,n.type),this.summary=e.summary,this.length=this.summary.length}toSingleLineString(e=80){return`\u{1F4CB} Summary: ${oe(this.summary,e)}`}},S=class n extends o{role;name;content;static type="message";constructor(e){super(e,n.type),this.role=e.role,this.name=e.name,this.content=e.content,this.length=this.content.map(t=>{if(t.type==="text")return t.content.length;if(t.type==="image"){let s=(t.width||0)*(t.height||0)/750;return s?s*3.5:t.content.length}return t.type==="audio"?t.transcription?.length??100:0}).reduce((t,s)=>t+s,0)}getTextContent(){return this.content.filter(e=>e.type==="text").map(e=>e.content).join(`
|
|
2
|
+
`)}},B=class n extends o{threadId;name;summary;users;static type="thread_update";constructor(e){super(e,n.type),this.threadId=e.threadId,this.name=e.name,this.summary=e.summary,this.users=e.users}},V=class n extends o{filename;operation;size;mimeType;static type="file";constructor(e){super(e,n.type),this.filename=e.filename,this.operation=e.operation,this.size=e.size,this.mimeType=e.mimeType}toSingleLineString(){let e=this.operation==="created"?"\u{1F4C4}":this.operation==="updated"?"\u{1F4DD}":"\u{1F5D1}\uFE0F",t=this.size?` (${(this.size/1024).toFixed(1)} KB)`:"";return`${e} ${this.operation}: ${this.filename}${t}`}},z=class n extends o{authUrl;state;integrationName;static type="oauth_request";constructor(e){super(e,n.type),this.authUrl=e.authUrl,this.state=e.state,this.integrationName=e.integrationName}},R=class n extends o{subThreadId;agentName;static type="delegation";constructor(e){super(e,n.type),this.subThreadId=e.subThreadId,this.agentName=e.agentName}},H=class n extends o{code;state;integrationName;error;errorDescription;static type="oauth_callback";constructor(e){super(e,n.type),this.code=e.code,this.state=e.state,this.integrationName=e.integrationName,this.error=e.error,this.errorDescription=e.errorDescription}},fe={[S.type]:S,[u.type]:u,[b.type]:b,[R.type]:R,[h.type]:h,[q.type]:q,[f.type]:f,[v.type]:v,[m.type]:m,[A.type]:A,[F.type]:F,[O.type]:O,[M.type]:M,[B.type]:B,[y.type]:y,[V.type]:V,[z.type]:z,[H.type]:H};function ae(n){let e=fe[n.type];return e?new e(n):void 0}var Ge=[{id:"builtin-plan",name:"plan",description:"Build a plan to complete the given task",source:"builtin",commands:[`@ We start a 3 phase process to build a comprehensive execution plan for the following task:
|
|
3
|
+
|
|
4
|
+
<task>
|
|
5
|
+
{{PARAMETERS}}
|
|
6
|
+
</task>
|
|
7
|
+
|
|
8
|
+
There will be 3 phases:
|
|
9
|
+
1. Research and understanding
|
|
10
|
+
2. Clarifying questions
|
|
11
|
+
3. Plan creation
|
|
12
|
+
|
|
13
|
+
Do not try to do all at once, wait for my request at each time.
|
|
14
|
+
|
|
15
|
+
Now we start with phase 1:
|
|
16
|
+
|
|
17
|
+
1. **Analyze the request** to identify:
|
|
18
|
+
- Core requirements and objectives
|
|
19
|
+
- Implicit assumptions or expectations
|
|
20
|
+
- Technical scope and constraints
|
|
21
|
+
|
|
22
|
+
2. **Research relevant context** using available tools:
|
|
23
|
+
- Use whatever tools you have available (file reading, API calls, search, etc.)
|
|
24
|
+
- Gather information about existing patterns, structures, and conventions
|
|
25
|
+
- Identify relevant files, modules, or resources
|
|
26
|
+
- Document key findings briefly
|
|
27
|
+
|
|
28
|
+
3. **Assess feasibility**:
|
|
29
|
+
- Identify potential challenges or blockers
|
|
30
|
+
- Note any dependencies or prerequisites
|
|
31
|
+
- Consider alternative approaches if applicable
|
|
32
|
+
|
|
33
|
+
Do not assume you have specific tools - use what's available to you.
|
|
34
|
+
|
|
35
|
+
Do not produce any document at this stage as you will have access to the accumulated research results later.
|
|
36
|
+
`,`@ let's continue with Phase 2: Clarifying Questions regarding the initial task.
|
|
37
|
+
|
|
38
|
+
<task>
|
|
39
|
+
{{PARAMETERS}}
|
|
40
|
+
</task>
|
|
41
|
+
|
|
42
|
+
Based on your research and understanding:
|
|
43
|
+
|
|
44
|
+
1. **Identify ambiguities** or missing information that could impact the completion of the task
|
|
45
|
+
- no boundaries
|
|
46
|
+
- insufficient definition of done
|
|
47
|
+
- lack of pre-requisites
|
|
48
|
+
|
|
49
|
+
2. **Ask focused questions** if clarification is needed:
|
|
50
|
+
- Use the 'invite' or 'choice' tools for user input
|
|
51
|
+
- Keep questions concise and specific
|
|
52
|
+
- Prioritize questions that significantly impact the approach
|
|
53
|
+
|
|
54
|
+
3. **Skip this phase** if the requirements are clear enough to proceed
|
|
55
|
+
|
|
56
|
+
Remember: Only ask questions that are truly necessary to create a solid plan.`,`@ finish with Phase 3: Plan Creation
|
|
57
|
+
|
|
58
|
+
Break down the task into 3-10 clear, actionable steps. Each step should be substantial enough to represent meaningful progress, but focused enough to be completed in one session.
|
|
59
|
+
|
|
60
|
+
Create a detailed execution plan:
|
|
61
|
+
- if you have access to the exchange area, save the plan there as 'plan.md'.
|
|
62
|
+
- otherwise, output the plan in the conversation.
|
|
63
|
+
- do not write any other document
|
|
64
|
+
|
|
65
|
+
The plan must follow this Markdown structure:
|
|
66
|
+
|
|
67
|
+
# Execution Plan: [Task Title]
|
|
68
|
+
|
|
69
|
+
## Overview
|
|
70
|
+
1-2 sentence summary of what will be accomplished.
|
|
71
|
+
|
|
72
|
+
## Context
|
|
73
|
+
Key information and constraints identified during research:
|
|
74
|
+
- Relevant patterns/conventions found
|
|
75
|
+
- Constraints or limitations
|
|
76
|
+
- Dependencies or prerequisites
|
|
77
|
+
- Key resources or materials involved
|
|
78
|
+
|
|
79
|
+
## Steps
|
|
80
|
+
|
|
81
|
+
### Step 1: [Step Title]
|
|
82
|
+
- **What to do**: Clear description of the action to take
|
|
83
|
+
- **Resources needed**: List files, tools, information, or materials required
|
|
84
|
+
- **Expected outcome**: What should be produced or achieved
|
|
85
|
+
- **Validation**: How to verify this step is complete
|
|
86
|
+
- **Dependencies**: Which previous steps must complete first (or "None")
|
|
87
|
+
|
|
88
|
+
### Step 2: [Step Title]
|
|
89
|
+
[Same structure as Step 1]
|
|
90
|
+
|
|
91
|
+
[Continue for all steps...]
|
|
92
|
+
|
|
93
|
+
## Success Criteria
|
|
94
|
+
How to verify the task is fully complete:
|
|
95
|
+
1. Objective measures of completion
|
|
96
|
+
2. Quality checks or review points
|
|
97
|
+
3. Final validation steps
|
|
98
|
+
|
|
99
|
+
## Risks & Considerations
|
|
100
|
+
- Potential challenges or obstacles
|
|
101
|
+
- Alternative approaches considered
|
|
102
|
+
- Areas requiring special attention
|
|
103
|
+
- Future improvements or follow-up items
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
After outputting the plan in the right place (in exchange or in conversation or according to user directives):
|
|
108
|
+
- do not produce other outputs nor documents
|
|
109
|
+
- do not start executing the plan`],createdBy:"system",createdAt:new Date("2024-01-01").toISOString(),webhookEnabled:!1,parameterFormat:""},{id:"builtin-execute-plan",name:"execute-plan",description:"Execute a previously created plan step by step, with validation and progress tracking.",source:"builtin",commands:[`@ Execute the plan from the exchange area or outlined previously in the conversation:
|
|
110
|
+
|
|
111
|
+
## Preparation
|
|
112
|
+
1. **Load the plan**: Read from exchange area (plan.md) or use previously discussed plan
|
|
113
|
+
2. **Review**: Understand the overall objective, context, and step sequence
|
|
114
|
+
3. **Pre-check**: Verify prerequisites are met; report any obvious issues
|
|
115
|
+
|
|
116
|
+
## Step-by-Step Execution
|
|
117
|
+
|
|
118
|
+
For each step in order:
|
|
119
|
+
|
|
120
|
+
1. **Announce**: State which step you're starting and what you'll do
|
|
121
|
+
2. **Check dependencies**: Verify required previous steps are complete
|
|
122
|
+
3. **Execute**: Perform the actions specified in the step
|
|
123
|
+
4. **Validate**: Apply the validation criteria from the plan
|
|
124
|
+
5. **Report**: Confirm completion and note any deviations
|
|
125
|
+
|
|
126
|
+
**For significant or risky steps**: Ask user confirmation before proceeding (use 'choice' tool)
|
|
127
|
+
|
|
128
|
+
## Issue Handling
|
|
129
|
+
|
|
130
|
+
If a step fails:
|
|
131
|
+
- Report the issue clearly
|
|
132
|
+
- Suggest solutions (retry, skip if non-critical, or stop)
|
|
133
|
+
- Use 'choice' tool to ask how to proceed if needed
|
|
134
|
+
|
|
135
|
+
## Completion
|
|
136
|
+
|
|
137
|
+
1. **Final verification**: Apply success criteria from the plan
|
|
138
|
+
2. **Summary**: Report what was accomplished, any deviations, validation results, and next steps
|
|
139
|
+
|
|
140
|
+
## Guidelines
|
|
141
|
+
- Follow the plan's order unless circumstances require adaptation
|
|
142
|
+
- Communicate progress clearly at each step, without excessive details
|
|
143
|
+
- Ask for guidance when the plan is unclear or issues arise`],createdBy:"system",createdAt:new Date("2024-01-01").toISOString(),webhookEnabled:!1,parameterFormat:""},{id:"builtin-re-prompt",name:"re-prompt",description:"Transform a vague request into a detailed, actionable prompt",source:"builtin",commands:[`@ I need you to analyze and reformulate the following request to make it more precise and actionable.
|
|
144
|
+
|
|
145
|
+
## User's initial request
|
|
146
|
+
|
|
147
|
+
{{PARAMETERS}}
|
|
148
|
+
|
|
149
|
+
## Your task
|
|
150
|
+
|
|
151
|
+
1. **Analyze the request** to identify:
|
|
152
|
+
- What is explicitly stated
|
|
153
|
+
- What is implicit or assumed
|
|
154
|
+
- What information is missing or ambiguous
|
|
155
|
+
- The likely intent behind the request
|
|
156
|
+
|
|
157
|
+
2. **Ask clarifying questions** if needed:
|
|
158
|
+
- If the request is too vague or has multiple interpretations
|
|
159
|
+
- If critical information is missing
|
|
160
|
+
- Use the 'invite' or 'choice' tools to gather necessary details
|
|
161
|
+
|
|
162
|
+
3. **Reformulate the request** into a clear, detailed, and actionable prompt:
|
|
163
|
+
- Make implicit requirements explicit
|
|
164
|
+
- Add relevant context from the current project
|
|
165
|
+
- Specify expected outcomes or deliverables
|
|
166
|
+
- Break down complex requests into clear steps if needed
|
|
167
|
+
- Use precise technical terminology when appropriate
|
|
168
|
+
|
|
169
|
+
4. **Present the reformulated request** and ask for confirmation:
|
|
170
|
+
- Show the enhanced version clearly
|
|
171
|
+
- Explain key changes or additions you made
|
|
172
|
+
- Ask if this matches the user's intent
|
|
173
|
+
|
|
174
|
+
The goal is to transform a rough idea into a well-defined request that will produce better AI responses.`],createdBy:"system",createdAt:new Date("2024-01-01").toISOString(),webhookEnabled:!1,parameterFormat:""},{id:"builtin-memory-learn",name:"memory-learn",description:"Extract and memorize new knowledge gained from recent context",source:"builtin",commands:[`@ Learn about the following topic and memorize relevant insights if defined:
|
|
175
|
+
|
|
176
|
+
<topic>
|
|
177
|
+
{{PARAMETERS}}
|
|
178
|
+
</topic>
|
|
179
|
+
|
|
180
|
+
If no specific topic is provided, extract learnings from the entire recent conversation context.
|
|
181
|
+
|
|
182
|
+
## Process
|
|
183
|
+
|
|
184
|
+
1. **Identify new knowledge**: From the recent conversation context, identify what you learned that:
|
|
185
|
+
- Was not in the initially given context
|
|
186
|
+
- Is specific to this user or project (not generic knowledge)
|
|
187
|
+
- Is useful and worth remembering
|
|
188
|
+
- Represents understanding, not just file copies
|
|
189
|
+
|
|
190
|
+
2. **Organize insights**: Split the knowledge into cohesive subjects, each with:
|
|
191
|
+
- **Title**: Short and descriptive (one sentence maximum)
|
|
192
|
+
- **Content**: Detailed explanation of what was learned
|
|
193
|
+
- Length: at most 3 paragraphs or short extracts and notes
|
|
194
|
+
- Format: Well-structured markdown
|
|
195
|
+
- Focus: Specific patterns, decisions, constraints, or insights
|
|
196
|
+
|
|
197
|
+
3. **Check for redundancy**: Before memorizing:
|
|
198
|
+
- Review the list of existing memories to avoid duplication
|
|
199
|
+
- If a similar memory exists, consider updating it instead of creating a new one
|
|
200
|
+
- delete memories if needed
|
|
201
|
+
|
|
202
|
+
4. **Memorize**: Use the memorization tools to save each subject:
|
|
203
|
+
- Choose appropriate level if available (PROJECT or USER)
|
|
204
|
+
- Ensure clear structure and completeness
|
|
205
|
+
- Memorize one subject at a time
|
|
206
|
+
|
|
207
|
+
## Guidelines
|
|
208
|
+
- Focus on actionable insights, not generic facts
|
|
209
|
+
- Ensure memories are self-contained and clear
|
|
210
|
+
- Avoid redundancy with existing memories
|
|
211
|
+
- Prioritize quality over quantity`],createdBy:"system",createdAt:new Date("2024-01-01").toISOString(),webhookEnabled:!1,parameterFormat:""},{id:"builtin-memory-curate",name:"memory-curate",description:"Analyze and clean up the memory system by consolidating redundancies and removing outdated information",source:"builtin",commands:[`@ we start a 4 phase memory curation process. Complete only the requested phase at each time.
|
|
212
|
+
|
|
213
|
+
Phase 1: Analyze redundancies
|
|
214
|
+
|
|
215
|
+
Review all current memories to identify:
|
|
216
|
+
|
|
217
|
+
1. **Redundant memories** that:
|
|
218
|
+
- Cover similar or overlapping topics
|
|
219
|
+
- Contain duplicate information
|
|
220
|
+
- Could be consolidated for better clarity
|
|
221
|
+
|
|
222
|
+
2. **For each group of redundant memories**:
|
|
223
|
+
- List the memory titles involved
|
|
224
|
+
- Explain the redundancy briefly
|
|
225
|
+
- Propose a consolidation approach
|
|
226
|
+
|
|
227
|
+
Do not make changes yet - just analyze and report findings.`,`@ Phase 2: Consolidate redundancies
|
|
228
|
+
|
|
229
|
+
Based on the analysis from Phase 1:
|
|
230
|
+
|
|
231
|
+
1. **For each identified redundancy**:
|
|
232
|
+
- Delete the individual redundant memories using deleteMemory
|
|
233
|
+
- Create a new consolidated memory that:
|
|
234
|
+
- Maintains all critical details from the originals
|
|
235
|
+
- Provides clear, well-structured content
|
|
236
|
+
- Uses appropriate level (PROJECT or USER)
|
|
237
|
+
- Explain your consolidation reasoning
|
|
238
|
+
|
|
239
|
+
2. **Be proactive but careful**: Preserve important details while eliminating duplication.`,`@ Phase 3: Check for outdated information
|
|
240
|
+
|
|
241
|
+
Review remaining memories for accuracy and relevance:
|
|
242
|
+
|
|
243
|
+
1. **Compare each memory against**:
|
|
244
|
+
- Other memories for inconsistencies
|
|
245
|
+
- Current project context for outdated information
|
|
246
|
+
- Core documentation for misalignments
|
|
247
|
+
|
|
248
|
+
2. **For each problematic memory**:
|
|
249
|
+
- List the memory title with brief explanation of the issue
|
|
250
|
+
- Take appropriate action:
|
|
251
|
+
- Delete if outdated or incorrect
|
|
252
|
+
- Update if incomplete or partially incorrect
|
|
253
|
+
- Consolidate if it fits better elsewhere
|
|
254
|
+
- Explain your reasoning clearly
|
|
255
|
+
|
|
256
|
+
Be thorough in your analysis.`,`@ Phase 4: Final verification
|
|
257
|
+
|
|
258
|
+
Verify the memory system's overall health:
|
|
259
|
+
|
|
260
|
+
1. **Review the current state**:
|
|
261
|
+
- Check overall structure and organization
|
|
262
|
+
- Verify each memory for completeness and validity
|
|
263
|
+
- Confirm proper categorization (PROJECT vs USER)
|
|
264
|
+
|
|
265
|
+
2. **Document the results**:
|
|
266
|
+
- Summarize what was consolidated or removed
|
|
267
|
+
- List any remaining issues or concerns
|
|
268
|
+
- Provide recommendations for maintaining memory quality
|
|
269
|
+
|
|
270
|
+
This ensures the memory system stays efficient and valuable.`],createdBy:"system",createdAt:new Date("2024-01-01").toISOString(),webhookEnabled:!1,parameterFormat:""}];var ct=[S.type,v.type,m.type,y.type,f.type,b.type,u.type,R.type];var he={CONFLUENCE:[],GIT:[],GIT_WORKTREE:[],GITLAB:[],JIRA:[],SLACK:[],ZENDESK:[],BASECAMP:[]},Rt=Object.keys(he).filter(n=>he[n]?.length===0);var W=class n{STORAGE_KEY="coday-preferences";isDesktopApp=!1;electronStorage=null;voiceLanguageSubject=new r("en-US");voiceLanguage$=this.voiceLanguageSubject.asObservable();voiceInputModeSubject=new r("browser");voiceInputMode$=this.voiceInputModeSubject.asObservable();enterToSendSubject=new r(!0);enterToSend$=this.enterToSendSubject.asObservable();voiceAnnounceEnabledSubject=new r(!1);voiceAnnounceEnabled$=this.voiceAnnounceEnabledSubject.asObservable();voiceModeSubject=new r("speech");voiceMode$=this.voiceModeSubject.asObservable();voiceReadFullTextSubject=new r(!1);voiceReadFullText$=this.voiceReadFullTextSubject.asObservable();voiceVolumeSubject=new r(.8);voiceVolume$=this.voiceVolumeSubject.asObservable();voiceRateSubject=new r(1.2);voiceRate$=this.voiceRateSubject.asObservable();selectedVoiceSubject=new r(null);selectedVoice$=this.selectedVoiceSubject.asObservable();printTechnicalMessagesSubject=new r(!1);printTechnicalMessages$=this.printTechnicalMessagesSubject.asObservable();hideTechnicalMessagesSubject=new r(!0);hideTechnicalMessages$=this.hideTechnicalMessagesSubject.asObservable();hideWarningMessagesSubject=new r(!1);hideWarningMessages$=this.hideWarningMessagesSubject.asObservable();agentNotificationEnabledSubject=new r(!1);agentNotificationEnabled$=this.agentNotificationEnabledSubject.asObservable();notificationSoundEnabledSubject=new r(!1);notificationSoundEnabled$=this.notificationSoundEnabledSubject.asObservable();browserNotificationEnabledSubject=new r(!1);browserNotificationEnabled$=this.browserNotificationEnabledSubject.asObservable();themeSubject=new r("light");theme$=this.themeSubject.asObservable();missionPreviewEnabledSubject=new r(!1);missionPreviewEnabled$=this.missionPreviewEnabledSubject.asObservable();constructor(){console.log("[PREFERENCES] Initializing preferences service"),typeof window<"u"&&window.codayDesktop?.storage&&(this.isDesktopApp=!0,this.electronStorage=window.codayDesktop.storage,console.log("[PREFERENCES] Running in desktop app mode with persistent storage")),this.initializePreferences()}initializePreferences(){this.isDesktopApp?this.loadPreferencesAsync():this.loadPreferencesSync()}loadPreferencesSync(){let e=this.getPreferenceSync("voiceLanguage","en-US")??"en-US";this.voiceLanguageSubject.next(e),console.log("[PREFERENCES] Voice language initialized to:",e);let t=this.getPreferenceSync("useEnterToSend",!0)??!0;this.enterToSendSubject.next(t),console.log("[PREFERENCES] Enter to send initialized to:",t);let s=this.getPreferenceSync("voiceAnnounceEnabled",!1)??!1;this.voiceAnnounceEnabledSubject.next(s);let i=this.getPreferenceSync("voiceMode","speech")??"speech";this.voiceModeSubject.next(i);let P=this.getPreferenceSync("voiceReadFullText",!1)??!1;this.voiceReadFullTextSubject.next(P);let l=this.getPreferenceSync("voiceVolume",.8)??.8;this.voiceVolumeSubject.next(l);let p=this.getPreferenceSync("voiceRate",1.2)??1.2;this.voiceRateSubject.next(p);let I=this.getPreferenceSync("selectedVoice",null)??null;this.selectedVoiceSubject.next(I);let _=this.getPreferenceSync("printTechnicalMessages",!1)??!1;this.printTechnicalMessagesSubject.next(_);let K=this.getPreferenceSync("hideTechnicalMessages",!0)??!0;this.hideTechnicalMessagesSubject.next(K);let G=this.getPreferenceSync("hideWarningMessages",!1)??!1;this.hideWarningMessagesSubject.next(G);let Q=this.getPreferenceSync("agentNotificationEnabled",!1)??!1;this.agentNotificationEnabledSubject.next(Q);let J=this.getPreferenceSync("notificationSoundEnabled",!0)??!0;this.notificationSoundEnabledSubject.next(J);let Y=this.getPreferenceSync("browserNotificationEnabled",!1)??!1;this.browserNotificationEnabledSubject.next(Y);let X=this.getPreferenceSync("theme","light")??"light";this.themeSubject.next(X);let Z=this.getPreferenceSync("missionPreviewEnabled",!1)??!1;this.missionPreviewEnabledSubject.next(Z);let ee=this.getPreferenceSync("voiceInputMode","browser")??"browser";this.voiceInputModeSubject.next(ee),console.log("[PREFERENCES] All preferences initialized successfully")}loadPreferencesAsync(){return d(this,null,function*(){let e=(yield this.getPreferenceAsync("voiceLanguage","en-US"))??"en-US";this.voiceLanguageSubject.next(e),console.log("[PREFERENCES] Voice language initialized to:",e);let t=(yield this.getPreferenceAsync("useEnterToSend",!0))??!0;this.enterToSendSubject.next(t),console.log("[PREFERENCES] Enter to send initialized to:",t);let s=(yield this.getPreferenceAsync("voiceAnnounceEnabled",!1))??!1;this.voiceAnnounceEnabledSubject.next(s);let i=(yield this.getPreferenceAsync("voiceMode","speech"))??"speech";this.voiceModeSubject.next(i);let P=(yield this.getPreferenceAsync("voiceReadFullText",!1))??!1;this.voiceReadFullTextSubject.next(P);let l=(yield this.getPreferenceAsync("voiceVolume",.8))??.8;this.voiceVolumeSubject.next(l);let p=(yield this.getPreferenceAsync("voiceRate",1.2))??1.2;this.voiceRateSubject.next(p);let I=(yield this.getPreferenceAsync("selectedVoice",null))??null;this.selectedVoiceSubject.next(I);let _=(yield this.getPreferenceAsync("printTechnicalMessages",!1))??!1;this.printTechnicalMessagesSubject.next(_);let K=(yield this.getPreferenceAsync("hideTechnicalMessages",!0))??!0;this.hideTechnicalMessagesSubject.next(K);let G=(yield this.getPreferenceAsync("hideWarningMessages",!1))??!1;this.hideWarningMessagesSubject.next(G);let Q=(yield this.getPreferenceAsync("agentNotificationEnabled",!1))??!1;this.agentNotificationEnabledSubject.next(Q);let J=(yield this.getPreferenceAsync("notificationSoundEnabled",!0))??!0;this.notificationSoundEnabledSubject.next(J);let Y=(yield this.getPreferenceAsync("browserNotificationEnabled",!1))??!1;this.browserNotificationEnabledSubject.next(Y);let X=(yield this.getPreferenceAsync("theme","light"))??"light";this.themeSubject.next(X);let Z=(yield this.getPreferenceAsync("missionPreviewEnabled",!1))??!1;this.missionPreviewEnabledSubject.next(Z);let ee=(yield this.getPreferenceAsync("voiceInputMode","browser"))??"browser";this.voiceInputModeSubject.next(ee),console.log("[PREFERENCES] All preferences initialized successfully (async)")})}getPreference(e,t){return this.getPreferenceSync(e,t)}getPreferenceSync(e,t){try{let s=localStorage.getItem(this.STORAGE_KEY);if(!s)return t;let i=JSON.parse(s);return i[e]!==void 0?i[e]:t}catch(s){return t}}getPreferenceAsync(e,t){return d(this,null,function*(){if(!this.electronStorage)return this.getPreferenceSync(e,t);try{let s=yield this.electronStorage.get(this.STORAGE_KEY);if(!s)return t;let i=JSON.parse(s);return i[e]!==void 0?i[e]:t}catch(s){return t}})}setPreference(e,t){this.isDesktopApp?this.setPreferenceAsync(e,t):this.setPreferenceSync(e,t)}setPreferenceSync(e,t){try{let s=localStorage.getItem(this.STORAGE_KEY),i=s?JSON.parse(s):{};i[e]=t,localStorage.setItem(this.STORAGE_KEY,JSON.stringify(i)),this.updateSubject(e,t)}catch(s){console.error("Failed to set preference:",s)}}setPreferenceAsync(e,t){return d(this,null,function*(){if(!this.electronStorage){this.setPreferenceSync(e,t);return}try{let s=yield this.electronStorage.get(this.STORAGE_KEY),i=s?JSON.parse(s):{};i[e]=t,yield this.electronStorage.set(this.STORAGE_KEY,JSON.stringify(i)),this.updateSubject(e,t)}catch(s){console.error("Failed to set preference:",s)}})}updateSubject(e,t){e==="voiceLanguage"&&this.voiceLanguageSubject.next(t),e==="useEnterToSend"&&this.enterToSendSubject.next(t),e==="voiceAnnounceEnabled"&&this.voiceAnnounceEnabledSubject.next(t),e==="voiceMode"&&this.voiceModeSubject.next(t),e==="voiceReadFullText"&&this.voiceReadFullTextSubject.next(t),e==="voiceVolume"&&this.voiceVolumeSubject.next(t),e==="voiceRate"&&this.voiceRateSubject.next(t),e==="selectedVoice"&&this.selectedVoiceSubject.next(t),e==="printTechnicalMessages"&&this.printTechnicalMessagesSubject.next(t),e==="hideTechnicalMessages"&&this.hideTechnicalMessagesSubject.next(t),e==="hideWarningMessages"&&this.hideWarningMessagesSubject.next(t),e==="agentNotificationEnabled"&&this.agentNotificationEnabledSubject.next(t),e==="notificationSoundEnabled"&&this.notificationSoundEnabledSubject.next(t),e==="browserNotificationEnabled"&&this.browserNotificationEnabledSubject.next(t),e==="theme"&&this.themeSubject.next(t),e==="voiceInputMode"&&this.voiceInputModeSubject.next(t),e==="missionPreviewEnabled"&&this.missionPreviewEnabledSubject.next(t)}setVoiceLanguage(e){console.log("[PREFERENCES] Setting voice language to:",e),this.setPreference("voiceLanguage",e)}getVoiceLanguage(){return this.getPreference("voiceLanguage","en-US")??"en-US"}setVoiceInputMode(e){console.log("[PREFERENCES] Setting voice input mode to:",e),this.setPreference("voiceInputMode",e)}getVoiceInputMode(){return this.getPreference("voiceInputMode","browser")??"browser"}setEnterToSend(e){console.log("[PREFERENCES] Setting Enter to send to:",e),this.setPreference("useEnterToSend",e)}getEnterToSend(){return this.getPreference("useEnterToSend",!1)??!1}setVoiceAnnounceEnabled(e){console.log("[PREFERENCES] Setting voice announce enabled to:",e),this.setPreference("voiceAnnounceEnabled",e)}getVoiceAnnounceEnabled(){return this.getPreference("voiceAnnounceEnabled",!1)??!1}setVoiceMode(e){console.log("[PREFERENCES] Setting voice mode to:",e),this.setPreference("voiceMode",e)}getVoiceMode(){return this.getPreference("voiceMode","speech")??"speech"}setVoiceReadFullText(e){console.log("[PREFERENCES] Setting voice read full text to:",e),this.setPreference("voiceReadFullText",e)}getVoiceReadFullText(){return this.getPreference("voiceReadFullText",!1)??!1}setVoiceVolume(e){let t=Math.max(0,Math.min(1,e));console.log("[PREFERENCES] Setting voice volume to:",t),this.setPreference("voiceVolume",t)}getVoiceVolume(){return this.getPreference("voiceVolume",.8)??.8}setVoiceRate(e){let t=Math.max(.5,Math.min(2,e));console.log("[PREFERENCES] Setting voice rate to:",t),this.setPreference("voiceRate",t)}getVoiceRate(){return this.getPreference("voiceRate",1.2)??1.2}setSelectedVoice(e){console.log("[PREFERENCES] Setting selected voice to:",e),this.setPreference("selectedVoice",e)}getSelectedVoice(){return this.getPreference("selectedVoice",null)??null}setPrintTechnicalMessages(e){console.log("[PREFERENCES] Setting print technical messages to:",e),this.setPreference("printTechnicalMessages",e)}getPrintTechnicalMessages(){return this.getPreference("printTechnicalMessages",!1)??!1}setHideTechnicalMessages(e){console.log("[PREFERENCES] Setting hide technical messages to:",e),this.setPreference("hideTechnicalMessages",e)}getHideTechnicalMessages(){return this.getPreference("hideTechnicalMessages",!0)??!0}setHideWarningMessages(e){console.log("[PREFERENCES] Setting hide warning messages to:",e),this.setPreference("hideWarningMessages",e)}getHideWarningMessages(){return this.getPreference("hideWarningMessages",!1)??!1}setAgentNotificationEnabled(e){console.log("[PREFERENCES] Setting agent notification enabled to:",e),this.setPreference("agentNotificationEnabled",e)}getAgentNotificationEnabled(){return this.getPreference("agentNotificationEnabled",!1)??!1}setNotificationSoundEnabled(e){console.log("[PREFERENCES] Setting notification sound enabled to:",e),this.setPreference("notificationSoundEnabled",e)}getNotificationSoundEnabled(){return this.getPreference("notificationSoundEnabled",!0)??!0}setBrowserNotificationEnabled(e){console.log("[PREFERENCES] Setting browser notification enabled to:",e),this.setPreference("browserNotificationEnabled",e)}getBrowserNotificationEnabled(){return this.getPreference("browserNotificationEnabled",!1)??!1}setMissionPreviewEnabled(e){this.setPreference("missionPreviewEnabled",e)}getMissionPreviewEnabled(){return this.getPreference("missionPreviewEnabled",!1)??!1}getMissionPreviewPanelWidth(){return this.getPreference("missionPreviewPanelWidth",33)??33}setMissionPreviewPanelWidth(e){this.setPreference("missionPreviewPanelWidth",e)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};var pe=class n{currentThemeSubject=new r("light");currentTheme$=this.currentThemeSubject.asObservable();preferences=a(W);subscription=null;constructor(){console.log("[THEME] Initializing theme service"),this.initializeTheme(),this.setupSystemThemeListener()}ngOnDestroy(){this.subscription?.unsubscribe()}initializeTheme(){this.subscription=this.preferences.theme$.subscribe(e=>{console.log("[THEME] Theme preference changed to:",e),this.applyTheme(e)})}setTheme(e){this.preferences.setPreference("theme",e),this.applyTheme(e)}getCurrentTheme(){return this.currentThemeSubject.value}applyTheme(e){if(console.log("[THEME] Applying theme:",e),this.currentThemeSubject.next(e),e==="system")if(typeof window<"u"&&window.matchMedia){let s=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";console.log("[THEME] System theme resolved to:",s),this.setDocumentTheme(s)}else console.log("[THEME] matchMedia not available, defaulting to light theme"),this.setDocumentTheme("light");else this.setDocumentTheme(e)}setDocumentTheme(e){console.log("[THEME] Setting document theme to:",e),typeof document<"u"&&document.documentElement&&(e==="dark"?document.documentElement.setAttribute("data-theme","dark"):document.documentElement.removeAttribute("data-theme"))}setupSystemThemeListener(){typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",e=>{this.getCurrentTheme()==="system"&&this.setDocumentTheme(e.matches?"dark":"light")})}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};var ge=class n{eventSource=null;eventsSubject=new j;connectionStatusSubject=new r({connected:!1,reconnectAttempts:0,maxAttempts:3});reconnectAttempts=0;MAX_RECONNECT_ATTEMPTS=3;RECONNECT_DELAY=2e3;events$=this.eventsSubject.asObservable();connectionStatus$=this.connectionStatusSubject.asObservable();ngZone=a(le);connectToThread(e,t){console.log("[SSE] Connecting to thread event stream:",e,t),this.eventSource&&(console.log("[SSE] Closing existing EventSource"),this.eventSource.close());let s=`/api/projects/${e}/threads/${t}/event-stream`;console.log("[SSE] EventSource URL:",s),this.eventSource=new EventSource(s),this.setupEventHandlers()}setupEventHandlers(){this.eventSource&&(this.eventSource.onmessage=e=>{this.ngZone.run(()=>{console.log("[SSE] Message received:",e.data.substring(0,100)),this.reconnectAttempts=0,this.updateConnectionStatus(!0,0);try{let t=JSON.parse(e.data),s=ae(t);s?(console.log("[SSE] Event:",s.type),this.eventsSubject.next(s)):console.warn("[SSE] Failed to build event:",t.type)}catch(t){console.error("[SSE] Parse error:",t.message)}})},this.eventSource.onopen=()=>{this.ngZone.run(()=>{console.log("[SSE] Connection established"),this.reconnectAttempts=0,this.updateConnectionStatus(!0,0)})},this.eventSource.onerror=e=>{this.ngZone.run(()=>{console.log("[SSE] EventSource error:",e),this.eventSource?.readyState===EventSource.CLOSED&&(console.log("[SSE] Connection closed"),this.updateConnectionStatus(!1,this.reconnectAttempts),this.reconnectAttempts<this.MAX_RECONNECT_ATTEMPTS?(console.log(`[SSE] Attempting reconnect ${this.reconnectAttempts+1}/${this.MAX_RECONNECT_ATTEMPTS}`),this.eventsSubject.next(new h({error:new Error(`Connection lost. Attempting to reconnect (${this.reconnectAttempts+1}/${this.MAX_RECONNECT_ATTEMPTS})...`)})),setTimeout(()=>{this.reconnectAttempts++,console.warn("[SSE] Reconnection may not work properly with thread-based connections")},this.RECONNECT_DELAY)):(console.log("[SSE] Max reconnection attempts reached"),this.eventsSubject.next(new h({error:new Error("Connection lost permanently. Please refresh the page.")}))))})})}disconnect(){this.eventSource&&(console.log("[SSE] Disconnecting EventSource"),this.eventSource.close(),this.eventSource=null,this.updateConnectionStatus(!1,0))}updateConnectionStatus(e,t){this.connectionStatusSubject.next({connected:e,reconnectAttempts:t,maxAttempts:this.MAX_RECONNECT_ATTEMPTS})}ngOnDestroy(){this.disconnect(),this.eventsSubject.complete(),this.connectionStatusSubject.complete()}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};var me=class n{http=a(E);projectState=a(w);threadState=a(U);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/threads/${this.threadState.getSelectedThreadIdOrThrow()}/messages`}getMessages(){return this.http.get(this.getBaseUrl())}sendMessage(e){return this.http.post(this.getBaseUrl(),e,{responseType:"text"})}sendFreeMessage(e){return this.http.post(this.getBaseUrl(),{message:e})}getMessage(e){return this.http.get(`${this.getBaseUrl()}/${encodeURIComponent(e)}`)}deleteMessage(e){return this.http.delete(`${this.getBaseUrl()}/${encodeURIComponent(e)}`)}getFormattedMessage(e){return this.http.get(`${this.getBaseUrl()}/${encodeURIComponent(e)}/formatted`,{responseType:"text"})}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};export{N as a,U as b,ue as c,q as d,f as e,Be as f,u as g,A as h,F as i,M as j,h as k,b as l,v as m,m as n,O as o,S as p,B as q,V as r,z as s,R as t,H as u,ae as v,W as w,pe as x,ge as y,me as z};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as Fe,b as Ke,c as Z}from"./chunk-6BPAEX7H.js";import{a as He}from"./chunk-2PCZ45ML.js";import{d as Je}from"./chunk-TPSIRGLZ.js";import{a as Ue}from"./chunk-NLRFBAA2.js";import{a as q,b as $,c as Pe,d as je,f as Xe,h as Ze}from"./chunk-CC5AKB2A.js";import"./chunk-O7ALTLRI.js";import{a as ve,b as Ce,c as ke,e as Ie,l as Ae,o as Re,q as Ge,v as Ve,w as Qe}from"./chunk-APQFC6DT.js";import"./chunk-FAAHG43E.js";import"./chunk-2NXSUKWO.js";import{d as ce,e as de}from"./chunk-LTFITYTW.js";import"./chunk-IF2A56UI.js";import{a as qe,b as $e,c as Be}from"./chunk-M7DIJJQG.js";import{a as ze,b as We}from"./chunk-OI3PIKFL.js";import"./chunk-47EXVHLI.js";import"./chunk-SKVQOMLG.js";import{c as Ye}from"./chunk-JPVNXEXU.js";import{a as Te,c as ye,d as Se,e as Me,j as Le}from"./chunk-BOMZXZNH.js";import{a as xe,b as we,c as Oe,e as De,f as B,i as z,j as W,m as U,n as H}from"./chunk-JRNOMFVU.js";import{a as Ne,b as P}from"./chunk-LCBWJP6Z.js";import{a as me,d as A,e as ge,f as ue,g as _e,h as he}from"./chunk-75DAJTMO.js";import"./chunk-J4KEKL2K.js";import{a as F,b as L}from"./chunk-MMKBNIVO.js";import{C as Ee}from"./chunk-DLU3TQID.js";import{a as be,b as V}from"./chunk-G4QDBE4F.js";import{O as fe,Q as R,S as G,n as pe}from"./chunk-24VYLV4I.js";import{Bb as x,Db as u,Fb as p,Ja as K,Jb as oe,Ka as c,Kb as re,Lb as ae,Pb as S,Qb as se,Rb as y,Rc as le,Tb as l,Ub as b,Vb as j,Wa as N,Z as E,a as O,b as D,ca as h,ga as m,ha as g,jb as Y,kc as v,lb as C,ma as ie,mb as k,ob as I,pb as w,qb as T,rb as f,s as te,sb as o,t as ne,ta as _,tb as s,ub as M}from"./chunk-RNXBUYHW.js";var lt=(r,t)=>t.name;function ct(r,t){if(r&1&&(o(0,"mat-option",11),l(1),s()),r&2){let e=t.$implicit;f("value",e),c(),b(e)}}function dt(r,t){r&1&&M(0,"mat-spinner",13)}function pt(r,t){if(r&1&&(o(0,"span",20),l(1),s()),r&2){let e=p().$implicit;c(),b(e.description)}}function mt(r,t){if(r&1&&(o(0,"mat-option",11)(1,"span",19),l(2),s(),C(3,pt,2,1,"span",20),s()),r&2){let e=t.$implicit;f("value",e.name),c(2),b(e.name),c(),k(e.description?3:-1)}}function gt(r,t){if(r&1&&(o(0,"mat-option",11),l(1),s()),r&2){let e=t.$implicit;f("value",e),c(),b(e)}}function ut(r,t){if(r&1){let e=x();o(0,"div",25)(1,"mat-form-field",8)(2,"mat-label"),l(3,"Name"),s(),o(4,"input",26),u("input",function(i){m(e);let a=p(2);return g(a.issueNumber.set(i.target.value))}),s()(),o(5,"mat-form-field",27)(6,"mat-label"),l(7,"Type"),s(),o(8,"mat-select",28),u("selectionChange",function(i){m(e);let a=p(2);return g(a.branchType.set(i.value))}),w(9,gt,2,2,"mat-option",11,I),s()()()}if(r&2){let e=p(2);c(4),f("value",e.issueNumber()),c(4),f("value",e.branchType()),c(),T(e.branchTypes)}}function _t(r,t){r&1&&M(0,"mat-spinner",13)}function ht(r,t){if(r&1&&(o(0,"mat-option",11),l(1),s()),r&2){let e=t.$implicit;f("value",e),c(),b(e)}}function ft(r,t){if(r&1){let e=x();o(0,"mat-form-field",8)(1,"mat-label"),l(2,"Source branch"),s(),o(3,"input",29,4),u("input",function(i){m(e);let a=p(2);return g(a.onBranchSearchInput(i.target.value))})("focus",function(){m(e);let i=S(4),a=p(2);return g(a.openPanel(i))}),s(),C(5,_t,1,0,"mat-spinner",13),o(6,"mat-autocomplete",10,5),u("optionSelected",function(i){m(e);let a=p(2);return g(a.selectBranch(i.option.value))}),w(8,ht,2,2,"mat-option",11,I),s()()}if(r&2){let e=S(7),n=p(2);c(3),f("value",n.branchSearch())("matAutocomplete",e)("disabled",n.isLoadingBranches()),c(2),k(n.isLoadingBranches()?5:-1),c(3),T(n.filteredBranches())}}function bt(r,t){if(r&1){let e=x();o(0,"div",21)(1,"button",22),u("click",function(){m(e);let i=p();return g(i.onModeChange("local"))}),o(2,"mat-icon"),l(3,"folder_open"),s(),o(4,"span",23),l(5,"Local"),s(),o(6,"span",24),l(7,"Work directly on the current branch"),s()(),o(8,"button",22),u("click",function(){m(e);let i=p();return g(i.onModeChange("worktree"))}),o(9,"mat-icon"),l(10,"account_tree"),s(),o(11,"span",23),l(12,"Worktree"),s(),o(13,"span",24),l(14,"Create an isolated worktree from a branch"),s()()(),C(15,ut,11,2,"div",25),C(16,ft,10,4,"mat-form-field",8)}if(r&2){let e=p();c(),y("active",e.mode()==="local"),c(7),y("active",e.mode()==="worktree"),c(7),k(e.isWorktree()?15:-1),c(),k(e.isWorktree()?16:-1)}}function vt(r,t){r&1&&M(0,"mat-spinner",18)}function Ct(r,t){r&1&&(o(0,"mat-icon"),l(1,"rocket_launch"),s())}function kt(r,t){r&1&&(o(0,"mat-icon"),l(1,"open_in_new"),s())}var Q=class r{projectApi=h(be);agentApi=h(Ue);dialogRef=h(me);projectState=h(V);forcedProject=P(this.projectState.forcedProject$,{initialValue:null});selectedProject=_("");projectSearch=_("");selectedAgent=_("");agentSearch=_("");mode=_("local");selectedBranch=_("");branchSearch=_("");issueNumber=_("");branchType=_("feature");task=_("");hasGit=_(!1);branchTypes=["feature","fix","refactor","chore","docs","build"];projects=_([]);agents=_([]);branches=_([]);filteredProjects=v(()=>{let t=this.projectSearch().toLowerCase();return t?this.projects().filter(e=>e.toLowerCase().includes(t)):this.projects()});filteredAgents=v(()=>{let t=this.agentSearch().toLowerCase();return t?this.agents().filter(e=>e.name.toLowerCase().includes(t)||e.description?.toLowerCase().includes(t)):this.agents()});filteredBranches=v(()=>{let t=this.branchSearch().toLowerCase();return t?this.branches().filter(e=>e.toLowerCase().includes(t)):this.branches()});isLoadingAgents=_(!1);isLoadingBranches=_(!1);isSubmitting=_(!1);isWorktree=v(()=>this.mode()==="worktree"&&this.hasGit());isValid=v(()=>{let t=this.projects().includes(this.selectedProject()),e=this.agents().some(i=>i.name===this.selectedAgent()),n=t&&e&&!!this.task().trim();return this.isWorktree()?n&&!!this.selectedBranch()&&!!this.issueNumber().trim()&&!!this.branchType():n});canNavigate=v(()=>this.projects().includes(this.selectedProject()));openPanel(t){t.openPanel()}onProjectSearchInput(t){this.projectSearch.set(t),this.selectedProject()&&t!==this.selectedProject()&&(this.selectedProject.set(""),this.selectedAgent.set(""),this.agentSearch.set(""),this.agents.set([]))}selectProject(t){this.selectedProject.set(t),this.projectSearch.set(t),this.selectedAgent.set(""),this.agentSearch.set(""),this.agents.set([]),this.branches.set([]),this.selectedBranch.set(""),this.branchSearch.set(""),this.hasGit.set(!1),this.mode.set("local"),this.isLoadingAgents.set(!0),this.agentApi.getAgents(t).subscribe({next:e=>{this.agents.set(e),this.isLoadingAgents.set(!1)},error:()=>{this.isLoadingAgents.set(!1)}}),this.projectApi.getGitBranches(t).subscribe({next:({branches:e})=>{this.hasGit.set(e.length>0)},error:()=>{this.hasGit.set(!1)}})}onAgentSearchInput(t){this.agentSearch.set(t),this.selectedAgent()&&t!==this.selectedAgent()&&this.selectedAgent.set("")}selectAgent(t){this.selectedAgent.set(t),this.agentSearch.set(t)}onBranchSearchInput(t){this.branchSearch.set(t),this.selectedBranch()&&t!==this.selectedBranch()&&this.selectedBranch.set("")}selectBranch(t){this.selectedBranch.set(t),this.branchSearch.set(t)}ngOnInit(){this.projectApi.listProjects().subscribe({next:({projects:t})=>{let e=t.map(n=>n.name);this.projects.set(e),e.length===1&&e[0]&&this.selectProject(e[0])}})}onProjectChange(t){this.selectProject(t)}onModeChange(t){this.mode.set(t),t==="worktree"&&this.selectedProject()&&this.branches().length===0&&this.loadBranches()}loadBranches(){this.isLoadingBranches.set(!0),this.projectApi.getGitBranches(this.selectedProject()).subscribe({next:({branches:t})=>{this.branches.set(t),this.isLoadingBranches.set(!1)},error:()=>{this.isLoadingBranches.set(!1)}})}submit(){if(!this.isSubmitting()){if(this.isValid()){this.isSubmitting.set(!0);let t=this.isWorktree()&&this.issueNumber().trim()?`${this.issueNumber().trim()} ${this.task().trim()}`:this.task().trim();this.projectApi.createTask(this.selectedProject(),this.selectedAgent(),t,this.isWorktree()?"worktree":"local",this.isWorktree()?this.selectedBranch():void 0,this.isWorktree()?this.issueNumber().trim():void 0,this.isWorktree()?this.branchType():void 0).subscribe({next:({threadId:e,projectId:n})=>{this.dialogRef.close({threadId:e,projectId:n})},error:()=>{this.isSubmitting.set(!1)}});return}if(this.canNavigate()){this.dialogRef.close({projectId:this.selectedProject(),navigate:!0});return}}}cancel(){this.dialogRef.close(null)}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=N({type:r,selectors:[["app-new-task-dialog"]],decls:37,vars:12,consts:[["projectTrigger","matAutocompleteTrigger"],["projectAuto",""],["agentTrigger","matAutocompleteTrigger"],["agentAuto",""],["branchTrigger","matAutocompleteTrigger"],["branchAuto",""],["mat-dialog-title",""],[1,"ntd-content"],["appearance","outline",1,"ntd-field"],["matInput","","placeholder","Search project...",3,"input","focus","value","matAutocomplete"],[3,"optionSelected"],[3,"value"],["matInput","","placeholder","Search agent...",3,"input","focus","value","matAutocomplete","disabled"],["matSuffix","","diameter","16"],["matInput","","placeholder","Describe what the agent should accomplish...","rows","4",3,"input","value"],["align","end"],["mat-button","",3,"click","disabled"],["mat-flat-button","",1,"ntd-launch-btn",3,"click","disabled"],["diameter","16"],[1,"ntd-agent-name"],[1,"ntd-agent-desc"],[1,"ntd-radio-group"],["type","button",1,"ntd-mode-btn",3,"click"],[1,"ntd-radio-label"],[1,"ntd-radio-hint"],[1,"ntd-row"],["matInput","","type","text","placeholder","Name",3,"input","value"],["appearance","outline",1,"ntd-field","ntd-field--small"],[3,"selectionChange","value"],["matInput","","placeholder","Search branch...",3,"input","focus","value","matAutocomplete","disabled"]],template:function(e,n){if(e&1){let i=x();o(0,"h2",6)(1,"mat-icon"),l(2,"rocket_launch"),s(),l(3,` New Task
|
|
2
|
+
`),s(),o(4,"mat-dialog-content",7)(5,"mat-form-field",8)(6,"mat-label"),l(7,"Project"),s(),o(8,"input",9,0),u("input",function(d){return n.onProjectSearchInput(d.target.value)})("focus",function(){m(i);let d=S(9);return g(n.openPanel(d))}),s(),o(10,"mat-autocomplete",10,1),u("optionSelected",function(d){return n.selectProject(d.option.value)}),w(12,ct,2,2,"mat-option",11,I),s()(),o(14,"mat-form-field",8)(15,"mat-label"),l(16,"Agent"),s(),o(17,"input",12,2),u("input",function(d){return n.onAgentSearchInput(d.target.value)})("focus",function(){m(i);let d=S(18);return g(n.openPanel(d))}),s(),C(19,dt,1,0,"mat-spinner",13),o(20,"mat-autocomplete",10,3),u("optionSelected",function(d){return n.selectAgent(d.option.value)}),w(22,mt,4,3,"mat-option",11,lt),s()(),C(24,bt,17,6),o(25,"mat-form-field",8)(26,"mat-label"),l(27,"Task"),s(),o(28,"textarea",14),u("input",function(d){return n.task.set(d.target.value)}),s()()(),o(29,"mat-dialog-actions",15)(30,"button",16),u("click",function(){return n.cancel()}),l(31,"Cancel"),s(),o(32,"button",17),u("click",function(){return n.submit()}),C(33,vt,1,0,"mat-spinner",18)(34,Ct,2,0,"mat-icon")(35,kt,2,0,"mat-icon"),l(36),s()()}if(e&2){let i=S(11),a=S(21);c(8),f("value",n.projectSearch())("matAutocomplete",i),c(4),T(n.filteredProjects()),c(5),f("value",n.agentSearch())("matAutocomplete",a)("disabled",!n.selectedProject()||n.isLoadingAgents()),c(2),k(n.isLoadingAgents()?19:-1),c(3),T(n.filteredAgents()),c(2),k(n.hasGit()&&!n.forcedProject()?24:-1),c(4),f("value",n.task()),c(2),f("disabled",n.isSubmitting()),c(2),f("disabled",!n.canNavigate()||n.isSubmitting()),c(),k(n.isSubmitting()?33:n.isValid()?34:35),c(3),j(" ",n.isValid()?"Launch":"Open"," ")}},dependencies:[Ee,he,ge,_e,ue,G,R,W,z,Oe,B,H,U,Be,qe,Le,$e,We,ze,$,q,L,F],styles:["h2[mat-dialog-title][_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:0}.ntd-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;padding-top:20px!important}.ntd-field[_ngcontent-%COMP%]{width:100%}.ntd-row[_ngcontent-%COMP%]{display:flex;gap:.75rem}.ntd-row[_ngcontent-%COMP%] .ntd-field--small[_ngcontent-%COMP%]{width:130px;flex-shrink:0}.ntd-radio-group[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding:.25rem 0 .75rem}.ntd-mode-btn[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;align-items:flex-start;gap:.15rem;padding:.75rem;border:1px solid var(--color-border);border-radius:8px;background:transparent;color:var(--color-text);cursor:pointer;transition:border-color .15s,background .15s}.ntd-mode-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.1rem;width:1.1rem;height:1.1rem;margin-bottom:.1rem}.ntd-mode-btn.active[_ngcontent-%COMP%]{border-color:var(--color-primary);background:color-mix(in srgb,var(--color-primary) 10%,transparent)}.ntd-mode-btn[_ngcontent-%COMP%]:hover:not(.active){border-color:var(--color-text-secondary)}.ntd-radio-label[_ngcontent-%COMP%]{font-weight:600;font-size:.9rem}.ntd-radio-hint[_ngcontent-%COMP%]{font-size:.72rem;color:var(--color-text-secondary);line-height:1.3;text-align:left}.ntd-agent-name[_ngcontent-%COMP%]{font-weight:500;display:block}.ntd-agent-desc[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:380px}.ntd-launch-btn[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse)}.ntd-launch-btn[_ngcontent-%COMP%]:disabled{background:var(--color-border);color:var(--color-text-secondary);opacity:.6;cursor:not-allowed}"]})};var X=class r{http=h(le);threadApi=h(ve);isLoading=_(!1);tasks=_([]);refresh(){this.isLoading.set(!0),this.threadApi.listAllThreads().pipe(te(15e3)).subscribe({next:t=>{let e=t.filter(n=>!n.parentThreadId).map(n=>({id:n.id,name:n.name,summary:n.summary,modifiedDate:n.modifiedDate,starring:n.starring??[],users:n.users??[],isActive:!1,status:this.deriveStatus(n),projectId:n.projectId,worktreeProject:n.worktreeProject}));this.tasks.set(this.sorted(e)),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1)}})}applyStatusEvent(t,e){let n=e==="invite"?"waiting-you":"in-progress";this.tasks.update(i=>this.sorted(i.map(a=>a.id===t?D(O({},a),{status:n}):a)))}closeTask(t,e){this.tasks.update(n=>n.filter(i=>i.id!==e)),this.http.delete(`/api/projects/${t}/missions/${e}`).subscribe({next:()=>this.refresh(),error:n=>{console.error("[GLOBAL-TC] Failed to close task:",n),this.refresh()}})}stopThread(t,e){this.http.post(`/api/projects/${t}/threads/${e}/stop`,{}).subscribe({error:n=>console.error("[GLOBAL-TC] Failed to stop thread:",n)})}deleteThread(t,e){this.tasks.update(n=>n.filter(i=>i.id!==e)),this.http.delete(`/api/projects/${t}/threads/${e}`).subscribe({next:()=>this.refresh(),error:n=>{console.error("[GLOBAL-TC] Failed to delete thread:",n),this.refresh()}})}toggleStar(t,e,n){let i=`/api/projects/${t}/threads/${e}/star`;(n?this.http.delete(i):this.http.post(i,{})).subscribe({next:()=>this.refresh(),error:d=>console.error("[GLOBAL-TC] Failed to toggle star:",d)})}markTaskDone(t,e){this.http.post(`/api/projects/${t}/threads/${e}/done`,{}).subscribe({next:()=>this.refresh(),error:n=>console.error("[GLOBAL-TC] Failed to mark task as done:",n)})}markTaskActive(t,e){this.http.delete(`/api/projects/${t}/threads/${e}/done`).subscribe({next:()=>this.refresh(),error:n=>console.error("[GLOBAL-TC] Failed to mark task as active:",n)})}deriveStatus(t){return t.closedByUser?"done":t.pendingInvite?"waiting-you":Date.now()-new Date(t.modifiedDate).getTime()<Ke?"in-progress":"paused"}sorted(t){return[...t].sort((e,n)=>{let i=Z[e.status]-Z[n.status];return i!==0?i:e.modifiedDate>n.modifiedDate?-1:1})}static \u0275fac=function(e){return new(e||r)};static \u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})};var J=class r{configApi=h(Ye);dialog=h(A);openUserConfigEditor(){this.configApi.getUserConfig().subscribe({next:t=>{this.dialog.open(Ze,{data:{configType:"user",initialContent:JSON.stringify(t,null,2)}}).afterClosed().subscribe(n=>{n&&this.configApi.updateUserConfig(n).subscribe({error:i=>console.error("[CONFIG-STATE] Error saving user config:",i)})})},error:t=>console.error("[CONFIG-STATE] Error loading user config:",t)})}static \u0275fac=function(e){return new(e||r)};static \u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})};var xt=["layoutContainer"],wt=(r,t)=>t.key,Tt=(r,t)=>t.name,yt=(r,t)=>t.status,tt=(r,t)=>t.id;function St(r,t){if(r&1){let e=x();o(0,"button",30),u("click",function(){m(e);let i=p();return g(i.clearSearch())}),o(1,"mat-icon"),l(2,"close"),s()()}}function Mt(r,t){if(r&1){let e=x();o(0,"button",31),u("click",function(){let i=m(e).$implicit,a=p(2);return g(a.setProject(i.name))}),l(1),o(2,"span",32),l(3),s()()}if(r&2){let e=t.$implicit,n=p(2);y("active",n.activeProject()===e.name),c(),j(" ",e.name," "),c(2),b(e.count)}}function Pt(r,t){if(r&1){let e=x();o(0,"nav",20)(1,"button",31),u("click",function(){m(e);let i=p();return g(i.setProject(null))}),l(2," All projects "),o(3,"span",32),l(4),s()(),w(5,Mt,4,4,"button",33,Tt),s()}if(r&2){let e=p();c(),y("active",e.activeProject()===null),c(3),b(e.allTasks().length),c(),T(e.projectSummaries())}}function jt(r,t){if(r&1&&(o(0,"span",35),l(1),s()),r&2){let e=p().$implicit,n=p();c(),b(n.filterCounts()[e.key])}}function Ot(r,t){if(r&1){let e=x();o(0,"button",34),u("click",function(){let i=m(e).$implicit,a=p();return g(a.setFilter(i.key))}),o(1,"mat-icon",24),l(2),s(),o(3,"span"),l(4),s(),C(5,jt,2,1,"span",35),s()}if(r&2){let e=t.$implicit,n=p();y("active",n.activeFilter()===e.key),Y("aria-selected",n.activeFilter()===e.key),c(2),b(e.icon),c(2),b(e.label),c(),k(n.filterCounts()[e.key]>0?5:-1)}}function Dt(r,t){r&1&&(o(0,"div",27),M(1,"mat-spinner",36),o(2,"p"),l(3,"Loading tasks from all projects\u2026"),s()())}function Et(r,t){r&1&&(o(0,"div",28)(1,"mat-icon",37),l(2,"hub"),s(),o(3,"p"),l(4,"No tasks found."),s()())}function Nt(r,t){if(r&1){let e=x();o(0,"app-task-card",43),u("stopRequested",function(i){let a=m(e).$implicit,d=p(3);return g(d.onStopRequested(i,a.projectId))})("deleteRequested",function(i){let a=m(e).$implicit,d=p(3);return g(d.onDeleteRequested(i,a.projectId))})("starToggled",function(i){let a=m(e).$implicit,d=p(3);return g(d.onStarToggled(i,a.projectId))})("closeTaskRequested",function(i){let a=m(e).$implicit,d=p(3);return g(d.onCloseTaskRequested(i,a.projectId))})("markDoneRequested",function(i){let a=m(e).$implicit,d=p(3);return g(d.onMarkDoneRequested(i,a.projectId))})("markActiveRequested",function(i){let a=m(e).$implicit,d=p(3);return g(d.onMarkActiveRequested(i,a.projectId))})("previewRequested",function(i){let a=m(e).$implicit,d=p(3);return g(d.onPreviewRequested(i,a.projectId,a.name))}),s()}if(r&2){let e=t.$implicit,n=p(3);y("is-previewed",n.previewThreadId()===e.id),f("task",e)("projectNameOverride",e.projectId)("showProject",!0)("previewMode",n.previewActive())}}function It(r,t){if(r&1&&(o(0,"section",38)(1,"h3",39)(2,"mat-icon",40),l(3),s(),l(4),o(5,"span",41),l(6),s()(),o(7,"div",29),w(8,Nt,1,6,"app-task-card",42,tt),s()()),r&2){let e=t.$implicit;c(3),b(e.icon),c(),j(" ",e.label," "),c(2),b(e.tasks.length),c(2),T(e.tasks)}}function At(r,t){if(r&1&&w(0,It,10,3,"section",38,yt),r&2){let e=p();T(e.taskGroups())}}function Rt(r,t){if(r&1){let e=x();o(0,"app-task-card",43),u("stopRequested",function(i){let a=m(e).$implicit,d=p(2);return g(d.onStopRequested(i,a.projectId))})("deleteRequested",function(i){let a=m(e).$implicit,d=p(2);return g(d.onDeleteRequested(i,a.projectId))})("starToggled",function(i){let a=m(e).$implicit,d=p(2);return g(d.onStarToggled(i,a.projectId))})("closeTaskRequested",function(i){let a=m(e).$implicit,d=p(2);return g(d.onCloseTaskRequested(i,a.projectId))})("markDoneRequested",function(i){let a=m(e).$implicit,d=p(2);return g(d.onMarkDoneRequested(i,a.projectId))})("markActiveRequested",function(i){let a=m(e).$implicit,d=p(2);return g(d.onMarkActiveRequested(i,a.projectId))})("previewRequested",function(i){let a=m(e).$implicit,d=p(2);return g(d.onPreviewRequested(i,a.projectId,a.name))}),s()}if(r&2){let e=t.$implicit,n=p(2);y("is-previewed",n.previewThreadId()===e.id),f("task",e)("projectNameOverride",e.projectId)("showProject",!0)("previewMode",n.previewActive())}}function Gt(r,t){if(r&1&&(o(0,"div",29),w(1,Rt,1,6,"app-task-card",42,tt),s()),r&2){let e=p();c(),T(e.displayedTasks())}}function Vt(r,t){if(r&1){let e=x();o(0,"div",44),u("mousedown",function(i){m(e);let a=p();return g(a.onResizerMousedown(i))}),s(),o(1,"div",45)(2,"header",46)(3,"span",47),l(4),s(),o(5,"div",48)(6,"button",49),u("click",function(){m(e);let i=p();return g(i.navigateToThread())}),o(7,"mat-icon"),l(8,"open_in_full"),s()(),o(9,"button",50),u("click",function(){m(e);let i=p();return g(i.closePreview())}),o(10,"mat-icon"),l(11,"close"),s()()()(),o(12,"div",51),M(13,"app-thread",52),s()()}if(r&2){let e=p();c(),se("width",e.previewPanelWidthPercent(),"%"),c(3),b(e.previewTaskName()||"Task"),c(9),f("projectName",e.previewProjectId())("threadId",e.previewThreadId())}}var Ft=20,Lt=70,qt=[{status:"waiting-you",label:"Waiting for you",icon:"mark_unread_chat_alt"},{status:"in-progress",label:"In progress",icon:"pending"},{status:"paused",label:"Paused",icon:"pause_circle"},{status:"error",label:"Error",icon:"error"},{status:"done",label:"Done",icon:"check_circle"}],$t=[{key:"all",label:"All",icon:"grid_view"},{key:"waiting-you",label:"Waiting for you",icon:"mark_unread_chat_alt"},{key:"in-progress",label:"In progress",icon:"pending"},{key:"paused",label:"Paused",icon:"pause_circle"},{key:"done",label:"Done",icon:"check_circle"}],et=class r{globalTaskService=h(X);destroyRef=h(ie);dialog=h(A);router=h(ce);configState=h(J);userService=h(ke);preferences=h(Qe);projectState=h(V);threadState=h(Ce);breakpointObserver=h(pe);username=P(this.userService.username$,{initialValue:null});isDesktop=P(this.breakpointObserver.observe("(min-width: 1280px)").pipe(ne(t=>t.matches)),{initialValue:!1});previewEnabled=P(this.preferences.missionPreviewEnabled$,{initialValue:!1});previewActive=v(()=>this.previewEnabled()&&this.isDesktop());previewThreadId=_(null);previewProjectId=_(null);previewTaskName=_(null);previewPanelWidthPercent=_(this.preferences.getMissionPreviewPanelWidth());isDraggingResizer=!1;dragStartX=0;dragStartWidth=0;containerWidth=0;layoutContainerRef;globalEventSource=null;filters=$t;activeFilter=_("all");starredOnly=_(!1);activeProject=_(null);searchQuery=_("");isLoading=this.globalTaskService.isLoading;allTasks=this.globalTaskService.tasks;projectSummaries=v(()=>{let t=this.allTasks(),e=new Map;for(let n of t)e.set(n.projectId,(e.get(n.projectId)??0)+1);return[...e.entries()].map(([n,i])=>({name:n,count:i})).sort((n,i)=>n.name.localeCompare(i.name))});filteredTasks=v(()=>{let t=this.allTasks(),e=this.activeProject();e&&(t=t.filter(a=>a.projectId===e));let n=this.username();this.starredOnly()&&n&&(t=t.filter(a=>a.starring.includes(n)));let i=this.activeFilter();return i!=="all"&&(t=t.filter(a=>a.status===i)),t});filterCounts=v(()=>{let t=this.allTasks(),e=this.activeProject();e&&(t=t.filter(i=>i.projectId===e));let n=this.username();return this.starredOnly()&&n&&(t=t.filter(i=>i.starring.includes(n))),{all:t.length,"waiting-you":t.filter(i=>i.status==="waiting-you").length,"in-progress":t.filter(i=>i.status==="in-progress").length,done:t.filter(i=>i.status==="done").length,paused:t.filter(i=>i.status==="paused").length,error:t.filter(i=>i.status==="error").length}});displayedTasks=v(()=>{let t=this.searchQuery().toLowerCase().trim(),e=this.sortedFilteredTasks();return t?e.filter(n=>(n.name||"").toLowerCase().includes(t)||(n.summary||"").toLowerCase().includes(t)):e});taskGroups=v(()=>{let t=this.displayedTasks();return qt.map(e=>D(O({},e),{tasks:t.filter(n=>n.status===e.status)})).filter(e=>e.tasks.length>0)});sortedFilteredTasks=v(()=>{let t=this.filteredTasks(),e={"waiting-you":0,"in-progress":1,paused:2,error:3,done:4};return[...t].sort((n,i)=>(e[n.status]??99)-(e[i.status]??99))});constructor(){this.destroyRef.onDestroy(()=>this.disconnectGlobalSse())}ngOnInit(){this.globalTaskService.refresh(),this.connectGlobalSse(),this.userService.fetchCurrentUser().pipe(Ne(this.destroyRef)).subscribe({error:t=>console.warn("[GTC] Could not fetch user:",t)})}setFilter(t){this.activeFilter.set(t)}toggleStarredFilter(){this.starredOnly.update(t=>!t)}setProject(t){this.activeProject.set(t),this.activeFilter.set("all")}onSearchInput(t){this.searchQuery.set(t.target.value)}clearSearch(){this.searchQuery.set("")}refresh(){this.globalTaskService.refresh()}openPreferences(){this.dialog.open(Xe,{width:"400px"})}openTokenUsage(){this.router.navigate(["/token-usage"])}openUserConfig(){this.configState.openUserConfigEditor()}openNewTaskDialog(){this.dialog.open(Q,{width:"500px",disableClose:!1}).afterClosed().subscribe(e=>{e&&(e.navigate?this.router.navigate(["project",e.projectId]):(setTimeout(()=>this.globalTaskService.refresh(),300),setTimeout(()=>this.globalTaskService.refresh(),1500)))})}onStopRequested(t,e){this.globalTaskService.stopThread(e,t)}onDeleteRequested(t,e){this.globalTaskService.deleteThread(e,t)}onStarToggled(t,e){let n=this.allTasks().find(d=>d.id===t);if(!n)return;let i=this.username(),a=!!i&&n.starring.includes(i);this.globalTaskService.toggleStar(e,t,a)}onCloseTaskRequested(t,e){let i=this.allTasks().find(d=>d.id===t)?.worktreeProject??e;this.dialog.open(He,{width:"420px",data:{title:"Close task",message:`This will stop the agent, delete the thread and remove the worktree project "${i}" from disk. This cannot be undone.`,confirmLabel:"Close task",cancelLabel:"Cancel"}}).afterClosed().subscribe(d=>{d&&this.globalTaskService.closeTask(e,t)})}onMarkDoneRequested(t,e){this.globalTaskService.markTaskDone(e,t)}onMarkActiveRequested(t,e){this.globalTaskService.markTaskActive(e,t)}onPreviewRequested(t,e,n){this.previewThreadId()===t?(this.previewThreadId.set(null),this.previewProjectId.set(null),this.previewTaskName.set(null)):(this.projectState.selectProject(e),this.threadState.selectThread(t),this.previewProjectId.set(e),this.previewThreadId.set(t),this.previewTaskName.set(n))}closePreview(){this.previewThreadId.set(null),this.previewProjectId.set(null),this.previewTaskName.set(null)}navigateToThread(){let t=this.previewThreadId(),e=this.previewProjectId();!t||!e||this.router.navigate(["project",e,"thread",t])}onResizerMousedown(t){t.preventDefault(),this.isDraggingResizer=!0,this.dragStartX=t.clientX,this.dragStartWidth=this.previewPanelWidthPercent(),this.containerWidth=this.layoutContainerRef?.nativeElement.offsetWidth??window.innerWidth}onDocumentMousemove(t){if(!this.isDraggingResizer)return;let n=(this.dragStartX-t.clientX)/this.containerWidth*100,i=Math.min(Lt,Math.max(Ft,this.dragStartWidth+n));this.previewPanelWidthPercent.set(i)}onDocumentMouseup(){this.isDraggingResizer&&(this.isDraggingResizer=!1,this.preferences.setMissionPreviewPanelWidth(this.previewPanelWidthPercent()))}connectGlobalSse(t=5e3){this.disconnectGlobalSse();let e=new EventSource("/api/event-stream");this.globalEventSource=e,e.onmessage=n=>{try{let i=JSON.parse(n.data),a=Ve(i);if(!a)return;let d=a.threadId;if(!d)return;a instanceof Ie||a instanceof Ae?this.globalTaskService.applyStatusEvent(d,"invite"):a instanceof Re?this.globalTaskService.applyStatusEvent(d,"thinking"):a instanceof Ge&&this.globalTaskService.refresh()}catch(i){}},e.onerror=()=>{e.readyState===EventSource.CLOSED&&(this.globalEventSource=null,setTimeout(()=>{this.globalEventSource||this.connectGlobalSse(Math.min(t*2,6e4))},t))}}disconnectGlobalSse(){this.globalEventSource&&(this.globalEventSource.close(),this.globalEventSource=null)}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=N({type:r,selectors:[["app-global-task-control"]],viewQuery:function(e,n){if(e&1&&oe(xt,5),e&2){let i;re(i=ae())&&(n.layoutContainerRef=i.first)}},hostBindings:function(e,n){e&1&&u("mousemove",function(a){return n.onDocumentMousemove(a)},K)("mouseup",function(){return n.onDocumentMouseup()},K)},decls:70,vars:10,consts:[["layoutContainer",""],["controlCenterMenu","matMenu"],[1,"gtc"],[1,"gtc-toolbar"],[1,"gtc-toolbar-left"],[1,"gtc-logo-icon"],[1,"gtc-title"],["appearance","fill","subscriptSizing","dynamic",1,"gtc-search"],["matPrefix",""],["matInput","","type","search","placeholder","Filter tasks\u2026","autocomplete","off",3,"input","keydown.escape","value"],["matSuffix","","mat-icon-button","","aria-label","Clear"],[1,"gtc-toolbar-actions"],["mat-icon-button","","matTooltip","Control Center","aria-label","Control Center",3,"matMenuTriggerFor"],["mat-menu-item","",3,"click"],["mat-menu-item","","href","https://github.com/whoz-oss/coday","target","_blank","rel","noopener noreferrer"],["mat-icon-button","","matTooltip","Refresh all tasks","aria-label","Refresh tasks",3,"click","disabled"],["mat-stroked-button","","routerLink","/projects","aria-label","Manage projects","matTooltip","Manage projects"],[1,"btn-label"],["mat-flat-button","","aria-label","New task","matTooltip","New Task",1,"gtc-new-btn",3,"click"],[1,"gtc-filter-bar"],["aria-label","Filter by project",1,"gtc-project-filters"],["role","tablist","aria-label","Filter by status",1,"gtc-filters"],["role","tab",1,"filter-chip",3,"active"],["role","switch","aria-label","Show starred tasks only",1,"filter-chip","starred-filter",3,"click"],[1,"filter-icon"],[1,"gtc-body"],[1,"gtc-content"],[1,"gtc-loading"],[1,"gtc-empty"],[1,"gtc-grid"],["matSuffix","","mat-icon-button","","aria-label","Clear",3,"click"],[1,"project-chip",3,"click"],[1,"chip-count"],[1,"project-chip",3,"active"],["role","tab",1,"filter-chip",3,"click"],[1,"filter-badge"],["diameter","36"],[1,"empty-icon"],[1,"gtc-group"],[1,"gtc-group-title"],[1,"group-icon"],[1,"group-count"],[3,"task","projectNameOverride","showProject","previewMode","is-previewed"],[3,"stopRequested","deleteRequested","starToggled","closeTaskRequested","markDoneRequested","markActiveRequested","previewRequested","task","projectNameOverride","showProject","previewMode"],["matTooltip","Drag to resize","aria-hidden","true",1,"gtc-resizer",3,"mousedown"],[1,"gtc-preview-pane"],[1,"gtc-preview-header"],[1,"gtc-preview-title"],[1,"gtc-preview-actions"],["matTooltip","Open full view","aria-label","Open thread in full view","type","button",1,"preview-action-btn",3,"click"],["matTooltip","Close panel","aria-label","Close preview panel","type","button",1,"preview-action-btn",3,"click"],[1,"gtc-preview-body"],[3,"projectName","threadId"]],template:function(e,n){if(e&1&&(o(0,"div",2,0)(2,"header",3)(3,"div",4)(4,"mat-icon",5),l(5,"hub"),s(),o(6,"h1",6),l(7,"Global Task Control"),s()(),o(8,"mat-form-field",7)(9,"mat-icon",8),l(10,"search"),s(),o(11,"input",9),u("input",function(a){return n.onSearchInput(a)})("keydown.escape",function(){return n.clearSearch()}),s(),C(12,St,3,0,"button",10),s(),o(13,"div",11)(14,"button",12)(15,"mat-icon"),l(16,"hub"),s()(),o(17,"mat-menu",null,1)(19,"button",13),u("click",function(){return n.openPreferences()}),o(20,"mat-icon"),l(21,"tune"),s(),o(22,"span"),l(23,"Preferences"),s()(),o(24,"button",13),u("click",function(){return n.openTokenUsage()}),o(25,"mat-icon"),l(26,"data_usage"),s(),o(27,"span"),l(28,"Token Usage"),s()(),o(29,"button",13),u("click",function(){return n.openUserConfig()}),o(30,"mat-icon"),l(31,"manage_accounts"),s(),o(32,"span"),l(33,"User Configuration"),s()(),M(34,"mat-divider"),o(35,"a",14)(36,"mat-icon"),l(37,"code"),s(),o(38,"span"),l(39,"Contribute on GitHub"),s()()(),o(40,"button",15),u("click",function(){return n.refresh()}),o(41,"mat-icon"),l(42,"refresh"),s()(),o(43,"button",16)(44,"mat-icon"),l(45,"settings"),s(),o(46,"span",17),l(47,"Manage projects"),s()(),o(48,"button",18),u("click",function(){return n.openNewTaskDialog()}),o(49,"mat-icon"),l(50,"rocket_launch"),s(),o(51,"span",17),l(52,"New Task"),s()()()(),o(53,"div",19),C(54,Pt,7,3,"nav",20),o(55,"nav",21),w(56,Ot,6,6,"button",22,wt),o(58,"button",23),u("click",function(){return n.toggleStarredFilter()}),o(59,"mat-icon",24),l(60,"star"),s(),o(61,"span"),l(62,"Starred"),s()()()(),o(63,"div",25)(64,"main",26),C(65,Dt,4,0,"div",27)(66,Et,5,0,"div",28)(67,At,2,0)(68,Gt,3,0,"div",29),s(),C(69,Vt,14,5),s()()),e&2){let i=S(18);c(11),f("value",n.searchQuery()),c(),k(n.searchQuery()?12:-1),c(2),f("matMenuTriggerFor",i),c(26),f("disabled",n.isLoading()),c(14),k(n.projectSummaries().length>1?54:-1),c(2),T(n.filters),c(2),y("active",n.starredOnly()),Y("aria-checked",n.starredOnly()),c(7),k(n.isLoading()?65:n.displayedTasks().length===0?66:n.activeFilter()==="all"&&!n.searchQuery()?67:68),c(4),k(n.previewActive()&&n.previewThreadId()&&n.previewProjectId()?69:-1)}},dependencies:[Fe,Je,L,F,G,R,fe,we,xe,$,q,Me,ye,Te,Se,je,Pe,W,z,De,B,H,U,de],styles:[".glass-panel[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow)}.glass-interactive[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);transition:all .3s cubic-bezier(.4,0,.2,1)}.glass-interactive[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 12px 40px #00000026}.glass-interactive[_ngcontent-%COMP%]:active{transform:translateY(0)}.glass-card[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);border-radius:20px;padding:1.5rem}.glass-button[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);transition:all .3s cubic-bezier(.4,0,.2,1)}.glass-button[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 12px 40px #00000026}.glass-button[_ngcontent-%COMP%]:active{transform:translateY(0)}.glass-button[_ngcontent-%COMP%]{border-radius:12px;padding:.75rem 1.5rem;font-weight:600;cursor:pointer}.glass-button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed;transform:none}.glass-button[_ngcontent-%COMP%]:disabled:hover{transform:none}.smooth-theme-transition[_ngcontent-%COMP%]{transition:background .3s ease,color .3s ease,border-color .3s ease,box-shadow .3s ease}[_nghost-%COMP%]{display:block;width:100%;height:100%;overflow:hidden}.gtc[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden}.gtc-toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:0 .75rem;height:56px;flex-shrink:0;border-bottom:1px solid var(--color-border, rgba(0, 0, 0, .1));box-sizing:border-box}.gtc-toolbar-left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;flex-shrink:0}.gtc-logo-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem;color:var(--color-primary)}.gtc-title[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600;color:var(--color-text);white-space:nowrap}.gtc-search[_ngcontent-%COMP%]{margin-left:auto;flex:0 1 240px;min-width:80px;--mat-form-field-container-height: 36px;--mat-form-field-container-vertical-padding: 6px;font-size:.875rem;--mdc-filled-text-field-container-color: transparent;--mdc-filled-text-field-hover-container-color: transparent;--mdc-filled-text-field-focus-container-color: transparent;--mdc-filled-text-field-active-indicator-color: transparent;--mdc-filled-text-field-hover-active-indicator-color: transparent;--mdc-filled-text-field-focus-active-indicator-color: transparent;--mdc-filled-text-field-active-indicator-height: 0}.gtc-toolbar-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;flex-shrink:0}.gtc-new-btn[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-radius:12px;font-weight:600;height:36px;padding:0 1rem}.gtc-new-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.1rem;width:1.1rem;height:1.1rem}@media(max-width:600px){.gtc-toolbar[_ngcontent-%COMP%]{flex-wrap:wrap;height:auto;min-height:48px;padding:.5rem .75rem;gap:.375rem}.gtc-title[_ngcontent-%COMP%]{font-size:.875rem}.gtc-search[_ngcontent-%COMP%]{order:3;flex:1 1 100%;min-width:0;margin-left:0}.gtc-toolbar-actions[_ngcontent-%COMP%]{margin-left:auto}.btn-label[_ngcontent-%COMP%]{display:none}.gtc-toolbar-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:not(mat-icon-button):not([mat-icon-button]){--mdc-text-button-container-height: 36px;--mdc-filled-button-container-height: 36px;--mdc-outlined-button-container-height: 36px;min-width:36px;width:36px;height:36px;padding:0;border-radius:50%!important}.gtc-toolbar-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:not(mat-icon-button):not([mat-icon-button]) .mat-mdc-button-touch-target[_ngcontent-%COMP%]{width:36px;height:36px}.gtc-toolbar-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:not(mat-icon-button):not([mat-icon-button]) mat-icon[_ngcontent-%COMP%]{margin:0!important}}.gtc-filter-bar[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem;padding:.5rem .75rem;flex-shrink:0;border-bottom:1px solid var(--color-border, rgba(0, 0, 0, .08))}.gtc-project-filters[_ngcontent-%COMP%]{display:flex;gap:.375rem;flex-wrap:wrap}.project-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;padding:.2rem .65rem;border-radius:100px;font-size:.75rem;font-weight:500;color:var(--color-text-secondary);background:transparent;border:1px solid var(--color-border);cursor:pointer;transition:background .15s ease,color .15s ease,border-color .15s ease;white-space:nowrap}.project-chip[_ngcontent-%COMP%] .chip-count[_ngcontent-%COMP%]{background:var(--color-bg-hover);border-radius:100px;padding:0 .3rem;font-size:.68rem;font-weight:700;min-width:16px;text-align:center;line-height:16px}.project-chip.active[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-color:var(--color-primary)}.project-chip.active[_ngcontent-%COMP%] .chip-count[_ngcontent-%COMP%]{background:#ffffff40;color:var(--color-text-inverse)}.project-chip[_ngcontent-%COMP%]:hover:not(.active){background:var(--color-bg-hover);color:var(--color-text)}.gtc-filters[_ngcontent-%COMP%]{display:flex;gap:.375rem;flex-wrap:wrap}.filter-chip[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);display:flex;align-items:center;gap:.375rem;padding:.3rem .75rem;border-radius:100px;font-size:.8rem;font-weight:500;color:var(--color-text-secondary);cursor:pointer;border:1px solid var(--color-border);transition:background .15s ease,color .15s ease,border-color .15s ease;white-space:nowrap}.filter-chip[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{font-size:.9rem;width:.9rem;height:.9rem}.filter-chip[_ngcontent-%COMP%] .filter-badge[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-radius:100px;padding:0 .375rem;font-size:.7rem;font-weight:700;min-width:18px;text-align:center;line-height:18px}.filter-chip.active[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-color:var(--color-primary)}.filter-chip.active[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{color:var(--color-text-inverse)}.filter-chip.active[_ngcontent-%COMP%] .filter-badge[_ngcontent-%COMP%]{background:#ffffff40;color:var(--color-text-inverse)}.filter-chip[_ngcontent-%COMP%]:hover:not(.active){background:var(--color-bg-hover);color:var(--color-text)}.starred-filter.active[_ngcontent-%COMP%]{background:#f5a62326;border-color:#f5a623;color:#f5a623}.starred-filter.active[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{color:#f5a623}.gtc-body[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex:1;overflow:hidden;min-height:0}.gtc-content[_ngcontent-%COMP%]{flex:1;overflow-y:auto;padding:1rem 1rem 2rem;min-width:0}.gtc-resizer[_ngcontent-%COMP%]{width:6px;flex-shrink:0;cursor:col-resize;background:transparent;border-left:1px solid var(--color-border);border-right:1px solid var(--color-border);transition:background .15s ease}.gtc-resizer[_ngcontent-%COMP%]:hover, .gtc-resizer[_ngcontent-%COMP%]:active{background:var(--color-primary);opacity:.4}.gtc-preview-pane[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden;flex-shrink:0;min-width:280px;border-left:1px solid var(--color-border);background:var(--glass-bg)}.gtc-preview-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.625rem .75rem .625rem 1rem;border-bottom:1px solid var(--color-border);flex-shrink:0}.gtc-preview-title[_ngcontent-%COMP%]{font-size:.875rem;font-weight:600;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1}.gtc-preview-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.125rem;flex-shrink:0}.preview-action-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:none;border-radius:6px;background:transparent;cursor:pointer;transition:background .15s ease}.preview-action-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;line-height:18px;color:var(--color-text-secondary)}.preview-action-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.preview-action-btn[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{color:var(--color-text)}.gtc-preview-body[_ngcontent-%COMP%]{flex:1;overflow:hidden;display:flex;flex-direction:column}.gtc-preview-body[_ngcontent-%COMP%] app-thread[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;overflow:hidden;height:100%} app-task-card.is-previewed .task-card{border-color:var(--color-primary);box-shadow:0 0 0 2px var(--color-primary)}.gtc-group[_ngcontent-%COMP%]{margin-bottom:1.25rem}.gtc-group[_ngcontent-%COMP%]:last-child{margin-bottom:0}.gtc-group-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin:0 0 .75rem;font-size:.8rem;font-weight:600;color:var(--color-text-secondary);text-transform:uppercase;letter-spacing:.05em}.gtc-group-title[_ngcontent-%COMP%] .group-icon[_ngcontent-%COMP%]{font-size:.95rem;width:.95rem;height:.95rem}.gtc-group-title[_ngcontent-%COMP%] .group-count[_ngcontent-%COMP%]{background:var(--color-bg-hover);border-radius:100px;padding:0 .375rem;font-size:.7rem;font-weight:700;min-width:16px;text-align:center;line-height:16px}.gtc-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:1rem}@media(max-width:600px){.gtc-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.gtc-loading[_ngcontent-%COMP%], .gtc-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem;padding:3rem;color:var(--color-text-secondary);text-align:center}.gtc-loading[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .gtc-empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;font-size:.9rem}.empty-icon[_ngcontent-%COMP%]{font-size:2.5rem;width:2.5rem;height:2.5rem;opacity:.3}"],changeDetection:0})};export{et as GlobalTaskControlComponent};
|