pi-freeflow 1.44.0 → 1.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +11 -13
  3. package/package.json +1 -1
  4. package/src/catalog.ts +38 -14
  5. package/src/client-recovery.ts +238 -0
  6. package/src/client-staging.ts +316 -0
  7. package/src/client.ts +117 -472
  8. package/src/cline-accounts.ts +26 -1223
  9. package/src/cline-device-auth.ts +5 -3
  10. package/src/cline-pool.ts +691 -0
  11. package/src/cline-roll.ts +642 -0
  12. package/src/commands-cline.ts +283 -0
  13. package/src/commands-relay.ts +808 -0
  14. package/src/commands-startup.ts +264 -0
  15. package/src/commands.ts +119 -1202
  16. package/src/config-paths.ts +254 -0
  17. package/src/config.ts +6 -687
  18. package/src/daemon.ts +16 -1
  19. package/src/deploy.ts +3 -1
  20. package/src/fingerprint-env.ts +334 -0
  21. package/src/fingerprint-tools.ts +348 -0
  22. package/src/index.ts +10 -6
  23. package/src/lane-translation.ts +263 -0
  24. package/src/models.ts +70 -112
  25. package/src/opencode-fingerprint.ts +29 -1310
  26. package/src/opencode-identity.ts +464 -0
  27. package/src/proxy-lanes.ts +1125 -0
  28. package/src/proxy-ports.ts +317 -0
  29. package/src/proxy.ts +74 -1385
  30. package/src/relay-codec.ts +365 -0
  31. package/src/relay-state.ts +10 -367
  32. package/src/relay.ts +78 -31
  33. package/src/sse-aggregator.ts +659 -0
  34. package/src/stream-cloak.ts +882 -0
  35. package/src/stream-pipe.ts +22 -871
  36. package/src/system-ca-fetch.ts +15 -4
  37. package/src/token.ts +7 -2
  38. package/src/tool-args.ts +10 -3
  39. package/src/tool-translation.ts +1 -236
  40. package/src/toolcall-audit.ts +20 -7
  41. package/src/update-checker.ts +17 -1
  42. package/src/update-core.ts +5 -2
  43. package/src/updater.ts +8 -3
  44. package/src/upstream-health.ts +22 -2
  45. package/src/zen-sidecar.ts +1 -0
  46. package/src/zen-transport.ts +48 -18
@@ -250,14 +250,16 @@ export async function pollDeviceToken(
250
250
  device_code: deviceCode,
251
251
  client_id: resolveClineWorkosClientId(),
252
252
  }),
253
- signal: AbortSignal.timeout(options?.timeoutMs ?? HTTP_TIMEOUT_MS),
253
+ signal: options?.signal
254
+ ? AbortSignal.any([options.signal, AbortSignal.timeout(options?.timeoutMs ?? HTTP_TIMEOUT_MS)])
255
+ : AbortSignal.timeout(options?.timeoutMs ?? HTTP_TIMEOUT_MS),
254
256
  });
255
257
  } catch (error) {
256
258
  if (outerSignal?.aborted) {
257
259
  throw new ClineAuthError("Device login cancelled", { errorCode: "cancelled" });
258
260
  }
259
261
  if (error instanceof ClineAuthError) throw error;
260
- if (Date.now() > deadline) throw new Error("WorkOS device authorization timed out");
262
+ if (Date.now() >= deadline) throw new Error("WorkOS device authorization timed out");
261
263
  await sleepMs(remainingMs(deadline, interval), outerSignal);
262
264
  continue;
263
265
  }
@@ -289,7 +291,7 @@ export async function pollDeviceToken(
289
291
  { status: response.status, errorCode: typeof payload.error === "string" ? payload.error : undefined },
290
292
  );
291
293
  }
292
- if (Date.now() > deadline) throw new Error("WorkOS device authorization timed out");
294
+ if (Date.now() >= deadline) throw new Error("WorkOS device authorization timed out");
293
295
  await sleepMs(remainingMs(deadline, interval), outerSignal);
294
296
  }
295
297
  }