gitspace 0.2.0-rc.2 → 0.2.0-rc.20
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/.claude/settings.local.json +4 -15
- package/.gitspace/events.json +11 -0
- package/.gitspace/processes.json +23 -0
- package/.gitspace/{select → scripts/select}/01-status.sh +6 -7
- package/AGENTS.md +58 -28
- package/README.md +68 -38
- package/bun.lock +199 -52
- package/docs/CONNECTION.md +1 -1
- package/docs/QUICKSTART.md +11 -2
- package/docs/REMOTE-DESIGN.md +15 -10
- package/docs/ROADMAP.md +1 -1
- package/docs/SITE_DOCS_FIGMA_MAKE.md +63 -54
- package/docs/UNIFIED_ARCHITECTURE.md +135 -289
- package/landing-page/src/components/docs/DocsContent.tsx +106 -23
- package/landing-page/src/components/docs/DocsSidebar.tsx +7 -1
- package/landing-page/src/components/landing/CTA.tsx +1 -1
- package/landing-page/src/components/landing/Features.tsx +2 -2
- package/landing-page/src/components/landing/UseCases.tsx +1 -1
- package/package.json +30 -24
- package/scripts/GHOSTTY_TAB_BUG.md +106 -0
- package/scripts/build.ts +3 -3
- package/scripts/migrate-secrets.ts +77 -0
- package/scripts/sample-events.ts +263 -0
- package/scripts/test-tabs-minimal.ts +68 -0
- package/scripts/test-tabs-workaround.ts +95 -0
- package/scripts/test-tabs.ts +171 -0
- package/src/app/input/__tests__/sessionCommands.test.ts +40 -0
- package/src/app/input/sessionCommands.ts +94 -0
- package/src/app/session/__tests__/useAttachController.test.ts +229 -0
- package/src/app/session/createSessionBackend.bun.ts +76 -0
- package/src/app/session/createSessionBackend.web.ts +104 -0
- package/src/app/session/types.ts +16 -0
- package/src/app/session/useAttachController.ts +220 -0
- package/src/app/session/useProcessActions.ts +201 -0
- package/src/app/session/useSessionClient.ts +35 -0
- package/src/app/session/useWorkspaceDeleteFlow.ts +170 -0
- package/src/app.tui.tsx +2929 -0
- package/src/app.web.tsx +1454 -0
- package/src/commands/__tests__/connect-key.test.ts +10 -0
- package/src/commands/__tests__/events.test.ts +201 -0
- package/src/commands/__tests__/notifications.test.ts +349 -0
- package/src/commands/__tests__/process.test.ts +251 -0
- package/src/commands/__tests__/serve-process-hosting.test.ts +63 -0
- package/src/commands/add.ts +78 -75
- package/src/commands/auth.ts +5 -0
- package/src/commands/bundle.ts +232 -0
- package/src/commands/config.ts +242 -0
- package/src/commands/connect-key.ts +1 -0
- package/src/commands/connect.ts +363 -74
- package/src/commands/events.ts +157 -0
- package/src/commands/host.ts +183 -13
- package/src/commands/linear.ts +717 -0
- package/src/commands/list.ts +6 -25
- package/src/commands/migrate.ts +52 -0
- package/src/commands/notifications.ts +351 -0
- package/src/commands/process.ts +104 -0
- package/src/commands/remove.ts +88 -50
- package/src/commands/review.ts +787 -0
- package/src/commands/serve.ts +475 -22
- package/src/commands/share.ts +0 -5
- package/src/commands/switch.ts +9 -1
- package/src/components/DPad.web.tsx +343 -0
- package/src/components/DiffViewer.web.tsx +1192 -0
- package/src/components/Events.tsx +137 -0
- package/src/components/Events.tui.tsx +129 -0
- package/src/components/Events.web.tsx +386 -0
- package/src/components/FloatingControls.web.tsx +112 -0
- package/src/components/FloatingJogWheel.web.tsx +240 -0
- package/src/{shared/components → components}/Flow.tsx +12 -7
- package/src/{shared/components → components}/Flow.web.tsx +53 -53
- package/src/{shared/components → components}/Inbox.tsx +3 -1
- package/src/{shared/components → components}/Inbox.web.tsx +32 -32
- package/src/{shared/components → components}/MachineList.tsx +4 -4
- package/src/{shared/components → components}/MachineList.web.tsx +27 -27
- package/src/components/NumPad.web.tsx +270 -0
- package/src/{shared/components → components}/ProjectList.tsx +4 -5
- package/src/components/ProjectOnboardingStep.ts +23 -0
- package/src/components/ProjectOnboardingStep.tui.tsx +88 -0
- package/src/components/ProjectOnboardingStep.web.tsx +59 -0
- package/src/components/RemoteMachineScreen.tui.tsx +690 -0
- package/src/components/ScriptTerminal.tui.tsx +160 -0
- package/src/components/ScriptTerminal.web.tsx +89 -0
- package/src/components/SessionTerminal.tui.tsx +406 -0
- package/src/components/SessionTerminal.web.tsx +467 -0
- package/src/components/SpacesBrowser.tsx +540 -0
- package/src/{shared/components → components}/SpacesBrowser.tui.tsx +97 -2
- package/src/components/SpacesBrowser.web.tsx +332 -0
- package/src/components/TerminalControls.web.tsx +464 -0
- package/src/components/ThreadPanel.web.tsx +798 -0
- package/src/components/__tests__/SpacesBrowser.test.ts +541 -0
- package/src/components/__tests__/SpacesBrowser.tui.test.tsx +249 -0
- package/src/components/__tests__/script-terminal-buffer.tui.test.ts +72 -0
- package/src/{shared/components → components}/index.ts +2 -0
- package/src/components/review-decision-colors.ts +11 -0
- package/src/components/script-terminal-buffer.tui.ts +37 -0
- package/src/components/session-terminal-page-navigation.ts +48 -0
- package/src/{tui/terminal-bracketed-paste.test.ts → components/terminal-bracketed-paste.tui.test.ts} +1 -3
- package/src/{tui/terminal-bracketed-paste.ts → components/terminal-bracketed-paste.tui.ts} +0 -1
- package/src/core/__tests__/bundle-refresh.test.ts +567 -0
- package/src/core/__tests__/bundle.test.ts +209 -0
- package/src/core/__tests__/github-review.test.ts +781 -0
- package/src/core/__tests__/project-lifecycle.test.ts +137 -0
- package/src/core/__tests__/workspace-lifecycle.test.ts +159 -0
- package/src/core/__tests__/workspace.test.ts +149 -0
- package/src/core/bundle-refresh.ts +1064 -0
- package/src/core/bundle.ts +68 -84
- package/src/core/config.ts +70 -175
- package/src/core/git.ts +452 -1
- package/src/core/github-review.ts +761 -0
- package/src/core/linear.ts +180 -2
- package/src/core/preferences-service.ts +17 -0
- package/src/core/project-catalog.ts +52 -0
- package/src/core/project-lifecycle.ts +163 -0
- package/src/core/review-executor.ts +316 -0
- package/src/core/review.ts +407 -0
- package/src/core/secret-runtime.ts +167 -0
- package/src/core/shell.ts +28 -72
- package/src/core/workspace-lifecycle.ts +216 -0
- package/src/core/workspace.ts +363 -0
- package/src/hooks/__tests__/useLocalSession.tui.test.ts +557 -0
- package/src/hooks/index.ts +8 -0
- package/src/{tui/hooks/index.ts → hooks/index.tui.ts} +8 -11
- package/src/{tui/hooks/useDaemonStatus.ts → hooks/useDaemonStatus.tui.ts} +2 -2
- package/src/hooks/useLocalSession.tui.ts +395 -0
- package/src/hooks/useRelayConnection.web.ts +54 -0
- package/src/hooks/useRemoteMachines.tui.ts +166 -0
- package/src/hooks/useRemoteTerminal.tui.ts +22 -0
- package/src/hooks/useReview.web.ts +248 -0
- package/src/hooks/useTerminal.web.ts +36 -0
- package/src/hooks/useUserActivity.ts +61 -0
- package/src/hooks/useVisualViewport.web.ts +104 -0
- package/src/index.ts +581 -15
- package/src/lib/events/__tests__/collector-filter.test.ts +105 -0
- package/src/lib/events/__tests__/store-query.test.ts +103 -0
- package/src/lib/events/collector.ts +494 -0
- package/src/lib/events/filters.ts +26 -0
- package/src/lib/events/index.ts +11 -0
- package/src/lib/events/indexer.ts +14 -0
- package/src/lib/events/paths.ts +69 -0
- package/src/lib/events/reader.ts +212 -0
- package/src/lib/events/store.ts +141 -0
- package/src/lib/preferences-service.web.ts +41 -0
- package/src/lib/processes/__tests__/config.test.ts +83 -0
- package/src/lib/processes/__tests__/names.test.ts +125 -0
- package/src/lib/processes/__tests__/schema.test.ts +208 -0
- package/src/lib/processes/__tests__/watchdog.test.ts +210 -0
- package/src/lib/processes/autostart.ts +16 -0
- package/src/lib/processes/config.ts +187 -0
- package/src/lib/processes/control.ts +53 -0
- package/src/lib/processes/editor.ts +32 -0
- package/src/lib/processes/events-config.ts +37 -0
- package/src/lib/processes/index.ts +14 -0
- package/src/lib/processes/instances.ts +20 -0
- package/src/lib/processes/manager.ts +131 -0
- package/src/lib/processes/names.ts +71 -0
- package/src/lib/processes/registry.ts +26 -0
- package/src/lib/processes/runner.ts +211 -0
- package/src/lib/processes/scheduler.ts +17 -0
- package/src/lib/processes/schema.ts +74 -0
- package/src/lib/processes/session-list.ts +15 -0
- package/src/lib/processes/state.ts +82 -0
- package/src/lib/processes/watchdog.test.ts +79 -0
- package/src/lib/processes/watchdog.ts +106 -0
- package/src/lib/remote-session/__tests__/protocol.test.ts +291 -0
- package/src/lib/remote-session/index.ts +1 -1
- package/src/lib/remote-session/protocol.ts +181 -5
- package/src/lib/remote-session/session-handler.ts +776 -59
- package/src/lib/remote-session/workspace-scanner.ts +1 -7
- package/src/lib/sonner.web.ts +1 -0
- package/src/{web/src/lib/storage/identity-store.ts → lib/storage/identity-store.web.ts} +1 -1
- package/src/lib/tmux-lite/cli.ts +81 -22
- package/src/lib/tmux-lite/process-run.integration.test.ts +266 -0
- package/src/lib/tmux-lite/protocol.ts +28 -3
- package/src/lib/tmux-lite/server-lifecycle.test.ts +212 -0
- package/src/lib/tmux-lite/server.ts +183 -21
- package/src/notifications/__tests__/useNotifications.test.ts +739 -0
- package/src/notifications/index.ts +32 -0
- package/src/notifications/policy.test.ts +424 -0
- package/src/notifications/policy.ts +139 -0
- package/src/notifications/types.ts +82 -0
- package/src/notifications/useNotifications.ts +350 -0
- package/src/pages/ReviewPage.web.tsx +511 -0
- package/src/preferences/index.ts +1 -0
- package/src/preferences/types.ts +9 -0
- package/src/relay/server.ts +59 -23
- package/src/relay-client/__tests__/machine-directory-client.test.ts +152 -0
- package/src/relay-client/__tests__/useMachineDirectory.test.ts +172 -0
- package/src/relay-client/adapters/browser.ts +27 -0
- package/src/relay-client/adapters/node.ts +29 -0
- package/src/relay-client/index.ts +33 -0
- package/src/relay-client/machine-directory-client.ts +244 -0
- package/src/relay-client/useMachineDirectory.ts +175 -0
- package/src/serve/client-session-manager.ts +16 -3
- package/src/serve/types.ts +5 -0
- package/src/session/__tests__/backend-manager.test.ts +101 -0
- package/src/session/__tests__/local-session-backend.test.ts +1129 -0
- package/src/session/__tests__/reducer.test.ts +80 -0
- package/src/session/__tests__/remote-session-backend.test.ts +995 -0
- package/src/session/__tests__/session-name.test.ts +35 -0
- package/src/session/__tests__/useBundleRefreshAttachFlow.test.ts +431 -0
- package/src/session/__tests__/useRemoteSessionClient.test.ts +424 -0
- package/src/session/__tests__/workspace-shell-hooks.integration.test.ts +268 -0
- package/src/session/__tests__/workspace-shell-hooks.test.ts +24 -0
- package/src/session/adapters/browser-remote.ts +101 -0
- package/src/session/adapters/node-remote.ts +135 -0
- package/src/session/backend-key.ts +5 -0
- package/src/session/backend-manager.ts +80 -0
- package/src/session/backend.ts +93 -0
- package/src/session/backends/local-session-backend.ts +1119 -0
- package/src/session/backends/remote-session-backend.ts +1378 -0
- package/src/{web/src/lib → session}/crypto/__tests__/web-terminal.test.ts +13 -13
- package/src/{web/src/lib/crypto/handshake.ts → session/crypto/handshake.web.ts} +2 -2
- package/src/{web/src/lib/crypto/identity.ts → session/crypto/identity.web.ts} +6 -1
- package/src/{web/src/lib/crypto/relay-signing.ts → session/crypto/relay-signing.web.ts} +1 -1
- package/src/session/events.ts +38 -0
- package/src/session/index.ts +116 -0
- package/src/session/reducer.ts +274 -0
- package/src/session/selectors.ts +28 -0
- package/src/session/session-name.ts +50 -0
- package/src/session/types.ts +101 -0
- package/src/session/useBundleRefreshAttachFlow.ts +608 -0
- package/src/session/useRemoteSessionClient.ts +424 -0
- package/src/session/useSessionEngine.ts +432 -0
- package/src/session/workspace-shell-hooks.ts +35 -0
- package/src/tui/__tests__/input-text.test.ts +24 -0
- package/src/tui/__tests__/local-terminal-sync.test.ts +82 -0
- package/src/tui/__tests__/session-terminal-page-navigation.test.ts +94 -0
- package/src/tui/app.tsx +2 -1816
- package/src/tui/index.ts +7 -13
- package/src/tui/input-text.ts +38 -0
- package/src/tui/local-terminal-sync.ts +41 -0
- package/src/types/bundle-refresh.ts +42 -0
- package/src/types/bundle.ts +21 -3
- package/src/types/config.ts +217 -19
- package/src/types/errors.ts +88 -2
- package/src/types/events.ts +91 -0
- package/src/types/processes.ts +45 -0
- package/src/types/review.ts +349 -0
- package/src/types/script-phase.ts +3 -0
- package/src/utils/__tests__/onboarding.test.ts +358 -0
- package/src/utils/__tests__/run-scripts.test.ts +535 -0
- package/src/utils/__tests__/run-workspace-scripts.test.ts +406 -0
- package/src/utils/__tests__/workspace-setup.integration.test.ts +633 -0
- package/src/utils/__tests__/workspace-state.test.ts +78 -0
- package/src/utils/clipboard.ts +53 -0
- package/src/utils/deps.test.ts +31 -0
- package/src/utils/deps.ts +20 -2
- package/src/utils/device.web.ts +163 -0
- package/src/utils/hostnames.ts +43 -0
- package/src/utils/hunk-header.ts +17 -0
- package/src/utils/id.ts +9 -0
- package/src/utils/normalize-env-key.ts +13 -0
- package/src/utils/onboarding.ts +95 -45
- package/src/utils/prompts.ts +63 -1
- package/src/utils/run-scripts.ts +210 -15
- package/src/utils/run-workspace-scripts.ts +355 -0
- package/src/utils/sanitize.test.ts +149 -0
- package/src/utils/sanitize.ts +64 -0
- package/src/utils/secrets.ts +743 -29
- package/src/utils/workspace-id.ts +55 -0
- package/src/utils/workspace-state.ts +408 -28
- package/src/version.generated.d.ts +2 -0
- package/tsconfig.json +7 -1
- package/{src/web → web}/bun.lock +100 -0
- package/web/index.css +249 -0
- package/{src/web → web}/index.html +1 -1
- package/{src/web/src → web}/main.tsx +1 -1
- package/{src/web → web}/package.json +3 -1
- package/{src/web → web}/public/vite.svg +1 -1
- package/{src/web → web}/tsconfig.app.json +8 -1
- package/{src/web → web}/vite.config.ts +8 -0
- package/npm/darwin-arm64/bin/gssh +0 -0
- package/npm/darwin-arm64/package.json +0 -20
- package/src/shared/components/SpacesBrowser.tsx +0 -332
- package/src/shared/components/SpacesBrowser.web.tsx +0 -221
- package/src/shared/hooks/index.ts +0 -16
- package/src/shared/hooks/useNavigation.ts +0 -226
- package/src/shared/index.ts +0 -122
- package/src/shared/providers/LocalMachineProvider.ts +0 -425
- package/src/shared/providers/MachineProvider.ts +0 -165
- package/src/shared/providers/RemoteMachineProvider.ts +0 -444
- package/src/shared/providers/index.ts +0 -26
- package/src/shared/types.ts +0 -145
- package/src/tui/adapters.ts +0 -120
- package/src/tui/components/Terminal.tsx +0 -580
- package/src/tui/hooks/useAppState.ts +0 -314
- package/src/tui/hooks/useInboxTUI.ts +0 -113
- package/src/tui/hooks/useRemoteMachines.ts +0 -209
- package/src/tui/state.ts +0 -299
- package/src/web/src/App.tsx +0 -604
- package/src/web/src/assets/react.svg +0 -1
- package/src/web/src/components/Terminal.tsx +0 -207
- package/src/web/src/hooks/useRelayConnection.ts +0 -224
- package/src/web/src/hooks/useTerminal.ts +0 -699
- package/src/web/src/index.css +0 -55
- package/src/web/src/types/identity.ts +0 -45
- package/worker/.wrangler/state/v3/d1/miniflare-D1DatabaseObject/12b7107e435bf1b9a8713a7f320472a63e543104d633d89a26f8d21f4e4ef182.sqlite +0 -0
- package/worker/.wrangler/state/v3/d1/miniflare-D1DatabaseObject/12b7107e435bf1b9a8713a7f320472a63e543104d633d89a26f8d21f4e4ef182.sqlite-shm +0 -0
- package/worker/.wrangler/state/v3/d1/miniflare-D1DatabaseObject/12b7107e435bf1b9a8713a7f320472a63e543104d633d89a26f8d21f4e4ef182.sqlite-wal +0 -0
- package/worker/.wrangler/state/v3/d1/miniflare-D1DatabaseObject/1a1ac3db1ab86ecf712f90322868a9aabc2c7dc9fe2dfbe94f9b075096276b0f.sqlite +0 -0
- package/worker/.wrangler/state/v3/d1/miniflare-D1DatabaseObject/1a1ac3db1ab86ecf712f90322868a9aabc2c7dc9fe2dfbe94f9b075096276b0f.sqlite-shm +0 -0
- package/worker/.wrangler/state/v3/d1/miniflare-D1DatabaseObject/1a1ac3db1ab86ecf712f90322868a9aabc2c7dc9fe2dfbe94f9b075096276b0f.sqlite-wal +0 -0
- /package/.gitspace/{setup → scripts/setup}/01-install-deps.sh +0 -0
- /package/.gitspace/{setup → scripts/setup}/02-typecheck.sh +0 -0
- /package/src/{shared/components → components}/Flow.tui.tsx +0 -0
- /package/src/{shared/components → components}/Inbox.tui.tsx +0 -0
- /package/src/{shared/components → components}/MachineList.tui.tsx +0 -0
- /package/src/{shared/components → components}/ProjectList.tui.tsx +0 -0
- /package/src/{shared/components → components}/ProjectList.web.tsx +0 -0
- /package/src/{web/src/lib/invite.ts → lib/invite.web.ts} +0 -0
- /package/src/{web/src/lib/crypto/frames.ts → session/crypto/frames.web.ts} +0 -0
- /package/src/{web/src/lib/crypto/keyexchange.ts → session/crypto/keyexchange.web.ts} +0 -0
- /package/{src/web → web}/README.md +0 -0
- /package/{src/web → web}/eslint.config.js +0 -0
- /package/{src/web → web}/tsconfig.json +0 -0
- /package/{src/web → web}/tsconfig.node.json +0 -0
|
@@ -1,21 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"permissions": {
|
|
3
3
|
"allow": [
|
|
4
|
-
"Bash(
|
|
5
|
-
"Bash(
|
|
6
|
-
"Bash(
|
|
7
|
-
"Bash(
|
|
8
|
-
"Bash(bun run typecheck:*)",
|
|
9
|
-
"Bash(bun -e:*)",
|
|
10
|
-
"Bash(bun:*)",
|
|
11
|
-
"Bash(xargs:*)",
|
|
12
|
-
"Bash(timeout 2 bash -c 'echo \"\"invalid-base64\"\" | bun src/index.ts access add \"\"not-valid-base64-data\"\" 2>&1')",
|
|
13
|
-
"Bash(wc:*)",
|
|
14
|
-
"WebFetch(domain:ghostty.org)",
|
|
15
|
-
"Bash(xxd:*)",
|
|
16
|
-
"WebFetch(domain:ast-grep.github.io)",
|
|
17
|
-
"WebFetch(domain:developers.cloudflare.com)",
|
|
18
|
-
"WebFetch(domain:gitspace.sh)"
|
|
4
|
+
"Bash(gh api:*)",
|
|
5
|
+
"Bash(gh search code:*)",
|
|
6
|
+
"Bash(curl:*)",
|
|
7
|
+
"Bash(bun scripts/build.ts:*)"
|
|
19
8
|
]
|
|
20
9
|
}
|
|
21
10
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"processes": [
|
|
3
|
+
{
|
|
4
|
+
"name": "sample-events",
|
|
5
|
+
"command": "bun",
|
|
6
|
+
"args": ["scripts/sample-events.ts"],
|
|
7
|
+
"autostart": false,
|
|
8
|
+
"events": {
|
|
9
|
+
"keepRawOutput": false,
|
|
10
|
+
"correlationField": "requestId",
|
|
11
|
+
"aggregateMode": "stream",
|
|
12
|
+
"updateIntervalMs": 200,
|
|
13
|
+
"maxTimeline": 50
|
|
14
|
+
},
|
|
15
|
+
"restart": {
|
|
16
|
+
"policy": "always",
|
|
17
|
+
"maxAttempts": 10,
|
|
18
|
+
"backoffMs": 2000,
|
|
19
|
+
"maxBackoffMs": 15000
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
#
|
|
4
4
|
# This runs every time you switch to an existing workspace.
|
|
5
5
|
#
|
|
6
|
-
# Bundle values are available
|
|
7
|
-
#
|
|
8
|
-
# SPACE_SECRET_<KEY> - Secret values from secret steps
|
|
6
|
+
# Bundle values are available using exact keys and uppercase snake-case aliases.
|
|
7
|
+
# Example aliases: DEVELOPER_NAME, EXAMPLE_API_TOKEN
|
|
9
8
|
|
|
10
9
|
WORKSPACE_NAME=$1
|
|
11
10
|
REPOSITORY=$2
|
|
@@ -15,14 +14,14 @@ echo "=== Workspace: $WORKSPACE_NAME ==="
|
|
|
15
14
|
echo ""
|
|
16
15
|
|
|
17
16
|
# Show bundle values (proof of concept)
|
|
18
|
-
if [ -n "$
|
|
19
|
-
echo "Welcome back, $
|
|
17
|
+
if [ -n "$DEVELOPER_NAME" ]; then
|
|
18
|
+
echo "Welcome back, $DEVELOPER_NAME!"
|
|
20
19
|
fi
|
|
21
20
|
|
|
22
21
|
# Show that we have access to the secret (masked)
|
|
23
|
-
if [ -n "$
|
|
22
|
+
if [ -n "$EXAMPLE_API_TOKEN" ]; then
|
|
24
23
|
# Only show first 4 characters to prove we have access
|
|
25
|
-
TOKEN_PREVIEW="${
|
|
24
|
+
TOKEN_PREVIEW="${EXAMPLE_API_TOKEN:0:4}..."
|
|
26
25
|
echo "API Token available: $TOKEN_PREVIEW (stored in OS keychain)"
|
|
27
26
|
fi
|
|
28
27
|
|
package/AGENTS.md
CHANGED
|
@@ -14,7 +14,7 @@ This document provides comprehensive information for AI assistants working on th
|
|
|
14
14
|
- **X3DH handshake** for forward-secret session encryption
|
|
15
15
|
- Web terminal interface (React + xterm.js)
|
|
16
16
|
- Linear issue integration for workspace creation
|
|
17
|
-
- Convention-based custom scripts (pre, setup, select phases)
|
|
17
|
+
- Convention-based custom scripts in `.gitspace/scripts/` (pre, setup, select, remove phases)
|
|
18
18
|
|
|
19
19
|
## Architecture
|
|
20
20
|
|
|
@@ -22,11 +22,12 @@ This document provides comprehensive information for AI assistants working on th
|
|
|
22
22
|
|
|
23
23
|
1. **Projects**: Top-level containers for a GitHub repository
|
|
24
24
|
- Located at `~/gitspace/<project-name>/`
|
|
25
|
-
- Contains: base repo clone, workspaces,
|
|
25
|
+
- Contains: base repo clone, workspaces, config
|
|
26
26
|
|
|
27
27
|
2. **Workspaces**: Individual git worktrees for features/branches
|
|
28
28
|
- Located at `~/gitspace/<project-name>/workspaces/<workspace-name>/`
|
|
29
29
|
- Each workspace has its own branch
|
|
30
|
+
- Scripts are sourced from `.gitspace/scripts/<phase>/` in the workspace (version-controlled)
|
|
30
31
|
|
|
31
32
|
3. **Sessions**: PTY terminal sessions managed by tmux-lite
|
|
32
33
|
- Can be attached from multiple clients
|
|
@@ -50,7 +51,7 @@ This document provides comprehensive information for AI assistants working on th
|
|
|
50
51
|
```
|
|
51
52
|
src/
|
|
52
53
|
├── index.ts # Entry point (TUI or CLI dispatch)
|
|
53
|
-
├── commands/ # CLI command implementations (
|
|
54
|
+
├── commands/ # CLI command implementations (17 files)
|
|
54
55
|
│ ├── access.ts # Access control list (add/list/remove)
|
|
55
56
|
│ ├── add.ts # Add projects/workspaces
|
|
56
57
|
│ ├── auth.ts # GitHub OAuth for gitspace.sh
|
|
@@ -58,6 +59,7 @@ src/
|
|
|
58
59
|
│ ├── directory.ts # Get project directory path
|
|
59
60
|
│ ├── host.ts # Subdomain hosting (reserve/release/list)
|
|
60
61
|
│ ├── identity.ts # Identity management (init/show)
|
|
62
|
+
│ ├── linear.ts # Linear integration (setup/show/clear)
|
|
61
63
|
│ ├── list.ts # List projects/workspaces
|
|
62
64
|
│ ├── machine.ts # Remote machine management (invite/list)
|
|
63
65
|
│ ├── relay.ts # Relay server (start/token)
|
|
@@ -126,22 +128,21 @@ src/
|
|
|
126
128
|
│ │ └── ProjectList.tui.tsx
|
|
127
129
|
│ ├── providers/ # Machine access abstraction
|
|
128
130
|
│ │ ├── MachineProvider.ts # Interface definition
|
|
129
|
-
│ │
|
|
130
|
-
│ │ └── RemoteMachineProvider.ts # Via relay
|
|
131
|
+
│ │ └── LocalMachineProvider.ts # Direct tmux-lite access
|
|
131
132
|
│ ├── hooks/
|
|
132
|
-
│ │ └──
|
|
133
|
+
│ │ └── useUserActivity.ts # Activity tracking for notifications
|
|
133
134
|
│ └── types.ts # Shared type definitions
|
|
134
135
|
├── tui/ # Terminal UI (OpenTUI)
|
|
135
136
|
│ ├── index.ts # TUI entry point
|
|
136
137
|
│ ├── app.tsx # Main TUI application
|
|
137
|
-
│ ├── state.ts # State management
|
|
138
|
-
│ ├── adapters.ts # Local/remote machine adapters
|
|
139
138
|
│ ├── components/
|
|
140
|
-
│ │
|
|
139
|
+
│ │ ├── RemoteMachineScreen.tsx # Remote machine browser screen
|
|
140
|
+
│ │ └── RemoteTerminal.tsx # Embedded session terminal
|
|
141
141
|
│ └── hooks/
|
|
142
|
-
│ ├── useAppState.ts
|
|
143
142
|
│ ├── useRemoteMachines.ts
|
|
144
|
-
│
|
|
143
|
+
│ ├── useRemoteTerminal.ts
|
|
144
|
+
│ ├── useLocalSession.ts
|
|
145
|
+
│ └── useDaemonStatus.ts
|
|
145
146
|
├── web/ # Web application (Vite + React)
|
|
146
147
|
│ └── src/
|
|
147
148
|
│ ├── App.tsx # Main web app
|
|
@@ -215,10 +216,11 @@ src/
|
|
|
215
216
|
| Command | Description |
|
|
216
217
|
|---------|-------------|
|
|
217
218
|
| `gssh relay start` | Start relay server |
|
|
218
|
-
| `gssh relay
|
|
219
|
-
| `gssh relay
|
|
220
|
-
| `gssh relay revoke <id>` | Revoke client authorization |
|
|
219
|
+
| `gssh relay authorize <pubkey>` | Authorize a machine on relay |
|
|
220
|
+
| `gssh relay revoke <id>` | Revoke machine authorization |
|
|
221
221
|
| `gssh relay machines` | List authorized machines |
|
|
222
|
+
| `gssh relay trusted` | List trusted relays |
|
|
223
|
+
| `gssh relay untrust <url>` | Remove relay from trusted list |
|
|
222
224
|
|
|
223
225
|
### tmux-lite Daemon
|
|
224
226
|
| Command | Description |
|
|
@@ -251,6 +253,23 @@ src/
|
|
|
251
253
|
| `gssh host set-primary <name>` | Set primary subdomain |
|
|
252
254
|
| `gssh host status` | Show hosting status |
|
|
253
255
|
|
|
256
|
+
### Linear Integration
|
|
257
|
+
| Command | Description |
|
|
258
|
+
|---------|-------------|
|
|
259
|
+
| `gssh linear setup` | Configure Linear integration (API key + teams) |
|
|
260
|
+
| `gssh linear setup --project <name>` | Configure Linear for a specific project |
|
|
261
|
+
| `gssh linear show` | Show user-level Linear configuration |
|
|
262
|
+
| `gssh linear show --project <name>` | Show project-specific Linear configuration |
|
|
263
|
+
| `gssh linear clear` | Clear user-level Linear configuration |
|
|
264
|
+
| `gssh linear clear --project <name>` | Clear project-specific Linear configuration |
|
|
265
|
+
|
|
266
|
+
### Bundle Management
|
|
267
|
+
| Command | Description |
|
|
268
|
+
|---------|-------------|
|
|
269
|
+
| `gssh bundle status` | Show bundle status for current project |
|
|
270
|
+
| `gssh bundle refresh` | Re-run bundle onboarding (keeps previous values as defaults) |
|
|
271
|
+
| `gssh bundle refresh --force` | Force refresh even if no changes detected |
|
|
272
|
+
|
|
254
273
|
## Remote Access Architecture
|
|
255
274
|
|
|
256
275
|
```
|
|
@@ -263,10 +282,19 @@ src/
|
|
|
263
282
|
└─────────────────┘ └─────────────────┘ └─────────────────┘
|
|
264
283
|
```
|
|
265
284
|
|
|
266
|
-
### Connection Flow
|
|
285
|
+
### Connection Flow (gitspace.sh Hosting)
|
|
267
286
|
|
|
268
|
-
1.
|
|
269
|
-
2.
|
|
287
|
+
1. User logs in: `gssh auth login` (GitHub OAuth)
|
|
288
|
+
2. User reserves subdomain: `gssh host reserve <name>`
|
|
289
|
+
3. Machine runs `gssh serve start` (auto-starts local relay + cloudflared tunnel)
|
|
290
|
+
4. Client connects via web: `https://<name>.gitspace.sh`
|
|
291
|
+
5. X3DH handshake establishes session keys
|
|
292
|
+
6. All terminal I/O is E2E encrypted
|
|
293
|
+
|
|
294
|
+
### Connection Flow (Self-Hosted Relay)
|
|
295
|
+
|
|
296
|
+
1. Machine runs `gssh serve start --relay ws://relay:4480/ws`
|
|
297
|
+
2. Machine registers with relay (Ed25519 challenge-response auth)
|
|
270
298
|
3. Machine creates invite: `gssh share create`
|
|
271
299
|
4. Client connects with invite: `gssh connect <token>`
|
|
272
300
|
5. X3DH handshake establishes session keys
|
|
@@ -280,7 +308,7 @@ src/
|
|
|
280
308
|
| Key exchange | X25519 |
|
|
281
309
|
| Symmetric encryption | AES-256-GCM |
|
|
282
310
|
| Key derivation | HKDF-SHA256 |
|
|
283
|
-
|
|
|
311
|
+
| Relay authentication | Ed25519 challenge-response |
|
|
284
312
|
|
|
285
313
|
## TUI/Web Shared Component Pattern
|
|
286
314
|
|
|
@@ -306,7 +334,7 @@ interface MachineProvider {
|
|
|
306
334
|
```
|
|
307
335
|
|
|
308
336
|
- `LocalMachineProvider`: Direct filesystem + tmux-lite CLI
|
|
309
|
-
-
|
|
337
|
+
- Remote machine access in UI now uses shared relay/session hooks + backend adapters (`shared/relay/*`, `shared/session/*`)
|
|
310
338
|
|
|
311
339
|
## Development Workflow
|
|
312
340
|
|
|
@@ -322,11 +350,14 @@ bun run build
|
|
|
322
350
|
# Run TUI
|
|
323
351
|
bun src/index.ts
|
|
324
352
|
|
|
325
|
-
# Run relay
|
|
326
|
-
|
|
353
|
+
# Run relay (uses Ed25519 identity from keychain)
|
|
354
|
+
bun src/index.ts relay start
|
|
355
|
+
|
|
356
|
+
# Run serve with gitspace.sh hosting (requires auth login + host reserve)
|
|
357
|
+
bun src/index.ts serve start
|
|
327
358
|
|
|
328
|
-
# Run serve
|
|
329
|
-
bun src/index.ts serve --relay ws://localhost:
|
|
359
|
+
# Run serve with self-hosted relay
|
|
360
|
+
bun src/index.ts serve start --relay ws://localhost:4480/ws
|
|
330
361
|
```
|
|
331
362
|
|
|
332
363
|
### Code Style
|
|
@@ -409,6 +440,7 @@ bun src/index.ts serve --relay ws://localhost:8080/ws --token <jwt>
|
|
|
409
440
|
| Access list | `~/gitspace/.access.json` | Authorized client public keys |
|
|
410
441
|
| Machine info | `~/gitspace/.machine.json` | Machine registration |
|
|
411
442
|
| Relay config | `~/gitspace/.relay.json` | Relay configuration cache |
|
|
443
|
+
| Host config | `~/gitspace/host.json` | gitspace.sh subdomain config |
|
|
412
444
|
| Daemon state | `~/gitspace/.serve/` | PID files, status sockets |
|
|
413
445
|
| tmux-lite state | `/tmp/` | Session data (configurable via `TMUX_LITE_SESSION_DIR`) |
|
|
414
446
|
|
|
@@ -418,9 +450,8 @@ bun src/index.ts serve --relay ws://localhost:8080/ws --token <jwt>
|
|
|
418
450
|
|----------|-------------|---------|
|
|
419
451
|
| `RELAY_PORT` | Relay server port | `4480` |
|
|
420
452
|
| `RELAY_BIND` | Relay bind address | `0.0.0.0` |
|
|
421
|
-
| `RELAY_SIGNING_SECRET` | Secret for HMAC JWT signing | Required |
|
|
422
453
|
| `RELAY_PRIVATE_KEY` | Base64 Ed25519 private key | Uses keychain |
|
|
423
|
-
| `
|
|
454
|
+
| `RELAY_LABEL` | Label for relay identity | None |
|
|
424
455
|
| `GITSPACE_API_URL` | gitspace.sh API URL | `https://api.gitspace.sh` |
|
|
425
456
|
|
|
426
457
|
### Default Values
|
|
@@ -431,9 +462,8 @@ bun src/index.ts serve --relay ws://localhost:8080/ws --token <jwt>
|
|
|
431
462
|
| Base branch | `main` | Global/project config |
|
|
432
463
|
| Stale workspace days | `30` | Global config |
|
|
433
464
|
| Relay port | `4480` | CLI/env |
|
|
434
|
-
| Default relay URL | `wss://relay.gitspace.sh` | CLI |
|
|
435
465
|
|
|
436
466
|
---
|
|
437
467
|
|
|
438
|
-
**Last Updated**:
|
|
439
|
-
**Runtime**: Bun
|
|
468
|
+
**Last Updated**: 2026-01
|
|
469
|
+
**Runtime**: Bun 1.3+
|
package/README.md
CHANGED
|
@@ -20,7 +20,6 @@ The following tools must be installed and available in your PATH:
|
|
|
20
20
|
- [GitHub CLI (`gh`)](https://cli.github.com/) - for listing repositories
|
|
21
21
|
- [Git](https://git-scm.com/) - for worktree management
|
|
22
22
|
- [jq](https://stedolan.github.io/jq/) - for JSON processing
|
|
23
|
-
- [Bun](https://bun.sh) - runtime for the CLI
|
|
24
23
|
|
|
25
24
|
**GitHub Authentication**: You must authenticate the GitHub CLI before using GitSpace:
|
|
26
25
|
|
|
@@ -31,7 +30,17 @@ gh auth login
|
|
|
31
30
|
## Installation
|
|
32
31
|
|
|
33
32
|
```bash
|
|
34
|
-
|
|
33
|
+
# npm
|
|
34
|
+
npm install -g gitspace
|
|
35
|
+
|
|
36
|
+
# bun
|
|
37
|
+
bun install -g gitspace
|
|
38
|
+
|
|
39
|
+
# pnpm
|
|
40
|
+
pnpm install -g gitspace
|
|
41
|
+
|
|
42
|
+
# yarn
|
|
43
|
+
yarn global add gitspace
|
|
35
44
|
|
|
36
45
|
# Verify installation
|
|
37
46
|
gssh --version
|
|
@@ -97,6 +106,22 @@ gssh switch
|
|
|
97
106
|
gssh switch my-feature
|
|
98
107
|
```
|
|
99
108
|
|
|
109
|
+
### Workspace Session Mode (`space`)
|
|
110
|
+
|
|
111
|
+
When GitSpace opens a workspace-scoped terminal session, it injects a `space` shell function (bash/zsh).
|
|
112
|
+
|
|
113
|
+
- Use `space ...` for workspace operations without repeating `--project` and `--workspace`
|
|
114
|
+
- `gssh` commands are restricted in this mode to avoid cross-workspace mistakes
|
|
115
|
+
- `gssh tmux ...` is blocked inside workspace sessions
|
|
116
|
+
|
|
117
|
+
Examples:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
space context --json
|
|
121
|
+
space review hunks src/app.ts --format json
|
|
122
|
+
space review add-hunk src/app.ts --index 1 --approve --body "Looks good"
|
|
123
|
+
```
|
|
124
|
+
|
|
100
125
|
## Repo Config Bundles
|
|
101
126
|
|
|
102
127
|
Repo config bundles allow repository owners to share onboarding configurations with their team. When someone clones a project that contains a bundle, they'll be guided through setup steps and have scripts automatically installed.
|
|
@@ -108,14 +133,15 @@ A bundle is a directory (typically `.gitspace/`) containing:
|
|
|
108
133
|
```
|
|
109
134
|
.gitspace/
|
|
110
135
|
├── bundle.json # Bundle manifest with onboarding steps
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
└──
|
|
118
|
-
└──
|
|
136
|
+
└── scripts/
|
|
137
|
+
├── pre/ # Deprecated: migrate scripts into ordered setup/
|
|
138
|
+
│ └── 01-copy-env.sh
|
|
139
|
+
├── setup/ # Scripts for setup runs (when bundle/value state changes)
|
|
140
|
+
│ └── 01-install-deps.sh
|
|
141
|
+
├── select/ # Scripts to run on each new terminal attach
|
|
142
|
+
│ └── 01-status.sh
|
|
143
|
+
└── remove/ # Scripts to run before workspace deletion
|
|
144
|
+
└── 01-cleanup.sh
|
|
119
145
|
```
|
|
120
146
|
|
|
121
147
|
### Bundle Manifest (`bundle.json`)
|
|
@@ -170,27 +196,27 @@ A bundle is a directory (typically `.gitspace/`) containing:
|
|
|
170
196
|
|
|
171
197
|
### Using Bundle Values in Scripts
|
|
172
198
|
|
|
173
|
-
Bundle values are passed to scripts as environment variables:
|
|
199
|
+
Bundle values are passed to scripts as environment variables using the configured bundle keys:
|
|
174
200
|
|
|
175
|
-
-
|
|
176
|
-
-
|
|
201
|
+
- `<KEY>` - Regular or secret value using the exact `configKey` from `bundle.json`
|
|
202
|
+
- `<NORMALIZED_KEY>` - Uppercase snake-case alias (for example, `teamName` -> `TEAM_NAME`)
|
|
177
203
|
|
|
178
204
|
**Example script:**
|
|
179
205
|
|
|
180
206
|
```bash
|
|
181
207
|
#!/bin/bash
|
|
182
|
-
# .gitspace/select/01-status.sh
|
|
208
|
+
# .gitspace/scripts/select/01-status.sh
|
|
183
209
|
|
|
184
210
|
WORKSPACE_NAME=$1
|
|
185
211
|
REPOSITORY=$2
|
|
186
212
|
|
|
187
213
|
# Access bundle values
|
|
188
|
-
if [ -n "$
|
|
189
|
-
echo "Welcome, $
|
|
214
|
+
if [ -n "$TEAM_NAME" ]; then
|
|
215
|
+
echo "Welcome, $TEAM_NAME team!"
|
|
190
216
|
fi
|
|
191
217
|
|
|
192
218
|
# Access secrets (stored securely in OS keychain)
|
|
193
|
-
if [ -n "$
|
|
219
|
+
if [ -n "$API_KEY" ]; then
|
|
194
220
|
echo "API Key configured"
|
|
195
221
|
fi
|
|
196
222
|
```
|
|
@@ -199,7 +225,7 @@ fi
|
|
|
199
225
|
|
|
200
226
|
Bundles can be loaded from:
|
|
201
227
|
|
|
202
|
-
1. **In-repo** (automatic): `.gitspace
|
|
228
|
+
1. **In-repo** (automatic): `.gitspace/` directory in the cloned repository
|
|
203
229
|
2. **Local path**: `gssh add project --bundle-path /path/to/bundle/`
|
|
204
230
|
3. **Remote URL**: `gssh add project --bundle-url https://example.com/bundle.zip`
|
|
205
231
|
|
|
@@ -347,14 +373,16 @@ Located at `~/gitspace/<project-name>/.config.json`:
|
|
|
347
373
|
|
|
348
374
|
### Custom Scripts
|
|
349
375
|
|
|
350
|
-
GitSpace uses **convention over configuration** for custom scripts
|
|
376
|
+
GitSpace uses **convention over configuration** for custom scripts. Scripts live
|
|
377
|
+
inside each workspace so they can vary by branch:
|
|
351
378
|
|
|
352
379
|
```
|
|
353
|
-
~/gitspace/<project-name>/
|
|
354
|
-
|
|
355
|
-
├──
|
|
356
|
-
├──
|
|
357
|
-
|
|
380
|
+
~/gitspace/<project-name>/workspaces/<workspace-name>/.gitspace/
|
|
381
|
+
└── scripts/
|
|
382
|
+
├── pre/ # Deprecated: run before setup (migrate to setup/)
|
|
383
|
+
├── setup/ # Run when setup state requires refresh
|
|
384
|
+
├── select/ # Run on each new terminal attach
|
|
385
|
+
└── remove/ # Run before workspace deletion
|
|
358
386
|
```
|
|
359
387
|
|
|
360
388
|
#### Script Execution Rules
|
|
@@ -363,15 +391,15 @@ GitSpace uses **convention over configuration** for custom scripts:
|
|
|
363
391
|
2. Scripts run **alphabetically** (use `01-`, `02-` prefixes)
|
|
364
392
|
3. **Working directory**: The workspace directory
|
|
365
393
|
4. **Arguments**: `$1` = workspace name, `$2` = repository name
|
|
366
|
-
5. **Environment**: Bundle values available
|
|
394
|
+
5. **Environment**: Bundle values available by key name (for example `REGION`, `PULUMI_ACCESS_TOKEN`)
|
|
367
395
|
|
|
368
396
|
#### Script Phases
|
|
369
397
|
|
|
370
398
|
| Phase | When | Use Case |
|
|
371
399
|
|-------|------|----------|
|
|
372
|
-
| `pre/` |
|
|
373
|
-
| `setup/` |
|
|
374
|
-
| `select/` | Every
|
|
400
|
+
| `pre/` | Deprecated | Move scripts into ordered `setup/` files |
|
|
401
|
+
| `setup/` | When setup state changes | Install dependencies, initial build |
|
|
402
|
+
| `select/` | Every new terminal attach | Git fetch, status checks |
|
|
375
403
|
| `remove/` | Before deletion | Cleanup, notifications |
|
|
376
404
|
|
|
377
405
|
### Environment Variables
|
|
@@ -381,8 +409,8 @@ GitSpace uses **convention over configuration** for custom scripts:
|
|
|
381
409
|
export SPACES_CURRENT_PROJECT="my-app"
|
|
382
410
|
|
|
383
411
|
# Available in scripts (from bundle onboarding):
|
|
384
|
-
#
|
|
385
|
-
#
|
|
412
|
+
# <KEY> - Value by exact bundle config key name
|
|
413
|
+
# <NORMALIZED_KEY> - Uppercase snake-case alias (e.g. teamName -> TEAM_NAME)
|
|
386
414
|
```
|
|
387
415
|
|
|
388
416
|
## Directory Structure
|
|
@@ -396,13 +424,15 @@ export SPACES_CURRENT_PROJECT="my-app"
|
|
|
396
424
|
│ ├── workspaces/ # Git worktrees
|
|
397
425
|
│ │ └── <workspace-name>/
|
|
398
426
|
│ │ ├── gitspace.lock # Setup completion marker
|
|
399
|
-
│ │
|
|
400
|
-
│ │
|
|
401
|
-
│ └──
|
|
402
|
-
│
|
|
403
|
-
│
|
|
404
|
-
│
|
|
405
|
-
│
|
|
427
|
+
│ │ ├── .prompt/ # Linear issue details (if applicable)
|
|
428
|
+
│ │ │ └── issue.md
|
|
429
|
+
│ │ └── .gitspace/
|
|
430
|
+
│ │ ├── bundle.json
|
|
431
|
+
│ │ └── scripts/ # Custom scripts (per worktree)
|
|
432
|
+
│ │ ├── pre/
|
|
433
|
+
│ │ ├── setup/
|
|
434
|
+
│ │ ├── select/
|
|
435
|
+
│ │ └── remove/
|
|
406
436
|
```
|
|
407
437
|
|
|
408
438
|
## Remote Access
|
|
@@ -578,7 +608,7 @@ Error: GitHub CLI is not authenticated
|
|
|
578
608
|
|
|
579
609
|
### Bundle secrets not available
|
|
580
610
|
|
|
581
|
-
If
|
|
611
|
+
If expected bundle key environment variables are empty, ensure:
|
|
582
612
|
1. You completed the onboarding secret steps
|
|
583
613
|
2. Your OS keychain service is running (libsecret on Linux, Keychain on macOS)
|
|
584
614
|
|