failproofai 1.0.12-beta.0 → 1.0.12-beta.2
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 +2 -2
- 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 +2 -2
- 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 +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- 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/_tree.segment.rsc +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 +22 -22
- package/.next/standalone/.next/server/app/api/audit/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/audit/status/route.js.nft.json +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.nft.json +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/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 +1 -1
- 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 +3 -3
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- 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 +14 -14
- package/.next/standalone/.next/server/app/policies/page.js +4 -4
- 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/app/settings/page/server-reference-manifest.json +8 -8
- package/.next/standalone/.next/server/app/settings/page.js +7 -7
- package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/chunks/{[externals]__0-ha5ydqq0mws._.js → [externals]__0vt9i6fqinjne._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__20xe05hm5u8_1._.js → [root-of-the-server]__0f_4g-vazrvxv._.js} +1 -1
- package/.next/standalone/.next/server/chunks/_0hf5q4xzyg40j._.js +1 -1
- package/.next/standalone/.next/server/chunks/_0tovk6q0miud6._.js +1 -1
- package/.next/standalone/.next/server/chunks/_0trp3ycqv17cl._.js +1 -1
- package/.next/standalone/.next/server/chunks/_19011-u44143j._.js +1 -1
- package/.next/standalone/.next/server/chunks/_1ek68lnh2daur._.js +2 -2
- package/.next/standalone/.next/server/chunks/{_0kc-piux3hady._.js → _1y590mjzpkbos._.js} +2 -2
- package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4vkpxxu7._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_hooks_0_em82s16zfym._.js +5 -0
- package/.next/standalone/.next/server/chunks/src_hooks_builtin-policies_ts_1yq5ybgx1v98e._.js +3 -0
- package/.next/standalone/.next/server/chunks/src_hooks_custom-hooks-loader_ts_0lnb3n3h94wnn._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_hooks_daemon-client_ts_0il_yu1zc0291._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_hooks_fp-home_ts_09kv0bn_4twyh._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0ts0fg5yih1c1._.js → [root-of-the-server]__00l2u6j86cb8y._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__08ch3staq3ejw._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0bigvy9xmv2ka._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h86bl2qf0k_o._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1_xbg2kx30wp-._.js → [root-of-the-server]__0naevg4bcoh54._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0pia5h3p8re4c._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0pwj2h2efe5f-._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1-ey9fgesfbc0._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__15usvs-ms-0hf._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__16gb3_92zvk5x._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1avi2kypusyb_._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1r7drlqli-ado._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0vcyntk4snf0f._.js → [root-of-the-server]__1vofkb2oq7p7e._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0bseae9u7g98r._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0eoura3_9gjb-._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0mouhaflye1ro._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_1gb0ifpkowwub._.js → _0ouu886szh6yj._.js} +10 -9
- package/.next/standalone/.next/server/chunks/ssr/_0pedwblqdoh58._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1djqs9i27e4kg._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_1ve8y151ua7qx._.js → _1fw0_nzkae5ao._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_20hn4gn87nsjc._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_next-internal_server_app_policies_page_actions_1sp2-yo5_vm5f.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/app_actions_get-scheduled-audit_ts_0ei9snixb5fd-._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_audit__components_audit-dashboard_tsx_0p9ud47q0xq5w._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_components_project-list_tsx_1ke6anr0vt64h._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_1kp6l3x33jqb6._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_19dqvpcz0uxur._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/app_settings_02tf1h47jmhhd._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_html-to-image_es_index_00jxj8foxqz5t.js → node_modules_html-to-image_es_index_1fv03uigni8s5.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_0janj0i6dqko7._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/package_json_[json]_cjs_013tntikdft59._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_06kzv9ddabn3_._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_0agdmptetetdt._.js +5 -0
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_0mdwgjisv4fub._.js +5 -0
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_1cv9_c4l1tzrm._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_daemon-client_ts_0k41_i7jg6ndv._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_fp-config_ts_04t589gp4p60j._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_pack-cli_ts_0t7me658zqmh_._.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/preview-props.json +3 -3
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +23 -23
- package/.next/standalone/.next/static/chunks/{0pjxnp927y7_j.js → 0ay__-d2h1xb5.js} +1 -1
- package/.next/standalone/.next/static/chunks/{2znt1784j9gd9.js → 0tbm3vjm62h-2.js} +1 -1
- package/.next/standalone/.next/static/chunks/1c_jf6g5wnslk.js +1 -0
- package/.next/standalone/.next/static/chunks/{3tn1bzk094e8e.js → 1my3-5p47t7r-.js} +1 -1
- package/.next/standalone/.next/static/chunks/20py8k1gd_i1m.js +1 -0
- package/.next/standalone/.next/static/chunks/21hckpmsc4g70.js +6 -0
- package/.next/standalone/.next/static/chunks/2hmex93ppj1ke.js +1 -0
- package/.next/standalone/.next/static/chunks/2o6d37j425uci.js +1 -0
- package/.next/standalone/.next/static/chunks/40oworn_-x12p.js +1 -0
- package/.next/standalone/.next/static/chunks/{2qz5piiir-qqm.js → 42xptz88mtq3x.js} +1 -1
- package/.next/standalone/app/actions/update-jev-config.ts +5 -3
- package/.next/standalone/app/settings/jev-panel.tsx +1 -1
- package/.next/standalone/fp-cloud-cli/CHANGELOG.md +32 -0
- package/.next/standalone/fp-cloud-cli/README.md +40 -1
- package/.next/standalone/fp-cloud-cli/fp_cli/client.py +91 -12
- package/.next/standalone/fp-cloud-cli/fp_cli/commands/fleet_cmds.py +78 -16
- package/.next/standalone/fp-cloud-cli/fp_cli/commands/policies_cmds.py +84 -18
- package/.next/standalone/fp-cloud-cli/fp_cli/enforcement.py +124 -6
- package/.next/standalone/fp-cloud-cli/fp_cli/models.py +89 -6
- package/.next/standalone/fp-cloud-cli/fp_cli/output.py +189 -20
- package/.next/standalone/fp-cloud-cli/fp_cli/policy_check.py +8 -5
- package/.next/standalone/fp-cloud-cli/skill/SKILL.md +2 -2
- package/.next/standalone/fp-cloud-cli/skill/references/commands.md +14 -7
- package/.next/standalone/fp-cloud-cli/tests/test_cloud_jev.py +527 -0
- package/.next/standalone/fp-cloud-cli/tests/test_enforcement_logic.py +46 -0
- package/.next/standalone/fp-cloud-cli/tests/test_output.py +23 -0
- package/.next/standalone/hermes-plugin/README.md +6 -4
- package/.next/standalone/hermes-plugin/__init__.py +27 -0
- package/.next/standalone/hermes-plugin/client.py +5 -1
- package/.next/standalone/hermes-plugin/plugin.yaml +1 -1
- package/.next/standalone/package.json +11 -10
- package/.next/standalone/sdk/python/uv.lock +31 -8
- package/.next/standalone/server.js +1 -1
- package/bin/failproofai.mjs +17 -1
- package/dist/cli.mjs +3507 -1250
- package/dist/worker.mjs +1779 -169
- package/hermes-plugin/README.md +6 -4
- package/hermes-plugin/__init__.py +27 -0
- package/hermes-plugin/client.py +5 -1
- package/hermes-plugin/plugin.yaml +1 -1
- package/package.json +11 -10
- package/src/audit/open-browser.ts +6 -7
- package/src/hooks/agent-roster.ts +180 -0
- package/src/hooks/agent-skill.ts +203 -0
- package/src/hooks/agent-targets.ts +60 -0
- package/src/hooks/cloud-connection.ts +91 -45
- package/src/hooks/cloud-enrollment-cli.ts +7 -4
- package/src/hooks/cloud-login.ts +6 -3
- package/src/hooks/cloud-managed-policies.ts +430 -20
- package/src/hooks/cloud-policy-errors.ts +481 -0
- package/src/hooks/codex-system-hooks.ts +10 -4
- package/src/hooks/config-status.ts +10 -4
- package/src/hooks/configure-wizard.ts +54 -26
- package/src/hooks/custom-hooks-loader.ts +26 -3
- package/src/hooks/daemon-client.ts +9 -4
- package/src/hooks/daemon-service.ts +2 -1
- package/src/hooks/delivery-health.ts +47 -2
- package/src/hooks/effective-reviewers.ts +36 -1
- package/src/hooks/fp-config.ts +19 -0
- package/src/hooks/fp-home.ts +6 -0
- package/src/hooks/handler.ts +255 -19
- package/src/hooks/health-probe.ts +15 -0
- package/src/hooks/hook-activity-store.ts +7 -1
- package/src/hooks/integrations.ts +36 -14
- package/src/hooks/jev-activity.ts +117 -1
- package/src/hooks/jev-cli.ts +196 -1
- package/src/hooks/jev-cloud-connection.ts +92 -0
- package/src/hooks/manager.ts +174 -34
- package/src/hooks/pack-failclosed.ts +2 -0
- package/src/hooks/pack-manifest.ts +8 -1
- package/src/hooks/policy-evaluator.ts +22 -1
- package/src/hooks/policy-registry.ts +3 -2
- package/src/hooks/policy-reviewability.ts +23 -5
- package/src/hooks/semantic/cloud-jev-health.ts +227 -0
- package/src/hooks/semantic/cloud-jev.ts +868 -0
- package/src/hooks/semantic/combine.ts +26 -1
- package/src/hooks/semantic/jev-client.ts +19 -2
- package/src/hooks/semantic/jev-config.ts +179 -30
- package/src/hooks/semantic/jev-review.ts +217 -10
- package/src/hooks/semantic/pack-policies.ts +2 -1
- package/src/hooks/semantic/types.ts +8 -0
- package/src/hooks/session-pause-cli.ts +1 -1
- package/src/hooks/tui.ts +13 -4
- package/src/hooks/uninstall-cli.ts +12 -1
- package/src/hooks/worker-server.ts +5 -1
- package/.next/standalone/.next/server/chunks/src_hooks_1aveq0uhs2t1b._.js +0 -5
- package/.next/standalone/.next/server/chunks/src_hooks_1eem5a7cyqlb2._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_effective-reviewers_ts_1h4wtvo55j16x._.js +0 -5
- package/.next/standalone/.next/static/chunks/0a-ccsp3xmypz.js +0 -1
- package/.next/standalone/.next/static/chunks/13jv-xvabeb62.js +0 -6
- package/.next/standalone/.next/static/chunks/2ank2u3apy8m6.js +0 -1
- package/.next/standalone/.next/static/chunks/2meqb9kygrncb.js +0 -1
- package/.next/standalone/.next/static/chunks/2ohktp_-lkv3x.js +0 -1
- package/.next/standalone/.next/static/chunks/2py0eldhwz8ay.js +0 -1
- /package/.next/standalone/.next/static/{SNr7o_-G4kNBQTR-iLZMM → LHCtFxVG0mdvd4lsXAOFC}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{SNr7o_-G4kNBQTR-iLZMM → LHCtFxVG0mdvd4lsXAOFC}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{SNr7o_-G4kNBQTR-iLZMM → LHCtFxVG0mdvd4lsXAOFC}/_ssgManifest.js +0 -0
package/.next/standalone/.next/server/chunks/ssr/app_components_project-list_tsx_1ke6anr0vt64h._.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[69349,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(77975);a.i(46786),a.i(14747);let e=/^[a-z]{2,}:/;function f(a){return!!a&&e.test(a)}var g=a.i(16316),h=a.i(27950),i=a.i(45481),j=a.i(90619),k=a.i(95947),l=a.i(87256);function m(a,b,c){return{key:a,label:b,depth:c,children:new Map,projectCount:0,lastModified:new Date(0),cli:[]}}function n(a,b){for(let c of(b.lastModified.getTime()>a.lastModified.getTime()&&(a.lastModified=b.lastModified,a.lastModifiedFormatted=b.lastModifiedFormatted),"number"==typeof b.sessionCount&&(a.sessionCount=(a.sessionCount??0)+b.sessionCount),a.projectCount+=1,b.cli))a.cli.includes(c)||a.cli.push(c)}function o(a){let b=[...a.children.values()].map(o).sort((a,b)=>b.lastModified.getTime()-a.lastModified.getTime());return{key:a.key,label:a.label,depth:a.depth,children:b,project:a.project,sessionCount:a.sessionCount,projectCount:a.projectCount,lastModified:a.lastModified,lastModifiedFormatted:a.lastModifiedFormatted,cli:a.cli}}var p=a.i(89027),q=a.i(41146),r=a.i(64831);let s={name:"folder",size:24,node:[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};s.node;let t=(0,r.f)(s);var u=a.i(33540),v=a.i(74215),w=a.i(38246),x=a.i(65967),y=a.i(24451);function z({date:a,formatted:c}){return(0,b.jsx)("span",{children:c||(0,g.f)(a)})}let A="failproofai.projects.collapsed";function B(a){try{window.localStorage.setItem(A,JSON.stringify([...a]))}catch{}}function C({node:a,collapsed:c,interactive:e,onToggle:g}){let h=a.children.length>0,i=a.project,j=c?q.f:p.f,k={paddingLeft:`${1.25*Math.min(a.depth,4)}rem`};return(0,b.jsxs)("tr",{className:"border-b border-border hover:bg-muted/50 transition-colors",children:[(0,b.jsx)("td",{className:"px-4 py-3",children:(0,b.jsx)("div",{style:k,children:(0,b.jsx)(t,{className:`w-5 h-5 ${h?"text-muted-foreground":"text-primary"}`})})}),(0,b.jsx)("td",{className:"px-4 py-3 max-w-md",children:(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",style:k,children:[h?e?(0,b.jsxs)("button",{type:"button",onClick:()=>g(a.key),"aria-expanded":!c,"aria-label":`${c?"Expand":"Collapse"} ${a.label}`,className:"flex items-center gap-1 font-semibold text-foreground hover:text-primary transition-colors break-words break-all text-left",children:[(0,b.jsx)(j,{className:"w-4 h-4 shrink-0"}),a.label]}):(0,b.jsxs)("span",{className:"flex items-center gap-1 font-semibold text-foreground break-words break-all",children:[(0,b.jsx)(j,{className:"w-4 h-4 shrink-0"}),a.label]}):i?(0,b.jsx)(w.default,{href:`/project/${encodeURIComponent(i.name)}`,className:"font-semibold text-foreground hover:text-primary transition-colors break-words break-all inline-block max-w-full",children:a.depth>0?a.label:function(a,b){return f(b)?b.replace(/:/g,"/"):/^[A-Za-z]--/.test(a)?a[0]+":/"+a.slice(3).replace(/-/g,"/"):a.replace(/-/g,"/")}(i.name,i.path)}):(0,b.jsx)("span",{className:"font-semibold text-foreground",children:a.label}),a.cli.map(a=>(0,b.jsx)(d.f,{cli:a},a)),h&&void 0!==a.sessionCount&&(0,b.jsxs)("span",{className:"text-xs text-muted-foreground",children:[a.sessionCount," session",1===a.sessionCount?"":"s"]})]})}),(0,b.jsx)("td",{className:"px-4 py-3 text-sm text-muted-foreground hidden md:table-cell truncate max-w-md",children:i?i.path:""}),(0,b.jsx)("td",{className:"px-4 py-3 text-sm text-muted-foreground",children:(0,b.jsx)(z,{date:a.lastModified,formatted:a.lastModifiedFormatted})})]})}a.s(["default",0,function({folders:a}){let d=(0,j.f)(),e=(0,c.useRef)(!1),[g,p]=(0,c.useState)(()=>(0,k.w)(d.get("q"))),[q,r]=(0,c.useState)(""),[s,t]=(0,c.useState)(()=>{let a=d.get("cli");return(0,l.U)(a)?a:""}),{filterPreset:w,dateRange:z,currentPage:D,setCurrentPage:E,handlePresetChange:F,handleDateRangeChange:G,clearFilters:H}=(0,i.f)(g,{filterPreset:(0,k.S)(d.get("preset")),dateRange:(0,k.R)(d.get("from"),d.get("to")),currentPage:(0,k.m)(d.get("page"))});(0,c.useEffect)(()=>{if(!e.current){e.current=!0;return}d.setAll({preset:(0,k.$)(w),...(0,k.V)(z),q:(0,k.l)(g),page:(0,k.t)(D),cli:s||void 0})},[w,z,g,D,s]);let I=a=>{let b=a.trim();b&&!g.includes(b)&&(p([...g,b]),r(""))},J=()=>{p([]),r("")},K=(0,c.useMemo)(()=>(0,h.j)(a),[a]),L=(0,c.useMemo)(()=>{let a=(0,h.b)(K,w,z);return g.length>0&&(a=a.filter(a=>{let b=a.name.toLowerCase();return g.every(a=>{let c=a.trim().toLowerCase().replace(/\//g,"-");return 0===c.length||b.includes(c)})})),s&&(a=a.filter(a=>a.cli.includes(s))),a.sort((a,b)=>b.lastModified.getTime()-a.lastModified.getTime())},[K,w,z,g,s]),M=(0,c.useMemo)(()=>(function(a){let b=new Map;for(let d of a){var c;let a,e=f(c=d.path)?c.split(":"):[];if(0===e.length){let a=m(`project:${d.name}`,d.name,0);a.project=d,n(a,d),b.set(a.key,a);continue}let g=b,h="";for(let b=0;b<e.length;b++){let c=e[b];h=0===b?c:`${h}:${c}`;let f=g.get(h);f||(f=m(h,c,b),g.set(h,f)),n(f,d),a=f,g=f.children}a&&!a.project&&(a.project=d)}return[...b.values()].map(o).sort((a,b)=>b.lastModified.getTime()-a.lastModified.getTime())})(L),[L]),N=Math.max(1,Math.ceil(M.length/h.N));(0,c.useEffect)(()=>{D>N&&E(N)},[D,N,E]);let O=(D-1)*h.N,P=Math.min(O+h.N,M.length),Q=(0,c.useMemo)(()=>M.slice(O,P),[M,O,P]),R=M.slice(0,O).reduce((a,b)=>a+b.projectCount,0),S=Q.reduce((a,b)=>a+b.projectCount,0),[T,U]=(0,c.useState)(()=>new Set);(0,c.useEffect)(()=>{U(new Set(function(){try{let a=window.localStorage.getItem(A),b=a?JSON.parse(a):null;return Array.isArray(b)?b.filter(a=>"string"==typeof a):[]}catch{return[]}}()))},[]);let V=a=>{U(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),B(c),c})},W=g.length>0,X=(0,c.useMemo)(()=>{var a;let b,c;return a=a=>!W&&T.has(a),b=[],(c=d=>{for(let e of d)b.push(e),e.children.length>0&&!a(e.key)&&c(e.children)})(Q),b},[Q,T,W]),Y=(0,c.useMemo)(()=>{let a,b;return a=[],(b=c=>{for(let d of c)d.children.length>0&&(a.push(d.key),b(d.children))})(Q),a},[Q]),Z=X.filter(a=>a.children.length>0).map(a=>a.key).some(a=>!T.has(a));return(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)("div",{className:"bg-card border border-border rounded-lg p-4",children:(0,b.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Filter by:"}),h.r.map(a=>(0,b.jsx)("button",{onClick:()=>F(a.value),className:`px-3 py-1.5 text-sm rounded-md transition-colors ${w===a.value?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/80"}`,children:a.label},a.value)),(0,b.jsx)("span",{className:"ml-2 text-sm font-medium text-foreground",children:"CLI:"}),(0,b.jsxs)("select",{"aria-label":"Filter by CLI",value:s,onChange:a=>{let b=a.target.value;t(""===b||(0,l.U)(b)?b:"")},className:"px-2 py-1.5 text-sm bg-input border border-border rounded-md text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent",children:[(0,b.jsx)("option",{value:"",children:"All CLIs"}),l.z.map(a=>(0,b.jsx)("option",{value:a,children:(0,l.A)(a)},a))]})]}),(0,b.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(u.f,{className:"w-4 h-4 text-muted-foreground"}),(0,b.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Search Keywords:"})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("input",{type:"text",value:q,onChange:a=>r(a.target.value),onKeyDown:a=>{"Enter"===a.key&&(a.preventDefault(),I(q))},placeholder:"Enter keyword and press Enter",className:"px-3 py-2 text-sm bg-input border border-border rounded-md text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-all hover:border-primary/50 w-[250px]","aria-label":"Add keyword"}),(0,b.jsx)("button",{onClick:()=>I(q),className:"px-3 py-2 text-sm bg-muted text-muted-foreground hover:bg-muted/80 rounded-md transition-colors","aria-label":"Add keyword",children:"Add"})]}),g.length>0&&(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[g.map((a,c)=>(0,b.jsxs)("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-muted text-muted-foreground rounded-md text-sm",children:[(0,b.jsx)("span",{children:a}),(0,b.jsx)("button",{onClick:()=>{p(g.filter((a,b)=>b!==c))},className:"hover:text-foreground transition-colors p-0.5 rounded hover:bg-muted/80","aria-label":`Remove keyword ${a}`,children:(0,b.jsx)(v.X,{className:"w-3.5 h-3.5"})})]},c)),(0,b.jsx)("button",{onClick:J,className:"px-2 py-1.5 text-xs bg-muted text-muted-foreground hover:bg-muted/80 rounded-md transition-colors","aria-label":"Clear all keywords",children:"Clear all"})]})]})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-4",children:[(0,b.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Custom Range:"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(y.f,{id:"date-from",value:z.from,onChange:a=>G("from",a),"aria-label":"Filter from date"}),(0,b.jsx)("span",{className:"text-muted-foreground",children:"to"}),(0,b.jsx)(y.f,{id:"date-to",value:z.to,onChange:a=>G("to",a),"aria-label":"Filter to date"})]}),("all"!==w||null!==z.from||null!==z.to||g.length>0||""!==s)&&(0,b.jsx)("button",{onClick:()=>{H(),J(),t("")},className:"px-3 py-2 text-sm bg-muted text-muted-foreground hover:bg-muted/80 rounded-md transition-colors",children:"Clear"})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-sm text-muted-foreground",children:[Y.length>0&&!W&&(0,b.jsx)("button",{type:"button",onClick:()=>{U(a=>{let b=new Set(a);for(let a of Y)Z?b.add(a):b.delete(a);return B(b),b})},className:"text-xs text-muted-foreground hover:text-foreground underline underline-offset-2 transition-colors",children:Z?"Collapse all":"Expand all"}),0===L.length?(0,b.jsx)("span",{children:"No projects found"}):(0,b.jsxs)("span",{children:["Showing ",R+1,"-",R+S," of ",L.length," projects",L.length!==K.length&&(0,b.jsxs)("span",{className:"ml-1",children:["(filtered from ",K.length," total)"]}),g.length>0&&(0,b.jsxs)("span",{className:"ml-1",children:["with ",g.length," keyword",1!==g.length?"s":""]})]})]})]})}),(0,b.jsxs)("div",{className:"bg-card border border-border rounded-lg overflow-hidden",children:[(0,b.jsx)("div",{className:"overflow-x-auto",children:(0,b.jsxs)("table",{className:"w-full",children:[(0,b.jsx)("thead",{children:(0,b.jsxs)("tr",{className:"border-b border-border bg-muted/50",children:[(0,b.jsx)("th",{scope:"col",className:"px-4 py-3 text-left text-sm font-semibold text-foreground w-12",children:(0,b.jsx)("span",{className:"sr-only",children:"Icon"})}),(0,b.jsx)("th",{scope:"col",className:"px-4 py-3 text-left text-sm font-semibold text-foreground max-w-md",children:"Agent Root"}),(0,b.jsx)("th",{scope:"col",className:"px-4 py-3 text-left text-sm font-semibold text-foreground hidden md:table-cell",children:"Path"}),(0,b.jsx)("th",{scope:"col",className:"px-4 py-3 text-left text-sm font-semibold text-foreground",children:"Last Modified"})]})}),(0,b.jsx)("tbody",{children:0===X.length?(0,b.jsx)("tr",{children:(0,b.jsx)("td",{colSpan:4,className:"px-4 py-8 text-center text-muted-foreground",children:"No projects found matching the selected filter."})}):X.map(a=>(0,b.jsx)(C,{node:a,collapsed:!W&&T.has(a.key),interactive:!W,onToggle:V},a.key))})]})}),L.length>0&&(0,b.jsx)(x.f,{currentPage:D,totalPages:N,onPageChange:E})]})]})}],69349)}];
|
|
1
|
+
module.exports=[69349,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(77975);a.i(46786),a.i(14747);let e=/^[a-z]{2,}:/;function f(a){return!!a&&e.test(a)}var g=a.i(16316),h=a.i(27950),i=a.i(45481),j=a.i(90619),k=a.i(95947),l=a.i(87256);function m(a,b,c){return{key:a,label:b,depth:c,children:new Map,projectCount:0,lastModified:new Date(0),cli:[]}}function n(a,b){for(let c of(b.lastModified.getTime()>a.lastModified.getTime()&&(a.lastModified=b.lastModified,a.lastModifiedFormatted=b.lastModifiedFormatted),"number"==typeof b.sessionCount&&(a.sessionCount=(a.sessionCount??0)+b.sessionCount),a.projectCount+=1,b.cli))a.cli.includes(c)||a.cli.push(c)}function o(a){let b=[...a.children.values()].map(o).sort((a,b)=>b.lastModified.getTime()-a.lastModified.getTime());return{key:a.key,label:a.label,depth:a.depth,children:b,project:a.project,sessionCount:a.sessionCount,projectCount:a.projectCount,lastModified:a.lastModified,lastModifiedFormatted:a.lastModifiedFormatted,cli:a.cli}}var p=a.i(89027),q=a.i(11330),r=a.i(64831);let s={name:"folder",size:24,node:[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};s.node;let t=(0,r.f)(s);var u=a.i(33540),v=a.i(74215),w=a.i(38246),x=a.i(65967),y=a.i(24451);function z({date:a,formatted:c}){return(0,b.jsx)("span",{children:c||(0,g.f)(a)})}let A="failproofai.projects.collapsed";function B(a){try{window.localStorage.setItem(A,JSON.stringify([...a]))}catch{}}function C({node:a,collapsed:c,interactive:e,onToggle:g}){let h=a.children.length>0,i=a.project,j=c?q.f:p.f,k={paddingLeft:`${1.25*Math.min(a.depth,4)}rem`};return(0,b.jsxs)("tr",{className:"border-b border-border hover:bg-muted/50 transition-colors",children:[(0,b.jsx)("td",{className:"px-4 py-3",children:(0,b.jsx)("div",{style:k,children:(0,b.jsx)(t,{className:`w-5 h-5 ${h?"text-muted-foreground":"text-primary"}`})})}),(0,b.jsx)("td",{className:"px-4 py-3 max-w-md",children:(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",style:k,children:[h?e?(0,b.jsxs)("button",{type:"button",onClick:()=>g(a.key),"aria-expanded":!c,"aria-label":`${c?"Expand":"Collapse"} ${a.label}`,className:"flex items-center gap-1 font-semibold text-foreground hover:text-primary transition-colors break-words break-all text-left",children:[(0,b.jsx)(j,{className:"w-4 h-4 shrink-0"}),a.label]}):(0,b.jsxs)("span",{className:"flex items-center gap-1 font-semibold text-foreground break-words break-all",children:[(0,b.jsx)(j,{className:"w-4 h-4 shrink-0"}),a.label]}):i?(0,b.jsx)(w.default,{href:`/project/${encodeURIComponent(i.name)}`,className:"font-semibold text-foreground hover:text-primary transition-colors break-words break-all inline-block max-w-full",children:a.depth>0?a.label:function(a,b){return f(b)?b.replace(/:/g,"/"):/^[A-Za-z]--/.test(a)?a[0]+":/"+a.slice(3).replace(/-/g,"/"):a.replace(/-/g,"/")}(i.name,i.path)}):(0,b.jsx)("span",{className:"font-semibold text-foreground",children:a.label}),a.cli.map(a=>(0,b.jsx)(d.f,{cli:a},a)),h&&void 0!==a.sessionCount&&(0,b.jsxs)("span",{className:"text-xs text-muted-foreground",children:[a.sessionCount," session",1===a.sessionCount?"":"s"]})]})}),(0,b.jsx)("td",{className:"px-4 py-3 text-sm text-muted-foreground hidden md:table-cell truncate max-w-md",children:i?i.path:""}),(0,b.jsx)("td",{className:"px-4 py-3 text-sm text-muted-foreground",children:(0,b.jsx)(z,{date:a.lastModified,formatted:a.lastModifiedFormatted})})]})}a.s(["default",0,function({folders:a}){let d=(0,j.f)(),e=(0,c.useRef)(!1),[g,p]=(0,c.useState)(()=>(0,k.w)(d.get("q"))),[q,r]=(0,c.useState)(""),[s,t]=(0,c.useState)(()=>{let a=d.get("cli");return(0,l.U)(a)?a:""}),{filterPreset:w,dateRange:z,currentPage:D,setCurrentPage:E,handlePresetChange:F,handleDateRangeChange:G,clearFilters:H}=(0,i.f)(g,{filterPreset:(0,k.S)(d.get("preset")),dateRange:(0,k.R)(d.get("from"),d.get("to")),currentPage:(0,k.m)(d.get("page"))});(0,c.useEffect)(()=>{if(!e.current){e.current=!0;return}d.setAll({preset:(0,k.$)(w),...(0,k.V)(z),q:(0,k.l)(g),page:(0,k.t)(D),cli:s||void 0})},[w,z,g,D,s]);let I=a=>{let b=a.trim();b&&!g.includes(b)&&(p([...g,b]),r(""))},J=()=>{p([]),r("")},K=(0,c.useMemo)(()=>(0,h.j)(a),[a]),L=(0,c.useMemo)(()=>{let a=(0,h.b)(K,w,z);return g.length>0&&(a=a.filter(a=>{let b=a.name.toLowerCase();return g.every(a=>{let c=a.trim().toLowerCase().replace(/\//g,"-");return 0===c.length||b.includes(c)})})),s&&(a=a.filter(a=>a.cli.includes(s))),a.sort((a,b)=>b.lastModified.getTime()-a.lastModified.getTime())},[K,w,z,g,s]),M=(0,c.useMemo)(()=>(function(a){let b=new Map;for(let d of a){var c;let a,e=f(c=d.path)?c.split(":"):[];if(0===e.length){let a=m(`project:${d.name}`,d.name,0);a.project=d,n(a,d),b.set(a.key,a);continue}let g=b,h="";for(let b=0;b<e.length;b++){let c=e[b];h=0===b?c:`${h}:${c}`;let f=g.get(h);f||(f=m(h,c,b),g.set(h,f)),n(f,d),a=f,g=f.children}a&&!a.project&&(a.project=d)}return[...b.values()].map(o).sort((a,b)=>b.lastModified.getTime()-a.lastModified.getTime())})(L),[L]),N=Math.max(1,Math.ceil(M.length/h.N));(0,c.useEffect)(()=>{D>N&&E(N)},[D,N,E]);let O=(D-1)*h.N,P=Math.min(O+h.N,M.length),Q=(0,c.useMemo)(()=>M.slice(O,P),[M,O,P]),R=M.slice(0,O).reduce((a,b)=>a+b.projectCount,0),S=Q.reduce((a,b)=>a+b.projectCount,0),[T,U]=(0,c.useState)(()=>new Set);(0,c.useEffect)(()=>{U(new Set(function(){try{let a=window.localStorage.getItem(A),b=a?JSON.parse(a):null;return Array.isArray(b)?b.filter(a=>"string"==typeof a):[]}catch{return[]}}()))},[]);let V=a=>{U(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),B(c),c})},W=g.length>0,X=(0,c.useMemo)(()=>{var a;let b,c;return a=a=>!W&&T.has(a),b=[],(c=d=>{for(let e of d)b.push(e),e.children.length>0&&!a(e.key)&&c(e.children)})(Q),b},[Q,T,W]),Y=(0,c.useMemo)(()=>{let a,b;return a=[],(b=c=>{for(let d of c)d.children.length>0&&(a.push(d.key),b(d.children))})(Q),a},[Q]),Z=X.filter(a=>a.children.length>0).map(a=>a.key).some(a=>!T.has(a));return(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)("div",{className:"bg-card border border-border rounded-lg p-4",children:(0,b.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Filter by:"}),h.r.map(a=>(0,b.jsx)("button",{onClick:()=>F(a.value),className:`px-3 py-1.5 text-sm rounded-md transition-colors ${w===a.value?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/80"}`,children:a.label},a.value)),(0,b.jsx)("span",{className:"ml-2 text-sm font-medium text-foreground",children:"CLI:"}),(0,b.jsxs)("select",{"aria-label":"Filter by CLI",value:s,onChange:a=>{let b=a.target.value;t(""===b||(0,l.U)(b)?b:"")},className:"px-2 py-1.5 text-sm bg-input border border-border rounded-md text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent",children:[(0,b.jsx)("option",{value:"",children:"All CLIs"}),l.z.map(a=>(0,b.jsx)("option",{value:a,children:(0,l.A)(a)},a))]})]}),(0,b.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(u.f,{className:"w-4 h-4 text-muted-foreground"}),(0,b.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Search Keywords:"})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("input",{type:"text",value:q,onChange:a=>r(a.target.value),onKeyDown:a=>{"Enter"===a.key&&(a.preventDefault(),I(q))},placeholder:"Enter keyword and press Enter",className:"px-3 py-2 text-sm bg-input border border-border rounded-md text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-all hover:border-primary/50 w-[250px]","aria-label":"Add keyword"}),(0,b.jsx)("button",{onClick:()=>I(q),className:"px-3 py-2 text-sm bg-muted text-muted-foreground hover:bg-muted/80 rounded-md transition-colors","aria-label":"Add keyword",children:"Add"})]}),g.length>0&&(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[g.map((a,c)=>(0,b.jsxs)("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-muted text-muted-foreground rounded-md text-sm",children:[(0,b.jsx)("span",{children:a}),(0,b.jsx)("button",{onClick:()=>{p(g.filter((a,b)=>b!==c))},className:"hover:text-foreground transition-colors p-0.5 rounded hover:bg-muted/80","aria-label":`Remove keyword ${a}`,children:(0,b.jsx)(v.X,{className:"w-3.5 h-3.5"})})]},c)),(0,b.jsx)("button",{onClick:J,className:"px-2 py-1.5 text-xs bg-muted text-muted-foreground hover:bg-muted/80 rounded-md transition-colors","aria-label":"Clear all keywords",children:"Clear all"})]})]})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-4",children:[(0,b.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Custom Range:"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(y.f,{id:"date-from",value:z.from,onChange:a=>G("from",a),"aria-label":"Filter from date"}),(0,b.jsx)("span",{className:"text-muted-foreground",children:"to"}),(0,b.jsx)(y.f,{id:"date-to",value:z.to,onChange:a=>G("to",a),"aria-label":"Filter to date"})]}),("all"!==w||null!==z.from||null!==z.to||g.length>0||""!==s)&&(0,b.jsx)("button",{onClick:()=>{H(),J(),t("")},className:"px-3 py-2 text-sm bg-muted text-muted-foreground hover:bg-muted/80 rounded-md transition-colors",children:"Clear"})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-sm text-muted-foreground",children:[Y.length>0&&!W&&(0,b.jsx)("button",{type:"button",onClick:()=>{U(a=>{let b=new Set(a);for(let a of Y)Z?b.add(a):b.delete(a);return B(b),b})},className:"text-xs text-muted-foreground hover:text-foreground underline underline-offset-2 transition-colors",children:Z?"Collapse all":"Expand all"}),0===L.length?(0,b.jsx)("span",{children:"No projects found"}):(0,b.jsxs)("span",{children:["Showing ",R+1,"-",R+S," of ",L.length," projects",L.length!==K.length&&(0,b.jsxs)("span",{className:"ml-1",children:["(filtered from ",K.length," total)"]}),g.length>0&&(0,b.jsxs)("span",{className:"ml-1",children:["with ",g.length," keyword",1!==g.length?"s":""]})]})]})]})}),(0,b.jsxs)("div",{className:"bg-card border border-border rounded-lg overflow-hidden",children:[(0,b.jsx)("div",{className:"overflow-x-auto",children:(0,b.jsxs)("table",{className:"w-full",children:[(0,b.jsx)("thead",{children:(0,b.jsxs)("tr",{className:"border-b border-border bg-muted/50",children:[(0,b.jsx)("th",{scope:"col",className:"px-4 py-3 text-left text-sm font-semibold text-foreground w-12",children:(0,b.jsx)("span",{className:"sr-only",children:"Icon"})}),(0,b.jsx)("th",{scope:"col",className:"px-4 py-3 text-left text-sm font-semibold text-foreground max-w-md",children:"Agent Root"}),(0,b.jsx)("th",{scope:"col",className:"px-4 py-3 text-left text-sm font-semibold text-foreground hidden md:table-cell",children:"Path"}),(0,b.jsx)("th",{scope:"col",className:"px-4 py-3 text-left text-sm font-semibold text-foreground",children:"Last Modified"})]})}),(0,b.jsx)("tbody",{children:0===X.length?(0,b.jsx)("tr",{children:(0,b.jsx)("td",{colSpan:4,className:"px-4 py-8 text-center text-muted-foreground",children:"No projects found matching the selected filter."})}):X.map(a=>(0,b.jsx)(C,{node:a,collapsed:!W&&T.has(a.key),interactive:!W,onToggle:V},a.key))})]})}),L.length>0&&(0,b.jsx)(x.f,{currentPage:D,totalPages:N,onPageChange:E})]})]})}],69349)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=app_components_project-list_tsx_1ke6anr0vt64h._.js.map
|
|
@@ -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(19121),e=a.i(66036);a.s(["default",0,function({error:a,reset:f}){return(0,c.useEffect)(()=>{(0,d.f)().then(b=>{(0,e.$)(b),(0,e.L)("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_1kp6l3x33jqb6._.js.map
|
package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_19dqvpcz0uxur._.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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(52562),g=a.i(89027),h=a.i(64831);let i={name:"code",size:24,node:[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]};i.node;let j=(0,h.f)(i);var k=a.i(85650);let l={name:"package",size:24,node:[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]};l.node;let m=(0,h.f)(l),n={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};n.node;let o=(0,h.f)(n);var p=a.i(41476);let q={name:"shield",size:24,node:[["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"}]]};q.node;let r=(0,h.f)(q),s={name:"shield-alert",size:24,node:[["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"}]]};s.node;let t=(0,h.f)(s),u={name:"shield-check",size:24,node:[["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"}]]};u.node;let v=(0,h.f)(u),w={name:"shield-x",size:24,node:[["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"}]],aliases:["shield-close"]};w.node;let x=(0,h.f)(w),y={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};y.node;let z=(0,h.f)(y),A={name:"triangle-alert",size:24,node:[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["alert-triangle"]};A.node;let B=(0,h.f)(A);var C=a.i(74215),D=a.i(65967),E=a.i(5050);let F=(0,E.createServerReference)("4012bc29553363320079da9c4da39e5f7f271db3d8",E.callServer,void 0,E.findSourceMapURL,"getHookActivityAction"),G=(0,E.createServerReference)("6054c975f99afafd19c3ef2563888cdfd417fcee2d",E.callServer,void 0,E.findSourceMapURL,"searchHookActivityAction"),H=(0,E.createServerReference)("0012ac8b873e10620d7bb4c85d954c8c84b59c4ab0",E.callServer,void 0,E.findSourceMapURL,"getActivePausesAction");function I({pauses:a,now:d}){let[e,f]=(0,c.useState)(()=>Date.now());(0,c.useEffect)(()=>{let a=setInterval(()=>f(Date.now()),3e4);return()=>clearInterval(a)},[]);let g=d??e,h=a.filter(a=>a.expiresAt>g);if(0===h.length)return null;let i=h.reduce((a,b)=>a.expiresAt<b.expiresAt?a:b);return(0,b.jsxs)("div",{role:"status",className:"mb-4 flex items-start gap-2.5 rounded border border-amber-500/40 bg-amber-500/[0.07] px-3 py-2.5",children:[(0,b.jsx)(t,{className:"h-4 w-4 shrink-0 text-amber-500 mt-0.5","aria-hidden":"true"}),(0,b.jsxs)("div",{className:"text-xs leading-relaxed",children:[(0,b.jsxs)("p",{className:"font-medium text-foreground",children:["Enforcement is paused for ",h.length," session",1===h.length?"":"s"," —"," ",function(a){if(a<=0)return"expiring now";if(a<6e4)return"under a minute";let b=Math.round(a/6e4);if(b<60)return`${b}m`;let c=Math.floor(b/60),d=b%60;return 0===d?`${c}h`:`${c}h${d}m`}(i.expiresAt-g)," left",h.length>1?" on the next to expire":"","."]}),(0,b.jsxs)("p",{className:"text-muted-foreground mt-0.5",children:["Builtin, custom and convention policies are suspended for"," ",1===h.length?"that session":"those sessions","; cloud-managed policies keep enforcing. It lifts on its own — or run"," ",(0,b.jsx)("span",{className:"font-mono text-foreground",children:"failproofai config --resume"}),"."]})]})]})}function J(){return(0,b.jsx)("span",{title:"Enforcement was paused for this session — local policies did not run",className:"ml-1.5 inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium uppercase tracking-wide border border-amber-500/40 bg-amber-500/10 text-amber-600 dark:text-amber-500",children:"paused"})}function K({item:a}){if(!a.pausedBy)return null;let c="number"==typeof a.pauseExpiresAt?new Date(a.pauseExpiresAt).toLocaleTimeString():null;return(0,b.jsxs)("div",{className:"sm:col-span-2 lg:col-span-3 mt-1 flex items-start gap-2 rounded border border-amber-500/30 bg-amber-500/5 px-2.5 py-2",children:[(0,b.jsx)(B,{className:"h-3.5 w-3.5 shrink-0 text-amber-500/80 mt-0.5","aria-hidden":"true"}),(0,b.jsxs)("p",{className:"text-[0.7rem] leading-relaxed text-muted-foreground",children:[(0,b.jsx)("span",{className:"font-medium text-foreground",children:"Not enforced — paused."})," Enforcement was suspended for this session","cli"===a.pausedBy?" from the CLI":` by ${a.pausedBy}`,c?`, lifting at ${c}`:"",". Builtin, custom and convention policies did not run for this event; cloud-managed policies did."]})]})}let L=["evaluator","jevDecision","jevCleared","jevFallbackReason","jevLatencyMs","jevModel","jevMode"],M=new Set(["jev","jev-fallback"]),N=new Set(["allow","instruct","deny"]),O=new Set(["observe","enforce"]),P=/^([a-z0-9]+(?:-[a-z0-9]+)*)\s*(?:$|[:(])/,Q=/^http-\d{3}$/,R="other",S=new Set(["aborted","cloudflare-error","cloudflare-incomplete","config","error","malformed","model-mismatch","network","no-api-key","no-transport","other","out-of-credits","prepare-error","provider-refused","rate-limited","request-cut","request-too-large","timeout","truncated","unavailable","upstream-error"]),T=new Map([["prepare","prepare-error"],["error","error"],["timeout","timeout"],["network","network"],["malformed","malformed"],["truncated","truncated"],["rate-limited","rate-limited"],["out-of-credits","out-of-credits"],["model-mismatch","model-mismatch"],["request-too-large","request-too-large"],["config","config"]]),U=/^[A-Za-z0-9._:/@~+-]{1,200}$/,V=/[\u0000-\u001f\u007f-\u009f\u2028\u2029]/,W=/^(?:custom|pack|cloud|failproofai|\.failproofai-[A-Za-z0-9_-]{1,32})\//;function X(a){return!("string"!=typeof a||0===a.length||[...a].length>200||V.test(a))&&(!/\s/.test(a)||W.test(a))}function Y(a){if(!L.some(b=>void 0!==a[b]))return a;let b={...a},c=a=>{delete b[a]};"string"==typeof b.evaluator&&M.has(b.evaluator)||c("evaluator"),"string"==typeof b.jevDecision&&N.has(b.jevDecision)||c("jevDecision");let d=void 0!==b.jevMode&&!("string"==typeof b.jevMode&&O.has(b.jevMode));if("string"==typeof b.jevMode&&O.has(b.jevMode)||c("jevMode"),d&&c("jevCleared"),Array.isArray(b.jevCleared)){let a=[...new Set(b.jevCleared.filter(X))].slice(0,64);b.jevCleared=a}else c("jevCleared");let e=function(a){if("string"!=typeof a)return;let b=a.trim().toLowerCase();if(0===b.length)return;let c=P.exec(b)?.[1];if(void 0===c||c.length>40)return R;if(Q.test(c))return c;let d=T.get(c)??c;return S.has(d)?d:R}(b.jevFallbackReason);return void 0===e?c("jevFallbackReason"):b.jevFallbackReason=e,"number"==typeof b.jevLatencyMs&&Number.isFinite(b.jevLatencyMs)&&b.jevLatencyMs>=0?b.jevLatencyMs=Math.round(b.jevLatencyMs):c("jevLatencyMs"),"string"==typeof b.jevModel&&U.test(b.jevModel.trim())?b.jevModel=b.jevModel.trim():c("jevModel"),b}function Z(a){return"jev-fallback"===a.evaluator?"fallback":"jev"!==a.evaluator?null:void 0!==a.jevCleared||void 0!==a.jevLatencyMs||void 0!==a.jevModel||"deny"===a.jevDecision||"instruct"===a.jevDecision?"answered":"allow"===a.jevDecision?"no-request":"not-consulted"}let $=new Set(["request-cut","truncated","model-mismatch"]);function _(a){return"jev-fallback"===a.evaluator&&(void 0!==a.jevDecision||$.has(a.jevFallbackReason??""))}let aa={allow:0,instruct:1,deny:2},ab={cleared:{label:"jev cleared",title:"Jev reviewed a reviewable policy's block and cleared it",className:"border-sky-500/40 bg-sky-500/10 text-sky-600 dark:text-sky-400"},"would-clear":{label:"jev observe",title:"Observe mode: Jev would have cleared a block here; the regex result was enforced",className:"border-sky-500/30 bg-sky-500/5 text-sky-600/80 dark:text-sky-400/80"},"observe-stricter":{label:"jev observe",title:"Observe mode: Jev would have been stricter here; the regex result was enforced",className:"border-sky-500/30 bg-sky-500/5 text-sky-600/80 dark:text-sky-400/80"},"fallback-stricter":{label:"jev fallback",title:"Jev answered but its answer was not applied (e.g. the call was truncated); it would have been stricter than the regex result",className:"border-amber-500/40 bg-amber-500/10 text-amber-600 dark:text-amber-400"},fallback:{label:"jev fallback",title:"Jev's answer was not used for this call (unavailable, truncated or mismatched); the regex policies decided alone",className:"border-muted-foreground/30 bg-muted/40 text-muted-foreground"}};function ac({item:a}){let c=function(a){let b=Y(a),c=Z(Y(b));if(null===c||"not-consulted"===c||"no-request"===c)return null;let d=()=>(aa[b.jevDecision??"allow"]??0)>(aa[a.decision??"allow"]??0);if("fallback"===c)return void 0!==b.jevDecision&&d()?"fallback-stricter":"fallback";let e=(b.jevCleared??[]).length>0;return"observe"===b.jevMode?e?"would-clear":d()?"observe-stricter":null:e?"cleared":null}(a);if(!c)return null;let d=ab[c];return(0,b.jsx)("span",{title:d.title,className:`ml-1.5 inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium uppercase tracking-wide border ${d.className}`,children:d.label})}function ad({item:a}){let c=function(a){let b=Y(a),c=Z(b);if(null===c)return null;if("not-consulted"===c)return["Jev not consulted: a hard policy's deny is final"];if("no-request"===c)return["Jev not asked: no semantic policy applies to this call"];let d=[];if("fallback"===c){let a=b.jevFallbackReason??"unknown reason";return _(b)?(d.push(`Jev's answer not applied: ${a}`),b.jevDecision&&d.push(`Jev verdict (not applied): ${b.jevDecision}`)):d.push(`Jev unavailable: ${a}`),d.push("the regex policies decided alone"),void 0!==b.jevLatencyMs&&d.push(`${b.jevLatencyMs} ms`),b.jevModel&&_(b)&&d.push(b.jevModel),d}b.jevDecision&&d.push(`Jev verdict: ${b.jevDecision}`);let e=b.jevCleared??[];return e.length>0&&d.push(`${"observe"===b.jevMode?"would have cleared":"cleared"} ${e.join(", ")}`),"observe"===b.jevMode&&d.push("observe mode: the regex result was enforced"),void 0!==b.jevLatencyMs&&d.push(`${b.jevLatencyMs} ms`),b.jevModel&&d.push(b.jevModel),0===d.length&&d.push("Jev answered"),d}(a);return c?(0,b.jsxs)("div",{className:"sm:col-span-2 lg:col-span-3",children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Semantic review: "}),(0,b.jsx)("span",{className:"font-mono text-foreground",children:c.join(" · ")})]}):null}let ae=(0,E.createServerReference)("003ec969a8989a732e9892b583c8c1eae41609faf4",E.callServer,void 0,E.findSourceMapURL,"getHooksConfigAction"),af=(0,E.createServerReference)("60922a6ad763c01f8628deefb271ad8b57448dc71f",E.callServer,void 0,E.findSourceMapURL,"toggleCustomPolicyAction"),ag=(0,E.createServerReference)("00823c0f6cf7d4ac073758eac3c57ba8d0c5626618",E.callServer,void 0,E.findSourceMapURL,"addBundledPackWebAction"),ah=(0,E.createServerReference)("601eb4e286c556791d5c438f0d9e8280e5796b9309",E.callServer,void 0,E.findSourceMapURL,"addPackWebAction"),ai=(0,E.createServerReference)("406703a0866f678d914175a67c98cab6f983694738",E.callServer,void 0,E.findSourceMapURL,"previewPackWebAction"),aj=(0,E.createServerReference)("40246a52f60fe43ef4aefce1f7722f47135dabedf1",E.callServer,void 0,E.findSourceMapURL,"removePackWebAction"),ak=(0,E.createServerReference)("701359d811bff550d6e601c11d1666edfd6ab71855",E.callServer,void 0,E.findSourceMapURL,"togglePackPolicyAction"),al=(0,E.createServerReference)("60c16351ca5e84728c77af9f5e0c7bd65237eb7a8e",E.callServer,void 0,E.findSourceMapURL,"installHooksWebAction"),am=(0,E.createServerReference)("6032e8373a616afd136a2f346c0d5a66c6c168d63a",E.callServer,void 0,E.findSourceMapURL,"removeHooksWebAction"),an=(0,E.createServerReference)("6077fb97f95b4c92e48a9d291b1f3bab7419cb7a1e",E.callServer,void 0,E.findSourceMapURL,"updatePolicyParamsAction");var ao=a.i(6236),ap=a.i(10765),aq=a.i(90619),ar=a.i(95947),as=a.i(87256);let at={claude:{PreToolUse:"block",UserPromptSubmit:"block",PermissionRequest:"block",Stop:"block",SubagentStop:"block",PreCompact:"block",PostToolBatch:"block",ConfigChange:"block",UserPromptExpansion:"block",TaskCreated:"block",TaskCompleted:"block",TeammateIdle:"block",Elicitation:"block",ElicitationResult:"block",PostToolUse:"observe",PostToolUseFailure:"observe",SessionStart:"observe",Setup:"observe",SubagentStart:"observe",SessionEnd:"observe",StopFailure:"observe",PermissionDenied:"observe",Notification:"observe",InstructionsLoaded:"observe",CwdChanged:"observe",FileChanged:"observe",PostCompact:"observe",WorktreeRemove:"observe"},codex:{PreToolUse:"block",PermissionRequest:"block",UserPromptSubmit:"block",Stop:"block",SubagentStop:"block",PostToolUse:"block",SessionStart:"observe",SubagentStart:"observe",PreCompact:"observe",PostCompact:"observe"},copilot:{PreToolUse:"block",Stop:"block",SubagentStop:"block",UserPromptSubmit:"block",PermissionRequest:"block",PostToolUse:"block",SessionStart:"observe",SessionEnd:"observe",PostToolUseFailure:"observe",PreCompact:"observe",Notification:"observe"},cursor:{PreToolUse:"block",Stop:"block",UserPromptSubmit:"block",PostToolUse:"observe",SessionStart:"observe",SessionEnd:"observe"},opencode:{PreToolUse:"block",PostToolUse:"observe",SessionStart:"observe",SessionEnd:"observe",UserPromptSubmit:"observe",PermissionRequest:"observe"},pi:{PreToolUse:"block",UserPromptSubmit:"block",PostToolUse:"observe",SessionStart:"observe",SessionEnd:"observe",Stop:"observe"},hermes:{PreToolUse:"block",PostToolUse:"observe",SubagentStop:"observe",SessionStart:"observe",SessionEnd:"observe"},openclaw:{PreToolUse:"block",UserPromptSubmit:"block",Stop:"block",PostToolUse:"observe",SessionStart:"observe",SessionEnd:"observe",SubagentStop:"observe",PreCompact:"observe"},factory:{PreToolUse:"block",UserPromptSubmit:"block",Stop:"block",PreCompact:"block",PostToolUse:"observe",SubagentStop:"observe",SessionStart:"observe",SessionEnd:"observe",Notification:"observe"},devin:{PreToolUse:"block",UserPromptSubmit:"block",Stop:"block",PermissionRequest:"block",PostToolUse:"observe",SessionStart:"observe",SessionEnd:"observe"},antigravity:{PreToolUse:"block",Stop:"block",PostToolUse:"observe",UserPromptSubmit:"observe"},goose:{PreToolUse:"block",UserPromptSubmit:"observe",PostToolUse:"observe",SessionStart:"observe",SessionEnd:"observe"}};var au=a.i(80977),av=a.i(40695);function aw({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);if(h||i||j||k||l){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":"pi";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 m=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 m?(0,b.jsx)(e.default,{href:`/project/${encodeURIComponent(m)}/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 ax({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)(x,{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)(t,{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)(v,{className:"h-3 w-3"}),"Allow"]})}function ay({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 az({integration:a}){if(!a)return null;let c=(0,as.A)(a),d=(0,as.G)(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 aA({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 aB({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 aC({text:a,field:d}){let[e,g]=(0,c.useState)(!1),{capture:h}=(0,ap.usePostHog)(),i=async b=>{b.stopPropagation(),h("activity_copy_clicked",{field:d??"unknown"});try{await navigator.clipboard.writeText(a),g(!0),setTimeout(()=>g(!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),g(!0),setTimeout(()=>g(!1),1500)}};return(0,b.jsx)("button",{onClick:i,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)(f.f,{className:"h-3 w-3 text-emerald-400"}):(0,b.jsx)(k.f,{className:"h-3 w-3"})})}function aD({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 aE({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 aF({item:a}){if("observe"!==function(a,b){if(!a||!b)return;let c=at[a];if(c)return c[b]}(a.integration,a.eventType))return null;let c=a.matchedPolicies??[];if(0===c.length)return null;let d=a.integration?(0,as.A)(a.integration):"This CLI",e=c.map(a=>a.replace(/^(custom|\.failproofai-(project|user))\//,"")),f=1===e.length?e[0]:`${e.length} policies`,g="deny"===a.decision;return(0,b.jsxs)("div",{className:"sm:col-span-2 lg:col-span-3 mt-1 flex items-start gap-2 rounded border border-amber-500/30 bg-amber-500/5 px-2.5 py-2",children:[(0,b.jsx)(B,{className:"h-3.5 w-3.5 shrink-0 text-amber-500/80 mt-0.5","aria-hidden":"true"}),(0,b.jsxs)("p",{className:"text-[0.7rem] leading-relaxed text-muted-foreground",children:[(0,b.jsx)("span",{className:"font-medium text-foreground",children:g?"Not enforced.":"Ran, but cannot enforce here."})," ",(0,b.jsx)("span",{className:"font-mono",children:f})," ran on"," ",(0,b.jsx)("span",{className:"font-mono",children:a.eventType}),", but ",d," discards hook verdicts for this event",g?" — the action went ahead anyway.":", so a policy cannot block here."," ","Move the check to an event ",d," enforces on, such as"," ",(0,b.jsx)("span",{className:"font-mono",children:"PreToolUse"}),"."]})]})}function aG({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:"▾"}),"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.jsx)(K,{item:a}),(0,b.jsx)(aF,{item:a}),a.policySource&&(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Decided by: "}),(0,b.jsx)("span",{className:"font-mono text-foreground",children:"cloud"===a.policySource&&a.cloudPolicyId?`cloud \xb7 ${a.cloudPolicyId} version ${a.cloudVersion}`:a.policySource})]}),(0,b.jsx)(ad,{item:a}),void 0!==a.cloudDeployment&&(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Cloud deployment: "}),(0,b.jsx)("span",{className:"font-mono text-foreground",children:a.cloudDeployment})]}),(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)(aC,{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)(aC,{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 aH({hooksInstalled:a,onSwitchTab:d}){let{intervalSec:e}=(0,ao.useAutoRefresh)(),{capture:f}=(0,ap.usePostHog)(),h=(0,aq.f)(),i=(0,c.useRef)(!1),[j,k]=(0,c.useState)(()=>(0,ar.m)(h.get("page"))),[l,m]=(0,c.useState)(null),[n,o]=(0,c.useState)([]),[p,q]=(0,c.useState)(null),[s,t]=(0,c.useState)(()=>{let a=h.get("decision");return"allow"===a||"deny"===a||"instruct"===a?a:""}),[u,v]=(0,c.useState)(()=>h.get("event")??""),[w,x]=(0,c.useState)(()=>h.get("policy")??""),[y,z]=(0,c.useState)(()=>h.get("session")??""),[A,B]=(0,c.useState)(()=>{let a=h.get("cli");return(0,as.U)(a)?a:""}),[C,E]=(0,c.useState)(()=>{let a=h.get("source");return"custom"===a||"convention"===a||"cloud"===a||"pack"===a||"jev"===a?a:""}),K=(0,c.useRef)(null),L=(0,c.useRef)(!0),M=(0,c.useRef)({filterDecision:s,filterEventType:u,filterPolicy:w,filterSessionId:y,filterCli:A,filterSource:C});M.current={filterDecision:s,filterEventType:u,filterPolicy:w,filterSessionId:y,filterCli:A,filterSource:C},(0,c.useEffect)(()=>{if(!i.current){i.current=!0;return}h.setAll({decision:s||void 0,event:u||void 0,policy:w||void 0,session:y||void 0,cli:A||void 0,source:C||void 0,page:(0,ar.t)(j)})},[s,u,w,y,A,C,j]);let N=""!==s||""!==u||""!==w||""!==y||""!==A||""!==C,O=(0,c.useCallback)(async a=>{try{let b,{filterDecision:c,filterEventType:d,filterPolicy:e,filterSessionId:f,filterCli:g,filterSource:h}=M.current;b=""!==c||""!==d||""!==e||""!==f||""!==g||""!==h?await G({decision:c||void 0,eventType:d||void 0,policyName:e||void 0,sessionId:f||void 0,integration:g||void 0,source:h||void 0},a):await F(a),m(b)}catch{}},[]);(0,c.useEffect)(()=>{O(j);let a=setInterval(()=>O(j),e>0?1e3*e:5e3);return()=>clearInterval(a)},[j,O,e]),(0,c.useEffect)(()=>{let a=!1,b=()=>{H().then(b=>{a||o(b)}).catch(()=>{})};b();let c=setInterval(b,e>0?1e3*e:5e3);return()=>{a=!0,clearInterval(c)}},[e]),(0,c.useEffect)(()=>(K.current&&clearTimeout(K.current),K.current=setTimeout(()=>{if(k(1),q(null),O(1),L.current){L.current=!1;return}f("activity_filter_changed",{active_filter_count:+(""!==s)+ +(""!==u)+ +(""!==w)+ +(""!==y)+ +(""!==A),has_decision:""!==s,has_event_type:""!==u,has_policy:""!==w,has_session:""!==y,has_cli:""!==A,decision:s||null,event_type:u||null,cli:A||null})},300),()=>{K.current&&clearTimeout(K.current)}),[s,u,w,y,A]);let P=l?.entries??[],Q=l?.totalPages??1;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(I,{pauses:n}),l?.stats&&l.stats.totalEvents>0&&(0,b.jsx)("div",{style:{marginBottom:18},children:(0,b.jsx)(aE,{stats:l.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)(aD,{value:s,onChange:t})]}),(0,b.jsxs)("div",{className:"filter-group",children:[(0,b.jsx)("span",{className:"filter-label",children:"event"}),(0,b.jsxs)("select",{value:u,onChange:a=>v(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:"source"}),(0,b.jsxs)("select",{value:C,onChange:a=>{let b=a.target.value;E("custom"===b||"convention"===b||"cloud"===b||"pack"===b||"jev"===b?b:"")},className:"filter-input","aria-label":"Filter by policy source",children:[(0,b.jsx)("option",{value:"",children:"all sources"}),(0,b.jsx)("option",{value:"custom",children:"custom"}),(0,b.jsx)("option",{value:"convention",children:"convention"}),(0,b.jsx)("option",{value:"cloud",children:"cloud"}),(0,b.jsx)("option",{value:"pack",children:"pack"}),(0,b.jsx)("option",{value:"jev",children:"jev"})]})]}),(0,b.jsxs)("div",{className:"filter-group",children:[(0,b.jsx)("span",{className:"filter-label",children:"cli"}),(0,b.jsxs)("select",{value:A,onChange:a=>{let b=a.target.value;B(""===b||(0,as.U)(b)?b:"")},className:"filter-input","aria-label":"Filter by CLI",children:[(0,b.jsx)("option",{value:"",children:"all clis"}),as.z.map(a=>(0,b.jsx)("option",{value:a,children:(0,as.A)(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:w,onChange:a=>x(a.target.value),placeholder:"filter by policy…",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:y,onChange:a=>z(a.target.value),placeholder:"filter by session…",className:"filter-input"})]}),N&&(0,b.jsx)("button",{type:"button",className:"filter-clear",onClick:()=>{t(""),v(""),B(""),x(""),z(""),E("")},"aria-label":"Clear all filters",children:"[ clear ]"})]}),0===P.length?(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 px-4 text-center",children:[(0,b.jsx)(r,{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:N?"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:P.map((a,d)=>{let e="deny"===a.decision,h=p===d,i="instruct"===a.decision;return(0,b.jsxs)(c.Fragment,{children:[(0,b.jsxs)("tr",{onClick:()=>{q(a=>{let b=a===d?null:d,c=P[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 ${e?"bg-red-500/[0.03] hover:bg-red-500/[0.07] border-l-2 border-l-red-500/40":i?"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"} ${h?"bg-muted/20":""}`,children:[(0,b.jsx)("td",{className:"px-4 py-2",children:(0,b.jsx)(g.f,{className:`h-3.5 w-3.5 text-muted-foreground transition-transform duration-150 ${h?"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:(0,au.f)(a.timestamp)}),(0,b.jsxs)("td",{className:"px-3 py-2",children:[(0,b.jsx)(ax,{decision:a.decision}),a.pausedBy&&(0,b.jsx)(J,{}),(0,b.jsx)(ac,{item:a})]}),(0,b.jsx)("td",{className:"px-3 py-2",children:(0,b.jsx)(ay,{eventType:a.eventType})}),(0,b.jsx)("td",{className:"px-3 py-2",children:(0,b.jsx)(az,{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)(aA,{mode:a.permissionMode}):"—"}),(0,b.jsx)("td",{className:"px-3 py-2",children:(0,b.jsx)(aB,{ms:a.durationMs})}),(0,b.jsx)("td",{className:"px-3 py-2",title:a.sessionId??"",children:(0,b.jsx)(aw,{sessionId:a.sessionId,transcriptPath:a.transcriptPath,integration:a.integration,cwd:a.cwd})})]}),h&&(0,b.jsx)(aG,{item:a})]},`${a.timestamp}-${d}`)})})]})}),(0,b.jsx)(D.f,{currentPage:j,totalPages:Q,onPageChange:a=>{f("activity_pagination_changed",{from_page:j,to_page:a,total_pages:Q}),k(a),q(null)}})]})]})}function aI({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 aJ({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)(C.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)(C.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)(av.f,{variant:"outline",size:"sm",onClick:d,className:"h-7 text-xs",children:"Cancel"}),(0,b.jsx)(av.f,{size:"sm",onClick:()=>e(h),className:"h-7 text-xs",children:"Save"})]})]})})}function aK({message:a,onDismiss:c,onInstall:e,isPending:f}){let{capture:g}=(0,ap.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(52562),g=a.i(89027),h=a.i(64831);let i={name:"code",size:24,node:[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]};i.node;let j=(0,h.f)(i);var k=a.i(85650);let l={name:"package",size:24,node:[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]};l.node;let m=(0,h.f)(l),n={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};n.node;let o=(0,h.f)(n);var p=a.i(41476);let q={name:"shield",size:24,node:[["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"}]]};q.node;let r=(0,h.f)(q),s={name:"shield-alert",size:24,node:[["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"}]]};s.node;let t=(0,h.f)(s),u={name:"shield-check",size:24,node:[["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"}]]};u.node;let v=(0,h.f)(u),w={name:"shield-x",size:24,node:[["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"}]],aliases:["shield-close"]};w.node;let x=(0,h.f)(w),y={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};y.node;let z=(0,h.f)(y),A={name:"triangle-alert",size:24,node:[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["alert-triangle"]};A.node;let B=(0,h.f)(A);var C=a.i(74215),D=a.i(65967),E=a.i(5050);let F=(0,E.createServerReference)("40597059608d8cfd1326f2f52b5dbf2675d9ae353e",E.callServer,void 0,E.findSourceMapURL,"getHookActivityAction"),G=(0,E.createServerReference)("6052b34d2e59825e93c0f9f6841554b4a903623a89",E.callServer,void 0,E.findSourceMapURL,"searchHookActivityAction"),H=(0,E.createServerReference)("003e1fdbbe4fdd5c55596a40a7178b9dbeb7625645",E.callServer,void 0,E.findSourceMapURL,"getActivePausesAction");function I({pauses:a,now:d}){let[e,f]=(0,c.useState)(()=>Date.now());(0,c.useEffect)(()=>{let a=setInterval(()=>f(Date.now()),3e4);return()=>clearInterval(a)},[]);let g=d??e,h=a.filter(a=>a.expiresAt>g);if(0===h.length)return null;let i=h.reduce((a,b)=>a.expiresAt<b.expiresAt?a:b);return(0,b.jsxs)("div",{role:"status",className:"mb-4 flex items-start gap-2.5 rounded border border-amber-500/40 bg-amber-500/[0.07] px-3 py-2.5",children:[(0,b.jsx)(t,{className:"h-4 w-4 shrink-0 text-amber-500 mt-0.5","aria-hidden":"true"}),(0,b.jsxs)("div",{className:"text-xs leading-relaxed",children:[(0,b.jsxs)("p",{className:"font-medium text-foreground",children:["Enforcement is paused for ",h.length," session",1===h.length?"":"s"," —"," ",function(a){if(a<=0)return"expiring now";if(a<6e4)return"under a minute";let b=Math.round(a/6e4);if(b<60)return`${b}m`;let c=Math.floor(b/60),d=b%60;return 0===d?`${c}h`:`${c}h${d}m`}(i.expiresAt-g)," left",h.length>1?" on the next to expire":"","."]}),(0,b.jsxs)("p",{className:"text-muted-foreground mt-0.5",children:["Builtin, custom and convention policies are suspended for"," ",1===h.length?"that session":"those sessions","; cloud-managed policies keep enforcing. It lifts on its own — or run"," ",(0,b.jsx)("span",{className:"font-mono text-foreground",children:"failproofai config --resume"}),"."]})]})]})}function J(){return(0,b.jsx)("span",{title:"Enforcement was paused for this session — local policies did not run",className:"ml-1.5 inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium uppercase tracking-wide border border-amber-500/40 bg-amber-500/10 text-amber-600 dark:text-amber-500",children:"paused"})}function K({item:a}){if(!a.pausedBy)return null;let c="number"==typeof a.pauseExpiresAt?new Date(a.pauseExpiresAt).toLocaleTimeString():null;return(0,b.jsxs)("div",{className:"sm:col-span-2 lg:col-span-3 mt-1 flex items-start gap-2 rounded border border-amber-500/30 bg-amber-500/5 px-2.5 py-2",children:[(0,b.jsx)(B,{className:"h-3.5 w-3.5 shrink-0 text-amber-500/80 mt-0.5","aria-hidden":"true"}),(0,b.jsxs)("p",{className:"text-[0.7rem] leading-relaxed text-muted-foreground",children:[(0,b.jsx)("span",{className:"font-medium text-foreground",children:"Not enforced — paused."})," Enforcement was suspended for this session","cli"===a.pausedBy?" from the CLI":` by ${a.pausedBy}`,c?`, lifting at ${c}`:"",". Builtin, custom and convention policies did not run for this event; cloud-managed policies did."]})]})}let L=["evaluator","jevDecision","jevCleared","jevFallbackReason","jevLatencyMs","jevModel","jevMode","jevChecks"],M=new Set(["jev","jev-fallback"]),N=new Set(["allow","instruct","deny"]),O=new Set(["observe","enforce"]),P=/^([a-z0-9]+(?:-[a-z0-9]+)*)\s*(?:$|[:(])/,Q=/^http-\d{3}$/,R="other",S=new Set(["aborted","cloudflare-error","cloudflare-incomplete","config","error","malformed","model-mismatch","network","no-api-key","no-transport","other","out-of-credits","prepare-error","provider-refused","rate-limited","request-cut","request-too-large","timeout","truncated","unavailable","upstream-error"]),T=new Map([["prepare","prepare-error"],["error","error"],["timeout","timeout"],["network","network"],["malformed","malformed"],["truncated","truncated"],["rate-limited","rate-limited"],["out-of-credits","out-of-credits"],["model-mismatch","model-mismatch"],["request-too-large","request-too-large"],["config","config"]]),U=/^[A-Za-z0-9._:/@~+-]{1,200}$/,V=/[\u0000-\u001f\u007f-\u009f\u2028\u2029]/,W=/^(?:custom|pack|cloud|failproofai|\.failproofai-[A-Za-z0-9_-]{1,32})\//;function X(a){return!("string"!=typeof a||0===a.length||[...a].length>200||V.test(a))&&(!/\s/.test(a)||W.test(a))}let Y=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/,Z=/^[a-z][a-z0-9_]{0,31}$/,$=new Set(["none","deny","instruct","overridden"]),_=new Set(["not-detected","exempt","fired","injection","user-asked","op-requested","task-step","downgraded","scan-incomplete"]),aa=a=>"number"==typeof a&&Number.isFinite(a)&&a>=0&&a<=1,ab=a=>Math.round(100*a)/100;function ac(a){if(!L.some(b=>void 0!==a[b]))return a;let b={...a},c=a=>{delete b[a]};"string"==typeof b.evaluator&&M.has(b.evaluator)||c("evaluator"),"string"==typeof b.jevDecision&&N.has(b.jevDecision)||c("jevDecision");let d=void 0!==b.jevMode&&!("string"==typeof b.jevMode&&O.has(b.jevMode));if("string"==typeof b.jevMode&&O.has(b.jevMode)||c("jevMode"),d&&c("jevCleared"),Array.isArray(b.jevCleared)){let a=[...new Set(b.jevCleared.filter(X))].slice(0,64);b.jevCleared=a}else c("jevCleared");let e=function(a){if("string"!=typeof a)return;let b=a.trim().toLowerCase();if(0===b.length)return;let c=P.exec(b)?.[1];if(void 0===c||c.length>40)return R;if(Q.test(c))return c;let d=T.get(c)??c;return S.has(d)?d:R}(b.jevFallbackReason);void 0===e?c("jevFallbackReason"):b.jevFallbackReason=e,"number"==typeof b.jevLatencyMs&&Number.isFinite(b.jevLatencyMs)&&b.jevLatencyMs>=0?b.jevLatencyMs=Math.round(b.jevLatencyMs):c("jevLatencyMs"),"string"==typeof b.jevModel&&U.test(b.jevModel.trim())?b.jevModel=b.jevModel.trim():c("jevModel");let f="jev"===b.evaluator?function(a){if(!Array.isArray(a))return;let b=[];for(let c of a){if(b.length>=32)break;let a=function(a){if(!a||"object"!=typeof a||Array.isArray(a)||"string"!=typeof a.check||!Y.test(a.check)||"string"!=typeof a.verdict||!$.has(a.verdict)||"string"!=typeof a.why||!_.has(a.why)||!aa(a.p))return null;let b={check:a.check,verdict:a.verdict,why:a.why,p:ab(a.p)};if("string"==typeof a.policy&&X(a.policy)&&!/\s/.test(a.policy)&&/^(?:cloud|pack)\//.test(a.policy)&&(b.policy=a.policy),aa(a.exempt)&&(b.exempt=ab(a.exempt)),!0===a.watched&&(b.watched=!0),a.probes&&"object"==typeof a.probes&&!Array.isArray(a.probes)){let c={};for(let[b,d]of Object.entries(a.probes)){if(Object.keys(c).length>=8)break;Z.test(b)&&aa(d)&&(c[b]=ab(d))}Object.keys(c).length>0&&(b.probes=c)}return b}(c);a&&b.push(a)}return a.length>0&&0===b.length?void 0:b}(b.jevChecks):void 0;return void 0===f?c("jevChecks"):b.jevChecks=f,b}function ad(a){return"jev-fallback"===a.evaluator?"fallback":"jev"!==a.evaluator?null:Array.isArray(a.jevChecks)&&0===a.jevChecks.length?"no-request":void 0!==a.jevCleared||void 0!==a.jevLatencyMs||void 0!==a.jevModel||"deny"===a.jevDecision||"instruct"===a.jevDecision?"answered":"allow"===a.jevDecision?"no-request":"not-consulted"}let ae=new Set(["request-cut","truncated","model-mismatch"]);function af(a){return"jev-fallback"===a.evaluator&&(void 0!==a.jevDecision||ae.has(a.jevFallbackReason??""))}let ag={allow:0,instruct:1,deny:2},ah={cleared:{label:"jev cleared",title:"Jev reviewed a reviewable policy's block and cleared it",className:"border-sky-500/40 bg-sky-500/10 text-sky-600 dark:text-sky-400"},"would-clear":{label:"jev observe",title:"Observe mode: Jev would have cleared a block here; the regex result was enforced",className:"border-sky-500/30 bg-sky-500/5 text-sky-600/80 dark:text-sky-400/80"},"observe-stricter":{label:"jev observe",title:"Observe mode: Jev would have been stricter here; the regex result was enforced",className:"border-sky-500/30 bg-sky-500/5 text-sky-600/80 dark:text-sky-400/80"},"fallback-stricter":{label:"jev fallback",title:"Jev answered but its answer was not applied (e.g. the call was truncated); it would have been stricter than the regex result",className:"border-amber-500/40 bg-amber-500/10 text-amber-600 dark:text-amber-400"},fallback:{label:"jev fallback",title:"Jev's answer was not used for this call (unavailable, truncated or mismatched); the regex policies decided alone",className:"border-muted-foreground/30 bg-muted/40 text-muted-foreground"}};function ai({item:a}){let c=function(a){let b=ac(a),c=ad(ac(b));if(null===c||"not-consulted"===c||"no-request"===c)return null;let d=()=>(ag[b.jevDecision??"allow"]??0)>(ag[a.decision??"allow"]??0);if("fallback"===c)return void 0!==b.jevDecision&&d()?"fallback-stricter":"fallback";let e=(b.jevCleared??[]).length>0;return"observe"===b.jevMode?e?"would-clear":d()?"observe-stricter":null:e?"cleared":null}(a);if(!c)return null;let d=ah[c];return(0,b.jsx)("span",{title:d.title,className:`ml-1.5 inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium uppercase tracking-wide border ${d.className}`,children:d.label})}function aj({item:a}){let c=function(a){let b=ac(a),c=ad(b);if(null===c)return null;if("not-consulted"===c)return["Jev not consulted: a hard policy's deny is final"];if("no-request"===c)return["Jev not asked: no semantic policy applies to this call"];let d=[];if("fallback"===c){let a=b.jevFallbackReason??"unknown reason";return af(b)?(d.push(`Jev's answer not applied: ${a}`),b.jevDecision&&d.push(`Jev verdict (not applied): ${b.jevDecision}`)):d.push(`Jev unavailable: ${a}`),d.push("the regex policies decided alone"),void 0!==b.jevLatencyMs&&d.push(`${b.jevLatencyMs} ms`),b.jevModel&&af(b)&&d.push(b.jevModel),d}b.jevDecision&&d.push(`Jev verdict: ${b.jevDecision}`);let e=b.jevCleared??[];return e.length>0&&d.push(`${"observe"===b.jevMode?"would have cleared":"cleared"} ${e.join(", ")}`),"observe"===b.jevMode&&d.push("observe mode: the regex result was enforced"),void 0!==b.jevLatencyMs&&d.push(`${b.jevLatencyMs} ms`),b.jevModel&&d.push(b.jevModel),0===d.length&&d.push("Jev answered"),d}(a);return c?(0,b.jsxs)("div",{className:"sm:col-span-2 lg:col-span-3",children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Semantic review: "}),(0,b.jsx)("span",{className:"font-mono text-foreground",children:c.join(" · ")})]}):null}let ak=(0,E.createServerReference)("005f40530ee0913f0dc33a3479bf2f5c22afa8083c",E.callServer,void 0,E.findSourceMapURL,"getHooksConfigAction"),al=(0,E.createServerReference)("607994c5578e5a2f52941151d4bc620a59f91e4a5a",E.callServer,void 0,E.findSourceMapURL,"toggleCustomPolicyAction"),am=(0,E.createServerReference)("0091894737391542754ac22e9e988149d8d86587ec",E.callServer,void 0,E.findSourceMapURL,"addBundledPackWebAction"),an=(0,E.createServerReference)("606e89f49f88d85ca3f83cff66f1cfd3499e54245e",E.callServer,void 0,E.findSourceMapURL,"addPackWebAction"),ao=(0,E.createServerReference)("4004c2b9d974ae0fc2f8c6f6e0b9b50b2811e0039f",E.callServer,void 0,E.findSourceMapURL,"previewPackWebAction"),ap=(0,E.createServerReference)("404917efc720f30711179f4926d6090eb451b4271e",E.callServer,void 0,E.findSourceMapURL,"removePackWebAction"),aq=(0,E.createServerReference)("703e3ddfd8b0240a37bbe43dd47ab20c4f27b84557",E.callServer,void 0,E.findSourceMapURL,"togglePackPolicyAction"),ar=(0,E.createServerReference)("603aaaefb9bed030bbf185af952ce6252653c8cdd5",E.callServer,void 0,E.findSourceMapURL,"installHooksWebAction"),as=(0,E.createServerReference)("60ef411770c2e2856eba3fd19177f0f4baf51d1ebf",E.callServer,void 0,E.findSourceMapURL,"removeHooksWebAction"),at=(0,E.createServerReference)("60d7b57a1fcc6e6010c5255fca93c526c3b8281a19",E.callServer,void 0,E.findSourceMapURL,"updatePolicyParamsAction");var au=a.i(6236),av=a.i(10765),aw=a.i(90619),ax=a.i(95947),ay=a.i(87256);let az={claude:{PreToolUse:"block",UserPromptSubmit:"block",PermissionRequest:"block",Stop:"block",SubagentStop:"block",PreCompact:"block",PostToolBatch:"block",ConfigChange:"block",UserPromptExpansion:"block",TaskCreated:"block",TaskCompleted:"block",TeammateIdle:"block",Elicitation:"block",ElicitationResult:"block",PostToolUse:"observe",PostToolUseFailure:"observe",SessionStart:"observe",Setup:"observe",SubagentStart:"observe",SessionEnd:"observe",StopFailure:"observe",PermissionDenied:"observe",Notification:"observe",InstructionsLoaded:"observe",CwdChanged:"observe",FileChanged:"observe",PostCompact:"observe",WorktreeRemove:"observe"},codex:{PreToolUse:"block",PermissionRequest:"block",UserPromptSubmit:"block",Stop:"block",SubagentStop:"block",PostToolUse:"block",SessionStart:"observe",SubagentStart:"observe",PreCompact:"observe",PostCompact:"observe"},copilot:{PreToolUse:"block",Stop:"block",SubagentStop:"block",UserPromptSubmit:"block",PermissionRequest:"block",PostToolUse:"block",SessionStart:"observe",SessionEnd:"observe",PostToolUseFailure:"observe",PreCompact:"observe",Notification:"observe"},cursor:{PreToolUse:"block",Stop:"block",UserPromptSubmit:"block",PostToolUse:"observe",SessionStart:"observe",SessionEnd:"observe"},opencode:{PreToolUse:"block",PostToolUse:"observe",SessionStart:"observe",SessionEnd:"observe",UserPromptSubmit:"observe",PermissionRequest:"observe"},pi:{PreToolUse:"block",UserPromptSubmit:"block",PostToolUse:"observe",SessionStart:"observe",SessionEnd:"observe",Stop:"observe"},hermes:{PreToolUse:"block",PostToolUse:"observe",SubagentStop:"observe",SessionStart:"observe",SessionEnd:"observe"},openclaw:{PreToolUse:"block",UserPromptSubmit:"block",Stop:"block",PostToolUse:"observe",SessionStart:"observe",SessionEnd:"observe",SubagentStop:"observe",PreCompact:"observe"},factory:{PreToolUse:"block",UserPromptSubmit:"block",Stop:"block",PreCompact:"block",PostToolUse:"observe",SubagentStop:"observe",SessionStart:"observe",SessionEnd:"observe",Notification:"observe"},devin:{PreToolUse:"block",UserPromptSubmit:"block",Stop:"block",PermissionRequest:"block",PostToolUse:"observe",SessionStart:"observe",SessionEnd:"observe"},antigravity:{PreToolUse:"block",Stop:"block",PostToolUse:"observe",UserPromptSubmit:"observe"},goose:{PreToolUse:"block",UserPromptSubmit:"observe",PostToolUse:"observe",SessionStart:"observe",SessionEnd:"observe"}};var aA=a.i(80977),aB=a.i(40695);function aC({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);if(h||i||j||k||l){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":"pi";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 m=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 m?(0,b.jsx)(e.default,{href:`/project/${encodeURIComponent(m)}/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 aD({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)(x,{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)(t,{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)(v,{className:"h-3 w-3"}),"Allow"]})}function aE({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 aF({integration:a}){if(!a)return null;let c=(0,ay.A)(a),d=(0,ay.G)(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 aG({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 aH({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 aI({text:a,field:d}){let[e,g]=(0,c.useState)(!1),{capture:h}=(0,av.usePostHog)(),i=async b=>{b.stopPropagation(),h("activity_copy_clicked",{field:d??"unknown"});try{await navigator.clipboard.writeText(a),g(!0),setTimeout(()=>g(!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),g(!0),setTimeout(()=>g(!1),1500)}};return(0,b.jsx)("button",{onClick:i,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)(f.f,{className:"h-3 w-3 text-emerald-400"}):(0,b.jsx)(k.f,{className:"h-3 w-3"})})}function aJ({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 aK({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 aL({item:a}){if("observe"!==function(a,b){if(!a||!b)return;let c=az[a];if(c)return c[b]}(a.integration,a.eventType))return null;let c=a.matchedPolicies??[];if(0===c.length)return null;let d=a.integration?(0,ay.A)(a.integration):"This CLI",e=c.map(a=>a.replace(/^(custom|\.failproofai-(project|user))\//,"")),f=1===e.length?e[0]:`${e.length} policies`,g="deny"===a.decision;return(0,b.jsxs)("div",{className:"sm:col-span-2 lg:col-span-3 mt-1 flex items-start gap-2 rounded border border-amber-500/30 bg-amber-500/5 px-2.5 py-2",children:[(0,b.jsx)(B,{className:"h-3.5 w-3.5 shrink-0 text-amber-500/80 mt-0.5","aria-hidden":"true"}),(0,b.jsxs)("p",{className:"text-[0.7rem] leading-relaxed text-muted-foreground",children:[(0,b.jsx)("span",{className:"font-medium text-foreground",children:g?"Not enforced.":"Ran, but cannot enforce here."})," ",(0,b.jsx)("span",{className:"font-mono",children:f})," ran on"," ",(0,b.jsx)("span",{className:"font-mono",children:a.eventType}),", but ",d," discards hook verdicts for this event",g?" — the action went ahead anyway.":", so a policy cannot block here."," ","Move the check to an event ",d," enforces on, such as"," ",(0,b.jsx)("span",{className:"font-mono",children:"PreToolUse"}),"."]})]})}function aM({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:"▾"}),"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.jsx)(K,{item:a}),(0,b.jsx)(aL,{item:a}),a.policySource&&(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Decided by: "}),(0,b.jsx)("span",{className:"font-mono text-foreground",children:"cloud"===a.policySource&&a.cloudPolicyId?`cloud \xb7 ${a.cloudPolicyId} version ${a.cloudVersion}`:a.policySource})]}),(0,b.jsx)(aj,{item:a}),void 0!==a.cloudDeployment&&(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Cloud deployment: "}),(0,b.jsx)("span",{className:"font-mono text-foreground",children:a.cloudDeployment})]}),(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)(aI,{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)(aI,{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 aN({hooksInstalled:a,onSwitchTab:d}){let{intervalSec:e}=(0,au.useAutoRefresh)(),{capture:f}=(0,av.usePostHog)(),h=(0,aw.f)(),i=(0,c.useRef)(!1),[j,k]=(0,c.useState)(()=>(0,ax.m)(h.get("page"))),[l,m]=(0,c.useState)(null),[n,o]=(0,c.useState)([]),[p,q]=(0,c.useState)(null),[s,t]=(0,c.useState)(()=>{let a=h.get("decision");return"allow"===a||"deny"===a||"instruct"===a?a:""}),[u,v]=(0,c.useState)(()=>h.get("event")??""),[w,x]=(0,c.useState)(()=>h.get("policy")??""),[y,z]=(0,c.useState)(()=>h.get("session")??""),[A,B]=(0,c.useState)(()=>{let a=h.get("cli");return(0,ay.U)(a)?a:""}),[C,E]=(0,c.useState)(()=>{let a=h.get("source");return"custom"===a||"convention"===a||"cloud"===a||"pack"===a||"jev"===a?a:""}),K=(0,c.useRef)(null),L=(0,c.useRef)(!0),M=(0,c.useRef)({filterDecision:s,filterEventType:u,filterPolicy:w,filterSessionId:y,filterCli:A,filterSource:C});M.current={filterDecision:s,filterEventType:u,filterPolicy:w,filterSessionId:y,filterCli:A,filterSource:C},(0,c.useEffect)(()=>{if(!i.current){i.current=!0;return}h.setAll({decision:s||void 0,event:u||void 0,policy:w||void 0,session:y||void 0,cli:A||void 0,source:C||void 0,page:(0,ax.t)(j)})},[s,u,w,y,A,C,j]);let N=""!==s||""!==u||""!==w||""!==y||""!==A||""!==C,O=(0,c.useCallback)(async a=>{try{let b,{filterDecision:c,filterEventType:d,filterPolicy:e,filterSessionId:f,filterCli:g,filterSource:h}=M.current;b=""!==c||""!==d||""!==e||""!==f||""!==g||""!==h?await G({decision:c||void 0,eventType:d||void 0,policyName:e||void 0,sessionId:f||void 0,integration:g||void 0,source:h||void 0},a):await F(a),m(b)}catch{}},[]);(0,c.useEffect)(()=>{O(j);let a=setInterval(()=>O(j),e>0?1e3*e:5e3);return()=>clearInterval(a)},[j,O,e]),(0,c.useEffect)(()=>{let a=!1,b=()=>{H().then(b=>{a||o(b)}).catch(()=>{})};b();let c=setInterval(b,e>0?1e3*e:5e3);return()=>{a=!0,clearInterval(c)}},[e]),(0,c.useEffect)(()=>(K.current&&clearTimeout(K.current),K.current=setTimeout(()=>{if(k(1),q(null),O(1),L.current){L.current=!1;return}f("activity_filter_changed",{active_filter_count:+(""!==s)+ +(""!==u)+ +(""!==w)+ +(""!==y)+ +(""!==A),has_decision:""!==s,has_event_type:""!==u,has_policy:""!==w,has_session:""!==y,has_cli:""!==A,decision:s||null,event_type:u||null,cli:A||null})},300),()=>{K.current&&clearTimeout(K.current)}),[s,u,w,y,A]);let P=l?.entries??[],Q=l?.totalPages??1;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(I,{pauses:n}),l?.stats&&l.stats.totalEvents>0&&(0,b.jsx)("div",{style:{marginBottom:18},children:(0,b.jsx)(aK,{stats:l.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)(aJ,{value:s,onChange:t})]}),(0,b.jsxs)("div",{className:"filter-group",children:[(0,b.jsx)("span",{className:"filter-label",children:"event"}),(0,b.jsxs)("select",{value:u,onChange:a=>v(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:"source"}),(0,b.jsxs)("select",{value:C,onChange:a=>{let b=a.target.value;E("custom"===b||"convention"===b||"cloud"===b||"pack"===b||"jev"===b?b:"")},className:"filter-input","aria-label":"Filter by policy source",children:[(0,b.jsx)("option",{value:"",children:"all sources"}),(0,b.jsx)("option",{value:"custom",children:"custom"}),(0,b.jsx)("option",{value:"convention",children:"convention"}),(0,b.jsx)("option",{value:"cloud",children:"cloud"}),(0,b.jsx)("option",{value:"pack",children:"pack"}),(0,b.jsx)("option",{value:"jev",children:"jev"})]})]}),(0,b.jsxs)("div",{className:"filter-group",children:[(0,b.jsx)("span",{className:"filter-label",children:"cli"}),(0,b.jsxs)("select",{value:A,onChange:a=>{let b=a.target.value;B(""===b||(0,ay.U)(b)?b:"")},className:"filter-input","aria-label":"Filter by CLI",children:[(0,b.jsx)("option",{value:"",children:"all clis"}),ay.z.map(a=>(0,b.jsx)("option",{value:a,children:(0,ay.A)(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:w,onChange:a=>x(a.target.value),placeholder:"filter by policy…",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:y,onChange:a=>z(a.target.value),placeholder:"filter by session…",className:"filter-input"})]}),N&&(0,b.jsx)("button",{type:"button",className:"filter-clear",onClick:()=>{t(""),v(""),B(""),x(""),z(""),E("")},"aria-label":"Clear all filters",children:"[ clear ]"})]}),0===P.length?(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 px-4 text-center",children:[(0,b.jsx)(r,{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:N?"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:P.map((a,d)=>{let e="deny"===a.decision,h=p===d,i="instruct"===a.decision;return(0,b.jsxs)(c.Fragment,{children:[(0,b.jsxs)("tr",{onClick:()=>{q(a=>{let b=a===d?null:d,c=P[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 ${e?"bg-red-500/[0.03] hover:bg-red-500/[0.07] border-l-2 border-l-red-500/40":i?"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"} ${h?"bg-muted/20":""}`,children:[(0,b.jsx)("td",{className:"px-4 py-2",children:(0,b.jsx)(g.f,{className:`h-3.5 w-3.5 text-muted-foreground transition-transform duration-150 ${h?"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:(0,aA.f)(a.timestamp)}),(0,b.jsxs)("td",{className:"px-3 py-2",children:[(0,b.jsx)(aD,{decision:a.decision}),a.pausedBy&&(0,b.jsx)(J,{}),(0,b.jsx)(ai,{item:a})]}),(0,b.jsx)("td",{className:"px-3 py-2",children:(0,b.jsx)(aE,{eventType:a.eventType})}),(0,b.jsx)("td",{className:"px-3 py-2",children:(0,b.jsx)(aF,{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)(aG,{mode:a.permissionMode}):"—"}),(0,b.jsx)("td",{className:"px-3 py-2",children:(0,b.jsx)(aH,{ms:a.durationMs})}),(0,b.jsx)("td",{className:"px-3 py-2",title:a.sessionId??"",children:(0,b.jsx)(aC,{sessionId:a.sessionId,transcriptPath:a.transcriptPath,integration:a.integration,cwd:a.cwd})})]}),h&&(0,b.jsx)(aM,{item:a})]},`${a.timestamp}-${d}`)})})]})}),(0,b.jsx)(D.f,{currentPage:j,totalPages:Q,onPageChange:a=>{f("activity_pagination_changed",{from_page:j,to_page:a,total_pages:Q}),k(a),q(null)}})]})]})}function aO({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 aP({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)(C.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)(C.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)(aB.f,{variant:"outline",size:"sm",onClick:d,className:"h-7 text-xs",children:"Cancel"}),(0,b.jsx)(aB.f,{size:"sm",onClick:()=>e(h),className:"h-7 text-xs",children:"Save"})]})]})})}function aQ({message:a,onDismiss:c,onInstall:e,isPending:f}){let{capture:g}=(0,av.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; }
|
|
5
5
|
}
|
|
6
|
-
`}),(0,b.jsxs)("div",{className:"rounded-lg border border-red-500/40 bg-red-950/95 shadow-2xl shadow-red-900/40 overflow-hidden backdrop-blur-sm",children:[(0,b.jsx)("div",{className:"h-0.5 w-full bg-gradient-to-r from-red-600 via-red-400 to-red-600"}),(0,b.jsxs)("div",{className:"p-4",children:[(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)("div",{className:"shrink-0 mt-0.5 flex h-5 w-5 items-center justify-center rounded-full bg-red-500 ring-2 ring-red-500/30",children:(0,b.jsx)(C.X,{className:"h-3 w-3 text-white",strokeWidth:3})}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("p",{className:"text-[0.65rem] font-bold uppercase tracking-widest text-red-400 mb-0.5",children:"Error"}),(0,b.jsx)("p",{className:"text-sm text-red-100 leading-snug",children:a})]}),(0,b.jsx)("button",{onClick:c,className:"shrink-0 -mt-0.5 -mr-0.5 rounded p-0.5 text-red-400/60 transition-colors hover:bg-red-500/20 hover:text-red-200","aria-label":"Dismiss",children:(0,b.jsx)(C.X,{className:"h-4 w-4"})})]}),(0,b.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,b.jsx)(av.f,{size:"sm",onClick:()=>{g("hooks_install_from_error_clicked",{error_message:a.slice(0,200)}),c(),e()},disabled:f,className:"h-7 flex-1 border-0 bg-red-500 px-3 text-xs font-semibold text-white hover:bg-red-400 disabled:opacity-50",children:"Install hooks"}),(0,b.jsx)(av.f,{variant:"ghost",size:"sm",onClick:c,className:"h-7 px-3 text-xs text-red-400 hover:bg-red-500/10 hover:text-red-200",children:"Dismiss"})]})]})]})]}),document.body)}function aL({onHooksInstallChange:a}){let[d,e]=(0,c.useState)(null),[f,g]=(0,c.useTransition)(),[h,i]=(0,c.useState)(null),[k,l]=(0,c.useState)(null),[m,n]=(0,c.useState)(null),[o,q]=(0,c.useState)(()=>new Set),s=(0,c.useRef)(!1),{capture:t}=(0,ap.usePostHog)(),u=(0,c.useCallback)((a,b)=>{t("action_error_displayed",{error_type:a,error_message:b.slice(0,200)}),i(b)},[t]),v=(0,c.useCallback)(async()=>{try{let b=await ae();e(b),a?.(b.clis.some(a=>a.installed))}catch{}},[a]);(0,c.useEffect)(()=>{v()},[v]),(0,c.useEffect)(()=>{d&&(s.current?q(new Set(d.clis.filter(a=>a.installed).map(a=>a.id))):(s.current=!0,q(new Set(d.clis.filter(a=>a.installed||a.detected).map(a=>a.id)))))},[d?.clis]);let w=(0,c.useMemo)(()=>new Set((d?.clis??[]).filter(a=>a.installed).map(a=>a.id)),[d?.clis]),x=(0,c.useMemo)(()=>{let a=[],b=[];for(let c of d?.clis??[]){let d=o.has(c.id);d&&!w.has(c.id)&&a.push(c.id),!d&&w.has(c.id)&&b.push(c.id)}return{toInstall:a,toRemove:b}},[d?.clis,o,w]),y=x.toInstall.length>0||x.toRemove.length>0,z=(a,b)=>{d&&(e(c=>c?{...c,customPolicies:c.customPolicies?.map(c=>c.id===a?{...c,enabled:!b}:c),conventionPolicies:c.conventionPolicies.map(c=>({...c,policies:c.policies.map(c=>c.id===a?{...c,enabled:!b}:c)}))}:c),g(async()=>{try{await af(a,!b)}catch{u("custom_policy_toggle","Failed to save custom policy change."),v()}}))},A=()=>{let{toInstall:a,toRemove:b}=x;(0!==a.length||0!==b.length)&&(t("cli_install_remove_submitted",{to_install:a,to_remove:b,count_install:a.length,count_remove:b.length}),g(async()=>{try{i(null),a.length>0&&await al("user",a),b.length>0&&await am("user",b)}catch(a){u("cli_apply",a instanceof Error?a.message:"Failed to apply changes.")}finally{await v()}}))};if(!d)return(0,b.jsx)("div",{className:"flex items-center justify-center py-16",children:(0,b.jsxs)("span",{className:"text-sm text-muted-foreground",children:["Loading","…"]})});let B=d.clis.some(a=>a.installed),C=w.size,D=o.size,E=Array.from(new Set(d.policies.map(a=>a.category)));return(0,b.jsxs)(b.Fragment,{children:[m&&(0,b.jsx)(aJ,{policy:m,onClose:()=>{t("policy_config_modal_closed",{policy_name:m.name,action:"cancel"}),n(null)},onSave:a=>{var b,c;if(!m)return;let d=m.packId?(b=m.packId,c=m.name,`pack/${b}/${c}`):m.name;n(null),g(async()=>{try{i(null),await an(d,a),await v()}catch(a){u("param_update",a instanceof Error?a.message:"Failed to save configuration.")}})}}),(0,b.jsxs)("div",{className:"bg-card border border-border rounded-lg overflow-hidden",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-4 px-5 py-3.5 border-b border-border/60 bg-muted/10",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3 min-w-0 flex-wrap",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:`h-2 w-2 rounded-full transition-shadow ${B?"bg-emerald-400 shadow-[0_0_8px_rgba(52,211,153,0.6)]":"bg-muted-foreground/40"}`,"aria-hidden":!0}),(0,b.jsx)("span",{className:"text-[0.65rem] uppercase tracking-[0.2em] font-mono text-foreground/90",children:"Integrations"})]}),(0,b.jsx)("span",{className:"text-[0.65rem] font-mono text-muted-foreground/40",children:"·"}),(0,b.jsxs)("div",{className:"text-[0.65rem] uppercase tracking-[0.2em] font-mono text-muted-foreground",children:[(0,b.jsx)("span",{className:"text-foreground tabular-nums",children:C.toString().padStart(2,"0")}),(0,b.jsxs)("span",{className:"opacity-50",children:[" / 0",d.clis.length," active"]})]}),y&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:"text-[0.65rem] font-mono text-muted-foreground/40",children:"·"}),(0,b.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-[0.65rem] uppercase tracking-[0.2em] font-mono text-pink-400",children:[(0,b.jsx)("span",{className:"h-1 w-1 rounded-full bg-pink-400 animate-pulse"}),x.toInstall.length+x.toRemove.length," pending"]})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,b.jsx)(av.f,{variant:"outline",size:"sm",onClick:()=>{let a=Array.from(w).filter(a=>o.has(a));0!==a.length&&(t("cli_reinstall_submitted",{cli_ids:a,count:a.length}),g(async()=>{try{i(null),await al("user",a)}catch(a){u("cli_reinstall",a instanceof Error?a.message:"Failed to reinstall.")}finally{await v()}}))},disabled:f||0===D,className:"text-xs h-7 px-3 font-mono",children:"Reinstall"}),(0,b.jsx)(av.f,{variant:"default",size:"sm",onClick:A,disabled:f||!y,className:"text-xs h-7 px-3 font-mono",children:"Apply changes"})]})]}),(0,b.jsx)("div",{className:"divide-y divide-border/30 border-b border-border/60",children:d.clis.map((a,c)=>{let e=o.has(a.id),g=w.has(a.id),h=e!==g,i=(0,as.G)(a.id),j=i.split(" ").find(a=>a.startsWith("text-"))??"text-foreground";return(0,b.jsxs)("label",{className:`group relative flex items-center gap-3 pl-6 pr-5 py-3 cursor-pointer transition-colors hover:bg-muted/15 ${h?"bg-pink-500/[0.04]":""}`,children:[(0,b.jsx)("div",{className:`absolute left-0 top-0 bottom-0 w-[3px] ${j} bg-current transition-opacity ${e?"opacity-100":"opacity-25 group-hover:opacity-60"}`,"aria-hidden":!0}),(0,b.jsx)("div",{className:"font-mono text-[0.65rem] text-muted-foreground/40 tabular-nums w-6 select-none",children:(c+1).toString().padStart(2,"0")}),(0,b.jsxs)("div",{className:"relative shrink-0",children:[(0,b.jsx)("input",{type:"checkbox",checked:e,onChange:()=>{var b;return b=a.id,void q(a=>{let c=new Set(a),e=!c.has(b);e?c.add(b):c.delete(b);let f=d?.clis.find(a=>a.id===b);return t("cli_selection_toggled",{cli_id:b,checked:e,current_state:f?.installed?"installed":f?.detected?"detected":"inactive"}),c})},disabled:f,className:"sr-only peer","aria-label":`Toggle ${a.label}`}),(0,b.jsx)("div",{className:`h-[18px] w-[18px] rounded-sm border transition-all peer-focus-visible:ring-2 peer-focus-visible:ring-primary/40 ${e?"bg-primary border-primary":"bg-background/50 border-border group-hover:border-foreground/40"}`,children:e&&(0,b.jsx)("svg",{viewBox:"0 0 18 18",className:"h-full w-full text-primary-foreground",fill:"none","aria-hidden":!0,children:(0,b.jsx)("path",{d:"M4 9.5L7.5 12.5L14 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),(0,b.jsx)("div",{className:"min-w-[150px] shrink-0",children:(0,b.jsx)("div",{className:"text-sm font-medium text-foreground",children:a.label})}),(0,b.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0",children:[g?(0,b.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 rounded-sm text-[0.6rem] uppercase tracking-[0.15em] font-mono border ${i}`,children:[(0,b.jsx)("span",{className:"h-1 w-1 rounded-full bg-current shadow-[0_0_4px_currentColor]"}),"Active"]}):a.detected?(0,b.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-sm text-[0.6rem] uppercase tracking-[0.15em] font-mono border border-border/60 text-muted-foreground/80 bg-muted/20",children:[(0,b.jsx)("span",{className:"h-1 w-1 rounded-full bg-current opacity-60"}),"Detected"]}):(0,b.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded-sm text-[0.6rem] uppercase tracking-[0.15em] font-mono border border-border/30 text-muted-foreground/40",children:"Inactive"}),h&&(0,b.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded-sm text-[0.6rem] uppercase tracking-[0.15em] font-mono border border-pink-500/40 text-pink-400 bg-pink-500/10",children:e?"+ install":"− remove"})]}),(0,b.jsx)("div",{className:"ml-auto hidden lg:block text-[0.7rem] font-mono text-muted-foreground/50 truncate max-w-[420px] group-hover:text-muted-foreground/80 transition-colors",title:a.settingsPath,children:a.settingsPath})]},a.id)})}),(0,b.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border/40 bg-muted/5",children:[(0,b.jsxs)("span",{className:"text-xs text-muted-foreground",children:[(0,b.jsx)("span",{className:"font-semibold text-foreground",children:d.policies.filter(a=>a.enabled).length+(d.customPolicies?.filter(a=>a.enabled).length??0)+(d.conventionPolicies?.reduce((a,b)=>a+b.policies.filter(a=>a.enabled).length,0)??0)})," / ",d.policies.length+(d.customPolicies?.length??0)+(d.conventionPolicies?.reduce((a,b)=>a+b.policies.length,0)??0)," ","policies enabled"]}),B&&(0,b.jsxs)("span",{className:"text-[0.65rem] text-muted-foreground/60",children:["· shared across ",C," active CLI",1===C?"":"s"]})]}),h&&(0,b.jsx)("div",{className:"px-4 py-2 bg-red-500/10 border-b border-red-500/20 text-xs text-red-400",children:h}),k&&(0,b.jsx)(aK,{message:k,onDismiss:()=>l(null),onInstall:A,isPending:f}),E.map(a=>{let c=d.policies.filter(b=>b.category===a),h=c.filter(a=>a.enabled).length;return(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-4 py-2.5 bg-muted/20 border-b border-border/50",children:[(0,b.jsx)("span",{className:"text-[0.7rem] font-semibold uppercase tracking-wider text-muted-foreground",children:a}),(0,b.jsxs)("span",{className:"text-[0.7rem] text-muted-foreground",children:[h," / ",c.length," enabled"]})]}),c.map(a=>(0,b.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 border-b border-border/20 hover:bg-muted/20 transition-colors",children:[(0,b.jsx)("div",{className:"mt-0.5 shrink-0",children:(0,b.jsx)(aI,{enabled:a.enabled,onChange:()=>{var b;let c;return b=a.enabled,c=a.name,void(!d||(!d.clis.some(a=>a.installed)?l("Policies are not installed. Install policies to continue."):(l(null),e(d=>d?{...d,policies:d.policies.map(d=>d.name===c&&d.packId===a.packId?{...d,enabled:!b}:d),packs:d.packs.map(d=>d.id===a.packId?{...d,policies:d.policies.map(a=>a.name===c?{...a,enabled:!b}:a)}:d)}:d),g(async()=>{try{let d=await ak(a.packId,c,!b);d.ok||(u("policy_toggle",d.error??"Failed to save policy change."),v())}catch{u("policy_toggle","Failed to save policy change."),v()}}))))},disabled:f})}),(0,b.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0 w-56 shrink-0 mt-0.5",children:[(0,b.jsx)("span",{className:"text-xs font-mono text-foreground truncate",children:a.name}),a.beta&&(0,b.jsx)("span",{className:"shrink-0 text-[0.6rem] px-1 py-0.5 rounded border bg-violet-500/10 text-violet-400 border-violet-500/20",children:"beta"})]}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground leading-relaxed",children:a.description}),a.eventScope&&(0,b.jsx)("span",{className:"block text-[0.65rem] text-muted-foreground/40 font-mono mt-0.5 hidden lg:block",children:a.eventScope}),a.params&&Object.keys(a.params).length>0&&(0,b.jsx)("div",{className:"flex flex-wrap gap-1 mt-1.5",children:Object.entries(a.params).map(([c,d])=>{let e=a.currentParams?.[c]??d.default,f=JSON.stringify(e)!==JSON.stringify(d.default);return(0,b.jsxs)("span",{className:`inline-flex items-center gap-1 font-mono text-[0.6rem] px-1.5 py-0.5 rounded border ${f?"bg-primary/10 text-primary/70 border-primary/20":"bg-muted/40 text-muted-foreground/55 border-border/40"}`,children:[(0,b.jsxs)("span",{className:"opacity-70",children:[c,":"]}),(0,b.jsx)("span",{children:function(a,b){if("string[]"===a||"pattern[]"===a){let c=Array.isArray(b)?b:[];return 0===c.length?"none":"pattern[]"===a?`${c.length} pattern${1!==c.length?"s":""}`:1===c.length?String(c[0]).slice(0,24):`${c.length} values`}return"boolean"===a?b?"on":"off":null==b||""===b?"—":String(b).slice(0,32)}(d.type,e)})]},c)})})]}),a.params&&Object.keys(a.params).length>0&&(0,b.jsx)("button",{className:"shrink-0 mt-0.5 text-muted-foreground hover:text-primary transition-colors",onClick:()=>{let b=Object.entries(a.params??{}).filter(([b,c])=>JSON.stringify(a.currentParams?.[b]??c.default)!==JSON.stringify(c.default)).length;t("policy_config_modal_opened",{policy_name:a.name,param_count:Object.keys(a.params??{}).length,has_customized_params:b>0,customized_count:b}),n(a)},title:"Edit parameters",children:(0,b.jsx)(p.f,{className:"h-3.5 w-3.5"})})]},`${a.packId}/${a.name}`))]},a)}),(d.customPoliciesPaths?.length||d.customPoliciesPath)&&(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-4 py-2.5 bg-muted/20 border-b border-border/50",children:[(0,b.jsx)("span",{className:"text-[0.7rem] font-semibold uppercase tracking-wider text-muted-foreground",children:"Custom Policies"}),(0,b.jsxs)("span",{className:"text-[0.7rem] text-muted-foreground",children:[d.customPolicies?.length??0," detected"]})]}),(d.customPoliciesPaths??[d.customPoliciesPath]).map(a=>(0,b.jsxs)("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border/20",children:[(0,b.jsx)(j,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),(0,b.jsx)("span",{className:"text-xs font-mono text-muted-foreground truncate",children:a})]},a)),(0,b.jsxs)("div",{className:"flex items-start gap-2 px-4 py-2.5 border-b border-border/20 bg-muted/10",children:[(0,b.jsx)(r,{className:"h-3.5 w-3.5 text-muted-foreground/60 shrink-0 mt-0.5"}),(0,b.jsx)("p",{className:"text-[0.7rem] text-muted-foreground/70 leading-relaxed",children:"Re-run the install command to add, remove, or reorder files."})]}),d.customPolicies?.map(a=>(0,b.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 border-b border-border/20 hover:bg-muted/20 transition-colors",children:[(0,b.jsx)("div",{className:"mt-0.5 shrink-0",children:(0,b.jsx)(aI,{enabled:a.enabled,onChange:()=>z(a.id,a.enabled),disabled:f})}),(0,b.jsx)("div",{className:"flex items-center gap-1.5 min-w-0 w-56 shrink-0 mt-0.5",children:(0,b.jsx)("span",{className:"text-xs font-mono text-foreground truncate",children:a.name})}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[a.description&&(0,b.jsx)("span",{className:"text-xs text-muted-foreground leading-relaxed",children:a.description}),a.eventScope&&(0,b.jsx)("span",{className:"block text-[0.65rem] text-muted-foreground/40 font-mono mt-0.5 hidden lg:block",children:a.eventScope})]})]},a.id))]}),d.conventionPolicies?.map(a=>(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-4 py-2.5 bg-muted/20 border-b border-border/50",children:[(0,b.jsxs)("span",{className:"text-[0.7rem] font-semibold uppercase tracking-wider text-muted-foreground",children:["Convention Policies — ","project"===a.scope?"Project":"User"]}),(0,b.jsxs)("span",{className:"text-[0.7rem] text-muted-foreground",children:[a.policies.length," hook",1===a.policies.length?"":"s"]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border/20",children:[(0,b.jsx)(j,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),(0,b.jsx)("span",{className:"text-xs font-mono text-muted-foreground truncate",children:a.path})]}),0===a.policies.length?(0,b.jsxs)("div",{className:"flex items-start gap-2 px-4 py-2.5 border-b border-border/20 bg-muted/10",children:[(0,b.jsx)(r,{className:"h-3.5 w-3.5 text-muted-foreground/60 shrink-0 mt-0.5"}),(0,b.jsxs)("p",{className:"text-[0.7rem] text-muted-foreground/70 leading-relaxed",children:["No policies could be read from this file. It is still loaded at runtime — run ",(0,b.jsx)("span",{className:"font-mono",children:"failproofai policies"})," to see what it registers."]})]}):a.policies.map(c=>(0,b.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 border-b border-border/20 hover:bg-muted/20 transition-colors",children:[(0,b.jsx)("div",{className:"mt-0.5 shrink-0",children:(0,b.jsx)(aI,{enabled:c.enabled,onChange:()=>z(c.id,c.enabled),disabled:f})}),(0,b.jsx)("div",{className:"flex items-center gap-1.5 min-w-0 w-56 shrink-0 mt-0.5",children:(0,b.jsx)("span",{className:"text-xs font-mono text-foreground truncate",children:c.name})}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[c.description&&(0,b.jsx)("span",{className:"text-xs text-muted-foreground leading-relaxed",children:c.description}),c.eventScope&&(0,b.jsx)("span",{className:"block text-[0.65rem] text-muted-foreground/40 font-mono mt-0.5 hidden lg:block",children:c.eventScope})]})]},`${a.path}:${c.name}`))]},a.path)),(0,b.jsx)(aM,{packs:d.packs??[],disabled:f,onChanged:v,onError:a=>u("pack_action",a)})]})]})}function aM({packs:a,disabled:d,onChanged:e,onError:f}){let[g,h]=(0,c.useState)(""),[i,j]=(0,c.useState)(null),[k,l]=(0,c.useState)(null),[n,p]=(0,c.useState)(null),{capture:q}=(0,ap.usePostHog)(),r=async()=>{if(g.trim()){j("preview"),p(null);try{let a=await ai(g);if(!a.ok)return void f(a.error??"Could not read that pack.");p(a)}finally{j(null)}}},s=async(a,b)=>{j(a),l(null);try{let a=await b();if(!a.ok)return void f(a.error??"Could not install that pack.");l(a.version?`${a.id}@${a.version}`:a.id??null),h(""),e()}catch(a){f(a instanceof Error?a.message:"Could not install that pack.")}finally{j(null)}};return(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-4 py-2.5 bg-muted/20 border-b border-border/50",children:[(0,b.jsx)("span",{className:"text-[0.7rem] font-semibold uppercase tracking-wider text-muted-foreground",children:"Policy Packs"}),(0,b.jsx)("span",{className:"text-[0.7rem] text-muted-foreground",children:0===a.length?"none installed":`${a.length} installed`})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2 px-4 py-3 border-b border-border/20",children:[(0,b.jsx)("input",{value:g,onChange:a=>h(a.target.value),onKeyDown:a=>{"Enter"===a.key&&g.trim()&&!i&&(q("pack_install_submitted",{via:"input"}),s("input",()=>ah(g)))},placeholder:"core · acme/ops · acme/ops@v1.2.0 · a release URL",spellCheck:!1,disabled:d||null!==i,className:"flex-1 min-w-[16rem] rounded-md border border-border/60 bg-background px-2.5 py-1.5 text-xs font-mono placeholder:text-muted-foreground/50 focus:outline-none focus:ring-1 focus:ring-ring disabled:opacity-50","aria-label":"Pack source"}),(0,b.jsx)(av.f,{size:"sm",variant:"outline",disabled:d||null!==i||0===g.trim().length,onClick:()=>{q("pack_preview_submitted",{}),r()},children:"preview"===i?"Reading…":"Preview"}),(0,b.jsxs)(av.f,{size:"sm",variant:"default",disabled:d||null!==i||0===g.trim().length,onClick:()=>{q("pack_install_submitted",{via:"button"}),s("input",()=>ah(g))},children:[(0,b.jsx)(o,{className:"h-3.5 w-3.5"}),"input"===i?"Installing…":"Install"]})]}),n?.ok&&(0,b.jsxs)("div",{className:"border-b border-border/20 bg-muted/5",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[(0,b.jsx)(m,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),(0,b.jsxs)("span",{className:"text-xs font-mono text-foreground",children:[n.id,"@",n.version]}),(0,b.jsxs)("span",{className:"text-[0.7rem] text-muted-foreground",children:[n.policies?.length??0," policies ·"," ",n.policies?.filter(a=>a.defaultEnabled).length??0," on by default",n.semantic&&n.semantic.length>0?` \xb7 ${n.semantic.length} Jev ${1===n.semantic.length?"check":"checks"}`:""]}),"observe"===n.effect&&(0,b.jsx)("span",{className:"text-[0.65rem] uppercase tracking-wider text-amber-500",children:"observes only"}),(0,b.jsx)("button",{onClick:()=>p(null),className:"ml-auto text-muted-foreground/60 hover:text-foreground","aria-label":"Close preview",children:(0,b.jsx)(C.X,{className:"h-3.5 w-3.5"})})]}),(0,b.jsx)("div",{className:"max-h-64 overflow-y-auto",children:n.policies?.map(a=>(0,b.jsxs)("div",{className:"flex items-start gap-3 px-4 py-2 border-t border-border/10",children:[(0,b.jsx)("span",{className:`text-[0.65rem] uppercase tracking-wider w-14 shrink-0 mt-0.5 ${a.defaultEnabled?"text-emerald-500":"text-muted-foreground/50"}`,children:a.defaultEnabled?"default":"opt-in"}),(0,b.jsx)("span",{className:"text-xs font-mono text-foreground w-56 shrink-0 truncate",children:a.name}),(0,b.jsxs)("span",{className:"text-xs text-muted-foreground leading-relaxed min-w-0",children:[a.description,(0,b.jsx)("span",{className:"block text-[0.65rem] text-muted-foreground/40 font-mono mt-0.5",children:a.category})]})]},a.name))}),(0,b.jsx)("div",{className:"px-4 py-2.5 border-t border-border/20",children:(0,b.jsxs)(av.f,{size:"sm",variant:"default",disabled:d||null!==i,onClick:()=>{q("pack_install_submitted",{via:"preview"}),s("input",()=>ah(g)).then(()=>p(null))},children:[(0,b.jsx)(o,{className:"h-3.5 w-3.5"}),"Install its defaults"]})})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2 px-4 py-2.5 border-b border-border/20 bg-muted/10",children:[(0,b.jsx)("span",{className:"text-[0.7rem] text-muted-foreground/70 mr-1",children:"Failproof AI policies:"}),(0,b.jsx)(av.f,{size:"sm",variant:"outline",disabled:d||null!==i,onClick:()=>{q("pack_install_submitted",{via:"ours"}),s("ours",()=>ah("FailproofAI/policies"))},children:"ours"===i?"Installing…":"Install from GitHub"}),(0,b.jsx)(av.f,{size:"sm",variant:"outline",disabled:d||null!==i,onClick:()=>{q("pack_install_submitted",{via:"bundled"}),s("bundled",()=>ag())},children:"bundled"===i?"Installing…":"Install offline copy"}),k&&(0,b.jsxs)("span",{className:"text-[0.7rem] text-emerald-500 font-mono",children:["installed ",k]})]}),a.map(a=>(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border/20",children:[(0,b.jsx)(m,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),(0,b.jsxs)("span",{className:"text-xs font-mono text-foreground truncate",children:[a.id,a.version?`@${a.version}`:""]}),"observe"===a.effect&&(0,b.jsx)("span",{className:"text-[0.65rem] uppercase tracking-wider text-amber-500",children:"observing"}),(0,b.jsx)("span",{className:"text-[0.65rem] text-muted-foreground/50 font-mono truncate hidden lg:inline",children:a.source}),(0,b.jsx)("button",{onClick:()=>void s(a.id,()=>aj(a.id)),disabled:d||null!==i,className:"ml-auto text-muted-foreground/60 hover:text-foreground disabled:opacity-40","aria-label":`Remove ${a.id}`,children:(0,b.jsx)(z,{className:"h-3.5 w-3.5"})})]}),a.error?(0,b.jsxs)("div",{className:"flex items-start gap-2 px-4 py-2.5 border-b border-border/20 bg-amber-500/5",children:[(0,b.jsx)(B,{className:"h-3.5 w-3.5 text-amber-500 shrink-0 mt-0.5"}),(0,b.jsxs)("p",{className:"text-[0.7rem] text-muted-foreground leading-relaxed",children:["This pack will not load: ",a.error]})]}):(0,b.jsx)("div",{className:"flex items-center gap-3 px-4 py-2.5 border-b border-border/20",children:(0,b.jsxs)("span",{className:"text-[0.7rem] text-muted-foreground",children:[a.policies.filter(a=>a.enabled).length," of ",a.policies.length," on — listed by category above"]})})]},`${a.id}@${a.version}`))]})}function aN({activeTab:a,onChange:c}){return(0,b.jsx)("div",{className:"tabs",style:{padding:0,marginBottom:24},children:[{id:"activity",label:"Activity"},{id:"policies",label:"Configure"}].map(d=>(0,b.jsx)("button",{type:"button",onClick:()=>c(d.id),className:`tab${a===d.id?" is-active":""}`,children:d.label.toLowerCase()},d.id))})}a.s(["default",0,function({initialTab:a="activity"}){let d=(0,aq.f)(),{capture:e}=(0,ap.usePostHog)(),[f,g]=(0,c.useState)(a),[h,i]=(0,c.useState)(void 0),[j,k]=(0,c.useState)(null),[l,m]=(0,c.useState)([]);(0,c.useEffect)(()=>{ae().then(a=>{i(a.clis.some(a=>a.installed)),k({enabled:a.enabledPolicies.length,total:a.policies.length+(a.customPolicies?.length??0)+(a.conventionPolicies?.reduce((a,b)=>a+b.policies.length,0)??0)}),m(a.clis.filter(a=>a.installed).map(a=>a.label))}).catch(()=>i(void 0))},[]);let n=0===l.length?"Policy evaluations":l.length<=3?`Policy evaluations across ${l.join(", ")}`:`Policy evaluations across ${l.length} agents`,o=a=>{a!==f&&e("policies_tab_switched",{tab:a,from_tab:f}),g(a),d.setAll({tab:"activity"===a?void 0:a})};return(0,b.jsx)("main",{className:"report",children:(0,b.jsxs)("section",{className:"section","data-screen-label":"policies",children:[(0,b.jsx)("h2",{style:{fontFamily:"var(--font-mono)",fontSize:24,fontWeight:600,letterSpacing:"-0.01em",color:"var(--ink)",margin:"0 0 16px"},children:"activity"===f?"Policies":"Configure Policies"}),"activity"===f?(0,b.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:32,flexWrap:"wrap",margin:"0 0 24px"},children:[(0,b.jsxs)("div",{style:{fontFamily:"var(--font-mono)",fontSize:14,color:"var(--ink-2)",lineHeight:1.7,flex:"1 1 480px",minWidth:0},children:[n,j&&(0,b.jsxs)("span",{style:{color:"var(--dim)"},children:[" · ","enabled policies"," ",(0,b.jsxs)("span",{style:{color:"var(--ink)",fontVariantNumeric:"tabular-nums"},children:[j.enabled,"/",j.total]})]})]}),(0,b.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:6,flex:"0 0 auto"},children:[(0,b.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:10,letterSpacing:"0.22em",textTransform:"uppercase",color:"var(--dim)"},children:"want to change which policies fire?"}),(0,b.jsx)("button",{type:"button",className:"btn btn-primary",onClick:()=>o("policies"),children:"[ configure policies → ]"})]})]}):(0,b.jsx)("p",{style:{fontFamily:"var(--font-mono)",fontSize:14,color:"var(--ink-2)",lineHeight:1.7,maxWidth:720,margin:"0 0 24px"},children:"switch policies on or off across your installed harnesses."}),(0,b.jsx)(aN,{activeTab:f,onChange:o}),"activity"===f?(0,b.jsx)(aH,{hooksInstalled:h,onSwitchTab:o}):(0,b.jsx)(aL,{onHooksInstallChange:i})]})})}],22712)}];
|
|
6
|
+
`}),(0,b.jsxs)("div",{className:"rounded-lg border border-red-500/40 bg-red-950/95 shadow-2xl shadow-red-900/40 overflow-hidden backdrop-blur-sm",children:[(0,b.jsx)("div",{className:"h-0.5 w-full bg-gradient-to-r from-red-600 via-red-400 to-red-600"}),(0,b.jsxs)("div",{className:"p-4",children:[(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)("div",{className:"shrink-0 mt-0.5 flex h-5 w-5 items-center justify-center rounded-full bg-red-500 ring-2 ring-red-500/30",children:(0,b.jsx)(C.X,{className:"h-3 w-3 text-white",strokeWidth:3})}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("p",{className:"text-[0.65rem] font-bold uppercase tracking-widest text-red-400 mb-0.5",children:"Error"}),(0,b.jsx)("p",{className:"text-sm text-red-100 leading-snug",children:a})]}),(0,b.jsx)("button",{onClick:c,className:"shrink-0 -mt-0.5 -mr-0.5 rounded p-0.5 text-red-400/60 transition-colors hover:bg-red-500/20 hover:text-red-200","aria-label":"Dismiss",children:(0,b.jsx)(C.X,{className:"h-4 w-4"})})]}),(0,b.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,b.jsx)(aB.f,{size:"sm",onClick:()=>{g("hooks_install_from_error_clicked",{error_message:a.slice(0,200)}),c(),e()},disabled:f,className:"h-7 flex-1 border-0 bg-red-500 px-3 text-xs font-semibold text-white hover:bg-red-400 disabled:opacity-50",children:"Install hooks"}),(0,b.jsx)(aB.f,{variant:"ghost",size:"sm",onClick:c,className:"h-7 px-3 text-xs text-red-400 hover:bg-red-500/10 hover:text-red-200",children:"Dismiss"})]})]})]})]}),document.body)}function aR({onHooksInstallChange:a}){let[d,e]=(0,c.useState)(null),[f,g]=(0,c.useTransition)(),[h,i]=(0,c.useState)(null),[k,l]=(0,c.useState)(null),[m,n]=(0,c.useState)(null),[o,q]=(0,c.useState)(()=>new Set),s=(0,c.useRef)(!1),{capture:t}=(0,av.usePostHog)(),u=(0,c.useCallback)((a,b)=>{t("action_error_displayed",{error_type:a,error_message:b.slice(0,200)}),i(b)},[t]),v=(0,c.useCallback)(async()=>{try{let b=await ak();e(b),a?.(b.clis.some(a=>a.installed))}catch{}},[a]);(0,c.useEffect)(()=>{v()},[v]),(0,c.useEffect)(()=>{d&&(s.current?q(new Set(d.clis.filter(a=>a.installed).map(a=>a.id))):(s.current=!0,q(new Set(d.clis.filter(a=>a.installed||a.detected).map(a=>a.id)))))},[d?.clis]);let w=(0,c.useMemo)(()=>new Set((d?.clis??[]).filter(a=>a.installed).map(a=>a.id)),[d?.clis]),x=(0,c.useMemo)(()=>{let a=[],b=[];for(let c of d?.clis??[]){let d=o.has(c.id);d&&!w.has(c.id)&&a.push(c.id),!d&&w.has(c.id)&&b.push(c.id)}return{toInstall:a,toRemove:b}},[d?.clis,o,w]),y=x.toInstall.length>0||x.toRemove.length>0,z=(a,b)=>{d&&(e(c=>c?{...c,customPolicies:c.customPolicies?.map(c=>c.id===a?{...c,enabled:!b}:c),conventionPolicies:c.conventionPolicies.map(c=>({...c,policies:c.policies.map(c=>c.id===a?{...c,enabled:!b}:c)}))}:c),g(async()=>{try{await al(a,!b)}catch{u("custom_policy_toggle","Failed to save custom policy change."),v()}}))},A=()=>{let{toInstall:a,toRemove:b}=x;(0!==a.length||0!==b.length)&&(t("cli_install_remove_submitted",{to_install:a,to_remove:b,count_install:a.length,count_remove:b.length}),g(async()=>{try{i(null),a.length>0&&await ar("user",a),b.length>0&&await as("user",b)}catch(a){u("cli_apply",a instanceof Error?a.message:"Failed to apply changes.")}finally{await v()}}))};if(!d)return(0,b.jsx)("div",{className:"flex items-center justify-center py-16",children:(0,b.jsxs)("span",{className:"text-sm text-muted-foreground",children:["Loading","…"]})});let B=d.clis.some(a=>a.installed),C=w.size,D=o.size,E=Array.from(new Set(d.policies.map(a=>a.category)));return(0,b.jsxs)(b.Fragment,{children:[m&&(0,b.jsx)(aP,{policy:m,onClose:()=>{t("policy_config_modal_closed",{policy_name:m.name,action:"cancel"}),n(null)},onSave:a=>{var b,c;if(!m)return;let d=m.packId?(b=m.packId,c=m.name,`pack/${b}/${c}`):m.name;n(null),g(async()=>{try{i(null),await at(d,a),await v()}catch(a){u("param_update",a instanceof Error?a.message:"Failed to save configuration.")}})}}),(0,b.jsxs)("div",{className:"bg-card border border-border rounded-lg overflow-hidden",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-4 px-5 py-3.5 border-b border-border/60 bg-muted/10",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3 min-w-0 flex-wrap",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:`h-2 w-2 rounded-full transition-shadow ${B?"bg-emerald-400 shadow-[0_0_8px_rgba(52,211,153,0.6)]":"bg-muted-foreground/40"}`,"aria-hidden":!0}),(0,b.jsx)("span",{className:"text-[0.65rem] uppercase tracking-[0.2em] font-mono text-foreground/90",children:"Integrations"})]}),(0,b.jsx)("span",{className:"text-[0.65rem] font-mono text-muted-foreground/40",children:"·"}),(0,b.jsxs)("div",{className:"text-[0.65rem] uppercase tracking-[0.2em] font-mono text-muted-foreground",children:[(0,b.jsx)("span",{className:"text-foreground tabular-nums",children:C.toString().padStart(2,"0")}),(0,b.jsxs)("span",{className:"opacity-50",children:[" / 0",d.clis.length," active"]})]}),y&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:"text-[0.65rem] font-mono text-muted-foreground/40",children:"·"}),(0,b.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-[0.65rem] uppercase tracking-[0.2em] font-mono text-pink-400",children:[(0,b.jsx)("span",{className:"h-1 w-1 rounded-full bg-pink-400 animate-pulse"}),x.toInstall.length+x.toRemove.length," pending"]})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,b.jsx)(aB.f,{variant:"outline",size:"sm",onClick:()=>{let a=Array.from(w).filter(a=>o.has(a));0!==a.length&&(t("cli_reinstall_submitted",{cli_ids:a,count:a.length}),g(async()=>{try{i(null),await ar("user",a)}catch(a){u("cli_reinstall",a instanceof Error?a.message:"Failed to reinstall.")}finally{await v()}}))},disabled:f||0===D,className:"text-xs h-7 px-3 font-mono",children:"Reinstall"}),(0,b.jsx)(aB.f,{variant:"default",size:"sm",onClick:A,disabled:f||!y,className:"text-xs h-7 px-3 font-mono",children:"Apply changes"})]})]}),(0,b.jsx)("div",{className:"divide-y divide-border/30 border-b border-border/60",children:d.clis.map((a,c)=>{let e=o.has(a.id),g=w.has(a.id),h=e!==g,i=(0,ay.G)(a.id),j=i.split(" ").find(a=>a.startsWith("text-"))??"text-foreground";return(0,b.jsxs)("label",{className:`group relative flex items-center gap-3 pl-6 pr-5 py-3 cursor-pointer transition-colors hover:bg-muted/15 ${h?"bg-pink-500/[0.04]":""}`,children:[(0,b.jsx)("div",{className:`absolute left-0 top-0 bottom-0 w-[3px] ${j} bg-current transition-opacity ${e?"opacity-100":"opacity-25 group-hover:opacity-60"}`,"aria-hidden":!0}),(0,b.jsx)("div",{className:"font-mono text-[0.65rem] text-muted-foreground/40 tabular-nums w-6 select-none",children:(c+1).toString().padStart(2,"0")}),(0,b.jsxs)("div",{className:"relative shrink-0",children:[(0,b.jsx)("input",{type:"checkbox",checked:e,onChange:()=>{var b;return b=a.id,void q(a=>{let c=new Set(a),e=!c.has(b);e?c.add(b):c.delete(b);let f=d?.clis.find(a=>a.id===b);return t("cli_selection_toggled",{cli_id:b,checked:e,current_state:f?.installed?"installed":f?.detected?"detected":"inactive"}),c})},disabled:f,className:"sr-only peer","aria-label":`Toggle ${a.label}`}),(0,b.jsx)("div",{className:`h-[18px] w-[18px] rounded-sm border transition-all peer-focus-visible:ring-2 peer-focus-visible:ring-primary/40 ${e?"bg-primary border-primary":"bg-background/50 border-border group-hover:border-foreground/40"}`,children:e&&(0,b.jsx)("svg",{viewBox:"0 0 18 18",className:"h-full w-full text-primary-foreground",fill:"none","aria-hidden":!0,children:(0,b.jsx)("path",{d:"M4 9.5L7.5 12.5L14 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),(0,b.jsx)("div",{className:"min-w-[150px] shrink-0",children:(0,b.jsx)("div",{className:"text-sm font-medium text-foreground",children:a.label})}),(0,b.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0",children:[g?(0,b.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 rounded-sm text-[0.6rem] uppercase tracking-[0.15em] font-mono border ${i}`,children:[(0,b.jsx)("span",{className:"h-1 w-1 rounded-full bg-current shadow-[0_0_4px_currentColor]"}),"Active"]}):a.detected?(0,b.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-sm text-[0.6rem] uppercase tracking-[0.15em] font-mono border border-border/60 text-muted-foreground/80 bg-muted/20",children:[(0,b.jsx)("span",{className:"h-1 w-1 rounded-full bg-current opacity-60"}),"Detected"]}):(0,b.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded-sm text-[0.6rem] uppercase tracking-[0.15em] font-mono border border-border/30 text-muted-foreground/40",children:"Inactive"}),h&&(0,b.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded-sm text-[0.6rem] uppercase tracking-[0.15em] font-mono border border-pink-500/40 text-pink-400 bg-pink-500/10",children:e?"+ install":"− remove"})]}),(0,b.jsx)("div",{className:"ml-auto hidden lg:block text-[0.7rem] font-mono text-muted-foreground/50 truncate max-w-[420px] group-hover:text-muted-foreground/80 transition-colors",title:a.settingsPath,children:a.settingsPath})]},a.id)})}),(0,b.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border/40 bg-muted/5",children:[(0,b.jsxs)("span",{className:"text-xs text-muted-foreground",children:[(0,b.jsx)("span",{className:"font-semibold text-foreground",children:d.policies.filter(a=>a.enabled).length+(d.customPolicies?.filter(a=>a.enabled).length??0)+(d.conventionPolicies?.reduce((a,b)=>a+b.policies.filter(a=>a.enabled).length,0)??0)})," / ",d.policies.length+(d.customPolicies?.length??0)+(d.conventionPolicies?.reduce((a,b)=>a+b.policies.length,0)??0)," ","policies enabled"]}),B&&(0,b.jsxs)("span",{className:"text-[0.65rem] text-muted-foreground/60",children:["· shared across ",C," active CLI",1===C?"":"s"]})]}),h&&(0,b.jsx)("div",{className:"px-4 py-2 bg-red-500/10 border-b border-red-500/20 text-xs text-red-400",children:h}),k&&(0,b.jsx)(aQ,{message:k,onDismiss:()=>l(null),onInstall:A,isPending:f}),E.map(a=>{let c=d.policies.filter(b=>b.category===a),h=c.filter(a=>a.enabled).length;return(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-4 py-2.5 bg-muted/20 border-b border-border/50",children:[(0,b.jsx)("span",{className:"text-[0.7rem] font-semibold uppercase tracking-wider text-muted-foreground",children:a}),(0,b.jsxs)("span",{className:"text-[0.7rem] text-muted-foreground",children:[h," / ",c.length," enabled"]})]}),c.map(a=>(0,b.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 border-b border-border/20 hover:bg-muted/20 transition-colors",children:[(0,b.jsx)("div",{className:"mt-0.5 shrink-0",children:(0,b.jsx)(aO,{enabled:a.enabled,onChange:()=>{var b;let c;return b=a.enabled,c=a.name,void(!d||(!d.clis.some(a=>a.installed)?l("Policies are not installed. Install policies to continue."):(l(null),e(d=>d?{...d,policies:d.policies.map(d=>d.name===c&&d.packId===a.packId?{...d,enabled:!b}:d),packs:d.packs.map(d=>d.id===a.packId?{...d,policies:d.policies.map(a=>a.name===c?{...a,enabled:!b}:a)}:d)}:d),g(async()=>{try{let d=await aq(a.packId,c,!b);d.ok||(u("policy_toggle",d.error??"Failed to save policy change."),v())}catch{u("policy_toggle","Failed to save policy change."),v()}}))))},disabled:f})}),(0,b.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0 w-56 shrink-0 mt-0.5",children:[(0,b.jsx)("span",{className:"text-xs font-mono text-foreground truncate",children:a.name}),a.beta&&(0,b.jsx)("span",{className:"shrink-0 text-[0.6rem] px-1 py-0.5 rounded border bg-violet-500/10 text-violet-400 border-violet-500/20",children:"beta"})]}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground leading-relaxed",children:a.description}),a.eventScope&&(0,b.jsx)("span",{className:"block text-[0.65rem] text-muted-foreground/40 font-mono mt-0.5 hidden lg:block",children:a.eventScope}),a.params&&Object.keys(a.params).length>0&&(0,b.jsx)("div",{className:"flex flex-wrap gap-1 mt-1.5",children:Object.entries(a.params).map(([c,d])=>{let e=a.currentParams?.[c]??d.default,f=JSON.stringify(e)!==JSON.stringify(d.default);return(0,b.jsxs)("span",{className:`inline-flex items-center gap-1 font-mono text-[0.6rem] px-1.5 py-0.5 rounded border ${f?"bg-primary/10 text-primary/70 border-primary/20":"bg-muted/40 text-muted-foreground/55 border-border/40"}`,children:[(0,b.jsxs)("span",{className:"opacity-70",children:[c,":"]}),(0,b.jsx)("span",{children:function(a,b){if("string[]"===a||"pattern[]"===a){let c=Array.isArray(b)?b:[];return 0===c.length?"none":"pattern[]"===a?`${c.length} pattern${1!==c.length?"s":""}`:1===c.length?String(c[0]).slice(0,24):`${c.length} values`}return"boolean"===a?b?"on":"off":null==b||""===b?"—":String(b).slice(0,32)}(d.type,e)})]},c)})})]}),a.params&&Object.keys(a.params).length>0&&(0,b.jsx)("button",{className:"shrink-0 mt-0.5 text-muted-foreground hover:text-primary transition-colors",onClick:()=>{let b=Object.entries(a.params??{}).filter(([b,c])=>JSON.stringify(a.currentParams?.[b]??c.default)!==JSON.stringify(c.default)).length;t("policy_config_modal_opened",{policy_name:a.name,param_count:Object.keys(a.params??{}).length,has_customized_params:b>0,customized_count:b}),n(a)},title:"Edit parameters",children:(0,b.jsx)(p.f,{className:"h-3.5 w-3.5"})})]},`${a.packId}/${a.name}`))]},a)}),(d.customPoliciesPaths?.length||d.customPoliciesPath)&&(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-4 py-2.5 bg-muted/20 border-b border-border/50",children:[(0,b.jsx)("span",{className:"text-[0.7rem] font-semibold uppercase tracking-wider text-muted-foreground",children:"Custom Policies"}),(0,b.jsxs)("span",{className:"text-[0.7rem] text-muted-foreground",children:[d.customPolicies?.length??0," detected"]})]}),(d.customPoliciesPaths??[d.customPoliciesPath]).map(a=>(0,b.jsxs)("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border/20",children:[(0,b.jsx)(j,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),(0,b.jsx)("span",{className:"text-xs font-mono text-muted-foreground truncate",children:a})]},a)),(0,b.jsxs)("div",{className:"flex items-start gap-2 px-4 py-2.5 border-b border-border/20 bg-muted/10",children:[(0,b.jsx)(r,{className:"h-3.5 w-3.5 text-muted-foreground/60 shrink-0 mt-0.5"}),(0,b.jsx)("p",{className:"text-[0.7rem] text-muted-foreground/70 leading-relaxed",children:"Re-run the install command to add, remove, or reorder files."})]}),d.customPolicies?.map(a=>(0,b.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 border-b border-border/20 hover:bg-muted/20 transition-colors",children:[(0,b.jsx)("div",{className:"mt-0.5 shrink-0",children:(0,b.jsx)(aO,{enabled:a.enabled,onChange:()=>z(a.id,a.enabled),disabled:f})}),(0,b.jsx)("div",{className:"flex items-center gap-1.5 min-w-0 w-56 shrink-0 mt-0.5",children:(0,b.jsx)("span",{className:"text-xs font-mono text-foreground truncate",children:a.name})}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[a.description&&(0,b.jsx)("span",{className:"text-xs text-muted-foreground leading-relaxed",children:a.description}),a.eventScope&&(0,b.jsx)("span",{className:"block text-[0.65rem] text-muted-foreground/40 font-mono mt-0.5 hidden lg:block",children:a.eventScope})]})]},a.id))]}),d.conventionPolicies?.map(a=>(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-4 py-2.5 bg-muted/20 border-b border-border/50",children:[(0,b.jsxs)("span",{className:"text-[0.7rem] font-semibold uppercase tracking-wider text-muted-foreground",children:["Convention Policies — ","project"===a.scope?"Project":"User"]}),(0,b.jsxs)("span",{className:"text-[0.7rem] text-muted-foreground",children:[a.policies.length," hook",1===a.policies.length?"":"s"]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border/20",children:[(0,b.jsx)(j,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),(0,b.jsx)("span",{className:"text-xs font-mono text-muted-foreground truncate",children:a.path})]}),0===a.policies.length?(0,b.jsxs)("div",{className:"flex items-start gap-2 px-4 py-2.5 border-b border-border/20 bg-muted/10",children:[(0,b.jsx)(r,{className:"h-3.5 w-3.5 text-muted-foreground/60 shrink-0 mt-0.5"}),(0,b.jsxs)("p",{className:"text-[0.7rem] text-muted-foreground/70 leading-relaxed",children:["No policies could be read from this file. It is still loaded at runtime — run ",(0,b.jsx)("span",{className:"font-mono",children:"failproofai policies"})," to see what it registers."]})]}):a.policies.map(c=>(0,b.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 border-b border-border/20 hover:bg-muted/20 transition-colors",children:[(0,b.jsx)("div",{className:"mt-0.5 shrink-0",children:(0,b.jsx)(aO,{enabled:c.enabled,onChange:()=>z(c.id,c.enabled),disabled:f})}),(0,b.jsx)("div",{className:"flex items-center gap-1.5 min-w-0 w-56 shrink-0 mt-0.5",children:(0,b.jsx)("span",{className:"text-xs font-mono text-foreground truncate",children:c.name})}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[c.description&&(0,b.jsx)("span",{className:"text-xs text-muted-foreground leading-relaxed",children:c.description}),c.eventScope&&(0,b.jsx)("span",{className:"block text-[0.65rem] text-muted-foreground/40 font-mono mt-0.5 hidden lg:block",children:c.eventScope})]})]},`${a.path}:${c.name}`))]},a.path)),(0,b.jsx)(aS,{packs:d.packs??[],disabled:f,onChanged:v,onError:a=>u("pack_action",a)})]})]})}function aS({packs:a,disabled:d,onChanged:e,onError:f}){let[g,h]=(0,c.useState)(""),[i,j]=(0,c.useState)(null),[k,l]=(0,c.useState)(null),[n,p]=(0,c.useState)(null),{capture:q}=(0,av.usePostHog)(),r=async()=>{if(g.trim()){j("preview"),p(null);try{let a=await ao(g);if(!a.ok)return void f(a.error??"Could not read that pack.");p(a)}finally{j(null)}}},s=async(a,b)=>{j(a),l(null);try{let a=await b();if(!a.ok)return void f(a.error??"Could not install that pack.");l(a.version?`${a.id}@${a.version}`:a.id??null),h(""),e()}catch(a){f(a instanceof Error?a.message:"Could not install that pack.")}finally{j(null)}};return(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-4 py-2.5 bg-muted/20 border-b border-border/50",children:[(0,b.jsx)("span",{className:"text-[0.7rem] font-semibold uppercase tracking-wider text-muted-foreground",children:"Policy Packs"}),(0,b.jsx)("span",{className:"text-[0.7rem] text-muted-foreground",children:0===a.length?"none installed":`${a.length} installed`})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2 px-4 py-3 border-b border-border/20",children:[(0,b.jsx)("input",{value:g,onChange:a=>h(a.target.value),onKeyDown:a=>{"Enter"===a.key&&g.trim()&&!i&&(q("pack_install_submitted",{via:"input"}),s("input",()=>an(g)))},placeholder:"core · acme/ops · acme/ops@v1.2.0 · a release URL",spellCheck:!1,disabled:d||null!==i,className:"flex-1 min-w-[16rem] rounded-md border border-border/60 bg-background px-2.5 py-1.5 text-xs font-mono placeholder:text-muted-foreground/50 focus:outline-none focus:ring-1 focus:ring-ring disabled:opacity-50","aria-label":"Pack source"}),(0,b.jsx)(aB.f,{size:"sm",variant:"outline",disabled:d||null!==i||0===g.trim().length,onClick:()=>{q("pack_preview_submitted",{}),r()},children:"preview"===i?"Reading…":"Preview"}),(0,b.jsxs)(aB.f,{size:"sm",variant:"default",disabled:d||null!==i||0===g.trim().length,onClick:()=>{q("pack_install_submitted",{via:"button"}),s("input",()=>an(g))},children:[(0,b.jsx)(o,{className:"h-3.5 w-3.5"}),"input"===i?"Installing…":"Install"]})]}),n?.ok&&(0,b.jsxs)("div",{className:"border-b border-border/20 bg-muted/5",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[(0,b.jsx)(m,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),(0,b.jsxs)("span",{className:"text-xs font-mono text-foreground",children:[n.id,"@",n.version]}),(0,b.jsxs)("span",{className:"text-[0.7rem] text-muted-foreground",children:[n.policies?.length??0," policies ·"," ",n.policies?.filter(a=>a.defaultEnabled).length??0," on by default",n.semantic&&n.semantic.length>0?` \xb7 ${n.semantic.length} Jev ${1===n.semantic.length?"check":"checks"}`:""]}),"observe"===n.effect&&(0,b.jsx)("span",{className:"text-[0.65rem] uppercase tracking-wider text-amber-500",children:"observes only"}),(0,b.jsx)("button",{onClick:()=>p(null),className:"ml-auto text-muted-foreground/60 hover:text-foreground","aria-label":"Close preview",children:(0,b.jsx)(C.X,{className:"h-3.5 w-3.5"})})]}),(0,b.jsx)("div",{className:"max-h-64 overflow-y-auto",children:n.policies?.map(a=>(0,b.jsxs)("div",{className:"flex items-start gap-3 px-4 py-2 border-t border-border/10",children:[(0,b.jsx)("span",{className:`text-[0.65rem] uppercase tracking-wider w-14 shrink-0 mt-0.5 ${a.defaultEnabled?"text-emerald-500":"text-muted-foreground/50"}`,children:a.defaultEnabled?"default":"opt-in"}),(0,b.jsx)("span",{className:"text-xs font-mono text-foreground w-56 shrink-0 truncate",children:a.name}),(0,b.jsxs)("span",{className:"text-xs text-muted-foreground leading-relaxed min-w-0",children:[a.description,(0,b.jsx)("span",{className:"block text-[0.65rem] text-muted-foreground/40 font-mono mt-0.5",children:a.category})]})]},a.name))}),(0,b.jsx)("div",{className:"px-4 py-2.5 border-t border-border/20",children:(0,b.jsxs)(aB.f,{size:"sm",variant:"default",disabled:d||null!==i,onClick:()=>{q("pack_install_submitted",{via:"preview"}),s("input",()=>an(g)).then(()=>p(null))},children:[(0,b.jsx)(o,{className:"h-3.5 w-3.5"}),"Install its defaults"]})})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2 px-4 py-2.5 border-b border-border/20 bg-muted/10",children:[(0,b.jsx)("span",{className:"text-[0.7rem] text-muted-foreground/70 mr-1",children:"Failproof AI policies:"}),(0,b.jsx)(aB.f,{size:"sm",variant:"outline",disabled:d||null!==i,onClick:()=>{q("pack_install_submitted",{via:"ours"}),s("ours",()=>an("FailproofAI/policies"))},children:"ours"===i?"Installing…":"Install from GitHub"}),(0,b.jsx)(aB.f,{size:"sm",variant:"outline",disabled:d||null!==i,onClick:()=>{q("pack_install_submitted",{via:"bundled"}),s("bundled",()=>am())},children:"bundled"===i?"Installing…":"Install offline copy"}),k&&(0,b.jsxs)("span",{className:"text-[0.7rem] text-emerald-500 font-mono",children:["installed ",k]})]}),a.map(a=>(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border/20",children:[(0,b.jsx)(m,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),(0,b.jsxs)("span",{className:"text-xs font-mono text-foreground truncate",children:[a.id,a.version?`@${a.version}`:""]}),"observe"===a.effect&&(0,b.jsx)("span",{className:"text-[0.65rem] uppercase tracking-wider text-amber-500",children:"observing"}),(0,b.jsx)("span",{className:"text-[0.65rem] text-muted-foreground/50 font-mono truncate hidden lg:inline",children:a.source}),(0,b.jsx)("button",{onClick:()=>void s(a.id,()=>ap(a.id)),disabled:d||null!==i,className:"ml-auto text-muted-foreground/60 hover:text-foreground disabled:opacity-40","aria-label":`Remove ${a.id}`,children:(0,b.jsx)(z,{className:"h-3.5 w-3.5"})})]}),a.error?(0,b.jsxs)("div",{className:"flex items-start gap-2 px-4 py-2.5 border-b border-border/20 bg-amber-500/5",children:[(0,b.jsx)(B,{className:"h-3.5 w-3.5 text-amber-500 shrink-0 mt-0.5"}),(0,b.jsxs)("p",{className:"text-[0.7rem] text-muted-foreground leading-relaxed",children:["This pack will not load: ",a.error]})]}):(0,b.jsx)("div",{className:"flex items-center gap-3 px-4 py-2.5 border-b border-border/20",children:(0,b.jsxs)("span",{className:"text-[0.7rem] text-muted-foreground",children:[a.policies.filter(a=>a.enabled).length," of ",a.policies.length," on — listed by category above"]})})]},`${a.id}@${a.version}`))]})}function aT({activeTab:a,onChange:c}){return(0,b.jsx)("div",{className:"tabs",style:{padding:0,marginBottom:24},children:[{id:"activity",label:"Activity"},{id:"policies",label:"Configure"}].map(d=>(0,b.jsx)("button",{type:"button",onClick:()=>c(d.id),className:`tab${a===d.id?" is-active":""}`,children:d.label.toLowerCase()},d.id))})}a.s(["default",0,function({initialTab:a="activity"}){let d=(0,aw.f)(),{capture:e}=(0,av.usePostHog)(),[f,g]=(0,c.useState)(a),[h,i]=(0,c.useState)(void 0),[j,k]=(0,c.useState)(null),[l,m]=(0,c.useState)([]);(0,c.useEffect)(()=>{ak().then(a=>{i(a.clis.some(a=>a.installed)),k({enabled:a.enabledPolicies.length,total:a.policies.length+(a.customPolicies?.length??0)+(a.conventionPolicies?.reduce((a,b)=>a+b.policies.length,0)??0)}),m(a.clis.filter(a=>a.installed).map(a=>a.label))}).catch(()=>i(void 0))},[]);let n=0===l.length?"Policy evaluations":l.length<=3?`Policy evaluations across ${l.join(", ")}`:`Policy evaluations across ${l.length} agents`,o=a=>{a!==f&&e("policies_tab_switched",{tab:a,from_tab:f}),g(a),d.setAll({tab:"activity"===a?void 0:a})};return(0,b.jsx)("main",{className:"report",children:(0,b.jsxs)("section",{className:"section","data-screen-label":"policies",children:[(0,b.jsx)("h2",{style:{fontFamily:"var(--font-mono)",fontSize:24,fontWeight:600,letterSpacing:"-0.01em",color:"var(--ink)",margin:"0 0 16px"},children:"activity"===f?"Policies":"Configure Policies"}),"activity"===f?(0,b.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:32,flexWrap:"wrap",margin:"0 0 24px"},children:[(0,b.jsxs)("div",{style:{fontFamily:"var(--font-mono)",fontSize:14,color:"var(--ink-2)",lineHeight:1.7,flex:"1 1 480px",minWidth:0},children:[n,j&&(0,b.jsxs)("span",{style:{color:"var(--dim)"},children:[" · ","enabled policies"," ",(0,b.jsxs)("span",{style:{color:"var(--ink)",fontVariantNumeric:"tabular-nums"},children:[j.enabled,"/",j.total]})]})]}),(0,b.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:6,flex:"0 0 auto"},children:[(0,b.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:10,letterSpacing:"0.22em",textTransform:"uppercase",color:"var(--dim)"},children:"want to change which policies fire?"}),(0,b.jsx)("button",{type:"button",className:"btn btn-primary",onClick:()=>o("policies"),children:"[ configure policies → ]"})]})]}):(0,b.jsx)("p",{style:{fontFamily:"var(--font-mono)",fontSize:14,color:"var(--ink-2)",lineHeight:1.7,maxWidth:720,margin:"0 0 24px"},children:"switch policies on or off across your installed harnesses."}),(0,b.jsx)(aT,{activeTab:f,onChange:o}),"activity"===f?(0,b.jsx)(aN,{hooksInstalled:h,onSwitchTab:o}):(0,b.jsx)(aR,{onHooksInstallChange:i})]})})}],22712)}];
|
|
7
7
|
|
|
8
8
|
//# sourceMappingURL=app_policies_hooks-client_tsx_19dqvpcz0uxur._.js.map
|