failproofai 1.0.2-beta.0 → 1.0.2-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/build-manifest.json +5 -5
- 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/build-manifest.json +2 -2
- 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/build-manifest.json +2 -2
- 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 +14 -14
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +14 -14
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +13 -13
- 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.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/build-manifest.json +2 -2
- 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 +14 -14
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +13 -13
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +14 -14
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/page/build-manifest.json +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/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +14 -14
- package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page/build-manifest.json +2 -2
- 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/build-manifest.json +2 -2
- 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/build-manifest.json +2 -2
- 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/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +4 -4
- 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/_0tovk6q._.js +1 -1
- package/.next/standalone/.next/server/chunks/_0trp3yc._.js +1 -1
- package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4v._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__013jr2b._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01wy8d-._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02npjtd._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__07gm3zl._.js +14 -14
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__090sxxw._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0da85px._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ftmoxc._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0oa1lav._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0p-5p8u._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0s740oi._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1p2otjt._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_08x1r5t._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0wb8osu._.js +23 -0
- package/.next/standalone/.next/server/chunks/ssr/{_12l4a_k._.js → _1oggjel._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1u8-lu2._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1zopuov._.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_settings-client_tsx_20lq-mq._.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +5 -5
- 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 +19 -19
- package/.next/standalone/.next/static/chunks/{3y54nw0i7dsjl.js → 0nnbtp0w4sxrr.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0sa9v5mhc8861.js → 0ykd_go4oahan.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0eqky-7n7dgdm.js → 140ip21rqmelt.js} +1 -1
- package/.next/standalone/.next/static/chunks/{2i2yt3hzjredm.js → 1da5a_a-3btas.js} +1 -1
- package/.next/standalone/.next/static/chunks/{1oml7c7env4-g.js → 1fac8krph-zgp.js} +1 -1
- package/.next/standalone/.next/static/chunks/{2hs7ycvsav7v2.js → 1nzy5jc_vf9e0.js} +1 -1
- package/.next/standalone/.next/static/chunks/{1sl2xmn9inx3y.js → 1yw71gn8vqco1.js} +1 -1
- package/.next/standalone/.next/static/chunks/{1nuqytbta44af.js → 29eh4k77otcw6.js} +1 -1
- package/.next/standalone/.next/static/chunks/{2aawsjld9ied_.js → 2axi5ehjbld9h.js} +1 -1
- package/.next/standalone/.next/static/chunks/{2gn7ut4svofm2.js → 2fzxl7n717pbc.js} +1 -1
- package/.next/standalone/.next/static/chunks/{35xg6retpe6rp.js → 3jjmdqqzem21x.js} +1 -1
- package/.next/standalone/.next/static/chunks/{turbopack-3kjgdgwci4tqf.js → turbopack-2vqpa-dts1gy4.js} +1 -1
- package/.next/standalone/app/actions/pack-actions.ts +21 -11
- package/.next/standalone/app/policies/hooks-client.tsx +3 -4
- package/.next/standalone/fp-cloud-cli/fp_cli/_version.py +1 -1
- package/.next/standalone/package.json +10 -11
- package/.next/standalone/sdk/python/failproofai_sdk/_version.py +1 -1
- package/.next/standalone/server.js +1 -1
- package/bin/failproofai.mjs +455 -316
- package/dist/cli.mjs +2374 -1873
- package/dist/worker.mjs +3 -13
- package/package.json +10 -11
- package/src/hooks/configure-wizard.ts +67 -444
- package/src/hooks/fp-reset.ts +10 -19
- package/src/hooks/handler.ts +2 -2
- package/src/hooks/manager.ts +58 -24
- package/src/hooks/pack-cli.ts +488 -43
- package/src/hooks/pack-failclosed.ts +1 -1
- package/src/hooks/pack-manifest.ts +14 -6
- package/src/hooks/pack-store.ts +89 -128
- package/src/hooks/tui.ts +150 -48
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0zig5sv._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_00e9tnf._.js +0 -23
- package/policy-pack/SHA256SUMS +0 -2
- package/policy-pack/failproofai-pack.json +0 -732
- package/policy-pack/failproofai-pack.mjs +0 -2017
- package/src/hooks/policy-presets.ts +0 -137
- /package/.next/standalone/.next/static/{nwbyWT06Ud0XdXOrVJyvS → A7czO1PZdTcNzLGa_H1sm}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{nwbyWT06Ud0XdXOrVJyvS → A7czO1PZdTcNzLGa_H1sm}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{nwbyWT06Ud0XdXOrVJyvS → A7czO1PZdTcNzLGa_H1sm}/_ssgManifest.js +0 -0
package/src/hooks/handler.ts
CHANGED
|
@@ -323,7 +323,7 @@ export async function evaluateHookEvent(
|
|
|
323
323
|
if (legacyNames.length > 0) {
|
|
324
324
|
hookLogWarn(
|
|
325
325
|
`enforcing ${legacyNames.length} policies from this build because no pack is installed — ` +
|
|
326
|
-
`run \`failproofai
|
|
326
|
+
`run \`failproofai policies add core\` to move them into a real pack`,
|
|
327
327
|
);
|
|
328
328
|
}
|
|
329
329
|
// What actually registered, for the pack-duplicate check below. A paused
|
|
@@ -432,7 +432,7 @@ export async function evaluateHookEvent(
|
|
|
432
432
|
// A pack policy whose name is an ENABLED BUILTIN is the same guard
|
|
433
433
|
// twice. The two register under different keys — `failproofai/block-sudo`
|
|
434
434
|
// and `pack/<id>@<version>/block-sudo` — so nothing deduped them, and
|
|
435
|
-
// the
|
|
435
|
+
// the core pack carries the builtins under exactly these names.
|
|
436
436
|
//
|
|
437
437
|
// A deny hides it (the first verdict short-circuits) but an INSTRUCT does
|
|
438
438
|
// not: instructions accumulate and are joined, so the agent received the
|
package/src/hooks/manager.ts
CHANGED
|
@@ -26,7 +26,7 @@ import { CliError } from "../cli-error";
|
|
|
26
26
|
import { hookLogWarn } from "./hook-logger";
|
|
27
27
|
import { customPoliciesDir, globalPolicyConfigFile } from "./fp-home";
|
|
28
28
|
import { readActiveCloudManagedPolicies } from "./cloud-managed-policies";
|
|
29
|
-
import {
|
|
29
|
+
import { CORE_SOURCE, addPack, setPackPolicyEnabled } from "./pack-store";
|
|
30
30
|
import type { ResolvedPack } from "./pack-manifest";
|
|
31
31
|
import { hasInstalledPacks, readInstalledPacks } from "./pack-manifest";
|
|
32
32
|
import {
|
|
@@ -480,7 +480,7 @@ async function installHooksImpl(
|
|
|
480
480
|
// would leave a freshly set-up machine enforcing nothing at all — which is
|
|
481
481
|
// the failure mode this whole product exists to prevent.
|
|
482
482
|
//
|
|
483
|
-
//
|
|
483
|
+
// Fetched from the pack's GitHub release: there is no copy in this package,
|
|
484
484
|
// cannot fail behind a proxy, and the machine is guarded the moment it is
|
|
485
485
|
// configured rather than the moment it next reaches github.com.
|
|
486
486
|
// The always-on guard is excluded: a pack may not declare `alwaysOn`, so the
|
|
@@ -489,7 +489,7 @@ async function installHooksImpl(
|
|
|
489
489
|
const alwaysOnNames = new Set(BUILTIN_POLICIES.filter((p) => p.alwaysOn).map((p) => p.name));
|
|
490
490
|
const fromPack = selectedPolicies.filter((name) => !alwaysOnNames.has(name));
|
|
491
491
|
if (fromPack.length > 0) {
|
|
492
|
-
// ONLY when there is no pack yet.
|
|
492
|
+
// ONLY when there is no pack yet. Fetching the core pack with
|
|
493
493
|
// `only: <selection>` REPLACES whatever the machine had chosen, and
|
|
494
494
|
// `selectedPolicies` is derived from `enabledPolicies` — which is empty on a
|
|
495
495
|
// machine whose pack came from `pack add core`. `policy add block-rm-rf`
|
|
@@ -499,11 +499,17 @@ async function installHooksImpl(
|
|
|
499
499
|
// With a pack already installed the names are switched on individually
|
|
500
500
|
// instead, which is additive and touches nothing else.
|
|
501
501
|
if (!hasInstalledPacks()) {
|
|
502
|
-
|
|
503
|
-
|
|
502
|
+
// Fetched, not unpacked from this package: there is no copy in here any
|
|
503
|
+
// more. That makes this the one path in `policies --install` that needs
|
|
504
|
+
// the network, so its failure is reported rather than thrown — the names
|
|
505
|
+
// are already written to config, and the no-pack fallback enforces them
|
|
506
|
+
// until a pack arrives.
|
|
507
|
+
try {
|
|
508
|
+
await addPack(CORE_SOURCE, { only: fromPack });
|
|
509
|
+
} catch (err) {
|
|
504
510
|
console.log(
|
|
505
|
-
`\nWarning: could not
|
|
506
|
-
`
|
|
511
|
+
`\nWarning: could not fetch the policy pack (${err instanceof Error ? err.message : String(err)}).\n` +
|
|
512
|
+
`Run \`failproofai policies add core\` once you are online.`,
|
|
507
513
|
);
|
|
508
514
|
}
|
|
509
515
|
} else {
|
|
@@ -861,25 +867,53 @@ export async function listHooks(cwd?: string): Promise<void> {
|
|
|
861
867
|
return 0;
|
|
862
868
|
}
|
|
863
869
|
})();
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
870
|
+
// `installedScopes` is about HOOKS — whether any agent CLI is wired to call
|
|
871
|
+
// us — and it says nothing about whether policies exist. Reporting it as
|
|
872
|
+
// "not installed" above a listing of an installed pack was a flat
|
|
873
|
+
// contradiction, and it hid the state that actually matters: a machine can
|
|
874
|
+
// hold thirty-eight policies and enforce none of them, because nothing is
|
|
875
|
+
// calling failproofai at all. That is the worst of the three states and it
|
|
876
|
+
// used to read like the emptiest.
|
|
877
|
+
const packsPresent = (() => {
|
|
878
|
+
try {
|
|
879
|
+
return readInstalledPacks().packs.length > 0;
|
|
880
|
+
} catch {
|
|
881
|
+
return false;
|
|
882
|
+
}
|
|
883
|
+
})();
|
|
884
|
+
const subtitle =
|
|
885
|
+
installedScopes.length > 0
|
|
886
|
+
? `${installedScopes.join(" + ")} · ${packCount} on`
|
|
887
|
+
: packsPresent
|
|
888
|
+
? `${packCount} on · NOT ENFORCING`
|
|
889
|
+
: "nothing installed";
|
|
890
|
+
groups.push(title("failproofai policies", subtitle, opts));
|
|
873
891
|
|
|
874
892
|
if (installedScopes.length === 0) {
|
|
875
893
|
groups.push(
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
894
|
+
packsPresent
|
|
895
|
+
? warning(
|
|
896
|
+
[
|
|
897
|
+
// ONE string, not four hand-broken ones. `warning` wraps each
|
|
898
|
+
// element to the terminal, so pre-wrapped prose keeps its author's
|
|
899
|
+
// line breaks as paragraph breaks and then wraps again inside
|
|
900
|
+
// them — which at 60 columns left the word "them." alone on a
|
|
901
|
+
// line. The command stays separate because it is not prose and
|
|
902
|
+
// must never be split across a wrap.
|
|
903
|
+
"These policies are installed but NOTHING is running them. No agent " +
|
|
904
|
+
"CLI on this machine is wired to call failproofai, so every policy " +
|
|
905
|
+
"below is inert. Wire it up with:",
|
|
906
|
+
" failproofai config",
|
|
907
|
+
],
|
|
908
|
+
opts,
|
|
909
|
+
)
|
|
910
|
+
: nextStep(
|
|
911
|
+
"failproofai config",
|
|
912
|
+
config.enabledPolicies.length > 0
|
|
913
|
+
? "These are configured but NOT installed — no hook is running them:"
|
|
914
|
+
: "Nothing is set up yet. Get started with:",
|
|
915
|
+
opts,
|
|
916
|
+
),
|
|
883
917
|
);
|
|
884
918
|
}
|
|
885
919
|
// Held back to the end rather than printed here. Everything below this point
|
|
@@ -1034,7 +1068,7 @@ export async function listHooks(cwd?: string): Promise<void> {
|
|
|
1034
1068
|
}
|
|
1035
1069
|
|
|
1036
1070
|
// Installed packs. They enforce on this machine exactly like every section
|
|
1037
|
-
// above, and until now the only way to see one was `failproofai
|
|
1071
|
+
// above, and until now the only way to see one was `failproofai policies` —
|
|
1038
1072
|
// so the command that answers "what is enforcing here?" answered it with a
|
|
1039
1073
|
// subset, for the one source a person had to go out of their way to install.
|
|
1040
1074
|
try {
|