tide-commander 1.67.0 → 1.68.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{BossLogsModal-DCwS2sUl.js → BossLogsModal-BAAom9o2.js} +1 -1
- package/dist/assets/{BossSpawnModal-G7rDRY0s.js → BossSpawnModal-toDplDkF.js} +1 -1
- package/dist/assets/{ControlsModal-CGRAjHup.js → ControlsModal-D03U6gmX.js} +1 -1
- package/dist/assets/{DockerLogsModal-D2Q30Fua.js → DockerLogsModal-BNSsrzrl.js} +1 -1
- package/dist/assets/{EmbeddedEditor-0YnlrcwV.js → EmbeddedEditor-BYhdfoCE.js} +1 -1
- package/dist/assets/{GmailOAuthSetup-jvEwPGIi.js → GmailOAuthSetup-myZ2ZrcR.js} +1 -1
- package/dist/assets/{GoogleOAuthSetup-BtG-j2uF.js → GoogleOAuthSetup-CcXj76ys.js} +1 -1
- package/dist/assets/{IframeModal-DObwdZKc.js → IframeModal-Dz7GP3Cv.js} +1 -1
- package/dist/assets/{IntegrationsPanel-BJM7-5-l.js → IntegrationsPanel-BcuHSs4k.js} +2 -2
- package/dist/assets/{LogViewerModal-DO4L6d1p.js → LogViewerModal-xUgsZ9ej.js} +1 -1
- package/dist/assets/{MonitoringModal-5GsKsJnc.js → MonitoringModal-C2Y2xSlC.js} +1 -1
- package/dist/assets/{PM2LogsModal-jb2FyI3U.js → PM2LogsModal-_jrHQUo9.js} +1 -1
- package/dist/assets/{RestoreArchivedAreaModal-D1L6h6km.js → RestoreArchivedAreaModal-ChVg52z-.js} +1 -1
- package/dist/assets/{Scene2DCanvas-D48fjiT7.js → Scene2DCanvas-B3W853kK.js} +1 -1
- package/dist/assets/{SceneManager-CDSFCv1W.js → SceneManager-B18djKZB.js} +5 -5
- package/dist/assets/{SkillsPanel-C4PPXR75.js → SkillsPanel-H1LGmiQa.js} +1 -1
- package/dist/assets/{SpawnModal-D_s9EvPc.js → SpawnModal-C6jHLOqe.js} +1 -1
- package/dist/assets/{SubordinateAssignmentModal-DtQXYtTK.js → SubordinateAssignmentModal-D7SFd1PQ.js} +1 -1
- package/dist/assets/{TriggerManagerPanel-f-yMJ3Qq.js → TriggerManagerPanel-BHydg20p.js} +2 -2
- package/dist/assets/{WorkflowEditorPanel-BGrkMH_W.js → WorkflowEditorPanel-CV2Uyz3q.js} +1 -1
- package/dist/assets/{index-Tf75NFV0.js → index-6yiJ4K77.js} +5 -5
- package/dist/assets/{index-sbUW8LEQ.js → index-9QRHHhjy.js} +1 -1
- package/dist/assets/index-BUHCV_MS.js +1 -0
- package/dist/assets/index-Bymy4ZcD.js +1 -0
- package/dist/assets/{index-C3IFhz-6.js → index-C46pFKRu.js} +1 -1
- package/dist/assets/{index-CrvjzE7c.js → index-CSfdM2wC.js} +2 -2
- package/dist/assets/index-CbwV9efF.css +1 -0
- package/dist/assets/{index-Dl8mT_ZQ.js → index-CvN92QjN.js} +1 -1
- package/dist/assets/{index-B2Y8957o.js → index-DGiQZp-V.js} +3 -3
- package/dist/assets/{index-f_yYt9B7.js → index-DajufGc7.js} +4 -4
- package/dist/assets/{main-DoRHB7F9.js → main-Cqo-Awpr.js} +77 -77
- package/dist/assets/main-PqjE2LNi.css +1 -0
- package/dist/assets/{web-CQnGhMaw.js → web-C8dPHvwd.js} +1 -1
- package/dist/assets/{web-Cq-ByMZ4.js → web-Df6f3cdZ.js} +1 -1
- package/dist/index.html +2 -2
- package/dist/src/packages/server/claude/runner/restart-policy.js +13 -14
- package/dist/src/packages/server/codex/backend.js +22 -5
- package/package.json +1 -1
- package/dist/assets/index-0uR1rrxK.js +0 -1
- package/dist/assets/index-DKZCR5P7.js +0 -1
- package/dist/assets/index-uNQFgIER.css +0 -1
- package/dist/assets/main-DYZn_CH2.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b_ as s}from"./main-Cqo-Awpr.js";import"./vendor-react--Eh9ivFN.js";import"./vendor-three-Chj50gSY.js";class l extends s{constructor(){super(...arguments),this.pending=[],this.deliveredNotifications=[],this.hasNotificationSupport=()=>{if(!("Notification"in window)||!Notification.requestPermission)return!1;if(Notification.permission!=="granted")try{new Notification("")}catch(i){if(i instanceof Error&&i.name==="TypeError")return!1}return!0}}async getDeliveredNotifications(){const i=[];for(const t of this.deliveredNotifications){const e={title:t.title,id:parseInt(t.tag),body:t.body};i.push(e)}return{notifications:i}}async removeDeliveredNotifications(i){for(const t of i.notifications){const e=this.deliveredNotifications.find(n=>n.tag===String(t.id));e==null||e.close(),this.deliveredNotifications=this.deliveredNotifications.filter(()=>!e)}}async removeAllDeliveredNotifications(){for(const i of this.deliveredNotifications)i.close();this.deliveredNotifications=[]}async createChannel(){throw this.unimplemented("Not implemented on web.")}async deleteChannel(){throw this.unimplemented("Not implemented on web.")}async listChannels(){throw this.unimplemented("Not implemented on web.")}async schedule(i){if(!this.hasNotificationSupport())throw this.unavailable("Notifications not supported in this browser.");for(const t of i.notifications)this.sendNotification(t);return{notifications:i.notifications.map(t=>({id:t.id}))}}async getPending(){return{notifications:this.pending}}async registerActionTypes(){throw this.unimplemented("Not implemented on web.")}async cancel(i){this.pending=this.pending.filter(t=>!i.notifications.find(e=>e.id===t.id))}async areEnabled(){const{display:i}=await this.checkPermissions();return{value:i==="granted"}}async changeExactNotificationSetting(){throw this.unimplemented("Not implemented on web.")}async checkExactNotificationSetting(){throw this.unimplemented("Not implemented on web.")}async requestPermissions(){if(!this.hasNotificationSupport())throw this.unavailable("Notifications not supported in this browser.");return{display:this.transformNotificationPermission(await Notification.requestPermission())}}async checkPermissions(){if(!this.hasNotificationSupport())throw this.unavailable("Notifications not supported in this browser.");return{display:this.transformNotificationPermission(Notification.permission)}}transformNotificationPermission(i){switch(i){case"granted":return"granted";case"denied":return"denied";default:return"prompt"}}sendPending(){var i;const t=[],e=new Date().getTime();for(const n of this.pending)!((i=n.schedule)===null||i===void 0)&&i.at&&n.schedule.at.getTime()<=e&&(this.buildNotification(n),t.push(n));this.pending=this.pending.filter(n=>!t.find(o=>o===n))}sendNotification(i){var t;if(!((t=i.schedule)===null||t===void 0)&&t.at){const e=i.schedule.at.getTime()-new Date().getTime();this.pending.push(i),setTimeout(()=>{this.sendPending()},e);return}this.buildNotification(i)}buildNotification(i){const t=new Notification(i.title,{body:i.body,tag:String(i.id)});return t.addEventListener("click",this.onClick.bind(this,i),!1),t.addEventListener("show",this.onShow.bind(this,i),!1),t.addEventListener("close",()=>{this.deliveredNotifications=this.deliveredNotifications.filter(()=>!this)},!1),this.deliveredNotifications.push(t),t}onClick(i){const t={actionId:"tap",notification:i};this.notifyListeners("localNotificationActionPerformed",t)}onShow(i){this.notifyListeners("localNotificationReceived",i)}}export{l as LocalNotificationsWeb};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b_ as a}from"./main-Cqo-Awpr.js";import{ImpactStyle as i,NotificationType as r}from"./index-CSfdM2wC.js";import"./vendor-react--Eh9ivFN.js";import"./vendor-three-Chj50gSY.js";class h extends a{constructor(){super(...arguments),this.selectionStarted=!1}async impact(t){const e=this.patternForImpact(t==null?void 0:t.style);this.vibrateWithPattern(e)}async notification(t){const e=this.patternForNotification(t==null?void 0:t.type);this.vibrateWithPattern(e)}async vibrate(t){const e=(t==null?void 0:t.duration)||300;this.vibrateWithPattern([e])}async selectionStart(){this.selectionStarted=!0}async selectionChanged(){this.selectionStarted&&this.vibrateWithPattern([70])}async selectionEnd(){this.selectionStarted=!1}patternForImpact(t=i.Heavy){return t===i.Medium?[43]:t===i.Light?[20]:[61]}patternForNotification(t=r.Success){return t===r.Warning?[30,40,30,50,60]:t===r.Error?[27,45,50]:[35,65,21]}vibrateWithPattern(t){if(navigator.vibrate)navigator.vibrate(t);else throw this.unavailable("Browser does not support the vibrate API")}}export{h as HapticsWeb};
|
package/dist/index.html
CHANGED
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
<link rel="icon" type="image/png" sizes="16x16" href="/assets/icons/favicon-16x16.png" />
|
|
23
23
|
<link rel="apple-touch-icon" sizes="180x180" href="/assets/icons/apple-touch-icon.png" />
|
|
24
24
|
<title>Tide Commander</title>
|
|
25
|
-
<script type="module" crossorigin src="/assets/main-
|
|
25
|
+
<script type="module" crossorigin src="/assets/main-Cqo-Awpr.js"></script>
|
|
26
26
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react--Eh9ivFN.js">
|
|
27
27
|
<link rel="modulepreload" crossorigin href="/assets/vendor-three-Chj50gSY.js">
|
|
28
|
-
<link rel="stylesheet" crossorigin href="/assets/main-
|
|
28
|
+
<link rel="stylesheet" crossorigin href="/assets/main-PqjE2LNi.css">
|
|
29
29
|
</head>
|
|
30
30
|
<body>
|
|
31
31
|
<div id="app"></div>
|
|
@@ -24,29 +24,28 @@ export class RunnerRestartPolicy {
|
|
|
24
24
|
log.log(`🔄 [AUTO-RESTART] No last request stored for ${agentId}, cannot restart`);
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
this.callbacks.onError(agentId, `Process crashed immediately (${runtime}ms) - not auto-restarting. Check Claude Code installation.`);
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
if (exitCode === 0) {
|
|
34
|
-
log.log(`🔄 [AUTO-RESTART] Process ${agentId} exited cleanly (code 0), not restarting`);
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
27
|
+
// Normal-exit conditions must be checked BEFORE the "runtime < 5s" crash
|
|
28
|
+
// heuristic, because single-shot backends like Codex routinely finish a
|
|
29
|
+
// turn in under 5 seconds — classifying that as a crash wedges the agent.
|
|
37
30
|
if (signal === 'SIGINT' || signal === 'SIGTERM') {
|
|
38
31
|
log.log(`🔄 [AUTO-RESTART] Process ${agentId} was stopped intentionally (${signal}), not restarting`);
|
|
39
32
|
return;
|
|
40
33
|
}
|
|
41
|
-
// If the process had completed its turn and was waiting for new input,
|
|
42
|
-
// its exit is a normal completion — not a crash. This is especially
|
|
43
|
-
// important for backends like Codex that exit after each task rather
|
|
44
|
-
// than staying resident for stdin-based follow-ups.
|
|
45
34
|
if (activeProcess.turnState === 'waiting_for_input') {
|
|
46
35
|
log.log(`🔄 [AUTO-RESTART] Process ${agentId} exited after completing its turn (turnState=waiting_for_input), not restarting`);
|
|
47
36
|
this.callbacks.onComplete(agentId, true);
|
|
48
37
|
return;
|
|
49
38
|
}
|
|
39
|
+
if (exitCode === 0) {
|
|
40
|
+
log.log(`🔄 [AUTO-RESTART] Process ${agentId} exited cleanly (code 0), not restarting`);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const runtime = Date.now() - activeProcess.startTime;
|
|
44
|
+
if (runtime < MIN_RUNTIME_FOR_RESTART_MS) {
|
|
45
|
+
log.error(`🔄 [AUTO-RESTART] Process ${agentId} died after only ${runtime}ms - NOT restarting (likely config error)`);
|
|
46
|
+
this.callbacks.onError(agentId, `Process crashed immediately (${runtime}ms) - not auto-restarting. Check Claude Code installation.`);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
50
49
|
const restartCount = activeProcess.restartCount || 0;
|
|
51
50
|
const lastRestartTime = activeProcess.lastRestartTime || 0;
|
|
52
51
|
const timeSinceLastRestart = Date.now() - lastRestartTime;
|
|
@@ -55,9 +55,13 @@ export function buildCodexPrompt(config) {
|
|
|
55
55
|
export class CodexBackend {
|
|
56
56
|
name = 'codex';
|
|
57
57
|
parser = new CodexJsonEventParser({ enableFileDiffEnrichment: true });
|
|
58
|
+
// Prompts are passed via stdin (not argv) so large prompts (skills + system
|
|
59
|
+
// prompt + class instructions) don't blow past tmux's ~16KB argv limit,
|
|
60
|
+
// which silently rejects the spawn with "command too long".
|
|
61
|
+
pendingStdinPrompt;
|
|
58
62
|
buildArgs(config) {
|
|
59
63
|
this.parser.setWorkingDirectory(config.workingDir);
|
|
60
|
-
|
|
64
|
+
this.pendingStdinPrompt = buildCodexPrompt(config);
|
|
61
65
|
const args = ['exec', '--experimental-json'];
|
|
62
66
|
const codexConfig = config.codexConfig;
|
|
63
67
|
const fullAuto = codexConfig?.fullAuto !== false;
|
|
@@ -87,11 +91,14 @@ export class CodexBackend {
|
|
|
87
91
|
if (shouldPassCodexModel(config.model)) {
|
|
88
92
|
args.push('--model', config.model);
|
|
89
93
|
}
|
|
94
|
+
// `-` in the PROMPT positional tells codex to read the prompt from stdin.
|
|
95
|
+
// Omitting it works too for `exec`, but being explicit makes the intent
|
|
96
|
+
// clear and is required by the `resume` subcommand.
|
|
90
97
|
if (config.sessionId) {
|
|
91
|
-
args.push('resume', config.sessionId,
|
|
98
|
+
args.push('resume', config.sessionId, '-');
|
|
92
99
|
return args;
|
|
93
100
|
}
|
|
94
|
-
args.push(
|
|
101
|
+
args.push('-');
|
|
95
102
|
return args;
|
|
96
103
|
}
|
|
97
104
|
parseEvent(rawEvent) {
|
|
@@ -155,9 +162,19 @@ export class CodexBackend {
|
|
|
155
162
|
return {};
|
|
156
163
|
}
|
|
157
164
|
requiresStdinInput() {
|
|
158
|
-
return
|
|
165
|
+
return true;
|
|
166
|
+
}
|
|
167
|
+
shouldCloseStdinAfterPrompt() {
|
|
168
|
+
// codex exec reads the prompt once then processes. EOF on stdin lets it
|
|
169
|
+
// start without waiting for more input.
|
|
170
|
+
return true;
|
|
159
171
|
}
|
|
160
172
|
formatStdinInput(prompt) {
|
|
161
|
-
|
|
173
|
+
// buildArgs caches the fully-assembled prompt (including injected
|
|
174
|
+
// system/area/class sections). Fall back to the raw prompt for the
|
|
175
|
+
// sendMessage path where buildArgs isn't re-invoked.
|
|
176
|
+
const full = this.pendingStdinPrompt ?? prompt;
|
|
177
|
+
this.pendingStdinPrompt = undefined;
|
|
178
|
+
return full;
|
|
162
179
|
}
|
|
163
180
|
}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as f,I as H,a1 as He,K as Ye,Z as Je,bz as Xe,r as A,s as te,bA as Ie,X as de,u as Ee}from"./main-DoRHB7F9.js";import"./vendor-react--Eh9ivFN.js";import"./vendor-three-Chj50gSY.js";function Z(t){return Array.isArray?Array.isArray(t):Te(t)==="[object Array]"}function Ze(t){if(typeof t=="string")return t;let e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function qe(t){return t==null?"":Ze(t)}function J(t){return typeof t=="string"}function _e(t){return typeof t=="number"}function et(t){return t===!0||t===!1||tt(t)&&Te(t)=="[object Boolean]"}function $e(t){return typeof t=="object"}function tt(t){return $e(t)&&t!==null}function P(t){return t!=null}function fe(t){return!t.trim().length}function Te(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const st="Incorrect 'index' type",nt=t=>`Invalid value for key ${t}`,rt=t=>`Pattern length exceeds max of ${t}.`,it=t=>`Missing ${t} property in key`,ct=t=>`Property 'weight' in key '${t}' must be a positive integer`,ve=Object.prototype.hasOwnProperty;class ot{constructor(e){this._keys=[],this._keyMap={};let s=0;e.forEach(n=>{let r=Pe(n);this._keys.push(r),this._keyMap[r.id]=r,s+=r.weight}),this._keys.forEach(n=>{n.weight/=s})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Pe(t){let e=null,s=null,n=null,r=1,i=null;if(J(t)||Z(t))n=t,e=be(t),s=me(t);else{if(!ve.call(t,"name"))throw new Error(it("name"));const c=t.name;if(n=c,ve.call(t,"weight")&&(r=t.weight,r<=0))throw new Error(ct(c));e=be(c),s=me(c),i=t.getFn}return{path:e,id:s,weight:r,src:n,getFn:i}}function be(t){return Z(t)?t:t.split(".")}function me(t){return Z(t)?t.join("."):t}function at(t,e){let s=[],n=!1;const r=(i,c,a)=>{if(P(i))if(!c[a])s.push(i);else{let u=c[a];const l=i[u];if(!P(l))return;if(a===c.length-1&&(J(l)||_e(l)||et(l)))s.push(qe(l));else if(Z(l)){n=!0;for(let h=0,d=l.length;h<d;h+=1)r(l[h],c,a+1)}else c.length&&r(l,c,a+1)}};return r(t,J(e)?e.split("."):e,0),n?s:s[0]}const ut={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},lt={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1},ht={location:0,threshold:.6,distance:100},dt={useExtendedSearch:!1,getFn:at,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var p={...lt,...ut,...ht,...dt};const ft=/[^ ]+/g;function mt(t=1,e=3){const s=new Map,n=Math.pow(10,e);return{get(r){const i=r.match(ft).length;if(s.has(i))return s.get(i);const c=1/Math.pow(i,.5*t),a=parseFloat(Math.round(c*n)/n);return s.set(i,a),a},clear(){s.clear()}}}class Ce{constructor({getFn:e=p.getFn,fieldNormWeight:s=p.fieldNormWeight}={}){this.norm=mt(s,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((s,n)=>{this._keysMap[s.id]=n})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,J(this.docs[0])?this.docs.forEach((e,s)=>{this._addString(e,s)}):this.docs.forEach((e,s)=>{this._addObject(e,s)}),this.norm.clear())}add(e){const s=this.size();J(e)?this._addString(e,s):this._addObject(e,s)}removeAt(e){this.records.splice(e,1);for(let s=e,n=this.size();s<n;s+=1)this.records[s].i-=1}getValueForItemAtKeyId(e,s){return e[this._keysMap[s]]}size(){return this.records.length}_addString(e,s){if(!P(e)||fe(e))return;let n={v:e,i:s,n:this.norm.get(e)};this.records.push(n)}_addObject(e,s){let n={i:s,$:{}};this.keys.forEach((r,i)=>{let c=r.getFn?r.getFn(e):this.getFn(e,r.path);if(P(c)){if(Z(c)){let a=[];const u=[{nestedArrIndex:-1,value:c}];for(;u.length;){const{nestedArrIndex:l,value:h}=u.pop();if(P(h))if(J(h)&&!fe(h)){let d={v:h,i:l,n:this.norm.get(h)};a.push(d)}else Z(h)&&h.forEach((d,m)=>{u.push({nestedArrIndex:m,value:d})})}n.$[i]=a}else if(J(c)&&!fe(c)){let a={v:c,n:this.norm.get(c)};n.$[i]=a}}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}}function Ke(t,e,{getFn:s=p.getFn,fieldNormWeight:n=p.fieldNormWeight}={}){const r=new Ce({getFn:s,fieldNormWeight:n});return r.setKeys(t.map(Pe)),r.setSources(e),r.create(),r}function pt(t,{getFn:e=p.getFn,fieldNormWeight:s=p.fieldNormWeight}={}){const{keys:n,records:r}=t,i=new Ce({getFn:e,fieldNormWeight:s});return i.setKeys(n),i.setIndexRecords(r),i}function ue(t,{errors:e=0,currentLocation:s=0,expectedLocation:n=0,distance:r=p.distance,ignoreLocation:i=p.ignoreLocation}={}){const c=e/t.length;if(i)return c;const a=Math.abs(n-s);return r?c+a/r:a?1:c}function gt(t=[],e=p.minMatchCharLength){let s=[],n=-1,r=-1,i=0;for(let c=t.length;i<c;i+=1){let a=t[i];a&&n===-1?n=i:!a&&n!==-1&&(r=i-1,r-n+1>=e&&s.push([n,r]),n=-1)}return t[i-1]&&i-n>=e&&s.push([n,i-1]),s}const se=32;function At(t,e,s,{location:n=p.location,distance:r=p.distance,threshold:i=p.threshold,findAllMatches:c=p.findAllMatches,minMatchCharLength:a=p.minMatchCharLength,includeMatches:u=p.includeMatches,ignoreLocation:l=p.ignoreLocation}={}){if(e.length>se)throw new Error(rt(se));const h=e.length,d=t.length,m=Math.max(0,Math.min(n,d));let g=i,y=m;const I=a>1||u,k=I?Array(d):[];let S;for(;(S=t.indexOf(e,y))>-1;){let E=ue(e,{currentLocation:S,expectedLocation:m,distance:r,ignoreLocation:l});if(g=Math.min(E,g),y=S+h,I){let C=0;for(;C<h;)k[S+C]=1,C+=1}}y=-1;let N=[],O=1,K=h+d;const ne=1<<h-1;for(let E=0;E<h;E+=1){let C=0,D=K;for(;C<D;)ue(e,{errors:E,currentLocation:m+D,expectedLocation:m,distance:r,ignoreLocation:l})<=g?C=D:K=D,D=Math.floor((K-C)/2+C);K=D;let $=Math.max(1,m-D+1),T=c?d:Math.min(m+D,d)+h,Q=Array(T+2);Q[T+1]=(1<<E)-1;for(let j=T;j>=$;j-=1){let X=j-1,oe=s[t.charAt(X)];if(I&&(k[X]=+!!oe),Q[j]=(Q[j+1]<<1|1)&oe,E&&(Q[j]|=(N[j+1]|N[j])<<1|1|N[j+1]),Q[j]&ne&&(O=ue(e,{errors:E,currentLocation:X,expectedLocation:m,distance:r,ignoreLocation:l}),O<=g)){if(g=O,y=X,y<=m)break;$=Math.max(1,2*m-y)}}if(ue(e,{errors:E+1,currentLocation:m,expectedLocation:m,distance:r,ignoreLocation:l})>g)break;N=Q}const G={isMatch:y>=0,score:Math.max(.001,O)};if(I){const E=gt(k,a);E.length?u&&(G.indices=E):G.isMatch=!1}return G}function yt(t){let e={};for(let s=0,n=t.length;s<n;s+=1){const r=t.charAt(s);e[r]=(e[r]||0)|1<<n-s-1}return e}const le=String.prototype.normalize?(t=>t.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(t=>t);class ze{constructor(e,{location:s=p.location,threshold:n=p.threshold,distance:r=p.distance,includeMatches:i=p.includeMatches,findAllMatches:c=p.findAllMatches,minMatchCharLength:a=p.minMatchCharLength,isCaseSensitive:u=p.isCaseSensitive,ignoreDiacritics:l=p.ignoreDiacritics,ignoreLocation:h=p.ignoreLocation}={}){if(this.options={location:s,threshold:n,distance:r,includeMatches:i,findAllMatches:c,minMatchCharLength:a,isCaseSensitive:u,ignoreDiacritics:l,ignoreLocation:h},e=u?e:e.toLowerCase(),e=l?le(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const d=(g,y)=>{this.chunks.push({pattern:g,alphabet:yt(g),startIndex:y})},m=this.pattern.length;if(m>se){let g=0;const y=m%se,I=m-y;for(;g<I;)d(this.pattern.substr(g,se),g),g+=se;if(y){const k=m-se;d(this.pattern.substr(k),k)}}else d(this.pattern,0)}searchIn(e){const{isCaseSensitive:s,ignoreDiacritics:n,includeMatches:r}=this.options;if(e=s?e:e.toLowerCase(),e=n?le(e):e,this.pattern===e){let I={isMatch:!0,score:0};return r&&(I.indices=[[0,e.length-1]]),I}const{location:i,distance:c,threshold:a,findAllMatches:u,minMatchCharLength:l,ignoreLocation:h}=this.options;let d=[],m=0,g=!1;this.chunks.forEach(({pattern:I,alphabet:k,startIndex:S})=>{const{isMatch:N,score:O,indices:K}=At(e,I,k,{location:i+S,distance:c,threshold:a,findAllMatches:u,minMatchCharLength:l,includeMatches:r,ignoreLocation:h});N&&(g=!0),m+=O,N&&K&&(d=[...d,...K])});let y={isMatch:g,score:g?m/this.chunks.length:1};return g&&r&&(y.indices=d),y}}class q{constructor(e){this.pattern=e}static isMultiMatch(e){return Se(e,this.multiRegex)}static isSingleMatch(e){return Se(e,this.singleRegex)}search(){}}function Se(t,e){const s=t.match(e);return s?s[1]:null}class xt extends q{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const s=e===this.pattern;return{isMatch:s,score:s?0:1,indices:[0,this.pattern.length-1]}}}class Et extends q{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const n=e.indexOf(this.pattern)===-1;return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class Ct extends q{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const s=e.startsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,this.pattern.length-1]}}}class wt extends q{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const s=!e.startsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,e.length-1]}}}class Ft extends q{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const s=e.endsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class Mt extends q{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const s=!e.endsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,e.length-1]}}}class Oe extends q{constructor(e,{location:s=p.location,threshold:n=p.threshold,distance:r=p.distance,includeMatches:i=p.includeMatches,findAllMatches:c=p.findAllMatches,minMatchCharLength:a=p.minMatchCharLength,isCaseSensitive:u=p.isCaseSensitive,ignoreDiacritics:l=p.ignoreDiacritics,ignoreLocation:h=p.ignoreLocation}={}){super(e),this._bitapSearch=new ze(e,{location:s,threshold:n,distance:r,includeMatches:i,findAllMatches:c,minMatchCharLength:a,isCaseSensitive:u,ignoreDiacritics:l,ignoreLocation:h})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class Qe extends q{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let s=0,n;const r=[],i=this.pattern.length;for(;(n=e.indexOf(this.pattern,s))>-1;)s=n+i,r.push([n,s-1]);const c=!!r.length;return{isMatch:c,score:c?0:1,indices:r}}}const pe=[xt,Qe,Ct,wt,Mt,Ft,Et,Oe],ke=pe.length,Dt=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,Bt="|";function It(t,e={}){return t.split(Bt).map(s=>{let n=s.trim().split(Dt).filter(i=>i&&!!i.trim()),r=[];for(let i=0,c=n.length;i<c;i+=1){const a=n[i];let u=!1,l=-1;for(;!u&&++l<ke;){const h=pe[l];let d=h.isMultiMatch(a);d&&(r.push(new h(d,e)),u=!0)}if(!u)for(l=-1;++l<ke;){const h=pe[l];let d=h.isSingleMatch(a);if(d){r.push(new h(d,e));break}}}return r})}const vt=new Set([Oe.type,Qe.type]);class bt{constructor(e,{isCaseSensitive:s=p.isCaseSensitive,ignoreDiacritics:n=p.ignoreDiacritics,includeMatches:r=p.includeMatches,minMatchCharLength:i=p.minMatchCharLength,ignoreLocation:c=p.ignoreLocation,findAllMatches:a=p.findAllMatches,location:u=p.location,threshold:l=p.threshold,distance:h=p.distance}={}){this.query=null,this.options={isCaseSensitive:s,ignoreDiacritics:n,includeMatches:r,minMatchCharLength:i,findAllMatches:a,ignoreLocation:c,location:u,threshold:l,distance:h},e=s?e:e.toLowerCase(),e=n?le(e):e,this.pattern=e,this.query=It(this.pattern,this.options)}static condition(e,s){return s.useExtendedSearch}searchIn(e){const s=this.query;if(!s)return{isMatch:!1,score:1};const{includeMatches:n,isCaseSensitive:r,ignoreDiacritics:i}=this.options;e=r?e:e.toLowerCase(),e=i?le(e):e;let c=0,a=[],u=0;for(let l=0,h=s.length;l<h;l+=1){const d=s[l];a.length=0,c=0;for(let m=0,g=d.length;m<g;m+=1){const y=d[m],{isMatch:I,indices:k,score:S}=y.search(e);if(I){if(c+=1,u+=S,n){const N=y.constructor.type;vt.has(N)?a=[...a,...k]:a.push(k)}}else{u=0,c=0,a.length=0;break}}if(c){let m={isMatch:!0,score:u/c};return n&&(m.indices=a),m}}return{isMatch:!1,score:1}}}const ge=[];function St(...t){ge.push(...t)}function Ae(t,e){for(let s=0,n=ge.length;s<n;s+=1){let r=ge[s];if(r.condition(t,e))return new r(t,e)}return new ze(t,e)}const he={AND:"$and",OR:"$or"},ye={PATH:"$path",PATTERN:"$val"},xe=t=>!!(t[he.AND]||t[he.OR]),kt=t=>!!t[ye.PATH],jt=t=>!Z(t)&&$e(t)&&!xe(t),je=t=>({[he.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function We(t,e,{auto:s=!0}={}){const n=r=>{let i=Object.keys(r);const c=kt(r);if(!c&&i.length>1&&!xe(r))return n(je(r));if(jt(r)){const u=c?r[ye.PATH]:i[0],l=c?r[ye.PATTERN]:r[u];if(!J(l))throw new Error(nt(u));const h={keyId:me(u),pattern:l};return s&&(h.searcher=Ae(l,e)),h}let a={children:[],operator:i[0]};return i.forEach(u=>{const l=r[u];Z(l)&&l.forEach(h=>{a.children.push(n(h))})}),a};return xe(t)||(t=je(t)),n(t)}function Rt(t,{ignoreFieldNorm:e=p.ignoreFieldNorm}){t.forEach(s=>{let n=1;s.matches.forEach(({key:r,norm:i,score:c})=>{const a=r?r.weight:null;n*=Math.pow(c===0&&a?Number.EPSILON:c,(a||1)*(e?1:i))}),s.score=n})}function Lt(t,e){const s=t.matches;e.matches=[],P(s)&&s.forEach(n=>{if(!P(n.indices)||!n.indices.length)return;const{indices:r,value:i}=n;let c={indices:r,value:i};n.key&&(c.key=n.key.src),n.idx>-1&&(c.refIndex=n.idx),e.matches.push(c)})}function Nt(t,e){e.score=t.score}function _t(t,e,{includeMatches:s=p.includeMatches,includeScore:n=p.includeScore}={}){const r=[];return s&&r.push(Lt),n&&r.push(Nt),t.map(i=>{const{idx:c}=i,a={item:e[c],refIndex:c};return r.length&&r.forEach(u=>{u(i,a)}),a})}class Y{constructor(e,s={},n){this.options={...p,...s},this.options.useExtendedSearch,this._keyStore=new ot(this.options.keys),this.setCollection(e,n)}setCollection(e,s){if(this._docs=e,s&&!(s instanceof Ce))throw new Error(st);this._myIndex=s||Ke(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){P(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const s=[];for(let n=0,r=this._docs.length;n<r;n+=1){const i=this._docs[n];e(i,n)&&(this.removeAt(n),n-=1,r-=1,s.push(i))}return s}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:s=-1}={}){const{includeMatches:n,includeScore:r,shouldSort:i,sortFn:c,ignoreFieldNorm:a}=this.options;let u=J(e)?J(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return Rt(u,{ignoreFieldNorm:a}),i&&u.sort(c),_e(s)&&s>-1&&(u=u.slice(0,s)),_t(u,this._docs,{includeMatches:n,includeScore:r})}_searchStringList(e){const s=Ae(e,this.options),{records:n}=this._myIndex,r=[];return n.forEach(({v:i,i:c,n:a})=>{if(!P(i))return;const{isMatch:u,score:l,indices:h}=s.searchIn(i);u&&r.push({item:i,idx:c,matches:[{score:l,value:i,norm:a,indices:h}]})}),r}_searchLogical(e){const s=We(e,this.options),n=(a,u,l)=>{if(!a.children){const{keyId:d,searcher:m}=a,g=this._findMatches({key:this._keyStore.get(d),value:this._myIndex.getValueForItemAtKeyId(u,d),searcher:m});return g&&g.length?[{idx:l,item:u,matches:g}]:[]}const h=[];for(let d=0,m=a.children.length;d<m;d+=1){const g=a.children[d],y=n(g,u,l);if(y.length)h.push(...y);else if(a.operator===he.AND)return[]}return h},r=this._myIndex.records,i={},c=[];return r.forEach(({$:a,i:u})=>{if(P(a)){let l=n(s,a,u);l.length&&(i[u]||(i[u]={idx:u,item:a,matches:[]},c.push(i[u])),l.forEach(({matches:h})=>{i[u].matches.push(...h)}))}}),c}_searchObjectList(e){const s=Ae(e,this.options),{keys:n,records:r}=this._myIndex,i=[];return r.forEach(({$:c,i:a})=>{if(!P(c))return;let u=[];n.forEach((l,h)=>{u.push(...this._findMatches({key:l,value:c[h],searcher:s}))}),u.length&&i.push({idx:a,item:c,matches:u})}),i}_findMatches({key:e,value:s,searcher:n}){if(!P(s))return[];let r=[];if(Z(s))s.forEach(({v:i,i:c,n:a})=>{if(!P(i))return;const{isMatch:u,score:l,indices:h}=n.searchIn(i);u&&r.push({score:l,key:e,value:i,idx:c,norm:a,indices:h})});else{const{v:i,n:c}=s,{isMatch:a,score:u,indices:l}=n.searchIn(i);a&&r.push({score:u,key:e,value:i,norm:c,indices:l})}return r}}Y.version="7.1.0";Y.createIndex=Ke;Y.parseIndex=pt;Y.config=p;Y.parseQuery=We;St(bt);const Re={".ts":"file-code",".tsx":"atom",".js":"file-code",".jsx":"atom",".py":"file-code",".rs":"file-code",".go":"file-code",".md":"file-text",".json":"clipboard",".yaml":"gear",".yml":"gear",".css":"palette",".scss":"palette",".html":"globe",".sql":"database",".sh":"terminal",".env":"lock",".toml":"gear",".lock":"lock",default:"file-text"};function $t(t){switch(t){case"scout":return"class-scout";case"builder":return"class-builder";case"debugger":return"class-debugger";case"architect":return"class-architect";case"warrior":return"class-warrior";case"support":return"class-support";case"boss":return"class-boss";default:return"class-default"}}function Tt(t,e=16){var r;const s="."+(((r=t.split(".").pop())==null?void 0:r.toLowerCase())??""),n=Re[s]||Re.default;return f.jsx(H,{name:n,size:e})}function Pt(t,e=16){return f.jsx(H,{name:$t(t),size:e,weight:"fill"})}function Ve(t){const e=Math.floor(t/1e3),s=Math.floor(e/60),n=Math.floor(s/60),r=Math.floor(n/24);return r>0?`${r}d ${n%24}h ago`:n>0?`${n}h ${s%60}m ago`:s>0?`${s}m ago`:"just now"}function Yt(t){const s=Date.now()-t;return Ve(s)}function Le(t){switch(t){case"agent":return"Agent";case"command":return"Command";case"area":return"Area";case"modified-file":return"Changed";case"building":return"Server";default:return t}}const Ne=["command","agent","building","area","modified-file"];function Kt({isOpen:t,onClose:e,onOpenSpawnModal:s,onOpenCommanderView:n,onOpenToolbox:r,onOpenFileExplorer:i,onOpenPM2LogsModal:c,onOpenBossLogsModal:a,onOpenDatabasePanel:u,onOpenMonitoringModal:l}){const h=He(),d=Ye(),m=Je(),g=Xe(),y=A.useRef(e);y.current=e;const I=A.useRef(s);I.current=s;const k=A.useRef(n);k.current=n;const S=A.useRef(r);S.current=r;const N=A.useRef(i);N.current=i;const O=A.useRef(c);O.current=c;const K=A.useRef(a);K.current=a;const ne=A.useRef(u);ne.current=u;const G=A.useRef(l);G.current=l;const[E,C]=A.useState(""),[D,$]=A.useState(0);A.useEffect(()=>{t&&(C(""),$(0))},[t]);const T=te.getShortcuts(),Q=A.useMemo(()=>{if(!t)return[];const o=T.find(F=>F.id==="spawn-agent"),w=T.find(F=>F.id==="toggle-commander");return[{id:"cmd-spawn",type:"command",title:"Spawn New Agent",subtitle:o?Ie(o):"Alt+N",icon:f.jsx(H,{name:"plus",size:16}),action:()=>{y.current(),I.current()}},{id:"cmd-commander",type:"command",title:"Commander View",subtitle:w?Ie(w):"Ctrl+K",icon:f.jsx(H,{name:"dashboard",size:16}),action:()=>{y.current(),k.current()}},{id:"cmd-settings",type:"command",title:"Settings & Tools",subtitle:"Configure Tide Commander",icon:f.jsx(H,{name:"gear",size:16}),action:()=>{y.current(),S.current()}},{id:"cmd-monitoring",type:"command",title:"Monitoring & Logs",subtitle:"Triggers, workflows, events",icon:f.jsx(H,{name:"chart-line",size:16}),action:()=>{var F;y.current(),(F=G.current)==null||F.call(G)}}]},[t,T]),ce=A.useMemo(()=>t?Array.from(h.values()).map(o=>{const w=(g||[]).filter(_=>_.agentId===o.id).map(_=>_.filePath),F=[...new Set(w)],M=F.map(_=>_.split("/").pop()||_),b=[];o.lastAssignedTask&&b.push(o.lastAssignedTask);const R=`${o.class} • ${o.status} • ${o.cwd}`;let B=`${o.name} ${R}`;M.length>0&&(B+=` ${M.join(" ")} ${F.join(" ")}`),b.length>0&&(B+=` ${b.join(" ")}`);const z=Date.now()-o.lastActivity;let V;return o.lastAssignedTask&&(o.lastAssignedTask.length>150?V=o.lastAssignedTask.slice(0,150)+"...":V=o.lastAssignedTask),{id:`agent-${o.id}`,type:"agent",title:o.name,subtitle:R,lastUserInput:V,timeAway:z,icon:Pt(o.class),_searchText:B,_modifiedFiles:F,_userQueries:b,action:()=>{y.current(),te.selectAgent(o.id),te.requestTerminalExpand()}}}):[],[t,h,g]),j=A.useMemo(()=>t?Array.from(d.values()).map(o=>{var w;return{id:`area-${o.id}`,type:"area",title:o.name,subtitle:`${o.assignedAgentIds.length} agents • ${((w=o.directories)==null?void 0:w.length)||0} folders`,icon:f.jsx(H,{name:"map",size:16}),action:()=>{y.current(),te.selectArea(o.id)}}}):[],[t,d]),X=A.useMemo(()=>t?Array.from(m.values()).filter(o=>o.type==="server"||o.type==="boss"||o.type==="database").map(o=>{var B,z,V,_;const w=o.status==="running"?"#4ade80":o.status==="stopped"?"#f87171":"#facc15",F=o.type==="boss"?"crown":o.type==="database"?"database":"desktop";let b=`${o.type==="boss"?"Boss":o.type==="database"?"Database":"Server"} • ${o.status}`;if(o.type==="database"&&((z=(B=o.database)==null?void 0:B.connections)!=null&&z.length)){const x=o.database.connections[0];b+=` • ${x.engine} @ ${x.host}`}else o.cwd&&(b+=` • ${o.cwd}`);let R=`${o.name} ${o.type} ${o.status} ${o.cwd||""} ${((V=o.pm2)==null?void 0:V.name)||""}`;if(o.type==="database"&&((_=o.database)!=null&&_.connections))for(const x of o.database.connections)R+=` ${x.name} ${x.engine} ${x.host} ${x.database||""} mysql postgresql sql`;return{id:`building-${o.id}`,type:"building",title:o.name,subtitle:b,icon:f.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[f.jsx(H,{name:"status-pending",size:10,weight:"fill",color:w}),f.jsx(H,{name:F,size:16})]}),_searchText:R,action:()=>{var x;y.current(),o.type==="boss"?K.current(o.id):o.type==="database"?ne.current(o.id):(x=o.pm2)!=null&&x.enabled&&O.current(o.id)}}}):[],[t,m]),oe=A.useMemo(()=>{if(!t)return[];const o=g||[],w=new Set,F=[];for(const M of o){if(w.has(M.filePath))continue;w.add(M.filePath);const b=M.filePath.split("/").pop()||M.filePath,R=M.action==="created"?"Created":M.action==="modified"?"Modified":M.action==="deleted"?"Deleted":"Read";if(F.push({id:`modified-${M.filePath}-${M.timestamp}`,type:"modified-file",title:b,subtitle:`${R} by ${M.agentName} • ${M.filePath}`,matchedText:M.filePath,icon:M.action==="deleted"?f.jsx(H,{name:"trash",size:16}):Tt(M.filePath),action:()=>{y.current();const B=Array.from(te.getState().areas.values());for(const z of B)for(const V of z.directories||[])if(M.filePath.startsWith(V)){te.setFileViewerPath(M.filePath),N.current(z.id);return}te.selectAgent(M.agentId)}}),F.length>=50)break}return F},[t,g]),we=A.useMemo(()=>new Y(ce,{keys:["title","subtitle","_searchText","lastUserInput"],threshold:.4,ignoreLocation:!0,includeScore:!0,includeMatches:!0}),[ce]),Fe=A.useMemo(()=>new Y(Q,{keys:["title","subtitle"],threshold:.4,includeScore:!0,includeMatches:!0}),[Q]),Me=A.useMemo(()=>new Y(j,{keys:["title","subtitle"],threshold:.4,includeScore:!0,includeMatches:!0}),[j]),De=A.useMemo(()=>new Y(oe,{keys:["title","subtitle","matchedText"],threshold:.4,ignoreLocation:!0,includeScore:!0,includeMatches:!0}),[oe]),Be=A.useMemo(()=>new Y(X,{keys:["title","subtitle","_searchText"],threshold:.4,ignoreLocation:!0,includeScore:!0,includeMatches:!0}),[X]),W=A.useMemo(()=>{if(!E.trim()){const x=[];x.push(...X);const v=[...ce].sort((L,U)=>{const re=L.timeAway??0,ie=U.timeAway??0;return re-ie});x.push(...v),x.push(...Q.slice(0,2)),x.push(...j.slice(0,2));const ee={};return Ne.forEach((L,U)=>{ee[L]=U}),x.sort((L,U)=>(ee[L.type]??999)-(ee[U.type]??999)),x}const o=E.toLowerCase(),w=we.search(E).slice(0,8),F=Fe.search(E).slice(0,3),M=Me.search(E).slice(0,2),b=De.search(E).slice(0,3),R=Be.search(E).filter(x=>{const v=x.score??1;return`${x.item.title} ${x.item.subtitle||""} ${x.item._searchText||""}`.toLowerCase().includes(o)||v<=.2}).slice(0,4),B=[],z=[],V=[];for(const x of w){const v={...x.item};if(v._modifiedFiles&&v._modifiedFiles.length>0){const L=v._modifiedFiles.filter(U=>{var ae;const re=((ae=U.split("/").pop())==null?void 0:ae.toLowerCase())||"",ie=U.toLowerCase();return re.includes(o)||ie.includes(o)});L.length>0&&(v.matchedFiles=L)}if(v._userQueries&&v._userQueries.length>0){const L=v._userQueries.find(U=>U.toLowerCase().includes(o));if(L)if(L.length>200){const re=L.toLowerCase().indexOf(o),ie=Math.max(0,re-60),ae=Math.min(L.length,re+o.length+100);v.matchedQuery=(ie>0?"...":"")+L.slice(ie,ae)+(ae<L.length?"...":"")}else v.matchedQuery=L}const ee=v.title.toLowerCase();ee===o||ee.startsWith(o)?z.push(v):V.push(v)}for(const x of z)B.push(x);for(const x of R)B.push(x.item);for(const x of V)B.push(x);for(const x of F)B.push(x.item);for(const x of M)B.push(x.item);for(const x of b)B.push(x.item);const _={};return Ne.forEach((x,v)=>{_[x]=v}),B.sort((x,v)=>(_[x.type]??999)-(_[v.type]??999)),B},[E,we,Fe,Me,De,Be,Q,ce,j,X]);A.useEffect(()=>{D>=W.length&&$(Math.max(0,W.length-1))},[W.length,D]);const Ue=A.useCallback(o=>{if(o.altKey&&!o.ctrlKey&&!o.metaKey&&(o.key==="p"||o.key==="n"||o.key==="P"||o.key==="N")){o.preventDefault(),o.stopPropagation(),o.nativeEvent.stopImmediatePropagation();const w=o.key.toLowerCase();$(w==="p"?F=>F>0?F-1:W.length-1:F=>F<W.length-1?F+1:0);return}switch(o.key){case"Escape":o.preventDefault(),y.current();break;case"ArrowUp":o.preventDefault(),$(w=>w>0?w-1:W.length-1);break;case"ArrowDown":o.preventDefault(),$(w=>w<W.length-1?w+1:0);break;case"Enter":o.preventDefault(),W[D]&&W[D].action();break}},[W,D]),Ge=A.useCallback((o,w)=>{if(!w||!o)return o;const F=o.toLowerCase(),M=w.toLowerCase(),b=[];let R=0,B=F.indexOf(M),z=0;for(;B!==-1;)B>R&&b.push(o.slice(R,B)),b.push(de.createElement("mark",{key:z++,className:"spotlight-highlight"},o.slice(B,B+w.length))),R=B+w.length,B=F.indexOf(M,R);return R<o.length&&b.push(o.slice(R)),b.length>0?de.createElement(de.Fragment,null,...b):o},[]);return{query:E,setQuery:C,selectedIndex:D,setSelectedIndex:$,results:W,handleKeyDown:Ue,highlightMatch:Ge}}const zt=A.forwardRef(function({query:e,onQueryChange:s,onKeyDown:n,onResetSelection:r},i){const{t:c}=Ee(["common"]);return f.jsxs("div",{className:"spotlight-input-wrapper",children:[f.jsx("span",{className:"spotlight-search-icon",children:"⌘"}),f.jsx("input",{ref:i,type:"text",className:"spotlight-input",placeholder:c("common:search.spotlightPlaceholder"),value:e,onChange:a=>{s(a.target.value),r()},onKeyDown:n,autoFocus:!0,spellCheck:!1}),f.jsxs("div",{className:"spotlight-input-hints",children:[f.jsx("span",{className:"spotlight-shortcut-hint",children:"↑↓"}),f.jsx("span",{className:"spotlight-shortcut-hint",children:"Enter"}),f.jsx("span",{className:"spotlight-shortcut-hint",children:"Esc"})]})]})}),Ot=A.memo(function({result:e,isSelected:s,query:n,highlightMatch:r,onClick:i,onMouseEnter:c}){const a=e.activityText||e.matchedFiles&&e.matchedFiles.length>0||e.matchedQuery;return f.jsxs("div",{className:`spotlight-item ${s?"selected":""} ${e.activityText?"has-activity":""}`,onClick:i,onMouseEnter:c,role:"option","aria-selected":s,children:[f.jsx("span",{className:"spotlight-item-icon","aria-hidden":"true",children:e.icon}),f.jsxs("div",{className:"spotlight-item-content",children:[f.jsxs("div",{className:"spotlight-item-header",children:[f.jsx("span",{className:"spotlight-item-title",children:r(e.title,n)}),f.jsx("span",{className:`spotlight-item-type ${e.type}`,"aria-label":Le(e.type),children:Le(e.type)})]}),e.subtitle&&f.jsx("span",{className:"spotlight-item-subtitle",children:r(e.subtitle,n)}),e.activityText&&f.jsx("span",{className:"spotlight-item-activity",children:r(e.activityText,n)}),a&&f.jsxs("div",{className:"spotlight-item-details",children:[e.matchedFiles&&e.matchedFiles.length>0&&f.jsx("span",{className:"spotlight-item-files",children:e.matchedFiles.map((u,l)=>f.jsxs("span",{className:"file-badge",children:[l>0&&f.jsx("span",{className:"file-separator",children:"•"}),r(u.split("/").pop()||u,n)]},u))}),e.matchedQuery&&f.jsx("span",{className:"spotlight-item-query",children:r(e.matchedQuery,n)})]}),e.timeAway!==void 0&&f.jsx("span",{className:"spotlight-item-time",children:f.jsxs("span",{className:"spotlight-time-away",children:["Idle: ",Ve(e.timeAway)]})}),e.lastUserInput&&!e.matchedQuery&&f.jsxs("span",{className:"spotlight-item-last-input",children:['"',r(e.lastUserInput,n),'"']})]})]})}),Qt=A.forwardRef(function({results:e,selectedIndex:s,query:n,highlightMatch:r,onSelectIndex:i},c){const{t:a}=Ee(["terminal"]),u=A.useRef(!1);A.useEffect(()=>{u.current=!1},[e]),A.useEffect(()=>{const d=typeof c=="function"?null:c==null?void 0:c.current;if(!d)return;const m=()=>{u.current=!0};return d.addEventListener("mousemove",m),()=>{d.removeEventListener("mousemove",m)}},[c,e]);const l={command:a("terminal:spotlight.categories.commands"),agent:a("terminal:spotlight.categories.agents"),building:a("terminal:spotlight.categories.infrastructure"),area:a("terminal:spotlight.categories.areas"),"modified-file":a("terminal:spotlight.categories.modifiedFiles")},h=A.useMemo(()=>{const d=[];let m=null,g=[];return e.forEach((y,I)=>{y.type!==m&&(m!==null&&g.length>0&&d.push([m,g]),m=y.type,g=[]),g.push({result:y,index:I})}),m!==null&&g.length>0&&d.push([m,g]),d},[e]);return A.useEffect(()=>{if(!c||typeof c=="function")return;const d=c.current;if(!d)return;const m=d.querySelector(".spotlight-item.selected");m&&m.scrollIntoView({block:"nearest",behavior:"smooth"})},[s,c]),e.length===0?f.jsx("div",{className:"spotlight-results",ref:c,children:f.jsx("div",{className:"spotlight-empty",children:a("terminal:spotlight.noResults")})}):f.jsx("div",{className:"spotlight-results",ref:c,children:h.map(([d,m])=>f.jsxs("div",{children:[h.length>1&&f.jsx("div",{className:"spotlight-category-header",children:l[d]||d}),m.map(({result:g,index:y})=>f.jsx(Ot,{result:g,isSelected:y===s,query:n,highlightMatch:r,onClick:()=>g.action(),onMouseEnter:()=>{u.current&&i(y)}},g.id))]},d))})}),Wt=A.memo(function(){const{t:e}=Ee(["terminal"]);return f.jsxs("div",{className:"spotlight-footer",children:[f.jsxs("div",{className:"spotlight-footer-left",children:[f.jsxs("span",{className:"spotlight-footer-hint",children:[f.jsx("kbd",{children:"↑"}),f.jsx("kbd",{children:"↓"})," ",f.jsx("kbd",{children:"Alt+N"}),f.jsx("kbd",{children:"Alt+P"})," ",e("terminal:spotlight.navigate")]}),f.jsxs("span",{className:"spotlight-footer-hint",children:[f.jsx("kbd",{children:"Enter"})," ",e("terminal:spotlight.select")]})]}),f.jsx("div",{className:"spotlight-footer-right",children:f.jsxs("span",{className:"spotlight-footer-hint",children:[f.jsx("kbd",{children:"Esc"})," ",e("common:buttons.close")]})})]})}),Vt=768;function Jt({isOpen:t,onClose:e,onOpenSpawnModal:s,onOpenCommanderView:n,onOpenToolbox:r,onOpenFileExplorer:i,onOpenPM2LogsModal:c,onOpenBossLogsModal:a,onOpenDatabasePanel:u,onOpenMonitoringModal:l}){const h=A.useRef(null),d=A.useRef(null),m=A.useRef(null),g=A.useRef(0),{query:y,setQuery:I,selectedIndex:k,setSelectedIndex:S,results:N,handleKeyDown:O,highlightMatch:K}=Kt({isOpen:t,onClose:e,onOpenSpawnModal:s,onOpenCommanderView:n,onOpenToolbox:r,onOpenFileExplorer:i,onOpenPM2LogsModal:c,onOpenBossLogsModal:a,onOpenDatabasePanel:u,onOpenMonitoringModal:l});g.current=N.length,A.useEffect(()=>{t&&setTimeout(()=>{var E;(E=h.current)==null||E.focus()},50)},[t]),A.useEffect(()=>{if(!t)return;const E=window.visualViewport;if(!E||window.innerWidth>Vt)return;const C=()=>{const D=d.current;D&&(D.style.height=`${E.height}px`,D.style.top=`${E.offsetTop}px`)};return C(),E.addEventListener("resize",C),E.addEventListener("scroll",C),()=>{E.removeEventListener("resize",C),E.removeEventListener("scroll",C);const D=d.current;D&&(D.style.height="",D.style.top="")}},[t]),A.useEffect(()=>{if(!t)return;const E=C=>{if(C.key==="Escape"){C.preventDefault(),C.stopPropagation(),C.stopImmediatePropagation(),e();return}if(C.altKey&&!C.ctrlKey&&!C.metaKey&&(C.key==="n"||C.key==="p"||C.key==="N"||C.key==="P")){C.preventDefault(),C.stopPropagation(),C.stopImmediatePropagation();const D=C.key.toLowerCase(),$=g.current;S(D==="p"?T=>T>0?T-1:$-1:T=>T<$-1?T+1:0);return}};return window.addEventListener("keydown",E,{capture:!0}),()=>{window.removeEventListener("keydown",E,{capture:!0})}},[t,e]);const ne=A.useCallback(E=>{E.target===E.currentTarget&&e()},[e]),G=A.useCallback(()=>{S(0)},[S]);return t?f.jsx("div",{ref:d,className:"spotlight-overlay",onClick:ne,children:f.jsxs("div",{className:"spotlight-modal",children:[f.jsx(zt,{ref:h,query:y,onQueryChange:I,onKeyDown:O,onResetSelection:G}),f.jsx(Qt,{ref:m,results:N,selectedIndex:k,query:y,highlightMatch:K,onSelectIndex:S}),f.jsx(Wt,{})]})}):null}export{Re as FILE_ICON_NAMES,Jt as Spotlight,Wt as SpotlightFooter,zt as SpotlightInput,Ot as SpotlightItem,Qt as SpotlightResults,Ve as formatDuration,Yt as formatRelativeTime,Pt as getAgentIcon,Tt as getFileIconFromPath,Le as getTypeLabel,Kt as useSpotlightSearch};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{z as $e,B as Be,r as n,C as Me,S as x,E as Re,G as ye,H as K,J as Le,s as h,K as Te,j as e,L as Fe,M as Pe,N as Oe,O as Ge,P as Ve,U as De,V as He,W as We,X as Ue,Y as Ke,Z as Xe,_ as qe,$ as Ye,a0 as Ze,a1 as Je,I as p,a2 as Qe,a3 as et,a4 as tt,a5 as at,a6 as nt}from"./main-DoRHB7F9.js";import"./vendor-react--Eh9ivFN.js";import"./vendor-three-Chj50gSY.js";const st=["simple","chat","advanced"],rt={simple:"Simple",chat:"Chat",advanced:"Advanced"},lt={simple:"○",chat:"◐",advanced:"◉"},it={simple:"Simple view — clean messages only",chat:"Chat view — assistant replies (no tool calls)",advanced:"Advanced view — everything including tools"},ze="flat-clear-context";function ct(g){const i=g.split("/").filter(Boolean);return i.length===0?g:i.slice(-2).join("/")}function ot(g,i){if(i.type==="rectangle"&&i.width&&i.height){const b=i.width/2,A=i.height/2;return g.x>=i.center.x-b&&g.x<=i.center.x+b&&g.z>=i.center.z-A&&g.z<=i.center.z+A}if(i.type==="circle"&&i.radius){const b=g.x-i.center.x,A=g.z-i.center.z;return b*b+A*A<=i.radius*i.radius}return!1}const dt=Ue.memo(function({agentId:i,terminalViewMode:b,onTerminalViewModeChange:A,inspectorOpen:G,onToggleInspector:_e,onImageClick:P,onFileClick:X,onBashClick:q,onViewMarkdown:te,onRequestClearSubordinates:ae,onOpenBuilding:Y,keyboard:Z,canNavigateBack:ne,canNavigateForward:ge,onNavigateBack:se,onNavigateForward:xe}){var E,M,d,_;const m=Ke(i),j=Xe(),N=n.useRef(null),J=Te(),V=n.useMemo(()=>{if(!m)return null;const a=new Set,c=[];for(const l of J.values())l.archived||l.directories.length===0||l.assignedAgentIds.includes(i)&&(a.add(l.id),c.push(l));for(const l of J.values())l.archived||l.directories.length===0||a.has(l.id)||ot({x:m.position.x,z:m.position.z},l)&&(a.add(l.id),c.push(l));return c.length===0?null:c.flatMap(l=>l.directories.filter(o=>o&&o.trim().length>0).map(o=>({areaId:l.id,areaName:l.name,dir:o})))},[m,i,J]),{branches:re,fetchRemote:le,fetchingDirs:ie}=qe(V),D=n.useMemo(()=>{var l;const a=h.getAreaForAgent(i);if(!a)return[];const c=[];for(const o of j.values())o.type==="terminal"&&h.isPositionInArea(o.position,a)&&c.push({id:o.id,name:o.name,hasUrl:!!((l=o.terminalStatus)!=null&&l.url)});return c},[i,j]),ce=n.useMemo(()=>{var l;const a=h.getAreaForAgent(i);if(!a)return[];const c=[];for(const o of j.values())o.type==="server"&&((l=o.pm2)!=null&&l.enabled)&&h.isPositionInArea(o.position,a)&&c.push({id:o.id,name:o.name});return c},[i,j]),oe=n.useMemo(()=>{const a=h.getAreaForAgent(i);if(!a)return[];const c=[];for(const l of j.values())l.type==="database"&&l.database&&h.isPositionInArea(l.position,a)&&c.push({id:l.id,name:l.name});return c},[i,j]),[,be]=n.useReducer(a=>a+1,0),H=((E=N.current)==null?void 0:E.search.searchMode)??!1,we=n.useCallback(()=>{var a;(a=N.current)==null||a.search.toggleSearch(),be()},[]),f=Ye(),y=f.isPending(ze),[w,T]=n.useState(null),S=w?j.get(w):null,{height:je,onResizeStart:Ne}=Ze(),[O,de]=n.useState(()=>ye(x.GIT_PANEL_OPEN,!1)),[v,C]=n.useState(()=>ye(x.BUILDINGS_PANEL_OPEN,!1)),W=n.useCallback(()=>{de(a=>{const c=!a;return K(x.GIT_PANEL_OPEN,c),c})},[]),ve=n.useCallback(()=>{C(a=>{const c=!a;return K(x.BUILDINGS_PANEL_OPEN,c),c})},[]),Ce=n.useCallback(()=>{de(!1),K(x.GIT_PANEL_OPEN,!1)},[]),me=n.useCallback(()=>{C(!1),K(x.BUILDINGS_PANEL_OPEN,!1)},[]),ke=Je();n.useEffect(()=>{if(!w)return;D.some(c=>c.id===w)||T(null)},[w,D]);const[$,B]=n.useState(!1),U=n.useRef(null);if(n.useEffect(()=>{if(!$)return;const a=c=>{U.current&&!U.current.contains(c.target)&&B(!1)};return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[$]),!m)return e.jsx("div",{className:"flat-chat flat-chat--empty",children:e.jsxs("div",{className:"flat-chat__placeholder",children:[e.jsx("span",{className:"flat-chat__placeholder-icon",children:"💬"}),e.jsx("span",{className:"flat-chat__placeholder-text",children:"Select an agent to start chatting"})]})});const k=m.contextStats,pe=!!k,Q=k?k.totalTokens:m.contextUsed||0,ue=k?k.contextWindow:m.contextLimit||2e5,he=k?k.usedPercent:Math.round(Q/ue*100),I=Math.max(0,Math.min(100,he)),Ae=Math.max(0,100-I),ee=I>=80?"#ff4a4a":I>=60?"#ff9e4a":I>=40?"#ffd700":"#4aff9e",L=(Q/1e3).toFixed(1),fe=(ue/1e3).toFixed(1),t=m.cwd,s=t?ct(t):null,r=((M=m.subordinateIds)==null?void 0:M.length)||0,u=r>0;return e.jsxs("div",{className:`flat-terminal-wrapper ${O||v?"flat-terminal-wrapper--with-side-panel":""}`,children:[e.jsxs("div",{className:"flat-terminal-wrapper__header",children:[e.jsxs("div",{className:"flat-terminal-wrapper__header-main",children:[e.jsx(Pe,{agent:m,size:28}),e.jsxs("div",{className:"flat-terminal-wrapper__header-info",children:[e.jsx("span",{className:"flat-terminal-wrapper__header-name",children:m.name}),e.jsx("span",{className:"flat-terminal-wrapper__header-status",style:{color:Oe(m.status)},children:m.status})]}),m.taskLabel&&e.jsxs("span",{className:"flat-terminal-wrapper__header-task",title:m.taskLabel,children:["📋 ",m.taskLabel]})]}),e.jsxs("div",{className:"flat-terminal-wrapper__header-meta",children:[e.jsx("div",{className:"flat-terminal-wrapper__view-mode",role:"group","aria-label":"Message view mode",children:st.map(a=>e.jsxs("button",{type:"button",className:`flat-terminal-wrapper__view-mode-btn ${b===a?"flat-terminal-wrapper__view-mode-btn--active":""}`,onClick:()=>A(a),title:it[a],"aria-pressed":b===a,children:[e.jsx("span",{className:"flat-terminal-wrapper__view-mode-icon","aria-hidden":"true",children:lt[a]}),e.jsx("span",{className:"flat-terminal-wrapper__view-mode-label",children:rt[a]})]},a))}),e.jsxs("div",{className:"flat-terminal-wrapper__actions",role:"group","aria-label":"Terminal actions",children:[e.jsx("button",{type:"button",className:"flat-terminal-wrapper__action-btn",onClick:se,disabled:!ne,title:"Back to previous agent","aria-label":"Back to previous agent",children:e.jsx(p,{name:"arrow-left",size:14})}),e.jsx("button",{type:"button",className:"flat-terminal-wrapper__action-btn",onClick:xe,disabled:!ge,title:"Forward to next agent","aria-label":"Forward to next agent",children:e.jsx(p,{name:"arrow-right",size:14})}),e.jsx("button",{type:"button",className:`flat-terminal-wrapper__action-btn ${H?"flat-terminal-wrapper__action-btn--active":""}`,onClick:we,title:H?"Close search":"Search messages","aria-pressed":H,children:e.jsx(p,{name:H?"cross":"search",size:14})}),e.jsx("button",{type:"button",className:`flat-terminal-wrapper__action-btn flat-terminal-wrapper__action-btn--danger ${y?"flat-terminal-wrapper__action-btn--confirm":""}`,onClick:()=>f.handleClick(ze,()=>{var a;h.clearContext(i),(a=N.current)==null||a.historyLoader.clearHistory()}),title:y?"Click again to confirm clear context":"Clear context",children:e.jsx(p,{name:y?"question":"clear",size:14})}),e.jsx("button",{type:"button",className:`flat-terminal-wrapper__action-btn ${O?"flat-terminal-wrapper__action-btn--active":""}`,onClick:W,title:O?"Hide git panel":"Show git changes","aria-pressed":O,children:e.jsx(p,{name:"git-branch",size:14})}),e.jsx("button",{type:"button",className:`flat-terminal-wrapper__action-btn ${v?"flat-terminal-wrapper__action-btn--active":""}`,onClick:ve,title:v?"Hide buildings panel":"Show area buildings","aria-pressed":v,children:e.jsx(p,{name:"buildings",size:14})}),e.jsxs("div",{className:"flat-terminal-wrapper__more",ref:U,children:[e.jsx("button",{type:"button",className:`flat-terminal-wrapper__action-btn ${$?"flat-terminal-wrapper__action-btn--active":""}`,onClick:()=>B(a=>!a),title:"More actions","aria-expanded":$,children:"⋮"}),$&&e.jsxs("div",{className:"flat-terminal-wrapper__more-menu",role:"menu",children:[e.jsxs("button",{type:"button",role:"menuitem",className:"flat-terminal-wrapper__more-item",onClick:()=>{h.collapseContext(i),B(!1)},disabled:m.status!=="idle",title:m.status!=="idle"?"Agent must be idle to collapse context":"Collapse context",children:[e.jsx(p,{name:"package",size:14}),e.jsx("span",{children:"Collapse context"})]}),u&&e.jsxs("button",{type:"button",role:"menuitem",className:"flat-terminal-wrapper__more-item flat-terminal-wrapper__more-item--danger",onClick:()=>{ae(i,r),B(!1)},children:[e.jsx(p,{name:"crown",size:14}),e.jsxs("span",{children:["Clear ",r," subordinate",r===1?"":"s"]})]}),e.jsx("div",{className:"flat-terminal-wrapper__more-divider"}),e.jsxs("button",{type:"button",role:"menuitem",className:"flat-terminal-wrapper__more-item flat-terminal-wrapper__more-item--danger",onClick:()=>{h.killAgent(i),B(!1)},children:[e.jsx(p,{name:"cross",size:14}),e.jsx("span",{children:"Remove agent"})]})]})]})]}),e.jsxs("button",{type:"button",className:`flat-terminal-wrapper__inspector-toggle ${G?"flat-terminal-wrapper__inspector-toggle--active":""}`,onClick:_e,title:G?"Hide inspector panel":"Show inspector panel","aria-label":G?"Hide inspector panel":"Show inspector panel","aria-pressed":G,children:[e.jsx("span",{className:"flat-terminal-wrapper__inspector-icon","aria-hidden":"true",children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5"}),e.jsx("line",{x1:"10",y1:"2.5",x2:"10",y2:"13.5"})]})}),e.jsx("span",{className:"flat-terminal-wrapper__inspector-label",children:"Inspector"})]})]})]}),e.jsx(Qe,{ref:N,agentId:i,agent:m,viewMode:b,isOpen:!0,onImageClick:P,onFileClick:X,onBashClick:q,onViewMarkdown:te,keyboard:Z,hasModalOpen:!1}),S&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"guake-bottom-terminal-resize",onMouseDown:Ne,role:"separator","aria-orientation":"horizontal","aria-label":"Resize embedded terminal"}),e.jsxs("div",{className:"flat-bottom-panel",role:"region","aria-label":`Embedded terminal: ${S.name}`,style:{height:je},children:[e.jsxs("div",{className:"flat-bottom-panel__header",children:[e.jsxs("span",{className:"flat-bottom-panel__title",children:[e.jsx(p,{name:"terminal",size:12}),e.jsx("span",{children:S.name}),!((d=S.terminalStatus)!=null&&d.url)&&e.jsx("span",{className:"flat-bottom-panel__muted",children:"(starting...)"})]}),e.jsx("button",{type:"button",className:"flat-bottom-panel__close",onClick:()=>T(null),title:"Close embedded terminal","aria-label":"Close embedded terminal",children:e.jsx(p,{name:"cross",size:12})})]}),e.jsx("div",{className:"flat-bottom-panel__body",children:(_=S.terminalStatus)!=null&&_.url?e.jsx(et,{terminalUrl:S.terminalStatus.url,visible:!0}):e.jsx("div",{className:"flat-bottom-panel__placeholder",children:"Starting terminal..."})})]})]}),e.jsxs("div",{className:"flat-terminal-wrapper__statusbar",role:"contentinfo",children:[m.isDetached&&e.jsxs("span",{className:"flat-terminal-wrapper__detached",title:"Reattaching session...",children:[e.jsx(p,{name:"refresh",size:12}),e.jsx("span",{children:"Reattaching"})]}),t&&s&&e.jsxs("span",{className:"flat-terminal-wrapper__cwd",title:t,onClick:()=>h.setFileViewerPath(t),children:[e.jsx("span",{className:"flat-terminal-wrapper__cwd-icon",children:e.jsx(p,{name:"folder",size:12})}),e.jsx("span",{className:"flat-terminal-wrapper__cwd-text",children:s})]}),V&&V.map(({areaId:a,areaName:c,dir:l})=>{const o=re.get(l),R=ie.has(l),F=l.split("/").filter(Boolean).pop()||l;return e.jsxs("span",{className:"flat-terminal-wrapper__area-dir",title:`${c}: ${l}${o?` (${o.branch}${o.ahead?` ↑${o.ahead}`:""}${o.behind?` ↓${o.behind}`:""})`:""}`,onClick:()=>h.openFileExplorerForAreaFolder(a,l),children:[e.jsx(p,{name:"folder-open",size:12}),e.jsx("span",{className:"flat-terminal-wrapper__area-dir-name",children:F}),o&&e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"flat-terminal-wrapper__area-dir-branch",children:[e.jsx(p,{name:"git-branch",size:10})," ",o.branch]}),o.ahead>0&&e.jsxs("span",{className:"flat-terminal-wrapper__branch-ahead",title:`${o.ahead} ahead`,children:[e.jsx(p,{name:"arrow-up",size:9}),o.ahead]}),o.behind>0&&e.jsxs("span",{className:"flat-terminal-wrapper__branch-behind",title:`${o.behind} behind`,children:[e.jsx(p,{name:"arrow-down",size:9}),o.behind]}),e.jsx("span",{className:`flat-terminal-wrapper__area-fetch ${R?"flat-terminal-wrapper__area-fetch--fetching":""}`,title:"Git fetch",onClick:z=>{z.stopPropagation(),le(l)},children:e.jsx(p,{name:R?"hourglass":"download",size:12})})]})]},`${a}:${l}`)}),e.jsxs("span",{className:"flat-terminal-wrapper__context",onClick:()=>h.setContextModalAgentId(i),title:pe?`Context usage: ${L}k / ${fe}k tokens (${I}% used). Click to view stats.`:"Click to fetch context stats",children:[e.jsx("span",{className:"flat-terminal-wrapper__context-icon",children:e.jsx(p,{name:"dashboard",size:12})}),e.jsx("span",{className:"flat-terminal-wrapper__context-label",children:"Ctx:"}),e.jsx("span",{className:"flat-terminal-wrapper__context-bar",children:e.jsx("span",{className:"flat-terminal-wrapper__context-bar-fill",style:{width:`${I}%`,backgroundColor:ee}})}),e.jsxs("span",{className:"flat-terminal-wrapper__context-tokens",style:{color:ee},children:[L,"k/",fe,"k"]}),e.jsxs("span",{className:"flat-terminal-wrapper__context-free",children:["(",Ae,"% free)"]}),!pe&&e.jsx("span",{className:"flat-terminal-wrapper__context-warning",title:"No context stats yet",children:e.jsx(p,{name:"warn",size:12})})]}),e.jsx("div",{className:"flat-terminal-wrapper__statusbar-spacer","aria-hidden":"true"}),D.length>0&&e.jsx("span",{className:"flat-terminal-wrapper__buildings",role:"group","aria-label":"Area terminals",children:D.map(a=>{const c=w===a.id;return e.jsx("button",{type:"button",className:`flat-terminal-wrapper__building-btn ${c?"flat-terminal-wrapper__building-btn--active":""} ${a.hasUrl?"":"flat-terminal-wrapper__building-btn--offline"}`,title:`${c?"Hide":"Show"} terminal: ${a.name}${a.hasUrl?"":" (starting...)"}`,onClick:()=>{if(c){T(null);return}a.hasUrl||h.sendBuildingCommand(a.id,"start"),T(a.id)},children:e.jsx(p,{name:"terminal",size:14})},a.id)})}),ce.length>0&&e.jsx("span",{className:"flat-terminal-wrapper__buildings",role:"group","aria-label":"Area PM2 logs",children:ce.map(a=>e.jsx("button",{type:"button",className:"flat-terminal-wrapper__building-btn",title:`Open logs: ${a.name}`,onClick:()=>Y(a.id),children:e.jsx(p,{name:"scroll",size:14})},a.id))}),oe.length>0&&e.jsx("span",{className:"flat-terminal-wrapper__buildings",role:"group","aria-label":"Area databases",children:oe.map(a=>e.jsx("button",{type:"button",className:"flat-terminal-wrapper__building-btn",title:`Open database: ${a.name}`,onClick:()=>Y(a.id),children:e.jsx(p,{name:"hard-drives",size:14})},a.id))}),e.jsx("div",{className:"flat-terminal-wrapper__theme",children:e.jsx(tt,{})})]}),O&&e.jsx(at,{agentId:i,agents:ke,onClose:Ce,branchInfoMap:re,fetchRemote:le,fetchingDirs:ie}),v&&e.jsx(nt,{agentId:i,onClose:me})]})});function ht({onAgentClick:g,onBuildingClick:i,onBuildingDoubleClick:b,onOpenSpawnModal:A,onOpenBossSpawnModal:G,onOpenAreaModal:_e}){const P=$e(),X=Be(),[q,te]=n.useState(null),[ae,Y]=n.useState(null),[Z,ne]=n.useState(null),[ge,se]=n.useState(()=>{const t=Me(x.VIEW_MODE);return t==="simple"||t==="chat"||t==="advanced"?t:"simple"}),xe=n.useCallback(t=>{se(t),Re(x.VIEW_MODE,t)},[]);n.useEffect(()=>{const t=s=>{if(s.key!==x.VIEW_MODE)return;const r=s.newValue;(r==="simple"||r==="chat"||r==="advanced")&&se(r)};return window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)},[]);const[m,j]=n.useState(()=>ye(x.FLAT_INSPECTOR_OPEN,!1)),[N,J]=n.useState(()=>Me(x.FLAT_INSPECTOR_VIEW)==="tracking"?"tracking":"agent"),V=n.useCallback(t=>{J(t),Re(x.FLAT_INSPECTOR_VIEW,t)},[]),re=n.useCallback(()=>{j(t=>{const s=!t;return K(x.FLAT_INSPECTOR_OPEN,s),s})},[]),le=n.useCallback(()=>{j(!1),K(x.FLAT_INSPECTOR_OPEN,!1)},[]),ie=Le(),D=n.useCallback((t,s)=>{te({url:t,name:s})},[]),ce=n.useCallback((t,s)=>{Y({command:t,output:s,isLive:!1})},[]),oe=n.useCallback((t,s)=>{h.setFileViewerPath(t,s)},[]),be=n.useCallback(t=>{},[]),H=n.useCallback((t,s)=>{ne({agentId:t,count:s})},[]),we=n.useCallback(t=>{b?b(t):i(t)},[i,b]),f=n.useMemo(()=>X.size>0?Array.from(X)[0]:null,[X]),y=n.useRef([]),w=n.useRef(-1),T=n.useRef(!1),S=n.useRef(null),[je,Ne]=n.useState(!1),[O,de]=n.useState(!1),v=n.useMemo(()=>new Set(P.map(t=>t.id)),[P]),C=n.useCallback(()=>{const t=y.current,s=w.current;Ne(s>0),de(s>=0&&s<t.length-1)},[]),W=n.useCallback(t=>{const s=y.current;if(s.length===0)return;let r=w.current+t;for(;r>=0&&r<s.length;){const u=s[r];if(v.has(u)){T.current=!0,w.current=r,C(),h.selectAgent(u);return}r+=t}},[v,C]),ve=n.useCallback(()=>W(-1),[W]),Ce=n.useCallback(()=>W(1),[W]);n.useEffect(()=>{if(!f){y.current=[],w.current=-1,C();return}if(S.current=f,T.current){T.current=!1,C();return}const t=y.current,s=w.current;if(s>=0&&t[s]===f){C();return}const r=s<t.length-1?t.slice(0,s+1):t.slice();r.push(f),r.length>100&&r.shift(),y.current=r,w.current=r.length-1,C()},[f,C]);const me=n.useCallback(t=>{g(t)},[g]),ke=f??"",$=n.useCallback(()=>{},[]),B=n.useCallback(t=>{me(t)},[me]),U=m&&!!f,k=n.useRef(null);n.useEffect(()=>{if(f)return;const t=s=>{if(s.key!==" "&&s.key!=="Backspace")return;const r=s.target;if(r.tagName==="INPUT"||r.tagName==="TEXTAREA"||r.isContentEditable)return;const u=S.current;!u||!v.has(u)||(s.preventDefault(),h.selectAgent(u))};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[f,v]);const[pe,Q]=n.useState(new Set),ue=n.useCallback(t=>{Q(s=>{const r=new Set(s);return r.has(t)?r.delete(t):r.add(t),r})},[]),he=n.useRef(null),[I,Ae]=n.useState(2);n.useEffect(()=>{const t=he.current;if(!t)return;const s=()=>{const u=t.clientWidth,E=240,M=10,d=Math.max(1,Math.floor((u+M)/(E+M)));Ae(d)};s();const r=new ResizeObserver(s);return r.observe(t),()=>r.disconnect()},[]);const ee=Te(),L=n.useMemo(()=>{const t=new Map,s=[];for(const d of P){const _=h.getAreaForAgent(d.id);if(!_||_.archived){s.push(d);continue}const a=t.get(_.id);a?a.push(d):t.set(_.id,[d])}const r=[];for(const[,d]of ee){if(d.archived)continue;const _=t.get(d.id);_&&_.length>0&&r.push({area:d,agents:_})}s.length>0&&r.push({area:{id:"__unassigned__",name:"Unassigned",color:"#6272a4",center:{x:0,z:0},type:"circle",radius:0,directories:[],archived:!1,assignedAgentIds:[],zIndex:0},agents:s});const u=r.filter(d=>d.area.id!=="__unassigned__"),E=r.filter(d=>d.area.id==="__unassigned__");if(u.length>1){let d=1/0,_=-1/0,a=1/0,c=-1/0;for(const z of u)d=Math.min(d,z.area.center.x),_=Math.max(_,z.area.center.x),a=Math.min(a,z.area.center.z),c=Math.max(c,z.area.center.z);const l=c-a||1,o=Math.max(1,I),R=Math.max(1,Math.ceil(u.length/o)),F=l/R;u.sort((z,Se)=>{const Ie=Math.min(R-1,Math.floor((z.area.center.z-a)/F)),Ee=Math.min(R-1,Math.floor((Se.area.center.z-a)/F));return Ie!==Ee?Ie-Ee:z.area.center.x-Se.area.center.x})}const M=d=>{d.sort((_,a)=>{var l,o,R,F;const c=(((l=_.position)==null?void 0:l.z)??0)-(((o=a.position)==null?void 0:o.z)??0);return c!==0?c:(((R=_.position)==null?void 0:R.x)??0)-(((F=a.position)==null?void 0:F.x)??0)})};for(const d of u)M(d.agents);for(const d of E)M(d.agents);return[...u,...E]},[P,ee,I]),fe=n.useCallback(t=>{const s=new Set(L.map(r=>r.area.id));s.delete(t),Q(s),requestAnimationFrame(()=>{const r=k.current;if(!r)return;const u=r.querySelector(`[data-area-id="${t}"]`);if(!u)return;const E=r.getBoundingClientRect(),d=u.getBoundingClientRect().top-E.top+r.scrollTop-8;r.scrollTo({top:Math.max(0,d),behavior:"smooth"})})},[L]);return e.jsxs("div",{className:`flat-view ${U?"flat-view--with-inspector":""}`,children:[e.jsxs("div",{className:"flat-middle",children:[e.jsxs("div",{className:"flat-middle__header",children:[e.jsx("h2",{className:"flat-middle__title",children:"👥 Agents"}),e.jsxs("div",{className:"flat-middle__actions",children:[e.jsx("button",{className:"flat-cta-btn flat-cta-btn--agent",onClick:A,title:"Create new agent",children:"+ Agent"}),e.jsx("button",{className:"flat-cta-btn flat-cta-btn--boss",onClick:G,title:"Create new boss agent",children:"+ Boss"}),e.jsx("button",{className:"flat-cta-btn flat-cta-btn--area",onClick:_e,title:"Create new area",children:"+ Area"})]})]}),e.jsx("div",{className:"flat-middle__content",children:e.jsx(Fe,{activeAgentId:ke,onClose:$,onSelectAgent:B,collapsedAreas:pe,onToggleArea:ue,agentListRef:k})})]}),e.jsx("div",{className:"flat-right",children:f?e.jsx(dt,{agentId:f,terminalViewMode:ge,onTerminalViewModeChange:xe,inspectorOpen:m,onToggleInspector:re,onImageClick:D,onFileClick:oe,onBashClick:ce,onViewMarkdown:be,onRequestClearSubordinates:H,onOpenBuilding:we,keyboard:ie,canNavigateBack:je,canNavigateForward:O,onNavigateBack:ve,onNavigateForward:Ce}):e.jsx("div",{className:"flat-chat flat-chat--empty",children:e.jsxs("div",{className:"flat-empty-overview",children:[e.jsxs("div",{className:"flat-empty-overview__header",children:[e.jsx("span",{className:"flat-empty-overview__title",children:"🗺️ Areas"}),e.jsx("span",{className:"flat-empty-overview__hint",children:"Click an area to focus it, or an agent to chat"})]}),e.jsx("div",{className:"flat-empty-overview__grid",ref:he,children:L.length===0?e.jsx("div",{className:"flat-empty-overview__empty",children:e.jsx("span",{children:"No areas or agents yet"})}):L.map(t=>{const s=t.area.id;return e.jsxs("div",{className:"flat-empty-area-card",style:{"--area-color":t.area.color},children:[e.jsxs("button",{type:"button",className:"flat-empty-area-card__header",onClick:()=>fe(s),title:`Focus ${t.area.name} in left panel`,children:[e.jsx("span",{className:"flat-empty-area-card__color",style:{background:t.area.color}}),e.jsx("span",{className:"flat-empty-area-card__name",children:t.area.name}),e.jsx("span",{className:"flat-empty-area-card__count",children:t.agents.length})]}),e.jsx("div",{className:"flat-empty-area-card__agents",children:t.agents.map(r=>e.jsxs("button",{type:"button",className:`flat-empty-agent-chip ${r.status}`,onClick:()=>g(r.id),title:`Open chat with ${r.name}`,children:[e.jsx(Pe,{agent:r,size:16}),e.jsx("span",{className:"flat-empty-agent-chip__name",children:r.name}),e.jsx("span",{className:"flat-empty-agent-chip__dot",style:{backgroundColor:Oe(r.status)}})]},r.id))})]},s)})})]})})}),U&&f&&e.jsxs("aside",{className:"flat-inspector","aria-label":"Inspector panel",children:[e.jsxs("div",{className:"flat-inspector__header",children:[e.jsxs("div",{className:"flat-inspector__tabs",role:"tablist","aria-label":"Inspector view",children:[e.jsx("button",{type:"button",role:"tab","aria-selected":N==="agent",className:`flat-inspector__tab ${N==="agent"?"flat-inspector__tab--active":""}`,onClick:()=>V("agent"),children:"Agent"}),e.jsx("button",{type:"button",role:"tab","aria-selected":N==="tracking",className:`flat-inspector__tab ${N==="tracking"?"flat-inspector__tab--active":""}`,onClick:()=>V("tracking"),children:"Tracking"})]}),e.jsx("button",{type:"button",className:"flat-inspector__close",onClick:le,title:"Close inspector","aria-label":"Close inspector",children:"✕"})]}),e.jsx("div",{className:"flat-inspector__body",children:N==="tracking"?e.jsx(Ge,{activeAgentId:f??"",onSelectAgent:t=>g(t)}):(()=>{const t=P.find(s=>s.id===f);return t?e.jsx(Ve,{agent:t,onFocusAgent:s=>g(s),onKillAgent:s=>h.killAgent(s)}):e.jsx("div",{className:"flat-inspector__empty",children:e.jsx("span",{children:"Agent not found"})})})()})]}),q&&e.jsx(De,{url:q.url,name:q.name,onClose:()=>te(null)}),ae&&e.jsx(He,{state:ae,onClose:()=>Y(null)}),Z&&e.jsx(We,{action:"clear-subordinates",selectedAgentId:Z.agentId,subordinateCount:Z.count,onClose:()=>ne(null),onClearHistory:()=>{}})]})}export{ht as FlatView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.app.view-mode-flat .guake-terminal{display:none}.flat-view{display:grid;grid-template-columns:1fr 1fr;height:100%;width:100%;background:#282a36;overflow:hidden;padding-left:64px;box-sizing:border-box;transition:grid-template-columns .25s ease}.flat-view--with-inspector{grid-template-columns:1fr 1fr 320px}.flat-middle{display:flex;flex-direction:column;background:#282a36;border-right:1px solid rgba(255,255,255,.06);overflow:hidden;min-width:280px}.flat-middle__header{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid rgba(255,255,255,.06);flex-shrink:0;gap:12px}.flat-middle__title{font-size:14px;font-weight:600;color:#f8f8f2;margin:0}.flat-middle__actions{display:flex;gap:6px;flex-shrink:0}.flat-middle__content{flex:1;overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:8px}.flat-middle__content::-webkit-scrollbar{width:6px}.flat-middle__content::-webkit-scrollbar-track{background:transparent}.flat-middle__content::-webkit-scrollbar-thumb{background:#ffffff1a;border-radius:3px}.flat-middle__content::-webkit-scrollbar-thumb:hover{background:#fff3}.flat-cta-btn{padding:4px 10px;font-size:11px;font-weight:500;border:none;border-radius:4px;cursor:pointer;transition:all .15s ease;white-space:nowrap}.flat-cta-btn--agent{background:#50fa7b26;color:#50fa7b}.flat-cta-btn--agent:hover{background:#50fa7b40}.flat-cta-btn--boss{background:#ffd70026;color:gold}.flat-cta-btn--boss:hover{background:#ffd70040}.flat-cta-btn--building{background:#8be9fd26;color:#8be9fd}.flat-cta-btn--building:hover{background:#8be9fd40}.flat-cta-btn--area{background:#bd93f926;color:#bd93f9}.flat-cta-btn--area:hover{background:#bd93f940}.flat-middle .agent-overview-panel{position:relative;inset:auto;width:100%;height:100%;border-right:none;flex:1;min-height:0;z-index:auto}.flat-middle .agent-overview-panel .aop-row-controls .close-btn{display:none}.flat-middle__content:has(>.agent-overview-panel){padding:0;overflow:hidden}.flat-right{display:flex;flex-direction:column;background:#21222c;overflow:hidden}.flat-chat{display:flex;flex-direction:column;height:100%}.flat-chat--empty{align-items:center;justify-content:center}.flat-chat__placeholder{display:flex;flex-direction:column;align-items:center;gap:12px;color:#6272a4}.flat-chat__placeholder-icon{font-size:48px;opacity:.5}.flat-chat__placeholder-text{font-size:14px}.flat-empty-overview{display:flex;flex-direction:column;height:100%;padding:12px 16px;gap:10px;overflow-y:auto}.flat-empty-overview::-webkit-scrollbar{width:6px}.flat-empty-overview::-webkit-scrollbar-track{background:transparent}.flat-empty-overview::-webkit-scrollbar-thumb{background:#ffffff1a;border-radius:3px}.flat-empty-overview::-webkit-scrollbar-thumb:hover{background:#fff3}.flat-empty-overview__header{display:flex;align-items:baseline;justify-content:space-between;gap:12px;flex-shrink:0}.flat-empty-overview__title{font-size:13px;font-weight:600;color:#f8f8f2}.flat-empty-overview__hint{font-size:11px;color:#6272a4}.flat-empty-overview__grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:10px;align-content:start}.flat-empty-overview__empty{grid-column:1/-1;display:flex;align-items:center;justify-content:center;padding:40px;color:#6272a4;font-size:13px}.flat-empty-area-card{display:flex;flex-direction:column;background:#363848;border:1px solid rgba(255,255,255,.06);border-radius:8px;overflow:hidden;transition:border-color .15s ease,box-shadow .15s ease}.flat-empty-area-card:hover{border-color:#ffffff1a;box-shadow:0 2px 8px #00000040}.flat-empty-area-card__header{display:flex;align-items:center;gap:6px;padding:6px 8px;background:transparent;border:none;cursor:pointer;width:100%;text-align:left;color:#f8f8f2;font-size:12px;font-weight:600;transition:background .15s ease}.flat-empty-area-card__header:hover{background:#ffffff0a}.flat-empty-area-card__color{width:8px;height:8px;border-radius:50%;flex-shrink:0}.flat-empty-area-card__name{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.flat-empty-area-card__count{font-size:10px;font-weight:500;color:#6272a4;background:#ffffff0f;padding:1px 5px;border-radius:8px;flex-shrink:0}.flat-empty-area-card__caret{font-size:10px;color:#6272a4;flex-shrink:0;width:12px;text-align:center}.flat-empty-area-card__agents{display:flex;flex-wrap:wrap;gap:4px;padding:0 8px 8px}.flat-empty-agent-chip{display:inline-flex;align-items:center;gap:5px;padding:3px 7px;background:#ffffff0a;border:1px solid rgba(255,255,255,.06);border-radius:10px;cursor:pointer;color:#9a9caa;font-size:11px;text-align:left;transition:background .15s ease,color .15s ease,border-color .15s ease;white-space:nowrap;min-width:0}.flat-empty-agent-chip:hover{background:#ffffff14;border-color:#ffffff1f;color:#f8f8f2}.flat-empty-agent-chip__name{min-width:0;overflow:hidden;text-overflow:ellipsis}.flat-empty-agent-chip__dot{width:6px;height:6px;border-radius:50%;flex-shrink:0}.flat-terminal-wrapper{display:flex;flex-direction:column;height:100%;min-height:0;position:relative;background:#21222c;overflow:hidden;--guake-side-panel-width: 380px}.flat-terminal-wrapper--with-side-panel>*:not(.guake-git-panel):not(.guake-buildings-panel):not(.guake-workflow-panel){margin-right:var(--guake-side-panel-width);transition:margin-right .2s ease}.flat-terminal-wrapper__header{display:flex;flex-direction:row;align-items:center;gap:12px;padding:6px 12px;border-bottom:1px solid rgba(255,255,255,.06);background:#1e1f29;flex-shrink:0;min-height:40px}.flat-terminal-wrapper__header-main{display:flex;align-items:center;gap:10px;min-width:0;flex:1 1 auto;overflow:hidden}.flat-terminal-wrapper__header-meta{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex:0 0 auto;flex-wrap:nowrap}.flat-terminal-wrapper__statusbar{display:flex;align-items:center;gap:10px;padding:6px 12px;flex-shrink:0;background:#1e1f29;border-top:1px solid rgba(255,255,255,.06);min-height:32px;box-sizing:border-box}.flat-terminal-wrapper__statusbar .flat-terminal-wrapper__cwd,.flat-terminal-wrapper__statusbar .flat-terminal-wrapper__context{background:transparent;border-color:#ffffff0a}.flat-terminal-wrapper__statusbar-spacer{flex:1 1 auto}.flat-terminal-wrapper__buildings{display:inline-flex;align-items:center;gap:4px;padding:2px;background:#ffffff0a;border:1px solid rgba(255,255,255,.06);border-radius:10px}.flat-terminal-wrapper__building-btn{display:inline-flex;align-items:center;justify-content:center;width:26px;height:22px;padding:0;color:#6272a4;background:transparent;border:none;border-radius:7px;cursor:pointer;transition:background .15s ease,color .15s ease}.flat-terminal-wrapper__building-btn:hover{color:#f8f8f2;background:#ffffff14}.flat-terminal-wrapper__building-btn--offline{color:#ffb86cbf}.flat-terminal-wrapper__building-btn--offline:hover{color:#ffb86c}.flat-terminal-wrapper__building-btn--active{color:#f8f8f2;background:#bd93f947;box-shadow:0 0 0 1px #bd93f973}.flat-terminal-wrapper__building-btn--active:hover{background:#bd93f95c}.flat-terminal-wrapper__detached{display:inline-flex;align-items:center;gap:6px;padding:3px 9px;font-size:11px;font-weight:500;color:#ffb86c;background:#ffb86c1f;border:1px solid rgba(255,184,108,.35);border-radius:10px;animation:blink 1.6s ease-in-out infinite}.flat-terminal-wrapper__area-dir{display:inline-flex;align-items:center;gap:5px;padding:3px 8px;font-size:11px;font-family:SF Mono,Menlo,Consolas,monospace;color:#9a9caa;background:#ffffff08;border:1px solid rgba(255,255,255,.05);border-radius:10px;cursor:pointer;max-width:240px;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:background .15s ease,color .15s ease,border-color .15s ease}.flat-terminal-wrapper__area-dir:hover{background:#ffffff14;color:#f8f8f2;border-color:#ffffff24}.flat-terminal-wrapper__area-dir-name{overflow:hidden;text-overflow:ellipsis}.flat-terminal-wrapper__area-dir-branch{display:inline-flex;align-items:center;gap:3px;color:#8be9fd;opacity:.85}.flat-terminal-wrapper__branch-ahead{display:inline-flex;align-items:center;color:#50fa7b}.flat-terminal-wrapper__branch-behind{display:inline-flex;align-items:center;color:#ffb86c}.flat-terminal-wrapper__area-fetch{display:inline-flex;align-items:center;padding:1px 3px;border-radius:4px;color:#6272a4;cursor:pointer;transition:background .15s ease,color .15s ease}.flat-terminal-wrapper__area-fetch:hover{background:#ffffff14;color:#f8f8f2}.flat-terminal-wrapper__area-fetch--fetching{animation:blink 1s ease-in-out infinite}.flat-terminal-wrapper__context-label{color:#6272a4;margin-right:2px}.flat-terminal-wrapper__context-free{color:#6272a4;font-size:10px}.flat-terminal-wrapper__actions{display:inline-flex;align-items:center;gap:4px;padding:2px;background:#ffffff0a;border:1px solid rgba(255,255,255,.06);border-radius:10px}.flat-terminal-wrapper__action-btn{display:inline-flex;align-items:center;justify-content:center;width:26px;height:24px;padding:0;font-size:12px;line-height:1;color:#6272a4;background:transparent;border:none;border-radius:7px;cursor:pointer;transition:background .15s ease,color .15s ease,box-shadow .15s ease}.flat-terminal-wrapper__action-btn:hover:not(:disabled){color:#f8f8f2;background:#ffffff0f}.flat-terminal-wrapper__action-btn:disabled{opacity:.35;cursor:not-allowed}.flat-terminal-wrapper__action-btn--active{color:#f8f8f2;background:#bd93f947;box-shadow:0 0 0 1px #bd93f973}.flat-terminal-wrapper__action-btn--active:hover{background:#bd93f95c}.flat-terminal-wrapper__action-btn--danger{color:#ff5555d9}.flat-terminal-wrapper__action-btn--danger:hover{color:#f55;background:#ff55551f}.flat-terminal-wrapper__action-btn--confirm{color:#f55;background:#ff55552e;box-shadow:0 0 0 1px #ff555580;animation:blink 1s ease-in-out infinite}.flat-terminal-wrapper__more{position:relative;display:inline-flex}.flat-terminal-wrapper__more-menu{position:absolute;top:calc(100% + 4px);right:0;min-width:220px;padding:4px;background:#363848;border:1px solid rgba(255,255,255,.08);border-radius:8px;box-shadow:0 8px 28px #00000073;z-index:100}.flat-terminal-wrapper__more-item{display:flex;align-items:center;gap:8px;width:100%;padding:6px 10px;font-size:12px;color:#f8f8f2;background:transparent;border:none;border-radius:6px;cursor:pointer;text-align:left;transition:background .15s ease,color .15s ease}.flat-terminal-wrapper__more-item:hover:not(:disabled){background:#ffffff0f}.flat-terminal-wrapper__more-item:disabled{opacity:.45;cursor:not-allowed}.flat-terminal-wrapper__more-item--danger{color:#ff5555e6}.flat-terminal-wrapper__more-item--danger:hover:not(:disabled){color:#f55;background:#ff55551f}.flat-terminal-wrapper__more-divider{height:1px;margin:4px 2px;background:#ffffff0f}.flat-terminal-wrapper__header-info{display:flex;flex-direction:row;align-items:baseline;gap:8px;min-width:0;overflow:hidden}.flat-terminal-wrapper__header-name{font-size:13px;font-weight:600;color:#f8f8f2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.flat-terminal-wrapper__header-status{font-size:10px;text-transform:capitalize;flex-shrink:0}.flat-terminal-wrapper__header-task{font-size:11px;color:#6272a4;max-width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:2px 8px;border-radius:10px;background:#ffffff0a;border:1px solid rgba(255,255,255,.06);flex-shrink:1}.flat-terminal-wrapper__cwd{display:inline-flex;align-items:center;gap:6px;padding:4px 9px;font-size:11px;color:#9a9caa;background:#ffffff0a;border:1px solid rgba(255,255,255,.06);border-radius:10px;cursor:pointer;max-width:240px;transition:background .15s ease,border-color .15s ease,color .15s ease}.flat-terminal-wrapper__cwd:hover{background:#ffffff14;border-color:#ffffff24;color:#f8f8f2}.flat-terminal-wrapper__cwd-icon{font-size:12px;line-height:1}.flat-terminal-wrapper__cwd-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:SF Mono,Menlo,Consolas,monospace}.flat-terminal-wrapper__context{display:inline-flex;align-items:center;gap:6px;padding:4px 9px;font-size:11px;color:#9a9caa;background:#ffffff0a;border:1px solid rgba(255,255,255,.06);border-radius:10px;cursor:pointer;transition:background .15s ease,border-color .15s ease}.flat-terminal-wrapper__context:hover{background:#ffffff14;border-color:#ffffff24}.flat-terminal-wrapper__context-icon{font-size:12px;line-height:1}.flat-terminal-wrapper__context-bar{position:relative;width:56px;height:5px;border-radius:3px;background:#ffffff14;overflow:hidden}.flat-terminal-wrapper__context-bar-fill{position:absolute;left:0;top:0;height:100%;border-radius:3px;transition:width .2s ease,background-color .2s ease}.flat-terminal-wrapper__context-tokens{font-family:SF Mono,Menlo,Consolas,monospace;font-size:11px;font-weight:600;font-variant-numeric:tabular-nums}.flat-terminal-wrapper__context-warning{font-size:11px;opacity:.8}.flat-terminal-wrapper__view-mode{display:inline-flex;align-items:center;padding:2px;gap:2px;background:#ffffff0a;border:1px solid rgba(255,255,255,.06);border-radius:10px}.flat-terminal-wrapper__view-mode-btn{display:inline-flex;align-items:center;gap:5px;padding:4px 9px;font-size:11px;font-weight:500;color:#6272a4;background:transparent;border:none;border-radius:8px;cursor:pointer;transition:background .15s ease,color .15s ease,box-shadow .15s ease}.flat-terminal-wrapper__view-mode-btn:hover{color:#f8f8f2;background:#ffffff0a}.flat-terminal-wrapper__view-mode-btn--active{color:#f8f8f2;background:#bd93f947;box-shadow:0 0 0 1px #bd93f980,0 1px 3px #00000040}.flat-terminal-wrapper__view-mode-btn--active:hover{background:#bd93f95c}.flat-terminal-wrapper__view-mode-icon{font-size:13px;line-height:1}.flat-terminal-wrapper__view-mode-label{line-height:1}.flat-terminal-wrapper__theme{display:inline-flex;align-items:center}.flat-terminal-wrapper__theme .theme-selector-trigger{padding:4px 9px;font-size:11px;border-radius:10px;background:#ffffff0a;border:1px solid rgba(255,255,255,.06)}.flat-terminal-wrapper__theme .theme-selector-trigger:hover{background:#ffffff14;border-color:#ffffff24}.flat-terminal-wrapper__inspector-toggle{display:inline-flex;align-items:center;gap:5px;padding:4px 9px;font-size:11px;font-weight:500;color:#9a9caa;background:#ffffff0a;border:1px solid rgba(255,255,255,.06);border-radius:10px;cursor:pointer;transition:background .15s ease,border-color .15s ease,color .15s ease,box-shadow .15s ease}.flat-terminal-wrapper__inspector-toggle:hover{color:#f8f8f2;background:#ffffff14;border-color:#ffffff24}.flat-terminal-wrapper__inspector-toggle--active{color:#f8f8f2;background:#bd93f938;border-color:#bd93f98c;box-shadow:0 0 0 1px #bd93f959,0 1px 3px #00000040}.flat-terminal-wrapper__inspector-toggle--active:hover{background:#bd93f952}.flat-terminal-wrapper__inspector-icon{display:inline-flex;align-items:center;justify-content:center;line-height:1}.flat-terminal-wrapper__inspector-label{line-height:1}@media(max-width:1100px){.flat-terminal-wrapper__view-mode-label,.flat-terminal-wrapper__inspector-label{display:none}.flat-terminal-wrapper__cwd{max-width:160px}}.flat-terminal-wrapper .guake-output{flex:1 1 auto;min-height:0;overflow-y:auto;padding:14px 18px}.flat-terminal-wrapper .guake-output::-webkit-scrollbar{width:6px}.flat-terminal-wrapper .guake-output::-webkit-scrollbar-track{background:transparent}.flat-terminal-wrapper .guake-output::-webkit-scrollbar-thumb{background:#ffffff1a;border-radius:3px}.flat-terminal-wrapper .guake-input-container{position:relative;flex-shrink:0;border-top:1px solid rgba(255,255,255,.06);background:#1e1f29}.flat-terminal-wrapper .guake-search-bar,.flat-terminal-wrapper .atp-search-bar{position:sticky;top:0;z-index:10;background:#1e1f29}.flat-terminal-wrapper .guake-handle,.flat-terminal-wrapper .guake-side-panel-resize,.flat-terminal-wrapper .atp-resize-handle{display:none}.flat-terminal-wrapper .compacting-indicator{padding:12px;margin:8px}@keyframes blink{0%,to{opacity:1}50%{opacity:.3}}.flat-inspector{display:flex;flex-direction:column;min-width:0;min-height:0;height:100%;background:#1e1f29;border-left:1px solid rgba(255,255,255,.06);overflow:hidden;animation:flat-inspector-slide-in .22s ease}.flat-inspector__header{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border-bottom:1px solid rgba(255,255,255,.06);background:#21222c;flex-shrink:0}.flat-inspector__tabs{display:inline-flex;align-items:center;gap:4px;padding:2px;background:#00000040;border:1px solid rgba(255,255,255,.06);border-radius:6px}.flat-inspector__tab{padding:4px 10px;font-size:12px;font-weight:500;color:#6272a4;background:transparent;border:none;border-radius:4px;cursor:pointer;transition:background .15s ease,color .15s ease}.flat-inspector__tab:hover{color:#f8f8f2}.flat-inspector__tab--active{color:#f8f8f2;background:#ffffff14}.flat-inspector__close{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;font-size:13px;color:#6272a4;background:transparent;border:1px solid transparent;border-radius:6px;cursor:pointer;transition:background .15s ease,color .15s ease,border-color .15s ease}.flat-inspector__close:hover{color:#f8f8f2;background:#ffffff0f;border-color:#ffffff1a}.flat-inspector__body{flex:1 1 auto;min-height:0;min-width:0;overflow-y:auto;overflow-x:hidden;display:flex;flex-direction:column}.flat-inspector__body .unit-panel{flex:1 1 auto;min-height:0;min-width:0;padding:10px}.flat-inspector__empty{display:flex;align-items:center;justify-content:center;flex:1;color:#6272a4;font-size:13px}@keyframes flat-inspector-slide-in{0%{opacity:0;transform:translate(12px)}to{opacity:1;transform:translate(0)}}@media(max-width:1024px){.flat-view,.flat-view--with-inspector{grid-template-columns:1fr}.flat-right,.flat-inspector{display:none}}@media(min-width:1400px){.flat-view{grid-template-columns:minmax(280px,400px) 1fr}.flat-view--with-inspector{grid-template-columns:minmax(280px,400px) 1fr 360px}}.flat-bottom-panel{display:flex;flex-direction:column;flex-shrink:0;height:250px;min-height:0;background:#1e1f29;border-top:1px solid rgba(255,255,255,.08);overflow:hidden}.flat-bottom-panel__header{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:4px 10px;background:#21222c;border-bottom:1px solid rgba(255,255,255,.06);flex-shrink:0;min-height:28px}.flat-bottom-panel__title{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:500;color:#f8f8f2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.flat-bottom-panel__muted{color:#6272a4;font-weight:400;font-size:10px}.flat-bottom-panel__close{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;padding:0;color:#6272a4;background:transparent;border:none;border-radius:6px;cursor:pointer;transition:background .15s ease,color .15s ease}.flat-bottom-panel__close:hover{color:#f8f8f2;background:#ffffff14}.flat-bottom-panel__body{flex:1 1 auto;min-height:0;display:flex;background:#282a36}.flat-bottom-panel__body>*{flex:1 1 auto;min-height:0}.flat-bottom-panel__placeholder{flex:1 1 auto;display:flex;align-items:center;justify-content:center;color:#6272a4;font-size:12px}
|