failproofai 1.0.2-beta.4 → 1.0.2-beta.6
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 +4 -4
- 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 +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 +2 -2
- 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 +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]__03r-lqq._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0o07qi9._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__12021ot._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1le9jqc._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0clqfab._.js → [root-of-the-server]__1tg4pu6._.js} +2 -2
- package/.next/standalone/.next/server/chunks/_0lxbzdq._.js +1 -1
- package/.next/standalone/.next/server/chunks/{_1lbh81u._.js → _19uwam-._.js} +1 -1
- package/.next/standalone/.next/server/chunks/_1ek68ln._.js +7 -7
- package/.next/standalone/.next/server/chunks/_1zuiiy3._.js +1 -1
- package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4v._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_hooks_fp-home_ts_09kv0bn._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1m84s36._.js → [root-of-the-server]__00-s7h8._.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 +6 -6
- 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]__14muoc4._.js → [root-of-the-server]__128se8m._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0jzbk4_._.js → [root-of-the-server]__190won8._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1ctpynv._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1p2otjt._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0rsd3ll._.js → [root-of-the-server]__1sc84bb._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_08x1r5t._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0ovx4lz._.js → _0no96tu._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_1dkh76z._.js → _11fc-hb._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_1ddpc5g._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_1db3-8n._.js → _1if9ixi._.js} +2 -2
- 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/chunks/ssr/lib_1cf5ya2._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/lib_opencode-projects_ts_15bjxkm._.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/{0lshnlpy1m6bc.js → 0931avh-06lj5.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0k_yvjc1yz0pq.js → 0h-3zffoy-_ji.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0ds64uculrze8.js → 0p84npzxdgpc5.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0d_re32wscs0b.js → 0sdgnflvw8kta.js} +1 -1
- package/.next/standalone/.next/static/chunks/{2dbi_x0c8n8fi.js → 0z7au3njlak0j.js} +1 -1
- package/.next/standalone/.next/static/chunks/{1o0ahew9568ls.js → 1id7o44jjegf0.js} +1 -1
- package/.next/standalone/.next/static/chunks/{00_t-xvc59tkb.js → 276n-edifojbd.js} +2 -2
- package/.next/standalone/.next/static/chunks/{07j2u70_3qsx8.js → 2jfskwd2u8o5r.js} +1 -1
- package/.next/standalone/.next/static/chunks/{2817_8e94ah9z.js → 2pxr7nr1nyotn.js} +1 -1
- package/.next/standalone/.next/static/chunks/{1oz0svxwt9574.js → 3i8rg2fv9nd6e.js} +2 -2
- package/.next/standalone/.next/static/chunks/{1q76jk_1_wgjq.js → 3vu_7_eor1m-k.js} +1 -1
- package/.next/standalone/.next/static/chunks/{turbopack-17utl_jw0wj11.js → turbopack-2x-o099q64i8h.js} +1 -1
- package/.next/standalone/lib/opencode-db.ts +77 -0
- package/.next/standalone/lib/opencode-projects.ts +37 -41
- package/.next/standalone/lib/opencode-sessions.ts +59 -36
- package/.next/standalone/package.json +9 -9
- package/.next/standalone/server.js +1 -1
- package/bin/failproofai.mjs +116 -34
- package/dist/cli.mjs +1732 -1177
- package/dist/worker.mjs +180 -165
- package/lib/opencode-db.ts +77 -0
- package/lib/opencode-projects.ts +37 -41
- package/lib/opencode-sessions.ts +59 -36
- package/package.json +9 -9
- package/src/audit/cache.ts +167 -11
- package/src/audit/cli-adapters/claude.ts +111 -1
- package/src/audit/cli-adapters/index.ts +31 -1
- package/src/audit/cli.ts +12 -0
- package/src/audit/index.ts +164 -13
- package/src/hooks/configure-wizard.ts +112 -18
- package/src/hooks/fp-reset.ts +1 -1
- package/src/hooks/handler.ts +13 -1
- package/src/hooks/manager.ts +69 -4
- package/src/hooks/onboarding-attempt.ts +4 -4
- package/src/hooks/pack-cli.ts +399 -32
- package/src/hooks/pack-store.ts +21 -8
- package/src/hooks/read-stdin.ts +78 -8
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1l-khtb._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1mhmdzs._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1qxztj-._.js +0 -3
- /package/.next/standalone/.next/static/{0iNzkTsP6rh14Rj5WL17o → mAYN9BOxWVFREnVp3yCHp}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{0iNzkTsP6rh14Rj5WL17o → mAYN9BOxWVFREnVp3yCHp}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{0iNzkTsP6rh14Rj5WL17o → mAYN9BOxWVFREnVp3yCHp}/_ssgManifest.js +0 -0
package/bin/failproofai.mjs
CHANGED
|
@@ -725,10 +725,10 @@ OPTIONS
|
|
|
725
725
|
failproofai pack — install policy packs published as GitHub releases
|
|
726
726
|
|
|
727
727
|
Usage:
|
|
728
|
-
failproofai
|
|
729
|
-
failproofai
|
|
730
|
-
failproofai
|
|
731
|
-
failproofai
|
|
728
|
+
failproofai policies add FailproofAI/policies the Failproof AI policies
|
|
729
|
+
failproofai policies add FailproofAI/policies --policy <a,b> just these
|
|
730
|
+
failproofai policies add FailproofAI/policies --category <x,y> whole categories
|
|
731
|
+
failproofai policies add FailproofAI/policies --all everything in it
|
|
732
732
|
failproofai pack list packs installed here
|
|
733
733
|
failproofai pack list <source> what a pack out there contains
|
|
734
734
|
failproofai pack add <source> [--policy <a,b>] [--category <x,y>] [--all]
|
|
@@ -739,7 +739,7 @@ A pack is one entry artifact plus a manifest, verified against the release's
|
|
|
739
739
|
SHA256SUMS at install time. The digest is recorded, and re-verified before every
|
|
740
740
|
import — so a pack cannot change under this machine after you installed it.
|
|
741
741
|
|
|
742
|
-
<source> is
|
|
742
|
+
<source> is any GitHub repo publishing a pack — ours included:
|
|
743
743
|
acme/support-agent newest release, pinned to its exact tag
|
|
744
744
|
acme/support-agent@v2.1.0 that release
|
|
745
745
|
github:acme/support-agent@v2.1.0 same, explicit
|
|
@@ -761,7 +761,7 @@ rest back on.
|
|
|
761
761
|
|
|
762
762
|
Examples:
|
|
763
763
|
failproofai pack add FailproofAI/policies
|
|
764
|
-
failproofai
|
|
764
|
+
failproofai policies add FailproofAI/policies --category sanitize,git
|
|
765
765
|
failproofai pack add github:acme/support-agent@v2.1.0 --only block-refunds
|
|
766
766
|
failproofai pack remove acme/support-agent
|
|
767
767
|
|
|
@@ -1220,7 +1220,12 @@ WHY THIS EXISTS
|
|
|
1220
1220
|
// ever ship a pack. `pack build` is canonicalized into this above.
|
|
1221
1221
|
if (args[0] === "publish") {
|
|
1222
1222
|
const subArgs = args.slice(1);
|
|
1223
|
-
|
|
1223
|
+
// NOT `subArgs.length === 0`. A bare `failproofai publish` is the headline
|
|
1224
|
+
// of the help this used to print instead — "TWO COMMANDS, FROM NOTHING:
|
|
1225
|
+
// --init to start, publish to ship it" — and every argument it needs is
|
|
1226
|
+
// worked out from the directory and the git remote. Printing help there
|
|
1227
|
+
// made the one documented command the only one that did nothing.
|
|
1228
|
+
if (subArgs.includes("--help") || subArgs.includes("-h")) {
|
|
1224
1229
|
console.log(`
|
|
1225
1230
|
failproofai publish — ship your policies as a pack anyone can install
|
|
1226
1231
|
|
|
@@ -1229,8 +1234,13 @@ TWO COMMANDS, FROM NOTHING
|
|
|
1229
1234
|
failproofai publish --init write a policy to start from
|
|
1230
1235
|
failproofai publish ship it
|
|
1231
1236
|
|
|
1232
|
-
|
|
1233
|
-
|
|
1237
|
+
Write your policies in a git repo, run publish, answer one question, done.
|
|
1238
|
+
It asks WHERE only when nothing tells it — no remote to read — and works
|
|
1239
|
+
the rest out: which files hold policies, what version is next, who you are.
|
|
1240
|
+
|
|
1241
|
+
Every flag below overrides something it would otherwise decide for you.
|
|
1242
|
+
None of them is required, and on a pipe or in CI the flags are all there
|
|
1243
|
+
is: nothing prompts where nobody can answer.
|
|
1234
1244
|
|
|
1235
1245
|
WHAT --init DOES
|
|
1236
1246
|
Asks what the pack is called, writes <name>.mjs, and stops. No network, no
|
|
@@ -1289,11 +1299,16 @@ THE REPO MUST BE PUBLIC
|
|
|
1289
1299
|
Only the release matters. Installs read releases/download/<tag>/<asset> and
|
|
1290
1300
|
never touch your git tree — pushing the source is for humans reading it.
|
|
1291
1301
|
|
|
1292
|
-
YOUR
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1302
|
+
YOUR POLICY FILES
|
|
1303
|
+
Write as many as you like — one per category reads well. Every file here
|
|
1304
|
+
that registers policies is found and bundled into the single artifact a
|
|
1305
|
+
pack has to be, because only the entry is digest-pinned and a pack
|
|
1306
|
+
importing siblings could not honestly claim to be verified. Bundling needs
|
|
1307
|
+
bun; without it, name one self-contained file.
|
|
1308
|
+
|
|
1309
|
+
Each policy may carry category and defaultEnabled alongside the usual
|
|
1310
|
+
fields. category is what --category selects on; defaultEnabled is what a
|
|
1311
|
+
bare 'policies add' switches on, and it defaults to false.
|
|
1297
1312
|
|
|
1298
1313
|
OPTIONS
|
|
1299
1314
|
--init [file] Write a starter policy and stop.
|
|
@@ -1356,7 +1371,7 @@ USAGE
|
|
|
1356
1371
|
failproofai policies add Pick from what is installed here
|
|
1357
1372
|
failproofai policies add <name> Turn one policy on
|
|
1358
1373
|
failproofai policies add <owner>/<repo> Install someone's pack
|
|
1359
|
-
failproofai policies add
|
|
1374
|
+
failproofai policies add FailproofAI/policies Our pack, fetched like any other
|
|
1360
1375
|
failproofai policies remove <name> Turn one policy off
|
|
1361
1376
|
failproofai policies remove <pack-id> Uninstall a pack
|
|
1362
1377
|
failproofai policies show <owner>/<repo> What a pack contains, before you take it
|
|
@@ -1389,7 +1404,7 @@ EXAMPLES
|
|
|
1389
1404
|
failproofai policies add
|
|
1390
1405
|
failproofai policies add block-sudo
|
|
1391
1406
|
failproofai policies add sanitize-api-keys --scope project
|
|
1392
|
-
failproofai policies add
|
|
1407
|
+
failproofai policies add FailproofAI/policies --category sanitize,git
|
|
1393
1408
|
failproofai policies add acme/deploy-guard --policy block-prod-deploy
|
|
1394
1409
|
failproofai policies show acme/deploy-guard
|
|
1395
1410
|
failproofai policies remove block-sudo
|
|
@@ -1409,18 +1424,41 @@ keep enforcing. FAILPROOFAI_PACK_BASE_URL points it all at a mirror.
|
|
|
1409
1424
|
// without a slash that is still a source — it is the short spelling of our
|
|
1410
1425
|
// own pack, and is checked by the pack lane itself rather than duplicated
|
|
1411
1426
|
// here.
|
|
1412
|
-
|
|
1427
|
+
// The first positional that is NOT some flag's value.
|
|
1428
|
+
//
|
|
1429
|
+
// A plain `rest.find(a => !a.startsWith("-"))` reads the first VALUE it
|
|
1430
|
+
// meets instead: `policies add --cli claude codex acme/x` picked "claude",
|
|
1431
|
+
// decided that was not a source because it has no slash, and sent the whole
|
|
1432
|
+
// command down the policy lane — where it died on "Unknown flag: --policy".
|
|
1433
|
+
// The same shape works, and misroutes, for --scope and --custom.
|
|
1434
|
+
//
|
|
1435
|
+
// `--cli` takes SEVERAL values, bounded the way pack-cli.ts bounds them: a
|
|
1436
|
+
// pack source always carries a slash and an agent name never does, which
|
|
1437
|
+
// separates the list from what follows it exactly.
|
|
1438
|
+
const VALUE_TAKING = new Set(["--scope", "--policy", "--category", "--only", "--custom", "-c"]);
|
|
1439
|
+
const skip = new Set();
|
|
1440
|
+
for (let i = 0; i < rest.length; i += 1) {
|
|
1441
|
+
if (VALUE_TAKING.has(rest[i])) skip.add(i + 1);
|
|
1442
|
+
if (rest[i] !== "--cli") continue;
|
|
1443
|
+
for (let j = i + 1; j < rest.length && !rest[j].startsWith("-") && !rest[j].includes("/"); j += 1) {
|
|
1444
|
+
skip.add(j);
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
const firstPositional = rest.find((a, i) => !a.startsWith("-") && !skip.has(i));
|
|
1413
1448
|
let looksLikeSource =
|
|
1414
1449
|
!!firstPositional &&
|
|
1415
1450
|
(firstPositional.includes("/") || firstPositional.startsWith("github:"));
|
|
1416
1451
|
if (!looksLikeSource && firstPositional) {
|
|
1417
|
-
//
|
|
1418
|
-
//
|
|
1419
|
-
//
|
|
1420
|
-
//
|
|
1421
|
-
//
|
|
1422
|
-
|
|
1423
|
-
|
|
1452
|
+
// A retired spelling of our own pack — `core` and friends — is still
|
|
1453
|
+
// routed to the pack lane, which is the only layer that can say what to
|
|
1454
|
+
// type instead. Sent anywhere else it reads as an unknown POLICY name and
|
|
1455
|
+
// the reply lists 38 names, none of which is the answer.
|
|
1456
|
+
//
|
|
1457
|
+
// Read from the layer that owns the set rather than restated here, where
|
|
1458
|
+
// the copy would drift. That exact drift already shipped once, when the
|
|
1459
|
+
// dashboard could not resolve a name the CLI could.
|
|
1460
|
+
const { RETIRED_CORE_ALIASES } = await import("../src/hooks/pack-store");
|
|
1461
|
+
looksLikeSource = RETIRED_CORE_ALIASES.has(firstPositional.toLowerCase());
|
|
1424
1462
|
}
|
|
1425
1463
|
|
|
1426
1464
|
if (action === "show" || looksLikeSource) {
|
|
@@ -1650,8 +1688,8 @@ EXAMPLES
|
|
|
1650
1688
|
failproofai policies --uninstall --cli pi
|
|
1651
1689
|
failproofai policies -u
|
|
1652
1690
|
failproofai policies --uninstall --custom
|
|
1653
|
-
failproofai
|
|
1654
|
-
failproofai
|
|
1691
|
+
failproofai policies add FailproofAI/policies
|
|
1692
|
+
failproofai policies add FailproofAI/policies --category git,database
|
|
1655
1693
|
failproofai pack list acme/support-agent
|
|
1656
1694
|
failproofai pack build ./my-policies.mjs --id acme/support --version 1.0.0
|
|
1657
1695
|
`.trimStart());
|
|
@@ -1877,19 +1915,38 @@ EXAMPLES
|
|
|
1877
1915
|
if (args[0] === "config") {
|
|
1878
1916
|
if (args.includes("--help") || args.includes("-h")) {
|
|
1879
1917
|
console.log(`
|
|
1880
|
-
failproofai config —
|
|
1918
|
+
failproofai config — set this machine up
|
|
1881
1919
|
|
|
1882
1920
|
USAGE
|
|
1883
|
-
failproofai config Guided setup
|
|
1921
|
+
failproofai config Guided setup
|
|
1884
1922
|
failproofai configure Alias for config
|
|
1885
1923
|
failproofai setup Alias for config
|
|
1886
1924
|
|
|
1887
1925
|
WHAT IT DOES
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1926
|
+
Installs the failproofaid service (needs root once), wires hooks into every
|
|
1927
|
+
agent CLI it supports, and optionally connects this machine to Cloud. It
|
|
1928
|
+
chooses NO policies — take some with 'failproofai policies add <owner>/<repo>'.
|
|
1929
|
+
|
|
1930
|
+
WITH NO TERMINAL (CI, containers, an agent driving it)
|
|
1931
|
+
It just runs. There is nothing to confirm when nobody is watching, so it
|
|
1932
|
+
applies rather than asking — no flag needed.
|
|
1933
|
+
|
|
1934
|
+
failproofai config set up, stay local
|
|
1935
|
+
failproofai config --token <key> set up and connect to Cloud
|
|
1936
|
+
--url <url> somewhere other than app.befailproof.ai
|
|
1937
|
+
--machine-id <id> defaults to a stable per-machine key
|
|
1938
|
+
--machine-label <name> defaults to this host's name
|
|
1939
|
+
--no-transcripts decisions only, no session transcripts
|
|
1940
|
+
|
|
1941
|
+
The key can come from FAILPROOFAI_CLOUD_TOKEN instead of the command line,
|
|
1942
|
+
and the url from FAILPROOFAI_CLOUD_URL — the same variable the daemon reads.
|
|
1943
|
+
Prefer the environment: an argument is readable from 'ps' by every user on
|
|
1944
|
+
the box, and lands in shell history and CI logs.
|
|
1945
|
+
|
|
1946
|
+
Exit 1 if anything it was asked to do did not happen — including a key the
|
|
1947
|
+
server refused, and a machine that could not reach root. 'sudo' is never
|
|
1948
|
+
prompted for here; it either works without a password or you are told the
|
|
1949
|
+
exact commands to run.
|
|
1893
1950
|
|
|
1894
1951
|
FAILPROOF CLOUD
|
|
1895
1952
|
failproofai config --connect <url> --token <key> [--machine-id <id>]
|
|
@@ -2078,8 +2135,33 @@ PAUSING ENFORCEMENT (one session, always time-boxed)
|
|
|
2078
2135
|
return;
|
|
2079
2136
|
}
|
|
2080
2137
|
|
|
2138
|
+
// Headless setup. `--token` IS the request to connect — there is no other
|
|
2139
|
+
// reason to pass a key — so there is no separate --connect to remember, and
|
|
2140
|
+
// the URL keeps the default the wizard already infers rather than being a
|
|
2141
|
+
// question the flag path alone asks.
|
|
2142
|
+
//
|
|
2143
|
+
// The key is taken from the environment when the flag is absent, because a
|
|
2144
|
+
// secret on argv is readable from `ps` by every user on the box and lands
|
|
2145
|
+
// in shell history and CI logs. FAILPROOFAI_CLOUD_TOKEN is the name the
|
|
2146
|
+
// Rust daemon already reads, so this unifies rather than invents.
|
|
2147
|
+
const valueFor = (flag) => {
|
|
2148
|
+
const i = args.indexOf(flag);
|
|
2149
|
+
if (i < 0) return undefined;
|
|
2150
|
+
const v = args[i + 1];
|
|
2151
|
+
if (!v || v.startsWith("-")) throw new CliError(`Missing value after ${flag}.`);
|
|
2152
|
+
return v;
|
|
2153
|
+
};
|
|
2081
2154
|
const { runConfigureWizard } = await import("../src/hooks/configure-wizard");
|
|
2082
|
-
const result = await runConfigureWizard(
|
|
2155
|
+
const result = await runConfigureWizard(
|
|
2156
|
+
{},
|
|
2157
|
+
{
|
|
2158
|
+
token: valueFor("--token") ?? process.env.FAILPROOFAI_CLOUD_TOKEN,
|
|
2159
|
+
url: valueFor("--url") ?? process.env.FAILPROOFAI_CLOUD_URL,
|
|
2160
|
+
machineId: valueFor("--machine-id"),
|
|
2161
|
+
machineLabel: valueFor("--machine-label"),
|
|
2162
|
+
noTranscripts: args.includes("--no-transcripts"),
|
|
2163
|
+
},
|
|
2164
|
+
);
|
|
2083
2165
|
await track("cli_configure_invoked", {
|
|
2084
2166
|
applied: result.applied,
|
|
2085
2167
|
// `target` and `scopes`, not `scope`: the wizard rework replaced that
|