failproofai 1.0.12 → 1.0.13-beta.2
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 +13 -13
- package/.next/standalone/.next/prerender-manifest.json +4 -4
- package/.next/standalone/.next/required-server-files.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page/build-manifest.json +2 -2
- 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 -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 +2 -2
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page/build-manifest.json +2 -2
- 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 +4 -3
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/api/audit/invite/route.js +6 -5
- 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 +27 -26
- 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 +4 -3
- 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 +6 -5
- package/.next/standalone/.next/server/app/api/auth/login-request/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/login-verify/route.js +6 -5
- package/.next/standalone/.next/server/app/api/auth/login-verify/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/logout/route.js +6 -5
- 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 +6 -5
- 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 +4 -3
- package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/audit/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/audit/page/server-reference-manifest.json +2 -2
- package/.next/standalone/.next/server/app/audit/page.js +7 -6
- package/.next/standalone/.next/server/app/audit/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/audit/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +3 -3
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/page.js +6 -5
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/policies/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +14 -14
- 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/build-manifest.json +2 -2
- 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 +21 -20
- package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/build-manifest.json +2 -2
- 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 +10 -9
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/projects/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/projects/page.js +7 -6
- package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +8 -8
- package/.next/standalone/.next/server/app/settings/page.js +6 -5
- 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]__0vt9i6fqinjne._.js → [externals]__1h83uo-b1b6-2._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[externals]__214wn4wh2x79y._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[externals]__1rlxpymm37wel._.js → [root-of-the-server]__031qp1lkow_kc._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__038kwryp970nh._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0_hsnj_a2mvl_._.js → [root-of-the-server]__03s1za0hn71yp._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0wg9dk8x8bnau._.js → [root-of-the-server]__07a0sa6fuw5_b._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__08atcie7jzswm._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__08dchfudh2_4f._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0car70pylmvor._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0spt0kv8azrpl._.js +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__12kq3x-h7t7i1._.js → [root-of-the-server]__0yvyp5b7jmlc4._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__02vous7mpi2xm._.js → [root-of-the-server]__145vo_drnuvas._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[externals]__0h0p9dmv_e7r7._.js → [root-of-the-server]__1a2d0ewycsp6k._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[externals]__1_407huhlmj1m._.js → [root-of-the-server]__1am_1tz0o0aqz._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__03i5o4a840guz._.js → [root-of-the-server]__1gxfzuvpyw30j._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1j6kfp0vzu5rw._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1l0ayum_hqqsw._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1lh8c0mmhdrbj._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1o9rznwc0w7og._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0f_4g-vazrvxv._.js → [root-of-the-server]__1o_622x0fglpr._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1oclamblhzhrf._.js +68 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1v1-l-83czzsr._.js +63 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__1a5zkndjwlc13._.js → [root-of-the-server]__1wwi53kkqhnfi._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{_1y590mjzpkbos._.js → _02sa8fcu9_9xo._.js} +2 -2
- package/.next/standalone/.next/server/chunks/_0tovk6q0miud6._.js +1 -1
- package/.next/standalone/.next/server/chunks/_0trp3ycqv17cl._.js +1 -1
- package/.next/standalone/.next/server/chunks/_1-2owkp-1_987._.js +1 -1
- package/.next/standalone/.next/server/chunks/_13ltj8a9z92o8._.js +1 -1
- package/.next/standalone/.next/server/chunks/_15k37au70vjvg._.js +1 -1
- package/.next/standalone/.next/server/chunks/_18rfu4__wjhwb._.js +1 -1
- package/.next/standalone/.next/server/chunks/_1ek68lnh2daur._.js +2 -2
- package/.next/standalone/.next/server/chunks/_1fz8m31sndkcu._.js +1 -1
- package/.next/standalone/.next/server/chunks/_1ogwigfb0163w._.js +1 -1
- package/.next/standalone/.next/server/chunks/_1vslkoe35wok6._.js +1 -1
- package/.next/standalone/.next/server/chunks/node_modules_@opentelemetry_api_build_esm_index_0oo58a7rymoxh.js +3 -0
- package/.next/standalone/.next/server/chunks/node_modules_@opentelemetry_api_build_esm_index_1jp9ij0_ddtgk.js +3 -0
- package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_01r25oigsgz07._.js +2 -2
- package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_09z9-p77cu37y._.js +2 -2
- package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4vkpxxu7._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0ffu2-38y03ic._.js → [root-of-the-server]__021vebe-4il8s._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__075uro8t92s0_._.js +14 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__08ch3staq3ejw._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[externals]__12qr51qgrrt6o._.js → [root-of-the-server]__097i34ct1o88x._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0alpzjn3450sr._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0aup10z2o8zc1._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0bigvy9xmv2ka._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0bioghlkjf7s7._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__01j58mdcdw0vn._.js → [root-of-the-server]__0ed1zh4scn7-k._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0naevg4bcoh54._.js → [root-of-the-server]__0evgy902m9h5e._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h86bl2qf0k_o._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0nhm28v58ty9z._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0pia5h3p8re4c._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0vse4qi496ol-._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__17r4zrwanhp6r._.js → [root-of-the-server]__0yb3u36xjy3b9._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0g8b0kyorya-t._.js → [root-of-the-server]__0ywj2u6ovfm_5._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1-ey9fgesfbc0._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0zn1d4blhd3bu._.js → [root-of-the-server]__10v5cyxvj64j4._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__15usvs-ms-0hf._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__16gb3_92zvk5x._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__190xwrr5zrfi3._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__167mipqmjprq5._.js → [root-of-the-server]__19nvo1qfswchs._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1avi2kypusyb_._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1vx7o8ukefudh._.js → [root-of-the-server]__1guwlpkyurdn9._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1k96jctukf65_._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1r7drlqli-ado._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1sj-wn2jp6va5._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1vofkb2oq7p7e._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1s2-ck3k3rsoo._.js → [root-of-the-server]__20dt376-socef._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1lnfv02ucky7m._.js → [root-of-the-server]__2158020r_amn9._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0eoura3_9gjb-._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0pedwblqdoh58._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1_ozgifqv1ssi._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1djqs9i27e4kg._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_1d98fyfrcaqhy._.js → _1nvqg4si0splb._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_next-internal_server_app_policies_page_actions_1sp2-yo5_vm5f.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/app_actions_get-scheduled-audit_ts_0ei9snixb5fd-._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_audit__components_audit-dashboard_tsx_0p9ud47q0xq5w._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_1kp6l3x33jqb6._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_19dqvpcz0uxur._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_settings_02tf1h47jmhhd._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_09s4n108bqreq._.js → node_modules_0ptcnmeaxvd_a._.js} +22 -2
- package/.next/standalone/.next/server/chunks/ssr/node_modules_@opentelemetry_api_build_esm_index_0ntwr8lzj6p2i.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_html-to-image_es_index_0tqc05n832v7a.js → node_modules_html-to-image_es_index_1gk40bvx2bftt.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_0bz67659f5z-3._.js +32 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_0janj0i6dqko7._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_0ocrceo0c9psx._.js +32 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_1alv566ojmz5j._.js +32 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_1khq67j4vo9y4._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_shared_lib_0ftnv26hg1lry._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_0dagmbznysrc2._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_11bnuznb72p7z._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/package_json_[json]_cjs_013tntikdft59._.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +13 -13
- package/.next/standalone/.next/server/middleware.js +2 -2
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/preview-props.json +3 -3
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +23 -23
- package/.next/standalone/.next/static/chunks/061bksch79zq2.js +1 -0
- package/.next/standalone/.next/static/chunks/{0wobqgosirs8p.js → 1l9lji2he-mbw.js} +1 -1
- package/.next/standalone/.next/static/chunks/{1kduj74-715jh.js → 1mkf3bas1g5ka.js} +1 -1
- package/.next/standalone/.next/static/chunks/22gs9785ug-vp.js +1 -0
- package/.next/standalone/.next/static/chunks/{0el9n3h9_zp5m.js → 2f9-xdgd1o3r5.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0umzct31duk5g.js → 2q-6h4rclnu98.js} +1 -1
- package/.next/standalone/.next/static/chunks/{27cavoc8paelg.js → 2x-77r0k0xm3b.js} +1 -1
- package/.next/standalone/.next/static/chunks/2xox4fr0q-ftn.js +1 -0
- package/.next/standalone/.next/static/chunks/3lgxb73wehfv2.js +1 -0
- package/.next/standalone/.next/static/chunks/{063al_q720fkj.js → 3xgxl1s_in776.js} +2 -2
- package/.next/standalone/.next/static/chunks/44rukkkzacqkl.js +6 -0
- package/.next/standalone/SECURITY.md +20 -4
- package/.next/standalone/fp-cloud-cli/CHANGELOG.md +15 -1
- package/.next/standalone/fp-cloud-cli/fp_cli/_version.py +1 -1
- package/.next/standalone/fp-cloud-cli/uv.lock +4 -4
- package/.next/standalone/hermes-plugin/plugin.yaml +1 -1
- package/.next/standalone/node_modules/@next/env/package.json +1 -1
- package/.next/standalone/node_modules/next/dist/build/swc/index.js +1 -1
- package/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo-experimental.runtime.prod.js +24 -24
- package/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.prod.js +26 -26
- package/.next/standalone/node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js +3 -3
- package/.next/standalone/node_modules/next/dist/compiled/next-server/pages-turbo.runtime.prod.js +13 -13
- package/.next/standalone/node_modules/next/dist/lib/patch-incorrect-lockfile.js +3 -3
- package/.next/standalone/node_modules/next/dist/server/app-render/app-render.js +41 -40
- package/.next/standalone/node_modules/next/dist/server/app-render/async-local-storage.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/app-render/dynamic-rendering-validation.js +814 -0
- package/.next/standalone/node_modules/next/dist/server/app-render/dynamic-rendering.js +1 -799
- package/.next/standalone/node_modules/next/dist/server/base-server.js +39 -5
- package/.next/standalone/node_modules/next/dist/server/config.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-turbopack.js +2 -2
- package/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/lib/app-info-log.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/lib/dedupe-fetch.js +4 -43
- package/.next/standalone/node_modules/next/dist/server/lib/patch-fetch-symbol.js +13 -0
- package/.next/standalone/node_modules/next/dist/server/lib/patch-fetch.js +3 -7
- package/.next/standalone/node_modules/next/dist/server/lib/router-server.js +3 -3
- package/.next/standalone/node_modules/next/dist/server/lib/router-utils/instrumentation-globals.external.js +77 -12
- package/.next/standalone/node_modules/next/dist/server/lib/start-server.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/lib/trace/constants.js +12 -0
- package/.next/standalone/node_modules/next/dist/server/lib/trace/tracer.js +30 -14
- package/.next/standalone/node_modules/next/dist/server/next-server.js +10 -11
- package/.next/standalone/node_modules/next/dist/server/route-modules/pages/pages-handler.js +29 -23
- package/.next/standalone/node_modules/next/dist/server/route-modules/route-module.js +85 -8
- package/.next/standalone/node_modules/next/dist/server/use-cache/use-cache-wrapper.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/web/adapter.js +124 -65
- package/.next/standalone/node_modules/next/dist/server/web/forward-trace-context.js +102 -0
- package/.next/standalone/node_modules/next/dist/telemetry/anonymous-meta.js +1 -1
- package/.next/standalone/node_modules/next/dist/telemetry/events/swc-load-failure.js +1 -1
- package/.next/standalone/node_modules/next/dist/telemetry/events/version.js +2 -2
- package/.next/standalone/node_modules/next/package.json +10 -10
- package/.next/standalone/node_modules/react/cjs/react.production.js +1 -1
- package/.next/standalone/node_modules/react/package.json +1 -1
- package/.next/standalone/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.js +1 -1
- package/.next/standalone/node_modules/react-dom/cjs/react-dom-server-legacy.node.production.js +1 -1
- package/.next/standalone/node_modules/react-dom/cjs/react-dom-server.browser.production.js +31 -27
- package/.next/standalone/node_modules/react-dom/cjs/react-dom-server.edge.production.js +33 -27
- package/.next/standalone/node_modules/react-dom/cjs/react-dom-server.node.production.js +38 -30
- package/.next/standalone/node_modules/react-dom/cjs/react-dom.production.js +1 -1
- package/.next/standalone/node_modules/react-dom/package.json +2 -2
- package/.next/standalone/package.json +10 -10
- package/.next/standalone/sdk/python/CHANGELOG.md +8 -4
- package/.next/standalone/sdk/python/failproofai_sdk/evaluator/source.py +2 -2
- package/.next/standalone/sdk/python/pyproject.toml +2 -7
- package/.next/standalone/sdk/python/skill/references/frameworks.md +0 -15
- package/.next/standalone/sdk/python/tests/test_docs.py +1 -4
- package/.next/standalone/sdk/python/tests/test_evaluator_source.py +1 -1
- package/.next/standalone/sdk/python/tests/test_packaging.py +4 -7
- package/.next/standalone/sdk/python/tests/test_zero_dependencies.py +2 -13
- package/.next/standalone/sdk/python/uv.lock +40 -902
- package/.next/standalone/sdk/typescript/CHANGELOG.md +52 -0
- package/.next/standalone/sdk/typescript/integration/fixtures/ai-4/package-lock.json +176 -68
- package/.next/standalone/sdk/typescript/integration/fixtures/ai-4/package.json +2 -2
- package/.next/standalone/sdk/typescript/integration/fixtures/ai-5/package-lock.json +3 -3
- package/.next/standalone/sdk/typescript/integration/fixtures/ai-5/package.json +1 -1
- package/.next/standalone/sdk/typescript/integration/fixtures/langchain-0.3/package-lock.json +115 -98
- package/.next/standalone/sdk/typescript/integration/fixtures/langchain-0.3/package.json +3 -3
- package/.next/standalone/sdk/typescript/integration/fixtures/langchain-dup-core/package-lock.json +4 -4
- package/.next/standalone/sdk/typescript/integration/fixtures/langchain-dup-core/package.json +1 -1
- package/.next/standalone/sdk/typescript/integration/fixtures/llamaindex-0.11/package-lock.json +171 -149
- package/.next/standalone/sdk/typescript/integration/fixtures/llamaindex-0.11/package.json +5 -2
- package/.next/standalone/sdk/typescript/integration/fixtures/mastra-1/package-lock.json +27 -15
- package/.next/standalone/sdk/typescript/integration/fixtures/mastra-1/package.json +2 -1
- package/.next/standalone/sdk/typescript/integration/fixtures/runtimes/deno-npm.ts +1 -1
- package/.next/standalone/server.js +1 -1
- package/README.md +0 -6
- package/dist/cli.mjs +369 -221
- package/dist/worker.mjs +1 -1
- package/hermes-plugin/plugin.yaml +1 -1
- package/package.json +10 -10
- package/scripts/sync-agent-cli-harnesses-prompt.md +26 -31
- package/src/hooks/daemon-service.ts +168 -3
- package/src/hooks/uninstall-cli.ts +3 -0
- package/.next/standalone/.codex/hooks.json +0 -76
- package/.next/standalone/.cursor/hooks.json +0 -47
- package/.next/standalone/.factory/hooks.json +0 -112
- package/.next/standalone/.next/server/chunks/[externals]__1x24dzcbbq6-g._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0__a_je8fsn65._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0l-oi4gdtmlo5._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0t9ufnv5hi2hq._.js +0 -327
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1aaw59g-5uty7._.js +0 -322
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1hqpg6vgmfexv._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[externals]__0ilfh9mfnzsth._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[externals]__0ohnuzsaozaca._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0pwj2h2efe5f-._.js +0 -14
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_0zuikgt2xho-v._.js +0 -271
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_158jo-9mwvgad._.js +0 -291
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_19r82zsxo2jj1._.js +0 -291
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_1dupwucoqt5qm._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_shared_lib_03w27x2kh17_8._.js +0 -23
- package/.next/standalone/.next/static/chunks/0k7g_8x3o6gd-.js +0 -1
- package/.next/standalone/.next/static/chunks/12rug3jilwqzs.js +0 -1
- package/.next/standalone/.next/static/chunks/2701amhrbsbot.js +0 -1
- package/.next/standalone/.next/static/chunks/2ve23a7keupjw.js +0 -1
- package/.next/standalone/.next/static/chunks/3bv6xaoitjpnh.js +0 -6
- package/.next/standalone/.opencode/opencode.json +0 -4
- package/.next/standalone/.opencode/plugins/failproofai.mjs +0 -210
- package/.next/standalone/.pi/settings.json +0 -5
- package/.next/standalone/node_modules/react/cjs/react.development.js +0 -1330
- package/scripts/dev-hook.mjs +0 -333
- /package/.next/standalone/.next/static/{D7LY1YSrw96ZxKSpxxrFw → TdOlUedz_AHC-0Ops67a_}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{D7LY1YSrw96ZxKSpxxrFw → TdOlUedz_AHC-0Ops67a_}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{D7LY1YSrw96ZxKSpxxrFw → TdOlUedz_AHC-0Ops67a_}/_ssgManifest.js +0 -0
package/dist/cli.mjs
CHANGED
|
@@ -29,7 +29,7 @@ var __esm = (fn, res, err) => () => {
|
|
|
29
29
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
30
30
|
|
|
31
31
|
// package.json
|
|
32
|
-
var version2 = "1.0.
|
|
32
|
+
var version2 = "1.0.13-beta.2", package_default;
|
|
33
33
|
var init_package = __esm(() => {
|
|
34
34
|
package_default = {
|
|
35
35
|
name: "failproofai",
|
|
@@ -114,7 +114,7 @@ var init_package = __esm(() => {
|
|
|
114
114
|
access: "public"
|
|
115
115
|
},
|
|
116
116
|
devDependencies: {
|
|
117
|
-
"@anthropic-ai/sdk": "^
|
|
117
|
+
"@anthropic-ai/sdk": "^1.3.0",
|
|
118
118
|
"@mdx-js/mdx": "^3.1.1",
|
|
119
119
|
"@tailwindcss/postcss": "^4.3.1",
|
|
120
120
|
"@tanstack/react-virtual": "^3.14.10",
|
|
@@ -159,16 +159,16 @@ var init_package = __esm(() => {
|
|
|
159
159
|
browserslist: "4.28.8"
|
|
160
160
|
},
|
|
161
161
|
optionalDependencies: {
|
|
162
|
-
"@failproofai/failproofaid-linux-x64": "1.0.
|
|
163
|
-
"@failproofai/failproofaid-linux-arm64": "1.0.
|
|
164
|
-
"@failproofai/failproofaid-darwin-x64": "1.0.
|
|
165
|
-
"@failproofai/failproofaid-darwin-arm64": "1.0.
|
|
162
|
+
"@failproofai/failproofaid-linux-x64": "1.0.13-beta.2",
|
|
163
|
+
"@failproofai/failproofaid-linux-arm64": "1.0.13-beta.2",
|
|
164
|
+
"@failproofai/failproofaid-darwin-x64": "1.0.13-beta.2",
|
|
165
|
+
"@failproofai/failproofaid-darwin-arm64": "1.0.13-beta.2"
|
|
166
166
|
},
|
|
167
167
|
failproofaidBinaries: {
|
|
168
|
-
"linux-x64": "
|
|
169
|
-
"linux-arm64": "
|
|
170
|
-
"darwin-x64": "
|
|
171
|
-
"darwin-arm64": "
|
|
168
|
+
"linux-x64": "8301567948ddf752b6db30ed5998e62139df4c7e1669b280159a83a9b951b94c",
|
|
169
|
+
"linux-arm64": "ad53ec24d7c09b2dbc07b792c0739dc1e5f443fdb9a795174d3a40453f90bbcf",
|
|
170
|
+
"darwin-x64": "e4e65a1071a5793bafb73625dc49d211ff19d7e0d8c03c804959d1357aebea1e",
|
|
171
|
+
"darwin-arm64": "78aa90272e2ace07ac3648a419b961f8d8bfe56c7fd3a0193d3579085d77e9cb"
|
|
172
172
|
}
|
|
173
173
|
};
|
|
174
174
|
});
|
|
@@ -13494,12 +13494,14 @@ import {
|
|
|
13494
13494
|
mkdirSync as mkdirSync7,
|
|
13495
13495
|
mkdtempSync,
|
|
13496
13496
|
readFileSync as readFileSync7,
|
|
13497
|
+
readdirSync as readdirSync2,
|
|
13498
|
+
statSync as statSync10,
|
|
13497
13499
|
writeFileSync as writeFileSync5,
|
|
13498
13500
|
unlinkSync,
|
|
13499
13501
|
rmSync as rmSync5
|
|
13500
13502
|
} from "node:fs";
|
|
13501
13503
|
import { homedir as homedir5, tmpdir, userInfo } from "node:os";
|
|
13502
|
-
import { resolve as resolve8 } from "node:path";
|
|
13504
|
+
import { dirname as dirname7, resolve as resolve8 } from "node:path";
|
|
13503
13505
|
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
13504
13506
|
function setDaemonConfigured(value, installedVersion) {
|
|
13505
13507
|
try {
|
|
@@ -13611,6 +13613,63 @@ function systemdUnitDir() {
|
|
|
13611
13613
|
function systemdUnitPath(user = serviceUser()) {
|
|
13612
13614
|
return resolve8(systemdUnitDir(), systemdUnitName(user));
|
|
13613
13615
|
}
|
|
13616
|
+
function systemBinaryRoot(user = serviceUser()) {
|
|
13617
|
+
return resolve8(process.env.FAILPROOFAI_SYSTEM_BIN_DIR || "/opt/failproofai", user);
|
|
13618
|
+
}
|
|
13619
|
+
function systemBinaryDir() {
|
|
13620
|
+
return resolve8(systemBinaryRoot(), "bin");
|
|
13621
|
+
}
|
|
13622
|
+
function daemonSystemBinaryDir() {
|
|
13623
|
+
return process.platform === "linux" ? systemBinaryRoot() : null;
|
|
13624
|
+
}
|
|
13625
|
+
function systemBinaryTarget(binaryPath) {
|
|
13626
|
+
if (process.platform !== "linux" || process.env.FAILPROOFAI_DAEMON_BINARY)
|
|
13627
|
+
return null;
|
|
13628
|
+
try {
|
|
13629
|
+
if (!statSync10(binaryPath).isFile())
|
|
13630
|
+
return null;
|
|
13631
|
+
} catch {
|
|
13632
|
+
return null;
|
|
13633
|
+
}
|
|
13634
|
+
return resolve8(systemBinaryDir(), `failproofaid-${version2}`);
|
|
13635
|
+
}
|
|
13636
|
+
function selinuxEnabled() {
|
|
13637
|
+
return existsSync11("/sys/fs/selinux/enforce");
|
|
13638
|
+
}
|
|
13639
|
+
function stageSystemBinary(binaryPath) {
|
|
13640
|
+
const target = systemBinaryTarget(binaryPath);
|
|
13641
|
+
if (!target)
|
|
13642
|
+
return binaryPath;
|
|
13643
|
+
const dir = systemBinaryDir();
|
|
13644
|
+
const staging = `${target}.${process.pid}.tmp`;
|
|
13645
|
+
runPrivileged("install", ["-d", "-m", "0755", dir]);
|
|
13646
|
+
try {
|
|
13647
|
+
runPrivileged("install", ["-m", "0755", binaryPath, staging]);
|
|
13648
|
+
runPrivileged("mv", ["-f", staging, target]);
|
|
13649
|
+
} catch (err) {
|
|
13650
|
+
try {
|
|
13651
|
+
runPrivileged("rm", ["-f", staging]);
|
|
13652
|
+
} catch {}
|
|
13653
|
+
throw err;
|
|
13654
|
+
}
|
|
13655
|
+
if (selinuxEnabled()) {
|
|
13656
|
+
const root = systemBinaryRoot();
|
|
13657
|
+
try {
|
|
13658
|
+
runPrivileged("restorecon", ["-R", root]);
|
|
13659
|
+
} catch (err) {
|
|
13660
|
+
hookLogWarn(`restorecon on ${root} failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
13661
|
+
}
|
|
13662
|
+
}
|
|
13663
|
+
return target;
|
|
13664
|
+
}
|
|
13665
|
+
function pruneSystemBinaries(current) {
|
|
13666
|
+
try {
|
|
13667
|
+
const dir = systemBinaryDir();
|
|
13668
|
+
const stale = readdirSync2(dir).filter((f) => f.startsWith("failproofaid-")).map((f) => resolve8(dir, f)).filter((p) => p !== current).map((p) => ({ p, mtime: statSync10(p).mtimeMs })).sort((a, b) => b.mtime - a.mtime).slice(1);
|
|
13669
|
+
for (const { p } of stale)
|
|
13670
|
+
runPrivileged("rm", ["-f", p]);
|
|
13671
|
+
} catch {}
|
|
13672
|
+
}
|
|
13614
13673
|
function legacySystemdUserUnitPath() {
|
|
13615
13674
|
return resolve8(homedir5(), ".config", "systemd", "user", "failproofaid.service");
|
|
13616
13675
|
}
|
|
@@ -13791,9 +13850,17 @@ ${envBlock} <key>StandardOutPath</key>
|
|
|
13791
13850
|
}
|
|
13792
13851
|
function daemonInstallCommands(binaryPath, workerCmd, cliCmd) {
|
|
13793
13852
|
if (process.platform === "linux") {
|
|
13853
|
+
const target = systemBinaryTarget(binaryPath);
|
|
13854
|
+
const dir = systemBinaryDir();
|
|
13855
|
+
const stage = target ? [
|
|
13856
|
+
`sudo install -d -m 0755 ${dir}`,
|
|
13857
|
+
`sudo install -m 0755 ${binaryPath} ${target}`,
|
|
13858
|
+
`{ sudo restorecon -R ${systemBinaryRoot()} 2>/dev/null || true; }`
|
|
13859
|
+
] : [];
|
|
13794
13860
|
return [
|
|
13861
|
+
...stage,
|
|
13795
13862
|
`sudo tee ${systemdUnitPath()} <<'EOF'
|
|
13796
|
-
${systemdUnitContents(binaryPath, workerCmd, cliCmd)}EOF`,
|
|
13863
|
+
${systemdUnitContents(target ?? binaryPath, workerCmd, cliCmd)}EOF`,
|
|
13797
13864
|
"sudo systemctl daemon-reload",
|
|
13798
13865
|
`sudo systemctl enable ${systemdUnitName()}`,
|
|
13799
13866
|
`sudo systemctl restart ${systemdUnitName()}`
|
|
@@ -13821,9 +13888,11 @@ async function installDaemonService() {
|
|
|
13821
13888
|
};
|
|
13822
13889
|
}
|
|
13823
13890
|
removeLegacyUserService();
|
|
13891
|
+
let execPath = binaryPath;
|
|
13824
13892
|
try {
|
|
13825
13893
|
if (process.platform === "linux") {
|
|
13826
|
-
|
|
13894
|
+
execPath = stageSystemBinary(binaryPath);
|
|
13895
|
+
writePrivilegedFile(systemdUnitPath(), systemdUnitContents(execPath, workerCmd, cliCmd));
|
|
13827
13896
|
runPrivileged("systemctl", ["daemon-reload"]);
|
|
13828
13897
|
runPrivileged("systemctl", ["enable", systemdUnitName()]);
|
|
13829
13898
|
restartSystemdUnit();
|
|
@@ -13847,6 +13916,8 @@ async function installDaemonService() {
|
|
|
13847
13916
|
hookLogWarn(`daemon service install failed: ${reason}`);
|
|
13848
13917
|
return { installed: false, reason };
|
|
13849
13918
|
}
|
|
13919
|
+
if (execPath !== binaryPath)
|
|
13920
|
+
pruneSystemBinaries(execPath);
|
|
13850
13921
|
return { installed: true };
|
|
13851
13922
|
}
|
|
13852
13923
|
async function probeDaemon() {
|
|
@@ -14079,6 +14150,13 @@ async function uninstallDaemonService() {
|
|
|
14079
14150
|
try {
|
|
14080
14151
|
runPrivileged("systemctl", ["daemon-reload"]);
|
|
14081
14152
|
} catch {}
|
|
14153
|
+
const binRoot = systemBinaryRoot();
|
|
14154
|
+
if (existsSync11(binRoot)) {
|
|
14155
|
+
runPrivileged("rm", ["-rf", binRoot]);
|
|
14156
|
+
try {
|
|
14157
|
+
runPrivileged("rmdir", [dirname7(binRoot)]);
|
|
14158
|
+
} catch {}
|
|
14159
|
+
}
|
|
14082
14160
|
} else {
|
|
14083
14161
|
const plistPath = launchdPlistPath();
|
|
14084
14162
|
if (!existsSync11(plistPath))
|
|
@@ -14161,9 +14239,9 @@ var init_daemon_service = __esm(() => {
|
|
|
14161
14239
|
// src/hooks/codex-system-hooks.ts
|
|
14162
14240
|
import { execSync as execSync3 } from "node:child_process";
|
|
14163
14241
|
import { createHash as createHash4 } from "node:crypto";
|
|
14164
|
-
import { accessSync, chmodSync as chmodSync5, constants as fsConstants3, existsSync as existsSync12, readFileSync as readFileSync8, rmSync as rmSync6, statSync as
|
|
14242
|
+
import { accessSync, chmodSync as chmodSync5, constants as fsConstants3, existsSync as existsSync12, readFileSync as readFileSync8, rmSync as rmSync6, statSync as statSync11 } from "node:fs";
|
|
14165
14243
|
import { homedir as homedir6 } from "node:os";
|
|
14166
|
-
import { dirname as
|
|
14244
|
+
import { dirname as dirname8, resolve as resolve9 } from "node:path";
|
|
14167
14245
|
function codexSystemConfigPath() {
|
|
14168
14246
|
const override = process.env.FAILPROOFAI_CODEX_SYSTEM_CONFIG;
|
|
14169
14247
|
if (override !== undefined)
|
|
@@ -14285,9 +14363,9 @@ function resolvedPath(deps) {
|
|
|
14285
14363
|
return deps.path !== undefined ? deps.path : codexSystemConfigPath();
|
|
14286
14364
|
}
|
|
14287
14365
|
function writableDirectly(path) {
|
|
14288
|
-
let dir =
|
|
14366
|
+
let dir = dirname8(path);
|
|
14289
14367
|
while (!existsSync12(dir)) {
|
|
14290
|
-
const parent =
|
|
14368
|
+
const parent = dirname8(dir);
|
|
14291
14369
|
if (parent === dir)
|
|
14292
14370
|
return false;
|
|
14293
14371
|
dir = parent;
|
|
@@ -14303,7 +14381,7 @@ function writableDirectly(path) {
|
|
|
14303
14381
|
}
|
|
14304
14382
|
function fileMode(path) {
|
|
14305
14383
|
try {
|
|
14306
|
-
return (
|
|
14384
|
+
return (statSync11(path).mode & 511).toString(8).padStart(4, "0");
|
|
14307
14385
|
} catch {
|
|
14308
14386
|
return "0644";
|
|
14309
14387
|
}
|
|
@@ -14314,7 +14392,7 @@ function writeSystemFile(path, contents, mode, direct) {
|
|
|
14314
14392
|
chmodSync5(path, parseInt(mode, 8));
|
|
14315
14393
|
return;
|
|
14316
14394
|
}
|
|
14317
|
-
runPrivileged("install", ["-d", "-m", "0755",
|
|
14395
|
+
runPrivileged("install", ["-d", "-m", "0755", dirname8(path)]);
|
|
14318
14396
|
writePrivilegedFile(path, contents, mode);
|
|
14319
14397
|
}
|
|
14320
14398
|
function removeSystemFile(path, direct) {
|
|
@@ -14680,19 +14758,19 @@ var init_codex_system_hooks = __esm(() => {
|
|
|
14680
14758
|
});
|
|
14681
14759
|
|
|
14682
14760
|
// lib/hermes-profiles.ts
|
|
14683
|
-
import { existsSync as existsSync13, readdirSync as
|
|
14761
|
+
import { existsSync as existsSync13, readdirSync as readdirSync3 } from "node:fs";
|
|
14684
14762
|
import { homedir as homedir7 } from "node:os";
|
|
14685
|
-
import { basename as basename2, dirname as
|
|
14763
|
+
import { basename as basename2, dirname as dirname9, join as join4, resolve as resolve10 } from "node:path";
|
|
14686
14764
|
function hermesRoot() {
|
|
14687
14765
|
const env = (process.env.HERMES_HOME || "").trim();
|
|
14688
14766
|
if (env) {
|
|
14689
14767
|
let home = resolve10(env);
|
|
14690
|
-
const parent =
|
|
14768
|
+
const parent = dirname9(home);
|
|
14691
14769
|
if (basename2(parent) === PROFILES_DIR)
|
|
14692
|
-
home =
|
|
14770
|
+
home = dirname9(parent);
|
|
14693
14771
|
const base = basename2(home);
|
|
14694
14772
|
if (base === STANDARD_HOME || base.startsWith(SIBLING_HOME_PREFIX)) {
|
|
14695
|
-
return join4(
|
|
14773
|
+
return join4(dirname9(home), STANDARD_HOME);
|
|
14696
14774
|
}
|
|
14697
14775
|
return home;
|
|
14698
14776
|
}
|
|
@@ -14715,7 +14793,7 @@ function listHermesProfiles() {
|
|
|
14715
14793
|
const seen = new Set([HERMES_DEFAULT_PROFILE]);
|
|
14716
14794
|
let names = [];
|
|
14717
14795
|
try {
|
|
14718
|
-
names =
|
|
14796
|
+
names = readdirSync3(join4(root, PROFILES_DIR), { withFileTypes: true }).filter((e) => (e.isDirectory() || e.isSymbolicLink()) && !e.name.startsWith(".")).map((e) => e.name).sort();
|
|
14719
14797
|
} catch {}
|
|
14720
14798
|
for (const name of names) {
|
|
14721
14799
|
if (seen.has(name))
|
|
@@ -14726,9 +14804,9 @@ function listHermesProfiles() {
|
|
|
14726
14804
|
if (basename2(root) !== STANDARD_HOME)
|
|
14727
14805
|
return out;
|
|
14728
14806
|
let siblings = [];
|
|
14729
|
-
const parent =
|
|
14807
|
+
const parent = dirname9(root);
|
|
14730
14808
|
try {
|
|
14731
|
-
siblings =
|
|
14809
|
+
siblings = readdirSync3(parent, { withFileTypes: true }).filter((entry) => (entry.isDirectory() || entry.isSymbolicLink()) && entry.name.startsWith(SIBLING_HOME_PREFIX) && entry.name.length > SIBLING_HOME_PREFIX.length && existsSync13(join4(parent, entry.name, "config.yaml"))).map((entry) => ({
|
|
14732
14810
|
name: entry.name.slice(SIBLING_HOME_PREFIX.length),
|
|
14733
14811
|
home: join4(parent, entry.name)
|
|
14734
14812
|
})).sort((a, b) => a.name.localeCompare(b.name));
|
|
@@ -14769,9 +14847,9 @@ var PROFILES_DIR = "profiles", STANDARD_HOME = ".hermes", SIBLING_HOME_PREFIX =
|
|
|
14769
14847
|
var init_hermes_profiles = () => {};
|
|
14770
14848
|
|
|
14771
14849
|
// lib/openclaw-profiles.ts
|
|
14772
|
-
import { existsSync as existsSync14, readdirSync as
|
|
14850
|
+
import { existsSync as existsSync14, readdirSync as readdirSync4 } from "node:fs";
|
|
14773
14851
|
import { homedir as homedir8 } from "node:os";
|
|
14774
|
-
import { basename as basename3, dirname as
|
|
14852
|
+
import { basename as basename3, dirname as dirname10, join as join5, resolve as resolve11 } from "node:path";
|
|
14775
14853
|
function openclawProfileHome() {
|
|
14776
14854
|
const stateDir = (process.env.OPENCLAW_STATE_DIR ?? "").trim();
|
|
14777
14855
|
if (stateDir)
|
|
@@ -14781,7 +14859,7 @@ function openclawProfileHome() {
|
|
|
14781
14859
|
return resolve11(openclawHome);
|
|
14782
14860
|
const configPath = (process.env.OPENCLAW_CONFIG_PATH || "").trim();
|
|
14783
14861
|
if (configPath)
|
|
14784
|
-
return
|
|
14862
|
+
return dirname10(resolve11(configPath));
|
|
14785
14863
|
return join5(homedir8(), ".openclaw");
|
|
14786
14864
|
}
|
|
14787
14865
|
function listOpenClawProfiles() {
|
|
@@ -14790,14 +14868,14 @@ function listOpenClawProfiles() {
|
|
|
14790
14868
|
if (activeBase !== ".openclaw" && !activeBase.startsWith(".openclaw-")) {
|
|
14791
14869
|
return [{ name: OPENCLAW_DEFAULT_PROFILE, home: activeHome }];
|
|
14792
14870
|
}
|
|
14793
|
-
const parent =
|
|
14871
|
+
const parent = dirname10(activeHome);
|
|
14794
14872
|
const defaultHome = join5(parent, ".openclaw");
|
|
14795
14873
|
const out = [
|
|
14796
14874
|
{ name: OPENCLAW_DEFAULT_PROFILE, home: defaultHome }
|
|
14797
14875
|
];
|
|
14798
14876
|
let entries;
|
|
14799
14877
|
try {
|
|
14800
|
-
entries =
|
|
14878
|
+
entries = readdirSync4(parent, { withFileTypes: true });
|
|
14801
14879
|
} catch {
|
|
14802
14880
|
return out;
|
|
14803
14881
|
}
|
|
@@ -14827,7 +14905,7 @@ import {
|
|
|
14827
14905
|
symlinkSync,
|
|
14828
14906
|
unlinkSync as unlinkSync2
|
|
14829
14907
|
} from "node:fs";
|
|
14830
|
-
import { resolve as resolve12, dirname as
|
|
14908
|
+
import { resolve as resolve12, dirname as dirname11, basename as basename4 } from "node:path";
|
|
14831
14909
|
import { fileURLToPath } from "node:url";
|
|
14832
14910
|
import { homedir as homedir9 } from "node:os";
|
|
14833
14911
|
function readJsonFile(path) {
|
|
@@ -14937,7 +15015,7 @@ function isMarkedCopilotHook(hook) {
|
|
|
14937
15015
|
return false;
|
|
14938
15016
|
}
|
|
14939
15017
|
function opencodePluginFilePath(settingsPath) {
|
|
14940
|
-
return resolve12(
|
|
15018
|
+
return resolve12(dirname11(settingsPath), "plugins", "failproofai.mjs");
|
|
14941
15019
|
}
|
|
14942
15020
|
function buildOpenCodePluginShim(binaryPath, scope) {
|
|
14943
15021
|
const useNpx = scope === "project";
|
|
@@ -15177,7 +15255,7 @@ function getHermesPluginSourcePath() {
|
|
|
15177
15255
|
const fromEnv = process.env.FAILPROOFAI_PACKAGE_ROOT;
|
|
15178
15256
|
if (fromEnv)
|
|
15179
15257
|
return resolve12(fromEnv, HERMES_PLUGIN_SOURCE_DIR);
|
|
15180
|
-
return findHermesPluginSourcePath(
|
|
15258
|
+
return findHermesPluginSourcePath(dirname11(fileURLToPath(import.meta.url)));
|
|
15181
15259
|
}
|
|
15182
15260
|
function findHermesPluginSourcePath(startDir) {
|
|
15183
15261
|
let dir = resolve12(startDir);
|
|
@@ -15185,7 +15263,7 @@ function findHermesPluginSourcePath(startDir) {
|
|
|
15185
15263
|
const candidate = resolve12(dir, HERMES_PLUGIN_SOURCE_DIR);
|
|
15186
15264
|
if (existsSync15(resolve12(candidate, "plugin.yaml")))
|
|
15187
15265
|
return candidate;
|
|
15188
|
-
const parent =
|
|
15266
|
+
const parent = dirname11(dir);
|
|
15189
15267
|
if (parent === dir)
|
|
15190
15268
|
break;
|
|
15191
15269
|
dir = parent;
|
|
@@ -15193,7 +15271,7 @@ function findHermesPluginSourcePath(startDir) {
|
|
|
15193
15271
|
return resolve12(startDir, "..", "..", HERMES_PLUGIN_SOURCE_DIR);
|
|
15194
15272
|
}
|
|
15195
15273
|
function hermesPluginPathForSettings(settingsPath) {
|
|
15196
|
-
return resolve12(
|
|
15274
|
+
return resolve12(dirname11(settingsPath), "plugins", HERMES_PLUGIN_ID);
|
|
15197
15275
|
}
|
|
15198
15276
|
function pathPresent(path) {
|
|
15199
15277
|
try {
|
|
@@ -15207,7 +15285,7 @@ function hasAllHermesPluginFiles(dir) {
|
|
|
15207
15285
|
return HERMES_PLUGIN_FILES.every((file) => existsSync15(resolve12(dir, file)));
|
|
15208
15286
|
}
|
|
15209
15287
|
function hermesLinkRecordPath(pluginPath) {
|
|
15210
|
-
return resolve12(
|
|
15288
|
+
return resolve12(dirname11(pluginPath), HERMES_LINK_RECORD);
|
|
15211
15289
|
}
|
|
15212
15290
|
function readHermesLinkRecord(pluginPath) {
|
|
15213
15291
|
try {
|
|
@@ -15230,10 +15308,10 @@ function isOwnedHermesPluginLink(pluginPath, target) {
|
|
|
15230
15308
|
return true;
|
|
15231
15309
|
if (samePath(target, getHermesPluginSourcePath()))
|
|
15232
15310
|
return true;
|
|
15233
|
-
const pkgRoot =
|
|
15311
|
+
const pkgRoot = dirname11(resolve12(target));
|
|
15234
15312
|
if (basename4(resolve12(target)) !== HERMES_PLUGIN_SOURCE_DIR)
|
|
15235
15313
|
return false;
|
|
15236
|
-
if (basename4(pkgRoot) !== "failproofai" || basename4(
|
|
15314
|
+
if (basename4(pkgRoot) !== "failproofai" || basename4(dirname11(pkgRoot)) !== "node_modules")
|
|
15237
15315
|
return false;
|
|
15238
15316
|
try {
|
|
15239
15317
|
const pkg = JSON.parse(readFileSync9(resolve12(pkgRoot, "package.json"), "utf8"));
|
|
@@ -15265,7 +15343,7 @@ function hermesPluginState(settingsPath) {
|
|
|
15265
15343
|
if (isLink) {
|
|
15266
15344
|
let target;
|
|
15267
15345
|
try {
|
|
15268
|
-
target = resolve12(
|
|
15346
|
+
target = resolve12(dirname11(pluginPath), readlinkSync2(pluginPath));
|
|
15269
15347
|
} catch {
|
|
15270
15348
|
return { kind: "foreign" };
|
|
15271
15349
|
}
|
|
@@ -15310,7 +15388,7 @@ function installHermesPlugin(settingsPath, deps = {}) {
|
|
|
15310
15388
|
}
|
|
15311
15389
|
return "unchanged";
|
|
15312
15390
|
}
|
|
15313
|
-
mkdirSync8(
|
|
15391
|
+
mkdirSync8(dirname11(destination), { recursive: true });
|
|
15314
15392
|
const suffix = `${process.pid}-${Date.now()}`;
|
|
15315
15393
|
const temporary = `${destination}.install-${suffix}`;
|
|
15316
15394
|
let linked = false;
|
|
@@ -16116,7 +16194,7 @@ var init_integrations = __esm(() => {
|
|
|
16116
16194
|
const effectiveScope = scope ?? "project";
|
|
16117
16195
|
const settingsPath = effectiveScope === "user" ? resolve12(homedir9(), ".config", "opencode", "opencode.json") : resolve12(process.cwd(), ".opencode", "opencode.json");
|
|
16118
16196
|
const pluginPath = opencodePluginFilePath(settingsPath);
|
|
16119
|
-
mkdirSync8(
|
|
16197
|
+
mkdirSync8(dirname11(pluginPath), { recursive: true });
|
|
16120
16198
|
writeConfigFileAtomic(pluginPath, buildOpenCodePluginShim(binaryPath, effectiveScope), { symlinks: "replace" });
|
|
16121
16199
|
if (!Array.isArray(s.plugin))
|
|
16122
16200
|
s.plugin = [];
|
|
@@ -19227,7 +19305,7 @@ var init_custom_hooks_registry = __esm(() => {
|
|
|
19227
19305
|
// src/hooks/loader-utils.ts
|
|
19228
19306
|
import { readFile as readFile2, writeFile as writeFile2, unlink, access, mkdir, lstat } from "fs/promises";
|
|
19229
19307
|
import { tmpdir as tmpdir2 } from "os";
|
|
19230
|
-
import { resolve as resolve13, dirname as
|
|
19308
|
+
import { resolve as resolve13, dirname as dirname12, relative as relative2, join as join6 } from "path";
|
|
19231
19309
|
import { pathToFileURL } from "url";
|
|
19232
19310
|
import { createHash as createHash5 } from "crypto";
|
|
19233
19311
|
function isTmpArtifact(name) {
|
|
@@ -19268,7 +19346,7 @@ async function findDistIndex() {
|
|
|
19268
19346
|
return candidate;
|
|
19269
19347
|
}
|
|
19270
19348
|
const candidates = [
|
|
19271
|
-
resolve13(
|
|
19349
|
+
resolve13(dirname12(process.execPath), "..", "assets", "dist", "index.js"),
|
|
19272
19350
|
resolve13(process.cwd(), "dist", "index.js"),
|
|
19273
19351
|
resolve13(process.cwd(), "node_modules", "failproofai", "dist", "index.js")
|
|
19274
19352
|
];
|
|
@@ -19359,7 +19437,7 @@ async function rewriteFileTree(entryPath, distUrl, distIndex, tmpSuffix = TMP_SU
|
|
|
19359
19437
|
if (distIndex) {
|
|
19360
19438
|
code = code.replace(/require\s*\(\s*(['"])(?:claudeye|failproofai)\1\s*\)/g, `require('${distIndex.replace(/\\/g, "\\\\")}')`);
|
|
19361
19439
|
}
|
|
19362
|
-
const dir =
|
|
19440
|
+
const dir = dirname12(filePath);
|
|
19363
19441
|
const rewrites = new Map;
|
|
19364
19442
|
for (const re of [LOCAL_IMPORT_RE, LOCAL_REQUIRE_RE]) {
|
|
19365
19443
|
const freshRe = new RegExp(re.source, re.flags);
|
|
@@ -19582,7 +19660,7 @@ var init_telemetry_id2 = __esm(() => {
|
|
|
19582
19660
|
// src/hooks/custom-hooks-loader.ts
|
|
19583
19661
|
import { resolve as resolve14, isAbsolute as isAbsolute2, basename as basename5 } from "node:path";
|
|
19584
19662
|
import { randomUUID } from "crypto";
|
|
19585
|
-
import { existsSync as existsSync16, readdirSync as
|
|
19663
|
+
import { existsSync as existsSync16, readdirSync as readdirSync5 } from "node:fs";
|
|
19586
19664
|
import { readFile as readFile3 } from "node:fs/promises";
|
|
19587
19665
|
import { pathToFileURL as pathToFileURL2 } from "node:url";
|
|
19588
19666
|
import { createHash as createHash6 } from "node:crypto";
|
|
@@ -19590,7 +19668,7 @@ function discoverPolicyFiles(dir) {
|
|
|
19590
19668
|
if (!existsSync16(dir))
|
|
19591
19669
|
return [];
|
|
19592
19670
|
try {
|
|
19593
|
-
const entries =
|
|
19671
|
+
const entries = readdirSync5(dir, { withFileTypes: true });
|
|
19594
19672
|
return entries.filter((e) => e.isFile() && CONVENTION_FILE_RE.test(e.name)).sort((a, b) => a.name.localeCompare(b.name)).map((e) => resolve14(dir, e.name));
|
|
19595
19673
|
} catch {
|
|
19596
19674
|
return [];
|
|
@@ -19600,7 +19678,7 @@ function findSkippedPolicyFiles(dir) {
|
|
|
19600
19678
|
if (!existsSync16(dir))
|
|
19601
19679
|
return [];
|
|
19602
19680
|
try {
|
|
19603
|
-
return
|
|
19681
|
+
return readdirSync5(dir, { withFileTypes: true }).filter((e) => e.isFile() && LOADABLE_EXT_RE.test(e.name) && !CONVENTION_FILE_RE.test(e.name) && !e.name.endsWith(".d.ts") && !isTmpArtifact(e.name)).map((e) => e.name).sort((a, b) => a.localeCompare(b));
|
|
19604
19682
|
} catch {
|
|
19605
19683
|
return [];
|
|
19606
19684
|
}
|
|
@@ -21447,7 +21525,7 @@ var init_pack_cli = __esm(() => {
|
|
|
21447
21525
|
// src/hooks/pack-store.ts
|
|
21448
21526
|
import { createHash as createHash7 } from "node:crypto";
|
|
21449
21527
|
import { existsSync as existsSync17, mkdirSync as mkdirSync9, readFileSync as readFileSync10, renameSync as renameSync6, rmSync as rmSync8, writeFileSync as writeFileSync7 } from "node:fs";
|
|
21450
|
-
import { dirname as
|
|
21528
|
+
import { dirname as dirname13, resolve as resolve15 } from "node:path";
|
|
21451
21529
|
function baseUrl2() {
|
|
21452
21530
|
return (process.env.FAILPROOFAI_PACK_BASE_URL || DEFAULT_BASE_URL2).replace(/\/+$/, "");
|
|
21453
21531
|
}
|
|
@@ -21618,7 +21696,7 @@ function sha256(bytes) {
|
|
|
21618
21696
|
function writeAtomic(target, bytes) {
|
|
21619
21697
|
const tempPath = `${target}.${process.pid}.tmp`;
|
|
21620
21698
|
try {
|
|
21621
|
-
mkdirSync9(
|
|
21699
|
+
mkdirSync9(dirname13(target), { recursive: true });
|
|
21622
21700
|
writeFileSync7(tempPath, bytes);
|
|
21623
21701
|
renameSync6(tempPath, target);
|
|
21624
21702
|
} catch (err) {
|
|
@@ -22963,10 +23041,10 @@ import {
|
|
|
22963
23041
|
writeFileSync as writeFileSync8,
|
|
22964
23042
|
appendFileSync as appendFileSync2,
|
|
22965
23043
|
renameSync as renameSync7,
|
|
22966
|
-
readdirSync as
|
|
23044
|
+
readdirSync as readdirSync6,
|
|
22967
23045
|
mkdirSync as mkdirSync10,
|
|
22968
23046
|
existsSync as existsSync18,
|
|
22969
|
-
statSync as
|
|
23047
|
+
statSync as statSync12,
|
|
22970
23048
|
unlinkSync as unlinkSync3
|
|
22971
23049
|
} from "node:fs";
|
|
22972
23050
|
import { join as join7 } from "node:path";
|
|
@@ -22987,7 +23065,7 @@ function acquireLock() {
|
|
|
22987
23065
|
if (e.code !== "EEXIST")
|
|
22988
23066
|
return;
|
|
22989
23067
|
try {
|
|
22990
|
-
const s =
|
|
23068
|
+
const s = statSync12(lockPath);
|
|
22991
23069
|
if (Date.now() - s.mtimeMs > LOCK_STALE_MS) {
|
|
22992
23070
|
writeFileSync8(lockPath, String(process.pid), "utf-8");
|
|
22993
23071
|
return;
|
|
@@ -23175,7 +23253,7 @@ function readJsonlFile(filePath) {
|
|
|
23175
23253
|
}
|
|
23176
23254
|
function getArchiveFiles() {
|
|
23177
23255
|
try {
|
|
23178
|
-
const files =
|
|
23256
|
+
const files = readdirSync6(storeDirValue());
|
|
23179
23257
|
return files.filter((f) => f.startsWith("page-") && f.endsWith(".jsonl")).sort((a, b) => {
|
|
23180
23258
|
const partsA = a.slice(5, -6).split("-");
|
|
23181
23259
|
const partsB = b.slice(5, -6).split("-");
|
|
@@ -23199,7 +23277,7 @@ var init_hook_activity_store = __esm(() => {
|
|
|
23199
23277
|
});
|
|
23200
23278
|
|
|
23201
23279
|
// src/hooks/delivery-health.ts
|
|
23202
|
-
import { existsSync as existsSync19, readFileSync as readFileSync12, readdirSync as
|
|
23280
|
+
import { existsSync as existsSync19, readFileSync as readFileSync12, readdirSync as readdirSync7, statSync as statSync13 } from "node:fs";
|
|
23203
23281
|
import { join as join8 } from "node:path";
|
|
23204
23282
|
function parseParkedName(name) {
|
|
23205
23283
|
const poison = name.endsWith(POISON_SUFFIX);
|
|
@@ -23241,7 +23319,7 @@ function deliveryHealth(home, now = Date.now(), connectedAt = home ? undefined :
|
|
|
23241
23319
|
return EMPTY;
|
|
23242
23320
|
let entries;
|
|
23243
23321
|
try {
|
|
23244
|
-
entries =
|
|
23322
|
+
entries = readdirSync7(dir);
|
|
23245
23323
|
} catch {
|
|
23246
23324
|
return EMPTY;
|
|
23247
23325
|
}
|
|
@@ -23257,7 +23335,7 @@ function deliveryHealth(home, now = Date.now(), connectedAt = home ? undefined :
|
|
|
23257
23335
|
const parsed = parseParkedName(name);
|
|
23258
23336
|
let mtime;
|
|
23259
23337
|
try {
|
|
23260
|
-
mtime =
|
|
23338
|
+
mtime = statSync13(join8(dir, name)).mtimeMs;
|
|
23261
23339
|
} catch {
|
|
23262
23340
|
continue;
|
|
23263
23341
|
}
|
|
@@ -24015,7 +24093,7 @@ var init_cursor_projects = __esm(() => {
|
|
|
24015
24093
|
});
|
|
24016
24094
|
|
|
24017
24095
|
// lib/sqlite-reader.ts
|
|
24018
|
-
import { existsSync as existsSync20, readFileSync as readFileSync13, statSync as
|
|
24096
|
+
import { existsSync as existsSync20, readFileSync as readFileSync13, statSync as statSync14 } from "node:fs";
|
|
24019
24097
|
import initSqlJs from "sql.js/dist/sql-asm.js";
|
|
24020
24098
|
async function tryNodeSqlite(dbPath) {
|
|
24021
24099
|
try {
|
|
@@ -24040,7 +24118,7 @@ function loadSqlJs() {
|
|
|
24040
24118
|
return sqlPromise;
|
|
24041
24119
|
}
|
|
24042
24120
|
function fileVersion2(path) {
|
|
24043
|
-
const stat =
|
|
24121
|
+
const stat = statSync14(path);
|
|
24044
24122
|
return { size: stat.size, mtimeMs: stat.mtimeMs, ctimeMs: stat.ctimeMs };
|
|
24045
24123
|
}
|
|
24046
24124
|
function sameVersion(a, b) {
|
|
@@ -24991,7 +25069,7 @@ var init_openclaw_db = __esm(() => {
|
|
|
24991
25069
|
|
|
24992
25070
|
// lib/openclaw-sessions.ts
|
|
24993
25071
|
import { readFile as readFile7 } from "node:fs/promises";
|
|
24994
|
-
import { readdirSync as
|
|
25072
|
+
import { readdirSync as readdirSync8, statSync as statSync15 } from "node:fs";
|
|
24995
25073
|
import { homedir as homedir16 } from "node:os";
|
|
24996
25074
|
import { join as join17 } from "node:path";
|
|
24997
25075
|
function openclawHome() {
|
|
@@ -25114,7 +25192,7 @@ function openclawLinesToLogEntries(lines, source = "session") {
|
|
|
25114
25192
|
}
|
|
25115
25193
|
function listOpenClawAgents() {
|
|
25116
25194
|
try {
|
|
25117
|
-
return
|
|
25195
|
+
return readdirSync8(join17(openclawHome(), "agents"), { withFileTypes: true }).filter((d) => d.isDirectory() && !d.name.startsWith(".")).map((d) => d.name).sort();
|
|
25118
25196
|
} catch {
|
|
25119
25197
|
return [];
|
|
25120
25198
|
}
|
|
@@ -25124,7 +25202,7 @@ function listOpenClawTranscripts() {
|
|
|
25124
25202
|
const out = [];
|
|
25125
25203
|
let agentIds;
|
|
25126
25204
|
try {
|
|
25127
|
-
agentIds =
|
|
25205
|
+
agentIds = readdirSync8(agentsDir, { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => d.name);
|
|
25128
25206
|
} catch {
|
|
25129
25207
|
return out;
|
|
25130
25208
|
}
|
|
@@ -25132,7 +25210,7 @@ function listOpenClawTranscripts() {
|
|
|
25132
25210
|
const sessionsDir = join17(agentsDir, agentId, "sessions");
|
|
25133
25211
|
let files;
|
|
25134
25212
|
try {
|
|
25135
|
-
files =
|
|
25213
|
+
files = readdirSync8(sessionsDir);
|
|
25136
25214
|
} catch {
|
|
25137
25215
|
continue;
|
|
25138
25216
|
}
|
|
@@ -25144,7 +25222,7 @@ function listOpenClawTranscripts() {
|
|
|
25144
25222
|
continue;
|
|
25145
25223
|
const transcriptPath = join17(sessionsDir, file);
|
|
25146
25224
|
try {
|
|
25147
|
-
const st =
|
|
25225
|
+
const st = statSync15(transcriptPath);
|
|
25148
25226
|
out.push({
|
|
25149
25227
|
agentId,
|
|
25150
25228
|
sessionId,
|
|
@@ -25389,7 +25467,7 @@ var init_openclaw_projects = __esm(() => {
|
|
|
25389
25467
|
|
|
25390
25468
|
// lib/factory-sessions.ts
|
|
25391
25469
|
import { readFile as readFile8 } from "node:fs/promises";
|
|
25392
|
-
import { readdirSync as
|
|
25470
|
+
import { readdirSync as readdirSync9, statSync as statSync16 } from "node:fs";
|
|
25393
25471
|
import { homedir as homedir17 } from "node:os";
|
|
25394
25472
|
import { join as join19 } from "node:path";
|
|
25395
25473
|
function factoryHome() {
|
|
@@ -25535,7 +25613,7 @@ function listFactoryTranscripts() {
|
|
|
25535
25613
|
const out = [];
|
|
25536
25614
|
let projectDirs;
|
|
25537
25615
|
try {
|
|
25538
|
-
projectDirs =
|
|
25616
|
+
projectDirs = readdirSync9(root, { withFileTypes: true }).filter((d) => d.isDirectory());
|
|
25539
25617
|
} catch {
|
|
25540
25618
|
return out;
|
|
25541
25619
|
}
|
|
@@ -25545,7 +25623,7 @@ function listFactoryTranscripts() {
|
|
|
25545
25623
|
const projectPath = join19(root, projectName);
|
|
25546
25624
|
let files;
|
|
25547
25625
|
try {
|
|
25548
|
-
files =
|
|
25626
|
+
files = readdirSync9(projectPath);
|
|
25549
25627
|
} catch {
|
|
25550
25628
|
continue;
|
|
25551
25629
|
}
|
|
@@ -25557,7 +25635,7 @@ function listFactoryTranscripts() {
|
|
|
25557
25635
|
continue;
|
|
25558
25636
|
const transcriptPath = join19(projectPath, file);
|
|
25559
25637
|
try {
|
|
25560
|
-
const st =
|
|
25638
|
+
const st = statSync16(transcriptPath);
|
|
25561
25639
|
out.push({ projectName, cwd, sessionId, transcriptPath, mtimeMs: st.mtimeMs, sizeBytes: st.size });
|
|
25562
25640
|
} catch {}
|
|
25563
25641
|
}
|
|
@@ -25977,7 +26055,7 @@ var init_devin_projects = __esm(() => {
|
|
|
25977
26055
|
|
|
25978
26056
|
// lib/antigravity-sessions.ts
|
|
25979
26057
|
import { readFile as readFile9 } from "node:fs/promises";
|
|
25980
|
-
import { readdirSync as
|
|
26058
|
+
import { readdirSync as readdirSync10, statSync as statSync17 } from "node:fs";
|
|
25981
26059
|
import { homedir as homedir19 } from "node:os";
|
|
25982
26060
|
import { join as join21 } from "node:path";
|
|
25983
26061
|
function antigravityHome() {
|
|
@@ -26102,7 +26180,7 @@ function listAntigravityTranscripts() {
|
|
|
26102
26180
|
const out = [];
|
|
26103
26181
|
let convoDirs;
|
|
26104
26182
|
try {
|
|
26105
|
-
convoDirs =
|
|
26183
|
+
convoDirs = readdirSync10(root, { withFileTypes: true }).filter((d) => d.isDirectory());
|
|
26106
26184
|
} catch {
|
|
26107
26185
|
return out;
|
|
26108
26186
|
}
|
|
@@ -26112,7 +26190,7 @@ function listAntigravityTranscripts() {
|
|
|
26112
26190
|
continue;
|
|
26113
26191
|
const transcriptPath = join21(root, conversationId, rel);
|
|
26114
26192
|
try {
|
|
26115
|
-
const st =
|
|
26193
|
+
const st = statSync17(transcriptPath);
|
|
26116
26194
|
if (!st.isFile())
|
|
26117
26195
|
continue;
|
|
26118
26196
|
out.push({ conversationId, transcriptPath, mtimeMs: st.mtimeMs, sizeBytes: st.size });
|
|
@@ -26125,7 +26203,7 @@ function findAntigravityTranscript(conversationId) {
|
|
|
26125
26203
|
return null;
|
|
26126
26204
|
const transcriptPath = join21(antigravityBrainRoot(), conversationId, antigravityTranscriptRelPath());
|
|
26127
26205
|
try {
|
|
26128
|
-
if (
|
|
26206
|
+
if (statSync17(transcriptPath).isFile())
|
|
26129
26207
|
return transcriptPath;
|
|
26130
26208
|
} catch {}
|
|
26131
26209
|
return null;
|
|
@@ -27040,9 +27118,9 @@ var init_log_entries = __esm(() => {
|
|
|
27040
27118
|
});
|
|
27041
27119
|
|
|
27042
27120
|
// lib/codex-sessions.ts
|
|
27043
|
-
import { readFileSync as readFileSync15, readdirSync as
|
|
27121
|
+
import { readFileSync as readFileSync15, readdirSync as readdirSync11, existsSync as existsSync22, writeFileSync as writeFileSync9, mkdirSync as mkdirSync11, statSync as statSync18 } from "node:fs";
|
|
27044
27122
|
import { readFile as readFile11 } from "node:fs/promises";
|
|
27045
|
-
import { dirname as
|
|
27123
|
+
import { dirname as dirname14, join as join27 } from "node:path";
|
|
27046
27124
|
import { homedir as homedir21 } from "node:os";
|
|
27047
27125
|
function readCache() {
|
|
27048
27126
|
try {
|
|
@@ -27055,7 +27133,7 @@ function readCache() {
|
|
|
27055
27133
|
}
|
|
27056
27134
|
function writeCacheEntry(sessionId, path) {
|
|
27057
27135
|
try {
|
|
27058
|
-
mkdirSync11(
|
|
27136
|
+
mkdirSync11(dirname14(CACHE_PATH), { recursive: true });
|
|
27059
27137
|
const cache = readCache();
|
|
27060
27138
|
cache[sessionId] = path;
|
|
27061
27139
|
writeFileSync9(CACHE_PATH, JSON.stringify(cache), "utf-8");
|
|
@@ -27063,7 +27141,7 @@ function writeCacheEntry(sessionId, path) {
|
|
|
27063
27141
|
}
|
|
27064
27142
|
function dirSearch(dir, sessionId) {
|
|
27065
27143
|
try {
|
|
27066
|
-
for (const f of
|
|
27144
|
+
for (const f of readdirSync11(dir, { withFileTypes: true })) {
|
|
27067
27145
|
if (f.isFile() && f.name.includes(sessionId) && f.name.endsWith(".jsonl")) {
|
|
27068
27146
|
return join27(dir, f.name);
|
|
27069
27147
|
}
|
|
@@ -27093,13 +27171,13 @@ function findCodexTranscript(sessionId) {
|
|
|
27093
27171
|
}
|
|
27094
27172
|
}
|
|
27095
27173
|
try {
|
|
27096
|
-
for (const y of
|
|
27174
|
+
for (const y of readdirSync11(root, { withFileTypes: true })) {
|
|
27097
27175
|
if (!y.isDirectory())
|
|
27098
27176
|
continue;
|
|
27099
|
-
for (const m of
|
|
27177
|
+
for (const m of readdirSync11(join27(root, y.name), { withFileTypes: true })) {
|
|
27100
27178
|
if (!m.isDirectory())
|
|
27101
27179
|
continue;
|
|
27102
|
-
for (const d of
|
|
27180
|
+
for (const d of readdirSync11(join27(root, y.name, m.name), { withFileTypes: true })) {
|
|
27103
27181
|
if (!d.isDirectory())
|
|
27104
27182
|
continue;
|
|
27105
27183
|
const hit = dirSearch(join27(root, y.name, m.name, d.name), sessionId);
|
|
@@ -27368,7 +27446,7 @@ var init_resolve_permission_mode = __esm(() => {
|
|
|
27368
27446
|
});
|
|
27369
27447
|
|
|
27370
27448
|
// lib/copilot-sessions.ts
|
|
27371
|
-
import { readFileSync as readFileSync17, readdirSync as
|
|
27449
|
+
import { readFileSync as readFileSync17, readdirSync as readdirSync12, existsSync as existsSync23, statSync as statSync19 } from "node:fs";
|
|
27372
27450
|
import { readFile as readFile12 } from "node:fs/promises";
|
|
27373
27451
|
import { join as join28, resolve as resolve17, sep as sep2 } from "node:path";
|
|
27374
27452
|
import { homedir as homedir22 } from "node:os";
|
|
@@ -27585,7 +27663,7 @@ var init_copilot_sessions = __esm(() => {
|
|
|
27585
27663
|
});
|
|
27586
27664
|
|
|
27587
27665
|
// lib/cursor-sessions.ts
|
|
27588
|
-
import { readFileSync as readFileSync18, readdirSync as
|
|
27666
|
+
import { readFileSync as readFileSync18, readdirSync as readdirSync13, existsSync as existsSync24, statSync as statSync20 } from "node:fs";
|
|
27589
27667
|
import { readFile as readFile13 } from "node:fs/promises";
|
|
27590
27668
|
import { basename as basename6, join as join29, resolve as resolve18, sep as sep3 } from "node:path";
|
|
27591
27669
|
import { homedir as homedir23 } from "node:os";
|
|
@@ -27599,7 +27677,7 @@ function getCursorSessionDir(sessionId) {
|
|
|
27599
27677
|
const projectsRoot = resolve18(home, NEW_PROJECTS_DIR2);
|
|
27600
27678
|
let projectEntries = [];
|
|
27601
27679
|
try {
|
|
27602
|
-
projectEntries =
|
|
27680
|
+
projectEntries = readdirSync13(projectsRoot, { withFileTypes: true });
|
|
27603
27681
|
} catch {}
|
|
27604
27682
|
for (const entry of projectEntries) {
|
|
27605
27683
|
if (!entry.isDirectory())
|
|
@@ -27841,7 +27919,7 @@ var init_cursor_sessions = __esm(() => {
|
|
|
27841
27919
|
});
|
|
27842
27920
|
|
|
27843
27921
|
// lib/pi-sessions.ts
|
|
27844
|
-
import { readFileSync as readFileSync19, readdirSync as
|
|
27922
|
+
import { readFileSync as readFileSync19, readdirSync as readdirSync14, existsSync as existsSync25, statSync as statSync21 } from "node:fs";
|
|
27845
27923
|
import { readFile as readFile14 } from "node:fs/promises";
|
|
27846
27924
|
import { join as join30, resolve as resolve19, sep as sep4 } from "node:path";
|
|
27847
27925
|
import { homedir as homedir24 } from "node:os";
|
|
@@ -27857,7 +27935,7 @@ function findPiTranscript(sessionId) {
|
|
|
27857
27935
|
const root = resolve19(getPiSessionStateRoot());
|
|
27858
27936
|
let cwdDirs;
|
|
27859
27937
|
try {
|
|
27860
|
-
cwdDirs =
|
|
27938
|
+
cwdDirs = readdirSync14(root);
|
|
27861
27939
|
} catch {
|
|
27862
27940
|
return null;
|
|
27863
27941
|
}
|
|
@@ -27867,7 +27945,7 @@ function findPiTranscript(sessionId) {
|
|
|
27867
27945
|
continue;
|
|
27868
27946
|
let files;
|
|
27869
27947
|
try {
|
|
27870
|
-
files =
|
|
27948
|
+
files = readdirSync14(cwdPath);
|
|
27871
27949
|
} catch {
|
|
27872
27950
|
continue;
|
|
27873
27951
|
}
|
|
@@ -28517,7 +28595,7 @@ var init_pack_failclosed = __esm(() => {
|
|
|
28517
28595
|
});
|
|
28518
28596
|
|
|
28519
28597
|
// src/hooks/session-pause.ts
|
|
28520
|
-
import { existsSync as existsSync27, mkdirSync as mkdirSync12, readdirSync as
|
|
28598
|
+
import { existsSync as existsSync27, mkdirSync as mkdirSync12, readdirSync as readdirSync15, readFileSync as readFileSync21, rmSync as rmSync10 } from "node:fs";
|
|
28521
28599
|
import { createHash as createHash8 } from "node:crypto";
|
|
28522
28600
|
import { join as join31, resolve as resolve21 } from "node:path";
|
|
28523
28601
|
function pauseStateDir() {
|
|
@@ -28631,7 +28709,7 @@ function listActivePauses(now = Date.now()) {
|
|
|
28631
28709
|
const out = [];
|
|
28632
28710
|
let names;
|
|
28633
28711
|
try {
|
|
28634
|
-
names =
|
|
28712
|
+
names = readdirSync15(dir);
|
|
28635
28713
|
} catch {
|
|
28636
28714
|
return [];
|
|
28637
28715
|
}
|
|
@@ -28682,14 +28760,14 @@ import {
|
|
|
28682
28760
|
existsSync as existsSync28,
|
|
28683
28761
|
mkdirSync as mkdirSync13,
|
|
28684
28762
|
readFileSync as readFileSync22,
|
|
28685
|
-
readdirSync as
|
|
28763
|
+
readdirSync as readdirSync16,
|
|
28686
28764
|
renameSync as renameSync9,
|
|
28687
28765
|
rmSync as rmSync11,
|
|
28688
28766
|
rmdirSync,
|
|
28689
|
-
statSync as
|
|
28767
|
+
statSync as statSync22,
|
|
28690
28768
|
writeFileSync as writeFileSync11
|
|
28691
28769
|
} from "node:fs";
|
|
28692
|
-
import { dirname as
|
|
28770
|
+
import { dirname as dirname15, isAbsolute as isAbsolute3, relative as relative4, resolve as resolve22 } from "node:path";
|
|
28693
28771
|
function migrateConventionPolicies() {
|
|
28694
28772
|
const from = legacy.customPoliciesDir();
|
|
28695
28773
|
if (!existsSync28(from))
|
|
@@ -28698,7 +28776,7 @@ function migrateConventionPolicies() {
|
|
|
28698
28776
|
const mergeInto = (dir, dest, prefix) => {
|
|
28699
28777
|
let entries;
|
|
28700
28778
|
try {
|
|
28701
|
-
entries =
|
|
28779
|
+
entries = readdirSync16(dir, { withFileTypes: true });
|
|
28702
28780
|
} catch {
|
|
28703
28781
|
return;
|
|
28704
28782
|
}
|
|
@@ -28720,7 +28798,7 @@ function migrateConventionPolicies() {
|
|
|
28720
28798
|
} catch {}
|
|
28721
28799
|
continue;
|
|
28722
28800
|
}
|
|
28723
|
-
if (entry.isDirectory() &&
|
|
28801
|
+
if (entry.isDirectory() && statSync22(target).isDirectory()) {
|
|
28724
28802
|
mergeInto(source, target, `${name}/`);
|
|
28725
28803
|
try {
|
|
28726
28804
|
rmdirSync(source);
|
|
@@ -28744,7 +28822,7 @@ function migrateLegacySpool() {
|
|
|
28744
28822
|
continue;
|
|
28745
28823
|
try {
|
|
28746
28824
|
mkdirSync13(to, { recursive: true });
|
|
28747
|
-
for (const entry of
|
|
28825
|
+
for (const entry of readdirSync16(from, { withFileTypes: true })) {
|
|
28748
28826
|
if (!entry.isFile())
|
|
28749
28827
|
continue;
|
|
28750
28828
|
let name = entry.name;
|
|
@@ -28771,7 +28849,7 @@ function migrateHookActivity() {
|
|
|
28771
28849
|
return [];
|
|
28772
28850
|
const moved = [];
|
|
28773
28851
|
try {
|
|
28774
|
-
const entries =
|
|
28852
|
+
const entries = readdirSync16(from, { withFileTypes: true }).filter((e) => e.isFile() && e.name.endsWith(".jsonl"));
|
|
28775
28853
|
if (entries.length === 0)
|
|
28776
28854
|
return [];
|
|
28777
28855
|
const to = hookActivityDir();
|
|
@@ -28887,7 +28965,7 @@ function writeCarriedPolicyConfig(carried) {
|
|
|
28887
28965
|
}
|
|
28888
28966
|
} catch {}
|
|
28889
28967
|
try {
|
|
28890
|
-
mkdirSync13(
|
|
28968
|
+
mkdirSync13(dirname15(to), { recursive: true });
|
|
28891
28969
|
writeFileSync11(to, JSON.stringify({ ...existing, ...carried }, null, 2) + `
|
|
28892
28970
|
`, "utf8");
|
|
28893
28971
|
} catch {
|
|
@@ -29079,12 +29157,12 @@ var init_untraced_note = __esm(() => {
|
|
|
29079
29157
|
});
|
|
29080
29158
|
|
|
29081
29159
|
// src/hooks/agent-roster.ts
|
|
29082
|
-
import { lstatSync as lstatSync4, readFileSync as readFileSync24, statSync as
|
|
29160
|
+
import { lstatSync as lstatSync4, readFileSync as readFileSync24, statSync as statSync23 } from "node:fs";
|
|
29083
29161
|
import { homedir as homedir26 } from "node:os";
|
|
29084
|
-
import { dirname as
|
|
29162
|
+
import { dirname as dirname16, resolve as resolve23 } from "node:path";
|
|
29085
29163
|
function installedHookAt2(path, cli) {
|
|
29086
29164
|
try {
|
|
29087
|
-
const stat =
|
|
29165
|
+
const stat = statSync23(path);
|
|
29088
29166
|
if (!stat.isFile() || stat.size > 131072)
|
|
29089
29167
|
return false;
|
|
29090
29168
|
const text = readFileSync24(path, "utf8");
|
|
@@ -29142,7 +29220,7 @@ function runtimeAgentSettingsPath2(cli, cwd, userHome = homedir26(), hookScope)
|
|
|
29142
29220
|
if (installedHookAt2(path, cli))
|
|
29143
29221
|
matches.add(path);
|
|
29144
29222
|
}
|
|
29145
|
-
const parent =
|
|
29223
|
+
const parent = dirname16(dir);
|
|
29146
29224
|
if (parent === dir)
|
|
29147
29225
|
break;
|
|
29148
29226
|
dir = parent;
|
|
@@ -29235,8 +29313,8 @@ var init_agent_roster2 = __esm(() => {
|
|
|
29235
29313
|
});
|
|
29236
29314
|
|
|
29237
29315
|
// src/hooks/semantic/jev-config.ts
|
|
29238
|
-
import { closeSync as closeSync3, constants as fsConstants4, fstatSync as fstatSync2, openSync as openSync3, readSync as readSync2, statSync as
|
|
29239
|
-
import { dirname as
|
|
29316
|
+
import { closeSync as closeSync3, constants as fsConstants4, fstatSync as fstatSync2, openSync as openSync3, readSync as readSync2, statSync as statSync24 } from "node:fs";
|
|
29317
|
+
import { dirname as dirname17 } from "node:path";
|
|
29240
29318
|
function parseJevMode(raw) {
|
|
29241
29319
|
return raw === "off" || raw === "observe" || raw === "enforce" ? raw : null;
|
|
29242
29320
|
}
|
|
@@ -29496,7 +29574,7 @@ function looseConfigDirMode(path) {
|
|
|
29496
29574
|
if (!modesAreMeaningful())
|
|
29497
29575
|
return null;
|
|
29498
29576
|
try {
|
|
29499
|
-
const mode =
|
|
29577
|
+
const mode = statSync24(dirname17(path)).mode & 511;
|
|
29500
29578
|
return (mode & DIR_WRITABLE_BY_OTHERS2) !== 0 ? mode : null;
|
|
29501
29579
|
} catch {
|
|
29502
29580
|
return null;
|
|
@@ -29557,8 +29635,8 @@ function inspectJevConfig() {
|
|
|
29557
29635
|
path,
|
|
29558
29636
|
mode,
|
|
29559
29637
|
reason: "too-open",
|
|
29560
|
-
problem: `its directory ${
|
|
29561
|
-
fix: `chmod 700 ${
|
|
29638
|
+
problem: `its directory ${dirname17(path)} is ${dirMode.toString(8).padStart(4, "0")} — other users can write there, ` + `so they can put their own config in its place; it must be owner-only (chmod 700 ${dirname17(path)})`,
|
|
29639
|
+
fix: `chmod 700 ${dirname17(path)}`
|
|
29562
29640
|
};
|
|
29563
29641
|
}
|
|
29564
29642
|
if (st.size > MAX_CONFIG_BYTES)
|
|
@@ -29677,14 +29755,14 @@ function jevInputsVersion() {
|
|
|
29677
29755
|
process.platform,
|
|
29678
29756
|
credentials,
|
|
29679
29757
|
statVersion(credentials),
|
|
29680
|
-
statVersion(
|
|
29758
|
+
statVersion(dirname17(credentials)),
|
|
29681
29759
|
config,
|
|
29682
29760
|
statVersion(config)
|
|
29683
29761
|
].join("\x00");
|
|
29684
29762
|
}
|
|
29685
29763
|
function statVersion(path) {
|
|
29686
29764
|
try {
|
|
29687
|
-
const st =
|
|
29765
|
+
const st = statSync24(path, { bigint: true });
|
|
29688
29766
|
return `${st.dev}:${st.ino}:${st.mode}:${st.size}:${st.mtimeNs}:${st.ctimeNs}`;
|
|
29689
29767
|
} catch (err) {
|
|
29690
29768
|
return `-${err.code ?? "error"}`;
|
|
@@ -29912,9 +29990,9 @@ var init_cloud_jev_health = __esm(() => {
|
|
|
29912
29990
|
});
|
|
29913
29991
|
|
|
29914
29992
|
// src/hooks/semantic/facts.ts
|
|
29915
|
-
import { existsSync as existsSync30, readFileSync as readFileSync25, statSync as
|
|
29993
|
+
import { existsSync as existsSync30, readFileSync as readFileSync25, statSync as statSync25 } from "node:fs";
|
|
29916
29994
|
import { homedir as homedir27 } from "node:os";
|
|
29917
|
-
import { dirname as
|
|
29995
|
+
import { dirname as dirname18, isAbsolute as isAbsolute4, resolve as resolve24 } from "node:path";
|
|
29918
29996
|
function classifyTool(toolName) {
|
|
29919
29997
|
if (SHELL_TOOLS.has(toolName))
|
|
29920
29998
|
return { toolClass: "shell", toolIsKnown: true };
|
|
@@ -30141,7 +30219,7 @@ function findGitDir(start) {
|
|
|
30141
30219
|
const candidate = resolve24(dir, ".git");
|
|
30142
30220
|
if (existsSync30(candidate))
|
|
30143
30221
|
return candidate;
|
|
30144
|
-
const parent =
|
|
30222
|
+
const parent = dirname18(dir);
|
|
30145
30223
|
if (parent === dir)
|
|
30146
30224
|
return null;
|
|
30147
30225
|
dir = parent;
|
|
@@ -30152,7 +30230,7 @@ function findProjectRoot(cwd) {
|
|
|
30152
30230
|
if (!cwd)
|
|
30153
30231
|
return null;
|
|
30154
30232
|
const gitDir = findGitDir(cwd);
|
|
30155
|
-
return gitDir ?
|
|
30233
|
+
return gitDir ? dirname18(gitDir) : cwd;
|
|
30156
30234
|
}
|
|
30157
30235
|
function readCurrentBranch(cwd) {
|
|
30158
30236
|
if (!cwd)
|
|
@@ -30162,12 +30240,12 @@ function readCurrentBranch(cwd) {
|
|
|
30162
30240
|
if (!gitPath)
|
|
30163
30241
|
return null;
|
|
30164
30242
|
let headFile = resolve24(gitPath, "HEAD");
|
|
30165
|
-
if (
|
|
30243
|
+
if (statSync25(gitPath).isFile()) {
|
|
30166
30244
|
const pointer = readFileSync25(gitPath, "utf8").trim();
|
|
30167
30245
|
const m = /^gitdir:\s*(.+)$/.exec(pointer);
|
|
30168
30246
|
if (!m)
|
|
30169
30247
|
return null;
|
|
30170
|
-
headFile = resolve24(
|
|
30248
|
+
headFile = resolve24(dirname18(gitPath), m[1], "HEAD");
|
|
30171
30249
|
}
|
|
30172
30250
|
const head = readFileSync25(headFile, "utf8").trim();
|
|
30173
30251
|
const ref = /^ref:\s*refs\/heads\/(.+)$/.exec(head);
|
|
@@ -30562,15 +30640,15 @@ import {
|
|
|
30562
30640
|
closeSync as closeSync4,
|
|
30563
30641
|
mkdirSync as mkdirSync14,
|
|
30564
30642
|
openSync as openSync4,
|
|
30565
|
-
readdirSync as
|
|
30643
|
+
readdirSync as readdirSync17,
|
|
30566
30644
|
readFileSync as readFileSync26,
|
|
30567
30645
|
readSync as readSync3,
|
|
30568
30646
|
renameSync as renameSync10,
|
|
30569
|
-
statSync as
|
|
30647
|
+
statSync as statSync26,
|
|
30570
30648
|
unlinkSync as unlinkSync4,
|
|
30571
30649
|
writeFileSync as writeFileSync12
|
|
30572
30650
|
} from "node:fs";
|
|
30573
|
-
import { dirname as
|
|
30651
|
+
import { dirname as dirname19, resolve as resolve25 } from "node:path";
|
|
30574
30652
|
function intentProfileKey(profile) {
|
|
30575
30653
|
if (validAgentIdentity(profile.agent))
|
|
30576
30654
|
return `${profile.agent.integration}.${profile.agent.instanceId}`;
|
|
@@ -30596,7 +30674,7 @@ function storeDirChain(innermost = sessionsDir()) {
|
|
|
30596
30674
|
chain.push(dir);
|
|
30597
30675
|
if (dir === home)
|
|
30598
30676
|
break;
|
|
30599
|
-
const parent =
|
|
30677
|
+
const parent = dirname19(dir);
|
|
30600
30678
|
if (parent === dir)
|
|
30601
30679
|
break;
|
|
30602
30680
|
dir = parent;
|
|
@@ -30609,7 +30687,7 @@ function looseIntentStoreDir(innermost) {
|
|
|
30609
30687
|
for (const dir of storeDirChain(innermost)) {
|
|
30610
30688
|
let mode;
|
|
30611
30689
|
try {
|
|
30612
|
-
mode =
|
|
30690
|
+
mode = statSync26(dir).mode & 511;
|
|
30613
30691
|
} catch {
|
|
30614
30692
|
continue;
|
|
30615
30693
|
}
|
|
@@ -30617,7 +30695,7 @@ function looseIntentStoreDir(innermost) {
|
|
|
30617
30695
|
continue;
|
|
30618
30696
|
try {
|
|
30619
30697
|
chmodSync7(dir, mode & ~DIR_WRITABLE_BY_OTHERS3);
|
|
30620
|
-
if ((
|
|
30698
|
+
if ((statSync26(dir).mode & DIR_WRITABLE_BY_OTHERS3) !== 0)
|
|
30621
30699
|
return dir;
|
|
30622
30700
|
} catch {
|
|
30623
30701
|
return dir;
|
|
@@ -30654,7 +30732,7 @@ function appendPrompt(slot, entry) {
|
|
|
30654
30732
|
}
|
|
30655
30733
|
function fileExists2(path) {
|
|
30656
30734
|
try {
|
|
30657
|
-
|
|
30735
|
+
statSync26(path);
|
|
30658
30736
|
return true;
|
|
30659
30737
|
} catch {
|
|
30660
30738
|
return false;
|
|
@@ -30664,12 +30742,12 @@ function pruneExpiredSessions(now = Date.now()) {
|
|
|
30664
30742
|
const root = sessionsDir();
|
|
30665
30743
|
let removed = pruneDir(root, now);
|
|
30666
30744
|
try {
|
|
30667
|
-
for (const name of
|
|
30745
|
+
for (const name of readdirSync17(root)) {
|
|
30668
30746
|
if (!PROFILE_DIR_RE.test(name))
|
|
30669
30747
|
continue;
|
|
30670
30748
|
const dir = resolve25(root, name);
|
|
30671
30749
|
try {
|
|
30672
|
-
if (
|
|
30750
|
+
if (statSync26(dir).isDirectory())
|
|
30673
30751
|
removed += pruneDir(dir, now);
|
|
30674
30752
|
} catch {}
|
|
30675
30753
|
}
|
|
@@ -30679,12 +30757,12 @@ function pruneExpiredSessions(now = Date.now()) {
|
|
|
30679
30757
|
function pruneDir(dir, now) {
|
|
30680
30758
|
let removed = 0;
|
|
30681
30759
|
try {
|
|
30682
|
-
for (const name of
|
|
30760
|
+
for (const name of readdirSync17(dir)) {
|
|
30683
30761
|
if (!SESSION_FILE_RE3.test(name))
|
|
30684
30762
|
continue;
|
|
30685
30763
|
const path = resolve25(dir, name);
|
|
30686
30764
|
try {
|
|
30687
|
-
const st =
|
|
30765
|
+
const st = statSync26(path);
|
|
30688
30766
|
if (st.isFile() && now - st.mtimeMs > INTENT_MAX_AGE_MS) {
|
|
30689
30767
|
unlinkSync4(path);
|
|
30690
30768
|
removed++;
|
|
@@ -30999,7 +31077,7 @@ function visitLinesBackwards(transcriptPath, maxBytes, visit) {
|
|
|
30999
31077
|
return;
|
|
31000
31078
|
let fd;
|
|
31001
31079
|
try {
|
|
31002
|
-
const st =
|
|
31080
|
+
const st = statSync26(path);
|
|
31003
31081
|
if (!st.isFile() || st.size === 0)
|
|
31004
31082
|
return;
|
|
31005
31083
|
fd = openSync4(path, "r");
|
|
@@ -31635,7 +31713,7 @@ var init_jev_client = __esm(() => {
|
|
|
31635
31713
|
|
|
31636
31714
|
// src/hooks/semantic/evaluator.ts
|
|
31637
31715
|
import { createHash as createHash9 } from "node:crypto";
|
|
31638
|
-
import { appendFileSync as appendFileSync3, mkdirSync as mkdirSync15, renameSync as renameSync11, statSync as
|
|
31716
|
+
import { appendFileSync as appendFileSync3, mkdirSync as mkdirSync15, renameSync as renameSync11, statSync as statSync27 } from "node:fs";
|
|
31639
31717
|
import { resolve as resolve26 } from "node:path";
|
|
31640
31718
|
function storeCut(message) {
|
|
31641
31719
|
return typeof message === "string" && message.length >= MAX_USER_MESSAGE_CHARS - STORE_CUT_SLACK && OMISSION_MARK.test(message);
|
|
@@ -31809,7 +31887,7 @@ function appendVerdictLog(row) {
|
|
|
31809
31887
|
const file = verdictLogFile();
|
|
31810
31888
|
mkdirSync15(semanticDir(), { recursive: true, mode: 448 });
|
|
31811
31889
|
try {
|
|
31812
|
-
if (
|
|
31890
|
+
if (statSync27(file).size > VERDICT_LOG_MAX_BYTES)
|
|
31813
31891
|
renameSync11(file, `${file}.1`);
|
|
31814
31892
|
} catch {}
|
|
31815
31893
|
appendFileSync3(file, JSON.stringify(row) + `
|
|
@@ -32534,7 +32612,7 @@ var init_jev_throttle = __esm(() => {
|
|
|
32534
32612
|
});
|
|
32535
32613
|
|
|
32536
32614
|
// src/hooks/semantic/session-root.ts
|
|
32537
|
-
import { mkdirSync as mkdirSync16, readdirSync as
|
|
32615
|
+
import { mkdirSync as mkdirSync16, readdirSync as readdirSync18, readFileSync as readFileSync27, statSync as statSync28, unlinkSync as unlinkSync5, writeFileSync as writeFileSync13 } from "node:fs";
|
|
32538
32616
|
import { isAbsolute as isAbsolute5, resolve as resolve27 } from "node:path";
|
|
32539
32617
|
function validRoot(v) {
|
|
32540
32618
|
return typeof v === "string" && isAbsolute5(v) && resolve27(v) === v && v !== "/";
|
|
@@ -32545,7 +32623,7 @@ function storeIsOurs() {
|
|
|
32545
32623
|
if (looseIntentStoreDir() !== null)
|
|
32546
32624
|
return false;
|
|
32547
32625
|
try {
|
|
32548
|
-
const mode =
|
|
32626
|
+
const mode = statSync28(rootsDir()).mode & 511;
|
|
32549
32627
|
return (mode & DIR_WRITABLE_BY_OTHERS4) === 0;
|
|
32550
32628
|
} catch {
|
|
32551
32629
|
return true;
|
|
@@ -32563,12 +32641,12 @@ function pruneSessionRoots(now = Date.now()) {
|
|
|
32563
32641
|
let removed = 0;
|
|
32564
32642
|
try {
|
|
32565
32643
|
const dir = rootsDir();
|
|
32566
|
-
for (const name of
|
|
32644
|
+
for (const name of readdirSync18(dir)) {
|
|
32567
32645
|
if (!ROOT_FILE_RE.test(name))
|
|
32568
32646
|
continue;
|
|
32569
32647
|
const path = resolve27(dir, name);
|
|
32570
32648
|
try {
|
|
32571
|
-
const st =
|
|
32649
|
+
const st = statSync28(path);
|
|
32572
32650
|
if (st.isFile() && now - st.mtimeMs > SESSION_ROOT_MAX_AGE_MS) {
|
|
32573
32651
|
unlinkSync5(path);
|
|
32574
32652
|
removed++;
|
|
@@ -34507,8 +34585,8 @@ var init_collector_config = __esm(() => {
|
|
|
34507
34585
|
});
|
|
34508
34586
|
|
|
34509
34587
|
// src/hooks/flush-cli.ts
|
|
34510
|
-
import { existsSync as existsSync32, mkdirSync as mkdirSync17, writeFileSync as writeFileSync14, readdirSync as
|
|
34511
|
-
import { dirname as
|
|
34588
|
+
import { existsSync as existsSync32, mkdirSync as mkdirSync17, writeFileSync as writeFileSync14, readdirSync as readdirSync19, statSync as statSync29 } from "node:fs";
|
|
34589
|
+
import { dirname as dirname20, join as join33 } from "node:path";
|
|
34512
34590
|
function flushRequestPath(home) {
|
|
34513
34591
|
return join33(failproofaiHome(home), "state", "flush-request.json");
|
|
34514
34592
|
}
|
|
@@ -34518,14 +34596,14 @@ function spoolDirs(home) {
|
|
|
34518
34596
|
if (!existsSync32(root))
|
|
34519
34597
|
return dirs;
|
|
34520
34598
|
try {
|
|
34521
|
-
return dirs.concat(
|
|
34599
|
+
return dirs.concat(readdirSync19(root, { withFileTypes: true }).filter((e) => e.isDirectory() && e.name !== "failed").map((e) => join33(root, e.name)));
|
|
34522
34600
|
} catch {
|
|
34523
34601
|
return dirs;
|
|
34524
34602
|
}
|
|
34525
34603
|
}
|
|
34526
34604
|
function parkedBatches(home) {
|
|
34527
34605
|
try {
|
|
34528
|
-
return
|
|
34606
|
+
return readdirSync19(failedDir(home)).filter((f) => f.endsWith(".jsonl")).length;
|
|
34529
34607
|
} catch {
|
|
34530
34608
|
return 0;
|
|
34531
34609
|
}
|
|
@@ -34542,14 +34620,14 @@ function spoolBacklog(home, now = Date.now()) {
|
|
|
34542
34620
|
for (const dir of spoolDirs(home)) {
|
|
34543
34621
|
let names;
|
|
34544
34622
|
try {
|
|
34545
|
-
names =
|
|
34623
|
+
names = readdirSync19(dir).filter((f) => f.endsWith(".jsonl"));
|
|
34546
34624
|
} catch {
|
|
34547
34625
|
continue;
|
|
34548
34626
|
}
|
|
34549
34627
|
count += names.length;
|
|
34550
34628
|
for (const name of names) {
|
|
34551
34629
|
try {
|
|
34552
|
-
const mtime =
|
|
34630
|
+
const mtime = statSync29(join33(dir, name)).mtimeMs;
|
|
34553
34631
|
if (oldest === undefined || mtime < oldest)
|
|
34554
34632
|
oldest = mtime;
|
|
34555
34633
|
} catch {}
|
|
@@ -34611,7 +34689,7 @@ async function runFlushCommand(opts = {}) {
|
|
|
34611
34689
|
return { exitCode: 0, pending: 0, lines: nothing };
|
|
34612
34690
|
}
|
|
34613
34691
|
const path = flushRequestPath(home);
|
|
34614
|
-
mkdirSync17(
|
|
34692
|
+
mkdirSync17(dirname20(path), { recursive: true });
|
|
34615
34693
|
writeFileSync14(path, `${JSON.stringify({ requestedAtMs: Date.now() }, null, 2)}
|
|
34616
34694
|
`, {
|
|
34617
34695
|
mode: 384
|
|
@@ -34655,7 +34733,7 @@ import {
|
|
|
34655
34733
|
rmSync as rmSync12,
|
|
34656
34734
|
writeFileSync as writeFileSync15
|
|
34657
34735
|
} from "node:fs";
|
|
34658
|
-
import { basename as basename7, dirname as
|
|
34736
|
+
import { basename as basename7, dirname as dirname21, join as join34, resolve as resolve28 } from "node:path";
|
|
34659
34737
|
function migrateToLayout4() {
|
|
34660
34738
|
const moves = [
|
|
34661
34739
|
{ from: legacy.authJson(), to: auditSessionFile() },
|
|
@@ -34677,7 +34755,7 @@ function migrateToLayout4() {
|
|
|
34677
34755
|
rmSync12(from, { force: true });
|
|
34678
34756
|
continue;
|
|
34679
34757
|
}
|
|
34680
|
-
mkdirSync18(
|
|
34758
|
+
mkdirSync18(dirname21(to), { recursive: true });
|
|
34681
34759
|
try {
|
|
34682
34760
|
renameSync12(from, to);
|
|
34683
34761
|
} catch {
|
|
@@ -35114,7 +35192,7 @@ var init_install_telemetry = () => {};
|
|
|
35114
35192
|
|
|
35115
35193
|
// lib/install-check.ts
|
|
35116
35194
|
import { existsSync as existsSync34, readFileSync as readFileSync30, writeFileSync as writeFileSync17, mkdirSync as mkdirSync20 } from "node:fs";
|
|
35117
|
-
import { dirname as
|
|
35195
|
+
import { dirname as dirname22, resolve as resolve29 } from "node:path";
|
|
35118
35196
|
import { platform as platform2, arch as arch2, release, homedir as homedir29, hostname as hostname2 } from "node:os";
|
|
35119
35197
|
import { createHmac as createHmac2 } from "node:crypto";
|
|
35120
35198
|
function hashToId4(raw) {
|
|
@@ -35248,7 +35326,7 @@ async function maybeReportInstall(version) {
|
|
|
35248
35326
|
enabled_policy_count: hooks.policyCount
|
|
35249
35327
|
}, { version, timeoutMs: REPORT_TIMEOUT_MS, enabled: telemetryEnabled }));
|
|
35250
35328
|
try {
|
|
35251
|
-
mkdirSync20(
|
|
35329
|
+
mkdirSync20(dirname22(versionFile), { recursive: true });
|
|
35252
35330
|
writeFileSync17(versionFile, version, "utf8");
|
|
35253
35331
|
} catch {}
|
|
35254
35332
|
await Promise.all(events.map((p) => p.catch(() => {})));
|
|
@@ -36716,7 +36794,7 @@ var init_cloud_introspect = __esm(() => {
|
|
|
36716
36794
|
|
|
36717
36795
|
// src/hooks/credential-recovery.ts
|
|
36718
36796
|
import { createHash as createHash11 } from "node:crypto";
|
|
36719
|
-
import { existsSync as existsSync40, mkdirSync as mkdirSync22, readdirSync as
|
|
36797
|
+
import { existsSync as existsSync40, mkdirSync as mkdirSync22, readdirSync as readdirSync20, renameSync as renameSync13 } from "node:fs";
|
|
36720
36798
|
import { join as join38 } from "node:path";
|
|
36721
36799
|
function previousOrgDirectory(id) {
|
|
36722
36800
|
const safe = id && /^[A-Za-z0-9_-]{1,128}$/.test(id) ? id : id ? createHash11("sha256").update(id).digest("hex") : "unknown";
|
|
@@ -36727,7 +36805,7 @@ function recoverCredentialRefusals(sameOrg, oldOrgId) {
|
|
|
36727
36805
|
if (!existsSync40(dir))
|
|
36728
36806
|
return 0;
|
|
36729
36807
|
let recovered = 0;
|
|
36730
|
-
for (const name of
|
|
36808
|
+
for (const name of readdirSync20(dir)) {
|
|
36731
36809
|
if (!/\.c(401|403)\.jsonl$/.test(name) || name.startsWith("."))
|
|
36732
36810
|
continue;
|
|
36733
36811
|
const targetDir = sameOrg ? dir : join38(previousOrgDirectory(oldOrgId), "failed");
|
|
@@ -36764,11 +36842,11 @@ import {
|
|
|
36764
36842
|
readSync as readSync4,
|
|
36765
36843
|
renameSync as renameSync14,
|
|
36766
36844
|
rmSync as rmSync15,
|
|
36767
|
-
statSync as
|
|
36845
|
+
statSync as statSync30,
|
|
36768
36846
|
unlinkSync as unlinkSync6,
|
|
36769
36847
|
writeFileSync as writeFileSync18
|
|
36770
36848
|
} from "node:fs";
|
|
36771
|
-
import { dirname as
|
|
36849
|
+
import { dirname as dirname23 } from "node:path";
|
|
36772
36850
|
import { randomBytes as randomBytes3 } from "node:crypto";
|
|
36773
36851
|
function writeCloudJevConfig(cloudBase) {
|
|
36774
36852
|
const first = writeCloudJevConfigIfAbsent(cloudBase);
|
|
@@ -36849,7 +36927,7 @@ function writeCloudJevConfigIfAbsent(cloudBase) {
|
|
|
36849
36927
|
return kept(path, cloudBase);
|
|
36850
36928
|
const body = `${JSON.stringify({ provider: JEV_CLOUD_PROVIDER, baseUrl, mode: CLOUD_JEV_INITIAL_MODE }, null, 2)}
|
|
36851
36929
|
`;
|
|
36852
|
-
const dir =
|
|
36930
|
+
const dir = dirname23(path);
|
|
36853
36931
|
const tmp = `${path}.${process.pid}.${randomBytes3(6).toString("hex")}.tmp`;
|
|
36854
36932
|
try {
|
|
36855
36933
|
if (!existsSync41(dir))
|
|
@@ -36914,7 +36992,7 @@ function tightenDir(dir) {
|
|
|
36914
36992
|
if (process.platform === "win32")
|
|
36915
36993
|
return;
|
|
36916
36994
|
try {
|
|
36917
|
-
const before =
|
|
36995
|
+
const before = statSync30(dir).mode & 511;
|
|
36918
36996
|
if ((before & 18) !== 0)
|
|
36919
36997
|
chmodSync9(dir, before & ~18);
|
|
36920
36998
|
} catch {}
|
|
@@ -37337,8 +37415,8 @@ var init_cloud_connection = __esm(() => {
|
|
|
37337
37415
|
});
|
|
37338
37416
|
|
|
37339
37417
|
// src/hooks/setup-state.ts
|
|
37340
|
-
import { existsSync as existsSync42, realpathSync as realpathSync4, statSync as
|
|
37341
|
-
import { dirname as
|
|
37418
|
+
import { existsSync as existsSync42, realpathSync as realpathSync4, statSync as statSync31 } from "node:fs";
|
|
37419
|
+
import { dirname as dirname24, resolve as resolve32 } from "node:path";
|
|
37342
37420
|
import { homedir as homedir31 } from "node:os";
|
|
37343
37421
|
function globalConfigPath(home = homedir31()) {
|
|
37344
37422
|
return globalPolicyConfigFile(home);
|
|
@@ -37351,7 +37429,7 @@ function legacyMarkerPath(home) {
|
|
|
37351
37429
|
}
|
|
37352
37430
|
function isDir(path) {
|
|
37353
37431
|
try {
|
|
37354
|
-
return
|
|
37432
|
+
return statSync31(path).isDirectory();
|
|
37355
37433
|
} catch {
|
|
37356
37434
|
return false;
|
|
37357
37435
|
}
|
|
@@ -37362,7 +37440,7 @@ function findProjectRoot2(start, home = homedir31()) {
|
|
|
37362
37440
|
while (dir !== resolvedHome) {
|
|
37363
37441
|
if (isDir(resolve32(dir, ".failproofai")))
|
|
37364
37442
|
return dir;
|
|
37365
|
-
const parent =
|
|
37443
|
+
const parent = dirname24(dir);
|
|
37366
37444
|
if (parent === dir)
|
|
37367
37445
|
break;
|
|
37368
37446
|
dir = parent;
|
|
@@ -37412,7 +37490,7 @@ var init_setup_state = __esm(() => {
|
|
|
37412
37490
|
|
|
37413
37491
|
// src/hooks/onboarding-attempt.ts
|
|
37414
37492
|
import { existsSync as existsSync43, mkdirSync as mkdirSync24, readFileSync as readFileSync34, rmSync as rmSync17, writeFileSync as writeFileSync19 } from "node:fs";
|
|
37415
|
-
import { dirname as
|
|
37493
|
+
import { dirname as dirname25 } from "node:path";
|
|
37416
37494
|
function readOnboardingAttempt() {
|
|
37417
37495
|
const path = onboardingAttemptFile();
|
|
37418
37496
|
if (!existsSync43(path))
|
|
@@ -37437,7 +37515,7 @@ function readOnboardingAttempt() {
|
|
|
37437
37515
|
function recordOnboardingAttempt(reason, cliVersion, daemonStatus, now = Date.now()) {
|
|
37438
37516
|
try {
|
|
37439
37517
|
const path = onboardingAttemptFile();
|
|
37440
|
-
mkdirSync24(
|
|
37518
|
+
mkdirSync24(dirname25(path), { recursive: true });
|
|
37441
37519
|
const record = {
|
|
37442
37520
|
schemaVersion: SCHEMA_VERSION3,
|
|
37443
37521
|
reason,
|
|
@@ -37545,7 +37623,7 @@ var init_onboarding_lock = __esm(() => {
|
|
|
37545
37623
|
});
|
|
37546
37624
|
|
|
37547
37625
|
// lib/claude-sessions.ts
|
|
37548
|
-
import { readdirSync as
|
|
37626
|
+
import { readdirSync as readdirSync21, statSync as statSync32, existsSync as existsSync44 } from "node:fs";
|
|
37549
37627
|
import { join as join39, basename as basename9 } from "node:path";
|
|
37550
37628
|
function getClaudeProjectsRoot() {
|
|
37551
37629
|
return getClaudeProjectsPath();
|
|
@@ -37554,7 +37632,7 @@ function listClaudeProjects() {
|
|
|
37554
37632
|
const root = getClaudeProjectsRoot();
|
|
37555
37633
|
let entries;
|
|
37556
37634
|
try {
|
|
37557
|
-
entries =
|
|
37635
|
+
entries = readdirSync21(root, { withFileTypes: true });
|
|
37558
37636
|
} catch {
|
|
37559
37637
|
return [];
|
|
37560
37638
|
}
|
|
@@ -37568,7 +37646,7 @@ function listClaudeTranscripts(project) {
|
|
|
37568
37646
|
const out = [];
|
|
37569
37647
|
let entries;
|
|
37570
37648
|
try {
|
|
37571
|
-
entries =
|
|
37649
|
+
entries = readdirSync21(project.path, { withFileTypes: true });
|
|
37572
37650
|
} catch {
|
|
37573
37651
|
return out;
|
|
37574
37652
|
}
|
|
@@ -37579,7 +37657,7 @@ function listClaudeTranscripts(project) {
|
|
|
37579
37657
|
continue;
|
|
37580
37658
|
const transcriptPath = join39(project.path, entry.name);
|
|
37581
37659
|
try {
|
|
37582
|
-
const s =
|
|
37660
|
+
const s = statSync32(transcriptPath);
|
|
37583
37661
|
out.push({
|
|
37584
37662
|
projectName: project.name,
|
|
37585
37663
|
cwd: project.cwd,
|
|
@@ -37596,7 +37674,7 @@ function listClaudeTranscripts(project) {
|
|
|
37596
37674
|
continue;
|
|
37597
37675
|
let subEntries;
|
|
37598
37676
|
try {
|
|
37599
|
-
subEntries =
|
|
37677
|
+
subEntries = readdirSync21(subDir, { withFileTypes: true });
|
|
37600
37678
|
} catch {
|
|
37601
37679
|
continue;
|
|
37602
37680
|
}
|
|
@@ -37606,7 +37684,7 @@ function listClaudeTranscripts(project) {
|
|
|
37606
37684
|
const agentId = sub.name.slice(0, -".jsonl".length);
|
|
37607
37685
|
const transcriptPath = join39(subDir, sub.name);
|
|
37608
37686
|
try {
|
|
37609
|
-
const s =
|
|
37687
|
+
const s = statSync32(transcriptPath);
|
|
37610
37688
|
out.push({
|
|
37611
37689
|
projectName: project.name,
|
|
37612
37690
|
cwd: project.cwd,
|
|
@@ -37822,7 +37900,7 @@ var init_claude = __esm(() => {
|
|
|
37822
37900
|
});
|
|
37823
37901
|
|
|
37824
37902
|
// src/audit/cli-adapters/codex.ts
|
|
37825
|
-
import { statSync as
|
|
37903
|
+
import { statSync as statSync33 } from "node:fs";
|
|
37826
37904
|
async function listCodexTranscriptMetadata(opts = {}) {
|
|
37827
37905
|
const projectFilter = opts.projects ? new Set(opts.projects) : null;
|
|
37828
37906
|
const sinceMs = opts.sinceMs ?? 0;
|
|
@@ -37839,7 +37917,7 @@ async function listCodexTranscriptMetadata(opts = {}) {
|
|
|
37839
37917
|
continue;
|
|
37840
37918
|
let sizeBytes = 0;
|
|
37841
37919
|
try {
|
|
37842
|
-
sizeBytes =
|
|
37920
|
+
sizeBytes = statSync33(s.path).size;
|
|
37843
37921
|
} catch {}
|
|
37844
37922
|
if (!s.sessionId)
|
|
37845
37923
|
continue;
|
|
@@ -37873,7 +37951,7 @@ var init_codex = __esm(() => {
|
|
|
37873
37951
|
});
|
|
37874
37952
|
|
|
37875
37953
|
// src/audit/cli-adapters/copilot.ts
|
|
37876
|
-
import { statSync as
|
|
37954
|
+
import { statSync as statSync34 } from "node:fs";
|
|
37877
37955
|
async function listCopilotTranscriptMetadata(opts = {}) {
|
|
37878
37956
|
const projectFilter = opts.projects ? new Set(opts.projects) : null;
|
|
37879
37957
|
const sinceMs = opts.sinceMs ?? 0;
|
|
@@ -37890,7 +37968,7 @@ async function listCopilotTranscriptMetadata(opts = {}) {
|
|
|
37890
37968
|
continue;
|
|
37891
37969
|
let sizeBytes = 0;
|
|
37892
37970
|
try {
|
|
37893
|
-
sizeBytes =
|
|
37971
|
+
sizeBytes = statSync34(s.path).size;
|
|
37894
37972
|
} catch {}
|
|
37895
37973
|
if (!s.sessionId)
|
|
37896
37974
|
continue;
|
|
@@ -37924,7 +38002,7 @@ var init_copilot = __esm(() => {
|
|
|
37924
38002
|
});
|
|
37925
38003
|
|
|
37926
38004
|
// src/audit/cli-adapters/cursor.ts
|
|
37927
|
-
import { statSync as
|
|
38005
|
+
import { statSync as statSync35 } from "node:fs";
|
|
37928
38006
|
async function listCursorTranscriptMetadata(opts = {}) {
|
|
37929
38007
|
const projectFilter = opts.projects ? new Set(opts.projects) : null;
|
|
37930
38008
|
const sinceMs = opts.sinceMs ?? 0;
|
|
@@ -37941,7 +38019,7 @@ async function listCursorTranscriptMetadata(opts = {}) {
|
|
|
37941
38019
|
continue;
|
|
37942
38020
|
let sizeBytes = 0;
|
|
37943
38021
|
try {
|
|
37944
|
-
sizeBytes =
|
|
38022
|
+
sizeBytes = statSync35(s.path).size;
|
|
37945
38023
|
} catch {}
|
|
37946
38024
|
if (!s.sessionId)
|
|
37947
38025
|
continue;
|
|
@@ -38182,7 +38260,7 @@ var init_opencode = __esm(() => {
|
|
|
38182
38260
|
});
|
|
38183
38261
|
|
|
38184
38262
|
// src/audit/cli-adapters/pi.ts
|
|
38185
|
-
import { statSync as
|
|
38263
|
+
import { statSync as statSync36 } from "node:fs";
|
|
38186
38264
|
async function listPiTranscriptMetadata(opts = {}) {
|
|
38187
38265
|
const projectFilter = opts.projects ? new Set(opts.projects) : null;
|
|
38188
38266
|
const sinceMs = opts.sinceMs ?? 0;
|
|
@@ -38199,7 +38277,7 @@ async function listPiTranscriptMetadata(opts = {}) {
|
|
|
38199
38277
|
continue;
|
|
38200
38278
|
let sizeBytes = 0;
|
|
38201
38279
|
try {
|
|
38202
|
-
sizeBytes =
|
|
38280
|
+
sizeBytes = statSync36(s.path).size;
|
|
38203
38281
|
} catch {}
|
|
38204
38282
|
if (!s.sessionId)
|
|
38205
38283
|
continue;
|
|
@@ -39858,7 +39936,7 @@ var init_api_server_client = __esm(() => {
|
|
|
39858
39936
|
});
|
|
39859
39937
|
|
|
39860
39938
|
// lib/auth/auth-store.ts
|
|
39861
|
-
import { existsSync as existsSync47, readFileSync as readFileSync39, readdirSync as
|
|
39939
|
+
import { existsSync as existsSync47, readFileSync as readFileSync39, readdirSync as readdirSync22, rmSync as rmSync19 } from "node:fs";
|
|
39862
39940
|
import { join as join41, resolve as resolve33 } from "node:path";
|
|
39863
39941
|
function getAuthFilePath() {
|
|
39864
39942
|
const override = process.env.FAILPROOFAI_AUTH_DIR;
|
|
@@ -39899,7 +39977,7 @@ function deleteAuth() {
|
|
|
39899
39977
|
const root = migrationsDir();
|
|
39900
39978
|
if (!existsSync47(root))
|
|
39901
39979
|
return;
|
|
39902
|
-
for (const entry of
|
|
39980
|
+
for (const entry of readdirSync22(root)) {
|
|
39903
39981
|
if (!entry.startsWith("backup-layout"))
|
|
39904
39982
|
continue;
|
|
39905
39983
|
const copy = resolve33(root, entry, "auth.json");
|
|
@@ -40494,7 +40572,7 @@ var init_cli = __esm(() => {
|
|
|
40494
40572
|
// src/hooks/configure-wizard.ts
|
|
40495
40573
|
import { existsSync as existsSync49, mkdirSync as mkdirSync28, writeFileSync as writeFileSync23, readFileSync as readFileSync41 } from "node:fs";
|
|
40496
40574
|
import { homedir as homedir34 } from "node:os";
|
|
40497
|
-
import { dirname as
|
|
40575
|
+
import { dirname as dirname26, resolve as resolve34, sep as sep5 } from "node:path";
|
|
40498
40576
|
async function emit(event, props) {
|
|
40499
40577
|
try {
|
|
40500
40578
|
await trackHookEvent2(getInstanceId2(), event, props);
|
|
@@ -40683,7 +40761,7 @@ function firstRunMarkerPath() {
|
|
|
40683
40761
|
}
|
|
40684
40762
|
function markLauncherSeen() {
|
|
40685
40763
|
try {
|
|
40686
|
-
mkdirSync28(
|
|
40764
|
+
mkdirSync28(dirname26(firstRunMarkerPath()), { recursive: true });
|
|
40687
40765
|
writeFileSync23(firstRunMarkerPath(), "1", "utf8");
|
|
40688
40766
|
} catch {}
|
|
40689
40767
|
}
|
|
@@ -41510,8 +41588,8 @@ var init_configure_wizard = __esm(() => {
|
|
|
41510
41588
|
});
|
|
41511
41589
|
|
|
41512
41590
|
// src/hooks/flush-cli.ts
|
|
41513
|
-
import { existsSync as existsSync50, mkdirSync as mkdirSync29, writeFileSync as writeFileSync24, readdirSync as
|
|
41514
|
-
import { dirname as
|
|
41591
|
+
import { existsSync as existsSync50, mkdirSync as mkdirSync29, writeFileSync as writeFileSync24, readdirSync as readdirSync23, statSync as statSync37 } from "node:fs";
|
|
41592
|
+
import { dirname as dirname27, join as join42 } from "node:path";
|
|
41515
41593
|
function flushRequestPath2(home) {
|
|
41516
41594
|
return join42(failproofaiHome(home), "state", "flush-request.json");
|
|
41517
41595
|
}
|
|
@@ -41521,14 +41599,14 @@ function spoolDirs2(home) {
|
|
|
41521
41599
|
if (!existsSync50(root))
|
|
41522
41600
|
return dirs;
|
|
41523
41601
|
try {
|
|
41524
|
-
return dirs.concat(
|
|
41602
|
+
return dirs.concat(readdirSync23(root, { withFileTypes: true }).filter((e) => e.isDirectory() && e.name !== "failed").map((e) => join42(root, e.name)));
|
|
41525
41603
|
} catch {
|
|
41526
41604
|
return dirs;
|
|
41527
41605
|
}
|
|
41528
41606
|
}
|
|
41529
41607
|
function parkedBatches2(home) {
|
|
41530
41608
|
try {
|
|
41531
|
-
return
|
|
41609
|
+
return readdirSync23(failedDir(home)).filter((f) => f.endsWith(".jsonl")).length;
|
|
41532
41610
|
} catch {
|
|
41533
41611
|
return 0;
|
|
41534
41612
|
}
|
|
@@ -41545,14 +41623,14 @@ function spoolBacklog2(home, now = Date.now()) {
|
|
|
41545
41623
|
for (const dir of spoolDirs2(home)) {
|
|
41546
41624
|
let names;
|
|
41547
41625
|
try {
|
|
41548
|
-
names =
|
|
41626
|
+
names = readdirSync23(dir).filter((f) => f.endsWith(".jsonl"));
|
|
41549
41627
|
} catch {
|
|
41550
41628
|
continue;
|
|
41551
41629
|
}
|
|
41552
41630
|
count += names.length;
|
|
41553
41631
|
for (const name of names) {
|
|
41554
41632
|
try {
|
|
41555
|
-
const mtime =
|
|
41633
|
+
const mtime = statSync37(join42(dir, name)).mtimeMs;
|
|
41556
41634
|
if (oldest === undefined || mtime < oldest)
|
|
41557
41635
|
oldest = mtime;
|
|
41558
41636
|
} catch {}
|
|
@@ -41614,7 +41692,7 @@ async function runFlushCommand2(opts = {}) {
|
|
|
41614
41692
|
return { exitCode: 0, pending: 0, lines: nothing };
|
|
41615
41693
|
}
|
|
41616
41694
|
const path = flushRequestPath2(home);
|
|
41617
|
-
mkdirSync29(
|
|
41695
|
+
mkdirSync29(dirname27(path), { recursive: true });
|
|
41618
41696
|
writeFileSync24(path, `${JSON.stringify({ requestedAtMs: Date.now() }, null, 2)}
|
|
41619
41697
|
`, {
|
|
41620
41698
|
mode: 384
|
|
@@ -44143,7 +44221,7 @@ var init_main = __esm(() => {
|
|
|
44143
44221
|
// src/hooks/otel-writers.ts
|
|
44144
44222
|
import { homedir as homedir35 } from "node:os";
|
|
44145
44223
|
import { resolve as resolve35 } from "node:path";
|
|
44146
|
-
import { accessSync as accessSync2, constants, readdirSync as
|
|
44224
|
+
import { accessSync as accessSync2, constants, readdirSync as readdirSync24, statSync as statSync38 } from "node:fs";
|
|
44147
44225
|
function vscodeSettingsPath(home = homedir35(), platform = process.platform) {
|
|
44148
44226
|
if (platform === "darwin")
|
|
44149
44227
|
return resolve35(home, "Library/Application Support/Code/User/settings.json");
|
|
@@ -44158,7 +44236,7 @@ function vscodeInstalled(home = homedir35(), platform = process.platform) {
|
|
|
44158
44236
|
const executable = (path) => {
|
|
44159
44237
|
try {
|
|
44160
44238
|
accessSync2(path, platform === "win32" ? constants.F_OK : constants.X_OK);
|
|
44161
|
-
return
|
|
44239
|
+
return statSync38(path).isFile();
|
|
44162
44240
|
} catch {
|
|
44163
44241
|
return false;
|
|
44164
44242
|
}
|
|
@@ -44170,7 +44248,7 @@ function vscodeInstalled(home = homedir35(), platform = process.platform) {
|
|
|
44170
44248
|
return true;
|
|
44171
44249
|
return [".vscode", ".vscode-insiders"].some((folder) => {
|
|
44172
44250
|
try {
|
|
44173
|
-
return
|
|
44251
|
+
return readdirSync24(resolve35(home, folder, "extensions"), { withFileTypes: true }).some((entry) => entry.isDirectory() && /^github\.copilot(?:-chat)?-\d/i.test(entry.name));
|
|
44174
44252
|
} catch {
|
|
44175
44253
|
return false;
|
|
44176
44254
|
}
|
|
@@ -44393,11 +44471,11 @@ import {
|
|
|
44393
44471
|
existsSync as existsSync52,
|
|
44394
44472
|
mkdirSync as mkdirSync30,
|
|
44395
44473
|
readFileSync as readFileSync42,
|
|
44396
|
-
statSync as
|
|
44474
|
+
statSync as statSync39,
|
|
44397
44475
|
unlinkSync as unlinkSync8,
|
|
44398
44476
|
writeFileSync as writeFileSync25
|
|
44399
44477
|
} from "node:fs";
|
|
44400
|
-
import { dirname as
|
|
44478
|
+
import { dirname as dirname28 } from "node:path";
|
|
44401
44479
|
import { createHash as createHash13, randomUUID as randomUUID6 } from "node:crypto";
|
|
44402
44480
|
import { homedir as homedir36 } from "node:os";
|
|
44403
44481
|
import { connect } from "node:net";
|
|
@@ -44457,13 +44535,13 @@ function credential() {
|
|
|
44457
44535
|
function backupOnce(path, original) {
|
|
44458
44536
|
if (existsSync52(`${path}.failproofai-bak`))
|
|
44459
44537
|
return;
|
|
44460
|
-
mkdirSync30(
|
|
44538
|
+
mkdirSync30(dirname28(path), { recursive: true });
|
|
44461
44539
|
writeFileSync25(`${path}.failproofai-bak`, original ?? "", { flag: "wx", mode: 384 });
|
|
44462
44540
|
chmodSync11(`${path}.failproofai-bak`, 384);
|
|
44463
44541
|
}
|
|
44464
44542
|
function savePrivate(agent, state) {
|
|
44465
44543
|
const path = otelAgentStateFile(agent);
|
|
44466
|
-
mkdirSync30(
|
|
44544
|
+
mkdirSync30(dirname28(path), { recursive: true, mode: 448 });
|
|
44467
44545
|
writeConfigFileAtomic(path, JSON.stringify(state), { backup: false, mode: 384 });
|
|
44468
44546
|
chmodSync11(path, 384);
|
|
44469
44547
|
}
|
|
@@ -44568,7 +44646,7 @@ async function enableAgent(agent, yes, localFlag, content, options) {
|
|
|
44568
44646
|
const next = editAgentConfig(original ?? "", agent, [...released, ...writes]);
|
|
44569
44647
|
const state = oldState ?? {
|
|
44570
44648
|
original,
|
|
44571
|
-
originalMode: original === null ? undefined :
|
|
44649
|
+
originalMode: original === null ? undefined : statSync39(file).mode & 511,
|
|
44572
44650
|
writtenHash: "",
|
|
44573
44651
|
previous: writes.map((w) => ({ path: w.path, value: getSetting(parsed, w.path) }))
|
|
44574
44652
|
};
|
|
@@ -45246,8 +45324,8 @@ var init_jev_stats = __esm(() => {
|
|
|
45246
45324
|
});
|
|
45247
45325
|
|
|
45248
45326
|
// src/hooks/jev-cli.ts
|
|
45249
|
-
import { chmodSync as chmodSync12, existsSync as existsSync53, statSync as
|
|
45250
|
-
import { dirname as
|
|
45327
|
+
import { chmodSync as chmodSync12, existsSync as existsSync53, statSync as statSync40, unlinkSync as unlinkSync9 } from "node:fs";
|
|
45328
|
+
import { dirname as dirname29 } from "node:path";
|
|
45251
45329
|
function jevHeader(name, meta, opts) {
|
|
45252
45330
|
return [screenKit(opts).header(meta ? `${name} · ${meta}` : name)];
|
|
45253
45331
|
}
|
|
@@ -45828,13 +45906,13 @@ async function setupRun(argv, deps, opts) {
|
|
|
45828
45906
|
}
|
|
45829
45907
|
let fileMode = null;
|
|
45830
45908
|
try {
|
|
45831
|
-
fileMode =
|
|
45909
|
+
fileMode = statSync40(path).mode & 511;
|
|
45832
45910
|
} catch {}
|
|
45833
|
-
const dir =
|
|
45911
|
+
const dir = dirname29(path);
|
|
45834
45912
|
let tightenedDir = null;
|
|
45835
45913
|
if (process.platform !== "win32") {
|
|
45836
45914
|
try {
|
|
45837
|
-
const before =
|
|
45915
|
+
const before = statSync40(dir).mode & 511;
|
|
45838
45916
|
if ((before & 18) !== 0) {
|
|
45839
45917
|
const after = before & -19;
|
|
45840
45918
|
chmodSync12(dir, after);
|
|
@@ -45956,15 +46034,15 @@ async function cloudSetup(values, bools, opts) {
|
|
|
45956
46034
|
}
|
|
45957
46035
|
if (process.platform !== "win32") {
|
|
45958
46036
|
try {
|
|
45959
|
-
const dir =
|
|
45960
|
-
const before =
|
|
46037
|
+
const dir = dirname29(path);
|
|
46038
|
+
const before = statSync40(dir).mode & 511;
|
|
45961
46039
|
if ((before & 18) !== 0)
|
|
45962
46040
|
chmodSync12(dir, before & -19);
|
|
45963
46041
|
} catch {}
|
|
45964
46042
|
}
|
|
45965
46043
|
let fileMode = null;
|
|
45966
46044
|
try {
|
|
45967
|
-
fileMode =
|
|
46045
|
+
fileMode = statSync40(path).mode & 511;
|
|
45968
46046
|
} catch {}
|
|
45969
46047
|
const cfg = checked.value;
|
|
45970
46048
|
const route = jevRoute(cfg);
|
|
@@ -46593,7 +46671,7 @@ import {
|
|
|
46593
46671
|
openSync as openSync8,
|
|
46594
46672
|
readFileSync as readFileSync43,
|
|
46595
46673
|
readSync as readSync6,
|
|
46596
|
-
statSync as
|
|
46674
|
+
statSync as statSync41,
|
|
46597
46675
|
writeFileSync as writeFileSync26
|
|
46598
46676
|
} from "node:fs";
|
|
46599
46677
|
function detectLayout2() {
|
|
@@ -46677,7 +46755,7 @@ import {
|
|
|
46677
46755
|
rmSync as rmSync21,
|
|
46678
46756
|
writeFileSync as writeFileSync27
|
|
46679
46757
|
} from "node:fs";
|
|
46680
|
-
import { basename as basename10, dirname as
|
|
46758
|
+
import { basename as basename10, dirname as dirname30, join as join43, resolve as resolve38 } from "node:path";
|
|
46681
46759
|
function migrateToLayout42() {
|
|
46682
46760
|
const moves = [
|
|
46683
46761
|
{ from: legacy.authJson(), to: auditSessionFile() },
|
|
@@ -46699,7 +46777,7 @@ function migrateToLayout42() {
|
|
|
46699
46777
|
rmSync21(from, { force: true });
|
|
46700
46778
|
continue;
|
|
46701
46779
|
}
|
|
46702
|
-
mkdirSync32(
|
|
46780
|
+
mkdirSync32(dirname30(to), { recursive: true });
|
|
46703
46781
|
try {
|
|
46704
46782
|
renameSync15(from, to);
|
|
46705
46783
|
} catch {
|
|
@@ -46938,12 +47016,14 @@ import {
|
|
|
46938
47016
|
mkdirSync as mkdirSync33,
|
|
46939
47017
|
mkdtempSync as mkdtempSync2,
|
|
46940
47018
|
readFileSync as readFileSync45,
|
|
47019
|
+
readdirSync as readdirSync25,
|
|
47020
|
+
statSync as statSync42,
|
|
46941
47021
|
writeFileSync as writeFileSync28,
|
|
46942
47022
|
unlinkSync as unlinkSync10,
|
|
46943
47023
|
rmSync as rmSync22
|
|
46944
47024
|
} from "node:fs";
|
|
46945
47025
|
import { homedir as homedir38, tmpdir as tmpdir3, userInfo as userInfo2 } from "node:os";
|
|
46946
|
-
import { resolve as resolve39 } from "node:path";
|
|
47026
|
+
import { dirname as dirname31, resolve as resolve39 } from "node:path";
|
|
46947
47027
|
import { execFileSync as execFileSync3 } from "node:child_process";
|
|
46948
47028
|
function isDaemonSupportedPlatform2() {
|
|
46949
47029
|
return process.platform === "linux" || process.platform === "darwin";
|
|
@@ -47049,6 +47129,60 @@ function systemdUnitDir2() {
|
|
|
47049
47129
|
function systemdUnitPath2(user = serviceUser2()) {
|
|
47050
47130
|
return resolve39(systemdUnitDir2(), systemdUnitName2(user));
|
|
47051
47131
|
}
|
|
47132
|
+
function systemBinaryRoot2(user = serviceUser2()) {
|
|
47133
|
+
return resolve39(process.env.FAILPROOFAI_SYSTEM_BIN_DIR || "/opt/failproofai", user);
|
|
47134
|
+
}
|
|
47135
|
+
function systemBinaryDir2() {
|
|
47136
|
+
return resolve39(systemBinaryRoot2(), "bin");
|
|
47137
|
+
}
|
|
47138
|
+
function systemBinaryTarget2(binaryPath) {
|
|
47139
|
+
if (process.platform !== "linux" || process.env.FAILPROOFAI_DAEMON_BINARY)
|
|
47140
|
+
return null;
|
|
47141
|
+
try {
|
|
47142
|
+
if (!statSync42(binaryPath).isFile())
|
|
47143
|
+
return null;
|
|
47144
|
+
} catch {
|
|
47145
|
+
return null;
|
|
47146
|
+
}
|
|
47147
|
+
return resolve39(systemBinaryDir2(), `failproofaid-${version2}`);
|
|
47148
|
+
}
|
|
47149
|
+
function selinuxEnabled2() {
|
|
47150
|
+
return existsSync56("/sys/fs/selinux/enforce");
|
|
47151
|
+
}
|
|
47152
|
+
function stageSystemBinary2(binaryPath) {
|
|
47153
|
+
const target = systemBinaryTarget2(binaryPath);
|
|
47154
|
+
if (!target)
|
|
47155
|
+
return binaryPath;
|
|
47156
|
+
const dir = systemBinaryDir2();
|
|
47157
|
+
const staging = `${target}.${process.pid}.tmp`;
|
|
47158
|
+
runPrivileged2("install", ["-d", "-m", "0755", dir]);
|
|
47159
|
+
try {
|
|
47160
|
+
runPrivileged2("install", ["-m", "0755", binaryPath, staging]);
|
|
47161
|
+
runPrivileged2("mv", ["-f", staging, target]);
|
|
47162
|
+
} catch (err) {
|
|
47163
|
+
try {
|
|
47164
|
+
runPrivileged2("rm", ["-f", staging]);
|
|
47165
|
+
} catch {}
|
|
47166
|
+
throw err;
|
|
47167
|
+
}
|
|
47168
|
+
if (selinuxEnabled2()) {
|
|
47169
|
+
const root = systemBinaryRoot2();
|
|
47170
|
+
try {
|
|
47171
|
+
runPrivileged2("restorecon", ["-R", root]);
|
|
47172
|
+
} catch (err) {
|
|
47173
|
+
hookLogWarn(`restorecon on ${root} failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
47174
|
+
}
|
|
47175
|
+
}
|
|
47176
|
+
return target;
|
|
47177
|
+
}
|
|
47178
|
+
function pruneSystemBinaries2(current) {
|
|
47179
|
+
try {
|
|
47180
|
+
const dir = systemBinaryDir2();
|
|
47181
|
+
const stale = readdirSync25(dir).filter((f) => f.startsWith("failproofaid-")).map((f) => resolve39(dir, f)).filter((p) => p !== current).map((p) => ({ p, mtime: statSync42(p).mtimeMs })).sort((a, b) => b.mtime - a.mtime).slice(1);
|
|
47182
|
+
for (const { p } of stale)
|
|
47183
|
+
runPrivileged2("rm", ["-f", p]);
|
|
47184
|
+
} catch {}
|
|
47185
|
+
}
|
|
47052
47186
|
function legacySystemdUserUnitPath2() {
|
|
47053
47187
|
return resolve39(homedir38(), ".config", "systemd", "user", "failproofaid.service");
|
|
47054
47188
|
}
|
|
@@ -47221,9 +47355,17 @@ ${envBlock} <key>StandardOutPath</key>
|
|
|
47221
47355
|
}
|
|
47222
47356
|
function daemonInstallCommands2(binaryPath, workerCmd, cliCmd) {
|
|
47223
47357
|
if (process.platform === "linux") {
|
|
47358
|
+
const target = systemBinaryTarget2(binaryPath);
|
|
47359
|
+
const dir = systemBinaryDir2();
|
|
47360
|
+
const stage = target ? [
|
|
47361
|
+
`sudo install -d -m 0755 ${dir}`,
|
|
47362
|
+
`sudo install -m 0755 ${binaryPath} ${target}`,
|
|
47363
|
+
`{ sudo restorecon -R ${systemBinaryRoot2()} 2>/dev/null || true; }`
|
|
47364
|
+
] : [];
|
|
47224
47365
|
return [
|
|
47366
|
+
...stage,
|
|
47225
47367
|
`sudo tee ${systemdUnitPath2()} <<'EOF'
|
|
47226
|
-
${systemdUnitContents2(binaryPath, workerCmd, cliCmd)}EOF`,
|
|
47368
|
+
${systemdUnitContents2(target ?? binaryPath, workerCmd, cliCmd)}EOF`,
|
|
47227
47369
|
"sudo systemctl daemon-reload",
|
|
47228
47370
|
`sudo systemctl enable ${systemdUnitName2()}`,
|
|
47229
47371
|
`sudo systemctl restart ${systemdUnitName2()}`
|
|
@@ -47251,9 +47393,11 @@ async function installDaemonService2() {
|
|
|
47251
47393
|
};
|
|
47252
47394
|
}
|
|
47253
47395
|
removeLegacyUserService2();
|
|
47396
|
+
let execPath = binaryPath;
|
|
47254
47397
|
try {
|
|
47255
47398
|
if (process.platform === "linux") {
|
|
47256
|
-
|
|
47399
|
+
execPath = stageSystemBinary2(binaryPath);
|
|
47400
|
+
writePrivilegedFile2(systemdUnitPath2(), systemdUnitContents2(execPath, workerCmd, cliCmd));
|
|
47257
47401
|
runPrivileged2("systemctl", ["daemon-reload"]);
|
|
47258
47402
|
runPrivileged2("systemctl", ["enable", systemdUnitName2()]);
|
|
47259
47403
|
restartSystemdUnit2();
|
|
@@ -47277,6 +47421,8 @@ async function installDaemonService2() {
|
|
|
47277
47421
|
hookLogWarn(`daemon service install failed: ${reason}`);
|
|
47278
47422
|
return { installed: false, reason };
|
|
47279
47423
|
}
|
|
47424
|
+
if (execPath !== binaryPath)
|
|
47425
|
+
pruneSystemBinaries2(execPath);
|
|
47280
47426
|
return { installed: true };
|
|
47281
47427
|
}
|
|
47282
47428
|
async function probeDaemon2() {
|
|
@@ -47685,10 +47831,12 @@ function manualServiceRemoval(servicePath) {
|
|
|
47685
47831
|
return [`sudo launchctl unload -w ${servicePath}`, `sudo rm -f ${servicePath}`];
|
|
47686
47832
|
}
|
|
47687
47833
|
const unit = servicePath.split("/").pop() ?? servicePath;
|
|
47834
|
+
const binDir = daemonSystemBinaryDir();
|
|
47688
47835
|
return [
|
|
47689
47836
|
`sudo systemctl disable --now ${unit}`,
|
|
47690
47837
|
`sudo rm -f ${servicePath}`,
|
|
47691
|
-
`sudo systemctl daemon-reload
|
|
47838
|
+
`sudo systemctl daemon-reload`,
|
|
47839
|
+
...binDir ? [`sudo rm -rf ${binDir}`] : []
|
|
47692
47840
|
];
|
|
47693
47841
|
}
|
|
47694
47842
|
var init_uninstall_cli = __esm(() => {
|
|
@@ -47706,8 +47854,8 @@ var init_uninstall_cli = __esm(() => {
|
|
|
47706
47854
|
import { execFileSync as execFileSync4 } from "node:child_process";
|
|
47707
47855
|
import { homedir as homedir39, tmpdir as tmpdir4 } from "node:os";
|
|
47708
47856
|
import { createHash as createHash14 } from "node:crypto";
|
|
47709
|
-
import { copyFileSync as copyFileSync5, existsSync as existsSync58, mkdirSync as mkdirSync34, mkdtempSync as mkdtempSync3, readFileSync as readFileSync46, readdirSync as
|
|
47710
|
-
import { basename as basename11, dirname as
|
|
47857
|
+
import { copyFileSync as copyFileSync5, existsSync as existsSync58, mkdirSync as mkdirSync34, mkdtempSync as mkdtempSync3, readFileSync as readFileSync46, readdirSync as readdirSync26, realpathSync as realpathSync5, rmSync as rmSync24, statSync as statSync43, writeFileSync as writeFileSync29 } from "node:fs";
|
|
47858
|
+
import { basename as basename11, dirname as dirname32, isAbsolute as isAbsolute6, join as join44, relative as relative5, resolve as resolve40, sep as sep6 } from "node:path";
|
|
47711
47859
|
function parseList(rest, ...flags) {
|
|
47712
47860
|
let found = false;
|
|
47713
47861
|
const out = [];
|
|
@@ -48297,7 +48445,7 @@ function inferTaggedVersion(entryPath, sources) {
|
|
|
48297
48445
|
function findEntry(dir) {
|
|
48298
48446
|
let names;
|
|
48299
48447
|
try {
|
|
48300
|
-
names =
|
|
48448
|
+
names = readdirSync26(dir);
|
|
48301
48449
|
} catch {
|
|
48302
48450
|
return [];
|
|
48303
48451
|
}
|
|
@@ -48307,7 +48455,7 @@ function findEntry(dir) {
|
|
|
48307
48455
|
continue;
|
|
48308
48456
|
const full = resolve40(dir, name);
|
|
48309
48457
|
try {
|
|
48310
|
-
if (
|
|
48458
|
+
if (statSync43(full).size > 512 * 1024)
|
|
48311
48459
|
continue;
|
|
48312
48460
|
const text = readFileSync46(full, "utf8");
|
|
48313
48461
|
if (/from\s+["']failproofai["']/.test(text) && /(?:customPolicies|semanticPolicies)\s*\.\s*add\s*\(/.test(text)) {
|
|
@@ -48326,7 +48474,7 @@ function withLocalImports(sources) {
|
|
|
48326
48474
|
const file = queue.shift();
|
|
48327
48475
|
let text;
|
|
48328
48476
|
try {
|
|
48329
|
-
if (
|
|
48477
|
+
if (statSync43(file).size > 512 * 1024)
|
|
48330
48478
|
continue;
|
|
48331
48479
|
text = readFileSync46(file, "utf8");
|
|
48332
48480
|
} catch {
|
|
@@ -48334,13 +48482,13 @@ function withLocalImports(sources) {
|
|
|
48334
48482
|
}
|
|
48335
48483
|
for (const re of LOCAL_IMPORT_RES) {
|
|
48336
48484
|
for (const match of text.matchAll(re)) {
|
|
48337
|
-
const base = resolve40(
|
|
48485
|
+
const base = resolve40(dirname32(file), match[1]);
|
|
48338
48486
|
for (const ext of LOCAL_IMPORT_EXTENSIONS) {
|
|
48339
48487
|
const candidate = base + ext;
|
|
48340
48488
|
if (seen.has(candidate))
|
|
48341
48489
|
break;
|
|
48342
48490
|
try {
|
|
48343
|
-
if (!
|
|
48491
|
+
if (!statSync43(candidate).isFile())
|
|
48344
48492
|
continue;
|
|
48345
48493
|
} catch {
|
|
48346
48494
|
continue;
|
|
@@ -48587,7 +48735,7 @@ esac
|
|
|
48587
48735
|
return true;
|
|
48588
48736
|
} finally {
|
|
48589
48737
|
try {
|
|
48590
|
-
rmSync24(
|
|
48738
|
+
rmSync24(dirname32(askpass), { recursive: true, force: true });
|
|
48591
48739
|
} catch {}
|
|
48592
48740
|
}
|
|
48593
48741
|
}
|
|
@@ -51099,14 +51247,14 @@ var init_parse_script_args = () => {};
|
|
|
51099
51247
|
|
|
51100
51248
|
// scripts/install-diagnosis.mjs
|
|
51101
51249
|
import { existsSync as existsSync60, readFileSync as readFileSync48, realpathSync as realpathSync6 } from "node:fs";
|
|
51102
|
-
import { dirname as
|
|
51250
|
+
import { dirname as dirname33, resolve as resolve43 } from "node:path";
|
|
51103
51251
|
import { homedir as homedir40, platform as platform5 } from "node:os";
|
|
51104
51252
|
import { spawnSync } from "node:child_process";
|
|
51105
51253
|
function findPackageRoot(start) {
|
|
51106
51254
|
try {
|
|
51107
51255
|
let dir = realpathSync6(start);
|
|
51108
51256
|
if (existsSync60(dir) && !existsSync60(resolve43(dir, "package.json"))) {
|
|
51109
|
-
dir =
|
|
51257
|
+
dir = dirname33(dir);
|
|
51110
51258
|
}
|
|
51111
51259
|
while (true) {
|
|
51112
51260
|
const pkgPath = resolve43(dir, "package.json");
|
|
@@ -51117,7 +51265,7 @@ function findPackageRoot(start) {
|
|
|
51117
51265
|
return dir;
|
|
51118
51266
|
} catch {}
|
|
51119
51267
|
}
|
|
51120
|
-
const parent =
|
|
51268
|
+
const parent = dirname33(dir);
|
|
51121
51269
|
if (parent === dir)
|
|
51122
51270
|
return null;
|
|
51123
51271
|
dir = parent;
|
|
@@ -51648,7 +51796,7 @@ var init_launch_ready = () => {};
|
|
|
51648
51796
|
// scripts/launch.ts
|
|
51649
51797
|
import { spawn as spawn2 } from "child_process";
|
|
51650
51798
|
import { realpathSync as realpathSync7, existsSync as existsSync61 } from "node:fs";
|
|
51651
|
-
import { resolve as resolve44, dirname as
|
|
51799
|
+
import { resolve as resolve44, dirname as dirname34 } from "node:path";
|
|
51652
51800
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
51653
51801
|
function launch(mode, options = {}) {
|
|
51654
51802
|
const { loggingLevel, disableTelemetry, allowedDevOrigins, host, remainingArgs } = parseScriptArgs(process.argv.slice(2));
|
|
@@ -51684,7 +51832,7 @@ ${k.caution(exposedBindWarning(exposed.host))}
|
|
|
51684
51832
|
process.env.PORT = port;
|
|
51685
51833
|
process.env.HOSTNAME = bindHost;
|
|
51686
51834
|
cmd = "node";
|
|
51687
|
-
const packageRoot = process.env.FAILPROOFAI_PACKAGE_ROOT ?? resolve44(
|
|
51835
|
+
const packageRoot = process.env.FAILPROOFAI_PACKAGE_ROOT ?? resolve44(dirname34(realpathSync7(fileURLToPath2(import.meta.url))), "..");
|
|
51688
51836
|
const serverJsPath = resolve44(packageRoot, ".next/standalone/server.js");
|
|
51689
51837
|
if (!existsSync61(serverJsPath)) {
|
|
51690
51838
|
let shadowMessage = null;
|
|
@@ -52913,7 +53061,7 @@ var init_session_pause_cli2 = __esm(() => {
|
|
|
52913
53061
|
// scripts/launch.ts
|
|
52914
53062
|
import { spawn as spawn3 } from "child_process";
|
|
52915
53063
|
import { realpathSync as realpathSync8, existsSync as existsSync62 } from "node:fs";
|
|
52916
|
-
import { resolve as resolve46, dirname as
|
|
53064
|
+
import { resolve as resolve46, dirname as dirname35 } from "node:path";
|
|
52917
53065
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
52918
53066
|
function launch2(mode, options = {}) {
|
|
52919
53067
|
const { loggingLevel, disableTelemetry, allowedDevOrigins, host, remainingArgs } = parseScriptArgs(process.argv.slice(2));
|
|
@@ -52949,7 +53097,7 @@ ${k.caution(exposedBindWarning(exposed.host))}
|
|
|
52949
53097
|
process.env.PORT = port;
|
|
52950
53098
|
process.env.HOSTNAME = bindHost;
|
|
52951
53099
|
cmd = "node";
|
|
52952
|
-
const packageRoot = process.env.FAILPROOFAI_PACKAGE_ROOT ?? resolve46(
|
|
53100
|
+
const packageRoot = process.env.FAILPROOFAI_PACKAGE_ROOT ?? resolve46(dirname35(realpathSync8(fileURLToPath3(import.meta.url))), "..");
|
|
52953
53101
|
const serverJsPath = resolve46(packageRoot, ".next/standalone/server.js");
|
|
52954
53102
|
if (!existsSync62(serverJsPath)) {
|
|
52955
53103
|
let shadowMessage = null;
|
|
@@ -53071,17 +53219,17 @@ var init_cli_error2 = __esm(() => {
|
|
|
53071
53219
|
|
|
53072
53220
|
// bin/failproofai.mjs
|
|
53073
53221
|
import { realpathSync as realpathSync9 } from "fs";
|
|
53074
|
-
import { dirname as
|
|
53222
|
+
import { dirname as dirname36, resolve as resolve47 } from "path";
|
|
53075
53223
|
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
53076
53224
|
// package.json
|
|
53077
|
-
var version = "1.0.
|
|
53225
|
+
var version = "1.0.13-beta.2";
|
|
53078
53226
|
|
|
53079
53227
|
// bin/failproofai.mjs
|
|
53080
53228
|
if (!process.env.FAILPROOFAI_PACKAGE_ROOT) {
|
|
53081
|
-
process.env.FAILPROOFAI_PACKAGE_ROOT = resolve47(
|
|
53229
|
+
process.env.FAILPROOFAI_PACKAGE_ROOT = resolve47(dirname36(realpathSync9(fileURLToPath4(import.meta.url))), "..");
|
|
53082
53230
|
}
|
|
53083
53231
|
if (!process.env.FAILPROOFAI_DIST_PATH) {
|
|
53084
|
-
process.env.FAILPROOFAI_DIST_PATH = resolve47(
|
|
53232
|
+
process.env.FAILPROOFAI_DIST_PATH = resolve47(dirname36(realpathSync9(fileURLToPath4(import.meta.url))), "..", "dist");
|
|
53085
53233
|
}
|
|
53086
53234
|
var args = process.argv.slice(2);
|
|
53087
53235
|
if (args[0] === "p" || args[0] === "policy")
|