gitspace 0.2.0-rc.20 → 0.2.0-rc.21
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/package.json +11 -6
- package/.claude/settings.local.json +0 -10
- package/.gitspace/bundle.json +0 -50
- package/.gitspace/events.json +0 -11
- package/.gitspace/processes.json +0 -23
- package/.gitspace/scripts/select/01-status.sh +0 -39
- package/.gitspace/scripts/setup/01-install-deps.sh +0 -12
- package/.gitspace/scripts/setup/02-typecheck.sh +0 -16
- package/AGENTS.md +0 -469
- package/CLAUDE.md +0 -1
- package/bun.lock +0 -794
- package/docs/CONNECTION.md +0 -623
- package/docs/GATEWAY-WORKER.md +0 -319
- package/docs/GETTING-STARTED.md +0 -448
- package/docs/GITSPACE-PLATFORM.md +0 -1819
- package/docs/INFRASTRUCTURE.md +0 -1347
- package/docs/PROTOCOL.md +0 -619
- package/docs/QUICKSTART.md +0 -183
- package/docs/RELAY.md +0 -327
- package/docs/REMOTE-DESIGN.md +0 -554
- package/docs/ROADMAP.md +0 -564
- package/docs/SITE_DOCS_FIGMA_MAKE.md +0 -1176
- package/docs/STACK-DESIGN.md +0 -588
- package/docs/UNIFIED_ARCHITECTURE.md +0 -138
- package/experiments/pty-benchmark.ts +0 -148
- package/experiments/pty-latency.ts +0 -100
- package/experiments/router/client.ts +0 -199
- package/experiments/router/protocol.ts +0 -74
- package/experiments/router/router.ts +0 -217
- package/experiments/router/session.ts +0 -180
- package/experiments/router/test.ts +0 -133
- package/experiments/socket-bandwidth.ts +0 -77
- package/homebrew/gitspace.rb +0 -45
- package/landing-page/ATTRIBUTIONS.md +0 -3
- package/landing-page/README.md +0 -11
- package/landing-page/bun.lock +0 -801
- package/landing-page/guidelines/Guidelines.md +0 -61
- package/landing-page/index.html +0 -37
- package/landing-page/package.json +0 -90
- package/landing-page/postcss.config.mjs +0 -15
- package/landing-page/public/_redirects +0 -1
- package/landing-page/public/favicon.png +0 -0
- package/landing-page/src/app/App.tsx +0 -53
- package/landing-page/src/app/components/figma/ImageWithFallback.tsx +0 -27
- package/landing-page/src/app/components/ui/accordion.tsx +0 -66
- package/landing-page/src/app/components/ui/alert-dialog.tsx +0 -157
- package/landing-page/src/app/components/ui/alert.tsx +0 -66
- package/landing-page/src/app/components/ui/aspect-ratio.tsx +0 -11
- package/landing-page/src/app/components/ui/avatar.tsx +0 -53
- package/landing-page/src/app/components/ui/badge.tsx +0 -46
- package/landing-page/src/app/components/ui/breadcrumb.tsx +0 -109
- package/landing-page/src/app/components/ui/button.tsx +0 -57
- package/landing-page/src/app/components/ui/calendar.tsx +0 -75
- package/landing-page/src/app/components/ui/card.tsx +0 -92
- package/landing-page/src/app/components/ui/carousel.tsx +0 -241
- package/landing-page/src/app/components/ui/chart.tsx +0 -353
- package/landing-page/src/app/components/ui/checkbox.tsx +0 -32
- package/landing-page/src/app/components/ui/collapsible.tsx +0 -33
- package/landing-page/src/app/components/ui/command.tsx +0 -177
- package/landing-page/src/app/components/ui/context-menu.tsx +0 -252
- package/landing-page/src/app/components/ui/dialog.tsx +0 -135
- package/landing-page/src/app/components/ui/drawer.tsx +0 -132
- package/landing-page/src/app/components/ui/dropdown-menu.tsx +0 -257
- package/landing-page/src/app/components/ui/form.tsx +0 -168
- package/landing-page/src/app/components/ui/hover-card.tsx +0 -44
- package/landing-page/src/app/components/ui/input-otp.tsx +0 -77
- package/landing-page/src/app/components/ui/input.tsx +0 -21
- package/landing-page/src/app/components/ui/label.tsx +0 -24
- package/landing-page/src/app/components/ui/menubar.tsx +0 -276
- package/landing-page/src/app/components/ui/navigation-menu.tsx +0 -168
- package/landing-page/src/app/components/ui/pagination.tsx +0 -127
- package/landing-page/src/app/components/ui/popover.tsx +0 -48
- package/landing-page/src/app/components/ui/progress.tsx +0 -31
- package/landing-page/src/app/components/ui/radio-group.tsx +0 -45
- package/landing-page/src/app/components/ui/resizable.tsx +0 -56
- package/landing-page/src/app/components/ui/scroll-area.tsx +0 -58
- package/landing-page/src/app/components/ui/select.tsx +0 -189
- package/landing-page/src/app/components/ui/separator.tsx +0 -28
- package/landing-page/src/app/components/ui/sheet.tsx +0 -139
- package/landing-page/src/app/components/ui/sidebar.tsx +0 -726
- package/landing-page/src/app/components/ui/skeleton.tsx +0 -13
- package/landing-page/src/app/components/ui/slider.tsx +0 -63
- package/landing-page/src/app/components/ui/sonner.tsx +0 -25
- package/landing-page/src/app/components/ui/switch.tsx +0 -31
- package/landing-page/src/app/components/ui/table.tsx +0 -116
- package/landing-page/src/app/components/ui/tabs.tsx +0 -66
- package/landing-page/src/app/components/ui/textarea.tsx +0 -18
- package/landing-page/src/app/components/ui/toggle-group.tsx +0 -73
- package/landing-page/src/app/components/ui/toggle.tsx +0 -47
- package/landing-page/src/app/components/ui/tooltip.tsx +0 -61
- package/landing-page/src/app/components/ui/use-mobile.ts +0 -21
- package/landing-page/src/app/components/ui/utils.ts +0 -6
- package/landing-page/src/components/docs/DocsContent.tsx +0 -801
- package/landing-page/src/components/docs/DocsSidebar.tsx +0 -90
- package/landing-page/src/components/landing/CTA.tsx +0 -59
- package/landing-page/src/components/landing/Comparison.tsx +0 -84
- package/landing-page/src/components/landing/FaultyTerminal.tsx +0 -424
- package/landing-page/src/components/landing/Features.tsx +0 -201
- package/landing-page/src/components/landing/Hero.tsx +0 -142
- package/landing-page/src/components/landing/Pricing.tsx +0 -140
- package/landing-page/src/components/landing/Roadmap.tsx +0 -86
- package/landing-page/src/components/landing/Security.tsx +0 -81
- package/landing-page/src/components/landing/TerminalWindow.tsx +0 -27
- package/landing-page/src/components/landing/UseCases.tsx +0 -55
- package/landing-page/src/components/landing/Workflow.tsx +0 -101
- package/landing-page/src/components/layout/DashboardNavbar.tsx +0 -37
- package/landing-page/src/components/layout/Footer.tsx +0 -55
- package/landing-page/src/components/layout/LandingNavbar.tsx +0 -82
- package/landing-page/src/components/ui/badge.tsx +0 -39
- package/landing-page/src/components/ui/breadcrumb.tsx +0 -115
- package/landing-page/src/components/ui/button.tsx +0 -57
- package/landing-page/src/components/ui/card.tsx +0 -79
- package/landing-page/src/components/ui/mock-terminal.tsx +0 -68
- package/landing-page/src/components/ui/separator.tsx +0 -28
- package/landing-page/src/lib/utils.ts +0 -6
- package/landing-page/src/main.tsx +0 -10
- package/landing-page/src/pages/Dashboard.tsx +0 -133
- package/landing-page/src/pages/DocsPage.tsx +0 -79
- package/landing-page/src/pages/LandingPage.tsx +0 -31
- package/landing-page/src/pages/TerminalView.tsx +0 -106
- package/landing-page/src/styles/fonts.css +0 -0
- package/landing-page/src/styles/index.css +0 -3
- package/landing-page/src/styles/tailwind.css +0 -4
- package/landing-page/src/styles/theme.css +0 -181
- package/landing-page/vite.config.ts +0 -19
- package/scripts/GHOSTTY_TAB_BUG.md +0 -106
- package/scripts/build.ts +0 -298
- package/scripts/migrate-secrets.ts +0 -77
- package/scripts/release.ts +0 -140
- package/scripts/sample-events.ts +0 -263
- package/scripts/test-tabs-minimal.ts +0 -68
- package/scripts/test-tabs-workaround.ts +0 -95
- package/scripts/test-tabs.ts +0 -171
- package/src/__tests__/test-utils.ts +0 -298
- package/src/app/input/__tests__/sessionCommands.test.ts +0 -40
- package/src/app/input/sessionCommands.ts +0 -94
- package/src/app/session/__tests__/useAttachController.test.ts +0 -229
- package/src/app/session/createSessionBackend.bun.ts +0 -76
- package/src/app/session/createSessionBackend.web.ts +0 -104
- package/src/app/session/types.ts +0 -16
- package/src/app/session/useAttachController.ts +0 -220
- package/src/app/session/useProcessActions.ts +0 -201
- package/src/app/session/useSessionClient.ts +0 -35
- package/src/app/session/useWorkspaceDeleteFlow.ts +0 -170
- package/src/app.tui.tsx +0 -2929
- package/src/app.web.tsx +0 -1454
- package/src/commands/__tests__/connect-key.test.ts +0 -10
- package/src/commands/__tests__/events.test.ts +0 -201
- package/src/commands/__tests__/notifications.test.ts +0 -349
- package/src/commands/__tests__/process.test.ts +0 -251
- package/src/commands/__tests__/serve-messages.test.ts +0 -190
- package/src/commands/__tests__/serve-process-hosting.test.ts +0 -63
- package/src/commands/access.ts +0 -298
- package/src/commands/add.ts +0 -455
- package/src/commands/auth.ts +0 -369
- package/src/commands/bundle.ts +0 -232
- package/src/commands/config.ts +0 -242
- package/src/commands/connect-key.ts +0 -1
- package/src/commands/connect.ts +0 -576
- package/src/commands/directory.ts +0 -16
- package/src/commands/events.ts +0 -157
- package/src/commands/host.ts +0 -566
- package/src/commands/identity.ts +0 -184
- package/src/commands/linear.ts +0 -717
- package/src/commands/list.ts +0 -181
- package/src/commands/migrate.ts +0 -52
- package/src/commands/notifications.ts +0 -351
- package/src/commands/process.ts +0 -104
- package/src/commands/relay.ts +0 -315
- package/src/commands/remove.ts +0 -279
- package/src/commands/review.ts +0 -787
- package/src/commands/serve.ts +0 -1946
- package/src/commands/share.ts +0 -451
- package/src/commands/status.ts +0 -125
- package/src/commands/switch.ts +0 -361
- package/src/commands/tmux.ts +0 -317
- package/src/components/DPad.web.tsx +0 -343
- package/src/components/DiffViewer.web.tsx +0 -1192
- package/src/components/Events.tsx +0 -137
- package/src/components/Events.tui.tsx +0 -129
- package/src/components/Events.web.tsx +0 -386
- package/src/components/FloatingControls.web.tsx +0 -112
- package/src/components/FloatingJogWheel.web.tsx +0 -240
- package/src/components/Flow.tsx +0 -458
- package/src/components/Flow.tui.tsx +0 -343
- package/src/components/Flow.web.tsx +0 -442
- package/src/components/Inbox.tsx +0 -448
- package/src/components/Inbox.tui.tsx +0 -262
- package/src/components/Inbox.web.tsx +0 -329
- package/src/components/MachineList.tsx +0 -187
- package/src/components/MachineList.tui.tsx +0 -161
- package/src/components/MachineList.web.tsx +0 -210
- package/src/components/NumPad.web.tsx +0 -270
- package/src/components/ProjectList.tsx +0 -175
- package/src/components/ProjectList.tui.tsx +0 -109
- package/src/components/ProjectList.web.tsx +0 -143
- package/src/components/ProjectOnboardingStep.ts +0 -23
- package/src/components/ProjectOnboardingStep.tui.tsx +0 -88
- package/src/components/ProjectOnboardingStep.web.tsx +0 -59
- package/src/components/RemoteMachineScreen.tui.tsx +0 -690
- package/src/components/ScriptTerminal.tui.tsx +0 -160
- package/src/components/ScriptTerminal.web.tsx +0 -89
- package/src/components/SessionTerminal.tui.tsx +0 -406
- package/src/components/SessionTerminal.web.tsx +0 -467
- package/src/components/SpacesBrowser.tsx +0 -540
- package/src/components/SpacesBrowser.tui.tsx +0 -258
- package/src/components/SpacesBrowser.web.tsx +0 -332
- package/src/components/TerminalControls.web.tsx +0 -464
- package/src/components/ThreadPanel.web.tsx +0 -798
- package/src/components/__tests__/SpacesBrowser.test.ts +0 -541
- package/src/components/__tests__/SpacesBrowser.tui.test.tsx +0 -249
- package/src/components/__tests__/script-terminal-buffer.tui.test.ts +0 -72
- package/src/components/index.ts +0 -105
- package/src/components/review-decision-colors.ts +0 -11
- package/src/components/script-terminal-buffer.tui.ts +0 -37
- package/src/components/session-terminal-page-navigation.ts +0 -48
- package/src/components/terminal-bracketed-paste.tui.test.ts +0 -43
- package/src/components/terminal-bracketed-paste.tui.ts +0 -46
- package/src/core/__tests__/access.test.ts +0 -240
- package/src/core/__tests__/bundle-refresh.test.ts +0 -567
- package/src/core/__tests__/bundle.test.ts +0 -209
- package/src/core/__tests__/github-review.test.ts +0 -781
- package/src/core/__tests__/project-lifecycle.test.ts +0 -137
- package/src/core/__tests__/workspace-lifecycle.test.ts +0 -159
- package/src/core/__tests__/workspace.test.ts +0 -149
- package/src/core/access.ts +0 -277
- package/src/core/bundle-refresh.ts +0 -1064
- package/src/core/bundle.ts +0 -326
- package/src/core/config.ts +0 -405
- package/src/core/git.ts +0 -768
- package/src/core/github-review.ts +0 -761
- package/src/core/github.ts +0 -151
- package/src/core/identity.ts +0 -631
- package/src/core/linear.ts +0 -403
- package/src/core/preferences-service.ts +0 -17
- package/src/core/project-catalog.ts +0 -52
- package/src/core/project-lifecycle.ts +0 -163
- package/src/core/review-executor.ts +0 -316
- package/src/core/review.ts +0 -407
- package/src/core/secret-runtime.ts +0 -167
- package/src/core/shell.ts +0 -117
- package/src/core/trusted-relays.ts +0 -315
- package/src/core/workspace-lifecycle.ts +0 -216
- package/src/core/workspace.ts +0 -363
- package/src/hooks/__tests__/useLocalSession.tui.test.ts +0 -557
- package/src/hooks/index.ts +0 -8
- package/src/hooks/index.tui.ts +0 -32
- package/src/hooks/useDaemonStatus.tui.ts +0 -174
- package/src/hooks/useLocalSession.tui.ts +0 -395
- package/src/hooks/useRelayConnection.web.ts +0 -54
- package/src/hooks/useRemoteMachines.tui.ts +0 -166
- package/src/hooks/useRemoteTerminal.tui.ts +0 -22
- package/src/hooks/useReview.web.ts +0 -248
- package/src/hooks/useTerminal.web.ts +0 -36
- package/src/hooks/useUserActivity.ts +0 -61
- package/src/hooks/useVisualViewport.web.ts +0 -104
- package/src/index.ts +0 -1376
- package/src/lib/events/__tests__/collector-filter.test.ts +0 -105
- package/src/lib/events/__tests__/store-query.test.ts +0 -103
- package/src/lib/events/collector.ts +0 -494
- package/src/lib/events/filters.ts +0 -26
- package/src/lib/events/index.ts +0 -11
- package/src/lib/events/indexer.ts +0 -14
- package/src/lib/events/paths.ts +0 -69
- package/src/lib/events/reader.ts +0 -212
- package/src/lib/events/store.ts +0 -141
- package/src/lib/invite.web.ts +0 -58
- package/src/lib/preferences-service.web.ts +0 -41
- package/src/lib/processes/__tests__/config.test.ts +0 -83
- package/src/lib/processes/__tests__/names.test.ts +0 -125
- package/src/lib/processes/__tests__/schema.test.ts +0 -208
- package/src/lib/processes/__tests__/watchdog.test.ts +0 -210
- package/src/lib/processes/autostart.ts +0 -16
- package/src/lib/processes/config.ts +0 -187
- package/src/lib/processes/control.ts +0 -53
- package/src/lib/processes/editor.ts +0 -32
- package/src/lib/processes/events-config.ts +0 -37
- package/src/lib/processes/index.ts +0 -14
- package/src/lib/processes/instances.ts +0 -20
- package/src/lib/processes/manager.ts +0 -131
- package/src/lib/processes/names.ts +0 -71
- package/src/lib/processes/registry.ts +0 -26
- package/src/lib/processes/runner.ts +0 -211
- package/src/lib/processes/scheduler.ts +0 -17
- package/src/lib/processes/schema.ts +0 -74
- package/src/lib/processes/session-list.ts +0 -15
- package/src/lib/processes/state.ts +0 -82
- package/src/lib/processes/watchdog.test.ts +0 -79
- package/src/lib/processes/watchdog.ts +0 -106
- package/src/lib/remote-session/__tests__/protocol.test.ts +0 -291
- package/src/lib/remote-session/index.ts +0 -7
- package/src/lib/remote-session/protocol.ts +0 -443
- package/src/lib/remote-session/session-handler.ts +0 -1298
- package/src/lib/remote-session/workspace-scanner.ts +0 -161
- package/src/lib/sonner.web.ts +0 -1
- package/src/lib/storage/identity-store.web.ts +0 -94
- package/src/lib/tmux-lite/README.md +0 -81
- package/src/lib/tmux-lite/cli.ts +0 -855
- package/src/lib/tmux-lite/crypto/__tests__/helpers/handshake-runner.ts +0 -349
- package/src/lib/tmux-lite/crypto/__tests__/helpers/mock-relay.ts +0 -291
- package/src/lib/tmux-lite/crypto/__tests__/helpers/test-identities.ts +0 -142
- package/src/lib/tmux-lite/crypto/__tests__/integration/authorization.integration.test.ts +0 -339
- package/src/lib/tmux-lite/crypto/__tests__/integration/e2e-communication.integration.test.ts +0 -477
- package/src/lib/tmux-lite/crypto/__tests__/integration/error-handling.integration.test.ts +0 -499
- package/src/lib/tmux-lite/crypto/__tests__/integration/handshake.integration.test.ts +0 -371
- package/src/lib/tmux-lite/crypto/__tests__/integration/security.integration.test.ts +0 -573
- package/src/lib/tmux-lite/crypto/access-control.test.ts +0 -512
- package/src/lib/tmux-lite/crypto/access-control.ts +0 -320
- package/src/lib/tmux-lite/crypto/frames.test.ts +0 -262
- package/src/lib/tmux-lite/crypto/frames.ts +0 -141
- package/src/lib/tmux-lite/crypto/handshake.ts +0 -894
- package/src/lib/tmux-lite/crypto/identity.test.ts +0 -220
- package/src/lib/tmux-lite/crypto/identity.ts +0 -286
- package/src/lib/tmux-lite/crypto/index.ts +0 -51
- package/src/lib/tmux-lite/crypto/invites.test.ts +0 -381
- package/src/lib/tmux-lite/crypto/invites.ts +0 -215
- package/src/lib/tmux-lite/crypto/keyexchange.ts +0 -435
- package/src/lib/tmux-lite/crypto/keys.test.ts +0 -58
- package/src/lib/tmux-lite/crypto/keys.ts +0 -47
- package/src/lib/tmux-lite/crypto/secretbox.test.ts +0 -169
- package/src/lib/tmux-lite/crypto/secretbox.ts +0 -124
- package/src/lib/tmux-lite/handshake-handler.ts +0 -451
- package/src/lib/tmux-lite/process-run.integration.test.ts +0 -266
- package/src/lib/tmux-lite/protocol.test.ts +0 -307
- package/src/lib/tmux-lite/protocol.ts +0 -291
- package/src/lib/tmux-lite/relay-client.ts +0 -506
- package/src/lib/tmux-lite/server-lifecycle.test.ts +0 -212
- package/src/lib/tmux-lite/server.ts +0 -1412
- package/src/lib/tmux-lite/shell-integration.sh +0 -37
- package/src/lib/tmux-lite/terminal-queries.test.ts +0 -54
- package/src/lib/tmux-lite/terminal-queries.ts +0 -49
- package/src/notifications/__tests__/useNotifications.test.ts +0 -739
- package/src/notifications/index.ts +0 -32
- package/src/notifications/policy.test.ts +0 -424
- package/src/notifications/policy.ts +0 -139
- package/src/notifications/types.ts +0 -82
- package/src/notifications/useNotifications.ts +0 -350
- package/src/pages/ReviewPage.web.tsx +0 -511
- package/src/preferences/index.ts +0 -1
- package/src/preferences/types.ts +0 -9
- package/src/relay/__tests__/e2e-flow.test.ts +0 -1284
- package/src/relay/__tests__/helpers/auth.ts +0 -354
- package/src/relay/__tests__/helpers/ports.ts +0 -51
- package/src/relay/__tests__/protocol-validation.test.ts +0 -265
- package/src/relay/authorization.ts +0 -303
- package/src/relay/embedded-assets.generated.d.ts +0 -15
- package/src/relay/identity.ts +0 -352
- package/src/relay/index.ts +0 -57
- package/src/relay/pipes.test.ts +0 -427
- package/src/relay/pipes.ts +0 -195
- package/src/relay/protocol.ts +0 -804
- package/src/relay/registries.test.ts +0 -437
- package/src/relay/registries.ts +0 -593
- package/src/relay/server.test.ts +0 -1323
- package/src/relay/server.ts +0 -1128
- package/src/relay/signing.ts +0 -238
- package/src/relay/types.ts +0 -69
- package/src/relay-client/__tests__/machine-directory-client.test.ts +0 -152
- package/src/relay-client/__tests__/useMachineDirectory.test.ts +0 -172
- package/src/relay-client/adapters/browser.ts +0 -27
- package/src/relay-client/adapters/node.ts +0 -29
- package/src/relay-client/index.ts +0 -33
- package/src/relay-client/machine-directory-client.ts +0 -244
- package/src/relay-client/useMachineDirectory.ts +0 -175
- package/src/serve/client-session-manager.ts +0 -635
- package/src/serve/daemon.ts +0 -497
- package/src/serve/pty-session.ts +0 -236
- package/src/serve/types.ts +0 -174
- package/src/session/__tests__/backend-manager.test.ts +0 -101
- package/src/session/__tests__/local-session-backend.test.ts +0 -1129
- package/src/session/__tests__/reducer.test.ts +0 -80
- package/src/session/__tests__/remote-session-backend.test.ts +0 -995
- package/src/session/__tests__/session-name.test.ts +0 -35
- package/src/session/__tests__/useBundleRefreshAttachFlow.test.ts +0 -431
- package/src/session/__tests__/useRemoteSessionClient.test.ts +0 -424
- package/src/session/__tests__/workspace-shell-hooks.integration.test.ts +0 -268
- package/src/session/__tests__/workspace-shell-hooks.test.ts +0 -24
- package/src/session/adapters/browser-remote.ts +0 -101
- package/src/session/adapters/node-remote.ts +0 -135
- package/src/session/backend-key.ts +0 -5
- package/src/session/backend-manager.ts +0 -80
- package/src/session/backend.ts +0 -93
- package/src/session/backends/local-session-backend.ts +0 -1119
- package/src/session/backends/remote-session-backend.ts +0 -1378
- package/src/session/crypto/__tests__/web-terminal.test.ts +0 -1158
- package/src/session/crypto/frames.web.ts +0 -205
- package/src/session/crypto/handshake.web.ts +0 -396
- package/src/session/crypto/identity.web.ts +0 -133
- package/src/session/crypto/keyexchange.web.ts +0 -246
- package/src/session/crypto/relay-signing.web.ts +0 -53
- package/src/session/events.ts +0 -38
- package/src/session/index.ts +0 -116
- package/src/session/reducer.ts +0 -274
- package/src/session/selectors.ts +0 -28
- package/src/session/session-name.ts +0 -50
- package/src/session/types.ts +0 -101
- package/src/session/useBundleRefreshAttachFlow.ts +0 -608
- package/src/session/useRemoteSessionClient.ts +0 -424
- package/src/session/useSessionEngine.ts +0 -432
- package/src/session/workspace-shell-hooks.ts +0 -35
- package/src/tui/__tests__/input-text.test.ts +0 -24
- package/src/tui/__tests__/local-terminal-sync.test.ts +0 -82
- package/src/tui/__tests__/session-terminal-page-navigation.test.ts +0 -94
- package/src/tui/app.tsx +0 -2
- package/src/tui/index.ts +0 -18
- package/src/tui/input-text.ts +0 -38
- package/src/tui/local-terminal-sync.ts +0 -41
- package/src/types/bundle-refresh.ts +0 -42
- package/src/types/bundle.ts +0 -130
- package/src/types/config.ts +0 -287
- package/src/types/errors.ts +0 -292
- package/src/types/events.ts +0 -91
- package/src/types/identity.ts +0 -284
- package/src/types/processes.ts +0 -45
- package/src/types/review.ts +0 -349
- package/src/types/script-phase.ts +0 -3
- package/src/types/workspace-fuzzy.ts +0 -49
- package/src/types/workspace.ts +0 -151
- package/src/utils/__tests__/onboarding.test.ts +0 -358
- package/src/utils/__tests__/run-scripts.test.ts +0 -535
- package/src/utils/__tests__/run-workspace-scripts.test.ts +0 -406
- package/src/utils/__tests__/workspace-setup.integration.test.ts +0 -633
- package/src/utils/__tests__/workspace-state.test.ts +0 -78
- package/src/utils/bun-socket-writer.ts +0 -80
- package/src/utils/clipboard.ts +0 -53
- package/src/utils/deps.test.ts +0 -31
- package/src/utils/deps.ts +0 -145
- package/src/utils/device.web.ts +0 -163
- package/src/utils/fuzzy-match.ts +0 -125
- package/src/utils/hostnames.ts +0 -43
- package/src/utils/hunk-header.ts +0 -17
- package/src/utils/id.ts +0 -9
- package/src/utils/logger.ts +0 -127
- package/src/utils/markdown.ts +0 -254
- package/src/utils/normalize-env-key.ts +0 -13
- package/src/utils/onboarding.ts +0 -279
- package/src/utils/prompts.ts +0 -176
- package/src/utils/run-commands.ts +0 -112
- package/src/utils/run-scripts.ts +0 -337
- package/src/utils/run-workspace-scripts.ts +0 -355
- package/src/utils/sanitize.test.ts +0 -149
- package/src/utils/sanitize.ts +0 -162
- package/src/utils/secrets.ts +0 -836
- package/src/utils/shell-escape.ts +0 -40
- package/src/utils/utf8.ts +0 -79
- package/src/utils/workspace-id.ts +0 -55
- package/src/utils/workspace-state.ts +0 -427
- package/src/version.generated.d.ts +0 -2
- package/todo-security.md +0 -92
- package/tsconfig.json +0 -29
- package/web/README.md +0 -73
- package/web/bun.lock +0 -675
- package/web/eslint.config.js +0 -23
- package/web/index.css +0 -249
- package/web/index.html +0 -16
- package/web/main.tsx +0 -10
- package/web/package.json +0 -39
- package/web/public/vite.svg +0 -1
- package/web/tsconfig.app.json +0 -35
- package/web/tsconfig.json +0 -7
- package/web/tsconfig.node.json +0 -26
- package/web/vite.config.ts +0 -39
- package/worker/bun.lock +0 -237
- package/worker/package.json +0 -22
- package/worker/schema.sql +0 -96
- package/worker/src/handlers/auth.ts +0 -451
- package/worker/src/handlers/subdomains.ts +0 -376
- package/worker/src/handlers/user.ts +0 -98
- package/worker/src/index.ts +0 -70
- package/worker/src/middleware/auth.ts +0 -152
- package/worker/src/services/cloudflare.ts +0 -609
- package/worker/src/types.ts +0 -96
- package/worker/tsconfig.json +0 -15
- package/worker/wrangler.toml +0 -26
|
@@ -1,798 +0,0 @@
|
|
|
1
|
-
/** @jsxImportSource react */
|
|
2
|
-
/**
|
|
3
|
-
* ThreadPanel — right-side panel listing all review threads.
|
|
4
|
-
*
|
|
5
|
-
* Shows thread targets, decisions, comments, and allows:
|
|
6
|
-
* - Resolving/unresolving threads
|
|
7
|
-
* - Adding replies
|
|
8
|
-
* - Editing/deleting own comments
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { Fragment, useState, useCallback, useEffect, useMemo, useRef, type ReactNode } from 'react';
|
|
12
|
-
import type { ReviewThread, HunkDecision } from '../types/review.js';
|
|
13
|
-
import type { HunkFocusTarget } from './DiffViewer.web.js';
|
|
14
|
-
import { normalizeHunkHeader } from '../utils/hunk-header.js';
|
|
15
|
-
import { REVIEW_DECISION_COLORS } from './review-decision-colors.js';
|
|
16
|
-
|
|
17
|
-
export interface ThreadPanelProps {
|
|
18
|
-
threads: ReviewThread[];
|
|
19
|
-
currentFilePath?: string | null;
|
|
20
|
-
hunkFocus?: HunkFocusTarget | null;
|
|
21
|
-
filterMode?: 'all' | 'current-file' | 'current-hunk';
|
|
22
|
-
onFilterModeChange?: (mode: 'all' | 'current-file' | 'current-hunk') => void;
|
|
23
|
-
selectedThreadId?: string | null;
|
|
24
|
-
hoveredThreadId?: string | null;
|
|
25
|
-
onResolveThread: (threadId: string, resolved: boolean) => Promise<void>;
|
|
26
|
-
onAddReply: (threadId: string, body: string) => Promise<void>;
|
|
27
|
-
onUpdateComment: (threadId: string, commentId: string, body: string) => Promise<void>;
|
|
28
|
-
onDeleteComment: (threadId: string, commentId: string) => Promise<void>;
|
|
29
|
-
onUpdateDecision: (threadId: string, decision: HunkDecision) => Promise<void>;
|
|
30
|
-
onOpenThreadTarget?: (threadId: string) => void;
|
|
31
|
-
onClose?: () => void;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const SAFE_LINK_SCHEMES = new Set(['http', 'https', 'mailto', 'tel']);
|
|
35
|
-
|
|
36
|
-
function isSafeMarkdownHref(href: string): boolean {
|
|
37
|
-
const trimmed = href.trim();
|
|
38
|
-
if (!trimmed) {
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (trimmed.startsWith('//')) {
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (
|
|
47
|
-
trimmed.startsWith('#') ||
|
|
48
|
-
trimmed.startsWith('/') ||
|
|
49
|
-
trimmed.startsWith('./') ||
|
|
50
|
-
trimmed.startsWith('../')
|
|
51
|
-
) {
|
|
52
|
-
return true;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const scheme = trimmed.match(/^([a-zA-Z][a-zA-Z\d+.-]*):/);
|
|
56
|
-
if (!scheme?.[1]) {
|
|
57
|
-
// Relative paths without a URI scheme are safe.
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return SAFE_LINK_SCHEMES.has(scheme[1].toLowerCase());
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function formatDate(iso: string): string {
|
|
65
|
-
try {
|
|
66
|
-
const d = new Date(iso);
|
|
67
|
-
return d.toLocaleDateString('en-US', { month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit' });
|
|
68
|
-
} catch {
|
|
69
|
-
return iso;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function targetLabel(thread: ReviewThread): string {
|
|
74
|
-
const t = thread.target;
|
|
75
|
-
if (t.kind === 'hunk') return `Hunk · ${t.file.split('/').pop()}`;
|
|
76
|
-
if (t.kind === 'line') return `L${t.startLine}–${t.endLine} · ${t.file.split('/').pop()}`;
|
|
77
|
-
if (t.kind === 'file') return `File · ${t.file.split('/').pop()}`;
|
|
78
|
-
return 'Overall';
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function renderMarkdownInline(text: string, keyPrefix: string): ReactNode[] {
|
|
82
|
-
const tokenPattern = /(\[[^\]]+\]\([^\)]+\)|`[^`]+`|\*\*[^*]+\*\*|\*[^*]+\*)/g;
|
|
83
|
-
const tokens = text.split(tokenPattern);
|
|
84
|
-
|
|
85
|
-
return tokens.map((token, index) => {
|
|
86
|
-
const key = `${keyPrefix}-inline-${index}`;
|
|
87
|
-
|
|
88
|
-
if (token.startsWith('`') && token.endsWith('`')) {
|
|
89
|
-
return (
|
|
90
|
-
<code key={key} style={{
|
|
91
|
-
fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Consolas, monospace',
|
|
92
|
-
fontSize: '11px',
|
|
93
|
-
background: '#0d1117',
|
|
94
|
-
border: '1px solid #30363d',
|
|
95
|
-
borderRadius: '3px',
|
|
96
|
-
padding: '0 4px',
|
|
97
|
-
color: '#c9d1d9',
|
|
98
|
-
}}>
|
|
99
|
-
{token.slice(1, -1)}
|
|
100
|
-
</code>
|
|
101
|
-
);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
if (token.startsWith('**') && token.endsWith('**')) {
|
|
105
|
-
return <strong key={key}>{token.slice(2, -2)}</strong>;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
if (token.startsWith('*') && token.endsWith('*')) {
|
|
109
|
-
return <em key={key}>{token.slice(1, -1)}</em>;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
const linkMatch = token.match(/^\[([^\]]+)\]\(([^\)]+)\)$/);
|
|
113
|
-
if (linkMatch) {
|
|
114
|
-
const label = linkMatch[1] ?? token;
|
|
115
|
-
const href = linkMatch[2] ?? '#';
|
|
116
|
-
if (!isSafeMarkdownHref(href)) {
|
|
117
|
-
return <Fragment key={key}>{label}</Fragment>;
|
|
118
|
-
}
|
|
119
|
-
return (
|
|
120
|
-
<a
|
|
121
|
-
key={key}
|
|
122
|
-
href={href}
|
|
123
|
-
target="_blank"
|
|
124
|
-
rel="noopener noreferrer"
|
|
125
|
-
style={{ color: '#58a6ff' }}
|
|
126
|
-
>
|
|
127
|
-
{label}
|
|
128
|
-
</a>
|
|
129
|
-
);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
return <Fragment key={key}>{token}</Fragment>;
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
function renderMarkdownBody(markdown: string, keyPrefix: string): ReactNode[] {
|
|
137
|
-
const lines = markdown.replace(/\r/g, '').split('\n');
|
|
138
|
-
const nodes: ReactNode[] = [];
|
|
139
|
-
let paragraph: string[] = [];
|
|
140
|
-
let listItems: string[] = [];
|
|
141
|
-
let inCodeBlock = false;
|
|
142
|
-
let codeLines: string[] = [];
|
|
143
|
-
|
|
144
|
-
const flushParagraph = () => {
|
|
145
|
-
if (paragraph.length === 0) return;
|
|
146
|
-
const text = paragraph.join(' ');
|
|
147
|
-
nodes.push(
|
|
148
|
-
<p key={`${keyPrefix}-p-${nodes.length}`} style={{ margin: '0 0 6px 0' }}>
|
|
149
|
-
{renderMarkdownInline(text, `${keyPrefix}-p-${nodes.length}`)}
|
|
150
|
-
</p>
|
|
151
|
-
);
|
|
152
|
-
paragraph = [];
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
const flushList = () => {
|
|
156
|
-
if (listItems.length === 0) return;
|
|
157
|
-
nodes.push(
|
|
158
|
-
<ul key={`${keyPrefix}-ul-${nodes.length}`} style={{ margin: '0 0 6px 16px', padding: 0 }}>
|
|
159
|
-
{listItems.map((item, index) => (
|
|
160
|
-
<li key={`${keyPrefix}-li-${index}`} style={{ marginBottom: '2px' }}>
|
|
161
|
-
{renderMarkdownInline(item, `${keyPrefix}-li-${index}`)}
|
|
162
|
-
</li>
|
|
163
|
-
))}
|
|
164
|
-
</ul>
|
|
165
|
-
);
|
|
166
|
-
listItems = [];
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
const flushCodeBlock = () => {
|
|
170
|
-
if (codeLines.length === 0) return;
|
|
171
|
-
nodes.push(
|
|
172
|
-
<pre key={`${keyPrefix}-code-${nodes.length}`} style={{
|
|
173
|
-
margin: '0 0 6px 0',
|
|
174
|
-
padding: '8px',
|
|
175
|
-
borderRadius: '6px',
|
|
176
|
-
background: '#0d1117',
|
|
177
|
-
border: '1px solid #30363d',
|
|
178
|
-
overflowX: 'auto',
|
|
179
|
-
}}>
|
|
180
|
-
<code style={{ fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Consolas, monospace', fontSize: '11px' }}>
|
|
181
|
-
{codeLines.join('\n')}
|
|
182
|
-
</code>
|
|
183
|
-
</pre>
|
|
184
|
-
);
|
|
185
|
-
codeLines = [];
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
for (const line of lines) {
|
|
189
|
-
if (line.trim().startsWith('```')) {
|
|
190
|
-
flushParagraph();
|
|
191
|
-
flushList();
|
|
192
|
-
if (inCodeBlock) {
|
|
193
|
-
flushCodeBlock();
|
|
194
|
-
}
|
|
195
|
-
inCodeBlock = !inCodeBlock;
|
|
196
|
-
continue;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
if (inCodeBlock) {
|
|
200
|
-
codeLines.push(line);
|
|
201
|
-
continue;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
if (!line.trim()) {
|
|
205
|
-
flushParagraph();
|
|
206
|
-
flushList();
|
|
207
|
-
continue;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
if (line.trimStart().startsWith('- ')) {
|
|
211
|
-
flushParagraph();
|
|
212
|
-
listItems.push(line.trimStart().slice(2));
|
|
213
|
-
continue;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
paragraph.push(line.trim());
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
flushParagraph();
|
|
220
|
-
flushList();
|
|
221
|
-
flushCodeBlock();
|
|
222
|
-
|
|
223
|
-
if (nodes.length === 0) {
|
|
224
|
-
nodes.push(<p key={`${keyPrefix}-empty`} style={{ margin: 0 }} />);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
return nodes;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
export function ThreadPanel({
|
|
231
|
-
threads,
|
|
232
|
-
currentFilePath,
|
|
233
|
-
hunkFocus,
|
|
234
|
-
filterMode = 'all',
|
|
235
|
-
onFilterModeChange,
|
|
236
|
-
selectedThreadId,
|
|
237
|
-
hoveredThreadId,
|
|
238
|
-
onResolveThread,
|
|
239
|
-
onAddReply,
|
|
240
|
-
onUpdateComment,
|
|
241
|
-
onDeleteComment,
|
|
242
|
-
onUpdateDecision,
|
|
243
|
-
onOpenThreadTarget,
|
|
244
|
-
onClose,
|
|
245
|
-
}: ThreadPanelProps) {
|
|
246
|
-
const [replyingTo, setReplyingTo] = useState<string | null>(null);
|
|
247
|
-
const [replyBody, setReplyBody] = useState('');
|
|
248
|
-
const [editingComment, setEditingComment] = useState<{ threadId: string; commentId: string; body: string } | null>(null);
|
|
249
|
-
const [submitting, setSubmitting] = useState(false);
|
|
250
|
-
const threadRefs = useRef<Record<string, HTMLDivElement | null>>({});
|
|
251
|
-
|
|
252
|
-
const visibleThreads = useMemo(() => {
|
|
253
|
-
if (filterMode === 'current-file' && currentFilePath) {
|
|
254
|
-
return threads.filter((thread) => {
|
|
255
|
-
if (thread.target.kind === 'workspace') {
|
|
256
|
-
return true;
|
|
257
|
-
}
|
|
258
|
-
return thread.target.file === currentFilePath;
|
|
259
|
-
});
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
if (filterMode === 'current-hunk' && hunkFocus) {
|
|
263
|
-
return threads.filter((thread) => {
|
|
264
|
-
if (thread.target.kind === 'hunk') {
|
|
265
|
-
return (
|
|
266
|
-
thread.target.file === hunkFocus.filePath &&
|
|
267
|
-
normalizeHunkHeader(thread.target.hunkHeader) === normalizeHunkHeader(hunkFocus.hunkHeader)
|
|
268
|
-
);
|
|
269
|
-
}
|
|
270
|
-
if (thread.target.kind === 'line') {
|
|
271
|
-
return doesLineThreadOverlapHunk(thread, hunkFocus);
|
|
272
|
-
}
|
|
273
|
-
return false;
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
return threads;
|
|
278
|
-
}, [currentFilePath, filterMode, hunkFocus, threads]);
|
|
279
|
-
|
|
280
|
-
useEffect(() => {
|
|
281
|
-
const focusId = hoveredThreadId ?? selectedThreadId;
|
|
282
|
-
if (!focusId) return;
|
|
283
|
-
|
|
284
|
-
const el = threadRefs.current[focusId];
|
|
285
|
-
if (!el) return;
|
|
286
|
-
|
|
287
|
-
el.scrollIntoView({ block: 'nearest', behavior: 'smooth' });
|
|
288
|
-
}, [hoveredThreadId, selectedThreadId]);
|
|
289
|
-
|
|
290
|
-
const handleAddReply = useCallback(async (threadId: string) => {
|
|
291
|
-
if (!replyBody.trim()) return;
|
|
292
|
-
setSubmitting(true);
|
|
293
|
-
try {
|
|
294
|
-
await onAddReply(threadId, replyBody.trim());
|
|
295
|
-
setReplyBody('');
|
|
296
|
-
setReplyingTo(null);
|
|
297
|
-
} catch {
|
|
298
|
-
// Error is surfaced via review hook state; avoid unhandled promise rejections.
|
|
299
|
-
} finally {
|
|
300
|
-
setSubmitting(false);
|
|
301
|
-
}
|
|
302
|
-
}, [replyBody, onAddReply]);
|
|
303
|
-
|
|
304
|
-
const handleSaveEdit = useCallback(async () => {
|
|
305
|
-
if (!editingComment || !editingComment.body.trim()) return;
|
|
306
|
-
setSubmitting(true);
|
|
307
|
-
try {
|
|
308
|
-
await onUpdateComment(editingComment.threadId, editingComment.commentId, editingComment.body.trim());
|
|
309
|
-
setEditingComment(null);
|
|
310
|
-
} catch {
|
|
311
|
-
// Error is surfaced via review hook state; avoid unhandled promise rejections.
|
|
312
|
-
} finally {
|
|
313
|
-
setSubmitting(false);
|
|
314
|
-
}
|
|
315
|
-
}, [editingComment, onUpdateComment]);
|
|
316
|
-
|
|
317
|
-
if (visibleThreads.length === 0) {
|
|
318
|
-
return (
|
|
319
|
-
<div style={{
|
|
320
|
-
height: '100%',
|
|
321
|
-
display: 'flex',
|
|
322
|
-
flexDirection: 'column',
|
|
323
|
-
background: '#0d1117',
|
|
324
|
-
borderLeft: '1px solid #30363d',
|
|
325
|
-
}}>
|
|
326
|
-
<div style={{
|
|
327
|
-
padding: '12px 16px',
|
|
328
|
-
borderBottom: '1px solid #30363d',
|
|
329
|
-
display: 'flex',
|
|
330
|
-
alignItems: 'center',
|
|
331
|
-
justifyContent: 'space-between',
|
|
332
|
-
}}>
|
|
333
|
-
<span style={{ fontSize: '13px', fontWeight: 600, color: '#e6edf3' }}>Review Threads</span>
|
|
334
|
-
{onClose && (
|
|
335
|
-
<button onClick={onClose} style={{ background: 'none', border: 'none', color: '#8b949e', cursor: 'pointer', fontSize: '16px' }}>×</button>
|
|
336
|
-
)}
|
|
337
|
-
</div>
|
|
338
|
-
<div style={{ flex: 1, display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#8b949e', fontSize: '13px' }}>
|
|
339
|
-
{filterMode === 'current-file'
|
|
340
|
-
? 'No threads for the current file.'
|
|
341
|
-
: filterMode === 'current-hunk'
|
|
342
|
-
? 'No threads for the selected hunk.'
|
|
343
|
-
: 'No threads yet. Click a diff line or hunk to add a comment.'}
|
|
344
|
-
</div>
|
|
345
|
-
</div>
|
|
346
|
-
);
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
return (
|
|
350
|
-
<div style={{
|
|
351
|
-
height: '100%',
|
|
352
|
-
display: 'flex',
|
|
353
|
-
flexDirection: 'column',
|
|
354
|
-
background: '#0d1117',
|
|
355
|
-
borderLeft: '1px solid #30363d',
|
|
356
|
-
overflow: 'hidden',
|
|
357
|
-
}}>
|
|
358
|
-
{/* Header */}
|
|
359
|
-
<div style={{
|
|
360
|
-
padding: '12px 16px',
|
|
361
|
-
borderBottom: '1px solid #30363d',
|
|
362
|
-
display: 'flex',
|
|
363
|
-
alignItems: 'center',
|
|
364
|
-
justifyContent: 'space-between',
|
|
365
|
-
flexShrink: 0,
|
|
366
|
-
}}>
|
|
367
|
-
<span style={{ fontSize: '13px', fontWeight: 600, color: '#e6edf3' }}>
|
|
368
|
-
Review Threads
|
|
369
|
-
<span style={{ marginLeft: '8px', fontSize: '11px', color: '#8b949e', fontWeight: 400 }}>
|
|
370
|
-
({visibleThreads.filter((t) => !t.resolved).length} open)
|
|
371
|
-
</span>
|
|
372
|
-
</span>
|
|
373
|
-
<div style={{ display: 'flex', alignItems: 'center', gap: '6px' }}>
|
|
374
|
-
<button
|
|
375
|
-
onClick={() => onFilterModeChange?.('all')}
|
|
376
|
-
style={{
|
|
377
|
-
fontSize: '10px',
|
|
378
|
-
padding: '2px 8px',
|
|
379
|
-
borderRadius: '999px',
|
|
380
|
-
border: '1px solid #30363d',
|
|
381
|
-
background: filterMode === 'all' ? '#1f6feb33' : '#21262d',
|
|
382
|
-
color: filterMode === 'all' ? '#58a6ff' : '#8b949e',
|
|
383
|
-
cursor: 'pointer',
|
|
384
|
-
}}
|
|
385
|
-
>
|
|
386
|
-
All
|
|
387
|
-
</button>
|
|
388
|
-
<button
|
|
389
|
-
onClick={() => onFilterModeChange?.('current-file')}
|
|
390
|
-
disabled={!currentFilePath}
|
|
391
|
-
style={{
|
|
392
|
-
fontSize: '10px',
|
|
393
|
-
padding: '2px 8px',
|
|
394
|
-
borderRadius: '999px',
|
|
395
|
-
border: '1px solid #30363d',
|
|
396
|
-
background: filterMode === 'current-file' ? '#1f6feb33' : '#21262d',
|
|
397
|
-
color: filterMode === 'current-file' ? '#58a6ff' : '#8b949e',
|
|
398
|
-
cursor: currentFilePath ? 'pointer' : 'not-allowed',
|
|
399
|
-
}}
|
|
400
|
-
>
|
|
401
|
-
Current file
|
|
402
|
-
</button>
|
|
403
|
-
<button
|
|
404
|
-
onClick={() => onFilterModeChange?.('current-hunk')}
|
|
405
|
-
disabled={!hunkFocus}
|
|
406
|
-
style={{
|
|
407
|
-
fontSize: '10px',
|
|
408
|
-
padding: '2px 8px',
|
|
409
|
-
borderRadius: '999px',
|
|
410
|
-
border: '1px solid #30363d',
|
|
411
|
-
background: filterMode === 'current-hunk' ? '#1f6feb33' : '#21262d',
|
|
412
|
-
color: filterMode === 'current-hunk' ? '#58a6ff' : '#8b949e',
|
|
413
|
-
cursor: hunkFocus ? 'pointer' : 'not-allowed',
|
|
414
|
-
}}
|
|
415
|
-
>
|
|
416
|
-
Current hunk
|
|
417
|
-
</button>
|
|
418
|
-
{onClose && (
|
|
419
|
-
<button
|
|
420
|
-
onClick={onClose}
|
|
421
|
-
style={{ background: 'none', border: 'none', color: '#8b949e', cursor: 'pointer', fontSize: '16px', padding: '0 4px' }}
|
|
422
|
-
>
|
|
423
|
-
×
|
|
424
|
-
</button>
|
|
425
|
-
)}
|
|
426
|
-
</div>
|
|
427
|
-
</div>
|
|
428
|
-
|
|
429
|
-
{filterMode === 'current-hunk' && hunkFocus && (
|
|
430
|
-
<div style={{
|
|
431
|
-
padding: '8px 12px',
|
|
432
|
-
borderBottom: '1px solid #21262d',
|
|
433
|
-
fontSize: '11px',
|
|
434
|
-
color: '#8b949e',
|
|
435
|
-
background: '#11161d',
|
|
436
|
-
display: 'flex',
|
|
437
|
-
gap: '6px',
|
|
438
|
-
alignItems: 'center',
|
|
439
|
-
}}>
|
|
440
|
-
<span style={{ color: '#58a6ff', fontWeight: 600 }}>Hunk filter</span>
|
|
441
|
-
<span style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
|
|
442
|
-
{normalizeHunkHeader(hunkFocus.hunkHeader)}
|
|
443
|
-
</span>
|
|
444
|
-
<button
|
|
445
|
-
onClick={() => onFilterModeChange?.('all')}
|
|
446
|
-
style={{
|
|
447
|
-
marginLeft: 'auto',
|
|
448
|
-
fontSize: '10px',
|
|
449
|
-
padding: '1px 6px',
|
|
450
|
-
borderRadius: '3px',
|
|
451
|
-
border: '1px solid #30363d',
|
|
452
|
-
background: '#21262d',
|
|
453
|
-
color: '#8b949e',
|
|
454
|
-
cursor: 'pointer',
|
|
455
|
-
}}
|
|
456
|
-
>
|
|
457
|
-
Clear
|
|
458
|
-
</button>
|
|
459
|
-
</div>
|
|
460
|
-
)}
|
|
461
|
-
|
|
462
|
-
{/* Thread list */}
|
|
463
|
-
<div style={{ flex: 1, overflowY: 'auto' }}>
|
|
464
|
-
{visibleThreads.map((thread) => {
|
|
465
|
-
const isSelected = thread.id === selectedThreadId;
|
|
466
|
-
const isHovered = thread.id === hoveredThreadId;
|
|
467
|
-
const decision = thread.decision;
|
|
468
|
-
|
|
469
|
-
return (
|
|
470
|
-
<div
|
|
471
|
-
key={thread.id}
|
|
472
|
-
ref={(el) => { threadRefs.current[thread.id] = el; }}
|
|
473
|
-
style={{
|
|
474
|
-
borderBottom: '1px solid #21262d',
|
|
475
|
-
background: isSelected ? '#161b22' : isHovered ? '#1b2230' : 'transparent',
|
|
476
|
-
boxShadow: isHovered ? 'inset 2px 0 0 #58a6ff' : undefined,
|
|
477
|
-
}}
|
|
478
|
-
>
|
|
479
|
-
{/* Thread header */}
|
|
480
|
-
<div style={{ padding: '10px 14px 6px' }}>
|
|
481
|
-
<div style={{ display: 'flex', alignItems: 'center', gap: '8px', marginBottom: '6px' }}>
|
|
482
|
-
{/* Decision badge */}
|
|
483
|
-
{decision && (
|
|
484
|
-
<span style={{
|
|
485
|
-
fontSize: '11px',
|
|
486
|
-
padding: '1px 6px',
|
|
487
|
-
borderRadius: '10px',
|
|
488
|
-
background: REVIEW_DECISION_COLORS[decision] + '22',
|
|
489
|
-
color: REVIEW_DECISION_COLORS[decision],
|
|
490
|
-
border: `1px solid ${REVIEW_DECISION_COLORS[decision]}44`,
|
|
491
|
-
}}>
|
|
492
|
-
{decision === 'approved' ? '✓ Approved' : decision === 'rejected' ? '✗ Changes requested' : '⏳ Pending'}
|
|
493
|
-
</span>
|
|
494
|
-
)}
|
|
495
|
-
{/* Resolved badge */}
|
|
496
|
-
{thread.resolved && (
|
|
497
|
-
<span style={{ fontSize: '11px', color: '#6e7681' }}>✓ Resolved</span>
|
|
498
|
-
)}
|
|
499
|
-
<span style={{ fontSize: '11px', color: '#6e7681', marginLeft: 'auto' }}>
|
|
500
|
-
{targetLabel(thread)}
|
|
501
|
-
</span>
|
|
502
|
-
{thread.target.kind !== 'workspace' && (
|
|
503
|
-
<button
|
|
504
|
-
onClick={() => onOpenThreadTarget?.(thread.id)}
|
|
505
|
-
style={{
|
|
506
|
-
fontSize: '10px',
|
|
507
|
-
padding: '1px 6px',
|
|
508
|
-
borderRadius: '3px',
|
|
509
|
-
border: '1px solid #30363d',
|
|
510
|
-
background: '#21262d',
|
|
511
|
-
color: '#58a6ff',
|
|
512
|
-
cursor: 'pointer',
|
|
513
|
-
}}
|
|
514
|
-
>
|
|
515
|
-
Go to code
|
|
516
|
-
</button>
|
|
517
|
-
)}
|
|
518
|
-
</div>
|
|
519
|
-
|
|
520
|
-
{/* Hunk decision buttons */}
|
|
521
|
-
{thread.target.kind === 'hunk' && !thread.resolved && (
|
|
522
|
-
<div style={{ display: 'flex', gap: '6px', marginBottom: '6px' }}>
|
|
523
|
-
{(['approved', 'rejected', 'pending'] as const).map((d) => (
|
|
524
|
-
<button
|
|
525
|
-
key={d}
|
|
526
|
-
onClick={() => {
|
|
527
|
-
void onUpdateDecision(thread.id, d).catch(() => {});
|
|
528
|
-
}}
|
|
529
|
-
style={{
|
|
530
|
-
fontSize: '11px',
|
|
531
|
-
padding: '2px 8px',
|
|
532
|
-
borderRadius: '4px',
|
|
533
|
-
border: '1px solid',
|
|
534
|
-
cursor: 'pointer',
|
|
535
|
-
background: decision === d ? REVIEW_DECISION_COLORS[d] + '33' : '#21262d',
|
|
536
|
-
color: decision === d ? REVIEW_DECISION_COLORS[d] : '#8b949e',
|
|
537
|
-
borderColor: decision === d ? REVIEW_DECISION_COLORS[d] + '66' : '#30363d',
|
|
538
|
-
}}
|
|
539
|
-
>
|
|
540
|
-
{d === 'approved' ? '✓ Approve' : d === 'rejected' ? '✗ Reject' : '⏳ Pending'}
|
|
541
|
-
</button>
|
|
542
|
-
))}
|
|
543
|
-
</div>
|
|
544
|
-
)}
|
|
545
|
-
|
|
546
|
-
{/* Comments */}
|
|
547
|
-
{thread.comments.map((comment, idx) => (
|
|
548
|
-
<div
|
|
549
|
-
key={comment.id}
|
|
550
|
-
style={{
|
|
551
|
-
marginBottom: '8px',
|
|
552
|
-
paddingLeft: idx > 0 ? '12px' : 0,
|
|
553
|
-
borderLeft: idx > 0 ? '2px solid #21262d' : 'none',
|
|
554
|
-
}}
|
|
555
|
-
>
|
|
556
|
-
<div style={{ display: 'flex', alignItems: 'center', gap: '6px', marginBottom: '3px' }}>
|
|
557
|
-
<span style={{ fontSize: '12px', fontWeight: 600, color: '#58a6ff' }}>{comment.author}</span>
|
|
558
|
-
<span style={{ fontSize: '11px', color: '#6e7681' }}>{formatDate(comment.createdAt)}</span>
|
|
559
|
-
{comment.githubId && (
|
|
560
|
-
<span style={{ fontSize: '10px', color: '#6e7681' }}>· GH</span>
|
|
561
|
-
)}
|
|
562
|
-
</div>
|
|
563
|
-
|
|
564
|
-
{editingComment?.commentId === comment.id ? (
|
|
565
|
-
<div>
|
|
566
|
-
<textarea
|
|
567
|
-
value={editingComment.body}
|
|
568
|
-
onChange={(e) => setEditingComment({ ...editingComment, body: e.target.value })}
|
|
569
|
-
rows={3}
|
|
570
|
-
style={{
|
|
571
|
-
width: '100%',
|
|
572
|
-
background: '#161b22',
|
|
573
|
-
border: '1px solid #30363d',
|
|
574
|
-
borderRadius: '4px',
|
|
575
|
-
color: '#e6edf3',
|
|
576
|
-
padding: '6px',
|
|
577
|
-
fontSize: '12px',
|
|
578
|
-
resize: 'vertical',
|
|
579
|
-
boxSizing: 'border-box',
|
|
580
|
-
}}
|
|
581
|
-
autoFocus
|
|
582
|
-
/>
|
|
583
|
-
<div style={{ display: 'flex', gap: '6px', marginTop: '4px' }}>
|
|
584
|
-
<button
|
|
585
|
-
onClick={() => {
|
|
586
|
-
void handleSaveEdit().catch(() => {});
|
|
587
|
-
}}
|
|
588
|
-
disabled={submitting}
|
|
589
|
-
style={{
|
|
590
|
-
fontSize: '11px',
|
|
591
|
-
padding: '3px 10px',
|
|
592
|
-
background: '#22c55e',
|
|
593
|
-
color: '#0d1117',
|
|
594
|
-
border: 'none',
|
|
595
|
-
borderRadius: '4px',
|
|
596
|
-
cursor: 'pointer',
|
|
597
|
-
}}
|
|
598
|
-
>
|
|
599
|
-
Save
|
|
600
|
-
</button>
|
|
601
|
-
<button
|
|
602
|
-
onClick={() => setEditingComment(null)}
|
|
603
|
-
style={{
|
|
604
|
-
fontSize: '11px',
|
|
605
|
-
padding: '3px 10px',
|
|
606
|
-
background: '#21262d',
|
|
607
|
-
color: '#8b949e',
|
|
608
|
-
border: '1px solid #30363d',
|
|
609
|
-
borderRadius: '4px',
|
|
610
|
-
cursor: 'pointer',
|
|
611
|
-
}}
|
|
612
|
-
>
|
|
613
|
-
Cancel
|
|
614
|
-
</button>
|
|
615
|
-
</div>
|
|
616
|
-
</div>
|
|
617
|
-
) : (
|
|
618
|
-
<div style={{ display: 'flex', gap: '6px', alignItems: 'flex-start' }}>
|
|
619
|
-
<div style={{
|
|
620
|
-
flex: 1,
|
|
621
|
-
fontSize: '12px',
|
|
622
|
-
color: '#e6edf3',
|
|
623
|
-
margin: 0,
|
|
624
|
-
whiteSpace: 'normal',
|
|
625
|
-
wordBreak: 'break-word',
|
|
626
|
-
lineHeight: 1.45,
|
|
627
|
-
}}>
|
|
628
|
-
{renderMarkdownBody(comment.body, comment.id)}
|
|
629
|
-
</div>
|
|
630
|
-
{comment.author === 'local' && (
|
|
631
|
-
<div style={{ display: 'flex', gap: '4px', flexShrink: 0 }}>
|
|
632
|
-
<button
|
|
633
|
-
onClick={() => setEditingComment({ threadId: thread.id, commentId: comment.id, body: comment.body })}
|
|
634
|
-
style={{
|
|
635
|
-
fontSize: '10px',
|
|
636
|
-
padding: '1px 5px',
|
|
637
|
-
background: 'none',
|
|
638
|
-
color: '#6e7681',
|
|
639
|
-
border: '1px solid #30363d',
|
|
640
|
-
borderRadius: '3px',
|
|
641
|
-
cursor: 'pointer',
|
|
642
|
-
}}
|
|
643
|
-
>
|
|
644
|
-
Edit
|
|
645
|
-
</button>
|
|
646
|
-
<button
|
|
647
|
-
onClick={() => {
|
|
648
|
-
void onDeleteComment(thread.id, comment.id).catch(() => {});
|
|
649
|
-
}}
|
|
650
|
-
style={{
|
|
651
|
-
fontSize: '10px',
|
|
652
|
-
padding: '1px 5px',
|
|
653
|
-
background: 'none',
|
|
654
|
-
color: '#f85149',
|
|
655
|
-
border: '1px solid #f8514944',
|
|
656
|
-
borderRadius: '3px',
|
|
657
|
-
cursor: 'pointer',
|
|
658
|
-
}}
|
|
659
|
-
>
|
|
660
|
-
Del
|
|
661
|
-
</button>
|
|
662
|
-
</div>
|
|
663
|
-
)}
|
|
664
|
-
</div>
|
|
665
|
-
)}
|
|
666
|
-
</div>
|
|
667
|
-
))}
|
|
668
|
-
|
|
669
|
-
{/* Reply form */}
|
|
670
|
-
{replyingTo === thread.id ? (
|
|
671
|
-
<div style={{ marginTop: '6px' }}>
|
|
672
|
-
<textarea
|
|
673
|
-
value={replyBody}
|
|
674
|
-
onChange={(e) => setReplyBody(e.target.value)}
|
|
675
|
-
placeholder="Write a reply..."
|
|
676
|
-
rows={2}
|
|
677
|
-
style={{
|
|
678
|
-
width: '100%',
|
|
679
|
-
background: '#161b22',
|
|
680
|
-
border: '1px solid #30363d',
|
|
681
|
-
borderRadius: '4px',
|
|
682
|
-
color: '#e6edf3',
|
|
683
|
-
padding: '6px',
|
|
684
|
-
fontSize: '12px',
|
|
685
|
-
resize: 'vertical',
|
|
686
|
-
boxSizing: 'border-box',
|
|
687
|
-
}}
|
|
688
|
-
autoFocus
|
|
689
|
-
onKeyDown={(e) => {
|
|
690
|
-
if (e.key === 'Escape') { setReplyingTo(null); setReplyBody(''); }
|
|
691
|
-
if (e.key === 'Enter' && (e.metaKey || e.ctrlKey)) {
|
|
692
|
-
void handleAddReply(thread.id).catch(() => {});
|
|
693
|
-
}
|
|
694
|
-
}}
|
|
695
|
-
/>
|
|
696
|
-
<div style={{ display: 'flex', gap: '6px', marginTop: '4px' }}>
|
|
697
|
-
<button
|
|
698
|
-
onClick={() => {
|
|
699
|
-
void handleAddReply(thread.id).catch(() => {});
|
|
700
|
-
}}
|
|
701
|
-
disabled={submitting || !replyBody.trim()}
|
|
702
|
-
style={{
|
|
703
|
-
fontSize: '11px',
|
|
704
|
-
padding: '3px 10px',
|
|
705
|
-
background: '#22c55e',
|
|
706
|
-
color: '#0d1117',
|
|
707
|
-
border: 'none',
|
|
708
|
-
borderRadius: '4px',
|
|
709
|
-
cursor: 'pointer',
|
|
710
|
-
}}
|
|
711
|
-
>
|
|
712
|
-
Reply
|
|
713
|
-
</button>
|
|
714
|
-
<button
|
|
715
|
-
onClick={() => { setReplyingTo(null); setReplyBody(''); }}
|
|
716
|
-
style={{
|
|
717
|
-
fontSize: '11px',
|
|
718
|
-
padding: '3px 10px',
|
|
719
|
-
background: '#21262d',
|
|
720
|
-
color: '#8b949e',
|
|
721
|
-
border: '1px solid #30363d',
|
|
722
|
-
borderRadius: '4px',
|
|
723
|
-
cursor: 'pointer',
|
|
724
|
-
}}
|
|
725
|
-
>
|
|
726
|
-
Cancel
|
|
727
|
-
</button>
|
|
728
|
-
</div>
|
|
729
|
-
</div>
|
|
730
|
-
) : (
|
|
731
|
-
<div style={{ display: 'flex', gap: '6px', marginTop: '6px' }}>
|
|
732
|
-
<button
|
|
733
|
-
onClick={() => { setReplyingTo(thread.id); setReplyBody(''); }}
|
|
734
|
-
style={{
|
|
735
|
-
fontSize: '11px',
|
|
736
|
-
padding: '2px 8px',
|
|
737
|
-
background: 'none',
|
|
738
|
-
color: '#58a6ff',
|
|
739
|
-
border: '1px solid #30363d',
|
|
740
|
-
borderRadius: '4px',
|
|
741
|
-
cursor: 'pointer',
|
|
742
|
-
}}
|
|
743
|
-
>
|
|
744
|
-
Reply
|
|
745
|
-
</button>
|
|
746
|
-
<button
|
|
747
|
-
onClick={() => {
|
|
748
|
-
void onResolveThread(thread.id, !thread.resolved).catch(() => {});
|
|
749
|
-
}}
|
|
750
|
-
style={{
|
|
751
|
-
fontSize: '11px',
|
|
752
|
-
padding: '2px 8px',
|
|
753
|
-
background: 'none',
|
|
754
|
-
color: thread.resolved ? '#6e7681' : '#22c55e',
|
|
755
|
-
border: '1px solid #30363d',
|
|
756
|
-
borderRadius: '4px',
|
|
757
|
-
cursor: 'pointer',
|
|
758
|
-
}}
|
|
759
|
-
>
|
|
760
|
-
{thread.resolved ? 'Re-open' : 'Resolve'}
|
|
761
|
-
</button>
|
|
762
|
-
</div>
|
|
763
|
-
)}
|
|
764
|
-
</div>
|
|
765
|
-
</div>
|
|
766
|
-
);
|
|
767
|
-
})}
|
|
768
|
-
</div>
|
|
769
|
-
</div>
|
|
770
|
-
);
|
|
771
|
-
}
|
|
772
|
-
|
|
773
|
-
function doesLineThreadOverlapHunk(thread: ReviewThread, hunkFocus: HunkFocusTarget): boolean {
|
|
774
|
-
if (thread.target.kind !== 'line' || thread.target.file !== hunkFocus.filePath) {
|
|
775
|
-
return false;
|
|
776
|
-
}
|
|
777
|
-
|
|
778
|
-
if (thread.target.side === 'LEFT') {
|
|
779
|
-
if (hunkFocus.oldEnd < hunkFocus.oldStart) {
|
|
780
|
-
return false;
|
|
781
|
-
}
|
|
782
|
-
return rangesOverlap(thread.target.startLine, thread.target.endLine, hunkFocus.oldStart, hunkFocus.oldEnd);
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
if (hunkFocus.newEnd < hunkFocus.newStart) {
|
|
786
|
-
return false;
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
return rangesOverlap(thread.target.startLine, thread.target.endLine, hunkFocus.newStart, hunkFocus.newEnd);
|
|
790
|
-
}
|
|
791
|
-
|
|
792
|
-
function rangesOverlap(startA: number, endA: number, startB: number, endB: number): boolean {
|
|
793
|
-
const minA = Math.min(startA, endA);
|
|
794
|
-
const maxA = Math.max(startA, endA);
|
|
795
|
-
const minB = Math.min(startB, endB);
|
|
796
|
-
const maxB = Math.max(startB, endB);
|
|
797
|
-
return Math.max(minA, minB) <= Math.min(maxA, maxB);
|
|
798
|
-
}
|