failproofai 1.0.2-beta.7 → 1.0.2-beta.8

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.
Files changed (116) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/build-manifest.json +3 -3
  3. package/.next/standalone/.next/prerender-manifest.json +3 -3
  4. package/.next/standalone/.next/required-server-files.json +1 -1
  5. package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
  6. package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
  7. package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.rsc +7 -7
  10. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +6 -6
  11. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
  12. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  14. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  15. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  16. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  17. package/.next/standalone/.next/server/app/_not-found.rsc +15 -15
  18. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +15 -15
  19. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +14 -14
  20. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  21. package/.next/standalone/.next/server/app/api/audit/invite/route.js.nft.json +1 -1
  22. package/.next/standalone/.next/server/app/api/audit/run/route.js.nft.json +1 -1
  23. package/.next/standalone/.next/server/app/api/audit/status/route.js.nft.json +1 -1
  24. package/.next/standalone/.next/server/app/api/auth/login-request/route.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/api/auth/login-verify/route.js.nft.json +1 -1
  26. package/.next/standalone/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
  27. package/.next/standalone/.next/server/app/api/auth/status/route.js.nft.json +1 -1
  28. package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js.nft.json +1 -1
  29. package/.next/standalone/.next/server/app/audit/page/server-reference-manifest.json +2 -2
  30. package/.next/standalone/.next/server/app/audit/page.js.nft.json +1 -1
  31. package/.next/standalone/.next/server/app/audit/page_client-reference-manifest.js +1 -1
  32. package/.next/standalone/.next/server/app/index.html +1 -1
  33. package/.next/standalone/.next/server/app/index.rsc +15 -15
  34. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +14 -14
  35. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +15 -15
  36. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  37. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
  38. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  39. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  40. package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +14 -14
  41. package/.next/standalone/.next/server/app/policies/page.js +5 -4
  42. package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
  43. package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
  44. package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
  45. package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
  46. package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
  47. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
  48. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
  49. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
  50. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
  51. package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
  52. package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
  53. package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  54. package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +4 -4
  55. package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
  56. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  57. package/.next/standalone/.next/server/chunks/{[externals]__1qzqcio._.js → [externals]__1lt47k4._.js} +1 -1
  58. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0o07qi9._.js +1 -1
  59. package/.next/standalone/.next/server/chunks/_0lxbzdq._.js +1 -1
  60. package/.next/standalone/.next/server/chunks/_1ek68ln._.js +3 -3
  61. package/.next/standalone/.next/server/chunks/_1zuiiy3._.js +1 -1
  62. package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4v._.js +1 -1
  63. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__013jr2b._.js +2 -2
  64. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01wy8d-._.js +2 -2
  65. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02npjtd._.js +2 -2
  66. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0da85px._.js +2 -2
  67. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ftmoxc._.js +2 -2
  68. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0oa1lav._.js +1 -1
  69. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0p-5p8u._.js +2 -2
  70. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0s740oi._.js +2 -2
  71. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1jjjg6g._.js → [root-of-the-server]__1-wzs7f._.js} +2 -2
  72. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__07gm3zl._.js → [root-of-the-server]__1n2ywfz._.js} +5 -19
  73. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1p2otjt._.js +2 -2
  74. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1opxw-7._.js → [root-of-the-server]__1wlvpe5._.js} +2 -2
  75. package/.next/standalone/.next/server/chunks/ssr/_08x1r5t._.js +1 -1
  76. package/.next/standalone/.next/server/chunks/ssr/{_0_nsohj._.js → _0l7zv8b._.js} +2 -2
  77. package/.next/standalone/.next/server/chunks/ssr/{_1uvml5y._.js → _1h33neq._.js} +1 -1
  78. package/.next/standalone/.next/server/chunks/ssr/_1u8-lu2._.js +1 -1
  79. package/.next/standalone/.next/server/chunks/ssr/_1zopuov._.js +1 -1
  80. package/.next/standalone/.next/server/chunks/ssr/_next-internal_server_app_policies_page_actions_1sp2-yo.js +17 -0
  81. package/.next/standalone/.next/server/chunks/ssr/app_audit__components_audit-dashboard_tsx_0p9ud47._.js +1 -1
  82. package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_1kp6l3x._.js +1 -1
  83. package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_19dqvpc._.js +1 -1
  84. package/.next/standalone/.next/server/chunks/ssr/app_settings_settings-client_tsx_20lq-mq._.js +1 -1
  85. package/.next/standalone/.next/server/chunks/ssr/src_hooks_pack-cli_ts_0t7me65._.js +3 -0
  86. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  87. package/.next/standalone/.next/server/middleware.js +1 -1
  88. package/.next/standalone/.next/server/pages/404.html +1 -1
  89. package/.next/standalone/.next/server/pages/500.html +1 -1
  90. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  91. package/.next/standalone/.next/server/server-reference-manifest.json +19 -19
  92. package/.next/standalone/.next/static/chunks/{3swqstog1cd9u.js → 0i3a6wf-f_yky.js} +1 -1
  93. package/.next/standalone/.next/static/chunks/{3vqddiy9tvlwf.js → 0u2ojcw25c_np.js} +1 -1
  94. package/.next/standalone/.next/static/chunks/{0icodhlwr9x_e.js → 11a_m8yksthtf.js} +2 -2
  95. package/.next/standalone/.next/static/chunks/{2-9lvhuto1iwo.js → 1ch5l9t2p16y4.js} +1 -1
  96. package/.next/standalone/.next/static/chunks/{3jt6n16p2qpex.js → 1n04wzsaes73g.js} +1 -1
  97. package/.next/standalone/.next/static/chunks/{44oamw33aso19.js → 2iryw37qfqy5y.js} +1 -1
  98. package/.next/standalone/.next/static/chunks/{1d7o3wnt3h6se.js → 34j7nmidlcuni.js} +1 -1
  99. package/.next/standalone/.next/static/chunks/{1d6c85605lsgp.js → 3927pu4ss_l4k.js} +1 -1
  100. package/.next/standalone/.next/static/chunks/{0tvmd0p_1i_g6.js → 3r0udrtpn78-e.js} +1 -1
  101. package/.next/standalone/.next/static/chunks/{1mfzsja6ftim5.css → 40nr6ehj4p3cw.css} +1 -1
  102. package/.next/standalone/.next/static/chunks/{1vzyn9h2kvj-i.js → 416zumre3fvfw.js} +1 -1
  103. package/.next/standalone/package.json +9 -9
  104. package/.next/standalone/server.js +1 -1
  105. package/bin/failproofai.mjs +47 -12
  106. package/dist/cli.mjs +6070 -4131
  107. package/dist/worker.mjs +6 -3
  108. package/package.json +9 -9
  109. package/scripts/build-policy-pack.mjs +28 -4
  110. package/src/hooks/pack-cli.ts +827 -97
  111. package/src/hooks/pack-manifest.ts +34 -1
  112. package/src/hooks/pack-store.ts +208 -16
  113. package/src/hooks/tui.ts +21 -1
  114. /package/.next/standalone/.next/static/{PKwyBPAHjy3DB8qqapaH4 → NgD5HvuyPxwgrpeIiafJL}/_buildManifest.js +0 -0
  115. /package/.next/standalone/.next/static/{PKwyBPAHjy3DB8qqapaH4 → NgD5HvuyPxwgrpeIiafJL}/_clientMiddlewareManifest.js +0 -0
  116. /package/.next/standalone/.next/static/{PKwyBPAHjy3DB8qqapaH4 → NgD5HvuyPxwgrpeIiafJL}/_ssgManifest.js +0 -0
package/dist/worker.mjs CHANGED
@@ -2559,7 +2559,7 @@ var init_builtin_policies = __esm(() => {
2559
2559
  });
2560
2560
 
2561
2561
  // package.json
2562
- var version = "1.0.2-beta.7";
2562
+ var version = "1.0.2-beta.8";
2563
2563
  var init_package = () => {};
2564
2564
 
2565
2565
  // src/posthog-key.ts
@@ -8911,10 +8911,12 @@ function parsePackIdentity(value) {
8911
8911
  if (value.effect !== undefined && value.effect !== "enforce" && value.effect !== "observe") {
8912
8912
  throw new Error(`unknown effect ${JSON.stringify(value.effect)} for pack ${value.id}`);
8913
8913
  }
8914
+ const commit = typeof value.commit === "string" && PACK_COMMIT_RE.test(value.commit.trim().toLowerCase()) ? value.commit.trim().toLowerCase() : undefined;
8914
8915
  return {
8915
8916
  id: value.id,
8916
8917
  version: value.version,
8917
- effect: value.effect ?? "enforce"
8918
+ effect: value.effect ?? "enforce",
8919
+ ...commit ? { commit } : {}
8918
8920
  };
8919
8921
  }
8920
8922
  function hasInstalledPacks() {
@@ -9077,7 +9079,7 @@ function safeDeclared(raw) {
9077
9079
  function errText(err) {
9078
9080
  return err instanceof Error ? err.message : String(err);
9079
9081
  }
9080
- var ACCEPTED_PACK_SCHEMA_VERSIONS, SHA256_RE2, PACK_ID_RE, PACK_VERSION_RE, PACK_POLICY_NAME_RE;
9082
+ var ACCEPTED_PACK_SCHEMA_VERSIONS, SHA256_RE2, PACK_ID_RE, PACK_VERSION_RE, PACK_COMMIT_RE, PACK_POLICY_NAME_RE;
9081
9083
  var init_pack_manifest = __esm(() => {
9082
9084
  init_fp_home();
9083
9085
  init_cloud_managed_policies();
@@ -9085,6 +9087,7 @@ var init_pack_manifest = __esm(() => {
9085
9087
  SHA256_RE2 = /^[a-f0-9]{64}$/;
9086
9088
  PACK_ID_RE = /^[A-Za-z0-9._-]{1,64}\/[A-Za-z0-9._-]{1,64}$/;
9087
9089
  PACK_VERSION_RE = /^[A-Za-z0-9][A-Za-z0-9._+-]{0,63}$/;
9090
+ PACK_COMMIT_RE = /^[0-9a-f]{7,40}$/;
9088
9091
  PACK_POLICY_NAME_RE = /^[A-Za-z0-9._-]{1,128}$/;
9089
9092
  });
9090
9093
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "failproofai",
3
- "version": "1.0.2-beta.7",
3
+ "version": "1.0.2-beta.8",
4
4
  "description": "Observability and enforcement for AI agent harnesses. 39 built-in policies hooked into 12 of them — Claude Code, Codex, Cursor, Hermes, OpenClaw and more — blocking the tool call before it runs. Local dashboard included, no account needed.",
5
5
  "bin": {
6
6
  "failproofai": "./dist/cli.mjs",
@@ -120,15 +120,15 @@
120
120
  "sharp": "0.35.0"
121
121
  },
122
122
  "optionalDependencies": {
123
- "@failproofai/failproofaid-linux-x64": "1.0.2-beta.7",
124
- "@failproofai/failproofaid-linux-arm64": "1.0.2-beta.7",
125
- "@failproofai/failproofaid-darwin-x64": "1.0.2-beta.7",
126
- "@failproofai/failproofaid-darwin-arm64": "1.0.2-beta.7"
123
+ "@failproofai/failproofaid-linux-x64": "1.0.2-beta.8",
124
+ "@failproofai/failproofaid-linux-arm64": "1.0.2-beta.8",
125
+ "@failproofai/failproofaid-darwin-x64": "1.0.2-beta.8",
126
+ "@failproofai/failproofaid-darwin-arm64": "1.0.2-beta.8"
127
127
  },
128
128
  "failproofaidBinaries": {
129
- "linux-x64": "75a8e231e057986f2b357e1fcb596641afd82a4b58f9271bb4b342951a364c2d",
130
- "linux-arm64": "47d2933d06e70faefa78fe06fdd4e06bc03e94a319d13a8837145d192cd84d8c",
131
- "darwin-x64": "6eae79c75746efe6922ca84e7dd899d01a50e651879abc8f90de69cd51c403f3",
132
- "darwin-arm64": "ddca616decc3d2415ce6a58ae5fe15786bd2cfa5a5319803f4207a01d40e4a0a"
129
+ "linux-x64": "7b49023fd9351ccdddc066f9560d998e6b582b763ab4ad4253831a2548e99ae1",
130
+ "linux-arm64": "b43af87cb0ca7e83bfbc053051ef4627ce9594cb7b6a520492689f750302adc1",
131
+ "darwin-x64": "c03d157deddf78d1d7928aa6d33909e1ff585eace77d5d25090c56c7eb2a9983",
132
+ "darwin-arm64": "a2489beaf7e580a3e012a45d346c8df5764f426f460c0c6fb9bd7b405ac65366"
133
133
  }
134
134
  }
@@ -37,6 +37,9 @@ import { createHash } from "node:crypto";
37
37
  import { mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
38
38
  import { dirname, join, resolve } from "node:path";
39
39
  import { fileURLToPath } from "node:url";
40
+ // The one place the pack's id is decided. Imported rather than restated — see
41
+ // PACK_ID below for what restating it cost.
42
+ import { CORE_SOURCE } from "../src/hooks/pack-store.ts";
40
43
 
41
44
  const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), "..");
42
45
  // `--out <dir>` lets the conformance test generate into a temp directory rather
@@ -47,10 +50,17 @@ const outArg = process.argv.indexOf("--out");
47
50
  const OUT_DIR = outArg !== -1 && process.argv[outArg + 1]
48
51
  ? resolve(process.argv[outArg + 1])
49
52
  : join(ROOT, "policy-pack");
50
- // Not `failproofai/builtins`. These stop being builtins the moment they ship as
51
- // a pack, and an id is the most durable place a retired word can hide — it ends
52
- // up in every machine's installed.json and in the listing every user reads.
53
- const PACK_ID = "failproofai/core";
53
+ // Not restated. The id is the most durable place a retired word can hide — it
54
+ // ends up in every machine's installed.json and in the listing every user reads
55
+ // and restating it here is how it hid twice: `failproofai/builtins` shipped
56
+ // first, was corrected to `failproofai/core` HERE and nowhere else, and then
57
+ // `core` was retired in pack-store while this line went on saying it. The one
58
+ // published release still declares `failproofai/builtins`, so a machine that
59
+ // installed it cannot be addressed by either name anybody would type.
60
+ //
61
+ // Read from the layer that owns the set, so the next rename reaches this file
62
+ // whether or not somebody remembers it exists.
63
+ const PACK_ID = CORE_SOURCE;
54
64
  const ENTRY_ASSET = "failproofai-pack.mjs";
55
65
  const MANIFEST_ASSET = "failproofai-pack.json";
56
66
  const CHECKSUMS_ASSET = "SHA256SUMS";
@@ -60,6 +70,17 @@ const version = JSON.parse(readFileSync(join(ROOT, "package.json"), "utf8")).ver
60
70
  // A generated entry that registers every non-alwaysOn builtin through the public
61
71
  // policy API — the same API a third-party pack uses. `failproofai` stays external
62
72
  // so the loader's shim resolves it, exactly as it does for any other pack.
73
+ //
74
+ // It registers `category` and `defaultEnabled` as well as name/description/
75
+ // match/fn, and that is not decoration. This script builds ITS manifest straight
76
+ // from POLICY_CATALOG, so omitting them from the ENTRY looked harmless — and was
77
+ // not: the entry IS the artifact, and anything that rebuilds a manifest from it
78
+ // saw 38 policies filed under "General" with none on by default. `failproofai
79
+ // publish` does exactly that, which is how a release that would have enforced
80
+ // nothing on a default install got as far as a dry run.
81
+ //
82
+ // Note for whoever edits the template below: it is a template literal, so a
83
+ // backtick inside it ends the string. Comments in there stay backtick-free.
63
84
  const entrySource = `
64
85
  import { customPolicies } from "failproofai";
65
86
  import { BUILTIN_POLICIES } from ${JSON.stringify(join(ROOT, "src/hooks/builtin-policies.ts"))};
@@ -69,6 +90,9 @@ for (const policy of BUILTIN_POLICIES) {
69
90
  customPolicies.add({
70
91
  name: policy.name,
71
92
  description: policy.description,
93
+ // Both fields matter here; see the note above entrySource.
94
+ category: policy.category,
95
+ defaultEnabled: policy.defaultEnabled === true,
72
96
  match: policy.match,
73
97
  fn: policy.fn,
74
98
  });