failproofai 0.0.5-beta.0 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/required-server-files.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +7 -7
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +2 -2
- package/.next/standalone/.next/server/app/_not-found.rsc +15 -15
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +15 -15
- package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +10 -10
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +15 -15
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +15 -15
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +10 -10
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +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 +8 -8
- package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0g72weg._.js +1 -1
- package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_0z7w.hh._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__092s1ta._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__09icjsf._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0r6vvp5._.js → [root-of-the-server]__0a~g15g._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0g.lg8b._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h..k-e._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0okos0k._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0z5dd-f._.js → [root-of-the-server]__0qn95h3._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0w6l33k._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__11pa2ra._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12t-wym._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_10lm7or._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_0xerkr6._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_0q-m0y-._.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/pages/404.html +2 -2
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +9 -9
- package/.next/standalone/.next/static/chunks/{0j_ivegn3i5wt.js → 09ikntpt2-o9b.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0kvldut6ndzyz.js → 0_yayar~bpphd.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0yf_mmdukq6up.js → 0em7tspi4kylh.js} +2 -2
- package/.next/standalone/.next/static/chunks/{04mtv9jnqknn3.js → 0lgbwkfqmnsmc.js} +1 -1
- package/.next/standalone/.next/static/chunks/{04fpsjft~cje..js → 0sme4lkv.tgn-.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0h4qcn40dunn7.js → 0yumumfzx_f27.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0.io32u7gjgsb.js → 13juklu.vksks.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0x8vagatq36_7.js → 17manv47o-~wp.js} +1 -1
- package/.next/standalone/CHANGELOG.md +4 -1
- package/.next/standalone/README.md +2 -2
- package/.next/standalone/dist/cli.mjs +2 -2
- package/.next/standalone/docs/ar/architecture.mdx +2 -2
- package/.next/standalone/docs/ar/configuration.mdx +1 -1
- package/.next/standalone/docs/ar/custom-policies.mdx +2 -5
- package/.next/standalone/docs/architecture.mdx +2 -2
- package/.next/standalone/docs/configuration.mdx +1 -1
- package/.next/standalone/docs/custom-policies.mdx +2 -6
- package/.next/standalone/docs/de/architecture.mdx +2 -2
- package/.next/standalone/docs/de/configuration.mdx +1 -1
- package/.next/standalone/docs/de/custom-policies.mdx +2 -5
- package/.next/standalone/docs/es/architecture.mdx +2 -2
- package/.next/standalone/docs/es/configuration.mdx +1 -1
- package/.next/standalone/docs/es/custom-policies.mdx +2 -5
- package/.next/standalone/docs/fr/architecture.mdx +2 -2
- package/.next/standalone/docs/fr/configuration.mdx +1 -1
- package/.next/standalone/docs/fr/custom-policies.mdx +2 -5
- package/.next/standalone/docs/he/architecture.mdx +2 -2
- package/.next/standalone/docs/he/configuration.mdx +1 -1
- package/.next/standalone/docs/he/custom-policies.mdx +2 -5
- package/.next/standalone/docs/hi/architecture.mdx +2 -2
- package/.next/standalone/docs/hi/configuration.mdx +1 -1
- package/.next/standalone/docs/hi/custom-policies.mdx +2 -5
- package/.next/standalone/docs/i18n/README.ar.md +2 -2
- package/.next/standalone/docs/i18n/README.de.md +2 -2
- package/.next/standalone/docs/i18n/README.es.md +2 -2
- package/.next/standalone/docs/i18n/README.fr.md +2 -2
- package/.next/standalone/docs/i18n/README.he.md +2 -2
- package/.next/standalone/docs/i18n/README.hi.md +2 -2
- package/.next/standalone/docs/i18n/README.it.md +2 -2
- package/.next/standalone/docs/i18n/README.ja.md +2 -2
- package/.next/standalone/docs/i18n/README.ko.md +2 -2
- package/.next/standalone/docs/i18n/README.pt-br.md +2 -2
- package/.next/standalone/docs/i18n/README.ru.md +2 -2
- package/.next/standalone/docs/i18n/README.tr.md +2 -2
- package/.next/standalone/docs/i18n/README.vi.md +2 -2
- package/.next/standalone/docs/i18n/README.zh.md +2 -2
- package/.next/standalone/docs/it/architecture.mdx +2 -2
- package/.next/standalone/docs/it/configuration.mdx +1 -1
- package/.next/standalone/docs/it/custom-policies.mdx +2 -5
- package/.next/standalone/docs/ja/architecture.mdx +2 -2
- package/.next/standalone/docs/ja/configuration.mdx +1 -1
- package/.next/standalone/docs/ja/custom-policies.mdx +2 -5
- package/.next/standalone/docs/ko/architecture.mdx +2 -2
- package/.next/standalone/docs/ko/configuration.mdx +1 -1
- package/.next/standalone/docs/ko/custom-policies.mdx +2 -5
- package/.next/standalone/docs/pt-br/architecture.mdx +2 -2
- package/.next/standalone/docs/pt-br/configuration.mdx +1 -1
- package/.next/standalone/docs/pt-br/custom-policies.mdx +2 -5
- package/.next/standalone/docs/ru/architecture.mdx +2 -2
- package/.next/standalone/docs/ru/configuration.mdx +1 -1
- package/.next/standalone/docs/ru/custom-policies.mdx +2 -5
- package/.next/standalone/docs/tr/architecture.mdx +2 -2
- package/.next/standalone/docs/tr/configuration.mdx +1 -1
- package/.next/standalone/docs/tr/custom-policies.mdx +2 -5
- package/.next/standalone/docs/vi/architecture.mdx +2 -2
- package/.next/standalone/docs/vi/configuration.mdx +1 -1
- package/.next/standalone/docs/vi/custom-policies.mdx +2 -5
- package/.next/standalone/docs/zh/architecture.mdx +2 -2
- package/.next/standalone/docs/zh/configuration.mdx +1 -1
- package/.next/standalone/docs/zh/custom-policies.mdx +2 -5
- package/.next/standalone/package.json +1 -1
- package/.next/standalone/server.js +1 -1
- package/README.md +2 -2
- package/dist/cli.mjs +2 -2
- package/package.json +1 -1
- /package/.next/standalone/.next/static/{ICeMHZ-8ZR7HY5GLm7oSJ → hYQM6iCWnF1W5XDpsIRhV}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{ICeMHZ-8ZR7HY5GLm7oSJ → hYQM6iCWnF1W5XDpsIRhV}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{ICeMHZ-8ZR7HY5GLm7oSJ → hYQM6iCWnF1W5XDpsIRhV}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,74886,43531,e=>{"use strict";var t=e.i(75254);let r=(0,t.default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,r],74886);let s=(0,t.default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["Check",0,s],43531)},81418,88092,51737,e=>{"use strict";var t=e.i(75254);let r=(0,t.default)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["ShieldCheck",0,r],81418);let s=(0,t.default)("shield-x",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]]);e.s(["ShieldX",0,s],88092);let n=(0,t.default)("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);e.s(["ShieldAlert",0,n],51737)},39616,96943,e=>{"use strict";let t=(0,e.i(75254).default)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Settings",0,t],39616);var r=e.i(95187);let s=(0,r.createServerReference)("600305cc9a147d06fe1261c1edbc641ba79d42e900",r.callServer,void 0,r.findSourceMapURL,"searchHookActivityAction");e.s(["searchHookActivityAction",0,s],96943)},34713,e=>{"use strict";e.s(["formatDuration",0,function(e){if(e<1e3)return`${e}ms`;let t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;let r=Math.floor(t/60);if(r>=60){let e=Math.floor(r/60);return`${e}h ${r%60}m`}let s=(t%60).toFixed(0);return`${r}m ${s}s`},"formatRelativeTime",0,function(e){let t=Date.now()-e;return t<6e4?`${Math.max(1,Math.floor(t/1e3))}s ago`:t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:`${Math.floor(t/864e5)}d ago`}])},73375,e=>{"use strict";let t=(0,e.i(75254).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",0,t],73375)},63059,e=>{"use strict";let t=(0,e.i(75254).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",0,t],63059)},73520,e=>{"use strict";var t=e.i(43476),r=e.i(73375),s=e.i(63059);e.s(["default",0,function({currentPage:e,totalPages:n,onPageChange:a}){if(n<=1)return null;let o=e=>`px-3 py-2 text-sm rounded-md transition-colors flex items-center gap-1 bg-muted text-muted-foreground ${e?"opacity-50 cursor-not-allowed":"hover:bg-muted/80"}`;return(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2 py-4",children:[(0,t.jsxs)("button",{onClick:()=>a(e-1),disabled:1===e,className:o(1===e),"aria-label":"Previous page",children:[(0,t.jsx)(r.ChevronLeft,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"Previous"})]}),(0,t.jsx)("div",{className:"flex items-center gap-1",children:(()=>{if(n<=7)return Array.from({length:n},(e,t)=>t+1);let t=[1],r=Math.max(2,e-1),s=Math.min(n-1,e+1);e<=3&&(s=Math.min(5,n-1)),e>=n-2&&(r=Math.max(2,n-4)),r>2&&t.push("ellipsis-start");for(let e=r;e<=s;e++)t.push(e);return s<n-1&&t.push("ellipsis-end"),t.push(n),t})().map(r=>"string"==typeof r?(0,t.jsx)("span",{className:"px-2 text-muted-foreground",children:"..."},r):(0,t.jsx)("button",{onClick:()=>a(r),className:`min-w-[2.5rem] px-3 py-2 text-sm rounded-md transition-colors ${e===r?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/80"}`,"aria-label":`Page ${r}`,"aria-current":e===r?"page":void 0,children:r},r))}),(0,t.jsxs)("button",{onClick:()=>a(e+1),disabled:e===n,className:o(e===n),"aria-label":"Next page",children:[(0,t.jsx)("span",{className:"hidden sm:inline",children:"Next"}),(0,t.jsx)(s.ChevronRight,{className:"w-4 h-4"})]})]})}])},80060,2711,e=>{"use strict";var t=e.i(18566),r=e.i(71645);function s(e){let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),s=String(e.getDate()).padStart(2,"0");return`${t}-${r}-${s}`}function n(e){var t;if(!e||(t=e,!/^\d{4}-\d{2}-\d{2}$/.test(t)||isNaN(Date.parse(t))))return null;let[r,s,n]=e.split("-").map(Number);return new Date(r,s-1,n,12,0,0)}e.s(["useUrlParams",0,function(){let e=(0,t.useSearchParams)(),s=(0,t.useRouter)(),n=(0,t.usePathname)(),a=(0,r.useRef)(null),o=(0,r.useCallback)(t=>e.get(t),[e]),l=(0,r.useCallback)(()=>new URLSearchParams(e.toString()),[e]),i=(0,r.useCallback)(t=>{a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{let r=new URLSearchParams(e.toString());for(let[e,s]of Object.entries(t))void 0===s||""===s?r.delete(e):r.set(e,s);let a=r.toString(),o=a?`${n}?${a}`:n;s.replace(o,{scroll:!1})},150)},[e,n,s]);return(0,r.useEffect)(()=>()=>{a.current&&clearTimeout(a.current)},[]),{get:o,getAll:l,setAll:i}}],80060),e.s(["dateRangeToParams",0,function(e){let t={};return e.from&&(t.from=s(e.from)),e.to&&(t.to=s(e.to)),t},"keywordsToParam",0,function(e){if(0!==e.length)return e.map(e=>encodeURIComponent(e)).join(",")},"pageToParam",0,function(e){return e<=1?void 0:String(e)},"paramToKeywords",0,function(e){return e?e.split(",").map(e=>decodeURIComponent(e.trim())).filter(e=>e.length>0):[]},"paramToPage",0,function(e){if(!e)return 1;let t=parseInt(e,10);return Number.isFinite(t)&&t>=1?t:1},"paramToPreset",0,function(e){return e&&["all","last-hour","today","last-7-days","last-30-days","custom"].includes(e)?e:"all"},"paramsToDateRange",0,function(e,t){return{from:n(e),to:n(t)}},"presetToParam",0,function(e){return"all"===e?void 0:e}],2711)},37727,e=>{"use strict";let t=(0,e.i(75254).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",0,t],37727)},64245,e=>{"use strict";var t=e.i(43476),r=e.i(71645),s=e.i(74080),n=e.i(22016),a=e.i(75254);let o=(0,a.default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);var l=e.i(81418),i=e.i(88092),d=e.i(51737),c=e.i(98919),m=e.i(64659),u=e.i(74886),x=e.i(43531),h=e.i(39616);let p=(0,a.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);var f=e.i(37727),g=e.i(73520),b=e.i(95187);let j=(0,b.createServerReference)("40a5bb8949bcdd304a82aa1b972f825d6b3be8c705",b.callServer,void 0,b.findSourceMapURL,"getHookActivityAction");var v=e.i(96943);let y=(0,b.createServerReference)("00fb97c356c53cafd02fb996b61c9c63c5a42a191a",b.callServer,void 0,b.findSourceMapURL,"getHooksConfigAction"),N=(0,b.createServerReference)("60c7e6275354f21d023ae84ff07c34cf5d3f900e52",b.callServer,void 0,b.findSourceMapURL,"togglePolicyAction"),k=(0,b.createServerReference)("404702bdd4d52ec66bfe0595a9dfb2023dd3881813",b.callServer,void 0,b.findSourceMapURL,"installHooksWebAction"),w=(0,b.createServerReference)("40162fdf0306d6eb42c895a82bc2624ca4f878b77e",b.callServer,void 0,b.findSourceMapURL,"removeHooksWebAction"),S=(0,b.createServerReference)("60089340913f90c0828bfbe5b8e2516ad82fb37abf",b.callServer,void 0,b.findSourceMapURL,"updatePolicyParamsAction");var C=e.i(85881),P=e.i(80060),T=e.i(2711),R=e.i(34713),$=e.i(67881);function A({sessionId:e,transcriptPath:r}){if(!e)return(0,t.jsx)("span",{className:"text-muted-foreground",children:"\\u2014"});let s=r?function(e){let t=e.replace(/\\/g,"/").split("/").filter(Boolean);if(t.length<2)return null;let r=t[t.length-2];return!r||r.startsWith(".")?null:r}(r):null,a=e?e.slice(0,8):"—";return s?(0,t.jsx)(n.default,{href:`/project/${encodeURIComponent(s)}/session/${encodeURIComponent(e)}`,className:"text-primary hover:underline font-mono",onClick:e=>e.stopPropagation(),children:a}):(0,t.jsx)("span",{className:"text-muted-foreground font-mono",children:a})}function M({decision:e}){return"deny"===e?(0,t.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,t.jsx)(i.ShieldX,{className:"h-3 w-3"}),"Deny"]}):"instruct"===e?(0,t.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,t.jsx)(d.ShieldAlert,{className:"h-3 w-3"}),"Instruct"]}):(0,t.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,t.jsx)(l.ShieldCheck,{className:"h-3 w-3"}),"Allow"]})}function I({eventType:e}){return(0,t.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:e})}function E({mode:e}){let r="default"===e;return(0,t.jsx)("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium border ${r?"bg-sky-500/10 text-sky-400 border-sky-500/20":"bg-amber-500/10 text-amber-400 border-amber-500/20"}`,children:e})}function U({ms:e}){return(0,t.jsx)("span",{className:`font-mono text-[0.7rem] ${e>500?"text-red-400":e>100?"text-amber-400":"text-muted-foreground"}`,children:e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`})}function F({text:e}){let[s,n]=(0,r.useState)(!1),a=async t=>{t.stopPropagation();try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)}catch{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),n(!0),setTimeout(()=>n(!1),1500)}};return(0,t.jsx)("button",{onClick:a,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:s?(0,t.jsx)(x.Check,{className:"h-3 w-3 text-emerald-400"}):(0,t.jsx)(u.Copy,{className:"h-3 w-3"})})}function D({value:e,onChange:r}){return(0,t.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(s=>(0,t.jsx)("button",{onClick:()=>r(s.value),className:`px-2.5 py-1 text-[0.65rem] font-medium rounded transition-all ${e===s.value?"deny"===s.value?"bg-red-500/15 text-red-400 shadow-sm":"allow"===s.value?"bg-emerald-500/15 text-emerald-400 shadow-sm":"instruct"===s.value?"bg-amber-500/15 text-amber-400 shadow-sm":"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:s.label},s.value))})}function z({stats:e}){let r=e.totalEvents>0?(e.denyCount/e.totalEvents*100).toFixed(0):"0";return(0,t.jsxs)("div",{className:"flex items-center gap-6 text-[0.7rem] text-muted-foreground",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-foreground font-mono font-semibold",children:e.totalEvents})," total events"]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("span",{className:`font-mono font-semibold ${e.denyCount>0?"text-red-400":"text-foreground"}`,children:[r,"%"]})," ","deny rate"]}),(0,t.jsxs)("div",{className:"hidden sm:block",children:["top policy:"," ",(0,t.jsx)("span",{className:"font-mono text-foreground",children:e.topPolicy??"—"})]})]})}function L({item:e}){return(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:10,className:"px-0 py-0",children:(0,t.jsxs)("div",{className:"px-6 py-3 bg-muted/20 border-t border-border/30 space-y-2 text-xs animate-expand",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-1.5",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Session ID: "}),(0,t.jsx)("span",{className:"font-mono text-foreground",children:e.sessionId??"—"}),e.sessionId&&(0,t.jsx)(F,{text:e.sessionId})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"CWD: "}),(0,t.jsx)("span",{className:"font-mono text-foreground",children:e.cwd??"—"}),e.cwd&&(0,t.jsx)(F,{text:e.cwd})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Transcript: "}),(0,t.jsx)("span",{className:"font-mono text-foreground break-all",children:e.transcriptPath??"—"})]})]}),e.policyNames&&e.policyNames.length>1&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Policies: "}),(0,t.jsx)("span",{className:"font-mono text-foreground",children:e.policyNames.join(", ")})]}),e.reason&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Full reason: "}),(0,t.jsx)("span",{className:"text-foreground",children:e.reason})]})]})})})}function O({hooksInstalled:e,onSwitchTab:s}){let{intervalSec:n}=(0,C.useAutoRefresh)(),a=(0,P.useUrlParams)(),o=(0,r.useRef)(!1),[l,i]=(0,r.useState)(()=>(0,T.paramToPage)(a.get("page"))),[d,u]=(0,r.useState)(null),[x,h]=(0,r.useState)(null),[p,f]=(0,r.useState)(()=>{let e=a.get("decision");return"allow"===e||"deny"===e||"instruct"===e?e:""}),[b,y]=(0,r.useState)(()=>a.get("event")??""),[N,k]=(0,r.useState)(()=>a.get("policy")??""),[w,S]=(0,r.useState)(()=>a.get("session")??""),$=(0,r.useRef)(null),F=(0,r.useRef)({filterDecision:p,filterEventType:b,filterPolicy:N,filterSessionId:w});F.current={filterDecision:p,filterEventType:b,filterPolicy:N,filterSessionId:w},(0,r.useEffect)(()=>{if(!o.current){o.current=!0;return}a.setAll({decision:p||void 0,event:b||void 0,policy:N||void 0,session:w||void 0,page:(0,T.pageToParam)(l)})},[p,b,N,w,l]);let B=""!==p||""!==b||""!==N||""!==w,H=(0,r.useCallback)(async e=>{try{let t,{filterDecision:r,filterEventType:s,filterPolicy:n,filterSessionId:a}=F.current;t=""!==r||""!==s||""!==n||""!==a?await (0,v.searchHookActivityAction)({decision:r||void 0,eventType:s||void 0,policyName:n||void 0,sessionId:a||void 0},e):await j(e),u(t)}catch{}},[]);(0,r.useEffect)(()=>{H(l);let e=setInterval(()=>H(l),n>0?1e3*n:5e3);return()=>clearInterval(e)},[l,H,n]),(0,r.useEffect)(()=>($.current&&clearTimeout($.current),$.current=setTimeout(()=>{i(1),h(null),H(1)},300),()=>{$.current&&clearTimeout($.current)}),[p,b,N,w]);let X=d?.entries??[],W=d?.totalPages??1;return(0,t.jsxs)(t.Fragment,{children:[d?.stats&&d.stats.totalEvents>0&&(0,t.jsx)("div",{className:"mb-4",children:(0,t.jsx)(z,{stats:d.stats})}),(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4 py-2.5 border-b border-border bg-muted/20",children:[(0,t.jsx)(D,{value:p,onChange:f}),(0,t.jsxs)("select",{value:b,onChange:e=>y(e.target.value),className:"h-7 rounded-md border border-border bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/40 transition-shadow",children:[(0,t.jsx)("option",{value:"",children:"All Events"}),(0,t.jsx)("option",{value:"PreToolUse",children:"PreToolUse"}),(0,t.jsx)("option",{value:"PostToolUse",children:"PostToolUse"}),(0,t.jsx)("option",{value:"SessionStart",children:"SessionStart"}),(0,t.jsx)("option",{value:"SessionEnd",children:"SessionEnd"}),(0,t.jsx)("option",{value:"UserPromptSubmit",children:"UserPromptSubmit"}),(0,t.jsx)("option",{value:"PermissionRequest",children:"PermissionRequest"})]}),(0,t.jsx)("div",{className:"relative",children:(0,t.jsx)("input",{type:"text",value:N,onChange:e=>k(e.target.value),placeholder:"Filter by policy\\u2026",className:"h-7 rounded-md border border-border bg-background px-2.5 text-xs text-foreground placeholder:text-muted-foreground w-44 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/40 transition-shadow"})}),(0,t.jsx)("div",{className:"relative",children:(0,t.jsx)("input",{type:"text",value:w,onChange:e=>S(e.target.value),placeholder:"Filter by session…",className:"h-7 rounded-md border border-border bg-background px-2.5 text-xs text-foreground placeholder:text-muted-foreground w-44 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/40 transition-shadow"})})]}),0===X.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 px-4 text-center",children:[(0,t.jsx)(c.Shield,{className:"h-12 w-12 text-muted-foreground/30"}),!1===e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-4 font-medium",children:"Policies are not installed"}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:["Go to the"," ",(0,t.jsx)("button",{className:"underline hover:text-foreground transition-colors",onClick:()=>s?.("policies"),children:"Policies tab"})," ","and click ",(0,t.jsx)("span",{className:"font-mono bg-muted px-1 rounded",children:"Install"})," to enable policy monitoring."]})]}):(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-4",children:B?"No matching activity.":"Waiting for hook events…"})]}):(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-xs",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"text-left text-muted-foreground border-b border-border bg-muted/30",children:[(0,t.jsx)("th",{className:"px-4 py-2.5 font-medium w-6"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Decision"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Event"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Tool"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Policy"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Reason"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Duration"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Session"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Mode"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium text-right",children:"Time"})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-border/30",children:X.map((e,s)=>{let n="deny"===e.decision,a=x===s,o="instruct"===e.decision;return(0,t.jsxs)(r.default.Fragment,{children:[(0,t.jsxs)("tr",{onClick:()=>{h(e=>e===s?null:s)},className:`cursor-pointer transition-colors ${n?"bg-red-500/[0.03] hover:bg-red-500/[0.07] border-l-2 border-l-red-500/40":o?"bg-amber-500/[0.03] hover:bg-amber-500/[0.07] border-l-2 border-l-amber-500/40":s%2==0?"hover:bg-muted/30":"bg-muted/[0.04] hover:bg-muted/30"} ${a?"bg-muted/20":""}`,children:[(0,t.jsx)("td",{className:"px-4 py-2",children:(0,t.jsx)(m.ChevronDown,{className:`h-3.5 w-3.5 text-muted-foreground transition-transform duration-150 ${a?"rotate-0":"-rotate-90"}`})}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(M,{decision:e.decision})}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(I,{eventType:e.eventType})}),(0,t.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:e.toolName??"—"}),(0,t.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:e.policyNames&&e.policyNames.length>1?(0,t.jsxs)("span",{title:e.policyNames.join(", "),children:[e.policyNames[0],(0,t.jsxs)("span",{className:"text-muted-foreground text-[0.6rem]",children:[" +",e.policyNames.length-1]})]}):e.policyName??"—"}),(0,t.jsx)("td",{className:"px-3 py-2 text-muted-foreground truncate max-w-[240px]",title:e.reason??"",children:e.reason??"—"}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(U,{ms:e.durationMs})}),(0,t.jsx)("td",{className:"px-3 py-2",title:e.sessionId??"",children:(0,t.jsx)(A,{sessionId:e.sessionId,transcriptPath:e.transcriptPath})}),(0,t.jsx)("td",{className:"px-3 py-2",children:e.permissionMode?(0,t.jsx)(E,{mode:e.permissionMode}):"—"}),(0,t.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground whitespace-nowrap",title:new Date(e.timestamp).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),children:(0,R.formatRelativeTime)(e.timestamp)})]}),a&&(0,t.jsx)(L,{item:e})]},`${e.timestamp}-${s}`)})})]})}),(0,t.jsx)(g.default,{currentPage:l,totalPages:W,onPageChange:e=>{i(e),h(null)}})]})]})}function B({enabled:e,onChange:r,disabled:s}){return(0,t.jsx)("button",{onClick:r,disabled:s,className:`relative inline-flex h-4 w-7 shrink-0 items-center rounded-full transition-colors disabled:opacity-40 ${e?"bg-emerald-500":"bg-muted-foreground/30"}`,"aria-label":e?"Disable policy":"Enable policy",children:(0,t.jsx)("span",{className:`inline-block h-3 w-3 rounded-full bg-white shadow transition-transform ${e?"translate-x-3.5":"translate-x-0.5"}`})})}function H({policy:e,onClose:s,onSave:n}){let a=e.params??{},o=e.currentParams??{},[l,i]=(0,r.useState)(()=>{let e={};for(let[t,r]of Object.entries(a)){let s=t in o?o[t]:r.default;e[t]=s}return e});(0,r.useEffect)(()=>{let e=e=>{"Escape"===e.key&&s()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[s]);let d=(e,t)=>{i(r=>({...r,[e]:t}))};return(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:e=>{e.target===e.currentTarget&&s()},children:(0,t.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,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-mono font-semibold text-foreground",children:e.name}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:e.description})]}),(0,t.jsx)("button",{onClick:s,className:"text-muted-foreground hover:text-foreground transition-colors",children:(0,t.jsx)(f.X,{className:"h-4 w-4"})})]}),(0,t.jsx)("div",{className:"overflow-y-auto flex-1 px-4 py-4 space-y-4",children:Object.entries(a).map(([e,r])=>(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-semibold text-foreground mb-1 font-mono",children:e}),(0,t.jsx)("p",{className:"text-[0.65rem] text-muted-foreground mb-1.5",children:r.description}),((e,r)=>{let s=l[e];if("boolean"===r.type)return(0,t.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,t.jsx)("input",{type:"checkbox",checked:!!s,onChange:t=>d(e,t.target.checked),className:"rounded border-border"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:r.description})]});if("number"===r.type)return(0,t.jsx)("input",{type:"number",value:"number"==typeof s?s:"",onChange:t=>d(e,Number(t.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[]"===r.type){let r=Array.isArray(s)?s.join("\n"):"";return(0,t.jsx)("textarea",{value:r,onChange:t=>d(e,t.target.value.split("\n").filter(e=>""!==e.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[]"===r.type){let r=Array.isArray(s)?s:[];return(0,t.jsxs)("div",{className:"space-y-1.5",children:[r.map((s,n)=>(0,t.jsxs)("div",{className:"flex gap-1.5 items-center",children:[(0,t.jsx)("input",{type:"text",value:s.regex,onChange:t=>{let s=[...r];s[n]={...s[n],regex:t.target.value},d(e,s)},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,t.jsx)("input",{type:"text",value:s.label,onChange:t=>{let s=[...r];s[n]={...s[n],label:t.target.value},d(e,s)},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,t.jsx)("button",{onClick:()=>d(e,r.filter((e,t)=>t!==n)),className:"text-muted-foreground/50 hover:text-destructive transition-colors",children:(0,t.jsx)(f.X,{className:"h-3.5 w-3.5"})})]},n)),(0,t.jsx)("button",{onClick:()=>d(e,[...r,{regex:"",label:""}]),className:"text-xs text-primary hover:underline",children:"+ Add pattern"})]})}return(0,t.jsx)("input",{type:"text",value:"string"==typeof s?s:"",onChange:t=>d(e,t.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"})})(e,r)]},e))}),(0,t.jsxs)("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-border",children:[(0,t.jsx)($.Button,{variant:"outline",size:"sm",onClick:s,className:"h-7 text-xs",children:"Cancel"}),(0,t.jsx)($.Button,{size:"sm",onClick:()=>n(l),className:"h-7 text-xs",children:"Save"})]})]})})}function X({message:e,onDismiss:r,onInstall:n,isPending:a}){return(0,s.createPortal)((0,t.jsxs)("div",{className:"fixed top-4 right-4 z-[9999] w-full max-w-sm",style:{animation:"slideInFromRight 0.25s ease-out"},children:[(0,t.jsx)("style",{children:`
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,74886,43531,e=>{"use strict";var t=e.i(75254);let r=(0,t.default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,r],74886);let s=(0,t.default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["Check",0,s],43531)},81418,88092,51737,e=>{"use strict";var t=e.i(75254);let r=(0,t.default)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["ShieldCheck",0,r],81418);let s=(0,t.default)("shield-x",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]]);e.s(["ShieldX",0,s],88092);let n=(0,t.default)("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);e.s(["ShieldAlert",0,n],51737)},39616,91389,e=>{"use strict";let t=(0,e.i(75254).default)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Settings",0,t],39616);var r=e.i(95187);let s=(0,r.createServerReference)("60d6b50cad2a9b73002f12986d113a983e47c47031",r.callServer,void 0,r.findSourceMapURL,"searchHookActivityAction");e.s(["searchHookActivityAction",0,s],91389)},34713,e=>{"use strict";e.s(["formatDuration",0,function(e){if(e<1e3)return`${e}ms`;let t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;let r=Math.floor(t/60);if(r>=60){let e=Math.floor(r/60);return`${e}h ${r%60}m`}let s=(t%60).toFixed(0);return`${r}m ${s}s`},"formatRelativeTime",0,function(e){let t=Date.now()-e;return t<6e4?`${Math.max(1,Math.floor(t/1e3))}s ago`:t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:`${Math.floor(t/864e5)}d ago`}])},73375,e=>{"use strict";let t=(0,e.i(75254).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",0,t],73375)},63059,e=>{"use strict";let t=(0,e.i(75254).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",0,t],63059)},73520,e=>{"use strict";var t=e.i(43476),r=e.i(73375),s=e.i(63059);e.s(["default",0,function({currentPage:e,totalPages:n,onPageChange:a}){if(n<=1)return null;let o=e=>`px-3 py-2 text-sm rounded-md transition-colors flex items-center gap-1 bg-muted text-muted-foreground ${e?"opacity-50 cursor-not-allowed":"hover:bg-muted/80"}`;return(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2 py-4",children:[(0,t.jsxs)("button",{onClick:()=>a(e-1),disabled:1===e,className:o(1===e),"aria-label":"Previous page",children:[(0,t.jsx)(r.ChevronLeft,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"Previous"})]}),(0,t.jsx)("div",{className:"flex items-center gap-1",children:(()=>{if(n<=7)return Array.from({length:n},(e,t)=>t+1);let t=[1],r=Math.max(2,e-1),s=Math.min(n-1,e+1);e<=3&&(s=Math.min(5,n-1)),e>=n-2&&(r=Math.max(2,n-4)),r>2&&t.push("ellipsis-start");for(let e=r;e<=s;e++)t.push(e);return s<n-1&&t.push("ellipsis-end"),t.push(n),t})().map(r=>"string"==typeof r?(0,t.jsx)("span",{className:"px-2 text-muted-foreground",children:"..."},r):(0,t.jsx)("button",{onClick:()=>a(r),className:`min-w-[2.5rem] px-3 py-2 text-sm rounded-md transition-colors ${e===r?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/80"}`,"aria-label":`Page ${r}`,"aria-current":e===r?"page":void 0,children:r},r))}),(0,t.jsxs)("button",{onClick:()=>a(e+1),disabled:e===n,className:o(e===n),"aria-label":"Next page",children:[(0,t.jsx)("span",{className:"hidden sm:inline",children:"Next"}),(0,t.jsx)(s.ChevronRight,{className:"w-4 h-4"})]})]})}])},80060,2711,e=>{"use strict";var t=e.i(18566),r=e.i(71645);function s(e){let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),s=String(e.getDate()).padStart(2,"0");return`${t}-${r}-${s}`}function n(e){var t;if(!e||(t=e,!/^\d{4}-\d{2}-\d{2}$/.test(t)||isNaN(Date.parse(t))))return null;let[r,s,n]=e.split("-").map(Number);return new Date(r,s-1,n,12,0,0)}e.s(["useUrlParams",0,function(){let e=(0,t.useSearchParams)(),s=(0,t.useRouter)(),n=(0,t.usePathname)(),a=(0,r.useRef)(null),o=(0,r.useCallback)(t=>e.get(t),[e]),l=(0,r.useCallback)(()=>new URLSearchParams(e.toString()),[e]),i=(0,r.useCallback)(t=>{a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{let r=new URLSearchParams(e.toString());for(let[e,s]of Object.entries(t))void 0===s||""===s?r.delete(e):r.set(e,s);let a=r.toString(),o=a?`${n}?${a}`:n;s.replace(o,{scroll:!1})},150)},[e,n,s]);return(0,r.useEffect)(()=>()=>{a.current&&clearTimeout(a.current)},[]),{get:o,getAll:l,setAll:i}}],80060),e.s(["dateRangeToParams",0,function(e){let t={};return e.from&&(t.from=s(e.from)),e.to&&(t.to=s(e.to)),t},"keywordsToParam",0,function(e){if(0!==e.length)return e.map(e=>encodeURIComponent(e)).join(",")},"pageToParam",0,function(e){return e<=1?void 0:String(e)},"paramToKeywords",0,function(e){return e?e.split(",").map(e=>decodeURIComponent(e.trim())).filter(e=>e.length>0):[]},"paramToPage",0,function(e){if(!e)return 1;let t=parseInt(e,10);return Number.isFinite(t)&&t>=1?t:1},"paramToPreset",0,function(e){return e&&["all","last-hour","today","last-7-days","last-30-days","custom"].includes(e)?e:"all"},"paramsToDateRange",0,function(e,t){return{from:n(e),to:n(t)}},"presetToParam",0,function(e){return"all"===e?void 0:e}],2711)},37727,e=>{"use strict";let t=(0,e.i(75254).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",0,t],37727)},64245,e=>{"use strict";var t=e.i(43476),r=e.i(71645),s=e.i(74080),n=e.i(22016),a=e.i(75254);let o=(0,a.default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);var l=e.i(81418),i=e.i(88092),d=e.i(51737),c=e.i(98919),m=e.i(64659),u=e.i(74886),x=e.i(43531),h=e.i(39616);let p=(0,a.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);var f=e.i(37727),g=e.i(73520),b=e.i(95187);let j=(0,b.createServerReference)("409ac3d85dad86d5a545121f41694fc27567621151",b.callServer,void 0,b.findSourceMapURL,"getHookActivityAction");var v=e.i(91389);let y=(0,b.createServerReference)("008446dd7dbe4ee2be6d4ded36b3c4f030e9b74347",b.callServer,void 0,b.findSourceMapURL,"getHooksConfigAction"),N=(0,b.createServerReference)("6079bbfe0ef26f117e878e498a62317637c9c83cdd",b.callServer,void 0,b.findSourceMapURL,"togglePolicyAction"),k=(0,b.createServerReference)("407393f434fa8e345b4788b72b0a8712ee0e2354f6",b.callServer,void 0,b.findSourceMapURL,"installHooksWebAction"),w=(0,b.createServerReference)("40b9c5d67896a92a1c3f884d07f1f899a26e34bbdb",b.callServer,void 0,b.findSourceMapURL,"removeHooksWebAction"),S=(0,b.createServerReference)("60c4fa86a547b54955f36e390513105c4efe97113f",b.callServer,void 0,b.findSourceMapURL,"updatePolicyParamsAction");var C=e.i(85881),P=e.i(80060),T=e.i(2711),R=e.i(34713),$=e.i(67881);function A({sessionId:e,transcriptPath:r}){if(!e)return(0,t.jsx)("span",{className:"text-muted-foreground",children:"\\u2014"});let s=r?function(e){let t=e.replace(/\\/g,"/").split("/").filter(Boolean);if(t.length<2)return null;let r=t[t.length-2];return!r||r.startsWith(".")?null:r}(r):null,a=e?e.slice(0,8):"—";return s?(0,t.jsx)(n.default,{href:`/project/${encodeURIComponent(s)}/session/${encodeURIComponent(e)}`,className:"text-primary hover:underline font-mono",onClick:e=>e.stopPropagation(),children:a}):(0,t.jsx)("span",{className:"text-muted-foreground font-mono",children:a})}function M({decision:e}){return"deny"===e?(0,t.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,t.jsx)(i.ShieldX,{className:"h-3 w-3"}),"Deny"]}):"instruct"===e?(0,t.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,t.jsx)(d.ShieldAlert,{className:"h-3 w-3"}),"Instruct"]}):(0,t.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,t.jsx)(l.ShieldCheck,{className:"h-3 w-3"}),"Allow"]})}function I({eventType:e}){return(0,t.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:e})}function E({mode:e}){let r="default"===e;return(0,t.jsx)("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium border ${r?"bg-sky-500/10 text-sky-400 border-sky-500/20":"bg-amber-500/10 text-amber-400 border-amber-500/20"}`,children:e})}function U({ms:e}){return(0,t.jsx)("span",{className:`font-mono text-[0.7rem] ${e>500?"text-red-400":e>100?"text-amber-400":"text-muted-foreground"}`,children:e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`})}function F({text:e}){let[s,n]=(0,r.useState)(!1),a=async t=>{t.stopPropagation();try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)}catch{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),n(!0),setTimeout(()=>n(!1),1500)}};return(0,t.jsx)("button",{onClick:a,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:s?(0,t.jsx)(x.Check,{className:"h-3 w-3 text-emerald-400"}):(0,t.jsx)(u.Copy,{className:"h-3 w-3"})})}function D({value:e,onChange:r}){return(0,t.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(s=>(0,t.jsx)("button",{onClick:()=>r(s.value),className:`px-2.5 py-1 text-[0.65rem] font-medium rounded transition-all ${e===s.value?"deny"===s.value?"bg-red-500/15 text-red-400 shadow-sm":"allow"===s.value?"bg-emerald-500/15 text-emerald-400 shadow-sm":"instruct"===s.value?"bg-amber-500/15 text-amber-400 shadow-sm":"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:s.label},s.value))})}function z({stats:e}){let r=e.totalEvents>0?(e.denyCount/e.totalEvents*100).toFixed(0):"0";return(0,t.jsxs)("div",{className:"flex items-center gap-6 text-[0.7rem] text-muted-foreground",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-foreground font-mono font-semibold",children:e.totalEvents})," total events"]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("span",{className:`font-mono font-semibold ${e.denyCount>0?"text-red-400":"text-foreground"}`,children:[r,"%"]})," ","deny rate"]}),(0,t.jsxs)("div",{className:"hidden sm:block",children:["top policy:"," ",(0,t.jsx)("span",{className:"font-mono text-foreground",children:e.topPolicy??"—"})]})]})}function L({item:e}){return(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:10,className:"px-0 py-0",children:(0,t.jsxs)("div",{className:"px-6 py-3 bg-muted/20 border-t border-border/30 space-y-2 text-xs animate-expand",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-1.5",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Session ID: "}),(0,t.jsx)("span",{className:"font-mono text-foreground",children:e.sessionId??"—"}),e.sessionId&&(0,t.jsx)(F,{text:e.sessionId})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"CWD: "}),(0,t.jsx)("span",{className:"font-mono text-foreground",children:e.cwd??"—"}),e.cwd&&(0,t.jsx)(F,{text:e.cwd})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Transcript: "}),(0,t.jsx)("span",{className:"font-mono text-foreground break-all",children:e.transcriptPath??"—"})]})]}),e.policyNames&&e.policyNames.length>1&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Policies: "}),(0,t.jsx)("span",{className:"font-mono text-foreground",children:e.policyNames.join(", ")})]}),e.reason&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Full reason: "}),(0,t.jsx)("span",{className:"text-foreground",children:e.reason})]})]})})})}function O({hooksInstalled:e,onSwitchTab:s}){let{intervalSec:n}=(0,C.useAutoRefresh)(),a=(0,P.useUrlParams)(),o=(0,r.useRef)(!1),[l,i]=(0,r.useState)(()=>(0,T.paramToPage)(a.get("page"))),[d,u]=(0,r.useState)(null),[x,h]=(0,r.useState)(null),[p,f]=(0,r.useState)(()=>{let e=a.get("decision");return"allow"===e||"deny"===e||"instruct"===e?e:""}),[b,y]=(0,r.useState)(()=>a.get("event")??""),[N,k]=(0,r.useState)(()=>a.get("policy")??""),[w,S]=(0,r.useState)(()=>a.get("session")??""),$=(0,r.useRef)(null),F=(0,r.useRef)({filterDecision:p,filterEventType:b,filterPolicy:N,filterSessionId:w});F.current={filterDecision:p,filterEventType:b,filterPolicy:N,filterSessionId:w},(0,r.useEffect)(()=>{if(!o.current){o.current=!0;return}a.setAll({decision:p||void 0,event:b||void 0,policy:N||void 0,session:w||void 0,page:(0,T.pageToParam)(l)})},[p,b,N,w,l]);let B=""!==p||""!==b||""!==N||""!==w,H=(0,r.useCallback)(async e=>{try{let t,{filterDecision:r,filterEventType:s,filterPolicy:n,filterSessionId:a}=F.current;t=""!==r||""!==s||""!==n||""!==a?await (0,v.searchHookActivityAction)({decision:r||void 0,eventType:s||void 0,policyName:n||void 0,sessionId:a||void 0},e):await j(e),u(t)}catch{}},[]);(0,r.useEffect)(()=>{H(l);let e=setInterval(()=>H(l),n>0?1e3*n:5e3);return()=>clearInterval(e)},[l,H,n]),(0,r.useEffect)(()=>($.current&&clearTimeout($.current),$.current=setTimeout(()=>{i(1),h(null),H(1)},300),()=>{$.current&&clearTimeout($.current)}),[p,b,N,w]);let X=d?.entries??[],W=d?.totalPages??1;return(0,t.jsxs)(t.Fragment,{children:[d?.stats&&d.stats.totalEvents>0&&(0,t.jsx)("div",{className:"mb-4",children:(0,t.jsx)(z,{stats:d.stats})}),(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4 py-2.5 border-b border-border bg-muted/20",children:[(0,t.jsx)(D,{value:p,onChange:f}),(0,t.jsxs)("select",{value:b,onChange:e=>y(e.target.value),className:"h-7 rounded-md border border-border bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/40 transition-shadow",children:[(0,t.jsx)("option",{value:"",children:"All Events"}),(0,t.jsx)("option",{value:"PreToolUse",children:"PreToolUse"}),(0,t.jsx)("option",{value:"PostToolUse",children:"PostToolUse"}),(0,t.jsx)("option",{value:"SessionStart",children:"SessionStart"}),(0,t.jsx)("option",{value:"SessionEnd",children:"SessionEnd"}),(0,t.jsx)("option",{value:"UserPromptSubmit",children:"UserPromptSubmit"}),(0,t.jsx)("option",{value:"PermissionRequest",children:"PermissionRequest"})]}),(0,t.jsx)("div",{className:"relative",children:(0,t.jsx)("input",{type:"text",value:N,onChange:e=>k(e.target.value),placeholder:"Filter by policy\\u2026",className:"h-7 rounded-md border border-border bg-background px-2.5 text-xs text-foreground placeholder:text-muted-foreground w-44 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/40 transition-shadow"})}),(0,t.jsx)("div",{className:"relative",children:(0,t.jsx)("input",{type:"text",value:w,onChange:e=>S(e.target.value),placeholder:"Filter by session…",className:"h-7 rounded-md border border-border bg-background px-2.5 text-xs text-foreground placeholder:text-muted-foreground w-44 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/40 transition-shadow"})})]}),0===X.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 px-4 text-center",children:[(0,t.jsx)(c.Shield,{className:"h-12 w-12 text-muted-foreground/30"}),!1===e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-4 font-medium",children:"Policies are not installed"}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:["Go to the"," ",(0,t.jsx)("button",{className:"underline hover:text-foreground transition-colors",onClick:()=>s?.("policies"),children:"Policies tab"})," ","and click ",(0,t.jsx)("span",{className:"font-mono bg-muted px-1 rounded",children:"Install"})," to enable policy monitoring."]})]}):(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-4",children:B?"No matching activity.":"Waiting for hook events…"})]}):(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-xs",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"text-left text-muted-foreground border-b border-border bg-muted/30",children:[(0,t.jsx)("th",{className:"px-4 py-2.5 font-medium w-6"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Decision"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Event"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Tool"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Policy"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Reason"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Duration"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Session"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Mode"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium text-right",children:"Time"})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-border/30",children:X.map((e,s)=>{let n="deny"===e.decision,a=x===s,o="instruct"===e.decision;return(0,t.jsxs)(r.default.Fragment,{children:[(0,t.jsxs)("tr",{onClick:()=>{h(e=>e===s?null:s)},className:`cursor-pointer transition-colors ${n?"bg-red-500/[0.03] hover:bg-red-500/[0.07] border-l-2 border-l-red-500/40":o?"bg-amber-500/[0.03] hover:bg-amber-500/[0.07] border-l-2 border-l-amber-500/40":s%2==0?"hover:bg-muted/30":"bg-muted/[0.04] hover:bg-muted/30"} ${a?"bg-muted/20":""}`,children:[(0,t.jsx)("td",{className:"px-4 py-2",children:(0,t.jsx)(m.ChevronDown,{className:`h-3.5 w-3.5 text-muted-foreground transition-transform duration-150 ${a?"rotate-0":"-rotate-90"}`})}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(M,{decision:e.decision})}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(I,{eventType:e.eventType})}),(0,t.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:e.toolName??"—"}),(0,t.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:e.policyNames&&e.policyNames.length>1?(0,t.jsxs)("span",{title:e.policyNames.join(", "),children:[e.policyNames[0],(0,t.jsxs)("span",{className:"text-muted-foreground text-[0.6rem]",children:[" +",e.policyNames.length-1]})]}):e.policyName??"—"}),(0,t.jsx)("td",{className:"px-3 py-2 text-muted-foreground truncate max-w-[240px]",title:e.reason??"",children:e.reason??"—"}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(U,{ms:e.durationMs})}),(0,t.jsx)("td",{className:"px-3 py-2",title:e.sessionId??"",children:(0,t.jsx)(A,{sessionId:e.sessionId,transcriptPath:e.transcriptPath})}),(0,t.jsx)("td",{className:"px-3 py-2",children:e.permissionMode?(0,t.jsx)(E,{mode:e.permissionMode}):"—"}),(0,t.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground whitespace-nowrap",title:new Date(e.timestamp).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),children:(0,R.formatRelativeTime)(e.timestamp)})]}),a&&(0,t.jsx)(L,{item:e})]},`${e.timestamp}-${s}`)})})]})}),(0,t.jsx)(g.default,{currentPage:l,totalPages:W,onPageChange:e=>{i(e),h(null)}})]})]})}function B({enabled:e,onChange:r,disabled:s}){return(0,t.jsx)("button",{onClick:r,disabled:s,className:`relative inline-flex h-4 w-7 shrink-0 items-center rounded-full transition-colors disabled:opacity-40 ${e?"bg-emerald-500":"bg-muted-foreground/30"}`,"aria-label":e?"Disable policy":"Enable policy",children:(0,t.jsx)("span",{className:`inline-block h-3 w-3 rounded-full bg-white shadow transition-transform ${e?"translate-x-3.5":"translate-x-0.5"}`})})}function H({policy:e,onClose:s,onSave:n}){let a=e.params??{},o=e.currentParams??{},[l,i]=(0,r.useState)(()=>{let e={};for(let[t,r]of Object.entries(a)){let s=t in o?o[t]:r.default;e[t]=s}return e});(0,r.useEffect)(()=>{let e=e=>{"Escape"===e.key&&s()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[s]);let d=(e,t)=>{i(r=>({...r,[e]:t}))};return(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:e=>{e.target===e.currentTarget&&s()},children:(0,t.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,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-mono font-semibold text-foreground",children:e.name}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:e.description})]}),(0,t.jsx)("button",{onClick:s,className:"text-muted-foreground hover:text-foreground transition-colors",children:(0,t.jsx)(f.X,{className:"h-4 w-4"})})]}),(0,t.jsx)("div",{className:"overflow-y-auto flex-1 px-4 py-4 space-y-4",children:Object.entries(a).map(([e,r])=>(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-semibold text-foreground mb-1 font-mono",children:e}),(0,t.jsx)("p",{className:"text-[0.65rem] text-muted-foreground mb-1.5",children:r.description}),((e,r)=>{let s=l[e];if("boolean"===r.type)return(0,t.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,t.jsx)("input",{type:"checkbox",checked:!!s,onChange:t=>d(e,t.target.checked),className:"rounded border-border"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:r.description})]});if("number"===r.type)return(0,t.jsx)("input",{type:"number",value:"number"==typeof s?s:"",onChange:t=>d(e,Number(t.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[]"===r.type){let r=Array.isArray(s)?s.join("\n"):"";return(0,t.jsx)("textarea",{value:r,onChange:t=>d(e,t.target.value.split("\n").filter(e=>""!==e.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[]"===r.type){let r=Array.isArray(s)?s:[];return(0,t.jsxs)("div",{className:"space-y-1.5",children:[r.map((s,n)=>(0,t.jsxs)("div",{className:"flex gap-1.5 items-center",children:[(0,t.jsx)("input",{type:"text",value:s.regex,onChange:t=>{let s=[...r];s[n]={...s[n],regex:t.target.value},d(e,s)},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,t.jsx)("input",{type:"text",value:s.label,onChange:t=>{let s=[...r];s[n]={...s[n],label:t.target.value},d(e,s)},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,t.jsx)("button",{onClick:()=>d(e,r.filter((e,t)=>t!==n)),className:"text-muted-foreground/50 hover:text-destructive transition-colors",children:(0,t.jsx)(f.X,{className:"h-3.5 w-3.5"})})]},n)),(0,t.jsx)("button",{onClick:()=>d(e,[...r,{regex:"",label:""}]),className:"text-xs text-primary hover:underline",children:"+ Add pattern"})]})}return(0,t.jsx)("input",{type:"text",value:"string"==typeof s?s:"",onChange:t=>d(e,t.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"})})(e,r)]},e))}),(0,t.jsxs)("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-border",children:[(0,t.jsx)($.Button,{variant:"outline",size:"sm",onClick:s,className:"h-7 text-xs",children:"Cancel"}),(0,t.jsx)($.Button,{size:"sm",onClick:()=>n(l),className:"h-7 text-xs",children:"Save"})]})]})})}function X({message:e,onDismiss:r,onInstall:n,isPending:a}){return(0,s.createPortal)((0,t.jsxs)("div",{className:"fixed top-4 right-4 z-[9999] w-full max-w-sm",style:{animation:"slideInFromRight 0.25s ease-out"},children:[(0,t.jsx)("style",{children:`
|
|
2
2
|
@keyframes slideInFromRight {
|
|
3
3
|
from { transform: translateX(calc(100% + 1rem)); opacity: 0; }
|
|
4
4
|
to { transform: translateX(0); opacity: 1; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,53348,e=>{"use strict";var r=e.i(43476),t=e.i(71645),n=e.i(
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,53348,e=>{"use strict";var r=e.i(43476),t=e.i(71645),n=e.i(16827),i=e.i(9969);e.s(["default",0,function({error:e,reset:o}){return(0,t.useEffect)(()=>{(0,n.getTelemetryConfig)().then(r=>{(0,i.setClientTelemetryConfig)(r),(0,i.captureClientEvent)("client_error",{error_message:e.message,error_name:e.name,error_digest:e.digest,boundary:"global"})}).catch(()=>{})},[e]),(0,r.jsx)("html",{children:(0,r.jsx)("body",{children:(0,r.jsx)("main",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",background:"#031035",color:"#f8fafc",fontFamily:"system-ui, sans-serif"},children:(0,r.jsxs)("div",{style:{textAlign:"center",padding:"2rem",border:"1px solid rgba(239,68,68,0.4)",borderRadius:"0.5rem",maxWidth:"500px"},children:[(0,r.jsx)("h2",{style:{color:"#ef4444",marginBottom:"0.5rem",fontSize:"1.25rem"},children:"Something went wrong"}),(0,r.jsx)("p",{style:{color:"#94a3b8",marginBottom:"1.5rem"},children:e.message||"An unexpected error occurred."}),(0,r.jsx)("button",{onClick:o,style:{padding:"0.5rem 1.25rem",background:"#3b82f6",color:"white",border:"none",borderRadius:"0.375rem",cursor:"pointer",fontSize:"0.875rem"},children:"Try again"})]})})})})}])}]);
|
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
-
## 0.0.5
|
|
5
|
+
## 0.0.5 — 2026-04-17
|
|
6
6
|
|
|
7
7
|
### Fixes
|
|
8
8
|
- Strengthen Stop-event deny/instruct instructions with mandatory framing so agents execute required actions instead of asking for confirmation (#109)
|
|
9
9
|
- Include legacy commit statuses (CodeRabbit, etc.) in CI green check — previously only Check Runs API was queried (#109)
|
|
10
10
|
|
|
11
|
+
### Docs
|
|
12
|
+
- Remove beta version annotations from convention-based policies and allow(message) documentation (#110)
|
|
13
|
+
|
|
11
14
|
## 0.0.4 — 2026-04-16
|
|
12
15
|
|
|
13
16
|
### Features
|
|
@@ -202,7 +202,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
202
202
|
| Function | Effect |
|
|
203
203
|
|----------|--------|
|
|
204
204
|
| `allow()` | Permit the operation |
|
|
205
|
-
| `allow(message)` | Permit and send informational context to Claude
|
|
205
|
+
| `allow(message)` | Permit and send informational context to Claude |
|
|
206
206
|
| `deny(message)` | Block the operation; message shown to Claude |
|
|
207
207
|
| `instruct(message)` | Add context to Claude's prompt; does not block |
|
|
208
208
|
|
|
@@ -220,7 +220,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
220
220
|
|
|
221
221
|
Custom hooks support transitive local imports, async/await, and access to `process.env`. Errors are fail-open (logged to `~/.failproofai/hook.log`, built-in policies continue). See [docs/custom-hooks.mdx](docs/custom-hooks.mdx) for the full guide.
|
|
222
222
|
|
|
223
|
-
### Convention-based policies
|
|
223
|
+
### Convention-based policies
|
|
224
224
|
|
|
225
225
|
Drop `*policies.{js,mjs,ts}` files into `.failproofai/policies/` and they're automatically loaded — no `--custom` flag or config changes needed. Works like git hooks: drop a file, it just works.
|
|
226
226
|
|
|
@@ -1951,7 +1951,7 @@ var init_hook_activity_store = __esm(() => {
|
|
|
1951
1951
|
});
|
|
1952
1952
|
|
|
1953
1953
|
// package.json
|
|
1954
|
-
var version2 = "0.0.5
|
|
1954
|
+
var version2 = "0.0.5";
|
|
1955
1955
|
var init_package = () => {};
|
|
1956
1956
|
|
|
1957
1957
|
// src/posthog-key.ts
|
|
@@ -3243,7 +3243,7 @@ import { realpathSync as realpathSync2 } from "fs";
|
|
|
3243
3243
|
import { dirname as dirname5, resolve as resolve8 } from "path";
|
|
3244
3244
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
3245
3245
|
// package.json
|
|
3246
|
-
var version = "0.0.5
|
|
3246
|
+
var version = "0.0.5";
|
|
3247
3247
|
|
|
3248
3248
|
// bin/failproofai.mjs
|
|
3249
3249
|
if (!process.env.FAILPROOFAI_PACKAGE_ROOT) {
|
|
@@ -103,9 +103,9 @@ icon: sitemap
|
|
|
103
103
|
- رمز الخروج: `0`
|
|
104
104
|
- stdout فارغ
|
|
105
105
|
|
|
106
|
-
**السماح مع
|
|
106
|
+
**السماح مع رسالة:**
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
`allow(message)` يسمح لسياسة بإرسال سياق معلوماتي مرة أخرى إلى Claude حتى عند السماح بالعملية. يكتب معالج الخطاف JSON التالي إلى **stdout** (وليس ملف إعدادات — هذه هي استجابة المعالج إلى Claude Code، تماماً مثل استجابات deny و instruct أعلاه):
|
|
109
109
|
|
|
110
110
|
```json
|
|
111
111
|
// مكتوب إلى stdout بواسطة عملية معالج الخطاف
|
|
@@ -154,7 +154,7 @@ resolved: { allowPatterns: ["sudo systemctl status"] } ← ينتقل إلى ا
|
|
|
154
154
|
|
|
155
155
|
يتم تحميل الملف جديدًا في كل حدث hook - لا يوجد تخزين مؤقت. انظر [السياسات المخصصة](/ar/custom-policies) لتفاصيل الإنشاء.
|
|
156
156
|
|
|
157
|
-
### السياسات القائمة على الاتفاقية
|
|
157
|
+
### السياسات القائمة على الاتفاقية
|
|
158
158
|
|
|
159
159
|
بالإضافة إلى `customPoliciesPath` الصريح، يقوم failproofai تلقائيًا باكتشاف وتحميل ملفات السياسة من المجلدات `.failproofai/policies/`:
|
|
160
160
|
|
|
@@ -41,7 +41,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
41
41
|
|
|
42
42
|
## طريقتان لتحميل السياسات المخصصة
|
|
43
43
|
|
|
44
|
-
### الخيار 1: المبنية على الاتفاقية (موصى
|
|
44
|
+
### الخيار 1: المبنية على الاتفاقية (موصى به)
|
|
45
45
|
|
|
46
46
|
أسقط ملفات `*policies.{js,mjs,ts}` في `.failproofai/policies/` وسيتم تحميلها تلقائياً - لا تحتاج إلى أعلام أو تغييرات في الإعدادات. يعمل هذا مثل خطافات git: أسقط ملفاً، وهو يعمل فقط.
|
|
47
47
|
|
|
@@ -127,11 +127,8 @@ customPolicies.add({
|
|
|
127
127
|
يمكنك إلحاق إرشادات إضافية بأي رسالة `deny` أو `instruct` بإضافة حقل `hint` في `policyParams` - لا حاجة لتغيير الرمز. يعمل هذا أيضاً للسياسات المخصصة (`custom/`)، واتفاقية المشروع (`.failproofai-project/`)، واتفاقية المستخدم (`.failproofai-user/`). انظر [التكوين → hint](/ar/configuration#hint-cross-cutting) للتفاصيل.
|
|
128
128
|
</Tip>
|
|
129
129
|
|
|
130
|
-
### رسائل السماح المعلوماتية
|
|
130
|
+
### رسائل السماح المعلوماتية
|
|
131
131
|
|
|
132
|
-
<Note>
|
|
133
|
-
`allow(message)` هي ميزة بيتا متاحة منذ v0.0.2-beta.3. قد تتغير واجهة برمجية التطبيقات في الإصدارات المستقبلية. الإصدارات السابقة تدعم فقط `allow()` بدون وسائط.
|
|
134
|
-
</Note>
|
|
135
132
|
|
|
136
133
|
`allow(message)` يسمح بالعملية **و** يرسل رسالة معلومات مرة أخرى إلى Claude. يتم تسليم الرسالة كـ `additionalContext` في استجابة stdout لمعالج الخطاف - نفس الآلية المستخدمة من قبل `instruct`، لكن مختلفة من الناحية الدلالية: إنها تحديث حالة وليست تحذير.
|
|
137
134
|
|
|
@@ -102,9 +102,9 @@ The handler enforces a 1 MB stdin limit. Payloads exceeding this are discarded a
|
|
|
102
102
|
- Exit code: `0`
|
|
103
103
|
- Empty stdout
|
|
104
104
|
|
|
105
|
-
**Allow with message
|
|
105
|
+
**Allow with message:**
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
`allow(message)` lets a policy send informational context back to Claude even when the operation is permitted. The hook handler writes the following JSON to **stdout** (not a config file — this is the handler's response to Claude Code, just like deny and instruct responses above):
|
|
108
108
|
|
|
109
109
|
```json
|
|
110
110
|
// Written to stdout by the hook handler process
|
|
@@ -153,7 +153,7 @@ Path to a JavaScript file containing custom hook policies. This is set automatic
|
|
|
153
153
|
|
|
154
154
|
The file is loaded fresh on every hook event - there is no caching. See [Custom Policies](/custom-policies) for authoring details.
|
|
155
155
|
|
|
156
|
-
### Convention-based policies
|
|
156
|
+
### Convention-based policies
|
|
157
157
|
|
|
158
158
|
In addition to the explicit `customPoliciesPath`, failproofai automatically discovers and loads policy files from `.failproofai/policies/` directories:
|
|
159
159
|
|
|
@@ -39,7 +39,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
39
39
|
|
|
40
40
|
## Two ways to load custom policies
|
|
41
41
|
|
|
42
|
-
### Option 1: Convention-based (recommended
|
|
42
|
+
### Option 1: Convention-based (recommended)
|
|
43
43
|
|
|
44
44
|
Drop `*policies.{js,mjs,ts}` files into `.failproofai/policies/` and they're automatically loaded — no flags or config changes needed. This works like git hooks: drop a file, it just works.
|
|
45
45
|
|
|
@@ -125,11 +125,7 @@ customPolicies.add({
|
|
|
125
125
|
You can append extra guidance to any `deny` or `instruct` message by adding a `hint` field in `policyParams` — no code change needed. This works for custom (`custom/`), project convention (`.failproofai-project/`), and user convention (`.failproofai-user/`) policies too. See [Configuration → hint](/configuration#hint-cross-cutting) for details.
|
|
126
126
|
</Tip>
|
|
127
127
|
|
|
128
|
-
### Informational allow messages
|
|
129
|
-
|
|
130
|
-
<Note>
|
|
131
|
-
`allow(message)` is a beta feature available since v0.0.2-beta.3. The API may change in future releases. Earlier versions only support `allow()` without arguments.
|
|
132
|
-
</Note>
|
|
128
|
+
### Informational allow messages
|
|
133
129
|
|
|
134
130
|
`allow(message)` permits the operation **and** sends an informational message back to Claude. The message is delivered as `additionalContext` in the hook handler's stdout response — the same mechanism used by `instruct`, but semantically different: it's a status update, not a warning.
|
|
135
131
|
|
|
@@ -102,9 +102,9 @@ Der Handler setzt ein Limit von 1 MB für stdin. Payloads, die dieses Limit übe
|
|
|
102
102
|
- Exit-Code: `0`
|
|
103
103
|
- Leerer stdout
|
|
104
104
|
|
|
105
|
-
**Allow mit Nachricht
|
|
105
|
+
**Allow mit Nachricht:**
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
`allow(message)` ermöglicht einer Policy, informativen Kontext an Claude zurückzusenden, auch wenn die Operation erlaubt wird. Der Hook-Handler schreibt folgendes JSON nach **stdout** (keine Konfigurationsdatei – dies ist die Antwort des Handlers an Claude Code, genau wie deny- und instruct-Antworten oben):
|
|
108
108
|
|
|
109
109
|
```json
|
|
110
110
|
// Written to stdout by the hook handler process
|
|
@@ -153,7 +153,7 @@ Pfad zu einer JavaScript-Datei mit benutzerdefinierten Hook-Richtlinien. Dieser
|
|
|
153
153
|
|
|
154
154
|
Die Datei wird bei jedem Hook-Ereignis neu geladen – es gibt kein Caching. Informationen zur Erstellung finden Sie unter [Benutzerdefinierte Richtlinien](/de/custom-policies).
|
|
155
155
|
|
|
156
|
-
### Konventionsbasierte Richtlinien
|
|
156
|
+
### Konventionsbasierte Richtlinien
|
|
157
157
|
|
|
158
158
|
Zusätzlich zum expliziten `customPoliciesPath` erkennt und lädt failproofai automatisch Richtliniendateien aus `.failproofai/policies/`-Verzeichnissen:
|
|
159
159
|
|
|
@@ -39,7 +39,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
39
39
|
|
|
40
40
|
## Zwei Wege zum Laden benutzerdefinierter Richtlinien
|
|
41
41
|
|
|
42
|
-
### Option 1: Konventionsbasiert (empfohlen
|
|
42
|
+
### Option 1: Konventionsbasiert (empfohlen)
|
|
43
43
|
|
|
44
44
|
Legen Sie `*policies.{js,mjs,ts}`-Dateien in `.failproofai/policies/` ab – sie werden automatisch geladen, ohne Flags oder Konfigurationsänderungen. Das funktioniert wie Git-Hooks: Datei ablegen, fertig.
|
|
45
45
|
|
|
@@ -125,11 +125,8 @@ customPolicies.add({
|
|
|
125
125
|
Sie können jeder `deny`- oder `instruct`-Nachricht zusätzliche Hinweise hinzufügen, indem Sie ein `hint`-Feld in `policyParams` setzen – ohne Codeänderung. Das funktioniert auch für benutzerdefinierte (`custom/`), Projekt-Konventions- (`.failproofai-project/`) und Benutzer-Konventionsrichtlinien (`.failproofai-user/`). Siehe [Konfiguration → hint](/de/configuration#hint-cross-cutting) für Details.
|
|
126
126
|
</Tip>
|
|
127
127
|
|
|
128
|
-
### Informative allow-Nachrichten
|
|
128
|
+
### Informative allow-Nachrichten
|
|
129
129
|
|
|
130
|
-
<Note>
|
|
131
|
-
`allow(message)` ist eine Beta-Funktion, verfügbar seit v0.0.2-beta.3. Die API kann sich in zukünftigen Releases ändern. Ältere Versionen unterstützen nur `allow()` ohne Argumente.
|
|
132
|
-
</Note>
|
|
133
130
|
|
|
134
131
|
`allow(message)` lässt die Operation zu **und** sendet eine informative Nachricht an Claude zurück. Die Nachricht wird als `additionalContext` in der stdout-Antwort des Hook-Handlers zugestellt – derselbe Mechanismus wie bei `instruct`, jedoch semantisch anders: Es handelt sich um eine Statusmeldung, nicht um eine Warnung.
|
|
135
132
|
|
|
@@ -102,9 +102,9 @@ El manejador aplica un límite de 1 MB en stdin. Los payloads que superen este l
|
|
|
102
102
|
- Código de salida: `0`
|
|
103
103
|
- stdout vacío
|
|
104
104
|
|
|
105
|
-
**Permitir con mensaje
|
|
105
|
+
**Permitir con mensaje:**
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
`allow(message)` permite que una política envíe contexto informativo a Claude incluso cuando la operación está permitida. El manejador de hooks escribe el siguiente JSON en **stdout** (no en un archivo de configuración — esta es la respuesta del manejador a Claude Code, igual que las respuestas de deny e instruct anteriores):
|
|
108
108
|
|
|
109
109
|
```json
|
|
110
110
|
// Written to stdout by the hook handler process
|
|
@@ -153,7 +153,7 @@ Ruta a un archivo JavaScript que contiene políticas de hook personalizadas. Est
|
|
|
153
153
|
|
|
154
154
|
El archivo se carga desde cero en cada evento de hook; no hay caché. Consulta [Políticas personalizadas](/es/custom-policies) para ver los detalles de creación.
|
|
155
155
|
|
|
156
|
-
### Políticas basadas en convención
|
|
156
|
+
### Políticas basadas en convención
|
|
157
157
|
|
|
158
158
|
Además del `customPoliciesPath` explícito, failproofai descubre y carga automáticamente archivos de políticas desde directorios `.failproofai/policies/`:
|
|
159
159
|
|
|
@@ -39,7 +39,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
39
39
|
|
|
40
40
|
## Dos formas de cargar políticas personalizadas
|
|
41
41
|
|
|
42
|
-
### Opción 1: Basada en convención (recomendada
|
|
42
|
+
### Opción 1: Basada en convención (recomendada)
|
|
43
43
|
|
|
44
44
|
Coloca archivos `*policies.{js,mjs,ts}` en `.failproofai/policies/` y se cargarán automáticamente, sin necesidad de flags ni cambios de configuración. Funciona como los git hooks: coloca el archivo y listo.
|
|
45
45
|
|
|
@@ -125,11 +125,8 @@ customPolicies.add({
|
|
|
125
125
|
Puedes añadir orientación adicional a cualquier mensaje `deny` o `instruct` incluyendo un campo `hint` en `policyParams`, sin necesidad de cambiar el código. Esto funciona también para políticas personalizadas (`custom/`), de convención de proyecto (`.failproofai-project/`) y de convención de usuario (`.failproofai-user/`). Consulta [Configuración → hint](/es/configuration#hint-cross-cutting) para más detalles.
|
|
126
126
|
</Tip>
|
|
127
127
|
|
|
128
|
-
### Mensajes informativos en allow
|
|
128
|
+
### Mensajes informativos en allow
|
|
129
129
|
|
|
130
|
-
<Note>
|
|
131
|
-
`allow(message)` es una funcionalidad en beta disponible desde v0.0.2-beta.3. La API podría cambiar en versiones futuras. Las versiones anteriores solo admiten `allow()` sin argumentos.
|
|
132
|
-
</Note>
|
|
133
130
|
|
|
134
131
|
`allow(message)` permite la operación **y** envía un mensaje informativo a Claude. El mensaje se entrega como `additionalContext` en la respuesta stdout del manejador de hooks — el mismo mecanismo que usa `instruct`, pero con una semántica diferente: es una actualización de estado, no una advertencia.
|
|
135
132
|
|
|
@@ -102,9 +102,9 @@ Le gestionnaire impose une limite de 1 Mo sur stdin. Les payloads dépassant cet
|
|
|
102
102
|
- Code de sortie : `0`
|
|
103
103
|
- stdout vide
|
|
104
104
|
|
|
105
|
-
**Autorisation avec message
|
|
105
|
+
**Autorisation avec message :**
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
`allow(message)` permet à une politique d'envoyer un contexte informatif à Claude même lorsque l'opération est autorisée. Le gestionnaire de hooks écrit le JSON suivant sur **stdout** (pas dans un fichier de configuration — il s'agit de la réponse du gestionnaire à Claude Code, tout comme les réponses de refus et d'instruction ci-dessus) :
|
|
108
108
|
|
|
109
109
|
```json
|
|
110
110
|
// Written to stdout by the hook handler process
|
|
@@ -153,7 +153,7 @@ Chemin vers un fichier JavaScript contenant des politiques de hook personnalisé
|
|
|
153
153
|
|
|
154
154
|
Le fichier est chargé à chaque événement de hook — il n'y a pas de mise en cache. Consultez [Politiques personnalisées](/fr/custom-policies) pour les détails de création.
|
|
155
155
|
|
|
156
|
-
### Politiques basées sur les conventions
|
|
156
|
+
### Politiques basées sur les conventions
|
|
157
157
|
|
|
158
158
|
En plus du `customPoliciesPath` explicite, failproofai découvre et charge automatiquement les fichiers de politiques depuis les répertoires `.failproofai/policies/` :
|
|
159
159
|
|
|
@@ -39,7 +39,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
39
39
|
|
|
40
40
|
## Deux façons de charger des politiques personnalisées
|
|
41
41
|
|
|
42
|
-
### Option 1 : Par convention (
|
|
42
|
+
### Option 1 : Par convention (recommandé)
|
|
43
43
|
|
|
44
44
|
Déposez des fichiers `*policies.{js,mjs,ts}` dans `.failproofai/policies/` et ils sont chargés automatiquement — aucun indicateur ni changement de configuration requis. Cela fonctionne comme les git hooks : déposez un fichier, il est pris en compte immédiatement.
|
|
45
45
|
|
|
@@ -125,11 +125,8 @@ customPolicies.add({
|
|
|
125
125
|
Vous pouvez ajouter des instructions supplémentaires à n'importe quel message `deny` ou `instruct` en ajoutant un champ `hint` dans `policyParams` — sans modifier le code. Cela fonctionne également pour les politiques personnalisées (`custom/`), par convention projet (`.failproofai-project/`) et par convention utilisateur (`.failproofai-user/`). Voir [Configuration → hint](/fr/configuration#hint-cross-cutting) pour les détails.
|
|
126
126
|
</Tip>
|
|
127
127
|
|
|
128
|
-
### Messages allow informationnels
|
|
128
|
+
### Messages allow informationnels
|
|
129
129
|
|
|
130
|
-
<Note>
|
|
131
|
-
`allow(message)` est une fonctionnalité bêta disponible depuis la v0.0.2-beta.3. L'API peut changer dans les versions futures. Les versions antérieures ne prennent en charge que `allow()` sans arguments.
|
|
132
|
-
</Note>
|
|
133
130
|
|
|
134
131
|
`allow(message)` autorise l'opération **et** envoie un message informationnel à Claude. Le message est délivré en tant que `additionalContext` dans la réponse stdout du gestionnaire de hook — le même mécanisme qu'`instruct`, mais sémantiquement différent : c'est une mise à jour de statut, pas un avertissement.
|
|
135
132
|
|
|
@@ -103,9 +103,9 @@ Claude Code לאחר מכן מפעיל את `failproofai --hook PreToolUse` כת
|
|
|
103
103
|
- קוד יציאה: `0`
|
|
104
104
|
- stdout ריק
|
|
105
105
|
|
|
106
|
-
**Allow עם
|
|
106
|
+
**Allow עם הודעה:**
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
`allow(message)` מאפשר למדיניות לשלוח הקשר מידע חזור ל-Claude גם כאשר הפעולה מורשית. מטפל ה-hook כותב את ה-JSON הבא ל-**stdout** (לא קובץ הגדרות — זו תגובת המטפל ל-Claude Code, בדיוק כמו תגובות deny ו-instruct לעיל):
|
|
109
109
|
|
|
110
110
|
```json
|
|
111
111
|
// כתוב ל-stdout על ידי תהליך מטפל ה-hook
|
|
@@ -153,7 +153,7 @@ resolved: { allowPatterns: ["sudo systemctl status"] } ← נופל דרך לג
|
|
|
153
153
|
|
|
154
154
|
הקובץ נטען מחדש בכל אירוע hook - אין קשמן. ראה [Custom Policies](/he/custom-policies) לפרטי יצירה.
|
|
155
155
|
|
|
156
|
-
### מדיניויות המבוססות על קונוונציה
|
|
156
|
+
### מדיניויות המבוססות על קונוונציה
|
|
157
157
|
|
|
158
158
|
בנוסף ל-`customPoliciesPath` המפורש, failproofai גילוי ותקבל מחדש קובצי מדיניויות מספריות `.failproofai/policies/`:
|
|
159
159
|
|
|
@@ -39,7 +39,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
39
39
|
|
|
40
40
|
## שתי דרכים לטעון מדיניויות מותאמות
|
|
41
41
|
|
|
42
|
-
### אפשרות 1: מבוססת קונבנציה (
|
|
42
|
+
### אפשרות 1: מבוססת קונבנציה (מומלצת)
|
|
43
43
|
|
|
44
44
|
שים קבצים `*policies.{js,mjs,ts}` בתיקייה `.failproofai/policies/` והם יוטענו באופן אוטומטי — ללא דגלים או שינויי קונפיגורציה. זה עובד כמו git hooks: שים קובץ, זה פשוט עובד.
|
|
45
45
|
|
|
@@ -125,11 +125,8 @@ customPolicies.add({
|
|
|
125
125
|
אתה יכול להצמיד הנחיות נוספות לכל הודעת `deny` או `instruct` על ידי הוספת שדה `hint` ב-`policyParams` — ללא צורך בשינוי קוד. זה עובד גם על מדיניויות custom (`custom/`), קונבנציה של פרויקט (`.failproofai-project/`), וקונבנציה של משתמש (`.failproofai-user/`). ראה [Configuration → hint](/he/configuration#hint-cross-cutting) לפרטים.
|
|
126
126
|
</Tip>
|
|
127
127
|
|
|
128
|
-
### הודעות allow מידע
|
|
128
|
+
### הודעות allow מידע
|
|
129
129
|
|
|
130
|
-
<Note>
|
|
131
|
-
`allow(message)` היא תכונת beta זמינה מ-v0.0.2-beta.3. ה-API עשוי להשתנות בגרסאות עתידיות. גרסאות קודמות תומכות רק ב-`allow()` ללא טיעונים.
|
|
132
|
-
</Note>
|
|
133
130
|
|
|
134
131
|
`allow(message)` מתיר את הפעולה **ו**שולח הודעה מידע בחזרה ל-Claude. ההודעה מועברת כ-`additionalContext` בתגובת stdout של hook handler — אותה מנגנון שבו משתמשים `instruct`, אך שונה מבחינה סמנטית: זה עדכון סטטוס, לא אזהרה.
|
|
135
132
|
|
|
@@ -104,9 +104,9 @@ Claude Code फिर प्रत्येक टूल कॉल से पह
|
|
|
104
104
|
- Exit कोड: `0`
|
|
105
105
|
- खाली stdout
|
|
106
106
|
|
|
107
|
-
**संदेश के साथ अनुमति
|
|
107
|
+
**संदेश के साथ अनुमति दें:**
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
`allow(message)` एक पॉलिसी को Claude को सूचनात्मक संदर्भ भेजने देता है भले ही ऑपरेशन की अनुमति हो। हुक हैंडलर निम्नलिखित JSON को **stdout** में लिखता है (कॉन्फ़िग फ़ाइल में नहीं — यह Claude Code को हैंडलर की प्रतिक्रिया है, अस्वीकार करें और निर्देशित करें प्रतिक्रिया की तरह):
|
|
110
110
|
|
|
111
111
|
```json
|
|
112
112
|
// हुक हैंडलर प्रक्रिया द्वारा stdout में लिखा गया
|
|
@@ -153,7 +153,7 @@ resolved: { allowPatterns: ["sudo systemctl status"] } ← falls through to glo
|
|
|
153
153
|
|
|
154
154
|
फ़ाइल प्रत्येक हुक इवेंट पर ताजी लोड की जाती है - कोई कैशिंग नहीं है। लेखन विवरण के लिए [Custom Policies](/hi/custom-policies) देखें।
|
|
155
155
|
|
|
156
|
-
### कन्वेंशन-आधारित नीतियां
|
|
156
|
+
### कन्वेंशन-आधारित नीतियां
|
|
157
157
|
|
|
158
158
|
स्पष्ट `customPoliciesPath` के अतिरिक्त, failproofai `.failproofai/policies/` निर्देशिकाओं से नीति फ़ाइलों को स्वचालित रूप से खोज निकालता है:
|
|
159
159
|
|
|
@@ -39,7 +39,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
39
39
|
|
|
40
40
|
## कस्टम पॉलिसीज़ लोड करने के दो तरीके
|
|
41
41
|
|
|
42
|
-
### विकल्प 1: कन्वेंशन-आधारित (
|
|
42
|
+
### विकल्प 1: कन्वेंशन-आधारित (अनुशंसित)
|
|
43
43
|
|
|
44
44
|
`.failproofai/policies/` में `*policies.{js,mjs,ts}` फ़ाइलें ड्रॉप करें और वे स्वचालित रूप से लोड हो जाती हैं — कोई फ़्लैग या कॉन्फ़िग परिवर्तन की आवश्यकता नहीं है। यह git hooks की तरह काम करता है: एक फ़ाइल ड्रॉप करें, यह बस काम करता है।
|
|
45
45
|
|
|
@@ -125,11 +125,8 @@ customPolicies.add({
|
|
|
125
125
|
`policyParams` में `hint` फ़ील्ड जोड़कर किसी भी `deny` या `instruct` संदेश के लिए अतिरिक्त निर्देश जोड़ सकते हैं — कोई कोड परिवर्तन की आवश्यकता नहीं है। यह कस्टम (`custom/`), प्रोजेक्ट कन्वेंशन (`.failproofai-project/`), और यूजर कन्वेंशन (`.failproofai-user/`) पॉलिसीज़ के लिए भी काम करता है। विवरण के लिए [कॉन्फ़िगरेशन → hint](/hi/configuration#hint-cross-cutting) देखें।
|
|
126
126
|
</Tip>
|
|
127
127
|
|
|
128
|
-
### सूचनात्मक allow संदेश
|
|
128
|
+
### सूचनात्मक allow संदेश
|
|
129
129
|
|
|
130
|
-
<Note>
|
|
131
|
-
`allow(message)` एक बीटा फीचर है जो v0.0.2-beta.3 के बाद से उपलब्ध है। API भविष्य की रिलीज़ में बदल सकता है। पहली संस्करणें केवल बिना तर्क के `allow()` का समर्थन करती हैं।
|
|
132
|
-
</Note>
|
|
133
130
|
|
|
134
131
|
`allow(message)` ऑपरेशन को अनुमति देता है **और** Claude को एक सूचनात्मक संदेश भेजता है। संदेश हुक हैंडलर के stdout प्रतिक्रिया में `additionalContext` के रूप में डिलीवर किया जाता है — `instruct` द्वारा उपयोग किया जाने वाला समान तंत्र, लेकिन शब्दार्थ रूप से अलग: यह एक सतर्कता नहीं, एक स्थिति अपडेट है।
|
|
135
132
|
|
|
@@ -210,7 +210,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
210
210
|
| الدالة | التأثير |
|
|
211
211
|
|----------|--------|
|
|
212
212
|
| `allow()` | السماح بالعملية |
|
|
213
|
-
| `allow(message)` | السماح وإرسال السياق المعلوماتي إلى Claude
|
|
213
|
+
| `allow(message)` | السماح وإرسال السياق المعلوماتي إلى Claude |
|
|
214
214
|
| `deny(message)` | حظر العملية؛ الرسالة معروضة ل Claude |
|
|
215
215
|
| `instruct(message)` | إضافة سياق إلى موجه Claude؛ لا تحظر |
|
|
216
216
|
|
|
@@ -228,7 +228,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
228
228
|
|
|
229
229
|
تدعم الخطافات المخصصة الاستيراد المحلي العابر، والانتظار غير المتزامن، والوصول إلى `process.env`. الأخطاء مفتوحة للفشل (تسجيل في `~/.failproofai/hook.log`، استمرار السياسات المدمجة). انظر [docs/custom-hooks.mdx](docs/custom-hooks.mdx) للحصول على الدليل الكامل.
|
|
230
230
|
|
|
231
|
-
### السياسات المستندة إلى الاتفاقية
|
|
231
|
+
### السياسات المستندة إلى الاتفاقية
|
|
232
232
|
|
|
233
233
|
ضع ملفات `*policies.{js,mjs,ts}` في `.failproofai/policies/` وسيتم تحميلها تلقائياً - لا حاجة لعلم `--custom` أو تغييرات التكوين. يعمل مثل git hooks: ضع الملف، وسيعمل.
|
|
234
234
|
|
|
@@ -208,7 +208,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
208
208
|
| Funktion | Wirkung |
|
|
209
209
|
|----------|---------|
|
|
210
210
|
| `allow()` | Erlaubt die Operation |
|
|
211
|
-
| `allow(message)` | Erlaubt und sendet informativen Kontext an Claude
|
|
211
|
+
| `allow(message)` | Erlaubt und sendet informativen Kontext an Claude |
|
|
212
212
|
| `deny(message)` | Blockiert die Operation; Nachricht wird Claude angezeigt |
|
|
213
213
|
| `instruct(message)` | Fügt Claude's Prompt Kontext hinzu; blockiert nicht |
|
|
214
214
|
|
|
@@ -226,7 +226,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
226
226
|
|
|
227
227
|
Benutzerdefinierte Hooks unterstützen transitive lokale Importe, async/await und Zugriff auf `process.env`. Fehler sind fail-open (werden in `~/.failproofai/hook.log` protokolliert, integrierte Richtlinien laufen weiter). Eine vollständige Anleitung finden Sie unter [docs/custom-hooks.mdx](docs/custom-hooks.mdx).
|
|
228
228
|
|
|
229
|
-
### Konventionsbasierte Richtlinien
|
|
229
|
+
### Konventionsbasierte Richtlinien
|
|
230
230
|
|
|
231
231
|
Legen Sie `*policies.{js,mjs,ts}`-Dateien in `.failproofai/policies/` ab – sie werden automatisch geladen, ohne `--custom`-Flag oder Konfigurationsänderungen. Funktioniert wie Git-Hooks: Datei ablegen, fertig.
|
|
232
232
|
|