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(),
|
||||
}),
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user