failproofai 1.0.0-beta.0 → 1.0.0-beta.10
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/app-path-routes-manifest.json +2 -1
- package/.next/standalone/.next/build-manifest.json +6 -6
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/required-server-files.json +1 -1
- package/.next/standalone/.next/routes-manifest.json +6 -0
- package/.next/standalone/.next/server/app/_global-error/page/build-manifest.json +3 -3
- 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 +3 -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 +2 -2
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
- 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 +3 -3
- 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 +3 -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/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +10 -10
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
- 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 +3 -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 +4 -3
- 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 +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 +2 -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 +3 -2
- 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 +3 -2
- package/.next/standalone/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/reminder/route.js +3 -2
- package/.next/standalone/.next/server/app/api/auth/reminder/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/status/route.js +3 -2
- 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 +3 -3
- package/.next/standalone/.next/server/app/audit/page/server-reference-manifest.json +2 -2
- package/.next/standalone/.next/server/app/audit/page.js +5 -3
- 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 +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +15 -15
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +10 -10
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/page/build-manifest.json +3 -3
- package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/page.js +3 -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 +3 -3
- package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +30 -18
- package/.next/standalone/.next/server/app/policies/page.js +5 -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/build-manifest.json +3 -3
- 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 +4 -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 +3 -3
- 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 +6 -4
- 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 +3 -3
- package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/projects/page.js +4 -2
- 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/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/settings/page/build-manifest.json +18 -0
- package/.next/standalone/.next/server/app/settings/page/next-font-manifest.json +6 -0
- package/.next/standalone/.next/server/app/settings/page/react-loadable-manifest.json +1 -0
- package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +53 -0
- package/.next/standalone/.next/server/app/settings/page.js +18 -0
- package/.next/standalone/.next/server/app/settings/page.js.map +5 -0
- package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app-paths-manifest.json +2 -1
- package/.next/standalone/.next/server/chunks/[externals]__0h9_83k._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[externals]__1nl3dvw._.js → [externals]__0r-zamh._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[externals]__1ifpkx-._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__06hexd0._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__094p1f1._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_0xu5z._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ed01_d._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0g0vcwt._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0h3lfmp._.js → [root-of-the-server]__0ky_n0r._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__18d-9oi._.js → [root-of-the-server]__0lk_935._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__16le-kd._.js → [root-of-the-server]__0pbp9fe._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0q-v9z2._.js +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__10oa-v9._.js → [root-of-the-server]__0v2fpxe._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0sb_5m8._.js → [root-of-the-server]__131ebum._.js} +3 -3
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0-dh5jy._.js → [root-of-the-server]__1_ps0jw._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0l4vuqm._.js → [root-of-the-server]__1a7i2q4._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1ibjy5x._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1iny24d._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1tvn4wf._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1tyedjt._.js +3 -0
- package/.next/standalone/.next/server/chunks/_0lxbzdq._.js +5 -0
- package/.next/standalone/.next/server/chunks/_1zuiiy3._.js +5 -0
- package/.next/standalone/.next/server/chunks/lib_telemetry_ts_0dctyyw._.js +5 -0
- package/.next/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_17k9e3w.js +5 -5
- package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_01r25oi._.js +2 -1
- package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_09z9-p7._.js +2 -1
- package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4v._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[externals]__1aq139v._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__04pwh4t._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__06bp_fg._.js +5 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__074qmkp._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__170799-._.js → [root-of-the-server]__0spkm68._.js} +11 -11
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__10butu6._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1a2hcb_._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1qapotl._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1apb7k_._.js → [root-of-the-server]__1rdruw4._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1rv-sc9._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1tyf0tc._.js +5 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1u-wx42._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1v185mo._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__01od0m6._.js → [root-of-the-server]__1yw368c._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0-yi74u._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_04mekdy._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0r-dsre._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0rjgfln._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0se484m._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0uz7o9y._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_11_p9y8._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1e19atl._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1fahg9e._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_1gmzkwj._.js +5 -0
- package/.next/standalone/.next/server/chunks/ssr/_1w8sola._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_1w_6p9g._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_1y4qr7u._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/app_audit__components_audit-dashboard_tsx_0p9ud47._.js +2 -2
- 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 +2 -2
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0dwo94s.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_11bnuzn._.js +2 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_builtin-policies_ts_09j2ndl._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_fp-config_ts_04t589g._.js +5 -0
- package/.next/standalone/.next/server/middleware-build-manifest.js +6 -6
- package/.next/standalone/.next/server/middleware.js +2 -2
- 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 +74 -20
- package/.next/standalone/.next/static/chunks/00adubtgov21s.js +1 -0
- package/.next/standalone/.next/static/chunks/{03fmihek9n986.js → 06zgzyh3wv1ig.js} +1 -1
- package/.next/standalone/.next/static/chunks/{1hdhteui932bq.js → 0qmo2t50kpb30.js} +1 -1
- package/.next/standalone/.next/static/chunks/{1grd7y94-igz9.js → 0yudogeqddpzr.js} +1 -1
- package/.next/standalone/.next/static/chunks/16p68cybetr31.js +1 -0
- package/.next/standalone/.next/static/chunks/1bm0q12hgs22l.css +2 -0
- package/.next/standalone/.next/static/chunks/{1d6ncspjagm53.js → 1fu90ch80qngv.js} +1 -1
- package/.next/standalone/.next/static/chunks/{2vr7aazw6k2-n.js → 1m416lie3qwsj.js} +1 -1
- package/.next/standalone/.next/static/chunks/1v1gqvpjk62jm.js +1 -0
- package/.next/standalone/.next/static/chunks/1ypqzvoal8j56.js +6 -0
- package/.next/standalone/.next/static/chunks/23kev26by1e4f.js +1 -0
- package/.next/standalone/.next/static/chunks/{29k6ef49zppxj.js → 2h4sbmp0ad78w.js} +1 -1
- package/.next/standalone/.next/static/chunks/2obwg4tterjpa.js +1 -0
- package/.next/standalone/.next/static/chunks/2uvhw57mf9lg_.css +2 -0
- package/.next/standalone/.next/static/chunks/{29ydr-8q0zis6.js → 30ufy4_e2n78e.js} +22 -22
- package/.next/standalone/.next/static/chunks/31coz11ia5vc4.js +1 -0
- package/.next/standalone/.next/static/chunks/{1s-_swlc80y43.js → 3p4j0l1o_p-nm.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0ip1n8xmgxarv.js → 3uxnxwxcctyj0.js} +1 -1
- package/.next/standalone/.next/static/chunks/{turbopack-1lsv92x7klwrn.js → turbopack-3diub4ctvn1n0.js} +1 -1
- package/.next/standalone/app/actions/get-active-pauses.ts +16 -0
- package/.next/standalone/app/actions/get-hooks-config.ts +2 -1
- package/.next/standalone/app/actions/get-scheduled-audit.ts +70 -0
- package/.next/standalone/app/actions/update-scheduled-audit.ts +44 -0
- package/.next/standalone/app/api/audit/run/route.ts +28 -0
- package/.next/standalone/app/api/audit/status/route.ts +13 -1
- package/.next/standalone/app/api/auth/status/route.ts +1 -1
- package/.next/standalone/app/audit/_components/auth-dialog.css +159 -0
- package/.next/standalone/app/audit/_components/auth-dialog.tsx +3 -0
- package/.next/standalone/app/audit/audit-styles.css +6 -149
- package/.next/standalone/app/components/pause-notices.tsx +111 -0
- package/.next/standalone/app/policies/hooks-client.tsx +81 -6
- package/.next/standalone/app/settings/page.tsx +31 -0
- package/.next/standalone/app/settings/settings-client.tsx +488 -0
- package/.next/standalone/components/navbar.tsx +2 -0
- package/.next/standalone/lib/auth/api-server-client.ts +2 -3
- package/.next/standalone/lib/auth/auth-store.ts +4 -4
- package/.next/standalone/lib/codex-sessions.ts +2 -1
- package/.next/standalone/lib/dashboard-host.ts +101 -0
- package/.next/standalone/lib/install-check.ts +22 -7
- package/.next/standalone/lib/pi-sessions.ts +99 -14
- package/.next/standalone/lib/telemetry-enabled.ts +54 -0
- package/.next/standalone/lib/telemetry-id.ts +52 -1
- package/.next/standalone/lib/telemetry.ts +8 -4
- package/.next/standalone/node_modules/react/cjs/react.development.js +1 -1
- package/.next/standalone/node_modules/react/cjs/react.production.js +1 -1
- package/.next/standalone/node_modules/react/package.json +3 -3
- package/.next/standalone/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.js +1 -1
- package/.next/standalone/node_modules/react-dom/cjs/react-dom-server-legacy.node.production.js +1 -1
- package/.next/standalone/node_modules/react-dom/cjs/react-dom-server.browser.production.js +3 -3
- package/.next/standalone/node_modules/react-dom/cjs/react-dom-server.edge.production.js +3 -3
- package/.next/standalone/node_modules/react-dom/cjs/react-dom-server.node.production.js +3 -3
- package/.next/standalone/node_modules/react-dom/cjs/react-dom.production.js +1 -1
- package/.next/standalone/node_modules/react-dom/package.json +4 -4
- package/.next/standalone/package.json +17 -10
- package/.next/standalone/proxy.ts +89 -1
- package/.next/standalone/server.js +1 -1
- package/bin/failproofai.mjs +518 -79
- package/dist/cli.mjs +11484 -6046
- package/dist/worker.mjs +2019 -272
- package/lib/auth/api-server-client.ts +2 -3
- package/lib/auth/auth-store.ts +4 -4
- package/lib/codex-sessions.ts +2 -1
- package/lib/dashboard-host.ts +101 -0
- package/lib/install-check.ts +22 -7
- package/lib/pi-sessions.ts +99 -14
- package/lib/telemetry-enabled.ts +54 -0
- package/lib/telemetry-id.ts +52 -1
- package/lib/telemetry.ts +8 -4
- package/package.json +17 -10
- package/scripts/build-daemon-packages.mjs +210 -0
- package/scripts/daemon-platforms.mjs +42 -0
- package/scripts/install-telemetry.mjs +8 -1
- package/scripts/launch.ts +25 -3
- package/scripts/parse-script-args.ts +17 -1
- package/scripts/prune-standalone.mjs +26 -0
- package/scripts/publish-aliases.mjs +62 -41
- package/scripts/repro-npm-install.sh +155 -0
- package/scripts/translate-docs/readme-translator.ts +163 -4
- package/scripts/validate-mdx.ts +153 -13
- package/src/audit/audit-lock.ts +285 -0
- package/src/audit/audit-schedule.ts +111 -0
- package/src/audit/cache.ts +18 -4
- package/src/audit/cli-adapters/goose.ts +2 -1
- package/src/audit/cli-adapters/hermes.ts +28 -10
- package/src/audit/cli.ts +191 -35
- package/src/audit/dashboard-cache.ts +2 -1
- package/src/hooks/backfill-cli.ts +247 -0
- package/src/hooks/builtin-policies.ts +390 -2
- package/src/hooks/cloud-connection.ts +354 -0
- package/src/hooks/cloud-enrollment-cli.ts +325 -0
- package/src/hooks/cloud-enrollment.ts +243 -0
- package/src/hooks/cloud-introspect.ts +147 -0
- package/src/hooks/cloud-managed-policies.ts +169 -0
- package/src/hooks/collector-config.ts +234 -0
- package/src/hooks/configure-wizard.ts +915 -158
- package/src/hooks/custom-hooks-loader.ts +191 -33
- package/src/hooks/daemon-client.ts +136 -17
- package/src/hooks/daemon-download.ts +192 -30
- package/src/hooks/daemon-service.ts +1190 -92
- package/src/hooks/first-run-gate.ts +50 -0
- package/src/hooks/fp-config.ts +497 -0
- package/src/hooks/fp-home.ts +375 -0
- package/src/hooks/fp-reset.ts +464 -0
- package/src/hooks/handler.ts +185 -6
- package/src/hooks/hook-activity-store.ts +85 -20
- package/src/hooks/hook-logger.ts +2 -1
- package/src/hooks/hook-telemetry.ts +5 -1
- package/src/hooks/hooks-config.ts +4 -3
- package/src/hooks/loader-utils.ts +171 -8
- package/src/hooks/manager.ts +5 -4
- package/src/hooks/onboarding-attempt.ts +179 -0
- package/src/hooks/onboarding-lock.ts +119 -0
- package/src/hooks/policy-types.ts +28 -0
- package/src/hooks/session-pause-cli.ts +159 -0
- package/src/hooks/session-pause.ts +268 -0
- package/src/hooks/setup-state.ts +256 -0
- package/src/hooks/tui.ts +119 -4
- package/src/hooks/uninstall-cli.ts +345 -0
- package/src/hooks/worker-server.ts +65 -3
- package/.next/standalone/.next/server/chunks/[externals]__14odj07._.js +0 -3
- package/.next/standalone/.next/server/chunks/[externals]__1s61mel._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0id_xf7._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0longh-._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__17g9wh7._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__19120tr._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1fwl2mz._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1myjm-d._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1rhmvod._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[externals]__1_g_b3t._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0114ewg._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0259h38._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02r5bgf._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0e8sjqm._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0lkzqax._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0qucxyj._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0u02miy._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0uno39i._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__14dd6h8._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1ath6v_._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1zj-87g._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1zqz4v8._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/_1m_p7pi._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_html-to-image_es_index_1-upb14.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_1ezd2jf._.js +0 -5
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_1tnuifj._.js +0 -5
- package/.next/standalone/.next/static/chunks/0h7auy7hzjyhw.js +0 -1
- package/.next/standalone/.next/static/chunks/0u9hc6oxx-gpj.js +0 -6
- package/.next/standalone/.next/static/chunks/0zbxssxh53n-3.js +0 -1
- package/.next/standalone/.next/static/chunks/2mazwb1qmur1p.js +0 -1
- package/.next/standalone/.next/static/chunks/2pujpnfx4pws6.css +0 -2
- package/.next/standalone/.next/static/chunks/33u59vf_8xpd-.js +0 -1
- package/.next/standalone/.next/static/chunks/3i27c3hcriawq.css +0 -1
- package/.next/standalone/.next/static/chunks/3wrgbih-516uj.js +0 -1
- package/.next/standalone/Cargo.lock +0 -428
- package/.next/standalone/Cargo.toml +0 -9
- package/.next/standalone/crates/PROTOCOL.md +0 -122
- package/.next/standalone/crates/failproofaid/Cargo.toml +0 -18
- package/.next/standalone/crates/failproofaid/src/lock.rs +0 -81
- package/.next/standalone/crates/failproofaid/src/main.rs +0 -83
- package/.next/standalone/crates/failproofaid/src/paths.rs +0 -172
- package/.next/standalone/crates/failproofaid/src/server.rs +0 -502
- package/.next/standalone/crates/failproofaid/src/worker.rs +0 -400
- package/.next/standalone/crates/failproofaid/tests/daemon_e2e.rs +0 -241
- package/.next/standalone/crates/fpai-ipc/Cargo.toml +0 -16
- package/.next/standalone/crates/fpai-ipc/src/envelope.rs +0 -175
- package/.next/standalone/crates/fpai-ipc/src/framing.rs +0 -177
- package/.next/standalone/crates/fpai-ipc/src/lib.rs +0 -10
- package/.next/standalone/crates/fpai-ipc/src/peer.rs +0 -80
- package/.next/standalone/docker-hook-sync/Dockerfile +0 -79
- package/.next/standalone/docker-hook-sync/entrypoint.sh +0 -109
- package/.next/standalone/integration-suite/Dockerfile +0 -47
- package/.next/standalone/integration-suite/README.md +0 -129
- package/.next/standalone/integration-suite/canary-policies.mjs +0 -45
- package/.next/standalone/integration-suite/capture-tokens.sh +0 -48
- package/.next/standalone/integration-suite/ci-entrypoint.sh +0 -179
- package/.next/standalone/integration-suite/inject-tokens.sh +0 -44
- package/.next/standalone/integration-suite/install-clis.sh +0 -136
- package/.next/standalone/integration-suite/probe-cli.sh +0 -248
- package/.next/standalone/integration-suite/report.js +0 -120
- package/.next/standalone/integration-suite/run.sh +0 -159
- package/.next/standalone/openclaw-plugin/index.js +0 -223
- package/.next/standalone/openclaw-plugin/openclaw.plugin.json +0 -6
- package/.next/standalone/openclaw-plugin/package.json +0 -12
- package/.next/standalone/osv-scanner.toml +0 -17
- package/.next/standalone/pi-extension/index.ts +0 -524
- package/.next/standalone/pi-extension/package.json +0 -12
- package/.next/standalone/postcss.config.mjs +0 -8
- package/.next/standalone/readme-arch-hq.gif +0 -0
- package/.next/standalone/rust-toolchain.toml +0 -4
- package/src/auth/cli.ts +0 -371
- /package/.next/standalone/.next/static/{7Lxtd352rSaHB-pmm6G8M → pBBcTvE6_VueYGbacy1kg}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{7Lxtd352rSaHB-pmm6G8M → pBBcTvE6_VueYGbacy1kg}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{7Lxtd352rSaHB-pmm6G8M → pBBcTvE6_VueYGbacy1kg}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Publishes the four `failproofaid` binaries as npm platform packages, so a
|
|
4
|
+
* plain `npm install failproofai` already carries the daemon for the machine
|
|
5
|
+
* it landed on instead of fetching one from the GitHub Release later.
|
|
6
|
+
*
|
|
7
|
+
* The release assets stay exactly as they are — this is a second channel, not
|
|
8
|
+
* a replacement. `src/hooks/daemon-download.ts` prefers whichever binary is
|
|
9
|
+
* already on disk, then this npm package, then the release; the npm path is
|
|
10
|
+
* the only one that works with no network at `failproofai config` time.
|
|
11
|
+
*
|
|
12
|
+
* Two rules make this safe, and both come from the way the first attempt at
|
|
13
|
+
* npm-shipping the daemon failed (CHANGELOG 1.0.0-beta.3 — four
|
|
14
|
+
* `optionalDependencies` were declared and never published, so every install
|
|
15
|
+
* resolved four 404s):
|
|
16
|
+
*
|
|
17
|
+
* 1. These packages publish BEFORE the root package that pins them, so the
|
|
18
|
+
* names always exist by the time anything depends on them.
|
|
19
|
+
* 2. A publish failure here is fatal, not a warning (unlike the alias stubs
|
|
20
|
+
* in publish-aliases.mjs, where a missing name costs nothing). Failing
|
|
21
|
+
* the job leaves the registry untouched; publishing a root package whose
|
|
22
|
+
* optional dependency 404s would ship the broken state to every user.
|
|
23
|
+
*
|
|
24
|
+
* Usage:
|
|
25
|
+
* node scripts/build-daemon-packages.mjs --artifacts <dir> [--dist-tag <tag>]
|
|
26
|
+
* [--version <v>] [--pin-root] [--dry-run]
|
|
27
|
+
*/
|
|
28
|
+
import { execFileSync } from "node:child_process";
|
|
29
|
+
import { chmodSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
30
|
+
import { tmpdir } from "node:os";
|
|
31
|
+
import { dirname, join, resolve } from "node:path";
|
|
32
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
33
|
+
import { gunzipSync } from "node:zlib";
|
|
34
|
+
import {
|
|
35
|
+
DAEMON_PLATFORMS,
|
|
36
|
+
daemonAssetName,
|
|
37
|
+
daemonOptionalDependencies,
|
|
38
|
+
daemonPackageName,
|
|
39
|
+
} from "./daemon-platforms.mjs";
|
|
40
|
+
|
|
41
|
+
const REPO_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Where the generated packages are staged — **outside the repo**, and that is
|
|
45
|
+
* load-bearing rather than tidy.
|
|
46
|
+
*
|
|
47
|
+
* `npm publish` re-runs `prepare`, so the Next build happens again *after*
|
|
48
|
+
* this script has run, and Next's file tracing pulls the whole project root
|
|
49
|
+
* into `.next/standalone` (see the "over-traced project artifacts" prune list
|
|
50
|
+
* in scripts/prune-standalone.mjs). Anything staged inside the checkout
|
|
51
|
+
* therefore ends up inside the published CLI tarball — measured: a dry run
|
|
52
|
+
* shipped 16 MB of daemon `.gz` assets under
|
|
53
|
+
* `.next/standalone/release-assets/`. Staging in the temp dir cannot be swept
|
|
54
|
+
* up by a build. `--staging` overrides it for tests.
|
|
55
|
+
*/
|
|
56
|
+
export const STAGING_DIR = resolve(tmpdir(), "failproofaid-packages");
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The manifest for one platform package.
|
|
60
|
+
*
|
|
61
|
+
* Deliberately carries no `bin` (it would shadow the root package's own
|
|
62
|
+
* `failproofaid` shim, which is what a user invoking the daemon by hand
|
|
63
|
+
* should reach) and no `exports` (so `require.resolve("<pkg>/package.json")`
|
|
64
|
+
* — how the CLI finds this package — keeps working).
|
|
65
|
+
*/
|
|
66
|
+
export function platformPackageManifest(platform, version, rootPkg = {}) {
|
|
67
|
+
return {
|
|
68
|
+
name: daemonPackageName(platform.key),
|
|
69
|
+
version,
|
|
70
|
+
description: `The failproofaid background daemon binary for ${platform.os} ${platform.cpu}. Installed automatically as an optional dependency of failproofai.`,
|
|
71
|
+
// npm's own platform filters: with both set, only the matching package is
|
|
72
|
+
// installed and the other three are skipped without a warning.
|
|
73
|
+
os: [platform.os],
|
|
74
|
+
cpu: [platform.cpu],
|
|
75
|
+
files: ["bin/"],
|
|
76
|
+
publishConfig: { access: "public" },
|
|
77
|
+
repository: rootPkg.repository,
|
|
78
|
+
homepage: rootPkg.homepage,
|
|
79
|
+
bugs: rootPkg.bugs,
|
|
80
|
+
license: rootPkg.license,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Stages one platform package on disk and returns its directory.
|
|
86
|
+
*
|
|
87
|
+
* The binary is written decompressed and mode 0755: npm records the executable
|
|
88
|
+
* bit in the tarball, so it survives publish → install, which is how esbuild
|
|
89
|
+
* and swc ship their binaries.
|
|
90
|
+
*/
|
|
91
|
+
export function stagePlatformPackage(platform, version, rootPkg, artifactsDir, stagingRoot = STAGING_DIR) {
|
|
92
|
+
const asset = resolve(artifactsDir, daemonAssetName(platform.key));
|
|
93
|
+
if (!existsSync(asset)) {
|
|
94
|
+
throw new Error(`missing artifact ${asset} — the daemon build did not produce ${daemonAssetName(platform.key)}`);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const dir = join(stagingRoot, `failproofaid-${platform.key}`);
|
|
98
|
+
rmSync(dir, { recursive: true, force: true });
|
|
99
|
+
mkdirSync(join(dir, "bin"), { recursive: true });
|
|
100
|
+
|
|
101
|
+
const binary = gunzipSync(readFileSync(asset));
|
|
102
|
+
const binaryPath = join(dir, "bin", "failproofaid");
|
|
103
|
+
writeFileSync(binaryPath, binary);
|
|
104
|
+
chmodSync(binaryPath, 0o755);
|
|
105
|
+
|
|
106
|
+
writeFileSync(
|
|
107
|
+
join(dir, "package.json"),
|
|
108
|
+
JSON.stringify(platformPackageManifest(platform, version, rootPkg), null, 2) + "\n",
|
|
109
|
+
);
|
|
110
|
+
writeFileSync(
|
|
111
|
+
join(dir, "README.md"),
|
|
112
|
+
`# ${daemonPackageName(platform.key)}\n\n` +
|
|
113
|
+
`The \`failproofaid\` background daemon binary for ${platform.os} ${platform.cpu}.\n\n` +
|
|
114
|
+
`Installed automatically as an optional dependency of [failproofai](https://www.npmjs.com/package/failproofai) — ` +
|
|
115
|
+
`you do not need to install it yourself.\n`,
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
return dir;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Writes the four platform packages into the root manifest's
|
|
123
|
+
* `optionalDependencies`, pinned to `version`.
|
|
124
|
+
*
|
|
125
|
+
* Called at publish time rather than committed: a pin to a version that does
|
|
126
|
+
* not exist yet breaks `bun install --frozen-lockfile` in this repo's own CI,
|
|
127
|
+
* and keeping four pins in step with every version bump by hand is the drift
|
|
128
|
+
* this whole file exists to avoid.
|
|
129
|
+
*/
|
|
130
|
+
export function pinRootManifest(version, packageJsonPath = resolve(REPO_ROOT, "package.json")) {
|
|
131
|
+
const pkg = JSON.parse(readFileSync(packageJsonPath, "utf8"));
|
|
132
|
+
pkg.optionalDependencies = { ...pkg.optionalDependencies, ...daemonOptionalDependencies(version) };
|
|
133
|
+
writeFileSync(packageJsonPath, JSON.stringify(pkg, null, 2) + "\n");
|
|
134
|
+
return pkg.optionalDependencies;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function parseArgs(argv) {
|
|
138
|
+
const valueOf = (flag, fallback) => {
|
|
139
|
+
const index = argv.indexOf(flag);
|
|
140
|
+
return index !== -1 && argv[index + 1] ? argv[index + 1] : fallback;
|
|
141
|
+
};
|
|
142
|
+
return {
|
|
143
|
+
artifacts: valueOf("--artifacts", "release-assets"),
|
|
144
|
+
staging: valueOf("--staging", STAGING_DIR),
|
|
145
|
+
distTag: valueOf("--dist-tag", null),
|
|
146
|
+
version: valueOf("--version", null),
|
|
147
|
+
pinRoot: argv.includes("--pin-root"),
|
|
148
|
+
dryRun: argv.includes("--dry-run"),
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* `npm publish`, with provenance when the registry will take it.
|
|
154
|
+
*
|
|
155
|
+
* Provenance needs a supported CI and a repository field npm can match to the
|
|
156
|
+
* building workflow; when it refuses, the publish itself is still correct, so
|
|
157
|
+
* this retries once without the flag rather than failing the release.
|
|
158
|
+
*/
|
|
159
|
+
function publishPackage(dir, distTag, dryRun) {
|
|
160
|
+
const args = ["publish", "--tag", distTag];
|
|
161
|
+
if (dryRun) args.push("--dry-run");
|
|
162
|
+
|
|
163
|
+
const attempt = (extra) =>
|
|
164
|
+
execFileSync("npm", [...args, ...extra], { cwd: dir, stdio: "pipe", encoding: "utf8" });
|
|
165
|
+
|
|
166
|
+
const withProvenance = !dryRun && process.env.GITHUB_ACTIONS === "true";
|
|
167
|
+
try {
|
|
168
|
+
return attempt(withProvenance ? ["--provenance"] : []);
|
|
169
|
+
} catch (err) {
|
|
170
|
+
const output = (err.stdout ?? "") + (err.stderr ?? "");
|
|
171
|
+
if (output.includes("cannot publish over")) return "[skip] already published at this version";
|
|
172
|
+
if (withProvenance && /provenance/i.test(output)) {
|
|
173
|
+
console.log("::warning::provenance was rejected — retrying the publish without it");
|
|
174
|
+
return attempt([]);
|
|
175
|
+
}
|
|
176
|
+
// Fatal on purpose: see the header. The root package pins these names, so
|
|
177
|
+
// a half-published set must stop the release rather than ship 404s.
|
|
178
|
+
throw new Error(`npm publish failed for ${dir}:\n${output.trim()}`);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export function main(argv = process.argv.slice(2)) {
|
|
183
|
+
const options = parseArgs(argv);
|
|
184
|
+
const rootPkg = JSON.parse(readFileSync(resolve(REPO_ROOT, "package.json"), "utf8"));
|
|
185
|
+
const version = options.version ?? rootPkg.version;
|
|
186
|
+
const distTag = options.distTag ?? (version.includes("-") ? "beta" : "latest");
|
|
187
|
+
const artifactsDir = resolve(process.cwd(), options.artifacts);
|
|
188
|
+
|
|
189
|
+
console.log(
|
|
190
|
+
`Publishing ${DAEMON_PLATFORMS.length} failproofaid platform packages at ${version} ` +
|
|
191
|
+
`(tag: ${distTag}${options.dryRun ? ", dry run" : ""}) from ${artifactsDir}`,
|
|
192
|
+
);
|
|
193
|
+
|
|
194
|
+
for (const platform of DAEMON_PLATFORMS) {
|
|
195
|
+
const dir = stagePlatformPackage(platform, version, rootPkg, artifactsDir, options.staging);
|
|
196
|
+
const name = daemonPackageName(platform.key);
|
|
197
|
+
console.log(`\n${name}@${version}`);
|
|
198
|
+
console.log(publishPackage(dir, distTag, options.dryRun).trim());
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
if (options.pinRoot) {
|
|
202
|
+
const pins = pinRootManifest(version);
|
|
203
|
+
console.log("\nPinned in the root manifest's optionalDependencies:");
|
|
204
|
+
console.log(JSON.stringify(pins, null, 2));
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
209
|
+
main();
|
|
210
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The platforms `failproofaid` is cross-compiled for, and the npm packages
|
|
3
|
+
* those binaries publish under.
|
|
4
|
+
*
|
|
5
|
+
* One list, three consumers: `build-daemon-packages.mjs` (publishes them),
|
|
6
|
+
* `publish-aliases.mjs` (pins them in every typo-squat stub), and the root
|
|
7
|
+
* package's injected `optionalDependencies`. They have to agree exactly — a
|
|
8
|
+
* name that appears in a dependency but never gets published is a 404 in
|
|
9
|
+
* every install, which is precisely how the first attempt at npm-shipping the
|
|
10
|
+
* daemon failed (see CHANGELOG 1.0.0-beta.3).
|
|
11
|
+
*
|
|
12
|
+
* `os` / `cpu` are npm's own filters, spelled in `process.platform` /
|
|
13
|
+
* `process.arch` values: with both set, npm and bun install only the package
|
|
14
|
+
* matching the machine and silently skip the other three.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
export const DAEMON_PLATFORMS = [
|
|
18
|
+
{ key: "linux-x64", os: "linux", cpu: "x64" },
|
|
19
|
+
{ key: "linux-arm64", os: "linux", cpu: "arm64" },
|
|
20
|
+
{ key: "darwin-x64", os: "darwin", cpu: "x64" },
|
|
21
|
+
{ key: "darwin-arm64", os: "darwin", cpu: "arm64" },
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
/** The npm package name carrying the binary for one platform key. */
|
|
25
|
+
export function daemonPackageName(key) {
|
|
26
|
+
return `@failproofai/failproofaid-${key}`;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** The release asset the binary for one platform key arrives in. */
|
|
30
|
+
export function daemonAssetName(key) {
|
|
31
|
+
return `failproofaid-${key}.gz`;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The `optionalDependencies` block that pins all four platform packages to one
|
|
36
|
+
* version — what the root package and every alias stub carry when published.
|
|
37
|
+
*/
|
|
38
|
+
export function daemonOptionalDependencies(version) {
|
|
39
|
+
return Object.fromEntries(
|
|
40
|
+
DAEMON_PLATFORMS.map((platform) => [daemonPackageName(platform.key), version]),
|
|
41
|
+
);
|
|
42
|
+
}
|
|
@@ -86,12 +86,19 @@ function getInstanceId() {
|
|
|
86
86
|
* fire from the CLI (see lib/install-check.ts) because package managers block
|
|
87
87
|
* install scripts by default.
|
|
88
88
|
*
|
|
89
|
+
* `opts.enabled` carries the resolved answer from lib/telemetry-enabled.ts. This
|
|
90
|
+
* file is a dependency-free .mjs so that it can run with no node_modules, which
|
|
91
|
+
* also means it cannot import the TOML config — so the caller, which can, passes
|
|
92
|
+
* the verdict in. Without it `[telemetry] enabled = false` would silence three
|
|
93
|
+
* dispatchers out of four and this one would keep reporting.
|
|
94
|
+
*
|
|
89
95
|
* @param {string} event
|
|
90
96
|
* @param {Record<string, unknown>} [properties]
|
|
91
|
-
* @param {{ version?: string, timeoutMs?: number }} [opts]
|
|
97
|
+
* @param {{ version?: string, timeoutMs?: number, enabled?: boolean }} [opts]
|
|
92
98
|
*/
|
|
93
99
|
export async function trackInstallEvent(event, properties = {}, opts = {}) {
|
|
94
100
|
if (process.env.FAILPROOFAI_TELEMETRY_DISABLED === "1") return;
|
|
101
|
+
if (opts.enabled === false) return;
|
|
95
102
|
|
|
96
103
|
const version = opts.version ?? process.env.npm_package_version ?? "unknown";
|
|
97
104
|
const body = JSON.stringify({
|
package/scripts/launch.ts
CHANGED
|
@@ -10,22 +10,40 @@ import { parseScriptArgs } from "./parse-script-args";
|
|
|
10
10
|
import { diagnoseShadow } from "./install-diagnosis.mjs";
|
|
11
11
|
import { makeSkewLogFilter } from "./skew-log-filter";
|
|
12
12
|
import { renderLaunchBanner } from "../src/hooks/tui";
|
|
13
|
+
import { isLoopbackHostname, resolveDashboardHost } from "../lib/dashboard-host";
|
|
13
14
|
import { version } from "../package.json";
|
|
14
15
|
|
|
15
16
|
export function launch(mode: "dev" | "start"): void {
|
|
16
|
-
const { loggingLevel, disableTelemetry, allowedDevOrigins, remainingArgs } = parseScriptArgs(process.argv.slice(2));
|
|
17
|
+
const { loggingLevel, disableTelemetry, allowedDevOrigins, host, remainingArgs } = parseScriptArgs(process.argv.slice(2));
|
|
17
18
|
|
|
18
19
|
// Branded splash — the same logomark + palette as the `configure` wizard, then
|
|
19
20
|
// a tidy version/links column. Falls back to plain text off a TTY.
|
|
20
21
|
for (const line of renderLaunchBanner(version)) console.log(line);
|
|
21
22
|
|
|
23
|
+
// The dashboard has no authentication and can toggle policies and uninstall
|
|
24
|
+
// hooks from every agent CLI, so it binds loopback unless someone asks
|
|
25
|
+
// otherwise. It used to bind 0.0.0.0 unconditionally, which handed all of
|
|
26
|
+
// that to every peer on the network.
|
|
27
|
+
const bindHost = resolveDashboardHost(host, process.env.FAILPROOFAI_DASHBOARD_HOST);
|
|
28
|
+
if (!isLoopbackHostname(bindHost)) {
|
|
29
|
+
console.warn(
|
|
30
|
+
`\n! Binding the dashboard to ${bindHost}, which is reachable from outside this machine.\n` +
|
|
31
|
+
` It has no authentication: anyone who can reach it can read your session\n` +
|
|
32
|
+
` transcripts, disable your policies, and uninstall failproofai's hooks.\n`,
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
// Read back by proxy.ts, which refuses any request whose Host is not one it
|
|
36
|
+
// should be answering to — the layer that stops DNS rebinding, which a
|
|
37
|
+
// loopback bind alone does not.
|
|
38
|
+
process.env.FAILPROOFAI_DASHBOARD_HOST = bindHost;
|
|
39
|
+
|
|
22
40
|
let cmd: string;
|
|
23
41
|
let cmdArgs: string[];
|
|
24
42
|
if (mode === "start") {
|
|
25
43
|
const portIdx = remainingArgs.indexOf("--port");
|
|
26
44
|
const port = portIdx >= 0 ? remainingArgs[portIdx + 1] : "8020";
|
|
27
45
|
process.env.PORT = port;
|
|
28
|
-
process.env.HOSTNAME =
|
|
46
|
+
process.env.HOSTNAME = bindHost;
|
|
29
47
|
cmd = "node";
|
|
30
48
|
// Resolve the real package root via realpathSync so symlinked npm global binaries
|
|
31
49
|
// don't cause import.meta.url to point at the symlink dir instead of the package dir.
|
|
@@ -74,7 +92,11 @@ export function launch(mode: "dev" | "start"): void {
|
|
|
74
92
|
cmdArgs = [serverJsPath];
|
|
75
93
|
} else {
|
|
76
94
|
cmd = "bunx";
|
|
77
|
-
|
|
95
|
+
// `next dev` with no -H listens on every interface too, so dev gets the same
|
|
96
|
+
// default. Skipped when the caller already passed one through, so an
|
|
97
|
+
// explicit -H in remainingArgs still wins.
|
|
98
|
+
const hasHostFlag = remainingArgs.some((a) => a === "-H" || a === "--hostname" || a.startsWith("--hostname="));
|
|
99
|
+
cmdArgs = ["--bun", "next", "dev", ...(hasHostFlag ? [] : ["-H", bindHost]), ...remainingArgs];
|
|
78
100
|
}
|
|
79
101
|
|
|
80
102
|
// In `start` (the shipped standalone server) we pipe + filter the child's
|
|
@@ -7,6 +7,13 @@ export interface ParsedScriptArgs {
|
|
|
7
7
|
loggingLevel: string | undefined;
|
|
8
8
|
disableTelemetry: boolean;
|
|
9
9
|
allowedDevOrigins: string[] | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Interface to bind the dashboard to. Undefined means the safe default
|
|
12
|
+
* (loopback) — see `resolveDashboardHost` in launch.ts. Only set this to a
|
|
13
|
+
* non-loopback address deliberately: the dashboard has no authentication and
|
|
14
|
+
* is a WRITE surface for this machine's security configuration.
|
|
15
|
+
*/
|
|
16
|
+
host: string | undefined;
|
|
10
17
|
remainingArgs: string[];
|
|
11
18
|
}
|
|
12
19
|
|
|
@@ -32,6 +39,7 @@ export function parseScriptArgs(argv: string[]): ParsedScriptArgs {
|
|
|
32
39
|
let loggingLevel: string | undefined;
|
|
33
40
|
let disableTelemetry = false;
|
|
34
41
|
let allowedDevOrigins: string[] | undefined;
|
|
42
|
+
let host: string | undefined;
|
|
35
43
|
|
|
36
44
|
for (let i = 0; i < args.length; i++) {
|
|
37
45
|
const arg = args[i];
|
|
@@ -71,7 +79,15 @@ export function parseScriptArgs(argv: string[]): ParsedScriptArgs {
|
|
|
71
79
|
i--;
|
|
72
80
|
continue;
|
|
73
81
|
}
|
|
82
|
+
|
|
83
|
+
if (flag === "--host") {
|
|
84
|
+
const { value, spliceCount } = parseStringFlag(flag, "an address to bind (e.g. 127.0.0.1)", inlineValue, args, i);
|
|
85
|
+
host = value;
|
|
86
|
+
args.splice(i, spliceCount);
|
|
87
|
+
i--;
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
74
90
|
}
|
|
75
91
|
|
|
76
|
-
return { loggingLevel, disableTelemetry, allowedDevOrigins, remainingArgs: args };
|
|
92
|
+
return { loggingLevel, disableTelemetry, allowedDevOrigins, host, remainingArgs: args };
|
|
77
93
|
}
|
|
@@ -101,6 +101,24 @@ const STANDALONE_ROOT_PRUNE = [
|
|
|
101
101
|
".claude", ".failproofai", ".github", ".vscode", ".idea",
|
|
102
102
|
// Failproofai CLI artifacts — the dashboard never loads these
|
|
103
103
|
"bin", "dist", "scripts", "src",
|
|
104
|
+
// Release-pipeline scratch: the daemon binaries downloaded from the build
|
|
105
|
+
// matrix and the staged platform packages. Both are written into the
|
|
106
|
+
// workspace only by a local/manual run (the publish workflow keeps them in
|
|
107
|
+
// RUNNER_TEMP precisely so this cannot happen), and 16 MB of `.gz` shipped
|
|
108
|
+
// inside the CLI tarball once already because nothing pruned them.
|
|
109
|
+
"release-assets", ".daemon-packages",
|
|
110
|
+
// The Rust workspace. `target/` is the big one: on any machine that has run
|
|
111
|
+
// `cargo build`, NFT traces it into the standalone output and it is FIFTEEN
|
|
112
|
+
// GIGABYTES of compiled artifacts — `npm pack` then hangs trying to tar it,
|
|
113
|
+
// which is how this was found. CI has not hit it because the Rust jobs build
|
|
114
|
+
// in a separate workspace, so nothing caught it; a contributor who builds the
|
|
115
|
+
// daemon and then the package hits it every time. The dashboard is a Next
|
|
116
|
+
// server — it never reads any of this.
|
|
117
|
+
"target", "crates",
|
|
118
|
+
// Test/dev trees NFT also over-traces. `integration-suite` is a harness, the
|
|
119
|
+
// plugin/extension dirs are shipped from the package root by `files`, not
|
|
120
|
+
// from inside the standalone bundle.
|
|
121
|
+
"integration-suite", "pi-extension", "openclaw-plugin", "docker-hook-sync",
|
|
104
122
|
];
|
|
105
123
|
const STANDALONE_ROOT_PRUNE_FILES = [
|
|
106
124
|
// Top-level markdown / licenses / docs
|
|
@@ -111,6 +129,14 @@ const STANDALONE_ROOT_PRUNE_FILES = [
|
|
|
111
129
|
"vitest.config.mts", "vitest.config.e2e.mts",
|
|
112
130
|
// Lockfiles
|
|
113
131
|
"bun.lock", "bun.lockb", "package-lock.json", "yarn.lock",
|
|
132
|
+
// Rust workspace manifests, siblings of the `target`/`crates` prune above.
|
|
133
|
+
"Cargo.toml", "Cargo.lock", "rust-toolchain.toml", "osv-scanner.toml",
|
|
134
|
+
// 11 MB README animation. Traced because it sits in the repo root and is
|
|
135
|
+
// referenced from README.md; the running dashboard never serves it.
|
|
136
|
+
"readme-arch-hq.gif",
|
|
137
|
+
// Incremental typechecker state — regenerated on every build, read by nothing
|
|
138
|
+
// at runtime, and routinely a few hundred KB.
|
|
139
|
+
"tsconfig.tsbuildinfo", "next-env.d.ts", "postcss.config.mjs",
|
|
114
140
|
];
|
|
115
141
|
for (const d of STANDALONE_ROOT_PRUNE) {
|
|
116
142
|
rmSync(join(STANDALONE, d), { recursive: true, force: true });
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import { execSync } from 'child_process';
|
|
3
3
|
import { readFileSync, writeFileSync, mkdirSync, rmSync, cpSync } from 'fs';
|
|
4
4
|
import { join, dirname } from 'path';
|
|
5
|
-
import { fileURLToPath } from 'url';
|
|
5
|
+
import { fileURLToPath, pathToFileURL } from 'url';
|
|
6
|
+
import { daemonOptionalDependencies } from './daemon-platforms.mjs';
|
|
6
7
|
|
|
7
8
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
9
|
const rootPkg = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf8'));
|
|
@@ -11,7 +12,7 @@ const DRY_RUN = process.argv.includes('--dry-run');
|
|
|
11
12
|
const distTagIdx = process.argv.indexOf('--dist-tag');
|
|
12
13
|
const DIST_TAG = distTagIdx !== -1 ? process.argv[distTagIdx + 1] : (VERSION.includes('-') ? 'beta' : 'latest');
|
|
13
14
|
|
|
14
|
-
const ALIASES = [
|
|
15
|
+
export const ALIASES = [
|
|
15
16
|
// Formatting variants — no "ai", or hyphen/underscore separators
|
|
16
17
|
'failproof',
|
|
17
18
|
'failproof-ai',
|
|
@@ -31,57 +32,77 @@ const ALIASES = [
|
|
|
31
32
|
'faliproofai',
|
|
32
33
|
];
|
|
33
34
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
/**
|
|
36
|
+
* The manifest one alias stub publishes.
|
|
37
|
+
*
|
|
38
|
+
* The four `@failproofai/failproofaid-<platform>` pins are the same ones the
|
|
39
|
+
* root package carries. They arrive transitively through the `failproofai`
|
|
40
|
+
* dependency anyway, but naming them here means someone who installs a typo'd
|
|
41
|
+
* name gets the daemon binary for exactly the reason the root package does,
|
|
42
|
+
* rather than by accident of resolution — and a test can assert it.
|
|
43
|
+
*/
|
|
44
|
+
export function aliasManifest(name, version = VERSION, pkg = rootPkg) {
|
|
45
|
+
return {
|
|
42
46
|
name,
|
|
43
|
-
version
|
|
47
|
+
version,
|
|
44
48
|
description: `Alias for failproofai — installs if you typed '${name}' instead of 'failproofai'`,
|
|
45
49
|
bin: { [name]: './bin/proxy.js' },
|
|
46
50
|
files: ['bin/'],
|
|
47
|
-
dependencies: { failproofai:
|
|
51
|
+
dependencies: { failproofai: version },
|
|
52
|
+
optionalDependencies: daemonOptionalDependencies(version),
|
|
48
53
|
publishConfig: { access: 'public' },
|
|
49
|
-
repository:
|
|
50
|
-
homepage:
|
|
51
|
-
bugs:
|
|
52
|
-
license:
|
|
54
|
+
repository: pkg.repository,
|
|
55
|
+
homepage: pkg.homepage,
|
|
56
|
+
bugs: pkg.bugs,
|
|
57
|
+
license: pkg.license,
|
|
53
58
|
};
|
|
59
|
+
}
|
|
54
60
|
|
|
55
|
-
|
|
56
|
-
|
|
61
|
+
export function main() {
|
|
62
|
+
const warnings = [];
|
|
57
63
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
64
|
+
for (const name of ALIASES) {
|
|
65
|
+
const tmpDir = join('/tmp', `npm-alias-${name}-${Date.now()}`);
|
|
66
|
+
const binDir = join(tmpDir, 'bin');
|
|
67
|
+
mkdirSync(binDir, { recursive: true });
|
|
68
|
+
|
|
69
|
+
const pkg = aliasManifest(name);
|
|
65
70
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
71
|
+
writeFileSync(join(tmpDir, 'package.json'), JSON.stringify(pkg, null, 2) + '\n');
|
|
72
|
+
cpSync(join(__dirname, 'alias-proxy.js'), join(binDir, 'proxy.js'));
|
|
73
|
+
|
|
74
|
+
if (DRY_RUN) {
|
|
75
|
+
console.log(`[dry-run] Would publish ${name}@${VERSION} (tag: ${DIST_TAG})`);
|
|
76
|
+
console.log(JSON.stringify(pkg, null, 2));
|
|
77
|
+
console.log('---');
|
|
78
|
+
rmSync(tmpDir, { recursive: true, force: true });
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
console.log(`Publishing ${name}@${VERSION}...`);
|
|
83
|
+
try {
|
|
84
|
+
execSync(`npm publish --tag ${DIST_TAG}`, { cwd: tmpDir, stdio: 'pipe' });
|
|
85
|
+
console.log(`Done: ${name}`);
|
|
86
|
+
} catch (err) {
|
|
87
|
+
const output = (err.stdout?.toString() ?? '') + (err.stderr?.toString() ?? '');
|
|
88
|
+
if (output.includes('too similar')) {
|
|
89
|
+
warnings.push(`${name}: blocked by npm similarity check — request via npm support`);
|
|
90
|
+
} else if (output.includes('cannot publish over')) {
|
|
91
|
+
console.log(`[skip] ${name}: already published at ${VERSION}`);
|
|
92
|
+
} else {
|
|
93
|
+
warnings.push(`${name}: ${output.trim().split('\n').find(l => l.includes('npm error')) ?? 'unknown error'}`);
|
|
94
|
+
}
|
|
78
95
|
}
|
|
96
|
+
|
|
97
|
+
rmSync(tmpDir, { recursive: true, force: true });
|
|
79
98
|
}
|
|
80
99
|
|
|
81
|
-
|
|
100
|
+
if (warnings.length > 0) {
|
|
101
|
+
console.log('\n::warning::Some alias packages were not published:');
|
|
102
|
+
for (const w of warnings) console.log(` - ${w}`);
|
|
103
|
+
}
|
|
82
104
|
}
|
|
83
105
|
|
|
84
|
-
if (
|
|
85
|
-
|
|
86
|
-
for (const w of warnings) console.log(` - ${w}`);
|
|
106
|
+
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
107
|
+
main();
|
|
87
108
|
}
|