failproofai 1.0.7 → 1.0.8-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/prerender-manifest.json +4 -4
- package/.next/standalone/.next/required-server-files.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page.js +4 -4
- package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +7 -7
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +6 -6
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js +4 -4
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +15 -15
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +15 -15
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +14 -14
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/api/audit/invite/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/audit/run/route.js +8 -7
- package/.next/standalone/.next/server/app/api/audit/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/audit/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/login-request/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/login-verify/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/audit/page/server-reference-manifest.json +2 -2
- package/.next/standalone/.next/server/app/audit/page.js +9 -7
- package/.next/standalone/.next/server/app/audit/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/audit/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +15 -15
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +14 -14
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +15 -15
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/page.js +6 -6
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +14 -14
- package/.next/standalone/.next/server/app/policies/page.js +11 -10
- package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page.js +8 -7
- package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/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 +6 -6
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/projects/page.js +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/server-reference-manifest.json +52 -8
- package/.next/standalone/.next/server/app/settings/page.js +12 -7
- 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]__1msfs-h._.js → [externals]__19_pzeq._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{[externals]__1_bftcl._.js → [externals]__20kzpkf._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0o07qi9._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1ttrwnd._.js +22 -0
- package/.next/standalone/.next/server/chunks/_09dz7xv._.js +21 -21
- package/.next/standalone/.next/server/chunks/_0tovk6q._.js +1 -1
- package/.next/standalone/.next/server/chunks/_0trp3yc._.js +1 -1
- package/.next/standalone/.next/server/chunks/_1ek68ln._.js +16 -16
- package/.next/standalone/.next/server/chunks/{_1c3k-8x._.js → _1q5i8mb._.js} +2 -2
- package/.next/standalone/.next/server/chunks/lib_16xa545._.js +3 -0
- package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4v._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_hooks_1aveq0u._.js +5 -0
- package/.next/standalone/.next/server/chunks/src_hooks_1eem5a7._.js +3 -0
- package/.next/standalone/.next/server/chunks/src_hooks_custom-hooks-loader_ts_0lnb3n3._.js +4 -2
- package/.next/standalone/.next/server/chunks/ssr/[externals]__0ohnuzs._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01bmjsj._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__04usis8._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__056wjo4._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__059yza8._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__06pflha._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0eip4_k._.js +22 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0n0xg95._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0qcb0mg._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0rwtwpm._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0yrsbd_._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__11mayhe._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12e7nhs._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__13d-wb6._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0bd3mje._.js → [root-of-the-server]__14o3ek1._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__15578wp._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__19evfi8._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1dinjii._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1m_svbe._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0cxe_2_._.js → [root-of-the-server]__1mf3zp6._.js} +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1pprgri._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1q4p5b8._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1qiz0e4._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_042cgl1._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_08x1r5t._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0bqoto4._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_166t73i._.js → _0o4xkpl._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0uyu3jf._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_1-i_gzc._.js → _1-7sqrb._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_1es2j7i._.js → _1gb0ifp._.js} +5 -5
- package/.next/standalone/.next/server/chunks/ssr/{_1_qswah._.js → _1q46vxx._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_1zopuov._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_next-internal_server_app_policies_page_actions_1sp2-yo.js +13 -13
- package/.next/standalone/.next/server/chunks/ssr/app_actions_get-scheduled-audit_ts_0ei9sni._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/app_audit__components_audit-dashboard_tsx_0p9ud47._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_1kp6l3x._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_19dqvpc._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/app_settings_02tf1h4._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_0aiy-os._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_next_dist_0drixxt._.js → node_modules_next_dist_0w6mzq5._.js} +4 -4
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_18_d8l1._.js +151 -0
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_0-q0umm._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_06kzv9d._.js +12 -0
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_0g194sy._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_1cv9_c4._.js +4 -2
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_1kx9e0d._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_effective-reviewers_ts_1h4wtvo._.js +5 -0
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_fp-config_ts_04t589g._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_fp-home_ts_0je3xkv._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_pack-cli_ts_0t7me65._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_semantic_pack-policies_ts_0gh_bu_._.js +3 -0
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +67 -23
- package/.next/standalone/.next/static/chunks/078gnymqoh3r4.js +1 -0
- package/.next/standalone/.next/static/chunks/{2mdh397ghgnvv.js → 0ahfwmbkpgfw4.js} +1 -1
- package/.next/standalone/.next/static/chunks/0bhidk90e-07f.css +2 -0
- package/.next/standalone/.next/static/chunks/1bu2-nv59ed6i.js +1 -0
- package/.next/standalone/.next/static/chunks/{0o6qlkgubtoex.js → 1v_tp3hm8wyhe.js} +1 -1
- package/.next/standalone/.next/static/chunks/2a405_e1o26ol.js +1 -0
- package/.next/standalone/.next/static/chunks/2qv4hshejedtx.css +1 -0
- package/.next/standalone/.next/static/chunks/2vo7qbdbvnc0o.js +69 -0
- package/.next/standalone/.next/static/chunks/{13i7-9is-vhys.js → 2z7i-yg59w4pn.js} +1 -1
- package/.next/standalone/.next/static/chunks/36uhh9el_oz8e.js +1 -0
- package/.next/standalone/.next/static/chunks/{0__8a7m868fvf.js → 3bgot5v6f6s3c.js} +1 -1
- package/.next/standalone/.next/static/chunks/3o3f1ibfci0p7.js +6 -0
- package/.next/standalone/PROBE-FOLLOWUP.md +186 -0
- package/.next/standalone/app/actions/get-jev-config.ts +604 -0
- package/.next/standalone/app/actions/pack-actions.ts +12 -0
- package/.next/standalone/app/actions/update-jev-config.ts +569 -0
- package/.next/standalone/app/components/jev-notices.tsx +96 -0
- package/.next/standalone/app/policies/hooks-client.tsx +14 -3
- package/.next/standalone/app/settings/jev-panel.tsx +630 -0
- package/.next/standalone/app/settings/page.tsx +20 -1
- package/.next/standalone/app/settings/settings-client.tsx +27 -1
- package/.next/standalone/app/settings/settings.css +79 -0
- package/.next/standalone/fp-cloud-cli/CHANGELOG.md +22 -4
- package/.next/standalone/fp-cloud-cli/fp_cli/client.py +14 -1
- package/.next/standalone/fp-cloud-cli/fp_cli/commands/keys_cmds.py +17 -3
- package/.next/standalone/fp-cloud-cli/fp_cli/commands/policies_cmds.py +3 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/permissions.py +22 -0
- package/.next/standalone/fp-cloud-cli/fp_cli/policy_check.py +169 -0
- package/.next/standalone/fp-cloud-cli/skill/references/commands.md +1 -1
- package/.next/standalone/fp-cloud-cli/tests/test_keys_queries.py +65 -0
- package/.next/standalone/fp-cloud-cli/tests/test_policy_check.py +61 -0
- package/.next/standalone/package.json +10 -10
- package/.next/standalone/sdk/python/CHANGELOG.md +7 -0
- package/.next/standalone/sdk/python/failproofai_sdk/_version.py +1 -1
- package/.next/standalone/sdk/typescript/scripts/release.mjs +30 -0
- package/.next/standalone/server.js +1 -1
- package/README.md +3 -2
- package/bin/failproofai.mjs +148 -4
- package/dist/cli.mjs +18537 -9492
- package/dist/index.js +19 -1
- package/dist/worker.mjs +10421 -3770
- package/package.json +10 -10
- package/pi-extension/index.ts +11 -0
- package/scripts/build-policy-pack.mjs +53 -2
- package/src/audit/features.ts +3 -2
- package/src/hooks/builtin-policies.ts +195 -8
- package/src/hooks/cloud-connection.ts +190 -1
- package/src/hooks/cloud-enrollment-cli.ts +57 -8
- package/src/hooks/cloud-introspect.ts +6 -0
- package/src/hooks/cloud-managed-policies.ts +22 -0
- package/src/hooks/configure-wizard.ts +26 -6
- package/src/hooks/custom-hooks-loader.ts +98 -10
- package/src/hooks/custom-hooks-registry.ts +45 -1
- package/src/hooks/effective-reviewers.ts +243 -0
- package/src/hooks/first-run-gate.ts +5 -0
- package/src/hooks/flush-cli.ts +35 -8
- package/src/hooks/fp-config.ts +266 -1
- package/src/hooks/fp-home.ts +23 -0
- package/src/hooks/fp-reset.ts +22 -4
- package/src/hooks/handler.ts +303 -7
- package/src/hooks/hook-activity-store.ts +118 -6
- package/src/hooks/hook-telemetry.ts +41 -0
- package/src/hooks/jev-activity.ts +385 -0
- package/src/hooks/jev-cli.ts +2172 -0
- package/src/hooks/jev-cloud-connection.ts +392 -0
- package/src/hooks/loader-utils.ts +6 -0
- package/src/hooks/manager.ts +45 -7
- package/src/hooks/pack-cli.ts +568 -37
- package/src/hooks/pack-failclosed.ts +3 -0
- package/src/hooks/pack-manifest.ts +489 -7
- package/src/hooks/pack-store.ts +194 -11
- package/src/hooks/policy-authority.ts +386 -0
- package/src/hooks/policy-catalog.ts +206 -0
- package/src/hooks/policy-evaluator.ts +963 -796
- package/src/hooks/policy-registry.ts +27 -1
- package/src/hooks/policy-reviewability.ts +258 -0
- package/src/hooks/policy-types.ts +128 -0
- package/src/hooks/semantic/combine.ts +581 -0
- package/src/hooks/semantic/compile.ts +176 -0
- package/src/hooks/semantic/decide.ts +408 -0
- package/src/hooks/semantic/envelope.ts +1255 -0
- package/src/hooks/semantic/evaluator.ts +556 -0
- package/src/hooks/semantic/facts.ts +298 -0
- package/src/hooks/semantic/intent.ts +1190 -0
- package/src/hooks/semantic/jev-client.ts +1155 -0
- package/src/hooks/semantic/jev-config.ts +1142 -0
- package/src/hooks/semantic/jev-review.ts +389 -0
- package/src/hooks/semantic/jev-stats.ts +289 -0
- package/src/hooks/semantic/jev-throttle.ts +427 -0
- package/src/hooks/semantic/pack-policies.ts +294 -0
- package/src/hooks/semantic/policies.ts +597 -0
- package/src/hooks/semantic/precondition-names.ts +60 -0
- package/src/hooks/semantic/preconditions.ts +58 -0
- package/src/hooks/semantic/redact.ts +2937 -0
- package/src/hooks/semantic/session-root.ts +116 -0
- package/src/hooks/semantic/types.ts +156 -0
- package/src/hooks/semver-precedence.ts +128 -0
- package/src/hooks/tui.ts +4 -0
- package/src/hooks/types.ts +1 -1
- package/src/hooks/worker-server.ts +121 -27
- package/src/index.ts +6 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0cuho4x._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1_r2rbg._.js +0 -24
- package/.next/standalone/.next/server/chunks/src_hooks_0iu54mz._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0-_ki57._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__013jr2b._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01wy8d-._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02npjtd._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0cg-bgc._.js +0 -5
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0cpu_mj._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0da85px._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ftmoxc._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0p-5p8u._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0u3w0ll._.js +0 -22
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__17d_ffl._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__19d9tgz._.js +0 -5
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1ctpynv._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1jiwfsj._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1p2otjt._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1phc187._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_06imw3p._.js +0 -5
- package/.next/standalone/.next/server/chunks/ssr/_0h_douw._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_1u8-lu2._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/app_settings_settings-client_tsx_20lq-mq._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_builtin-policies_ts_09j2ndl._.js +0 -3
- package/.next/standalone/.next/static/chunks/094xgi4owxaqf.js +0 -1
- package/.next/standalone/.next/static/chunks/1rz20_pz828f3.js +0 -6
- package/.next/standalone/.next/static/chunks/2k9f4tyv04809.css +0 -1
- package/.next/standalone/.next/static/chunks/2klitrtzpaoe0.js +0 -1
- package/.next/standalone/.next/static/chunks/2rshywgeqsyzk.css +0 -2
- package/.next/standalone/.next/static/chunks/3pzx4chkhko9k.js +0 -1
- package/.next/standalone/.next/static/chunks/3rh5o7e16irrm.js +0 -69
- package/.next/standalone/.next/static/chunks/43ufqrz8qo3h-.js +0 -1
- /package/.next/standalone/.next/static/{PgeWCHmyVbjRznv2VO7KF → O_b5R1axf5cb4NxIXq2kS}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{PgeWCHmyVbjRznv2VO7KF → O_b5R1axf5cb4NxIXq2kS}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{PgeWCHmyVbjRznv2VO7KF → O_b5R1axf5cb4NxIXq2kS}/_ssgManifest.js +0 -0
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
module.exports=[70406,(e,t,n)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},18622,(e,t,n)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},20635,(e,t,n)=>{t.exports=e.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},24725,(e,t,n)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},56704,(e,t,n)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,n)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},59043,(e,t,n)=>{t.exports=e.x("next/dist/server/runtime-reacts.external.js",()=>require("next/dist/server/runtime-reacts.external.js"))},93695,(e,t,n)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},74533,(e,t,n)=>{t.exports=e.x("node:child_process",()=>require("node:child_process"))},66680,(e,t,n)=>{t.exports=e.x("node:crypto",()=>require("node:crypto"))},2157,(e,t,n)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},60526,(e,t,n)=>{t.exports=e.x("node:os",()=>require("node:os"))},50227,(e,t,n)=>{t.exports=e.x("node:path",()=>require("node:path"))},81111,(e,t,n)=>{t.exports=e.x("node:stream",()=>require("node:stream"))},48480,e=>{"use strict";let t={running:!1,error:null};e.s(["finishRun",0,function(e){t.running=!1,t.startedAt=void 0,t.error=e},"getRunState",0,function(){return{...t}},"tryAcquireRun",0,function(){return!t.running&&(t.running=!0,t.startedAt=Date.now(),t.error=null,!0)}])},30441,e=>{"use strict";var t=e.i(50227),n=e.i(79708),i=e.i(93114),s=e.i(83534),r=e.i(81580),o=e.i(28557),a=e.i(40911);function l(){return(0,t.join)((0,i.antigravityHome)(),"conversation_summaries.db")}async function c(){let e=new Map,t=await (0,n.openSqliteReadonly)(l());if(!t)return e;try{for(let n of t.query("SELECT conversation_id, title, step_count, workspace_uris, last_modified_time FROM conversation_summaries"))n.conversation_id&&e.set(n.conversation_id,{title:n.title??void 0,cwd:function(e){let t;if(!e)return;try{let n=JSON.parse(e);Array.isArray(n)&&"string"==typeof n[0]?t=n[0]:"string"==typeof n&&(t=n)}catch{t=e}if(!t)return;let n=t.replace(/^file:\/\//,"");return n.length>0?n:void 0}(n.workspace_uris),stepCount:"number"==typeof n.step_count?n.step_count:void 0,lastMs:function(e){if("number"==typeof e&&Number.isFinite(e))return e>1e12?e:e>1e9?1e3*e:void 0;if("string"==typeof e){let t=Date.parse(e);if(!Number.isNaN(t))return t}}(n.last_modified_time)})}catch{}finally{t.close()}return e}async function u(){let e;try{e=(0,i.listAntigravityTranscripts)()}catch(e){return(0,a.logWarn)("Failed to scan Antigravity brain dir:",e),[]}let t=await c(),n=[];for(let s of e){let e=t.get(s.conversationId),r=e?.cwd??null;if(!r)try{let e=await (0,i.getAntigravitySessionLog)(s.conversationId);r=e?.cwd??null}catch{r=null}n.push({conversationId:s.conversationId,cwd:r,title:e?.title,mtimeMs:e?.lastMs??s.mtimeMs})}return n}let d="antigravity";async function f(){let e=await u(),t=new Map;for(let n of e){let e=n.cwd?(0,r.encodeFolderName)(n.cwd):d,i=n.cwd??"antigravity",s=t.get(e);(!s||n.mtimeMs>s.latest)&&t.set(e,{latest:n.mtimeMs,path:i})}let n=[];for(let[e,{latest:i,path:s}]of t){let t=new Date(i);n.push({name:e,path:s,isDirectory:!0,lastModified:t,lastModifiedFormatted:(0,o.formatDate)(t),cli:["antigravity"]})}return n.sort((e,t)=>t.lastModified.getTime()-e.lastModified.getTime()),n}async function m(e){let t=(await u()).filter(t=>(t.cwd?(0,r.encodeFolderName)(t.cwd):d)===e);if(0===t.length)return{cwd:null,sessions:[]};let n=[...t].sort((e,t)=>t.mtimeMs-e.mtimeMs);return{cwd:n.find(e=>e.cwd)?.cwd??(e===d?null:(0,r.decodeFolderName)(e)),sessions:n.map(e=>{let t=new Date(e.mtimeMs);return{name:e.title??e.conversationId,path:`antigravity://${e.conversationId}`,lastModified:t,lastModifiedFormatted:(0,o.formatDate)(t),sessionId:e.conversationId,cli:"antigravity"}})}}let p=(0,s.runtimeCache)(f,30),y=(0,s.runtimeCache)(e=>m(e),30,{maxSize:50});e.s(["antigravitySummariesDbPath",0,l,"getAntigravityIndex",0,c,"getAntigravityProjects",0,f,"getAntigravitySessionsByEncodedName",0,m,"getCachedAntigravityProjects",0,p,"getCachedAntigravitySessionsByEncodedName",0,y])},93114,e=>{"use strict";var t=e.i(12714),n=e.i(2157),i=e.i(60526),s=e.i(50227),r=e.i(83534),o=e.i(54214),a=e.i(67405);let l=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,c=new Set(["CONVERSATION_HISTORY","CHECKPOINT"]);function u(){return process.env.ANTIGRAVITY_HOME||(0,s.join)((0,i.homedir)(),".gemini","antigravity-cli")}function d(){return(0,s.join)(u(),"brain")}function f(){return(0,s.join)(".system_generated","logs","transcript_full.jsonl")}function m(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function p(e,t="session"){let n=[],i=new Map,s=Date.now();for(let r=0;r<e.length;r++){let l=e[r];if(!m(l))continue;let u="string"==typeof l.type?l.type:"";if(!u||c.has(u))continue;let d=function(e,t){if("number"==typeof e&&Number.isFinite(e)){if(e>1e12)return new Date(e);if(e>1e9)return new Date(1e3*e)}if("string"==typeof e){let t=Date.parse(e);if(!Number.isNaN(t))return new Date(t)}return new Date(t)}(l.created_at,s+r),f=d.toISOString(),p="number"==typeof l.step_index?l.step_index:r,y={uuid:`antigravity-${p}`,parentUuid:null},h=(0,o.baseEntry)(y,f,d,t);if("USER_INPUT"===u){let e="string"==typeof l.content?l.content:"";n.push({type:"user",...h,message:{role:"user",content:e}});continue}if("PLANNER_RESPONSE"===u){let e=[];if("string"==typeof l.content&&l.content.length>0&&e.push({type:"text",text:l.content}),Array.isArray(l.tool_calls))for(let t=0;t<l.tool_calls.length;t++){let n=l.tool_calls[t];if(!m(n))continue;let s="string"==typeof n.name?n.name:"tool",r={type:"tool_use",id:`${s}-${p}-${t}`,name:s,input:m(n.args)?n.args:{}};e.push(r);let o=s.toUpperCase(),a=i.get(o)??[];a.push({block:r,startMs:d.getTime()}),i.set(o,a)}if(0===e.length)continue;n.push({type:"assistant",...h,message:{role:"assistant",content:e}});continue}let g=i.get(u);if(g&&g.length>0){let{block:e,startMs:t}=g.shift(),n=Math.max(0,d.getTime()-t);e.result={timestamp:f,timestampFormatted:(0,o.formatTimestamp)(d),content:"string"==typeof l.content?l.content:"",durationMs:n,durationFormatted:(0,a.formatDuration)(n)};continue}n.push({type:"system",...h,raw:y})}return n.sort((e,t)=>e.timestampMs-t.timestampMs),n}function y(e){if(!l.test(e))return null;let t=(0,s.join)(d(),e,f());try{if((0,n.statSync)(t).isFile())return t}catch{}return null}async function h(e){let n,i=y(e);if(!i)return null;try{n=await (0,t.readFile)(i,"utf-8")}catch{return null}let s=(0,o.parseRawLines)(n,"session"),r=p(s,"session"),a=function(e){for(let t of e)if(m(t)&&Array.isArray(t.tool_calls))for(let e of t.tool_calls){if(!m(e)||!m(e.args))continue;let t=e.args.Cwd??e.args.cwd;if("string"==typeof t&&t.length>0)return t}}(s);return{entries:r,rawLines:s,cwd:a,filePath:i}}(0,r.runtimeCache)(e=>h(e),60,{maxSize:50}),e.s(["antigravityHome",0,u,"antigravityLinesToLogEntries",0,p,"findAntigravityTranscript",0,y,"getAntigravitySessionLog",0,h,"listAntigravityTranscripts",0,function(){let e,t=d(),i=f(),r=[];try{e=(0,n.readdirSync)(t,{withFileTypes:!0}).filter(e=>e.isDirectory())}catch{return r}for(let o of e){let e=o.name;if(!l.test(e))continue;let a=(0,s.join)(t,e,i);try{let t=(0,n.statSync)(a);if(!t.isFile())continue;r.push({conversationId:e,transcriptPath:a,mtimeMs:t.mtimeMs,sizeBytes:t.size})}catch{}}return r}])},94930,e=>{"use strict";var t=e.i(2157),n=e.i(50227),i=e.i(66680);e.s(["writeJsonAtomically",0,function(e,s,r={}){let o=r.mode??384,a=r.dirMode??448,l=(0,n.dirname)(e);(0,t.existsSync)(l)||(0,t.mkdirSync)(l,{recursive:!0,mode:a});let c=`${e}.${process.pid}.${(0,i.randomBytes)(6).toString("hex")}.tmp`;try{(0,t.writeFileSync)(c,JSON.stringify(s,null,2),{mode:o});try{(63&(0,t.statSync)(c).mode)!=0&&(0,t.chmodSync)(c,o)}catch{}(0,t.renameSync)(c,e);try{(63&(0,t.statSync)(e).mode)!=0&&(0,t.chmodSync)(e,o)}catch{}}catch(e){try{(0,t.rmSync)(c,{force:!0})}catch{}throw e}}])},36203,e=>{"use strict";var t=e.i(12714),n=e.i(60526),i=e.i(50227),s=e.i(81580),r=e.i(83534),o=e.i(71809),a=e.i(28557),l=e.i(40911);let c=(0,i.join)((0,n.homedir)(),".codex","sessions"),u=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i;async function d(e){try{return await (0,t.readdir)(e,{withFileTypes:!0})}catch{return null}}async function f(e){let n=null;try{n=await (0,t.open)(e,"r");let i=Buffer.alloc(262144),{bytesRead:s}=await n.read(i,0,262144,0);if(0===s)return null;let r=i.subarray(0,s),o=r.indexOf(10),a=-1===o?s:o;return r.subarray(0,a).toString("utf-8")}catch{return null}finally{n&&await n.close().catch(()=>{})}}async function m(e){let t=await d(e);return t?t.filter(e=>e.isFile()&&e.name.endsWith(".jsonl")).map(t=>(0,i.join)(e,t.name)):[]}async function p(){let e=await d(c);if(!e)return[];let n=[];for(let t of e){if(!t.isDirectory())continue;let e=await d((0,i.join)(c,t.name));if(e)for(let s of e){if(!s.isDirectory())continue;let e=await d((0,i.join)(c,t.name,s.name));if(e)for(let r of e){if(!r.isDirectory())continue;let e=(0,i.join)(c,t.name,s.name,r.name);n.push(...await m(e))}}}return 0===n.length?[]:(await (0,o.batchAll)(n.map(e=>async()=>{let n,i,s=(i=(e.split("/").pop()??"").match(u))?i[0]:null;if(!s)return null;let r=await f(e);if(!r)return null;let{cwd:o}=function(e){try{let t=JSON.parse(e);if("session_meta"!==t.type)return{};let n=t.payload?.cwd;if("string"!=typeof n||0===n.length)return{};return{cwd:n}}catch{return{}}}(r);if(!o)return null;try{let i=await (0,t.open)(e,"r");try{n=(await i.stat()).mtime}finally{await i.close().catch(()=>{})}}catch{n=new Date(0)}return{filePath:e,fileName:e.split("/").pop()??"",cwd:o,sessionId:s,fileMtime:n}}),16)).filter(e=>"fulfilled"===e.status).map(e=>e.value).filter(e=>null!==e)}let y=(0,r.runtimeCache)(p,30);async function h(){let e;try{e=await y()}catch(e){return(0,l.logWarn)("Failed to scan Codex sessions:",e),[]}let t=new Map;for(let n of e){let e=t.get(n.cwd);(!e||n.fileMtime.getTime()>e.latest.getTime())&&t.set(n.cwd,{latest:n.fileMtime,cwd:n.cwd})}let n=[];for(let{cwd:e,latest:i}of t.values())n.push({name:(0,s.encodeFolderName)(e),path:e,isDirectory:!0,lastModified:i,lastModifiedFormatted:(0,a.formatDate)(i),cli:["codex"]});return n.sort((e,t)=>t.lastModified.getTime()-e.lastModified.getTime()),n}function g(e){let t=e.map(e=>({name:e.fileName.replace(/\.jsonl$/,""),path:e.filePath,lastModified:e.fileMtime,lastModifiedFormatted:(0,a.formatDate)(e.fileMtime),sessionId:e.sessionId,cli:"codex"}));return t.sort((e,t)=>t.lastModified.getTime()-e.lastModified.getTime()),t}async function w(e){let t;try{t=await y()}catch(e){return(0,l.logWarn)("Failed to scan Codex sessions:",e),[]}return g(t.filter(t=>t.cwd===e))}async function _(e){let t;try{t=await y()}catch(e){return(0,l.logWarn)("Failed to scan Codex sessions:",e),{cwd:null,sessions:[]}}let n=t.filter(t=>(0,s.encodeFolderName)(t.cwd)===e);return{cwd:n[0]?.cwd??null,sessions:g(n)}}let S=(0,r.runtimeCache)(h,30),v=(0,r.runtimeCache)(e=>w(e),30,{maxSize:50}),E=(0,r.runtimeCache)(e=>_(e),30,{maxSize:50});e.s(["getCachedCodexProjects",0,S,"getCachedCodexSessionsByEncodedName",0,E,"getCachedCodexSessionsForCwd",0,v,"getCodexProjects",0,h,"getCodexSessionsByEncodedName",0,_,"getCodexSessionsForCwd",0,w])},57232,e=>{"use strict";var t=e.i(2157),n=e.i(12714),i=e.i(50227),s=e.i(60526),r=e.i(83534),o=e.i(54214),a=e.i(67405);let l=(0,e.i(79857).codexSessionPathsFile)();function c(){try{if(!(0,t.existsSync)(l))return{};return JSON.parse((0,t.readFileSync)(l,"utf-8"))}catch{return{}}}function u(e,n){try{(0,t.mkdirSync)((0,i.dirname)(l),{recursive:!0});let s=c();s[e]=n,(0,t.writeFileSync)(l,JSON.stringify(s),"utf-8")}catch{}}function d(e,n){try{for(let s of(0,t.readdirSync)(e,{withFileTypes:!0}))if(s.isFile()&&s.name.includes(n)&&s.name.endsWith(".jsonl"))return(0,i.join)(e,s.name)}catch{}return null}function f(e){let n=c()[e];if(n&&(0,t.existsSync)(n))return n;let r=(0,i.join)((0,s.homedir)(),".codex","sessions"),o=new Date,a=new Date(o.getTime()-864e5);for(let t of[o,a].map(e=>{let t=String(e.getUTCFullYear()),n=String(e.getUTCMonth()+1).padStart(2,"0"),s=String(e.getUTCDate()).padStart(2,"0");return(0,i.join)(r,t,n,s)})){let n=d(t,e);if(n)return u(e,n),n}try{for(let n of(0,t.readdirSync)(r,{withFileTypes:!0}))if(n.isDirectory()){for(let s of(0,t.readdirSync)((0,i.join)(r,n.name),{withFileTypes:!0}))if(s.isDirectory())for(let o of(0,t.readdirSync)((0,i.join)(r,n.name,s.name),{withFileTypes:!0})){if(!o.isDirectory())continue;let t=d((0,i.join)(r,n.name,s.name,o.name),e);if(t)return u(e,t),t}}}catch{}return null}function m(e,t){return Array.isArray(e)?e.filter(e=>e?.type===t&&"string"==typeof e.text).map(e=>e.text).join("\n"):""}async function p(e,t="session"){let n,i=e.split("\n").filter(e=>""!==e.trim()),s=[],r=[],l=new Map,c=new Map,u=!1;for(let e=0;e<i.length;e++){let d;e>0&&e%200==0&&await new Promise(e=>setImmediate(e));let f=i[e];try{d=JSON.parse(f)}catch{continue}let p={...d,_source:t};r.push(p);let y=d.timestamp;if(!y)continue;let h=new Date(y);if(Number.isNaN(h.getTime()))continue;let g=d.type,w=d.payload??{};if("session_meta"===g){let e=w.cwd;"string"!=typeof e||n||(n=e),s.push({type:"system",...(0,o.baseEntry)(p,y,h,t),raw:p});continue}if("response_item"===g){let e=w.type;if("message"===e){let e=w.role,n=w.content;if("user"===e||"developer"===e){let i=m(n,"input_text");if(!i)continue;let r="developer"===e?`[developer] ${i}`:i;s.push({type:"user",...(0,o.baseEntry)(p,y,h,t),message:{role:"user",content:r}});continue}if("assistant"===e){let e=m(n,"output_text");if(!e)continue;let i=[{type:"text",text:e}];s.push({type:"assistant",...(0,o.baseEntry)(p,y,h,t),message:{role:"assistant",content:i}});continue}s.push({type:"system",...(0,o.baseEntry)(p,y,h,t),raw:p});continue}if("function_call"===e){let e=w.call_id,n=w.name??"function_call",i={type:"tool_use",id:e??`${y}-${n}`,name:n,input:function(e){if(!e)return{};try{return JSON.parse(e)}catch{return{}}}(w.arguments)},r={type:"assistant",...(0,o.baseEntry)(p,y,h,t),message:{role:"assistant",content:[i]}};s.push(r),e&&(l.set(e,i),c.set(e,h.getTime()));continue}if("function_call_output"===e){let e=w.call_id,n=e?l.get(e):void 0;if(n){let t=c.get(e)??h.getTime(),i=Math.max(0,h.getTime()-t);n.result={timestamp:y,timestampFormatted:(0,o.formatTimestamp)(h),content:"string"==typeof w.output?w.output:JSON.stringify(w.output),durationMs:i,durationFormatted:(0,a.formatDuration)(i)};continue}s.push({type:"system",...(0,o.baseEntry)(p,y,h,t),raw:p});continue}s.push({type:"system",...(0,o.baseEntry)(p,y,h,t),raw:p});continue}if("event_msg"===g){let e=w.type;if("task_started"===e){let e=u?"Session Resumed":"Session Started";u=!0,s.push({type:"queue-operation",...(0,o.baseEntry)(p,y,h,t),label:e});continue}if("exec_command_end"===e){let e=w.call_id,n=e?l.get(e):void 0;if(n){let t=w.duration,i=t?(t.secs??0)*1e3+Math.round((t.nanos??0)/1e6):Math.max(0,h.getTime()-(c.get(e)??h.getTime())),s=w.aggregated_output;n.result={timestamp:y,timestampFormatted:(0,o.formatTimestamp)(h),content:"string"==typeof s?s:JSON.stringify(s),durationMs:i,durationFormatted:(0,a.formatDuration)(i)};continue}s.push({type:"system",...(0,o.baseEntry)(p,y,h,t),raw:p});continue}if("user_message"===e||"agent_message"===e)continue;s.push({type:"system",...(0,o.baseEntry)(p,y,h,t),raw:p});continue}s.push({type:"system",...(0,o.baseEntry)(p,y,h,t),raw:p})}return s.length>500&&await new Promise(e=>setImmediate(e)),s.sort((e,t)=>e.timestampMs-t.timestampMs),{entries:s,rawLines:r,cwd:n}}async function y(e){let t=f(e);if(!t)return null;let i=await (0,n.readFile)(t,"utf-8"),{entries:s,rawLines:r,cwd:o}=await p(i,"session");return{entries:s,rawLines:r,cwd:o,filePath:t}}(0,r.runtimeCache)(e=>y(e),60,{maxSize:50}),e.s(["findCodexTranscript",0,f,"getCodexSessionLog",0,y])},55851,e=>{"use strict";var t=e.i(12714),n=e.i(60526),i=e.i(50227),s=e.i(81580),r=e.i(83534),o=e.i(71809),a=e.i(28557),l=e.i(40911);async function c(e){try{return await (0,t.readdir)(e,{withFileTypes:!0})}catch{return null}}async function u(e){try{return(await (0,t.stat)(e)).mtime}catch{return null}}async function d(){let e=(0,i.join)(process.env.COPILOT_HOME||(0,i.join)((0,n.homedir)(),".copilot"),"session-state"),s=await c(e);if(!s)return[];let r=s.filter(e=>e.isDirectory()).map(t=>({sessionId:t.name,workspacePath:(0,i.join)(e,t.name,"workspace.yaml"),eventsPath:(0,i.join)(e,t.name,"events.jsonl")}));return(await (0,o.batchAll)(r.map(e=>async()=>{let n;try{n=await (0,t.readFile)(e.workspacePath,"utf-8")}catch{return null}let i=function(e){let t=e.match(/^cwd\s*:\s*(.+?)\s*$/m);if(t)return t[1].replace(/^['"]|['"]$/g,"")}(n);if(!i)return null;let s=await u(e.eventsPath),r=await u(e.workspacePath),o=null!==s,a=s&&r?new Date(Math.max(s.getTime(),r.getTime())):s??r??new Date(0);return{workspacePath:e.workspacePath,eventsPath:e.eventsPath,sessionId:e.sessionId,cwd:i,fileMtime:a,hasTranscript:o}}),16)).filter(e=>"fulfilled"===e.status).map(e=>e.value).filter(e=>null!==e)}let f=(0,r.runtimeCache)(d,30);async function m(){let e;try{e=await f()}catch(e){return(0,l.logWarn)("Failed to scan Copilot sessions:",e),[]}let t=new Map;for(let n of e){if(!n.hasTranscript)continue;let e=t.get(n.cwd);(!e||n.fileMtime.getTime()>e.latest.getTime())&&t.set(n.cwd,{latest:n.fileMtime,cwd:n.cwd})}let n=[];for(let{cwd:e,latest:i}of t.values())n.push({name:(0,s.encodeFolderName)(e),path:e,isDirectory:!0,lastModified:i,lastModifiedFormatted:(0,a.formatDate)(i),cli:["copilot"]});return n.sort((e,t)=>t.lastModified.getTime()-e.lastModified.getTime()),n}function p(e){let t=e.filter(e=>e.hasTranscript).map(e=>({name:e.sessionId,path:e.eventsPath,lastModified:e.fileMtime,lastModifiedFormatted:(0,a.formatDate)(e.fileMtime),sessionId:e.sessionId,cli:"copilot"}));return t.sort((e,t)=>t.lastModified.getTime()-e.lastModified.getTime()),t}async function y(e){let t;try{t=await f()}catch(e){return(0,l.logWarn)("Failed to scan Copilot sessions:",e),[]}return p(t.filter(t=>t.cwd===e))}async function h(e){let t;try{t=await f()}catch(e){return(0,l.logWarn)("Failed to scan Copilot sessions:",e),{cwd:null,sessions:[]}}let n=t.filter(t=>t.hasTranscript&&(0,s.encodeFolderName)(t.cwd)===e);return{cwd:n[0]?.cwd??null,sessions:p(n)}}let g=(0,r.runtimeCache)(m,30),w=(0,r.runtimeCache)(e=>y(e),30,{maxSize:50}),_=(0,r.runtimeCache)(e=>h(e),30,{maxSize:50});e.s(["getCachedCopilotProjects",0,g,"getCachedCopilotSessionsByEncodedName",0,_,"getCachedCopilotSessionsForCwd",0,w,"getCopilotProjects",0,m,"getCopilotSessionsByEncodedName",0,h,"getCopilotSessionsForCwd",0,y])},78166,e=>{"use strict";var t=e.i(2157),n=e.i(12714),i=e.i(50227),s=e.i(60526),r=e.i(83534),o=e.i(54214),a=e.i(67405);function l(e,t){let n=function(e){if(!e)return null;let t=(0,i.resolve)((0,i.join)(process.env.COPILOT_HOME||(0,i.join)((0,s.homedir)(),".copilot"),"session-state")),n=(0,i.resolve)(t,e);return n!==t&&n.startsWith(`${t}${i.sep}`)?n:null}(e);return n?(0,i.join)(n,t):null}function c(e){let n=l(e,"events.jsonl");return n&&(0,t.existsSync)(n)?n:null}async function u(e,t="session"){let n,i=e.split("\n").filter(e=>""!==e.trim()),s=[],r=[],l=new Map,c=new Map,d=!1;for(let e=0;e<i.length;e++){let u;e>0&&e%200==0&&await new Promise(e=>setImmediate(e));let f=i[e];try{u=JSON.parse(f)}catch{continue}let m={...u,_source:t};r.push(m);let p=u.timestamp;if(!p)continue;let y=new Date(p);if(Number.isNaN(y.getTime()))continue;let h=y.toISOString(),g=u.type,w=u.data??{};if("session.start"===g){let e=w.context,i=e?.cwd;"string"!=typeof i||n||(n=i);let r=d?"Session Resumed":"Session Started";d=!0,s.push({type:"queue-operation",...(0,o.baseEntry)(m,h,y,t),label:r});continue}if("user.message"===g){let e=w.content??"";if(!e)continue;s.push({type:"user",...(0,o.baseEntry)(m,h,y,t),message:{role:"user",content:e}});continue}if("system.message"===g){s.push({type:"system",...(0,o.baseEntry)(m,h,y,t),raw:m});continue}if("assistant.message"===g){let e=w.content??"";if(!e){s.push({type:"system",...(0,o.baseEntry)(m,h,y,t),raw:m});continue}let n=[{type:"text",text:e}];s.push({type:"assistant",...(0,o.baseEntry)(m,h,y,t),message:{role:"assistant",content:n}});continue}if("tool.execution_start"===g){let e=w.toolCallId,n=w.toolName??"tool",i=w.arguments??{},r={type:"tool_use",id:e??`${y.getTime()}-${n}`,name:n,input:i},a={type:"assistant",...(0,o.baseEntry)(m,h,y,t),message:{role:"assistant",content:[r]}};s.push(a),e&&(l.set(e,r),c.set(e,y.getTime()));continue}if("tool.execution_complete"===g){let e=w.toolCallId,n=e?l.get(e):void 0;if(n){let t=c.get(e)??y.getTime(),i=w.result??{},s=w.toolTelemetry??{},r=s.metrics?.commandTimeMs??s.metrics?.durationMs??null,l="number"==typeof r&&r>=0?r:Math.max(0,y.getTime()-t),u=i.detailedContent??i.content??"";n.result={timestamp:h,timestampFormatted:(0,o.formatTimestamp)(y),content:"string"==typeof u?u:JSON.stringify(u),durationMs:l,durationFormatted:(0,a.formatDuration)(l)};continue}s.push({type:"system",...(0,o.baseEntry)(m,h,y,t),raw:m});continue}s.push({type:"system",...(0,o.baseEntry)(m,h,y,t),raw:m})}return s.length>500&&await new Promise(e=>setImmediate(e)),s.sort((e,t)=>e.timestampMs-t.timestampMs),{entries:s,rawLines:r,cwd:n}}async function d(e){let i,s=c(e);if(!s)return null;try{i=await (0,n.readFile)(s,"utf-8")}catch{return null}let{entries:r,rawLines:o,cwd:a}=await u(i,"session");return{entries:r,rawLines:o,cwd:a??function(e){let n,i=(n=l(e,"workspace.yaml"))&&(0,t.existsSync)(n)?n:null;if(i)try{let e=(0,t.readFileSync)(i,"utf-8"),n=RegExp("^cwd\\s*:\\s*(.+?)\\s*$","m"),s=e.match(n);if(!s)return;return s[1].replace(/^['"]|['"]$/g,"")}catch{return}}(e),filePath:s}}(0,r.runtimeCache)(e=>d(e),60,{maxSize:50}),e.s(["findCopilotTranscript",0,c,"getCopilotSessionLog",0,d])},46413,e=>{"use strict";var t=e.i(12714),n=e.i(60526),i=e.i(50227),s=e.i(81580),r=e.i(83534),o=e.i(71809),a=e.i(28557),l=e.i(40911);let c=["agent-sessions","conversations","sessions"],u=["meta.json","session.json","workspace.json","workspace.yaml"],d=["events.jsonl","transcript.jsonl","messages.jsonl"];async function f(e){try{return await (0,t.readdir)(e,{withFileTypes:!0})}catch{return null}}async function m(e){try{return(await (0,t.stat)(e)).mtime}catch{return null}}async function p(e,n){for(let s of n){let n,r=(0,i.join)(e,s);if(await m(r)===null)continue;try{n=await (0,t.readFile)(r,"utf-8")}catch{continue}let o=function(e){try{let t=JSON.parse(e);if("string"==typeof t.cwd&&t.cwd.length>0)return t.cwd}catch{}let t=e.match(/^\s*cwd\s*:\s*(.+?)\s*$/m);if(t){let e=t[1].replace(/^['"]|['"]$/g,"");if(e.length>0)return e}}(n);if(o)return{path:r,cwd:o}}return null}async function y(e,t){for(let n of t){let t=(0,i.join)(e,n);if(await m(t)!==null)return t}return null}async function h(){let e=process.env.CURSOR_HOME||(0,i.join)((0,n.homedir)(),".cursor"),t=[],r=[],a=(0,i.join)(e,"projects"),l=await f(a);if(l)for(let e of l){if(!e.isDirectory())continue;let n=(0,s.decodeFolderName)(e.name),r=n.startsWith("/")||/^[A-Za-z]:\//.test(n)?n:`/${n}`,o=(0,i.join)(a,e.name,"agent-transcripts"),l=await f(o);if(l)for(let e of l)e.isDirectory()&&t.push({sessionId:e.name,dir:(0,i.join)(o,e.name),cwd:r})}for(let t of c){let n=(0,i.join)(e,t),s=await f(n);if(s)for(let e of s)e.isDirectory()&&r.push({sessionId:e.name,dir:(0,i.join)(n,e.name)})}return 0===t.length&&0===r.length?[]:(await (0,o.batchAll)([...t.map(e=>async()=>{let t=(0,i.join)(e.dir,`${e.sessionId}.jsonl`),n=await m(t);return n?{metaPath:e.dir,transcriptPath:t,sessionId:e.sessionId,cwd:e.cwd,fileMtime:n,hasTranscript:!0}:null}),...r.map(e=>async()=>{let t=await p(e.dir,u);if(!t)return null;let n=await y(e.dir,d),i=n?await m(n):null,s=await m(t.path),r=i&&s?new Date(Math.max(i.getTime(),s.getTime())):i??s??new Date(0);return{metaPath:t.path,transcriptPath:n,sessionId:e.sessionId,cwd:t.cwd,fileMtime:r,hasTranscript:null!==n}})],16)).filter(e=>"fulfilled"===e.status).map(e=>e.value).filter(e=>null!==e)}let g=(0,r.runtimeCache)(h,30);async function w(){let e;try{e=await g()}catch(e){return(0,l.logWarn)("Failed to scan Cursor sessions:",e),[]}let t=new Map;for(let n of e){if(!n.hasTranscript)continue;let e=t.get(n.cwd);(!e||n.fileMtime.getTime()>e.latest.getTime())&&t.set(n.cwd,{latest:n.fileMtime,cwd:n.cwd})}let n=[];for(let{cwd:e,latest:i}of t.values())n.push({name:(0,s.encodeFolderName)(e),path:e,isDirectory:!0,lastModified:i,lastModifiedFormatted:(0,a.formatDate)(i),cli:["cursor"]});return n.sort((e,t)=>t.lastModified.getTime()-e.lastModified.getTime()),n}function _(e){let t=e.filter(e=>e.hasTranscript&&e.transcriptPath).map(e=>({name:e.sessionId,path:e.transcriptPath,lastModified:e.fileMtime,lastModifiedFormatted:(0,a.formatDate)(e.fileMtime),sessionId:e.sessionId,cli:"cursor"}));return t.sort((e,t)=>t.lastModified.getTime()-e.lastModified.getTime()),t}async function S(e){let t;try{t=await g()}catch(e){return(0,l.logWarn)("Failed to scan Cursor sessions:",e),[]}return _(t.filter(t=>t.cwd===e))}async function v(e){let t;try{t=await g()}catch(e){return(0,l.logWarn)("Failed to scan Cursor sessions:",e),{cwd:null,sessions:[]}}let n=t.filter(t=>t.hasTranscript&&(0,s.encodeFolderName)(t.cwd)===e);return{cwd:n[0]?.cwd??null,sessions:_(n)}}let E=(0,r.runtimeCache)(w,30),M=(0,r.runtimeCache)(e=>S(e),30,{maxSize:50}),C=(0,r.runtimeCache)(e=>v(e),30,{maxSize:50});e.s(["getCachedCursorProjects",0,E,"getCachedCursorSessionsByEncodedName",0,C,"getCachedCursorSessionsForCwd",0,M,"getCursorProjects",0,w,"getCursorSessionsByEncodedName",0,v,"getCursorSessionsForCwd",0,S])},72094,e=>{"use strict";var t=e.i(2157),n=e.i(12714),i=e.i(50227),s=e.i(60526),r=e.i(83534),o=e.i(54214),a=e.i(67405);let l=["agent-sessions","conversations","sessions"],c=["events.jsonl","transcript.jsonl","messages.jsonl"],u="agent-transcripts";function d(e){let n=function(e){if(!e)return null;let n=(0,i.resolve)(process.env.CURSOR_HOME||(0,i.join)((0,s.homedir)(),".cursor")),r=(0,i.resolve)(n,"projects"),o=[];try{o=(0,t.readdirSync)(r,{withFileTypes:!0})}catch{}for(let n of o){if(!n.isDirectory())continue;let s=(0,i.resolve)(r,n.name,u,e),o=(0,i.resolve)(r,n.name,u);if(s!==o&&s.startsWith(`${o}${i.sep}`)&&(0,t.existsSync)(s))return s}for(let s of l){let r=(0,i.resolve)(n,s),o=(0,i.resolve)(r,e);if(o!==r&&o.startsWith(`${r}${i.sep}`)&&(0,t.existsSync)(o))return o}return null}(e);if(!n)return null;let r=(0,i.join)(n,`${(0,i.basename)(n)}.jsonl`);if((0,t.existsSync)(r))return r;for(let e of c){let s=(0,i.join)(n,e);if((0,t.existsSync)(s))return s}return null}async function f(e,t="session"){let n,i=e.split("\n").filter(e=>""!==e.trim()),s=[],r=[],l=new Map,c=new Map,u=!1,d=Date.now();for(let e=0;e<i.length;e++){let f;e>0&&e%200==0&&await new Promise(e=>setImmediate(e));let m=i[e];try{f=JSON.parse(m)}catch{continue}let p={...f,_source:t};if(r.push(p),!f.type&&f.role&&f.message?.content){let n=new Date(d+e),i=n.toISOString(),r=f.message.content.filter(e=>e?.type==="text"&&"string"==typeof e.text).map(e=>e.text).join("");if("user"===f.role){let e=/<user_query>\s*([\s\S]*?)\s*<\/user_query>/.exec(r),a=e?e[1]:r;a&&s.push({type:"user",...(0,o.baseEntry)(p,i,n,t),message:{role:"user",content:a}});continue}if("assistant"===f.role){let e=r?[{type:"text",text:r}]:[];0===e.length?s.push({type:"system",...(0,o.baseEntry)(p,i,n,t),raw:p}):s.push({type:"assistant",...(0,o.baseEntry)(p,i,n,t),message:{role:"assistant",content:e}});continue}s.push({type:"system",...(0,o.baseEntry)(p,i,n,t),raw:p});continue}let y=f.timestamp;if(!y)continue;let h=new Date(y);if(Number.isNaN(h.getTime()))continue;let g=h.toISOString(),w=f.type,_=f.data??{};if("session.start"===w||"sessionStart"===w||"session_start"===w){let e=_.context??_,i=e.cwd;"string"!=typeof i||n||(n=i),!n&&Array.isArray(e.workspace_roots)&&"string"==typeof e.workspace_roots[0]&&(n=e.workspace_roots[0]);let r=u?"Session Resumed":"Session Started";u=!0,s.push({type:"queue-operation",...(0,o.baseEntry)(p,g,h,t),label:r});continue}if("user.message"===w||"userMessage"===w){let e="string"==typeof _.content?_.content:"string"==typeof _.text?_.text:"";if(!e)continue;s.push({type:"user",...(0,o.baseEntry)(p,g,h,t),message:{role:"user",content:e}});continue}if("system.message"===w||"systemMessage"===w){s.push({type:"system",...(0,o.baseEntry)(p,g,h,t),raw:p});continue}if("assistant.message"===w||"assistantMessage"===w){let e="string"==typeof _.content?_.content:"string"==typeof _.text?_.text:"";if(!e){s.push({type:"system",...(0,o.baseEntry)(p,g,h,t),raw:p});continue}let n=[{type:"text",text:e}];s.push({type:"assistant",...(0,o.baseEntry)(p,g,h,t),message:{role:"assistant",content:n}});continue}if("tool.execution_start"===w||"tool.executionStart"===w||"preToolUse"===w){let e=_.toolCallId??_.tool_use_id,n=_.toolName??_.tool_name??"tool",i=_.arguments??_.tool_input??{},r={type:"tool_use",id:e??`${h.getTime()}-${n}`,name:n,input:i},a={type:"assistant",...(0,o.baseEntry)(p,g,h,t),message:{role:"assistant",content:[r]}};s.push(a),e&&(l.set(e,r),c.set(e,h.getTime()));continue}if("tool.execution_complete"===w||"tool.executionComplete"===w||"postToolUse"===w){let e=_.toolCallId??_.tool_use_id,n=e?l.get(e):void 0;if(n){let t=c.get(e)??h.getTime(),i=_.result??{},s=_.duration,r="number"==typeof s&&s>=0?s:Math.max(0,h.getTime()-t),l=i.detailedContent??i.content??_.tool_output??"";n.result={timestamp:g,timestampFormatted:(0,o.formatTimestamp)(h),content:"string"==typeof l?l:JSON.stringify(l),durationMs:r,durationFormatted:(0,a.formatDuration)(r)};continue}s.push({type:"system",...(0,o.baseEntry)(p,g,h,t),raw:p});continue}s.push({type:"system",...(0,o.baseEntry)(p,g,h,t),raw:p})}return s.length>500&&await new Promise(e=>setImmediate(e)),s.sort((e,t)=>e.timestampMs-t.timestampMs),{entries:s,rawLines:r,cwd:n}}async function m(e){let t,i=d(e);if(!i)return null;try{t=await (0,n.readFile)(i,"utf-8")}catch{return null}let{entries:s,rawLines:r,cwd:o}=await f(t,"session");return{entries:s,rawLines:r,cwd:o,filePath:i}}(0,r.runtimeCache)(e=>m(e),60,{maxSize:50}),e.s(["findCursorTranscript",0,d,"getCursorSessionLog",0,m])},79364,e=>{"use strict";var t=e.i(79708),n=e.i(40375),i=e.i(81580),s=e.i(83534),r=e.i(28557);async function o(){let e=await (0,t.openSqliteReadonly)((0,n.devinDbPath)());if(!e)return[];try{return e.query("SELECT id, working_directory, title, created_at, last_activity_at, hidden FROM sessions ORDER BY last_activity_at DESC").filter(e=>!e.hidden).map(e=>{let t=e.working_directory??void 0;return{sessionId:e.id,cwd:t,title:e.title??void 0,projectName:t?(0,i.encodeFolderName)(t):"devin",mtimeMs:(0,n.devinEpochToMs)(e.last_activity_at??e.created_at)}})}catch{return[]}finally{e.close()}}let a=(0,s.runtimeCache)(o,2);async function l(){let e=await o(),t=new Map;for(let n of e){if(!n.cwd)continue;let e=t.get(n.projectName);(!e||n.mtimeMs>e.latest)&&t.set(n.projectName,{latest:n.mtimeMs,cwd:n.cwd,name:n.projectName})}let n=[];for(let{name:e,cwd:i,latest:s}of t.values()){let t=new Date(s);n.push({name:e,path:i,isDirectory:!0,lastModified:t,lastModifiedFormatted:(0,r.formatDate)(t),cli:["devin"]})}return n.sort((e,t)=>t.lastModified.getTime()-e.lastModified.getTime()),n}async function c(e){let t=(await o()).filter(t=>t.cwd&&t.projectName===e);if(0===t.length)return{cwd:null,sessions:[]};let n=[...t].sort((e,t)=>t.mtimeMs-e.mtimeMs);return{cwd:n[0].cwd??null,sessions:n.map(e=>{let t=new Date(e.mtimeMs);return{name:e.title??e.sessionId,path:`devin-db://${e.sessionId}`,lastModified:t,lastModifiedFormatted:(0,r.formatDate)(t),sessionId:e.sessionId,cli:"devin"}})}}let u=(0,s.runtimeCache)(l,2),d=(0,s.runtimeCache)(e=>c(e),2,{maxSize:50});e.s(["getCachedDevinProjects",0,u,"getCachedDevinSessions",0,a,"getCachedDevinSessionsByEncodedName",0,d,"getDevinProjects",0,l,"getDevinSessions",0,o,"getDevinSessionsByEncodedName",0,c])},40375,e=>{"use strict";var t=e.i(60526),n=e.i(50227),i=e.i(79708),s=e.i(83534),r=e.i(54214),o=e.i(67405);let a=/^[A-Za-z0-9_-]+$/;function l(){return process.env.DEVIN_DB_PATH||(0,n.join)(process.env.DEVIN_HOME||(0,n.join)((0,t.homedir)(),".local","share","devin"),"cli","sessions.db")}function c(e){if("string"==typeof e&&0!==e.length)try{return JSON.parse(e)}catch{return}}function u(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function d(e){return"string"==typeof e?e:Array.isArray(e)?e.map(e=>u(e)&&"string"==typeof e.text?e.text:"").filter(Boolean).join("\n"):""}function f(e,t){if("number"==typeof e&&Number.isFinite(e)){if(e>1e12)return new Date(e);if(e>1e9)return new Date(1e3*e)}if("string"==typeof e){let t=Date.parse(e);if(!Number.isNaN(t))return new Date(t)}return new Date(t)}async function m(e){if(!e||!a.test(e))return null;let t=await (0,i.openSqliteReadonly)(l());if(!t)return null;try{let n=t.query("SELECT working_directory FROM sessions WHERE id = ?",[e]);if(0===n.length)return null;let i=n[0].working_directory,s=t.query("SELECT node_id, parent_node_id, chat_message, created_at FROM message_nodes WHERE session_id = ? ORDER BY node_id ASC",[e]),a=function(e){let t=[];for(let n of e){let e=c(n.chat_message);u(e)&&(null!=n.created_at&&null==e._created_at&&(e._created_at=n.created_at),t.push(e))}return t}(function(e){if(0===e.length)return e;let t=new Map;for(let n of e)"number"==typeof n.node_id&&t.set(n.node_id,n);let n=e.reduce((e,t)=>(e.node_id??-1)>(t.node_id??-1)?e:t),i=[],s=new Set;for(;n&&"number"==typeof n.node_id&&!s.has(n.node_id);)s.add(n.node_id),i.push(n),n=null!=n.parent_node_id?t.get(n.parent_node_id):void 0;return i.reverse()}(s)),l=function(e,t="session"){let n=[],i=new Map,s=new Map,a=Date.now();for(let l=0;l<e.length;l++){let m=e[l];if(!u(m))continue;let p="string"==typeof m.role?m.role:"system",y=function(e,t){let n=u(e.metadata)?e.metadata:void 0;return n&&null!=n.created_at?f(n.created_at,t):null!=e._created_at?f(e._created_at,t):new Date(t)}(m,a+l),h=y.toISOString(),g={uuid:null!=m.message_id?String(m.message_id):`devin-${l}`,parentUuid:null},w=(0,r.baseEntry)(g,h,y,t);if("user"===p){n.push({type:"user",...w,message:{role:"user",content:d(m.content)}});continue}if("assistant"===p){let e=[],t=d(m.content);for(let n of(t&&e.push({type:"text",text:t}),function(e){let t=Array.isArray(e)?e:c(e);if(!Array.isArray(t))return[];let n=[];for(let e of t){if(!u(e))continue;let t=u(e.function)?e.function:{},i="string"==typeof e.name?e.name:"string"==typeof t.name?t.name:"tool",s="string"==typeof e.id&&e.id||"string"==typeof e.call_id&&e.call_id||`${i}-${n.length}`,r=e.arguments??t.arguments,o=u(r)?r:c(r);n.push({id:s,name:i,input:u(o)?o:{}})}return n}(m.tool_calls))){let t={type:"tool_use",id:n.id,name:n.name,input:n.input};e.push(t),i.set(n.id,t),s.set(n.id,y.getTime())}if(0===e.length)continue;n.push({type:"assistant",...w,message:{role:"assistant",content:e,model:"string"==typeof m.model?m.model:void 0}});continue}if("tool"===p){let e="string"==typeof m.tool_call_id?m.tool_call_id:void 0,t=e?i.get(e):void 0;if(t){let n=e&&s.get(e)||y.getTime(),i=Math.max(0,y.getTime()-n);t.result={timestamp:h,timestampFormatted:(0,r.formatTimestamp)(y),content:d(m.content),durationMs:i,durationFormatted:(0,o.formatDuration)(i)};continue}}n.push({type:"system",...w,raw:g})}return n.sort((e,t)=>e.timestampMs-t.timestampMs),n}(a,"session"),m=i&&i.length>0?i:void 0;return{entries:l,rawLines:a,cwd:m,filePath:`devin-db://${e}`}}catch{return null}finally{t.close()}}(0,s.runtimeCache)(e=>m(e),2,{maxSize:50}),e.s(["devinDbPath",0,l,"devinEpochToMs",0,function(e){if("number"==typeof e&&Number.isFinite(e)){if(e>1e12)return e;if(e>1e9)return 1e3*e}return Date.now()},"getDevinSessionLog",0,m])},28246,e=>{"use strict";var t=e.i(12714),n=e.i(2157),i=e.i(60526),s=e.i(50227),r=e.i(81580),o=e.i(83534),a=e.i(54214),l=e.i(67405);let c=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;function u(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function d(e){return"string"==typeof e?e:Array.isArray(e)?e.map(e=>u(e)&&"string"==typeof e.text?e.text:"").filter(Boolean).join("\n"):""}function f(e,t="session"){let n=[],i=new Map,s=new Map,r=Date.now();for(let o=0;o<e.length;o++){let c=e[o];if(!u(c)||"message"!==c.type)continue;let f=u(c.message)?c.message:void 0;if(!f)continue;let m="string"==typeof f.role?f.role:"system",p=function(e,t){if("number"==typeof e&&Number.isFinite(e)){if(e>1e12)return new Date(e);if(e>1e9)return new Date(1e3*e)}if("string"==typeof e){let t=Date.parse(e);if(!Number.isNaN(t))return new Date(t)}return new Date(t)}(c.timestamp??f.timestamp,r+o),y=p.toISOString(),h={uuid:null!=c.id?String(c.id):`factory-${o}`,parentUuid:null!=c.parentId?String(c.parentId):null},g=(0,a.baseEntry)(h,y,p,t),w=f.content;if("assistant"===m){let e=[];if(Array.isArray(w)){for(let t of w)if(u(t)){if("text"===t.type&&"string"==typeof t.text)e.push({type:"text",text:t.text});else if("tool_use"===t.type){let n="string"==typeof t.id?t.id:`${String(t.name??"tool")}-${e.length}`,r={type:"tool_use",id:n,name:"string"==typeof t.name?t.name:"tool",input:u(t.input)?t.input:{}};e.push(r),i.set(n,r),s.set(n,p.getTime())}}}else{let t=d(w);t&&e.push({type:"text",text:t})}if(0===e.length)continue;n.push({type:"assistant",...g,message:{role:"assistant",content:e,model:"string"==typeof f.model?f.model:void 0}});continue}if(Array.isArray(w)){let e=!1,t=[];for(let n of w)if(u(n)){if("tool_result"===n.type){let t="string"==typeof n.tool_use_id?n.tool_use_id:"string"==typeof n.toolUseId?n.toolUseId:void 0,r=t?i.get(t):void 0;if(r){let i=t&&s.get(t)||p.getTime(),o=Math.max(0,p.getTime()-i);r.result={timestamp:y,timestampFormatted:(0,a.formatTimestamp)(p),content:d(n.content),durationMs:o,durationFormatted:(0,l.formatDuration)(o)},e=!0;continue}}"text"===n.type&&"string"==typeof n.text&&t.push(n.text)}t.length>0?n.push({type:"user",...g,message:{role:"user",content:t.join("\n")}}):e||n.push({type:"system",...g,raw:h});continue}if("user"===m){n.push({type:"user",...g,message:{role:"user",content:d(w)}});continue}n.push({type:"system",...g,raw:h})}return n.sort((e,t)=>e.timestampMs-t.timestampMs),n}function m(){let e,t=(0,s.join)(process.env.FACTORY_HOME||(0,s.join)((0,i.homedir)(),".factory"),"sessions"),o=[];try{e=(0,n.readdirSync)(t,{withFileTypes:!0}).filter(e=>e.isDirectory())}catch{return o}for(let i of e){let e,a=i.name,l=(0,r.decodeFolderName)(a),u=(0,s.join)(t,a);try{e=(0,n.readdirSync)(u)}catch{continue}for(let t of e){if(!t.endsWith(".jsonl"))continue;let e=t.slice(0,-6);if(!c.test(e))continue;let i=(0,s.join)(u,t);try{let t=(0,n.statSync)(i);o.push({projectName:a,cwd:l,sessionId:e,transcriptPath:i,mtimeMs:t.mtimeMs,sizeBytes:t.size})}catch{}}}return o}function p(e){if(!c.test(e))return null;for(let t of m())if(t.sessionId===e)return t.transcriptPath;return null}async function y(e){let n,i,s=p(e);if(!s)return null;try{n=await (0,t.readFile)(s,"utf-8")}catch{return null}let r=(0,a.parseRawLines)(n,"session"),o=f(r,"session");for(let e of r)if(u(e)&&"session_start"===e.type&&"string"==typeof e.cwd&&e.cwd.length>0){i=e.cwd;break}return{entries:o,rawLines:r,cwd:i,filePath:s}}(0,o.runtimeCache)(e=>y(e),60,{maxSize:50}),e.s(["factoryLinesToLogEntries",0,f,"findFactoryTranscript",0,p,"getFactorySessionLog",0,y,"listFactoryTranscripts",0,m])},69164,e=>{"use strict";var t=e.i(79708),n=e.i(36618),i=e.i(81580),s=e.i(83534),r=e.i(28557);async function o(){let e=await (0,t.openSqliteReadonly)((0,n.gooseDbPath)());if(!e)return[];try{return e.query("SELECT id, working_dir, description, name, session_type, created_at, updated_at FROM sessions ORDER BY updated_at DESC").filter(e=>"hidden"!==e.session_type).map(e=>{let t=e.working_dir??void 0,s=(e.description&&e.description.length>0?e.description:e.name)??void 0;return{sessionId:e.id,cwd:t,title:s&&s.length>0?s:void 0,projectName:t?(0,i.encodeFolderName)(t):"goose",mtimeMs:(0,n.gooseTimestampToMs)(e.updated_at??e.created_at)}})}catch{return[]}finally{e.close()}}let a=(0,s.runtimeCache)(o,2);async function l(){let e=await o(),t=new Map;for(let n of e){if(!n.cwd)continue;let e=t.get(n.projectName);(!e||n.mtimeMs>e.latest)&&t.set(n.projectName,{latest:n.mtimeMs,cwd:n.cwd,name:n.projectName})}let n=[];for(let{name:e,cwd:i,latest:s}of t.values()){let t=new Date(s);n.push({name:e,path:i,isDirectory:!0,lastModified:t,lastModifiedFormatted:(0,r.formatDate)(t),cli:["goose"]})}return n.sort((e,t)=>t.lastModified.getTime()-e.lastModified.getTime()),n}async function c(e){let t=(await o()).filter(t=>t.cwd&&t.projectName===e);if(0===t.length)return{cwd:null,sessions:[]};let n=[...t].sort((e,t)=>t.mtimeMs-e.mtimeMs);return{cwd:n[0].cwd??null,sessions:n.map(e=>{let t=new Date(e.mtimeMs);return{name:e.title??e.sessionId,path:`goose-db://${e.sessionId}`,lastModified:t,lastModifiedFormatted:(0,r.formatDate)(t),sessionId:e.sessionId,cli:"goose"}})}}let u=(0,s.runtimeCache)(l,2),d=(0,s.runtimeCache)(e=>c(e),2,{maxSize:50});e.s(["getCachedGooseProjects",0,u,"getCachedGooseSessions",0,a,"getCachedGooseSessionsByEncodedName",0,d,"getGooseProjects",0,l,"getGooseSessions",0,o,"getGooseSessionsByEncodedName",0,c])},36618,e=>{"use strict";var t=e.i(60526),n=e.i(50227),i=e.i(79708),s=e.i(83534),r=e.i(54214),o=e.i(67405);let a=/^\d{8}_\d+$/;function l(){return process.env.GOOSE_DB_PATH||(0,n.join)(function(){if(process.env.GOOSE_HOME)return process.env.GOOSE_HOME;let e=process.env.XDG_DATA_HOME;return(0,n.join)(e&&e.length>0?e:(0,n.join)((0,t.homedir)(),".local","share"),"goose")}(),"sessions","sessions.db")}function c(e){if("number"==typeof e&&Number.isFinite(e)){if(e>1e12)return e;if(e>1e9)return 1e3*e}if("string"==typeof e&&e.length>0){let t=Date.parse(/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(e)?e.replace(" ","T")+"Z":e);if(!Number.isNaN(t))return t}return Date.now()}function u(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function d(e){return"string"==typeof e?e:Array.isArray(e)?e.map(e=>u(e)&&"string"==typeof e.text?e.text:"").filter(Boolean).join("\n"):""}async function f(e){if(!e||!a.test(e))return null;let t=await (0,i.openSqliteReadonly)(l());if(!t)return null;try{let n=t.query("SELECT working_dir FROM sessions WHERE id = ?",[e]);if(0===n.length)return null;let i=n[0].working_dir,s=t.query("SELECT role, content_json, created_timestamp FROM messages WHERE session_id = ? ORDER BY id ASC",[e]),a=function(e,t="session"){let n=[],i=new Map,s=new Map,a=Date.now();for(let l=0;l<e.length;l++){let f=e[l],m=function(e){if("string"==typeof e&&0!==e.length)try{return JSON.parse(e)}catch{return}}(f.content_json);if(!Array.isArray(m))continue;let p="string"==typeof f.role?f.role:"system",y=function(e,t){let n="number"==typeof e||"string"==typeof e?c(e):NaN;return new Date(Number.isNaN(n)?t:n)}(f.created_timestamp,a+l),h=y.toISOString(),g={uuid:`goose-${l}`,parentUuid:null},w=(0,r.baseEntry)(g,h,y,t),_=[],S=[],v=[];for(let e of m)u(e)&&("text"===e.type&&"string"==typeof e.text?_.push(e.text):"toolRequest"===e.type?S.push(e):"toolResponse"===e.type&&v.push(e));for(let e of v){let t="string"==typeof e.id?e.id:void 0,n=t?i.get(t):void 0;if(!n)continue;let a=t&&s.get(t)||y.getTime(),l=Math.max(0,y.getTime()-a);n.result={timestamp:h,timestampFormatted:(0,r.formatTimestamp)(y),content:function(e){let t=(u(e.toolResult)?e.toolResult:{}).value;return u(t)&&Array.isArray(t.content)?d(t.content):"string"==typeof t?t:Array.isArray(t)?d(t):""}(e),durationMs:l,durationFormatted:(0,o.formatDuration)(l)}}let E=_.join("\n").trim();if(S.length>0||"assistant"===p&&E){let e=[];for(let t of(E&&e.push({type:"text",text:E}),S)){let{id:n,name:r,input:o}=function(e,t){let n="string"==typeof e.id&&e.id?e.id:`goose-tool-${t}`,i=u(e.toolCall)?e.toolCall:{},s=u(i.value)?i.value:{},r="string"==typeof s.name?s.name:"tool";return{id:n,name:r,input:u(s.arguments)?s.arguments:{}}}(t,e.length),a={type:"tool_use",id:n,name:r,input:o};e.push(a),i.set(n,a),s.set(n,y.getTime())}if(0===e.length)continue;n.push({type:"assistant",...w,message:{role:"assistant",content:e}});continue}if("user"===p&&E){n.push({type:"user",...w,message:{role:"user",content:E}});continue}E&&n.push({type:"system",...w,raw:g})}return n.sort((e,t)=>e.timestampMs-t.timestampMs),n}(s,"session"),l=i&&i.length>0?i:void 0;return{entries:a,rawLines:s,cwd:l,filePath:`goose-db://${e}`}}catch{return null}finally{t.close()}}(0,s.runtimeCache)(e=>f(e),2,{maxSize:50}),e.s(["getGooseSessionLog",0,f,"gooseDbPath",0,l,"gooseTimestampToMs",0,c])},28898,e=>{"use strict";var t=e.i(2157),n=e.i(60526),i=e.i(50227);let s="profiles",r=".hermes",o=".hermes-",a="default";function l(){let e=(process.env.HERMES_HOME||"").trim();if(e){let t=(0,i.resolve)(e),n=(0,i.dirname)(t);(0,i.basename)(n)===s&&(t=(0,i.dirname)(n));let a=(0,i.basename)(t);return a===r||a.startsWith(o)?(0,i.join)((0,i.dirname)(t),r):t}return(0,i.join)((0,n.homedir)(),r)}function c(){let e=l(),n=[{name:a,home:e}],c=new Set([a]),u=[];try{u=(0,t.readdirSync)((0,i.join)(e,s),{withFileTypes:!0}).filter(e=>(e.isDirectory()||e.isSymbolicLink())&&!e.name.startsWith(".")).map(e=>e.name).sort()}catch{}for(let t of u)c.has(t)||(c.add(t),n.push({name:t,home:(0,i.join)(e,s,t)}));if((0,i.basename)(e)!==r)return n;let d=[],f=(0,i.dirname)(e);try{d=(0,t.readdirSync)(f,{withFileTypes:!0}).filter(e=>(e.isDirectory()||e.isSymbolicLink())&&e.name.startsWith(o)&&e.name.length>o.length&&(0,t.existsSync)((0,i.join)(f,e.name,"config.yaml"))).map(e=>({name:e.name.slice(o.length),home:(0,i.join)(f,e.name)})).sort((e,t)=>e.name.localeCompare(t.name))}catch{return n}for(let e of d){let t=function(e,t){if(!t.has(e))return e;let n=`${e}-home`;if(!t.has(n))return n;let i=2;for(;t.has(`${n}-${i}`);)i+=1;return`${n}-${i}`}(e.name,c);c.add(t),n.push({name:t,home:e.home})}return n}e.s(["HERMES_DEFAULT_PROFILE",0,a,"hermesProjectName",0,function(e,t){return`hermes-${e}-${t}`},"hermesProjectNameCandidates",0,function(e){if(!e.startsWith("hermes-"))return[];let t=e.slice(7);if(!t)return[];let n=[];for(let e of c().map(e=>e.name).sort((e,t)=>t.length-e.length)){let i=`${e}-`;t.startsWith(i)&&t.length>i.length&&n.push({profile:e,source:t.slice(i.length)})}return n.push({profile:a,source:t}),n},"hermesProjectPath",0,function(e,t){return`hermes:${e}:${t}`},"hermesRoot",0,l,"listHermesProfiles",0,c])},64828,e=>{"use strict";var t=e.i(79708),n=e.i(3605),i=e.i(28898),s=e.i(83534),r=e.i(28557);async function o(){let e=[];for(let{profile:t,dbPath:i}of(0,n.hermesDbPaths)())e.push(...await a(i,t));return e.sort((e,t)=>t.mtimeMs-e.mtimeMs),e}async function a(e,i){let s=await (0,t.openSqliteReadonly)(e);if(!s)return[];try{return s.query("SELECT s.id, s.source, s.cwd, s.title, s.user_id, s.chat_id, s.chat_type, s.started_at, s.ended_at, s.message_count, lm.last_activity FROM sessions s LEFT JOIN (SELECT session_id, MAX(timestamp) AS last_activity FROM messages GROUP BY session_id) lm ON lm.session_id = s.id ORDER BY lm.last_activity DESC").map(e=>({sessionId:e.id,profile:i,source:e.source??void 0,cwd:e.cwd??void 0,title:e.title??void 0,userId:e.user_id??void 0,chatId:e.chat_id??void 0,chatType:e.chat_type??void 0,mtimeMs:(0,n.epochToMs)(e.last_activity??e.ended_at??e.started_at),messageCount:"number"==typeof e.message_count?e.message_count:0,hasMessages:null!=e.last_activity}))}catch{return[]}finally{s.close()}}let l=(0,s.runtimeCache)(o,2);async function c(){let e=await o(),t=new Map;for(let n of e){if(n.messageCount<=0&&!n.hasMessages)continue;let e=n.profile||i.HERMES_DEFAULT_PROFILE,s=n.source??"unknown",r=JSON.stringify([e,s]),o=t.get(r);o?(o.latest=Math.max(o.latest,n.mtimeMs),o.count+=1):t.set(r,{profile:e,source:s,latest:n.mtimeMs,count:1})}let n=[];for(let{profile:e,source:s,latest:o,count:a}of t.values()){let t=new Date(o);n.push({name:(0,i.hermesProjectName)(e,s),path:(0,i.hermesProjectPath)(e,s),isDirectory:!0,lastModified:t,lastModifiedFormatted:(0,r.formatDate)(t),cli:["hermes"],sessionCount:a})}return n.sort((e,t)=>t.lastModified.getTime()-e.lastModified.getTime()),n}async function u(e){let t=(0,i.hermesProjectNameCandidates)(e);if(0===t.length)return{cwd:null,sessions:[]};let n=await o(),s=e=>n.filter(t=>(t.messageCount>0||t.hasMessages)&&(t.profile||i.HERMES_DEFAULT_PROFILE)===e.profile&&(t.source??"unknown")===e.source),a=t[0],l=s(a);if(0===l.length)for(let e of t.slice(1)){let t=s(e);if(t.length>0){a=e,l=t;break}}let{profile:c,source:u}=a;return{cwd:(0,i.hermesProjectPath)(c,u),sessions:l.map(e=>{let t=new Date(e.mtimeMs);return{name:e.title??e.sessionId,path:`hermes://${e.sessionId}`,lastModified:t,lastModifiedFormatted:(0,r.formatDate)(t),sessionId:e.sessionId,cli:"hermes",userId:e.userId,channelId:e.chatId,channelType:e.chatType}})}}let d=(0,s.runtimeCache)(c,2),f=(0,s.runtimeCache)(e=>u(e),2,{maxSize:50});e.s(["getCachedHermesProjects",0,d,"getCachedHermesSessions",0,l,"getCachedHermesSessionsByEncodedName",0,f,"getHermesProjects",0,c,"getHermesSessions",0,o,"getHermesSessionsByEncodedName",0,u])},3605,e=>{"use strict";var t=e.i(50227),n=e.i(79708),i=e.i(28898),s=e.i(83534),r=e.i(54214),o=e.i(67405);function a(){let e=process.env.HERMES_DB_PATH;return e?[{profile:i.HERMES_DEFAULT_PROFILE,dbPath:e}]:(0,i.listHermesProfiles)().map(e=>({profile:e.name,dbPath:(0,t.join)(e.home,"state.db")}))}function l(e){if("string"==typeof e&&0!==e.length)try{return JSON.parse(e)}catch{return}}function c(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function u(e){return"string"==typeof e?e:Array.isArray(e)?e.map(e=>c(e)&&"string"==typeof e.text?e.text:"").filter(Boolean).join("\n"):""}async function d(e){if(!e||!/^[A-Za-z0-9_-]+$/.test(e))return null;for(let{profile:t,dbPath:n}of a()){let i=await f(n,t,e);if(i)return i}return null}async function f(e,t,s){let a=await (0,n.openSqliteReadonly)(e);if(!a)return null;try{let e=a.query("SELECT source, cwd FROM sessions WHERE id = ?",[s]);if(0===e.length)return null;let{source:n,cwd:d}=e[0],f=a.query("SELECT id, role, content, tool_call_id, tool_calls, tool_name, timestamp FROM messages WHERE session_id = ? ORDER BY timestamp ASC",[s]),m=function(e,t="session"){let n=[],i=new Map,s=new Map,a=Date.now();for(let d=0;d<e.length;d++){let f=e[d];if(!c(f))continue;let m="string"==typeof f.role?f.role:"system",p=function(e,t){if("number"==typeof e&&Number.isFinite(e)){if(e>1e12)return new Date(e);if(e>1e9)return new Date(1e3*e)}if("string"==typeof e){let t=Date.parse(e);if(!Number.isNaN(t))return new Date(t)}return new Date(t)}(f.timestamp??f.time_created,a+d),y=p.toISOString(),h={uuid:null!=f.id?String(f.id):`hermes-${d}`,parentUuid:null},g=(0,r.baseEntry)(h,y,p,t);if("user"===m){n.push({type:"user",...g,message:{role:"user",content:u(f.content)}});continue}if("assistant"===m){let e=[],t=u(f.content);for(let n of(t&&e.push({type:"text",text:t}),function(e){let t=Array.isArray(e)?e:l(e);if(!Array.isArray(t))return[];let n=[];for(let e of t){if(!c(e))continue;let t=c(e.function)?e.function:{},i="string"==typeof t.name?t.name:"string"==typeof e.name?e.name:"tool",s="string"==typeof e.id&&e.id||"string"==typeof e.call_id&&e.call_id||`${i}-${n.length}`,r=c(t.arguments)?t.arguments:l(t.arguments);n.push({id:s,name:i,input:c(r)?r:{}})}return n}(f.tool_calls))){let t={type:"tool_use",id:n.id,name:n.name,input:n.input};e.push(t),i.set(n.id,t),s.set(n.id,p.getTime())}if(0===e.length)continue;n.push({type:"assistant",...g,message:{role:"assistant",content:e}});continue}if("tool"===m){let e="string"==typeof f.tool_call_id?f.tool_call_id:void 0,t=e?i.get(e):void 0;if(t){let n=e&&s.get(e)||p.getTime(),i=Math.max(0,p.getTime()-n);t.result={timestamp:y,timestampFormatted:(0,r.formatTimestamp)(p),content:u(f.content),durationMs:i,durationFormatted:(0,o.formatDuration)(i)};continue}}n.push({type:"system",...g,raw:h})}return n.sort((e,t)=>e.timestampMs-t.timestampMs),n}(f,"session"),p=d&&d.length>0?d:n?(0,i.hermesProjectPath)(t,n):void 0;return{entries:m,rawLines:f,cwd:p,filePath:`hermes://${s}`,profile:t}}catch{return null}finally{a.close()}}(0,s.runtimeCache)(e=>d(e),2,{maxSize:50}),e.s(["epochToMs",0,function(e){if("number"==typeof e&&Number.isFinite(e)){if(e>1e12)return e;if(e>1e9)return 1e3*e}return Date.now()},"getHermesSessionLog",0,d,"hermesDbPaths",0,a])},96878,e=>{"use strict";var t=e.i(2157),n=e.i(50227),i=e.i(79708);function s(e){return"string"==typeof e&&e.length>0?e:void 0}function r(e){try{let t=JSON.parse(e);return t&&"object"==typeof t&&!Array.isArray(t)?t:void 0}catch{return}}function o(e,t){return`openclaw-sqlite://${encodeURIComponent(e)}/${t}`}function a(e,i){let s=[];for(let r of i){let i=(0,n.join)(e,"agents",r,"agent","openclaw-agent.sqlite");(0,t.existsSync)(i)&&s.push({agentId:r,dbPath:i})}return s}async function l(e,t){let n=[];for(let{agentId:l,dbPath:c}of a(e,t)){let e=await (0,i.openSqliteReadonly)(c);if(e)try{let t;try{t=e.query(`SELECT w.session_id, w.session_key, w.updated_at,
|
|
2
|
-
w.transcript_updated_at, w.ended_at, w.channel,
|
|
3
|
-
w.chat_type, w.display_name,
|
|
4
|
-
COALESCE((SELECT MAX(e.created_at)
|
|
5
|
-
FROM transcript_events e
|
|
6
|
-
WHERE e.session_id = w.session_id), 0) AS event_updated_at,
|
|
7
|
-
COALESCE((SELECT SUM(length(e.event_json) + 1)
|
|
8
|
-
FROM transcript_events e
|
|
9
|
-
WHERE e.session_id = w.session_id), 0) AS size_bytes
|
|
10
|
-
FROM session_windows w
|
|
11
|
-
WHERE EXISTS (SELECT 1 FROM transcript_events e
|
|
12
|
-
WHERE e.session_id = w.session_id)`)}catch{continue}let i=function(e){let t,n=new Map;try{t=e.query(`SELECT current_session_id, entry_json, label, display_name
|
|
13
|
-
FROM session_nodes`)}catch{return n}for(let e of t){let t=r(e.entry_json)??{},i=t.origin&&"object"==typeof t.origin&&!Array.isArray(t.origin)?t.origin:{};n.set(e.current_session_id,{channel:s(t.lastChannel)??s(i.provider)??s(i.surface),label:s(e.label)??s(e.display_name)??s(t.displayName)??s(i.label),chatId:s(t.lastTo)??s(i.from),chatType:s(t.chatType)??s(i.chatType)})}return n}(e),a=function(e){let t,n=new Map;try{t=e.query(`SELECT sc.session_id, c.channel, c.kind, c.peer_id,
|
|
14
|
-
c.delivery_target, c.label
|
|
15
|
-
FROM session_conversations sc
|
|
16
|
-
JOIN conversations c ON c.conversation_id = sc.conversation_id
|
|
17
|
-
ORDER BY CASE sc.role WHEN 'primary' THEN 0 ELSE 1 END, sc.last_seen_at DESC`)}catch{return n}for(let e of t)n.has(e.session_id)||n.set(e.session_id,{channel:s(e.channel),label:s(e.label),chatId:s(e.delivery_target)??s(e.peer_id),chatType:s(e.kind)});return n}(e);for(let e of t){let t=i.get(e.session_id),r=a.get(e.session_id);n.push({sessionId:e.session_id,agentId:l,dbPath:c,transcriptPath:o(l,e.session_id),mtimeMs:Math.max(Number(e.updated_at)||0,Number(e.transcript_updated_at)||0,Number(e.ended_at)||0,Number(e.event_updated_at)||0),sizeBytes:Number(e.size_bytes)||0,channel:s(e.channel)??r?.channel??t?.channel??"local",label:s(e.display_name)??r?.label??t?.label,chatId:r?.chatId??t?.chatId,chatType:s(e.chat_type)??r?.chatType??t?.chatType})}}finally{e.close()}}return n}async function c(e,t,n){for(let{agentId:s,dbPath:l}of a(e,t)){let e=await (0,i.openSqliteReadonly)(l);if(e)try{let t;try{t=e.query(`SELECT event_json
|
|
18
|
-
FROM transcript_events
|
|
19
|
-
WHERE session_id = ?
|
|
20
|
-
ORDER BY seq ASC`,[n])}catch{continue}if(0===t.length)continue;let i=t.map(e=>e.event_json),a=i.map(r).filter(e=>void 0!==e);return{agentId:s,dbPath:l,filePath:o(s,n),rawLines:a,eventJsonLines:i}}finally{e.close()}}return null}e.s(["listOpenClawSqliteSessions",0,l,"readOpenClawSqliteTranscript",0,c])},90624,e=>{"use strict";var t=e.i(2157),n=e.i(50227),i=e.i(83534),s=e.i(64199),r=e.i(28557),o=e.i(96878);function a(e){return"string"==typeof e&&e.length>0?e:void 0}async function l(){let e=(0,s.listOpenClawTranscripts)(),i=new Map,r=new Map;for(let o of e){let e=i.get(o.agentId);e||(e=function(e){let i,r=new Map,o=(0,n.join)((0,s.openclawHome)(),"agents",e,"sessions","sessions.json");try{i=JSON.parse((0,t.readFileSync)(o,"utf-8"))}catch{return r}if(!i||"object"!=typeof i)return r;for(let e of Object.values(i)){if(!e||"object"!=typeof e)continue;let t=a(e.sessionId);if(!t)continue;let n=e.origin&&"object"==typeof e.origin?e.origin:{},i="number"==typeof e.lastInteractionAt?e.lastInteractionAt:"number"==typeof e.updatedAt?e.updatedAt:void 0;r.set(t,{lastMs:i,channel:a(e.lastChannel)??a(n.provider)??a(n.surface),chatType:a(e.chatType)??a(n.chatType),label:a(n.label),chatId:a(e.lastTo)??a(n.from)})}return r}(o.agentId),i.set(o.agentId,e));let l=e.get(o.sessionId);r.set(`${o.agentId}\0${o.sessionId}`,{sessionId:o.sessionId,agentId:o.agentId,channel:l?.channel??"local",label:l?.label,chatType:l?.chatType,chatId:l?.chatId,transcriptPath:o.transcriptPath,mtimeMs:l?.lastMs??o.mtimeMs,sizeBytes:o.sizeBytes})}for(let e of(await (0,o.listOpenClawSqliteSessions)((0,s.openclawHome)(),(0,s.listOpenClawAgents)())))r.set(`${e.agentId}\0${e.sessionId}`,e);return[...r.values()].sort((e,t)=>t.mtimeMs-e.mtimeMs)}let c=(0,i.runtimeCache)(l,2);function u(e,t){return`openclaw-${e}-${t}`}function d(e,t){return`openclaw:${e}:${t}`}function f(e){if(!e.startsWith("openclaw-"))return[];let t=e.slice(9);if(!t)return[];let n=[];for(let e of(0,s.listOpenClawAgents)().sort((e,t)=>t.length-e.length)){let i=`${e}-`;t.startsWith(i)&&t.length>i.length&&n.push({agentId:e,channel:t.slice(i.length)})}return n.push({agentId:null,channel:t}),n}async function m(){let e=await l(),t=new Map;for(let n of e){let e=JSON.stringify([n.agentId,n.channel]),i=t.get(e);i?(i.latest=Math.max(i.latest,n.mtimeMs),i.count+=1):t.set(e,{agentId:n.agentId,channel:n.channel,latest:n.mtimeMs,count:1})}let n=[];for(let{agentId:e,channel:i,latest:s,count:o}of t.values()){let t=new Date(s);n.push({name:u(e,i),path:d(e,i),isDirectory:!0,lastModified:t,lastModifiedFormatted:(0,r.formatDate)(t),cli:["openclaw"],sessionCount:o})}return n.sort((e,t)=>t.lastModified.getTime()-e.lastModified.getTime()),n}async function p(e){let t=f(e);if(0===t.length)return{cwd:null,sessions:[]};let n=await l(),i=e=>n.filter(t=>t.channel===e.channel&&(null===e.agentId||t.agentId===e.agentId)),s=t[0],o=i(s);if(0===o.length)for(let e of t.slice(1)){let t=i(e);if(t.length>0){s=e,o=t;break}}let{agentId:a,channel:c}=s;return{cwd:null===a?`openclaw:${c}`:d(a,c),sessions:o.map(e=>{let t=new Date(e.mtimeMs);return{name:e.label??e.chatId??e.sessionId,path:e.sessionId,lastModified:t,lastModifiedFormatted:(0,r.formatDate)(t),sessionId:e.sessionId,cli:"openclaw",channelId:e.chatId,channelType:e.chatType}})}}let y=(0,i.runtimeCache)(m,2),h=(0,i.runtimeCache)(e=>p(e),2,{maxSize:50});e.s(["getCachedOpenClawProjects",0,y,"getCachedOpenClawSessions",0,c,"getCachedOpenClawSessionsByEncodedName",0,h,"getOpenClawProjects",0,m,"getOpenClawSessions",0,l,"getOpenClawSessionsByEncodedName",0,p,"openClawProjectName",0,u,"openClawProjectNameCandidates",0,f,"openClawProjectPath",0,d,"parseOpenClawProjectName",0,function(e){return f(e)[0]??null}])},64199,e=>{"use strict";var t=e.i(12714),n=e.i(2157),i=e.i(60526),s=e.i(50227),r=e.i(83534),o=e.i(54214),a=e.i(67405),l=e.i(96878);let c=/^[0-9a-fA-F-]{36}$/;function u(){return process.env.OPENCLAW_STATE_DIR||process.env.OPENCLAW_HOME||(0,s.join)((0,i.homedir)(),".openclaw")}function d(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function f(e){return"string"==typeof e?e:Array.isArray(e)?e.map(e=>d(e)&&"string"==typeof e.text?e.text:"").filter(Boolean).join("\n"):""}function m(e,t="session"){let n=[],i=new Map,s=new Map,r=Date.now();for(let l=0;l<e.length;l++){let c=e[l];if(!d(c)||"message"!==c.type)continue;let u=d(c.message)?c.message:void 0;if(!u)continue;let m="string"==typeof u.role?u.role:"system",p=function(e,t){if("number"==typeof e&&Number.isFinite(e)){if(e>1e12)return new Date(e);if(e>1e9)return new Date(1e3*e)}if("string"==typeof e){let t=Date.parse(e);if(!Number.isNaN(t))return new Date(t)}return new Date(t)}(c.timestamp??u.timestamp,r+l),y=p.toISOString(),h={uuid:null!=c.id?String(c.id):`openclaw-${l}`,parentUuid:null!=c.parentId?String(c.parentId):null},g=(0,o.baseEntry)(h,y,p,t);if("user"===m){n.push({type:"user",...g,message:{role:"user",content:f(u.content)}});continue}if("assistant"===m){let e=[],t=u.content;if(Array.isArray(t)){for(let n of t)if(d(n)){if("text"===n.type&&"string"==typeof n.text)e.push({type:"text",text:n.text});else if("toolCall"===n.type){let t="string"==typeof n.id?n.id:`${String(n.name??"tool")}-${e.length}`,r={type:"tool_use",id:t,name:"string"==typeof n.name?n.name:"tool",input:d(n.arguments)?n.arguments:{}};e.push(r),i.set(t,r),s.set(t,p.getTime())}}}else{let n=f(t);n&&e.push({type:"text",text:n})}if(0===e.length)continue;n.push({type:"assistant",...g,message:{role:"assistant",content:e,model:"string"==typeof u.model?u.model:void 0}});continue}if("toolResult"===m){let e="string"==typeof u.toolCallId?u.toolCallId:void 0,t=e?i.get(e):void 0;if(t){let n=d(u.details)?u.details:void 0,i=e&&s.get(e)||p.getTime(),r=n&&"number"==typeof n.durationMs?n.durationMs:Math.max(0,p.getTime()-i);t.result={timestamp:y,timestampFormatted:(0,o.formatTimestamp)(p),content:f(u.content),durationMs:r,durationFormatted:(0,a.formatDuration)(r)};continue}}n.push({type:"system",...g,raw:h})}return n.sort((e,t)=>e.timestampMs-t.timestampMs),n}function p(){try{return(0,n.readdirSync)((0,s.join)(u(),"agents"),{withFileTypes:!0}).filter(e=>e.isDirectory()&&!e.name.startsWith(".")).map(e=>e.name).sort()}catch{return[]}}function y(){let e,t=(0,s.join)(u(),"agents"),i=[];try{e=(0,n.readdirSync)(t,{withFileTypes:!0}).filter(e=>e.isDirectory()).map(e=>e.name)}catch{return i}for(let r of e){let e,o=(0,s.join)(t,r,"sessions");try{e=(0,n.readdirSync)(o)}catch{continue}for(let t of e){if(!t.endsWith(".jsonl")||t.endsWith(".trajectory.jsonl"))continue;let e=t.slice(0,-6);if(!c.test(e))continue;let a=(0,s.join)(o,t);try{let t=(0,n.statSync)(a);i.push({agentId:r,sessionId:e,transcriptPath:a,mtimeMs:t.mtimeMs,sizeBytes:t.size})}catch{}}}return i}function h(e){if(!c.test(e))return null;for(let t of y())if(t.sessionId===e)return t.transcriptPath;return null}async function g(e){let n,i;if(!c.test(e))return null;let s=await (0,l.readOpenClawSqliteTranscript)(u(),p(),e);if(s){let e,t=m(s.rawLines,"session");for(let t of s.rawLines)if("session"===t.type&&"string"==typeof t.cwd&&t.cwd.length>0){e=t.cwd;break}return{entries:t,rawLines:s.rawLines,cwd:e,filePath:s.filePath}}let r=h(e);if(!r)return null;try{n=await (0,t.readFile)(r,"utf-8")}catch{return null}let a=(0,o.parseRawLines)(n,"session"),f=m(a,"session");for(let e of a)if(d(e)&&"session"===e.type&&"string"==typeof e.cwd&&e.cwd.length>0){i=e.cwd;break}return{entries:f,rawLines:a,cwd:i,filePath:r}}(0,r.runtimeCache)(e=>g(e),2,{maxSize:50}),e.s(["findOpenClawTranscript",0,h,"getOpenClawSessionLog",0,g,"listOpenClawAgents",0,p,"listOpenClawTranscripts",0,y,"openclawHome",0,u])},40759,e=>{"use strict";var t=e.i(60526),n=e.i(50227),i=e.i(79708);async function s(e){let s=await (0,i.openSqliteReadonly)(function(){if(process.env.OPENCODE_DB_PATH)return process.env.OPENCODE_DB_PATH;let e=process.env.OPENCODE_HOME??(0,n.join)((0,t.homedir)(),".local","share","opencode");return(0,n.join)(e,"opencode.db")}());if(!s)return null;try{return e(s)}catch{return null}finally{try{s.close()}catch{}}}async function r(e,t=[]){return s(n=>n.query(e,t))}e.s(["queryOpenCodeDb",0,r,"withOpenCodeDb",0,s])},35435,e=>{"use strict";var t=e.i(40759),n=e.i(81580),i=e.i(83534),s=e.i(28557),r=e.i(40911);async function o(){return(0,t.queryOpenCodeDb)("SELECT id, project_id, slug, directory, title, time_created, time_updated FROM session ORDER BY time_updated DESC LIMIT ?",[1e3])}async function a(){let e=await (0,t.withOpenCodeDb)(e=>({sessions:e.query("SELECT id, project_id, slug, directory, title, time_created, time_updated FROM session ORDER BY time_updated DESC LIMIT ?",[1e3]),projects:e.query("SELECT id, worktree, vcs, name, time_created, time_updated FROM project")}));return{sessions:e?.sessions??null,projects:e?.projects??null}}async function l(){let{sessions:e,projects:t}=await a();if(null===e&&null===t)return[];let i=new Map;for(let e of t??[])i.set(e.id,e);let r=new Map;for(let t of e??[]){if(!t.project_id)continue;let e=r.get(t.project_id);e||(e={rows:[],latest:0},r.set(t.project_id,e)),e.rows.push(t),t.time_updated>e.latest&&(e.latest=t.time_updated)}let o=new Set,l=[];for(let[e,t]of r){o.add(e);let r=i.get(e),a=r?.worktree??t.rows[0]?.directory??null,c=a?(0,n.encodeFolderName)(a):e,u=a??"",d=new Date(Math.max(t.latest,r?.time_updated??0));l.push({name:c,path:u,isDirectory:!0,lastModified:d,lastModifiedFormatted:(0,s.formatDate)(d),cli:["opencode"]})}for(let e of t??[]){if(o.has(e.id))continue;let t=e.worktree??"",i=t?(0,n.encodeFolderName)(t):e.id,r=new Date(e.time_updated);l.push({name:i,path:t,isDirectory:!0,lastModified:r,lastModifiedFormatted:(0,s.formatDate)(r),cli:["opencode"]})}return l.sort((e,t)=>t.lastModified.getTime()-e.lastModified.getTime()),l}async function c(e){let t=await o();return t?t.filter(t=>t.directory===e).map(e=>{let t=new Date(e.time_updated);return{name:e.title??e.slug??e.id,path:`opencode://${e.id}`,lastModified:t,lastModifiedFormatted:(0,s.formatDate)(t),sessionId:e.id,cli:"opencode"}}):[]}async function u(e){let t,i;try{({projects:t,sessions:i}=await a())}catch(e){return(0,r.logWarn)("Failed to read OpenCode DB:",e),{cwd:null,sessions:[]}}if(!t||!i)return{cwd:null,sessions:[]};let o=t.find(t=>t.worktree&&(0,n.encodeFolderName)(t.worktree)===e);if(!o||!o.worktree)return{cwd:null,sessions:[]};let l=i.filter(e=>e.project_id===o.id);return{cwd:o.worktree,sessions:l.map(e=>{let t=new Date(e.time_updated);return{name:e.title??e.slug??e.id,path:`opencode://${e.id}`,lastModified:t,lastModifiedFormatted:(0,s.formatDate)(t),sessionId:e.id,cli:"opencode"}})}}let d=(0,i.runtimeCache)(l,30),f=(0,i.runtimeCache)(e=>c(e),30,{maxSize:50}),m=(0,i.runtimeCache)(e=>u(e),30,{maxSize:50});e.s(["getCachedOpenCodeProjects",0,d,"getCachedOpenCodeSessionsByEncodedName",0,m,"getCachedOpenCodeSessionsForCwd",0,f,"getOpenCodeProjects",0,l,"getOpenCodeSessionsByEncodedName",0,u,"getOpenCodeSessionsForCwd",0,c])},99440,e=>{"use strict";var t=e.i(40759),n=e.i(83534),i=e.i(54214),s=e.i(67405);function r(e){try{return e()}catch{return null}}function o(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function a(e){if("string"!=typeof e||0===e.length)return null;try{let t=JSON.parse(e);return o(t)?t:null}catch{return null}}async function l(e){if(!e||!/^[A-Za-z0-9_-]+$/.test(e))return null;let n=await (0,t.withOpenCodeDb)(t=>({sessions:r(()=>t.query("SELECT id, project_id, slug, directory, title, time_created, time_updated FROM session WHERE id = ?",[e])),messages:r(()=>t.query("SELECT id, session_id, time_created, time_updated, data FROM message WHERE session_id = ? ORDER BY time_created ASC",[e])),parts:r(()=>t.query("SELECT id, message_id, session_id, time_created, time_updated, data FROM part WHERE session_id = ? ORDER BY time_created ASC",[e]))})),l=n?.sessions??null;if(!l||0===l.length)return null;let c=l[0],u=n?.messages??null,d=n?.parts??null;if(!u)return{entries:[],rawLines:[],cwd:c.directory??void 0,filePath:`opencode://${e}`};let f=new Map;for(let e of d??[]){let t=f.get(e.message_id);t||(t=[],f.set(e.message_id,t)),t.push(e)}let m=[],p=[];for(let e of u){let t=f.get(e.id)??[];m.push(function(e,t,n){let r=a(e.data)??{},l="string"==typeof r.role?r.role:"system",c=new Date(e.time_created),u=c.toISOString(),d={uuid:e.id,parentUuid:null},f=(0,i.baseEntry)(d,u,c,n),m=[],p="";for(let e of t){let t=a(e.data);if(!t)continue;let n="string"==typeof t.type?t.type:"unknown";if("text"===n){let e="string"==typeof t.text?t.text:"string"==typeof t.content?t.content:"";e&&(m.push({type:"text",text:e}),p+=(p?"\n":"")+e);continue}if("tool"===n){let n="string"==typeof t.tool?t.tool:"string"==typeof t.name?t.name:"tool",r=o(t.state)?t.state:null,a=r&&o(r.input)?r.input:o(t.input)?t.input:o(t.args)?t.args:{},l={type:"tool_use",id:e.id,name:n,input:a},c=r&&"string"==typeof r.status?r.status:"";if(r&&("completed"===c||"error"===c)){let t=("error"===c&&"string"==typeof r.error?r.error:null)??r.output,n="string"==typeof t?t:null!=t?JSON.stringify(t):"",a=o(r.time)?r.time:{},u="number"==typeof a.start?a.start:e.time_created,d="number"==typeof a.end?a.end:e.time_updated,f=Math.max(0,d-u),m=new Date(d);l.result={timestamp:m.toISOString(),timestampFormatted:(0,i.formatTimestamp)(m),content:n,durationMs:f,durationFormatted:(0,s.formatDuration)(f)}}m.push(l);continue}m.push({type:"text",text:`[opencode ${n}]`})}if("user"===l)return{...f,type:"user",message:{role:"user",content:p}};if("assistant"===l){let e=o(r.model)?r.model:null,t=e&&"string"==typeof e.modelID?e.modelID:void 0;return{...f,type:"assistant",message:{role:"assistant",content:m,model:t}}}return{...f,type:"system",raw:{id:e.id,role:l,parts:m}}}(e,t,"session"));let n=a(e.data);p.push({id:e.id,session_id:e.session_id,time_created:e.time_created,data:n??e.data})}return{entries:m,rawLines:p,cwd:c.directory??void 0,filePath:`opencode://${e}`}}async function c(e){if(!e||!/^[A-Za-z0-9_-]+$/.test(e))return null;let n=await (0,t.withOpenCodeDb)(t=>({sessions:r(()=>t.query("SELECT id, project_id, slug, directory, title, time_created, time_updated FROM session WHERE id = ?",[e])),messages:r(()=>t.query("SELECT id, session_id, time_created, time_updated, data FROM message WHERE session_id = ? ORDER BY time_created ASC",[e])),parts:r(()=>t.query("SELECT id, message_id, session_id, time_created, time_updated, data FROM part WHERE session_id = ? ORDER BY time_created ASC",[e]))})),i=n?.sessions??null;if(!i||0===i.length)return null;let s=n?.messages??null,o=n?.parts??null;return null===s||null===o?null:{session:i[0],messages:s.map(e=>({...e,data:a(e.data)??e.data})),parts:o.map(e=>({...e,data:a(e.data)??e.data}))}}(0,n.runtimeCache)(e=>l(e),30,{maxSize:50}),e.s(["getOpenCodeSessionExport",0,c,"getOpenCodeSessionLog",0,l])},19791,e=>{"use strict";var t=e.i(12714),n=e.i(60526),i=e.i(50227),s=e.i(81580),r=e.i(83534),o=e.i(71809),a=e.i(28557),l=e.i(40911);let c=/^[\d-]+T[\d-]+Z_([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.jsonl$/i;async function u(e){try{return await (0,t.readdir)(e,{withFileTypes:!0})}catch{return null}}async function d(e){try{return(await (0,t.stat)(e)).mtime}catch{return null}}async function f(e){let n;try{n=await (0,t.readFile)(e,"utf-8")}catch{return null}let i=n.indexOf("\n")>=0?n.slice(0,n.indexOf("\n")):n;if(!i)return null;try{let e=JSON.parse(i);if("session"!==e.type||"string"!=typeof e.cwd||0===e.cwd.length)return null;return e.cwd}catch{return null}}async function m(){let e=process.env.PI_SESSIONS_DIR||(0,i.join)((0,n.homedir)(),".pi","agent","sessions"),t=await u(e);if(!t)return[];let s=[];for(let n of t){if(!n.isDirectory())continue;let t=(0,i.join)(e,n.name),r=await u(t);if(r)for(let e of r){if(!e.isFile())continue;let n=c.exec(e.name);n&&s.push({sessionId:n[1],filePath:(0,i.join)(t,e.name)})}}return 0===s.length?[]:(await (0,o.batchAll)(s.map(e=>async()=>{let t=await f(e.filePath);if(!t)return null;let n=await d(e.filePath);return n?{filePath:e.filePath,sessionId:e.sessionId,cwd:t,fileMtime:n}:null}),16)).filter(e=>"fulfilled"===e.status).map(e=>e.value).filter(e=>null!==e)}let p=(0,r.runtimeCache)(m,30);async function y(){let e;try{e=await p()}catch(e){return(0,l.logWarn)("Failed to scan Pi sessions:",e),[]}let t=new Map;for(let n of e){let e=t.get(n.cwd);(!e||n.fileMtime.getTime()>e.latest.getTime())&&t.set(n.cwd,{latest:n.fileMtime,cwd:n.cwd})}let n=[];for(let{cwd:e,latest:i}of t.values())n.push({name:(0,s.encodeFolderName)(e),path:e,isDirectory:!0,lastModified:i,lastModifiedFormatted:(0,a.formatDate)(i),cli:["pi"]});return n.sort((e,t)=>t.lastModified.getTime()-e.lastModified.getTime()),n}function h(e){let t=e.map(e=>({name:e.sessionId,path:e.filePath,lastModified:e.fileMtime,lastModifiedFormatted:(0,a.formatDate)(e.fileMtime),sessionId:e.sessionId,cli:"pi"}));return t.sort((e,t)=>t.lastModified.getTime()-e.lastModified.getTime()),t}async function g(e){let t;try{t=await p()}catch(e){return(0,l.logWarn)("Failed to scan Pi sessions:",e),[]}return h(t.filter(t=>t.cwd===e))}async function w(e){let t;try{t=await p()}catch(e){return(0,l.logWarn)("Failed to scan Pi sessions:",e),{cwd:null,sessions:[]}}let n=t.filter(t=>(0,s.encodeFolderName)(t.cwd)===e),i=Array.from(new Set(n.map(e=>e.cwd)));return 1!==i.length?{cwd:null,sessions:[]}:{cwd:i[0],sessions:h(n)}}let _=(0,r.runtimeCache)(y,30),S=(0,r.runtimeCache)(e=>g(e),30,{maxSize:50}),v=(0,r.runtimeCache)(e=>w(e),30,{maxSize:50});e.s(["getCachedPiProjects",0,_,"getCachedPiSessionsByEncodedName",0,v,"getCachedPiSessionsForCwd",0,S,"getPiProjects",0,y,"getPiSessionsByEncodedName",0,w,"getPiSessionsForCwd",0,g])},85116,e=>{"use strict";var t=e.i(2157),n=e.i(12714),i=e.i(50227),s=e.i(60526),r=e.i(83534),o=e.i(54214),a=e.i(67405);let l=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,c=/^[\d-]+T[\d-]+Z_([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.jsonl$/i;function u(e){let n;if(!l.test(e))return null;let r=(0,i.resolve)(process.env.PI_SESSIONS_DIR||(0,i.join)((0,s.homedir)(),".pi","agent","sessions"));try{n=(0,t.readdirSync)(r)}catch{return null}for(let s of n){let n,o=(0,i.resolve)(r,s);if(o.startsWith(`${r}${i.sep}`)){try{n=(0,t.readdirSync)(o)}catch{continue}for(let s of n){let n=c.exec(s);if(!n||n[1].toLowerCase()!==e.toLowerCase())continue;let r=(0,i.resolve)(o,s);if(r.startsWith(`${o}${i.sep}`)&&(0,t.existsSync)(r))return r}}}return null}function d(e){if(!Array.isArray(e))return"";let t=[];for(let n of e)n?.type==="text"&&"string"==typeof n.text&&t.push(n.text);return t.join("\n\n")}async function f(e,t="session"){let n,i=e.split("\n").filter(e=>""!==e.trim()),s=[],r=[],l=!1,c=new Map,u=new Map;for(let e=0;e<i.length;e++){let f;e>0&&e%200==0&&await new Promise(e=>setImmediate(e));let m=i[e];try{f=JSON.parse(m)}catch{continue}let p={...f,_source:t};r.push(p);let y=f.timestamp;if(!y)continue;let h=new Date(y);if(Number.isNaN(h.getTime()))continue;let g=h.toISOString(),w=f.type;if("session"===w){"string"!=typeof f.cwd||n||(n=f.cwd);let e=l?"Session Resumed":"Session Started";l=!0,s.push({type:"queue-operation",...(0,o.baseEntry)(p,g,h,t),label:e});continue}if("message"===w&&f.message&&"object"==typeof f.message){let e=f.message.role,n=f.message.content;if("user"===e){let e=d(n);if(!e)continue;s.push({type:"user",...(0,o.baseEntry)(p,g,h,t),message:{role:"user",content:e}});continue}if("assistant"===e){let e=function(e,t){if(!Array.isArray(e))return[];let n=[];for(let i of e)if(i?.type==="text"&&"string"==typeof i.text&&i.text.length>0&&n.push({type:"text",text:i.text}),i?.type==="thinking"&&"string"==typeof i.thinking&&i.thinking.length>0&&n.push({type:"text",text:`[thinking] ${i.thinking}`}),i?.type==="toolCall"){let e="string"==typeof i.id&&i.id.length>0?i.id:`${"string"==typeof i.name?i.name:"tool"}-${n.length}`,s={type:"tool_use",id:e,name:"string"==typeof i.name?i.name:"tool",input:i.arguments&&"object"==typeof i.arguments&&!Array.isArray(i.arguments)?i.arguments:{}};n.push(s),t?.(s)}return n}(n,e=>{c.set(e.id,e),u.set(e.id,h.getTime())});if(0===e.length){s.push({type:"system",...(0,o.baseEntry)(p,g,h,t),raw:p});continue}s.push({type:"assistant",...(0,o.baseEntry)(p,g,h,t),message:{role:"assistant",content:e}});continue}if("toolResult"===e){let e=f.message.toolCallId,t="string"==typeof e?c.get(e):void 0;if(t){let i="string"==typeof e&&u.get(e)||h.getTime(),s=Math.max(0,h.getTime()-i);t.result={timestamp:g,timestampFormatted:(0,o.formatTimestamp)(h),content:d(n),durationMs:s,durationFormatted:(0,a.formatDuration)(s)};continue}}s.push({type:"system",...(0,o.baseEntry)(p,g,h,t),raw:p});continue}s.push({type:"system",...(0,o.baseEntry)(p,g,h,t),raw:p})}return s.length>500&&await new Promise(e=>setImmediate(e)),s.sort((e,t)=>e.timestampMs-t.timestampMs),{entries:s,rawLines:r,cwd:n}}async function m(e){let t,i,s=u(e);if(!s)return null;try{t=await (0,n.readFile)(s,"utf-8")}catch{return null}try{i=await f(t,"session")}catch{return null}return{entries:i.entries,rawLines:i.rawLines,cwd:i.cwd,filePath:s}}(0,r.runtimeCache)(e=>m(e),60,{maxSize:50}),e.s(["findPiTranscript",0,u,"getPiSessionLog",0,m])},46501,e=>{"use strict";var t=e.i(10659),n=e.i(17694),i=e.i(24214),s=e.i(28067);let r=s.POSTHOG_API_KEY;async function o(){try{if(!(0,n.isTelemetryEnabled)()||globalThis.__FAILPROOFAI_POSTHOG__)return;let t=await e.A(78081),i=process.env.FAILPROOFAI_POSTHOG_KEY??r,s=process.env.FAILPROOFAI_POSTHOG_HOST??"https://us.i.posthog.com";globalThis.__FAILPROOFAI_POSTHOG__=new t.PostHog(i,{host:s,flushAt:1,flushInterval:1e4,requestTimeout:1e4,fetchRetryCount:3,fetchRetryDelay:3e3});let o=!1,a=()=>{o||(o=!0,globalThis.__FAILPROOFAI_POSTHOG__?.shutdown().catch(()=>{}))};process.on("beforeExit",a),process.on("SIGTERM",a),process.on("SIGINT",a)}catch(e){console.warn("[failproofai:telemetry] init failed:",e instanceof Error?e.message:e)}}e.s(["initTelemetry",0,o,"trackEvent",0,function(e,r){if(!(0,n.isTelemetryEnabled)())return;let o=globalThis.__FAILPROOFAI_POSTHOG__;o&&o.capture({distinctId:(0,t.getInstanceId)(),event:e,properties:{...r,$lib:"failproofai",failproofai_version:i.version,product:s.POSTHOG_PRODUCT}})}])},29095,e=>{"use strict";var t=e.i(2157),n=e.i(79857);function i(e,t){return!(e&&function(e){if(!Number.isInteger(e)||e<=0)return!1;try{return process.kill(e,0),!0}catch(e){return"EPERM"===e.code}}(e.pid))||t-e.startedAt>36e5}function s(e,n){let i=!1,s=()=>{if(i)return;i=!0,process.removeListener("exit",s);let o=r(e);if(!o||o.pid===n.pid)try{(0,t.unlinkSync)(e)}catch{}};return process.once("exit",s),{info:n,release:s}}function r(e){try{let n=JSON.parse((0,t.readFileSync)(e,"utf8"));if("number"!=typeof n?.pid||"number"!=typeof n?.startedAt)return null;return{pid:n.pid,startedAt:n.startedAt,source:n.source??"cli"}}catch{return null}}function o(e,n){let i=JSON.stringify(n),s=`${e}.${process.pid}.tmp`;try{(0,t.writeFileSync)(s,i,{mode:384})}catch{return!1}try{return(0,t.linkSync)(s,e),!0}catch(s){let n;if("EEXIST"===s.code)return!1;var r=e,o=i;try{return n=(0,t.openSync)(r,"wx",384),(0,t.writeSync)(n,o),!0}catch{return!1}finally{if(void 0!==n)try{(0,t.closeSync)(n)}catch{}}}finally{try{(0,t.unlinkSync)(s)}catch{}}}e.s(["acquireAuditLock",0,function(e,a=Date.now()){let l=(0,n.auditLockFile)(),c={pid:process.pid,startedAt:a,source:e};try{(0,t.mkdirSync)((0,n.failproofaiHome)(),{recursive:!0}),(0,t.mkdirSync)((0,n.runDir)(),{recursive:!0,mode:448})}catch{return{ok:!1,heldBy:null}}if(o(l,c))return{ok:!0,lock:s(l,c)};let u=r(l);if(!i(u,a))return{ok:!1,heldBy:u};try{(0,t.unlinkSync)(l)}catch{}return o(l,c)?{ok:!0,lock:s(l,c)}:{ok:!1,heldBy:r(l)}},"readActiveAuditLock",0,function(e=Date.now()){let t=r((0,n.auditLockFile)());return i(t,e)?null:t}])},47756,e=>{"use strict";var t=e.i(2157),n=e.i(94930),i=e.i(79857);function s(){return(0,i.auditDashboardFile)()}e.s(["readDashboardCache",0,function(){let e=s();if(!(0,t.existsSync)(e))return null;try{let n=(0,t.readFileSync)(e,"utf-8"),i=JSON.parse(n);if(!i||"object"!=typeof i||"string"!=typeof i.cachedAt||!i.params||"object"!=typeof i.params||!i.result||"object"!=typeof i.result||2!==i.schemaVersion||function(e,t=30){let n=new Date(e).getTime();return!!Number.isNaN(n)||Date.now()-n>6e4*t}(i.cachedAt,10080))return null;return i}catch{return null}},"writeDashboardCache",0,function(e,t){try{let i={schemaVersion:2,cachedAt:new Date().toISOString(),params:e,result:t};return(0,n.writeJsonAtomically)(s(),i),!0}catch{return!1}}])},97348,73136,49335,e=>{"use strict";var t=e.i(2157),n=e.i(50227),i=e.i(79857);let s={info:0,warn:1,error:2},r=(0,i.logsDir)(),o=!1,a="warn",l=!1,c=r;function u(e){return!function(){if(o)return;o=!0;let e=(process.env.FAILPROOFAI_LOG_LEVEL??"").toLowerCase();("info"===e||"warn"===e||"error"===e)&&(a=e);let t=(process.env.FAILPROOFAI_HOOK_LOG_FILE??"").trim();t&&(l=!0,"1"!==t&&"true"!==t&&(c=t))}(),s[e]>=s[a]}function d(e,t){process.stderr.write(`[failproofai:hook] ${e} ${t}
|
|
21
|
-
`)}function f(e,i){if(l)try{(0,t.existsSync)(c)||(0,t.mkdirSync)(c,{recursive:!0});let s=(0,n.join)(c,"hooks.log");try{if((0,t.statSync)(s).size>=524288){let e=`hooks-${Date.now()}.log`;(0,t.renameSync)(s,(0,n.join)(c,e))}}catch{}let r=new Date().toISOString(),o=`[${r}] ${e} ${i}
|
|
22
|
-
`;(0,t.appendFileSync)(s,o,"utf-8")}catch{}}function m(e){u("warn")&&(d("WARN",e),f("WARN",e))}e.s(["hookLogError",0,function(e){u("error")&&(d("ERROR",e),f("ERROR",e))},"hookLogInfo",0,function(e){u("info")&&(d("INFO",e),f("INFO",e))},"hookLogWarn",0,m],97348);var p=e.i(60526);function y(e){if(!(0,t.existsSync)(e))return{};try{let n=(0,t.readFileSync)(e,"utf8");return JSON.parse(n)}catch(t){return m(`failed to parse config at ${e}: ${t instanceof Error?t.message:String(t)}`),{}}}e.s(["readMergedHooksConfig",0,function(e){let s=function(e){let i=(0,p.homedir)(),s=(0,n.resolve)(e);for(;s!==i;){let e=(0,n.resolve)(s,".failproofai");try{if((0,t.statSync)(e).isDirectory())return s}catch{}let i=(0,n.dirname)(s);if(i===s)break;s=i}return(0,n.resolve)(e)}(e??process.cwd()),r=(0,n.resolve)(s,".failproofai","policies-config.json"),o=(0,n.resolve)(s,".failproofai","policies-config.local.json"),a=(0,i.globalPolicyConfigFile)(),l=y(r),c=y(o),u=y(a),d=new Set([...l.enabledPolicies??[],...c.enabledPolicies??[],...u.enabledPolicies??[]]),f={};for(let e of[l,c,u])if(e.policyParams)for(let[t,n]of Object.entries(e.policyParams))t in f||(f[t]=n);let m=[l,c,u].map(e=>void 0!==e.customPoliciesPaths?e.customPoliciesPaths:void 0!==e.customPoliciesPath?[e.customPoliciesPath]:void 0).find(e=>void 0!==e),h=new Set([...l.disabledCustomPolicies??[],...c.disabledCustomPolicies??[],...u.disabledCustomPolicies??[]]),g=l.customPoliciesEnabled??c.customPoliciesEnabled??u.customPoliciesEnabled,w=l.llm??c.llm??u.llm;return{enabledPolicies:[...d],...Object.keys(f).length>0?{policyParams:f}:{},...void 0!==m?{customPoliciesPaths:m}:{},...h.size?{disabledCustomPolicies:[...h]}:{},...void 0!==g?{customPoliciesEnabled:g}:{},...void 0!==w?{llm:w}:{}}}],73136);var h=e.i(24214),g=e.i(28067),w=e.i(17694);let _=g.POSTHOG_API_KEY,S=new Set;async function v(e,t,n){let i=JSON.stringify({api_key:process.env.FAILPROOFAI_POSTHOG_KEY??_,event:t,distinct_id:e,properties:{...n,$lib:"failproofai-hooks",failproofai_version:h.version,product:g.POSTHOG_PRODUCT}});try{await fetch(process.env.FAILPROOFAI_POSTHOG_HOST?`${process.env.FAILPROOFAI_POSTHOG_HOST}/capture/`:"https://us.i.posthog.com/capture/",{method:"POST",headers:{"Content-Type":"application/json"},body:i,signal:AbortSignal.timeout(5e3)})}catch{}}async function E(e,t,n){if(!(0,w.isTelemetryEnabled)())return;let i=v(e,t,n);S.add(i),i.finally(()=>S.delete(i)),await i}e.s(["trackHookEvent",0,E],49335)}];
|
|
23
|
-
|
|
24
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__1_r2rbg._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[52306,e=>{"use strict";var t=e.i(66680),r=e.i(2157),o=e.i(50227),s=e.i(79857);let i=[1],a=/^[a-f0-9]{64}$/,n=/^[A-Za-z0-9._-]{1,64}\/[A-Za-z0-9._-]{1,64}$/,l=/^[A-Za-z0-9][A-Za-z0-9._+-]{0,63}$/,_=/^[0-9a-f]{7,40}$/,p=/^[A-Za-z0-9._-]{1,128}$/;function c(e){return e instanceof Error?e.message:String(e)}e.s(["readInstalledPacks",0,function(){let e,d=process.env.FAILPROOFAI_PACK_DIR?(0,o.resolve)(process.env.FAILPROOFAI_PACK_DIR,"installed.json"):(0,s.packsInstalledFile)();if(!(0,r.existsSync)(d))return{packs:[],errors:[]};try{e=JSON.parse((0,r.readFileSync)(d,"utf8"))}catch(e){return{packs:[],errors:[{id:null,reason:`unreadable pack manifest: ${c(e)}`}]}}if(!e||"object"!=typeof e)return{packs:[],errors:[{id:null,reason:"pack manifest is not an object"}]};let f=e;if(!i.includes(f.schemaVersion))return{packs:[],errors:[{id:null,reason:`unsupported pack manifest schema ${String(f.schemaVersion)} (supported: ${i.join(", ")})`}]};if(!Array.isArray(f.packs))return{packs:[],errors:[{id:null,reason:"pack manifest packs is not an array"}]};let h=process.env.FAILPROOFAI_PACK_DIR??(0,s.packsDir)(),O=[],E=[],S=new Set;for(let e of f.packs){let s=e&&"object"==typeof e&&"string"==typeof e.id?e.id:null;try{let s=function(e,s){if(!s||"object"!=typeof s)throw Error("pack entry is not an object");let i=function(e){if("string"!=typeof e.id||!n.test(e.id))throw Error(`unsafe pack id ${JSON.stringify(e.id)}`);if("string"!=typeof e.version||!l.test(e.version))throw Error(`invalid version for pack ${e.id}`);if(void 0!==e.effect&&"enforce"!==e.effect&&"observe"!==e.effect)throw Error(`unknown effect ${JSON.stringify(e.effect)} for pack ${e.id}`);let t="string"==typeof e.commit&&_.test(e.commit.trim().toLowerCase())?e.commit.trim().toLowerCase():void 0;return{id:e.id,version:e.version,effect:e.effect??"enforce",...t?{commit:t}:{}}}(s);if("string"!=typeof s.source||0===s.source.length)throw Error(`pack ${s.id} has no source`);if("string"!=typeof s.sha256||!a.test(s.sha256))throw Error(`invalid SHA-256 for pack ${s.id}`);let c=i.effect,d=function(e,t){if(!t||(0,o.isAbsolute)(t))throw Error(`unsafe managed policy path ${JSON.stringify(t)}`);let s=(0,o.resolve)(e,t),i=(0,o.relative)(e,s);if(i.startsWith("..")||(0,o.isAbsolute)(i))throw Error(`managed policy path escapes its root: ${JSON.stringify(t)}`);let a=(0,r.realpathSync)(e),n=(0,r.realpathSync)(s),l=(0,o.relative)(a,n);if(l.startsWith("..")||(0,o.isAbsolute)(l))throw Error(`managed policy symlink escapes its root: ${JSON.stringify(t)}`);return n}(e,s.entry),f=(0,t.createHash)("sha256").update((0,r.readFileSync)(d)).digest("hex");if(f!==s.sha256)throw Error(`pack ${s.id} failed integrity verification: expected ${s.sha256}, got ${f}`);if(!Array.isArray(s.policies))throw Error(`pack ${s.id} policies is not an array`);let h=s.policies.map((e,t)=>(function(e,t,r){let o=`${e} policy #${r}`;if(!t||"object"!=typeof t)throw Error(`${o} is not an object`);let s=t.name;if("string"!=typeof s||!p.test(s))throw Error(`${o} has an unsafe name ${JSON.stringify(s)}`);if("alwaysOn"in t)throw Error(`${o} declares alwaysOn, which packs may not set`);if("string"!=typeof t.description||0===t.description.length)throw Error(`${o} is missing a description`);if("string"!=typeof t.category||0===t.category.length)throw Error(`${o} is missing a category`);if("boolean"!=typeof t.defaultEnabled)throw Error(`${o} is missing defaultEnabled`);if(!t.match||"object"!=typeof t.match)throw Error(`${o} is missing a match`);let i=t.match;for(let e of["events","toolNames"]){let t=i[e];if(void 0!==t&&(!Array.isArray(t)||t.some(e=>"string"!=typeof e||0===e.length)))throw Error(`${o} has a match.${e} that is not a list of names`)}return t})(s.id,e,t)),O=new Set;for(let e of h){if(O.has(e.name))throw Error(`pack ${s.id} declares ${e.name} twice`);O.add(e.name)}let E=null;if(void 0!==s.enabled){if(!Array.isArray(s.enabled)||s.enabled.some(e=>"string"!=typeof e))throw Error(`pack ${s.id} enabled is not an array of names`);E=s.enabled.filter(e=>O.has(e))}let S=null;if(void 0!==s.clis){if(!Array.isArray(s.clis)||s.clis.some(e=>"string"!=typeof e))throw Error(`pack ${s.id} clis is not an array of agent names`);S=s.clis}return{clis:S,id:i.id,version:i.version,source:s.source,path:d,sha256:s.sha256,effect:c,policies:h,enabled:E}}(h,e);if(S.has(s.id))throw Error(`duplicate pack id ${s.id}`);S.add(s.id),O.push(s)}catch(r){let t=e&&("observe"===e.effect||"enforce"===e.effect)?e.effect:"enforce";E.push({id:s,reason:c(r),effect:t,...Array.isArray(e?.policies)?{declared:function(e){let t=[];for(let r of e)r&&"object"==typeof r&&"string"==typeof r.name&&r.match&&"object"==typeof r.match&&t.push(r);return t}(e.policies)}:{},...Array.isArray(e?.clis)&&e.clis.every(e=>"string"==typeof e)?{clis:e.clis}:{}})}}return{packs:O,errors:E}}],52306)},71194,e=>{"use strict";e.i(66680),e.i(2157),e.i(50227),e.i(52306),e.s(["CORE_SOURCE",0,"FailproofAI/policies","PACK_CHECKSUMS_ASSET",0,"SHA256SUMS","PACK_ENTRY_ASSET",0,"failproofai-pack.mjs","PACK_MANIFEST_ASSET",0,"failproofai-pack.json"])},38441,e=>{"use strict";let t=["SessionStart","SessionEnd","UserPromptSubmit","PreToolUse","PermissionRequest","PermissionDenied","PostToolUse","PostToolUseFailure","Notification","SubagentStart","SubagentStop","TaskCreated","TaskCompleted","Stop","StopFailure","TeammateIdle","InstructionsLoaded","ConfigChange","CwdChanged","FileChanged","WorktreeCreate","WorktreeRemove","PreCompact","PostCompact","Elicitation","ElicitationResult","UserPromptExpansion","PostToolBatch","Setup"].filter(e=>"WorktreeCreate"!==e);e.s(["ANTIGRAVITY_HOOK_EVENT_TYPES",0,["PreToolUse","PostToolUse","PreInvocation","Stop"],"ANTIGRAVITY_HOOK_SCOPES",0,["user","project"],"ANTIGRAVITY_TOOL_INPUT_MAP",0,{Bash:{CommandLine:"command",Cwd:"cwd"},Write:{TargetFile:"file_path",CodeContent:"content"},Edit:{TargetFile:"file_path"},Read:{TargetFile:"file_path",AbsolutePath:"file_path",File:"file_path"}},"ANTIGRAVITY_TOOL_MAP",0,{run_command:"Bash",write_to_file:"Write",read_file:"Read",view_file:"Read",edit_file:"Edit",replace_file_content:"Edit",list_dir:"LS",find_by_name:"Glob",grep_search:"Grep",read_url_content:"WebFetch",search_web:"WebSearch"},"CLAUDE_INSTALL_EVENT_TYPES",0,t,"CODEX_EVENT_MAP",0,{session_start:"SessionStart",pre_tool_use:"PreToolUse",permission_request:"PermissionRequest",post_tool_use:"PostToolUse",user_prompt_submit:"UserPromptSubmit",stop:"Stop",subagent_start:"SubagentStart",pre_compact:"PreCompact",post_compact:"PostCompact",subagent_stop:"SubagentStop"},"CODEX_HOOK_EVENT_TYPES",0,["session_start","pre_tool_use","permission_request","post_tool_use","user_prompt_submit","stop","subagent_start","pre_compact","post_compact","subagent_stop"],"CODEX_HOOK_SCOPES",0,["user","project"],"CODEX_TOOL_MAP",0,{apply_patch:"Edit",write_stdin:"Bash"},"COPILOT_HOOK_EVENT_TYPES",0,["SessionStart","SessionEnd","UserPromptSubmit","PreToolUse","PostToolUse","Stop","SubagentStop","PostToolUseFailure","ErrorOccurred","PreCompact","PermissionRequest","Notification"],"COPILOT_HOOK_SCOPES",0,["user","project"],"COPILOT_TOOL_INPUT_MAP",0,{Read:{path:"file_path"},Write:{path:"file_path",file_text:"content"},Edit:{path:"file_path",old_str:"old_string",new_str:"new_string"}},"COPILOT_TOOL_MAP",0,{bash:"Bash",powershell:"Bash",list_bash:"Bash",read_bash:"Bash",stop_bash:"Bash",write_bash:"Bash",list_powershell:"Bash",read_powershell:"Bash",stop_powershell:"Bash",write_powershell:"Bash",read:"Read",view:"Read",show_file:"Read",write:"Write",create:"Write",edit:"Edit",apply_patch:"Edit",str_replace_editor:"Edit",glob:"Glob",grep:"Grep",rg:"Grep",ls:"LS",web_fetch:"WebFetch"},"CURSOR_HOOK_EVENT_TYPES",0,["sessionStart","sessionEnd","beforeSubmitPrompt","preToolUse","postToolUse","stop","subagentStop"],"CURSOR_HOOK_SCOPES",0,["user","project"],"CURSOR_TOOL_MAP",0,{Shell:"Bash"},"DEVIN_HOOK_EVENT_TYPES",0,["SessionStart","UserPromptSubmit","PreToolUse","PostToolUse","PermissionRequest","Stop","SessionEnd"],"DEVIN_HOOK_SCOPES",0,["user","project"],"DEVIN_TOOL_MAP",0,{exec:"Bash"},"FACTORY_HOOK_EVENT_TYPES",0,["SessionStart","UserPromptSubmit","PreToolUse","PostToolUse","Notification","Stop","SubagentStop","PreCompact","SessionEnd"],"FACTORY_HOOK_SCOPES",0,["user","project"],"FACTORY_TOOL_MAP",0,{Execute:"Bash",Read:"Read",Edit:"Edit",Create:"Write",Grep:"Grep",Glob:"Glob",LS:"LS",FetchUrl:"WebFetch",WebSearch:"WebSearch",TodoWrite:"TodoWrite",Task:"Task"},"FAILPROOFAI_HOOK_MARKER",0,"__failproofai_hook__","GOOSE_HOOK_EVENT_TYPES",0,["SessionStart","UserPromptSubmit","PreToolUse","PostToolUse","SessionEnd"],"GOOSE_HOOK_SCOPES",0,["user","project"],"GOOSE_TOOL_INPUT_MAP",0,{Read:{path:"file_path",source:"file_path"},Write:{path:"file_path"},Edit:{path:"file_path"},LS:{path:"file_path"}},"GOOSE_TOOL_MAP",0,{shell:"Bash",write:"Write",edit:"Edit",view:"Read",read_image:"Read",glob:"Glob",grep:"Grep",tree:"LS",delegate:"Task",todo__todo_write:"TodoWrite"},"HERMES_HOOK_EVENT_TYPES",0,["pre_tool_call","post_tool_call","on_session_start","on_session_end","subagent_stop"],"HERMES_HOOK_SCOPES",0,["user"],"HERMES_TOOL_INPUT_MAP",0,{Read:{path:"file_path"},Write:{path:"file_path"},Edit:{path:"file_path"}},"HERMES_TOOL_MAP",0,{terminal:"Bash",bash:"Bash",read_file:"Read",write_file:"Write",patch:"Edit",web_search:"WebSearch",web_extract:"WebFetch",search_files:"Grep",todo:"TodoWrite"},"HOOK_SCOPES",0,["user","project","local"],"INTEGRATION_TYPES",0,["claude","codex","copilot","cursor","opencode","pi","hermes","openclaw","factory","devin","antigravity","goose"],"OPENCLAW_HOOK_EVENT_TYPES",0,["before_tool_call","after_tool_call","before_agent_run","before_agent_finalize","session_start","session_end","subagent_ended","before_compaction"],"OPENCLAW_HOOK_SCOPES",0,["user"],"OPENCLAW_TOOL_INPUT_MAP",0,{Read:{path:"file_path"},Write:{path:"file_path"},Edit:{path:"file_path"}},"OPENCLAW_TOOL_MAP",0,{exec:"Bash",read:"Read",write:"Write",edit:"Edit",grep:"Grep",glob:"Glob",web_search:"WebSearch",web_fetch:"WebFetch"},"OPENCODE_HOOK_EVENT_TYPES",0,["tool.execute.before","tool.execute.after","session.created","session.deleted","session.idle","message.updated","permission.ask"],"OPENCODE_HOOK_SCOPES",0,["user","project"],"OPENCODE_TOOL_INPUT_MAP",0,{Read:{filePath:"file_path"},Write:{filePath:"file_path"},Edit:{filePath:"file_path",oldString:"old_string",newString:"new_string",replaceAll:"replace_all"}},"OPENCODE_TOOL_MAP",0,{bash:"Bash",read:"Read",write:"Write",edit:"Edit",apply_patch:"Edit",glob:"Glob",grep:"Grep",list:"LS",webfetch:"WebFetch",websearch:"WebSearch",todowrite:"TodoWrite",todoread:"TodoRead"},"PI_HOOK_EVENT_TYPES",0,["session_start","session_shutdown","input","tool_call","user_bash","tool_result","agent_end"],"PI_HOOK_SCOPES",0,["user","project"],"PI_TOOL_INPUT_MAP",0,{Read:{path:"file_path"},Write:{path:"file_path"},Edit:{path:"file_path"}},"PI_TOOL_MAP",0,{bash:"Bash",read:"Read",write:"Write",edit:"Edit",glob:"Glob",grep:"Grep"}])}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=src_hooks_0iu54mz._.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
module.exports=[74533,(a,b,c)=>{b.exports=a.x("node:child_process",()=>require("node:child_process"))},66680,(a,b,c)=>{b.exports=a.x("node:crypto",()=>require("node:crypto"))},2157,(a,b,c)=>{b.exports=a.x("node:fs",()=>require("node:fs"))},60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},20213,a=>{"use strict";var b=a.i(36359),c=a.i(36119),d=a.i(37936),e=a.i(21572),f=a.i(81243);async function g(a){if(a&&!await (0,f.whoAmI)()){let a=(0,f.readAuth)();return{ok:!1,reason:a&&1e3*a.refresh_expires_at>Date.now()?"unreachable":"signed-out"}}return{ok:!0,auto:(0,e.updateConfig)({audit:a?{auto:!0,reportsConsentedAt:Date.now()}:{auto:!1}}).audit.auto}}async function h(a){return(0,e.updateConfig)({audit:{intervalDays:a}}),{intervalDays:(0,e.readConfig)().audit.intervalDays}}(0,a.i(13095).ensureServerEntryExports)([g,h]),(0,d.registerServerReference)(g,"40aac3636c72b5aab138ea6cbda9e74fa705467e45",null),(0,d.registerServerReference)(h,"4079544fdc84445811e53a00ea70296d9813c89684",null),a.s([],14097),a.i(14097),a.s(["0000a8b66118a0391a4da97c0fc09b21e69423995b",()=>b.getTelemetryConfig,"009f26efb71bd459e010cdd08411f37c42b179eab9",()=>c.getScheduledAuditAction,"4079544fdc84445811e53a00ea70296d9813c89684",0,h,"40aac3636c72b5aab138ea6cbda9e74fa705467e45",0,g],20213)},36359,a=>{"use strict";var b=a.i(37936),c=a.i(69839);a.i(93328);var d=a.i(31920),e=a.i(12072);async function f(){let a=(0,d.isTelemetryEnabled)();return{enabled:a,distinctId:a?(0,c.getInstanceId)():"",apiKey:process.env.FAILPROOFAI_POSTHOG_KEY??"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX",host:process.env.FAILPROOFAI_POSTHOG_HOST??"https://us.i.posthog.com",version:e.version}}(0,a.i(13095).ensureServerEntryExports)([f]),(0,b.registerServerReference)(f,"0000a8b66118a0391a4da97c0fc09b21e69423995b",null),a.s(["getTelemetryConfig",0,f])},31920,a=>{"use strict";var b=a.i(21572);a.s(["isTelemetryEnabled",0,function(){if("1"===process.env.FAILPROOFAI_TELEMETRY_DISABLED)return!1;try{return(0,b.readConfig)().telemetry.enabled}catch{return!0}}])},69839,a=>{"use strict";let b;var c=a.i(2157),d=a.i(50227),e=a.i(60526),f=a.i(66680);a.i(74533);var g=a.i(75818);let h=d.default.join(e.default.homedir(),".failproofai"),i=d.default.join(h,"instance-id");function j(a){return f.default.createHmac("sha256","failproofai-telemetry-v1").update(a).digest("hex")}function k(a){let b;try{if(b=(0,g.telemetryIdFile)(),c.default.readFileSync(b,"utf-8").trim()===a)return}catch{try{b=(0,g.telemetryIdFile)()}catch{return}}try{c.default.mkdirSync(d.default.dirname(b),{recursive:!0});let e=`${b}.${process.pid}.tmp`;c.default.writeFileSync(e,a,{encoding:"utf-8",mode:384}),c.default.renameSync(e,b)}catch{}}a.s(["getInstanceId",0,function(){if(b)return b;let a=function(){try{for(let a of(e.default.platform(),["/etc/machine-id","/var/lib/dbus/machine-id"]))try{let b=c.default.readFileSync(a,"utf-8").trim();if(b)return b}catch{}}catch{}}();if(a)return k(b=j(a)),b;let d=[e.default.hostname(),e.default.homedir(),e.default.platform(),e.default.arch(),e.default.cpus()[0]?.model??""].join(":");return d?k(b=j(d)):k(b=function(){try{let a=c.default.readFileSync(i,"utf-8").trim();if(a)return a}catch{}let a=f.default.randomUUID();try{c.default.mkdirSync(h,{recursive:!0}),c.default.writeFileSync(i,a,"utf-8")}catch{}return a}()),b},"hashToId",0,j])},93328,a=>{"use strict";var b=a.i(69839),c=a.i(31920),d=a.i(12072),e=a.i(79779);e.POSTHOG_API_KEY,a.s(["trackEvent",0,function(a,f){if(!(0,c.isTelemetryEnabled)())return;let g=globalThis.__FAILPROOFAI_POSTHOG__;g&&g.capture({distinctId:(0,b.getInstanceId)(),event:a,properties:{...f,$lib:"failproofai",failproofai_version:d.version,product:e.POSTHOG_PRODUCT}})}])},13095,(a,b,c)=>{"use strict";function d(a){for(let b=0;b<a.length;b++){let c=a[b];if("function"!=typeof c)throw Object.defineProperty(Error(`A "use server" file can only export async functions, found ${typeof c}.
|
|
2
|
-
Read more: https://nextjs.org/docs/messages/invalid-use-server-value`),"__NEXT_ERROR_CODE",{value:"E352",enumerable:!1,configurable:!0})}}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"ensureServerEntryExports",{enumerable:!0,get:function(){return d}})},37936,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"registerServerReference",{enumerable:!0,get:function(){return d.registerServerReference}});let d=a.r(11857)},12072,(a,b,c)=>{b.exports={name:"failproofai",version:"1.0.7",description:"Observability and enforcement for AI agent harnesses. 39 built-in policies hooked into 12 of them — Claude Code, Codex, Cursor, Hermes, OpenClaw and more — blocking the tool call before it runs. Local dashboard included, no account needed.",bin:{failproofai:"./dist/cli.mjs",failproofaid:"./bin/failproofaid-shim.mjs"},files:["bin/","src/","scripts/","lib/","pi-extension/","hermes-plugin/","openclaw-plugin/",".next/standalone/","dist/","README.md"],engines:{node:">=20.9.0",bun:">=1.3.0"},scripts:{predev:"bun run build:cli && bun link",dev:"FAILPROOFAI_TELEMETRY_DISABLED=1 bun scripts/dev.ts --port 8020","build:cli":"bun build --target=node --format=esm --outfile=dist/cli.mjs bin/failproofai.mjs --external posthog-node --external sql.js && node -e \"const fs=require('fs');const c=fs.readFileSync('dist/cli.mjs','utf8');fs.writeFileSync('dist/cli.mjs',c.replace('#!/usr/bin/env bun','#!/usr/bin/env node').replace('// @bun\\n',''))\"","build:worker":"bun build --target=node --format=esm --outfile=dist/worker.mjs bin/failproofai-worker.mjs --external posthog-node --external sql.js",build:"bun build --target=node --format=cjs --outfile=dist/index.js src/index.ts && bun run build:cli && bun run build:worker && bun --bun next build && node -e \"const {cpSync}=require('fs');cpSync('.next/static','.next/standalone/.next/static',{recursive:true});\" && node scripts/prune-standalone.mjs",prestart:"bun run build:cli && bun link",start:"FAILPROOFAI_TELEMETRY_DISABLED=1 bun scripts/start.ts",test:"vitest","test:run":"vitest run",lint:"eslint . --config eslint.config.mjs",prepare:"bun run build","test:e2e":"vitest run --config vitest.config.e2e.mts","test:e2e:watch":"vitest --config vitest.config.e2e.mts",translate:"bun scripts/translate-docs/cli.ts","translate:readme":"bun scripts/translate-docs/cli.ts --readme-only","translate:docs":"bun scripts/translate-docs/cli.ts --docs-only","translate:dry-run":"bun scripts/translate-docs/cli.ts --dry-run","translate:validate":"bun scripts/translate-docs/cli.ts --validate","validate:mdx":"bun scripts/validate-mdx.ts","docs:audit":"bun scripts/docs-audit.ts","build:pack":"bun scripts/build-policy-pack.mjs"},keywords:["agent-observability","llm-observability","agent-tracing","agent-monitoring","agent-harness","guardrails","enforcement","policies","evals","ai-agent","autonomous-agent","agent-reliability","failure-prevention","claude-code","codex","hermes","openclaw","cli","local-first","hooks"],author:"ExosphereHost Inc. <failproofai@exosphere.host>",license:"SEE LICENSE IN LICENSE",homepage:"https://github.com/FailproofAI/failproofai",repository:{type:"git",url:"https://github.com/FailproofAI/failproofai.git"},bugs:{url:"https://github.com/FailproofAI/failproofai/issues"},publishConfig:{access:"public"},devDependencies:{"@anthropic-ai/sdk":"^0.127.0","@mdx-js/mdx":"^3.1.1","@tailwindcss/postcss":"^4.3.1","@tanstack/react-virtual":"^3.14.10","@testing-library/jest-dom":"^7.0.0","@testing-library/react":"^16.3.2","@testing-library/user-event":"^14.6.5","@types/node":"26.6.1","@types/react":"19.3.0","@types/react-dom":"^19.2.3","@vitejs/plugin-react":"^6.1.0",clsx:"^2.1.1",eslint:"^10.9.0","eslint-config-next":"^16.3.2",jsdom:"^30.0.1","lucide-react":"^1.33.0",next:"^16.3.2",react:"^19.2.4","react-dom":"^19.2.4","tailwind-merge":"^3.4.0",tailwindcss:"^4.3.1",typescript:"6.0.3",vitest:"^5.0.0"},dependencies:{"html-to-image":"^1.11.13","posthog-node":"^5.50.0","sql.js":"^1.14.1",yaml:"^2.9.0"},overrides:{nanoid:"3.3.18",postcss:"8.5.26","eslint-plugin-react-hooks":"7.0.1",vite:"8.0.16",undici:"7.29.0","brace-expansion":"5.0.9",sharp:"0.35.4",browserslist:"4.28.8"},optionalDependencies:{"@failproofai/failproofaid-linux-x64":"1.0.7","@failproofai/failproofaid-linux-arm64":"1.0.7","@failproofai/failproofaid-darwin-x64":"1.0.7","@failproofai/failproofaid-darwin-arm64":"1.0.7"},failproofaidBinaries:{"linux-x64":"65acfcabaa4dda6d37d2958d4100c366a85f17c68d2250de6126e2717ca773e6","linux-arm64":"cece883f87d53034003be8f0f293aa89bd0e69306d6032e17b3eb91f230b3ce2","darwin-x64":"565aa3d560a05dd76e2eb843ddbad593d2d8df94c963bdeb1c7e2a8a3816d0c5","darwin-arm64":"2b41601b53e77a31439e92d8be9be6b9872e3d4ad7e8664ff89cd2be4ed6c44d"}}},79779,a=>{"use strict";a.s(["POSTHOG_API_KEY",0,"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX","POSTHOG_PRODUCT",0,"failproofai-oss"])}];
|
|
3
|
-
|
|
4
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__0-_ki57._.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
module.exports=[74533,(a,b,c)=>{b.exports=a.x("node:child_process",()=>require("node:child_process"))},66680,(a,b,c)=>{b.exports=a.x("node:crypto",()=>require("node:crypto"))},2157,(a,b,c)=>{b.exports=a.x("node:fs",()=>require("node:fs"))},60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},165,a=>{"use strict";var b=a.i(36359);a.s([],84833),a.i(84833),a.s(["0000a8b66118a0391a4da97c0fc09b21e69423995b",()=>b.getTelemetryConfig],165)},36359,a=>{"use strict";var b=a.i(37936),c=a.i(69839);a.i(93328);var d=a.i(31920),e=a.i(12072);async function f(){let a=(0,d.isTelemetryEnabled)();return{enabled:a,distinctId:a?(0,c.getInstanceId)():"",apiKey:process.env.FAILPROOFAI_POSTHOG_KEY??"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX",host:process.env.FAILPROOFAI_POSTHOG_HOST??"https://us.i.posthog.com",version:e.version}}(0,a.i(13095).ensureServerEntryExports)([f]),(0,b.registerServerReference)(f,"0000a8b66118a0391a4da97c0fc09b21e69423995b",null),a.s(["getTelemetryConfig",0,f])},31920,a=>{"use strict";var b=a.i(21572);a.s(["isTelemetryEnabled",0,function(){if("1"===process.env.FAILPROOFAI_TELEMETRY_DISABLED)return!1;try{return(0,b.readConfig)().telemetry.enabled}catch{return!0}}])},69839,a=>{"use strict";let b;var c=a.i(2157),d=a.i(50227),e=a.i(60526),f=a.i(66680);a.i(74533);var g=a.i(75818);let h=d.default.join(e.default.homedir(),".failproofai"),i=d.default.join(h,"instance-id");function j(a){return f.default.createHmac("sha256","failproofai-telemetry-v1").update(a).digest("hex")}function k(a){let b;try{if(b=(0,g.telemetryIdFile)(),c.default.readFileSync(b,"utf-8").trim()===a)return}catch{try{b=(0,g.telemetryIdFile)()}catch{return}}try{c.default.mkdirSync(d.default.dirname(b),{recursive:!0});let e=`${b}.${process.pid}.tmp`;c.default.writeFileSync(e,a,{encoding:"utf-8",mode:384}),c.default.renameSync(e,b)}catch{}}a.s(["getInstanceId",0,function(){if(b)return b;let a=function(){try{for(let a of(e.default.platform(),["/etc/machine-id","/var/lib/dbus/machine-id"]))try{let b=c.default.readFileSync(a,"utf-8").trim();if(b)return b}catch{}}catch{}}();if(a)return k(b=j(a)),b;let d=[e.default.hostname(),e.default.homedir(),e.default.platform(),e.default.arch(),e.default.cpus()[0]?.model??""].join(":");return d?k(b=j(d)):k(b=function(){try{let a=c.default.readFileSync(i,"utf-8").trim();if(a)return a}catch{}let a=f.default.randomUUID();try{c.default.mkdirSync(h,{recursive:!0}),c.default.writeFileSync(i,a,"utf-8")}catch{}return a}()),b},"hashToId",0,j])},93328,a=>{"use strict";var b=a.i(69839),c=a.i(31920),d=a.i(12072),e=a.i(79779);e.POSTHOG_API_KEY,a.s(["trackEvent",0,function(a,f){if(!(0,c.isTelemetryEnabled)())return;let g=globalThis.__FAILPROOFAI_POSTHOG__;g&&g.capture({distinctId:(0,b.getInstanceId)(),event:a,properties:{...f,$lib:"failproofai",failproofai_version:d.version,product:e.POSTHOG_PRODUCT}})}])},13095,(a,b,c)=>{"use strict";function d(a){for(let b=0;b<a.length;b++){let c=a[b];if("function"!=typeof c)throw Object.defineProperty(Error(`A "use server" file can only export async functions, found ${typeof c}.
|
|
2
|
-
Read more: https://nextjs.org/docs/messages/invalid-use-server-value`),"__NEXT_ERROR_CODE",{value:"E352",enumerable:!1,configurable:!0})}}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"ensureServerEntryExports",{enumerable:!0,get:function(){return d}})},37936,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"registerServerReference",{enumerable:!0,get:function(){return d.registerServerReference}});let d=a.r(11857)},2726,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[externals]__0vmspq5._.js","server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_11bnuzn._.js"].map(b=>a.l(b))).then(()=>b(74493)))},12072,(a,b,c)=>{b.exports={name:"failproofai",version:"1.0.7",description:"Observability and enforcement for AI agent harnesses. 39 built-in policies hooked into 12 of them — Claude Code, Codex, Cursor, Hermes, OpenClaw and more — blocking the tool call before it runs. Local dashboard included, no account needed.",bin:{failproofai:"./dist/cli.mjs",failproofaid:"./bin/failproofaid-shim.mjs"},files:["bin/","src/","scripts/","lib/","pi-extension/","hermes-plugin/","openclaw-plugin/",".next/standalone/","dist/","README.md"],engines:{node:">=20.9.0",bun:">=1.3.0"},scripts:{predev:"bun run build:cli && bun link",dev:"FAILPROOFAI_TELEMETRY_DISABLED=1 bun scripts/dev.ts --port 8020","build:cli":"bun build --target=node --format=esm --outfile=dist/cli.mjs bin/failproofai.mjs --external posthog-node --external sql.js && node -e \"const fs=require('fs');const c=fs.readFileSync('dist/cli.mjs','utf8');fs.writeFileSync('dist/cli.mjs',c.replace('#!/usr/bin/env bun','#!/usr/bin/env node').replace('// @bun\\n',''))\"","build:worker":"bun build --target=node --format=esm --outfile=dist/worker.mjs bin/failproofai-worker.mjs --external posthog-node --external sql.js",build:"bun build --target=node --format=cjs --outfile=dist/index.js src/index.ts && bun run build:cli && bun run build:worker && bun --bun next build && node -e \"const {cpSync}=require('fs');cpSync('.next/static','.next/standalone/.next/static',{recursive:true});\" && node scripts/prune-standalone.mjs",prestart:"bun run build:cli && bun link",start:"FAILPROOFAI_TELEMETRY_DISABLED=1 bun scripts/start.ts",test:"vitest","test:run":"vitest run",lint:"eslint . --config eslint.config.mjs",prepare:"bun run build","test:e2e":"vitest run --config vitest.config.e2e.mts","test:e2e:watch":"vitest --config vitest.config.e2e.mts",translate:"bun scripts/translate-docs/cli.ts","translate:readme":"bun scripts/translate-docs/cli.ts --readme-only","translate:docs":"bun scripts/translate-docs/cli.ts --docs-only","translate:dry-run":"bun scripts/translate-docs/cli.ts --dry-run","translate:validate":"bun scripts/translate-docs/cli.ts --validate","validate:mdx":"bun scripts/validate-mdx.ts","docs:audit":"bun scripts/docs-audit.ts","build:pack":"bun scripts/build-policy-pack.mjs"},keywords:["agent-observability","llm-observability","agent-tracing","agent-monitoring","agent-harness","guardrails","enforcement","policies","evals","ai-agent","autonomous-agent","agent-reliability","failure-prevention","claude-code","codex","hermes","openclaw","cli","local-first","hooks"],author:"ExosphereHost Inc. <failproofai@exosphere.host>",license:"SEE LICENSE IN LICENSE",homepage:"https://github.com/FailproofAI/failproofai",repository:{type:"git",url:"https://github.com/FailproofAI/failproofai.git"},bugs:{url:"https://github.com/FailproofAI/failproofai/issues"},publishConfig:{access:"public"},devDependencies:{"@anthropic-ai/sdk":"^0.127.0","@mdx-js/mdx":"^3.1.1","@tailwindcss/postcss":"^4.3.1","@tanstack/react-virtual":"^3.14.10","@testing-library/jest-dom":"^7.0.0","@testing-library/react":"^16.3.2","@testing-library/user-event":"^14.6.5","@types/node":"26.6.1","@types/react":"19.3.0","@types/react-dom":"^19.2.3","@vitejs/plugin-react":"^6.1.0",clsx:"^2.1.1",eslint:"^10.9.0","eslint-config-next":"^16.3.2",jsdom:"^30.0.1","lucide-react":"^1.33.0",next:"^16.3.2",react:"^19.2.4","react-dom":"^19.2.4","tailwind-merge":"^3.4.0",tailwindcss:"^4.3.1",typescript:"6.0.3",vitest:"^5.0.0"},dependencies:{"html-to-image":"^1.11.13","posthog-node":"^5.50.0","sql.js":"^1.14.1",yaml:"^2.9.0"},overrides:{nanoid:"3.3.18",postcss:"8.5.26","eslint-plugin-react-hooks":"7.0.1",vite:"8.0.16",undici:"7.29.0","brace-expansion":"5.0.9",sharp:"0.35.4",browserslist:"4.28.8"},optionalDependencies:{"@failproofai/failproofaid-linux-x64":"1.0.7","@failproofai/failproofaid-linux-arm64":"1.0.7","@failproofai/failproofaid-darwin-x64":"1.0.7","@failproofai/failproofaid-darwin-arm64":"1.0.7"},failproofaidBinaries:{"linux-x64":"65acfcabaa4dda6d37d2958d4100c366a85f17c68d2250de6126e2717ca773e6","linux-arm64":"cece883f87d53034003be8f0f293aa89bd0e69306d6032e17b3eb91f230b3ce2","darwin-x64":"565aa3d560a05dd76e2eb843ddbad593d2d8df94c963bdeb1c7e2a8a3816d0c5","darwin-arm64":"2b41601b53e77a31439e92d8be9be6b9872e3d4ad7e8664ff89cd2be4ed6c44d"}}},79779,a=>{"use strict";a.s(["POSTHOG_API_KEY",0,"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX","POSTHOG_PRODUCT",0,"failproofai-oss"])}];
|
|
3
|
-
|
|
4
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__013jr2b._.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
module.exports=[74533,(a,b,c)=>{b.exports=a.x("node:child_process",()=>require("node:child_process"))},66680,(a,b,c)=>{b.exports=a.x("node:crypto",()=>require("node:crypto"))},2157,(a,b,c)=>{b.exports=a.x("node:fs",()=>require("node:fs"))},60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},7292,1144,a=>{"use strict";var b=a.i(37936),c=a.i(2157),d=a.i(50227),e=a.i(75818);let f="current.jsonl",g=()=>(0,e.hookActivityDir)();function h(){(0,c.existsSync)(g())||(0,c.mkdirSync)(g(),{recursive:!0})}function i(){let a=function(){try{return JSON.parse((0,c.readFileSync)((0,d.join)(g(),"stats.json"),"utf-8"))}catch{return{totalEvents:0,denyCount:0,policyMap:{}}}}(),b=null,e=0;for(let[c,d]of Object.entries(a.policyMap))d>e&&(b=c,e=d);return{totalEvents:a.totalEvents,denyCount:a.denyCount,topPolicy:b,topPolicyCount:e}}function j(a,b){let c=(function(){h();let a=l((0,d.join)(g(),f)).reverse(),b=m(),c=[];for(let a of b){let b=l((0,d.join)(g(),a));c.push(...b.reverse())}return[...a,...c]})().filter(b=>(!a.decision||b.decision===a.decision)&&(!a.eventType||b.eventType===a.eventType)&&(!a.policyName||!!b.policyName&&!!b.policyName.toLowerCase().includes(a.policyName.toLowerCase()))&&(!a.sessionId||!!b.sessionId&&!!b.sessionId.toLowerCase().includes(a.sessionId.toLowerCase()))&&(!a.integration||b.integration===a.integration)&&(!a.source||b.policySource===a.source)&&!0),e=Math.max(1,Math.ceil(c.length/25)),j=(b-1)*25;return{entries:c.slice(j,j+25),totalPages:e,page:b,stats:i()}}function k(a){let b=function(a){if(h(),a<1)return[];if(1===a)return l((0,d.join)(g(),f)).reverse();let b=m(),c=a-2;return c>=b.length?[]:l((0,d.join)(g(),b[c])).reverse()}(a);return{entries:b,totalPages:(h(),1+m().length),page:a,stats:i()}}function l(a){let b=function(a){try{return(0,c.readFileSync)(a,"utf-8")}catch{return""}}(a);if(!b.trim())return[];let d=[];for(let a of b.trim().split("\n"))try{var e;d.push((e=JSON.parse(a),void 0===e.cloudVersion&&"number"==typeof e.cloudRevision&&(e.cloudVersion=e.cloudRevision),void 0===e.cloudDeployment&&"number"==typeof e.cloudGeneration&&(e.cloudDeployment=e.cloudGeneration),e))}catch{}return d}function m(){try{return(0,c.readdirSync)(g()).filter(a=>a.startsWith("page-")&&a.endsWith(".jsonl")).sort((a,b)=>{let c=a.slice(5,-6).split("-"),d=b.slice(5,-6).split("-"),e=parseInt(c[0],10),f=parseInt(d[0],10);if(e!==f)return f-e;let g=c.length>1?parseInt(c[1],10):0;return(d.length>1?parseInt(d[1],10):0)-g})}catch{return[]}}async function n(a){return k(a)}async function o(a,b){return j(a,b)}a.s(["getHookActivityHistory",0,k,"searchHookActivity",0,j],1144),(0,a.i(13095).ensureServerEntryExports)([n,o]),(0,b.registerServerReference)(n,"4052996db5bcf9a91f55c3109c60382cae2e908e52",null),(0,b.registerServerReference)(o,"60502d248fd08c48cd46e31caafa4275686e675a83",null),a.s(["getHookActivityAction",0,n,"searchHookActivityAction",0,o],7292)},36359,a=>{"use strict";var b=a.i(37936),c=a.i(69839);a.i(93328);var d=a.i(31920),e=a.i(12072);async function f(){let a=(0,d.isTelemetryEnabled)();return{enabled:a,distinctId:a?(0,c.getInstanceId)():"",apiKey:process.env.FAILPROOFAI_POSTHOG_KEY??"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX",host:process.env.FAILPROOFAI_POSTHOG_HOST??"https://us.i.posthog.com",version:e.version}}(0,a.i(13095).ensureServerEntryExports)([f]),(0,b.registerServerReference)(f,"0000a8b66118a0391a4da97c0fc09b21e69423995b",null),a.s(["getTelemetryConfig",0,f])},31920,a=>{"use strict";var b=a.i(21572);a.s(["isTelemetryEnabled",0,function(){if("1"===process.env.FAILPROOFAI_TELEMETRY_DISABLED)return!1;try{return(0,b.readConfig)().telemetry.enabled}catch{return!0}}])},69839,a=>{"use strict";let b;var c=a.i(2157),d=a.i(50227),e=a.i(60526),f=a.i(66680);a.i(74533);var g=a.i(75818);let h=d.default.join(e.default.homedir(),".failproofai"),i=d.default.join(h,"instance-id");function j(a){return f.default.createHmac("sha256","failproofai-telemetry-v1").update(a).digest("hex")}function k(a){let b;try{if(b=(0,g.telemetryIdFile)(),c.default.readFileSync(b,"utf-8").trim()===a)return}catch{try{b=(0,g.telemetryIdFile)()}catch{return}}try{c.default.mkdirSync(d.default.dirname(b),{recursive:!0});let e=`${b}.${process.pid}.tmp`;c.default.writeFileSync(e,a,{encoding:"utf-8",mode:384}),c.default.renameSync(e,b)}catch{}}a.s(["getInstanceId",0,function(){if(b)return b;let a=function(){try{for(let a of(e.default.platform(),["/etc/machine-id","/var/lib/dbus/machine-id"]))try{let b=c.default.readFileSync(a,"utf-8").trim();if(b)return b}catch{}}catch{}}();if(a)return k(b=j(a)),b;let d=[e.default.hostname(),e.default.homedir(),e.default.platform(),e.default.arch(),e.default.cpus()[0]?.model??""].join(":");return d?k(b=j(d)):k(b=function(){try{let a=c.default.readFileSync(i,"utf-8").trim();if(a)return a}catch{}let a=f.default.randomUUID();try{c.default.mkdirSync(h,{recursive:!0}),c.default.writeFileSync(i,a,"utf-8")}catch{}return a}()),b},"hashToId",0,j])},93328,a=>{"use strict";var b=a.i(69839),c=a.i(31920),d=a.i(12072),e=a.i(79779);e.POSTHOG_API_KEY,a.s(["trackEvent",0,function(a,f){if(!(0,c.isTelemetryEnabled)())return;let g=globalThis.__FAILPROOFAI_POSTHOG__;g&&g.capture({distinctId:(0,b.getInstanceId)(),event:a,properties:{...f,$lib:"failproofai",failproofai_version:d.version,product:e.POSTHOG_PRODUCT}})}])},13095,(a,b,c)=>{"use strict";function d(a){for(let b=0;b<a.length;b++){let c=a[b];if("function"!=typeof c)throw Object.defineProperty(Error(`A "use server" file can only export async functions, found ${typeof c}.
|
|
2
|
-
Read more: https://nextjs.org/docs/messages/invalid-use-server-value`),"__NEXT_ERROR_CODE",{value:"E352",enumerable:!1,configurable:!0})}}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"ensureServerEntryExports",{enumerable:!0,get:function(){return d}})},37936,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"registerServerReference",{enumerable:!0,get:function(){return d.registerServerReference}});let d=a.r(11857)},12072,(a,b,c)=>{b.exports={name:"failproofai",version:"1.0.7",description:"Observability and enforcement for AI agent harnesses. 39 built-in policies hooked into 12 of them — Claude Code, Codex, Cursor, Hermes, OpenClaw and more — blocking the tool call before it runs. Local dashboard included, no account needed.",bin:{failproofai:"./dist/cli.mjs",failproofaid:"./bin/failproofaid-shim.mjs"},files:["bin/","src/","scripts/","lib/","pi-extension/","hermes-plugin/","openclaw-plugin/",".next/standalone/","dist/","README.md"],engines:{node:">=20.9.0",bun:">=1.3.0"},scripts:{predev:"bun run build:cli && bun link",dev:"FAILPROOFAI_TELEMETRY_DISABLED=1 bun scripts/dev.ts --port 8020","build:cli":"bun build --target=node --format=esm --outfile=dist/cli.mjs bin/failproofai.mjs --external posthog-node --external sql.js && node -e \"const fs=require('fs');const c=fs.readFileSync('dist/cli.mjs','utf8');fs.writeFileSync('dist/cli.mjs',c.replace('#!/usr/bin/env bun','#!/usr/bin/env node').replace('// @bun\\n',''))\"","build:worker":"bun build --target=node --format=esm --outfile=dist/worker.mjs bin/failproofai-worker.mjs --external posthog-node --external sql.js",build:"bun build --target=node --format=cjs --outfile=dist/index.js src/index.ts && bun run build:cli && bun run build:worker && bun --bun next build && node -e \"const {cpSync}=require('fs');cpSync('.next/static','.next/standalone/.next/static',{recursive:true});\" && node scripts/prune-standalone.mjs",prestart:"bun run build:cli && bun link",start:"FAILPROOFAI_TELEMETRY_DISABLED=1 bun scripts/start.ts",test:"vitest","test:run":"vitest run",lint:"eslint . --config eslint.config.mjs",prepare:"bun run build","test:e2e":"vitest run --config vitest.config.e2e.mts","test:e2e:watch":"vitest --config vitest.config.e2e.mts",translate:"bun scripts/translate-docs/cli.ts","translate:readme":"bun scripts/translate-docs/cli.ts --readme-only","translate:docs":"bun scripts/translate-docs/cli.ts --docs-only","translate:dry-run":"bun scripts/translate-docs/cli.ts --dry-run","translate:validate":"bun scripts/translate-docs/cli.ts --validate","validate:mdx":"bun scripts/validate-mdx.ts","docs:audit":"bun scripts/docs-audit.ts","build:pack":"bun scripts/build-policy-pack.mjs"},keywords:["agent-observability","llm-observability","agent-tracing","agent-monitoring","agent-harness","guardrails","enforcement","policies","evals","ai-agent","autonomous-agent","agent-reliability","failure-prevention","claude-code","codex","hermes","openclaw","cli","local-first","hooks"],author:"ExosphereHost Inc. <failproofai@exosphere.host>",license:"SEE LICENSE IN LICENSE",homepage:"https://github.com/FailproofAI/failproofai",repository:{type:"git",url:"https://github.com/FailproofAI/failproofai.git"},bugs:{url:"https://github.com/FailproofAI/failproofai/issues"},publishConfig:{access:"public"},devDependencies:{"@anthropic-ai/sdk":"^0.127.0","@mdx-js/mdx":"^3.1.1","@tailwindcss/postcss":"^4.3.1","@tanstack/react-virtual":"^3.14.10","@testing-library/jest-dom":"^7.0.0","@testing-library/react":"^16.3.2","@testing-library/user-event":"^14.6.5","@types/node":"26.6.1","@types/react":"19.3.0","@types/react-dom":"^19.2.3","@vitejs/plugin-react":"^6.1.0",clsx:"^2.1.1",eslint:"^10.9.0","eslint-config-next":"^16.3.2",jsdom:"^30.0.1","lucide-react":"^1.33.0",next:"^16.3.2",react:"^19.2.4","react-dom":"^19.2.4","tailwind-merge":"^3.4.0",tailwindcss:"^4.3.1",typescript:"6.0.3",vitest:"^5.0.0"},dependencies:{"html-to-image":"^1.11.13","posthog-node":"^5.50.0","sql.js":"^1.14.1",yaml:"^2.9.0"},overrides:{nanoid:"3.3.18",postcss:"8.5.26","eslint-plugin-react-hooks":"7.0.1",vite:"8.0.16",undici:"7.29.0","brace-expansion":"5.0.9",sharp:"0.35.4",browserslist:"4.28.8"},optionalDependencies:{"@failproofai/failproofaid-linux-x64":"1.0.7","@failproofai/failproofaid-linux-arm64":"1.0.7","@failproofai/failproofaid-darwin-x64":"1.0.7","@failproofai/failproofaid-darwin-arm64":"1.0.7"},failproofaidBinaries:{"linux-x64":"65acfcabaa4dda6d37d2958d4100c366a85f17c68d2250de6126e2717ca773e6","linux-arm64":"cece883f87d53034003be8f0f293aa89bd0e69306d6032e17b3eb91f230b3ce2","darwin-x64":"565aa3d560a05dd76e2eb843ddbad593d2d8df94c963bdeb1c7e2a8a3816d0c5","darwin-arm64":"2b41601b53e77a31439e92d8be9be6b9872e3d4ad7e8664ff89cd2be4ed6c44d"}}},79779,a=>{"use strict";a.s(["POSTHOG_API_KEY",0,"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX","POSTHOG_PRODUCT",0,"failproofai-oss"])}];
|
|
3
|
-
|
|
4
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__01wy8d-._.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
module.exports=[74533,(a,b,c)=>{b.exports=a.x("node:child_process",()=>require("node:child_process"))},66680,(a,b,c)=>{b.exports=a.x("node:crypto",()=>require("node:crypto"))},2157,(a,b,c)=>{b.exports=a.x("node:fs",()=>require("node:fs"))},60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},37985,a=>{"use strict";var b=a.i(36359);a.s([],80194),a.i(80194),a.s(["0000a8b66118a0391a4da97c0fc09b21e69423995b",()=>b.getTelemetryConfig],37985)},36359,a=>{"use strict";var b=a.i(37936),c=a.i(69839);a.i(93328);var d=a.i(31920),e=a.i(12072);async function f(){let a=(0,d.isTelemetryEnabled)();return{enabled:a,distinctId:a?(0,c.getInstanceId)():"",apiKey:process.env.FAILPROOFAI_POSTHOG_KEY??"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX",host:process.env.FAILPROOFAI_POSTHOG_HOST??"https://us.i.posthog.com",version:e.version}}(0,a.i(13095).ensureServerEntryExports)([f]),(0,b.registerServerReference)(f,"0000a8b66118a0391a4da97c0fc09b21e69423995b",null),a.s(["getTelemetryConfig",0,f])},31920,a=>{"use strict";var b=a.i(21572);a.s(["isTelemetryEnabled",0,function(){if("1"===process.env.FAILPROOFAI_TELEMETRY_DISABLED)return!1;try{return(0,b.readConfig)().telemetry.enabled}catch{return!0}}])},69839,a=>{"use strict";let b;var c=a.i(2157),d=a.i(50227),e=a.i(60526),f=a.i(66680);a.i(74533);var g=a.i(75818);let h=d.default.join(e.default.homedir(),".failproofai"),i=d.default.join(h,"instance-id");function j(a){return f.default.createHmac("sha256","failproofai-telemetry-v1").update(a).digest("hex")}function k(a){let b;try{if(b=(0,g.telemetryIdFile)(),c.default.readFileSync(b,"utf-8").trim()===a)return}catch{try{b=(0,g.telemetryIdFile)()}catch{return}}try{c.default.mkdirSync(d.default.dirname(b),{recursive:!0});let e=`${b}.${process.pid}.tmp`;c.default.writeFileSync(e,a,{encoding:"utf-8",mode:384}),c.default.renameSync(e,b)}catch{}}a.s(["getInstanceId",0,function(){if(b)return b;let a=function(){try{for(let a of(e.default.platform(),["/etc/machine-id","/var/lib/dbus/machine-id"]))try{let b=c.default.readFileSync(a,"utf-8").trim();if(b)return b}catch{}}catch{}}();if(a)return k(b=j(a)),b;let d=[e.default.hostname(),e.default.homedir(),e.default.platform(),e.default.arch(),e.default.cpus()[0]?.model??""].join(":");return d?k(b=j(d)):k(b=function(){try{let a=c.default.readFileSync(i,"utf-8").trim();if(a)return a}catch{}let a=f.default.randomUUID();try{c.default.mkdirSync(h,{recursive:!0}),c.default.writeFileSync(i,a,"utf-8")}catch{}return a}()),b},"hashToId",0,j])},93328,a=>{"use strict";var b=a.i(69839),c=a.i(31920),d=a.i(12072),e=a.i(79779);e.POSTHOG_API_KEY,a.s(["trackEvent",0,function(a,f){if(!(0,c.isTelemetryEnabled)())return;let g=globalThis.__FAILPROOFAI_POSTHOG__;g&&g.capture({distinctId:(0,b.getInstanceId)(),event:a,properties:{...f,$lib:"failproofai",failproofai_version:d.version,product:e.POSTHOG_PRODUCT}})}])},13095,(a,b,c)=>{"use strict";function d(a){for(let b=0;b<a.length;b++){let c=a[b];if("function"!=typeof c)throw Object.defineProperty(Error(`A "use server" file can only export async functions, found ${typeof c}.
|
|
2
|
-
Read more: https://nextjs.org/docs/messages/invalid-use-server-value`),"__NEXT_ERROR_CODE",{value:"E352",enumerable:!1,configurable:!0})}}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"ensureServerEntryExports",{enumerable:!0,get:function(){return d}})},37936,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"registerServerReference",{enumerable:!0,get:function(){return d.registerServerReference}});let d=a.r(11857)},2726,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[externals]__0vmspq5._.js","server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_11bnuzn._.js"].map(b=>a.l(b))).then(()=>b(74493)))},12072,(a,b,c)=>{b.exports={name:"failproofai",version:"1.0.7",description:"Observability and enforcement for AI agent harnesses. 39 built-in policies hooked into 12 of them — Claude Code, Codex, Cursor, Hermes, OpenClaw and more — blocking the tool call before it runs. Local dashboard included, no account needed.",bin:{failproofai:"./dist/cli.mjs",failproofaid:"./bin/failproofaid-shim.mjs"},files:["bin/","src/","scripts/","lib/","pi-extension/","hermes-plugin/","openclaw-plugin/",".next/standalone/","dist/","README.md"],engines:{node:">=20.9.0",bun:">=1.3.0"},scripts:{predev:"bun run build:cli && bun link",dev:"FAILPROOFAI_TELEMETRY_DISABLED=1 bun scripts/dev.ts --port 8020","build:cli":"bun build --target=node --format=esm --outfile=dist/cli.mjs bin/failproofai.mjs --external posthog-node --external sql.js && node -e \"const fs=require('fs');const c=fs.readFileSync('dist/cli.mjs','utf8');fs.writeFileSync('dist/cli.mjs',c.replace('#!/usr/bin/env bun','#!/usr/bin/env node').replace('// @bun\\n',''))\"","build:worker":"bun build --target=node --format=esm --outfile=dist/worker.mjs bin/failproofai-worker.mjs --external posthog-node --external sql.js",build:"bun build --target=node --format=cjs --outfile=dist/index.js src/index.ts && bun run build:cli && bun run build:worker && bun --bun next build && node -e \"const {cpSync}=require('fs');cpSync('.next/static','.next/standalone/.next/static',{recursive:true});\" && node scripts/prune-standalone.mjs",prestart:"bun run build:cli && bun link",start:"FAILPROOFAI_TELEMETRY_DISABLED=1 bun scripts/start.ts",test:"vitest","test:run":"vitest run",lint:"eslint . --config eslint.config.mjs",prepare:"bun run build","test:e2e":"vitest run --config vitest.config.e2e.mts","test:e2e:watch":"vitest --config vitest.config.e2e.mts",translate:"bun scripts/translate-docs/cli.ts","translate:readme":"bun scripts/translate-docs/cli.ts --readme-only","translate:docs":"bun scripts/translate-docs/cli.ts --docs-only","translate:dry-run":"bun scripts/translate-docs/cli.ts --dry-run","translate:validate":"bun scripts/translate-docs/cli.ts --validate","validate:mdx":"bun scripts/validate-mdx.ts","docs:audit":"bun scripts/docs-audit.ts","build:pack":"bun scripts/build-policy-pack.mjs"},keywords:["agent-observability","llm-observability","agent-tracing","agent-monitoring","agent-harness","guardrails","enforcement","policies","evals","ai-agent","autonomous-agent","agent-reliability","failure-prevention","claude-code","codex","hermes","openclaw","cli","local-first","hooks"],author:"ExosphereHost Inc. <failproofai@exosphere.host>",license:"SEE LICENSE IN LICENSE",homepage:"https://github.com/FailproofAI/failproofai",repository:{type:"git",url:"https://github.com/FailproofAI/failproofai.git"},bugs:{url:"https://github.com/FailproofAI/failproofai/issues"},publishConfig:{access:"public"},devDependencies:{"@anthropic-ai/sdk":"^0.127.0","@mdx-js/mdx":"^3.1.1","@tailwindcss/postcss":"^4.3.1","@tanstack/react-virtual":"^3.14.10","@testing-library/jest-dom":"^7.0.0","@testing-library/react":"^16.3.2","@testing-library/user-event":"^14.6.5","@types/node":"26.6.1","@types/react":"19.3.0","@types/react-dom":"^19.2.3","@vitejs/plugin-react":"^6.1.0",clsx:"^2.1.1",eslint:"^10.9.0","eslint-config-next":"^16.3.2",jsdom:"^30.0.1","lucide-react":"^1.33.0",next:"^16.3.2",react:"^19.2.4","react-dom":"^19.2.4","tailwind-merge":"^3.4.0",tailwindcss:"^4.3.1",typescript:"6.0.3",vitest:"^5.0.0"},dependencies:{"html-to-image":"^1.11.13","posthog-node":"^5.50.0","sql.js":"^1.14.1",yaml:"^2.9.0"},overrides:{nanoid:"3.3.18",postcss:"8.5.26","eslint-plugin-react-hooks":"7.0.1",vite:"8.0.16",undici:"7.29.0","brace-expansion":"5.0.9",sharp:"0.35.4",browserslist:"4.28.8"},optionalDependencies:{"@failproofai/failproofaid-linux-x64":"1.0.7","@failproofai/failproofaid-linux-arm64":"1.0.7","@failproofai/failproofaid-darwin-x64":"1.0.7","@failproofai/failproofaid-darwin-arm64":"1.0.7"},failproofaidBinaries:{"linux-x64":"65acfcabaa4dda6d37d2958d4100c366a85f17c68d2250de6126e2717ca773e6","linux-arm64":"cece883f87d53034003be8f0f293aa89bd0e69306d6032e17b3eb91f230b3ce2","darwin-x64":"565aa3d560a05dd76e2eb843ddbad593d2d8df94c963bdeb1c7e2a8a3816d0c5","darwin-arm64":"2b41601b53e77a31439e92d8be9be6b9872e3d4ad7e8664ff89cd2be4ed6c44d"}}},79779,a=>{"use strict";a.s(["POSTHOG_API_KEY",0,"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX","POSTHOG_PRODUCT",0,"failproofai-oss"])}];
|
|
3
|
-
|
|
4
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__02npjtd._.js.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
module.exports=[874,(a,b,c)=>{b.exports=a.x("buffer",()=>require("buffer"))},54799,(a,b,c)=>{b.exports=a.x("crypto",()=>require("crypto"))},24868,(a,b,c)=>{b.exports=a.x("fs/promises",()=>require("fs/promises"))},60815,a=>{a.v(a=>Promise.resolve().then(()=>a(24868)))},12714,(a,b,c)=>{b.exports=a.x("node:fs/promises",()=>require("node:fs/promises"))},1457,(a,b,c)=>{b.exports=a.x("node:readline",()=>require("node:readline"))},57764,(a,b,c)=>{b.exports=a.x("node:url",()=>require("node:url"))},46786,(a,b,c)=>{b.exports=a.x("os",()=>require("os"))},5365,(a,b,c)=>{b.exports=a.x("process",()=>require("process"))},92509,(a,b,c)=>{b.exports=a.x("url",()=>require("url"))},8674,a=>{"use strict";var b=a.i(2157),c=a.i(50227),d=a.i(66680);a.s(["writeJsonAtomically",0,function(a,e,f={}){let g=f.mode??384,h=f.dirMode??448,i=(0,c.dirname)(a);(0,b.existsSync)(i)||(0,b.mkdirSync)(i,{recursive:!0,mode:h});let j=`${a}.${process.pid}.${(0,d.randomBytes)(6).toString("hex")}.tmp`;try{(0,b.writeFileSync)(j,JSON.stringify(e,null,2),{mode:g});try{(63&(0,b.statSync)(j).mode)!=0&&(0,b.chmodSync)(j,g)}catch{}(0,b.renameSync)(j,a);try{(63&(0,b.statSync)(a).mode)!=0&&(0,b.chmodSync)(a,g)}catch{}}catch(a){try{(0,b.rmSync)(j,{force:!0})}catch{}throw a}}])},24282,a=>{"use strict";let b={claude:{id:"claude",label:"Claude Code",badgeClasses:"bg-orange-500/10 text-orange-400 border-orange-500/20"},codex:{id:"codex",label:"OpenAI Codex",badgeClasses:"bg-purple-500/10 text-purple-400 border-purple-500/20"},copilot:{id:"copilot",label:"GitHub Copilot",badgeClasses:"bg-blue-500/10 text-blue-400 border-blue-500/20"},cursor:{id:"cursor",label:"Cursor Agent",badgeClasses:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20"},opencode:{id:"opencode",label:"OpenCode",badgeClasses:"bg-amber-500/10 text-amber-400 border-amber-500/20"},pi:{id:"pi",label:"Pi",badgeClasses:"bg-pink-500/10 text-pink-400 border-pink-500/20"},hermes:{id:"hermes",label:"Hermes",badgeClasses:"bg-indigo-500/10 text-indigo-400 border-indigo-500/20"},openclaw:{id:"openclaw",label:"OpenClaw",badgeClasses:"bg-teal-500/10 text-teal-400 border-teal-500/20"},factory:{id:"factory",label:"Factory Droid",badgeClasses:"bg-rose-500/10 text-rose-400 border-rose-500/20"},devin:{id:"devin",label:"Devin CLI",badgeClasses:"bg-violet-500/10 text-violet-400 border-violet-500/20"},antigravity:{id:"antigravity",label:"Antigravity CLI",badgeClasses:"bg-cyan-500/10 text-cyan-400 border-cyan-500/20"},goose:{id:"goose",label:"Goose",badgeClasses:"bg-lime-500/10 text-lime-400 border-lime-500/20"}};a.s(["getCliBadgeClasses",0,function(a){return b[a]?.badgeClasses??b.claude.badgeClasses},"getCliLabel",0,function(a){return b[a]?.label??a}])},43600,a=>{"use strict";var b=a.i(2157),c=a.i(60526),d=a.i(50227);let e="profiles",f=".hermes",g=".hermes-",h="default";function i(){let a=(process.env.HERMES_HOME||"").trim();if(a){let b=(0,d.resolve)(a),c=(0,d.dirname)(b);(0,d.basename)(c)===e&&(b=(0,d.dirname)(c));let h=(0,d.basename)(b);return h===f||h.startsWith(g)?(0,d.join)((0,d.dirname)(b),f):b}return(0,d.join)((0,c.homedir)(),f)}function j(){let a=i(),c=[{name:h,home:a}],j=new Set([h]),k=[];try{k=(0,b.readdirSync)((0,d.join)(a,e),{withFileTypes:!0}).filter(a=>(a.isDirectory()||a.isSymbolicLink())&&!a.name.startsWith(".")).map(a=>a.name).sort()}catch{}for(let b of k)j.has(b)||(j.add(b),c.push({name:b,home:(0,d.join)(a,e,b)}));if((0,d.basename)(a)!==f)return c;let l=[],m=(0,d.dirname)(a);try{l=(0,b.readdirSync)(m,{withFileTypes:!0}).filter(a=>(a.isDirectory()||a.isSymbolicLink())&&a.name.startsWith(g)&&a.name.length>g.length&&(0,b.existsSync)((0,d.join)(m,a.name,"config.yaml"))).map(a=>({name:a.name.slice(g.length),home:(0,d.join)(m,a.name)})).sort((a,b)=>a.name.localeCompare(b.name))}catch{return c}for(let a of l){let b=function(a,b){if(!b.has(a))return a;let c=`${a}-home`;if(!b.has(c))return c;let d=2;for(;b.has(`${c}-${d}`);)d+=1;return`${c}-${d}`}(a.name,j);j.add(b),c.push({name:b,home:a.home})}return c}a.s(["HERMES_DEFAULT_PROFILE",0,h,"hermesProjectName",0,function(a,b){return`hermes-${a}-${b}`},"hermesProjectNameCandidates",0,function(a){if(!a.startsWith("hermes-"))return[];let b=a.slice(7);if(!b)return[];let c=[];for(let a of j().map(a=>a.name).sort((a,b)=>b.length-a.length)){let d=`${a}-`;b.startsWith(d)&&b.length>d.length&&c.push({profile:a,source:b.slice(d.length)})}return c.push({profile:h,source:b}),c},"hermesProjectPath",0,function(a,b){return`hermes:${a}:${b}`},"hermesRoot",0,i,"listHermesProfiles",0,j])},2726,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[externals]__0ilfh9m._.js","server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_11bnuzn._.js"].map(b=>a.l(b))).then(()=>b(74493)))},6188,a=>{a.v(a=>Promise.resolve().then(()=>a(15638)))},84670,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[root-of-the-server]__1v185mo._.js"].map(b=>a.l(b))).then(()=>b(32271)))},10695,a=>{"use strict";var b=a.i(2157),c=a.i(50227),d=a.i(75818);let e={info:0,warn:1,error:2},f=(0,d.logsDir)(),g=!1,h="warn",i=!1,j=f;function k(a){return!function(){if(g)return;g=!0;let a=(process.env.FAILPROOFAI_LOG_LEVEL??"").toLowerCase();("info"===a||"warn"===a||"error"===a)&&(h=a);let b=(process.env.FAILPROOFAI_HOOK_LOG_FILE??"").trim();b&&(i=!0,"1"!==b&&"true"!==b&&(j=b))}(),e[a]>=e[h]}function l(a,b){process.stderr.write(`[failproofai:hook] ${a} ${b}
|
|
2
|
-
`)}function m(a,d){if(i)try{(0,b.existsSync)(j)||(0,b.mkdirSync)(j,{recursive:!0});let e=(0,c.join)(j,"hooks.log");try{if((0,b.statSync)(e).size>=524288){let a=`hooks-${Date.now()}.log`;(0,b.renameSync)(e,(0,c.join)(j,a))}}catch{}let f=new Date().toISOString(),g=`[${f}] ${a} ${d}
|
|
3
|
-
`;(0,b.appendFileSync)(e,g,"utf-8")}catch{}}a.s(["hookLogError",0,function(a){k("error")&&(l("ERROR",a),m("ERROR",a))},"hookLogWarn",0,function(a){k("warn")&&(l("WARN",a),m("WARN",a))}])},49679,a=>{a.v(b=>Promise.all(["server/chunks/ssr/src_hooks_pack-cli_ts_0t7me65._.js"].map(b=>a.l(b))).then(()=>b(31934)))}];
|
|
4
|
-
|
|
5
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__0cg-bgc._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[93695,(a,b,c)=>{b.exports=a.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},95450,a=>{"use strict";a.s(["default",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call the default export of [project]/app/policies/hooks-client.tsx from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/app/policies/hooks-client.tsx","default")},78862,a=>{"use strict";var b=a.i(95450);a.n(b)},3,a=>{"use strict";var b=a.i(7997),c=a.i(717);a.i(70396);var d=a.i(73727),e=a.i(78862);async function f({searchParams:a}){(process.env.FAILPROOFAI_DISABLE_PAGES??"").split(",").map(a=>a.trim()).filter(Boolean).includes("policies")&&(0,d.notFound)();let{tab:g}=await a;return(0,b.jsx)(c.Suspense,{children:(0,b.jsx)(e.default,{initialTab:"policies"===g?"policies":"activity"})})}a.s(["default",0,f,"dynamic",0,"force-dynamic"])},70216,function(a){a.n(a.i(3))},63025,a=>{"use strict";var b=a.i(12948),c=a.i(67436),d=a.i(94331);a.i(70408);let e=(0,b.instrumentModuleGetter)(()=>a.r(70864)),f=(0,b.instrumentModuleGetter)(()=>a.r(65897)),g=(0,b.instrumentModuleGetter)(()=>a.r(43619)),h=(0,b.instrumentModuleGetter)(()=>a.r(13718)),i=(0,b.instrumentModuleGetter)(()=>a.r(18198)),j=(0,b.instrumentModuleGetter)(()=>a.r(94367)),k=["",{children:["policies",{children:["__PAGE__",{},{metadata:{},page:[(0,b.instrumentModuleGetter)(()=>a.r(70216)),"[project]/app/policies/page.tsx"]},[]]},{metadata:{}},[]]},{layout:[e,"[project]/app/layout.tsx"],error:[f,"[project]/app/error.tsx"],"not-found":[g,"[project]/node_modules/next/dist/client/components/builtin/not-found.js"],forbidden:[h,"[project]/node_modules/next/dist/client/components/builtin/forbidden.js"],unauthorized:[i,"[project]/node_modules/next/dist/client/components/builtin/unauthorized.js"],"global-error":[j,"[project]/app/global-error.tsx"]},[]],l=a.r.bind(a),m=a.l.bind(a),n=(0,c.createAppPageEntrypoint)({tree:k,page:"/policies/page",pathname:"/policies",require:l,loadChunk:m,interopDefault:d.interopDefault}),o=n.__next_app__,p=n.routeModule,q=n.handler;a.s(["__next_app__",0,o,"handler",0,q,"routeModule",0,p],25575),a.i(25575);var r=a.i(22922);a.s(["ClientPageRoot",()=>r.ClientPageRoot,"ClientSegmentRoot",()=>r.ClientSegmentRoot,"Fragment",()=>r.Fragment,"HTTPAccessFallbackBoundary",()=>r.HTTPAccessFallbackBoundary,"InstantValidation",()=>r.InstantValidation,"LayoutRouter",()=>r.LayoutRouter,"LoadingBoundaryProvider",()=>r.LoadingBoundaryProvider,"Postpone",()=>r.Postpone,"RenderFromTemplateContext",()=>r.RenderFromTemplateContext,"RootLayoutBoundary",()=>r.RootLayoutBoundary,"SegmentViewNode",()=>r.SegmentViewNode,"SegmentViewStateNode",()=>r.SegmentViewStateNode,"__next_app__",0,o,"captureOwnerStack",()=>r.captureOwnerStack,"collectPrefetchHints",()=>r.collectPrefetchHints,"collectSegmentData",()=>r.collectSegmentData,"createElement",()=>r.createElement,"createMetadataComponents",()=>r.createMetadataComponents,"createPrerenderParamsForClientSegment",()=>r.createPrerenderParamsForClientSegment,"createPrerenderSearchParamsForClientPage",()=>r.createPrerenderSearchParamsForClientPage,"createServerParamsForServerSegment",()=>r.createServerParamsForServerSegment,"createServerSearchParamsForServerPage",()=>r.createServerSearchParamsForServerPage,"createTemporaryReferenceSet",()=>r.createTemporaryReferenceSet,"decodeAction",()=>r.decodeAction,"decodeFormState",()=>r.decodeFormState,"decodeReply",()=>r.decodeReply,"handler",0,q,"isEmptyHTMLPrelude",()=>r.isEmptyHTMLPrelude,"patchFetch",()=>r.patchFetch,"preconnect",()=>r.preconnect,"preloadFont",()=>r.preloadFont,"preloadStyle",()=>r.preloadStyle,"prerender",()=>r.prerender,"prerenderToNodeStream",()=>r.prerenderToNodeStream,"renderToPipeableStream",()=>r.renderToPipeableStream,"renderToReadableStream",()=>r.renderToReadableStream,"routeModule",0,p,"serverHooks",()=>r.serverHooks,"taintObjectReference",()=>r.taintObjectReference],63025)}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__0cpu_mj._.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
module.exports=[74533,(a,b,c)=>{b.exports=a.x("node:child_process",()=>require("node:child_process"))},66680,(a,b,c)=>{b.exports=a.x("node:crypto",()=>require("node:crypto"))},2157,(a,b,c)=>{b.exports=a.x("node:fs",()=>require("node:fs"))},60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},26035,a=>{"use strict";var b=a.i(36359);a.s([],19459),a.i(19459),a.s(["0000a8b66118a0391a4da97c0fc09b21e69423995b",()=>b.getTelemetryConfig],26035)},36359,a=>{"use strict";var b=a.i(37936),c=a.i(69839);a.i(93328);var d=a.i(31920),e=a.i(12072);async function f(){let a=(0,d.isTelemetryEnabled)();return{enabled:a,distinctId:a?(0,c.getInstanceId)():"",apiKey:process.env.FAILPROOFAI_POSTHOG_KEY??"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX",host:process.env.FAILPROOFAI_POSTHOG_HOST??"https://us.i.posthog.com",version:e.version}}(0,a.i(13095).ensureServerEntryExports)([f]),(0,b.registerServerReference)(f,"0000a8b66118a0391a4da97c0fc09b21e69423995b",null),a.s(["getTelemetryConfig",0,f])},31920,a=>{"use strict";var b=a.i(21572);a.s(["isTelemetryEnabled",0,function(){if("1"===process.env.FAILPROOFAI_TELEMETRY_DISABLED)return!1;try{return(0,b.readConfig)().telemetry.enabled}catch{return!0}}])},69839,a=>{"use strict";let b;var c=a.i(2157),d=a.i(50227),e=a.i(60526),f=a.i(66680);a.i(74533);var g=a.i(75818);let h=d.default.join(e.default.homedir(),".failproofai"),i=d.default.join(h,"instance-id");function j(a){return f.default.createHmac("sha256","failproofai-telemetry-v1").update(a).digest("hex")}function k(a){let b;try{if(b=(0,g.telemetryIdFile)(),c.default.readFileSync(b,"utf-8").trim()===a)return}catch{try{b=(0,g.telemetryIdFile)()}catch{return}}try{c.default.mkdirSync(d.default.dirname(b),{recursive:!0});let e=`${b}.${process.pid}.tmp`;c.default.writeFileSync(e,a,{encoding:"utf-8",mode:384}),c.default.renameSync(e,b)}catch{}}a.s(["getInstanceId",0,function(){if(b)return b;let a=function(){try{for(let a of(e.default.platform(),["/etc/machine-id","/var/lib/dbus/machine-id"]))try{let b=c.default.readFileSync(a,"utf-8").trim();if(b)return b}catch{}}catch{}}();if(a)return k(b=j(a)),b;let d=[e.default.hostname(),e.default.homedir(),e.default.platform(),e.default.arch(),e.default.cpus()[0]?.model??""].join(":");return d?k(b=j(d)):k(b=function(){try{let a=c.default.readFileSync(i,"utf-8").trim();if(a)return a}catch{}let a=f.default.randomUUID();try{c.default.mkdirSync(h,{recursive:!0}),c.default.writeFileSync(i,a,"utf-8")}catch{}return a}()),b},"hashToId",0,j])},93328,a=>{"use strict";var b=a.i(69839),c=a.i(31920),d=a.i(12072),e=a.i(79779);e.POSTHOG_API_KEY,a.s(["trackEvent",0,function(a,f){if(!(0,c.isTelemetryEnabled)())return;let g=globalThis.__FAILPROOFAI_POSTHOG__;g&&g.capture({distinctId:(0,b.getInstanceId)(),event:a,properties:{...f,$lib:"failproofai",failproofai_version:d.version,product:e.POSTHOG_PRODUCT}})}])},13095,(a,b,c)=>{"use strict";function d(a){for(let b=0;b<a.length;b++){let c=a[b];if("function"!=typeof c)throw Object.defineProperty(Error(`A "use server" file can only export async functions, found ${typeof c}.
|
|
2
|
-
Read more: https://nextjs.org/docs/messages/invalid-use-server-value`),"__NEXT_ERROR_CODE",{value:"E352",enumerable:!1,configurable:!0})}}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"ensureServerEntryExports",{enumerable:!0,get:function(){return d}})},37936,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"registerServerReference",{enumerable:!0,get:function(){return d.registerServerReference}});let d=a.r(11857)},2726,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[externals]__0vmspq5._.js","server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_11bnuzn._.js"].map(b=>a.l(b))).then(()=>b(74493)))},12072,(a,b,c)=>{b.exports={name:"failproofai",version:"1.0.7",description:"Observability and enforcement for AI agent harnesses. 39 built-in policies hooked into 12 of them — Claude Code, Codex, Cursor, Hermes, OpenClaw and more — blocking the tool call before it runs. Local dashboard included, no account needed.",bin:{failproofai:"./dist/cli.mjs",failproofaid:"./bin/failproofaid-shim.mjs"},files:["bin/","src/","scripts/","lib/","pi-extension/","hermes-plugin/","openclaw-plugin/",".next/standalone/","dist/","README.md"],engines:{node:">=20.9.0",bun:">=1.3.0"},scripts:{predev:"bun run build:cli && bun link",dev:"FAILPROOFAI_TELEMETRY_DISABLED=1 bun scripts/dev.ts --port 8020","build:cli":"bun build --target=node --format=esm --outfile=dist/cli.mjs bin/failproofai.mjs --external posthog-node --external sql.js && node -e \"const fs=require('fs');const c=fs.readFileSync('dist/cli.mjs','utf8');fs.writeFileSync('dist/cli.mjs',c.replace('#!/usr/bin/env bun','#!/usr/bin/env node').replace('// @bun\\n',''))\"","build:worker":"bun build --target=node --format=esm --outfile=dist/worker.mjs bin/failproofai-worker.mjs --external posthog-node --external sql.js",build:"bun build --target=node --format=cjs --outfile=dist/index.js src/index.ts && bun run build:cli && bun run build:worker && bun --bun next build && node -e \"const {cpSync}=require('fs');cpSync('.next/static','.next/standalone/.next/static',{recursive:true});\" && node scripts/prune-standalone.mjs",prestart:"bun run build:cli && bun link",start:"FAILPROOFAI_TELEMETRY_DISABLED=1 bun scripts/start.ts",test:"vitest","test:run":"vitest run",lint:"eslint . --config eslint.config.mjs",prepare:"bun run build","test:e2e":"vitest run --config vitest.config.e2e.mts","test:e2e:watch":"vitest --config vitest.config.e2e.mts",translate:"bun scripts/translate-docs/cli.ts","translate:readme":"bun scripts/translate-docs/cli.ts --readme-only","translate:docs":"bun scripts/translate-docs/cli.ts --docs-only","translate:dry-run":"bun scripts/translate-docs/cli.ts --dry-run","translate:validate":"bun scripts/translate-docs/cli.ts --validate","validate:mdx":"bun scripts/validate-mdx.ts","docs:audit":"bun scripts/docs-audit.ts","build:pack":"bun scripts/build-policy-pack.mjs"},keywords:["agent-observability","llm-observability","agent-tracing","agent-monitoring","agent-harness","guardrails","enforcement","policies","evals","ai-agent","autonomous-agent","agent-reliability","failure-prevention","claude-code","codex","hermes","openclaw","cli","local-first","hooks"],author:"ExosphereHost Inc. <failproofai@exosphere.host>",license:"SEE LICENSE IN LICENSE",homepage:"https://github.com/FailproofAI/failproofai",repository:{type:"git",url:"https://github.com/FailproofAI/failproofai.git"},bugs:{url:"https://github.com/FailproofAI/failproofai/issues"},publishConfig:{access:"public"},devDependencies:{"@anthropic-ai/sdk":"^0.127.0","@mdx-js/mdx":"^3.1.1","@tailwindcss/postcss":"^4.3.1","@tanstack/react-virtual":"^3.14.10","@testing-library/jest-dom":"^7.0.0","@testing-library/react":"^16.3.2","@testing-library/user-event":"^14.6.5","@types/node":"26.6.1","@types/react":"19.3.0","@types/react-dom":"^19.2.3","@vitejs/plugin-react":"^6.1.0",clsx:"^2.1.1",eslint:"^10.9.0","eslint-config-next":"^16.3.2",jsdom:"^30.0.1","lucide-react":"^1.33.0",next:"^16.3.2",react:"^19.2.4","react-dom":"^19.2.4","tailwind-merge":"^3.4.0",tailwindcss:"^4.3.1",typescript:"6.0.3",vitest:"^5.0.0"},dependencies:{"html-to-image":"^1.11.13","posthog-node":"^5.50.0","sql.js":"^1.14.1",yaml:"^2.9.0"},overrides:{nanoid:"3.3.18",postcss:"8.5.26","eslint-plugin-react-hooks":"7.0.1",vite:"8.0.16",undici:"7.29.0","brace-expansion":"5.0.9",sharp:"0.35.4",browserslist:"4.28.8"},optionalDependencies:{"@failproofai/failproofaid-linux-x64":"1.0.7","@failproofai/failproofaid-linux-arm64":"1.0.7","@failproofai/failproofaid-darwin-x64":"1.0.7","@failproofai/failproofaid-darwin-arm64":"1.0.7"},failproofaidBinaries:{"linux-x64":"65acfcabaa4dda6d37d2958d4100c366a85f17c68d2250de6126e2717ca773e6","linux-arm64":"cece883f87d53034003be8f0f293aa89bd0e69306d6032e17b3eb91f230b3ce2","darwin-x64":"565aa3d560a05dd76e2eb843ddbad593d2d8df94c963bdeb1c7e2a8a3816d0c5","darwin-arm64":"2b41601b53e77a31439e92d8be9be6b9872e3d4ad7e8664ff89cd2be4ed6c44d"}}},79779,a=>{"use strict";a.s(["POSTHOG_API_KEY",0,"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX","POSTHOG_PRODUCT",0,"failproofai-oss"])}];
|
|
3
|
-
|
|
4
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__0da85px._.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
module.exports=[74533,(a,b,c)=>{b.exports=a.x("node:child_process",()=>require("node:child_process"))},66680,(a,b,c)=>{b.exports=a.x("node:crypto",()=>require("node:crypto"))},2157,(a,b,c)=>{b.exports=a.x("node:fs",()=>require("node:fs"))},60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},36359,a=>{"use strict";var b=a.i(37936),c=a.i(69839);a.i(93328);var d=a.i(31920),e=a.i(12072);async function f(){let a=(0,d.isTelemetryEnabled)();return{enabled:a,distinctId:a?(0,c.getInstanceId)():"",apiKey:process.env.FAILPROOFAI_POSTHOG_KEY??"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX",host:process.env.FAILPROOFAI_POSTHOG_HOST??"https://us.i.posthog.com",version:e.version}}(0,a.i(13095).ensureServerEntryExports)([f]),(0,b.registerServerReference)(f,"0000a8b66118a0391a4da97c0fc09b21e69423995b",null),a.s(["getTelemetryConfig",0,f])},8674,a=>{"use strict";var b=a.i(2157),c=a.i(50227),d=a.i(66680);a.s(["writeJsonAtomically",0,function(a,e,f={}){let g=f.mode??384,h=f.dirMode??448,i=(0,c.dirname)(a);(0,b.existsSync)(i)||(0,b.mkdirSync)(i,{recursive:!0,mode:h});let j=`${a}.${process.pid}.${(0,d.randomBytes)(6).toString("hex")}.tmp`;try{(0,b.writeFileSync)(j,JSON.stringify(e,null,2),{mode:g});try{(63&(0,b.statSync)(j).mode)!=0&&(0,b.chmodSync)(j,g)}catch{}(0,b.renameSync)(j,a);try{(63&(0,b.statSync)(a).mode)!=0&&(0,b.chmodSync)(a,g)}catch{}}catch(a){try{(0,b.rmSync)(j,{force:!0})}catch{}throw a}}])},31920,a=>{"use strict";var b=a.i(21572);a.s(["isTelemetryEnabled",0,function(){if("1"===process.env.FAILPROOFAI_TELEMETRY_DISABLED)return!1;try{return(0,b.readConfig)().telemetry.enabled}catch{return!0}}])},69839,a=>{"use strict";let b;var c=a.i(2157),d=a.i(50227),e=a.i(60526),f=a.i(66680);a.i(74533);var g=a.i(75818);let h=d.default.join(e.default.homedir(),".failproofai"),i=d.default.join(h,"instance-id");function j(a){return f.default.createHmac("sha256","failproofai-telemetry-v1").update(a).digest("hex")}function k(a){let b;try{if(b=(0,g.telemetryIdFile)(),c.default.readFileSync(b,"utf-8").trim()===a)return}catch{try{b=(0,g.telemetryIdFile)()}catch{return}}try{c.default.mkdirSync(d.default.dirname(b),{recursive:!0});let e=`${b}.${process.pid}.tmp`;c.default.writeFileSync(e,a,{encoding:"utf-8",mode:384}),c.default.renameSync(e,b)}catch{}}a.s(["getInstanceId",0,function(){if(b)return b;let a=function(){try{for(let a of(e.default.platform(),["/etc/machine-id","/var/lib/dbus/machine-id"]))try{let b=c.default.readFileSync(a,"utf-8").trim();if(b)return b}catch{}}catch{}}();if(a)return k(b=j(a)),b;let d=[e.default.hostname(),e.default.homedir(),e.default.platform(),e.default.arch(),e.default.cpus()[0]?.model??""].join(":");return d?k(b=j(d)):k(b=function(){try{let a=c.default.readFileSync(i,"utf-8").trim();if(a)return a}catch{}let a=f.default.randomUUID();try{c.default.mkdirSync(h,{recursive:!0}),c.default.writeFileSync(i,a,"utf-8")}catch{}return a}()),b},"hashToId",0,j])},93328,a=>{"use strict";var b=a.i(69839),c=a.i(31920),d=a.i(12072),e=a.i(79779);e.POSTHOG_API_KEY,a.s(["trackEvent",0,function(a,f){if(!(0,c.isTelemetryEnabled)())return;let g=globalThis.__FAILPROOFAI_POSTHOG__;g&&g.capture({distinctId:(0,b.getInstanceId)(),event:a,properties:{...f,$lib:"failproofai",failproofai_version:d.version,product:e.POSTHOG_PRODUCT}})}])},13095,(a,b,c)=>{"use strict";function d(a){for(let b=0;b<a.length;b++){let c=a[b];if("function"!=typeof c)throw Object.defineProperty(Error(`A "use server" file can only export async functions, found ${typeof c}.
|
|
2
|
-
Read more: https://nextjs.org/docs/messages/invalid-use-server-value`),"__NEXT_ERROR_CODE",{value:"E352",enumerable:!1,configurable:!0})}}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"ensureServerEntryExports",{enumerable:!0,get:function(){return d}})},37936,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"registerServerReference",{enumerable:!0,get:function(){return d.registerServerReference}});let d=a.r(11857)},12072,(a,b,c)=>{b.exports={name:"failproofai",version:"1.0.7",description:"Observability and enforcement for AI agent harnesses. 39 built-in policies hooked into 12 of them — Claude Code, Codex, Cursor, Hermes, OpenClaw and more — blocking the tool call before it runs. Local dashboard included, no account needed.",bin:{failproofai:"./dist/cli.mjs",failproofaid:"./bin/failproofaid-shim.mjs"},files:["bin/","src/","scripts/","lib/","pi-extension/","hermes-plugin/","openclaw-plugin/",".next/standalone/","dist/","README.md"],engines:{node:">=20.9.0",bun:">=1.3.0"},scripts:{predev:"bun run build:cli && bun link",dev:"FAILPROOFAI_TELEMETRY_DISABLED=1 bun scripts/dev.ts --port 8020","build:cli":"bun build --target=node --format=esm --outfile=dist/cli.mjs bin/failproofai.mjs --external posthog-node --external sql.js && node -e \"const fs=require('fs');const c=fs.readFileSync('dist/cli.mjs','utf8');fs.writeFileSync('dist/cli.mjs',c.replace('#!/usr/bin/env bun','#!/usr/bin/env node').replace('// @bun\\n',''))\"","build:worker":"bun build --target=node --format=esm --outfile=dist/worker.mjs bin/failproofai-worker.mjs --external posthog-node --external sql.js",build:"bun build --target=node --format=cjs --outfile=dist/index.js src/index.ts && bun run build:cli && bun run build:worker && bun --bun next build && node -e \"const {cpSync}=require('fs');cpSync('.next/static','.next/standalone/.next/static',{recursive:true});\" && node scripts/prune-standalone.mjs",prestart:"bun run build:cli && bun link",start:"FAILPROOFAI_TELEMETRY_DISABLED=1 bun scripts/start.ts",test:"vitest","test:run":"vitest run",lint:"eslint . --config eslint.config.mjs",prepare:"bun run build","test:e2e":"vitest run --config vitest.config.e2e.mts","test:e2e:watch":"vitest --config vitest.config.e2e.mts",translate:"bun scripts/translate-docs/cli.ts","translate:readme":"bun scripts/translate-docs/cli.ts --readme-only","translate:docs":"bun scripts/translate-docs/cli.ts --docs-only","translate:dry-run":"bun scripts/translate-docs/cli.ts --dry-run","translate:validate":"bun scripts/translate-docs/cli.ts --validate","validate:mdx":"bun scripts/validate-mdx.ts","docs:audit":"bun scripts/docs-audit.ts","build:pack":"bun scripts/build-policy-pack.mjs"},keywords:["agent-observability","llm-observability","agent-tracing","agent-monitoring","agent-harness","guardrails","enforcement","policies","evals","ai-agent","autonomous-agent","agent-reliability","failure-prevention","claude-code","codex","hermes","openclaw","cli","local-first","hooks"],author:"ExosphereHost Inc. <failproofai@exosphere.host>",license:"SEE LICENSE IN LICENSE",homepage:"https://github.com/FailproofAI/failproofai",repository:{type:"git",url:"https://github.com/FailproofAI/failproofai.git"},bugs:{url:"https://github.com/FailproofAI/failproofai/issues"},publishConfig:{access:"public"},devDependencies:{"@anthropic-ai/sdk":"^0.127.0","@mdx-js/mdx":"^3.1.1","@tailwindcss/postcss":"^4.3.1","@tanstack/react-virtual":"^3.14.10","@testing-library/jest-dom":"^7.0.0","@testing-library/react":"^16.3.2","@testing-library/user-event":"^14.6.5","@types/node":"26.6.1","@types/react":"19.3.0","@types/react-dom":"^19.2.3","@vitejs/plugin-react":"^6.1.0",clsx:"^2.1.1",eslint:"^10.9.0","eslint-config-next":"^16.3.2",jsdom:"^30.0.1","lucide-react":"^1.33.0",next:"^16.3.2",react:"^19.2.4","react-dom":"^19.2.4","tailwind-merge":"^3.4.0",tailwindcss:"^4.3.1",typescript:"6.0.3",vitest:"^5.0.0"},dependencies:{"html-to-image":"^1.11.13","posthog-node":"^5.50.0","sql.js":"^1.14.1",yaml:"^2.9.0"},overrides:{nanoid:"3.3.18",postcss:"8.5.26","eslint-plugin-react-hooks":"7.0.1",vite:"8.0.16",undici:"7.29.0","brace-expansion":"5.0.9",sharp:"0.35.4",browserslist:"4.28.8"},optionalDependencies:{"@failproofai/failproofaid-linux-x64":"1.0.7","@failproofai/failproofaid-linux-arm64":"1.0.7","@failproofai/failproofaid-darwin-x64":"1.0.7","@failproofai/failproofaid-darwin-arm64":"1.0.7"},failproofaidBinaries:{"linux-x64":"65acfcabaa4dda6d37d2958d4100c366a85f17c68d2250de6126e2717ca773e6","linux-arm64":"cece883f87d53034003be8f0f293aa89bd0e69306d6032e17b3eb91f230b3ce2","darwin-x64":"565aa3d560a05dd76e2eb843ddbad593d2d8df94c963bdeb1c7e2a8a3816d0c5","darwin-arm64":"2b41601b53e77a31439e92d8be9be6b9872e3d4ad7e8664ff89cd2be4ed6c44d"}}},15501,a=>{"use strict";var b=a.i(2157);a.i(8674);var c=a.i(75818);function d(){return(0,c.auditDashboardFile)()}a.s(["readDashboardCache",0,function(){let a=d();if(!(0,b.existsSync)(a))return null;try{let c=(0,b.readFileSync)(a,"utf-8"),d=JSON.parse(c);if(!d||"object"!=typeof d||"string"!=typeof d.cachedAt||!d.params||"object"!=typeof d.params||!d.result||"object"!=typeof d.result||2!==d.schemaVersion||function(a,b=30){let c=new Date(a).getTime();return!!Number.isNaN(c)||Date.now()-c>6e4*b}(d.cachedAt,10080))return null;return d}catch{return null}},"readDashboardCacheMeta",0,function(){let a=d();if(!(0,b.existsSync)(a))return null;try{let c=(0,b.readFileSync)(a,"utf-8"),d=JSON.parse(c);if(!d||2!==d.schemaVersion||"string"!=typeof d.cachedAt||Number.isNaN(new Date(d.cachedAt).getTime()))return null;let e=d.result,f=a=>"number"==typeof a&&Number.isFinite(a)?a:null;return{cachedAt:d.cachedAt,findings:f(e?.totals?.hits),sessionsScanned:f(e?.transcripts?.scanned),eventsScanned:f(e?.eventsScanned)}}catch{return null}}])},79779,a=>{"use strict";a.s(["POSTHOG_API_KEY",0,"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX","POSTHOG_PRODUCT",0,"failproofai-oss"])}];
|
|
3
|
-
|
|
4
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__0ftmoxc._.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
module.exports=[74533,(a,b,c)=>{b.exports=a.x("node:child_process",()=>require("node:child_process"))},66680,(a,b,c)=>{b.exports=a.x("node:crypto",()=>require("node:crypto"))},2157,(a,b,c)=>{b.exports=a.x("node:fs",()=>require("node:fs"))},60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},24190,a=>{"use strict";var b=a.i(36359);a.s([],40488),a.i(40488),a.s(["0000a8b66118a0391a4da97c0fc09b21e69423995b",()=>b.getTelemetryConfig],24190)},36359,a=>{"use strict";var b=a.i(37936),c=a.i(69839);a.i(93328);var d=a.i(31920),e=a.i(12072);async function f(){let a=(0,d.isTelemetryEnabled)();return{enabled:a,distinctId:a?(0,c.getInstanceId)():"",apiKey:process.env.FAILPROOFAI_POSTHOG_KEY??"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX",host:process.env.FAILPROOFAI_POSTHOG_HOST??"https://us.i.posthog.com",version:e.version}}(0,a.i(13095).ensureServerEntryExports)([f]),(0,b.registerServerReference)(f,"0000a8b66118a0391a4da97c0fc09b21e69423995b",null),a.s(["getTelemetryConfig",0,f])},31920,a=>{"use strict";var b=a.i(21572);a.s(["isTelemetryEnabled",0,function(){if("1"===process.env.FAILPROOFAI_TELEMETRY_DISABLED)return!1;try{return(0,b.readConfig)().telemetry.enabled}catch{return!0}}])},69839,a=>{"use strict";let b;var c=a.i(2157),d=a.i(50227),e=a.i(60526),f=a.i(66680);a.i(74533);var g=a.i(75818);let h=d.default.join(e.default.homedir(),".failproofai"),i=d.default.join(h,"instance-id");function j(a){return f.default.createHmac("sha256","failproofai-telemetry-v1").update(a).digest("hex")}function k(a){let b;try{if(b=(0,g.telemetryIdFile)(),c.default.readFileSync(b,"utf-8").trim()===a)return}catch{try{b=(0,g.telemetryIdFile)()}catch{return}}try{c.default.mkdirSync(d.default.dirname(b),{recursive:!0});let e=`${b}.${process.pid}.tmp`;c.default.writeFileSync(e,a,{encoding:"utf-8",mode:384}),c.default.renameSync(e,b)}catch{}}a.s(["getInstanceId",0,function(){if(b)return b;let a=function(){try{for(let a of(e.default.platform(),["/etc/machine-id","/var/lib/dbus/machine-id"]))try{let b=c.default.readFileSync(a,"utf-8").trim();if(b)return b}catch{}}catch{}}();if(a)return k(b=j(a)),b;let d=[e.default.hostname(),e.default.homedir(),e.default.platform(),e.default.arch(),e.default.cpus()[0]?.model??""].join(":");return d?k(b=j(d)):k(b=function(){try{let a=c.default.readFileSync(i,"utf-8").trim();if(a)return a}catch{}let a=f.default.randomUUID();try{c.default.mkdirSync(h,{recursive:!0}),c.default.writeFileSync(i,a,"utf-8")}catch{}return a}()),b},"hashToId",0,j])},93328,a=>{"use strict";var b=a.i(69839),c=a.i(31920),d=a.i(12072),e=a.i(79779);e.POSTHOG_API_KEY,a.s(["trackEvent",0,function(a,f){if(!(0,c.isTelemetryEnabled)())return;let g=globalThis.__FAILPROOFAI_POSTHOG__;g&&g.capture({distinctId:(0,b.getInstanceId)(),event:a,properties:{...f,$lib:"failproofai",failproofai_version:d.version,product:e.POSTHOG_PRODUCT}})}])},13095,(a,b,c)=>{"use strict";function d(a){for(let b=0;b<a.length;b++){let c=a[b];if("function"!=typeof c)throw Object.defineProperty(Error(`A "use server" file can only export async functions, found ${typeof c}.
|
|
2
|
-
Read more: https://nextjs.org/docs/messages/invalid-use-server-value`),"__NEXT_ERROR_CODE",{value:"E352",enumerable:!1,configurable:!0})}}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"ensureServerEntryExports",{enumerable:!0,get:function(){return d}})},37936,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"registerServerReference",{enumerable:!0,get:function(){return d.registerServerReference}});let d=a.r(11857)},2726,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[externals]__0vmspq5._.js","server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_11bnuzn._.js"].map(b=>a.l(b))).then(()=>b(74493)))},12072,(a,b,c)=>{b.exports={name:"failproofai",version:"1.0.7",description:"Observability and enforcement for AI agent harnesses. 39 built-in policies hooked into 12 of them — Claude Code, Codex, Cursor, Hermes, OpenClaw and more — blocking the tool call before it runs. Local dashboard included, no account needed.",bin:{failproofai:"./dist/cli.mjs",failproofaid:"./bin/failproofaid-shim.mjs"},files:["bin/","src/","scripts/","lib/","pi-extension/","hermes-plugin/","openclaw-plugin/",".next/standalone/","dist/","README.md"],engines:{node:">=20.9.0",bun:">=1.3.0"},scripts:{predev:"bun run build:cli && bun link",dev:"FAILPROOFAI_TELEMETRY_DISABLED=1 bun scripts/dev.ts --port 8020","build:cli":"bun build --target=node --format=esm --outfile=dist/cli.mjs bin/failproofai.mjs --external posthog-node --external sql.js && node -e \"const fs=require('fs');const c=fs.readFileSync('dist/cli.mjs','utf8');fs.writeFileSync('dist/cli.mjs',c.replace('#!/usr/bin/env bun','#!/usr/bin/env node').replace('// @bun\\n',''))\"","build:worker":"bun build --target=node --format=esm --outfile=dist/worker.mjs bin/failproofai-worker.mjs --external posthog-node --external sql.js",build:"bun build --target=node --format=cjs --outfile=dist/index.js src/index.ts && bun run build:cli && bun run build:worker && bun --bun next build && node -e \"const {cpSync}=require('fs');cpSync('.next/static','.next/standalone/.next/static',{recursive:true});\" && node scripts/prune-standalone.mjs",prestart:"bun run build:cli && bun link",start:"FAILPROOFAI_TELEMETRY_DISABLED=1 bun scripts/start.ts",test:"vitest","test:run":"vitest run",lint:"eslint . --config eslint.config.mjs",prepare:"bun run build","test:e2e":"vitest run --config vitest.config.e2e.mts","test:e2e:watch":"vitest --config vitest.config.e2e.mts",translate:"bun scripts/translate-docs/cli.ts","translate:readme":"bun scripts/translate-docs/cli.ts --readme-only","translate:docs":"bun scripts/translate-docs/cli.ts --docs-only","translate:dry-run":"bun scripts/translate-docs/cli.ts --dry-run","translate:validate":"bun scripts/translate-docs/cli.ts --validate","validate:mdx":"bun scripts/validate-mdx.ts","docs:audit":"bun scripts/docs-audit.ts","build:pack":"bun scripts/build-policy-pack.mjs"},keywords:["agent-observability","llm-observability","agent-tracing","agent-monitoring","agent-harness","guardrails","enforcement","policies","evals","ai-agent","autonomous-agent","agent-reliability","failure-prevention","claude-code","codex","hermes","openclaw","cli","local-first","hooks"],author:"ExosphereHost Inc. <failproofai@exosphere.host>",license:"SEE LICENSE IN LICENSE",homepage:"https://github.com/FailproofAI/failproofai",repository:{type:"git",url:"https://github.com/FailproofAI/failproofai.git"},bugs:{url:"https://github.com/FailproofAI/failproofai/issues"},publishConfig:{access:"public"},devDependencies:{"@anthropic-ai/sdk":"^0.127.0","@mdx-js/mdx":"^3.1.1","@tailwindcss/postcss":"^4.3.1","@tanstack/react-virtual":"^3.14.10","@testing-library/jest-dom":"^7.0.0","@testing-library/react":"^16.3.2","@testing-library/user-event":"^14.6.5","@types/node":"26.6.1","@types/react":"19.3.0","@types/react-dom":"^19.2.3","@vitejs/plugin-react":"^6.1.0",clsx:"^2.1.1",eslint:"^10.9.0","eslint-config-next":"^16.3.2",jsdom:"^30.0.1","lucide-react":"^1.33.0",next:"^16.3.2",react:"^19.2.4","react-dom":"^19.2.4","tailwind-merge":"^3.4.0",tailwindcss:"^4.3.1",typescript:"6.0.3",vitest:"^5.0.0"},dependencies:{"html-to-image":"^1.11.13","posthog-node":"^5.50.0","sql.js":"^1.14.1",yaml:"^2.9.0"},overrides:{nanoid:"3.3.18",postcss:"8.5.26","eslint-plugin-react-hooks":"7.0.1",vite:"8.0.16",undici:"7.29.0","brace-expansion":"5.0.9",sharp:"0.35.4",browserslist:"4.28.8"},optionalDependencies:{"@failproofai/failproofaid-linux-x64":"1.0.7","@failproofai/failproofaid-linux-arm64":"1.0.7","@failproofai/failproofaid-darwin-x64":"1.0.7","@failproofai/failproofaid-darwin-arm64":"1.0.7"},failproofaidBinaries:{"linux-x64":"65acfcabaa4dda6d37d2958d4100c366a85f17c68d2250de6126e2717ca773e6","linux-arm64":"cece883f87d53034003be8f0f293aa89bd0e69306d6032e17b3eb91f230b3ce2","darwin-x64":"565aa3d560a05dd76e2eb843ddbad593d2d8df94c963bdeb1c7e2a8a3816d0c5","darwin-arm64":"2b41601b53e77a31439e92d8be9be6b9872e3d4ad7e8664ff89cd2be4ed6c44d"}}},79779,a=>{"use strict";a.s(["POSTHOG_API_KEY",0,"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX","POSTHOG_PRODUCT",0,"failproofai-oss"])}];
|
|
3
|
-
|
|
4
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__0p-5p8u._.js.map
|