failproofai 1.0.7-beta.1 → 1.0.7-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/required-server-files.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +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.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.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.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.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.nft.json +1 -1
- package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +7 -7
- package/.next/standalone/.next/server/app/settings/page.js +2 -2
- 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/[root-of-the-server]__0l3yhx4._.js +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0o07qi9._.js +1 -1
- 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/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_18qtd42._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__04usis8._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__056wjo4._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0yxwl6j._.js → [root-of-the-server]__0l44ual._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0n0xg95._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0rwtwpm._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0s_yomn._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__11mayhe._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1pprgri._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1q4p5b8._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_042cgl1._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_08x1r5t._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0bqoto4._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_214wgrp._.js → _1mel6y1._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0bn2oo8._.js → _1v-jvrv._.js} +1 -1
- 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_actions_get-scheduled-audit_ts_0ei9sni._.js +1 -1
- 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 +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_settings_02tf1h4._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_15t8kqj._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_1fm2w5z._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_1j0zy3v._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_builtin-policies_ts_09j2ndl._.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 +22 -22
- package/.next/standalone/.next/static/chunks/043j99m8ykg__.css +2 -0
- package/.next/standalone/.next/static/chunks/0fqd7m_u81mi5.js +1 -0
- package/.next/standalone/.next/static/chunks/129ag2bw93bdh.js +1 -0
- package/.next/standalone/.next/static/chunks/{29fql3nbnfc9q.js → 1qd741hzlmjbo.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0vmd180qfntfb.js → 2_pltstd8-xgs.js} +1 -1
- package/.next/standalone/.next/static/chunks/{1u5zsejmgrir_.js → 2c8j9l6j_b1ci.js} +1 -1
- package/.next/standalone/.next/static/chunks/3-k569wzcli8q.js +1 -0
- package/.next/standalone/.next/static/chunks/{258668t68du6b.js → 3brze37td_wnc.js} +1 -1
- package/.next/standalone/.next/static/chunks/3otmypm6j_xfo.js +6 -0
- package/.next/standalone/.next/static/chunks/{12tvm75t5ffui.js → 3ugmd_7dyn0id.js} +1 -1
- package/.next/standalone/.next/static/chunks/3yxro_r2_o9ad.js +69 -0
- package/.next/standalone/PROBE-FOLLOWUP.md +186 -0
- package/.next/standalone/app/actions/get-jev-config.ts +38 -23
- package/.next/standalone/app/actions/update-jev-config.ts +1 -1
- package/.next/standalone/app/settings/jev-panel.tsx +33 -29
- package/.next/standalone/package.json +10 -10
- 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 +119 -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 +281 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/ai-4/package.json +13 -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 +168 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/ai-5/package.json +13 -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 +463 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/langchain-0.3/package.json +15 -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 +579 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/langchain-dup-core/package.json +15 -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 +6417 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/mastra-0/package.json +15 -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/README.md +2 -2
- package/dist/cli.mjs +208 -27
- package/dist/worker.mjs +120 -14
- package/package.json +10 -10
- package/scripts/build-policy-pack.mjs +14 -0
- package/src/audit/features.ts +3 -2
- package/src/hooks/builtin-policies.ts +156 -5
- package/src/hooks/jev-cli.ts +57 -1
- package/src/hooks/manager.ts +1 -1
- package/src/hooks/pack-cli.ts +150 -18
- package/src/hooks/pack-store.ts +1 -1
- package/src/hooks/policy-catalog.ts +148 -9
- package/src/hooks/types.ts +1 -1
- package/.next/standalone/.next/static/chunks/0cd-_8-c-m1ea.js +0 -6
- package/.next/standalone/.next/static/chunks/0qrbdkv9qmvli.js +0 -69
- package/.next/standalone/.next/static/chunks/0uldbut9y2-e8.js +0 -1
- package/.next/standalone/.next/static/chunks/285spx855h_3r.css +0 -2
- 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/.next/static/{T8YAYM9h_64fKv705vug7 → gbEOjBgZAxF2UIUwZVHNu}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{T8YAYM9h_64fKv705vug7 → gbEOjBgZAxF2UIUwZVHNu}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{T8YAYM9h_64fKv705vug7 → gbEOjBgZAxF2UIUwZVHNu}/_ssgManifest.js +0 -0
package/dist/cli.mjs
CHANGED
|
@@ -29,12 +29,12 @@ var __esm = (fn, res, err) => () => {
|
|
|
29
29
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
30
30
|
|
|
31
31
|
// package.json
|
|
32
|
-
var version2 = "1.0.7-beta.
|
|
32
|
+
var version2 = "1.0.7-beta.2", package_default;
|
|
33
33
|
var init_package = __esm(() => {
|
|
34
34
|
package_default = {
|
|
35
35
|
name: "failproofai",
|
|
36
36
|
version: version2,
|
|
37
|
-
description: "Observability and enforcement for AI agent harnesses.
|
|
37
|
+
description: "Observability and enforcement for AI agent harnesses. 40 built-in policies hooked into 12 of them — Claude Code, Codex, Cursor, Hermes, OpenClaw and more — blocking the tool call before it runs. Local dashboard included, no account needed.",
|
|
38
38
|
bin: {
|
|
39
39
|
failproofai: "./dist/cli.mjs",
|
|
40
40
|
failproofaid: "./bin/failproofaid-shim.mjs"
|
|
@@ -155,16 +155,16 @@ var init_package = __esm(() => {
|
|
|
155
155
|
browserslist: "4.28.8"
|
|
156
156
|
},
|
|
157
157
|
optionalDependencies: {
|
|
158
|
-
"@failproofai/failproofaid-linux-x64": "1.0.7-beta.
|
|
159
|
-
"@failproofai/failproofaid-linux-arm64": "1.0.7-beta.
|
|
160
|
-
"@failproofai/failproofaid-darwin-x64": "1.0.7-beta.
|
|
161
|
-
"@failproofai/failproofaid-darwin-arm64": "1.0.7-beta.
|
|
158
|
+
"@failproofai/failproofaid-linux-x64": "1.0.7-beta.2",
|
|
159
|
+
"@failproofai/failproofaid-linux-arm64": "1.0.7-beta.2",
|
|
160
|
+
"@failproofai/failproofaid-darwin-x64": "1.0.7-beta.2",
|
|
161
|
+
"@failproofai/failproofaid-darwin-arm64": "1.0.7-beta.2"
|
|
162
162
|
},
|
|
163
163
|
failproofaidBinaries: {
|
|
164
|
-
"linux-x64": "
|
|
165
|
-
"linux-arm64": "
|
|
166
|
-
"darwin-x64": "
|
|
167
|
-
"darwin-arm64": "
|
|
164
|
+
"linux-x64": "5362ab6a4cfb23d1eee598aac67aedd9e43351e62724ee1c6b40c4fc8021c08f",
|
|
165
|
+
"linux-arm64": "f14a2548b41e14ad32b7fdd03a27ffe7160da1046e422e1f651099371b0d27e5",
|
|
166
|
+
"darwin-x64": "14189cade04f17cf5278bd8061a5ec0c2a2381aa21944ae0d05e8c35b98c2816",
|
|
167
|
+
"darwin-arm64": "4ba9f5c321894d953407efa3404f0deec07dccfd7db7bc2511bb35226816b583"
|
|
168
168
|
}
|
|
169
169
|
};
|
|
170
170
|
});
|
|
@@ -1912,7 +1912,8 @@ var init_policy_catalog = __esm(() => {
|
|
|
1912
1912
|
impact: "Catches catastrophic `rm -rf /` and Windows equivalents.",
|
|
1913
1913
|
description: "Prevent catastrophic deletions",
|
|
1914
1914
|
match: { events: ["PreToolUse"], toolNames: ["Bash"] },
|
|
1915
|
-
authority: "
|
|
1915
|
+
authority: "reviewable",
|
|
1916
|
+
reviewedBy: ["destructive-deletion"],
|
|
1916
1917
|
defaultEnabled: false,
|
|
1917
1918
|
category: "Dangerous Commands",
|
|
1918
1919
|
params: {
|
|
@@ -1943,7 +1944,8 @@ var init_policy_catalog = __esm(() => {
|
|
|
1943
1944
|
impact: "kubectl can change live cluster state — gated unless allow-listed.",
|
|
1944
1945
|
description: "Block kubectl commands (Kubernetes cluster mutations)",
|
|
1945
1946
|
match: { events: ["PreToolUse"], toolNames: ["Bash"] },
|
|
1946
|
-
authority: "
|
|
1947
|
+
authority: "reviewable",
|
|
1948
|
+
reviewedBy: ["production-infra-change"],
|
|
1947
1949
|
defaultEnabled: false,
|
|
1948
1950
|
category: "Infra Commands",
|
|
1949
1951
|
params: {
|
|
@@ -1960,7 +1962,8 @@ var init_policy_catalog = __esm(() => {
|
|
|
1960
1962
|
impact: "Terraform mutates real infrastructure — gated unless allow-listed.",
|
|
1961
1963
|
description: "Block terraform and tofu (OpenTofu) commands",
|
|
1962
1964
|
match: { events: ["PreToolUse"], toolNames: ["Bash"] },
|
|
1963
|
-
authority: "
|
|
1965
|
+
authority: "reviewable",
|
|
1966
|
+
reviewedBy: ["production-infra-change"],
|
|
1964
1967
|
defaultEnabled: false,
|
|
1965
1968
|
category: "Infra Commands",
|
|
1966
1969
|
params: {
|
|
@@ -1977,7 +1980,8 @@ var init_policy_catalog = __esm(() => {
|
|
|
1977
1980
|
impact: "AWS CLI can spend money or break prod — gated.",
|
|
1978
1981
|
description: "Block aws CLI commands",
|
|
1979
1982
|
match: { events: ["PreToolUse"], toolNames: ["Bash"] },
|
|
1980
|
-
authority: "
|
|
1983
|
+
authority: "reviewable",
|
|
1984
|
+
reviewedBy: ["production-infra-change"],
|
|
1981
1985
|
defaultEnabled: false,
|
|
1982
1986
|
category: "Infra Commands",
|
|
1983
1987
|
params: {
|
|
@@ -1994,7 +1998,8 @@ var init_policy_catalog = __esm(() => {
|
|
|
1994
1998
|
impact: "gcloud can spend money or break prod — gated.",
|
|
1995
1999
|
description: "Block gcloud (Google Cloud) CLI commands",
|
|
1996
2000
|
match: { events: ["PreToolUse"], toolNames: ["Bash"] },
|
|
1997
|
-
authority: "
|
|
2001
|
+
authority: "reviewable",
|
|
2002
|
+
reviewedBy: ["production-infra-change"],
|
|
1998
2003
|
defaultEnabled: false,
|
|
1999
2004
|
category: "Infra Commands",
|
|
2000
2005
|
params: {
|
|
@@ -2011,7 +2016,8 @@ var init_policy_catalog = __esm(() => {
|
|
|
2011
2016
|
impact: "az can spend money or break prod — gated.",
|
|
2012
2017
|
description: "Block az (Azure) CLI commands",
|
|
2013
2018
|
match: { events: ["PreToolUse"], toolNames: ["Bash"] },
|
|
2014
|
-
authority: "
|
|
2019
|
+
authority: "reviewable",
|
|
2020
|
+
reviewedBy: ["production-infra-change"],
|
|
2015
2021
|
defaultEnabled: false,
|
|
2016
2022
|
category: "Infra Commands",
|
|
2017
2023
|
params: {
|
|
@@ -2028,7 +2034,8 @@ var init_policy_catalog = __esm(() => {
|
|
|
2028
2034
|
impact: "Helm releases mutate cluster state — gated.",
|
|
2029
2035
|
description: "Block helm commands",
|
|
2030
2036
|
match: { events: ["PreToolUse"], toolNames: ["Bash"] },
|
|
2031
|
-
authority: "
|
|
2037
|
+
authority: "reviewable",
|
|
2038
|
+
reviewedBy: ["production-infra-change"],
|
|
2032
2039
|
defaultEnabled: false,
|
|
2033
2040
|
category: "Infra Commands",
|
|
2034
2041
|
params: {
|
|
@@ -2062,7 +2069,8 @@ var init_policy_catalog = __esm(() => {
|
|
|
2062
2069
|
impact: "Stops the agent from creating `.pem`, `id_rsa`, `credentials.json`, etc.",
|
|
2063
2070
|
description: "Block writing secret key files",
|
|
2064
2071
|
match: { events: ["PreToolUse"], toolNames: ["Write"] },
|
|
2065
|
-
authority: "
|
|
2072
|
+
authority: "reviewable",
|
|
2073
|
+
reviewedBy: ["secret-exposure"],
|
|
2066
2074
|
defaultEnabled: false,
|
|
2067
2075
|
category: "Dangerous Commands",
|
|
2068
2076
|
params: {
|
|
@@ -2096,7 +2104,8 @@ var init_policy_catalog = __esm(() => {
|
|
|
2096
2104
|
impact: "Force-pushes rewrite history and can clobber teammates' work.",
|
|
2097
2105
|
description: "Prevent force-pushing to any branch",
|
|
2098
2106
|
match: { events: ["PreToolUse"], toolNames: ["Bash"] },
|
|
2099
|
-
authority: "
|
|
2107
|
+
authority: "reviewable",
|
|
2108
|
+
reviewedBy: ["git-history-rewrite"],
|
|
2100
2109
|
defaultEnabled: false,
|
|
2101
2110
|
category: "Git"
|
|
2102
2111
|
},
|
|
@@ -2138,6 +2147,23 @@ var init_policy_catalog = __esm(() => {
|
|
|
2138
2147
|
defaultEnabled: false,
|
|
2139
2148
|
category: "Git"
|
|
2140
2149
|
},
|
|
2150
|
+
{
|
|
2151
|
+
name: "warn-git-clean",
|
|
2152
|
+
displayTitle: "Tried to delete untracked or ignored files with git clean",
|
|
2153
|
+
impact: "`git clean -fdx` takes `.env`, local config and unstaged work — git never had a copy of any of it.",
|
|
2154
|
+
description: "Warns before git clean deletes untracked directories (-d) or ignored files (-x / -X)",
|
|
2155
|
+
match: { events: ["PreToolUse"], toolNames: ["Bash"] },
|
|
2156
|
+
authority: "hard",
|
|
2157
|
+
defaultEnabled: false,
|
|
2158
|
+
category: "Git",
|
|
2159
|
+
params: {
|
|
2160
|
+
destructiveFlags: {
|
|
2161
|
+
type: "string[]",
|
|
2162
|
+
description: "git clean flag letters that make it worth warning about, checked alongside --force. Narrow to ['x','X'] to allow `git clean -fd`, or widen with 'f' to warn on a bare `git clean -f`.",
|
|
2163
|
+
default: ["d", "x", "X"]
|
|
2164
|
+
}
|
|
2165
|
+
}
|
|
2166
|
+
},
|
|
2141
2167
|
{
|
|
2142
2168
|
name: "warn-all-files-staged",
|
|
2143
2169
|
displayTitle: "Staged all files with git add -A / .",
|
|
@@ -3288,7 +3314,7 @@ function stripShellQuoting(command) {
|
|
|
3288
3314
|
const ansiDecoded = joined.replace(/\$'((?:[^'\\]|\\.)*)'/g, (_, body) => decodeAnsiC(body));
|
|
3289
3315
|
return ansiDecoded.replace(/\\(.)/g, "$1").replace(/['"]/g, "");
|
|
3290
3316
|
}
|
|
3291
|
-
function
|
|
3317
|
+
function gitSubcommandIndex(args) {
|
|
3292
3318
|
for (let i = 0;i < args.length; i++) {
|
|
3293
3319
|
const arg = args[i];
|
|
3294
3320
|
if (GIT_FLAGS_WITH_OPERANDS.has(arg)) {
|
|
@@ -3297,9 +3323,13 @@ function gitSubcommand(args) {
|
|
|
3297
3323
|
}
|
|
3298
3324
|
if (arg.startsWith("-"))
|
|
3299
3325
|
continue;
|
|
3300
|
-
return
|
|
3326
|
+
return i;
|
|
3301
3327
|
}
|
|
3302
|
-
return;
|
|
3328
|
+
return -1;
|
|
3329
|
+
}
|
|
3330
|
+
function gitSubcommand(args) {
|
|
3331
|
+
const i = gitSubcommandIndex(args);
|
|
3332
|
+
return i < 0 ? undefined : args[i];
|
|
3303
3333
|
}
|
|
3304
3334
|
function globCouldNameState(raw) {
|
|
3305
3335
|
const stripped = raw.replace(/^[()]+|[()]+$/g, "");
|
|
@@ -4415,6 +4445,77 @@ function warnGitStashDrop(ctx) {
|
|
|
4415
4445
|
}
|
|
4416
4446
|
return allow();
|
|
4417
4447
|
}
|
|
4448
|
+
function readGitCleanFlags(args) {
|
|
4449
|
+
const letters = new Set;
|
|
4450
|
+
let force = false;
|
|
4451
|
+
let dryRun = false;
|
|
4452
|
+
let sawEndOfOptions = false;
|
|
4453
|
+
for (const token of args) {
|
|
4454
|
+
if (token === "--") {
|
|
4455
|
+
sawEndOfOptions = true;
|
|
4456
|
+
continue;
|
|
4457
|
+
}
|
|
4458
|
+
if (sawEndOfOptions)
|
|
4459
|
+
continue;
|
|
4460
|
+
if (token === "--force") {
|
|
4461
|
+
force = true;
|
|
4462
|
+
continue;
|
|
4463
|
+
}
|
|
4464
|
+
if (token === "--dry-run") {
|
|
4465
|
+
dryRun = true;
|
|
4466
|
+
continue;
|
|
4467
|
+
}
|
|
4468
|
+
if (token.startsWith("--"))
|
|
4469
|
+
continue;
|
|
4470
|
+
if (!SHORT_FLAG_CLUSTER_RE.test(token))
|
|
4471
|
+
continue;
|
|
4472
|
+
for (const letter of token.slice(1)) {
|
|
4473
|
+
if (letter === "f")
|
|
4474
|
+
force = true;
|
|
4475
|
+
if (letter === "n")
|
|
4476
|
+
dryRun = true;
|
|
4477
|
+
letters.add(letter);
|
|
4478
|
+
}
|
|
4479
|
+
}
|
|
4480
|
+
if (force)
|
|
4481
|
+
letters.add("f");
|
|
4482
|
+
return { force, dryRun, letters };
|
|
4483
|
+
}
|
|
4484
|
+
function gitCleanForceWaived(globalOptions) {
|
|
4485
|
+
for (let i = 0;i < globalOptions.length; i++) {
|
|
4486
|
+
const token = globalOptions[i];
|
|
4487
|
+
const value = token === "-c" ? globalOptions[i + 1] : token.startsWith("-c") ? token.slice(2) : undefined;
|
|
4488
|
+
if (value !== undefined && GIT_CLEAN_FORCE_WAIVED_RE.test(value))
|
|
4489
|
+
return true;
|
|
4490
|
+
}
|
|
4491
|
+
return false;
|
|
4492
|
+
}
|
|
4493
|
+
function warnGitClean(ctx) {
|
|
4494
|
+
if (ctx.toolName !== "Bash")
|
|
4495
|
+
return allow();
|
|
4496
|
+
const destructiveFlags = ctx.params?.destructiveFlags ?? GIT_CLEAN_DESTRUCTIVE_FLAGS;
|
|
4497
|
+
if (destructiveFlags.length === 0)
|
|
4498
|
+
return allow();
|
|
4499
|
+
for (const segment of shellSegments(getCommand(ctx))) {
|
|
4500
|
+
const tokens = parseArgvTokens(segment);
|
|
4501
|
+
const gitIdx = tokens.findIndex((t) => GIT_CMD_RE.test(t));
|
|
4502
|
+
if (gitIdx < 0)
|
|
4503
|
+
continue;
|
|
4504
|
+
const args = tokens.slice(gitIdx + 1);
|
|
4505
|
+
const subIdx = gitSubcommandIndex(args);
|
|
4506
|
+
if (subIdx < 0 || args[subIdx] !== "clean")
|
|
4507
|
+
continue;
|
|
4508
|
+
const flags = readGitCleanFlags(args.slice(subIdx + 1));
|
|
4509
|
+
if (flags.dryRun)
|
|
4510
|
+
continue;
|
|
4511
|
+
if (!flags.force && !gitCleanForceWaived(args.slice(0, subIdx)))
|
|
4512
|
+
continue;
|
|
4513
|
+
if (!destructiveFlags.some((f) => flags.letters.has(f)))
|
|
4514
|
+
continue;
|
|
4515
|
+
return instruct("STOP: This command deletes untracked files from the working tree (git clean). Git has no copy of " + "untracked or ignored files, so nothing it removes can be recovered: -d takes whole untracked " + "directories, and -x / -X also take .gitignore'd files such as .env, local config and scratch work. " + "Re-run it with --dry-run and confirm the exact paths with the user before executing.");
|
|
4516
|
+
}
|
|
4517
|
+
return allow();
|
|
4518
|
+
}
|
|
4418
4519
|
function warnAllFilesStaged(ctx) {
|
|
4419
4520
|
if (ctx.toolName !== "Bash")
|
|
4420
4521
|
return allow();
|
|
@@ -4800,7 +4901,7 @@ function registerBuiltinPolicies(enabledNames) {
|
|
|
4800
4901
|
}
|
|
4801
4902
|
}
|
|
4802
4903
|
}
|
|
4803
|
-
var isClaudeInternalPath, isClaudeSettingsFile, SHELL_OPERATORS, SHELL_METACHAR_RE, JWT_RE, API_KEY_PATTERNS, CONNECTION_STRING_RE, PRIVATE_KEY_RE, BEARER_TOKEN_RE, SECRET_PATTERNS, SQL_TOOL_RE, DESTRUCTIVE_SQL_RE, DELETE_NO_WHERE_RE, SQL_WHERE_RE, SCHEMA_ALTER_RE, PUBLISH_CMD_RE, ENV_PRINTENV_RE, ECHO_ENV_RE, EXPORT_RE, PS_ENV_VAR_RE, PS_CHILDITEM_ENV_RE, DOTNET_GETENV_RE, CMD_ECHO_ENV_RE, ENV_FILE_PATH_RE, ENV_CMD_RE, PS_ELEVATION_RE, RUNAS_RE, CURL_PIPE_SH_RE, SEGMENT_SEPARATORS, COMMAND_PREFIX_TOKENS, SELF_BINARY_TOKEN_RE, SELF_ENTRY_PATH_RE, CONFIG_SUBCOMMAND_RE, PAUSE_FLAG_RE, ENV_ASSIGNMENT_RE, RUNNER_OPERAND_RE, PS_WEB_PIPE_RE, SHORT_FLAG_BUNDLE_RE, SAFE_FORCE_PREFIXES, SECRET_FILE_RE, SECRET_FILE_ID_RSA_RE, SECRET_FILE_CREDENTIALS_RE, GIT_COMMIT_MERGE_RE, FAILPROOFAI_STATE_PATH_RE, STATE_READ_COMMANDS, SHELL_KEYWORD_PREFIXES, LOOP_HEADER_RE, COPY_COMMANDS, OPERAND_WRITE_COMMANDS, SECOND_OPERAND_WRITERS, OUTPUT_FLAG_COMMANDS, FIND_WRITE_ACTIONS, SAFE_EXEC_COMMANDS, GIT_DESTRUCTIVE_SUBCOMMANDS, GIT_FLAGS_WITH_OPERANDS, STATE_MENTION_COMMANDS, FIND_EXEC_ACTIONS, PIPELINE_SEPARATORS, VAR_REFERENCE_RE, STATE_GLOB_CANDIDATES, GLOB_DECOYS, BRACE_EXPANSION_LIMIT = 4096, BRACE_EXPANSION_ROUNDS = 24, GLOB_METACHAR_RE, REDIRECT_TARGET_RE, FAILPROOFAI_UNINSTALL_RE, GIT_AMEND_RE, GIT_STASH_DROP_RE, GIT_ADD_ALL_RE, NPM_GLOBAL_RE, YARN_GLOBAL_RE, PNPM_GLOBAL_RE, BUN_GLOBAL_RE, CARGO_INSTALL_RE, PIP_SYSTEM_RE, PKG_MANAGER_DETECTORS, NOHUP_RE, SCREEN_DETACH_RE, TMUX_DETACH_RE, DISOWN_RE, BACKGROUND_AMPERSAND_RE, KUBECTL_RE, TERRAFORM_RE, AWS_CLI_RE, GCLOUD_RE, AZ_CLI_RE, HELM_RE, GH_PIPELINE_RE, gitBranchCache, GIT_BRANCH_CACHE_MAX_ENTRIES = 500, EVAL_FLAG_RE, HOME_PREFIX_RE, RM_CMD_RE, FIND_CMD_RE, FIND_EXEC_RE, FIND_GLOBAL_OPT_RE, FIND_EXPR_START_RE, SCRATCH_ROOTS, CATASTROPHIC_DEPTH = 2, READ_LIKE_CMDS, TOOL_CALL_TRACKER_MAX_BYTES = 65536, SEGMENT_SPLIT_RE, POLICY_IMPLEMENTATIONS, BUILTIN_POLICIES;
|
|
4904
|
+
var isClaudeInternalPath, isClaudeSettingsFile, SHELL_OPERATORS, SHELL_METACHAR_RE, JWT_RE, API_KEY_PATTERNS, CONNECTION_STRING_RE, PRIVATE_KEY_RE, BEARER_TOKEN_RE, SECRET_PATTERNS, SQL_TOOL_RE, DESTRUCTIVE_SQL_RE, DELETE_NO_WHERE_RE, SQL_WHERE_RE, SCHEMA_ALTER_RE, PUBLISH_CMD_RE, ENV_PRINTENV_RE, ECHO_ENV_RE, EXPORT_RE, PS_ENV_VAR_RE, PS_CHILDITEM_ENV_RE, DOTNET_GETENV_RE, CMD_ECHO_ENV_RE, ENV_FILE_PATH_RE, ENV_CMD_RE, PS_ELEVATION_RE, RUNAS_RE, CURL_PIPE_SH_RE, SEGMENT_SEPARATORS, COMMAND_PREFIX_TOKENS, SELF_BINARY_TOKEN_RE, SELF_ENTRY_PATH_RE, CONFIG_SUBCOMMAND_RE, PAUSE_FLAG_RE, ENV_ASSIGNMENT_RE, RUNNER_OPERAND_RE, PS_WEB_PIPE_RE, SHORT_FLAG_BUNDLE_RE, SAFE_FORCE_PREFIXES, SECRET_FILE_RE, SECRET_FILE_ID_RSA_RE, SECRET_FILE_CREDENTIALS_RE, GIT_COMMIT_MERGE_RE, FAILPROOFAI_STATE_PATH_RE, STATE_READ_COMMANDS, SHELL_KEYWORD_PREFIXES, LOOP_HEADER_RE, COPY_COMMANDS, OPERAND_WRITE_COMMANDS, SECOND_OPERAND_WRITERS, OUTPUT_FLAG_COMMANDS, FIND_WRITE_ACTIONS, SAFE_EXEC_COMMANDS, GIT_DESTRUCTIVE_SUBCOMMANDS, GIT_FLAGS_WITH_OPERANDS, STATE_MENTION_COMMANDS, FIND_EXEC_ACTIONS, PIPELINE_SEPARATORS, VAR_REFERENCE_RE, STATE_GLOB_CANDIDATES, GLOB_DECOYS, BRACE_EXPANSION_LIMIT = 4096, BRACE_EXPANSION_ROUNDS = 24, GLOB_METACHAR_RE, REDIRECT_TARGET_RE, FAILPROOFAI_UNINSTALL_RE, GIT_AMEND_RE, GIT_STASH_DROP_RE, GIT_CMD_RE, SHORT_FLAG_CLUSTER_RE, GIT_CLEAN_FORCE_WAIVED_RE, GIT_CLEAN_DESTRUCTIVE_FLAGS, GIT_ADD_ALL_RE, NPM_GLOBAL_RE, YARN_GLOBAL_RE, PNPM_GLOBAL_RE, BUN_GLOBAL_RE, CARGO_INSTALL_RE, PIP_SYSTEM_RE, PKG_MANAGER_DETECTORS, NOHUP_RE, SCREEN_DETACH_RE, TMUX_DETACH_RE, DISOWN_RE, BACKGROUND_AMPERSAND_RE, KUBECTL_RE, TERRAFORM_RE, AWS_CLI_RE, GCLOUD_RE, AZ_CLI_RE, HELM_RE, GH_PIPELINE_RE, gitBranchCache, GIT_BRANCH_CACHE_MAX_ENTRIES = 500, EVAL_FLAG_RE, HOME_PREFIX_RE, RM_CMD_RE, FIND_CMD_RE, FIND_EXEC_RE, FIND_GLOBAL_OPT_RE, FIND_EXPR_START_RE, SCRATCH_ROOTS, CATASTROPHIC_DEPTH = 2, READ_LIKE_CMDS, TOOL_CALL_TRACKER_MAX_BYTES = 65536, SEGMENT_SPLIT_RE, POLICY_IMPLEMENTATIONS, BUILTIN_POLICIES;
|
|
4804
4905
|
var init_builtin_policies = __esm(() => {
|
|
4805
4906
|
init_policy_catalog();
|
|
4806
4907
|
init_policy_registry();
|
|
@@ -5069,6 +5170,10 @@ var init_builtin_policies = __esm(() => {
|
|
|
5069
5170
|
FAILPROOFAI_UNINSTALL_RE = /(?:npm\s+(?:uninstall|remove|un|r)\s.*failproofai|bun\s+remove\s.*failproofai|yarn\s+global\s+remove\s+failproofai|pnpm\s+(?:remove|uninstall|un)\s.*failproofai)/;
|
|
5070
5171
|
GIT_AMEND_RE = /\bgit\s+commit\b.*--amend\b/;
|
|
5071
5172
|
GIT_STASH_DROP_RE = /\bgit\s+stash\s+(?:drop|clear)\b/;
|
|
5173
|
+
GIT_CMD_RE = /^(?:\/\S*\/)?git$/;
|
|
5174
|
+
SHORT_FLAG_CLUSTER_RE = /^-[A-Za-z]+$/;
|
|
5175
|
+
GIT_CLEAN_FORCE_WAIVED_RE = /^clean\.requireforce=(?:false|0|no|off)$/i;
|
|
5176
|
+
GIT_CLEAN_DESTRUCTIVE_FLAGS = ["d", "x", "X"];
|
|
5072
5177
|
GIT_ADD_ALL_RE = /\bgit\s+add\s+(?:-A\b|--all\b|\.(?:\s|$|;|&&|\|\|))/;
|
|
5073
5178
|
NPM_GLOBAL_RE = /\bnpm\s+(?:install|i)\b(?=.*(?:\s-g\b|--global\b))/;
|
|
5074
5179
|
YARN_GLOBAL_RE = /\byarn\s+global\s+add\b/;
|
|
@@ -5137,6 +5242,7 @@ var init_builtin_policies = __esm(() => {
|
|
|
5137
5242
|
"block-work-on-main": blockWorkOnMain,
|
|
5138
5243
|
"warn-git-amend": warnGitAmend,
|
|
5139
5244
|
"warn-git-stash-drop": warnGitStashDrop,
|
|
5245
|
+
"warn-git-clean": warnGitClean,
|
|
5140
5246
|
"warn-all-files-staged": warnAllFilesStaged,
|
|
5141
5247
|
"warn-destructive-sql": warnDestructiveSql,
|
|
5142
5248
|
"warn-schema-alteration": warnSchemaAlteration,
|
|
@@ -36579,6 +36685,17 @@ function providerForUrl(url) {
|
|
|
36579
36685
|
return "custom";
|
|
36580
36686
|
}
|
|
36581
36687
|
}
|
|
36688
|
+
function accountIdFromUrl(url) {
|
|
36689
|
+
try {
|
|
36690
|
+
const parsed = new URL(url);
|
|
36691
|
+
if (PROVIDER_BY_HOST[parsed.hostname.toLowerCase()] !== "cloudflare")
|
|
36692
|
+
return null;
|
|
36693
|
+
const m = /\/accounts\/([0-9a-f]{32})(?:\/|$)/i.exec(parsed.pathname);
|
|
36694
|
+
return m ? m[1].toLowerCase() : null;
|
|
36695
|
+
} catch {
|
|
36696
|
+
return null;
|
|
36697
|
+
}
|
|
36698
|
+
}
|
|
36582
36699
|
function isProviderDefaultUrl(kind, url) {
|
|
36583
36700
|
const base = JEV_PROVIDER_DEFAULTS[kind].baseUrl;
|
|
36584
36701
|
if (!base)
|
|
@@ -36668,6 +36785,22 @@ async function setup(argv, deps, opts) {
|
|
|
36668
36785
|
const kind = explicit ?? urlProvider.kind;
|
|
36669
36786
|
if (explicit === null)
|
|
36670
36787
|
values.set("--provider", kind);
|
|
36788
|
+
if (kind === "cloudflare") {
|
|
36789
|
+
const fromUrl = accountIdFromUrl(normalized);
|
|
36790
|
+
const given = values.get("--account-id");
|
|
36791
|
+
if (fromUrl !== null && given === undefined) {
|
|
36792
|
+
values.set("--account-id", fromUrl);
|
|
36793
|
+
} else if (fromUrl !== null && given !== undefined && given.toLowerCase() !== fromUrl) {
|
|
36794
|
+
return fail2([
|
|
36795
|
+
"Not saved: --account-id and the account id in --url are different.",
|
|
36796
|
+
` --url names ${fromUrl}`,
|
|
36797
|
+
` --account-id names ${given.toLowerCase()}`,
|
|
36798
|
+
"Drop one of them.",
|
|
36799
|
+
"",
|
|
36800
|
+
"Nothing was written."
|
|
36801
|
+
]);
|
|
36802
|
+
}
|
|
36803
|
+
}
|
|
36671
36804
|
values.set("--base-url", kind !== "custom" && isProviderDefaultUrl(kind, normalized) ? "default" : normalized);
|
|
36672
36805
|
values.delete("--url");
|
|
36673
36806
|
}
|
|
@@ -36730,7 +36863,9 @@ async function setup(argv, deps, opts) {
|
|
|
36730
36863
|
if (kind === "cloudflare" && urlProvider?.kind === "cloudflare" && typeof next.accountId !== "string") {
|
|
36731
36864
|
return fail2([
|
|
36732
36865
|
`Not saved: ${urlProvider.host} is Cloudflare Workers AI, whose endpoint is per-account.`,
|
|
36733
|
-
"Pass the account id as well: --account-id <32 hex characters
|
|
36866
|
+
"Pass the account id as well: --account-id <32 hex characters>,",
|
|
36867
|
+
"or give the full run URL, which already contains it:",
|
|
36868
|
+
" https://api.cloudflare.com/client/v4/accounts/<id>/ai/run",
|
|
36734
36869
|
"",
|
|
36735
36870
|
"Nothing was written."
|
|
36736
36871
|
]);
|
|
@@ -39654,6 +39789,52 @@ function relativeAge(iso) {
|
|
|
39654
39789
|
return value < 10 ? "just now" : `${value} seconds ago`;
|
|
39655
39790
|
return `${value} ${label}${value === 1 ? "" : "s"} ago`;
|
|
39656
39791
|
}
|
|
39792
|
+
function reviewersByCheck(policies, semantic) {
|
|
39793
|
+
const ownChecks = new Set(semantic.map((s) => s.name));
|
|
39794
|
+
const byCheck = new Map(semantic.map((s) => [s.name, []]));
|
|
39795
|
+
for (const policy of policies) {
|
|
39796
|
+
const { authority, reviewedBy } = resolvePolicyAuthority(policy, ownChecks);
|
|
39797
|
+
if (authority !== "reviewable")
|
|
39798
|
+
continue;
|
|
39799
|
+
for (const check of reviewedBy ?? [])
|
|
39800
|
+
byCheck.get(check)?.push(policy.name);
|
|
39801
|
+
}
|
|
39802
|
+
return byCheck;
|
|
39803
|
+
}
|
|
39804
|
+
function reviewersCell(names) {
|
|
39805
|
+
if (names.length <= REVIEWERS_LISTED)
|
|
39806
|
+
return names.join(", ");
|
|
39807
|
+
return `${names.slice(0, 2).join(", ")}, +${names.length - 2}`;
|
|
39808
|
+
}
|
|
39809
|
+
function unreviewedCell(mode, policies) {
|
|
39810
|
+
if (mode === "instruct")
|
|
39811
|
+
return "instruct-only — it can never deny";
|
|
39812
|
+
if (policies === 0)
|
|
39813
|
+
return "this pack has no policies to clear";
|
|
39814
|
+
if (policies === 1)
|
|
39815
|
+
return "the one policy here does not cover this";
|
|
39816
|
+
return `nothing in the ${policies} covers this`;
|
|
39817
|
+
}
|
|
39818
|
+
function jevChecksSection(pack, opts) {
|
|
39819
|
+
if (pack.semantic.length === 0)
|
|
39820
|
+
return null;
|
|
39821
|
+
const reviewers = reviewersByCheck(pack.policies, pack.semantic);
|
|
39822
|
+
const rows = pack.semantic.map((check) => {
|
|
39823
|
+
const named = reviewers.get(check.name) ?? [];
|
|
39824
|
+
return [
|
|
39825
|
+
check.mode,
|
|
39826
|
+
check.name,
|
|
39827
|
+
named.length > 0 ? `reviews ${reviewersCell(named)}` : `— ${unreviewedCell(check.mode, pack.policies.length)}`
|
|
39828
|
+
];
|
|
39829
|
+
});
|
|
39830
|
+
return [
|
|
39831
|
+
...rule(`Jev checks — ${pack.semantic.length} · not selectable · only where Jev is configured`, opts),
|
|
39832
|
+
...table({ head: ["", "", ""], rows, protect: [0, 1] }, opts),
|
|
39833
|
+
"",
|
|
39834
|
+
...note("Nothing toggles them: `--policy` cannot name one, `failproofai policies` never lists them, " + "and a pack's checks replace the ones this build ships with.", opts),
|
|
39835
|
+
...note(pack.policies.length === 0 ? "This pack ships no regex policies, so none of these checks clears anything here: a deny " + "check can only ADD a deny, and an instruct check only ever warns." : `\`reviews\` is which of this pack's own ${pack.policies.length} policies each check can clear. ` + "A deny check that reviews nothing can only ever ADD a deny; an instruct check never answers " + "deny, so nothing pairs with one.", opts)
|
|
39836
|
+
];
|
|
39837
|
+
}
|
|
39657
39838
|
async function listRemote(source) {
|
|
39658
39839
|
const opts = optsFor(process.stdout);
|
|
39659
39840
|
let preview;
|
|
@@ -39679,7 +39860,7 @@ async function listRemote(source) {
|
|
|
39679
39860
|
]);
|
|
39680
39861
|
}
|
|
39681
39862
|
}
|
|
39682
|
-
return ok3(stack(title(`${preview.id}@${preview.version}`, `${preview.policies.length} policies · ${categories.length} categories` + (preview.semantic.length > 0 ? ` · ${semanticPhrase(preview.semantic.length)}` : ""), opts), note(`Not installed. ${defaults.length} of ${preview.policies.length} are on by default; the rest are opt-in.` + (preview.effect === "observe" ? " This pack OBSERVES — it records and blocks nothing." : ""), opts), preview.
|
|
39863
|
+
return ok3(stack(title(`${preview.id}@${preview.version}`, `${preview.policies.length} policies · ${categories.length} categories` + (preview.semantic.length > 0 ? ` · ${semanticPhrase(preview.semantic.length)}` : ""), opts), note(`Not installed. ${defaults.length} of ${preview.policies.length} are on by default; the rest are opt-in.` + (preview.effect === "observe" ? " This pack OBSERVES — it records and blocks nothing." : ""), opts), preview.minCliVersion ? note(`Requires failproofai ${preview.minCliVersion} or newer.`, opts) : null, preview.resolvedFromLatest ? note(`Newest release: ${preview.source}`, opts) : null, table({ head: ["", "", ""], rows }, opts), jevChecksSection(preview, opts), nextStep(`failproofai policies add ${source}`, "Install the defaults with:", opts), note("Or take part of it: --policy <a,b>, --category <x,y>, --all", opts)));
|
|
39683
39864
|
}
|
|
39684
39865
|
async function list() {
|
|
39685
39866
|
const { packs, errors } = readInstalledPacks();
|
|
@@ -39774,7 +39955,7 @@ var ok3 = (lines, meta) => ({
|
|
|
39774
39955
|
lines,
|
|
39775
39956
|
exitCode: 0,
|
|
39776
39957
|
...meta ? { meta } : {}
|
|
39777
|
-
}), fail3 = (lines) => ({ lines, exitCode: 1 }), VALUE_FLAGS3, LOCAL_IMPORT_RES, LOCAL_IMPORT_EXTENSIONS, VERSION_SHA_LENGTH = 12, PUBLISH_VALUE_FLAGS2, INSTALLABLE_PACK_ASSETS, GITHUB_API2, GITHUB_UPLOADS2, GITHUB_GIT2;
|
|
39958
|
+
}), fail3 = (lines) => ({ lines, exitCode: 1 }), VALUE_FLAGS3, LOCAL_IMPORT_RES, LOCAL_IMPORT_EXTENSIONS, VERSION_SHA_LENGTH = 12, PUBLISH_VALUE_FLAGS2, INSTALLABLE_PACK_ASSETS, GITHUB_API2, GITHUB_UPLOADS2, GITHUB_GIT2, REVIEWERS_LISTED = 3;
|
|
39778
39959
|
var init_pack_cli2 = __esm(() => {
|
|
39779
39960
|
init_types();
|
|
39780
39961
|
init_pack_manifest();
|
|
@@ -42398,7 +42579,7 @@ import { realpathSync as realpathSync7 } from "fs";
|
|
|
42398
42579
|
import { dirname as dirname30, resolve as resolve39 } from "path";
|
|
42399
42580
|
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
42400
42581
|
// package.json
|
|
42401
|
-
var version = "1.0.7-beta.
|
|
42582
|
+
var version = "1.0.7-beta.2";
|
|
42402
42583
|
|
|
42403
42584
|
// bin/failproofai.mjs
|
|
42404
42585
|
if (!process.env.FAILPROOFAI_PACKAGE_ROOT) {
|
package/dist/worker.mjs
CHANGED
|
@@ -708,7 +708,8 @@ var init_policy_catalog = __esm(() => {
|
|
|
708
708
|
impact: "Catches catastrophic `rm -rf /` and Windows equivalents.",
|
|
709
709
|
description: "Prevent catastrophic deletions",
|
|
710
710
|
match: { events: ["PreToolUse"], toolNames: ["Bash"] },
|
|
711
|
-
authority: "
|
|
711
|
+
authority: "reviewable",
|
|
712
|
+
reviewedBy: ["destructive-deletion"],
|
|
712
713
|
defaultEnabled: false,
|
|
713
714
|
category: "Dangerous Commands",
|
|
714
715
|
params: {
|
|
@@ -739,7 +740,8 @@ var init_policy_catalog = __esm(() => {
|
|
|
739
740
|
impact: "kubectl can change live cluster state — gated unless allow-listed.",
|
|
740
741
|
description: "Block kubectl commands (Kubernetes cluster mutations)",
|
|
741
742
|
match: { events: ["PreToolUse"], toolNames: ["Bash"] },
|
|
742
|
-
authority: "
|
|
743
|
+
authority: "reviewable",
|
|
744
|
+
reviewedBy: ["production-infra-change"],
|
|
743
745
|
defaultEnabled: false,
|
|
744
746
|
category: "Infra Commands",
|
|
745
747
|
params: {
|
|
@@ -756,7 +758,8 @@ var init_policy_catalog = __esm(() => {
|
|
|
756
758
|
impact: "Terraform mutates real infrastructure — gated unless allow-listed.",
|
|
757
759
|
description: "Block terraform and tofu (OpenTofu) commands",
|
|
758
760
|
match: { events: ["PreToolUse"], toolNames: ["Bash"] },
|
|
759
|
-
authority: "
|
|
761
|
+
authority: "reviewable",
|
|
762
|
+
reviewedBy: ["production-infra-change"],
|
|
760
763
|
defaultEnabled: false,
|
|
761
764
|
category: "Infra Commands",
|
|
762
765
|
params: {
|
|
@@ -773,7 +776,8 @@ var init_policy_catalog = __esm(() => {
|
|
|
773
776
|
impact: "AWS CLI can spend money or break prod — gated.",
|
|
774
777
|
description: "Block aws CLI commands",
|
|
775
778
|
match: { events: ["PreToolUse"], toolNames: ["Bash"] },
|
|
776
|
-
authority: "
|
|
779
|
+
authority: "reviewable",
|
|
780
|
+
reviewedBy: ["production-infra-change"],
|
|
777
781
|
defaultEnabled: false,
|
|
778
782
|
category: "Infra Commands",
|
|
779
783
|
params: {
|
|
@@ -790,7 +794,8 @@ var init_policy_catalog = __esm(() => {
|
|
|
790
794
|
impact: "gcloud can spend money or break prod — gated.",
|
|
791
795
|
description: "Block gcloud (Google Cloud) CLI commands",
|
|
792
796
|
match: { events: ["PreToolUse"], toolNames: ["Bash"] },
|
|
793
|
-
authority: "
|
|
797
|
+
authority: "reviewable",
|
|
798
|
+
reviewedBy: ["production-infra-change"],
|
|
794
799
|
defaultEnabled: false,
|
|
795
800
|
category: "Infra Commands",
|
|
796
801
|
params: {
|
|
@@ -807,7 +812,8 @@ var init_policy_catalog = __esm(() => {
|
|
|
807
812
|
impact: "az can spend money or break prod — gated.",
|
|
808
813
|
description: "Block az (Azure) CLI commands",
|
|
809
814
|
match: { events: ["PreToolUse"], toolNames: ["Bash"] },
|
|
810
|
-
authority: "
|
|
815
|
+
authority: "reviewable",
|
|
816
|
+
reviewedBy: ["production-infra-change"],
|
|
811
817
|
defaultEnabled: false,
|
|
812
818
|
category: "Infra Commands",
|
|
813
819
|
params: {
|
|
@@ -824,7 +830,8 @@ var init_policy_catalog = __esm(() => {
|
|
|
824
830
|
impact: "Helm releases mutate cluster state — gated.",
|
|
825
831
|
description: "Block helm commands",
|
|
826
832
|
match: { events: ["PreToolUse"], toolNames: ["Bash"] },
|
|
827
|
-
authority: "
|
|
833
|
+
authority: "reviewable",
|
|
834
|
+
reviewedBy: ["production-infra-change"],
|
|
828
835
|
defaultEnabled: false,
|
|
829
836
|
category: "Infra Commands",
|
|
830
837
|
params: {
|
|
@@ -858,7 +865,8 @@ var init_policy_catalog = __esm(() => {
|
|
|
858
865
|
impact: "Stops the agent from creating `.pem`, `id_rsa`, `credentials.json`, etc.",
|
|
859
866
|
description: "Block writing secret key files",
|
|
860
867
|
match: { events: ["PreToolUse"], toolNames: ["Write"] },
|
|
861
|
-
authority: "
|
|
868
|
+
authority: "reviewable",
|
|
869
|
+
reviewedBy: ["secret-exposure"],
|
|
862
870
|
defaultEnabled: false,
|
|
863
871
|
category: "Dangerous Commands",
|
|
864
872
|
params: {
|
|
@@ -892,7 +900,8 @@ var init_policy_catalog = __esm(() => {
|
|
|
892
900
|
impact: "Force-pushes rewrite history and can clobber teammates' work.",
|
|
893
901
|
description: "Prevent force-pushing to any branch",
|
|
894
902
|
match: { events: ["PreToolUse"], toolNames: ["Bash"] },
|
|
895
|
-
authority: "
|
|
903
|
+
authority: "reviewable",
|
|
904
|
+
reviewedBy: ["git-history-rewrite"],
|
|
896
905
|
defaultEnabled: false,
|
|
897
906
|
category: "Git"
|
|
898
907
|
},
|
|
@@ -934,6 +943,23 @@ var init_policy_catalog = __esm(() => {
|
|
|
934
943
|
defaultEnabled: false,
|
|
935
944
|
category: "Git"
|
|
936
945
|
},
|
|
946
|
+
{
|
|
947
|
+
name: "warn-git-clean",
|
|
948
|
+
displayTitle: "Tried to delete untracked or ignored files with git clean",
|
|
949
|
+
impact: "`git clean -fdx` takes `.env`, local config and unstaged work — git never had a copy of any of it.",
|
|
950
|
+
description: "Warns before git clean deletes untracked directories (-d) or ignored files (-x / -X)",
|
|
951
|
+
match: { events: ["PreToolUse"], toolNames: ["Bash"] },
|
|
952
|
+
authority: "hard",
|
|
953
|
+
defaultEnabled: false,
|
|
954
|
+
category: "Git",
|
|
955
|
+
params: {
|
|
956
|
+
destructiveFlags: {
|
|
957
|
+
type: "string[]",
|
|
958
|
+
description: "git clean flag letters that make it worth warning about, checked alongside --force. Narrow to ['x','X'] to allow `git clean -fd`, or widen with 'f' to warn on a bare `git clean -f`.",
|
|
959
|
+
default: ["d", "x", "X"]
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
},
|
|
937
963
|
{
|
|
938
964
|
name: "warn-all-files-staged",
|
|
939
965
|
displayTitle: "Staged all files with git add -A / .",
|
|
@@ -1136,7 +1162,7 @@ function instruct(reason) {
|
|
|
1136
1162
|
}
|
|
1137
1163
|
|
|
1138
1164
|
// package.json
|
|
1139
|
-
var version = "1.0.7-beta.
|
|
1165
|
+
var version = "1.0.7-beta.2";
|
|
1140
1166
|
var init_package = () => {};
|
|
1141
1167
|
|
|
1142
1168
|
// src/hooks/policy-types.ts
|
|
@@ -2055,7 +2081,7 @@ function stripShellQuoting(command) {
|
|
|
2055
2081
|
const ansiDecoded = joined.replace(/\$'((?:[^'\\]|\\.)*)'/g, (_, body) => decodeAnsiC(body));
|
|
2056
2082
|
return ansiDecoded.replace(/\\(.)/g, "$1").replace(/['"]/g, "");
|
|
2057
2083
|
}
|
|
2058
|
-
function
|
|
2084
|
+
function gitSubcommandIndex(args) {
|
|
2059
2085
|
for (let i = 0;i < args.length; i++) {
|
|
2060
2086
|
const arg = args[i];
|
|
2061
2087
|
if (GIT_FLAGS_WITH_OPERANDS.has(arg)) {
|
|
@@ -2064,9 +2090,13 @@ function gitSubcommand(args) {
|
|
|
2064
2090
|
}
|
|
2065
2091
|
if (arg.startsWith("-"))
|
|
2066
2092
|
continue;
|
|
2067
|
-
return
|
|
2093
|
+
return i;
|
|
2068
2094
|
}
|
|
2069
|
-
return;
|
|
2095
|
+
return -1;
|
|
2096
|
+
}
|
|
2097
|
+
function gitSubcommand(args) {
|
|
2098
|
+
const i = gitSubcommandIndex(args);
|
|
2099
|
+
return i < 0 ? undefined : args[i];
|
|
2070
2100
|
}
|
|
2071
2101
|
function globCouldNameState(raw) {
|
|
2072
2102
|
const stripped = raw.replace(/^[()]+|[()]+$/g, "");
|
|
@@ -3182,6 +3212,77 @@ function warnGitStashDrop(ctx) {
|
|
|
3182
3212
|
}
|
|
3183
3213
|
return allow();
|
|
3184
3214
|
}
|
|
3215
|
+
function readGitCleanFlags(args) {
|
|
3216
|
+
const letters = new Set;
|
|
3217
|
+
let force = false;
|
|
3218
|
+
let dryRun = false;
|
|
3219
|
+
let sawEndOfOptions = false;
|
|
3220
|
+
for (const token of args) {
|
|
3221
|
+
if (token === "--") {
|
|
3222
|
+
sawEndOfOptions = true;
|
|
3223
|
+
continue;
|
|
3224
|
+
}
|
|
3225
|
+
if (sawEndOfOptions)
|
|
3226
|
+
continue;
|
|
3227
|
+
if (token === "--force") {
|
|
3228
|
+
force = true;
|
|
3229
|
+
continue;
|
|
3230
|
+
}
|
|
3231
|
+
if (token === "--dry-run") {
|
|
3232
|
+
dryRun = true;
|
|
3233
|
+
continue;
|
|
3234
|
+
}
|
|
3235
|
+
if (token.startsWith("--"))
|
|
3236
|
+
continue;
|
|
3237
|
+
if (!SHORT_FLAG_CLUSTER_RE.test(token))
|
|
3238
|
+
continue;
|
|
3239
|
+
for (const letter of token.slice(1)) {
|
|
3240
|
+
if (letter === "f")
|
|
3241
|
+
force = true;
|
|
3242
|
+
if (letter === "n")
|
|
3243
|
+
dryRun = true;
|
|
3244
|
+
letters.add(letter);
|
|
3245
|
+
}
|
|
3246
|
+
}
|
|
3247
|
+
if (force)
|
|
3248
|
+
letters.add("f");
|
|
3249
|
+
return { force, dryRun, letters };
|
|
3250
|
+
}
|
|
3251
|
+
function gitCleanForceWaived(globalOptions) {
|
|
3252
|
+
for (let i = 0;i < globalOptions.length; i++) {
|
|
3253
|
+
const token = globalOptions[i];
|
|
3254
|
+
const value = token === "-c" ? globalOptions[i + 1] : token.startsWith("-c") ? token.slice(2) : undefined;
|
|
3255
|
+
if (value !== undefined && GIT_CLEAN_FORCE_WAIVED_RE.test(value))
|
|
3256
|
+
return true;
|
|
3257
|
+
}
|
|
3258
|
+
return false;
|
|
3259
|
+
}
|
|
3260
|
+
function warnGitClean(ctx) {
|
|
3261
|
+
if (ctx.toolName !== "Bash")
|
|
3262
|
+
return allow();
|
|
3263
|
+
const destructiveFlags = ctx.params?.destructiveFlags ?? GIT_CLEAN_DESTRUCTIVE_FLAGS;
|
|
3264
|
+
if (destructiveFlags.length === 0)
|
|
3265
|
+
return allow();
|
|
3266
|
+
for (const segment of shellSegments(getCommand(ctx))) {
|
|
3267
|
+
const tokens = parseArgvTokens(segment);
|
|
3268
|
+
const gitIdx = tokens.findIndex((t) => GIT_CMD_RE.test(t));
|
|
3269
|
+
if (gitIdx < 0)
|
|
3270
|
+
continue;
|
|
3271
|
+
const args = tokens.slice(gitIdx + 1);
|
|
3272
|
+
const subIdx = gitSubcommandIndex(args);
|
|
3273
|
+
if (subIdx < 0 || args[subIdx] !== "clean")
|
|
3274
|
+
continue;
|
|
3275
|
+
const flags = readGitCleanFlags(args.slice(subIdx + 1));
|
|
3276
|
+
if (flags.dryRun)
|
|
3277
|
+
continue;
|
|
3278
|
+
if (!flags.force && !gitCleanForceWaived(args.slice(0, subIdx)))
|
|
3279
|
+
continue;
|
|
3280
|
+
if (!destructiveFlags.some((f) => flags.letters.has(f)))
|
|
3281
|
+
continue;
|
|
3282
|
+
return instruct("STOP: This command deletes untracked files from the working tree (git clean). Git has no copy of " + "untracked or ignored files, so nothing it removes can be recovered: -d takes whole untracked " + "directories, and -x / -X also take .gitignore'd files such as .env, local config and scratch work. " + "Re-run it with --dry-run and confirm the exact paths with the user before executing.");
|
|
3283
|
+
}
|
|
3284
|
+
return allow();
|
|
3285
|
+
}
|
|
3185
3286
|
function warnAllFilesStaged(ctx) {
|
|
3186
3287
|
if (ctx.toolName !== "Bash")
|
|
3187
3288
|
return allow();
|
|
@@ -3567,7 +3668,7 @@ function registerBuiltinPolicies(enabledNames) {
|
|
|
3567
3668
|
}
|
|
3568
3669
|
}
|
|
3569
3670
|
}
|
|
3570
|
-
var isClaudeInternalPath, isClaudeSettingsFile, SHELL_OPERATORS, SHELL_METACHAR_RE, JWT_RE, API_KEY_PATTERNS, CONNECTION_STRING_RE, PRIVATE_KEY_RE, BEARER_TOKEN_RE, SECRET_PATTERNS, SQL_TOOL_RE, DESTRUCTIVE_SQL_RE, DELETE_NO_WHERE_RE, SQL_WHERE_RE, SCHEMA_ALTER_RE, PUBLISH_CMD_RE, ENV_PRINTENV_RE, ECHO_ENV_RE, EXPORT_RE, PS_ENV_VAR_RE, PS_CHILDITEM_ENV_RE, DOTNET_GETENV_RE, CMD_ECHO_ENV_RE, ENV_FILE_PATH_RE, ENV_CMD_RE, PS_ELEVATION_RE, RUNAS_RE, CURL_PIPE_SH_RE, SEGMENT_SEPARATORS, COMMAND_PREFIX_TOKENS, SELF_BINARY_TOKEN_RE, SELF_ENTRY_PATH_RE, CONFIG_SUBCOMMAND_RE, PAUSE_FLAG_RE, ENV_ASSIGNMENT_RE, RUNNER_OPERAND_RE, PS_WEB_PIPE_RE, SHORT_FLAG_BUNDLE_RE, SAFE_FORCE_PREFIXES, SECRET_FILE_RE, SECRET_FILE_ID_RSA_RE, SECRET_FILE_CREDENTIALS_RE, GIT_COMMIT_MERGE_RE, FAILPROOFAI_STATE_PATH_RE, STATE_READ_COMMANDS, SHELL_KEYWORD_PREFIXES, LOOP_HEADER_RE, COPY_COMMANDS, OPERAND_WRITE_COMMANDS, SECOND_OPERAND_WRITERS, OUTPUT_FLAG_COMMANDS, FIND_WRITE_ACTIONS, SAFE_EXEC_COMMANDS, GIT_DESTRUCTIVE_SUBCOMMANDS, GIT_FLAGS_WITH_OPERANDS, STATE_MENTION_COMMANDS, FIND_EXEC_ACTIONS, PIPELINE_SEPARATORS, VAR_REFERENCE_RE, STATE_GLOB_CANDIDATES, GLOB_DECOYS, BRACE_EXPANSION_LIMIT = 4096, BRACE_EXPANSION_ROUNDS = 24, GLOB_METACHAR_RE, REDIRECT_TARGET_RE, FAILPROOFAI_UNINSTALL_RE, GIT_AMEND_RE, GIT_STASH_DROP_RE, GIT_ADD_ALL_RE, NPM_GLOBAL_RE, YARN_GLOBAL_RE, PNPM_GLOBAL_RE, BUN_GLOBAL_RE, CARGO_INSTALL_RE, PIP_SYSTEM_RE, PKG_MANAGER_DETECTORS, NOHUP_RE, SCREEN_DETACH_RE, TMUX_DETACH_RE, DISOWN_RE, BACKGROUND_AMPERSAND_RE, KUBECTL_RE, TERRAFORM_RE, AWS_CLI_RE, GCLOUD_RE, AZ_CLI_RE, HELM_RE, GH_PIPELINE_RE, gitBranchCache, GIT_BRANCH_CACHE_MAX_ENTRIES = 500, EVAL_FLAG_RE, HOME_PREFIX_RE, RM_CMD_RE, FIND_CMD_RE, FIND_EXEC_RE, FIND_GLOBAL_OPT_RE, FIND_EXPR_START_RE, SCRATCH_ROOTS, CATASTROPHIC_DEPTH = 2, READ_LIKE_CMDS, TOOL_CALL_TRACKER_MAX_BYTES = 65536, SEGMENT_SPLIT_RE, POLICY_IMPLEMENTATIONS, BUILTIN_POLICIES;
|
|
3671
|
+
var isClaudeInternalPath, isClaudeSettingsFile, SHELL_OPERATORS, SHELL_METACHAR_RE, JWT_RE, API_KEY_PATTERNS, CONNECTION_STRING_RE, PRIVATE_KEY_RE, BEARER_TOKEN_RE, SECRET_PATTERNS, SQL_TOOL_RE, DESTRUCTIVE_SQL_RE, DELETE_NO_WHERE_RE, SQL_WHERE_RE, SCHEMA_ALTER_RE, PUBLISH_CMD_RE, ENV_PRINTENV_RE, ECHO_ENV_RE, EXPORT_RE, PS_ENV_VAR_RE, PS_CHILDITEM_ENV_RE, DOTNET_GETENV_RE, CMD_ECHO_ENV_RE, ENV_FILE_PATH_RE, ENV_CMD_RE, PS_ELEVATION_RE, RUNAS_RE, CURL_PIPE_SH_RE, SEGMENT_SEPARATORS, COMMAND_PREFIX_TOKENS, SELF_BINARY_TOKEN_RE, SELF_ENTRY_PATH_RE, CONFIG_SUBCOMMAND_RE, PAUSE_FLAG_RE, ENV_ASSIGNMENT_RE, RUNNER_OPERAND_RE, PS_WEB_PIPE_RE, SHORT_FLAG_BUNDLE_RE, SAFE_FORCE_PREFIXES, SECRET_FILE_RE, SECRET_FILE_ID_RSA_RE, SECRET_FILE_CREDENTIALS_RE, GIT_COMMIT_MERGE_RE, FAILPROOFAI_STATE_PATH_RE, STATE_READ_COMMANDS, SHELL_KEYWORD_PREFIXES, LOOP_HEADER_RE, COPY_COMMANDS, OPERAND_WRITE_COMMANDS, SECOND_OPERAND_WRITERS, OUTPUT_FLAG_COMMANDS, FIND_WRITE_ACTIONS, SAFE_EXEC_COMMANDS, GIT_DESTRUCTIVE_SUBCOMMANDS, GIT_FLAGS_WITH_OPERANDS, STATE_MENTION_COMMANDS, FIND_EXEC_ACTIONS, PIPELINE_SEPARATORS, VAR_REFERENCE_RE, STATE_GLOB_CANDIDATES, GLOB_DECOYS, BRACE_EXPANSION_LIMIT = 4096, BRACE_EXPANSION_ROUNDS = 24, GLOB_METACHAR_RE, REDIRECT_TARGET_RE, FAILPROOFAI_UNINSTALL_RE, GIT_AMEND_RE, GIT_STASH_DROP_RE, GIT_CMD_RE, SHORT_FLAG_CLUSTER_RE, GIT_CLEAN_FORCE_WAIVED_RE, GIT_CLEAN_DESTRUCTIVE_FLAGS, GIT_ADD_ALL_RE, NPM_GLOBAL_RE, YARN_GLOBAL_RE, PNPM_GLOBAL_RE, BUN_GLOBAL_RE, CARGO_INSTALL_RE, PIP_SYSTEM_RE, PKG_MANAGER_DETECTORS, NOHUP_RE, SCREEN_DETACH_RE, TMUX_DETACH_RE, DISOWN_RE, BACKGROUND_AMPERSAND_RE, KUBECTL_RE, TERRAFORM_RE, AWS_CLI_RE, GCLOUD_RE, AZ_CLI_RE, HELM_RE, GH_PIPELINE_RE, gitBranchCache, GIT_BRANCH_CACHE_MAX_ENTRIES = 500, EVAL_FLAG_RE, HOME_PREFIX_RE, RM_CMD_RE, FIND_CMD_RE, FIND_EXEC_RE, FIND_GLOBAL_OPT_RE, FIND_EXPR_START_RE, SCRATCH_ROOTS, CATASTROPHIC_DEPTH = 2, READ_LIKE_CMDS, TOOL_CALL_TRACKER_MAX_BYTES = 65536, SEGMENT_SPLIT_RE, POLICY_IMPLEMENTATIONS, BUILTIN_POLICIES;
|
|
3571
3672
|
var init_builtin_policies = __esm(() => {
|
|
3572
3673
|
init_policy_catalog();
|
|
3573
3674
|
init_policy_registry();
|
|
@@ -3836,6 +3937,10 @@ var init_builtin_policies = __esm(() => {
|
|
|
3836
3937
|
FAILPROOFAI_UNINSTALL_RE = /(?:npm\s+(?:uninstall|remove|un|r)\s.*failproofai|bun\s+remove\s.*failproofai|yarn\s+global\s+remove\s+failproofai|pnpm\s+(?:remove|uninstall|un)\s.*failproofai)/;
|
|
3837
3938
|
GIT_AMEND_RE = /\bgit\s+commit\b.*--amend\b/;
|
|
3838
3939
|
GIT_STASH_DROP_RE = /\bgit\s+stash\s+(?:drop|clear)\b/;
|
|
3940
|
+
GIT_CMD_RE = /^(?:\/\S*\/)?git$/;
|
|
3941
|
+
SHORT_FLAG_CLUSTER_RE = /^-[A-Za-z]+$/;
|
|
3942
|
+
GIT_CLEAN_FORCE_WAIVED_RE = /^clean\.requireforce=(?:false|0|no|off)$/i;
|
|
3943
|
+
GIT_CLEAN_DESTRUCTIVE_FLAGS = ["d", "x", "X"];
|
|
3839
3944
|
GIT_ADD_ALL_RE = /\bgit\s+add\s+(?:-A\b|--all\b|\.(?:\s|$|;|&&|\|\|))/;
|
|
3840
3945
|
NPM_GLOBAL_RE = /\bnpm\s+(?:install|i)\b(?=.*(?:\s-g\b|--global\b))/;
|
|
3841
3946
|
YARN_GLOBAL_RE = /\byarn\s+global\s+add\b/;
|
|
@@ -3904,6 +4009,7 @@ var init_builtin_policies = __esm(() => {
|
|
|
3904
4009
|
"block-work-on-main": blockWorkOnMain,
|
|
3905
4010
|
"warn-git-amend": warnGitAmend,
|
|
3906
4011
|
"warn-git-stash-drop": warnGitStashDrop,
|
|
4012
|
+
"warn-git-clean": warnGitClean,
|
|
3907
4013
|
"warn-all-files-staged": warnAllFilesStaged,
|
|
3908
4014
|
"warn-destructive-sql": warnDestructiveSql,
|
|
3909
4015
|
"warn-schema-alteration": warnSchemaAlteration,
|