skillhub/cli/src/services/install-transaction.ts
XiaoSeS 3560679793
Some checks failed
Deploy Docs / build (push) Has been cancelled
Security / Dependency Review (push) Has been cancelled
Security / CodeQL (java-kotlin) (push) Has been cancelled
Security / CodeQL (javascript-typescript) (push) Has been cancelled
Security / CodeQL (python) (push) Has been cancelled
Deploy Docs / Deploy (push) Has been cancelled
feat(dsh): add native SkillHub plugin for DeepSeek Harness (#956)
Add the native SkillHub plugin for DeepSeek Harness with a scoped skill center, conversation search/install tools, exact-version installation and protected lifecycle management. Prepare the independently versioned 0.1.0 npm candidate with an empty default Registry and documented compatibility limits.

Keep formal specifications and executable regression tests; remove archived development screenshots and runtime reports from the final tree. Review fixes cover independent scopes, installed references, pre-staging recovery and idempotent discovery.

Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>
2026-10-16 19:22:26 +08:00

56 lines
1.8 KiB
TypeScript

import type { Inventory } from '../stores/inventory-store'
export interface InstallMove {
phase: 'backup' | 'install'
index: number
agent: string
canonicalSkillDir: string
stagingDir: string
backupDir: string | null
from: string
to: string
}
export interface InstallCommit {
before: Inventory
after: Inventory
}
export interface InstallPreparation {
before: Inventory
release: { registry: string; namespace: string; slug: string; version: string; fingerprint: string }
targets: Array<{ agent: string; canonicalSkillDir: string; skillDir: string; stagingDir: string; installedAt: string }>
}
export interface InstallCleanup {
path: string
removed: boolean
error?: string
}
export interface InstallStaging {
canonicalSkillDir: string
rootDir: string
stagingDir: string
}
/** Durable observers are awaited; these are not UI progress listeners. */
export interface InstallTransactionObserver {
/** Called before download and again while holding all target locks. */
beforeTargetMutation?(canonicalTargets: readonly string[]): Promise<void>
/** Persist the chosen temporary path before creating its directory or extracting bytes. */
beforeStaging?(staging: InstallStaging): Promise<void>
/** Persist every staged target and the old inventory before the first rename. */
beforePreparation?(preparation: InstallPreparation): Promise<void>
beforeMove?(move: InstallMove): Promise<void>
afterMove?(move: InstallMove): Promise<void>
beforeInventoryCommit?(commit: InstallCommit): Promise<void>
afterInventoryCommit?(): Promise<void>
cleanupResult?(cleanup: InstallCleanup): Promise<void>
}
export interface InstallTransactionWarning {
stage: 'afterInventoryCommit' | 'backupCleanup' | 'cleanupResult'
message: string
path?: string
}