Sprites have no size presets and CPU/storage are fixed (8 vCPU / 100 GB), so memory policy (limit + autoscale) is the sizing lever for bursty unknown workloads. ensureSprite now applies idempotently, non-failing: - memoryAutoscale (default true) lets the platform grow memory under pressure instead of thrashing at a fixed cap - memoryLimitMB (0 = Fly default ceiling 8192) is the peak ceiling - Settings UI exposes both controls
72 lines
2.6 KiB
TypeScript
72 lines
2.6 KiB
TypeScript
import { defineSettings } from "@getpaseo/plugin";
|
|
import { z } from "zod";
|
|
|
|
export const flySpritesSettingsSchema = z.object({
|
|
token: z.string().default(""),
|
|
baseUrl: z.string().default("https://api.sprites.dev"),
|
|
flyOrgSlug: z.string().default(""),
|
|
openbaoEnabled: z.boolean().default(true),
|
|
openbaoAddr: z.string().default("https://bao.site.latha.org"),
|
|
openbaoAuthMount: z.string().default("jwt"),
|
|
openbaoRole: z.string().default("admin"),
|
|
openbaoKvMount: z.string().default("secret"),
|
|
openbaoSecretPath: z.string().default("paseo"),
|
|
openbaoSecretKey: z.string().default("FLY_TOKEN"),
|
|
zitadelIssuer: z.string().default("https://auth.site.latha.org"),
|
|
zitadelClientId: z.string().default("400222693598691513"),
|
|
zitadelScope: z.string().default("openid profile email"),
|
|
spritePrefix: z.string().default("paseo-agent-"),
|
|
defaultRegion: z.string().default(""),
|
|
defaultRamMB: z.number().int().nonnegative().default(0),
|
|
defaultCpus: z.number().int().nonnegative().default(0),
|
|
memoryLimitMB: z.number().int().nonnegative().default(0),
|
|
memoryAutoscale: z.boolean().default(true),
|
|
defaultRemoteCwd: z.string().default("/workspace"),
|
|
defaultProviderMode: z.enum(["shell", "acp"]).default("acp"),
|
|
acpCommand: z.string().default("claude-code-acp"),
|
|
syncWorkspaceOnCreate: z.boolean().default(true),
|
|
syncAntigravityAuth: z.boolean().default(true),
|
|
injectAgentTools: z.boolean().default(true),
|
|
autoCleanupOnArchive: z.boolean().default(false),
|
|
keepSpriteHostsAwake: z.boolean().default(true),
|
|
});
|
|
|
|
export type FlySpritesSettings = z.output<typeof flySpritesSettingsSchema>;
|
|
|
|
export const flySpritesSettings = defineSettings({
|
|
id: "fly-sprites",
|
|
scope: "host",
|
|
version: 1,
|
|
schema: flySpritesSettingsSchema,
|
|
});
|
|
|
|
export const defaultFlySpritesSettings: FlySpritesSettings = {
|
|
token: "",
|
|
baseUrl: "https://api.sprites.dev",
|
|
flyOrgSlug: "",
|
|
openbaoEnabled: true,
|
|
openbaoAddr: "https://bao.site.latha.org",
|
|
openbaoAuthMount: "jwt",
|
|
openbaoRole: "admin",
|
|
openbaoKvMount: "secret",
|
|
openbaoSecretPath: "paseo",
|
|
openbaoSecretKey: "FLY_TOKEN",
|
|
zitadelIssuer: "https://auth.site.latha.org",
|
|
zitadelClientId: "400222693598691513",
|
|
zitadelScope: "openid profile email",
|
|
spritePrefix: "paseo-agent-",
|
|
defaultRegion: "",
|
|
defaultRamMB: 0,
|
|
defaultCpus: 0,
|
|
memoryLimitMB: 0,
|
|
memoryAutoscale: true,
|
|
defaultRemoteCwd: "/workspace",
|
|
defaultProviderMode: "acp",
|
|
acpCommand: "claude-code-acp",
|
|
syncWorkspaceOnCreate: true,
|
|
syncAntigravityAuth: true,
|
|
injectAgentTools: true,
|
|
autoCleanupOnArchive: false,
|
|
keepSpriteHostsAwake: true,
|
|
};
|