@lobu/runtime-server 21.2.0 → 21.2.1
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/component.json +1 -1
- package/dist/owletto/dist/assets/_-CLhipgJI.js +1 -0
- package/dist/owletto/dist/assets/{_-C1iPVDAS.js → _-D0ZVGAIA.js} +2 -2
- package/dist/owletto/dist/assets/{_agentId-DvhFYLLv.js → _agentId-BLXUf3ot.js} +1 -1
- package/dist/owletto/dist/assets/_agentId-DnI66MF3.js +1 -0
- package/dist/owletto/dist/assets/{_automationId-NuFSEFlw.js → _automationId-ziwseLb7.js} +1 -1
- package/dist/owletto/dist/assets/{_connectorKey._connectionId-D_FhMGN1.js → _connectorKey._connectionId-B6V3ySFK.js} +1 -1
- package/dist/owletto/dist/assets/{_connectorKey.index-B8AZikVg.js → _connectorKey.index-CR5u_dtt.js} +1 -1
- package/dist/owletto/dist/assets/{_conversationId-D1Cx42I0.js → _conversationId-FBMYmOl8.js} +1 -1
- package/dist/owletto/dist/assets/{_deploymentId-BjtZC8Oo.js → _deploymentId-DNTXbT_m.js} +1 -1
- package/dist/owletto/dist/assets/_name-B37LKIxH.js +1 -0
- package/dist/owletto/dist/assets/{_owner-c8L8M4FP.js → _owner-BxYumqC2.js} +1 -1
- package/dist/owletto/dist/assets/_shape-Bxz-04jR.js +1 -0
- package/dist/owletto/dist/assets/_skillKey-D5MFbiw2.js +1 -0
- package/dist/owletto/dist/assets/{_slug-Nlm2ziLr.js → _slug-Dlhit09k.js} +1 -1
- package/dist/owletto/dist/assets/_viewKey-C6535i-t.js +1 -0
- package/dist/owletto/dist/assets/_viewKey-CQCtY3Y8.js +1 -0
- package/dist/owletto/dist/assets/_viewKey-CxKfKbRa.js +1 -0
- package/dist/owletto/dist/assets/{accept-invitation-BfqbITxp.js → accept-invitation-BQQwec3R.js} +1 -1
- package/dist/owletto/dist/assets/{activity-route-view-CTQEg3Us.js → activity-route-view-BwThvdGs.js} +1 -1
- package/dist/owletto/dist/assets/{agent-card-controls-49SIdmyU.js → agent-card-controls-B3RhzsPz.js} +1 -1
- package/dist/owletto/dist/assets/{agent-client-setup-list-ChwHMq4Q.js → agent-client-setup-list-BFtgRwe8.js} +1 -1
- package/dist/owletto/dist/assets/{agent-connect-pages-CJntJskO.js → agent-connect-pages-BO4wQn4L.js} +1 -1
- package/dist/owletto/dist/assets/{agent-editor-form-CEEFNek5.js → agent-editor-form-BYC4uSNz.js} +1 -1
- package/dist/owletto/dist/assets/{agent-guardrails-route-BF_RvzHv.js → agent-guardrails-route-Dp02G1AQ.js} +1 -1
- package/dist/owletto/dist/assets/{agent-loading-shells-Cve_XIMW.js → agent-loading-shells-OagauQzV.js} +1 -1
- package/dist/owletto/dist/assets/{agent-permissions-matrix-DEYa123T.js → agent-permissions-matrix-B9Ho3P1t.js} +1 -1
- package/dist/owletto/dist/assets/{agent-skill-context-DuS7Ojm_.js → agent-skill-context-BAr2Dw3F.js} +1 -1
- package/dist/owletto/dist/assets/{agent-skills-route-BItudd8s.js → agent-skills-route-B4VUnVi0.js} +1 -1
- package/dist/owletto/dist/assets/{agent-subpage-shell-BkGzpmv5.js → agent-subpage-shell-Dz8I-GUt.js} +1 -1
- package/dist/owletto/dist/assets/{agent-thread-DhCFggHZ.js → agent-thread-B9-cdkaV.js} +1 -1
- package/dist/owletto/dist/assets/agents-D0CIg4b9.js +1 -0
- package/dist/owletto/dist/assets/{agents-workbench-BZaoiFNY.js → agents-workbench-C2sr5h82.js} +1 -1
- package/dist/owletto/dist/assets/{app._appId-0fp8NC9-.js → app._appId-DLsJ_QWS.js} +1 -1
- package/dist/owletto/dist/assets/{automation-detail-content-C08Ef137.js → automation-detail-content-9Rjb_I9j.js} +1 -1
- package/dist/owletto/dist/assets/automations-D0CIg4b9.js +1 -0
- package/dist/owletto/dist/assets/{calendar-CvEqJnKS.js → calendar-DAiyi1ZL.js} +1 -1
- package/dist/owletto/dist/assets/{callback-BfjlxUcL.js → callback-CaRe2TOT.js} +1 -1
- package/dist/owletto/dist/assets/{card-MXMmjz9G.js → card-CMmh2mzo.js} +1 -1
- package/dist/owletto/dist/assets/{claim-B5igXpyF.js → claim-CYHnUF7G.js} +1 -1
- package/dist/owletto/dist/assets/{clients-DqMOcwpO.js → clients-Cp1BJ28u.js} +1 -1
- package/dist/owletto/dist/assets/{code-editor-bpbaa7f6.js → code-editor-CYsR2VBP.js} +1 -1
- package/dist/owletto/dist/assets/connect-CZip2g_B.js +1 -0
- package/dist/owletto/dist/assets/connect._clientId-CEKY8Dnv.js +1 -0
- package/dist/owletto/dist/assets/{connected._clientId-BWVr-PMm.js → connected._clientId-C5xRjxNO.js} +1 -1
- package/dist/owletto/dist/assets/{connection-D-dXA43c.js → connection-C06HZ241.js} +1 -1
- package/dist/owletto/dist/assets/{connection-feed-detail-XYK-ubKG.js → connection-feed-detail-D1whY5hL.js} +1 -1
- package/dist/owletto/dist/assets/{connector-provenance-RL_DcF2q.js → connector-provenance-BjKiUhYE.js} +1 -1
- package/dist/owletto/dist/assets/{connectors-B2_PLuXP.js → connectors-Baejya0T.js} +1 -1
- package/dist/owletto/dist/assets/{consent-CMrkyIfi.js → consent-CfYDldcF.js} +1 -1
- package/dist/owletto/dist/assets/{core.esm-BrIR85HL.js → core.esm-QA7BQgiK.js} +1 -1
- package/dist/owletto/dist/assets/create-C3P-3_8O.js +1 -0
- package/dist/owletto/dist/assets/create-CwnrPUEw.js +1 -0
- package/dist/owletto/dist/assets/{create-UTXCruIl.js → create-DOScS9Gl.js} +1 -1
- package/dist/owletto/dist/assets/{create-automation-form-BHir-pIp.js → create-automation-form-CuxiIRCF.js} +1 -1
- package/dist/owletto/dist/assets/{create._connectorKey-qjd3B6p5.js → create._connectorKey-Bjv3lCf8.js} +1 -1
- package/dist/owletto/dist/assets/{cronstrue-BwvvZn_Y.js → cronstrue-2GHCtD7h.js} +1 -1
- package/dist/owletto/dist/assets/{deployments-DHAx8TBs.js → deployments-ByBv1DW-.js} +1 -1
- package/dist/owletto/dist/assets/deployments-C-_ECORv.js +1 -0
- package/dist/owletto/dist/assets/{deployments-body-B54mJoZC.js → deployments-body-Bm2upStd.js} +1 -1
- package/dist/owletto/dist/assets/{device-Bi_9KNKQ.js → device-B0i7Xp8y.js} +1 -1
- package/dist/owletto/dist/assets/{device-pin-tombstone-Dkmmka9d.js → device-pin-tombstone-Bd6vS2zu.js} +1 -1
- package/dist/owletto/dist/assets/{device-rows-CkTAaZ3m.js → device-rows-Bwf8qDte.js} +1 -1
- package/dist/owletto/dist/assets/{device._deviceId-B_WqDhY5.js → device._deviceId-DJLAesm3.js} +1 -1
- package/dist/owletto/dist/assets/{entity-options-Bm1sbpmt.js → entity-options-CrbS6K-i.js} +1 -1
- package/dist/owletto/dist/assets/{entity-page-DZUGex-P.js → entity-page-ijZe_1-6.js} +1 -1
- package/dist/owletto/dist/assets/{entity-type-page-DSBcVv9e.js → entity-type-page-onp2Tk_E.js} +1 -1
- package/dist/owletto/dist/assets/{event-page-B837JclA.js → event-page-C0B2UDY-.js} +1 -1
- package/dist/owletto/dist/assets/{events-feed-BgvLTppV.js → events-feed-DK35T4g7.js} +1 -1
- package/dist/owletto/dist/assets/{full-page-spinner-ByBsHimW.js → full-page-spinner-Dd8eEaxq.js} +1 -1
- package/dist/owletto/dist/assets/guardrails-DKO8_J-G.js +1 -0
- package/dist/owletto/dist/assets/identity-CKM54vrM.js +1 -0
- package/dist/owletto/dist/assets/{index-DjYcFuq9.js → index--VmN5WxW.js} +1 -1
- package/dist/owletto/dist/assets/{index-GZkujXG1.js → index-B2AmRqYh.js} +1589 -1589
- package/dist/owletto/dist/assets/{index-Be5BLMwZ.js → index-B_rcEgFX.js} +1 -1
- package/dist/owletto/dist/assets/{index-Dpf0I2N4.js → index-BmhGe6-Z.js} +1 -1
- package/dist/owletto/dist/assets/index-C1dJSGrL.js +1 -0
- package/dist/owletto/dist/assets/index-CAFw4qCb.js +1 -0
- package/dist/owletto/dist/assets/{index-DBs2lhwE.js → index-CCcc_xBw.js} +1 -1
- package/dist/owletto/dist/assets/{index-DqrjJ9LB.js → index-CLU3gXVm.js} +1 -1
- package/dist/owletto/dist/assets/{index-Cane2GT3.js → index-Cf0GJoiG.js} +1 -1
- package/dist/owletto/dist/assets/index-CqQVnAY-.js +1 -0
- package/dist/owletto/dist/assets/{index-BrT0gBIi.js → index-CxT0uyIe.js} +1 -1
- package/dist/owletto/dist/assets/index-DR08e6Ec.js +1 -0
- package/dist/owletto/dist/assets/index-DYb9L5FC.js +1 -0
- package/dist/owletto/dist/assets/{index-C1MV7ajb.js → index-DlepU3cY.js} +1 -1
- package/dist/owletto/dist/assets/index-SUUcQGT-.js +1 -0
- package/dist/owletto/dist/assets/index-SdiFOfR1.js +1 -0
- package/dist/owletto/dist/assets/index-zcfi5r1l.js +1 -0
- package/dist/owletto/dist/assets/{json-diff-D6sv990W.js → json-diff-ClBBYBQD.js} +1 -1
- package/dist/owletto/dist/assets/{list-skeleton-B39wKVT1.js → list-skeleton-BtWn2eo2.js} +1 -1
- package/dist/owletto/dist/assets/{login-DxnhCvKx.js → login-d3PdO-qV.js} +1 -1
- package/dist/owletto/dist/assets/{logout-Lvib6Kk7.js → logout-DgckxwLn.js} +1 -1
- package/dist/owletto/dist/assets/{member-scope-gate-CM-GNviT.js → member-scope-gate-DXOCfx-v.js} +1 -1
- package/dist/owletto/dist/assets/{memory-browse-page-DKmyI1FJ.js → memory-browse-page-CeAnKoTR.js} +1 -1
- package/dist/owletto/dist/assets/{missing-view-CAFqvZpi.js → missing-view-DrZ8m8yo.js} +1 -1
- package/dist/owletto/dist/assets/{model-selector-BoudNhPZ.js → model-selector-CapL1ARf.js} +1 -1
- package/dist/owletto/dist/assets/models-CB8mhq7j.js +1 -0
- package/dist/owletto/dist/assets/{new-Jp_DtYBt.js → new-BBUb-VR4.js} +1 -1
- package/dist/owletto/dist/assets/{new-e3C5Yokb.js → new-CBLJ25_w.js} +1 -1
- package/dist/owletto/dist/assets/{new-CKSjnGM9.js → new-tTXB4qBW.js} +1 -1
- package/dist/owletto/dist/assets/{oauth-workspace-access-DuPiMSr2.js → oauth-workspace-access-DearynqZ.js} +1 -1
- package/dist/owletto/dist/assets/{organization-DUPBruFP.js → organization-BgdBg-PJ.js} +1 -1
- package/dist/owletto/dist/assets/{permissions-DqkX4mTH.js → permissions-h_qSft1A.js} +1 -1
- package/dist/owletto/dist/assets/{proposal-review-shell-C04RG1qM.js → proposal-review-shell-D4YNrrye.js} +1 -1
- package/dist/owletto/dist/assets/{recent-BmxCZQ8j.js → recent-JiBNvZzD.js} +1 -1
- package/dist/owletto/dist/assets/{renderer-eFSU65zm.js → renderer-DgPLyEbx.js} +1 -1
- package/dist/owletto/dist/assets/{reset-password-BinCwene.js → reset-password-B8tWPtIj.js} +1 -1
- package/dist/owletto/dist/assets/{runs-DwThk2CI.js → runs-oHveuEUB.js} +1 -1
- package/dist/owletto/dist/assets/{runs-panel-DfxWCV7K.js → runs-panel-C56GDaJm.js} +1 -1
- package/dist/owletto/dist/assets/{runs-table-Dh7FL3Va.js → runs-table-BUKDjiBc.js} +1 -1
- package/dist/owletto/dist/assets/{schema-value-normalization-CPLeOm7K.js → schema-value-normalization-3JuM_r1H.js} +1 -1
- package/dist/owletto/dist/assets/settings-DaKg6U5O.js +1 -0
- package/dist/owletto/dist/assets/{settings-DLg89oqz.js → settings-DhnRi2nq.js} +1 -1
- package/dist/owletto/dist/assets/skills-BpQncuMC.js +1 -0
- package/dist/owletto/dist/assets/{switch-Dcx3_8kM.js → switch-BQ40_DMb.js} +1 -1
- package/dist/owletto/dist/assets/{use-applied-views-BpvIIgWG.js → use-applied-views-B-Z-Weji.js} +1 -1
- package/dist/owletto/dist/assets/{use-mention-search-Vndny_Gd.js → use-mention-search-B4DfZFm5.js} +1 -1
- package/dist/owletto/dist/assets/{view-frame-DxiuLSGA.js → view-frame-C7ciEoLo.js} +1 -1
- package/dist/owletto/dist/index.html +1 -1
- package/dist/server-main.bundle.mjs +2266 -2125
- package/npm-shrinkwrap.json +5 -5
- package/package.json +1 -1
- package/vendor/connector-sdk/package.json +1 -1
- package/vendor/core/package.json +1 -1
- package/vendor/views/dist/api.d.ts +42 -5
- package/vendor/views/dist/api.js +63 -6
- package/vendor/views/package.json +1 -1
- package/dist/owletto/dist/assets/_-TlzPuBqI.js +0 -1
- package/dist/owletto/dist/assets/_agentId-DutmYPK7.js +0 -1
- package/dist/owletto/dist/assets/_name-DTlirHDv.js +0 -1
- package/dist/owletto/dist/assets/_shape-DQaUs_O7.js +0 -1
- package/dist/owletto/dist/assets/_skillKey-CJSEeyG0.js +0 -1
- package/dist/owletto/dist/assets/_viewKey-BK9NZs21.js +0 -1
- package/dist/owletto/dist/assets/_viewKey-D-Og614G.js +0 -1
- package/dist/owletto/dist/assets/_viewKey-DIFCFECi.js +0 -1
- package/dist/owletto/dist/assets/agents-BIA5SCAT.js +0 -1
- package/dist/owletto/dist/assets/automations-BIA5SCAT.js +0 -1
- package/dist/owletto/dist/assets/connect-DpQrbviv.js +0 -1
- package/dist/owletto/dist/assets/connect._clientId-A_F-UzTr.js +0 -1
- package/dist/owletto/dist/assets/create-DhxcVjNh.js +0 -1
- package/dist/owletto/dist/assets/create-jVkf6V76.js +0 -1
- package/dist/owletto/dist/assets/deployments-CSJHFlJz.js +0 -1
- package/dist/owletto/dist/assets/guardrails-cMGe6IIe.js +0 -1
- package/dist/owletto/dist/assets/identity-BORtpi5L.js +0 -1
- package/dist/owletto/dist/assets/index-B5lGxbbZ.js +0 -1
- package/dist/owletto/dist/assets/index-BGz-9DDG.js +0 -1
- package/dist/owletto/dist/assets/index-BrzsfXR-.js +0 -1
- package/dist/owletto/dist/assets/index-C31QOVZH.js +0 -1
- package/dist/owletto/dist/assets/index-C6USRbY8.js +0 -1
- package/dist/owletto/dist/assets/index-Dh8ubWqr.js +0 -1
- package/dist/owletto/dist/assets/index-DpgsgDFc.js +0 -1
- package/dist/owletto/dist/assets/index-pFFCzVi5.js +0 -1
- package/dist/owletto/dist/assets/models-B8BuBmLu.js +0 -1
- package/dist/owletto/dist/assets/settings-CSrpSUqR.js +0 -1
- package/dist/owletto/dist/assets/skills-PQP0fNxc.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,b$ as B,af as k,cM as D,cN as R,cO as K,gl as G,am as J,bX as V,bW as Y,c4 as Z,gm as ee,c5 as P,aA as F,c1 as se,c0 as ne,c3 as te,c2 as re,r as A,gn as ae,go as ie,c6 as le,c7 as oe,L as T,gp as ce,gq as de,cI as q,gr as ue,gs as me,gt as ge,gu as S,cC as L,X as fe,gv as W,gw as z,cB as xe,P as he,gx as ye,gy as pe,ca as be,gz as ve}from"./index-
|
|
1
|
+
import{j as e,b$ as B,af as k,cM as D,cN as R,cO as K,gl as G,am as J,bX as V,bW as Y,c4 as Z,gm as ee,c5 as P,aA as F,c1 as se,c0 as ne,c3 as te,c2 as re,r as A,gn as ae,go as ie,c6 as le,c7 as oe,L as T,gp as ce,gq as de,cI as q,gr as ue,gs as me,gt as ge,gu as S,cC as L,X as fe,gv as W,gw as z,cB as xe,P as he,gx as ye,gy as pe,ca as be,gz as ve}from"./index-B2AmRqYh.js";const je={auto:"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400",approval:"bg-amber-500/15 text-amber-600 dark:text-amber-400",deny:"bg-red-500/15 text-red-600 dark:text-red-400"};function Ne({options:n,value:t,floor:o,onChange:a,disabled:i,ariaLabel:m,compact:u}){return e.jsx("div",{role:"radiogroup","aria-label":m,className:k("inline-flex shrink-0 items-stretch gap-0.5 rounded-lg border border-border bg-muted/40 p-0.5"),children:n.map(l=>{const y=G({option:l,floor:o}),h=l===t,g=y.disabled&&!h,p=B[l],f=e.jsx("button",{type:"button",role:"radio","aria-checked":h,disabled:i||g,onClick:()=>{!h&&!g&&!i&&a(l)},className:k("inline-flex shrink-0 items-center justify-center whitespace-nowrap font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",u?"min-w-[3rem] rounded-md px-2.5 py-1.5 text-xs leading-none":"min-w-[3.25rem] rounded-md px-3 py-1.5 text-sm leading-none",h?k(je[l],""):"text-muted-foreground hover:bg-background/60 hover:text-foreground",g&&"cursor-not-allowed opacity-40",i&&!g&&"cursor-not-allowed opacity-60"),children:p},l);return g&&y.reason?e.jsxs(D,{children:[e.jsx(R,{asChild:!0,children:e.jsx("span",{className:"inline-flex shrink-0",children:f})}),e.jsx(K,{children:y.reason})]},l):f})})}function M({children:n,controls:t}){return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-2 px-3 py-2",children:[e.jsx("div",{className:"min-w-40 flex-1 text-sm",children:n}),e.jsx("div",{className:"flex shrink-0 items-center gap-2",children:t})]})}const _e=[{resourceClass:"entity",title:"Entities",sub:"Defaults for every entity type."},{resourceClass:"agent_config",title:"Agents",sub:"Defaults for reading and managing agents."}];function Ae(n,t,o,a,i=null){const m=W(n.floor,t,o,a,i),u=z(n.floor,t,o,a,i)?m:"auto";return(a!==null||i!==null)&&ye(n.agent,t,o)?pe(u,S(n,t,o,null)):u}function ke({label:n,response:t,resourceClass:o,action:a,entityTypeSlug:i,targetAgentId:m=null,dimmed:u,pending:l,onSave:y}){const h=W(t.floor,o,a,i,m),g=z(t.floor,o,a,i,m),p=S(t,o,a,i,m),f=Ae(t,o,a,i,m),v=be(o,a),b=e.jsx("div",{className:k("inline-flex shrink-0",u&&"opacity-45"),children:e.jsx(Ne,{options:v,value:p,floor:f,disabled:l,compact:!0,ariaLabel:n,onChange:y})});return g?e.jsxs(D,{children:[e.jsx(R,{asChild:!0,children:e.jsx("span",{className:"inline-flex shrink-0",children:b})}),e.jsxs(K,{children:["Org floor ",B[h]," — can only go stricter"]})]}):b}function Se(n,t){const o=i=>i.resource_class===t.resource_class&&(i.entity_type_slug??null)===(t.entity_type_slug??null)&&(i.operation_key??null)===(t.operation_key??null)&&(i.target_agent_id??null)===(t.target_agent_id??null),a=n.map(i=>o(i)?t:i);return a.some(o)?a:[...a,t]}function Ce(n,t,o,a,i,m){const u=ve(n,t,o,a);return u[i]=m,u}const $="font-medium text-foreground hover:text-primary hover:underline";function Ee({type:n}){return e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(q,{icon:n.icon,className:"h-3.5 w-3.5 shrink-0"}),e.jsx("span",{className:"font-medium",children:n.name}),e.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:n.slug})]})}function Q({label:n,disabled:t,hint:o,searchPlaceholder:a,emptyText:i,children:m}){return t?e.jsxs("div",{className:"px-3 py-1.5 text-xs text-muted-foreground",children:[n,o?` ${o}`:""]}):e.jsx(xe,{contentClassName:"w-[min(100vw-2rem,22rem)]",searchPlaceholder:a,emptyText:i,trigger:u=>e.jsxs("button",{type:"button","aria-expanded":u,className:"flex w-full items-center gap-1.5 px-3 py-1.5 text-left text-xs text-primary hover:bg-muted/50",children:[e.jsx(he,{className:"h-3 w-3"}),n]}),children:u=>m(u)})}function we({pending:n,onClick:t,label:o}){return e.jsx("button",{type:"button",disabled:n,onClick:t,"aria-label":o,className:"rounded p-0.5 text-muted-foreground hover:bg-red-500/10 hover:text-red-600 disabled:opacity-50 dark:hover:text-red-400",children:e.jsx(fe,{className:"h-3 w-3"})})}function $e({owner:n,agentId:t,variant:o="agent"}){const a=o==="org-floor",i=J(),m=V(n,t??"",{enabled:!a&&!!t}),u=Y(n,{enabled:a}),{data:l,isLoading:y,isError:h,error:g}=a?u:m,p=a?Z(n):ee(n,t??""),f=P({mutationFn:r=>a?se(n,r):ne(n,t??"",r),onSuccess:r=>{i.setQueryData(p,d=>d&&{...d,agent:Se(d.agent,r)}),i.invalidateQueries({queryKey:p}),a&&i.invalidateQueries({queryKey:["agent-permissions"]})},onError:r=>{F.error(r instanceof Error?r.message:"Failed to save permission")}}),v=P({mutationFn:r=>a?te(n,r):re(n,t??"",r),onSuccess:()=>{i.invalidateQueries({queryKey:p}),a&&i.invalidateQueries({queryKey:["agent-permissions"]})},onError:r=>{F.error(r instanceof Error?r.message:"Failed to remove override")}}),b=f.isPending||v.isPending,C=A.useMemo(()=>l?ae(l):[],[l]),E=A.useMemo(()=>{if(!l)return[];const r=new Set(C.map(d=>d.slug));return l.entity_types.filter(d=>!r.has(d.slug))},[l,C]),j=A.useMemo(()=>l?ie(l):[],[l]),N=A.useMemo(()=>{if(!l)return[];const r=new Set(j.map(d=>d.id));return l.agents.filter(d=>(a||d.id!==t)&&!r.has(d.id))},[l,j,t,a]);if(y)return e.jsx(le,{label:"permissions",variant:"cards",cards:2});if(h||!l)return e.jsx(oe,{label:g instanceof Error?g.message:"permissions"});const x=l,I=(r,d,w,_,s=null)=>{const c=Ce(x,r,d,s,w,_);f.mutate({resource_class:r,effects:c,entity_type_slug:d,target_agent_id:s})},H=x.entity_types.length===0?"— none yet":E.length===0?"— all covered":null,X=N.length===0&&j.length===0?"— no other agents":N.length===0?"— all covered":null;return e.jsxs("div",{className:"space-y-4",children:[a?null:e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Manage connector rules and agent restrictions in"," ",e.jsx(T,{to:"/$owner/settings/organization",params:{owner:n},search:{agent:t},hash:"policies",className:$,children:"Organization policies"}),"."]}),_e.map(r=>{const d=r.resourceClass==="entity",w=r.resourceClass==="agent_config",_=[{key:"default",label:"Default",name:"Default",entityTypeSlug:null,targetAgentId:null,owned:!1,diffs:0},...d?C.map(s=>({key:`entity:${s.slug}`,name:s.name,label:e.jsx(T,{to:"/$owner/entity-types/$slug",params:{owner:n,slug:s.slug},className:$,title:`Open ${s.name}`,children:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(q,{icon:s.icon,className:"h-3.5 w-3.5 shrink-0"}),s.name]})}),entityTypeSlug:s.slug,targetAgentId:null,owned:de(x,s.slug),diffs:ce(x,s.slug)})):j.map(s=>({key:`agent:${s.id}`,name:s.name,label:e.jsx(T,{to:"/$owner/agents/$agentId/settings",params:{owner:n,agentId:s.id},search:{run_id:void 0},className:$,title:`Open ${s.name}`,children:s.name}),entityTypeSlug:null,targetAgentId:s.id,owned:me(x,s.id),diffs:ue(x,s.id)}))];return e.jsxs("section",{className:"space-y-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h3",{className:"text-sm font-medium",children:r.title}),e.jsx("p",{className:"text-xs text-muted-foreground",children:r.sub})]}),e.jsxs("div",{className:"divide-y overflow-hidden rounded-lg border",children:[_.map(s=>e.jsxs("div",{className:"divide-y",children:[_.length>1&&e.jsx("div",{className:"bg-muted/30",children:e.jsx(M,{controls:s.owned?e.jsx(we,{pending:b,label:`Remove ${s.name} exception`,onClick:()=>v.mutate({resource_class:r.resourceClass,entity_type_slug:s.entityTypeSlug,target_agent_id:s.targetAgentId})}):null,children:e.jsxs("div",{className:"flex items-center gap-2",children:[s.label,s.key!=="default"&&!s.owned?e.jsx("span",{className:"text-xs text-muted-foreground",children:"Organization minimum"}):s.diffs>0?e.jsxs("span",{className:"text-xs text-muted-foreground",children:[s.diffs," ",s.diffs===1?"change":"changes"]}):null]})})}),e.jsx("div",{className:"divide-y",children:ge[r.resourceClass].filter(c=>!s.targetAgentId||c!=="create").map(c=>{const O=`${c.charAt(0).toUpperCase()+c.slice(1)} ${d?"entities":"agents"}`;return e.jsx(M,{controls:e.jsx(ke,{label:`${s.name}: ${O}`,response:x,resourceClass:r.resourceClass,action:c,entityTypeSlug:s.entityTypeSlug,targetAgentId:s.targetAgentId,dimmed:s.key!=="default"&&S(x,r.resourceClass,c,s.entityTypeSlug,s.targetAgentId)===S(x,r.resourceClass,c,null),pending:b,onSave:U=>I(r.resourceClass,s.entityTypeSlug,c,U,s.targetAgentId)}),children:O},c)})})]},s.key)),e.jsxs("div",{className:"border-t",children:[d?e.jsx(Q,{label:"Add type",disabled:b||E.length===0,hint:H,searchPlaceholder:"Search types…",emptyText:"No matching types.",children:s=>E.map(c=>e.jsx(L,{value:`${c.name} ${c.slug}`,onSelect:()=>{f.mutate({resource_class:"entity",effects:{},entity_type_slug:c.slug}),s()},className:"cursor-pointer",children:e.jsx(Ee,{type:c})},c.slug))}):null,w?e.jsx(Q,{label:"Add agent",disabled:b||N.length===0,hint:X,searchPlaceholder:"Search agents…",emptyText:"No matching agents.",children:s=>N.map(c=>e.jsxs(L,{value:`${c.name} ${c.id}`,onSelect:()=>{f.mutate({resource_class:"agent_config",effects:{},target_agent_id:c.id}),s()},className:"cursor-pointer",children:[e.jsx("span",{className:"font-medium",children:c.name}),e.jsx("span",{className:"ml-1.5 font-mono text-[10px] text-muted-foreground",children:c.id})]},c.id))}):null]})]})]},r.resourceClass)})]})}export{$e as A,M as P,Ne as a};
|
package/dist/owletto/dist/assets/{agent-skill-context-DuS7Ojm_.js → agent-skill-context-BAr2Dw3F.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as p,aI as G,dW as ge,dX as pe,gN as be,aA as F,j as ve}from"./index-
|
|
1
|
+
import{r as p,aI as G,dW as ge,dX as pe,gN as be,aA as F,j as ve}from"./index-B2AmRqYh.js";import{K as E,d as me,g as he,e as xe,s as Ce,f as Ie,h as Se,i as W,b as ke,c as ye,j as we,k as Re,C as Y,l as Ae}from"./core.esm-QA7BQgiK.js";import{s as De,b as Ee}from"./skill-editor-D_W3QlRz.js";function X(e,n,t){const r=e.slice();return r.splice(t<0?r.length+t:t,0,r.splice(n,1)[0]),r}function Le(e,n){return e.reduce((t,r,s)=>{const u=n.get(r);return u&&(t[s]=u),t},Array(e.length))}function P(e){return e!==null&&e>=0}function Te(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==n[t])return!1;return!0}function Ne(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const H=e=>{let{rects:n,activeIndex:t,overIndex:r,index:s}=e;const u=X(n,r,t),o=n[s],a=u[s];return!a||!o?null:{x:a.left-o.left,y:a.top-o.top,scaleX:a.width/o.width,scaleY:a.height/o.height}},M={scaleX:1,scaleY:1},Ve=e=>{var n;let{activeIndex:t,activeNodeRect:r,index:s,rects:u,overIndex:o}=e;const a=(n=u[t])!=null?n:r;if(!a)return null;if(s===t){const f=u[o];return f?{x:0,y:t<o?f.top+f.height-(a.top+a.height):f.top-a.top,...M}:null}const m=Oe(u,s,t);return s>t&&s<=o?{x:0,y:-a.height-m,...M}:s<t&&s>=o?{x:0,y:a.height+m,...M}:{x:0,y:0,...M}};function Oe(e,n,t){const r=e[n],s=e[n-1],u=e[n+1];return r?t<n?s?r.top-(s.top+s.height):u?u.top-(r.top+r.height):0:u?u.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const V="Sortable",J=G.createContext({activeIndex:-1,containerId:V,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:H,disabled:{draggable:!1,droppable:!1}});function Je(e){let{children:n,id:t,items:r,strategy:s=H,disabled:u=!1}=e;const{active:o,dragOverlay:a,droppableRects:m,over:f,measureDroppableContainers:i}=Ie(),l=Se(V,t),b=a.rect!==null,h=p.useMemo(()=>r.map(d=>typeof d=="object"&&"id"in d?d.id:d),[r]),k=o!=null,w=o?h.indexOf(o.id):-1,C=f?h.indexOf(f.id):-1,R=p.useRef(h),I=!Te(h,R.current),S=C!==-1&&w===-1||I,c=Ne(u);W(()=>{I&&k&&i(h)},[I,h,k,i]),p.useEffect(()=>{R.current=h},[h]);const g=p.useMemo(()=>({activeIndex:w,containerId:l,disabled:c,disableTransforms:S,items:h,overIndex:C,useDragOverlay:b,sortedRects:Le(h,m),strategy:s}),[w,l,c.draggable,c.droppable,S,h,C,m,b,s]);return G.createElement(J.Provider,{value:g},n)}const Pe=e=>{let{id:n,items:t,activeIndex:r,overIndex:s}=e;return X(t,r,s).indexOf(n)},Me=e=>{let{containerId:n,isSorting:t,wasDragging:r,index:s,items:u,newIndex:o,previousItems:a,previousContainerId:m,transition:f}=e;return!f||!r||a!==u&&s===o?!1:t?!0:o!==s&&n===m},je={duration:200,easing:"ease"},Q="transform",$e=Y.Transition.toString({property:Q,duration:0,easing:"linear"}),ze={roleDescription:"sortable"};function Fe(e){let{disabled:n,index:t,node:r,rect:s}=e;const[u,o]=p.useState(null),a=p.useRef(t);return W(()=>{if(!n&&t!==a.current&&r.current){const m=s.current;if(m){const f=Ae(r.current,{ignoreTransform:!0}),i={x:m.left-f.left,y:m.top-f.top,scaleX:m.width/f.width,scaleY:m.height/f.height};(i.x||i.y)&&o(i)}}t!==a.current&&(a.current=t)},[n,t,r,s]),p.useEffect(()=>{u&&o(null)},[u]),u}function Qe(e){let{animateLayoutChanges:n=Me,attributes:t,disabled:r,data:s,getNewIndex:u=Pe,id:o,strategy:a,resizeObserverConfig:m,transition:f=je}=e;const{items:i,containerId:l,activeIndex:b,disabled:h,disableTransforms:k,sortedRects:w,overIndex:C,useDragOverlay:R,strategy:I}=p.useContext(J),S=Xe(r,h),c=i.indexOf(o),g=p.useMemo(()=>({sortable:{containerId:l,index:c,items:i},...s}),[l,s,c,i]),d=p.useMemo(()=>i.slice(i.indexOf(o)),[i,o]),{rect:v,node:y,isOver:A,setNodeRef:L}=ke({id:o,data:g,disabled:S.droppable,resizeObserverConfig:{updateMeasurementsFor:d,...m}}),{active:D,activatorEvent:te,activeNodeRect:ne,attributes:re,setNodeRef:K,listeners:se,isDragging:$,over:oe,setActivatorNodeRef:ae,transform:ie}=ye({id:o,data:g,attributes:{...ze,...t},disabled:S.draggable}),le=we(L,K),T=!!D,U=T&&!k&&P(b)&&P(C),_=!R&&$,q=_&&U?ie:null,ce=U?q??(a??I)({rects:w,activeNodeRect:ne,activeIndex:b,overIndex:C,index:c}):null,O=P(b)&&P(C)?u({id:o,items:i,activeIndex:b,overIndex:C}):c,N=D?.id,x=p.useRef({activeId:N,items:i,newIndex:O,containerId:l}),ue=i!==x.current.items,B=n({active:D,containerId:l,isDragging:$,isSorting:T,id:o,index:c,items:i,newIndex:x.current.newIndex,previousItems:x.current.items,previousContainerId:x.current.containerId,transition:f,wasDragging:x.current.activeId!=null}),z=Fe({disabled:!B,index:c,node:y,rect:v});return p.useEffect(()=>{T&&x.current.newIndex!==O&&(x.current.newIndex=O),l!==x.current.containerId&&(x.current.containerId=l),i!==x.current.items&&(x.current.items=i)},[T,O,l,i]),p.useEffect(()=>{if(N===x.current.activeId)return;if(N!=null&&x.current.activeId==null){x.current.activeId=N;return}const fe=setTimeout(()=>{x.current.activeId=N},50);return()=>clearTimeout(fe)},[N]),{active:D,activeIndex:b,attributes:re,data:g,rect:v,index:c,newIndex:O,items:i,isOver:A,isSorting:T,isDragging:$,listeners:se,node:y,overIndex:C,over:oe,setNodeRef:le,setActivatorNodeRef:ae,setDroppableNodeRef:L,setDraggableNodeRef:K,transform:z??ce,transition:de()};function de(){if(z||ue&&x.current.newIndex===c)return $e;if(!(_&&!Re(te)||!f)&&(T||B))return Y.Transition.toString({...f,property:Q})}}function Xe(e,n){var t,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(t=e?.draggable)!=null?t:n.draggable,droppable:(r=e?.droppable)!=null?r:n.droppable}}function j(e){if(!e)return!1;const n=e.data.current;return!!(n&&"sortable"in n&&typeof n.sortable=="object"&&"containerId"in n.sortable&&"items"in n.sortable&&"index"in n.sortable)}const Ke=[E.Down,E.Right,E.Up,E.Left],Ze=(e,n)=>{let{context:{active:t,collisionRect:r,droppableRects:s,droppableContainers:u,over:o,scrollableAncestors:a}}=n;if(Ke.includes(e.code)){if(e.preventDefault(),!t||!r)return;const m=[];u.getEnabled().forEach(l=>{if(!l||l!=null&&l.disabled)return;const b=s.get(l.id);if(b)switch(e.code){case E.Down:r.top<b.top&&m.push(l);break;case E.Up:r.top>b.top&&m.push(l);break;case E.Left:r.left>b.left&&m.push(l);break;case E.Right:r.left<b.left&&m.push(l);break}});const f=me({collisionRect:r,droppableRects:s,droppableContainers:m});let i=he(f,"id");if(i===o?.id&&f.length>1&&(i=f[1].id),i!=null){const l=u.get(t.id),b=u.get(i),h=b?s.get(b.id):null,k=b?.node.current;if(k&&h&&l&&b){const C=xe(k).some((d,v)=>a[v]!==d),R=Z(l,b),I=Ue(l,b),S=C||!R?{x:0,y:0}:{x:I?r.width-h.width:0,y:I?r.height-h.height:0},c={x:h.left,y:h.top};return S.x&&S.y?c:Ce(c,S)}}}};function Z(e,n){return!j(e)||!j(n)?!1:e.data.current.sortable.containerId===n.data.current.sortable.containerId}function Ue(e,n){return!j(e)||!j(n)||!Z(e,n)?!1:e.data.current.sortable.index<n.data.current.sortable.index}function _e(e){return{skillsConfig:De(e)}}function qe(e){return e.repo.startsWith("system/")?["System"]:[]}function et(e,n){return e.filter(t=>!t.hidden&&!n.has(t.repo)).map(t=>({key:t.repo,name:t.name,description:t.description||t.instructions||"Add this skill to give the agent tools and capabilities.",badges:qe(t)}))}function tt(e,n){const t=n.trim().toLowerCase();return t?e.filter(r=>r.name.toLowerCase().includes(t)||r.description.toLowerCase().includes(t)||r.key.toLowerCase().includes(t)):e}function Be(e){const n=e.instructions?.trim();return{repo:e.repo,skillId:e.skillId,name:e.name,description:e.description,instructions:n,content:n||e.name,enabled:!0,system:e.repo.startsWith("system/")}}const ee=p.createContext(null);function nt({agentId:e,children:n}){const{data:t,isLoading:r}=ge(e),{data:s,isLoading:u}=pe(e),o=be(e),a=p.useMemo(()=>t?Ee(t,s?.catalog??[]):[],[t,s]),[m,f]=p.useState(null),i=m??a,l=p.useCallback(async(c,g)=>{if(!t)return F.error("Still loading agent settings — try again in a moment"),!1;try{const d=_e(c);return await o.mutateAsync(d),F.success(g),!0}catch(d){return F.error(d instanceof Error?d.message:"Failed to save skills"),!1}},[t,o]),b=p.useCallback(c=>{const g=s?.catalog.find(d=>d.repo===c);g&&f(d=>{const v=d??a;return v.some(y=>y.repo===c)?v:[...v,Be(g)]})},[a,s?.catalog]),h=p.useCallback(c=>{const g=c.name.trim();if(!g)return null;const d=`custom/${g.toLowerCase().replace(/[^a-z0-9-]/g,"-")}`,v=c.instructions.trim();return f(y=>{const A=y??a;return A.some(L=>L.repo===d)?A:[...A,{repo:d,skillId:g,name:g,instructions:v||void 0,content:v||g,enabled:!0}]}),d},[a]),k=p.useCallback((c,g)=>{f(d=>(d??a).map(v=>v.repo===c?{...v,...g}:v))},[a]),w=p.useCallback((c,g)=>{f(d=>{const v=d??a,y=v.findIndex(D=>D.repo===c),A=v.findIndex(D=>D.repo===g);if(y<0||A<0||y===A)return v;const L=X(v,y,A);return l(L,"Skill order updated"),L})},[l,a]),C=p.useCallback(async c=>{const g=i.filter(d=>d.repo!==c);return f(g),l(g,"Skill removed")},[l,i]),R=p.useCallback(async(c,g)=>{const d=i.map(v=>v.repo===c?{...v,enabled:g}:v);return f(d),l(d,g?"Skill enabled":"Skill disabled")},[l,i]),I=p.useCallback(async()=>{await l(i,"Skills saved")},[l,i]),S=p.useMemo(()=>({agentId:e,skillRows:i,catalog:s,isLoading:r||u,isSaving:o.isPending,addSkillFromCatalog:b,addCustomSkill:h,updateSkillRow:k,reorderSkills:w,removeSkillAndSave:C,setSkillEnabledAndSave:R,saveSkills:I}),[h,b,e,u,r,w,C,R,I,i,s,o.isPending,k]);return ve.jsx(ee.Provider,{value:S,children:n})}function rt(){const e=p.useContext(ee);if(!e)throw new Error("useAgentSkillEditor must be used within AgentSkillEditorProvider");return e}export{nt as A,Je as S,Ze as a,et as b,Qe as c,tt as f,qe as s,rt as u,Ve as v};
|
package/dist/owletto/dist/assets/{agent-skills-route-BItudd8s.js → agent-skills-route-B4VUnVi0.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as A,r as u,j as e,P as F,a6 as C,a7 as K,dY as P,b_ as Q,B as N,af as E,aP as Y,e4 as z,e5 as G,bk as H,gU as U,fQ as V,ia as X}from"./index-GZkujXG1.js";import{a as q,A as J}from"./agent-subpage-shell-BkGzpmv5.js";import{u as $,b as W,f as Z,s as ee,a as se,S as te,v as ae,c as le}from"./agent-skill-context-DuS7Ojm_.js";import{f as ne}from"./agent-loading-shells-Cve_XIMW.js";import{u as ie,a as L,m as oe,P as re,D as ce,n as de,C as me}from"./core.esm-BrIR85HL.js";import{A as ue}from"./agent-card-controls-49SIdmyU.js";const T=":";function w(s){const t=s.indexOf("/");return t<0?s:`${s.slice(0,t)}${T}${s.slice(t+1)}`}function B(s){const t=s.indexOf(T);return t<0?s:`${s.slice(0,t)}/${s.slice(t+1)}`}function ge({owner:s,agentId:t,onBack:a,backLabel:n="Skills"}){const o=A(),[i,g]=u.useState(""),[k,h]=u.useState(!1),[r,p]=u.useState(""),[m,b]=u.useState(""),{skillRows:c,catalog:x,isLoading:S,addSkillFromCatalog:y,addCustomSkill:v}=$(),l=u.useMemo(()=>new Set(c.map(d=>d.repo)),[c]),f=u.useMemo(()=>W(x?.catalog??[],l),[x?.catalog,l]),j=u.useMemo(()=>Z(f,i),[f,i]),R=d=>{y(d),o({to:"/$owner/agents/$agentId/skills/$skillKey",params:{owner:s,agentId:t,skillKey:w(d)}})},_=()=>{const d=v({name:r,instructions:m});d&&o({to:"/$owner/agents/$agentId/skills/$skillKey",params:{owner:s,agentId:t,skillKey:w(d)}})},O=a?e.jsx(q,{title:"Add a skill",description:"Skills bundle instructions, tools, and knowledge an agent can reuse. Pick one from the catalog or create your own.",onBack:a,backLabel:n}):e.jsxs("div",{className:"space-y-1",children:[e.jsx("h1",{className:"text-xl font-semibold",children:"Add a skill"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Skills bundle instructions, tools, and knowledge an agent can reuse. Pick one from the catalog or create your own."})]});return e.jsxs("div",{className:"space-y-6",children:[O,e.jsx("div",{className:E(Y,"w-full"),children:k?e.jsxs("div",{className:"space-y-3 p-3",children:[e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(C,{htmlFor:"custom-skill-name",children:"Name"}),e.jsx(K,{id:"custom-skill-name",value:r,onChange:d=>p(d.target.value),placeholder:"my-skill"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(C,{htmlFor:"custom-skill-instructions",children:"Instructions"}),e.jsx(P,{id:"custom-skill-instructions",value:m,onChange:d=>b(d.target.value),placeholder:"Instructions for the agent when this skill is active...",rows:3})]})]}),e.jsx(Q,{onCancel:()=>h(!1),children:e.jsx(N,{type:"button",size:"sm",onClick:_,disabled:!r.trim(),children:"Add custom skill"})})]}):e.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 p-3 text-left text-muted-foreground transition-colors hover:text-foreground",onClick:()=>h(!0),children:[e.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-muted",children:e.jsx(F,{className:"h-4 w-4"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Create custom skill"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Define instructions and packages"})]})]})}),S?e.jsx(z,{}):e.jsx(G,{items:j,searchQuery:i,onSearchChange:g,onSelect:d=>R(d.key),searchPlaceholder:"Search skills...",searchAriaLabel:"Search skills",emptyMessage:i.trim()?`No skills match "${i}"`:f.length===0?"All catalog skills are already configured":"No skills available"})]})}function xe({row:s}){const{isSaving:t,updateSkillRow:a}=$(),n=s.system===!0;return e.jsx("div",{className:"space-y-6",children:n?e.jsx("p",{className:"text-sm text-muted-foreground",children:"System skill metadata is managed by Lobu. You can enable or disable it and change its position in the skill list."}):e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(C,{htmlFor:"skill-name",children:"Name"}),e.jsx(K,{id:"skill-name",value:s.name,onChange:o=>a(s.repo,{name:o.target.value}),disabled:t})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(C,{htmlFor:"skill-instructions",children:"Instructions"}),e.jsx(P,{id:"skill-instructions",value:s.instructions??"",onChange:o=>{const i=o.target.value;a(s.repo,{instructions:i,content:i.trim()||s.name})},rows:4,disabled:t})]})]})})}function he({owner:s,agentId:t,skillKey:a}){const n=A(),[o,i]=u.useState(!1),g=B(a),{skillRows:k,catalog:h,isSaving:r,saveSkills:p,removeSkillAndSave:m,addSkillFromCatalog:b}=$(),c=k.find(v=>v.repo===g)??null,x=h?.catalog.find(v=>v.repo===g);u.useEffect(()=>{!c&&x&&b(g)},[b,x,g,c]);const S=async()=>{await m(g)&&(i(!1),n({to:"/$owner/agents/$agentId/skills",params:{owner:s,agentId:t}}))};if(!c)return x?null:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Skill not found."});const y=!c.system;return e.jsxs("div",{className:"space-y-6",children:[e.jsx(xe,{row:c}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-end",children:[y?o?e.jsxs(e.Fragment,{children:[e.jsx(N,{type:"button",variant:"destructive",onClick:()=>void S(),disabled:r,children:r?"Removing...":"Remove skill"}),e.jsx(N,{type:"button",variant:"outline",onClick:()=>i(!1),disabled:r,children:"Cancel"})]}):e.jsxs(N,{type:"button",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>i(!0),disabled:r,children:["Remove ",c.name]}):null,e.jsx(N,{type:"button",onClick:()=>void p(),disabled:r||o,children:r?"Saving...":"Save changes"})]})]})}function fe(s){return s.map(t=>{const a=ee(t).map(String);return{id:t.repo,repo:t.repo,name:t.name,description:t.description,badges:a,enabled:t.enabled}})}const D="Skills bundle instructions, tools, and knowledge an agent can reuse. Add one from the catalog or write your own; drag to set which the agent reaches for first.";function M({owner:s,agentId:t,expandedRepo:a}){const n=A(),{skillRows:o,catalog:i,isLoading:g,isSaving:k,reorderSkills:h,setSkillEnabledAndSave:r,addSkillFromCatalog:p}=$();u.useEffect(()=>{a&&(o.some(l=>l.repo===a)||i?.catalog.some(l=>l.repo===a)&&p(a))},[a,o,i,p]);const m=u.useMemo(()=>fe(o),[o]),b=u.useMemo(()=>m.map(l=>l.repo),[m]),c=ie(L(re,{activationConstraint:{distance:8}}),L(oe,{coordinateGetter:se})),x=()=>{n({to:"/$owner/agents/$agentId/skills/create",params:{owner:s,agentId:t}})},S=e.jsxs(N,{type:"button",onClick:x,children:[e.jsx(F,{className:"mr-1.5 h-4 w-4"}),"Add skill"]}),y=l=>{if(l===a){n({to:"/$owner/agents/$agentId/skills",params:{owner:s,agentId:t}});return}n({to:"/$owner/agents/$agentId/skills/$skillKey",params:{owner:s,agentId:t,skillKey:w(l)}})},v=l=>{const{active:f,over:j}=l;!j||f.id===j.id||h(String(f.id),String(j.id))};return g?e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:D}),e.jsx(ne,{rows:2})]}):m.length===0?e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:D}),e.jsx(H,{icon:U,title:"No skills yet",description:"Add a system skill from the catalog or create a custom skill for this agent.",actionLabel:"Add skill",onAction:x})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("p",{className:"min-w-0 flex-1 text-sm text-muted-foreground",children:D}),S]}),e.jsx(ce,{sensors:c,collisionDetection:de,onDragEnd:v,children:e.jsx(te,{items:b,strategy:ae,children:e.jsx("div",{className:"overflow-hidden rounded-lg border",children:m.map((l,f)=>{const j=l.repo===a;return e.jsx(ke,{card:l,rank:f+1,disabled:k,expanded:j,isLast:f===m.length-1,onToggle:()=>y(l.repo),onToggleEnabled:R=>void r(l.repo,R),toggleDisabled:k,children:j?e.jsx(he,{owner:s,agentId:t,skillKey:w(l.repo)}):null},l.id)})})})})]})}function ke({card:s,rank:t,disabled:a,expanded:n,isLast:o,onToggle:i,onToggleEnabled:g,toggleDisabled:k,children:h}){const r=a||n,{attributes:p,listeners:m,setNodeRef:b,transform:c,transition:x,isDragging:S}=le({id:s.repo,disabled:r}),y={transform:me.Transform.toString(c),transition:x};return e.jsxs("div",{ref:b,style:y,className:E("bg-background",!o||n?"border-b":"",S&&"z-10 bg-card opacity-80 "),children:[e.jsxs("div",{className:"flex items-stretch gap-1 pr-3",children:[e.jsx("button",{type:"button",className:"flex shrink-0 cursor-grab touch-none items-center px-2 text-muted-foreground hover:text-foreground active:cursor-grabbing disabled:cursor-not-allowed disabled:opacity-50","aria-label":`Reorder ${s.name}`,disabled:r,...p,...m,children:e.jsx(V,{className:"h-4 w-4"})}),e.jsxs("button",{type:"button",className:E("flex min-w-0 flex-1 items-center gap-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",!s.enabled&&!n&&"opacity-70"),onClick:i,"aria-expanded":n,children:[e.jsx("span",{className:"w-4 shrink-0 text-center text-xs tabular-nums text-muted-foreground",children:t}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[e.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:s.name}),s.description?e.jsx("p",{className:"line-clamp-1 text-xs text-muted-foreground",children:s.description}):null,e.jsx(X,{badges:s.badges})]})]}),e.jsx(ue,{enabled:s.enabled,name:s.name,expanded:n,onToggleEnabled:g,toggleDisabled:k,onToggle:i})]}),n&&h?e.jsx("div",{className:"border-t border-border px-4 py-4",children:h}):null]})}function I({owner:s,agentId:t,children:a,showBack:n}){return e.jsx(J,{owner:s,agentId:t,showBack:n,backLabel:"Skills",backTo:"/$owner/agents/$agentId/skills",children:a})}function Ne({owner:s,agentId:t}){return e.jsx(I,{owner:s,agentId:t,children:e.jsx(M,{owner:s,agentId:t})})}function Ce({owner:s,agentId:t}){const a=A();return e.jsx(I,{owner:s,agentId:t,children:e.jsx(ge,{owner:s,agentId:t,onBack:()=>{a({to:"/$owner/agents/$agentId/skills",params:{owner:s,agentId:t}})}})})}function we({owner:s,agentId:t,skillKey:a}){return e.jsx(I,{owner:s,agentId:t,children:e.jsx(M,{owner:s,agentId:t,expandedRepo:B(a)})})}export{Ne as A,Ce as a,we as b};
|
|
1
|
+
import{_ as A,r as u,j as e,P as F,a6 as C,a7 as K,dY as P,b_ as Q,B as N,af as E,aP as Y,e4 as z,e5 as G,bk as H,gU as U,fQ as V,ia as X}from"./index-B2AmRqYh.js";import{a as q,A as J}from"./agent-subpage-shell-Dz8I-GUt.js";import{u as $,b as W,f as Z,s as ee,a as se,S as te,v as ae,c as le}from"./agent-skill-context-BAr2Dw3F.js";import{f as ne}from"./agent-loading-shells-OagauQzV.js";import{u as ie,a as L,m as oe,P as re,D as ce,n as de,C as me}from"./core.esm-QA7BQgiK.js";import{A as ue}from"./agent-card-controls-B3RhzsPz.js";const T=":";function w(s){const t=s.indexOf("/");return t<0?s:`${s.slice(0,t)}${T}${s.slice(t+1)}`}function B(s){const t=s.indexOf(T);return t<0?s:`${s.slice(0,t)}/${s.slice(t+1)}`}function ge({owner:s,agentId:t,onBack:a,backLabel:n="Skills"}){const o=A(),[i,g]=u.useState(""),[k,h]=u.useState(!1),[r,p]=u.useState(""),[m,b]=u.useState(""),{skillRows:c,catalog:x,isLoading:S,addSkillFromCatalog:y,addCustomSkill:v}=$(),l=u.useMemo(()=>new Set(c.map(d=>d.repo)),[c]),f=u.useMemo(()=>W(x?.catalog??[],l),[x?.catalog,l]),j=u.useMemo(()=>Z(f,i),[f,i]),R=d=>{y(d),o({to:"/$owner/agents/$agentId/skills/$skillKey",params:{owner:s,agentId:t,skillKey:w(d)}})},_=()=>{const d=v({name:r,instructions:m});d&&o({to:"/$owner/agents/$agentId/skills/$skillKey",params:{owner:s,agentId:t,skillKey:w(d)}})},O=a?e.jsx(q,{title:"Add a skill",description:"Skills bundle instructions, tools, and knowledge an agent can reuse. Pick one from the catalog or create your own.",onBack:a,backLabel:n}):e.jsxs("div",{className:"space-y-1",children:[e.jsx("h1",{className:"text-xl font-semibold",children:"Add a skill"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Skills bundle instructions, tools, and knowledge an agent can reuse. Pick one from the catalog or create your own."})]});return e.jsxs("div",{className:"space-y-6",children:[O,e.jsx("div",{className:E(Y,"w-full"),children:k?e.jsxs("div",{className:"space-y-3 p-3",children:[e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(C,{htmlFor:"custom-skill-name",children:"Name"}),e.jsx(K,{id:"custom-skill-name",value:r,onChange:d=>p(d.target.value),placeholder:"my-skill"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(C,{htmlFor:"custom-skill-instructions",children:"Instructions"}),e.jsx(P,{id:"custom-skill-instructions",value:m,onChange:d=>b(d.target.value),placeholder:"Instructions for the agent when this skill is active...",rows:3})]})]}),e.jsx(Q,{onCancel:()=>h(!1),children:e.jsx(N,{type:"button",size:"sm",onClick:_,disabled:!r.trim(),children:"Add custom skill"})})]}):e.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 p-3 text-left text-muted-foreground transition-colors hover:text-foreground",onClick:()=>h(!0),children:[e.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-muted",children:e.jsx(F,{className:"h-4 w-4"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Create custom skill"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Define instructions and packages"})]})]})}),S?e.jsx(z,{}):e.jsx(G,{items:j,searchQuery:i,onSearchChange:g,onSelect:d=>R(d.key),searchPlaceholder:"Search skills...",searchAriaLabel:"Search skills",emptyMessage:i.trim()?`No skills match "${i}"`:f.length===0?"All catalog skills are already configured":"No skills available"})]})}function xe({row:s}){const{isSaving:t,updateSkillRow:a}=$(),n=s.system===!0;return e.jsx("div",{className:"space-y-6",children:n?e.jsx("p",{className:"text-sm text-muted-foreground",children:"System skill metadata is managed by Lobu. You can enable or disable it and change its position in the skill list."}):e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(C,{htmlFor:"skill-name",children:"Name"}),e.jsx(K,{id:"skill-name",value:s.name,onChange:o=>a(s.repo,{name:o.target.value}),disabled:t})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(C,{htmlFor:"skill-instructions",children:"Instructions"}),e.jsx(P,{id:"skill-instructions",value:s.instructions??"",onChange:o=>{const i=o.target.value;a(s.repo,{instructions:i,content:i.trim()||s.name})},rows:4,disabled:t})]})]})})}function he({owner:s,agentId:t,skillKey:a}){const n=A(),[o,i]=u.useState(!1),g=B(a),{skillRows:k,catalog:h,isSaving:r,saveSkills:p,removeSkillAndSave:m,addSkillFromCatalog:b}=$(),c=k.find(v=>v.repo===g)??null,x=h?.catalog.find(v=>v.repo===g);u.useEffect(()=>{!c&&x&&b(g)},[b,x,g,c]);const S=async()=>{await m(g)&&(i(!1),n({to:"/$owner/agents/$agentId/skills",params:{owner:s,agentId:t}}))};if(!c)return x?null:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Skill not found."});const y=!c.system;return e.jsxs("div",{className:"space-y-6",children:[e.jsx(xe,{row:c}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-end",children:[y?o?e.jsxs(e.Fragment,{children:[e.jsx(N,{type:"button",variant:"destructive",onClick:()=>void S(),disabled:r,children:r?"Removing...":"Remove skill"}),e.jsx(N,{type:"button",variant:"outline",onClick:()=>i(!1),disabled:r,children:"Cancel"})]}):e.jsxs(N,{type:"button",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>i(!0),disabled:r,children:["Remove ",c.name]}):null,e.jsx(N,{type:"button",onClick:()=>void p(),disabled:r||o,children:r?"Saving...":"Save changes"})]})]})}function fe(s){return s.map(t=>{const a=ee(t).map(String);return{id:t.repo,repo:t.repo,name:t.name,description:t.description,badges:a,enabled:t.enabled}})}const D="Skills bundle instructions, tools, and knowledge an agent can reuse. Add one from the catalog or write your own; drag to set which the agent reaches for first.";function M({owner:s,agentId:t,expandedRepo:a}){const n=A(),{skillRows:o,catalog:i,isLoading:g,isSaving:k,reorderSkills:h,setSkillEnabledAndSave:r,addSkillFromCatalog:p}=$();u.useEffect(()=>{a&&(o.some(l=>l.repo===a)||i?.catalog.some(l=>l.repo===a)&&p(a))},[a,o,i,p]);const m=u.useMemo(()=>fe(o),[o]),b=u.useMemo(()=>m.map(l=>l.repo),[m]),c=ie(L(re,{activationConstraint:{distance:8}}),L(oe,{coordinateGetter:se})),x=()=>{n({to:"/$owner/agents/$agentId/skills/create",params:{owner:s,agentId:t}})},S=e.jsxs(N,{type:"button",onClick:x,children:[e.jsx(F,{className:"mr-1.5 h-4 w-4"}),"Add skill"]}),y=l=>{if(l===a){n({to:"/$owner/agents/$agentId/skills",params:{owner:s,agentId:t}});return}n({to:"/$owner/agents/$agentId/skills/$skillKey",params:{owner:s,agentId:t,skillKey:w(l)}})},v=l=>{const{active:f,over:j}=l;!j||f.id===j.id||h(String(f.id),String(j.id))};return g?e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:D}),e.jsx(ne,{rows:2})]}):m.length===0?e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:D}),e.jsx(H,{icon:U,title:"No skills yet",description:"Add a system skill from the catalog or create a custom skill for this agent.",actionLabel:"Add skill",onAction:x})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("p",{className:"min-w-0 flex-1 text-sm text-muted-foreground",children:D}),S]}),e.jsx(ce,{sensors:c,collisionDetection:de,onDragEnd:v,children:e.jsx(te,{items:b,strategy:ae,children:e.jsx("div",{className:"overflow-hidden rounded-lg border",children:m.map((l,f)=>{const j=l.repo===a;return e.jsx(ke,{card:l,rank:f+1,disabled:k,expanded:j,isLast:f===m.length-1,onToggle:()=>y(l.repo),onToggleEnabled:R=>void r(l.repo,R),toggleDisabled:k,children:j?e.jsx(he,{owner:s,agentId:t,skillKey:w(l.repo)}):null},l.id)})})})})]})}function ke({card:s,rank:t,disabled:a,expanded:n,isLast:o,onToggle:i,onToggleEnabled:g,toggleDisabled:k,children:h}){const r=a||n,{attributes:p,listeners:m,setNodeRef:b,transform:c,transition:x,isDragging:S}=le({id:s.repo,disabled:r}),y={transform:me.Transform.toString(c),transition:x};return e.jsxs("div",{ref:b,style:y,className:E("bg-background",!o||n?"border-b":"",S&&"z-10 bg-card opacity-80 "),children:[e.jsxs("div",{className:"flex items-stretch gap-1 pr-3",children:[e.jsx("button",{type:"button",className:"flex shrink-0 cursor-grab touch-none items-center px-2 text-muted-foreground hover:text-foreground active:cursor-grabbing disabled:cursor-not-allowed disabled:opacity-50","aria-label":`Reorder ${s.name}`,disabled:r,...p,...m,children:e.jsx(V,{className:"h-4 w-4"})}),e.jsxs("button",{type:"button",className:E("flex min-w-0 flex-1 items-center gap-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",!s.enabled&&!n&&"opacity-70"),onClick:i,"aria-expanded":n,children:[e.jsx("span",{className:"w-4 shrink-0 text-center text-xs tabular-nums text-muted-foreground",children:t}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[e.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:s.name}),s.description?e.jsx("p",{className:"line-clamp-1 text-xs text-muted-foreground",children:s.description}):null,e.jsx(X,{badges:s.badges})]})]}),e.jsx(ue,{enabled:s.enabled,name:s.name,expanded:n,onToggleEnabled:g,toggleDisabled:k,onToggle:i})]}),n&&h?e.jsx("div",{className:"border-t border-border px-4 py-4",children:h}):null]})}function I({owner:s,agentId:t,children:a,showBack:n}){return e.jsx(J,{owner:s,agentId:t,showBack:n,backLabel:"Skills",backTo:"/$owner/agents/$agentId/skills",children:a})}function Ne({owner:s,agentId:t}){return e.jsx(I,{owner:s,agentId:t,children:e.jsx(M,{owner:s,agentId:t})})}function Ce({owner:s,agentId:t}){const a=A();return e.jsx(I,{owner:s,agentId:t,children:e.jsx(ge,{owner:s,agentId:t,onBack:()=>{a({to:"/$owner/agents/$agentId/skills",params:{owner:s,agentId:t}})}})})}function we({owner:s,agentId:t,skillKey:a}){return e.jsx(I,{owner:s,agentId:t,children:e.jsx(M,{owner:s,agentId:t,expandedRepo:B(a)})})}export{Ne as A,Ce as a,we as b};
|
package/dist/owletto/dist/assets/{agent-subpage-shell-BkGzpmv5.js → agent-subpage-shell-Dz8I-GUt.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as m,j as e,af as h,B as n,eD as i}from"./index-
|
|
1
|
+
import{_ as m,j as e,af as h,B as n,eD as i}from"./index-B2AmRqYh.js";function p({owner:t,agentId:a,children:s,showBack:r,backLabel:o,backTo:x,title:c,className:u}){const d=m(),l=()=>{d({to:x,params:{owner:t,agentId:a}})};return e.jsx("div",{className:h("mx-auto w-full max-w-3xl pb-8",u),children:c?e.jsxs(e.Fragment,{children:[e.jsx(j,{title:c,onBack:l,backLabel:o}),s]}):r?e.jsx(g,{onBack:l,backLabel:o,children:s}):s})}function g({onBack:t,backLabel:a,children:s}){return e.jsxs("div",{className:"relative",children:[e.jsx(n,{type:"button",variant:"ghost",size:"icon",className:"absolute right-full top-0 mr-1 size-8 text-muted-foreground hover:text-foreground","aria-label":`Back to ${a}`,onClick:t,children:e.jsx(i,{className:"h-4 w-4"})}),s]})}function j({title:t,onBack:a,backLabel:s,action:r}){return e.jsx("div",{className:"sticky top-0 z-10 mb-2 bg-background py-2",children:e.jsxs("div",{className:"relative flex items-center justify-center gap-1",children:[e.jsx(n,{type:"button",variant:"ghost",size:"icon",className:"size-8 shrink-0 text-muted-foreground hover:text-foreground","aria-label":`Back to ${s}`,onClick:a,children:e.jsx(i,{className:"h-4 w-4"})}),e.jsx("span",{className:"truncate text-base font-semibold",children:t}),r?e.jsx("div",{className:"absolute right-0",children:r}):null]})})}function v({title:t,description:a,onBack:s,backLabel:r}){return e.jsxs("div",{className:"mb-2 space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2",children:[e.jsx(n,{type:"button",variant:"ghost",size:"icon",className:"size-8 shrink-0 text-muted-foreground hover:text-foreground","aria-label":`Back to ${r}`,onClick:s,children:e.jsx(i,{className:"h-4 w-4"})}),e.jsx("h1",{className:"text-xl font-semibold",children:t})]}),e.jsx("p",{className:"text-center text-sm text-muted-foreground",children:a})]})}export{p as A,v as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s,r as l,ep as Kt,am as qt,eq as Gt,dW as Qt,aj as ot,ac as Ve,ak as st,ci as Xt,er as lt,es as Yt,L as xt,af as D,cR as Jt,c_ as wt,d0 as Zt,et as en,cs as tn,d1 as nn,eu as rn,B as ce,ev as on,ew as sn,ex as ze,X as ln,n as an,c$ as cn,aP as Ce,ey as un,cp as dn,cq as pn,ez as fn,ct as mn,bG as hn,eA as gn,eB as vn,ec as bn,bD as yn,dA as xn,dB as wn}from"./index-
|
|
1
|
+
import{j as s,r as l,ep as Kt,am as qt,eq as Gt,dW as Qt,aj as ot,ac as Ve,ak as st,ci as Xt,er as lt,es as Yt,L as xt,af as D,cR as Jt,c_ as wt,d0 as Zt,et as en,cs as tn,d1 as nn,eu as rn,B as ce,ev as on,ew as sn,ex as ze,X as ln,n as an,c$ as cn,aP as Ce,ey as un,cp as dn,cq as pn,ez as fn,ct as mn,bG as hn,eA as gn,eB as vn,ec as bn,bD as yn,dA as xn,dB as wn}from"./index-B2AmRqYh.js";import{D as Rn,E as Sn}from"./app-bridge-BH3g2mKG.js";import{A as Tn,a as jn,b as Cn,c as Xe,d as Rt,e as Nn}from"./agent-loading-shells-OagauQzV.js";import{t as An}from"./pending-seed-CPbfgnLX.js";import{h as En,t as kn,R as _n,i as In,u as On,b as Pn,f as Ln}from"./use-mention-search-B4DfZFm5.js";const St=l.createContext(null);function Mn({extension:e,children:t}){return s.jsx(St.Provider,{value:e??null,children:t})}function Ye(){return l.useContext(St)}var Je=(e=>(e.PROVIDER_QUOTA_EXHAUSTED="PROVIDER_QUOTA_EXHAUSTED",e.PROVIDER_AUTH="PROVIDER_AUTH",e.PROVIDER_UNKNOWN_MODEL="PROVIDER_UNKNOWN_MODEL",e.PROVIDER_BASE_URL_UNRESOLVED="PROVIDER_BASE_URL_UNRESOLVED",e.NO_MODEL_CONFIGURED="NO_MODEL_CONFIGURED",e.WORKER_UNRESPONSIVE="WORKER_UNRESPONSIVE",e.WORKER_DIED="WORKER_DIED",e.WORKER_STARTUP_FAILED="WORKER_STARTUP_FAILED",e.PROVIDER_TOOL_CALL_FAILED="PROVIDER_TOOL_CALL_FAILED",e.SESSION_TIMEOUT="SESSION_TIMEOUT",e))(Je||{});const $n={PROVIDER_QUOTA_EXHAUSTED:{cta:"provider-management",ctaLabel:"Manage provider"},PROVIDER_AUTH:{cta:"provider-management",ctaLabel:"Reconnect provider"},PROVIDER_UNKNOWN_MODEL:{cta:"agent-settings",ctaLabel:"Choose model"},PROVIDER_BASE_URL_UNRESOLVED:{cta:"provider-management",ctaLabel:"Manage provider"},PROVIDER_TOOL_CALL_FAILED:{message:"The model provider rejected its own tool call and ended the turn. This is usually temporary — please try again.",cta:"none"},NO_MODEL_CONFIGURED:{message:"No model is configured for this agent. Choose a model in agent settings.",cta:"agent-settings",ctaLabel:"Choose a model"},WORKER_UNRESPONSIVE:{message:"The agent didn't finish responding in time. This is usually temporary — please try again.",cta:"none"},WORKER_DIED:{message:"The agent stopped unexpectedly before it could reply. This is usually temporary — please try again.",cta:"none"},WORKER_STARTUP_FAILED:{message:"The agent couldn't start, so your request wasn't processed. Please try again in a moment.",cta:"none"},SESSION_TIMEOUT:{cta:"none",silent:!0}};function Dn(e){if(typeof e=="string")return Object.values(Je).includes(e)?e:void 0}const Un=Object.freeze(Object.defineProperty({__proto__:null,AGENT_ERRORS:$n,AgentErrorCode:Je,toAgentErrorCode:Dn},Symbol.toStringTag,{value:"Module"})),{AGENT_ERRORS:Fn,toAgentErrorCode:Bn}=Un;function it(e,t){if(!t)return null;try{const n=new URL(t);return n.protocol!=="http:"&&n.protocol!=="https:"?null:new URL(e,`${n.origin}/`).toString()}catch{return null}}function Tt(e,t){const n=Bn(e);if(!n)return null;const r=Fn[n];if(r.cta==="none"||!t.workspaceSlug)return null;const o=encodeURIComponent(t.workspaceSlug);if(r.cta==="provider-connect"||r.cta==="provider-management"){const a=t.provider?`/${o}/connectors/${encodeURIComponent(`${Kt}${t.provider}`)}`:`/${o}/connectors`,c=it(a,t.webOrigin);if(!c)return null;const u=new URL(c);return t.provider&&t.model&&u.searchParams.set("model",t.model),{label:r.ctaLabel??"Connect a provider",href:u.toString()}}if(!t.agentId)return null;const i=it(`/${o}/agents/${encodeURIComponent(t.agentId)}/settings`,t.webOrigin);return i?{label:r.ctaLabel??"Open settings",href:i}:null}function jt(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e.subscribable;if(!t||typeof t!="object"||Array.isArray(t))return null;const n=t;if(typeof n.connector_key!="string"||!n.connector_key||typeof n.resource_type!="string"||!n.resource_type||typeof n.resource_ref!="string"||!n.resource_ref||typeof n.label!="string"||!n.label)return null;const r=Array.isArray(n.suggested_event_keys)?n.suggested_event_keys.filter(o=>typeof o=="string"&&!!o):void 0;return{connector_key:n.connector_key,resource_type:n.resource_type,resource_ref:n.resource_ref,label:n.label,...r?.length?{suggested_event_keys:r}:{}}}const at=new Set(["localhost","127.0.0.1","::1","[::1]"]);function Vn(e){return e?.trim().toLowerCase().replace(/^\.+|\.+$/g,"")||null}function ct(e,t){const n=Vn(t);if(!n)return!1;const r=e.toLowerCase().replace(/\.$/,"");return r===n||r.endsWith(`.${n}`)}function ut(e,t,n){try{const r=new URL(t),o=new URL(e,t),i=at.has(o.hostname)&&at.has(r.hostname),a=o.protocol===r.protocol&&(o.protocol==="https:"||o.protocol==="http:")&&ct(o.hostname,n)&&ct(r.hostname,n);return o.origin!==r.origin&&(i||a)&&(o.protocol=r.protocol,o.host=r.host),o.origin===r.origin&&o.pathname.startsWith("/api/v1/agents")&&(o.pathname=`/lobu${o.pathname}`),o.toString()}catch{return e}}const Hn=/\.(png|jpe?g|gif|webp|avif|bmp|svg)$/i,Ct=new Set(["suggest_actions"]),Le="Thinking…";function zn(e){const{textOut:t,statusLine:n,errorText:r,toolCalls:o}=e,i=[];n===Le&&i.push({type:"reasoning"}),r&&i.push({type:"error",text:r});let a=t;return n&&n!==Le&&(a=t?`${t}
|
|
2
2
|
|
|
3
3
|
${n}`:n),a&&i.push({type:"text",text:a}),i.push(...o),i}const Ze=l.createContext(null);function Ne(){const e=l.useContext(Ze);if(!e)throw new Error("useLobuChat must be used within <LobuChatProvider>");return e}function Mo({messages:e,children:t}){const n=l.useMemo(()=>({messages:e,running:!1,append:()=>{},cancel:()=>{},pendingAttachments:[],addAttachments:()=>{},removeAttachment:()=>{},agentId:null,conversationId:"",workspaceSlug:null,currentSuggestions:null}),[e]);return s.jsx(Ze.Provider,{value:n,children:t})}const Nt=/\[([^\]]*)\]\((\S*?\/api\/v1\/files\/[^)\s]+)\)/g;function dt(e){return e.replace(/<lobu_internal_context>[\s\S]*?<\/lobu_internal_context>\n*/g,"").replace(Nt,"").replace(/\n{3,}/g,`
|
|
4
4
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t,Y as o}from"./index-B2AmRqYh.js";const n=()=>t.jsx(o,{});export{n as component};
|
package/dist/owletto/dist/assets/{agents-workbench-BZaoiFNY.js → agents-workbench-C2sr5h82.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s,gQ as C,gR as N,cs as L,af as x,gS as M,gT as S,_ as b,$ as I,p as j,q as k,bt as w,r as W,Y as O,gU as D,gV as P,cd as R,gW as E,gX as F,Z as y,fL as U,L as _,l as G}from"./index-
|
|
1
|
+
import{j as s,gQ as C,gR as N,cs as L,af as x,gS as M,gT as S,_ as b,$ as I,p as j,q as k,bt as w,r as W,Y as O,gU as D,gV as P,cd as R,gW as E,gX as F,Z as y,fL as U,L as _,l as G}from"./index-B2AmRqYh.js";import{A as H}from"./agent-editor-form-BYC4uSNz.js";import{P as T}from"./proposal-review-shell-D4YNrrye.js";function q({identity:e,sections:n,activeSection:t,activeItem:o,onSectionSelect:r,sectionLabel:c,highlightSection:l=!0,className:g}){const a=o??n.find(i=>i.key===t)??n[0];if(!a)return null;const d=a.icon;return s.jsx("div",{className:x("flex shrink-0 flex-col items-center px-4 lg:px-6",g),children:s.jsxs("div",{className:"flex min-w-0 max-w-full flex-wrap items-center justify-center gap-x-3 gap-y-2",children:[e,s.jsxs(C,{children:[s.jsx(N,{asChild:!0,children:s.jsxs("button",{type:"button",className:x("inline-flex shrink-0 items-center gap-1.5 rounded-md px-2.5 py-1 text-sm transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring",l?"bg-muted font-medium text-foreground":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),"aria-label":c,children:[s.jsx(d,{className:"h-3.5 w-3.5 shrink-0"}),a.label,s.jsx(L,{className:"h-3.5 w-3.5 shrink-0 opacity-60"})]})}),s.jsx(M,{align:"center",className:"min-w-[11rem]",children:n.map(({key:i,label:u,icon:m})=>s.jsxs(S,{className:x(i===t&&"bg-accent font-medium"),onSelect:()=>r(i),children:[s.jsx(m,{className:"h-4 w-4"}),s.jsx("span",{children:u})]},i))})]})]})})}const p=[{key:"skills",label:"Skills",icon:D},{key:"guardrails",label:"Guardrails",icon:P},{key:"permissions",label:"Permissions",icon:R,adminOnly:!0},{key:"models",label:"Models",icon:E},{key:"settings",label:"Settings",icon:F}];function z(e){return p.filter(n=>!n.adminOnly||e)}function Q(e,n){if(n===`${e}/conversations`||n.startsWith(`${e}/conversations/`))return null;for(const{key:t}of p)if(n===`${e}/${t}`||n.startsWith(`${e}/${t}/`))return t;return n===`${e}/identity`||n===`${e}/identity/`?"settings":null}function V(e){return e.trim().charAt(0).toUpperCase()||"?"}function X({owner:e,agentId:n,agentName:t,activeDest:o}){const r=b(),{orgContext:c}=y(),{isAdmin:l}=U(c.organizationId),g=z(!!l),a=o??"settings",d=p.find(i=>i.key===a);return s.jsx(q,{identity:s.jsxs(_,{to:"/$owner/agents/$agentId/settings",params:{owner:e,agentId:n},search:{run_id:void 0},className:"flex min-w-0 items-center gap-2 rounded-md outline-none transition-colors hover:opacity-90 focus-visible:ring-2 focus-visible:ring-ring",title:"Agent settings",children:[s.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-semibold text-foreground",children:V(t)}),s.jsx("h1",{className:"min-w-0 truncate text-base font-semibold tracking-tight",children:t})]}),sections:g,activeSection:a,activeItem:d,sectionLabel:"Agent section",highlightSection:o!==null,onSectionSelect:i=>{r({to:`/$owner/agents/$agentId/${i}`,params:{owner:e,agentId:n}})}})}function K({owner:e,agentId:n}){const t=b(),{pathname:o}=I(),{isAuthenticated:r}=j(),{isMember:c}=k(),l=r&&c,{data:g=[],isLoading:a}=w({enabled:l}),d=g.find($=>$.agentId===n)??null,i=!d&&!a&&l,u=`/${e}/agents/${n}`,m=`${u}/conversations`,f=o===m||o.startsWith(`${m}/`),h=Q(u,o);W.useEffect(()=>{i&&t({to:"/$owner",params:{owner:e},replace:!0})},[i,t,e]);const A=d?.name??"Agent";return s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-3 overflow-hidden py-4 md:py-6",children:[s.jsx(X,{owner:e,agentId:n,agentName:A,activeDest:h}),s.jsx("div",{className:x("flex min-h-0 min-w-0 flex-1 flex-col px-4 lg:px-6",f?"overflow-hidden":"overflow-y-auto"),children:s.jsx(O,{})})]})}function Y({agent:e,tab:n,runId:t}){return s.jsx("div",{className:"mx-auto w-full max-w-3xl pb-6",children:s.jsx(T,{resource:{kind:"agent",agentId:e.agentId},runId:t,children:({reviewMode:o,proposal:r,controlsDisabled:c})=>s.jsx(H,{mode:{kind:"edit",agent:e},section:n,reviewMode:o,reviewProposal:r,reviewControlsDisabled:c},e.agentId)})})}function ee({owner:e,agentId:n,tab:t,runId:o}){const{orgContext:r,hasOrgContext:c}=y(),{isLoading:l}=G(`/${e}`,r),{isAuthenticated:g}=j(),{isMember:a,isLoading:d}=k(),i=g&&a,{data:u=[],isLoading:m}=w({enabled:i}),v=i?!c||l||m||d:l||d,f=u.find(h=>h.agentId===n)??null;return v||!f?null:s.jsx(Y,{agent:f,tab:t,runId:o})}export{K as A,ee as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l,hZ as p,bi as u,b9 as f,bo as m,j as e,ba as j,L as i,hk as g,eL as x,bn as b,co as N,gA as v,gB as w,gC as y,R as C,B as k,aL as P,e3 as A,h_ as D,aS as B}from"./index-
|
|
1
|
+
import{r as l,hZ as p,bi as u,b9 as f,bo as m,j as e,ba as j,L as i,hk as g,eL as x,bn as b,co as N,gA as v,gB as w,gC as y,R as C,B as k,aL as P,e3 as A,h_ as D,aS as B}from"./index-B2AmRqYh.js";import{d as L}from"./device-rows-Bwf8qDte.js";function R({ownerSlug:s,appId:n}){const t=l.useMemo(()=>p(s,n,u()),[s,n]),{data:a=[]}=f(),o=l.useMemo(()=>{const r=t?.devicePlatforms;return r?.length?a.filter(c=>{const d=m(c);return d!=null&&r.includes(d)}):[]},[t,a]);if(!t)return e.jsxs(j,{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"There is no app by that name."}),e.jsx(i,{to:"/$owner/connectors",params:{owner:s},search:{},className:"text-sm text-primary hover:underline",children:"Back to connectors"})]});const h=(t.devicePlatforms?.length??0)>0;return e.jsx("div",{className:"flex flex-1 flex-col",children:e.jsxs(g,{header:e.jsx(v,{breadcrumb:e.jsx(w,{crumbs:[e.jsx(i,{to:"/$owner/connectors",params:{owner:s},search:{},className:y,children:"Connectors"},"connectors")]}),icon:e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border text-muted-foreground",children:t.icon}),title:t.name,caption:t.description}),children:[e.jsx(x,{title:"Set up",children:e.jsx("div",{className:"space-y-3",children:t.steps.map(r=>e.jsx(S,{step:r},r.label))})}),h?e.jsx(x,{title:"Devices",count:o.length>0?String(o.length):void 0,children:o.length===0?e.jsx("p",{className:"text-xs text-muted-foreground",children:"Nothing yet. Finish the steps above and it appears here, and on the connectors list."}):e.jsx("div",{className:"overflow-hidden rounded-lg border",children:o.map((r,c)=>e.jsxs(i,{to:"/$owner/connectors/device/$deviceId",params:{owner:s,deviceId:r.id},className:I(c,o.length),children:[e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:e.jsx(b,{platform:m(r)})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:N(r)}),e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:L(r)})]})]},r.id))})}):null]})})}function I(s,n){return`flex items-center gap-3 px-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground ${s===n-1?"":"border-b"}`}function S({step:s}){const[n,t]=l.useState(!1);if(s.href)return e.jsxs("a",{href:s.href,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-xs font-medium text-primary hover:bg-accent/50",children:[s.label,e.jsx(C,{className:"h-3 w-3"})]});const a=s.command??"";return e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:s.label}),e.jsxs("div",{className:"flex items-start gap-2 rounded-lg border bg-muted/40 p-2.5",children:[e.jsx("pre",{className:"min-w-0 flex-1 overflow-x-auto font-mono text-xs leading-relaxed",children:a}),e.jsxs(k,{variant:"ghost",size:"sm",className:"h-6 shrink-0 px-1.5 text-xs",onClick:()=>{typeof navigator>"u"||!navigator.clipboard||navigator.clipboard.writeText(a).then(()=>{t(!0),setTimeout(()=>t(!1),1500)})},children:[n?e.jsx(P,{className:"h-3.5 w-3.5"}):e.jsx(A,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"sr-only",children:"Copy"})]})]})]})}function M(){const{owner:s,appId:n}=D.useParams();return e.jsx(B,{owner:s,children:({ownerSlug:t})=>e.jsx(R,{ownerSlug:t,appId:n})})}export{M as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as j,j as e,S as A,dy as O,dz as D,dA as L,dB as M,dC as B,dD as F,o as U,dE as H,D as S,Z as J,l as K,p as V,q as W,dF as z,dG as w,B as P,L as T,dH as $,af as G,aP as X,dI as Y}from"./index-GZkujXG1.js";import{C as q,A as Z}from"./create-automation-form-BHir-pIp.js";import{P as Q}from"./proposal-review-shell-C04RG1qM.js";import{J as E}from"./json-diff-D6sv990W.js";import{u as ee,a as te}from"./deployments-DHAx8TBs.js";import{A as ne}from"./agent-loading-shells-Cve_XIMW.js";import{b as oe,a as se,s as ae,h as re,R as ie,A as le}from"./agent-thread-DhCFggHZ.js";import{E as ue}from"./events-feed-BgvLTppV.js";const ce=20;function C({automationId:t}){const n=ee({resourceKind:"automation",resourceId:t}),[s,r]=j.useState(null),u=te(s!=null?String(s):null),d=(n.data?.pages.length??0)>=ce&&!!n.hasNextPage,o=!!n.isFetchNextPageError;j.useEffect(()=>{!d&&n.hasNextPage&&!n.isFetchingNextPage&&!n.isError&&!o&&n.fetchNextPage()},[d,n.fetchNextPage,n.hasNextPage,n.isFetchingNextPage,n.isError,o]);const f=j.useMemo(()=>(n.data?.pages??[]).flatMap(c=>c.items).filter(c=>c.type==="change"&&c.resourceKind==="automation"&&c.resourceId===String(t)),[n.data,t]),i=!!n.hasNextPage&&!d,p=typeof n.refetch=="function",m=typeof n.fetchNextPage=="function";return n.isLoading?e.jsx(A,{className:"h-20 w-full rounded-lg"}):n.isError&&!o?e.jsxs("section",{className:"space-y-2","aria-label":"Automation definition history","data-testid":"automation-definition-history",children:[e.jsx("h3",{className:"font-medium text-sm",children:"Definition history"}),e.jsx("p",{className:"text-sm text-muted-foreground","data-testid":"automation-definition-history-error",children:"Definition history unavailable."}),p?e.jsx("button",{type:"button",className:"text-sm underline","data-testid":"automation-definition-history-retry",onClick:()=>void n.refetch(),children:"Retry"}):null]}):e.jsxs("section",{className:"space-y-2","aria-label":"Automation definition history","data-testid":"automation-definition-history",children:[e.jsx("h3",{className:"font-medium text-sm",children:"Definition history"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Runtime and delivery configuration changes with actor and before/after. Content versions (prompt, sources) are listed separately."}),f.length===0&&!i?e.jsx("p",{className:"py-4 text-sm text-muted-foreground","data-testid":"automation-definition-history-empty",children:"No definition changes recorded yet."}):e.jsx("ul",{className:"space-y-1","data-testid":"automation-definition-history-list",children:f.map(a=>{if(a.type!=="change")return null;const l=a.createdBy??a.agentId??a.actorSource??"unknown";return e.jsx("li",{children:e.jsxs("button",{type:"button",className:"flex w-full flex-wrap items-center justify-between gap-2 rounded-lg border border-border/60 px-3 py-2 text-left text-sm hover:bg-muted/50",onClick:()=>r(c=>c===a.id?null:a.id),"data-testid":`automation-definition-history-item-${a.id}`,children:[e.jsx("span",{className:"font-medium",children:a.action??a.op??"change"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:(a.changedFields??[]).join(", ")}),e.jsx("span",{className:"text-xs text-muted-foreground",children:l}),e.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(a.createdAt).toLocaleString()})]})},a.id)})}),i?e.jsx("p",{className:"text-xs text-muted-foreground","data-testid":"automation-definition-history-loading-more",children:"Loading more history…"}):null,d?e.jsx("p",{className:"text-xs text-muted-foreground","data-testid":"automation-definition-history-capped",children:"Showing recent definition changes"}):null,o?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"text-xs text-muted-foreground","data-testid":"automation-definition-history-page-error",children:"Couldn't load more history."}),m?e.jsx("button",{type:"button",className:"text-xs underline","data-testid":"automation-definition-history-retry-next",onClick:()=>void n.fetchNextPage(),children:"Retry"}):null]}):null,s!=null?e.jsx("div",{"data-testid":"automation-definition-history-detail",children:u.isLoading?e.jsx(A,{className:"h-24 w-full rounded-lg"}):u.isError?e.jsx("p",{className:"text-sm text-muted-foreground","data-testid":"automation-definition-history-detail-error",children:"Change detail unavailable."}):u.data?e.jsx(E,{before:u.data.before,after:u.data.after}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Change detail unavailable."})}):null]})}const R=Symbol("trusted-automation-interaction");function _(t){return Object.defineProperty(t,R,{value:!0}),t}function de(t){return{title:`${t} items waiting for you`,icon:"entity",impact:{level:"normal"},tone:"default",blocks:[{type:"text",value:"Review the individual proposals below, or decide the whole run at once.",muted:!0}],actions:[{id:"approve-all",label:"Approve all",variant:"primary",icon:"check",confirm:!0,confirmPrompt:`Approve all ${t} proposals?`,tool:"manage_operations",args:{action:"approve"},resolvedLabel:`Approved all ${t} proposals.`},{id:"reject-all",label:"Keep all separate",variant:"outline",icon:"x",confirm:!0,confirmPrompt:`Reject all ${t} proposals?`,tool:"manage_operations",args:{action:"reject"},resolvedLabel:`Rejected all ${t} proposals.`}]}}const me=new Set(["entity-merge-approval","automation-approval-batch","entity-merge-result"]);function N(t){return new Promise(n=>{t({onSettled:(s,r)=>n(!!r)})})}function I(t){try{return new URL(t,window.location.origin).origin===window.location.origin}catch{return!1}}function pe(){const t=O(),n=D(),s=L(),r=M(),u=B();return j.useMemo(()=>({toolNames:me,resolve:(h,d)=>{if(!d||typeof d!="object"||d[R]!==!0)return null;const o=d;if(h==="automation-approval-batch"){const m=typeof o.runId=="number"&&Number.isSafeInteger(o.runId)&&o.runId>0?o.runId:null,a=typeof o.count=="number"&&Number.isSafeInteger(o.count)&&o.count>1?o.count:null,l=Array.isArray(o.runIds)?o.runIds.filter(c=>typeof c=="number"&&Number.isSafeInteger(c)&&c>0):[];return m===null||a===null||l.length!==a||new Set(l).size!==a?null:{view:de(a),handlers:{manage_operations:c=>c.action!=="approve"&&c.action!=="reject"?Promise.resolve(!0):N(y=>c.action==="approve"?t.mutate({run_id:m,run_ids:l},y):n.mutate({run_id:m,run_ids:l},y))}}}if(h==="entity-merge-approval"){const m=typeof o.runId=="number"&&Number.isSafeInteger(o.runId)&&o.runId>0?o.runId:null;if(m===null||o.action!=="merge"||o.resourceKind!=="entity")return null;const a=oe(o),l=(o.status??"pending")==="pending";return{view:a.view,handlers:{open_review_link:c=>{const y=typeof c.url=="string"?c.url:"";return!a.reviewUrls.has(y)||!I(y)?Promise.resolve(!0):(window.open(y,"_blank","noopener,noreferrer"),Promise.resolve(!1))},...l?{manage_operations:c=>c.action==="approve"?N(y=>s.mutate({run_id:m},y)):c.action==="reject"?N(y=>r.mutate({run_id:m},y)):Promise.resolve(!0)}:{}}}}if(h!=="entity-merge-result")return null;const f=o.loser&&typeof o.loser=="object"?o.loser:null,i=typeof f?.id=="number"?f.id:null;if(i===null)return null;const p=se(o);return{view:p.view,handlers:{open_review_link:m=>{const a=typeof m.url=="string"?m.url:"";return!p.reviewUrls.has(a)||!I(a)?Promise.resolve(!0):(window.open(a,"_blank","noopener,noreferrer"),Promise.resolve(!1))},manage_entity:()=>N(m=>u.mutate({entityId:i},m))}}}}),[s,t,r,n,u])}function ge(t){const n=[];return t.forEach((s,r)=>{n.push({id:`sep:${s.runId}`,role:"system",parts:[{type:"text",text:fe(s,r)}],createdAt:s.completedAt?new Date(s.completedAt).getTime():void 0});for(const u of s.messages)n.push({...u,id:`r${s.runId}:${u.id}`})}),n}function fe(t,n){const s=(t.pendingActionCount??0)>0?`Waiting for you (${t.pendingActionCount})`:t.status==="completed"?"Completed":t.status??"Completed",r=(t.autoAppliedCount??0)>0?` · ${t.autoAppliedCount} applied automatically`:"",u=t.completedAt?new Date(t.completedAt).toLocaleString():null;return u?`Run ${n+1} · ${s}${r} · ${u}`:`Run ${n+1} · ${s}${r}`}const he=/(?:^|\n)Run this Automation now/;function xe(t){return t.role==="user"&&t.parts.some(n=>n.type==="text"&&he.test(n.text))}function ye(t){return`history-interaction:${t.runId}:${t.eventId??"error"}`}function ve({agentId:t,automationId:n,ownerSlug:s,runId:r}){const{data:u,isLoading:h}=F(t,n,{orgSlug:s}),d=pe(),o=U(),f=j.useCallback(p=>{o?.open({href:`/${s}/automations/${n}?run_id=${p}`,title:`Automation run #${p}`,runId:p})},[o,s,t,n]),i=j.useMemo(()=>{const p=u?.runs??[],a=(r!=null?p.filter(l=>l.runId===r):p).slice().reverse();return ge(a.map(l=>{const c=l.messages.map(g=>ae(g,{showToolCalls:!0})).filter(g=>g!==null&&!xe(g));l.task?.trim()&&c.unshift({id:"task",role:"user",parts:[{type:"text",text:l.task.trim()}]});for(const g of l.automaticActions??[]){const v=x=>H(s,[...x.parentEntityType&&x.parentSlug?[{entity_type:x.parentEntityType,slug:x.parentSlug}]:[],{entity_type:x.entityType,slug:x.slug}]);c.push({id:`automatic-action:${g.operationId}`,role:"assistant",parts:[{type:"tool-call",toolCallId:`automatic-action-${g.operationId}`,toolName:"entity-merge-result",args:_({...g,loserHref:v(g.loser),winnerHref:v(g.winner)})}]})}const y=l.actions??[],b=y.filter(g=>g.status==="pending");if(b.length>1){const g=b.map(v=>v.runId).sort((v,x)=>v-x);c.push({id:"approval-batch",role:"assistant",parts:[{type:"tool-call",toolCallId:`approval-batch-${l.runId}`,toolName:"automation-approval-batch",args:_({runId:l.runId,count:b.length,runIds:g})}]})}for(const g of y){const v=re([g],{workspaceSlug:s,agentId:t,webOrigin:typeof window>"u"?null:window.location.origin});v&&c.push({...v,id:ye(g),parts:v.parts.map(x=>x.type==="tool-call"&&x.toolName==="tool-approval"&&g.action==="merge"&&g.resourceKind==="entity"?{...x,toolName:"entity-merge-approval",args:_({...x.args})}:x)})}return{runId:l.runId,completedAt:l.completedAt,status:l.status,pendingActionCount:l.pendingActionCount,autoAppliedCount:l.autoAppliedCount,messages:c}}))},[t,u,s,r]);return h?e.jsx(ne,{readOnly:!0}):i.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No run transcripts yet. Recent runs will show here when the Automation fires (failed runs appear with their prompt even without a full transcript)."}):e.jsx("div",{className:"flex h-[calc(100dvh-12rem)] min-h-[24rem] min-w-0 flex-1 flex-col",children:e.jsx(ie,{messages:i,children:e.jsx(le,{readOnly:!0,readerPositionMode:"runs",interactionExtension:d,onRunSelect:r==null&&o?f:void 0})})})}function k(t){const{orgContext:n,hasOrgContext:s}=J(),{data:r,isLoading:u}=K(`/${t}`,n),{isAuthenticated:h}=V(),{isMember:d,isLoading:o}=W(),f=h&&d,i=r?.workspace,p=f?!s||u||o:u||o;return{organizationId:i?.id??"",isLoading:p}}function Ee(t){return k(t)}function je({owner:t,automationId:n,organizationId:s}){const{data:r,isLoading:u}=z(n,s),h=r?.length??0,d=h>w,o=Math.min(h,w),f=new Set(r?.map(l=>l.entity_type).filter(Boolean)??[]),i=!d&&f.size===1?[...f][0]:null;if(u)return e.jsx(A,{className:"h-10 w-full rounded-lg"});if(o===0)return null;const p=d?`${w}+`:String(o),m=i!=null?`${p} ${i} ${o===1?"entity":"entities"} built by this automation`:`${p} ${o===1?"entity":"entities"} built by this automation`,a=i!=null?Y(t,i):{to:"/$owner/data",params:{owner:t},search:{}};return e.jsxs("div",{className:G(X,"flex flex-wrap items-center justify-between gap-2 px-3 py-2.5 text-sm"),children:[e.jsx("span",{className:"text-muted-foreground",children:m}),e.jsx(P,{asChild:!0,variant:"ghost",size:"sm",className:"h-7 gap-1",children:e.jsxs(T,{to:a.to,params:a.params,search:a.search,children:["View in Memory",e.jsx($,{className:"h-3.5 w-3.5"})]})})]})}function Ne({owner:t,automationId:n,organizationId:s}){const r=Number(n),u=j.useMemo(()=>({producedByAutomationId:r}),[r]);return Number.isFinite(r)?e.jsxs("section",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"font-medium text-sm",children:"Produced by this Automation"}),e.jsx(P,{asChild:!0,variant:"ghost",size:"sm",className:"h-7 gap-1",children:e.jsxs(T,{to:"/$owner/events",params:{owner:t},search:{produced_by:String(r)},children:["Open in Activity",e.jsx($,{className:"h-3.5 w-3.5"})]})})]}),e.jsx(ue,{organizationId:s,ownerSlug:t,filters:u,emptyState:e.jsx("p",{className:"py-6 text-sm text-muted-foreground",children:"This Automation hasn't written anything yet. Events it creates, entities it changes and notifications it sends will appear here."})})]}):null}function Ae({agentId:t,owner:n,automationId:s,organizationId:r}){return e.jsxs("div",{className:"space-y-4",children:[r?e.jsx(je,{owner:n,automationId:s,organizationId:r}):null,t?e.jsx(ve,{agentId:t,automationId:s,ownerSlug:n}):e.jsx("p",{className:"rounded-lg border border-border/60 px-3 py-2.5 text-sm text-muted-foreground",children:"Runs execute on the automation's executor, so there is no agent transcript to show. What it produced is below."}),r?e.jsx(Ne,{owner:n,automationId:s,organizationId:r}):null]})}function be({agentId:t,automationId:n,runId:s,organizationId:r,onDone:u}){const[h,d]=j.useState({ready:!1,triggers:[]}),o=j.useCallback(a=>{d(l=>JSON.stringify(l)===JSON.stringify(a)?l:a)},[]),f=S(n,void 0,r,{includeVersions:!0}),i=f.data?.automation,p=e.jsx("div",{className:"flex flex-col gap-4",children:[0,1,2].map(a=>e.jsx(A,{className:"h-16 w-full rounded-lg"},a))}),m=f.isLoading?p:i?e.jsx(q,{organizationId:r,prefillAgentId:t??void 0,editingAutomation:{automation_id:i.automation_id,name:i.automation_name,slug:i.slug,description:i.description,prompt:i.prompt,sources:i.sources,reaction_script:i.reaction_script,managed_agent_id:i.managed_agent_id,device_worker_id:i.device_worker_id,agent_kind:i.agent_kind,delivery_target:i.delivery_target??void 0,execution_config:i.execution_config??void 0,keying_config:i.keying_config,reactions_guidance:i.reactions_guidance,triggers:i.triggers},createFields:{triggers:h.triggers},triggerFields:e.jsx(Z,{organizationId:r,initialTriggers:i.triggers??[],onChange:o},JSON.stringify(i.triggers??[])),hideHeader:!0,hideCancel:!0,submitDisabled:!h.ready,onClose:u,onSuccess:u}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Automation not found. It may have been removed."});return t?e.jsxs("div",{className:"space-y-6",children:[e.jsx(Q,{resource:{kind:"automation",agentId:t,automationId:n},runId:s,onDone:u,children:({reviewMode:a,proposal:l})=>a==="active"?e.jsx(E,{before:l?.current??null,after:{...l?.current??{},...l?.proposedAfter??{}}}):a==="loading"?p:a==="error"?null:m}),e.jsx(C,{automationId:n})]}):e.jsxs("div",{className:"space-y-6",children:[m,e.jsx(C,{automationId:n})]})}function Re({owner:t,agentId:n,automationId:s,view:r,runId:u,onDone:h}){const{organizationId:d}=k(t),o=S(s,void 0,d),f=n??o.data?.automation?.managed_agent_id??null;return u||r==="definition"?e.jsx(be,{agentId:f,automationId:s,runId:u,organizationId:d,onDone:h}):e.jsx(Ae,{agentId:f,owner:t,automationId:s,organizationId:d})}export{ve as A,Re as a,Ee as u};
|
|
1
|
+
import{r as j,j as e,S as A,dy as O,dz as D,dA as L,dB as M,dC as B,dD as F,o as U,dE as H,D as S,Z as J,l as K,p as V,q as W,dF as z,dG as w,B as P,L as T,dH as $,af as G,aP as X,dI as Y}from"./index-B2AmRqYh.js";import{C as q,A as Z}from"./create-automation-form-CuxiIRCF.js";import{P as Q}from"./proposal-review-shell-D4YNrrye.js";import{J as E}from"./json-diff-ClBBYBQD.js";import{u as ee,a as te}from"./deployments-ByBv1DW-.js";import{A as ne}from"./agent-loading-shells-OagauQzV.js";import{b as oe,a as se,s as ae,h as re,R as ie,A as le}from"./agent-thread-B9-cdkaV.js";import{E as ue}from"./events-feed-DK35T4g7.js";const ce=20;function C({automationId:t}){const n=ee({resourceKind:"automation",resourceId:t}),[s,r]=j.useState(null),u=te(s!=null?String(s):null),d=(n.data?.pages.length??0)>=ce&&!!n.hasNextPage,o=!!n.isFetchNextPageError;j.useEffect(()=>{!d&&n.hasNextPage&&!n.isFetchingNextPage&&!n.isError&&!o&&n.fetchNextPage()},[d,n.fetchNextPage,n.hasNextPage,n.isFetchingNextPage,n.isError,o]);const f=j.useMemo(()=>(n.data?.pages??[]).flatMap(c=>c.items).filter(c=>c.type==="change"&&c.resourceKind==="automation"&&c.resourceId===String(t)),[n.data,t]),i=!!n.hasNextPage&&!d,p=typeof n.refetch=="function",m=typeof n.fetchNextPage=="function";return n.isLoading?e.jsx(A,{className:"h-20 w-full rounded-lg"}):n.isError&&!o?e.jsxs("section",{className:"space-y-2","aria-label":"Automation definition history","data-testid":"automation-definition-history",children:[e.jsx("h3",{className:"font-medium text-sm",children:"Definition history"}),e.jsx("p",{className:"text-sm text-muted-foreground","data-testid":"automation-definition-history-error",children:"Definition history unavailable."}),p?e.jsx("button",{type:"button",className:"text-sm underline","data-testid":"automation-definition-history-retry",onClick:()=>void n.refetch(),children:"Retry"}):null]}):e.jsxs("section",{className:"space-y-2","aria-label":"Automation definition history","data-testid":"automation-definition-history",children:[e.jsx("h3",{className:"font-medium text-sm",children:"Definition history"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Runtime and delivery configuration changes with actor and before/after. Content versions (prompt, sources) are listed separately."}),f.length===0&&!i?e.jsx("p",{className:"py-4 text-sm text-muted-foreground","data-testid":"automation-definition-history-empty",children:"No definition changes recorded yet."}):e.jsx("ul",{className:"space-y-1","data-testid":"automation-definition-history-list",children:f.map(a=>{if(a.type!=="change")return null;const l=a.createdBy??a.agentId??a.actorSource??"unknown";return e.jsx("li",{children:e.jsxs("button",{type:"button",className:"flex w-full flex-wrap items-center justify-between gap-2 rounded-lg border border-border/60 px-3 py-2 text-left text-sm hover:bg-muted/50",onClick:()=>r(c=>c===a.id?null:a.id),"data-testid":`automation-definition-history-item-${a.id}`,children:[e.jsx("span",{className:"font-medium",children:a.action??a.op??"change"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:(a.changedFields??[]).join(", ")}),e.jsx("span",{className:"text-xs text-muted-foreground",children:l}),e.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(a.createdAt).toLocaleString()})]})},a.id)})}),i?e.jsx("p",{className:"text-xs text-muted-foreground","data-testid":"automation-definition-history-loading-more",children:"Loading more history…"}):null,d?e.jsx("p",{className:"text-xs text-muted-foreground","data-testid":"automation-definition-history-capped",children:"Showing recent definition changes"}):null,o?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"text-xs text-muted-foreground","data-testid":"automation-definition-history-page-error",children:"Couldn't load more history."}),m?e.jsx("button",{type:"button",className:"text-xs underline","data-testid":"automation-definition-history-retry-next",onClick:()=>void n.fetchNextPage(),children:"Retry"}):null]}):null,s!=null?e.jsx("div",{"data-testid":"automation-definition-history-detail",children:u.isLoading?e.jsx(A,{className:"h-24 w-full rounded-lg"}):u.isError?e.jsx("p",{className:"text-sm text-muted-foreground","data-testid":"automation-definition-history-detail-error",children:"Change detail unavailable."}):u.data?e.jsx(E,{before:u.data.before,after:u.data.after}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Change detail unavailable."})}):null]})}const R=Symbol("trusted-automation-interaction");function _(t){return Object.defineProperty(t,R,{value:!0}),t}function de(t){return{title:`${t} items waiting for you`,icon:"entity",impact:{level:"normal"},tone:"default",blocks:[{type:"text",value:"Review the individual proposals below, or decide the whole run at once.",muted:!0}],actions:[{id:"approve-all",label:"Approve all",variant:"primary",icon:"check",confirm:!0,confirmPrompt:`Approve all ${t} proposals?`,tool:"manage_operations",args:{action:"approve"},resolvedLabel:`Approved all ${t} proposals.`},{id:"reject-all",label:"Keep all separate",variant:"outline",icon:"x",confirm:!0,confirmPrompt:`Reject all ${t} proposals?`,tool:"manage_operations",args:{action:"reject"},resolvedLabel:`Rejected all ${t} proposals.`}]}}const me=new Set(["entity-merge-approval","automation-approval-batch","entity-merge-result"]);function N(t){return new Promise(n=>{t({onSettled:(s,r)=>n(!!r)})})}function I(t){try{return new URL(t,window.location.origin).origin===window.location.origin}catch{return!1}}function pe(){const t=O(),n=D(),s=L(),r=M(),u=B();return j.useMemo(()=>({toolNames:me,resolve:(h,d)=>{if(!d||typeof d!="object"||d[R]!==!0)return null;const o=d;if(h==="automation-approval-batch"){const m=typeof o.runId=="number"&&Number.isSafeInteger(o.runId)&&o.runId>0?o.runId:null,a=typeof o.count=="number"&&Number.isSafeInteger(o.count)&&o.count>1?o.count:null,l=Array.isArray(o.runIds)?o.runIds.filter(c=>typeof c=="number"&&Number.isSafeInteger(c)&&c>0):[];return m===null||a===null||l.length!==a||new Set(l).size!==a?null:{view:de(a),handlers:{manage_operations:c=>c.action!=="approve"&&c.action!=="reject"?Promise.resolve(!0):N(y=>c.action==="approve"?t.mutate({run_id:m,run_ids:l},y):n.mutate({run_id:m,run_ids:l},y))}}}if(h==="entity-merge-approval"){const m=typeof o.runId=="number"&&Number.isSafeInteger(o.runId)&&o.runId>0?o.runId:null;if(m===null||o.action!=="merge"||o.resourceKind!=="entity")return null;const a=oe(o),l=(o.status??"pending")==="pending";return{view:a.view,handlers:{open_review_link:c=>{const y=typeof c.url=="string"?c.url:"";return!a.reviewUrls.has(y)||!I(y)?Promise.resolve(!0):(window.open(y,"_blank","noopener,noreferrer"),Promise.resolve(!1))},...l?{manage_operations:c=>c.action==="approve"?N(y=>s.mutate({run_id:m},y)):c.action==="reject"?N(y=>r.mutate({run_id:m},y)):Promise.resolve(!0)}:{}}}}if(h!=="entity-merge-result")return null;const f=o.loser&&typeof o.loser=="object"?o.loser:null,i=typeof f?.id=="number"?f.id:null;if(i===null)return null;const p=se(o);return{view:p.view,handlers:{open_review_link:m=>{const a=typeof m.url=="string"?m.url:"";return!p.reviewUrls.has(a)||!I(a)?Promise.resolve(!0):(window.open(a,"_blank","noopener,noreferrer"),Promise.resolve(!1))},manage_entity:()=>N(m=>u.mutate({entityId:i},m))}}}}),[s,t,r,n,u])}function ge(t){const n=[];return t.forEach((s,r)=>{n.push({id:`sep:${s.runId}`,role:"system",parts:[{type:"text",text:fe(s,r)}],createdAt:s.completedAt?new Date(s.completedAt).getTime():void 0});for(const u of s.messages)n.push({...u,id:`r${s.runId}:${u.id}`})}),n}function fe(t,n){const s=(t.pendingActionCount??0)>0?`Waiting for you (${t.pendingActionCount})`:t.status==="completed"?"Completed":t.status??"Completed",r=(t.autoAppliedCount??0)>0?` · ${t.autoAppliedCount} applied automatically`:"",u=t.completedAt?new Date(t.completedAt).toLocaleString():null;return u?`Run ${n+1} · ${s}${r} · ${u}`:`Run ${n+1} · ${s}${r}`}const he=/(?:^|\n)Run this Automation now/;function xe(t){return t.role==="user"&&t.parts.some(n=>n.type==="text"&&he.test(n.text))}function ye(t){return`history-interaction:${t.runId}:${t.eventId??"error"}`}function ve({agentId:t,automationId:n,ownerSlug:s,runId:r}){const{data:u,isLoading:h}=F(t,n,{orgSlug:s}),d=pe(),o=U(),f=j.useCallback(p=>{o?.open({href:`/${s}/automations/${n}?run_id=${p}`,title:`Automation run #${p}`,runId:p})},[o,s,t,n]),i=j.useMemo(()=>{const p=u?.runs??[],a=(r!=null?p.filter(l=>l.runId===r):p).slice().reverse();return ge(a.map(l=>{const c=l.messages.map(g=>ae(g,{showToolCalls:!0})).filter(g=>g!==null&&!xe(g));l.task?.trim()&&c.unshift({id:"task",role:"user",parts:[{type:"text",text:l.task.trim()}]});for(const g of l.automaticActions??[]){const v=x=>H(s,[...x.parentEntityType&&x.parentSlug?[{entity_type:x.parentEntityType,slug:x.parentSlug}]:[],{entity_type:x.entityType,slug:x.slug}]);c.push({id:`automatic-action:${g.operationId}`,role:"assistant",parts:[{type:"tool-call",toolCallId:`automatic-action-${g.operationId}`,toolName:"entity-merge-result",args:_({...g,loserHref:v(g.loser),winnerHref:v(g.winner)})}]})}const y=l.actions??[],b=y.filter(g=>g.status==="pending");if(b.length>1){const g=b.map(v=>v.runId).sort((v,x)=>v-x);c.push({id:"approval-batch",role:"assistant",parts:[{type:"tool-call",toolCallId:`approval-batch-${l.runId}`,toolName:"automation-approval-batch",args:_({runId:l.runId,count:b.length,runIds:g})}]})}for(const g of y){const v=re([g],{workspaceSlug:s,agentId:t,webOrigin:typeof window>"u"?null:window.location.origin});v&&c.push({...v,id:ye(g),parts:v.parts.map(x=>x.type==="tool-call"&&x.toolName==="tool-approval"&&g.action==="merge"&&g.resourceKind==="entity"?{...x,toolName:"entity-merge-approval",args:_({...x.args})}:x)})}return{runId:l.runId,completedAt:l.completedAt,status:l.status,pendingActionCount:l.pendingActionCount,autoAppliedCount:l.autoAppliedCount,messages:c}}))},[t,u,s,r]);return h?e.jsx(ne,{readOnly:!0}):i.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No run transcripts yet. Recent runs will show here when the Automation fires (failed runs appear with their prompt even without a full transcript)."}):e.jsx("div",{className:"flex h-[calc(100dvh-12rem)] min-h-[24rem] min-w-0 flex-1 flex-col",children:e.jsx(ie,{messages:i,children:e.jsx(le,{readOnly:!0,readerPositionMode:"runs",interactionExtension:d,onRunSelect:r==null&&o?f:void 0})})})}function k(t){const{orgContext:n,hasOrgContext:s}=J(),{data:r,isLoading:u}=K(`/${t}`,n),{isAuthenticated:h}=V(),{isMember:d,isLoading:o}=W(),f=h&&d,i=r?.workspace,p=f?!s||u||o:u||o;return{organizationId:i?.id??"",isLoading:p}}function Ee(t){return k(t)}function je({owner:t,automationId:n,organizationId:s}){const{data:r,isLoading:u}=z(n,s),h=r?.length??0,d=h>w,o=Math.min(h,w),f=new Set(r?.map(l=>l.entity_type).filter(Boolean)??[]),i=!d&&f.size===1?[...f][0]:null;if(u)return e.jsx(A,{className:"h-10 w-full rounded-lg"});if(o===0)return null;const p=d?`${w}+`:String(o),m=i!=null?`${p} ${i} ${o===1?"entity":"entities"} built by this automation`:`${p} ${o===1?"entity":"entities"} built by this automation`,a=i!=null?Y(t,i):{to:"/$owner/data",params:{owner:t},search:{}};return e.jsxs("div",{className:G(X,"flex flex-wrap items-center justify-between gap-2 px-3 py-2.5 text-sm"),children:[e.jsx("span",{className:"text-muted-foreground",children:m}),e.jsx(P,{asChild:!0,variant:"ghost",size:"sm",className:"h-7 gap-1",children:e.jsxs(T,{to:a.to,params:a.params,search:a.search,children:["View in Memory",e.jsx($,{className:"h-3.5 w-3.5"})]})})]})}function Ne({owner:t,automationId:n,organizationId:s}){const r=Number(n),u=j.useMemo(()=>({producedByAutomationId:r}),[r]);return Number.isFinite(r)?e.jsxs("section",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"font-medium text-sm",children:"Produced by this Automation"}),e.jsx(P,{asChild:!0,variant:"ghost",size:"sm",className:"h-7 gap-1",children:e.jsxs(T,{to:"/$owner/events",params:{owner:t},search:{produced_by:String(r)},children:["Open in Activity",e.jsx($,{className:"h-3.5 w-3.5"})]})})]}),e.jsx(ue,{organizationId:s,ownerSlug:t,filters:u,emptyState:e.jsx("p",{className:"py-6 text-sm text-muted-foreground",children:"This Automation hasn't written anything yet. Events it creates, entities it changes and notifications it sends will appear here."})})]}):null}function Ae({agentId:t,owner:n,automationId:s,organizationId:r}){return e.jsxs("div",{className:"space-y-4",children:[r?e.jsx(je,{owner:n,automationId:s,organizationId:r}):null,t?e.jsx(ve,{agentId:t,automationId:s,ownerSlug:n}):e.jsx("p",{className:"rounded-lg border border-border/60 px-3 py-2.5 text-sm text-muted-foreground",children:"Runs execute on the automation's executor, so there is no agent transcript to show. What it produced is below."}),r?e.jsx(Ne,{owner:n,automationId:s,organizationId:r}):null]})}function be({agentId:t,automationId:n,runId:s,organizationId:r,onDone:u}){const[h,d]=j.useState({ready:!1,triggers:[]}),o=j.useCallback(a=>{d(l=>JSON.stringify(l)===JSON.stringify(a)?l:a)},[]),f=S(n,void 0,r,{includeVersions:!0}),i=f.data?.automation,p=e.jsx("div",{className:"flex flex-col gap-4",children:[0,1,2].map(a=>e.jsx(A,{className:"h-16 w-full rounded-lg"},a))}),m=f.isLoading?p:i?e.jsx(q,{organizationId:r,prefillAgentId:t??void 0,editingAutomation:{automation_id:i.automation_id,name:i.automation_name,slug:i.slug,description:i.description,prompt:i.prompt,sources:i.sources,reaction_script:i.reaction_script,managed_agent_id:i.managed_agent_id,device_worker_id:i.device_worker_id,agent_kind:i.agent_kind,delivery_target:i.delivery_target??void 0,execution_config:i.execution_config??void 0,keying_config:i.keying_config,reactions_guidance:i.reactions_guidance,triggers:i.triggers},createFields:{triggers:h.triggers},triggerFields:e.jsx(Z,{organizationId:r,initialTriggers:i.triggers??[],onChange:o},JSON.stringify(i.triggers??[])),hideHeader:!0,hideCancel:!0,submitDisabled:!h.ready,onClose:u,onSuccess:u}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Automation not found. It may have been removed."});return t?e.jsxs("div",{className:"space-y-6",children:[e.jsx(Q,{resource:{kind:"automation",agentId:t,automationId:n},runId:s,onDone:u,children:({reviewMode:a,proposal:l})=>a==="active"?e.jsx(E,{before:l?.current??null,after:{...l?.current??{},...l?.proposedAfter??{}}}):a==="loading"?p:a==="error"?null:m}),e.jsx(C,{automationId:n})]}):e.jsxs("div",{className:"space-y-6",children:[m,e.jsx(C,{automationId:n})]})}function Re({owner:t,agentId:n,automationId:s,view:r,runId:u,onDone:h}){const{organizationId:d}=k(t),o=S(s,void 0,d),f=n??o.data?.automation?.managed_agent_id??null;return u||r==="definition"?e.jsx(be,{agentId:f,automationId:s,runId:u,organizationId:d,onDone:h}):e.jsx(Ae,{agentId:f,owner:t,automationId:s,organizationId:d})}export{ve as A,Re as a,Ee as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t,Y as o}from"./index-B2AmRqYh.js";const n=()=>t.jsx(o,{});export{n as component};
|