gitspace 0.2.0-rc.13 → 0.2.0-rc.15

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.
Files changed (190) hide show
  1. package/.claude/settings.local.json +2 -1
  2. package/.gitspace/select/01-status.sh +6 -7
  3. package/AGENTS.md +8 -9
  4. package/README.md +20 -19
  5. package/docs/CONNECTION.md +1 -1
  6. package/docs/REMOTE-DESIGN.md +15 -10
  7. package/docs/ROADMAP.md +1 -1
  8. package/docs/SITE_DOCS_FIGMA_MAKE.md +10 -9
  9. package/docs/UNIFIED_ARCHITECTURE.md +135 -289
  10. package/landing-page/src/components/docs/DocsContent.tsx +2 -2
  11. package/package.json +6 -6
  12. package/scripts/build.ts +3 -3
  13. package/src/app/input/__tests__/sessionCommands.test.ts +40 -0
  14. package/src/app/input/sessionCommands.ts +94 -0
  15. package/src/app/session/__tests__/useAttachController.test.ts +202 -0
  16. package/src/app/session/createSessionBackend.bun.ts +76 -0
  17. package/src/app/session/createSessionBackend.web.ts +104 -0
  18. package/src/app/session/types.ts +16 -0
  19. package/src/app/session/useAttachController.ts +212 -0
  20. package/src/app/session/useSessionClient.ts +35 -0
  21. package/src/app.tui.tsx +2591 -0
  22. package/src/{web/src/App.tsx → app.web.tsx} +322 -130
  23. package/src/commands/__tests__/connect-key.test.ts +10 -0
  24. package/src/commands/add.ts +26 -38
  25. package/src/commands/bundle.ts +12 -1
  26. package/src/commands/connect-key.ts +1 -0
  27. package/src/commands/connect.ts +363 -74
  28. package/src/commands/list.ts +6 -25
  29. package/src/commands/switch.ts +7 -5
  30. package/src/{web/src/components/DPad.tsx → components/DPad.web.tsx} +1 -2
  31. package/src/{web/src/components/FloatingControls.tsx → components/FloatingControls.web.tsx} +2 -2
  32. package/src/{web/src/components/FloatingJogWheel.tsx → components/FloatingJogWheel.web.tsx} +2 -2
  33. package/src/{shared/components → components}/Flow.tsx +12 -7
  34. package/src/{shared/components → components}/MachineList.tsx +4 -4
  35. package/src/{web/src/components/NumPad.tsx → components/NumPad.web.tsx} +1 -2
  36. package/src/{shared/components → components}/ProjectList.tsx +4 -5
  37. package/src/components/ProjectOnboardingStep.ts +23 -0
  38. package/src/components/ProjectOnboardingStep.tui.tsx +88 -0
  39. package/src/components/ProjectOnboardingStep.web.tsx +59 -0
  40. package/src/components/RemoteMachineScreen.tui.tsx +392 -0
  41. package/src/components/ScriptTerminal.tui.tsx +160 -0
  42. package/src/components/ScriptTerminal.web.tsx +89 -0
  43. package/src/components/SessionTerminal.tui.tsx +391 -0
  44. package/src/components/SessionTerminal.web.tsx +371 -0
  45. package/src/{shared/components → components}/SpacesBrowser.tsx +18 -17
  46. package/src/{web/src/components/TerminalControls.tsx → components/TerminalControls.web.tsx} +2 -3
  47. package/src/components/__tests__/script-terminal-buffer.tui.test.ts +72 -0
  48. package/src/components/script-terminal-buffer.tui.ts +37 -0
  49. package/src/components/session-terminal-page-navigation.ts +48 -0
  50. package/src/{tui/terminal-bracketed-paste.test.ts → components/terminal-bracketed-paste.tui.test.ts} +1 -3
  51. package/src/{tui/terminal-bracketed-paste.ts → components/terminal-bracketed-paste.tui.ts} +0 -1
  52. package/src/core/__tests__/bundle-refresh.test.ts +392 -221
  53. package/src/core/__tests__/project-lifecycle.test.ts +137 -0
  54. package/src/core/__tests__/workspace-lifecycle.test.ts +136 -0
  55. package/src/core/bundle-refresh.ts +840 -127
  56. package/src/core/preferences-service.ts +17 -0
  57. package/src/core/project-catalog.ts +52 -0
  58. package/src/core/project-lifecycle.ts +163 -0
  59. package/src/core/shell.ts +18 -66
  60. package/src/core/workspace-lifecycle.ts +194 -0
  61. package/src/core/workspace.ts +24 -0
  62. package/src/hooks/__tests__/useLocalSession.tui.test.ts +544 -0
  63. package/src/hooks/index.ts +8 -0
  64. package/src/{tui/hooks/index.ts → hooks/index.tui.ts} +8 -11
  65. package/src/{tui/hooks/useDaemonStatus.ts → hooks/useDaemonStatus.tui.ts} +2 -2
  66. package/src/hooks/useLocalSession.tui.ts +356 -0
  67. package/src/hooks/useRelayConnection.web.ts +54 -0
  68. package/src/hooks/useRemoteMachines.tui.ts +166 -0
  69. package/src/hooks/useRemoteTerminal.tui.ts +22 -0
  70. package/src/hooks/useTerminal.web.ts +36 -0
  71. package/src/hooks/useUserActivity.ts +61 -0
  72. package/src/lib/preferences-service.web.ts +41 -0
  73. package/src/lib/remote-session/protocol.ts +66 -2
  74. package/src/lib/remote-session/session-handler.ts +188 -16
  75. package/src/lib/remote-session/workspace-scanner.ts +1 -7
  76. package/src/lib/sonner.web.ts +1 -0
  77. package/src/{web/src/lib/storage/identity-store.ts → lib/storage/identity-store.web.ts} +1 -1
  78. package/src/lib/tmux-lite/cli.ts +1 -9
  79. package/src/{shared/notifications → notifications}/__tests__/useNotifications.test.ts +1 -1
  80. package/src/{shared/notifications → notifications}/policy.test.ts +1 -1
  81. package/src/{shared/notifications → notifications}/policy.ts +1 -1
  82. package/src/{shared/notifications → notifications}/types.ts +1 -1
  83. package/src/{shared/notifications → notifications}/useNotifications.ts +1 -1
  84. package/src/preferences/index.ts +1 -0
  85. package/src/preferences/types.ts +9 -0
  86. package/src/relay/server.ts +56 -22
  87. package/src/relay-client/__tests__/machine-directory-client.test.ts +152 -0
  88. package/src/relay-client/__tests__/useMachineDirectory.test.ts +172 -0
  89. package/src/relay-client/adapters/browser.ts +27 -0
  90. package/src/relay-client/adapters/node.ts +29 -0
  91. package/src/relay-client/index.ts +33 -0
  92. package/src/relay-client/machine-directory-client.ts +244 -0
  93. package/src/relay-client/useMachineDirectory.ts +175 -0
  94. package/src/session/__tests__/backend-manager.test.ts +89 -0
  95. package/src/session/__tests__/local-session-backend.test.ts +977 -0
  96. package/src/session/__tests__/reducer.test.ts +80 -0
  97. package/src/session/__tests__/remote-session-backend.test.ts +567 -0
  98. package/src/session/__tests__/useBundleRefreshAttachFlow.test.ts +431 -0
  99. package/src/session/__tests__/useRemoteSessionClient.test.ts +412 -0
  100. package/src/session/adapters/browser-remote.ts +101 -0
  101. package/src/session/adapters/node-remote.ts +135 -0
  102. package/src/session/backend-key.ts +5 -0
  103. package/src/session/backend-manager.ts +80 -0
  104. package/src/session/backend.ts +65 -0
  105. package/src/session/backends/local-session-backend.ts +839 -0
  106. package/src/session/backends/remote-session-backend.ts +980 -0
  107. package/src/{web/src/lib → session}/crypto/__tests__/web-terminal.test.ts +13 -13
  108. package/src/{web/src/lib/crypto/handshake.ts → session/crypto/handshake.web.ts} +2 -2
  109. package/src/{web/src/lib/crypto/identity.ts → session/crypto/identity.web.ts} +6 -1
  110. package/src/{web/src/lib/crypto/relay-signing.ts → session/crypto/relay-signing.web.ts} +1 -1
  111. package/src/session/events.ts +29 -0
  112. package/src/session/index.ts +115 -0
  113. package/src/session/reducer.ts +240 -0
  114. package/src/session/selectors.ts +28 -0
  115. package/src/session/types.ts +85 -0
  116. package/src/session/useBundleRefreshAttachFlow.ts +606 -0
  117. package/src/session/useRemoteSessionClient.ts +351 -0
  118. package/src/session/useSessionEngine.ts +310 -0
  119. package/src/tui/__tests__/input-text.test.ts +24 -0
  120. package/src/tui/__tests__/local-terminal-sync.test.ts +82 -0
  121. package/src/tui/__tests__/session-terminal-page-navigation.test.ts +94 -0
  122. package/src/tui/app.tsx +2 -2555
  123. package/src/tui/index.ts +7 -13
  124. package/src/tui/input-text.ts +38 -0
  125. package/src/tui/local-terminal-sync.ts +41 -0
  126. package/src/types/bundle-refresh.ts +42 -0
  127. package/src/types/bundle.ts +21 -3
  128. package/src/types/config.ts +38 -14
  129. package/src/types/errors.ts +4 -2
  130. package/src/types/script-phase.ts +3 -0
  131. package/src/utils/__tests__/onboarding.test.ts +11 -10
  132. package/src/utils/__tests__/run-scripts.test.ts +80 -7
  133. package/src/utils/__tests__/run-workspace-scripts.test.ts +184 -22
  134. package/src/utils/__tests__/workspace-setup.integration.test.ts +563 -0
  135. package/src/utils/__tests__/workspace-state.test.ts +78 -0
  136. package/src/utils/onboarding.ts +24 -10
  137. package/src/utils/run-scripts.ts +76 -12
  138. package/src/utils/run-workspace-scripts.ts +270 -26
  139. package/src/utils/workspace-state.ts +397 -33
  140. package/tsconfig.json +7 -1
  141. package/{src/web/src → web}/index.css +2 -0
  142. package/{src/web → web}/index.html +1 -1
  143. package/{src/web/src → web}/main.tsx +1 -1
  144. package/{src/web → web}/public/vite.svg +1 -1
  145. package/{src/web → web}/tsconfig.app.json +6 -1
  146. package/{src/web → web}/vite.config.ts +5 -0
  147. package/src/shared/hooks/index.ts +0 -16
  148. package/src/shared/hooks/useNavigation.ts +0 -226
  149. package/src/shared/index.ts +0 -122
  150. package/src/shared/providers/LocalMachineProvider.ts +0 -425
  151. package/src/shared/providers/MachineProvider.ts +0 -165
  152. package/src/shared/providers/RemoteMachineProvider.ts +0 -439
  153. package/src/shared/providers/index.ts +0 -26
  154. package/src/shared/types.ts +0 -145
  155. package/src/tui/adapters.ts +0 -120
  156. package/src/tui/components/ScriptTerminal.tsx +0 -211
  157. package/src/tui/components/Terminal.tsx +0 -698
  158. package/src/tui/hooks/useAppState.ts +0 -314
  159. package/src/tui/hooks/useInboxTUI.ts +0 -114
  160. package/src/tui/hooks/useRemoteMachines.ts +0 -208
  161. package/src/tui/state.ts +0 -316
  162. package/src/web/src/assets/react.svg +0 -1
  163. package/src/web/src/components/Terminal.tsx +0 -326
  164. package/src/web/src/hooks/useRelayConnection.ts +0 -224
  165. package/src/web/src/hooks/useTerminal.ts +0 -763
  166. package/src/web/src/types/identity.ts +0 -45
  167. /package/src/{shared/components → components}/Flow.tui.tsx +0 -0
  168. /package/src/{shared/components → components}/Flow.web.tsx +0 -0
  169. /package/src/{shared/components → components}/Inbox.tsx +0 -0
  170. /package/src/{shared/components → components}/Inbox.tui.tsx +0 -0
  171. /package/src/{shared/components → components}/Inbox.web.tsx +0 -0
  172. /package/src/{shared/components → components}/MachineList.tui.tsx +0 -0
  173. /package/src/{shared/components → components}/MachineList.web.tsx +0 -0
  174. /package/src/{shared/components → components}/ProjectList.tui.tsx +0 -0
  175. /package/src/{shared/components → components}/ProjectList.web.tsx +0 -0
  176. /package/src/{shared/components → components}/SpacesBrowser.tui.tsx +0 -0
  177. /package/src/{shared/components → components}/SpacesBrowser.web.tsx +0 -0
  178. /package/src/{shared/components → components}/index.ts +0 -0
  179. /package/src/{web/src/hooks/useVisualViewport.ts → hooks/useVisualViewport.web.ts} +0 -0
  180. /package/src/{web/src/lib/invite.ts → lib/invite.web.ts} +0 -0
  181. /package/src/{shared/notifications → notifications}/index.ts +0 -0
  182. /package/src/{web/src/lib/crypto/frames.ts → session/crypto/frames.web.ts} +0 -0
  183. /package/src/{web/src/lib/crypto/keyexchange.ts → session/crypto/keyexchange.web.ts} +0 -0
  184. /package/src/{web/src/utils/device.ts → utils/device.web.ts} +0 -0
  185. /package/{src/web → web}/README.md +0 -0
  186. /package/{src/web → web}/bun.lock +0 -0
  187. /package/{src/web → web}/eslint.config.js +0 -0
  188. /package/{src/web → web}/package.json +0 -0
  189. /package/{src/web → web}/tsconfig.json +0 -0
  190. /package/{src/web → web}/tsconfig.node.json +0 -0
@@ -3,7 +3,8 @@
3
3
  "allow": [
4
4
  "Bash(gh api:*)",
5
5
  "Bash(gh search code:*)",
6
- "Bash(curl:*)"
6
+ "Bash(curl:*)",
7
+ "Bash(bun scripts/build.ts:*)"
7
8
  ]
8
9
  }
9
10
  }
@@ -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 as environment variables:
7
- # SPACE_VALUE_<KEY> - Regular values from input steps
8
- # SPACE_SECRET_<KEY> - Secret values from secret steps
6
+ # Bundle values are available as environment variables using bundle key names.
7
+ # Example: DEVELOPERNAME, EXAMPLEAPITOKEN
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 "$SPACE_VALUE_DEVELOPERNAME" ]; then
19
- echo "Welcome back, $SPACE_VALUE_DEVELOPERNAME!"
17
+ if [ -n "$DEVELOPERNAME" ]; then
18
+ echo "Welcome back, $DEVELOPERNAME!"
20
19
  fi
21
20
 
22
21
  # Show that we have access to the secret (masked)
23
- if [ -n "$SPACE_SECRET_EXAMPLEAPITOKEN" ]; then
22
+ if [ -n "$EXAMPLEAPITOKEN" ]; then
24
23
  # Only show first 4 characters to prove we have access
25
- TOKEN_PREVIEW="${SPACE_SECRET_EXAMPLEAPITOKEN:0:4}..."
24
+ TOKEN_PREVIEW="${EXAMPLEAPITOKEN:0:4}..."
26
25
  echo "API Token available: $TOKEN_PREVIEW (stored in OS keychain)"
27
26
  fi
28
27
 
package/AGENTS.md CHANGED
@@ -128,22 +128,21 @@ src/
128
128
  │ │ └── ProjectList.tui.tsx
129
129
  │ ├── providers/ # Machine access abstraction
130
130
  │ │ ├── MachineProvider.ts # Interface definition
131
- │ │ ├── LocalMachineProvider.ts # Direct tmux-lite access
132
- │ │ └── RemoteMachineProvider.ts # Via relay
131
+ │ │ └── LocalMachineProvider.ts # Direct tmux-lite access
133
132
  │ ├── hooks/
134
- │ │ └── useNavigation.ts # Navigation state management
133
+ │ │ └── useUserActivity.ts # Activity tracking for notifications
135
134
  │ └── types.ts # Shared type definitions
136
135
  ├── tui/ # Terminal UI (OpenTUI)
137
136
  │ ├── index.ts # TUI entry point
138
137
  │ ├── app.tsx # Main TUI application
139
- │ ├── state.ts # State management
140
- │ ├── adapters.ts # Local/remote machine adapters
141
138
  │ ├── components/
142
- │ │ └── Terminal.tsx # Embedded terminal
139
+ │ │ ├── RemoteMachineScreen.tsx # Remote machine browser screen
140
+ │ │ └── RemoteTerminal.tsx # Embedded session terminal
143
141
  │ └── hooks/
144
- │ ├── useAppState.ts
145
142
  │ ├── useRemoteMachines.ts
146
- └── useInboxTUI.ts
143
+ ├── useRemoteTerminal.ts
144
+ │ ├── useLocalSession.ts
145
+ │ └── useDaemonStatus.ts
147
146
  ├── web/ # Web application (Vite + React)
148
147
  │ └── src/
149
148
  │ ├── App.tsx # Main web app
@@ -335,7 +334,7 @@ interface MachineProvider {
335
334
  ```
336
335
 
337
336
  - `LocalMachineProvider`: Direct filesystem + tmux-lite CLI
338
- - `RemoteMachineProvider`: Via relay WebSocket
337
+ - Remote machine access in UI now uses shared relay/session hooks + backend adapters (`shared/relay/*`, `shared/session/*`)
339
338
 
340
339
  ## Development Workflow
341
340
 
package/README.md CHANGED
@@ -118,11 +118,11 @@ A bundle is a directory (typically `.gitspace/`) containing:
118
118
  .gitspace/
119
119
  ├── bundle.json # Bundle manifest with onboarding steps
120
120
  └── scripts/
121
- ├── pre/ # Scripts to run before setup
121
+ ├── pre/ # Deprecated: migrate scripts into ordered setup/
122
122
  │ └── 01-copy-env.sh
123
- ├── setup/ # Scripts to run on first workspace creation
123
+ ├── setup/ # Scripts for setup runs (when bundle/value state changes)
124
124
  │ └── 01-install-deps.sh
125
- ├── select/ # Scripts to run every time workspace is opened
125
+ ├── select/ # Scripts to run on each new terminal attach
126
126
  │ └── 01-status.sh
127
127
  └── remove/ # Scripts to run before workspace deletion
128
128
  └── 01-cleanup.sh
@@ -180,10 +180,10 @@ A bundle is a directory (typically `.gitspace/`) containing:
180
180
 
181
181
  ### Using Bundle Values in Scripts
182
182
 
183
- Bundle values are passed to scripts as environment variables:
183
+ Bundle values are passed to scripts as environment variables using the configured bundle keys:
184
184
 
185
- - `SPACE_VALUE_<KEY>` - Regular values from input steps
186
- - `SPACE_SECRET_<KEY>` - Secret values from secret steps (fetched from OS keychain)
185
+ - `<KEY>` - Regular or secret value using the exact `configKey` from `bundle.json`
186
+ - Legacy aliases `SPACE_VALUE_<KEY>` / `SPACE_SECRET_<KEY>` are also provided for compatibility
187
187
 
188
188
  **Example script:**
189
189
 
@@ -195,12 +195,12 @@ WORKSPACE_NAME=$1
195
195
  REPOSITORY=$2
196
196
 
197
197
  # Access bundle values
198
- if [ -n "$SPACE_VALUE_TEAMNAME" ]; then
199
- echo "Welcome, $SPACE_VALUE_TEAMNAME team!"
198
+ if [ -n "$TEAMNAME" ]; then
199
+ echo "Welcome, $TEAMNAME team!"
200
200
  fi
201
201
 
202
202
  # Access secrets (stored securely in OS keychain)
203
- if [ -n "$SPACE_SECRET_APIKEY" ]; then
203
+ if [ -n "$APIKEY" ]; then
204
204
  echo "API Key configured"
205
205
  fi
206
206
  ```
@@ -363,9 +363,9 @@ inside each workspace so they can vary by branch:
363
363
  ```
364
364
  ~/gitspace/<project-name>/workspaces/<workspace-name>/.gitspace/
365
365
  └── scripts/
366
- ├── pre/ # Run before setup (terminal)
367
- ├── setup/ # Run once on workspace creation
368
- ├── select/ # Run every time workspace is opened
366
+ ├── pre/ # Deprecated: run before setup (migrate to setup/)
367
+ ├── setup/ # Run when setup state requires refresh
368
+ ├── select/ # Run on each new terminal attach
369
369
  └── remove/ # Run before workspace deletion
370
370
  ```
371
371
 
@@ -375,15 +375,15 @@ inside each workspace so they can vary by branch:
375
375
  2. Scripts run **alphabetically** (use `01-`, `02-` prefixes)
376
376
  3. **Working directory**: The workspace directory
377
377
  4. **Arguments**: `$1` = workspace name, `$2` = repository name
378
- 5. **Environment**: Bundle values available as `SPACE_VALUE_*` and `SPACE_SECRET_*`
378
+ 5. **Environment**: Bundle values available by key name (for example `REGION`, `PULUMI_ACCESS_TOKEN`)
379
379
 
380
380
  #### Script Phases
381
381
 
382
382
  | Phase | When | Use Case |
383
383
  |-------|------|----------|
384
- | `pre/` | Once, before setup | Copy .env files, create directories |
385
- | `setup/` | Once, on workspace creation | Install dependencies, initial build |
386
- | `select/` | Every workspace open | Git fetch, status checks |
384
+ | `pre/` | Deprecated | Move scripts into ordered `setup/` files |
385
+ | `setup/` | When setup state changes | Install dependencies, initial build |
386
+ | `select/` | Every new terminal attach | Git fetch, status checks |
387
387
  | `remove/` | Before deletion | Cleanup, notifications |
388
388
 
389
389
  ### Environment Variables
@@ -393,8 +393,9 @@ inside each workspace so they can vary by branch:
393
393
  export SPACES_CURRENT_PROJECT="my-app"
394
394
 
395
395
  # Available in scripts (from bundle onboarding):
396
- # SPACE_VALUE_<KEY> - Regular values
397
- # SPACE_SECRET_<KEY> - Secret values (from OS keychain)
396
+ # <KEY> - Value by bundle config key name
397
+ # SPACE_VALUE_<KEY> - Legacy alias for regular values
398
+ # SPACE_SECRET_<KEY> - Legacy alias for secret values
398
399
  ```
399
400
 
400
401
  ## Directory Structure
@@ -592,7 +593,7 @@ Error: GitHub CLI is not authenticated
592
593
 
593
594
  ### Bundle secrets not available
594
595
 
595
- If `SPACE_SECRET_*` variables are empty, ensure:
596
+ If expected bundle key environment variables are empty, ensure:
596
597
  1. You completed the onboarding secret steps
597
598
  2. Your OS keychain service is running (libsecret on Linux, Keychain on macOS)
598
599
 
@@ -4,7 +4,7 @@ This document describes how GitSpace handles WebSocket connections, disconnectio
4
4
 
5
5
  > **Related:** See [PROTOCOL.md](./PROTOCOL.md) for message/frame format, [REMOTE-DESIGN.md](./REMOTE-DESIGN.md) for security model.
6
6
 
7
- > **Implementation Note:** The web client (`src/web/`) currently lacks the
7
+ > **Implementation Note:** The web client tooling (`web/`) currently lacks the
8
8
  > auto-reconnection logic described below. While the relay connection has a
9
9
  > 15-second heartbeat, neither the relay nor terminal connections implement
10
10
  > exponential backoff reconnection. This is a known gap - disconnections
@@ -293,14 +293,18 @@ Key responsibilities:
293
293
  **Role:** User interface, decryption endpoint
294
294
 
295
295
  ```
296
- src/web/src/
297
- ├── App.tsx # Main application
296
+ web/
297
+ ├── index.html # Vite entry document
298
+ └── main.tsx # Lightweight web entrypoint
299
+
300
+ src/
301
+ ├── app.web.tsx # Main web application
298
302
  ├── hooks/
299
- │ ├── useRelayConnection.ts # WebSocket + machine list
300
- │ └── useTerminal.ts # Terminal session management
303
+ │ ├── useRelayConnection.web.ts
304
+ │ └── useTerminal.web.ts
301
305
  ├── components/
302
- │ └── Terminal.tsx # xterm.js wrapper
303
- └── lib/crypto/ # Client-side X3DH + encryption
306
+ │ └── SessionTerminal.web.tsx
307
+ └── session/crypto/ # Client-side X3DH + encryption
304
308
  ```
305
309
 
306
310
  Key responsibilities:
@@ -319,10 +323,11 @@ src/
319
323
  ├── commands/connect.ts # CLI connect command
320
324
  ├── tui/
321
325
  │ ├── app.tsx # TUI application
322
- │ ├── adapters.ts # Machine provider adapters
323
- │ └── hooks/useRemoteMachines.ts
324
- └── shared/providers/
325
- └── RemoteMachineProvider.ts
326
+ │ ├── hooks/useRemoteMachines.ts
327
+ │ └── hooks/useRemoteTerminal.ts
328
+ └── shared/
329
+ ├── relay/ # Shared relay directory client/hooks
330
+ └── session/ # Shared session backends + engine
326
331
  ```
327
332
 
328
333
  ---
package/docs/ROADMAP.md CHANGED
@@ -159,7 +159,7 @@ VM-per-workspace isolation using Lima. Works on all Apple Silicon (M1/M2/M3+).
159
159
  - `src/core/lima/manager.ts` - VM lifecycle (start/stop/status)
160
160
  - `src/core/lima/config.ts` - Generate Lima YAML from workspace config
161
161
  - `src/core/lima/connection.ts` - Connect to tmux-lite inside VM
162
- - `src/shared/providers/LimaMachineProvider.ts` - MachineProvider implementation
162
+ - `src/session/backends/lima-session-backend.ts` - Session backend implementation
163
163
 
164
164
  **Session Lifecycle:**
165
165
  1. User selects workspace in TUI
@@ -297,7 +297,7 @@ Script execution rules:
297
297
  - Scripts run alphabetically (use `01-`, `02-` prefixes)
298
298
  - Working directory: The workspace directory
299
299
  - Arguments: `$1` = workspace name, `$2` = repository name
300
- - Environment: Bundle values available as `SPACE_VALUE_*` and `SPACE_SECRET_*`
300
+ - Environment: Bundle values available by key name (for example `REGION`, `PULUMI_ACCESS_TOKEN`)
301
301
 
302
302
  Example script (`.gitspace/scripts/select/01-status.sh`):
303
303
  ```bash
@@ -377,14 +377,15 @@ Using bundle values in scripts:
377
377
  ```bash
378
378
  #!/bin/bash
379
379
  # Values available as environment variables:
380
- # SPACE_VALUE_<KEY> - Regular values from input steps
381
- # SPACE_SECRET_<KEY> - Secret values from secret steps (from OS keychain)
380
+ # <KEY> - Value by bundle config key name
381
+ # SPACE_VALUE_<KEY> - Legacy alias for regular values
382
+ # SPACE_SECRET_<KEY> - Legacy alias for secret values
382
383
 
383
- if [ -n "$SPACE_VALUE_TEAMNAME" ]; then
384
- echo "Welcome, $SPACE_VALUE_TEAMNAME team!"
384
+ if [ -n "$TEAMNAME" ]; then
385
+ echo "Welcome, $TEAMNAME team!"
385
386
  fi
386
387
 
387
- if [ -n "$SPACE_SECRET_APIKEY" ]; then
388
+ if [ -n "$APIKEY" ]; then
388
389
  echo "API Key configured"
389
390
  fi
390
391
  ```
@@ -629,7 +630,7 @@ gssh identity init --label "My Device"
629
630
 
630
631
  ### Bundle/Secrets Issues
631
632
 
632
- **"SPACE_SECRET_* variables are empty"**
633
+ **"Bundle key variables are empty"**
633
634
  1. Ensure you completed onboarding secret steps
634
635
  2. Check OS keychain is accessible:
635
636
  - macOS: Keychain Access should be running
@@ -959,8 +960,8 @@ Bundles allow teams to share onboarding configurations. Place in `.gitspace/`:
959
960
 
960
961
  **Using values in scripts:**
961
962
  ```bash
962
- echo "Team: $SPACE_VALUE_TEAMNAME"
963
- echo "Has API key: $SPACE_SECRET_APIKEY"
963
+ echo "Team: $TEAMNAME"
964
+ echo "Has API key: $APIKEY"
964
965
  ```
965
966
 
966
967
  ---