failproofai 1.0.1 → 1.0.2-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 +3 -3
- package/.next/standalone/.next/prerender-manifest.json +6 -6
- package/.next/standalone/.next/required-server-files.json +1 -1
- 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 +7 -7
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +6 -6
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js +2 -2
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +15 -15
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +15 -15
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +14 -14
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/api/audit/invite/route.js +3 -2
- package/.next/standalone/.next/server/app/api/audit/invite/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/audit/run/route.js +5 -4
- package/.next/standalone/.next/server/app/api/audit/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/audit/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/login-request/route.js +2 -2
- 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 +4 -3
- 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 +4 -4
- 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 +4 -4
- 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.nft.json +1 -1
- package/.next/standalone/.next/server/app/audit/page/server-reference-manifest.json +2 -2
- package/.next/standalone/.next/server/app/audit/page.js +2 -2
- package/.next/standalone/.next/server/app/audit/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/audit/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +15 -15
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +14 -14
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +15 -15
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- 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/server-reference-manifest.json +66 -22
- package/.next/standalone/.next/server/app/policies/page.js +5 -4
- 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/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page.js +2 -2
- package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/projects/page.js +2 -2
- package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +4 -4
- package/.next/standalone/.next/server/app/settings/page.js +1 -1
- 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]__1qzqcio._.js → [externals]__0e32-7c._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[externals]__1s462yl._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__01eqny5._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_0xu5z._.js +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__1p8poxd._.js → [root-of-the-server]__0igxt32._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0neqlu-._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0o07qi9._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0t9oqnn._.js +3 -0
- package/.next/standalone/.next/server/chunks/_0bs-v8p._.js +3 -0
- package/.next/standalone/.next/server/chunks/_0tovk6q._.js +3 -0
- package/.next/standalone/.next/server/chunks/_0trp3yc._.js +3 -0
- package/.next/standalone/.next/server/chunks/_185gyk9._.js +3 -0
- package/.next/standalone/.next/server/chunks/_1ek68ln._.js +5 -6
- package/.next/standalone/.next/server/chunks/lib_telemetry-id_ts_1k8gj9o._.js +3 -0
- package/.next/standalone/.next/server/chunks/{node_modules_posthog-node_dist_entrypoints_index_node_mjs_09d5c79._.js → node_modules_posthog-node_dist_entrypoints_index_node_mjs_04op_ou._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{node_modules_posthog-node_dist_entrypoints_index_node_mjs_1d2g73o._.js → node_modules_posthog-node_dist_entrypoints_index_node_mjs_0dr20uz._.js} +1 -1
- package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4v._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_hooks_0xbw3bu._.js +12 -0
- package/.next/standalone/.next/server/chunks/src_hooks_fp-home_ts_09kv0bn._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__013jr2b._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01wy8d-._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02npjtd._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0spkm68._.js → [root-of-the-server]__07gm3zl._.js} +21 -20
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0da85px._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ftmoxc._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0oa1lav._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0p-5p8u._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0s740oi._.js +6 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__07tbbf3._.js → [root-of-the-server]__0zig5sv._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__192nhvh._.js +5 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1p2otjt._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0lvyuv4._.js → _00e9tnf._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_08x1r5t._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0u5zauv._.js → _12l4a_k._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1u8-lu2._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1zopuov._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_audit__components_audit-dashboard_tsx_0p9ud47._.js +13 -13
- package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_1kp6l3x._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_19dqvpc._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/app_settings_settings-client_tsx_20lq-mq._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_08o7bqo._.js +10 -0
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_builtin-policies_ts_09j2ndl._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_fp-home_ts_0je3xkv._.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/middleware.js +1 -1
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +71 -27
- package/.next/standalone/.next/static/chunks/{37fcpc36x9gpe.js → 0eqky-7n7dgdm.js} +1 -1
- package/.next/standalone/.next/static/chunks/{1ide1wl2f7zi1.js → 0sa9v5mhc8861.js} +13 -13
- package/.next/standalone/.next/static/chunks/1mfzsja6ftim5.css +2 -0
- package/.next/standalone/.next/static/chunks/{3k7mxbp9hiom0.js → 1nuqytbta44af.js} +1 -1
- package/.next/standalone/.next/static/chunks/1sl2xmn9inx3y.js +6 -0
- package/.next/standalone/.next/static/chunks/{2_2lhuojq2xop.js → 2aawsjld9ied_.js} +1 -1
- package/.next/standalone/.next/static/chunks/2gn7ut4svofm2.js +1 -0
- package/.next/standalone/.next/static/chunks/{31s1smp-g7gks.js → 2hs7ycvsav7v2.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0k5050ezjvv49.js → 2i2yt3hzjredm.js} +1 -1
- package/.next/standalone/.next/static/chunks/{3c808qrfcq0im.js → 35xg6retpe6rp.js} +1 -1
- package/.next/standalone/.next/static/chunks/{2zpp1we2jv6tb.js → 3y54nw0i7dsjl.js} +1 -1
- package/.next/standalone/SECURITY.md +5 -4
- package/.next/standalone/app/actions/get-hooks-config.ts +108 -17
- package/.next/standalone/app/actions/pack-actions.ts +153 -0
- package/.next/standalone/app/audit/_components/run-progress.tsx +1 -1
- package/.next/standalone/app/audit/_components/share-templates.ts +13 -13
- package/.next/standalone/app/policies/hooks-client.tsx +320 -14
- package/.next/standalone/components/navbar.tsx +2 -28
- package/.next/standalone/components/reach-developers.tsx +8 -1
- package/.next/standalone/docs-old/agenteye/python-sdk-skill.mdx +1 -1
- package/.next/standalone/docs-old/agenteye/python-sdk.mdx +59 -35
- package/.next/standalone/docs-old/i18n/README.ar.md +1 -0
- package/.next/standalone/docs-old/i18n/README.de.md +1 -0
- package/.next/standalone/docs-old/i18n/README.es.md +1 -0
- package/.next/standalone/docs-old/i18n/README.fr.md +1 -0
- package/.next/standalone/docs-old/i18n/README.he.md +1 -0
- package/.next/standalone/docs-old/i18n/README.hi.md +1 -0
- package/.next/standalone/docs-old/i18n/README.it.md +1 -0
- package/.next/standalone/docs-old/i18n/README.ja.md +1 -0
- package/.next/standalone/docs-old/i18n/README.ko.md +1 -0
- package/.next/standalone/docs-old/i18n/README.pt-br.md +1 -0
- package/.next/standalone/docs-old/i18n/README.ru.md +1 -0
- package/.next/standalone/docs-old/i18n/README.tr.md +1 -0
- package/.next/standalone/docs-old/i18n/README.vi.md +1 -0
- package/.next/standalone/docs-old/i18n/README.zh.md +1 -0
- package/.next/standalone/fp-cloud-cli/CHANGELOG.md +431 -0
- package/.next/standalone/fp-cloud-cli/LICENSE +42 -0
- package/.next/standalone/fp-cloud-cli/MANIFEST.in +10 -0
- package/.next/standalone/fp-cloud-cli/README.md +259 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/__init__.py +10 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/__main__.py +4 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/_click_compat.py +64 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/_context.py +332 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/_version.py +1 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/analytics.py +432 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/analytics_config.py +77 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/analytics_registry.py +83 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/app.py +492 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/auth.py +160 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/client.py +1694 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/commands/__init__.py +0 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/commands/_write.py +214 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/commands/agent_cmds.py +407 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/commands/alerts_cmds.py +445 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/commands/audits_cmds.py +1054 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/commands/auth_cmds.py +512 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/commands/errors_cmds.py +190 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/commands/evals_cmds.py +161 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/commands/events_cmds.py +159 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/commands/fleet_cmds.py +416 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/commands/guardrails_cmds.py +148 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/commands/incidents_cmds.py +472 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/commands/keys_cmds.py +407 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/commands/list_cmds.py +63 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/commands/orgs_cmds.py +319 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/commands/policies_cmds.py +499 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/commands/queries_cmds.py +378 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/commands/sessions_cmds.py +151 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/commands/settings_cmds.py +150 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/commands/usage_cmds.py +35 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/commands/users_cmds.py +404 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/config.py +330 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/dates.py +78 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/enforcement.py +345 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/errors.py +98 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/models.py +891 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/orgs.py +30 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/output.py +6593 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/permissions.py +208 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/policy_check.py +290 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/py.typed +0 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/select.py +322 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/theme.py +53 -0
- package/.next/standalone/fp-cloud-cli/pyproject.toml +106 -0
- package/.next/standalone/fp-cloud-cli/skill/SKILL.md +302 -0
- package/.next/standalone/fp-cloud-cli/skill/agents/openai.yaml +8 -0
- package/.next/standalone/fp-cloud-cli/skill/references/commands.md +254 -0
- package/.next/standalone/fp-cloud-cli/tests/__init__.py +0 -0
- package/.next/standalone/fp-cloud-cli/tests/conftest.py +92 -0
- package/.next/standalone/fp-cloud-cli/tests/test_alerting.py +644 -0
- package/.next/standalone/fp-cloud-cli/tests/test_analytics.py +385 -0
- package/.next/standalone/fp-cloud-cli/tests/test_audits.py +950 -0
- package/.next/standalone/fp-cloud-cli/tests/test_auth.py +98 -0
- package/.next/standalone/fp-cloud-cli/tests/test_auth_mode.py +272 -0
- package/.next/standalone/fp-cloud-cli/tests/test_click_compat.py +118 -0
- package/.next/standalone/fp-cloud-cli/tests/test_client.py +299 -0
- package/.next/standalone/fp-cloud-cli/tests/test_commands.py +814 -0
- package/.next/standalone/fp-cloud-cli/tests/test_config.py +99 -0
- package/.next/standalone/fp-cloud-cli/tests/test_dashboards_agent.py +340 -0
- package/.next/standalone/fp-cloud-cli/tests/test_dates.py +76 -0
- package/.next/standalone/fp-cloud-cli/tests/test_enforcement_logic.py +481 -0
- package/.next/standalone/fp-cloud-cli/tests/test_facets.py +170 -0
- package/.next/standalone/fp-cloud-cli/tests/test_failproofai_home.py +722 -0
- package/.next/standalone/fp-cloud-cli/tests/test_fp_home_contract.py +198 -0
- package/.next/standalone/fp-cloud-cli/tests/test_hardening.py +186 -0
- package/.next/standalone/fp-cloud-cli/tests/test_help_table_coverage.py +127 -0
- package/.next/standalone/fp-cloud-cli/tests/test_keys_queries.py +496 -0
- package/.next/standalone/fp-cloud-cli/tests/test_list.py +59 -0
- package/.next/standalone/fp-cloud-cli/tests/test_multivalue.py +183 -0
- package/.next/standalone/fp-cloud-cli/tests/test_no_customer_identifiers.py +168 -0
- package/.next/standalone/fp-cloud-cli/tests/test_operator.py +492 -0
- package/.next/standalone/fp-cloud-cli/tests/test_orgs.py +692 -0
- package/.next/standalone/fp-cloud-cli/tests/test_output.py +1732 -0
- package/.next/standalone/fp-cloud-cli/tests/test_policy_check.py +191 -0
- package/.next/standalone/fp-cloud-cli/tests/test_readme_matches_reality.py +125 -0
- package/.next/standalone/fp-cloud-cli/tests/test_review_fixes.py +161 -0
- package/.next/standalone/fp-cloud-cli/tests/test_telemetry_completeness.py +90 -0
- package/.next/standalone/fp-cloud-cli/tests/test_usage.py +115 -0
- package/.next/standalone/fp-cloud-cli/tests/test_v1_origin_diagnostic.py +70 -0
- package/.next/standalone/fp-cloud-cli/tests/test_v1_routing.py +214 -0
- package/.next/standalone/fp-cloud-cli/tests/test_whoami.py +104 -0
- package/.next/standalone/fp-cloud-cli/uv.lock +552 -0
- package/.next/standalone/package.json +29 -22
- package/.next/standalone/sdk/python/CHANGELOG.md +70 -0
- package/.next/standalone/sdk/python/LICENSE +42 -0
- package/.next/standalone/sdk/python/MANIFEST.in +21 -0
- package/.next/standalone/sdk/python/README.md +466 -0
- package/.next/standalone/sdk/python/docs/README.md +249 -0
- package/.next/standalone/sdk/python/docs/_shared/README.md +43 -0
- package/.next/standalone/sdk/python/docs/_shared/__init__.py +195 -0
- package/.next/standalone/sdk/python/docs/crewai/README.md +328 -0
- package/.next/standalone/sdk/python/docs/crewai/examples/quickstart.py +61 -0
- package/.next/standalone/sdk/python/docs/crewai/examples/research_crew.py +92 -0
- package/.next/standalone/sdk/python/docs/langgraph/README.md +481 -0
- package/.next/standalone/sdk/python/docs/langgraph/examples/quickstart.py +51 -0
- package/.next/standalone/sdk/python/docs/langgraph/examples/research_agent.py +86 -0
- package/.next/standalone/sdk/python/docs/langgraph/examples/supervisor_handoff.py +83 -0
- package/.next/standalone/sdk/python/docs/llama_index/README.md +332 -0
- package/.next/standalone/sdk/python/docs/llama_index/examples/quickstart.py +62 -0
- package/.next/standalone/sdk/python/docs/llama_index/examples/research_agent.py +93 -0
- package/.next/standalone/sdk/python/docs/manual/README.md +491 -0
- package/.next/standalone/sdk/python/docs/manual/examples/quickstart.py +57 -0
- package/.next/standalone/sdk/python/docs/manual/examples/research_agent.py +133 -0
- package/.next/standalone/sdk/python/docs/pydantic_ai/README.md +323 -0
- package/.next/standalone/sdk/python/docs/pydantic_ai/examples/quickstart.py +48 -0
- package/.next/standalone/sdk/python/docs/pydantic_ai/examples/research_agent.py +94 -0
- package/.next/standalone/sdk/python/failproofai_sdk/__init__.py +131 -0
- package/.next/standalone/sdk/python/failproofai_sdk/_context.py +218 -0
- package/.next/standalone/sdk/python/failproofai_sdk/_environment.py +78 -0
- package/.next/standalone/sdk/python/failproofai_sdk/_events.py +752 -0
- package/.next/standalone/sdk/python/failproofai_sdk/_resolver.py +118 -0
- package/.next/standalone/sdk/python/failproofai_sdk/_runtime.py +21 -0
- package/.next/standalone/sdk/python/failproofai_sdk/_schema.py +317 -0
- package/.next/standalone/sdk/python/failproofai_sdk/_scopes.py +422 -0
- package/.next/standalone/sdk/python/failproofai_sdk/_version.py +1 -0
- package/.next/standalone/sdk/python/failproofai_sdk/_writer.py +750 -0
- package/.next/standalone/sdk/python/failproofai_sdk/integrations/__init__.py +274 -0
- package/.next/standalone/sdk/python/failproofai_sdk/integrations/_compat.py +247 -0
- package/.next/standalone/sdk/python/failproofai_sdk/integrations/_core.py +1076 -0
- package/.next/standalone/sdk/python/failproofai_sdk/integrations/crewai.py +1669 -0
- package/.next/standalone/sdk/python/failproofai_sdk/integrations/langchain.py +2151 -0
- package/.next/standalone/sdk/python/failproofai_sdk/integrations/llama_index.py +1588 -0
- package/.next/standalone/sdk/python/failproofai_sdk/integrations/pydantic_ai.py +977 -0
- package/.next/standalone/sdk/python/failproofai_sdk/py.typed +0 -0
- package/.next/standalone/sdk/python/pyproject.toml +92 -0
- package/.next/standalone/sdk/python/skill/SKILL.md +399 -0
- package/.next/standalone/sdk/python/skill/agents/openai.yaml +8 -0
- package/.next/standalone/sdk/python/skill/references/events.md +234 -0
- package/.next/standalone/sdk/python/skill/references/frameworks.md +314 -0
- package/.next/standalone/sdk/python/skill/references/install.md +100 -0
- package/.next/standalone/sdk/python/skill/references/integration.md +352 -0
- package/.next/standalone/sdk/python/tests/__init__.py +0 -0
- package/.next/standalone/sdk/python/tests/conftest.py +169 -0
- package/.next/standalone/sdk/python/tests/integrations/__init__.py +6 -0
- package/.next/standalone/sdk/python/tests/integrations/test_crewai.py +1299 -0
- package/.next/standalone/sdk/python/tests/integrations/test_langchain.py +2338 -0
- package/.next/standalone/sdk/python/tests/integrations/test_llama_index.py +1576 -0
- package/.next/standalone/sdk/python/tests/integrations/test_pydantic_ai.py +1102 -0
- package/.next/standalone/sdk/python/tests/test_context.py +410 -0
- package/.next/standalone/sdk/python/tests/test_docs.py +411 -0
- package/.next/standalone/sdk/python/tests/test_durability.py +1352 -0
- package/.next/standalone/sdk/python/tests/test_encoding.py +571 -0
- package/.next/standalone/sdk/python/tests/test_integrations.py +1127 -0
- package/.next/standalone/sdk/python/tests/test_no_customer_identifiers.py +214 -0
- package/.next/standalone/sdk/python/tests/test_packaging.py +185 -0
- package/.next/standalone/sdk/python/tests/test_resolver_umbrella.py +178 -0
- package/.next/standalone/sdk/python/tests/test_scopes.py +487 -0
- package/.next/standalone/sdk/python/tests/test_sdk.py +923 -0
- package/.next/standalone/sdk/python/tests/test_server_contract.py +650 -0
- package/.next/standalone/sdk/python/tests/test_site_docs.py +371 -0
- package/.next/standalone/sdk/python/tests/test_skill_snippets.py +165 -0
- package/.next/standalone/sdk/python/tests/test_spool_contract.py +287 -0
- package/.next/standalone/sdk/python/tests/test_spool_creation.py +360 -0
- package/.next/standalone/sdk/python/tests/test_wire_format.py +279 -0
- package/.next/standalone/sdk/python/tests/test_zero_dependencies.py +378 -0
- package/.next/standalone/sdk/python/uv.lock +6005 -0
- package/.next/standalone/server.js +1 -1
- package/README.md +77 -21
- package/bin/failproofai.mjs +145 -11
- package/dist/cli.mjs +4482 -2205
- package/dist/index.js +5 -5
- package/dist/worker.mjs +2399 -1978
- package/package.json +29 -22
- package/policy-pack/SHA256SUMS +2 -0
- package/policy-pack/failproofai-pack.json +732 -0
- package/policy-pack/failproofai-pack.mjs +2017 -0
- package/scripts/build-policy-pack.mjs +121 -0
- package/scripts/changelog-section.py +77 -0
- package/scripts/prune-standalone.mjs +3 -0
- package/scripts/python-version.py +232 -0
- package/scripts/translate-docs/cli.ts +21 -0
- package/scripts/translate-docs/mintlify-nav.ts +85 -13
- package/scripts/translate-docs/translator.ts +66 -11
- package/src/audit/cache.ts +40 -3
- package/src/audit/cli.ts +1 -1
- package/src/audit/index.ts +1 -1
- package/src/audit/replay.ts +89 -3
- package/src/audit/report.ts +5 -5
- package/src/audit/schedule-cli.ts +49 -53
- package/src/hooks/builtin-policies.ts +217 -579
- package/src/hooks/cloud-enrollment-cli.ts +66 -27
- package/src/hooks/cloud-managed-policies.ts +6 -1
- package/src/hooks/configure-wizard.ts +1 -1
- package/src/hooks/custom-hooks-loader.ts +89 -6
- package/src/hooks/fp-home.ts +92 -4
- package/src/hooks/fp-reset.ts +26 -2
- package/src/hooks/handler.ts +181 -11
- package/src/hooks/harness-cli.ts +79 -25
- package/src/hooks/hook-activity-store.ts +13 -3
- package/src/hooks/install-prompt.ts +25 -3
- package/src/hooks/manager.ts +418 -172
- package/src/hooks/migrations.ts +2 -2
- package/src/hooks/pack-cli.ts +505 -0
- package/src/hooks/pack-failclosed.ts +189 -0
- package/src/hooks/pack-manifest.ts +344 -0
- package/src/hooks/pack-store.ts +930 -0
- package/src/hooks/policy-catalog.ts +535 -0
- package/src/hooks/policy-evaluator.ts +24 -16
- package/src/hooks/policy-presets.ts +4 -2
- package/src/hooks/policy-registry.ts +8 -2
- package/src/hooks/policy-types.ts +26 -0
- package/src/hooks/session-pause-cli.ts +33 -9
- package/src/hooks/tui.ts +570 -0
- package/src/hooks/types.ts +15 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_usx0j._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_zk340._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0agdw2a._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0d1u_na._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0oy4kxb._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0zf034w._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1tvn4wf._.js +0 -3
- package/.next/standalone/.next/server/chunks/_0lxbzdq._.js +0 -3
- package/.next/standalone/.next/server/chunks/_1ger0a2._.js +0 -3
- package/.next/standalone/.next/server/chunks/_1zuiiy3._.js +0 -3
- package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_1iiwm5e._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0kc8_v5._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0kgy9da._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0mhqk5a._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0pltpn8._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0qkcyf-._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0w0x_ok._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1_dfocn._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1bfex62._.js +0 -5
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1kzapg5._.js +0 -6
- package/.next/standalone/.next/static/chunks/36fw6yk1s6x_f.js +0 -1
- package/.next/standalone/.next/static/chunks/3tzq0260n17ae.js +0 -6
- package/.next/standalone/.next/static/chunks/3wq9x0c-7ld5d.css +0 -2
- /package/.next/standalone/.next/static/{ZklXxyA5ygsWSQz2u_zii → nwbyWT06Ud0XdXOrVJyvS}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{ZklXxyA5ygsWSQz2u_zii → nwbyWT06Ud0XdXOrVJyvS}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{ZklXxyA5ygsWSQz2u_zii → nwbyWT06Ud0XdXOrVJyvS}/_ssgManifest.js +0 -0
package/src/hooks/tui.ts
CHANGED
|
@@ -357,6 +357,7 @@ export function renderLaunchBanner(version: string, stdout: TTYOut = process.std
|
|
|
357
357
|
row("star", c.dim("https://github.com/failproofai/failproofai")),
|
|
358
358
|
row("docs", c.dim("https://docs.befailproof.ai/introduction")),
|
|
359
359
|
row("discord", c.dim("https://discord.befailproof.ai/")),
|
|
360
|
+
row("reddit", c.dim("https://www.reddit.com/r/failproofai/")),
|
|
360
361
|
"",
|
|
361
362
|
];
|
|
362
363
|
}
|
|
@@ -901,3 +902,572 @@ export function promptText(opts: PromptTextOptions): Promise<string | null> {
|
|
|
901
902
|
stdin.on("keypress", onKey);
|
|
902
903
|
});
|
|
903
904
|
}
|
|
905
|
+
|
|
906
|
+
// ── the kit ──────────────────────────────────────────────────────────────────
|
|
907
|
+
/**
|
|
908
|
+
* The block builders every PRINTED surface is assembled from.
|
|
909
|
+
*
|
|
910
|
+
* The prompts above dress the wizard. Everything else the CLI prints grew its
|
|
911
|
+
* own dialect instead: `policies` renders a table with `── rules ──` and colored
|
|
912
|
+
* chips, `pack list` and `harness list` print a bare sentence plus an indented
|
|
913
|
+
* example, `config --status` opens with a prose line and then label/value rows at
|
|
914
|
+
* label width 9, `audit --status` indents by three and misaligns its own value
|
|
915
|
+
* column (col 21 on the first row, 18 on the rest, plus a whitespace-only line),
|
|
916
|
+
* and `uninstall` prints `•` bullets with no header and no color at all. Six
|
|
917
|
+
* answers to "how does this product state a fact".
|
|
918
|
+
*
|
|
919
|
+
* These are the one answer. Every builder is pure — `(spec, opts) => string[]` —
|
|
920
|
+
* so a surface can be asserted at any width, with color on or off, without a pty;
|
|
921
|
+
* that is the same shape `renderBrandLogo`, `reviewLines` and `buildSummary`
|
|
922
|
+
* already have, and the reason they are the only rendering we can currently test.
|
|
923
|
+
*
|
|
924
|
+
* Callers pass `optsFor(stdout)` and print with `printBlock`, which owns the
|
|
925
|
+
* outer margins so no surface has to remember them.
|
|
926
|
+
*/
|
|
927
|
+
|
|
928
|
+
/** Every printed line starts here. Two spaces, never three. */
|
|
929
|
+
export const INDENT = " ";
|
|
930
|
+
|
|
931
|
+
export interface RenderOpts {
|
|
932
|
+
/** Terminal width. Defaults to 80 so a piped or asserted render is deterministic. */
|
|
933
|
+
cols?: number;
|
|
934
|
+
/** Whether to emit ANSI at all. Defaults to OFF — colour is opt-in via `optsFor`. */
|
|
935
|
+
color?: boolean;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
function ctx(opts?: RenderOpts): { cols: number; c: ReturnType<typeof paint> } {
|
|
939
|
+
return { cols: Math.max(20, opts?.cols ?? 80), c: paint(opts?.color ?? false) };
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
/** Derive render options from a real stream, honouring NO_COLOR and non-TTY. */
|
|
943
|
+
export function optsFor(stdout: TTYOut = process.stdout): Required<RenderOpts> {
|
|
944
|
+
return { cols: stdout.columns || 80, color: colorsEnabled(stdout) };
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
/** Visible width of a line, skipping ANSI CSI sequences — the counterpart to
|
|
948
|
+
* `truncate`, needed wherever a column has to line up under coloured content. */
|
|
949
|
+
export function visibleWidth(line: string): number {
|
|
950
|
+
let width = 0;
|
|
951
|
+
let i = 0;
|
|
952
|
+
while (i < line.length) {
|
|
953
|
+
if (line[i] === ESC && line[i + 1] === "[") {
|
|
954
|
+
let j = i + 2;
|
|
955
|
+
while (j < line.length && !/[A-Za-z]/.test(line[j])) j++;
|
|
956
|
+
i = j + 1;
|
|
957
|
+
} else {
|
|
958
|
+
width++;
|
|
959
|
+
i++;
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
return width;
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
/** Wrap PLAIN text to `width`. A single word longer than the budget (a path, a
|
|
966
|
+
* URL) overflows its own line rather than being broken — a split path is worse
|
|
967
|
+
* than a long one, because it cannot be copied. */
|
|
968
|
+
export function wrap(text: string, width: number): string[] {
|
|
969
|
+
if (width <= 0) return [text];
|
|
970
|
+
const words = text.split(/\s+/).filter(Boolean);
|
|
971
|
+
if (words.length === 0) return [];
|
|
972
|
+
const out: string[] = [];
|
|
973
|
+
let line = "";
|
|
974
|
+
for (const word of words) {
|
|
975
|
+
if (!line) line = word;
|
|
976
|
+
else if (line.length + 1 + word.length <= width) line += ` ${word}`;
|
|
977
|
+
else {
|
|
978
|
+
out.push(line);
|
|
979
|
+
line = word;
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
if (line) out.push(line);
|
|
983
|
+
return out;
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
/** One visible character plus whatever SGR codes are in effect at it. */
|
|
987
|
+
interface AnsiCell {
|
|
988
|
+
ch: string;
|
|
989
|
+
active: string;
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
function toAnsiCells(text: string): AnsiCell[] {
|
|
993
|
+
const cells: AnsiCell[] = [];
|
|
994
|
+
let active = "";
|
|
995
|
+
let i = 0;
|
|
996
|
+
while (i < text.length) {
|
|
997
|
+
if (text[i] === ESC && text[i + 1] === "[") {
|
|
998
|
+
let j = i + 2;
|
|
999
|
+
while (j < text.length && !/[A-Za-z]/.test(text[j])) j++;
|
|
1000
|
+
const code = text.slice(i, j + 1);
|
|
1001
|
+
// A reset clears everything; anything else stacks on top.
|
|
1002
|
+
active = /\[0?m$/.test(code) ? "" : active + code;
|
|
1003
|
+
i = j + 1;
|
|
1004
|
+
} else {
|
|
1005
|
+
cells.push({ ch: text[i], active });
|
|
1006
|
+
i++;
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
return cells;
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
function renderAnsiCells(line: AnsiCell[]): string {
|
|
1013
|
+
let out = "";
|
|
1014
|
+
let active = "";
|
|
1015
|
+
for (const cell of line) {
|
|
1016
|
+
if (cell.active !== active) {
|
|
1017
|
+
if (active) out += ANSI_RESET;
|
|
1018
|
+
out += cell.active;
|
|
1019
|
+
active = cell.active;
|
|
1020
|
+
}
|
|
1021
|
+
out += cell.ch;
|
|
1022
|
+
}
|
|
1023
|
+
// Every produced line closes what it opened. A line that ends mid-SGR bleeds
|
|
1024
|
+
// its colour into everything printed after it.
|
|
1025
|
+
return active ? out + ANSI_RESET : out;
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
/**
|
|
1029
|
+
* Wrap text that carries colour, on visible width.
|
|
1030
|
+
*
|
|
1031
|
+
* `wrap` counts escape bytes as characters, so a coloured value used to be
|
|
1032
|
+
* handed back unwrapped — and then `writeLines` cut it at the terminal edge with
|
|
1033
|
+
* `truncate`, which stops at the first plain character past the limit. That lost
|
|
1034
|
+
* the tail of the sentence with no ellipsis to say so, AND dropped the closing
|
|
1035
|
+
* reset, so the colour ran on into every line that followed. Both were
|
|
1036
|
+
* reproduced on `audit --status` at 80 columns.
|
|
1037
|
+
*/
|
|
1038
|
+
export function wrapAnsi(text: string, width: number): string[] {
|
|
1039
|
+
if (width <= 0) return [text];
|
|
1040
|
+
if (!text.includes(ESC)) return wrap(text, width);
|
|
1041
|
+
const words: AnsiCell[][] = [];
|
|
1042
|
+
let word: AnsiCell[] = [];
|
|
1043
|
+
for (const cell of toAnsiCells(text)) {
|
|
1044
|
+
if (/\s/.test(cell.ch)) {
|
|
1045
|
+
if (word.length > 0) words.push(word);
|
|
1046
|
+
word = [];
|
|
1047
|
+
} else {
|
|
1048
|
+
word.push(cell);
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
if (word.length > 0) words.push(word);
|
|
1052
|
+
|
|
1053
|
+
const lines: string[] = [];
|
|
1054
|
+
let line: AnsiCell[] = [];
|
|
1055
|
+
for (const next of words) {
|
|
1056
|
+
if (line.length > 0 && line.length + 1 + next.length > width) {
|
|
1057
|
+
lines.push(renderAnsiCells(line));
|
|
1058
|
+
line = [...next];
|
|
1059
|
+
continue;
|
|
1060
|
+
}
|
|
1061
|
+
if (line.length > 0) line.push({ ch: " ", active: line[line.length - 1].active });
|
|
1062
|
+
line.push(...next);
|
|
1063
|
+
}
|
|
1064
|
+
if (line.length > 0) lines.push(renderAnsiCells(line));
|
|
1065
|
+
return lines;
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
/** Close any SGR a hard cut left open, for the same reason. */
|
|
1069
|
+
function closeSgr(text: string): string {
|
|
1070
|
+
const cells = toAnsiCells(text);
|
|
1071
|
+
const last = cells[cells.length - 1];
|
|
1072
|
+
return last && last.active ? text + ANSI_RESET : text;
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
/** Fit one cell to `width`: ANSI-safe hard cut when it carries colour, a proper
|
|
1076
|
+
* single-ellipsis cut when it is plain. */
|
|
1077
|
+
function fit(cell: string, width: number): string {
|
|
1078
|
+
if (visibleWidth(cell) <= width) return cell;
|
|
1079
|
+
return cell.includes(ESC) ? closeSgr(truncate(cell, width)) : ellipsize(cell, width);
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
/** Pad a possibly-coloured cell to `width` visible columns. */
|
|
1083
|
+
function pad(cell: string, width: number, align: "left" | "right" = "left"): string {
|
|
1084
|
+
const gap = Math.max(0, width - visibleWidth(cell));
|
|
1085
|
+
return align === "right" ? " ".repeat(gap) + cell : cell + " ".repeat(gap);
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
/**
|
|
1089
|
+
* Join blocks with exactly one blank line between them.
|
|
1090
|
+
*
|
|
1091
|
+
* This is blank-line discipline as code rather than as a rule people remember:
|
|
1092
|
+
* whitespace-only lines normalise to empty, two blanks never survive next to
|
|
1093
|
+
* each other, and a block cannot open with one. `audit --status` prints a line
|
|
1094
|
+
* containing a single space today; assembled through here it cannot.
|
|
1095
|
+
*/
|
|
1096
|
+
export function stack(...groups: Array<string[] | null | undefined>): string[] {
|
|
1097
|
+
const out: string[] = [];
|
|
1098
|
+
for (const group of groups) {
|
|
1099
|
+
if (!group || group.length === 0) continue;
|
|
1100
|
+
const body: string[] = [];
|
|
1101
|
+
for (const line of group) {
|
|
1102
|
+
const normalised = line.trim() === "" ? "" : line;
|
|
1103
|
+
if (normalised === "" && (body.length === 0 || body[body.length - 1] === "")) continue;
|
|
1104
|
+
body.push(normalised);
|
|
1105
|
+
}
|
|
1106
|
+
while (body.length > 0 && body[body.length - 1] === "") body.pop();
|
|
1107
|
+
if (body.length === 0) continue;
|
|
1108
|
+
if (out.length > 0) out.push("");
|
|
1109
|
+
out.push(...body);
|
|
1110
|
+
}
|
|
1111
|
+
return out;
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
/**
|
|
1115
|
+
* Print an assembled block with its outer margins. One place decides them.
|
|
1116
|
+
*
|
|
1117
|
+
* Deliberately NOT `writeLines`, which truncates each line to the terminal
|
|
1118
|
+
* width. Every builder above already fits its content, so the only lines that
|
|
1119
|
+
* can exceed the width are ones holding a token that cannot be broken — a path,
|
|
1120
|
+
* a URL, a session id. Cutting those loses characters silently and with no
|
|
1121
|
+
* ellipsis to admit it; letting the terminal wrap keeps them copyable, which is
|
|
1122
|
+
* the entire reason they are printed.
|
|
1123
|
+
*/
|
|
1124
|
+
export function printBlock(stdout: TTYOut, lines: string[]): void {
|
|
1125
|
+
if (lines.length === 0) return;
|
|
1126
|
+
stdout.write(["", ...lines.map(closeSgr), ""].join("\n") + "\n");
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
/**
|
|
1130
|
+
* The heading every surface opens with: what you are looking at, and the state
|
|
1131
|
+
* it describes, right-aligned and dim.
|
|
1132
|
+
*
|
|
1133
|
+
* Six of our printed surfaces open with nothing at all, so output arrives with
|
|
1134
|
+
* no statement of what it is — which is survivable on a screen you asked for and
|
|
1135
|
+
* confusing in scrollback next to five other commands.
|
|
1136
|
+
*/
|
|
1137
|
+
export function title(name: string, meta?: string, opts?: RenderOpts): string[] {
|
|
1138
|
+
const { cols, c } = ctx(opts);
|
|
1139
|
+
const left = `${INDENT}${c.bold(name)}`;
|
|
1140
|
+
if (!meta) return [left];
|
|
1141
|
+
const right = c.dim(meta);
|
|
1142
|
+
const gap = cols - visibleWidth(left) - visibleWidth(right) - INDENT.length;
|
|
1143
|
+
// Too narrow to sit on one line: drop it under rather than let it wrap into
|
|
1144
|
+
// the middle of the heading, where it reads as a second, broken title.
|
|
1145
|
+
if (gap < 2) return [left, `${INDENT}${c.dim(meta)}`];
|
|
1146
|
+
return [left + " ".repeat(gap) + right];
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
/** A section divider — the `── Convention Policies ──────` shape `policies`
|
|
1150
|
+
* already uses, available to every surface instead of one. */
|
|
1151
|
+
export function rule(label?: string, opts?: RenderOpts): string[] {
|
|
1152
|
+
const { cols, c } = ctx(opts);
|
|
1153
|
+
const width = Math.max(4, cols - INDENT.length * 2);
|
|
1154
|
+
if (!label) return [`${INDENT}${c.dim("─".repeat(width))}`];
|
|
1155
|
+
const head = `── ${label} `;
|
|
1156
|
+
const tail = Math.max(3, width - head.length);
|
|
1157
|
+
return [`${INDENT}${c.dim(head + "─".repeat(tail))}`];
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
export interface Row {
|
|
1161
|
+
label: string;
|
|
1162
|
+
value: string;
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
/**
|
|
1166
|
+
* Label/value rows on ONE computed column.
|
|
1167
|
+
*
|
|
1168
|
+
* The column is derived from the widest label in the block and never hardcoded,
|
|
1169
|
+
* which is the entire fix for `audit --status` printing its first row's value at
|
|
1170
|
+
* column 21 and the rest at 18 — two hand-counted paddings in one block, in the
|
|
1171
|
+
* same file.
|
|
1172
|
+
*/
|
|
1173
|
+
export function rows(items: Array<Row | [string, string]>, opts?: RenderOpts): string[] {
|
|
1174
|
+
const { cols, c } = ctx(opts);
|
|
1175
|
+
const pairs = items.map((item) =>
|
|
1176
|
+
Array.isArray(item) ? { label: item[0], value: item[1] } : item,
|
|
1177
|
+
);
|
|
1178
|
+
if (pairs.length === 0) return [];
|
|
1179
|
+
// The column grows to the widest label and the label is NEVER cut. It used to
|
|
1180
|
+
// be capped at 24 and ellipsized, which quietly ate the pause session id —
|
|
1181
|
+
// the one string `--resume --session <id>` needs, printed nowhere else. Half
|
|
1182
|
+
// an id is not a shorter fact, it is an unusable one; a label past the cap
|
|
1183
|
+
// takes its own line instead, so the value column survives.
|
|
1184
|
+
const widest = Math.max(...pairs.map((p) => visibleWidth(p.label)));
|
|
1185
|
+
const labelWidth = Math.min(widest, Math.max(12, Math.floor((cols - INDENT.length * 2) / 2)));
|
|
1186
|
+
const valueBudget = Math.max(8, cols - INDENT.length * 2 - labelWidth - 2);
|
|
1187
|
+
const out: string[] = [];
|
|
1188
|
+
for (const { label, value } of pairs) {
|
|
1189
|
+
if (visibleWidth(label) > labelWidth) {
|
|
1190
|
+
out.push(`${INDENT}${c.dim(label)}`);
|
|
1191
|
+
for (const extra of wrapAnsi(value, valueBudget)) {
|
|
1192
|
+
out.push(" ".repeat(INDENT.length + labelWidth + 2) + extra);
|
|
1193
|
+
}
|
|
1194
|
+
continue;
|
|
1195
|
+
}
|
|
1196
|
+
const gutter = `${INDENT}${pad(c.dim(label), labelWidth)} `;
|
|
1197
|
+
const hang = " ".repeat(visibleWidth(gutter));
|
|
1198
|
+
// Wrapped with a hanging indent rather than cut. Cutting looks tidier and is
|
|
1199
|
+
// worse: these values are URLs, machine ids and paths, and half of one is
|
|
1200
|
+
// not a shorter fact, it is an unusable one. Neither `wrap` nor `wrapAnsi`
|
|
1201
|
+
// splits a single token, so a long URL survives whole on its own line — the
|
|
1202
|
+
// only case that can still pass the right edge, and the right trade.
|
|
1203
|
+
const wrapped = wrapAnsi(value, valueBudget);
|
|
1204
|
+
if (wrapped.length === 0) {
|
|
1205
|
+
out.push(gutter.trimEnd());
|
|
1206
|
+
continue;
|
|
1207
|
+
}
|
|
1208
|
+
out.push(gutter + wrapped[0]);
|
|
1209
|
+
for (const extra of wrapped.slice(1)) out.push(hang + extra);
|
|
1210
|
+
}
|
|
1211
|
+
return out;
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
/** A row, optionally with dim continuation lines under it — configured params,
|
|
1215
|
+
* a policy hint, the reason a file would not load. */
|
|
1216
|
+
export interface TableRow {
|
|
1217
|
+
cells: string[];
|
|
1218
|
+
notes?: string[];
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
/** A heading between rows. Widths are computed across the WHOLE table, so the
|
|
1222
|
+
* columns line up through every section instead of jumping at each one — which
|
|
1223
|
+
* is what a table-per-section does, along with repeating the column labels. */
|
|
1224
|
+
export interface TableSection {
|
|
1225
|
+
section: string;
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
export interface TableSpec {
|
|
1229
|
+
head: string[];
|
|
1230
|
+
rows: Array<string[] | TableRow | TableSection>;
|
|
1231
|
+
/** Per-column alignment. Numbers read right, everything else left. */
|
|
1232
|
+
align?: Array<"left" | "right">;
|
|
1233
|
+
/** Which column absorbs the leftover width (default: the last). */
|
|
1234
|
+
flex?: number;
|
|
1235
|
+
/**
|
|
1236
|
+
* Columns the shrink pass may not touch. The second pass takes width from the
|
|
1237
|
+
* WIDEST column, which in a path table is the path — cutting the one value the
|
|
1238
|
+
* listing exists to hand back to the user.
|
|
1239
|
+
*/
|
|
1240
|
+
protect?: number[];
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
/** The `policies` table, available to every surface that lists things. */
|
|
1244
|
+
export function table(spec: TableSpec, opts?: RenderOpts): string[] {
|
|
1245
|
+
const { cols, c } = ctx(opts);
|
|
1246
|
+
const count = spec.head.length;
|
|
1247
|
+
if (count === 0) return [];
|
|
1248
|
+
const flex = spec.flex ?? count - 1;
|
|
1249
|
+
const body: Array<TableRow | TableSection> = spec.rows.map((r) =>
|
|
1250
|
+
Array.isArray(r) ? { cells: r } : r,
|
|
1251
|
+
);
|
|
1252
|
+
const dataRows = body.filter((r): r is TableRow => "cells" in r);
|
|
1253
|
+
const natural = spec.head.map((h, i) =>
|
|
1254
|
+
Math.max(visibleWidth(h), ...dataRows.map((r) => visibleWidth(r.cells[i] ?? ""))),
|
|
1255
|
+
);
|
|
1256
|
+
const budget = cols - INDENT.length * 2 - (count - 1) * 2;
|
|
1257
|
+
// The flex column gives way first, and only when it has nothing left to give
|
|
1258
|
+
// do the others shrink — widest first, so a narrow terminal costs the column
|
|
1259
|
+
// that can most afford it. Without the second pass a single long cell (a path,
|
|
1260
|
+
// a description) pushed the whole row past the terminal edge, which is the
|
|
1261
|
+
// overrun this kit exists to end.
|
|
1262
|
+
let overflow = natural.reduce((a, b) => a + b, 0) - budget;
|
|
1263
|
+
if (overflow > 0) {
|
|
1264
|
+
const give = Math.min(overflow, Math.max(0, natural[flex] - 8));
|
|
1265
|
+
natural[flex] -= give;
|
|
1266
|
+
overflow -= give;
|
|
1267
|
+
}
|
|
1268
|
+
const protectedCols = new Set(spec.protect ?? []);
|
|
1269
|
+
while (overflow > 0) {
|
|
1270
|
+
let widest = -1;
|
|
1271
|
+
for (let i = 0; i < natural.length; i += 1) {
|
|
1272
|
+
if (protectedCols.has(i) || natural[i] <= 4) continue;
|
|
1273
|
+
if (widest === -1 || natural[i] > natural[widest]) widest = i;
|
|
1274
|
+
}
|
|
1275
|
+
// Everything left is protected or already at its floor: leave the row long
|
|
1276
|
+
// and let the terminal wrap it rather than cut a protected value.
|
|
1277
|
+
if (widest === -1) break;
|
|
1278
|
+
natural[widest] -= 1;
|
|
1279
|
+
overflow -= 1;
|
|
1280
|
+
}
|
|
1281
|
+
const line = (cells: string[]) =>
|
|
1282
|
+
INDENT +
|
|
1283
|
+
cells
|
|
1284
|
+
.map((cell, i) => pad(fit(cell, natural[i]), natural[i], spec.align?.[i] ?? "left"))
|
|
1285
|
+
.join(" ")
|
|
1286
|
+
.trimEnd();
|
|
1287
|
+
// Notes hang under the row's LAST fixed column — i.e. where the name starts —
|
|
1288
|
+
// so a hint reads as belonging to its row rather than to the table.
|
|
1289
|
+
const noteIndent =
|
|
1290
|
+
INDENT.length + natural.slice(0, Math.max(0, flex - 1)).reduce((a, b) => a + b + 2, 0);
|
|
1291
|
+
// All-empty headings mean a table that does not want a header row: repeating
|
|
1292
|
+
// column labels above every section is chrome, not content.
|
|
1293
|
+
const wantsHead = spec.head.some((h) => h.length > 0);
|
|
1294
|
+
const out = wantsHead ? [line(spec.head.map((h) => c.dim(h))), ...rule(undefined, opts)] : [];
|
|
1295
|
+
for (const row of body) {
|
|
1296
|
+
if ("section" in row) {
|
|
1297
|
+
if (out.length > 0) out.push("");
|
|
1298
|
+
out.push(...rule(row.section, opts));
|
|
1299
|
+
continue;
|
|
1300
|
+
}
|
|
1301
|
+
out.push(line(row.cells));
|
|
1302
|
+
for (const n of row.notes ?? []) {
|
|
1303
|
+
for (const wrapped of wrap(n, Math.max(8, cols - noteIndent - INDENT.length))) {
|
|
1304
|
+
out.push(" ".repeat(noteIndent) + c.dim(wrapped));
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
return out;
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
/** Every state a listed thing can be in. Symbol AND colour, never colour alone,
|
|
1312
|
+
* so the list still reads under NO_COLOR and for a red/green-blind reader. */
|
|
1313
|
+
export type ChipState =
|
|
1314
|
+
| "on"
|
|
1315
|
+
| "off"
|
|
1316
|
+
| "mixed"
|
|
1317
|
+
| "locked"
|
|
1318
|
+
| "cloud"
|
|
1319
|
+
| "pack"
|
|
1320
|
+
| "failed"
|
|
1321
|
+
| "observe";
|
|
1322
|
+
|
|
1323
|
+
const CHIP_LABELS: Record<ChipState, string> = {
|
|
1324
|
+
on: "✓ ON",
|
|
1325
|
+
off: "· OFF",
|
|
1326
|
+
// A convention FILE holds several hooks and some of them can be disabled
|
|
1327
|
+
// individually, so "on" and "off" cannot describe it between them.
|
|
1328
|
+
mixed: "◐ MIXED",
|
|
1329
|
+
locked: "✓ LOCK",
|
|
1330
|
+
cloud: "✓ CLOUD",
|
|
1331
|
+
pack: "✓ PACK",
|
|
1332
|
+
failed: "⚠ FAIL",
|
|
1333
|
+
observe: "◉ OBS",
|
|
1334
|
+
};
|
|
1335
|
+
|
|
1336
|
+
/** Width of the widest chip, so a column of them lines up without the caller
|
|
1337
|
+
* knowing which states it happens to contain. */
|
|
1338
|
+
export const CHIP_WIDTH = Math.max(...Object.values(CHIP_LABELS).map((l) => l.length));
|
|
1339
|
+
|
|
1340
|
+
export function chip(state: ChipState, opts?: RenderOpts): string {
|
|
1341
|
+
const { c } = ctx(opts);
|
|
1342
|
+
const label = CHIP_LABELS[state];
|
|
1343
|
+
const painted =
|
|
1344
|
+
state === "on" || state === "pack"
|
|
1345
|
+
? c.pink(label)
|
|
1346
|
+
: state === "failed" || state === "mixed"
|
|
1347
|
+
? c.warn(label)
|
|
1348
|
+
: state === "cloud" || state === "observe"
|
|
1349
|
+
? c.guide(label)
|
|
1350
|
+
: c.dim(label);
|
|
1351
|
+
return pad(painted, CHIP_WIDTH);
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
/** A bulleted list, wrapped, with continuation lines aligned under the text —
|
|
1355
|
+
* `uninstall` prints 200-column bullets today that wrap into column 0. */
|
|
1356
|
+
export function bullets(items: string[], opts?: RenderOpts): string[] {
|
|
1357
|
+
const { cols, c } = ctx(opts);
|
|
1358
|
+
const budget = Math.max(8, cols - INDENT.length - 4);
|
|
1359
|
+
const out: string[] = [];
|
|
1360
|
+
for (const item of items) {
|
|
1361
|
+
const [first, ...rest] = wrap(item, budget);
|
|
1362
|
+
if (first === undefined) continue;
|
|
1363
|
+
out.push(`${INDENT}${c.pink("•")} ${first}`);
|
|
1364
|
+
for (const line of rest) out.push(`${INDENT} ${line}`);
|
|
1365
|
+
}
|
|
1366
|
+
return out;
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
/** A dim aside under a block. */
|
|
1370
|
+
export function note(text: string, opts?: RenderOpts): string[] {
|
|
1371
|
+
const { cols, c } = ctx(opts);
|
|
1372
|
+
return wrap(text, Math.max(8, cols - INDENT.length * 2)).map((l) => `${INDENT}${c.dim(l)}`);
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
/**
|
|
1376
|
+
* "Here is the command to run next" — the single most repeated shape in the CLI
|
|
1377
|
+
* and, today, invented separately by `policies`, `pack list` and `harness list`.
|
|
1378
|
+
*/
|
|
1379
|
+
export function nextStep(cmd: string, why?: string, opts?: RenderOpts): string[] {
|
|
1380
|
+
const { c } = ctx(opts);
|
|
1381
|
+
const out: string[] = [];
|
|
1382
|
+
if (why) out.push(...note(why, opts));
|
|
1383
|
+
out.push(`${INDENT}${INDENT}${c.pink(cmd)}`);
|
|
1384
|
+
return out;
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
function gutterBlock(symbol: string, lines: string[], opts?: RenderOpts): string[] {
|
|
1388
|
+
const { cols } = ctx(opts);
|
|
1389
|
+
const budget = Math.max(8, cols - INDENT.length - 3);
|
|
1390
|
+
const out: string[] = [];
|
|
1391
|
+
for (const line of lines) {
|
|
1392
|
+
for (const wrapped of wrap(line, budget)) {
|
|
1393
|
+
out.push(out.length === 0 ? `${INDENT}${symbol} ${wrapped}` : `${INDENT} ${wrapped}`);
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
return out;
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
/** Amber gutter. One shape for every warning, whether it is two lines about
|
|
1400
|
+
* scopes or six about the daemon. */
|
|
1401
|
+
export function warning(lines: string[], opts?: RenderOpts): string[] {
|
|
1402
|
+
const { c } = ctx(opts);
|
|
1403
|
+
return gutterBlock(c.warn("⚠"), lines, opts);
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
/** The same, for the ones that destroy something. */
|
|
1407
|
+
export function danger(lines: string[], opts?: RenderOpts): string[] {
|
|
1408
|
+
const { c } = ctx(opts);
|
|
1409
|
+
return gutterBlock(c.pink("!"), lines, opts);
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1412
|
+
/** Nothing to show, said the same way everywhere: what is empty, then the one
|
|
1413
|
+
* command that changes that. */
|
|
1414
|
+
export function emptyState(
|
|
1415
|
+
spec: { what: string; hint?: string; cmd?: string },
|
|
1416
|
+
opts?: RenderOpts,
|
|
1417
|
+
): string[] {
|
|
1418
|
+
return stack(note(spec.what, opts), spec.cmd ? nextStep(spec.cmd, spec.hint, opts) : null);
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
export interface HelpSpec {
|
|
1422
|
+
usage: Array<[string, string?]>;
|
|
1423
|
+
options?: Array<[string, string]>;
|
|
1424
|
+
examples?: string[];
|
|
1425
|
+
/** Free lines under the heading, before USAGE. */
|
|
1426
|
+
lead?: string[];
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
/**
|
|
1430
|
+
* One shape for all five help screens.
|
|
1431
|
+
*
|
|
1432
|
+
* `policy --help`, `audit --help`, `pack --help`, `harness --help` and the top
|
|
1433
|
+
* level each position their description column differently and indent
|
|
1434
|
+
* differently, so reading two of them in a row feels like two products. The
|
|
1435
|
+
* column is computed here from the widest entry, capped so a long flag cannot
|
|
1436
|
+
* push every description off the right edge.
|
|
1437
|
+
*/
|
|
1438
|
+
export function helpBlock(spec: HelpSpec, opts?: RenderOpts): string[] {
|
|
1439
|
+
const { cols, c } = ctx(opts);
|
|
1440
|
+
const entries = [...spec.usage.map(([n]) => n), ...(spec.options ?? []).map(([n]) => n)];
|
|
1441
|
+
const nameWidth = Math.min(34, Math.max(12, ...entries.map((n) => n.length)));
|
|
1442
|
+
const section = (heading: string, body: string[]): string[] =>
|
|
1443
|
+
body.length === 0 ? [] : [c.dim(heading), ...body];
|
|
1444
|
+
const entryLines = (items: Array<[string, string?]>): string[] => {
|
|
1445
|
+
const out: string[] = [];
|
|
1446
|
+
for (const [name, description] of items) {
|
|
1447
|
+
if (!description) {
|
|
1448
|
+
out.push(`${INDENT}${name}`);
|
|
1449
|
+
continue;
|
|
1450
|
+
}
|
|
1451
|
+
const budget = Math.max(12, cols - INDENT.length * 2 - nameWidth - 2);
|
|
1452
|
+
const [first, ...rest] = wrap(description, budget);
|
|
1453
|
+
// A name wider than the column takes its own line rather than shoving the
|
|
1454
|
+
// description out — the top-level help has several of these today.
|
|
1455
|
+
if (name.length > nameWidth) {
|
|
1456
|
+
out.push(`${INDENT}${name}`);
|
|
1457
|
+
for (const line of [first, ...rest]) {
|
|
1458
|
+
if (line !== undefined) out.push(`${INDENT}${" ".repeat(nameWidth)} ${c.dim(line)}`);
|
|
1459
|
+
}
|
|
1460
|
+
continue;
|
|
1461
|
+
}
|
|
1462
|
+
out.push(`${INDENT}${name.padEnd(nameWidth)} ${c.dim(first ?? "")}`);
|
|
1463
|
+
for (const line of rest) out.push(`${INDENT}${" ".repeat(nameWidth)} ${c.dim(line)}`);
|
|
1464
|
+
}
|
|
1465
|
+
return out;
|
|
1466
|
+
};
|
|
1467
|
+
return stack(
|
|
1468
|
+
spec.lead ? spec.lead.map((l) => `${INDENT}${l}`) : null,
|
|
1469
|
+
section("USAGE", entryLines(spec.usage)),
|
|
1470
|
+
section("OPTIONS", entryLines(spec.options ?? [])),
|
|
1471
|
+
section("EXAMPLES", (spec.examples ?? []).map((e) => `${INDENT}${e}`)),
|
|
1472
|
+
);
|
|
1473
|
+
}
|
package/src/hooks/types.ts
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Constants and interfaces for agent
|
|
2
|
+
* Constants and interfaces for agent harness hook integrations.
|
|
3
|
+
*
|
|
4
|
+
* A harness is whatever an agent runs inside. The twelve below are two classes:
|
|
5
|
+
* ten coding CLIs (Claude Code, Codex, Copilot, Cursor, OpenCode, Pi, Factory,
|
|
6
|
+
* Devin, Antigravity, Goose) and two chat/assistant gateways (Hermes, OpenClaw).
|
|
7
|
+
*
|
|
8
|
+
* An agent instrumented directly via the Python SDK is NOT one of these twelve
|
|
9
|
+
* and is not a third class here: the SDK reports events, it does not sit in the
|
|
10
|
+
* tool-call path, so it delivers observability without enforcement. Copy that
|
|
11
|
+
* lists it alongside the twelve overstates what it does.
|
|
12
|
+
*
|
|
13
|
+
* INTEGRATION_TYPES below is the authoritative list:
|
|
14
|
+
* __tests__/scripts/copy-counts.test.ts pins its length, and the policy, event
|
|
15
|
+
* and enforcement counts, against the harness and policy counts stated in
|
|
16
|
+
* README.md, package.json and docs/index.mdx.
|
|
3
17
|
*/
|
|
4
18
|
|
|
5
19
|
export const HOOK_SCOPES = ["user", "project", "local"] as const;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},20635,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},59043,(e,t,r)=>{t.exports=e.x("next/dist/server/runtime-reacts.external.js",()=>require("next/dist/server/runtime-reacts.external.js"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},74533,(e,t,r)=>{t.exports=e.x("node:child_process",()=>require("node:child_process"))},66680,(e,t,r)=>{t.exports=e.x("node:crypto",()=>require("node:crypto"))},2157,(e,t,r)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},60526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},81111,(e,t,r)=>{t.exports=e.x("node:stream",()=>require("node:stream"))},94930,e=>{"use strict";var t=e.i(2157),r=e.i(50227),n=e.i(66680);e.s(["writeJsonAtomically",0,function(e,s,o={}){let a=o.mode??384,i=o.dirMode??448,c=(0,r.dirname)(e);(0,t.existsSync)(c)||(0,t.mkdirSync)(c,{recursive:!0,mode:i});let u=`${e}.${process.pid}.${(0,n.randomBytes)(6).toString("hex")}.tmp`;try{(0,t.writeFileSync)(u,JSON.stringify(s,null,2),{mode:a});try{(63&(0,t.statSync)(u).mode)!=0&&(0,t.chmodSync)(u,a)}catch{}(0,t.renameSync)(u,e);try{(63&(0,t.statSync)(e).mode)!=0&&(0,t.chmodSync)(e,a)}catch{}}catch(e){try{(0,t.rmSync)(u,{force:!0})}catch{}throw e}}])},6375,e=>{"use strict";var t=e.i(46501);function r(){return(process.env.FAILPROOF_API_URL??process.env.FAILPROOFAI_API_URL??"https://api.befailproof.ai").replace(/\/+$/,"")}class n extends Error{status;code;retryAfterSecs;constructor(e,t,r,n){super(r),this.status=e,this.code=t,this.retryAfterSecs=n,this.name="AuthApiError"}}async function s(e){let t={};try{t=await e.json()}catch{}let r=t.code??`http_${e.status}`,s=t.message??t.detail??e.statusText??"request failed",o=t.retry_after_secs;if(void 0===o){let t=e.headers.get("retry-after");if(t){let e=Number(t);Number.isFinite(e)&&(o=e)}}return void 0!==o&&(o=Math.max(0,Math.min(86400,o))),new n(e.status,r,s,o)}async function o(e,r){try{return await fetch(e,{...r,signal:function(e){let t=AbortSignal.timeout(1e4);if(!e)return t;let r=AbortSignal.any;if(r)return r([t,e]);let n=new AbortController;if(t.aborted)n.abort(t.reason);else t.addEventListener("abort",()=>n.abort(t.reason),{once:!0});if(e.aborted)n.abort(e.reason);else e.addEventListener("abort",()=>n.abort(e.reason),{once:!0});return n.signal}(r.signal??void 0)})}catch(o){let s=function(e){if(null===e||"object"!=typeof e)return!1;let t=e.name;return"AbortError"===t||"TimeoutError"===t}(o);if((0,t.trackEvent)("api_server_unreachable",{kind:s?"timeout":"network",path:function(e){try{return new URL(e).pathname}catch{return e}}(e),method:"string"==typeof r.method?r.method:"GET"}),s)throw new n(0,"timeout",`request to ${e} timed out after 10000ms`);throw o}}async function a(e,t,n){let a={"content-type":"application/json"};n?.accessToken&&(a.authorization=`Bearer ${n.accessToken}`);let i=await o(`${r()}${e}`,{method:"POST",headers:a,body:JSON.stringify(t)});if(204!==i.status){if(!i.ok)throw await s(i);return await i.json()}}async function i(e,t){let n=await o(`${r()}${e}`,{method:"GET",headers:{authorization:`Bearer ${t}`}});if(!n.ok)throw await s(n);return await n.json()}async function c(e){return a("/v0/auth/login/request",{email:e})}async function u(e,t){return a("/v0/auth/login/verify",{email:e,code:t})}async function l(e){return a("/v0/auth/token/refresh",{refresh_token:e})}async function f(e,t){await a("/v0/auth/logout",{refresh_token:t},{accessToken:e})}async function d(e){return i("/v0/auth/me",e)}async function p(e,t,r){return a("/v0/invite",void 0===r?{to:t}:{to:t,score:r},{accessToken:e})}e.s(["AuthApiError",0,n,"fetchMe",0,d,"logoutSession",0,f,"refreshAccessToken",0,l,"requestLoginCode",0,c,"sendInvites",0,p,"verifyLoginCode",0,u],6375)},17707,e=>{"use strict";var t=e.i(2157),r=e.i(50227),n=e.i(94930),s=e.i(79857),o=e.i(6375);function a(){let e=process.env.FAILPROOFAI_AUTH_DIR;return e?(0,r.join)(e,"session.json"):(0,s.auditSessionFile)()}function i(){let e=a();if(!(0,t.existsSync)(e))return null;try{let r=(0,t.readFileSync)(e,"utf-8"),n=JSON.parse(r);if("string"!=typeof n.access_token||"string"!=typeof n.refresh_token||"number"!=typeof n.access_expires_at||"object"!=typeof n.user||!n.user||"string"!=typeof n.user.id||"string"!=typeof n.user.email)return null;return{access_token:n.access_token,refresh_token:n.refresh_token,access_expires_at:n.access_expires_at,refresh_expires_at:"number"==typeof n.refresh_expires_at?n.refresh_expires_at:n.access_expires_at,user:{id:n.user.id,email:n.user.email}}}catch{return null}}function c(e){(0,n.writeJsonAtomically)(a(),e)}function u(){let e=a();(0,t.existsSync)(e)&&(0,t.rmSync)(e,{force:!0});try{let e=(0,s.migrationsDir)();if(!(0,t.existsSync)(e))return;for(let n of(0,t.readdirSync)(e)){if(!n.startsWith("backup-layout"))continue;let s=(0,r.resolve)(e,n,"auth.json");(0,t.existsSync)(s)&&(0,t.rmSync)(s,{force:!0})}}catch{}}function l(e,t){let r=Math.floor(Date.now()/1e3),n=e.user??t;if(!n)throw Error("authFromTokenResponse: missing user identity");return{access_token:e.access_token,refresh_token:e.refresh_token,access_expires_at:r+e.access_expires_in,refresh_expires_at:r+e.refresh_expires_in,user:n}}let f=new Map;async function d(e){let t=f.get(e.refresh_token);if(t)return t;let r=(async()=>{let t=l(await (0,o.refreshAccessToken)(e.refresh_token),e.user);return c(t),t})();f.set(e.refresh_token,r);try{return await r}finally{f.delete(e.refresh_token)}}async function p(){let e=i();if(!e)return null;let t=Math.floor(Date.now()/1e3);if(e.access_expires_at-t>60)return e;try{return await d(e)}catch(e){return e instanceof o.AuthApiError&&401===e.status&&u(),null}}async function h(){let e=await p();if(!e)return null;try{return{me:await (0,o.fetchMe)(e.access_token),auth:e}}catch(e){if(e instanceof o.AuthApiError&&401===e.status){let e=i();if(!e)return null;try{let t=await d(e);return{me:await (0,o.fetchMe)(t.access_token),auth:t}}catch(e){e instanceof o.AuthApiError&&401===e.status&&u()}}return null}}e.s(["authFromTokenResponse",0,l,"deleteAuth",0,u,"readAuth",0,i,"whoAmI",0,h,"writeAuth",0,c])},78081,e=>{e.v(t=>Promise.all(["server/chunks/[externals]__0qxhecv._.js","server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_01r25oi._.js"].map(t=>e.l(t))).then(()=>t(39702)))}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__0_usx0j._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},20635,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},59043,(e,t,r)=>{t.exports=e.x("next/dist/server/runtime-reacts.external.js",()=>require("next/dist/server/runtime-reacts.external.js"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},74533,(e,t,r)=>{t.exports=e.x("node:child_process",()=>require("node:child_process"))},66680,(e,t,r)=>{t.exports=e.x("node:crypto",()=>require("node:crypto"))},2157,(e,t,r)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},60526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},81111,(e,t,r)=>{t.exports=e.x("node:stream",()=>require("node:stream"))},94930,e=>{"use strict";var t=e.i(2157),r=e.i(50227),n=e.i(66680);e.s(["writeJsonAtomically",0,function(e,s,o={}){let a=o.mode??384,i=o.dirMode??448,c=(0,r.dirname)(e);(0,t.existsSync)(c)||(0,t.mkdirSync)(c,{recursive:!0,mode:i});let u=`${e}.${process.pid}.${(0,n.randomBytes)(6).toString("hex")}.tmp`;try{(0,t.writeFileSync)(u,JSON.stringify(s,null,2),{mode:a});try{(63&(0,t.statSync)(u).mode)!=0&&(0,t.chmodSync)(u,a)}catch{}(0,t.renameSync)(u,e);try{(63&(0,t.statSync)(e).mode)!=0&&(0,t.chmodSync)(e,a)}catch{}}catch(e){try{(0,t.rmSync)(u,{force:!0})}catch{}throw e}}])},6375,e=>{"use strict";var t=e.i(46501);function r(){return(process.env.FAILPROOF_API_URL??process.env.FAILPROOFAI_API_URL??"https://api.befailproof.ai").replace(/\/+$/,"")}class n extends Error{status;code;retryAfterSecs;constructor(e,t,r,n){super(r),this.status=e,this.code=t,this.retryAfterSecs=n,this.name="AuthApiError"}}async function s(e){let t={};try{t=await e.json()}catch{}let r=t.code??`http_${e.status}`,s=t.message??t.detail??e.statusText??"request failed",o=t.retry_after_secs;if(void 0===o){let t=e.headers.get("retry-after");if(t){let e=Number(t);Number.isFinite(e)&&(o=e)}}return void 0!==o&&(o=Math.max(0,Math.min(86400,o))),new n(e.status,r,s,o)}async function o(e,r){try{return await fetch(e,{...r,signal:function(e){let t=AbortSignal.timeout(1e4);if(!e)return t;let r=AbortSignal.any;if(r)return r([t,e]);let n=new AbortController;if(t.aborted)n.abort(t.reason);else t.addEventListener("abort",()=>n.abort(t.reason),{once:!0});if(e.aborted)n.abort(e.reason);else e.addEventListener("abort",()=>n.abort(e.reason),{once:!0});return n.signal}(r.signal??void 0)})}catch(o){let s=function(e){if(null===e||"object"!=typeof e)return!1;let t=e.name;return"AbortError"===t||"TimeoutError"===t}(o);if((0,t.trackEvent)("api_server_unreachable",{kind:s?"timeout":"network",path:function(e){try{return new URL(e).pathname}catch{return e}}(e),method:"string"==typeof r.method?r.method:"GET"}),s)throw new n(0,"timeout",`request to ${e} timed out after 10000ms`);throw o}}async function a(e,t,n){let a={"content-type":"application/json"};n?.accessToken&&(a.authorization=`Bearer ${n.accessToken}`);let i=await o(`${r()}${e}`,{method:"POST",headers:a,body:JSON.stringify(t)});if(204!==i.status){if(!i.ok)throw await s(i);return await i.json()}}async function i(e,t){let n=await o(`${r()}${e}`,{method:"GET",headers:{authorization:`Bearer ${t}`}});if(!n.ok)throw await s(n);return await n.json()}async function c(e){return a("/v0/auth/login/request",{email:e})}async function u(e,t){return a("/v0/auth/login/verify",{email:e,code:t})}async function l(e){return a("/v0/auth/token/refresh",{refresh_token:e})}async function f(e,t){await a("/v0/auth/logout",{refresh_token:t},{accessToken:e})}async function d(e){return i("/v0/auth/me",e)}async function p(e,t,r){return a("/v0/invite",void 0===r?{to:t}:{to:t,score:r},{accessToken:e})}e.s(["AuthApiError",0,n,"fetchMe",0,d,"logoutSession",0,f,"refreshAccessToken",0,l,"requestLoginCode",0,c,"sendInvites",0,p,"verifyLoginCode",0,u],6375)},17707,e=>{"use strict";var t=e.i(2157),r=e.i(50227),n=e.i(94930),s=e.i(79857),o=e.i(6375);function a(){let e=process.env.FAILPROOFAI_AUTH_DIR;return e?(0,r.join)(e,"session.json"):(0,s.auditSessionFile)()}function i(){let e=a();if(!(0,t.existsSync)(e))return null;try{let r=(0,t.readFileSync)(e,"utf-8"),n=JSON.parse(r);if("string"!=typeof n.access_token||"string"!=typeof n.refresh_token||"number"!=typeof n.access_expires_at||"object"!=typeof n.user||!n.user||"string"!=typeof n.user.id||"string"!=typeof n.user.email)return null;return{access_token:n.access_token,refresh_token:n.refresh_token,access_expires_at:n.access_expires_at,refresh_expires_at:"number"==typeof n.refresh_expires_at?n.refresh_expires_at:n.access_expires_at,user:{id:n.user.id,email:n.user.email}}}catch{return null}}function c(e){(0,n.writeJsonAtomically)(a(),e)}function u(){let e=a();(0,t.existsSync)(e)&&(0,t.rmSync)(e,{force:!0});try{let e=(0,s.migrationsDir)();if(!(0,t.existsSync)(e))return;for(let n of(0,t.readdirSync)(e)){if(!n.startsWith("backup-layout"))continue;let s=(0,r.resolve)(e,n,"auth.json");(0,t.existsSync)(s)&&(0,t.rmSync)(s,{force:!0})}}catch{}}function l(e,t){let r=Math.floor(Date.now()/1e3),n=e.user??t;if(!n)throw Error("authFromTokenResponse: missing user identity");return{access_token:e.access_token,refresh_token:e.refresh_token,access_expires_at:r+e.access_expires_in,refresh_expires_at:r+e.refresh_expires_in,user:n}}let f=new Map;async function d(e){let t=f.get(e.refresh_token);if(t)return t;let r=(async()=>{let t=l(await (0,o.refreshAccessToken)(e.refresh_token),e.user);return c(t),t})();f.set(e.refresh_token,r);try{return await r}finally{f.delete(e.refresh_token)}}async function p(){let e=i();if(!e)return null;let t=Math.floor(Date.now()/1e3);if(e.access_expires_at-t>60)return e;try{return await d(e)}catch(e){return e instanceof o.AuthApiError&&401===e.status&&u(),null}}async function h(){let e=await p();if(!e)return null;try{return{me:await (0,o.fetchMe)(e.access_token),auth:e}}catch(e){if(e instanceof o.AuthApiError&&401===e.status){let e=i();if(!e)return null;try{let t=await d(e);return{me:await (0,o.fetchMe)(t.access_token),auth:t}}catch(e){e instanceof o.AuthApiError&&401===e.status&&u()}}return null}}e.s(["authFromTokenResponse",0,l,"deleteAuth",0,u,"readAuth",0,i,"whoAmI",0,h,"writeAuth",0,c])},78081,e=>{e.v(t=>Promise.all(["server/chunks/[externals]__0qxhecv._.js","server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_01r25oi._.js"].map(t=>e.l(t))).then(()=>t(39702)))}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__0_zk340._.js.map
|