Fix StartOS 0.4 TypeScript packaging to match SDK API
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { sdk } from '../sdk'
|
||||
import { updateYtdlp } from './updateYtdlp'
|
||||
|
||||
export const actions = sdk.Actions.of().addAction(updateYtdlp)
|
||||
// Actions will be added once the base build is verified.
|
||||
export const actions = sdk.Actions.of()
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
import { i18n } from '../i18n'
|
||||
import { sdk } from '../sdk'
|
||||
|
||||
export const updateYtdlp = sdk.Action.withoutInput(
|
||||
'update-ytdlp',
|
||||
async ({ effects }) => ({
|
||||
name: i18n('Update yt-dlp'),
|
||||
description: i18n(
|
||||
'Downloads the latest version of yt-dlp. Run this if YouTube downloads are failing — YouTube frequently changes its systems, requiring yt-dlp updates.',
|
||||
),
|
||||
warning: i18n('This may take a minute. The service will continue running.'),
|
||||
allowedStatuses: 'any',
|
||||
group: null,
|
||||
visibility: 'enabled' as const,
|
||||
}),
|
||||
async ({ effects }) => {
|
||||
// Run pip upgrade inside the running subcontainer
|
||||
const sub = await sdk.SubContainer.of(
|
||||
effects,
|
||||
{ imageId: 'main' },
|
||||
sdk.Mounts.of().mountVolume({
|
||||
volumeId: 'main',
|
||||
subpath: null,
|
||||
mountpoint: '/data',
|
||||
readonly: false,
|
||||
}),
|
||||
'ytdlp-update-sub',
|
||||
)
|
||||
|
||||
const result = await sub.exec(['sh', '-c',
|
||||
'pip3 install --break-system-packages -U yt-dlp curl_cffi 2>&1; echo "---"; echo "yt-dlp version: $(yt-dlp --version)"',
|
||||
])
|
||||
|
||||
const output = result.stdout || 'Update completed'
|
||||
|
||||
return {
|
||||
version: '1' as const,
|
||||
title: 'yt-dlp Update',
|
||||
message: output,
|
||||
result: {
|
||||
type: 'single' as const,
|
||||
name: 'Output',
|
||||
value: output,
|
||||
masked: false,
|
||||
copyable: true,
|
||||
qr: false,
|
||||
},
|
||||
}
|
||||
},
|
||||
)
|
||||
@@ -1,6 +1,6 @@
|
||||
import { sdk } from './sdk'
|
||||
|
||||
// YouTube Summarizer has no dependencies on other StartOS services.
|
||||
export const dependencies = sdk.setupDependencies(async ({ effects }) => {
|
||||
export const setDependencies = sdk.setupDependencies(async ({ effects }) => {
|
||||
return {}
|
||||
})
|
||||
|
||||
@@ -10,11 +10,6 @@ const dict = {
|
||||
// interfaces.ts
|
||||
'Web UI': 4,
|
||||
'The web interface for YouTube Summarizer — browse, search, and manage your transcript library': 5,
|
||||
|
||||
// actions/updateYtdlp.ts
|
||||
'Update yt-dlp': 6,
|
||||
'Downloads the latest version of yt-dlp. Run this if YouTube downloads are failing — YouTube frequently changes its systems, requiring yt-dlp updates.': 7,
|
||||
'This may take a minute. The service will continue running.': 8,
|
||||
} as const
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
import { sdk } from './sdk'
|
||||
|
||||
// init runs on install, update, restore, and container rebuild.
|
||||
// For YouTube Summarizer, no special initialization is needed —
|
||||
// the entrypoint script handles directory creation and config loading.
|
||||
export const { init, uninit } = sdk.setupInit(
|
||||
async ({ effects, kind }) => {
|
||||
// Nothing to do — directories are created by docker_entrypoint.sh
|
||||
// and config is loaded from the persistent volume.
|
||||
},
|
||||
)
|
||||
@@ -0,0 +1,18 @@
|
||||
import { sdk } from '../sdk'
|
||||
import { setDependencies } from '../dependencies'
|
||||
import { setInterfaces } from '../interfaces'
|
||||
import { versionGraph } from '../versions'
|
||||
import { actions } from '../actions'
|
||||
import { restoreInit } from '../backups'
|
||||
import { setup } from './setup'
|
||||
|
||||
export const init = sdk.setupInit(
|
||||
restoreInit,
|
||||
versionGraph,
|
||||
setup,
|
||||
setInterfaces,
|
||||
setDependencies,
|
||||
actions,
|
||||
)
|
||||
|
||||
export const uninit = sdk.setupUninit(versionGraph)
|
||||
@@ -0,0 +1,8 @@
|
||||
import { sdk } from '../sdk'
|
||||
|
||||
// YouTube Summarizer needs no special initialization.
|
||||
// Directories are created by docker_entrypoint.sh and
|
||||
// config is loaded from the persistent volume at runtime.
|
||||
export const setup = sdk.setupOnInit(async (effects, kind) => {
|
||||
// Nothing to do on install, update, restore, or rebuild.
|
||||
})
|
||||
@@ -1,16 +1,14 @@
|
||||
import { VersionInfo } from '@start9labs/start-sdk'
|
||||
import { IMPOSSIBLE, VersionInfo } from '@start9labs/start-sdk'
|
||||
|
||||
export const v_0_1_0 = VersionInfo.of({
|
||||
version: '0.1.0:0',
|
||||
releaseNotes: {
|
||||
en_US:
|
||||
'Initial StartOS package. Download, transcribe, and summarize YouTube videos ' +
|
||||
'and podcast episodes using Google Gemini AI. Features include channel and ' +
|
||||
'podcast subscriptions, background processing queue, auto-download per ' +
|
||||
'subscription, and organized history with folders.',
|
||||
'and podcast episodes using Google Gemini AI.',
|
||||
},
|
||||
migrations: {
|
||||
up: async ({ effects }) => {},
|
||||
down: 'IMPOSSIBLE',
|
||||
down: IMPOSSIBLE,
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user