v0.2.3 Core tier 10/5/5 split + dynamic health version
This commit is contained in:
@@ -3,8 +3,9 @@ import { v_0_1_0 } from './v0.1.0'
|
||||
import { v_0_2_0 } from './v0.2.0'
|
||||
import { v_0_2_1 } from './v0.2.1'
|
||||
import { v_0_2_2 } from './v0.2.2'
|
||||
import { v_0_2_3 } from './v0.2.3'
|
||||
|
||||
export const versionGraph = VersionGraph.of({
|
||||
current: v_0_2_2,
|
||||
other: [v_0_2_1, v_0_2_0, v_0_1_0],
|
||||
current: v_0_2_3,
|
||||
other: [v_0_2_2, v_0_2_1, v_0_2_0, v_0_1_0],
|
||||
})
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
import { VersionInfo } from '@start9labs/start-sdk'
|
||||
import { configFile } from '../file-models/config.json'
|
||||
|
||||
export const v_0_2_3 = VersionInfo.of({
|
||||
version: '0.2.3:0',
|
||||
releaseNotes: {
|
||||
en_US:
|
||||
'Core tier reworked: 10 lifetime credits (was 5), with the first 5 served via Gemini and the next 5 via operator hardware. /relay/health now reports the actual package version. Existing installs migrate their saved tier-quota blob automatically on upgrade.',
|
||||
},
|
||||
migrations: {
|
||||
// Update the saved tier-quota JSON for installs that came up under
|
||||
// v0.2.0–v0.2.2 (Core: 5 lifetime, all Gemini). Idempotent — if
|
||||
// the operator has already moved away from the old defaults via
|
||||
// Adjust Tier Quotas, we leave their values alone.
|
||||
up: async ({ effects }) => {
|
||||
const current = await configFile.read().once()
|
||||
if (!current?.relay_tier_quotas_json) return
|
||||
let parsed: any = {}
|
||||
try {
|
||||
parsed = JSON.parse(current.relay_tier_quotas_json)
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
// Migrate only the legacy default shape — operator-edited blobs
|
||||
// are left alone. The legacy shape was exactly: core.lifetime=5
|
||||
// AND no geminiCapLifetime field present.
|
||||
const isLegacyCore =
|
||||
parsed?.core?.lifetime === 5 &&
|
||||
parsed?.core?.geminiCapLifetime === undefined
|
||||
if (!isLegacyCore) return
|
||||
parsed.core = {
|
||||
lifetime: 10,
|
||||
geminiCapLifetime: 5,
|
||||
monthly: null,
|
||||
geminiCapMonthly: null,
|
||||
}
|
||||
await configFile.merge(effects, {
|
||||
relay_tier_quotas_json: JSON.stringify(parsed),
|
||||
})
|
||||
},
|
||||
down: async ({ effects }) => {},
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user