@shepai/cli 1.110.1 → 1.110.2-pr343.55002ac
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/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.d.ts +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.js +3 -2
- package/dist/src/presentation/web/components/common/merge-review/index.d.ts +1 -0
- package/dist/src/presentation/web/components/common/merge-review/index.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/merge-review/index.js +1 -0
- package/dist/src/presentation/web/components/common/merge-review/merge-diff-viewer.d.ts +7 -0
- package/dist/src/presentation/web/components/common/merge-review/merge-diff-viewer.d.ts.map +1 -0
- package/dist/src/presentation/web/components/common/merge-review/merge-diff-viewer.js +160 -0
- package/dist/src/presentation/web/components/common/merge-review/merge-diff-viewer.stories.d.ts +18 -0
- package/dist/src/presentation/web/components/common/merge-review/merge-diff-viewer.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/common/merge-review/merge-diff-viewer.stories.js +240 -0
- package/dist/src/presentation/web/components/common/merge-review/merge-review.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/merge-review/merge-review.js +2 -2
- package/dist/src/presentation/web/components/ui/code-block.d.ts +28 -0
- package/dist/src/presentation/web/components/ui/code-block.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/code-block.js +47 -0
- package/dist/src/presentation/web/components/ui/code-block.stories.d.ts +16 -0
- package/dist/src/presentation/web/components/ui/code-block.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/code-block.stories.js +89 -0
- package/dist/src/presentation/web/components/ui/file-tree.d.ts +22 -0
- package/dist/src/presentation/web/components/ui/file-tree.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/file-tree.js +61 -0
- package/dist/src/presentation/web/components/ui/file-tree.stories.d.ts +14 -0
- package/dist/src/presentation/web/components/ui/file-tree.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/file-tree.stories.js +116 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/build-manifest.json +2 -2
- package/web/.next/fallback-build-manifest.json +2 -2
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/required-server-files.js +3 -3
- package/web/.next/required-server-files.json +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +20 -20
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +18 -18
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +20 -20
- package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +18 -18
- package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +18 -18
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
- package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
- package/web/.next/server/app/settings/page/server-reference-manifest.json +5 -5
- package/web/.next/server/app/settings/page.js.nft.json +1 -1
- package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/skills/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/skills/page.js.nft.json +1 -1
- package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/tools/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/tools/page.js.nft.json +1 -1
- package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/version/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/version/page.js.nft.json +1 -1
- package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
- package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_d0119342._.js +1 -1
- package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_d0119342._.js.map +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_a1104008.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_a1104008.js.map +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_92642200.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_92642200.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__039967e3._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__039967e3._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__07a39ff2._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__11033878._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__11033878._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__24dd0927._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__2773312c._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__2773312c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__5d87af2e._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__89e8a5cc._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__cbd8062c._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__cbd8062c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__d52e4ffa._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__d52e4ffa._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__d91fdd51._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__d91fdd51._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__e70c5627._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__e70c5627._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f4e2e929._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f4e2e929._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__fdc75809._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__fdc75809._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_135edb9c._.js +1 -1
- package/web/.next/server/chunks/ssr/_135edb9c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_6d26a08f._.js +1 -1
- package/web/.next/server/chunks/ssr/_6d26a08f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_d4d44f39._.js → _72bc8b0e._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_d4d44f39._.js.map → _72bc8b0e._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_8dacd1e7._.js +1 -1
- package/web/.next/server/chunks/ssr/_8dacd1e7._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_f3c9f75e._.js → _ba7a3d30._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_f3c9f75e._.js.map → _ba7a3d30._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_cc77a143._.js +1 -1
- package/web/.next/server/chunks/ssr/_cc77a143._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_ccec5866._.js → _f728cbf8._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_ccec5866._.js.map → _f728cbf8._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_888633e1.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_888633e1.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_ce7cbc3c._.js +2 -2
- package/web/.next/server/chunks/ssr/src_presentation_web_ce7cbc3c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_ui_scroll-area_tsx_53ae5be7._.js +3 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_components_ui_scroll-area_tsx_53ae5be7._.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_e2604413._.js +2 -2
- package/web/.next/server/chunks/ssr/src_presentation_web_e2604413._.js.map +1 -1
- package/web/.next/server/pages/500.html +2 -2
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +31 -31
- package/web/.next/static/chunks/{0abe4c1aa4868d43.js → 05417418b2a9cee3.js} +1 -1
- package/web/.next/static/chunks/{fd69e290a23f42db.js → 101ecf26d6966833.js} +1 -1
- package/web/.next/static/chunks/{d2696b56eaa27811.js → 1337f3e3c08718c7.js} +1 -1
- package/web/.next/static/chunks/2ec28c90ceaf4a13.js +11 -0
- package/web/.next/static/chunks/302445eb4ccd97da.css +1 -0
- package/web/.next/static/chunks/31776630de2d206b.js +1 -0
- package/web/.next/static/chunks/{c5d0ea070fd28a5f.js → 3a91978763f307a4.js} +1 -1
- package/web/.next/static/chunks/4943e3f713ca59b9.js +1 -0
- package/web/.next/static/chunks/{ff30b8acb47c382f.js → 7a5a5fd6ca5f68b0.js} +1 -1
- package/web/.next/static/chunks/aa4d2f43278ff233.js +2 -0
- package/web/.next/static/chunks/c271f980766af122.js +1 -0
- package/web/.next/static/chunks/{1b53abdc3e0915fa.js → c2cf5f8de6e440f4.js} +1 -1
- package/web/.next/static/chunks/d721d84d863d8f7d.js +1 -0
- package/web/.next/static/chunks/db88d096c40852ed.js +1 -0
- package/web/.next/static/chunks/{d332c5a1d5b931b6.js → f9b654bc46c065d1.js} +2 -2
- package/web/package.json +3 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__845a9d2a._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__845a9d2a._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js.map +0 -1
- package/web/.next/static/chunks/07b853e29af1e5f2.js +0 -1
- package/web/.next/static/chunks/303a1217006489b9.js +0 -1
- package/web/.next/static/chunks/4e97c46640657f42.js +0 -11
- package/web/.next/static/chunks/5543614d36607aef.js +0 -1
- package/web/.next/static/chunks/5558a658fa82a01f.css +0 -1
- package/web/.next/static/chunks/d14c7aec739301f8.js +0 -2
- package/web/.next/static/chunks/d7fa87cf3302ec81.js +0 -1
- /package/web/.next/static/{OhzCWJVe_Ly9xvRRY6B0s → kP5AxZfxARVpUZmGJasAa}/_buildManifest.js +0 -0
- /package/web/.next/static/{OhzCWJVe_Ly9xvRRY6B0s → kP5AxZfxARVpUZmGJasAa}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{OhzCWJVe_Ly9xvRRY6B0s → kP5AxZfxARVpUZmGJasAa}/_ssgManifest.js +0 -0
package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export declare function readSpecFile(specDir: string, filename: string): string;
|
|
|
24
24
|
/**
|
|
25
25
|
* Build executor options with cwd. Each node gets a clean agent context.
|
|
26
26
|
*/
|
|
27
|
-
export declare function buildExecutorOptions(state: FeatureAgentState): AgentExecutionOptions;
|
|
27
|
+
export declare function buildExecutorOptions(state: FeatureAgentState, overrides?: Partial<Pick<AgentExecutionOptions, 'timeout'>>): AgentExecutionOptions;
|
|
28
28
|
/**
|
|
29
29
|
* Parse YAML with automatic sanitization of common AI-generated issues.
|
|
30
30
|
* First attempts normal parsing; on failure, sanitizes unquoted braces
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-helpers.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,+DAA+D,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAUrD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM;kBAG/B,MAAM,GAAG,IAAI;mBAIZ,MAAM,GAAG,IAAI;EAK/B;AAED,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE7D;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAMtE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"node-helpers.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,+DAA+D,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAUrD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM;kBAG/B,MAAM,GAAG,IAAI;mBAIZ,MAAM,GAAG,IAAI;EAK/B;AAED,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE7D;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAMtE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,iBAAiB,EACxB,SAAS,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,GAC1D,qBAAqB,CAQvB;AAeD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAQrD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,SAAS,GAAG,OAAO,CAQ3F;AAMD,MAAM,MAAM,aAAa,GAAG,eAAe,GAAG,mBAAmB,GAAG,eAAe,GAAG,SAAS,CAAC;AAMhG;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,aAAa,CAKjE;AAED,MAAM,WAAW,YAAY;IAC3B,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAChC,QAAQ,EAAE,cAAc,EACxB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,qBAAqB,EAC9B,SAAS,CAAC,EAAE,YAAY,GACvB,OAAO,CAAC,oBAAoB,CAAC,CA6B/B;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAW5D;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,UAAU,GAAG,IAAI,CAqB5F;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI;IAAE,QAAQ,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAOhG;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,UAAU,GAAG,IAAI,CAwB1F;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAa5F;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IACzC,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,6FAA6F;IAC7F,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,GAAG,MAAM,CAiCT;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAa3E;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,cAAc,EACxB,WAAW,EAAE,CAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,UAAU,KAAK,MAAM,GACjE,CAAC,KAAK,EAAE,iBAAiB,KAAK,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAoHnE"}
|
package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.js
CHANGED
|
@@ -44,12 +44,13 @@ export function readSpecFile(specDir, filename) {
|
|
|
44
44
|
/**
|
|
45
45
|
* Build executor options with cwd. Each node gets a clean agent context.
|
|
46
46
|
*/
|
|
47
|
-
export function buildExecutorOptions(state) {
|
|
47
|
+
export function buildExecutorOptions(state, overrides) {
|
|
48
48
|
return {
|
|
49
49
|
cwd: state.worktreePath || state.repositoryPath,
|
|
50
50
|
maxTurns: 5000,
|
|
51
|
-
timeout:
|
|
51
|
+
timeout: 600_000, // 10 minutes per agent call — prevents infinite hangs
|
|
52
52
|
...(state.model ? { model: state.model } : {}),
|
|
53
|
+
...overrides,
|
|
53
54
|
};
|
|
54
55
|
}
|
|
55
56
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { MergeReview } from './merge-review.js';
|
|
2
2
|
export { DiffView } from './diff-view.js';
|
|
3
|
+
export { MergeDiffViewer } from './merge-diff-viewer.js';
|
|
3
4
|
export type { MergeReviewProps, MergeReviewData, MergeReviewFileDiff } from './merge-review-config.js';
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/merge-review/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/merge-review/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { MergeReviewFileDiff } from './merge-review-config.js';
|
|
2
|
+
export interface MergeDiffViewerProps {
|
|
3
|
+
fileDiffs: MergeReviewFileDiff[];
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function MergeDiffViewer({ fileDiffs, className }: MergeDiffViewerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
//# sourceMappingURL=merge-diff-viewer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-diff-viewer.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/merge-review/merge-diff-viewer.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,mBAAmB,EAAuB,MAAM,uBAAuB,CAAC;AAEtF,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,mBAAmB,EAAE,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAmLD,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,oBAAoB,kDAoD7E"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState, useMemo, useCallback } from 'react';
|
|
4
|
+
import { FilePlus, FileMinus, FileEdit, FileText } from 'lucide-react';
|
|
5
|
+
import { cn } from '../../../lib/utils.js';
|
|
6
|
+
import { Tree } from '../../ui/file-tree.js';
|
|
7
|
+
import { CodeBlock } from '../../ui/code-block.js';
|
|
8
|
+
const STATUS_COLORS = {
|
|
9
|
+
added: 'text-green-600',
|
|
10
|
+
modified: 'text-amber-600',
|
|
11
|
+
deleted: 'text-red-600',
|
|
12
|
+
renamed: 'text-blue-600',
|
|
13
|
+
};
|
|
14
|
+
const STATUS_ICONS = {
|
|
15
|
+
added: FilePlus,
|
|
16
|
+
modified: FileEdit,
|
|
17
|
+
deleted: FileMinus,
|
|
18
|
+
renamed: FileEdit,
|
|
19
|
+
};
|
|
20
|
+
const EXTENSION_LANGUAGE_MAP = {
|
|
21
|
+
'.ts': 'typescript',
|
|
22
|
+
'.tsx': 'tsx',
|
|
23
|
+
'.js': 'javascript',
|
|
24
|
+
'.jsx': 'jsx',
|
|
25
|
+
'.json': 'json',
|
|
26
|
+
'.css': 'css',
|
|
27
|
+
'.scss': 'scss',
|
|
28
|
+
'.html': 'html',
|
|
29
|
+
'.md': 'markdown',
|
|
30
|
+
'.yaml': 'yaml',
|
|
31
|
+
'.yml': 'yaml',
|
|
32
|
+
'.py': 'python',
|
|
33
|
+
'.go': 'go',
|
|
34
|
+
'.rs': 'rust',
|
|
35
|
+
'.sh': 'bash',
|
|
36
|
+
'.bash': 'bash',
|
|
37
|
+
'.sql': 'sql',
|
|
38
|
+
'.xml': 'xml',
|
|
39
|
+
'.svg': 'xml',
|
|
40
|
+
'.graphql': 'graphql',
|
|
41
|
+
'.gql': 'graphql',
|
|
42
|
+
'.dockerfile': 'dockerfile',
|
|
43
|
+
'.toml': 'toml',
|
|
44
|
+
'.env': 'bash',
|
|
45
|
+
'.mjs': 'javascript',
|
|
46
|
+
'.cjs': 'javascript',
|
|
47
|
+
'.mts': 'typescript',
|
|
48
|
+
'.cts': 'typescript',
|
|
49
|
+
};
|
|
50
|
+
function detectLanguage(filePath) {
|
|
51
|
+
const ext = filePath.slice(filePath.lastIndexOf('.')).toLowerCase();
|
|
52
|
+
if (EXTENSION_LANGUAGE_MAP[ext])
|
|
53
|
+
return EXTENSION_LANGUAGE_MAP[ext];
|
|
54
|
+
const basename = filePath.split('/').pop()?.toLowerCase() ?? '';
|
|
55
|
+
if (basename === 'dockerfile')
|
|
56
|
+
return 'dockerfile';
|
|
57
|
+
if (basename === 'makefile')
|
|
58
|
+
return 'makefile';
|
|
59
|
+
return 'text';
|
|
60
|
+
}
|
|
61
|
+
function buildDiffCode(hunks) {
|
|
62
|
+
const lines = [];
|
|
63
|
+
const addedLines = [];
|
|
64
|
+
const removedLines = [];
|
|
65
|
+
let lineNum = 0;
|
|
66
|
+
for (const hunk of hunks) {
|
|
67
|
+
if (lineNum > 0) {
|
|
68
|
+
lineNum++;
|
|
69
|
+
lines.push(`── ${hunk.header} ──`);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
lineNum++;
|
|
73
|
+
lines.push(`── ${hunk.header} ──`);
|
|
74
|
+
}
|
|
75
|
+
for (const line of hunk.lines) {
|
|
76
|
+
lineNum++;
|
|
77
|
+
const prefix = line.type === 'added' ? '+ ' : line.type === 'removed' ? '- ' : ' ';
|
|
78
|
+
lines.push(`${prefix}${line.content}`);
|
|
79
|
+
if (line.type === 'added')
|
|
80
|
+
addedLines.push(lineNum);
|
|
81
|
+
if (line.type === 'removed')
|
|
82
|
+
removedLines.push(lineNum);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return { code: lines.join('\n'), addedLines, removedLines };
|
|
86
|
+
}
|
|
87
|
+
function buildTreeElements(fileDiffs) {
|
|
88
|
+
const root = new Map();
|
|
89
|
+
for (const file of fileDiffs) {
|
|
90
|
+
const parts = file.path.split('/');
|
|
91
|
+
const fileName = parts.pop();
|
|
92
|
+
let currentLevel = root;
|
|
93
|
+
let parentElement;
|
|
94
|
+
let pathSoFar = '';
|
|
95
|
+
for (const part of parts) {
|
|
96
|
+
pathSoFar = pathSoFar ? `${pathSoFar}/${part}` : part;
|
|
97
|
+
if (!currentLevel.has(pathSoFar)) {
|
|
98
|
+
const folder = {
|
|
99
|
+
id: pathSoFar,
|
|
100
|
+
name: part,
|
|
101
|
+
type: 'folder',
|
|
102
|
+
isSelectable: false,
|
|
103
|
+
children: [],
|
|
104
|
+
};
|
|
105
|
+
currentLevel.set(pathSoFar, folder);
|
|
106
|
+
if (parentElement) {
|
|
107
|
+
parentElement.children = parentElement.children ?? [];
|
|
108
|
+
parentElement.children.push(folder);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
parentElement = currentLevel.get(pathSoFar);
|
|
112
|
+
// Get/create next level map
|
|
113
|
+
parentElement.children ??= [];
|
|
114
|
+
const nextLevel = new Map();
|
|
115
|
+
for (const child of parentElement.children) {
|
|
116
|
+
nextLevel.set(child.id, child);
|
|
117
|
+
}
|
|
118
|
+
currentLevel = nextLevel;
|
|
119
|
+
}
|
|
120
|
+
const StatusIcon = STATUS_ICONS[file.status];
|
|
121
|
+
const fileElement = {
|
|
122
|
+
id: file.path,
|
|
123
|
+
name: fileName,
|
|
124
|
+
type: 'file',
|
|
125
|
+
isSelectable: true,
|
|
126
|
+
icon: _jsx(StatusIcon, { className: cn('h-3.5 w-3.5 shrink-0', STATUS_COLORS[file.status]) }),
|
|
127
|
+
badge: (_jsxs("span", { className: "flex items-center gap-1 text-[10px]", children: [file.additions > 0 ? _jsxs("span", { className: "text-green-600", children: ["+", file.additions] }) : null, file.deletions > 0 ? _jsxs("span", { className: "text-red-600", children: ["-", file.deletions] }) : null] })),
|
|
128
|
+
};
|
|
129
|
+
if (parentElement) {
|
|
130
|
+
parentElement.children = parentElement.children ?? [];
|
|
131
|
+
// Only add if not already present
|
|
132
|
+
if (!parentElement.children.find((c) => c.id === fileElement.id)) {
|
|
133
|
+
parentElement.children.push(fileElement);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
root.set(file.path, fileElement);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return Array.from(root.values());
|
|
141
|
+
}
|
|
142
|
+
function DiffCodeView({ file }) {
|
|
143
|
+
const { code, addedLines, removedLines } = useMemo(() => buildDiffCode(file.hunks), [file.hunks]);
|
|
144
|
+
const language = useMemo(() => detectLanguage(file.path), [file.path]);
|
|
145
|
+
if (file.hunks.length === 0) {
|
|
146
|
+
return (_jsx("div", { className: "text-muted-foreground flex h-full items-center justify-center text-xs", children: "No diff content available" }));
|
|
147
|
+
}
|
|
148
|
+
return (_jsx(CodeBlock, { language: language, filename: file.path, code: code, addedLines: addedLines, removedLines: removedLines, className: "h-full rounded-none" }));
|
|
149
|
+
}
|
|
150
|
+
export function MergeDiffViewer({ fileDiffs, className }) {
|
|
151
|
+
const [selectedFileId, setSelectedFileId] = useState(fileDiffs.length > 0 ? fileDiffs[0].path : undefined);
|
|
152
|
+
const treeElements = useMemo(() => buildTreeElements(fileDiffs), [fileDiffs]);
|
|
153
|
+
const selectedFile = useMemo(() => fileDiffs.find((f) => f.path === selectedFileId), [fileDiffs, selectedFileId]);
|
|
154
|
+
const handleSelectChange = useCallback((id) => {
|
|
155
|
+
setSelectedFileId(id);
|
|
156
|
+
}, []);
|
|
157
|
+
if (fileDiffs.length === 0)
|
|
158
|
+
return null;
|
|
159
|
+
return (_jsxs("div", { "data-testid": "merge-diff-viewer", className: cn('border-border flex overflow-hidden rounded-lg border', className), children: [_jsxs("div", { className: "border-border flex w-56 shrink-0 flex-col border-r", children: [_jsxs("div", { className: "border-border flex items-center gap-2 border-b px-3 py-2", children: [_jsx(FileText, { className: "text-muted-foreground h-3.5 w-3.5" }), _jsx("span", { className: "text-foreground text-xs font-semibold", children: "Files" }), _jsxs("span", { className: "text-muted-foreground text-[10px]", children: ["(", fileDiffs.length, ")"] })] }), _jsx(Tree, { elements: treeElements, initialSelectedId: selectedFileId, onSelectChange: handleSelectChange, indicator: false, className: "flex-1", "data-testid": "merge-diff-file-tree" })] }), _jsx("div", { className: "flex min-w-0 flex-1 flex-col", children: selectedFile ? (_jsx(DiffCodeView, { file: selectedFile })) : (_jsx("div", { className: "text-muted-foreground flex flex-1 items-center justify-center text-xs", children: "Select a file to view changes" })) })] }));
|
|
160
|
+
}
|
package/dist/src/presentation/web/components/common/merge-review/merge-diff-viewer.stories.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { MergeDiffViewer } from './merge-diff-viewer.js';
|
|
3
|
+
declare const meta: Meta<typeof MergeDiffViewer>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof MergeDiffViewer>;
|
|
6
|
+
/** Default — multiple files with various change types. */
|
|
7
|
+
export declare const Default: Story;
|
|
8
|
+
/** Single modified file with multiple hunks. */
|
|
9
|
+
export declare const SingleFile: Story;
|
|
10
|
+
/** Only new files added. */
|
|
11
|
+
export declare const OnlyAdditions: Story;
|
|
12
|
+
/** Only deleted files. */
|
|
13
|
+
export declare const OnlyDeletions: Story;
|
|
14
|
+
/** Renamed file with modifications. */
|
|
15
|
+
export declare const RenamedFile: Story;
|
|
16
|
+
/** Empty diff list — renders nothing. */
|
|
17
|
+
export declare const EmptyDiffs: Story;
|
|
18
|
+
//# sourceMappingURL=merge-diff-viewer.stories.d.ts.map
|
package/dist/src/presentation/web/components/common/merge-review/merge-diff-viewer.stories.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-diff-viewer.stories.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/merge-review/merge-diff-viewer.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAyLtD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,eAAe,CAwBtC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9C,0DAA0D;AAC1D,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC;AAEF,gDAAgD;AAChD,eAAO,MAAM,UAAU,EAAE,KAKxB,CAAC;AAEF,4BAA4B;AAC5B,eAAO,MAAM,aAAa,EAAE,KAK3B,CAAC;AAEF,0BAA0B;AAC1B,eAAO,MAAM,aAAa,EAAE,KAK3B,CAAC;AAEF,uCAAuC;AACvC,eAAO,MAAM,WAAW,EAAE,KAKzB,CAAC;AAEF,yCAAyC;AACzC,eAAO,MAAM,UAAU,EAAE,KAIxB,CAAC"}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { MergeDiffViewer } from './merge-diff-viewer.js';
|
|
3
|
+
const sampleFiles = [
|
|
4
|
+
{
|
|
5
|
+
path: 'src/components/auth/login-form.tsx',
|
|
6
|
+
additions: 45,
|
|
7
|
+
deletions: 12,
|
|
8
|
+
status: 'modified',
|
|
9
|
+
hunks: [
|
|
10
|
+
{
|
|
11
|
+
header: '@@ -1,8 +1,12 @@',
|
|
12
|
+
lines: [
|
|
13
|
+
{
|
|
14
|
+
type: 'context',
|
|
15
|
+
content: "import { useState } from 'react';",
|
|
16
|
+
oldNumber: 1,
|
|
17
|
+
newNumber: 1,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
type: 'context',
|
|
21
|
+
content: "import { Button } from '../../ui/button.js';",
|
|
22
|
+
oldNumber: 2,
|
|
23
|
+
newNumber: 2,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
type: 'added',
|
|
27
|
+
content: "import { Input } from '../../ui/input.js';",
|
|
28
|
+
newNumber: 3,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
type: 'added',
|
|
32
|
+
content: "import { Label } from '../../ui/label.js';",
|
|
33
|
+
newNumber: 4,
|
|
34
|
+
},
|
|
35
|
+
{ type: 'context', content: '', oldNumber: 3, newNumber: 5 },
|
|
36
|
+
{ type: 'removed', content: 'export function LoginForm() {', oldNumber: 4 },
|
|
37
|
+
{
|
|
38
|
+
type: 'added',
|
|
39
|
+
content: 'export function LoginForm({ onSubmit }: LoginFormProps) {',
|
|
40
|
+
newNumber: 6,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
type: 'context',
|
|
44
|
+
content: " const [email, setEmail] = useState('');",
|
|
45
|
+
oldNumber: 5,
|
|
46
|
+
newNumber: 7,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
type: 'context',
|
|
50
|
+
content: " const [password, setPassword] = useState('');",
|
|
51
|
+
oldNumber: 6,
|
|
52
|
+
newNumber: 8,
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
type: 'added',
|
|
56
|
+
content: ' const [isLoading, setIsLoading] = useState(false);',
|
|
57
|
+
newNumber: 9,
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
header: '@@ -15,6 +19,12 @@',
|
|
63
|
+
lines: [
|
|
64
|
+
{ type: 'context', content: ' return (', oldNumber: 15, newNumber: 19 },
|
|
65
|
+
{
|
|
66
|
+
type: 'context',
|
|
67
|
+
content: ' <form onSubmit={handleSubmit}>',
|
|
68
|
+
oldNumber: 16,
|
|
69
|
+
newNumber: 20,
|
|
70
|
+
},
|
|
71
|
+
{ type: 'added', content: ' <Label htmlFor="email">Email</Label>', newNumber: 21 },
|
|
72
|
+
{
|
|
73
|
+
type: 'added',
|
|
74
|
+
content: ' <Input id="email" value={email} onChange={e => setEmail(e.target.value)} />',
|
|
75
|
+
newNumber: 22,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
type: 'added',
|
|
79
|
+
content: ' <Label htmlFor="password">Password</Label>',
|
|
80
|
+
newNumber: 23,
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
type: 'added',
|
|
84
|
+
content: ' <Input id="password" type="password" value={password} onChange={e => setPassword(e.target.value)} />',
|
|
85
|
+
newNumber: 24,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
type: 'context',
|
|
89
|
+
content: ' <Button type="submit">Login</Button>',
|
|
90
|
+
oldNumber: 17,
|
|
91
|
+
newNumber: 25,
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
path: 'src/lib/auth.ts',
|
|
99
|
+
additions: 28,
|
|
100
|
+
deletions: 0,
|
|
101
|
+
status: 'added',
|
|
102
|
+
hunks: [
|
|
103
|
+
{
|
|
104
|
+
header: '@@ -0,0 +1,8 @@',
|
|
105
|
+
lines: [
|
|
106
|
+
{ type: 'added', content: "import { hash } from 'bcrypt';", newNumber: 1 },
|
|
107
|
+
{ type: 'added', content: '', newNumber: 2 },
|
|
108
|
+
{
|
|
109
|
+
type: 'added',
|
|
110
|
+
content: 'export async function hashPassword(password: string) {',
|
|
111
|
+
newNumber: 3,
|
|
112
|
+
},
|
|
113
|
+
{ type: 'added', content: ' return hash(password, 10);', newNumber: 4 },
|
|
114
|
+
{ type: 'added', content: '}', newNumber: 5 },
|
|
115
|
+
{ type: 'added', content: '', newNumber: 6 },
|
|
116
|
+
{
|
|
117
|
+
type: 'added',
|
|
118
|
+
content: 'export async function verifyPassword(password: string, hashed: string) {',
|
|
119
|
+
newNumber: 7,
|
|
120
|
+
},
|
|
121
|
+
{ type: 'added', content: ' return compare(password, hashed);', newNumber: 8 },
|
|
122
|
+
{ type: 'added', content: '}', newNumber: 9 },
|
|
123
|
+
],
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
path: 'src/utils/legacy-auth.ts',
|
|
129
|
+
additions: 0,
|
|
130
|
+
deletions: 35,
|
|
131
|
+
status: 'deleted',
|
|
132
|
+
hunks: [
|
|
133
|
+
{
|
|
134
|
+
header: '@@ -1,5 +0,0 @@',
|
|
135
|
+
lines: [
|
|
136
|
+
{ type: 'removed', content: '// Legacy auth utilities', oldNumber: 1 },
|
|
137
|
+
{ type: 'removed', content: 'export function oldLogin() {', oldNumber: 2 },
|
|
138
|
+
{ type: 'removed', content: " return fetch('/api/login');", oldNumber: 3 },
|
|
139
|
+
{ type: 'removed', content: '}', oldNumber: 4 },
|
|
140
|
+
],
|
|
141
|
+
},
|
|
142
|
+
],
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
path: 'src/services/user-service.ts',
|
|
146
|
+
oldPath: 'src/services/user.ts',
|
|
147
|
+
additions: 5,
|
|
148
|
+
deletions: 2,
|
|
149
|
+
status: 'renamed',
|
|
150
|
+
hunks: [
|
|
151
|
+
{
|
|
152
|
+
header: '@@ -1,4 +1,7 @@',
|
|
153
|
+
lines: [
|
|
154
|
+
{ type: 'removed', content: "import { db } from './db';", oldNumber: 1 },
|
|
155
|
+
{ type: 'added', content: "import { db } from '../lib/db';", newNumber: 1 },
|
|
156
|
+
{ type: 'added', content: "import { hashPassword } from '../lib/auth';", newNumber: 2 },
|
|
157
|
+
{ type: 'context', content: '', oldNumber: 2, newNumber: 3 },
|
|
158
|
+
{ type: 'context', content: 'export class UserService {', oldNumber: 3, newNumber: 4 },
|
|
159
|
+
],
|
|
160
|
+
},
|
|
161
|
+
],
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
path: 'package.json',
|
|
165
|
+
additions: 2,
|
|
166
|
+
deletions: 1,
|
|
167
|
+
status: 'modified',
|
|
168
|
+
hunks: [
|
|
169
|
+
{
|
|
170
|
+
header: '@@ -10,6 +10,7 @@',
|
|
171
|
+
lines: [
|
|
172
|
+
{ type: 'context', content: ' "dependencies": {', oldNumber: 10, newNumber: 10 },
|
|
173
|
+
{ type: 'removed', content: ' "react": "^17.0.0",', oldNumber: 11 },
|
|
174
|
+
{ type: 'added', content: ' "react": "^18.0.0",', newNumber: 11 },
|
|
175
|
+
{ type: 'added', content: ' "bcrypt": "^5.1.0",', newNumber: 12 },
|
|
176
|
+
{ type: 'context', content: ' }', oldNumber: 12, newNumber: 13 },
|
|
177
|
+
],
|
|
178
|
+
},
|
|
179
|
+
],
|
|
180
|
+
},
|
|
181
|
+
];
|
|
182
|
+
const meta = {
|
|
183
|
+
title: 'Drawers/Review/MergeDiffViewer',
|
|
184
|
+
component: MergeDiffViewer,
|
|
185
|
+
tags: ['autodocs'],
|
|
186
|
+
parameters: {
|
|
187
|
+
layout: 'fullscreen',
|
|
188
|
+
},
|
|
189
|
+
decorators: [
|
|
190
|
+
(Story) => (_jsx("div", { style: {
|
|
191
|
+
height: '600px',
|
|
192
|
+
width: '100%',
|
|
193
|
+
maxWidth: '900px',
|
|
194
|
+
overflow: 'hidden',
|
|
195
|
+
border: '1px solid var(--color-border)',
|
|
196
|
+
}, children: _jsx("div", { style: { height: '100%', padding: '16px' }, children: _jsx(Story, {}) }) })),
|
|
197
|
+
],
|
|
198
|
+
};
|
|
199
|
+
export default meta;
|
|
200
|
+
/** Default — multiple files with various change types. */
|
|
201
|
+
export const Default = {
|
|
202
|
+
args: {
|
|
203
|
+
fileDiffs: sampleFiles,
|
|
204
|
+
className: 'h-full',
|
|
205
|
+
},
|
|
206
|
+
};
|
|
207
|
+
/** Single modified file with multiple hunks. */
|
|
208
|
+
export const SingleFile = {
|
|
209
|
+
args: {
|
|
210
|
+
fileDiffs: [sampleFiles[0]],
|
|
211
|
+
className: 'h-full',
|
|
212
|
+
},
|
|
213
|
+
};
|
|
214
|
+
/** Only new files added. */
|
|
215
|
+
export const OnlyAdditions = {
|
|
216
|
+
args: {
|
|
217
|
+
fileDiffs: [sampleFiles[1]],
|
|
218
|
+
className: 'h-full',
|
|
219
|
+
},
|
|
220
|
+
};
|
|
221
|
+
/** Only deleted files. */
|
|
222
|
+
export const OnlyDeletions = {
|
|
223
|
+
args: {
|
|
224
|
+
fileDiffs: [sampleFiles[2]],
|
|
225
|
+
className: 'h-full',
|
|
226
|
+
},
|
|
227
|
+
};
|
|
228
|
+
/** Renamed file with modifications. */
|
|
229
|
+
export const RenamedFile = {
|
|
230
|
+
args: {
|
|
231
|
+
fileDiffs: [sampleFiles[3]],
|
|
232
|
+
className: 'h-full',
|
|
233
|
+
},
|
|
234
|
+
};
|
|
235
|
+
/** Empty diff list — renders nothing. */
|
|
236
|
+
export const EmptyDiffs = {
|
|
237
|
+
args: {
|
|
238
|
+
fileDiffs: [],
|
|
239
|
+
},
|
|
240
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge-review.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/merge-review/merge-review.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,gBAAgB,EAAuB,MAAM,uBAAuB,CAAC;AA0KnF,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,YAAoB,EACpB,WAAmB,EACnB,SAAS,EACT,iBAAiB,GAClB,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"merge-review.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/merge-review/merge-review.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,gBAAgB,EAAuB,MAAM,uBAAuB,CAAC;AA0KnF,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,YAAoB,EACpB,WAAmB,EACnB,SAAS,EACT,iBAAiB,GAClB,EAAE,gBAAgB,2CA6JlB"}
|
|
@@ -5,7 +5,7 @@ import { ExternalLink, AlertTriangle, FileDiff, GitCommitHorizontal, GitBranch,
|
|
|
5
5
|
import { Badge } from '../../ui/badge.js';
|
|
6
6
|
import { CiStatusBadge } from '../../common/ci-status-badge/index.js';
|
|
7
7
|
import { DrawerActionBar } from '../../common/drawer-action-bar/index.js';
|
|
8
|
-
import {
|
|
8
|
+
import { MergeDiffViewer } from './merge-diff-viewer.js';
|
|
9
9
|
const EVIDENCE_ICONS = {
|
|
10
10
|
Screenshot: Camera,
|
|
11
11
|
Video: MonitorPlay,
|
|
@@ -71,5 +71,5 @@ export function MergeReview({ data, onApprove, onReject, isProcessing = false, i
|
|
|
71
71
|
const handleApproveOrResolve = hasConflicts && onReject ? () => onReject('Resolve merge conflicts', []) : onApprove;
|
|
72
72
|
return (_jsxs("div", { className: "flex min-h-0 flex-1 flex-col", children: [_jsxs("div", { className: "flex-1 space-y-4 overflow-y-auto p-4", children: [_jsxs("div", { className: "flex items-start gap-3", children: [_jsx("div", { className: "mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full bg-emerald-500" }), _jsxs("div", { className: "flex-1", children: [_jsx("h2", { className: "text-foreground text-sm font-bold", children: "Merge Review" }), _jsx("p", { className: "text-muted-foreground mt-1 text-xs leading-relaxed", children: pr
|
|
73
73
|
? 'Review the pull request details and approve to merge.'
|
|
74
|
-
: 'Review the changes and approve to merge.' })] })] }), branch ? (_jsx("div", { className: "border-border rounded-lg border", children: _jsxs("div", { className: "flex items-center gap-2 px-4 py-3", children: [_jsx(GitBranch, { className: "text-muted-foreground h-4 w-4 shrink-0" }), _jsx(Badge, { variant: "secondary", className: "font-mono text-[11px]", children: branch.source }), _jsx(ArrowRight, { className: "text-muted-foreground h-3.5 w-3.5 shrink-0" }), _jsx(Badge, { variant: "outline", className: "font-mono text-[11px]", children: branch.target })] }) })) : null, pr ? (_jsx("div", { className: "border-border rounded-lg border", children: _jsxs("div", { className: "space-y-3 px-4 py-3", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("a", { href: pr.url, target: "_blank", rel: "noopener noreferrer", className: "text-primary flex items-center gap-1.5 text-sm font-semibold underline underline-offset-2", children: ["PR #", pr.number, _jsx(ExternalLink, { className: "h-3.5 w-3.5" })] }), _jsx(Badge, { variant: "outline", className: "text-xs", children: pr.status })] }), pr.mergeable === false ? (_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-muted-foreground text-xs font-medium", children: "Merge Status" }), _jsxs(Badge, { className: "border-transparent bg-orange-50 text-orange-700 hover:bg-orange-50", children: [_jsx(AlertTriangle, { className: "mr-1 h-3.5 w-3.5" }), "Conflicts"] })] })) : null, pr.ciStatus ? (_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-muted-foreground text-xs font-medium", children: "CI Status" }), _jsx(CiStatusBadge, { status: pr.ciStatus })] })) : null, pr.commitHash ? (_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-muted-foreground text-xs font-medium", children: "Commit" }), _jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx(GitCommitHorizontal, { className: "text-muted-foreground h-3.5 w-3.5" }), _jsx("code", { className: "bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]", children: pr.commitHash.slice(0, 7) })] })] })) : null] }) })) : null, diffSummary ? (_jsx("div", { className: "border-border rounded-lg border", children: _jsxs("div", { className: "px-4 py-3", children: [_jsxs("div", { className: "mb-3 flex items-center gap-2", children: [_jsx(FileDiff, { className: "text-muted-foreground h-4 w-4" }), _jsx("span", { className: "text-foreground text-xs font-semibold", children: "Changes" })] }), _jsxs("div", { className: "grid grid-cols-4 gap-3", children: [_jsxs("div", { className: "text-center", children: [_jsx("div", { className: "text-foreground text-sm font-bold", children: diffSummary.filesChanged }), _jsx("div", { className: "text-muted-foreground text-[10px]", children: "files" })] }), _jsxs("div", { className: "text-center", children: [_jsxs("div", { className: "text-sm font-bold text-green-600", children: ["+", diffSummary.additions] }), _jsx("div", { className: "text-muted-foreground text-[10px]", children: "additions" })] }), _jsxs("div", { className: "text-center", children: [_jsxs("div", { className: "text-sm font-bold text-red-600", children: ["-", diffSummary.deletions] }), _jsx("div", { className: "text-muted-foreground text-[10px]", children: "deletions" })] }), _jsxs("div", { className: "text-center", children: [_jsx("div", { className: "text-foreground text-sm font-bold", children: diffSummary.commitCount }), _jsx("div", { className: "text-muted-foreground text-[10px]", children: "commits" })] })] })] }) })) : warning ? (_jsx("div", { className: "border-border rounded-lg border", children: _jsxs("div", { className: "flex items-center gap-2 px-4 py-3", children: [_jsx(AlertTriangle, { className: "text-muted-foreground h-4 w-4 shrink-0" }), _jsx("span", { className: "text-muted-foreground text-xs", children: warning })] }) })) : null, evidence && evidence.length > 0 ? (_jsx(EvidenceList, { evidence: evidence, basePath: evidenceBasePath })) : null, fileDiffs && fileDiffs.length > 0 ? _jsx(
|
|
74
|
+
: 'Review the changes and approve to merge.' })] })] }), branch ? (_jsx("div", { className: "border-border rounded-lg border", children: _jsxs("div", { className: "flex items-center gap-2 px-4 py-3", children: [_jsx(GitBranch, { className: "text-muted-foreground h-4 w-4 shrink-0" }), _jsx(Badge, { variant: "secondary", className: "font-mono text-[11px]", children: branch.source }), _jsx(ArrowRight, { className: "text-muted-foreground h-3.5 w-3.5 shrink-0" }), _jsx(Badge, { variant: "outline", className: "font-mono text-[11px]", children: branch.target })] }) })) : null, pr ? (_jsx("div", { className: "border-border rounded-lg border", children: _jsxs("div", { className: "space-y-3 px-4 py-3", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("a", { href: pr.url, target: "_blank", rel: "noopener noreferrer", className: "text-primary flex items-center gap-1.5 text-sm font-semibold underline underline-offset-2", children: ["PR #", pr.number, _jsx(ExternalLink, { className: "h-3.5 w-3.5" })] }), _jsx(Badge, { variant: "outline", className: "text-xs", children: pr.status })] }), pr.mergeable === false ? (_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-muted-foreground text-xs font-medium", children: "Merge Status" }), _jsxs(Badge, { className: "border-transparent bg-orange-50 text-orange-700 hover:bg-orange-50", children: [_jsx(AlertTriangle, { className: "mr-1 h-3.5 w-3.5" }), "Conflicts"] })] })) : null, pr.ciStatus ? (_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-muted-foreground text-xs font-medium", children: "CI Status" }), _jsx(CiStatusBadge, { status: pr.ciStatus })] })) : null, pr.commitHash ? (_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-muted-foreground text-xs font-medium", children: "Commit" }), _jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx(GitCommitHorizontal, { className: "text-muted-foreground h-3.5 w-3.5" }), _jsx("code", { className: "bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]", children: pr.commitHash.slice(0, 7) })] })] })) : null] }) })) : null, diffSummary ? (_jsx("div", { className: "border-border rounded-lg border", children: _jsxs("div", { className: "px-4 py-3", children: [_jsxs("div", { className: "mb-3 flex items-center gap-2", children: [_jsx(FileDiff, { className: "text-muted-foreground h-4 w-4" }), _jsx("span", { className: "text-foreground text-xs font-semibold", children: "Changes" })] }), _jsxs("div", { className: "grid grid-cols-4 gap-3", children: [_jsxs("div", { className: "text-center", children: [_jsx("div", { className: "text-foreground text-sm font-bold", children: diffSummary.filesChanged }), _jsx("div", { className: "text-muted-foreground text-[10px]", children: "files" })] }), _jsxs("div", { className: "text-center", children: [_jsxs("div", { className: "text-sm font-bold text-green-600", children: ["+", diffSummary.additions] }), _jsx("div", { className: "text-muted-foreground text-[10px]", children: "additions" })] }), _jsxs("div", { className: "text-center", children: [_jsxs("div", { className: "text-sm font-bold text-red-600", children: ["-", diffSummary.deletions] }), _jsx("div", { className: "text-muted-foreground text-[10px]", children: "deletions" })] }), _jsxs("div", { className: "text-center", children: [_jsx("div", { className: "text-foreground text-sm font-bold", children: diffSummary.commitCount }), _jsx("div", { className: "text-muted-foreground text-[10px]", children: "commits" })] })] })] }) })) : warning ? (_jsx("div", { className: "border-border rounded-lg border", children: _jsxs("div", { className: "flex items-center gap-2 px-4 py-3", children: [_jsx(AlertTriangle, { className: "text-muted-foreground h-4 w-4 shrink-0" }), _jsx("span", { className: "text-muted-foreground text-xs", children: warning })] }) })) : null, evidence && evidence.length > 0 ? (_jsx(EvidenceList, { evidence: evidence, basePath: evidenceBasePath })) : null, fileDiffs && fileDiffs.length > 0 ? (_jsx(MergeDiffViewer, { fileDiffs: fileDiffs, className: "min-h-[400px]" })) : null] }), _jsx(DrawerActionBar, { onReject: onReject, onApprove: handleApproveOrResolve, approveLabel: hasConflicts ? 'Resolve Conflicts' : 'Approve Merge', approveVariant: hasConflicts ? 'warning' : 'default', revisionPlaceholder: "Ask AI to revise before merging...", isProcessing: isProcessing, isRejecting: isRejecting, chatInput: chatInput, onChatInputChange: onChatInputChange })] }));
|
|
75
75
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface CodeBlockTab {
|
|
2
|
+
name: string;
|
|
3
|
+
code: string;
|
|
4
|
+
language?: string;
|
|
5
|
+
highlightLines?: number[];
|
|
6
|
+
}
|
|
7
|
+
export type CodeBlockProps = {
|
|
8
|
+
/** Programming language for syntax highlighting. */
|
|
9
|
+
language: string;
|
|
10
|
+
/** File name displayed in the header. */
|
|
11
|
+
filename: string;
|
|
12
|
+
/** Line numbers to highlight. */
|
|
13
|
+
highlightLines?: number[];
|
|
14
|
+
/** Lines highlighted with a green (addition) background. */
|
|
15
|
+
addedLines?: number[];
|
|
16
|
+
/** Lines highlighted with a red (deletion) background. */
|
|
17
|
+
removedLines?: number[];
|
|
18
|
+
/** Additional class name for the container. */
|
|
19
|
+
className?: string;
|
|
20
|
+
} & ({
|
|
21
|
+
code: string;
|
|
22
|
+
tabs?: never;
|
|
23
|
+
} | {
|
|
24
|
+
code?: never;
|
|
25
|
+
tabs: CodeBlockTab[];
|
|
26
|
+
});
|
|
27
|
+
export declare function CodeBlock({ language, filename, code, highlightLines, addedLines, removedLines, tabs, className, }: CodeBlockProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
//# sourceMappingURL=code-block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-block.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/web/components/ui/code-block.tsx"],"names":[],"mappings":"AAQA,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,oDAAoD;IACpD,QAAQ,EAAE,MAAM,CAAC;IACjB,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,iCAAiC;IACjC,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,4DAA4D;IAC5D,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,0DAA0D;IAC1D,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,KAAK,CAAA;CAAE,GAAG;IAAE,IAAI,CAAC,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,YAAY,EAAE,CAAA;CAAE,CAAC,CAAC;AAE9E,wBAAgB,SAAS,CAAC,EACxB,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,cAAmB,EACnB,UAAe,EACf,YAAiB,EACjB,IAAS,EACT,SAAS,GACV,EAAE,cAAc,2CAwFhB"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
|
|
5
|
+
import { oneDark } from 'react-syntax-highlighter/dist/cjs/styles/prism';
|
|
6
|
+
import { Check, Copy } from 'lucide-react';
|
|
7
|
+
import { cn } from '../../lib/utils.js';
|
|
8
|
+
export function CodeBlock({ language, filename, code, highlightLines = [], addedLines = [], removedLines = [], tabs = [], className, }) {
|
|
9
|
+
const [copied, setCopied] = React.useState(false);
|
|
10
|
+
const [activeTab, setActiveTab] = React.useState(0);
|
|
11
|
+
const tabsExist = tabs.length > 0;
|
|
12
|
+
const copyToClipboard = async () => {
|
|
13
|
+
const textToCopy = tabsExist ? tabs[activeTab].code : code;
|
|
14
|
+
if (textToCopy) {
|
|
15
|
+
await navigator.clipboard.writeText(textToCopy);
|
|
16
|
+
setCopied(true);
|
|
17
|
+
setTimeout(() => setCopied(false), 2000);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const activeCode = tabsExist ? tabs[activeTab].code : code;
|
|
21
|
+
const activeLanguage = tabsExist ? (tabs[activeTab].language ?? language) : language;
|
|
22
|
+
const activeHighlightLines = tabsExist ? (tabs[activeTab].highlightLines ?? []) : highlightLines;
|
|
23
|
+
return (_jsxs("div", { "data-testid": "code-block", className: cn('relative w-full rounded-lg bg-slate-950 p-4 font-mono text-sm', className), children: [_jsx("div", { className: "flex flex-col gap-2", children: tabsExist ? (_jsx("div", { className: "flex overflow-x-auto", children: tabs.map((tab, index) => (_jsx("button", { type: "button", onClick: () => setActiveTab(index), className: cn('px-3 py-2 font-sans text-xs transition-colors', activeTab === index ? 'text-white' : 'text-zinc-400 hover:text-zinc-200'), children: tab.name }, tab.name))) })) : (_jsxs("div", { className: "flex items-center justify-between py-2", children: [_jsx("div", { className: "text-xs text-zinc-400", children: filename }), _jsx("button", { type: "button", onClick: copyToClipboard, className: "flex items-center gap-1 font-sans text-xs text-zinc-400 transition-colors hover:text-zinc-200", children: copied ? _jsx(Check, { className: "h-3.5 w-3.5" }) : _jsx(Copy, { className: "h-3.5 w-3.5" }) })] })) }), _jsx(SyntaxHighlighter, { language: activeLanguage, style: oneDark, customStyle: {
|
|
24
|
+
margin: 0,
|
|
25
|
+
padding: 0,
|
|
26
|
+
background: 'transparent',
|
|
27
|
+
fontSize: '0.875rem',
|
|
28
|
+
}, wrapLines: true, showLineNumbers: true, lineProps: (lineNumber) => {
|
|
29
|
+
let backgroundColor = 'transparent';
|
|
30
|
+
if (addedLines.includes(lineNumber)) {
|
|
31
|
+
backgroundColor = 'rgba(34,197,94,0.15)';
|
|
32
|
+
}
|
|
33
|
+
else if (removedLines.includes(lineNumber)) {
|
|
34
|
+
backgroundColor = 'rgba(239,68,68,0.15)';
|
|
35
|
+
}
|
|
36
|
+
else if (activeHighlightLines.includes(lineNumber)) {
|
|
37
|
+
backgroundColor = 'rgba(255,255,255,0.1)';
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
style: {
|
|
41
|
+
backgroundColor,
|
|
42
|
+
display: 'block',
|
|
43
|
+
width: '100%',
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
}, PreTag: "div", children: String(activeCode) })] }));
|
|
47
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { CodeBlock } from './code-block.js';
|
|
3
|
+
declare const meta: Meta<typeof CodeBlock>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof CodeBlock>;
|
|
6
|
+
/** Default — single code block with syntax highlighting. */
|
|
7
|
+
export declare const Default: Story;
|
|
8
|
+
/** Highlighted lines to draw attention to specific code. */
|
|
9
|
+
export declare const HighlightedLines: Story;
|
|
10
|
+
/** Tabbed code view with multiple files. */
|
|
11
|
+
export declare const WithTabs: Story;
|
|
12
|
+
/** JSON content. */
|
|
13
|
+
export declare const JsonContent: Story;
|
|
14
|
+
/** Diff-style highlighting with green (added) and red (removed) backgrounds. */
|
|
15
|
+
export declare const DiffHighlighting: Story;
|
|
16
|
+
//# sourceMappingURL=code-block.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-block.stories.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/web/components/ui/code-block.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AA2BzC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CAOhC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,SAAS,CAAC,CAAC;AAExC,4DAA4D;AAC5D,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF,4DAA4D;AAC5D,eAAO,MAAM,gBAAgB,EAAE,KAO9B,CAAC;AAEF,4CAA4C;AAC5C,eAAO,MAAM,QAAQ,EAAE,KAStB,CAAC;AAEF,oBAAoB;AACpB,eAAO,MAAM,WAAW,EAAE,KAUzB,CAAC;AAaF,gFAAgF;AAChF,eAAO,MAAM,gBAAgB,EAAE,KAQ9B,CAAC"}
|