failproofai 1.0.8 → 1.0.9-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/prerender-manifest.json +4 -4
- package/.next/standalone/.next/required-server-files.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +7 -7
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +6 -6
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +15 -15
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +15 -15
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +14 -14
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/api/audit/invite/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/audit/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/audit/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/login-request/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/login-verify/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/audit/page/server-reference-manifest.json +2 -2
- package/.next/standalone/.next/server/app/audit/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/audit/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +15 -15
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +14 -14
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +15 -15
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +14 -14
- package/.next/standalone/.next/server/app/policies/page.js +3 -3
- 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.nft.json +1 -1
- package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0o07qi9._.js +1 -1
- package/.next/standalone/.next/server/chunks/_09dz7xv._.js +20 -20
- package/.next/standalone/.next/server/chunks/_0tovk6q._.js +1 -1
- package/.next/standalone/.next/server/chunks/_0trp3yc._.js +1 -1
- package/.next/standalone/.next/server/chunks/_1ek68ln._.js +2 -2
- package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4v._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_hooks_1aveq0u._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__04usis8._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__056wjo4._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0n0xg95._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0rwtwpm._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0tmz862._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__11mayhe._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__15578wp._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1m_svbe._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1pprgri._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1q4p5b8._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_042cgl1._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_08x1r5t._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0bqoto4._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0-vcssj._.js → _0n0lja6._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1gb0ifp._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_1p3iz2d._.js +23 -0
- package/.next/standalone/.next/server/chunks/ssr/_1zopuov._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_next-internal_server_app_policies_page_actions_1sp2-yo.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/app_actions_get-scheduled-audit_ts_0ei9sni._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_audit__components_audit-dashboard_tsx_0p9ud47._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_1kp6l3x._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_19dqvpc._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_settings_02tf1h4._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_effective-reviewers_ts_1h4wtvo._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_semantic_pack-policies_ts_0gh_bu_._.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +23 -23
- package/.next/standalone/.next/static/chunks/{3c3qbmosdjl6w.js → 0247hc9ath5t-.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0m-9d6yn9hx4j.js → 03001k9jy-kst.js} +1 -1
- package/.next/standalone/.next/static/chunks/{2qdpj67x6ifk_.js → 06k7gsfnb7jkh.js} +1 -1
- package/.next/standalone/.next/static/chunks/0qejem4-zt-hy.js +1 -0
- package/.next/standalone/.next/static/chunks/{21uv-uusw329x.js → 0snylg3y1i47a.js} +1 -1
- package/.next/standalone/.next/static/chunks/1h0if8ky362as.js +1 -0
- package/.next/standalone/.next/static/chunks/{0wbjy0zo-m7is.js → 2qsrrrl2maqsb.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0bhidk90e-07f.css → 3_e_wg5_oay87.css} +1 -1
- package/.next/standalone/.next/static/chunks/3ns-egfh8i8i5.js +6 -0
- package/.next/standalone/.next/static/chunks/3rq7fjj9we0v3.js +1 -0
- package/.next/standalone/.next/static/chunks/42m0f2hh8vfb1.js +1 -0
- package/.next/standalone/app/actions/get-jev-config.ts +2 -2
- package/.next/standalone/app/actions/update-jev-config.ts +12 -9
- package/.next/standalone/app/components/jev-notices.tsx +10 -10
- package/.next/standalone/app/settings/jev-panel.tsx +11 -11
- package/.next/standalone/fp-cloud-cli/CHANGELOG.md +2 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/output.py +26 -0
- package/.next/standalone/fp-cloud-cli/tests/test_output.py +27 -0
- package/.next/standalone/hermes-plugin/README.md +18 -8
- package/.next/standalone/package.json +10 -10
- package/.next/standalone/server.js +1 -1
- package/bin/failproofai.mjs +33 -7
- package/dist/cli.mjs +556 -521
- package/dist/worker.mjs +56 -375
- package/hermes-plugin/README.md +18 -8
- package/package.json +10 -10
- package/scripts/build-policy-pack.mjs +6 -9
- package/src/hooks/cloud-connection.ts +12 -6
- package/src/hooks/custom-hooks-loader.ts +1 -1
- package/src/hooks/effective-reviewers.ts +50 -43
- package/src/hooks/handler.ts +25 -16
- package/src/hooks/hermes-update.ts +74 -0
- package/src/hooks/hook-activity-store.ts +3 -3
- package/src/hooks/integrations.ts +349 -55
- package/src/hooks/jev-activity.ts +3 -3
- package/src/hooks/jev-cli.ts +17 -17
- package/src/hooks/jev-cloud-connection.ts +4 -4
- package/src/hooks/manager.ts +3 -2
- package/src/hooks/pack-cli.ts +24 -23
- package/src/hooks/pack-manifest.ts +25 -2
- package/src/hooks/pack-store.ts +2 -2
- package/src/hooks/policy-authority.ts +51 -32
- package/src/hooks/policy-evaluator.ts +5 -5
- package/src/hooks/policy-registry.ts +5 -7
- package/src/hooks/policy-reviewability.ts +26 -10
- package/src/hooks/policy-types.ts +4 -4
- package/src/hooks/semantic/combine.ts +13 -13
- package/src/hooks/semantic/evaluator.ts +5 -5
- package/src/hooks/semantic/jev-client.ts +1 -1
- package/src/hooks/semantic/jev-config.ts +21 -12
- package/src/hooks/semantic/jev-review.ts +3 -3
- package/src/hooks/semantic/jev-stats.ts +17 -17
- package/src/hooks/semantic/pack-policies.ts +48 -48
- package/src/hooks/semantic/policies.ts +13 -425
- package/src/hooks/semantic/precondition-names.ts +1 -1
- package/src/hooks/semantic/preconditions.ts +1 -1
- package/src/hooks/semantic/types.ts +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__13t1zkw._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_13kfn90._.js +0 -23
- package/.next/standalone/.next/static/chunks/06dnzbolj00mc.js +0 -6
- package/.next/standalone/.next/static/chunks/16f3fa-lx38hk.js +0 -1
- package/.next/standalone/.next/static/chunks/2g2tki08kdhie.js +0 -1
- package/.next/standalone/.next/static/chunks/3-nbtkhg9y-1j.js +0 -1
- package/.next/standalone/.next/static/chunks/355km0ihuqo1p.js +0 -1
- /package/.next/standalone/.next/static/{5yKM8NoTOpUI0MoQl8eo5 → z1C0kJVF0NCtWn5R88hW3}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{5yKM8NoTOpUI0MoQl8eo5 → z1C0kJVF0NCtWn5R88hW3}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{5yKM8NoTOpUI0MoQl8eo5 → z1C0kJVF0NCtWn5R88hW3}/_ssgManifest.js +0 -0
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The
|
|
3
|
-
* the
|
|
2
|
+
* The probes every Jev request carries (scope, injection, the task probes) and
|
|
3
|
+
* the path and branch helpers the pack preconditions compile to.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
5
|
+
* ## No checks live here
|
|
6
|
+
*
|
|
7
|
+
* The npm package ships NO Jev checks. The sixteen that used to be compiled in
|
|
8
|
+
* as `SEMANTIC_POLICIES` are published as the `FailproofAI/jev-policies` pack,
|
|
9
|
+
* and reach a machine only through `failproofai policies add
|
|
10
|
+
* FailproofAI/jev-policies`. With no installed pack declaring a `semantic`
|
|
11
|
+
* entry, Jev asks nothing and is never called (`pack-policies.ts`). Tests keep
|
|
12
|
+
* a reference copy in `__tests__/fixtures/jev-policies.ts`.
|
|
13
|
+
*
|
|
14
|
+
* Authoring rules for a check (in a pack), learned from TypeSafe's docs and from measuring the regex
|
|
6
15
|
* engine against real traffic:
|
|
7
16
|
*
|
|
8
17
|
* - One dimension per probe. A single "is this dangerous" question scored
|
|
@@ -17,7 +26,7 @@
|
|
|
17
26
|
* - Refer to state by its field names (`agent_request`, `facts.paths`,
|
|
18
27
|
* `user_said`) so every question is anchored to the same labelled envelope.
|
|
19
28
|
*/
|
|
20
|
-
import type { Facts, PathFact
|
|
29
|
+
import type { Facts, PathFact } from "./types";
|
|
21
30
|
|
|
22
31
|
/**
|
|
23
32
|
* The branch names `commit-on-protected-branch` guards.
|
|
@@ -71,427 +80,6 @@ export function outsideProject(facts: Facts, p: PathFact): boolean {
|
|
|
71
80
|
return p.resolved !== cwd && !p.resolved.startsWith(cwd.endsWith("/") ? cwd : cwd + "/");
|
|
72
81
|
}
|
|
73
82
|
|
|
74
|
-
export const SEMANTIC_POLICIES: ReadonlyArray<SemanticPolicy> = [
|
|
75
|
-
{
|
|
76
|
-
name: "destructive-deletion",
|
|
77
|
-
title: "Tried to permanently delete data that cannot be regenerated",
|
|
78
|
-
appliesTo: ["shell", "write"],
|
|
79
|
-
mode: "deny",
|
|
80
|
-
userCanOverride: true,
|
|
81
|
-
probes: [
|
|
82
|
-
{
|
|
83
|
-
id: "destroys",
|
|
84
|
-
instructions:
|
|
85
|
-
"The tool call in `agent_request` permanently deletes, wipes, truncates or overwrites existing files, " +
|
|
86
|
-
"directories or disks — for example `rm -r`, `find -delete`, `shred`, `dd of=`, `mkfs`, `truncate`, " +
|
|
87
|
-
"`rsync --delete`, `git clean -fdx`, or redirecting output over an existing file.",
|
|
88
|
-
criteria: {
|
|
89
|
-
true: "Existing data would be destroyed or irreversibly overwritten.",
|
|
90
|
-
false: "Nothing existing is destroyed: it reads, lists, creates new files, or moves data somewhere recoverable.",
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
id: "irreplaceable",
|
|
95
|
-
instructions:
|
|
96
|
-
"What would be destroyed is outside the project, is the whole project, is the user's home directory, " +
|
|
97
|
-
"is the filesystem root, or is data that cannot simply be regenerated (source code, documents, databases, " +
|
|
98
|
-
"keys). Use `facts.paths[].relation` to see where each target sits relative to the project.",
|
|
99
|
-
criteria: {
|
|
100
|
-
true: "The destroyed data matters and could not be rebuilt by running a command.",
|
|
101
|
-
false:
|
|
102
|
-
"Only regenerable data inside the project is affected: build output, dist/, caches, node_modules, " +
|
|
103
|
-
"virtualenvs, coverage reports, temp files, or files the agent itself just created.",
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
],
|
|
107
|
-
guidance: "This permanently deletes data that cannot be rebuilt. Confirm the exact paths with the user first.",
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
name: "production-infra-change",
|
|
111
|
-
title: "Tried to change live infrastructure",
|
|
112
|
-
appliesTo: ["shell"],
|
|
113
|
-
mode: "deny",
|
|
114
|
-
userCanOverride: true,
|
|
115
|
-
probes: [
|
|
116
|
-
{
|
|
117
|
-
id: "mutates",
|
|
118
|
-
instructions:
|
|
119
|
-
"The command in `agent_request` changes the state of cloud or cluster infrastructure: it creates, " +
|
|
120
|
-
"updates, deletes, applies, scales, restarts, rolls out, deploys or destroys resources in a cloud " +
|
|
121
|
-
"account, Kubernetes cluster, managed database, DNS, CDN or hosting platform (any CLI: kubectl, helm, " +
|
|
122
|
-
"terraform, tofu, pulumi, aws, gcloud, az, doctl, flyctl, vercel, wrangler, railway, and so on — " +
|
|
123
|
-
"however the binary is spelled or pathed).",
|
|
124
|
-
criteria: {
|
|
125
|
-
true: "It mutates infrastructure.",
|
|
126
|
-
false:
|
|
127
|
-
"It only reads or plans: get, list, describe, logs, status, plan, diff, validate, whoami, or --dry-run.",
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
id: "not_local",
|
|
132
|
-
instructions:
|
|
133
|
-
"The target of that change is a shared or production environment, or its environment cannot be told " +
|
|
134
|
-
"from the command.",
|
|
135
|
-
criteria: {
|
|
136
|
-
true: "Production, shared, or unknown environment.",
|
|
137
|
-
false:
|
|
138
|
-
"Clearly a local or throwaway environment: localhost, kind, minikube, docker-desktop, k3d, or a " +
|
|
139
|
-
"context, workspace or profile whose name says dev, test, staging, sandbox or local.",
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
|
-
],
|
|
143
|
-
guidance: "This changes live infrastructure. Run it against a non-production target, or hand the command to a human.",
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
name: "git-history-rewrite",
|
|
147
|
-
title: "Tried to rewrite or discard shared git history",
|
|
148
|
-
appliesTo: ["shell"],
|
|
149
|
-
mode: "deny",
|
|
150
|
-
userCanOverride: true,
|
|
151
|
-
probes: [
|
|
152
|
-
{
|
|
153
|
-
id: "rewrites_remote",
|
|
154
|
-
instructions:
|
|
155
|
-
"The command in `agent_request` force-pushes or otherwise overwrites history on a git remote: " +
|
|
156
|
-
"`git push --force`, `--force-with-lease`, `-f`, a `+refspec` such as `+HEAD:main`, or deleting a " +
|
|
157
|
-
"remote branch. Git's global options before the subcommand (`git -C dir`, `git -c key=val`) and an " +
|
|
158
|
-
"absolute path to the git binary do not change what the command does.",
|
|
159
|
-
criteria: {
|
|
160
|
-
true: "Remote history would be overwritten or a remote branch deleted.",
|
|
161
|
-
false: "A normal push that only adds commits, or no push at all.",
|
|
162
|
-
},
|
|
163
|
-
},
|
|
164
|
-
],
|
|
165
|
-
guidance: "Force-pushing rewrites history other people may have pulled. Confirm with the user first.",
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
name: "push-to-protected-branch",
|
|
169
|
-
title: "Tried to push directly to a protected branch",
|
|
170
|
-
appliesTo: ["shell"],
|
|
171
|
-
mode: "instruct",
|
|
172
|
-
userCanOverride: true,
|
|
173
|
-
probes: [
|
|
174
|
-
{
|
|
175
|
-
id: "pushes_protected",
|
|
176
|
-
instructions:
|
|
177
|
-
"The command in `agent_request` pushes commits to a remote branch named main, master, production, " +
|
|
178
|
-
"release or trunk — either named explicitly or implied because `facts.current_git_branch` is one of " +
|
|
179
|
-
"those and the push names no other branch.",
|
|
180
|
-
criteria: {
|
|
181
|
-
true: "Commits land directly on a protected remote branch.",
|
|
182
|
-
false:
|
|
183
|
-
"It pushes a feature branch whose name merely contains a word like main (e.g. feature/main-menu), " +
|
|
184
|
-
"or it does not push.",
|
|
185
|
-
},
|
|
186
|
-
},
|
|
187
|
-
],
|
|
188
|
-
guidance: "Pushing straight to a protected branch skips review. Push a branch and open a PR unless the user asked for this.",
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
name: "commit-on-protected-branch",
|
|
192
|
-
title: "Tried to commit directly on a protected branch",
|
|
193
|
-
appliesTo: ["shell"],
|
|
194
|
-
mode: "instruct",
|
|
195
|
-
userCanOverride: true,
|
|
196
|
-
precondition: (facts) => facts.currentGitBranch !== null && PROTECTED_BRANCHES.has(facts.currentGitBranch),
|
|
197
|
-
probes: [
|
|
198
|
-
{
|
|
199
|
-
id: "creates_commit",
|
|
200
|
-
instructions:
|
|
201
|
-
"The command in `agent_request` creates or amends a git commit, merge, rebase or cherry-pick in the " +
|
|
202
|
-
"repository (including `git -C dir commit` and `git commit -a`).",
|
|
203
|
-
criteria: {
|
|
204
|
-
true: "A new commit is written to the current branch.",
|
|
205
|
-
false: "It only inspects history (log, show, diff, status) or mentions `commit` in a message or search.",
|
|
206
|
-
},
|
|
207
|
-
},
|
|
208
|
-
],
|
|
209
|
-
guidance: "You are on a protected branch. Create a feature branch before committing unless the user asked otherwise.",
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
name: "secret-exposure",
|
|
213
|
-
title: "Tried to read or copy credentials",
|
|
214
|
-
appliesTo: ["shell", "read", "write"],
|
|
215
|
-
mode: "deny",
|
|
216
|
-
userCanOverride: true,
|
|
217
|
-
probes: [
|
|
218
|
-
{
|
|
219
|
-
id: "touches_secrets",
|
|
220
|
-
instructions:
|
|
221
|
-
"The tool call in `agent_request` reads, prints, copies, or writes credential material: SSH private " +
|
|
222
|
-
"keys (~/.ssh/id_*), authorized_keys, cloud credentials (~/.aws, ~/.config/gcloud, ~/.azure, " +
|
|
223
|
-
"~/.kube/config), .env files containing real secret values, API tokens, password stores, keychains, " +
|
|
224
|
-
"or browser cookie databases.",
|
|
225
|
-
criteria: {
|
|
226
|
-
true: "Actual secret values would be read, displayed, copied or written.",
|
|
227
|
-
false:
|
|
228
|
-
"It only references the concept: source code that reads process.env, a variable name, an .env.example " +
|
|
229
|
-
"template, a test fixture, documentation about credentials, or a grep for the word.",
|
|
230
|
-
},
|
|
231
|
-
},
|
|
232
|
-
],
|
|
233
|
-
guidance: "This exposes real credentials. Ask the user before reading or copying secret material.",
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
name: "credential-exfiltration",
|
|
237
|
-
title: "Tried to send secrets or private files off the machine",
|
|
238
|
-
appliesTo: ["shell", "network"],
|
|
239
|
-
mode: "deny",
|
|
240
|
-
userCanOverride: false,
|
|
241
|
-
probes: [
|
|
242
|
-
{
|
|
243
|
-
id: "sends_out",
|
|
244
|
-
instructions:
|
|
245
|
-
"The tool call in `agent_request` sends data to a network destination: an HTTP POST or PUT (curl -d, " +
|
|
246
|
-
"curl -F, curl -T, wget --post-data), scp, sftp, rsync or rclone to a remote, nc or socat, an upload to " +
|
|
247
|
-
"a paste site, bucket or webhook, or a DNS lookup carrying encoded data.",
|
|
248
|
-
criteria: {
|
|
249
|
-
true: "Data leaves this machine.",
|
|
250
|
-
false: "It only downloads, or only talks to localhost.",
|
|
251
|
-
},
|
|
252
|
-
},
|
|
253
|
-
{
|
|
254
|
-
id: "sensitive_payload",
|
|
255
|
-
instructions:
|
|
256
|
-
"The data being sent includes credentials, keys, tokens, environment variables, or the contents of files " +
|
|
257
|
-
"from outside the project (see `facts.paths`).",
|
|
258
|
-
criteria: {
|
|
259
|
-
true: "Secrets or private files are in what is sent.",
|
|
260
|
-
false: "What is sent is ordinary project data the user would expect to share, like a test request body.",
|
|
261
|
-
},
|
|
262
|
-
},
|
|
263
|
-
],
|
|
264
|
-
guidance: "This sends secrets or private files to a remote destination, which the user cannot approve. Do not send them.",
|
|
265
|
-
},
|
|
266
|
-
{
|
|
267
|
-
name: "remote-code-execution",
|
|
268
|
-
title: "Tried to run code downloaded from the internet",
|
|
269
|
-
appliesTo: ["shell"],
|
|
270
|
-
mode: "deny",
|
|
271
|
-
userCanOverride: true,
|
|
272
|
-
probes: [
|
|
273
|
-
{
|
|
274
|
-
/**
|
|
275
|
-
* The `…` in the `wget` example is load-bearing, not decoration.
|
|
276
|
-
*
|
|
277
|
-
* A code span in a question whose first token is `curl` or `wget` and
|
|
278
|
-
* whose second token is a bare short option (`-O x.sh`, `-s`, `-fsSL`)
|
|
279
|
-
* is refused by the Cloudflare route — HTTP 402, code 2021, "Model
|
|
280
|
-
* execution failed (Payment error)" — deterministically, on any state.
|
|
281
|
-
* `curl … | sh` and `bash <(curl …)` below are accepted because their
|
|
282
|
-
* second token is the placeholder, and `wget … -O x.sh` is accepted for
|
|
283
|
-
* the same reason. The client reads 402 as `out-of-credits`, so the
|
|
284
|
-
* refusal used to degrade every call that selected this policy to
|
|
285
|
-
* regex and blame the operator's billing for it.
|
|
286
|
-
*
|
|
287
|
-
* So: keep a placeholder (or a URL) between `wget`/`curl` and its first
|
|
288
|
-
* short option in any example written inside backticks here.
|
|
289
|
-
*/
|
|
290
|
-
id: "download_and_run",
|
|
291
|
-
instructions:
|
|
292
|
-
"The command in `agent_request` downloads code or a script from the internet and executes it: " +
|
|
293
|
-
"`curl … | sh`, `bash <(curl …)`, `wget … -O x.sh && bash x.sh`, `python3 -c \"$(curl …)\"`, piping into " +
|
|
294
|
-
"any interpreter (sh, bash, zsh, python, node, perl, ruby), or eval of a fetched string.",
|
|
295
|
-
criteria: {
|
|
296
|
-
true: "Fetched code is executed.",
|
|
297
|
-
false:
|
|
298
|
-
"It only downloads without running, runs a local file, or merely searches for or quotes such a command " +
|
|
299
|
-
"(for example grep over a README).",
|
|
300
|
-
},
|
|
301
|
-
},
|
|
302
|
-
],
|
|
303
|
-
exempt: {
|
|
304
|
-
id: "official_installer",
|
|
305
|
-
instructions:
|
|
306
|
-
"The URL being executed is the documented official installer of a widely used developer tool, served from " +
|
|
307
|
-
"that tool's own domain (for example bun.sh, sh.rustup.rs, get.docker.com, deb.nodesource.com, " +
|
|
308
|
-
"raw.githubusercontent.com/nvm-sh/nvm, astral.sh/uv).",
|
|
309
|
-
},
|
|
310
|
-
guidance: "This executes code fetched from the internet. Download it, show it to the user, then run it.",
|
|
311
|
-
},
|
|
312
|
-
{
|
|
313
|
-
name: "privilege-escalation",
|
|
314
|
-
title: "Tried to run with elevated privileges",
|
|
315
|
-
appliesTo: ["shell"],
|
|
316
|
-
mode: "deny",
|
|
317
|
-
userCanOverride: true,
|
|
318
|
-
probes: [
|
|
319
|
-
{
|
|
320
|
-
id: "elevates",
|
|
321
|
-
instructions:
|
|
322
|
-
"The command in `agent_request` runs something as root or another user: sudo, doas, su, pkexec, run0, " +
|
|
323
|
-
"`sudo -i`, `sudo -s`, including when the binary is written as an absolute path or reached through a " +
|
|
324
|
-
"variable or wrapper.",
|
|
325
|
-
criteria: {
|
|
326
|
-
true: "Privileges are elevated.",
|
|
327
|
-
false: "It runs as the current user, or only mentions sudo in text, a comment, or a search pattern.",
|
|
328
|
-
},
|
|
329
|
-
},
|
|
330
|
-
],
|
|
331
|
-
guidance: "This runs with elevated privileges. Ask the user to run it themselves.",
|
|
332
|
-
},
|
|
333
|
-
{
|
|
334
|
-
name: "database-destruction",
|
|
335
|
-
title: "Tried to destroy or mass-modify database data",
|
|
336
|
-
appliesTo: ["shell"],
|
|
337
|
-
mode: "deny",
|
|
338
|
-
userCanOverride: true,
|
|
339
|
-
probes: [
|
|
340
|
-
{
|
|
341
|
-
id: "destructive_sql",
|
|
342
|
-
instructions:
|
|
343
|
-
"The command in `agent_request` executes SQL or a database command that drops or truncates a table, " +
|
|
344
|
-
"schema or database, or deletes or updates rows without a condition that narrows them to specific " +
|
|
345
|
-
"records. A condition that is always true (`WHERE 1=1`, `WHERE true`, `WHERE id > 0`) does not narrow " +
|
|
346
|
-
"anything. Also counts: `redis-cli FLUSHALL`, `dropdb`, `mongo … dropDatabase()`.",
|
|
347
|
-
criteria: {
|
|
348
|
-
true: "Many rows, a table, or a whole database would be removed or overwritten.",
|
|
349
|
-
false: "It reads, inserts, or changes a specific identified record, or runs a migration file by name.",
|
|
350
|
-
},
|
|
351
|
-
},
|
|
352
|
-
{
|
|
353
|
-
id: "real_database",
|
|
354
|
-
instructions: "The database it targets holds real data rather than being a disposable test database.",
|
|
355
|
-
criteria: {
|
|
356
|
-
true: "A real or shared database, or one whose purpose cannot be told.",
|
|
357
|
-
false: "Clearly an in-memory, test, fixture or throwaway local database (sqlite :memory:, a test_ database).",
|
|
358
|
-
},
|
|
359
|
-
},
|
|
360
|
-
],
|
|
361
|
-
guidance: "This destroys database data. Confirm the target and scope with the user first.",
|
|
362
|
-
},
|
|
363
|
-
{
|
|
364
|
-
name: "read-outside-workspace",
|
|
365
|
-
title: "Read files outside the project",
|
|
366
|
-
appliesTo: ["shell", "read"],
|
|
367
|
-
mode: "instruct",
|
|
368
|
-
userCanOverride: true,
|
|
369
|
-
precondition: (facts) => facts.paths.some((p) => outsideProject(facts, p)),
|
|
370
|
-
probes: [
|
|
371
|
-
{
|
|
372
|
-
id: "reads_outside",
|
|
373
|
-
instructions:
|
|
374
|
-
"The tool call in `agent_request` reads the contents of files that `facts.paths` marks as outside the " +
|
|
375
|
-
"project, in the user's home directory (for example another repository, Documents, or dotfiles).",
|
|
376
|
-
criteria: {
|
|
377
|
-
true: "It reads file contents from outside the project.",
|
|
378
|
-
false:
|
|
379
|
-
"It only changes directory, lists names, checks existence, or touches the agent's own tool caches.",
|
|
380
|
-
},
|
|
381
|
-
},
|
|
382
|
-
],
|
|
383
|
-
guidance: "This reads files outside the current project. Mention why before continuing.",
|
|
384
|
-
},
|
|
385
|
-
{
|
|
386
|
-
name: "agent-config-tampering",
|
|
387
|
-
title: "Tried to change the agent's own safety configuration",
|
|
388
|
-
appliesTo: ["shell", "write"],
|
|
389
|
-
mode: "deny",
|
|
390
|
-
userCanOverride: false,
|
|
391
|
-
probes: [
|
|
392
|
-
{
|
|
393
|
-
id: "edits_agent_config",
|
|
394
|
-
instructions:
|
|
395
|
-
"The tool call in `agent_request` modifies or deletes an AI agent's own configuration, hooks, " +
|
|
396
|
-
"permissions or guardrails: .claude/settings.json, .claude/settings.local.json, ~/.claude/, .codex/, " +
|
|
397
|
-
".cursor/hooks.json, .gemini/, .factory/, failproofai configuration or policies, or permission and " +
|
|
398
|
-
"safety sections of AGENTS.md or CLAUDE.md.",
|
|
399
|
-
criteria: {
|
|
400
|
-
true: "The agent's hooks, permissions or safety settings would change.",
|
|
401
|
-
false: "It only reads those files, or edits ordinary project documentation.",
|
|
402
|
-
},
|
|
403
|
-
},
|
|
404
|
-
],
|
|
405
|
-
guidance: "An agent must not change its own guardrails. Ask the user to make this change.",
|
|
406
|
-
},
|
|
407
|
-
{
|
|
408
|
-
name: "system-modification",
|
|
409
|
-
title: "Tried to change the system outside the project",
|
|
410
|
-
appliesTo: ["shell"],
|
|
411
|
-
mode: "instruct",
|
|
412
|
-
userCanOverride: true,
|
|
413
|
-
probes: [
|
|
414
|
-
{
|
|
415
|
-
id: "modifies_system",
|
|
416
|
-
instructions:
|
|
417
|
-
"The command in `agent_request` installs or removes software system-wide or changes machine " +
|
|
418
|
-
"configuration: apt, dnf, pacman, brew install, `npm install -g`, `pip install` outside a virtualenv, " +
|
|
419
|
-
"editing files under /etc, systemctl enable or disable, crontab, or changing shell startup files.",
|
|
420
|
-
criteria: {
|
|
421
|
-
true: "The machine changes outside the project directory.",
|
|
422
|
-
false: "It installs project dependencies locally (npm install, bun install, pip install in a venv).",
|
|
423
|
-
},
|
|
424
|
-
},
|
|
425
|
-
],
|
|
426
|
-
guidance: "This changes the machine outside the project. Mention it to the user.",
|
|
427
|
-
},
|
|
428
|
-
{
|
|
429
|
-
name: "env-secrets-dump",
|
|
430
|
-
title: "Tried to print environment secrets",
|
|
431
|
-
appliesTo: ["shell"],
|
|
432
|
-
mode: "instruct",
|
|
433
|
-
userCanOverride: true,
|
|
434
|
-
probes: [
|
|
435
|
-
{
|
|
436
|
-
id: "dumps_env",
|
|
437
|
-
instructions:
|
|
438
|
-
"The command in `agent_request` prints environment variable VALUES that may be secret: `env`, " +
|
|
439
|
-
"`printenv`, `set`, `export -p`, or `echo` of a variable whose name suggests a key, token, password " +
|
|
440
|
-
"or secret.",
|
|
441
|
-
criteria: {
|
|
442
|
-
true: "Secret-looking environment values would be printed.",
|
|
443
|
-
false:
|
|
444
|
-
"It echoes a literal string, prints a non-secret variable like PATH or HOME, creates a virtualenv " +
|
|
445
|
-
"named env, or searches code for the word export.",
|
|
446
|
-
},
|
|
447
|
-
},
|
|
448
|
-
],
|
|
449
|
-
guidance: "This prints environment values that may be secrets into the transcript.",
|
|
450
|
-
},
|
|
451
|
-
{
|
|
452
|
-
name: "external-destructive-action",
|
|
453
|
-
title: "Tried an irreversible action through an external tool",
|
|
454
|
-
appliesTo: ["other"],
|
|
455
|
-
mode: "deny",
|
|
456
|
-
userCanOverride: true,
|
|
457
|
-
probes: [
|
|
458
|
-
{
|
|
459
|
-
id: "irreversible_external",
|
|
460
|
-
instructions:
|
|
461
|
-
"The tool call in `agent_request` (an MCP or integration tool, see `facts.tool_name`) performs an " +
|
|
462
|
-
"irreversible or externally visible action: deleting records, repositories, files or accounts; " +
|
|
463
|
-
"sending email, chat or social messages on the user's behalf; making payments or purchases; merging or " +
|
|
464
|
-
"closing pull requests; changing permissions, access or billing; or writing to a production system.",
|
|
465
|
-
criteria: {
|
|
466
|
-
true: "Something outside this machine changes in a way that cannot be quietly undone.",
|
|
467
|
-
false: "It reads, searches, lists, fetches, or creates a draft that nobody else sees yet.",
|
|
468
|
-
},
|
|
469
|
-
},
|
|
470
|
-
],
|
|
471
|
-
guidance: "This takes an irreversible action in an external system. Confirm with the user first.",
|
|
472
|
-
},
|
|
473
|
-
{
|
|
474
|
-
name: "external-data-egress",
|
|
475
|
-
title: "Sent private data to an external tool",
|
|
476
|
-
appliesTo: ["other"],
|
|
477
|
-
mode: "instruct",
|
|
478
|
-
userCanOverride: true,
|
|
479
|
-
probes: [
|
|
480
|
-
{
|
|
481
|
-
id: "egresses_private",
|
|
482
|
-
instructions:
|
|
483
|
-
"The arguments in `agent_request` send private data to an external service: source code, file " +
|
|
484
|
-
"contents, credentials, customer data, or personal information.",
|
|
485
|
-
criteria: {
|
|
486
|
-
true: "Private data is being shared with a third party.",
|
|
487
|
-
false: "Only a query, identifier or public information is sent.",
|
|
488
|
-
},
|
|
489
|
-
},
|
|
490
|
-
],
|
|
491
|
-
guidance: "This shares private data with an external service. Mention what is being sent.",
|
|
492
|
-
},
|
|
493
|
-
];
|
|
494
|
-
|
|
495
83
|
/**
|
|
496
84
|
* Asked once per call, alongside the injection probe, whenever a user override
|
|
497
85
|
* is possible. "Did the user ask for this?" alone was cleared by requests that
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* deciding, per tool call, what this process computes. A precondition gates
|
|
10
10
|
* every hook event, so it is the last place to accept publisher-authored code.
|
|
11
11
|
* So the manifest names one of a fixed, compiled-in set and
|
|
12
|
-
* `preconditions.ts` owns the bodies. Only 2 of the 16
|
|
12
|
+
* `preconditions.ts` owns the bodies. Only 2 of the 16 FailproofAI semantic
|
|
13
13
|
* policies use a precondition at all, so the closed set costs nothing real.
|
|
14
14
|
*
|
|
15
15
|
* ## Why this file exists apart from `preconditions.ts`
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* VALIDATES a name imports `precondition-names.ts` instead, and the header
|
|
8
8
|
* there says why that separation is load-bearing.
|
|
9
9
|
*
|
|
10
|
-
* Every body reuses the helper
|
|
10
|
+
* Every body reuses the helper FailproofAI's own checks were written with rather than
|
|
11
11
|
* restating the rule. A pack's `paths_outside_project` and the builtin
|
|
12
12
|
* `read-outside-workspace` have to mean the same thing: the whole point of the
|
|
13
13
|
* precondition is to decide whether the paired regex deny gets a question at
|
|
@@ -68,7 +68,7 @@ export interface SemanticPolicy {
|
|
|
68
68
|
precondition?: (facts: Facts) => boolean;
|
|
69
69
|
/** Shown to the agent when the policy fires. */
|
|
70
70
|
guidance: string;
|
|
71
|
-
/** The pack that declared it; absent for
|
|
71
|
+
/** The pack that declared it; absent for a caller-supplied set (a replay, a test). Attribution only. */
|
|
72
72
|
origin?: { packId: string; packVersion?: string };
|
|
73
73
|
}
|
|
74
74
|
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[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"))},1608,a=>{"use strict";var b=a.i(5050);let c=(0,b.createServerReference)("0073e97c60b69f2f4014585dd8d236a6a7c09a9cac",b.callServer,void 0,b.findSourceMapURL,"getTelemetryConfig");a.s(["getTelemetryConfig",0,c])},3171,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(1608),e=a.i(66036);a.s(["default",0,function({error:a,reset:f}){return(0,c.useEffect)(()=>{(0,d.getTelemetryConfig)().then(b=>{(0,e.setClientTelemetryConfig)(b),(0,e.captureClientEvent)("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=>{"use strict";a.s(["captureClientEvent",0,function(a,b){},"setClientTelemetryConfig",0,function(a){}])},46058,(a,b,c)=>{"use strict";function d(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(d=function(a){return a?c:b})(a)}c._=function(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var c=d(b);if(c&&c.has(a))return c.get(a);var e={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a)if("default"!==g&&Object.prototype.hasOwnProperty.call(a,g)){var h=f?Object.getOwnPropertyDescriptor(a,g):null;h&&(h.get||h.set)?Object.defineProperty(e,g,h):e[g]=a[g]}return e.default=a,c&&c.set(a,e),e}},5050,(a,b,c)=>{"use strict";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)},20611,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"callServer",{enumerable:!0,get:function(){return g}});let d=a.r(72131),e=a.r(88347),f=a.r(90841);async function g(a,b){return new Promise((c,g)=>{(0,d.startTransition)(()=>{(0,f.dispatchAppRouterAction)({type:e.ACTION_SERVER_ACTION,actionId:a,actionArgs:b,resolve:c,reject:g})})})}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},1722,(a,b,c)=>{"use strict";let d;Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"findSourceMapURL",{enumerable:!0,get:function(){return d}});("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},88347,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d,e,f={ACTION_HMR_REFRESH:function(){return l},ACTION_NAVIGATE:function(){return i},ACTION_REFRESH:function(){return h},ACTION_RESTORE:function(){return j},ACTION_SERVER_ACTION:function(){return m},ACTION_SERVER_PATCH:function(){return k},PrefetchKind:function(){return n},ScrollBehavior:function(){return o}};for(var g in f)Object.defineProperty(c,g,{enumerable:!0,get:f[g]});let h="refresh",i="navigate",j="restore",k="server-patch",l="hmr-refresh",m="server-action";var n=((d={}).AUTO="auto",d.FULL="full",d),o=((e={})[e.Default=0]="Default",e[e.NoScroll=1]="NoScroll",e);("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},90841,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={dispatchAppRouterAction:function(){return i},dispatchGestureState:function(){return j},refreshOnInstantNavigationUnlock:function(){return h},useActionQueue:function(){return k}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(46058)._(a.r(72131)),g=a.r(67009);a.r(88347);function h(){}function i(a){!0;throw Object.defineProperty(Error("Internal Next.js error: Router action dispatched before initialization."),"__NEXT_ERROR_CODE",{value:"E668",enumerable:!1,configurable:!0})}function j(a){!0;throw Object.defineProperty(Error("Internal Next.js error: Router action dispatched before initialization."),"__NEXT_ERROR_CODE",{value:"E668",enumerable:!1,configurable:!0})}function k(a){let[b,c]=f.default.useState(a.state),[d,e]=(0,f.useOptimistic)(b),h=(0,f.useMemo)(()=>d,[d]);return(0,g.isThenable)(h)?(0,f.use)(h):h}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},42602,(a,b,c)=>{"use strict";b.exports=a.r(18622)},9270,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.AppRouterContext},36313,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.HooksClientContext},18341,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.ServerInsertedHtml},35112,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].ReactDOM},87924,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].ReactJsxRuntime},38783,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].ReactServerDOMTurbopackClient},72131,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].React},67009,(a,b,c)=>{"use strict";function d(a){return null!==a&&"object"==typeof a&&"then"in a&&"function"==typeof a.then}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"isThenable",{enumerable:!0,get:function(){return d}})}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__13t1zkw._.js.map
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
module.exports=[1608,a=>{"use strict";var b=a.i(5050);let c=(0,b.createServerReference)("0073e97c60b69f2f4014585dd8d236a6a7c09a9cac",b.callServer,void 0,b.findSourceMapURL,"getTelemetryConfig");a.s(["getTelemetryConfig",0,c])},18952,a=>{"use strict";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=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(50944),e=a.i(1608),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.getTelemetryConfig)().then(b=>{a||((0,f.setClientTelemetryConfig)(b),j.current=!0,(0,f.captureClientEvent)("$pageview"),i.current=window.location.pathname)}),()=>{a=!0}},[]),(0,c.useEffect)(()=>{j.current&&i.current!==h&&(i.current=h,(0,f.captureClientEvent)("$pageview"))},[h]);let k=c.default.useCallback((a,b)=>{(0,f.captureClientEvent)(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=>{"use strict";a.s(["captureClientEvent",0,function(a,b){},"setClientTelemetryConfig",0,function(a){}])},46058,(a,b,c)=>{"use strict";function d(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(d=function(a){return a?c:b})(a)}c._=function(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var c=d(b);if(c&&c.has(a))return c.get(a);var e={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a)if("default"!==g&&Object.prototype.hasOwnProperty.call(a,g)){var h=f?Object.getOwnPropertyDescriptor(a,g):null;h&&(h.get||h.set)?Object.defineProperty(e,g,h):e[g]=a[g]}return e.default=a,c&&c.set(a,e),e}},5050,(a,b,c)=>{"use strict";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)},20611,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"callServer",{enumerable:!0,get:function(){return g}});let d=a.r(72131),e=a.r(88347),f=a.r(90841);async function g(a,b){return new Promise((c,g)=>{(0,d.startTransition)(()=>{(0,f.dispatchAppRouterAction)({type:e.ACTION_SERVER_ACTION,actionId:a,actionArgs:b,resolve:c,reject:g})})})}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},1722,(a,b,c)=>{"use strict";let d;Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"findSourceMapURL",{enumerable:!0,get:function(){return d}});("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},88347,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d,e,f={ACTION_HMR_REFRESH:function(){return l},ACTION_NAVIGATE:function(){return i},ACTION_REFRESH:function(){return h},ACTION_RESTORE:function(){return j},ACTION_SERVER_ACTION:function(){return m},ACTION_SERVER_PATCH:function(){return k},PrefetchKind:function(){return n},ScrollBehavior:function(){return o}};for(var g in f)Object.defineProperty(c,g,{enumerable:!0,get:f[g]});let h="refresh",i="navigate",j="restore",k="server-patch",l="hmr-refresh",m="server-action";var n=((d={}).AUTO="auto",d.FULL="full",d),o=((e={})[e.Default=0]="Default",e[e.NoScroll=1]="NoScroll",e);("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},90841,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={dispatchAppRouterAction:function(){return i},dispatchGestureState:function(){return j},refreshOnInstantNavigationUnlock:function(){return h},useActionQueue:function(){return k}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(46058)._(a.r(72131)),g=a.r(67009);a.r(88347);function h(){}function i(a){!0;throw Object.defineProperty(Error("Internal Next.js error: Router action dispatched before initialization."),"__NEXT_ERROR_CODE",{value:"E668",enumerable:!1,configurable:!0})}function j(a){!0;throw Object.defineProperty(Error("Internal Next.js error: Router action dispatched before initialization."),"__NEXT_ERROR_CODE",{value:"E668",enumerable:!1,configurable:!0})}function k(a){let[b,c]=f.default.useState(a.state),[d,e]=(0,f.useOptimistic)(b),h=(0,f.useMemo)(()=>d,[d]);return(0,g.isThenable)(h)?(0,f.use)(h):h}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},14827,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={createLinkPrefetchPartialError:function(){return g},createUnrenderedSegmentError:function(){return f}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});function f(a,b){let c=`Route "${a}": Could not validate that a segment in your UI has instant navigation.`;if(b.length>0){let a=1===b.length?"Dropped segment":"Dropped segments";c+=`
|
|
2
|
-
|
|
3
|
-
This segment was dropped from rendering. Issues that would prevent instant navigation will go undetected.
|
|
4
|
-
|
|
5
|
-
${a}:
|
|
6
|
-
${b.map(a=>` ${a}`).join("\n")}
|
|
7
|
-
|
|
8
|
-
Ways to fix this:
|
|
9
|
-
- [render] Render the dropped segment
|
|
10
|
-
- [ignore] Set \`export const instant = false\` to opt the dropped segment out of instant-navigation validation
|
|
11
|
-
|
|
12
|
-
Learn more: https://nextjs.org/docs/messages/instant-unrendered-segment`}return Object.defineProperty(Error(c),"__NEXT_ERROR_CODE",{value:"E1286",enumerable:!1,configurable:!0})}function g(a){return Object.defineProperty(Error(`Next.js encountered dynamic data during prefetching for "${a}".
|
|
13
|
-
|
|
14
|
-
This will lead to slower, more expensive prefetches.
|
|
15
|
-
|
|
16
|
-
Ways to fix this:
|
|
17
|
-
- [upgrade] Opt into Partial Prefetching by exporting \`const prefetch = 'partial'\` from the page or layout, or by setting \`partialPrefetching: true\` in next.config to opt the whole app in
|
|
18
|
-
- [disable] Remove \`prefetch={true}\` from the <Link> to use the default prefetch
|
|
19
|
-
- [ignore] Set \`export const instant = false\` to opt the route out of instant-navigation validation
|
|
20
|
-
|
|
21
|
-
Learn more: https://nextjs.org/docs/messages/instant-link-prefetch-partial`),"__NEXT_ERROR_CODE",{value:"E1435",enumerable:!1,configurable:!0})}},88644,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"InvariantError",{enumerable:!0,get:function(){return d}});class d extends Error{constructor(a,b){super(`Invariant: ${a.endsWith(".")?a:a+"."} This is a bug in Next.js.`,b),Object.defineProperty(this,"__NEXT_ERROR_CODE",{value:"E1179",enumerable:!1,configurable:!0}),this.name="InvariantError"}}},67009,(a,b,c)=>{"use strict";function d(a){return null!==a&&"object"==typeof a&&"then"in a&&"function"==typeof a.then}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"isThenable",{enumerable:!0,get:function(){return d}})},41997,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={BailoutToCSRError:function(){return g},isBailoutToCSRError:function(){return h}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f="BAILOUT_TO_CLIENT_SIDE_RENDERING";class g extends Error{constructor(a){super(`Bail out to client-side rendering: ${a}`),this.reason=a,this.digest=f}}function h(a){return"object"==typeof a&&null!==a&&"digest"in a&&a.digest===f}},54427,(a,b,c)=>{"use strict";function d(){let a,b,c=new Promise((c,d)=>{a=c,b=d});return{resolve:a,reject:b,promise:c}}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"createPromiseWithResolvers",{enumerable:!0,get:function(){return d}})},39118,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={DEFAULT_SEGMENT_KEY:function(){return l},NOT_FOUND_SEGMENT_KEY:function(){return m},PAGE_SEGMENT_KEY:function(){return k},addSearchParamsIfPageSegment:function(){return i},computeSelectedLayoutSegment:function(){return j},getSegmentValue:function(){return f},getSelectedLayoutSegmentPath:function(){return function a(b,c,d=!0,e=[]){let g;if(d)g=b[1][c];else{let a=b[1];g=a.children??Object.values(a)[0]}if(!g)return e;let h=f(g[0]);return!h||h.startsWith(k)?e:(e.push(h),a(g,c,!1,e))}},isGroupSegment:function(){return g},isParallelRouteSegment:function(){return h}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});function f(a){return Array.isArray(a)?a[1]:a}function g(a){return"("===a[0]&&a.endsWith(")")}function h(a){return a.startsWith("@")&&"@children"!==a}function i(a,b){if(a.includes(k)){let a=JSON.stringify(b);return"{}"!==a?k+"?"+a:k}return a}function j(a,b){if(!a||0===a.length)return null;let c="children"===b?a[0]:a[a.length-1];return c===l?null:c}let k="__PAGE__",l="__DEFAULT__",m="/_not-found"}];
|
|
22
|
-
|
|
23
|
-
//# sourceMappingURL=_13kfn90._.js.map
|