deepline 0.3.550 → 0.3.552

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 (192) hide show
  1. package/dist/bundling-sources/sdk/src/client-core.ts +23 -0
  2. package/dist/bundling-sources/sdk/src/http-core.ts +6 -2
  3. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  4. package/dist/bundling-sources/sdk/src/runs/watch-polling.ts +58 -29
  5. package/dist/bundling-sources/sdk/src/types.ts +22 -0
  6. package/dist/bundling-sources/shared_libs/integration-contracts/tool-connection.ts +42 -0
  7. package/dist/bundling-sources/shared_libs/monitors/package.json +2 -0
  8. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-upstream-identity.ts +80 -13
  9. package/dist/bundling-sources/shared_libs/monitors/snitcher-ip2company.ts +31 -0
  10. package/dist/bundling-sources/shared_libs/monitors/tamradar-countries.ts +285 -0
  11. package/dist/bundling-sources/shared_libs/monitors/tracking-provider-guidance.ts +1 -0
  12. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +163 -0
  13. package/dist/bundling-sources/shared_libs/play-runtime/activity-observation.ts +2 -0
  14. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +137 -0
  15. package/dist/bundling-sources/shared_libs/play-runtime/durable-runs-rollout.ts +12 -0
  16. package/dist/bundling-sources/shared_libs/play-runtime/experiment-switches.ts +20 -16
  17. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +47 -14
  18. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +48 -3
  19. package/dist/bundling-sources/shared_libs/play-runtime/runtime-constants.ts +9 -0
  20. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +187 -16
  21. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +102 -29
  22. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +854 -3
  23. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +15 -1
  24. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +6 -2
  25. package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +37 -7
  26. package/dist/bundling-sources/shared_libs/plays/share/static-pipeline-summary.ts +43 -0
  27. package/dist/bundling-sources/shared_libs/product-notifications/billing-sales.ts +1 -0
  28. package/dist/bundling-sources/shared_libs/product-notifications/catalog.ts +38 -5
  29. package/dist/bundling-sources/shared_libs/product-notifications/default-policy.ts +1 -1
  30. package/dist/bundling-sources/shared_libs/product-notifications/events.ts +16 -0
  31. package/dist/cli/{auth-UJCAHGZG.mjs → auth-KVSBJZOX.mjs} +5 -5
  32. package/dist/cli/auth-MMNVWATX.js +43 -0
  33. package/dist/cli/{billing-RYWMI7JJ.mjs → billing-54RHFEBI.mjs} +20 -13
  34. package/dist/cli/{billing-VO2O5O5O.js → billing-FQREA7UA.js} +109 -102
  35. package/dist/cli/chunk-2RIKOPIM.mjs +9 -0
  36. package/dist/cli/{chunk-XYIECA7M.js → chunk-2WFPHBR4.js} +30 -8
  37. package/dist/cli/{chunk-SBNNK73L.js → chunk-3FD5EQ62.js} +6 -6
  38. package/dist/cli/{chunk-JLFOQRWM.js → chunk-45PVGZST.js} +270 -270
  39. package/dist/cli/{chunk-YSYOQYZE.js → chunk-4MK42735.js} +48 -44
  40. package/dist/cli/{chunk-2IW5GKB4.js → chunk-4NQF6KJ3.js} +13 -13
  41. package/dist/cli/{chunk-72NXIFOT.mjs → chunk-4TALT2M3.mjs} +1 -1
  42. package/dist/cli/{chunk-ADWMIZCB.js → chunk-4UUR4TCH.js} +22 -13
  43. package/dist/cli/{chunk-EMPXPEIQ.mjs → chunk-57VZVF5D.mjs} +3 -3
  44. package/dist/cli/{chunk-5J3TRWTB.js → chunk-634ZDA3F.js} +1 -1
  45. package/dist/cli/{chunk-FMXLQHM2.mjs → chunk-6O5HOODW.mjs} +13 -13
  46. package/dist/cli/{chunk-HCFH2V27.mjs → chunk-6PRW5UBA.mjs} +3 -2
  47. package/dist/cli/{chunk-N2Y2IGNB.mjs → chunk-6RZOWL2V.mjs} +1 -1
  48. package/dist/cli/{chunk-JKLDCFY5.js → chunk-6YCA5NKJ.js} +11 -11
  49. package/dist/cli/{chunk-5LUF4LAR.mjs → chunk-6ZORHRKB.mjs} +1 -0
  50. package/dist/cli/{chunk-DGUTBLXF.js → chunk-77AAAGVB.js} +3 -2
  51. package/dist/cli/{chunk-OKNOQRQ3.js → chunk-7IKQKKNX.js} +3 -3
  52. package/dist/cli/{chunk-JYUIIDZO.js → chunk-ADRC5I3R.js} +23 -22
  53. package/dist/cli/{chunk-IZCPOX7X.mjs → chunk-AQWQ2BFX.mjs} +1 -1
  54. package/dist/cli/{chunk-7BWMCVYU.mjs → chunk-AWJPDPMA.mjs} +1 -1
  55. package/dist/cli/{chunk-S6XOKGBF.mjs → chunk-AZQ264ID.mjs} +1 -1
  56. package/dist/cli/{chunk-EU23QOJ6.js → chunk-BAIST2BR.js} +26 -26
  57. package/dist/cli/{chunk-6P7TGCHQ.mjs → chunk-BGBJV26E.mjs} +10 -3
  58. package/dist/cli/{chunk-COHCKZQK.mjs → chunk-DJ2JDK4O.mjs} +2 -1
  59. package/dist/cli/{chunk-E4S7OE7B.mjs → chunk-EOPEYCY7.mjs} +3 -3
  60. package/dist/cli/{chunk-LUULRAQB.mjs → chunk-EUPVF4SU.mjs} +10 -7
  61. package/dist/cli/{chunk-TB3WT76F.js → chunk-F2LH7TGF.js} +23 -20
  62. package/dist/cli/{chunk-UL7HWZO7.mjs → chunk-FTJLJCE5.mjs} +2 -2
  63. package/dist/cli/{chunk-3WG2GURT.js → chunk-G4O75EXF.js} +9 -9
  64. package/dist/cli/{chunk-7AOFSZJM.mjs → chunk-GGGAEVCX.mjs} +23 -1
  65. package/dist/cli/{chunk-R5CYKRA2.js → chunk-GKYAYLRI.js} +12 -12
  66. package/dist/cli/{chunk-UV4RU2TE.js → chunk-H4ALLC2X.js} +2 -0
  67. package/dist/cli/{chunk-LWHWMU4V.js → chunk-HO3XK3R7.js} +7 -7
  68. package/dist/cli/{chunk-E2QVWDDW.mjs → chunk-HYC4MKGK.mjs} +3 -3
  69. package/dist/cli/{chunk-KSUTNW3X.js → chunk-IDVVIXPJ.js} +42 -41
  70. package/dist/cli/{chunk-BJO7ZXAK.js → chunk-IHRKLXZN.js} +5 -5
  71. package/dist/cli/{chunk-ZQZOYGDC.mjs → chunk-IYSTRCLX.mjs} +5 -4
  72. package/dist/cli/{chunk-SMLWC7PM.js → chunk-JWUAX6OP.js} +10 -10
  73. package/dist/cli/{chunk-RKF263LR.js → chunk-KWSH5T7K.js} +25 -18
  74. package/dist/cli/{chunk-I62PCYU6.js → chunk-MF2GHZDO.js} +2 -2
  75. package/dist/cli/{chunk-XKE2PGZ2.js → chunk-PFO3ISXA.js} +26 -15
  76. package/dist/cli/{chunk-MXEYNRTZ.mjs → chunk-PTVD2GVQ.mjs} +6 -5
  77. package/dist/cli/{chunk-QD2KT7II.mjs → chunk-QAORXEY3.mjs} +2 -2
  78. package/dist/cli/{chunk-2AKS64KJ.mjs → chunk-QILKGXYF.mjs} +2 -2
  79. package/dist/cli/{chunk-DJWM5OOY.mjs → chunk-QPKH23EC.mjs} +4 -4
  80. package/dist/cli/{chunk-MAE3AKDR.mjs → chunk-QX7LFGJR.mjs} +18 -9
  81. package/dist/cli/{chunk-CIBQVA6V.mjs → chunk-QY3ZNU6Z.mjs} +2 -2
  82. package/dist/cli/{chunk-MJDQZYKO.js → chunk-RBEUVDZF.js} +10 -6
  83. package/dist/cli/{chunk-RS6ZSKX6.js → chunk-RQZQVFCJ.js} +2 -2
  84. package/dist/cli/{chunk-QNWNR6DG.js → chunk-S46HWQKO.js} +53 -53
  85. package/dist/cli/{chunk-4NQWUUOH.mjs → chunk-S5S355UY.mjs} +2 -2
  86. package/dist/cli/{chunk-NM3AYEDI.js → chunk-SHLFOPD6.js} +5 -5
  87. package/dist/cli/{chunk-K7JZV4QW.mjs → chunk-U7QRMBIY.mjs} +2 -2
  88. package/dist/cli/{chunk-ECWOIXAV.js → chunk-UPMRIVZB.js} +14 -12
  89. package/dist/cli/{chunk-R7J7CJPZ.js → chunk-V436Z54K.js} +1 -0
  90. package/dist/cli/{chunk-RINUMR6C.js → chunk-VQALXEXO.js} +20 -19
  91. package/dist/cli/{chunk-F2RXBNT5.mjs → chunk-WE5HES3H.mjs} +7 -5
  92. package/dist/cli/{chunk-GWNYLIF7.mjs → chunk-WEHCBH5R.mjs} +4 -2
  93. package/dist/cli/{chunk-SZNX3XU3.js → chunk-WLN3SUIA.js} +3 -3
  94. package/dist/cli/{chunk-3W44AJOE.js → chunk-XVB7V4N7.js} +18 -16
  95. package/dist/cli/{chunk-HEVUFICQ.mjs → chunk-YJHE3O5M.mjs} +9 -5
  96. package/dist/cli/{chunk-GVW5V562.mjs → chunk-YLTMXJFC.mjs} +7 -3
  97. package/dist/cli/{chunk-TL3WIXDH.mjs → chunk-Z5TSLLOW.mjs} +19 -8
  98. package/dist/cli/{chunk-KLQILE2I.mjs → chunk-ZIAXDBXX.mjs} +2 -2
  99. package/dist/cli/command-docs.js +4 -4
  100. package/dist/cli/command-docs.mjs +3 -3
  101. package/dist/cli/concurrent-runs-help-FQAIHKKC.js +21 -0
  102. package/dist/cli/{concurrent-runs-help-766HVJR3.mjs → concurrent-runs-help-Q4KPAUJX.mjs} +7 -7
  103. package/dist/cli/{csv-VU52KZOX.mjs → csv-2PTVDNO6.mjs} +10 -5
  104. package/dist/cli/{csv-4DZKGYCU.js → csv-F5VAGX4K.js} +19 -14
  105. package/dist/cli/{db-UBGW373S.mjs → db-IEDXAUF7.mjs} +6 -6
  106. package/dist/cli/{db-KPIH4HPW.js → db-Z3OIUFMM.js} +27 -27
  107. package/dist/cli/{describe-NGITP6RA.mjs → describe-QDANCTS3.mjs} +21 -21
  108. package/dist/cli/describe-VUTT5ZKU.js +50 -0
  109. package/dist/cli/describe-core.d.mts +4 -2
  110. package/dist/cli/describe-core.d.ts +4 -2
  111. package/dist/cli/describe-core.js +4 -4
  112. package/dist/cli/describe-core.mjs +3 -3
  113. package/dist/cli/{executions-G3X25U3V.js → executions-H6H5655J.js} +8 -8
  114. package/dist/cli/{executions-CO5UF3CV.mjs → executions-R3LP74QN.mjs} +6 -6
  115. package/dist/cli/{feedback-ZYF65WPH.js → feedback-VFOUR66B.js} +14 -14
  116. package/dist/cli/{feedback-M2L5DVN2.mjs → feedback-WL3MRVT5.mjs} +6 -6
  117. package/dist/cli/git-ETB3GH3K.js +25 -0
  118. package/dist/cli/{git-AYJD5CLS.mjs → git-YX2J4GCI.mjs} +5 -5
  119. package/dist/cli/index.js +148 -148
  120. package/dist/cli/index.mjs +47 -47
  121. package/dist/cli/{integrations-LKEGGTZO.mjs → integrations-5ZK5KLVP.mjs} +7 -7
  122. package/dist/cli/{integrations-GSXXJ4CF.js → integrations-E2JZYKHS.js} +15 -15
  123. package/dist/cli/{legacy-noops-MZDLLEKN.js → legacy-noops-3VW4IJTH.js} +9 -9
  124. package/dist/cli/{legacy-noops-UF4GKMD4.mjs → legacy-noops-SMN3GSXY.mjs} +6 -6
  125. package/dist/cli/{mcp-RTNC6LP3.js → mcp-UQV2K4EW.js} +24 -24
  126. package/dist/cli/{mcp-NHQ6RMBP.mjs → mcp-V6MGCYAG.mjs} +4 -4
  127. package/dist/cli/{monitors-NC4ZR5DH.mjs → monitors-GGKS5W6M.mjs} +7 -7
  128. package/dist/cli/{monitors-WMWB6EKQ.js → monitors-R3BBDCRC.js} +100 -100
  129. package/dist/cli/{org-33Q7CXJB.js → org-GRYVMNSW.js} +88 -88
  130. package/dist/cli/{org-ZXUSYREQ.mjs → org-Z37NGJV4.mjs} +6 -6
  131. package/dist/cli/{play-N24XV6TI.js → play-2MVO27VO.js} +332 -332
  132. package/dist/cli/{play-IPWFGNRE.mjs → play-MDWPR4XG.mjs} +19 -19
  133. package/dist/cli/{providers-AUI7MMQS.js → providers-2AACRUZH.js} +9 -9
  134. package/dist/cli/{providers-MSVE7UZS.mjs → providers-AKDYFZJZ.mjs} +6 -6
  135. package/dist/cli/{quickstart-PSC6VTRI.js → quickstart-H6IV3PV3.js} +6 -6
  136. package/dist/cli/{quickstart-OME5XMW5.mjs → quickstart-QDGRJFZY.mjs} +4 -4
  137. package/dist/cli/{run-UTIX7CJY.js → run-2634REDK.js} +47 -47
  138. package/dist/cli/{run-EYTT2DHO.mjs → run-RTSQNGRD.mjs} +26 -26
  139. package/dist/cli/{search-FVE7PM72.mjs → search-6AOJ4XPP.mjs} +7 -7
  140. package/dist/cli/search-VTW2YNBS.js +32 -0
  141. package/dist/cli/{search-output-TQMY6BDG.mjs → search-output-6ADMTOU5.mjs} +40 -10
  142. package/dist/cli/{search-output-O463JNLR.js → search-output-S5ODBL5E.js} +43 -13
  143. package/dist/cli/{secrets-TWZ2GO73.js → secrets-LHCIIHMT.js} +15 -15
  144. package/dist/cli/{secrets-KCJJAHQB.mjs → secrets-TFIFBFB3.mjs} +6 -6
  145. package/dist/cli/sessions-CJ4FJ2WB.js +22 -0
  146. package/dist/cli/{sessions-ZCWAA7QL.mjs → sessions-WHBVUHVW.mjs} +6 -6
  147. package/dist/cli/{settings-SCR654U7.js → settings-CP4FVK2W.js} +85 -85
  148. package/dist/cli/{settings-4JFKCKII.mjs → settings-EBONWL5C.mjs} +12 -12
  149. package/dist/cli/{setup-Q2YOPGOI.mjs → setup-I5AZE3IU.mjs} +15 -10
  150. package/dist/cli/{setup-O6GH3UWT.js → setup-LFGHTNLQ.js} +55 -50
  151. package/dist/cli/skills-R7EBXREW.js +36 -0
  152. package/dist/cli/{skills-QHPZ6H2G.mjs → skills-W76AO5XE.mjs} +7 -7
  153. package/dist/cli/{tools-YO22H46E.mjs → tools-7IJHGF6W.mjs} +19 -19
  154. package/dist/cli/tools-V7U2BDXM.js +57 -0
  155. package/dist/cli/update-4COPZETK.js +34 -0
  156. package/dist/cli/{update-WHBC5IHE.mjs → update-GFOPZTHY.mjs} +9 -9
  157. package/dist/cli/{views-4CZJ5BLG.js → views-BPL2TQJ4.js} +21 -21
  158. package/dist/cli/{views-XNLXV2BT.mjs → views-D4NX4SBG.mjs} +6 -6
  159. package/dist/cli/{workflow-QUWP2CG2.mjs → workflow-YXP42FUI.mjs} +7 -7
  160. package/dist/cli/{workflow-C4VBARIE.js → workflow-ZYNAUCKC.js} +17 -17
  161. package/dist/{client-Ceo295L2.d.ts → client-Bf3IpUKN.d.ts} +1 -1
  162. package/dist/{client-BEJqhQAj.d.mts → client-CyXGrO4D.d.mts} +1 -1
  163. package/dist/{client-core-BPYuWfBC.d.ts → client-core-BWd0lX0Z.d.ts} +110 -4
  164. package/dist/{client-core-BqetRxx-.d.mts → client-core-BxsLnXlm.d.mts} +110 -4
  165. package/dist/index.d.mts +3 -3
  166. package/dist/index.d.ts +3 -3
  167. package/dist/index.js +9 -9
  168. package/dist/index.mjs +6 -6
  169. package/dist/install-integrity.json +127 -126
  170. package/dist/plays/play-description.d.mts +1 -1
  171. package/dist/plays/play-description.d.ts +1 -1
  172. package/dist/plays/run-request.d.mts +1 -1
  173. package/dist/plays/run-request.d.ts +1 -1
  174. package/dist/release.d.mts +1 -1
  175. package/dist/release.d.ts +1 -1
  176. package/dist/release.js +2 -2
  177. package/dist/release.mjs +1 -1
  178. package/dist/server.d.mts +2 -2
  179. package/dist/server.d.ts +2 -2
  180. package/dist/server.js +5 -5
  181. package/dist/server.mjs +3 -3
  182. package/package.json +1 -1
  183. package/dist/cli/auth-J4OW5RNJ.js +0 -43
  184. package/dist/cli/chunk-NIPLY25A.mjs +0 -7
  185. package/dist/cli/concurrent-runs-help-3XZIHVRP.js +0 -21
  186. package/dist/cli/describe-4BI6E2CM.js +0 -50
  187. package/dist/cli/git-QRZP4DNA.js +0 -25
  188. package/dist/cli/search-CQ6JG2EN.js +0 -32
  189. package/dist/cli/sessions-LMPXUPUH.js +0 -22
  190. package/dist/cli/skills-M4CFE65Z.js +0 -36
  191. package/dist/cli/tools-CV7XA2V6.js +0 -57
  192. package/dist/cli/update-PUWBKPWJ.js +0 -34
@@ -0,0 +1,285 @@
1
+ // TamRadar's supported countries for the industry radar `countries` filter:
2
+ // each row is the two-letter code, the name TamRadar saves and returns, and
3
+ // its other accepted names. TamRadar matches any of them ignoring case and
4
+ // extra spaces, so "us", "US" and "United States" are one country.
5
+ // Source: https://docs.tamradar.com/guides/supported-countries (250 countries,
6
+ // Unicode CLDR 48 English names), read 2026-11-17. Runtime-neutral: Convex
7
+ // claim admission and the app derive the same identity key from it.
8
+ const TAMRADAR_COUNTRIES: readonly (
9
+ | readonly [code: string, name: string]
10
+ | readonly [code: string, name: string, alsoAccepted: readonly string[]]
11
+ )[] = [
12
+ ['AF', 'Afghanistan'],
13
+ ['AX', 'Åland Islands'],
14
+ ['AL', 'Albania'],
15
+ ['DZ', 'Algeria'],
16
+ ['AS', 'American Samoa'],
17
+ ['AD', 'Andorra'],
18
+ ['AO', 'Angola'],
19
+ ['AI', 'Anguilla'],
20
+ ['AQ', 'Antarctica'],
21
+ ['AG', 'Antigua & Barbuda'],
22
+ ['AR', 'Argentina'],
23
+ ['AM', 'Armenia'],
24
+ ['AW', 'Aruba'],
25
+ ['AU', 'Australia'],
26
+ ['AT', 'Austria'],
27
+ ['AZ', 'Azerbaijan'],
28
+ ['BS', 'Bahamas'],
29
+ ['BH', 'Bahrain'],
30
+ ['BD', 'Bangladesh'],
31
+ ['BB', 'Barbados'],
32
+ ['BY', 'Belarus'],
33
+ ['BE', 'Belgium'],
34
+ ['BZ', 'Belize'],
35
+ ['BJ', 'Benin'],
36
+ ['BM', 'Bermuda'],
37
+ ['BT', 'Bhutan'],
38
+ ['BO', 'Bolivia'],
39
+ ['BA', 'Bosnia & Herzegovina', ['Bosnia']],
40
+ ['BW', 'Botswana'],
41
+ ['BV', 'Bouvet Island'],
42
+ ['BR', 'Brazil'],
43
+ ['IO', 'British Indian Ocean Territory', ['Chagos Archipelago']],
44
+ ['VG', 'British Virgin Islands'],
45
+ ['BN', 'Brunei'],
46
+ ['BG', 'Bulgaria'],
47
+ ['BF', 'Burkina Faso'],
48
+ ['BI', 'Burundi'],
49
+ ['KH', 'Cambodia'],
50
+ ['CM', 'Cameroon'],
51
+ ['CA', 'Canada'],
52
+ ['CV', 'Cape Verde', ['Cabo Verde']],
53
+ ['BQ', 'Caribbean Netherlands'],
54
+ ['KY', 'Cayman Islands'],
55
+ ['CF', 'Central African Republic'],
56
+ ['TD', 'Chad'],
57
+ ['CL', 'Chile'],
58
+ ['CN', 'China'],
59
+ ['CX', 'Christmas Island'],
60
+ ['CC', 'Cocos (Keeling) Islands', ['Cocos Islands']],
61
+ ['CO', 'Colombia'],
62
+ ['KM', 'Comoros'],
63
+ ['CG', 'Congo - Brazzaville', ['Congo (Republic)']],
64
+ ['CD', 'Congo - Kinshasa', ['Congo (DRC)']],
65
+ ['CK', 'Cook Islands'],
66
+ ['CR', 'Costa Rica'],
67
+ ['CI', 'Côte d’Ivoire', ['Ivory Coast']],
68
+ ['HR', 'Croatia'],
69
+ ['CU', 'Cuba'],
70
+ ['CW', 'Curaçao'],
71
+ ['CY', 'Cyprus'],
72
+ ['CZ', 'Czechia', ['Czech Republic']],
73
+ ['DK', 'Denmark'],
74
+ ['DJ', 'Djibouti'],
75
+ ['DM', 'Dominica'],
76
+ ['DO', 'Dominican Republic'],
77
+ ['EC', 'Ecuador'],
78
+ ['EG', 'Egypt'],
79
+ ['SV', 'El Salvador'],
80
+ ['GQ', 'Equatorial Guinea'],
81
+ ['ER', 'Eritrea'],
82
+ ['EE', 'Estonia'],
83
+ ['SZ', 'Eswatini', ['Swaziland']],
84
+ ['ET', 'Ethiopia'],
85
+ ['FK', 'Falkland Islands', ['Falkland Islands (Islas Malvinas)']],
86
+ ['FO', 'Faroe Islands'],
87
+ ['FJ', 'Fiji'],
88
+ ['FI', 'Finland'],
89
+ ['FR', 'France'],
90
+ ['GF', 'French Guiana'],
91
+ ['PF', 'French Polynesia'],
92
+ ['TF', 'French Southern Territories'],
93
+ ['GA', 'Gabon'],
94
+ ['GM', 'Gambia'],
95
+ ['GE', 'Georgia'],
96
+ ['DE', 'Germany'],
97
+ ['GH', 'Ghana'],
98
+ ['GI', 'Gibraltar'],
99
+ ['GR', 'Greece'],
100
+ ['GL', 'Greenland'],
101
+ ['GD', 'Grenada'],
102
+ ['GP', 'Guadeloupe'],
103
+ ['GU', 'Guam'],
104
+ ['GT', 'Guatemala'],
105
+ ['GG', 'Guernsey'],
106
+ ['GN', 'Guinea'],
107
+ ['GW', 'Guinea-Bissau'],
108
+ ['GY', 'Guyana'],
109
+ ['HT', 'Haiti'],
110
+ ['HM', 'Heard & McDonald Islands'],
111
+ ['HN', 'Honduras'],
112
+ ['HK', 'Hong Kong SAR China', ['Hong Kong']],
113
+ ['HU', 'Hungary'],
114
+ ['IS', 'Iceland'],
115
+ ['IN', 'India'],
116
+ ['ID', 'Indonesia'],
117
+ ['IR', 'Iran'],
118
+ ['IQ', 'Iraq'],
119
+ ['IE', 'Ireland'],
120
+ ['IM', 'Isle of Man'],
121
+ ['IL', 'Israel'],
122
+ ['IT', 'Italy'],
123
+ ['JM', 'Jamaica'],
124
+ ['JP', 'Japan'],
125
+ ['JE', 'Jersey'],
126
+ ['JO', 'Jordan'],
127
+ ['KZ', 'Kazakhstan'],
128
+ ['KE', 'Kenya'],
129
+ ['KI', 'Kiribati'],
130
+ ['XK', 'Kosovo'],
131
+ ['KW', 'Kuwait'],
132
+ ['KG', 'Kyrgyzstan'],
133
+ ['LA', 'Laos'],
134
+ ['LV', 'Latvia'],
135
+ ['LB', 'Lebanon'],
136
+ ['LS', 'Lesotho'],
137
+ ['LR', 'Liberia'],
138
+ ['LY', 'Libya'],
139
+ ['LI', 'Liechtenstein'],
140
+ ['LT', 'Lithuania'],
141
+ ['LU', 'Luxembourg'],
142
+ ['MO', 'Macao SAR China', ['Macao']],
143
+ ['MG', 'Madagascar'],
144
+ ['MW', 'Malawi'],
145
+ ['MY', 'Malaysia'],
146
+ ['MV', 'Maldives'],
147
+ ['ML', 'Mali'],
148
+ ['MT', 'Malta'],
149
+ ['MH', 'Marshall Islands'],
150
+ ['MQ', 'Martinique'],
151
+ ['MR', 'Mauritania'],
152
+ ['MU', 'Mauritius'],
153
+ ['YT', 'Mayotte'],
154
+ ['MX', 'Mexico'],
155
+ ['FM', 'Micronesia'],
156
+ ['MD', 'Moldova'],
157
+ ['MC', 'Monaco'],
158
+ ['MN', 'Mongolia'],
159
+ ['ME', 'Montenegro'],
160
+ ['MS', 'Montserrat'],
161
+ ['MA', 'Morocco'],
162
+ ['MZ', 'Mozambique'],
163
+ ['MM', 'Myanmar (Burma)', ['Myanmar']],
164
+ ['NA', 'Namibia'],
165
+ ['NR', 'Nauru'],
166
+ ['NP', 'Nepal'],
167
+ ['NL', 'Netherlands'],
168
+ ['NC', 'New Caledonia'],
169
+ ['NZ', 'New Zealand', ['Aotearoa New Zealand']],
170
+ ['NI', 'Nicaragua'],
171
+ ['NE', 'Niger'],
172
+ ['NG', 'Nigeria'],
173
+ ['NU', 'Niue'],
174
+ ['NF', 'Norfolk Island'],
175
+ ['KP', 'North Korea'],
176
+ ['MK', 'North Macedonia'],
177
+ ['MP', 'Northern Mariana Islands'],
178
+ ['NO', 'Norway'],
179
+ ['OM', 'Oman'],
180
+ ['PK', 'Pakistan'],
181
+ ['PW', 'Palau'],
182
+ ['PS', 'Palestinian Territories', ['Palestine']],
183
+ ['PA', 'Panama'],
184
+ ['PG', 'Papua New Guinea'],
185
+ ['PY', 'Paraguay'],
186
+ ['PE', 'Peru'],
187
+ ['PH', 'Philippines'],
188
+ ['PN', 'Pitcairn Islands', ['Pitcairn']],
189
+ ['PL', 'Poland'],
190
+ ['PT', 'Portugal'],
191
+ ['PR', 'Puerto Rico'],
192
+ ['QA', 'Qatar'],
193
+ ['RE', 'Réunion'],
194
+ ['RO', 'Romania'],
195
+ ['RU', 'Russia'],
196
+ ['RW', 'Rwanda'],
197
+ ['WS', 'Samoa'],
198
+ ['SM', 'San Marino'],
199
+ ['ST', 'São Tomé & Príncipe'],
200
+ ['SA', 'Saudi Arabia'],
201
+ ['SN', 'Senegal'],
202
+ ['RS', 'Serbia'],
203
+ ['SC', 'Seychelles'],
204
+ ['SL', 'Sierra Leone'],
205
+ ['SG', 'Singapore'],
206
+ ['SX', 'Sint Maarten'],
207
+ ['SK', 'Slovakia'],
208
+ ['SI', 'Slovenia'],
209
+ ['SB', 'Solomon Islands'],
210
+ ['SO', 'Somalia'],
211
+ ['ZA', 'South Africa'],
212
+ ['GS', 'South Georgia & South Sandwich Islands'],
213
+ ['KR', 'South Korea'],
214
+ ['SS', 'South Sudan'],
215
+ ['ES', 'Spain'],
216
+ ['LK', 'Sri Lanka'],
217
+ ['BL', 'St. Barthélemy'],
218
+ ['SH', 'St. Helena'],
219
+ ['KN', 'St. Kitts & Nevis'],
220
+ ['LC', 'St. Lucia'],
221
+ ['MF', 'St. Martin'],
222
+ ['PM', 'St. Pierre & Miquelon'],
223
+ ['VC', 'St. Vincent & Grenadines'],
224
+ ['SD', 'Sudan'],
225
+ ['SR', 'Suriname'],
226
+ ['SJ', 'Svalbard & Jan Mayen'],
227
+ ['SE', 'Sweden'],
228
+ ['CH', 'Switzerland'],
229
+ ['SY', 'Syria'],
230
+ ['TW', 'Taiwan'],
231
+ ['TJ', 'Tajikistan'],
232
+ ['TZ', 'Tanzania'],
233
+ ['TH', 'Thailand'],
234
+ ['TL', 'Timor-Leste', ['East Timor']],
235
+ ['TG', 'Togo'],
236
+ ['TK', 'Tokelau'],
237
+ ['TO', 'Tonga'],
238
+ ['TT', 'Trinidad & Tobago'],
239
+ ['TN', 'Tunisia'],
240
+ ['TR', 'Türkiye', ['Turkey']],
241
+ ['TM', 'Turkmenistan'],
242
+ ['TC', 'Turks & Caicos Islands'],
243
+ ['TV', 'Tuvalu'],
244
+ ['UM', 'U.S. Outlying Islands'],
245
+ ['VI', 'U.S. Virgin Islands'],
246
+ ['UG', 'Uganda'],
247
+ ['UA', 'Ukraine'],
248
+ ['AE', 'United Arab Emirates'],
249
+ ['GB', 'United Kingdom', ['UK']],
250
+ ['US', 'United States'],
251
+ ['UY', 'Uruguay'],
252
+ ['UZ', 'Uzbekistan'],
253
+ ['VU', 'Vanuatu'],
254
+ ['VA', 'Vatican City'],
255
+ ['VE', 'Venezuela'],
256
+ ['VN', 'Vietnam'],
257
+ ['WF', 'Wallis & Futuna'],
258
+ ['EH', 'Western Sahara'],
259
+ ['YE', 'Yemen'],
260
+ ['ZM', 'Zambia'],
261
+ ['ZW', 'Zimbabwe'],
262
+ ];
263
+
264
+ function countryLookupKey(value: string) {
265
+ return value.trim().replace(/\s+/g, ' ').toLowerCase();
266
+ }
267
+
268
+ const TAMRADAR_COUNTRY_NAME_BY_LOOKUP_KEY: ReadonlyMap<string, string> =
269
+ new Map(
270
+ TAMRADAR_COUNTRIES.flatMap(([code, name, alsoAccepted = []]) =>
271
+ [code, name, ...alsoAccepted].map(
272
+ (accepted) => [countryLookupKey(accepted), name] as const,
273
+ ),
274
+ ),
275
+ );
276
+
277
+ /**
278
+ * The country name TamRadar saves for an accepted code or name, or null when
279
+ * TamRadar does not accept the value (it refuses the create with a 400).
280
+ */
281
+ export function tamradarCanonicalCountryName(value: string): string | null {
282
+ return (
283
+ TAMRADAR_COUNTRY_NAME_BY_LOOKUP_KEY.get(countryLookupKey(value)) ?? null
284
+ );
285
+ }
@@ -7,6 +7,7 @@ export const VECTOR_POST_DEPLOY_GUIDANCE = {
7
7
  steps: [
8
8
  'In Vector, open the segment named in this monitor setup.',
9
9
  'Add a webhook endpoint using {{callback_url}}, then select contact.visited.',
10
+ 'Other event types the endpoint subscribes to (company.visited, contact.intent, visitor.identified, contact) are stored too; each row names its event_type.',
10
11
  'Enable the webhook action on the segment and send a Vector test event.',
11
12
  ],
12
13
  event_type: 'contact.visited',
@@ -1971,5 +1971,168 @@
1971
1971
  "runTimeoutMs": 120000,
1972
1972
  "failureAlert": "convex_native_scheduled_function",
1973
1973
  "domainReportRequired": true
1974
+ },
1975
+ {
1976
+ "id": "github.warehouse-tool-rollups",
1977
+ "name": "Warehouse Tool Rollups",
1978
+ "workflowEvents": ["workflow_dispatch"],
1979
+ "scheduler": "github_actions",
1980
+ "cadence": "runAfter(successful mirror materialization)",
1981
+ "timezone": "UTC",
1982
+ "source": ".github/workflows/warehouse-tool-rollups.yml",
1983
+ "locator": "workflow_dispatch:",
1984
+ "owner": "data-platform",
1985
+ "criticality": "reporting",
1986
+ "purpose": "Recompute historical tool analytics from raw mirrored usage and atomically publish Search serving snapshots once per UTC cutoff.",
1987
+ "successDefinition": "A source-certified snapshot reconciles and publishes, or the same cutoff already has a complete snapshot. Historical runs retain each daily build without rewinding current serving data.",
1988
+ "failureDefinition": "Source is stale or changes during the read, SQL fails, or a bounded publication fails; the previous serving snapshot remains active.",
1989
+ "startGraceMs": 600000,
1990
+ "runTimeoutMs": 5400000,
1991
+ "failureAlert": "github_workflow_run",
1992
+ "domainReportRequired": true
1993
+ },
1994
+ {
1995
+ "id": "convex.ledger-shadow-journal-drain",
1996
+ "name": "Ledger shadow journal writer drain",
1997
+ "scheduler": "convex_scheduled_action",
1998
+ "cadence": "runAfter(0) when a shadow book's writer lease is taken; lease-owned continuation and linger hops",
1999
+ "source": "packages/convex/ledgerJournalWriter.ts",
2000
+ "locator": "drainWriter",
2001
+ "purpose": "Apply a shadow book's journal writer turns (inert: runs only on shadow books, and only while the shadow ceiling is above 0 or a dev/Preview harness forces it).",
2002
+ "successDefinition": "The drain applies its turns under its writer lease epoch and idles, hands over, or is fenced by a newer epoch.",
2003
+ "failureDefinition": "The native scheduled action fails; the writer lease watch restarts the drain at the next epoch.",
2004
+ "runTimeoutMs": 600000,
2005
+ "timezone": "UTC",
2006
+ "owner": "billing",
2007
+ "criticality": "reporting",
2008
+ "startGraceMs": 120000,
2009
+ "failureAlert": "convex_native_scheduled_function",
2010
+ "domainReportRequired": true
2011
+ },
2012
+ {
2013
+ "id": "convex.ledger-shadow-journal-watch",
2014
+ "name": "Ledger shadow journal writer lease watch",
2015
+ "scheduler": "convex_scheduled_mutation",
2016
+ "cadence": "runAfter at each drain epoch's lease end plus the watch grace",
2017
+ "source": "packages/convex/ledgerJournalWriter.ts",
2018
+ "locator": "watchWriterLease",
2019
+ "purpose": "Restart a shadow book's writer drain whose action died (inert: shadow books only, ceiling 0).",
2020
+ "successDefinition": "The watch re-arms for a live lease, ends for a released or superseded epoch, or takes the lapsed lease over at the next epoch.",
2021
+ "failureDefinition": "The native scheduled mutation fails; the next append or lease request takes the lapsed lease over.",
2022
+ "runTimeoutMs": 60000,
2023
+ "timezone": "UTC",
2024
+ "owner": "billing",
2025
+ "criticality": "reporting",
2026
+ "startGraceMs": 120000,
2027
+ "failureAlert": "convex_native_scheduled_function",
2028
+ "domainReportRequired": true
2029
+ },
2030
+ {
2031
+ "id": "convex.ledger-shadow-journal-page-sweep",
2032
+ "name": "Ledger shadow journal slot page settle and carry sweep",
2033
+ "scheduler": "convex_scheduled_mutation",
2034
+ "cadence": "runAt each slot page's window end plus the settle delay; carried tickets runAt the settle plus the carry window",
2035
+ "source": "packages/convex/ledgerJournalPages.ts",
2036
+ "locator": "settleSlotPage",
2037
+ "purpose": "Settle each shadow book's slot page once and return its carried tickets' reserve (inert: shadow books only, ceiling 0).",
2038
+ "successDefinition": "The page closes with its spend and appends its totals once, or is skipped as already closed or rescheduled as early.",
2039
+ "failureDefinition": "The native scheduled mutation fails; the writer's page watchdog schedules the settle again at its next org sweep.",
2040
+ "runTimeoutMs": 60000,
2041
+ "timezone": "UTC",
2042
+ "owner": "billing",
2043
+ "criticality": "reporting",
2044
+ "startGraceMs": 120000,
2045
+ "failureAlert": "convex_native_scheduled_function",
2046
+ "domainReportRequired": true
2047
+ },
2048
+ {
2049
+ "id": "convex.ledger-shadow-follower-drain",
2050
+ "name": "Ledger shadow follower drain",
2051
+ "scheduler": "convex_scheduled_action",
2052
+ "cadence": "runAfter(0) when an organization's follower lease is taken; lease-owned continuation while a pending row is due within the linger",
2053
+ "source": "packages/convex/ledgerJournalShadow.ts",
2054
+ "locator": "drainShadowFollower",
2055
+ "purpose": "Compare each due shadowed call with main's reservation (read in a query), finalize its immutable diff row and apply main's terminal fact to its shadow async hold, or back the row off (inert: shadow books only, shadow ceiling 0).",
2056
+ "successDefinition": "Every due pending row of the organization is finalized or backed off, and the drain continues, lingers or releases its lease with one timer for the next due row.",
2057
+ "failureDefinition": "The native scheduled action fails; the follower lease watch takes the lapsed lease over at the next epoch, and the orphan sweep requests a drain for overdue rows.",
2058
+ "runTimeoutMs": 600000,
2059
+ "timezone": "UTC",
2060
+ "owner": "billing",
2061
+ "criticality": "reporting",
2062
+ "startGraceMs": 120000,
2063
+ "failureAlert": "convex_native_scheduled_function",
2064
+ "domainReportRequired": true
2065
+ },
2066
+ {
2067
+ "id": "convex.ledger-shadow-follower-watch",
2068
+ "name": "Ledger shadow follower lease watch",
2069
+ "scheduler": "convex_scheduled_mutation",
2070
+ "cadence": "runAfter at each follower drain epoch's lease end plus the watch grace",
2071
+ "source": "packages/convex/ledgerJournalShadow.ts",
2072
+ "locator": "watchFollowerLease",
2073
+ "purpose": "Restart an organization's follower drain whose action died with due rows left (inert: shadow books only, shadow ceiling 0).",
2074
+ "successDefinition": "The watch re-arms for a live lease, ends for a superseded or idle one, or takes the lapsed lease over at the next epoch.",
2075
+ "failureDefinition": "The native scheduled mutation fails; the next shadow admit or the orphan sweep requests a drain.",
2076
+ "runTimeoutMs": 60000,
2077
+ "timezone": "UTC",
2078
+ "owner": "billing",
2079
+ "criticality": "reporting",
2080
+ "startGraceMs": 120000,
2081
+ "failureAlert": "convex_native_scheduled_function",
2082
+ "domainReportRequired": true
2083
+ },
2084
+ {
2085
+ "id": "convex.ledger-shadow-orphan-sweep",
2086
+ "name": "Ledger shadow follower orphan sweep",
2087
+ "scheduler": "convex_scheduled_mutation",
2088
+ "cadence": "runAfter(0) from the shared operations API run action, one bounded pass (no cron until the approved activation)",
2089
+ "source": "packages/convex/ledgerJournalShadow.ts",
2090
+ "locator": "sweepOrphanFollowers",
2091
+ "purpose": "Request one follower drain for each organization whose pending rows are overdue with no live drain (inert: refuses while the shadow ceiling is 0).",
2092
+ "successDefinition": "One bounded page of overdue rows is read and each organization without a live drain gets exactly one drain request.",
2093
+ "failureDefinition": "The native scheduled mutation fails; overdue rows stay pending (no money moves) until the next pass.",
2094
+ "runTimeoutMs": 60000,
2095
+ "timezone": "UTC",
2096
+ "owner": "billing",
2097
+ "criticality": "reporting",
2098
+ "startGraceMs": 120000,
2099
+ "failureAlert": "convex_native_scheduled_function",
2100
+ "domainReportRequired": true
2101
+ },
2102
+ {
2103
+ "id": "convex.ledger-shadow-diff-retention",
2104
+ "name": "Ledger shadow diff retention",
2105
+ "scheduler": "convex_scheduled_mutation",
2106
+ "cadence": "runAfter(0) from the shared operations API run action; self-continued while pages come back full, bounded per pass (no cron until the approved activation)",
2107
+ "source": "packages/convex/ledgerJournalShadowOps.ts",
2108
+ "locator": "sweepDiffRetention",
2109
+ "purpose": "Delete shadow diff rows finalized more than 30 days ago (inert: refuses while the shadow ceiling is 0).",
2110
+ "successDefinition": "Expired diff rows are deleted in bounded pages until a short page or the pass bound.",
2111
+ "failureDefinition": "The native scheduled mutation fails; expired rows remain until the next pass.",
2112
+ "runTimeoutMs": 60000,
2113
+ "timezone": "UTC",
2114
+ "owner": "billing",
2115
+ "criticality": "reporting",
2116
+ "startGraceMs": 120000,
2117
+ "failureAlert": "convex_native_scheduled_function",
2118
+ "domainReportRequired": true
2119
+ },
2120
+ {
2121
+ "id": "convex.ledger-shadow-journal-retention",
2122
+ "name": "Ledger shadow journal retention",
2123
+ "scheduler": "convex_scheduled_action",
2124
+ "cadence": "runAfter(0) from the shared operations API run action; the pass continues itself from its book cursor until every shadow book is visited (no cron until the approved activation)",
2125
+ "source": "packages/convex/ledgerJournalShadowOps.ts",
2126
+ "locator": "sweepJournalRetention",
2127
+ "purpose": "Delete shadow journal rows of calls closed past retention (7 days, and never before the follower's last check), only for books whose probes find expired rows, in bounded rounds; never a book's funding, books, writer lease, fence or floor (inert: refuses while the shadow ceiling is 0).",
2128
+ "successDefinition": "Every shadow book is probed once per pass, and each book with expired rows is retained within the per-book round bound; unfinished books are reported.",
2129
+ "failureDefinition": "The native scheduled action fails; expired rows remain until the next pass.",
2130
+ "runTimeoutMs": 600000,
2131
+ "timezone": "UTC",
2132
+ "owner": "billing",
2133
+ "criticality": "reporting",
2134
+ "startGraceMs": 120000,
2135
+ "failureAlert": "convex_native_scheduled_function",
2136
+ "domainReportRequired": true
1974
2137
  }
1975
2138
  ]
@@ -54,6 +54,8 @@ export type PlayActivityTarget =
54
54
  limit?: number;
55
55
  /** Whether this limit was pinned at launch or read from workspace policy. */
56
56
  limitSource?: 'admission' | 'workspace';
57
+ /** Completed capacity wait duration; absent on older observations. */
58
+ waitedMs?: number;
57
59
  };
58
60
 
59
61
  export type PlayActivityProgress = {
@@ -1610,6 +1610,22 @@ export async function reconcileNodeRuntimeMapResultsWithPersistedSheet(input: {
1610
1610
  offset: number;
1611
1611
  rowMode: 'all' | 'output';
1612
1612
  }) => Promise<Record<string, unknown>[]>;
1613
+ /**
1614
+ * Keys this run committed as visible terminal rows, in commit order.
1615
+ * Overlapping runs of one Play share the dataset, and a later run's
1616
+ * admission or write moves a row's ownership to itself. Run-scoped reads
1617
+ * then omit that row; these keys let finalization return it and prove each
1618
+ * missing row was finished by another run rather than lost.
1619
+ */
1620
+ committedRowKeys?: readonly string[];
1621
+ /**
1622
+ * Finished (enriched or failed) rows for the keys, whichever run owns them,
1623
+ * or null when the reader cannot answer (an older runtime API). Null keeps
1624
+ * the shortfall a failure.
1625
+ */
1626
+ readCommittedTerminalRows?: (
1627
+ keys: string[],
1628
+ ) => Promise<readonly CommittedTerminalRow[] | null>;
1613
1629
  log?: (line: string) => void;
1614
1630
  }): Promise<Record<string, unknown>[]> {
1615
1631
  if (
@@ -1634,6 +1650,25 @@ export async function reconcileNodeRuntimeMapResultsWithPersistedSheet(input: {
1634
1650
  }
1635
1651
 
1636
1652
  if (persistedRows.length < input.expectedRows) {
1653
+ const committed = await readCommittedRowsAcrossRuns(input);
1654
+ if (committed && committed.takenOverRows > 0) {
1655
+ if (
1656
+ committed.unfinishedKeys === 0 &&
1657
+ committed.rows.length >= input.expectedRows
1658
+ ) {
1659
+ input.log?.(
1660
+ `Runtime sheet finalization recovered ctx.dataset("${input.mapName}") ` +
1661
+ `with ${committed.takenOverRows} committed row(s) another run of this dataset now owns; ` +
1662
+ `${persistedRows.length}/${input.expectedRows} terminal persisted row(s) are still owned by ` +
1663
+ `run ${input.runId ?? 'unknown'}.`,
1664
+ );
1665
+ return committed.rows;
1666
+ }
1667
+ input.log?.(
1668
+ `Runtime sheet finalization found ${committed.takenOverRows} committed row(s) of ctx.dataset("${input.mapName}") ` +
1669
+ `finished by another run; ${committed.unfinishedKeys} committed row(s) have no finished row.`,
1670
+ );
1671
+ }
1637
1672
  throw new Error(
1638
1673
  `Runtime sheet finalization mismatch for ctx.dataset("${input.mapName}"): ` +
1639
1674
  `expected ${input.expectedRows} terminal persisted row(s), saw ${persistedRows.length}; ` +
@@ -1653,6 +1688,68 @@ export async function reconcileNodeRuntimeMapResultsWithPersistedSheet(input: {
1653
1688
  return input.currentRows;
1654
1689
  }
1655
1690
 
1691
+ export type CommittedTerminalRow = {
1692
+ key: string;
1693
+ data: Record<string, unknown>;
1694
+ inputIndex?: number;
1695
+ ownedByOtherRun: boolean;
1696
+ };
1697
+
1698
+ // Each answer carries full row bodies; keep one gateway response small.
1699
+ const RUNTIME_SHEET_TAKEOVER_KEY_BATCH = 100;
1700
+
1701
+ /**
1702
+ * Every committed row in one list: rows this run still owns stay in input
1703
+ * order, and each row another run took over keeps its commit slot (its input
1704
+ * position in this run is not stored once the owner changes).
1705
+ */
1706
+ async function readCommittedRowsAcrossRuns(input: {
1707
+ committedRowKeys?: readonly string[];
1708
+ readCommittedTerminalRows?: (
1709
+ keys: string[],
1710
+ ) => Promise<readonly CommittedTerminalRow[] | null>;
1711
+ }): Promise<{
1712
+ rows: Record<string, unknown>[];
1713
+ takenOverRows: number;
1714
+ unfinishedKeys: number;
1715
+ } | null> {
1716
+ if (!input.committedRowKeys || !input.readCommittedTerminalRows) return null;
1717
+ const keys = [...new Set(input.committedRowKeys.filter(Boolean))];
1718
+ const byKey = new Map<string, CommittedTerminalRow>();
1719
+ for (
1720
+ let offset = 0;
1721
+ offset < keys.length;
1722
+ offset += RUNTIME_SHEET_TAKEOVER_KEY_BATCH
1723
+ ) {
1724
+ const page = keys.slice(offset, offset + RUNTIME_SHEET_TAKEOVER_KEY_BATCH);
1725
+ const rows = await input.readCommittedTerminalRows(page);
1726
+ if (rows === null) return null;
1727
+ const requested = new Set(page);
1728
+ for (const row of rows) {
1729
+ if (requested.has(row.key)) byKey.set(row.key, row);
1730
+ }
1731
+ }
1732
+ const slots = keys.flatMap((key) => {
1733
+ const row = byKey.get(key);
1734
+ return row ? [row] : [];
1735
+ });
1736
+ const ownedInInputOrder = slots
1737
+ .filter((row) => !row.ownedByOtherRun)
1738
+ .sort(
1739
+ (left, right) =>
1740
+ (left.inputIndex ?? Number.MAX_SAFE_INTEGER) -
1741
+ (right.inputIndex ?? Number.MAX_SAFE_INTEGER),
1742
+ );
1743
+ let nextOwned = 0;
1744
+ return {
1745
+ rows: slots.map((row) =>
1746
+ row.ownedByOtherRun ? row.data : ownedInInputOrder[nextOwned++]!.data,
1747
+ ),
1748
+ takenOverRows: slots.length - ownedInInputOrder.length,
1749
+ unfinishedKeys: keys.length - slots.length,
1750
+ };
1751
+ }
1752
+
1656
1753
  export function resolveToolRuntimeTimeoutMs(
1657
1754
  toolId: string,
1658
1755
  requestedTimeoutMs?: number,
@@ -12219,6 +12316,46 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
12219
12316
  currentRows: results,
12220
12317
  failedRowCount: resumedPendingRowsOnly ? 0 : visibleFailedRows.length,
12221
12318
  rowMode: finalizationRowMode,
12319
+ // When the resumed frame recorded superseded rows, restoreCompletedRows
12320
+ // already kept only keys this run still owned at that wake; the
12321
+ // others became reused inputs and left expectedRows. Takeovers after
12322
+ // that restore (or on a frame without superseded rows) remain here
12323
+ // and must be proven finished by another run.
12324
+ committedRowKeys: [
12325
+ ...previouslyCompletedRowKeys,
12326
+ ...visibleCompletedRows.map((row) => row.key),
12327
+ ],
12328
+ readCommittedTerminalRows:
12329
+ this.#options.baseUrl &&
12330
+ this.#options.executorToken &&
12331
+ this.#options.playName &&
12332
+ this.#options.runId
12333
+ ? async (keys) => {
12334
+ const result = await readRuntimeSheetDatasetRowKeys(
12335
+ {
12336
+ baseUrl: this.#options.baseUrl!,
12337
+ executorToken: this.#options.executorToken!,
12338
+ dbSessionStrategy: this.#options.dbSessionStrategy,
12339
+ playName: this.#options.playName!,
12340
+ userEmail: this.#options.userEmail,
12341
+ runId: this.#options.runId!,
12342
+ },
12343
+ {
12344
+ tableNamespace: resolvedTableNamespace,
12345
+ runId: this.#options.runId!,
12346
+ keys,
12347
+ rowMode: 'terminalRowsAnyRun',
12348
+ },
12349
+ );
12350
+ // An older runtime API answers an unknown mode as an
12351
+ // `output` read of this run's own keys; only an echoed mode
12352
+ // carries rows from every run.
12353
+ return result.rowMode === 'terminalRowsAnyRun' &&
12354
+ Array.isArray(result.rows)
12355
+ ? result.rows
12356
+ : null;
12357
+ }
12358
+ : undefined,
12222
12359
  log: (line) => this.runtimeLog(line),
12223
12360
  readPersistedRows: async (readInput) => {
12224
12361
  if (
@@ -167,6 +167,18 @@ export const DURABLE_RUNS_ROLLOUT = {
167
167
  * previous path. Off: unchanged.
168
168
  */
169
169
  rateStateCollapsedAcquire: false,
170
+ /**
171
+ * Organizations whose concurrency-bearing rate-state acquires send the scope
172
+ * lock and grant as one request (the `rateStateCollapsedAcquire` path) while
173
+ * the two switches above are off. The acquire's requester must be
174
+ * `org:<id>` for a listed id. Narrower than turning the switches on: for a
175
+ * listed org, pure-rate acquires and the in-acquire observation fold stay
176
+ * multi-trip, as do every other requester and every call without one
177
+ * (releases, penalties). Both paths take the same locks in the same order, so
178
+ * a listed org can share a provider bucket with unlisted ones. Empty: no
179
+ * change.
180
+ */
181
+ rateStateOneRequestOrgIds: [] as readonly string[],
170
182
  /**
171
183
  * While a detached runner waits for the park acknowledgement, it issues the
172
184
  * read-only startup lookups its static plan names (tool metadata and