@lobu/runtime-server 21.0.0 → 21.1.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/catalogs/automations.json +0 -8
- package/dist/component.json +1 -1
- package/dist/connectors/github.ts +269 -194
- package/dist/connectors/google_calendar.ts +36 -132
- package/dist/connectors/jira.ts +13 -4
- package/dist/connectors/producthunt.ts +3 -1
- package/dist/connectors/reddit.ts +34 -4
- package/dist/db/migrations/20260928120000_classification_consolidation.sql +51 -0
- package/dist/dependencies.bun.lock +11 -11
- package/dist/owletto/dist/assets/_-00GgOtdu.js +1 -0
- package/dist/owletto/dist/assets/{_-DrcppoWh.js → _-XlUwOWCI.js} +2 -2
- package/dist/owletto/dist/assets/{_agentId-HNcmgH56.js → _agentId-B2DrawIk.js} +1 -1
- package/dist/owletto/dist/assets/_agentId-CS0AcWH2.js +1 -0
- package/dist/owletto/dist/assets/{_automationId-BCfrLnUS.js → _automationId-BLnqLtUv.js} +1 -1
- package/dist/owletto/dist/assets/{_connectorKey._connectionId-126-iG9w.js → _connectorKey._connectionId-DcUWoZ-C.js} +1 -1
- package/dist/owletto/dist/assets/{_connectorKey.index-CywE9A3N.js → _connectorKey.index-C_yKycN_.js} +1 -1
- package/dist/owletto/dist/assets/{_conversationId-CNETA_rY.js → _conversationId-CpuEvflw.js} +1 -1
- package/dist/owletto/dist/assets/{_deploymentId-CAVpXf8s.js → _deploymentId-BL9tnDFl.js} +1 -1
- package/dist/owletto/dist/assets/_name-DlxjWkKk.js +1 -0
- package/dist/owletto/dist/assets/{_owner-D2eh4R90.js → _owner-Cg50UU6m.js} +1 -1
- package/dist/owletto/dist/assets/_shape-BWZW4mj8.js +1 -0
- package/dist/owletto/dist/assets/_skillKey-B25fO0_O.js +1 -0
- package/dist/owletto/dist/assets/{_slug-DoIaJBbh.js → _slug-DbD-wv2m.js} +1 -1
- package/dist/owletto/dist/assets/_viewKey-BcTEvQ3N.js +1 -0
- package/dist/owletto/dist/assets/_viewKey-W4RjiUWL.js +1 -0
- package/dist/owletto/dist/assets/_viewKey-iGPCKSda.js +1 -0
- package/dist/owletto/dist/assets/{accept-invitation-BWRiEUsd.js → accept-invitation-BmQKbQem.js} +1 -1
- package/dist/owletto/dist/assets/{activity-route-view-rVdTeVXN.js → activity-route-view-BvtAoGVt.js} +1 -1
- package/dist/owletto/dist/assets/{agent-card-controls-JubkhcHt.js → agent-card-controls-bhTMPoVi.js} +1 -1
- package/dist/owletto/dist/assets/{agent-client-setup-list-Btcy4Cu1.js → agent-client-setup-list-BBbq_2B1.js} +1 -1
- package/dist/owletto/dist/assets/{agent-connect-pages-Chfqn8iL.js → agent-connect-pages-DkDlFVY5.js} +1 -1
- package/dist/owletto/dist/assets/{agent-editor-form-BrOkwfg8.js → agent-editor-form-DwHD9j1Y.js} +1 -1
- package/dist/owletto/dist/assets/{agent-guardrails-route-CHM7JbIl.js → agent-guardrails-route-0PsTrqMC.js} +1 -1
- package/dist/owletto/dist/assets/{agent-loading-shells-DsiGx1fn.js → agent-loading-shells-BQLjzMPy.js} +1 -1
- package/dist/owletto/dist/assets/{agent-permissions-matrix-L_gFvSu1.js → agent-permissions-matrix-B-Q5rmuB.js} +1 -1
- package/dist/owletto/dist/assets/{agent-skill-context-D7tOJ8Pb.js → agent-skill-context-s42Q4Wjo.js} +1 -1
- package/dist/owletto/dist/assets/{agent-skills-route-AylS-B9v.js → agent-skills-route-Cwq1QrhW.js} +1 -1
- package/dist/owletto/dist/assets/{agent-subpage-shell-B7tCQ9zd.js → agent-subpage-shell-DtzoRy6N.js} +1 -1
- package/dist/owletto/dist/assets/{agent-thread-DOYh7WLW.js → agent-thread-D7AGGjRV.js} +1 -1
- package/dist/owletto/dist/assets/agents-BqCKU4CT.js +1 -0
- package/dist/owletto/dist/assets/{agents-workbench-DOwn78eL.js → agents-workbench-Cl7FO7b3.js} +1 -1
- package/dist/owletto/dist/assets/{app._appId-fJ_RRn1Z.js → app._appId-CqYz3AOO.js} +1 -1
- package/dist/owletto/dist/assets/{automation-detail-content-CMprQht5.js → automation-detail-content-CKSywvzE.js} +1 -1
- package/dist/owletto/dist/assets/automations-BqCKU4CT.js +1 -0
- package/dist/owletto/dist/assets/{calendar-BbD1N97u.js → calendar-CHXehtu0.js} +1 -1
- package/dist/owletto/dist/assets/{callback-PELM84Lh.js → callback-DZ3YyXeV.js} +1 -1
- package/dist/owletto/dist/assets/{card-DpLjEqIc.js → card-4Ull9W6d.js} +1 -1
- package/dist/owletto/dist/assets/{claim-BLLvLOBM.js → claim-BGLCPLXq.js} +1 -1
- package/dist/owletto/dist/assets/{clients-Bd8WpHSV.js → clients-C7ubnFsS.js} +1 -1
- package/dist/owletto/dist/assets/{code-editor-DGJQDoHD.js → code-editor-BHiWR94J.js} +1 -1
- package/dist/owletto/dist/assets/connect-BNatqg6j.js +1 -0
- package/dist/owletto/dist/assets/connect._clientId-BGG2IqiQ.js +1 -0
- package/dist/owletto/dist/assets/{connected._clientId-BYGmFRCF.js → connected._clientId-7RU89sVW.js} +1 -1
- package/dist/owletto/dist/assets/{connection-B0O8OZuK.js → connection-CTaUGXl6.js} +1 -1
- package/dist/owletto/dist/assets/{connection-feed-detail-DZjtoEfm.js → connection-feed-detail-B1xieiEh.js} +1 -1
- package/dist/owletto/dist/assets/{connector-provenance-D_g9gGXU.js → connector-provenance-DRdUEmQ1.js} +1 -1
- package/dist/owletto/dist/assets/{connectors-BiMMm_QQ.js → connectors-NBwCLuZg.js} +1 -1
- package/dist/owletto/dist/assets/{consent-CIzW-960.js → consent-fmhPPlpi.js} +1 -1
- package/dist/owletto/dist/assets/{core.esm-Ds4Nuq9d.js → core.esm-C-eNiUAl.js} +1 -1
- package/dist/owletto/dist/assets/{create-BvCaqhwK.js → create-8bBbQJGY.js} +1 -1
- package/dist/owletto/dist/assets/create-Cl6cfNAp.js +1 -0
- package/dist/owletto/dist/assets/create-DrVso8O7.js +1 -0
- package/dist/owletto/dist/assets/create-automation-form-De8J-JD5.js +2 -0
- package/dist/owletto/dist/assets/{create._connectorKey--qDi1h6S.js → create._connectorKey-CHAotlsF.js} +1 -1
- package/dist/owletto/dist/assets/{cronstrue-h8_zIyZD.js → cronstrue-C5yTgk5z.js} +1 -1
- package/dist/owletto/dist/assets/deployments-C7M3fV5K.js +1 -0
- package/dist/owletto/dist/assets/{deployments-ICDss7yS.js → deployments-D1gbQwsy.js} +1 -1
- package/dist/owletto/dist/assets/{deployments-body-DulCUAMt.js → deployments-body-DycIGlnL.js} +1 -1
- package/dist/owletto/dist/assets/{device-kTL2l_cz.js → device-DyPnQkhO.js} +1 -1
- package/dist/owletto/dist/assets/{device-pin-tombstone-BmD4pv_e.js → device-pin-tombstone-CwJitllC.js} +1 -1
- package/dist/owletto/dist/assets/{device-rows-BqudjhFu.js → device-rows-BBhW1C7Y.js} +1 -1
- package/dist/owletto/dist/assets/{device._deviceId-CsLJJ6jv.js → device._deviceId-XswfXHOc.js} +1 -1
- package/dist/owletto/dist/assets/{entity-options-ErxYvMDH.js → entity-options-utGBmFX0.js} +1 -1
- package/dist/owletto/dist/assets/{entity-page-CYRAwUGO.js → entity-page-BxwuqqWk.js} +1 -1
- package/dist/owletto/dist/assets/{entity-type-page-BlAizGlz.js → entity-type-page-BrWqk6so.js} +1 -1
- package/dist/owletto/dist/assets/{event-page-DTXPxc-E.js → event-page-LIm4EDmJ.js} +1 -1
- package/dist/owletto/dist/assets/{events-feed-L3c-LLiJ.js → events-feed-C4L8mQV7.js} +1 -1
- package/dist/owletto/dist/assets/{full-page-spinner-BxcYpJXx.js → full-page-spinner-DsU-Cb3L.js} +1 -1
- package/dist/owletto/dist/assets/guardrails-CGFWCfbQ.js +1 -0
- package/dist/owletto/dist/assets/identity-uPYpPogR.js +1 -0
- package/dist/owletto/dist/assets/{index-13rywWam.js → index-1YrrvVJ4.js} +1 -1
- package/dist/owletto/dist/assets/index-BKMafTe4.js +1 -0
- package/dist/owletto/dist/assets/index-BsL1-C2-.js +1 -0
- package/dist/owletto/dist/assets/index-C58oW727.js +1 -0
- package/dist/owletto/dist/assets/{index--lEHrFE4.js → index-CQ4s6nzy.js} +1 -1
- package/dist/owletto/dist/assets/{index-DAv5S2aK.js → index-CpWKAAGX.js} +1 -1
- package/dist/owletto/dist/assets/{index-QcHQZI87.js → index-D2dcENg2.js} +1 -1
- package/dist/owletto/dist/assets/{index-CheCJomo.js → index-DCK0KhMM.js} +1 -1
- package/dist/owletto/dist/assets/{index-BRvT0VV9.js → index-DXqiRON3.js} +1 -1
- package/dist/owletto/dist/assets/index-DgEc5IvT.js +1 -0
- package/dist/owletto/dist/assets/{index-DdGjY1Hb.js → index-DtRfQcRH.js} +1530 -1530
- package/dist/owletto/dist/assets/index-DvhM9tuI.js +1 -0
- package/dist/owletto/dist/assets/{index-CFkj9iR_.js → index-DwtfHCHB.js} +1 -1
- package/dist/owletto/dist/assets/index-DyYFZjh-.js +1 -0
- package/dist/owletto/dist/assets/{index-B_-MLsof.js → index-nOYvNROJ.js} +1 -1
- package/dist/owletto/dist/assets/index-oDoJENMF.js +1 -0
- package/dist/owletto/dist/assets/index-rPdUEOa3.js +1 -0
- package/dist/owletto/dist/assets/{json-diff-BV2STDGj.js → json-diff-DYeX-xLk.js} +1 -1
- package/dist/owletto/dist/assets/{list-skeleton-CT5n4ND_.js → list-skeleton-s4GPSJ8J.js} +1 -1
- package/dist/owletto/dist/assets/{login-DKsgABYt.js → login-Di5VF2F_.js} +1 -1
- package/dist/owletto/dist/assets/{logout-D_CP-emw.js → logout-BuaQGSnw.js} +1 -1
- package/dist/owletto/dist/assets/{member-scope-gate-BTgmlfFJ.js → member-scope-gate-CJqJZk7T.js} +1 -1
- package/dist/owletto/dist/assets/{memory-browse-page-FHaJC3ML.js → memory-browse-page-Bibfs2sK.js} +1 -1
- package/dist/owletto/dist/assets/{missing-view-Bve6pJP-.js → missing-view-CD4DOaG8.js} +1 -1
- package/dist/owletto/dist/assets/{model-selector-BLCEahny.js → model-selector-XC5CI2Et.js} +1 -1
- package/dist/owletto/dist/assets/models--8mTFOLz.js +1 -0
- package/dist/owletto/dist/assets/{new-CirOK0Sw.js → new-BzkA1sq2.js} +1 -1
- package/dist/owletto/dist/assets/{new-DzapH2sV.js → new-C3f0BShb.js} +1 -1
- package/dist/owletto/dist/assets/{new-BAIGSdfp.js → new-DA5LF6iB.js} +1 -1
- package/dist/owletto/dist/assets/{oauth-workspace-access-BF7jaswv.js → oauth-workspace-access-D6epOq0R.js} +1 -1
- package/dist/owletto/dist/assets/{organization-D9RPsWG-.js → organization-DOtBRqDQ.js} +1 -1
- package/dist/owletto/dist/assets/{permissions-BlRONw-u.js → permissions-D8uJHINS.js} +1 -1
- package/dist/owletto/dist/assets/{proposal-review-shell-uskeFIUr.js → proposal-review-shell-C3K-JXjb.js} +1 -1
- package/dist/owletto/dist/assets/{recent-CmJ4Is6V.js → recent-CFcWceBl.js} +1 -1
- package/dist/owletto/dist/assets/{renderer-Dyf4t8kR.js → renderer-1nRJFMGx.js} +1 -1
- package/dist/owletto/dist/assets/{reset-password-BVIeE1Zm.js → reset-password-9RTWhBEb.js} +1 -1
- package/dist/owletto/dist/assets/{runs-CzBeUzlQ.js → runs-_yVh6PPB.js} +1 -1
- package/dist/owletto/dist/assets/{runs-panel-D7l1uLGm.js → runs-panel-B2852xus.js} +1 -1
- package/dist/owletto/dist/assets/{runs-table-dATyiBg2.js → runs-table--dnFQatY.js} +1 -1
- package/dist/owletto/dist/assets/{schema-value-normalization-DgMkyVVE.js → schema-value-normalization-BspxVEGy.js} +1 -1
- package/dist/owletto/dist/assets/{settings-Co1wj_m6.js → settings-9lDASETT.js} +1 -1
- package/dist/owletto/dist/assets/settings-DQo_ZS2P.js +1 -0
- package/dist/owletto/dist/assets/skills-a5xQ4RE9.js +1 -0
- package/dist/owletto/dist/assets/{switch-DDkPrV3p.js → switch-CxDXvPGE.js} +1 -1
- package/dist/owletto/dist/assets/{use-applied-views-DELwQQh7.js → use-applied-views-DvMT3wap.js} +1 -1
- package/dist/owletto/dist/assets/{use-mention-search-CGA3AaKm.js → use-mention-search-CeTEE3oE.js} +1 -1
- package/dist/owletto/dist/assets/{view-frame-DDr-Xtet.js → view-frame-HoBawpT2.js} +1 -1
- package/dist/owletto/dist/index.html +1 -1
- package/dist/providers.json +0 -1
- package/dist/server-main.bundle.mjs +2365 -3969
- package/npm-shrinkwrap.json +41 -41
- package/package.json +1 -1
- package/vendor/connector-sdk/dist/connector-types.d.ts +0 -2
- package/vendor/connector-sdk/package.json +1 -1
- package/vendor/core/dist/contracts/tools/manage-auth-profiles.d.ts +14 -0
- package/vendor/core/dist/contracts/tools/manage-auth-profiles.js +12 -1
- package/vendor/core/dist/contracts/tools/manage-automations.d.ts +0 -10
- package/vendor/core/dist/contracts/tools/manage-automations.js +0 -33
- package/vendor/core/dist/contracts/tools/manage-classifiers.d.ts +4 -34
- package/vendor/core/dist/contracts/tools/manage-classifiers.js +13 -44
- package/vendor/core/dist/contracts/tools/manage-entity.d.ts +0 -9
- package/vendor/core/dist/contracts/tools/manage-entity.js +0 -6
- package/vendor/core/dist/contracts/tools/view-attach.d.ts +20 -0
- package/vendor/core/dist/contracts/tools/view-attach.js +45 -0
- package/vendor/core/dist/contracts/worker/protocol.d.ts +17 -0
- package/vendor/core/dist/contracts/worker/protocol.js +12 -1
- package/vendor/core/dist/index.d.ts +1 -1
- package/vendor/core/dist/provider-config-types.d.ts +0 -9
- package/vendor/core/dist/sdk-compat.d.ts +1 -1
- package/vendor/core/package.json +6 -1
- package/vendor/views/dist/api.d.ts +9 -4
- package/vendor/views/dist/api.js +6 -2
- package/vendor/views/package.json +1 -1
- package/dist/owletto/dist/assets/_-CwFknmeA.js +0 -1
- package/dist/owletto/dist/assets/_agentId-Cr57JKYx.js +0 -1
- package/dist/owletto/dist/assets/_name-BP7OlVxL.js +0 -1
- package/dist/owletto/dist/assets/_shape-BqV8tSfw.js +0 -1
- package/dist/owletto/dist/assets/_skillKey-2xTjhL_C.js +0 -1
- package/dist/owletto/dist/assets/_viewKey-8ePnWEg-.js +0 -1
- package/dist/owletto/dist/assets/_viewKey-D8rjUFLV.js +0 -1
- package/dist/owletto/dist/assets/_viewKey-DhVOkzYd.js +0 -1
- package/dist/owletto/dist/assets/agents-0ncYwbz6.js +0 -1
- package/dist/owletto/dist/assets/automations-0ncYwbz6.js +0 -1
- package/dist/owletto/dist/assets/connect-Cx49f4J0.js +0 -1
- package/dist/owletto/dist/assets/connect._clientId-BDFBqKSA.js +0 -1
- package/dist/owletto/dist/assets/create--fsxroj2.js +0 -1
- package/dist/owletto/dist/assets/create-BqL-ahEf.js +0 -1
- package/dist/owletto/dist/assets/create-automation-form-DN2w080o.js +0 -2
- package/dist/owletto/dist/assets/deployments-BROg1Te8.js +0 -1
- package/dist/owletto/dist/assets/guardrails-Dh4adTXY.js +0 -1
- package/dist/owletto/dist/assets/identity-B8lKn0je.js +0 -1
- package/dist/owletto/dist/assets/index-BUp24ZJr.js +0 -1
- package/dist/owletto/dist/assets/index-Bq-q4Y7E.js +0 -1
- package/dist/owletto/dist/assets/index-CgBgOElA.js +0 -1
- package/dist/owletto/dist/assets/index-CpiW66xK.js +0 -1
- package/dist/owletto/dist/assets/index-DBi2Xr3i.js +0 -1
- package/dist/owletto/dist/assets/index-DHOha5OJ.js +0 -1
- package/dist/owletto/dist/assets/index-Dkyl7l6E.js +0 -1
- package/dist/owletto/dist/assets/index-kq4537-S.js +0 -1
- package/dist/owletto/dist/assets/models-C4N7LQAW.js +0 -1
- package/dist/owletto/dist/assets/settings-BK1GHmzb.js +0 -1
- package/dist/owletto/dist/assets/skills-DF53JcYt.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r,j as e,bX as le,bY as de,bZ as ue,b_ as me,b$ as P,ad as ce,B,Z as ns,a as ys,d1 as js,cy as as,dD as _s,dE as Ns,S as Pt,ac as N,al as R,aV as We,dF as Tt,cU as bs,cW as ks,dG as Ss,cm as os,cX as ws,bB as Mt,dH as Cs,cv as ot,cw as Ue,aR as at,dI as jt,bA as is,P as Ge,cr as Es,ap as Os,ai as As,d3 as Fs,dJ as Ps,dK as Ts,dL as Ms,dM as Ls,dN as Rs,ah as Ds,L as $s,a3 as rs,dO as Is,bz as qs,bf as Ks,dP as Lt,dQ as Ws,dR as Bs,cf as Us,dS as Vs,dT as ft,s as zs,dU as Qs,dV as Js,dW as Gs,dX as Hs,dY as Xs,dZ as Ys,d_ as Zs,d$ as en,e0 as tn,bC as sn,c1 as nn}from"./index-DdGjY1Hb.js";import{c as an}from"./cronstrue-h8_zIyZD.js";import{C as on,f as rn}from"./entity-options-ErxYvMDH.js";import{S as cn}from"./switch-DDkPrV3p.js";import{a as ln,A as dn}from"./device-automation-BIjs7DZJ.js";import{M as un}from"./model-selector-BLCEahny.js";import{b as mn}from"./skill-editor-D_W3QlRz.js";import{C as nt}from"./code-editor-DGJQDoHD.js";import{u as hn,M as Rt,a as Dt,s as xn,o as gn,b as pn,c as fn,d as vn,e as yn,v as jn,r as _n}from"./use-mention-search-CGA3AaKm.js";const tt=[{value:"*/15 * * * *",label:"Every 15 minutes"},{value:"0 * * * *",label:"Every hour"},{value:"0 */6 * * *",label:"Every 6 hours"},{value:"0 9 * * *",label:"Daily at 9:00 AM"},{value:"0 18 * * *",label:"Daily at 6:00 PM"},{value:"0 9 * * 1-5",label:"Weekdays at 9:00 AM"},{value:"0 9 * * 1",label:"Weekly · Monday 9:00 AM"},{value:"0 9 1 * *",label:"Monthly · 1st at 9:00 AM"},{value:"custom",label:"Custom cron…"}];function Nn(n){const t=n.trim();if(!t)return null;try{return an.toString(t,{throwExceptionOnParseError:!0})}catch{return null}}function bn({value:n,onChange:t,placeholder:s="No schedule",className:c}){const u=n??"",m=tt.some(p=>p.value===u),[l,o]=r.useState(!m&&u!==""),i=p=>{p==="custom"?o(!0):(o(!1),t(p))},y=u?Nn(u):null,S=u?e.jsx("p",{className:y?"text-xs text-muted-foreground":"text-xs text-destructive",children:y??"Not a valid cron expression."}):null;return!u&&!l?e.jsxs(le,{onValueChange:i,children:[e.jsx(de,{className:c??"w-full",children:e.jsx(ue,{placeholder:s})}),e.jsx(me,{children:tt.map(p=>e.jsxs(P,{value:p.value,children:[p.label,p.value!=="custom"&&e.jsx("span",{className:"ml-2 text-xs text-muted-foreground font-mono",children:p.value})]},p.value))})]}):e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[l?e.jsx(ce,{placeholder:"0 */6 * * *",value:u,onChange:p=>t(p.target.value),className:"font-mono text-sm flex-1"}):e.jsxs(le,{value:u,onValueChange:i,children:[e.jsx(de,{className:c??"w-full flex-1",children:e.jsx(ue,{children:tt.find(p=>p.value===u)?.label??u})}),e.jsx(me,{children:tt.map(p=>e.jsxs(P,{value:p.value,children:[p.label,p.value!=="custom"&&e.jsx("span",{className:"ml-2 text-xs text-muted-foreground font-mono",children:p.value})]},p.value))})]}),e.jsx(B,{type:"button",variant:"ghost",size:"icon",className:"h-9 w-9 shrink-0",onClick:()=>{o(!1),t("")},children:e.jsx(ns,{className:"h-4 w-4"})})]}),S]})}const ut="__all_workspace_event_types__",kn=[],Sn={};function $t(n,t,s){const c=new Map;if(!t)for(const[m,l]of Object.entries(s??{}))c.set(m,{key:m,label:Mt(m),description:l.description});const u=[...n].filter(m=>!t||m.slug===t).sort((m,l)=>m.slug.localeCompare(l.slug));for(const m of u)for(const[l,o]of Object.entries(m.event_kinds??{})){const i=c.get(l);if(i){!i.description&&o.description&&(i.description=o.description),JSON.stringify(i.metadataSchema??null)!==JSON.stringify(o.metadataSchema??null)&&(i.metadataSchema=void 0);continue}c.set(l,{key:l,label:Mt(l),description:o.description,metadataSchema:o.metadataSchema})}return[...c.values()].sort((m,l)=>m.label.localeCompare(l.label))}function It(n){const t=n[0];if(!t)return;const s=u=>JSON.stringify(Object.keys(u?.properties??{}).sort()),c=s(t);return n.every(u=>s(u)===c)?t:void 0}function qt(n,t,s){const c=new Set(Object.keys(t.properties??{}));return{...Object.fromEntries(Object.entries(n).filter(([u])=>!c.has(u))),...s}}function Ke(n,t,s){return s==="steer"&&(n==="window"||t!=="reply_to_source")?"coalesce":s}function Qe(n,t){return n==="window"?"silent":t}function Kt(n){return Object.fromEntries(Object.entries(n).filter(([t])=>t==="resource_ref"||t==="resource_type"))}function Wt(n,t,s){const c=new Set(Object.keys(t?.properties??{})),u=new Set(s.flatMap(m=>Object.keys(m.filterSchema?.properties??{})));return Object.fromEntries(Object.entries(Cs(n)).filter(([m])=>m==="resource_ref"||m==="resource_type"||!u.has(m)||c.has(m)))}function wn({value:n,options:t,onChange:s}){return e.jsx("div",{className:"inline-flex rounded-md border bg-muted/30 p-0.5 text-sm",children:t.map(c=>e.jsx("button",{type:"button","aria-pressed":n===c.value,onClick:()=>s(c.value),className:R("rounded px-3 py-1 transition-colors",n===c.value?"bg-background text-foreground ":"text-muted-foreground hover:text-foreground"),children:c.label},c.value))})}function Bt({events:n,selectedKeys:t,onToggle:s,ariaLabel:c="Events"}){const u=r.useId(),m=n.filter(o=>t.includes(o.key)).map(o=>o.label),l=m.length===0?"Choose events":m.length===1?m[0]:`${m.length} events selected`;return e.jsx(ot,{contentClassName:"w-[var(--radix-popover-trigger-width)] min-w-[280px]",searchPlaceholder:"Filter events...",emptyText:"No events found.",trigger:o=>e.jsxs(B,{type:"button",variant:"outline",role:"combobox","aria-label":c,"aria-expanded":o,className:"w-full justify-between font-normal",children:[e.jsx("span",{className:R(m.length===0&&"text-muted-foreground"),children:l}),e.jsx(jt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]}),children:()=>n.map((o,i)=>{const y=t.includes(o.key),S=`${u}-${i}-state`;return e.jsxs(Ue,{value:`${o.label} ${o.key}`,onSelect:()=>s(o.key),"aria-label":o.label,"aria-describedby":S,className:"cursor-pointer",children:[e.jsx(at,{className:R("mr-2 h-4 w-4",y?"opacity-100":"opacity-0")}),o.label,e.jsx("span",{id:S,className:"sr-only",children:y?"Selected":"Not selected"})]},o.key)})})}function Cn({organizationId:n,initialTrigger:t,onChange:s,allowedKinds:c,showSectionHeader:u=!0,fieldIdPrefix:m="automation-trigger-"}){const l=ys(n,{status:"active",limit:500}),o=js(n),i=as({organizationId:n}),y=_s({organizationId:n}),S=l.data??[],p=o.data??[],$=i.data??kn,h=y.data??Sn,j=r.useMemo(()=>$.filter(d=>d.organization_id===n),[$,n]),_=t?.kind==="event"&&t?.source==="workspace",w=_||t===void 0,M=c?.length?[...c]:["event","time","manual"],b=M.join("|"),K=(()=>{const d=t===null?"manual":t?.kind==="schedule"?"time":"event";return M.includes(d)?d:M[0]??"event"})(),[f,z]=r.useState(K),[Q,be]=r.useState(_?"workspace":typeof t?.connection_id=="number"?String(t.connection_id):t?.kind==="event"&&t.connector_key?"":"workspace"),k=Q==="workspace",A=k?"":Q,[g,U]=r.useState(typeof t?.entity_type=="string"?t.entity_type:""),ve=r.useMemo(()=>Array.isArray(t?.event_types)?t.event_types:[],[t]),[F,H]=r.useState(()=>ve.filter(d=>typeof d=="string")),[X,ne]=r.useState(t?.match&&typeof t.match=="object"&&!Array.isArray(t.match)?t.match:{}),[ke,Ee]=r.useState(typeof t?.cron=="string"?t.cron:"0 9 * * 1-5"),he=typeof t?.timezone=="string"?t.timezone:void 0,[I,ye]=r.useState(t?.kind==="schedule"||w&&t?.execution!=="turn"||t?.execution==="window"?"window":"turn"),[J,Y]=r.useState(Qe(I,t?.output==="reply_to_source"?"reply_to_source":"silent")),[ae,oe]=r.useState(t?.kind==="schedule"||w&&t?.active_run!=="queue"?"coalesce":Ke(I,J,t?.active_run==="coalesce"||t?.active_run==="steer"?t.active_run:"queue")),[Oe,Ae]=r.useState(t?.skip_if_unchanged!==!1),[x,je]=r.useState(!1);r.useEffect(()=>{const d=b.split("|");if(!d.includes(f)){const v=d[0]??"event";z(v),ye(v==="time"||v==="event"&&k?"window":"turn"),oe(v==="time"||v==="event"&&k?"coalesce":"queue"),Y("silent")}},[b,f,k]);const T=S.find(d=>String(d.id)===A),xe=l.isLoading||o.isLoading,Z=i.isLoading,G=typeof t?.connector_key=="string"?t.connector_key:void 0,Fe=f==="event"&&!k&&t?.kind==="event"&&t?.source!=="workspace"&&typeof t.connection_id=="number"&&String(t.connection_id)===A&&!T,_e=f==="event"&&!k&&t?.kind==="event"&&t?.source!=="workspace"&&t.connection_id==null&&G!==void 0&&A==="",Pe=p.find(d=>d.key===(T?.connector_key??(_e?G:void 0))),ge=Pe?.automation_events??[],ee=ge.filter(d=>F.includes(d.key)),Se=ee[0],Re=j.find(d=>d.slug===g),Te=[...j.filter(d=>Object.keys(d.event_kinds??{}).length>0||d.slug===g),...g&&!Re?[{slug:g,name:g}]:[]],C=r.useMemo(()=>$t(j,g||void 0,h),[j,g,h]),Me=C.filter(d=>F.includes(d.key)),De=Me[0],pe=It(ee.map(d=>d.filterSchema)),we=It(Me.map(d=>d.metadataSchema)),$e=!!(k&&g&&!Re),Ie=Fe||_e,fe=(f==="event"?k?F.length>0&&!$e:!!(F.length>0&&(A&&T||Ie)):f==="time"?!!ke.trim():!0)&&(f!=="event"||!Ns(X));r.useEffect(()=>{let d;if(fe&&f==="event"&&!k){const v=Wt(X,pe,Pe?.automation_events??[]);T||_e?d={kind:"event",source:"connector",connector_key:T?.connector_key??G,...T?{connection_id:Number(A)}:{},event_types:F,...Object.keys(v).length>0?{match:v}:{},execution:I,active_run:Ke(I,J,ae),output:Qe(I,J),skip_if_unchanged:Oe}:Fe&&(d=t?{...t,source:"connector"}:void 0)}else if(fe&&f==="event"&&k){const v=Wt(X,we,C.map(E=>({filterSchema:E.metadataSchema})));d={kind:"event",source:"workspace",...g?{entity_type:g}:{},event_types:F,...Object.keys(v).length>0?{match:v}:{},execution:I,active_run:ae==="queue"?"queue":"coalesce"}}else fe&&f==="time"&&(d={kind:"schedule",cron:ke.trim(),...he?{timezone:he}:{},execution:"window",active_run:"coalesce",skip_if_unchanged:Oe});s({ready:fe,kind:f,trigger:d})},[ae,A,T,ke,Pe,F,I,X,f,G,he,t,k,s,J,fe,pe,we,Oe,g,C,_e,Fe]);const He=d=>{const v=S.find(O=>String(O.id)===d),E=p.find(O=>O.key===v?.connector_key),te=F.filter(O=>E?.automation_events?.some(Le=>Le.key===O)),ie=E?.automation_events?.find(O=>O.key===te[0]),Ce=v?.connector_key!==(T?.connector_key??G);if(be(d),H(te),!ie)ne(Kt);else if(Ce){const O=ie.defaults?.execution??"turn",Le=ie.defaults?.activeRun??"queue",V=Qe(O,ie.defaults?.output??"silent");ne(Kt),ye(O),oe(Ke(O,V,Le)),Y(V)}},Xe=d=>{if(d==="workspace"){be("workspace"),H(v=>v.filter(E=>C.some(te=>te.key===E))),ne({}),ye("window"),oe("coalesce"),Y("silent");return}He(d)},Ye=d=>{const v=F.includes(d)?F.filter(O=>O!==d):ge.map(O=>O.key).filter(O=>O===d||F.includes(O));if(H(v),v[0]===F[0])return;const E=ge.find(O=>O.key===v[0]),te=E?.defaults?.execution??"turn",ie=E?.defaults?.activeRun??"queue",Ce=Qe(te,E?.defaults?.output??"silent");ye(te),oe(Ke(te,Ce,ie)),Y(Ce)},Ze=d=>{const v=d===ut?"":d,E=j.find(ie=>ie.slug===v),te=$t(j,E?.slug,h);U(v),H(ie=>ie.filter(Ce=>te.some(O=>O.key===Ce))),ne({})},it=d=>{H(v=>v.includes(d)?v.filter(E=>E!==d):C.map(E=>E.key).filter(E=>E===d||v.includes(E)))},qe=[{value:"event",label:"Event"},{value:"time",label:"Schedule"},{value:"manual",label:"Manual"}].filter(d=>M.includes(d.value));return e.jsxs("div",{className:"space-y-4",children:[u?e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{className:"text-sm font-medium",children:"When"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Choose what starts this Automation. Its goal and context stay reusable."})]}):null,qe.length>1?e.jsx(wn,{value:f,options:qe,onChange:d=>{z(d),ye(d==="time"||d==="event"&&k?"window":"turn"),oe(d==="time"||d==="event"&&k?"coalesce":"queue"),Y("silent")}}):null,f==="event"?xe||k&&Z?e.jsxs("div",{className:"space-y-2",children:[e.jsx(Pt,{className:"h-9 w-full"}),e.jsx(Pt,{className:"h-9 w-full"})]}):e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{children:"Source"}),e.jsx(on,{connections:S,value:Q,onValueChange:Xe,disabled:Ie,includeWorkspaceEvents:!0,ariaLabel:"Source",placeholder:"Choose a source"}),Fe?e.jsx("p",{className:"text-xs text-muted-foreground",children:"This shared connection is managed outside this organization. Other Automation fields can still be edited."}):_e?e.jsxs("p",{className:"text-xs text-muted-foreground",children:["This Automation listens across all"," ",String(t?.connector_key)," connections. Other Automation fields can still be edited."]}):null]}),k?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{children:C.length>1?"Events":"Event"}),C.length>0?e.jsx(Bt,{events:C,selectedKeys:F,onToggle:it}):e.jsx("div",{className:R(We,"px-3 py-2 text-sm text-muted-foreground"),children:g?"This entity type has no declared Automation events.":"This workspace has no declared Automation events."}),De?.description?e.jsx("p",{className:"text-xs text-muted-foreground",children:De.description}):null,$e?e.jsxs("p",{className:"text-xs text-destructive",children:["This trigger filters on entity type “",g,"”, which no longer exists in this workspace. Clear the Entity type filter under Trigger options to save."]}):null,e.jsx("p",{className:"text-xs text-muted-foreground",children:"Only declared Automation outputs in the current workspace can trigger this Automation. Ordinary saved events remain data."})]}),we?e.jsx(Tt,{schema:we,values:X,onValuesChange:d=>ne(v=>qt(v,we,d)),fieldIdPrefix:`${m}workspace-`},`${g||"workspace"}:${F.join(",")}`):null]}):T||_e?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{children:ge.length>1?"Events":"Event"}),ge.length?e.jsx(Bt,{events:ge,selectedKeys:F,onToggle:Ye}):e.jsx("div",{className:R(We,"px-3 py-2 text-sm text-muted-foreground"),children:"This connector has not published subscribable events."}),Se?.description?e.jsx("p",{className:"text-xs text-muted-foreground",children:Se.description}):null]}),typeof X.resource_ref=="string"||pe?e.jsxs("div",{className:"space-y-3",children:[typeof X.resource_ref=="string"?e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{children:"Resource"}),e.jsx("div",{className:R(We,"px-3 py-2 text-sm"),children:X.resource_ref})]}):null,pe?e.jsx(Tt,{schema:pe,values:X,onValuesChange:d=>ne(v=>qt(v,pe,d)),fieldIdPrefix:m},F.join(",")):null]}):null]}):Q?null:e.jsx("p",{className:"text-xs text-muted-foreground",children:"Choose workspace events or a connected app as the source."})]}):f==="time"?e.jsx(bn,{value:ke,onChange:Ee}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Run this Automation explicitly from Lobu, the API, CLI, or MCP."}),f!=="manual"&&!Ie?e.jsxs(bs,{open:x,onOpenChange:je,children:[e.jsx(ks,{asChild:!0,children:e.jsxs(B,{type:"button",variant:"ghost",className:"h-auto w-full justify-between px-0 py-1 text-muted-foreground hover:bg-transparent hover:text-foreground",children:[e.jsxs("span",{className:"flex items-center gap-2 text-sm",children:[e.jsx(Ss,{className:"h-4 w-4"}),"Trigger options",e.jsxs("span",{className:"font-normal text-muted-foreground",children:["· ",I==="turn"?"Each event":"Window"," ·"," ",f==="time"?"Combine":k?ae==="queue"?"Queue":"Combine":ae==="queue"?"Queue":ae==="coalesce"?"Combine":"Update current run",f==="event"&&!k?` · ${I==="turn"&&J==="reply_to_source"?"Reply":"Save in Lobu"}`:""]})]}),e.jsx(os,{className:R("h-4 w-4 transition-transform",x&&"rotate-180")})]})}),e.jsxs(ws,{className:"space-y-4 pt-3",children:[f==="event"&&k?e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{children:"Entity type filter"}),e.jsxs(le,{value:g||ut,onValueChange:Ze,children:[e.jsx(de,{"aria-label":"Entity type filter",children:e.jsx(ue,{})}),e.jsxs(me,{children:[e.jsx(P,{value:ut,children:"All event types"}),Te.map(d=>e.jsx(P,{value:d.slug,children:d.name},d.slug))]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional. Limit selected events to outputs linked to this entity type."})]}):null,f==="event"?e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{children:"Run"}),e.jsxs(le,{value:I,onValueChange:d=>{const v=d,E=Qe(v,J);ye(v),Y(E),oe(Ke(v,E,ae))},children:[e.jsx(de,{children:e.jsx(ue,{})}),e.jsxs(me,{children:[e.jsx(P,{value:"turn",children:"Start a run for each event"}),e.jsx(P,{value:"window",children:"Batch events into a window"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{children:"When busy"}),e.jsxs(le,{value:ae,onValueChange:d=>oe(d),children:[e.jsx(de,{children:e.jsx(ue,{})}),e.jsxs(me,{children:[e.jsx(P,{value:"queue",children:"Queue"}),e.jsx(P,{value:"coalesce",children:"Combine waiting events"}),!k&&I==="turn"&&J==="reply_to_source"&&Se?.capabilities?.steering?e.jsx(P,{value:"steer",children:"Update the current run"}):null]})]})]})]}):null,I==="window"&&(f==="time"||!k)?e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Skip unchanged windows"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"No source changes means no agent run or LLM call."})]}),e.jsx(cn,{"aria-label":"Skip unchanged windows",checked:Oe,onCheckedChange:Ae})]}):null,f==="event"&&!k&&I==="turn"?e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{children:"Result"}),e.jsxs(le,{value:J,onValueChange:d=>{const v=d;Y(v),oe(Ke(I,v,ae))},children:[e.jsx(de,{children:e.jsx(ue,{})}),e.jsxs(me,{children:[Se?.capabilities?.replyToSource?e.jsx(P,{value:"reply_to_source",children:"Reply where it happened"}):null,e.jsx(P,{value:"silent",children:"Save in Lobu"})]})]}),Se?.capabilities?.replyToSource?e.jsx("p",{className:"text-xs text-muted-foreground",children:"Messages matching this trigger run the Automation; anything else in the conversation stays with the connected agent."}):null]}):null]})]}):null]})}const En=16;function Be(){return crypto.randomUUID()}function On(n){return n===void 0?[{key:Be(),initial:void 0}]:n.length===0?[{key:Be(),initial:null}]:n.map(t=>({key:Be(),initial:t}))}function cs(n){return n?n.kind==="time"||n.trigger?.kind==="schedule":!1}function An(n,t){return n?n.ready===t.ready&&n.kind===t.kind&&JSON.stringify(n.trigger)===JSON.stringify(t.trigger):!1}function Fn(n,t){const s=n.map(o=>t[o.key]??{ready:!1,kind:"event"});if(!(n.length>1)&&s[0]?.kind==="manual")return{ready:s[0].ready,triggers:[]};const u=s.filter(cs).length;return{ready:!s.some(o=>o.kind==="manual")&&u<=1&&s.length>0&&s.every(o=>o.ready&&o.trigger),triggers:s.filter(o=>o.trigger).map(o=>o.trigger)}}function da({organizationId:n,initialTriggers:t,onChange:s}){const c=r.useId(),[u,m]=r.useState(()=>On(t)),[l,o]=r.useState({}),i=r.useRef("");r.useEffect(()=>{const h=Fn(u,l),j=JSON.stringify(h);j!==i.current&&(i.current=j,s(h))},[u,l,s]);const y=u.find(h=>cs(l[h.key]))?.key??u.find(h=>h.initial&&typeof h.initial=="object"&&h.initial.kind==="schedule"&&!l[h.key])?.key??null,S=r.useCallback((h,j)=>{o(_=>An(_[h],j)?_:{..._,[h]:j})},[]),p=()=>{const h=u[0],j=h?l[h.key]:void 0;if(u.length===1&&(j?.kind==="manual"||h?.initial===null)){const _=Be();o({}),m([{key:_,initial:void 0}]);return}m(_=>[..._,{key:Be(),initial:void 0}])},$=h=>{if(u.length<=1){const j=Be();o({}),m([{key:j,initial:null}]);return}o(j=>{const _={...j};return delete _[h],_}),m(j=>j.filter(_=>_.key!==h))};return e.jsxs("section",{className:"space-y-4","aria-labelledby":`${c}-heading`,children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{id:`${c}-heading`,className:"text-sm font-medium",children:"When"}),u.length>1?e.jsx("p",{className:"text-xs text-muted-foreground",children:"Each trigger can start this Automation independently (OR). At most one schedule. If several match the same event, the first listed wins for run options."}):null]}),e.jsx("div",{className:"space-y-3",children:u.map((h,j)=>{const _=u.length>1,w=_?y&&y!==h.key?["event"]:["event","time"]:["event","time","manual"],M=l[h.key],b=_||(M?M.kind!=="manual":h.initial!==null);return e.jsxs("div",{className:R("space-y-3 rounded-lg border bg-card/40 p-3",_&&"relative"),children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:_?`Trigger ${j+1}`:"Trigger"}),b?e.jsx(B,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive","aria-label":_?`Remove trigger ${j+1}`:"Clear trigger",onClick:()=>$(h.key),children:e.jsx(is,{className:"h-3.5 w-3.5"})}):null]}),e.jsx(Pn,{slotKey:h.key,organizationId:n,initial:h.initial,kinds:w,fieldIdPrefix:`${c}-${h.key}-`,onChange:S})]},h.key)})}),e.jsxs(B,{type:"button",variant:"outline",size:"sm",className:"w-full sm:w-auto",onClick:p,disabled:u.length>=En,children:[e.jsx(Ge,{className:"mr-1.5 h-3.5 w-3.5"}),"Add another trigger"]})]})}function Pn({slotKey:n,organizationId:t,initial:s,kinds:c,fieldIdPrefix:u,onChange:m}){const l=r.useCallback(o=>m(n,o),[m,n]);return e.jsx(Cn,{organizationId:t,initialTrigger:s,allowedKinds:c,showSectionHeader:!1,fieldIdPrefix:u,onChange:l})}const Ut={agents:!0,lobuEmbedded:!1};function Tn(){const{data:n}=Es({queryKey:["features"],queryFn:async()=>{const t=await Os(`${As}/api/features`);return t.ok?t.json():Ut},staleTime:3e4,refetchInterval:6e4});return n??Ut}const Vt=["slack","imessage"],mt="__none__";function Je(n){return`${n.connection_id}:${n.feed_key}`}function Mn(n){const t=n.indexOf(":");if(t<=0)return null;const s=Number(n.slice(0,t)),c=n.slice(t+1);return!Number.isSafeInteger(s)||s<=0||!c?null:{connection_id:s,channel_id:c}}function ht(n){return n?`${n.connection_id}:${n.channel_id}`:""}function st(n){return`${n.display_name||n.feed_key} (${n.feed_key})`}function Ln({organizationId:n,agentId:t,value:s,onChange:c,disabled:u=!1,automationName:m,onPendingChange:l}){const{data:o=[],isLoading:i}=Fs(n),y=ht(s),[S,p]=r.useState(null),[$,h]=r.useState(!1),j=r.useRef(t),_=r.useMemo(()=>o.filter(g=>g.store==="channel_messages"&&g.target_agent_id===t&&Vt.includes(g.connector_key)),[o,t]);r.useEffect(()=>{if(j.current===t||(j.current=t,p(null),h(!1),s==null))return;const g=ht(s);if(g==="")return;o.some(ve=>ve.store==="channel_messages"&&ve.target_agent_id===t&&Vt.includes(ve.connector_key)&&Je(ve)===g)||c(null)},[t,o,s,c]);const w=S??y,M=w===""?mt:w,b=_.find(g=>Je(g)===w),K=S!==null&&S!==""&&S!==y;r.useEffect(()=>{l?.(K)},[K,l]);const f=b??(S?void 0:_.find(g=>Je(g)===y)),z=g=>{const U=g===mt?"":g;if(U===""){p(null),h(!1),c(null);return}if(U===y){p(null),h(!1);return}p(U),h(!1)},Q=g=>{if(h(g),g&&S){const U=Mn(S);U&&(p(null),c(U))}else!g&&S&&p(null)},k=(s&&ht(s)!==""?s:void 0)??(b?{connection_id:b.connection_id,channel_id:b.feed_key}:void 0),A=(m??"").trim()||"This automation";return e.jsxs("div",{className:"space-y-2",children:[e.jsxs(N,{htmlFor:"automation-delivery-target",children:["Digest destination"," ",e.jsx("span",{className:"text-xs font-normal text-muted-foreground",children:"(optional)"})]}),t?e.jsxs(le,{value:M,onValueChange:z,disabled:u||i,children:[e.jsx(de,{id:"automation-delivery-target",className:"font-mono text-sm",children:e.jsx(ue,{placeholder:i?"Loading bound channels…":_.length===0?"No bound Slack or iMessage channels":"No digest — runs stay silent"})}),e.jsxs(me,{children:[e.jsx(P,{value:mt,children:"No digest — runs stay silent"}),_.map(g=>e.jsxs(P,{value:Je(g),children:[st(g)," · ",g.connector_key]},Je(g)))]})]}):e.jsx("p",{className:"text-xs text-muted-foreground",children:"Select a managed agent first — only channels bound to that agent can receive digests."}),t&&!i&&_.length===0?e.jsx("p",{className:"text-xs text-muted-foreground",children:"No Slack or iMessage channels are bound to this agent yet. Link a private channel first, then select it here."}):null,K&&b?e.jsxs("label",{className:"flex cursor-pointer items-start gap-2 text-xs",children:[e.jsx("input",{type:"checkbox",checked:$,onChange:g=>Q(g.target.checked),className:"mt-0.5","aria-label":`Confirm digest delivery to ${st(b)}`}),e.jsxs("span",{className:"text-muted-foreground",children:["I confirm posting material-change digests to"," ",e.jsx("span",{className:"font-medium text-foreground",children:st(b)}),". Destination changes are audited."]})]}):null,f||k?e.jsxs("div",{className:R(We,"space-y-1.5 px-3 py-2"),children:[e.jsxs("p",{className:"text-xs font-medium",children:["Digest preview →"," ",e.jsx("span",{className:"font-mono font-normal",children:f?`${f.connector_key} ${st(f)} · connection ${f.connection_id}`:`${k?.channel_id} · connection ${k?.connection_id}`})]}),e.jsxs("p",{className:"font-mono text-xs",children:[A," applied 2 new + 1 updated"]}),e.jsx("p",{className:"whitespace-pre-line font-mono text-xs text-muted-foreground",children:`+ Example task (#12)
|
|
2
|
-
~ Follow-up item (#34)`}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Sends only after a successful run with material changes. Runs with zero changes send nothing. Retries reuse the same notification and delivery receipts dedupe channel posts, but provider acceptance with a lost receipt can still duplicate."})]}):null]})}const zt=4096;function Rn({open:n,onOpenChange:t,initial:s,onSubmit:c}){const[u,m]=r.useState(""),[l,o]=r.useState(""),[i,y]=r.useState(null);r.useEffect(()=>{n&&(m(s?.name??""),o(s?.query??""),y(null))},[n,s]);const S=()=>{const $=u.trim(),h=l.trim();if(!$){y("Give the SQL source a name.");return}if(!h){y("Enter a query.");return}if(h.length>zt){y(`Query is too long (${h.length} chars, max ${zt}).`);return}c({name:$,query:h}),t(!1)},p=!!s;return e.jsx(Ps,{open:n,onOpenChange:t,children:e.jsxs(Ts,{className:"max-w-2xl",children:[e.jsxs(Ms,{children:[e.jsx(Ls,{children:p?"Edit SQL source":"SQL source"}),e.jsx(Rs,{children:"Write a query the automation runs each period. It becomes a reference in the prompt — the query travels with the chip."})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"sql-source-name",children:"Name"}),e.jsx(ce,{id:"sql-source-name",value:u,onChange:$=>m($.target.value),placeholder:"recent_cancellations",autoFocus:!p}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The output-field name this source fills."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"sql-source-query",children:"Query"}),e.jsx(nt,{value:l,onChange:o,language:"sql",placeholder:"SELECT id, payload_text, occurred_at FROM events ORDER BY occurred_at DESC",minHeight:"160px"})]}),i?e.jsx("p",{className:"text-sm text-destructive",children:i}):null]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(B,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),e.jsx(B,{onClick:S,children:p?"Save":"Add source"})]})]})})}const Dn=["skill","feed","connection","connector","metric","entity_type"];function $n({value:n,onChange:t,library:s,pinned:c,required:u,error:m,owner:l,agentId:o,sources:i,onAddSources:y}){const S=hn(Dn,Rt,{skills:s,skillAgentId:o||null}),p=r.useRef(null),[$,h]=r.useState(null),j=r.useMemo(()=>{if(!i)return[];const b=new Set(i.map(K=>K.query.trim()));return Dt(n).filter(K=>!b.has(K.query.trim()))},[n,i]),_=xn(n),w=gn(c.filter(b=>_.includes(b.name)),s),M=s.length>0;return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs(N,{htmlFor:"automation-prompt",children:["Instructions"," ",u?e.jsx("span",{className:"text-destructive",children:"*"}):e.jsx("span",{className:"text-xs font-normal text-muted-foreground",children:"(optional)"})]}),_.length>0?e.jsxs("span",{className:"text-xs text-muted-foreground",children:[_.length,"/",Rt," skills"]}):null]}),e.jsx("div",{className:"rounded-lg border bg-background focus-within:ring-1 focus-within:ring-ring",children:e.jsx(pn,{value:n,onChange:t,onSubmit:()=>{},submitOnEnter:!1,searchRefs:S,handleRef:p,onSqlRequest:()=>h({}),onSqlEdit:(b,K)=>h({initial:b,pos:K}),placeholder:M?"What should this Automation do? Type @ to pull in a skill or a data source.":"What should this Automation do? Type @ to pull in a data source.",className:"[&_.ProseMirror]:min-h-[7rem] [&_.ProseMirror]:max-h-72 [&_.ProseMirror]:overflow-y-auto"})}),e.jsx(Rn,{open:$!==null,onOpenChange:b=>{b||h(null)},initial:$?.initial,onSubmit:b=>{p.current?.insertSql(b,$?.pos),h(null)}}),j.length>0&&y?e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 rounded-lg border border-dashed p-3",children:[e.jsxs("p",{className:"text-xs text-muted-foreground",children:[j.length===1?`"${j[0]?.name}" is referenced in the instructions but is not a source on this Automation.`:`${j.length} references in the instructions are not sources on this Automation.`," ","Editing an Automation does not add them automatically."]}),e.jsx(B,{type:"button",variant:"outline",size:"sm",onClick:()=>y(Dt(n,i)),children:j.length===1?"Add as a source":"Add as sources"})]}):null,_.length>0?e.jsx("div",{className:"flex flex-wrap items-center gap-1.5",children:_.map(b=>{const K=w.includes(b),f=!s.some(z=>z.name===b);return e.jsxs(Ds,{variant:f?"destructive":"secondary",className:"font-normal",children:[b,f?" · unavailable":K?" · newer text":null]},b)})}):null,w.length>0?e.jsxs("p",{className:"rounded-lg border border-dashed p-3 text-xs text-muted-foreground",children:[w.length===1?`"${w[0]}" has been edited since this Automation pinned it.`:`${w.length} skills have been edited since this Automation pinned them.`," ","This Automation keeps running the pinned text until you save it again."]}):null,m?e.jsx("p",{className:"text-xs text-destructive",children:m}):null,!M&&o?e.jsxs("p",{className:"text-xs text-muted-foreground",children:["This agent has no skills yet."," ",e.jsx($s,{to:"/$owner/agents/$agentId/skills",params:{owner:l,agentId:o},className:"font-medium text-foreground underline underline-offset-2",children:"Add one"})," ","to reuse instructions across Automations."]}):m?null:e.jsx("p",{className:"text-xs text-muted-foreground",children:M?"Type @ to pull in a skill, a feed, connection, connector, metric, entity type, or a SQL query. Skill text is saved with this version, so later edits to the skill do not change this Automation until you update it.":"Type @ to pull in a feed, connection, connector, metric, entity type, or a SQL query this Automation should read."})]})}const In=["connection","connector","feed","metric","entity_type"];function qn({sources:n,onChange:t,disabled:s}){const{currentOwner:c,resolvedOrganizationId:u}=rs(),[m,l]=r.useState(""),{refs:o}=fn({owner:c,organizationId:u,kinds:In,query:m,limitPerKind:10});return e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{children:"Sources"}),n.length>0?e.jsx("ul",{className:"space-y-2",children:n.map(i=>e.jsxs("li",{className:"flex items-start gap-2 rounded-lg border bg-background p-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate font-mono text-xs font-medium",children:i.name}),e.jsx("div",{className:"truncate text-xs text-muted-foreground",children:i.query})]}),e.jsx(B,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0","aria-label":`Remove source ${i.name}`,disabled:s,onClick:()=>t(n.filter(y=>y.query!==i.query)),children:e.jsx(ns,{className:"h-3.5 w-3.5"})})]},i.query))}):null,e.jsx("div",{className:"flex gap-2",children:e.jsx(ot,{searchPlaceholder:"Search feeds, connections, metrics…",emptyText:"No matching reference.",onQueryChange:l,trigger:()=>e.jsxs(B,{type:"button",variant:"outline",size:"sm",disabled:s,children:[e.jsx(Ge,{className:"mr-2 h-3.5 w-3.5"}),"Add source"]}),children:i=>o.map(y=>e.jsxs(Ue,{value:`${y.label} ${y.kind}`,onSelect:()=>{t(vn(y,n)),i()},children:[e.jsx("span",{className:"truncate text-sm",children:y.label}),e.jsx("span",{className:"ml-2 shrink-0 text-xs text-muted-foreground",children:y.kind})]},`${y.kind}:${y.id}`))})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Data handed to the agent alongside its instructions, and what change detection is measured against. Editing an Automation does not re-read the instructions for these — this list is what runs. To add a SQL source, write it with @ in the instructions above. Automation-owned; skills never add or remove sources."})]})}function Kn({organizationId:n,value:t,onChange:s,className:c}){const{data:u=[]}=Is(n),m=rn(u),l=m.find(o=>o.id===t);return e.jsx(ot,{contentClassName:"w-[300px]",searchPlaceholder:"Search entities...",emptyText:"No entities found.",trigger:o=>e.jsxs(B,{variant:"outline",role:"combobox","aria-expanded":o,className:R("w-full justify-between",c),children:[l?`${l.name} (${l.entityType})`:"All workspace",e.jsx(jt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]}),children:o=>e.jsxs(e.Fragment,{children:[e.jsxs(Ue,{value:"all workspace",onSelect:()=>{s(void 0),o()},className:"cursor-pointer",children:[e.jsx(at,{className:R("mr-2 h-4 w-4",t===void 0?"opacity-100":"opacity-0")}),e.jsx("span",{children:"All workspace"})]}),m.map(i=>e.jsxs(Ue,{value:`${i.name} ${i.entityType}`,onSelect:()=>{s(i.id),o()},className:"cursor-pointer",children:[e.jsx(at,{className:R("mr-2 h-4 w-4",t===i.id?"opacity-100":"opacity-0")}),e.jsxs("span",{children:[i.name," ",e.jsxs("span",{className:"text-muted-foreground text-xs",children:["(",i.entityType,")"]})]})]},i.id))]})})}function vt(n){if(Array.isArray(n))return n;if(typeof n=="string"&&n.startsWith("{")&&n.endsWith("}")){const t=n.slice(1,-1);return t?t.split(",").map(s=>s.trim()):[]}return[]}const Wn=ln.map(n=>({value:n,label:dn[n]})),Qt=[{value:"agent",label:"Agent",hint:"An agent reads the window and follows your instructions."},{value:"code",label:"Code",hint:"A deterministic script processes each completed window."},{value:"both",label:"Agent + code",hint:"An agent extracts per your instructions, then the script runs."}];function Jt(n){const t=!!(n?.prompt?.trim()||n?.skills?.some(c=>c.content.trim())),s=!!n?.reaction_script?.trim();return t&&s?"both":s?"code":"agent"}const Bn=["text","number","date","boolean","json"],Un=[{value:"key",label:"Key"},{value:"searchable",label:"Searchable"},{value:"plain",label:"Plain"}],xt=[{value:"plan",label:"Plan first"},{value:"auto",label:"Auto"},{value:"acceptEdits",label:"Accept edits"},{value:"dontAsk",label:"Don't ask"},{value:"bypassPermissions",label:"Bypass permissions"}];let Gt=0;function Vn(){return Gt+=1,`field-${Gt}`}function yt(n={}){return{id:Vn(),name:n.name??"",type:n.type??"text",role:n.role??"plain"}}function zn(n){return n.replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase())}function Ve(n){return n.trim().toLowerCase().replace(/[^a-z0-9_]+/g,"_").replace(/^_+|_+$/g,"")}function Qn(n){return n?Object.keys(n).every(t=>["entity_type","entity_path","key_fields","key_output_field"].includes(t)):!0}function Jn(n){return n?n.every(t=>!t||typeof t!="object"||Array.isArray(t)?!1:Object.keys(t).every(s=>["slug","name","source_path","value_field"].includes(s))):!0}function Ht(n){return n?Qn(n.keying_config)&&Jn(n.classifiers)?"fields":"json":"fields"}function Xt(n){const t=n?.keying_config?.entity_type;return typeof t=="string"?t:""}function Yt(n){const t=n?.keying_config?.entity_path;return typeof t=="string"&&t.trim()?t:"$"}function Zt(n){const t=new Map,s=Array.isArray(n?.keying_config?.key_fields)?n?.keying_config?.key_fields:[];for(const c of s){if(typeof c!="string")continue;const u=Ve(c);u&&t.set(u,yt({name:u,role:"key"}))}for(const c of n?.classifiers??[]){if(!c||typeof c!="object"||Array.isArray(c))continue;const u=c.value_field;if(typeof u!="string")continue;const m=Ve(u);!m||t.has(m)||t.set(m,yt({name:m,role:"searchable"}))}return Array.from(t.values())}function Ne(n,t){const s=n?.execution_config?.[t];return typeof s=="number"||typeof s=="string"?String(s):""}function es(n,t,s){const c=n?.execution_config?.[t];return typeof c=="string"&&s.includes(c)?c:""}function gt(n,t){const s=n.trim();if(!s)return{};const c=Number(s);return Number.isFinite(c)?{value:c}:{error:`${t} must be a number.`}}function ts({entityType:n,entityPath:t,fields:s}){const c=s.map(i=>({...i,name:Ve(i.name)})).filter(i=>i.name),u=c.filter(i=>i.role==="key").map(i=>i.name),m=c.filter(i=>i.role==="searchable"),l=Ve(n),o=t.trim()||"$";return u.length>0&&!l?{error:"Key fields need an output entity type."}:(u.length>0||m.length>0,{keyingConfig:u.length>0?{entity_type:l,entity_path:o,key_fields:u,key_output_field:`${l}_key`}:void 0,classifiers:m.length>0?m.map(i=>({slug:i.name,name:zn(i.name),source_path:o,value_field:i.name})):void 0})}function Gn(n,t){return e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{className:"text-sm font-medium",children:n}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t})]})}function ss(n){return!!(n?.classifiers?.length||n?.keying_config||n?.reactions_guidance||n?.model_config||n?.execution_config||n?.sources?.length||vt(n?.tags).length)}function Hn({organizationId:n,entityId:t,prefill:s,onSubmit:c,isSubmitting:u,error:m,isEditing:l,onCancel:o,triggerFields:i,submitLabel:y="Create Automation",submitDisabled:S=!1,triggers:p}){const{lobuEmbedded:$}=Tn(),{currentOwner:h}=rs(),{data:j=[]}=qs(),{data:_=[]}=Ks(),[w,M]=r.useState(s?.managed_agent_id??""),b=!!s?.managed_agent_id&&!l,[K,f]=r.useState(s?.delivery_target??null),[z,Q]=r.useState(!1),[be,k]=r.useState(s?.device_worker_id??""),[A,g]=r.useState(s?.device_worker_id?"device":"agent"),[U,ve]=r.useState(s?.agent_kind??""),{data:F=[]}=as({organizationId:n}),[H,X]=r.useState(s?.name??""),[ne,ke]=r.useState(s?.slug??""),[Ee,he]=r.useState(!!s?.slug),[I,ye]=r.useState(s?.description??""),[J,Y]=r.useState(s?.prompt??""),[ae,oe]=r.useState(!1),Oe=s?.skills??[],[Ae,x]=r.useState(s?.sources??[]),[je,T]=r.useState(s?.entity_id??t),[xe,Z]=r.useState(s?.reaction_script??""),[G,Fe]=r.useState(()=>Jt(s)),[_e,Pe]=r.useState(s?.classifiers?JSON.stringify(s.classifiers,null,2):""),[ge,ee]=r.useState(null),[Se,Re]=r.useState(s?.keying_config?JSON.stringify(s.keying_config,null,2):""),[Te,C]=r.useState(null),[Me,De]=r.useState(()=>Ht(s)),[pe,we]=r.useState(()=>Xt(s)),[$e,Ie]=r.useState(()=>Yt(s)),[ze,fe]=r.useState(()=>Zt(s)),[He,Xe]=r.useState(s?.reactions_guidance??""),[Ye,Ze]=r.useState(()=>Ne(s,"timeout_seconds")),[it,_t]=r.useState(()=>Ne(s,"max_budget_usd")),[qe,d]=r.useState(()=>Ne(s,"model")),[v,E]=r.useState(()=>es(s,"permission_mode",xt.map(a=>a.value))),[te,ie]=r.useState(()=>Ne(s,"effort")),[Ce,O]=r.useState(()=>Ne(s,"finalize_nudges")),[Le,V]=r.useState(null),[rt,Nt]=r.useState(vt(s?.tags).join(", ")),[bt,kt]=r.useState(""),[ct,St]=r.useState(!!(l||ss(s)));r.useEffect(()=>{s&&(X(s.name??""),ke(s.slug??""),he(!!s.slug),ye(s.description??""),Y(s.prompt??""),oe(!1),x(s.sources??[]),T(s.entity_id??t),k(s.device_worker_id??""),g(s.device_worker_id?"device":"agent"),ve(s.agent_kind??""),Z(s.reaction_script??""),Fe(Jt(s)),Pe(s.classifiers?JSON.stringify(s.classifiers,null,2):""),ee(null),Re(s.keying_config?JSON.stringify(s.keying_config,null,2):""),C(null),De(Ht(s)),we(Xt(s)),Ie(Yt(s)),fe(Zt(s)),Xe(s.reactions_guidance??""),Ze(Ne(s,"timeout_seconds")),_t(Ne(s,"max_budget_usd")),d(Ne(s,"model")),E(es(s,"permission_mode",xt.map(a=>a.value))),ie(Ne(s,"effort")),O(Ne(s,"finalize_nudges")),V(null),Nt(vt(s.tags).join(", ")),kt(""),M(s.managed_agent_id??""),f(s.delivery_target??null),St(!!(l||ss(s))))},[s,t,l]);const ls=Ee?ne:Lt(H),{data:ds}=Ws(w||null),{data:us}=Bs(w||null,{enabled:!!w}),lt=mn(ds??null,us?.catalog??[]),ms=yn(p),dt=xe.trim().length>0,et=!l&&G==="code"?"":J,hs=!l&&G==="agent"?void 0:xe.trim()||void 0,wt=(l||G==="code")&&dt,Ct=jn(et,lt,p,wt),xs=ae||et.trim()!==""?Ct:null,Et=_n(et,lt),Ot=!l&&G!=="agent",At=!!H.trim()&&!Ct&&(!Ot||dt)&&!z,gs=ms&&!wt&&Et.length===0,ps=()=>{if(!At)return;let a,L;if(Me==="fields"){const re=ts({entityType:pe,entityPath:$e,fields:ze});if(re.error){C(re.error);return}a=re.classifiers,L=re.keyingConfig,ee(null),C(null)}else{if(_e.trim())try{const re=JSON.parse(_e);if(!Array.isArray(re)){ee("Classifiers must be a JSON array.");return}a=re}catch{ee("Invalid JSON. Please check the syntax.");return}if(ee(null),Se.trim())try{const re=JSON.parse(Se);if(typeof re!="object"||Array.isArray(re)){C("Keying config must be a JSON object.");return}L=re}catch{C("Invalid JSON. Please check the syntax.");return}C(null)}const D=gt(Ye,"Timeout");if(D.error){V(D.error);return}if(D.value!==void 0&&(!Number.isInteger(D.value)||D.value<1)){V("Timeout must be a whole number greater than 0.");return}const q=gt(it,"Budget");if(q.error){V(q.error);return}if(q.value!==void 0&&q.value<0){V("Budget cannot be negative.");return}const se=gt(Ce,"Finalize nudges");if(se.error){V(se.error);return}if(se.value!==void 0&&(!Number.isInteger(se.value)||se.value<0||se.value>5)){V("Finalize nudges must be a whole number from 0 to 5.");return}const W={...D.value!==void 0?{timeout_seconds:D.value}:{},...q.value!==void 0?{max_budget_usd:q.value}:{},...qe.trim()?{model:qe.trim()}:{},...v?{permission_mode:v}:{},...te.trim()?{effort:te.trim()}:{},...se.value!==void 0?{finalize_nudges:se.value}:{}},fs=Object.keys(W).length>0||l?W:void 0;V(null);const vs=rt.trim()?rt.split(",").map(re=>re.trim()).filter(Boolean):void 0;c({slug:ls,name:H.trim(),description:I.trim()||void 0,prompt:et,skills:Et,entity_id:je,sources:Ae,reaction_script:hs,classifiers:a,keying_config:L,reactions_guidance:He.trim()||void 0,execution_config:fs,tags:vs,change_notes:bt.trim()||void 0,managed_agent_id:A==="agent"&&w.trim()||null,device_worker_id:A==="device"&&be.trim()||null,agent_kind:A==="device"&&U.trim()||null,delivery_target:K})},Ft=e.jsxs("div",{className:"space-y-2",children:[e.jsxs(N,{htmlFor:"scratch-reaction",children:["Reaction Script"," ",Ot?e.jsx("span",{className:"text-destructive",children:"*"}):e.jsx("span",{className:"text-xs font-normal text-muted-foreground",children:"(optional)"})]}),e.jsx(nt,{value:xe,onChange:Z,language:"typescript",placeholder:"export default async function reaction(ctx) { ... }",minHeight:"120px"}),l?null:e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Runs deterministically on every completed window, after agent extraction. Declare an ",e.jsx("code",{children:"input"})," export to set the window's extraction contract."]})]});return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs(N,{htmlFor:"scratch-name",children:["Name ",e.jsx("span",{className:"text-destructive",children:"*"})]}),!l&&e.jsx("button",{type:"button",onClick:()=>he(!Ee),className:"text-xs text-muted-foreground hover:text-foreground",children:Ee?"Use automatic slug":"Customize slug"})]}),e.jsx(ce,{id:"scratch-name",value:H,onChange:a=>X(a.target.value),placeholder:"e.g., Escalation signals"}),!l&&Ee?e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"scratch-slug",children:"Slug"}),e.jsx(ce,{id:"scratch-slug",value:ne,onChange:a=>ke(a.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"")),placeholder:Lt(H)||"custom-slug"})]}):null]})}),l?null:e.jsxs("fieldset",{className:"space-y-2",children:[e.jsx("legend",{className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"How does this run?"}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:Qt.map(a=>e.jsx("button",{type:"button","aria-pressed":G===a.value,onClick:()=>Fe(a.value),className:R("rounded-md px-2.5 py-1.5 text-xs font-medium transition-colors",G===a.value?"bg-secondary text-secondary-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:a.label},a.value))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:Qt.find(a=>a.value===G)?.hint})]}),l||G!=="code"?e.jsx($n,{value:J,onChange:a=>{oe(!0),Y(a)},library:lt,pinned:Oe,required:gs,error:xs,owner:h??"",agentId:w,sources:l?Ae:void 0,onAddSources:l?x:void 0}):null,!l&&G!=="agent"?Ft:null,l?e.jsx(qn,{sources:Ae,onChange:x,disabled:u}):null,e.jsx("div",{className:"space-y-4",children:i}),e.jsx(Ln,{organizationId:n,agentId:A==="agent"?w.trim():"",value:K,onChange:f,disabled:u,automationName:H,onPendingChange:Q}),z?e.jsx("p",{className:"text-xs text-destructive",children:"Confirm the digest destination above before saving — an unconfirmed destination is not sent."}):null,e.jsxs(B,{type:"button",variant:"ghost",className:"w-full justify-between px-0 text-muted-foreground hover:bg-transparent hover:text-foreground","aria-expanded":ct,"aria-controls":"automation-advanced-settings",onClick:()=>St(a=>!a),children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Us,{className:"h-4 w-4"}),"Advanced settings"]}),e.jsx(os,{className:R("h-4 w-4 transition-transform",ct&&"rotate-180")})]}),e.jsxs("div",{id:"automation-advanced-settings",className:R("space-y-4",!ct&&"hidden"),children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"scratch-description",children:"Description"}),e.jsx(ce,{id:"scratch-description",value:I,onChange:a=>ye(a.target.value),placeholder:"What this automation does"})]}),!t&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{children:"Entity scope"}),e.jsx(Kn,{organizationId:n,value:je,onChange:T}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Limit this automation to one workspace entity."})]}),l?Ft:null,e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(N,{children:"Output fields"}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Key fields become stable entity keys. Searchable fields become classifiers."})]}),e.jsx(B,{type:"button",variant:"outline",size:"sm",onClick:()=>{if(Me==="fields"){const a=ts({entityType:pe,entityPath:$e,fields:ze});if(a.error){C(a.error);return}Pe(a.classifiers?JSON.stringify(a.classifiers,null,2):""),Re(a.keyingConfig?JSON.stringify(a.keyingConfig,null,2):""),De("json")}else De("fields");ee(null),C(null)},children:Me==="fields"?"Edit JSON":"Use fields"})]}),Me==="fields"?e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"scratch-output-entity-type",children:"Output entity type"}),e.jsx(ot,{contentClassName:"w-[320px]",searchPlaceholder:"Search or type a new type…",emptyText:"Type a name to create a new entity type.",trigger:a=>e.jsxs(B,{type:"button",variant:"outline",role:"combobox","aria-expanded":a,id:"scratch-output-entity-type",className:"w-full justify-between font-mono text-sm font-normal",children:[e.jsx("span",{className:R("truncate",!pe&&"text-muted-foreground"),children:pe||"Select entity type"}),e.jsx(jt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]}),children:(a,L)=>{const D=Ve(L),q=F.filter(W=>!W.backing_sql),se=q.some(W=>W.slug===D);return e.jsxs(e.Fragment,{children:[q.map(W=>e.jsxs(Ue,{value:`${W.name??W.slug} ${W.slug}`,onSelect:()=>{we(W.slug),C(null),a()},className:"cursor-pointer",children:[e.jsx(at,{className:R("mr-2 h-4 w-4",pe===W.slug?"opacity-100":"opacity-0")}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"font-mono text-sm",children:W.slug}),W.name&&W.name!==W.slug&&e.jsx("div",{className:"truncate text-xs text-muted-foreground",children:W.name})]})]},W.slug)),D&&!se&&e.jsxs(Ue,{value:L,onSelect:()=>{we(D),C(null),a()},className:"cursor-pointer",children:[e.jsx(Ge,{className:"mr-2 h-4 w-4"}),e.jsxs("span",{className:"text-sm",children:["Create"," ",e.jsx("span",{className:"font-mono",children:D})]})]})]})}})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"scratch-output-path",children:"Output path"}),e.jsx(ce,{id:"scratch-output-path",value:$e,onChange:a=>{Ie(a.target.value),C(null)},placeholder:"$.items[*]",className:"font-mono text-sm"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(N,{children:"Fields"}),e.jsxs(B,{type:"button",variant:"outline",size:"sm",onClick:()=>{fe(a=>[...a,yt()]),ee(null),C(null)},children:[e.jsx(Ge,{className:"mr-2 h-4 w-4"}),"Add field"]})]}),ze.length===0?e.jsx("div",{className:R(We,"px-3 py-2 text-sm text-muted-foreground"),children:"No output fields configured."}):e.jsx("div",{className:"space-y-2",children:ze.map(a=>e.jsxs("div",{className:R(We,"grid gap-2 p-3 sm:grid-cols-[minmax(0,1fr)_128px_minmax(0,240px)_auto]"),children:[e.jsx(ce,{value:a.name,onChange:L=>{const D=Ve(L.target.value);fe(q=>q.map(se=>se.id===a.id?{...se,name:D}:se)),ee(null),C(null)},placeholder:"severity","aria-label":"Output field name",className:"font-mono text-sm"}),e.jsxs(le,{value:a.type,onValueChange:L=>{fe(D=>D.map(q=>q.id===a.id?{...q,type:L}:q))},children:[e.jsx(de,{"aria-label":"Output field type",children:e.jsx(ue,{})}),e.jsx(me,{children:Bn.map(L=>e.jsx(P,{value:L,children:L},L))})]}),e.jsx("div",{className:"grid grid-cols-3 rounded-md border border-input bg-background p-1",children:Un.map(L=>e.jsx("button",{type:"button",onClick:()=>{fe(D=>D.map(q=>q.id===a.id?{...q,role:L.value}:q)),ee(null),C(null)},className:R("rounded-sm px-2 py-1 text-xs transition-colors",a.role===L.value?"bg-muted/70 text-foreground":"text-muted-foreground hover:text-foreground"),children:L.label},L.value))}),e.jsx(B,{type:"button",variant:"ghost",size:"icon",onClick:()=>{fe(L=>L.filter(D=>D.id!==a.id)),ee(null),C(null)},"aria-label":"Remove output field",children:e.jsx(is,{className:"h-4 w-4"})})]},a.id))})]}),Te&&e.jsx("p",{className:"text-xs text-destructive",children:Te}),ge&&e.jsx("p",{className:"text-xs text-destructive",children:ge})]}):e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"scratch-classifiers",children:"Classifiers (JSON)"}),e.jsx(nt,{value:_e,onChange:a=>{Pe(a),ee(null)},language:"json",placeholder:'[{ "slug": "sentiment", "name": "Sentiment", "source_path": "$.analysis[*]", "value_field": "sentiment" }]',minHeight:"80px"}),ge&&e.jsx("p",{className:"text-xs text-destructive",children:ge})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"scratch-keying-config",children:"Keying Config (JSON)"}),e.jsx(nt,{value:Se,onChange:a=>{Re(a),C(null)},language:"json",placeholder:'{ "entity_type": "topic", "entity_path": "$.items[*]", "key_fields": ["name"], "key_output_field": "entity_key" }',minHeight:"60px"}),Te&&e.jsx("p",{className:"text-xs text-destructive",children:Te})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"scratch-reactions-guidance",children:"Reactions Guidance"}),e.jsx(Vs,{id:"scratch-reactions-guidance",value:He,onChange:a=>Xe(a.target.value),placeholder:"Guidance text for the reaction system (e.g., when to alert, severity thresholds)...",className:"font-mono text-xs min-h-[80px]"})]}),e.jsxs("div",{className:"space-y-4",children:[Gn("Run settings","Choose where the automation runs and the budget it can use."),!b&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"scratch-runs-on",children:"Runs on"}),e.jsxs(le,{value:A,onValueChange:a=>g(a),children:[e.jsx(de,{id:"scratch-runs-on",className:"text-sm",children:e.jsx(ue,{})}),e.jsxs(me,{children:[e.jsx(P,{value:"agent",children:"Managed agent"}),e.jsx(P,{value:"device",children:"On a device"}),e.jsx(P,{value:"manual",children:"Manual-only"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:A==="agent"?"Automated runs dispatch to a managed Lobu agent.":A==="device"?"Automated runs are claimed and executed locally by a device worker (Mac app, remote worker).":"No executor — this automation runs only when started manually by a connected client."})]}),!b&&A==="agent"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"scratch-agent-id",children:"Agent"}),$?e.jsxs(le,{value:w||"__unselected__",onValueChange:a=>{M(a==="__unselected__"?"":a)},children:[e.jsx(de,{id:"scratch-agent-id",className:"font-mono text-sm",children:e.jsx(ue,{placeholder:"Select a Lobu agent"})}),e.jsx(me,{children:j.map(a=>e.jsxs(P,{value:a.agentId,children:[a.name," (",a.agentId,")"]},a.agentId))})]}):e.jsx(ce,{id:"scratch-agent-id",value:w,onChange:a=>{M(a.target.value)},placeholder:"e.g., agent-123",className:"font-mono text-sm"})]}),!b&&A==="device"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"scratch-device-id",children:"Device"}),e.jsxs(le,{value:be||"__unselected__",onValueChange:a=>k(a==="__unselected__"?"":a),children:[e.jsx(de,{id:"scratch-device-id",className:"font-mono text-sm",children:e.jsx(ue,{placeholder:"Select a device worker"})}),e.jsx(me,{children:_.map(a=>e.jsx(P,{value:a.id,children:a.label||a.platform||a.id},a.id))})]})]}),!b&&A==="device"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"scratch-device-agent-kind",children:"Runs as"}),e.jsxs(le,{value:U||"__default__",onValueChange:a=>ve(a==="__default__"?"":a),children:[e.jsx(de,{id:"scratch-device-agent-kind",className:"text-sm",children:e.jsx(ue,{placeholder:"Device default"})}),e.jsxs(me,{children:[e.jsx(P,{value:"__default__",children:"Device default"}),Wn.map(a=>e.jsx(P,{value:a.value,children:a.label},a.value))]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Device default uses that device's preferred local agent. Availability is checked again when a run is claimed, so a run stays queued if its selected runtime is no longer available."})]}),e.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{children:"Model"}),e.jsx(un,{value:qe,onChange:a=>{d(a),V(null)},placeholder:"Use agent default"})]})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"scratch-timeout",children:"Timeout seconds"}),e.jsx(ce,{id:"scratch-timeout",type:"number",min:1,max:86400,value:Ye,onChange:a=>{Ze(a.target.value),V(null)},placeholder:"600"})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"scratch-permission-mode",children:"Permission mode"}),e.jsxs(le,{value:v||"__default__",onValueChange:a=>{E(a==="__default__"?"":a),V(null)},children:[e.jsx(de,{id:"scratch-permission-mode",children:e.jsx(ue,{placeholder:"Default"})}),e.jsxs(me,{children:[e.jsx(P,{value:"__default__",children:"Default"}),xt.map(a=>e.jsx(P,{value:a.value,children:a.label},a.value))]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"scratch-effort",children:"Effort"}),e.jsx(ce,{id:"scratch-effort",value:te,onChange:a=>{ie(a.target.value),V(null)},placeholder:"Default","aria-describedby":"scratch-effort-help"}),e.jsx("p",{id:"scratch-effort-help",className:"text-xs text-muted-foreground",children:"For device runs, use a value supported by the selected CLI and model. Leave empty for its default."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"scratch-finalize-nudges",children:"Finalize nudges"}),e.jsx(ce,{id:"scratch-finalize-nudges",type:"number",min:0,max:5,value:Ce,onChange:a=>{O(a.target.value),V(null)},placeholder:"Default"})]})]}),Le&&e.jsx("p",{className:"text-xs text-destructive",children:Le})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"scratch-tags",children:"Tags"}),e.jsx(ce,{id:"scratch-tags",value:rt,onChange:a=>Nt(a.target.value),placeholder:"ops, support, risk"})]}),l&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"scratch-change-notes",children:"Change notes"}),e.jsx(ce,{id:"scratch-change-notes",value:bt,onChange:a=>kt(a.target.value),placeholder:"What changed in this version?"})]})]})]}),m&&!ge&&!Te&&!Le&&e.jsx("div",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:m}),e.jsx(ft,{onCancel:o,children:e.jsx(B,{onClick:ps,disabled:!At||u||S,children:u?e.jsxs(e.Fragment,{children:[e.jsx(zs,{size:"lg",className:"mr-2"}),l?"Saving...":"Creating..."]}):l?"Save Automation":y})})]})}function Xn(n,t){const s=n??null,c=t??null;return s===null||c===null?s===c:s.connection_id===c.connection_id&&s.channel_id===c.channel_id}function Yn(n){const t=n.detail??{};return{name:n.name,slug:t.slug,description:t.description??n.description??void 0,prompt:t.prompt,triggers:t.triggers,sources:t.sources,classifiers:t.classifiers,keying_config:t.keying_config,reactions_guidance:t.reactions_guidance,reaction_script:t.reaction_script,model_config:t.model_config,execution_config:t.execution_config,tags:t.tags}}function ua({onClose:n,hideCancel:t=!1,hideHeader:s=!1,organizationId:c,entityId:u,entityName:m,prefillAgentId:l,onSuccess:o,editingAutomation:i,catalogPrefill:y,onDraft:S,triggerFields:p,submitLabel:$,submitDisabled:h,createFields:j,onPrefillTriggers:_}){const w=Qs(),M=Js(),b=Gs(),K=Hs(),f=!!i,[z,Q]=r.useState("template"),[be,k]=r.useState(void 0),[A,g]=r.useState(void 0),{data:U=[],isLoading:ve}=Xs(),[F,H]=r.useState(""),X=r.useMemo(()=>l?{managed_agent_id:l}:void 0,[l]),ne=r.useMemo(()=>U.map(x=>({key:x.id,name:x.name,description:x.description??"",badges:x.detail?.tags??[]})),[U]),ke=r.useMemo(()=>ne.filter(x=>x.name.toLowerCase().includes(F.toLowerCase())||x.description.toLowerCase().includes(F.toLowerCase())),[ne,F]),Ee=x=>{const je=U.find(xe=>xe.id===x.key);if(!je)return;const T=Yn(je);g(l?{...T,managed_agent_id:l}:T),_?.(T.triggers??[]),Q("scratch")},he=()=>{w.reset(),M.reset(),Q("template"),k(void 0),g(void 0),n()},I=f?j?.triggers??i.triggers??[]:j?.triggers??A?.triggers??y?.triggers??[],ye=async x=>{try{if(S){await S(x);return}if(f){const je=j?.triggers??i.triggers??[],T=i.reaction_script??"",xe=x.reaction_script??"";xe&&xe!==T&&await b.mutateAsync({automation_id:i.automation_id,reaction_script:xe}),await M.mutateAsync({automation_id:i.automation_id,name:x.name,description:x.description,prompt:x.prompt,sources:x.sources,set_as_current:!0,triggers:je,classifiers:x.classifiers,keying_config:x.keying_config,reactions_guidance:x.reactions_guidance,change_notes:x.change_notes}),!xe&&T&&await b.mutateAsync({automation_id:i.automation_id,reaction_script:""});const Z={};x.model_config!==void 0&&(Z.model_config=x.model_config),x.execution_config!==void 0&&(Z.execution_config=x.execution_config),x.tags!==void 0&&(Z.tags=x.tags),x.delivery_target!==void 0&&!Xn(x.delivery_target,i.delivery_target)&&(Z.delivery_target=x.delivery_target),x.managed_agent_id!==void 0&&(Z.managed_agent_id=x.managed_agent_id||null),x.agent_kind!==void 0&&(Z.agent_kind=x.agent_kind||null),x.device_worker_id!==void 0&&(Z.device_worker_id=x.device_worker_id||null),Object.keys(Z).length>0&&await K.mutateAsync({automation_id:i.automation_id,...Z}),he(),o?.(i.automation_id)}else{const je=j?.triggers??A?.triggers??y?.triggers??[],T=await w.mutateAsync({...x,managed_agent_id:x.managed_agent_id??void 0,device_worker_id:x.device_worker_id??void 0,agent_kind:x.agent_kind??void 0,delivery_target:x.delivery_target??void 0,triggers:je});he(),T.automation_id&&o?.(T.automation_id)}}catch{}},J=f?M:w;let Y="Add an automation";f?Y="Edit automation configuration (saves as a new version)":m&&(Y=`Add an automation for ${m}`);const ae=i?{entity_id:i.entity_id,name:i.name,slug:i.slug,description:i.description,prompt:i.prompt,sources:i.sources,reaction_script:i.reaction_script,device_worker_id:i.device_worker_id??void 0,agent_kind:i.agent_kind??void 0,classifiers:i.classifiers,keying_config:i.keying_config,reactions_guidance:i.reactions_guidance,model_config:i.model_config,execution_config:i.execution_config,tags:i.tags,managed_agent_id:i.managed_agent_id??void 0,delivery_target:i.delivery_target??void 0}:void 0,oe=f?"Edit Automation":"Create Automation",Oe=e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("h1",{className:"text-2xl font-semibold leading-tight",children:oe}),e.jsx("p",{className:"text-sm text-muted-foreground",children:Y})]}),Ae=e.jsxs("div",{className:"py-6 space-y-6",children:[!f&&e.jsxs("div",{className:"flex flex-wrap justify-start gap-2",children:[e.jsx(pt,{active:z==="template",onClick:()=>Q("template"),icon:e.jsx(Ys,{className:"h-4 w-4"}),label:"From templates"}),e.jsx(pt,{active:z==="scratch",onClick:()=>{Q("scratch"),k(void 0),g(void 0)},icon:e.jsx(Ge,{className:"h-4 w-4"}),label:"From scratch"}),e.jsx(pt,{active:z==="clone",onClick:()=>Q("clone"),icon:e.jsx(Zs,{className:"h-4 w-4"}),label:"Clone existing"})]}),!f&&z==="template"?e.jsxs(e.Fragment,{children:[ve?e.jsx(en,{}):e.jsx(tn,{items:ke,searchQuery:F,onSearchChange:H,onSelect:Ee,searchPlaceholder:"Search templates...",searchAriaLabel:"Search automation templates",emptyMessage:ne.length===0?"No automation templates available.":void 0}),s&&!t?e.jsx(ft,{onCancel:he}):null]}):!f&&z==="clone"&&!be?e.jsxs(e.Fragment,{children:[e.jsx(Zn,{organizationId:c,onSelect:x=>{k(x),_?.(x.triggers??[]),Q("scratch")}}),s&&!t?e.jsx(ft,{onCancel:he}):null]}):e.jsx(Hn,{organizationId:c,entityId:u,prefill:ae??be??A??y??X,onSubmit:ye,isSubmitting:J.isPending,error:J.error?J.error.message:null,isEditing:f,onCancel:t?void 0:he,triggerFields:p,submitLabel:$,submitDisabled:h,triggers:I})]});return e.jsxs("div",{className:"flex flex-col",children:[s?null:Oe,Ae]})}function pt({active:n,onClick:t,icon:s,label:c}){return e.jsxs("button",{type:"button",onClick:t,className:R("flex items-center gap-2 rounded-md border px-3 py-2 text-sm transition-colors",n?"border-primary bg-primary/5 text-primary":"border-border text-muted-foreground hover:border-muted-foreground/30 hover:text-foreground"),children:[s,c]})}function Zn({organizationId:n,onSelect:t}){const{data:s,isLoading:c}=sn(n),[u,m]=r.useState(""),l=(s||[]).filter(o=>o.name?.toLowerCase().includes(u.toLowerCase()));return c?e.jsx(nn,{label:"automations",variant:"list-picker",rows:4}):!s||s.length===0?e.jsx("p",{className:"text-sm text-muted-foreground py-4",children:"No existing automations to clone."}):e.jsxs("div",{className:"space-y-3",children:[e.jsx("input",{type:"text",value:u,onChange:o=>m(o.target.value),placeholder:"Search automations...",className:"w-full rounded-md border px-3 py-2 text-sm bg-background"}),e.jsxs("div",{className:"space-y-2 max-h-[400px] overflow-y-auto",children:[l.map(o=>e.jsxs("button",{type:"button",onClick:()=>t({name:`${o.name} (copy)`,slug:`${o.slug||o.automation_id}-copy`,prompt:o.prompt,classifiers:o.classifiers,keying_config:o.keying_config,triggers:o.triggers,sources:o.sources}),className:"w-full text-left rounded-md border p-3 hover:border-primary/50 hover:bg-primary/5 transition-colors",children:[e.jsx("p",{className:"text-sm font-medium",children:o.name}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[o.entity_name||"Space-level"," · v",o.version??"?"]})]},o.automation_id)),l.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No automations match your search."})]})]})}export{da as A,ua as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t,a2 as o}from"./index-DdGjY1Hb.js";const n=()=>t.jsx(o,{});export{n as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t,a2 as o}from"./index-DdGjY1Hb.js";function a(){return t.jsx(o,{})}export{a as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{hP as t,j as n}from"./index-DdGjY1Hb.js";import{a as i}from"./agents-workbench-DOwn78eL.js";import"./agent-editor-form-BrOkwfg8.js";import"./model-selector-BLCEahny.js";import"./proposal-review-shell-uskeFIUr.js";import"./runs-CzBeUzlQ.js";function d(){const{owner:o,agentId:r}=t.useParams(),e=t.useSearch();return n.jsx(i,{owner:o,agentId:r,tab:"identity",runId:e.run_id})}export{d as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b8 as r,j as e}from"./index-DdGjY1Hb.js";import{M as m}from"./memory-browse-page-FHaJC3ML.js";import"./switch-DDkPrV3p.js";import"./entity-type-page-BlAizGlz.js";import"./json-diff-BV2STDGj.js";import"./index-CDz3-ieP.js";import"./index-Vcq4gwWv.js";import"./code-editor-DGJQDoHD.js";import"./schema-value-normalization-DgMkyVVE.js";import"./calendar-BbD1N97u.js";import"./core.esm-Ds4Nuq9d.js";import"./renderer-Dyf4t8kR.js";import"./card-DpLjEqIc.js";import"./view-frame-DDr-Xtet.js";import"./app-bridge-BH3g2mKG.js";import"./missing-view-Bve6pJP-.js";import"./use-applied-views-DELwQQh7.js";import"./member-scope-gate-BTgmlfFJ.js";function S(){const{owner:t}=r.useParams(),o=r.useSearch();return e.jsx(m,{ownerSlug:t,create:!1,createType:o.create_type==="true"})}export{S as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{hT as o,j as e}from"./index-DdGjY1Hb.js";import{A as n}from"./agent-guardrails-route-CHM7JbIl.js";import"./model-selector-BLCEahny.js";import"./agent-subpage-shell-B7tCQ9zd.js";import"./agent-loading-shells-DsiGx1fn.js";import"./agent-card-controls-JubkhcHt.js";import"./switch-DDkPrV3p.js";function d(){const{owner:r,agentId:t}=o.useParams();return e.jsx(n,{owner:r,agentId:t})}export{d as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{hl as n,j as o,aY as r}from"./index-DdGjY1Hb.js";import{A as a}from"./agent-connect-pages-Chfqn8iL.js";import"./agent-client-setup-list-Btcy4Cu1.js";import"./clients-Bd8WpHSV.js";import"./client-rows-EJSKR6z1.js";function g(){const{owner:t}=n.useParams();return o.jsx(r,{owner:t,children:({ownerSlug:e})=>o.jsx(a,{owner:e})})}export{g as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{hR as r,j as e}from"./index-DdGjY1Hb.js";import{A as m}from"./agent-skills-route-AylS-B9v.js";import"./agent-subpage-shell-B7tCQ9zd.js";import"./agent-skill-context-D7tOJ8Pb.js";import"./core.esm-Ds4Nuq9d.js";import"./skill-editor-D_W3QlRz.js";import"./agent-loading-shells-DsiGx1fn.js";import"./agent-card-controls-JubkhcHt.js";import"./switch-DDkPrV3p.js";function R(){const{owner:t,agentId:o}=r.useParams();return e.jsx(m,{owner:t,agentId:o})}export{R as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{gE as e,gF as n,j as m}from"./index-DdGjY1Hb.js";import{E as i}from"./event-page-DTXPxc-E.js";import"./events-feed-L3c-LLiJ.js";import"./use-applied-views-DELwQQh7.js";import"./clients-Bd8WpHSV.js";import"./renderer-Dyf4t8kR.js";import"./card-DpLjEqIc.js";import"./view-frame-DDr-Xtet.js";import"./app-bridge-BH3g2mKG.js";import"./missing-view-Bve6pJP-.js";function l(){const{owner:o,eventId:r}=e.useParams(),t=n(r);return t===null?null:m.jsx(i,{owner:o,eventId:t})}export{l as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{bU as t,j as p,bV as m}from"./index-DdGjY1Hb.js";import{M as i}from"./memory-browse-page-FHaJC3ML.js";import"./switch-DDkPrV3p.js";import"./entity-type-page-BlAizGlz.js";import"./json-diff-BV2STDGj.js";import"./index-CDz3-ieP.js";import"./index-Vcq4gwWv.js";import"./code-editor-DGJQDoHD.js";import"./schema-value-normalization-DgMkyVVE.js";import"./calendar-BbD1N97u.js";import"./core.esm-Ds4Nuq9d.js";import"./renderer-Dyf4t8kR.js";import"./card-DpLjEqIc.js";import"./view-frame-DDr-Xtet.js";import"./app-bridge-BH3g2mKG.js";import"./missing-view-Bve6pJP-.js";import"./use-applied-views-DELwQQh7.js";import"./member-scope-gate-BTgmlfFJ.js";function M(){const{owner:o,entityType:r}=t.useParams(),{create:e}=t.useSearch();return p.jsx(i,{ownerSlug:o,typeScope:m(r),create:e??!1})}export{M as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a8 as t,j as i}from"./index-DdGjY1Hb.js";import{A as m}from"./activity-route-view-rVdTeVXN.js";import"./device-automation-BIjs7DZJ.js";import"./agent-thread-storage-U6htL3ad.js";import"./pending-seed-CPbfgnLX.js";import"./clients-Bd8WpHSV.js";import"./client-rows-EJSKR6z1.js";import"./connection-label-BobuYiAG.js";import"./events-feed-L3c-LLiJ.js";import"./use-applied-views-DELwQQh7.js";import"./renderer-Dyf4t8kR.js";import"./card-DpLjEqIc.js";import"./calendar-BbD1N97u.js";import"./agent-loading-shells-DsiGx1fn.js";import"./member-scope-gate-BTgmlfFJ.js";function y(){const{owner:o}=t.useParams(),r=t.useSearch();return i.jsx(m,{owner:o,search:r,attentionLens:!0})}export{y as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{gH as t,j as s}from"./index-DdGjY1Hb.js";import{D as e}from"./deployments-body-DulCUAMt.js";import"./deployments-ICDss7yS.js";function p(){const{owner:o}=t.useParams();return s.jsx(e,{owner:o})}export{p as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{hO as e,j as r}from"./index-DdGjY1Hb.js";import{a as m}from"./agents-workbench-DOwn78eL.js";import"./agent-editor-form-BrOkwfg8.js";import"./model-selector-BLCEahny.js";import"./proposal-review-shell-uskeFIUr.js";import"./runs-CzBeUzlQ.js";function g(){const{owner:o,agentId:t}=e.useParams();return r.jsx(m,{owner:o,agentId:t,tab:"models"})}export{g as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{hM as t,j as n}from"./index-DdGjY1Hb.js";import{a as s}from"./agents-workbench-DOwn78eL.js";import"./agent-editor-form-BrOkwfg8.js";import"./model-selector-BLCEahny.js";import"./proposal-review-shell-uskeFIUr.js";import"./runs-CzBeUzlQ.js";function c(){const{owner:o,agentId:r}=t.useParams(),e=t.useSearch();return n.jsx(s,{owner:o,agentId:r,tab:"settings",runId:e.run_id})}export{c as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{hL as r,j as t,a2 as s}from"./index-DdGjY1Hb.js";import{A as e}from"./agent-skill-context-D7tOJ8Pb.js";import"./core.esm-Ds4Nuq9d.js";import"./skill-editor-D_W3QlRz.js";function p(){const{agentId:o}=r.useParams();return t.jsx(e,{agentId:o,children:t.jsx(s,{})})}export{p as component};
|