@buoy-gg/agent-core 7.0.41 → 7.0.43

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 (201) hide show
  1. package/lib/commonjs/blocks/receipts.js +1 -761
  2. package/lib/commonjs/blocks/runId.js +1 -31
  3. package/lib/commonjs/blocks/types.js +1 -140
  4. package/lib/commonjs/blocks/uiTool.js +6 -1405
  5. package/lib/commonjs/catalog/catalog.g.js +5 -4556
  6. package/lib/commonjs/catalog/catalog.source.json +249 -0
  7. package/lib/commonjs/catalog/catalog.types.g.js +1 -46
  8. package/lib/commonjs/catalog/normalizeParams.js +2 -332
  9. package/lib/commonjs/catalog/signature.js +1 -68
  10. package/lib/commonjs/catalog/snapshotReads.js +1 -263
  11. package/lib/commonjs/catalog/toProviderTools.js +2 -145
  12. package/lib/commonjs/catalog/validateParams.js +1 -129
  13. package/lib/commonjs/context/buildContextPack.js +1 -489
  14. package/lib/commonjs/effects/digest.js +1 -34
  15. package/lib/commonjs/effects/ledger.js +1 -345
  16. package/lib/commonjs/engine/askGate.js +1 -287
  17. package/lib/commonjs/engine/effectFor.js +1 -223
  18. package/lib/commonjs/engine/evidence.js +3 -111
  19. package/lib/commonjs/engine/historyBudget.js +1 -363
  20. package/lib/commonjs/engine/retrieve.js +1 -214
  21. package/lib/commonjs/engine/runAgentTurn.js +8 -1836
  22. package/lib/commonjs/engine/systemPrompt.js +54 -163
  23. package/lib/commonjs/engine/textToolCalls.js +1 -276
  24. package/lib/commonjs/engine/tokenCalibration.js +1 -81
  25. package/lib/commonjs/engine/verify.js +4 -297
  26. package/lib/commonjs/index.js +1 -384
  27. package/lib/commonjs/policy/labels.js +1 -319
  28. package/lib/commonjs/policy/policy.js +1 -148
  29. package/lib/commonjs/policy/redact.js +1 -172
  30. package/lib/commonjs/providers/anthropic.js +3 -445
  31. package/lib/commonjs/providers/openai.js +4 -324
  32. package/lib/commonjs/providers/problem.js +1 -98
  33. package/lib/commonjs/providers/sse.js +1 -240
  34. package/lib/commonjs/providers/streamTimer.js +1 -123
  35. package/lib/commonjs/providers/transport.js +1 -123
  36. package/lib/commonjs/providers/types.js +1 -6
  37. package/lib/commonjs/providers/xhrStream.js +1 -212
  38. package/lib/commonjs/realNow.js +1 -0
  39. package/lib/commonjs/session.js +1 -393
  40. package/lib/commonjs/types.js +0 -1
  41. package/lib/module/blocks/receipts.js +1 -755
  42. package/lib/module/blocks/runId.js +1 -26
  43. package/lib/module/blocks/types.js +1 -134
  44. package/lib/module/blocks/uiTool.js +6 -1396
  45. package/lib/module/catalog/catalog.g.js +5 -4552
  46. package/lib/module/catalog/catalog.source.json +249 -0
  47. package/lib/module/catalog/catalog.types.g.js +1 -42
  48. package/lib/module/catalog/normalizeParams.js +2 -326
  49. package/lib/module/catalog/signature.js +1 -63
  50. package/lib/module/catalog/snapshotReads.js +1 -259
  51. package/lib/module/catalog/toProviderTools.js +2 -139
  52. package/lib/module/catalog/validateParams.js +1 -124
  53. package/lib/module/context/buildContextPack.js +1 -485
  54. package/lib/module/effects/digest.js +1 -29
  55. package/lib/module/effects/ledger.js +1 -339
  56. package/lib/module/engine/askGate.js +1 -280
  57. package/lib/module/engine/effectFor.js +1 -220
  58. package/lib/module/engine/evidence.js +3 -105
  59. package/lib/module/engine/historyBudget.js +1 -355
  60. package/lib/module/engine/retrieve.js +1 -210
  61. package/lib/module/engine/runAgentTurn.js +8 -1827
  62. package/lib/module/engine/systemPrompt.js +54 -157
  63. package/lib/module/engine/textToolCalls.js +1 -270
  64. package/lib/module/engine/tokenCalibration.js +1 -75
  65. package/lib/module/engine/verify.js +4 -289
  66. package/lib/module/index.js +1 -35
  67. package/lib/module/policy/labels.js +1 -312
  68. package/lib/module/policy/policy.js +1 -142
  69. package/lib/module/policy/redact.js +1 -165
  70. package/lib/module/providers/anthropic.js +3 -441
  71. package/lib/module/providers/openai.js +4 -320
  72. package/lib/module/providers/problem.js +1 -92
  73. package/lib/module/providers/sse.js +1 -231
  74. package/lib/module/providers/streamTimer.js +1 -118
  75. package/lib/module/providers/transport.js +1 -119
  76. package/lib/module/providers/types.js +1 -4
  77. package/lib/module/providers/xhrStream.js +1 -207
  78. package/lib/module/realNow.js +1 -0
  79. package/lib/module/session.js +1 -369
  80. package/lib/module/types.js +0 -1
  81. package/lib/typescript/catalog/catalog.g.d.ts +3 -3
  82. package/lib/typescript/catalog/catalog.types.g.d.ts +3 -2
  83. package/lib/typescript/providers/problem.d.ts +0 -20
  84. package/lib/typescript/providers/streamTimer.d.ts +0 -24
  85. package/lib/typescript/realNow.d.ts +18 -0
  86. package/lib/web/index.mjs +52 -53
  87. package/package.json +1 -1
  88. package/lib/commonjs/blocks/receipts.js.map +0 -1
  89. package/lib/commonjs/blocks/runId.js.map +0 -1
  90. package/lib/commonjs/blocks/types.js.map +0 -1
  91. package/lib/commonjs/blocks/uiTool.js.map +0 -1
  92. package/lib/commonjs/catalog/catalog.g.js.map +0 -1
  93. package/lib/commonjs/catalog/catalog.types.g.js.map +0 -1
  94. package/lib/commonjs/catalog/normalizeParams.js.map +0 -1
  95. package/lib/commonjs/catalog/signature.js.map +0 -1
  96. package/lib/commonjs/catalog/snapshotReads.js.map +0 -1
  97. package/lib/commonjs/catalog/toProviderTools.js.map +0 -1
  98. package/lib/commonjs/catalog/validateParams.js.map +0 -1
  99. package/lib/commonjs/context/buildContextPack.js.map +0 -1
  100. package/lib/commonjs/effects/digest.js.map +0 -1
  101. package/lib/commonjs/effects/ledger.js.map +0 -1
  102. package/lib/commonjs/engine/askGate.js.map +0 -1
  103. package/lib/commonjs/engine/effectFor.js.map +0 -1
  104. package/lib/commonjs/engine/evidence.js.map +0 -1
  105. package/lib/commonjs/engine/historyBudget.js.map +0 -1
  106. package/lib/commonjs/engine/retrieve.js.map +0 -1
  107. package/lib/commonjs/engine/runAgentTurn.js.map +0 -1
  108. package/lib/commonjs/engine/systemPrompt.js.map +0 -1
  109. package/lib/commonjs/engine/textToolCalls.js.map +0 -1
  110. package/lib/commonjs/engine/tokenCalibration.js.map +0 -1
  111. package/lib/commonjs/engine/verify.js.map +0 -1
  112. package/lib/commonjs/index.js.map +0 -1
  113. package/lib/commonjs/policy/labels.js.map +0 -1
  114. package/lib/commonjs/policy/policy.js.map +0 -1
  115. package/lib/commonjs/policy/redact.js.map +0 -1
  116. package/lib/commonjs/providers/anthropic.js.map +0 -1
  117. package/lib/commonjs/providers/openai.js.map +0 -1
  118. package/lib/commonjs/providers/problem.js.map +0 -1
  119. package/lib/commonjs/providers/sse.js.map +0 -1
  120. package/lib/commonjs/providers/streamTimer.js.map +0 -1
  121. package/lib/commonjs/providers/transport.js.map +0 -1
  122. package/lib/commonjs/providers/types.js.map +0 -1
  123. package/lib/commonjs/providers/xhrStream.js.map +0 -1
  124. package/lib/commonjs/session.js.map +0 -1
  125. package/lib/commonjs/types.js.map +0 -1
  126. package/lib/module/blocks/receipts.js.map +0 -1
  127. package/lib/module/blocks/runId.js.map +0 -1
  128. package/lib/module/blocks/types.js.map +0 -1
  129. package/lib/module/blocks/uiTool.js.map +0 -1
  130. package/lib/module/catalog/catalog.g.js.map +0 -1
  131. package/lib/module/catalog/catalog.types.g.js.map +0 -1
  132. package/lib/module/catalog/normalizeParams.js.map +0 -1
  133. package/lib/module/catalog/signature.js.map +0 -1
  134. package/lib/module/catalog/snapshotReads.js.map +0 -1
  135. package/lib/module/catalog/toProviderTools.js.map +0 -1
  136. package/lib/module/catalog/validateParams.js.map +0 -1
  137. package/lib/module/context/buildContextPack.js.map +0 -1
  138. package/lib/module/effects/digest.js.map +0 -1
  139. package/lib/module/effects/ledger.js.map +0 -1
  140. package/lib/module/engine/askGate.js.map +0 -1
  141. package/lib/module/engine/effectFor.js.map +0 -1
  142. package/lib/module/engine/evidence.js.map +0 -1
  143. package/lib/module/engine/historyBudget.js.map +0 -1
  144. package/lib/module/engine/retrieve.js.map +0 -1
  145. package/lib/module/engine/runAgentTurn.js.map +0 -1
  146. package/lib/module/engine/systemPrompt.js.map +0 -1
  147. package/lib/module/engine/textToolCalls.js.map +0 -1
  148. package/lib/module/engine/tokenCalibration.js.map +0 -1
  149. package/lib/module/engine/verify.js.map +0 -1
  150. package/lib/module/index.js.map +0 -1
  151. package/lib/module/policy/labels.js.map +0 -1
  152. package/lib/module/policy/policy.js.map +0 -1
  153. package/lib/module/policy/redact.js.map +0 -1
  154. package/lib/module/providers/anthropic.js.map +0 -1
  155. package/lib/module/providers/openai.js.map +0 -1
  156. package/lib/module/providers/problem.js.map +0 -1
  157. package/lib/module/providers/sse.js.map +0 -1
  158. package/lib/module/providers/streamTimer.js.map +0 -1
  159. package/lib/module/providers/transport.js.map +0 -1
  160. package/lib/module/providers/types.js.map +0 -1
  161. package/lib/module/providers/xhrStream.js.map +0 -1
  162. package/lib/module/session.js.map +0 -1
  163. package/lib/module/types.js.map +0 -1
  164. package/lib/typescript/blocks/receipts.d.ts.map +0 -1
  165. package/lib/typescript/blocks/runId.d.ts.map +0 -1
  166. package/lib/typescript/blocks/types.d.ts.map +0 -1
  167. package/lib/typescript/blocks/uiTool.d.ts.map +0 -1
  168. package/lib/typescript/catalog/catalog.g.d.ts.map +0 -1
  169. package/lib/typescript/catalog/catalog.types.g.d.ts.map +0 -1
  170. package/lib/typescript/catalog/normalizeParams.d.ts.map +0 -1
  171. package/lib/typescript/catalog/signature.d.ts.map +0 -1
  172. package/lib/typescript/catalog/snapshotReads.d.ts.map +0 -1
  173. package/lib/typescript/catalog/toProviderTools.d.ts.map +0 -1
  174. package/lib/typescript/catalog/validateParams.d.ts.map +0 -1
  175. package/lib/typescript/context/buildContextPack.d.ts.map +0 -1
  176. package/lib/typescript/effects/digest.d.ts.map +0 -1
  177. package/lib/typescript/effects/ledger.d.ts.map +0 -1
  178. package/lib/typescript/engine/askGate.d.ts.map +0 -1
  179. package/lib/typescript/engine/effectFor.d.ts.map +0 -1
  180. package/lib/typescript/engine/evidence.d.ts.map +0 -1
  181. package/lib/typescript/engine/historyBudget.d.ts.map +0 -1
  182. package/lib/typescript/engine/retrieve.d.ts.map +0 -1
  183. package/lib/typescript/engine/runAgentTurn.d.ts.map +0 -1
  184. package/lib/typescript/engine/systemPrompt.d.ts.map +0 -1
  185. package/lib/typescript/engine/textToolCalls.d.ts.map +0 -1
  186. package/lib/typescript/engine/tokenCalibration.d.ts.map +0 -1
  187. package/lib/typescript/engine/verify.d.ts.map +0 -1
  188. package/lib/typescript/index.d.ts.map +0 -1
  189. package/lib/typescript/policy/labels.d.ts.map +0 -1
  190. package/lib/typescript/policy/policy.d.ts.map +0 -1
  191. package/lib/typescript/policy/redact.d.ts.map +0 -1
  192. package/lib/typescript/providers/anthropic.d.ts.map +0 -1
  193. package/lib/typescript/providers/openai.d.ts.map +0 -1
  194. package/lib/typescript/providers/problem.d.ts.map +0 -1
  195. package/lib/typescript/providers/sse.d.ts.map +0 -1
  196. package/lib/typescript/providers/streamTimer.d.ts.map +0 -1
  197. package/lib/typescript/providers/transport.d.ts.map +0 -1
  198. package/lib/typescript/providers/types.d.ts.map +0 -1
  199. package/lib/typescript/providers/xhrStream.d.ts.map +0 -1
  200. package/lib/typescript/session.d.ts.map +0 -1
  201. package/lib/typescript/types.d.ts.map +0 -1
@@ -2515,6 +2515,255 @@
2515
2515
  ],
2516
2516
  "unavailableWhen": "The `@buoy-gg/time-machine` tool is not in the app's FloatingDevTools tool list, or the app is a release build that has not opted into `externalSync.enableInRelease` with a real Pro license (packages/devtools-floating-menu/src/floatingMenu/autoExternalSync.tsx:190 — no socket, so no action reaches the device at all). Individual state sources are also absent unless their tool package is installed and instrumented: check `providers[].canCapture`/`canRestore` from `list` before assuming a source is covered."
2517
2517
  },
2518
+ {
2519
+ "toolId": "clock",
2520
+ "title": "Clock",
2521
+ "summary": "Override the app's own clock without touching the device: move it to any date (setTime), jump it forward or back (shift), stop it (freeze/resume), run it faster (setRate), or go back to real time (reset). Reach for it to test anything time-based on the client: expired offers and coupons, countdowns, trial and renewal dates, day or month rollovers, 'last seen' labels, token expiry the app checks itself. What moves: Date.now(), new Date(), Date() and Intl.DateTimeFormat format() with no date; a forward shift also runs the app's setTimeout/setInterval callbacks that come due inside the jump, once each. What stays real: performance.now(), animations, native timers and scheduled notifications, the time zone, and the backend's clock, so a server that checks expiry itself still uses real time. Values the app computed before the change keep their old time until the screen re-reads the clock or the app reloads (the override survives reloads). It also reads the app's sign-in tokens from Network's captured requests (JWTs, PASETO, opaque tokens whose login response gave an expiry, session cookies) and tests the app's token refresh: jumpToTokenExpiry for apps that refresh before expiry, failNextRequest for apps that refresh after a 401. Raw tokens are never returned. Every action returns the same state object as getState: { mode:'real'|'running'|'frozen', active, rate, virtualNow, virtualIso, realNow, offsetMs, timeZone, timers:{total,timeouts,intervals,nextTimeoutInMs}, lastJump:{byMs,firedTimers,at}|null, settings:{persist,showChip,fireTimersOnJump}, tokens:{available, tokens:[{id,label,host,formatLabel,hint,claims,expiresAt,serverExpiresAt,expirySource,lifetimeMs,issuedBy,refresh,uses,refreshes,looping,expiredSends,rejected}], check:{kind:'expiry'|'401',tokenId,status:'waiting'|'refreshed'|'loop',forcedAt,refreshedAt,newLifetimeMs,newIssuedBy,newTokens,staleAfterFailure}|null}, patched:{date,intl,timers,animatedOnRealClock} }. expiresAt is on the app's clock; serverExpiresAt on real time.",
2522
+ "unavailableWhen": "Needs @buoy-gg/clock installed (FloatingDevTools auto-discovers it). In release builds the saved override and timer tracking load when the Clock tool is first opened rather than at app start.",
2523
+ "actions": [
2524
+ {
2525
+ "action": "getState",
2526
+ "summary": "Read what the app's clock says right now, how far it is from real time, and the pending timers.",
2527
+ "description": "Returns the state object described in the tool summary. Read virtualIso (the app's time) against realNow before reporting what 'now' is for the app; offsetMs is app minus real. mode 'real' means no override is on. timers counts the app's pending setTimeout/setInterval callbacks, which is how many a forward shift could run.",
2528
+ "effect": "read",
2529
+ "release": "works",
2530
+ "params": {
2531
+ "type": "object",
2532
+ "properties": {},
2533
+ "additionalProperties": false
2534
+ }
2535
+ },
2536
+ {
2537
+ "action": "setTime",
2538
+ "summary": "Move the app's clock to `time` (ISO 8601, epoch ms, or relative like \"+3d\"); pass `freeze` true to stop it there.",
2539
+ "description": "`time` accepts \"2026-12-31T23:59:50\" (device-local when no zone is given), \"2026-12-31 23:59\", \"2026-12-31T23:59:50Z\", epoch milliseconds, or a signed duration from the app's current time (\"+30d\", \"-2h\"). The clock keeps running from there at the current speed unless `freeze` is true. Unlike shift, setTime never runs timers. Throws a message naming the accepted formats when `time` cannot be read. Returns the new state.",
2540
+ "effect": "write",
2541
+ "release": "works",
2542
+ "undo": {
2543
+ "action": "reset",
2544
+ "note": "reset returns to the device's real clock. If an override was already on before this call, reset does not bring that one back: read getState first and set it again with setTime/setRate."
2545
+ },
2546
+ "params": {
2547
+ "type": "object",
2548
+ "properties": {
2549
+ "time": {
2550
+ "type": [
2551
+ "string",
2552
+ "number"
2553
+ ],
2554
+ "description": "Target time: ISO 8601 (\"2026-12-31T23:59:50\"), \"YYYY-MM-DD HH:MM\", epoch ms, or relative (\"+1d\", \"-2h\")."
2555
+ },
2556
+ "freeze": {
2557
+ "type": "boolean",
2558
+ "description": "Stop the clock at `time` instead of letting it run. Default false."
2559
+ }
2560
+ },
2561
+ "required": [
2562
+ "time"
2563
+ ],
2564
+ "additionalProperties": false
2565
+ }
2566
+ },
2567
+ {
2568
+ "action": "shift",
2569
+ "summary": "Jump the app's clock `by` a duration (\"+1d\", \"-2h30m\", \"90s\" or ms); forward jumps also run app timers that come due unless `fireTimers` is false.",
2570
+ "description": "Moves the clock relative to what it reads now; a frozen clock stays frozen. Units: ms, s, m, h, d, w, mo (30 days), y (365 days). A forward jump runs, once each and soonest first, every app setTimeout/setInterval callback due within the jump (Playwright fastForward rules) and shortens what is left of the others; lastJump.firedTimers reports how many ran. Buoy's own timers are never run. Backward jumps never run timers. Returns the new state.",
2571
+ "effect": "write",
2572
+ "release": "works",
2573
+ "undo": {
2574
+ "action": "reset",
2575
+ "note": "reset returns to the device's real clock. If an override was already on before this call, reset does not bring that one back: read getState first and set it again with setTime/setRate."
2576
+ },
2577
+ "params": {
2578
+ "type": "object",
2579
+ "properties": {
2580
+ "by": {
2581
+ "type": [
2582
+ "string",
2583
+ "number"
2584
+ ],
2585
+ "description": "Signed duration: \"+1d\", \"-2h30m\", \"90s\", \"1.5 hours\", or a number of ms."
2586
+ },
2587
+ "fireTimers": {
2588
+ "type": "boolean",
2589
+ "description": "Run app timers that come due inside a forward jump. Default: the fireTimersOnJump setting (on)."
2590
+ }
2591
+ },
2592
+ "required": [
2593
+ "by"
2594
+ ],
2595
+ "additionalProperties": false
2596
+ }
2597
+ },
2598
+ {
2599
+ "action": "freeze",
2600
+ "summary": "Stop the app's clock where it is, or at `time` if given.",
2601
+ "description": "The app reads the same instant until resume, shift, setTime or reset. Timers keep running in real time and animations keep moving; only reads of the time stop. `time` takes the same formats as setTime. Returns the new state.",
2602
+ "effect": "write",
2603
+ "release": "works",
2604
+ "undo": {
2605
+ "action": "resume",
2606
+ "note": "resume starts the clock again from the frozen instant; it does not return to the time before the freeze. Use reset for real time."
2607
+ },
2608
+ "params": {
2609
+ "type": "object",
2610
+ "properties": {
2611
+ "time": {
2612
+ "type": [
2613
+ "string",
2614
+ "number"
2615
+ ],
2616
+ "description": "Optional instant to freeze at (same formats as setTime). Omit to freeze at the current app time."
2617
+ }
2618
+ },
2619
+ "additionalProperties": false
2620
+ }
2621
+ },
2622
+ {
2623
+ "action": "resume",
2624
+ "summary": "Start a frozen app clock again from the instant it was frozen at.",
2625
+ "description": "No-op when the clock is not frozen. The clock continues at its current speed. Returns the new state.",
2626
+ "effect": "write",
2627
+ "release": "works",
2628
+ "undo": {
2629
+ "action": "freeze",
2630
+ "note": "freeze stops it again, at the current app time."
2631
+ },
2632
+ "params": {
2633
+ "type": "object",
2634
+ "properties": {},
2635
+ "additionalProperties": false
2636
+ }
2637
+ },
2638
+ {
2639
+ "action": "setRate",
2640
+ "summary": "Run the app's clock `rate` times as fast as real time (1 = normal, 60 = a minute per second, 3600 = an hour per second).",
2641
+ "description": "Starts from what the app's clock reads now, so nothing jumps. Only reads of the time speed up: timer delays stay real, so taps, animations and polling behave; code that recomputes from Date.now() on each tick (most countdowns) shows the faster time. Range 0.1 to 86400. Returns the new state.",
2642
+ "effect": "write",
2643
+ "release": "works",
2644
+ "undo": {
2645
+ "action": "setRate",
2646
+ "note": "Call again with rate 1. That keeps the time already gained; use reset for real time."
2647
+ },
2648
+ "params": {
2649
+ "type": "object",
2650
+ "properties": {
2651
+ "rate": {
2652
+ "type": "number",
2653
+ "description": "Speed multiplier, 0.1-86400. 1 is normal speed."
2654
+ }
2655
+ },
2656
+ "required": [
2657
+ "rate"
2658
+ ],
2659
+ "additionalProperties": false
2660
+ }
2661
+ },
2662
+ {
2663
+ "action": "reset",
2664
+ "summary": "Put the app back on the device's real clock.",
2665
+ "description": "Removes the Date and Intl patches entirely, clears the saved override and closes the clock chip. Screens that already computed a time keep it until they re-read the clock or the app reloads. Returns the new state (mode 'real').",
2666
+ "effect": "write",
2667
+ "release": "works",
2668
+ "params": {
2669
+ "type": "object",
2670
+ "properties": {},
2671
+ "additionalProperties": false
2672
+ }
2673
+ },
2674
+ {
2675
+ "action": "updateSettings",
2676
+ "summary": "Change the Clock tool's settings: `persist` (keep the override across reloads), `showChip` (floating reminder), `fireTimersOnJump`.",
2677
+ "description": "Only the booleans given are changed. persist=false still applies the override now but forgets it on the next reload. Returns the new state with settings.",
2678
+ "effect": "write",
2679
+ "release": "works",
2680
+ "params": {
2681
+ "type": "object",
2682
+ "properties": {
2683
+ "persist": {
2684
+ "type": "boolean",
2685
+ "description": "Keep the override across reloads and restarts."
2686
+ },
2687
+ "showChip": {
2688
+ "type": "boolean",
2689
+ "description": "Show the floating clock chip while an override is on."
2690
+ },
2691
+ "fireTimersOnJump": {
2692
+ "type": "boolean",
2693
+ "description": "Whether forward shifts run app timers that come due."
2694
+ }
2695
+ },
2696
+ "additionalProperties": false
2697
+ }
2698
+ },
2699
+ {
2700
+ "action": "jumpToTokenExpiry",
2701
+ "summary": "Move the app's clock to just before a sign-in token expires (default 10 s before), then watch for the app to fetch a new token.",
2702
+ "description": "Tests apps that refresh their token before it expires by comparing its expiry with Date.now(). Shifts the app's clock forward (running timers that come due, like a scheduled refresh) to `leadMs` before the token's expiry, and starts a refresh check. The server keeps real time, so it still accepts the old token: only the app's own refresh logic is exercised. The app has to send a request (or run its refresh timer) before a new token shows up; read getState's tokens.check for the result: 'refreshed' with the new token's lifetime and issuing endpoint, or 'loop' when new tokens keep arriving because they already look expired to the moved clock. Throws when no token has been seen, when the token's expiry is unreadable (then use failNextRequest), or when it has already expired on the app's clock.",
2703
+ "effect": "write",
2704
+ "release": "works",
2705
+ "undo": {
2706
+ "action": "reset",
2707
+ "note": "reset puts the app back on real time. The app keeps any token it fetched meanwhile, which is harmless."
2708
+ },
2709
+ "params": {
2710
+ "type": "object",
2711
+ "properties": {
2712
+ "token": {
2713
+ "type": "string",
2714
+ "description": "Token id from getState's tokens[].id. Default: the most recently used token that has a readable expiry."
2715
+ },
2716
+ "leadMs": {
2717
+ "type": "number",
2718
+ "description": "Land this many ms before expiry. Default 10000."
2719
+ }
2720
+ },
2721
+ "additionalProperties": false
2722
+ }
2723
+ },
2724
+ {
2725
+ "action": "failNextRequest",
2726
+ "summary": "Answer the app's next request that carries a sign-in token with a 401 (or `status` 403), once or `times` times, then watch for the app to fetch a new token.",
2727
+ "description": "Tests apps that refresh their token after the server rejects it. Adds a one-shot Network override on the token's origin, limited to requests that send the token's header, so the 401 never lands on the app's own token request. It answers with `WWW-Authenticate: Bearer error=\"invalid_token\"` and an invalid_token JSON body, and starts a refresh check. Needs @buoy-gg/network. The app has to send a request for the 401 to reach it; getState's tokens.check then shows forcedAt, whether a new token arrived, staleAfterFailure (requests that re-sent the old token after the 401) and failedRefreshes (token requests that failed). Replaces an earlier 401 that has not fired yet.",
2728
+ "effect": "write",
2729
+ "release": "works",
2730
+ "undo": {
2731
+ "action": "stopTokenCheck",
2732
+ "note": "stopTokenCheck withdraws the 401 if it has not reached the app yet. A 401 the app already received cannot be taken back."
2733
+ },
2734
+ "params": {
2735
+ "type": "object",
2736
+ "properties": {
2737
+ "token": {
2738
+ "type": "string",
2739
+ "description": "Token id from getState's tokens[].id. Default: the most recently used token that has a readable expiry."
2740
+ },
2741
+ "status": {
2742
+ "type": "number",
2743
+ "description": "401 (default) or 403."
2744
+ },
2745
+ "times": {
2746
+ "type": "number",
2747
+ "description": "How many requests to fail, 1-10. Default 1."
2748
+ }
2749
+ },
2750
+ "additionalProperties": false
2751
+ }
2752
+ },
2753
+ {
2754
+ "action": "stopTokenCheck",
2755
+ "summary": "End the refresh check, withdrawing a forced 401 that has not reached the app yet.",
2756
+ "description": "Clears tokens.check. When the check was started by failNextRequest and the 401 has not fired, removes that Network override so it cannot fail a later request. Returns the new state.",
2757
+ "effect": "write",
2758
+ "release": "works",
2759
+ "params": {
2760
+ "type": "object",
2761
+ "properties": {},
2762
+ "additionalProperties": false
2763
+ }
2764
+ }
2765
+ ]
2766
+ },
2518
2767
  {
2519
2768
  "toolId": "storage",
2520
2769
  "title": "Storage",
@@ -1,46 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.CATALOG_ACTIONS = void 0;
7
- /**
8
- * GENERATED by scripts/gen-agent-catalog.mjs — do not edit.
9
- * Source: packages/agent-core/src/catalog/catalog.source.json
10
- *
11
- * The catalog's tool ids and action names as types, so a wrong name fails
12
- * at compile time. `catalog.g.ts` carries the data.
13
- *
14
- * 26 Buoy tools, 218 actions.
15
- */
16
-
17
- /** Action names per tool — the runtime mirror of {@link CatalogActionMap}. */
18
- const CATALOG_ACTIONS = exports.CATALOG_ACTIONS = {
19
- "env": ["getSnapshot"],
20
- "console": ["getSnapshot", "clearEntries"],
21
- "sentry": ["getSnapshot", "clearEnvelopes"],
22
- "jotai": ["listAtoms", "getAtomValue", "getChangeDetail", "setAtom", "clearEvents"],
23
- "route-events": ["getSnapshot", "getCurrentRoute", "navigate", "stackGoBack", "stackNavigateToIndex", "stackPopToIndex", "stackPopToTop", "clearEvents"],
24
- "debug-borders": ["cycleMode", "setMode"],
25
- "zustand": ["listStores", "getStoreState", "getChangeDetail", "setState", "rehydrate", "clearEvents"],
26
- "redux": ["getState", "getActionDetail", "dispatch", "clearEvents"],
27
- "impersonate": ["searchUsers", "startImpersonation", "stopImpersonation", "pauseImpersonation", "resumeImpersonation", "updateSettings", "removeFromHistory", "clearHistory"],
28
- "query": ["listQueries", "getQueryData", "refetch", "invalidate", "reset", "remove", "setQueryData", "triggerError", "restoreError", "triggerLoading", "restoreLoading", "clearQueryCache", "clearMutationCache", "setOnline"],
29
- "events": ["exportEvents", "setEnabledSources", "clearEvents"],
30
- "network": ["getSnapshot", "getCaptureStatus", "getEventBody", "setPinned", "setSaved", "removeSavedRecord", "clearSavedRequests", "clearPinnedRequests", "clearEvents", "listOverrideRules", "getOverrideRuleBody", "debugOverrides", "upsertOverrideRule", "setOverrideRuleEnabled", "setOverridesEnabled", "deleteOverrideRule", "clearOverrideRules", "getNetworkConditions", "setNetworkConditions"],
31
- "js-top": ["sample", "getOriginDetail", "setEnabled", "pause", "resume", "clear"],
32
- "app": ["ping", "reloadApp"],
33
- "time-machine": ["list", "capture", "captureBaseline", "wipeAll", "restore", "preview", "inspect", "delete", "rename", "duplicate", "setExclusions", "setScope", "setRestoreRoute"],
34
- "storage": ["getRequiredKeys", "async.getAllKeys", "async.multiGet", "async.getItem", "async.setItem", "async.removeItem", "async.multiRemove", "async.multiSet", "async.clear", "clearAppStorage", "getEventDetail", "clearEvents", "timeTravel.undo", "timeTravel.jump", "mmkv.snapshot", "mmkv.get", "mmkv.set", "mmkv.remove", "secure.keys", "secure.snapshot", "secure.get", "secure.set", "secure.delete"],
35
- "highlight-updates": ["describeScreen", "tapElement", "waitFor", "beginMeasurement", "endMeasurement", "locateComponent", "getRenderDetail", "setEnabled", "toggle", "setSilentTracking", "toggleFreeze", "setSpotlight", "clearRenderCounts", "startTouchCapture", "stopTouchCapture", "clearTouchCapture", "readTouchCapture"],
36
- "scenarios": ["listScenarios", "getScenario", "save", "acceptDraft", "discardDraft", "preview", "run", "deactivate", "delete", "setFolder", "listFolders", "getActive", "export"],
37
- "perf-monitor": ["setEnabled", "startRecording", "stopRecording", "savePending", "discardPending", "mark", "startAutomation", "cancelAutomation", "acknowledgeAutomation", "refreshIndex", "getAutomationConfig", "setAutomationConfig", "loadReport", "deleteReport", "deleteBatch", "clearAll"],
38
- "assets": ["list", "getDetail", "rescan", "measureSizes", "saveBaseline", "clearBaseline", "getDiff", "clearRecords", "getScanStatus"],
39
- "tv-remote": ["arm", "getEventsSince", "setMenuCapture", "disarm", "clear"],
40
- "focus-inspector": ["rescan", "focusElement", "setTracking", "clearHistory"],
41
- "images": ["list", "getDetail", "getCaptureStatus", "retry", "flash", "proveSavings", "setOverride", "clearOverride", "setNetworkMode", "setBlankImages", "hardReload", "evictDisk", "massAction", "clearRecords", "clearExpoCaches"],
42
- "ask-buoy": ["listChanges", "undoAll", "retrieve", "openProcedure"],
43
- "push-notifications": ["getSnapshot", "getCapabilities", "getEvent", "getPermissions", "listPresented", "refreshToken", "setCaptureSession", "clearCapturedEvents", "scheduleLocal"],
44
- "image-overlay": ["getSnapshot", "listTargets", "selectTarget", "loadImage", "setSettings", "fitToScreen", "resetSettings", "remove"]
45
- };
46
- //# sourceMappingURL=catalog.types.g.js.map
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.CATALOG_ACTIONS=void 0;const CATALOG_ACTIONS=exports.CATALOG_ACTIONS={"env":["getSnapshot"],"console":["getSnapshot","clearEntries"],"sentry":["getSnapshot","clearEnvelopes"],"jotai":["listAtoms","getAtomValue","getChangeDetail","setAtom","clearEvents"],"route-events":["getSnapshot","getCurrentRoute","navigate","stackGoBack","stackNavigateToIndex","stackPopToIndex","stackPopToTop","clearEvents"],"debug-borders":["cycleMode","setMode"],"zustand":["listStores","getStoreState","getChangeDetail","setState","rehydrate","clearEvents"],"redux":["getState","getActionDetail","dispatch","clearEvents"],"impersonate":["searchUsers","startImpersonation","stopImpersonation","pauseImpersonation","resumeImpersonation","updateSettings","removeFromHistory","clearHistory"],"query":["listQueries","getQueryData","refetch","invalidate","reset","remove","setQueryData","triggerError","restoreError","triggerLoading","restoreLoading","clearQueryCache","clearMutationCache","setOnline"],"events":["exportEvents","setEnabledSources","clearEvents"],"network":["getSnapshot","getCaptureStatus","getEventBody","setPinned","setSaved","removeSavedRecord","clearSavedRequests","clearPinnedRequests","clearEvents","listOverrideRules","getOverrideRuleBody","debugOverrides","upsertOverrideRule","setOverrideRuleEnabled","setOverridesEnabled","deleteOverrideRule","clearOverrideRules","getNetworkConditions","setNetworkConditions"],"js-top":["sample","getOriginDetail","setEnabled","pause","resume","clear"],"app":["ping","reloadApp"],"time-machine":["list","capture","captureBaseline","wipeAll","restore","preview","inspect","delete","rename","duplicate","setExclusions","setScope","setRestoreRoute"],"clock":["getState","setTime","shift","freeze","resume","setRate","reset","updateSettings","jumpToTokenExpiry","failNextRequest","stopTokenCheck"],"storage":["getRequiredKeys","async.getAllKeys","async.multiGet","async.getItem","async.setItem","async.removeItem","async.multiRemove","async.multiSet","async.clear","clearAppStorage","getEventDetail","clearEvents","timeTravel.undo","timeTravel.jump","mmkv.snapshot","mmkv.get","mmkv.set","mmkv.remove","secure.keys","secure.snapshot","secure.get","secure.set","secure.delete"],"highlight-updates":["describeScreen","tapElement","waitFor","beginMeasurement","endMeasurement","locateComponent","getRenderDetail","setEnabled","toggle","setSilentTracking","toggleFreeze","setSpotlight","clearRenderCounts","startTouchCapture","stopTouchCapture","clearTouchCapture","readTouchCapture"],"scenarios":["listScenarios","getScenario","save","acceptDraft","discardDraft","preview","run","deactivate","delete","setFolder","listFolders","getActive","export"],"perf-monitor":["setEnabled","startRecording","stopRecording","savePending","discardPending","mark","startAutomation","cancelAutomation","acknowledgeAutomation","refreshIndex","getAutomationConfig","setAutomationConfig","loadReport","deleteReport","deleteBatch","clearAll"],"assets":["list","getDetail","rescan","measureSizes","saveBaseline","clearBaseline","getDiff","clearRecords","getScanStatus"],"tv-remote":["arm","getEventsSince","setMenuCapture","disarm","clear"],"focus-inspector":["rescan","focusElement","setTracking","clearHistory"],"images":["list","getDetail","getCaptureStatus","retry","flash","proveSavings","setOverride","clearOverride","setNetworkMode","setBlankImages","hardReload","evictDisk","massAction","clearRecords","clearExpoCaches"],"ask-buoy":["listChanges","undoAll","retrieve","openProcedure"],"push-notifications":["getSnapshot","getCapabilities","getEvent","getPermissions","listPresented","refreshToken","setCaptureSession","clearCapturedEvents","scheduleLocal"],"image-overlay":["getSnapshot","listTargets","selectTarget","loadImage","setSettings","fitToScreen","resetSettings","remove"]};