feat: lease-based Sprite keepalive with expiry and renewal
Replace forever-on heartbeat billing with a finite lease system: callers request a window of Sprite time and renew as needed; on expiry the heartbeat session stops and the Sprite auto-pauses. - SpriteLeaseStore (server/sprite-lease-store.ts): refcounted leases with TTL clamping ([60s, 8h], default 15min) persisted to sprite-leases.json - SpriteHostKeepalive reimplemented on leases; legacy keepalive-hosts manifest seeds one final window then clears - Provider: session.open acquires, session.prompt renews, session.close releases - sprite_* tools and RPCs acquire/renew/release via sprites.lease.acquire/renew/release/list - destroy/archive release leases before deleting Sprites - Settings: defaultLeaseMinutes (1-480, default 30), schema v2
This commit is contained in:
1 parent
4ae69f54ce
commit
ec93b5a215
8 files changed
+591
-98
No files matched your search
+3
-1
@@ -29,6 +29,7 @@ export const flySpritesSettingsSchema = z.object({
|
||||
injectAgentTools: z.boolean().default(true),
|
||||
autoCleanupOnArchive: z.boolean().default(false),
|
||||
keepSpriteHostsAwake: z.boolean().default(true),
|
||||
defaultLeaseMinutes: z.number().int().min(1).max(480).default(30),
|
||||
});
|
||||
|
||||
export type FlySpritesSettings = z.output<typeof flySpritesSettingsSchema>;
|
||||
@@ -36,7 +37,7 @@ export type FlySpritesSettings = z.output<typeof flySpritesSettingsSchema>;
|
||||
export const flySpritesSettings = defineSettings({
|
||||
id: "fly-sprites",
|
||||
scope: "host",
|
||||
version: 1,
|
||||
version: 2,
|
||||
schema: flySpritesSettingsSchema,
|
||||
});
|
||||
|
||||
@@ -68,4 +69,5 @@ export const defaultFlySpritesSettings: FlySpritesSettings = {
|
||||
injectAgentTools: true,
|
||||
autoCleanupOnArchive: false,
|
||||
keepSpriteHostsAwake: true,
|
||||
defaultLeaseMinutes: 30,
|
||||
};
|
||||
Reference in new issue
Block a user