promptarc 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -25
- package/dist/bin.js +886 -4
- package/dist/share-direct.js +360 -0
- package/dist/web/.next/BUILD_ID +1 -1
- package/dist/web/.next/app-build-manifest.json +318 -226
- package/dist/web/.next/app-path-routes-manifest.json +24 -13
- package/dist/web/.next/build-manifest.json +14 -14
- package/dist/web/.next/prerender-manifest.json +89 -1
- package/dist/web/.next/routes-manifest.json +36 -0
- package/dist/web/.next/server/app/_not-found/page.js +1 -1
- package/dist/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/api/admin/backfill-ai/route.js +8 -0
- package/dist/web/.next/server/app/api/admin/backfill-ai/route.js.nft.json +1 -0
- package/dist/web/.next/server/app/api/admin/backfill-ai/route_client-reference-manifest.js +1 -0
- package/dist/web/.next/server/app/api/admin/backfill-search/route.js +1 -1
- package/dist/web/.next/server/app/api/admin/backfill-search/route.js.nft.json +1 -1
- package/dist/web/.next/server/app/api/admin/backfill-search/route_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/api/ai/context/route.js +31 -0
- package/dist/web/.next/server/app/api/ai/context/route.js.nft.json +1 -0
- package/dist/web/.next/server/app/api/ai/context/route_client-reference-manifest.js +1 -0
- package/dist/web/.next/server/app/api/ai/pr-summary/route.js +28 -0
- package/dist/web/.next/server/app/api/ai/pr-summary/route.js.nft.json +1 -0
- package/dist/web/.next/server/app/api/ai/pr-summary/route_client-reference-manifest.js +1 -0
- package/dist/web/.next/server/app/api/ai/pr-summary-local/route.js +28 -0
- package/dist/web/.next/server/app/api/ai/pr-summary-local/route.js.nft.json +1 -0
- package/dist/web/.next/server/app/api/ai/pr-summary-local/route_client-reference-manifest.js +1 -0
- package/dist/web/.next/server/app/api/ai/process/route.js +8 -0
- package/dist/web/.next/server/app/api/ai/process/route.js.nft.json +1 -0
- package/dist/web/.next/server/app/api/ai/process/route_client-reference-manifest.js +1 -0
- package/dist/web/.next/server/app/api/cli/download/route.js +1 -1
- package/dist/web/.next/server/app/api/cli/download/route.js.nft.json +1 -1
- package/dist/web/.next/server/app/api/cli/download/route_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/api/cli/feedback/route_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/api/cli/init/route_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/api/cli/my-shares/route.js +1 -1
- package/dist/web/.next/server/app/api/cli/my-shares/route_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/api/cli/poll/route_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/api/cli/project-settings/route_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/api/cli/share-mutate/route_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/api/cli/sync-list/route_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/api/local/project-sessions/route.js +1 -1
- package/dist/web/.next/server/app/api/local/project-sessions/route.js.nft.json +1 -1
- package/dist/web/.next/server/app/api/local/project-sessions/route_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/api/local/watch/route.js +2 -2
- package/dist/web/.next/server/app/api/local/watch/route.js.nft.json +1 -1
- package/dist/web/.next/server/app/api/local/watch/route_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/api/search/route.js +1 -1
- package/dist/web/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/api/search-index/route.js +1 -1
- package/dist/web/.next/server/app/api/search-index/route.js.nft.json +1 -1
- package/dist/web/.next/server/app/api/search-index/route_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/api/share/download/[slug]/route.js +1 -1
- package/dist/web/.next/server/app/api/share/download/[slug]/route.js.nft.json +1 -1
- package/dist/web/.next/server/app/api/share/download/[slug]/route_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/api/share/route.js +1 -1
- package/dist/web/.next/server/app/api/share/route.js.nft.json +1 -1
- package/dist/web/.next/server/app/api/share/route_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/api/upload/route.js +2 -2
- package/dist/web/.next/server/app/api/upload/route.js.nft.json +1 -1
- package/dist/web/.next/server/app/api/upload/route_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/auth/callback/route_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/auth/signout/route_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/blog/ai-coding-agents-2026/page.js +2 -0
- package/dist/web/.next/server/app/blog/ai-coding-agents-2026/page.js.nft.json +1 -0
- package/dist/web/.next/server/app/blog/ai-coding-agents-2026/page_client-reference-manifest.js +1 -0
- package/dist/web/.next/server/app/blog/page.js +2 -0
- package/dist/web/.next/server/app/blog/page.js.nft.json +1 -0
- package/dist/web/.next/server/app/blog/page_client-reference-manifest.js +1 -0
- package/dist/web/.next/server/app/cli/login/page.js +1 -1
- package/dist/web/.next/server/app/cli/login/page_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/digest/page_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/feedback/page_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/my-projects/[projectKey]/page_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/my-projects/page_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/my-shares/page.js +1 -1
- package/dist/web/.next/server/app/my-shares/page_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/opengraph-image/route.js +1 -71
- package/dist/web/.next/server/app/opengraph-image/route.js.nft.json +1 -0
- package/dist/web/.next/server/app/opengraph-image/route_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/opengraph-image.body +0 -0
- package/dist/web/.next/server/app/opengraph-image.meta +1 -0
- package/dist/web/.next/server/app/page.js +2 -2
- package/dist/web/.next/server/app/page.js.nft.json +1 -1
- package/dist/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/privacy/page.js +2 -0
- package/dist/web/.next/server/app/privacy/page.js.nft.json +1 -0
- package/dist/web/.next/server/app/privacy/page_client-reference-manifest.js +1 -0
- package/dist/web/.next/server/app/projects/[id]/page.js +1 -1
- package/dist/web/.next/server/app/projects/[id]/page.js.nft.json +1 -1
- package/dist/web/.next/server/app/projects/[id]/page_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/r/[slug]/opengraph-image/route.js +1 -1
- package/dist/web/.next/server/app/r/[slug]/opengraph-image/route_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/r/[slug]/page.js +2 -2
- package/dist/web/.next/server/app/r/[slug]/page.js.nft.json +1 -1
- package/dist/web/.next/server/app/r/[slug]/page_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/robots.txt/route.js +16 -0
- package/dist/web/.next/server/app/robots.txt/route.js.nft.json +1 -0
- package/dist/web/.next/server/app/robots.txt/route_client-reference-manifest.js +1 -0
- package/dist/web/.next/server/app/robots.txt.body +9 -0
- package/dist/web/.next/server/app/robots.txt.meta +1 -0
- package/dist/web/.next/server/app/search/page_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/sessions/[projectId]/[sessionId]/page.js +1 -1
- package/dist/web/.next/server/app/sessions/[projectId]/[sessionId]/page.js.nft.json +1 -1
- package/dist/web/.next/server/app/sessions/[projectId]/[sessionId]/page_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/sign-in/page.js +1 -1
- package/dist/web/.next/server/app/sign-in/page_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/sitemap.xml/route.js +16 -0
- package/dist/web/.next/server/app/sitemap.xml/route.js.nft.json +1 -0
- package/dist/web/.next/server/app/sitemap.xml/route_client-reference-manifest.js +1 -0
- package/dist/web/.next/server/app/sitemap.xml.body +51 -0
- package/dist/web/.next/server/app/sitemap.xml.meta +1 -0
- package/dist/web/.next/server/app/terms/page.js +2 -0
- package/dist/web/.next/server/app/terms/page.js.nft.json +1 -0
- package/dist/web/.next/server/app/terms/page_client-reference-manifest.js +1 -0
- package/dist/web/.next/server/app-paths-manifest.json +24 -13
- package/dist/web/.next/server/chunks/1017.js +2 -0
- package/dist/web/.next/server/chunks/1134.js +8 -0
- package/dist/web/.next/server/chunks/1825.js +1 -1
- package/dist/web/.next/server/chunks/8334.js +1 -1
- package/dist/web/.next/server/functions-config-manifest.json +17 -2
- package/dist/web/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/.next/server/middleware-manifest.json +1 -43
- package/dist/web/.next/server/pages/500.html +1 -1
- package/dist/web/.next/server/server-reference-manifest.js +1 -1
- package/dist/web/.next/server/server-reference-manifest.json +1 -1
- package/dist/web/.next/static/LF69v3WA6LbEAkvRHNqfG/_buildManifest.js +1 -0
- package/dist/web/.next/static/chunks/1029-12dc6d00537d43fd.js +1 -0
- package/dist/web/.next/static/chunks/4695-b52fc3d81451c3c3.js +1 -0
- package/dist/web/.next/static/chunks/552926ff-c5d04ae0c2d9f826.js +1 -0
- package/dist/web/.next/static/chunks/7200-4560b15b9cad37b3.js +1 -0
- package/dist/web/.next/static/chunks/app/_not-found/page-0f1123e35eb8f046.js +1 -0
- package/dist/web/.next/static/chunks/app/api/admin/backfill-ai/route-0f1123e35eb8f046.js +1 -0
- package/dist/web/.next/static/chunks/app/api/admin/backfill-search/route-0f1123e35eb8f046.js +1 -0
- package/dist/web/.next/static/chunks/app/api/ai/context/route-0f1123e35eb8f046.js +1 -0
- package/dist/web/.next/static/chunks/app/api/ai/pr-summary/route-0f1123e35eb8f046.js +1 -0
- package/dist/web/.next/static/chunks/app/api/ai/pr-summary-local/route-0f1123e35eb8f046.js +1 -0
- package/dist/web/.next/static/chunks/app/api/ai/process/route-0f1123e35eb8f046.js +1 -0
- package/dist/web/.next/static/chunks/app/api/cli/download/route-0f1123e35eb8f046.js +1 -0
- package/dist/web/.next/static/chunks/app/api/cli/feedback/route-0f1123e35eb8f046.js +1 -0
- package/dist/web/.next/static/chunks/app/api/cli/init/route-0f1123e35eb8f046.js +1 -0
- package/dist/web/.next/static/chunks/app/api/cli/my-shares/route-0f1123e35eb8f046.js +1 -0
- package/dist/web/.next/static/chunks/app/api/cli/poll/route-0f1123e35eb8f046.js +1 -0
- package/dist/web/.next/static/chunks/app/api/cli/project-settings/route-0f1123e35eb8f046.js +1 -0
- package/dist/web/.next/static/chunks/app/api/cli/share-mutate/route-0f1123e35eb8f046.js +1 -0
- package/dist/web/.next/static/chunks/app/api/cli/sync-list/route-0f1123e35eb8f046.js +1 -0
- package/dist/web/.next/static/chunks/app/api/local/project-sessions/route-0f1123e35eb8f046.js +1 -0
- package/dist/web/.next/static/chunks/app/api/local/watch/route-0f1123e35eb8f046.js +1 -0
- package/dist/web/.next/static/chunks/app/api/search/route-0f1123e35eb8f046.js +1 -0
- package/dist/web/.next/static/chunks/app/api/search-index/route-0f1123e35eb8f046.js +1 -0
- package/dist/web/.next/static/chunks/app/api/share/download/[slug]/route-0f1123e35eb8f046.js +1 -0
- package/dist/web/.next/static/chunks/app/api/share/route-0f1123e35eb8f046.js +1 -0
- package/dist/web/.next/static/chunks/app/api/upload/route-0f1123e35eb8f046.js +1 -0
- package/dist/web/.next/static/chunks/app/auth/callback/route-0f1123e35eb8f046.js +1 -0
- package/dist/web/.next/static/chunks/app/auth/signout/route-0f1123e35eb8f046.js +1 -0
- package/dist/web/.next/static/chunks/app/blog/ai-coding-agents-2026/page-0f1123e35eb8f046.js +1 -0
- package/dist/web/.next/static/chunks/app/blog/layout-9b51270472318488.js +1 -0
- package/dist/web/.next/static/chunks/app/blog/page-8400ea4ac5a7eb44.js +1 -0
- package/dist/web/.next/static/chunks/app/cli/login/page-26287cfd64c0fb49.js +1 -0
- package/dist/web/.next/static/chunks/app/digest/page-8400ea4ac5a7eb44.js +1 -0
- package/dist/web/.next/static/chunks/app/feedback/page-55ef0005807f1cef.js +1 -0
- package/dist/web/.next/static/chunks/app/layout-aa56caf2bf5af86f.js +1 -0
- package/dist/web/.next/static/chunks/app/my-projects/[projectKey]/page-7c5f2badf689d2e8.js +1 -0
- package/dist/web/.next/static/chunks/app/my-projects/page-c0390151fd6332a0.js +1 -0
- package/dist/web/.next/static/chunks/app/my-shares/{page-697d61e07a7546b2.js → page-49c0112973401c14.js} +1 -1
- package/dist/web/.next/static/chunks/app/not-found-8400ea4ac5a7eb44.js +1 -0
- package/dist/web/.next/static/chunks/app/opengraph-image/route-0f1123e35eb8f046.js +1 -0
- package/dist/web/.next/static/chunks/app/page-95394e3c6370084f.js +1 -0
- package/dist/web/.next/static/chunks/app/privacy/page-9b51270472318488.js +1 -0
- package/dist/web/.next/static/chunks/app/projects/[id]/page-7dd46a825d03a7d9.js +1 -0
- package/dist/web/.next/static/chunks/app/r/[slug]/opengraph-image/route-0f1123e35eb8f046.js +1 -0
- package/dist/web/.next/static/chunks/app/r/[slug]/page-6a0983805e048ac3.js +1 -0
- package/dist/web/.next/static/chunks/app/robots.txt/route-0f1123e35eb8f046.js +1 -0
- package/dist/web/.next/static/chunks/app/search/page-c29f37dc2462b676.js +1 -0
- package/dist/web/.next/static/chunks/app/sessions/[projectId]/[sessionId]/page-87b4505dd32edb9d.js +1 -0
- package/dist/web/.next/static/chunks/app/sign-in/page-fea3971ff9237b72.js +1 -0
- package/dist/web/.next/static/chunks/app/sitemap.xml/route-0f1123e35eb8f046.js +1 -0
- package/dist/web/.next/static/chunks/app/terms/page-9b51270472318488.js +1 -0
- package/dist/web/.next/static/chunks/d99d8e6a-55da88efbe15e3e1.js +1 -0
- package/dist/web/.next/static/chunks/framework-c1efa271b5a96d9d.js +1 -0
- package/dist/web/.next/static/chunks/main-app-70de904c7caade50.js +1 -0
- package/dist/web/.next/static/chunks/main-d211cddc79aac1cb.js +1 -0
- package/dist/web/.next/static/chunks/pages/{_app-42b849402a54b9e6.js → _app-701b0752a0d4c3a9.js} +1 -1
- package/dist/web/.next/static/chunks/pages/_error-327385abc873a736.js +1 -0
- package/dist/web/.next/static/chunks/{webpack-3a8b65d12c8eb987.js → webpack-3a446128dfa39f85.js} +1 -1
- package/dist/web/.next/static/css/c76bb7513858c50c.css +3 -0
- package/dist/web/package.json +1 -0
- package/dist/web/public/apple-touch-icon.png +0 -0
- package/dist/web/public/favicon-16.png +0 -0
- package/dist/web/public/favicon-32.png +0 -0
- package/dist/web/public/icon-192.png +0 -0
- package/dist/web/public/icon-512.png +0 -0
- package/dist/web/public/logo.png +0 -0
- package/package.json +1 -1
- package/dist/web/.next/server/app/opengraph-image/route.js.map +0 -1
- package/dist/web/.next/server/chunks/6019.js +0 -2
- package/dist/web/.next/server/edge-chunks/asset_noto-sans-v27-latin-regular.5dda3fca77107598.ttf +0 -0
- package/dist/web/.next/server/edge-chunks/wasm_77d9faebf7af9e421806970ce10a58e9d83116d7.wasm +0 -0
- package/dist/web/.next/server/edge-chunks/wasm_ef4866ecae192fd87727067cf2c0c0cf9fb8b020.wasm +0 -0
- package/dist/web/.next/server/edge-runtime-webpack.js +0 -2
- package/dist/web/.next/server/interception-route-rewrite-manifest.js +0 -1
- package/dist/web/.next/static/ZxFskpyUoxefJOzSxSb6s/_buildManifest.js +0 -1
- package/dist/web/.next/static/chunks/200-619918ea0fdbd6ff.js +0 -1
- package/dist/web/.next/static/chunks/29-7904810aeffd75a0.js +0 -1
- package/dist/web/.next/static/chunks/552926ff-e8a371ec0133d0dc.js +0 -1
- package/dist/web/.next/static/chunks/695-00bca043953d4170.js +0 -1
- package/dist/web/.next/static/chunks/app/_not-found/page-bd7ebde8ab75cb95.js +0 -1
- package/dist/web/.next/static/chunks/app/api/admin/backfill-search/route-bd7ebde8ab75cb95.js +0 -1
- package/dist/web/.next/static/chunks/app/api/cli/download/route-bd7ebde8ab75cb95.js +0 -1
- package/dist/web/.next/static/chunks/app/api/cli/feedback/route-bd7ebde8ab75cb95.js +0 -1
- package/dist/web/.next/static/chunks/app/api/cli/init/route-bd7ebde8ab75cb95.js +0 -1
- package/dist/web/.next/static/chunks/app/api/cli/my-shares/route-bd7ebde8ab75cb95.js +0 -1
- package/dist/web/.next/static/chunks/app/api/cli/poll/route-bd7ebde8ab75cb95.js +0 -1
- package/dist/web/.next/static/chunks/app/api/cli/project-settings/route-bd7ebde8ab75cb95.js +0 -1
- package/dist/web/.next/static/chunks/app/api/cli/share-mutate/route-bd7ebde8ab75cb95.js +0 -1
- package/dist/web/.next/static/chunks/app/api/cli/sync-list/route-bd7ebde8ab75cb95.js +0 -1
- package/dist/web/.next/static/chunks/app/api/local/project-sessions/route-bd7ebde8ab75cb95.js +0 -1
- package/dist/web/.next/static/chunks/app/api/local/watch/route-bd7ebde8ab75cb95.js +0 -1
- package/dist/web/.next/static/chunks/app/api/search/route-bd7ebde8ab75cb95.js +0 -1
- package/dist/web/.next/static/chunks/app/api/search-index/route-bd7ebde8ab75cb95.js +0 -1
- package/dist/web/.next/static/chunks/app/api/share/download/[slug]/route-bd7ebde8ab75cb95.js +0 -1
- package/dist/web/.next/static/chunks/app/api/share/route-bd7ebde8ab75cb95.js +0 -1
- package/dist/web/.next/static/chunks/app/api/upload/route-bd7ebde8ab75cb95.js +0 -1
- package/dist/web/.next/static/chunks/app/auth/callback/route-bd7ebde8ab75cb95.js +0 -1
- package/dist/web/.next/static/chunks/app/auth/signout/route-bd7ebde8ab75cb95.js +0 -1
- package/dist/web/.next/static/chunks/app/cli/login/page-647fd605d0fe2472.js +0 -1
- package/dist/web/.next/static/chunks/app/digest/page-41ec674edc998616.js +0 -1
- package/dist/web/.next/static/chunks/app/feedback/page-60f4d489fd598c9c.js +0 -1
- package/dist/web/.next/static/chunks/app/layout-f5666b9135264807.js +0 -1
- package/dist/web/.next/static/chunks/app/my-projects/[projectKey]/page-3a816489e5e8534b.js +0 -1
- package/dist/web/.next/static/chunks/app/my-projects/page-c88eba56cb5d0b8d.js +0 -1
- package/dist/web/.next/static/chunks/app/not-found-41ec674edc998616.js +0 -1
- package/dist/web/.next/static/chunks/app/opengraph-image/route-bd7ebde8ab75cb95.js +0 -1
- package/dist/web/.next/static/chunks/app/page-e6e80157848514e3.js +0 -1
- package/dist/web/.next/static/chunks/app/projects/[id]/page-faec0dc5b09bd35f.js +0 -1
- package/dist/web/.next/static/chunks/app/r/[slug]/opengraph-image/route-bd7ebde8ab75cb95.js +0 -1
- package/dist/web/.next/static/chunks/app/r/[slug]/page-65707eb198f673a1.js +0 -1
- package/dist/web/.next/static/chunks/app/search/page-fc0b629efa815c64.js +0 -1
- package/dist/web/.next/static/chunks/app/sessions/[projectId]/[sessionId]/page-5e70eaa0a429d94a.js +0 -1
- package/dist/web/.next/static/chunks/app/sign-in/page-792d0d79889186cf.js +0 -1
- package/dist/web/.next/static/chunks/d99d8e6a-80443bd3c9d31f50.js +0 -1
- package/dist/web/.next/static/chunks/framework-39000e34f38d10f6.js +0 -1
- package/dist/web/.next/static/chunks/main-app-21e9441fa7ac15ef.js +0 -1
- package/dist/web/.next/static/chunks/main-f824d48fd7ff2e3b.js +0 -1
- package/dist/web/.next/static/chunks/pages/_error-412ff705bc5b0636.js +0 -1
- package/dist/web/.next/static/css/3c4744a7426424ee.css +0 -3
- /package/dist/web/.next/static/{ZxFskpyUoxefJOzSxSb6s → LF69v3WA6LbEAkvRHNqfG}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Direct share: build a SharedReplay artifact locally and POST it
|
|
3
|
+
* to the hosted /api/upload endpoint. No local dashboard needed.
|
|
4
|
+
*
|
|
5
|
+
* This is a self-contained implementation that reads a JSONL session
|
|
6
|
+
* file, builds a minimal SharedReplay, strips secrets, and uploads.
|
|
7
|
+
* It duplicates some logic from @promptarc/core intentionally — the
|
|
8
|
+
* CLI can't import from the core workspace package at runtime.
|
|
9
|
+
*/
|
|
10
|
+
import { readFileSync } from 'node:fs';
|
|
11
|
+
import { basename } from 'node:path';
|
|
12
|
+
// ─── Secret patterns for redaction ────────────────────────────────────────
|
|
13
|
+
const SECRET_PATTERNS = [
|
|
14
|
+
/\bsk-ant-[a-zA-Z0-9_-]{10,}/g,
|
|
15
|
+
/\bsk-(?:proj-)?[a-zA-Z0-9_-]{20,}/g,
|
|
16
|
+
/\bAKIA[0-9A-Z]{16}/g,
|
|
17
|
+
/\bghp_[A-Za-z0-9]{20,}/g,
|
|
18
|
+
/\bghs_[A-Za-z0-9]{20,}/g,
|
|
19
|
+
/\bgho_[A-Za-z0-9]{20,}/g,
|
|
20
|
+
/\bglpat-[A-Za-z0-9_-]{20,}/g,
|
|
21
|
+
/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}/g,
|
|
22
|
+
/\bsb_secret_[A-Za-z0-9_-]{10,}/g,
|
|
23
|
+
/\bxoxb-[0-9]{10,}-[A-Za-z0-9-]+/g,
|
|
24
|
+
/\bnpm_[A-Za-z0-9]{20,}/g,
|
|
25
|
+
];
|
|
26
|
+
const HOME_RE = new RegExp(process.env.HOME?.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') ?? '/dev/null', 'g');
|
|
27
|
+
function redactString(s) {
|
|
28
|
+
let secrets = 0;
|
|
29
|
+
let paths = 0;
|
|
30
|
+
let result = s;
|
|
31
|
+
for (const pat of SECRET_PATTERNS) {
|
|
32
|
+
result = result.replace(pat, () => { secrets++; return '[REDACTED]'; });
|
|
33
|
+
}
|
|
34
|
+
if (HOME_RE.test(result)) {
|
|
35
|
+
result = result.replace(HOME_RE, '~');
|
|
36
|
+
paths++;
|
|
37
|
+
}
|
|
38
|
+
return { text: result, secrets, paths };
|
|
39
|
+
}
|
|
40
|
+
// ─── JSONL → SharedReplay ─────────────────────────────────────────────────
|
|
41
|
+
export function buildReplayFromJsonl(filePath, projectName) {
|
|
42
|
+
const raw = readFileSync(filePath, 'utf8');
|
|
43
|
+
const lines = raw.split('\n').filter(Boolean);
|
|
44
|
+
const messages = [];
|
|
45
|
+
let msgIndex = 0;
|
|
46
|
+
let toolCallCount = 0;
|
|
47
|
+
let fileChangeCount = 0;
|
|
48
|
+
let userMessageCount = 0;
|
|
49
|
+
let firstTimestamp = '';
|
|
50
|
+
let lastTimestamp = '';
|
|
51
|
+
let title = '';
|
|
52
|
+
let totalSecrets = 0;
|
|
53
|
+
let totalPaths = 0;
|
|
54
|
+
for (const line of lines) {
|
|
55
|
+
let parsed;
|
|
56
|
+
try {
|
|
57
|
+
parsed = JSON.parse(line);
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
// Claude Code format.
|
|
63
|
+
if (parsed.type === 'user' || parsed.type === 'assistant') {
|
|
64
|
+
const role = parsed.type;
|
|
65
|
+
const ts = parsed.timestamp ?? new Date().toISOString();
|
|
66
|
+
if (!firstTimestamp)
|
|
67
|
+
firstTimestamp = ts;
|
|
68
|
+
lastTimestamp = ts;
|
|
69
|
+
const content = parseClaudeContent(parsed, role);
|
|
70
|
+
if (content.length === 0)
|
|
71
|
+
continue;
|
|
72
|
+
// Redact content.
|
|
73
|
+
const redacted = content.map((block) => redactBlock(block));
|
|
74
|
+
totalSecrets += redacted.reduce((n, r) => n + r.secrets, 0);
|
|
75
|
+
totalPaths += redacted.reduce((n, r) => n + r.paths, 0);
|
|
76
|
+
if (role === 'user') {
|
|
77
|
+
userMessageCount++;
|
|
78
|
+
if (!title) {
|
|
79
|
+
const textBlock = redacted.find((r) => r.block.type === 'text');
|
|
80
|
+
if (textBlock && textBlock.block.type === 'text') {
|
|
81
|
+
title = textBlock.block.text.slice(0, 200);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
for (const r of redacted) {
|
|
86
|
+
if (r.block.type === 'tool_use')
|
|
87
|
+
toolCallCount++;
|
|
88
|
+
if (r.block.type === 'tool_use' && ['Edit', 'Write', 'apply_patch', 'write_file'].includes(r.block.name)) {
|
|
89
|
+
fileChangeCount++;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
messages.push({
|
|
93
|
+
id: parsed.uuid ?? `msg-${msgIndex}`,
|
|
94
|
+
parentId: parsed.parentUuid ?? null,
|
|
95
|
+
role,
|
|
96
|
+
timestamp: ts,
|
|
97
|
+
content: redacted.map((r) => r.block),
|
|
98
|
+
...(parsed.type === 'assistant' && parsed.message?.model
|
|
99
|
+
? { model: parsed.message.model }
|
|
100
|
+
: {}),
|
|
101
|
+
isSidechain: parsed.isSidechain ?? false,
|
|
102
|
+
});
|
|
103
|
+
msgIndex++;
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
// Codex format.
|
|
107
|
+
if (parsed.type === 'response_item' || parsed.type === 'event_msg') {
|
|
108
|
+
const ts = parsed.timestamp ?? new Date().toISOString();
|
|
109
|
+
if (!firstTimestamp)
|
|
110
|
+
firstTimestamp = ts;
|
|
111
|
+
lastTimestamp = ts;
|
|
112
|
+
const payload = parsed.payload;
|
|
113
|
+
if (!payload)
|
|
114
|
+
continue;
|
|
115
|
+
if (payload.type === 'message' && (payload.role === 'user' || payload.role === 'assistant')) {
|
|
116
|
+
const role = payload.role;
|
|
117
|
+
const contentArr = payload.content;
|
|
118
|
+
if (!Array.isArray(contentArr))
|
|
119
|
+
continue;
|
|
120
|
+
const blocks = contentArr
|
|
121
|
+
.map((b) => parseCodexBlock(b))
|
|
122
|
+
.filter((b) => b !== null);
|
|
123
|
+
if (blocks.length === 0)
|
|
124
|
+
continue;
|
|
125
|
+
const redacted = blocks.map(redactBlock);
|
|
126
|
+
totalSecrets += redacted.reduce((n, r) => n + r.secrets, 0);
|
|
127
|
+
if (role === 'user')
|
|
128
|
+
userMessageCount++;
|
|
129
|
+
if (role === 'user' && !title) {
|
|
130
|
+
const tb = redacted.find((r) => r.block.type === 'text');
|
|
131
|
+
if (tb && tb.block.type === 'text')
|
|
132
|
+
title = tb.block.text.slice(0, 200);
|
|
133
|
+
}
|
|
134
|
+
messages.push({
|
|
135
|
+
id: `codex-${msgIndex}`,
|
|
136
|
+
parentId: null,
|
|
137
|
+
role,
|
|
138
|
+
timestamp: ts,
|
|
139
|
+
content: redacted.map((r) => r.block),
|
|
140
|
+
isSidechain: false,
|
|
141
|
+
});
|
|
142
|
+
msgIndex++;
|
|
143
|
+
}
|
|
144
|
+
else if (payload.type === 'function_call') {
|
|
145
|
+
toolCallCount++;
|
|
146
|
+
const block = {
|
|
147
|
+
type: 'tool_use',
|
|
148
|
+
id: payload.call_id ?? `call-${msgIndex}`,
|
|
149
|
+
name: payload.name ?? 'unknown',
|
|
150
|
+
input: safeParseJson(payload.arguments),
|
|
151
|
+
};
|
|
152
|
+
appendToLastAssistant(messages, block, ts, msgIndex++);
|
|
153
|
+
}
|
|
154
|
+
else if (payload.type === 'function_call_output') {
|
|
155
|
+
const output = payload.output ?? '';
|
|
156
|
+
const r = redactString(output);
|
|
157
|
+
totalSecrets += r.secrets;
|
|
158
|
+
const block = {
|
|
159
|
+
type: 'tool_result',
|
|
160
|
+
toolUseId: payload.call_id ?? '',
|
|
161
|
+
output: r.text.slice(0, 12000),
|
|
162
|
+
isError: false,
|
|
163
|
+
};
|
|
164
|
+
appendToLastAssistant(messages, block, ts, msgIndex++);
|
|
165
|
+
}
|
|
166
|
+
if (parsed.type === 'event_msg' && payload.type === 'user_message') {
|
|
167
|
+
const text = payload.message ?? '';
|
|
168
|
+
if (!text.trim())
|
|
169
|
+
continue;
|
|
170
|
+
const r = redactString(text);
|
|
171
|
+
totalSecrets += r.secrets;
|
|
172
|
+
if (!title)
|
|
173
|
+
title = r.text.slice(0, 200);
|
|
174
|
+
userMessageCount++;
|
|
175
|
+
messages.push({
|
|
176
|
+
id: `codex-user-${msgIndex}`,
|
|
177
|
+
parentId: null,
|
|
178
|
+
role: 'user',
|
|
179
|
+
timestamp: ts,
|
|
180
|
+
content: [{ type: 'text', text: r.text }],
|
|
181
|
+
isSidechain: false,
|
|
182
|
+
});
|
|
183
|
+
msgIndex++;
|
|
184
|
+
}
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
// Cursor format.
|
|
188
|
+
if (parsed.role === 'user' || parsed.role === 'assistant') {
|
|
189
|
+
const role = parsed.role;
|
|
190
|
+
const msg = parsed.message;
|
|
191
|
+
const contentArr = msg?.content;
|
|
192
|
+
if (!Array.isArray(contentArr))
|
|
193
|
+
continue;
|
|
194
|
+
const blocks = [];
|
|
195
|
+
for (const item of contentArr) {
|
|
196
|
+
const c = item;
|
|
197
|
+
if (c.type === 'text') {
|
|
198
|
+
let text = c.text ?? '';
|
|
199
|
+
text = text.replace(/<\/?user_query>/g, '').replace(/\[REDACTED\]/g, '').trim();
|
|
200
|
+
if (text) {
|
|
201
|
+
const r = redactString(text);
|
|
202
|
+
totalSecrets += r.secrets;
|
|
203
|
+
totalPaths += r.paths;
|
|
204
|
+
blocks.push({ type: 'text', text: r.text });
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
else if (c.type === 'tool_use') {
|
|
208
|
+
toolCallCount++;
|
|
209
|
+
blocks.push({
|
|
210
|
+
type: 'tool_use',
|
|
211
|
+
id: c.id ?? `cursor-tool-${msgIndex}`,
|
|
212
|
+
name: c.name ?? 'unknown',
|
|
213
|
+
input: c.input ?? {},
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
if (blocks.length === 0)
|
|
218
|
+
continue;
|
|
219
|
+
if (role === 'user') {
|
|
220
|
+
userMessageCount++;
|
|
221
|
+
if (!title) {
|
|
222
|
+
const tb = blocks.find((b) => b.type === 'text');
|
|
223
|
+
if (tb && tb.type === 'text')
|
|
224
|
+
title = tb.text.slice(0, 200);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
messages.push({
|
|
228
|
+
id: `cursor-${msgIndex}`,
|
|
229
|
+
parentId: null,
|
|
230
|
+
role,
|
|
231
|
+
timestamp: new Date().toISOString(),
|
|
232
|
+
content: blocks,
|
|
233
|
+
isSidechain: false,
|
|
234
|
+
});
|
|
235
|
+
msgIndex++;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
return {
|
|
239
|
+
formatVersion: 1,
|
|
240
|
+
createdAt: new Date().toISOString(),
|
|
241
|
+
meta: {
|
|
242
|
+
title: title || `Session from ${projectName}`,
|
|
243
|
+
projectName,
|
|
244
|
+
startedAt: firstTimestamp || new Date().toISOString(),
|
|
245
|
+
endedAt: lastTimestamp || null,
|
|
246
|
+
messageCount: messages.length,
|
|
247
|
+
userMessageCount,
|
|
248
|
+
toolCallCount,
|
|
249
|
+
fileChangeCount,
|
|
250
|
+
},
|
|
251
|
+
messages,
|
|
252
|
+
diffs: [],
|
|
253
|
+
tasks: [],
|
|
254
|
+
todos: [],
|
|
255
|
+
redactionStats: {
|
|
256
|
+
secretsRedacted: totalSecrets,
|
|
257
|
+
pathsRedacted: totalPaths,
|
|
258
|
+
imagesDropped: 0,
|
|
259
|
+
toolResultsTruncated: 0,
|
|
260
|
+
},
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
// ─── Helpers ──────────────────────────────────────────────────────────────
|
|
264
|
+
function parseClaudeContent(parsed, role) {
|
|
265
|
+
const msg = parsed.message;
|
|
266
|
+
if (typeof msg === 'string') {
|
|
267
|
+
return [{ type: 'text', text: msg }];
|
|
268
|
+
}
|
|
269
|
+
if (typeof msg === 'object' && msg) {
|
|
270
|
+
const content = msg.content;
|
|
271
|
+
if (typeof content === 'string') {
|
|
272
|
+
return [{ type: 'text', text: content }];
|
|
273
|
+
}
|
|
274
|
+
if (Array.isArray(content)) {
|
|
275
|
+
const blocks = [];
|
|
276
|
+
for (const item of content) {
|
|
277
|
+
const c = item;
|
|
278
|
+
if (c.type === 'text' && typeof c.text === 'string') {
|
|
279
|
+
blocks.push({ type: 'text', text: c.text });
|
|
280
|
+
}
|
|
281
|
+
else if (c.type === 'thinking' && typeof c.thinking === 'string') {
|
|
282
|
+
// Strip thinking blocks — same as buildSharedReplay.
|
|
283
|
+
}
|
|
284
|
+
else if (c.type === 'tool_use') {
|
|
285
|
+
blocks.push({
|
|
286
|
+
type: 'tool_use',
|
|
287
|
+
id: c.id ?? '',
|
|
288
|
+
name: c.name ?? '',
|
|
289
|
+
input: c.input ?? {},
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
else if (c.type === 'tool_result') {
|
|
293
|
+
const output = typeof c.content === 'string'
|
|
294
|
+
? c.content
|
|
295
|
+
: typeof c.output === 'string'
|
|
296
|
+
? c.output
|
|
297
|
+
: JSON.stringify(c.content ?? c.output ?? '');
|
|
298
|
+
blocks.push({
|
|
299
|
+
type: 'tool_result',
|
|
300
|
+
toolUseId: c.tool_use_id ?? c.toolUseId ?? '',
|
|
301
|
+
output: output.slice(0, 12000),
|
|
302
|
+
isError: Boolean(c.is_error ?? c.isError),
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
return blocks;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
return [];
|
|
310
|
+
}
|
|
311
|
+
function parseCodexBlock(c) {
|
|
312
|
+
if ((c.type === 'input_text' || c.type === 'text') && typeof c.text === 'string') {
|
|
313
|
+
return { type: 'text', text: c.text };
|
|
314
|
+
}
|
|
315
|
+
if (c.type === 'output_text' && typeof c.text === 'string') {
|
|
316
|
+
return { type: 'text', text: c.text };
|
|
317
|
+
}
|
|
318
|
+
return null;
|
|
319
|
+
}
|
|
320
|
+
function redactBlock(block) {
|
|
321
|
+
if (block.type === 'text') {
|
|
322
|
+
const r = redactString(block.text);
|
|
323
|
+
return { block: { type: 'text', text: r.text }, secrets: r.secrets, paths: r.paths };
|
|
324
|
+
}
|
|
325
|
+
if (block.type === 'tool_result') {
|
|
326
|
+
const r = redactString(block.output);
|
|
327
|
+
return {
|
|
328
|
+
block: { type: 'tool_result', toolUseId: block.toolUseId, output: r.text, isError: block.isError },
|
|
329
|
+
secrets: r.secrets,
|
|
330
|
+
paths: r.paths,
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
return { block, secrets: 0, paths: 0 };
|
|
334
|
+
}
|
|
335
|
+
function appendToLastAssistant(messages, block, ts, idx) {
|
|
336
|
+
for (let i = messages.length - 1; i >= 0; i--) {
|
|
337
|
+
if (messages[i].role === 'assistant') {
|
|
338
|
+
messages[i].content.push(block);
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
messages.push({
|
|
343
|
+
id: `auto-${idx}`,
|
|
344
|
+
parentId: null,
|
|
345
|
+
role: 'assistant',
|
|
346
|
+
timestamp: ts,
|
|
347
|
+
content: [block],
|
|
348
|
+
isSidechain: false,
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
function safeParseJson(s) {
|
|
352
|
+
if (!s)
|
|
353
|
+
return {};
|
|
354
|
+
try {
|
|
355
|
+
return JSON.parse(s);
|
|
356
|
+
}
|
|
357
|
+
catch {
|
|
358
|
+
return { raw: s };
|
|
359
|
+
}
|
|
360
|
+
}
|
package/dist/web/.next/BUILD_ID
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
LF69v3WA6LbEAkvRHNqfG
|