@omnicross/subscriptions 0.1.4 → 0.1.6

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.
package/dist/index.d.cts CHANGED
@@ -80,13 +80,11 @@ interface SubscriptionCredentialStore {
80
80
  * → sort by `priority` asc → effective `lastUsedAt` asc (LRU) → `createdAt` asc
81
81
  * → `[0]`.
82
82
  *
83
- * A faithful port of CRS `sortAccountsByPriority` + `unifiedClaudeScheduler`
84
- * session mapping. The class holds process-lived state the affinity map and an
85
- * in-memory `lastUsedAt` overlay (the authoritative live tie-break value, seeded
86
- * from the persisted field and advanced to `now` on each selection so repeated
87
- * selections round-robin fairly even before any durable persist). ONE instance is
88
- * constructed at bootstrap and SHARED by all three auth strategies (each scopes
89
- * its calls by `providerId`), mirroring the single long-lived CRS scheduler.
83
+ * The class holds process-lived state: a session-affinity map and an in-memory
84
+ * `lastUsedAt` overlay. The overlay is seeded from persisted state and advanced
85
+ * to `now` on each selection, so repeated selections rotate fairly even before
86
+ * durable persistence. One instance is constructed at bootstrap and shared by
87
+ * all three auth strategies, with every call scoped by `providerId`.
90
88
  *
91
89
  * ZERO-REGRESSION CARRIER: `select()` returns `null` when the schedulable account
92
90
  * count is ≤ 1. Callers treat `null` (and an `isActive` result) as "use the
@@ -96,15 +94,17 @@ interface SubscriptionCredentialStore {
96
94
  * @module scheduler/SubscriptionAccountSelector
97
95
  */
98
96
 
99
- /** Sticky session→account affinity TTL (CRS parity: 1 hour). */
97
+ /** Sticky session→account affinity TTL (1 hour). */
100
98
  declare const SESSION_AFFINITY_TTL_MS = 3600000;
101
99
  /** Min gap between best-effort `lastUsedAt` durable persists, per account. */
102
100
  declare const LAST_USED_PERSIST_THROTTLE_MS = 60000;
103
- /** Precedence assumed for an account with no `priority` (CRS `|| 50`). */
101
+ /** Precedence assumed for an account with no explicit `priority`. */
104
102
  declare const DEFAULT_ACCOUNT_PRIORITY = 50;
105
103
  /** One schedulable candidate — the scheduling projection of an account entry. */
106
104
  interface SchedulableAccount {
107
105
  id: string;
106
+ /** Operator-defined pool group used by resource-level gateway bindings. */
107
+ group?: string;
108
108
  /** Default `50` (lower = higher precedence). */
109
109
  priority?: number;
110
110
  /** ISO — LRU tie-break; absent ⇒ treated as least-recently-used (`0`). */
@@ -226,9 +226,9 @@ declare class SubscriptionProviderRegistry {
226
226
  * process singleton, built here and captured by the opencodego profile's
227
227
  * `nextFallback` (consult) + `recordModelOutcome` (record) closures. Because
228
228
  * the `SubscriptionProviderRegistry` is itself a process singleton (via
229
- * `setSubscriptionProviderRegistry`), breaker state persists across requests
230
- * exactly the reference's long-lived `FallbackHandler`. Constructed with the
231
- * default reference thresholds (3 / 30s / 3) and the default `Date.now` clock.
229
+ * `setSubscriptionProviderRegistry`), breaker state persists across requests.
230
+ * Constructed with the production thresholds (3 / 30s / 3) and the default
231
+ * `Date.now` clock.
232
232
  */
233
233
  private readonly breaker;
234
234
  constructor(accounts: SubscriptionAccountService, tokens: SubscriptionCredentialStore);
package/dist/index.d.ts CHANGED
@@ -80,13 +80,11 @@ interface SubscriptionCredentialStore {
80
80
  * → sort by `priority` asc → effective `lastUsedAt` asc (LRU) → `createdAt` asc
81
81
  * → `[0]`.
82
82
  *
83
- * A faithful port of CRS `sortAccountsByPriority` + `unifiedClaudeScheduler`
84
- * session mapping. The class holds process-lived state the affinity map and an
85
- * in-memory `lastUsedAt` overlay (the authoritative live tie-break value, seeded
86
- * from the persisted field and advanced to `now` on each selection so repeated
87
- * selections round-robin fairly even before any durable persist). ONE instance is
88
- * constructed at bootstrap and SHARED by all three auth strategies (each scopes
89
- * its calls by `providerId`), mirroring the single long-lived CRS scheduler.
83
+ * The class holds process-lived state: a session-affinity map and an in-memory
84
+ * `lastUsedAt` overlay. The overlay is seeded from persisted state and advanced
85
+ * to `now` on each selection, so repeated selections rotate fairly even before
86
+ * durable persistence. One instance is constructed at bootstrap and shared by
87
+ * all three auth strategies, with every call scoped by `providerId`.
90
88
  *
91
89
  * ZERO-REGRESSION CARRIER: `select()` returns `null` when the schedulable account
92
90
  * count is ≤ 1. Callers treat `null` (and an `isActive` result) as "use the
@@ -96,15 +94,17 @@ interface SubscriptionCredentialStore {
96
94
  * @module scheduler/SubscriptionAccountSelector
97
95
  */
98
96
 
99
- /** Sticky session→account affinity TTL (CRS parity: 1 hour). */
97
+ /** Sticky session→account affinity TTL (1 hour). */
100
98
  declare const SESSION_AFFINITY_TTL_MS = 3600000;
101
99
  /** Min gap between best-effort `lastUsedAt` durable persists, per account. */
102
100
  declare const LAST_USED_PERSIST_THROTTLE_MS = 60000;
103
- /** Precedence assumed for an account with no `priority` (CRS `|| 50`). */
101
+ /** Precedence assumed for an account with no explicit `priority`. */
104
102
  declare const DEFAULT_ACCOUNT_PRIORITY = 50;
105
103
  /** One schedulable candidate — the scheduling projection of an account entry. */
106
104
  interface SchedulableAccount {
107
105
  id: string;
106
+ /** Operator-defined pool group used by resource-level gateway bindings. */
107
+ group?: string;
108
108
  /** Default `50` (lower = higher precedence). */
109
109
  priority?: number;
110
110
  /** ISO — LRU tie-break; absent ⇒ treated as least-recently-used (`0`). */
@@ -226,9 +226,9 @@ declare class SubscriptionProviderRegistry {
226
226
  * process singleton, built here and captured by the opencodego profile's
227
227
  * `nextFallback` (consult) + `recordModelOutcome` (record) closures. Because
228
228
  * the `SubscriptionProviderRegistry` is itself a process singleton (via
229
- * `setSubscriptionProviderRegistry`), breaker state persists across requests
230
- * exactly the reference's long-lived `FallbackHandler`. Constructed with the
231
- * default reference thresholds (3 / 30s / 3) and the default `Date.now` clock.
229
+ * `setSubscriptionProviderRegistry`), breaker state persists across requests.
230
+ * Constructed with the production thresholds (3 / 30s / 3) and the default
231
+ * `Date.now` clock.
232
232
  */
233
233
  private readonly breaker;
234
234
  constructor(accounts: SubscriptionAccountService, tokens: SubscriptionCredentialStore);