UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1 lines • 8.12 kB
import{n as e,r as t}from"./rolldown-runtime-CNOWq4Kh.js";import{BA as n,Gn as r,Gp as i,Wn as a,Wp as o,dO as s,dj as c,mj as l,pj as u,uO as d,zA as f}from"./control-ui-boot-shared-DFTSUQQ0.js";import{C as p,O as m,Rt as h,U as g,d as _,f as v,g as y,j as b,l as x,m as S,o as C,p as w,s as T,u as E,v as ee,x as D}from"./solid-runtime-C416s-HC.js";import{mo as te,po as ne}from"./control-ui-boot-chat-DewxEbIm.js";import{a as O,n as k,o as re,r as ie,s as ae,t as oe}from"./session-goal-display-EV4XfCB7.js";var se=t({ChatGoal:()=>le,ChatGoalActions:()=>M,ChatGoalBody:()=>N,ChatGoalMetrics:()=>P,ChatGoalRecoveryAction:()=>I,ChatGoalRecoveryMessage:()=>F,ChatGoalRecoveryNotice:()=>ue,GoalIcon:()=>A});function A(){return b(d,{"aria-hidden":`true`,get children(){return[L(),R(),z()]}})}function j(e){let t=()=>e.goal.status===`active`?i(1e3):0;var n=B();return _(n,()=>k(re(e.goal,t()))),x(()=>w(e.class),(e,t)=>{C(n,e,t)}),n}function M(e){let t=t=>!e.resumeRecovery&&e.canAct&&!!e.onGoalAction&&(t===`edit`?!!e.onGoalEdit&&e.goal.status!==`complete`:t===`pause`?e.goal.status===`active`:t!==`resume`||e.goal.status!==`active`);var n=H(),r=n.firstChild,i=r.nextSibling;return _(n,b(m,{get when(){return v(()=>!!e.resumeRecovery)()?!e.resumeRecovery.pending:e.resumeRecovery},get children(){var t=V(),n=t.firstChild;return t._$$click=()=>void e.resumeRecovery?.onCheck(),_(t,b(f,{name:`play`}),n),_(n,()=>l(`chat.goals.retryResume`)),x(()=>!e.connected,e=>{y(t,`disabled`,e)}),t}}),r),_(n,b(p,{each:pe,children:n=>v(()=>v(()=>!!t(n))()?(()=>{var t=U(),r=t.firstChild,i=r.firstChild;return t._$owner=h(),r._$$click=()=>{n===`edit`?e.onGoalEdit?.(e.goal):e.onGoalAction?.(e.goal.id,n)},_(r,b(f,{get name(){return me[n]}}),i),_(i,()=>l(`chat.goals.${n}Chip`)),x(()=>({e:l(n===`resume`&&e.resumeBusy?`chat.goals.busy`:`chat.goals.${n}`),t:[`agent-chat__goal-action`,`agent-chat__goal-${n}`],a:l(`chat.goals.${n}`),o:n===`resume`&&e.resumeBusy,i:n===`resume`&&e.resumeBusy?.5:void 0}),({e,t:n,a:i,o:a,i:o},s)=>{e!==s?.e&&y(t,`content`,e),C(r,n,s?.t),i!==s?.a&&y(r,`aria-label`,i),a!==s?.o&&y(r,`disabled`,a),o!==s?.i&&ee(r,`opacity`,o)}),t})():null)}),i),n}function N(e){return[(()=>{var t=W(),n=t.firstChild,r=e.objectiveRef;return typeof r==`function`||Array.isArray(r)?S(()=>r,t):e.objectiveRef=t,x(()=>e.goal.objective,e=>{n.data=e}),t})(),v(()=>v(()=>!(!e.goal.lastStatusNote||e.resumeRecovery))()?(()=>{var t=G();return _(t,()=>e.goal.lastStatusNote),t})():null)]}function P(e){var t=K(),n=t.firstChild;return _(t,(()=>{var t=v(()=>!!O(e.goal));return()=>t()?[(()=>{var t=q();return _(t,()=>O(e.goal)),t})(),J()]:null})(),n),_(n,b(m,{get when(){return e.live},get fallback(){return k(re(e.goal,Date.now()))},get children(){return b(j,{get goal(){return e.goal}})}})),t}function ce(e){let t=()=>e.goal.status!==`active`,n=()=>t()&&!e.expanded&&!e.resumeRecovery?e.goal.lastStatusNote:void 0,i=()=>e.resumeRecovery?l(e.resumeRecovery.pending?`chat.goals.resuming`:`chat.goals.resumeUnconfirmed`):ie(e.goal.status);var a=Y(),o=a.firstChild,s=o.firstChild,c=s.nextSibling,u=c.firstChild,d=u.firstChild,p=u.nextSibling,m=c.nextSibling,g=m.firstChild,S=o.nextSibling,w=S.firstChild,T=w.firstChild,E=T.nextSibling;return _(s,(()=>{var t=v(()=>!!e.resumeRecovery?.pending);return()=>t()?X():v(()=>e.goal.status===`active`)()?b(A,{}):b(f,{get name(){return fe[e.goal.status]}})})()),u._$owner=h(),_(d,i),_(p,()=>e.goal.objective),_(o,b(j,{get goal(){return e.goal},class:`agent-chat__goal-elapsed`}),m),_(m,b(M,{get goal(){return e.goal},get canAct(){return e.canAct},get resumeBusy(){return e.resumeBusy},get resumeRecovery(){return e.resumeRecovery},get connected(){return e.connected},get onGoalAction(){return e.onGoalAction},get onGoalEdit(){return e.onGoalEdit}}),g),g._$$click=()=>e.onExpandedChange(!e.expanded),_(g,b(f,{get name(){return e.expanded?`chevronDown`:`chevronRight`}})),_(w,b(N,{get goal(){return e.goal},get resumeRecovery(){return e.resumeRecovery},get objectiveRef(){return r(!1,!0,{revision:()=>e.goal.objective})}}),T),_(w,b(P,{get goal(){return e.goal}}),E),x(()=>({e:[`agent-chat__goal`,`agent-chat__goal--${e.resumeRecovery?`resuming`:e.goal.status}`],t:String(e.expanded),a:e.resumeRecovery?`${i()}: ${e.goal.objective}`:oe(e.goal),o:e.resumeRecovery?.pending?`true`:`false`,i:n()??``,n:!n(),s:n()?`0`:void 0,h:e.expanded?`true`:`false`,r:l(e.expanded?`chat.goals.hideDetails`:`chat.goals.showDetails`),d:String(e.expanded),l:e.expanded?`false`:`true`,u:!e.expanded}),({e,t,a:n,o:r,i,n:o,s,h:c,r:l,d:f,l:p,u:m},h)=>{C(a,e,h?.e),t!==h?.t&&y(a,`data-expanded`,t),n!==h?.a&&y(a,`aria-label`,n),r!==h?.o&&y(a,`aria-busy`,r),i!==h?.i&&(u.content=i),o!==h?.n&&y(u,`disabled`,o),s!==h?.s&&y(d,`tabindex`,s),c!==h?.h&&y(g,`aria-expanded`,c),l!==h?.r&&y(g,`aria-label`,l),f!==h?.d&&y(S,`data-expanded`,f),p!==h?.l&&y(S,`aria-hidden`,p),m!==h?.u&&y(S,`inert`,m)}),a}function le(e){return b(m,{get when(){return e.goal!==void 0},get children(){return b(ce,{get goal(){return e.goal},get expanded(){return e.expanded},get canAct(){return e.canAct},get resumeBusy(){return e.resumeBusy},get resumeRecovery(){return e.resumeRecovery},get connected(){return e.connected},get onGoalAction(){return e.onGoalAction},get onGoalEdit(){return e.onGoalEdit},get onExpandedChange(){return e.onExpandedChange}})}})}function ue(e){var t=Z(),n=t.firstChild,r=n.nextSibling;return _(n,b(f,{name:`alertTriangle`})),_(r,b(F,{get recovery(){return e.recovery}})),_(t,b(I,{get recovery(){return e.recovery},get connected(){return e.connected}}),null),t}function F(e){return[(()=>{var t=Q();return _(t,()=>l(e.recovery.pending?`chat.goals.checking`:`chat.goals.recoveryTitle`)),t})(),(()=>{var t=B();return _(t,()=>l(e.recovery.retired===`expired`?`chat.goals.recoveryExpired`:e.recovery.retired===`invalid`?`chat.goals.recoveryInvalid`:`chat.goals.recoveryHint`)),t})()]}function I(e){var t=de();return t._$$click=()=>void e.recovery.onCheck(),_(t,()=>l(e.recovery.retired?`chat.goals.refreshCurrent`:`chat.goals.checkOutcome`)),x(()=>!e.connected||e.recovery.pending,e=>{y(t,`disabled`,e)}),t}var L,R,z,B,V,H,U,W,G,K,q,J,Y,X,Z,Q,de,fe,pe,me;function $(){return($=e((()=>{E(),g(),ae(),n(),a(),s(),ne(),c(),o(),L=D(`<svg><path d="M12 13V2l8 4-8 4"></svg>`,2),R=D(`<svg><path d="M20.561 10.222a9 9 0 1 1-12.55-5.29"></svg>`,2),z=D(`<svg><path d="M8.002 9.997a5 5 0 1 0 8.9 2.02"></svg>`,2),B=D(`<span>`),V=D(`<button class="agent-chat__goal-action agent-chat__goal-resume"type=button><span class=agent-chat__goal-action-label>`),H=D(`<span class=agent-chat__goal-command-actions><!><!>`),U=D(`<openclaw-tooltip><button type=button><span class=agent-chat__goal-action-label>`,1),W=D(`<div class=agent-chat__goal-detail-objective> `),G=D(`<div class=agent-chat__goal-detail-note>`),K=D(`<div class=agent-chat__goal-detail-meta><span class=agent-chat__goal-detail-duration>`),q=D(`<span class=agent-chat__goal-detail-usage>`),J=D(`<span class=agent-chat__goal-detail-separator aria-hidden=true>·`),Y=D(`<div role=group><div class=agent-chat__goal-row><span class=agent-chat__goal-icon aria-hidden=true></span><span class=agent-chat__goal-copy><openclaw-tooltip><span class=agent-chat__goal-label role=status></span></openclaw-tooltip><span class=agent-chat__goal-objective></span></span><span class=agent-chat__goal-actions><button class="agent-chat__goal-action agent-chat__goal-expand"type=button></button></span></div><div class=agent-chat__goal-detail><div class=agent-chat__goal-detail-content><!><!>`,1),X=D(`<span class=session-run-spinner>`),Z=D(`<div class="chat-composer-neighbor-card chat-composer-neighbor-card--warn"role=status><span class=chat-composer-neighbor-card__icon aria-hidden=true></span><div class=chat-composer-neighbor-card__copy>`),Q=D(`<strong>`),de=D(`<button class="btn btn--sm"type=button>`),u(te),fe={paused:`pause`,blocked:`alertTriangle`,usage_limited:`alertTriangle`,budget_limited:`alertTriangle`,complete:`check`},pe=[`edit`,`pause`,`resume`,`clear`],me={edit:`penLine`,pause:`pause`,resume:`play`,clear:`trash`},T([`click`])})))()}export{F as a,$ as c,I as i,N as n,A as o,P as r,se as s,M as t};