failproofai 1.0.11 → 1.0.12-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/build-manifest.json +23 -23
- package/.next/standalone/.next/prerender-manifest.json +4 -4
- package/.next/standalone/.next/required-server-files.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page/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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 -3
- 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 +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- 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/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/api/audit/invite/route.js +5 -6
- 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 +9 -9
- 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 +2 -2
- 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 +4 -5
- 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 +6 -7
- 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 +6 -7
- 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 +5 -6
- 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 +2 -2
- 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 +4 -4
- 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 +3 -3
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- 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 +2 -2
- 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 +14 -14
- package/.next/standalone/.next/server/app/policies/page.js +3 -3
- package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page/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 +7 -7
- 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 +8 -8
- 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 +3 -3
- 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 +3 -3
- package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +8 -8
- package/.next/standalone/.next/server/app/settings/page.js +3 -3
- 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/{[externals]__0qkp92tjfvw8r._.js → [externals]__0-ha5ydqq0mws._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[externals]__1x24dzcbbq6-g._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__02vous7mpi2xm._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__03i5o4a840guz._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0__a_je8fsn65._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_hsnj_a2mvl_._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0l-oi4gdtmlo5._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0swiyzbmvja2d._.js → [root-of-the-server]__0t9ufnv5hi2hq._.js} +5 -5
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wg9dk8x8bnau._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__12kq3x-h7t7i1._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1a5zkndjwlc13._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__1r7kbfkiw2xmu._.js → [root-of-the-server]__1aaw59g-5uty7._.js} +12 -12
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1hqpg6vgmfexv._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__1izwqj_ij_9x_._.js → [root-of-the-server]__20xe05hm5u8_1._.js} +1 -1
- package/.next/standalone/.next/server/chunks/_09dz7xva4ce_2._.js +1 -1
- package/.next/standalone/.next/server/chunks/{_1ixl-kxq_ctsa._.js → _0kc-piux3hady._.js} +2 -2
- package/.next/standalone/.next/server/chunks/_0tovk6q0miud6._.js +1 -1
- package/.next/standalone/.next/server/chunks/_0trp3ycqv17cl._.js +1 -1
- package/.next/standalone/.next/server/chunks/_1vslkoe35wok6._.js +1 -1
- package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4vkpxxu7._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01j58mdcdw0vn._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__08ch3staq3ejw._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0_a8z2ldp2v3n._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0bigvy9xmv2ka._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ffu2-38y03ic._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0g8b0kyorya-t._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h86bl2qf0k_o._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0pia5h3p8re4c._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__075uro8t92s0_._.js → [root-of-the-server]__0pwj2h2efe5f-._.js} +3 -3
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0_lbstb5x2t15._.js → [root-of-the-server]__0ts0fg5yih1c1._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0zn1d4blhd3bu._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1-ey9fgesfbc0._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__15usvs-ms-0hf._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__16gb3_92zvk5x._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__17r4zrwanhp6r._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1avi2kypusyb_._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1lnfv02ucky7m._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1mc9-zlnh656_._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1r7drlqli-ado._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1s2-ck3k3rsoo._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1l1qgu5mfapkh._.js → [root-of-the-server]__1vx7o8ukefudh._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0eoura3_9gjb-._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0pedwblqdoh58._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1_ozgifqv1ssi._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1djqs9i27e4kg._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1gb0ifpkowwub._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0dc-of_bn0cim._.js → _1ve8y151ua7qx._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_next-internal_server_app_policies_page_actions_1sp2-yo5_vm5f.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/app_actions_get-scheduled-audit_ts_0ei9snixb5fd-._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_audit__components_audit-dashboard_tsx_0p9ud47q0xq5w._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_1kp6l3x33jqb6._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_19dqvpcz0uxur._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_settings_02tf1h47jmhhd._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_html-to-image_es_index_1f_ymmaonkksc.js → node_modules_html-to-image_es_index_00jxj8foxqz5t.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/package_json_[json]_cjs_013tntikdft59._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_pack-cli_ts_0t7me658zqmh_._.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +23 -23
- 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/preview-props.json +3 -3
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +23 -23
- package/.next/standalone/.next/static/chunks/{0frxv4_m-m2u5.js → 063al_q720fkj.js} +1 -1
- package/.next/standalone/.next/static/chunks/{16z6_d7sp61jm.js → 0a-ccsp3xmypz.js} +1 -1
- package/.next/standalone/.next/static/chunks/{302llgh97ce6w.js → 0pjxnp927y7_j.js} +1 -1
- package/.next/standalone/.next/static/chunks/{44a7k2_62qc-9.js → 13jv-xvabeb62.js} +2 -2
- package/.next/standalone/.next/static/chunks/2ank2u3apy8m6.js +1 -0
- package/.next/standalone/.next/static/chunks/2meqb9kygrncb.js +1 -0
- package/.next/standalone/.next/static/chunks/2ohktp_-lkv3x.js +1 -0
- package/.next/standalone/.next/static/chunks/2py0eldhwz8ay.js +1 -0
- package/.next/standalone/.next/static/chunks/{1_c0dc7zqj1n7.js → 2qz5piiir-qqm.js} +1 -1
- package/.next/standalone/.next/static/chunks/2tjfp9dirxnku.js +1 -0
- package/.next/standalone/.next/static/chunks/{37stoe-_yd852.js → 2znt1784j9gd9.js} +1 -1
- package/.next/standalone/.next/static/chunks/3tn1bzk094e8e.js +1 -0
- package/.next/standalone/fp-cloud-cli/uv.lock +6 -6
- package/.next/standalone/hermes-plugin/plugin.yaml +1 -1
- package/.next/standalone/node_modules/@next/env/package.json +1 -1
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/api/context.js +72 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/api/diag.js +84 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/api/metrics.js +50 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/api/propagation.js +80 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/api/trace.js +70 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/baggage/context-helpers.js +52 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/baggage/internal/baggage-impl.js +44 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/baggage/internal/symbol.js +12 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/baggage/utils.js +41 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/context/NoopContextManager.js +27 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/context/context.js +52 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/context-api.js +16 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/diag/ComponentLogger.js +47 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/diag/consoleLogger.js +73 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/diag/internal/logLevelLogger.js +34 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/diag/types.js +33 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/diag-api.js +20 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/index.js +71 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/internal/global-utils.js +60 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/internal/semver.js +111 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/metrics/Metric.js +18 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/metrics/NoopMeter.js +118 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/metrics/NoopMeterProvider.js +20 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/metrics-api.js +17 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/propagation/NoopTextMapPropagator.js +23 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/propagation/TextMapPropagator.js +36 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/propagation-api.js +17 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/trace/NonRecordingSpan.js +58 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/trace/NoopTracer.js +68 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/trace/NoopTracerProvider.js +21 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/trace/ProxyTracer.js +46 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/trace/ProxyTracerProvider.js +46 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/trace/SamplingResult.js +33 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/trace/context-utils.js +71 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/trace/internal/tracestate-impl.js +94 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/trace/internal/tracestate-validators.js +35 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/trace/internal/utils.js +16 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/trace/invalid-span-constants.js +25 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/trace/span_kind.js +38 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/trace/spancontext-utils.js +66 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/trace/status.js +29 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/trace/trace_flags.js +18 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/trace-api.js +17 -0
- package/.next/standalone/node_modules/@opentelemetry/api/build/src/version.js +10 -0
- package/.next/standalone/node_modules/@opentelemetry/api/package.json +96 -0
- package/.next/standalone/node_modules/next/dist/build/swc/index.js +1 -1
- package/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo-experimental.runtime.prod.js +2 -2
- package/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.prod.js +2 -2
- package/.next/standalone/node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js +1 -1
- package/.next/standalone/node_modules/next/dist/lib/patch-incorrect-lockfile.js +3 -3
- package/.next/standalone/node_modules/next/dist/server/app-render/async-local-storage.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/config.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-turbopack.js +2 -2
- package/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/lib/app-info-log.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/lib/generate-agent-files.js +3 -3
- package/.next/standalone/node_modules/next/dist/server/lib/router-server.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/lib/start-server.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/lib/trace/tracer.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/typescript/rules/config.js +2 -2
- package/.next/standalone/node_modules/next/dist/server/use-cache/use-cache-wrapper.js +1 -1
- package/.next/standalone/node_modules/next/dist/telemetry/anonymous-meta.js +1 -1
- package/.next/standalone/node_modules/next/dist/telemetry/events/swc-load-failure.js +1 -1
- package/.next/standalone/node_modules/next/dist/telemetry/events/version.js +2 -2
- package/.next/standalone/node_modules/next/package.json +11 -11
- package/.next/standalone/package.json +11 -11
- package/.next/standalone/sdk/python/CHANGELOG.md +7 -0
- package/.next/standalone/sdk/python/failproofai_sdk/_version.py +1 -1
- package/.next/standalone/sdk/python/pyproject.toml +19 -0
- package/.next/standalone/sdk/python/uv.lock +520 -301
- package/.next/standalone/sdk/typescript/CHANGELOG.md +13 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/mastra-1/package-lock.json +4 -13
- package/.next/standalone/sdk/typescript/integration/fixtures/mastra-1/package.json +2 -1
- package/.next/standalone/sdk/typescript/integration/fixtures/nextjs/package-lock.json +4 -13
- package/.next/standalone/sdk/typescript/integration/fixtures/nextjs/package.json +3 -0
- package/.next/standalone/sdk/typescript/package-lock.json +178 -162
- package/.next/standalone/sdk/typescript/package.json +1 -1
- package/.next/standalone/sdk/typescript/src/version.ts +1 -1
- package/.next/standalone/server.js +1 -1
- package/dist/cli.mjs +638 -79
- package/dist/worker.mjs +1 -1
- package/hermes-plugin/plugin.yaml +1 -1
- package/package.json +11 -11
- package/src/audit/open-browser.ts +19 -1
- package/src/hooks/cloud-introspect.ts +5 -2
- package/src/hooks/cloud-login.ts +245 -0
- package/src/hooks/configure-wizard.ts +311 -15
- package/src/hooks/tui.ts +271 -0
- package/.next/standalone/.next/server/chunks/[externals]__0hjaw70fchx66._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__07l68zv0hqdiu._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0car70pylmvor._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0u3i025_setk_._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__10a2f6s636yc7._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1qt5u58xrcuk6._.js +0 -3
- package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_077n_4ip5__fu._.js +0 -3
- package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_0mqvvxcn6v0op._.js +0 -3
- package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_0pb7ds5g0vzgn._.js +0 -3
- package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_1gasm5xkeqmm3._.js +0 -3
- package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_1q1heqmkhh8l4._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0888k4s6spfmh._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0_bflu046ep5j._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0fdwgktjfhedo._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0s4deza787asx._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__18qe-hu0gwqm4._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1_p_9xe520fex._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1fmhm8_s9i4re._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1g76awtnmimd1._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1pczevlpk5lxh._.js +0 -3
- package/.next/standalone/.next/static/chunks/0m-tv1y6ghhtk.js +0 -1
- package/.next/standalone/.next/static/chunks/0ol2gj4ntfn56.js +0 -1
- package/.next/standalone/.next/static/chunks/15rm15u5a6dua.js +0 -1
- package/.next/standalone/.next/static/chunks/1kwj8uqxuv85t.js +0 -1
- package/.next/standalone/.next/static/chunks/3hj5_7i3nw4zj.js +0 -1
- package/.next/standalone/.next/static/chunks/3iyoapeoq_hup.js +0 -1
- /package/.next/standalone/.next/static/{kEFP3ybXwZdriNEQmWwlH → SNr7o_-G4kNBQTR-iLZMM}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{kEFP3ybXwZdriNEQmWwlH → SNr7o_-G4kNBQTR-iLZMM}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{kEFP3ybXwZdriNEQmWwlH → SNr7o_-G4kNBQTR-iLZMM}/_ssgManifest.js +0 -0
package/dist/cli.mjs
CHANGED
|
@@ -29,7 +29,7 @@ var __esm = (fn, res, err) => () => {
|
|
|
29
29
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
30
30
|
|
|
31
31
|
// package.json
|
|
32
|
-
var version2 = "1.0.
|
|
32
|
+
var version2 = "1.0.12-beta.0", package_default;
|
|
33
33
|
var init_package = __esm(() => {
|
|
34
34
|
package_default = {
|
|
35
35
|
name: "failproofai",
|
|
@@ -114,7 +114,7 @@ var init_package = __esm(() => {
|
|
|
114
114
|
access: "public"
|
|
115
115
|
},
|
|
116
116
|
devDependencies: {
|
|
117
|
-
"@anthropic-ai/sdk": "^0.
|
|
117
|
+
"@anthropic-ai/sdk": "^0.135.0",
|
|
118
118
|
"@mdx-js/mdx": "^3.1.1",
|
|
119
119
|
"@tailwindcss/postcss": "^4.3.1",
|
|
120
120
|
"@tanstack/react-virtual": "^3.14.10",
|
|
@@ -150,7 +150,7 @@ var init_package = __esm(() => {
|
|
|
150
150
|
nanoid: "3.3.18",
|
|
151
151
|
postcss: "8.5.26",
|
|
152
152
|
"eslint-plugin-react-hooks": "7.0.1",
|
|
153
|
-
vite: "8.
|
|
153
|
+
vite: "8.1.6",
|
|
154
154
|
undici: "7.29.1",
|
|
155
155
|
"brace-expansion": "5.0.12",
|
|
156
156
|
sharp: "0.35.5",
|
|
@@ -158,16 +158,16 @@ var init_package = __esm(() => {
|
|
|
158
158
|
browserslist: "4.28.8"
|
|
159
159
|
},
|
|
160
160
|
optionalDependencies: {
|
|
161
|
-
"@failproofai/failproofaid-linux-x64": "1.0.
|
|
162
|
-
"@failproofai/failproofaid-linux-arm64": "1.0.
|
|
163
|
-
"@failproofai/failproofaid-darwin-x64": "1.0.
|
|
164
|
-
"@failproofai/failproofaid-darwin-arm64": "1.0.
|
|
161
|
+
"@failproofai/failproofaid-linux-x64": "1.0.12-beta.0",
|
|
162
|
+
"@failproofai/failproofaid-linux-arm64": "1.0.12-beta.0",
|
|
163
|
+
"@failproofai/failproofaid-darwin-x64": "1.0.12-beta.0",
|
|
164
|
+
"@failproofai/failproofaid-darwin-arm64": "1.0.12-beta.0"
|
|
165
165
|
},
|
|
166
166
|
failproofaidBinaries: {
|
|
167
|
-
"linux-x64": "
|
|
168
|
-
"linux-arm64": "
|
|
169
|
-
"darwin-x64": "
|
|
170
|
-
"darwin-arm64": "
|
|
167
|
+
"linux-x64": "61710dd6261ff0deb1116e390c366c26809bf04bb2e2c16f279b7d79e1819049",
|
|
168
|
+
"linux-arm64": "5e9501522d35b32790664b4f3b1b90aa1728629f5013df94e72c2e2a11842bd2",
|
|
169
|
+
"darwin-x64": "e9d195cf30b6bc2427b7cbe89e354cc8dab7ae02e7c45a7e44a941eda84c2674",
|
|
170
|
+
"darwin-arm64": "d70ae3a3b8073ace0852a20671dba3d32f380b97ed4a01f5791a13d2fa12e63b"
|
|
171
171
|
}
|
|
172
172
|
};
|
|
173
173
|
});
|
|
@@ -20171,6 +20171,199 @@ function promptCloudKey(opts) {
|
|
|
20171
20171
|
});
|
|
20172
20172
|
});
|
|
20173
20173
|
}
|
|
20174
|
+
function slowedDown(interval) {
|
|
20175
|
+
return Math.max(interval, Math.min(10, interval + 2));
|
|
20176
|
+
}
|
|
20177
|
+
function promptBrowserLogin(opts) {
|
|
20178
|
+
const stdin = opts.stdin ?? process.stdin;
|
|
20179
|
+
const stdout = opts.stdout ?? process.stdout;
|
|
20180
|
+
if (!stdin.isTTY || !stdout.isTTY)
|
|
20181
|
+
return Promise.resolve(null);
|
|
20182
|
+
const now = opts.now ?? Date.now;
|
|
20183
|
+
const c = paint(colorsEnabled(stdout));
|
|
20184
|
+
const kit = screenKit({ cols: stdout.columns || 80, color: colorsEnabled(stdout) });
|
|
20185
|
+
const spinnerFrames = "⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏";
|
|
20186
|
+
const region = { lastCount: 0 };
|
|
20187
|
+
let phase = "starting";
|
|
20188
|
+
let failLine = "";
|
|
20189
|
+
let cautionLine = "";
|
|
20190
|
+
let expiresAt = 0;
|
|
20191
|
+
let interval = 2;
|
|
20192
|
+
let frame = 0;
|
|
20193
|
+
let settled = false;
|
|
20194
|
+
let headingShown = false;
|
|
20195
|
+
const above = [];
|
|
20196
|
+
let pollTimer = null;
|
|
20197
|
+
let spinTimer = null;
|
|
20198
|
+
let attempt = 0;
|
|
20199
|
+
const countdown = () => {
|
|
20200
|
+
const left = Math.max(0, Math.ceil((expiresAt - now()) / 1000));
|
|
20201
|
+
return `${Math.floor(left / 60)}:${String(left % 60).padStart(2, "0")}`;
|
|
20202
|
+
};
|
|
20203
|
+
const build = () => {
|
|
20204
|
+
const spin = c.ink3(spinnerFrames[frame % spinnerFrames.length]);
|
|
20205
|
+
switch (phase) {
|
|
20206
|
+
case "starting":
|
|
20207
|
+
return [`${INDENT}${spin} Getting a link…`];
|
|
20208
|
+
case "waiting":
|
|
20209
|
+
return [
|
|
20210
|
+
`${INDENT}${spin} Waiting for you to authorize in the browser ${c.ink3(`· expires in ${countdown()}`)}`,
|
|
20211
|
+
...cautionLine ? [kit.caution(cautionLine)] : [],
|
|
20212
|
+
"",
|
|
20213
|
+
kit.keys(["tab more options", "ctrl-c cancel"])
|
|
20214
|
+
];
|
|
20215
|
+
case "expired":
|
|
20216
|
+
return [kit.fail("That link expired."), "", kit.keys(["enter new link", "tab more options"])];
|
|
20217
|
+
case "denied":
|
|
20218
|
+
return [kit.fail("Not authorized in the browser."), "", kit.keys(["enter try again", "tab more options"])];
|
|
20219
|
+
case "failed":
|
|
20220
|
+
return [kit.fail(failLine), "", kit.keys(["enter try again", "tab more options"])];
|
|
20221
|
+
}
|
|
20222
|
+
};
|
|
20223
|
+
const draw = () => {
|
|
20224
|
+
if (settled)
|
|
20225
|
+
return;
|
|
20226
|
+
repaint(stdout, region, headingShown ? build() : [promptHeading(c, opts.message, opts.meta), ...build()]);
|
|
20227
|
+
};
|
|
20228
|
+
const printAbove = (lines) => {
|
|
20229
|
+
const clear = region.lastCount > 0 ? `${ESC}[${region.lastCount}A${ESC}[J` : "";
|
|
20230
|
+
stdout.write(`${clear}${lines.join(`
|
|
20231
|
+
`)}
|
|
20232
|
+
`);
|
|
20233
|
+
region.lastCount = 0;
|
|
20234
|
+
above.push(...lines);
|
|
20235
|
+
};
|
|
20236
|
+
const clearPoll = () => {
|
|
20237
|
+
if (pollTimer)
|
|
20238
|
+
clearTimeout(pollTimer);
|
|
20239
|
+
pollTimer = null;
|
|
20240
|
+
};
|
|
20241
|
+
const restoreTerminal = () => showCursor(stdout);
|
|
20242
|
+
return new Promise((resolve) => {
|
|
20243
|
+
const wasRaw = stdin.isRaw;
|
|
20244
|
+
const finish = (answer) => {
|
|
20245
|
+
if (settled)
|
|
20246
|
+
return;
|
|
20247
|
+
clearPoll();
|
|
20248
|
+
if (spinTimer)
|
|
20249
|
+
clearInterval(spinTimer);
|
|
20250
|
+
stdin.removeListener("keypress", onKey);
|
|
20251
|
+
stdin.setRawMode?.(wasRaw ?? false);
|
|
20252
|
+
stdin.pause();
|
|
20253
|
+
process.removeListener("exit", restoreTerminal);
|
|
20254
|
+
if (answer === BACK) {
|
|
20255
|
+
const cols = stdout.columns || 80;
|
|
20256
|
+
for (const line of above)
|
|
20257
|
+
region.lastCount += Math.max(1, Math.ceil(visibleWidth(line) / cols));
|
|
20258
|
+
}
|
|
20259
|
+
const lines = answer === null ? [c.ink3("cancelled")] : answer === BACK ? [] : opts.collapsed(answer.value);
|
|
20260
|
+
repaint(stdout, region, lines, { cut: false });
|
|
20261
|
+
settled = true;
|
|
20262
|
+
restoreTerminal();
|
|
20263
|
+
resolve(answer);
|
|
20264
|
+
};
|
|
20265
|
+
const schedulePoll = (forAttempt) => {
|
|
20266
|
+
clearPoll();
|
|
20267
|
+
pollTimer = setTimeout(() => void pollOnce(forAttempt), interval * 1000);
|
|
20268
|
+
};
|
|
20269
|
+
const pollOnce = async (forAttempt) => {
|
|
20270
|
+
let answer;
|
|
20271
|
+
try {
|
|
20272
|
+
answer = await opts.poll();
|
|
20273
|
+
} catch (err) {
|
|
20274
|
+
answer = { state: "unreachable", line: err instanceof Error ? err.message : String(err) };
|
|
20275
|
+
}
|
|
20276
|
+
if (settled || forAttempt !== attempt)
|
|
20277
|
+
return;
|
|
20278
|
+
switch (answer.state) {
|
|
20279
|
+
case "approved":
|
|
20280
|
+
return finish({ value: answer.value });
|
|
20281
|
+
case "denied":
|
|
20282
|
+
phase = "denied";
|
|
20283
|
+
return draw();
|
|
20284
|
+
case "expired":
|
|
20285
|
+
phase = "expired";
|
|
20286
|
+
return draw();
|
|
20287
|
+
case "slow_down":
|
|
20288
|
+
interval = slowedDown(interval);
|
|
20289
|
+
break;
|
|
20290
|
+
case "unreachable":
|
|
20291
|
+
cautionLine = `Can't reach the server right now (${answer.line}) — still trying.`;
|
|
20292
|
+
break;
|
|
20293
|
+
case "pending":
|
|
20294
|
+
cautionLine = "";
|
|
20295
|
+
if (answer.interval && answer.interval > 0)
|
|
20296
|
+
interval = answer.interval;
|
|
20297
|
+
break;
|
|
20298
|
+
}
|
|
20299
|
+
if (now() > expiresAt + interval * 1000) {
|
|
20300
|
+
phase = "expired";
|
|
20301
|
+
return draw();
|
|
20302
|
+
}
|
|
20303
|
+
draw();
|
|
20304
|
+
schedulePoll(forAttempt);
|
|
20305
|
+
};
|
|
20306
|
+
const begin = async () => {
|
|
20307
|
+
const mine = ++attempt;
|
|
20308
|
+
clearPoll();
|
|
20309
|
+
cautionLine = "";
|
|
20310
|
+
phase = "starting";
|
|
20311
|
+
draw();
|
|
20312
|
+
let started;
|
|
20313
|
+
try {
|
|
20314
|
+
started = await opts.start();
|
|
20315
|
+
} catch (err) {
|
|
20316
|
+
started = { ok: false, line: err instanceof Error ? err.message : String(err), retryable: true };
|
|
20317
|
+
}
|
|
20318
|
+
if (settled || mine !== attempt)
|
|
20319
|
+
return;
|
|
20320
|
+
if (!started.ok) {
|
|
20321
|
+
if (!started.retryable)
|
|
20322
|
+
return finish(BACK);
|
|
20323
|
+
phase = "failed";
|
|
20324
|
+
failLine = started.line;
|
|
20325
|
+
return draw();
|
|
20326
|
+
}
|
|
20327
|
+
expiresAt = now() + started.expiresIn * 1000;
|
|
20328
|
+
interval = started.interval > 0 ? started.interval : 2;
|
|
20329
|
+
const opened = opts.open(started.url);
|
|
20330
|
+
printAbove([
|
|
20331
|
+
...headingShown ? [] : [promptHeading(c, opts.message, opts.meta)],
|
|
20332
|
+
opened ? `${INDENT}Opening your browser to connect ${opts.machineLabel}. If it doesn't open, use this link:` : `${INDENT}Open this link in any browser to connect ${opts.machineLabel}:`,
|
|
20333
|
+
`${INDENT}${c.bold(started.url)}`,
|
|
20334
|
+
""
|
|
20335
|
+
]);
|
|
20336
|
+
headingShown = true;
|
|
20337
|
+
phase = "waiting";
|
|
20338
|
+
draw();
|
|
20339
|
+
schedulePoll(mine);
|
|
20340
|
+
};
|
|
20341
|
+
function onKey(_str, key) {
|
|
20342
|
+
if (!key || settled)
|
|
20343
|
+
return;
|
|
20344
|
+
if (key.ctrl && (key.name === "c" || key.name === "d"))
|
|
20345
|
+
return finish(null);
|
|
20346
|
+
if (key.name === "escape" || key.name === "tab")
|
|
20347
|
+
return finish(BACK);
|
|
20348
|
+
if ((key.name === "return" || key.name === "enter") && phase !== "waiting" && phase !== "starting") {
|
|
20349
|
+
begin();
|
|
20350
|
+
}
|
|
20351
|
+
}
|
|
20352
|
+
process.once("exit", restoreTerminal);
|
|
20353
|
+
readline.emitKeypressEvents(stdin);
|
|
20354
|
+
stdin.setRawMode?.(true);
|
|
20355
|
+
stdin.resume();
|
|
20356
|
+
hideCursor(stdout);
|
|
20357
|
+
stdin.on("keypress", onKey);
|
|
20358
|
+
spinTimer = setInterval(() => {
|
|
20359
|
+
frame++;
|
|
20360
|
+
if (phase === "waiting" || phase === "starting")
|
|
20361
|
+
draw();
|
|
20362
|
+
}, 120);
|
|
20363
|
+
spinTimer.unref?.();
|
|
20364
|
+
begin();
|
|
20365
|
+
});
|
|
20366
|
+
}
|
|
20174
20367
|
function ctx(opts) {
|
|
20175
20368
|
return { cols: Math.max(20, opts?.cols ?? 80), c: paint(opts?.color ?? false) };
|
|
20176
20369
|
}
|
|
@@ -33272,6 +33465,195 @@ var init_first_run_gate = __esm(() => {
|
|
|
33272
33465
|
];
|
|
33273
33466
|
});
|
|
33274
33467
|
|
|
33468
|
+
// src/hooks/cloud-login.ts
|
|
33469
|
+
async function postJson2(origin, path, body, fetchImpl) {
|
|
33470
|
+
const controller = new AbortController;
|
|
33471
|
+
const timer = setTimeout(() => controller.abort(), TIMEOUT_MS);
|
|
33472
|
+
try {
|
|
33473
|
+
const res = await fetchImpl(`${origin.replace(/\/+$/, "")}${path}`, {
|
|
33474
|
+
method: "POST",
|
|
33475
|
+
headers: { "Content-Type": "application/json" },
|
|
33476
|
+
body: JSON.stringify(body),
|
|
33477
|
+
redirect: "manual",
|
|
33478
|
+
signal: controller.signal
|
|
33479
|
+
});
|
|
33480
|
+
let json = null;
|
|
33481
|
+
try {
|
|
33482
|
+
const parsed = await res.json();
|
|
33483
|
+
json = parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : null;
|
|
33484
|
+
} catch {
|
|
33485
|
+
json = null;
|
|
33486
|
+
}
|
|
33487
|
+
return { status: res.status, json };
|
|
33488
|
+
} catch (err) {
|
|
33489
|
+
return { error: err instanceof Error ? err.name === "AbortError" ? "timed out" : err.message : String(err) };
|
|
33490
|
+
} finally {
|
|
33491
|
+
clearTimeout(timer);
|
|
33492
|
+
}
|
|
33493
|
+
}
|
|
33494
|
+
function displayText(v, max = 200) {
|
|
33495
|
+
if (typeof v !== "string")
|
|
33496
|
+
return;
|
|
33497
|
+
const t = v.replace(INVISIBLE, "").trim().slice(0, max);
|
|
33498
|
+
return t.length > 0 ? t : undefined;
|
|
33499
|
+
}
|
|
33500
|
+
function org(v) {
|
|
33501
|
+
const o = v && typeof v === "object" ? v : {};
|
|
33502
|
+
return { id: str3(o.id), slug: displayText(o.slug), name: displayText(o.name) };
|
|
33503
|
+
}
|
|
33504
|
+
function permissions(v) {
|
|
33505
|
+
return Array.isArray(v) ? v.map((p) => displayText(p, 64)).filter((p) => p !== undefined) : [];
|
|
33506
|
+
}
|
|
33507
|
+
function isOpenableUrl(raw) {
|
|
33508
|
+
try {
|
|
33509
|
+
const u = new URL(raw);
|
|
33510
|
+
return u.protocol === "https:" || u.protocol === "http:";
|
|
33511
|
+
} catch {
|
|
33512
|
+
return false;
|
|
33513
|
+
}
|
|
33514
|
+
}
|
|
33515
|
+
function machineOs(platform = process.platform) {
|
|
33516
|
+
return platform === "darwin" ? "macOS" : platform === "win32" ? "windows" : platform;
|
|
33517
|
+
}
|
|
33518
|
+
async function startLogin(origin, machine, fetchImpl = fetch) {
|
|
33519
|
+
const r = await postJson2(origin, LOGIN_START_PATH, { machine_label: machine.label, machine_os: machine.os, cli_version: machine.cliVersion }, fetchImpl);
|
|
33520
|
+
if ("error" in r)
|
|
33521
|
+
return { kind: "unreachable", reason: r.error };
|
|
33522
|
+
if (r.status === 404 || r.status >= 300 && r.status < 400)
|
|
33523
|
+
return { kind: "unsupported" };
|
|
33524
|
+
if (r.status === 429)
|
|
33525
|
+
return { kind: "refused", reason: "too many login attempts from here — wait a minute" };
|
|
33526
|
+
if (r.status !== 201 || !r.json) {
|
|
33527
|
+
return r.status >= 500 ? { kind: "unreachable", reason: `the server answered ${r.status}` } : { kind: "refused", reason: displayText(r.json?.error, 120) ?? `the server answered ${r.status}` };
|
|
33528
|
+
}
|
|
33529
|
+
const verificationUrl = str3(r.json.verification_url);
|
|
33530
|
+
const pollSecret = str3(r.json.poll_secret);
|
|
33531
|
+
if (!verificationUrl || !pollSecret || !isOpenableUrl(verificationUrl)) {
|
|
33532
|
+
return { kind: "unsupported" };
|
|
33533
|
+
}
|
|
33534
|
+
return {
|
|
33535
|
+
kind: "ok",
|
|
33536
|
+
verificationUrl: new URL(verificationUrl).href,
|
|
33537
|
+
pollSecret,
|
|
33538
|
+
expiresIn: within(r.json.expires_in, 30, 3600, 600),
|
|
33539
|
+
interval: within(r.json.interval, 1, 30, 2)
|
|
33540
|
+
};
|
|
33541
|
+
}
|
|
33542
|
+
async function pollLogin(origin, pollSecret, fetchImpl = fetch) {
|
|
33543
|
+
const r = await postJson2(origin, LOGIN_POLL_PATH, { poll_secret: pollSecret }, fetchImpl);
|
|
33544
|
+
if ("error" in r)
|
|
33545
|
+
return { kind: "unreachable", reason: r.error };
|
|
33546
|
+
if (r.status === 404)
|
|
33547
|
+
return { kind: "unknown" };
|
|
33548
|
+
if (r.status !== 200 || !r.json)
|
|
33549
|
+
return { kind: "unreachable", reason: `the server answered ${r.status}` };
|
|
33550
|
+
const j = r.json;
|
|
33551
|
+
switch (j.status) {
|
|
33552
|
+
case "pending":
|
|
33553
|
+
return { kind: "pending", interval: typeof j.interval === "number" ? within(j.interval, 1, 30, 2) : undefined };
|
|
33554
|
+
case "slow_down":
|
|
33555
|
+
return { kind: "slow_down" };
|
|
33556
|
+
case "approved":
|
|
33557
|
+
return {
|
|
33558
|
+
kind: "approved",
|
|
33559
|
+
org: org(j.org),
|
|
33560
|
+
approvedBy: displayText(j.approved_by),
|
|
33561
|
+
keyName: displayText(j.key_name),
|
|
33562
|
+
permissions: permissions(j.permissions)
|
|
33563
|
+
};
|
|
33564
|
+
case "denied":
|
|
33565
|
+
return { kind: "denied" };
|
|
33566
|
+
case "expired":
|
|
33567
|
+
return { kind: "expired" };
|
|
33568
|
+
case "claimed":
|
|
33569
|
+
return { kind: "claimed" };
|
|
33570
|
+
default:
|
|
33571
|
+
return { kind: "unknown" };
|
|
33572
|
+
}
|
|
33573
|
+
}
|
|
33574
|
+
async function claimLogin(origin, pollSecret, fetchImpl = fetch) {
|
|
33575
|
+
const r = await postJson2(origin, LOGIN_CLAIM_PATH, { poll_secret: pollSecret }, fetchImpl);
|
|
33576
|
+
if ("error" in r)
|
|
33577
|
+
return { kind: "unreachable", reason: r.error };
|
|
33578
|
+
const j = r.json ?? {};
|
|
33579
|
+
if (r.status === 201) {
|
|
33580
|
+
const key = str3(j.api_key);
|
|
33581
|
+
if (!key)
|
|
33582
|
+
return { kind: "refused", reason: "the server answered without a key" };
|
|
33583
|
+
return {
|
|
33584
|
+
kind: "ok",
|
|
33585
|
+
key,
|
|
33586
|
+
keyId: str3(j.key_id),
|
|
33587
|
+
keyName: displayText(j.key_name),
|
|
33588
|
+
org: org(j.org),
|
|
33589
|
+
permissions: permissions(j.permissions),
|
|
33590
|
+
approvedBy: displayText(j.approved_by)
|
|
33591
|
+
};
|
|
33592
|
+
}
|
|
33593
|
+
if (r.status === 410)
|
|
33594
|
+
return { kind: "expired" };
|
|
33595
|
+
if (r.status === 403 && j.error === "approval_revoked")
|
|
33596
|
+
return { kind: "revoked" };
|
|
33597
|
+
if (r.status >= 500)
|
|
33598
|
+
return { kind: "unreachable", reason: `the server answered ${r.status}` };
|
|
33599
|
+
return {
|
|
33600
|
+
kind: "refused",
|
|
33601
|
+
reason: displayText(j.status, 40) ? `the login request is ${displayText(j.status, 40)}` : `the server answered ${r.status}`
|
|
33602
|
+
};
|
|
33603
|
+
}
|
|
33604
|
+
var LOGIN_START_PATH = "/api/auth/cli/start", LOGIN_POLL_PATH = "/api/auth/cli/poll", LOGIN_CLAIM_PATH = "/api/auth/cli/claim", TIMEOUT_MS = 1e4, str3 = (v) => typeof v === "string" && v.length > 0 ? v : undefined, INVISIBLE, within = (v, lo, hi, fallback) => typeof v === "number" && Number.isFinite(v) && v > 0 ? Math.min(hi, Math.max(lo, v)) : fallback;
|
|
33605
|
+
var init_cloud_login = __esm(() => {
|
|
33606
|
+
INVISIBLE = /[\u0000-\u001f\u007f-\u009f\u061c\u180e\u200b-\u200f\u202a-\u202e\u2060-\u2069\ufeff]/g;
|
|
33607
|
+
});
|
|
33608
|
+
|
|
33609
|
+
// src/audit/open-browser.ts
|
|
33610
|
+
import { spawn } from "node:child_process";
|
|
33611
|
+
function canOpenBrowser(env = process.env, platform = process.platform) {
|
|
33612
|
+
if (env.SSH_CONNECTION || env.SSH_CLIENT || env.SSH_TTY)
|
|
33613
|
+
return false;
|
|
33614
|
+
if (platform === "linux" && !env.DISPLAY && !env.WAYLAND_DISPLAY)
|
|
33615
|
+
return false;
|
|
33616
|
+
return true;
|
|
33617
|
+
}
|
|
33618
|
+
function openUrl(url) {
|
|
33619
|
+
let cmd;
|
|
33620
|
+
let args;
|
|
33621
|
+
if (process.platform === "darwin") {
|
|
33622
|
+
cmd = "open";
|
|
33623
|
+
args = [url];
|
|
33624
|
+
} else if (process.platform === "win32") {
|
|
33625
|
+
cmd = "cmd";
|
|
33626
|
+
args = ["/c", "start", "", url];
|
|
33627
|
+
} else {
|
|
33628
|
+
cmd = "xdg-open";
|
|
33629
|
+
args = [url];
|
|
33630
|
+
}
|
|
33631
|
+
try {
|
|
33632
|
+
const child = spawn(cmd, args, { stdio: "ignore", detached: true });
|
|
33633
|
+
child.on("error", () => {});
|
|
33634
|
+
child.unref();
|
|
33635
|
+
} catch {}
|
|
33636
|
+
}
|
|
33637
|
+
function openWhenReady(port, path) {
|
|
33638
|
+
const base = `http://localhost:${port}`;
|
|
33639
|
+
const target = `${base}${path}`;
|
|
33640
|
+
(async () => {
|
|
33641
|
+
const deadline = Date.now() + POLL_TIMEOUT_MS;
|
|
33642
|
+
while (Date.now() < deadline) {
|
|
33643
|
+
try {
|
|
33644
|
+
await fetch(base, { method: "GET", redirect: "manual" });
|
|
33645
|
+
openUrl(target);
|
|
33646
|
+
return;
|
|
33647
|
+
} catch {
|
|
33648
|
+
await new Promise((r) => setTimeout(r, POLL_INTERVAL_MS));
|
|
33649
|
+
}
|
|
33650
|
+
}
|
|
33651
|
+
openUrl(target);
|
|
33652
|
+
})();
|
|
33653
|
+
}
|
|
33654
|
+
var POLL_INTERVAL_MS = 150, POLL_TIMEOUT_MS = 30000;
|
|
33655
|
+
var init_open_browser = () => {};
|
|
33656
|
+
|
|
33275
33657
|
// src/cli-error.ts
|
|
33276
33658
|
var CliError;
|
|
33277
33659
|
var init_cli_error = __esm(() => {
|
|
@@ -34336,8 +34718,8 @@ async function introspectKey(origin, token, fetchImpl = fetch, timeoutMs = 1e4)
|
|
|
34336
34718
|
identity: {
|
|
34337
34719
|
keyId: typeof b.key_id === "string" ? b.key_id : undefined,
|
|
34338
34720
|
orgId: typeof b.org_id === "string" ? b.org_id : undefined,
|
|
34339
|
-
orgSlug:
|
|
34340
|
-
orgName:
|
|
34721
|
+
orgSlug: displayText(b.org_slug),
|
|
34722
|
+
orgName: displayText(b.org_name),
|
|
34341
34723
|
permissions: b.permissions.filter((p) => typeof p === "string"),
|
|
34342
34724
|
expiresAt: typeof b.expires_at === "string" ? b.expires_at : null,
|
|
34343
34725
|
otelIngest: typeof b.otel_ingest === "boolean" ? b.otel_ingest : undefined
|
|
@@ -34353,6 +34735,9 @@ function describeOrg(identity) {
|
|
|
34353
34735
|
return identity.orgName ?? identity.orgSlug ?? identity.orgId ?? "an unknown organisation";
|
|
34354
34736
|
}
|
|
34355
34737
|
var INTROSPECT_PATH = "/v1/auth/introspect", PERMISSION_EVENTS = "events:add", PERMISSION_POLICIES = "policies:pull", PERMISSION_JEV = "jev:evaluate";
|
|
34738
|
+
var init_cloud_introspect = __esm(() => {
|
|
34739
|
+
init_cloud_login();
|
|
34740
|
+
});
|
|
34356
34741
|
|
|
34357
34742
|
// src/hooks/credential-recovery.ts
|
|
34358
34743
|
import { createHash as createHash11 } from "node:crypto";
|
|
@@ -34884,6 +35269,7 @@ var init_cloud_connection = __esm(() => {
|
|
|
34884
35269
|
init_cloud_enrollment();
|
|
34885
35270
|
init_fp_home();
|
|
34886
35271
|
init_fp_config();
|
|
35272
|
+
init_cloud_introspect();
|
|
34887
35273
|
init_effective_reviewers();
|
|
34888
35274
|
init_collector_config();
|
|
34889
35275
|
init_credential_recovery();
|
|
@@ -37279,47 +37665,6 @@ function sanitizeErrorMessage(err) {
|
|
|
37279
37665
|
var MAX_ERROR_MESSAGE_LEN = 300;
|
|
37280
37666
|
var init_telemetry_sanitize = () => {};
|
|
37281
37667
|
|
|
37282
|
-
// src/audit/open-browser.ts
|
|
37283
|
-
import { spawn } from "node:child_process";
|
|
37284
|
-
function openUrl(url) {
|
|
37285
|
-
let cmd;
|
|
37286
|
-
let args;
|
|
37287
|
-
if (process.platform === "darwin") {
|
|
37288
|
-
cmd = "open";
|
|
37289
|
-
args = [url];
|
|
37290
|
-
} else if (process.platform === "win32") {
|
|
37291
|
-
cmd = "cmd";
|
|
37292
|
-
args = ["/c", "start", "", url];
|
|
37293
|
-
} else {
|
|
37294
|
-
cmd = "xdg-open";
|
|
37295
|
-
args = [url];
|
|
37296
|
-
}
|
|
37297
|
-
try {
|
|
37298
|
-
const child = spawn(cmd, args, { stdio: "ignore", detached: true });
|
|
37299
|
-
child.on("error", () => {});
|
|
37300
|
-
child.unref();
|
|
37301
|
-
} catch {}
|
|
37302
|
-
}
|
|
37303
|
-
function openWhenReady(port, path) {
|
|
37304
|
-
const base = `http://localhost:${port}`;
|
|
37305
|
-
const target = `${base}${path}`;
|
|
37306
|
-
(async () => {
|
|
37307
|
-
const deadline = Date.now() + POLL_TIMEOUT_MS;
|
|
37308
|
-
while (Date.now() < deadline) {
|
|
37309
|
-
try {
|
|
37310
|
-
await fetch(base, { method: "GET", redirect: "manual" });
|
|
37311
|
-
openUrl(target);
|
|
37312
|
-
return;
|
|
37313
|
-
} catch {
|
|
37314
|
-
await new Promise((r) => setTimeout(r, POLL_INTERVAL_MS));
|
|
37315
|
-
}
|
|
37316
|
-
}
|
|
37317
|
-
openUrl(target);
|
|
37318
|
-
})();
|
|
37319
|
-
}
|
|
37320
|
-
var POLL_INTERVAL_MS = 150, POLL_TIMEOUT_MS = 30000;
|
|
37321
|
-
var init_open_browser = () => {};
|
|
37322
|
-
|
|
37323
37668
|
// lib/telemetry.ts
|
|
37324
37669
|
function trackEvent(name, properties) {
|
|
37325
37670
|
if (!isTelemetryEnabled())
|
|
@@ -37407,7 +37752,7 @@ async function fetchWithTimeout2(url, init) {
|
|
|
37407
37752
|
throw err;
|
|
37408
37753
|
}
|
|
37409
37754
|
}
|
|
37410
|
-
async function
|
|
37755
|
+
async function postJson3(path, body, init) {
|
|
37411
37756
|
const headers = { "content-type": "application/json" };
|
|
37412
37757
|
if (init?.accessToken)
|
|
37413
37758
|
headers["authorization"] = `Bearer ${init.accessToken}`;
|
|
@@ -37423,18 +37768,18 @@ async function postJson2(path, body, init) {
|
|
|
37423
37768
|
return await res.json();
|
|
37424
37769
|
}
|
|
37425
37770
|
async function requestLoginCode(email) {
|
|
37426
|
-
return
|
|
37771
|
+
return postJson3("/v0/auth/login/request", { email });
|
|
37427
37772
|
}
|
|
37428
37773
|
async function verifyLoginCode(email, code) {
|
|
37429
|
-
return
|
|
37774
|
+
return postJson3("/v0/auth/login/verify", { email, code });
|
|
37430
37775
|
}
|
|
37431
37776
|
async function refreshAccessToken(refreshToken) {
|
|
37432
|
-
return
|
|
37777
|
+
return postJson3("/v0/auth/token/refresh", {
|
|
37433
37778
|
refresh_token: refreshToken
|
|
37434
37779
|
});
|
|
37435
37780
|
}
|
|
37436
37781
|
async function submitAuditReport(accessToken, body) {
|
|
37437
|
-
return
|
|
37782
|
+
return postJson3("/v0/audit-reports", body, { accessToken });
|
|
37438
37783
|
}
|
|
37439
37784
|
var DEFAULT_API_BASE = "https://api.befailproof.ai", AuthApiError, REQUEST_TIMEOUT_MS = 1e4;
|
|
37440
37785
|
var init_api_server_client = __esm(() => {
|
|
@@ -38514,6 +38859,156 @@ ${process.platform} service target.
|
|
|
38514
38859
|
stdin,
|
|
38515
38860
|
stdout
|
|
38516
38861
|
});
|
|
38862
|
+
const askKey = () => promptCloudKey({
|
|
38863
|
+
message: "Connect to cloud",
|
|
38864
|
+
meta: source ? `${host} · from ${source}` : host,
|
|
38865
|
+
tabHint: "go back",
|
|
38866
|
+
emptyError: "Paste a key, or press tab to go back.",
|
|
38867
|
+
check: async (key) => {
|
|
38868
|
+
if (!url)
|
|
38869
|
+
return { ok: false, line: badUrl ?? "No usable endpoint." };
|
|
38870
|
+
const r = await checkCloudKey(url, key);
|
|
38871
|
+
if (r.ok) {
|
|
38872
|
+
typedOrg = r.org;
|
|
38873
|
+
return { ok: true, line: r.note };
|
|
38874
|
+
}
|
|
38875
|
+
return { ok: false, line: r.refused ? `That key was refused: ${r.reason}.` : `Couldn't check the key: ${r.reason}.` };
|
|
38876
|
+
},
|
|
38877
|
+
collapsed: (answer) => answer === OPEN_SOURCE ? [] : [...cloudLines(planFor(answer)), ""],
|
|
38878
|
+
stdin,
|
|
38879
|
+
stdout
|
|
38880
|
+
});
|
|
38881
|
+
let loginUnsupported = false;
|
|
38882
|
+
const askLogin = (endpoint) => {
|
|
38883
|
+
let pollSecret = "";
|
|
38884
|
+
return promptBrowserLogin({
|
|
38885
|
+
message: "Connect to cloud",
|
|
38886
|
+
meta: source ? `${host} · from ${source}` : host,
|
|
38887
|
+
machineLabel,
|
|
38888
|
+
start: async () => {
|
|
38889
|
+
const r = await startLogin(endpoint, { label: machineLabel, os: machineOs(), cliVersion: version2 });
|
|
38890
|
+
if (r.kind === "ok") {
|
|
38891
|
+
pollSecret = r.pollSecret;
|
|
38892
|
+
emit("configure_cloud_login", { step: "started" });
|
|
38893
|
+
return { ok: true, url: r.verificationUrl, expiresIn: r.expiresIn, interval: r.interval };
|
|
38894
|
+
}
|
|
38895
|
+
if (r.kind === "unsupported") {
|
|
38896
|
+
emit("configure_cloud_login", { step: "unsupported" });
|
|
38897
|
+
loginUnsupported = true;
|
|
38898
|
+
return { ok: false, retryable: false, line: `${host} doesn't support logging in from here yet.` };
|
|
38899
|
+
}
|
|
38900
|
+
return {
|
|
38901
|
+
ok: false,
|
|
38902
|
+
retryable: true,
|
|
38903
|
+
line: r.kind === "refused" ? `Couldn't start the login: ${r.reason}.` : `Couldn't reach ${host}: ${r.reason}.`
|
|
38904
|
+
};
|
|
38905
|
+
},
|
|
38906
|
+
poll: async () => {
|
|
38907
|
+
const p = await pollLogin(endpoint, pollSecret);
|
|
38908
|
+
switch (p.kind) {
|
|
38909
|
+
case "approved":
|
|
38910
|
+
emit("configure_cloud_login", { step: "approved" });
|
|
38911
|
+
return {
|
|
38912
|
+
state: "approved",
|
|
38913
|
+
value: {
|
|
38914
|
+
kind: "login",
|
|
38915
|
+
pollSecret,
|
|
38916
|
+
org: p.org,
|
|
38917
|
+
approvedBy: p.approvedBy,
|
|
38918
|
+
keyName: p.keyName,
|
|
38919
|
+
permissions: p.permissions
|
|
38920
|
+
}
|
|
38921
|
+
};
|
|
38922
|
+
case "pending":
|
|
38923
|
+
return { state: "pending", interval: p.interval };
|
|
38924
|
+
case "slow_down":
|
|
38925
|
+
return { state: "slow_down" };
|
|
38926
|
+
case "denied":
|
|
38927
|
+
emit("configure_cloud_login", { step: "denied" });
|
|
38928
|
+
return { state: "denied" };
|
|
38929
|
+
case "unreachable":
|
|
38930
|
+
return { state: "unreachable", line: p.reason };
|
|
38931
|
+
default:
|
|
38932
|
+
return { state: "expired" };
|
|
38933
|
+
}
|
|
38934
|
+
},
|
|
38935
|
+
open: (link) => {
|
|
38936
|
+
if (!canOpenBrowser())
|
|
38937
|
+
return false;
|
|
38938
|
+
openUrl(link);
|
|
38939
|
+
return true;
|
|
38940
|
+
},
|
|
38941
|
+
collapsed: (plan) => [...cloudLines(plan), ""],
|
|
38942
|
+
stdin,
|
|
38943
|
+
stdout
|
|
38944
|
+
});
|
|
38945
|
+
};
|
|
38946
|
+
const chooseConnection = async () => {
|
|
38947
|
+
const verdict = saved && !saved.splitKeys ? await transient("Checking your saved key…", () => checkCloudKey(saved.url, saved.token)) : null;
|
|
38948
|
+
const savedBroken = verdict !== null && !verdict.ok && verdict.refused;
|
|
38949
|
+
const keptPlan = verdict && verdict.ok ? { kind: "kept", how: "saved", verified: true } : verdict && !verdict.refused ? { kind: "kept", how: "saved", verified: false } : { kind: "kept", how: "skip", verified: false };
|
|
38950
|
+
const keepHint = !saved ? "" : saved.splitKeys ? "leave both keys as they are" : verdict?.ok ? `${verdict.org ?? saved.org ?? hostOf(saved.url)} · key ${maskToken(saved.token)}` : savedBroken ? "its key no longer works" : "its key couldn't be checked just now";
|
|
38951
|
+
const login = {
|
|
38952
|
+
label: saved ? "Log in again" : "Log in to FailproofAI Cloud",
|
|
38953
|
+
value: "login",
|
|
38954
|
+
hint: savedBroken ? "recommended · your saved key no longer works" : saved ? "opens your browser and makes a new key" : "recommended · opens your browser"
|
|
38955
|
+
};
|
|
38956
|
+
const key = { label: "Paste an API key", value: "key", hint: "one you already have" };
|
|
38957
|
+
const oss = { label: "Use open source", value: "oss", hint: "skip the cloud" };
|
|
38958
|
+
const keep = { label: "Keep current connection", value: "keep", hint: keepHint };
|
|
38959
|
+
const choices = !saved ? [login, key, oss] : savedBroken ? [login, key, keep] : [keep, login, key];
|
|
38960
|
+
const leftLogin = (result) => {
|
|
38961
|
+
if (result === null || result === BACK) {
|
|
38962
|
+
if (result === BACK && loginUnsupported) {
|
|
38963
|
+
write([kit.caution(`${host} doesn't support logging in from here yet. Paste an API key instead.`), ""]);
|
|
38964
|
+
}
|
|
38965
|
+
return result;
|
|
38966
|
+
}
|
|
38967
|
+
return result.value;
|
|
38968
|
+
};
|
|
38969
|
+
if (url && (!saved || savedBroken)) {
|
|
38970
|
+
if (savedBroken && verdict && !verdict.ok) {
|
|
38971
|
+
write([kit.caution(`Your saved key no longer works: ${verdict.reason}. Logging in again.`)]);
|
|
38972
|
+
}
|
|
38973
|
+
emit("configure_cloud_choice", { choice: "login", connected: Boolean(saved), auto: true });
|
|
38974
|
+
const first = leftLogin(await askLogin(url));
|
|
38975
|
+
if (first !== BACK)
|
|
38976
|
+
return first;
|
|
38977
|
+
}
|
|
38978
|
+
for (;; ) {
|
|
38979
|
+
const pick = await selectOne({
|
|
38980
|
+
message: "Connect to cloud",
|
|
38981
|
+
meta: source ? `${host} · from ${source}` : host,
|
|
38982
|
+
choices: loginUnsupported ? choices.filter((c) => c.value !== "login") : choices,
|
|
38983
|
+
collapsed: (p) => p === "keep" ? [...cloudLines(keptPlan), ""] : p === "oss" ? [...cloudLines({ kind: "oss" }), ""] : [],
|
|
38984
|
+
stdin,
|
|
38985
|
+
stdout
|
|
38986
|
+
});
|
|
38987
|
+
if (pick === null)
|
|
38988
|
+
return null;
|
|
38989
|
+
emit("configure_cloud_choice", { choice: pick, connected: Boolean(saved) });
|
|
38990
|
+
if (pick === "keep")
|
|
38991
|
+
return keptPlan;
|
|
38992
|
+
if (pick === "oss")
|
|
38993
|
+
return { kind: "oss" };
|
|
38994
|
+
if (pick === "key") {
|
|
38995
|
+
const answer = await askKey();
|
|
38996
|
+
if (answer === null)
|
|
38997
|
+
return null;
|
|
38998
|
+
if (answer === OPEN_SOURCE)
|
|
38999
|
+
continue;
|
|
39000
|
+
return planFor(answer);
|
|
39001
|
+
}
|
|
39002
|
+
if (!url) {
|
|
39003
|
+
write([kit.fail(badUrl ?? "No usable endpoint."), ""]);
|
|
39004
|
+
continue;
|
|
39005
|
+
}
|
|
39006
|
+
const result = leftLogin(await askLogin(url));
|
|
39007
|
+
if (result === BACK)
|
|
39008
|
+
continue;
|
|
39009
|
+
return result;
|
|
39010
|
+
}
|
|
39011
|
+
};
|
|
38517
39012
|
let cloud;
|
|
38518
39013
|
if (answers.oss) {
|
|
38519
39014
|
cloud = saved ? { kind: "kept", how: "skip", verified: false } : { kind: "oss" };
|
|
@@ -38545,16 +39040,17 @@ ${process.platform} service target.
|
|
|
38545
39040
|
} else {
|
|
38546
39041
|
if (badUrl)
|
|
38547
39042
|
write([kit.fail(badUrl)]);
|
|
38548
|
-
const
|
|
38549
|
-
if (
|
|
39043
|
+
const chosen = await chooseConnection();
|
|
39044
|
+
if (chosen === null)
|
|
38550
39045
|
return cancel();
|
|
38551
|
-
cloud =
|
|
39046
|
+
cloud = chosen;
|
|
38552
39047
|
}
|
|
38553
39048
|
const fp = readConfig();
|
|
38554
39049
|
const hookedNow = INTEGRATION_TYPES.filter((id) => hookedAtUserScope(id, cwd));
|
|
38555
39050
|
const plan = planAgents({ detected: detectInstalledClis(), saved: fp.agents, hooked: hookedNow });
|
|
38556
|
-
const
|
|
38557
|
-
const
|
|
39051
|
+
const connecting = cloud.kind === "connect" || cloud.kind === "login";
|
|
39052
|
+
const collectingAfter = connecting || readIngestCredential() !== null;
|
|
39053
|
+
const sessionsOn = connecting ? answers.noTranscripts !== true : fp.collector.sessions === true;
|
|
38558
39054
|
let selected;
|
|
38559
39055
|
if (answers.agents && answers.agents.length > 0) {
|
|
38560
39056
|
const named = new Set(answers.agents);
|
|
@@ -38586,6 +39082,27 @@ ${process.platform} service target.
|
|
|
38586
39082
|
const { added, removed } = agentChanges(plan, selected);
|
|
38587
39083
|
const done = [];
|
|
38588
39084
|
let daemonInstalled = daemonAlreadyRunning;
|
|
39085
|
+
if ((daemonWanted || daemonUnitStale) && !unattended) {
|
|
39086
|
+
let stillRoot = false;
|
|
39087
|
+
try {
|
|
39088
|
+
stillRoot = canElevate();
|
|
39089
|
+
} catch {
|
|
39090
|
+
stillRoot = false;
|
|
39091
|
+
}
|
|
39092
|
+
if (!stillRoot && daemonWanted) {
|
|
39093
|
+
if (!elevate("Your sudo session expired while you were away. Installing failproofaid needs root again.")) {
|
|
39094
|
+
write([
|
|
39095
|
+
kit.fail("Couldn't get root, so setup stopped before changing anything."),
|
|
39096
|
+
` Re-run once you can use sudo: ${kit.cmd("failproofai config")}`
|
|
39097
|
+
]);
|
|
39098
|
+
emit("configure_aborted", { reason: "needs_root" });
|
|
39099
|
+
return { applied: false, abort: "needs_root" };
|
|
39100
|
+
}
|
|
39101
|
+
} else if (!stillRoot && !elevate("Your sudo session expired while you were away. Refreshing failproofaid's service definition needs root again.")) {
|
|
39102
|
+
done.push(kit.caution("No root, so its service definition stays as it is. Scheduled audits stay off until it is refreshed."));
|
|
39103
|
+
daemonUnitStale = false;
|
|
39104
|
+
}
|
|
39105
|
+
}
|
|
38589
39106
|
if (daemonWanted) {
|
|
38590
39107
|
if (daemonBroken) {
|
|
38591
39108
|
await transient("Removing the failproofaid service that can't start…", async () => {
|
|
@@ -38652,14 +39169,14 @@ ${process.platform} service target.
|
|
|
38652
39169
|
setDaemonConfigured(true, version2);
|
|
38653
39170
|
pruneOldDaemonBinaries();
|
|
38654
39171
|
}
|
|
38655
|
-
const connectedAfterPlan =
|
|
39172
|
+
const connectedAfterPlan = connecting || cloud.kind === "kept";
|
|
38656
39173
|
const applied = emit("configure_applied", {
|
|
38657
39174
|
target: "user",
|
|
38658
39175
|
scopes: ["user"],
|
|
38659
39176
|
cli: selected,
|
|
38660
39177
|
cli_count: selected.length,
|
|
38661
39178
|
policy_count: (readScopedHooksConfig("user", cwd).enabledPolicies ?? []).length,
|
|
38662
|
-
connected:
|
|
39179
|
+
connected: connecting,
|
|
38663
39180
|
mode: connectedAfterPlan ? "cloud" : "oss",
|
|
38664
39181
|
agents_selected: selected.length,
|
|
38665
39182
|
agents_detected: plan.detected.size,
|
|
@@ -38672,8 +39189,22 @@ ${process.platform} service target.
|
|
|
38672
39189
|
requestFreshStart(plan.mode === "rerun" ? added : [], collectingAfter && sessionsOn);
|
|
38673
39190
|
updateConfig({ agents: { selected, seen: plan.seen } });
|
|
38674
39191
|
let connected = false;
|
|
38675
|
-
|
|
38676
|
-
|
|
39192
|
+
let token = cloud.kind === "connect" ? cloud.token : null;
|
|
39193
|
+
let orgLabel = cloud.kind === "connect" ? cloud.org : undefined;
|
|
39194
|
+
let mintedName;
|
|
39195
|
+
if (cloud.kind === "login" && url) {
|
|
39196
|
+
const claimed = await transient("Creating this machine's key…", () => claimLogin(url, cloud.pollSecret));
|
|
39197
|
+
emit("configure_cloud_login", { step: "claimed", ok: claimed.kind === "ok", reason: claimed.kind });
|
|
39198
|
+
if (claimed.kind === "ok") {
|
|
39199
|
+
token = claimed.key;
|
|
39200
|
+
orgLabel = loginOrgLabel(claimed.org);
|
|
39201
|
+
mintedName = claimed.keyName;
|
|
39202
|
+
} else {
|
|
39203
|
+
hookLogWarn(`cloud login could not be completed: ${claimed.kind}`);
|
|
39204
|
+
done.push(kit.caution(claimed.kind === "expired" ? "The login took too long to finish, so no key was created. Everything else was applied." : claimed.kind === "revoked" ? "Whoever approved the login can no longer create keys in that org, so no key was created." : claimed.kind === "unreachable" ? `Couldn't reach ${host} to create the key (${claimed.reason}); everything else was applied.` : `The key couldn't be created: ${claimed.reason}. Everything else was applied.`, "failproofai config"));
|
|
39205
|
+
}
|
|
39206
|
+
}
|
|
39207
|
+
if (token && url) {
|
|
38677
39208
|
try {
|
|
38678
39209
|
const outcome = await transient("Connecting…", () => connectToCloud({
|
|
38679
39210
|
url,
|
|
@@ -38684,7 +39215,10 @@ ${process.platform} service target.
|
|
|
38684
39215
|
}));
|
|
38685
39216
|
connected = outcome.anyConfigured;
|
|
38686
39217
|
done.push(...outcome.changes ?? []);
|
|
38687
|
-
done.push(...connectDoneLines(kit, outcome, host,
|
|
39218
|
+
done.push(...connectDoneLines(kit, outcome, host, orgLabel));
|
|
39219
|
+
if (cloud.kind === "login" && saved && connected) {
|
|
39220
|
+
done.push(` Your previous key for this machine still works until you revoke it on ${host}'s keys page.`);
|
|
39221
|
+
}
|
|
38688
39222
|
if (outcome.ingest.ok && answers.noTranscripts === true) {
|
|
38689
39223
|
done.push(" Decisions only: session transcripts are not sent (--no-transcripts).");
|
|
38690
39224
|
}
|
|
@@ -38693,9 +39227,15 @@ ${process.platform} service target.
|
|
|
38693
39227
|
hookLogWarn(`cloud connection was not written: ${err instanceof Error ? err.message : String(err)}`);
|
|
38694
39228
|
done.push(kit.caution("Couldn't connect; everything else was applied.", "failproofai config"));
|
|
38695
39229
|
}
|
|
39230
|
+
if (cloud.kind === "login" && !connected) {
|
|
39231
|
+
done.push(` The key ${mintedName ? `"${mintedName}" ` : ""}was created but isn't in use here; revoke it on ${host}'s keys page.`);
|
|
39232
|
+
}
|
|
38696
39233
|
} else if (cloud.kind === "kept" && cloud.how === "saved" && fp.mode !== "cloud") {
|
|
38697
39234
|
updateConfig({ mode: "cloud" });
|
|
38698
39235
|
}
|
|
39236
|
+
const keptOld = cloud.kind === "login" && !token && saved !== undefined;
|
|
39237
|
+
if (keptOld)
|
|
39238
|
+
done.push(" This machine keeps its previous connection.");
|
|
38699
39239
|
await applied;
|
|
38700
39240
|
markLauncherSeen();
|
|
38701
39241
|
clearOnboardingAttempt();
|
|
@@ -38705,7 +39245,7 @@ ${process.platform} service target.
|
|
|
38705
39245
|
done,
|
|
38706
39246
|
cwd,
|
|
38707
39247
|
agents: selected.length,
|
|
38708
|
-
connected: connected || cloud.kind === "kept",
|
|
39248
|
+
connected: connected || cloud.kind === "kept" || keptOld,
|
|
38709
39249
|
codexTrust
|
|
38710
39250
|
}));
|
|
38711
39251
|
return {
|
|
@@ -38716,10 +39256,15 @@ ${process.platform} service target.
|
|
|
38716
39256
|
policies,
|
|
38717
39257
|
daemonInstalled,
|
|
38718
39258
|
connected,
|
|
38719
|
-
mode: connected || cloud.kind === "kept" ? "cloud" : "oss",
|
|
39259
|
+
mode: connected || cloud.kind === "kept" || keptOld ? "cloud" : "oss",
|
|
38720
39260
|
agents: { selected, added, removed }
|
|
38721
39261
|
};
|
|
38722
39262
|
}
|
|
39263
|
+
function loginOrgLabel(org) {
|
|
39264
|
+
if (org.name && org.slug)
|
|
39265
|
+
return `${org.name} (${org.slug})`;
|
|
39266
|
+
return org.name ?? org.slug ?? "your org";
|
|
39267
|
+
}
|
|
38723
39268
|
function savedConnection() {
|
|
38724
39269
|
const cloud = readCloudCredentials();
|
|
38725
39270
|
const ingest = readIngestCredential();
|
|
@@ -38746,8 +39291,12 @@ function resolveCloudUrl(flag, existing) {
|
|
|
38746
39291
|
const env = process.env.FAILPROOFAI_CLOUD_URL?.trim();
|
|
38747
39292
|
const fromFlag = flag?.trim();
|
|
38748
39293
|
const override = fromFlag || env;
|
|
38749
|
-
if (!override)
|
|
38750
|
-
|
|
39294
|
+
if (!override) {
|
|
39295
|
+
if (!existing)
|
|
39296
|
+
return { ok: true, url: cloudBaseFor(DEFAULT_INGEST_URL) };
|
|
39297
|
+
const saved = validateCloudUrl(existing);
|
|
39298
|
+
return saved.ok ? { ok: true, url: existing } : { ok: false, message: `the saved cloud address "${existing}" cannot be used: ${saved.reason}` };
|
|
39299
|
+
}
|
|
38751
39300
|
const source = fromFlag && fromFlag !== env ? "--url" : "FAILPROOFAI_CLOUD_URL";
|
|
38752
39301
|
const validated = validateCloudUrl(cloudBaseFor(override));
|
|
38753
39302
|
if (!validated.ok) {
|
|
@@ -38802,6 +39351,11 @@ function cloudCollapsedLines(kit, plan, at) {
|
|
|
38802
39351
|
kit.ok(plan.org ? `Key accepted for ${plan.org} on ${at.host}` : `Key accepted by ${at.host}`),
|
|
38803
39352
|
...plan.note ? [kit.caution(plan.note)] : []
|
|
38804
39353
|
];
|
|
39354
|
+
case "login":
|
|
39355
|
+
return [
|
|
39356
|
+
head,
|
|
39357
|
+
kit.ok(`Logged in${plan.approvedBy ? ` as ${plan.approvedBy}` : ""} · ${loginOrgLabel(plan.org)} on ${at.host}`)
|
|
39358
|
+
];
|
|
38805
39359
|
}
|
|
38806
39360
|
}
|
|
38807
39361
|
function connectDoneLines(kit, outcome, host, org) {
|
|
@@ -38858,6 +39412,8 @@ function doneLines(kit, state) {
|
|
|
38858
39412
|
var init_configure_wizard = __esm(() => {
|
|
38859
39413
|
init_pack_store();
|
|
38860
39414
|
init_tui();
|
|
39415
|
+
init_cloud_login();
|
|
39416
|
+
init_open_browser();
|
|
38861
39417
|
init_collector_config();
|
|
38862
39418
|
init_integrations();
|
|
38863
39419
|
init_types();
|
|
@@ -38872,6 +39428,7 @@ var init_configure_wizard = __esm(() => {
|
|
|
38872
39428
|
init_hook_logger();
|
|
38873
39429
|
init_cloud_enrollment();
|
|
38874
39430
|
init_cloud_connection();
|
|
39431
|
+
init_cloud_introspect();
|
|
38875
39432
|
init_fp_config();
|
|
38876
39433
|
init_backfill_request();
|
|
38877
39434
|
init_agent_selection();
|
|
@@ -42148,6 +42705,7 @@ var init_otel_cli = __esm(() => {
|
|
|
42148
42705
|
init_fp_home();
|
|
42149
42706
|
init_safe_config_write();
|
|
42150
42707
|
init_collector_config();
|
|
42708
|
+
init_cloud_introspect();
|
|
42151
42709
|
init_cloud_enrollment();
|
|
42152
42710
|
init_integrations();
|
|
42153
42711
|
init_tui();
|
|
@@ -42161,6 +42719,7 @@ var init_otel_cli2 = __esm(() => {
|
|
|
42161
42719
|
init_fp_home();
|
|
42162
42720
|
init_safe_config_write();
|
|
42163
42721
|
init_collector_config();
|
|
42722
|
+
init_cloud_introspect();
|
|
42164
42723
|
init_cloud_enrollment();
|
|
42165
42724
|
init_integrations();
|
|
42166
42725
|
init_tui();
|
|
@@ -42713,7 +43272,7 @@ function cloudKeyRow() {
|
|
|
42713
43272
|
function octal(mode) {
|
|
42714
43273
|
return mode === null ? null : mode.toString(8).padStart(4, "0");
|
|
42715
43274
|
}
|
|
42716
|
-
function
|
|
43275
|
+
function permissions2(mode) {
|
|
42717
43276
|
if (mode === null)
|
|
42718
43277
|
return "unknown";
|
|
42719
43278
|
return (mode & 63) === 0 ? `${octal(mode)} (owner-only)` : `${octal(mode)} (too open)`;
|
|
@@ -43214,7 +43773,7 @@ async function setupRun(argv, deps, opts) {
|
|
|
43214
43773
|
["timeout", `${cfg.timeoutMs} ms`],
|
|
43215
43774
|
["key", keyNote],
|
|
43216
43775
|
["config", path],
|
|
43217
|
-
["permissions",
|
|
43776
|
+
["permissions", permissions2(fileMode)]
|
|
43218
43777
|
], opts), offBase ? jevWarn([
|
|
43219
43778
|
`Saved as given, but ${provider}'s API is at ${offBase.api}, and this URL sends requests to ${offBase.endpoint} instead.`,
|
|
43220
43779
|
`Unless something of yours answers Jev requests at that path, every evaluation will fail there and hooks will fall back to regex — \`failproofai jev test\` says which it is in one request. To send requests back to ${provider}'s own API: failproofai jev setup --base-url default`
|
|
@@ -43339,7 +43898,7 @@ async function cloudSetup(values, bools, opts) {
|
|
|
43339
43898
|
["timeout", `${cfg.timeoutMs} ms`],
|
|
43340
43899
|
["key", keySource ? CLOUD_KEY_SOURCE : cloudKeyRow()],
|
|
43341
43900
|
["config", path],
|
|
43342
|
-
["permissions",
|
|
43901
|
+
["permissions", permissions2(fileMode)]
|
|
43343
43902
|
], opts), jevNote("Hooks read this file on every tool call — no restart. Calls are charged to your FailproofAI Cloud org's plan.", opts), shownMode === "off" ? null : keySource ? jevNext("failproofai jev test", "Check it with one live request:", opts) : jevNext("failproofai config --token <key>", `Jev stays off until this machine is connected with a key that carries jev:evaluate (the "machine" preset on the dashboard's Keys page):`, opts)));
|
|
43344
43903
|
}
|
|
43345
43904
|
function routeForRouting(routing) {
|
|
@@ -43499,7 +44058,7 @@ The daemon does not see this shell's environment.`) : [];
|
|
|
43499
44058
|
...route ? [["endpoint", displayEndpoint(route.endpoint)]] : [],
|
|
43500
44059
|
["mode", modeLine(inspection.routing.mode ?? DEFAULT_JEV_MODE)],
|
|
43501
44060
|
["key", `from ${JEV_API_KEY_ENV}, not set in this shell; the daemon never sees a shell's environment`],
|
|
43502
|
-
["config", `${inspection.path}${kit.sep}${
|
|
44061
|
+
["config", `${inspection.path}${kit.sep}${permissions2(inspection.mode)}`]
|
|
43503
44062
|
], [legacyNote], [step(`Set ${JEV_API_KEY_ENV} for this shell, or store the key in the file:`, "failproofai jev setup --key-stdin < key-file")]));
|
|
43504
44063
|
}
|
|
43505
44064
|
if (inspection.status === "off") {
|
|
@@ -43566,7 +44125,7 @@ The daemon does not see this shell's environment.`) : [];
|
|
|
43566
44125
|
"key",
|
|
43567
44126
|
inspection.keySource === "cloud" ? CLOUD_KEY_SOURCE : inspection.keySource === "file" ? "set in the config file" : `from ${JEV_API_KEY_ENV} (this shell only; the daemon does not see it)`
|
|
43568
44127
|
],
|
|
43569
|
-
["config", `${inspection.path}${kit.sep}${
|
|
44128
|
+
["config", `${inspection.path}${kit.sep}${permissions2(inspection.mode)}`],
|
|
43570
44129
|
...coverage ? [["reviewable", reviewableSummary(coverage)]] : []
|
|
43571
44130
|
], [coverageProblem ? kit.notice("caution", coverageProblem) : [], legacyNote], []));
|
|
43572
44131
|
}
|
|
@@ -50216,7 +50775,7 @@ import { realpathSync as realpathSync9 } from "fs";
|
|
|
50216
50775
|
import { dirname as dirname32, resolve as resolve43 } from "path";
|
|
50217
50776
|
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
50218
50777
|
// package.json
|
|
50219
|
-
var version = "1.0.
|
|
50778
|
+
var version = "1.0.12-beta.0";
|
|
50220
50779
|
|
|
50221
50780
|
// bin/failproofai.mjs
|
|
50222
50781
|
if (!process.env.FAILPROOFAI_PACKAGE_ROOT) {
|