failproofai 1.0.12-beta.0 → 1.0.12-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/required-server-files.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +2 -2
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/api/audit/invite/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/audit/run/route.js +22 -22
- package/.next/standalone/.next/server/app/api/audit/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/audit/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/login-request/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/login-verify/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/audit/page/server-reference-manifest.json +2 -2
- package/.next/standalone/.next/server/app/audit/page.js +1 -1
- package/.next/standalone/.next/server/app/audit/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/audit/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +3 -3
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +14 -14
- package/.next/standalone/.next/server/app/policies/page.js +4 -4
- package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +8 -8
- package/.next/standalone/.next/server/app/settings/page.js +7 -7
- package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/chunks/{[externals]__0-ha5ydqq0mws._.js → [externals]__0vt9i6fqinjne._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__20xe05hm5u8_1._.js → [root-of-the-server]__0f_4g-vazrvxv._.js} +1 -1
- package/.next/standalone/.next/server/chunks/_0hf5q4xzyg40j._.js +1 -1
- package/.next/standalone/.next/server/chunks/_0tovk6q0miud6._.js +1 -1
- package/.next/standalone/.next/server/chunks/_0trp3ycqv17cl._.js +1 -1
- package/.next/standalone/.next/server/chunks/_19011-u44143j._.js +1 -1
- package/.next/standalone/.next/server/chunks/_1ek68lnh2daur._.js +1 -1
- package/.next/standalone/.next/server/chunks/{_0kc-piux3hady._.js → _1y590mjzpkbos._.js} +2 -2
- package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4vkpxxu7._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_hooks_0_em82s16zfym._.js +5 -0
- package/.next/standalone/.next/server/chunks/src_hooks_builtin-policies_ts_1yq5ybgx1v98e._.js +3 -0
- package/.next/standalone/.next/server/chunks/src_hooks_custom-hooks-loader_ts_0lnb3n3h94wnn._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_hooks_daemon-client_ts_0il_yu1zc0291._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_hooks_fp-home_ts_09kv0bn_4twyh._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0588st-tpiuia._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__08ch3staq3ejw._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0vcyntk4snf0f._.js → [root-of-the-server]__0b78b0j8iyv6l._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0bigvy9xmv2ka._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h86bl2qf0k_o._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1_xbg2kx30wp-._.js → [root-of-the-server]__0naevg4bcoh54._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0pia5h3p8re4c._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1-ey9fgesfbc0._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__15usvs-ms-0hf._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__16gb3_92zvk5x._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1avi2kypusyb_._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1r7drlqli-ado._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0eoura3_9gjb-._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0pedwblqdoh58._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_128ebxr83nk6g._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_1gb0ifpkowwub._.js → _1a3tubds7s7ow._.js} +10 -9
- package/.next/standalone/.next/server/chunks/ssr/_1djqs9i27e4kg._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_next-internal_server_app_policies_page_actions_1sp2-yo5_vm5f.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/app_actions_get-scheduled-audit_ts_0ei9snixb5fd-._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_audit__components_audit-dashboard_tsx_0p9ud47q0xq5w._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_1kp6l3x33jqb6._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_19dqvpcz0uxur._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_settings_02tf1h47jmhhd._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_html-to-image_es_index_00jxj8foxqz5t.js → node_modules_html-to-image_es_index_1i8oid1gc7s1f.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/package_json_[json]_cjs_013tntikdft59._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_06kzv9ddabn3_._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_0agdmptetetdt._.js +5 -0
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_0mdwgjisv4fub._.js +5 -0
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_1cv9_c4l1tzrm._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_daemon-client_ts_0k41_i7jg6ndv._.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/preview-props.json +3 -3
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +23 -23
- package/.next/standalone/.next/static/chunks/{3tn1bzk094e8e.js → 0_zfad4co-t2z.js} +1 -1
- package/.next/standalone/.next/static/chunks/0jutamwqz8pg5.js +1 -0
- package/.next/standalone/.next/static/chunks/{2meqb9kygrncb.js → 114hbolvrv94e.js} +1 -1
- package/.next/standalone/.next/static/chunks/{2znt1784j9gd9.js → 18433qz-8njv3.js} +1 -1
- package/.next/standalone/.next/static/chunks/1b32-afqacaen.js +1 -0
- package/.next/standalone/.next/static/chunks/{13jv-xvabeb62.js → 1p-hsi58i-6h0.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0pjxnp927y7_j.js → 2-tf6_7u623kd.js} +1 -1
- package/.next/standalone/.next/static/chunks/{2qz5piiir-qqm.js → 24w3x2da9sk49.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0a-ccsp3xmypz.js → 3-pku9qwv1yfu.js} +1 -1
- package/.next/standalone/.next/static/chunks/42e8zab314654.js +1 -0
- package/.next/standalone/fp-cloud-cli/CHANGELOG.md +41 -0
- package/.next/standalone/fp-cloud-cli/README.md +42 -1
- package/.next/standalone/fp-cloud-cli/fp_cli/client.py +117 -12
- package/.next/standalone/fp-cloud-cli/fp_cli/commands/fleet_cmds.py +285 -19
- package/.next/standalone/fp-cloud-cli/fp_cli/commands/policies_cmds.py +84 -18
- package/.next/standalone/fp-cloud-cli/fp_cli/enforcement.py +170 -6
- package/.next/standalone/fp-cloud-cli/fp_cli/models.py +89 -6
- package/.next/standalone/fp-cloud-cli/fp_cli/output.py +259 -21
- package/.next/standalone/fp-cloud-cli/fp_cli/policy_check.py +8 -5
- package/.next/standalone/fp-cloud-cli/skill/SKILL.md +2 -2
- package/.next/standalone/fp-cloud-cli/skill/references/commands.md +17 -9
- package/.next/standalone/fp-cloud-cli/tests/test_cloud_jev.py +692 -0
- package/.next/standalone/fp-cloud-cli/tests/test_enforcement_logic.py +46 -0
- package/.next/standalone/fp-cloud-cli/tests/test_output.py +23 -0
- package/.next/standalone/hermes-plugin/README.md +6 -4
- package/.next/standalone/hermes-plugin/__init__.py +16 -0
- package/.next/standalone/hermes-plugin/client.py +5 -1
- package/.next/standalone/hermes-plugin/plugin.yaml +1 -1
- package/.next/standalone/package.json +9 -9
- package/.next/standalone/server.js +1 -1
- package/bin/failproofai.mjs +17 -1
- package/dist/cli.mjs +2930 -1747
- package/dist/worker.mjs +1450 -145
- package/hermes-plugin/README.md +6 -4
- package/hermes-plugin/__init__.py +16 -0
- package/hermes-plugin/client.py +5 -1
- package/hermes-plugin/plugin.yaml +1 -1
- package/package.json +9 -9
- package/src/audit/open-browser.ts +1 -19
- package/src/hooks/agent-roster.ts +172 -0
- package/src/hooks/agent-targets.ts +60 -0
- package/src/hooks/cloud-connection.ts +97 -27
- package/src/hooks/cloud-enrollment-cli.ts +7 -4
- package/src/hooks/cloud-introspect.ts +2 -5
- package/src/hooks/cloud-managed-policies.ts +380 -20
- package/src/hooks/cloud-policy-errors.ts +481 -0
- package/src/hooks/config-status.ts +1 -1
- package/src/hooks/configure-wizard.ts +15 -311
- package/src/hooks/custom-hooks-loader.ts +26 -3
- package/src/hooks/daemon-client.ts +9 -4
- package/src/hooks/daemon-service.ts +2 -1
- package/src/hooks/effective-reviewers.ts +22 -1
- package/src/hooks/fp-home.ts +6 -0
- package/src/hooks/handler.ts +235 -18
- package/src/hooks/health-probe.ts +15 -0
- package/src/hooks/integrations.ts +18 -11
- package/src/hooks/jev-cli.ts +197 -0
- package/src/hooks/jev-cloud-connection.ts +92 -0
- package/src/hooks/manager.ts +122 -16
- package/src/hooks/pack-failclosed.ts +2 -0
- package/src/hooks/pack-manifest.ts +8 -1
- package/src/hooks/policy-evaluator.ts +5 -1
- package/src/hooks/policy-registry.ts +3 -2
- package/src/hooks/policy-reviewability.ts +21 -5
- package/src/hooks/semantic/cloud-jev-health.ts +227 -0
- package/src/hooks/semantic/cloud-jev.ts +677 -0
- package/src/hooks/semantic/jev-client.ts +18 -1
- package/src/hooks/semantic/jev-config.ts +173 -3
- package/src/hooks/semantic/jev-review.ts +129 -10
- package/src/hooks/semantic/pack-policies.ts +2 -1
- package/src/hooks/semantic/types.ts +8 -0
- package/src/hooks/session-pause-cli.ts +1 -1
- package/src/hooks/tui.ts +0 -271
- package/src/hooks/worker-server.ts +5 -1
- package/.next/standalone/.next/server/chunks/src_hooks_1aveq0uhs2t1b._.js +0 -5
- package/.next/standalone/.next/server/chunks/src_hooks_1eem5a7cyqlb2._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ts0fg5yih1c1._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_1ve8y151ua7qx._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_effective-reviewers_ts_1h4wtvo55j16x._.js +0 -5
- package/.next/standalone/.next/static/chunks/2ank2u3apy8m6.js +0 -1
- package/.next/standalone/.next/static/chunks/2ohktp_-lkv3x.js +0 -1
- package/.next/standalone/.next/static/chunks/2py0eldhwz8ay.js +0 -1
- package/src/hooks/cloud-login.ts +0 -245
- /package/.next/standalone/.next/static/{SNr7o_-G4kNBQTR-iLZMM → xq8UgF5yFxty1VWxY2hyn}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{SNr7o_-G4kNBQTR-iLZMM → xq8UgF5yFxty1VWxY2hyn}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{SNr7o_-G4kNBQTR-iLZMM → xq8UgF5yFxty1VWxY2hyn}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[73634,38791,71194,e=>{"use strict";var t=e.i(50227),i=e.i(2157),n=e.i(12714),r=e.i(74533),a=e.i(60526);let o=[{name:"sanitize-jwt",description:"Stop Claude from reading JWTs in tool responses",displayTitle:"Redacted JWT tokens from tool output",impact:"Stops the agent from echoing auth tokens it saw in command output.",match:{events:["PostToolUse"]},authority:"hard",defaultEnabled:!0,category:"Sanitize"},{name:"sanitize-api-keys",description:"Stop Claude from reading API keys (OpenAI, Anthropic, GitHub, AWS, Stripe, Google) in tool responses",displayTitle:"Redacted API keys from tool output",impact:"Catches OpenAI / Anthropic / GitHub / AWS / Stripe / Google keys before the model sees them.",match:{events:["PostToolUse"]},authority:"hard",defaultEnabled:!0,category:"Sanitize",params:{additionalPatterns:{type:"pattern[]",description:"Additional API key patterns to scrub, each with { regex, label }",default:[]}}},{name:"sanitize-connection-strings",description:"Stop Claude from reading database connection strings with embedded credentials in tool responses",displayTitle:"Redacted database connection strings from tool output",impact:"Strips embedded DB credentials before they reach the model context.",match:{events:["PostToolUse"]},authority:"hard",defaultEnabled:!0,category:"Sanitize"},{name:"sanitize-private-key-content",description:"Stop Claude from reading PEM private key content in tool responses",displayTitle:"Redacted PEM private keys from tool output",impact:"Prevents private key bodies from being echoed into chat context.",match:{events:["PostToolUse"]},authority:"hard",defaultEnabled:!0,category:"Sanitize"},{name:"sanitize-bearer-tokens",displayTitle:"Redacted bearer tokens from tool output",impact:"Strips Authorization: Bearer values before they hit the model.",description:"Stop Claude from reading Authorization Bearer tokens in tool responses",match:{events:["PostToolUse"]},authority:"hard",defaultEnabled:!0,category:"Sanitize"},{name:"protect-env-vars",displayTitle:"Tried to dump environment variables to chat",impact:"Env vars often contain secrets; blocking `env` / `printenv` keeps them out of the model context.",description:"Prevent commands that read environment variables",match:{events:["PreToolUse"],toolNames:["Bash"]},authority:"reviewable",reviewedBy:["env-secrets-dump","secret-exposure"],defaultEnabled:!0,category:"Environment"},{name:"block-env-files",displayTitle:"Tried to read or write a .env file",impact:"`.env` files routinely contain API keys and DB credentials.",description:"Block reading/writing .env files",match:{events:["PreToolUse"]},authority:"reviewable",reviewedBy:["secret-exposure"],defaultEnabled:!0,category:"Environment"},{name:"block-read-outside-cwd",displayTitle:"Tried to read files outside your project directory",impact:"Stops the agent from peeking at neighboring repos or your home directory.",description:"Block file reads outside the session working directory",match:{events:["PreToolUse"],toolNames:["Read","Glob","Grep","Bash"]},authority:"reviewable",reviewedBy:["read-outside-workspace"],defaultEnabled:!1,category:"Environment",params:{allowPaths:{type:"string[]",description:"Absolute paths outside cwd that are allowed to be read",default:[]}}},{name:"block-sudo",displayTitle:"Tried to run a command with sudo",impact:"Sudo gives the agent root — blocked unless explicitly allow-listed.",description:"Block sudo commands",match:{events:["PreToolUse","PermissionRequest"],toolNames:["Bash"]},authority:"hard",defaultEnabled:!0,category:"Dangerous Commands",params:{allowPatterns:{type:"string[]",description:"Sudo command patterns to allow, matched token-by-token (e.g. 'sudo systemctl status')",default:[]}}},{name:"block-curl-pipe-sh",displayTitle:"Tried to pipe a downloaded script straight to a shell",impact:"`curl ... | sh` runs unverified remote code on your machine.",description:"Block piping downloads to shell",match:{events:["PreToolUse"],toolNames:["Bash"]},authority:"hard",defaultEnabled:!0,category:"Dangerous Commands"},{name:"block-rm-rf",displayTitle:"Tried to recursively delete a system path",impact:"Catches catastrophic `rm -rf /` and Windows equivalents.",description:"Prevent catastrophic deletions",match:{events:["PreToolUse"],toolNames:["Bash"]},authority:"reviewable",reviewedBy:["destructive-deletion"],defaultEnabled:!1,category:"Dangerous Commands",params:{allowPaths:{type:"string[]",description:"Paths that are allowed to be recursively deleted",default:[]}}},{name:"block-failproofai-commands",displayTitle:"Tried to disable, pause or modify failproofai itself",impact:"An agent that can pause or remove enforcement can switch off every other policy.",description:"Block failproofai CLI commands, self-pause and uninstallation",match:{events:["PreToolUse","PermissionRequest"],toolNames:["Bash","Write","Edit","NotebookEdit"]},defaultEnabled:!0,alwaysOn:!0,authority:"hard",category:"Dangerous Commands"},{name:"block-kubectl",displayTitle:"Tried to run a Kubernetes command",impact:"kubectl can change live cluster state — gated unless allow-listed.",description:"Block kubectl commands (Kubernetes cluster mutations)",match:{events:["PreToolUse"],toolNames:["Bash"]},authority:"reviewable",reviewedBy:["production-infra-change"],defaultEnabled:!1,category:"Infra Commands",params:{allowPatterns:{type:"string[]",description:"kubectl command patterns to allow, matched token-by-token (e.g. 'kubectl get *', 'kubectl describe *')",default:[]}}},{name:"block-terraform",displayTitle:"Tried to run a Terraform/OpenTofu command",impact:"Terraform mutates real infrastructure — gated unless allow-listed.",description:"Block terraform and tofu (OpenTofu) commands",match:{events:["PreToolUse"],toolNames:["Bash"]},authority:"reviewable",reviewedBy:["production-infra-change"],defaultEnabled:!1,category:"Infra Commands",params:{allowPatterns:{type:"string[]",description:"terraform/tofu command patterns to allow (e.g. 'terraform plan', 'terraform validate')",default:[]}}},{name:"block-aws-cli",displayTitle:"Tried to run an AWS CLI command",impact:"AWS CLI can spend money or break prod — gated.",description:"Block aws CLI commands",match:{events:["PreToolUse"],toolNames:["Bash"]},authority:"reviewable",reviewedBy:["production-infra-change"],defaultEnabled:!1,category:"Infra Commands",params:{allowPatterns:{type:"string[]",description:"aws CLI command patterns to allow (e.g. 'aws s3 ls *', 'aws sts get-caller-identity')",default:[]}}},{name:"block-gcloud",displayTitle:"Tried to run a Google Cloud command",impact:"gcloud can spend money or break prod — gated.",description:"Block gcloud (Google Cloud) CLI commands",match:{events:["PreToolUse"],toolNames:["Bash"]},authority:"reviewable",reviewedBy:["production-infra-change"],defaultEnabled:!1,category:"Infra Commands",params:{allowPatterns:{type:"string[]",description:"gcloud command patterns to allow (e.g. 'gcloud auth list', 'gcloud config list')",default:[]}}},{name:"block-az-cli",displayTitle:"Tried to run an Azure CLI command",impact:"az can spend money or break prod — gated.",description:"Block az (Azure) CLI commands",match:{events:["PreToolUse"],toolNames:["Bash"]},authority:"reviewable",reviewedBy:["production-infra-change"],defaultEnabled:!1,category:"Infra Commands",params:{allowPatterns:{type:"string[]",description:"az CLI command patterns to allow (e.g. 'az account show', 'az group list')",default:[]}}},{name:"block-helm",displayTitle:"Tried to run a Helm command",impact:"Helm releases mutate cluster state — gated.",description:"Block helm commands",match:{events:["PreToolUse"],toolNames:["Bash"]},authority:"reviewable",reviewedBy:["production-infra-change"],defaultEnabled:!1,category:"Infra Commands",params:{allowPatterns:{type:"string[]",description:"helm command patterns to allow (e.g. 'helm list', 'helm status *')",default:[]}}},{name:"block-gh-pipeline",displayTitle:"Tried to run a privileged GitHub CLI pipeline command",impact:"Catches `gh workflow run`, `gh pr merge`, `gh secret set`, etc.",description:"Block gh CLI pipeline-trigger subcommands (workflow run, run rerun/cancel, pr merge, release create/delete, cache delete, secret set/delete)",match:{events:["PreToolUse"],toolNames:["Bash"]},authority:"hard",defaultEnabled:!1,category:"Infra Commands",params:{allowPatterns:{type:"string[]",description:"gh pipeline command patterns to allow (e.g. specific scripted invocations); read-only gh subcommands like 'gh pr view' and 'gh run list' are not matched by this policy",default:[]}}},{name:"block-secrets-write",displayTitle:"Tried to write a secret-key file",impact:"Stops the agent from creating `.pem`, `id_rsa`, `credentials.json`, etc.",description:"Block writing secret key files",match:{events:["PreToolUse"],toolNames:["Write"]},authority:"reviewable",reviewedBy:["secret-exposure"],defaultEnabled:!1,category:"Dangerous Commands",params:{additionalPatterns:{type:"string[]",description:"Additional filename patterns (substrings) to block",default:[]}}},{name:"block-push-master",displayTitle:"Tried to push directly to main/master",impact:"Direct pushes to a protected branch bypass review.",description:"Block pushing to main/master",match:{events:["PreToolUse"],toolNames:["Bash"]},authority:"hard",defaultEnabled:!0,category:"Git",params:{protectedBranches:{type:"string[]",description:"Branch names to protect from direct pushes",default:["main","master"]}}},{name:"block-force-push",displayTitle:"Tried to force-push",impact:"Force-pushes rewrite history and can clobber teammates' work.",description:"Prevent force-pushing to any branch",match:{events:["PreToolUse"],toolNames:["Bash"]},authority:"reviewable",reviewedBy:["git-history-rewrite"],defaultEnabled:!1,category:"Git"},{name:"block-work-on-main",displayTitle:"Tried to commit or merge on main/master",impact:"Work should land via PR — direct commits skip review.",description:"Block git commits and merges on main/master branch",match:{events:["PreToolUse"],toolNames:["Bash"]},authority:"hard",defaultEnabled:!1,category:"Git",params:{protectedBranches:{type:"string[]",description:"Branch names where commits/merges are blocked",default:["main","master"]}}},{name:"warn-git-amend",displayTitle:"Used git commit --amend",impact:"Amending after a push rewrites history that others may have pulled.",description:"Warns before amending git commits, which rewrites history",match:{events:["PreToolUse"],toolNames:["Bash"]},authority:"reviewable",reviewedBy:["git-history-rewrite"],defaultEnabled:!1,category:"Git"},{name:"warn-git-stash-drop",displayTitle:"Tried to drop or clear git stash",impact:"Stash deletions are permanent and silent.",description:"Warns before permanently deleting stashed changes",match:{events:["PreToolUse"],toolNames:["Bash"]},authority:"hard",defaultEnabled:!1,category:"Git"},{name:"warn-git-clean",displayTitle:"Tried to delete untracked or ignored files with git clean",impact:"`git clean -fdx` takes `.env`, local config and unstaged work — git never had a copy of any of it.",description:"Warns before git clean deletes untracked directories (-d) or ignored files (-x / -X)",match:{events:["PreToolUse"],toolNames:["Bash"]},authority:"hard",defaultEnabled:!1,category:"Git",params:{destructiveFlags:{type:"string[]",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`.",default:["d","x","X"]}}},{name:"warn-all-files-staged",displayTitle:"Staged all files with git add -A / .",impact:"Wide stages routinely catch generated files or secrets you didn't intend to commit.",description:"Warns before staging all working tree files with git add -A / . / --all",match:{events:["PreToolUse"],toolNames:["Bash"]},authority:"hard",defaultEnabled:!1,category:"Git"},{name:"warn-destructive-sql",displayTitle:"Ran destructive SQL (DROP / TRUNCATE / DELETE without WHERE)",impact:"Easy way to wipe a table by accident.",description:"Warn before executing destructive SQL (DROP/TRUNCATE/DELETE without WHERE) via database clients",match:{events:["PreToolUse"],toolNames:["Bash"]},authority:"reviewable",reviewedBy:["database-destruction"],defaultEnabled:!1,category:"Database"},{name:"warn-schema-alteration",displayTitle:"Altered a database schema column",impact:"ALTER TABLE operations can lock tables and break readers.",description:"Warns before SQL schema changes (ALTER TABLE with column or rename operations)",match:{events:["PreToolUse"],toolNames:["Bash"]},authority:"hard",defaultEnabled:!1,category:"Database"},{name:"warn-package-publish",displayTitle:"Tried to publish a package",impact:"Publishes are irreversible — `npm publish` / `cargo publish` shouldn't happen without intent.",description:"Warn before publishing packages to public registries (npm, PyPI, crates.io, RubyGems, etc.)",match:{events:["PreToolUse"],toolNames:["Bash"]},authority:"hard",defaultEnabled:!1,category:"Packages & System"},{name:"warn-global-package-install",displayTitle:"Installed a package globally",impact:"`npm i -g`, `cargo install`, `pip --user` pollute your machine outside the project.",description:"Warns before installing packages globally (npm -g, cargo install, etc.)",match:{events:["PreToolUse"],toolNames:["Bash"]},authority:"reviewable",reviewedBy:["system-modification"],defaultEnabled:!1,category:"Packages & System"},{name:"prefer-package-manager",displayTitle:"Used a non-preferred package manager",impact:"Mixing package managers creates lockfile churn for your team.",description:"Blocks non-preferred package managers and tells Claude to use an allowed one (e.g., uv instead of pip)",match:{events:["PreToolUse"],toolNames:["Bash"]},authority:"hard",defaultEnabled:!1,category:"Packages & System",params:{allowed:{type:"string[]",description:"Allowed package manager names (e.g. ['uv', 'bun']). Any detected manager not in this list is blocked.",default:[]},blocked:{type:"string[]",description:"Additional manager names to block beyond the built-in list (e.g. ['pdm', 'pipx']).",default:[]}}},{name:"warn-large-file-write",displayTitle:"Wrote a file larger than the configured threshold",impact:"Catches accidentally large file writes (logs, binaries, model dumps).",description:"Warn before writing files larger than 1MB (configurable via thresholdKb param)",match:{events:["PreToolUse"],toolNames:["Write"]},authority:"hard",defaultEnabled:!1,category:"Packages & System",params:{thresholdKb:{type:"number",description:"File size threshold in KB above which a warning is issued",default:1024}}},{name:"warn-background-process",displayTitle:"Started a long-lived background process",impact:"Catches `nohup` / `&` / `screen` / `tmux` / `disown` patterns that the agent often forgets to clean up.",description:"Warns before starting detached or background processes",match:{events:["PreToolUse"],toolNames:["Bash"]},authority:"hard",defaultEnabled:!1,category:"Packages & System"},{name:"warn-repeated-tool-calls",displayTitle:"Called the same tool 3+ times with identical arguments",impact:"Usually a sign of a stuck loop burning tokens.",description:"Warn when the same tool is called 3+ times with identical parameters",match:{events:["PreToolUse"]},authority:"hard",defaultEnabled:!1,category:"AI Behavior"},{name:"require-commit-before-stop",displayTitle:"Stopped with uncommitted changes",impact:"Work not in a commit is invisible to teammates and easy to lose.",description:"Require all changes to be committed before Claude stops",match:{events:["Stop"]},authority:"hard",defaultEnabled:!1,category:"Workflow"},{name:"require-push-before-stop",displayTitle:"Stopped with unpushed commits",impact:"Local-only commits won't trigger CI or be reviewable.",description:"Require all commits to be pushed to remote before Claude stops",match:{events:["Stop"]},authority:"hard",defaultEnabled:!1,category:"Workflow",params:{remote:{type:"string",description:"Remote name to push to (default: origin)",default:"origin"},baseBranch:{type:"string",description:"Base branch to compare against (default: main)",default:"main"}}},{name:"require-pr-before-stop",displayTitle:"Stopped without a PR for the branch",impact:"Branches without PRs don't get reviewed.",description:"Require a pull request to exist for the current branch before Claude stops",match:{events:["Stop"]},authority:"hard",defaultEnabled:!1,category:"Workflow",params:{baseBranch:{type:"string",description:"Base branch to compare against (default: main)",default:"main"}}},{name:"require-no-conflicts-before-stop",displayTitle:"Stopped with a branch that conflicts with main",impact:"Conflicting branches can't merge — surface them early.",description:"Require the current branch to merge cleanly with the base branch before Claude stops",match:{events:["Stop"]},authority:"hard",defaultEnabled:!1,category:"Workflow",params:{baseBranch:{type:"string",description:"Base branch to check for conflicts against (default: main)",default:"main"}}},{name:"require-ci-green-before-stop",displayTitle:"Stopped with failing CI",impact:"Failing CI blocks deploy.",description:"Require CI checks to pass on the current HEAD commit before Claude stops (ignores stale runs on prior commits)",match:{events:["Stop"]},authority:"hard",defaultEnabled:!1,category:"Workflow"}];function s(e){return e?{decision:"allow",reason:e}:{decision:"allow"}}function l(e){return{decision:"deny",reason:e}}function c(e){return{decision:"instruct",reason:e}}var u=e.i(16774),d=e.i(99891);let p="__FAILPROOFAI_POLICY_REGISTRY__",m="__FAILPROOFAI_POLICY_INDEX_CACHE__",f="failproofai";function h(e){return e.includes("/")?e:`${f}/${e}`}function g(e){globalThis[m]=e}function b(){let e=globalThis;return e[p]||(e[p]=[]),e[p]}function y(e,t,i,n,r=0,a,o){let s=h(e),l=b(),c=l.findIndex(e=>e.name===s),p=o?(0,d.d)(o,(0,u.j)()):void 0,m={name:s,description:t,fn:i,match:n,priority:r,...a?{params:a}:{},...p?{authority:p.authority}:{},...p?.reviewedBy?{reviewedBy:p.reviewedBy}:{}};c>=0?l[c]=m:l.push(m),g(null)}e.s(["l",0,f,"G",0,function(e,t=null){globalThis[p]=[],g(null),(0,u.Z)(e,t)},"Z",0,function(){return[...b()]},"w",0,function(e,t){let i=globalThis[m];i||g(i=new Map);let n=`${e}:${t??""}`,r=i.get(n);if(r)return r;let a=b().filter(i=>(!i.match.events||!(i.match.events.length>0)||!!i.match.events.includes(e))&&(!i.match.toolNames||!(i.match.toolNames.length>0)||!!t&&!!i.match.toolNames.includes(t))).sort((e,t)=>t.priority-e.priority);return i.set(n,a),a},"o",0,h,"T",0,y,"c",0,function(e){globalThis[p]=[...e],g(null)}],38791);var k=e.i(97348);let w=function(e){let i=e.replaceAll("\\","/");for(let e of[".claude",".codex",".copilot",".cursor",".opencode",".pi",".gemini"]){let n=(0,t.join)((0,a.homedir)(),e).replaceAll("\\","/");if(i===n||i.startsWith(n+"/"))return!0}for(let e of[(0,t.join)(".config","opencode"),(0,t.join)(".local","share","opencode")]){let n=(0,t.join)((0,a.homedir)(),e).replaceAll("\\","/");if(i===n||i.startsWith(n+"/"))return!0}return!1},v=function(e){return!!(/[\\/]\.claude[\\/]settings(?:\.[^/\\]+)?\.json$/.test(e)||/[\\/]\.codex[\\/]hooks\.json$/.test(e)||/[\\/]\.copilot[\\/]hooks[\\/][^/\\]+\.json$/.test(e)||/[\\/]\.github[\\/]hooks[\\/][^/\\]+\.json$/.test(e)||/[\\/]\.cursor[\\/]hooks\.json$/.test(e)||/[\\/]\.opencode[\\/]opencode\.jsonc?$/.test(e)||/[\\/]\.opencode[\\/]plugins[\\/][^/\\]+\.(?:mjs|js|ts)$/.test(e)||/[\\/]\.config[\\/]opencode[\\/]opencode\.jsonc?$/.test(e)||/[\\/]\.config[\\/]opencode[\\/]config\.json$/.test(e)||/[\\/]\.config[\\/]opencode[\\/]plugins[\\/][^/\\]+\.(?:mjs|js|ts)$/.test(e)||/[\\/]\.pi[\\/](?:agent[\\/])?settings\.json$/.test(e)||/[\\/]\.pi[\\/](?:agent[\\/])?extensions[\\/]/.test(e)||/[\\/]\.gemini[\\/]settings\.json$/.test(e)||/[\\/]\.gemini[\\/]config[\\/]hooks\.json$/.test(e))};function $(e){return e.toolInput?.command??""}function T(e){return e.toolInput?.file_path??""}function A(e){return e.trim().split(/\s+/).map(e=>e.replace(/^['"]|['"]$/g,""))}let E=new Set(["&&","||","|",";"]),S=/[;&<>`$()\\]/,P=/eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}/,B=[[/sk-ant-[A-Za-z0-9\-_]{20,}/,"Anthropic API key"],[/sk-proj-[A-Za-z0-9\-_]{20,}/,"OpenAI project API key"],[/sk-[A-Za-z0-9]{20,}/,"OpenAI API key"],[/ghp_[A-Za-z0-9]{36}/,"GitHub personal access token"],[/github_pat_[A-Za-z0-9_]{82}/,"GitHub fine-grained token"],[/AKIA[A-Z0-9]{16}/,"AWS access key ID"],[/sk_live_[A-Za-z0-9]{24,}/,"Stripe live secret key"],[/sk_test_[A-Za-z0-9]{24,}/,"Stripe test secret key"],[/AIza[0-9A-Za-z\-_]{35}/,"Google API key"]],C=/(?:postgresql|postgres|mysql|mongodb(?:\+srv)?|redis|amqps?|smtps?):\/\/[^@\s]+@/,x=/-----BEGIN (?:[A-Z]+ )?PRIVATE KEY-----/,N=/Authorization:\s*Bearer\s+[A-Za-z0-9\-._~+/]{20,}/i,I=[[x,"private key"],[P,"JWT"],[N,"bearer token"],[C,"database credentials"],...B],R=/\b(?:psql|mysql|sqlite3|pgcli|clickhouse-client)\b/,W=/\b(?:DROP\s+(?:TABLE|DATABASE|SCHEMA)|TRUNCATE\b)/i,O=/\bDELETE\s+FROM\b/i,z=/\bWHERE\b/i,D=/\bALTER\s+TABLE\b[\s\S]*\b(?:DROP\s+COLUMN|ADD\s+COLUMN|RENAME\s+(?:COLUMN|TO)|MODIFY\s+COLUMN)\b/i,j=/(?:npm\s+publish|bun\s+publish|pnpm\s+publish|yarn\s+npm\s+publish|twine\s+upload|poetry\s+publish|cargo\s+publish|gem\s+push)\b/,_=/(?:^|\s|;|&&|\|\|)(?:env|printenv)(?:\s|$|;|&&|\|)/,U=/echo\s+.*\$\{?[A-Za-z_]/,L=/(?:^|\s|;|&&|\|\|)export\s+\w+/,H=/(?:^|[;&|({\n`'"]|\$\()\s*(?:set|export(?:\s+-p)?)\s*(?:$|[|;&>)\n])|\b(?:declare|typeset)\s+-[A-Za-z]*[xp]|\bcompgen\s+-[A-Za-z]*[ev]|\/proc\/(?:self|thread-self|\d+|\$\$|\$BASHPID)\/environ/,Z=/\b(?:python[\d.]*|node|bun|deno)\b/,q=/\bos\.environ(?!\s*\[|\.(?:get|setdefault|pop|update)\b)|\bprocess\.env(?![.\[\w])/,G=/\$env:[A-Za-z_]/i,F=/(?:Get-ChildItem|dir|gci|ls)\s+Env:/i,M=/\[Environment\]::GetEnvironment/i,J=/echo\s+%[A-Za-z_]/i,K=/(?:^|[\\/])\.env(?:\.|$)/,Y=/\.env(?:\b|\s|$|\.)/,X=/Start-Process\s+.*-Verb\s+RunAs/i,Q=/(?:^|;|&&|\|\|)\s*runas\s/i,V=/(?:curl|wget)\s.*\|\s*(?:sh|bash|zsh|dash|ksh|csh|tcsh|fish|ash)\b/,ee=/[;&|\n\r(){}`]+/,et=new Set(["npx","bunx","pnpx","npm","pnpm","yarn","dlx","exec","run","eval","node","bun","deno","env","command","builtin","nohup","setsid","time","timeout","nice","stdbuf","xargs","sudo","doas","sh","bash","zsh","dash","ksh","fish","ash"]),ei=/(?:^|\/)failproofai[^/]*$/,en=/failproofai\/(?:dist\/(?:cli|index)\.mjs|bin\/failproofai\.mjs)$/,er=/^(?:config|configure|setup)$/,ea=/^--pause(?:=|$)/,eo=/^[A-Za-z_][A-Za-z0-9_]*=/,es=/^\d+[a-z]*$/i;function el(e){let t=e.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g,"$$$1"),i=null,n=new Set;for(let[,e,i]of t.matchAll(/(?:^|[\s;&|])([A-Za-z_][A-Za-z0-9_]*)=("[^"]*"|'[^']*'|[^\s;&|]+)/g)){let t=i.replace(/^["']|["']$/g,"");(ei.test(t)||en.test(t))&&n.add(e)}let r=e=>{let t=/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(e);return!!t&&n.has(t[1])};for(let e of t.split(ee)){let t=e.split(/\s+/).filter(Boolean),n=0;for(;n<t.length;){let e=t[n];if(!(eo.test(e)||e.startsWith("-")||e.startsWith(">")||e.startsWith("<")||es.test(e)||et.has(e.slice(e.lastIndexOf("/")+1))))break;n++}if(n>=t.length||!ei.test(t[n])&&!en.test(t[n])&&!r(t[n]))continue;let a=t.slice(n+1),o=a.findIndex(e=>er.test(e));if(-1!==o&&a.slice(o+1).some(e=>ea.test(e)))return"pause";i="cli"}return i}let ec=/(?:Invoke-WebRequest|iwr|Invoke-RestMethod|irm)\s+.*\|\s*(?:Invoke-Expression|iex)/i,eu=/^-[a-zA-Z]*f[a-zA-Z]*$/,ed=["--force-with-lease","--force-if-includes"],ep=/\.(?:pem|key)$/,em=/id_rsa/,ef=/credentials/,eh=/git\s+(commit|merge|rebase|cherry-pick)\b/,eg=/\.failproofai(?:\/|\b)/,eb=new Set(["cat","bat","less","more","head","tail","nl","strings","xxd","od","jq","yq","diff","cmp","wc","sort","uniq","column","awk","cut","ls","dir","tree","stat","file","du","df","readlink","realpath","basename","dirname","pwd","test","find","grep","egrep","fgrep","rg","ag","ack","md5sum","sha1sum","sha256sum","shasum","cksum","cd","pushd","popd","cp","rsync","install","tee","sed","true","false",":","echo","printf","[","[[","]","]]","test","read","for","select","case","done","fi","esac"]),ey=new Set(["do","then","else","elif","if","while","until","!"]),ek=/(?:^|[\s(])(?:while|until|for|select)\s/,ew=new Set(["cp","rsync","install"]),ev=new Set(["tee"]),e$=new Set(["uniq","xxd"]),eT={sort:["-o","--output"],tree:["-o","--output"],curl:["-o","--output","--output-dir","-D","--dump-header","--trace","--trace-ascii"]},eA=new Set(["-fprint","-fprint0","-fprintf","-fls"]),eE=new Set(["cat","bat","head","tail","nl","strings","xxd","od","jq","yq","wc","ls","stat","file","du","readlink","realpath","basename","dirname","grep","egrep","fgrep","rg","md5sum","sha1sum","sha256sum","shasum","cksum","echo","printf","true",":"]),eS=new Set(["clean","rm","restore","checkout","reset","stash"]),eP=new Set(["-C","-c","--git-dir","--work-tree","--namespace","--exec-path"]);function eB(e){for(let t=0;t<e.length;t++){let i=e[t];if(eP.has(i)){t++;continue}if(!i.startsWith("-"))return t}return -1}let eC=new Set(["git","gh","glab","echo","printf","curl","code","open"]),ex=new Set(["-exec","-execdir","-ok","-okdir"]),eN=/\|\||&&|[;\n\r&]+/,eI=/\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?/g,eR=[".failproofai","~/.failproofai","$HOME/.failproofai","${HOME}/.failproofai","/root/.failproofai","/home/u/.failproofai","/Users/u/.failproofai"],eW=[".config",".cache",".local",".git",".npm",".ssh",".bashrc","node_modules","dist","build","target","coverage","tmp","src","~/.config","~/.cache","$HOME/.config","${HOME}/.cache","/home/u/.config","/Users/u/.config","/root/.cache","/tmp/build","a","foo.txt","test-failures"];function eO(e){if(!eD.test(e))return!1;for(let t of function(e){let t=[e];for(let i=0;i<24;i++){let i=[],n=!1;for(let e of t){let t=function(e){let t=e.indexOf("{");if(-1===t)return null;let i=0,n=[],r="";for(let a=t;a<e.length;a++){let o=e[a];if("{"===o){if(1==++i)continue}else if("}"===o){if(0==--i)return n.push(r),{start:t,end:a,alternatives:n}}else if(","===o&&1===i){n.push(r),r="";continue}r+=o}return null}(e);if(!t){i.push(e);continue}for(let r of(n=!0,t.alternatives))i.push(e.slice(0,t.start)+r+e.slice(t.end+1))}if(!n)return i;if(i.length>4096)return[ez(e)];t=i}return t.map(ez)}(e))if(function(e){if(eg.test(e))return!0;let t=e.split("/");for(let e=1;e<=t.length;e++)if(function(e){let t;if(!eD.test(e))return!1;let i="^"+function e(t){let i="";for(let n=0;n<t.length;n++){let r=function(t,i){let n=t[i];if(!"?*+@!".includes(n)||"("!==t[i+1])return null;let r=[],a="",o=0,s=i+1;for(;s<t.length;s++){let e=t[s];if("("===e){if(1==++o)continue}else if(")"===e){if(0==--o){r.push(a);break}}else if("|"===e&&1===o){r.push(a),a="";continue}a+=e}if(s>=t.length)return null;if("!"===n)return{source:"[^/]*",end:s};let l=r.map(t=>e(t)).join("|");return{source:`(?:${l})${"?"===n?"?":"*"===n?"*":"+"===n?"+":""}`,end:s}}(t,n);if(r){i+=r.source,n=r.end;continue}let a=t[n];if("*"===a)i+="[^/]*";else if("?"===a)i+="[^/]";else if("["===a){let e=function(e,t){let i=t+1,n=!1;("!"===e[i]||"^"===e[i])&&(n=!0,i++);let r="";for("]"===e[i]&&(r+="]",i++);i<e.length&&"]"!==e[i];){let t="["===e[i]?e[i+1]:void 0;if(":"===t||"."===t||"="===t){let n=e.indexOf(`${t}]`,i+2);if(-1!==n){r+=e.slice(i,n+2),i=n+2;continue}}r+=e[i],i++}if(i>=e.length)return null;if(/\[[.=:]/.test(r))return{source:"[^/]",end:i};let a=r.replace(/[\\\]]/g,"\\$&");return 0===a.length?{source:"[^/]",end:i}:{source:`[${n?"^":""}${a}]`,end:i}}(t,n);if(!e){i+="\\[";continue}i+=e.source,n=e.end}else i+=a.replace(/[.+^${}()|\\\]]/g,"\\$&")}return i}(e);try{t=RegExp(i+"$")}catch{return!1}return!!eR.some(e=>t.test(e))&&!eW.some(e=>t.test(e))}(t.slice(0,e).join("/")))return!0;return!1}(t))return!0;return!1}function ez(e){let t="",i=0;for(let n of e){if("{"===n){0===i&&(t+="*"),i++;continue}if("}"===n){i>0&&i--;continue}0===i&&(t+=n)}return t}let eD=/[*?[{]|[@+!]\(/;function ej(e){let t=[];for(let i=0;i<e.length;i++){if("`"===e[i]){let n=e.indexOf("`",i+1);if(-1===n)break;t.push(e.slice(i+1,n)),i=n;continue}if("$"!==e[i]||"("!==e[i+1])continue;let n=1,r=i+2;for(;r<e.length&&n>0;r++)"("===e[r]?n++:")"===e[r]&&n--;0===n&&t.push(e.slice(i+2,r-1)),i=r-1}return t}let e_=/\d*>{1,2}\|?\s*("[^"]*"|'[^']*'|[^\s;&|<>]+)/g;function eU(e){return e.replace(/^[(){}'"]+|[(){}'"]+$/g,"")}function eL(e){let t=eU(e);return t.slice(t.lastIndexOf("/")+1)}function eH(e,t=0){if(0===t){let t=ej(e);for(let e=0;e<t.length&&e<64;e++){if(eH(t[e],1))return!0;t.push(...ej(t[e]))}}let i=[...e.matchAll(/(?:^|[\s;&|(])(?:export\s+)?([A-Za-z_][A-Za-z0-9_]*)=("[^"]*"|'[^']*'|[^\s;&|)]+)/g)].map(([,e,t])=>[e,t.replace(/^["']|["']$/g,"")]),n=new Set;for(let e=0;e<i.length+1;e++){let e=n.size;for(let[e,t]of i)(eg.test(t)||[...t.matchAll(eI)].some(([,e])=>n.has(e)))&&n.add(e);if(n.size===e)break}let r=e=>{if(eg.test(e))return!0;for(let[,t]of e.matchAll(eI))if(n.has(t))return!0;return e.split(/\s+/).some(e=>{var t;let i;return i=(t=e.replace(/^['"]+|['"]+$/g,"")).replace(/^[()]+|[()]+$/g,""),eO(t)||i!==t&&eO(i)})},a=!1,o=0,s=null,l=!1;for(let t of e.split(eN)){if(!t.trim())continue;let e=t.split("|"),i=r(t)||a||l;if(i&&ek.test(t)&&(l=!0),/(?:^|\s)done(?:\s|$)/.test(t)&&(l=!1),i){for(let[,e]of t.matchAll(e_))if(r(e.replace(/^["']|["']$/g,"")))return!0}for(let t of e){o+=(t.match(/\(/g)??[]).length;let e=function(e){let t=e.trim().split(/\s+/).map(eU).filter(Boolean),i=0;for(;i<t.length;){let e=t[i];if(/^\d*(?:>{1,2}\|?|<{1,3})/.test(e)){i+=/^\d*(?:>{1,2}\|?|<{1,3})$/.test(e)?2:1;continue}if(!(eo.test(e)||e.startsWith("-")||es.test(e)||ey.has(e)||et.has(eL(e))))break;i++}return t.slice(i)}(t),n=e.length>0?eL(e[0]):"";if("cd"===n||"pushd"===n){let t=e.slice(1).find(e=>!e.startsWith("-"));s=(a=void 0!==t&&r(t))?o:null}else if("popd"===n)a=!1,s=null;else if(i&&e.length>0&&function(e,t){if(0===e.length)return!1;let i=eL(e[0]),n=e.slice(1);if("find"===i)return!!(n.some(e=>"-delete"===e)||n.some(e=>eA.has(e)))||n.some((e,t)=>ex.has(e)&&!eE.has(eL(n[t+1]??"")));if("sed"===i)return!!n.some(e=>e.startsWith("-i")||e.startsWith("--in-place"))||n.some((e,i)=>/(?:^|[;}/\s])w$/.test(e)&&t(n[i+1]??""))||n.some(e=>/(?:^|[;}/\s])w\s*\S*\.failproofai/.test(e));if("awk"===i||"gawk"===i||"mawk"===i)return n.some(e=>/system\s*\(|\|\s*["']|\|&/.test(e));if(ew.has(i)){if(n.includes("--remove-source-files")&&n.some(e=>t(e)))return!0;let e=n.findIndex(e=>"-t"===e||"--target-directory"===e);if(-1!==e&&t(n[e+1]??"")||n.some(e=>e.startsWith("--target-directory=")&&t(e)))return!0;let i=n.filter(e=>!e.startsWith("-")),r=i[i.length-1];return void 0!==r&&t(r)}if(ev.has(i))return n.some(e=>!e.startsWith("-")&&t(e));if(e$.has(i)){let e=n.filter(e=>!e.startsWith("-"));return e.length>1&&t(e[e.length-1])}if("git"===i){let e,t=(e=eB(n))<0?void 0:n[e];return void 0!==t&&eS.has(t)}return!!function(e,t,i){let n=eT[e];if(!n)return!1;for(let e=0;e<t.length;e++){let r=t[e];if(n.find(e=>e.startsWith("--")&&r.startsWith(`${e}=`))&&i(r))return!0;let a=/^-[A-Za-z]*[oD]$/.test(r)&&n.includes(`-${r[r.length-1]}`);if((n.includes(r)||a)&&i(t[e+1]??""))return!0}return!1}(i,n,t)||!(eb.has(i)||eC.has(i))}(e,r))return!0;o-=(t.match(/\)/g)??[]).length,null!==s&&o<s&&(a=!1,s=null)}}return!1}let eZ=/(?: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)/,eq=/\bgit\s+commit\b.*--amend\b/,eG=/\bgit\s+stash\s+(?:drop|clear)\b/,eF=/^(?:\/\S*\/)?git$/,eM=/^-[A-Za-z]+$/,eJ=/^clean\.requireforce=(?:false|0|no|off)$/i,eK=["d","x","X"],eY=/\bgit\s+add\s+(?:-A\b|--all\b|\.(?:\s|$|;|&&|\|\|))/,eX=/\bnpm\s+(?:install|i)\b(?=.*(?:\s-g\b|--global\b))/,eQ=/\byarn\s+global\s+add\b/,eV=/\bpnpm\s+(?:add|install|i)\b(?=.*(?:\s-g\b|--global\b))/,e0=/\bbun\s+(?:install|add)\b(?=.*(?:\s-g\b|--global\b))/,e1=/\bcargo\s+install\b/,e3=/\bpip(?:3)?\s+install\b(?=.*(?:--user\b|--break-system-packages\b))/,e2={pip:[/\bpip\b/,/\bpip3\b/,/\bpython3?\s+-m\s+pip\b/],npm:[/\bnpm\b/,/\bnpx\b/],yarn:[/\byarn\b/],pnpm:[/\bpnpm\b/,/\bpnpx\b/],bun:[/\bbun\b/,/\bbunx\b/],uv:[/\buv\b/],poetry:[/\bpoetry\b/],pipenv:[/\bpipenv\b/],conda:[/\bconda\b/],cargo:[/\bcargo\b/]},e9=/\bnohup\s+\S/,e8=/\bscreen\s+-[A-Za-z]*d[A-Za-z]*\b/,e5=/\btmux\s+(?:new-session|new)\b[^|&;]*-d\b/,e6=/\bdisown\b/,e4=/(?<![&|])\s?&\s*(?:$|#|;)/,e7=/(?:^|[;\n]|&&|\|\|?|&)\s*kubectl(?:\s|$)/,te=/(?:^|[;\n]|&&|\|\|?|&)\s*(?:terraform|tofu)(?:\s|$)/,tt=/(?:^|[;\n]|&&|\|\|?|&)\s*aws(?:\s|$)/,ti=/(?:^|[;\n]|&&|\|\|?|&)\s*gcloud(?:\s|$)/,tn=/(?:^|[;\n]|&&|\|\|?|&)\s*az(?:\s|$)/,tr=/(?:^|[;\n]|&&|\|\|?|&)\s*helm(?:\s|$)/,ta=/(?:^|[;\n]|&&|\|\|?|&)\s*gh\s+(?:workflow\s+(?:run|enable|disable)|run\s+(?:rerun|cancel)|pr\s+merge|release\s+(?:create|delete)|cache\s+delete|secret\s+(?:set|delete))\b/,to=new Map;function ts(e){try{let n=function(e){try{return(0,i.statSync)((0,t.join)(e,".git","HEAD")).mtimeMs}catch{return null}}(e),a=to.get(e);if(a&&null!==n&&a.headMtimeMs===n)return a.branch||null;let o=(0,r.execSync)("git rev-parse --abbrev-ref HEAD",{cwd:e,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:3e3}).trim();return null!==n&&(to.size>=500&&to.clear(),to.set(e,{branch:o,headMtimeMs:n})),o||null}catch{return null}}function tl(e,t){let i=A(e),n=A(t);return!(i.length<n.length||i.some(e=>E.has(e))||i.some(e=>S.test(e)))&&n.every((e,t)=>"*"===e||e===i[t])}let tc=/^-{1,2}c$/;function tu(e){return e.split(/&&|\|\||[|;\n]/).map(e=>e.trim()).filter(e=>/^git\s+push\s/.test(e)).map(e=>e.replace(/^git\s+push\s+/,""))}let td=/^(?:~[A-Za-z0-9_.-]*|\$HOME|\$\{HOME\})(?=$|\/)/,tp=/^(?:\/\S*\/)?rm$/,tm=/^(?:\/\S*\/)?find$/,tf=/^-(?:exec|execdir|ok|okdir)$/,th=/^-(?:[HLP]|D|O\d*)$/,tg=/^(?:-|\\?[(!])/,tb=["/tmp","/var/tmp"];function ty(e){let t=e.match(/^(?:~|\$HOME|\$\{HOME\})(?=$|\/)/);return t?(0,a.homedir)()+e.slice(t[0].length):e}function tk(e){return e.replace(/\/\*$/,"").replace(/\/+$/,"")}function tw(e){let t=e.replace(/^['"]|['"]$/g,"");if(""===t)return!1;let i=t.match(td);if(!i&&/^[$`]/.test(t))return!0;let n=i?t.slice(i[0].length):t.startsWith("/")?t:null;if(null===n)return!1;let r=tk(n).split("/").filter(Boolean);return!(!i&&tb.some(e=>`/${r.join("/")}`.startsWith(`${e}/`)))&&r.length<=2}function tv(e){let t=A(e),i=t.findIndex(e=>tm.test(e));if(i>=0){let e=t.slice(i+1),n=e.findIndex(e=>tf.test(e));if(e.includes("-delete")||n>=0&&tp.test(e[n+1]??"")){let t=0;for(;t<e.length&&th.test(e[t]);)t+="-D"===e[t]?2:1;let i=e.slice(t),n=i.findIndex(e=>tg.test(e));return n<0?i:i.slice(0,n)}}let n=t.findIndex(e=>tp.test(e));if(n>=0){let e=t.slice(n+1),i=e.filter(e=>/^-[^-]/.test(e)).join(""),r=e.filter(e=>/^--/.test(e)),a=/r/i.test(i)||r.some(e=>/^--recursive$/i.test(e)),o=/f/.test(i)||r.some(e=>/^--force$/i.test(e));if(a&&o)return e.filter(e=>!e.startsWith("-"))}return null}function t$(e){return e.split(/&&|\|\||[|;\n]/).map(e=>e.trim()).filter(e=>""!==e)}let tT=/(?:^|;|&&|\|\||\|)\s*(?:ls|find|cat|head|tail|less|more|wc|file|stat|tree|du)\s/;function tA(e,t,i){if("Bash"!==e.toolName)return s();let n=$(e);return!t.test(n)||(e.params?.allowPatterns??[]).some(e=>tl(n,e))?s():l(i)}let tE=/\s*(?:&&|\|\||\||;)\s*/;function tS(e){return e.session?.permissionMode==="plan"}let tP={"sanitize-jwt":function(e){let t=JSON.stringify(e.payload);return P.test(t)?{decision:"deny",reason:"JWT token detected in tool output",message:"[REDACTED: JWT token removed by failproofai]"}:s()},"sanitize-api-keys":function(e){let t=JSON.stringify(e.payload);for(let[e,i]of B)if(e.test(t))return{decision:"deny",reason:`${i} detected in tool output`,message:`[REDACTED: ${i} removed by failproofai]`};for(let{regex:i,label:n}of e.params?.additionalPatterns??[])try{if(new RegExp(i).test(t))return{decision:"deny",reason:`${n} detected in tool output`,message:`[REDACTED: ${n} removed by failproofai]`}}catch{(0,k.g)(`additionalPatterns: invalid regex "${i}", skipping`)}return s()},"sanitize-connection-strings":function(e){let t=JSON.stringify(e.payload);return C.test(t)?{decision:"deny",reason:"Database connection string with credentials detected in tool output",message:"[REDACTED: connection string removed by failproofai]"}:s()},"sanitize-private-key-content":function(e){let t=JSON.stringify(e.payload);return x.test(t)?{decision:"deny",reason:"Private key content detected in tool output",message:"[REDACTED: private key content removed by failproofai]"}:s()},"sanitize-bearer-tokens":function(e){let t=JSON.stringify(e.payload);return N.test(t)?{decision:"deny",reason:"Bearer token detected in tool output",message:"[REDACTED: Bearer token removed by failproofai]"}:s()},"protect-env-vars":function(e){if("Bash"!==e.toolName)return s();let t=$(e);return _.test(t)?l("Command reads environment variables"):U.test(t)?l("Command echoes environment variable"):L.test(t)?l("Command exports environment variable"):H.test(t)||Z.test(t)&&q.test(t)?l("Command dumps environment variables"):G.test(t)?l("Command reads environment variable via PowerShell"):F.test(t)?l("Command reads environment variables via PowerShell"):M.test(t)?l("Command reads environment variable via .NET"):J.test(t)?l("Command echoes environment variable via cmd"):s()},"block-env-files":function(e){let t=$(e),i=T(e);return i&&K.test(i)?l("Access to .env file blocked"):"Bash"===e.toolName&&Y.test(t)?l("Command references .env file"):s()},"block-read-outside-cwd":function(e){let i=process.env.CLAUDE_PROJECT_DIR||e.session?.cwd;if(!i)return s();let n=e.params?.allowPaths??[];if("Bash"===e.toolName){let r=$(e);if(!tT.test(r))return s();let o=function(e){let i,n=[],r=/(?<![a-zA-Z0-9_.\-~\\*?:=/])(?:~\/[^\s;|&"'()\[\]{}]*|~(?=\s|$|[;|&"'()\[\]{}])|\/[^\s;|&"'()\[\]{}]*)/g;function o(e){let i;for(r.lastIndex=0;null!==(i=r.exec(e));){let r=i[0];if(/^\/{2,}$/.test(r)){let t=e.lastIndexOf("\n",i.index-1);if(-1!==t&&"\\"!==e[t-1]&&/^[ \t]*$/.test(e.slice(t+1,i.index)))continue}"~"===r?r=(0,a.homedir)():r.startsWith("~/")&&(r=(0,t.join)((0,a.homedir)(),r.slice(2))),n.push(r)}}let s=e.length,l=!1,c=!1;for(let t=0;t<e.length;t++){let i=e[t];if('"'!==i||c)if("'"!==i||l){if("|"===i&&!l&&!c){s=t;break}}else c=!c;else l=!l}let u=e.slice(0,s),d=/"([^"]*)"|'([^']*)'/g;for(;null!==(i=d.exec(u));){let e=i[1]??i[2]??"";/[*?\[\]^$+()\\]/.test(e)||o(e)}return o(e.replace(/"[^"]*"/g,e=>" ".repeat(e.length)).replace(/'[^']*'/g,e=>" ".repeat(e.length))),n}(r),c=i.endsWith("/")?i:i+"/";for(let e of o){let r=(0,t.resolve)(i,e);if(v(r))return l(`Reading agent settings file blocked: ${r}`);if(!w(r)&&"/dev/null"!==r&&r!==i&&!r.startsWith(c)){if(n.some(e=>r===e||r.startsWith(e.endsWith("/")?e:e+"/")))continue;return l(`Bash read outside project directory blocked: ${r}`)}}return s()}let r=T(e),o=e.toolInput?.path??"",c=r||o;if(!c)return s();let u=(0,t.resolve)(i,c);if(v(u))return l(`Reading agent settings file blocked: ${u}`);if(w(u)||"/dev/null"===u)return s();let d=i.endsWith("/")?i:i+"/";return u===i||u.startsWith(d)?s():n.some(e=>u===e||u.startsWith(e.endsWith("/")?e:e+"/"))?s():l(`Access outside project directory blocked: ${u}`)},"block-sudo":function(e){if("Bash"!==e.toolName)return s();let t=$(e).trimStart();return function e(t,i=0){for(let n of function(e){let t=[],i=[],n="",r=null,a=()=>{n&&i.push(n),n=""},o=()=>{a(),i.length&&t.push(i),i=[]};for(let t=0;t<e.length;t++){let i=e[t];if(r){if("\\"===i&&'"'===r&&t+1<e.length){n+=e[++t];continue}if(i===r){r=null;continue}n+=i;continue}if("\\"===i&&t+1<e.length){n+=e[++t];continue}if('"'===i||"'"===i){r=i;continue}if(/\s/.test(i)){a();continue}if(/[;&|\n\r(){}`]/.test(i)){o();continue}n+=i}return o(),t}(t)){let t=0;for(;t<n.length;){let r=n[t],a=r.slice(r.lastIndexOf("/")+1);if("sudo"===a||"doas"===a)return!0;if(!(eo.test(r)||r.startsWith("-")||r.startsWith(">")||r.startsWith("<")||es.test(r)||et.has(a)))break;if(tc.test(r)&&i<3&&t+1<n.length&&e(n[t+1],i+1))return!0;t++}}return!1}(t)?(e.params?.allowPatterns??[]).some(e=>tl(t,e))?s():l("sudo commands are blocked"):X.test(t)?l("Elevated process launch is blocked"):Q.test(t)?l("runas elevation is blocked"):s()},"block-curl-pipe-sh":function(e){if("Bash"!==e.toolName)return s();let t=$(e);return V.test(t)?l("Piping downloads to shell is blocked"):ec.test(t)?l("Piping downloads to Invoke-Expression is blocked"):s()},"block-rm-rf":function(e){if("Bash"!==e.toolName)return s();let t=$(e);return t$(t).some(e=>{let t=tv(e);return null!==t&&t.some(tw)})?!function(e,t){if(0===t.length)return!1;let i=t.map(e=>tk(ty(e))||"/"),n=!1;for(let r of t$(e)){let e=tv(r);if(null!==e)for(let a of(n=!0,e)){let e=tk(ty(a))||"/";if(!i.some(t=>e===t||e.startsWith(t+"/"))&&!t.some(e=>{let t=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return RegExp(`${t}(?:[/"'\\s/*]|$)`).test(r)}))return!1}}return n}(t,e.params?.allowPaths??[])?l("Catastrophic deletion blocked"):s():/Remove-Item\s+.*-Recurse.*-Force.*(?:[A-Z]:\\(?:\s|$)|\\\*)/i.test(t)||/(?:rd|rmdir)\s+\/s\s+\/q\s+[A-Z]:\\/i.test(t)?l("Catastrophic deletion blocked"):s()},"block-failproofai-commands":function(e){if("Write"===e.toolName||"Edit"===e.toolName||"NotebookEdit"===e.toolName){let t=T(e)||(e.toolInput?.notebook_path??"");return eg.test(t)?l("Writing to failproofai's own state would switch enforcement off. If a policy is blocking legitimate work, say so and let the operator decide."):s()}if("Bash"!==e.toolName)return s();let t=$(e),i=t.replace(/\\\r?\n/g,"").replace(/\$'((?:[^'\\]|\\.)*)'/g,(e,t)=>t.replace(/\\(x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{1,4}|U[0-9A-Fa-f]{1,8}|[0-7]{1,3}|.)/g,(e,t)=>{try{if("x"===t[0])return String.fromCharCode(parseInt(t.slice(1),16));if("u"===t[0]||"U"===t[0])return String.fromCodePoint(parseInt(t.slice(1),16));if(/^[0-7]+$/.test(t))return String.fromCharCode(parseInt(t,8))}catch{return t}return({a:"\x07",b:"\b",e:"\x1b",f:"\f",n:"\n",r:"\r",t:" ",v:"\v","\\":"\\","'":"'",'"':'"',"?":"?"})[t]??t})).replace(/\\(.)/g,"$1").replace(/['"]/g,""),n=el(t)??el(i);return"pause"===n?l("Pausing failproofai enforcement is a human action, not an agent one. If a policy is blocking legitimate work, say so and let the operator decide."):"cli"===n?l("Running failproofai CLI commands is blocked"):eZ.test(t)||eZ.test(i)?l("Uninstalling failproofai is blocked"):eH(t)||eH(i)?l("Deleting, moving or overwriting failproofai's own state would switch enforcement off. If a policy is blocking legitimate work, say so and let the operator decide."):s()},"block-kubectl":function(e){return tA(e,e7,"kubectl commands are blocked")},"block-terraform":function(e){return tA(e,te,"terraform/tofu commands are blocked")},"block-aws-cli":function(e){return tA(e,tt,"aws CLI commands are blocked")},"block-gcloud":function(e){return tA(e,ti,"gcloud commands are blocked")},"block-az-cli":function(e){return tA(e,tn,"az (Azure) CLI commands are blocked")},"block-helm":function(e){return tA(e,tr,"helm commands are blocked")},"block-gh-pipeline":function(e){return tA(e,ta,"gh pipeline-trigger commands are blocked")},"block-secrets-write":function(e){if("Write"!==e.toolName)return s();let t=T(e);if(ep.test(t)||em.test(t)||ef.test(t))return l("Writing secret key files is blocked");for(let i of e.params?.additionalPatterns??[])if(t.includes(i))return l(`Writing blocked file pattern: ${i}`);return s()},"block-push-master":function(e){if("Bash"!==e.toolName)return s();let t=e.params?.protectedBranches??["main","master"];if(0===t.length)return s();let i=tu($(e)),n=RegExp(`\\b(?:${t.map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})\\b`);return i.some(e=>n.test(e))?l(`Pushing to ${t.join("/")} is blocked`):s()},"block-force-push":function(e){if("Bash"!==e.toolName)return s();for(let t of tu($(e))){let e=!1;for(let i of t.split(/\s+/)){if("--"===i){e=!0;continue}if(!e&&function(e){return"--force"===e||!ed.some(t=>e.startsWith(t))&&(!!e.startsWith("--force")||eu.test(e))}(i))return l("Force-pushing is blocked")}}return s()},"block-work-on-main":function(e){if("Bash"!==e.toolName)return s();let t=$(e).match(eh);if(!t)return s();let i=e.session?.cwd;if(!i)return s();let n=ts(i);return n&&(e.params?.protectedBranches??["main","master"]).includes(n)?l(`Git ${t[1]} on ${n} is blocked. Create a feature branch first.`):s()},"warn-git-amend":function(e){if("Bash"!==e.toolName)return s();let t=$(e);return eq.test(t)?c("STOP: This command amends the last commit, which rewrites git history. If this commit has already been pushed to a shared branch, this will cause divergence for other contributors. Confirm with the user before executing."):s()},"warn-git-stash-drop":function(e){if("Bash"!==e.toolName)return s();let t=$(e);return eG.test(t)?c("STOP: This command permanently deletes stashed changes (git stash drop/clear). Stash entries cannot be recovered after deletion. Confirm with the user before executing."):s()},"warn-git-clean":function(e){if("Bash"!==e.toolName)return s();let t=e.params?.destructiveFlags??eK;if(0===t.length)return s();for(let i of t$($(e))){let e=A(i),n=e.findIndex(e=>eF.test(e));if(n<0)continue;let r=e.slice(n+1),a=eB(r);if(a<0||"clean"!==r[a])continue;let o=function(e){let t=new Set,i=!1,n=!1,r=!1;for(let a of e){if("--"===a){r=!0;continue}if(!r){if("--force"===a){i=!0;continue}if("--dry-run"===a){n=!0;continue}if(!a.startsWith("--")&&eM.test(a))for(let e of a.slice(1))"f"===e&&(i=!0),"n"===e&&(n=!0),t.add(e)}}return i&&t.add("f"),{force:i,dryRun:n,letters:t}}(r.slice(a+1));if(!o.dryRun&&(o.force||function(e){for(let t=0;t<e.length;t++){let i=e[t],n="-c"===i?e[t+1]:i.startsWith("-c")?i.slice(2):void 0;if(void 0!==n&&eJ.test(n))return!0}return!1}(r.slice(0,a)))&&t.some(e=>o.letters.has(e)))return c("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.")}return s()},"warn-all-files-staged":function(e){if("Bash"!==e.toolName)return s();let t=$(e);return eY.test(t)?c("STOP: This command stages all files in the working tree (git add -A / --all / .). This may inadvertently include build artifacts, generated files, or sensitive files not covered by .gitignore. Confirm with the user before executing."):s()},"warn-destructive-sql":function(e){if("Bash"!==e.toolName)return s();let t=$(e);return R.test(t)&&(W.test(t)||O.test(t)&&!z.test(t))?c("STOP: This command contains destructive SQL (DROP/TRUNCATE/DELETE). Confirm with the user before executing."):s()},"warn-schema-alteration":function(e){if("Bash"!==e.toolName)return s();let t=$(e);return R.test(t)&&D.test(t)?c("STOP: This command contains a schema-altering SQL statement (ALTER TABLE with column or rename operation). Schema changes on production databases are irreversible or disruptive. Confirm with the user before executing."):s()},"warn-package-publish":function(e){if("Bash"!==e.toolName)return s();let t=$(e);return j.test(t)?c("STOP: This command publishes a package to a public registry. Confirm with the user that this is intentional."):s()},"warn-global-package-install":function(e){if("Bash"!==e.toolName)return s();let t=$(e);return eX.test(t)||eQ.test(t)||eV.test(t)||e0.test(t)||e1.test(t)||e3.test(t)?c("STOP: This command installs a package globally, which modifies the system-wide environment outside the project. This can conflict with other projects or system tools. Confirm with the user before executing."):s()},"prefer-package-manager":function(e){if("Bash"!==e.toolName)return s();let t=$(e);if(!t)return s();let i=e.params?.allowed??[];if(0===i.length)return s();let n=new Set(i.map(e=>e.toLowerCase())),r=e.params?.blocked??[],a=i.join(", ");for(let e of t.split(tE)){let t=e.trim();if(!t)continue;let i=!1;for(let e of n){let n=e2[e];if(n){for(let e of n)if(e.test(t)){i=!0;break}if(i)break}}if(!i){for(let[e,i]of Object.entries(e2))if(!n.has(e)){for(let n of i)if(n.test(t))return l(`"${e}" is not an allowed package manager. Allowed package managers for this project: ${a}. Rewrite this command using an allowed package manager.`)}for(let e of r){let i=e.toLowerCase();if(!n.has(i)&&RegExp(`\\b${i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`).test(t))return l(`"${i}" is not an allowed package manager. Allowed package managers for this project: ${a}. Rewrite this command using an allowed package manager.`)}}}return s()},"warn-large-file-write":function(e){if("Write"!==e.toolName)return s();let t=e.toolInput?.content;if("string"!=typeof t)return s();let i=e.params?.thresholdKb??1024;return t.length>1024*i?c(`STOP: You are writing a file larger than ${i}KB (${Math.round(t.length/1024)}KB). This is unusually large. Confirm this is intentional before proceeding.`):s()},"warn-background-process":function(e){if("Bash"!==e.toolName)return s();let t=$(e);return e9.test(t)||e8.test(t)||e5.test(t)||e6.test(t)||e4.test(t)?c("STOP: This command starts a background or detached process (nohup, screen -d, tmux -d, or trailing &). Background processes persist after Claude's session and may be difficult to track or stop. Confirm with the user before executing."):s()},"warn-repeated-tool-calls":async function e(e){let t=e.session?.transcriptPath;if(!t||!e.toolName||!e.toolInput)return s();let i=`${t}.tool-calls.json`,r=JSON.stringify({tool:e.toolName,input:e.toolInput}),a={};try{let e=await (0,n.readFile)(i,"utf8");a=JSON.parse(e)}catch{}let o=a[r]??0;if(o>=3)return c(`STOP: You have already called ${e.toolName} ${o} times with identical parameters. This is wasteful and unproductive. Do NOT repeat this call — use a different approach or ask the user for clarification.`);a[r]=o+1;try{let e=JSON.stringify(a);e.length<=65536&&await (0,n.writeFile)(i,e,"utf8")}catch{}return s()},"require-commit-before-stop":function(e){if(tS(e))return s("Plan mode — no changes made, skipping commit check.");let t=e.session?.cwd;if(!t)return s("No working directory available, skipping commit check.");try{if((0,r.execSync)("git status --porcelain",{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:5e3}).trim().length>0)return l("You have uncommitted changes in the working directory. Commit all changes now.");return s("All changes are committed.")}catch{return s("Not a git repository, skipping commit check.")}},"require-push-before-stop":function(e){if(tS(e))return s("Plan mode — no changes made, skipping push check.");let t=e.session?.cwd;if(!t)return s("No working directory available, skipping push check.");try{if(!(0,r.execSync)("git remote",{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:3e3}).trim())return s("No git remote configured, skipping push check.");let i=e.params?.remote??"origin",n=ts(t);if(!n||"HEAD"===n)return s("Detached HEAD, skipping push check.");let a=e.params?.baseBranch??"main";if(n===a)return s(`On base branch "${a}", skipping push check.`);try{if(!(0,r.execFileSync)("git",["log",`${i}/${a}..HEAD`,"--oneline"],{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:5e3}).trim())return s(`No commits ahead of ${i}/${a}, skipping push check.`);if(!(0,r.execFileSync)("git",["diff","--stat",`${i}/${a}`,"HEAD"],{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:5e3}).trim())return s(`No file changes compared to ${i}/${a}, skipping push check.`)}catch{}let o=!1;try{(0,r.execFileSync)("git",["rev-parse","--verify",`${i}/${n}`],{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:3e3}),o=!0}catch{}if(!o)return l(`Branch "${n}" has not been pushed to remote "${i}". Run now: git push -u ${i} ${n}`);let c=(0,r.execFileSync)("git",["log",`${i}/${n}..HEAD`,"--oneline"],{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:5e3}).trim();if(c.length>0){let e=c.split("\n").length;return l(`You have ${e} unpushed commit${e>1?"s":""} on branch "${n}". Run now: git push`)}return s(`All commits pushed to "${i}".`)}catch{return s("Could not check push status, skipping.")}},"require-pr-before-stop":function(e){if(tS(e))return s("Plan mode — no changes made, skipping PR check.");let t=e.session?.cwd;if(!t)return s("No working directory available, skipping PR check.");try{let i;try{(0,r.execSync)("gh --version",{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:3e3})}catch{return s("GitHub CLI (gh) not installed, skipping PR check.")}let n=ts(t);if(!n||"HEAD"===n)return s("Detached HEAD, skipping PR check.");let a=e.params?.baseBranch??"main";if(n===a)return s(`On base branch "${a}", skipping PR check.`);try{if(!(0,r.execFileSync)("git",["log",`origin/${a}..HEAD`,"--oneline"],{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:5e3}).trim())return s(`No commits ahead of origin/${a}, skipping PR check.`);if(!(0,r.execFileSync)("git",["diff","--stat",`origin/${a}`,"HEAD"],{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:5e3}).trim())return s(`No file changes compared to origin/${a}, skipping PR check.`)}catch{}try{i=(0,r.execSync)("gh pr view --json number,url,state",{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:15e3}).trim()}catch{return l(`No pull request found for branch "${n}". Run now: gh pr create`)}let o=JSON.parse(i);if("OPEN"===o.state)return s(`PR #${o.number} exists: ${o.url}`);if("MERGED"===o.state)return s(`PR #${o.number} was merged: ${o.url}. Switch off this branch (e.g. 'git checkout ${a} && git pull') before stopping again.`);return l(`Pull request for branch "${n}" is ${o.state.toLowerCase()}. Run now: gh pr create`)}catch{return s("Could not check PR status, skipping.")}},"require-no-conflicts-before-stop":function(e){let t,i;if(tS(e))return s("Plan mode — no changes made, skipping conflict check.");let n=e.session?.cwd;if(!n)return s("No working directory available, skipping conflict check.");let a=ts(n);if(!a||"HEAD"===a)return s("Detached HEAD, skipping conflict check.");let o=e.params?.baseBranch??"main";if(a===o)return s(`On base branch "${o}", skipping conflict check.`);try{(0,r.execSync)("gh --version",{cwd:n,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:3e3})}catch{return s("gh CLI not installed, skipping conflict check.")}try{t=(0,r.execSync)("gh pr view --json mergeable,number,url,state",{cwd:n,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:15e3}).trim()}catch{return s("No pull request found for branch, skipping conflict check.")}try{i=JSON.parse(t)}catch{return s("Could not parse gh pr view output, skipping conflict check.")}if("OPEN"!==i.state)return s(`PR #${i.number} is ${i.state.toLowerCase()}; skipping conflict check.`);try{(0,r.execFileSync)("git",["rev-parse","--verify",`origin/${o}`],{cwd:n,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:3e3}),(0,r.execFileSync)("git",["log",`origin/${o}..HEAD`,"--oneline"],{cwd:n,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:5e3}).trim()&&(0,r.execFileSync)("git",["merge-tree","--write-tree","--name-only",`origin/${o}`,"HEAD"],{cwd:n,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:1e4})}catch(e){if(1===e.status){let t=("string"==typeof e.stdout?e.stdout:e.stdout?.toString("utf8")??"").trim().split("\n"),i=[];for(let e=1;e<t.length;e++){let n=t[e];if(""===n)break;i.push(n)}let n=i.length?i.join(", "):"one or more files";return l(`Branch "${a}" has merge conflicts with ${o} in: ${n}. Rebase or merge origin/${o} now and resolve the conflicts.`)}}return"CONFLICTING"===i.mergeable?l(`PR #${i.number} has merge conflicts per GitHub (${i.url}). Rebase or merge origin/${o} now and resolve the conflicts.`):"UNKNOWN"===i.mergeable?l(`GitHub is still computing mergeability for PR #${i.number} (${i.url}). Wait ~10 seconds, then re-check with \`gh pr view --json mergeable\` before attempting to stop again.`):s(`PR #${i.number} merges cleanly per GitHub.`)},"require-ci-green-before-stop":function(e){if(tS(e))return s("Plan mode — no changes made, skipping CI check.");let t=e.session?.cwd;if(!t)return s("No working directory available, skipping CI check.");try{try{(0,r.execSync)("gh --version",{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:3e3})}catch{return s("GitHub CLI (gh) not installed, skipping CI check.")}let e=ts(t);if(!e||"HEAD"===e)return s("Detached HEAD, skipping CI check.");let i=function(e){try{return(0,r.execSync)("git rev-parse HEAD",{cwd:e,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:3e3}).trim()||null}catch{return null}}(t),n=[];try{let a=(0,r.execFileSync)("gh",["run","list","--branch",e,"--limit","20","--json","status,conclusion,name,headSha"],{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:15e3}).trim();if(a&&"[]"!==a){let e=JSON.parse(a),t=i?e.filter(e=>e.headSha===i):e,r=new Set;n=t.filter(e=>!r.has(e.name)&&(r.add(e.name),!0))}}catch{}let a=[],o=[];i&&(a=function(e,t){try{let i=(0,r.execFileSync)("gh",["api",`repos/{owner}/{repo}/commits/${t}/check-runs`,"--jq",'.check_runs | map(select(.app.slug != "github-actions")) | map({name: .name, status: .status, conclusion: (.conclusion // "")})'],{cwd:e,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:15e3}).trim();if(!i||"[]"===i)return[];return JSON.parse(i)}catch{return[]}}(t,i),o=function(e,t){try{let i=(0,r.execFileSync)("gh",["api",`repos/{owner}/{repo}/commits/${t}/statuses`,"--jq","map({name: .context, state: .state}) | unique_by(.name)"],{cwd:e,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:15e3}).trim();if(!i||"[]"===i)return[];return JSON.parse(i).map(e=>({name:e.name,status:"pending"===e.state?"in_progress":"completed",conclusion:"pending"===e.state?"":"success"===e.state?"success":"failure"}))}catch{return[]}}(t,i));let c=[...n,...a,...o];if(0===c.length)return s(`No CI runs found for branch "${e}".`);let u=c.filter(e=>"completed"===e.status&&"success"!==e.conclusion&&"skipped"!==e.conclusion&&"cancelled"!==e.conclusion&&"neutral"!==e.conclusion);if(u.length>0){let t=u.map(e=>`"${e.name}"`).join(", ");return l(`CI checks are failing on branch "${e}": ${t}. Fix the failing checks now.`)}let d=c.filter(e=>"in_progress"===e.status||"queued"===e.status||"waiting"===e.status);if(d.length>0){let t=d.map(e=>`"${e.name}"`).join(", ");return l(`CI checks are still running on branch "${e}": ${t}. Wait for all checks to complete, then verify they pass.`)}return s(`All CI checks passed on branch "${e}".`)}catch{return s("Could not check CI status, skipping.")}}},tB=new Set(Object.keys(tP)),tC=o.filter(e=>!tB.has(e.name)).map(e=>e.name);if(tC.length>0)throw Error(`failproofai: builtin policies missing an implementation: ${tC.join(", ")}`);let tx=new Set(o.map(e=>e.name)),tN=[...tB].filter(e=>!tx.has(e));if(tN.length>0)throw Error(`failproofai: policy implementations with no catalog entry: ${tN.join(", ")}`);let tI=o.map(e=>({...e,fn:tP[e.name]}));e.s(["H",0,tI,"G",0,I,"k",0,function(e){let t=new Set(e.map(h));for(let e of tI)(e.alwaysOn||t.has(h(e.name)))&&y(e.name,e.description,e.fn,e.match,0,e.params,{authority:e.authority,reviewedBy:e.reviewedBy,alwaysOn:e.alwaysOn})}],73634),e.i(66680),e.i(52306),e.s(["w",0,"FailproofAI/policies","U",0,"SHA256SUMS","Z",0,"failproofai-pack.mjs","v",0,"failproofai-pack.json"],71194)}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=src_hooks_builtin-policies_ts_1yq5ybgx1v98e._.js.map
|
package/.next/standalone/.next/server/chunks/src_hooks_custom-hooks-loader_ts_0lnb3n3h94wnn._.js
CHANGED
|
@@ -7,6 +7,6 @@ export const clearCustomHooks = _cjs.clearCustomHooks;
|
|
|
7
7
|
export const allow = _cjs.allow;
|
|
8
8
|
export const deny = _cjs.deny;
|
|
9
9
|
export const instruct = _cjs.instruct;
|
|
10
|
-
export default _cjs;`,r=`failproofai-dist${i}.shim.mjs`;try{let e=(0,g.q)();await (0,p.mkdir)(e,{recursive:!0,mode:448});let t=await (0,p.lstat)(e),i="function"==typeof process.getuid?process.getuid():null;if(!t.isDirectory()||t.isSymbolicLink()||null!==i&&t.uid!==i||63&t.mode)throw Error(`${e} is not a private directory owned by this user`);let s=await v(e,r,o,!1);return{shimPath:s,shimUrl:(0,_.pathToFileURL)(s).href}}catch(e){(0,n.g)(`policy shim directory unusable (${e instanceof Error?e.message:String(e)}); falling back to ${(0,m.tmpdir)()}`)}let s=await v((0,m.tmpdir)(),r,o,!0);return{shimPath:s,shimUrl:(0,_.pathToFileURL)(s).href}}async function S(e,t,o,r=w,s){let a=[e],n=new Set,l=[],c=null;if(o&&t){let e=await F(o,t,r);l.push(e.shimPath),c=e.shimUrl}for(;a.length>0;){let t,u=a.shift();if(n.has(u))continue;if(n.add(u),s&&u===e){let e=await (0,p.readFile)(u),o=(0,i.createHash)("sha256").update(e).digest("hex");if(o!==s)throw Error(`cloud-managed policy failed integrity re-verification at load: expected ${s}, got ${o}`);t=e.toString("utf-8")}else t=await (0,p.readFile)(u,"utf-8");c&&(t=t.replace(/from\s+(['"])(?:claudeye|failproofai)\1/g,`from '${c}'`)),o&&(t=t.replace(/require\s*\(\s*(['"])(?:claudeye|failproofai)\1\s*\)/g,`require('${o.replace(/\\/g,"\\\\")}')`));let f=(0,h.dirname)(u),d=new Map;for(let e of[y,$]){let i,o=new RegExp(e.source,e.flags);for(;null!==(i=o.exec(t));){let e=i[2];if(d.has(e))continue;let t=await k(f,e);if(!t)continue;n.has(t)||a.includes(t)||a.push(t);let o=(0,h.relative)(f,t+r).split("\\").join("/");o.startsWith(".")||(o="./"+o),d.set(e,o)}}for(let e of[...d.keys()].sort((e,t)=>t.length-e.length)){let i=d.get(e),o=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=(t=t.replace(RegExp(`'${o}'`,"g"),`'${i}'`)).replace(RegExp(`"${o}"`,"g"),`"${i}"`)}let m=u+r;await (0,p.writeFile)(m,t,"utf-8"),l.push(m)}return l}async function P(e){for(let t of e)try{await (0,p.unlink)(t)}catch{}}e.i(73136);var b=e.i(49335),A=e.i(10659);e.i(16774),e.i(99891);let E="__FAILPROOFAI_LOADING_HOOKS__",O=0,T=new Map;async function U(e){let t,i,o=Number.isFinite(i=Number(process.env.FAILPROOFAI_POLICY_LOAD_TIMEOUT_MS))&&i>0?i:1e4;try{await Promise.race([import(e),new Promise((e,i)=>{t=setTimeout(()=>i(Error(`timed out loading module after ${o}ms`)),o),t.unref?.()})])}finally{t&&clearTimeout(t)}}let L=new Set;async function R(e,o){let r=globalThis;r[E]=!0;let a=[];try{let r=await j(),l=r?(0,s.pathToFileURL)(r).href:null,c=++O,p=`${w}.${process.pid}.${c}.${(0,i.randomUUID)()}.mjs`;a=await S(e,l,r,p,o?.verifyEntrySha);let m=await I(a,p),h=T.get(e);if(h?.fingerprint===m){for(let e of h.hooks)f.add({...e});return null}let _=e+p,g=(0,s.pathToFileURL)(_).href,y=u().length,$=d().length;await U(g);let x=d().slice($).map(e=>e?.name);return o?.outsidePack&&x.length>0&&!L.has(e)&&(L.add(e),(0,n.g)(`${(0,t.basename)(e)}: semanticPolicies.add only takes effect in a pack published with \`failproofai publish\`; ${x.join(", ")} ${1===x.length?"is":"are"} never asked here`)),T.size>=500&&T.clear(),T.set(e,{fingerprint:m,hooks:u().slice(y).map(e=>({...e}))}),null}catch(s){let i=s instanceof Error?s.message:String(s),r=/Cannot find module|MODULE_NOT_FOUND|
|
|
10
|
+
export default _cjs;`,r=`failproofai-dist${i}.shim.mjs`;try{let e=(0,g.q)();await (0,p.mkdir)(e,{recursive:!0,mode:448});let t=await (0,p.lstat)(e),i="function"==typeof process.getuid?process.getuid():null;if(!t.isDirectory()||t.isSymbolicLink()||null!==i&&t.uid!==i||63&t.mode)throw Error(`${e} is not a private directory owned by this user`);let s=await v(e,r,o,!1);return{shimPath:s,shimUrl:(0,_.pathToFileURL)(s).href}}catch(e){(0,n.g)(`policy shim directory unusable (${e instanceof Error?e.message:String(e)}); falling back to ${(0,m.tmpdir)()}`)}let s=await v((0,m.tmpdir)(),r,o,!0);return{shimPath:s,shimUrl:(0,_.pathToFileURL)(s).href}}async function S(e,t,o,r=w,s){let a=[e],n=new Set,l=[],c=null;if(o&&t){let e=await F(o,t,r);l.push(e.shimPath),c=e.shimUrl}for(;a.length>0;){let t,u=a.shift();if(n.has(u))continue;if(n.add(u),s&&u===e){let e=await (0,p.readFile)(u),o=(0,i.createHash)("sha256").update(e).digest("hex");if(o!==s)throw Error(`cloud-managed policy failed integrity re-verification at load: expected ${s}, got ${o}`);t=e.toString("utf-8")}else t=await (0,p.readFile)(u,"utf-8");c&&(t=t.replace(/from\s+(['"])(?:claudeye|failproofai)\1/g,`from '${c}'`)),o&&(t=t.replace(/require\s*\(\s*(['"])(?:claudeye|failproofai)\1\s*\)/g,`require('${o.replace(/\\/g,"\\\\")}')`));let f=(0,h.dirname)(u),d=new Map;for(let e of[y,$]){let i,o=new RegExp(e.source,e.flags);for(;null!==(i=o.exec(t));){let e=i[2];if(d.has(e))continue;let t=await k(f,e);if(!t)continue;n.has(t)||a.includes(t)||a.push(t);let o=(0,h.relative)(f,t+r).split("\\").join("/");o.startsWith(".")||(o="./"+o),d.set(e,o)}}for(let e of[...d.keys()].sort((e,t)=>t.length-e.length)){let i=d.get(e),o=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=(t=t.replace(RegExp(`'${o}'`,"g"),`'${i}'`)).replace(RegExp(`"${o}"`,"g"),`"${i}"`)}let m=u+r;await (0,p.writeFile)(m,t,"utf-8"),l.push(m)}return l}async function P(e){for(let t of e)try{await (0,p.unlink)(t)}catch{}}e.i(73136);var b=e.i(49335),A=e.i(10659);e.i(16774),e.i(99891);let E="__FAILPROOFAI_LOADING_HOOKS__",O=0,T=new Map;async function U(e){let t,i,o=Number.isFinite(i=Number(process.env.FAILPROOFAI_POLICY_LOAD_TIMEOUT_MS))&&i>0?i:1e4;try{await Promise.race([import(e),new Promise((e,i)=>{t=setTimeout(()=>i(Error(`timed out loading module after ${o}ms`)),o),t.unref?.()})])}finally{t&&clearTimeout(t)}}let L=new Set;async function R(e,o){let r=globalThis;r[E]=!0;let a=[];try{let r=await j(),l=r?(0,s.pathToFileURL)(r).href:null,c=++O,p=`${w}.${process.pid}.${c}.${(0,i.randomUUID)()}.mjs`;a=await S(e,l,r,p,o?.verifyEntrySha);let m=await I(a,p),h=T.get(e);if(h?.fingerprint===m){for(let e of h.hooks)f.add({...e});return null}let _=e+p,g=(0,s.pathToFileURL)(_).href,y=u().length,$=d().length;await U(g);let x=d().slice($).map(e=>e?.name);return o?.outsidePack&&x.length>0&&!L.has(e)&&(L.add(e),(0,n.g)(`${(0,t.basename)(e)}: semanticPolicies.add only takes effect in a pack published with \`failproofai publish\`; ${x.join(", ")} ${1===x.length?"is":"are"} never asked here`)),T.size>=500&&T.clear(),T.set(e,{fingerprint:m,hooks:u().slice(y).map(e=>({...e}))}),null}catch(s){let i=s instanceof Error?s.message:String(s),r=/Cannot find module|MODULE_NOT_FOUND|Cannot find package/i.test(i)?"module_not_found":/ENOENT/i.test(i)?"file_not_found":/SyntaxError|Unexpected token/i.test(i)?"syntax_error":/timed out loading module/i.test(i)?"load_timeout":"runtime_error";if((0,b.f)((0,A.f)(),"custom_hooks_load_error",{error_type:r,is_convention:!!o?.conventionScope,convention_scope:o?.conventionScope??null,file_basename:(0,t.basename)(e)}),o?.strict)throw Error(`Failed to load custom hooks from ${e}: ${i}`);return(0,n.F)(`failed to load custom hooks from ${e}: ${i}`),{type:r,reason:i}}finally{r[E]=!1,await P(a)}}async function I(e,t){let i=(0,a.createHash)("sha256");for(let o of[...e].sort()){i.update(o.replaceAll(t,w));let e=await (0,r.readFile)(o,"utf8");i.update(e.replaceAll(t,w))}return i.digest("hex")}async function C(e,i){let r;if(!e)return[];let s=(0,t.isAbsolute)(e)?e:(0,t.resolve)(i?.sessionCwd??process.cwd(),e);if(!(0,o.existsSync)(s)){if(i?.strict)throw Error(`Custom hooks file not found: ${s}`);return(0,n.g)(`customPoliciesPath not found: ${s}`),[]}return(r=globalThis)[l]=[],r[c]=[],await R(s,i),u()}e.s(["loadCustomHooks",0,C],90521)}];
|
|
11
11
|
|
|
12
12
|
//# sourceMappingURL=src_hooks_custom-hooks-loader_ts_0lnb3n3h94wnn._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[4464,e=>{"use strict";var t=e.i(61095);e.i(2157);var
|
|
1
|
+
module.exports=[4464,e=>{"use strict";var t=e.i(61095);e.i(2157);var n=e.i(79857);async function o(e=150){return new Promise(n=>{let o=!1,a=e=>{o||(o=!0,clearTimeout(s),i.removeAllListeners(),i.destroy(),n(e))},i=(0,t.createConnection)({path:r()}),s=setTimeout(()=>a(!1),e);s.unref?.(),i.on("connect",()=>a(!0)),i.on("error",()=>a(!1))})}function r(){return process.env.FAILPROOFAI_DAEMON_SOCKET?process.env.FAILPROOFAI_DAEMON_SOCKET:(0,n._)()}async function a(e,n){let o=n?.responseTimeoutMs??3e4;return new Promise(n=>{let a,i=!1,s=e=>{clearTimeout(a),a=setTimeout(()=>u("unreachable"),e),a.unref?.()},c=e=>{i||(i=!0,clearTimeout(a),l.removeAllListeners(),l.destroy(),n(e))},u=e=>c({ok:!1,failure:e}),l=(0,t.createConnection)({path:r()});s(150);let f=Buffer.alloc(0),d=null;l.on("connect",()=>{let t,n;s(o),l.write((t=Buffer.from(JSON.stringify(e),"utf8"),(n=Buffer.alloc(4)).writeUInt32BE(t.length,0),Buffer.concat([n,t])))}),l.on("data",e=>{let t;if(f=Buffer.concat([f,e]),null===d){if(f.length<4)return;if((d=f.readUInt32BE(0))>0x1000000)return void u("unreachable");f=f.subarray(4)}if(f.length<d)return;let n=f.subarray(0,d);try{t=JSON.parse(n.toString("utf8"))}catch{u("unreachable");return}if(!t||"object"!=typeof t||Array.isArray(t))return void u("unreachable");let o=t;2!==o.protocolVersion?u("protocol-mismatch"):c({ok:!0,message:o})}),l.on("error",()=>u("unreachable")),l.on("close",()=>u("unreachable"))})}async function i(e,t){let n=await a({type:"hook",protocolVersion:2,hookEvent:e.hookEvent,cli:e.cli,stdin:e.stdin,cwd:e.cwd,agentSettingsPath:e.agentSettingsPath},t);if(!n.ok)return n;let o=n.message;return"hookResult"===o.type&&"number"==typeof o.exitCode&&"string"==typeof o.stdout&&"string"==typeof o.stderr?{ok:!0,response:{exitCode:o.exitCode,stdout:o.stdout,stderr:o.stderr}}:{ok:!1,failure:"unreachable"}}function s(e){return Array.isArray(e)&&e.every(e=>"string"==typeof e)}async function c(e,t){let n=await a({type:"policyEvaluation",protocolVersion:2,integration:e.integration,event:e.event,payload:e.payload,cwd:e.cwd,agentSettingsPath:e.agentSettingsPath},t);if(!n.ok)return n;let o=n.message,r=e=>null==e||"string"==typeof e;return"policyResult"===o.type&&("allow"===o.decision||"deny"===o.decision||"instruct"===o.decision)&&s(o.policyNames)&&r(o.reason)&&s(o.matchedPolicies)&&"number"==typeof o.durationMs&&Number.isInteger(o.durationMs)&&o.durationMs>=0&&r(o.toolName)?{ok:!0}:{ok:!1,failure:"unreachable"}}e.i(32127),e.s(["attemptDaemonHook",0,i,"attemptDaemonPolicyEvaluation",0,c,"daemonAcceptsConnections",0,o])}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=src_hooks_daemon-client_ts_0il_yu1zc0291._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[79857,e=>{"use strict";var s=e.i(60526),o=e.i(50227);function
|
|
1
|
+
module.exports=[79857,e=>{"use strict";var s=e.i(60526),o=e.i(50227);function i(e){return e?(0,o.resolve)(e,".failproofai"):process.env.FAILPROOFAI_HOME||(0,o.resolve)((0,s.homedir)(),".failproofai")}let r=(e,...s)=>e?(0,o.resolve)(i(e),...s):((...e)=>(0,o.resolve)(i(),...e))(...s),l=e=>(0,o.resolve)(r(e,"policies"),"packs"),a=e=>r(e,"run");e.s(["r",0,e=>(0,o.resolve)(r(e,"audit"),"cache"),"X",0,e=>(0,o.resolve)(r(e,"audit"),"dashboard.json"),"D",0,e=>(0,o.resolve)(a(e),"audit.lock"),"e",0,e=>(0,o.resolve)(r(e,"audit"),"session.json"),"I",0,e=>(0,o.resolve)(r(e,"policies"),"cloud-policies"),"V",0,e=>(0,o.resolve)(r(e,"state"),"codex-session-paths.json"),"y",0,e=>r(e,"config.json"),"_",0,()=>process.env.FAILPROOFAI_DAEMON_SOCKET||(0,o.resolve)(a(),"failproofaid.sock"),"J",0,i,"O",0,e=>r(e,"policies-config.json"),"A",0,e=>r(e,"logs"),"u",0,e=>r(e,"migrations"),"n",0,l,"v",0,e=>(0,o.resolve)(l(e),"installed.json"),"m",0,a,"q",0,e=>(0,o.resolve)(r(e,"state"),"shims"),"z",0,e=>(0,o.resolve)(r(e,"state"),"telemetry-id")])}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=src_hooks_fp-home_ts_09kv0bn_4twyh._.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[[1375,a=>{var b=a.i(5050);let c=(0,b.createServerReference)("00de9ed6392ff068792d68e272f943ca9a05f589fa",b.callServer,void 0,b.findSourceMapURL,"getTelemetryConfig");a.s(["f",0,c])},3171,a=>{var b=a.i(87924),c=a.i(72131),d=a.i(1375),e=a.i(66036);a.s(["default",0,function({error:a,reset:f}){return(0,c.useEffect)(()=>{(0,d.f)().then(b=>{(0,e.$)(b),(0,e.L)("client_error",{error_message:a.message,error_name:a.name,error_digest:a.digest,boundary:"global"})}).catch(()=>{})},[a]),(0,b.jsx)("html",{children:(0,b.jsx)("body",{children:(0,b.jsx)("main",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",background:"#031035",color:"#f8fafc",fontFamily:"system-ui, sans-serif"},children:(0,b.jsxs)("div",{style:{textAlign:"center",padding:"2rem",border:"1px solid rgba(239,68,68,0.4)",borderRadius:"0.5rem",maxWidth:"500px"},children:[(0,b.jsx)("h2",{style:{color:"#ef4444",marginBottom:"0.5rem",fontSize:"1.25rem"},children:"Something went wrong"}),(0,b.jsx)("p",{style:{color:"#94a3b8",marginBottom:"1.5rem"},children:a.message||"An unexpected error occurred."}),(0,b.jsx)("button",{onClick:f,style:{padding:"0.5rem 1.25rem",background:"#3b82f6",color:"white",border:"none",borderRadius:"0.375rem",cursor:"pointer",fontSize:"0.875rem"},children:"Try again"})]})})})})}])},66036,a=>{a.s(["L",0,function(a,b){},"$",0,function(a){}])},5050,(a,b,c)=>{Object.defineProperty(c,"__esModule",{value:!0});var d={callServer:function(){return f.callServer},createServerReference:function(){return h.createServerReference},findSourceMapURL:function(){return g.findSourceMapURL}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(20611),g=a.r(1722),h=a.r(38783)},42602,(a,b,c)=>{b.exports=a.r(18622)},9270,(a,b,c)=>{b.exports=a.r(42602).vendored.contexts.AppRouterContext},36313,(a,b,c)=>{b.exports=a.r(42602).vendored.contexts.HooksClientContext},18341,(a,b,c)=>{b.exports=a.r(42602).vendored.contexts.ServerInsertedHtml},35112,(a,b,c)=>{b.exports=a.r(42602).vendored["react-ssr"].ReactDOM},87924,(a,b,c)=>{b.exports=a.r(42602).vendored["react-ssr"].ReactJsxRuntime},38783,(a,b,c)=>{b.exports=a.r(42602).vendored["react-ssr"].ReactServerDOMTurbopackClient},72131,(a,b,c)=>{b.exports=a.r(42602).vendored["react-ssr"].React}],18622,(a,b,c)=>{b.exports=a.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},20635,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},24725,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},43285,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/dynamic-access-async-storage.external.js",()=>require("next/dist/server/app-render/dynamic-access-async-storage.external.js"))},56704,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},59043,(a,b,c)=>{b.exports=a.x("next/dist/server/runtime-reacts.external.js",()=>require("next/dist/server/runtime-reacts.external.js"))}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__0588st-tpiuia._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[[26035,a=>{var b=a.i(36359);a.S([b,"
|
|
1
|
+
module.exports=[[26035,a=>{var b=a.i(36359);a.S([b,"00de9ed6392ff068792d68e272f943ca9a05f589fa,f"],26035)},36359,a=>{var b=a.i(37936),c=a.i(69839);a.i(93328);var d=a.i(31920),e=a.i(12072);async function f(){let a=(0,d.f)();return{enabled:a,distinctId:a?(0,c._)():"",apiKey:process.env.FAILPROOFAI_POSTHOG_KEY??"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX",host:process.env.FAILPROOFAI_POSTHOG_HOST??"https://us.i.posthog.com",version:e.version}}(0,a.i(13095).ensureServerEntryExports)([f]),(0,b.registerServerReference)(f,"00de9ed6392ff068792d68e272f943ca9a05f589fa",null),a.s(["f",0,f])},8674,a=>{var b=a.i(2157),c=a.i(50227),d=a.i(66680);a.s(["f",0,function(a,e,f={}){let g=f.mode??384,h=f.dirMode??448,i=(0,c.dirname)(a);(0,b.existsSync)(i)||(0,b.mkdirSync)(i,{recursive:!0,mode:h});let j=`${a}.${process.pid}.${(0,d.randomBytes)(6).toString("hex")}.tmp`;try{(0,b.writeFileSync)(j,JSON.stringify(e,null,2),{mode:g});try{(63&(0,b.statSync)(j).mode)!=0&&(0,b.chmodSync)(j,g)}catch{}(0,b.renameSync)(j,a);try{(63&(0,b.statSync)(a).mode)!=0&&(0,b.chmodSync)(a,g)}catch{}}catch(a){try{(0,b.rmSync)(j,{force:!0})}catch{}throw a}}])}],74533,(a,b,c)=>{b.exports=a.x("node:child_process",()=>require("node:child_process"))},66680,(a,b,c)=>{b.exports=a.x("node:crypto",()=>require("node:crypto"))},2157,(a,b,c)=>{b.exports=a.x("node:fs",()=>require("node:fs"))},60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},2726,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[externals]__12qr51qgrrt6o._.js","server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_11bnuznb72p7z._.js"].map(b=>a.l(b))).then(()=>b(74493)))}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=%5Broot-of-the-server%5D__08ch3staq3ejw._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
module.exports=[60815,a=>{a.v(a=>Promise.resolve().then(()=>a(24868)))},2726,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[externals]__0ilfh9mfnzsth._.js","server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_11bnuznb72p7z._.js"].map(b=>a.l(b))).then(()=>b(74493)))},6188,a=>{a.v(a=>Promise.resolve().then(()=>a(15638)))},84670,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[externals]_node_net_1yam_zj43-40b._.js","server/chunks/ssr/src_hooks_daemon-client_ts_0k41_i7jg6ndv._.js"].map(b=>a.l(b))).then(()=>b(32271)))},49679,a=>{a.v(b=>Promise.all(["server/chunks/ssr/src_hooks_semantic_pack-policies_ts_0gh_bu_3oswax._.js","server/chunks/ssr/src_hooks_pack-cli_ts_0t7me658zqmh_._.js"].map(b=>a.l(b))).then(()=>b(31934)))}];
|
|
2
2
|
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__0b78b0j8iyv6l._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[[99558,a=>{var b=a.i(36359),c=a.i(37936),d=a.i(15501);async function e(){let a=(0,d.x)();if(!a){let a=(0,d.t)();return{status:"empty",expired:null!==a,expiredAt:a?.cachedAt??null}}return{status:"cached",cachedAt:a.cachedAt,params:a.params,result:a.result}}(0,a.i(13095).ensureServerEntryExports)([e]),(0,c.registerServerReference)(e,"
|
|
1
|
+
module.exports=[[99558,a=>{var b=a.i(36359),c=a.i(37936),d=a.i(15501);async function e(){let a=(0,d.x)();if(!a){let a=(0,d.t)();return{status:"empty",expired:null!==a,expiredAt:a?.cachedAt??null}}return{status:"cached",cachedAt:a.cachedAt,params:a.params,result:a.result}}(0,a.i(13095).ensureServerEntryExports)([e]),(0,c.registerServerReference)(e,"002221848076906f86c47312eaef10191a5ff7094d",null),a.s(["002221848076906f86c47312eaef10191a5ff7094d",0,e,"00de9ed6392ff068792d68e272f943ca9a05f589fa",()=>b.f],99558)},36359,a=>{var b=a.i(37936),c=a.i(69839);a.i(93328);var d=a.i(31920),e=a.i(12072);async function f(){let a=(0,d.f)();return{enabled:a,distinctId:a?(0,c._)():"",apiKey:process.env.FAILPROOFAI_POSTHOG_KEY??"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX",host:process.env.FAILPROOFAI_POSTHOG_HOST??"https://us.i.posthog.com",version:e.version}}(0,a.i(13095).ensureServerEntryExports)([f]),(0,b.registerServerReference)(f,"00de9ed6392ff068792d68e272f943ca9a05f589fa",null),a.s(["f",0,f])},8674,a=>{var b=a.i(2157),c=a.i(50227),d=a.i(66680);a.s(["f",0,function(a,e,f={}){let g=f.mode??384,h=f.dirMode??448,i=(0,c.dirname)(a);(0,b.existsSync)(i)||(0,b.mkdirSync)(i,{recursive:!0,mode:h});let j=`${a}.${process.pid}.${(0,d.randomBytes)(6).toString("hex")}.tmp`;try{(0,b.writeFileSync)(j,JSON.stringify(e,null,2),{mode:g});try{(63&(0,b.statSync)(j).mode)!=0&&(0,b.chmodSync)(j,g)}catch{}(0,b.renameSync)(j,a);try{(63&(0,b.statSync)(a).mode)!=0&&(0,b.chmodSync)(a,g)}catch{}}catch(a){try{(0,b.rmSync)(j,{force:!0})}catch{}throw a}}])}],74533,(a,b,c)=>{b.exports=a.x("node:child_process",()=>require("node:child_process"))},66680,(a,b,c)=>{b.exports=a.x("node:crypto",()=>require("node:crypto"))},2157,(a,b,c)=>{b.exports=a.x("node:fs",()=>require("node:fs"))},60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=%5Broot-of-the-server%5D__0bigvy9xmv2ka._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[[7292,a=>{var b=a.i(37936),c=a.i(1144);async function d(a){return(0,c.b)(a)}async function e(a,b){return(0,c.c)(a,b)}(0,a.i(13095).ensureServerEntryExports)([d,e]),(0,b.registerServerReference)(d,"
|
|
1
|
+
module.exports=[[7292,a=>{var b=a.i(37936),c=a.i(1144);async function d(a){return(0,c.b)(a)}async function e(a,b){return(0,c.c)(a,b)}(0,a.i(13095).ensureServerEntryExports)([d,e]),(0,b.registerServerReference)(d,"40620aef35573c0f70760dade2911af54d7bb6bdcd",null),(0,b.registerServerReference)(e,"601da5259db8771c5daa055322e9f6abf5b570520a",null),a.s(["x",0,d,"m",0,e])},36359,a=>{var b=a.i(37936),c=a.i(69839);a.i(93328);var d=a.i(31920),e=a.i(12072);async function f(){let a=(0,d.f)();return{enabled:a,distinctId:a?(0,c._)():"",apiKey:process.env.FAILPROOFAI_POSTHOG_KEY??"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX",host:process.env.FAILPROOFAI_POSTHOG_HOST??"https://us.i.posthog.com",version:e.version}}(0,a.i(13095).ensureServerEntryExports)([f]),(0,b.registerServerReference)(f,"00de9ed6392ff068792d68e272f943ca9a05f589fa",null),a.s(["f",0,f])},8674,a=>{var b=a.i(2157),c=a.i(50227),d=a.i(66680);a.s(["f",0,function(a,e,f={}){let g=f.mode??384,h=f.dirMode??448,i=(0,c.dirname)(a);(0,b.existsSync)(i)||(0,b.mkdirSync)(i,{recursive:!0,mode:h});let j=`${a}.${process.pid}.${(0,d.randomBytes)(6).toString("hex")}.tmp`;try{(0,b.writeFileSync)(j,JSON.stringify(e,null,2),{mode:g});try{(63&(0,b.statSync)(j).mode)!=0&&(0,b.chmodSync)(j,g)}catch{}(0,b.renameSync)(j,a);try{(63&(0,b.statSync)(a).mode)!=0&&(0,b.chmodSync)(a,g)}catch{}}catch(a){try{(0,b.rmSync)(j,{force:!0})}catch{}throw a}}])}],74533,(a,b,c)=>{b.exports=a.x("node:child_process",()=>require("node:child_process"))}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=%5Broot-of-the-server%5D__0h86bl2qf0k_o._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
module.exports=[54799,(a,b,c)=>{b.exports=a.x("crypto",()=>require("crypto"))},60815,a=>{a.v(a=>Promise.resolve().then(()=>a(24868)))},20635,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},24725,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},56704,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},59043,(a,b,c)=>{b.exports=a.x("next/dist/server/runtime-reacts.external.js",()=>require("next/dist/server/runtime-reacts.external.js"))},27028,(a,b,c)=>{b.exports=a.x("node:zlib",()=>require("node:zlib"))},717,(a,b,c)=>{"use strict";b.exports=a.r(24951).vendored["react-rsc"].React},2726,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[externals]__0ohnuzsaozaca._.js","server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_11bnuznb72p7z._.js"].map(b=>a.l(b))).then(()=>b(74493)))},84670,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[externals]_node_net_1yam_zj43-40b._.js","server/chunks/ssr/src_hooks_daemon-client_ts_0k41_i7jg6ndv._.js"].map(b=>a.l(b))).then(()=>b(32271)))}];
|
|
2
2
|
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__0naevg4bcoh54._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[[7292,a=>{var b=a.i(37936),c=a.i(1144);async function d(a){return(0,c.b)(a)}async function e(a,b){return(0,c.c)(a,b)}(0,a.i(13095).ensureServerEntryExports)([d,e]),(0,b.registerServerReference)(d,"
|
|
1
|
+
module.exports=[[7292,a=>{var b=a.i(37936),c=a.i(1144);async function d(a){return(0,c.b)(a)}async function e(a,b){return(0,c.c)(a,b)}(0,a.i(13095).ensureServerEntryExports)([d,e]),(0,b.registerServerReference)(d,"40620aef35573c0f70760dade2911af54d7bb6bdcd",null),(0,b.registerServerReference)(e,"601da5259db8771c5daa055322e9f6abf5b570520a",null),a.s(["x",0,d,"m",0,e])},36359,a=>{var b=a.i(37936),c=a.i(69839);a.i(93328);var d=a.i(31920),e=a.i(12072);async function f(){let a=(0,d.f)();return{enabled:a,distinctId:a?(0,c._)():"",apiKey:process.env.FAILPROOFAI_POSTHOG_KEY??"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX",host:process.env.FAILPROOFAI_POSTHOG_HOST??"https://us.i.posthog.com",version:e.version}}(0,a.i(13095).ensureServerEntryExports)([f]),(0,b.registerServerReference)(f,"00de9ed6392ff068792d68e272f943ca9a05f589fa",null),a.s(["f",0,f])},8674,a=>{var b=a.i(2157),c=a.i(50227),d=a.i(66680);a.s(["f",0,function(a,e,f={}){let g=f.mode??384,h=f.dirMode??448,i=(0,c.dirname)(a);(0,b.existsSync)(i)||(0,b.mkdirSync)(i,{recursive:!0,mode:h});let j=`${a}.${process.pid}.${(0,d.randomBytes)(6).toString("hex")}.tmp`;try{(0,b.writeFileSync)(j,JSON.stringify(e,null,2),{mode:g});try{(63&(0,b.statSync)(j).mode)!=0&&(0,b.chmodSync)(j,g)}catch{}(0,b.renameSync)(j,a);try{(63&(0,b.statSync)(a).mode)!=0&&(0,b.chmodSync)(a,g)}catch{}}catch(a){try{(0,b.rmSync)(j,{force:!0})}catch{}throw a}}])}],74533,(a,b,c)=>{b.exports=a.x("node:child_process",()=>require("node:child_process"))},66680,(a,b,c)=>{b.exports=a.x("node:crypto",()=>require("node:crypto"))},2157,(a,b,c)=>{b.exports=a.x("node:fs",()=>require("node:fs"))},60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=%5Broot-of-the-server%5D__0pia5h3p8re4c._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[[24190,a=>{var b=a.i(36359);a.S([b,"
|
|
1
|
+
module.exports=[[24190,a=>{var b=a.i(36359);a.S([b,"00de9ed6392ff068792d68e272f943ca9a05f589fa,f"],24190)},36359,a=>{var b=a.i(37936),c=a.i(69839);a.i(93328);var d=a.i(31920),e=a.i(12072);async function f(){let a=(0,d.f)();return{enabled:a,distinctId:a?(0,c._)():"",apiKey:process.env.FAILPROOFAI_POSTHOG_KEY??"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX",host:process.env.FAILPROOFAI_POSTHOG_HOST??"https://us.i.posthog.com",version:e.version}}(0,a.i(13095).ensureServerEntryExports)([f]),(0,b.registerServerReference)(f,"00de9ed6392ff068792d68e272f943ca9a05f589fa",null),a.s(["f",0,f])},8674,a=>{var b=a.i(2157),c=a.i(50227),d=a.i(66680);a.s(["f",0,function(a,e,f={}){let g=f.mode??384,h=f.dirMode??448,i=(0,c.dirname)(a);(0,b.existsSync)(i)||(0,b.mkdirSync)(i,{recursive:!0,mode:h});let j=`${a}.${process.pid}.${(0,d.randomBytes)(6).toString("hex")}.tmp`;try{(0,b.writeFileSync)(j,JSON.stringify(e,null,2),{mode:g});try{(63&(0,b.statSync)(j).mode)!=0&&(0,b.chmodSync)(j,g)}catch{}(0,b.renameSync)(j,a);try{(63&(0,b.statSync)(a).mode)!=0&&(0,b.chmodSync)(a,g)}catch{}}catch(a){try{(0,b.rmSync)(j,{force:!0})}catch{}throw a}}])}],74533,(a,b,c)=>{b.exports=a.x("node:child_process",()=>require("node:child_process"))},66680,(a,b,c)=>{b.exports=a.x("node:crypto",()=>require("node:crypto"))},2157,(a,b,c)=>{b.exports=a.x("node:fs",()=>require("node:fs"))},60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},2726,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[externals]__12qr51qgrrt6o._.js","server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_11bnuznb72p7z._.js"].map(b=>a.l(b))).then(()=>b(74493)))}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=%5Broot-of-the-server%5D__1-ey9fgesfbc0._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[24868,(a,b,c)=>{b.exports=a.x("fs/promises",()=>require("fs/promises"))},74533,(a,b,c)=>{b.exports=a.x("node:child_process",()=>require("node:child_process"))},66680,(a,b,c)=>{b.exports=a.x("node:crypto",()=>require("node:crypto"))},2157,(a,b,c)=>{b.exports=a.x("node:fs",()=>require("node:fs"))},12714,(a,b,c)=>{b.exports=a.x("node:fs/promises",()=>require("node:fs/promises"))},44376,(a,b,c)=>{b.exports=a.x("node:module",()=>require("node:module"))},60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},57764,(a,b,c)=>{b.exports=a.x("node:url",()=>require("node:url"))},46786,(a,b,c)=>{b.exports=a.x("os",()=>require("os"))},14747,(a,b,c)=>{b.exports=a.x("path",()=>require("path"))},92509,(a,b,c)=>{b.exports=a.x("url",()=>require("url"))},36359,a=>{"use strict";var b=a.i(37936),c=a.i(69839);a.i(93328);var d=a.i(31920),e=a.i(12072);async function f(){let a=(0,d.f)();return{enabled:a,distinctId:a?(0,c._)():"",apiKey:process.env.FAILPROOFAI_POSTHOG_KEY??"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX",host:process.env.FAILPROOFAI_POSTHOG_HOST??"https://us.i.posthog.com",version:e.version}}(0,a.i(13095).ensureServerEntryExports)([f]),(0,b.registerServerReference)(f,"
|
|
1
|
+
module.exports=[24868,(a,b,c)=>{b.exports=a.x("fs/promises",()=>require("fs/promises"))},74533,(a,b,c)=>{b.exports=a.x("node:child_process",()=>require("node:child_process"))},66680,(a,b,c)=>{b.exports=a.x("node:crypto",()=>require("node:crypto"))},2157,(a,b,c)=>{b.exports=a.x("node:fs",()=>require("node:fs"))},12714,(a,b,c)=>{b.exports=a.x("node:fs/promises",()=>require("node:fs/promises"))},44376,(a,b,c)=>{b.exports=a.x("node:module",()=>require("node:module"))},60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},57764,(a,b,c)=>{b.exports=a.x("node:url",()=>require("node:url"))},46786,(a,b,c)=>{b.exports=a.x("os",()=>require("os"))},14747,(a,b,c)=>{b.exports=a.x("path",()=>require("path"))},92509,(a,b,c)=>{b.exports=a.x("url",()=>require("url"))},36359,a=>{"use strict";var b=a.i(37936),c=a.i(69839);a.i(93328);var d=a.i(31920),e=a.i(12072);async function f(){let a=(0,d.f)();return{enabled:a,distinctId:a?(0,c._)():"",apiKey:process.env.FAILPROOFAI_POSTHOG_KEY??"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX",host:process.env.FAILPROOFAI_POSTHOG_HOST??"https://us.i.posthog.com",version:e.version}}(0,a.i(13095).ensureServerEntryExports)([f]),(0,b.registerServerReference)(f,"00de9ed6392ff068792d68e272f943ca9a05f589fa",null),a.s(["f",0,f])},8674,a=>{"use strict";var b=a.i(2157),c=a.i(50227),d=a.i(66680);a.s(["f",0,function(a,e,f={}){let g=f.mode??384,h=f.dirMode??448,i=(0,c.dirname)(a);(0,b.existsSync)(i)||(0,b.mkdirSync)(i,{recursive:!0,mode:h});let j=`${a}.${process.pid}.${(0,d.randomBytes)(6).toString("hex")}.tmp`;try{(0,b.writeFileSync)(j,JSON.stringify(e,null,2),{mode:g});try{(63&(0,b.statSync)(j).mode)!=0&&(0,b.chmodSync)(j,g)}catch{}(0,b.renameSync)(j,a);try{(63&(0,b.statSync)(a).mode)!=0&&(0,b.chmodSync)(a,g)}catch{}}catch(a){try{(0,b.rmSync)(j,{force:!0})}catch{}throw a}}])}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=%5Broot-of-the-server%5D__15usvs-ms-0hf._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[[37985,a=>{var b=a.i(36359);a.S([b,"
|
|
1
|
+
module.exports=[[37985,a=>{var b=a.i(36359);a.S([b,"00de9ed6392ff068792d68e272f943ca9a05f589fa,f"],37985)},36359,a=>{var b=a.i(37936),c=a.i(69839);a.i(93328);var d=a.i(31920),e=a.i(12072);async function f(){let a=(0,d.f)();return{enabled:a,distinctId:a?(0,c._)():"",apiKey:process.env.FAILPROOFAI_POSTHOG_KEY??"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX",host:process.env.FAILPROOFAI_POSTHOG_HOST??"https://us.i.posthog.com",version:e.version}}(0,a.i(13095).ensureServerEntryExports)([f]),(0,b.registerServerReference)(f,"00de9ed6392ff068792d68e272f943ca9a05f589fa",null),a.s(["f",0,f])},8674,a=>{var b=a.i(2157),c=a.i(50227),d=a.i(66680);a.s(["f",0,function(a,e,f={}){let g=f.mode??384,h=f.dirMode??448,i=(0,c.dirname)(a);(0,b.existsSync)(i)||(0,b.mkdirSync)(i,{recursive:!0,mode:h});let j=`${a}.${process.pid}.${(0,d.randomBytes)(6).toString("hex")}.tmp`;try{(0,b.writeFileSync)(j,JSON.stringify(e,null,2),{mode:g});try{(63&(0,b.statSync)(j).mode)!=0&&(0,b.chmodSync)(j,g)}catch{}(0,b.renameSync)(j,a);try{(63&(0,b.statSync)(a).mode)!=0&&(0,b.chmodSync)(a,g)}catch{}}catch(a){try{(0,b.rmSync)(j,{force:!0})}catch{}throw a}}])}],74533,(a,b,c)=>{b.exports=a.x("node:child_process",()=>require("node:child_process"))},66680,(a,b,c)=>{b.exports=a.x("node:crypto",()=>require("node:crypto"))},2157,(a,b,c)=>{b.exports=a.x("node:fs",()=>require("node:fs"))},60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},2726,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[externals]__12qr51qgrrt6o._.js","server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_11bnuznb72p7z._.js"].map(b=>a.l(b))).then(()=>b(74493)))}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=%5Broot-of-the-server%5D__16gb3_92zvk5x._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[[39027,a=>{var b=a.i(36359);a.S([b,"
|
|
1
|
+
module.exports=[[39027,a=>{var b=a.i(36359);a.S([b,"00de9ed6392ff068792d68e272f943ca9a05f589fa,f"],39027)},36359,a=>{var b=a.i(37936),c=a.i(69839);a.i(93328);var d=a.i(31920),e=a.i(12072);async function f(){let a=(0,d.f)();return{enabled:a,distinctId:a?(0,c._)():"",apiKey:process.env.FAILPROOFAI_POSTHOG_KEY??"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX",host:process.env.FAILPROOFAI_POSTHOG_HOST??"https://us.i.posthog.com",version:e.version}}(0,a.i(13095).ensureServerEntryExports)([f]),(0,b.registerServerReference)(f,"00de9ed6392ff068792d68e272f943ca9a05f589fa",null),a.s(["f",0,f])},8674,a=>{var b=a.i(2157),c=a.i(50227),d=a.i(66680);a.s(["f",0,function(a,e,f={}){let g=f.mode??384,h=f.dirMode??448,i=(0,c.dirname)(a);(0,b.existsSync)(i)||(0,b.mkdirSync)(i,{recursive:!0,mode:h});let j=`${a}.${process.pid}.${(0,d.randomBytes)(6).toString("hex")}.tmp`;try{(0,b.writeFileSync)(j,JSON.stringify(e,null,2),{mode:g});try{(63&(0,b.statSync)(j).mode)!=0&&(0,b.chmodSync)(j,g)}catch{}(0,b.renameSync)(j,a);try{(63&(0,b.statSync)(a).mode)!=0&&(0,b.chmodSync)(a,g)}catch{}}catch(a){try{(0,b.rmSync)(j,{force:!0})}catch{}throw a}}])}],74533,(a,b,c)=>{b.exports=a.x("node:child_process",()=>require("node:child_process"))},66680,(a,b,c)=>{b.exports=a.x("node:crypto",()=>require("node:crypto"))},2157,(a,b,c)=>{b.exports=a.x("node:fs",()=>require("node:fs"))},60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},2726,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[externals]__12qr51qgrrt6o._.js","server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_11bnuznb72p7z._.js"].map(b=>a.l(b))).then(()=>b(74493)))}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=%5Broot-of-the-server%5D__1avi2kypusyb_._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[[165,a=>{var b=a.i(36359);a.S([b,"
|
|
1
|
+
module.exports=[[165,a=>{var b=a.i(36359);a.S([b,"00de9ed6392ff068792d68e272f943ca9a05f589fa,f"],165)},36359,a=>{var b=a.i(37936),c=a.i(69839);a.i(93328);var d=a.i(31920),e=a.i(12072);async function f(){let a=(0,d.f)();return{enabled:a,distinctId:a?(0,c._)():"",apiKey:process.env.FAILPROOFAI_POSTHOG_KEY??"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX",host:process.env.FAILPROOFAI_POSTHOG_HOST??"https://us.i.posthog.com",version:e.version}}(0,a.i(13095).ensureServerEntryExports)([f]),(0,b.registerServerReference)(f,"00de9ed6392ff068792d68e272f943ca9a05f589fa",null),a.s(["f",0,f])},8674,a=>{var b=a.i(2157),c=a.i(50227),d=a.i(66680);a.s(["f",0,function(a,e,f={}){let g=f.mode??384,h=f.dirMode??448,i=(0,c.dirname)(a);(0,b.existsSync)(i)||(0,b.mkdirSync)(i,{recursive:!0,mode:h});let j=`${a}.${process.pid}.${(0,d.randomBytes)(6).toString("hex")}.tmp`;try{(0,b.writeFileSync)(j,JSON.stringify(e,null,2),{mode:g});try{(63&(0,b.statSync)(j).mode)!=0&&(0,b.chmodSync)(j,g)}catch{}(0,b.renameSync)(j,a);try{(63&(0,b.statSync)(a).mode)!=0&&(0,b.chmodSync)(a,g)}catch{}}catch(a){try{(0,b.rmSync)(j,{force:!0})}catch{}throw a}}])}],74533,(a,b,c)=>{b.exports=a.x("node:child_process",()=>require("node:child_process"))},66680,(a,b,c)=>{b.exports=a.x("node:crypto",()=>require("node:crypto"))},2157,(a,b,c)=>{b.exports=a.x("node:fs",()=>require("node:fs"))},60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},2726,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[externals]__12qr51qgrrt6o._.js","server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_11bnuznb72p7z._.js"].map(b=>a.l(b))).then(()=>b(74493)))}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=%5Broot-of-the-server%5D__1r7drlqli-ado._.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module.exports=[[35874,a=>{var b=a.i(36359),c=a.i(36119),d=a.i(41289),e=a.i(37936),f=a.i(2157),g=a.i(50227),h=a.i(5246),i=a.i(8674);let j=new Set(["localhost","127.0.0.1","::1","[::1]","0:0:0:0:0:0:0:1"]);function k(a){let b=a.trim().toLowerCase();return!!b&&(!!j.has(b)||/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(b))}var l=a.i(87481),m=a.i(55113),n=a.i(13095);let o="this request did not come from the dashboard in your browser, so nothing was written.",p="env-key-stand-in";async function q(){var a,b;let c;try{c=await (0,h.headers)()}catch{return o}let d=k((a=void 0,b=process.env.FAILPROOFAI_DASHBOARD_HOST,(a??b??"").trim()||"127.0.0.1")),e=c.get("host");if(d&&(!e||!k(function(a){let b=a.trim();if(b.startsWith("[")){let a=b.indexOf("]");return -1===a?b:b.slice(0,a+1)}let c=b.indexOf(":");return -1===c?b:b.slice(0,c)}(e))))return o;let f=c.get("origin");if(!f)return d?null:o;let g=null;try{g=new URL(f).host.toLowerCase()}catch{g=null}return g&&g===(e??"").toLowerCase()?null:o}function r(a){if(!a)return null;let b=(0,l.A)(a);if(!b.ok)return null;try{let a=new URL(b.value).origin;return"null"===a?null:a}catch{return null}}function s(a){let b=(0,g.dirname)(a);try{let a=511&(0,f.statSync)(b).mode;(18&a)!=0&&(0,f.chmodSync)(b,-19&a)}catch{}}async function t(a){let b=await q();if(b)return{ok:!1,problem:b};let c=a.provider.trim();if(!l.n.includes(c))return{ok:!1,problem:`provider must be one of ${l.n.join(", ")}`};if(c===l.e)return{ok:!1,problem:"FailproofAI Cloud's Jev is turned on by connecting this machine (failproofai config --token <key>), and switched with the mode control — not saved from this form."};let e=(0,l._)(a.mode);if(null===e)return{ok:!1,problem:'mode must be "off", "observe" or "enforce".'};let f=a.baseUrl.trim(),g=f?(0,l.A)(f):null;if(g&&!g.ok)return{ok:!1,problem:g.problem};let h=(0,l.Z)(),j=h?.raw??null,k=null!==j&&j.provider===c;if(g?.ok){let a=(0,l.A)(j?.baseUrl),b=k&&a.ok&&(0,l.T)(a.value).url===(0,l.T)(g.value).url,d=b?null:(0,l.O)(c,g.value);if(d)return{ok:!1,problem:`${d}.`};let e=b?null:(0,l.f)(g.value);if(e)return{ok:!1,problem:`that url is an endpoint, not an api base — its path ends in ${e.suffix}. ${(0,m.G)(g.value)} Use ${(0,l.T)(e.base).url} instead.`}}let n=k?{...j}:{};!k&&j&&(void 0!==j.mode&&(n.mode=j.mode),void 0!==j.timeoutMs&&(n.timeoutMs=j.timeoutMs)),n.provider=c,f?n.baseUrl=function(a,b){if("string"!=typeof b||""===b)return a;let c=(0,l.A)(b);if(!c.ok)return a;let d=(0,l.T)(c.value);if(!d.hadQuery)return a;let e=(0,l.A)(a);return e.ok&&e.value===d.url?c.value:a}(f,j?.baseUrl):delete n.baseUrl;let o=a.accountId.trim();"cloudflare"===c&&o?n.accountId=o:delete n.accountId,n.mode=e;let t=k&&h?.tooOpen!==!0&&r(f)===r("string"==typeof j?.baseUrl?j.baseUrl:""),u="string"==typeof j?.apiKey&&""!==j.apiKey,v=null!==j&&!u&&(0,l.P)(j,p).ok,w=a.token.trim();if(w){let a=(0,l.$)(w);if(a)return{ok:!1,problem:a,needsToken:!0};n.apiKey=w}else if(!t&&!v)return{ok:!1,needsToken:!0,problem:u?k&&h?.tooOpen===!0?`${(0,l.W)()} was open to other users, so the endpoint it names may not be one you chose and its stored token is not reused. check the endpoint above, then enter the token for it.`:k?"that endpoint is not the one the stored token was given for, so it is not sent there. enter the token for it.":"enter the token for this provider.":"enter the token for this provider."};let x=void 0===n.apiKey,y=(0,l.P)(n,x?p:null);if(!y.ok)return{ok:!1,problem:y.problem,...!0===y.missingKey?{needsToken:!0}:{}};let z=(0,l.W)();try{(0,i.f)(z,n,{mode:384,dirMode:448})}catch(a){return{ok:!1,problem:`could not write ${z} (${a.code??"error"}).`}}return s(z),{ok:!0,view:await (0,d.f)()}}async function u(a){let b=await q();if(b)return{ok:!1,problem:b};let c=(0,l._)(a);if(null===c)return{ok:!1,problem:'mode must be "off", "observe" or "enforce".'};let e=(0,l.Z)();if(null===e)return{ok:!1,problem:`there is no readable ${(0,l.W)()} to switch. connect this machine (failproofai config --token <key>) or set up your own endpoint below.`};if(e.tooOpen)return{ok:!1,problem:`${(0,l.W)()} is open to other users, so Jev is already off and the endpoint it names is not trusted. fix its permissions first (chmod 600, and chmod 700 on its directory).`};let f={...e.raw,mode:c},g=f.provider===l.e,h=(0,l.P)(f,g||"string"==typeof f.apiKey?null:p,g?{url:function(a){if("string"!=typeof a)return"";try{return new URL(a).origin}catch{return""}}(f.baseUrl),key:p}:null);if(!h.ok)return{ok:!1,problem:h.problem};let j=(0,l.W)();try{(0,i.f)(j,f,{mode:384,dirMode:448})}catch(a){return{ok:!1,problem:`could not write ${j} (${a.code??"error"}).`}}return s(j),{ok:!0,view:await (0,d.f)()}}async function v(){let a=await q();if(a)return{ok:!1,problem:a};let b=(0,l.W)();if((0,f.existsSync)(b))try{(0,f.unlinkSync)(b)}catch(a){return{ok:!1,problem:`could not remove ${b} (${a.code??"error"}).`}}return{ok:!0,view:await (0,d.f)()}}(0,n.ensureServerEntryExports)([t,u,v]),(0,e.registerServerReference)(t,"40efd95eef98ad185ef9d139a21ca7d1d6905e34d5",null),(0,e.registerServerReference)(u,"4051bcb104f743e8e533ce34b83cc84eca2f875736",null),(0,e.registerServerReference)(v,"000f25cb570f9ee8b2f54da19de57f679d6e17a052",null);var w=a.i(21572),x=a.i(81243);async function y(a){if(a&&!await (0,x.s)()){let a=(0,x.M)();return{ok:!1,reason:a&&1e3*a.refresh_expires_at>Date.now()?"unreachable":"signed-out"}}return{ok:!0,auto:(0,w.t)({audit:a?{auto:!0,reportsConsentedAt:Date.now()}:{auto:!1}}).audit.auto}}async function z(a){return(0,w.t)({audit:{intervalDays:a}}),{intervalDays:(0,w.s)().audit.intervalDays}}(0,n.ensureServerEntryExports)([y,z]),(0,e.registerServerReference)(y,"40c9442f8916b211fed78371a2bff660dea301ef3c",null),(0,e.registerServerReference)(z,"406b9805673a46697a80acba35ac964f3ef5e62a4f",null),a.s(["0001953c5af243a11547577ef82018061ce3259b2e",()=>c.f,"000f25cb570f9ee8b2f54da19de57f679d6e17a052",0,v,"00c117e2f6723aaec427f79646a93b7db2e2c1fc33",()=>d.f,"00c1643dbf5223904a82f005011bb3f653f0975037",()=>b.f,"4051bcb104f743e8e533ce34b83cc84eca2f875736",0,u,"406b9805673a46697a80acba35ac964f3ef5e62a4f",0,z,"40c9442f8916b211fed78371a2bff660dea301ef3c",0,y,"40efd95eef98ad185ef9d139a21ca7d1d6905e34d5",0,t],35874)},8018,(a,b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"createDedupedByCallsiteServerErrorLoggerDev",{enumerable:!0,get:function(){return i}});let d=function(a){if(a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var b=e(void 0);if(b&&b.has(a))return b.get(a);var c={__proto__:null},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in a)if("default"!==f&&Object.prototype.hasOwnProperty.call(a,f)){var g=d?Object.getOwnPropertyDescriptor(a,f):null;g&&(g.get||g.set)?Object.defineProperty(c,f,g):c[f]=a[f]}return c.default=a,b&&b.set(a,c),c}(a.r(717));function e(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(e=function(a){return a?c:b})(a)}let f={current:null},g="function"==typeof d.cache?d.cache:a=>a,h=console.warn;function i(a){return function(...b){h(a(...b))}}g(a=>{try{h(f.current)}finally{f.current=null}})},81740,(a,b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"cookies",{enumerable:!0,get:function(){return o}});let d=a.r(14896),e=a.r(63681),f=a.r(56704),g=a.r(32319),h=a.r(60384),i=a.r(60312),j=a.r(13091),k=a.r(8018),l=a.r(28091),m=a.r(50640),n=a.r(55907);function o(){let a="cookies",b=f.workAsyncStorage.getStore(),c=g.workUnitAsyncStorage.getStore();if(b){if(c&&!(0,l.isRequestApiAllowedInCurrentPhase)(c))throw Error(`Route ${b.route} used \`cookies()\` inside \`after()\` while rendering. This is not supported. If you need this data inside an \`after()\` callback, use \`cookies()\` outside of the callback. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`);if(b.forceStatic)return q(d.RequestCookiesAdapter.seal(new e.RequestCookies(new Headers({}))));if(b.dynamicShouldError)throw new i.StaticGenBailoutError(`Route ${b.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`cookies()\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);if(c)switch(c.type){case"cache":let f=(0,n.createCookiesInUseCacheError)(b.route);throw Error.captureStackTrace(f,o),(0,j.applyOwnerStack)(f),b.invalidDynamicUsageError??=f,f;case"unstable-cache":throw(0,n.createCookiesInUnstableCacheError)(b.route);case"build-time-generator":throw Error(`Route ${b.route} used \`cookies()\` inside \`${c.functionName}\`. This is not supported because \`${c.functionName}\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`);case"prerender":var k=b,r=c;let g=p.get(r);if(g)return g;let s=(0,j.makeSessionDataHangingPromise)(r.renderSignal,k.route,"`cookies()`",r);return p.set(r,s),s;case"prerender-client":case"validation-client":let t="`cookies`";throw new m.InvariantError(`${t} must not be used within a Client Component. Next.js should be preventing ${t} from being included in Client Components statically, but did not in this case.`);case"prerender-legacy":return(0,h.throwToInterruptStaticGeneration)(a,b,c);case"prerender-runtime":{let{stagedRendering:a}=c;if(a)return a.delayUntilStage(j.RENDER_STAGES_BY_DATA_KIND.sessionData,"cookies",c.cookies);return q(c.cookies)}case"private-cache":return q(c.cookies);case"request":let u;if((0,h.trackDynamicDataInDynamicRender)(c),u=(0,d.areCookiesMutableInCurrentPhase)(c)?c.userspaceMutableCookies:c.cookies,!c.asyncApiPromises)return q(u);if(u===c.mutableCookies)return c.asyncApiPromises.mutableCookies;return c.asyncApiPromises.cookies}}(0,g.throwForMissingRequestStore)(a)}let p=new WeakMap;function q(a){let b=p.get(a);if(b)return b;let c=Promise.resolve(a);return p.set(a,c),c}(0,k.createDedupedByCallsiteServerErrorLoggerDev)(function(a,b){let c=a?`Route "${a}" `:"This route ";return Error(`${c}used ${b}. \`cookies()\` returns a Promise and must be unwrapped with \`await\` or \`React.use()\` before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`)})},51125,(a,b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"draftMode",{enumerable:!0,get:function(){return m}});let d=a.r(32319),e=a.r(56704),f=a.r(60384),g=a.r(8018),h=a.r(60312),i=a.r(96556),j=a.r(50640),k=a.r(55907);a.r(51409);let l=a.r(13091);function m(){let a="draftMode",b=e.workAsyncStorage.getStore(),c=d.workUnitAsyncStorage.getStore();switch((!b||!c)&&(0,d.throwForMissingRequestStore)(a),c.type){case"prerender-runtime":{let{stagedRendering:a}=c;if(a)return a.delayUntilStage(l.RENDER_STAGES_BY_DATA_KIND.sessionData,"draftMode",new q(c.draftMode));return n(c.draftMode,b)}case"request":return n(c.draftMode,b);case"cache":case"private-cache":case"unstable-cache":let f=(0,d.getDraftModeProviderForCacheScope)(b,c);if(f)return n(f,b);case"prerender":case"prerender-legacy":return n(null,b);case"prerender-client":case"validation-client":{let a="`draftMode`";throw new j.InvariantError(`${a} must not be used within a Client Component. Next.js should be preventing ${a} from being included in Client Components statically, but did not in this case.`)}case"build-time-generator":throw Error(`Route ${b.route} used \`${a}()\` inside \`${c.functionName}\`. This is not supported because \`${c.functionName}\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`);default:return c}}function n(a,b){let c=p.get(a??o);return c||Promise.resolve(new q(a))}let o={},p=new WeakMap;class q{constructor(a){this._provider=a}get isEnabled(){return null!==this._provider&&this._provider.isEnabled}enable(){r("draftMode().enable()",this.enable),null!==this._provider&&this._provider.enable()}disable(){r("draftMode().disable()",this.disable),null!==this._provider&&this._provider.disable()}}function r(a,b){let c=e.workAsyncStorage.getStore(),g=d.workUnitAsyncStorage.getStore();if(c){if((null==g?void 0:g.phase)==="after")throw Error(`Route ${c.route} used "${a}" inside \`after()\`. The enabled status of \`draftMode()\` can be read inside \`after()\` but you cannot enable or disable \`draftMode()\`. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`);if(c.dynamicShouldError)throw new h.StaticGenBailoutError(`Route ${c.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${a}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);if(g)switch(g.type){case"cache":case"private-cache":{let d=(0,k.createDraftModeMutationInUseCacheError)(c.route,a);throw Error.captureStackTrace(d,b),(0,l.applyOwnerStack)(d),c.invalidDynamicUsageError??=d,d}case"unstable-cache":throw(0,k.createDraftModeMutationInUnstableCacheError)(c.route,a);case"prerender":case"prerender-runtime":{let b=Error(`Route ${c.route} used ${a} without first calling \`await connection()\`. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-headers`);return(0,f.abortAndThrowOnSynchronousRequestDataAccess)(c.route,a,b,g)}case"prerender-client":case"validation-client":let d="`draftMode`";throw new j.InvariantError(`${d} must not be used within a Client Component. Next.js should be preventing ${d} from being included in Client Components statically, but did not in this case.`);case"prerender-legacy":g.revalidate=0;let e=new i.DynamicServerError(`Route ${c.route} couldn't be rendered statically because it used \`${a}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`);throw c.dynamicUsageDescription=a,c.dynamicUsageStack=e.stack,e;case"request":(0,f.trackDynamicDataInDynamicRender)(g);break;case"build-time-generator":throw Error(`Route ${c.route} used \`${a}\` inside \`${g.functionName}\`. This is not supported because \`${g.functionName}\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`)}}}(0,g.createDedupedByCallsiteServerErrorLoggerDev)(function(a,b){let c=a?`Route "${a}" `:"This route ";return Error(`${c}used ${b}. \`draftMode()\` returns a Promise and must be unwrapped with \`await\` or \`React.use()\` before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`)})},35754,(a,b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"headers",{enumerable:!0,get:function(){return n}});let d=a.r(29927),e=a.r(56704),f=a.r(32319),g=a.r(60384),h=a.r(60312),i=a.r(13091),j=a.r(8018),k=a.r(28091),l=a.r(50640),m=a.r(55907);function n(){let a="headers",b=e.workAsyncStorage.getStore(),c=f.workUnitAsyncStorage.getStore();if(b){if(c&&!(0,k.isRequestApiAllowedInCurrentPhase)(c))throw Error(`Route ${b.route} used \`headers()\` inside \`after()\` while rendering. This is not supported. If you need this data inside an \`after()\` callback, use \`headers()\` outside of the callback. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`);if(b.forceStatic)return p(d.HeadersAdapter.seal(new Headers({})));if(c)switch(c.type){case"cache":{let a=(0,m.createHeadersInUseCacheError)(b.route);throw Error.captureStackTrace(a,n),(0,i.applyOwnerStack)(a),b.invalidDynamicUsageError??=a,a}case"unstable-cache":throw(0,m.createHeadersInUnstableCacheError)(b.route);case"build-time-generator":throw Error(`Route ${b.route} used \`headers()\` inside \`${c.functionName}\`. This is not supported because \`${c.functionName}\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`)}if(b.dynamicShouldError)throw new h.StaticGenBailoutError(`Route ${b.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`headers()\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);if(c)switch(c.type){case"prerender":var j=b,q=c;let e=o.get(q);if(e)return e;let f=(0,i.makeSessionDataHangingPromise)(q.renderSignal,j.route,"`headers()`",q);return o.set(q,f),f;case"prerender-client":case"validation-client":let r="`headers`";throw new l.InvariantError(`${r} must not be used within a client component. Next.js should be preventing ${r} from being included in client components statically, but did not in this case.`);case"prerender-legacy":return(0,g.throwToInterruptStaticGeneration)(a,b,c);case"prerender-runtime":{let{stagedRendering:a}=c;if(a)return a.delayUntilStage(i.RENDER_STAGES_BY_DATA_KIND.sessionData,"headers",c.headers);return p(c.headers)}case"private-cache":return p(c.headers);case"request":if((0,g.trackDynamicDataInDynamicRender)(c),c.asyncApiPromises)return c.asyncApiPromises.headers;return p(c.headers)}}(0,f.throwForMissingRequestStore)(a)}let o=new WeakMap;function p(a){let b=o.get(a);if(b)return b;let c=Promise.resolve(a);return o.set(a,c),c}(0,j.createDedupedByCallsiteServerErrorLoggerDev)(function(a,b){let c=a?`Route "${a}" `:"This route ";return Error(`${c}used ${b}. \`headers()\` returns a Promise and must be unwrapped with \`await\` or \`React.use()\` before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`)})},28091,(a,b,c)=>{Object.defineProperty(c,"__esModule",{value:!0});var d={isRequestApiAllowedInCurrentPhase:function(){return l},throwForSearchParamsAccessInUseCache:function(){return k},throwWithStaticGenerationBailoutErrorWithDynamicError:function(){return j}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(60312),g=a.r(20635),h=a.r(24725),i=a.r(55907);function j(a,b){throw new f.StaticGenBailoutError(`Route ${a} with \`dynamic = "error"\` couldn't be rendered statically because it used ${b}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`)}function k(a,b){let c=(0,i.createSearchParamsInUseCacheError)(a.route);throw Error.captureStackTrace(c,b),a.invalidDynamicUsageError??=c,c}function l(a){switch(a.phase){case"action":case"render":return!0;case"after":{let a=g.actionAsyncStorage.getStore();if(a&&(a.isAppRoute||a.isAction))return!0;let b=h.afterTaskAsyncStorage.getStore();if(b)return"action"===b.rootTaskSpawnPhase;return!1}}}},55907,(a,b,c)=>{Object.defineProperty(c,"__esModule",{value:!0});var d={createCacheLifeOutsideUseCacheError:function(){return B},createCacheTagOutsideUseCacheError:function(){return A},createConnectionInPrivateUseCacheError:function(){return q},createConnectionInPublicUseCacheError:function(){return p},createConnectionInUnstableCacheError:function(){return r},createCookiesInUnstableCacheError:function(){return l},createCookiesInUseCacheError:function(){return k},createDraftModeMutationInUnstableCacheError:function(){return v},createDraftModeMutationInUseCacheError:function(){return u},createHeadersInUnstableCacheError:function(){return n},createHeadersInUseCacheError:function(){return m},createNestedCacheShortExpireError:function(){return D},createNestedCacheZeroRevalidateError:function(){return C},createRevalidateDuringRenderError:function(){return w},createRevalidateInBuildTimeGeneratorError:function(){return y},createRevalidateInCachedFunctionError:function(){return x},createRouteHandlerRequestInUnstableCacheError:function(){return t},createRouteHandlerRequestInUseCacheError:function(){return s},createSearchParamsInUseCacheError:function(){return o},createUseCachePrivateInsidePublicUseCacheError:function(){return E},createUseCachePrivateInsideUnstableCacheError:function(){return F},createUseCachePrivateOutsideRequestContextError:function(){return G}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f="https://nextjs.org/docs/messages/next-request-in-use-cache",g="https://nextjs.org/docs/app/api-reference/functions/unstable_cache",h="https://nextjs.org/docs/messages/use-cache-private-composition",i="https://nextjs.org/docs/messages/revalidate-in-use-cache",j="https://nextjs.org/docs/messages/nested-use-cache-no-explicit-cachelife";function k(a){return Error(`Route "${a}": \`cookies()\` can't be read inside \`"use cache"\`. Read it outside the cached function and pass what you need as an argument.
|
|
1
|
+
module.exports=[[35874,a=>{var b=a.i(36359),c=a.i(36119),d=a.i(41289),e=a.i(37936),f=a.i(2157),g=a.i(50227),h=a.i(5246),i=a.i(8674);let j=new Set(["localhost","127.0.0.1","::1","[::1]","0:0:0:0:0:0:0:1"]);function k(a){let b=a.trim().toLowerCase();return!!b&&(!!j.has(b)||/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(b))}var l=a.i(87481),m=a.i(55113),n=a.i(13095);let o="this request did not come from the dashboard in your browser, so nothing was written.",p="env-key-stand-in";async function q(){var a,b;let c;try{c=await (0,h.headers)()}catch{return o}let d=k((a=void 0,b=process.env.FAILPROOFAI_DASHBOARD_HOST,(a??b??"").trim()||"127.0.0.1")),e=c.get("host");if(d&&(!e||!k(function(a){let b=a.trim();if(b.startsWith("[")){let a=b.indexOf("]");return -1===a?b:b.slice(0,a+1)}let c=b.indexOf(":");return -1===c?b:b.slice(0,c)}(e))))return o;let f=c.get("origin");if(!f)return d?null:o;let g=null;try{g=new URL(f).host.toLowerCase()}catch{g=null}return g&&g===(e??"").toLowerCase()?null:o}function r(a){if(!a)return null;let b=(0,l.A)(a);if(!b.ok)return null;try{let a=new URL(b.value).origin;return"null"===a?null:a}catch{return null}}function s(a){let b=(0,g.dirname)(a);try{let a=511&(0,f.statSync)(b).mode;(18&a)!=0&&(0,f.chmodSync)(b,-19&a)}catch{}}async function t(a){let b=await q();if(b)return{ok:!1,problem:b};let c=a.provider.trim();if(!l.n.includes(c))return{ok:!1,problem:`provider must be one of ${l.n.join(", ")}`};if(c===l.e)return{ok:!1,problem:"FailproofAI Cloud's Jev is turned on by connecting this machine (failproofai config --token <key>), and switched with the mode control — not saved from this form."};let e=(0,l._)(a.mode);if(null===e)return{ok:!1,problem:'mode must be "off", "observe" or "enforce".'};let f=a.baseUrl.trim(),g=f?(0,l.A)(f):null;if(g&&!g.ok)return{ok:!1,problem:g.problem};let h=(0,l.Z)(),j=h?.raw??null,k=null!==j&&j.provider===c;if(g?.ok){let a=(0,l.A)(j?.baseUrl),b=k&&a.ok&&(0,l.T)(a.value).url===(0,l.T)(g.value).url,d=b?null:(0,l.O)(c,g.value);if(d)return{ok:!1,problem:`${d}.`};let e=b?null:(0,l.f)(g.value);if(e)return{ok:!1,problem:`that url is an endpoint, not an api base — its path ends in ${e.suffix}. ${(0,m.G)(g.value)} Use ${(0,l.T)(e.base).url} instead.`}}let n=k?{...j}:{};!k&&j&&(void 0!==j.mode&&(n.mode=j.mode),void 0!==j.timeoutMs&&(n.timeoutMs=j.timeoutMs)),n.provider=c,f?n.baseUrl=function(a,b){if("string"!=typeof b||""===b)return a;let c=(0,l.A)(b);if(!c.ok)return a;let d=(0,l.T)(c.value);if(!d.hadQuery)return a;let e=(0,l.A)(a);return e.ok&&e.value===d.url?c.value:a}(f,j?.baseUrl):delete n.baseUrl;let o=a.accountId.trim();"cloudflare"===c&&o?n.accountId=o:delete n.accountId,n.mode=e;let t=k&&h?.tooOpen!==!0&&r(f)===r("string"==typeof j?.baseUrl?j.baseUrl:""),u="string"==typeof j?.apiKey&&""!==j.apiKey,v=null!==j&&!u&&(0,l.P)(j,p).ok,w=a.token.trim();if(w){let a=(0,l.$)(w);if(a)return{ok:!1,problem:a,needsToken:!0};n.apiKey=w}else if(!t&&!v)return{ok:!1,needsToken:!0,problem:u?k&&h?.tooOpen===!0?`${(0,l.W)()} was open to other users, so the endpoint it names may not be one you chose and its stored token is not reused. check the endpoint above, then enter the token for it.`:k?"that endpoint is not the one the stored token was given for, so it is not sent there. enter the token for it.":"enter the token for this provider.":"enter the token for this provider."};let x=void 0===n.apiKey,y=(0,l.P)(n,x?p:null);if(!y.ok)return{ok:!1,problem:y.problem,...!0===y.missingKey?{needsToken:!0}:{}};let z=(0,l.W)();try{(0,i.f)(z,n,{mode:384,dirMode:448})}catch(a){return{ok:!1,problem:`could not write ${z} (${a.code??"error"}).`}}return s(z),{ok:!0,view:await (0,d.f)()}}async function u(a){let b=await q();if(b)return{ok:!1,problem:b};let c=(0,l._)(a);if(null===c)return{ok:!1,problem:'mode must be "off", "observe" or "enforce".'};let e=(0,l.Z)();if(null===e)return{ok:!1,problem:`there is no readable ${(0,l.W)()} to switch. connect this machine (failproofai config --token <key>) or set up your own endpoint below.`};if(e.tooOpen)return{ok:!1,problem:`${(0,l.W)()} is open to other users, so Jev is already off and the endpoint it names is not trusted. fix its permissions first (chmod 600, and chmod 700 on its directory).`};let f={...e.raw,mode:c},g=f.provider===l.e,h=(0,l.P)(f,g||"string"==typeof f.apiKey?null:p,g?{url:function(a){if("string"!=typeof a)return"";try{return new URL(a).origin}catch{return""}}(f.baseUrl),key:p}:null);if(!h.ok)return{ok:!1,problem:h.problem};let j=(0,l.W)();try{(0,i.f)(j,f,{mode:384,dirMode:448})}catch(a){return{ok:!1,problem:`could not write ${j} (${a.code??"error"}).`}}return s(j),{ok:!0,view:await (0,d.f)()}}async function v(){let a=await q();if(a)return{ok:!1,problem:a};let b=(0,l.W)();if((0,f.existsSync)(b))try{(0,f.unlinkSync)(b)}catch(a){return{ok:!1,problem:`could not remove ${b} (${a.code??"error"}).`}}return{ok:!0,view:await (0,d.f)()}}(0,n.ensureServerEntryExports)([t,u,v]),(0,e.registerServerReference)(t,"40c1e5828b89f194396a4edc086ed817d4931d5ac8",null),(0,e.registerServerReference)(u,"40c96ce60ae14f95409628d3eeef0c1ffff3b426bd",null),(0,e.registerServerReference)(v,"0063958edce5309d23c8b62f3cb34558c89b70dded",null);var w=a.i(21572),x=a.i(81243);async function y(a){if(a&&!await (0,x.s)()){let a=(0,x.M)();return{ok:!1,reason:a&&1e3*a.refresh_expires_at>Date.now()?"unreachable":"signed-out"}}return{ok:!0,auto:(0,w.t)({audit:a?{auto:!0,reportsConsentedAt:Date.now()}:{auto:!1}}).audit.auto}}async function z(a){return(0,w.t)({audit:{intervalDays:a}}),{intervalDays:(0,w.s)().audit.intervalDays}}(0,n.ensureServerEntryExports)([y,z]),(0,e.registerServerReference)(y,"40552ac1d76f989b4b1d866d70394d9192459bbde0",null),(0,e.registerServerReference)(z,"4065281afd273e7a92cb535aa8aa5369bb864fc84e",null),a.s(["001e76cc3ece7218b24b9e6382ab3e016aeb9f2290",()=>d.f,"0042ee3f3518fc9ad9f544ba4f9df7e68d57ce0a04",()=>c.f,"0063958edce5309d23c8b62f3cb34558c89b70dded",0,v,"00de9ed6392ff068792d68e272f943ca9a05f589fa",()=>b.f,"40552ac1d76f989b4b1d866d70394d9192459bbde0",0,y,"4065281afd273e7a92cb535aa8aa5369bb864fc84e",0,z,"40c1e5828b89f194396a4edc086ed817d4931d5ac8",0,t,"40c96ce60ae14f95409628d3eeef0c1ffff3b426bd",0,u],35874)},8018,(a,b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"createDedupedByCallsiteServerErrorLoggerDev",{enumerable:!0,get:function(){return i}});let d=function(a){if(a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var b=e(void 0);if(b&&b.has(a))return b.get(a);var c={__proto__:null},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in a)if("default"!==f&&Object.prototype.hasOwnProperty.call(a,f)){var g=d?Object.getOwnPropertyDescriptor(a,f):null;g&&(g.get||g.set)?Object.defineProperty(c,f,g):c[f]=a[f]}return c.default=a,b&&b.set(a,c),c}(a.r(717));function e(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(e=function(a){return a?c:b})(a)}let f={current:null},g="function"==typeof d.cache?d.cache:a=>a,h=console.warn;function i(a){return function(...b){h(a(...b))}}g(a=>{try{h(f.current)}finally{f.current=null}})},81740,(a,b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"cookies",{enumerable:!0,get:function(){return o}});let d=a.r(14896),e=a.r(63681),f=a.r(56704),g=a.r(32319),h=a.r(60384),i=a.r(60312),j=a.r(13091),k=a.r(8018),l=a.r(28091),m=a.r(50640),n=a.r(55907);function o(){let a="cookies",b=f.workAsyncStorage.getStore(),c=g.workUnitAsyncStorage.getStore();if(b){if(c&&!(0,l.isRequestApiAllowedInCurrentPhase)(c))throw Error(`Route ${b.route} used \`cookies()\` inside \`after()\` while rendering. This is not supported. If you need this data inside an \`after()\` callback, use \`cookies()\` outside of the callback. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`);if(b.forceStatic)return q(d.RequestCookiesAdapter.seal(new e.RequestCookies(new Headers({}))));if(b.dynamicShouldError)throw new i.StaticGenBailoutError(`Route ${b.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`cookies()\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);if(c)switch(c.type){case"cache":let f=(0,n.createCookiesInUseCacheError)(b.route);throw Error.captureStackTrace(f,o),(0,j.applyOwnerStack)(f),b.invalidDynamicUsageError??=f,f;case"unstable-cache":throw(0,n.createCookiesInUnstableCacheError)(b.route);case"build-time-generator":throw Error(`Route ${b.route} used \`cookies()\` inside \`${c.functionName}\`. This is not supported because \`${c.functionName}\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`);case"prerender":var k=b,r=c;let g=p.get(r);if(g)return g;let s=(0,j.makeSessionDataHangingPromise)(r.renderSignal,k.route,"`cookies()`",r);return p.set(r,s),s;case"prerender-client":case"validation-client":let t="`cookies`";throw new m.InvariantError(`${t} must not be used within a Client Component. Next.js should be preventing ${t} from being included in Client Components statically, but did not in this case.`);case"prerender-legacy":return(0,h.throwToInterruptStaticGeneration)(a,b,c);case"prerender-runtime":{let{stagedRendering:a}=c;if(a)return a.delayUntilStage(j.RENDER_STAGES_BY_DATA_KIND.sessionData,"cookies",c.cookies);return q(c.cookies)}case"private-cache":return q(c.cookies);case"request":let u;if((0,h.trackDynamicDataInDynamicRender)(c),u=(0,d.areCookiesMutableInCurrentPhase)(c)?c.userspaceMutableCookies:c.cookies,!c.asyncApiPromises)return q(u);if(u===c.mutableCookies)return c.asyncApiPromises.mutableCookies;return c.asyncApiPromises.cookies}}(0,g.throwForMissingRequestStore)(a)}let p=new WeakMap;function q(a){let b=p.get(a);if(b)return b;let c=Promise.resolve(a);return p.set(a,c),c}(0,k.createDedupedByCallsiteServerErrorLoggerDev)(function(a,b){let c=a?`Route "${a}" `:"This route ";return Error(`${c}used ${b}. \`cookies()\` returns a Promise and must be unwrapped with \`await\` or \`React.use()\` before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`)})},51125,(a,b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"draftMode",{enumerable:!0,get:function(){return m}});let d=a.r(32319),e=a.r(56704),f=a.r(60384),g=a.r(8018),h=a.r(60312),i=a.r(96556),j=a.r(50640),k=a.r(55907);a.r(51409);let l=a.r(13091);function m(){let a="draftMode",b=e.workAsyncStorage.getStore(),c=d.workUnitAsyncStorage.getStore();switch((!b||!c)&&(0,d.throwForMissingRequestStore)(a),c.type){case"prerender-runtime":{let{stagedRendering:a}=c;if(a)return a.delayUntilStage(l.RENDER_STAGES_BY_DATA_KIND.sessionData,"draftMode",new q(c.draftMode));return n(c.draftMode,b)}case"request":return n(c.draftMode,b);case"cache":case"private-cache":case"unstable-cache":let f=(0,d.getDraftModeProviderForCacheScope)(b,c);if(f)return n(f,b);case"prerender":case"prerender-legacy":return n(null,b);case"prerender-client":case"validation-client":{let a="`draftMode`";throw new j.InvariantError(`${a} must not be used within a Client Component. Next.js should be preventing ${a} from being included in Client Components statically, but did not in this case.`)}case"build-time-generator":throw Error(`Route ${b.route} used \`${a}()\` inside \`${c.functionName}\`. This is not supported because \`${c.functionName}\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`);default:return c}}function n(a,b){let c=p.get(a??o);return c||Promise.resolve(new q(a))}let o={},p=new WeakMap;class q{constructor(a){this._provider=a}get isEnabled(){return null!==this._provider&&this._provider.isEnabled}enable(){r("draftMode().enable()",this.enable),null!==this._provider&&this._provider.enable()}disable(){r("draftMode().disable()",this.disable),null!==this._provider&&this._provider.disable()}}function r(a,b){let c=e.workAsyncStorage.getStore(),g=d.workUnitAsyncStorage.getStore();if(c){if((null==g?void 0:g.phase)==="after")throw Error(`Route ${c.route} used "${a}" inside \`after()\`. The enabled status of \`draftMode()\` can be read inside \`after()\` but you cannot enable or disable \`draftMode()\`. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`);if(c.dynamicShouldError)throw new h.StaticGenBailoutError(`Route ${c.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${a}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);if(g)switch(g.type){case"cache":case"private-cache":{let d=(0,k.createDraftModeMutationInUseCacheError)(c.route,a);throw Error.captureStackTrace(d,b),(0,l.applyOwnerStack)(d),c.invalidDynamicUsageError??=d,d}case"unstable-cache":throw(0,k.createDraftModeMutationInUnstableCacheError)(c.route,a);case"prerender":case"prerender-runtime":{let b=Error(`Route ${c.route} used ${a} without first calling \`await connection()\`. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-headers`);return(0,f.abortAndThrowOnSynchronousRequestDataAccess)(c.route,a,b,g)}case"prerender-client":case"validation-client":let d="`draftMode`";throw new j.InvariantError(`${d} must not be used within a Client Component. Next.js should be preventing ${d} from being included in Client Components statically, but did not in this case.`);case"prerender-legacy":g.revalidate=0;let e=new i.DynamicServerError(`Route ${c.route} couldn't be rendered statically because it used \`${a}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`);throw c.dynamicUsageDescription=a,c.dynamicUsageStack=e.stack,e;case"request":(0,f.trackDynamicDataInDynamicRender)(g);break;case"build-time-generator":throw Error(`Route ${c.route} used \`${a}\` inside \`${g.functionName}\`. This is not supported because \`${g.functionName}\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`)}}}(0,g.createDedupedByCallsiteServerErrorLoggerDev)(function(a,b){let c=a?`Route "${a}" `:"This route ";return Error(`${c}used ${b}. \`draftMode()\` returns a Promise and must be unwrapped with \`await\` or \`React.use()\` before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`)})},35754,(a,b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"headers",{enumerable:!0,get:function(){return n}});let d=a.r(29927),e=a.r(56704),f=a.r(32319),g=a.r(60384),h=a.r(60312),i=a.r(13091),j=a.r(8018),k=a.r(28091),l=a.r(50640),m=a.r(55907);function n(){let a="headers",b=e.workAsyncStorage.getStore(),c=f.workUnitAsyncStorage.getStore();if(b){if(c&&!(0,k.isRequestApiAllowedInCurrentPhase)(c))throw Error(`Route ${b.route} used \`headers()\` inside \`after()\` while rendering. This is not supported. If you need this data inside an \`after()\` callback, use \`headers()\` outside of the callback. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`);if(b.forceStatic)return p(d.HeadersAdapter.seal(new Headers({})));if(c)switch(c.type){case"cache":{let a=(0,m.createHeadersInUseCacheError)(b.route);throw Error.captureStackTrace(a,n),(0,i.applyOwnerStack)(a),b.invalidDynamicUsageError??=a,a}case"unstable-cache":throw(0,m.createHeadersInUnstableCacheError)(b.route);case"build-time-generator":throw Error(`Route ${b.route} used \`headers()\` inside \`${c.functionName}\`. This is not supported because \`${c.functionName}\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`)}if(b.dynamicShouldError)throw new h.StaticGenBailoutError(`Route ${b.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`headers()\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);if(c)switch(c.type){case"prerender":var j=b,q=c;let e=o.get(q);if(e)return e;let f=(0,i.makeSessionDataHangingPromise)(q.renderSignal,j.route,"`headers()`",q);return o.set(q,f),f;case"prerender-client":case"validation-client":let r="`headers`";throw new l.InvariantError(`${r} must not be used within a client component. Next.js should be preventing ${r} from being included in client components statically, but did not in this case.`);case"prerender-legacy":return(0,g.throwToInterruptStaticGeneration)(a,b,c);case"prerender-runtime":{let{stagedRendering:a}=c;if(a)return a.delayUntilStage(i.RENDER_STAGES_BY_DATA_KIND.sessionData,"headers",c.headers);return p(c.headers)}case"private-cache":return p(c.headers);case"request":if((0,g.trackDynamicDataInDynamicRender)(c),c.asyncApiPromises)return c.asyncApiPromises.headers;return p(c.headers)}}(0,f.throwForMissingRequestStore)(a)}let o=new WeakMap;function p(a){let b=o.get(a);if(b)return b;let c=Promise.resolve(a);return o.set(a,c),c}(0,j.createDedupedByCallsiteServerErrorLoggerDev)(function(a,b){let c=a?`Route "${a}" `:"This route ";return Error(`${c}used ${b}. \`headers()\` returns a Promise and must be unwrapped with \`await\` or \`React.use()\` before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`)})},28091,(a,b,c)=>{Object.defineProperty(c,"__esModule",{value:!0});var d={isRequestApiAllowedInCurrentPhase:function(){return l},throwForSearchParamsAccessInUseCache:function(){return k},throwWithStaticGenerationBailoutErrorWithDynamicError:function(){return j}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(60312),g=a.r(20635),h=a.r(24725),i=a.r(55907);function j(a,b){throw new f.StaticGenBailoutError(`Route ${a} with \`dynamic = "error"\` couldn't be rendered statically because it used ${b}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`)}function k(a,b){let c=(0,i.createSearchParamsInUseCacheError)(a.route);throw Error.captureStackTrace(c,b),a.invalidDynamicUsageError??=c,c}function l(a){switch(a.phase){case"action":case"render":return!0;case"after":{let a=g.actionAsyncStorage.getStore();if(a&&(a.isAppRoute||a.isAction))return!0;let b=h.afterTaskAsyncStorage.getStore();if(b)return"action"===b.rootTaskSpawnPhase;return!1}}}},55907,(a,b,c)=>{Object.defineProperty(c,"__esModule",{value:!0});var d={createCacheLifeOutsideUseCacheError:function(){return B},createCacheTagOutsideUseCacheError:function(){return A},createConnectionInPrivateUseCacheError:function(){return q},createConnectionInPublicUseCacheError:function(){return p},createConnectionInUnstableCacheError:function(){return r},createCookiesInUnstableCacheError:function(){return l},createCookiesInUseCacheError:function(){return k},createDraftModeMutationInUnstableCacheError:function(){return v},createDraftModeMutationInUseCacheError:function(){return u},createHeadersInUnstableCacheError:function(){return n},createHeadersInUseCacheError:function(){return m},createNestedCacheShortExpireError:function(){return D},createNestedCacheZeroRevalidateError:function(){return C},createRevalidateDuringRenderError:function(){return w},createRevalidateInBuildTimeGeneratorError:function(){return y},createRevalidateInCachedFunctionError:function(){return x},createRouteHandlerRequestInUnstableCacheError:function(){return t},createRouteHandlerRequestInUseCacheError:function(){return s},createSearchParamsInUseCacheError:function(){return o},createUseCachePrivateInsidePublicUseCacheError:function(){return E},createUseCachePrivateInsideUnstableCacheError:function(){return F},createUseCachePrivateOutsideRequestContextError:function(){return G}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f="https://nextjs.org/docs/messages/next-request-in-use-cache",g="https://nextjs.org/docs/app/api-reference/functions/unstable_cache",h="https://nextjs.org/docs/messages/use-cache-private-composition",i="https://nextjs.org/docs/messages/revalidate-in-use-cache",j="https://nextjs.org/docs/messages/nested-use-cache-no-explicit-cachelife";function k(a){return Error(`Route "${a}": \`cookies()\` can't be read inside \`"use cache"\`. Read it outside the cached function and pass what you need as an argument.
|
|
2
2
|
Learn more: ${f}`)}function l(a){return Error(`Route "${a}": \`cookies()\` can't be read inside \`unstable_cache()\`. Read it outside the cached function and pass what you need as an argument.
|
|
3
3
|
Learn more: ${g}`)}function m(a){return Error(`Route "${a}": \`headers()\` can't be read inside \`"use cache"\`. Read it outside the cached function and pass what you need as an argument.
|
|
4
4
|
Learn more: ${f}`)}function n(a){return Error(`Route "${a}": \`headers()\` can't be read inside \`unstable_cache()\`. Read it outside the cached function and pass what you need as an argument.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[21776,a=>{"use strict";var b=a.i(36359),c=a.i(7292);a.S([b,"
|
|
1
|
+
module.exports=[21776,a=>{"use strict";var b=a.i(36359),c=a.i(7292);a.S([b,"00de9ed6392ff068792d68e272f943ca9a05f589fa,f",0,c,"601da5259db8771c5daa055322e9f6abf5b570520a,m"],21776)},2726,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[externals]__12qr51qgrrt6o._.js","server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_11bnuznb72p7z._.js"].map(b=>a.l(b))).then(()=>b(74493)))}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=_0pedwblqdoh58._.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
(()=>{"use strict";module.exports=[1375,a=>{var b=a.i(5050);let c=(0,b.createServerReference)("00de9ed6392ff068792d68e272f943ca9a05f589fa",b.callServer,void 0,b.findSourceMapURL,"getTelemetryConfig");a.s(["f",0,c])},18952,a=>{var b=a.i(87924),c=a.i(72131);let d=[],e=0,f=new Set;function g(){for(let a of f)a()}function h(a){return f.add(a),()=>f.delete(a)}function i(){return d}function j({message:a}){let[d,e]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{requestAnimationFrame(()=>e(!0));let a=setTimeout(()=>e(!1),2e3);return()=>clearTimeout(a)},[]),(0,b.jsx)("div",{className:`bg-card border border-border text-foreground text-sm px-4 py-2 rounded-lg shadow-lg transition-opacity duration-300 ${d?"opacity-100":"opacity-0"}`,children:a})}a.s(["Toaster",0,function(){let a=(0,c.useSyncExternalStore)(h,i,i);return(0,b.jsx)("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2",children:a.map(a=>(0,b.jsx)(j,{message:a.message},a.id))})},"toast",0,function(a){let b=e++;d=[...d,{id:b,message:a}],g(),setTimeout(()=>{d=d.filter(a=>a.id!==b),g()},2500)}])},10765,a=>{var b=a.i(87924),c=a.i(72131),d=a.i(50944),e=a.i(1375),f=a.i(66036);let g=(0,c.createContext)(void 0);a.s(["PostHogProvider",0,function({children:a}){let h=(0,d.usePathname)(),i=(0,c.useRef)(null),j=(0,c.useRef)(!1);(0,c.useEffect)(()=>{let a=!1;return(0,e.f)().then(b=>{a||((0,f.$)(b),j.current=!0,(0,f.L)("$pageview"),i.current=window.location.pathname)}),()=>{a=!0}},[]),(0,c.useEffect)(()=>{j.current&&i.current!==h&&(i.current=h,(0,f.L)("$pageview"))},[h]);let k=c.default.useCallback((a,b)=>{(0,f.L)(a,b)},[]);return(0,b.jsx)(g.Provider,{value:{capture:k},children:a})},"usePostHog",0,function(){let a=(0,c.useContext)(g);if(void 0===a)throw Error("usePostHog must be used within a PostHogProvider");return a}])},66036,a=>{a.s(["L",0,function(a,b){},"$",0,function(a){}])},5050,(a,b,c)=>{Object.defineProperty(c,"__esModule",{value:!0});var d={callServer:function(){return f.callServer},createServerReference:function(){return h.createServerReference},findSourceMapURL:function(){return g.findSourceMapURL}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(20611),g=a.r(1722),h=a.r(38783)}]})();
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=_128ebxr83nk6g._.js.map
|