@lobu/runtime-server 20.0.0 → 20.0.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/catalogs/connectors.json +165 -15
- package/dist/component.json +1 -1
- package/dist/connectors/chat-automation-events.ts +33 -0
- package/dist/connectors/discord.ts +2 -0
- package/dist/connectors/gchat.ts +2 -0
- package/dist/connectors/google_drive.ts +210 -40
- package/dist/connectors/slack-automation-events.ts +0 -31
- package/dist/connectors/slack.ts +2 -2
- package/dist/connectors/teams.ts +2 -0
- package/dist/connectors/telegram.ts +2 -0
- package/dist/connectors/whatsapp.ts +2 -0
- package/dist/dependencies.bun.lock +4 -4
- package/dist/guest.bundle.js +13 -1
- package/dist/owletto/dist/apple-touch-icon.png +0 -0
- package/dist/owletto/dist/assets/{_-WVpKI9q9.js → _-BTmsEMQo.js} +2 -2
- package/dist/owletto/dist/assets/_-ea0K1u_g.js +1 -0
- package/dist/owletto/dist/assets/{_agentId-U2D1yGV_.js → _agentId-DON3NuNk.js} +1 -1
- package/dist/owletto/dist/assets/_agentId-qF8hi8Cf.js +1 -0
- package/dist/owletto/dist/assets/{_automationId-BggDSfkK.js → _automationId-Bprfhhg8.js} +1 -1
- package/dist/owletto/dist/assets/{_connectorKey._connectionId-BalfcgLi.js → _connectorKey._connectionId-75LMK1pB.js} +1 -1
- package/dist/owletto/dist/assets/{_connectorKey.index-IRfifXtO.js → _connectorKey.index-N0fJPz8N.js} +1 -1
- package/dist/owletto/dist/assets/{_conversationId-1GSbJquw.js → _conversationId-BY5q9MHG.js} +1 -1
- package/dist/owletto/dist/assets/{_deploymentId-DpMLDfMN.js → _deploymentId-DFh2d5Pm.js} +1 -1
- package/dist/owletto/dist/assets/_name-OY_X_Zm-.js +1 -0
- package/dist/owletto/dist/assets/{_owner-CZwj2Fc5.js → _owner-B92z-CVu.js} +1 -1
- package/dist/owletto/dist/assets/_skillKey-CeEE23_w.js +1 -0
- package/dist/owletto/dist/assets/{_slug-5SDJ_Zlr.js → _slug-CvHxtUEf.js} +1 -1
- package/dist/owletto/dist/assets/accept-invitation-CXSrxBJN.js +1 -0
- package/dist/owletto/dist/assets/activity-route-view-C9W2Ipni.js +1 -0
- package/dist/owletto/dist/assets/{agent-card-controls-Duh-6QNV.js → agent-card-controls-CLupkefQ.js} +1 -1
- package/dist/owletto/dist/assets/{agent-client-setup-list-u6MIKBDe.js → agent-client-setup-list-DgFv4h0W.js} +1 -1
- package/dist/owletto/dist/assets/{agent-connect-pages-22bJIutE.js → agent-connect-pages-DT8R_qnj.js} +1 -1
- package/dist/owletto/dist/assets/{agent-editor-form-DIo7SWp4.js → agent-editor-form-ayUg3Ws1.js} +1 -1
- package/dist/owletto/dist/assets/{agent-guardrails-route-Duv7Rpd9.js → agent-guardrails-route-D-b6CIt2.js} +1 -1
- package/dist/owletto/dist/assets/{agent-loading-shells-D6mLqg3d.js → agent-loading-shells-DjMpSoub.js} +1 -1
- package/dist/owletto/dist/assets/agent-permissions-matrix-BuGatiEq.js +1 -0
- package/dist/owletto/dist/assets/{agent-skill-context-DjPLOCBS.js → agent-skill-context-DKpIFmCh.js} +1 -1
- package/dist/owletto/dist/assets/{agent-skills-route-CdCVU8ZJ.js → agent-skills-route-DqIMttMK.js} +1 -1
- package/dist/owletto/dist/assets/{agent-subpage-shell-BfomD6m2.js → agent-subpage-shell-Bojgj1uq.js} +1 -1
- package/dist/owletto/dist/assets/{agent-thread-COEinkFo.js → agent-thread-R8Pego9t.js} +2 -2
- package/dist/owletto/dist/assets/agents-C9x76gSX.js +1 -0
- package/dist/owletto/dist/assets/{agents-workbench-BuIaYVFK.js → agents-workbench-BojDv6gX.js} +1 -1
- package/dist/owletto/dist/assets/{app._appId-BULz-FRp.js → app._appId-DNNB5FaI.js} +1 -1
- package/dist/owletto/dist/assets/{automation-detail-content-Ck6YhKpX.js → automation-detail-content-CzqrHc4P.js} +1 -1
- package/dist/owletto/dist/assets/automations-C9x76gSX.js +1 -0
- package/dist/owletto/dist/assets/{calendar-BZSx-Jno.js → calendar-VAaxHxss.js} +1 -1
- package/dist/owletto/dist/assets/{callback-DTbt2OS1.js → callback-0VB9tUCF.js} +1 -1
- package/dist/owletto/dist/assets/{card-BsWGRkun.js → card-HMQT7vU5.js} +1 -1
- package/dist/owletto/dist/assets/{claim-6BXg-jBt.js → claim-C2-YTMw-.js} +1 -1
- package/dist/owletto/dist/assets/{clients-CJI4gT-V.js → clients-C0I3V7XE.js} +1 -1
- package/dist/owletto/dist/assets/{code-editor-C104Bzj2.js → code-editor-hOZHdlxM.js} +1 -1
- package/dist/owletto/dist/assets/connect-DSr_gD8x.js +1 -0
- package/dist/owletto/dist/assets/connect._clientId-CTamwGrw.js +1 -0
- package/dist/owletto/dist/assets/{connected._clientId-L6cpG1ip.js → connected._clientId-BFuU4-8j.js} +1 -1
- package/dist/owletto/dist/assets/{connection-CqXJ7EAc.js → connection-De_2AD46.js} +1 -1
- package/dist/owletto/dist/assets/{connection-feed-detail-DgZF0nux.js → connection-feed-detail-Cbn85fG9.js} +1 -1
- package/dist/owletto/dist/assets/{connector-provenance-DyEHCwrM.js → connector-provenance-B17-ze5S.js} +1 -1
- package/dist/owletto/dist/assets/{connectors-zM9Yv-LM.js → connectors-KnNED_-4.js} +1 -1
- package/dist/owletto/dist/assets/{consent-CvL2QShm.js → consent-BOYb4pNu.js} +1 -1
- package/dist/owletto/dist/assets/{core.esm-DUExfZp5.js → core.esm-COW6Pfy6.js} +1 -1
- package/dist/owletto/dist/assets/{create-BiERXyJD.js → create-BFpUZ_mU.js} +1 -1
- package/dist/owletto/dist/assets/create-CblXKFGZ.js +1 -0
- package/dist/owletto/dist/assets/create-ChUbSYvl.js +1 -0
- package/dist/owletto/dist/assets/create-automation-form-CRenA7Ix.js +1 -0
- package/dist/owletto/dist/assets/{create._connectorKey-DWUsdgk7.js → create._connectorKey-D4dIDQIQ.js} +1 -1
- package/dist/owletto/dist/assets/{cronstrue-Bmga7mGH.js → cronstrue-BrlFh5Jy.js} +1 -1
- package/dist/owletto/dist/assets/deployments-DTFrUY7p.js +1 -0
- package/dist/owletto/dist/assets/{deployments-body-Cw9tB9-c.js → deployments-body-CXqfjLqj.js} +1 -1
- package/dist/owletto/dist/assets/{device-Dy4u9FiS.js → device-B0BBIdVx.js} +1 -1
- package/dist/owletto/dist/assets/{device-pin-tombstone-CmAxFq2z.js → device-pin-tombstone-BBYes4en.js} +1 -1
- package/dist/owletto/dist/assets/{device-rows-CVv5-okl.js → device-rows-E63OZ9Cp.js} +1 -1
- package/dist/owletto/dist/assets/{device._deviceId-DNKPNnE2.js → device._deviceId-JN0cUCGe.js} +1 -1
- package/dist/owletto/dist/assets/{entity-options-C5Mj2ZVk.js → entity-options-qan9-Ycm.js} +1 -1
- package/dist/owletto/dist/assets/{entity-page-BdTxty8B.js → entity-page-CozUOlVP.js} +1 -1
- package/dist/owletto/dist/assets/{entity-type-page-jhiER8wM.js → entity-type-page-xISySjVW.js} +1 -1
- package/dist/owletto/dist/assets/{events-feed-CEQj2uAu.js → events-feed-DmZ3Ig3X.js} +1 -1
- package/dist/owletto/dist/assets/{full-page-spinner-BSp5F0ls.js → full-page-spinner-Q_J5Wcop.js} +1 -1
- package/dist/owletto/dist/assets/guardrails-BB9iOxE3.js +1 -0
- package/dist/owletto/dist/assets/identity-DYbfG4hU.js +1 -0
- package/dist/owletto/dist/assets/index-7d9B918E.js +1 -0
- package/dist/owletto/dist/assets/{index-C2YGEKPo.js → index-BKZMzuMS.js} +7 -7
- package/dist/owletto/dist/assets/index-BsDA0XzK.js +1 -0
- package/dist/owletto/dist/assets/{index-1D5YJuZt.js → index-BwN9pHNs.js} +1 -1
- package/dist/owletto/dist/assets/{index-DFD8r981.js → index-BwVojwkg.js} +1 -1
- package/dist/owletto/dist/assets/index-C4Lz_gB-.js +1 -0
- package/dist/owletto/dist/assets/{index-BO8P4P_v.js → index-C78ucWDF.js} +1 -1
- package/dist/owletto/dist/assets/{index-D6nIYLM-.js → index-C9Dtjaoi.js} +1 -1
- package/dist/owletto/dist/assets/{index-CKWRiFJL.js → index-CGx4og7r.js} +1 -1
- package/dist/owletto/dist/assets/index-CO65Rkad.js +1 -0
- package/dist/owletto/dist/assets/index-CT_kxGkR.js +1 -0
- package/dist/owletto/dist/assets/index-ChcQMdod.css +1 -0
- package/dist/owletto/dist/assets/index-CrKgNtiq.js +1 -0
- package/dist/owletto/dist/assets/{index-CLQ-2wO3.js → index-DLZbFRSM.js} +1 -1
- package/dist/owletto/dist/assets/index-DUIbfL6x.js +1 -0
- package/dist/owletto/dist/assets/{index-DtRraJyI.js → index-DmB-3GhU.js} +1 -1
- package/dist/owletto/dist/assets/{index-CyT-Rwip.js → index-pKfsEvLt.js} +1 -1
- package/dist/owletto/dist/assets/{json-diff-gsOHOgl7.js → json-diff-1FNS_wGA.js} +1 -1
- package/dist/owletto/dist/assets/{list-skeleton-Cs18bNnk.js → list-skeleton-B6gjzr8t.js} +1 -1
- package/dist/owletto/dist/assets/login-S9EGV_EA.js +1 -0
- package/dist/owletto/dist/assets/{logout-DKUiKENJ.js → logout-BOXPSr57.js} +1 -1
- package/dist/owletto/dist/assets/{member-scope-gate-g7uB6GYE.js → member-scope-gate-yGr4lrGD.js} +1 -1
- package/dist/owletto/dist/assets/{memory-browse-page-BUwnO2o2.js → memory-browse-page-5n3MvqdS.js} +2 -2
- package/dist/owletto/dist/assets/{model-selector-DfsEq1db.js → model-selector-9ZRlR7Sa.js} +1 -1
- package/dist/owletto/dist/assets/models-LOhfJ0sb.js +1 -0
- package/dist/owletto/dist/assets/{new-BWw3u5jE.js → new-BeZJOJgR.js} +1 -1
- package/dist/owletto/dist/assets/{new-CW9MfqPX.js → new-D4wlbvAZ.js} +1 -1
- package/dist/owletto/dist/assets/{new-BSo83s7P.js → new-Dxn1qrmS.js} +1 -1
- package/dist/owletto/dist/assets/{oauth-workspace-access-DM3uXXPM.js → oauth-workspace-access-DoE-9F42.js} +1 -1
- package/dist/owletto/dist/assets/{organization-DJtG7bUJ.js → organization-BezNEJK7.js} +1 -1
- package/dist/owletto/dist/assets/{permissions-DcYSiYWQ.js → permissions-GkKtC6a5.js} +1 -1
- package/dist/owletto/dist/assets/{proposal-review-shell-CLrF2OFP.js → proposal-review-shell-Bk9D_9YN.js} +1 -1
- package/dist/owletto/dist/assets/{recent-BAuh77AP.js → recent-BVvscz1V.js} +1 -1
- package/dist/owletto/dist/assets/{renderer-BdAH16jE.js → renderer-CAyr3B3s.js} +2 -2
- package/dist/owletto/dist/assets/reset-password-atCMI5uQ.js +1 -0
- package/dist/owletto/dist/assets/{runs-tK0NlrM5.js → runs-CftQDTkq.js} +1 -1
- package/dist/owletto/dist/assets/runs-panel-BkRtr_C4.js +1 -0
- package/dist/owletto/dist/assets/{runs-table-BQACrHq5.js → runs-table-CWCl38L5.js} +1 -1
- package/dist/owletto/dist/assets/{schema-value-normalization-Dr5Osu6u.js → schema-value-normalization-C9Lm83-q.js} +1 -1
- package/dist/owletto/dist/assets/settings-BKMOjfYf.js +1 -0
- package/dist/owletto/dist/assets/{settings-D9ezdxp8.js → settings-CgTgofgd.js} +1 -1
- package/dist/owletto/dist/assets/skills-DWr8qR3U.js +1 -0
- package/dist/owletto/dist/assets/{switch-C1vQiKIo.js → switch-BOGbkDQb.js} +1 -1
- package/dist/owletto/dist/assets/{use-mention-search-CCqN_8wM.js → use-mention-search-C9ckRw0s.js} +2 -2
- package/dist/owletto/dist/favicon.ico +0 -0
- package/dist/owletto/dist/favicon.svg +5 -6
- package/dist/owletto/dist/fonts/dm-mono-latin-500-normal.woff2 +0 -0
- package/dist/owletto/dist/fonts/dm-sans-latin-400-normal.woff2 +0 -0
- package/dist/owletto/dist/fonts/dm-sans-latin-600-normal.woff2 +0 -0
- package/dist/owletto/dist/index.html +8 -8
- package/dist/owletto/dist/lobu-logo.svg +16 -0
- package/dist/server-main.bundle.mjs +2415 -1268
- package/npm-shrinkwrap.json +17 -17
- package/package.json +1 -1
- package/vendor/connector-sdk/dist/index.d.ts +1 -1
- package/vendor/connector-sdk/dist/logger.js +4 -1
- package/vendor/connector-sdk/dist/reaction-sdk.d.ts +9 -0
- package/vendor/connector-sdk/package.json +1 -1
- package/vendor/core/dist/contracts/tools/manage-automations.d.ts +16 -0
- package/vendor/core/dist/contracts/tools/manage-automations.js +12 -3
- package/vendor/core/dist/contracts/worker/protocol.d.ts +9 -0
- package/vendor/core/dist/contracts/worker/protocol.js +10 -1
- package/vendor/core/dist/logger.js +4 -2
- package/vendor/core/package.json +1 -1
- package/dist/owletto/dist/assets/_-BjTOSrPW.js +0 -1
- package/dist/owletto/dist/assets/_agentId-E5FuvQ_W.js +0 -1
- package/dist/owletto/dist/assets/_name-Ca5sRv2h.js +0 -1
- package/dist/owletto/dist/assets/_skillKey-BnDO8aEk.js +0 -1
- package/dist/owletto/dist/assets/accept-invitation-tMqF2W59.js +0 -1
- package/dist/owletto/dist/assets/activity-route-view-DSJj0TBg.js +0 -1
- package/dist/owletto/dist/assets/agent-permissions-matrix-QvA6xL8Q.js +0 -1
- package/dist/owletto/dist/assets/agents-DztpCplG.js +0 -1
- package/dist/owletto/dist/assets/automations-DztpCplG.js +0 -1
- package/dist/owletto/dist/assets/connect-9tegWawc.js +0 -1
- package/dist/owletto/dist/assets/connect._clientId-Dh6e0n6A.js +0 -1
- package/dist/owletto/dist/assets/create-BL_WcDoF.js +0 -1
- package/dist/owletto/dist/assets/create-Dyz5QbON.js +0 -1
- package/dist/owletto/dist/assets/create-automation-form-DCYFtK4q.js +0 -1
- package/dist/owletto/dist/assets/deployments-h8jIWEVy.js +0 -1
- package/dist/owletto/dist/assets/guardrails-DrOhJHr5.js +0 -1
- package/dist/owletto/dist/assets/identity-BTE8ZlL9.js +0 -1
- package/dist/owletto/dist/assets/index-Be4XiWxU.js +0 -1
- package/dist/owletto/dist/assets/index-CPqabIYs.css +0 -1
- package/dist/owletto/dist/assets/index-CS1UPepo.js +0 -1
- package/dist/owletto/dist/assets/index-DGinfBZr.js +0 -1
- package/dist/owletto/dist/assets/index-DJs1EEbu.js +0 -1
- package/dist/owletto/dist/assets/index-DZb_utnT.js +0 -1
- package/dist/owletto/dist/assets/index-RH7aiqHs.js +0 -1
- package/dist/owletto/dist/assets/index-xwlLZWva.js +0 -1
- package/dist/owletto/dist/assets/login-B3RTCs3p.js +0 -1
- package/dist/owletto/dist/assets/models-CZZt4VcZ.js +0 -1
- package/dist/owletto/dist/assets/reset-password-DjgDJAYG.js +0 -1
- package/dist/owletto/dist/assets/runs-panel-Dqq-0G9H.js +0 -1
- package/dist/owletto/dist/assets/settings-DZifZxa5.js +0 -1
- package/dist/owletto/dist/assets/skills-CNtoLPU_.js +0 -1
- package/dist/owletto/dist/fonts/geist-pixel-square.woff2 +0 -0
- package/dist/owletto/dist/fonts/inter-latin-400-normal.woff2 +0 -0
- package/dist/owletto/dist/fonts/inter-latin-500-normal.woff2 +0 -0
- package/dist/owletto/dist/fonts/inter-latin-600-normal.woff2 +0 -0
- package/dist/owletto/dist/fonts/jizBRFtNs2ka5fXjeivQ4LroWlx-6zUTjnTLgNs.woff2 +0 -0
- package/dist/owletto/dist/fonts/jizBRFtNs2ka5fXjeivQ4LroWlx-6zsTjnTLgNuZ5w.woff2 +0 -0
- package/dist/owletto/dist/fonts/jizHRFtNs2ka5fXjeivQ4LroWlx-6zAjgn7Motmp5r61.woff2 +0 -0
- package/dist/owletto/dist/fonts/jizHRFtNs2ka5fXjeivQ4LroWlx-6zAjjH7Motmp5g.woff2 +0 -0
- package/dist/owletto/dist/fonts/tDbV2o-flEEny0FZhsfKu5WU4xD0OwGtT0rU3BE.woff2 +0 -0
- package/dist/owletto/dist/fonts/tDbV2o-flEEny0FZhsfKu5WU4xD1OwGtT0rU3BE.woff2 +0 -0
- package/dist/owletto/dist/fonts/tDbV2o-flEEny0FZhsfKu5WU4xD2OwGtT0rU3BE.woff2 +0 -0
- package/dist/owletto/dist/fonts/tDbV2o-flEEny0FZhsfKu5WU4xD4OwGtT0rU3BE.woff2 +0 -0
- package/dist/owletto/dist/fonts/tDbV2o-flEEny0FZhsfKu5WU4xD7OwGtT0rU.woff2 +0 -0
- package/dist/owletto/dist/fonts/tDbV2o-flEEny0FZhsfKu5WU4xD_OwGtT0rU3BE.woff2 +0 -0
- package/dist/owletto/dist/fonts/tDbX2o-flEEny0FZhsfKu5WU4xD-Cw2nSGjW7BDEAQ.woff2 +0 -0
- package/dist/owletto/dist/fonts/tDbX2o-flEEny0FZhsfKu5WU4xD-Cw6nSGjW7BDEAQ.woff2 +0 -0
- package/dist/owletto/dist/fonts/tDbX2o-flEEny0FZhsfKu5WU4xD-CwCnSGjW7BDEAQ.woff2 +0 -0
- package/dist/owletto/dist/fonts/tDbX2o-flEEny0FZhsfKu5WU4xD-CwOnSGjW7BA.woff2 +0 -0
- package/dist/owletto/dist/fonts/tDbX2o-flEEny0FZhsfKu5WU4xD-CwenSGjW7BDEAQ.woff2 +0 -0
- package/dist/owletto/dist/fonts/tDbX2o-flEEny0FZhsfKu5WU4xD-CwynSGjW7BDEAQ.woff2 +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{am as v,r as a,j as e,L as h,an as j,ag as y,ao as N}from"./index-BKZMzuMS.js";import{C as k,a as C,b as S,c as L}from"./card-HMQT7vU5.js";function R(){const{token:n,error:x}=v.useSearch(),[o,p]=a.useState(""),[i,f]=a.useState(""),[d,s]=a.useState(null),[l,c]=a.useState(!1),[u,g]=a.useState(!1),w=async t=>{if(t.preventDefault(),!n){s("This reset link is invalid or expired.");return}if(o.length<8){s("Password must be at least 8 characters.");return}if(o!==i){s("Passwords do not match.");return}c(!0),s(null);try{const r=await j(`${y}/api/auth/reset-password`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({token:n,newPassword:o})});if(!r.ok)throw await N(r);g(!0)}catch(r){s(r instanceof Error?r.message:"Failed to reset password")}finally{c(!1)}},b=!n||x==="INVALID_TOKEN",m={callbackUrl:void 0,mode:void 0,error:void 0,errorDescription:void 0,loginHint:void 0,invitationOrg:void 0,intent:void 0};return e.jsx("div",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center",children:e.jsxs("div",{className:"w-full max-w-md p-8",children:[e.jsx("img",{src:"/lobu-logo.svg",alt:"Lobu",className:"mx-auto mb-6 h-8 w-auto"}),e.jsxs(k,{children:[e.jsx(C,{children:e.jsx(S,{asChild:!0,children:e.jsx("h1",{className:"text-center text-2xl",children:"Reset your password"})})}),e.jsx(L,{children:b&&!u?e.jsxs("div",{className:"mt-6 space-y-4 text-center",children:[e.jsx("p",{className:"text-sm text-destructive",children:"This reset link is invalid or expired."}),e.jsx(h,{to:"/auth/login",search:m,className:"text-sm text-primary hover:underline",children:"Back to sign in"})]}):u?e.jsxs("div",{className:"mt-6 space-y-4 text-center",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your password has been reset successfully."}),e.jsx(h,{to:"/auth/login",search:m,className:"text-sm text-primary hover:underline",children:"Continue to sign in"})]}):e.jsxs("form",{onSubmit:w,className:"mt-6 space-y-4",children:[d&&e.jsx("div",{className:"p-3 text-sm text-destructive bg-destructive/10 rounded-lg",children:d}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"new-password",className:"block text-sm font-medium",children:"New password"}),e.jsx("input",{id:"new-password",type:"password",value:o,onChange:t=>p(t.target.value),minLength:8,required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"confirm-password",className:"block text-sm font-medium",children:"Confirm new password"}),e.jsx("input",{id:"confirm-password",type:"password",value:i,onChange:t=>f(t.target.value),minLength:8,required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsx("button",{type:"submit",disabled:l,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:l?"Resetting password...":"Reset password"})]})})]})]})})}export{R as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dc as s,cE as d,fq as c,cF as l,an as f,fr as g}from"./index-
|
|
1
|
+
import{dc as s,cE as d,fq as c,cF as l,an as f,fr as g}from"./index-BKZMzuMS.js";const y=30,_=new Set(["running","pending","claimed"]);function I(n){return"connectionId"in n?["connection",n.connectionId]:"deviceId"in n?["device",n.deviceId]:"connectorKey"in n?["connector",n.connectorKey]:["feed",n.feedId]}function m(n){return"connectionId"in n?{connection_ids:[n.connectionId]}:"deviceId"in n?{device_worker_id:n.deviceId}:"connectorKey"in n?{connector_key:n.connectorKey}:{feed_ids:[n.feedId]}}function v(n,t,i){return c({queryKey:["runs-infinite",i??null,n?I(n):null,t.runTypes??null,t.status??null],queryFn:async({pageParam:e})=>{const a=e;return l("manage_operations",{action:"list_runs",...m(n),...t.runTypes&&t.runTypes.length>0?{run_types:t.runTypes}:{},...t.status?{status:t.status}:{},...a?{before_id:a.before_id,before_created_at:a.before_created_at}:{},limit:y},i?{slug:i}:void 0)},initialPageParam:null,getNextPageParam:e=>{if(!e.has_more)return;const a=e.runs[e.runs.length-1];if(a)return{before_id:a.id,before_created_at:a.created_at}},refetchInterval:e=>(e.state.data?.pages??[]).some(o=>o.runs.some(u=>_.has(u.status)))?5e3:!1,enabled:!!n,staleTime:15e3})}function p(n,t){return n.kind==="agent"?n.agentId?`/${n.agentId}/config/pending/${t}`:null:n.agentId&&n.automationId?`/${n.agentId}/automations/${n.automationId}/pending/${t}`:null}function T(n,t){const{slug:i}=s(),e=t!=null?p(n,t):null,a=n.kind==="agent"?["agent",n.agentId]:["automation",n.agentId,n.automationId];return d({queryKey:["pending-proposal",i,...a,t],queryFn:async()=>{const r=await f(g(i,e),{credentials:"include"});if(r.status===404)return{status:"gone"};if(!r.ok)throw new Error(`Failed to fetch pending proposal: ${r.status}`);return{status:"pending",proposal:await r.json()}},enabled:!!i&&!!e&&!!t,staleTime:0,retry:!1})}export{v as a,T as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,aj as h,bY as k,bZ as T,b_ as w,b$ as A,c0 as C,S as l,r,s as I}from"./index-BKZMzuMS.js";import{a as P}from"./runs-CftQDTkq.js";import{R as E}from"./runs-table-CWCl38L5.js";const f=[{value:"all",label:"All"},{value:"sync",label:"Sync",runTypes:["sync"]},{value:"action",label:"Action",runTypes:["action"]},{value:"auth",label:"Auth",runTypes:["auth"]}];function F(s){return f.find(t=>t.value===s)?.runTypes}const B=[{value:"all",label:"All statuses"},{value:"running",label:"Running"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"},{value:"pending",label:"Pending"}];function L({bucket:s,status:t,onBucketChange:a,onStatusChange:u}){return e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"inline-flex rounded-md border bg-muted/30 p-0.5 text-sm",children:f.map(n=>e.jsx("button",{type:"button",onClick:()=>a(n.value),className:h("rounded px-3 py-1 transition-colors",s===n.value?"bg-background text-foreground ":"text-muted-foreground hover:text-foreground"),children:n.label},n.value))}),e.jsxs(k,{value:t,onValueChange:u,children:[e.jsx(T,{className:"w-[150px]",children:e.jsx(w,{})}),e.jsx(A,{children:B.map(n=>e.jsx(C,{value:n.value,children:n.label},n.value))})]})]})}function M({labels:s,className:t}){return e.jsx("div",{className:h("inline-flex rounded-md border bg-muted/30 p-0.5 text-sm",t),children:s.map((a,u)=>e.jsx("span",{className:u===0?"rounded bg-background px-3 py-1 text-foreground ":"px-3 py-1 text-muted-foreground",children:a},a))})}function v({rows:s=6}){return e.jsxs("div",{className:"rounded-lg border",role:"status","aria-label":"Loading runs",children:[e.jsx("div",{className:"border-b px-3 py-2",children:e.jsx(l,{className:"h-3 w-1/4"})}),e.jsx("div",{className:"divide-y",children:Array.from({length:s}).map((t,a)=>e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5",children:[e.jsx(l,{className:"h-3.5 w-3.5 rounded-full shrink-0"}),e.jsx(l,{className:"h-3 w-20"}),e.jsx(l,{className:"h-3 w-16"}),e.jsx(l,{className:"ml-auto h-3 w-12 shrink-0"}),e.jsx(l,{className:"h-7 w-7 rounded-md shrink-0"})]},a))})]})}function K({rows:s=6}){return e.jsxs("div",{className:"space-y-4",role:"status","aria-label":"Loading runs",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(M,{labels:["All","Sync","Action","Auth"]}),e.jsx("div",{className:"h-9 w-[150px] rounded-md border border-input"})]}),e.jsx(v,{rows:s})]})}function V({scope:s,ownerSlug:t}){const[a,u]=r.useState("all"),[n,b]=r.useState("all"),j=r.useMemo(()=>({runTypes:F(a),status:n==="all"?void 0:n}),[a,n]),{data:i,isLoading:N,isError:y,hasNextPage:o,isFetchingNextPage:d,fetchNextPage:x}=P(s,j,t),m=r.useMemo(()=>i?.pages.flatMap(c=>c.runs)??[],[i]),S={runType:a==="all",feed:!0,connection:"deviceId"in s||"connectorKey"in s},p=r.useRef(null);return r.useEffect(()=>{const c=p.current;if(!c||!o)return;const g=new IntersectionObserver(R=>{R[0]?.isIntersecting&&!d&&x()},{rootMargin:"200px"});return g.observe(c),()=>g.disconnect()},[o,d,x]),e.jsxs("div",{className:"space-y-3",children:[e.jsx(L,{bucket:a,status:n,onBucketChange:u,onStatusChange:b}),N?e.jsx(v,{}):y?e.jsx("p",{className:"rounded-lg border bg-destructive/5 px-3 py-6 text-center text-xs text-destructive",children:"Failed to load runs."}):m.length===0?e.jsx("p",{className:"rounded-lg border bg-muted/20 px-3 py-6 text-center text-xs text-muted-foreground",children:"No runs yet."}):e.jsxs(e.Fragment,{children:[e.jsx(E,{runs:m,ownerSlug:t,columns:S}),e.jsx("div",{ref:p,className:"h-1"}),d&&e.jsx("div",{className:"flex justify-center py-3",children:e.jsx(I,{size:"lg",className:"text-muted-foreground"})})]})]})}export{V as R,K as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,aj as f,J as v,fj as k,S as g,fk as w,n as C,fl as F,bm as P,fm as D,B as S,L as j,P as z,x as T,dU as O,aR as $,cM as U,dl as H,dm as q,dn as M,fn as J,fo as W,cy as K,cz as G,cA as N,cB as u,cC as X,cD as x,eW as Y,af as Q,fp as Z,cs as ee,az as te,s as se,bJ as ne,r as L,ci as A,cj as R,ck as E}from"./index-C2YGEKPo.js";import{c as ae}from"./connection-label-BobuYiAG.js";const re={amber:"bg-amber-500",muted:"bg-muted-foreground/40",destructive:"bg-destructive"};function B({tone:t}){return e.jsx("span",{"aria-hidden":t===null,className:f("h-1.5 w-1.5 shrink-0 rounded-full",t===null?"bg-transparent":re[t])})}function I(t){switch(t.attention){case"needs_auth":return"Needs authentication";case"setup_required":return t.attention_reason?.trim()||"Setup required";case"paused":return"Paused";case"misconfigured":return"Configuration error";case"device_offline":return`Waiting for ${t.device_label||t.device_platform||"device"}`;case"last_attempt_failed":{const n=Number(t.consecutive_failures??0);return t.last_error?.trim()||(n>0?`${n} consecutive sync ${n===1?"failure":"failures"}`:"Last sync failed")}case"overdue":return"Scheduled run overdue";case"no_trigger":return"No schedule — this feed only runs when you sync it";case"never_run":return t.execution_mode==="scheduled"?"Scheduled, not run yet":"Not synced yet";default:return null}}function ie(t){switch(t.attention){case"last_attempt_failed":case"misconfigured":return"destructive";case"needs_auth":case"setup_required":case"device_offline":case"overdue":case"no_trigger":case"never_run":return t.attention==="never_run"&&t.execution_mode!=="scheduled"?"muted":"amber";case"paused":return"muted";default:return t.status==="active"?null:t.status==="error"?"destructive":"muted"}}function ce(t){return Object.keys(t?.feeds_schema??{}).length>0}const y=new Set(["error","revoked","pending_auth"]),oe={pending_auth:"needs reconnect",revoked:"revoked",error:"error",paused:"paused",active:"active"};function Ne({connections:t,connectorDef:n,organizationId:r,ownerSlug:c,connectorKey:s,isLoading:a=!1}){const d=v(),i=t.filter(m=>y.has(m.status)||!!n&&k(n)&&!m.device_worker_id).length;if(a)return e.jsx(g,{className:"h-16 w-full rounded-lg"});const l=t.length;return e.jsx(w,{title:"Connections",summary:`${l} ${l===1?"connection":"connections"}${i?` · ${i} ${i===1?"needs":"need"} attention`:""}`,onOpen:()=>d?.open({href:"",title:"Connections",connectorPanel:{section:"connections",connectorKey:s,organizationId:r,ownerSlug:c}})})}function ve({connections:t,connectorDef:n,ownerSlug:r,connectorKey:c}){if(t.length===0)return null;const s=[...t].sort((a,d)=>{const i=y.has(a.status)?0:1,l=y.has(d.status)?0:1;return i-l});return e.jsx("ul",{className:"flex flex-col gap-2",children:s.map(a=>{const d=ae({...a,connector_name:a.connector_name??n?.name??null}),i=!!n&&k(n)&&!a.device_worker_id,l=a.status==="error"||a.status==="revoked"||a.status==="pending_auth";return e.jsx("li",{children:e.jsxs(j,{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:r,connectorKey:c,connectionId:String(a.id)},search:{},className:"flex items-center justify-between gap-3 rounded-lg border border-border px-3 py-2.5 transition-colors hover:bg-accent/50",children:[e.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[e.jsx(B,{tone:a.status==="active"?null:a.status==="error"||a.status==="revoked"?"destructive":"amber"}),e.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:d})]}),e.jsxs("span",{className:"flex min-w-0 max-w-1/2 shrink-0 items-center gap-2",children:[i?e.jsx("span",{className:"shrink-0 text-xs text-amber-600",children:"Needs a device"}):l?e.jsx("span",{className:"min-w-0 truncate text-xs text-muted-foreground",children:a.error_message?.trim()||oe[a.status]||a.status}):null,e.jsx(O,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted-foreground"})]})]})},a.id)})})}function ke({connection:t,ownerSlug:n,connectorKey:r,connectorDef:c}){const{data:s=[],isLoading:a}=C(t.id),d=ce(c),i=t.facets?.chat??!1,{inspectFeed:l}=F(),m=c?.feeds_schema??{},p={owner:n,connectorKey:r,connectionId:String(t.id)};return a?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(g,{className:"h-12 w-full rounded-lg"}),e.jsx(g,{className:"h-12 w-full rounded-lg"})]}):s.length===0?e.jsx(P,{icon:D,title:i?"No channels":"No feeds",description:d?i?"Bind a channel to route conversations to this connection.":"Add a feed to start collecting data from this connection.":i?"This chat connection has no bound channels yet.":"This connector doesn't provide any feeds.",children:d?e.jsx(S,{asChild:!0,size:"sm",children:e.jsxs(j,{to:"/$owner/connectors/$connectorKey/$connectionId",params:p,search:{addFeed:!0},children:[e.jsx(z,{className:"h-3.5 w-3.5"}),i?"Add channel":"Add feed"]})}):null}):e.jsx("ul",{className:"flex flex-col gap-2",children:s.map(o=>{const h=o.display_name?.trim()||o.feed_key,b=I(o),_=m[o.feed_key],V=`/${n}/connectors/${r}/${t.id}?feedId=${o.id}`;return e.jsx("li",{children:e.jsxs("button",{type:"button",onClick:()=>{_&&l(o.feed_key,_,V)},className:"flex w-full items-center justify-between gap-3 rounded-lg border border-border px-3 py-2.5 text-left transition-colors hover:bg-accent/50",children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(B,{tone:ie(o)}),e.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:h})]}),e.jsx("span",{className:o.attention==="last_attempt_failed"||o.attention==="misconfigured"?"max-w-[50%] shrink-0 text-right text-xs text-destructive":o.attention&&o.attention!=="healthy"?"max-w-[50%] shrink-0 text-right text-xs text-amber-600 dark:text-amber-400":"shrink-0 text-xs text-muted-foreground",title:b??void 0,children:b??(o.store==="channel_messages"?"chat channel":o.operations.includes("read")&&o.operations.includes("sync")?"synced + live":o.operations.includes("read")?"live":o.last_sync_at?`synced ${T(o.last_sync_at)}`:"not synced yet")})]})},o.id)})})}function we({connection:t,ownerSlug:n,title:r}){const c=v(),{data:s=[],isLoading:a,isError:d}=C(t.id),i=s.filter(h=>["needs_auth","setup_required","misconfigured","last_attempt_failed","device_offline","overdue"].includes(h.attention??"")),l=s.filter(h=>h.status==="paused").length,m=a?t.feed_count:s.length,p=t.facets?.chat?"channels":"feeds",o=a?`Loading ${p}…`:d?`Could not load ${p} — open to retry`:`${m} ${p}${i.length?` · ${i.length} need attention`:""}${l?` · ${l} paused`:""}`;return e.jsxs("div",{className:"space-y-2",children:[e.jsx(w,{title:r,summary:o,onOpen:()=>c?.open({href:"",title:t.facets?.chat?"Channels":"Feeds",connectorPanel:{section:"feeds",connectorKey:t.connector_key,connectionId:t.id,organizationId:t.organization_id,ownerSlug:n}})}),i.length>0&&e.jsxs("ul",{className:"space-y-1 text-xs text-destructive",children:[i.slice(0,3).map(h=>e.jsxs("li",{children:[h.display_name||h.feed_key,": ",I(h)]},h.id)),i.length>3&&e.jsxs("li",{children:[i.length-3," more sources need attention."]})]})]})}const le=$("inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium transition-colors",{variants:{status:{active:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",paused:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400",error:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400",pending:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",rejected:"bg-gray-100 text-gray-700 dark:bg-gray-900/30 dark:text-gray-400",default:"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300"}},defaultVariants:{status:"default"}}),de=$("h-1.5 w-1.5 rounded-full",{variants:{status:{active:"bg-green-500",paused:"bg-yellow-500",error:"bg-red-500",pending:"bg-blue-500",rejected:"bg-gray-500",default:"bg-gray-500"}},defaultVariants:{status:"default"}});function ue({className:t,status:n,showDot:r=!0,children:c,...s}){return e.jsxs("span",{className:f(le({status:n}),t),...s,children:[r&&e.jsx("span",{className:de({status:n})}),c]})}function xe(t,n){switch(n.kind){case"connection":return W(t,n.id);case"feed":return J(t,n.id);case"run":return{to:"/$owner/events",params:{owner:t},search:{run_ids:String(n.id)}}}}function he({ownerSlug:t,scope:n,variant:r="outline",iconOnly:c=!1,label:s,className:a,title:d}){const i=xe(t,n),l=d??s??"View in memory",m=e.jsx(S,{asChild:!0,variant:r,size:c?"icon":"sm",className:f(c&&"h-7 w-7",a),children:e.jsxs(j,{to:i.to,params:i.params,search:i.search,children:[e.jsx(U,{className:f("h-3.5 w-3.5",!c&&"mr-1.5")}),!c&&(s??"View in memory")]})});return c?e.jsxs(H,{children:[e.jsx(q,{asChild:!0,children:m}),e.jsx(M,{children:l})]}):m}const me=new Set(["error","failed","revoked"]);function pe(t){return t==="active"?"active":t==="paused"?"paused":t==="pending"||t==="pending_auth"?"pending":me.has(t)?"error":"default"}function fe({status:t}){return t==="completed"?e.jsx(ee,{className:"h-3.5 w-3.5 text-green-500"}):t==="failed"?e.jsx(te,{className:"h-3.5 w-3.5 text-destructive"}):t==="running"?e.jsx(se,{className:"text-blue-500"}):e.jsx(ne,{className:"h-3.5 w-3.5 text-muted-foreground"})}function ge({error:t}){const[n,r]=L.useState(!1);return t.length>80?e.jsxs(A,{open:n,onOpenChange:r,children:[e.jsx(R,{asChild:!0,children:e.jsx("button",{type:"button",className:"text-left text-destructive truncate max-w-[200px] hover:underline",children:t})}),e.jsx(E,{className:"w-96 max-h-64 overflow-auto",children:e.jsx("pre",{className:"text-xs whitespace-pre-wrap break-words text-destructive",children:t})})]}):e.jsx("span",{className:"text-destructive",children:t})}function ye({checkpoint:t}){const[n,r]=L.useState(!1);return e.jsxs(A,{open:n,onOpenChange:r,children:[e.jsx(R,{asChild:!0,children:e.jsx("button",{type:"button",className:"text-left text-muted-foreground hover:underline",children:"view"})}),e.jsx(E,{className:"w-80 max-h-64 overflow-auto",children:e.jsx("pre",{className:"text-xs whitespace-pre-wrap break-words",children:JSON.stringify(t,null,2)})})]})}function je(t){return t.feed_display_name??t.feed_key??"—"}function Ce({runs:t,ownerSlug:n,columns:r={}}){const c=t.some(s=>s.checkpoint);return e.jsx("div",{className:"rounded-lg border",children:e.jsxs(K,{children:[e.jsx(G,{children:e.jsxs(N,{children:[e.jsx(u,{className:"text-xs py-1.5 px-3 w-8"}),e.jsx(u,{className:"text-xs py-1.5 px-3",children:"When"}),r.runType&&e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Type"}),r.connection&&e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Connection"}),r.feed&&e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Feed"}),e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Status"}),e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Items"}),e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Duration"}),e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Version"}),c&&e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Checkpoint"}),e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Error"}),e.jsx(u,{className:"text-xs py-1.5 px-3 w-8"})]})}),e.jsx(X,{children:t.map(s=>{const a=s.completed_at?Math.round((new Date(s.completed_at).getTime()-new Date(s.created_at).getTime())/1e3):null;return e.jsxs(N,{children:[e.jsx(x,{className:"py-1.5 px-3",children:e.jsx(fe,{status:s.status})}),e.jsx(x,{className:"py-1.5 px-3 text-xs text-muted-foreground",title:Y(s.created_at),children:T(s.created_at)}),r.runType&&e.jsx(x,{className:"py-1.5 px-3 text-xs",children:e.jsx(Q,{variant:"secondary",className:"font-mono text-[10px]",children:s.run_type??"—"})}),r.connection&&e.jsx(x,{className:"py-1.5 px-3 text-xs text-muted-foreground",children:s.connection_display_name??"—"}),r.feed&&e.jsx(x,{className:"py-1.5 px-3 text-xs text-muted-foreground",children:je(s)}),e.jsx(x,{className:"py-1.5 px-3 text-xs",children:e.jsx(ue,{status:pe(s.status),children:s.status})}),e.jsx(x,{className:"py-1.5 px-3 text-xs font-mono text-muted-foreground",children:s.items_collected??"—"}),e.jsx(x,{className:"py-1.5 px-3 text-xs text-muted-foreground",children:a!=null?Z(a):"—"}),e.jsx(x,{className:"py-1.5 px-3 text-xs font-mono text-muted-foreground",children:s.connector_version??"—"}),c&&e.jsx(x,{className:"py-1.5 px-3 text-xs",children:s.checkpoint?e.jsx(ye,{checkpoint:s.checkpoint}):e.jsx("span",{className:"text-muted-foreground",children:"—"})}),e.jsx(x,{className:"py-1.5 px-3 text-xs",children:s.error_message?e.jsx(ge,{error:s.error_message}):""}),e.jsx(x,{className:"py-1.5 px-3 text-right",children:e.jsx(he,{ownerSlug:n,scope:{kind:"run",id:s.id},variant:"ghost",iconOnly:!0,title:"View events from this run"})})]},s.id)})})]})})}export{ve as C,Ce as R,ue as S,he as V,Ne as a,ke as b,ce as c,we as d,I as f,pe as g};
|
|
1
|
+
import{j as e,aj as f,J as v,fj as k,S as g,fk as w,n as C,fl as F,bm as P,fm as D,B as S,L as j,P as z,x as T,dU as O,aR as $,cM as U,dl as H,dm as q,dn as M,fn as J,fo as W,cy as K,cz as G,cA as N,cB as u,cC as X,cD as x,eW as Y,af as Q,fp as Z,cs as ee,az as te,s as se,bJ as ne,r as L,ci as A,cj as R,ck as E}from"./index-BKZMzuMS.js";import{c as ae}from"./connection-label-BobuYiAG.js";const re={amber:"bg-amber-500",muted:"bg-muted-foreground/40",destructive:"bg-destructive"};function B({tone:t}){return e.jsx("span",{"aria-hidden":t===null,className:f("h-1.5 w-1.5 shrink-0 rounded-full",t===null?"bg-transparent":re[t])})}function I(t){switch(t.attention){case"needs_auth":return"Needs authentication";case"setup_required":return t.attention_reason?.trim()||"Setup required";case"paused":return"Paused";case"misconfigured":return"Configuration error";case"device_offline":return`Waiting for ${t.device_label||t.device_platform||"device"}`;case"last_attempt_failed":{const n=Number(t.consecutive_failures??0);return t.last_error?.trim()||(n>0?`${n} consecutive sync ${n===1?"failure":"failures"}`:"Last sync failed")}case"overdue":return"Scheduled run overdue";case"no_trigger":return"No schedule — this feed only runs when you sync it";case"never_run":return t.execution_mode==="scheduled"?"Scheduled, not run yet":"Not synced yet";default:return null}}function ie(t){switch(t.attention){case"last_attempt_failed":case"misconfigured":return"destructive";case"needs_auth":case"setup_required":case"device_offline":case"overdue":case"no_trigger":case"never_run":return t.attention==="never_run"&&t.execution_mode!=="scheduled"?"muted":"amber";case"paused":return"muted";default:return t.status==="active"?null:t.status==="error"?"destructive":"muted"}}function ce(t){return Object.keys(t?.feeds_schema??{}).length>0}const y=new Set(["error","revoked","pending_auth"]),oe={pending_auth:"needs reconnect",revoked:"revoked",error:"error",paused:"paused",active:"active"};function Ne({connections:t,connectorDef:n,organizationId:r,ownerSlug:c,connectorKey:s,isLoading:a=!1}){const d=v(),i=t.filter(m=>y.has(m.status)||!!n&&k(n)&&!m.device_worker_id).length;if(a)return e.jsx(g,{className:"h-16 w-full rounded-lg"});const l=t.length;return e.jsx(w,{title:"Connections",summary:`${l} ${l===1?"connection":"connections"}${i?` · ${i} ${i===1?"needs":"need"} attention`:""}`,onOpen:()=>d?.open({href:"",title:"Connections",connectorPanel:{section:"connections",connectorKey:s,organizationId:r,ownerSlug:c}})})}function ve({connections:t,connectorDef:n,ownerSlug:r,connectorKey:c}){if(t.length===0)return null;const s=[...t].sort((a,d)=>{const i=y.has(a.status)?0:1,l=y.has(d.status)?0:1;return i-l});return e.jsx("ul",{className:"flex flex-col gap-2",children:s.map(a=>{const d=ae({...a,connector_name:a.connector_name??n?.name??null}),i=!!n&&k(n)&&!a.device_worker_id,l=a.status==="error"||a.status==="revoked"||a.status==="pending_auth";return e.jsx("li",{children:e.jsxs(j,{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:r,connectorKey:c,connectionId:String(a.id)},search:{},className:"flex items-center justify-between gap-3 rounded-lg border border-border px-3 py-2.5 transition-colors hover:bg-accent/50",children:[e.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[e.jsx(B,{tone:a.status==="active"?null:a.status==="error"||a.status==="revoked"?"destructive":"amber"}),e.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:d})]}),e.jsxs("span",{className:"flex min-w-0 max-w-1/2 shrink-0 items-center gap-2",children:[i?e.jsx("span",{className:"shrink-0 text-xs text-amber-600",children:"Needs a device"}):l?e.jsx("span",{className:"min-w-0 truncate text-xs text-muted-foreground",children:a.error_message?.trim()||oe[a.status]||a.status}):null,e.jsx(O,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted-foreground"})]})]})},a.id)})})}function ke({connection:t,ownerSlug:n,connectorKey:r,connectorDef:c}){const{data:s=[],isLoading:a}=C(t.id),d=ce(c),i=t.facets?.chat??!1,{inspectFeed:l}=F(),m=c?.feeds_schema??{},p={owner:n,connectorKey:r,connectionId:String(t.id)};return a?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(g,{className:"h-12 w-full rounded-lg"}),e.jsx(g,{className:"h-12 w-full rounded-lg"})]}):s.length===0?e.jsx(P,{icon:D,title:i?"No channels":"No feeds",description:d?i?"Bind a channel to route conversations to this connection.":"Add a feed to start collecting data from this connection.":i?"This chat connection has no bound channels yet.":"This connector doesn't provide any feeds.",children:d?e.jsx(S,{asChild:!0,size:"sm",children:e.jsxs(j,{to:"/$owner/connectors/$connectorKey/$connectionId",params:p,search:{addFeed:!0},children:[e.jsx(z,{className:"h-3.5 w-3.5"}),i?"Add channel":"Add feed"]})}):null}):e.jsx("ul",{className:"flex flex-col gap-2",children:s.map(o=>{const h=o.display_name?.trim()||o.feed_key,b=I(o),_=m[o.feed_key],V=`/${n}/connectors/${r}/${t.id}?feedId=${o.id}`;return e.jsx("li",{children:e.jsxs("button",{type:"button",onClick:()=>{_&&l(o.feed_key,_,V)},className:"flex w-full items-center justify-between gap-3 rounded-lg border border-border px-3 py-2.5 text-left transition-colors hover:bg-accent/50",children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(B,{tone:ie(o)}),e.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:h})]}),e.jsx("span",{className:o.attention==="last_attempt_failed"||o.attention==="misconfigured"?"max-w-[50%] shrink-0 text-right text-xs text-destructive":o.attention&&o.attention!=="healthy"?"max-w-[50%] shrink-0 text-right text-xs text-amber-600 dark:text-amber-400":"shrink-0 text-xs text-muted-foreground",title:b??void 0,children:b??(o.store==="channel_messages"?"chat channel":o.operations.includes("read")&&o.operations.includes("sync")?"synced + live":o.operations.includes("read")?"live":o.last_sync_at?`synced ${T(o.last_sync_at)}`:"not synced yet")})]})},o.id)})})}function we({connection:t,ownerSlug:n,title:r}){const c=v(),{data:s=[],isLoading:a,isError:d}=C(t.id),i=s.filter(h=>["needs_auth","setup_required","misconfigured","last_attempt_failed","device_offline","overdue"].includes(h.attention??"")),l=s.filter(h=>h.status==="paused").length,m=a?t.feed_count:s.length,p=t.facets?.chat?"channels":"feeds",o=a?`Loading ${p}…`:d?`Could not load ${p} — open to retry`:`${m} ${p}${i.length?` · ${i.length} need attention`:""}${l?` · ${l} paused`:""}`;return e.jsxs("div",{className:"space-y-2",children:[e.jsx(w,{title:r,summary:o,onOpen:()=>c?.open({href:"",title:t.facets?.chat?"Channels":"Feeds",connectorPanel:{section:"feeds",connectorKey:t.connector_key,connectionId:t.id,organizationId:t.organization_id,ownerSlug:n}})}),i.length>0&&e.jsxs("ul",{className:"space-y-1 text-xs text-destructive",children:[i.slice(0,3).map(h=>e.jsxs("li",{children:[h.display_name||h.feed_key,": ",I(h)]},h.id)),i.length>3&&e.jsxs("li",{children:[i.length-3," more sources need attention."]})]})]})}const le=$("inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium transition-colors",{variants:{status:{active:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",paused:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400",error:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400",pending:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",rejected:"bg-gray-100 text-gray-700 dark:bg-gray-900/30 dark:text-gray-400",default:"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300"}},defaultVariants:{status:"default"}}),de=$("h-1.5 w-1.5 rounded-full",{variants:{status:{active:"bg-green-500",paused:"bg-yellow-500",error:"bg-red-500",pending:"bg-blue-500",rejected:"bg-gray-500",default:"bg-gray-500"}},defaultVariants:{status:"default"}});function ue({className:t,status:n,showDot:r=!0,children:c,...s}){return e.jsxs("span",{className:f(le({status:n}),t),...s,children:[r&&e.jsx("span",{className:de({status:n})}),c]})}function xe(t,n){switch(n.kind){case"connection":return W(t,n.id);case"feed":return J(t,n.id);case"run":return{to:"/$owner/events",params:{owner:t},search:{run_ids:String(n.id)}}}}function he({ownerSlug:t,scope:n,variant:r="outline",iconOnly:c=!1,label:s,className:a,title:d}){const i=xe(t,n),l=d??s??"View in memory",m=e.jsx(S,{asChild:!0,variant:r,size:c?"icon":"sm",className:f(c&&"h-7 w-7",a),children:e.jsxs(j,{to:i.to,params:i.params,search:i.search,children:[e.jsx(U,{className:f("h-3.5 w-3.5",!c&&"mr-1.5")}),!c&&(s??"View in memory")]})});return c?e.jsxs(H,{children:[e.jsx(q,{asChild:!0,children:m}),e.jsx(M,{children:l})]}):m}const me=new Set(["error","failed","revoked"]);function pe(t){return t==="active"?"active":t==="paused"?"paused":t==="pending"||t==="pending_auth"?"pending":me.has(t)?"error":"default"}function fe({status:t}){return t==="completed"?e.jsx(ee,{className:"h-3.5 w-3.5 text-green-500"}):t==="failed"?e.jsx(te,{className:"h-3.5 w-3.5 text-destructive"}):t==="running"?e.jsx(se,{className:"text-blue-500"}):e.jsx(ne,{className:"h-3.5 w-3.5 text-muted-foreground"})}function ge({error:t}){const[n,r]=L.useState(!1);return t.length>80?e.jsxs(A,{open:n,onOpenChange:r,children:[e.jsx(R,{asChild:!0,children:e.jsx("button",{type:"button",className:"text-left text-destructive truncate max-w-[200px] hover:underline",children:t})}),e.jsx(E,{className:"w-96 max-h-64 overflow-auto",children:e.jsx("pre",{className:"text-xs whitespace-pre-wrap break-words text-destructive",children:t})})]}):e.jsx("span",{className:"text-destructive",children:t})}function ye({checkpoint:t}){const[n,r]=L.useState(!1);return e.jsxs(A,{open:n,onOpenChange:r,children:[e.jsx(R,{asChild:!0,children:e.jsx("button",{type:"button",className:"text-left text-muted-foreground hover:underline",children:"view"})}),e.jsx(E,{className:"w-80 max-h-64 overflow-auto",children:e.jsx("pre",{className:"text-xs whitespace-pre-wrap break-words",children:JSON.stringify(t,null,2)})})]})}function je(t){return t.feed_display_name??t.feed_key??"—"}function Ce({runs:t,ownerSlug:n,columns:r={}}){const c=t.some(s=>s.checkpoint);return e.jsx("div",{className:"rounded-lg border",children:e.jsxs(K,{children:[e.jsx(G,{children:e.jsxs(N,{children:[e.jsx(u,{className:"text-xs py-1.5 px-3 w-8"}),e.jsx(u,{className:"text-xs py-1.5 px-3",children:"When"}),r.runType&&e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Type"}),r.connection&&e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Connection"}),r.feed&&e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Feed"}),e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Status"}),e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Items"}),e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Duration"}),e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Version"}),c&&e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Checkpoint"}),e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Error"}),e.jsx(u,{className:"text-xs py-1.5 px-3 w-8"})]})}),e.jsx(X,{children:t.map(s=>{const a=s.completed_at?Math.round((new Date(s.completed_at).getTime()-new Date(s.created_at).getTime())/1e3):null;return e.jsxs(N,{children:[e.jsx(x,{className:"py-1.5 px-3",children:e.jsx(fe,{status:s.status})}),e.jsx(x,{className:"py-1.5 px-3 text-xs text-muted-foreground",title:Y(s.created_at),children:T(s.created_at)}),r.runType&&e.jsx(x,{className:"py-1.5 px-3 text-xs",children:e.jsx(Q,{variant:"secondary",className:"font-mono text-[10px]",children:s.run_type??"—"})}),r.connection&&e.jsx(x,{className:"py-1.5 px-3 text-xs text-muted-foreground",children:s.connection_display_name??"—"}),r.feed&&e.jsx(x,{className:"py-1.5 px-3 text-xs text-muted-foreground",children:je(s)}),e.jsx(x,{className:"py-1.5 px-3 text-xs",children:e.jsx(ue,{status:pe(s.status),children:s.status})}),e.jsx(x,{className:"py-1.5 px-3 text-xs font-mono text-muted-foreground",children:s.items_collected??"—"}),e.jsx(x,{className:"py-1.5 px-3 text-xs text-muted-foreground",children:a!=null?Z(a):"—"}),e.jsx(x,{className:"py-1.5 px-3 text-xs font-mono text-muted-foreground",children:s.connector_version??"—"}),c&&e.jsx(x,{className:"py-1.5 px-3 text-xs",children:s.checkpoint?e.jsx(ye,{checkpoint:s.checkpoint}):e.jsx("span",{className:"text-muted-foreground",children:"—"})}),e.jsx(x,{className:"py-1.5 px-3 text-xs",children:s.error_message?e.jsx(ge,{error:s.error_message}):""}),e.jsx(x,{className:"py-1.5 px-3 text-right",children:e.jsx(he,{ownerSlug:n,scope:{kind:"run",id:s.id},variant:"ghost",iconOnly:!0,title:"View events from this run"})})]},s.id)})})]})})}export{ve as C,Ce as R,ue as S,he as V,Ne as a,ke as b,ce as c,we as d,I as f,pe as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as O,j as t,aE as ae,eT as ne,ak as le,aa as q,bY as oe,bZ as de,b_ as ce,b$ as me,c0 as ue,fV as fe,fW as R,fX as Z,fY as xe,fZ as D,f_ as he,B as I,bw as G,P as Q,cy as be,cz as je,cA as z,cB as X,cC as ye,cD as B,ab as U,cI as ge,f$ as Ne,de as ve,df as W,g0 as we,aO as pe,aj as T,eq as Se,x as $e,dl as Oe,dm as Ie,af as Te,c$ as Ae,dn as Ee,ci as Le,cj as ke,dp as Re,ck as Ce,dq as P,cl as Pe}from"./index-C2YGEKPo.js";import{C as Fe}from"./calendar-BZSx-Jno.js";var _e="Separator",K="horizontal",De=["horizontal","vertical"],re=O.forwardRef((s,r)=>{const{decorative:e,orientation:i=K,...a}=s,m=ze(i)?i:K,b=e?{role:"none"}:{"aria-orientation":m==="vertical"?m:void 0,role:"separator"};return t.jsx(ae.div,{"data-orientation":m,...b,...a,ref:r})});re.displayName=_e;function ze(s){return De.includes(s)}var ie=re;function L(s){return String(s??"").split(/[_-]/).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}function Be(s){return s.replace(/[^a-zA-Z0-9_-]/g,"-")}const Ve=/^\d{4}-\d{2}-\d{2}$/;function J(s){if(Ve.test(s)){const[r,e,i]=s.split("-").map(Number),a=new Date(0);return a.setHours(0,0,0,0),a.setFullYear(r,e-1,i),a}return new Date(s)}function qe(s,r=!1){if(!s)return r?"Pick a date and time":"Pick a date";const e=J(s);return Number.isNaN(e.getTime())?s:r?e.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}):P(e,"LLL dd, y")}function V(s){if(!s)return"";const r=J(s);if(Number.isNaN(r.getTime()))return"";const e=r.getTimezoneOffset()*6e4;return new Date(r.getTime()-e).toISOString().slice(0,16)}function ee(s){if(!s)return;const r=new Date(s);if(!Number.isNaN(r.getTime()))return r.toISOString()}function C(s,r){const e=r==="slug"?s.slug:s.metadata?.[r];return e==null?"":String(e)}function Me({control:s}){const r=[s.set_by,s.set_at?$e(s.set_at):null].filter(Boolean).join(" · ");return t.jsxs(Oe,{children:[t.jsx(Ie,{asChild:!0,children:t.jsxs(Te,{variant:"outline",className:"gap-1 border-emerald-500/30 bg-emerald-500/10 text-[10px] uppercase tracking-wide text-emerald-600 dark:text-emerald-400",children:[t.jsx(Ae,{className:"h-3 w-3"}),"You"]})}),t.jsxs(Ee,{className:"max-w-xs space-y-1",children:[t.jsx("div",{className:"text-xs font-medium",children:"Human-owned field"}),s.note?t.jsx("div",{className:"text-xs text-primary-foreground/90",children:s.note}):null,r?t.jsx("div",{className:"text-[11px] text-primary-foreground/70",children:r}):null]})]})}function te({id:s,value:r,onChange:e,readonly:i,ariaLabel:a,includeTime:m=!1}){const u=r?J(r):void 0,[b,c]=O.useState(()=>V(r).slice(11));return O.useEffect(()=>{c(V(r).slice(11))},[r]),t.jsx("div",{className:"relative",children:t.jsxs(Le,{children:[t.jsx(ke,{asChild:!0,children:t.jsxs(I,{id:s,"aria-label":a,type:"button",variant:"outline",disabled:i,className:T("w-full justify-start rounded-md bg-muted px-3 text-left font-normal",!r&&"text-muted-foreground"),children:[t.jsx(Re,{className:"mr-2 h-4 w-4 shrink-0"}),t.jsx("span",{className:"truncate",children:qe(r,m)})]})}),t.jsxs(Ce,{className:"w-auto space-y-3 p-0",align:"start",children:[t.jsx(Fe,{mode:"single",selected:u,defaultMonth:u,onSelect:x=>{if(!x)return;if(!m){e(P(x,"yyyy-MM-dd"));return}const n=b||"00:00";e(ee(`${P(x,"yyyy-MM-dd")}T${n}`))},initialFocus:!0}),m?t.jsxs("div",{className:"border-t p-3 pt-0",children:[t.jsx(q,{htmlFor:`${s}-time`,className:"text-xs text-muted-foreground",children:"Time"}),t.jsx(U,{id:`${s}-time`,type:"time",value:b,onChange:x=>{c(x.target.value);const n=r?V(r).slice(0,10):u?P(u,"yyyy-MM-dd"):"";n&&e(ee(`${n}T${x.target.value}`))},disabled:i})]}):null]})]})})}function Ue({id:s,value:r,onChange:e,readonly:i,ariaLabel:a,entityType:m,lookupField:u,numeric:b=!1,orgContext:c}){const x=f=>{if(f===void 0||f==="")return e(void 0);if(!b)return e(f);const p=Number(f);e(Number.isFinite(p)?p:f)},{data:n}=ge(m,c,{limit:Ne}),d=(n?.entities??[]).filter(f=>C(f,u)!==""),l=r==null?"":String(r),$=d.find(f=>C(f,u)===l);return c?i?t.jsx("div",{className:"flex h-9 items-center rounded-md border border-input bg-muted px-3 text-sm",children:$?.name||l||"-"}):t.jsx(ve,{contentClassName:"w-[320px]",searchPlaceholder:`Search ${L(m).toLowerCase()}...`,emptyText:`No ${m} found.`,trigger:f=>t.jsxs(I,{id:s,"aria-label":a,type:"button",variant:"outline",role:"combobox","aria-expanded":f,className:"w-full justify-between",children:[t.jsx("span",{className:T("truncate",!l&&"text-muted-foreground"),children:$?.name||l||`Select ${L(m).toLowerCase()}`}),t.jsx(Se,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]}),children:(f,p)=>{const S=p.trim(),j=S.length>0&&!d.some(v=>C(v,u)===S);return t.jsxs(t.Fragment,{children:[j?t.jsxs(W,{value:`use ${S}`,onSelect:()=>{x(S),f()},children:[t.jsx(we,{className:"mr-2 h-3.5 w-3.5 opacity-60"}),t.jsxs("span",{className:"truncate",children:["Use ",t.jsx("span",{className:"font-medium",children:S})]})]}):null,d.map(v=>{const o=C(v,u),y=o===l;return t.jsxs(W,{value:`${v.name} ${v.slug} ${v.entity_type} ${o}`,onSelect:()=>{x(o||void 0),f()},children:[t.jsx(pe,{className:T("mr-2 h-4 w-4",y?"opacity-100":"opacity-0")}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"truncate",children:v.name}),t.jsx("div",{className:"text-xs text-muted-foreground",children:v.slug})]})]},`${v.id}-${o}`)})]})}}):t.jsx(U,{id:s,"aria-label":a,type:b?"number":"text",value:l,onChange:f=>x(f.target.value||void 0),disabled:i})}function M({fieldPath:s,fieldKey:r,prop:e,value:i,onChange:a,isRequired:m,readonly:u,control:b,compact:c=!1,orgContext:x}){const n=e.description||L(r),d=Be(s),l=u||e.readOnly===!0,$=!c&&b?t.jsx(Me,{control:b}):null,f=e.type==="object"||!!e.properties,p=e.type==="array"&&!!e.items&&(e.items?.type==="object"||!!e.items?.properties),S=e.type==="array"&&!!e.items&&(e.items?.type==="string"||e.items?.type==="number"||e.items?.type==="integer"||e.items?.type==="boolean");if(e.type==="boolean")return t.jsxs("div",{className:c?"flex items-center":"flex items-center space-x-2 py-1",children:[t.jsx(le,{id:d,"aria-label":c?n:void 0,checked:i??!1,onCheckedChange:o=>a(o),disabled:l}),c?null:t.jsxs(q,{htmlFor:d,className:"flex items-center gap-1.5 font-normal",children:[n,$]})]});let j;if(e.enum&&Array.isArray(e.enum))j=t.jsxs(oe,{value:i==null?"":String(i),onValueChange:o=>a(o===""?void 0:e.type==="number"||e.type==="integer"?Number(o):o),disabled:l,children:[t.jsx(de,{id:d,"aria-label":c?n:void 0,children:t.jsx(ce,{placeholder:`Select ${n.toLowerCase()}`})}),t.jsx(me,{children:e.enum.map(o=>{const y=String(o);return t.jsx(ue,{value:y,children:L(y)},y)})})]});else if(e["x-link-entity-type"])j=t.jsx(Ue,{id:d,value:i,onChange:a,readonly:l,ariaLabel:c?n:void 0,entityType:e["x-link-entity-type"],lookupField:e["x-link-lookup-field"]||"slug",numeric:e.type==="number"||e.type==="integer",orgContext:x});else if(e.type==="number"||e.type==="integer")j=t.jsx(fe,{id:d,ariaLabel:c?n:void 0,value:i,onChange:a,integer:e.type==="integer",placeholder:`Enter ${n.toLowerCase()}`,readOnly:l});else if(f){const o=Object.entries(e.properties??{}),y=new Set(e.required??[]),A=R(i)?i:{};j=o.length===0||!R(i)&&i!==void 0&&i!==null?t.jsx(Z,{id:d,value:i,ariaLabel:`${n} JSON object`,readOnly:l,onChange:a}):t.jsx("fieldset",{"aria-label":c?n:void 0,"aria-labelledby":c?void 0:`${d}-label`,className:"space-y-3 rounded-md border p-3",children:o.map(([w,k])=>t.jsx(M,{fieldPath:`${s}.${w}`,fieldKey:w,prop:k,value:A[w],onChange:g=>{const h={...A};g===void 0?delete h[w]:h[w]=g,a(h)},isRequired:y.has(w),readonly:l,orgContext:x},w))})}else if(S)j=i!=null&&!xe(i)?t.jsx(D,{id:d,value:i,ariaLabel:`${n} JSON array`,readOnly:l,itemType:e.items?.type,itemEnum:e.items?.enum,minItems:e.minItems,maxItems:e.maxItems,onChange:a}):t.jsx(he,{id:d,value:i,itemType:e.items?.type,itemEnum:e.items?.enum,minItems:e.minItems,maxItems:e.maxItems,ariaLabel:c?n:void 0,readOnly:l,showHelp:!c,onChange:a});else if(p&&e.items){const o=Array.isArray(i)?i:[],y=Object.entries(e.items.properties??{}),A=new Set(e.items.required??[]),w=e.maxItems===void 0||o.length<e.maxItems,k=e.minItems===void 0||o.length>e.minItems;j=!Array.isArray(i)&&i!==void 0&&i!==null||y.length>0&&o.some(g=>!R(g))?t.jsx(D,{id:d,value:i,ariaLabel:`${n} JSON array`,readOnly:l,itemType:"object",minItems:e.minItems,maxItems:e.maxItems,onChange:a}):y.length===0?t.jsxs("fieldset",{"aria-label":c?n:void 0,"aria-labelledby":c?void 0:`${d}-label`,className:"space-y-3",children:[o.length===0?t.jsx("p",{className:"text-sm text-muted-foreground",children:"No rows"}):o.map((g,h)=>t.jsxs("fieldset",{className:"space-y-2 rounded-md border p-3",children:[t.jsxs("legend",{className:"px-1 text-xs font-medium text-muted-foreground",children:["Row ",h+1]}),t.jsx(Z,{id:`${d}-${h}-json`,value:g,ariaLabel:`${n} row ${h+1} JSON object`,readOnly:l,onChange:E=>{const N=[...o];N[h]=E,a(N)}}),l?null:t.jsxs(I,{type:"button",variant:"ghost",size:"sm","aria-label":`Remove row ${h+1}`,disabled:!k,onClick:()=>a(o.filter((E,N)=>N!==h)),children:[t.jsx(G,{className:"mr-1.5 h-4 w-4"}),"Remove row"]})]},`${s}.${h}`)),l?null:t.jsxs(I,{type:"button",variant:"outline",size:"sm",disabled:!w,onClick:()=>a([...o,{}]),children:[t.jsx(Q,{className:"mr-1.5 h-4 w-4"}),"Add row"]})]}):t.jsxs("fieldset",{"aria-label":c?n:void 0,"aria-labelledby":c?void 0:`${d}-label`,className:"space-y-3",children:[t.jsx("div",{className:"rounded-md border",children:t.jsxs(be,{children:[t.jsx(je,{children:t.jsxs(z,{children:[y.map(([g,h])=>t.jsxs(X,{children:[h.description||L(g),A.has(g)?t.jsx("span",{className:"text-destructive ml-1",children:"*"}):null]},g)),l?null:t.jsx(X,{className:"w-12"})]})}),t.jsx(ye,{children:o.length===0?t.jsx(z,{children:t.jsx(B,{colSpan:y.length+(l?0:1),className:"text-sm text-muted-foreground",children:"No rows"})}):o.map((g,h)=>{const E=R(g)?g:{};return t.jsxs(z,{children:[y.map(([N,F])=>t.jsx(B,{className:"align-top",children:t.jsx(M,{fieldPath:`${s}.${h}.${N}`,fieldKey:N,prop:F,value:E[N],onChange:H=>{const Y=[...o],_={...E};H===void 0?delete _[N]:_[N]=H,Y[h]=_,a(Y)},isRequired:A.has(N),readonly:l,compact:!0,orgContext:x})},N)),l?null:t.jsx(B,{className:"align-top",children:t.jsx(I,{type:"button",variant:"ghost",size:"icon","aria-label":`Remove row ${h+1}`,disabled:!k,onClick:()=>a(o.filter((N,F)=>F!==h)),children:t.jsx(G,{className:"h-4 w-4"})})})]},`${s}.${h}`)})})]})}),l?null:t.jsxs(I,{type:"button",variant:"outline",size:"sm",disabled:!w,onClick:()=>a([...o,{}]),children:[t.jsx(Q,{className:"mr-1.5 h-4 w-4"}),"Add row"]})]})}else if(e.type==="array")j=t.jsx(D,{id:d,value:i,ariaLabel:`${n} JSON array`,readOnly:l,itemType:e.items?.type,itemEnum:e.items?.enum,minItems:e.minItems,maxItems:e.maxItems,onChange:a});else if(e.format==="date")j=t.jsx(te,{id:d,value:typeof i=="string"?i:void 0,onChange:a,readonly:l,ariaLabel:c?n:void 0});else if(e.format==="date-time")j=t.jsx(te,{id:d,value:typeof i=="string"?i:void 0,onChange:a,readonly:l,ariaLabel:c?n:void 0,includeTime:!0});else{const o=e.format==="uri"||e.format==="url";j=t.jsx(U,{id:d,"aria-label":c?n:void 0,type:o?"url":"text",value:i??"",onChange:y=>a(y.target.value||void 0),placeholder:o?"https://example.com":`Enter ${n.toLowerCase()}`,disabled:l})}if(c)return j;const v=f||p;return t.jsxs("div",{className:"space-y-1.5",children:[v?t.jsxs("p",{id:`${d}-label`,className:"flex items-center gap-1.5 text-sm font-medium",children:[t.jsxs("span",{children:[n,m?t.jsx("span",{className:"text-destructive ml-1",children:"*"}):null]}),$]}):t.jsxs(q,{htmlFor:d,className:"flex items-center gap-1.5",children:[t.jsxs("span",{children:[n,m?t.jsx("span",{className:"text-destructive ml-1",children:"*"}):null]}),$]}),j]})}function We(s){const r={};for(const[e,i]of Object.entries(s)){const a=ne(i);a==null||a===""||(r[e]=a)}return r}function Ke({schema:s,values:r,onValuesChange:e,readonly:i=!1,fieldControls:a,orgContext:m}){const u=s,b=u?.properties,c=new Set(u?.required??[]),x=(n,d)=>{e({...r,[n]:d})};return!b||Object.keys(b).length===0?t.jsx("p",{className:"text-sm text-muted-foreground py-2",children:"No additional fields required for this entity type."}):t.jsx("div",{className:"space-y-4",children:Object.entries(b).map(([n,d])=>"x-measure"in d||"x-dimension"in d?null:t.jsx(M,{fieldPath:n,fieldKey:n,prop:d,value:r[n],onChange:l=>x(n,l),isRequired:c.has(n),readonly:i,control:a?.[n],orgContext:m},n))})}const Je=O.forwardRef(({className:s,orientation:r="horizontal",decorative:e=!0,...i},a)=>t.jsx(ie,{ref:a,decorative:e,orientation:r,className:T("shrink-0 bg-border",r==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",s),...i}));Je.displayName=ie.displayName;function se(s,r){const e=s?.properties;if(e)return Object.entries(e).find(([,i])=>i[r])?.[0]}function He(s){const r=s.trim(),e=r.split(/[\s._@/-]+/).filter(Boolean),i=e.length>=2?`${e[0][0]}${e[1][0]}`:(e[0]??r).slice(0,2);let a=0;for(let m=0;m<r.length;m++)a=a*31+r.charCodeAt(m)>>>0;return{initials:i.toUpperCase()||"?",hue:a%360}}function Ye(s){const[r,e]=O.useState();return O.useEffect(()=>{if(!s){e(void 0);return}let i=!1;const a=s.trim().toLowerCase();return crypto.subtle.digest("SHA-256",new TextEncoder().encode(a)).then(m=>{i||e(Array.from(new Uint8Array(m)).map(u=>u.toString(16).padStart(2,"0")).join(""))}),()=>{i=!0}},[s]),r?`https://www.gravatar.com/avatar/${r}?d=identicon&s=80`:void 0}function et({metadata:s,metadataSchema:r,name:e,typeIcon:i,className:a="h-6 w-6",iconClassName:m="h-5 w-5",initialsFallback:u=!1}){const b=se(r,"x-image"),c=se(r,"x-email"),x=b&&s?.[b]||void 0,n=c&&s?.[c]||void 0,d=Ye(x?void 0:n),l=x||d,[$,f]=O.useState(!1);if(O.useEffect(()=>{f(!1)},[l]),l&&!$)return t.jsx("img",{src:l,alt:e,referrerPolicy:"no-referrer",onError:()=>f(!0),className:T("rounded-full object-cover border border-border",a)});if(u){const p=e.trim()||n||Ze(s,r)||e,{initials:S,hue:j}=He(p);return t.jsx("span",{role:"img","aria-label":e,className:T("inline-grid place-items-center rounded-full border border-border font-semibold text-white select-none",a),style:{background:`oklch(0.55 0.13 ${j})`,fontSize:"0.85em"},children:S})}return t.jsx(Pe,{icon:i,className:m})}function Ze(s,r){if(!s)return;const e=r?.properties,i=["email","handle","username","login","github","x_handle","slug"],a=Object.keys(e||s);for(const m of a)if(i.includes(m.toLowerCase())){const u=s[m];if(typeof u=="string"&&u.trim())return u}}function Ge(s,r){if(typeof s!="string"||!r||r.length===0)return s;const e=s.trim();if(r.includes(e))return e;try{const i=JSON.parse(e);if(typeof i=="string"&&r.includes(i))return i}catch{}return s}function tt(s,r){if(!s)return{};const e=r?.properties;return e?Object.fromEntries(Object.entries(s).map(([i,a])=>[i,Ge(a,e[i]?.enum)])):{...s}}export{Ke as D,et as E,Je as S,tt as a,We as c,Ge as n};
|
|
1
|
+
import{r as O,j as t,aE as ae,eT as ne,ak as le,aa as q,bY as oe,bZ as de,b_ as ce,b$ as me,c0 as ue,fV as fe,fW as R,fX as Z,fY as xe,fZ as D,f_ as he,B as I,bw as G,P as Q,cy as be,cz as je,cA as z,cB as X,cC as ye,cD as B,ab as U,cI as ge,f$ as Ne,de as ve,df as W,g0 as we,aO as pe,aj as T,eq as Se,x as $e,dl as Oe,dm as Ie,af as Te,c$ as Ae,dn as Ee,ci as Le,cj as ke,dp as Re,ck as Ce,dq as P,cl as Pe}from"./index-BKZMzuMS.js";import{C as Fe}from"./calendar-VAaxHxss.js";var _e="Separator",K="horizontal",De=["horizontal","vertical"],re=O.forwardRef((s,r)=>{const{decorative:e,orientation:i=K,...a}=s,m=ze(i)?i:K,b=e?{role:"none"}:{"aria-orientation":m==="vertical"?m:void 0,role:"separator"};return t.jsx(ae.div,{"data-orientation":m,...b,...a,ref:r})});re.displayName=_e;function ze(s){return De.includes(s)}var ie=re;function L(s){return String(s??"").split(/[_-]/).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}function Be(s){return s.replace(/[^a-zA-Z0-9_-]/g,"-")}const Ve=/^\d{4}-\d{2}-\d{2}$/;function J(s){if(Ve.test(s)){const[r,e,i]=s.split("-").map(Number),a=new Date(0);return a.setHours(0,0,0,0),a.setFullYear(r,e-1,i),a}return new Date(s)}function qe(s,r=!1){if(!s)return r?"Pick a date and time":"Pick a date";const e=J(s);return Number.isNaN(e.getTime())?s:r?e.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}):P(e,"LLL dd, y")}function V(s){if(!s)return"";const r=J(s);if(Number.isNaN(r.getTime()))return"";const e=r.getTimezoneOffset()*6e4;return new Date(r.getTime()-e).toISOString().slice(0,16)}function ee(s){if(!s)return;const r=new Date(s);if(!Number.isNaN(r.getTime()))return r.toISOString()}function C(s,r){const e=r==="slug"?s.slug:s.metadata?.[r];return e==null?"":String(e)}function Me({control:s}){const r=[s.set_by,s.set_at?$e(s.set_at):null].filter(Boolean).join(" · ");return t.jsxs(Oe,{children:[t.jsx(Ie,{asChild:!0,children:t.jsxs(Te,{variant:"outline",className:"gap-1 border-emerald-500/30 bg-emerald-500/10 text-[10px] uppercase tracking-wide text-emerald-600 dark:text-emerald-400",children:[t.jsx(Ae,{className:"h-3 w-3"}),"You"]})}),t.jsxs(Ee,{className:"max-w-xs space-y-1",children:[t.jsx("div",{className:"text-xs font-medium",children:"Human-owned field"}),s.note?t.jsx("div",{className:"text-xs text-primary-foreground/90",children:s.note}):null,r?t.jsx("div",{className:"text-[11px] text-primary-foreground/70",children:r}):null]})]})}function te({id:s,value:r,onChange:e,readonly:i,ariaLabel:a,includeTime:m=!1}){const u=r?J(r):void 0,[b,c]=O.useState(()=>V(r).slice(11));return O.useEffect(()=>{c(V(r).slice(11))},[r]),t.jsx("div",{className:"relative",children:t.jsxs(Le,{children:[t.jsx(ke,{asChild:!0,children:t.jsxs(I,{id:s,"aria-label":a,type:"button",variant:"outline",disabled:i,className:T("w-full justify-start rounded-md bg-muted px-3 text-left font-normal",!r&&"text-muted-foreground"),children:[t.jsx(Re,{className:"mr-2 h-4 w-4 shrink-0"}),t.jsx("span",{className:"truncate",children:qe(r,m)})]})}),t.jsxs(Ce,{className:"w-auto space-y-3 p-0",align:"start",children:[t.jsx(Fe,{mode:"single",selected:u,defaultMonth:u,onSelect:x=>{if(!x)return;if(!m){e(P(x,"yyyy-MM-dd"));return}const n=b||"00:00";e(ee(`${P(x,"yyyy-MM-dd")}T${n}`))},initialFocus:!0}),m?t.jsxs("div",{className:"border-t p-3 pt-0",children:[t.jsx(q,{htmlFor:`${s}-time`,className:"text-xs text-muted-foreground",children:"Time"}),t.jsx(U,{id:`${s}-time`,type:"time",value:b,onChange:x=>{c(x.target.value);const n=r?V(r).slice(0,10):u?P(u,"yyyy-MM-dd"):"";n&&e(ee(`${n}T${x.target.value}`))},disabled:i})]}):null]})]})})}function Ue({id:s,value:r,onChange:e,readonly:i,ariaLabel:a,entityType:m,lookupField:u,numeric:b=!1,orgContext:c}){const x=f=>{if(f===void 0||f==="")return e(void 0);if(!b)return e(f);const p=Number(f);e(Number.isFinite(p)?p:f)},{data:n}=ge(m,c,{limit:Ne}),d=(n?.entities??[]).filter(f=>C(f,u)!==""),l=r==null?"":String(r),$=d.find(f=>C(f,u)===l);return c?i?t.jsx("div",{className:"flex h-9 items-center rounded-md border border-input bg-muted px-3 text-sm",children:$?.name||l||"-"}):t.jsx(ve,{contentClassName:"w-[320px]",searchPlaceholder:`Search ${L(m).toLowerCase()}...`,emptyText:`No ${m} found.`,trigger:f=>t.jsxs(I,{id:s,"aria-label":a,type:"button",variant:"outline",role:"combobox","aria-expanded":f,className:"w-full justify-between",children:[t.jsx("span",{className:T("truncate",!l&&"text-muted-foreground"),children:$?.name||l||`Select ${L(m).toLowerCase()}`}),t.jsx(Se,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]}),children:(f,p)=>{const S=p.trim(),j=S.length>0&&!d.some(v=>C(v,u)===S);return t.jsxs(t.Fragment,{children:[j?t.jsxs(W,{value:`use ${S}`,onSelect:()=>{x(S),f()},children:[t.jsx(we,{className:"mr-2 h-3.5 w-3.5 opacity-60"}),t.jsxs("span",{className:"truncate",children:["Use ",t.jsx("span",{className:"font-medium",children:S})]})]}):null,d.map(v=>{const o=C(v,u),y=o===l;return t.jsxs(W,{value:`${v.name} ${v.slug} ${v.entity_type} ${o}`,onSelect:()=>{x(o||void 0),f()},children:[t.jsx(pe,{className:T("mr-2 h-4 w-4",y?"opacity-100":"opacity-0")}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"truncate",children:v.name}),t.jsx("div",{className:"text-xs text-muted-foreground",children:v.slug})]})]},`${v.id}-${o}`)})]})}}):t.jsx(U,{id:s,"aria-label":a,type:b?"number":"text",value:l,onChange:f=>x(f.target.value||void 0),disabled:i})}function M({fieldPath:s,fieldKey:r,prop:e,value:i,onChange:a,isRequired:m,readonly:u,control:b,compact:c=!1,orgContext:x}){const n=e.description||L(r),d=Be(s),l=u||e.readOnly===!0,$=!c&&b?t.jsx(Me,{control:b}):null,f=e.type==="object"||!!e.properties,p=e.type==="array"&&!!e.items&&(e.items?.type==="object"||!!e.items?.properties),S=e.type==="array"&&!!e.items&&(e.items?.type==="string"||e.items?.type==="number"||e.items?.type==="integer"||e.items?.type==="boolean");if(e.type==="boolean")return t.jsxs("div",{className:c?"flex items-center":"flex items-center space-x-2 py-1",children:[t.jsx(le,{id:d,"aria-label":c?n:void 0,checked:i??!1,onCheckedChange:o=>a(o),disabled:l}),c?null:t.jsxs(q,{htmlFor:d,className:"flex items-center gap-1.5 font-normal",children:[n,$]})]});let j;if(e.enum&&Array.isArray(e.enum))j=t.jsxs(oe,{value:i==null?"":String(i),onValueChange:o=>a(o===""?void 0:e.type==="number"||e.type==="integer"?Number(o):o),disabled:l,children:[t.jsx(de,{id:d,"aria-label":c?n:void 0,children:t.jsx(ce,{placeholder:`Select ${n.toLowerCase()}`})}),t.jsx(me,{children:e.enum.map(o=>{const y=String(o);return t.jsx(ue,{value:y,children:L(y)},y)})})]});else if(e["x-link-entity-type"])j=t.jsx(Ue,{id:d,value:i,onChange:a,readonly:l,ariaLabel:c?n:void 0,entityType:e["x-link-entity-type"],lookupField:e["x-link-lookup-field"]||"slug",numeric:e.type==="number"||e.type==="integer",orgContext:x});else if(e.type==="number"||e.type==="integer")j=t.jsx(fe,{id:d,ariaLabel:c?n:void 0,value:i,onChange:a,integer:e.type==="integer",placeholder:`Enter ${n.toLowerCase()}`,readOnly:l});else if(f){const o=Object.entries(e.properties??{}),y=new Set(e.required??[]),A=R(i)?i:{};j=o.length===0||!R(i)&&i!==void 0&&i!==null?t.jsx(Z,{id:d,value:i,ariaLabel:`${n} JSON object`,readOnly:l,onChange:a}):t.jsx("fieldset",{"aria-label":c?n:void 0,"aria-labelledby":c?void 0:`${d}-label`,className:"space-y-3 rounded-md border p-3",children:o.map(([w,k])=>t.jsx(M,{fieldPath:`${s}.${w}`,fieldKey:w,prop:k,value:A[w],onChange:g=>{const h={...A};g===void 0?delete h[w]:h[w]=g,a(h)},isRequired:y.has(w),readonly:l,orgContext:x},w))})}else if(S)j=i!=null&&!xe(i)?t.jsx(D,{id:d,value:i,ariaLabel:`${n} JSON array`,readOnly:l,itemType:e.items?.type,itemEnum:e.items?.enum,minItems:e.minItems,maxItems:e.maxItems,onChange:a}):t.jsx(he,{id:d,value:i,itemType:e.items?.type,itemEnum:e.items?.enum,minItems:e.minItems,maxItems:e.maxItems,ariaLabel:c?n:void 0,readOnly:l,showHelp:!c,onChange:a});else if(p&&e.items){const o=Array.isArray(i)?i:[],y=Object.entries(e.items.properties??{}),A=new Set(e.items.required??[]),w=e.maxItems===void 0||o.length<e.maxItems,k=e.minItems===void 0||o.length>e.minItems;j=!Array.isArray(i)&&i!==void 0&&i!==null||y.length>0&&o.some(g=>!R(g))?t.jsx(D,{id:d,value:i,ariaLabel:`${n} JSON array`,readOnly:l,itemType:"object",minItems:e.minItems,maxItems:e.maxItems,onChange:a}):y.length===0?t.jsxs("fieldset",{"aria-label":c?n:void 0,"aria-labelledby":c?void 0:`${d}-label`,className:"space-y-3",children:[o.length===0?t.jsx("p",{className:"text-sm text-muted-foreground",children:"No rows"}):o.map((g,h)=>t.jsxs("fieldset",{className:"space-y-2 rounded-md border p-3",children:[t.jsxs("legend",{className:"px-1 text-xs font-medium text-muted-foreground",children:["Row ",h+1]}),t.jsx(Z,{id:`${d}-${h}-json`,value:g,ariaLabel:`${n} row ${h+1} JSON object`,readOnly:l,onChange:E=>{const N=[...o];N[h]=E,a(N)}}),l?null:t.jsxs(I,{type:"button",variant:"ghost",size:"sm","aria-label":`Remove row ${h+1}`,disabled:!k,onClick:()=>a(o.filter((E,N)=>N!==h)),children:[t.jsx(G,{className:"mr-1.5 h-4 w-4"}),"Remove row"]})]},`${s}.${h}`)),l?null:t.jsxs(I,{type:"button",variant:"outline",size:"sm",disabled:!w,onClick:()=>a([...o,{}]),children:[t.jsx(Q,{className:"mr-1.5 h-4 w-4"}),"Add row"]})]}):t.jsxs("fieldset",{"aria-label":c?n:void 0,"aria-labelledby":c?void 0:`${d}-label`,className:"space-y-3",children:[t.jsx("div",{className:"rounded-md border",children:t.jsxs(be,{children:[t.jsx(je,{children:t.jsxs(z,{children:[y.map(([g,h])=>t.jsxs(X,{children:[h.description||L(g),A.has(g)?t.jsx("span",{className:"text-destructive ml-1",children:"*"}):null]},g)),l?null:t.jsx(X,{className:"w-12"})]})}),t.jsx(ye,{children:o.length===0?t.jsx(z,{children:t.jsx(B,{colSpan:y.length+(l?0:1),className:"text-sm text-muted-foreground",children:"No rows"})}):o.map((g,h)=>{const E=R(g)?g:{};return t.jsxs(z,{children:[y.map(([N,F])=>t.jsx(B,{className:"align-top",children:t.jsx(M,{fieldPath:`${s}.${h}.${N}`,fieldKey:N,prop:F,value:E[N],onChange:H=>{const Y=[...o],_={...E};H===void 0?delete _[N]:_[N]=H,Y[h]=_,a(Y)},isRequired:A.has(N),readonly:l,compact:!0,orgContext:x})},N)),l?null:t.jsx(B,{className:"align-top",children:t.jsx(I,{type:"button",variant:"ghost",size:"icon","aria-label":`Remove row ${h+1}`,disabled:!k,onClick:()=>a(o.filter((N,F)=>F!==h)),children:t.jsx(G,{className:"h-4 w-4"})})})]},`${s}.${h}`)})})]})}),l?null:t.jsxs(I,{type:"button",variant:"outline",size:"sm",disabled:!w,onClick:()=>a([...o,{}]),children:[t.jsx(Q,{className:"mr-1.5 h-4 w-4"}),"Add row"]})]})}else if(e.type==="array")j=t.jsx(D,{id:d,value:i,ariaLabel:`${n} JSON array`,readOnly:l,itemType:e.items?.type,itemEnum:e.items?.enum,minItems:e.minItems,maxItems:e.maxItems,onChange:a});else if(e.format==="date")j=t.jsx(te,{id:d,value:typeof i=="string"?i:void 0,onChange:a,readonly:l,ariaLabel:c?n:void 0});else if(e.format==="date-time")j=t.jsx(te,{id:d,value:typeof i=="string"?i:void 0,onChange:a,readonly:l,ariaLabel:c?n:void 0,includeTime:!0});else{const o=e.format==="uri"||e.format==="url";j=t.jsx(U,{id:d,"aria-label":c?n:void 0,type:o?"url":"text",value:i??"",onChange:y=>a(y.target.value||void 0),placeholder:o?"https://example.com":`Enter ${n.toLowerCase()}`,disabled:l})}if(c)return j;const v=f||p;return t.jsxs("div",{className:"space-y-1.5",children:[v?t.jsxs("p",{id:`${d}-label`,className:"flex items-center gap-1.5 text-sm font-medium",children:[t.jsxs("span",{children:[n,m?t.jsx("span",{className:"text-destructive ml-1",children:"*"}):null]}),$]}):t.jsxs(q,{htmlFor:d,className:"flex items-center gap-1.5",children:[t.jsxs("span",{children:[n,m?t.jsx("span",{className:"text-destructive ml-1",children:"*"}):null]}),$]}),j]})}function We(s){const r={};for(const[e,i]of Object.entries(s)){const a=ne(i);a==null||a===""||(r[e]=a)}return r}function Ke({schema:s,values:r,onValuesChange:e,readonly:i=!1,fieldControls:a,orgContext:m}){const u=s,b=u?.properties,c=new Set(u?.required??[]),x=(n,d)=>{e({...r,[n]:d})};return!b||Object.keys(b).length===0?t.jsx("p",{className:"text-sm text-muted-foreground py-2",children:"No additional fields required for this entity type."}):t.jsx("div",{className:"space-y-4",children:Object.entries(b).map(([n,d])=>"x-measure"in d||"x-dimension"in d?null:t.jsx(M,{fieldPath:n,fieldKey:n,prop:d,value:r[n],onChange:l=>x(n,l),isRequired:c.has(n),readonly:i,control:a?.[n],orgContext:m},n))})}const Je=O.forwardRef(({className:s,orientation:r="horizontal",decorative:e=!0,...i},a)=>t.jsx(ie,{ref:a,decorative:e,orientation:r,className:T("shrink-0 bg-border",r==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",s),...i}));Je.displayName=ie.displayName;function se(s,r){const e=s?.properties;if(e)return Object.entries(e).find(([,i])=>i[r])?.[0]}function He(s){const r=s.trim(),e=r.split(/[\s._@/-]+/).filter(Boolean),i=e.length>=2?`${e[0][0]}${e[1][0]}`:(e[0]??r).slice(0,2);let a=0;for(let m=0;m<r.length;m++)a=a*31+r.charCodeAt(m)>>>0;return{initials:i.toUpperCase()||"?",hue:a%360}}function Ye(s){const[r,e]=O.useState();return O.useEffect(()=>{if(!s){e(void 0);return}let i=!1;const a=s.trim().toLowerCase();return crypto.subtle.digest("SHA-256",new TextEncoder().encode(a)).then(m=>{i||e(Array.from(new Uint8Array(m)).map(u=>u.toString(16).padStart(2,"0")).join(""))}),()=>{i=!0}},[s]),r?`https://www.gravatar.com/avatar/${r}?d=identicon&s=80`:void 0}function et({metadata:s,metadataSchema:r,name:e,typeIcon:i,className:a="h-6 w-6",iconClassName:m="h-5 w-5",initialsFallback:u=!1}){const b=se(r,"x-image"),c=se(r,"x-email"),x=b&&s?.[b]||void 0,n=c&&s?.[c]||void 0,d=Ye(x?void 0:n),l=x||d,[$,f]=O.useState(!1);if(O.useEffect(()=>{f(!1)},[l]),l&&!$)return t.jsx("img",{src:l,alt:e,referrerPolicy:"no-referrer",onError:()=>f(!0),className:T("rounded-full object-cover border border-border",a)});if(u){const p=e.trim()||n||Ze(s,r)||e,{initials:S,hue:j}=He(p);return t.jsx("span",{role:"img","aria-label":e,className:T("inline-grid place-items-center rounded-full border border-border font-semibold text-white select-none",a),style:{background:`oklch(0.55 0.13 ${j})`,fontSize:"0.85em"},children:S})}return t.jsx(Pe,{icon:i,className:m})}function Ze(s,r){if(!s)return;const e=r?.properties,i=["email","handle","username","login","github","x_handle","slug"],a=Object.keys(e||s);for(const m of a)if(i.includes(m.toLowerCase())){const u=s[m];if(typeof u=="string"&&u.trim())return u}}function Ge(s,r){if(typeof s!="string"||!r||r.length===0)return s;const e=s.trim();if(r.includes(e))return e;try{const i=JSON.parse(e);if(typeof i=="string"&&r.includes(i))return i}catch{}return s}function tt(s,r){if(!s)return{};const e=r?.properties;return e?Object.fromEntries(Object.entries(s).map(([i,a])=>[i,Ge(a,e[i]?.enum)])):{...s}}export{Ke as D,et as E,Je as S,tt as a,We as c,Ge as n};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{hq as t,j as n}from"./index-BKZMzuMS.js";import{a as s}from"./agents-workbench-BojDv6gX.js";import"./agent-editor-form-ayUg3Ws1.js";import"./model-selector-9ZRlR7Sa.js";import"./proposal-review-shell-Bk9D_9YN.js";import"./runs-CftQDTkq.js";function c(){const{owner:o,agentId:r}=t.useParams(),e=t.useSearch();return n.jsx(s,{owner:o,agentId:r,tab:"settings",runId:e.run_id})}export{c as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Y as i,j as e,L as c,a5 as m,aj as t,aS as a,B as l,ap as d}from"./index-
|
|
1
|
+
import{Y as i,j as e,L as c,a5 as m,aj as t,aS as a,B as l,ap as d}from"./index-BKZMzuMS.js";import{F as o}from"./full-page-spinner-Q_J5Wcop.js";function h(){const{session:s,isReady:n}=i();if(!n)return e.jsx(o,{});if(!s||!s.user)return e.jsx("div",{className:"container mx-auto py-8 px-4",children:e.jsxs("div",{className:"max-w-md mx-auto text-center space-y-4",children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Not signed in"}),e.jsx("p",{className:"text-muted-foreground",children:"Please sign in to view your settings."}),e.jsx(c,{to:"/auth/login",search:m({intent:"sign-in"}),className:"inline-block px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Sign In"})]})});const r=async()=>{await d(),window.location.href="/"};return e.jsx("div",{className:"container mx-auto py-8 px-4",children:e.jsxs("div",{className:"max-w-2xl mx-auto space-y-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Settings"}),e.jsx("p",{className:"text-muted-foreground",children:"Manage your account settings"})]}),e.jsxs("div",{className:t(a,"p-6 space-y-6"),children:[e.jsx("h2",{className:"text-lg font-medium",children:"Profile"}),e.jsxs("div",{className:"flex items-center gap-4",children:[s.user.image?e.jsx("img",{src:s.user.image,alt:s.user.name||"User",referrerPolicy:"no-referrer",className:"h-16 w-16 rounded-full object-cover"}):e.jsx("div",{className:"h-16 w-16 rounded-full bg-primary/10 flex items-center justify-center",children:e.jsx("span",{className:"text-xl font-medium text-primary",children:(s.user.name||s.user.email||"U")[0].toUpperCase()})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:s.user.name||"User"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.user.email})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Name"}),e.jsx("p",{className:"mt-1",children:s.user.name||"Not set"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Email"}),e.jsx("p",{className:"mt-1",children:s.user.email})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"User ID"}),e.jsx("p",{className:"mt-1 text-xs font-mono text-muted-foreground",children:s.user.id})]})]})]}),e.jsxs("div",{className:t(a,"p-6 space-y-4"),children:[e.jsx("h2",{className:"text-lg font-medium",children:"Account"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Sign out of your account on this device."}),e.jsx(l,{variant:"destructive",onClick:r,children:"Sign Out"})]})]})})}export{h as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{hp as r,j as t,a0 as s}from"./index-BKZMzuMS.js";import{A as e}from"./agent-skill-context-DKpIFmCh.js";import"./core.esm-COW6Pfy6.js";import"./skill-editor-D_W3QlRz.js";function p(){const{agentId:o}=r.useParams();return t.jsx(e,{agentId:o,children:t.jsx(s,{})})}export{p as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r,aj as i}from"./index-
|
|
1
|
+
import{j as r,aj as i}from"./index-BKZMzuMS.js";function l({checked:n,onCheckedChange:s,disabled:o,className:e,...t}){return r.jsx("button",{type:"button",role:"switch","aria-checked":n,disabled:o,onClick:()=>s(!n),className:i("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",n?"bg-primary":"bg-input",e),...t,children:r.jsx("span",{className:i("pointer-events-none block h-4 w-4 rounded-full bg-background ring-0 transition-transform",n?"translate-x-4":"translate-x-0")})})}export{l as S};
|