feat: switch to managed Paseo Sprite agents, remote hosts, and Fly token exchange
This commit is contained in:
1 parent
9188bfc277
commit
32c02cb3cd
14 files changed
+1860
-446
No files matched your search
+94
-1
@@ -41,6 +41,34 @@ export const CheckpointSummarySchema = z.object({
|
||||
|
||||
export type CheckpointSummary = z.output<typeof CheckpointSummarySchema>;
|
||||
|
||||
export const SpriteHostSummarySchema = z.object({
|
||||
registrationId: z.string(),
|
||||
serverId: z.string().nullable(),
|
||||
label: z.string(),
|
||||
spriteName: z.string(),
|
||||
status: z.enum(["error", "connecting", "online", "offline", "disabled"]),
|
||||
error: z.string().nullable(),
|
||||
});
|
||||
|
||||
export type SpriteHostSummary = z.output<typeof SpriteHostSummarySchema>;
|
||||
|
||||
export const SpriteAgentSummarySchema = z.object({
|
||||
agentId: z.string(),
|
||||
serverId: z.string(),
|
||||
hostLabel: z.string(),
|
||||
spriteName: z.string(),
|
||||
title: z.string().nullable(),
|
||||
status: z.string(),
|
||||
provider: z.string(),
|
||||
model: z.string().nullable(),
|
||||
cwd: z.string(),
|
||||
lastError: z.string().nullable(),
|
||||
pendingPermissionsCount: z.number(),
|
||||
updatedAt: z.string(),
|
||||
});
|
||||
|
||||
export type SpriteAgentSummary = z.output<typeof SpriteAgentSummarySchema>;
|
||||
|
||||
export const TokenSourceSchema = z.enum(["settings", "openbao", "env", "none"]);
|
||||
export type TokenSource = z.output<typeof TokenSourceSchema>;
|
||||
|
||||
@@ -95,7 +123,72 @@ export const statusRpc = defineRpc({
|
||||
tokenSource: TokenSourceSchema,
|
||||
remoteError: z.string().nullable(),
|
||||
sprites: z.array(SpriteSummarySchema),
|
||||
workers: z.array(WorkerSummarySchema),
|
||||
spriteHosts: z.array(SpriteHostSummarySchema),
|
||||
spriteAgents: z.array(SpriteAgentSummarySchema),
|
||||
agentSprites: z.record(z.string(), z.string()),
|
||||
}),
|
||||
});
|
||||
|
||||
export const ensureSpriteHostRpc = defineRpc({
|
||||
name: "sprites.host.ensure",
|
||||
input: z.object({
|
||||
spriteName: z.string().optional(),
|
||||
syncLocalPath: z.string().optional(),
|
||||
remoteDir: z.string().optional(),
|
||||
}),
|
||||
output: z.discriminatedUnion("ok", [
|
||||
z.object({
|
||||
ok: z.literal(true),
|
||||
spriteName: z.string(),
|
||||
serverId: z.string(),
|
||||
registrationId: z.string(),
|
||||
remoteDir: z.string(),
|
||||
syncedFiles: z.number().optional(),
|
||||
}),
|
||||
z.object({
|
||||
ok: z.literal(false),
|
||||
error: z.string(),
|
||||
}),
|
||||
]),
|
||||
});
|
||||
|
||||
export const launchSpriteAgentRpc = defineRpc({
|
||||
name: "sprites.agent.launch",
|
||||
input: z.object({
|
||||
spriteName: z.string().optional(),
|
||||
title: z.string().optional(),
|
||||
prompt: z.string().optional(),
|
||||
syncLocalPath: z.string().optional(),
|
||||
remoteDir: z.string().optional(),
|
||||
provider: z.string().optional(),
|
||||
}),
|
||||
output: z.discriminatedUnion("ok", [
|
||||
z.object({
|
||||
ok: z.literal(true),
|
||||
agentId: z.string(),
|
||||
serverId: z.string(),
|
||||
spriteName: z.string(),
|
||||
provider: z.string(),
|
||||
remoteDir: z.string(),
|
||||
syncedFiles: z.number().optional(),
|
||||
}),
|
||||
z.object({
|
||||
ok: z.literal(false),
|
||||
error: z.string(),
|
||||
}),
|
||||
]),
|
||||
});
|
||||
|
||||
export const spriteAgentActionRpc = defineRpc({
|
||||
name: "sprites.agent.action",
|
||||
input: z.object({
|
||||
serverId: z.string(),
|
||||
agentId: z.string(),
|
||||
action: z.enum(["interrupt", "archive"]),
|
||||
}),
|
||||
output: z.object({
|
||||
ok: z.boolean(),
|
||||
error: z.string().optional(),
|
||||
}),
|
||||
});
|
||||
|
||||
|
||||
+6
-4
@@ -4,6 +4,7 @@ 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"),
|
||||
@@ -14,12 +15,12 @@ export const flySpritesSettingsSchema = z.object({
|
||||
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-worker-"),
|
||||
spritePrefix: z.string().default("paseo-agent-"),
|
||||
defaultRegion: z.string().default(""),
|
||||
defaultRamMB: z.number().int().nonnegative().default(0),
|
||||
defaultCpus: z.number().int().nonnegative().default(0),
|
||||
defaultRemoteCwd: z.string().default("/workspace"),
|
||||
defaultProviderMode: z.enum(["shell", "acp"]).default("shell"),
|
||||
defaultProviderMode: z.enum(["shell", "acp"]).default("acp"),
|
||||
acpCommand: z.string().default("claude-code-acp"),
|
||||
syncWorkspaceOnCreate: z.boolean().default(true),
|
||||
injectAgentTools: z.boolean().default(true),
|
||||
@@ -38,6 +39,7 @@ export const flySpritesSettings = defineSettings({
|
||||
export const defaultFlySpritesSettings: FlySpritesSettings = {
|
||||
token: "",
|
||||
baseUrl: "https://api.sprites.dev",
|
||||
flyOrgSlug: "",
|
||||
openbaoEnabled: true,
|
||||
openbaoAddr: "https://bao.site.latha.org",
|
||||
openbaoAuthMount: "jwt",
|
||||
@@ -48,12 +50,12 @@ export const defaultFlySpritesSettings: FlySpritesSettings = {
|
||||
zitadelIssuer: "https://auth.site.latha.org",
|
||||
zitadelClientId: "400222693598691513",
|
||||
zitadelScope: "openid profile email",
|
||||
spritePrefix: "paseo-worker-",
|
||||
spritePrefix: "paseo-agent-",
|
||||
defaultRegion: "",
|
||||
defaultRamMB: 0,
|
||||
defaultCpus: 0,
|
||||
defaultRemoteCwd: "/workspace",
|
||||
defaultProviderMode: "shell",
|
||||
defaultProviderMode: "acp",
|
||||
acpCommand: "claude-code-acp",
|
||||
syncWorkspaceOnCreate: true,
|
||||
injectAgentTools: true,
|
||||
|
||||
Reference in new issue
Block a user