English
craft-hub / CraftHubRuntime
Class: CraftHubRuntime
Defined in: packages/craft-hub/src/runtime.ts:70
Constructors
Constructor
new CraftHubRuntime(
options?):CraftHubRuntime
Defined in: packages/craft-hub/src/runtime.ts:129
Parameters
options?
string | CraftHubOptions = {}
Returns
CraftHubRuntime
Properties
accountProvider?
readonlyoptionalaccountProvider?:AccountProvider
Defined in: packages/craft-hub/src/runtime.ts:86
accountSync
readonlyaccountSync:AccountSyncService
Defined in: packages/craft-hub/src/runtime.ts:105
agentActions
readonlyagentActions:AgentActionService
Defined in: packages/craft-hub/src/runtime.ts:110
agentTasks
readonlyagentTasks:AgentTaskManager
Defined in: packages/craft-hub/src/runtime.ts:109
applicationMaintenance
readonlyapplicationMaintenance:ApplicationMaintenanceService
Defined in: packages/craft-hub/src/runtime.ts:72
Host-local read-only application discovery; does not require an installation plugin.
distribution
readonlydistribution:DistributionConfig
Defined in: packages/craft-hub/src/runtime.ts:116
dotfilesManager
readonlydotfilesManager:DotfilesManager
Defined in: packages/craft-hub/src/runtime.ts:94
environmentSetup
readonlyenvironmentSetup:EnvironmentSetupService
Defined in: packages/craft-hub/src/runtime.ts:101
environmentSources
readonlyenvironmentSources:EnvironmentSourceService
Defined in: packages/craft-hub/src/runtime.ts:102
gitIntegration
readonlygitIntegration:GitIntegration
Defined in: packages/craft-hub/src/runtime.ts:115
hostEnvironment
readonlyhostEnvironment:HostEnvironment
Defined in: packages/craft-hub/src/runtime.ts:85
integrationForms
readonlyintegrationForms:IntegrationFormService
Defined in: packages/craft-hub/src/runtime.ts:74
One-use native form reviews share the runtime's declaration, project and invocation boundaries.
integrationRegistry
readonlyintegrationRegistry:IntegrationRegistry
Defined in: packages/craft-hub/src/runtime.ts:112
ownerScopes
readonlyownerScopes:OwnerScopeService
Defined in: packages/craft-hub/src/runtime.ts:106
personalConfigRepository
readonlypersonalConfigRepository:PersonalConfigRepository
Defined in: packages/craft-hub/src/runtime.ts:93
personalGitSync
readonlypersonalGitSync:PersonalGitSyncService
Defined in: packages/craft-hub/src/runtime.ts:104
pluginManager
readonlypluginManager:PluginManager
Defined in: packages/craft-hub/src/runtime.ts:111
projects
readonlyprojects:ProjectRegistry
Defined in: packages/craft-hub/src/runtime.ts:88
releasePlanner
readonlyreleasePlanner:ReleasePlanner
Defined in: packages/craft-hub/src/runtime.ts:114
settings
readonlysettings:CraftHubSettingsService
Defined in: packages/craft-hub/src/runtime.ts:91
setupProfile
readonlysetupProfile:SetupProfileService
Defined in: packages/craft-hub/src/runtime.ts:100
softwareSources
readonlysoftwareSources:SoftwareSourceService
Defined in: packages/craft-hub/src/runtime.ts:99
store
readonlystore:CraftHubStore
Defined in: packages/craft-hub/src/runtime.ts:87
teamGitSync
readonlyteamGitSync:TeamGitSyncService
Defined in: packages/craft-hub/src/runtime.ts:107
teams
readonlyteams:TeamManager
Defined in: packages/craft-hub/src/runtime.ts:108
userConfig
readonlyuserConfig:UserConfigService
Defined in: packages/craft-hub/src/runtime.ts:92
workAssistant
readonlyworkAssistant:WorkAssistant
Defined in: packages/craft-hub/src/runtime.ts:89
workItemProjects
readonlyworkItemProjects:WorkItemProjectService
Defined in: packages/craft-hub/src/runtime.ts:90
workspaceCatalog
readonlyworkspaceCatalog:WorkspaceCatalogService
Defined in: packages/craft-hub/src/runtime.ts:97
workspaceImports
readonlyworkspaceImports:WorkspaceImportService
Defined in: packages/craft-hub/src/runtime.ts:103
workspaces
readonlyworkspaces:WorkspaceService
Defined in: packages/craft-hub/src/runtime.ts:95
workspaceSubscriptions
readonlyworkspaceSubscriptions:WorkspaceSubscriptionService
Defined in: packages/craft-hub/src/runtime.ts:96
Methods
addProject()
addProject(
path):Promise<ProjectRecord>
Defined in: packages/craft-hub/src/runtime.ts:221
Register a local project path without granting trust.
Parameters
path
string
Returns
Promise<ProjectRecord>
applyGitIntegration()
applyGitIntegration(
projectId,request):Promise<GitIntegrationResult>
Defined in: packages/craft-hub/src/runtime.ts:263
Recheck and apply a reviewed local Git integration Plan.
Parameters
projectId
string
request
Returns
Promise<GitIntegrationResult>
cancelAllRuns()
cancelAllRuns():
Promise<void>
Defined in: packages/craft-hub/src/runtime.ts:852
Stop every active run during application shutdown.
Returns
Promise<void>
cancelRun()
cancelRun(
runId):Promise<RunRecord>
Defined in: packages/craft-hub/src/runtime.ts:845
Stop an active run and wait for its final record.
Parameters
runId
string
Returns
Promise<RunRecord>
cancelSoftwareInstallation()
cancelSoftwareInstallation(
sourceId,runId):Promise<{createdAt:string;id:string;items:object[];planId:string;retryOf?:string;sourceId:string;state:"waiting"|"running"|"completed"|"cancelled"|"failed"|"queued"|"cancelling"|"interrupted";updatedAt:string;version:1; }>
Defined in: packages/craft-hub/src/runtime.ts:364
Stop active and pending work through the software worker owner.
Parameters
sourceId
string
runId
string
Returns
Promise<{ createdAt: string; id: string; items: object[]; planId: string; retryOf?: string; sourceId: string; state: "waiting" | "running" | "completed" | "cancelled" | "failed" | "queued" | "cancelling" | "interrupted"; updatedAt: string; version: 1; }>
capabilities()
capabilities(
projectId):Promise<Capability[]>
Defined in: packages/craft-hub/src/runtime.ts:268
Discover the current capabilities for one registered project.
Parameters
projectId
string
Returns
Promise<Capability[]>
capabilityDiscovery()
capabilityDiscovery(
projectId,requestedLocale?):Promise<CapabilityDiscoveryResult>
Defined in: packages/craft-hub/src/runtime.ts:565
Discover capabilities and non-fatal diagnostics for one registered project.
Parameters
projectId
string
requestedLocale?
"en" | "zh-CN"
Returns
Promise<CapabilityDiscoveryResult>
capabilityPins()
capabilityPins(
projectId):Promise<CapabilityPins>
Defined in: packages/craft-hub/src/runtime.ts:706
Return the current capability ids represented by this project's machine-local pin order.
Parameters
projectId
string
Returns
Promise<CapabilityPins>
cleanupRuns()
cleanupRuns(
options):Promise<RunCleanupResult>
Defined in: packages/craft-hub/src/runtime.ts:822
Delete unpinned persisted runs matching the requested retention policy.
Parameters
options
Returns
Promise<RunCleanupResult>
close()
close():
Promise<void>
Defined in: packages/craft-hub/src/runtime.ts:860
Cancel active agent tasks and commands during host shutdown.
Returns
Promise<void>
completeIntegrationConnection()
completeIntegrationConnection(
integrationId,input):Promise<void>
Defined in: packages/craft-hub/src/runtime.ts:543
Finish only an OAuth session previously started through an enabled integration.
Parameters
integrationId
string
input
Record<string, unknown>
Returns
Promise<void>
diagnosticSnapshot()
diagnosticSnapshot():
Promise<WorkbenchDiagnosticSnapshot>
Defined in: packages/craft-hub/src/runtime.ts:278
Collect current host, extension, and configuration failures for client presentation.
Returns
Promise<WorkbenchDiagnosticSnapshot>
getPluginDiagnostics()
getPluginDiagnostics(): readonly
PluginDiagnostic[]
Defined in: packages/craft-hub/src/runtime.ts:736
Diagnostics from the most recent plugin discovery pass.
Returns
readonly PluginDiagnostic[]
initializeProjectConfig()
initializeProjectConfig(
projectId,mode,expectedRevision?):Promise<ProjectConfigInitializationResult>
Defined in: packages/craft-hub/src/runtime.ts:231
Preview or create one registered project's optional repository-owned configuration.
Parameters
projectId
string
mode
ProjectConfigInitializationMode
expectedRevision?
string
Returns
Promise<ProjectConfigInitializationResult>
installSoftware()
installSoftware(
sourceId,planId,confirmed):Promise<{createdAt:string;id:string;items:object[];planId:string;retryOf?:string;sourceId:string;state:"waiting"|"running"|"completed"|"cancelled"|"failed"|"queued"|"cancelling"|"interrupted";updatedAt:string;version:1; }>
Defined in: packages/craft-hub/src/runtime.ts:352
Install an explicitly reviewed adapter plan on this local machine.
Parameters
sourceId
string
planId
string
confirmed
boolean
Returns
Promise<{ createdAt: string; id: string; items: object[]; planId: string; retryOf?: string; sourceId: string; state: "waiting" | "running" | "completed" | "cancelled" | "failed" | "queued" | "cancelling" | "interrupted"; updatedAt: string; version: 1; }>
integrationContributions()
integrationContributions():
Promise<{diagnostics:IntegrationDiagnostic[];integrations:ResolvedIntegrationContribution[]; }>
Defined in: packages/craft-hub/src/runtime.ts:273
Resolve installed marketplace integration declarations against trusted host providers.
Returns
Promise<{ diagnostics: IntegrationDiagnostic[]; integrations: ResolvedIntegrationContribution[]; }>
integrationSourcePath()
integrationSourcePath(
integrationId,actionId,entityId,detailIndex,projectId?):Promise<string>
Defined in: packages/craft-hub/src/runtime.ts:552
Resolve a source from a fresh provider result, never a renderer-supplied path.
Parameters
integrationId
string
actionId
string
entityId
string
detailIndex
number
projectId?
string
Returns
Promise<string>
integrationViewFilters()
integrationViewFilters(
options):Promise<unknown>
Defined in: packages/craft-hub/src/runtime.ts:517
Persist display filters in local, account-isolated storage after validating the installed view.
Parameters
options
accountKey?
string
blockId
string
filters?
unknown
integrationId
string
projectId?
string
viewId
string
Returns
Promise<unknown>
invokeIntegrationAction()
invokeIntegrationAction(
options):Promise<IntegrationActionResult>
Defined in: packages/craft-hub/src/runtime.ts:387
Parameters
options
actionId
string
callbackUrl?
string
confirmed?
boolean
input?
Record<string, unknown>
integrationId
string
projectId?
string
reviewedAction?
unknown
reviewedConnection?
unknown
Returns
Promise<IntegrationActionResult>
localEnvironmentSnapshot()
localEnvironmentSnapshot():
Promise<LocalEnvironmentSnapshot>
Defined in: packages/craft-hub/src/runtime.ts:302
Inspect fixed tools on a local API host, sharing only concurrent requests.
Returns
Promise<LocalEnvironmentSnapshot>
onIntegrationsChanged()
onIntegrationsChanged(
listener): () =>void
Defined in: packages/craft-hub/src/runtime.ts:382
Observe attempted integration writes after they settle; reads and denied confirmations do not emit.
Parameters
listener
(integrationId) => void
Returns
() => void
onRunsChanged()
onRunsChanged(
listener): () =>void
Defined in: packages/craft-hub/src/runtime.ts:827
Subscribe to execution summary changes.
Parameters
listener
(summary) => void
Returns
() => void
openSoftwareApplication()
openSoftwareApplication(
sourceId,softwareId):Promise<{destination:"application";softwareId:string;version:1; }>
Defined in: packages/craft-hub/src/runtime.ts:370
Request a detected application launch through its trusted catalog identifier.
Parameters
sourceId
string
softwareId
string
Returns
Promise<{ destination: "application"; softwareId: string; version: 1; }>
pinRun()
pinRun(
runId,pinned):Promise<RunRecord>
Defined in: packages/craft-hub/src/runtime.ts:817
Set whether a persisted run is exempt from automatic retention.
Parameters
runId
string
pinned
boolean
Returns
Promise<RunRecord>
planGitIntegration()
planGitIntegration(
projectId,request?):Promise<GitIntegrationPlan>
Defined in: packages/craft-hub/src/runtime.ts:258
Compute a fresh, side-effect-free Plan for integrating the current local Git branch.
Parameters
projectId
string
request?
Returns
Promise<GitIntegrationPlan>
previewCommand()
previewCommand(
projectId,capabilityId,inputs?):Promise<CommandInvocation>
Defined in: packages/craft-hub/src/runtime.ts:741
Resolve and validate one command invocation without executing it.
Parameters
projectId
string
capabilityId
string
inputs?
CommandInputValues = {}
Returns
Promise<CommandInvocation>
projectOverview()
projectOverview(
projectId,packagePath?,requestedLocale?):Promise<ProjectOverview>
Defined in: packages/craft-hub/src/runtime.ts:684
Resolve one contextual project or package overview and its bounded README.
Parameters
projectId
string
packagePath?
string = '.'
requestedLocale?
"en" | "zh-CN"
Returns
Promise<ProjectOverview>
projectOverviewAsset()
projectOverviewAsset(
projectId,projectRelativePath):Promise<{content:Buffer;contentType:string; } |undefined>
Defined in: packages/craft-hub/src/runtime.ts:700
Read one bounded raster asset contained by a registered project.
Parameters
projectId
string
projectRelativePath
string
Returns
Promise<{ content: Buffer; contentType: string; } | undefined>
projectRunSummaries()
projectRunSummaries():
ProjectRunSummary[]
Defined in: packages/craft-hub/src/runtime.ts:803
Current per-project execution summaries for UI and API consumers.
Returns
projectSkills()
projectSkills(
projectId):Promise<ProjectSkillsState>
Defined in: packages/craft-hub/src/runtime.ts:657
Return effective repository and machine-local Skill activation state.
Parameters
projectId
string
Returns
Promise<ProjectSkillsState>
protectProfile()
protectProfile():
Promise<void>
Defined in: packages/craft-hub/src/runtime.ts:874
Hold a shared migration barrier for the lifetime of a host or direct CLI operation.
Returns
Promise<void>
releasePlan()
releasePlan(
projectId,capabilityId,inputs?):Promise<ReleasePlan>
Defined in: packages/craft-hub/src/runtime.ts:753
Compute a fresh release preflight without mutating the repository.
Parameters
projectId
string
capabilityId
string
inputs?
CommandInputValues = {}
Returns
Promise<ReleasePlan>
resizeRun()
resizeRun(
runId,columns,rows):void
Defined in: packages/craft-hub/src/runtime.ts:838
Resize the pseudo-terminal attached to an active run.
Parameters
runId
string
columns
number
rows
number
Returns
void
run()
run(
projectId,capabilityId,onOutput?,inputs?,approval?):Promise<RunHandle>
Defined in: packages/craft-hub/src/runtime.ts:762
Execute a discovered command after trust/input validation; optional host reviews are rechecked before spawn.
Parameters
projectId
string
capabilityId
string
onOutput?
(event) => void
inputs?
CommandInputValues = {}
approval?
Returns
Promise<RunHandle>
runs()
runs():
Promise<RunRecord[]>
Defined in: packages/craft-hub/src/runtime.ts:812
List persisted run records.
Returns
Promise<RunRecord[]>
softwareCatalogSnapshot()
softwareCatalogSnapshot(
__namedParameters?):Promise<SoftwareCatalogSnapshot>
Defined in: packages/craft-hub/src/runtime.ts:312
Browse cached metadata; optionally overlay read-only plugin discovery on local hosts.
Parameters
__namedParameters?
localDiscovery?
boolean = true
Returns
Promise<SoftwareCatalogSnapshot>
softwareInstallationPlan()
softwareInstallationPlan(
sourceId,softwareIds):Promise<{createdAt:string;id:string;items:object[];prerequisites:string[];sourceId:string;version:1; }>
Defined in: packages/craft-hub/src/runtime.ts:346
Review selected host software without changing project trust or installing packages.
Parameters
sourceId
string
softwareIds
string[]
Returns
Promise<{ createdAt: string; id: string; items: object[]; prerequisites: string[]; sourceId: string; version: 1; }>
softwareInstallationRuns()
softwareInstallationRuns(
sourceId):Promise<{runs:object[];version:1; }>
Defined in: packages/craft-hub/src/runtime.ts:358
Recover recent adapter-owned software progress after a client refresh.
Parameters
sourceId
string
Returns
Promise<{ runs: object[]; version: 1; }>
unregisterProject()
unregisterProject(
projectId):Promise<ProjectRecord>
Defined in: packages/craft-hub/src/runtime.ts:226
Remove a project registration without deleting its directory.
Parameters
projectId
string
Returns
Promise<ProjectRecord>
updateCapabilityPins()
updateCapabilityPins(
projectId,capabilityIds):Promise<CapabilityPins>
Defined in: packages/craft-hub/src/runtime.ts:721
Replace one project's machine-local pin order after validating every capability id.
Parameters
projectId
string
capabilityIds
string[]
Returns
Promise<CapabilityPins>
updateProjectSkills()
updateProjectSkills(
projectId,input):Promise<ProjectSkillsState>
Defined in: packages/craft-hub/src/runtime.ts:676
Replace machine-local Skill preferences after validating their bounded shape.
Parameters
projectId
string
input
Returns
Promise<ProjectSkillsState>
updateSoftwareFavorite()
updateSoftwareFavorite(
request):Promise<SoftwareFavoritesSnapshot>
Defined in: packages/craft-hub/src/runtime.ts:318
Change favorites while preserving all other home settings, with the caller's inspected revision.
Parameters
request
unknown
Returns
Promise<SoftwareFavoritesSnapshot>
withConfiguration()
withConfiguration<
T>(action):Promise<T>
Defined in: packages/craft-hub/src/runtime.ts:214
Serialize account synchronization with configuration API mutations in this runtime.
Type Parameters
T
T
Parameters
action
() => Promise<T>
Returns
Promise<T>
writeRun()
writeRun(
runId,data):void
Defined in: packages/craft-hub/src/runtime.ts:833
Send terminal input to an active run.
Parameters
runId
string
data
string
Returns
void