|
1 | | -import type { SessionGistCommand } from "./session-gist-domain.js" |
| 1 | +import type { AuthCommand } from "./auth-domain.js" |
| 2 | +import type { SessionsCommand } from "./sessions-domain.js" |
| 3 | +import type { StateCommand } from "./state-domain.js" |
2 | 4 |
|
| 5 | +export type { |
| 6 | + AuthClaudeLoginCommand, |
| 7 | + AuthClaudeLogoutCommand, |
| 8 | + AuthClaudeStatusCommand, |
| 9 | + AuthCodexLoginCommand, |
| 10 | + AuthCodexLogoutCommand, |
| 11 | + AuthCodexStatusCommand, |
| 12 | + AuthCommand, |
| 13 | + AuthGeminiLoginCommand, |
| 14 | + AuthGeminiLogoutCommand, |
| 15 | + AuthGeminiStatusCommand, |
| 16 | + AuthGithubLoginCommand, |
| 17 | + AuthGithubLogoutCommand, |
| 18 | + AuthGithubStatusCommand |
| 19 | +} from "./auth-domain.js" |
3 | 20 | export type { MenuAction, ParseError } from "./menu.js" |
4 | 21 | export { parseMenuSelection } from "./menu.js" |
5 | 22 | export { deriveRepoPathParts, deriveRepoSlug, resolveRepoInput } from "./repo.js" |
| 23 | +export type { |
| 24 | + SessionsCommand, |
| 25 | + SessionsKillCommand, |
| 26 | + SessionsListCommand, |
| 27 | + SessionsLogsCommand |
| 28 | +} from "./sessions-domain.js" |
| 29 | +export type { |
| 30 | + StateCommand, |
| 31 | + StateCommitCommand, |
| 32 | + StateInitCommand, |
| 33 | + StatePathCommand, |
| 34 | + StatePullCommand, |
| 35 | + StatePushCommand, |
| 36 | + StateStatusCommand, |
| 37 | + StateSyncCommand |
| 38 | +} from "./state-domain.js" |
| 39 | +export { |
| 40 | + defaultCpuLimit, |
| 41 | + defaultDockerNetworkMode, |
| 42 | + defaultDockerSharedNetworkName, |
| 43 | + defaultRamLimit, |
| 44 | + defaultTemplateConfig, |
| 45 | + dockerGitSharedCacheVolumeName, |
| 46 | + dockerGitSharedCodexVolumeName |
| 47 | +} from "./template-defaults.js" |
6 | 48 |
|
7 | 49 | export type AgentMode = "claude" | "codex" | "gemini" |
8 | 50 |
|
9 | 51 | export type DockerNetworkMode = "shared" | "project" |
10 | 52 |
|
11 | | -export const defaultDockerNetworkMode: DockerNetworkMode = "shared" |
12 | | - |
13 | | -export const defaultDockerSharedNetworkName = "docker-git-shared" |
14 | | -export const dockerGitSharedCacheVolumeName = "docker-git-shared-cache" |
15 | | -export const dockerGitSharedCodexVolumeName = "docker-git-shared-codex" |
16 | | - |
17 | | -export const defaultCpuLimit = "30%" |
18 | | - |
19 | | -export const defaultRamLimit = "30%" |
20 | | - |
21 | 53 | export interface TemplateConfig { |
22 | 54 | readonly containerName: string |
23 | 55 | readonly serviceName: string |
@@ -82,25 +114,6 @@ export interface PanesCommand { |
82 | 114 | readonly projectDir: string |
83 | 115 | } |
84 | 116 |
|
85 | | -export interface SessionsListCommand { |
86 | | - readonly _tag: "SessionsList" |
87 | | - readonly projectDir: string |
88 | | - readonly includeDefault: boolean |
89 | | -} |
90 | | - |
91 | | -export interface SessionsKillCommand { |
92 | | - readonly _tag: "SessionsKill" |
93 | | - readonly projectDir: string |
94 | | - readonly pid: number |
95 | | -} |
96 | | - |
97 | | -export interface SessionsLogsCommand { |
98 | | - readonly _tag: "SessionsLogs" |
99 | | - readonly projectDir: string |
100 | | - readonly pid: number |
101 | | - readonly lines: number |
102 | | -} |
103 | | - |
104 | 117 | // CHANGE: remove scrap cache mode and keep only the reproducible session snapshot. |
105 | 118 | // WHY: cache archives include large, easily-rebuildable artifacts (e.g. node_modules) that should not be stored in git. |
106 | 119 | // QUOTE(ТЗ): "не должно быть старого режима где он качает весь шлак типо node_modules" |
@@ -174,162 +187,18 @@ export interface DownAllCommand { |
174 | 187 | readonly _tag: "DownAll" |
175 | 188 | } |
176 | 189 |
|
177 | | -export interface StatePathCommand { |
178 | | - readonly _tag: "StatePath" |
179 | | -} |
180 | | - |
181 | | -export interface StateInitCommand { |
182 | | - readonly _tag: "StateInit" |
183 | | - readonly repoUrl: string |
184 | | - readonly repoRef: string |
185 | | -} |
186 | | - |
187 | | -export interface StatePullCommand { |
188 | | - readonly _tag: "StatePull" |
189 | | -} |
190 | | - |
191 | | -export interface StatePushCommand { |
192 | | - readonly _tag: "StatePush" |
193 | | -} |
194 | | - |
195 | | -export interface StateStatusCommand { |
196 | | - readonly _tag: "StateStatus" |
197 | | -} |
198 | | - |
199 | | -export interface StateCommitCommand { |
200 | | - readonly _tag: "StateCommit" |
201 | | - readonly message: string |
202 | | -} |
203 | | - |
204 | | -export interface StateSyncCommand { |
205 | | - readonly _tag: "StateSync" |
206 | | - readonly message: string | null |
207 | | -} |
208 | | - |
209 | | -export interface AuthGithubLoginCommand { |
210 | | - readonly _tag: "AuthGithubLogin" |
211 | | - readonly label: string | null |
212 | | - readonly token: string | null |
213 | | - readonly scopes: string | null |
214 | | - readonly envGlobalPath: string |
215 | | -} |
216 | | - |
217 | | -export interface AuthGithubStatusCommand { |
218 | | - readonly _tag: "AuthGithubStatus" |
219 | | - readonly envGlobalPath: string |
220 | | -} |
221 | | - |
222 | | -export interface AuthGithubLogoutCommand { |
223 | | - readonly _tag: "AuthGithubLogout" |
224 | | - readonly label: string | null |
225 | | - readonly envGlobalPath: string |
226 | | -} |
227 | | - |
228 | | -export interface AuthCodexLoginCommand { |
229 | | - readonly _tag: "AuthCodexLogin" |
230 | | - readonly label: string | null |
231 | | - readonly codexAuthPath: string |
232 | | -} |
233 | | - |
234 | | -export interface AuthCodexStatusCommand { |
235 | | - readonly _tag: "AuthCodexStatus" |
236 | | - readonly label: string | null |
237 | | - readonly codexAuthPath: string |
238 | | -} |
239 | | - |
240 | | -export interface AuthCodexLogoutCommand { |
241 | | - readonly _tag: "AuthCodexLogout" |
242 | | - readonly label: string | null |
243 | | - readonly codexAuthPath: string |
244 | | -} |
245 | | - |
246 | | -export interface AuthClaudeLoginCommand { |
247 | | - readonly _tag: "AuthClaudeLogin" |
248 | | - readonly label: string | null |
249 | | - readonly claudeAuthPath: string |
250 | | -} |
251 | | - |
252 | | -export interface AuthClaudeStatusCommand { |
253 | | - readonly _tag: "AuthClaudeStatus" |
254 | | - readonly label: string | null |
255 | | - readonly claudeAuthPath: string |
256 | | -} |
257 | | - |
258 | | -export interface AuthClaudeLogoutCommand { |
259 | | - readonly _tag: "AuthClaudeLogout" |
260 | | - readonly label: string | null |
261 | | - readonly claudeAuthPath: string |
262 | | -} |
263 | | - |
264 | | -// CHANGE: add Gemini CLI auth commands |
265 | | -// WHY: enable Gemini CLI authentication management similar to Claude/Codex |
266 | | -// QUOTE(ТЗ): "Добавь поддержку gemini CLI" |
267 | | -// REF: issue-146 |
268 | | -// SOURCE: https://geminicli.com/docs/get-started/authentication/ |
269 | | -// FORMAT THEOREM: forall cmd ∈ AuthGeminiCommand: cmd.geminiAuthPath is valid path |
270 | | -// PURITY: CORE |
271 | | -// EFFECT: n/a |
272 | | -// INVARIANT: authentication state is isolated by label |
273 | | -// COMPLEXITY: O(1) |
274 | | -export interface AuthGeminiLoginCommand { |
275 | | - readonly _tag: "AuthGeminiLogin" |
276 | | - readonly label: string | null |
277 | | - readonly geminiAuthPath: string |
278 | | - readonly isWeb: boolean |
279 | | -} |
280 | | - |
281 | | -export interface AuthGeminiStatusCommand { |
282 | | - readonly _tag: "AuthGeminiStatus" |
283 | | - readonly label: string | null |
284 | | - readonly geminiAuthPath: string |
285 | | -} |
286 | | - |
287 | | -export interface AuthGeminiLogoutCommand { |
288 | | - readonly _tag: "AuthGeminiLogout" |
289 | | - readonly label: string | null |
290 | | - readonly geminiAuthPath: string |
291 | | -} |
292 | | - |
293 | 190 | export type { |
294 | 191 | SessionGistBackupCommand, |
295 | 192 | SessionGistCommand, |
296 | 193 | SessionGistDownloadCommand, |
297 | 194 | SessionGistListCommand, |
298 | 195 | SessionGistViewCommand |
299 | 196 | } from "./session-gist-domain.js" |
300 | | -export type SessionsCommand = |
301 | | - | SessionsListCommand |
302 | | - | SessionsKillCommand |
303 | | - | SessionsLogsCommand |
304 | | - | SessionGistCommand |
305 | 197 |
|
306 | 198 | export type ScrapCommand = |
307 | 199 | | ScrapExportCommand |
308 | 200 | | ScrapImportCommand |
309 | 201 |
|
310 | | -export type AuthCommand = |
311 | | - | AuthGithubLoginCommand |
312 | | - | AuthGithubStatusCommand |
313 | | - | AuthGithubLogoutCommand |
314 | | - | AuthCodexLoginCommand |
315 | | - | AuthCodexStatusCommand |
316 | | - | AuthCodexLogoutCommand |
317 | | - | AuthClaudeLoginCommand |
318 | | - | AuthClaudeStatusCommand |
319 | | - | AuthClaudeLogoutCommand |
320 | | - | AuthGeminiLoginCommand |
321 | | - | AuthGeminiStatusCommand |
322 | | - | AuthGeminiLogoutCommand |
323 | | - |
324 | | -export type StateCommand = |
325 | | - | StatePathCommand |
326 | | - | StateInitCommand |
327 | | - | StatePullCommand |
328 | | - | StatePushCommand |
329 | | - | StateStatusCommand |
330 | | - | StateCommitCommand |
331 | | - | StateSyncCommand |
332 | | - |
333 | 202 | export type Command = |
334 | 203 | | CreateCommand |
335 | 204 | | MenuCommand |
@@ -389,28 +258,3 @@ export const resolveComposeNetworkName = ( |
389 | 258 | export const resolveProjectBootstrapVolumeName = ( |
390 | 259 | config: Pick<TemplateConfig, "volumeName"> |
391 | 260 | ): string => `${config.volumeName}-bootstrap` |
392 | | - |
393 | | -export const defaultTemplateConfig = { |
394 | | - containerName: "dev-ssh", |
395 | | - serviceName: "dev", |
396 | | - sshUser: "dev", |
397 | | - sshPort: 2222, |
398 | | - repoRef: "main", |
399 | | - targetDir: "/home/dev/app", |
400 | | - volumeName: "dev_home", |
401 | | - dockerGitPath: "./.docker-git", |
402 | | - authorizedKeysPath: "./.docker-git/authorized_keys", |
403 | | - envGlobalPath: "./.docker-git/.orch/env/global.env", |
404 | | - envProjectPath: "./.orch/env/project.env", |
405 | | - codexAuthPath: "./.docker-git/.orch/auth/codex", |
406 | | - codexSharedAuthPath: "./.docker-git/.orch/auth/codex", |
407 | | - codexHome: "/home/dev/.codex", |
408 | | - geminiAuthPath: "./.docker-git/.orch/auth/gemini", |
409 | | - geminiHome: "/home/dev/.gemini", |
410 | | - cpuLimit: defaultCpuLimit, |
411 | | - ramLimit: defaultRamLimit, |
412 | | - dockerNetworkMode: defaultDockerNetworkMode, |
413 | | - dockerSharedNetworkName: defaultDockerSharedNetworkName, |
414 | | - enableMcpPlaywright: false, |
415 | | - pnpmVersion: "10.27.0" |
416 | | -} |
0 commit comments