@agentdeck/bridge 1.0.24 → 1.2.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 (184) hide show
  1. package/README.md +14 -6
  2. package/assets/fonts/NOTICE-PocketSansWorld.md +10 -0
  3. package/assets/fonts/OFL-PocketSansWorld.txt +93 -0
  4. package/assets/fonts/PocketSansWorld_12.cpfont +0 -0
  5. package/assets/fonts/pocket-sans-world.manifest.json +49 -0
  6. package/assets/learning/LICENSE-CC-BY-SA-4.0.txt +10 -0
  7. package/assets/learning/NOTICE.md +33 -0
  8. package/assets/learning/jp-n3-ko.manifest.json +27 -0
  9. package/assets/learning/jp-n3-ko.pdl +0 -0
  10. package/dist/adapters/openclaw.d.ts +74 -4
  11. package/dist/adapters/openclaw.d.ts.map +1 -1
  12. package/dist/adapters/openclaw.js +235 -43
  13. package/dist/adapters/openclaw.js.map +1 -1
  14. package/dist/agent-cli-diagnostics.d.ts +20 -0
  15. package/dist/agent-cli-diagnostics.d.ts.map +1 -0
  16. package/dist/agent-cli-diagnostics.js +100 -0
  17. package/dist/agent-cli-diagnostics.js.map +1 -0
  18. package/dist/apme/adapters/openclaw-hook.d.ts +38 -10
  19. package/dist/apme/adapters/openclaw-hook.d.ts.map +1 -1
  20. package/dist/apme/adapters/openclaw-hook.js +181 -37
  21. package/dist/apme/adapters/openclaw-hook.js.map +1 -1
  22. package/dist/apme/collector.d.ts +55 -2
  23. package/dist/apme/collector.d.ts.map +1 -1
  24. package/dist/apme/collector.js +324 -37
  25. package/dist/apme/collector.js.map +1 -1
  26. package/dist/apme/dashboard-html.d.ts.map +1 -1
  27. package/dist/apme/dashboard-html.js +275 -35
  28. package/dist/apme/dashboard-html.js.map +1 -1
  29. package/dist/apme/http.d.ts.map +1 -1
  30. package/dist/apme/http.js +33 -5
  31. package/dist/apme/http.js.map +1 -1
  32. package/dist/apme/index.d.ts.map +1 -1
  33. package/dist/apme/index.js +6 -2
  34. package/dist/apme/index.js.map +1 -1
  35. package/dist/apme/pareto.d.ts +2 -1
  36. package/dist/apme/pareto.d.ts.map +1 -1
  37. package/dist/apme/pareto.js +15 -4
  38. package/dist/apme/pareto.js.map +1 -1
  39. package/dist/apme/recommend.d.ts +24 -1
  40. package/dist/apme/recommend.d.ts.map +1 -1
  41. package/dist/apme/recommend.js +43 -7
  42. package/dist/apme/recommend.js.map +1 -1
  43. package/dist/apme/store.d.ts +47 -1
  44. package/dist/apme/store.d.ts.map +1 -1
  45. package/dist/apme/store.js +397 -99
  46. package/dist/apme/store.js.map +1 -1
  47. package/dist/bridge-core.d.ts +25 -1
  48. package/dist/bridge-core.d.ts.map +1 -1
  49. package/dist/bridge-core.js +50 -9
  50. package/dist/bridge-core.js.map +1 -1
  51. package/dist/card-feed.d.ts +46 -1
  52. package/dist/card-feed.d.ts.map +1 -1
  53. package/dist/card-feed.js +166 -6
  54. package/dist/card-feed.js.map +1 -1
  55. package/dist/cli.d.ts +56 -0
  56. package/dist/cli.d.ts.map +1 -1
  57. package/dist/cli.js +442 -34
  58. package/dist/cli.js.map +1 -1
  59. package/dist/codex-rate-limits-live.d.ts +180 -10
  60. package/dist/codex-rate-limits-live.d.ts.map +1 -1
  61. package/dist/codex-rate-limits-live.js +475 -22
  62. package/dist/codex-rate-limits-live.js.map +1 -1
  63. package/dist/daemon-build-identity.d.ts +124 -0
  64. package/dist/daemon-build-identity.d.ts.map +1 -0
  65. package/dist/daemon-build-identity.js +310 -0
  66. package/dist/daemon-build-identity.js.map +1 -0
  67. package/dist/daemon-server.d.ts +34 -6
  68. package/dist/daemon-server.d.ts.map +1 -1
  69. package/dist/daemon-server.js +876 -109
  70. package/dist/daemon-server.js.map +1 -1
  71. package/dist/daemon-takeover.d.ts +11 -0
  72. package/dist/daemon-takeover.d.ts.map +1 -1
  73. package/dist/daemon-takeover.js +62 -17
  74. package/dist/daemon-takeover.js.map +1 -1
  75. package/dist/daemon-ws-client.d.ts +1 -0
  76. package/dist/daemon-ws-client.d.ts.map +1 -1
  77. package/dist/daemon-ws-client.js +25 -16
  78. package/dist/daemon-ws-client.js.map +1 -1
  79. package/dist/daemon.js +1 -1
  80. package/dist/daemon.js.map +1 -1
  81. package/dist/esp32-serial.d.ts +18 -0
  82. package/dist/esp32-serial.d.ts.map +1 -1
  83. package/dist/esp32-serial.js +23 -1
  84. package/dist/esp32-serial.js.map +1 -1
  85. package/dist/font-pack.d.ts +15 -0
  86. package/dist/font-pack.d.ts.map +1 -0
  87. package/dist/font-pack.js +75 -0
  88. package/dist/font-pack.js.map +1 -0
  89. package/dist/glance-frame.d.ts.map +1 -1
  90. package/dist/glance-frame.js +5 -1
  91. package/dist/glance-frame.js.map +1 -1
  92. package/dist/hook-codex-sessions.d.ts +3 -1
  93. package/dist/hook-codex-sessions.d.ts.map +1 -1
  94. package/dist/hook-codex-sessions.js +27 -7
  95. package/dist/hook-codex-sessions.js.map +1 -1
  96. package/dist/http-auth-gate.d.ts.map +1 -1
  97. package/dist/http-auth-gate.js +9 -1
  98. package/dist/http-auth-gate.js.map +1 -1
  99. package/dist/index.js +2 -2
  100. package/dist/index.js.map +1 -1
  101. package/dist/learning-pack.d.ts +24 -0
  102. package/dist/learning-pack.d.ts.map +1 -0
  103. package/dist/learning-pack.js +125 -0
  104. package/dist/learning-pack.js.map +1 -0
  105. package/dist/legacy-rearm-ledger.d.ts +56 -0
  106. package/dist/legacy-rearm-ledger.d.ts.map +1 -0
  107. package/dist/legacy-rearm-ledger.js +66 -0
  108. package/dist/legacy-rearm-ledger.js.map +1 -0
  109. package/dist/mdns.d.ts +33 -0
  110. package/dist/mdns.d.ts.map +1 -1
  111. package/dist/mdns.js +92 -3
  112. package/dist/mdns.js.map +1 -1
  113. package/dist/openclaw-session.d.ts.map +1 -1
  114. package/dist/openclaw-session.js +13 -0
  115. package/dist/openclaw-session.js.map +1 -1
  116. package/dist/openclaw-timeline-feed.d.ts +84 -0
  117. package/dist/openclaw-timeline-feed.d.ts.map +1 -0
  118. package/dist/openclaw-timeline-feed.js +162 -0
  119. package/dist/openclaw-timeline-feed.js.map +1 -0
  120. package/dist/openclaw-transcript-timeline.d.ts +103 -0
  121. package/dist/openclaw-transcript-timeline.d.ts.map +1 -0
  122. package/dist/openclaw-transcript-timeline.js +328 -0
  123. package/dist/openclaw-transcript-timeline.js.map +1 -0
  124. package/dist/pairing-knocks.d.ts +80 -0
  125. package/dist/pairing-knocks.d.ts.map +1 -0
  126. package/dist/pairing-knocks.js +312 -0
  127. package/dist/pairing-knocks.js.map +1 -0
  128. package/dist/passive-observer.d.ts +21 -1
  129. package/dist/passive-observer.d.ts.map +1 -1
  130. package/dist/passive-observer.js +37 -3
  131. package/dist/passive-observer.js.map +1 -1
  132. package/dist/pixoo/micro-glyphs.d.ts +4 -0
  133. package/dist/pixoo/micro-glyphs.d.ts.map +1 -1
  134. package/dist/pixoo/micro-glyphs.js +29 -0
  135. package/dist/pixoo/micro-glyphs.js.map +1 -1
  136. package/dist/pixoo/pixoo-font.d.ts.map +1 -1
  137. package/dist/pixoo/pixoo-font.js +3 -1
  138. package/dist/pixoo/pixoo-font.js.map +1 -1
  139. package/dist/pixoo/pixoo-renderer.d.ts +1 -1
  140. package/dist/pixoo/pixoo-renderer.d.ts.map +1 -1
  141. package/dist/pixoo/pixoo-renderer.js +17 -2
  142. package/dist/pixoo/pixoo-renderer.js.map +1 -1
  143. package/dist/pty-manager.d.ts +9 -0
  144. package/dist/pty-manager.d.ts.map +1 -1
  145. package/dist/pty-manager.js +63 -4
  146. package/dist/pty-manager.js.map +1 -1
  147. package/dist/relayed-usage.d.ts +98 -0
  148. package/dist/relayed-usage.d.ts.map +1 -0
  149. package/dist/relayed-usage.js +103 -0
  150. package/dist/relayed-usage.js.map +1 -0
  151. package/dist/session-aggregator.d.ts +3 -0
  152. package/dist/session-aggregator.d.ts.map +1 -1
  153. package/dist/session-aggregator.js.map +1 -1
  154. package/dist/session-registry.d.ts +1 -0
  155. package/dist/session-registry.d.ts.map +1 -1
  156. package/dist/surface-protocol.d.ts +84 -0
  157. package/dist/surface-protocol.d.ts.map +1 -0
  158. package/dist/surface-protocol.js +237 -0
  159. package/dist/surface-protocol.js.map +1 -0
  160. package/dist/timeline-store.d.ts +1 -1
  161. package/dist/timeline-store.d.ts.map +1 -1
  162. package/dist/timeline-store.js +16 -1
  163. package/dist/timeline-store.js.map +1 -1
  164. package/dist/tui/dashboard.d.ts.map +1 -1
  165. package/dist/tui/dashboard.js +8 -1
  166. package/dist/tui/dashboard.js.map +1 -1
  167. package/dist/tui/renderer.d.ts.map +1 -1
  168. package/dist/tui/renderer.js +35 -0
  169. package/dist/tui/renderer.js.map +1 -1
  170. package/dist/weather-config.d.ts +17 -0
  171. package/dist/weather-config.d.ts.map +1 -0
  172. package/dist/weather-config.js +54 -0
  173. package/dist/weather-config.js.map +1 -0
  174. package/dist/weather.d.ts +44 -4
  175. package/dist/weather.d.ts.map +1 -1
  176. package/dist/weather.js +223 -15
  177. package/dist/weather.js.map +1 -1
  178. package/dist/ws-server.d.ts +18 -0
  179. package/dist/ws-server.d.ts.map +1 -1
  180. package/dist/ws-server.js +95 -7
  181. package/dist/ws-server.js.map +1 -1
  182. package/fm-helper/AgentDeckFMHelper.swift +51 -5
  183. package/package.json +4 -3
  184. package/src/timebox/sync_ble.py +35 -16
@@ -29,15 +29,44 @@ interface RawLiveRateLimits {
29
29
  */
30
30
  export declare function parseLiveCodexRateLimits(result: unknown, capturedAt: string): CodexRateLimits | null;
31
31
  /**
32
- * The account-wide limit block among what `account/rateLimits/read` returned.
32
+ * The account-wide limit block among what `account/rateLimits/read` returned,
33
+ * plus the id it should be recorded under.
33
34
  *
34
- * Prefers the top-level `rateLimits` (what the Codex CLI shows) and falls back
35
- * to the first unnamed entry of `rateLimitsByLimitId`. Returns null when every
36
- * family is model-scoped: "no account-wide reading" is the honest answer, and
37
- * the caller then keeps whatever the rollout path found rather than adopting one
38
- * model's quota as the account's. Exported for unit testing.
35
+ * Prefers the top-level `rateLimits` what the Codex CLI itself shows, and
36
+ * measured correct on 2026-08-27 at the exact moment the rollout was lying (the
37
+ * account at 100% up there, the Spark pool only under its own map key). Falls
38
+ * back to an unnamed entry of `rateLimitsByLimitId`, windowed before windowless
39
+ * so a `premium` credit block cannot be handed back ahead of a real windowed
40
+ * `codex` entry on iteration order alone. Returns null when every family is
41
+ * model-scoped: "no account-wide reading" is the honest answer, and the caller
42
+ * then keeps whatever the rollout path found rather than adopting one model's
43
+ * quota as the account's.
44
+ *
45
+ * ## What this deliberately does NOT do any more
46
+ *
47
+ * Three successive review rounds found HIGH-severity defects in machinery added
48
+ * here to defend a shape that has never been observed: a top-level block that
49
+ * mislabels itself the way the ROLLOUT does. The defence fingerprinted every
50
+ * candidate against the weekly resets of the response's own named pools, and
51
+ * each version of it failed in a new direction — handing back a block it had
52
+ * just identified as a pool, admitting a pool through a rung that dropped the
53
+ * key test, and finally refusing everything, because the response mirrors its
54
+ * top-level block into the map under its own key and any account id outside a
55
+ * hardcoded allow-list therefore fingerprint-matched ITSELF (`codex_pro` →
56
+ * `null` → no live read at all, which disables the 100%-wall detection this
57
+ * whole path exists for, pins the mid-turn spawn skip open, and leaves the relay
58
+ * guard permanently unarmed).
59
+ *
60
+ * The measured discriminators are `limitName` (non-empty ⇒ scoped, across 823
61
+ * rollouts and every live sample) and the map key, and they are enough. Guessing
62
+ * at a failure the producer has not shown produced three real ones. If the live
63
+ * top level is ever seen mislabelling itself, the fix belongs here — with that
64
+ * observation attached.
39
65
  */
40
- export declare function pickAccountWideLiveLimits(top?: RawLiveRateLimits | null, byLimitId?: Record<string, RawLiveRateLimits> | null): RawLiveRateLimits | null;
66
+ export declare function pickAccountWideLiveLimits(top?: RawLiveRateLimits | null, byLimitId?: Record<string, RawLiveRateLimits> | null): {
67
+ limits: RawLiveRateLimits;
68
+ limitId?: string;
69
+ } | null;
41
70
  /**
42
71
  * How to hand the Codex binary to `spawn`.
43
72
  *
@@ -65,6 +94,58 @@ export declare function queryCodexRateLimitsLive(opts?: {
65
94
  args?: string[];
66
95
  timeoutMs?: number;
67
96
  }): Promise<CodexRateLimits | null>;
97
+ /**
98
+ * Whether the live reading contradicts the passive one about WHOSE quota it is.
99
+ * The picker uses it to prefer the live snapshot; the throttle uses its negation
100
+ * to decide whether the passive snapshot's freshness may suppress the next
101
+ * query. One expression, because written as two they drifted immediately: the
102
+ * throttle compared families against a cached live snapshot with no bound at
103
+ * all, so once that snapshot's window elapsed the mid-turn skip was lifted
104
+ * permanently while the picker had already stopped honouring the same
105
+ * fingerprint.
106
+ *
107
+ * The two consumers still REACH it differently, and that is deliberate rather
108
+ * than drift. The picker settles plan disagreement first and never asks this at
109
+ * all when the classes differ; the throttle asks it regardless, because a cached
110
+ * live snapshot minted under a retired plan is itself a reason to spend a query
111
+ * — the answer that replaces it is the only thing that can end the disagreement.
112
+ * The cost is bounded by the same spawn throttles as everything else here.
113
+ *
114
+ * The throttle must NOT reuse this predicate, and that is the whole point of
115
+ * `liveCorroboratesPassiveFamily` below. Exported for unit testing.
116
+ */
117
+ export declare function liveRejectsPassiveFamily(passive?: CodexRateLimits | null, live?: CodexRateLimits | null, nowMs?: number): boolean;
118
+ /**
119
+ * True when two snapshots describe the same limit FAMILY — or when there is not
120
+ * enough information to say they do not.
121
+ *
122
+ * `isModelScopedCodexLimit` reads the family off the snapshot's own `limit_name`,
123
+ * and that discriminator stopped being reliable on the rollout path. Measured
124
+ * 2026-08-27, inside a single rollout file, after the account's weekly quota was
125
+ * exhausted:
126
+ *
127
+ * ...T20:59:45Z limit_id "codex" limit_name null weekly resets 1788274890 (the account)
128
+ * ...T20:59:46Z limit_id "premium" limit_name null no windows at all
129
+ * ...T13:01:31Z limit_id "codex" limit_name null 5h + weekly resets 1788440488
130
+ *
131
+ * That third shape is `codex_bengalfox` ("GPT-5.3-Codex-Spark") wearing the
132
+ * account's id: `account/rateLimits/read` returned the SAME two reset instants
133
+ * under `rateLimitsByLimitId.codex_bengalfox` at that moment, while the account
134
+ * family sat at 100% with `rateLimitReachedType: "rate_limit_reached"`. So once
135
+ * the account limit is reached and Codex serves the turn from a per-model pool,
136
+ * the rollout records that pool's numbers under an unnamed `codex` label and the
137
+ * name-based filter admits them: the deck read 54% / 24% for an exhausted week.
138
+ *
139
+ * The live read is the only source that keys families correctly, so it is what
140
+ * the passive reading is checked against. Two rules keep the check honest:
141
+ * an unknown on either side is "no information" and matches (a pre-`limit_id`
142
+ * rollout, a credit plan with no weekly window), and a mismatch is resolved by
143
+ * preferring the LIVE snapshot rather than by dropping both — the mismatch also
144
+ * arises legitimately for a few minutes after the account's weekly window rolls
145
+ * over, and there the live answer is merely stale, never wrong about whose
146
+ * quota it is. Exported for unit testing.
147
+ */
148
+ export declare function codexSnapshotsShareLimitFamily(a?: CodexRateLimits | null, b?: CodexRateLimits | null): boolean;
68
149
  /**
69
150
  * Choose between the passive rollout reading and the live app-server reading.
70
151
  *
@@ -75,9 +156,34 @@ export declare function queryCodexRateLimitsLive(opts?: {
75
156
  * current, and the ONLY source carrying the new tier — lost every comparison and
76
157
  * was then voided as a mismatch. A snapshot with no `capturedAt` at all loses to
77
158
  * a stamped one within its match class; ties keep the passive reading, which is
78
- * the on-disk ground truth. Exported for unit testing.
159
+ * the on-disk ground truth.
160
+ *
161
+ * Family agreement is a tie-break WITHIN the plan class, and settled before
162
+ * recency, which cannot see it: the rollout is appended every couple of seconds
163
+ * while Codex works, so a snapshot describing a per-model pool under the
164
+ * account's id (see `codexSnapshotsShareLimitFamily`) wins every recency
165
+ * comparison for as long as the session runs, and the true account reading only
166
+ * surfaces in the gaps where the live query gets to fire. That is the
167
+ * oscillation this guard removes — the same gauge alternating between an
168
+ * exhausted week and a half-used one depending on which source answered last.
169
+ *
170
+ * It must stay UNDER the plan test, because a plan change moves the weekly reset
171
+ * instant too (`1787805401` under `plus` → `1787934975` under `prolite`, same
172
+ * `limit_id: "codex"`, both verbatim in `codex-rate-limits.test.ts`). Ranked
173
+ * above it, the family guard would answer a plan change by handing back the
174
+ * retired-plan live snapshot — which `normalizeCodexRateLimits` then voids to a
175
+ * windowless block, blanking every Codex gauge for up to the failure backoff.
176
+ * That is precisely the regression `codexSnapshotOutranks` exists to prevent,
177
+ * reintroduced through the door next to it.
178
+ *
179
+ * Only a live snapshot whose own weekly window exists AND is still running gets
180
+ * to reject anything (`familyFingerprintCanReject`) — an expired or absent
181
+ * fingerprint is not evidence about which family the current window belongs to.
182
+ * Exported for unit testing; `nowMs` is injectable for the same reason.
79
183
  */
80
- export declare function pickBestCodexRateLimits(passive: CodexRateLimits | null, live: CodexRateLimits | null, accountPlan?: string): CodexRateLimits | null;
184
+ export declare function pickBestCodexRateLimits(passive: CodexRateLimits | null, live: CodexRateLimits | null, accountPlan?: string, nowMs?: number, opts?: {
185
+ liveOwnsFamilyAuthority?: boolean;
186
+ }): CodexRateLimits | null;
81
187
  /** Throttle policy, kept pure so the cadence is testable without spawning. */
82
188
  export declare function shouldQueryCodexRateLimitsLive(input: {
83
189
  nowMs: number;
@@ -88,7 +194,58 @@ export declare function shouldQueryCodexRateLimitsLive(input: {
88
194
  * longer holds — i.e. it is about to be voided and carries no usable number.
89
195
  * Defaults to true so callers that know no account tier behave as before. */
90
196
  passivePlanMatchesAccount?: boolean;
197
+ /** False when the passive snapshot describes a different limit family from the
198
+ * last live answer — it is then a different QUANTITY, not a fresher reading of
199
+ * the same one, so its freshness must not suppress the query that carries the
200
+ * account's number. Defaults to true (no live answer yet ⇒ nothing to compare
201
+ * against). */
202
+ passiveMatchesAccountFamily?: boolean;
91
203
  }): boolean;
204
+ /**
205
+ * Whether a published Codex block may speak for the account's limit FAMILY —
206
+ * the question the relay path has to answer before it lets that block reject a
207
+ * session bridge's.
208
+ *
209
+ * It is deliberately NOT "did the live snapshot win the last pick". Identity
210
+ * with the pick is false in the ordinary good case: when the two readings agree
211
+ * on family the picker keeps the fresher rollout, which while Codex is working
212
+ * is every single build. Read that way, the guard switched itself off exactly
213
+ * when the daemon did hold a verified baseline — and a bridge sampling a
214
+ * mislabelled pool line a second later then won on recency, which is the
215
+ * oscillation this whole change removes, surviving at the one call site that
216
+ * had no other defence.
217
+ *
218
+ * The real question is whether a live answer exists, carries a fingerprint that
219
+ * may reject (`familyFingerprintCanReject`), and agrees with what was published.
220
+ * A plan-voided live snapshot fails the second test rather than lending its
221
+ * authority to a passive block that outranked it for unrelated reasons.
222
+ *
223
+ * Takes the live block rather than reading the module cache, so the rule can be
224
+ * driven directly instead of only through a spawn, and answers with the instant
225
+ * the authority lapses rather than a yes/no read against the caller's clock.
226
+ */
227
+ export declare function codexLiveFamilyAuthorityExpiry(published?: CodexRateLimits | null, live?: CodexRateLimits | null): number | null;
228
+ /**
229
+ * Whether the cached live answer positively vouches for the passive reading's
230
+ * family — the THROTTLE's question, and deliberately not the picker's.
231
+ *
232
+ * Routing the throttle through `liveRejectsPassiveFamily` deadlocked the two
233
+ * bounds against each other on exactly the busy machine this change is for. The
234
+ * skip suppresses queries while the rollout is fresh, so under continuous Codex
235
+ * use the cached answer is never refreshed; fifteen minutes in it loses its
236
+ * authority; and from then on a disagreement could no longer be REPORTED as one,
237
+ * because the age bound lives inside the rejection test. `passiveMatchesAccountFamily`
238
+ * stayed true, the skip stayed engaged, no query ever fired, and the picker fell
239
+ * through to recency — publishing the mislabelled pool reading for the rest of
240
+ * the run.
241
+ *
242
+ * So the polarity is inverted here on purpose: the skip is earned by a live
243
+ * answer that is present, still able to arbitrate, and in agreement. Anything
244
+ * else — no answer, a stale one, a disagreeing one — is a REASON to spend a
245
+ * query, never a reason to skip one. The spawn throttles bound the cost either
246
+ * way. Exported for unit testing.
247
+ */
248
+ export declare function liveCorroboratesPassiveFamily(passive?: CodexRateLimits | null, live?: CodexRateLimits | null, nowMs?: number): boolean;
92
249
  /** Last live snapshot, or null if none has been obtained. */
93
250
  export declare function getLiveCodexRateLimits(): CodexRateLimits | null;
94
251
  /**
@@ -101,9 +258,22 @@ export declare function getLiveCodexRateLimits(): CodexRateLimits | null;
101
258
  * `accountPlan` is the live tier from `auth.json`. Passing it is what lets both
102
259
  * halves of this function tell "old" from "void"; omitting it keeps the previous
103
260
  * newest-wins behaviour.
261
+ *
262
+ * The third axis needs no argument: the last live answer is itself the record of
263
+ * which limit family belongs to the account, so a passive snapshot describing a
264
+ * different one is neither preferred nor allowed to throttle the next query
265
+ * (`codexSnapshotsShareLimitFamily`).
104
266
  */
105
267
  export declare function codexRateLimitsWithLiveRefresh(passive: CodexRateLimits | null, accountPlan?: string): CodexRateLimits | null;
106
268
  /** Test hook — clears the module-level cache and throttle state. */
107
- export declare function __resetCodexRateLimitsLiveForTest(): void;
269
+ export declare function __resetCodexRateLimitsLiveForTest(seed?: {
270
+ cachedLive?: CodexRateLimits | null;
271
+ lastAttemptMs?: number;
272
+ }): void;
273
+ /** Throttle state, so a test can tell "a query was spent" from "the skip held".
274
+ * `lastAttemptMs` moves synchronously, before any subprocess exists. */
275
+ export declare function __peekCodexRateLimitsLiveForTest(): {
276
+ lastAttemptMs: number;
277
+ };
108
278
  export {};
109
279
  //# sourceMappingURL=codex-rate-limits-live.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codex-rate-limits-live.d.ts","sourceRoot":"","sources":["../src/codex-rate-limits-live.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAgB,eAAe,EAAwB,MAAM,mBAAmB,CAAC;AAiD7F,UAAU,aAAa;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;mEAC+D;IAC/D,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,cAAc;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC3B;AAED,UAAU,iBAAiB;IACzB,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IAC/B,SAAS,CAAC,EAA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