failproofai 1.0.4-beta.8 → 1.0.4
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 +5 -5
- package/.next/standalone/.next/prerender-manifest.json +4 -4
- package/.next/standalone/.next/required-server-files.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page.js +2 -2
- package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +7 -7
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +6 -6
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js +2 -2
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +14 -14
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +14 -14
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +13 -13
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/api/audit/invite/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/audit/run/route.js +4 -4
- package/.next/standalone/.next/server/app/api/audit/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/audit/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/login-request/route.js.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 +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/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/audit/page/server-reference-manifest.json +4 -37
- package/.next/standalone/.next/server/app/audit/page.js +2 -2
- package/.next/standalone/.next/server/app/audit/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/audit/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +14 -14
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +13 -13
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +14 -14
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/page.js +2 -2
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/policies/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +14 -14
- package/.next/standalone/.next/server/app/policies/page.js +4 -4
- package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page.js +4 -4
- package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js +5 -5
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/projects/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/projects/page.js +3 -3
- package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +4 -15
- package/.next/standalone/.next/server/app/settings/page.js +4 -4
- 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]__0hmcwgg._.js → [externals]__0-9ti7z._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{[externals]__14b7cc6._.js → [externals]__0u3wrvq._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0-219ec._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__04_h-a5._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__08dchfu._.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]__0rv7m0k._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__17g9wh7._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1le9jqc._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1legmza._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1p-qi2t._.js +5 -0
- 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/{_1_eakl4._.js → _1-akg6w._.js} +2 -2
- package/.next/standalone/.next/server/chunks/_1ek68ln._.js +10 -10
- package/.next/standalone/.next/server/chunks/_1vslkoe._.js +1 -1
- package/.next/standalone/.next/server/chunks/lib_telemetry_ts_0dctyyw._.js +1 -1
- package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4v._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_hooks_fp-home_ts_09kv0bn._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__187jks6._.js → [root-of-the-server]__00-s7h8._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__013jr2b._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01wy8d-._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02npjtd._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1fa1jd9._.js → [root-of-the-server]__09flfsx._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0da85px._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ftmoxc._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0kokc8z._.js → [root-of-the-server]__0n_lxhg._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0oa1lav._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0p-5p8u._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0s740oi._.js +6 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1kpd1za._.js → [root-of-the-server]__190won8._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1ctpynv._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1nq7ivq._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1p2otjt._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__00y9ww2._.js → [root-of-the-server]__1sc84bb._.js} +2 -21
- package/.next/standalone/.next/server/chunks/ssr/_02yoeej._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_00bqkhj._.js → _04rbnaq._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_08x1r5t._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0s-77v5._.js → _0h_douw._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1_ozgif._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1ddpc5g._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1es2j7i._.js +14 -51
- package/.next/standalone/.next/server/chunks/ssr/{_14c6q09._.js → _1if9ixi._.js} +2 -21
- package/.next/standalone/.next/server/chunks/ssr/{_07t3jol._.js → _1u8-lu2._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_1ylae7o._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_1zopuov._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_next-internal_server_app_policies_page_actions_1sp2-yo.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/app_audit__components_audit-dashboard_tsx_0p9ud47._.js +69 -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 +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_settings_settings-client_tsx_20lq-mq._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/lib_openclaw-projects_ts_0qxq3bp._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_13n822a._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_html-to-image_es_index_1ao30b1.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_builtin-policies_ts_09j2ndl._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_fp-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/middleware-build-manifest.js +5 -5
- 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 +21 -65
- package/.next/standalone/.next/static/chunks/{1302duobnz07l.js → 0-tyrpwuc3lla.js} +1 -1
- package/.next/standalone/.next/static/chunks/0ca7octhod0g2.js +69 -0
- package/.next/standalone/.next/static/chunks/0u64yey446k4f.css +1 -0
- package/.next/standalone/.next/static/chunks/{2n85g-crgcx5j.js → 1j6o9min_6qa9.js} +1 -1
- package/.next/standalone/.next/static/chunks/27cl8h-c2w7cd.js +1 -0
- package/.next/standalone/.next/static/chunks/{0jpd8dv2vk930.css → 29-iqnp9v_axt.css} +1 -1
- package/.next/standalone/.next/static/chunks/{3uyhmm01g64k4.css → 2k9f4tyv04809.css} +0 -1
- package/.next/standalone/.next/static/chunks/{1chm9piluggc-.js → 2lwipmv5etc8m.js} +1 -1
- package/.next/standalone/.next/static/chunks/2pd16tn5qmx13.js +1 -0
- package/.next/standalone/.next/static/chunks/{2ukucf6g-kbs5.js → 2u8vh73tpw28_.js} +1 -1
- package/.next/standalone/.next/static/chunks/{1_x7pqemw5n_w.js → 31u94yukw9fz-.js} +1 -1
- package/.next/standalone/.next/static/chunks/{2mizt96igig1y.js → 3p9_8x5ezce-9.js} +1 -1
- package/.next/standalone/.next/static/chunks/3qfoeqhy5l10x.js +1 -0
- package/.next/standalone/.next/static/chunks/{0vm4wdx3w-2_w.js → 3tjji451hrgc0.js} +1 -1
- package/.next/standalone/.next/static/chunks/3zkg2s2vzxc3d.js +1 -0
- package/.next/standalone/.next/static/chunks/{turbopack-3s3c-u_u_l0u9.js → turbopack-3p73obe0xmrxm.js} +1 -1
- package/.next/standalone/.opencode/plugins/failproofai.mjs +27 -51
- package/.next/standalone/app/actions/get-scheduled-audit.ts +0 -5
- package/.next/standalone/app/actions/update-scheduled-audit.ts +57 -18
- package/.next/standalone/app/api/auth/status/route.ts +2 -3
- package/.next/standalone/app/audit/_components/audit-dashboard.tsx +34 -140
- package/.next/standalone/app/audit/_components/audit-poster.tsx +10 -29
- package/.next/standalone/app/audit/_components/come-back-better-section.tsx +1 -6
- package/.next/standalone/app/audit/_components/empty-state.tsx +1 -4
- package/.next/standalone/app/audit/_components/how-to-improve-section.tsx +5 -19
- package/.next/standalone/app/audit/_components/share-templates.ts +44 -110
- package/.next/standalone/app/audit/audit-styles.css +1 -132
- package/.next/standalone/app/settings/page.tsx +1 -1
- package/.next/standalone/app/settings/settings-client.tsx +45 -50
- package/.next/standalone/lib/auth/api-server-client.ts +5 -33
- package/.next/standalone/lib/claude-sessions.ts +27 -101
- package/.next/standalone/lib/codex-sessions.ts +4 -20
- package/.next/standalone/lib/copilot-sessions.ts +1 -32
- package/.next/standalone/lib/cursor-sessions.ts +5 -62
- package/.next/standalone/lib/download-session.ts +13 -58
- package/.next/standalone/lib/openclaw-projects.ts +18 -54
- package/.next/standalone/lib/openclaw-sessions.ts +17 -75
- package/.next/standalone/lib/sqlite-reader.ts +1 -78
- package/.next/standalone/package.json +9 -9
- package/.next/standalone/server.js +1 -1
- package/bin/failproofai.mjs +1 -1
- package/dist/cli.mjs +664 -2121
- package/dist/worker.mjs +105 -422
- package/lib/auth/api-server-client.ts +5 -33
- package/lib/claude-sessions.ts +27 -101
- package/lib/codex-sessions.ts +4 -20
- package/lib/copilot-sessions.ts +1 -32
- package/lib/cursor-sessions.ts +5 -62
- package/lib/download-session.ts +13 -58
- package/lib/openclaw-projects.ts +18 -54
- package/lib/openclaw-sessions.ts +17 -75
- package/lib/sqlite-reader.ts +1 -78
- package/package.json +9 -9
- package/pi-extension/index.ts +5 -50
- package/src/audit/cache.ts +0 -6
- package/src/audit/cli-adapters/claude.ts +0 -13
- package/src/audit/cli-login.ts +1 -4
- package/src/audit/cli.ts +7 -157
- package/src/audit/harm-report.ts +4 -111
- package/src/audit/index.ts +15 -286
- package/src/audit/machine-store.ts +9 -8
- package/src/audit/redact-example.ts +15 -324
- package/src/audit/report-harm.ts +37 -33
- package/src/audit/report.ts +3 -6
- package/src/audit/schedule-cli.ts +33 -54
- package/src/audit/scoring.ts +0 -49
- package/src/audit/types.ts +0 -52
- package/src/hooks/builtin-policies.ts +2 -67
- package/src/hooks/configure-wizard.ts +0 -55
- package/src/hooks/fp-config.ts +48 -83
- package/src/hooks/fp-home.ts +0 -27
- package/src/hooks/integrations.ts +14 -51
- package/src/hooks/uninstall-cli.ts +2 -17
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0faqz9x._.js +0 -22
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0zyc_nm._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__112b4go._.js +0 -24
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1l71g3y._.js +0 -22
- package/.next/standalone/.next/server/chunks/lib_openclaw-projects_ts_0gc-p24._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0-4ja6q._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__00cr3xu._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__04px77e._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0egr5s1._.js +0 -6
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0i0l1di._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0n2txhk._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0r3c1_0._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__17xnxlx._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1ckpmkk._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1kaotix._.js +0 -22
- package/.next/standalone/.next/server/chunks/ssr/_04ng_6x._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0l2hi_d._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/app_audit__components_rerun-button_tsx_0blihgw._.js +0 -3
- package/.next/standalone/.next/static/chunks/0igq884ziuv-8.js +0 -1
- package/.next/standalone/.next/static/chunks/349jkb79v5g6z.js +0 -1
- package/.next/standalone/.next/static/chunks/3a4gth64hwtwf.js +0 -1
- package/.next/standalone/app/actions/get-leaks.ts +0 -104
- package/.next/standalone/app/audit/_components/leak-section.tsx +0 -192
- package/.next/standalone/lib/openclaw-db.ts +0 -271
- package/lib/openclaw-db.ts +0 -271
- package/src/audit/desktop-notify.ts +0 -420
- package/src/audit/leak-fingerprint.ts +0 -198
- package/src/audit/leak-record.ts +0 -248
- package/src/audit/leak-scan.ts +0 -268
- package/src/audit/leak-store.ts +0 -220
- package/src/audit/macos-notifier.ts +0 -298
- package/src/hooks/notice.ts +0 -24
- /package/.next/standalone/.next/static/{DNhaAH8iPGH0tIuxee5_2 → dg8VQ7Ejlo0Qsh_x92oIt}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{DNhaAH8iPGH0tIuxee5_2 → dg8VQ7Ejlo0Qsh_x92oIt}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{DNhaAH8iPGH0tIuxee5_2 → dg8VQ7Ejlo0Qsh_x92oIt}/_ssgManifest.js +0 -0
package/dist/worker.mjs
CHANGED
|
@@ -2805,39 +2805,15 @@ var init_builtin_policies = __esm(() => {
|
|
|
2805
2805
|
SHELL_METACHAR_RE = /[;&<>`$()\\]/;
|
|
2806
2806
|
JWT_RE = /eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}/;
|
|
2807
2807
|
API_KEY_PATTERNS = [
|
|
2808
|
-
[/sk-ant-api03-[A-Za-z0-9\-_]{20,}/, "Anthropic API key"],
|
|
2809
|
-
[/sk-ant-oat01-[A-Za-z0-9\-_]{20,}/, "Anthropic OAuth token"],
|
|
2810
2808
|
[/sk-ant-[A-Za-z0-9\-_]{20,}/, "Anthropic API key"],
|
|
2811
2809
|
[/sk-proj-[A-Za-z0-9\-_]{20,}/, "OpenAI project API key"],
|
|
2812
|
-
[/
|
|
2813
|
-
[/(?<!\w)sk-admin-[A-Za-z0-9\-_]{20,}/, "OpenAI admin key"],
|
|
2814
|
-
[/sk-or-v1-[A-Za-z0-9\-_]{20,}/, "OpenRouter API key"],
|
|
2815
|
-
[/sk-[A-Za-z0-9]{20,}/, "OpenAI-compatible key (issuer unknown)"],
|
|
2816
|
-
[/github_pat_[A-Za-z0-9_]{82}/, "GitHub fine-grained token"],
|
|
2810
|
+
[/sk-[A-Za-z0-9]{20,}/, "OpenAI API key"],
|
|
2817
2811
|
[/ghp_[A-Za-z0-9]{36}/, "GitHub personal access token"],
|
|
2818
|
-
[/
|
|
2819
|
-
[/ghu_[A-Za-z0-9]{36}/, "GitHub user-to-server token"],
|
|
2820
|
-
[/ghs_[A-Za-z0-9]{36}/, "GitHub server-to-server token"],
|
|
2821
|
-
[/ghr_[A-Za-z0-9]{36}/, "GitHub refresh token"],
|
|
2822
|
-
[/glpat-[A-Za-z0-9\-_]{20,}/, "GitLab personal access token"],
|
|
2812
|
+
[/github_pat_[A-Za-z0-9_]{82}/, "GitHub fine-grained token"],
|
|
2823
2813
|
[/AKIA[A-Z0-9]{16}/, "AWS access key ID"],
|
|
2824
|
-
[/ASIA[A-Z0-9]{16}/, "AWS temporary access key ID"],
|
|
2825
2814
|
[/sk_live_[A-Za-z0-9]{24,}/, "Stripe live secret key"],
|
|
2826
2815
|
[/sk_test_[A-Za-z0-9]{24,}/, "Stripe test secret key"],
|
|
2827
|
-
[/
|
|
2828
|
-
[/AIza[0-9A-Za-z\-_]{35}/, "Google API key"],
|
|
2829
|
-
[/\d{8,10}:[A-Za-z0-9_-]{35}/, "Telegram bot token"],
|
|
2830
|
-
[/xox[baprs]-[A-Za-z0-9-]{10,}/, "Slack token"],
|
|
2831
|
-
[/xapp-[0-9]-[A-Za-z0-9-]{10,}/, "Slack app-level token"],
|
|
2832
|
-
[/hf_[A-Za-z0-9]{30,}/, "Hugging Face token"],
|
|
2833
|
-
[/gsk_[A-Za-z0-9]{40,}/, "Groq API key"],
|
|
2834
|
-
[/r8_[A-Za-z0-9]{30,}/, "Replicate token"],
|
|
2835
|
-
[/xai-[A-Za-z0-9]{40,}/, "xAI API key"],
|
|
2836
|
-
[/npm_[A-Za-z0-9]{36}/, "npm access token"],
|
|
2837
|
-
[/dop_v1_[a-f0-9]{64}/, "DigitalOcean token"],
|
|
2838
|
-
[/shpat_[a-fA-F0-9]{32}/, "Shopify access token"],
|
|
2839
|
-
[/sb_secret_[A-Za-z0-9\-_]{20,}/, "Supabase secret key"],
|
|
2840
|
-
[/sbp_[a-f0-9]{40}/, "Supabase personal token"]
|
|
2816
|
+
[/AIza[0-9A-Za-z\-_]{35}/, "Google API key"]
|
|
2841
2817
|
];
|
|
2842
2818
|
CONNECTION_STRING_RE = /(?:postgresql|postgres|mysql|mongodb(?:\+srv)?|redis|amqps?|smtps?):\/\/[^@\s]+@/;
|
|
2843
2819
|
PRIVATE_KEY_RE = /-----BEGIN (?:[A-Z]+ )?PRIVATE KEY-----/;
|
|
@@ -3507,7 +3483,7 @@ function parsePackPolicyName(canonicalName) {
|
|
|
3507
3483
|
}
|
|
3508
3484
|
|
|
3509
3485
|
// package.json
|
|
3510
|
-
var version = "1.0.4
|
|
3486
|
+
var version = "1.0.4";
|
|
3511
3487
|
var init_package = () => {};
|
|
3512
3488
|
|
|
3513
3489
|
// src/posthog-key.ts
|
|
@@ -3611,8 +3587,7 @@ function projectConfig(parsed) {
|
|
|
3611
3587
|
const daemon = parsed.daemon ?? {};
|
|
3612
3588
|
const collector = parsed.collector ?? {};
|
|
3613
3589
|
const telemetry = parsed.telemetry ?? {};
|
|
3614
|
-
const
|
|
3615
|
-
const audit = auditPresent ? parsed.audit : {};
|
|
3590
|
+
const audit = parsed.audit ?? {};
|
|
3616
3591
|
return {
|
|
3617
3592
|
mode: mode === "cloud" ? "cloud" : "oss",
|
|
3618
3593
|
daemon: { configured: daemon.configured === true },
|
|
@@ -3627,8 +3602,7 @@ function projectConfig(parsed) {
|
|
|
3627
3602
|
},
|
|
3628
3603
|
telemetry: { enabled: telemetry.enabled !== false },
|
|
3629
3604
|
audit: {
|
|
3630
|
-
auto:
|
|
3631
|
-
notify: audit.notify !== false,
|
|
3605
|
+
auto: audit.auto === true,
|
|
3632
3606
|
intervalDays: readIntervalDays(audit.interval_days),
|
|
3633
3607
|
reportsConsentedAt: typeof audit.reports_consented_at === "number" && Number.isFinite(audit.reports_consented_at) ? audit.reports_consented_at : undefined
|
|
3634
3608
|
}
|
|
@@ -3650,7 +3624,7 @@ var init_fp_config = __esm(() => {
|
|
|
3650
3624
|
environment: "local"
|
|
3651
3625
|
},
|
|
3652
3626
|
telemetry: { enabled: true },
|
|
3653
|
-
audit: { auto: false,
|
|
3627
|
+
audit: { auto: false, intervalDays: DEFAULT_AUDIT_INTERVAL_DAYS }
|
|
3654
3628
|
};
|
|
3655
3629
|
});
|
|
3656
3630
|
|
|
@@ -5902,21 +5876,8 @@ var init_cursor_projects = __esm(() => {
|
|
|
5902
5876
|
// lib/sqlite-reader.ts
|
|
5903
5877
|
import { existsSync as existsSync8, readFileSync as readFileSync6 } from "node:fs";
|
|
5904
5878
|
import initSqlJs from "sql.js/dist/sql-asm.js";
|
|
5905
|
-
function silenceSqliteExperimentalWarning() {
|
|
5906
|
-
if (warningPatched)
|
|
5907
|
-
return;
|
|
5908
|
-
warningPatched = true;
|
|
5909
|
-
const original = process.emitWarning.bind(process);
|
|
5910
|
-
process.emitWarning = (warning, ...rest) => {
|
|
5911
|
-
const text = typeof warning === "string" ? warning : String(warning?.message ?? "");
|
|
5912
|
-
if (text.includes("SQLite is an experimental feature"))
|
|
5913
|
-
return;
|
|
5914
|
-
return original(warning, ...rest);
|
|
5915
|
-
};
|
|
5916
|
-
}
|
|
5917
5879
|
async function tryNodeSqlite(dbPath) {
|
|
5918
5880
|
try {
|
|
5919
|
-
silenceSqliteExperimentalWarning();
|
|
5920
5881
|
const mod = await import("node:sqlite");
|
|
5921
5882
|
const db = new mod.DatabaseSync(dbPath, { readOnly: true });
|
|
5922
5883
|
return {
|
|
@@ -5937,21 +5898,10 @@ function loadSqlJs() {
|
|
|
5937
5898
|
sqlPromise = initSqlJs();
|
|
5938
5899
|
return sqlPromise;
|
|
5939
5900
|
}
|
|
5940
|
-
function clearWalFlag(bytes) {
|
|
5941
|
-
if (bytes.length < 20)
|
|
5942
|
-
return bytes;
|
|
5943
|
-
if (bytes.toString("latin1", 0, 16) !== SQLITE_MAGIC)
|
|
5944
|
-
return bytes;
|
|
5945
|
-
if (bytes[18] === 1 && bytes[19] === 1)
|
|
5946
|
-
return bytes;
|
|
5947
|
-
bytes[18] = 1;
|
|
5948
|
-
bytes[19] = 1;
|
|
5949
|
-
return bytes;
|
|
5950
|
-
}
|
|
5951
5901
|
async function trySqlJs(dbPath) {
|
|
5952
5902
|
try {
|
|
5953
5903
|
const SQL = await loadSqlJs();
|
|
5954
|
-
const db = new SQL.Database(
|
|
5904
|
+
const db = new SQL.Database(readFileSync6(dbPath));
|
|
5955
5905
|
return {
|
|
5956
5906
|
query(sql, params) {
|
|
5957
5907
|
const stmt = db.prepare(sql);
|
|
@@ -5979,7 +5929,7 @@ async function openSqliteReadonly(dbPath) {
|
|
|
5979
5929
|
return null;
|
|
5980
5930
|
return await tryNodeSqlite(dbPath) ?? await trySqlJs(dbPath);
|
|
5981
5931
|
}
|
|
5982
|
-
var
|
|
5932
|
+
var sqlPromise = null;
|
|
5983
5933
|
var init_sqlite_reader = () => {};
|
|
5984
5934
|
|
|
5985
5935
|
// lib/opencode-db.ts
|
|
@@ -6686,169 +6636,13 @@ var init_hermes_projects = __esm(() => {
|
|
|
6686
6636
|
getCachedHermesSessionsByEncodedName = runtimeCache((name) => getHermesSessionsByEncodedName(name), 2, { maxSize: 50 });
|
|
6687
6637
|
});
|
|
6688
6638
|
|
|
6689
|
-
// lib/openclaw-db.ts
|
|
6690
|
-
import { existsSync as existsSync9 } from "node:fs";
|
|
6691
|
-
import { join as join13 } from "node:path";
|
|
6692
|
-
function str(value) {
|
|
6693
|
-
return typeof value === "string" && value.length > 0 ? value : undefined;
|
|
6694
|
-
}
|
|
6695
|
-
function parseObject(value) {
|
|
6696
|
-
try {
|
|
6697
|
-
const parsed = JSON.parse(value);
|
|
6698
|
-
return parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : undefined;
|
|
6699
|
-
} catch {
|
|
6700
|
-
return;
|
|
6701
|
-
}
|
|
6702
|
-
}
|
|
6703
|
-
function syntheticPath(agentId, sessionId) {
|
|
6704
|
-
return `openclaw-sqlite://${encodeURIComponent(agentId)}/${sessionId}`;
|
|
6705
|
-
}
|
|
6706
|
-
function listOpenClawDatabases(home, agentIds) {
|
|
6707
|
-
const out = [];
|
|
6708
|
-
for (const agentId of agentIds) {
|
|
6709
|
-
const dbPath = join13(home, "agents", agentId, "agent", DB_NAME);
|
|
6710
|
-
if (existsSync9(dbPath))
|
|
6711
|
-
out.push({ agentId, dbPath });
|
|
6712
|
-
}
|
|
6713
|
-
return out;
|
|
6714
|
-
}
|
|
6715
|
-
function readNodeMetadata(db) {
|
|
6716
|
-
const out = new Map;
|
|
6717
|
-
let rows;
|
|
6718
|
-
try {
|
|
6719
|
-
rows = db.query(`SELECT current_session_id, entry_json, label, display_name
|
|
6720
|
-
FROM session_nodes`);
|
|
6721
|
-
} catch {
|
|
6722
|
-
return out;
|
|
6723
|
-
}
|
|
6724
|
-
for (const row of rows) {
|
|
6725
|
-
const entry = parseObject(row.entry_json) ?? {};
|
|
6726
|
-
const origin = entry.origin && typeof entry.origin === "object" && !Array.isArray(entry.origin) ? entry.origin : {};
|
|
6727
|
-
out.set(row.current_session_id, {
|
|
6728
|
-
channel: str(entry.lastChannel) ?? str(origin.provider) ?? str(origin.surface),
|
|
6729
|
-
label: str(row.label) ?? str(row.display_name) ?? str(entry.displayName) ?? str(origin.label),
|
|
6730
|
-
chatId: str(entry.lastTo) ?? str(origin.from),
|
|
6731
|
-
chatType: str(entry.chatType) ?? str(origin.chatType)
|
|
6732
|
-
});
|
|
6733
|
-
}
|
|
6734
|
-
return out;
|
|
6735
|
-
}
|
|
6736
|
-
function readConversationMetadata(db) {
|
|
6737
|
-
const out = new Map;
|
|
6738
|
-
let rows;
|
|
6739
|
-
try {
|
|
6740
|
-
rows = db.query(`SELECT sc.session_id, c.channel, c.kind, c.peer_id,
|
|
6741
|
-
c.delivery_target, c.label
|
|
6742
|
-
FROM session_conversations sc
|
|
6743
|
-
JOIN conversations c ON c.conversation_id = sc.conversation_id
|
|
6744
|
-
ORDER BY CASE sc.role WHEN 'primary' THEN 0 ELSE 1 END, sc.last_seen_at DESC`);
|
|
6745
|
-
} catch {
|
|
6746
|
-
return out;
|
|
6747
|
-
}
|
|
6748
|
-
for (const row of rows) {
|
|
6749
|
-
if (out.has(row.session_id))
|
|
6750
|
-
continue;
|
|
6751
|
-
out.set(row.session_id, {
|
|
6752
|
-
channel: str(row.channel),
|
|
6753
|
-
label: str(row.label),
|
|
6754
|
-
chatId: str(row.delivery_target) ?? str(row.peer_id),
|
|
6755
|
-
chatType: str(row.kind)
|
|
6756
|
-
});
|
|
6757
|
-
}
|
|
6758
|
-
return out;
|
|
6759
|
-
}
|
|
6760
|
-
async function listOpenClawSqliteSessions(home, agentIds) {
|
|
6761
|
-
const sessions = [];
|
|
6762
|
-
for (const { agentId, dbPath } of listOpenClawDatabases(home, agentIds)) {
|
|
6763
|
-
const db = await openSqliteReadonly(dbPath);
|
|
6764
|
-
if (!db)
|
|
6765
|
-
continue;
|
|
6766
|
-
try {
|
|
6767
|
-
let rows;
|
|
6768
|
-
try {
|
|
6769
|
-
rows = db.query(`SELECT w.session_id, w.session_key, w.updated_at,
|
|
6770
|
-
w.transcript_updated_at, w.ended_at, w.channel,
|
|
6771
|
-
w.chat_type, w.display_name,
|
|
6772
|
-
COALESCE((SELECT MAX(e.created_at)
|
|
6773
|
-
FROM transcript_events e
|
|
6774
|
-
WHERE e.session_id = w.session_id), 0) AS event_updated_at,
|
|
6775
|
-
COALESCE((SELECT SUM(length(e.event_json) + 1)
|
|
6776
|
-
FROM transcript_events e
|
|
6777
|
-
WHERE e.session_id = w.session_id), 0) AS size_bytes
|
|
6778
|
-
FROM session_windows w
|
|
6779
|
-
WHERE EXISTS (SELECT 1 FROM transcript_events e
|
|
6780
|
-
WHERE e.session_id = w.session_id)`);
|
|
6781
|
-
} catch {
|
|
6782
|
-
continue;
|
|
6783
|
-
}
|
|
6784
|
-
const nodes = readNodeMetadata(db);
|
|
6785
|
-
const conversations = readConversationMetadata(db);
|
|
6786
|
-
for (const row of rows) {
|
|
6787
|
-
const node = nodes.get(row.session_id);
|
|
6788
|
-
const conversation = conversations.get(row.session_id);
|
|
6789
|
-
sessions.push({
|
|
6790
|
-
sessionId: row.session_id,
|
|
6791
|
-
agentId,
|
|
6792
|
-
dbPath,
|
|
6793
|
-
transcriptPath: syntheticPath(agentId, row.session_id),
|
|
6794
|
-
mtimeMs: Math.max(Number(row.updated_at) || 0, Number(row.transcript_updated_at) || 0, Number(row.ended_at) || 0, Number(row.event_updated_at) || 0),
|
|
6795
|
-
sizeBytes: Number(row.size_bytes) || 0,
|
|
6796
|
-
channel: str(row.channel) ?? conversation?.channel ?? node?.channel ?? "local",
|
|
6797
|
-
label: str(row.display_name) ?? conversation?.label ?? node?.label,
|
|
6798
|
-
chatId: conversation?.chatId ?? node?.chatId,
|
|
6799
|
-
chatType: str(row.chat_type) ?? conversation?.chatType ?? node?.chatType
|
|
6800
|
-
});
|
|
6801
|
-
}
|
|
6802
|
-
} finally {
|
|
6803
|
-
db.close();
|
|
6804
|
-
}
|
|
6805
|
-
}
|
|
6806
|
-
return sessions;
|
|
6807
|
-
}
|
|
6808
|
-
async function readOpenClawSqliteTranscript(home, agentIds, sessionId) {
|
|
6809
|
-
for (const { agentId, dbPath } of listOpenClawDatabases(home, agentIds)) {
|
|
6810
|
-
const db = await openSqliteReadonly(dbPath);
|
|
6811
|
-
if (!db)
|
|
6812
|
-
continue;
|
|
6813
|
-
try {
|
|
6814
|
-
let rows;
|
|
6815
|
-
try {
|
|
6816
|
-
rows = db.query(`SELECT event_json
|
|
6817
|
-
FROM transcript_events
|
|
6818
|
-
WHERE session_id = ?
|
|
6819
|
-
ORDER BY seq ASC`, [sessionId]);
|
|
6820
|
-
} catch {
|
|
6821
|
-
continue;
|
|
6822
|
-
}
|
|
6823
|
-
if (rows.length === 0)
|
|
6824
|
-
continue;
|
|
6825
|
-
const eventJsonLines = rows.map((row) => row.event_json);
|
|
6826
|
-
const rawLines = eventJsonLines.map(parseObject).filter((line) => line !== undefined);
|
|
6827
|
-
return {
|
|
6828
|
-
agentId,
|
|
6829
|
-
dbPath,
|
|
6830
|
-
filePath: syntheticPath(agentId, sessionId),
|
|
6831
|
-
rawLines,
|
|
6832
|
-
eventJsonLines
|
|
6833
|
-
};
|
|
6834
|
-
} finally {
|
|
6835
|
-
db.close();
|
|
6836
|
-
}
|
|
6837
|
-
}
|
|
6838
|
-
return null;
|
|
6839
|
-
}
|
|
6840
|
-
var DB_NAME = "openclaw-agent.sqlite";
|
|
6841
|
-
var init_openclaw_db = __esm(() => {
|
|
6842
|
-
init_sqlite_reader();
|
|
6843
|
-
});
|
|
6844
|
-
|
|
6845
6639
|
// lib/openclaw-sessions.ts
|
|
6846
6640
|
import { readFile as readFile7 } from "node:fs/promises";
|
|
6847
6641
|
import { readdirSync as readdirSync4, statSync as statSync6 } from "node:fs";
|
|
6848
6642
|
import { homedir as homedir11 } from "node:os";
|
|
6849
|
-
import { join as
|
|
6643
|
+
import { join as join13 } from "node:path";
|
|
6850
6644
|
function openclawHome() {
|
|
6851
|
-
return process.env.
|
|
6645
|
+
return process.env.OPENCLAW_HOME || join13(homedir11(), ".openclaw");
|
|
6852
6646
|
}
|
|
6853
6647
|
function isPlainObject2(v) {
|
|
6854
6648
|
return !!v && typeof v === "object" && !Array.isArray(v);
|
|
@@ -6935,11 +6729,7 @@ function openclawLinesToLogEntries(lines, source = "session") {
|
|
|
6935
6729
|
entries.push({
|
|
6936
6730
|
type: "assistant",
|
|
6937
6731
|
...base,
|
|
6938
|
-
message: {
|
|
6939
|
-
role: "assistant",
|
|
6940
|
-
content: blocks,
|
|
6941
|
-
model: typeof m.model === "string" ? m.model : undefined
|
|
6942
|
-
}
|
|
6732
|
+
message: { role: "assistant", content: blocks, model: typeof m.model === "string" ? m.model : undefined }
|
|
6943
6733
|
});
|
|
6944
6734
|
continue;
|
|
6945
6735
|
}
|
|
@@ -6967,13 +6757,13 @@ function openclawLinesToLogEntries(lines, source = "session") {
|
|
|
6967
6757
|
}
|
|
6968
6758
|
function listOpenClawAgents() {
|
|
6969
6759
|
try {
|
|
6970
|
-
return readdirSync4(
|
|
6760
|
+
return readdirSync4(join13(openclawHome(), "agents"), { withFileTypes: true }).filter((d) => d.isDirectory() && !d.name.startsWith(".")).map((d) => d.name).sort();
|
|
6971
6761
|
} catch {
|
|
6972
6762
|
return [];
|
|
6973
6763
|
}
|
|
6974
6764
|
}
|
|
6975
6765
|
function listOpenClawTranscripts() {
|
|
6976
|
-
const agentsDir =
|
|
6766
|
+
const agentsDir = join13(openclawHome(), "agents");
|
|
6977
6767
|
const out = [];
|
|
6978
6768
|
let agentIds;
|
|
6979
6769
|
try {
|
|
@@ -6982,7 +6772,7 @@ function listOpenClawTranscripts() {
|
|
|
6982
6772
|
return out;
|
|
6983
6773
|
}
|
|
6984
6774
|
for (const agentId of agentIds) {
|
|
6985
|
-
const sessionsDir =
|
|
6775
|
+
const sessionsDir = join13(agentsDir, agentId, "sessions");
|
|
6986
6776
|
let files;
|
|
6987
6777
|
try {
|
|
6988
6778
|
files = readdirSync4(sessionsDir);
|
|
@@ -6995,16 +6785,10 @@ function listOpenClawTranscripts() {
|
|
|
6995
6785
|
const sessionId = file.slice(0, -".jsonl".length);
|
|
6996
6786
|
if (!OPENCLAW_SESSION_ID_RE.test(sessionId))
|
|
6997
6787
|
continue;
|
|
6998
|
-
const transcriptPath =
|
|
6788
|
+
const transcriptPath = join13(sessionsDir, file);
|
|
6999
6789
|
try {
|
|
7000
6790
|
const st = statSync6(transcriptPath);
|
|
7001
|
-
out.push({
|
|
7002
|
-
agentId,
|
|
7003
|
-
sessionId,
|
|
7004
|
-
transcriptPath,
|
|
7005
|
-
mtimeMs: st.mtimeMs,
|
|
7006
|
-
sizeBytes: st.size
|
|
7007
|
-
});
|
|
6791
|
+
out.push({ agentId, sessionId, transcriptPath, mtimeMs: st.mtimeMs, sizeBytes: st.size });
|
|
7008
6792
|
} catch {}
|
|
7009
6793
|
}
|
|
7010
6794
|
}
|
|
@@ -7020,25 +6804,6 @@ function findOpenClawTranscript(sessionId) {
|
|
|
7020
6804
|
return null;
|
|
7021
6805
|
}
|
|
7022
6806
|
async function getOpenClawSessionLog(sessionId) {
|
|
7023
|
-
if (!OPENCLAW_SESSION_ID_RE.test(sessionId))
|
|
7024
|
-
return null;
|
|
7025
|
-
const sqlite = await readOpenClawSqliteTranscript(openclawHome(), listOpenClawAgents(), sessionId);
|
|
7026
|
-
if (sqlite) {
|
|
7027
|
-
const entries = openclawLinesToLogEntries(sqlite.rawLines, "session");
|
|
7028
|
-
let cwd;
|
|
7029
|
-
for (const line of sqlite.rawLines) {
|
|
7030
|
-
if (line.type === "session" && typeof line.cwd === "string" && line.cwd.length > 0) {
|
|
7031
|
-
cwd = line.cwd;
|
|
7032
|
-
break;
|
|
7033
|
-
}
|
|
7034
|
-
}
|
|
7035
|
-
return {
|
|
7036
|
-
entries,
|
|
7037
|
-
rawLines: sqlite.rawLines,
|
|
7038
|
-
cwd,
|
|
7039
|
-
filePath: sqlite.filePath
|
|
7040
|
-
};
|
|
7041
|
-
}
|
|
7042
6807
|
const filePath = findOpenClawTranscript(sessionId);
|
|
7043
6808
|
if (!filePath)
|
|
7044
6809
|
return null;
|
|
@@ -7062,7 +6827,6 @@ async function getOpenClawSessionLog(sessionId) {
|
|
|
7062
6827
|
var OPENCLAW_SESSION_ID_RE, getCachedOpenClawSessionLog;
|
|
7063
6828
|
var init_openclaw_sessions = __esm(() => {
|
|
7064
6829
|
init_log_entries();
|
|
7065
|
-
init_openclaw_db();
|
|
7066
6830
|
OPENCLAW_SESSION_ID_RE = /^[0-9a-fA-F-]{36}$/;
|
|
7067
6831
|
getCachedOpenClawSessionLog = runtimeCache((sessionId) => getOpenClawSessionLog(sessionId), 2, { maxSize: 50 });
|
|
7068
6832
|
});
|
|
@@ -7073,13 +6837,13 @@ __export(exports_openclaw_projects, {
|
|
|
7073
6837
|
getOpenClawProjects: () => getOpenClawProjects
|
|
7074
6838
|
});
|
|
7075
6839
|
import { readFileSync as readFileSync7 } from "node:fs";
|
|
7076
|
-
import { join as
|
|
7077
|
-
function
|
|
6840
|
+
import { join as join14 } from "node:path";
|
|
6841
|
+
function str(v) {
|
|
7078
6842
|
return typeof v === "string" && v.length > 0 ? v : undefined;
|
|
7079
6843
|
}
|
|
7080
6844
|
function readSessionsIndex(agentId) {
|
|
7081
6845
|
const out = new Map;
|
|
7082
|
-
const indexPath =
|
|
6846
|
+
const indexPath = join14(openclawHome(), "agents", agentId, "sessions", "sessions.json");
|
|
7083
6847
|
let raw;
|
|
7084
6848
|
try {
|
|
7085
6849
|
raw = JSON.parse(readFileSync7(indexPath, "utf-8"));
|
|
@@ -7092,17 +6856,17 @@ function readSessionsIndex(agentId) {
|
|
|
7092
6856
|
if (!v || typeof v !== "object")
|
|
7093
6857
|
continue;
|
|
7094
6858
|
const e = v;
|
|
7095
|
-
const sessionId =
|
|
6859
|
+
const sessionId = str(e.sessionId);
|
|
7096
6860
|
if (!sessionId)
|
|
7097
6861
|
continue;
|
|
7098
6862
|
const origin = e.origin && typeof e.origin === "object" ? e.origin : {};
|
|
7099
6863
|
const lastMs = typeof e.lastInteractionAt === "number" ? e.lastInteractionAt : typeof e.updatedAt === "number" ? e.updatedAt : undefined;
|
|
7100
6864
|
out.set(sessionId, {
|
|
7101
6865
|
lastMs,
|
|
7102
|
-
channel:
|
|
7103
|
-
chatType:
|
|
7104
|
-
label:
|
|
7105
|
-
chatId:
|
|
6866
|
+
channel: str(e.lastChannel) ?? str(origin.provider) ?? str(origin.surface),
|
|
6867
|
+
chatType: str(e.chatType) ?? str(origin.chatType),
|
|
6868
|
+
label: str(origin.label),
|
|
6869
|
+
chatId: str(e.lastTo) ?? str(origin.from)
|
|
7106
6870
|
});
|
|
7107
6871
|
}
|
|
7108
6872
|
return out;
|
|
@@ -7110,7 +6874,7 @@ function readSessionsIndex(agentId) {
|
|
|
7110
6874
|
async function getOpenClawSessions() {
|
|
7111
6875
|
const transcripts = listOpenClawTranscripts();
|
|
7112
6876
|
const indexByAgent = new Map;
|
|
7113
|
-
const refs =
|
|
6877
|
+
const refs = [];
|
|
7114
6878
|
for (const t of transcripts) {
|
|
7115
6879
|
let idx = indexByAgent.get(t.agentId);
|
|
7116
6880
|
if (!idx) {
|
|
@@ -7118,7 +6882,7 @@ async function getOpenClawSessions() {
|
|
|
7118
6882
|
indexByAgent.set(t.agentId, idx);
|
|
7119
6883
|
}
|
|
7120
6884
|
const meta = idx.get(t.sessionId);
|
|
7121
|
-
refs.
|
|
6885
|
+
refs.push({
|
|
7122
6886
|
sessionId: t.sessionId,
|
|
7123
6887
|
agentId: t.agentId,
|
|
7124
6888
|
channel: meta?.channel ?? "local",
|
|
@@ -7130,11 +6894,8 @@ async function getOpenClawSessions() {
|
|
|
7130
6894
|
sizeBytes: t.sizeBytes
|
|
7131
6895
|
});
|
|
7132
6896
|
}
|
|
7133
|
-
|
|
7134
|
-
|
|
7135
|
-
refs.set(`${s.agentId}\x00${s.sessionId}`, s);
|
|
7136
|
-
}
|
|
7137
|
-
return [...refs.values()].sort((a, b) => b.mtimeMs - a.mtimeMs);
|
|
6897
|
+
refs.sort((a, b) => b.mtimeMs - a.mtimeMs);
|
|
6898
|
+
return refs;
|
|
7138
6899
|
}
|
|
7139
6900
|
function openClawProjectName(agentId, channel) {
|
|
7140
6901
|
return `openclaw-${agentId}-${channel}`;
|
|
@@ -7169,12 +6930,7 @@ async function getOpenClawProjects() {
|
|
|
7169
6930
|
prev.latest = Math.max(prev.latest, s.mtimeMs);
|
|
7170
6931
|
prev.count += 1;
|
|
7171
6932
|
} else {
|
|
7172
|
-
groups.set(key, {
|
|
7173
|
-
agentId: s.agentId,
|
|
7174
|
-
channel: s.channel,
|
|
7175
|
-
latest: s.mtimeMs,
|
|
7176
|
-
count: 1
|
|
7177
|
-
});
|
|
6933
|
+
groups.set(key, { agentId: s.agentId, channel: s.channel, latest: s.mtimeMs, count: 1 });
|
|
7178
6934
|
}
|
|
7179
6935
|
}
|
|
7180
6936
|
const out = [];
|
|
@@ -7232,7 +6988,6 @@ async function getOpenClawSessionsByEncodedName(name) {
|
|
|
7232
6988
|
var getCachedOpenClawSessions, getCachedOpenClawProjects, getCachedOpenClawSessionsByEncodedName;
|
|
7233
6989
|
var init_openclaw_projects = __esm(() => {
|
|
7234
6990
|
init_openclaw_sessions();
|
|
7235
|
-
init_openclaw_db();
|
|
7236
6991
|
getCachedOpenClawSessions = runtimeCache(getOpenClawSessions, 2);
|
|
7237
6992
|
getCachedOpenClawProjects = runtimeCache(getOpenClawProjects, 2);
|
|
7238
6993
|
getCachedOpenClawSessionsByEncodedName = runtimeCache((name) => getOpenClawSessionsByEncodedName(name), 2, { maxSize: 50 });
|
|
@@ -7242,12 +6997,12 @@ var init_openclaw_projects = __esm(() => {
|
|
|
7242
6997
|
import { readFile as readFile8 } from "node:fs/promises";
|
|
7243
6998
|
import { readdirSync as readdirSync5, statSync as statSync7 } from "node:fs";
|
|
7244
6999
|
import { homedir as homedir12 } from "node:os";
|
|
7245
|
-
import { join as
|
|
7000
|
+
import { join as join15 } from "node:path";
|
|
7246
7001
|
function factoryHome() {
|
|
7247
|
-
return process.env.FACTORY_HOME ||
|
|
7002
|
+
return process.env.FACTORY_HOME || join15(homedir12(), ".factory");
|
|
7248
7003
|
}
|
|
7249
7004
|
function factorySessionsRoot() {
|
|
7250
|
-
return
|
|
7005
|
+
return join15(factoryHome(), "sessions");
|
|
7251
7006
|
}
|
|
7252
7007
|
function isPlainObject3(v) {
|
|
7253
7008
|
return !!v && typeof v === "object" && !Array.isArray(v);
|
|
@@ -7393,7 +7148,7 @@ function listFactoryTranscripts() {
|
|
|
7393
7148
|
for (const dir of projectDirs) {
|
|
7394
7149
|
const projectName = dir.name;
|
|
7395
7150
|
const cwd = decodeFolderName(projectName);
|
|
7396
|
-
const projectPath =
|
|
7151
|
+
const projectPath = join15(root, projectName);
|
|
7397
7152
|
let files;
|
|
7398
7153
|
try {
|
|
7399
7154
|
files = readdirSync5(projectPath);
|
|
@@ -7406,7 +7161,7 @@ function listFactoryTranscripts() {
|
|
|
7406
7161
|
const sessionId = file.slice(0, -".jsonl".length);
|
|
7407
7162
|
if (!FACTORY_SESSION_ID_RE.test(sessionId))
|
|
7408
7163
|
continue;
|
|
7409
|
-
const transcriptPath =
|
|
7164
|
+
const transcriptPath = join15(projectPath, file);
|
|
7410
7165
|
try {
|
|
7411
7166
|
const st = statSync7(transcriptPath);
|
|
7412
7167
|
out.push({ projectName, cwd, sessionId, transcriptPath, mtimeMs: st.mtimeMs, sizeBytes: st.size });
|
|
@@ -7530,12 +7285,12 @@ var init_factory_projects = __esm(() => {
|
|
|
7530
7285
|
|
|
7531
7286
|
// lib/devin-sessions.ts
|
|
7532
7287
|
import { homedir as homedir13 } from "node:os";
|
|
7533
|
-
import { join as
|
|
7288
|
+
import { join as join16 } from "node:path";
|
|
7534
7289
|
function devinHome() {
|
|
7535
|
-
return process.env.DEVIN_HOME ||
|
|
7290
|
+
return process.env.DEVIN_HOME || join16(homedir13(), ".local", "share", "devin");
|
|
7536
7291
|
}
|
|
7537
7292
|
function devinDbPath() {
|
|
7538
|
-
return process.env.DEVIN_DB_PATH ||
|
|
7293
|
+
return process.env.DEVIN_DB_PATH || join16(devinHome(), "cli", "sessions.db");
|
|
7539
7294
|
}
|
|
7540
7295
|
function devinEpochToMs(value) {
|
|
7541
7296
|
if (typeof value === "number" && Number.isFinite(value)) {
|
|
@@ -7829,15 +7584,15 @@ var init_devin_projects = __esm(() => {
|
|
|
7829
7584
|
import { readFile as readFile9 } from "node:fs/promises";
|
|
7830
7585
|
import { readdirSync as readdirSync6, statSync as statSync8 } from "node:fs";
|
|
7831
7586
|
import { homedir as homedir14 } from "node:os";
|
|
7832
|
-
import { join as
|
|
7587
|
+
import { join as join17 } from "node:path";
|
|
7833
7588
|
function antigravityHome() {
|
|
7834
|
-
return process.env.ANTIGRAVITY_HOME ||
|
|
7589
|
+
return process.env.ANTIGRAVITY_HOME || join17(homedir14(), ".gemini", "antigravity-cli");
|
|
7835
7590
|
}
|
|
7836
7591
|
function antigravityBrainRoot() {
|
|
7837
|
-
return
|
|
7592
|
+
return join17(antigravityHome(), "brain");
|
|
7838
7593
|
}
|
|
7839
7594
|
function antigravityTranscriptRelPath() {
|
|
7840
|
-
return
|
|
7595
|
+
return join17(".system_generated", "logs", "transcript_full.jsonl");
|
|
7841
7596
|
}
|
|
7842
7597
|
function isPlainObject5(v) {
|
|
7843
7598
|
return !!v && typeof v === "object" && !Array.isArray(v);
|
|
@@ -7960,7 +7715,7 @@ function listAntigravityTranscripts() {
|
|
|
7960
7715
|
const conversationId = dir.name;
|
|
7961
7716
|
if (!ANTIGRAVITY_CONVERSATION_ID_RE.test(conversationId))
|
|
7962
7717
|
continue;
|
|
7963
|
-
const transcriptPath =
|
|
7718
|
+
const transcriptPath = join17(root, conversationId, rel);
|
|
7964
7719
|
try {
|
|
7965
7720
|
const st = statSync8(transcriptPath);
|
|
7966
7721
|
if (!st.isFile())
|
|
@@ -7973,7 +7728,7 @@ function listAntigravityTranscripts() {
|
|
|
7973
7728
|
function findAntigravityTranscript(conversationId) {
|
|
7974
7729
|
if (!ANTIGRAVITY_CONVERSATION_ID_RE.test(conversationId))
|
|
7975
7730
|
return null;
|
|
7976
|
-
const transcriptPath =
|
|
7731
|
+
const transcriptPath = join17(antigravityBrainRoot(), conversationId, antigravityTranscriptRelPath());
|
|
7977
7732
|
try {
|
|
7978
7733
|
if (statSync8(transcriptPath).isFile())
|
|
7979
7734
|
return transcriptPath;
|
|
@@ -8008,9 +7763,9 @@ var exports_antigravity_projects = {};
|
|
|
8008
7763
|
__export(exports_antigravity_projects, {
|
|
8009
7764
|
getAntigravityProjects: () => getAntigravityProjects
|
|
8010
7765
|
});
|
|
8011
|
-
import { join as
|
|
7766
|
+
import { join as join18 } from "node:path";
|
|
8012
7767
|
function antigravitySummariesDbPath() {
|
|
8013
|
-
return
|
|
7768
|
+
return join18(antigravityHome(), "conversation_summaries.db");
|
|
8014
7769
|
}
|
|
8015
7770
|
function parseWorkspaceCwd(raw) {
|
|
8016
7771
|
if (!raw)
|
|
@@ -8154,15 +7909,15 @@ var init_antigravity_projects = __esm(() => {
|
|
|
8154
7909
|
|
|
8155
7910
|
// lib/goose-sessions.ts
|
|
8156
7911
|
import { homedir as homedir15 } from "node:os";
|
|
8157
|
-
import { join as
|
|
7912
|
+
import { join as join19 } from "node:path";
|
|
8158
7913
|
function gooseHome() {
|
|
8159
7914
|
if (process.env.GOOSE_HOME)
|
|
8160
7915
|
return process.env.GOOSE_HOME;
|
|
8161
7916
|
const xdg = process.env.XDG_DATA_HOME;
|
|
8162
|
-
return
|
|
7917
|
+
return join19(xdg && xdg.length > 0 ? xdg : join19(homedir15(), ".local", "share"), "goose");
|
|
8163
7918
|
}
|
|
8164
7919
|
function gooseDbPath() {
|
|
8165
|
-
return process.env.GOOSE_DB_PATH ||
|
|
7920
|
+
return process.env.GOOSE_DB_PATH || join19(gooseHome(), "sessions", "sessions.db");
|
|
8166
7921
|
}
|
|
8167
7922
|
function gooseTimestampToMs(value) {
|
|
8168
7923
|
if (typeof value === "number" && Number.isFinite(value)) {
|
|
@@ -8425,7 +8180,7 @@ var init_goose_projects = __esm(() => {
|
|
|
8425
8180
|
|
|
8426
8181
|
// lib/projects.ts
|
|
8427
8182
|
import { readdir as readdir5, stat as stat4 } from "node:fs/promises";
|
|
8428
|
-
import { join as
|
|
8183
|
+
import { join as join20, resolve as resolve9, sep } from "node:path";
|
|
8429
8184
|
async function getMtime(path, label) {
|
|
8430
8185
|
try {
|
|
8431
8186
|
return (await stat4(path)).mtime;
|
|
@@ -8451,7 +8206,7 @@ async function getClaudeProjectFolders() {
|
|
|
8451
8206
|
if (!entries)
|
|
8452
8207
|
return [];
|
|
8453
8208
|
const settled = await batchAll(entries.filter((entry) => entry.isDirectory()).map((entry) => async () => {
|
|
8454
|
-
const folderPath =
|
|
8209
|
+
const folderPath = join20(projectsPath, entry.name);
|
|
8455
8210
|
const mtime = await getMtime(folderPath, entry.name);
|
|
8456
8211
|
return {
|
|
8457
8212
|
name: entry.name,
|
|
@@ -8578,7 +8333,7 @@ function resolveProjectPath(projectName) {
|
|
|
8578
8333
|
if (/^[/\\]/.test(projectName))
|
|
8579
8334
|
throw new RangeError("Absolute project name");
|
|
8580
8335
|
const projectsPath = resolve9(getClaudeProjectsPath());
|
|
8581
|
-
const candidate = resolve9(
|
|
8336
|
+
const candidate = resolve9(join20(projectsPath, projectName));
|
|
8582
8337
|
if (!candidate.startsWith(projectsPath + sep)) {
|
|
8583
8338
|
throw new RangeError("Project path escapes root");
|
|
8584
8339
|
}
|
|
@@ -8596,7 +8351,7 @@ async function getSessionFiles(projectPath) {
|
|
|
8596
8351
|
return [];
|
|
8597
8352
|
const jsonlEntries = entries.filter((entry) => entry.isFile() && entry.name.endsWith(".jsonl") && extractSessionId2(entry.name));
|
|
8598
8353
|
const settled = await batchAll(jsonlEntries.map((entry) => async () => {
|
|
8599
|
-
const filePath =
|
|
8354
|
+
const filePath = join20(projectPath, entry.name);
|
|
8600
8355
|
const mtime = await getMtime(filePath, entry.name);
|
|
8601
8356
|
return {
|
|
8602
8357
|
name: entry.name,
|
|
@@ -8625,13 +8380,13 @@ var init_projects = __esm(() => {
|
|
|
8625
8380
|
|
|
8626
8381
|
// lib/resolve-subagent-path.ts
|
|
8627
8382
|
import { access as access2 } from "fs/promises";
|
|
8628
|
-
import { join as
|
|
8383
|
+
import { join as join21, relative as relative3 } from "path";
|
|
8629
8384
|
async function resolveSubagentPath(projectsPath, projectName, sessionId, agentId) {
|
|
8630
8385
|
const fileName = `agent-${agentId}.jsonl`;
|
|
8631
8386
|
const candidatePaths = [
|
|
8632
|
-
|
|
8633
|
-
|
|
8634
|
-
|
|
8387
|
+
join21(projectsPath, projectName, fileName),
|
|
8388
|
+
join21(projectsPath, projectName, sessionId, fileName),
|
|
8389
|
+
join21(projectsPath, projectName, sessionId, "subagents", fileName)
|
|
8635
8390
|
];
|
|
8636
8391
|
for (const candidatePath of candidatePaths) {
|
|
8637
8392
|
if (relative3(projectsPath, candidatePath).startsWith("..")) {
|
|
@@ -8653,7 +8408,7 @@ var init_resolve_subagent_path = () => {};
|
|
|
8653
8408
|
|
|
8654
8409
|
// lib/log-entries.ts
|
|
8655
8410
|
import { readFile as readFile10 } from "fs/promises";
|
|
8656
|
-
import { join as
|
|
8411
|
+
import { join as join22 } from "path";
|
|
8657
8412
|
function formatTimestamp(date) {
|
|
8658
8413
|
const base = formatDate(date);
|
|
8659
8414
|
const ms = date.getMilliseconds().toString().padStart(3, "0");
|
|
@@ -8847,7 +8602,7 @@ async function parseFileContent(fileContent, source) {
|
|
|
8847
8602
|
async function parseSessionLog(projectName, sessionId) {
|
|
8848
8603
|
const projectDir = resolveProjectPath(projectName);
|
|
8849
8604
|
const projectsPath = getClaudeProjectsPath();
|
|
8850
|
-
const filePath =
|
|
8605
|
+
const filePath = join22(projectDir, `${sessionId}.jsonl`);
|
|
8851
8606
|
const fileContent = await readFile10(filePath, "utf-8");
|
|
8852
8607
|
const { entries: sessionEntries, rawLines: sessionRawLines, subagentIds } = await parseFileContent(fileContent, "session");
|
|
8853
8608
|
if (subagentIds.length === 0) {
|
|
@@ -8884,13 +8639,13 @@ var init_log_entries = __esm(() => {
|
|
|
8884
8639
|
});
|
|
8885
8640
|
|
|
8886
8641
|
// lib/codex-sessions.ts
|
|
8887
|
-
import { readFileSync as readFileSync8, readdirSync as readdirSync7, existsSync as
|
|
8642
|
+
import { readFileSync as readFileSync8, readdirSync as readdirSync7, existsSync as existsSync9, writeFileSync as writeFileSync4, mkdirSync as mkdirSync5, statSync as statSync9 } from "node:fs";
|
|
8888
8643
|
import { readFile as readFile11 } from "node:fs/promises";
|
|
8889
|
-
import { dirname as dirname4, join as
|
|
8644
|
+
import { dirname as dirname4, join as join23 } from "node:path";
|
|
8890
8645
|
import { homedir as homedir16 } from "node:os";
|
|
8891
8646
|
function readCache() {
|
|
8892
8647
|
try {
|
|
8893
|
-
if (!
|
|
8648
|
+
if (!existsSync9(CACHE_PATH))
|
|
8894
8649
|
return {};
|
|
8895
8650
|
return JSON.parse(readFileSync8(CACHE_PATH, "utf-8"));
|
|
8896
8651
|
} catch {
|
|
@@ -8909,7 +8664,7 @@ function dirSearch(dir, sessionId) {
|
|
|
8909
8664
|
try {
|
|
8910
8665
|
for (const f of readdirSync7(dir, { withFileTypes: true })) {
|
|
8911
8666
|
if (f.isFile() && f.name.includes(sessionId) && f.name.endsWith(".jsonl")) {
|
|
8912
|
-
return
|
|
8667
|
+
return join23(dir, f.name);
|
|
8913
8668
|
}
|
|
8914
8669
|
}
|
|
8915
8670
|
} catch {}
|
|
@@ -8918,16 +8673,16 @@ function dirSearch(dir, sessionId) {
|
|
|
8918
8673
|
function findCodexTranscript(sessionId) {
|
|
8919
8674
|
const cache = readCache();
|
|
8920
8675
|
const cached = cache[sessionId];
|
|
8921
|
-
if (cached &&
|
|
8676
|
+
if (cached && existsSync9(cached))
|
|
8922
8677
|
return cached;
|
|
8923
|
-
const root =
|
|
8678
|
+
const root = join23(homedir16(), ".codex", "sessions");
|
|
8924
8679
|
const today = new Date;
|
|
8925
8680
|
const yesterday = new Date(today.getTime() - 24 * 60 * 60 * 1000);
|
|
8926
8681
|
const datedDirs = [today, yesterday].map((d) => {
|
|
8927
8682
|
const y = String(d.getUTCFullYear());
|
|
8928
8683
|
const m = String(d.getUTCMonth() + 1).padStart(2, "0");
|
|
8929
8684
|
const day = String(d.getUTCDate()).padStart(2, "0");
|
|
8930
|
-
return
|
|
8685
|
+
return join23(root, y, m, day);
|
|
8931
8686
|
});
|
|
8932
8687
|
for (const dir of datedDirs) {
|
|
8933
8688
|
const hit = dirSearch(dir, sessionId);
|
|
@@ -8940,13 +8695,13 @@ function findCodexTranscript(sessionId) {
|
|
|
8940
8695
|
for (const y of readdirSync7(root, { withFileTypes: true })) {
|
|
8941
8696
|
if (!y.isDirectory())
|
|
8942
8697
|
continue;
|
|
8943
|
-
for (const m of readdirSync7(
|
|
8698
|
+
for (const m of readdirSync7(join23(root, y.name), { withFileTypes: true })) {
|
|
8944
8699
|
if (!m.isDirectory())
|
|
8945
8700
|
continue;
|
|
8946
|
-
for (const d of readdirSync7(
|
|
8701
|
+
for (const d of readdirSync7(join23(root, y.name, m.name), { withFileTypes: true })) {
|
|
8947
8702
|
if (!d.isDirectory())
|
|
8948
8703
|
continue;
|
|
8949
|
-
const hit = dirSearch(
|
|
8704
|
+
const hit = dirSearch(join23(root, y.name, m.name, d.name), sessionId);
|
|
8950
8705
|
if (hit) {
|
|
8951
8706
|
writeCacheEntry(sessionId, hit);
|
|
8952
8707
|
return hit;
|
|
@@ -8972,15 +8727,6 @@ function joinTexts(blocks, wantedType) {
|
|
|
8972
8727
|
return blocks.filter((b) => b?.type === wantedType && typeof b.text === "string").map((b) => b.text).join(`
|
|
8973
8728
|
`);
|
|
8974
8729
|
}
|
|
8975
|
-
function toolOutputText(output) {
|
|
8976
|
-
if (typeof output === "string")
|
|
8977
|
-
return output;
|
|
8978
|
-
if (Array.isArray(output)) {
|
|
8979
|
-
return output.filter((block) => !!block && typeof block === "object").map((block) => typeof block.text === "string" ? block.text : "").filter(Boolean).join(`
|
|
8980
|
-
`);
|
|
8981
|
-
}
|
|
8982
|
-
return output === undefined ? "" : JSON.stringify(output);
|
|
8983
|
-
}
|
|
8984
8730
|
async function parseCodexLog(fileContent, source = "session") {
|
|
8985
8731
|
const lines = fileContent.split(`
|
|
8986
8732
|
`).filter((line) => line.trim() !== "");
|
|
@@ -9057,11 +8803,10 @@ async function parseCodexLog(fileContent, source = "session") {
|
|
|
9057
8803
|
});
|
|
9058
8804
|
continue;
|
|
9059
8805
|
}
|
|
9060
|
-
if (subType === "function_call"
|
|
8806
|
+
if (subType === "function_call") {
|
|
9061
8807
|
const callId = payload.call_id;
|
|
9062
8808
|
const name = payload.name ?? "function_call";
|
|
9063
|
-
const
|
|
9064
|
-
const input = safeJsonParse4(encodedInput);
|
|
8809
|
+
const input = safeJsonParse4(payload.arguments);
|
|
9065
8810
|
const toolUse = {
|
|
9066
8811
|
type: "tool_use",
|
|
9067
8812
|
id: callId ?? `${timestamp}-${name}`,
|
|
@@ -9080,7 +8825,7 @@ async function parseCodexLog(fileContent, source = "session") {
|
|
|
9080
8825
|
}
|
|
9081
8826
|
continue;
|
|
9082
8827
|
}
|
|
9083
|
-
if (subType === "function_call_output"
|
|
8828
|
+
if (subType === "function_call_output") {
|
|
9084
8829
|
const callId = payload.call_id;
|
|
9085
8830
|
const block = callId ? toolUseById.get(callId) : undefined;
|
|
9086
8831
|
if (block) {
|
|
@@ -9089,7 +8834,7 @@ async function parseCodexLog(fileContent, source = "session") {
|
|
|
9089
8834
|
block.result = {
|
|
9090
8835
|
timestamp,
|
|
9091
8836
|
timestampFormatted: formatTimestamp(date),
|
|
9092
|
-
content:
|
|
8837
|
+
content: typeof payload.output === "string" ? payload.output : JSON.stringify(payload.output),
|
|
9093
8838
|
durationMs: duration,
|
|
9094
8839
|
durationFormatted: formatDuration(duration)
|
|
9095
8840
|
};
|
|
@@ -9222,15 +8967,15 @@ var init_resolve_permission_mode = __esm(() => {
|
|
|
9222
8967
|
});
|
|
9223
8968
|
|
|
9224
8969
|
// lib/copilot-sessions.ts
|
|
9225
|
-
import { readFileSync as readFileSync10, readdirSync as readdirSync8, existsSync as
|
|
8970
|
+
import { readFileSync as readFileSync10, readdirSync as readdirSync8, existsSync as existsSync10, statSync as statSync10 } from "node:fs";
|
|
9226
8971
|
import { readFile as readFile12 } from "node:fs/promises";
|
|
9227
|
-
import { join as
|
|
8972
|
+
import { join as join24, resolve as resolve10, sep as sep2 } from "node:path";
|
|
9228
8973
|
import { homedir as homedir17 } from "node:os";
|
|
9229
8974
|
function getCopilotHome() {
|
|
9230
|
-
return process.env.COPILOT_HOME ||
|
|
8975
|
+
return process.env.COPILOT_HOME || join24(homedir17(), ".copilot");
|
|
9231
8976
|
}
|
|
9232
8977
|
function getCopilotSessionStateRoot2() {
|
|
9233
|
-
return
|
|
8978
|
+
return join24(getCopilotHome(), "session-state");
|
|
9234
8979
|
}
|
|
9235
8980
|
function getCopilotSessionDir(sessionId) {
|
|
9236
8981
|
if (!sessionId)
|
|
@@ -9245,19 +8990,19 @@ function resolveSessionFile(sessionId, filename) {
|
|
|
9245
8990
|
const dir = getCopilotSessionDir(sessionId);
|
|
9246
8991
|
if (!dir)
|
|
9247
8992
|
return null;
|
|
9248
|
-
return
|
|
8993
|
+
return join24(dir, filename);
|
|
9249
8994
|
}
|
|
9250
8995
|
function findCopilotTranscript(sessionId) {
|
|
9251
8996
|
const candidate = resolveSessionFile(sessionId, "events.jsonl");
|
|
9252
8997
|
if (!candidate)
|
|
9253
8998
|
return null;
|
|
9254
|
-
return
|
|
8999
|
+
return existsSync10(candidate) ? candidate : null;
|
|
9255
9000
|
}
|
|
9256
9001
|
function findCopilotWorkspace(sessionId) {
|
|
9257
9002
|
const candidate = resolveSessionFile(sessionId, "workspace.yaml");
|
|
9258
9003
|
if (!candidate)
|
|
9259
9004
|
return null;
|
|
9260
|
-
return
|
|
9005
|
+
return existsSync10(candidate) ? candidate : null;
|
|
9261
9006
|
}
|
|
9262
9007
|
function readYamlScalar(path, key) {
|
|
9263
9008
|
try {
|
|
@@ -9284,8 +9029,6 @@ async function parseCopilotLog(fileContent, source = "session") {
|
|
|
9284
9029
|
const rawLines = [];
|
|
9285
9030
|
const toolUseById = new Map;
|
|
9286
9031
|
const toolUseStartMs = new Map;
|
|
9287
|
-
let mostRecentToolUse;
|
|
9288
|
-
let mostRecentToolUseStartMs = 0;
|
|
9289
9032
|
let cwd;
|
|
9290
9033
|
let seenSessionStart = false;
|
|
9291
9034
|
for (let i = 0;i < lines.length; i++) {
|
|
@@ -9381,24 +9124,8 @@ async function parseCopilotLog(fileContent, source = "session") {
|
|
|
9381
9124
|
toolUseById.set(callId, toolUse);
|
|
9382
9125
|
toolUseStartMs.set(callId, date.getTime());
|
|
9383
9126
|
}
|
|
9384
|
-
mostRecentToolUse = toolUse;
|
|
9385
|
-
mostRecentToolUseStartMs = date.getTime();
|
|
9386
9127
|
continue;
|
|
9387
9128
|
}
|
|
9388
|
-
if (recType === "hook.start" && data.hookType === "postToolUse" && mostRecentToolUse) {
|
|
9389
|
-
const input = data.input ?? {};
|
|
9390
|
-
const hookResult = input.toolResult ?? {};
|
|
9391
|
-
const hookContent = hookResult.textResultForLlm ?? hookResult.sessionLog;
|
|
9392
|
-
if (typeof hookContent === "string" && hookContent.length > 0) {
|
|
9393
|
-
mostRecentToolUse.result = {
|
|
9394
|
-
timestamp,
|
|
9395
|
-
timestampFormatted: formatTimestamp(date),
|
|
9396
|
-
content: hookContent,
|
|
9397
|
-
durationMs: Math.max(0, date.getTime() - mostRecentToolUseStartMs),
|
|
9398
|
-
durationFormatted: formatDuration(Math.max(0, date.getTime() - mostRecentToolUseStartMs))
|
|
9399
|
-
};
|
|
9400
|
-
}
|
|
9401
|
-
}
|
|
9402
9129
|
if (recType === "tool.execution_complete") {
|
|
9403
9130
|
const callId = data.toolCallId;
|
|
9404
9131
|
const block = callId ? toolUseById.get(callId) : undefined;
|
|
@@ -9408,8 +9135,7 @@ async function parseCopilotLog(fileContent, source = "session") {
|
|
|
9408
9135
|
const telemetry = data.toolTelemetry ?? {};
|
|
9409
9136
|
const reportedMs = telemetry.metrics?.commandTimeMs ?? telemetry.metrics?.durationMs ?? null;
|
|
9410
9137
|
const durationMs = typeof reportedMs === "number" && reportedMs >= 0 ? reportedMs : Math.max(0, date.getTime() - startMs);
|
|
9411
|
-
const
|
|
9412
|
-
const content = block.result?.content || completionContent;
|
|
9138
|
+
const content = result.detailedContent ?? result.content ?? "";
|
|
9413
9139
|
block.result = {
|
|
9414
9140
|
timestamp,
|
|
9415
9141
|
timestampFormatted: formatTimestamp(date),
|
|
@@ -9458,12 +9184,12 @@ var init_copilot_sessions = __esm(() => {
|
|
|
9458
9184
|
});
|
|
9459
9185
|
|
|
9460
9186
|
// lib/cursor-sessions.ts
|
|
9461
|
-
import { readFileSync as readFileSync11, readdirSync as readdirSync9, existsSync as
|
|
9187
|
+
import { readFileSync as readFileSync11, readdirSync as readdirSync9, existsSync as existsSync11, statSync as statSync11 } from "node:fs";
|
|
9462
9188
|
import { readFile as readFile13 } from "node:fs/promises";
|
|
9463
|
-
import { basename as basename3, join as
|
|
9189
|
+
import { basename as basename3, join as join25, resolve as resolve11, sep as sep3 } from "node:path";
|
|
9464
9190
|
import { homedir as homedir18 } from "node:os";
|
|
9465
9191
|
function getCursorHome2() {
|
|
9466
|
-
return process.env.CURSOR_HOME ||
|
|
9192
|
+
return process.env.CURSOR_HOME || join25(homedir18(), ".cursor");
|
|
9467
9193
|
}
|
|
9468
9194
|
function getCursorSessionDir(sessionId) {
|
|
9469
9195
|
if (!sessionId)
|
|
@@ -9481,7 +9207,7 @@ function getCursorSessionDir(sessionId) {
|
|
|
9481
9207
|
const transcriptRoot = resolve11(projectsRoot, entry.name, NEW_AGENT_TRANSCRIPTS_DIR2);
|
|
9482
9208
|
if (candidate === transcriptRoot || !candidate.startsWith(`${transcriptRoot}${sep3}`))
|
|
9483
9209
|
continue;
|
|
9484
|
-
if (
|
|
9210
|
+
if (existsSync11(candidate))
|
|
9485
9211
|
return candidate;
|
|
9486
9212
|
}
|
|
9487
9213
|
for (const sub of LEGACY_SESSION_ROOT_CANDIDATES2) {
|
|
@@ -9489,7 +9215,7 @@ function getCursorSessionDir(sessionId) {
|
|
|
9489
9215
|
const candidate = resolve11(root, sessionId);
|
|
9490
9216
|
if (candidate === root || !candidate.startsWith(`${root}${sep3}`))
|
|
9491
9217
|
continue;
|
|
9492
|
-
if (
|
|
9218
|
+
if (existsSync11(candidate))
|
|
9493
9219
|
return candidate;
|
|
9494
9220
|
}
|
|
9495
9221
|
return null;
|
|
@@ -9498,12 +9224,12 @@ function findCursorTranscript(sessionId) {
|
|
|
9498
9224
|
const dir = getCursorSessionDir(sessionId);
|
|
9499
9225
|
if (!dir)
|
|
9500
9226
|
return null;
|
|
9501
|
-
const newCandidate =
|
|
9502
|
-
if (
|
|
9227
|
+
const newCandidate = join25(dir, `${basename3(dir)}.jsonl`);
|
|
9228
|
+
if (existsSync11(newCandidate))
|
|
9503
9229
|
return newCandidate;
|
|
9504
9230
|
for (const name of LEGACY_TRANSCRIPT_FILE_CANDIDATES2) {
|
|
9505
|
-
const candidate =
|
|
9506
|
-
if (
|
|
9231
|
+
const candidate = join25(dir, name);
|
|
9232
|
+
if (existsSync11(candidate))
|
|
9507
9233
|
return candidate;
|
|
9508
9234
|
}
|
|
9509
9235
|
return null;
|
|
@@ -9533,27 +9259,8 @@ async function parseCursorLog(fileContent, source = "session") {
|
|
|
9533
9259
|
if (!raw.type && raw.role && raw.message?.content) {
|
|
9534
9260
|
const synthDate = new Date(SYNTH_T0 + i);
|
|
9535
9261
|
const synthTs = synthDate.toISOString();
|
|
9536
|
-
const
|
|
9537
|
-
const textParts = messageContent.filter((c) => c?.type === "text" && typeof c.text === "string").map((c) => c.text).join("");
|
|
9262
|
+
const textParts = raw.message.content.filter((c) => c?.type === "text" && typeof c.text === "string").map((c) => c.text).join("");
|
|
9538
9263
|
if (raw.role === "user") {
|
|
9539
|
-
let attachedResult = false;
|
|
9540
|
-
for (const block of messageContent) {
|
|
9541
|
-
if (block?.type !== "tool_result")
|
|
9542
|
-
continue;
|
|
9543
|
-
const callId = typeof block.tool_use_id === "string" ? block.tool_use_id : undefined;
|
|
9544
|
-
const toolUse = callId ? toolUseById.get(callId) : undefined;
|
|
9545
|
-
if (!toolUse)
|
|
9546
|
-
continue;
|
|
9547
|
-
const durationMs = Math.max(0, synthDate.getTime() - (toolUseStartMs.get(callId) ?? synthDate.getTime()));
|
|
9548
|
-
toolUse.result = {
|
|
9549
|
-
timestamp: synthTs,
|
|
9550
|
-
timestampFormatted: formatTimestamp(synthDate),
|
|
9551
|
-
content: typeof block.content === "string" ? block.content : block.content == null ? "" : JSON.stringify(block.content),
|
|
9552
|
-
durationMs,
|
|
9553
|
-
durationFormatted: formatDuration(durationMs)
|
|
9554
|
-
};
|
|
9555
|
-
attachedResult = true;
|
|
9556
|
-
}
|
|
9557
9264
|
const queryMatch = /<user_query>\s*([\s\S]*?)\s*<\/user_query>/.exec(textParts);
|
|
9558
9265
|
const text = queryMatch ? queryMatch[1] : textParts;
|
|
9559
9266
|
if (text) {
|
|
@@ -9562,35 +9269,11 @@ async function parseCursorLog(fileContent, source = "session") {
|
|
|
9562
9269
|
...baseEntry(rawCopy, synthTs, synthDate, source),
|
|
9563
9270
|
message: { role: "user", content: text }
|
|
9564
9271
|
});
|
|
9565
|
-
} else if (!attachedResult) {
|
|
9566
|
-
entries.push({
|
|
9567
|
-
type: "system",
|
|
9568
|
-
...baseEntry(rawCopy, synthTs, synthDate, source),
|
|
9569
|
-
raw: rawCopy
|
|
9570
|
-
});
|
|
9571
9272
|
}
|
|
9572
9273
|
continue;
|
|
9573
9274
|
}
|
|
9574
9275
|
if (raw.role === "assistant") {
|
|
9575
|
-
const blocks = [];
|
|
9576
|
-
if (textParts)
|
|
9577
|
-
blocks.push({ type: "text", text: textParts });
|
|
9578
|
-
for (let j = 0;j < messageContent.length; j++) {
|
|
9579
|
-
const contentBlock = messageContent[j];
|
|
9580
|
-
if (contentBlock?.type !== "tool_use")
|
|
9581
|
-
continue;
|
|
9582
|
-
const name = typeof contentBlock.name === "string" ? contentBlock.name : "tool";
|
|
9583
|
-
const id = typeof contentBlock.id === "string" && contentBlock.id ? contentBlock.id : `cursor-${i}-${name}-${j}`;
|
|
9584
|
-
const toolUse = {
|
|
9585
|
-
type: "tool_use",
|
|
9586
|
-
id,
|
|
9587
|
-
name,
|
|
9588
|
-
input: contentBlock.input && typeof contentBlock.input === "object" ? contentBlock.input : {}
|
|
9589
|
-
};
|
|
9590
|
-
blocks.push(toolUse);
|
|
9591
|
-
toolUseById.set(id, toolUse);
|
|
9592
|
-
toolUseStartMs.set(id, synthDate.getTime());
|
|
9593
|
-
}
|
|
9276
|
+
const blocks = textParts ? [{ type: "text", text: textParts }] : [];
|
|
9594
9277
|
if (blocks.length === 0) {
|
|
9595
9278
|
entries.push({
|
|
9596
9279
|
type: "system",
|
|
@@ -9757,12 +9440,12 @@ var init_cursor_sessions = __esm(() => {
|
|
|
9757
9440
|
});
|
|
9758
9441
|
|
|
9759
9442
|
// lib/pi-sessions.ts
|
|
9760
|
-
import { readFileSync as readFileSync12, readdirSync as readdirSync10, existsSync as
|
|
9443
|
+
import { readFileSync as readFileSync12, readdirSync as readdirSync10, existsSync as existsSync12, statSync as statSync12 } from "node:fs";
|
|
9761
9444
|
import { readFile as readFile14 } from "node:fs/promises";
|
|
9762
|
-
import { join as
|
|
9445
|
+
import { join as join26, resolve as resolve12, sep as sep4 } from "node:path";
|
|
9763
9446
|
import { homedir as homedir19 } from "node:os";
|
|
9764
9447
|
function getPiSessionStateRoot() {
|
|
9765
|
-
return process.env.PI_SESSIONS_DIR ||
|
|
9448
|
+
return process.env.PI_SESSIONS_DIR || join26(homedir19(), ".pi", "agent", "sessions");
|
|
9766
9449
|
}
|
|
9767
9450
|
function isSafeSessionId(sessionId) {
|
|
9768
9451
|
return UUID_RE.test(sessionId);
|
|
@@ -9794,7 +9477,7 @@ function findPiTranscript(sessionId) {
|
|
|
9794
9477
|
const candidate = resolve12(cwdPath, f);
|
|
9795
9478
|
if (!candidate.startsWith(`${cwdPath}${sep4}`))
|
|
9796
9479
|
continue;
|
|
9797
|
-
if (
|
|
9480
|
+
if (existsSync12(candidate))
|
|
9798
9481
|
return candidate;
|
|
9799
9482
|
}
|
|
9800
9483
|
}
|
|
@@ -10154,9 +9837,9 @@ var init_pack_failclosed = __esm(() => {
|
|
|
10154
9837
|
var init_atomic_write = () => {};
|
|
10155
9838
|
|
|
10156
9839
|
// src/hooks/session-pause.ts
|
|
10157
|
-
import { existsSync as
|
|
9840
|
+
import { existsSync as existsSync13, mkdirSync as mkdirSync6, readdirSync as readdirSync11, readFileSync as readFileSync13, rmSync as rmSync2 } from "node:fs";
|
|
10158
9841
|
import { createHash as createHash5 } from "node:crypto";
|
|
10159
|
-
import { join as
|
|
9842
|
+
import { join as join27, resolve as resolve13 } from "node:path";
|
|
10160
9843
|
function pauseStateDir() {
|
|
10161
9844
|
const override = process.env.FAILPROOFAI_STATE_DIR;
|
|
10162
9845
|
if (override)
|
|
@@ -10165,7 +9848,7 @@ function pauseStateDir() {
|
|
|
10165
9848
|
}
|
|
10166
9849
|
function pauseFilePath(sessionId) {
|
|
10167
9850
|
const digest = createHash5("sha256").update(sessionId).digest("hex").slice(0, 32);
|
|
10168
|
-
return
|
|
9851
|
+
return join27(pauseStateDir(), `${digest}.json`);
|
|
10169
9852
|
}
|
|
10170
9853
|
function parseStored(raw) {
|
|
10171
9854
|
if (!raw || typeof raw !== "object")
|
|
@@ -10194,7 +9877,7 @@ function readActivePause(sessionId, now = Date.now()) {
|
|
|
10194
9877
|
return null;
|
|
10195
9878
|
try {
|
|
10196
9879
|
const path = pauseFilePath(sessionId);
|
|
10197
|
-
if (!
|
|
9880
|
+
if (!existsSync13(path))
|
|
10198
9881
|
return null;
|
|
10199
9882
|
const stored = parseStored(JSON.parse(readFileSync13(path, "utf8")));
|
|
10200
9883
|
if (!stored)
|
|
@@ -10235,7 +9918,7 @@ var init_daemon_service = __esm(() => {
|
|
|
10235
9918
|
// src/hooks/fp-reset.ts
|
|
10236
9919
|
import {
|
|
10237
9920
|
copyFileSync,
|
|
10238
|
-
existsSync as
|
|
9921
|
+
existsSync as existsSync14,
|
|
10239
9922
|
mkdirSync as mkdirSync7,
|
|
10240
9923
|
readFileSync as readFileSync14,
|
|
10241
9924
|
readdirSync as readdirSync12,
|
|
@@ -10252,7 +9935,7 @@ function layoutWarningForHook() {
|
|
|
10252
9935
|
if (state.kind === "future") {
|
|
10253
9936
|
return `[failproofai] this directory was written by a newer version (layout ${state.found} vs ${LAYOUT_VERSION}) — policies are NOT being enforced. ` + `Upgrade failproofai.`;
|
|
10254
9937
|
}
|
|
10255
|
-
if (
|
|
9938
|
+
if (existsSync14(globalPolicyConfigFile()))
|
|
10256
9939
|
return null;
|
|
10257
9940
|
return `[failproofai] setup predates this version — global policies are NOT being enforced. ` + `Run \`failproofai config\` to re-create it.`;
|
|
10258
9941
|
}
|
|
@@ -10629,7 +10312,7 @@ var init_handler = __esm(() => {
|
|
|
10629
10312
|
|
|
10630
10313
|
// src/hooks/worker-server.ts
|
|
10631
10314
|
import { createConnection, createServer } from "node:net";
|
|
10632
|
-
import { existsSync as
|
|
10315
|
+
import { existsSync as existsSync15, unlinkSync as unlinkSync2 } from "node:fs";
|
|
10633
10316
|
function isWorkerHookRequest(msg) {
|
|
10634
10317
|
if (!msg || typeof msg !== "object")
|
|
10635
10318
|
return false;
|
|
@@ -10762,14 +10445,14 @@ function requestExistingWorkerShutdown(socketPath) {
|
|
|
10762
10445
|
function startWorkerServer(socketPath, shutdown) {
|
|
10763
10446
|
const server = createServer((socket) => handleConnection(socket, shutdown ?? (() => server.close())));
|
|
10764
10447
|
const listen = () => {
|
|
10765
|
-
if (
|
|
10448
|
+
if (existsSync15(socketPath)) {
|
|
10766
10449
|
try {
|
|
10767
10450
|
unlinkSync2(socketPath);
|
|
10768
10451
|
} catch {}
|
|
10769
10452
|
}
|
|
10770
10453
|
server.listen(socketPath);
|
|
10771
10454
|
};
|
|
10772
|
-
if (!
|
|
10455
|
+
if (!existsSync15(socketPath))
|
|
10773
10456
|
listen();
|
|
10774
10457
|
else
|
|
10775
10458
|
requestExistingWorkerShutdown(socketPath).then(listen, (err) => server.emit("error", err));
|