mirror of
https://github.com/stablyai/orca.git
synced 2026-10-23 00:03:52 +00:00
* chore(dead-code): drop 2k lines of unreachable exports and orphan modules Ran knip across every build entry (main, preload, renderer, popout, web, cli, relay, workers, forked sidecars, config scripts) and removed what no entry graph can reach. - 11 orphan modules nothing imported, plus one test that only covered them - 159 unused exports/types, with their now-dead helpers, imports and tests Each candidate was verified against dynamic references before deletion. 42 knip hits were false positives and are kept: shared modules consumed by the mobile/ workspace, the src/shared/plugins/** public API, vendored shadcn primitives, and relay wire-protocol constants held for compatibility. Adds knip.json + `pnpm audit:dead-code` so this stays measurable. Verified: pnpm typecheck, pnpm lint, and 2081 tests across the 73 affected test files all pass. * chore(dead-code): move knip config under config/ Root-level additions are blocked by the root directory guard. Co-authored-by: Orca <help@stably.ai> --------- Co-authored-by: Orca <help@stably.ai>
74 lines
2.3 KiB
TypeScript
74 lines
2.3 KiB
TypeScript
import { z } from 'zod'
|
|
import { EphemeralVmRecipeResultSchema } from './ephemeral-vm-recipes'
|
|
|
|
export const EphemeralVmRuntimeStatusSchema = z.enum([
|
|
'provisioning',
|
|
'running',
|
|
'suspended',
|
|
'suspend_failed',
|
|
'resume_failed',
|
|
'failed',
|
|
'cleanup_pending',
|
|
'cleanup_failed',
|
|
'cleaned'
|
|
])
|
|
|
|
export type EphemeralVmRuntimeStatus = z.infer<typeof EphemeralVmRuntimeStatusSchema>
|
|
|
|
export const EphemeralVmCleanupStatusSchema = z.enum([
|
|
'not_started',
|
|
'disabled',
|
|
'running',
|
|
'succeeded',
|
|
'failed'
|
|
])
|
|
|
|
export type EphemeralVmCleanupStatus = z.infer<typeof EphemeralVmCleanupStatusSchema>
|
|
|
|
export const EphemeralVmRuntimeConnectionModeSchema = z.enum(['orca-server', 'ssh'])
|
|
|
|
const EphemeralVmRuntimeRecipeSchema = z
|
|
.object({
|
|
id: z.string().min(1),
|
|
name: z.string().min(1),
|
|
create: z.string().min(1),
|
|
description: z.string().min(1).optional(),
|
|
suspend: z.string().min(1).optional(),
|
|
resume: z.string().min(1).optional(),
|
|
destroy: z.string().min(1).optional(),
|
|
destroyDisabled: z.boolean().optional()
|
|
})
|
|
.strict()
|
|
|
|
export const EphemeralVmRuntimeRecordSchema = z.object({
|
|
id: z.string().min(1),
|
|
recipeId: z.string().min(1),
|
|
/** Immutable lifecycle commands used for this runtime even if its source
|
|
* pack is updated, disabled, or removed later. */
|
|
recipe: EphemeralVmRuntimeRecipeSchema.optional(),
|
|
repoId: z.string().min(1).optional(),
|
|
projectId: z.string().min(1).optional(),
|
|
workspaceId: z.string().min(1).optional(),
|
|
workspaceName: z.string().min(1).optional(),
|
|
connectionMode: EphemeralVmRuntimeConnectionModeSchema.optional(),
|
|
runtimeEnvironmentId: z.string().min(1).optional(),
|
|
sshTargetId: z.string().min(1).optional(),
|
|
status: EphemeralVmRuntimeStatusSchema,
|
|
cleanupStatus: EphemeralVmCleanupStatusSchema,
|
|
cleanupDisabled: z.boolean().optional(),
|
|
cleanupLastAttemptAt: z.number().finite().optional(),
|
|
cleanupLastError: z.string().min(1).optional(),
|
|
createdAt: z.number().finite(),
|
|
updatedAt: z.number().finite(),
|
|
recipeResult: EphemeralVmRecipeResultSchema
|
|
})
|
|
|
|
export type EphemeralVmRuntimeRecord = z.infer<typeof EphemeralVmRuntimeRecordSchema>
|
|
|
|
export const EphemeralVmRuntimeStoreSchema = z.object({
|
|
version: z.literal(1),
|
|
runtimes: z.array(EphemeralVmRuntimeRecordSchema)
|
|
})
|
|
|
|
export type EphemeralVmRuntimeStore = z.infer<typeof EphemeralVmRuntimeStoreSchema>
|