failproofai 1.0.3 → 1.0.4-beta.1
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/.grok/hooks/failproofai.json +172 -0
- 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.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.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 +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 +2 -2
- package/.next/standalone/.next/server/app/audit/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/audit/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +15 -15
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +14 -14
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +15 -15
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/page/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.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 +1 -1
- package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page/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 +3 -3
- 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 +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/projects/page/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 +1 -1
- package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +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]__0u3wrvq._.js → [externals]__0_gzk8q._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{[externals]__0-9ti7z._.js → [externals]__1zndo1i._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__07hor7h._.js +5 -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]__0cuho4x._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0elsuli._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0gnj_qa._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ljuzm_._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0o07qi9._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0w23bpg._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0x5c7sh._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0yik9_w._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1adacul._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1jg6s9m._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1s6qci9._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1xfm05z._.js +3 -0
- package/.next/standalone/.next/server/chunks/_09dz7xv._.js +1 -1
- package/.next/standalone/.next/server/chunks/_0tdy_6l._.js +3 -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/_1ek68ln._.js +21 -14
- package/.next/standalone/.next/server/chunks/lib_grok-projects_ts_1i2epl_._.js +3 -0
- package/.next/standalone/.next/server/chunks/lib_qwen-projects_ts_0wu_a8e._.js +3 -0
- package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_01r25oi._.js +2 -2
- package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_09z9-p7._.js +2 -2
- package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4v._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_hooks_0iu54mz._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__013jr2b._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01wy8d-._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02npjtd._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0_4gcz8._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0d--wmy._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0da85px._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ftmoxc._.js +2 -2
- 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 +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0qqrlf_._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0s11fx1._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0s740oi._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0n_lxhg._.js → [root-of-the-server]__0wvusu0._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1b5jzxr._.js → [root-of-the-server]__16gamwq._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1bbk-si._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1c3ybxr._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1izi7zn._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1p2otjt._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1qapotl._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1zl_r0t._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__21bj7uw._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0-yi74u._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0v8eebd._.js → _00z5uuq._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_1if9ixi._.js → _08f0jd2._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_08x1r5t._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0wso5d3._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0j6gd_k._.js → _1byck5v._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_1es2j7i._.js +155 -1
- package/.next/standalone/.next/server/chunks/ssr/_1u8-lu2._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1zopuov._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_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 +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 +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_cline-projects_ts_13_hbdd._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/lib_grok-projects_ts_0rc-d0o._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/lib_ori-projects_ts_04tofqo._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/lib_qwen-projects_ts_0w3i9o7._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_11bnuzn._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_builtin-policies_ts_09j2ndl._.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 +19 -19
- package/.next/standalone/.next/static/chunks/{0ollg-nnu3t3e.js → 00gv0v91mycm-.js} +1 -1
- package/.next/standalone/.next/static/chunks/{354-n7p7labpn.js → 01hvwwrhvbzyh.js} +1 -1
- package/.next/standalone/.next/static/chunks/0hzmxwb2pvk5p.js +6 -0
- package/.next/standalone/.next/static/chunks/{0nm11ysn0153h.js → 0j884dwnwtyrt.js} +1 -1
- package/.next/standalone/.next/static/chunks/0mr9dg3bnloa1.js +1 -0
- package/.next/standalone/.next/static/chunks/0qn9khv0oo9ex.js +1 -0
- package/.next/standalone/.next/static/chunks/{2xm5mj1d21b4n.js → 1_2jsatfuthrw.js} +1 -1
- package/.next/standalone/.next/static/chunks/1_bxotmf9qngs.js +1 -0
- package/.next/standalone/.next/static/chunks/1eyl7fzkmnkf_.js +1 -0
- package/.next/standalone/.next/static/chunks/{42yfkhekx440s.js → 1po3lirgk2riw.js} +1 -1
- package/.next/standalone/.next/static/chunks/{40lpt2o2b283e.js → 2bnf_4pgyk1rq.js} +1 -1
- package/.next/standalone/.next/static/chunks/{1a6u7l3giejch.js → 2bvwsyu6x__ia.js} +1 -1
- package/.next/standalone/.next/static/chunks/{3l36d73kj18zw.js → 3_--3ibia6ba1.js} +1 -1
- package/.next/standalone/.next/static/chunks/3gf1jg-5m-u1t.css +2 -0
- package/.next/standalone/.next/static/chunks/{3pibxnbhjza7n.js → 3ws7eljkq25wg.js} +1 -1
- package/.next/standalone/.next/static/chunks/{turbopack-2x-o099q64i8h.js → turbopack-18qf4jodtft6b.js} +1 -1
- package/.next/standalone/.qwen/settings.json +251 -0
- package/.next/standalone/app/project/[name]/page.tsx +24 -4
- package/.next/standalone/assets/logos/cline.png +0 -0
- package/.next/standalone/assets/logos/grok-dark.svg +1 -0
- package/.next/standalone/assets/logos/grok-light.svg +1 -0
- package/.next/standalone/assets/logos/ori-dark.svg +1 -0
- package/.next/standalone/assets/logos/ori-light.svg +1 -0
- package/.next/standalone/assets/logos/qwen.svg +1 -0
- package/.next/standalone/lib/cli-registry.ts +33 -1
- package/.next/standalone/lib/cline-projects.ts +155 -0
- package/.next/standalone/lib/cline-sessions.ts +268 -0
- package/.next/standalone/lib/download-session.ts +37 -0
- package/.next/standalone/lib/grok-projects.ts +123 -0
- package/.next/standalone/lib/grok-sessions.ts +355 -0
- package/.next/standalone/lib/ori-projects.ts +141 -0
- package/.next/standalone/lib/ori-sessions.ts +221 -0
- package/.next/standalone/lib/projects.ts +27 -3
- package/.next/standalone/lib/qwen-projects.ts +106 -0
- package/.next/standalone/lib/qwen-sessions.ts +313 -0
- package/.next/standalone/node_modules/@next/env/package.json +1 -1
- package/.next/standalone/node_modules/next/dist/build/swc/index.js +1 -1
- package/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo-experimental.runtime.prod.js +1 -1
- package/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.prod.js +1 -1
- package/.next/standalone/node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js +1 -1
- package/.next/standalone/node_modules/next/dist/compiled/next-server/pages-turbo.runtime.prod.js +5 -5
- package/.next/standalone/node_modules/next/dist/lib/patch-incorrect-lockfile.js +3 -3
- package/.next/standalone/node_modules/next/dist/server/config.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-turbopack.js +2 -2
- package/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/image-optimizer.js +2 -2
- package/.next/standalone/node_modules/next/dist/server/lib/app-info-log.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/lib/incremental-cache/file-system-cache.js +17 -4
- package/.next/standalone/node_modules/next/dist/server/lib/start-server.js +1 -1
- package/.next/standalone/node_modules/next/dist/shared/lib/router/utils/escape-path-delimiters.js +1 -1
- package/.next/standalone/node_modules/next/dist/telemetry/anonymous-meta.js +1 -1
- package/.next/standalone/node_modules/next/dist/telemetry/events/swc-load-failure.js +1 -1
- package/.next/standalone/node_modules/next/dist/telemetry/events/version.js +2 -2
- package/.next/standalone/node_modules/next/package.json +10 -10
- package/.next/standalone/package.json +11 -11
- package/.next/standalone/sdk/python/uv.lock +29 -29
- package/.next/standalone/server.js +1 -1
- package/README.md +38 -7
- package/bin/failproofai.mjs +24 -7
- package/dist/cli.mjs +20313 -17756
- package/dist/worker.mjs +8521 -6768
- package/lib/cli-registry.ts +33 -1
- package/lib/cline-projects.ts +155 -0
- package/lib/cline-sessions.ts +268 -0
- package/lib/download-session.ts +37 -0
- package/lib/grok-projects.ts +123 -0
- package/lib/grok-sessions.ts +355 -0
- package/lib/ori-projects.ts +141 -0
- package/lib/ori-sessions.ts +221 -0
- package/lib/projects.ts +27 -3
- package/lib/qwen-projects.ts +106 -0
- package/lib/qwen-sessions.ts +313 -0
- package/package.json +11 -11
- package/src/audit/cli-adapters/cline.ts +50 -0
- package/src/audit/cli-adapters/grok.ts +70 -0
- package/src/audit/cli-adapters/index.ts +24 -0
- package/src/audit/cli-adapters/ori.ts +55 -0
- package/src/audit/cli-adapters/qwen.ts +71 -0
- package/src/hooks/batch-expand.ts +380 -0
- package/src/hooks/batch-fanout.ts +142 -0
- package/src/hooks/builtin-policies.ts +6 -4
- package/src/hooks/enforcement-capability.ts +97 -0
- package/src/hooks/handler.ts +61 -5
- package/src/hooks/harness-cli.ts +3 -1
- package/src/hooks/integrations.ts +756 -2
- package/src/hooks/normalize-cli-payload.ts +126 -0
- package/src/hooks/policy-evaluator.ts +297 -6
- package/src/hooks/resolve-transcript-path.ts +10 -0
- package/src/hooks/risk-patterns.ts +26 -0
- package/src/hooks/tool-name-canonicalize.ts +64 -0
- package/src/hooks/types.ts +533 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1le9jqc._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1p-qi2t._.js +0 -5
- package/.next/standalone/.next/server/chunks/_1-akg6w._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__00-s7h8._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__190won8._.js +0 -3
- 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]__1sc84bb._.js +0 -3
- package/.next/standalone/.next/static/chunks/03slu0c8_71y7.js +0 -1
- package/.next/standalone/.next/static/chunks/1-_zkmnm-jwei.js +0 -1
- package/.next/standalone/.next/static/chunks/1r9676mkvihto.js +0 -1
- package/.next/standalone/.next/static/chunks/30pct5s734jua.js +0 -6
- package/.next/standalone/.next/static/chunks/40nr6ehj4p3cw.css +0 -2
- package/.next/standalone/.next/static/chunks/41b5ptaocvi_l.js +0 -1
- /package/.next/standalone/.next/static/{JBYgkXkA1PS48m9P_hKNw → qJx3mbOQV-5ElrcRb4Sp7}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{JBYgkXkA1PS48m9P_hKNw → qJx3mbOQV-5ElrcRb4Sp7}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{JBYgkXkA1PS48m9P_hKNw → qJx3mbOQV-5ElrcRb4Sp7}/_ssgManifest.js +0 -0
package/src/hooks/types.ts
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
export const HOOK_SCOPES = ["user", "project", "local"] as const;
|
|
20
20
|
export type HookScope = (typeof HOOK_SCOPES)[number];
|
|
21
21
|
|
|
22
|
-
export const INTEGRATION_TYPES = ["claude", "codex", "copilot", "cursor", "opencode", "pi", "hermes", "openclaw", "factory", "devin", "antigravity", "goose"] as const;
|
|
22
|
+
export const INTEGRATION_TYPES = ["claude", "codex", "copilot", "cursor", "opencode", "pi", "hermes", "openclaw", "factory", "devin", "antigravity", "goose", "grok", "qwen", "ori", "cline"] as const;
|
|
23
23
|
export type IntegrationType = (typeof INTEGRATION_TYPES)[number];
|
|
24
24
|
|
|
25
25
|
export const CODEX_HOOK_SCOPES = ["user", "project"] as const;
|
|
@@ -999,6 +999,537 @@ export const GOOSE_TOOL_INPUT_MAP: Record<string, Record<string, string>> = {
|
|
|
999
999
|
LS: { path: "file_path" },
|
|
1000
1000
|
};
|
|
1001
1001
|
|
|
1002
|
+
// ---------------------------------------------------------------------------
|
|
1003
|
+
// grok (xAI's `grok` CLI) — 13th integration. Dual-pillar (live hooks + audit),
|
|
1004
|
+
// user + project scope, Claude/Codex-style external shell hooks. The entire
|
|
1005
|
+
// contract below was VERIFIED LIVE against grok 1.0.3 (1a29d5bc12) with a
|
|
1006
|
+
// recorder hook on all 14 events plus deny / stop-gate probes.
|
|
1007
|
+
//
|
|
1008
|
+
// 1. **The envelope is camelCase**, so — like Antigravity — normalizeCliPayload
|
|
1009
|
+
// has a `grok` branch. `toolName`/`toolInput`/`sessionId`/`transcriptPath`
|
|
1010
|
+
// → snake_case, `workspaceRoot` → `cwd`, `toolResult` → `tool_response`
|
|
1011
|
+
// (grok does NOT use Claude's `tool_response`), `stopHookActive` →
|
|
1012
|
+
// `stop_hook_active`. NOTE `hookEventName`'s *value* is snake_case
|
|
1013
|
+
// ("pre_tool_use") while the `--hook` arg is PascalCase, so the arg is the
|
|
1014
|
+
// canonical source and there is NO GROK_EVENT_MAP.
|
|
1015
|
+
//
|
|
1016
|
+
// 2. **Deny = `{"decision":"deny","reason"}` on stdout at exit 0.** VERIFIED
|
|
1017
|
+
// live, and it beat `--yolo` (permissionMode `bypassPermissions`). grok
|
|
1018
|
+
// does NOT read Claude's `hookSpecificOutput.permissionDecision` shape —
|
|
1019
|
+
// also verified live, by A/B: the identical hook emitting Claude's shape
|
|
1020
|
+
// let `echo` run, emitting grok's shape blocked it. This is why
|
|
1021
|
+
// isGrokEnvelope() exists (see normalize-cli-payload.ts).
|
|
1022
|
+
//
|
|
1023
|
+
// 3. **Stop fires TWICE per session** — once per real turn end
|
|
1024
|
+
// (`reason: "end_turn"`) and once at shutdown (`reason: "shutdown"`),
|
|
1025
|
+
// whose decision grok parses and then IGNORES (no turn is left to
|
|
1026
|
+
// continue). So the Stop branch in policy-evaluator.ts gates on
|
|
1027
|
+
// `reason === "end_turn"`; blocking on the shutdown fire would emit a deny
|
|
1028
|
+
// that is counted as enforcement and can never be acted on. Captured
|
|
1029
|
+
// sequence, one turn: end_turn/stopHookActive=false (we blocked) → the
|
|
1030
|
+
// agent ran the required command → end_turn/stopHookActive=true (allowed)
|
|
1031
|
+
// → shutdown. Cap: 8 continuations per turn, then grok forces the stop.
|
|
1032
|
+
//
|
|
1033
|
+
// 4. **Project hooks require a GIT REPO** — undocumented, verified live: in a
|
|
1034
|
+
// *trusted* non-git directory holding a valid `.grok/hooks/*.json`, grok
|
|
1035
|
+
// logs `project_sources=0` and the hook never fires; after `git init` in
|
|
1036
|
+
// the same directory it logs `project_sources=4` and fires. A project-scope
|
|
1037
|
+
// install into a non-git dir is a silent no-op, so the installer warns.
|
|
1038
|
+
// Project scope additionally requires folder trust (`--trust` /
|
|
1039
|
+
// `/hooks-trust`); user scope (`~/.grok/hooks/`) is always trusted.
|
|
1040
|
+
//
|
|
1041
|
+
// Settings paths (VERIFIED):
|
|
1042
|
+
// user → ~/.grok/hooks/failproofai.json (always trusted)
|
|
1043
|
+
// project → <repo>/.grok/hooks/failproofai.json (needs git + folder trust)
|
|
1044
|
+
//
|
|
1045
|
+
// `timeout` is in SECONDS (grok's default is 5; 600 for Stop/SubagentStop).
|
|
1046
|
+
// Env injected on every hook: GROK_HOOK_EVENT, GROK_HOOK_NAME, GROK_SESSION_ID,
|
|
1047
|
+
// GROK_WORKSPACE_ROOT, and CLAUDE_PROJECT_DIR (a Claude-compatible alias) — so
|
|
1048
|
+
// the dogfood config can use $CLAUDE_PROJECT_DIR like .claude/settings.json.
|
|
1049
|
+
//
|
|
1050
|
+
// Audit pillar: `~/.grok/sessions/<percent-encoded-cwd>/<sessionId>/` —
|
|
1051
|
+
// PERCENT encoding (`%2Fhome%2Fyou%2Frepo`), not Claude's dash style. Each
|
|
1052
|
+
// session dir holds chat_history.jsonl + events.jsonl + summary.json (the last
|
|
1053
|
+
// carries `info.cwd`, `session_summary`, `num_messages`, `current_model_id`).
|
|
1054
|
+
// See lib/grok-sessions.ts. `GROK_HOME` overrides the home dir for tests.
|
|
1055
|
+
export const GROK_HOOK_SCOPES = ["user", "project"] as const;
|
|
1056
|
+
export type GrokHookScope = (typeof GROK_HOOK_SCOPES)[number];
|
|
1057
|
+
|
|
1058
|
+
// All 14 of grok's events, which is its entire surface. Every name here was
|
|
1059
|
+
// accepted by a live grok 1.0.3 (`hooks: loaded from global source … count=14`,
|
|
1060
|
+
// `loaded hooks hook_count=14`, no unknown-key warning) — grok silently SKIPS
|
|
1061
|
+
// unrecognized event keys, so acceptance is the thing to verify, and it was.
|
|
1062
|
+
// `Notification` and `StopFailure` were additionally observed firing.
|
|
1063
|
+
//
|
|
1064
|
+
// The six beyond the original eight are all OBSERVATION — grok's own ACP
|
|
1065
|
+
// handshake advertises `blockingEvents: ["pre_tool_use","stop","subagent_stop"]`
|
|
1066
|
+
// and that is the complete list, so nothing added here can ever deny. They are
|
|
1067
|
+
// installed for custom-policy surface and audit signal, and because the cost of
|
|
1068
|
+
// an event that never fires is zero.
|
|
1069
|
+
export const GROK_HOOK_EVENT_TYPES = [
|
|
1070
|
+
"SessionStart",
|
|
1071
|
+
"UserPromptSubmit",
|
|
1072
|
+
"PreToolUse",
|
|
1073
|
+
"PostToolUse",
|
|
1074
|
+
"PostToolUseFailure",
|
|
1075
|
+
"PermissionDenied",
|
|
1076
|
+
"Stop",
|
|
1077
|
+
"StopFailure",
|
|
1078
|
+
"Notification",
|
|
1079
|
+
"SubagentStart",
|
|
1080
|
+
"SubagentStop",
|
|
1081
|
+
"PreCompact",
|
|
1082
|
+
"PostCompact",
|
|
1083
|
+
"SessionEnd",
|
|
1084
|
+
] as const;
|
|
1085
|
+
export type GrokHookEventType = (typeof GROK_HOOK_EVENT_TYPES)[number];
|
|
1086
|
+
|
|
1087
|
+
/**
|
|
1088
|
+
* grok's tool ids → Claude PascalCase canonical names so existing builtins
|
|
1089
|
+
* (which match `toolName === "Bash"`) fire unchanged. Every entry below was
|
|
1090
|
+
* observed on the wire, not read from a doc — which matters here, because
|
|
1091
|
+
* grok's own docs disagree with themselves: the hooks doc calls the shell tool
|
|
1092
|
+
* `run_terminal_command` and the headless doc calls it `run_terminal_cmd`. The
|
|
1093
|
+
* wire says `run_terminal_command`; the alias is kept so a matcher written
|
|
1094
|
+
* against either name still canonicalizes. Unknown tools pass through via the
|
|
1095
|
+
* `?? raw` fallback in handler.ts:canonicalizeToolName.
|
|
1096
|
+
*/
|
|
1097
|
+
export const GROK_TOOL_MAP: Record<string, string> = {
|
|
1098
|
+
run_terminal_command: "Bash",
|
|
1099
|
+
run_terminal_cmd: "Bash",
|
|
1100
|
+
write: "Write",
|
|
1101
|
+
read_file: "Read",
|
|
1102
|
+
search_replace: "Edit",
|
|
1103
|
+
grep: "Grep",
|
|
1104
|
+
list_dir: "LS",
|
|
1105
|
+
web_search: "WebSearch",
|
|
1106
|
+
web_fetch: "WebFetch",
|
|
1107
|
+
spawn_subagent: "Task",
|
|
1108
|
+
};
|
|
1109
|
+
|
|
1110
|
+
/**
|
|
1111
|
+
* Per-tool input-key translation, keyed by the *canonical* tool name. Only two
|
|
1112
|
+
* of grok's tools deviate, and both were found by capture rather than by
|
|
1113
|
+
* reading: `read_file` delivers the path as `target_file` and `list_dir` as
|
|
1114
|
+
* `target_directory`. The `read_file` entry is the load-bearing one — without
|
|
1115
|
+
* it a live `.env` read sails past block-env-files / block-read-outside-cwd,
|
|
1116
|
+
* the exact bug COPILOT_TOOL_INPUT_MAP was added to fix. Everything else is
|
|
1117
|
+
* already canonical: Bash `command`, Write `file_path`/`content`, Edit
|
|
1118
|
+
* `file_path`/`old_string`/`new_string`, Grep `pattern`/`path`.
|
|
1119
|
+
*/
|
|
1120
|
+
export const GROK_TOOL_INPUT_MAP: Record<string, Record<string, string>> = {
|
|
1121
|
+
Read: { target_file: "file_path" },
|
|
1122
|
+
LS: { target_directory: "path" },
|
|
1123
|
+
};
|
|
1124
|
+
|
|
1125
|
+
// ---------------------------------------------------------------------------
|
|
1126
|
+
// qwen (Alibaba's Qwen Code, `qwen`) — 14th integration. Dual-pillar, user +
|
|
1127
|
+
// project scope. The CHEAPEST integration in the codebase: qwen is a near-pure
|
|
1128
|
+
// Claude clone on the wire, so it needs NO event map, NO payload normalization,
|
|
1129
|
+
// and NO tool-input map. Verified live against @qwen-code/qwen-code 0.21.12.
|
|
1130
|
+
//
|
|
1131
|
+
// 1. **Payload is pure Claude snake_case** — `hook_event_name` (PascalCase
|
|
1132
|
+
// *value*, unlike grok), `session_id`, `transcript_path`, `cwd`,
|
|
1133
|
+
// `permission_mode`, `tool_name`, `tool_input`, `tool_response`,
|
|
1134
|
+
// `stop_hook_active`. Nothing to normalize.
|
|
1135
|
+
//
|
|
1136
|
+
// 2. **Deny = `hookSpecificOutput.permissionDecision`** ("allow" | "deny" |
|
|
1137
|
+
// "ask"), which is Claude's own PreToolUse shape — so the generic Claude
|
|
1138
|
+
// branch in policy-evaluator.ts already emits the right thing and qwen
|
|
1139
|
+
// needs no PreToolUse special-case. VERIFIED live: it beat `-y` (yolo) and
|
|
1140
|
+
// the reason reached the model verbatim. ("ask" degrades to deny in
|
|
1141
|
+
// headless and in background subagents.) Stop takes the top-level
|
|
1142
|
+
// `{decision:"block",reason}` shape instead, which is why the qwen branch
|
|
1143
|
+
// below exists at all.
|
|
1144
|
+
//
|
|
1145
|
+
// 3. **`stop_hook_active` is TRUE on the FIRST Stop fire**, before anything
|
|
1146
|
+
// has blocked — verified live. It is therefore NOT a usable "already
|
|
1147
|
+
// retrying" signal on qwen, and no failproofai loop guard may depend on
|
|
1148
|
+
// it. (Unlike grok, qwen fires no session-end Stop: both fires are real.)
|
|
1149
|
+
//
|
|
1150
|
+
// 4. **`UserPromptSubmit` fires per MODEL INVOCATION, not per user prompt** —
|
|
1151
|
+
// one user turn produced FOUR of them (initial query + one per tool-result
|
|
1152
|
+
// continuation). qwen's own docs confirm it covers UserQuery/ToolResult/
|
|
1153
|
+
// Hook sends and warn that `prompt` is not necessarily user input. Any
|
|
1154
|
+
// UserPromptSubmit policy fires N× per turn here; `submitted_prompt` is
|
|
1155
|
+
// present only for interactive-TUI submissions (absent in headless, ACP,
|
|
1156
|
+
// serve, SDK).
|
|
1157
|
+
//
|
|
1158
|
+
// Settings paths (VERIFIED): the `hooks` key inside qwen's normal settings.
|
|
1159
|
+
// user → ~/.qwen/settings.json
|
|
1160
|
+
// project → <cwd>/.qwen/settings.json
|
|
1161
|
+
//
|
|
1162
|
+
// `timeout` is in MILLISECONDS (default 60000) — qwen is the ONLY integration
|
|
1163
|
+
// that is not seconds-based, so buildHookEntry must not be "simplified" to
|
|
1164
|
+
// share the others' value. `disableAllHooks: true` (top level) and `--safe-mode`
|
|
1165
|
+
// both disable every hook.
|
|
1166
|
+
//
|
|
1167
|
+
// Audit pillar: `~/.qwen/projects/<dash-encoded-cwd>/chats/<sessionId>.jsonl` —
|
|
1168
|
+
// Claude-style encoded-cwd folders, one JSONL per session, lines carrying
|
|
1169
|
+
// `{sessionId, timestamp, type: user|assistant|system|tool_result, cwd}`. A real
|
|
1170
|
+
// cwd per line means audit groups by project like Claude/Devin/Goose. See
|
|
1171
|
+
// lib/qwen-sessions.ts. `QWEN_HOME` overrides the home dir for tests.
|
|
1172
|
+
export const QWEN_HOOK_SCOPES = ["user", "project"] as const;
|
|
1173
|
+
export type QwenHookScope = (typeof QWEN_HOOK_SCOPES)[number];
|
|
1174
|
+
|
|
1175
|
+
// Every event below has a real `executeHooks("<Event>")` dispatch site in the
|
|
1176
|
+
// shipped qwen bundle (verified by reading it, not the docs — which is also how
|
|
1177
|
+
// `InstructionsLoaded`, `UserPromptExpansion` and `PostToolBatch` turned up:
|
|
1178
|
+
// all three are dispatched but absent from qwen's documented event table).
|
|
1179
|
+
// TodoCreated/TodoCompleted/PostToolBatch/InstructionsLoaded/Notification were
|
|
1180
|
+
// additionally observed firing in a live 0.21.12 session.
|
|
1181
|
+
//
|
|
1182
|
+
// Deliberately NOT subscribed:
|
|
1183
|
+
// • `MessageDisplay` — fires per streaming chunk, i.e. a hook process per
|
|
1184
|
+
// chunk. The one entry here that could make hooks feel slow.
|
|
1185
|
+
// • `PostToolBatch` — fired 6× in the same task PostToolUse fired 5×, and
|
|
1186
|
+
// carries the same tool calls in batch form. Measured at +76% hook
|
|
1187
|
+
// invocations for a task, against no builtin that reads it. One line to add
|
|
1188
|
+
// later if a custom policy ever wants batch granularity.
|
|
1189
|
+
// • `SessionDelete` — no canonical equivalent, and little to enforce on.
|
|
1190
|
+
export const QWEN_HOOK_EVENT_TYPES = [
|
|
1191
|
+
"SessionStart",
|
|
1192
|
+
"UserPromptSubmit",
|
|
1193
|
+
"PreToolUse",
|
|
1194
|
+
"PostToolUse",
|
|
1195
|
+
"PostToolUseFailure",
|
|
1196
|
+
"PermissionRequest",
|
|
1197
|
+
"PermissionDenied",
|
|
1198
|
+
"Stop",
|
|
1199
|
+
"StopFailure",
|
|
1200
|
+
"SubagentStart",
|
|
1201
|
+
"SubagentStop",
|
|
1202
|
+
"PreCompact",
|
|
1203
|
+
"PostCompact",
|
|
1204
|
+
"Notification",
|
|
1205
|
+
"InstructionsLoaded",
|
|
1206
|
+
"UserPromptExpansion",
|
|
1207
|
+
"TodoCreated",
|
|
1208
|
+
"TodoCompleted",
|
|
1209
|
+
"SessionEnd",
|
|
1210
|
+
] as const;
|
|
1211
|
+
export type QwenHookEventType = (typeof QWEN_HOOK_EVENT_TYPES)[number];
|
|
1212
|
+
|
|
1213
|
+
/**
|
|
1214
|
+
* qwen event name → canonical HookEventType.
|
|
1215
|
+
*
|
|
1216
|
+
* Seventeen of nineteen are already canonical and map to themselves; this map
|
|
1217
|
+
* exists for the two that are not. qwen calls its task list "todos", so
|
|
1218
|
+
* `TodoCreated`/`TodoCompleted` are the same concept failproofai and Claude
|
|
1219
|
+
* call `TaskCreated`/`TaskCompleted`, and mapping them lets a policy written
|
|
1220
|
+
* once fire on both.
|
|
1221
|
+
*
|
|
1222
|
+
* These two are also the only ADDED events on either CLI that can actually
|
|
1223
|
+
* block. qwen runs todo hooks in two phases and the payload says which:
|
|
1224
|
+
* during `phase: "validation"` a `{decision:"block"|"deny", reason}` prevents
|
|
1225
|
+
* the write and the reason goes back to the model; during `phase: "postWrite"`
|
|
1226
|
+
* the todo is already persisted and a block is ignored. Both phases were
|
|
1227
|
+
* observed live (`phase: "validation"` on every capture).
|
|
1228
|
+
*
|
|
1229
|
+
* Exhaustive `Record<QwenHookEventType, HookEventType>` so tsc fails the build
|
|
1230
|
+
* if an event is added here without deciding what it canonicalizes to.
|
|
1231
|
+
*/
|
|
1232
|
+
export const QWEN_EVENT_MAP: Record<QwenHookEventType, HookEventType> = {
|
|
1233
|
+
SessionStart: "SessionStart",
|
|
1234
|
+
UserPromptSubmit: "UserPromptSubmit",
|
|
1235
|
+
PreToolUse: "PreToolUse",
|
|
1236
|
+
PostToolUse: "PostToolUse",
|
|
1237
|
+
PostToolUseFailure: "PostToolUseFailure",
|
|
1238
|
+
PermissionRequest: "PermissionRequest",
|
|
1239
|
+
PermissionDenied: "PermissionDenied",
|
|
1240
|
+
Stop: "Stop",
|
|
1241
|
+
StopFailure: "StopFailure",
|
|
1242
|
+
SubagentStart: "SubagentStart",
|
|
1243
|
+
SubagentStop: "SubagentStop",
|
|
1244
|
+
PreCompact: "PreCompact",
|
|
1245
|
+
PostCompact: "PostCompact",
|
|
1246
|
+
Notification: "Notification",
|
|
1247
|
+
InstructionsLoaded: "InstructionsLoaded",
|
|
1248
|
+
UserPromptExpansion: "UserPromptExpansion",
|
|
1249
|
+
TodoCreated: "TaskCreated",
|
|
1250
|
+
TodoCompleted: "TaskCompleted",
|
|
1251
|
+
SessionEnd: "SessionEnd",
|
|
1252
|
+
};
|
|
1253
|
+
|
|
1254
|
+
/**
|
|
1255
|
+
* qwen's runtime tool ids → Claude PascalCase canonical names. All six were
|
|
1256
|
+
* observed live. qwen also accepts its own display names (`WriteFile`,
|
|
1257
|
+
* `ReadFile`) as matcher aliases, so those are mapped too for configs written
|
|
1258
|
+
* against the older names. Unknown tools pass through via the `?? raw`
|
|
1259
|
+
* fallback.
|
|
1260
|
+
*
|
|
1261
|
+
* There is deliberately NO QWEN_TOOL_INPUT_MAP: every tool already delivers
|
|
1262
|
+
* canonical keys — `run_shell_command` `{command}`, `read_file` `{file_path}`,
|
|
1263
|
+
* `write_file` `{file_path, content}`, `edit` `{file_path, old_string,
|
|
1264
|
+
* new_string}`, `grep_search` `{pattern, path}`, `list_directory` `{path}`.
|
|
1265
|
+
*/
|
|
1266
|
+
export const QWEN_TOOL_MAP: Record<string, string> = {
|
|
1267
|
+
run_shell_command: "Bash",
|
|
1268
|
+
read_file: "Read",
|
|
1269
|
+
ReadFile: "Read",
|
|
1270
|
+
read_many_files: "Read",
|
|
1271
|
+
write_file: "Write",
|
|
1272
|
+
WriteFile: "Write",
|
|
1273
|
+
edit: "Edit",
|
|
1274
|
+
replace: "Edit",
|
|
1275
|
+
grep_search: "Grep",
|
|
1276
|
+
search_file_content: "Grep",
|
|
1277
|
+
glob: "Glob",
|
|
1278
|
+
list_directory: "LS",
|
|
1279
|
+
web_fetch: "WebFetch",
|
|
1280
|
+
google_web_search: "WebSearch",
|
|
1281
|
+
task: "Task",
|
|
1282
|
+
todo_write: "TodoWrite",
|
|
1283
|
+
};
|
|
1284
|
+
|
|
1285
|
+
|
|
1286
|
+
// ── Ori (OpenRouter's ori) ──────────────────────────────────────────────────
|
|
1287
|
+
//
|
|
1288
|
+
// `ori` is two products behind one binary, and only the second is this
|
|
1289
|
+
// integration:
|
|
1290
|
+
//
|
|
1291
|
+
// 1. A LAUNCHER for other agent CLIs (`ori claude`, `ori codex`, `ori grok`,
|
|
1292
|
+
// `ori opencode`, `ori hermes`, `ori omp`, `ori prime-agent`, `ori kilo`,
|
|
1293
|
+
// `ori dsh`) that runs the real third-party binary under OpenRouter
|
|
1294
|
+
// credentials. It injects credentials and NOTHING else — verified live
|
|
1295
|
+
// against ori 0.12.0+68f9a36: `ori claude` passes `--settings '<json>'`
|
|
1296
|
+
// carrying only `apiKeyHelper` + `env`; `ori codex` passes `-c
|
|
1297
|
+
// model_provider=…` key overrides (which override `config.toml` keys, a
|
|
1298
|
+
// different file from `hooks.json`); `ori grok` and `ori opencode` set env
|
|
1299
|
+
// vars only; and NONE of them redirect HOME or a config dir. Claude's
|
|
1300
|
+
// `--settings` MERGES (proven: a project SessionStart hook fired
|
|
1301
|
+
// identically with and without ori's exact blob) and opencode's
|
|
1302
|
+
// `OPENCODE_CONFIG_CONTENT` merges too (proven against `opencode debug
|
|
1303
|
+
// config`: the `plugin` array survived intact and `openrouter` was added
|
|
1304
|
+
// beside the pre-existing provider). So failproofai's EXISTING per-CLI
|
|
1305
|
+
// hooks keep enforcing under `ori <agent>`, and this integration
|
|
1306
|
+
// deliberately does nothing for that path.
|
|
1307
|
+
//
|
|
1308
|
+
// 2. ori's OWN agent — bare `ori` / `ori code`, the built-in
|
|
1309
|
+
// `@ori-runloop/agent-loop` harness. THAT is what this integration gates.
|
|
1310
|
+
//
|
|
1311
|
+
// Enforcement is via ori's PUBLISHED EXTENSION POINTS, supplied by a feature: a
|
|
1312
|
+
// workspace package under the global workspace's `features/`, AUTO-DISCOVERED
|
|
1313
|
+
// with no config file to register it in (like Goose's dropped plugin dir, and
|
|
1314
|
+
// unlike OpenCode, which must be named in `opencode.json`). failproofai
|
|
1315
|
+
// generates that feature at `~/.ori/global/features/failproofai/`. USER scope
|
|
1316
|
+
// only — bare `ori` boots the GLOBAL workspace rather than the project's, so
|
|
1317
|
+
// one install covers every project and there is no project-scope equivalent.
|
|
1318
|
+
//
|
|
1319
|
+
// Three points, each `policy: "unique"` (exactly one provider apiece, so a
|
|
1320
|
+
// competing feature claiming one displaces us):
|
|
1321
|
+
//
|
|
1322
|
+
// approval-policy static {defaultAction, rules[]} — consulted in BOTH modes
|
|
1323
|
+
// approval-asker dynamic per-call callback — MANUAL mode only
|
|
1324
|
+
// unattended-approvals dynamic per-call callback — unattended runs
|
|
1325
|
+
//
|
|
1326
|
+
// **The mode caveat is the whole story for coverage** (verified live). ori's
|
|
1327
|
+
// approval mode defaults to `self-drive`, which "approves every command without
|
|
1328
|
+
// prompting", and in that mode the DYNAMIC points are NEVER CALLED. Proven
|
|
1329
|
+
// three ways: no callback fired under self-drive; still none after adding
|
|
1330
|
+
// `approval-policy` with `defaultAction:"ask"` (so `ask` degrades to
|
|
1331
|
+
// auto-approve); but `defaultAction:"reject"` DID block every tool call — which
|
|
1332
|
+
// proves the static point is wired and that it is specifically the dynamic
|
|
1333
|
+
// asker self-drive skips. So failproofai's per-argument policies enforce on ori
|
|
1334
|
+
// only under `--approvals manual` (or `/approvals` → manual in the TUI). There
|
|
1335
|
+
// is no config key or env var to change that default: searched `config.json`,
|
|
1336
|
+
// `ori.md` frontmatter, the `ORI_*` env surface and the shipped selfdev docs.
|
|
1337
|
+
// `ORI_STATIC_APPROVAL_POLICY` below is what we can still enforce in the
|
|
1338
|
+
// default mode, and it is deliberately `ask` (a no-op there) rather than
|
|
1339
|
+
// `reject`, because claiming the point with a blanket reject would brick every
|
|
1340
|
+
// self-drive session the moment failproofai is installed.
|
|
1341
|
+
//
|
|
1342
|
+
// The one thing ori does BETTER than every other integration: both dynamic
|
|
1343
|
+
// points declare `failureBehavior: "deny"` — "a throwing, rejecting, or
|
|
1344
|
+
// malformed provider denies the request". **ori fails closed natively**, so a
|
|
1345
|
+
// failproofai fault blocks the call instead of waving it through. Goose and
|
|
1346
|
+
// OpenClaw fail open today; everywhere else we built fail-closed ourselves.
|
|
1347
|
+
//
|
|
1348
|
+
// The verdict shape is `{outcome: "allow" | "deny"}` — binary, and NO reason
|
|
1349
|
+
// string reaches the model, so a denial arrives as a bare tool failure.
|
|
1350
|
+
// `instruct()` therefore degrades to allow + a stderr note. There is no Stop
|
|
1351
|
+
// event at all, so the 5 `require-*-before-stop` builtins are INAPPLICABLE on
|
|
1352
|
+
// ori, exactly as on Hermes and Goose.
|
|
1353
|
+
//
|
|
1354
|
+
// Gate payload, captured live off real tool calls (ori 0.12.0+68f9a36 driving
|
|
1355
|
+
// nvidia/nemotron-3.5-lightning:free):
|
|
1356
|
+
// {tool:"bash", arguments:[{name:"command"}], capabilities:["execute","read","write"]}
|
|
1357
|
+
// {tool:"read", arguments:[{name:"path"}], capabilities:["read"]}
|
|
1358
|
+
// {tool:"write", arguments:[{name:"path"},{name:"content"}], capabilities:["write"]}
|
|
1359
|
+
// {tool:"glob", arguments:[{name:"pattern"}], capabilities:["read"]}
|
|
1360
|
+
// {tool:"grep", arguments:[{name:"pattern"},{name:"path"}], capabilities:["read"]}
|
|
1361
|
+
// {tool:"edit", arguments:[{name:"patch"}], capabilities:["read","write"]}
|
|
1362
|
+
//
|
|
1363
|
+
// Two properties that bite:
|
|
1364
|
+
// • `arguments` is a flat name/value STRING array — every value arrives
|
|
1365
|
+
// stringified, so a policy expecting a structured tool input sees text.
|
|
1366
|
+
// • The gate fires TWICE per tool call: once with `escalated:false`, then
|
|
1367
|
+
// again with `escalated:true` plus a synthetic `{name:"escalated",
|
|
1368
|
+
// value:"true"}` argument. A policy must be idempotent across that ladder.
|
|
1369
|
+
//
|
|
1370
|
+
// `edit` is the awkward one: it carries the entire change as a single `patch`
|
|
1371
|
+
// string in OpenAI apply_patch format (`*** Begin Patch` / `*** Update File:
|
|
1372
|
+
// <path>` / `*** End Patch`) with NO separate path argument — so `file_path`,
|
|
1373
|
+
// which `block-env-files`, `block-secrets-write` and every other path builtin
|
|
1374
|
+
// reads, is simply absent and those builtins would never fire on an edit.
|
|
1375
|
+
// `oriPatchFilePaths()` in tool-name-canonicalize.ts recovers it from the patch
|
|
1376
|
+
// header. KNOWN GAP: a multi-file patch yields several paths and `file_path`
|
|
1377
|
+
// holds only one, so builtins see the FIRST and a policy that would have denied
|
|
1378
|
+
// on a later file does not fire; the full list is exposed as `ori_patch_files`
|
|
1379
|
+
// for custom policies to read.
|
|
1380
|
+
export const ORI_HOOK_SCOPES = ["user"] as const;
|
|
1381
|
+
export type OriHookScope = (typeof ORI_HOOK_SCOPES)[number];
|
|
1382
|
+
|
|
1383
|
+
// Only PreToolUse: all three approval points gate a tool call and nothing else.
|
|
1384
|
+
// ori has no prompt-submit, post-tool, session or stop hook we can subscribe to
|
|
1385
|
+
// (its feature-to-feature `hooks` export is documented upstream as "consumer
|
|
1386
|
+
// wiring and dispatch land in #1068" — i.e. not wired yet).
|
|
1387
|
+
export const ORI_HOOK_EVENT_TYPES = ["PreToolUse"] as const;
|
|
1388
|
+
export type OriHookEventType = (typeof ORI_HOOK_EVENT_TYPES)[number];
|
|
1389
|
+
|
|
1390
|
+
// ori tool ids arrive lowercase. All six below were observed at the live
|
|
1391
|
+
// approval gate; unknown tools pass through unchanged so they still reach the
|
|
1392
|
+
// audit, just unmatched by name-keyed builtins.
|
|
1393
|
+
export const ORI_TOOL_MAP: Record<string, string> = {
|
|
1394
|
+
bash: "Bash",
|
|
1395
|
+
read: "Read",
|
|
1396
|
+
write: "Write",
|
|
1397
|
+
edit: "Edit",
|
|
1398
|
+
glob: "Glob",
|
|
1399
|
+
grep: "Grep",
|
|
1400
|
+
};
|
|
1401
|
+
|
|
1402
|
+
// Keyed by the CANONICAL tool name (the handler canonicalizes the name first).
|
|
1403
|
+
// `bash`'s `command`, `glob`/`grep`'s `pattern` and `grep`'s `path` are already
|
|
1404
|
+
// the keys Claude builtins read, so they need no entry; `read`/`write` deliver
|
|
1405
|
+
// the path as `path`. `Edit` is absent on purpose — its path is inside the
|
|
1406
|
+
// patch blob, not a key, and is derived instead.
|
|
1407
|
+
export const ORI_TOOL_INPUT_MAP: Record<string, Record<string, string>> = {
|
|
1408
|
+
Read: { path: "file_path" },
|
|
1409
|
+
Write: { path: "file_path" },
|
|
1410
|
+
};
|
|
1411
|
+
|
|
1412
|
+
// Claimed so `approval-policy` is ours (it is `unique`, so leaving it unclaimed
|
|
1413
|
+
// invites another feature to take it), but deliberately inert: `ask` is what
|
|
1414
|
+
// self-drive already does. See the mode caveat above for why this is not
|
|
1415
|
+
// `reject`.
|
|
1416
|
+
export const ORI_STATIC_APPROVAL_POLICY = {
|
|
1417
|
+
defaultAction: "ask",
|
|
1418
|
+
rules: [] as const,
|
|
1419
|
+
} as const;
|
|
1420
|
+
|
|
1421
|
+
|
|
1422
|
+
// ── Cline (cline CLI) ───────────────────────────────────────────────────────
|
|
1423
|
+
//
|
|
1424
|
+
// Cline is the only integration whose config is a DIRECTORY OF EVENT-NAMED
|
|
1425
|
+
// FILES rather than a settings file. There is no JSON to merge and no array to
|
|
1426
|
+
// append to: the install drops one launcher script per event, named exactly for
|
|
1427
|
+
// the event it subscribes to. Verified live against cline v3.0.60.
|
|
1428
|
+
//
|
|
1429
|
+
// Three rules from that contract govern everything below:
|
|
1430
|
+
//
|
|
1431
|
+
// 1. **THE FILENAME IS THE EVENT**, case-insensitively, and only ten names
|
|
1432
|
+
// exist. A typo is not an error — it is silence. This is what made an
|
|
1433
|
+
// earlier probe conclude, wrongly, that cline had no reachable hook
|
|
1434
|
+
// surface: the files were in the right directory under the wrong names,
|
|
1435
|
+
// and cline skipped them without a log line.
|
|
1436
|
+
// 2. **The EXTENSION must be in the allowlist** — `"" .sh .bash .zsh .js .mjs
|
|
1437
|
+
// .cjs .ts .mts .cts .py .ps1` — or the file is skipped, also silently. A
|
|
1438
|
+
// `hooks.json` is invisible twice over. The file need NOT be executable;
|
|
1439
|
+
// the interpreter comes from the shebang, else the extension.
|
|
1440
|
+
// 3. **THE EXIT CODE IS IGNORED** on every event. The verdict is the single
|
|
1441
|
+
// JSON object on stdout, so the launcher must ALWAYS print exactly one
|
|
1442
|
+
// object — `{}` when failproofai produced nothing. Unparseable stdout makes
|
|
1443
|
+
// cline skip the hook and run the tool.
|
|
1444
|
+
//
|
|
1445
|
+
// Hook directories, in cline's own search order:
|
|
1446
|
+
// ~/Documents/Cline/Hooks
|
|
1447
|
+
// $CLINE_DIR/hooks (default ~/.cline/hooks) ← user scope
|
|
1448
|
+
// <workspace>/.clinerules/hooks ← project scope
|
|
1449
|
+
// <workspace>/.cline/hooks
|
|
1450
|
+
// **`--hooks-dir` IS A DEAD FLAG** in v3.0.60: it writes `CLINE_HOOKS_DIR`,
|
|
1451
|
+
// which appears exactly once in the shipped binary — that write — and is read by
|
|
1452
|
+
// nothing. Never emit it.
|
|
1453
|
+
//
|
|
1454
|
+
// Deny shape: `{"cancel": true, "errorMessage": "…"}`. Cline's verdict schema is
|
|
1455
|
+
// `{contextModification?, cancel?, review?, errorMessage?, context?,
|
|
1456
|
+
// overrideInput?}` — there is NO `decision` / `block` / `permissionDecision`
|
|
1457
|
+
// field, so every generic branch in policy-evaluator.ts is inert for it.
|
|
1458
|
+
// `overrideInput` is a real MUTATE channel and `context` a real
|
|
1459
|
+
// additional-context channel; neither is wired yet.
|
|
1460
|
+
//
|
|
1461
|
+
// **FAIL-OPEN, with no way to opt out.** A timeout (120s default), a parse
|
|
1462
|
+
// failure or a spawn error makes cline skip the hook and run the tool. Unlike
|
|
1463
|
+
// ori there is no `failureBehavior:"deny"` to inherit, so a failproofai fault on
|
|
1464
|
+
// cline is a silent allow — which is why the generated launcher prints `{}` on
|
|
1465
|
+
// any error rather than partial output that might parse as something else.
|
|
1466
|
+
//
|
|
1467
|
+
// **THE PRODUCT CAVEAT:** `cancel:true` becomes `{stop:true}` and is applied by
|
|
1468
|
+
// `applyStopControl`, which THROWS `ControlledStopError` — it ABORTS THE WHOLE
|
|
1469
|
+
// RUN (observed live as `[abort] aborted by another client`), not just the one
|
|
1470
|
+
// tool call. It is a STRONGER action than a per-tool deny, not a weaker one.
|
|
1471
|
+
//
|
|
1472
|
+
// PreToolUse payload, captured live:
|
|
1473
|
+
// {"hookName":"tool_call","iteration":1,"taskId":"conv_…","userId":"…",
|
|
1474
|
+
// "workspaceRoots":["/abs/path"],"workspaceInfo":{"rootPath":"…","hint":"…"},
|
|
1475
|
+
// "agent_id":"…","parent_agent_id":null,"sessionContext":{"rootSessionId":"…"},
|
|
1476
|
+
// "tool_call":{"id":"call_…","name":"run_commands","input":{"commands":["echo hi"]}},
|
|
1477
|
+
// "preToolUse":{"toolName":"run_commands","parameters":{"commands":"[\"echo hi\"]"}}}
|
|
1478
|
+
// `tool_call.input` is the source of truth; `preToolUse.parameters`
|
|
1479
|
+
// JSON-STRINGIFIES every array value, so reading it would hand the batch
|
|
1480
|
+
// expander a string and silently drop the entire fan-out.
|
|
1481
|
+
export const CLINE_HOOK_SCOPES = ["user", "project"] as const;
|
|
1482
|
+
export type ClineHookScope = (typeof CLINE_HOOK_SCOPES)[number];
|
|
1483
|
+
|
|
1484
|
+
// The nine we install. `PreCompact` is one of cline's ten names but is
|
|
1485
|
+
// DELIBERATELY EXCLUDED: it maps to undefined upstream and is skipped at
|
|
1486
|
+
// dispatch, so a file for it costs a subprocess per compaction and buys nothing.
|
|
1487
|
+
export const CLINE_HOOK_EVENT_TYPES = [
|
|
1488
|
+
"TaskStart",
|
|
1489
|
+
"TaskResume",
|
|
1490
|
+
"TaskCancel",
|
|
1491
|
+
"TaskComplete",
|
|
1492
|
+
"TaskError",
|
|
1493
|
+
"PreToolUse",
|
|
1494
|
+
"PostToolUse",
|
|
1495
|
+
"UserPromptSubmit",
|
|
1496
|
+
"SessionShutdown",
|
|
1497
|
+
] as const;
|
|
1498
|
+
export type ClineHookEventType = (typeof CLINE_HOOK_EVENT_TYPES)[number];
|
|
1499
|
+
|
|
1500
|
+
// These nine strings are simultaneously the `--hook` argument, the installed
|
|
1501
|
+
// file's basename, and the key here.
|
|
1502
|
+
export const CLINE_EVENT_MAP: Record<ClineHookEventType, HookEventType> = {
|
|
1503
|
+
TaskStart: "SessionStart",
|
|
1504
|
+
TaskResume: "SessionStart", // a resumed task is the same session continuing
|
|
1505
|
+
TaskCancel: "SessionEnd",
|
|
1506
|
+
TaskComplete: "Stop",
|
|
1507
|
+
TaskError: "StopFailure",
|
|
1508
|
+
PreToolUse: "PreToolUse",
|
|
1509
|
+
PostToolUse: "PostToolUse",
|
|
1510
|
+
UserPromptSubmit: "UserPromptSubmit",
|
|
1511
|
+
SessionShutdown: "SessionEnd",
|
|
1512
|
+
};
|
|
1513
|
+
|
|
1514
|
+
// Every entry observed LIVE on cline v3.0.60's PreToolUse payload. Unknown tools
|
|
1515
|
+
// pass through unchanged so they still reach the audit, just unmatched by
|
|
1516
|
+
// name-keyed builtins.
|
|
1517
|
+
export const CLINE_TOOL_MAP: Record<string, string> = {
|
|
1518
|
+
run_commands: "Bash",
|
|
1519
|
+
read_files: "Read",
|
|
1520
|
+
search_codebase: "Grep",
|
|
1521
|
+
apply_patch: "Edit",
|
|
1522
|
+
};
|
|
1523
|
+
|
|
1524
|
+
// **There is deliberately NO CLINE_TOOL_INPUT_MAP.** Do not "fix" the omission
|
|
1525
|
+
// by adding an empty one. Every cline tool is batch- or blob-shaped, so there is
|
|
1526
|
+
// no key to RENAME — the whole job is a value-SHAPE transform, and it lives in
|
|
1527
|
+
// batch-expand.ts:
|
|
1528
|
+
// run_commands {commands:[…]} → one element per entry, {command}
|
|
1529
|
+
// read_files {files:[{path}]}→ one element per entry, {file_path}
|
|
1530
|
+
// search_codebase {queries:[…]} → one element per entry, {pattern}
|
|
1531
|
+
// apply_patch {input:"blob"} → one element per patched file
|
|
1532
|
+
|
|
1002
1533
|
export const HOOK_EVENT_TYPES = [
|
|
1003
1534
|
"SessionStart",
|
|
1004
1535
|
"SessionEnd",
|
|
@@ -1093,7 +1624,7 @@ export interface SessionMetadata {
|
|
|
1093
1624
|
* Use this for round-tripping the agent-side event name in response shapes
|
|
1094
1625
|
* when stdin doesn't include `hook_event_name`. */
|
|
1095
1626
|
rawHookEventName?: string;
|
|
1096
|
-
/** Which agent CLI fired this hook (claude | codex | copilot | cursor | opencode | pi | hermes | openclaw | factory | devin | antigravity | goose). Set by handler.ts from --cli. */
|
|
1627
|
+
/** Which agent CLI fired this hook (claude | codex | copilot | cursor | opencode | pi | hermes | openclaw | factory | devin | antigravity | goose | ori | cline). Set by handler.ts from --cli. */
|
|
1097
1628
|
cli?: IntegrationType;
|
|
1098
1629
|
}
|
|
1099
1630
|
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[22734,(e,r,t)=>{r.exports=e.x("fs",()=>require("fs"))},24868,(e,r,t)=>{r.exports=e.x("fs/promises",()=>require("fs/promises"))},70406,(e,r,t)=>{r.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},18622,(e,r,t)=>{r.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,r,t)=>{r.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,r,t)=>{r.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,r,t)=>{r.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,r,t)=>{r.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,r,t)=>{r.exports=e.x("next/dist/server/runtime-reacts.external.js",()=>require("next/dist/server/runtime-reacts.external.js"))},93695,(e,r,t)=>{r.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},12714,(e,r,t)=>{r.exports=e.x("node:fs/promises",()=>require("node:fs/promises"))},50227,(e,r,t)=>{r.exports=e.x("node:path",()=>require("node:path"))},81111,(e,r,t)=>{r.exports=e.x("node:stream",()=>require("node:stream"))},46786,(e,r,t)=>{r.exports=e.x("os",()=>require("os"))},14747,(e,r,t)=>{r.exports=e.x("path",()=>require("path"))},91301,e=>{e.v(r=>Promise.all(["server/chunks/[root-of-the-server]__1qb590j._.js","server/chunks/_1vslkoe._.js"].map(r=>e.l(r))).then(()=>r(30441)))},16341,e=>{e.v(r=>Promise.all(["server/chunks/[root-of-the-server]__1shcqgr._.js"].map(r=>e.l(r))).then(()=>r(93114)))},37352,e=>{e.v(r=>Promise.all(["server/chunks/[root-of-the-server]__1jm9fw6._.js"].map(r=>e.l(r))).then(()=>r(36203)))},18944,e=>{e.v(r=>Promise.all(["server/chunks/[root-of-the-server]__17g9wh7._.js","server/chunks/src_hooks_fp-home_ts_09kv0bn._.js"].map(r=>e.l(r))).then(()=>r(57232)))},71809,e=>{"use strict";async function r(e,r){let t=Array(e.length),s=0;async function o(){for(;s<e.length;){let r=s++;try{t[r]={status:"fulfilled",value:await e[r]()}}catch(e){t[r]={status:"rejected",reason:e}}}}let a=Array.from({length:Math.min(r,e.length)},()=>o());return await Promise.all(a),t}e.s(["batchAll",0,r])},5807,e=>{e.v(r=>Promise.all(["server/chunks/[root-of-the-server]__1w9zl9-._.js"].map(r=>e.l(r))).then(()=>r(55851)))},21476,e=>{e.v(r=>Promise.all(["server/chunks/[root-of-the-server]__1legmza._.js"].map(r=>e.l(r))).then(()=>r(78166)))},97452,e=>{e.v(r=>Promise.all(["server/chunks/[root-of-the-server]__1ou2ehh._.js"].map(r=>e.l(r))).then(()=>r(46413)))},23414,e=>{e.v(r=>Promise.all(["server/chunks/[root-of-the-server]__0rv7m0k._.js"].map(r=>e.l(r))).then(()=>r(72094)))},52400,e=>{e.v(r=>Promise.all(["server/chunks/[root-of-the-server]__0g6bbuw._.js","server/chunks/_1vslkoe._.js"].map(r=>e.l(r))).then(()=>r(79364)))},53229,e=>{e.v(r=>Promise.all(["server/chunks/[root-of-the-server]__1ffkmds._.js","server/chunks/_1vslkoe._.js"].map(r=>e.l(r))).then(()=>r(40375)))},62998,e=>{e.v(r=>Promise.all(["server/chunks/[root-of-the-server]__0q0qzx1._.js"].map(r=>e.l(r))).then(()=>r(69391)))},95231,e=>{e.v(r=>Promise.all(["server/chunks/[root-of-the-server]__0--lkk6._.js"].map(r=>e.l(r))).then(()=>r(28246)))},28557,e=>{"use strict";e.s(["formatDate",0,function(e){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0}).format(e)}])},31854,e=>{e.v(r=>Promise.all(["server/chunks/[root-of-the-server]__08w4wmd._.js","server/chunks/_1vslkoe._.js"].map(r=>e.l(r))).then(()=>r(69164)))},49081,e=>{e.v(r=>Promise.all(["server/chunks/[root-of-the-server]__1xuedea._.js","server/chunks/_1vslkoe._.js"].map(r=>e.l(r))).then(()=>r(36618)))},67347,e=>{e.v(r=>Promise.all(["server/chunks/[root-of-the-server]__1anxb5k._.js","server/chunks/_1vslkoe._.js"].map(r=>e.l(r))).then(()=>r(64828)))},32359,e=>{e.v(r=>Promise.all(["server/chunks/[root-of-the-server]__0zlqo2t._.js","server/chunks/_1vslkoe._.js"].map(r=>e.l(r))).then(()=>r(3605)))},40911,e=>{"use strict";let r={info:0,warn:1,error:2};function t(e){return r[e]>=r.warn}function s(e){return`[failproofai${new Date().toISOString()}] ${e}`}e.s(["logActivity",0,function(e,r,o){if(!t("info"))return;let a=[`user=${e}`,`action=${r}`];o&&a.push(o),console.log(s("ACTIVITY"),a.join(" "))},"logError",0,function(e,r){void 0!==r?console.error(s("ERROR"),e,r):console.error(s("ERROR"),e)},"logWarn",0,function(e,r){t("warn")&&(void 0!==r?console.warn(s("WARN"),e,r):console.warn(s("WARN"),e))}])},38978,e=>{e.v(r=>Promise.all(["server/chunks/[root-of-the-server]__04_h-a5._.js"].map(r=>e.l(r))).then(()=>r(90624)))},26435,e=>{e.v(r=>Promise.all(["server/chunks/[root-of-the-server]__0-219ec._.js"].map(r=>e.l(r))).then(()=>r(64199)))},82978,e=>{e.v(r=>Promise.all(["server/chunks/[root-of-the-server]__03r-lqq._.js","server/chunks/_1vslkoe._.js"].map(r=>e.l(r))).then(()=>r(35435)))},82859,e=>{e.v(r=>Promise.all(["server/chunks/[root-of-the-server]__12021ot._.js","server/chunks/_1vslkoe._.js"].map(r=>e.l(r))).then(()=>r(99440)))},81580,e=>{"use strict";var r=e.i(46786),t=e.i(14747);e.s(["decodeFolderName",0,function(e){return/^[A-Za-z]--/.test(e)?e[0]+":/"+e.slice(3).replace(/-/g,"/"):e.replace(/-/g,"/")},"encodeFolderName",0,function(e){let r=/^([A-Za-z]):[\\/](.*)$/.exec(e);return r?r[1]+"--"+r[2].replace(/[\\/]/g,"-"):e.replace(/[\\/]/g,"-")},"getClaudeProjectsPath",0,function(){let e=process.env.CLAUDE_PROJECTS_PATH;return e||(0,t.join)((0,r.homedir)(),".claude","projects")}])},45093,e=>{e.v(r=>Promise.all(["server/chunks/[root-of-the-server]__0f7mikp._.js"].map(r=>e.l(r))).then(()=>r(19791)))},41330,e=>{e.v(r=>Promise.all(["server/chunks/[root-of-the-server]__0q-v9z2._.js"].map(r=>e.l(r))).then(()=>r(85116)))},56936,e=>{"use strict";var r=e.i(12714),t=e.i(50227),s=e.i(81580),o=e.i(83534),a=e.i(71809),n=e.i(40911),i=e.i(28557);let l=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;async function c(e,t){try{return(await (0,r.stat)(e)).mtime}catch(e){return(0,n.logWarn)(`Failed to stat ${t}:`,e),new Date(0)}}async function u(e){try{if(!(await (0,r.stat)(e)).isDirectory())return null;return await (0,r.readdir)(e,{withFileTypes:!0})}catch{return null}}async function h(){try{let e=(0,s.getClaudeProjectsPath)(),r=await u(e);if(!r)return[];let o=(await (0,a.batchAll)(r.filter(e=>e.isDirectory()).map(r=>async()=>{let s=(0,t.join)(e,r.name),o=await c(s,r.name);return{name:r.name,path:s,isDirectory:!0,lastModified:o,lastModifiedFormatted:(0,i.formatDate)(o),cli:["claude"]}}),16)).filter(e=>"fulfilled"===e.status).map(e=>e.value);return o.sort((e,r)=>r.lastModified.getTime()-e.lastModified.getTime()),o}catch(e){return(0,n.logError)("Error reading Claude project folders:",e),[]}}async function d(){let[{getCodexProjects:r},{getCopilotProjects:t},{getCursorProjects:s},{getOpenCodeProjects:o},{getPiProjects:a},{getHermesProjects:i},{getOpenClawProjects:l},{getFactoryProjects:c},{getDevinProjects:u},{getAntigravityProjects:d},{getGooseProjects:m}]=await Promise.all([e.A(37352),e.A(5807),e.A(97452),e.A(82978),e.A(45093),e.A(67347),e.A(38978),e.A(62998),e.A(52400),e.A(91301),e.A(31854)]),[f,p,v,_,j,g,x,k,w,y,P,E]=await Promise.all([h(),r().catch(e=>((0,n.logError)("Error reading Codex projects:",e),[])),t().catch(e=>((0,n.logError)("Error reading Copilot projects:",e),[])),s().catch(e=>((0,n.logError)("Error reading Cursor projects:",e),[])),o().catch(e=>((0,n.logError)("Error reading OpenCode projects:",e),[])),a().catch(e=>((0,n.logError)("Error reading Pi projects:",e),[])),i().catch(e=>((0,n.logError)("Error reading Hermes projects:",e),[])),l().catch(e=>((0,n.logError)("Error reading OpenClaw projects:",e),[])),c().catch(e=>((0,n.logError)("Error reading Factory projects:",e),[])),u().catch(e=>((0,n.logError)("Error reading Devin projects:",e),[])),d().catch(e=>((0,n.logError)("Error reading Antigravity projects:",e),[])),m().catch(e=>((0,n.logError)("Error reading Goose projects:",e),[]))]);return function(...e){let r=new Map;for(let t of e)for(let e of t){let t=r.get(e.name);if(!t){r.set(e.name,{...e,cli:[...e.cli]});continue}let s=[...t.cli];for(let r of e.cli)s.includes(r)||s.push(r);let o=e.lastModified.getTime()>t.lastModified.getTime()?e:t;r.set(e.name,{...t,cli:s,lastModified:o.lastModified,lastModifiedFormatted:o.lastModifiedFormatted,sessionCount:void 0===t.sessionCount&&void 0===e.sessionCount?void 0:(t.sessionCount??0)+(e.sessionCount??0)})}let t=Array.from(r.values());return t.sort((e,r)=>r.lastModified.getTime()-e.lastModified.getTime()),t}(f,p,v,_,j,g,x,k,w,y,P,E)}function m(e){if(!e)throw RangeError("Empty project name");if(/^[/\\]/.test(e))throw RangeError("Absolute project name");let r=(0,t.resolve)((0,s.getClaudeProjectsPath)()),o=(0,t.resolve)((0,t.join)(r,e));if(!o.startsWith(r+t.sep))throw RangeError("Project path escapes root");return o}function f(e){let r=e.match(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i);return r?r[0]:void 0}async function p(e){try{let r=await u(e);if(!r)return[];let s=r.filter(e=>e.isFile()&&e.name.endsWith(".jsonl")&&f(e.name)),o=(await (0,a.batchAll)(s.map(r=>async()=>{let s=(0,t.join)(e,r.name),o=await c(s,r.name);return{name:r.name,path:s,lastModified:o,lastModifiedFormatted:(0,i.formatDate)(o),sessionId:f(r.name),cli:"claude"}}),16)).filter(e=>"fulfilled"===e.status).map(e=>e.value);return o.sort((e,r)=>r.lastModified.getTime()-e.lastModified.getTime()),o}catch(e){return(0,n.logError)("Error reading session files:",e),[]}}(0,o.runtimeCache)(d,30),(0,o.runtimeCache)(e=>p(e),30),e.s(["UUID_RE",0,l,"resolveProjectPath",0,m,"resolveSessionFilePath",0,function(e,r){if(!l.test(r))throw RangeError("Invalid session ID");let s=m(e);return(0,t.join)(s,`${r}.jsonl`)}])},83534,e=>{"use strict";e.s(["runtimeCache",0,function(e,r,t){let s=new Map,o=new Map,a=t?.maxSize;return async(...t)=>{let n=JSON.stringify(t),i=s.get(n);if(i&&Date.now()<i.expiry)return i.data;let l=o.get(n);if(l)return l;let c=e(...t).then(e=>{if(o.delete(n),a&&s.size>=a){let e=s.keys().next().value;s.delete(e)}return s.set(n,{data:e,expiry:Date.now()+1e3*r}),e},e=>{throw o.delete(n),e});return o.set(n,c),c}}])}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__1le9jqc._.js.map
|