mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
feat(opencode): surface server startup and recovery failures in-app
This commit is contained in:
1 parent
53a70d8545
commit
7e9afc3da4
19 files changed
+454
-181
No files matched your search
@@ -79,6 +79,10 @@ export {
|
||||
parseOpenCodeVersionOutput,
|
||||
} from './release'
|
||||
|
||||
export { OPENCODE_LIFECYCLE_STATES, OPENCODE_RECOVERY_ACTIONS } from './lifecycle'
|
||||
|
||||
export type { OpenCodeLifecycleState, OpenCodeLifecycleStatus, OpenCodeRecoveryAction } from './lifecycle'
|
||||
|
||||
export const OPENCODE_SERVER_USERNAME = 'opencode'
|
||||
|
||||
export type OpenCodeApi = ReturnType<typeof OpenCode.make>
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
export const OPENCODE_LIFECYCLE_STATES = [
|
||||
'idle',
|
||||
'starting',
|
||||
'healthy',
|
||||
'unhealthy',
|
||||
'recovering',
|
||||
'failed',
|
||||
'stopping',
|
||||
'stopped',
|
||||
] as const
|
||||
|
||||
export type OpenCodeLifecycleState = (typeof OPENCODE_LIFECYCLE_STATES)[number]
|
||||
|
||||
export const OPENCODE_RECOVERY_ACTIONS = [
|
||||
'restart',
|
||||
'debug_capture',
|
||||
'rollback_last_known_good',
|
||||
'seed_default_config',
|
||||
] as const
|
||||
|
||||
export type OpenCodeRecoveryAction = (typeof OPENCODE_RECOVERY_ACTIONS)[number]
|
||||
|
||||
export interface OpenCodeLifecycleStatus {
|
||||
state: OpenCodeLifecycleState
|
||||
healthy: boolean
|
||||
port: number
|
||||
version: string | null
|
||||
minVersion: string
|
||||
versionSupported: boolean
|
||||
lastError: string | null
|
||||
activeRecoveryAction: OpenCodeRecoveryAction | null
|
||||
attemptedRecoveryActions: OpenCodeRecoveryAction[]
|
||||
nextRecoveryAction: OpenCodeRecoveryAction | null
|
||||
failureCount: number
|
||||
watching: boolean
|
||||
updatedAt: string
|
||||
}
|
||||
Reference in new issue
Block a user