failproofai 0.0.13-beta.2 → 0.0.14-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/.factory/hooks.json +112 -0
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- 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.nft.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +7 -7
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +15 -15
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +15 -15
- package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +10 -10
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/api/audit/invite/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/audit/run/route.js +3 -3
- package/.next/standalone/.next/server/app/api/audit/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/login-request/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/login-verify/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/reminder/route.js.nft.json +1 -1
- 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 -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.nft.json +1 -1
- package/.next/standalone/.next/server/app/audit/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +15 -15
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +15 -15
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +10 -10
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +8 -8
- package/.next/standalone/.next/server/app/policies/page.js +1 -1
- 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 +3 -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 +5 -3
- 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 +1 -1
- 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/chunks/[root-of-the-server]__0--lkk6._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0-219ec._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__04_h-a5._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__06cuf1y._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__08w4wmd._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0g6bbuw._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0jllheg._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0jnjf2t._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0q-v9z2._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0q0qzx1._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0q2nbsl._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0rv7m0k._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0xuaoik._.js +3 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__16le-kd._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__17g9wh7._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1d9qen3._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1ffkmds._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1fwl2mz._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1legmza._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1mrihkj._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1myjm-d._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1qb590j._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1qxztj-._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1shcqgr._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1xuedea._.js +3 -0
- package/.next/standalone/.next/server/chunks/{_1z062h5._.js → _1vslkoe._.js} +2 -2
- package/.next/standalone/.next/server/chunks/lib_factory-projects_ts_1eo_bk-._.js +3 -0
- package/.next/standalone/.next/server/chunks/lib_openclaw-projects_ts_0gc-p24._.js +3 -0
- package/.next/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_17k9e3w.js +24 -12
- package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_01r25oi._.js +1 -1
- package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_09z9-p7._.js +1 -1
- package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4v._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__00cz9as._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__015_i4t._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__030k0c6._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__03lv-pe._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__042d3cd._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__05r_17v._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1rlmypf._.js → [root-of-the-server]__07qfsfa._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__09q1168._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0e2l3c1._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__09u1pcy._.js → [root-of-the-server]__0ge8e7w._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h12me5._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0hci7t3._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0hdsupo._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0p84xee._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0qeuy9c._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0s89hoe._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ynf7tx._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__11rtg6s._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__14dd6h8._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__170799-._.js +12 -9
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__17ai7sy._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1d8omgc._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1dky4g0._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1nq7ivq._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1tkjqka._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__212nf49._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_05whahf._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0_9_ytf._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_11_p9y8._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0ul5rf_._.js → _1_ozgif._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_1p0-leb._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_audit__components_audit-dashboard_tsx_0p9ud47._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_1kp6l3x._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_19dqvpc._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/lib_0xkhw_v._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/lib_antigravity-projects_ts_0_6zf11._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/lib_devin-projects_ts_0a64qdy._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/lib_factory-projects_ts_1uyaahq._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/lib_goose-projects_ts_0zkscri._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/lib_openclaw-projects_ts_0qxq3bp._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_html-to-image_es_index_09fe3kb.js → node_modules_html-to-image_es_index_0g5r64e.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0-uvagv.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_03c7gi5.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_09p-8om.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0v-kfiu.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0xrgzyz.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1806lsc.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1j6dd-e.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1sa65r-.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_11bnuzn._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_1ezd2jf._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_1tnuifj._.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- 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 +10 -10
- package/.next/standalone/.next/static/chunks/003uz088wbmz7.js +1 -0
- package/.next/standalone/.next/static/chunks/{0l2n5ftar65ox.js → 0405htbxay9vd.js} +1 -1
- package/.next/standalone/.next/static/chunks/0iinhn4417nk1.js +1 -0
- package/.next/standalone/.next/static/chunks/1374x9bv_s_vg.js +6 -0
- package/.next/standalone/.next/static/chunks/{06cw8nbn5c4_r.js → 17sdztgbcc0fi.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0i0joc040j999.js → 2m_tbl39fcedn.js} +1 -1
- package/.next/standalone/.next/static/chunks/{25qvspmcbb_5y.js → 2o3ql0n5owqsw.js} +1 -1
- package/.next/standalone/.next/static/chunks/{2a-k91nsa1lgf.js → 2ufuwhv03yvtb.js} +1 -1
- package/.next/standalone/.next/static/chunks/35-90m9py64d4.js +1 -0
- package/.next/standalone/.next/static/chunks/3r--yyjkp9_7b.css +2 -0
- package/.next/standalone/.next/static/chunks/{23t-i9s-q--nu.js → 43weu8f59tlix.js} +1 -1
- package/.next/standalone/.next/static/chunks/{2oz8ok8fzxaj3.js → 454dyizqik6t9.js} +2 -2
- package/.next/standalone/app/api/audit/run/route.ts +2 -0
- package/.next/standalone/app/audit/_components/empty-state.tsx +1 -1
- package/.next/standalone/app/globals.css +25 -1
- package/.next/standalone/app/policies/hooks-client.tsx +2 -4
- package/.next/standalone/app/project/[name]/page.tsx +30 -10
- package/.next/standalone/app/project/[name]/session/[sessionId]/page.tsx +71 -21
- package/.next/standalone/assets/logos/antigravity.svg +1 -0
- package/.next/standalone/assets/logos/devin.svg +1 -0
- package/.next/standalone/assets/logos/factory-dark.png +0 -0
- package/.next/standalone/assets/logos/factory-light.png +0 -0
- package/.next/standalone/assets/logos/goose-dark.svg +1 -0
- package/.next/standalone/assets/logos/goose-light.svg +1 -0
- package/.next/standalone/assets/logos/openclaw.svg +22 -0
- package/.next/standalone/components/navbar.tsx +5 -11
- package/.next/standalone/components/reach-developers.tsx +1 -1
- package/.next/standalone/lib/antigravity-projects.ts +224 -0
- package/.next/standalone/lib/antigravity-sessions.ts +283 -0
- package/.next/standalone/lib/cli-registry.ts +26 -6
- package/.next/standalone/lib/devin-projects.ts +141 -0
- package/.next/standalone/lib/devin-sessions.ts +343 -0
- package/.next/standalone/lib/download-session.ts +56 -5
- package/.next/standalone/lib/factory-projects.ts +109 -0
- package/.next/standalone/lib/factory-sessions.ts +312 -0
- package/.next/standalone/lib/goose-projects.ts +148 -0
- package/.next/standalone/lib/goose-sessions.ts +296 -0
- package/.next/standalone/lib/openclaw-projects.ts +182 -0
- package/.next/standalone/lib/openclaw-sessions.ts +284 -0
- package/.next/standalone/lib/projects.ts +33 -9
- package/.next/standalone/lib/telemetry-sanitize.ts +43 -0
- package/.next/standalone/openclaw-plugin/index.js +223 -0
- package/.next/standalone/openclaw-plugin/openclaw.plugin.json +6 -0
- package/.next/standalone/openclaw-plugin/package.json +12 -0
- package/.next/standalone/package.json +4 -3
- package/.next/standalone/server.js +1 -1
- package/README.md +105 -57
- package/bin/failproofai.mjs +87 -29
- package/dist/cli.mjs +12803 -9809
- package/lib/antigravity-projects.ts +224 -0
- package/lib/antigravity-sessions.ts +283 -0
- package/lib/cli-registry.ts +26 -6
- package/lib/devin-projects.ts +141 -0
- package/lib/devin-sessions.ts +343 -0
- package/lib/download-session.ts +56 -5
- package/lib/factory-projects.ts +109 -0
- package/lib/factory-sessions.ts +312 -0
- package/lib/goose-projects.ts +148 -0
- package/lib/goose-sessions.ts +296 -0
- package/lib/openclaw-projects.ts +182 -0
- package/lib/openclaw-sessions.ts +284 -0
- package/lib/projects.ts +33 -9
- package/lib/telemetry-sanitize.ts +43 -0
- package/openclaw-plugin/index.js +223 -0
- package/openclaw-plugin/openclaw.plugin.json +6 -0
- package/openclaw-plugin/package.json +12 -0
- package/package.json +4 -3
- package/scripts/launch.ts +4 -8
- package/scripts/postinstall.mjs +3 -4
- package/scripts/sync-agent-cli-harnesses-prompt.md +7 -10
- package/scripts/translate-docs/cli.ts +73 -52
- package/scripts/translate-docs/config.ts +57 -13
- package/scripts/translate-docs/mdx-translator.ts +51 -31
- package/scripts/translate-docs/mintlify-nav.ts +91 -10
- package/scripts/translate-docs/types.ts +3 -0
- package/src/audit/cli-adapters/antigravity.ts +87 -0
- package/src/audit/cli-adapters/devin.ts +53 -0
- package/src/audit/cli-adapters/factory.ts +75 -0
- package/src/audit/cli-adapters/goose.ts +53 -0
- package/src/audit/cli-adapters/index.ts +30 -6
- package/src/audit/cli-adapters/openclaw.ts +56 -0
- package/src/audit/cli.ts +44 -1
- package/src/audit/report.ts +1 -1
- package/src/audit/types.ts +1 -1
- package/src/hooks/builtin-policies.ts +5 -5
- package/src/hooks/configure-wizard.ts +356 -0
- package/src/hooks/handler.ts +283 -218
- package/src/hooks/hook-telemetry.ts +43 -3
- package/src/hooks/install-prompt.ts +92 -173
- package/src/hooks/integrations.ts +739 -138
- package/src/hooks/manager.ts +46 -2
- package/src/hooks/policy-evaluator.ts +301 -121
- package/src/hooks/policy-presets.ts +71 -0
- package/src/hooks/resolve-cwd.ts +1 -1
- package/src/hooks/resolve-permission-mode.ts +1 -5
- package/src/hooks/resolve-transcript-path.ts +25 -7
- package/src/hooks/tool-name-canonicalize.ts +36 -3
- package/src/hooks/tui.ts +578 -0
- package/src/hooks/types.ts +447 -109
- package/.next/standalone/.gemini/settings.json +0 -147
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0cag8qd._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0cefjd9._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ekj92q._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__12v-lma._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__136y39g._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__13h8pzr._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1hgv_75._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__04bqvos._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0dqgs96._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0q5rfxg._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0qukut7._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1ql-mch._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_11v0g3z._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/lib_gemini-projects_ts_1c7bgx-._.js +0 -3
- package/.next/standalone/.next/static/chunks/0fa7j157kg9_d.js +0 -1
- package/.next/standalone/.next/static/chunks/1c8i78p7t1i-5.js +0 -1
- package/.next/standalone/.next/static/chunks/1sg8kx5szx42y.js +0 -6
- package/.next/standalone/.next/static/chunks/25s52un3k_wht.css +0 -2
- package/.next/standalone/.next/static/chunks/2rkvn4znvuy4o.js +0 -1
- package/.next/standalone/assets/logos/gemini-dark.svg +0 -13
- package/.next/standalone/assets/logos/gemini-light.svg +0 -13
- package/.next/standalone/lib/gemini-projects.ts +0 -243
- package/.next/standalone/lib/gemini-sessions.ts +0 -365
- package/lib/gemini-projects.ts +0 -243
- package/lib/gemini-sessions.ts +0 -365
- package/src/audit/cli-adapters/gemini.ts +0 -51
- package/src/hooks/first-run-nudge.ts +0 -146
- /package/.next/standalone/.next/static/{HgG0mizCfOM3XyN1EW-sL → MNJWFb2jLRrxRKGFNK6Hy}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{HgG0mizCfOM3XyN1EW-sL → MNJWFb2jLRrxRKGFNK6Hy}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{HgG0mizCfOM3XyN1EW-sL → MNJWFb2jLRrxRKGFNK6Hy}/_ssgManifest.js +0 -0
package/scripts/launch.ts
CHANGED
|
@@ -9,19 +9,15 @@ import { createInterface } from "node:readline";
|
|
|
9
9
|
import { parseScriptArgs } from "./parse-script-args";
|
|
10
10
|
import { diagnoseShadow } from "./install-diagnosis.mjs";
|
|
11
11
|
import { makeSkewLogFilter } from "./skew-log-filter";
|
|
12
|
+
import { renderLaunchBanner } from "../src/hooks/tui";
|
|
12
13
|
import { version } from "../package.json";
|
|
13
14
|
|
|
14
15
|
export function launch(mode: "dev" | "start"): void {
|
|
15
16
|
const { loggingLevel, disableTelemetry, allowedDevOrigins, remainingArgs } = parseScriptArgs(process.argv.slice(2));
|
|
16
17
|
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
|
|
20
|
-
console.log(`\n failproof ai\n`);
|
|
21
|
-
console.log(` 📦 Version: ${version}`);
|
|
22
|
-
console.log(` ⭐ Star us: https://github.com/failproofai/failproofai`);
|
|
23
|
-
console.log(` 📖 Docs: https://docs.befailproof.ai/introduction`);
|
|
24
|
-
console.log(` 💬 Discord: https://discord.gg/2zjBZP7yQJ\n`);
|
|
18
|
+
// Branded splash — the same logomark + palette as the `configure` wizard, then
|
|
19
|
+
// a tidy version/links column. Falls back to plain text off a TTY.
|
|
20
|
+
for (const line of renderLaunchBanner(version)) console.log(line);
|
|
25
21
|
|
|
26
22
|
let cmd: string;
|
|
27
23
|
let cmdArgs: string[];
|
package/scripts/postinstall.mjs
CHANGED
|
@@ -144,10 +144,9 @@ try {
|
|
|
144
144
|
|
|
145
145
|
if (!hooksResult.configured && !hooksResult.registered) {
|
|
146
146
|
console.log(
|
|
147
|
-
`\n[failproofai] Installed
|
|
148
|
-
`
|
|
149
|
-
`
|
|
150
|
-
` Disable first-run prompt: FAILPROOFAI_NO_FIRST_RUN=1\n`
|
|
147
|
+
`\n[failproofai] Installed ✓\n` +
|
|
148
|
+
` 👋 Hi! Run \`failproofai config\` to set it up.\n` +
|
|
149
|
+
` (Disable this prompt: FAILPROOFAI_NO_FIRST_RUN=1)\n`
|
|
151
150
|
);
|
|
152
151
|
}
|
|
153
152
|
|
|
@@ -32,7 +32,6 @@ tracked in `src/hooks/types.ts` and written to disk by `src/hooks/integrations.t
|
|
|
32
32
|
| Cursor Agent | `CURSOR_HOOK_EVENT_TYPES` | `CURSOR_EVENT_MAP` | `.cursor/hooks.json` |
|
|
33
33
|
| OpenCode | `OPENCODE_HOOK_EVENT_TYPES` | `OPENCODE_EVENT_MAP` | `.opencode/opencode.json` + `.opencode/plugins/failproofai.mjs` |
|
|
34
34
|
| Pi | `PI_HOOK_EVENT_TYPES` | `PI_EVENT_MAP` | `.pi/settings.json` |
|
|
35
|
-
| Gemini CLI | `GEMINI_HOOK_EVENT_TYPES` | `GEMINI_EVENT_MAP` | `.gemini/settings.json` |
|
|
36
35
|
|
|
37
36
|
## What "drift" means — three scopes
|
|
38
37
|
|
|
@@ -62,7 +61,7 @@ For each verified CLI, compare the upstream docs to this repo across three scope
|
|
|
62
61
|
when you only need to **inspect** a committed fixture, prefer
|
|
63
62
|
`git show HEAD:<path>` (e.g. `git show HEAD:.codex/hooks.json`) — it is never
|
|
64
63
|
blocked and is the reliable way to read `.claude/settings.json`, `.codex/hooks.json`,
|
|
65
|
-
`.cursor/hooks.json`, `.github/hooks/failproofai.json`,
|
|
64
|
+
`.cursor/hooks.json`, `.github/hooks/failproofai.json`,
|
|
66
65
|
`.pi/settings.json`, and `.opencode/*`.
|
|
67
66
|
- Do **NOT** run `failproofai policies --install` (or any `failproofai` subcommand)
|
|
68
67
|
to regenerate a fixture — it is blocked. Edit fixtures by hand.
|
|
@@ -76,7 +75,7 @@ Spawn one subagent per CLI (seven, in parallel). Each subagent, for its CLI:
|
|
|
76
75
|
**settings-file schema** (top-level keys, per-entry shape, command field name,
|
|
77
76
|
timeout field name **and unit**, and whether `matcher` / `version` / `$schema`
|
|
78
77
|
are present). **Use upstream casing exactly** — Codex snake_case, Cursor
|
|
79
|
-
camelCase, OpenCode dot.namespaced, Pi snake_case, Claude/Copilot
|
|
78
|
+
camelCase, OpenCode dot.namespaced, Pi snake_case, Claude/Copilot
|
|
80
79
|
PascalCase. Do **not** normalize.
|
|
81
80
|
2. Compare against this repo: the CLI's `*HOOK_EVENT_TYPES` array + paired
|
|
82
81
|
`*EVENT_MAP` (scope 1); its `*_TOOL_MAP` / `*_TOOL_INPUT_MAP` and its branch in
|
|
@@ -98,7 +97,6 @@ surface is documented in the package source, not a clean enumeration).
|
|
|
98
97
|
| Cursor | https://cursor.com/docs/hooks |
|
|
99
98
|
| OpenCode | https://opencode.ai/docs/plugins/ |
|
|
100
99
|
| Pi | https://www.npmjs.com/package/@mariozechner/pi-coding-agent |
|
|
101
|
-
| Gemini | https://geminicli.com/docs/hooks/ · https://geminicli.com/docs/reference/tools/ (tool names) |
|
|
102
100
|
|
|
103
101
|
## Phase 2 — Decide what to do (do this BEFORE editing any files)
|
|
104
102
|
|
|
@@ -122,7 +120,6 @@ changes that block a clean stop on the comment / no-op paths below.
|
|
|
122
120
|
|
|
123
121
|
> This open sync PR is missing newly-detected drift:
|
|
124
122
|
> - **Cursor**: upstream added event `afterEdit` — append to `CURSOR_HOOK_EVENT_TYPES` (+ a `CURSOR_EVENT_MAP` entry).
|
|
125
|
-
> - **Gemini**: the `run_shell_command` tool was renamed to `shell` — the `GEMINI_TOOL_MAP` key is stale.
|
|
126
123
|
>
|
|
127
124
|
> (hook-sync bot — please fold these into this PR rather than opening a second sync PR.)
|
|
128
125
|
|
|
@@ -140,7 +137,7 @@ requires.
|
|
|
140
137
|
- **Append** new events just before `] as const`, preserving upstream casing.
|
|
141
138
|
- **Delete** removed events; if the CLI has an `*EVENT_MAP`, also delete the same
|
|
142
139
|
key from that map (the `Record` is exhaustive — a stale key fails `tsc`).
|
|
143
|
-
- For **map-bearing CLIs** (Codex, Cursor, OpenCode, Pi
|
|
140
|
+
- For **map-bearing CLIs** (Codex, Cursor, OpenCode, Pi), do **NOT** invent
|
|
144
141
|
the canonical mapping for a newly-added event — leave it out of the `*EVENT_MAP`
|
|
145
142
|
so `tsc` fails intentionally, and add a reviewer-checklist item to the PR body
|
|
146
143
|
(see below). For **Claude and Copilot** (no map), the build stays green.
|
|
@@ -148,9 +145,9 @@ requires.
|
|
|
148
145
|
- If `HOOK_EVENT_TYPES` (Claude) changed: in `__tests__/hooks/manager.test.ts`,
|
|
149
146
|
update the `installs hooks for all <N> event types` description AND both
|
|
150
147
|
`expect(Object.keys(written.hooks)).toHaveLength(<N>)` assertions.
|
|
151
|
-
- If `
|
|
152
|
-
update the `expect(
|
|
153
|
-
|
|
148
|
+
- If a CLI's `*_HOOK_EVENT_TYPES` changed: in `__tests__/hooks/integrations.test.ts`,
|
|
149
|
+
update the matching `expect(<cli>.eventTypes).toHaveLength(<N>)` assertion AND the
|
|
150
|
+
description string.
|
|
154
151
|
- Locate these by searching for the current count number.
|
|
155
152
|
|
|
156
153
|
### Scope 2 / Scope 3 (tool schema / settings-file shape)
|
|
@@ -211,7 +208,7 @@ The PR **body** must contain, in order:
|
|
|
211
208
|
`__tests__/e2e/hooks/<cli>-integration.e2e.test.ts`, the seven dogfood fixtures
|
|
212
209
|
(`.claude/settings.json`, `.codex/hooks.json`, `.cursor/hooks.json`,
|
|
213
210
|
`.github/hooks/failproofai.json`, `.opencode/opencode.json`,
|
|
214
|
-
`.opencode/plugins/failproofai.mjs`, `.pi/settings.json
|
|
211
|
+
`.opencode/plugins/failproofai.mjs`, `.pi/settings.json`),
|
|
215
212
|
and `CHANGELOG.md`.
|
|
216
213
|
- Do **NOT** edit `.failproofai/policies-config.json` (the entrypoint manages it),
|
|
217
214
|
`src/hooks/handler.ts`, `src/hooks/manager.ts`, or any other source file.
|
|
@@ -3,10 +3,19 @@ import { parseArgs } from "node:util";
|
|
|
3
3
|
import { existsSync, readdirSync, readFileSync } from "node:fs";
|
|
4
4
|
import { dirname, join, relative } from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
LANGUAGES,
|
|
8
|
+
getLanguagesByTier,
|
|
9
|
+
getLanguageByCode,
|
|
10
|
+
getModelForTier,
|
|
11
|
+
} from "./config";
|
|
7
12
|
import { getEnglishMdxPages, translateMdxPage } from "./mdx-translator";
|
|
8
13
|
import { translateReadme } from "./readme-translator";
|
|
9
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
getNavigationPageReferences,
|
|
16
|
+
updateDocsJson,
|
|
17
|
+
readDocsConfig,
|
|
18
|
+
} from "./mintlify-nav";
|
|
10
19
|
import { readCache, writeCache, isCached, setCacheEntry } from "./cache";
|
|
11
20
|
import type { TranslationResult } from "./types";
|
|
12
21
|
|
|
@@ -87,44 +96,14 @@ async function validateNavReferences(): Promise<boolean> {
|
|
|
87
96
|
let total = 0;
|
|
88
97
|
let missing = 0;
|
|
89
98
|
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
groups: Array<{ pages: string[] }>;
|
|
99
|
-
}>;
|
|
100
|
-
for (const tab of tabs) {
|
|
101
|
-
for (const group of tab.groups) {
|
|
102
|
-
for (const page of group.pages) {
|
|
103
|
-
total++;
|
|
104
|
-
const filePath = join(DOCS_DIR, `${page}.mdx`);
|
|
105
|
-
if (!existsSync(filePath)) {
|
|
106
|
-
console.error(` MISSING: ${page} -> ${filePath}`);
|
|
107
|
-
missing++;
|
|
108
|
-
valid = false;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
} else {
|
|
114
|
-
for (const langEntry of languages) {
|
|
115
|
-
for (const tab of langEntry.tabs) {
|
|
116
|
-
for (const group of tab.groups) {
|
|
117
|
-
for (const page of group.pages) {
|
|
118
|
-
total++;
|
|
119
|
-
const filePath = join(DOCS_DIR, `${page}.mdx`);
|
|
120
|
-
if (!existsSync(filePath)) {
|
|
121
|
-
console.error(` MISSING [${langEntry.language}]: ${page} -> ${filePath}`);
|
|
122
|
-
missing++;
|
|
123
|
-
valid = false;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
99
|
+
for (const reference of getNavigationPageReferences(nav)) {
|
|
100
|
+
total++;
|
|
101
|
+
const filePath = join(DOCS_DIR, `${reference.page}.mdx`);
|
|
102
|
+
if (!existsSync(filePath)) {
|
|
103
|
+
const context = reference.language ? ` [${reference.language}]` : "";
|
|
104
|
+
console.error(` MISSING${context}: ${reference.page} -> ${filePath}`);
|
|
105
|
+
missing++;
|
|
106
|
+
valid = false;
|
|
128
107
|
}
|
|
129
108
|
}
|
|
130
109
|
|
|
@@ -169,7 +148,9 @@ async function main() {
|
|
|
169
148
|
`${isDryRun ? "[DRY RUN] " : ""}Translating into: ${langCodes.join(", ")}`,
|
|
170
149
|
);
|
|
171
150
|
if (!modelOverride) {
|
|
172
|
-
console.log(
|
|
151
|
+
console.log(
|
|
152
|
+
`Models: Tier 1 -> ${getModelForTier(1)}, Tier 2/3 -> ${getModelForTier(2)}`,
|
|
153
|
+
);
|
|
173
154
|
} else {
|
|
174
155
|
console.log(`Model override: ${modelOverride}`);
|
|
175
156
|
}
|
|
@@ -186,10 +167,17 @@ async function main() {
|
|
|
186
167
|
// configured in translator.ts) to absorb per-request transient
|
|
187
168
|
// `Connection error.` from LB-induced replica flapping.
|
|
188
169
|
// Override via TRANSLATE_MAX_CONCURRENT (integer >= 1; otherwise default).
|
|
189
|
-
const parsedConcurrent = Number.parseInt(
|
|
170
|
+
const parsedConcurrent = Number.parseInt(
|
|
171
|
+
process.env.TRANSLATE_MAX_CONCURRENT ?? "",
|
|
172
|
+
10,
|
|
173
|
+
);
|
|
190
174
|
const MAX_CONCURRENT =
|
|
191
|
-
Number.isInteger(parsedConcurrent) && parsedConcurrent > 0
|
|
192
|
-
|
|
175
|
+
Number.isInteger(parsedConcurrent) && parsedConcurrent > 0
|
|
176
|
+
? parsedConcurrent
|
|
177
|
+
: 4;
|
|
178
|
+
async function runWithConcurrency<T>(
|
|
179
|
+
tasks: (() => Promise<T>)[],
|
|
180
|
+
): Promise<T[]> {
|
|
193
181
|
const results: T[] = [];
|
|
194
182
|
let i = 0;
|
|
195
183
|
async function next(): Promise<void> {
|
|
@@ -198,7 +186,11 @@ async function main() {
|
|
|
198
186
|
results[idx] = await tasks[idx]();
|
|
199
187
|
}
|
|
200
188
|
}
|
|
201
|
-
await Promise.all(
|
|
189
|
+
await Promise.all(
|
|
190
|
+
Array.from({ length: Math.min(MAX_CONCURRENT, tasks.length) }, () =>
|
|
191
|
+
next(),
|
|
192
|
+
),
|
|
193
|
+
);
|
|
202
194
|
return results;
|
|
203
195
|
}
|
|
204
196
|
|
|
@@ -227,7 +219,11 @@ async function main() {
|
|
|
227
219
|
for (const page of filteredPages) {
|
|
228
220
|
const relPath = relative(DOCS_DIR, page);
|
|
229
221
|
const task = { page, relPath, lang };
|
|
230
|
-
if (
|
|
222
|
+
if (
|
|
223
|
+
!isForce &&
|
|
224
|
+
!isDryRun &&
|
|
225
|
+
isCached(cache, relPath, lang, pageContents.get(page)!)
|
|
226
|
+
) {
|
|
231
227
|
cachedTasks.push(task);
|
|
232
228
|
} else {
|
|
233
229
|
uncachedTasks.push(task);
|
|
@@ -235,7 +231,9 @@ async function main() {
|
|
|
235
231
|
}
|
|
236
232
|
}
|
|
237
233
|
|
|
238
|
-
console.log(
|
|
234
|
+
console.log(
|
|
235
|
+
`\n${filteredPages.length} MDX pages x ${langCodes.length} languages = ${filteredPages.length * langCodes.length} total`,
|
|
236
|
+
);
|
|
239
237
|
console.log(` Cached (unchanged): ${cachedTasks.length}`);
|
|
240
238
|
console.log(` Need translation: ${uncachedTasks.length}`);
|
|
241
239
|
|
|
@@ -268,7 +266,14 @@ async function main() {
|
|
|
268
266
|
console.log(` ${relPath} [${lang}] -> ${status}`);
|
|
269
267
|
results.push(result);
|
|
270
268
|
if (!result.cached && !isDryRun) {
|
|
271
|
-
setCacheEntry(
|
|
269
|
+
setCacheEntry(
|
|
270
|
+
cache,
|
|
271
|
+
relPath,
|
|
272
|
+
lang,
|
|
273
|
+
pageContents.get(page)!,
|
|
274
|
+
result.inputTokens,
|
|
275
|
+
result.outputTokens,
|
|
276
|
+
);
|
|
272
277
|
}
|
|
273
278
|
} catch (err) {
|
|
274
279
|
const msg = err instanceof Error ? err.message : String(err);
|
|
@@ -285,10 +290,17 @@ async function main() {
|
|
|
285
290
|
console.log(`\nTranslating README...`);
|
|
286
291
|
|
|
287
292
|
// Read README once
|
|
288
|
-
const readmeSource = readFileSync(
|
|
293
|
+
const readmeSource = readFileSync(
|
|
294
|
+
join(DOCS_DIR, "..", "README.md"),
|
|
295
|
+
"utf-8",
|
|
296
|
+
);
|
|
289
297
|
const uncachedLangs: string[] = [];
|
|
290
298
|
for (const lang of langCodes) {
|
|
291
|
-
if (
|
|
299
|
+
if (
|
|
300
|
+
!isForce &&
|
|
301
|
+
!isDryRun &&
|
|
302
|
+
isCached(cache, "README.md", lang, readmeSource)
|
|
303
|
+
) {
|
|
292
304
|
console.log(` README.${lang}.md -> cached`);
|
|
293
305
|
results.push({
|
|
294
306
|
lang,
|
|
@@ -317,10 +329,19 @@ async function main() {
|
|
|
317
329
|
const status = isDryRun
|
|
318
330
|
? "would translate"
|
|
319
331
|
: `translated (${result.inputTokens}+${result.outputTokens} tokens)`;
|
|
320
|
-
console.log(
|
|
332
|
+
console.log(
|
|
333
|
+
` README.${lang}.md -> ${langConfig.nativeName}: ${status}`,
|
|
334
|
+
);
|
|
321
335
|
results.push(result);
|
|
322
336
|
if (!result.cached && !isDryRun) {
|
|
323
|
-
setCacheEntry(
|
|
337
|
+
setCacheEntry(
|
|
338
|
+
cache,
|
|
339
|
+
"README.md",
|
|
340
|
+
lang,
|
|
341
|
+
readmeSource,
|
|
342
|
+
result.inputTokens,
|
|
343
|
+
result.outputTokens,
|
|
344
|
+
);
|
|
324
345
|
}
|
|
325
346
|
} catch (err) {
|
|
326
347
|
const msg = err instanceof Error ? err.message : String(err);
|
|
@@ -2,22 +2,60 @@ import type { LanguageConfig } from "./types";
|
|
|
2
2
|
|
|
3
3
|
export const LANGUAGES: LanguageConfig[] = [
|
|
4
4
|
// Tier 1 — largest developer populations
|
|
5
|
-
{
|
|
5
|
+
{
|
|
6
|
+
code: "zh",
|
|
7
|
+
name: "Chinese (Simplified)",
|
|
8
|
+
nativeName: "\u7b80\u4f53\u4e2d\u6587",
|
|
9
|
+
tier: 1,
|
|
10
|
+
},
|
|
6
11
|
{ code: "ja", name: "Japanese", nativeName: "\u65e5\u672c\u8a9e", tier: 1 },
|
|
7
12
|
{ code: "ko", name: "Korean", nativeName: "\ud55c\uad6d\uc5b4", tier: 1 },
|
|
8
13
|
{ code: "es", name: "Spanish", nativeName: "Espa\u00f1ol", tier: 1 },
|
|
9
|
-
{
|
|
14
|
+
{
|
|
15
|
+
code: "pt-br",
|
|
16
|
+
mintlifyCode: "pt-BR",
|
|
17
|
+
name: "Portuguese (Brazil)",
|
|
18
|
+
nativeName: "Portugu\u00eas",
|
|
19
|
+
tier: 1,
|
|
20
|
+
},
|
|
10
21
|
{ code: "de", name: "German", nativeName: "Deutsch", tier: 1 },
|
|
11
22
|
{ code: "fr", name: "French", nativeName: "Fran\u00e7ais", tier: 1 },
|
|
12
23
|
// Tier 2 — strong tech communities
|
|
13
|
-
{
|
|
14
|
-
|
|
24
|
+
{
|
|
25
|
+
code: "ru",
|
|
26
|
+
name: "Russian",
|
|
27
|
+
nativeName: "\u0420\u0443\u0441\u0441\u043a\u0438\u0439",
|
|
28
|
+
tier: 2,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
code: "hi",
|
|
32
|
+
name: "Hindi",
|
|
33
|
+
nativeName: "\u0939\u093f\u0928\u094d\u0926\u0940",
|
|
34
|
+
tier: 2,
|
|
35
|
+
},
|
|
15
36
|
{ code: "tr", name: "Turkish", nativeName: "T\u00fcrk\u00e7e", tier: 2 },
|
|
16
|
-
{
|
|
37
|
+
{
|
|
38
|
+
code: "vi",
|
|
39
|
+
name: "Vietnamese",
|
|
40
|
+
nativeName: "Ti\u1ebfng Vi\u1ec7t",
|
|
41
|
+
tier: 2,
|
|
42
|
+
},
|
|
17
43
|
{ code: "it", name: "Italian", nativeName: "Italiano", tier: 2 },
|
|
18
44
|
// Tier 3 — RTL languages
|
|
19
|
-
{
|
|
20
|
-
|
|
45
|
+
{
|
|
46
|
+
code: "ar",
|
|
47
|
+
name: "Arabic",
|
|
48
|
+
nativeName: "\u0627\u0644\u0639\u0631\u0628\u064a\u0629",
|
|
49
|
+
tier: 3,
|
|
50
|
+
rtl: true,
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
code: "he",
|
|
54
|
+
name: "Hebrew",
|
|
55
|
+
nativeName: "\u05e2\u05d1\u05e8\u05d9\u05ea",
|
|
56
|
+
tier: 3,
|
|
57
|
+
rtl: true,
|
|
58
|
+
},
|
|
21
59
|
];
|
|
22
60
|
|
|
23
61
|
export function getLanguagesByTier(maxTier: number): LanguageConfig[] {
|
|
@@ -184,17 +222,21 @@ export const NAV_TRANSLATIONS: Record<
|
|
|
184
222
|
ru: {
|
|
185
223
|
docs: "\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f",
|
|
186
224
|
examples: "\u041f\u0440\u0438\u043c\u0435\u0440\u044b",
|
|
187
|
-
gettingStarted:
|
|
188
|
-
|
|
225
|
+
gettingStarted:
|
|
226
|
+
"\u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b",
|
|
227
|
+
coreConcepts:
|
|
228
|
+
"\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438",
|
|
189
229
|
cli: "CLI",
|
|
190
230
|
tools: "\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b",
|
|
191
|
-
advanced:
|
|
231
|
+
advanced:
|
|
232
|
+
"\u041f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0439",
|
|
192
233
|
},
|
|
193
234
|
hi: {
|
|
194
235
|
docs: "\u0926\u0938\u094d\u0924\u093e\u0935\u0947\u091c\u093c",
|
|
195
236
|
examples: "\u0909\u0926\u093e\u0939\u0930\u0923",
|
|
196
237
|
gettingStarted: "\u0936\u0941\u0930\u0942 \u0915\u0930\u0947\u0902",
|
|
197
|
-
coreConcepts:
|
|
238
|
+
coreConcepts:
|
|
239
|
+
"\u092e\u0942\u0932 \u0905\u0935\u0927\u093e\u0930\u0923\u093e\u090f\u0901",
|
|
198
240
|
cli: "CLI",
|
|
199
241
|
tools: "\u0909\u092a\u0915\u0930\u0923",
|
|
200
242
|
advanced: "\u0909\u0928\u094d\u0928\u0924",
|
|
@@ -230,7 +272,8 @@ export const NAV_TRANSLATIONS: Record<
|
|
|
230
272
|
docs: "\u0627\u0644\u0645\u0633\u062a\u0646\u062f\u0627\u062a",
|
|
231
273
|
examples: "\u0623\u0645\u062b\u0644\u0629",
|
|
232
274
|
gettingStarted: "\u0627\u0644\u0628\u062f\u0627\u064a\u0629",
|
|
233
|
-
coreConcepts:
|
|
275
|
+
coreConcepts:
|
|
276
|
+
"\u0627\u0644\u0645\u0641\u0627\u0647\u064a\u0645 \u0627\u0644\u0623\u0633\u0627\u0633\u064a\u0629",
|
|
234
277
|
cli: "CLI",
|
|
235
278
|
tools: "\u0627\u0644\u0623\u062f\u0648\u0627\u062a",
|
|
236
279
|
advanced: "\u0645\u062a\u0642\u062f\u0645",
|
|
@@ -238,7 +281,8 @@ export const NAV_TRANSLATIONS: Record<
|
|
|
238
281
|
he: {
|
|
239
282
|
docs: "\u05ea\u05d9\u05e2\u05d5\u05d3",
|
|
240
283
|
examples: "\u05d3\u05d5\u05d2\u05de\u05d0\u05d5\u05ea",
|
|
241
|
-
gettingStarted:
|
|
284
|
+
gettingStarted:
|
|
285
|
+
"\u05ea\u05d7\u05d9\u05dc\u05ea \u05e2\u05d1\u05d5\u05d3\u05d4",
|
|
242
286
|
coreConcepts: "\u05de\u05d5\u05e9\u05d2\u05d9 \u05d9\u05e1\u05d5\u05d3",
|
|
243
287
|
cli: "CLI",
|
|
244
288
|
tools: "\u05db\u05dc\u05d9\u05dd",
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
readFileSync,
|
|
3
|
+
writeFileSync,
|
|
4
|
+
mkdirSync,
|
|
5
|
+
readdirSync,
|
|
6
|
+
statSync,
|
|
7
|
+
} from "node:fs";
|
|
2
8
|
import { dirname, join, relative } from "node:path";
|
|
3
9
|
import { fileURLToPath } from "node:url";
|
|
4
10
|
import { getLanguageByCode } from "./config";
|
|
5
11
|
import { translateContent } from "./translator";
|
|
6
|
-
import {
|
|
7
|
-
readCache,
|
|
8
|
-
writeCache,
|
|
9
|
-
isCached,
|
|
10
|
-
setCacheEntry,
|
|
11
|
-
} from "./cache";
|
|
12
|
+
import { readCache, writeCache, isCached, setCacheEntry } from "./cache";
|
|
12
13
|
import type { TranslationResult, TranslationCache } from "./types";
|
|
13
14
|
|
|
14
15
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
@@ -98,28 +99,23 @@ export function stripStrayTrailingFence(content: string): string {
|
|
|
98
99
|
* e.g. href="/built-in-policies" -> href="/es/built-in-policies"
|
|
99
100
|
* [Getting started](/getting-started) -> [Getting started](/es/getting-started)
|
|
100
101
|
*/
|
|
101
|
-
export function rewriteInternalLinks(
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
export function rewriteInternalLinks(content: string, lang: string): string {
|
|
103
|
+
const shouldPreservePath = (path: string): boolean =>
|
|
104
|
+
path.startsWith("/http") ||
|
|
105
|
+
path === "/" ||
|
|
106
|
+
/\.(?:png|jpe?g|gif|svg|webp|ico)(?:#.*)?$/i.test(path);
|
|
107
|
+
|
|
105
108
|
// Rewrite MDX component href attributes pointing to internal paths
|
|
106
|
-
let result = content.replace(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
if (path.startsWith("/http") || path === "/") return `href="${path}"`;
|
|
111
|
-
return `href="/${lang}${path}"`;
|
|
112
|
-
},
|
|
113
|
-
);
|
|
109
|
+
let result = content.replace(/href="(\/[^"]*?)"/g, (_match, path: string) => {
|
|
110
|
+
if (shouldPreservePath(path)) return `href="${path}"`;
|
|
111
|
+
return `href="/${lang}${path}"`;
|
|
112
|
+
});
|
|
114
113
|
|
|
115
114
|
// Rewrite Markdown links with internal paths
|
|
116
|
-
result = result.replace(
|
|
117
|
-
|
|
118
|
-
(
|
|
119
|
-
|
|
120
|
-
return `](/${lang}${path})`;
|
|
121
|
-
},
|
|
122
|
-
);
|
|
115
|
+
result = result.replace(/\]\((\/[^)]*?)\)/g, (_match, path: string) => {
|
|
116
|
+
if (shouldPreservePath(path)) return `](${path})`;
|
|
117
|
+
return `](/${lang}${path})`;
|
|
118
|
+
});
|
|
123
119
|
|
|
124
120
|
return result;
|
|
125
121
|
}
|
|
@@ -130,7 +126,12 @@ export function rewriteInternalLinks(
|
|
|
130
126
|
export async function translateMdxPage(
|
|
131
127
|
sourcePath: string,
|
|
132
128
|
lang: string,
|
|
133
|
-
options: {
|
|
129
|
+
options: {
|
|
130
|
+
force?: boolean;
|
|
131
|
+
dryRun?: boolean;
|
|
132
|
+
model?: string;
|
|
133
|
+
cache?: TranslationCache;
|
|
134
|
+
} = {},
|
|
134
135
|
): Promise<TranslationResult> {
|
|
135
136
|
const relPath = relative(DOCS_DIR, sourcePath);
|
|
136
137
|
const outputPath = join(DOCS_DIR, lang, relPath);
|
|
@@ -186,7 +187,14 @@ export async function translateMdxPage(
|
|
|
186
187
|
// Update cache — skip if caller manages the cache (batch write)
|
|
187
188
|
if (!options.cache) {
|
|
188
189
|
const cache = readCache();
|
|
189
|
-
setCacheEntry(
|
|
190
|
+
setCacheEntry(
|
|
191
|
+
cache,
|
|
192
|
+
relPath,
|
|
193
|
+
lang,
|
|
194
|
+
sourceContent,
|
|
195
|
+
inputTokens,
|
|
196
|
+
outputTokens,
|
|
197
|
+
);
|
|
190
198
|
writeCache(cache);
|
|
191
199
|
}
|
|
192
200
|
|
|
@@ -213,7 +221,7 @@ export function getEnglishMdxPages(): string[] {
|
|
|
213
221
|
if (statSync(full).isDirectory()) {
|
|
214
222
|
// Skip language directories at the top level
|
|
215
223
|
if (!prefix && isLanguageDir(entry)) continue;
|
|
216
|
-
// Skip non-
|
|
224
|
+
// Skip non-page asset and localization directories.
|
|
217
225
|
if (!prefix && (entry === "logo" || entry === "i18n")) continue;
|
|
218
226
|
walk(full, rel);
|
|
219
227
|
} else if (entry.endsWith(".mdx")) {
|
|
@@ -228,8 +236,20 @@ export function getEnglishMdxPages(): string[] {
|
|
|
228
236
|
|
|
229
237
|
function isLanguageDir(name: string): boolean {
|
|
230
238
|
const langCodes = [
|
|
231
|
-
"zh",
|
|
232
|
-
"
|
|
239
|
+
"zh",
|
|
240
|
+
"ja",
|
|
241
|
+
"ko",
|
|
242
|
+
"es",
|
|
243
|
+
"pt-br",
|
|
244
|
+
"de",
|
|
245
|
+
"fr",
|
|
246
|
+
"ru",
|
|
247
|
+
"hi",
|
|
248
|
+
"tr",
|
|
249
|
+
"vi",
|
|
250
|
+
"it",
|
|
251
|
+
"ar",
|
|
252
|
+
"he",
|
|
233
253
|
];
|
|
234
254
|
return langCodes.includes(name);
|
|
235
255
|
}
|