feat: add async Sprite job manager with progress polling
- Add SpriteJobManager and job RPCs (start/get/list) for connect, launch, create, and sync operations - Time-box status RPC with 5s remote timeout and lazy remote fetching - Cache remote sprites, raw token, and host/agent lists to avoid redundant API calls - Harden sprite host exec timeouts, JSON parsing, and npm install with --no-audit --no-fund - UI: poll active jobs with phase updates in workers screen - Reduce token exchange and OpenBao request timeout to 8s
This commit is contained in:
1 parent
32c02cb3cd
commit
36d88ef168
8 files changed
+1142
-186
No files matched your search
@@ -49,8 +49,9 @@ interface CachedSecret {
|
||||
}
|
||||
|
||||
const SECRET_CACHE_TTL_MS = 5 * 60_000;
|
||||
const SECRET_CACHE_TTL_COLD_MS = 30 * 60_000;
|
||||
const DISCOVERY_CACHE_TTL_MS = 60 * 60_000;
|
||||
const REQUEST_TIMEOUT_MS = 15_000;
|
||||
const REQUEST_TIMEOUT_MS = 8_000;
|
||||
|
||||
function sessionFilePath(): string {
|
||||
const base = process.env.PASEO_HOME || path.join(homedir(), ".paseo");
|
||||
@@ -356,8 +357,8 @@ export class OpenBaoClient {
|
||||
].join("|");
|
||||
}
|
||||
|
||||
async getSecretToken(forceRefresh = false): Promise<string> {
|
||||
const settings = await this.getSettings();
|
||||
async getSecretToken(forceRefresh = false, settingsOverride?: FlySpritesSettings): Promise<string> {
|
||||
const settings = settingsOverride ?? (await this.getSettings());
|
||||
if (!settings.openbaoEnabled) {
|
||||
return "";
|
||||
}
|
||||
@@ -460,7 +461,7 @@ export class OpenBaoClient {
|
||||
cacheKey,
|
||||
token: found,
|
||||
pulledAt: new Date().toISOString(),
|
||||
expiresAtMs: Date.now() + SECRET_CACHE_TTL_MS,
|
||||
expiresAtMs: Date.now() + SECRET_CACHE_TTL_COLD_MS,
|
||||
};
|
||||
return found;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user