working setup flow + manifest localization

This commit is contained in:
Aiden McClelland
2026-01-20 18:28:28 -07:00
parent 6a1c1fde06
commit 3828b03790
51 changed files with 799 additions and 324 deletions

View File

@@ -1,3 +1,4 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { LocaleString } from "./LocaleString"
export type AddCategoryParams = { id: string; name: string }
export type AddCategoryParams = { id: string; name: LocaleString }

View File

@@ -1,9 +1,10 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { LocaleString } from "./LocaleString"
export type Alerts = {
install: string | null
uninstall: string | null
restore: string | null
start: string | null
stop: string | null
install: LocaleString | null
uninstall: LocaleString | null
restore: LocaleString | null
start: LocaleString | null
stop: LocaleString | null
}

View File

@@ -2,7 +2,7 @@
import type { EncryptedWire } from "./EncryptedWire"
export type AttachParams = {
startOsPassword: EncryptedWire | null
password: EncryptedWire | null
guid: string
kiosk?: boolean
}

View File

@@ -1,3 +1,4 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { LocaleString } from "./LocaleString"
export type Category = { name: string }
export type Category = { name: LocaleString }

View File

@@ -1,9 +1,10 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { DataUrl } from "./DataUrl"
import type { LocaleString } from "./LocaleString"
export type DependencyMetadata = {
title: string | null
title: LocaleString | null
icon: DataUrl | null
description: string | null
description: LocaleString | null
optional: boolean
}

View File

@@ -1,3 +1,4 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { LocaleString } from "./LocaleString"
export type Description = { short: string; long: string }
export type Description = { short: LocaleString; long: LocaleString }

View File

@@ -0,0 +1,9 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type KeyboardOptions = {
layout: string
keymap: string | null
model: string | null
variant: string | null
options: Array<string>
}

View File

@@ -0,0 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type LocaleString = string | Record<string, string>

View File

@@ -6,6 +6,7 @@ import type { GitHash } from "./GitHash"
import type { HardwareRequirements } from "./HardwareRequirements"
import type { ImageConfig } from "./ImageConfig"
import type { ImageId } from "./ImageId"
import type { LocaleString } from "./LocaleString"
import type { PackageId } from "./PackageId"
import type { Version } from "./Version"
import type { VolumeId } from "./VolumeId"
@@ -15,7 +16,7 @@ export type Manifest = {
title: string
version: Version
satisfies: Array<Version>
releaseNotes: string
releaseNotes: LocaleString
canMigrateTo: string
canMigrateFrom: string
license: string

View File

@@ -1,4 +1,5 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { LocaleString } from "./LocaleString"
import type { PathOrUrl } from "./PathOrUrl"
export type Metadata = { title: string; icon: PathOrUrl }
export type Metadata = { title: LocaleString; icon: PathOrUrl }

View File

@@ -5,6 +5,7 @@ import type { DependencyMetadata } from "./DependencyMetadata"
import type { Description } from "./Description"
import type { GitHash } from "./GitHash"
import type { HardwareRequirements } from "./HardwareRequirements"
import type { LocaleString } from "./LocaleString"
import type { MerkleArchiveCommitment } from "./MerkleArchiveCommitment"
import type { PackageId } from "./PackageId"
import type { RegistryAsset } from "./RegistryAsset"
@@ -15,7 +16,7 @@ export type PackageVersionInfo = {
title: string
icon: DataUrl
description: Description
releaseNotes: string
releaseNotes: LocaleString
gitHash: GitHash | null
license: string
wrapperRepo: string

View File

@@ -0,0 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type Pem = string

View File

@@ -1,5 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { Governor } from "./Governor"
import type { KeyboardOptions } from "./KeyboardOptions"
import type { LshwDevice } from "./LshwDevice"
import type { NetworkInfo } from "./NetworkInfo"
import type { ServerStatus } from "./ServerStatus"
@@ -27,4 +28,6 @@ export type ServerInfo = {
ram: number
devices: Array<LshwDevice>
kiosk: boolean | null
language: string | null
keyboard: KeyboardOptions | null
}

View File

@@ -3,8 +3,8 @@ import type { EncryptedWire } from "./EncryptedWire"
import type { RecoverySource } from "./RecoverySource"
export type SetupExecuteParams = {
startOsLogicalname: string
startOsPassword: EncryptedWire
guid: string
password: EncryptedWire
recoverySource: RecoverySource<EncryptedWire> | null
kiosk?: boolean
}

View File

@@ -0,0 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type SetupInfo = { guid: string | null; attach: boolean }

View File

@@ -1,8 +1,8 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { Pem } from "./Pem"
export type SetupResult = {
torAddresses: Array<string>
hostname: string
lanAddress: string
rootCa: string
rootCa: Pem
needsRestart: boolean
}

View File

@@ -1,7 +1,10 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { SetupInfo } from "./SetupInfo"
import type { SetupProgress } from "./SetupProgress"
import type { SetupResult } from "./SetupResult"
export type SetupStatusRes =
| ({ status: "complete" } & SetupResult)
| { status: "needs-install" }
| ({ status: "incomplete" } & SetupInfo)
| ({ status: "running" } & SetupProgress)
| ({ status: "complete" } & SetupResult)

View File

@@ -121,9 +121,11 @@ export { InstallingState } from "./InstallingState"
export { InstallParams } from "./InstallParams"
export { IpHostname } from "./IpHostname"
export { IpInfo } from "./IpInfo"
export { KeyboardOptions } from "./KeyboardOptions"
export { ListPackageSignersParams } from "./ListPackageSignersParams"
export { ListServiceInterfacesParams } from "./ListServiceInterfacesParams"
export { ListVersionSignersParams } from "./ListVersionSignersParams"
export { LocaleString } from "./LocaleString"
export { LoginParams } from "./LoginParams"
export { LshwDevice } from "./LshwDevice"
export { LshwDisplay } from "./LshwDisplay"
@@ -161,6 +163,7 @@ export { PackageState } from "./PackageState"
export { PackageVersionInfo } from "./PackageVersionInfo"
export { PasswordType } from "./PasswordType"
export { PathOrUrl } from "./PathOrUrl"
export { Pem } from "./Pem"
export { Percentage } from "./Percentage"
export { Progress } from "./Progress"
export { ProgressUnits } from "./ProgressUnits"
@@ -199,6 +202,7 @@ export { SetMainStatusStatus } from "./SetMainStatusStatus"
export { SetMainStatus } from "./SetMainStatus"
export { SetNameParams } from "./SetNameParams"
export { SetupExecuteParams } from "./SetupExecuteParams"
export { SetupInfo } from "./SetupInfo"
export { SetupProgress } from "./SetupProgress"
export { SetupResult } from "./SetupResult"
export { SetupStatusRes } from "./SetupStatusRes"

View File

@@ -48,9 +48,9 @@ export type SDKManifest = {
readonly docsUrl: string
readonly description: {
/** Short description to display on the marketplace list page. Max length 80 chars. */
readonly short: string
readonly short: T.LocaleString
/** Long description to display on the marketplace details page for this service. Max length 500 chars. */
readonly long: string
readonly long: T.LocaleString
}
/**
* override the StartOS version this package was made for
@@ -96,17 +96,17 @@ export type SDKManifest = {
readonly alerts?: {
/** An warning alert requiring user confirmation before proceeding with initial installation of this service. */
readonly install?: string | null
readonly install?: T.LocaleString | null
/** An warning alert requiring user confirmation before updating this service. */
readonly update?: string | null
readonly update?: T.LocaleString | null
/** An warning alert requiring user confirmation before uninstalling this service. */
readonly uninstall?: string | null
readonly uninstall?: T.LocaleString | null
/** An warning alert requiring user confirmation before restoring this service from backup. */
readonly restore?: string | null
readonly restore?: T.LocaleString | null
/** An warning alert requiring user confirmation before starting this service. */
readonly start?: string | null
readonly start?: T.LocaleString | null
/** An warning alert requiring user confirmation before stopping this service. */
readonly stop?: string | null
readonly stop?: T.LocaleString | null
}
/**
* @description A mapping of service dependencies to be displayed to users when viewing the Marketplace

View File

@@ -355,10 +355,13 @@ export class GetServiceInterface<Mapped = ServiceInterfaceFilled | null> {
const watch = this.watch(abort.signal)
const res = await watch.next()
if (this.effects.constRetry) {
watch.next().then(() => {
abort.abort()
this.effects.constRetry && this.effects.constRetry()
})
watch
.next()
.then(() => {
abort.abort()
this.effects.constRetry && this.effects.constRetry()
})
.catch()
}
return res.value
}

View File

@@ -55,10 +55,13 @@ export class GetServiceInterfaces<Mapped = ServiceInterfaceFilled[]> {
const watch = this.watch(abort.signal)
const res = await watch.next()
if (this.effects.constRetry) {
watch.next().then(() => {
abort.abort()
this.effects.constRetry && this.effects.constRetry()
})
watch
.next()
.then(() => {
abort.abort()
this.effects.constRetry && this.effects.constRetry()
})
.catch()
}
return res.value
}

View File

@@ -19,10 +19,13 @@ export class GetServiceManifest<Mapped = Manifest> {
const watch = this.watch(abort.signal)
const res = await watch.next()
if (this.effects.constRetry) {
watch.next().then(() => {
abort.abort()
this.effects.constRetry && this.effects.constRetry()
})
watch
.next()
.then(() => {
abort.abort()
this.effects.constRetry && this.effects.constRetry()
})
.catch()
}
return res.value
}

View File

@@ -230,10 +230,13 @@ export class FileHelper<A> {
eq,
]
this.consts.push(record)
watch.next().then(() => {
this.consts = this.consts.filter((r) => r !== record)
effects.constRetry && effects.constRetry()
})
watch
.next()
.then(() => {
this.consts = this.consts.filter((r) => r !== record)
effects.constRetry && effects.constRetry()
})
.catch()
}
return res.value
}
@@ -263,6 +266,7 @@ export class FileHelper<A> {
})
.catch((e) => console.error(asError(e)))
if (!prev || !eq(prev.value, newRes)) {
console.error("yielding", JSON.stringify({ prev: prev, newRes }))
yield newRes
}
prev = { value: newRes }