failproofai 1.0.2-beta.2 → 1.0.2-beta.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 +6 -6
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/required-server-files.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page/build-manifest.json +3 -3
- 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 +3 -3
- 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 +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 +2 -3
- 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 -5
- 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 +2 -2
- 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 +3 -4
- 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 +4 -4
- 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 +4 -4
- package/.next/standalone/.next/server/app/api/auth/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/audit/page/build-manifest.json +3 -3
- 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 +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 +3 -3
- 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 +3 -3
- package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +14 -14
- package/.next/standalone/.next/server/app/policies/page.js +2 -2
- 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 +3 -3
- 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.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 +3 -3
- 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.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 +3 -3
- package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +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 +3 -3
- 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]__0e32-7c._.js → [externals]__1qzqcio._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_usx0j._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_zk340._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0clqfab._.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]__0oy4kxb._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0zf034w._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0igxt32._.js → [root-of-the-server]__1p8poxd._.js} +2 -2
- package/.next/standalone/.next/server/chunks/_0lxbzdq._.js +3 -0
- package/.next/standalone/.next/server/chunks/_1ek68ln._.js +6 -5
- package/.next/standalone/.next/server/chunks/_1lbh81u._.js +3 -0
- package/.next/standalone/.next/server/chunks/_1zuiiy3._.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_04op_ou._.js → node_modules_posthog-node_dist_entrypoints_index_node_mjs_09d5c79._.js} +1 -1
- 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/{node_modules_posthog-node_dist_entrypoints_index_node_mjs_0dr20uz._.js → node_modules_posthog-node_dist_entrypoints_index_node_mjs_1d2g73o._.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]__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]__07gm3zl._.js +4 -4
- 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]__0s740oi._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__14muoc4._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{src_hooks_08o7bqo._.js → [root-of-the-server]__15r6r7w._.js} +2 -2
- 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]__1tag8_-._.js +5 -0
- package/.next/standalone/.next/server/chunks/ssr/_08x1r5t._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_1oggjel._.js → _0ovx4lz._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1dkh76z._.js +23 -0
- 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/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/node_modules_13n822a._.js +1 -1
- 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/middleware-build-manifest.js +6 -6
- package/.next/standalone/.next/server/middleware.js +1 -1
- 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/{1yw71gn8vqco1.js → 00_t-xvc59tkb.js} +2 -2
- package/.next/standalone/.next/static/chunks/{3jjmdqqzem21x.js → 07j2u70_3qsx8.js} +1 -1
- package/.next/standalone/.next/static/chunks/{2fzxl7n717pbc.js → 0d_re32wscs0b.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0ykd_go4oahan.js → 0ds64uculrze8.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0nnbtp0w4sxrr.js → 0k_yvjc1yz0pq.js} +1 -1
- package/.next/standalone/.next/static/chunks/0lshnlpy1m6bc.js +1 -0
- package/.next/standalone/.next/static/chunks/{1da5a_a-3btas.js → 1o0ahew9568ls.js} +1 -1
- package/.next/standalone/.next/static/chunks/{1za08zjcctyil.js → 1oz0svxwt9574.js} +2 -2
- package/.next/standalone/.next/static/chunks/{29eh4k77otcw6.js → 1q76jk_1_wgjq.js} +1 -1
- package/.next/standalone/.next/static/chunks/{2axi5ehjbld9h.js → 2817_8e94ah9z.js} +1 -1
- package/.next/standalone/.next/static/chunks/{1nzy5jc_vf9e0.js → 2dbi_x0c8n8fi.js} +1 -1
- package/.next/standalone/.next/static/chunks/{1fac8krph-zgp.js → 354-n7p7labpn.js} +1 -1
- package/.next/standalone/.next/static/chunks/turbopack-17utl_jw0wj11.js +1 -0
- package/.next/standalone/SECURITY.md +18 -3
- package/.next/standalone/fp-cloud-cli/CHANGELOG.md +7 -0
- package/.next/standalone/fp-cloud-cli/uv.lock +6 -6
- 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/client/components/segment-cache/cache.js +23 -34
- 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/pages-turbo.runtime.prod.js +1 -1
- 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/lib/app-info-log.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/lib/start-server.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 +19 -19
- package/.next/standalone/sdk/python/CHANGELOG.md +7 -0
- package/.next/standalone/sdk/python/uv.lock +23 -23
- package/.next/standalone/server.js +1 -1
- package/bin/failproofai.mjs +131 -55
- package/dist/cli.mjs +12940 -12627
- package/dist/worker.mjs +11 -1
- package/package.json +19 -19
- package/src/audit/cache.ts +34 -29
- package/src/audit/replay.ts +15 -91
- package/src/hooks/configure-wizard.ts +16 -48
- package/src/hooks/handler.ts +8 -1
- package/src/hooks/manager.ts +24 -2
- package/src/hooks/pack-cli.ts +572 -43
- package/src/hooks/pack-manifest.ts +28 -0
- package/src/hooks/pack-store.ts +20 -28
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__01eqny5._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0neqlu-._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0t9oqnn._.js +0 -3
- package/.next/standalone/.next/server/chunks/_0bs-v8p._.js +0 -3
- package/.next/standalone/.next/server/chunks/_0tovk6q._.js +0 -3
- package/.next/standalone/.next/server/chunks/_0trp3yc._.js +0 -3
- package/.next/standalone/.next/server/chunks/_185gyk9._.js +0 -3
- package/.next/standalone/.next/server/chunks/src_hooks_0xbw3bu._.js +0 -12
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__090sxxw._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__192nhvh._.js +0 -5
- package/.next/standalone/.next/server/chunks/ssr/_0wb8osu._.js +0 -23
- package/.next/standalone/.next/static/chunks/140ip21rqmelt.js +0 -1
- package/.next/standalone/.next/static/chunks/turbopack-2vqpa-dts1gy4.js +0 -1
- /package/.next/standalone/.next/static/{A7czO1PZdTcNzLGa_H1sm → 0iNzkTsP6rh14Rj5WL17o}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{A7czO1PZdTcNzLGa_H1sm → 0iNzkTsP6rh14Rj5WL17o}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{A7czO1PZdTcNzLGa_H1sm → 0iNzkTsP6rh14Rj5WL17o}/_ssgManifest.js +0 -0
|
@@ -84,6 +84,19 @@ export interface InstalledPackRecord {
|
|
|
84
84
|
* made against.
|
|
85
85
|
*/
|
|
86
86
|
enabled?: string[];
|
|
87
|
+
/**
|
|
88
|
+
* Which agent CLIs this pack guards. Absent means ALL of them.
|
|
89
|
+
*
|
|
90
|
+
* Setup wires hooks into every supported agent, because hooks alone enforce
|
|
91
|
+
* nothing — so "which agents" stopped being a setup question and became a
|
|
92
|
+
* per-pack one, asked where the user is looking at a real list. A team may
|
|
93
|
+
* want its deploy guards on the agent that ships and not on the one used for
|
|
94
|
+
* scratch work, and that is a property of the PACK, not of the machine.
|
|
95
|
+
*
|
|
96
|
+
* Absent rather than "all twelve" for packs installed before this existed:
|
|
97
|
+
* a machine upgrading must not silently narrow what it enforces.
|
|
98
|
+
*/
|
|
99
|
+
clis?: string[];
|
|
87
100
|
}
|
|
88
101
|
|
|
89
102
|
export interface ResolvedPack {
|
|
@@ -98,6 +111,8 @@ export interface ResolvedPack {
|
|
|
98
111
|
policies: PolicyCatalogEntry[];
|
|
99
112
|
/** Selected policy names, or null when the user took the whole pack. */
|
|
100
113
|
enabled: string[] | null;
|
|
114
|
+
/** Agent CLIs this pack guards, or null for all of them. */
|
|
115
|
+
clis: string[] | null;
|
|
101
116
|
}
|
|
102
117
|
|
|
103
118
|
export interface PackError {
|
|
@@ -250,7 +265,20 @@ function parsePack(root: string, value: unknown): ResolvedPack {
|
|
|
250
265
|
enabled = raw.enabled.filter((n) => names.has(n));
|
|
251
266
|
}
|
|
252
267
|
|
|
268
|
+
// Validated but NOT filtered against the known integration list. An unknown
|
|
269
|
+
// name means this record was written by a newer build that supports an agent
|
|
270
|
+
// this one does not; dropping it would silently widen the pack back to every
|
|
271
|
+
// CLI, which is the one direction a narrowing choice must never move.
|
|
272
|
+
let clis: string[] | null = null;
|
|
273
|
+
if (raw.clis !== undefined) {
|
|
274
|
+
if (!Array.isArray(raw.clis) || raw.clis.some((c) => typeof c !== "string")) {
|
|
275
|
+
throw new Error(`pack ${raw.id} clis is not an array of agent names`);
|
|
276
|
+
}
|
|
277
|
+
clis = raw.clis;
|
|
278
|
+
}
|
|
279
|
+
|
|
253
280
|
return {
|
|
281
|
+
clis,
|
|
254
282
|
id: identity.id,
|
|
255
283
|
version: identity.version,
|
|
256
284
|
source: raw.source,
|
package/src/hooks/pack-store.ts
CHANGED
|
@@ -332,6 +332,8 @@ export interface PackAddOptions {
|
|
|
332
332
|
only?: string[];
|
|
333
333
|
categories?: string[];
|
|
334
334
|
all?: boolean;
|
|
335
|
+
/** Agent CLIs this pack should guard. Omitted means all of them. */
|
|
336
|
+
clis?: string[];
|
|
335
337
|
}
|
|
336
338
|
|
|
337
339
|
export interface AddedPack {
|
|
@@ -554,14 +556,23 @@ function resolveSelection(
|
|
|
554
556
|
}
|
|
555
557
|
for (const n of opts.only) picked.add(n);
|
|
556
558
|
}
|
|
557
|
-
|
|
559
|
+
// An EXPRESSED selection wins, even when it is empty.
|
|
560
|
+
//
|
|
561
|
+
// `opts.only = []` means "install the pack, enable none of it" — which is what
|
|
562
|
+
// the picker sends when somebody unticks everything and confirms. Testing
|
|
563
|
+
// `picked.size > 0` made that indistinguishable from passing no flags at all,
|
|
564
|
+
// so it fell through and installed the publisher's defaults: the exact
|
|
565
|
+
// opposite of what was chosen, reported as "the pack's defaults". Presence of
|
|
566
|
+
// the key is the signal, not its length.
|
|
567
|
+
if (opts?.only !== undefined || opts?.categories?.length) {
|
|
558
568
|
// Kept in the pack's declared order, which is the order everything else
|
|
559
569
|
// presents them in.
|
|
560
570
|
return { enabled: available.filter((n) => picked.has(n)), reason: "selected" };
|
|
561
571
|
}
|
|
562
572
|
|
|
563
|
-
// No
|
|
564
|
-
// policy back on because the user did not repeat themselves is not
|
|
573
|
+
// No selection expressed. An upgrade keeps whatever the machine already had —
|
|
574
|
+
// switching a policy back on because the user did not repeat themselves is not
|
|
575
|
+
// an upgrade.
|
|
565
576
|
if (previouslyInstalled) {
|
|
566
577
|
return { enabled: previous === null ? null : (previous ?? null), reason: "carried" };
|
|
567
578
|
}
|
|
@@ -634,7 +645,7 @@ export async function checkPackArtifact(
|
|
|
634
645
|
|
|
635
646
|
export async function addPack(
|
|
636
647
|
source: string,
|
|
637
|
-
opts?:
|
|
648
|
+
opts?: PackAddOptions,
|
|
638
649
|
): Promise<AddPackResult> {
|
|
639
650
|
if (process.env.FAILPROOFAI_NO_DOWNLOAD) {
|
|
640
651
|
throw new Error(
|
|
@@ -731,6 +742,11 @@ export async function addPack(
|
|
|
731
742
|
policies: fetched.policies,
|
|
732
743
|
...(fetched.effect ? { effect: fetched.effect } : {}),
|
|
733
744
|
...(enabled ? { enabled } : {}),
|
|
745
|
+
// Omitted, not written as the full list, when the user did not narrow it.
|
|
746
|
+
// An absent `clis` means "every agent", and it keeps meaning that when a
|
|
747
|
+
// thirteenth CLI is supported — whereas a materialised list of twelve would
|
|
748
|
+
// silently exclude the new one from every pack installed before it existed.
|
|
749
|
+
...(opts?.clis ? { clis: opts.clis } : {}),
|
|
734
750
|
};
|
|
735
751
|
|
|
736
752
|
const absorbed = upsertInstalled(record);
|
|
@@ -749,30 +765,6 @@ export async function addPack(
|
|
|
749
765
|
};
|
|
750
766
|
}
|
|
751
767
|
|
|
752
|
-
/**
|
|
753
|
-
* The vendored pack directory, when a working tree happens to have one.
|
|
754
|
-
*
|
|
755
|
-
* The published package does NOT carry `policy-pack/` and there is no install
|
|
756
|
-
* path through here. Our policies are fetched from their GitHub release like
|
|
757
|
-
* anybody else's — a pack that ships inside the binary is a policy set chosen
|
|
758
|
-
* for the user and written to their disk before they asked, and it gave our own
|
|
759
|
-
* policies a delivery route no third-party pack could use.
|
|
760
|
-
*
|
|
761
|
-
* The one remaining caller is `audit/replay.ts`, which prefers the pack's own
|
|
762
|
-
* functions when a dev tree has run `build:pack` and falls back to the compiled
|
|
763
|
-
* implementations when it returns null. Both produce identical text, so the two
|
|
764
|
-
* paths score the same; the fallback is the normal case now.
|
|
765
|
-
*
|
|
766
|
-
* Anchored at `FAILPROOFAI_PACKAGE_ROOT` for the reason `npmPlatformBinaryPath`
|
|
767
|
-
* documents: `import.meta.url` does not survive the CJS bundle.
|
|
768
|
-
*/
|
|
769
|
-
export function bundledPackDir(): string | null {
|
|
770
|
-
const root = process.env.FAILPROOFAI_PACKAGE_ROOT;
|
|
771
|
-
if (!root) return null;
|
|
772
|
-
const dir = resolve(root, "policy-pack");
|
|
773
|
-
return existsSync(resolve(dir, PACK_MANIFEST_ASSET)) ? dir : null;
|
|
774
|
-
}
|
|
775
|
-
|
|
776
768
|
export function setPackPolicyEnabled(
|
|
777
769
|
packId: string,
|
|
778
770
|
name: string,
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},20635,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},59043,(e,t,r)=>{t.exports=e.x("next/dist/server/runtime-reacts.external.js",()=>require("next/dist/server/runtime-reacts.external.js"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},74533,(e,t,r)=>{t.exports=e.x("node:child_process",()=>require("node:child_process"))},66680,(e,t,r)=>{t.exports=e.x("node:crypto",()=>require("node:crypto"))},2157,(e,t,r)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},60526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},81111,(e,t,r)=>{t.exports=e.x("node:stream",()=>require("node:stream"))},94930,e=>{"use strict";var t=e.i(2157),r=e.i(50227),s=e.i(66680);e.s(["writeJsonAtomically",0,function(e,n,o={}){let i=o.mode??384,a=o.dirMode??448,c=(0,r.dirname)(e);(0,t.existsSync)(c)||(0,t.mkdirSync)(c,{recursive:!0,mode:a});let u=`${e}.${process.pid}.${(0,s.randomBytes)(6).toString("hex")}.tmp`;try{(0,t.writeFileSync)(u,JSON.stringify(n,null,2),{mode:i});try{(63&(0,t.statSync)(u).mode)!=0&&(0,t.chmodSync)(u,i)}catch{}(0,t.renameSync)(u,e);try{(63&(0,t.statSync)(e).mode)!=0&&(0,t.chmodSync)(e,i)}catch{}}catch(e){try{(0,t.rmSync)(u,{force:!0})}catch{}throw e}}])},6375,e=>{"use strict";var t=e.i(46501);function r(){return(process.env.FAILPROOF_API_URL??process.env.FAILPROOFAI_API_URL??"https://api.befailproof.ai").replace(/\/+$/,"")}class s extends Error{status;code;retryAfterSecs;constructor(e,t,r,s){super(r),this.status=e,this.code=t,this.retryAfterSecs=s,this.name="AuthApiError"}}async function n(e){let t={};try{t=await e.json()}catch{}let r=t.code??`http_${e.status}`,n=t.message??t.detail??e.statusText??"request failed",o=t.retry_after_secs;if(void 0===o){let t=e.headers.get("retry-after");if(t){let e=Number(t);Number.isFinite(e)&&(o=e)}}return void 0!==o&&(o=Math.max(0,Math.min(86400,o))),new s(e.status,r,n,o)}async function o(e,r){try{return await fetch(e,{...r,signal:function(e){let t=AbortSignal.timeout(1e4);if(!e)return t;let r=AbortSignal.any;if(r)return r([t,e]);let s=new AbortController;if(t.aborted)s.abort(t.reason);else t.addEventListener("abort",()=>s.abort(t.reason),{once:!0});if(e.aborted)s.abort(e.reason);else e.addEventListener("abort",()=>s.abort(e.reason),{once:!0});return s.signal}(r.signal??void 0)})}catch(o){let n=function(e){if(null===e||"object"!=typeof e)return!1;let t=e.name;return"AbortError"===t||"TimeoutError"===t}(o);if((0,t.trackEvent)("api_server_unreachable",{kind:n?"timeout":"network",path:function(e){try{return new URL(e).pathname}catch{return e}}(e),method:"string"==typeof r.method?r.method:"GET"}),n)throw new s(0,"timeout",`request to ${e} timed out after 10000ms`);throw o}}async function i(e,t,s){let i={"content-type":"application/json"};s?.accessToken&&(i.authorization=`Bearer ${s.accessToken}`);let a=await o(`${r()}${e}`,{method:"POST",headers:i,body:JSON.stringify(t)});if(204!==a.status){if(!a.ok)throw await n(a);return await a.json()}}async function a(e,t){let s=await o(`${r()}${e}`,{method:"GET",headers:{authorization:`Bearer ${t}`}});if(!s.ok)throw await n(s);return await s.json()}async function c(e){return i("/v0/auth/login/request",{email:e})}async function u(e,t){return i("/v0/auth/login/verify",{email:e,code:t})}async function l(e){return i("/v0/auth/token/refresh",{refresh_token:e})}async function f(e,t){await i("/v0/auth/logout",{refresh_token:t},{accessToken:e})}async function p(e){return a("/v0/auth/me",e)}async function d(e,t,r){return i("/v0/invite",void 0===r?{to:t}:{to:t,score:r},{accessToken:e})}e.s(["AuthApiError",0,s,"fetchMe",0,p,"logoutSession",0,f,"refreshAccessToken",0,l,"requestLoginCode",0,c,"sendInvites",0,d,"verifyLoginCode",0,u],6375)},17707,e=>{"use strict";var t=e.i(2157),r=e.i(50227),s=e.i(94930),n=e.i(79857),o=e.i(6375);function i(){let e=process.env.FAILPROOFAI_AUTH_DIR;return e?(0,r.join)(e,"session.json"):(0,n.auditSessionFile)()}function a(){let e=i();if(!(0,t.existsSync)(e))return null;try{let r=(0,t.readFileSync)(e,"utf-8"),s=JSON.parse(r);if("string"!=typeof s.access_token||"string"!=typeof s.refresh_token||"number"!=typeof s.access_expires_at||"object"!=typeof s.user||!s.user||"string"!=typeof s.user.id||"string"!=typeof s.user.email)return null;return{access_token:s.access_token,refresh_token:s.refresh_token,access_expires_at:s.access_expires_at,refresh_expires_at:"number"==typeof s.refresh_expires_at?s.refresh_expires_at:s.access_expires_at,user:{id:s.user.id,email:s.user.email}}}catch{return null}}function c(e){(0,s.writeJsonAtomically)(i(),e)}function u(){let e=i();(0,t.existsSync)(e)&&(0,t.rmSync)(e,{force:!0});try{let e=(0,n.migrationsDir)();if(!(0,t.existsSync)(e))return;for(let s of(0,t.readdirSync)(e)){if(!s.startsWith("backup-layout"))continue;let n=(0,r.resolve)(e,s,"auth.json");(0,t.existsSync)(n)&&(0,t.rmSync)(n,{force:!0})}}catch{}}function l(e,t){let r=Math.floor(Date.now()/1e3),s=e.user??t;if(!s)throw Error("authFromTokenResponse: missing user identity");return{access_token:e.access_token,refresh_token:e.refresh_token,access_expires_at:r+e.access_expires_in,refresh_expires_at:r+e.refresh_expires_in,user:s}}let f=new Map;async function p(e){let t=f.get(e.refresh_token);if(t)return t;let r=(async()=>{let t=l(await (0,o.refreshAccessToken)(e.refresh_token),e.user);return c(t),t})();f.set(e.refresh_token,r);try{return await r}finally{f.delete(e.refresh_token)}}async function d(){let e=a();if(!e)return null;let t=Math.floor(Date.now()/1e3);if(e.access_expires_at-t>60)return e;try{return await p(e)}catch(e){return e instanceof o.AuthApiError&&401===e.status&&u(),null}}async function h(){let e=await d();if(!e)return null;try{return{me:await (0,o.fetchMe)(e.access_token),auth:e}}catch(e){if(e instanceof o.AuthApiError&&401===e.status){let e=a();if(!e)return null;try{let t=await p(e);return{me:await (0,o.fetchMe)(t.access_token),auth:t}}catch(e){e instanceof o.AuthApiError&&401===e.status&&u()}}return null}}e.s(["authFromTokenResponse",0,l,"deleteAuth",0,u,"readAuth",0,a,"whoAmI",0,h,"writeAuth",0,c])},46501,e=>{"use strict";var t=e.i(10659),r=e.i(17694),s=e.i(24214),n=e.i(28067);let o=n.POSTHOG_API_KEY;async function i(){try{if(!(0,r.isTelemetryEnabled)()||globalThis.__FAILPROOFAI_POSTHOG__)return;let t=await e.A(78081),s=process.env.FAILPROOFAI_POSTHOG_KEY??o,n=process.env.FAILPROOFAI_POSTHOG_HOST??"https://us.i.posthog.com";globalThis.__FAILPROOFAI_POSTHOG__=new t.PostHog(s,{host:n,flushAt:1,flushInterval:1e4,requestTimeout:1e4,fetchRetryCount:3,fetchRetryDelay:3e3});let i=!1,a=()=>{i||(i=!0,globalThis.__FAILPROOFAI_POSTHOG__?.shutdown().catch(()=>{}))};process.on("beforeExit",a),process.on("SIGTERM",a),process.on("SIGINT",a)}catch(e){console.warn("[failproofai:telemetry] init failed:",e instanceof Error?e.message:e)}}e.s(["initTelemetry",0,i,"trackEvent",0,function(e,o){if(!(0,r.isTelemetryEnabled)())return;let i=globalThis.__FAILPROOFAI_POSTHOG__;i&&i.capture({distinctId:(0,t.getInstanceId)(),event:e,properties:{...o,$lib:"failproofai",failproofai_version:s.version,product:n.POSTHOG_PRODUCT}})}])}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__01eqny5._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[60815,e=>{e.v(e=>Promise.resolve().then(()=>e(24868)))},91301,e=>{e.v(e=>Promise.resolve().then(()=>e(30441)))},37352,e=>{e.v(e=>Promise.resolve().then(()=>e(36203)))},5807,e=>{e.v(e=>Promise.resolve().then(()=>e(55851)))},97452,e=>{e.v(e=>Promise.resolve().then(()=>e(46413)))},52400,e=>{e.v(e=>Promise.resolve().then(()=>e(79364)))},62998,e=>{e.v(s=>Promise.all(["server/chunks/lib_factory-projects_ts_1eo_bk-._.js"].map(s=>e.l(s))).then(()=>s(69391)))},31854,e=>{e.v(e=>Promise.resolve().then(()=>e(69164)))},67347,e=>{e.v(e=>Promise.resolve().then(()=>e(64828)))},38978,e=>{e.v(e=>Promise.resolve().then(()=>e(90624)))},82978,e=>{e.v(e=>Promise.resolve().then(()=>e(35435)))},45093,e=>{e.v(e=>Promise.resolve().then(()=>e(19791)))},78081,e=>{e.v(s=>Promise.all(["server/chunks/[externals]__0h0p9dm._.js","server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_01r25oi._.js"].map(s=>e.l(s))).then(()=>s(39702)))},396,e=>{e.v(e=>Promise.resolve().then(()=>e(90521)))}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__0neqlu-._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[54799,(e,t,n)=>{t.exports=e.x("crypto",()=>require("crypto"))},70406,(e,t,n)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},18622,(e,t,n)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},20635,(e,t,n)=>{t.exports=e.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},24725,(e,t,n)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},56704,(e,t,n)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,n)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},59043,(e,t,n)=>{t.exports=e.x("next/dist/server/runtime-reacts.external.js",()=>require("next/dist/server/runtime-reacts.external.js"))},93695,(e,t,n)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},74533,(e,t,n)=>{t.exports=e.x("node:child_process",()=>require("node:child_process"))},66680,(e,t,n)=>{t.exports=e.x("node:crypto",()=>require("node:crypto"))},2157,(e,t,n)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},60526,(e,t,n)=>{t.exports=e.x("node:os",()=>require("node:os"))},50227,(e,t,n)=>{t.exports=e.x("node:path",()=>require("node:path"))},81111,(e,t,n)=>{t.exports=e.x("node:stream",()=>require("node:stream"))},57764,(e,t,n)=>{t.exports=e.x("node:url",()=>require("node:url"))},92509,(e,t,n)=>{t.exports=e.x("url",()=>require("url"))},48480,e=>{"use strict";let t={running:!1,error:null};e.s(["finishRun",0,function(e){t.running=!1,t.startedAt=void 0,t.error=e},"getRunState",0,function(){return{...t}},"tryAcquireRun",0,function(){return!t.running&&(t.running=!0,t.startedAt=Date.now(),t.error=null,!0)}])},30441,e=>{"use strict";var t=e.i(50227),n=e.i(79708),i=e.i(93114),s=e.i(83534),r=e.i(81580),o=e.i(28557),a=e.i(40911);function l(){return(0,t.join)((0,i.antigravityHome)(),"conversation_summaries.db")}async function u(){let e=new Map,t=await (0,n.openSqliteReadonly)(l());if(!t)return e;try{for(let n of t.query("SELECT conversation_id, title, step_count, workspace_uris, last_modified_time FROM conversation_summaries"))n.conversation_id&&e.set(n.conversation_id,{title:n.title??void 0,cwd:function(e){let t;if(!e)return;try{let n=JSON.parse(e);Array.isArray(n)&&"string"==typeof n[0]?t=n[0]:"string"==typeof n&&(t=n)}catch{t=e}if(!t)return;let n=t.replace(/^file:\/\//,"");return n.length>0?n:void 0}(n.workspace_uris),stepCount:"number"==typeof n.step_count?n.step_count:void 0,lastMs:function(e){if("number"==typeof e&&Number.isFinite(e))return e>1e12?e:e>1e9?1e3*e:void 0;if("string"==typeof e){let t=Date.parse(e);if(!Number.isNaN(t))return t}}(n.last_modified_time)})}catch{}finally{t.close()}return e}async function c(){let e;try{e=(0,i.listAntigravityTranscripts)()}catch(e){return(0,a.logWarn)("Failed to scan Antigravity brain dir:",e),[]}let t=await u(),n=[];for(let s of e){let e=t.get(s.conversationId),r=e?.cwd??null;if(!r)try{let e=await (0,i.getAntigravitySessionLog)(s.conversationId);r=e?.cwd??null}catch{r=null}n.push({conversationId:s.conversationId,cwd:r,title:e?.title,mtimeMs:e?.lastMs??s.mtimeMs})}return n}let d="antigravity";async function f(){let e=await c(),t=new Map;for(let n of e){let e=n.cwd?(0,r.encodeFolderName)(n.cwd):d,i=n.cwd??"antigravity",s=t.get(e);(!s||n.mtimeMs>s.latest)&&t.set(e,{latest:n.mtimeMs,path:i})}let n=[];for(let[e,{latest:i,path:s}]of t){let t=new Date(i);n.push({name:e,path:s,isDirectory:!0,lastModified:t,lastModifiedFormatted:(0,o.formatDate)(t),cli:["antigravity"]})}return n.sort((e,t)=>t.lastModified.getTime()-e.lastModified.getTime()),n}async function m(e){let t=(await c()).filter(t=>(t.cwd?(0,r.encodeFolderName)(t.cwd):d)===e);if(0===t.length)return{cwd:null,sessions:[]};let n=[...t].sort((e,t)=>t.mtimeMs-e.mtimeMs);return{cwd:n.find(e=>e.cwd)?.cwd??(e===d?null:(0,r.decodeFolderName)(e)),sessions:n.map(e=>{let t=new Date(e.mtimeMs);return{name:e.title??e.conversationId,path:`antigravity://${e.conversationId}`,lastModified:t,lastModifiedFormatted:(0,o.formatDate)(t),sessionId:e.conversationId,cli:"antigravity"}})}}let p=(0,s.runtimeCache)(f,30),y=(0,s.runtimeCache)(e=>m(e),30,{maxSize:50});e.s(["antigravitySummariesDbPath",0,l,"getAntigravityIndex",0,u,"getAntigravityProjects",0,f,"getAntigravitySessionsByEncodedName",0,m,"getCachedAntigravityProjects",0,p,"getCachedAntigravitySessionsByEncodedName",0,y])},93114,e=>{"use strict";var t=e.i(12714),n=e.i(2157),i=e.i(60526),s=e.i(50227),r=e.i(83534),o=e.i(54214),a=e.i(67405);let l=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,u=new Set(["CONVERSATION_HISTORY","CHECKPOINT"]);function c(){return process.env.ANTIGRAVITY_HOME||(0,s.join)((0,i.homedir)(),".gemini","antigravity-cli")}function d(){return(0,s.join)(c(),"brain")}function f(){return(0,s.join)(".system_generated","logs","transcript_full.jsonl")}function m(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function p(e,t="session"){let n=[],i=new Map,s=Date.now();for(let r=0;r<e.length;r++){let l=e[r];if(!m(l))continue;let c="string"==typeof l.type?l.type:"";if(!c||u.has(c))continue;let d=function(e,t){if("number"==typeof e&&Number.isFinite(e)){if(e>1e12)return new Date(e);if(e>1e9)return new Date(1e3*e)}if("string"==typeof e){let t=Date.parse(e);if(!Number.isNaN(t))return new Date(t)}return new Date(t)}(l.created_at,s+r),f=d.toISOString(),p="number"==typeof l.step_index?l.step_index:r,y={uuid:`antigravity-${p}`,parentUuid:null},g=(0,o.baseEntry)(y,f,d,t);if("USER_INPUT"===c){let e="string"==typeof l.content?l.content:"";n.push({type:"user",...g,message:{role:"user",content:e}});continue}if("PLANNER_RESPONSE"===c){let e=[];if("string"==typeof l.content&&l.content.length>0&&e.push({type:"text",text:l.content}),Array.isArray(l.tool_calls))for(let t=0;t<l.tool_calls.length;t++){let n=l.tool_calls[t];if(!m(n))continue;let s="string"==typeof n.name?n.name:"tool",r={type:"tool_use",id:`${s}-${p}-${t}`,name:s,input:m(n.args)?n.args:{}};e.push(r);let o=s.toUpperCase(),a=i.get(o)??[];a.push({block:r,startMs:d.getTime()}),i.set(o,a)}if(0===e.length)continue;n.push({type:"assistant",...g,message:{role:"assistant",content:e}});continue}let h=i.get(c);if(h&&h.length>0){let{block:e,startMs:t}=h.shift(),n=Math.max(0,d.getTime()-t);e.result={timestamp:f,timestampFormatted:(0,o.formatTimestamp)(d),content:"string"==typeof l.content?l.content:"",durationMs:n,durationFormatted:(0,a.formatDuration)(n)};continue}n.push({type:"system",...g,raw:y})}return n.sort((e,t)=>e.timestampMs-t.timestampMs),n}function y(e){if(!l.test(e))return null;let t=(0,s.join)(d(),e,f());try{if((0,n.statSync)(t).isFile())return t}catch{}return null}async function g(e){let n,i=y(e);if(!i)return null;try{n=await (0,t.readFile)(i,"utf-8")}catch{return null}let s=(0,o.parseRawLines)(n,"session"),r=p(s,"session"),a=function(e){for(let t of e)if(m(t)&&Array.isArray(t.tool_calls))for(let e of t.tool_calls){if(!m(e)||!m(e.args))continue;let t=e.args.Cwd??e.args.cwd;if("string"==typeof t&&t.length>0)return t}}(s);return{entries:r,rawLines:s,cwd:a,filePath:i}}(0,r.runtimeCache)(e=>g(e),60,{maxSize:50}),e.s(["antigravityHome",0,c,"antigravityLinesToLogEntries",0,p,"findAntigravityTranscript",0,y,"getAntigravitySessionLog",0,g,"listAntigravityTranscripts",0,function(){let e,t=d(),i=f(),r=[];try{e=(0,n.readdirSync)(t,{withFileTypes:!0}).filter(e=>e.isDirectory())}catch{return r}for(let o of e){let e=o.name;if(!l.test(e))continue;let a=(0,s.join)(t,e,i);try{let t=(0,n.statSync)(a);if(!t.isFile())continue;r.push({conversationId:e,transcriptPath:a,mtimeMs:t.mtimeMs,sizeBytes:t.size})}catch{}}return r}])},94930,e=>{"use strict";var t=e.i(2157),n=e.i(50227),i=e.i(66680);e.s(["writeJsonAtomically",0,function(e,s,r={}){let o=r.mode??384,a=r.dirMode??448,l=(0,n.dirname)(e);(0,t.existsSync)(l)||(0,t.mkdirSync)(l,{recursive:!0,mode:a});let u=`${e}.${process.pid}.${(0,i.randomBytes)(6).toString("hex")}.tmp`;try{(0,t.writeFileSync)(u,JSON.stringify(s,null,2),{mode:o});try{(63&(0,t.statSync)(u).mode)!=0&&(0,t.chmodSync)(u,o)}catch{}(0,t.renameSync)(u,e);try{(63&(0,t.statSync)(e).mode)!=0&&(0,t.chmodSync)(e,o)}catch{}}catch(e){try{(0,t.rmSync)(u,{force:!0})}catch{}throw e}}])},36203,e=>{"use strict";var t=e.i(12714),n=e.i(60526),i=e.i(50227),s=e.i(81580),r=e.i(83534),o=e.i(71809),a=e.i(28557),l=e.i(40911);let u=(0,i.join)((0,n.homedir)(),".codex","sessions"),c=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i;async function d(e){try{return await (0,t.readdir)(e,{withFileTypes:!0})}catch{return null}}async function f(e){let n=null;try{n=await (0,t.open)(e,"r");let i=Buffer.alloc(262144),{bytesRead:s}=await n.read(i,0,262144,0);if(0===s)return null;let r=i.subarray(0,s),o=r.indexOf(10),a=-1===o?s:o;return r.subarray(0,a).toString("utf-8")}catch{return null}finally{n&&await n.close().catch(()=>{})}}async function m(e){let t=await d(e);return t?t.filter(e=>e.isFile()&&e.name.endsWith(".jsonl")).map(t=>(0,i.join)(e,t.name)):[]}async function p(){let e=await d(u);if(!e)return[];let n=[];for(let t of e){if(!t.isDirectory())continue;let e=await d((0,i.join)(u,t.name));if(e)for(let s of e){if(!s.isDirectory())continue;let e=await d((0,i.join)(u,t.name,s.name));if(e)for(let r of e){if(!r.isDirectory())continue;let e=(0,i.join)(u,t.name,s.name,r.name);n.push(...await m(e))}}}return 0===n.length?[]:(await (0,o.batchAll)(n.map(e=>async()=>{let n,i,s=(i=(e.split("/").pop()??"").match(c))?i[0]:null;if(!s)return null;let r=await f(e);if(!r)return null;let{cwd:o}=function(e){try{let t=JSON.parse(e);if("session_meta"!==t.type)return{};let n=t.payload?.cwd;if("string"!=typeof n||0===n.length)return{};return{cwd:n}}catch{return{}}}(r);if(!o)return null;try{let i=await (0,t.open)(e,"r");try{n=(await i.stat()).mtime}finally{await i.close().catch(()=>{})}}catch{n=new Date(0)}return{filePath:e,fileName:e.split("/").pop()??"",cwd:o,sessionId:s,fileMtime:n}}),16)).filter(e=>"fulfilled"===e.status).map(e=>e.value).filter(e=>null!==e)}let y=(0,r.runtimeCache)(p,30);async function g(){let e;try{e=await y()}catch(e){return(0,l.logWarn)("Failed to scan Codex sessions:",e),[]}let t=new Map;for(let n of e){let e=t.get(n.cwd);(!e||n.fileMtime.getTime()>e.latest.getTime())&&t.set(n.cwd,{latest:n.fileMtime,cwd:n.cwd})}let n=[];for(let{cwd:e,latest:i}of t.values())n.push({name:(0,s.encodeFolderName)(e),path:e,isDirectory:!0,lastModified:i,lastModifiedFormatted:(0,a.formatDate)(i),cli:["codex"]});return n.sort((e,t)=>t.lastModified.getTime()-e.lastModified.getTime()),n}function h(e){let t=e.map(e=>({name:e.fileName.replace(/\.jsonl$/,""),path:e.filePath,lastModified:e.fileMtime,lastModifiedFormatted:(0,a.formatDate)(e.fileMtime),sessionId:e.sessionId,cli:"codex"}));return t.sort((e,t)=>t.lastModified.getTime()-e.lastModified.getTime()),t}async function w(e){let t;try{t=await y()}catch(e){return(0,l.logWarn)("Failed to scan Codex sessions:",e),[]}return h(t.filter(t=>t.cwd===e))}async function _(e){let t;try{t=await y()}catch(e){return(0,l.logWarn)("Failed to scan Codex sessions:",e),{cwd:null,sessions:[]}}let n=t.filter(t=>(0,s.encodeFolderName)(t.cwd)===e);return{cwd:n[0]?.cwd??null,sessions:h(n)}}let S=(0,r.runtimeCache)(g,30),M=(0,r.runtimeCache)(e=>w(e),30,{maxSize:50}),x=(0,r.runtimeCache)(e=>_(e),30,{maxSize:50});e.s(["getCachedCodexProjects",0,S,"getCachedCodexSessionsByEncodedName",0,x,"getCachedCodexSessionsForCwd",0,M,"getCodexProjects",0,g,"getCodexSessionsByEncodedName",0,_,"getCodexSessionsForCwd",0,w])},57232,e=>{"use strict";var t=e.i(2157),n=e.i(12714),i=e.i(50227),s=e.i(60526),r=e.i(83534),o=e.i(54214),a=e.i(67405);let l=(0,e.i(79857).codexSessionPathsFile)();function u(){try{if(!(0,t.existsSync)(l))return{};return JSON.parse((0,t.readFileSync)(l,"utf-8"))}catch{return{}}}function c(e,n){try{(0,t.mkdirSync)((0,i.dirname)(l),{recursive:!0});let s=u();s[e]=n,(0,t.writeFileSync)(l,JSON.stringify(s),"utf-8")}catch{}}function d(e,n){try{for(let s of(0,t.readdirSync)(e,{withFileTypes:!0}))if(s.isFile()&&s.name.includes(n)&&s.name.endsWith(".jsonl"))return(0,i.join)(e,s.name)}catch{}return null}function f(e){let n=u()[e];if(n&&(0,t.existsSync)(n))return n;let r=(0,i.join)((0,s.homedir)(),".codex","sessions"),o=new Date,a=new Date(o.getTime()-864e5);for(let t of[o,a].map(e=>{let t=String(e.getUTCFullYear()),n=String(e.getUTCMonth()+1).padStart(2,"0"),s=String(e.getUTCDate()).padStart(2,"0");return(0,i.join)(r,t,n,s)})){let n=d(t,e);if(n)return c(e,n),n}try{for(let n of(0,t.readdirSync)(r,{withFileTypes:!0}))if(n.isDirectory()){for(let s of(0,t.readdirSync)((0,i.join)(r,n.name),{withFileTypes:!0}))if(s.isDirectory())for(let o of(0,t.readdirSync)((0,i.join)(r,n.name,s.name),{withFileTypes:!0})){if(!o.isDirectory())continue;let t=d((0,i.join)(r,n.name,s.name,o.name),e);if(t)return c(e,t),t}}}catch{}return null}function m(e,t){return Array.isArray(e)?e.filter(e=>e?.type===t&&"string"==typeof e.text).map(e=>e.text).join("\n"):""}async function p(e,t="session"){let n,i=e.split("\n").filter(e=>""!==e.trim()),s=[],r=[],l=new Map,u=new Map,c=!1;for(let e=0;e<i.length;e++){let d;e>0&&e%200==0&&await new Promise(e=>setImmediate(e));let f=i[e];try{d=JSON.parse(f)}catch{continue}let p={...d,_source:t};r.push(p);let y=d.timestamp;if(!y)continue;let g=new Date(y);if(Number.isNaN(g.getTime()))continue;let h=d.type,w=d.payload??{};if("session_meta"===h){let e=w.cwd;"string"!=typeof e||n||(n=e),s.push({type:"system",...(0,o.baseEntry)(p,y,g,t),raw:p});continue}if("response_item"===h){let e=w.type;if("message"===e){let e=w.role,n=w.content;if("user"===e||"developer"===e){let i=m(n,"input_text");if(!i)continue;let r="developer"===e?`[developer] ${i}`:i;s.push({type:"user",...(0,o.baseEntry)(p,y,g,t),message:{role:"user",content:r}});continue}if("assistant"===e){let e=m(n,"output_text");if(!e)continue;let i=[{type:"text",text:e}];s.push({type:"assistant",...(0,o.baseEntry)(p,y,g,t),message:{role:"assistant",content:i}});continue}s.push({type:"system",...(0,o.baseEntry)(p,y,g,t),raw:p});continue}if("function_call"===e){let e=w.call_id,n=w.name??"function_call",i={type:"tool_use",id:e??`${y}-${n}`,name:n,input:function(e){if(!e)return{};try{return JSON.parse(e)}catch{return{}}}(w.arguments)},r={type:"assistant",...(0,o.baseEntry)(p,y,g,t),message:{role:"assistant",content:[i]}};s.push(r),e&&(l.set(e,i),u.set(e,g.getTime()));continue}if("function_call_output"===e){let e=w.call_id,n=e?l.get(e):void 0;if(n){let t=u.get(e)??g.getTime(),i=Math.max(0,g.getTime()-t);n.result={timestamp:y,timestampFormatted:(0,o.formatTimestamp)(g),content:"string"==typeof w.output?w.output:JSON.stringify(w.output),durationMs:i,durationFormatted:(0,a.formatDuration)(i)};continue}s.push({type:"system",...(0,o.baseEntry)(p,y,g,t),raw:p});continue}s.push({type:"system",...(0,o.baseEntry)(p,y,g,t),raw:p});continue}if("event_msg"===h){let e=w.type;if("task_started"===e){let e=c?"Session Resumed":"Session Started";c=!0,s.push({type:"queue-operation",...(0,o.baseEntry)(p,y,g,t),label:e});continue}if("exec_command_end"===e){let e=w.call_id,n=e?l.get(e):void 0;if(n){let t=w.duration,i=t?(t.secs??0)*1e3+Math.round((t.nanos??0)/1e6):Math.max(0,g.getTime()-(u.get(e)??g.getTime())),s=w.aggregated_output;n.result={timestamp:y,timestampFormatted:(0,o.formatTimestamp)(g),content:"string"==typeof s?s:JSON.stringify(s),durationMs:i,durationFormatted:(0,a.formatDuration)(i)};continue}s.push({type:"system",...(0,o.baseEntry)(p,y,g,t),raw:p});continue}if("user_message"===e||"agent_message"===e)continue;s.push({type:"system",...(0,o.baseEntry)(p,y,g,t),raw:p});continue}s.push({type:"system",...(0,o.baseEntry)(p,y,g,t),raw:p})}return s.length>500&&await new Promise(e=>setImmediate(e)),s.sort((e,t)=>e.timestampMs-t.timestampMs),{entries:s,rawLines:r,cwd:n}}async function y(e){let t=f(e);if(!t)return null;let i=await (0,n.readFile)(t,"utf-8"),{entries:s,rawLines:r,cwd:o}=await p(i,"session");return{entries:s,rawLines:r,cwd:o,filePath:t}}(0,r.runtimeCache)(e=>y(e),60,{maxSize:50}),e.s(["findCodexTranscript",0,f,"getCodexSessionLog",0,y])},55851,e=>{"use strict";var t=e.i(12714),n=e.i(60526),i=e.i(50227),s=e.i(81580),r=e.i(83534),o=e.i(71809),a=e.i(28557),l=e.i(40911);async function u(e){try{return await (0,t.readdir)(e,{withFileTypes:!0})}catch{return null}}async function c(e){try{return(await (0,t.stat)(e)).mtime}catch{return null}}async function d(){let e=(0,i.join)(process.env.COPILOT_HOME||(0,i.join)((0,n.homedir)(),".copilot"),"session-state"),s=await u(e);if(!s)return[];let r=s.filter(e=>e.isDirectory()).map(t=>({sessionId:t.name,workspacePath:(0,i.join)(e,t.name,"workspace.yaml"),eventsPath:(0,i.join)(e,t.name,"events.jsonl")}));return(await (0,o.batchAll)(r.map(e=>async()=>{let n;try{n=await (0,t.readFile)(e.workspacePath,"utf-8")}catch{return null}let i=function(e){let t=e.match(/^cwd\s*:\s*(.+?)\s*$/m);if(t)return t[1].replace(/^['"]|['"]$/g,"")}(n);if(!i)return null;let s=await c(e.eventsPath),r=await c(e.workspacePath),o=null!==s,a=s&&r?new Date(Math.max(s.getTime(),r.getTime())):s??r??new Date(0);return{workspacePath:e.workspacePath,eventsPath:e.eventsPath,sessionId:e.sessionId,cwd:i,fileMtime:a,hasTranscript:o}}),16)).filter(e=>"fulfilled"===e.status).map(e=>e.value).filter(e=>null!==e)}let f=(0,r.runtimeCache)(d,30);async function m(){let e;try{e=await f()}catch(e){return(0,l.logWarn)("Failed to scan Copilot sessions:",e),[]}let t=new Map;for(let n of e){if(!n.hasTranscript)continue;let e=t.get(n.cwd);(!e||n.fileMtime.getTime()>e.latest.getTime())&&t.set(n.cwd,{latest:n.fileMtime,cwd:n.cwd})}let n=[];for(let{cwd:e,latest:i}of t.values())n.push({name:(0,s.encodeFolderName)(e),path:e,isDirectory:!0,lastModified:i,lastModifiedFormatted:(0,a.formatDate)(i),cli:["copilot"]});return n.sort((e,t)=>t.lastModified.getTime()-e.lastModified.getTime()),n}function p(e){let t=e.filter(e=>e.hasTranscript).map(e=>({name:e.sessionId,path:e.eventsPath,lastModified:e.fileMtime,lastModifiedFormatted:(0,a.formatDate)(e.fileMtime),sessionId:e.sessionId,cli:"copilot"}));return t.sort((e,t)=>t.lastModified.getTime()-e.lastModified.getTime()),t}async function y(e){let t;try{t=await f()}catch(e){return(0,l.logWarn)("Failed to scan Copilot sessions:",e),[]}return p(t.filter(t=>t.cwd===e))}async function g(e){let t;try{t=await f()}catch(e){return(0,l.logWarn)("Failed to scan Copilot sessions:",e),{cwd:null,sessions:[]}}let n=t.filter(t=>t.hasTranscript&&(0,s.encodeFolderName)(t.cwd)===e);return{cwd:n[0]?.cwd??null,sessions:p(n)}}let h=(0,r.runtimeCache)(m,30),w=(0,r.runtimeCache)(e=>y(e),30,{maxSize:50}),_=(0,r.runtimeCache)(e=>g(e),30,{maxSize:50});e.s(["getCachedCopilotProjects",0,h,"getCachedCopilotSessionsByEncodedName",0,_,"getCachedCopilotSessionsForCwd",0,w,"getCopilotProjects",0,m,"getCopilotSessionsByEncodedName",0,g,"getCopilotSessionsForCwd",0,y])},78166,e=>{"use strict";var t=e.i(2157),n=e.i(12714),i=e.i(50227),s=e.i(60526),r=e.i(83534),o=e.i(54214),a=e.i(67405);function l(e,t){let n=function(e){if(!e)return null;let t=(0,i.resolve)((0,i.join)(process.env.COPILOT_HOME||(0,i.join)((0,s.homedir)(),".copilot"),"session-state")),n=(0,i.resolve)(t,e);return n!==t&&n.startsWith(`${t}${i.sep}`)?n:null}(e);return n?(0,i.join)(n,t):null}function u(e){let n=l(e,"events.jsonl");return n&&(0,t.existsSync)(n)?n:null}async function c(e,t="session"){let n,i=e.split("\n").filter(e=>""!==e.trim()),s=[],r=[],l=new Map,u=new Map,d=!1;for(let e=0;e<i.length;e++){let c;e>0&&e%200==0&&await new Promise(e=>setImmediate(e));let f=i[e];try{c=JSON.parse(f)}catch{continue}let m={...c,_source:t};r.push(m);let p=c.timestamp;if(!p)continue;let y=new Date(p);if(Number.isNaN(y.getTime()))continue;let g=y.toISOString(),h=c.type,w=c.data??{};if("session.start"===h){let e=w.context,i=e?.cwd;"string"!=typeof i||n||(n=i);let r=d?"Session Resumed":"Session Started";d=!0,s.push({type:"queue-operation",...(0,o.baseEntry)(m,g,y,t),label:r});continue}if("user.message"===h){let e=w.content??"";if(!e)continue;s.push({type:"user",...(0,o.baseEntry)(m,g,y,t),message:{role:"user",content:e}});continue}if("system.message"===h){s.push({type:"system",...(0,o.baseEntry)(m,g,y,t),raw:m});continue}if("assistant.message"===h){let e=w.content??"";if(!e){s.push({type:"system",...(0,o.baseEntry)(m,g,y,t),raw:m});continue}let n=[{type:"text",text:e}];s.push({type:"assistant",...(0,o.baseEntry)(m,g,y,t),message:{role:"assistant",content:n}});continue}if("tool.execution_start"===h){let e=w.toolCallId,n=w.toolName??"tool",i=w.arguments??{},r={type:"tool_use",id:e??`${y.getTime()}-${n}`,name:n,input:i},a={type:"assistant",...(0,o.baseEntry)(m,g,y,t),message:{role:"assistant",content:[r]}};s.push(a),e&&(l.set(e,r),u.set(e,y.getTime()));continue}if("tool.execution_complete"===h){let e=w.toolCallId,n=e?l.get(e):void 0;if(n){let t=u.get(e)??y.getTime(),i=w.result??{},s=w.toolTelemetry??{},r=s.metrics?.commandTimeMs??s.metrics?.durationMs??null,l="number"==typeof r&&r>=0?r:Math.max(0,y.getTime()-t),c=i.detailedContent??i.content??"";n.result={timestamp:g,timestampFormatted:(0,o.formatTimestamp)(y),content:"string"==typeof c?c:JSON.stringify(c),durationMs:l,durationFormatted:(0,a.formatDuration)(l)};continue}s.push({type:"system",...(0,o.baseEntry)(m,g,y,t),raw:m});continue}s.push({type:"system",...(0,o.baseEntry)(m,g,y,t),raw:m})}return s.length>500&&await new Promise(e=>setImmediate(e)),s.sort((e,t)=>e.timestampMs-t.timestampMs),{entries:s,rawLines:r,cwd:n}}async function d(e){let i,s=u(e);if(!s)return null;try{i=await (0,n.readFile)(s,"utf-8")}catch{return null}let{entries:r,rawLines:o,cwd:a}=await c(i,"session");return{entries:r,rawLines:o,cwd:a??function(e){let n,i=(n=l(e,"workspace.yaml"))&&(0,t.existsSync)(n)?n:null;if(i)try{let e=(0,t.readFileSync)(i,"utf-8"),n=RegExp("^cwd\\s*:\\s*(.+?)\\s*$","m"),s=e.match(n);if(!s)return;return s[1].replace(/^['"]|['"]$/g,"")}catch{return}}(e),filePath:s}}(0,r.runtimeCache)(e=>d(e),60,{maxSize:50}),e.s(["findCopilotTranscript",0,u,"getCopilotSessionLog",0,d])},46413,e=>{"use strict";var t=e.i(12714),n=e.i(60526),i=e.i(50227),s=e.i(81580),r=e.i(83534),o=e.i(71809),a=e.i(28557),l=e.i(40911);let u=["agent-sessions","conversations","sessions"],c=["meta.json","session.json","workspace.json","workspace.yaml"],d=["events.jsonl","transcript.jsonl","messages.jsonl"];async function f(e){try{return await (0,t.readdir)(e,{withFileTypes:!0})}catch{return null}}async function m(e){try{return(await (0,t.stat)(e)).mtime}catch{return null}}async function p(e,n){for(let s of n){let n,r=(0,i.join)(e,s);if(await m(r)===null)continue;try{n=await (0,t.readFile)(r,"utf-8")}catch{continue}let o=function(e){try{let t=JSON.parse(e);if("string"==typeof t.cwd&&t.cwd.length>0)return t.cwd}catch{}let t=e.match(/^\s*cwd\s*:\s*(.+?)\s*$/m);if(t){let e=t[1].replace(/^['"]|['"]$/g,"");if(e.length>0)return e}}(n);if(o)return{path:r,cwd:o}}return null}async function y(e,t){for(let n of t){let t=(0,i.join)(e,n);if(await m(t)!==null)return t}return null}async function g(){let e=process.env.CURSOR_HOME||(0,i.join)((0,n.homedir)(),".cursor"),t=[],r=[],a=(0,i.join)(e,"projects"),l=await f(a);if(l)for(let e of l){if(!e.isDirectory())continue;let n=(0,s.decodeFolderName)(e.name),r=n.startsWith("/")||/^[A-Za-z]:\//.test(n)?n:`/${n}`,o=(0,i.join)(a,e.name,"agent-transcripts"),l=await f(o);if(l)for(let e of l)e.isDirectory()&&t.push({sessionId:e.name,dir:(0,i.join)(o,e.name),cwd:r})}for(let t of u){let n=(0,i.join)(e,t),s=await f(n);if(s)for(let e of s)e.isDirectory()&&r.push({sessionId:e.name,dir:(0,i.join)(n,e.name)})}return 0===t.length&&0===r.length?[]:(await (0,o.batchAll)([...t.map(e=>async()=>{let t=(0,i.join)(e.dir,`${e.sessionId}.jsonl`),n=await m(t);return n?{metaPath:e.dir,transcriptPath:t,sessionId:e.sessionId,cwd:e.cwd,fileMtime:n,hasTranscript:!0}:null}),...r.map(e=>async()=>{let t=await p(e.dir,c);if(!t)return null;let n=await y(e.dir,d),i=n?await m(n):null,s=await m(t.path),r=i&&s?new Date(Math.max(i.getTime(),s.getTime())):i??s??new Date(0);return{metaPath:t.path,transcriptPath:n,sessionId:e.sessionId,cwd:t.cwd,fileMtime:r,hasTranscript:null!==n}})],16)).filter(e=>"fulfilled"===e.status).map(e=>e.value).filter(e=>null!==e)}let h=(0,r.runtimeCache)(g,30);async function w(){let e;try{e=await h()}catch(e){return(0,l.logWarn)("Failed to scan Cursor sessions:",e),[]}let t=new Map;for(let n of e){if(!n.hasTranscript)continue;let e=t.get(n.cwd);(!e||n.fileMtime.getTime()>e.latest.getTime())&&t.set(n.cwd,{latest:n.fileMtime,cwd:n.cwd})}let n=[];for(let{cwd:e,latest:i}of t.values())n.push({name:(0,s.encodeFolderName)(e),path:e,isDirectory:!0,lastModified:i,lastModifiedFormatted:(0,a.formatDate)(i),cli:["cursor"]});return n.sort((e,t)=>t.lastModified.getTime()-e.lastModified.getTime()),n}function _(e){let t=e.filter(e=>e.hasTranscript&&e.transcriptPath).map(e=>({name:e.sessionId,path:e.transcriptPath,lastModified:e.fileMtime,lastModifiedFormatted:(0,a.formatDate)(e.fileMtime),sessionId:e.sessionId,cli:"cursor"}));return t.sort((e,t)=>t.lastModified.getTime()-e.lastModified.getTime()),t}async function S(e){let t;try{t=await h()}catch(e){return(0,l.logWarn)("Failed to scan Cursor sessions:",e),[]}return _(t.filter(t=>t.cwd===e))}async function M(e){let t;try{t=await h()}catch(e){return(0,l.logWarn)("Failed to scan Cursor sessions:",e),{cwd:null,sessions:[]}}let n=t.filter(t=>t.hasTranscript&&(0,s.encodeFolderName)(t.cwd)===e);return{cwd:n[0]?.cwd??null,sessions:_(n)}}let x=(0,r.runtimeCache)(w,30),v=(0,r.runtimeCache)(e=>S(e),30,{maxSize:50}),C=(0,r.runtimeCache)(e=>M(e),30,{maxSize:50});e.s(["getCachedCursorProjects",0,x,"getCachedCursorSessionsByEncodedName",0,C,"getCachedCursorSessionsForCwd",0,v,"getCursorProjects",0,w,"getCursorSessionsByEncodedName",0,M,"getCursorSessionsForCwd",0,S])},72094,e=>{"use strict";var t=e.i(2157),n=e.i(12714),i=e.i(50227),s=e.i(60526),r=e.i(83534),o=e.i(54214),a=e.i(67405);let l=["agent-sessions","conversations","sessions"],u=["events.jsonl","transcript.jsonl","messages.jsonl"],c="agent-transcripts";function d(e){let n=function(e){if(!e)return null;let n=(0,i.resolve)(process.env.CURSOR_HOME||(0,i.join)((0,s.homedir)(),".cursor")),r=(0,i.resolve)(n,"projects"),o=[];try{o=(0,t.readdirSync)(r,{withFileTypes:!0})}catch{}for(let n of o){if(!n.isDirectory())continue;let s=(0,i.resolve)(r,n.name,c,e),o=(0,i.resolve)(r,n.name,c);if(s!==o&&s.startsWith(`${o}${i.sep}`)&&(0,t.existsSync)(s))return s}for(let s of l){let r=(0,i.resolve)(n,s),o=(0,i.resolve)(r,e);if(o!==r&&o.startsWith(`${r}${i.sep}`)&&(0,t.existsSync)(o))return o}return null}(e);if(!n)return null;let r=(0,i.join)(n,`${(0,i.basename)(n)}.jsonl`);if((0,t.existsSync)(r))return r;for(let e of u){let s=(0,i.join)(n,e);if((0,t.existsSync)(s))return s}return null}async function f(e,t="session"){let n,i=e.split("\n").filter(e=>""!==e.trim()),s=[],r=[],l=new Map,u=new Map,c=!1,d=Date.now();for(let e=0;e<i.length;e++){let f;e>0&&e%200==0&&await new Promise(e=>setImmediate(e));let m=i[e];try{f=JSON.parse(m)}catch{continue}let p={...f,_source:t};if(r.push(p),!f.type&&f.role&&f.message?.content){let n=new Date(d+e),i=n.toISOString(),r=f.message.content.filter(e=>e?.type==="text"&&"string"==typeof e.text).map(e=>e.text).join("");if("user"===f.role){let e=/<user_query>\s*([\s\S]*?)\s*<\/user_query>/.exec(r),a=e?e[1]:r;a&&s.push({type:"user",...(0,o.baseEntry)(p,i,n,t),message:{role:"user",content:a}});continue}if("assistant"===f.role){let e=r?[{type:"text",text:r}]:[];0===e.length?s.push({type:"system",...(0,o.baseEntry)(p,i,n,t),raw:p}):s.push({type:"assistant",...(0,o.baseEntry)(p,i,n,t),message:{role:"assistant",content:e}});continue}s.push({type:"system",...(0,o.baseEntry)(p,i,n,t),raw:p});continue}let y=f.timestamp;if(!y)continue;let g=new Date(y);if(Number.isNaN(g.getTime()))continue;let h=g.toISOString(),w=f.type,_=f.data??{};if("session.start"===w||"sessionStart"===w||"session_start"===w){let e=_.context??_,i=e.cwd;"string"!=typeof i||n||(n=i),!n&&Array.isArray(e.workspace_roots)&&"string"==typeof e.workspace_roots[0]&&(n=e.workspace_roots[0]);let r=c?"Session Resumed":"Session Started";c=!0,s.push({type:"queue-operation",...(0,o.baseEntry)(p,h,g,t),label:r});continue}if("user.message"===w||"userMessage"===w){let e="string"==typeof _.content?_.content:"string"==typeof _.text?_.text:"";if(!e)continue;s.push({type:"user",...(0,o.baseEntry)(p,h,g,t),message:{role:"user",content:e}});continue}if("system.message"===w||"systemMessage"===w){s.push({type:"system",...(0,o.baseEntry)(p,h,g,t),raw:p});continue}if("assistant.message"===w||"assistantMessage"===w){let e="string"==typeof _.content?_.content:"string"==typeof _.text?_.text:"";if(!e){s.push({type:"system",...(0,o.baseEntry)(p,h,g,t),raw:p});continue}let n=[{type:"text",text:e}];s.push({type:"assistant",...(0,o.baseEntry)(p,h,g,t),message:{role:"assistant",content:n}});continue}if("tool.execution_start"===w||"tool.executionStart"===w||"preToolUse"===w){let e=_.toolCallId??_.tool_use_id,n=_.toolName??_.tool_name??"tool",i=_.arguments??_.tool_input??{},r={type:"tool_use",id:e??`${g.getTime()}-${n}`,name:n,input:i},a={type:"assistant",...(0,o.baseEntry)(p,h,g,t),message:{role:"assistant",content:[r]}};s.push(a),e&&(l.set(e,r),u.set(e,g.getTime()));continue}if("tool.execution_complete"===w||"tool.executionComplete"===w||"postToolUse"===w){let e=_.toolCallId??_.tool_use_id,n=e?l.get(e):void 0;if(n){let t=u.get(e)??g.getTime(),i=_.result??{},s=_.duration,r="number"==typeof s&&s>=0?s:Math.max(0,g.getTime()-t),l=i.detailedContent??i.content??_.tool_output??"";n.result={timestamp:h,timestampFormatted:(0,o.formatTimestamp)(g),content:"string"==typeof l?l:JSON.stringify(l),durationMs:r,durationFormatted:(0,a.formatDuration)(r)};continue}s.push({type:"system",...(0,o.baseEntry)(p,h,g,t),raw:p});continue}s.push({type:"system",...(0,o.baseEntry)(p,h,g,t),raw:p})}return s.length>500&&await new Promise(e=>setImmediate(e)),s.sort((e,t)=>e.timestampMs-t.timestampMs),{entries:s,rawLines:r,cwd:n}}async function m(e){let t,i=d(e);if(!i)return null;try{t=await (0,n.readFile)(i,"utf-8")}catch{return null}let{entries:s,rawLines:r,cwd:o}=await f(t,"session");return{entries:s,rawLines:r,cwd:o,filePath:i}}(0,r.runtimeCache)(e=>m(e),60,{maxSize:50}),e.s(["findCursorTranscript",0,d,"getCursorSessionLog",0,m])},79364,e=>{"use strict";var t=e.i(79708),n=e.i(40375),i=e.i(81580),s=e.i(83534),r=e.i(28557);async function o(){let e=await (0,t.openSqliteReadonly)((0,n.devinDbPath)());if(!e)return[];try{return e.query("SELECT id, working_directory, title, created_at, last_activity_at, hidden FROM sessions ORDER BY last_activity_at DESC").filter(e=>!e.hidden).map(e=>{let t=e.working_directory??void 0;return{sessionId:e.id,cwd:t,title:e.title??void 0,projectName:t?(0,i.encodeFolderName)(t):"devin",mtimeMs:(0,n.devinEpochToMs)(e.last_activity_at??e.created_at)}})}catch{return[]}finally{e.close()}}let a=(0,s.runtimeCache)(o,2);async function l(){let e=await o(),t=new Map;for(let n of e){if(!n.cwd)continue;let e=t.get(n.projectName);(!e||n.mtimeMs>e.latest)&&t.set(n.projectName,{latest:n.mtimeMs,cwd:n.cwd,name:n.projectName})}let n=[];for(let{name:e,cwd:i,latest:s}of t.values()){let t=new Date(s);n.push({name:e,path:i,isDirectory:!0,lastModified:t,lastModifiedFormatted:(0,r.formatDate)(t),cli:["devin"]})}return n.sort((e,t)=>t.lastModified.getTime()-e.lastModified.getTime()),n}async function u(e){let t=(await o()).filter(t=>t.cwd&&t.projectName===e);if(0===t.length)return{cwd:null,sessions:[]};let n=[...t].sort((e,t)=>t.mtimeMs-e.mtimeMs);return{cwd:n[0].cwd??null,sessions:n.map(e=>{let t=new Date(e.mtimeMs);return{name:e.title??e.sessionId,path:`devin-db://${e.sessionId}`,lastModified:t,lastModifiedFormatted:(0,r.formatDate)(t),sessionId:e.sessionId,cli:"devin"}})}}let c=(0,s.runtimeCache)(l,2),d=(0,s.runtimeCache)(e=>u(e),2,{maxSize:50});e.s(["getCachedDevinProjects",0,c,"getCachedDevinSessions",0,a,"getCachedDevinSessionsByEncodedName",0,d,"getDevinProjects",0,l,"getDevinSessions",0,o,"getDevinSessionsByEncodedName",0,u])},40375,e=>{"use strict";var t=e.i(60526),n=e.i(50227),i=e.i(79708),s=e.i(83534),r=e.i(54214),o=e.i(67405);let a=/^[A-Za-z0-9_-]+$/;function l(){return process.env.DEVIN_DB_PATH||(0,n.join)(process.env.DEVIN_HOME||(0,n.join)((0,t.homedir)(),".local","share","devin"),"cli","sessions.db")}function u(e){if("string"==typeof e&&0!==e.length)try{return JSON.parse(e)}catch{return}}function c(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function d(e){return"string"==typeof e?e:Array.isArray(e)?e.map(e=>c(e)&&"string"==typeof e.text?e.text:"").filter(Boolean).join("\n"):""}function f(e,t){if("number"==typeof e&&Number.isFinite(e)){if(e>1e12)return new Date(e);if(e>1e9)return new Date(1e3*e)}if("string"==typeof e){let t=Date.parse(e);if(!Number.isNaN(t))return new Date(t)}return new Date(t)}async function m(e){if(!e||!a.test(e))return null;let t=await (0,i.openSqliteReadonly)(l());if(!t)return null;try{let n=t.query("SELECT working_directory FROM sessions WHERE id = ?",[e]);if(0===n.length)return null;let i=n[0].working_directory,s=t.query("SELECT node_id, parent_node_id, chat_message, created_at FROM message_nodes WHERE session_id = ? ORDER BY node_id ASC",[e]),a=function(e){let t=[];for(let n of e){let e=u(n.chat_message);c(e)&&(null!=n.created_at&&null==e._created_at&&(e._created_at=n.created_at),t.push(e))}return t}(function(e){if(0===e.length)return e;let t=new Map;for(let n of e)"number"==typeof n.node_id&&t.set(n.node_id,n);let n=e.reduce((e,t)=>(e.node_id??-1)>(t.node_id??-1)?e:t),i=[],s=new Set;for(;n&&"number"==typeof n.node_id&&!s.has(n.node_id);)s.add(n.node_id),i.push(n),n=null!=n.parent_node_id?t.get(n.parent_node_id):void 0;return i.reverse()}(s)),l=function(e,t="session"){let n=[],i=new Map,s=new Map,a=Date.now();for(let l=0;l<e.length;l++){let m=e[l];if(!c(m))continue;let p="string"==typeof m.role?m.role:"system",y=function(e,t){let n=c(e.metadata)?e.metadata:void 0;return n&&null!=n.created_at?f(n.created_at,t):null!=e._created_at?f(e._created_at,t):new Date(t)}(m,a+l),g=y.toISOString(),h={uuid:null!=m.message_id?String(m.message_id):`devin-${l}`,parentUuid:null},w=(0,r.baseEntry)(h,g,y,t);if("user"===p){n.push({type:"user",...w,message:{role:"user",content:d(m.content)}});continue}if("assistant"===p){let e=[],t=d(m.content);for(let n of(t&&e.push({type:"text",text:t}),function(e){let t=Array.isArray(e)?e:u(e);if(!Array.isArray(t))return[];let n=[];for(let e of t){if(!c(e))continue;let t=c(e.function)?e.function:{},i="string"==typeof e.name?e.name:"string"==typeof t.name?t.name:"tool",s="string"==typeof e.id&&e.id||"string"==typeof e.call_id&&e.call_id||`${i}-${n.length}`,r=e.arguments??t.arguments,o=c(r)?r:u(r);n.push({id:s,name:i,input:c(o)?o:{}})}return n}(m.tool_calls))){let t={type:"tool_use",id:n.id,name:n.name,input:n.input};e.push(t),i.set(n.id,t),s.set(n.id,y.getTime())}if(0===e.length)continue;n.push({type:"assistant",...w,message:{role:"assistant",content:e,model:"string"==typeof m.model?m.model:void 0}});continue}if("tool"===p){let e="string"==typeof m.tool_call_id?m.tool_call_id:void 0,t=e?i.get(e):void 0;if(t){let n=e&&s.get(e)||y.getTime(),i=Math.max(0,y.getTime()-n);t.result={timestamp:g,timestampFormatted:(0,r.formatTimestamp)(y),content:d(m.content),durationMs:i,durationFormatted:(0,o.formatDuration)(i)};continue}}n.push({type:"system",...w,raw:h})}return n.sort((e,t)=>e.timestampMs-t.timestampMs),n}(a,"session"),m=i&&i.length>0?i:void 0;return{entries:l,rawLines:a,cwd:m,filePath:`devin-db://${e}`}}catch{return null}finally{t.close()}}(0,s.runtimeCache)(e=>m(e),2,{maxSize:50}),e.s(["devinDbPath",0,l,"devinEpochToMs",0,function(e){if("number"==typeof e&&Number.isFinite(e)){if(e>1e12)return e;if(e>1e9)return 1e3*e}return Date.now()},"getDevinSessionLog",0,m])},28246,e=>{"use strict";var t=e.i(12714),n=e.i(2157),i=e.i(60526),s=e.i(50227),r=e.i(81580),o=e.i(83534),a=e.i(54214),l=e.i(67405);let u=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;function c(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function d(e){return"string"==typeof e?e:Array.isArray(e)?e.map(e=>c(e)&&"string"==typeof e.text?e.text:"").filter(Boolean).join("\n"):""}function f(e,t="session"){let n=[],i=new Map,s=new Map,r=Date.now();for(let o=0;o<e.length;o++){let u=e[o];if(!c(u)||"message"!==u.type)continue;let f=c(u.message)?u.message:void 0;if(!f)continue;let m="string"==typeof f.role?f.role:"system",p=function(e,t){if("number"==typeof e&&Number.isFinite(e)){if(e>1e12)return new Date(e);if(e>1e9)return new Date(1e3*e)}if("string"==typeof e){let t=Date.parse(e);if(!Number.isNaN(t))return new Date(t)}return new Date(t)}(u.timestamp??f.timestamp,r+o),y=p.toISOString(),g={uuid:null!=u.id?String(u.id):`factory-${o}`,parentUuid:null!=u.parentId?String(u.parentId):null},h=(0,a.baseEntry)(g,y,p,t),w=f.content;if("assistant"===m){let e=[];if(Array.isArray(w)){for(let t of w)if(c(t)){if("text"===t.type&&"string"==typeof t.text)e.push({type:"text",text:t.text});else if("tool_use"===t.type){let n="string"==typeof t.id?t.id:`${String(t.name??"tool")}-${e.length}`,r={type:"tool_use",id:n,name:"string"==typeof t.name?t.name:"tool",input:c(t.input)?t.input:{}};e.push(r),i.set(n,r),s.set(n,p.getTime())}}}else{let t=d(w);t&&e.push({type:"text",text:t})}if(0===e.length)continue;n.push({type:"assistant",...h,message:{role:"assistant",content:e,model:"string"==typeof f.model?f.model:void 0}});continue}if(Array.isArray(w)){let e=!1,t=[];for(let n of w)if(c(n)){if("tool_result"===n.type){let t="string"==typeof n.tool_use_id?n.tool_use_id:"string"==typeof n.toolUseId?n.toolUseId:void 0,r=t?i.get(t):void 0;if(r){let i=t&&s.get(t)||p.getTime(),o=Math.max(0,p.getTime()-i);r.result={timestamp:y,timestampFormatted:(0,a.formatTimestamp)(p),content:d(n.content),durationMs:o,durationFormatted:(0,l.formatDuration)(o)},e=!0;continue}}"text"===n.type&&"string"==typeof n.text&&t.push(n.text)}t.length>0?n.push({type:"user",...h,message:{role:"user",content:t.join("\n")}}):e||n.push({type:"system",...h,raw:g});continue}if("user"===m){n.push({type:"user",...h,message:{role:"user",content:d(w)}});continue}n.push({type:"system",...h,raw:g})}return n.sort((e,t)=>e.timestampMs-t.timestampMs),n}function m(){let e,t=(0,s.join)(process.env.FACTORY_HOME||(0,s.join)((0,i.homedir)(),".factory"),"sessions"),o=[];try{e=(0,n.readdirSync)(t,{withFileTypes:!0}).filter(e=>e.isDirectory())}catch{return o}for(let i of e){let e,a=i.name,l=(0,r.decodeFolderName)(a),c=(0,s.join)(t,a);try{e=(0,n.readdirSync)(c)}catch{continue}for(let t of e){if(!t.endsWith(".jsonl"))continue;let e=t.slice(0,-6);if(!u.test(e))continue;let i=(0,s.join)(c,t);try{let t=(0,n.statSync)(i);o.push({projectName:a,cwd:l,sessionId:e,transcriptPath:i,mtimeMs:t.mtimeMs,sizeBytes:t.size})}catch{}}}return o}function p(e){if(!u.test(e))return null;for(let t of m())if(t.sessionId===e)return t.transcriptPath;return null}async function y(e){let n,i,s=p(e);if(!s)return null;try{n=await (0,t.readFile)(s,"utf-8")}catch{return null}let r=(0,a.parseRawLines)(n,"session"),o=f(r,"session");for(let e of r)if(c(e)&&"session_start"===e.type&&"string"==typeof e.cwd&&e.cwd.length>0){i=e.cwd;break}return{entries:o,rawLines:r,cwd:i,filePath:s}}(0,o.runtimeCache)(e=>y(e),60,{maxSize:50}),e.s(["factoryLinesToLogEntries",0,f,"findFactoryTranscript",0,p,"getFactorySessionLog",0,y,"listFactoryTranscripts",0,m])},69164,e=>{"use strict";var t=e.i(79708),n=e.i(36618),i=e.i(81580),s=e.i(83534),r=e.i(28557);async function o(){let e=await (0,t.openSqliteReadonly)((0,n.gooseDbPath)());if(!e)return[];try{return e.query("SELECT id, working_dir, description, name, session_type, created_at, updated_at FROM sessions ORDER BY updated_at DESC").filter(e=>"hidden"!==e.session_type).map(e=>{let t=e.working_dir??void 0,s=(e.description&&e.description.length>0?e.description:e.name)??void 0;return{sessionId:e.id,cwd:t,title:s&&s.length>0?s:void 0,projectName:t?(0,i.encodeFolderName)(t):"goose",mtimeMs:(0,n.gooseTimestampToMs)(e.updated_at??e.created_at)}})}catch{return[]}finally{e.close()}}let a=(0,s.runtimeCache)(o,2);async function l(){let e=await o(),t=new Map;for(let n of e){if(!n.cwd)continue;let e=t.get(n.projectName);(!e||n.mtimeMs>e.latest)&&t.set(n.projectName,{latest:n.mtimeMs,cwd:n.cwd,name:n.projectName})}let n=[];for(let{name:e,cwd:i,latest:s}of t.values()){let t=new Date(s);n.push({name:e,path:i,isDirectory:!0,lastModified:t,lastModifiedFormatted:(0,r.formatDate)(t),cli:["goose"]})}return n.sort((e,t)=>t.lastModified.getTime()-e.lastModified.getTime()),n}async function u(e){let t=(await o()).filter(t=>t.cwd&&t.projectName===e);if(0===t.length)return{cwd:null,sessions:[]};let n=[...t].sort((e,t)=>t.mtimeMs-e.mtimeMs);return{cwd:n[0].cwd??null,sessions:n.map(e=>{let t=new Date(e.mtimeMs);return{name:e.title??e.sessionId,path:`goose-db://${e.sessionId}`,lastModified:t,lastModifiedFormatted:(0,r.formatDate)(t),sessionId:e.sessionId,cli:"goose"}})}}let c=(0,s.runtimeCache)(l,2),d=(0,s.runtimeCache)(e=>u(e),2,{maxSize:50});e.s(["getCachedGooseProjects",0,c,"getCachedGooseSessions",0,a,"getCachedGooseSessionsByEncodedName",0,d,"getGooseProjects",0,l,"getGooseSessions",0,o,"getGooseSessionsByEncodedName",0,u])},36618,e=>{"use strict";var t=e.i(60526),n=e.i(50227),i=e.i(79708),s=e.i(83534),r=e.i(54214),o=e.i(67405);let a=/^\d{8}_\d+$/;function l(){return process.env.GOOSE_DB_PATH||(0,n.join)(function(){if(process.env.GOOSE_HOME)return process.env.GOOSE_HOME;let e=process.env.XDG_DATA_HOME;return(0,n.join)(e&&e.length>0?e:(0,n.join)((0,t.homedir)(),".local","share"),"goose")}(),"sessions","sessions.db")}function u(e){if("number"==typeof e&&Number.isFinite(e)){if(e>1e12)return e;if(e>1e9)return 1e3*e}if("string"==typeof e&&e.length>0){let t=Date.parse(/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(e)?e.replace(" ","T")+"Z":e);if(!Number.isNaN(t))return t}return Date.now()}function c(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function d(e){return"string"==typeof e?e:Array.isArray(e)?e.map(e=>c(e)&&"string"==typeof e.text?e.text:"").filter(Boolean).join("\n"):""}async function f(e){if(!e||!a.test(e))return null;let t=await (0,i.openSqliteReadonly)(l());if(!t)return null;try{let n=t.query("SELECT working_dir FROM sessions WHERE id = ?",[e]);if(0===n.length)return null;let i=n[0].working_dir,s=t.query("SELECT role, content_json, created_timestamp FROM messages WHERE session_id = ? ORDER BY id ASC",[e]),a=function(e,t="session"){let n=[],i=new Map,s=new Map,a=Date.now();for(let l=0;l<e.length;l++){let f=e[l],m=function(e){if("string"==typeof e&&0!==e.length)try{return JSON.parse(e)}catch{return}}(f.content_json);if(!Array.isArray(m))continue;let p="string"==typeof f.role?f.role:"system",y=function(e,t){let n="number"==typeof e||"string"==typeof e?u(e):NaN;return new Date(Number.isNaN(n)?t:n)}(f.created_timestamp,a+l),g=y.toISOString(),h={uuid:`goose-${l}`,parentUuid:null},w=(0,r.baseEntry)(h,g,y,t),_=[],S=[],M=[];for(let e of m)c(e)&&("text"===e.type&&"string"==typeof e.text?_.push(e.text):"toolRequest"===e.type?S.push(e):"toolResponse"===e.type&&M.push(e));for(let e of M){let t="string"==typeof e.id?e.id:void 0,n=t?i.get(t):void 0;if(!n)continue;let a=t&&s.get(t)||y.getTime(),l=Math.max(0,y.getTime()-a);n.result={timestamp:g,timestampFormatted:(0,r.formatTimestamp)(y),content:function(e){let t=(c(e.toolResult)?e.toolResult:{}).value;return c(t)&&Array.isArray(t.content)?d(t.content):"string"==typeof t?t:Array.isArray(t)?d(t):""}(e),durationMs:l,durationFormatted:(0,o.formatDuration)(l)}}let x=_.join("\n").trim();if(S.length>0||"assistant"===p&&x){let e=[];for(let t of(x&&e.push({type:"text",text:x}),S)){let{id:n,name:r,input:o}=function(e,t){let n="string"==typeof e.id&&e.id?e.id:`goose-tool-${t}`,i=c(e.toolCall)?e.toolCall:{},s=c(i.value)?i.value:{},r="string"==typeof s.name?s.name:"tool";return{id:n,name:r,input:c(s.arguments)?s.arguments:{}}}(t,e.length),a={type:"tool_use",id:n,name:r,input:o};e.push(a),i.set(n,a),s.set(n,y.getTime())}if(0===e.length)continue;n.push({type:"assistant",...w,message:{role:"assistant",content:e}});continue}if("user"===p&&x){n.push({type:"user",...w,message:{role:"user",content:x}});continue}x&&n.push({type:"system",...w,raw:h})}return n.sort((e,t)=>e.timestampMs-t.timestampMs),n}(s,"session"),l=i&&i.length>0?i:void 0;return{entries:a,rawLines:s,cwd:l,filePath:`goose-db://${e}`}}catch{return null}finally{t.close()}}(0,s.runtimeCache)(e=>f(e),2,{maxSize:50}),e.s(["getGooseSessionLog",0,f,"gooseDbPath",0,l,"gooseTimestampToMs",0,u])},64828,e=>{"use strict";var t=e.i(79708),n=e.i(3605),i=e.i(28898),s=e.i(83534),r=e.i(28557);async function o(){let e=[];for(let{profile:t,dbPath:i}of(0,n.hermesDbPaths)())e.push(...await a(i,t));return e.sort((e,t)=>t.mtimeMs-e.mtimeMs),e}async function a(e,i){let s=await (0,t.openSqliteReadonly)(e);if(!s)return[];try{return s.query("SELECT s.id, s.source, s.cwd, s.title, s.user_id, s.chat_id, s.chat_type, s.started_at, s.ended_at, s.message_count, lm.last_activity FROM sessions s LEFT JOIN (SELECT session_id, MAX(timestamp) AS last_activity FROM messages GROUP BY session_id) lm ON lm.session_id = s.id ORDER BY lm.last_activity DESC").map(e=>({sessionId:e.id,profile:i,source:e.source??void 0,cwd:e.cwd??void 0,title:e.title??void 0,userId:e.user_id??void 0,chatId:e.chat_id??void 0,chatType:e.chat_type??void 0,mtimeMs:(0,n.epochToMs)(e.last_activity??e.ended_at??e.started_at),messageCount:"number"==typeof e.message_count?e.message_count:0,hasMessages:null!=e.last_activity}))}catch{return[]}finally{s.close()}}let l=(0,s.runtimeCache)(o,2);async function u(){let e=await o(),t=new Map;for(let n of e){if(n.messageCount<=0&&!n.hasMessages)continue;let e=n.profile||i.HERMES_DEFAULT_PROFILE,s=n.source??"unknown",r=JSON.stringify([e,s]),o=t.get(r);o?(o.latest=Math.max(o.latest,n.mtimeMs),o.count+=1):t.set(r,{profile:e,source:s,latest:n.mtimeMs,count:1})}let n=[];for(let{profile:e,source:s,latest:o,count:a}of t.values()){let t=new Date(o);n.push({name:(0,i.hermesProjectName)(e,s),path:(0,i.hermesProjectPath)(e,s),isDirectory:!0,lastModified:t,lastModifiedFormatted:(0,r.formatDate)(t),cli:["hermes"],sessionCount:a})}return n.sort((e,t)=>t.lastModified.getTime()-e.lastModified.getTime()),n}async function c(e){let t=(0,i.hermesProjectNameCandidates)(e);if(0===t.length)return{cwd:null,sessions:[]};let n=await o(),s=e=>n.filter(t=>(t.messageCount>0||t.hasMessages)&&(t.profile||i.HERMES_DEFAULT_PROFILE)===e.profile&&(t.source??"unknown")===e.source),a=t[0],l=s(a);if(0===l.length)for(let e of t.slice(1)){let t=s(e);if(t.length>0){a=e,l=t;break}}let{profile:u,source:c}=a;return{cwd:(0,i.hermesProjectPath)(u,c),sessions:l.map(e=>{let t=new Date(e.mtimeMs);return{name:e.title??e.sessionId,path:`hermes://${e.sessionId}`,lastModified:t,lastModifiedFormatted:(0,r.formatDate)(t),sessionId:e.sessionId,cli:"hermes",userId:e.userId,channelId:e.chatId,channelType:e.chatType}})}}let d=(0,s.runtimeCache)(u,2),f=(0,s.runtimeCache)(e=>c(e),2,{maxSize:50});e.s(["getCachedHermesProjects",0,d,"getCachedHermesSessions",0,l,"getCachedHermesSessionsByEncodedName",0,f,"getHermesProjects",0,u,"getHermesSessions",0,o,"getHermesSessionsByEncodedName",0,c])},3605,28898,e=>{"use strict";var t=e.i(50227),n=e.i(79708),i=e.i(2157),s=e.i(60526);let r="profiles",o="default";function a(){let e,n=function(){let e=(process.env.HERMES_HOME||"").trim();if(e){let n=(0,t.resolve)(e),i=(0,t.dirname)(n);return(0,t.basename)(i)===r?(0,t.dirname)(i):n}return(0,t.join)((0,s.homedir)(),".hermes")}(),a=[{name:o,home:n}],l=new Set([o]);try{e=(0,i.readdirSync)((0,t.join)(n,r),{withFileTypes:!0}).filter(e=>(e.isDirectory()||e.isSymbolicLink())&&!e.name.startsWith(".")).map(e=>e.name).sort()}catch{return a}for(let i of e)l.has(i)||(l.add(i),a.push({name:i,home:(0,t.join)(n,r,i)}));return a}function l(e,t){return`hermes:${e}:${t}`}e.s(["HERMES_DEFAULT_PROFILE",0,o,"hermesProjectName",0,function(e,t){return`hermes-${e}-${t}`},"hermesProjectNameCandidates",0,function(e){if(!e.startsWith("hermes-"))return[];let t=e.slice(7);if(!t)return[];let n=[];for(let e of a().map(e=>e.name).sort((e,t)=>t.length-e.length)){let i=`${e}-`;t.startsWith(i)&&t.length>i.length&&n.push({profile:e,source:t.slice(i.length)})}return n.push({profile:o,source:t}),n},"hermesProjectPath",0,l,"listHermesProfiles",0,a],28898);var u=e.i(83534),c=e.i(54214),d=e.i(67405);function f(){let e=process.env.HERMES_DB_PATH;return e?[{profile:o,dbPath:e}]:a().map(e=>({profile:e.name,dbPath:(0,t.join)(e.home,"state.db")}))}function m(e){if("string"==typeof e&&0!==e.length)try{return JSON.parse(e)}catch{return}}function p(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function y(e){return"string"==typeof e?e:Array.isArray(e)?e.map(e=>p(e)&&"string"==typeof e.text?e.text:"").filter(Boolean).join("\n"):""}async function g(e){if(!e||!/^[A-Za-z0-9_-]+$/.test(e))return null;for(let{profile:t,dbPath:n}of f()){let i=await h(n,t,e);if(i)return i}return null}async function h(e,t,i){let s=await (0,n.openSqliteReadonly)(e);if(!s)return null;try{let e=s.query("SELECT source, cwd FROM sessions WHERE id = ?",[i]);if(0===e.length)return null;let{source:n,cwd:r}=e[0],o=s.query("SELECT id, role, content, tool_call_id, tool_calls, tool_name, timestamp FROM messages WHERE session_id = ? ORDER BY timestamp ASC",[i]),a=function(e,t="session"){let n=[],i=new Map,s=new Map,r=Date.now();for(let o=0;o<e.length;o++){let a=e[o];if(!p(a))continue;let l="string"==typeof a.role?a.role:"system",u=function(e,t){if("number"==typeof e&&Number.isFinite(e)){if(e>1e12)return new Date(e);if(e>1e9)return new Date(1e3*e)}if("string"==typeof e){let t=Date.parse(e);if(!Number.isNaN(t))return new Date(t)}return new Date(t)}(a.timestamp??a.time_created,r+o),f=u.toISOString(),g={uuid:null!=a.id?String(a.id):`hermes-${o}`,parentUuid:null},h=(0,c.baseEntry)(g,f,u,t);if("user"===l){n.push({type:"user",...h,message:{role:"user",content:y(a.content)}});continue}if("assistant"===l){let e=[],t=y(a.content);for(let n of(t&&e.push({type:"text",text:t}),function(e){let t=Array.isArray(e)?e:m(e);if(!Array.isArray(t))return[];let n=[];for(let e of t){if(!p(e))continue;let t=p(e.function)?e.function:{},i="string"==typeof t.name?t.name:"string"==typeof e.name?e.name:"tool",s="string"==typeof e.id&&e.id||"string"==typeof e.call_id&&e.call_id||`${i}-${n.length}`,r=p(t.arguments)?t.arguments:m(t.arguments);n.push({id:s,name:i,input:p(r)?r:{}})}return n}(a.tool_calls))){let t={type:"tool_use",id:n.id,name:n.name,input:n.input};e.push(t),i.set(n.id,t),s.set(n.id,u.getTime())}if(0===e.length)continue;n.push({type:"assistant",...h,message:{role:"assistant",content:e}});continue}if("tool"===l){let e="string"==typeof a.tool_call_id?a.tool_call_id:void 0,t=e?i.get(e):void 0;if(t){let n=e&&s.get(e)||u.getTime(),i=Math.max(0,u.getTime()-n);t.result={timestamp:f,timestampFormatted:(0,c.formatTimestamp)(u),content:y(a.content),durationMs:i,durationFormatted:(0,d.formatDuration)(i)};continue}}n.push({type:"system",...h,raw:g})}return n.sort((e,t)=>e.timestampMs-t.timestampMs),n}(o,"session"),u=r&&r.length>0?r:n?l(t,n):void 0;return{entries:a,rawLines:o,cwd:u,filePath:`hermes://${i}`,profile:t}}catch{return null}finally{s.close()}}(0,u.runtimeCache)(e=>g(e),2,{maxSize:50}),e.s(["epochToMs",0,function(e){if("number"==typeof e&&Number.isFinite(e)){if(e>1e12)return e;if(e>1e9)return 1e3*e}return Date.now()},"getHermesSessionLog",0,g,"hermesDbPaths",0,f],3605)},90624,e=>{"use strict";var t=e.i(2157),n=e.i(50227),i=e.i(83534),s=e.i(64199),r=e.i(28557);function o(e){return"string"==typeof e&&e.length>0?e:void 0}async function a(){let e=(0,s.listOpenClawTranscripts)(),i=new Map,r=[];for(let a of e){let e=i.get(a.agentId);e||(e=function(e){let i,r=new Map,a=(0,n.join)((0,s.openclawHome)(),"agents",e,"sessions","sessions.json");try{i=JSON.parse((0,t.readFileSync)(a,"utf-8"))}catch{return r}if(!i||"object"!=typeof i)return r;for(let e of Object.values(i)){if(!e||"object"!=typeof e)continue;let t=o(e.sessionId);if(!t)continue;let n=e.origin&&"object"==typeof e.origin?e.origin:{},i="number"==typeof e.lastInteractionAt?e.lastInteractionAt:"number"==typeof e.updatedAt?e.updatedAt:void 0;r.set(t,{lastMs:i,channel:o(e.lastChannel)??o(n.provider)??o(n.surface),chatType:o(e.chatType)??o(n.chatType),label:o(n.label),chatId:o(e.lastTo)??o(n.from)})}return r}(a.agentId),i.set(a.agentId,e));let l=e.get(a.sessionId);r.push({sessionId:a.sessionId,agentId:a.agentId,channel:l?.channel??"local",label:l?.label,chatType:l?.chatType,chatId:l?.chatId,transcriptPath:a.transcriptPath,mtimeMs:l?.lastMs??a.mtimeMs,sizeBytes:a.sizeBytes})}return r.sort((e,t)=>t.mtimeMs-e.mtimeMs),r}let l=(0,i.runtimeCache)(a,2);function u(e,t){return`openclaw-${e}-${t}`}function c(e,t){return`openclaw:${e}:${t}`}function d(e){if(!e.startsWith("openclaw-"))return[];let t=e.slice(9);if(!t)return[];let n=[];for(let e of(0,s.listOpenClawAgents)().sort((e,t)=>t.length-e.length)){let i=`${e}-`;t.startsWith(i)&&t.length>i.length&&n.push({agentId:e,channel:t.slice(i.length)})}return n.push({agentId:null,channel:t}),n}async function f(){let e=await a(),t=new Map;for(let n of e){let e=JSON.stringify([n.agentId,n.channel]),i=t.get(e);i?(i.latest=Math.max(i.latest,n.mtimeMs),i.count+=1):t.set(e,{agentId:n.agentId,channel:n.channel,latest:n.mtimeMs,count:1})}let n=[];for(let{agentId:e,channel:i,latest:s,count:o}of t.values()){let t=new Date(s);n.push({name:u(e,i),path:c(e,i),isDirectory:!0,lastModified:t,lastModifiedFormatted:(0,r.formatDate)(t),cli:["openclaw"],sessionCount:o})}return n.sort((e,t)=>t.lastModified.getTime()-e.lastModified.getTime()),n}async function m(e){let t=d(e);if(0===t.length)return{cwd:null,sessions:[]};let n=await a(),i=e=>n.filter(t=>t.channel===e.channel&&(null===e.agentId||t.agentId===e.agentId)),s=t[0],o=i(s);if(0===o.length)for(let e of t.slice(1)){let t=i(e);if(t.length>0){s=e,o=t;break}}let{agentId:l,channel:u}=s;return{cwd:null===l?`openclaw:${u}`:c(l,u),sessions:o.map(e=>{let t=new Date(e.mtimeMs);return{name:e.label??e.chatId??e.sessionId,path:e.sessionId,lastModified:t,lastModifiedFormatted:(0,r.formatDate)(t),sessionId:e.sessionId,cli:"openclaw",channelId:e.chatId,channelType:e.chatType}})}}let p=(0,i.runtimeCache)(f,2),y=(0,i.runtimeCache)(e=>m(e),2,{maxSize:50});e.s(["getCachedOpenClawProjects",0,p,"getCachedOpenClawSessions",0,l,"getCachedOpenClawSessionsByEncodedName",0,y,"getOpenClawProjects",0,f,"getOpenClawSessions",0,a,"getOpenClawSessionsByEncodedName",0,m,"openClawProjectName",0,u,"openClawProjectNameCandidates",0,d,"openClawProjectPath",0,c,"parseOpenClawProjectName",0,function(e){return d(e)[0]??null}])},64199,e=>{"use strict";var t=e.i(12714),n=e.i(2157),i=e.i(60526),s=e.i(50227),r=e.i(83534),o=e.i(54214),a=e.i(67405);let l=/^[0-9a-fA-F-]{36}$/;function u(){return process.env.OPENCLAW_HOME||(0,s.join)((0,i.homedir)(),".openclaw")}function c(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function d(e){return"string"==typeof e?e:Array.isArray(e)?e.map(e=>c(e)&&"string"==typeof e.text?e.text:"").filter(Boolean).join("\n"):""}function f(){let e,t=(0,s.join)(u(),"agents"),i=[];try{e=(0,n.readdirSync)(t,{withFileTypes:!0}).filter(e=>e.isDirectory()).map(e=>e.name)}catch{return i}for(let r of e){let e,o=(0,s.join)(t,r,"sessions");try{e=(0,n.readdirSync)(o)}catch{continue}for(let t of e){if(!t.endsWith(".jsonl")||t.endsWith(".trajectory.jsonl"))continue;let e=t.slice(0,-6);if(!l.test(e))continue;let a=(0,s.join)(o,t);try{let t=(0,n.statSync)(a);i.push({agentId:r,sessionId:e,transcriptPath:a,mtimeMs:t.mtimeMs,sizeBytes:t.size})}catch{}}}return i}function m(e){if(!l.test(e))return null;for(let t of f())if(t.sessionId===e)return t.transcriptPath;return null}async function p(e){let n,i,s=m(e);if(!s)return null;try{n=await (0,t.readFile)(s,"utf-8")}catch{return null}let r=(0,o.parseRawLines)(n,"session"),l=function(e,t="session"){let n=[],i=new Map,s=new Map,r=Date.now();for(let l=0;l<e.length;l++){let u=e[l];if(!c(u)||"message"!==u.type)continue;let f=c(u.message)?u.message:void 0;if(!f)continue;let m="string"==typeof f.role?f.role:"system",p=function(e,t){if("number"==typeof e&&Number.isFinite(e)){if(e>1e12)return new Date(e);if(e>1e9)return new Date(1e3*e)}if("string"==typeof e){let t=Date.parse(e);if(!Number.isNaN(t))return new Date(t)}return new Date(t)}(u.timestamp??f.timestamp,r+l),y=p.toISOString(),g={uuid:null!=u.id?String(u.id):`openclaw-${l}`,parentUuid:null!=u.parentId?String(u.parentId):null},h=(0,o.baseEntry)(g,y,p,t);if("user"===m){n.push({type:"user",...h,message:{role:"user",content:d(f.content)}});continue}if("assistant"===m){let e=[],t=f.content;if(Array.isArray(t)){for(let n of t)if(c(n)){if("text"===n.type&&"string"==typeof n.text)e.push({type:"text",text:n.text});else if("toolCall"===n.type){let t="string"==typeof n.id?n.id:`${String(n.name??"tool")}-${e.length}`,r={type:"tool_use",id:t,name:"string"==typeof n.name?n.name:"tool",input:c(n.arguments)?n.arguments:{}};e.push(r),i.set(t,r),s.set(t,p.getTime())}}}else{let n=d(t);n&&e.push({type:"text",text:n})}if(0===e.length)continue;n.push({type:"assistant",...h,message:{role:"assistant",content:e,model:"string"==typeof f.model?f.model:void 0}});continue}if("toolResult"===m){let e="string"==typeof f.toolCallId?f.toolCallId:void 0,t=e?i.get(e):void 0;if(t){let n=c(f.details)?f.details:void 0,i=e&&s.get(e)||p.getTime(),r=n&&"number"==typeof n.durationMs?n.durationMs:Math.max(0,p.getTime()-i);t.result={timestamp:y,timestampFormatted:(0,o.formatTimestamp)(p),content:d(f.content),durationMs:r,durationFormatted:(0,a.formatDuration)(r)};continue}}n.push({type:"system",...h,raw:g})}return n.sort((e,t)=>e.timestampMs-t.timestampMs),n}(r,"session");for(let e of r)if(c(e)&&"session"===e.type&&"string"==typeof e.cwd&&e.cwd.length>0){i=e.cwd;break}return{entries:l,rawLines:r,cwd:i,filePath:s}}(0,r.runtimeCache)(e=>p(e),2,{maxSize:50}),e.s(["findOpenClawTranscript",0,m,"getOpenClawSessionLog",0,p,"listOpenClawAgents",0,function(){try{return(0,n.readdirSync)((0,s.join)(u(),"agents"),{withFileTypes:!0}).filter(e=>e.isDirectory()&&!e.name.startsWith(".")).map(e=>e.name).sort()}catch{return[]}},"listOpenClawTranscripts",0,f,"openclawHome",0,u])},35435,e=>{"use strict";var t=e.i(74533),n=e.i(81580),i=e.i(83534),s=e.i(28557),r=e.i(40911);function o(e){try{let n=(0,t.execFileSync)("opencode",["db","--format","json",e],{encoding:"utf8",timeout:5e3,stdio:["ignore","pipe","pipe"]});if(!n.trim())return[];let i=JSON.parse(n);if(!Array.isArray(i))return null;return i}catch{return null}}function a(){return o("SELECT id, project_id, slug, directory, title, time_created, time_updated FROM session ORDER BY time_updated DESC LIMIT 1000")}function l(){return o("SELECT id, worktree, vcs, name, time_created, time_updated FROM project")}async function u(){let e=a(),t=l();if(null===e&&null===t)return[];let i=new Map;for(let e of t??[])i.set(e.id,e);let r=new Map;for(let t of e??[]){if(!t.project_id)continue;let e=r.get(t.project_id);e||(e={rows:[],latest:0},r.set(t.project_id,e)),e.rows.push(t),t.time_updated>e.latest&&(e.latest=t.time_updated)}let o=new Set,u=[];for(let[e,t]of r){o.add(e);let r=i.get(e),a=r?.worktree??t.rows[0]?.directory??null,l=a?(0,n.encodeFolderName)(a):e,c=a??"",d=new Date(Math.max(t.latest,r?.time_updated??0));u.push({name:l,path:c,isDirectory:!0,lastModified:d,lastModifiedFormatted:(0,s.formatDate)(d),cli:["opencode"]})}for(let e of t??[]){if(o.has(e.id))continue;let t=e.worktree??"",i=t?(0,n.encodeFolderName)(t):e.id,r=new Date(e.time_updated);u.push({name:i,path:t,isDirectory:!0,lastModified:r,lastModifiedFormatted:(0,s.formatDate)(r),cli:["opencode"]})}return u.sort((e,t)=>t.lastModified.getTime()-e.lastModified.getTime()),u}async function c(e){let t=a();return t?t.filter(t=>t.directory===e).map(e=>{let t=new Date(e.time_updated);return{name:e.title??e.slug??e.id,path:`opencode://${e.id}`,lastModified:t,lastModifiedFormatted:(0,s.formatDate)(t),sessionId:e.id,cli:"opencode"}}):[]}async function d(e){let t,i;try{t=l(),i=a()}catch(e){return(0,r.logWarn)("Failed to read OpenCode DB:",e),{cwd:null,sessions:[]}}if(!t||!i)return{cwd:null,sessions:[]};let o=t.find(t=>t.worktree&&(0,n.encodeFolderName)(t.worktree)===e);if(!o||!o.worktree)return{cwd:null,sessions:[]};let u=i.filter(e=>e.project_id===o.id);return{cwd:o.worktree,sessions:u.map(e=>{let t=new Date(e.time_updated);return{name:e.title??e.slug??e.id,path:`opencode://${e.id}`,lastModified:t,lastModifiedFormatted:(0,s.formatDate)(t),sessionId:e.id,cli:"opencode"}})}}let f=(0,i.runtimeCache)(u,30),m=(0,i.runtimeCache)(e=>c(e),30,{maxSize:50}),p=(0,i.runtimeCache)(e=>d(e),30,{maxSize:50});e.s(["getCachedOpenCodeProjects",0,f,"getCachedOpenCodeSessionsByEncodedName",0,p,"getCachedOpenCodeSessionsForCwd",0,m,"getOpenCodeProjects",0,u,"getOpenCodeSessionsByEncodedName",0,d,"getOpenCodeSessionsForCwd",0,c])},99440,e=>{"use strict";var t=e.i(74533),n=e.i(83534),i=e.i(54214),s=e.i(67405);function r(e){try{let n=(0,t.execFileSync)("opencode",["db","--format","json",e],{encoding:"utf8",timeout:5e3,stdio:["ignore","pipe","pipe"]});if(!n.trim())return[];let i=JSON.parse(n);if(!Array.isArray(i))return null;return i}catch{return null}}function o(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function a(e){if("string"!=typeof e||0===e.length)return null;try{let t=JSON.parse(e);return o(t)?t:null}catch{return null}}async function l(e){if(!e||!/^[A-Za-z0-9_-]+$/.test(e))return null;let t=r(`SELECT id, project_id, slug, directory, title, time_created, time_updated FROM session WHERE id = '${e}'`);if(!t||0===t.length)return null;let n=t[0],l=r(`SELECT id, session_id, time_created, time_updated, data FROM message WHERE session_id = '${e}' ORDER BY time_created ASC`),u=r(`SELECT id, message_id, session_id, time_created, time_updated, data FROM part WHERE session_id = '${e}' ORDER BY time_created ASC`);if(!l)return{entries:[],rawLines:[],cwd:n.directory??void 0,filePath:`opencode://${e}`};let c=new Map;for(let e of u??[]){let t=c.get(e.message_id);t||(t=[],c.set(e.message_id,t)),t.push(e)}let d=[],f=[];for(let e of l){let t=c.get(e.id)??[];d.push(function(e,t,n){let r=a(e.data)??{},l="string"==typeof r.role?r.role:"system",u=new Date(e.time_created),c=u.toISOString(),d={uuid:e.id,parentUuid:null},f=(0,i.baseEntry)(d,c,u,n),m=[],p="";for(let e of t){let t=a(e.data);if(!t)continue;let n="string"==typeof t.type?t.type:"unknown";if("text"===n){let e="string"==typeof t.text?t.text:"string"==typeof t.content?t.content:"";e&&(m.push({type:"text",text:e}),p+=(p?"\n":"")+e);continue}if("tool"===n){let n="string"==typeof t.tool?t.tool:"string"==typeof t.name?t.name:"tool",r=o(t.state)?t.state:null,a=r&&o(r.input)?r.input:o(t.input)?t.input:o(t.args)?t.args:{},l={type:"tool_use",id:e.id,name:n,input:a},u=r&&"string"==typeof r.status?r.status:"";if(r&&("completed"===u||"error"===u)){let t=("error"===u&&"string"==typeof r.error?r.error:null)??r.output,n="string"==typeof t?t:null!=t?JSON.stringify(t):"",a=o(r.time)?r.time:{},c="number"==typeof a.start?a.start:e.time_created,d="number"==typeof a.end?a.end:e.time_updated,f=Math.max(0,d-c),m=new Date(d);l.result={timestamp:m.toISOString(),timestampFormatted:(0,i.formatTimestamp)(m),content:n,durationMs:f,durationFormatted:(0,s.formatDuration)(f)}}m.push(l);continue}m.push({type:"text",text:`[opencode ${n}]`})}if("user"===l)return{...f,type:"user",message:{role:"user",content:p}};if("assistant"===l){let e=o(r.model)?r.model:null,t=e&&"string"==typeof e.modelID?e.modelID:void 0;return{...f,type:"assistant",message:{role:"assistant",content:m,model:t}}}return{...f,type:"system",raw:{id:e.id,role:l,parts:m}}}(e,t,"session"));let n=a(e.data);f.push({id:e.id,session_id:e.session_id,time_created:e.time_created,data:n??e.data})}return{entries:d,rawLines:f,cwd:n.directory??void 0,filePath:`opencode://${e}`}}async function u(e){if(!e||!/^[A-Za-z0-9_-]+$/.test(e))return null;let t=r(`SELECT id, project_id, slug, directory, title, time_created, time_updated FROM session WHERE id = '${e}'`);if(!t||0===t.length)return null;let n=r(`SELECT id, session_id, time_created, time_updated, data FROM message WHERE session_id = '${e}' ORDER BY time_created ASC`),i=r(`SELECT id, message_id, session_id, time_created, time_updated, data FROM part WHERE session_id = '${e}' ORDER BY time_created ASC`);return null===n||null===i?null:{session:t[0],messages:n.map(e=>({...e,data:a(e.data)??e.data})),parts:i.map(e=>({...e,data:a(e.data)??e.data}))}}(0,n.runtimeCache)(e=>l(e),30,{maxSize:50}),e.s(["getOpenCodeSessionExport",0,u,"getOpenCodeSessionLog",0,l])},19791,e=>{"use strict";var t=e.i(12714),n=e.i(60526),i=e.i(50227),s=e.i(81580),r=e.i(83534),o=e.i(71809),a=e.i(28557),l=e.i(40911);let u=/^[\d-]+T[\d-]+Z_([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.jsonl$/i;async function c(e){try{return await (0,t.readdir)(e,{withFileTypes:!0})}catch{return null}}async function d(e){try{return(await (0,t.stat)(e)).mtime}catch{return null}}async function f(e){let n;try{n=await (0,t.readFile)(e,"utf-8")}catch{return null}let i=n.indexOf("\n")>=0?n.slice(0,n.indexOf("\n")):n;if(!i)return null;try{let e=JSON.parse(i);if("session"!==e.type||"string"!=typeof e.cwd||0===e.cwd.length)return null;return e.cwd}catch{return null}}async function m(){let e=process.env.PI_SESSIONS_DIR||(0,i.join)((0,n.homedir)(),".pi","agent","sessions"),t=await c(e);if(!t)return[];let s=[];for(let n of t){if(!n.isDirectory())continue;let t=(0,i.join)(e,n.name),r=await c(t);if(r)for(let e of r){if(!e.isFile())continue;let n=u.exec(e.name);n&&s.push({sessionId:n[1],filePath:(0,i.join)(t,e.name)})}}return 0===s.length?[]:(await (0,o.batchAll)(s.map(e=>async()=>{let t=await f(e.filePath);if(!t)return null;let n=await d(e.filePath);return n?{filePath:e.filePath,sessionId:e.sessionId,cwd:t,fileMtime:n}:null}),16)).filter(e=>"fulfilled"===e.status).map(e=>e.value).filter(e=>null!==e)}let p=(0,r.runtimeCache)(m,30);async function y(){let e;try{e=await p()}catch(e){return(0,l.logWarn)("Failed to scan Pi sessions:",e),[]}let t=new Map;for(let n of e){let e=t.get(n.cwd);(!e||n.fileMtime.getTime()>e.latest.getTime())&&t.set(n.cwd,{latest:n.fileMtime,cwd:n.cwd})}let n=[];for(let{cwd:e,latest:i}of t.values())n.push({name:(0,s.encodeFolderName)(e),path:e,isDirectory:!0,lastModified:i,lastModifiedFormatted:(0,a.formatDate)(i),cli:["pi"]});return n.sort((e,t)=>t.lastModified.getTime()-e.lastModified.getTime()),n}function g(e){let t=e.map(e=>({name:e.sessionId,path:e.filePath,lastModified:e.fileMtime,lastModifiedFormatted:(0,a.formatDate)(e.fileMtime),sessionId:e.sessionId,cli:"pi"}));return t.sort((e,t)=>t.lastModified.getTime()-e.lastModified.getTime()),t}async function h(e){let t;try{t=await p()}catch(e){return(0,l.logWarn)("Failed to scan Pi sessions:",e),[]}return g(t.filter(t=>t.cwd===e))}async function w(e){let t;try{t=await p()}catch(e){return(0,l.logWarn)("Failed to scan Pi sessions:",e),{cwd:null,sessions:[]}}let n=t.filter(t=>(0,s.encodeFolderName)(t.cwd)===e),i=Array.from(new Set(n.map(e=>e.cwd)));return 1!==i.length?{cwd:null,sessions:[]}:{cwd:i[0],sessions:g(n)}}let _=(0,r.runtimeCache)(y,30),S=(0,r.runtimeCache)(e=>h(e),30,{maxSize:50}),M=(0,r.runtimeCache)(e=>w(e),30,{maxSize:50});e.s(["getCachedPiProjects",0,_,"getCachedPiSessionsByEncodedName",0,M,"getCachedPiSessionsForCwd",0,S,"getPiProjects",0,y,"getPiSessionsByEncodedName",0,w,"getPiSessionsForCwd",0,h])},85116,e=>{"use strict";var t=e.i(2157),n=e.i(12714),i=e.i(50227),s=e.i(60526),r=e.i(83534),o=e.i(54214),a=e.i(67405);let l=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,u=/^[\d-]+T[\d-]+Z_([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.jsonl$/i;function c(e){let n;if(!l.test(e))return null;let r=(0,i.resolve)(process.env.PI_SESSIONS_DIR||(0,i.join)((0,s.homedir)(),".pi","agent","sessions"));try{n=(0,t.readdirSync)(r)}catch{return null}for(let s of n){let n,o=(0,i.resolve)(r,s);if(o.startsWith(`${r}${i.sep}`)){try{n=(0,t.readdirSync)(o)}catch{continue}for(let s of n){let n=u.exec(s);if(!n||n[1].toLowerCase()!==e.toLowerCase())continue;let r=(0,i.resolve)(o,s);if(r.startsWith(`${o}${i.sep}`)&&(0,t.existsSync)(r))return r}}}return null}function d(e){if(!Array.isArray(e))return"";let t=[];for(let n of e)n?.type==="text"&&"string"==typeof n.text&&t.push(n.text);return t.join("\n\n")}async function f(e,t="session"){let n,i=e.split("\n").filter(e=>""!==e.trim()),s=[],r=[],l=!1,u=new Map,c=new Map;for(let e=0;e<i.length;e++){let f;e>0&&e%200==0&&await new Promise(e=>setImmediate(e));let m=i[e];try{f=JSON.parse(m)}catch{continue}let p={...f,_source:t};r.push(p);let y=f.timestamp;if(!y)continue;let g=new Date(y);if(Number.isNaN(g.getTime()))continue;let h=g.toISOString(),w=f.type;if("session"===w){"string"!=typeof f.cwd||n||(n=f.cwd);let e=l?"Session Resumed":"Session Started";l=!0,s.push({type:"queue-operation",...(0,o.baseEntry)(p,h,g,t),label:e});continue}if("message"===w&&f.message&&"object"==typeof f.message){let e=f.message.role,n=f.message.content;if("user"===e){let e=d(n);if(!e)continue;s.push({type:"user",...(0,o.baseEntry)(p,h,g,t),message:{role:"user",content:e}});continue}if("assistant"===e){let e=function(e,t){if(!Array.isArray(e))return[];let n=[];for(let i of e)if(i?.type==="text"&&"string"==typeof i.text&&i.text.length>0&&n.push({type:"text",text:i.text}),i?.type==="thinking"&&"string"==typeof i.thinking&&i.thinking.length>0&&n.push({type:"text",text:`[thinking] ${i.thinking}`}),i?.type==="toolCall"){let e="string"==typeof i.id&&i.id.length>0?i.id:`${"string"==typeof i.name?i.name:"tool"}-${n.length}`,s={type:"tool_use",id:e,name:"string"==typeof i.name?i.name:"tool",input:i.arguments&&"object"==typeof i.arguments&&!Array.isArray(i.arguments)?i.arguments:{}};n.push(s),t?.(s)}return n}(n,e=>{u.set(e.id,e),c.set(e.id,g.getTime())});if(0===e.length){s.push({type:"system",...(0,o.baseEntry)(p,h,g,t),raw:p});continue}s.push({type:"assistant",...(0,o.baseEntry)(p,h,g,t),message:{role:"assistant",content:e}});continue}if("toolResult"===e){let e=f.message.toolCallId,t="string"==typeof e?u.get(e):void 0;if(t){let i="string"==typeof e&&c.get(e)||g.getTime(),s=Math.max(0,g.getTime()-i);t.result={timestamp:h,timestampFormatted:(0,o.formatTimestamp)(g),content:d(n),durationMs:s,durationFormatted:(0,a.formatDuration)(s)};continue}}s.push({type:"system",...(0,o.baseEntry)(p,h,g,t),raw:p});continue}s.push({type:"system",...(0,o.baseEntry)(p,h,g,t),raw:p})}return s.length>500&&await new Promise(e=>setImmediate(e)),s.sort((e,t)=>e.timestampMs-t.timestampMs),{entries:s,rawLines:r,cwd:n}}async function m(e){let t,i,s=c(e);if(!s)return null;try{t=await (0,n.readFile)(s,"utf-8")}catch{return null}try{i=await f(t,"session")}catch{return null}return{entries:i.entries,rawLines:i.rawLines,cwd:i.cwd,filePath:s}}(0,r.runtimeCache)(e=>m(e),60,{maxSize:50}),e.s(["findPiTranscript",0,c,"getPiSessionLog",0,m])},46501,e=>{"use strict";var t=e.i(10659),n=e.i(17694),i=e.i(24214),s=e.i(28067);let r=s.POSTHOG_API_KEY;async function o(){try{if(!(0,n.isTelemetryEnabled)()||globalThis.__FAILPROOFAI_POSTHOG__)return;let t=await e.A(78081),i=process.env.FAILPROOFAI_POSTHOG_KEY??r,s=process.env.FAILPROOFAI_POSTHOG_HOST??"https://us.i.posthog.com";globalThis.__FAILPROOFAI_POSTHOG__=new t.PostHog(i,{host:s,flushAt:1,flushInterval:1e4,requestTimeout:1e4,fetchRetryCount:3,fetchRetryDelay:3e3});let o=!1,a=()=>{o||(o=!0,globalThis.__FAILPROOFAI_POSTHOG__?.shutdown().catch(()=>{}))};process.on("beforeExit",a),process.on("SIGTERM",a),process.on("SIGINT",a)}catch(e){console.warn("[failproofai:telemetry] init failed:",e instanceof Error?e.message:e)}}e.s(["initTelemetry",0,o,"trackEvent",0,function(e,r){if(!(0,n.isTelemetryEnabled)())return;let o=globalThis.__FAILPROOFAI_POSTHOG__;o&&o.capture({distinctId:(0,t.getInstanceId)(),event:e,properties:{...r,$lib:"failproofai",failproofai_version:i.version,product:s.POSTHOG_PRODUCT}})}])},29095,e=>{"use strict";var t=e.i(2157),n=e.i(79857);function i(e,t){return!(e&&function(e){if(!Number.isInteger(e)||e<=0)return!1;try{return process.kill(e,0),!0}catch(e){return"EPERM"===e.code}}(e.pid))||t-e.startedAt>36e5}function s(e,n){let i=!1,s=()=>{if(i)return;i=!0,process.removeListener("exit",s);let o=r(e);if(!o||o.pid===n.pid)try{(0,t.unlinkSync)(e)}catch{}};return process.once("exit",s),{info:n,release:s}}function r(e){try{let n=JSON.parse((0,t.readFileSync)(e,"utf8"));if("number"!=typeof n?.pid||"number"!=typeof n?.startedAt)return null;return{pid:n.pid,startedAt:n.startedAt,source:n.source??"cli"}}catch{return null}}function o(e,n){let i=JSON.stringify(n),s=`${e}.${process.pid}.tmp`;try{(0,t.writeFileSync)(s,i,{mode:384})}catch{return!1}try{return(0,t.linkSync)(s,e),!0}catch(s){let n;if("EEXIST"===s.code)return!1;var r=e,o=i;try{return n=(0,t.openSync)(r,"wx",384),(0,t.writeSync)(n,o),!0}catch{return!1}finally{if(void 0!==n)try{(0,t.closeSync)(n)}catch{}}}finally{try{(0,t.unlinkSync)(s)}catch{}}}e.s(["acquireAuditLock",0,function(e,a=Date.now()){let l=(0,n.auditLockFile)(),u={pid:process.pid,startedAt:a,source:e};try{(0,t.mkdirSync)((0,n.failproofaiHome)(),{recursive:!0}),(0,t.mkdirSync)((0,n.runDir)(),{recursive:!0,mode:448})}catch{return{ok:!1,heldBy:null}}if(o(l,u))return{ok:!0,lock:s(l,u)};let c=r(l);if(!i(c,a))return{ok:!1,heldBy:c};try{(0,t.unlinkSync)(l)}catch{}return o(l,u)?{ok:!0,lock:s(l,u)}:{ok:!1,heldBy:r(l)}},"readActiveAuditLock",0,function(e=Date.now()){let t=r((0,n.auditLockFile)());return i(t,e)?null:t}])},47756,e=>{"use strict";var t=e.i(2157),n=e.i(94930),i=e.i(79857);function s(){return(0,i.auditDashboardFile)()}e.s(["readDashboardCache",0,function(){let e=s();if(!(0,t.existsSync)(e))return null;try{let n=(0,t.readFileSync)(e,"utf-8"),i=JSON.parse(n);if(!i||"object"!=typeof i||"string"!=typeof i.cachedAt||!i.params||"object"!=typeof i.params||!i.result||"object"!=typeof i.result||2!==i.schemaVersion||function(e,t=30){let n=new Date(e).getTime();return!!Number.isNaN(n)||Date.now()-n>6e4*t}(i.cachedAt,10080))return null;return i}catch{return null}},"writeDashboardCache",0,function(e,t){try{let i={schemaVersion:2,cachedAt:new Date().toISOString(),params:e,result:t};return(0,n.writeJsonAtomically)(s(),i),!0}catch{return!1}}])}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__0t9oqnn._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[20855,e=>{"use strict";var t=e.i(89171),a=e.i(17707);async function r(){let e=(0,a.readAuth)();return e?t.NextResponse.json({authenticated:!0,user:{id:e.user.id,email:e.user.email}},{status:200}):t.NextResponse.json({authenticated:!1},{status:200})}e.s(["GET",0,r,"dynamic",0,"force-dynamic"])},96889,e=>{"use strict";var t=e.i(47909),a=e.i(74017),r=e.i(96250),n=e.i(59756),s=e.i(61916),i=e.i(74677),o=e.i(69741),l=e.i(16795),u=e.i(87718),d=e.i(95169),c=e.i(47587),p=e.i(66012),h=e.i(70101),R=e.i(26937),v=e.i(10372),m=e.i(93695);e.i(52474);var g=e.i(220);let f=new t.AppRouteRouteModule({definition:{kind:a.RouteKind.APP_ROUTE,page:"/api/auth/status/route",pathname:"/api/auth/status",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/auth/status/route.ts",nextConfigOutput:"standalone",userland:()=>e.r(20855),...{}}),{workAsyncStorage:E,workUnitAsyncStorage:C,serverHooks:w}=f;async function x(e,t,r){r.requestMeta&&(0,n.setRequestMeta)(e,r.requestMeta),f.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let E="/api/auth/status/route";E=E.replace(/\/index$/,"")||"/";let C=await f.prepare(e,t,{srcPage:E,multiZoneDraftMode:!1});if(!C)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:w,deploymentId:x,params:_,nextConfig:A,parsedUrl:y,isDraftMode:T,prerenderManifest:P,routerServerContext:N,isOnDemandRevalidate:S,revalidateOnlyGenerated:b,resolvedPathname:O,clientReferenceManifest:q,serverActionsManifest:H}=C,I=(0,o.normalizeAppPath)(E),M=!!(P.dynamicRoutes[I]||P.routes[O]),k=async()=>((null==N?void 0:N.render404)?await N.render404(e,t,y,!1):t.end("This page could not be found"),null);if(M&&!T){let e=!!P.routes[O],t=P.dynamicRoutes[I];if(t&&!1===t.fallback&&!e){if(A.adapterPath)return await k();throw new m.NoFallbackError}}let U=null;!M||f.isDev||T||(U="/index"===(U=O)?"/":U);let D=!0===f.isDev||!M,j=M&&!D;H&&q&&(0,i.setManifestsSingleton)({page:E,clientReferenceManifest:q,serverActionsManifest:H});let F=e.method||"GET",K=(0,s.getTracer)(),L=K.getActiveScopeSpan(),$=!!(null==N?void 0:N.isWrappedByNextServer),B=!!(0,n.getRequestMeta)(e,"minimalMode"),G=(0,n.getRequestMeta)(e,"incrementalCache")||await f.getIncrementalCache(e,A,P,B);null==G||G.resetRequestCache(),globalThis.__incrementalCache=G;let V={params:_,previewProps:P.preview,renderOpts:{experimental:{authInterrupts:!!A.experimental.authInterrupts,useCacheTimeout:A.experimental.useCacheTimeout},cacheComponents:!!A.cacheComponents,validationLevel:A.experimental.instantInsights.validationLevel,supportsDynamicResponse:D,incrementalCache:G,hmrRefreshHash:(0,n.getRequestMeta)(e,"hmrRefreshHash"),cacheLifeProfiles:A.cacheLife,staticPageGenerationTimeout:A.staticPageGenerationTimeout,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,a,r,n)=>f.onRequestError(e,t,r,n,N)},sharedContext:{buildId:w,deploymentId:x}},X=new l.NodeNextRequest(e),W=new l.NodeNextResponse(t),z=u.NextRequestAdapter.fromNodeNextRequest(X,(0,u.signalFromNodeResponse)(t)),Z=async({previousCacheEntry:a})=>{try{if(!B&&S&&b&&!a)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await f.handle(z,V);e.fetchMetrics=V.renderOpts.fetchMetrics;let s=V.renderOpts.pendingWaitUntil;s&&r.waitUntil&&(r.waitUntil(s),s=void 0);let i=V.renderOpts.collectedTags;if(!M)return await (0,p.sendResponse)(X,W,n,s),null;{let e=await n.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(n.headers);i&&(t[v.NEXT_CACHE_TAGS_HEADER]=i),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let a=void 0!==V.renderOpts.collectedRevalidate&&!(V.renderOpts.collectedRevalidate>=v.INFINITE_CACHE)&&V.renderOpts.collectedRevalidate,r=void 0===V.renderOpts.collectedExpire||V.renderOpts.collectedExpire>=v.INFINITE_CACHE?!1!==a&&a>0?A.expireTime:void 0:V.renderOpts.collectedExpire;return{value:{kind:g.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:a,expire:r}}}}catch(t){throw(null==a?void 0:a.isStale)&&await f.onRequestError(e,t,{routerKind:"App Router",routePath:E,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:j,isOnDemandRevalidate:S})},!1,N),t}},J=async(n,i)=>{try{var o,l;let n=await f.handleResponse({req:e,nextConfig:A,cacheKey:U,routeKind:a.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:P,isRoutePPREnabled:!1,isOnDemandRevalidate:S,revalidateOnlyGenerated:b,responseGenerator:Z,waitUntil:r.waitUntil,isMinimalMode:B});if(!M)return;if((null==n||null==(o=n.value)?void 0:o.kind)!==g.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==n||null==(l=n.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});B||t.setHeader("x-nextjs-cache",S?"REVALIDATED":n.isMiss?"MISS":n.isStale?"STALE":"HIT"),T&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let s=(0,h.fromNodeOutgoingHttpHeaders)(n.value.headers);B&&M||s.delete(v.NEXT_CACHE_TAGS_HEADER),!n.cacheControl||t.getHeader("Cache-Control")||s.get("Cache-Control")||s.set("Cache-Control",(0,R.getCacheControlHeader)(n.cacheControl)),await (0,p.sendResponse)(X,W,new Response(n.value.body,{headers:s,status:n.value.status||200}));return}catch(t){if(t instanceof m.NoFallbackError||await f.onRequestError(e,t,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:j,isOnDemandRevalidate:S})},!1,N),M)throw t;await (0,p.sendResponse)(X,W,new Response(null,{status:500}));return}finally{(()=>{if(!n)return;let e=t.statusCode;n.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(n.setStatus({code:s.SpanStatusCode.ERROR}),n.setAttribute("error.type",e.toString()));let a=K.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==d.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let r=a.get("next.route")||I,o=`${F} ${r}`;n.setAttributes({"next.route":r,"http.route":r,"next.span_name":o}),n.updateName(o),i&&i!==n&&(i.setAttribute("http.route",r),i.updateName(o))})()}};if($&&L)await J(L,void 0);else{let t=K.getActiveScopeSpan();await K.withPropagatedContext(e.headers,()=>K.trace(d.BaseServerSpan.handleRequest,{spanName:`${F} ${E}`,kind:s.SpanKind.SERVER,attributes:{"http.method":F,"http.target":e.url}},e=>J(e,t)),void 0,!$)}}e.s(["handler",0,x,"patchFetch",0,function(){return(0,r.patchFetch)({workAsyncStorage:E,workUnitAsyncStorage:C})},"routeModule",0,f,"serverHooks",0,w,"workAsyncStorage",0,E,"workUnitAsyncStorage",0,C])},78081,e=>{e.v(t=>Promise.all(["server/chunks/[externals]__0qxhecv._.js","server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_01r25oi._.js"].map(t=>e.l(t))).then(()=>t(39702)))}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_0bs-v8p._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[17694,e=>{"use strict";var t=e.i(2157);e.i(50227);var i=e.i(79857);let r={mode:"oss",daemon:{configured:!1},collector:{sessions:!1,hooks:!0,hooksVerbosity:"decisions",redact:"minimal",environment:"local"},telemetry:{enabled:!0},audit:{auto:!1,intervalDays:7}};e.s(["isTelemetryEnabled",0,function(){if("1"===process.env.FAILPROOFAI_TELEMETRY_DISABLED)return!1;try{return function(){try{var e;let r,n,a,s,o;return e=JSON.parse((0,t.readFileSync)((0,i.configFile)(),"utf8")),r=e.mode?.kind,n=e.daemon??{},a=e.collector??{},s=e.telemetry??{},o=e.audit??{},{mode:"cloud"===r?"cloud":"oss",daemon:{configured:!0===n.configured},collector:{sessions:!0===a.sessions,hooks:!1!==a.hooks,hooksVerbosity:"all"===a.hooks_verbosity||"off"===a.hooks_verbosity?a.hooks_verbosity:"decisions",redact:"off"===a.redact?"off":"minimal",environment:"string"==typeof a.environment?a.environment:"local",machineId:"string"==typeof a.machine_id?a.machine_id:void 0,sources:function(e){if(!e||"object"!=typeof e||Array.isArray(e))return;let t={};for(let[i,r]of Object.entries(e)){if(!r||"object"!=typeof r||Array.isArray(r))continue;let e=r.extra_paths;if(!Array.isArray(e))continue;let n=e.filter(e=>"string"==typeof e&&""!==e.trim());n.length>0&&(t[i]={extraPaths:n})}return Object.keys(t).length>0?t:void 0}(a.sources)},telemetry:{enabled:!1!==s.enabled},audit:{auto:!0===o.auto,intervalDays:function(e){if("number"!=typeof e||!Number.isFinite(e))return 7;let t=Math.floor(e);return t<1?7:Math.min(t,90)}(o.interval_days),reportsConsentedAt:"number"==typeof o.reports_consented_at&&Number.isFinite(o.reports_consented_at)?o.reports_consented_at:void 0}}}catch{return structuredClone(r)}}().telemetry.enabled}catch{return!0}}],17694)},10659,e=>{"use strict";let t;var i=e.i(2157),r=e.i(50227),n=e.i(60526),a=e.i(66680);e.i(74533);var s=e.i(79857);let o=r.default.join(n.default.homedir(),".failproofai"),l=r.default.join(o,"instance-id");function c(e){return a.default.createHmac("sha256","failproofai-telemetry-v1").update(e).digest("hex")}function d(e){let t;try{if(t=(0,s.telemetryIdFile)(),i.default.readFileSync(t,"utf-8").trim()===e)return}catch{try{t=(0,s.telemetryIdFile)()}catch{return}}try{i.default.mkdirSync(r.default.dirname(t),{recursive:!0});let n=`${t}.${process.pid}.tmp`;i.default.writeFileSync(n,e,{encoding:"utf-8",mode:384}),i.default.renameSync(n,t)}catch{}}e.s(["getInstanceId",0,function(){if(t)return t;let e=function(){try{for(let e of(n.default.platform(),["/etc/machine-id","/var/lib/dbus/machine-id"]))try{let t=i.default.readFileSync(e,"utf-8").trim();if(t)return t}catch{}}catch{}}();if(e)return d(t=c(e)),t;let r=[n.default.hostname(),n.default.homedir(),n.default.platform(),n.default.arch(),n.default.cpus()[0]?.model??""].join(":");return r?d(t=c(r)):d(t=function(){try{let e=i.default.readFileSync(l,"utf-8").trim();if(e)return e}catch{}let e=a.default.randomUUID();try{i.default.mkdirSync(o,{recursive:!0}),i.default.writeFileSync(l,e,"utf-8")}catch{}return e}()),t}])},24214,(e,t,i)=>{t.exports={name:"failproofai",version:"1.0.2-beta.2",description:"Observability and enforcement for AI agent harnesses. 39 built-in policies hooked into 12 of them — Claude Code, Codex, Cursor, Hermes, OpenClaw and more — blocking the tool call before it runs. Local dashboard included, no account needed.",bin:{failproofai:"./dist/cli.mjs",failproofaid:"./bin/failproofaid-shim.mjs"},files:["bin/","src/","scripts/","lib/","pi-extension/","openclaw-plugin/",".next/standalone/","dist/","README.md"],engines:{node:">=20.9.0",bun:">=1.3.0"},scripts:{predev:"bun run build:cli && bun link",dev:"FAILPROOFAI_TELEMETRY_DISABLED=1 bun scripts/dev.ts --port 8020","build:cli":"bun build --target=node --format=esm --outfile=dist/cli.mjs bin/failproofai.mjs --external posthog-node --external sql.js && node -e \"const fs=require('fs');const c=fs.readFileSync('dist/cli.mjs','utf8');fs.writeFileSync('dist/cli.mjs',c.replace('#!/usr/bin/env bun','#!/usr/bin/env node').replace('// @bun\\n',''))\"","build:worker":"bun build --target=node --format=esm --outfile=dist/worker.mjs bin/failproofai-worker.mjs --external posthog-node --external sql.js",build:"bun build --target=node --format=cjs --outfile=dist/index.js src/index.ts && bun run build:cli && bun run build:worker && bun --bun next build && node -e \"const {cpSync}=require('fs');cpSync('.next/static','.next/standalone/.next/static',{recursive:true});\" && node scripts/prune-standalone.mjs",prestart:"bun run build:cli && bun link",start:"FAILPROOFAI_TELEMETRY_DISABLED=1 bun scripts/start.ts",test:"vitest","test:run":"vitest run",lint:"eslint . --config eslint.config.mjs",prepare:"bun run build","test:e2e":"vitest run --config vitest.config.e2e.mts","test:e2e:watch":"vitest --config vitest.config.e2e.mts",translate:"bun scripts/translate-docs/cli.ts","translate:readme":"bun scripts/translate-docs/cli.ts --readme-only","translate:docs":"bun scripts/translate-docs/cli.ts --docs-only","translate:dry-run":"bun scripts/translate-docs/cli.ts --dry-run","translate:validate":"bun scripts/translate-docs/cli.ts --validate","validate:mdx":"bun scripts/validate-mdx.ts","docs:audit":"bun scripts/docs-audit.ts","build:pack":"bun scripts/build-policy-pack.mjs"},keywords:["agent-observability","llm-observability","agent-tracing","agent-monitoring","agent-harness","guardrails","enforcement","policies","evals","ai-agent","autonomous-agent","agent-reliability","failure-prevention","claude-code","codex","hermes","openclaw","cli","local-first","hooks"],author:"ExosphereHost Inc. <failproofai@exosphere.host>",license:"SEE LICENSE IN LICENSE",homepage:"https://github.com/FailproofAI/failproofai",repository:{type:"git",url:"https://github.com/FailproofAI/failproofai.git"},bugs:{url:"https://github.com/FailproofAI/failproofai/issues"},publishConfig:{access:"public"},devDependencies:{"@anthropic-ai/sdk":"^0.117.1","@mdx-js/mdx":"^3.1.1","@tailwindcss/postcss":"^4.3.1","@tanstack/react-virtual":"^3.14.9","@testing-library/jest-dom":"^7.0.0","@testing-library/react":"^16.3.2","@testing-library/user-event":"^14.6.1","@types/node":"26.2.0","@types/react":"19.2.18","@types/react-dom":"^19.2.3","@vitejs/plugin-react":"^6.0.5",clsx:"^2.1.1",eslint:"^10.5.0","eslint-config-next":"^16.2.9",jsdom:"^30.0.1","lucide-react":"^1.28.0",next:"^16.2.11",react:"^19.2.4","react-dom":"^19.2.4","tailwind-merge":"^3.4.0",tailwindcss:"^4.3.1",typescript:"6.0.3",vitest:"^4.1.9"},dependencies:{"html-to-image":"^1.11.13","posthog-node":"^5.47.7","sql.js":"^1.14.1",yaml:"^2.9.0"},overrides:{nanoid:"3.3.18",postcss:"8.5.26","eslint-plugin-react-hooks":"7.0.1",vite:"8.0.16",undici:"7.29.0","brace-expansion":"5.0.9",sharp:"0.35.0"},optionalDependencies:{"@failproofai/failproofaid-linux-x64":"1.0.2-beta.2","@failproofai/failproofaid-linux-arm64":"1.0.2-beta.2","@failproofai/failproofaid-darwin-x64":"1.0.2-beta.2","@failproofai/failproofaid-darwin-arm64":"1.0.2-beta.2"},failproofaidBinaries:{"linux-x64":"fcfa5ae234e66eb6b57ec28445900c5f5a231f5f3a1fb0aeaca281d81f74c81e","linux-arm64":"a2bb9894d311a86740170128a706a9503fecc15ac5cbbc4587243151175a671c","darwin-x64":"97c1054b6229824ff7a9cbee67f3c1e2608db9e0b38a0dfc1adb21bf772a9666","darwin-arm64":"eb60b5fd3c1727f0d5406961367e2ea9b6c7fbc0b975247e7db664d502863f13"}}},28067,e=>{"use strict";e.s(["POSTHOG_API_KEY",0,"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX","POSTHOG_PRODUCT",0,"failproofai-oss"])}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_0tovk6q._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[17694,e=>{"use strict";var t=e.i(2157);e.i(50227);var i=e.i(79857);let r={mode:"oss",daemon:{configured:!1},collector:{sessions:!1,hooks:!0,hooksVerbosity:"decisions",redact:"minimal",environment:"local"},telemetry:{enabled:!0},audit:{auto:!1,intervalDays:7}};e.s(["isTelemetryEnabled",0,function(){if("1"===process.env.FAILPROOFAI_TELEMETRY_DISABLED)return!1;try{return function(){try{var e;let r,n,a,s,o;return e=JSON.parse((0,t.readFileSync)((0,i.configFile)(),"utf8")),r=e.mode?.kind,n=e.daemon??{},a=e.collector??{},s=e.telemetry??{},o=e.audit??{},{mode:"cloud"===r?"cloud":"oss",daemon:{configured:!0===n.configured},collector:{sessions:!0===a.sessions,hooks:!1!==a.hooks,hooksVerbosity:"all"===a.hooks_verbosity||"off"===a.hooks_verbosity?a.hooks_verbosity:"decisions",redact:"off"===a.redact?"off":"minimal",environment:"string"==typeof a.environment?a.environment:"local",machineId:"string"==typeof a.machine_id?a.machine_id:void 0,sources:function(e){if(!e||"object"!=typeof e||Array.isArray(e))return;let t={};for(let[i,r]of Object.entries(e)){if(!r||"object"!=typeof r||Array.isArray(r))continue;let e=r.extra_paths;if(!Array.isArray(e))continue;let n=e.filter(e=>"string"==typeof e&&""!==e.trim());n.length>0&&(t[i]={extraPaths:n})}return Object.keys(t).length>0?t:void 0}(a.sources)},telemetry:{enabled:!1!==s.enabled},audit:{auto:!0===o.auto,intervalDays:function(e){if("number"!=typeof e||!Number.isFinite(e))return 7;let t=Math.floor(e);return t<1?7:Math.min(t,90)}(o.interval_days),reportsConsentedAt:"number"==typeof o.reports_consented_at&&Number.isFinite(o.reports_consented_at)?o.reports_consented_at:void 0}}}catch{return structuredClone(r)}}().telemetry.enabled}catch{return!0}}],17694)},10659,e=>{"use strict";let t;var i=e.i(2157),r=e.i(50227),n=e.i(60526),a=e.i(66680);e.i(74533);var s=e.i(79857);let o=r.default.join(n.default.homedir(),".failproofai"),l=r.default.join(o,"instance-id");function c(e){return a.default.createHmac("sha256","failproofai-telemetry-v1").update(e).digest("hex")}function d(e){let t;try{if(t=(0,s.telemetryIdFile)(),i.default.readFileSync(t,"utf-8").trim()===e)return}catch{try{t=(0,s.telemetryIdFile)()}catch{return}}try{i.default.mkdirSync(r.default.dirname(t),{recursive:!0});let n=`${t}.${process.pid}.tmp`;i.default.writeFileSync(n,e,{encoding:"utf-8",mode:384}),i.default.renameSync(n,t)}catch{}}e.s(["getInstanceId",0,function(){if(t)return t;let e=function(){try{for(let e of(n.default.platform(),["/etc/machine-id","/var/lib/dbus/machine-id"]))try{let t=i.default.readFileSync(e,"utf-8").trim();if(t)return t}catch{}}catch{}}();if(e)return d(t=c(e)),t;let r=[n.default.hostname(),n.default.homedir(),n.default.platform(),n.default.arch(),n.default.cpus()[0]?.model??""].join(":");return r?d(t=c(r)):d(t=function(){try{let e=i.default.readFileSync(l,"utf-8").trim();if(e)return e}catch{}let e=a.default.randomUUID();try{i.default.mkdirSync(o,{recursive:!0}),i.default.writeFileSync(l,e,"utf-8")}catch{}return e}()),t}])},24214,(e,t,i)=>{t.exports={name:"failproofai",version:"1.0.2-beta.2",description:"Observability and enforcement for AI agent harnesses. 39 built-in policies hooked into 12 of them — Claude Code, Codex, Cursor, Hermes, OpenClaw and more — blocking the tool call before it runs. Local dashboard included, no account needed.",bin:{failproofai:"./dist/cli.mjs",failproofaid:"./bin/failproofaid-shim.mjs"},files:["bin/","src/","scripts/","lib/","pi-extension/","openclaw-plugin/",".next/standalone/","dist/","README.md"],engines:{node:">=20.9.0",bun:">=1.3.0"},scripts:{predev:"bun run build:cli && bun link",dev:"FAILPROOFAI_TELEMETRY_DISABLED=1 bun scripts/dev.ts --port 8020","build:cli":"bun build --target=node --format=esm --outfile=dist/cli.mjs bin/failproofai.mjs --external posthog-node --external sql.js && node -e \"const fs=require('fs');const c=fs.readFileSync('dist/cli.mjs','utf8');fs.writeFileSync('dist/cli.mjs',c.replace('#!/usr/bin/env bun','#!/usr/bin/env node').replace('// @bun\\n',''))\"","build:worker":"bun build --target=node --format=esm --outfile=dist/worker.mjs bin/failproofai-worker.mjs --external posthog-node --external sql.js",build:"bun build --target=node --format=cjs --outfile=dist/index.js src/index.ts && bun run build:cli && bun run build:worker && bun --bun next build && node -e \"const {cpSync}=require('fs');cpSync('.next/static','.next/standalone/.next/static',{recursive:true});\" && node scripts/prune-standalone.mjs",prestart:"bun run build:cli && bun link",start:"FAILPROOFAI_TELEMETRY_DISABLED=1 bun scripts/start.ts",test:"vitest","test:run":"vitest run",lint:"eslint . --config eslint.config.mjs",prepare:"bun run build","test:e2e":"vitest run --config vitest.config.e2e.mts","test:e2e:watch":"vitest --config vitest.config.e2e.mts",translate:"bun scripts/translate-docs/cli.ts","translate:readme":"bun scripts/translate-docs/cli.ts --readme-only","translate:docs":"bun scripts/translate-docs/cli.ts --docs-only","translate:dry-run":"bun scripts/translate-docs/cli.ts --dry-run","translate:validate":"bun scripts/translate-docs/cli.ts --validate","validate:mdx":"bun scripts/validate-mdx.ts","docs:audit":"bun scripts/docs-audit.ts","build:pack":"bun scripts/build-policy-pack.mjs"},keywords:["agent-observability","llm-observability","agent-tracing","agent-monitoring","agent-harness","guardrails","enforcement","policies","evals","ai-agent","autonomous-agent","agent-reliability","failure-prevention","claude-code","codex","hermes","openclaw","cli","local-first","hooks"],author:"ExosphereHost Inc. <failproofai@exosphere.host>",license:"SEE LICENSE IN LICENSE",homepage:"https://github.com/FailproofAI/failproofai",repository:{type:"git",url:"https://github.com/FailproofAI/failproofai.git"},bugs:{url:"https://github.com/FailproofAI/failproofai/issues"},publishConfig:{access:"public"},devDependencies:{"@anthropic-ai/sdk":"^0.117.1","@mdx-js/mdx":"^3.1.1","@tailwindcss/postcss":"^4.3.1","@tanstack/react-virtual":"^3.14.9","@testing-library/jest-dom":"^7.0.0","@testing-library/react":"^16.3.2","@testing-library/user-event":"^14.6.1","@types/node":"26.2.0","@types/react":"19.2.18","@types/react-dom":"^19.2.3","@vitejs/plugin-react":"^6.0.5",clsx:"^2.1.1",eslint:"^10.5.0","eslint-config-next":"^16.2.9",jsdom:"^30.0.1","lucide-react":"^1.28.0",next:"^16.2.11",react:"^19.2.4","react-dom":"^19.2.4","tailwind-merge":"^3.4.0",tailwindcss:"^4.3.1",typescript:"6.0.3",vitest:"^4.1.9"},dependencies:{"html-to-image":"^1.11.13","posthog-node":"^5.47.7","sql.js":"^1.14.1",yaml:"^2.9.0"},overrides:{nanoid:"3.3.18",postcss:"8.5.26","eslint-plugin-react-hooks":"7.0.1",vite:"8.0.16",undici:"7.29.0","brace-expansion":"5.0.9",sharp:"0.35.0"},optionalDependencies:{"@failproofai/failproofaid-linux-x64":"1.0.2-beta.2","@failproofai/failproofaid-linux-arm64":"1.0.2-beta.2","@failproofai/failproofaid-darwin-x64":"1.0.2-beta.2","@failproofai/failproofaid-darwin-arm64":"1.0.2-beta.2"},failproofaidBinaries:{"linux-x64":"fcfa5ae234e66eb6b57ec28445900c5f5a231f5f3a1fb0aeaca281d81f74c81e","linux-arm64":"a2bb9894d311a86740170128a706a9503fecc15ac5cbbc4587243151175a671c","darwin-x64":"97c1054b6229824ff7a9cbee67f3c1e2608db9e0b38a0dfc1adb21bf772a9666","darwin-arm64":"eb60b5fd3c1727f0d5406961367e2ea9b6c7fbc0b975247e7db664d502863f13"}}},28067,e=>{"use strict";e.s(["POSTHOG_API_KEY",0,"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX","POSTHOG_PRODUCT",0,"failproofai-oss"])}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_0trp3yc._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[19851,e=>{"use strict";var t=e.i(89171),a=e.i(6375),r=e.i(17707),n=e.i(46501);async function o(){await (0,n.initTelemetry)();let e=(0,r.readAuth)();if(!e)return(0,n.trackEvent)("audit_user_logged_out",{source:"dashboard",had_session:!1,upstream:"noop"}),t.NextResponse.json({authenticated:!1},{status:200});let o="skipped",s=null;try{await (0,a.logoutSession)(e.access_token,e.refresh_token),o="revoked"}catch(e){e instanceof a.AuthApiError&&401===e.status?o="revoked":(o="failed",s=e instanceof Error?e.message.slice(0,200):String(e).slice(0,200))}return(0,r.deleteAuth)(),(0,n.trackEvent)("audit_user_logged_out",{source:"dashboard",had_session:!0,upstream:o,upstream_error:s,user_id:e.user.id}),t.NextResponse.json({authenticated:!1,upstream:o},{status:200})}e.s(["POST",0,o,"dynamic",0,"force-dynamic"])},43488,e=>{"use strict";var t=e.i(47909),a=e.i(74017),r=e.i(96250),n=e.i(59756),o=e.i(61916),s=e.i(74677),i=e.i(69741),l=e.i(16795),u=e.i(87718),d=e.i(95169),c=e.i(47587),p=e.i(66012),h=e.i(70101),R=e.i(26937),v=e.i(10372),g=e.i(93695);e.i(52474);var m=e.i(220);let f=new t.AppRouteRouteModule({definition:{kind:a.RouteKind.APP_ROUTE,page:"/api/auth/logout/route",pathname:"/api/auth/logout",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/auth/logout/route.ts",nextConfigOutput:"standalone",userland:()=>e.r(19851),...{}}),{workAsyncStorage:E,workUnitAsyncStorage:_,serverHooks:w}=f;async function C(e,t,r){r.requestMeta&&(0,n.setRequestMeta)(e,r.requestMeta),f.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let E="/api/auth/logout/route";E=E.replace(/\/index$/,"")||"/";let _=await f.prepare(e,t,{srcPage:E,multiZoneDraftMode:!1});if(!_)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:w,deploymentId:C,params:x,nextConfig:A,parsedUrl:y,isDraftMode:T,prerenderManifest:S,routerServerContext:P,isOnDemandRevalidate:b,revalidateOnlyGenerated:N,resolvedPathname:k,clientReferenceManifest:O,serverActionsManifest:q}=_,H=(0,i.normalizeAppPath)(E),I=!!(S.dynamicRoutes[H]||S.routes[k]),M=async()=>((null==P?void 0:P.render404)?await P.render404(e,t,y,!1):t.end("This page could not be found"),null);if(I&&!T){let e=!!S.routes[k],t=S.dynamicRoutes[H];if(t&&!1===t.fallback&&!e){if(A.adapterPath)return await M();throw new g.NoFallbackError}}let U=null;!I||f.isDev||T||(U="/index"===(U=k)?"/":U);let D=!0===f.isDev||!I,j=I&&!D;q&&O&&(0,s.setManifestsSingleton)({page:E,clientReferenceManifest:O,serverActionsManifest:q});let F=e.method||"GET",K=(0,o.getTracer)(),L=K.getActiveScopeSpan(),$=!!(null==P?void 0:P.isWrappedByNextServer),B=!!(0,n.getRequestMeta)(e,"minimalMode"),G=(0,n.getRequestMeta)(e,"incrementalCache")||await f.getIncrementalCache(e,A,S,B);null==G||G.resetRequestCache(),globalThis.__incrementalCache=G;let V={params:x,previewProps:S.preview,renderOpts:{experimental:{authInterrupts:!!A.experimental.authInterrupts,useCacheTimeout:A.experimental.useCacheTimeout},cacheComponents:!!A.cacheComponents,validationLevel:A.experimental.instantInsights.validationLevel,supportsDynamicResponse:D,incrementalCache:G,hmrRefreshHash:(0,n.getRequestMeta)(e,"hmrRefreshHash"),cacheLifeProfiles:A.cacheLife,staticPageGenerationTimeout:A.staticPageGenerationTimeout,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,a,r,n)=>f.onRequestError(e,t,r,n,P)},sharedContext:{buildId:w,deploymentId:C}},X=new l.NodeNextRequest(e),W=new l.NodeNextResponse(t),z=u.NextRequestAdapter.fromNodeNextRequest(X,(0,u.signalFromNodeResponse)(t)),Z=async({previousCacheEntry:a})=>{try{if(!B&&b&&N&&!a)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await f.handle(z,V);e.fetchMetrics=V.renderOpts.fetchMetrics;let o=V.renderOpts.pendingWaitUntil;o&&r.waitUntil&&(r.waitUntil(o),o=void 0);let s=V.renderOpts.collectedTags;if(!I)return await (0,p.sendResponse)(X,W,n,o),null;{let e=await n.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(n.headers);s&&(t[v.NEXT_CACHE_TAGS_HEADER]=s),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let a=void 0!==V.renderOpts.collectedRevalidate&&!(V.renderOpts.collectedRevalidate>=v.INFINITE_CACHE)&&V.renderOpts.collectedRevalidate,r=void 0===V.renderOpts.collectedExpire||V.renderOpts.collectedExpire>=v.INFINITE_CACHE?!1!==a&&a>0?A.expireTime:void 0:V.renderOpts.collectedExpire;return{value:{kind:m.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:a,expire:r}}}}catch(t){throw(null==a?void 0:a.isStale)&&await f.onRequestError(e,t,{routerKind:"App Router",routePath:E,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:j,isOnDemandRevalidate:b})},!1,P),t}},J=async(n,s)=>{try{var i,l;let n=await f.handleResponse({req:e,nextConfig:A,cacheKey:U,routeKind:a.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:S,isRoutePPREnabled:!1,isOnDemandRevalidate:b,revalidateOnlyGenerated:N,responseGenerator:Z,waitUntil:r.waitUntil,isMinimalMode:B});if(!I)return;if((null==n||null==(i=n.value)?void 0:i.kind)!==m.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==n||null==(l=n.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});B||t.setHeader("x-nextjs-cache",b?"REVALIDATED":n.isMiss?"MISS":n.isStale?"STALE":"HIT"),T&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let o=(0,h.fromNodeOutgoingHttpHeaders)(n.value.headers);B&&I||o.delete(v.NEXT_CACHE_TAGS_HEADER),!n.cacheControl||t.getHeader("Cache-Control")||o.get("Cache-Control")||o.set("Cache-Control",(0,R.getCacheControlHeader)(n.cacheControl)),await (0,p.sendResponse)(X,W,new Response(n.value.body,{headers:o,status:n.value.status||200}));return}catch(t){if(t instanceof g.NoFallbackError||await f.onRequestError(e,t,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:j,isOnDemandRevalidate:b})},!1,P),I)throw t;await (0,p.sendResponse)(X,W,new Response(null,{status:500}));return}finally{(()=>{if(!n)return;let e=t.statusCode;n.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(n.setStatus({code:o.SpanStatusCode.ERROR}),n.setAttribute("error.type",e.toString()));let a=K.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==d.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let r=a.get("next.route")||H,i=`${F} ${r}`;n.setAttributes({"next.route":r,"http.route":r,"next.span_name":i}),n.updateName(i),s&&s!==n&&(s.setAttribute("http.route",r),s.updateName(i))})()}};if($&&L)await J(L,void 0);else{let t=K.getActiveScopeSpan();await K.withPropagatedContext(e.headers,()=>K.trace(d.BaseServerSpan.handleRequest,{spanName:`${F} ${E}`,kind:o.SpanKind.SERVER,attributes:{"http.method":F,"http.target":e.url}},e=>J(e,t)),void 0,!$)}}e.s(["handler",0,C,"patchFetch",0,function(){return(0,r.patchFetch)({workAsyncStorage:E,workUnitAsyncStorage:_})},"routeModule",0,f,"serverHooks",0,w,"workAsyncStorage",0,E,"workUnitAsyncStorage",0,_])},78081,e=>{e.v(t=>Promise.all(["server/chunks/[externals]__0qxhecv._.js","server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_01r25oi._.js"].map(t=>e.l(t))).then(()=>t(39702)))}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_185gyk9._.js.map
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
module.exports=[90521,e=>{"use strict";var t=e.i(50227),o=e.i(54799),i=e.i(2157),r=e.i(12714),s=e.i(57764),n=e.i(66680),a=e.i(97348),l=e.i(93119),c=e.i(29476);e.i(73136);var u=e.i(49335),f=e.i(10659);e.i(79857);let d="__FAILPROOFAI_LOADING_HOOKS__",p=0,m=new Map;async function h(e){let t,o,i=Number.isFinite(o=Number(process.env.FAILPROOFAI_POLICY_LOAD_TIMEOUT_MS))&&o>0?o:1e4;try{await Promise.race([import(e),new Promise((e,o)=>{t=setTimeout(()=>o(Error(`timed out loading module after ${i}ms`)),i),t.unref?.()})])}finally{t&&clearTimeout(t)}}async function g(e,i){let r=globalThis;r[d]=!0;let n=[];try{let t=await (0,c.findDistIndex)(),r=t?(0,s.pathToFileURL)(t).href:null,a=++p,u=`${c.TMP_SUFFIX}.${process.pid}.${a}.${(0,o.randomUUID)()}.mjs`;n=await (0,c.rewriteFileTree)(e,r,t,u,i?.verifyEntrySha);let f=await y(n,u),d=m.get(e);if(d?.fingerprint===f){for(let e of d.hooks)l.customPolicies.add({...e});return null}let g=e+u,_=(0,s.pathToFileURL)(g).href,w=(0,l.getCustomHooks)().length;return await h(_),m.size>=500&&m.clear(),m.set(e,{fingerprint:f,hooks:(0,l.getCustomHooks)().slice(w).map(e=>({...e}))}),null}catch(s){let o=s instanceof Error?s.message:String(s),r=/Cannot find module|MODULE_NOT_FOUND|ENOENT/i.test(o)?"module_not_found":/SyntaxError|Unexpected token/i.test(o)?"syntax_error":/timed out loading module/i.test(o)?"load_timeout":"runtime_error";if((0,u.trackHookEvent)((0,f.getInstanceId)(),"custom_hooks_load_error",{error_type:r,is_convention:!!i?.conventionScope,convention_scope:i?.conventionScope??null,file_basename:(0,t.basename)(e)}),i?.strict)throw Error(`Failed to load custom hooks from ${e}: ${o}`);return(0,a.hookLogError)(`failed to load custom hooks from ${e}: ${o}`),{type:r,reason:o}}finally{r[d]=!1,await (0,c.cleanupTmpFiles)(n)}}async function y(e,t){let o=(0,n.createHash)("sha256");for(let i of[...e].sort()){o.update(i.replaceAll(t,c.TMP_SUFFIX));let e=await (0,r.readFile)(i,"utf8");o.update(e.replaceAll(t,c.TMP_SUFFIX))}return o.digest("hex")}async function _(e,o){if(!e)return[];let r=(0,t.isAbsolute)(e)?e:(0,t.resolve)(o?.sessionCwd??process.cwd(),e);if(!(0,i.existsSync)(r)){if(o?.strict)throw Error(`Custom hooks file not found: ${r}`);return(0,a.hookLogWarn)(`customPoliciesPath not found: ${r}`),[]}return(0,l.clearCustomHooks)(),await g(r,o),(0,l.getCustomHooks)()}e.s(["loadCustomHooks",0,_])},93119,29476,e=>{"use strict";let t="__failproofai_custom_hooks__";function o(){let e=globalThis;return Array.isArray(e[t])||(e[t]=[]),e[t]}e.s(["clearCustomHooks",0,function(){globalThis[t]=[]},"customPolicies",0,{add(e){o().push(e)}},"getCustomHooks",0,function(){return o()}],93119);var i=e.i(24868),r=e.i(46786),s=e.i(14747),n=e.i(92509),a=e.i(54799),l=e.i(79857),c=e.i(97348);let u=".__failproofai_tmp__.mjs",f=/(?:import\s+(?:[\s\S]*?\s+from\s+)?|export\s+(?:[\s\S]*?\s+from\s+))(['"])(\.\.?\/[^'"]+)\1/g,d=/require\s*\(\s*(['"])(\.\.?\/[^'"]+)\1\s*\)/g;async function p(e){try{return await (0,i.access)(e),!0}catch{return!1}}async function m(){let e=process.env.FAILPROOFAI_DIST_PATH;if(e){let t=(0,s.resolve)(e,"index.js");if(await p(t))return t}for(let e of[(0,s.resolve)((0,s.dirname)(process.execPath),"..","assets","dist","index.js"),(0,s.resolve)(process.cwd(),"dist","index.js"),(0,s.resolve)(process.cwd(),"node_modules","failproofai","dist","index.js")])if(await p(e))return e;return null}async function h(e,t){let o=(0,s.resolve)(e,t);for(let e of[o,`${o}.js`,`${o}.mjs`,`${o}.ts`,(0,s.resolve)(o,"index.js")])if(await p(e))return e;return null}async function g(e,t,o,r){let n=(0,s.join)(e,t);return await (0,i.writeFile)(n,o,{encoding:"utf-8",mode:384,...r?{flag:"wx"}:{}}),n}async function y(e,t,o=u){let s=`import _cjs from '${t}';
|
|
2
|
-
export const customPolicies = _cjs.customPolicies;
|
|
3
|
-
export const getCustomHooks = _cjs.getCustomHooks;
|
|
4
|
-
export const clearCustomHooks = _cjs.clearCustomHooks;
|
|
5
|
-
export const allow = _cjs.allow;
|
|
6
|
-
export const deny = _cjs.deny;
|
|
7
|
-
export const instruct = _cjs.instruct;
|
|
8
|
-
export default _cjs;`,a=`failproofai-dist${o}.shim.mjs`;try{let e=(0,l.shimsDir)();await (0,i.mkdir)(e,{recursive:!0,mode:448});let t=await (0,i.lstat)(e),o="function"==typeof process.getuid?process.getuid():null;if(!t.isDirectory()||t.isSymbolicLink()||null!==o&&t.uid!==o||63&t.mode)throw Error(`${e} is not a private directory owned by this user`);let r=await g(e,a,s,!1);return{shimPath:r,shimUrl:(0,n.pathToFileURL)(r).href}}catch(e){(0,c.hookLogWarn)(`policy shim directory unusable (${e instanceof Error?e.message:String(e)}); falling back to ${(0,r.tmpdir)()}`)}let f=await g((0,r.tmpdir)(),a,s,!0);return{shimPath:f,shimUrl:(0,n.pathToFileURL)(f).href}}async function _(e,t,o,r=u,n){let l=[e],c=new Set,p=[],m=null;if(o&&t){let e=await y(o,t,r);p.push(e.shimPath),m=e.shimUrl}for(;l.length>0;){let t,u=l.shift();if(c.has(u))continue;if(c.add(u),n&&u===e){let e=await (0,i.readFile)(u),o=(0,a.createHash)("sha256").update(e).digest("hex");if(o!==n)throw Error(`cloud-managed policy failed integrity re-verification at load: expected ${n}, got ${o}`);t=e.toString("utf-8")}else t=await (0,i.readFile)(u,"utf-8");m&&(t=t.replace(/from\s+(['"])(?:claudeye|failproofai)\1/g,`from '${m}'`)),o&&(t=t.replace(/require\s*\(\s*(['"])(?:claudeye|failproofai)\1\s*\)/g,`require('${o.replace(/\\/g,"\\\\")}')`));let g=(0,s.dirname)(u),y=new Map;for(let e of[f,d]){let o,i=new RegExp(e.source,e.flags);for(;null!==(o=i.exec(t));){let e=o[2];if(y.has(e))continue;let t=await h(g,e);if(!t)continue;c.has(t)||l.includes(t)||l.push(t);let i=(0,s.relative)(g,t+r).split("\\").join("/");i.startsWith(".")||(i="./"+i),y.set(e,i)}}for(let e of[...y.keys()].sort((e,t)=>t.length-e.length)){let o=y.get(e),i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=(t=t.replace(RegExp(`'${i}'`,"g"),`'${o}'`)).replace(RegExp(`"${i}"`,"g"),`"${o}"`)}let _=u+r;await (0,i.writeFile)(_,t,"utf-8"),p.push(_)}return p}async function w(e){for(let t of e)try{await (0,i.unlink)(t)}catch{}}e.s(["TMP_SUFFIX",0,u,"cleanupTmpFiles",0,w,"findDistIndex",0,m,"rewriteFileTree",0,_],29476)},97348,e=>{"use strict";var t=e.i(2157),o=e.i(50227),i=e.i(79857);let r={info:0,warn:1,error:2},s=(0,i.logsDir)(),n=!1,a="warn",l=!1,c=s;function u(e){return!function(){if(n)return;n=!0;let e=(process.env.FAILPROOFAI_LOG_LEVEL??"").toLowerCase();("info"===e||"warn"===e||"error"===e)&&(a=e);let t=(process.env.FAILPROOFAI_HOOK_LOG_FILE??"").trim();t&&(l=!0,"1"!==t&&"true"!==t&&(c=t))}(),r[e]>=r[a]}function f(e,t){process.stderr.write(`[failproofai:hook] ${e} ${t}
|
|
9
|
-
`)}function d(e,i){if(l)try{(0,t.existsSync)(c)||(0,t.mkdirSync)(c,{recursive:!0});let r=(0,o.join)(c,"hooks.log");try{if((0,t.statSync)(r).size>=524288){let e=`hooks-${Date.now()}.log`;(0,t.renameSync)(r,(0,o.join)(c,e))}}catch{}let s=new Date().toISOString(),n=`[${s}] ${e} ${i}
|
|
10
|
-
`;(0,t.appendFileSync)(r,n,"utf-8")}catch{}}e.s(["hookLogError",0,function(e){u("error")&&(f("ERROR",e),d("ERROR",e))},"hookLogInfo",0,function(e){u("info")&&(f("INFO",e),d("INFO",e))},"hookLogWarn",0,function(e){u("warn")&&(f("WARN",e),d("WARN",e))}])},73136,49335,e=>{"use strict";var t=e.i(2157),o=e.i(50227),i=e.i(60526),r=e.i(97348),s=e.i(79857);function n(e){if(!(0,t.existsSync)(e))return{};try{let o=(0,t.readFileSync)(e,"utf8");return JSON.parse(o)}catch(t){return(0,r.hookLogWarn)(`failed to parse config at ${e}: ${t instanceof Error?t.message:String(t)}`),{}}}e.s(["readMergedHooksConfig",0,function(e){let r=function(e){let r=(0,i.homedir)(),s=(0,o.resolve)(e);for(;s!==r;){let e=(0,o.resolve)(s,".failproofai");try{if((0,t.statSync)(e).isDirectory())return s}catch{}let i=(0,o.dirname)(s);if(i===s)break;s=i}return(0,o.resolve)(e)}(e??process.cwd()),a=(0,o.resolve)(r,".failproofai","policies-config.json"),l=(0,o.resolve)(r,".failproofai","policies-config.local.json"),c=(0,s.globalPolicyConfigFile)(),u=n(a),f=n(l),d=n(c),p=new Set([...u.enabledPolicies??[],...f.enabledPolicies??[],...d.enabledPolicies??[]]),m={};for(let e of[u,f,d])if(e.policyParams)for(let[t,o]of Object.entries(e.policyParams))t in m||(m[t]=o);let h=[u,f,d].map(e=>void 0!==e.customPoliciesPaths?e.customPoliciesPaths:void 0!==e.customPoliciesPath?[e.customPoliciesPath]:void 0).find(e=>void 0!==e),g=new Set([...u.disabledCustomPolicies??[],...f.disabledCustomPolicies??[],...d.disabledCustomPolicies??[]]),y=u.customPoliciesEnabled??f.customPoliciesEnabled??d.customPoliciesEnabled,_=u.llm??f.llm??d.llm;return{enabledPolicies:[...p],...Object.keys(m).length>0?{policyParams:m}:{},...void 0!==h?{customPoliciesPaths:h}:{},...g.size?{disabledCustomPolicies:[...g]}:{},...void 0!==y?{customPoliciesEnabled:y}:{},...void 0!==_?{llm:_}:{}}}],73136);var a=e.i(24214),l=e.i(28067),c=e.i(17694);let u=l.POSTHOG_API_KEY,f=new Set;async function d(e,t,o){let i=JSON.stringify({api_key:process.env.FAILPROOFAI_POSTHOG_KEY??u,event:t,distinct_id:e,properties:{...o,$lib:"failproofai-hooks",failproofai_version:a.version,product:l.POSTHOG_PRODUCT}});try{await fetch(process.env.FAILPROOFAI_POSTHOG_HOST?`${process.env.FAILPROOFAI_POSTHOG_HOST}/capture/`:"https://us.i.posthog.com/capture/",{method:"POST",headers:{"Content-Type":"application/json"},body:i,signal:AbortSignal.timeout(5e3)})}catch{}}async function p(e,t,o){if(!(0,c.isTelemetryEnabled)())return;let i=d(e,t,o);f.add(i),i.finally(()=>f.delete(i)),await i}e.s(["trackHookEvent",0,p],49335)}];
|
|
11
|
-
|
|
12
|
-
//# sourceMappingURL=src_hooks_0xbw3bu._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[18622,(a,b,c)=>{b.exports=a.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,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},24725,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},43285,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/dynamic-access-async-storage.external.js",()=>require("next/dist/server/app-render/dynamic-access-async-storage.external.js"))},56704,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(a,b,c)=>{b.exports=a.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,(a,b,c)=>{b.exports=a.x("next/dist/server/runtime-reacts.external.js",()=>require("next/dist/server/runtime-reacts.external.js"))},9107,a=>{"use strict";var b=a.i(5050);let c=(0,b.createServerReference)("0020a7a02a051c8b4bcc9c4978e3c26bcf6070650e",b.callServer,void 0,b.findSourceMapURL,"getTelemetryConfig");a.s(["getTelemetryConfig",0,c])},3171,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(9107),e=a.i(66036);a.s(["default",0,function({error:a,reset:f}){return(0,c.useEffect)(()=>{(0,d.getTelemetryConfig)().then(b=>{(0,e.setClientTelemetryConfig)(b),(0,e.captureClientEvent)("client_error",{error_message:a.message,error_name:a.name,error_digest:a.digest,boundary:"global"})}).catch(()=>{})},[a]),(0,b.jsx)("html",{children:(0,b.jsx)("body",{children:(0,b.jsx)("main",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",background:"#031035",color:"#f8fafc",fontFamily:"system-ui, sans-serif"},children:(0,b.jsxs)("div",{style:{textAlign:"center",padding:"2rem",border:"1px solid rgba(239,68,68,0.4)",borderRadius:"0.5rem",maxWidth:"500px"},children:[(0,b.jsx)("h2",{style:{color:"#ef4444",marginBottom:"0.5rem",fontSize:"1.25rem"},children:"Something went wrong"}),(0,b.jsx)("p",{style:{color:"#94a3b8",marginBottom:"1.5rem"},children:a.message||"An unexpected error occurred."}),(0,b.jsx)("button",{onClick:f,style:{padding:"0.5rem 1.25rem",background:"#3b82f6",color:"white",border:"none",borderRadius:"0.375rem",cursor:"pointer",fontSize:"0.875rem"},children:"Try again"})]})})})})}])},66036,a=>{"use strict";a.s(["captureClientEvent",0,function(a,b){},"setClientTelemetryConfig",0,function(a){}])},46058,(a,b,c)=>{"use strict";function d(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(d=function(a){return a?c:b})(a)}c._=function(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var c=d(b);if(c&&c.has(a))return c.get(a);var e={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a)if("default"!==g&&Object.prototype.hasOwnProperty.call(a,g)){var h=f?Object.getOwnPropertyDescriptor(a,g):null;h&&(h.get||h.set)?Object.defineProperty(e,g,h):e[g]=a[g]}return e.default=a,c&&c.set(a,e),e}},5050,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={callServer:function(){return f.callServer},createServerReference:function(){return h.createServerReference},findSourceMapURL:function(){return g.findSourceMapURL}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(20611),g=a.r(1722),h=a.r(38783)},20611,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"callServer",{enumerable:!0,get:function(){return g}});let d=a.r(72131),e=a.r(88347),f=a.r(90841);async function g(a,b){return new Promise((c,g)=>{(0,d.startTransition)(()=>{(0,f.dispatchAppRouterAction)({type:e.ACTION_SERVER_ACTION,actionId:a,actionArgs:b,resolve:c,reject:g})})})}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},1722,(a,b,c)=>{"use strict";let d;Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"findSourceMapURL",{enumerable:!0,get:function(){return d}});("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},88347,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d,e,f={ACTION_HMR_REFRESH:function(){return l},ACTION_NAVIGATE:function(){return i},ACTION_REFRESH:function(){return h},ACTION_RESTORE:function(){return j},ACTION_SERVER_ACTION:function(){return m},ACTION_SERVER_PATCH:function(){return k},PrefetchKind:function(){return n},ScrollBehavior:function(){return o}};for(var g in f)Object.defineProperty(c,g,{enumerable:!0,get:f[g]});let h="refresh",i="navigate",j="restore",k="server-patch",l="hmr-refresh",m="server-action";var n=((d={}).AUTO="auto",d.FULL="full",d),o=((e={})[e.Default=0]="Default",e[e.NoScroll=1]="NoScroll",e);("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},90841,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={dispatchAppRouterAction:function(){return i},dispatchGestureState:function(){return j},refreshOnInstantNavigationUnlock:function(){return h},useActionQueue:function(){return k}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(46058)._(a.r(72131)),g=a.r(67009);a.r(88347);function h(){}function i(a){!0;throw Object.defineProperty(Error("Internal Next.js error: Router action dispatched before initialization."),"__NEXT_ERROR_CODE",{value:"E668",enumerable:!1,configurable:!0})}function j(a){!0;throw Object.defineProperty(Error("Internal Next.js error: Router action dispatched before initialization."),"__NEXT_ERROR_CODE",{value:"E668",enumerable:!1,configurable:!0})}function k(a){let[b,c]=f.default.useState(a.state),[d,e]=(0,f.useOptimistic)(b),h=(0,f.useMemo)(()=>d,[d]);return(0,g.isThenable)(h)?(0,f.use)(h):h}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},42602,(a,b,c)=>{"use strict";b.exports=a.r(18622)},9270,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.AppRouterContext},36313,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.HooksClientContext},18341,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.ServerInsertedHtml},35112,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].ReactDOM},87924,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].ReactJsxRuntime},38783,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].ReactServerDOMTurbopackClient},72131,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].React},67009,(a,b,c)=>{"use strict";function d(a){return null!==a&&"object"==typeof a&&"then"in a&&"function"==typeof a.then}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"isThenable",{enumerable:!0,get:function(){return d}})}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__090sxxw._.js.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
module.exports=[54799,(a,b,c)=>{b.exports=a.x("crypto",()=>require("crypto"))},24868,(a,b,c)=>{b.exports=a.x("fs/promises",()=>require("fs/promises"))},60815,a=>{a.v(a=>Promise.resolve().then(()=>a(24868)))},12714,(a,b,c)=>{b.exports=a.x("node:fs/promises",()=>require("node:fs/promises"))},1457,(a,b,c)=>{b.exports=a.x("node:readline",()=>require("node:readline"))},57764,(a,b,c)=>{b.exports=a.x("node:url",()=>require("node:url"))},46786,(a,b,c)=>{b.exports=a.x("os",()=>require("os"))},92509,(a,b,c)=>{b.exports=a.x("url",()=>require("url"))},8674,a=>{"use strict";var b=a.i(2157),c=a.i(50227),d=a.i(66680);a.s(["writeJsonAtomically",0,function(a,e,f={}){let g=f.mode??384,h=f.dirMode??448,i=(0,c.dirname)(a);(0,b.existsSync)(i)||(0,b.mkdirSync)(i,{recursive:!0,mode:h});let j=`${a}.${process.pid}.${(0,d.randomBytes)(6).toString("hex")}.tmp`;try{(0,b.writeFileSync)(j,JSON.stringify(e,null,2),{mode:g});try{(63&(0,b.statSync)(j).mode)!=0&&(0,b.chmodSync)(j,g)}catch{}(0,b.renameSync)(j,a);try{(63&(0,b.statSync)(a).mode)!=0&&(0,b.chmodSync)(a,g)}catch{}}catch(a){try{(0,b.rmSync)(j,{force:!0})}catch{}throw a}}])},24282,a=>{"use strict";let b={claude:{id:"claude",label:"Claude Code",badgeClasses:"bg-orange-500/10 text-orange-400 border-orange-500/20"},codex:{id:"codex",label:"OpenAI Codex",badgeClasses:"bg-purple-500/10 text-purple-400 border-purple-500/20"},copilot:{id:"copilot",label:"GitHub Copilot",badgeClasses:"bg-blue-500/10 text-blue-400 border-blue-500/20"},cursor:{id:"cursor",label:"Cursor Agent",badgeClasses:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20"},opencode:{id:"opencode",label:"OpenCode",badgeClasses:"bg-amber-500/10 text-amber-400 border-amber-500/20"},pi:{id:"pi",label:"Pi",badgeClasses:"bg-pink-500/10 text-pink-400 border-pink-500/20"},hermes:{id:"hermes",label:"Hermes",badgeClasses:"bg-indigo-500/10 text-indigo-400 border-indigo-500/20"},openclaw:{id:"openclaw",label:"OpenClaw",badgeClasses:"bg-teal-500/10 text-teal-400 border-teal-500/20"},factory:{id:"factory",label:"Factory Droid",badgeClasses:"bg-rose-500/10 text-rose-400 border-rose-500/20"},devin:{id:"devin",label:"Devin CLI",badgeClasses:"bg-violet-500/10 text-violet-400 border-violet-500/20"},antigravity:{id:"antigravity",label:"Antigravity CLI",badgeClasses:"bg-cyan-500/10 text-cyan-400 border-cyan-500/20"},goose:{id:"goose",label:"Goose",badgeClasses:"bg-lime-500/10 text-lime-400 border-lime-500/20"}};a.s(["getCliBadgeClasses",0,function(a){return b[a]?.badgeClasses??b.claude.badgeClasses},"getCliLabel",0,function(a){return b[a]?.label??a}])},43600,a=>{"use strict";var b=a.i(2157),c=a.i(60526),d=a.i(50227);let e="profiles",f="default";function g(){let a=(process.env.HERMES_HOME||"").trim();if(a){let b=(0,d.resolve)(a),c=(0,d.dirname)(b);return(0,d.basename)(c)===e?(0,d.dirname)(c):b}return(0,d.join)((0,c.homedir)(),".hermes")}function h(){let a,c=g(),h=[{name:f,home:c}],i=new Set([f]);try{a=(0,b.readdirSync)((0,d.join)(c,e),{withFileTypes:!0}).filter(a=>(a.isDirectory()||a.isSymbolicLink())&&!a.name.startsWith(".")).map(a=>a.name).sort()}catch{return h}for(let b of a)i.has(b)||(i.add(b),h.push({name:b,home:(0,d.join)(c,e,b)}));return h}a.s(["HERMES_DEFAULT_PROFILE",0,f,"hermesProjectName",0,function(a,b){return`hermes-${a}-${b}`},"hermesProjectNameCandidates",0,function(a){if(!a.startsWith("hermes-"))return[];let b=a.slice(7);if(!b)return[];let c=[];for(let a of h().map(a=>a.name).sort((a,b)=>b.length-a.length)){let d=`${a}-`;b.startsWith(d)&&b.length>d.length&&c.push({profile:a,source:b.slice(d.length)})}return c.push({profile:f,source:b}),c},"hermesProjectPath",0,function(a,b){return`hermes:${a}:${b}`},"hermesRoot",0,g,"listHermesProfiles",0,h])},2726,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[externals]__0ilfh9m._.js","server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_11bnuzn._.js"].map(b=>a.l(b))).then(()=>b(74493)))},6188,a=>{a.v(a=>Promise.resolve().then(()=>a(15638)))},10695,a=>{"use strict";var b=a.i(2157),c=a.i(50227),d=a.i(75818);let e={info:0,warn:1,error:2},f=(0,d.logsDir)(),g=!1,h="warn",i=!1,j=f;function k(a){return!function(){if(g)return;g=!0;let a=(process.env.FAILPROOFAI_LOG_LEVEL??"").toLowerCase();("info"===a||"warn"===a||"error"===a)&&(h=a);let b=(process.env.FAILPROOFAI_HOOK_LOG_FILE??"").trim();b&&(i=!0,"1"!==b&&"true"!==b&&(j=b))}(),e[a]>=e[h]}function l(a,b){process.stderr.write(`[failproofai:hook] ${a} ${b}
|
|
2
|
-
`)}function m(a,d){if(i)try{(0,b.existsSync)(j)||(0,b.mkdirSync)(j,{recursive:!0});let e=(0,c.join)(j,"hooks.log");try{if((0,b.statSync)(e).size>=524288){let a=`hooks-${Date.now()}.log`;(0,b.renameSync)(e,(0,c.join)(j,a))}}catch{}let f=new Date().toISOString(),g=`[${f}] ${a} ${d}
|
|
3
|
-
`;(0,b.appendFileSync)(e,g,"utf-8")}catch{}}a.s(["hookLogError",0,function(a){k("error")&&(l("ERROR",a),m("ERROR",a))},"hookLogWarn",0,function(a){k("warn")&&(l("WARN",a),m("WARN",a))}])}];
|
|
4
|
-
|
|
5
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__192nhvh._.js.map
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
module.exports=[9107,a=>{"use strict";var b=a.i(5050);let c=(0,b.createServerReference)("0020a7a02a051c8b4bcc9c4978e3c26bcf6070650e",b.callServer,void 0,b.findSourceMapURL,"getTelemetryConfig");a.s(["getTelemetryConfig",0,c])},18952,a=>{"use strict";var b=a.i(87924),c=a.i(72131);let d=[],e=0,f=new Set;function g(){for(let a of f)a()}function h(a){return f.add(a),()=>f.delete(a)}function i(){return d}function j({message:a}){let[d,e]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{requestAnimationFrame(()=>e(!0));let a=setTimeout(()=>e(!1),2e3);return()=>clearTimeout(a)},[]),(0,b.jsx)("div",{className:`bg-card border border-border text-foreground text-sm px-4 py-2 rounded-lg shadow-lg transition-opacity duration-300 ${d?"opacity-100":"opacity-0"}`,children:a})}a.s(["Toaster",0,function(){let a=(0,c.useSyncExternalStore)(h,i,i);return(0,b.jsx)("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2",children:a.map(a=>(0,b.jsx)(j,{message:a.message},a.id))})},"toast",0,function(a){let b=e++;d=[...d,{id:b,message:a}],g(),setTimeout(()=>{d=d.filter(a=>a.id!==b),g()},2500)}])},10765,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(50944),e=a.i(9107),f=a.i(66036);let g=(0,c.createContext)(void 0);a.s(["PostHogProvider",0,function({children:a}){let h=(0,d.usePathname)(),i=(0,c.useRef)(null),j=(0,c.useRef)(!1);(0,c.useEffect)(()=>{let a=!1;return(0,e.getTelemetryConfig)().then(b=>{a||((0,f.setClientTelemetryConfig)(b),j.current=!0,(0,f.captureClientEvent)("$pageview"),i.current=window.location.pathname)}),()=>{a=!0}},[]),(0,c.useEffect)(()=>{j.current&&i.current!==h&&(i.current=h,(0,f.captureClientEvent)("$pageview"))},[h]);let k=c.default.useCallback((a,b)=>{(0,f.captureClientEvent)(a,b)},[]);return(0,b.jsx)(g.Provider,{value:{capture:k},children:a})},"usePostHog",0,function(){let a=(0,c.useContext)(g);if(void 0===a)throw Error("usePostHog must be used within a PostHogProvider");return a}])},66036,a=>{"use strict";a.s(["captureClientEvent",0,function(a,b){},"setClientTelemetryConfig",0,function(a){}])},46058,(a,b,c)=>{"use strict";function d(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(d=function(a){return a?c:b})(a)}c._=function(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var c=d(b);if(c&&c.has(a))return c.get(a);var e={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a)if("default"!==g&&Object.prototype.hasOwnProperty.call(a,g)){var h=f?Object.getOwnPropertyDescriptor(a,g):null;h&&(h.get||h.set)?Object.defineProperty(e,g,h):e[g]=a[g]}return e.default=a,c&&c.set(a,e),e}},5050,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={callServer:function(){return f.callServer},createServerReference:function(){return h.createServerReference},findSourceMapURL:function(){return g.findSourceMapURL}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(20611),g=a.r(1722),h=a.r(38783)},20611,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"callServer",{enumerable:!0,get:function(){return g}});let d=a.r(72131),e=a.r(88347),f=a.r(90841);async function g(a,b){return new Promise((c,g)=>{(0,d.startTransition)(()=>{(0,f.dispatchAppRouterAction)({type:e.ACTION_SERVER_ACTION,actionId:a,actionArgs:b,resolve:c,reject:g})})})}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},1722,(a,b,c)=>{"use strict";let d;Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"findSourceMapURL",{enumerable:!0,get:function(){return d}});("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},88347,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d,e,f={ACTION_HMR_REFRESH:function(){return l},ACTION_NAVIGATE:function(){return i},ACTION_REFRESH:function(){return h},ACTION_RESTORE:function(){return j},ACTION_SERVER_ACTION:function(){return m},ACTION_SERVER_PATCH:function(){return k},PrefetchKind:function(){return n},ScrollBehavior:function(){return o}};for(var g in f)Object.defineProperty(c,g,{enumerable:!0,get:f[g]});let h="refresh",i="navigate",j="restore",k="server-patch",l="hmr-refresh",m="server-action";var n=((d={}).AUTO="auto",d.FULL="full",d),o=((e={})[e.Default=0]="Default",e[e.NoScroll=1]="NoScroll",e);("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},90841,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={dispatchAppRouterAction:function(){return i},dispatchGestureState:function(){return j},refreshOnInstantNavigationUnlock:function(){return h},useActionQueue:function(){return k}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(46058)._(a.r(72131)),g=a.r(67009);a.r(88347);function h(){}function i(a){!0;throw Object.defineProperty(Error("Internal Next.js error: Router action dispatched before initialization."),"__NEXT_ERROR_CODE",{value:"E668",enumerable:!1,configurable:!0})}function j(a){!0;throw Object.defineProperty(Error("Internal Next.js error: Router action dispatched before initialization."),"__NEXT_ERROR_CODE",{value:"E668",enumerable:!1,configurable:!0})}function k(a){let[b,c]=f.default.useState(a.state),[d,e]=(0,f.useOptimistic)(b),h=(0,f.useMemo)(()=>d,[d]);return(0,g.isThenable)(h)?(0,f.use)(h):h}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},14827,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={createLinkPrefetchPartialError:function(){return g},createUnrenderedSegmentError:function(){return f}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});function f(a,b){let c=`Route "${a}": Could not validate that a segment in your UI has instant navigation.`;if(b.length>0){let a=1===b.length?"Dropped segment":"Dropped segments";c+=`
|
|
2
|
-
|
|
3
|
-
This segment was dropped from rendering. Issues that would prevent instant navigation will go undetected.
|
|
4
|
-
|
|
5
|
-
${a}:
|
|
6
|
-
${b.map(a=>` ${a}`).join("\n")}
|
|
7
|
-
|
|
8
|
-
Ways to fix this:
|
|
9
|
-
- [render] Render the dropped segment
|
|
10
|
-
- [ignore] Set \`export const instant = false\` to opt the dropped segment out of instant-navigation validation
|
|
11
|
-
|
|
12
|
-
Learn more: https://nextjs.org/docs/messages/instant-unrendered-segment`}return Object.defineProperty(Error(c),"__NEXT_ERROR_CODE",{value:"E1286",enumerable:!1,configurable:!0})}function g(a){return Object.defineProperty(Error(`Next.js encountered dynamic data during prefetching for "${a}".
|
|
13
|
-
|
|
14
|
-
This will lead to slower, more expensive prefetches.
|
|
15
|
-
|
|
16
|
-
Ways to fix this:
|
|
17
|
-
- [upgrade] Opt into Partial Prefetching by exporting \`const prefetch = 'partial'\` from the page or layout, or by setting \`partialPrefetching: true\` in next.config to opt the whole app in
|
|
18
|
-
- [disable] Remove \`prefetch={true}\` from the <Link> to use the default prefetch
|
|
19
|
-
- [ignore] Set \`export const instant = false\` to opt the route out of instant-navigation validation
|
|
20
|
-
|
|
21
|
-
Learn more: https://nextjs.org/docs/messages/instant-link-prefetch-partial`),"__NEXT_ERROR_CODE",{value:"E1435",enumerable:!1,configurable:!0})}},88644,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"InvariantError",{enumerable:!0,get:function(){return d}});class d extends Error{constructor(a,b){super(`Invariant: ${a.endsWith(".")?a:a+"."} This is a bug in Next.js.`,b),Object.defineProperty(this,"__NEXT_ERROR_CODE",{value:"E1179",enumerable:!1,configurable:!0}),this.name="InvariantError"}}},67009,(a,b,c)=>{"use strict";function d(a){return null!==a&&"object"==typeof a&&"then"in a&&"function"==typeof a.then}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"isThenable",{enumerable:!0,get:function(){return d}})},41997,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={BailoutToCSRError:function(){return g},isBailoutToCSRError:function(){return h}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f="BAILOUT_TO_CLIENT_SIDE_RENDERING";class g extends Error{constructor(a){super(`Bail out to client-side rendering: ${a}`),this.reason=a,this.digest=f}}function h(a){return"object"==typeof a&&null!==a&&"digest"in a&&a.digest===f}},54427,(a,b,c)=>{"use strict";function d(){let a,b,c=new Promise((c,d)=>{a=c,b=d});return{resolve:a,reject:b,promise:c}}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"createPromiseWithResolvers",{enumerable:!0,get:function(){return d}})},39118,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={DEFAULT_SEGMENT_KEY:function(){return l},NOT_FOUND_SEGMENT_KEY:function(){return m},PAGE_SEGMENT_KEY:function(){return k},addSearchParamsIfPageSegment:function(){return i},computeSelectedLayoutSegment:function(){return j},getSegmentValue:function(){return f},getSelectedLayoutSegmentPath:function(){return function a(b,c,d=!0,e=[]){let g;if(d)g=b[1][c];else{let a=b[1];g=a.children??Object.values(a)[0]}if(!g)return e;let h=f(g[0]);return!h||h.startsWith(k)?e:(e.push(h),a(g,c,!1,e))}},isGroupSegment:function(){return g},isParallelRouteSegment:function(){return h}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});function f(a){return Array.isArray(a)?a[1]:a}function g(a){return"("===a[0]&&a.endsWith(")")}function h(a){return a.startsWith("@")&&"@children"!==a}function i(a,b){if(a.includes(k)){let a=JSON.stringify(b);return"{}"!==a?k+"?"+a:k}return a}function j(a,b){if(!a||0===a.length)return null;let c="children"===b?a[0]:a[a.length-1];return c===l?null:c}let k="__PAGE__",l="__DEFAULT__",m="/_not-found"}];
|
|
22
|
-
|
|
23
|
-
//# sourceMappingURL=_0wb8osu._.js.map
|