failproofai 0.0.11-beta.9 → 0.0.11
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/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/required-server-files.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +7 -7
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +15 -15
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +15 -15
- package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +10 -10
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/api/audit/invite/route.js +1 -1
- package/.next/standalone/.next/server/app/api/audit/invite/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/audit/run/route.js +1 -1
- package/.next/standalone/.next/server/app/api/audit/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/login-request/route.js +1 -1
- package/.next/standalone/.next/server/app/api/auth/login-request/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/login-verify/route.js +1 -1
- package/.next/standalone/.next/server/app/api/auth/login-verify/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/logout/route.js +1 -1
- package/.next/standalone/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/reminder/route.js +1 -1
- package/.next/standalone/.next/server/app/api/auth/reminder/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/status/route.js +1 -1
- package/.next/standalone/.next/server/app/api/auth/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/audit/page/server-reference-manifest.json +2 -2
- package/.next/standalone/.next/server/app/audit/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/audit/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +15 -15
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +15 -15
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +10 -10
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +8 -8
- package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/chunks/[externals]__1_g_b3t._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0dwpg-h._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0lnenda._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__13i_sva._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1_mqemn._.js +1 -1
- package/.next/standalone/.next/server/chunks/node_modules_0-tu4ot._.js +1 -1
- package/.next/standalone/.next/server/chunks/node_modules_1bnh1y0._.js +1 -1
- package/.next/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_17k9e3w.js +3 -3
- package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_01r25oi._.js +1 -1
- package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_09z9-p7._.js +1 -1
- package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4v._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0e446gb._.js → [root-of-the-server]__00uwqi6._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0808sha._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0e4-6d8._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ehe24g._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0g253ve._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0k65l27._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0wprfyc._.js → [root-of-the-server]__0kjb_s4._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0vxf0_g._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12mcauo._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1mt35_w._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1pcxxwg._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1uvfwgr._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_11_p9y8._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_audit__components_audit-dashboard_tsx_0p9ud47._.js +49 -21
- package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_1kp6l3x._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_19dqvpc._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_html-to-image_es_index_0y4a-0q.js → node_modules_html-to-image_es_index_0ihmbv4.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_11bnuzn._.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +10 -10
- package/.next/standalone/.next/static/chunks/{3ty6dhcuogout.js → 02fywjt0by40a.js} +1 -1
- package/.next/standalone/.next/static/chunks/0xdx2ehtbdoeg.js +1 -0
- package/.next/standalone/.next/static/chunks/{07_d165p5h5ys.js → 1-a5rvq67k7ed.js} +1 -1
- package/.next/standalone/.next/static/chunks/{3nj6g3xu9uy78.js → 15csyj1_rf0-w.js} +1 -1
- package/.next/standalone/.next/static/chunks/1o0xa47736gi9.css +2 -0
- package/.next/standalone/.next/static/chunks/24cv31x607n7k.js +1 -0
- package/.next/standalone/.next/static/chunks/2n_s8v1ae38_a.js +69 -0
- package/.next/standalone/.next/static/chunks/{277oc363p56n6.js → 2y-jmvrjxz60x.js} +2 -2
- package/.next/standalone/.next/static/chunks/{1kvadxkgnapyj.js → 3eik_d9qrvoft.js} +1 -1
- package/.next/standalone/.next/static/chunks/{168k-8z6k7e8z.css → 3i27c3hcriawq.css} +1 -1
- package/.next/standalone/.next/static/chunks/{2z42u62k-8-_q.js → 3v61675vr6jav.js} +1 -1
- package/.next/standalone/app/api/audit/invite/route.ts +10 -1
- package/.next/standalone/app/api/audit/run/route.ts +35 -0
- package/.next/standalone/app/api/auth/login-request/route.ts +2 -2
- package/.next/standalone/app/api/auth/login-verify/route.ts +10 -2
- package/.next/standalone/app/audit/_components/audit-dashboard.tsx +9 -1
- package/.next/standalone/app/audit/_components/audit-poster.tsx +11 -7
- package/.next/standalone/app/audit/_components/auth-dialog.tsx +6 -4
- package/.next/standalone/app/audit/_components/come-back-better-section.tsx +23 -3
- package/.next/standalone/app/audit/_components/invite-dialog.tsx +6 -3
- package/.next/standalone/app/audit/_components/share-templates.ts +58 -28
- package/.next/standalone/app/audit/audit-styles.css +17 -22
- package/.next/standalone/app/globals.css +27 -2
- package/.next/standalone/app/policies/hooks-client.tsx +33 -24
- package/.next/standalone/components/reach-developers.tsx +10 -25
- package/.next/standalone/lib/auth/api-server-client.ts +5 -2
- package/.next/standalone/lib/client-telemetry.ts +4 -0
- package/.next/standalone/package.json +6 -4
- package/.next/standalone/server.js +1 -1
- package/README.md +2 -2
- package/bin/failproofai.mjs +24 -5
- package/dist/cli.mjs +2328 -381
- package/lib/auth/api-server-client.ts +5 -2
- package/lib/client-telemetry.ts +4 -0
- package/package.json +6 -4
- package/scripts/launch.ts +30 -4
- package/scripts/postinstall.mjs +10 -1
- package/scripts/skew-log-filter.ts +46 -0
- package/scripts/validate-mdx.ts +139 -0
- package/src/audit/cli.ts +330 -0
- package/src/audit/open-browser.ts +69 -0
- package/src/auth/cli.ts +16 -13
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1r1h8v9._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1uatkiv._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1y6gxxb._.js +0 -3
- package/.next/standalone/.next/static/chunks/28mkxkl_d91-l.js +0 -1
- package/.next/standalone/.next/static/chunks/28x7jvo3kxd3u.js +0 -41
- package/.next/standalone/.next/static/chunks/29nrs5xs9c4hx.css +0 -2
- package/.next/standalone/.next/static/chunks/29tg7deqmq32l.js +0 -1
- /package/.next/standalone/.next/static/{NYPiJP6Rv_exQdSFVS8HP → P_MIRSeoE296wkbE-Icin}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{NYPiJP6Rv_exQdSFVS8HP → P_MIRSeoE296wkbE-Icin}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{NYPiJP6Rv_exQdSFVS8HP → P_MIRSeoE296wkbE-Icin}/_ssgManifest.js +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[3171,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(
|
|
1
|
+
module.exports=[3171,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(72850),e=a.i(66036);a.s(["default",0,function({error:a,reset:f}){return(0,c.useEffect)(()=>{(0,d.getTelemetryConfig)().then(b=>{(0,e.setClientTelemetryConfig)(b),(0,e.captureClientEvent)("client_error",{error_message:a.message,error_name:a.name,error_digest:a.digest,boundary:"global"})}).catch(()=>{})},[a]),(0,b.jsx)("html",{children:(0,b.jsx)("body",{children:(0,b.jsx)("main",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",background:"#031035",color:"#f8fafc",fontFamily:"system-ui, sans-serif"},children:(0,b.jsxs)("div",{style:{textAlign:"center",padding:"2rem",border:"1px solid rgba(239,68,68,0.4)",borderRadius:"0.5rem",maxWidth:"500px"},children:[(0,b.jsx)("h2",{style:{color:"#ef4444",marginBottom:"0.5rem",fontSize:"1.25rem"},children:"Something went wrong"}),(0,b.jsx)("p",{style:{color:"#94a3b8",marginBottom:"1.5rem"},children:a.message||"An unexpected error occurred."}),(0,b.jsx)("button",{onClick:f,style:{padding:"0.5rem 1.25rem",background:"#3b82f6",color:"white",border:"none",borderRadius:"0.375rem",cursor:"pointer",fontSize:"0.875rem"},children:"Try again"})]})})})})}])}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=app_global-error_tsx_1kp6l3x._.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module.exports=[22712,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(35112),e=a.i(38246),f=a.i(64831);let g=(0,f.default)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),h=(0,f.default)("shield-x",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]]),i=(0,f.default)("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]),j=(0,f.default)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);var k=a.i(89027),l=a.i(85650),m=a.i(52562);let n=(0,f.default)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),o=(0,f.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);var p=a.i(74215),q=a.i(65967),r=a.i(5050);let s=(0,r.createServerReference)("40da347c09433ee1c4e890153b7f5f75d06682711a",r.callServer,void 0,r.findSourceMapURL,"getHookActivityAction"),t=(0,r.createServerReference)("60b0e5aa98daceeca9a18531da2c416c032df53de2",r.callServer,void 0,r.findSourceMapURL,"searchHookActivityAction"),u=(0,r.createServerReference)("004e864ec7f2c70fe05275742ff2781a1c6e01364f",r.callServer,void 0,r.findSourceMapURL,"getHooksConfigAction"),v=(0,r.createServerReference)("60069f82d13ff45cef142db0424a5d0d0c00d5b852",r.callServer,void 0,r.findSourceMapURL,"togglePolicyAction"),w=(0,r.createServerReference)("60912ce1e2ff35541ee8d09be3ac697c98a7f3a1b5",r.callServer,void 0,r.findSourceMapURL,"installHooksWebAction"),x=(0,r.createServerReference)("606e8c8f449762f4eab75ccde884303184a7700117",r.callServer,void 0,r.findSourceMapURL,"removeHooksWebAction"),y=(0,r.createServerReference)("6021e13e2c9e4d2aea70e465fc73cc59f6de0802ff",r.callServer,void 0,r.findSourceMapURL,"updatePolicyParamsAction");var z=a.i(6236),A=a.i(10765),B=a.i(90619),C=a.i(95947),D=a.i(87256),E=a.i(40695);function F({sessionId:a,transcriptPath:c,integration:d,cwd:f}){if(!a)return(0,b.jsx)("span",{className:"text-muted-foreground",children:"\\u2014"});let g=a?a.slice(0,8):"—",h="codex"===d||(c?.includes("/.codex/")??!1),i="copilot"===d||(c?.includes("/.copilot/session-state/")??!1),j="cursor"===d||(c?.includes("/.cursor/")??!1),k="opencode"===d||(c?.includes("/.local/share/opencode/")??!1)||(c?.includes("/.opencode/")??!1),l="pi"===d||(c?.includes("/.pi/")??!1),m="gemini"===d||(c?.includes("/.gemini/")??!1);if(h||i||j||k||l||m){let c,d=f?(c=/^([A-Za-z]):[\\/](.*)$/.exec(f))?c[1]+"--"+c[2].replace(/[\\/]/g,"-"):f.replace(/[\\/]/g,"-"):h?"codex":i?"copilot":j?"cursor":k?"opencode":l?"pi":"gemini";return(0,b.jsx)(e.default,{href:`/project/${encodeURIComponent(d)}/session/${encodeURIComponent(a)}`,className:"text-primary hover:underline font-mono",onClick:a=>a.stopPropagation(),children:g})}let n=c?function(a){let b=a.replace(/\\/g,"/").split("/").filter(Boolean);if(b.length<2)return null;let c=b[b.length-2];return!c||c.startsWith(".")?null:c}(c):null;return n?(0,b.jsx)(e.default,{href:`/project/${encodeURIComponent(n)}/session/${encodeURIComponent(a)}`,className:"text-primary hover:underline font-mono",onClick:a=>a.stopPropagation(),children:g}):(0,b.jsx)("span",{className:"text-muted-foreground font-mono",children:g})}function G({decision:a}){return"deny"===a?(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-red-500/10 text-red-400 border border-red-500/20",children:[(0,b.jsx)(h,{className:"h-3 w-3"}),"Deny"]}):"instruct"===a?(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-amber-500/10 text-amber-400 border border-amber-500/20",children:[(0,b.jsx)(i,{className:"h-3 w-3"}),"Instruct"]}):(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-emerald-500/10 text-emerald-400 border border-emerald-500/20",children:[(0,b.jsx)(g,{className:"h-3 w-3"}),"Allow"]})}function H({eventType:a}){return(0,b.jsx)("span",{className:"inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium bg-muted text-muted-foreground border border-border/50",children:a})}function I({integration:a}){if(!a)return null;let c=(0,D.getCliLabel)(a),d=(0,D.getCliBadgeClasses)(a);return(0,b.jsx)("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium border ${d}`,title:`Agent CLI: ${c}`,children:c})}function J({mode:a}){let c="default"===a;return(0,b.jsx)("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium border ${c?"bg-sky-500/10 text-sky-400 border-sky-500/20":"bg-amber-500/10 text-amber-400 border-amber-500/20"}`,children:a})}function K({ms:a}){return(0,b.jsx)("span",{className:`font-mono text-[0.7rem] ${a>500?"text-red-400":a>100?"text-amber-400":"text-muted-foreground"}`,children:a<1e3?`${a}ms`:`${(a/1e3).toFixed(1)}s`})}function L({text:a,field:d}){let[e,f]=(0,c.useState)(!1),{capture:g}=(0,A.usePostHog)(),h=async b=>{b.stopPropagation(),g("activity_copy_clicked",{field:d??"unknown"});try{await navigator.clipboard.writeText(a),f(!0),setTimeout(()=>f(!1),1500)}catch{let b=document.createElement("textarea");b.value=a,b.style.position="fixed",b.style.opacity="0",document.body.appendChild(b),b.select(),document.execCommand("copy"),document.body.removeChild(b),f(!0),setTimeout(()=>f(!1),1500)}};return(0,b.jsx)("button",{onClick:h,className:"inline-flex items-center justify-center h-5 w-5 rounded hover:bg-muted/50 text-muted-foreground hover:text-foreground transition-colors",title:"Copy",children:e?(0,b.jsx)(m.Check,{className:"h-3 w-3 text-emerald-400"}):(0,b.jsx)(l.Copy,{className:"h-3 w-3"})})}function M({value:a,onChange:c}){return(0,b.jsx)("div",{className:"inline-flex items-center rounded-md border border-border bg-muted/30 p-0.5",children:[{label:"All",value:""},{label:"Allow",value:"allow"},{label:"Instruct",value:"instruct"},{label:"Deny",value:"deny"}].map(d=>(0,b.jsx)("button",{onClick:()=>c(d.value),className:`px-2.5 py-1 text-[0.65rem] font-medium rounded transition-all ${a===d.value?"deny"===d.value?"bg-red-500/15 text-red-400 shadow-sm":"allow"===d.value?"bg-emerald-500/15 text-emerald-400 shadow-sm":"instruct"===d.value?"bg-amber-500/15 text-amber-400 shadow-sm":"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:d.label},d.value))})}function N({stats:a}){let c=a.totalEvents>0?a.denyCount/a.totalEvents*100:0,d=c.toFixed(c>=10?0:1),e=0===a.denyCount?"":c>=5?" is-deny":c>=2?" is-warn":"";return(0,b.jsxs)("div",{className:"stat-bar",role:"group","aria-label":"Activity stats",children:[(0,b.jsxs)("div",{className:"stat-cell",children:[(0,b.jsx)("span",{className:"eyebrow",children:"total events"}),(0,b.jsx)("span",{className:"value",children:a.totalEvents.toLocaleString()}),(0,b.jsx)("span",{className:"meta",children:"across all installed agents"})]}),(0,b.jsxs)("div",{className:"stat-cell",children:[(0,b.jsx)("span",{className:"eyebrow",children:"deny rate"}),(0,b.jsxs)("span",{className:`value${e}`,children:[d,"%"]}),(0,b.jsxs)("span",{className:"meta",children:[a.denyCount.toLocaleString()," of ",a.totalEvents.toLocaleString()," denied"]})]}),(0,b.jsxs)("div",{className:"stat-cell",children:[(0,b.jsx)("span",{className:"eyebrow",children:"top policy"}),(0,b.jsx)("span",{className:"value",style:{fontSize:16,fontWeight:500,color:a.topPolicy?"var(--accent-pink)":"var(--dim)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:a.topPolicy??void 0,children:a.topPolicy??"—"}),(0,b.jsx)("span",{className:"meta",children:"most-evaluated policy in scope"})]})]})}function O({item:a}){return(0,b.jsx)("tr",{children:(0,b.jsx)("td",{colSpan:11,className:"px-0 py-0",children:(0,b.jsxs)("div",{className:"activity-detail animate-expand text-xs",children:[(0,b.jsxs)("span",{className:"activity-detail-eyebrow",children:[(0,b.jsx)("span",{"aria-hidden":"true",children:"\\u25be"}),"event detail"]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Session ID: "}),(0,b.jsx)("span",{className:"font-mono text-foreground",children:a.sessionId??"—"}),a.sessionId&&(0,b.jsx)(L,{text:a.sessionId,field:"session_id"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"CWD: "}),(0,b.jsx)("span",{className:"font-mono text-foreground",children:a.cwd??"—"}),a.cwd&&(0,b.jsx)(L,{text:a.cwd,field:"cwd"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Transcript: "}),(0,b.jsx)("span",{className:"font-mono text-foreground break-all",children:a.transcriptPath??"—"}),a.transcriptPath?.startsWith("opencode-db://")&&(0,b.jsx)("span",{className:"text-muted-foreground ml-1",children:"(stored in opencode DB)"})]})]}),a.policyNames&&a.policyNames.length>1&&(0,b.jsxs)("div",{style:{marginTop:8},children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Policies: "}),(0,b.jsx)("span",{className:"font-mono text-foreground",children:a.policyNames.join(", ")})]}),a.reason&&(0,b.jsxs)("div",{style:{marginTop:8},children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Full reason: "}),(0,b.jsx)("span",{className:"text-foreground",children:a.reason})]})]})})})}function P({hooksInstalled:a,onSwitchTab:d}){let{intervalSec:e}=(0,z.useAutoRefresh)(),{capture:f}=(0,A.usePostHog)(),g=(0,B.useUrlParams)(),h=(0,c.useRef)(!1),[i,l]=(0,c.useState)(()=>(0,C.paramToPage)(g.get("page"))),[m,n]=(0,c.useState)(null),[o,p]=(0,c.useState)(null),[r,u]=(0,c.useState)(()=>{let a=g.get("decision");return"allow"===a||"deny"===a||"instruct"===a?a:""}),[v,w]=(0,c.useState)(()=>g.get("event")??""),[x,y]=(0,c.useState)(()=>g.get("policy")??""),[E,L]=(0,c.useState)(()=>g.get("session")??""),[Q,R]=(0,c.useState)(()=>{let a=g.get("cli");return(0,D.isKnownCli)(a)?a:""}),S=(0,c.useRef)(null),T=(0,c.useRef)(!0),U=(0,c.useRef)({filterDecision:r,filterEventType:v,filterPolicy:x,filterSessionId:E,filterCli:Q});U.current={filterDecision:r,filterEventType:v,filterPolicy:x,filterSessionId:E,filterCli:Q},(0,c.useEffect)(()=>{if(!h.current){h.current=!0;return}g.setAll({decision:r||void 0,event:v||void 0,policy:x||void 0,session:E||void 0,cli:Q||void 0,page:(0,C.pageToParam)(i)})},[r,v,x,E,Q,i]);let V=""!==r||""!==v||""!==x||""!==E||""!==Q,W=(0,c.useCallback)(async a=>{try{let b,{filterDecision:c,filterEventType:d,filterPolicy:e,filterSessionId:f,filterCli:g}=U.current;b=""!==c||""!==d||""!==e||""!==f||""!==g?await t({decision:c||void 0,eventType:d||void 0,policyName:e||void 0,sessionId:f||void 0,integration:g||void 0},a):await s(a),n(b)}catch{}},[]);(0,c.useEffect)(()=>{W(i);let a=setInterval(()=>W(i),e>0?1e3*e:5e3);return()=>clearInterval(a)},[i,W,e]),(0,c.useEffect)(()=>(S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{if(l(1),p(null),W(1),T.current){T.current=!1;return}f("activity_filter_changed",{active_filter_count:+(""!==r)+ +(""!==v)+ +(""!==x)+ +(""!==E)+ +(""!==Q),has_decision:""!==r,has_event_type:""!==v,has_policy:""!==x,has_session:""!==E,has_cli:""!==Q,decision:r||null,event_type:v||null,cli:Q||null})},300),()=>{S.current&&clearTimeout(S.current)}),[r,v,x,E,Q]);let X=m?.entries??[],Y=m?.totalPages??1;return(0,b.jsxs)(b.Fragment,{children:[m?.stats&&m.stats.totalEvents>0&&(0,b.jsx)("div",{style:{marginBottom:18},children:(0,b.jsx)(N,{stats:m.stats})}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"filter-bar",children:[(0,b.jsxs)("div",{className:"filter-group",children:[(0,b.jsx)("span",{className:"filter-label",children:"decision"}),(0,b.jsx)(M,{value:r,onChange:u})]}),(0,b.jsxs)("div",{className:"filter-group",children:[(0,b.jsx)("span",{className:"filter-label",children:"event"}),(0,b.jsxs)("select",{value:v,onChange:a=>w(a.target.value),className:"filter-input",children:[(0,b.jsx)("option",{value:"",children:"all events"}),(0,b.jsx)("option",{value:"PreToolUse",children:"PreToolUse"}),(0,b.jsx)("option",{value:"PostToolUse",children:"PostToolUse"}),(0,b.jsx)("option",{value:"SessionStart",children:"SessionStart"}),(0,b.jsx)("option",{value:"SessionEnd",children:"SessionEnd"}),(0,b.jsx)("option",{value:"UserPromptSubmit",children:"UserPromptSubmit"}),(0,b.jsx)("option",{value:"PermissionRequest",children:"PermissionRequest"})]})]}),(0,b.jsxs)("div",{className:"filter-group",children:[(0,b.jsx)("span",{className:"filter-label",children:"cli"}),(0,b.jsxs)("select",{value:Q,onChange:a=>{let b=a.target.value;R(""===b||(0,D.isKnownCli)(b)?b:"")},className:"filter-input","aria-label":"Filter by CLI",children:[(0,b.jsx)("option",{value:"",children:"all clis"}),D.KNOWN_CLI_IDS.map(a=>(0,b.jsx)("option",{value:a,children:(0,D.getCliLabel)(a)},a))]})]}),(0,b.jsxs)("div",{className:"filter-group filter-group--grow",children:[(0,b.jsx)("span",{className:"filter-label",children:"policy"}),(0,b.jsx)("input",{type:"text",value:x,onChange:a=>y(a.target.value),placeholder:"filter by policy\\u2026",className:"filter-input"})]}),(0,b.jsxs)("div",{className:"filter-group filter-group--grow",children:[(0,b.jsx)("span",{className:"filter-label",children:"session"}),(0,b.jsx)("input",{type:"text",value:E,onChange:a=>L(a.target.value),placeholder:"filter by session…",className:"filter-input"})]}),V&&(0,b.jsx)("button",{type:"button",className:"filter-clear",onClick:()=>{u(""),w(""),R(""),y(""),L("")},"aria-label":"Clear all filters",children:"[ clear ]"})]}),0===X.length?(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 px-4 text-center",children:[(0,b.jsx)(j,{className:"h-12 w-12 text-muted-foreground/30"}),!1===a?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("p",{className:"text-sm text-muted-foreground mt-4 font-medium",children:"Policies are not installed"}),(0,b.jsxs)("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:["Go to the"," ",(0,b.jsx)("button",{className:"underline hover:text-foreground transition-colors",onClick:()=>d?.("policies"),children:"Policies tab"})," ","and click ",(0,b.jsx)("span",{className:"font-mono bg-muted px-1 rounded",children:"Install"})," to enable policy monitoring."]})]}):(0,b.jsx)("p",{className:"text-sm text-muted-foreground mt-4",children:V?"No matching activity.":"Waiting for hook events…"})]}):(0,b.jsx)("div",{className:"overflow-x-auto activity-table-wrap",children:(0,b.jsxs)("table",{className:"w-full text-xs activity-table",style:{tableLayout:"fixed"},children:[(0,b.jsxs)("colgroup",{children:[(0,b.jsx)("col",{style:{width:32}}),(0,b.jsx)("col",{style:{width:"8%"}}),(0,b.jsx)("col",{style:{width:"8%"}}),(0,b.jsx)("col",{style:{width:"8%"}}),(0,b.jsx)("col",{style:{width:"7%"}}),(0,b.jsx)("col",{style:{width:"18%"}}),(0,b.jsx)("col",{style:{width:"22%"}}),(0,b.jsx)("col",{style:{width:"6%"}}),(0,b.jsx)("col",{style:{width:"8%"}}),(0,b.jsx)("col",{style:{width:"8%"}}),(0,b.jsx)("col",{style:{width:"7%"}})]}),(0,b.jsx)("thead",{className:"activity-thead",children:(0,b.jsxs)("tr",{children:[(0,b.jsx)("th",{className:"px-4 py-3"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Decision"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Event"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"CLI"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Tool"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Policy"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Reason"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Duration"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Session"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Mode"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th text-right",children:"Time"})]})}),(0,b.jsx)("tbody",{className:"divide-y divide-border/30",children:X.map((a,d)=>{var e;let g,h="deny"===a.decision,i=o===d,j="instruct"===a.decision;return(0,b.jsxs)(c.default.Fragment,{children:[(0,b.jsxs)("tr",{onClick:()=>{p(a=>{let b=a===d?null:d,c=X[d];return f("activity_row_toggled",{expanded:null!==b,decision:c?.decision??null,policy_name:c?.policyName??null,event_type:c?.eventType??null}),b})},className:`cursor-pointer transition-colors ${h?"bg-red-500/[0.03] hover:bg-red-500/[0.07] border-l-2 border-l-red-500/40":j?"bg-amber-500/[0.03] hover:bg-amber-500/[0.07] border-l-2 border-l-amber-500/40":d%2==0?"hover:bg-muted/30":"bg-muted/[0.04] hover:bg-muted/30"} ${i?"bg-muted/20":""}`,children:[(0,b.jsx)("td",{className:"px-4 py-2",children:(0,b.jsx)(k.ChevronDown,{className:`h-3.5 w-3.5 text-muted-foreground transition-transform duration-150 ${i?"rotate-0":"-rotate-90"}`})}),(0,b.jsx)("td",{className:"px-3 py-2",children:(0,b.jsx)(G,{decision:a.decision})}),(0,b.jsx)("td",{className:"px-3 py-2",children:(0,b.jsx)(H,{eventType:a.eventType})}),(0,b.jsx)("td",{className:"px-3 py-2",children:(0,b.jsx)(I,{integration:a.integration})}),(0,b.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:a.toolName??"—"}),(0,b.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:a.policyNames&&a.policyNames.length>1?(0,b.jsxs)("span",{title:a.policyNames.join(", "),children:[a.policyNames[0],(0,b.jsxs)("span",{className:"text-muted-foreground text-[0.6rem]",children:[" +",a.policyNames.length-1]})]}):a.policyName??"—"}),(0,b.jsx)("td",{className:"px-3 py-2 text-muted-foreground truncate",title:a.reason??"",children:a.reason??"—"}),(0,b.jsx)("td",{className:"px-3 py-2",children:(0,b.jsx)(K,{ms:a.durationMs})}),(0,b.jsx)("td",{className:"px-3 py-2",title:a.sessionId??"",children:(0,b.jsx)(F,{sessionId:a.sessionId,transcriptPath:a.transcriptPath,integration:a.integration,cwd:a.cwd})}),(0,b.jsx)("td",{className:"px-3 py-2",children:a.permissionMode?(0,b.jsx)(J,{mode:a.permissionMode}):"—"}),(0,b.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground whitespace-nowrap",title:new Date(a.timestamp).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),children:(e=a.timestamp,(g=Date.now()-e)<6e4?`${Math.max(1,Math.floor(g/1e3))}s ago`:g<36e5?`${Math.floor(g/6e4)}m ago`:g<864e5?`${Math.floor(g/36e5)}h ago`:`${Math.floor(g/864e5)}d ago`)})]}),i&&(0,b.jsx)(O,{item:a})]},`${a.timestamp}-${d}`)})})]})}),(0,b.jsx)(q.default,{currentPage:i,totalPages:Y,onPageChange:a=>{f("activity_pagination_changed",{from_page:i,to_page:a,total_pages:Y}),l(a),p(null)}})]})]})}function Q({enabled:a,onChange:c,disabled:d}){return(0,b.jsx)("button",{onClick:c,disabled:d,className:`relative inline-flex h-4 w-7 shrink-0 items-center rounded-full transition-colors disabled:opacity-40 ${a?"bg-emerald-500":"bg-muted-foreground/30"}`,"aria-label":a?"Disable policy":"Enable policy",children:(0,b.jsx)("span",{className:`inline-block h-3 w-3 rounded-full bg-white shadow transition-transform ${a?"translate-x-3.5":"translate-x-0.5"}`})})}function R({policy:a,onClose:d,onSave:e}){let f=a.params??{},g=a.currentParams??{},[h,i]=(0,c.useState)(()=>{let a={};for(let[b,c]of Object.entries(f)){let d=b in g?g[b]:c.default;a[b]=d}return a});(0,c.useEffect)(()=>{let a=a=>{"Escape"===a.key&&d()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[d]);let j=(a,b)=>{i(c=>({...c,[a]:b}))};return(0,b.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:a=>{a.target===a.currentTarget&&d()},children:(0,b.jsxs)("div",{className:"bg-card border border-border rounded-lg shadow-xl w-full max-w-lg mx-4 max-h-[80vh] flex flex-col",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-sm font-mono font-semibold text-foreground",children:a.name}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:a.description})]}),(0,b.jsx)("button",{onClick:d,className:"text-muted-foreground hover:text-foreground transition-colors",children:(0,b.jsx)(p.X,{className:"h-4 w-4"})})]}),(0,b.jsx)("div",{className:"overflow-y-auto flex-1 px-4 py-4 space-y-4",children:Object.entries(f).map(([a,c])=>(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"block text-xs font-semibold text-foreground mb-1 font-mono",children:a}),(0,b.jsx)("p",{className:"text-[0.65rem] text-muted-foreground mb-1.5",children:c.description}),((a,c)=>{let d=h[a];if("boolean"===c.type)return(0,b.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,b.jsx)("input",{type:"checkbox",checked:!!d,onChange:b=>j(a,b.target.checked),className:"rounded border-border"}),(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:c.description})]});if("number"===c.type)return(0,b.jsx)("input",{type:"number",value:"number"==typeof d?d:"",onChange:b=>j(a,Number(b.target.value)),className:"w-full h-7 rounded border border-border bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-primary/40"});if("string[]"===c.type){let c=Array.isArray(d)?d.join("\n"):"";return(0,b.jsx)("textarea",{value:c,onChange:b=>j(a,b.target.value.split("\n").filter(a=>""!==a.trim())),rows:4,placeholder:"One entry per line",className:"w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground font-mono focus:outline-none focus:ring-2 focus:ring-primary/40 resize-y"})}if("pattern[]"===c.type){let c=Array.isArray(d)?d:[];return(0,b.jsxs)("div",{className:"space-y-1.5",children:[c.map((d,e)=>(0,b.jsxs)("div",{className:"flex gap-1.5 items-center",children:[(0,b.jsx)("input",{type:"text",value:d.regex,onChange:b=>{let d=[...c];d[e]={...d[e],regex:b.target.value},j(a,d)},placeholder:"regex",className:"flex-1 h-6 rounded border border-border bg-background px-2 text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/40"}),(0,b.jsx)("input",{type:"text",value:d.label,onChange:b=>{let d=[...c];d[e]={...d[e],label:b.target.value},j(a,d)},placeholder:"label",className:"flex-1 h-6 rounded border border-border bg-background px-2 text-xs focus:outline-none focus:ring-2 focus:ring-primary/40"}),(0,b.jsx)("button",{onClick:()=>j(a,c.filter((a,b)=>b!==e)),className:"text-muted-foreground/50 hover:text-destructive transition-colors",children:(0,b.jsx)(p.X,{className:"h-3.5 w-3.5"})})]},e)),(0,b.jsx)("button",{onClick:()=>j(a,[...c,{regex:"",label:""}]),className:"text-xs text-primary hover:underline",children:"+ Add pattern"})]})}return(0,b.jsx)("input",{type:"text",value:"string"==typeof d?d:"",onChange:b=>j(a,b.target.value),className:"w-full h-7 rounded border border-border bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-primary/40"})})(a,c)]},a))}),(0,b.jsxs)("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-border",children:[(0,b.jsx)(E.Button,{variant:"outline",size:"sm",onClick:d,className:"h-7 text-xs",children:"Cancel"}),(0,b.jsx)(E.Button,{size:"sm",onClick:()=>e(h),className:"h-7 text-xs",children:"Save"})]})]})})}function S({message:a,onDismiss:c,onInstall:e,isPending:f}){let{capture:g}=(0,A.usePostHog)();return(0,d.createPortal)((0,b.jsxs)("div",{className:"fixed top-4 right-4 z-[9999] w-full max-w-sm",style:{animation:"slideInFromRight 0.25s ease-out"},children:[(0,b.jsx)("style",{children:`
|
|
1
|
+
module.exports=[22712,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(35112),e=a.i(38246),f=a.i(64831);let g=(0,f.default)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),h=(0,f.default)("shield-x",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]]),i=(0,f.default)("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]),j=(0,f.default)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);var k=a.i(89027),l=a.i(85650),m=a.i(52562);let n=(0,f.default)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),o=(0,f.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);var p=a.i(74215),q=a.i(65967),r=a.i(5050);let s=(0,r.createServerReference)("40cb578545ca16ca272e6cee536a1beb6ced1c20ae",r.callServer,void 0,r.findSourceMapURL,"getHookActivityAction"),t=(0,r.createServerReference)("60eae94ef10c13087319d3480f89e7ea4be834c6a7",r.callServer,void 0,r.findSourceMapURL,"searchHookActivityAction"),u=(0,r.createServerReference)("003575adc273e606668952bb88c9184fcc3702802e",r.callServer,void 0,r.findSourceMapURL,"getHooksConfigAction"),v=(0,r.createServerReference)("60ec1a66cf2a3594ef1af92d3d418b15bc54ace115",r.callServer,void 0,r.findSourceMapURL,"togglePolicyAction"),w=(0,r.createServerReference)("606410946ffa73db43321f1a4d00c39e8fc7bc8d18",r.callServer,void 0,r.findSourceMapURL,"installHooksWebAction"),x=(0,r.createServerReference)("60c9a0adaa922c76bedb3585258e25f0c4f003dc9e",r.callServer,void 0,r.findSourceMapURL,"removeHooksWebAction"),y=(0,r.createServerReference)("60d1f0ebc4b5811aab92442996d5e987130d9714de",r.callServer,void 0,r.findSourceMapURL,"updatePolicyParamsAction");var z=a.i(6236),A=a.i(10765),B=a.i(90619),C=a.i(95947),D=a.i(87256),E=a.i(40695);function F({sessionId:a,transcriptPath:c,integration:d,cwd:f}){if(!a)return(0,b.jsx)("span",{className:"text-muted-foreground",children:"\\u2014"});let g=a?a.slice(0,8):"—",h="codex"===d||(c?.includes("/.codex/")??!1),i="copilot"===d||(c?.includes("/.copilot/session-state/")??!1),j="cursor"===d||(c?.includes("/.cursor/")??!1),k="opencode"===d||(c?.includes("/.local/share/opencode/")??!1)||(c?.includes("/.opencode/")??!1),l="pi"===d||(c?.includes("/.pi/")??!1),m="gemini"===d||(c?.includes("/.gemini/")??!1);if(h||i||j||k||l||m){let c,d=f?(c=/^([A-Za-z]):[\\/](.*)$/.exec(f))?c[1]+"--"+c[2].replace(/[\\/]/g,"-"):f.replace(/[\\/]/g,"-"):h?"codex":i?"copilot":j?"cursor":k?"opencode":l?"pi":"gemini";return(0,b.jsx)(e.default,{href:`/project/${encodeURIComponent(d)}/session/${encodeURIComponent(a)}`,className:"text-primary hover:underline font-mono",onClick:a=>a.stopPropagation(),children:g})}let n=c?function(a){let b=a.replace(/\\/g,"/").split("/").filter(Boolean);if(b.length<2)return null;let c=b[b.length-2];return!c||c.startsWith(".")?null:c}(c):null;return n?(0,b.jsx)(e.default,{href:`/project/${encodeURIComponent(n)}/session/${encodeURIComponent(a)}`,className:"text-primary hover:underline font-mono",onClick:a=>a.stopPropagation(),children:g}):(0,b.jsx)("span",{className:"text-muted-foreground font-mono",children:g})}function G({decision:a}){return"deny"===a?(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-red-500/10 text-red-400 border border-red-500/20",children:[(0,b.jsx)(h,{className:"h-3 w-3"}),"Deny"]}):"instruct"===a?(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-amber-500/10 text-amber-400 border border-amber-500/20",children:[(0,b.jsx)(i,{className:"h-3 w-3"}),"Instruct"]}):(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-emerald-500/10 text-emerald-400 border border-emerald-500/20",children:[(0,b.jsx)(g,{className:"h-3 w-3"}),"Allow"]})}function H({eventType:a}){return(0,b.jsx)("span",{className:"inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium bg-muted text-muted-foreground border border-border/50",children:a})}function I({integration:a}){if(!a)return null;let c=(0,D.getCliLabel)(a),d=(0,D.getCliBadgeClasses)(a);return(0,b.jsx)("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium border ${d}`,title:`Agent CLI: ${c}`,children:c})}function J({mode:a}){let c="default"===a;return(0,b.jsx)("span",{title:a,className:`inline-block max-w-full truncate rounded px-1.5 py-0.5 align-middle text-[0.6rem] font-medium border ${c?"bg-sky-500/10 text-sky-400 border-sky-500/20":"bg-amber-500/10 text-amber-400 border-amber-500/20"}`,children:a})}function K({ms:a}){return(0,b.jsx)("span",{className:`font-mono text-[0.7rem] ${a>500?"text-red-400":a>100?"text-amber-400":"text-muted-foreground"}`,children:a<1e3?`${a}ms`:`${(a/1e3).toFixed(1)}s`})}function L({text:a,field:d}){let[e,f]=(0,c.useState)(!1),{capture:g}=(0,A.usePostHog)(),h=async b=>{b.stopPropagation(),g("activity_copy_clicked",{field:d??"unknown"});try{await navigator.clipboard.writeText(a),f(!0),setTimeout(()=>f(!1),1500)}catch{let b=document.createElement("textarea");b.value=a,b.style.position="fixed",b.style.opacity="0",document.body.appendChild(b),b.select(),document.execCommand("copy"),document.body.removeChild(b),f(!0),setTimeout(()=>f(!1),1500)}};return(0,b.jsx)("button",{onClick:h,className:"inline-flex items-center justify-center h-5 w-5 rounded hover:bg-muted/50 text-muted-foreground hover:text-foreground transition-colors",title:"Copy",children:e?(0,b.jsx)(m.Check,{className:"h-3 w-3 text-emerald-400"}):(0,b.jsx)(l.Copy,{className:"h-3 w-3"})})}function M({value:a,onChange:c}){return(0,b.jsx)("div",{className:"inline-flex items-center rounded-md border border-border bg-muted/30 p-0.5",children:[{label:"All",value:""},{label:"Allow",value:"allow"},{label:"Instruct",value:"instruct"},{label:"Deny",value:"deny"}].map(d=>(0,b.jsx)("button",{onClick:()=>c(d.value),className:`px-2.5 py-1 text-[0.65rem] font-medium rounded transition-all ${a===d.value?"deny"===d.value?"bg-red-500/15 text-red-400 shadow-sm":"allow"===d.value?"bg-emerald-500/15 text-emerald-400 shadow-sm":"instruct"===d.value?"bg-amber-500/15 text-amber-400 shadow-sm":"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:d.label},d.value))})}function N({stats:a}){let c=a.totalEvents>0?a.denyCount/a.totalEvents*100:0,d=c.toFixed(c>=10?0:1),e=0===a.denyCount?"":c>=5?" is-deny":c>=2?" is-warn":"";return(0,b.jsxs)("div",{className:"stat-bar",role:"group","aria-label":"Activity stats",children:[(0,b.jsxs)("div",{className:"stat-cell",children:[(0,b.jsx)("span",{className:"eyebrow",children:"total events"}),(0,b.jsx)("span",{className:"value",children:a.totalEvents.toLocaleString()}),(0,b.jsx)("span",{className:"meta",children:"across all installed agents"})]}),(0,b.jsxs)("div",{className:"stat-cell",children:[(0,b.jsx)("span",{className:"eyebrow",children:"deny rate"}),(0,b.jsxs)("span",{className:`value${e}`,children:[d,"%"]}),(0,b.jsxs)("span",{className:"meta",children:[a.denyCount.toLocaleString()," of ",a.totalEvents.toLocaleString()," denied"]})]}),(0,b.jsxs)("div",{className:"stat-cell",children:[(0,b.jsx)("span",{className:"eyebrow",children:"top policy"}),(0,b.jsx)("span",{className:"value",style:{fontSize:16,fontWeight:500,color:a.topPolicy?"var(--accent-pink)":"var(--dim)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:a.topPolicy??void 0,children:a.topPolicy??"—"}),(0,b.jsx)("span",{className:"meta",children:"most-evaluated policy in scope"})]})]})}function O({item:a}){return(0,b.jsx)("tr",{children:(0,b.jsx)("td",{colSpan:11,className:"px-0 py-0",children:(0,b.jsxs)("div",{className:"activity-detail animate-expand text-xs",children:[(0,b.jsxs)("span",{className:"activity-detail-eyebrow",children:[(0,b.jsx)("span",{"aria-hidden":"true",children:"\\u25be"}),"event detail"]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Session ID: "}),(0,b.jsx)("span",{className:"font-mono text-foreground",children:a.sessionId??"—"}),a.sessionId&&(0,b.jsx)(L,{text:a.sessionId,field:"session_id"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"CWD: "}),(0,b.jsx)("span",{className:"font-mono text-foreground",children:a.cwd??"—"}),a.cwd&&(0,b.jsx)(L,{text:a.cwd,field:"cwd"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Transcript: "}),(0,b.jsx)("span",{className:"font-mono text-foreground break-all",children:a.transcriptPath??"—"}),a.transcriptPath?.startsWith("opencode-db://")&&(0,b.jsx)("span",{className:"text-muted-foreground ml-1",children:"(stored in opencode DB)"})]})]}),a.policyNames&&a.policyNames.length>1&&(0,b.jsxs)("div",{style:{marginTop:8},children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Policies: "}),(0,b.jsx)("span",{className:"font-mono text-foreground",children:a.policyNames.join(", ")})]}),a.reason&&(0,b.jsxs)("div",{style:{marginTop:8},children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Full reason: "}),(0,b.jsx)("span",{className:"text-foreground",children:a.reason})]})]})})})}function P({hooksInstalled:a,onSwitchTab:d}){let{intervalSec:e}=(0,z.useAutoRefresh)(),{capture:f}=(0,A.usePostHog)(),g=(0,B.useUrlParams)(),h=(0,c.useRef)(!1),[i,l]=(0,c.useState)(()=>(0,C.paramToPage)(g.get("page"))),[m,n]=(0,c.useState)(null),[o,p]=(0,c.useState)(null),[r,u]=(0,c.useState)(()=>{let a=g.get("decision");return"allow"===a||"deny"===a||"instruct"===a?a:""}),[v,w]=(0,c.useState)(()=>g.get("event")??""),[x,y]=(0,c.useState)(()=>g.get("policy")??""),[E,L]=(0,c.useState)(()=>g.get("session")??""),[Q,R]=(0,c.useState)(()=>{let a=g.get("cli");return(0,D.isKnownCli)(a)?a:""}),S=(0,c.useRef)(null),T=(0,c.useRef)(!0),U=(0,c.useRef)({filterDecision:r,filterEventType:v,filterPolicy:x,filterSessionId:E,filterCli:Q});U.current={filterDecision:r,filterEventType:v,filterPolicy:x,filterSessionId:E,filterCli:Q},(0,c.useEffect)(()=>{if(!h.current){h.current=!0;return}g.setAll({decision:r||void 0,event:v||void 0,policy:x||void 0,session:E||void 0,cli:Q||void 0,page:(0,C.pageToParam)(i)})},[r,v,x,E,Q,i]);let V=""!==r||""!==v||""!==x||""!==E||""!==Q,W=(0,c.useCallback)(async a=>{try{let b,{filterDecision:c,filterEventType:d,filterPolicy:e,filterSessionId:f,filterCli:g}=U.current;b=""!==c||""!==d||""!==e||""!==f||""!==g?await t({decision:c||void 0,eventType:d||void 0,policyName:e||void 0,sessionId:f||void 0,integration:g||void 0},a):await s(a),n(b)}catch{}},[]);(0,c.useEffect)(()=>{W(i);let a=setInterval(()=>W(i),e>0?1e3*e:5e3);return()=>clearInterval(a)},[i,W,e]),(0,c.useEffect)(()=>(S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{if(l(1),p(null),W(1),T.current){T.current=!1;return}f("activity_filter_changed",{active_filter_count:+(""!==r)+ +(""!==v)+ +(""!==x)+ +(""!==E)+ +(""!==Q),has_decision:""!==r,has_event_type:""!==v,has_policy:""!==x,has_session:""!==E,has_cli:""!==Q,decision:r||null,event_type:v||null,cli:Q||null})},300),()=>{S.current&&clearTimeout(S.current)}),[r,v,x,E,Q]);let X=m?.entries??[],Y=m?.totalPages??1;return(0,b.jsxs)(b.Fragment,{children:[m?.stats&&m.stats.totalEvents>0&&(0,b.jsx)("div",{style:{marginBottom:18},children:(0,b.jsx)(N,{stats:m.stats})}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"filter-bar",children:[(0,b.jsxs)("div",{className:"filter-group",children:[(0,b.jsx)("span",{className:"filter-label",children:"decision"}),(0,b.jsx)(M,{value:r,onChange:u})]}),(0,b.jsxs)("div",{className:"filter-group",children:[(0,b.jsx)("span",{className:"filter-label",children:"event"}),(0,b.jsxs)("select",{value:v,onChange:a=>w(a.target.value),className:"filter-input",children:[(0,b.jsx)("option",{value:"",children:"all events"}),(0,b.jsx)("option",{value:"PreToolUse",children:"PreToolUse"}),(0,b.jsx)("option",{value:"PostToolUse",children:"PostToolUse"}),(0,b.jsx)("option",{value:"SessionStart",children:"SessionStart"}),(0,b.jsx)("option",{value:"SessionEnd",children:"SessionEnd"}),(0,b.jsx)("option",{value:"UserPromptSubmit",children:"UserPromptSubmit"}),(0,b.jsx)("option",{value:"PermissionRequest",children:"PermissionRequest"})]})]}),(0,b.jsxs)("div",{className:"filter-group",children:[(0,b.jsx)("span",{className:"filter-label",children:"cli"}),(0,b.jsxs)("select",{value:Q,onChange:a=>{let b=a.target.value;R(""===b||(0,D.isKnownCli)(b)?b:"")},className:"filter-input","aria-label":"Filter by CLI",children:[(0,b.jsx)("option",{value:"",children:"all clis"}),D.KNOWN_CLI_IDS.map(a=>(0,b.jsx)("option",{value:a,children:(0,D.getCliLabel)(a)},a))]})]}),(0,b.jsxs)("div",{className:"filter-group filter-group--grow",children:[(0,b.jsx)("span",{className:"filter-label",children:"policy"}),(0,b.jsx)("input",{type:"text",value:x,onChange:a=>y(a.target.value),placeholder:"filter by policy\\u2026",className:"filter-input"})]}),(0,b.jsxs)("div",{className:"filter-group filter-group--grow",children:[(0,b.jsx)("span",{className:"filter-label",children:"session"}),(0,b.jsx)("input",{type:"text",value:E,onChange:a=>L(a.target.value),placeholder:"filter by session…",className:"filter-input"})]}),V&&(0,b.jsx)("button",{type:"button",className:"filter-clear",onClick:()=>{u(""),w(""),R(""),y(""),L("")},"aria-label":"Clear all filters",children:"[ clear ]"})]}),0===X.length?(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 px-4 text-center",children:[(0,b.jsx)(j,{className:"h-12 w-12 text-muted-foreground/30"}),!1===a?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("p",{className:"text-sm text-muted-foreground mt-4 font-medium",children:"Policies are not installed"}),(0,b.jsxs)("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:["Go to the"," ",(0,b.jsx)("button",{className:"underline hover:text-foreground transition-colors",onClick:()=>d?.("policies"),children:"Policies tab"})," ","and click ",(0,b.jsx)("span",{className:"font-mono bg-muted px-1 rounded",children:"Install"})," to enable policy monitoring."]})]}):(0,b.jsx)("p",{className:"text-sm text-muted-foreground mt-4",children:V?"No matching activity.":"Waiting for hook events…"})]}):(0,b.jsx)("div",{className:"overflow-x-auto activity-table-wrap",children:(0,b.jsxs)("table",{className:"w-full text-xs activity-table",style:{tableLayout:"fixed"},children:[(0,b.jsxs)("colgroup",{children:[(0,b.jsx)("col",{style:{width:32}}),(0,b.jsx)("col",{style:{width:"7%"}}),(0,b.jsx)("col",{style:{width:"9%"}}),(0,b.jsx)("col",{style:{width:"12%"}}),(0,b.jsx)("col",{style:{width:"11%"}}),(0,b.jsx)("col",{style:{width:"9%"}}),(0,b.jsx)("col",{style:{width:"13%"}}),(0,b.jsx)("col",{style:{width:"12%"}}),(0,b.jsx)("col",{style:{width:"11%"}}),(0,b.jsx)("col",{style:{width:"8%"}}),(0,b.jsx)("col",{style:{width:"8%"}})]}),(0,b.jsx)("thead",{className:"activity-thead",children:(0,b.jsxs)("tr",{children:[(0,b.jsx)("th",{className:"px-4 py-3"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Time"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Decision"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Event"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"CLI"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Tool"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Policy"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Reason"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Mode"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Duration"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Session"})]})}),(0,b.jsx)("tbody",{className:"divide-y divide-border/30",children:X.map((a,d)=>{var e;let g,h="deny"===a.decision,i=o===d,j="instruct"===a.decision;return(0,b.jsxs)(c.default.Fragment,{children:[(0,b.jsxs)("tr",{onClick:()=>{p(a=>{let b=a===d?null:d,c=X[d];return f("activity_row_toggled",{expanded:null!==b,decision:c?.decision??null,policy_name:c?.policyName??null,event_type:c?.eventType??null}),b})},className:`activity-data-row cursor-pointer transition-colors ${h?"bg-red-500/[0.03] hover:bg-red-500/[0.07] border-l-2 border-l-red-500/40":j?"bg-amber-500/[0.03] hover:bg-amber-500/[0.07] border-l-2 border-l-amber-500/40":d%2==0?"hover:bg-muted/30":"bg-muted/[0.04] hover:bg-muted/30"} ${i?"bg-muted/20":""}`,children:[(0,b.jsx)("td",{className:"px-4 py-2",children:(0,b.jsx)(k.ChevronDown,{className:`h-3.5 w-3.5 text-muted-foreground transition-transform duration-150 ${i?"rotate-0":"-rotate-90"}`})}),(0,b.jsx)("td",{className:"px-3 py-2 text-muted-foreground whitespace-nowrap",title:new Date(a.timestamp).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),children:(e=a.timestamp,(g=Date.now()-e)<6e4?`${Math.max(1,Math.floor(g/1e3))}s ago`:g<36e5?`${Math.floor(g/6e4)}m ago`:g<864e5?`${Math.floor(g/36e5)}h ago`:`${Math.floor(g/864e5)}d ago`)}),(0,b.jsx)("td",{className:"px-3 py-2",children:(0,b.jsx)(G,{decision:a.decision})}),(0,b.jsx)("td",{className:"px-3 py-2",children:(0,b.jsx)(H,{eventType:a.eventType})}),(0,b.jsx)("td",{className:"px-3 py-2",children:(0,b.jsx)(I,{integration:a.integration})}),(0,b.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:a.toolName??"—"}),(0,b.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:a.policyNames&&a.policyNames.length>1?(0,b.jsxs)("span",{title:a.policyNames.join(", "),children:[a.policyNames[0],(0,b.jsxs)("span",{className:"text-muted-foreground text-[0.6rem]",children:[" +",a.policyNames.length-1]})]}):a.policyName??"—"}),(0,b.jsx)("td",{className:"px-3 py-2 text-muted-foreground truncate",title:a.reason??"",children:a.reason??"—"}),(0,b.jsx)("td",{className:"px-3 py-2",children:a.permissionMode?(0,b.jsx)(J,{mode:a.permissionMode}):"—"}),(0,b.jsx)("td",{className:"px-3 py-2",children:(0,b.jsx)(K,{ms:a.durationMs})}),(0,b.jsx)("td",{className:"px-3 py-2",title:a.sessionId??"",children:(0,b.jsx)(F,{sessionId:a.sessionId,transcriptPath:a.transcriptPath,integration:a.integration,cwd:a.cwd})})]}),i&&(0,b.jsx)(O,{item:a})]},`${a.timestamp}-${d}`)})})]})}),(0,b.jsx)(q.default,{currentPage:i,totalPages:Y,onPageChange:a=>{f("activity_pagination_changed",{from_page:i,to_page:a,total_pages:Y}),l(a),p(null)}})]})]})}function Q({enabled:a,onChange:c,disabled:d}){return(0,b.jsx)("button",{onClick:c,disabled:d,className:`relative inline-flex h-4 w-7 shrink-0 items-center rounded-full transition-colors disabled:opacity-40 ${a?"bg-emerald-500":"bg-muted-foreground/30"}`,"aria-label":a?"Disable policy":"Enable policy",children:(0,b.jsx)("span",{className:`inline-block h-3 w-3 rounded-full bg-white shadow transition-transform ${a?"translate-x-3.5":"translate-x-0.5"}`})})}function R({policy:a,onClose:d,onSave:e}){let f=a.params??{},g=a.currentParams??{},[h,i]=(0,c.useState)(()=>{let a={};for(let[b,c]of Object.entries(f)){let d=b in g?g[b]:c.default;a[b]=d}return a});(0,c.useEffect)(()=>{let a=a=>{"Escape"===a.key&&d()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[d]);let j=(a,b)=>{i(c=>({...c,[a]:b}))};return(0,b.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:a=>{a.target===a.currentTarget&&d()},children:(0,b.jsxs)("div",{className:"bg-card border border-border rounded-lg shadow-xl w-full max-w-lg mx-4 max-h-[80vh] flex flex-col",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-sm font-mono font-semibold text-foreground",children:a.name}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:a.description})]}),(0,b.jsx)("button",{onClick:d,className:"text-muted-foreground hover:text-foreground transition-colors",children:(0,b.jsx)(p.X,{className:"h-4 w-4"})})]}),(0,b.jsx)("div",{className:"overflow-y-auto flex-1 px-4 py-4 space-y-4",children:Object.entries(f).map(([a,c])=>(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"block text-xs font-semibold text-foreground mb-1 font-mono",children:a}),(0,b.jsx)("p",{className:"text-[0.65rem] text-muted-foreground mb-1.5",children:c.description}),((a,c)=>{let d=h[a];if("boolean"===c.type)return(0,b.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,b.jsx)("input",{type:"checkbox",checked:!!d,onChange:b=>j(a,b.target.checked),className:"rounded border-border"}),(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:c.description})]});if("number"===c.type)return(0,b.jsx)("input",{type:"number",value:"number"==typeof d?d:"",onChange:b=>j(a,Number(b.target.value)),className:"w-full h-7 rounded border border-border bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-primary/40"});if("string[]"===c.type){let c=Array.isArray(d)?d.join("\n"):"";return(0,b.jsx)("textarea",{value:c,onChange:b=>j(a,b.target.value.split("\n").filter(a=>""!==a.trim())),rows:4,placeholder:"One entry per line",className:"w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground font-mono focus:outline-none focus:ring-2 focus:ring-primary/40 resize-y"})}if("pattern[]"===c.type){let c=Array.isArray(d)?d:[];return(0,b.jsxs)("div",{className:"space-y-1.5",children:[c.map((d,e)=>(0,b.jsxs)("div",{className:"flex gap-1.5 items-center",children:[(0,b.jsx)("input",{type:"text",value:d.regex,onChange:b=>{let d=[...c];d[e]={...d[e],regex:b.target.value},j(a,d)},placeholder:"regex",className:"flex-1 h-6 rounded border border-border bg-background px-2 text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/40"}),(0,b.jsx)("input",{type:"text",value:d.label,onChange:b=>{let d=[...c];d[e]={...d[e],label:b.target.value},j(a,d)},placeholder:"label",className:"flex-1 h-6 rounded border border-border bg-background px-2 text-xs focus:outline-none focus:ring-2 focus:ring-primary/40"}),(0,b.jsx)("button",{onClick:()=>j(a,c.filter((a,b)=>b!==e)),className:"text-muted-foreground/50 hover:text-destructive transition-colors",children:(0,b.jsx)(p.X,{className:"h-3.5 w-3.5"})})]},e)),(0,b.jsx)("button",{onClick:()=>j(a,[...c,{regex:"",label:""}]),className:"text-xs text-primary hover:underline",children:"+ Add pattern"})]})}return(0,b.jsx)("input",{type:"text",value:"string"==typeof d?d:"",onChange:b=>j(a,b.target.value),className:"w-full h-7 rounded border border-border bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-primary/40"})})(a,c)]},a))}),(0,b.jsxs)("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-border",children:[(0,b.jsx)(E.Button,{variant:"outline",size:"sm",onClick:d,className:"h-7 text-xs",children:"Cancel"}),(0,b.jsx)(E.Button,{size:"sm",onClick:()=>e(h),className:"h-7 text-xs",children:"Save"})]})]})})}function S({message:a,onDismiss:c,onInstall:e,isPending:f}){let{capture:g}=(0,A.usePostHog)();return(0,d.createPortal)((0,b.jsxs)("div",{className:"fixed top-4 right-4 z-[9999] w-full max-w-sm",style:{animation:"slideInFromRight 0.25s ease-out"},children:[(0,b.jsx)("style",{children:`
|
|
2
2
|
@keyframes slideInFromRight {
|
|
3
3
|
from { transform: translateX(calc(100% + 1rem)); opacity: 0; }
|
|
4
4
|
to { transform: translateX(0); opacity: 1; }
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
module.exports=[3900,a=>{a.v(b=>Promise.all(["server/chunks/ssr/node_modules_html-to-image_es_index_1ao30b1.js"].map(b=>a.l(b))).then(()=>b(63460)))}];
|
|
2
2
|
|
|
3
|
-
//# sourceMappingURL=node_modules_html-to-
|
|
3
|
+
//# sourceMappingURL=node_modules_html-to-image_es_index_0ihmbv4.js.map
|