@godmode-team/godmode 1.4.1 → 1.5.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.
@@ -6117,14 +6117,41 @@ ${i}
6117
6117
  </div>
6118
6118
  <p class="wizard-success-path">Workspace: <code>${n.workspacePath}</code></p>
6119
6119
  <p class="wizard-success-hint">
6120
- Start a new chat session and the agent will automatically read your memory files.
6121
- The system gets smarter with every conversation.
6120
+ Your memory system is set up. Now let's meet the team that will work for you.
6122
6121
  </p>
6123
- <button class="wizard-btn wizard-btn--next" @click=${()=>t.onClose()}>
6124
- Start Using GodMode
6122
+ <button class="wizard-btn wizard-btn--next" @click=${()=>t.onStepChange(10)}>
6123
+ Meet Your Team
6125
6124
  </button>
6126
6125
  </div>
6127
- `:r`${h}`}function tp(){return{name:"",timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,focus:"",projects:[],commStyle:"Direct and concise -- no fluff, just answers",hardRules:[],keyPeople:[],defaultModel:"sonnet"}}function Q0(){return{step:0,answers:tp(),preview:null,generating:!1,result:null,error:null}}function np(e,t){const{step:n,answers:s}=e;if(n===9)return r`
6126
+ `:r`${h}`}const Q0={researcher:"🔍",writer:"✍️",analyst:"📊","task-runner":"⚡","creative-director":"🎨",growth:"📈"};function Y0(e,t){const n=e.roster??[];return r`
6127
+ <div class="wizard-team">
6128
+ <h2 class="wizard-team-title">Your AI team is ready</h2>
6129
+ <p class="wizard-team-subtitle">
6130
+ Your ally manages them — you just say what you need.
6131
+ </p>
6132
+ <p class="wizard-team-hint">
6133
+ Each specialist handles a different kind of work. As you use GodMode, they learn your preferences and get better.
6134
+ </p>
6135
+
6136
+ <div class="wizard-team-grid">
6137
+ ${n.map((s,a)=>r`
6138
+ <div class="wizard-team-card" style="animation-delay: ${a*120}ms">
6139
+ <span class="wizard-team-icon">${Q0[s.slug]??"🤖"}</span>
6140
+ <h3 class="wizard-team-name">${s.name}</h3>
6141
+ <p class="wizard-team-mission">${s.mission??s.taskTypes.join(", ")}</p>
6142
+ </div>
6143
+ `)}
6144
+ </div>
6145
+
6146
+ <button class="wizard-btn wizard-btn--next wizard-team-cta" @click=${()=>t.onClose()}>
6147
+ Let's Go
6148
+ </button>
6149
+ </div>
6150
+ `}function tp(){return{name:"",timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,focus:"",projects:[],commStyle:"Direct and concise -- no fluff, just answers",hardRules:[],keyPeople:[],defaultModel:"sonnet"}}function J0(){return{step:0,answers:tp(),preview:null,generating:!1,result:null,roster:null,error:null}}function np(e,t){const{step:n,answers:s}=e;if(n===10)return r`
6151
+ <div class="wizard-fullscreen">
6152
+ ${Y0(e,t)}
6153
+ </div>
6154
+ `;if(n===9)return r`
6128
6155
  <div class="wizard-fullscreen">
6129
6156
  ${G0(e,t)}
6130
6157
  </div>
@@ -6145,7 +6172,7 @@ ${i}
6145
6172
  ${F0(n,t,a,i)}
6146
6173
  </div>
6147
6174
  </div>
6148
- `}const Y0=Object.freeze(Object.defineProperty({__proto__:null,emptyWizardAnswers:tp,emptyWizardState:Q0,renderOnboardingWizard:np},Symbol.toStringTag,{value:"Module"}));function fn(e){return e===null?"none":e>=8?"high":e>=5?"medium":"low"}function as(e){return{high:"trust-score--high",medium:"trust-score--medium",low:"trust-score--low",none:"trust-score--none"}[e]}function J0(e){return{improving:"Improving",declining:"Declining",stable:"Stable",new:"New"}[e]??"New"}function X0(e){return{improving:"trust-trend--up",declining:"trust-trend--down",stable:"trust-trend--stable",new:"trust-trend--new"}[e]??"trust-trend--new"}function Z0(e){return{improving:"↑",declining:"↓",stable:"→",new:"•"}[e]??"•"}function eS(e){const t=Date.now()-Date.parse(e),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const s=Math.floor(n/60);if(s<24)return`${s}h ago`;const a=Math.floor(s/24);return a<7?`${a}d ago`:new Date(e).toLocaleDateString()}function tS(e){const t=e.overallScore,n=fn(t);return r`
6175
+ `}const X0=Object.freeze(Object.defineProperty({__proto__:null,emptyWizardAnswers:tp,emptyWizardState:J0,renderOnboardingWizard:np},Symbol.toStringTag,{value:"Module"}));function fn(e){return e===null?"none":e>=8?"high":e>=5?"medium":"low"}function as(e){return{high:"trust-score--high",medium:"trust-score--medium",low:"trust-score--low",none:"trust-score--none"}[e]}function Z0(e){return{improving:"Improving",declining:"Declining",stable:"Stable",new:"New"}[e]??"New"}function eS(e){return{improving:"trust-trend--up",declining:"trust-trend--down",stable:"trust-trend--stable",new:"trust-trend--new"}[e]??"trust-trend--new"}function tS(e){return{improving:"↑",declining:"↓",stable:"→",new:"•"}[e]??"•"}function nS(e){const t=Date.now()-Date.parse(e),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const s=Math.floor(n/60);if(s<24)return`${s}h ago`;const a=Math.floor(s/24);return a<7?`${a}d ago`:new Date(e).toLocaleDateString()}function sS(e){const t=e.overallScore,n=fn(t);return r`
6149
6176
  <div class="trust-overall">
6150
6177
  <div class="trust-overall-score ${as(n)}">
6151
6178
  <span class="trust-overall-number">${t!==null?t.toFixed(1):"--"}</span>
@@ -6159,14 +6186,14 @@ ${i}
6159
6186
  </span>
6160
6187
  </div>
6161
6188
  </div>
6162
- `}function nS(e,t){const s=Math.min(100,Math.max(0,(e??t)/10*100)),a=fn(e??(t>0?t:null));return r`
6189
+ `}function aS(e,t){const s=Math.min(100,Math.max(0,(e??t)/10*100)),a=fn(e??(t>0?t:null));return r`
6163
6190
  <div class="trust-progress">
6164
6191
  <div
6165
6192
  class="trust-progress-fill ${as(a)}"
6166
6193
  style="width: ${s}%"
6167
6194
  ></div>
6168
6195
  </div>
6169
- `}function sS(e,t){const s=e.trustScore!==null?e.trustScore.toFixed(1):e.avgRating>0?e.avgRating.toFixed(1):"--",a=fn(e.trustScore??(e.avgRating>0?e.avgRating:null)),i=e.count<10?10-e.count:0;return r`
6196
+ `}function iS(e,t){const s=e.trustScore!==null?e.trustScore.toFixed(1):e.avgRating>0?e.avgRating.toFixed(1):"--",a=fn(e.trustScore??(e.avgRating>0?e.avgRating:null)),i=e.count<10?10-e.count:0;return r`
6170
6197
  <div class="trust-card">
6171
6198
  <div class="trust-card-header">
6172
6199
  <span class="trust-card-name">${e.workflow}</span>
@@ -6180,12 +6207,12 @@ ${i}
6180
6207
  <div class="trust-card-score-row">
6181
6208
  <span class="trust-card-score ${as(a)}">${s}</span>
6182
6209
  <span class="trust-card-score-label">/10</span>
6183
- <span class="trust-trend ${X0(e.trend)}">
6184
- ${Z0(e.trend)} ${J0(e.trend)}
6210
+ <span class="trust-trend ${eS(e.trend)}">
6211
+ ${tS(e.trend)} ${Z0(e.trend)}
6185
6212
  </span>
6186
6213
  </div>
6187
6214
 
6188
- ${nS(e.trustScore,e.avgRating)}
6215
+ ${aS(e.trustScore,e.avgRating)}
6189
6216
 
6190
6217
  <div class="trust-card-meta">
6191
6218
  <span class="trust-card-count">${e.count} rating${e.count!==1?"s":""}</span>
@@ -6200,18 +6227,18 @@ ${i}
6200
6227
  </div>
6201
6228
  `:h}
6202
6229
  </div>
6203
- `}function aS(){return[{workflow:"Code Reviews",avgRating:8.2,count:14,trustScore:8.2,needsFeedback:!1,trend:"improving",recentNotes:[],recentFeedback:[]},{workflow:"Email Drafts",avgRating:6.5,count:11,trustScore:6.5,needsFeedback:!0,trend:"stable",recentNotes:[],recentFeedback:["Be more concise","Match my tone"]},{workflow:"Research",avgRating:7.8,count:3,trustScore:null,needsFeedback:!1,trend:"new",recentNotes:[],recentFeedback:[]}]}function iS(){const e=aS();return{workflows:e.map(t=>t.workflow),summaries:e,ratings:[],total:0,overallScore:7.6,totalRatings:28,totalUses:28}}function oS(e){const t=fn(e.rating);return r`
6230
+ `}function oS(){return[{workflow:"Code Reviews",avgRating:8.2,count:14,trustScore:8.2,needsFeedback:!1,trend:"improving",recentNotes:[],recentFeedback:[]},{workflow:"Email Drafts",avgRating:6.5,count:11,trustScore:6.5,needsFeedback:!0,trend:"stable",recentNotes:[],recentFeedback:["Be more concise","Match my tone"]},{workflow:"Research",avgRating:7.8,count:3,trustScore:null,needsFeedback:!1,trend:"new",recentNotes:[],recentFeedback:[]}]}function rS(){const e=oS();return{workflows:e.map(t=>t.workflow),summaries:e,ratings:[],total:0,overallScore:7.6,totalRatings:28,totalUses:28}}function lS(e){const t=fn(e.rating);return r`
6204
6231
  <div class="trust-rating-row">
6205
6232
  <span class="trust-rating-score ${as(t)}">${e.rating}</span>
6206
6233
  <span class="trust-rating-workflow">${e.workflow}</span>
6207
6234
  ${e.note?r`<span class="trust-rating-note">${e.note}</span>`:h}
6208
- <span class="trust-rating-time">${eS(e.timestamp)}</span>
6235
+ <span class="trust-rating-time">${nS(e.timestamp)}</span>
6209
6236
  </div>
6210
- `}function rS(){return r`
6237
+ `}function cS(){return r`
6211
6238
  <div class="trust-sample-banner">
6212
6239
  Sample data — use skills and rate them to build your real trust profile.
6213
6240
  </div>
6214
- `}function lS(e){const t=e.connected,n=e.guardrailsData,s=e.consciousnessStatus,a=e.data?.todayRating??null,i=e.updateStatus??null,o=i?.openclawUpdateAvailable||i?.pluginUpdateAvailable;if(!t)return{level:"alert",icon:"⚠️",text:"Gateway disconnected",detail:"Reconnect to restore full functionality."};if(o){const c=[];return i.openclawUpdateAvailable&&i.openclawLatest&&c.push(`OpenClaw ${i.openclawVersion} → ${i.openclawLatest}`),i.pluginUpdateAvailable&&i.pluginLatest&&c.push(`GodMode ${i.pluginVersion} → ${i.pluginLatest}`),{level:"warn",icon:"🔄",text:"Update available",detail:c.join(", ")+". Visit Overview to update."}}if(s==="error")return{level:"warn",icon:"🧠",text:"Consciousness sync needs attention",detail:"Your system is running but the last sync encountered an error."};if(n){const c=n.gates.filter(p=>p.enabled).length,u=n.gates.length;if(c<u)return{level:"warn",icon:"🛡",text:`${u-c} security gate${u-c!==1?"s":""} disabled`,detail:"Your system is running with reduced safety coverage."}}const l=i&&!o?" Up to date.":"";return a?a.rating>=8?{level:"ok",icon:"✨",text:`Rated ${a.rating}/10 today — GodMode is running great.`,detail:`All systems secure and building trust daily.${l}`}:a.rating>=5?{level:"ok",icon:"💪",text:`Rated ${a.rating}/10 today — working to improve.`,detail:`Your feedback is being applied. All systems secure.${l}`}:{level:"warn",icon:"💬",text:`Rated ${a.rating}/10 today — your feedback matters.`,detail:`We're using your input to get better. All systems secure.${l}`}:{level:"ok",icon:"✅",text:"Your GodMode is safe, secure, and building trust daily.",detail:`All systems healthy.${l} Rate your day below to help improve.`}}function cS(e){const{level:t,icon:n,text:s,detail:a}=lS(e);return r`
6241
+ `}function dS(e){const t=e.connected,n=e.guardrailsData,s=e.consciousnessStatus,a=e.data?.todayRating??null,i=e.updateStatus??null,o=i?.openclawUpdateAvailable||i?.pluginUpdateAvailable;if(!t)return{level:"alert",icon:"⚠️",text:"Gateway disconnected",detail:"Reconnect to restore full functionality."};if(o){const c=[];return i.openclawUpdateAvailable&&i.openclawLatest&&c.push(`OpenClaw ${i.openclawVersion} → ${i.openclawLatest}`),i.pluginUpdateAvailable&&i.pluginLatest&&c.push(`GodMode ${i.pluginVersion} → ${i.pluginLatest}`),{level:"warn",icon:"🔄",text:"Update available",detail:c.join(", ")+". Visit Overview to update."}}if(s==="error")return{level:"warn",icon:"🧠",text:"Consciousness sync needs attention",detail:"Your system is running but the last sync encountered an error."};if(n){const c=n.gates.filter(p=>p.enabled).length,u=n.gates.length;if(c<u)return{level:"warn",icon:"🛡",text:`${u-c} security gate${u-c!==1?"s":""} disabled`,detail:"Your system is running with reduced safety coverage."}}const l=i&&!o?" Up to date.":"";return a?a.rating>=8?{level:"ok",icon:"✨",text:`Rated ${a.rating}/10 today — GodMode is running great.`,detail:`All systems secure and building trust daily.${l}`}:a.rating>=5?{level:"ok",icon:"💪",text:`Rated ${a.rating}/10 today — working to improve.`,detail:`Your feedback is being applied. All systems secure.${l}`}:{level:"warn",icon:"💬",text:`Rated ${a.rating}/10 today — your feedback matters.`,detail:`We're using your input to get better. All systems secure.${l}`}:{level:"ok",icon:"✅",text:"Your GodMode is safe, secure, and building trust daily.",detail:`All systems healthy.${l} Rate your day below to help improve.`}}function uS(e){const{level:t,icon:n,text:s,detail:a}=dS(e);return r`
6215
6242
  <div class="trust-hero trust-hero--${t}">
6216
6243
  <span class="trust-hero-icon">${n}</span>
6217
6244
  <div class="trust-hero-body">
@@ -6219,7 +6246,7 @@ ${i}
6219
6246
  <div class="trust-hero-detail">${a}</div>
6220
6247
  </div>
6221
6248
  </div>
6222
- `}function dS(e){return e<=4?"trust-daily-button--low":e<=7?"trust-daily-button--med":"trust-daily-button--high"}function Xl(e){const t=[];for(let n=0;n<7;n++)t.push(e[n]??null);return r`
6249
+ `}function pS(e){return e<=4?"trust-daily-button--low":e<=7?"trust-daily-button--med":"trust-daily-button--high"}function Xl(e){const t=[];for(let n=0;n<7;n++)t.push(e[n]??null);return r`
6223
6250
  <div class="trust-daily-trend">
6224
6251
  ${t.map(n=>{if(!n)return r`<div class="trust-daily-trend-dot trust-daily-trend-dot--empty"></div>`;const s=Math.max(4,n.rating/10*28),a=fn(n.rating);return r`
6225
6252
  <div
@@ -6229,7 +6256,7 @@ ${i}
6229
6256
  ></div>
6230
6257
  `})}
6231
6258
  </div>
6232
- `}function uS(e){const t=e.data,n=t?.todayRating??null,s=t?.recentDaily??[],a=t?.dailyStreak??0,i=t?.dailyAverage??null;if(!e.onDailyRate)return h;if(n){const o=fn(n.rating),l=n.rating<7&&!n.note;return r`
6259
+ `}function hS(e){const t=e.data,n=t?.todayRating??null,s=t?.recentDaily??[],a=t?.dailyStreak??0,i=t?.dailyAverage??null;if(!e.onDailyRate)return h;if(n){const o=fn(n.rating),l=n.rating<7&&!n.note;return r`
6233
6260
  <div class="trust-daily">
6234
6261
  <div class="trust-daily-header">
6235
6262
  <span class="trust-daily-prompt">Today's Rating</span>
@@ -6273,7 +6300,7 @@ ${i}
6273
6300
  <div class="trust-daily-buttons">
6274
6301
  ${[1,2,3,4,5,6,7,8,9,10].map(o=>r`
6275
6302
  <button
6276
- class="trust-daily-button ${dS(o)}"
6303
+ class="trust-daily-button ${pS(o)}"
6277
6304
  type="button"
6278
6305
  title="${o}/10"
6279
6306
  @click=${()=>e.onDailyRate(o)}
@@ -6287,7 +6314,7 @@ ${i}
6287
6314
  </div>
6288
6315
  `:h}
6289
6316
  </div>
6290
- `}function pS(e){if(!e)return r`
6317
+ `}function fS(e){if(!e)return r`
6291
6318
  <div class="trust-health-card">
6292
6319
  <div class="trust-health-card-header">
6293
6320
  <span class="trust-health-card-icon">\u{1F6E1}</span>
@@ -6329,7 +6356,7 @@ ${i}
6329
6356
  <div class="trust-health-activity">No activity in last 24h</div>
6330
6357
  `}
6331
6358
  </div>
6332
- `}function hS(e){return!e||e==="idle"?"Idle":e==="loading"?"Syncing...":e==="ok"?"Synced":"Error"}function fS(e){return!e||e==="idle"?"trust-health-dot--idle":e==="loading"?"trust-health-dot--warn":e==="ok"?"trust-health-dot--ok":"trust-health-dot--error"}function gS(e){const t=e.connected,n=e.consciousnessStatus,s=e.sessionsCount,a=e.gatewayUptimeMs,l=(t?1:0)+(n==="ok"||n==="idle"?1:0)===2&&t;return r`
6359
+ `}function gS(e){return!e||e==="idle"?"Idle":e==="loading"?"Syncing...":e==="ok"?"Synced":"Error"}function mS(e){return!e||e==="idle"?"trust-health-dot--idle":e==="loading"?"trust-health-dot--warn":e==="ok"?"trust-health-dot--ok":"trust-health-dot--error"}function vS(e){const t=e.connected,n=e.consciousnessStatus,s=e.sessionsCount,a=e.gatewayUptimeMs,l=(t?1:0)+(n==="ok"||n==="idle"?1:0)===2&&t;return r`
6333
6360
  <div class="trust-health-card">
6334
6361
  <div class="trust-health-card-header">
6335
6362
  <span class="trust-health-card-icon">\u{1F4E1}</span>
@@ -6344,9 +6371,9 @@ ${i}
6344
6371
  </div>
6345
6372
 
6346
6373
  <div class="trust-health-row">
6347
- <span class="trust-health-dot ${fS(n)}"></span>
6374
+ <span class="trust-health-dot ${mS(n)}"></span>
6348
6375
  <span class="trust-health-label">Consciousness</span>
6349
- <span class="trust-health-value">${hS(n)}</span>
6376
+ <span class="trust-health-value">${gS(n)}</span>
6350
6377
  </div>
6351
6378
 
6352
6379
  ${s!=null?r`
@@ -6365,15 +6392,15 @@ ${i}
6365
6392
  </div>
6366
6393
  `:h}
6367
6394
  </div>
6368
- `}function mS(e){return r`
6395
+ `}function yS(e){return r`
6369
6396
  <div class="trust-health">
6370
6397
  <h3 class="trust-health-title">System Health</h3>
6371
6398
  <div class="trust-health-grid">
6372
- ${pS(e.guardrailsData)}
6373
- ${gS(e)}
6399
+ ${fS(e.guardrailsData)}
6400
+ ${vS(e)}
6374
6401
  </div>
6375
6402
  </div>
6376
- `}function vS(e){const{connected:t,loading:n,data:s,onRemoveWorkflow:a,onRefresh:i}=e;if(!t)return r`
6403
+ `}function bS(e){const{connected:t,loading:n,data:s,onRemoveWorkflow:a,onRefresh:i}=e;if(!t)return r`
6377
6404
  <section class="tab-body trust-section">
6378
6405
  <div class="trust-disconnected">Not connected to gateway.</div>
6379
6406
  </section>
@@ -6381,32 +6408,32 @@ ${i}
6381
6408
  <section class="tab-body trust-section">
6382
6409
  <div class="trust-loading">Loading trust tracker...</div>
6383
6410
  </section>
6384
- `;const l=!(s?.summaries??[]).some(f=>f.count>0),c=l?iS():s,u=c.summaries,p=l?[]:s?.ratings??[];return r`
6411
+ `;const l=!(s?.summaries??[]).some(f=>f.count>0),c=l?rS():s,u=c.summaries,p=l?[]:s?.ratings??[];return r`
6385
6412
  <section class="tab-body trust-section">
6386
- ${cS(e)}
6413
+ ${uS(e)}
6387
6414
 
6388
- ${l?rS():h}
6415
+ ${l?cS():h}
6389
6416
 
6390
- ${uS(e)}
6417
+ ${hS(e)}
6391
6418
 
6392
- ${tS(c)}
6419
+ ${sS(c)}
6393
6420
 
6394
6421
  <div class="trust-workflows-grid">
6395
- ${u.map(f=>sS(f,l?null:a))}
6422
+ ${u.map(f=>iS(f,l?null:a))}
6396
6423
  </div>
6397
6424
 
6398
- ${mS(e)}
6425
+ ${yS(e)}
6399
6426
 
6400
6427
  ${p.length>0?r`
6401
6428
  <div class="trust-history">
6402
6429
  <h3 class="trust-history-title">Recent Ratings</h3>
6403
6430
  <div class="trust-history-list">
6404
- ${p.slice(0,20).map(oS)}
6431
+ ${p.slice(0,20).map(lS)}
6405
6432
  </div>
6406
6433
  </div>
6407
6434
  `:h}
6408
6435
  </section>
6409
- `}function yS(e){const t=Date.now()-Date.parse(e),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const s=Math.floor(n/60);if(s<24)return`${s}h ago`;const a=Math.floor(s/24);return a<7?`${a}d ago`:new Date(e).toLocaleDateString()}function bS(e){return{fired:"guardrails-badge--fired",blocked:"guardrails-badge--blocked",cleaned:"guardrails-badge--cleaned"}[e]??""}function sp(e,t){return r`
6436
+ `}function wS(e){const t=Date.now()-Date.parse(e),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const s=Math.floor(n/60);if(s<24)return`${s}h ago`;const a=Math.floor(s/24);return a<7?`${a}d ago`:new Date(e).toLocaleDateString()}function $S(e){return{fired:"guardrails-badge--fired",blocked:"guardrails-badge--blocked",cleaned:"guardrails-badge--cleaned"}[e]??""}function sp(e,t){return r`
6410
6437
  <button
6411
6438
  class="options-toggle ${e?"options-toggle--on":""}"
6412
6439
  role="switch"
@@ -6417,7 +6444,7 @@ ${i}
6417
6444
  <span class="options-toggle-thumb"></span>
6418
6445
  </span>
6419
6446
  </button>
6420
- `}function wS(e,t,n,s){const a=e.thresholds?.[t]??0;return r`
6447
+ `}function kS(e,t,n,s){const a=e.thresholds?.[t]??0;return r`
6421
6448
  <div class="guardrails-threshold">
6422
6449
  <label class="guardrails-threshold-label">${n}</label>
6423
6450
  <input
@@ -6429,7 +6456,7 @@ ${i}
6429
6456
  @change=${i=>{const o=Number(i.target.value);!Number.isNaN(o)&&o>0&&s(e.id,t,o)}}
6430
6457
  />
6431
6458
  </div>
6432
- `}function $S(e,t,n){const s=e.thresholdLabels?Object.keys(e.thresholdLabels):[];return r`
6459
+ `}function SS(e,t,n){const s=e.thresholdLabels?Object.keys(e.thresholdLabels):[];return r`
6433
6460
  <div class="guardrails-card card ${e.enabled?"":"guardrails-card--disabled"}">
6434
6461
  <div class="guardrails-card-header">
6435
6462
  <div class="guardrails-card-info">
@@ -6442,11 +6469,11 @@ ${i}
6442
6469
  <div class="guardrails-card-description">${e.description}</div>
6443
6470
  ${s.length>0?r`
6444
6471
  <div class="guardrails-thresholds">
6445
- ${s.map(a=>wS(e,a,e.thresholdLabels[a],n))}
6472
+ ${s.map(a=>kS(e,a,e.thresholdLabels[a],n))}
6446
6473
  </div>
6447
6474
  `:h}
6448
6475
  </div>
6449
- `}function kS(e,t,n){const s=e.action==="redirect"?"↪":"🚫",a=e.action==="redirect"?"redirect":"block";return r`
6476
+ `}function AS(e,t,n){const s=e.action==="redirect"?"↪":"🚫",a=e.action==="redirect"?"redirect":"block";return r`
6450
6477
  <div class="guardrails-card card guardrails-custom-card ${e.enabled?"":"guardrails-card--disabled"}">
6451
6478
  <div class="guardrails-card-header">
6452
6479
  <div class="guardrails-card-info">
@@ -6465,14 +6492,14 @@ ${i}
6465
6492
  ${e.trigger.patterns.map(i=>r`<span class="guardrails-pattern-tag">${i}</span>`)}
6466
6493
  </div>
6467
6494
  </div>
6468
- `}function SS(e){return r`
6495
+ `}function _S(e){return r`
6469
6496
  <div class="guardrails-activity-row">
6470
- <span class="guardrails-badge ${bS(e.action)}">${e.action}</span>
6497
+ <span class="guardrails-badge ${$S(e.action)}">${e.action}</span>
6471
6498
  <span class="guardrails-activity-gate">${e.gateId}</span>
6472
6499
  <span class="guardrails-activity-detail">${e.detail}</span>
6473
- <span class="guardrails-activity-time">${yS(e.timestamp)}</span>
6500
+ <span class="guardrails-activity-time">${wS(e.timestamp)}</span>
6474
6501
  </div>
6475
- `}function AS(e){const{connected:t,loading:n,data:s,onToggle:a,onThresholdChange:i,onCustomToggle:o,onCustomDelete:l,onToggleAddForm:c,onOpenAllyChat:u}=e;if(!t)return r`
6502
+ `}function TS(e){const{connected:t,loading:n,data:s,onToggle:a,onThresholdChange:i,onCustomToggle:o,onCustomDelete:l,onToggleAddForm:c,onOpenAllyChat:u}=e;if(!t)return r`
6476
6503
  <section class="tab-body guardrails-section">
6477
6504
  <div class="guardrails-empty">Not connected to gateway.</div>
6478
6505
  </section>
@@ -6487,7 +6514,7 @@ ${i}
6487
6514
  <h2 class="guardrails-col-heading">Safety Gates</h2>
6488
6515
  <p class="guardrails-col-subtitle">${g}/${p.length} active — prevent runaway loops, bad searches, and lazy responses.</p>
6489
6516
  <div class="guardrails-grid">
6490
- ${p.map(v=>$S(v,a,i))}
6517
+ ${p.map(v=>SS(v,a,i))}
6491
6518
  </div>
6492
6519
  </div>
6493
6520
 
@@ -6503,7 +6530,7 @@ ${i}
6503
6530
 
6504
6531
  ${m.length>0?r`
6505
6532
  <div class="guardrails-custom-grid">
6506
- ${m.map(v=>kS(v,o,l))}
6533
+ ${m.map(v=>AS(v,o,l))}
6507
6534
  </div>
6508
6535
  `:r`
6509
6536
  <div class="guardrails-custom-empty">
@@ -6516,19 +6543,19 @@ ${i}
6516
6543
  <h3 class="guardrails-history-title">Recent Activity</h3>
6517
6544
  ${f.length>0?r`
6518
6545
  <div class="guardrails-history-list">
6519
- ${f.slice(0,30).map(SS)}
6546
+ ${f.slice(0,30).map(_S)}
6520
6547
  </div>
6521
6548
  `:r`<div class="guardrails-no-activity">No gate activity recorded yet.</div>`}
6522
6549
  </div>
6523
6550
  </div>
6524
6551
  </div>
6525
6552
  </section>
6526
- `}const _S={coding:"Builder",research:"Researcher",analysis:"Analyst",creative:"Creative",review:"Reviewer",ops:"Ops",task:"Agent",url:"Reader",idea:"Explorer"};function TS(e){const t=Date.now()-e,n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const s=Math.floor(n/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function xS(e){switch(e){case"started":return"▶️";case"completed":return"✅";case"failed":return"❌";case"queued":return"⏳";case"stage":return"🔄";default:return"📋"}}function Zl(e){switch(e){case"coding":return"mc-type-badge mc-type-badge--coding";case"subagent":return"mc-type-badge mc-type-badge--subagent";case"swarm":return"mc-type-badge mc-type-badge--swarm";case"queue":return"mc-type-badge mc-type-badge--queue";default:return"mc-type-badge"}}function ec(e){return`mc-agent-card mc-agent-card--${e}`}function CS(e){const t=[];return e.activeNow>0&&t.push(`${e.activeNow} agent${e.activeNow>1?"s":""} working`),e.queueReview>0&&t.push(`${e.queueReview} need${e.queueReview>1?"":"s"} your attention`),e.completedToday>0&&t.push(`${e.completedToday} done today`),t.length===0&&(t.push("Nothing running"),e.completedToday>0&&t.push(`${e.completedToday} completed today`)),r`
6553
+ `}const xS={coding:"Builder",research:"Researcher",analysis:"Analyst",creative:"Creative",review:"Reviewer",ops:"Ops",task:"Agent",url:"Reader",idea:"Explorer"};function CS(e){const t=Date.now()-e,n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const s=Math.floor(n/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function ES(e){switch(e){case"started":return"▶️";case"completed":return"✅";case"failed":return"❌";case"queued":return"⏳";case"stage":return"🔄";default:return"📋"}}function Zl(e){switch(e){case"coding":return"mc-type-badge mc-type-badge--coding";case"subagent":return"mc-type-badge mc-type-badge--subagent";case"swarm":return"mc-type-badge mc-type-badge--swarm";case"queue":return"mc-type-badge mc-type-badge--queue";default:return"mc-type-badge"}}function ec(e){return`mc-agent-card mc-agent-card--${e}`}function LS(e){const t=[];return e.activeNow>0&&t.push(`${e.activeNow} agent${e.activeNow>1?"s":""} working`),e.queueReview>0&&t.push(`${e.queueReview} need${e.queueReview>1?"":"s"} your attention`),e.completedToday>0&&t.push(`${e.completedToday} done today`),t.length===0&&(t.push("Nothing running"),e.completedToday>0&&t.push(`${e.completedToday} completed today`)),r`
6527
6554
  <div class="mc-status-line">
6528
6555
  ${e.activeNow>0?r`<span class="mc-active-dot"></span>`:h}
6529
6556
  <span>${t.join(" · ")}</span>
6530
6557
  </div>
6531
- `}function ES(e){return r`
6558
+ `}function RS(e){return r`
6532
6559
  <div class="mc-stats-banner">
6533
6560
  <div class="mc-stat-card">
6534
6561
  <div class="mc-stat-value">
@@ -6553,7 +6580,7 @@ ${i}
6553
6580
  <div class="mc-stat-label">Queue${e.queueReview>0?` (${e.queueReview} review)`:""}</div>
6554
6581
  </div>
6555
6582
  </div>
6556
- `}function LS(e){return e.swarmStages?r`
6583
+ `}function PS(e){return e.swarmStages?r`
6557
6584
  <div class="mc-pipeline">
6558
6585
  ${["design","build","qc"].map((n,s)=>{const i=e.swarmStages?.[n]?.status??"pending";return r`
6559
6586
  ${s>0?r`<span class="mc-pipeline-arrow">\u2192</span>`:h}
@@ -6593,7 +6620,7 @@ ${i}
6593
6620
  ${e.branch?r`<span class="mc-agent-card-model">${e.branch}</span>`:h}
6594
6621
  ${e.error&&e.status!=="failed"?r`<span style="color: var(--danger, #ef4444)">${e.error}</span>`:h}
6595
6622
  </div>
6596
- ${e.type==="swarm"?LS(e):h}
6623
+ ${e.type==="swarm"?PS(e):h}
6597
6624
  ${e.status==="failed"?r`
6598
6625
  <div class="mc-agent-card-actions">
6599
6626
  <button class="mc-detail-btn" @click=${i=>{i.stopPropagation(),t.onViewDetail(e)}}>View Error</button>
@@ -6610,7 +6637,7 @@ ${i}
6610
6637
  <div class="mc-agents-grid">
6611
6638
  ${s.map(a=>ap(a,t,n))}
6612
6639
  </div>
6613
- `}function RS(e,t,n,s,a){const i=e.filter(o=>o.isReview===!0);return i.length===0?h:r`
6640
+ `}function IS(e,t,n,s,a){const i=e.filter(o=>o.isReview===!0);return i.length===0?h:r`
6614
6641
  <div style="margin-bottom: 1.5rem">
6615
6642
  <h3 class="mc-section-title">Ready for Review</h3>
6616
6643
  <div class="mc-agents-grid">
@@ -6630,7 +6657,7 @@ ${i}
6630
6657
  `)}
6631
6658
  </div>
6632
6659
  </div>
6633
- `}function PS(e,t){const n=e.filter(s=>s.status==="pending");return n.length===0?h:r`
6660
+ `}function MS(e,t){const n=e.filter(s=>s.status==="pending");return n.length===0?h:r`
6634
6661
  <div style="margin-bottom: 1.5rem">
6635
6662
  <h3 class="mc-section-title">Queued (${n.length})</h3>
6636
6663
  <div class="mc-agents-grid">
@@ -6638,7 +6665,7 @@ ${i}
6638
6665
  <div class="mc-agent-card mc-agent-card--queued">
6639
6666
  <div class="mc-agent-card-header">
6640
6667
  <div class="mc-agent-card-info">
6641
- <span class="mc-type-badge mc-type-badge--queue">${_S[s.type]??s.type}</span>
6668
+ <span class="mc-type-badge mc-type-badge--queue">${xS[s.type]??s.type}</span>
6642
6669
  <span class="mc-agent-card-task">${s.title}</span>
6643
6670
  </div>
6644
6671
  ${t?r`<button class="mc-open-session-btn" @click=${()=>t(s.id)}>Start</button>`:h}
@@ -6648,7 +6675,7 @@ ${i}
6648
6675
  `)}
6649
6676
  </div>
6650
6677
  </div>
6651
- `}function IS(e,t,n){const s=e.filter(a=>a.isReview===!0||a.status==="failed");return s.length===0?r`
6678
+ `}function DS(e,t,n){const s=e.filter(a=>a.isReview===!0||a.status==="failed");return s.length===0?r`
6652
6679
  <div class="mc-attention-section">
6653
6680
  <div class="mc-attention-empty">
6654
6681
  Nothing needs you right now.
@@ -6676,16 +6703,16 @@ ${i}
6676
6703
  `)}
6677
6704
  </div>
6678
6705
  </div>
6679
- `}function MS(e){const t=e.filter(n=>n.status==="pending");return t.length===0?h:r`<div class="mc-queue-depth-text">${t.length} more queued</div>`}function DS(e){return e?r`
6706
+ `}function OS(e){const t=e.filter(n=>n.status==="pending");return t.length===0?h:r`<div class="mc-queue-depth-text">${t.length} more queued</div>`}function NS(e){return e?r`
6680
6707
  <div class="mc-idle-cta">
6681
6708
  <p>Prosper is idle.</p>
6682
6709
  <button class="mc-open-session-btn" @click=${e}>Ask Prosper what to work on</button>
6683
6710
  </div>
6684
- `:h}function OS(e,t){const n=(e.type==="failed"||e.type==="completed")&&e.agentRef;return r`
6711
+ `:h}function FS(e,t){const n=(e.type==="failed"||e.type==="completed")&&e.agentRef;return r`
6685
6712
  <div class="mc-feed-item ${n?"mc-feed-item--clickable":""}"
6686
6713
  @click=${n?()=>t?.(e.agentRef):h}>
6687
- <span class="mc-feed-time">${TS(e.timestamp)}</span>
6688
- <span class="mc-feed-icon">${xS(e.type)}</span>
6714
+ <span class="mc-feed-time">${CS(e.timestamp)}</span>
6715
+ <span class="mc-feed-icon">${ES(e.type)}</span>
6689
6716
  <span class="mc-feed-text">${e.summary}</span>
6690
6717
  ${e.prUrl&&!n?r`<a class="mc-feed-link" href="${e.prUrl}" target="_blank">View PR</a>`:h}
6691
6718
  </div>
@@ -6707,18 +6734,18 @@ ${i}
6707
6734
  <h3 class="mc-section-title">Activity Feed</h3>
6708
6735
  `}
6709
6736
  <div class="mc-feed-list">
6710
- ${a.map(o=>OS(o,n))}
6737
+ ${a.map(o=>FS(o,n))}
6711
6738
  </div>
6712
6739
  ${i?r`<button class="mc-show-more-btn" @click=${()=>{}}>Show all ${e.length} events</button>`:h}
6713
6740
  </div>
6714
- `}function NS(e,t){const s=e.filter(i=>i.status==="done"||i.status==="failed").filter(i=>!i.isReview);if(s.length===0)return h;const a=s.slice(0,10);return r`
6741
+ `}function BS(e,t){const s=e.filter(i=>i.status==="done"||i.status==="failed").filter(i=>!i.isReview);if(s.length===0)return h;const a=s.slice(0,10);return r`
6715
6742
  <div style="margin-bottom: 1.5rem">
6716
6743
  <h3 class="mc-section-title">Recent Completed</h3>
6717
6744
  <div class="mc-agents-grid">
6718
6745
  ${a.map(i=>ap(i,t))}
6719
6746
  </div>
6720
6747
  </div>
6721
- `}function FS(e){if(!e.connected)return r`<div class="mc-section"><div class="mc-empty">Not connected to gateway.</div></div>`;if(e.loading&&!e.data)return r`<div class="mc-section"><div class="mc-loading">Loading agent data...</div></div>`;if(e.error&&!e.data)return r`
6748
+ `}function US(e){if(!e.connected)return r`<div class="mc-section"><div class="mc-empty">Not connected to gateway.</div></div>`;if(e.loading&&!e.data)return r`<div class="mc-section"><div class="mc-loading">Loading agent data...</div></div>`;if(e.error&&!e.data)return r`
6722
6749
  <div class="mc-section">
6723
6750
  <div class="mc-empty" style="color: var(--danger, #ef4444)">
6724
6751
  ${e.error}
@@ -6735,7 +6762,7 @@ ${i}
6735
6762
  </button>
6736
6763
  </div>
6737
6764
 
6738
- ${e.fullControl?ES(t.stats):CS(t.stats)}
6765
+ ${e.fullControl?RS(t.stats):LS(t.stats)}
6739
6766
 
6740
6767
  ${e.fullControl?r`
6741
6768
  <div class="mc-two-col">
@@ -6743,40 +6770,40 @@ ${i}
6743
6770
  <h3 class="mc-section-title">Active Agents</h3>
6744
6771
  ${tc(t.agents,n)}
6745
6772
 
6746
- ${RS(t.agents,e.onApproveItem,e.onViewDetail,e.onOpenTaskSession,e.onViewTaskFiles)}
6773
+ ${IS(t.agents,e.onApproveItem,e.onViewDetail,e.onOpenTaskSession,e.onViewTaskFiles)}
6747
6774
 
6748
- ${PS(t.queueItems,e.onStartQueueItem)}
6775
+ ${MS(t.queueItems,e.onStartQueueItem)}
6749
6776
 
6750
6777
  ${nc(t.activityFeed,!1,e.onViewDetail)}
6751
6778
  </div>
6752
6779
 
6753
6780
  <div class="mc-col-side">
6754
- ${NS(t.agents,n)}
6781
+ ${BS(t.agents,n)}
6755
6782
  </div>
6756
6783
  </div>
6757
6784
  `:r`
6758
6785
  <div>
6759
- ${IS(t.agents,n,e.onApproveItem)}
6786
+ ${DS(t.agents,n,e.onApproveItem)}
6760
6787
 
6761
6788
  ${t.stats.activeNow>0||t.agents.some(s=>s.status==="active"||s.status==="queued")?r`
6762
6789
  <h3 class="mc-section-title">Active</h3>
6763
6790
  ${tc(t.agents,n,!0)}
6764
6791
  `:h}
6765
6792
 
6766
- ${MS(t.queueItems)}
6793
+ ${OS(t.queueItems)}
6767
6794
 
6768
- ${t.stats.activeNow===0&&t.stats.queueDepth===0?DS(e.onAskProsper):h}
6795
+ ${t.stats.activeNow===0&&t.stats.queueDepth===0?NS(e.onAskProsper):h}
6769
6796
 
6770
6797
  ${nc(t.activityFeed,!1,e.onViewDetail,!0)}
6771
6798
  </div>
6772
6799
  `}
6773
6800
  </div>
6774
- `}function BS(e,t){if(e?.label)return e.label;if(e?.displayName)return e.displayName;const n=Te.get(t);if(n)return n;if(t.includes("webchat")){const a=t.match(/webchat[:-](\d+)/);return a?`Chat ${a[1]}`:"Chat"}if(t.includes("main"))return"MAIN";const s=t.split(/[:-]/);return s[s.length-1]||t}function US(e){return e?e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e):"0"}function zS(e){const t=e,n=String(t.role??"");if(n!=="user"&&n!=="assistant")return h;const s=typeof t.content=="string"?t.content:Array.isArray(t.content)?t.content.filter(i=>i.type==="text").map(i=>String(i.text??"")).join(" "):"";if(!s.trim())return h;const a=s.slice(0,300);return r`
6801
+ `}function zS(e,t){if(e?.label)return e.label;if(e?.displayName)return e.displayName;const n=Te.get(t);if(n)return n;if(t.includes("webchat")){const a=t.match(/webchat[:-](\d+)/);return a?`Chat ${a[1]}`:"Chat"}if(t.includes("main"))return"MAIN";const s=t.split(/[:-]/);return s[s.length-1]||t}function KS(e){return e?e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e):"0"}function WS(e){const t=e,n=String(t.role??"");if(n!=="user"&&n!=="assistant")return h;const s=typeof t.content=="string"?t.content:Array.isArray(t.content)?t.content.filter(i=>i.type==="text").map(i=>String(i.text??"")).join(" "):"";if(!s.trim())return h;const a=s.slice(0,300);return r`
6775
6802
  <div class="parallel-col__msg parallel-col__msg--${n}">
6776
6803
  <span class="parallel-col__msg-role">${n==="user"?"You":"AI"}</span>
6777
6804
  <span class="parallel-col__msg-text">${a}${s.length>300?"...":""}</span>
6778
6805
  </div>
6779
- `}function KS(e){return r`
6806
+ `}function qS(e){return r`
6780
6807
  <div
6781
6808
  class="parallel-col parallel-col--empty"
6782
6809
  @dragover=${t=>{t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.currentTarget.classList.add("parallel-col--dragover")}}
@@ -6794,7 +6821,7 @@ ${i}
6794
6821
  <span class="parallel-col__drop-text">Drag a session here</span>
6795
6822
  </div>
6796
6823
  </div>
6797
- `}function WS(e,t,n){const{state:s,onAssignLane:a,onSendInLane:i}=n,o=s.sessionsResult?.sessions??[],l=Ie(o,t),c=l?.key??t,u=s.workingSessions.has(t)||s.workingSessions.has(c),p=BS(l,t),f=Fs.get(t)??Fs.get(c),m=l?.model??"",g=l?.totalTokens??0,$=s.settings.tabLastViewed[c]??s.settings.tabLastViewed[t]??0,d=l?.updatedAt??0,v=!u&&d>$,_=t===s.sessionKey?s.chatMessages:Ke.get(t)??Ke.get(c)??[],T=A=>{A instanceof HTMLElement&&A.dispatchEvent(new CustomEvent("lane-viewed",{detail:{sessionKey:c},bubbles:!0,composed:!0}))};return r`
6824
+ `}function jS(e,t,n){const{state:s,onAssignLane:a,onSendInLane:i}=n,o=s.sessionsResult?.sessions??[],l=Ie(o,t),c=l?.key??t,u=s.workingSessions.has(t)||s.workingSessions.has(c),p=zS(l,t),f=Fs.get(t)??Fs.get(c),m=l?.model??"",g=l?.totalTokens??0,$=s.settings.tabLastViewed[c]??s.settings.tabLastViewed[t]??0,d=l?.updatedAt??0,v=!u&&d>$,_=t===s.sessionKey?s.chatMessages:Ke.get(t)??Ke.get(c)??[],T=A=>{A instanceof HTMLElement&&A.dispatchEvent(new CustomEvent("lane-viewed",{detail:{sessionKey:c},bubbles:!0,composed:!0}))};return r`
6798
6825
  <div
6799
6826
  class="parallel-col parallel-col--filled ${u?"parallel-col--working":""} ${v?"parallel-col--ready":""}"
6800
6827
  @pointerdown=${A=>T(A.currentTarget)}
@@ -6836,13 +6863,13 @@ ${i}
6836
6863
  <div class="parallel-col__meta">
6837
6864
  ${m?r`<span class="parallel-col__model">${m}</span>`:h}
6838
6865
  <span class="parallel-col__turns">${f!=null?`${f} turns`:"--"}</span>
6839
- <span class="parallel-col__tokens">${US(g)} tokens</span>
6866
+ <span class="parallel-col__tokens">${KS(g)} tokens</span>
6840
6867
  </div>
6841
6868
  </div>
6842
6869
 
6843
6870
  <!-- Messages -->
6844
6871
  <div class="parallel-col__messages">
6845
- ${_.length>0?_.slice(-120).map(zS):r`<div class="parallel-col__empty">No messages yet</div>`}
6872
+ ${_.length>0?_.slice(-120).map(WS):r`<div class="parallel-col__empty">No messages yet</div>`}
6846
6873
  </div>
6847
6874
 
6848
6875
  <!-- Compose -->
@@ -6856,16 +6883,16 @@ ${i}
6856
6883
  />
6857
6884
  </div>
6858
6885
  </div>
6859
- `}function qS(e){const t=e.state.settings.parallelLanes;return r`
6886
+ `}function HS(e){const t=e.state.settings.parallelLanes;return r`
6860
6887
  <div
6861
6888
  class="parallel-columns"
6862
6889
  @lane-drop=${n=>{e.onAssignLane(n.detail.laneIndex,n.detail.sessionKey)}}
6863
6890
  @lane-reorder=${n=>{e.onReorderLanes(n.detail.fromIndex,n.detail.toIndex)}}
6864
6891
  @lane-viewed=${n=>{e.onLaneViewed(n.detail.sessionKey)}}
6865
6892
  >
6866
- ${t.map((n,s)=>n?WS(s,n,e):KS(s))}
6893
+ ${t.map((n,s)=>n?jS(s,n,e):qS(s))}
6867
6894
  </div>
6868
- `}const jS=20;function ip(e){switch(e.split(".").pop()?.toLowerCase()){case"md":return"📝";case"html":return"🌐";case"json":case"yaml":case"yml":case"toml":return"⚙️";case"ts":case"js":case"py":case"sh":case"rs":case"go":return"💻";case"css":return"🎨";default:return"📄"}}function op(e,t=jS){const n=[];function s(a){for(const i of a){if(n.length>=t)return;const o=i;o.type==="file"?n.push(o):o.type==="directory"&&o.children&&s(o.children)}}return s(e),n}const HS=8;function VS(e){return op(e,500).filter(n=>n.modifiedAt!=null).sort((n,s)=>(s.modifiedAt??0)-(n.modifiedAt??0)).slice(0,HS)}function GS(e){const n=Date.now()-e,s=Math.floor(n/6e4);if(s<1)return"just now";if(s<60)return`${s}m ago`;const a=Math.floor(s/60);if(a<24)return`${a}h ago`;const i=Math.floor(a/24);return i<30?`${i}d ago`:`${Math.floor(i/30)}mo ago`}function QS(e,t){if(!e||e.length===0)return h;const n=VS(e);return n.length===0?h:r`
6895
+ `}const VS=20;function ip(e){switch(e.split(".").pop()?.toLowerCase()){case"md":return"📝";case"html":return"🌐";case"json":case"yaml":case"yml":case"toml":return"⚙️";case"ts":case"js":case"py":case"sh":case"rs":case"go":return"💻";case"css":return"🎨";default:return"📄"}}function op(e,t=VS){const n=[];function s(a){for(const i of a){if(n.length>=t)return;const o=i;o.type==="file"?n.push(o):o.type==="directory"&&o.children&&s(o.children)}}return s(e),n}const GS=8;function QS(e){return op(e,500).filter(n=>n.modifiedAt!=null).sort((n,s)=>(s.modifiedAt??0)-(n.modifiedAt??0)).slice(0,GS)}function YS(e){const n=Date.now()-e,s=Math.floor(n/6e4);if(s<1)return"just now";if(s<60)return`${s}m ago`;const a=Math.floor(s/60);if(a<24)return`${a}h ago`;const i=Math.floor(a/24);return i<30?`${i}d ago`:`${Math.floor(i/30)}mo ago`}function JS(e,t){if(!e||e.length===0)return h;const n=QS(e);return n.length===0?h:r`
6869
6896
  <div class="work-section">
6870
6897
  <div class="work-section-label">Recent</div>
6871
6898
  <div class="work-file-list">
@@ -6876,12 +6903,12 @@ ${i}
6876
6903
  >
6877
6904
  <span class="work-file-icon">${ip(s.name)}</span>
6878
6905
  <span class="work-file-name">${s.name}</span>
6879
- <span class="work-file-meta">${s.modifiedAt?GS(s.modifiedAt):""}</span>
6906
+ <span class="work-file-meta">${s.modifiedAt?YS(s.modifiedAt):""}</span>
6880
6907
  </button>
6881
6908
  `)}
6882
6909
  </div>
6883
6910
  </div>
6884
- `}function YS(e,t){if(!e||e.length===0)return h;const n=op(e);return n.length===0?h:r`
6911
+ `}function XS(e,t){if(!e||e.length===0)return h;const n=op(e);return n.length===0?h:r`
6885
6912
  <div class="work-file-list">
6886
6913
  ${n.map(s=>r`
6887
6914
  <button
@@ -6895,7 +6922,7 @@ ${i}
6895
6922
  `)}
6896
6923
  ${e.length>n.length?r`<div class="work-file-overflow">+${e.length-n.length} more files</div>`:h}
6897
6924
  </div>
6898
- `}function JS(e,t,n,s,a,i,o,l){return r`
6925
+ `}function ZS(e,t,n,s,a,i,o,l){return r`
6899
6926
  <div class="my-day-card work-project ${t?"expanded":""}">
6900
6927
  <button class="my-day-card-header" @click=${a} style="cursor: pointer; width: 100%; border: none; background: none; text-align: left;">
6901
6928
  <div class="my-day-card-title">
@@ -6915,16 +6942,16 @@ ${i}
6915
6942
  Loading...
6916
6943
  </div>
6917
6944
  `:h}
6918
- ${n.length>0?QS(n,o):h}
6945
+ ${n.length>0?JS(n,o):h}
6919
6946
  ${n.length>0?r`
6920
6947
  <div class="work-section">
6921
6948
  <div class="work-section-label">Files</div>
6922
- ${YS(n,o)}
6949
+ ${XS(n,o)}
6923
6950
  </div>
6924
6951
  `:e.outputs.length>0?r`
6925
6952
  <div class="work-section">
6926
6953
  <div class="work-section-label">Files & Outputs</div>
6927
- ${XS(e.outputs)}
6954
+ ${e1(e.outputs)}
6928
6955
  </div>
6929
6956
  `:h}
6930
6957
  ${e.people.length>0?r`
@@ -6967,7 +6994,7 @@ ${i}
6967
6994
  </div>
6968
6995
  `:h}
6969
6996
  </div>
6970
- `}function XS(e){const t=e.reduce((s,a)=>{const i=a.type||"other";return s[i]||(s[i]=[]),s[i].push(a),s},{}),n={document:"📄",template:"📋",report:"📊",presentation:"📽️",spreadsheet:"📈",code:"💻",image:"🖼️",video:"🎬",audio:"🎵",archive:"📦",pdf:"📕",markdown:"📝"};return r`
6997
+ `}function e1(e){const t=e.reduce((s,a)=>{const i=a.type||"other";return s[i]||(s[i]=[]),s[i].push(a),s},{}),n={document:"📄",template:"📋",report:"📊",presentation:"📽️",spreadsheet:"📈",code:"💻",image:"🖼️",video:"🎬",audio:"🎵",archive:"📦",pdf:"📕",markdown:"📝"};return r`
6971
6998
  <div class="work-file-tree">
6972
6999
  ${Object.entries(t).map(([s,a])=>r`
6973
7000
  <div class="work-folder">
@@ -6983,7 +7010,7 @@ ${i}
6983
7010
  `)}
6984
7011
  `)}
6985
7012
  </div>
6986
- `}function ZS(e){const{projects:t,loading:n,error:s,expandedProjects:a=new Set,projectFiles:i={},detailLoading:o=new Set,onRefresh:l,onToggleProject:c,onPersonClick:u,onFileClick:p,onSkillClick:f}=e;if(n)return r`
7013
+ `}function t1(e){const{projects:t,loading:n,error:s,expandedProjects:a=new Set,projectFiles:i={},detailLoading:o=new Set,onRefresh:l,onToggleProject:c,onPersonClick:u,onFileClick:p,onSkillClick:f}=e;if(n)return r`
6987
7014
  <div class="my-day-container">
6988
7015
  <div class="my-day-loading">
6989
7016
  <div class="spinner"></div>
@@ -7021,7 +7048,7 @@ ${i}
7021
7048
  </div>
7022
7049
  </div>
7023
7050
  `:h}
7024
- ${m.map($=>JS($,a.has($.id),i[$.id]??[],o.has($.id),()=>c?.($.id),u,p,f))}
7051
+ ${m.map($=>ZS($,a.has($.id),i[$.id]??[],o.has($.id),()=>c?.($.id),u,p,f))}
7025
7052
  ${g.length>0?r`
7026
7053
  <div style="margin-top: 16px; color: var(--mc-text-muted); font-size: 12px;">
7027
7054
  ${g.length} archived project${g.length!==1?"s":""}
@@ -7030,7 +7057,7 @@ ${i}
7030
7057
  </div>
7031
7058
  </div>
7032
7059
  </div>
7033
- `}function Ze(e){if(!e)return"";try{return z(new Date(e).getTime())}catch{return""}}function pn(e){return r`<div class="second-brain-md-body">${ke(ye(e))}</div>`}function e1(e){const{identity:t}=e;return!t||t.files.length===0?is("No identity files found","Start building your Second Brain by creating USER.md in ~/godmode/."):r`
7060
+ `}function Ze(e){if(!e)return"";try{return z(new Date(e).getTime())}catch{return""}}function pn(e){return r`<div class="second-brain-md-body">${ke(ye(e))}</div>`}function n1(e){const{identity:t}=e;return!t||t.files.length===0?is("No identity files found","Start building your Second Brain by creating USER.md in ~/godmode/."):r`
7034
7061
  <div class="second-brain-panel">
7035
7062
  ${t.identityOs?r`
7036
7063
  <div
@@ -7071,7 +7098,7 @@ ${i}
7071
7098
  </div>
7072
7099
  `:h}
7073
7100
  </div>
7074
- `}function t1(e){const{memoryBank:t,selectedEntry:n,searchQuery:s,browsingFolder:a,folderEntries:i,folderName:o}=e;if(n)return r`
7101
+ `}function s1(e){const{memoryBank:t,selectedEntry:n,searchQuery:s,browsingFolder:a,folderEntries:i,folderName:o}=e;if(n)return r`
7075
7102
  <div class="second-brain-panel">
7076
7103
  <button class="second-brain-back-btn" @click=${()=>e.onBack()}>
7077
7104
  \u{2190} Back
@@ -7158,7 +7185,7 @@ ${i}
7158
7185
  </div>
7159
7186
  ${e.updatedAt?r`<div class="second-brain-entry-meta">${Ze(e.updatedAt)}</div>`:h}
7160
7187
  </div>
7161
- `}function n1(e){const{aiPacket:t,syncing:n}=e;return r`
7188
+ `}function a1(e){const{aiPacket:t,syncing:n}=e;return r`
7162
7189
  <div class="second-brain-panel">
7163
7190
  <div class="second-brain-sync-bar">
7164
7191
  <div class="second-brain-sync-info">
@@ -7203,7 +7230,7 @@ ${i}
7203
7230
  </div>
7204
7231
  `:h}
7205
7232
  </div>
7206
- `}const sc={connected:{dot:"●",label:"Connected",cls:"second-brain-source--connected"},available:{dot:"○",label:"Available",cls:"second-brain-source--available"}};function s1(e){const{sourcesData:t}=e;if(!t||t.sources.length===0)return is("No sources detected","Connect data sources to build your context universe.");const n=t.sources.filter(a=>a.status==="connected"),s=t.sources.filter(a=>a.status==="available");return r`
7233
+ `}const sc={connected:{dot:"●",label:"Connected",cls:"second-brain-source--connected"},available:{dot:"○",label:"Available",cls:"second-brain-source--available"}};function i1(e){const{sourcesData:t}=e;if(!t||t.sources.length===0)return is("No sources detected","Connect data sources to build your context universe.");const n=t.sources.filter(a=>a.status==="connected"),s=t.sources.filter(a=>a.status==="available");return r`
7207
7234
  <div class="second-brain-panel">
7208
7235
  <div class="second-brain-sources-summary">
7209
7236
  <span class="second-brain-sources-count">${t.connectedCount}</span>
@@ -7264,7 +7291,7 @@ ${i}
7264
7291
  </div>
7265
7292
  ${e.updatedAt?r`<div class="second-brain-entry-meta">${Ze(e.updatedAt)}</div>`:h}
7266
7293
  </div>
7267
- `}function a1(e){const{researchData:t,selectedEntry:n,searchQuery:s,browsingFolder:a,folderEntries:i,folderName:o}=e;if(n)return r`
7294
+ `}function o1(e){const{researchData:t,selectedEntry:n,searchQuery:s,browsingFolder:a,folderEntries:i,folderName:o}=e;if(n)return r`
7268
7295
  <div class="second-brain-panel">
7269
7296
  <button class="second-brain-back-btn" @click=${()=>e.onBack()}>
7270
7297
  \u{2190} Back
@@ -7333,7 +7360,7 @@ ${i}
7333
7360
  </div>
7334
7361
  `})}
7335
7362
  </div>
7336
- `}function i1(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}K`:`${(e/(1024*1024)).toFixed(1)}M`}function o1(e){return r`
7363
+ `}function r1(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}K`:`${(e/(1024*1024)).toFixed(1)}M`}function l1(e){return r`
7337
7364
  <div class="sb-files-container">
7338
7365
  <div class="sb-files-search-bar">
7339
7366
  <input
@@ -7345,9 +7372,9 @@ ${i}
7345
7372
  />
7346
7373
  </div>
7347
7374
 
7348
- ${e.fileSearchResults?r1(e):e.fileTreeLoading?r`<div class="sb-files-loading">Loading file tree...</div>`:e.fileTree?rp(e.fileTree,e):r`<div class="sb-files-empty">No files found</div>`}
7375
+ ${e.fileSearchResults?c1(e):e.fileTreeLoading?r`<div class="sb-files-loading">Loading file tree...</div>`:e.fileTree?rp(e.fileTree,e):r`<div class="sb-files-empty">No files found</div>`}
7349
7376
  </div>
7350
- `}function r1(e){const t=e.fileSearchResults??[];return t.length===0?r`<div class="sb-files-empty">No results found</div>`:r`
7377
+ `}function c1(e){const t=e.fileSearchResults??[];return t.length===0?r`<div class="sb-files-empty">No results found</div>`:r`
7351
7378
  <div class="sb-files-results">
7352
7379
  ${t.map(n=>r`
7353
7380
  <button
@@ -7381,7 +7408,7 @@ ${i}
7381
7408
  >
7382
7409
  <span class="sb-file-icon">\u{1F4C4}</span>
7383
7410
  <span class="sb-file-name">${s.name}</span>
7384
- ${s.size!=null?r`<span class="sb-tree-size">${i1(s.size)}</span>`:h}
7411
+ ${s.size!=null?r`<span class="sb-tree-size">${r1(s.size)}</span>`:h}
7385
7412
  </button>
7386
7413
  `)}
7387
7414
  </div>
@@ -7391,7 +7418,7 @@ ${i}
7391
7418
  <div class="second-brain-empty-title">${e}</div>
7392
7419
  <div class="second-brain-empty-hint">${t}</div>
7393
7420
  </div>
7394
- `}function l1(e){if(!e)return h;if(!e.available)return r`
7421
+ `}function d1(e){if(!e)return h;if(!e.available)return r`
7395
7422
  <div class="vault-health-bar vault-health-disconnected">
7396
7423
  <span class="vault-health-status">\u26A0\uFE0F Vault not connected</span>
7397
7424
  <span class="vault-health-detail">Using local storage. Set OBSIDIAN_VAULT_PATH to connect your Obsidian vault.</span>
@@ -7408,9 +7435,9 @@ ${i}
7408
7435
  </span>
7409
7436
  ${s}
7410
7437
  </div>
7411
- `}function c1(e){const{subtab:t,loading:n,vaultHealth:s}=e;return r`
7438
+ `}function u1(e){const{subtab:t,loading:n,vaultHealth:s}=e;return r`
7412
7439
  <section class="second-brain-container">
7413
- ${l1(s)}
7440
+ ${d1(s)}
7414
7441
  <div class="second-brain-tabs">
7415
7442
  <button
7416
7443
  class="second-brain-tab ${t==="identity"?"active":""}"
@@ -7462,9 +7489,9 @@ ${i}
7462
7489
  </button>
7463
7490
  </div>
7464
7491
 
7465
- ${t==="intel"?r`<div class="muted" style="padding: 16px;">Intel has been folded into the daily brief.</div>`:n?r`<div class="second-brain-loading"><div class="second-brain-loading-spinner"></div>Loading...</div>`:t==="identity"?e1(e):t==="memory-bank"?t1(e):t==="ai-packet"?n1(e):t==="sources"?s1(e):t==="resources"?d1(e):t==="files"?o1(e):a1(e)}
7492
+ ${t==="intel"?r`<div class="muted" style="padding: 16px;">Intel has been folded into the daily brief.</div>`:n?r`<div class="second-brain-loading"><div class="second-brain-loading-spinner"></div>Loading...</div>`:t==="identity"?n1(e):t==="memory-bank"?s1(e):t==="ai-packet"?a1(e):t==="sources"?i1(e):t==="resources"?p1(e):t==="files"?l1(e):o1(e)}
7466
7493
  </section>
7467
- `}function d1(e){const{communityResources:t,communityResourceAddFormOpen:n}=e;return r`
7494
+ `}function p1(e){const{communityResources:t,communityResourceAddFormOpen:n}=e;return r`
7468
7495
  <div class="second-brain-panel">
7469
7496
  <div class="second-brain-research-toolbar">
7470
7497
  <div style="flex:1">
@@ -7483,7 +7510,7 @@ ${i}
7483
7510
  </button>
7484
7511
  </div>
7485
7512
 
7486
- ${n?p1(e):h}
7513
+ ${n?f1(e):h}
7487
7514
 
7488
7515
  ${!t||t.resources.length===0?is("No community resources yet","Add GitHub repos, awesome-lists, and tools for your AI agents to discover and reference."):r`
7489
7516
  <div class="second-brain-section">
@@ -7492,12 +7519,12 @@ ${i}
7492
7519
  <span class="second-brain-section-count">${t.count}</span>
7493
7520
  </div>
7494
7521
  <div class="second-brain-entry-list">
7495
- ${t.resources.map(s=>u1(s,e))}
7522
+ ${t.resources.map(s=>h1(s,e))}
7496
7523
  </div>
7497
7524
  </div>
7498
7525
  `}
7499
7526
  </div>
7500
- `}function u1(e,t){return r`
7527
+ `}function h1(e,t){return r`
7501
7528
  <div class="second-brain-entry">
7502
7529
  <div class="second-brain-entry-icon">\u{1F517}</div>
7503
7530
  <div class="second-brain-entry-body">
@@ -7517,7 +7544,7 @@ ${i}
7517
7544
  @click=${n=>{n.stopPropagation(),t.onCommunityResourceRemove(e.id)}}
7518
7545
  >Remove</button>
7519
7546
  </div>
7520
- `}function p1(e){const t=e.communityResourceAddForm??{url:"",label:"",description:"",tags:""};return r`
7547
+ `}function f1(e){const t=e.communityResourceAddForm??{url:"",label:"",description:"",tags:""};return r`
7521
7548
  <div class="second-brain-research-form">
7522
7549
  <div class="second-brain-research-form-row">
7523
7550
  <label class="second-brain-research-form-label">URL *</label>
@@ -7565,7 +7592,7 @@ ${i}
7565
7592
  @click=${()=>e.onCommunityResourceAdd()}
7566
7593
  >Add Resource</button>
7567
7594
  </div>
7568
- `}function h1(e){return e==="global"?r`<span class="dashboard-card-scope">Global</span>`:r`<span class="dashboard-card-scope">${e}</span>`}function f1(e,t,n){return r`
7595
+ `}function g1(e){return e==="global"?r`<span class="dashboard-card-scope">Global</span>`:r`<span class="dashboard-card-scope">${e}</span>`}function m1(e,t,n){return r`
7569
7596
  <div class="dashboard-card">
7570
7597
  <button
7571
7598
  class="dashboard-card-main"
@@ -7574,7 +7601,7 @@ ${i}
7574
7601
  <div class="dashboard-card-title">${e.title}</div>
7575
7602
  ${e.description?r`<div class="dashboard-card-desc">${e.description}</div>`:h}
7576
7603
  <div class="dashboard-card-meta">
7577
- ${h1(e.scope)}
7604
+ ${g1(e.scope)}
7578
7605
  <span>${z(new Date(e.updatedAt).getTime())}</span>
7579
7606
  </div>
7580
7607
  </button>
@@ -7584,7 +7611,7 @@ ${i}
7584
7611
  @click=${s=>{s.stopPropagation(),confirm(`Delete "${e.title}"?`)&&n(e.id)}}
7585
7612
  >&times;</button>
7586
7613
  </div>
7587
- `}function g1(e){const{activeDashboardHtml:t,activeDashboardManifest:n,isWorking:s}=e;return!t||!n?h:r`
7614
+ `}function v1(e){const{activeDashboardHtml:t,activeDashboardManifest:n,isWorking:s}=e;return!t||!n?h:r`
7588
7615
  <section class="dashboards-container">
7589
7616
  <div class="dashboards-active-header">
7590
7617
  <button
@@ -7607,7 +7634,7 @@ ${i}
7607
7634
  </div>
7608
7635
  </div>
7609
7636
  </section>
7610
- `}function m1(e){const{loading:t,dashboards:n}=e;return r`
7637
+ `}function y1(e){const{loading:t,dashboards:n}=e;return r`
7611
7638
  <section class="dashboards-container">
7612
7639
  <div class="dashboards-toolbar">
7613
7640
  <button
@@ -7627,18 +7654,18 @@ ${i}
7627
7654
  </div>
7628
7655
  `:r`
7629
7656
  <div class="dashboards-grid">
7630
- ${n.map(s=>f1(s,e.onSelectDashboard,e.onDeleteDashboard))}
7657
+ ${n.map(s=>m1(s,e.onSelectDashboard,e.onDeleteDashboard))}
7631
7658
  </div>
7632
7659
  `}
7633
7660
  </section>
7634
- `}function v1(e){return e.error?r`
7661
+ `}function b1(e){return e.error?r`
7635
7662
  <section class="dashboards-container">
7636
7663
  <div class="dashboards-error">
7637
7664
  <p>${e.error}</p>
7638
7665
  <button @click=${()=>e.onRefresh()}>Retry</button>
7639
7666
  </div>
7640
7667
  </section>
7641
- `:e.activeDashboardHtml&&e.activeDashboardManifest?g1(e):m1(e)}const y1={0:"Assessment",1:"Interview",2:"Second Brain",3:"Workflow Audit",4:"Configuration",5:"First Win",6:"Ready"},b1=[{id:"slack",name:"Slack",icon:"#",desc:"Team messaging"},{id:"google-calendar",name:"Google Calendar",icon:"Cal",desc:"Events & scheduling"},{id:"clickup",name:"ClickUp",icon:"CU",desc:"Project management"},{id:"github",name:"GitHub",icon:"GH",desc:"Code & repos"},{id:"obsidian",name:"Obsidian",icon:"Ob",desc:"Notes & knowledge"},{id:"notion",name:"Notion",icon:"N",desc:"Docs & wikis"},{id:"linear",name:"Linear",icon:"Li",desc:"Issue tracking"},{id:"apple-reminders",name:"Apple Reminders",icon:"AR",desc:"Tasks (macOS)"},{id:"email",name:"Email",icon:"@",desc:"Gmail / Outlook"},{id:"things-mac",name:"Things",icon:"Th",desc:"Task manager (macOS)"}];function w1(e){return r`
7668
+ `:e.activeDashboardHtml&&e.activeDashboardManifest?v1(e):y1(e)}const w1={0:"Assessment",1:"Interview",2:"Second Brain",3:"Workflow Audit",4:"Configuration",5:"First Win",6:"Ready"},$1=[{id:"slack",name:"Slack",icon:"#",desc:"Team messaging"},{id:"google-calendar",name:"Google Calendar",icon:"Cal",desc:"Events & scheduling"},{id:"clickup",name:"ClickUp",icon:"CU",desc:"Project management"},{id:"github",name:"GitHub",icon:"GH",desc:"Code & repos"},{id:"obsidian",name:"Obsidian",icon:"Ob",desc:"Notes & knowledge"},{id:"notion",name:"Notion",icon:"N",desc:"Docs & wikis"},{id:"linear",name:"Linear",icon:"Li",desc:"Issue tracking"},{id:"apple-reminders",name:"Apple Reminders",icon:"AR",desc:"Tasks (macOS)"},{id:"email",name:"Email",icon:"@",desc:"Gmail / Outlook"},{id:"things-mac",name:"Things",icon:"Th",desc:"Task manager (macOS)"}];function k1(e){return r`
7642
7669
  <div class="onboarding-progress">
7643
7670
  <div class="onboarding-progress-bar">
7644
7671
  ${[2,3,4,5].map(n=>r`
@@ -7646,20 +7673,20 @@ ${i}
7646
7673
  class="onboarding-progress-step ${e>=n?"completed":""} ${e===n?"active":""}"
7647
7674
  >
7648
7675
  <div class="onboarding-progress-dot"></div>
7649
- <span class="onboarding-progress-label">${y1[n]}</span>
7676
+ <span class="onboarding-progress-label">${w1[n]}</span>
7650
7677
  </div>
7651
7678
  `)}
7652
7679
  </div>
7653
7680
  <div class="onboarding-progress-fill" style="width: ${(e-2)/4*100}%"></div>
7654
7681
  </div>
7655
- `}function $1(e,t){return r`
7682
+ `}function S1(e,t){return r`
7656
7683
  <div class="onboarding-tools-overlay">
7657
7684
  <div class="onboarding-tools-header">
7658
7685
  <h3>Connect Your Tools</h3>
7659
7686
  <p>Tap a tool to connect it. The agent will help with setup.</p>
7660
7687
  </div>
7661
7688
  <div class="onboarding-tools-grid">
7662
- ${b1.map(n=>{const a=e.find(i=>i.id===n.id)?.status??"pending";return r`
7689
+ ${$1.map(n=>{const a=e.find(i=>i.id===n.id)?.status??"pending";return r`
7663
7690
  <div class="onboarding-tool-card ${a}" data-tool-id="${n.id}">
7664
7691
  <div class="onboarding-tool-icon">${n.icon}</div>
7665
7692
  <div class="onboarding-tool-name">${n.name}</div>
@@ -7672,7 +7699,7 @@ ${i}
7672
7699
  </div>
7673
7700
  <button class="onboarding-skip-btn" @click=${t}>Skip for now</button>
7674
7701
  </div>
7675
- `}function k1(e){return e.length?r`
7702
+ `}function A1(e){return e.length?r`
7676
7703
  <div class="onboarding-audit-overlay">
7677
7704
  <h3>GodMode Audit Results</h3>
7678
7705
  <div class="onboarding-audit-cards">
@@ -7686,7 +7713,7 @@ ${i}
7686
7713
  `)}
7687
7714
  </div>
7688
7715
  </div>
7689
- `:r`${h}`}function S1(e){const t=e>=70?"#38a169":e>=40?"#d69e2e":"#e53e3e",n=e>=70?"Good":e>=40?"Needs Work":"Getting Started";return r`
7716
+ `:r`${h}`}function _1(e){const t=e>=70?"#38a169":e>=40?"#d69e2e":"#e53e3e",n=e>=70?"Good":e>=40?"Needs Work":"Getting Started";return r`
7690
7717
  <div class="onboarding-health-gauge">
7691
7718
  <div class="health-score" style="color: ${t}">
7692
7719
  <span class="health-number">${e}</span>
@@ -7694,9 +7721,9 @@ ${i}
7694
7721
  </div>
7695
7722
  <div class="health-label" style="color: ${t}">${n}</div>
7696
7723
  </div>
7697
- `}function A1(e){return r`
7724
+ `}function T1(e){return r`
7698
7725
  <div class="onboarding-assessment">
7699
- ${S1(e.healthScore)}
7726
+ ${_1(e.healthScore)}
7700
7727
  <div class="assessment-checklist">
7701
7728
  <div class="assessment-item ${e.configExists?"ok":"gap"}">
7702
7729
  <span class="assessment-icon">${e.configExists?"✅":"❌"}</span>
@@ -7734,14 +7761,14 @@ ${i}
7734
7761
  `)}
7735
7762
  </div>
7736
7763
  </div>
7737
- `}function _1(e,t){return r`
7764
+ `}function x1(e,t){return r`
7738
7765
  <div class="onboarding-fullscreen">
7739
7766
  <div class="onboarding-welcome">
7740
7767
  <div class="onboarding-welcome-glow"></div>
7741
7768
  <h1 class="onboarding-title">Welcome to GodMode</h1>
7742
7769
  ${t?r`
7743
7770
  <p class="onboarding-subtitle">Here's where your setup stands today:</p>
7744
- ${A1(t)}
7771
+ ${T1(t)}
7745
7772
  <p class="onboarding-subtitle">Let's get you to 100. It takes about 15 minutes.</p>
7746
7773
  `:r`
7747
7774
  <div class="onboarding-value-cards">
@@ -7773,7 +7800,7 @@ ${i}
7773
7800
  </button>
7774
7801
  </div>
7775
7802
  </div>
7776
- `}function T1(e){let t="",n="",s="";const a=["rocket","lightning","fire","star","brain","crown","diamond","target","compass","mountain"],i={rocket:"🚀",lightning:"⚡",fire:"🔥",star:"⭐",brain:"🧠",crown:"👑",diamond:"💎",target:"🎯",compass:"🧭",mountain:"⛰️"};function o(l){l.preventDefault();const c=l.target,u=new FormData(c);t=u.get("name")?.trim()??"",n=u.get("mission")?.trim()??"",s=u.get("emoji")?.trim()||"🚀",t&&e({name:t,mission:n,emoji:s})}return r`
7803
+ `}function C1(e){let t="",n="",s="";const a=["rocket","lightning","fire","star","brain","crown","diamond","target","compass","mountain"],i={rocket:"🚀",lightning:"⚡",fire:"🔥",star:"⭐",brain:"🧠",crown:"👑",diamond:"💎",target:"🎯",compass:"🧭",mountain:"⛰️"};function o(l){l.preventDefault();const c=l.target,u=new FormData(c);t=u.get("name")?.trim()??"",n=u.get("mission")?.trim()??"",s=u.get("emoji")?.trim()||"🚀",t&&e({name:t,mission:n,emoji:s})}return r`
7777
7804
  <div class="onboarding-fullscreen">
7778
7805
  <div class="onboarding-identity">
7779
7806
  <h2 class="onboarding-identity-title">Who are you?</h2>
@@ -7821,11 +7848,11 @@ ${i}
7821
7848
  </form>
7822
7849
  </div>
7823
7850
  </div>
7824
- `}function x1(e){const{phase:t,tools:n,auditFindings:s,onSkipPhase:a}=e;return r`
7825
- ${w1(t)}
7826
- ${t===3?$1(n,a):h}
7827
- ${t===4&&s.length>0?k1(s):h}
7828
- `}function C1(e,t,n){return e?r`
7851
+ `}function E1(e){const{phase:t,tools:n,auditFindings:s,onSkipPhase:a}=e;return r`
7852
+ ${k1(t)}
7853
+ ${t===3?S1(n,a):h}
7854
+ ${t===4&&s.length>0?A1(s):h}
7855
+ `}function L1(e,t,n){return e?r`
7829
7856
  <div class="onboarding-fullscreen onboarding-summary">
7830
7857
  <div class="onboarding-summary-content">
7831
7858
  <div class="onboarding-summary-emoji">${t?.emoji??"🚀"}</div>
@@ -7858,7 +7885,7 @@ ${i}
7858
7885
  </button>
7859
7886
  </div>
7860
7887
  </div>
7861
- `:r`${h}`}const E1=["AI updates","Competitor intel","Market trends","Industry news","Tech launches"];function L1(e){let t="",n="",s="",a=!1;function i(l,c){if(!c)return;const u=c.value.trim();u.toLowerCase().includes(l.toLowerCase())||(c.value=u?`${u}, ${l}`:l)}function o(l){if(l.preventDefault(),a)return;const c=l.target,u=c.querySelector('[name="name"]')?.value?.trim()??"",p=c.querySelector('[name="licenseKey"]')?.value?.trim()??"",f=c.querySelector('[name="dailyIntel"]')?.value?.trim()??"";if(!u){c.querySelector('[name="name"]')?.focus();return}a=!0,e.onQuickSetup(u,p,f)}return r`
7888
+ `:r`${h}`}const R1=["AI updates","Competitor intel","Market trends","Industry news","Tech launches"];function P1(e){let t="",n="",s="",a=!1;function i(l,c){if(!c)return;const u=c.value.trim();u.toLowerCase().includes(l.toLowerCase())||(c.value=u?`${u}, ${l}`:l)}function o(l){if(l.preventDefault(),a)return;const c=l.target,u=c.querySelector('[name="name"]')?.value?.trim()??"",p=c.querySelector('[name="licenseKey"]')?.value?.trim()??"",f=c.querySelector('[name="dailyIntel"]')?.value?.trim()??"";if(!u){c.querySelector('[name="name"]')?.focus();return}a=!0,e.onQuickSetup(u,p,f)}return r`
7862
7889
  <div class="setup-quick">
7863
7890
  <div class="setup-quick__header">
7864
7891
  <span class="setup-quick__icon">⚡</span>
@@ -7900,7 +7927,7 @@ ${i}
7900
7927
  <span class="setup-label-optional">(optional)</span>
7901
7928
  </label>
7902
7929
  <div class="setup-chips">
7903
- ${E1.map(l=>r`
7930
+ ${R1.map(l=>r`
7904
7931
  <button
7905
7932
  type="button"
7906
7933
  class="setup-chip"
@@ -7935,7 +7962,7 @@ ${i}
7935
7962
  </button>
7936
7963
  </div>
7937
7964
  </div>
7938
- `}function R1(e){const t=e.steps.filter(a=>a.completed).length,n=e.steps.length,s=t===n;return r`
7965
+ `}function I1(e){const t=e.steps.filter(a=>a.completed).length,n=e.steps.length,s=t===n;return r`
7939
7966
  <details class="setup-milestone ${s?"setup-milestone--done":""}" ?open=${e.status==="in-progress"}>
7940
7967
  <summary class="setup-milestone__header">
7941
7968
  <span class="setup-milestone__emoji">${e.emoji}</span>
@@ -7960,7 +7987,7 @@ ${i}
7960
7987
  </ul>
7961
7988
  </div>
7962
7989
  </details>
7963
- `}function P1(e){const{checklist:t,checklistLoading:n,onHideSetup:s,onOpenWizard:a}=e;if(n&&!t)return r`<div class="setup-loading">Loading setup progress...</div>`;if(!t)return r`<div class="setup-loading">Couldn't load setup progress. Is the gateway running?</div>`;const{milestones:i,percentComplete:o}=t;return r`
7990
+ `}function M1(e){const{checklist:t,checklistLoading:n,onHideSetup:s,onOpenWizard:a}=e;if(n&&!t)return r`<div class="setup-loading">Loading setup progress...</div>`;if(!t)return r`<div class="setup-loading">Couldn't load setup progress. Is the gateway running?</div>`;const{milestones:i,percentComplete:o}=t;return r`
7964
7991
  <div class="setup-checklist">
7965
7992
  <div class="setup-checklist__header">
7966
7993
  <h3 class="setup-checklist__title">Setup Progress</h3>
@@ -7972,7 +7999,7 @@ ${i}
7972
7999
  </div>
7973
8000
 
7974
8001
  <div class="setup-milestones">
7975
- ${i.map(l=>R1(l))}
8002
+ ${i.map(l=>I1(l))}
7976
8003
  </div>
7977
8004
 
7978
8005
  <div class="setup-actions">
@@ -7991,10 +8018,10 @@ ${i}
7991
8018
  </button>
7992
8019
  </div>
7993
8020
  </div>
7994
- `}function I1(e){return e.connected?r`
8021
+ `}function D1(e){return e.connected?r`
7995
8022
  <section class="tab-body setup-section">
7996
- ${e.quickSetupDone?h:L1(e)}
7997
- ${P1(e)}
8023
+ ${e.quickSetupDone?h:P1(e)}
8024
+ ${M1(e)}
7998
8025
  </section>
7999
8026
  `:r`
8000
8027
  <section class="tab-body setup-section">
@@ -8098,7 +8125,7 @@ ${i}
8098
8125
  </button>
8099
8126
  `:r`
8100
8127
  <div class="integration-guide">
8101
- <div class="guide-steps">${M1(s.steps)}</div>
8128
+ <div class="guide-steps">${O1(s.steps)}</div>
8102
8129
 
8103
8130
  ${s.envVars.length>0?r`
8104
8131
  <div class="guide-inputs">
@@ -8155,8 +8182,8 @@ ${i}
8155
8182
  </div>
8156
8183
  `:h}
8157
8184
  </div>
8158
- `}function M1(e){const t=e.split(`
8159
- `),n=[];for(const s of t)s.startsWith("```")||(s.match(/^\d+\./)?n.push(r`<p class="guide-step">${lc(s)}</p>`):s.trim()&&n.push(r`<p>${lc(s)}</p>`));return r`${n}`}function D1(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function lc(e){let t=D1(e);return t=t.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(n,s,a)=>{const i=a.trim().toLowerCase();return i.startsWith("javascript:")||i.startsWith("data:")||i.startsWith("vbscript:")?s:`<a href="${a}" target="_blank" rel="noopener">${s}</a>`}),t=t.replace(/`([^`]+)`/g,"<code>$1</code>"),t=t.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),r`<span>${ke(t)}</span>`}const O1=/^data:/i,N1=/^https?:\/\//i;function F1(e){const t=e.agentsList?.agents??[],s=Cc(e.sessionKey)?.agentId??e.agentsList?.defaultId??"main",i=t.find(l=>l.id===s)?.identity,o=i?.avatarUrl??i?.avatar;if(o)return O1.test(o)||N1.test(o)?o:i?.avatarUrl}function cc(e,t){const n=e.dynamicSlots[t];return n?r`
8185
+ `}function O1(e){const t=e.split(`
8186
+ `),n=[];for(const s of t)s.startsWith("```")||(s.match(/^\d+\./)?n.push(r`<p class="guide-step">${lc(s)}</p>`):s.trim()&&n.push(r`<p>${lc(s)}</p>`));return r`${n}`}function N1(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function lc(e){let t=N1(e);return t=t.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(n,s,a)=>{const i=a.trim().toLowerCase();return i.startsWith("javascript:")||i.startsWith("data:")||i.startsWith("vbscript:")?s:`<a href="${a}" target="_blank" rel="noopener">${s}</a>`}),t=t.replace(/`([^`]+)`/g,"<code>$1</code>"),t=t.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),r`<span>${ke(t)}</span>`}const F1=/^data:/i,B1=/^https?:\/\//i;function U1(e){const t=e.agentsList?.agents??[],s=Cc(e.sessionKey)?.agentId??e.agentsList?.defaultId??"main",i=t.find(l=>l.id===s)?.identity,o=i?.avatarUrl??i?.avatar;if(o)return F1.test(o)||B1.test(o)?o:i?.avatarUrl}function cc(e,t){const n=e.dynamicSlots[t];return n?r`
8160
8187
  <div class="dynamic-slot">
8161
8188
  <div class="dynamic-slot__toolbar">
8162
8189
  <span class="dynamic-slot__label">Custom view</span>
@@ -8168,7 +8195,7 @@ ${i}
8168
8195
  </div>
8169
8196
  <div class="dynamic-slot__content">${ke(Gc(n))}</div>
8170
8197
  </div>
8171
- `:h}function dc(e){return e.trim().toLowerCase().replace(/[^a-z0-9+\s]/g," ").replace(/\s+/g," ")}function Li(e){const t=e.trim();if(!t)return t;const n=t.split(/\s+/);if(n.length>=2&&n.length%2===0){const l=n.length/2,c=n.slice(0,l).join(" "),u=n.slice(l).join(" ");if(c.toLowerCase()===u.toLowerCase())return c}const s=t.replace(/\s+/g," ").toLowerCase(),a=Math.floor(s.length/2),i=s.slice(0,a).trim(),o=s.slice(a).trim();return i&&i===o?t.slice(0,Math.ceil(t.length/2)).trim():t}function Ri(e,t){const n=t?.sessionId?.trim();if(n)return`session:${n}`;const s=t?.label??t?.displayName??Te.get(t?.key??e)??Te.get(e)??"",a=dc(Li(s));if(a){const i=String(t?.surface??"").trim().toLowerCase(),o=dc(String(t?.subject??"")).slice(0,20),l=a.split(" ").filter(Boolean).slice(0,3).join(" ");return`name:${i}|${o}|${l||a.slice(0,24)}`}return`key:${e.trim().toLowerCase()}`}function uc(e){if(e===ee)return!0;const t=e.toLowerCase();return!!(t==="agent:main:main"||t.endsWith(":main"))}function B1(e){const t=e.sessionsResult?.sessions,n=[...new Set(e.settings.openTabs.map(l=>l.trim()).filter(Boolean))].filter(l=>!uc(l)),s=Ie(t,e.sessionKey),a=Ri(e.sessionKey,s),i=new Map;for(const l of n){const c=Ie(t,l),u=Ri(l,c);if(!i.has(u)){i.set(u,l);continue}l===e.sessionKey&&i.set(u,l)}const o=[...i.values()];if(o.length===0){const l=e.sessionKey.trim()||"main";uc(l)||o.push(l)}return{tabKeys:o,activeIdentity:a}}function U1(e){const t=e.onboardingActive&&e.onboarding,n=e.onboardingPhase??0,s=e.onboardingData;if(t&&n===0)return _1(()=>{e.handleOnboardingStart?.()},s?.assessment);if(t&&n===1)return T1(d=>{e.handleOnboardingIdentitySubmit?.(d)});if(t&&n===6)return C1(s?.summary??null,s?.identity??null,()=>{e.handleOnboardingComplete?.()});if(e.wizardActive&&e.wizardState)return np(e.wizardState,{onStepChange:d=>{e.handleWizardStepChange?.(d)},onAnswerChange:(d,v)=>{e.handleWizardAnswerChange?.(d,v)},onPreview:()=>{e.handleWizardPreview?.()},onGenerate:()=>{e.handleWizardGenerate?.()},onClose:()=>{e.handleWizardClose?.()}});const a=e.presenceEntries.length,i=e.sessionsResult?.count??null,o=e.cronStatus?.nextWakeAtMs??null,l=e.connected?null:"Disconnected from gateway.",c=e.tab==="chat",u=c&&(e.settings.chatFocusMode||e.onboarding||t&&n>=2),p=e.onboarding?!1:e.settings.chatShowThinking,f=F1(e),m=e.chatAvatarUrl??f??null,{tabKeys:g,activeIdentity:$}=B1(e);return r`
8198
+ `:h}function dc(e){return e.trim().toLowerCase().replace(/[^a-z0-9+\s]/g," ").replace(/\s+/g," ")}function Li(e){const t=e.trim();if(!t)return t;const n=t.split(/\s+/);if(n.length>=2&&n.length%2===0){const l=n.length/2,c=n.slice(0,l).join(" "),u=n.slice(l).join(" ");if(c.toLowerCase()===u.toLowerCase())return c}const s=t.replace(/\s+/g," ").toLowerCase(),a=Math.floor(s.length/2),i=s.slice(0,a).trim(),o=s.slice(a).trim();return i&&i===o?t.slice(0,Math.ceil(t.length/2)).trim():t}function Ri(e,t){const n=t?.sessionId?.trim();if(n)return`session:${n}`;const s=t?.label??t?.displayName??Te.get(t?.key??e)??Te.get(e)??"",a=dc(Li(s));if(a){const i=String(t?.surface??"").trim().toLowerCase(),o=dc(String(t?.subject??"")).slice(0,20),l=a.split(" ").filter(Boolean).slice(0,3).join(" ");return`name:${i}|${o}|${l||a.slice(0,24)}`}return`key:${e.trim().toLowerCase()}`}function uc(e){if(e===ee)return!0;const t=e.toLowerCase();return!!(t==="agent:main:main"||t.endsWith(":main"))}function z1(e){const t=e.sessionsResult?.sessions,n=[...new Set(e.settings.openTabs.map(l=>l.trim()).filter(Boolean))].filter(l=>!uc(l)),s=Ie(t,e.sessionKey),a=Ri(e.sessionKey,s),i=new Map;for(const l of n){const c=Ie(t,l),u=Ri(l,c);if(!i.has(u)){i.set(u,l);continue}l===e.sessionKey&&i.set(u,l)}const o=[...i.values()];if(o.length===0){const l=e.sessionKey.trim()||"main";uc(l)||o.push(l)}return{tabKeys:o,activeIdentity:a}}function K1(e){const t=e.onboardingActive&&e.onboarding,n=e.onboardingPhase??0,s=e.onboardingData;if(t&&n===0)return x1(()=>{e.handleOnboardingStart?.()},s?.assessment);if(t&&n===1)return C1(d=>{e.handleOnboardingIdentitySubmit?.(d)});if(t&&n===6)return L1(s?.summary??null,s?.identity??null,()=>{e.handleOnboardingComplete?.()});if(e.wizardActive&&e.wizardState)return np(e.wizardState,{onStepChange:d=>{e.handleWizardStepChange?.(d)},onAnswerChange:(d,v)=>{e.handleWizardAnswerChange?.(d,v)},onPreview:()=>{e.handleWizardPreview?.()},onGenerate:()=>{e.handleWizardGenerate?.()},onClose:()=>{e.handleWizardClose?.()}});const a=e.presenceEntries.length,i=e.sessionsResult?.count??null,o=e.cronStatus?.nextWakeAtMs??null,l=e.connected?null:"Disconnected from gateway.",c=e.tab==="chat",u=c&&(e.settings.chatFocusMode||e.onboarding||t&&n>=2),p=e.onboarding?!1:e.settings.chatShowThinking,f=U1(e),m=e.chatAvatarUrl??f??null,{tabKeys:g,activeIdentity:$}=z1(e);return r`
8172
8199
  <div class="shell ${c?"shell--chat":""} ${u?"shell--chat-focus":""} ${e.settings.navCollapsed?"shell--nav-collapsed":""} ${e.onboarding?"shell--onboarding":""}">
8173
8200
  <header class="topbar">
8174
8201
  <div class="topbar-left">
@@ -8359,7 +8386,7 @@ ${i}
8359
8386
  </button>`:h}
8360
8387
 
8361
8388
  ${e.tab==="setup"?r`
8362
- ${I1({connected:e.connected,quickSetupDone:e.setupQuickDone??!1,checklist:e.setupChecklist??null,checklistLoading:e.setupChecklistLoading??!1,onQuickSetup:(d,v,S)=>e.handleQuickSetup?.(d,v,S),onHideSetup:()=>e.handleHideSetup?.(),onOpenWizard:()=>e.handleWizardOpen?.(),onNavigate:d=>e.setTab(d),onRunAssessment:()=>e.handleRunAssessment?.(),onOpenSupportChat:()=>e.handleOpenSupportChat()})}
8389
+ ${D1({connected:e.connected,quickSetupDone:e.setupQuickDone??!1,checklist:e.setupChecklist??null,checklistLoading:e.setupChecklistLoading??!1,onQuickSetup:(d,v,S)=>e.handleQuickSetup?.(d,v,S),onHideSetup:()=>e.handleHideSetup?.(),onOpenWizard:()=>e.handleWizardOpen?.(),onNavigate:d=>e.setTab(d),onRunAssessment:()=>e.handleRunAssessment?.(),onOpenSupportChat:()=>e.handleOpenSupportChat()})}
8363
8390
  ${e.setupQuickDone?oc({connected:e.connected,integrations:e.onboardingIntegrations??null,coreProgress:e.onboardingCoreProgress??null,expandedCard:e.onboardingExpandedCard??null,loadingGuide:e.onboardingLoadingGuide??null,activeGuide:e.onboardingActiveGuide??null,testingId:e.onboardingTestingId??null,testResult:e.onboardingTestResult??null,configValues:e.onboardingConfigValues??{},onLoadIntegrations:()=>e.handleLoadIntegrations(),onExpandCard:d=>e.handleExpandCard(d),onLoadGuide:d=>e.handleLoadGuide(d),onTestIntegration:d=>e.handleTestIntegration(d),onConfigureIntegration:(d,v)=>e.handleConfigureIntegration(d,v),onUpdateConfigValue:(d,v)=>e.handleUpdateConfigValue(d,v),onSkipIntegration:d=>e.handleSkipIntegration(d),onNavigate:d=>e.setTab(d),onMarkComplete:()=>e.handleMarkOnboardingComplete?.(),onOpenSupportChat:()=>e.handleOpenSupportChat()}):h}
8364
8391
  `:h}
8365
8392
 
@@ -8371,7 +8398,7 @@ ${i}
8371
8398
 
8372
8399
  ${e.tab==="today"||e.tab==="my-day"?e.dynamicSlots.today?cc(e,"today"):Lk({connected:e.connected,loading:e.myDayLoading??!1,error:e.myDayError??null,onRefresh:()=>e.handleMyDayRefresh(),dailyBrief:e.dailyBrief??null,dailyBriefLoading:e.dailyBriefLoading??!1,dailyBriefError:e.dailyBriefError??null,onBriefRefresh:()=>e.handleDailyBriefRefresh(),onBriefOpenInObsidian:()=>e.handleDailyBriefOpenInObsidian(),onBriefSave:d=>e.handleBriefSave(d),onBriefToggleCheckbox:(d,v)=>e.handleBriefToggleCheckbox(d,v),onOpenFile:d=>{e.handleOpenFile(d)},selectedDate:e.todaySelectedDate,onDatePrev:()=>e.handleDatePrev(),onDateNext:()=>e.handleDateNext(),onDateToday:()=>e.handleDateToday(),viewMode:e.todayViewMode??"brief",onViewModeChange:d=>e.handleTodayViewModeChange(d),agentLog:e.agentLog??null,agentLogLoading:e.agentLogLoading??!1,agentLogError:e.agentLogError??null,onAgentLogRefresh:()=>e.handleMyDayRefresh(),focusPulseActive:!1,todayTasks:e.todayTasks??[],todayTasksLoading:e.todayTasksLoading??!1,onToggleTaskComplete:(d,v)=>e.handleMyDayTaskStatusChange(d,v==="complete"?"pending":"complete"),onStartTask:d=>e.handleTodayStartTask(d),onCreateTask:d=>e.handleTodayCreateTask(d),onEditTask:d=>e.handleTodayEditTask(d),onUpdateTask:(d,v)=>e.handleTodayUpdateTask(d,v),editingTaskId:e.todayEditingTaskId,showCompletedTasks:e.todayShowCompleted,onToggleCompletedTasks:()=>e.handleTodayToggleCompleted(),decisionCards:(e.todayQueueResults??[]).length>0?{items:e.todayQueueResults,onApprove:d=>e.handleDecisionApprove(d),onReject:d=>e.handleDecisionReject(d),onViewOutput:(d,v)=>e.handleDecisionViewOutput(d,v),onOpenChat:d=>e.handleDecisionOpenChat(d)}:void 0}):h}
8373
8400
 
8374
- ${e.tab==="work"?e.dynamicSlots.work?cc(e,"work"):ZS({connected:e.connected,projects:e.workProjects??[],loading:e.workLoading??!1,error:e.workError??null,expandedProjects:e.workExpandedProjects,projectFiles:e.workProjectFiles??{},detailLoading:e.workDetailLoading??new Set,onRefresh:()=>e.handleWorkRefresh(),onToggleProject:d=>e.handleWorkToggleProject(d),onPersonClick:d=>e.handleWorkPersonClick(d),onFileClick:d=>e.handleWorkFileClick(d),onSkillClick:(d,v)=>e.handleWorkSkillClick(d,v)}):h}
8401
+ ${e.tab==="work"?e.dynamicSlots.work?cc(e,"work"):t1({connected:e.connected,projects:e.workProjects??[],loading:e.workLoading??!1,error:e.workError??null,expandedProjects:e.workExpandedProjects,projectFiles:e.workProjectFiles??{},detailLoading:e.workDetailLoading??new Set,onRefresh:()=>e.handleWorkRefresh(),onToggleProject:d=>e.handleWorkToggleProject(d),onPersonClick:d=>e.handleWorkPersonClick(d),onFileClick:d=>e.handleWorkFileClick(d),onSkillClick:(d,v)=>e.handleWorkSkillClick(d,v)}):h}
8375
8402
 
8376
8403
  ${e.tab==="channels"?Aw({connected:e.connected,loading:e.channelsLoading,snapshot:e.channelsSnapshot,lastError:e.channelsError,lastSuccessAt:e.channelsLastSuccess,whatsappMessage:e.whatsappLoginMessage,whatsappQrDataUrl:e.whatsappLoginQrDataUrl,whatsappConnected:e.whatsappLoginConnected,whatsappBusy:e.whatsappBusy,configSchema:e.configSchema,configSchemaLoading:e.configSchemaLoading,configForm:e.configForm,configUiHints:e.configUiHints,configSaving:e.configSaving,configFormDirty:e.configFormDirty,nostrProfileFormState:e.nostrProfileFormState,nostrProfileAccountId:e.nostrProfileAccountId,onRefresh:d=>Me(e,d),onWhatsAppStart:d=>e.handleWhatsAppStart(d),onWhatsAppWait:()=>e.handleWhatsAppWait(),onWhatsAppLogout:()=>e.handleWhatsAppLogout(),onConfigPatch:(d,v)=>Zt(e,d,v),onConfigSave:()=>e.handleChannelConfigSave(),onConfigReload:()=>e.handleChannelConfigReload(),onNostrProfileEdit:(d,v)=>e.handleNostrProfileEdit(d,v),onNostrProfileCancel:()=>e.handleNostrProfileCancel(),onNostrProfileFieldChange:(d,v)=>e.handleNostrProfileFieldChange(d,v),onNostrProfileSave:()=>e.handleNostrProfileSave(),onNostrProfileImport:()=>e.handleNostrProfileImport(),onNostrProfileToggleAdvanced:()=>e.handleNostrProfileToggleAdvanced()}):h}
8377
8404
 
@@ -8385,7 +8412,7 @@ ${i}
8385
8412
 
8386
8413
  ${e.tab==="nodes"?Rk({loading:e.nodesLoading,nodes:e.nodes,devicesLoading:e.devicesLoading,devicesError:e.devicesError,devicesList:e.devicesList,configForm:e.configForm??e.configSnapshot?.config,configLoading:e.configLoading,configSaving:e.configSaving,configDirty:e.configFormDirty,configFormMode:e.configFormMode,execApprovalsLoading:e.execApprovalsLoading,execApprovalsSaving:e.execApprovalsSaving,execApprovalsDirty:e.execApprovalsDirty,execApprovalsSnapshot:e.execApprovalsSnapshot,execApprovalsForm:e.execApprovalsForm,execApprovalsSelectedAgent:e.execApprovalsSelectedAgent,execApprovalsTarget:e.execApprovalsTarget,execApprovalsTargetNodeId:e.execApprovalsTargetNodeId,onRefresh:()=>na(e),onDevicesRefresh:()=>pt(e),onDeviceApprove:d=>Gm(e,d),onDeviceReject:d=>Qm(e,d),onDeviceRotate:(d,v,S)=>Ym(e,{deviceId:d,role:v,scopes:S}),onDeviceRevoke:(d,v)=>Jm(e,{deviceId:d,role:v}),onLoadConfig:()=>Ye(e),onLoadExecApprovals:()=>{const d=e.execApprovalsTarget==="node"&&e.execApprovalsTargetNodeId?{kind:"node",nodeId:e.execApprovalsTargetNodeId}:{kind:"gateway"};return wo(e,d)},onBindDefault:d=>{d?Zt(e,["tools","exec","node"],d):fr(e,["tools","exec","node"])},onBindAgent:(d,v)=>{const S=["agents","list",d,"tools","exec","node"];v?Zt(e,S,v):fr(e,S)},onSaveBindings:()=>Ps(e),onExecApprovalsTargetChange:(d,v)=>{e.execApprovalsTarget=d,e.execApprovalsTargetNodeId=v,e.execApprovalsSnapshot=null,e.execApprovalsForm=null,e.execApprovalsDirty=!1,e.execApprovalsSelectedAgent=null},onExecApprovalsSelectAgent:d=>{e.execApprovalsSelectedAgent=d},onExecApprovalsPatch:(d,v)=>yy(e,d,v),onExecApprovalsRemove:d=>by(e,d),onSaveExecApprovals:()=>{const d=e.execApprovalsTarget==="node"&&e.execApprovalsTargetNodeId?{kind:"node",nodeId:e.execApprovalsTargetNodeId}:{kind:"gateway"};return vy(e,d)}}):h}
8387
8414
 
8388
- ${t&&n>=2&&n<=5&&e.tab==="chat"?x1({phase:n,identity:s?.identity??null,tools:s?.tools??[],auditFindings:s?.audit?.findings??[],summary:s?.summary??null,onSkipPhase:()=>e.handleOnboardingSkipPhase?.()}):e.tab==="chat"&&e.workspaceNeedsSetup&&!e.chatMessages?.length&&!t?r`
8415
+ ${t&&n>=2&&n<=5&&e.tab==="chat"?E1({phase:n,identity:s?.identity??null,tools:s?.tools??[],auditFindings:s?.audit?.findings??[],summary:s?.summary??null,onSkipPhase:()=>e.handleOnboardingSkipPhase?.()}):e.tab==="chat"&&e.workspaceNeedsSetup&&!e.chatMessages?.length&&!t?r`
8389
8416
  <div class="workspace-welcome-banner">
8390
8417
  <div class="welcome-content">
8391
8418
  <div class="welcome-title">Welcome to GodMode</div>
@@ -8409,21 +8436,21 @@ ${i}
8409
8436
  </div>
8410
8437
  `:h}
8411
8438
 
8412
- ${e.tab==="chat"&&e.settings.chatParallelView?qS({state:e,onAssignLane:(d,v)=>{const S=v?Ie(e.sessionsResult?.sessions,v)?.key??v:null,_=[...e.settings.parallelLanes];_[d]=S,e.applySettings({...e.settings,parallelLanes:_}),S&&e.client&&no(e.client,S).then(()=>{e.applySettings({...e.settings})})},onReorderLanes:(d,v)=>{if(d===v||d<0||v<0||d>=e.settings.parallelLanes.length||v>=e.settings.parallelLanes.length)return;const S=[...e.settings.parallelLanes],[_]=S.splice(d,1);S.splice(v,0,_),e.applySettings({...e.settings,parallelLanes:S})},onLaneViewed:d=>{const v=Ie(e.sessionsResult?.sessions,d)?.key??d,S=Date.now(),T=Ie(e.sessionsResult?.sessions,v)?.updatedAt??0,A=Math.max(e.settings.tabLastViewed[d]??0,e.settings.tabLastViewed[v]??0);T>0&&A>=T||e.applySettings({...e.settings,tabLastViewed:{...e.settings.tabLastViewed,[d]:S,[v]:S}})},onSendInLane:(d,v)=>{d!==e.sessionKey?($e(e),e.sessionKey=d,Le(e,d),e.chatLoading=!0,e.chatMessages=[],e.chatStream=null,e.chatStreamStartedAt=null,e.chatRunId=null,e.resetToolStream(),e.applySettings({...e.settings,sessionKey:d,lastActiveSessionKey:d}),e.loadAssistantIdentity(),ve(e,d,!0),ne(e).then(()=>{e.chatMessage=v,e.handleSendChat(v)})):(e.chatMessage=v,e.handleSendChat(v))}}):h}
8439
+ ${e.tab==="chat"&&e.settings.chatParallelView?HS({state:e,onAssignLane:(d,v)=>{const S=v?Ie(e.sessionsResult?.sessions,v)?.key??v:null,_=[...e.settings.parallelLanes];_[d]=S,e.applySettings({...e.settings,parallelLanes:_}),S&&e.client&&no(e.client,S).then(()=>{e.applySettings({...e.settings})})},onReorderLanes:(d,v)=>{if(d===v||d<0||v<0||d>=e.settings.parallelLanes.length||v>=e.settings.parallelLanes.length)return;const S=[...e.settings.parallelLanes],[_]=S.splice(d,1);S.splice(v,0,_),e.applySettings({...e.settings,parallelLanes:S})},onLaneViewed:d=>{const v=Ie(e.sessionsResult?.sessions,d)?.key??d,S=Date.now(),T=Ie(e.sessionsResult?.sessions,v)?.updatedAt??0,A=Math.max(e.settings.tabLastViewed[d]??0,e.settings.tabLastViewed[v]??0);T>0&&A>=T||e.applySettings({...e.settings,tabLastViewed:{...e.settings.tabLastViewed,[d]:S,[v]:S}})},onSendInLane:(d,v)=>{d!==e.sessionKey?($e(e),e.sessionKey=d,Le(e,d),e.chatLoading=!0,e.chatMessages=[],e.chatStream=null,e.chatStreamStartedAt=null,e.chatRunId=null,e.resetToolStream(),e.applySettings({...e.settings,sessionKey:d,lastActiveSessionKey:d}),e.loadAssistantIdentity(),ve(e,d,!0),ne(e).then(()=>{e.chatMessage=v,e.handleSendChat(v)})):(e.chatMessage=v,e.handleSendChat(v))}}):h}
8413
8440
 
8414
8441
  ${e.tab==="chat"&&!e.settings.chatParallelView?m$({basePath:e.basePath,sessionKey:e.sessionKey,onSessionKeyChange:d=>{$e(e),e.sessionKey=d,Le(e,d),e.chatLoading=!0,e.chatMessages=[],e.chatAttachments=[],e.chatStream=null,e.chatStreamStartedAt=null,e.chatRunId=null,e.chatQueue=[],e.resetToolStream(),e.resetChatScroll(),e.applySettings({...e.settings,sessionKey:d,lastActiveSessionKey:d}),e.loadAssistantIdentity(),ne(e),qs(e)},thinkingLevel:e.chatThinkingLevel,showThinking:p,loading:e.chatLoading,sending:e.chatSending,sendingSessionKey:e.chatSendingSessionKey,compactionStatus:e.compactionStatus,assistantAvatarUrl:m,messages:e.chatMessages,toolMessages:e.chatToolMessages,stream:e.chatStream,streamStartedAt:e.chatStreamStartedAt,draft:e.chatMessage,queue:e.chatQueue,connected:e.connected,canSend:e.connected,disabledReason:l,error:e.lastError,sessions:e.sessionsResult,focusMode:u,onRefresh:()=>(e.resetToolStream(),Promise.all([ne(e),qs(e)])),onToggleFocusMode:()=>{e.onboarding||e.applySettings({...e.settings,chatFocusMode:!e.settings.chatFocusMode})},onChatScroll:d=>e.handleChatScroll(d),onDraftChange:d=>e.chatMessage=d,attachments:e.chatAttachments,onAttachmentsChange:d=>e.chatAttachments=d,showToast:(d,v)=>e.showToast(d,v),onSend:d=>e.handleSendChat(void 0,{queue:d}),canAbort:!!e.chatRunId,onAbort:()=>{e.handleAbortChat()},onCompact:()=>{e.handleCompactChat()},pendingRetry:e.pendingRetry,onRetry:()=>{e.handleRetryMessage()},onClearRetry:()=>e.handleClearRetry(),onQueueRemove:d=>e.removeQueuedMessage(d),onNewSession:()=>e.handleSendChat("/new",{restoreDraft:!0}),onConsciousnessFlush:()=>{e.handleConsciousnessFlush()},consciousnessStatus:e.consciousnessStatus,sidebarOpen:e.sidebarOpen,sidebarContent:e.sidebarContent,sidebarError:e.sidebarError,sidebarMimeType:e.sidebarMimeType,sidebarFilePath:e.sidebarFilePath,sidebarTitle:e.sidebarTitle,splitRatio:e.splitRatio,onOpenSidebar:(d,v)=>e.handleOpenSidebar(d,v),onMessageLinkClick:d=>e.handleOpenMessageFileLink(d),onCloseSidebar:()=>e.handleCloseSidebar(),onOpenFile:d=>e.handleOpenFile(d),onSplitRatioChange:d=>e.handleSplitRatioChange(d),onPushToDrive:(d,v)=>e.handlePushToDrive(d,v),driveAccounts:e.driveAccounts,showDrivePicker:e.showDrivePicker,driveUploading:e.driveUploading,onToggleDrivePicker:()=>e.handleToggleDrivePicker(),onImageClick:(d,v,S)=>e.handleImageClick(d,v,S),resolveImageUrl:(d,v)=>kv(e.sessionKey,d,v),assistantName:e.assistantName,assistantAvatar:e.assistantAvatar,userName:e.userName,userAvatar:e.userAvatar,currentToolName:e.currentToolName,currentToolInfo:e.currentToolInfo,isWorking:e.workingSessions.has(e.sessionKey),showScrollButton:!e.chatUserNearBottom,showNewMessages:e.chatNewMessagesBelow,onScrollToBottom:()=>{const d=document.querySelector(".chat-thread");d&&(d.scrollTo({top:d.scrollHeight,behavior:"smooth"}),e.chatUserNearBottom=!0,e.chatNewMessagesBelow=!1)},allyPanelOpen:e.allyPanelOpen??!1,allyProps:e.allyPanelOpen?{allyName:e.assistantName,allyAvatar:e.assistantAvatar??null,open:!0,messages:e.allyMessages??[],stream:e.allyStream??null,draft:e.allyDraft??"",sending:e.allySending??!1,isWorking:e.allyWorking??!1,unreadCount:0,connected:e.connected,compact:!0,attachments:e.allyAttachments??[],onToggle:()=>e.handleAllyToggle(),onDraftChange:d=>e.handleAllyDraftChange(d),onSend:()=>e.handleAllySend(),onOpenFullChat:()=>e.handleAllyOpenFull(),onAttachmentsChange:d=>e.handleAllyAttachmentsChange(d)}:null}):h}
8415
8442
 
8416
8443
  ${e.tab==="options"?M0({connected:e.connected,loading:e.godmodeOptionsLoading,options:e.godmodeOptions,onToggle:(d,v)=>e.handleOptionToggle(d,v),onOpenWizard:e.handleWizardOpen?()=>e.handleWizardOpen?.():void 0}):h}
8417
8444
 
8418
- ${e.tab==="guardrails"?AS({connected:e.connected,loading:e.guardrailsLoading,data:e.guardrailsData,showAddForm:e.guardrailsShowAddForm,onToggle:(d,v)=>e.handleGuardrailToggle(d,v),onThresholdChange:(d,v,S)=>e.handleGuardrailThresholdChange(d,v,S),onCustomToggle:(d,v)=>e.handleCustomGuardrailToggle(d,v),onCustomDelete:d=>e.handleCustomGuardrailDelete(d),onToggleAddForm:()=>e.handleToggleGuardrailAddForm(),onOpenAllyChat:d=>{e.handleAllyToggle(),d&&e.handleAllyDraftChange(d)}}):h}
8445
+ ${e.tab==="guardrails"?TS({connected:e.connected,loading:e.guardrailsLoading,data:e.guardrailsData,showAddForm:e.guardrailsShowAddForm,onToggle:(d,v)=>e.handleGuardrailToggle(d,v),onThresholdChange:(d,v,S)=>e.handleGuardrailThresholdChange(d,v,S),onCustomToggle:(d,v)=>e.handleCustomGuardrailToggle(d,v),onCustomDelete:d=>e.handleCustomGuardrailDelete(d),onToggleAddForm:()=>e.handleToggleGuardrailAddForm(),onOpenAllyChat:d=>{e.handleAllyToggle(),d&&e.handleAllyDraftChange(d)}}):h}
8419
8446
 
8420
- ${e.tab==="mission-control"?FS({connected:e.connected,loading:e.missionControlLoading,error:e.missionControlError,data:e.missionControlData??null,fullControl:e.missionControlFullControl,onToggleFullControl:()=>e.handleMissionControlToggleFullControl(),onRefresh:()=>e.handleMissionControlRefresh(),onCancelTask:d=>e.handleMissionControlCancelTask(d),onApproveItem:d=>e.handleMissionControlApproveItem(d),onRetryItem:d=>e.handleMissionControlRetryItem(d),onViewDetail:d=>e.handleMissionControlViewDetail(d),onOpenSession:d=>e.handleMissionControlOpenSession(d),onOpenTaskSession:d=>e.handleMissionControlOpenTaskSession(d),onStartQueueItem:d=>e.handleMissionControlStartQueueItem(d),onViewTaskFiles:d=>e.handleMissionControlViewTaskFiles(d),onAskProsper:()=>{e.handleAllyToggle(),e.handleAllyDraftChange("What should I focus on next?")}}):h}
8447
+ ${e.tab==="mission-control"?US({connected:e.connected,loading:e.missionControlLoading,error:e.missionControlError,data:e.missionControlData??null,fullControl:e.missionControlFullControl,onToggleFullControl:()=>e.handleMissionControlToggleFullControl(),onRefresh:()=>e.handleMissionControlRefresh(),onCancelTask:d=>e.handleMissionControlCancelTask(d),onApproveItem:d=>e.handleMissionControlApproveItem(d),onRetryItem:d=>e.handleMissionControlRetryItem(d),onViewDetail:d=>e.handleMissionControlViewDetail(d),onOpenSession:d=>e.handleMissionControlOpenSession(d),onOpenTaskSession:d=>e.handleMissionControlOpenTaskSession(d),onStartQueueItem:d=>e.handleMissionControlStartQueueItem(d),onViewTaskFiles:d=>e.handleMissionControlViewTaskFiles(d),onAskProsper:()=>{e.handleAllyToggle(),e.handleAllyDraftChange("What should I focus on next?")}}):h}
8421
8448
 
8422
- ${e.tab==="trust"?vS({connected:e.connected,loading:e.trustTrackerLoading,data:e.trustTrackerData,onAddWorkflow:d=>e.handleTrustAddWorkflow(d),onRemoveWorkflow:d=>e.handleTrustRemoveWorkflow(d),onRefresh:()=>e.handleTrustLoad(),guardrailsData:e.guardrailsData,consciousnessStatus:e.consciousnessStatus,sessionsCount:i,gatewayUptimeMs:e.hello?.snapshot?.uptimeMs??null,onDailyRate:(d,v)=>e.handleDailyRate(d,v),updateStatus:e.updateStatus?{openclawUpdateAvailable:e.updateStatus.openclawUpdateAvailable,pluginUpdateAvailable:e.updateStatus.pluginUpdateAvailable,openclawVersion:e.updateStatus.openclawVersion,pluginVersion:e.updateStatus.pluginVersion,openclawLatest:e.updateStatus.openclawLatest,pluginLatest:e.updateStatus.pluginLatest}:null}):h}
8449
+ ${e.tab==="trust"?bS({connected:e.connected,loading:e.trustTrackerLoading,data:e.trustTrackerData,onAddWorkflow:d=>e.handleTrustAddWorkflow(d),onRemoveWorkflow:d=>e.handleTrustRemoveWorkflow(d),onRefresh:()=>e.handleTrustLoad(),guardrailsData:e.guardrailsData,consciousnessStatus:e.consciousnessStatus,sessionsCount:i,gatewayUptimeMs:e.hello?.snapshot?.uptimeMs??null,onDailyRate:(d,v)=>e.handleDailyRate(d,v),updateStatus:e.updateStatus?{openclawUpdateAvailable:e.updateStatus.openclawUpdateAvailable,pluginUpdateAvailable:e.updateStatus.pluginUpdateAvailable,openclawVersion:e.updateStatus.openclawVersion,pluginVersion:e.updateStatus.pluginVersion,openclawLatest:e.updateStatus.openclawLatest,pluginLatest:e.updateStatus.pluginLatest}:null}):h}
8423
8450
 
8424
- ${e.tab==="second-brain"?c1({connected:e.connected,loading:e.secondBrainLoading??!1,error:e.secondBrainError??null,subtab:e.secondBrainSubtab??"identity",identity:e.secondBrainIdentity??null,memoryBank:e.secondBrainMemoryBank??null,aiPacket:e.secondBrainAiPacket??null,sourcesData:e.secondBrainSourcesData??null,selectedEntry:e.secondBrainSelectedEntry??null,searchQuery:e.secondBrainSearchQuery??"",syncing:e.secondBrainSyncing??!1,browsingFolder:e.secondBrainBrowsingFolder??null,folderEntries:e.secondBrainFolderEntries??null,folderName:e.secondBrainFolderName??null,onSubtabChange:d=>e.handleSecondBrainSubtabChange(d),onSelectEntry:d=>e.handleSecondBrainSelectEntry(d),onOpenInBrowser:d=>e.handleSecondBrainOpenInBrowser(d),onBrowseFolder:d=>e.handleSecondBrainBrowseFolder(d),onBack:()=>e.handleSecondBrainBack(),onSearch:d=>e.handleSecondBrainSearch(d),onSync:()=>e.handleSecondBrainSync(),onRefresh:()=>e.handleSecondBrainRefresh(),onOpenSidebar:(d,v)=>e.handleOpenSidebar(d,v),researchData:e.secondBrainResearchData??null,researchAddFormOpen:e.secondBrainResearchAddFormOpen??!1,researchAddForm:e.secondBrainResearchAddForm,researchCategories:e.secondBrainResearchCategories??[],onResearchAddFormToggle:()=>e.handleResearchAddFormToggle(),onResearchAddFormChange:(d,v)=>e.handleResearchAddFormChange(d,v),onResearchAddSubmit:()=>e.handleResearchAddSubmit(),onSaveViaChat:()=>e.handleResearchSaveViaChat(),communityResources:e.secondBrainCommunityResources??null,communityResourceAddFormOpen:e.secondBrainCommunityResourceAddFormOpen??!1,communityResourceAddForm:e.secondBrainCommunityResourceAddForm,onCommunityResourceAdd:()=>e.handleCommunityResourceAdd(),onCommunityResourceRemove:d=>e.handleCommunityResourceRemove(d),onCommunityResourceAddFormToggle:()=>e.handleCommunityResourceAddFormToggle(),onCommunityResourceAddFormChange:(d,v)=>e.handleCommunityResourceAddFormChange(d,v),onAddSource:()=>e.handleAddSource(),fileTree:e.secondBrainFileTree??null,fileTreeLoading:e.secondBrainFileTreeLoading??!1,fileSearchQuery:e.secondBrainFileSearchQuery??"",fileSearchResults:e.secondBrainFileSearchResults??null,onFileTreeRefresh:()=>e.handleSecondBrainFileTreeRefresh(),onFileSearch:d=>e.handleSecondBrainFileSearch(d),onFileSelect:d=>e.handleSecondBrainFileSelect(d),intelProps:(e.secondBrainSubtab??"identity")==="intel"?{insights:e.intelInsights??[],discoveries:e.intelDiscoveries??[],patterns:e.intelPatterns??null,status:e.intelStatus??null,loading:e.intelLoading??!1,error:e.intelError??null,onDismiss:d=>e.handleIntelDismiss(d),onAct:d=>e.handleIntelAct(d),onRefresh:()=>e.handleIntelRefresh()}:void 0,vaultHealth:e.secondBrainVaultHealth??null}):h}
8451
+ ${e.tab==="second-brain"?u1({connected:e.connected,loading:e.secondBrainLoading??!1,error:e.secondBrainError??null,subtab:e.secondBrainSubtab??"identity",identity:e.secondBrainIdentity??null,memoryBank:e.secondBrainMemoryBank??null,aiPacket:e.secondBrainAiPacket??null,sourcesData:e.secondBrainSourcesData??null,selectedEntry:e.secondBrainSelectedEntry??null,searchQuery:e.secondBrainSearchQuery??"",syncing:e.secondBrainSyncing??!1,browsingFolder:e.secondBrainBrowsingFolder??null,folderEntries:e.secondBrainFolderEntries??null,folderName:e.secondBrainFolderName??null,onSubtabChange:d=>e.handleSecondBrainSubtabChange(d),onSelectEntry:d=>e.handleSecondBrainSelectEntry(d),onOpenInBrowser:d=>e.handleSecondBrainOpenInBrowser(d),onBrowseFolder:d=>e.handleSecondBrainBrowseFolder(d),onBack:()=>e.handleSecondBrainBack(),onSearch:d=>e.handleSecondBrainSearch(d),onSync:()=>e.handleSecondBrainSync(),onRefresh:()=>e.handleSecondBrainRefresh(),onOpenSidebar:(d,v)=>e.handleOpenSidebar(d,v),researchData:e.secondBrainResearchData??null,researchAddFormOpen:e.secondBrainResearchAddFormOpen??!1,researchAddForm:e.secondBrainResearchAddForm,researchCategories:e.secondBrainResearchCategories??[],onResearchAddFormToggle:()=>e.handleResearchAddFormToggle(),onResearchAddFormChange:(d,v)=>e.handleResearchAddFormChange(d,v),onResearchAddSubmit:()=>e.handleResearchAddSubmit(),onSaveViaChat:()=>e.handleResearchSaveViaChat(),communityResources:e.secondBrainCommunityResources??null,communityResourceAddFormOpen:e.secondBrainCommunityResourceAddFormOpen??!1,communityResourceAddForm:e.secondBrainCommunityResourceAddForm,onCommunityResourceAdd:()=>e.handleCommunityResourceAdd(),onCommunityResourceRemove:d=>e.handleCommunityResourceRemove(d),onCommunityResourceAddFormToggle:()=>e.handleCommunityResourceAddFormToggle(),onCommunityResourceAddFormChange:(d,v)=>e.handleCommunityResourceAddFormChange(d,v),onAddSource:()=>e.handleAddSource(),fileTree:e.secondBrainFileTree??null,fileTreeLoading:e.secondBrainFileTreeLoading??!1,fileSearchQuery:e.secondBrainFileSearchQuery??"",fileSearchResults:e.secondBrainFileSearchResults??null,onFileTreeRefresh:()=>e.handleSecondBrainFileTreeRefresh(),onFileSearch:d=>e.handleSecondBrainFileSearch(d),onFileSelect:d=>e.handleSecondBrainFileSelect(d),intelProps:(e.secondBrainSubtab??"identity")==="intel"?{insights:e.intelInsights??[],discoveries:e.intelDiscoveries??[],patterns:e.intelPatterns??null,status:e.intelStatus??null,loading:e.intelLoading??!1,error:e.intelError??null,onDismiss:d=>e.handleIntelDismiss(d),onAct:d=>e.handleIntelAct(d),onRefresh:()=>e.handleIntelRefresh()}:void 0,vaultHealth:e.secondBrainVaultHealth??null}):h}
8425
8452
 
8426
- ${e.tab==="dashboards"?e.dynamicSlots.dashboards?r`<div class="dynamic-slot">${ke(Gc(e.dynamicSlots.dashboards))}</div>`:v1({connected:e.connected,loading:e.dashboardsLoading??!1,error:e.dashboardsError??null,dashboards:e.dashboardsList,activeDashboardId:e.activeDashboardId??null,activeDashboardHtml:e.activeDashboardHtml??null,activeDashboardManifest:e.activeDashboardManifest??null,isWorking:e.activeDashboardManifest?.sessionId?e.workingSessions.has(e.activeDashboardManifest.sessionId):!1,onSelectDashboard:d=>e.handleDashboardSelect(d),onDeleteDashboard:d=>e.handleDashboardDelete(d),onCreateViaChat:()=>e.handleDashboardCreateViaChat(),onBack:()=>e.handleDashboardBack(),onRefresh:()=>e.handleDashboardsRefresh(),onOpenSession:d=>e.handleDashboardOpenSession(d)}):h}
8453
+ ${e.tab==="dashboards"?e.dynamicSlots.dashboards?r`<div class="dynamic-slot">${ke(Gc(e.dynamicSlots.dashboards))}</div>`:b1({connected:e.connected,loading:e.dashboardsLoading??!1,error:e.dashboardsError??null,dashboards:e.dashboardsList,activeDashboardId:e.activeDashboardId??null,activeDashboardHtml:e.activeDashboardHtml??null,activeDashboardManifest:e.activeDashboardManifest??null,isWorking:e.activeDashboardManifest?.sessionId?e.workingSessions.has(e.activeDashboardManifest.sessionId):!1,onSelectDashboard:d=>e.handleDashboardSelect(d),onDeleteDashboard:d=>e.handleDashboardDelete(d),onCreateViaChat:()=>e.handleDashboardCreateViaChat(),onBack:()=>e.handleDashboardBack(),onRefresh:()=>e.handleDashboardsRefresh(),onOpenSession:d=>e.handleDashboardOpenSession(d)}):h}
8427
8454
 
8428
8455
  ${e.tab==="config"?E$({raw:e.configRaw,originalRaw:e.configRawOriginal,valid:e.configValid,issues:e.configIssues,loading:e.configLoading,saving:e.configSaving,applying:e.configApplying,updating:e.updateRunning,connected:e.connected,schema:e.configSchema,schemaLoading:e.configSchemaLoading,uiHints:e.configUiHints,formMode:e.configFormMode,formValue:e.configForm,originalValue:e.configFormOriginal,searchQuery:e.configSearchQuery,activeSection:e.configActiveSection,activeSubsection:e.configActiveSubsection,onRawChange:d=>{e.configRaw=d},onFormModeChange:d=>e.configFormMode=d,onFormPatch:(d,v)=>Zt(e,d,v),onSearchChange:d=>e.configSearchQuery=d,onSectionChange:d=>{e.configActiveSection=d,e.configActiveSubsection=null},onSubsectionChange:d=>e.configActiveSubsection=d,onReload:()=>Ye(e),onSave:()=>Ps(e),onApply:()=>Jp(e),onUpdate:()=>hr(e),userName:e.userName||"",userAvatar:e.userAvatar,onUserProfileUpdate:(d,v)=>e.handleUpdateUserProfile(d,v),onModelSwitch:(d,v)=>Xp(e,d,v)}):h}
8429
8456
 
@@ -8445,22 +8472,22 @@ ${i}
8445
8472
  ${R0({toasts:e.toasts,onDismiss:d=>e.dismissToast(d)})}
8446
8473
  ${E0(e.lightbox,{onClose:()=>e.handleLightboxClose(),onNav:d=>e.handleLightboxNav(d)})}
8447
8474
  </div>
8448
- `}async function z1(e){}async function K1(e){}async function W1(e,t){}async function q1(e){}async function j1(e){}async function H1(e){}async function Oo(e){if(!(!e.client||!e.connected)){e.trustTrackerLoading=!0;try{const[t,n]=await Promise.all([e.client.request("trust.dashboard",{}),e.client.request("trust.history",{limit:50})]);e.trustTrackerData={workflows:t.workflows,summaries:t.summaries,ratings:n.ratings,total:n.total,overallScore:t.overallScore,totalRatings:t.totalRatings,totalUses:t.totalUses,todayRating:t.todayRating??null,dailyAverage:t.dailyAverage??null,dailyStreak:t.dailyStreak??0,recentDaily:t.recentDaily??[]}}catch{e.trustTrackerData=null}finally{e.trustTrackerLoading=!1}}}async function lp(e,t){if(!(!e.client||!e.connected))try{await e.client.request("trust.workflows.set",{workflows:t}),e.showToast("Workflows updated","success",2e3),await Oo(e)}catch(n){e.showToast("Failed to update workflows","error"),console.error("[TrustTracker] setWorkflows error:",n)}}async function V1(e,t){const n=e.trustTrackerData?.workflows??[];if(n.length>=5){e.showToast("Maximum 5 workflows allowed","error");return}if(n.includes(t.trim())){e.showToast("Workflow already tracked","error");return}await lp(e,[...n,t.trim()])}async function G1(e,t){const n=e.trustTrackerData?.workflows??[];await lp(e,n.filter(s=>s!==t))}async function Q1(e,t,n){if(!(!e.client||!e.connected))try{await e.client.request("trust.dailyRate",{rating:t,...n?{note:n}:{}}),e.showToast(`Rated ${t}/10 today`,"success",2e3),await Oo(e)}catch(s){e.showToast("Failed to submit daily rating","error"),console.error("[TrustTracker] dailyRate error:",s)}}const Y1=6e4,pc=15,hc=new Set;let Es=null;async function fc(e){if(!(!e.client||!e.connected))try{const t=new Date,n=new Date(t.getTime()+pc*6e4+6e4),s=await e.client.request("calendar.events.range",{startDate:t.toISOString(),endDate:n.toISOString()});for(const a of s.events??[]){if(hc.has(a.id))continue;const i=new Date(a.startTime),o=Math.round((i.getTime()-t.getTime())/6e4);if(o>0&&o<=pc){hc.add(a.id);const l=i.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit"}),c=a.location?` @ ${a.location}`:"",u=`${a.title} starts in ${o} min (${l})${c}`;e.showToast(u,"warning",0)}}}catch(t){console.warn("[MeetingNotify] Poll error:",t)}}function J1(e){cp(),fc(e),Es=setInterval(()=>{fc(e)},Y1)}function cp(){Es&&(clearInterval(Es),Es=null)}let X1=0;function Z1(e,t="info",n=3e3,s){return{id:`toast-${Date.now()}-${X1++}`,message:e,type:t,duration:n,createdAt:Date.now(),action:s}}function e2(e,t){return e.filter(n=>n.id!==t)}function t2(e,t){return[...e,t]}var n2=Object.defineProperty,s2=Object.getOwnPropertyDescriptor,b=(e,t,n,s)=>{for(var a=s>1?void 0:s?s2(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(a=(s?o(t,n,a):o(a))||a);return s&&a&&n2(t,n,a),a};function si(){return fm()}function ws(){return mm()}function a2(){if(!window.location.search)return!1;const t=new URLSearchParams(window.location.search).get("onboarding");if(!t)return!1;const n=t.trim().toLowerCase();return n==="1"||n==="true"||n==="yes"||n==="on"}function i2(e,t){let n=e.trim();if(!n)return null;if(n.startsWith("Read HEARTBEAT.md")||n.startsWith("Read CONSCIOUSNESS.md")||/^System:\s*\[\d{4}-\d{2}-\d{2}/.test(n)||n==="NO_REPLY"||n.startsWith(`NO_REPLY
8475
+ `}async function W1(e){}async function q1(e){}async function j1(e,t){}async function H1(e){}async function V1(e){}async function G1(e){}async function Oo(e){if(!(!e.client||!e.connected)){e.trustTrackerLoading=!0;try{const[t,n]=await Promise.all([e.client.request("trust.dashboard",{}),e.client.request("trust.history",{limit:50})]);e.trustTrackerData={workflows:t.workflows,summaries:t.summaries,ratings:n.ratings,total:n.total,overallScore:t.overallScore,totalRatings:t.totalRatings,totalUses:t.totalUses,todayRating:t.todayRating??null,dailyAverage:t.dailyAverage??null,dailyStreak:t.dailyStreak??0,recentDaily:t.recentDaily??[]}}catch{e.trustTrackerData=null}finally{e.trustTrackerLoading=!1}}}async function lp(e,t){if(!(!e.client||!e.connected))try{await e.client.request("trust.workflows.set",{workflows:t}),e.showToast("Workflows updated","success",2e3),await Oo(e)}catch(n){e.showToast("Failed to update workflows","error"),console.error("[TrustTracker] setWorkflows error:",n)}}async function Q1(e,t){const n=e.trustTrackerData?.workflows??[];if(n.length>=5){e.showToast("Maximum 5 workflows allowed","error");return}if(n.includes(t.trim())){e.showToast("Workflow already tracked","error");return}await lp(e,[...n,t.trim()])}async function Y1(e,t){const n=e.trustTrackerData?.workflows??[];await lp(e,n.filter(s=>s!==t))}async function J1(e,t,n){if(!(!e.client||!e.connected))try{await e.client.request("trust.dailyRate",{rating:t,...n?{note:n}:{}}),e.showToast(`Rated ${t}/10 today`,"success",2e3),await Oo(e)}catch(s){e.showToast("Failed to submit daily rating","error"),console.error("[TrustTracker] dailyRate error:",s)}}const X1=6e4,pc=15,hc=new Set;let Es=null;async function fc(e){if(!(!e.client||!e.connected))try{const t=new Date,n=new Date(t.getTime()+pc*6e4+6e4),s=await e.client.request("calendar.events.range",{startDate:t.toISOString(),endDate:n.toISOString()});for(const a of s.events??[]){if(hc.has(a.id))continue;const i=new Date(a.startTime),o=Math.round((i.getTime()-t.getTime())/6e4);if(o>0&&o<=pc){hc.add(a.id);const l=i.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit"}),c=a.location?` @ ${a.location}`:"",u=`${a.title} starts in ${o} min (${l})${c}`;e.showToast(u,"warning",0)}}}catch(t){console.warn("[MeetingNotify] Poll error:",t)}}function Z1(e){cp(),fc(e),Es=setInterval(()=>{fc(e)},X1)}function cp(){Es&&(clearInterval(Es),Es=null)}let e2=0;function t2(e,t="info",n=3e3,s){return{id:`toast-${Date.now()}-${e2++}`,message:e,type:t,duration:n,createdAt:Date.now(),action:s}}function n2(e,t){return e.filter(n=>n.id!==t)}function s2(e,t){return[...e,t]}var a2=Object.defineProperty,i2=Object.getOwnPropertyDescriptor,b=(e,t,n,s)=>{for(var a=s>1?void 0:s?i2(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(a=(s?o(t,n,a):o(a))||a);return s&&a&&a2(t,n,a),a};function si(){return fm()}function ws(){return mm()}function o2(){if(!window.location.search)return!1;const t=new URLSearchParams(window.location.search).get("onboarding");if(!t)return!1;const n=t.trim().toLowerCase();return n==="1"||n==="true"||n==="yes"||n==="on"}function r2(e,t){let n=e.trim();if(!n)return null;if(n.startsWith("Read HEARTBEAT.md")||n.startsWith("Read CONSCIOUSNESS.md")||/^System:\s*\[\d{4}-\d{2}-\d{2}/.test(n)||n==="NO_REPLY"||n.startsWith(`NO_REPLY
8449
8476
  `)||/^#\s*(?:🧠|Atlas Consciousness)/i.test(n)||n.startsWith("# WORKING.md")||n.startsWith("# MISTAKES.md"))return console.debug("[Ally] Filtered message:",t,n.substring(0,100)),null;if(/(?:VERIFIED|FIXED|NEW):\s/.test(n)&&/✅|🟡|☑/.test(n)&&n.length>300)return console.debug("[Ally] Filtered message (verification dump):",t,n.substring(0,100)),null;if(/^###\s*(?:Onboarding Philosophy|Self-Surgery Problem|Open Architecture)/i.test(n))return console.debug("[Ally] Filtered message (system block):",t,n.substring(0,100)),null;if(/^\[GodMode Context:[^\]]*\]\s*$/.test(n))return console.debug("[Ally] Filtered message:",t,n.substring(0,100)),null;if(n=n.replace(/^(?:HEARTBEAT_OK|CONSCIOUSNESS_OK)\s*/i,"").trim(),n=n.replace(/^Deep work window is yours\.\s*/i,"").trim(),!n)return null;if(/^\w+\s+\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/.test(n)&&n.length>200||/^##\s*Your Team\s*\(Agent Roster\)/i.test(n)&&n.indexOf(`
8450
8477
 
8451
- ## `)===-1)return console.debug("[Ally] Filtered message:",t,n.substring(0,100)),null;if(/^##?\s*Persistence Protocol/i.test(n)||/^You are resourceful and thorough\.\s*Your job is to GET THE JOB DONE/i.test(n)||/^##?\s*Core (?:Behaviors|Principles)/i.test(n)||/^##?\s*Your Role as Prosper/i.test(n))return console.debug("[Ally] Filtered message (persona leak):",t,n.substring(0,100)),null;const s=n.toLowerCase();return["persistence protocol","core principles:","core behaviors","your role as prosper","be diligent first time","exhaust reasonable options","assume capability exists","elite executive assistant","consciousness context","working context","enforcement:","internal system context injected by godmode"].filter(i=>s.includes(i)).length>=2?(console.debug("[Ally] Filtered message (multi-signal system leak):",t,n.substring(0,100)),null):/^(?:ID\s+START\s+END\s+SUMMARY)/i.test(n)?(console.debug("[Ally] Filtered message:",t,n.substring(0,100)),null):n}const gc=new Set(["chat","today","workspaces","work","data","overview","channels","instances","sessions","cron","skills","nodes","config","debug","logs","my-day"]),o2=["path","filePath","file","workspacePath"];let y=class extends nn{constructor(){super(...arguments),this.settings=sb(),this.password="",this.tab="chat",this.onboarding=a2(),this.connected=!1,this.reconnecting=!1,this.reconnectAttempt=0,this.theme=this.settings.theme??"system",this.themeResolved="dark",this.hello=null,this.lastError=null,this.eventLog=[],this.toolStreamSyncTimer=null,this.sidebarCloseTimer=null,this.sessionPickerClickOutsideHandler=null,this.sessionSearchClickOutsideHandler=null,this.assistantName=si().name,this.assistantAvatar=si().avatar,this.assistantAgentId=si().agentId??null,this.userName=ws().name,this.userAvatar=ws().avatar,this.sessionKey=this.settings.sessionKey,this.sessionPickerOpen=!1,this.sessionPickerPosition=null,this.sessionPickerSearch="",this.sessionSearchOpen=!1,this.sessionSearchPosition=null,this.sessionSearchQuery="",this.sessionSearchResults=[],this.sessionSearchLoading=!1,this.profilePopoverOpen=!1,this.profileEditName="",this.profileEditAvatar="",this.editingTabKey=null,this.chatLoading=!1,this.chatSending=!1,this.chatSendingSessionKey=null,this.chatMessage="",this.chatDrafts={},this.chatMessages=[],this.chatToolMessages=[],this.chatStream=null,this.chatStreamStartedAt=null,this.chatRunId=null,this.currentToolName=null,this.currentToolInfo=null,this.workingSessions=new Set,this.compactionStatus=null,this.chatAvatarUrl=null,this.chatThinkingLevel=null,this.chatQueue=[],this.chatAttachments=[],this.pendingRetry=null,this.autoRetryAfterCompact=!1,this.sidebarOpen=!1,this.sidebarContent=null,this.sidebarError=null,this.sidebarMimeType=null,this.sidebarFilePath=null,this.sidebarTitle=null,this.splitRatio=this.settings.splitRatio,this.lightbox=Zu(),this.driveAccounts=[],this.showDrivePicker=!1,this.driveUploading=!1,this.updateStatus=null,this.updateLoading=!1,this.updateError=null,this.updateLastChecked=null,this.updatePollInterval=null,this.nodesLoading=!1,this.nodes=[],this.devicesLoading=!1,this.devicesError=null,this.devicesList=null,this.execApprovalsLoading=!1,this.execApprovalsSaving=!1,this.execApprovalsDirty=!1,this.execApprovalsSnapshot=null,this.execApprovalsForm=null,this.execApprovalsSelectedAgent=null,this.execApprovalsTarget="gateway",this.execApprovalsTargetNodeId=null,this.execApprovalQueue=[],this.execApprovalBusy=!1,this.execApprovalError=null,this.pendingGatewayUrl=null,this.configLoading=!1,this.configRaw=`{
8478
+ ## `)===-1)return console.debug("[Ally] Filtered message:",t,n.substring(0,100)),null;if(/^##?\s*Persistence Protocol/i.test(n)||/^You are resourceful and thorough\.\s*Your job is to GET THE JOB DONE/i.test(n)||/^##?\s*Core (?:Behaviors|Principles)/i.test(n)||/^##?\s*Your Role as Prosper/i.test(n))return console.debug("[Ally] Filtered message (persona leak):",t,n.substring(0,100)),null;const s=n.toLowerCase();return["persistence protocol","core principles:","core behaviors","your role as prosper","be diligent first time","exhaust reasonable options","assume capability exists","elite executive assistant","consciousness context","working context","enforcement:","internal system context injected by godmode"].filter(i=>s.includes(i)).length>=2?(console.debug("[Ally] Filtered message (multi-signal system leak):",t,n.substring(0,100)),null):/^(?:ID\s+START\s+END\s+SUMMARY)/i.test(n)?(console.debug("[Ally] Filtered message:",t,n.substring(0,100)),null):n}const gc=new Set(["chat","today","workspaces","work","data","overview","channels","instances","sessions","cron","skills","nodes","config","debug","logs","my-day"]),l2=["path","filePath","file","workspacePath"];let y=class extends nn{constructor(){super(...arguments),this.settings=sb(),this.password="",this.tab="chat",this.onboarding=o2(),this.connected=!1,this.reconnecting=!1,this.reconnectAttempt=0,this.theme=this.settings.theme??"system",this.themeResolved="dark",this.hello=null,this.lastError=null,this.eventLog=[],this.toolStreamSyncTimer=null,this.sidebarCloseTimer=null,this.sessionPickerClickOutsideHandler=null,this.sessionSearchClickOutsideHandler=null,this.assistantName=si().name,this.assistantAvatar=si().avatar,this.assistantAgentId=si().agentId??null,this.userName=ws().name,this.userAvatar=ws().avatar,this.sessionKey=this.settings.sessionKey,this.sessionPickerOpen=!1,this.sessionPickerPosition=null,this.sessionPickerSearch="",this.sessionSearchOpen=!1,this.sessionSearchPosition=null,this.sessionSearchQuery="",this.sessionSearchResults=[],this.sessionSearchLoading=!1,this.profilePopoverOpen=!1,this.profileEditName="",this.profileEditAvatar="",this.editingTabKey=null,this.chatLoading=!1,this.chatSending=!1,this.chatSendingSessionKey=null,this.chatMessage="",this.chatDrafts={},this.chatMessages=[],this.chatToolMessages=[],this.chatStream=null,this.chatStreamStartedAt=null,this.chatRunId=null,this.currentToolName=null,this.currentToolInfo=null,this.workingSessions=new Set,this.compactionStatus=null,this.chatAvatarUrl=null,this.chatThinkingLevel=null,this.chatQueue=[],this.chatAttachments=[],this.pendingRetry=null,this.autoRetryAfterCompact=!1,this.sidebarOpen=!1,this.sidebarContent=null,this.sidebarError=null,this.sidebarMimeType=null,this.sidebarFilePath=null,this.sidebarTitle=null,this.splitRatio=this.settings.splitRatio,this.lightbox=Zu(),this.driveAccounts=[],this.showDrivePicker=!1,this.driveUploading=!1,this.updateStatus=null,this.updateLoading=!1,this.updateError=null,this.updateLastChecked=null,this.updatePollInterval=null,this.nodesLoading=!1,this.nodes=[],this.devicesLoading=!1,this.devicesError=null,this.devicesList=null,this.execApprovalsLoading=!1,this.execApprovalsSaving=!1,this.execApprovalsDirty=!1,this.execApprovalsSnapshot=null,this.execApprovalsForm=null,this.execApprovalsSelectedAgent=null,this.execApprovalsTarget="gateway",this.execApprovalsTargetNodeId=null,this.execApprovalQueue=[],this.execApprovalBusy=!1,this.execApprovalError=null,this.pendingGatewayUrl=null,this.configLoading=!1,this.configRaw=`{
8452
8479
  }
8453
- `,this.configRawOriginal="",this.configValid=null,this.configIssues=[],this.configSaving=!1,this.configApplying=!1,this.updateRunning=!1,this.applySessionKey=this.settings.lastActiveSessionKey,this.configSnapshot=null,this.configSchema=null,this.configSchemaVersion=null,this.configSchemaLoading=!1,this.configUiHints={},this.configForm=null,this.configFormOriginal=null,this.configFormDirty=!1,this.configFormMode="form",this.configSearchQuery="",this.configActiveSection=null,this.configActiveSubsection=null,this.channelsLoading=!1,this.channelsSnapshot=null,this.channelsError=null,this.channelsLastSuccess=null,this.whatsappLoginMessage=null,this.whatsappLoginQrDataUrl=null,this.whatsappLoginConnected=null,this.whatsappBusy=!1,this.nostrProfileFormState=null,this.nostrProfileAccountId=null,this.presenceLoading=!1,this.presenceEntries=[],this.presenceError=null,this.presenceStatus=null,this.agentsLoading=!1,this.agentsList=null,this.agentsError=null,this.sessionsLoading=!1,this.sessionsResult=null,this.sessionsError=null,this.sessionsFilterActive="",this.sessionsFilterLimit="120",this.sessionsIncludeGlobal=!0,this.sessionsIncludeUnknown=!1,this.archivedSessions=[],this.archivedSessionsLoading=!1,this.archivedSessionsExpanded=!1,this.cronLoading=!1,this.cronJobs=[],this.cronStatus=null,this.cronError=null,this.cronForm={...bb},this.cronRunsJobId=null,this.cronRuns=[],this.cronBusy=!1,this.workspaceNeedsSetup=!1,this.onboardingPhase=0,this.onboardingData=null,this.onboardingActive=!1,this.wizardActive=!1,this.wizardState=null,this.showSetupTab=!1,this.setupChecklist=null,this.setupChecklistLoading=!1,this.setupQuickDone=!1,this.onboardingIntegrations=null,this.onboardingCoreProgress=null,this.onboardingExpandedCard=null,this.onboardingLoadingGuide=null,this.onboardingActiveGuide=null,this.onboardingTestingId=null,this.onboardingTestResult=null,this.onboardingConfigValues={},this.onboardingProgress=null,this.selectedWorkspace=null,this.workspacesSearchQuery="",this.workspaceItemSearchQuery="",this.workspacesLoading=!1,this.workspacesCreateLoading=!1,this.workspacesError=null,this.workspaceExpandedFolders=new Set,this.editingTaskId=null,this.workspaceBrowsePath=null,this.workspaceBrowseEntries=null,this.workspaceBreadcrumbs=null,this.workspaceBrowseSearchQuery="",this.workspaceBrowseSearchResults=null,this.myDayLoading=!1,this.myDayError=null,this.todaySelectedDate=re(),this.todayViewMode="brief",this.dailyBriefLoading=!1,this.dailyBriefError=null,this.agentLogLoading=!1,this.agentLogError=null,this.briefNotes={},this.todayTasks=[],this.todayTasksLoading=!1,this.todayEditingTaskId=null,this.todayShowCompleted=!1,this.allyPanelOpen=!1,this.allyMessages=[],this.allyStream=null,this.allyDraft="",this.allyUnread=0,this.allySending=!1,this.allyWorking=!1,this.allyAttachments=[],this.todayQueueResults=[],this.chatPrivateMode=!1,this.privateSessions=new Map,this._privateSessionTimer=null,this.goalsLoading=!1,this.goalsError=null,this.dataLoading=!1,this.dataError=null,this.dataSubtab="dashboard",this.dynamicSlots={},this.workLoading=!1,this.workError=null,this.workExpandedProjects=new Set,this.workProjectFiles={},this.workDetailLoading=new Set,this.skillsLoading=!1,this.skillsReport=null,this.skillsError=null,this.skillsFilter="",this.skillEdits={},this.skillsBusyKey=null,this.skillMessages={},this.debugLoading=!1,this.debugStatus=null,this.debugHealth=null,this.debugModels=[],this.debugHeartbeat=null,this.debugCallMethod="",this.debugCallParams="{}",this.debugCallResult=null,this.debugCallError=null,this.logsLoading=!1,this.logsError=null,this.logsFile=null,this.logsEntries=[],this.logsFilterText="",this.logsLevelFilters={...yb},this.logsAutoFollow=!0,this.logsTruncated=!1,this.logsCursor=null,this.logsLastFetchAt=null,this.logsLimit=500,this.logsMaxBytes=25e4,this.logsAtBottom=!0,this.toasts=[],this.client=null,this.chatScrollFrame=null,this.chatScrollTimeout=null,this.chatHasAutoScrolled=!1,this.chatUserNearBottom=!0,this.chatIsAutoScrolling=!1,this.chatNewMessagesBelow=!1,this.consciousnessStatus="idle",this.focusPulseData=null,this.trustTrackerData=null,this.trustTrackerLoading=!1,this.guardrailsData=null,this.guardrailsLoading=!1,this.guardrailsShowAddForm=!1,this.missionControlData=null,this.missionControlLoading=!1,this.missionControlError=null,this.missionControlFullControl=(()=>{try{return localStorage.getItem("godmode.mc.fullControl")==="1"}catch{return!0}})(),this.missionControlPollInterval=null,this.godmodeOptions=null,this.godmodeOptionsLoading=!1,this.dashboardsLoading=!1,this.dashboardsError=null,this.activeDashboardId=null,this.activeDashboardHtml=null,this.activeDashboardManifest=null,this.dashboardPreviousSessionKey=null,this.dashboardChatOpen=!1,this.secondBrainSubtab="identity",this.secondBrainLoading=!1,this.secondBrainError=null,this.secondBrainIdentity=null,this.secondBrainMemoryBank=null,this.secondBrainAiPacket=null,this.secondBrainSourcesData=null,this.secondBrainResearchData=null,this.secondBrainResearchAddFormOpen=!1,this.secondBrainResearchAddForm={title:"",url:"",category:"",tags:"",notes:""},this.secondBrainResearchCategories=[],this.secondBrainSelectedEntry=null,this.secondBrainSearchQuery="",this.secondBrainSyncing=!1,this.secondBrainBrowsingFolder=null,this.secondBrainFolderEntries=null,this.secondBrainFolderName=null,this.secondBrainFileTree=null,this.secondBrainFileTreeLoading=!1,this.secondBrainFileSearchQuery="",this.secondBrainFileSearchResults=null,this.nodesPollInterval=null,this.logsPollInterval=null,this.debugPollInterval=null,this.agentLogPollInterval=null,this.logsScrollFrame=null,this.toolStreamById=new Map,this.toolStreamOrder=[],this.refreshSessionsAfterChat=!1,this.basePath="",this.popStateHandler=()=>bu(this),this.keydownHandler=()=>{},this.themeMedia=null,this.themeMediaHandler=null,this.topbarObserver=null}createRenderRoot(){return this}connectedCallback(){if(super.connectedCallback(),this.settings.userName)this.userName=this.settings.userName;else{const t=ws();this.userName=t.name}if(this.settings.userAvatar)this.userAvatar=this.settings.userAvatar;else{const t=ws();this.userAvatar=t.avatar}Ib(this);const e=re();this.todaySelectedDate!==e&&(this.todaySelectedDate=e),this.agentLogPollInterval==null&&(this.agentLogPollInterval=window.setInterval(()=>{!this.connected||!(this.tab==="today"||this.tab==="my-day")||this.todayViewMode!=="agent-log"||Jt(this)},6e4)),J1(this),this._restorePrivateSessions()}firstUpdated(){Mb(this)}disconnectedCallback(){cp(),this._stopPrivateSessionTimer(),this.agentLogPollInterval!=null&&(clearInterval(this.agentLogPollInterval),this.agentLogPollInterval=null),Db(this),super.disconnectedCallback()}updated(e){Nb(this,e)}connect(){po(this)}handleChatScroll(e){gh(this,e)}handleLogsScroll(e){mh(this,e)}exportLogs(e,t){vh(e,t)}resetToolStream(){Bi(this)}resetChatScroll(){Lc(this)}async loadAssistantIdentity(){await hd(this)}applySettings(e){Je(this,e)}setTab(e){_o(this,e)}setTheme(e,t){hu(this,e,t)}async loadOverview(){await Co(this)}async loadCron(){await ca(this)}async handleAbortChat(){await Eo(this)}async handleConsciousnessFlush(){if(!(!this.client||this.consciousnessStatus==="loading")){this.consciousnessStatus="loading";try{await this.client.request("godmode.consciousness.flush",{}),this.consciousnessStatus="ok"}catch{this.consciousnessStatus="error"}setTimeout(()=>{this.consciousnessStatus!=="loading"&&(this.consciousnessStatus="idle")},3e3)}}async loadFocusPulse(){await z1()}async handleFocusPulseStartMorning(){await K1(),this.setTab("chat");const e="Let's do my morning set. Check my daily note for today's Win The Day items, then help me review priorities and pick my #1 focus to lock in.",{createNewSession:t}=await E(async()=>{const{createNewSession:n}=await Promise.resolve().then(()=>at);return{createNewSession:n}},void 0,import.meta.url);t(this),this.handleSendChat(e)}async handleFocusPulseSetFocus(e){await W1()}async handleFocusPulseComplete(){await q1()}async handleFocusPulsePulseCheck(){await j1()}async handleFocusPulseEndDay(){await H1()}async handleTrustLoad(){await Oo(this)}async handleTrustAddWorkflow(e){await V1(this,e)}async handleTrustRemoveWorkflow(e){await G1(this,e)}async handleDailyRate(e,t){await Q1(this,e,t)}async handleGuardrailsLoad(){const{loadGuardrails:e}=await E(async()=>{const{loadGuardrails:t}=await Promise.resolve().then(()=>Qt);return{loadGuardrails:t}},void 0,import.meta.url);await e(this)}async handleGuardrailToggle(e,t){const{toggleGuardrail:n}=await E(async()=>{const{toggleGuardrail:s}=await Promise.resolve().then(()=>Qt);return{toggleGuardrail:s}},void 0,import.meta.url);await n(this,e,t)}async handleGuardrailThresholdChange(e,t,n){const{updateGuardrailThreshold:s}=await E(async()=>{const{updateGuardrailThreshold:a}=await Promise.resolve().then(()=>Qt);return{updateGuardrailThreshold:a}},void 0,import.meta.url);await s(this,e,t,n)}async handleCustomGuardrailToggle(e,t){const{toggleCustomGuardrail:n}=await E(async()=>{const{toggleCustomGuardrail:s}=await Promise.resolve().then(()=>Qt);return{toggleCustomGuardrail:s}},void 0,import.meta.url);await n(this,e,t)}async handleCustomGuardrailDelete(e){const{deleteCustomGuardrail:t}=await E(async()=>{const{deleteCustomGuardrail:n}=await Promise.resolve().then(()=>Qt);return{deleteCustomGuardrail:n}},void 0,import.meta.url);await t(this,e)}async handleCustomGuardrailAdd(e){const{addCustomGuardrailFromUI:t}=await E(async()=>{const{addCustomGuardrailFromUI:n}=await Promise.resolve().then(()=>Qt);return{addCustomGuardrailFromUI:n}},void 0,import.meta.url);await t(this,e),this.guardrailsShowAddForm=!1}handleToggleGuardrailAddForm(){this.guardrailsShowAddForm=!this.guardrailsShowAddForm}handleMissionControlToggleFullControl(){this.missionControlFullControl=!this.missionControlFullControl;try{localStorage.setItem("godmode.mc.fullControl",this.missionControlFullControl?"1":"0")}catch{}}async handleMissionControlRefresh(){const{loadMissionControl:e}=await E(async()=>{const{loadMissionControl:t}=await Promise.resolve().then(()=>Gt);return{loadMissionControl:t}},void 0,import.meta.url);await e(this)}async handleMissionControlCancelTask(e){const{cancelCodingTask:t}=await E(async()=>{const{cancelCodingTask:n}=await Promise.resolve().then(()=>Gt);return{cancelCodingTask:n}},void 0,import.meta.url);await t(this,e)}async handleMissionControlApproveItem(e){const{approveCodingTask:t,approveQueueItem:n}=await E(async()=>{const{approveCodingTask:a,approveQueueItem:i}=await Promise.resolve().then(()=>Gt);return{approveCodingTask:a,approveQueueItem:i}},void 0,import.meta.url);await t(this,e)||await n(this,e)}async handleMissionControlRetryItem(e){const{retryQueueItem:t}=await E(async()=>{const{retryQueueItem:n}=await Promise.resolve().then(()=>Gt);return{retryQueueItem:n}},void 0,import.meta.url);await t(this,e)}async handleMissionControlViewDetail(e){const{loadAgentDetail:t}=await E(async()=>{const{loadAgentDetail:s}=await Promise.resolve().then(()=>Gt);return{loadAgentDetail:s}},void 0,import.meta.url),n=await t(this,e);this.handleOpenSidebar(n.content,{mimeType:n.mimeType,title:n.title})}async handleMissionControlOpenSession(e){const t=this.settings.openTabs.includes(e)?this.settings.openTabs:[...this.settings.openTabs,e];this.applySettings({...this.settings,openTabs:t,sessionKey:e,lastActiveSessionKey:e,tabLastViewed:{...this.settings.tabLastViewed,[e]:Date.now()}}),this.sessionKey=e,this.setTab("chat"),this.chatMessages=[],this.chatStream=null,this.chatStreamStartedAt=null,this.chatRunId=null,this.resetToolStream(),this.resetChatScroll(),this.loadAssistantIdentity();const{loadChatHistory:n}=await E(async()=>{const{loadChatHistory:s}=await Promise.resolve().then(()=>Ge);return{loadChatHistory:s}},void 0,import.meta.url);await n(this)}async handleMissionControlOpenTaskSession(e){if(!(!this.client||!this.connected))try{const t=await this.client.request("tasks.openSession",{taskId:e});if(t?.sessionId){if(t.task?.title){const{autoTitleCache:n}=await E(async()=>{const{autoTitleCache:s}=await Promise.resolve().then(()=>Cn);return{autoTitleCache:s}},void 0,import.meta.url);n.set(t.sessionId,t.task.title)}await this.handleMissionControlOpenSession(t.sessionId),t.queueOutput&&this.chatMessages.length===0&&await this.seedSessionWithAgentOutput(t.task?.title??"task",t.queueOutput,t.agentPrompt??void 0)}}catch(t){console.error("[MissionControl] Failed to open task session:",t),this.showToast("Failed to open session","error")}}async handleMissionControlStartQueueItem(e){await this.handleMissionControlOpenTaskSession(e)}async handleMissionControlViewTaskFiles(e){try{const n=(await this.client?.request("queue.taskFiles",{itemId:e}))?.files??[];if(n.length===0){this.showToast("No files found for this task","info");return}const a=`## Task Files
8480
+ `,this.configRawOriginal="",this.configValid=null,this.configIssues=[],this.configSaving=!1,this.configApplying=!1,this.updateRunning=!1,this.applySessionKey=this.settings.lastActiveSessionKey,this.configSnapshot=null,this.configSchema=null,this.configSchemaVersion=null,this.configSchemaLoading=!1,this.configUiHints={},this.configForm=null,this.configFormOriginal=null,this.configFormDirty=!1,this.configFormMode="form",this.configSearchQuery="",this.configActiveSection=null,this.configActiveSubsection=null,this.channelsLoading=!1,this.channelsSnapshot=null,this.channelsError=null,this.channelsLastSuccess=null,this.whatsappLoginMessage=null,this.whatsappLoginQrDataUrl=null,this.whatsappLoginConnected=null,this.whatsappBusy=!1,this.nostrProfileFormState=null,this.nostrProfileAccountId=null,this.presenceLoading=!1,this.presenceEntries=[],this.presenceError=null,this.presenceStatus=null,this.agentsLoading=!1,this.agentsList=null,this.agentsError=null,this.sessionsLoading=!1,this.sessionsResult=null,this.sessionsError=null,this.sessionsFilterActive="",this.sessionsFilterLimit="120",this.sessionsIncludeGlobal=!0,this.sessionsIncludeUnknown=!1,this.archivedSessions=[],this.archivedSessionsLoading=!1,this.archivedSessionsExpanded=!1,this.cronLoading=!1,this.cronJobs=[],this.cronStatus=null,this.cronError=null,this.cronForm={...bb},this.cronRunsJobId=null,this.cronRuns=[],this.cronBusy=!1,this.workspaceNeedsSetup=!1,this.onboardingPhase=0,this.onboardingData=null,this.onboardingActive=!1,this.wizardActive=!1,this.wizardState=null,this.showSetupTab=!1,this.setupChecklist=null,this.setupChecklistLoading=!1,this.setupQuickDone=!1,this.onboardingIntegrations=null,this.onboardingCoreProgress=null,this.onboardingExpandedCard=null,this.onboardingLoadingGuide=null,this.onboardingActiveGuide=null,this.onboardingTestingId=null,this.onboardingTestResult=null,this.onboardingConfigValues={},this.onboardingProgress=null,this.selectedWorkspace=null,this.workspacesSearchQuery="",this.workspaceItemSearchQuery="",this.workspacesLoading=!1,this.workspacesCreateLoading=!1,this.workspacesError=null,this.workspaceExpandedFolders=new Set,this.editingTaskId=null,this.workspaceBrowsePath=null,this.workspaceBrowseEntries=null,this.workspaceBreadcrumbs=null,this.workspaceBrowseSearchQuery="",this.workspaceBrowseSearchResults=null,this.myDayLoading=!1,this.myDayError=null,this.todaySelectedDate=re(),this.todayViewMode="brief",this.dailyBriefLoading=!1,this.dailyBriefError=null,this.agentLogLoading=!1,this.agentLogError=null,this.briefNotes={},this.todayTasks=[],this.todayTasksLoading=!1,this.todayEditingTaskId=null,this.todayShowCompleted=!1,this.allyPanelOpen=!1,this.allyMessages=[],this.allyStream=null,this.allyDraft="",this.allyUnread=0,this.allySending=!1,this.allyWorking=!1,this.allyAttachments=[],this.todayQueueResults=[],this.chatPrivateMode=!1,this.privateSessions=new Map,this._privateSessionTimer=null,this.goalsLoading=!1,this.goalsError=null,this.dataLoading=!1,this.dataError=null,this.dataSubtab="dashboard",this.dynamicSlots={},this.workLoading=!1,this.workError=null,this.workExpandedProjects=new Set,this.workProjectFiles={},this.workDetailLoading=new Set,this.skillsLoading=!1,this.skillsReport=null,this.skillsError=null,this.skillsFilter="",this.skillEdits={},this.skillsBusyKey=null,this.skillMessages={},this.debugLoading=!1,this.debugStatus=null,this.debugHealth=null,this.debugModels=[],this.debugHeartbeat=null,this.debugCallMethod="",this.debugCallParams="{}",this.debugCallResult=null,this.debugCallError=null,this.logsLoading=!1,this.logsError=null,this.logsFile=null,this.logsEntries=[],this.logsFilterText="",this.logsLevelFilters={...yb},this.logsAutoFollow=!0,this.logsTruncated=!1,this.logsCursor=null,this.logsLastFetchAt=null,this.logsLimit=500,this.logsMaxBytes=25e4,this.logsAtBottom=!0,this.toasts=[],this.client=null,this.chatScrollFrame=null,this.chatScrollTimeout=null,this.chatHasAutoScrolled=!1,this.chatUserNearBottom=!0,this.chatIsAutoScrolling=!1,this.chatNewMessagesBelow=!1,this.consciousnessStatus="idle",this.focusPulseData=null,this.trustTrackerData=null,this.trustTrackerLoading=!1,this.guardrailsData=null,this.guardrailsLoading=!1,this.guardrailsShowAddForm=!1,this.missionControlData=null,this.missionControlLoading=!1,this.missionControlError=null,this.missionControlFullControl=(()=>{try{return localStorage.getItem("godmode.mc.fullControl")==="1"}catch{return!0}})(),this.missionControlPollInterval=null,this.godmodeOptions=null,this.godmodeOptionsLoading=!1,this.dashboardsLoading=!1,this.dashboardsError=null,this.activeDashboardId=null,this.activeDashboardHtml=null,this.activeDashboardManifest=null,this.dashboardPreviousSessionKey=null,this.dashboardChatOpen=!1,this.secondBrainSubtab="identity",this.secondBrainLoading=!1,this.secondBrainError=null,this.secondBrainIdentity=null,this.secondBrainMemoryBank=null,this.secondBrainAiPacket=null,this.secondBrainSourcesData=null,this.secondBrainResearchData=null,this.secondBrainResearchAddFormOpen=!1,this.secondBrainResearchAddForm={title:"",url:"",category:"",tags:"",notes:""},this.secondBrainResearchCategories=[],this.secondBrainSelectedEntry=null,this.secondBrainSearchQuery="",this.secondBrainSyncing=!1,this.secondBrainBrowsingFolder=null,this.secondBrainFolderEntries=null,this.secondBrainFolderName=null,this.secondBrainFileTree=null,this.secondBrainFileTreeLoading=!1,this.secondBrainFileSearchQuery="",this.secondBrainFileSearchResults=null,this.nodesPollInterval=null,this.logsPollInterval=null,this.debugPollInterval=null,this.agentLogPollInterval=null,this.logsScrollFrame=null,this.toolStreamById=new Map,this.toolStreamOrder=[],this.refreshSessionsAfterChat=!1,this.basePath="",this.popStateHandler=()=>bu(this),this.keydownHandler=()=>{},this.themeMedia=null,this.themeMediaHandler=null,this.topbarObserver=null}createRenderRoot(){return this}connectedCallback(){if(super.connectedCallback(),this.settings.userName)this.userName=this.settings.userName;else{const t=ws();this.userName=t.name}if(this.settings.userAvatar)this.userAvatar=this.settings.userAvatar;else{const t=ws();this.userAvatar=t.avatar}Ib(this);const e=re();this.todaySelectedDate!==e&&(this.todaySelectedDate=e),this.agentLogPollInterval==null&&(this.agentLogPollInterval=window.setInterval(()=>{!this.connected||!(this.tab==="today"||this.tab==="my-day")||this.todayViewMode!=="agent-log"||Jt(this)},6e4)),Z1(this),this._restorePrivateSessions()}firstUpdated(){Mb(this)}disconnectedCallback(){cp(),this._stopPrivateSessionTimer(),this.agentLogPollInterval!=null&&(clearInterval(this.agentLogPollInterval),this.agentLogPollInterval=null),Db(this),super.disconnectedCallback()}updated(e){Nb(this,e)}connect(){po(this)}handleChatScroll(e){gh(this,e)}handleLogsScroll(e){mh(this,e)}exportLogs(e,t){vh(e,t)}resetToolStream(){Bi(this)}resetChatScroll(){Lc(this)}async loadAssistantIdentity(){await hd(this)}applySettings(e){Je(this,e)}setTab(e){_o(this,e)}setTheme(e,t){hu(this,e,t)}async loadOverview(){await Co(this)}async loadCron(){await ca(this)}async handleAbortChat(){await Eo(this)}async handleConsciousnessFlush(){if(!(!this.client||this.consciousnessStatus==="loading")){this.consciousnessStatus="loading";try{await this.client.request("godmode.consciousness.flush",{}),this.consciousnessStatus="ok"}catch{this.consciousnessStatus="error"}setTimeout(()=>{this.consciousnessStatus!=="loading"&&(this.consciousnessStatus="idle")},3e3)}}async loadFocusPulse(){await W1()}async handleFocusPulseStartMorning(){await q1(),this.setTab("chat");const e="Let's do my morning set. Check my daily note for today's Win The Day items, then help me review priorities and pick my #1 focus to lock in.",{createNewSession:t}=await E(async()=>{const{createNewSession:n}=await Promise.resolve().then(()=>at);return{createNewSession:n}},void 0,import.meta.url);t(this),this.handleSendChat(e)}async handleFocusPulseSetFocus(e){await j1()}async handleFocusPulseComplete(){await H1()}async handleFocusPulsePulseCheck(){await V1()}async handleFocusPulseEndDay(){await G1()}async handleTrustLoad(){await Oo(this)}async handleTrustAddWorkflow(e){await Q1(this,e)}async handleTrustRemoveWorkflow(e){await Y1(this,e)}async handleDailyRate(e,t){await J1(this,e,t)}async handleGuardrailsLoad(){const{loadGuardrails:e}=await E(async()=>{const{loadGuardrails:t}=await Promise.resolve().then(()=>Qt);return{loadGuardrails:t}},void 0,import.meta.url);await e(this)}async handleGuardrailToggle(e,t){const{toggleGuardrail:n}=await E(async()=>{const{toggleGuardrail:s}=await Promise.resolve().then(()=>Qt);return{toggleGuardrail:s}},void 0,import.meta.url);await n(this,e,t)}async handleGuardrailThresholdChange(e,t,n){const{updateGuardrailThreshold:s}=await E(async()=>{const{updateGuardrailThreshold:a}=await Promise.resolve().then(()=>Qt);return{updateGuardrailThreshold:a}},void 0,import.meta.url);await s(this,e,t,n)}async handleCustomGuardrailToggle(e,t){const{toggleCustomGuardrail:n}=await E(async()=>{const{toggleCustomGuardrail:s}=await Promise.resolve().then(()=>Qt);return{toggleCustomGuardrail:s}},void 0,import.meta.url);await n(this,e,t)}async handleCustomGuardrailDelete(e){const{deleteCustomGuardrail:t}=await E(async()=>{const{deleteCustomGuardrail:n}=await Promise.resolve().then(()=>Qt);return{deleteCustomGuardrail:n}},void 0,import.meta.url);await t(this,e)}async handleCustomGuardrailAdd(e){const{addCustomGuardrailFromUI:t}=await E(async()=>{const{addCustomGuardrailFromUI:n}=await Promise.resolve().then(()=>Qt);return{addCustomGuardrailFromUI:n}},void 0,import.meta.url);await t(this,e),this.guardrailsShowAddForm=!1}handleToggleGuardrailAddForm(){this.guardrailsShowAddForm=!this.guardrailsShowAddForm}handleMissionControlToggleFullControl(){this.missionControlFullControl=!this.missionControlFullControl;try{localStorage.setItem("godmode.mc.fullControl",this.missionControlFullControl?"1":"0")}catch{}}async handleMissionControlRefresh(){const{loadMissionControl:e}=await E(async()=>{const{loadMissionControl:t}=await Promise.resolve().then(()=>Gt);return{loadMissionControl:t}},void 0,import.meta.url);await e(this)}async handleMissionControlCancelTask(e){const{cancelCodingTask:t}=await E(async()=>{const{cancelCodingTask:n}=await Promise.resolve().then(()=>Gt);return{cancelCodingTask:n}},void 0,import.meta.url);await t(this,e)}async handleMissionControlApproveItem(e){const{approveCodingTask:t,approveQueueItem:n}=await E(async()=>{const{approveCodingTask:a,approveQueueItem:i}=await Promise.resolve().then(()=>Gt);return{approveCodingTask:a,approveQueueItem:i}},void 0,import.meta.url);await t(this,e)||await n(this,e)}async handleMissionControlRetryItem(e){const{retryQueueItem:t}=await E(async()=>{const{retryQueueItem:n}=await Promise.resolve().then(()=>Gt);return{retryQueueItem:n}},void 0,import.meta.url);await t(this,e)}async handleMissionControlViewDetail(e){const{loadAgentDetail:t}=await E(async()=>{const{loadAgentDetail:s}=await Promise.resolve().then(()=>Gt);return{loadAgentDetail:s}},void 0,import.meta.url),n=await t(this,e);this.handleOpenSidebar(n.content,{mimeType:n.mimeType,title:n.title})}async handleMissionControlOpenSession(e){const t=this.settings.openTabs.includes(e)?this.settings.openTabs:[...this.settings.openTabs,e];this.applySettings({...this.settings,openTabs:t,sessionKey:e,lastActiveSessionKey:e,tabLastViewed:{...this.settings.tabLastViewed,[e]:Date.now()}}),this.sessionKey=e,this.setTab("chat"),this.chatMessages=[],this.chatStream=null,this.chatStreamStartedAt=null,this.chatRunId=null,this.resetToolStream(),this.resetChatScroll(),this.loadAssistantIdentity();const{loadChatHistory:n}=await E(async()=>{const{loadChatHistory:s}=await Promise.resolve().then(()=>Ge);return{loadChatHistory:s}},void 0,import.meta.url);await n(this)}async handleMissionControlOpenTaskSession(e){if(!(!this.client||!this.connected))try{const t=await this.client.request("tasks.openSession",{taskId:e});if(t?.sessionId){if(t.task?.title){const{autoTitleCache:n}=await E(async()=>{const{autoTitleCache:s}=await Promise.resolve().then(()=>Cn);return{autoTitleCache:s}},void 0,import.meta.url);n.set(t.sessionId,t.task.title)}await this.handleMissionControlOpenSession(t.sessionId),t.queueOutput&&this.chatMessages.length===0&&await this.seedSessionWithAgentOutput(t.task?.title??"task",t.queueOutput,t.agentPrompt??void 0)}}catch(t){console.error("[MissionControl] Failed to open task session:",t),this.showToast("Failed to open session","error")}}async handleMissionControlStartQueueItem(e){await this.handleMissionControlOpenTaskSession(e)}async handleMissionControlViewTaskFiles(e){try{const n=(await this.client?.request("queue.taskFiles",{itemId:e}))?.files??[];if(n.length===0){this.showToast("No files found for this task","info");return}const a=`## Task Files
8454
8481
 
8455
8482
  ${n.map(i=>`- **${i.name}** (${i.type}, ${(i.size/1024).toFixed(1)} KB)
8456
8483
  \`${i.path}\``).join(`
8457
8484
 
8458
8485
  `)}`;this.handleOpenSidebar(a,{title:"Task Files"})}catch(t){console.error("Failed to load task files:",t),this.showToast("Failed to load task files","error")}}handleAllyToggle(){this.allyPanelOpen=!this.allyPanelOpen,this.allyPanelOpen&&(this.allyUnread=0,this._loadAllyHistory().then(()=>this._scrollAllyToBottom()))}handleAllyDraftChange(e){this.allyDraft=e}handleAllyAttachmentsChange(e){this.allyAttachments=e}async handleAllySend(){const e=this.allyDraft.trim(),t=this.allyAttachments;if(!e&&t.length===0||this.allySending)return;const n=um(this);let s=e?`${n}
8459
8486
 
8460
- ${e}`:n;this.allyDraft="",this.allyAttachments=[],this.allySending=!0,this.allyMessages=[...this.allyMessages,{role:"user",content:e||"(image)",timestamp:Date.now()}];try{let a;if(t.length>0){const o=[];for(const l of t){if(!l.dataUrl)continue;const c=l.dataUrl.match(/^data:([^;]+);base64,(.+)$/);if(!c)continue;const[,u,p]=c;u.startsWith("image/")&&o.push({type:"image",mimeType:u,content:p,fileName:l.fileName})}if(o.length>0){a=o;try{await this.client?.request("images.cache",{images:o.map(l=>({data:l.content,mimeType:l.mimeType,fileName:l.fileName})),sessionKey:ee})}catch{}}}const i=`ally-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;await this.client?.request("chat.send",{sessionKey:ee,message:s,deliver:!1,idempotencyKey:i,attachments:a}),this.allyWorking=!0,setTimeout(()=>{this.allyWorking&&!this.allyStream&&(this.allyMessages=[...this.allyMessages,{role:"assistant",content:"*Session is busy — your message is queued and will be answered shortly.*",timestamp:Date.now()}],this.allyWorking=!1)},45e3)}catch(a){const i=a instanceof Error?a.message:String(a);console.error("[Ally] Failed to send ally message:",i),this.allyMessages=[...this.allyMessages,{role:"assistant",content:`*Send failed: ${i}*`,timestamp:Date.now()}]}finally{this.allySending=!1}}handleAllyOpenFull(){this.allyPanelOpen=!1,this.setTab("chat"),this.applySettings({...this.settings,sessionKey:ee,lastActiveSessionKey:ee,tabLastViewed:{...this.settings.tabLastViewed,[ee]:Date.now()}}),this.sessionKey=ee,this.chatMessages=[],this.chatStream=null,this.chatStreamStartedAt=null,this.chatRunId=null,this.resetToolStream(),this.resetChatScroll(),this.loadAssistantIdentity(),E(async()=>{const{loadChatHistory:e}=await Promise.resolve().then(()=>Ge);return{loadChatHistory:e}},void 0,import.meta.url).then(({loadChatHistory:e})=>e(this))}_scrollAllyToBottom(){this.updateComplete.then(()=>{requestAnimationFrame(()=>{const e=this.renderRoot?.querySelector?.(".ally-panel, .ally-inline")??document.querySelector(".ally-panel, .ally-inline");if(!e)return;const t=e.querySelector(".ally-panel__messages");t&&(t.scrollTop=t.scrollHeight)})})}async _loadAllyHistory(){try{const e=await this.client?.request("chat.history",{sessionKey:ee,limit:100});if(e?.messages){const{extractText:t,formatApiError:n}=await E(async()=>{const{extractText:s,formatApiError:a}=await Promise.resolve().then(()=>$g);return{extractText:s,formatApiError:a}},void 0,import.meta.url);this.allyMessages=e.messages.map(s=>{let a=t(s);if(!a)return null;const i=n(a);if(i&&(a=i),a=a.replace(/^\[GodMode Context:[^\]]*\]\s*/i,"").trim(),!a)return null;const o=s.role??"assistant",l=i2(a,o);return l?{role:o,content:l,timestamp:s.timestamp}:null}).filter(s=>s!==null)}}catch{}}async handleDecisionApprove(e){if(!(!this.client||!this.connected))try{await this.client.request("queue.approve",{id:e}),this.todayQueueResults=this.todayQueueResults.filter(t=>t.id!==e)}catch(t){console.error("[DecisionCard] Approve failed:",t),this.showToast("Failed to approve","error")}}async handleDecisionReject(e){if(!(!this.client||!this.connected))try{await this.client.request("queue.reject",{id:e}),this.todayQueueResults=this.todayQueueResults.filter(t=>t.id!==e)}catch(t){console.error("[DecisionCard] Reject failed:",t),this.showToast("Failed to reject","error")}}async handleDecisionViewOutput(e,t){if(!this.client||!this.connected){this.showToast("Not connected to gateway","error");return}try{const n=await this.client.request("queue.readOutput",{path:t}),s=t.split("/").pop()??"Agent Output";this.handleOpenSidebar(n.content,{mimeType:"text/markdown",filePath:t,title:s})}catch(n){console.error("[DecisionCard] View output failed:",n),this.handleOpenFile(t)}}async handleDecisionOpenChat(e){const t=this.todayQueueResults?.find(a=>a.id===e);if(!t)return;if(t.sourceTaskId){await this.handleMissionControlOpenTaskSession(t.sourceTaskId);return}const{createNewSession:n}=await E(async()=>{const{createNewSession:a}=await Promise.resolve().then(()=>at);return{createNewSession:a}},void 0,import.meta.url);n(this),this.setTab("chat");const{autoTitleCache:s}=await E(async()=>{const{autoTitleCache:a}=await Promise.resolve().then(()=>Cn);return{autoTitleCache:a}},void 0,import.meta.url);if(s.set(this.sessionKey,t.title),t.outputPath&&this.client&&this.connected)try{const a=await this.client.request("queue.readOutput",{path:t.outputPath});a?.content&&await this.seedSessionWithAgentOutput(t.title,a.content)}catch{await this.seedSessionWithAgentOutput(t.title,t.summary)}else t.summary&&await this.seedSessionWithAgentOutput(t.title,t.summary)}async handleTodayOpenChatToEdit(e){try{const t=this.todayQueueResults?.find(s=>s.id===e),n=t?.outputPath;if(n&&this.client&&this.connected)try{const s=await this.client.request("queue.readOutput",{path:n});this.handleOpenSidebar(s.content,{mimeType:"text/markdown",filePath:n,title:t?.title??n.split("/").pop()??"Agent Output"})}catch{await this.handleOpenFile(n)}this.allyPanelOpen=!0,this.allyUnread=0,this.tab!=="chat"&&this.setTab("chat")}catch(t){console.error("Open chat to edit failed:",t)}}async seedSessionWithAgentOutput(e,t,n){if(!this.client||!this.connected)return;this.handleOpenSidebar(t,{title:`Agent Output: ${e}`,filePath:null,mimeType:null});const s=t.match(/## Summary\n([\s\S]*?)(?=\n## |$)/),a=s?s[1].trim().split(`
8487
+ ${e}`:n;this.allyDraft="",this.allyAttachments=[],this.allySending=!0,this.allyMessages=[...this.allyMessages,{role:"user",content:e||"(image)",timestamp:Date.now()}];try{let a;if(t.length>0){const o=[];for(const l of t){if(!l.dataUrl)continue;const c=l.dataUrl.match(/^data:([^;]+);base64,(.+)$/);if(!c)continue;const[,u,p]=c;u.startsWith("image/")&&o.push({type:"image",mimeType:u,content:p,fileName:l.fileName})}if(o.length>0){a=o;try{await this.client?.request("images.cache",{images:o.map(l=>({data:l.content,mimeType:l.mimeType,fileName:l.fileName})),sessionKey:ee})}catch{}}}const i=`ally-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;await this.client?.request("chat.send",{sessionKey:ee,message:s,deliver:!1,idempotencyKey:i,attachments:a}),this.allyWorking=!0,setTimeout(()=>{this.allyWorking&&!this.allyStream&&(this.allyMessages=[...this.allyMessages,{role:"assistant",content:"*Session is busy — your message is queued and will be answered shortly.*",timestamp:Date.now()}],this.allyWorking=!1)},45e3)}catch(a){const i=a instanceof Error?a.message:String(a);console.error("[Ally] Failed to send ally message:",i),this.allyMessages=[...this.allyMessages,{role:"assistant",content:`*Send failed: ${i}*`,timestamp:Date.now()}]}finally{this.allySending=!1}}handleAllyOpenFull(){this.allyPanelOpen=!1,this.setTab("chat"),this.applySettings({...this.settings,sessionKey:ee,lastActiveSessionKey:ee,tabLastViewed:{...this.settings.tabLastViewed,[ee]:Date.now()}}),this.sessionKey=ee,this.chatMessages=[],this.chatStream=null,this.chatStreamStartedAt=null,this.chatRunId=null,this.resetToolStream(),this.resetChatScroll(),this.loadAssistantIdentity(),E(async()=>{const{loadChatHistory:e}=await Promise.resolve().then(()=>Ge);return{loadChatHistory:e}},void 0,import.meta.url).then(({loadChatHistory:e})=>e(this))}_scrollAllyToBottom(){this.updateComplete.then(()=>{requestAnimationFrame(()=>{const e=this.renderRoot?.querySelector?.(".ally-panel, .ally-inline")??document.querySelector(".ally-panel, .ally-inline");if(!e)return;const t=e.querySelector(".ally-panel__messages");t&&(t.scrollTop=t.scrollHeight)})})}async _loadAllyHistory(){try{const e=await this.client?.request("chat.history",{sessionKey:ee,limit:100});if(e?.messages){const{extractText:t,formatApiError:n}=await E(async()=>{const{extractText:s,formatApiError:a}=await Promise.resolve().then(()=>$g);return{extractText:s,formatApiError:a}},void 0,import.meta.url);this.allyMessages=e.messages.map(s=>{let a=t(s);if(!a)return null;const i=n(a);if(i&&(a=i),a=a.replace(/^\[GodMode Context:[^\]]*\]\s*/i,"").trim(),!a)return null;const o=s.role??"assistant",l=r2(a,o);return l?{role:o,content:l,timestamp:s.timestamp}:null}).filter(s=>s!==null)}}catch{}}async handleDecisionApprove(e){if(!(!this.client||!this.connected))try{await this.client.request("queue.approve",{id:e}),this.todayQueueResults=this.todayQueueResults.filter(t=>t.id!==e)}catch(t){console.error("[DecisionCard] Approve failed:",t),this.showToast("Failed to approve","error")}}async handleDecisionReject(e){if(!(!this.client||!this.connected))try{await this.client.request("queue.reject",{id:e}),this.todayQueueResults=this.todayQueueResults.filter(t=>t.id!==e)}catch(t){console.error("[DecisionCard] Reject failed:",t),this.showToast("Failed to reject","error")}}async handleDecisionViewOutput(e,t){if(!this.client||!this.connected){this.showToast("Not connected to gateway","error");return}try{const n=await this.client.request("queue.readOutput",{path:t}),s=t.split("/").pop()??"Agent Output";this.handleOpenSidebar(n.content,{mimeType:"text/markdown",filePath:t,title:s})}catch(n){console.error("[DecisionCard] View output failed:",n),this.handleOpenFile(t)}}async handleDecisionOpenChat(e){const t=this.todayQueueResults?.find(a=>a.id===e);if(!t)return;if(t.sourceTaskId){await this.handleMissionControlOpenTaskSession(t.sourceTaskId);return}const{createNewSession:n}=await E(async()=>{const{createNewSession:a}=await Promise.resolve().then(()=>at);return{createNewSession:a}},void 0,import.meta.url);n(this),this.setTab("chat");const{autoTitleCache:s}=await E(async()=>{const{autoTitleCache:a}=await Promise.resolve().then(()=>Cn);return{autoTitleCache:a}},void 0,import.meta.url);if(s.set(this.sessionKey,t.title),t.outputPath&&this.client&&this.connected)try{const a=await this.client.request("queue.readOutput",{path:t.outputPath});a?.content&&await this.seedSessionWithAgentOutput(t.title,a.content)}catch{await this.seedSessionWithAgentOutput(t.title,t.summary)}else t.summary&&await this.seedSessionWithAgentOutput(t.title,t.summary)}async handleTodayOpenChatToEdit(e){try{const t=this.todayQueueResults?.find(s=>s.id===e),n=t?.outputPath;if(n&&this.client&&this.connected)try{const s=await this.client.request("queue.readOutput",{path:n});this.handleOpenSidebar(s.content,{mimeType:"text/markdown",filePath:n,title:t?.title??n.split("/").pop()??"Agent Output"})}catch{await this.handleOpenFile(n)}this.allyPanelOpen=!0,this.allyUnread=0,this.tab!=="chat"&&this.setTab("chat")}catch(t){console.error("Open chat to edit failed:",t)}}async seedSessionWithAgentOutput(e,t,n){if(!this.client||!this.connected)return;this.handleOpenSidebar(t,{title:`Agent Output: ${e}`,filePath:null,mimeType:null});const s=t.match(/## Summary\n([\s\S]*?)(?=\n## |$)/),a=s?s[1].trim().split(`
8461
8488
  `).slice(0,3).join(`
8462
8489
  `):"Output available in sidebar.",i=[`Agent completed **${e}**.`,"",a,"","Full output is in the sidebar. What would you like to do?"].join(`
8463
- `);try{const{sendChatMessage:o}=await E(async()=>{const{sendChatMessage:l}=await Promise.resolve().then(()=>Ge);return{sendChatMessage:l}},void 0,import.meta.url);await o(this,i)}catch(o){console.error("[Session] Failed to seed session with agent output:",o)}}async handleMissionControlAddToQueue(e,t){if(!(!this.client||!this.connected))try{await this.client.request("queue.add",{type:e,title:t,priority:"normal"}),this.showToast("Added to queue","success",2e3);const{loadMissionControl:n}=await E(async()=>{const{loadMissionControl:s}=await Promise.resolve().then(()=>Gt);return{loadMissionControl:s}},void 0,import.meta.url);await n(this)}catch{this.showToast("Failed to add to queue","error")}}async handleDashboardsRefresh(){const{loadDashboards:e}=await E(async()=>{const{loadDashboards:t}=await import("./dashboards-BWn_hwxU.js");return{loadDashboards:t}},[],import.meta.url);await e(this)}async handleDashboardSelect(e){const{loadDashboard:t}=await E(async()=>{const{loadDashboard:n}=await import("./dashboards-BWn_hwxU.js");return{loadDashboard:n}},[],import.meta.url);if(await t(this,e),this.client&&this.connected)try{const n=await this.client.request("dashboards.openSession",{dashboardId:e});if(n?.sessionId){this.dashboardPreviousSessionKey=this.sessionKey;const s=n.sessionId,{autoTitleCache:a}=await E(async()=>{const{autoTitleCache:l}=await Promise.resolve().then(()=>Cn);return{autoTitleCache:l}},void 0,import.meta.url);a.set(s,n.manifest.title),this.activeDashboardManifest&&(this.activeDashboardManifest={...this.activeDashboardManifest,sessionId:s});const{saveDraft:i}=await E(async()=>{const{saveDraft:l}=await Promise.resolve().then(()=>ja);return{saveDraft:l}},void 0,import.meta.url);i(this),this.sessionKey=s,this.chatMessages=[],this.chatStream=null,this.chatStreamStartedAt=null,this.chatRunId=null,this.resetToolStream();const{loadChatHistory:o}=await E(async()=>{const{loadChatHistory:l}=await Promise.resolve().then(()=>Ge);return{loadChatHistory:l}},void 0,import.meta.url);await o(this),this.dashboardChatOpen=!0}}catch(n){console.error("[Dashboards] Failed to init session on select:",n)}}async handleDashboardDelete(e){const{deleteDashboard:t}=await E(async()=>{const{deleteDashboard:n}=await import("./dashboards-BWn_hwxU.js");return{deleteDashboard:n}},[],import.meta.url);await t(this,e)}async handleDashboardCreateViaChat(){this.setTab("chat");const{createNewSession:e}=await E(async()=>{const{createNewSession:t}=await Promise.resolve().then(()=>at);return{createNewSession:t}},void 0,import.meta.url);e(this),this.handleSendChat("I want to create a custom dashboard. Ask me what data I want to see and design it for me. You can use any of GodMode's data — tasks, calendar, focus pulse, goals, trust scores, agent activity, queue status, coding tasks, workspace stats, and more.")}handleDashboardBack(){if(this.activeDashboardId=null,this.activeDashboardHtml=null,this.activeDashboardManifest=null,this.dashboardChatOpen=!1,this.dashboardPreviousSessionKey){const e=this.dashboardPreviousSessionKey;this.dashboardPreviousSessionKey=null,E(async()=>{const{saveDraft:t}=await Promise.resolve().then(()=>ja);return{saveDraft:t}},void 0,import.meta.url).then(({saveDraft:t})=>{t(this),this.sessionKey=e,E(async()=>{const{loadChatHistory:n}=await Promise.resolve().then(()=>Ge);return{loadChatHistory:n}},void 0,import.meta.url).then(({loadChatHistory:n})=>{n(this)})})}}async handleDashboardOpenSession(e){const t=this.activeDashboardManifest?.sessionId;if(!t){this.showToast("No session for this dashboard","error");return}this.dashboardPreviousSessionKey=null,this.activeDashboardId=null,this.activeDashboardHtml=null,this.activeDashboardManifest=null,this.dashboardChatOpen=!1;const n=this.settings.openTabs.includes(t)?this.settings.openTabs:[...this.settings.openTabs,t];this.applySettings({...this.settings,openTabs:n,sessionKey:t,lastActiveSessionKey:t,tabLastViewed:{...this.settings.tabLastViewed,[t]:Date.now()}}),this.setTab("chat");const{syncUrlWithSessionKey:s}=await E(async()=>{const{syncUrlWithSessionKey:a}=await Promise.resolve().then(()=>hb);return{syncUrlWithSessionKey:a}},void 0,import.meta.url);s(this,t,!0)}async handleOptionsLoad(){const{loadOptions:e}=await E(async()=>{const{loadOptions:t}=await import("./options-QuHclvvX.js");return{loadOptions:t}},[],import.meta.url);await e(this)}async handleOptionToggle(e,t){const{saveOption:n}=await E(async()=>{const{saveOption:s}=await import("./options-QuHclvvX.js");return{saveOption:s}},[],import.meta.url);await n(this,e,t)}async handleSecondBrainRefresh(){const{loadSecondBrain:e}=await E(async()=>{const{loadSecondBrain:t}=await import("./second-brain-nWUdvmOD.js");return{loadSecondBrain:t}},[],import.meta.url);await e(this)}handleSecondBrainSubtabChange(e){this.secondBrainSubtab=e,this.secondBrainLoading=!1,this.secondBrainSelectedEntry=null,this.secondBrainSearchQuery="",this.secondBrainError=null,this.secondBrainBrowsingFolder=null,this.secondBrainFolderEntries=null,this.secondBrainFolderName=null,e==="intel"?this.handleIntelLoad().catch(t=>{console.error("[Intel] Load after subtab change failed:",t),this.intelError=t instanceof Error?t.message:"Failed to load intel data"}):e==="files"?this.handleSecondBrainFileTreeRefresh().catch(t=>{console.error("[SecondBrain] File tree load after subtab change failed:",t)}):this.handleSecondBrainRefresh().catch(t=>{console.error("[SecondBrain] Refresh after subtab change failed:",t),this.secondBrainError=t instanceof Error?t.message:"Failed to load data",this.secondBrainLoading=!1})}async handleSecondBrainSelectEntry(e){if(e.endsWith(".html")||e.endsWith(".htm")){try{const s=await this.client.request("secondBrain.memoryBankEntry",{path:e});s?.content&&this.handleOpenSidebar(s.content,{mimeType:"text/html",filePath:e,title:s.name||e.split("/").pop()||"File"})}catch(s){console.error("[SecondBrain] Failed to open HTML file:",s)}return}const{loadSecondBrainEntry:n}=await E(async()=>{const{loadSecondBrainEntry:s}=await import("./second-brain-nWUdvmOD.js");return{loadSecondBrainEntry:s}},[],import.meta.url);await n(this,e)}async handleSecondBrainOpenInBrowser(e){try{const t=await this.client.request("secondBrain.memoryBankEntry",{path:e});if(t?.content){const n=new Blob([t.content],{type:"text/html"}),s=URL.createObjectURL(n);window.open(s,"_blank","noopener,noreferrer")}}catch(t){console.error("[SecondBrain] Failed to open in browser:",t)}}async handleSecondBrainBrowseFolder(e){const{browseFolder:t}=await E(async()=>{const{browseFolder:n}=await import("./second-brain-nWUdvmOD.js");return{browseFolder:n}},[],import.meta.url);await t(this,e)}handleSecondBrainBack(){this.secondBrainSelectedEntry?this.secondBrainSelectedEntry=null:this.secondBrainBrowsingFolder&&(this.secondBrainBrowsingFolder=null,this.secondBrainFolderEntries=null,this.secondBrainFolderName=null)}handleSecondBrainSearch(e){this.secondBrainSearchQuery=e}async handleSecondBrainSync(){const{syncSecondBrain:e}=await E(async()=>{const{syncSecondBrain:t}=await import("./second-brain-nWUdvmOD.js");return{syncSecondBrain:t}},[],import.meta.url);await e(this)}async handleSecondBrainFileTreeRefresh(){if(!(!this.client||!this.connected)){this.secondBrainFileTreeLoading=!0;try{const e=await this.client.request("secondBrain.fileTree",{depth:4});this.secondBrainFileTree=e.tree??[]}catch(e){console.error("[SecondBrain] fileTree failed:",e)}finally{this.secondBrainFileTreeLoading=!1}}}handleSecondBrainFileSearch(e){if(this.secondBrainFileSearchQuery=e,!e.trim()){this.secondBrainFileSearchResults=null;return}this._doSecondBrainFileSearch(e)}async _doSecondBrainFileSearch(e){if(!(!this.client||!this.connected))try{const t=await this.client.request("secondBrain.search",{query:e,limit:50});this.secondBrainFileSearchQuery===e&&(this.secondBrainFileSearchResults=t.results??[])}catch(t){console.error("[SecondBrain] search failed:",t)}}async handleSecondBrainFileSelect(e){if(!(!this.client||!this.connected))try{const t=await this.client.request("secondBrain.memoryBankEntry",{path:e});if(t?.content){const n=e.endsWith(".html")||e.endsWith(".htm");this.handleOpenSidebar(t.content,{mimeType:n?"text/html":"text/markdown",filePath:e,title:t.name||e.split("/").pop()||"File"})}}catch(t){console.error("[SecondBrain] Failed to open file:",t),this.showToast("Failed to open file","error")}}handleResearchAddFormToggle(){this.secondBrainResearchAddFormOpen=!this.secondBrainResearchAddFormOpen,this.secondBrainResearchAddFormOpen&&(this.secondBrainResearchAddForm={title:"",url:"",category:"",tags:"",notes:""})}handleResearchAddFormChange(e,t){this.secondBrainResearchAddForm={...this.secondBrainResearchAddForm,[e]:t}}async handleResearchAddSubmit(){const{addResearch:e}=await E(async()=>{const{addResearch:t}=await import("./second-brain-nWUdvmOD.js");return{addResearch:t}},[],import.meta.url);await e(this)}async handleResearchSaveViaChat(){this.setTab("chat");const{createNewSession:e}=await E(async()=>{const{createNewSession:t}=await Promise.resolve().then(()=>at);return{createNewSession:t}},void 0,import.meta.url);e(this),this.handleSendChat("I want to save some research. I'll paste links, bookmarks, or notes — please organize them into ~/godmode/memory/research/ with proper frontmatter (title, url, category, tags, date). Ask me what I'd like to save.")}async handleAddSource(){this.setTab("chat");const{createNewSession:e}=await E(async()=>{const{createNewSession:t}=await Promise.resolve().then(()=>at);return{createNewSession:t}},void 0,import.meta.url);e(this),this.handleSendChat("I want to add a new data source to my Second Brain. Help me figure out what I need — whether it's an API integration, a local file sync, or a new skill. Ask me what source I'd like to connect.")}async handleCommunityResourceAdd(){const{addCommunityResource:e}=await E(async()=>{const{addCommunityResource:t}=await import("./second-brain-nWUdvmOD.js");return{addCommunityResource:t}},[],import.meta.url);await e(this)}async handleCommunityResourceRemove(e){const{removeCommunityResource:t}=await E(async()=>{const{removeCommunityResource:n}=await import("./second-brain-nWUdvmOD.js");return{removeCommunityResource:n}},[],import.meta.url);await t(this,e)}handleCommunityResourceAddFormToggle(){this.secondBrainCommunityResourceAddFormOpen=!this.secondBrainCommunityResourceAddFormOpen,this.secondBrainCommunityResourceAddFormOpen&&(this.secondBrainCommunityResourceAddForm={url:"",label:"",description:"",tags:""})}handleCommunityResourceAddFormChange(e,t){this.secondBrainCommunityResourceAddForm={...this.secondBrainCommunityResourceAddForm,[e]:t}}removeQueuedMessage(e){Su(this,e)}async handleSendChat(e,t){const n=this.sessionsResult?.sessions?.find(s=>s.key===this.sessionKey);if(n){const s=n.totalTokens??0,a=n.contextTokens??this.sessionsResult?.defaults?.contextTokens??2e5;if((a>0?s/a:0)>=.9&&!this.compactionStatus?.active){const o=(e??this.chatMessage).trim(),l=e==null?[...this.chatAttachments??[]]:[];if(o||l.length>0){this.pendingRetry={message:o,attachments:l,timestamp:Date.now()},this.autoRetryAfterCompact=!0,this.chatMessages=[...this.chatMessages,{role:"user",content:[{type:"text",text:o}],timestamp:Date.now()}],e==null&&(this.chatMessage="",this.chatAttachments=[]),this.showToast("Context near limit — auto-compacting...","info",3e3),this.handleCompactChat();return}}}await Au(this,e,t)}handleToggleSessionPicker(){this.sessionPickerOpen=!this.sessionPickerOpen}handleToggleSessionSearch(e){if(!this.sessionSearchOpen&&e){const n=e.currentTarget.getBoundingClientRect();this.sessionSearchPosition={top:n.bottom+8,right:window.innerWidth-n.right}}this.sessionSearchOpen=!this.sessionSearchOpen,this.sessionSearchOpen||(this.sessionSearchQuery="",this.sessionSearchResults=[])}async handleSessionSearchQuery(e){if(this.sessionSearchQuery=e,!e.trim()){this.sessionSearchResults=[];return}if(this.client){this.sessionSearchLoading=!0;try{const t=await this.client.request("sessions.searchContent",{query:e.trim(),limit:20});this.sessionSearchResults=t.results}catch(t){console.error("Session search failed:",t),this.sessionSearchResults=[]}finally{this.sessionSearchLoading=!1}}}handleSelectSession(e){this.sessionPickerOpen=!1,this.sessionSearchOpen=!1,this.sessionSearchQuery="",this.sessionSearchResults=[]}async handleWhatsAppStart(e){await nh(this,e)}async handleWhatsAppWait(){await sh(this)}async handleWhatsAppLogout(){await ah(this)}async handleChannelConfigSave(){await ih(this)}async handleChannelConfigReload(){await oh(this)}async handleCompactChat(){if(!this.connected){this.showToast("Cannot compact: not connected","error");return}if(!this.sessionKey){this.showToast("Cannot compact: no active session","error");return}this.compactionStatus={active:!0,startedAt:Date.now(),completedAt:null};try{await this.handleSendChat("/compact")}catch(e){this.compactionStatus=null,console.error("Compaction failed:",e),this.showToast("Compaction failed","error")}}injectCompactionSummary(e,t){const n={role:"system",content:e,timestamp:Date.now(),isCompactionSummary:!0,keptMessages:t};this.chatMessages=[n,...this.chatMessages]}async handleRetryMessage(){const e={client:this.client,connected:this.connected,sessionKey:this.sessionKey,chatLoading:this.chatLoading,chatMessages:this.chatMessages,chatThinkingLevel:this.chatThinkingLevel,chatSending:this.chatSending,chatSendingSessionKey:this.chatSendingSessionKey,chatMessage:this.chatMessage,chatAttachments:this.chatAttachments,chatRunId:this.chatRunId,chatStream:this.chatStream,chatStreamStartedAt:this.chatStreamStartedAt,lastError:this.lastError,pendingRetry:this.pendingRetry},t=await md(e);this.chatSending=e.chatSending,this.chatSendingSessionKey=e.chatSendingSessionKey,this.chatRunId=e.chatRunId,this.chatStream=e.chatStream,this.chatStreamStartedAt=e.chatStreamStartedAt,this.lastError=e.lastError,this.pendingRetry=e.pendingRetry??null,this.chatMessages=e.chatMessages,t&&this.showToast("Message resent","success",2e3)}handleClearRetry(){this.pendingRetry=null}handleNostrProfileEdit(e,t){lh(this,e,t)}handleNostrProfileCancel(){ch(this)}handleNostrProfileFieldChange(e,t){dh(this,e,t)}async handleNostrProfileSave(){await ph(this)}async handleNostrProfileImport(){await hh(this)}handleNostrProfileToggleAdvanced(){uh(this)}async handleExecApprovalDecision(e){const t=this.execApprovalQueue[0];if(!(!t||!this.client||this.execApprovalBusy)){this.execApprovalBusy=!0,this.execApprovalError=null;try{await this.client.request("exec.approval.resolve",{id:t.id,decision:e}),this.execApprovalQueue=this.execApprovalQueue.filter(n=>n.id!==t.id)}catch(n){this.execApprovalError=`Exec approval failed: ${String(n)}`}finally{this.execApprovalBusy=!1}}}handleGatewayUrlConfirm(){const e=this.pendingGatewayUrl;e&&(this.pendingGatewayUrl=null,Je(this,{...this.settings,gatewayUrl:e}),this.connect())}handleGatewayUrlCancel(){this.pendingGatewayUrl=null}handleOpenSidebar(e,t={}){this.sidebarCloseTimer!=null&&(window.clearTimeout(this.sidebarCloseTimer),this.sidebarCloseTimer=null),this.sidebarContent=e,this.sidebarError=null,this.sidebarMimeType=t.mimeType?.trim()||null,this.sidebarFilePath=t.filePath?.trim()||null,this.sidebarTitle=t.title?.trim()||null,this.sidebarOpen=!0}handleCloseSidebar(){this.sidebarOpen=!1,this.showDrivePicker=!1,this.sidebarCloseTimer!=null&&window.clearTimeout(this.sidebarCloseTimer),this.sidebarCloseTimer=window.setTimeout(()=>{this.sidebarOpen||(this.sidebarContent=null,this.sidebarError=null,this.sidebarMimeType=null,this.sidebarFilePath=null,this.sidebarTitle=null,this.sidebarCloseTimer=null)},200)}async handleOpenFile(e){if(!this.client||!this.connected){this.showToast("Not connected to gateway","error");return}try{const t=await this.client.request("files.read",{path:e}),n=e.split(".").pop()?.toLowerCase()??"",s=t.contentType??t.mime??(n==="md"?"text/markdown":null),a=e.split("/").pop()??e;this.handleOpenSidebar(t.content,{mimeType:s,filePath:e,title:a}),t.truncated&&this.showToast(`Opened truncated file: ${e}`,"warning")}catch(t){console.error("[Chat] Failed to open file:",t),this.showToast(`Failed to open file: ${e}`,"error")}}async handleToggleDrivePicker(){if(this.showDrivePicker){this.showDrivePicker=!1;return}if(this.driveAccounts.length===0)try{const e=await this.client?.request("files.listDriveAccounts",{});this.driveAccounts=e?.accounts??[]}catch{this.driveAccounts=[]}this.showDrivePicker=!0}async handlePushToDrive(e,t){if(!this.driveUploading){if(this.showDrivePicker=!1,this._pendingBatchPaths&&this._pendingBatchPaths.length>0){const n=this._pendingBatchPaths;this._pendingBatchPaths=void 0,await this._executeBatchDrive(n,t);return}this.driveUploading=!0;try{const n={filePath:e};t&&(n.account=t);const s=await this.client?.request("files.pushToDrive",n),a=t?` to ${t.split("@")[0]}`:"",i=s?.message??`Uploaded${a} to Google Drive`,o=s?.driveUrl;this.showToast(i,"success",o?8e3:5e3,o?{label:"View in Drive",url:o}:void 0)}catch(n){console.error("Push to Drive failed:",n);const s=n instanceof Error?n.message:typeof n=="object"&&n!==null&&"message"in n?String(n.message):"Unknown error";s.includes("GOG_NOT_FOUND")||s.includes("gog CLI not found")?this.showToast("Google Drive not configured. Install gog CLI: npm install -g gog-cli, then run: gog auth add <email> --services drive","warning",1e4):s.includes("GOG_AUTH")||s.includes("auth")&&s.includes("expired")?this.showToast("Google Drive auth expired. Re-authenticate: gog auth add <email> --services drive","warning",8e3):this.showToast(`Drive upload failed: ${s}`,"error",8e3)}finally{this.driveUploading=!1}}}async handleBatchPushToDrive(e){if(this.driveUploading||e.length===0)return;if(!this.driveAccounts||this.driveAccounts.length===0)try{const n=await this.client?.request("files.listDriveAccounts");this.driveAccounts=n?.accounts??[]}catch{}if(this.driveAccounts&&this.driveAccounts.length>1){this._pendingBatchPaths=e,this.showDrivePicker=!0;return}const t=this.driveAccounts?.[0]?.email;await this._executeBatchDrive(e,t)}async _executeBatchDrive(e,t){this.driveUploading=!0,this.showToast(`Uploading ${e.length} files to Drive...`,"info",0);try{const n={filePaths:e};t&&(n.account=t);const s=await this.client?.request("files.batchPushToDrive",n);this.dismissAllToasts();const a=s?.results?.filter(o=>o.success).length??0,i=s?.results?.length??e.length;a===i?this.showToast(`Uploaded ${a} files to Google Drive`,"success",5e3):this.showToast(`Uploaded ${a}/${i} files (${i-a} failed)`,"warning",8e3)}catch(n){this.dismissAllToasts();const s=n instanceof Error?n.message:"Unknown error";this.showToast(`Batch Drive upload failed: ${s}`,"error",8e3)}finally{this.driveUploading=!1,this._pendingBatchPaths=void 0}}handleSplitRatioChange(e){const t=Math.max(.4,Math.min(.7,e));this.splitRatio=t,this.applySettings({...this.settings,splitRatio:t})}handleImageClick(e,t,n){this.lightbox=S0(e,t,n)}handleLightboxClose(){this.lightbox=A0()}handleLightboxNav(e){this.lightbox=_0(this.lightbox,e)}normalizeWorkspacePathCandidate(e,t={}){let n=e.trim();if(!n||n.startsWith("#"))return null;for(;n.startsWith("./");)n=n.slice(2);if(n=n.replaceAll("\\","/"),!t.allowAbsolute)for(;n.startsWith("/");)n=n.slice(1);return!n||n.includes("\0")?null:n}isAbsoluteFilesystemPath(e){return e.startsWith("/")||e.startsWith("~/")||/^[a-z]:[\\/]/i.test(e)}inferMimeTypeFromPath(e){if(!e)return null;const t=e.trim().toLowerCase();if(!t)return null;const n=t.split(".").pop()??"";return n?n==="md"||n==="markdown"||n==="mdx"?"text/markdown":n==="html"||n==="htm"?"text/html":n==="json"||n==="json5"?"application/json":n==="txt"||n==="text"||n==="log"?"text/plain":n==="svg"||n==="svgz"?"image/svg+xml":n==="avif"||n==="bmp"||n==="gif"||n==="heic"||n==="heif"||n==="jpeg"||n==="jpg"||n==="png"||n==="webp"?`image/${n==="jpg"?"jpeg":n}`:null:null}sidebarTitleForPath(e){const t=e.replaceAll("\\","/").trim();if(!t)return"Document";const n=t.split("/");return n[n.length-1]||t}async listWorkspaceIdsForPathResolution(){const e=[],t=new Set,n=s=>{if(typeof s!="string")return;const a=s.trim();!a||t.has(a)||(t.add(a),e.push(a))};n(this.selectedWorkspace?.id);for(const s of this.workspaces??[])n(s.id);if(e.length>0||!this.client||!this.connected)return e;try{const s=await this.client.request("workspaces.list",{});for(const a of s.workspaces??[])n(a.id)}catch{}return e}async openWorkspaceRelativeFileInViewer(e){if(!this.client||!this.connected)return!1;const t=await this.listWorkspaceIdsForPathResolution();for(const n of t)try{const s=await this.client.request("workspaces.readFile",{workspaceId:n,filePath:e});if(typeof s.content!="string")continue;return this.handleOpenSidebar(s.content,{mimeType:s.contentType??s.mime??this.inferMimeTypeFromPath(e),filePath:s.path??e,title:this.sidebarTitleForPath(e)}),!0}catch{}return!1}extractWorkspacePathCandidatesFromHref(e){const t=e.trim();if(!t)return[];const n=[],s=t.toLowerCase();if(s.startsWith("mailto:")||s.startsWith("tel:")||s.startsWith("javascript:")||s.startsWith("data:"))return[];if(t.startsWith("file://")){let u=t.slice(7);u.startsWith("/~/")&&(u="~"+u.slice(2));try{u=decodeURIComponent(u)}catch{}n.push(u);const p=[],f=new Set;for(const m of n){const g=this.normalizeWorkspacePathCandidate(m,{allowAbsolute:!0});!g||f.has(g)||(f.add(g),p.push(g))}return p}const a=/^[a-z][a-z0-9+.-]*:/i.test(t),i=/^[a-z]:[\\/]/i.test(t);(!a||i)&&n.push(t);let o=null;try{o=new URL(t,window.location.href)}catch{o=null}if(o&&/^https?:$/.test(o.protocol)&&o.origin===window.location.origin){for(const $ of o2){const d=o.searchParams.get($);d&&n.push(d)}const p=(t.split("#")[0]??"").split("?")[0]??"";p.length>0&&!p.startsWith("/")&&!p.includes("://")&&n.push(p);let m=o.pathname;this.basePath&&m.startsWith(`${this.basePath}/`)?m=m.slice(this.basePath.length):this.basePath&&m===this.basePath&&(m="");const g=m.startsWith("/")?m.slice(1):m;if(g){n.push(g);const $=g.indexOf("/");if($>0){const d=g.slice(0,$).toLowerCase();gc.has(d)&&n.push(g.slice($+1))}}if(m.startsWith("/")&&g){const $=g.split("/")[0]?.toLowerCase()??"";gc.has($)||n.push(m)}}const l=[],c=new Set;for(const u of n){let p=u;try{p=decodeURIComponent(u)}catch{}const f=this.normalizeWorkspacePathCandidate(p,{allowAbsolute:!0});!f||c.has(f)||(c.add(f),l.push(f))}return l}async openWorkspaceFileInViewer(e){if(!this.client||!this.connected)return!1;const t=this.isAbsoluteFilesystemPath(e);if(!t&&await this.openWorkspaceRelativeFileInViewer(e))return!0;try{const n=await this.client.request("workspaces.readFile",{path:e});if(typeof n.content=="string")return this.handleOpenSidebar(n.content,{mimeType:n.contentType??n.mime??this.inferMimeTypeFromPath(e),filePath:n.path??e,title:this.sidebarTitleForPath(e)}),!0}catch{}if(!t)return!1;try{const n=await this.client.request("files.read",{path:e,maxSize:1e6});return typeof n.content!="string"?!1:(this.handleOpenSidebar(n.content,{mimeType:this.inferMimeTypeFromPath(e),filePath:e,title:this.sidebarTitleForPath(e)}),!0)}catch{return!1}}async handleOpenMessageFileLink(e){const t=this.extractWorkspacePathCandidatesFromHref(e);if(t.length===0)return!1;for(const n of t)if(await this.openWorkspaceFileInViewer(n))return!0;return!1}showToast(e,t="info",n=5e3,s){const a=Z1(e,t,n,s);this.toasts=t2(this.toasts,a),n>0&&window.setTimeout(()=>{this.dismissToast(a.id)},n)}dismissToast(e){this.toasts=e2(this.toasts,e)}dismissAllToasts(){this.toasts=[]}async handleMyDayRefresh(){if(this.todayViewMode==="agent-log"){await Jt(this,{refresh:!0});return}await Ks(this),this._loadDecisionCards()}_loadDecisionCards(){E(()=>Promise.resolve().then(()=>In),void 0,import.meta.url).then(async e=>{this.todayQueueResults=await e.loadTodayQueueResults(this)}).catch(()=>{})}async handleMyDayTaskStatusChange(e,t){if(!(!this.client||!this.connected))try{await this.client.request("tasks.update",{id:e,status:t,completedAt:t==="complete"?new Date().toISOString():null});const{loadTodayTasksWithQueueStatus:n}=await E(async()=>{const{loadTodayTasksWithQueueStatus:s}=await Promise.resolve().then(()=>In);return{loadTodayTasksWithQueueStatus:s}},void 0,import.meta.url);await n(this)}catch(n){console.error("[MyDay] Failed to update task status:",n)}}async handleTodayCreateTask(e){if(!(!this.client||!this.connected))try{await this.client.request("tasks.create",{title:e,dueDate:re(),priority:"medium",source:"chat"});const{loadTodayTasksWithQueueStatus:t}=await E(async()=>{const{loadTodayTasksWithQueueStatus:n}=await Promise.resolve().then(()=>In);return{loadTodayTasksWithQueueStatus:n}},void 0,import.meta.url);await t(this)}catch(t){console.error("[MyDay] Failed to create task:",t),this.showToast("Failed to create task","error")}}handleTodayEditTask(e){this.todayEditingTaskId=e}async handleTodayUpdateTask(e,t){if(!(!this.client||!this.connected))try{await this.client.request("tasks.update",{id:e,...t}),this.todayEditingTaskId=null;const{loadTodayTasksWithQueueStatus:n}=await E(async()=>{const{loadTodayTasksWithQueueStatus:s}=await Promise.resolve().then(()=>In);return{loadTodayTasksWithQueueStatus:s}},void 0,import.meta.url);await n(this)}catch(n){console.error("[MyDay] Failed to update task:",n),this.showToast("Failed to update task","error")}}handleTodayToggleCompleted(){this.todayShowCompleted=!this.todayShowCompleted}async handleTodayStartTask(e){if(!(!this.client||!this.connected))try{const t=await this.client.request("tasks.openSession",{taskId:e}),n=t?.sessionId??t?.sessionKey;if(n){if(t.task?.title){const{autoTitleCache:i}=await E(async()=>{const{autoTitleCache:o}=await Promise.resolve().then(()=>Cn);return{autoTitleCache:o}},void 0,import.meta.url);i.set(n,t.task.title)}this.setTab("chat"),this.sessionKey=n;const s=this.settings.openTabs.includes(n)?this.settings.openTabs:[...this.settings.openTabs,n];this.applySettings({...this.settings,sessionKey:n,lastActiveSessionKey:n,openTabs:s}),this.chatMessages=[],this.chatStream=null,this.chatStreamStartedAt=null,this.chatRunId=null,this.resetToolStream(),this.resetChatScroll(),this.loadAssistantIdentity();const{loadChatHistory:a}=await E(async()=>{const{loadChatHistory:i}=await Promise.resolve().then(()=>Ge);return{loadChatHistory:i}},void 0,import.meta.url);await a(this),t.queueOutput&&this.chatMessages.length===0&&this.seedSessionWithAgentOutput(t.task?.title??"this task",t.queueOutput,t.agentPrompt??void 0),this.requestUpdate()}}catch(t){console.error("[MyDay] Failed to open session for task:",t),this.showToast("Failed to open session for task","error")}}handleDatePrev(){const e=new Date(this.todaySelectedDate+"T12:00:00");if(e.setDate(e.getDate()-1),this.todaySelectedDate=re(e),this.todayViewMode==="agent-log"){Jt(this);return}xs(this)}handleDateNext(){const e=new Date(this.todaySelectedDate+"T12:00:00");e.setDate(e.getDate()+1);const t=re(),n=re(e);if(!(n>t)){if(this.todaySelectedDate=n,this.todayViewMode==="agent-log"){Jt(this);return}xs(this)}}handleDateToday(){this.todaySelectedDate=re(),Ks(this)}async handleDailyBriefRefresh(){await xs(this)}handleDailyBriefOpenInObsidian(){const e=this.dailyBrief?.date;ou(e)}async loadBriefNotes(){if(!this.client||!this.connected)return;const e=this.todaySelectedDate;try{const t=await this.client.request("briefNotes.get",{date:e});this.briefNotes=t.notes??{}}catch(t){console.error("[BriefNotes] Load error:",t),this.briefNotes={}}}async handleBriefNoteSave(e,t){if(!this.client||!this.connected)return;const n=this.todaySelectedDate;try{const s=await this.client.request("briefNotes.update",{date:n,section:e,text:t});this.briefNotes=s.notes??{}}catch(s){console.error("[BriefNotes] Save error:",s),this.showToast("Failed to save note","error")}}handleTodayViewModeChange(e){this.todayViewMode=e,e==="agent-log"&&!this.agentLog&&Jt(this)}handlePrivateModeToggle(){if(this.chatPrivateMode){const e=this.sessionKey;this.chatPrivateMode=!1,this._destroyPrivateSession(e),this.showToast("Private session destroyed","info",2e3);return}this.chatPrivateMode=!0,this.setTab("chat"),E(async()=>{const{createNewSession:e}=await Promise.resolve().then(()=>at);return{createNewSession:e}},void 0,import.meta.url).then(({createNewSession:e})=>{e(this);const t=Date.now()+1440*60*1e3;this.privateSessions=new Map(this.privateSessions).set(this.sessionKey,t),this._persistPrivateSessions(),this._startPrivateSessionTimer(),this.chatMessages=[{role:"assistant",content:`This is a **private session**. Nothing will be saved to memory or logs.
8490
+ `);try{const{sendChatMessage:o}=await E(async()=>{const{sendChatMessage:l}=await Promise.resolve().then(()=>Ge);return{sendChatMessage:l}},void 0,import.meta.url);await o(this,i)}catch(o){console.error("[Session] Failed to seed session with agent output:",o)}}async handleMissionControlAddToQueue(e,t){if(!(!this.client||!this.connected))try{await this.client.request("queue.add",{type:e,title:t,priority:"normal"}),this.showToast("Added to queue","success",2e3);const{loadMissionControl:n}=await E(async()=>{const{loadMissionControl:s}=await Promise.resolve().then(()=>Gt);return{loadMissionControl:s}},void 0,import.meta.url);await n(this)}catch{this.showToast("Failed to add to queue","error")}}async handleDashboardsRefresh(){const{loadDashboards:e}=await E(async()=>{const{loadDashboards:t}=await import("./dashboards-BWn_hwxU.js");return{loadDashboards:t}},[],import.meta.url);await e(this)}async handleDashboardSelect(e){const{loadDashboard:t}=await E(async()=>{const{loadDashboard:n}=await import("./dashboards-BWn_hwxU.js");return{loadDashboard:n}},[],import.meta.url);if(await t(this,e),this.client&&this.connected)try{const n=await this.client.request("dashboards.openSession",{dashboardId:e});if(n?.sessionId){this.dashboardPreviousSessionKey=this.sessionKey;const s=n.sessionId,{autoTitleCache:a}=await E(async()=>{const{autoTitleCache:l}=await Promise.resolve().then(()=>Cn);return{autoTitleCache:l}},void 0,import.meta.url);a.set(s,n.manifest.title),this.activeDashboardManifest&&(this.activeDashboardManifest={...this.activeDashboardManifest,sessionId:s});const{saveDraft:i}=await E(async()=>{const{saveDraft:l}=await Promise.resolve().then(()=>ja);return{saveDraft:l}},void 0,import.meta.url);i(this),this.sessionKey=s,this.chatMessages=[],this.chatStream=null,this.chatStreamStartedAt=null,this.chatRunId=null,this.resetToolStream();const{loadChatHistory:o}=await E(async()=>{const{loadChatHistory:l}=await Promise.resolve().then(()=>Ge);return{loadChatHistory:l}},void 0,import.meta.url);await o(this),this.dashboardChatOpen=!0}}catch(n){console.error("[Dashboards] Failed to init session on select:",n)}}async handleDashboardDelete(e){const{deleteDashboard:t}=await E(async()=>{const{deleteDashboard:n}=await import("./dashboards-BWn_hwxU.js");return{deleteDashboard:n}},[],import.meta.url);await t(this,e)}async handleDashboardCreateViaChat(){this.setTab("chat");const{createNewSession:e}=await E(async()=>{const{createNewSession:t}=await Promise.resolve().then(()=>at);return{createNewSession:t}},void 0,import.meta.url);e(this),this.handleSendChat("I want to create a custom dashboard. Ask me what data I want to see and design it for me. You can use any of GodMode's data — tasks, calendar, focus pulse, goals, trust scores, agent activity, queue status, coding tasks, workspace stats, and more.")}handleDashboardBack(){if(this.activeDashboardId=null,this.activeDashboardHtml=null,this.activeDashboardManifest=null,this.dashboardChatOpen=!1,this.dashboardPreviousSessionKey){const e=this.dashboardPreviousSessionKey;this.dashboardPreviousSessionKey=null,E(async()=>{const{saveDraft:t}=await Promise.resolve().then(()=>ja);return{saveDraft:t}},void 0,import.meta.url).then(({saveDraft:t})=>{t(this),this.sessionKey=e,E(async()=>{const{loadChatHistory:n}=await Promise.resolve().then(()=>Ge);return{loadChatHistory:n}},void 0,import.meta.url).then(({loadChatHistory:n})=>{n(this)})})}}async handleDashboardOpenSession(e){const t=this.activeDashboardManifest?.sessionId;if(!t){this.showToast("No session for this dashboard","error");return}this.dashboardPreviousSessionKey=null,this.activeDashboardId=null,this.activeDashboardHtml=null,this.activeDashboardManifest=null,this.dashboardChatOpen=!1;const n=this.settings.openTabs.includes(t)?this.settings.openTabs:[...this.settings.openTabs,t];this.applySettings({...this.settings,openTabs:n,sessionKey:t,lastActiveSessionKey:t,tabLastViewed:{...this.settings.tabLastViewed,[t]:Date.now()}}),this.setTab("chat");const{syncUrlWithSessionKey:s}=await E(async()=>{const{syncUrlWithSessionKey:a}=await Promise.resolve().then(()=>hb);return{syncUrlWithSessionKey:a}},void 0,import.meta.url);s(this,t,!0)}async handleOptionsLoad(){const{loadOptions:e}=await E(async()=>{const{loadOptions:t}=await import("./options-QuHclvvX.js");return{loadOptions:t}},[],import.meta.url);await e(this)}async handleOptionToggle(e,t){const{saveOption:n}=await E(async()=>{const{saveOption:s}=await import("./options-QuHclvvX.js");return{saveOption:s}},[],import.meta.url);await n(this,e,t)}async handleSecondBrainRefresh(){const{loadSecondBrain:e}=await E(async()=>{const{loadSecondBrain:t}=await import("./second-brain-nWUdvmOD.js");return{loadSecondBrain:t}},[],import.meta.url);await e(this)}handleSecondBrainSubtabChange(e){this.secondBrainSubtab=e,this.secondBrainLoading=!1,this.secondBrainSelectedEntry=null,this.secondBrainSearchQuery="",this.secondBrainError=null,this.secondBrainBrowsingFolder=null,this.secondBrainFolderEntries=null,this.secondBrainFolderName=null,e==="intel"?this.handleIntelLoad().catch(t=>{console.error("[Intel] Load after subtab change failed:",t),this.intelError=t instanceof Error?t.message:"Failed to load intel data"}):e==="files"?this.handleSecondBrainFileTreeRefresh().catch(t=>{console.error("[SecondBrain] File tree load after subtab change failed:",t)}):this.handleSecondBrainRefresh().catch(t=>{console.error("[SecondBrain] Refresh after subtab change failed:",t),this.secondBrainError=t instanceof Error?t.message:"Failed to load data",this.secondBrainLoading=!1})}async handleSecondBrainSelectEntry(e){if(e.endsWith(".html")||e.endsWith(".htm")){try{const s=await this.client.request("secondBrain.memoryBankEntry",{path:e});s?.content&&this.handleOpenSidebar(s.content,{mimeType:"text/html",filePath:e,title:s.name||e.split("/").pop()||"File"})}catch(s){console.error("[SecondBrain] Failed to open HTML file:",s)}return}const{loadSecondBrainEntry:n}=await E(async()=>{const{loadSecondBrainEntry:s}=await import("./second-brain-nWUdvmOD.js");return{loadSecondBrainEntry:s}},[],import.meta.url);await n(this,e)}async handleSecondBrainOpenInBrowser(e){try{const t=await this.client.request("secondBrain.memoryBankEntry",{path:e});if(t?.content){const n=new Blob([t.content],{type:"text/html"}),s=URL.createObjectURL(n);window.open(s,"_blank","noopener,noreferrer")}}catch(t){console.error("[SecondBrain] Failed to open in browser:",t)}}async handleSecondBrainBrowseFolder(e){const{browseFolder:t}=await E(async()=>{const{browseFolder:n}=await import("./second-brain-nWUdvmOD.js");return{browseFolder:n}},[],import.meta.url);await t(this,e)}handleSecondBrainBack(){this.secondBrainSelectedEntry?this.secondBrainSelectedEntry=null:this.secondBrainBrowsingFolder&&(this.secondBrainBrowsingFolder=null,this.secondBrainFolderEntries=null,this.secondBrainFolderName=null)}handleSecondBrainSearch(e){this.secondBrainSearchQuery=e}async handleSecondBrainSync(){const{syncSecondBrain:e}=await E(async()=>{const{syncSecondBrain:t}=await import("./second-brain-nWUdvmOD.js");return{syncSecondBrain:t}},[],import.meta.url);await e(this)}async handleSecondBrainFileTreeRefresh(){if(!(!this.client||!this.connected)){this.secondBrainFileTreeLoading=!0;try{const e=await this.client.request("secondBrain.fileTree",{depth:4});this.secondBrainFileTree=e.tree??[]}catch(e){console.error("[SecondBrain] fileTree failed:",e)}finally{this.secondBrainFileTreeLoading=!1}}}handleSecondBrainFileSearch(e){if(this.secondBrainFileSearchQuery=e,!e.trim()){this.secondBrainFileSearchResults=null;return}this._doSecondBrainFileSearch(e)}async _doSecondBrainFileSearch(e){if(!(!this.client||!this.connected))try{const t=await this.client.request("secondBrain.search",{query:e,limit:50});this.secondBrainFileSearchQuery===e&&(this.secondBrainFileSearchResults=t.results??[])}catch(t){console.error("[SecondBrain] search failed:",t)}}async handleSecondBrainFileSelect(e){if(!(!this.client||!this.connected))try{const t=await this.client.request("secondBrain.memoryBankEntry",{path:e});if(t?.content){const n=e.endsWith(".html")||e.endsWith(".htm");this.handleOpenSidebar(t.content,{mimeType:n?"text/html":"text/markdown",filePath:e,title:t.name||e.split("/").pop()||"File"})}}catch(t){console.error("[SecondBrain] Failed to open file:",t),this.showToast("Failed to open file","error")}}handleResearchAddFormToggle(){this.secondBrainResearchAddFormOpen=!this.secondBrainResearchAddFormOpen,this.secondBrainResearchAddFormOpen&&(this.secondBrainResearchAddForm={title:"",url:"",category:"",tags:"",notes:""})}handleResearchAddFormChange(e,t){this.secondBrainResearchAddForm={...this.secondBrainResearchAddForm,[e]:t}}async handleResearchAddSubmit(){const{addResearch:e}=await E(async()=>{const{addResearch:t}=await import("./second-brain-nWUdvmOD.js");return{addResearch:t}},[],import.meta.url);await e(this)}async handleResearchSaveViaChat(){this.setTab("chat");const{createNewSession:e}=await E(async()=>{const{createNewSession:t}=await Promise.resolve().then(()=>at);return{createNewSession:t}},void 0,import.meta.url);e(this),this.handleSendChat("I want to save some research. I'll paste links, bookmarks, or notes — please organize them into ~/godmode/memory/research/ with proper frontmatter (title, url, category, tags, date). Ask me what I'd like to save.")}async handleAddSource(){this.setTab("chat");const{createNewSession:e}=await E(async()=>{const{createNewSession:t}=await Promise.resolve().then(()=>at);return{createNewSession:t}},void 0,import.meta.url);e(this),this.handleSendChat("I want to add a new data source to my Second Brain. Help me figure out what I need — whether it's an API integration, a local file sync, or a new skill. Ask me what source I'd like to connect.")}async handleCommunityResourceAdd(){const{addCommunityResource:e}=await E(async()=>{const{addCommunityResource:t}=await import("./second-brain-nWUdvmOD.js");return{addCommunityResource:t}},[],import.meta.url);await e(this)}async handleCommunityResourceRemove(e){const{removeCommunityResource:t}=await E(async()=>{const{removeCommunityResource:n}=await import("./second-brain-nWUdvmOD.js");return{removeCommunityResource:n}},[],import.meta.url);await t(this,e)}handleCommunityResourceAddFormToggle(){this.secondBrainCommunityResourceAddFormOpen=!this.secondBrainCommunityResourceAddFormOpen,this.secondBrainCommunityResourceAddFormOpen&&(this.secondBrainCommunityResourceAddForm={url:"",label:"",description:"",tags:""})}handleCommunityResourceAddFormChange(e,t){this.secondBrainCommunityResourceAddForm={...this.secondBrainCommunityResourceAddForm,[e]:t}}removeQueuedMessage(e){Su(this,e)}async handleSendChat(e,t){const n=this.sessionsResult?.sessions?.find(s=>s.key===this.sessionKey);if(n){const s=n.totalTokens??0,a=n.contextTokens??this.sessionsResult?.defaults?.contextTokens??2e5;if((a>0?s/a:0)>=.9&&!this.compactionStatus?.active){const o=(e??this.chatMessage).trim(),l=e==null?[...this.chatAttachments??[]]:[];if(o||l.length>0){this.pendingRetry={message:o,attachments:l,timestamp:Date.now()},this.autoRetryAfterCompact=!0,this.chatMessages=[...this.chatMessages,{role:"user",content:[{type:"text",text:o}],timestamp:Date.now()}],e==null&&(this.chatMessage="",this.chatAttachments=[]),this.showToast("Context near limit — auto-compacting...","info",3e3),this.handleCompactChat();return}}}await Au(this,e,t)}handleToggleSessionPicker(){this.sessionPickerOpen=!this.sessionPickerOpen}handleToggleSessionSearch(e){if(!this.sessionSearchOpen&&e){const n=e.currentTarget.getBoundingClientRect();this.sessionSearchPosition={top:n.bottom+8,right:window.innerWidth-n.right}}this.sessionSearchOpen=!this.sessionSearchOpen,this.sessionSearchOpen||(this.sessionSearchQuery="",this.sessionSearchResults=[])}async handleSessionSearchQuery(e){if(this.sessionSearchQuery=e,!e.trim()){this.sessionSearchResults=[];return}if(this.client){this.sessionSearchLoading=!0;try{const t=await this.client.request("sessions.searchContent",{query:e.trim(),limit:20});this.sessionSearchResults=t.results}catch(t){console.error("Session search failed:",t),this.sessionSearchResults=[]}finally{this.sessionSearchLoading=!1}}}handleSelectSession(e){this.sessionPickerOpen=!1,this.sessionSearchOpen=!1,this.sessionSearchQuery="",this.sessionSearchResults=[]}async handleWhatsAppStart(e){await nh(this,e)}async handleWhatsAppWait(){await sh(this)}async handleWhatsAppLogout(){await ah(this)}async handleChannelConfigSave(){await ih(this)}async handleChannelConfigReload(){await oh(this)}async handleCompactChat(){if(!this.connected){this.showToast("Cannot compact: not connected","error");return}if(!this.sessionKey){this.showToast("Cannot compact: no active session","error");return}this.compactionStatus={active:!0,startedAt:Date.now(),completedAt:null};try{await this.handleSendChat("/compact")}catch(e){this.compactionStatus=null,console.error("Compaction failed:",e),this.showToast("Compaction failed","error")}}injectCompactionSummary(e,t){const n={role:"system",content:e,timestamp:Date.now(),isCompactionSummary:!0,keptMessages:t};this.chatMessages=[n,...this.chatMessages]}async handleRetryMessage(){const e={client:this.client,connected:this.connected,sessionKey:this.sessionKey,chatLoading:this.chatLoading,chatMessages:this.chatMessages,chatThinkingLevel:this.chatThinkingLevel,chatSending:this.chatSending,chatSendingSessionKey:this.chatSendingSessionKey,chatMessage:this.chatMessage,chatAttachments:this.chatAttachments,chatRunId:this.chatRunId,chatStream:this.chatStream,chatStreamStartedAt:this.chatStreamStartedAt,lastError:this.lastError,pendingRetry:this.pendingRetry},t=await md(e);this.chatSending=e.chatSending,this.chatSendingSessionKey=e.chatSendingSessionKey,this.chatRunId=e.chatRunId,this.chatStream=e.chatStream,this.chatStreamStartedAt=e.chatStreamStartedAt,this.lastError=e.lastError,this.pendingRetry=e.pendingRetry??null,this.chatMessages=e.chatMessages,t&&this.showToast("Message resent","success",2e3)}handleClearRetry(){this.pendingRetry=null}handleNostrProfileEdit(e,t){lh(this,e,t)}handleNostrProfileCancel(){ch(this)}handleNostrProfileFieldChange(e,t){dh(this,e,t)}async handleNostrProfileSave(){await ph(this)}async handleNostrProfileImport(){await hh(this)}handleNostrProfileToggleAdvanced(){uh(this)}async handleExecApprovalDecision(e){const t=this.execApprovalQueue[0];if(!(!t||!this.client||this.execApprovalBusy)){this.execApprovalBusy=!0,this.execApprovalError=null;try{await this.client.request("exec.approval.resolve",{id:t.id,decision:e}),this.execApprovalQueue=this.execApprovalQueue.filter(n=>n.id!==t.id)}catch(n){this.execApprovalError=`Exec approval failed: ${String(n)}`}finally{this.execApprovalBusy=!1}}}handleGatewayUrlConfirm(){const e=this.pendingGatewayUrl;e&&(this.pendingGatewayUrl=null,Je(this,{...this.settings,gatewayUrl:e}),this.connect())}handleGatewayUrlCancel(){this.pendingGatewayUrl=null}handleOpenSidebar(e,t={}){this.sidebarCloseTimer!=null&&(window.clearTimeout(this.sidebarCloseTimer),this.sidebarCloseTimer=null),this.sidebarContent=e,this.sidebarError=null,this.sidebarMimeType=t.mimeType?.trim()||null,this.sidebarFilePath=t.filePath?.trim()||null,this.sidebarTitle=t.title?.trim()||null,this.sidebarOpen=!0}handleCloseSidebar(){this.sidebarOpen=!1,this.showDrivePicker=!1,this.sidebarCloseTimer!=null&&window.clearTimeout(this.sidebarCloseTimer),this.sidebarCloseTimer=window.setTimeout(()=>{this.sidebarOpen||(this.sidebarContent=null,this.sidebarError=null,this.sidebarMimeType=null,this.sidebarFilePath=null,this.sidebarTitle=null,this.sidebarCloseTimer=null)},200)}async handleOpenFile(e){if(!this.client||!this.connected){this.showToast("Not connected to gateway","error");return}try{const t=await this.client.request("files.read",{path:e}),n=e.split(".").pop()?.toLowerCase()??"",s=t.contentType??t.mime??(n==="md"?"text/markdown":null),a=e.split("/").pop()??e;this.handleOpenSidebar(t.content,{mimeType:s,filePath:e,title:a}),t.truncated&&this.showToast(`Opened truncated file: ${e}`,"warning")}catch(t){console.error("[Chat] Failed to open file:",t),this.showToast(`Failed to open file: ${e}`,"error")}}async handleToggleDrivePicker(){if(this.showDrivePicker){this.showDrivePicker=!1;return}if(this.driveAccounts.length===0)try{const e=await this.client?.request("files.listDriveAccounts",{});this.driveAccounts=e?.accounts??[]}catch{this.driveAccounts=[]}this.showDrivePicker=!0}async handlePushToDrive(e,t){if(!this.driveUploading){if(this.showDrivePicker=!1,this._pendingBatchPaths&&this._pendingBatchPaths.length>0){const n=this._pendingBatchPaths;this._pendingBatchPaths=void 0,await this._executeBatchDrive(n,t);return}this.driveUploading=!0;try{const n={filePath:e};t&&(n.account=t);const s=await this.client?.request("files.pushToDrive",n),a=t?` to ${t.split("@")[0]}`:"",i=s?.message??`Uploaded${a} to Google Drive`,o=s?.driveUrl;this.showToast(i,"success",o?8e3:5e3,o?{label:"View in Drive",url:o}:void 0)}catch(n){console.error("Push to Drive failed:",n);const s=n instanceof Error?n.message:typeof n=="object"&&n!==null&&"message"in n?String(n.message):"Unknown error";s.includes("GOG_NOT_FOUND")||s.includes("gog CLI not found")?this.showToast("Google Drive not configured. Install gog CLI: npm install -g gog-cli, then run: gog auth add <email> --services drive","warning",1e4):s.includes("GOG_AUTH")||s.includes("auth")&&s.includes("expired")?this.showToast("Google Drive auth expired. Re-authenticate: gog auth add <email> --services drive","warning",8e3):this.showToast(`Drive upload failed: ${s}`,"error",8e3)}finally{this.driveUploading=!1}}}async handleBatchPushToDrive(e){if(this.driveUploading||e.length===0)return;if(!this.driveAccounts||this.driveAccounts.length===0)try{const n=await this.client?.request("files.listDriveAccounts");this.driveAccounts=n?.accounts??[]}catch{}if(this.driveAccounts&&this.driveAccounts.length>1){this._pendingBatchPaths=e,this.showDrivePicker=!0;return}const t=this.driveAccounts?.[0]?.email;await this._executeBatchDrive(e,t)}async _executeBatchDrive(e,t){this.driveUploading=!0,this.showToast(`Uploading ${e.length} files to Drive...`,"info",0);try{const n={filePaths:e};t&&(n.account=t);const s=await this.client?.request("files.batchPushToDrive",n);this.dismissAllToasts();const a=s?.results?.filter(o=>o.success).length??0,i=s?.results?.length??e.length;a===i?this.showToast(`Uploaded ${a} files to Google Drive`,"success",5e3):this.showToast(`Uploaded ${a}/${i} files (${i-a} failed)`,"warning",8e3)}catch(n){this.dismissAllToasts();const s=n instanceof Error?n.message:"Unknown error";this.showToast(`Batch Drive upload failed: ${s}`,"error",8e3)}finally{this.driveUploading=!1,this._pendingBatchPaths=void 0}}handleSplitRatioChange(e){const t=Math.max(.4,Math.min(.7,e));this.splitRatio=t,this.applySettings({...this.settings,splitRatio:t})}handleImageClick(e,t,n){this.lightbox=S0(e,t,n)}handleLightboxClose(){this.lightbox=A0()}handleLightboxNav(e){this.lightbox=_0(this.lightbox,e)}normalizeWorkspacePathCandidate(e,t={}){let n=e.trim();if(!n||n.startsWith("#"))return null;for(;n.startsWith("./");)n=n.slice(2);if(n=n.replaceAll("\\","/"),!t.allowAbsolute)for(;n.startsWith("/");)n=n.slice(1);return!n||n.includes("\0")?null:n}isAbsoluteFilesystemPath(e){return e.startsWith("/")||e.startsWith("~/")||/^[a-z]:[\\/]/i.test(e)}inferMimeTypeFromPath(e){if(!e)return null;const t=e.trim().toLowerCase();if(!t)return null;const n=t.split(".").pop()??"";return n?n==="md"||n==="markdown"||n==="mdx"?"text/markdown":n==="html"||n==="htm"?"text/html":n==="json"||n==="json5"?"application/json":n==="txt"||n==="text"||n==="log"?"text/plain":n==="svg"||n==="svgz"?"image/svg+xml":n==="avif"||n==="bmp"||n==="gif"||n==="heic"||n==="heif"||n==="jpeg"||n==="jpg"||n==="png"||n==="webp"?`image/${n==="jpg"?"jpeg":n}`:null:null}sidebarTitleForPath(e){const t=e.replaceAll("\\","/").trim();if(!t)return"Document";const n=t.split("/");return n[n.length-1]||t}async listWorkspaceIdsForPathResolution(){const e=[],t=new Set,n=s=>{if(typeof s!="string")return;const a=s.trim();!a||t.has(a)||(t.add(a),e.push(a))};n(this.selectedWorkspace?.id);for(const s of this.workspaces??[])n(s.id);if(e.length>0||!this.client||!this.connected)return e;try{const s=await this.client.request("workspaces.list",{});for(const a of s.workspaces??[])n(a.id)}catch{}return e}async openWorkspaceRelativeFileInViewer(e){if(!this.client||!this.connected)return!1;const t=await this.listWorkspaceIdsForPathResolution();for(const n of t)try{const s=await this.client.request("workspaces.readFile",{workspaceId:n,filePath:e});if(typeof s.content!="string")continue;return this.handleOpenSidebar(s.content,{mimeType:s.contentType??s.mime??this.inferMimeTypeFromPath(e),filePath:s.path??e,title:this.sidebarTitleForPath(e)}),!0}catch{}return!1}extractWorkspacePathCandidatesFromHref(e){const t=e.trim();if(!t)return[];const n=[],s=t.toLowerCase();if(s.startsWith("mailto:")||s.startsWith("tel:")||s.startsWith("javascript:")||s.startsWith("data:"))return[];if(t.startsWith("file://")){let u=t.slice(7);u.startsWith("/~/")&&(u="~"+u.slice(2));try{u=decodeURIComponent(u)}catch{}n.push(u);const p=[],f=new Set;for(const m of n){const g=this.normalizeWorkspacePathCandidate(m,{allowAbsolute:!0});!g||f.has(g)||(f.add(g),p.push(g))}return p}const a=/^[a-z][a-z0-9+.-]*:/i.test(t),i=/^[a-z]:[\\/]/i.test(t);(!a||i)&&n.push(t);let o=null;try{o=new URL(t,window.location.href)}catch{o=null}if(o&&/^https?:$/.test(o.protocol)&&o.origin===window.location.origin){for(const $ of l2){const d=o.searchParams.get($);d&&n.push(d)}const p=(t.split("#")[0]??"").split("?")[0]??"";p.length>0&&!p.startsWith("/")&&!p.includes("://")&&n.push(p);let m=o.pathname;this.basePath&&m.startsWith(`${this.basePath}/`)?m=m.slice(this.basePath.length):this.basePath&&m===this.basePath&&(m="");const g=m.startsWith("/")?m.slice(1):m;if(g){n.push(g);const $=g.indexOf("/");if($>0){const d=g.slice(0,$).toLowerCase();gc.has(d)&&n.push(g.slice($+1))}}if(m.startsWith("/")&&g){const $=g.split("/")[0]?.toLowerCase()??"";gc.has($)||n.push(m)}}const l=[],c=new Set;for(const u of n){let p=u;try{p=decodeURIComponent(u)}catch{}const f=this.normalizeWorkspacePathCandidate(p,{allowAbsolute:!0});!f||c.has(f)||(c.add(f),l.push(f))}return l}async openWorkspaceFileInViewer(e){if(!this.client||!this.connected)return!1;const t=this.isAbsoluteFilesystemPath(e);if(!t&&await this.openWorkspaceRelativeFileInViewer(e))return!0;try{const n=await this.client.request("workspaces.readFile",{path:e});if(typeof n.content=="string")return this.handleOpenSidebar(n.content,{mimeType:n.contentType??n.mime??this.inferMimeTypeFromPath(e),filePath:n.path??e,title:this.sidebarTitleForPath(e)}),!0}catch{}if(!t)return!1;try{const n=await this.client.request("files.read",{path:e,maxSize:1e6});return typeof n.content!="string"?!1:(this.handleOpenSidebar(n.content,{mimeType:this.inferMimeTypeFromPath(e),filePath:e,title:this.sidebarTitleForPath(e)}),!0)}catch{return!1}}async handleOpenMessageFileLink(e){const t=this.extractWorkspacePathCandidatesFromHref(e);if(t.length===0)return!1;for(const n of t)if(await this.openWorkspaceFileInViewer(n))return!0;return!1}showToast(e,t="info",n=5e3,s){const a=t2(e,t,n,s);this.toasts=s2(this.toasts,a),n>0&&window.setTimeout(()=>{this.dismissToast(a.id)},n)}dismissToast(e){this.toasts=n2(this.toasts,e)}dismissAllToasts(){this.toasts=[]}async handleMyDayRefresh(){if(this.todayViewMode==="agent-log"){await Jt(this,{refresh:!0});return}await Ks(this),this._loadDecisionCards()}_loadDecisionCards(){E(()=>Promise.resolve().then(()=>In),void 0,import.meta.url).then(async e=>{this.todayQueueResults=await e.loadTodayQueueResults(this)}).catch(()=>{})}async handleMyDayTaskStatusChange(e,t){if(!(!this.client||!this.connected))try{await this.client.request("tasks.update",{id:e,status:t,completedAt:t==="complete"?new Date().toISOString():null});const{loadTodayTasksWithQueueStatus:n}=await E(async()=>{const{loadTodayTasksWithQueueStatus:s}=await Promise.resolve().then(()=>In);return{loadTodayTasksWithQueueStatus:s}},void 0,import.meta.url);await n(this)}catch(n){console.error("[MyDay] Failed to update task status:",n)}}async handleTodayCreateTask(e){if(!(!this.client||!this.connected))try{await this.client.request("tasks.create",{title:e,dueDate:re(),priority:"medium",source:"chat"});const{loadTodayTasksWithQueueStatus:t}=await E(async()=>{const{loadTodayTasksWithQueueStatus:n}=await Promise.resolve().then(()=>In);return{loadTodayTasksWithQueueStatus:n}},void 0,import.meta.url);await t(this)}catch(t){console.error("[MyDay] Failed to create task:",t),this.showToast("Failed to create task","error")}}handleTodayEditTask(e){this.todayEditingTaskId=e}async handleTodayUpdateTask(e,t){if(!(!this.client||!this.connected))try{await this.client.request("tasks.update",{id:e,...t}),this.todayEditingTaskId=null;const{loadTodayTasksWithQueueStatus:n}=await E(async()=>{const{loadTodayTasksWithQueueStatus:s}=await Promise.resolve().then(()=>In);return{loadTodayTasksWithQueueStatus:s}},void 0,import.meta.url);await n(this)}catch(n){console.error("[MyDay] Failed to update task:",n),this.showToast("Failed to update task","error")}}handleTodayToggleCompleted(){this.todayShowCompleted=!this.todayShowCompleted}async handleTodayStartTask(e){if(!(!this.client||!this.connected))try{const t=await this.client.request("tasks.openSession",{taskId:e}),n=t?.sessionId??t?.sessionKey;if(n){if(t.task?.title){const{autoTitleCache:i}=await E(async()=>{const{autoTitleCache:o}=await Promise.resolve().then(()=>Cn);return{autoTitleCache:o}},void 0,import.meta.url);i.set(n,t.task.title)}this.setTab("chat"),this.sessionKey=n;const s=this.settings.openTabs.includes(n)?this.settings.openTabs:[...this.settings.openTabs,n];this.applySettings({...this.settings,sessionKey:n,lastActiveSessionKey:n,openTabs:s}),this.chatMessages=[],this.chatStream=null,this.chatStreamStartedAt=null,this.chatRunId=null,this.resetToolStream(),this.resetChatScroll(),this.loadAssistantIdentity();const{loadChatHistory:a}=await E(async()=>{const{loadChatHistory:i}=await Promise.resolve().then(()=>Ge);return{loadChatHistory:i}},void 0,import.meta.url);await a(this),t.queueOutput&&this.chatMessages.length===0&&this.seedSessionWithAgentOutput(t.task?.title??"this task",t.queueOutput,t.agentPrompt??void 0),this.requestUpdate()}}catch(t){console.error("[MyDay] Failed to open session for task:",t),this.showToast("Failed to open session for task","error")}}handleDatePrev(){const e=new Date(this.todaySelectedDate+"T12:00:00");if(e.setDate(e.getDate()-1),this.todaySelectedDate=re(e),this.todayViewMode==="agent-log"){Jt(this);return}xs(this)}handleDateNext(){const e=new Date(this.todaySelectedDate+"T12:00:00");e.setDate(e.getDate()+1);const t=re(),n=re(e);if(!(n>t)){if(this.todaySelectedDate=n,this.todayViewMode==="agent-log"){Jt(this);return}xs(this)}}handleDateToday(){this.todaySelectedDate=re(),Ks(this)}async handleDailyBriefRefresh(){await xs(this)}handleDailyBriefOpenInObsidian(){const e=this.dailyBrief?.date;ou(e)}async loadBriefNotes(){if(!this.client||!this.connected)return;const e=this.todaySelectedDate;try{const t=await this.client.request("briefNotes.get",{date:e});this.briefNotes=t.notes??{}}catch(t){console.error("[BriefNotes] Load error:",t),this.briefNotes={}}}async handleBriefNoteSave(e,t){if(!this.client||!this.connected)return;const n=this.todaySelectedDate;try{const s=await this.client.request("briefNotes.update",{date:n,section:e,text:t});this.briefNotes=s.notes??{}}catch(s){console.error("[BriefNotes] Save error:",s),this.showToast("Failed to save note","error")}}handleTodayViewModeChange(e){this.todayViewMode=e,e==="agent-log"&&!this.agentLog&&Jt(this)}handlePrivateModeToggle(){if(this.chatPrivateMode){const e=this.sessionKey;this.chatPrivateMode=!1,this._destroyPrivateSession(e),this.showToast("Private session destroyed","info",2e3);return}this.chatPrivateMode=!0,this.setTab("chat"),E(async()=>{const{createNewSession:e}=await Promise.resolve().then(()=>at);return{createNewSession:e}},void 0,import.meta.url).then(({createNewSession:e})=>{e(this);const t=Date.now()+1440*60*1e3;this.privateSessions=new Map(this.privateSessions).set(this.sessionKey,t),this._persistPrivateSessions(),this._startPrivateSessionTimer(),this.chatMessages=[{role:"assistant",content:`This is a **private session**. Nothing will be saved to memory or logs.
8464
8491
 
8465
8492
  This session self-destructs when you close it or in **24 hours** — whichever comes first.`,timestamp:Date.now()}],this.requestUpdate()}),this.showToast("Private session created — 24h countdown started","info",3e3)}async _destroyPrivateSession(e){const t=new Map(this.privateSessions);if(t.delete(e),this.privateSessions=t,this._persistPrivateSessions(),this.sessionKey===e){this.chatPrivateMode=!1;const n=this.settings.openTabs.filter(a=>a!==e),s=n[0]||ee;this.applySettings({...this.settings,openTabs:n,sessionKey:s,lastActiveSessionKey:s}),this.sessionKey=s,(await E(async()=>{const{loadChatHistory:a}=await Promise.resolve().then(()=>Ge);return{loadChatHistory:a}},void 0,import.meta.url)).loadChatHistory(this)}else this.applySettings({...this.settings,openTabs:this.settings.openTabs.filter(n=>n!==e)});this.client&&this.connected&&this.client.request("sessions.delete",{key:e,deleteTranscript:!0}).catch(()=>{}),this.privateSessions.size===0&&this._stopPrivateSessionTimer()}_persistPrivateSessions(){const e=Array.from(this.privateSessions.entries());e.length===0?localStorage.removeItem("godmode.privateSessions"):localStorage.setItem("godmode.privateSessions",JSON.stringify(e))}_restorePrivateSessions(){try{const e=localStorage.getItem("godmode.privateSessions");if(!e)return;const t=JSON.parse(e),n=Date.now(),s=t.filter(([,a])=>a>n);if(this.privateSessions=new Map(s),s.length!==t.length){const a=t.filter(([,i])=>i<=n);for(const[i]of a)this._destroyPrivateSession(i)}this.privateSessions.size>0&&(this.privateSessions.has(this.sessionKey)&&(this.chatPrivateMode=!0),this._startPrivateSessionTimer()),this._persistPrivateSessions()}catch{localStorage.removeItem("godmode.privateSessions")}}_startPrivateSessionTimer(){this._privateSessionTimer||(this._privateSessionTimer=setInterval(()=>{const e=Date.now();for(const[t,n]of this.privateSessions)n<=e&&(this._destroyPrivateSession(t),this.showToast("Private session expired and was destroyed","info",3e3));this.privateSessions.size>0&&this.requestUpdate()},3e4))}_stopPrivateSessionTimer(){this._privateSessionTimer&&(clearInterval(this._privateSessionTimer),this._privateSessionTimer=null)}async handleBriefSave(e){if(!this.client||!this.connected)return;const t=this.dailyBrief?.date||this.todaySelectedDate;try{await this.client.request("dailyBrief.update",{date:t,content:e}),this.dailyBrief&&(this.dailyBrief={...this.dailyBrief,updatedAt:new Date().toISOString()})}catch(n){console.error("[DailyBrief] Save error:",n),this.showToast("Failed to save brief","error")}}async handleBriefToggleCheckbox(e,t){if(!this.client||!this.connected)return;const n=this.dailyBrief?.date||this.todaySelectedDate;try{await this.client.request("dailyBrief.toggleCheckbox",{date:n,index:e,checked:t}),this.dailyBrief&&(this.dailyBrief={...this.dailyBrief,updatedAt:new Date().toISOString()})}catch(s){console.error("[DailyBrief] Checkbox toggle error:",s),this.showToast("Failed to toggle checkbox","error")}}async handleWorkRefresh(){await ru(this)}handleWorkToggleProject(e){const t=new Set(this.workExpandedProjects);t.has(e)?t.delete(e):(t.add(e),this.workProjectFiles[e]||Ry(this,e)),this.workExpandedProjects=t}async handleWorkFileClick(e){if(!this.client||!this.connected){this.showToast("Not connected to gateway","error");return}try{const t=await this.client.request("workspaces.readFile",{path:e});if(!t.content){this.showToast(t.error??"Failed to read file","error");return}this.handleOpenSidebar(t.content,{mimeType:t.contentType??t.mime??this.inferMimeTypeFromPath(e),filePath:t.path??e,title:this.sidebarTitleForPath(e)})}catch(t){console.error("[Work] Failed to read file:",t),this.showToast(`Failed to open: ${e}`,"error")}}handleWorkSkillClick(e,t){this.handleStartChatWithPrompt(`Tell me about the "${e}" skill and how it's used in the ${t} project.`)}handlePeopleImport(e){const t=e==="apple"?"Import my contacts from Apple Contacts and organize them into categories.":"Import my contacts from Google Contacts and organize them into categories.";this.handleStartChatWithPrompt(t)}async handleWorkspacesRefresh(){await ra(this)}async handleWorkspaceBrowse(e){if(!this.selectedWorkspace)return;const{browseWorkspaceFolder:t}=await E(async()=>{const{browseWorkspaceFolder:s}=await Promise.resolve().then(()=>pe);return{browseWorkspaceFolder:s}},void 0,import.meta.url),n=await t(this,this.selectedWorkspace.id,e);n&&(this.workspaceBrowsePath=e,this.workspaceBrowseEntries=n.entries,this.workspaceBreadcrumbs=n.breadcrumbs)}async handleWorkspaceBrowseSearch(e){if(this.workspaceBrowseSearchQuery=e,!e.trim()||!this.selectedWorkspace){this.workspaceBrowseSearchResults=null;return}const{searchWorkspaceFiles:t}=await E(async()=>{const{searchWorkspaceFiles:n}=await Promise.resolve().then(()=>pe);return{searchWorkspaceFiles:n}},void 0,import.meta.url);this.workspaceBrowseSearchResults=await t(this,this.selectedWorkspace.id,e)}handleWorkspaceBrowseBack(){this.workspaceBrowsePath=null,this.workspaceBrowseEntries=null,this.workspaceBreadcrumbs=null,this.workspaceBrowseSearchQuery="",this.workspaceBrowseSearchResults=null}async handleWorkspaceCreateFolder(e){if(!this.selectedWorkspace)return;const{createWorkspaceFolder:t}=await E(async()=>{const{createWorkspaceFolder:s}=await Promise.resolve().then(()=>pe);return{createWorkspaceFolder:s}},void 0,import.meta.url),n=await t(this,this.selectedWorkspace.id,e);n&&this.workspaceBrowsePath&&await this.handleWorkspaceBrowse(this.workspaceBrowsePath),n&&this.showToast("Folder created","success",2e3)}async handleGoalsRefresh(){if(!(!this.client||!this.connected)){this.goalsLoading=!0,this.goalsError=null;try{const e=await this.client.request("goals.get",{});this.goals=e.goals??[]}catch(e){this.goalsError=e instanceof Error?e.message:"Failed to load goals",console.error("[Goals] Load error:",e)}finally{this.goalsLoading=!1}}}handleOnboardingStart(){this.onboardingPhase=1,this.onboardingData&&(this.onboardingData={...this.onboardingData,phase:1}),this.client?.request("onboarding.update",{phase:1,completePhase:0})}async handleOnboardingIdentitySubmit(e){if(this.client)try{await this.client.request("onboarding.update",{phase:2,completePhase:1,identity:e}),this.onboardingPhase=2,this.onboardingData&&(this.onboardingData={...this.onboardingData,phase:2,identity:e}),this.userName=e.name,this.userAvatar=e.emoji,this.applySettings({...this.settings,userName:e.name,userAvatar:e.emoji}),this.setTab("chat"),E(async()=>{const{createNewSession:t}=await Promise.resolve().then(()=>at);return{createNewSession:t}},void 0,import.meta.url).then(({createNewSession:t})=>{t(this);const n=`I just set up my GodMode identity. My name is ${e.name}${e.mission?` and my mission is: ${e.mission}`:""}. Let's set up my workspace.`;this.chatMessage=n,this.handleSendChat(n)})}catch(t){console.error("[Onboarding] Identity submit failed:",t),this.showToast("Failed to save identity","error")}}handleOnboardingSkipPhase(){if(!this.client)return;const e=Math.min(this.onboardingPhase+1,6);this.onboardingPhase=e,this.client.request("onboarding.update",{phase:e,completePhase:this.onboardingPhase})}handleOnboardingComplete(){this.onboardingActive=!1,this.onboardingPhase=6,this.onboardingData&&(this.onboardingData={...this.onboardingData,phase:6,completedAt:new Date().toISOString()}),this.client?.request("onboarding.complete",{summary:this.onboardingData?.summary??null}),this.showToast("Welcome to GodMode!","success",4e3)}handleStartChatWithPrompt(e){this.setTab("chat"),E(async()=>{const{createNewSession:t}=await Promise.resolve().then(()=>at);return{createNewSession:t}},void 0,import.meta.url).then(({createNewSession:t})=>{t(this),this.chatMessage=e,this.requestUpdate()})}handleOpenSupportChat(){const e="agent:main:support";if(this.sessionKey===e){this.setTab("chat");return}E(async()=>{const{saveDraft:s}=await Promise.resolve().then(()=>ja);return{saveDraft:s}},void 0,import.meta.url).then(({saveDraft:s})=>s(this));const n=this.settings.openTabs.includes(e)?this.settings.openTabs:[...this.settings.openTabs,e];this.applySettings({...this.settings,openTabs:n,sessionKey:e,lastActiveSessionKey:e,tabLastViewed:{...this.settings.tabLastViewed,[e]:Date.now()}}),this.sessionKey=e,this.setTab("chat"),this.chatMessages=[],this.chatStream=null,this.chatStreamStartedAt=null,this.chatRunId=null,this.resetToolStream(),this.resetChatScroll(),this.loadAssistantIdentity(),E(async()=>{const{autoTitleCache:s}=await Promise.resolve().then(()=>Cn);return{autoTitleCache:s}},void 0,import.meta.url).then(({autoTitleCache:s})=>{s.set(e,"Support")}),E(async()=>{const{loadChatHistory:s}=await Promise.resolve().then(()=>Ge);return{loadChatHistory:s}},void 0,import.meta.url).then(({loadChatHistory:s})=>{s(this).then(()=>{this.chatMessages.length===0&&this.sessionKey===e&&(this.chatMessages=[{role:"assistant",content:`**Welcome to GodMode Support**
8466
8493
 
@@ -8471,4 +8498,4 @@ I have full access to your system diagnostics and GodMode knowledge base. I can
8471
8498
  - Setup guidance
8472
8499
  - Escalation to the team if needed
8473
8500
 
8474
- What can I help you with?`,timestamp:Date.now()}],this.requestUpdate())}).catch(a=>{console.error("[Support] Failed to load chat history:",a)})})}handleWizardOpen(){E(async()=>{const{emptyWizardState:e}=await Promise.resolve().then(()=>Y0);return{emptyWizardState:e}},void 0,import.meta.url).then(({emptyWizardState:e})=>{this.wizardState=e(),this.wizardActive=!0,this.requestUpdate()})}handleWizardClose(){this.wizardActive=!1,this.wizardState=null,this.requestUpdate()}handleWizardStepChange(e){this.wizardState&&(this.wizardState={...this.wizardState,step:e},this.requestUpdate())}handleWizardAnswerChange(e,t){this.wizardState&&(this.wizardState={...this.wizardState,answers:{...this.wizardState.answers,[e]:t}},this.requestUpdate())}async handleWizardPreview(){if(!(!this.client||!this.wizardState))try{const e=await this.client.request("onboarding.wizard.preview",this.wizardState.answers);this.wizardState={...this.wizardState,preview:e.files??[]},this.requestUpdate()}catch(e){console.error("[Wizard] Preview failed:",e)}}async handleWizardGenerate(){if(!(!this.client||!this.wizardState)){this.wizardState={...this.wizardState,generating:!0,error:null},this.requestUpdate();try{const e=await this.client.request("onboarding.wizard.generate",this.wizardState.answers);this.wizardState={...this.wizardState,generating:!1,step:9,result:{filesCreated:e.filesCreated,filesSkipped:e.filesSkipped,configPatched:e.configPatched,workspacePath:e.workspacePath}},this.requestUpdate(),this.showToast("Memory system generated!","success",4e3)}catch(e){const t=e instanceof Error?e.message:"Failed to generate workspace";this.wizardState={...this.wizardState,generating:!1,error:t},this.requestUpdate(),this.showToast(t,"error")}}}async handleQuickSetup(e,t,n){E(()=>import("./setup-DDvbMoK2.js"),[],import.meta.url).then(async({quickSetup:s})=>{await s(this,e,t,n)&&(this.setTab("chat"),E(async()=>{const{loadChecklist:i}=await import("./setup-DDvbMoK2.js");return{loadChecklist:i}},[],import.meta.url).then(({loadChecklist:i})=>i(this)))})}handleLoadSetupChecklist(){E(async()=>{const{loadChecklist:e}=await import("./setup-DDvbMoK2.js");return{loadChecklist:e}},[],import.meta.url).then(({loadChecklist:e})=>e(this))}handleHideSetup(){E(async()=>{const{hideSetup:e}=await import("./setup-DDvbMoK2.js");return{hideSetup:e}},[],import.meta.url).then(({hideSetup:e})=>e(this))}handleRunAssessment(){this.client&&this.client.request("onboarding.assess",{}).then(()=>{this.handleLoadSetupChecklist()})}async handleDataRefresh(){if(!(!this.client||!this.connected)){this.dataLoading=!0,this.dataError=null;try{const e=await this.client.request("dataSources.list",{});this.dataSources=e.sources??[]}catch(e){this.dataError=e instanceof Error?e.message:"Failed to load data sources",console.error("[Data] Load error:",e)}finally{this.dataLoading=!1}}}handleDataSubtabChange(e){this.dataSubtab=e}handleDataConnectSource(e){const n=this.dataSources?.find(s=>s.id===e)?.name??e;this.handleStartChatWithPrompt(`Help me connect and configure the ${n} integration.`)}handleDataQuerySubmit(e){this.handleStartChatWithPrompt(`Query my connected data: ${e}`)}handleUpdateUserProfile(e,t){const n=e.trim().slice(0,50),s=t.trim();this.userName=n||"You",this.userAvatar=s||null,this.applySettings({...this.settings,userName:n,userAvatar:s})}async handleLoadIntegrations(){await(await E(()=>import("./onboarding-setup-eq3R6nNk.js"),[],import.meta.url)).loadIntegrations(this)}handleExpandCard(e){E(()=>import("./onboarding-setup-eq3R6nNk.js"),[],import.meta.url).then(t=>t.expandCard(this,e))}async handleLoadGuide(e){await(await E(()=>import("./onboarding-setup-eq3R6nNk.js"),[],import.meta.url)).loadGuide(this,e)}async handleTestIntegration(e){await(await E(()=>import("./onboarding-setup-eq3R6nNk.js"),[],import.meta.url)).testIntegration(this,e)}async handleConfigureIntegration(e,t){await(await E(()=>import("./onboarding-setup-eq3R6nNk.js"),[],import.meta.url)).configureIntegration(this,e,t)}handleUpdateConfigValue(e,t){this.onboardingConfigValues={...this.onboardingConfigValues,[e]:t}}handleSkipIntegration(e){E(()=>import("./onboarding-setup-eq3R6nNk.js"),[],import.meta.url).then(t=>t.skipIntegration(this,e))}async handleMarkOnboardingComplete(){if(!(!this.client||!this.connected))try{await this.client.request("onboarding.complete",{}),this.godmodeOptions&&(this.godmodeOptions={...this.godmodeOptions,"onboarding.complete":!0}),this.showSetupTab=!1,this.setTab("chat")}catch(e){console.error("[onboarding] Failed to mark complete:",e)}}render(){return U1(this)}};b([w()],y.prototype,"settings",2);b([w()],y.prototype,"password",2);b([w()],y.prototype,"tab",2);b([w()],y.prototype,"onboarding",2);b([w()],y.prototype,"connected",2);b([w()],y.prototype,"reconnecting",2);b([w()],y.prototype,"reconnectAttempt",2);b([w()],y.prototype,"theme",2);b([w()],y.prototype,"themeResolved",2);b([w()],y.prototype,"hello",2);b([w()],y.prototype,"lastError",2);b([w()],y.prototype,"eventLog",2);b([w()],y.prototype,"assistantName",2);b([w()],y.prototype,"assistantAvatar",2);b([w()],y.prototype,"assistantAgentId",2);b([w()],y.prototype,"userName",2);b([w()],y.prototype,"userAvatar",2);b([w()],y.prototype,"sessionKey",2);b([w()],y.prototype,"sessionPickerOpen",2);b([w()],y.prototype,"sessionPickerPosition",2);b([w()],y.prototype,"sessionPickerSearch",2);b([w()],y.prototype,"sessionSearchOpen",2);b([w()],y.prototype,"sessionSearchPosition",2);b([w()],y.prototype,"sessionSearchQuery",2);b([w()],y.prototype,"sessionSearchResults",2);b([w()],y.prototype,"sessionSearchLoading",2);b([w()],y.prototype,"profilePopoverOpen",2);b([w()],y.prototype,"profileEditName",2);b([w()],y.prototype,"profileEditAvatar",2);b([w()],y.prototype,"editingTabKey",2);b([w()],y.prototype,"chatLoading",2);b([w()],y.prototype,"chatSending",2);b([w()],y.prototype,"chatSendingSessionKey",2);b([w()],y.prototype,"chatMessage",2);b([w()],y.prototype,"chatDrafts",2);b([w()],y.prototype,"chatMessages",2);b([w()],y.prototype,"chatToolMessages",2);b([w()],y.prototype,"chatStream",2);b([w()],y.prototype,"chatStreamStartedAt",2);b([w()],y.prototype,"chatRunId",2);b([w()],y.prototype,"currentToolName",2);b([w()],y.prototype,"currentToolInfo",2);b([w()],y.prototype,"workingSessions",2);b([w()],y.prototype,"compactionStatus",2);b([w()],y.prototype,"chatAvatarUrl",2);b([w()],y.prototype,"chatThinkingLevel",2);b([w()],y.prototype,"chatQueue",2);b([w()],y.prototype,"chatAttachments",2);b([w()],y.prototype,"pendingRetry",2);b([w()],y.prototype,"autoRetryAfterCompact",2);b([w()],y.prototype,"sidebarOpen",2);b([w()],y.prototype,"sidebarContent",2);b([w()],y.prototype,"sidebarError",2);b([w()],y.prototype,"sidebarMimeType",2);b([w()],y.prototype,"sidebarFilePath",2);b([w()],y.prototype,"sidebarTitle",2);b([w()],y.prototype,"splitRatio",2);b([w()],y.prototype,"lightbox",2);b([w()],y.prototype,"driveAccounts",2);b([w()],y.prototype,"showDrivePicker",2);b([w()],y.prototype,"driveUploading",2);b([w()],y.prototype,"updateStatus",2);b([w()],y.prototype,"updateLoading",2);b([w()],y.prototype,"updateError",2);b([w()],y.prototype,"updateLastChecked",2);b([w()],y.prototype,"nodesLoading",2);b([w()],y.prototype,"nodes",2);b([w()],y.prototype,"devicesLoading",2);b([w()],y.prototype,"devicesError",2);b([w()],y.prototype,"devicesList",2);b([w()],y.prototype,"execApprovalsLoading",2);b([w()],y.prototype,"execApprovalsSaving",2);b([w()],y.prototype,"execApprovalsDirty",2);b([w()],y.prototype,"execApprovalsSnapshot",2);b([w()],y.prototype,"execApprovalsForm",2);b([w()],y.prototype,"execApprovalsSelectedAgent",2);b([w()],y.prototype,"execApprovalsTarget",2);b([w()],y.prototype,"execApprovalsTargetNodeId",2);b([w()],y.prototype,"execApprovalQueue",2);b([w()],y.prototype,"execApprovalBusy",2);b([w()],y.prototype,"execApprovalError",2);b([w()],y.prototype,"pendingGatewayUrl",2);b([w()],y.prototype,"configLoading",2);b([w()],y.prototype,"configRaw",2);b([w()],y.prototype,"configRawOriginal",2);b([w()],y.prototype,"configValid",2);b([w()],y.prototype,"configIssues",2);b([w()],y.prototype,"configSaving",2);b([w()],y.prototype,"configApplying",2);b([w()],y.prototype,"updateRunning",2);b([w()],y.prototype,"applySessionKey",2);b([w()],y.prototype,"configSnapshot",2);b([w()],y.prototype,"configSchema",2);b([w()],y.prototype,"configSchemaVersion",2);b([w()],y.prototype,"configSchemaLoading",2);b([w()],y.prototype,"configUiHints",2);b([w()],y.prototype,"configForm",2);b([w()],y.prototype,"configFormOriginal",2);b([w()],y.prototype,"configFormDirty",2);b([w()],y.prototype,"configFormMode",2);b([w()],y.prototype,"configSearchQuery",2);b([w()],y.prototype,"configActiveSection",2);b([w()],y.prototype,"configActiveSubsection",2);b([w()],y.prototype,"channelsLoading",2);b([w()],y.prototype,"channelsSnapshot",2);b([w()],y.prototype,"channelsError",2);b([w()],y.prototype,"channelsLastSuccess",2);b([w()],y.prototype,"whatsappLoginMessage",2);b([w()],y.prototype,"whatsappLoginQrDataUrl",2);b([w()],y.prototype,"whatsappLoginConnected",2);b([w()],y.prototype,"whatsappBusy",2);b([w()],y.prototype,"nostrProfileFormState",2);b([w()],y.prototype,"nostrProfileAccountId",2);b([w()],y.prototype,"presenceLoading",2);b([w()],y.prototype,"presenceEntries",2);b([w()],y.prototype,"presenceError",2);b([w()],y.prototype,"presenceStatus",2);b([w()],y.prototype,"agentsLoading",2);b([w()],y.prototype,"agentsList",2);b([w()],y.prototype,"agentsError",2);b([w()],y.prototype,"sessionsLoading",2);b([w()],y.prototype,"sessionsResult",2);b([w()],y.prototype,"sessionsError",2);b([w()],y.prototype,"sessionsFilterActive",2);b([w()],y.prototype,"sessionsFilterLimit",2);b([w()],y.prototype,"sessionsIncludeGlobal",2);b([w()],y.prototype,"sessionsIncludeUnknown",2);b([w()],y.prototype,"archivedSessions",2);b([w()],y.prototype,"archivedSessionsLoading",2);b([w()],y.prototype,"archivedSessionsExpanded",2);b([w()],y.prototype,"cronLoading",2);b([w()],y.prototype,"cronJobs",2);b([w()],y.prototype,"cronStatus",2);b([w()],y.prototype,"cronError",2);b([w()],y.prototype,"cronForm",2);b([w()],y.prototype,"cronRunsJobId",2);b([w()],y.prototype,"cronRuns",2);b([w()],y.prototype,"cronBusy",2);b([w()],y.prototype,"workspaceNeedsSetup",2);b([w()],y.prototype,"onboardingPhase",2);b([w()],y.prototype,"onboardingData",2);b([w()],y.prototype,"onboardingActive",2);b([w()],y.prototype,"wizardActive",2);b([w()],y.prototype,"wizardState",2);b([w()],y.prototype,"showSetupTab",2);b([w()],y.prototype,"setupChecklist",2);b([w()],y.prototype,"setupChecklistLoading",2);b([w()],y.prototype,"setupQuickDone",2);b([w()],y.prototype,"onboardingIntegrations",2);b([w()],y.prototype,"onboardingCoreProgress",2);b([w()],y.prototype,"onboardingExpandedCard",2);b([w()],y.prototype,"onboardingLoadingGuide",2);b([w()],y.prototype,"onboardingActiveGuide",2);b([w()],y.prototype,"onboardingTestingId",2);b([w()],y.prototype,"onboardingTestResult",2);b([w()],y.prototype,"onboardingConfigValues",2);b([w()],y.prototype,"onboardingProgress",2);b([w()],y.prototype,"workspaces",2);b([w()],y.prototype,"selectedWorkspace",2);b([w()],y.prototype,"workspacesSearchQuery",2);b([w()],y.prototype,"workspaceItemSearchQuery",2);b([w()],y.prototype,"workspacesLoading",2);b([w()],y.prototype,"workspacesCreateLoading",2);b([w()],y.prototype,"workspacesError",2);b([w()],y.prototype,"workspaceExpandedFolders",2);b([w()],y.prototype,"allTasks",2);b([w()],y.prototype,"taskFilter",2);b([w()],y.prototype,"taskSort",2);b([w()],y.prototype,"showCompletedTasks",2);b([w()],y.prototype,"editingTaskId",2);b([w()],y.prototype,"workspaceBrowsePath",2);b([w()],y.prototype,"workspaceBrowseEntries",2);b([w()],y.prototype,"workspaceBreadcrumbs",2);b([w()],y.prototype,"workspaceBrowseSearchQuery",2);b([w()],y.prototype,"workspaceBrowseSearchResults",2);b([w()],y.prototype,"myDayLoading",2);b([w()],y.prototype,"myDayError",2);b([w()],y.prototype,"todaySelectedDate",2);b([w()],y.prototype,"todayViewMode",2);b([w()],y.prototype,"dailyBrief",2);b([w()],y.prototype,"dailyBriefLoading",2);b([w()],y.prototype,"dailyBriefError",2);b([w()],y.prototype,"agentLog",2);b([w()],y.prototype,"agentLogLoading",2);b([w()],y.prototype,"agentLogError",2);b([w()],y.prototype,"briefNotes",2);b([w()],y.prototype,"todayTasks",2);b([w()],y.prototype,"todayTasksLoading",2);b([w()],y.prototype,"todayEditingTaskId",2);b([w()],y.prototype,"todayShowCompleted",2);b([w()],y.prototype,"allyPanelOpen",2);b([w()],y.prototype,"allyMessages",2);b([w()],y.prototype,"allyStream",2);b([w()],y.prototype,"allyDraft",2);b([w()],y.prototype,"allyUnread",2);b([w()],y.prototype,"allySending",2);b([w()],y.prototype,"allyWorking",2);b([w()],y.prototype,"allyAttachments",2);b([w()],y.prototype,"todayQueueResults",2);b([w()],y.prototype,"chatPrivateMode",2);b([w()],y.prototype,"privateSessions",2);b([w()],y.prototype,"goals",2);b([w()],y.prototype,"goalsLoading",2);b([w()],y.prototype,"goalsError",2);b([w()],y.prototype,"dataSources",2);b([w()],y.prototype,"dataLoading",2);b([w()],y.prototype,"dataError",2);b([w()],y.prototype,"dataSubtab",2);b([w()],y.prototype,"dynamicSlots",2);b([w()],y.prototype,"workProjects",2);b([w()],y.prototype,"workLoading",2);b([w()],y.prototype,"workError",2);b([w()],y.prototype,"workExpandedProjects",2);b([w()],y.prototype,"workProjectFiles",2);b([w()],y.prototype,"workDetailLoading",2);b([w()],y.prototype,"skillsLoading",2);b([w()],y.prototype,"skillsReport",2);b([w()],y.prototype,"skillsError",2);b([w()],y.prototype,"skillsFilter",2);b([w()],y.prototype,"skillEdits",2);b([w()],y.prototype,"skillsBusyKey",2);b([w()],y.prototype,"skillMessages",2);b([w()],y.prototype,"debugLoading",2);b([w()],y.prototype,"debugStatus",2);b([w()],y.prototype,"debugHealth",2);b([w()],y.prototype,"debugModels",2);b([w()],y.prototype,"debugHeartbeat",2);b([w()],y.prototype,"debugCallMethod",2);b([w()],y.prototype,"debugCallParams",2);b([w()],y.prototype,"debugCallResult",2);b([w()],y.prototype,"debugCallError",2);b([w()],y.prototype,"logsLoading",2);b([w()],y.prototype,"logsError",2);b([w()],y.prototype,"logsFile",2);b([w()],y.prototype,"logsEntries",2);b([w()],y.prototype,"logsFilterText",2);b([w()],y.prototype,"logsLevelFilters",2);b([w()],y.prototype,"logsAutoFollow",2);b([w()],y.prototype,"logsTruncated",2);b([w()],y.prototype,"logsCursor",2);b([w()],y.prototype,"logsLastFetchAt",2);b([w()],y.prototype,"logsLimit",2);b([w()],y.prototype,"logsMaxBytes",2);b([w()],y.prototype,"logsAtBottom",2);b([w()],y.prototype,"toasts",2);b([w()],y.prototype,"chatUserNearBottom",2);b([w()],y.prototype,"chatNewMessagesBelow",2);b([w()],y.prototype,"consciousnessStatus",2);b([w()],y.prototype,"focusPulseData",2);b([w()],y.prototype,"trustTrackerData",2);b([w()],y.prototype,"trustTrackerLoading",2);b([w()],y.prototype,"guardrailsData",2);b([w()],y.prototype,"guardrailsLoading",2);b([w()],y.prototype,"guardrailsShowAddForm",2);b([w()],y.prototype,"missionControlData",2);b([w()],y.prototype,"missionControlLoading",2);b([w()],y.prototype,"missionControlError",2);b([w()],y.prototype,"missionControlFullControl",2);b([w()],y.prototype,"godmodeOptions",2);b([w()],y.prototype,"godmodeOptionsLoading",2);b([w()],y.prototype,"dashboardsList",2);b([w()],y.prototype,"dashboardsLoading",2);b([w()],y.prototype,"dashboardsError",2);b([w()],y.prototype,"activeDashboardId",2);b([w()],y.prototype,"activeDashboardHtml",2);b([w()],y.prototype,"activeDashboardManifest",2);b([w()],y.prototype,"dashboardChatOpen",2);b([w()],y.prototype,"secondBrainSubtab",2);b([w()],y.prototype,"secondBrainLoading",2);b([w()],y.prototype,"secondBrainError",2);b([w()],y.prototype,"secondBrainIdentity",2);b([w()],y.prototype,"secondBrainMemoryBank",2);b([w()],y.prototype,"secondBrainAiPacket",2);b([w()],y.prototype,"secondBrainSourcesData",2);b([w()],y.prototype,"secondBrainResearchData",2);b([w()],y.prototype,"secondBrainResearchAddFormOpen",2);b([w()],y.prototype,"secondBrainResearchAddForm",2);b([w()],y.prototype,"secondBrainResearchCategories",2);b([w()],y.prototype,"secondBrainSelectedEntry",2);b([w()],y.prototype,"secondBrainSearchQuery",2);b([w()],y.prototype,"secondBrainSyncing",2);b([w()],y.prototype,"secondBrainBrowsingFolder",2);b([w()],y.prototype,"secondBrainFolderEntries",2);b([w()],y.prototype,"secondBrainFolderName",2);b([w()],y.prototype,"secondBrainFileTree",2);b([w()],y.prototype,"secondBrainFileTreeLoading",2);b([w()],y.prototype,"secondBrainFileSearchQuery",2);b([w()],y.prototype,"secondBrainFileSearchResults",2);y=b([kc("godmode-app")],y);
8501
+ What can I help you with?`,timestamp:Date.now()}],this.requestUpdate())}).catch(a=>{console.error("[Support] Failed to load chat history:",a)})})}handleWizardOpen(){E(async()=>{const{emptyWizardState:e}=await Promise.resolve().then(()=>X0);return{emptyWizardState:e}},void 0,import.meta.url).then(({emptyWizardState:e})=>{this.wizardState=e(),this.wizardActive=!0,this.requestUpdate()})}handleWizardClose(){this.wizardActive=!1,this.wizardState=null,this.requestUpdate()}handleWizardStepChange(e){this.wizardState&&(this.wizardState={...this.wizardState,step:e},this.requestUpdate(),e===10&&this.client&&this.client.request("onboarding.seedRoster",{}).then(t=>{this.wizardState&&(this.wizardState={...this.wizardState,roster:t.roster},this.requestUpdate())}).catch(t=>{console.error("[Wizard] seedRoster failed:",t)}))}handleWizardAnswerChange(e,t){this.wizardState&&(this.wizardState={...this.wizardState,answers:{...this.wizardState.answers,[e]:t}},this.requestUpdate())}async handleWizardPreview(){if(!(!this.client||!this.wizardState))try{const e=await this.client.request("onboarding.wizard.preview",this.wizardState.answers);this.wizardState={...this.wizardState,preview:e.files??[]},this.requestUpdate()}catch(e){console.error("[Wizard] Preview failed:",e)}}async handleWizardGenerate(){if(!(!this.client||!this.wizardState)){this.wizardState={...this.wizardState,generating:!0,error:null},this.requestUpdate();try{const e=await this.client.request("onboarding.wizard.generate",this.wizardState.answers);this.wizardState={...this.wizardState,generating:!1,step:9,result:{filesCreated:e.filesCreated,filesSkipped:e.filesSkipped,configPatched:e.configPatched,workspacePath:e.workspacePath}},this.requestUpdate(),this.showToast("Memory system generated!","success",4e3)}catch(e){const t=e instanceof Error?e.message:"Failed to generate workspace";this.wizardState={...this.wizardState,generating:!1,error:t},this.requestUpdate(),this.showToast(t,"error")}}}async handleQuickSetup(e,t,n){E(()=>import("./setup-DDvbMoK2.js"),[],import.meta.url).then(async({quickSetup:s})=>{await s(this,e,t,n)&&(this.setTab("chat"),E(async()=>{const{loadChecklist:i}=await import("./setup-DDvbMoK2.js");return{loadChecklist:i}},[],import.meta.url).then(({loadChecklist:i})=>i(this)))})}handleLoadSetupChecklist(){E(async()=>{const{loadChecklist:e}=await import("./setup-DDvbMoK2.js");return{loadChecklist:e}},[],import.meta.url).then(({loadChecklist:e})=>e(this))}handleHideSetup(){E(async()=>{const{hideSetup:e}=await import("./setup-DDvbMoK2.js");return{hideSetup:e}},[],import.meta.url).then(({hideSetup:e})=>e(this))}handleRunAssessment(){this.client&&this.client.request("onboarding.assess",{}).then(()=>{this.handleLoadSetupChecklist()})}async handleDataRefresh(){if(!(!this.client||!this.connected)){this.dataLoading=!0,this.dataError=null;try{const e=await this.client.request("dataSources.list",{});this.dataSources=e.sources??[]}catch(e){this.dataError=e instanceof Error?e.message:"Failed to load data sources",console.error("[Data] Load error:",e)}finally{this.dataLoading=!1}}}handleDataSubtabChange(e){this.dataSubtab=e}handleDataConnectSource(e){const n=this.dataSources?.find(s=>s.id===e)?.name??e;this.handleStartChatWithPrompt(`Help me connect and configure the ${n} integration.`)}handleDataQuerySubmit(e){this.handleStartChatWithPrompt(`Query my connected data: ${e}`)}handleUpdateUserProfile(e,t){const n=e.trim().slice(0,50),s=t.trim();this.userName=n||"You",this.userAvatar=s||null,this.applySettings({...this.settings,userName:n,userAvatar:s})}async handleLoadIntegrations(){await(await E(()=>import("./onboarding-setup-eq3R6nNk.js"),[],import.meta.url)).loadIntegrations(this)}handleExpandCard(e){E(()=>import("./onboarding-setup-eq3R6nNk.js"),[],import.meta.url).then(t=>t.expandCard(this,e))}async handleLoadGuide(e){await(await E(()=>import("./onboarding-setup-eq3R6nNk.js"),[],import.meta.url)).loadGuide(this,e)}async handleTestIntegration(e){await(await E(()=>import("./onboarding-setup-eq3R6nNk.js"),[],import.meta.url)).testIntegration(this,e)}async handleConfigureIntegration(e,t){await(await E(()=>import("./onboarding-setup-eq3R6nNk.js"),[],import.meta.url)).configureIntegration(this,e,t)}handleUpdateConfigValue(e,t){this.onboardingConfigValues={...this.onboardingConfigValues,[e]:t}}handleSkipIntegration(e){E(()=>import("./onboarding-setup-eq3R6nNk.js"),[],import.meta.url).then(t=>t.skipIntegration(this,e))}async handleMarkOnboardingComplete(){if(!(!this.client||!this.connected))try{await this.client.request("onboarding.complete",{}),this.godmodeOptions&&(this.godmodeOptions={...this.godmodeOptions,"onboarding.complete":!0}),this.showSetupTab=!1,this.setTab("chat")}catch(e){console.error("[onboarding] Failed to mark complete:",e)}}render(){return K1(this)}};b([w()],y.prototype,"settings",2);b([w()],y.prototype,"password",2);b([w()],y.prototype,"tab",2);b([w()],y.prototype,"onboarding",2);b([w()],y.prototype,"connected",2);b([w()],y.prototype,"reconnecting",2);b([w()],y.prototype,"reconnectAttempt",2);b([w()],y.prototype,"theme",2);b([w()],y.prototype,"themeResolved",2);b([w()],y.prototype,"hello",2);b([w()],y.prototype,"lastError",2);b([w()],y.prototype,"eventLog",2);b([w()],y.prototype,"assistantName",2);b([w()],y.prototype,"assistantAvatar",2);b([w()],y.prototype,"assistantAgentId",2);b([w()],y.prototype,"userName",2);b([w()],y.prototype,"userAvatar",2);b([w()],y.prototype,"sessionKey",2);b([w()],y.prototype,"sessionPickerOpen",2);b([w()],y.prototype,"sessionPickerPosition",2);b([w()],y.prototype,"sessionPickerSearch",2);b([w()],y.prototype,"sessionSearchOpen",2);b([w()],y.prototype,"sessionSearchPosition",2);b([w()],y.prototype,"sessionSearchQuery",2);b([w()],y.prototype,"sessionSearchResults",2);b([w()],y.prototype,"sessionSearchLoading",2);b([w()],y.prototype,"profilePopoverOpen",2);b([w()],y.prototype,"profileEditName",2);b([w()],y.prototype,"profileEditAvatar",2);b([w()],y.prototype,"editingTabKey",2);b([w()],y.prototype,"chatLoading",2);b([w()],y.prototype,"chatSending",2);b([w()],y.prototype,"chatSendingSessionKey",2);b([w()],y.prototype,"chatMessage",2);b([w()],y.prototype,"chatDrafts",2);b([w()],y.prototype,"chatMessages",2);b([w()],y.prototype,"chatToolMessages",2);b([w()],y.prototype,"chatStream",2);b([w()],y.prototype,"chatStreamStartedAt",2);b([w()],y.prototype,"chatRunId",2);b([w()],y.prototype,"currentToolName",2);b([w()],y.prototype,"currentToolInfo",2);b([w()],y.prototype,"workingSessions",2);b([w()],y.prototype,"compactionStatus",2);b([w()],y.prototype,"chatAvatarUrl",2);b([w()],y.prototype,"chatThinkingLevel",2);b([w()],y.prototype,"chatQueue",2);b([w()],y.prototype,"chatAttachments",2);b([w()],y.prototype,"pendingRetry",2);b([w()],y.prototype,"autoRetryAfterCompact",2);b([w()],y.prototype,"sidebarOpen",2);b([w()],y.prototype,"sidebarContent",2);b([w()],y.prototype,"sidebarError",2);b([w()],y.prototype,"sidebarMimeType",2);b([w()],y.prototype,"sidebarFilePath",2);b([w()],y.prototype,"sidebarTitle",2);b([w()],y.prototype,"splitRatio",2);b([w()],y.prototype,"lightbox",2);b([w()],y.prototype,"driveAccounts",2);b([w()],y.prototype,"showDrivePicker",2);b([w()],y.prototype,"driveUploading",2);b([w()],y.prototype,"updateStatus",2);b([w()],y.prototype,"updateLoading",2);b([w()],y.prototype,"updateError",2);b([w()],y.prototype,"updateLastChecked",2);b([w()],y.prototype,"nodesLoading",2);b([w()],y.prototype,"nodes",2);b([w()],y.prototype,"devicesLoading",2);b([w()],y.prototype,"devicesError",2);b([w()],y.prototype,"devicesList",2);b([w()],y.prototype,"execApprovalsLoading",2);b([w()],y.prototype,"execApprovalsSaving",2);b([w()],y.prototype,"execApprovalsDirty",2);b([w()],y.prototype,"execApprovalsSnapshot",2);b([w()],y.prototype,"execApprovalsForm",2);b([w()],y.prototype,"execApprovalsSelectedAgent",2);b([w()],y.prototype,"execApprovalsTarget",2);b([w()],y.prototype,"execApprovalsTargetNodeId",2);b([w()],y.prototype,"execApprovalQueue",2);b([w()],y.prototype,"execApprovalBusy",2);b([w()],y.prototype,"execApprovalError",2);b([w()],y.prototype,"pendingGatewayUrl",2);b([w()],y.prototype,"configLoading",2);b([w()],y.prototype,"configRaw",2);b([w()],y.prototype,"configRawOriginal",2);b([w()],y.prototype,"configValid",2);b([w()],y.prototype,"configIssues",2);b([w()],y.prototype,"configSaving",2);b([w()],y.prototype,"configApplying",2);b([w()],y.prototype,"updateRunning",2);b([w()],y.prototype,"applySessionKey",2);b([w()],y.prototype,"configSnapshot",2);b([w()],y.prototype,"configSchema",2);b([w()],y.prototype,"configSchemaVersion",2);b([w()],y.prototype,"configSchemaLoading",2);b([w()],y.prototype,"configUiHints",2);b([w()],y.prototype,"configForm",2);b([w()],y.prototype,"configFormOriginal",2);b([w()],y.prototype,"configFormDirty",2);b([w()],y.prototype,"configFormMode",2);b([w()],y.prototype,"configSearchQuery",2);b([w()],y.prototype,"configActiveSection",2);b([w()],y.prototype,"configActiveSubsection",2);b([w()],y.prototype,"channelsLoading",2);b([w()],y.prototype,"channelsSnapshot",2);b([w()],y.prototype,"channelsError",2);b([w()],y.prototype,"channelsLastSuccess",2);b([w()],y.prototype,"whatsappLoginMessage",2);b([w()],y.prototype,"whatsappLoginQrDataUrl",2);b([w()],y.prototype,"whatsappLoginConnected",2);b([w()],y.prototype,"whatsappBusy",2);b([w()],y.prototype,"nostrProfileFormState",2);b([w()],y.prototype,"nostrProfileAccountId",2);b([w()],y.prototype,"presenceLoading",2);b([w()],y.prototype,"presenceEntries",2);b([w()],y.prototype,"presenceError",2);b([w()],y.prototype,"presenceStatus",2);b([w()],y.prototype,"agentsLoading",2);b([w()],y.prototype,"agentsList",2);b([w()],y.prototype,"agentsError",2);b([w()],y.prototype,"sessionsLoading",2);b([w()],y.prototype,"sessionsResult",2);b([w()],y.prototype,"sessionsError",2);b([w()],y.prototype,"sessionsFilterActive",2);b([w()],y.prototype,"sessionsFilterLimit",2);b([w()],y.prototype,"sessionsIncludeGlobal",2);b([w()],y.prototype,"sessionsIncludeUnknown",2);b([w()],y.prototype,"archivedSessions",2);b([w()],y.prototype,"archivedSessionsLoading",2);b([w()],y.prototype,"archivedSessionsExpanded",2);b([w()],y.prototype,"cronLoading",2);b([w()],y.prototype,"cronJobs",2);b([w()],y.prototype,"cronStatus",2);b([w()],y.prototype,"cronError",2);b([w()],y.prototype,"cronForm",2);b([w()],y.prototype,"cronRunsJobId",2);b([w()],y.prototype,"cronRuns",2);b([w()],y.prototype,"cronBusy",2);b([w()],y.prototype,"workspaceNeedsSetup",2);b([w()],y.prototype,"onboardingPhase",2);b([w()],y.prototype,"onboardingData",2);b([w()],y.prototype,"onboardingActive",2);b([w()],y.prototype,"wizardActive",2);b([w()],y.prototype,"wizardState",2);b([w()],y.prototype,"showSetupTab",2);b([w()],y.prototype,"setupChecklist",2);b([w()],y.prototype,"setupChecklistLoading",2);b([w()],y.prototype,"setupQuickDone",2);b([w()],y.prototype,"onboardingIntegrations",2);b([w()],y.prototype,"onboardingCoreProgress",2);b([w()],y.prototype,"onboardingExpandedCard",2);b([w()],y.prototype,"onboardingLoadingGuide",2);b([w()],y.prototype,"onboardingActiveGuide",2);b([w()],y.prototype,"onboardingTestingId",2);b([w()],y.prototype,"onboardingTestResult",2);b([w()],y.prototype,"onboardingConfigValues",2);b([w()],y.prototype,"onboardingProgress",2);b([w()],y.prototype,"workspaces",2);b([w()],y.prototype,"selectedWorkspace",2);b([w()],y.prototype,"workspacesSearchQuery",2);b([w()],y.prototype,"workspaceItemSearchQuery",2);b([w()],y.prototype,"workspacesLoading",2);b([w()],y.prototype,"workspacesCreateLoading",2);b([w()],y.prototype,"workspacesError",2);b([w()],y.prototype,"workspaceExpandedFolders",2);b([w()],y.prototype,"allTasks",2);b([w()],y.prototype,"taskFilter",2);b([w()],y.prototype,"taskSort",2);b([w()],y.prototype,"showCompletedTasks",2);b([w()],y.prototype,"editingTaskId",2);b([w()],y.prototype,"workspaceBrowsePath",2);b([w()],y.prototype,"workspaceBrowseEntries",2);b([w()],y.prototype,"workspaceBreadcrumbs",2);b([w()],y.prototype,"workspaceBrowseSearchQuery",2);b([w()],y.prototype,"workspaceBrowseSearchResults",2);b([w()],y.prototype,"myDayLoading",2);b([w()],y.prototype,"myDayError",2);b([w()],y.prototype,"todaySelectedDate",2);b([w()],y.prototype,"todayViewMode",2);b([w()],y.prototype,"dailyBrief",2);b([w()],y.prototype,"dailyBriefLoading",2);b([w()],y.prototype,"dailyBriefError",2);b([w()],y.prototype,"agentLog",2);b([w()],y.prototype,"agentLogLoading",2);b([w()],y.prototype,"agentLogError",2);b([w()],y.prototype,"briefNotes",2);b([w()],y.prototype,"todayTasks",2);b([w()],y.prototype,"todayTasksLoading",2);b([w()],y.prototype,"todayEditingTaskId",2);b([w()],y.prototype,"todayShowCompleted",2);b([w()],y.prototype,"allyPanelOpen",2);b([w()],y.prototype,"allyMessages",2);b([w()],y.prototype,"allyStream",2);b([w()],y.prototype,"allyDraft",2);b([w()],y.prototype,"allyUnread",2);b([w()],y.prototype,"allySending",2);b([w()],y.prototype,"allyWorking",2);b([w()],y.prototype,"allyAttachments",2);b([w()],y.prototype,"todayQueueResults",2);b([w()],y.prototype,"chatPrivateMode",2);b([w()],y.prototype,"privateSessions",2);b([w()],y.prototype,"goals",2);b([w()],y.prototype,"goalsLoading",2);b([w()],y.prototype,"goalsError",2);b([w()],y.prototype,"dataSources",2);b([w()],y.prototype,"dataLoading",2);b([w()],y.prototype,"dataError",2);b([w()],y.prototype,"dataSubtab",2);b([w()],y.prototype,"dynamicSlots",2);b([w()],y.prototype,"workProjects",2);b([w()],y.prototype,"workLoading",2);b([w()],y.prototype,"workError",2);b([w()],y.prototype,"workExpandedProjects",2);b([w()],y.prototype,"workProjectFiles",2);b([w()],y.prototype,"workDetailLoading",2);b([w()],y.prototype,"skillsLoading",2);b([w()],y.prototype,"skillsReport",2);b([w()],y.prototype,"skillsError",2);b([w()],y.prototype,"skillsFilter",2);b([w()],y.prototype,"skillEdits",2);b([w()],y.prototype,"skillsBusyKey",2);b([w()],y.prototype,"skillMessages",2);b([w()],y.prototype,"debugLoading",2);b([w()],y.prototype,"debugStatus",2);b([w()],y.prototype,"debugHealth",2);b([w()],y.prototype,"debugModels",2);b([w()],y.prototype,"debugHeartbeat",2);b([w()],y.prototype,"debugCallMethod",2);b([w()],y.prototype,"debugCallParams",2);b([w()],y.prototype,"debugCallResult",2);b([w()],y.prototype,"debugCallError",2);b([w()],y.prototype,"logsLoading",2);b([w()],y.prototype,"logsError",2);b([w()],y.prototype,"logsFile",2);b([w()],y.prototype,"logsEntries",2);b([w()],y.prototype,"logsFilterText",2);b([w()],y.prototype,"logsLevelFilters",2);b([w()],y.prototype,"logsAutoFollow",2);b([w()],y.prototype,"logsTruncated",2);b([w()],y.prototype,"logsCursor",2);b([w()],y.prototype,"logsLastFetchAt",2);b([w()],y.prototype,"logsLimit",2);b([w()],y.prototype,"logsMaxBytes",2);b([w()],y.prototype,"logsAtBottom",2);b([w()],y.prototype,"toasts",2);b([w()],y.prototype,"chatUserNearBottom",2);b([w()],y.prototype,"chatNewMessagesBelow",2);b([w()],y.prototype,"consciousnessStatus",2);b([w()],y.prototype,"focusPulseData",2);b([w()],y.prototype,"trustTrackerData",2);b([w()],y.prototype,"trustTrackerLoading",2);b([w()],y.prototype,"guardrailsData",2);b([w()],y.prototype,"guardrailsLoading",2);b([w()],y.prototype,"guardrailsShowAddForm",2);b([w()],y.prototype,"missionControlData",2);b([w()],y.prototype,"missionControlLoading",2);b([w()],y.prototype,"missionControlError",2);b([w()],y.prototype,"missionControlFullControl",2);b([w()],y.prototype,"godmodeOptions",2);b([w()],y.prototype,"godmodeOptionsLoading",2);b([w()],y.prototype,"dashboardsList",2);b([w()],y.prototype,"dashboardsLoading",2);b([w()],y.prototype,"dashboardsError",2);b([w()],y.prototype,"activeDashboardId",2);b([w()],y.prototype,"activeDashboardHtml",2);b([w()],y.prototype,"activeDashboardManifest",2);b([w()],y.prototype,"dashboardChatOpen",2);b([w()],y.prototype,"secondBrainSubtab",2);b([w()],y.prototype,"secondBrainLoading",2);b([w()],y.prototype,"secondBrainError",2);b([w()],y.prototype,"secondBrainIdentity",2);b([w()],y.prototype,"secondBrainMemoryBank",2);b([w()],y.prototype,"secondBrainAiPacket",2);b([w()],y.prototype,"secondBrainSourcesData",2);b([w()],y.prototype,"secondBrainResearchData",2);b([w()],y.prototype,"secondBrainResearchAddFormOpen",2);b([w()],y.prototype,"secondBrainResearchAddForm",2);b([w()],y.prototype,"secondBrainResearchCategories",2);b([w()],y.prototype,"secondBrainSelectedEntry",2);b([w()],y.prototype,"secondBrainSearchQuery",2);b([w()],y.prototype,"secondBrainSyncing",2);b([w()],y.prototype,"secondBrainBrowsingFolder",2);b([w()],y.prototype,"secondBrainFolderEntries",2);b([w()],y.prototype,"secondBrainFolderName",2);b([w()],y.prototype,"secondBrainFileTree",2);b([w()],y.prototype,"secondBrainFileTreeLoading",2);b([w()],y.prototype,"secondBrainFileSearchQuery",2);b([w()],y.prototype,"secondBrainFileSearchResults",2);y=b([kc("godmode-app")],y);