failproofai 1.0.7-beta.1 → 1.0.7
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 +4 -4
- 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 +4 -4
- 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 +6 -6
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
- 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 +4 -4
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +15 -15
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +15 -15
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +14 -14
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/api/audit/invite/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/audit/run/route.js +7 -8
- 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 +5 -7
- package/.next/standalone/.next/server/app/audit/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/audit/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +15 -15
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +14 -14
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +15 -15
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/page.js +6 -6
- 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 +11 -13
- 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 +7 -8
- 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 +7 -7
- 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 +6 -7
- 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 -41
- package/.next/standalone/.next/server/app/settings/page.js +9 -12
- 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]__1j-zsg5._.js → [externals]__1_bftcl._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{[externals]__19_pzeq._.js → [externals]__1msfs-h._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0o07qi9._.js +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__1bf34x4._.js → [root-of-the-server]__1_r2rbg._.js} +7 -5
- package/.next/standalone/.next/server/chunks/_09dz7xv._.js +21 -21
- package/.next/standalone/.next/server/chunks/_0tovk6q._.js +1 -1
- package/.next/standalone/.next/server/chunks/_0trp3yc._.js +1 -1
- package/.next/standalone/.next/server/chunks/{_1q5i8mb._.js → _1c3k-8x._.js} +2 -2
- package/.next/standalone/.next/server/chunks/_1ek68ln._.js +16 -16
- package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_09z9-p7._.js +1 -1
- package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4v._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_hooks_0iu54mz._.js +3 -0
- package/.next/standalone/.next/server/chunks/src_hooks_custom-hooks-loader_ts_0lnb3n3._.js +2 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0-_ki57._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__013jr2b._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01wy8d-._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02npjtd._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0yxwl6j._.js → [root-of-the-server]__0bd3mje._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0cg-bgc._.js +5 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0cpu_mj._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1mf3zp6._.js → [root-of-the-server]__0cxe_2_._.js} +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0da85px._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ftmoxc._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0p-5p8u._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0u3w0ll._.js +22 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__17d_ffl._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__19d9tgz._.js +5 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1ctpynv._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1jiwfsj._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1p2otjt._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1phc187._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_06imw3p._.js +5 -0
- package/.next/standalone/.next/server/chunks/ssr/_08x1r5t._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_1w_5l7t._.js → _0h_douw._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_214wgrp._.js → _1-i_gzc._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0bn2oo8._.js → _166t73i._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_1q46vxx._.js → _1_qswah._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_1gb0ifp._.js → _1es2j7i._.js} +5 -5
- package/.next/standalone/.next/server/chunks/ssr/_1u8-lu2._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_1zopuov._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_next-internal_server_app_policies_page_actions_1sp2-yo.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/app_audit__components_audit-dashboard_tsx_0p9ud47._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_1kp6l3x._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_19dqvpc._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/app_settings_settings-client_tsx_20lq-mq._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_next_dist_18_d8l1._.js → node_modules_next_dist_0drixxt._.js} +4 -4
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_1cv9_c4._.js +10 -0
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_builtin-policies_ts_09j2ndl._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_fp-home_ts_0je3xkv._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_pack-cli_ts_0t7me65._.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +23 -56
- package/.next/standalone/.next/static/chunks/094xgi4owxaqf.js +1 -0
- package/.next/standalone/.next/static/chunks/0__8a7m868fvf.js +1 -0
- package/.next/standalone/.next/static/chunks/{12tvm75t5ffui.js → 0o6qlkgubtoex.js} +1 -1
- package/.next/standalone/.next/static/chunks/13i7-9is-vhys.js +1 -0
- package/.next/standalone/.next/static/chunks/1rz20_pz828f3.js +6 -0
- package/.next/standalone/.next/static/chunks/2k9f4tyv04809.css +1 -0
- package/.next/standalone/.next/static/chunks/{0vmd180qfntfb.js → 2klitrtzpaoe0.js} +1 -1
- package/.next/standalone/.next/static/chunks/{258668t68du6b.js → 2mdh397ghgnvv.js} +1 -1
- package/.next/standalone/.next/static/chunks/2rshywgeqsyzk.css +2 -0
- package/.next/standalone/.next/static/chunks/3pzx4chkhko9k.js +1 -0
- package/.next/standalone/.next/static/chunks/{0qrbdkv9qmvli.js → 3rh5o7e16irrm.js} +1 -1
- package/.next/standalone/.next/static/chunks/{29fql3nbnfc9q.js → 43ufqrz8qo3h-.js} +1 -1
- package/.next/standalone/SECURITY.md +53 -0
- package/.next/standalone/app/actions/pack-actions.ts +0 -12
- package/.next/standalone/app/policies/hooks-client.tsx +0 -9
- package/.next/standalone/app/settings/page.tsx +1 -20
- package/.next/standalone/app/settings/settings-client.tsx +1 -27
- package/.next/standalone/app/settings/settings.css +0 -79
- package/.next/standalone/package.json +9 -9
- package/.next/standalone/sdk/python/skill/SKILL.md +60 -14
- package/.next/standalone/sdk/python/skill/agents/openai.yaml +2 -1
- package/.next/standalone/sdk/python/skill/references/evaluator.md +255 -0
- package/.next/standalone/sdk/python/skill/references/events.md +17 -8
- package/.next/standalone/sdk/python/skill/references/frameworks.md +3 -0
- package/.next/standalone/sdk/python/skill/references/install.md +3 -0
- package/.next/standalone/sdk/python/skill/references/integration.md +6 -2
- package/.next/standalone/sdk/python/skill/references/typescript.md +568 -0
- package/.next/standalone/sdk/typescript/CHANGELOG.md +133 -0
- package/.next/standalone/sdk/typescript/LICENSE +42 -0
- package/.next/standalone/sdk/typescript/README.md +552 -0
- package/.next/standalone/sdk/typescript/eslint.config.mjs +59 -0
- package/.next/standalone/sdk/typescript/examples/research-agent.ts +197 -0
- package/.next/standalone/sdk/typescript/integration/ai.test.ts +920 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/ai-4/agent.ts +337 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/ai-4/package-lock.json +261 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/ai-4/package.json +16 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/ai-4/surfaces.ts +605 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/ai-4/tsconfig.json +12 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/ai-4/tsconfig.surfaces.json +4 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/ai-5/agent.ts +342 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/ai-5/package-lock.json +156 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/ai-5/package.json +16 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/ai-5/surfaces.ts +628 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/ai-5/tsconfig.json +12 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/ai-5/tsconfig.surfaces.json +4 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/ai-6/agent.ts +346 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/ai-6/package-lock.json +156 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/ai-6/package.json +13 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/ai-6/surfaces.ts +651 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/ai-6/tsconfig.json +12 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/ai-6/tsconfig.surfaces.json +4 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/ai-7/agent.ts +350 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/ai-7/package-lock.json +153 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/ai-7/package.json +13 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/ai-7/surfaces.ts +651 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/ai-7/tsconfig.json +12 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/ai-7/tsconfig.surfaces.json +4 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/langchain-0.3/agent.ts +623 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/langchain-0.3/package-lock.json +344 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/langchain-0.3/package.json +19 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/langchain-0.3/tsconfig.json +12 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/langchain-1/agent-v1.ts +99 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/langchain-1/agent.ts +623 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/langchain-1/package-lock.json +336 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/langchain-1/package.json +15 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/langchain-1/tsconfig.json +12 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/langchain-dup-core/agent.ts +96 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/langchain-dup-core/package-lock.json +441 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/langchain-dup-core/package.json +19 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/langchain-dup-core/tsconfig.json +12 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/langchain-dup-core/vendor/lc-weather-provider/index.cjs +53 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/langchain-dup-core/vendor/lc-weather-provider/index.mjs +55 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/langchain-dup-core/vendor/lc-weather-provider/package.json +18 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/llamaindex-0.11/agent.ts +659 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/llamaindex-0.11/package-lock.json +635 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/llamaindex-0.11/package.json +15 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/llamaindex-0.11/tsconfig.json +12 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/llamaindex-0.12/agent.ts +659 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/llamaindex-0.12/package-lock.json +553 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/llamaindex-0.12/package.json +15 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/llamaindex-0.12/tsconfig.json +12 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/mastra-0/agent.ts +877 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/mastra-0/mcp-server.mjs +66 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/mastra-0/package-lock.json +6797 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/mastra-0/package.json +24 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/mastra-0/tsconfig.json +12 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/mastra-1/agent.ts +872 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/mastra-1/mcp-server.mjs +66 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/mastra-1/package-lock.json +2540 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/mastra-1/package.json +15 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/mastra-1/tsconfig.json +12 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/nextjs/app/actions.ts +18 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/nextjs/app/api/ai/route.ts +42 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/nextjs/app/api/edge/route.ts +29 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/nextjs/app/api/langgraph/route.ts +21 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/nextjs/app/api/llamaindex/route.ts +11 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/nextjs/app/api/mastra/route.ts +19 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/nextjs/app/api/status/route.ts +7 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/nextjs/app/layout.tsx +9 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/nextjs/app/page.tsx +15 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/nextjs/instrumentation.ts +15 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/nextjs/lib/ai.ts +61 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/nextjs/lib/langgraph.ts +68 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/nextjs/lib/llamaindex.ts +98 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/nextjs/lib/mastra.ts +90 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/nextjs/next.config.ts +52 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/nextjs/package-lock.json +4343 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/nextjs/package.json +28 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/runtimes/agent.ts +51 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/runtimes/deno-npm.ts +76 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/runtimes/package-lock.json +484 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/runtimes/package.json +15 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/types/agent.ts +79 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/types/package-lock.json +740 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/types/package.json +11 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/vanilla/agent.ts +197 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/vanilla/package-lock.json +70 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/vanilla/package.json +12 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/vanilla/tsconfig.json +12 -0
- package/.next/standalone/sdk/typescript/integration/global-setup.ts +29 -0
- package/.next/standalone/sdk/typescript/integration/harness.ts +451 -0
- package/.next/standalone/sdk/typescript/integration/langchain.test.ts +682 -0
- package/.next/standalone/sdk/typescript/integration/llamaindex.test.ts +709 -0
- package/.next/standalone/sdk/typescript/integration/mastra-coverage.test.ts +386 -0
- package/.next/standalone/sdk/typescript/integration/mastra.test.ts +311 -0
- package/.next/standalone/sdk/typescript/integration/nextjs.test.ts +341 -0
- package/.next/standalone/sdk/typescript/integration/runtime-parity.ts +180 -0
- package/.next/standalone/sdk/typescript/integration/runtimes.bun.test.ts +15 -0
- package/.next/standalone/sdk/typescript/integration/runtimes.core.test.ts +113 -0
- package/.next/standalone/sdk/typescript/integration/runtimes.deno.test.ts +19 -0
- package/.next/standalone/sdk/typescript/integration/types.test.ts +141 -0
- package/.next/standalone/sdk/typescript/integration/vanilla.test.ts +255 -0
- package/.next/standalone/sdk/typescript/package-lock.json +2640 -0
- package/.next/standalone/sdk/typescript/package.json +401 -0
- package/.next/standalone/sdk/typescript/scripts/finalize-build.mjs +123 -0
- package/.next/standalone/sdk/typescript/scripts/release.mjs +177 -0
- package/.next/standalone/sdk/typescript/src/clock.ts +58 -0
- package/.next/standalone/sdk/typescript/src/context.ts +214 -0
- package/.next/standalone/sdk/typescript/src/edge/adapter.ts +18 -0
- package/.next/standalone/sdk/typescript/src/edge/ai.ts +116 -0
- package/.next/standalone/sdk/typescript/src/edge/index.ts +238 -0
- package/.next/standalone/sdk/typescript/src/edge/langchain.ts +18 -0
- package/.next/standalone/sdk/typescript/src/edge/llamaindex.ts +12 -0
- package/.next/standalone/sdk/typescript/src/edge/mastra.ts +17 -0
- package/.next/standalone/sdk/typescript/src/edge/notice.ts +33 -0
- package/.next/standalone/sdk/typescript/src/environment.ts +75 -0
- package/.next/standalone/sdk/typescript/src/evaluator/authoring.ts +480 -0
- package/.next/standalone/sdk/typescript/src/evaluator/cli.ts +96 -0
- package/.next/standalone/sdk/typescript/src/evaluator/client.ts +421 -0
- package/.next/standalone/sdk/typescript/src/evaluator/expression.ts +1292 -0
- package/.next/standalone/sdk/typescript/src/evaluator/index.ts +144 -0
- package/.next/standalone/sdk/typescript/src/evaluator/protocol.ts +747 -0
- package/.next/standalone/sdk/typescript/src/evaluator/runtime.ts +930 -0
- package/.next/standalone/sdk/typescript/src/evaluator/sandbox-worker.ts +171 -0
- package/.next/standalone/sdk/typescript/src/evaluator/source-limits.ts +27 -0
- package/.next/standalone/sdk/typescript/src/evaluator/source.ts +509 -0
- package/.next/standalone/sdk/typescript/src/events.ts +879 -0
- package/.next/standalone/sdk/typescript/src/exit.ts +117 -0
- package/.next/standalone/sdk/typescript/src/index.ts +186 -0
- package/.next/standalone/sdk/typescript/src/integrations/ai.ts +1566 -0
- package/.next/standalone/sdk/typescript/src/integrations/compat.ts +322 -0
- package/.next/standalone/sdk/typescript/src/integrations/core.ts +1321 -0
- package/.next/standalone/sdk/typescript/src/integrations/index.ts +355 -0
- package/.next/standalone/sdk/typescript/src/integrations/langchain.ts +2340 -0
- package/.next/standalone/sdk/typescript/src/integrations/llamaindex.ts +2111 -0
- package/.next/standalone/sdk/typescript/src/integrations/mastra.ts +1802 -0
- package/.next/standalone/sdk/typescript/src/logger.ts +98 -0
- package/.next/standalone/sdk/typescript/src/next.ts +115 -0
- package/.next/standalone/sdk/typescript/src/node-require.ts +446 -0
- package/.next/standalone/sdk/typescript/src/redact.ts +305 -0
- package/.next/standalone/sdk/typescript/src/resolver.ts +120 -0
- package/.next/standalone/sdk/typescript/src/runtime.ts +29 -0
- package/.next/standalone/sdk/typescript/src/schema.ts +410 -0
- package/.next/standalone/sdk/typescript/src/scopes.ts +701 -0
- package/.next/standalone/sdk/typescript/src/shared.ts +33 -0
- package/.next/standalone/sdk/typescript/src/version.ts +5 -0
- package/.next/standalone/sdk/typescript/src/writer.ts +934 -0
- package/.next/standalone/sdk/typescript/test/adapters.test.ts +397 -0
- package/.next/standalone/sdk/typescript/test/ai.test.ts +1076 -0
- package/.next/standalone/sdk/typescript/test/copies.test.ts +204 -0
- package/.next/standalone/sdk/typescript/test/edge.test.ts +183 -0
- package/.next/standalone/sdk/typescript/test/evaluator-client.test.ts +234 -0
- package/.next/standalone/sdk/typescript/test/evaluator-protocol.test.ts +225 -0
- package/.next/standalone/sdk/typescript/test/events.test.ts +193 -0
- package/.next/standalone/sdk/typescript/test/expression.test.ts +181 -0
- package/.next/standalone/sdk/typescript/test/global-setup.ts +26 -0
- package/.next/standalone/sdk/typescript/test/helpers.ts +130 -0
- package/.next/standalone/sdk/typescript/test/integrations.test.ts +369 -0
- package/.next/standalone/sdk/typescript/test/langchain-copies.test.ts +204 -0
- package/.next/standalone/sdk/typescript/test/langchain.test.ts +999 -0
- package/.next/standalone/sdk/typescript/test/llamaindex.test.ts +1760 -0
- package/.next/standalone/sdk/typescript/test/mastra-coverage.test.ts +501 -0
- package/.next/standalone/sdk/typescript/test/mastra-lifecycle.test.ts +479 -0
- package/.next/standalone/sdk/typescript/test/mastra.test.ts +285 -0
- package/.next/standalone/sdk/typescript/test/next.test.ts +109 -0
- package/.next/standalone/sdk/typescript/test/packaging.test.ts +312 -0
- package/.next/standalone/sdk/typescript/test/redaction.test.ts +171 -0
- package/.next/standalone/sdk/typescript/test/runtimes.test.ts +101 -0
- package/.next/standalone/sdk/typescript/test/sandbox.test.ts +189 -0
- package/.next/standalone/sdk/typescript/test/scopes.test.ts +271 -0
- package/.next/standalone/sdk/typescript/test/setup.ts +19 -0
- package/.next/standalone/sdk/typescript/test/skill-snippets.test.ts +73 -0
- package/.next/standalone/sdk/typescript/test/spool-contract.test.ts +124 -0
- package/.next/standalone/sdk/typescript/test/tracker-bounds.test.ts +191 -0
- package/.next/standalone/sdk/typescript/test/wire-format.test.ts +214 -0
- package/.next/standalone/sdk/typescript/test/writer.test.ts +407 -0
- package/.next/standalone/sdk/typescript/tsconfig.build.json +15 -0
- package/.next/standalone/sdk/typescript/tsconfig.cjs.json +19 -0
- package/.next/standalone/sdk/typescript/tsconfig.json +28 -0
- package/.next/standalone/sdk/typescript/vitest.config.ts +33 -0
- package/.next/standalone/sdk/typescript/vitest.integration.config.ts +23 -0
- package/.next/standalone/server.js +1 -1
- package/bin/failproofai.mjs +2 -115
- package/dist/cli.mjs +6538 -13686
- package/dist/index.js +1 -19
- package/dist/worker.mjs +2085 -8012
- package/package.json +9 -9
- package/pi-extension/index.ts +0 -11
- package/scripts/build-policy-pack.mjs +2 -39
- package/src/hooks/builtin-policies.ts +3 -21
- package/src/hooks/cloud-enrollment-cli.ts +1 -1
- package/src/hooks/cloud-managed-policies.ts +0 -22
- package/src/hooks/custom-hooks-loader.ts +7 -45
- package/src/hooks/custom-hooks-registry.ts +1 -45
- package/src/hooks/first-run-gate.ts +0 -5
- package/src/hooks/fp-home.ts +0 -23
- package/src/hooks/handler.ts +6 -265
- package/src/hooks/hook-activity-store.ts +1 -105
- package/src/hooks/hook-telemetry.ts +0 -41
- package/src/hooks/loader-utils.ts +0 -6
- package/src/hooks/pack-cli.ts +17 -278
- package/src/hooks/pack-manifest.ts +7 -479
- package/src/hooks/pack-store.ts +10 -156
- package/src/hooks/policy-catalog.ts +0 -65
- package/src/hooks/policy-evaluator.ts +796 -940
- package/src/hooks/policy-registry.ts +0 -25
- package/src/hooks/policy-types.ts +0 -126
- package/src/hooks/worker-server.ts +26 -119
- package/src/index.ts +0 -6
- package/.next/standalone/.next/server/chunks/src_hooks_01frwmb._.js +0 -5
- package/.next/standalone/.next/server/chunks/src_hooks_18qtd42._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01bmjsj._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__04usis8._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__056wjo4._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__059yza8._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0eip4_k._.js +0 -22
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0n0xg95._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0qcb0mg._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0qxnccm._.js +0 -5
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0rwtwpm._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0s_yomn._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0soxz2z._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0yrsbd_._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__11mayhe._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__13d-wb6._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1dinjii._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1pprgri._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1q4p5b8._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1qiz0e4._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_042cgl1._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0bqoto4._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0uyu3jf._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_1feuvhb._.js +0 -5
- package/.next/standalone/.next/server/chunks/ssr/app_actions_get-scheduled-audit_ts_0ei9sni._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/app_settings_02tf1h4._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_0w6mzq5._.js +0 -151
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_095a_79._.js +0 -5
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_15t8kqj._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_18k8rl0._.js +0 -12
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_1fm2w5z._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_1j0zy3v._.js +0 -3
- package/.next/standalone/.next/static/chunks/0cd-_8-c-m1ea.js +0 -6
- package/.next/standalone/.next/static/chunks/0uldbut9y2-e8.js +0 -1
- package/.next/standalone/.next/static/chunks/1u5zsejmgrir_.js +0 -1
- package/.next/standalone/.next/static/chunks/285spx855h_3r.css +0 -2
- package/.next/standalone/.next/static/chunks/2qv4hshejedtx.css +0 -1
- package/.next/standalone/.next/static/chunks/2vkvu9-opa_1z.js +0 -1
- package/.next/standalone/.next/static/chunks/37lhv7wa3ywt6.js +0 -1
- package/.next/standalone/app/actions/get-jev-config.ts +0 -409
- package/.next/standalone/app/actions/update-jev-config.ts +0 -420
- package/.next/standalone/app/components/jev-notices.tsx +0 -96
- package/.next/standalone/app/settings/jev-panel.tsx +0 -469
- package/src/hooks/effective-reviewers.ts +0 -79
- package/src/hooks/jev-activity.ts +0 -385
- package/src/hooks/jev-cli.ts +0 -1193
- package/src/hooks/policy-authority.ts +0 -333
- package/src/hooks/policy-reviewability.ts +0 -229
- package/src/hooks/semantic/combine.ts +0 -541
- package/src/hooks/semantic/compile.ts +0 -176
- package/src/hooks/semantic/decide.ts +0 -392
- package/src/hooks/semantic/envelope.ts +0 -1296
- package/src/hooks/semantic/evaluator.ts +0 -547
- package/src/hooks/semantic/facts.ts +0 -292
- package/src/hooks/semantic/intent.ts +0 -1190
- package/src/hooks/semantic/jev-client.ts +0 -643
- package/src/hooks/semantic/jev-config.ts +0 -594
- package/src/hooks/semantic/jev-review.ts +0 -374
- package/src/hooks/semantic/jev-stats.ts +0 -289
- package/src/hooks/semantic/jev-throttle.ts +0 -421
- package/src/hooks/semantic/pack-policies.ts +0 -251
- package/src/hooks/semantic/policies.ts +0 -596
- package/src/hooks/semantic/precondition-names.ts +0 -60
- package/src/hooks/semantic/preconditions.ts +0 -58
- package/src/hooks/semantic/redact.ts +0 -2910
- package/src/hooks/semantic/types.ts +0 -145
- package/src/hooks/semver-precedence.ts +0 -128
- /package/.next/standalone/.next/static/{T8YAYM9h_64fKv705vug7 → PgeWCHmyVbjRznv2VO7KF}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{T8YAYM9h_64fKv705vug7 → PgeWCHmyVbjRznv2VO7KF}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{T8YAYM9h_64fKv705vug7 → PgeWCHmyVbjRznv2VO7KF}/_ssgManifest.js +0 -0
|
@@ -1,469 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* The Jev panel on /settings — the dashboard's half of `failproofai jev setup`.
|
|
5
|
-
*
|
|
6
|
-
* ## What it is for
|
|
7
|
-
*
|
|
8
|
-
* Jev is the optional second evaluation tier. It is on when, and only when, a
|
|
9
|
-
* valid `~/.failproofai/jev.json` exists; without it the hook path is byte for
|
|
10
|
-
* byte what it was before. So this panel has two jobs, in this order:
|
|
11
|
-
*
|
|
12
|
-
* 1. say whether it is on, where it sends requests, in which mode, how much
|
|
13
|
-
* of the enabled policy set it is allowed to clear, and — once it has run
|
|
14
|
-
* — how often it fell back to the regex engine. A panel that only took
|
|
15
|
-
* input would leave "is this thing working" unanswerable from the
|
|
16
|
-
* dashboard.
|
|
17
|
-
* 2. take the endpoint and the token.
|
|
18
|
-
*
|
|
19
|
-
* It is a full-width cell in the same hairline console as the scheduled-audit
|
|
20
|
-
* panel, using the same tokens, the same `.btn-press` action and the same
|
|
21
|
-
* `toast()` on success. No new colour and no new control that did not already
|
|
22
|
-
* exist on this page, except a `<select>` — five providers do not fit a switch.
|
|
23
|
-
*
|
|
24
|
-
* ## The token is write-only
|
|
25
|
-
*
|
|
26
|
-
* The field is always blank on load, whatever is stored. `JevSettingsView`
|
|
27
|
-
* carries a presence flag and at most the last four characters, so the panel
|
|
28
|
-
* can say "configured, ending 3f2a" and nothing more; the value itself never
|
|
29
|
-
* leaves the machine's filesystem. Leaving the field empty on save KEEPS the
|
|
30
|
-
* key where it is — the stored one, or the environment's for a config that takes
|
|
31
|
-
* it from there — which the server decides, not this component.
|
|
32
|
-
*
|
|
33
|
-
* The stored MODEL is shown the same way when it does not look like a model id,
|
|
34
|
-
* for the same reason: it is the one routing field someone can paste a key into.
|
|
35
|
-
* The panel gets a `JevModelView`, never the string, so there is nothing here to
|
|
36
|
-
* leak even by accident. It is display-only — the form does not offer the field,
|
|
37
|
-
* and a save leaves whatever is stored alone.
|
|
38
|
-
*
|
|
39
|
-
* Client-side validation here is a convenience only. Every rule — the URL
|
|
40
|
-
* scheme, plain http being refused outside shadow mode, cloudflare's account id
|
|
41
|
-
* — is enforced server-side by the same `validateJevConfig` the loader runs.
|
|
42
|
-
*/
|
|
43
|
-
|
|
44
|
-
import { useCallback, useEffect, useRef, useState, type ReactNode } from "react";
|
|
45
|
-
import {
|
|
46
|
-
getJevSettingsAction,
|
|
47
|
-
type JevModelView,
|
|
48
|
-
type JevSettingsView,
|
|
49
|
-
} from "@/app/actions/get-jev-config";
|
|
50
|
-
import {
|
|
51
|
-
removeJevConfigAction,
|
|
52
|
-
saveJevConfigAction,
|
|
53
|
-
} from "@/app/actions/update-jev-config";
|
|
54
|
-
import { toast } from "@/app/components/toast";
|
|
55
|
-
|
|
56
|
-
const PROVIDERS = [
|
|
57
|
-
{ value: "typesafe", label: "typesafe" },
|
|
58
|
-
{ value: "openrouter", label: "openrouter" },
|
|
59
|
-
{ value: "vercel", label: "vercel ai gateway" },
|
|
60
|
-
{ value: "cloudflare", label: "cloudflare workers ai" },
|
|
61
|
-
{ value: "custom", label: "custom endpoint" },
|
|
62
|
-
] as const;
|
|
63
|
-
|
|
64
|
-
const MODES = [
|
|
65
|
-
{ value: "enforce", label: "enforce — jev's verdict counts" },
|
|
66
|
-
{ value: "shadow", label: "shadow — log only, regex decides" },
|
|
67
|
-
] as const;
|
|
68
|
-
|
|
69
|
-
/** "24h" / "7d" / "30m", for the stats window. */
|
|
70
|
-
function fmtWindow(ms: number): string {
|
|
71
|
-
const h = ms / 3_600_000;
|
|
72
|
-
if (Number.isInteger(h) && h >= 1) return h % 24 === 0 ? `${h / 24}d` : `${h}h`;
|
|
73
|
-
return `${Math.max(1, Math.round(ms / 60_000))}m`;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/** A rate as a whole percent. 0.0417 → "4%". */
|
|
77
|
-
function fmtRate(rate: number): string {
|
|
78
|
-
return `${Math.round(rate * 100)}%`;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* The model row. `withheld` is the case worth having a row for at all: the file
|
|
83
|
-
* holds something in that slot that does not look like a model id, which is
|
|
84
|
-
* what a key pasted one field off looks like, so it is described and not
|
|
85
|
-
* printed — and the server never sent it here to print. The loader's own reason
|
|
86
|
-
* and its fix are already on the page above, in `view.problem`.
|
|
87
|
-
*/
|
|
88
|
-
function fmtModel(model: JevModelView): string {
|
|
89
|
-
switch (model.kind) {
|
|
90
|
-
case "id":
|
|
91
|
-
return model.id;
|
|
92
|
-
case "withheld":
|
|
93
|
-
return "set to something that is not a model id — not shown here, in case it is a key";
|
|
94
|
-
default:
|
|
95
|
-
return "the provider's default";
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
interface FormState {
|
|
100
|
-
provider: string;
|
|
101
|
-
baseUrl: string;
|
|
102
|
-
accountId: string;
|
|
103
|
-
mode: string;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
function formFrom(view: JevSettingsView): FormState {
|
|
107
|
-
return {
|
|
108
|
-
provider: view.provider ?? "typesafe",
|
|
109
|
-
baseUrl: view.baseUrl,
|
|
110
|
-
accountId: view.accountId,
|
|
111
|
-
mode: view.mode,
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/** One labelled control, laid out like the interval row above it. */
|
|
116
|
-
function Field({
|
|
117
|
-
id,
|
|
118
|
-
label,
|
|
119
|
-
hint,
|
|
120
|
-
children,
|
|
121
|
-
}: {
|
|
122
|
-
id: string;
|
|
123
|
-
label: string;
|
|
124
|
-
hint?: string;
|
|
125
|
-
children: ReactNode;
|
|
126
|
-
}) {
|
|
127
|
-
return (
|
|
128
|
-
<div className="set-field">
|
|
129
|
-
<label className="set-field-label" htmlFor={id}>
|
|
130
|
-
{label}
|
|
131
|
-
</label>
|
|
132
|
-
{children}
|
|
133
|
-
{hint ? <span className="set-hint">{hint}</span> : null}
|
|
134
|
-
</div>
|
|
135
|
-
);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
export default function JevPanel({ initial }: { initial: JevSettingsView | null }) {
|
|
139
|
-
const [view, setView] = useState<JevSettingsView | null>(initial);
|
|
140
|
-
const [form, setForm] = useState<FormState>(
|
|
141
|
-
initial ? formFrom(initial) : { provider: "typesafe", baseUrl: "", accountId: "", mode: "enforce" },
|
|
142
|
-
);
|
|
143
|
-
const [token, setToken] = useState("");
|
|
144
|
-
const [busy, setBusy] = useState(false);
|
|
145
|
-
const [problem, setProblem] = useState<string | null>(null);
|
|
146
|
-
/**
|
|
147
|
-
* The server's `needsToken`: the one refusal whose remedy is this field, so it
|
|
148
|
-
* is marked rather than leaving the person to match the message to a control.
|
|
149
|
-
* The refusals that no token can settle deliberately do not set it.
|
|
150
|
-
*/
|
|
151
|
-
const [needsToken, setNeedsToken] = useState(false);
|
|
152
|
-
const mounted = useRef(true);
|
|
153
|
-
/**
|
|
154
|
-
* Whether the user has touched the form since the last read. A focus refresh
|
|
155
|
-
* must not overwrite a half-typed endpoint with what is still on disk — the
|
|
156
|
-
* page re-reads on every `visibilitychange`, which includes the tab hide that
|
|
157
|
-
* happens when somebody alt-tabs to their password manager mid-edit.
|
|
158
|
-
*/
|
|
159
|
-
const dirty = useRef(false);
|
|
160
|
-
|
|
161
|
-
const reload = useCallback(async () => {
|
|
162
|
-
try {
|
|
163
|
-
const next = await getJevSettingsAction();
|
|
164
|
-
if (!mounted.current) return;
|
|
165
|
-
setView(next);
|
|
166
|
-
if (!dirty.current) setForm(formFrom(next));
|
|
167
|
-
} catch {
|
|
168
|
-
// Leave what is on screen: it describes real machine state, and blanking
|
|
169
|
-
// it would report something less true than what is already there.
|
|
170
|
-
}
|
|
171
|
-
}, []);
|
|
172
|
-
|
|
173
|
-
useEffect(() => {
|
|
174
|
-
mounted.current = true;
|
|
175
|
-
void reload();
|
|
176
|
-
return () => {
|
|
177
|
-
mounted.current = false;
|
|
178
|
-
};
|
|
179
|
-
}, [reload]);
|
|
180
|
-
|
|
181
|
-
useEffect(() => {
|
|
182
|
-
// Same reason as the scheduled-audit panel: `failproofai jev setup` in a
|
|
183
|
-
// terminal changes the same file, and a page left open would otherwise keep
|
|
184
|
-
// showing the old state until it was reloaded by hand.
|
|
185
|
-
const onFocus = () => void reload();
|
|
186
|
-
window.addEventListener("focus", onFocus);
|
|
187
|
-
document.addEventListener("visibilitychange", onFocus);
|
|
188
|
-
return () => {
|
|
189
|
-
window.removeEventListener("focus", onFocus);
|
|
190
|
-
document.removeEventListener("visibilitychange", onFocus);
|
|
191
|
-
};
|
|
192
|
-
}, [reload]);
|
|
193
|
-
|
|
194
|
-
const set = useCallback(<K extends keyof FormState>(key: K, value: FormState[K]) => {
|
|
195
|
-
dirty.current = true;
|
|
196
|
-
setForm((f) => ({ ...f, [key]: value }));
|
|
197
|
-
}, []);
|
|
198
|
-
|
|
199
|
-
const onSave = useCallback(async () => {
|
|
200
|
-
setBusy(true);
|
|
201
|
-
setProblem(null);
|
|
202
|
-
try {
|
|
203
|
-
// The form does not offer a model, so it says nothing about one: the
|
|
204
|
-
// server keeps a stored model when the provider is unchanged, and drops it
|
|
205
|
-
// for the new provider's default when it is not — the same rule `jev setup`
|
|
206
|
-
// applies. `JevConfigInput` has no model field for this to get wrong.
|
|
207
|
-
const res = await saveJevConfigAction({
|
|
208
|
-
provider: form.provider,
|
|
209
|
-
baseUrl: form.baseUrl,
|
|
210
|
-
accountId: form.accountId,
|
|
211
|
-
mode: form.mode,
|
|
212
|
-
token,
|
|
213
|
-
});
|
|
214
|
-
if (!res.ok) {
|
|
215
|
-
setProblem(res.problem);
|
|
216
|
-
setNeedsToken(res.needsToken === true);
|
|
217
|
-
return;
|
|
218
|
-
}
|
|
219
|
-
dirty.current = false;
|
|
220
|
-
setNeedsToken(false);
|
|
221
|
-
setToken("");
|
|
222
|
-
setView(res.view);
|
|
223
|
-
setForm(formFrom(res.view));
|
|
224
|
-
toast(res.view.on ? "jev is on." : "saved.");
|
|
225
|
-
} catch {
|
|
226
|
-
setProblem("could not save that.");
|
|
227
|
-
} finally {
|
|
228
|
-
setBusy(false);
|
|
229
|
-
}
|
|
230
|
-
}, [form, token]);
|
|
231
|
-
|
|
232
|
-
const onRemove = useCallback(async () => {
|
|
233
|
-
setBusy(true);
|
|
234
|
-
setProblem(null);
|
|
235
|
-
setNeedsToken(false);
|
|
236
|
-
try {
|
|
237
|
-
const res = await removeJevConfigAction();
|
|
238
|
-
if (!res.ok) {
|
|
239
|
-
setProblem(res.problem);
|
|
240
|
-
return;
|
|
241
|
-
}
|
|
242
|
-
dirty.current = false;
|
|
243
|
-
setToken("");
|
|
244
|
-
setView(res.view);
|
|
245
|
-
setForm(formFrom(res.view));
|
|
246
|
-
toast("jev is off. hooks run the regex policies.");
|
|
247
|
-
} catch {
|
|
248
|
-
setProblem("could not turn that off.");
|
|
249
|
-
} finally {
|
|
250
|
-
setBusy(false);
|
|
251
|
-
}
|
|
252
|
-
}, []);
|
|
253
|
-
|
|
254
|
-
const configured = view !== null && view.status !== "absent";
|
|
255
|
-
const stored = view?.token;
|
|
256
|
-
const tokenHint = needsToken
|
|
257
|
-
? "needed for this save — type the token for this endpoint"
|
|
258
|
-
: stored
|
|
259
|
-
? stored.source === "env"
|
|
260
|
-
? "configured, read from the environment — leave blank to keep it"
|
|
261
|
-
: stored.hint
|
|
262
|
-
? `configured, ending ${stored.hint} — leave blank to keep it`
|
|
263
|
-
: "configured — leave blank to keep it"
|
|
264
|
-
: // The file names the environment as the key's source and the variable is
|
|
265
|
-
// unset in this process. Leaving the field blank keeps that arrangement,
|
|
266
|
-
// which is not the same thing as "there is no key" — the endpoint and the
|
|
267
|
-
// mode are editable from here without one.
|
|
268
|
-
view?.status === "key-missing"
|
|
269
|
-
? "read from the environment, which is not set in this shell — leave blank to keep it that way"
|
|
270
|
-
: "sent as a bearer token; stored owner-only at 0600";
|
|
271
|
-
|
|
272
|
-
return (
|
|
273
|
-
<div className="set-cell set-jev">
|
|
274
|
-
<h2 className="set-cell-title">jev · semantic evaluation</h2>
|
|
275
|
-
|
|
276
|
-
<div className="set-row set-row-main">
|
|
277
|
-
<div className="set-row-copy">
|
|
278
|
-
<span className={view?.on ? "set-strong" : "set-dim"}>
|
|
279
|
-
{view === null
|
|
280
|
-
? "reading…"
|
|
281
|
-
: view.on
|
|
282
|
-
? `on. every judged command is also asked of ${view.provider}.`
|
|
283
|
-
: "off. hooks run the regex policies exactly as before."}
|
|
284
|
-
</span>
|
|
285
|
-
<span className="set-dim">
|
|
286
|
-
{view?.on
|
|
287
|
-
? view.mode === "shadow"
|
|
288
|
-
? "shadow: jev's answers are logged, the regex result is what gets enforced."
|
|
289
|
-
: "enforce: jev's answers can clear a reviewable deny."
|
|
290
|
-
: "a second opinion on the commands the regex policies flag. needs your own endpoint and token."}
|
|
291
|
-
</span>
|
|
292
|
-
</div>
|
|
293
|
-
</div>
|
|
294
|
-
|
|
295
|
-
{view && configured && (
|
|
296
|
-
<dl className="set-how-list">
|
|
297
|
-
{view.endpoint && (
|
|
298
|
-
<div className="set-how-row">
|
|
299
|
-
<dt className="set-how-label">endpoint</dt>
|
|
300
|
-
<dd className="set-how-body">{view.endpoint}</dd>
|
|
301
|
-
</div>
|
|
302
|
-
)}
|
|
303
|
-
<div className="set-how-row">
|
|
304
|
-
<dt className="set-how-label">model</dt>
|
|
305
|
-
<dd className="set-how-body">{fmtModel(view.model)}</dd>
|
|
306
|
-
</div>
|
|
307
|
-
<div className="set-how-row">
|
|
308
|
-
<dt className="set-how-label">token</dt>
|
|
309
|
-
<dd className="set-how-body">
|
|
310
|
-
{stored
|
|
311
|
-
? stored.source === "env"
|
|
312
|
-
? "from FAILPROOFAI_JEV_API_KEY"
|
|
313
|
-
: stored.hint
|
|
314
|
-
? `configured, ending ${stored.hint}`
|
|
315
|
-
: "configured"
|
|
316
|
-
: "none stored"}
|
|
317
|
-
</dd>
|
|
318
|
-
</div>
|
|
319
|
-
{view.permissions && (
|
|
320
|
-
<div className="set-how-row">
|
|
321
|
-
<dt className="set-how-label">file</dt>
|
|
322
|
-
<dd className="set-how-body">
|
|
323
|
-
{`${view.path} · ${view.permissions}`}
|
|
324
|
-
</dd>
|
|
325
|
-
</div>
|
|
326
|
-
)}
|
|
327
|
-
{view.reviewable && (
|
|
328
|
-
<div className="set-how-row">
|
|
329
|
-
<dt className="set-how-label">reviewable</dt>
|
|
330
|
-
{/* The count, in the server's words — the same sentence
|
|
331
|
-
`failproofai jev status` prints, because the two surfaces must
|
|
332
|
-
not disagree about what Jev is allowed to clear. */}
|
|
333
|
-
<dd className="set-how-body">{view.reviewable.summary}</dd>
|
|
334
|
-
</div>
|
|
335
|
-
)}
|
|
336
|
-
{view.stats && view.stats.total > 0 && (
|
|
337
|
-
<div className="set-how-row">
|
|
338
|
-
<dt className="set-how-label">fallbacks</dt>
|
|
339
|
-
{/* One string, not an interpolated fragment: a sentence split
|
|
340
|
-
across text nodes is a sentence a screen reader and a test both
|
|
341
|
-
have to reassemble. */}
|
|
342
|
-
<dd className="set-how-body">
|
|
343
|
-
{`${fmtRate(view.stats.fallbackRate)} of ${view.stats.total} calls in the last ${fmtWindow(view.stats.windowMs)} fell back to the regex engine.`}
|
|
344
|
-
</dd>
|
|
345
|
-
</div>
|
|
346
|
-
)}
|
|
347
|
-
</dl>
|
|
348
|
-
)}
|
|
349
|
-
|
|
350
|
-
{view?.problem && (
|
|
351
|
-
<p className="set-warn">
|
|
352
|
-
{view.problem}
|
|
353
|
-
{view.fix ? ` — ${view.fix}` : ""}
|
|
354
|
-
</p>
|
|
355
|
-
)}
|
|
356
|
-
|
|
357
|
-
{/* Jev is on, answering, and cannot clear a single verdict. Nothing else
|
|
358
|
-
on this page shows it: a policy set with no authority marks behaves
|
|
359
|
-
exactly like a healthy one until you notice that nothing is ever
|
|
360
|
-
cleared. The server sends the cause and the remedy together. */}
|
|
361
|
-
{view?.reviewable?.problem && <p className="set-warn">{view.reviewable.problem}</p>}
|
|
362
|
-
|
|
363
|
-
<div className="set-rule" />
|
|
364
|
-
|
|
365
|
-
<div className="set-jev-fields">
|
|
366
|
-
<Field id="jev-provider" label="provider">
|
|
367
|
-
<select
|
|
368
|
-
id="jev-provider"
|
|
369
|
-
className="set-select"
|
|
370
|
-
value={form.provider}
|
|
371
|
-
disabled={busy}
|
|
372
|
-
onChange={(e) => set("provider", e.target.value)}
|
|
373
|
-
>
|
|
374
|
-
{PROVIDERS.map((p) => (
|
|
375
|
-
<option key={p.value} value={p.value}>
|
|
376
|
-
{p.label}
|
|
377
|
-
</option>
|
|
378
|
-
))}
|
|
379
|
-
</select>
|
|
380
|
-
</Field>
|
|
381
|
-
|
|
382
|
-
<Field
|
|
383
|
-
id="jev-url"
|
|
384
|
-
label="endpoint url"
|
|
385
|
-
hint={
|
|
386
|
-
form.provider === "custom"
|
|
387
|
-
? "required — https, or http to localhost in shadow mode"
|
|
388
|
-
: "leave blank for the provider's own api"
|
|
389
|
-
}
|
|
390
|
-
>
|
|
391
|
-
<input
|
|
392
|
-
id="jev-url"
|
|
393
|
-
type="text"
|
|
394
|
-
className="set-text"
|
|
395
|
-
inputMode="url"
|
|
396
|
-
autoComplete="off"
|
|
397
|
-
spellCheck={false}
|
|
398
|
-
placeholder={form.provider === "custom" ? "https://…" : "the provider's own api"}
|
|
399
|
-
value={form.baseUrl}
|
|
400
|
-
disabled={busy}
|
|
401
|
-
onChange={(e) => set("baseUrl", e.target.value)}
|
|
402
|
-
/>
|
|
403
|
-
</Field>
|
|
404
|
-
|
|
405
|
-
{form.provider === "cloudflare" && (
|
|
406
|
-
<Field id="jev-account" label="account id" hint="32 lowercase hex characters">
|
|
407
|
-
<input
|
|
408
|
-
id="jev-account"
|
|
409
|
-
type="text"
|
|
410
|
-
className="set-text"
|
|
411
|
-
autoComplete="off"
|
|
412
|
-
spellCheck={false}
|
|
413
|
-
value={form.accountId}
|
|
414
|
-
disabled={busy}
|
|
415
|
-
onChange={(e) => set("accountId", e.target.value)}
|
|
416
|
-
/>
|
|
417
|
-
</Field>
|
|
418
|
-
)}
|
|
419
|
-
|
|
420
|
-
<Field id="jev-token" label="token" hint={tokenHint}>
|
|
421
|
-
<input
|
|
422
|
-
id="jev-token"
|
|
423
|
-
type="password"
|
|
424
|
-
className="set-text"
|
|
425
|
-
autoComplete="off"
|
|
426
|
-
spellCheck={false}
|
|
427
|
-
placeholder={stored ? "•••• kept" : ""}
|
|
428
|
-
value={token}
|
|
429
|
-
disabled={busy}
|
|
430
|
-
aria-invalid={needsToken || undefined}
|
|
431
|
-
onChange={(e) => {
|
|
432
|
-
dirty.current = true;
|
|
433
|
-
setToken(e.target.value);
|
|
434
|
-
}}
|
|
435
|
-
/>
|
|
436
|
-
</Field>
|
|
437
|
-
|
|
438
|
-
<Field id="jev-mode" label="mode">
|
|
439
|
-
<select
|
|
440
|
-
id="jev-mode"
|
|
441
|
-
className="set-select"
|
|
442
|
-
value={form.mode}
|
|
443
|
-
disabled={busy}
|
|
444
|
-
onChange={(e) => set("mode", e.target.value)}
|
|
445
|
-
>
|
|
446
|
-
{MODES.map((m) => (
|
|
447
|
-
<option key={m.value} value={m.value}>
|
|
448
|
-
{m.label}
|
|
449
|
-
</option>
|
|
450
|
-
))}
|
|
451
|
-
</select>
|
|
452
|
-
</Field>
|
|
453
|
-
</div>
|
|
454
|
-
|
|
455
|
-
{problem && <p className="set-warn">{problem}</p>}
|
|
456
|
-
|
|
457
|
-
<div className="set-actions set-jev-actions">
|
|
458
|
-
<button type="button" className="btn btn-press" disabled={busy} onClick={() => void onSave()}>
|
|
459
|
-
{busy ? "[ saving… ]" : configured ? "[ save changes ]" : "[ turn jev on ]"}
|
|
460
|
-
</button>
|
|
461
|
-
{configured && (
|
|
462
|
-
<button type="button" className="set-link" disabled={busy} onClick={() => void onRemove()}>
|
|
463
|
-
turn jev off
|
|
464
|
-
</button>
|
|
465
|
-
)}
|
|
466
|
-
</div>
|
|
467
|
-
</div>
|
|
468
|
-
);
|
|
469
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The semantic checks a `reviewedBy` may name ON THIS MACHINE.
|
|
3
|
-
*
|
|
4
|
-
* ## Why this is not simply `SEMANTIC_REVIEWER_NAMES`
|
|
5
|
-
*
|
|
6
|
-
* A pack that declares its own `semantic` entries replaces the compiled-in
|
|
7
|
-
* `SEMANTIC_POLICIES` wholesale (`semantic/pack-policies.ts`). So on that
|
|
8
|
-
* machine the sixteen builtin names are checks that will never be asked, and the
|
|
9
|
-
* pack's own names are the only ones that will — while
|
|
10
|
-
* `resolvePolicyAuthority`, judging against the builtin set, would read the
|
|
11
|
-
* pack's `reviewedBy: ["its-own-check"]` as naming a check "this build does not
|
|
12
|
-
* have" and downgrade the policy to `hard` with nothing but a warning in the
|
|
13
|
-
* hook log. That is a rewritten policy set arriving with its reviewability
|
|
14
|
-
* quietly removed: the deny half of the two-tier evaluator working exactly as
|
|
15
|
-
* documented while the clearing half cannot fire once — the failure
|
|
16
|
-
* `policy-reviewability.ts` was written to make audible, reintroduced one layer
|
|
17
|
-
* down.
|
|
18
|
-
*
|
|
19
|
-
* The names come from the MANIFEST, which is already where `authority` and
|
|
20
|
-
* `reviewedBy` themselves are read from, so this adds no new trust and imports
|
|
21
|
-
* no semantic module.
|
|
22
|
-
*
|
|
23
|
-
* ## Why it is a module of its own, and cached the way it is
|
|
24
|
-
*
|
|
25
|
-
* `registerPolicy` asks this for every policy that declares an authority — forty
|
|
26
|
-
* times per hook event — and the honest answer costs a digest verification per
|
|
27
|
-
* installed pack. So it is cached, and the cache is dropped by `clearPolicies()`:
|
|
28
|
-
* one read per registration pass, and the answer's lifetime is exactly the
|
|
29
|
-
* registry's. That is the right coupling rather than a convenient one — this set
|
|
30
|
-
* describes the policies sitting in the registry, and the handler rebuilds both
|
|
31
|
-
* together, so they cannot come to describe different machines.
|
|
32
|
-
*
|
|
33
|
-
* It lives beside `policy-registry.ts` rather than inside `pack-manifest.ts`
|
|
34
|
-
* because the registry may not depend on the whole manifest reader: several
|
|
35
|
-
* tests isolate themselves from the running machine's real packs by mocking
|
|
36
|
-
* `pack-manifest` down to `readInstalledPacks` and `hasInstalledPacks`, and a
|
|
37
|
-
* registration path reaching for a third export of that module breaks them all
|
|
38
|
-
* — loudly here, but it is the shape of a change that would later break them
|
|
39
|
-
* silently.
|
|
40
|
-
*/
|
|
41
|
-
import { readInstalledPacks } from "./pack-manifest";
|
|
42
|
-
import { SEMANTIC_REVIEWER_NAMES } from "./policy-authority";
|
|
43
|
-
|
|
44
|
-
let cached: ReadonlySet<string> | null = null;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* The installed packs' semantic policy names when any pack declares some, and
|
|
48
|
-
* this build's compiled-in set otherwise.
|
|
49
|
-
*
|
|
50
|
-
* Never throws: an unreadable manifest declares nothing, and the builtin set
|
|
51
|
-
* stands. That is the same fail-open posture every other reader of the pack
|
|
52
|
-
* manifest takes, and here it also fails in the safe direction — a pack's
|
|
53
|
-
* `reviewedBy` will not match a builtin name, so its policies stay `hard`
|
|
54
|
-
* rather than being cleared by a question nobody could read.
|
|
55
|
-
*/
|
|
56
|
-
export function effectiveReviewerNames(): ReadonlySet<string> {
|
|
57
|
-
if (cached) return cached;
|
|
58
|
-
let names: ReadonlySet<string> = SEMANTIC_REVIEWER_NAMES;
|
|
59
|
-
try {
|
|
60
|
-
const declared = readInstalledPacks().packs.flatMap((p) => (p.semantic ?? []).map((s) => s.name));
|
|
61
|
-
// Only when a pack actually declared some. A machine whose packs carry only
|
|
62
|
-
// the regex floor still runs the compiled-in semantic set, so its builtin
|
|
63
|
-
// reviewer names are the live ones.
|
|
64
|
-
if (declared.length > 0) names = new Set(declared);
|
|
65
|
-
} catch {
|
|
66
|
-
// See above: silence here is the builtin set, not an empty one.
|
|
67
|
-
}
|
|
68
|
-
cached = names;
|
|
69
|
-
return names;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Drop the cached answer. Called by `clearPolicies()`, which every evaluation
|
|
74
|
-
* runs before it registers anything — so a pack installed under a long-lived
|
|
75
|
-
* warm worker is picked up on the next event rather than at the next restart.
|
|
76
|
-
*/
|
|
77
|
-
export function forgetEffectiveReviewerNames(): void {
|
|
78
|
-
cached = null;
|
|
79
|
-
}
|