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/worker.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "failproofai",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12-beta.0",
|
|
4
4
|
"description": "Observability and enforcement for AI agent harnesses. 40 built-in policies hooked into 12 of them — Claude Code, Codex, Cursor, Hermes, OpenClaw and more — blocking the tool call before it runs. Local dashboard included, no account needed.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"failproofai": "./dist/cli.mjs",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"access": "public"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
|
-
"@anthropic-ai/sdk": "^0.
|
|
84
|
+
"@anthropic-ai/sdk": "^0.135.0",
|
|
85
85
|
"@mdx-js/mdx": "^3.1.1",
|
|
86
86
|
"@tailwindcss/postcss": "^4.3.1",
|
|
87
87
|
"@tanstack/react-virtual": "^3.14.10",
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
"nanoid": "3.3.18",
|
|
118
118
|
"postcss": "8.5.26",
|
|
119
119
|
"eslint-plugin-react-hooks": "7.0.1",
|
|
120
|
-
"vite": "8.
|
|
120
|
+
"vite": "8.1.6",
|
|
121
121
|
"undici": "7.29.1",
|
|
122
122
|
"brace-expansion": "5.0.12",
|
|
123
123
|
"sharp": "0.35.5",
|
|
@@ -125,15 +125,15 @@
|
|
|
125
125
|
"browserslist": "4.28.8"
|
|
126
126
|
},
|
|
127
127
|
"optionalDependencies": {
|
|
128
|
-
"@failproofai/failproofaid-linux-x64": "1.0.
|
|
129
|
-
"@failproofai/failproofaid-linux-arm64": "1.0.
|
|
130
|
-
"@failproofai/failproofaid-darwin-x64": "1.0.
|
|
131
|
-
"@failproofai/failproofaid-darwin-arm64": "1.0.
|
|
128
|
+
"@failproofai/failproofaid-linux-x64": "1.0.12-beta.0",
|
|
129
|
+
"@failproofai/failproofaid-linux-arm64": "1.0.12-beta.0",
|
|
130
|
+
"@failproofai/failproofaid-darwin-x64": "1.0.12-beta.0",
|
|
131
|
+
"@failproofai/failproofaid-darwin-arm64": "1.0.12-beta.0"
|
|
132
132
|
},
|
|
133
133
|
"failproofaidBinaries": {
|
|
134
|
-
"linux-x64": "
|
|
135
|
-
"linux-arm64": "
|
|
136
|
-
"darwin-x64": "
|
|
137
|
-
"darwin-arm64": "
|
|
134
|
+
"linux-x64": "61710dd6261ff0deb1116e390c366c26809bf04bb2e2c16f279b7d79e1819049",
|
|
135
|
+
"linux-arm64": "5e9501522d35b32790664b4f3b1b90aa1728629f5013df94e72c2e2a11842bd2",
|
|
136
|
+
"darwin-x64": "e9d195cf30b6bc2427b7cbe89e354cc8dab7ae02e7c45a7e44a941eda84c2674",
|
|
137
|
+
"darwin-arm64": "d70ae3a3b8073ace0852a20671dba3d32f380b97ed4a01f5791a13d2fa12e63b"
|
|
138
138
|
}
|
|
139
139
|
}
|
|
@@ -13,8 +13,26 @@ import { spawn } from "node:child_process";
|
|
|
13
13
|
const POLL_INTERVAL_MS = 150;
|
|
14
14
|
const POLL_TIMEOUT_MS = 30_000;
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Whether opening a browser here can put a page in front of the person.
|
|
18
|
+
*
|
|
19
|
+
* False over SSH — `xdg-open` would start a browser on the REMOTE machine, or
|
|
20
|
+
* fail, while the person is looking at their own screen — and on a Linux box
|
|
21
|
+
* with no display at all (a container, a server). Callers then print the link,
|
|
22
|
+
* which works from any device. A guess, not a promise: a false positive costs a
|
|
23
|
+
* browser that does not appear next to a link that is printed anyway.
|
|
24
|
+
*/
|
|
25
|
+
export function canOpenBrowser(
|
|
26
|
+
env: NodeJS.ProcessEnv = process.env,
|
|
27
|
+
platform: NodeJS.Platform = process.platform,
|
|
28
|
+
): boolean {
|
|
29
|
+
if (env.SSH_CONNECTION || env.SSH_CLIENT || env.SSH_TTY) return false;
|
|
30
|
+
if (platform === "linux" && !env.DISPLAY && !env.WAYLAND_DISPLAY) return false;
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
|
|
16
34
|
/** Open a URL with the platform's default handler. Never throws. */
|
|
17
|
-
function openUrl(url: string): void {
|
|
35
|
+
export function openUrl(url: string): void {
|
|
18
36
|
let cmd: string;
|
|
19
37
|
let args: string[];
|
|
20
38
|
if (process.platform === "darwin") {
|
|
@@ -33,6 +33,8 @@
|
|
|
33
33
|
* second.
|
|
34
34
|
*/
|
|
35
35
|
|
|
36
|
+
import { displayText } from "./cloud-login";
|
|
37
|
+
|
|
36
38
|
/** The path introspect is served on, appended to the cloud origin. */
|
|
37
39
|
export const INTROSPECT_PATH = "/v1/auth/introspect";
|
|
38
40
|
|
|
@@ -126,8 +128,9 @@ export async function introspectKey(
|
|
|
126
128
|
identity: {
|
|
127
129
|
keyId: typeof b.key_id === "string" ? b.key_id : undefined,
|
|
128
130
|
orgId: typeof b.org_id === "string" ? b.org_id : undefined,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
+
// Printed in "Connected as …": text only, never terminal controls.
|
|
132
|
+
orgSlug: displayText(b.org_slug),
|
|
133
|
+
orgName: displayText(b.org_name),
|
|
131
134
|
permissions: b.permissions.filter((p): p is string => typeof p === "string"),
|
|
132
135
|
expiresAt: typeof b.expires_at === "string" ? b.expires_at : null,
|
|
133
136
|
otelIngest: typeof b.otel_ingest === "boolean" ? b.otel_ingest : undefined,
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The CLI half of "Log in to FailproofAI Cloud" — `failproofai config`'s
|
|
3
|
+
* browser login.
|
|
4
|
+
*
|
|
5
|
+
* The CLI asks the dashboard for a link, a person approves it in a browser
|
|
6
|
+
* (signing up, signing in, picking or creating an org on the way), and the CLI
|
|
7
|
+
* — polling with a secret only it holds — sees the approval and, once setup has
|
|
8
|
+
* finished, claims a freshly minted machine key. The server side is
|
|
9
|
+
* `server/src/routes/cli_login.rs` in AgentEye; the relay is the dashboard's
|
|
10
|
+
* `/api/auth/cli/*`.
|
|
11
|
+
*
|
|
12
|
+
* Three calls, each with an injectable `fetch` so tests never reach the network:
|
|
13
|
+
* start → { verificationUrl, pollSecret, expiresIn, interval }
|
|
14
|
+
* poll → pending / slow_down / approved (org + who) / denied / expired / …
|
|
15
|
+
* claim → the key, exactly once. Called at APPLY, after the daemon installs:
|
|
16
|
+
* an approval that is never claimed leaves no key behind.
|
|
17
|
+
*
|
|
18
|
+
* Every call refuses to follow a redirect, for the reason `introspectKey` gives:
|
|
19
|
+
* a dashboard that does not know a path can answer with a login page, and a 200
|
|
20
|
+
* from that must never read as success.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
export const LOGIN_START_PATH = "/api/auth/cli/start";
|
|
24
|
+
export const LOGIN_POLL_PATH = "/api/auth/cli/poll";
|
|
25
|
+
export const LOGIN_CLAIM_PATH = "/api/auth/cli/claim";
|
|
26
|
+
|
|
27
|
+
const TIMEOUT_MS = 10_000;
|
|
28
|
+
|
|
29
|
+
export interface LoginOrg {
|
|
30
|
+
id?: string;
|
|
31
|
+
slug?: string;
|
|
32
|
+
name?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type StartResult =
|
|
36
|
+
| { kind: "ok"; verificationUrl: string; pollSecret: string; expiresIn: number; interval: number }
|
|
37
|
+
/** This cloud predates browser login. Pasting a key still works. */
|
|
38
|
+
| { kind: "unsupported" }
|
|
39
|
+
| { kind: "refused"; reason: string }
|
|
40
|
+
| { kind: "unreachable"; reason: string };
|
|
41
|
+
|
|
42
|
+
export type PollResult =
|
|
43
|
+
| { kind: "pending"; interval?: number }
|
|
44
|
+
| { kind: "slow_down" }
|
|
45
|
+
| { kind: "approved"; org: LoginOrg; approvedBy?: string; keyName?: string; permissions: string[] }
|
|
46
|
+
| { kind: "denied" }
|
|
47
|
+
| { kind: "expired" }
|
|
48
|
+
| { kind: "claimed" }
|
|
49
|
+
/** The server no longer knows this request (swept, or never existed). */
|
|
50
|
+
| { kind: "unknown" }
|
|
51
|
+
| { kind: "unreachable"; reason: string };
|
|
52
|
+
|
|
53
|
+
export type ClaimResult =
|
|
54
|
+
| {
|
|
55
|
+
kind: "ok";
|
|
56
|
+
key: string;
|
|
57
|
+
keyId?: string;
|
|
58
|
+
keyName?: string;
|
|
59
|
+
org: LoginOrg;
|
|
60
|
+
permissions: string[];
|
|
61
|
+
approvedBy?: string;
|
|
62
|
+
}
|
|
63
|
+
| { kind: "expired" }
|
|
64
|
+
/** The person who approved can no longer grant this key. */
|
|
65
|
+
| { kind: "revoked" }
|
|
66
|
+
| { kind: "refused"; reason: string }
|
|
67
|
+
| { kind: "unreachable"; reason: string };
|
|
68
|
+
|
|
69
|
+
type Fetch = typeof fetch;
|
|
70
|
+
|
|
71
|
+
async function postJson(
|
|
72
|
+
origin: string,
|
|
73
|
+
path: string,
|
|
74
|
+
body: unknown,
|
|
75
|
+
fetchImpl: Fetch,
|
|
76
|
+
): Promise<{ status: number; json: Record<string, unknown> | null } | { error: string }> {
|
|
77
|
+
const controller = new AbortController();
|
|
78
|
+
const timer = setTimeout(() => controller.abort(), TIMEOUT_MS);
|
|
79
|
+
try {
|
|
80
|
+
const res = await fetchImpl(`${origin.replace(/\/+$/, "")}${path}`, {
|
|
81
|
+
method: "POST",
|
|
82
|
+
headers: { "Content-Type": "application/json" },
|
|
83
|
+
body: JSON.stringify(body),
|
|
84
|
+
redirect: "manual",
|
|
85
|
+
signal: controller.signal,
|
|
86
|
+
});
|
|
87
|
+
let json: Record<string, unknown> | null = null;
|
|
88
|
+
try {
|
|
89
|
+
const parsed: unknown = await res.json();
|
|
90
|
+
json = parsed && typeof parsed === "object" && !Array.isArray(parsed) ? (parsed as Record<string, unknown>) : null;
|
|
91
|
+
} catch {
|
|
92
|
+
json = null;
|
|
93
|
+
}
|
|
94
|
+
return { status: res.status, json };
|
|
95
|
+
} catch (err) {
|
|
96
|
+
// Deliberately not the URL: setup is often run while screen-sharing.
|
|
97
|
+
return { error: err instanceof Error ? (err.name === "AbortError" ? "timed out" : err.message) : String(err) };
|
|
98
|
+
} finally {
|
|
99
|
+
clearTimeout(timer);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const str = (v: unknown): string | undefined => (typeof v === "string" && v.length > 0 ? v : undefined);
|
|
104
|
+
|
|
105
|
+
// Controls (a terminal executes them: clear the screen, retitle the window,
|
|
106
|
+
// write the clipboard), bidi overrides and isolates, and zero-width formatting.
|
|
107
|
+
const INVISIBLE = /[\u0000-\u001f\u007f-\u009f\u061c\u180e\u200b-\u200f\u202a-\u202e\u2060-\u2069\ufeff]/g;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* A server-supplied string made safe to print. Org names are chosen by whoever
|
|
111
|
+
* created the org and the CLI prints the one it was approved into — the line
|
|
112
|
+
* that is meant to show who approved what — so none of it may reach the
|
|
113
|
+
* terminal as anything but text.
|
|
114
|
+
*/
|
|
115
|
+
export function displayText(v: unknown, max = 200): string | undefined {
|
|
116
|
+
if (typeof v !== "string") return undefined;
|
|
117
|
+
const t = v.replace(INVISIBLE, "").trim().slice(0, max);
|
|
118
|
+
return t.length > 0 ? t : undefined;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function org(v: unknown): LoginOrg {
|
|
122
|
+
const o = v && typeof v === "object" ? (v as Record<string, unknown>) : {};
|
|
123
|
+
return { id: str(o.id), slug: displayText(o.slug), name: displayText(o.name) };
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function permissions(v: unknown): string[] {
|
|
127
|
+
return Array.isArray(v) ? v.map((p) => displayText(p, 64)).filter((p): p is string => p !== undefined) : [];
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/** A server's number, kept to a range this client can live with: a huge poll
|
|
131
|
+
* interval overflows `setTimeout` into a 1 ms storm, a tiny one polls flat out. */
|
|
132
|
+
const within = (v: unknown, lo: number, hi: number, fallback: number): number =>
|
|
133
|
+
typeof v === "number" && Number.isFinite(v) && v > 0 ? Math.min(hi, Math.max(lo, v)) : fallback;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Only an http(s) link is ever handed to the browser opener. The URL comes from
|
|
137
|
+
* the server, and `xdg-open` / `open` will happily act on any scheme they know.
|
|
138
|
+
*/
|
|
139
|
+
export function isOpenableUrl(raw: string): boolean {
|
|
140
|
+
try {
|
|
141
|
+
const u = new URL(raw);
|
|
142
|
+
return u.protocol === "https:" || u.protocol === "http:";
|
|
143
|
+
} catch {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/** What the browser page should call this machine and its OS. */
|
|
149
|
+
export function machineOs(platform: NodeJS.Platform = process.platform): string {
|
|
150
|
+
return platform === "darwin" ? "macOS" : platform === "win32" ? "windows" : platform;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export async function startLogin(
|
|
154
|
+
origin: string,
|
|
155
|
+
machine: { label: string; os: string; cliVersion: string },
|
|
156
|
+
fetchImpl: Fetch = fetch,
|
|
157
|
+
): Promise<StartResult> {
|
|
158
|
+
const r = await postJson(
|
|
159
|
+
origin,
|
|
160
|
+
LOGIN_START_PATH,
|
|
161
|
+
{ machine_label: machine.label, machine_os: machine.os, cli_version: machine.cliVersion },
|
|
162
|
+
fetchImpl,
|
|
163
|
+
);
|
|
164
|
+
if ("error" in r) return { kind: "unreachable", reason: r.error };
|
|
165
|
+
// No such route, or the web app redirecting an unknown path: a cloud from
|
|
166
|
+
// before this feature. Not an error — the key prompt still connects it.
|
|
167
|
+
if (r.status === 404 || (r.status >= 300 && r.status < 400)) return { kind: "unsupported" };
|
|
168
|
+
if (r.status === 429) return { kind: "refused", reason: "too many login attempts from here — wait a minute" };
|
|
169
|
+
if (r.status !== 201 || !r.json) {
|
|
170
|
+
return r.status >= 500
|
|
171
|
+
? { kind: "unreachable", reason: `the server answered ${r.status}` }
|
|
172
|
+
: { kind: "refused", reason: displayText(r.json?.error, 120) ?? `the server answered ${r.status}` };
|
|
173
|
+
}
|
|
174
|
+
const verificationUrl = str(r.json.verification_url);
|
|
175
|
+
const pollSecret = str(r.json.poll_secret);
|
|
176
|
+
if (!verificationUrl || !pollSecret || !isOpenableUrl(verificationUrl)) {
|
|
177
|
+
// A 201 without the fields is something other than this API.
|
|
178
|
+
return { kind: "unsupported" };
|
|
179
|
+
}
|
|
180
|
+
return {
|
|
181
|
+
kind: "ok",
|
|
182
|
+
// Re-serialised, never the raw string: it is printed, and the parser
|
|
183
|
+
// percent-encodes every control and non-ASCII character in it.
|
|
184
|
+
verificationUrl: new URL(verificationUrl).href,
|
|
185
|
+
pollSecret,
|
|
186
|
+
expiresIn: within(r.json.expires_in, 30, 3600, 600),
|
|
187
|
+
interval: within(r.json.interval, 1, 30, 2),
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export async function pollLogin(origin: string, pollSecret: string, fetchImpl: Fetch = fetch): Promise<PollResult> {
|
|
192
|
+
const r = await postJson(origin, LOGIN_POLL_PATH, { poll_secret: pollSecret }, fetchImpl);
|
|
193
|
+
if ("error" in r) return { kind: "unreachable", reason: r.error };
|
|
194
|
+
if (r.status === 404) return { kind: "unknown" };
|
|
195
|
+
if (r.status !== 200 || !r.json) return { kind: "unreachable", reason: `the server answered ${r.status}` };
|
|
196
|
+
const j = r.json;
|
|
197
|
+
switch (j.status) {
|
|
198
|
+
case "pending":
|
|
199
|
+
return { kind: "pending", interval: typeof j.interval === "number" ? within(j.interval, 1, 30, 2) : undefined };
|
|
200
|
+
case "slow_down":
|
|
201
|
+
return { kind: "slow_down" };
|
|
202
|
+
case "approved":
|
|
203
|
+
return {
|
|
204
|
+
kind: "approved",
|
|
205
|
+
org: org(j.org),
|
|
206
|
+
approvedBy: displayText(j.approved_by),
|
|
207
|
+
keyName: displayText(j.key_name),
|
|
208
|
+
permissions: permissions(j.permissions),
|
|
209
|
+
};
|
|
210
|
+
case "denied":
|
|
211
|
+
return { kind: "denied" };
|
|
212
|
+
case "expired":
|
|
213
|
+
return { kind: "expired" };
|
|
214
|
+
case "claimed":
|
|
215
|
+
return { kind: "claimed" };
|
|
216
|
+
default:
|
|
217
|
+
return { kind: "unknown" };
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export async function claimLogin(origin: string, pollSecret: string, fetchImpl: Fetch = fetch): Promise<ClaimResult> {
|
|
222
|
+
const r = await postJson(origin, LOGIN_CLAIM_PATH, { poll_secret: pollSecret }, fetchImpl);
|
|
223
|
+
if ("error" in r) return { kind: "unreachable", reason: r.error };
|
|
224
|
+
const j = r.json ?? {};
|
|
225
|
+
if (r.status === 201) {
|
|
226
|
+
const key = str(j.api_key);
|
|
227
|
+
if (!key) return { kind: "refused", reason: "the server answered without a key" };
|
|
228
|
+
return {
|
|
229
|
+
kind: "ok",
|
|
230
|
+
key,
|
|
231
|
+
keyId: str(j.key_id),
|
|
232
|
+
keyName: displayText(j.key_name),
|
|
233
|
+
org: org(j.org),
|
|
234
|
+
permissions: permissions(j.permissions),
|
|
235
|
+
approvedBy: displayText(j.approved_by),
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
if (r.status === 410) return { kind: "expired" };
|
|
239
|
+
if (r.status === 403 && j.error === "approval_revoked") return { kind: "revoked" };
|
|
240
|
+
if (r.status >= 500) return { kind: "unreachable", reason: `the server answered ${r.status}` };
|
|
241
|
+
return {
|
|
242
|
+
kind: "refused",
|
|
243
|
+
reason: displayText(j.status, 40) ? `the login request is ${displayText(j.status, 40)}` : `the server answered ${r.status}`,
|
|
244
|
+
};
|
|
245
|
+
}
|