deepline 0.3.549 → 0.3.551

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 (178) hide show
  1. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  2. package/dist/bundling-sources/sdk/src/types.ts +22 -0
  3. package/dist/bundling-sources/shared_libs/integration-contracts/tool-connection.ts +42 -0
  4. package/dist/bundling-sources/shared_libs/monitors/snitcher-ip2company.ts +31 -0
  5. package/dist/bundling-sources/shared_libs/monitors/tracking-provider-guidance.ts +1 -0
  6. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +19 -0
  7. package/dist/bundling-sources/shared_libs/play-runtime/activity-observation.ts +2 -0
  8. package/dist/bundling-sources/shared_libs/play-runtime/durable-runs-rollout.ts +2 -2
  9. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +187 -16
  10. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +70 -19
  11. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +854 -3
  12. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +15 -1
  13. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +6 -2
  14. package/dist/bundling-sources/shared_libs/plays/share/static-pipeline-summary.ts +43 -0
  15. package/dist/bundling-sources/shared_libs/product-notifications/billing-sales.ts +1 -0
  16. package/dist/bundling-sources/shared_libs/product-notifications/catalog.ts +38 -5
  17. package/dist/bundling-sources/shared_libs/product-notifications/default-policy.ts +1 -1
  18. package/dist/bundling-sources/shared_libs/product-notifications/events.ts +16 -0
  19. package/dist/cli/auth-B4PI7GVY.js +43 -0
  20. package/dist/cli/{auth-YENF525S.mjs → auth-E7BH4GMJ.mjs} +5 -5
  21. package/dist/cli/{billing-52GAHIDZ.js → billing-DNQAZGX7.js} +99 -99
  22. package/dist/cli/{billing-XPXB27G7.mjs → billing-OXKU462W.mjs} +10 -10
  23. package/dist/cli/chunk-2RIKOPIM.mjs +9 -0
  24. package/dist/cli/{chunk-L6UMWAAY.mjs → chunk-2UXDHFSF.mjs} +1 -1
  25. package/dist/cli/{chunk-XYIECA7M.js → chunk-2WFPHBR4.js} +30 -8
  26. package/dist/cli/{chunk-HWCIU3KY.js → chunk-2ZYRBMQM.js} +23 -22
  27. package/dist/cli/{chunk-NVALIJQS.js → chunk-3G6QZACZ.js} +23 -20
  28. package/dist/cli/{chunk-BPBPY42E.js → chunk-3KYBDAR3.js} +7 -7
  29. package/dist/cli/{chunk-DCTEH6N5.mjs → chunk-3T65J5RG.mjs} +2 -2
  30. package/dist/cli/{chunk-DIRLEJJX.js → chunk-44I675YK.js} +42 -41
  31. package/dist/cli/{chunk-LP2VNGG3.mjs → chunk-44KSACJW.mjs} +2 -2
  32. package/dist/cli/{chunk-X4RGDE4J.mjs → chunk-4D3WIZST.mjs} +1 -1
  33. package/dist/cli/{chunk-7FY7AHR6.js → chunk-4OMAGJ6U.js} +2 -2
  34. package/dist/cli/{chunk-TYOAOSDL.js → chunk-54EEYLTF.js} +3 -3
  35. package/dist/cli/{chunk-PLAJ6HPD.mjs → chunk-5IL7SC45.mjs} +2 -2
  36. package/dist/cli/{chunk-XS72HELO.mjs → chunk-5S6PHKRV.mjs} +2 -1
  37. package/dist/cli/{chunk-4HSSPT73.js → chunk-5VVSEU67.js} +6 -6
  38. package/dist/cli/{chunk-ANOTB6V3.mjs → chunk-6PWJKMFQ.mjs} +5 -4
  39. package/dist/cli/{chunk-MAE3AKDR.mjs → chunk-7DOQ3OEX.mjs} +17 -8
  40. package/dist/cli/{chunk-RMKRZJOS.js → chunk-7RSIFA72.js} +18 -16
  41. package/dist/cli/{chunk-4AUV5QJF.mjs → chunk-7WQNWJQW.mjs} +7 -5
  42. package/dist/cli/{chunk-6P7TGCHQ.mjs → chunk-BGBJV26E.mjs} +10 -3
  43. package/dist/cli/{chunk-UGVXHT62.mjs → chunk-BIIJATTX.mjs} +2 -2
  44. package/dist/cli/{chunk-ADWMIZCB.js → chunk-C4CUZH57.js} +20 -11
  45. package/dist/cli/{chunk-PQX4WTBY.mjs → chunk-CLRAANWH.mjs} +1 -1
  46. package/dist/cli/{chunk-XPYCNA43.js → chunk-COGREZAO.js} +48 -44
  47. package/dist/cli/{chunk-QUELC3B2.js → chunk-CQ6JYQSW.js} +10 -10
  48. package/dist/cli/{chunk-Z3DKJOUL.mjs → chunk-D6M5HFBB.mjs} +1 -1
  49. package/dist/cli/{chunk-W77LBYF3.mjs → chunk-E64HFB4L.mjs} +13 -13
  50. package/dist/cli/{chunk-BDOLPGHD.mjs → chunk-FOTGUFVK.mjs} +3 -3
  51. package/dist/cli/{chunk-4QUWXUUJ.mjs → chunk-GGB3JYCW.mjs} +3 -2
  52. package/dist/cli/{chunk-7AOFSZJM.mjs → chunk-GGGAEVCX.mjs} +23 -1
  53. package/dist/cli/{chunk-PLJCY35C.mjs → chunk-GVYLCCKN.mjs} +1 -1
  54. package/dist/cli/{chunk-UV4RU2TE.js → chunk-H4ALLC2X.js} +2 -0
  55. package/dist/cli/{chunk-V5WPYOAE.mjs → chunk-HEHVGEZV.mjs} +10 -7
  56. package/dist/cli/{chunk-AZSVDAXT.mjs → chunk-I4VKGNAQ.mjs} +9 -5
  57. package/dist/cli/{chunk-RKF263LR.js → chunk-KWSH5T7K.js} +25 -18
  58. package/dist/cli/{chunk-4DJNXAPH.js → chunk-LPJPCGT3.js} +8 -8
  59. package/dist/cli/{chunk-Y5SKYU5X.mjs → chunk-MNSTCJMX.mjs} +3 -3
  60. package/dist/cli/{chunk-Y5MDCPWA.js → chunk-MR5LTVHD.js} +53 -53
  61. package/dist/cli/{chunk-LMFTDDAM.mjs → chunk-MXGA6JFI.mjs} +2 -2
  62. package/dist/cli/{chunk-BDUZJX4V.js → chunk-NMWGZD6Y.js} +26 -26
  63. package/dist/cli/{chunk-5622PYAP.js → chunk-PACD5DGC.js} +4 -4
  64. package/dist/cli/{chunk-CX4KGWCH.mjs → chunk-PM7MO62Y.mjs} +3 -3
  65. package/dist/cli/{chunk-ETLEPHLT.js → chunk-POLUE7D5.js} +11 -11
  66. package/dist/cli/{chunk-VLAJGF27.js → chunk-PPSDCN6C.js} +3 -2
  67. package/dist/cli/{chunk-KBMBNUUW.js → chunk-QM6Y6S4E.js} +5 -5
  68. package/dist/cli/{chunk-YX7BX2FA.mjs → chunk-RE5MJBEV.mjs} +2 -2
  69. package/dist/cli/{chunk-5CXE22BI.mjs → chunk-S7IZWGUA.mjs} +2 -2
  70. package/dist/cli/{chunk-OWX4AAJ4.js → chunk-T2B5BVZE.js} +13 -13
  71. package/dist/cli/{chunk-3IUQNHIG.js → chunk-UDXULACQ.js} +3 -3
  72. package/dist/cli/{chunk-ECWOIXAV.js → chunk-UPMRIVZB.js} +14 -12
  73. package/dist/cli/{chunk-U6KHWIAO.mjs → chunk-V6SCP4B7.mjs} +1 -1
  74. package/dist/cli/{chunk-V7WMNX4R.js → chunk-VTGG2RT3.js} +1 -1
  75. package/dist/cli/{chunk-QIZBUY2N.mjs → chunk-VWLHRZFG.mjs} +4 -4
  76. package/dist/cli/{chunk-YZTS3XA7.js → chunk-W2ZWQUHT.js} +2 -2
  77. package/dist/cli/{chunk-5T37KQNG.mjs → chunk-W425ERWN.mjs} +6 -5
  78. package/dist/cli/{chunk-GWNYLIF7.mjs → chunk-WEHCBH5R.mjs} +4 -2
  79. package/dist/cli/{chunk-CXFOYRI4.js → chunk-WKBHUB6R.js} +270 -270
  80. package/dist/cli/{chunk-SVNAP2QI.js → chunk-XYE5XPGF.js} +9 -9
  81. package/dist/cli/{chunk-HPSCRVTM.js → chunk-Z2FIOG3V.js} +12 -12
  82. package/dist/cli/{chunk-KTZ3VU6S.js → chunk-ZCDKE4UH.js} +5 -5
  83. package/dist/cli/{chunk-QGKX2WBZ.js → chunk-ZDQFBJPO.js} +20 -19
  84. package/dist/cli/{chunk-J6FINSAK.mjs → chunk-ZMNGZ6XS.mjs} +1 -1
  85. package/dist/cli/command-docs.js +3 -3
  86. package/dist/cli/command-docs.mjs +2 -2
  87. package/dist/cli/{concurrent-runs-help-OYSLW55L.mjs → concurrent-runs-help-C6L6I5OR.mjs} +7 -7
  88. package/dist/cli/concurrent-runs-help-JEFQZTJI.js +21 -0
  89. package/dist/cli/{csv-FRO3UFMQ.js → csv-QMF4FWE7.js} +19 -14
  90. package/dist/cli/{csv-TFCTUYF2.mjs → csv-SYSDXFEM.mjs} +10 -5
  91. package/dist/cli/{db-NHVZBT2H.mjs → db-Q7HURWRZ.mjs} +6 -6
  92. package/dist/cli/{db-SNFNRVZJ.js → db-YSHPPA4H.js} +27 -27
  93. package/dist/cli/describe-PXTSBJTL.js +50 -0
  94. package/dist/cli/{describe-OVFPRJJL.mjs → describe-YGMQBV44.mjs} +21 -21
  95. package/dist/cli/describe-core.d.mts +4 -2
  96. package/dist/cli/describe-core.d.ts +4 -2
  97. package/dist/cli/describe-core.js +4 -4
  98. package/dist/cli/describe-core.mjs +3 -3
  99. package/dist/cli/{executions-HWMH2LTC.mjs → executions-G7U3VUXN.mjs} +6 -6
  100. package/dist/cli/{executions-RZLKKPZV.js → executions-MWBC5TAW.js} +8 -8
  101. package/dist/cli/{feedback-WD4JVF77.mjs → feedback-GMHIFLBJ.mjs} +6 -6
  102. package/dist/cli/{feedback-3D5OROCI.js → feedback-SD55OY6H.js} +14 -14
  103. package/dist/cli/{git-RYUKBCUZ.mjs → git-HPE45OPD.mjs} +5 -5
  104. package/dist/cli/git-I3JV7IGH.js +25 -0
  105. package/dist/cli/index.js +147 -147
  106. package/dist/cli/index.mjs +46 -46
  107. package/dist/cli/{integrations-KJPFCEXL.mjs → integrations-2W4MGIQR.mjs} +7 -7
  108. package/dist/cli/{integrations-Y7OK23DW.js → integrations-HFKVBY6G.js} +15 -15
  109. package/dist/cli/{legacy-noops-2PU2ZVEP.mjs → legacy-noops-GZYKNU2Z.mjs} +6 -6
  110. package/dist/cli/{legacy-noops-G7ZY7K3K.js → legacy-noops-SXVNDEXN.js} +9 -9
  111. package/dist/cli/{mcp-D7F2RSOI.mjs → mcp-BWA6KULG.mjs} +4 -4
  112. package/dist/cli/{mcp-GILBYX72.js → mcp-PJRHQHHU.js} +24 -24
  113. package/dist/cli/{monitors-OXNHOT3C.js → monitors-K2WSI6CR.js} +100 -100
  114. package/dist/cli/{monitors-IK5KXY2H.mjs → monitors-SYQKCATO.mjs} +7 -7
  115. package/dist/cli/{org-L5D7EISU.mjs → org-5KD7X7IA.mjs} +6 -6
  116. package/dist/cli/{org-OYM3UNTP.js → org-YQ2CR32B.js} +88 -88
  117. package/dist/cli/{play-YK22QPYO.js → play-SZXY2F2S.js} +352 -341
  118. package/dist/cli/{play-PK6QO3WX.mjs → play-TTMABJEI.mjs} +40 -29
  119. package/dist/cli/{providers-Z6MNJDCG.mjs → providers-GQIOMRQO.mjs} +6 -6
  120. package/dist/cli/{providers-5CYP7P4N.js → providers-YDHCTZAF.js} +9 -9
  121. package/dist/cli/{quickstart-2YKETYJY.js → quickstart-BNYOXQXG.js} +6 -6
  122. package/dist/cli/{quickstart-2I73XQXB.mjs → quickstart-PHSSMKCA.mjs} +4 -4
  123. package/dist/cli/{run-KGQ6TUBB.mjs → run-74C3C75C.mjs} +26 -26
  124. package/dist/cli/{run-YVSEAVE5.js → run-GFIAZXVL.js} +47 -47
  125. package/dist/cli/search-2RRRF4LW.js +32 -0
  126. package/dist/cli/{search-V2HPN6FU.mjs → search-3SWUB7KX.mjs} +7 -7
  127. package/dist/cli/{search-output-BUSANFRN.js → search-output-6JF3S4TP.js} +43 -13
  128. package/dist/cli/{search-output-OCTOSDEO.mjs → search-output-K2SWHVHQ.mjs} +40 -10
  129. package/dist/cli/{secrets-WZGRBWI5.mjs → secrets-2M4XWEKE.mjs} +6 -6
  130. package/dist/cli/{secrets-VDKTHCVB.js → secrets-2SAKLH2H.js} +15 -15
  131. package/dist/cli/{sessions-5DTN55DZ.mjs → sessions-A64BCXTO.mjs} +6 -6
  132. package/dist/cli/sessions-SBH27JNW.js +22 -0
  133. package/dist/cli/{settings-A7VSNOLI.js → settings-HV64WIJF.js} +85 -85
  134. package/dist/cli/{settings-BK5FPQ3X.mjs → settings-SVGEC3FI.mjs} +12 -12
  135. package/dist/cli/{setup-LLQVPZTP.mjs → setup-EDC3NEJ3.mjs} +15 -10
  136. package/dist/cli/{setup-NV27CYQ5.js → setup-FHXOLQGQ.js} +55 -50
  137. package/dist/cli/{skills-IV6HK4XA.mjs → skills-3HGHZMXB.mjs} +7 -7
  138. package/dist/cli/skills-Y3SRLOYD.js +36 -0
  139. package/dist/cli/tools-OFYPUPUV.js +57 -0
  140. package/dist/cli/{tools-4FKPCRD7.mjs → tools-P2QS6A6Q.mjs} +19 -19
  141. package/dist/cli/{update-MH5M746E.mjs → update-552BYQM4.mjs} +9 -9
  142. package/dist/cli/update-SOUSCLB7.js +34 -0
  143. package/dist/cli/{views-KXC4JDT7.mjs → views-LD5HXJYY.mjs} +6 -6
  144. package/dist/cli/{views-JW44TCGL.js → views-PA25NAE3.js} +21 -21
  145. package/dist/cli/{workflow-F5AHL2ET.js → workflow-FIDBUQV6.js} +17 -17
  146. package/dist/cli/{workflow-FI4DL7ZI.mjs → workflow-LDYFGBYP.mjs} +7 -7
  147. package/dist/{client-BEJqhQAj.d.mts → client-DuDFiJDU.d.mts} +1 -1
  148. package/dist/{client-core-BPYuWfBC.d.ts → client-core-CJRzLanv.d.ts} +93 -4
  149. package/dist/{client-core-BqetRxx-.d.mts → client-core-DydMQOft.d.mts} +93 -4
  150. package/dist/{client-Ceo295L2.d.ts → client-t9HZAkFD.d.ts} +1 -1
  151. package/dist/index.d.mts +3 -3
  152. package/dist/index.d.ts +3 -3
  153. package/dist/index.js +9 -9
  154. package/dist/index.mjs +6 -6
  155. package/dist/install-integrity.json +124 -124
  156. package/dist/plays/play-description.d.mts +1 -1
  157. package/dist/plays/play-description.d.ts +1 -1
  158. package/dist/plays/run-request.d.mts +1 -1
  159. package/dist/plays/run-request.d.ts +1 -1
  160. package/dist/release.d.mts +1 -1
  161. package/dist/release.d.ts +1 -1
  162. package/dist/release.js +2 -2
  163. package/dist/release.mjs +1 -1
  164. package/dist/server.d.mts +2 -2
  165. package/dist/server.d.ts +2 -2
  166. package/dist/server.js +5 -5
  167. package/dist/server.mjs +3 -3
  168. package/package.json +1 -1
  169. package/dist/cli/auth-UVEZIP3H.js +0 -43
  170. package/dist/cli/chunk-NIPLY25A.mjs +0 -7
  171. package/dist/cli/concurrent-runs-help-74AFW3BD.js +0 -21
  172. package/dist/cli/describe-2JCOC4AK.js +0 -50
  173. package/dist/cli/git-GCCPCUWJ.js +0 -25
  174. package/dist/cli/search-YG3UIZ6A.js +0 -32
  175. package/dist/cli/sessions-NSPT6LHT.js +0 -22
  176. package/dist/cli/skills-UA5E4DA3.js +0 -36
  177. package/dist/cli/tools-NJVPAG37.js +0 -57
  178. package/dist/cli/update-DKX27XZB.js +0 -34
@@ -205,7 +205,7 @@ export const SDK_RELEASE = {
205
205
  // getters keep their established compatibility behavior.
206
206
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
207
207
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
208
- version: '0.3.549',
208
+ version: '0.3.551',
209
209
  updateSummary: {
210
210
  introducedIn: '0.3.90',
211
211
  summary:
@@ -1,3 +1,7 @@
1
+ import type {
2
+ ToolDiscoveryAuth,
3
+ ToolDiscoveryUsage,
4
+ } from '../../shared_libs/integration-contracts/tool-connection';
1
5
  import type {
2
6
  TerminalRuntimePerformance,
3
7
  TerminalRuntimePerformanceUnavailableReason,
@@ -252,6 +256,9 @@ export interface ToolCategoryListing {
252
256
  * schema, examples, pricing, extraction guidance, and execution metadata.
253
257
  */
254
258
  export interface ToolDefinition extends ToolExecutionMetadataFields {
259
+ auth?: ToolDiscoveryAuth;
260
+ toolUsage?: ToolDiscoveryUsage;
261
+ describeCommand?: string;
255
262
  /** Unique tool identifier used in API calls (e.g. `"dropleads_search_people"`). */
256
263
  toolId: string;
257
264
  /** Provider that backs this tool (e.g. `"hunter"`, `"dropleads"`, `"test"`). */
@@ -587,6 +594,9 @@ export interface SearchOptions extends ToolSearchOptions {
587
594
 
588
595
  /** One ranked search result; `kind` says which fields accompany it. */
589
596
  export interface SearchResultItem {
597
+ auth?: ToolDiscoveryAuth;
598
+ toolUsage?: ToolDiscoveryUsage;
599
+ describeCommand?: string;
590
600
  /** Tool id for tools and monitor types, play reference, or `docs/<path>`. */
591
601
  id: string;
592
602
  kind:
@@ -645,6 +655,18 @@ export interface ToolSearchResult {
645
655
  search_terms?: string[];
646
656
  /** Search mode used. */
647
657
  search_mode?: 'v1' | 'v2';
658
+ /** Scoped result for an exact tool ID, independent of ranked alternatives. */
659
+ exactLookup?: {
660
+ id: string;
661
+ status:
662
+ | 'found'
663
+ | 'catalog_miss'
664
+ | 'outside_search_scope'
665
+ | 'unavailable_in_workspace'
666
+ | 'lookup_unavailable';
667
+ toolId?: string;
668
+ message?: string;
669
+ };
648
670
  /** Whether search fell back to category matching. */
649
671
  search_fallback_to_category?: boolean;
650
672
  /** Query-writing advice when phrasing is unclear, matches are weak, or the search is empty. */
@@ -11,3 +11,45 @@ export function isToolConnectionName(value: unknown): value is string {
11
11
  GOOGLE_WORKSPACE_DOMAIN_PATTERN.test(value))
12
12
  );
13
13
  }
14
+
15
+ export type ToolAuthMode = {
16
+ kind:
17
+ | 'managed'
18
+ | 'oauth'
19
+ | 'personal_oauth'
20
+ | 'user_credentials'
21
+ | 'workspace_oauth'
22
+ | 'workspace_credentials'
23
+ | 'workspace_delegation';
24
+ status:
25
+ | 'available'
26
+ | 'requires_connection'
27
+ | 'requires_permission'
28
+ | 'unavailable'
29
+ | 'unknown';
30
+ setupPath?: string;
31
+ requiredScopes?: string[];
32
+ /** Names and scopes the authenticated caller has permission to use. */
33
+ connections?: Array<{ name: string; verifiedScopes?: string[] }>;
34
+ };
35
+
36
+ export type ToolDiscoveryAuth = {
37
+ modes: ToolAuthMode[];
38
+ connectionRequired?: true;
39
+ };
40
+
41
+ export type ToolDiscoveryUsage = {
42
+ effect?: 'read' | 'write' | 'destructive';
43
+ requiredInputs: Array<{ name: string; meaning?: string }>;
44
+ /** Provider-authored example. Replace the sample inputs before executing. */
45
+ example?: {
46
+ cli: string;
47
+ mcp: {
48
+ tool_id: string;
49
+ input: Record<string, unknown>;
50
+ connection?: string;
51
+ confirm_mutation?: true;
52
+ };
53
+ play: string;
54
+ };
55
+ };
@@ -61,6 +61,24 @@ function readRecord(value: unknown): Record<string, unknown> | null {
61
61
  : null;
62
62
  }
63
63
 
64
+ /**
65
+ * The documented 404 bodies: `{ "error": "not found" }`, or a record for the
66
+ * looked-up IP with a network `type` and no company. Any other 404 body, such
67
+ * as a structured route error, is not an answer about this IP.
68
+ */
69
+ function isSnitcherNoCompanyBody(
70
+ record: Record<string, unknown> | null,
71
+ ip: string,
72
+ ) {
73
+ if (!record) return false;
74
+ if (record.error === 'not found') return true;
75
+ return (
76
+ record.ip === ip &&
77
+ typeof record.type === 'string' &&
78
+ readRecord(record.company) === null
79
+ );
80
+ }
81
+
64
82
  function readString(value: unknown) {
65
83
  return typeof value === 'string' && value.trim() ? value.trim() : null;
66
84
  }
@@ -241,6 +259,19 @@ export async function findSnitcherIp2Company(
241
259
  if (response.status === 403)
242
260
  return { status: 'quota_exceeded', ip: candidate };
243
261
  if (response.status === 429) return { status: 'rate_limited', ip: candidate };
262
+ // Snitcher answers 404 when the IP has no company: an ISP or residential
263
+ // network (`type: "isp"`, `domain: null`) or `{ "error": "not found" }`.
264
+ // That is a definitive answer, so it is cached and never retried. A 404
265
+ // without that JSON body (a gateway or moved path) stays a retryable failure.
266
+ if (response.status === 404 && isSnitcherNoCompanyBody(record, candidate)) {
267
+ return {
268
+ status: 'no_company',
269
+ ip: candidate,
270
+ networkType: readString(record?.type),
271
+ company: null,
272
+ geoIp: readRecord(record?.geoIP),
273
+ };
274
+ }
244
275
  if (!response.ok) {
245
276
  return {
246
277
  status: 'failed',
@@ -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,24 @@
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
1974
1993
  }
1975
1994
  ]
@@ -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 = {
@@ -150,7 +150,7 @@ export const DURABLE_RUNS_ROLLOUT = {
150
150
  * not a scalar, or a placeholder reused without an explicit cast, keeps the
151
151
  * multi-trip path. Off: unchanged.
152
152
  */
153
- rateStateSingleTripTransactions: false,
153
+ rateStateSingleTripTransactions: true,
154
154
  /**
155
155
  * Collapse a warm rate-state acquire to as few requests as its transactions
156
156
  * allow (needs `rateStateSingleTripTransactions`). The concurrency grant
@@ -166,7 +166,7 @@ export const DURABLE_RUNS_ROLLOUT = {
166
166
  * row locks and errors; any statement that cannot be rendered keeps the
167
167
  * previous path. Off: unchanged.
168
168
  */
169
- rateStateCollapsedAcquire: false,
169
+ rateStateCollapsedAcquire: true,
170
170
  /**
171
171
  * While a detached runner waits for the park acknowledgement, it issues the
172
172
  * read-only startup lookups its static plan names (tool metadata and
@@ -186,6 +186,9 @@ import {
186
186
  completePostgresSchedulerComputeBillingSessionBootstrap,
187
187
  claimPostgresSchedulerWaitingDetachedAttemptForTerminal,
188
188
  deferPostgresSchedulerAttemptForCapacity,
189
+ gatePostgresSchedulerSandboxCapacity,
190
+ sandboxCapacityWaitFallbackSeconds,
191
+ sandboxCapacityWakeEventName,
189
192
  deferPostgresSchedulerAttemptForExecutorTokenOutage,
190
193
  detachedRunnerCeilingDeadlineMsFromSuspension,
191
194
  enqueuePostgresSchedulerSandboxCleanupForAttempt,
@@ -367,7 +370,10 @@ import {
367
370
  import { DIRECT_COMPLETED_TERMINAL_CONTRACT } from './terminal-contract';
368
371
  import { runnerReadiness } from './runner-push';
369
372
  import { runtimeApiBaseUrlFromLaunch } from './runtime-api-origin';
370
- import { shouldTerminalizeSandboxCapacityRejection } from '../launch-source-policy';
373
+ import {
374
+ resolvePlayLaunchQueuePolicy,
375
+ shouldTerminalizeSandboxCapacityRejection,
376
+ } from '../launch-source-policy';
371
377
  import {
372
378
  ABSURD_CANCELLED_DEADLINE_RECONCILE_LIMIT,
373
379
  reconcileAbsurdRuntimeCancellations,
@@ -377,6 +383,7 @@ import {
377
383
  abandonRuntimeSandboxOperationReservation,
378
384
  bindRuntimeSandboxCapacityLease,
379
385
  createRuntimeSandboxOperationReservation,
386
+ DEFAULT_PLAY_SANDBOX_CONCURRENCY,
380
387
  precheckRuntimeSandboxCapacity,
381
388
  readReservedDaytonaCancellationOperation,
382
389
  recordDaytonaSandboxCleanupIntent,
@@ -778,6 +785,15 @@ function isTransientHeartbeatTimeout(error: unknown): boolean {
778
785
  );
779
786
  }
780
787
 
788
+ function runIdSpreadSeconds(runId: string, spreadSeconds: number): number {
789
+ let hash = 2166136261;
790
+ for (let index = 0; index < runId.length; index += 1) {
791
+ hash ^= runId.charCodeAt(index);
792
+ hash = Math.imul(hash, 16777619);
793
+ }
794
+ return Math.abs(hash) % Math.max(1, Math.floor(spreadSeconds));
795
+ }
796
+
781
797
  /**
782
798
  * A workspace sandbox-capacity refusal, whether it arrives as the typed class,
783
799
  * by name across the provider-backend boundary, or as a generic scheduler
@@ -825,12 +841,7 @@ export function capacityDeferralSeconds(
825
841
  Math.ceil(runtimeSchedulerCapacityRetryAfterMs(error) / 1_000),
826
842
  );
827
843
  // Keep a saturated fleet from waking every parked run in the same second.
828
- let hash = 2166136261;
829
- for (let index = 0; index < runId.length; index += 1) {
830
- hash ^= runId.charCodeAt(index);
831
- hash = Math.imul(hash, 16777619);
832
- }
833
- return baseSeconds + (Math.abs(hash) % 3);
844
+ return baseSeconds + runIdSpreadSeconds(runId, 3);
834
845
  }
835
846
 
836
847
  export async function runWithAbsurdExecutionLeaseHeartbeat<T>(input: {
@@ -3388,6 +3399,8 @@ async function prepareAbsurdAttempt(input: {
3388
3399
  options: Pick<PostgresSchedulerOptions, 'schema'>;
3389
3400
  runId: string;
3390
3401
  queueName: string;
3402
+ /** This task's wait on that sandbox-capacity `seq` timed out. */
3403
+ retireSandboxCapacityWaitSeq?: number;
3391
3404
  }) {
3392
3405
  return input.deps.runWithClient(
3393
3406
  async (client) => {
@@ -3581,6 +3594,77 @@ async function prepareAbsurdAttempt(input: {
3581
3594
  );
3582
3595
  }
3583
3596
 
3597
+ if (shouldGateSandboxCapacityBeforeClaim(launch, laneState.status)) {
3598
+ // Like the projection gate above, this runs before an attempt exists:
3599
+ // a full org parks the task on a wake event instead of allocating an
3600
+ // attempt that the in-attempt reservation would refuse.
3601
+ let gate: Awaited<
3602
+ ReturnType<typeof gatePostgresSchedulerSandboxCapacity>
3603
+ > | null = null;
3604
+ try {
3605
+ gate = await gatePostgresSchedulerSandboxCapacity(
3606
+ client,
3607
+ {
3608
+ runId: input.runId,
3609
+ orgId: launch.orgId,
3610
+ entitlementLimit: launch.concurrentRunsLimit ?? null,
3611
+ defaultLimit: DEFAULT_PLAY_SANDBOX_CONCURRENCY,
3612
+ queueName: input.queueName,
3613
+ nowMs: Date.now(),
3614
+ ...(input.retireSandboxCapacityWaitSeq !== undefined
3615
+ ? { retireSeq: input.retireSandboxCapacityWaitSeq }
3616
+ : {}),
3617
+ },
3618
+ input.options,
3619
+ );
3620
+ } catch (error) {
3621
+ if (isRetryableAttemptPreparationError(error)) throw error;
3622
+ // The gate is advisory. A defect in it must not spend engine
3623
+ // attempts or settle the run; the in-attempt reservation still
3624
+ // enforces the cap.
3625
+ console.error('[runtime.scheduler.sandbox_capacity_gate_failed]', {
3626
+ runId: input.runId,
3627
+ orgId: launch.orgId,
3628
+ error: error instanceof Error ? error.message : String(error),
3629
+ });
3630
+ }
3631
+ if (gate?.kind === 'waiting') {
3632
+ // A burst that started waiting together re-checks spread out.
3633
+ const fallbackSeconds = sandboxCapacityWaitFallbackSeconds(
3634
+ Date.now() - gate.sinceMs,
3635
+ );
3636
+ const delaySeconds =
3637
+ fallbackSeconds +
3638
+ runIdSpreadSeconds(input.runId, fallbackSeconds / 10);
3639
+ console.info('[runtime.scheduler.sandbox_capacity_wait]', {
3640
+ runId: input.runId,
3641
+ orgId: launch.orgId,
3642
+ limit: gate.limit,
3643
+ activeLeases: gate.activeLeases,
3644
+ ahead: gate.ahead,
3645
+ seq: gate.seq,
3646
+ waitedMs: Date.now() - gate.sinceMs,
3647
+ fallbackSeconds: delaySeconds,
3648
+ attemptAllocated: false,
3649
+ });
3650
+ return {
3651
+ kind: 'sandbox_capacity_wait' as const,
3652
+ launch,
3653
+ seq: gate.seq,
3654
+ delaySeconds,
3655
+ };
3656
+ }
3657
+ if (gate?.kind === 'admitted' && gate.waitedMs !== null) {
3658
+ console.info('[runtime.scheduler.sandbox_capacity_admitted]', {
3659
+ runId: input.runId,
3660
+ orgId: launch.orgId,
3661
+ limit: gate.limit,
3662
+ activeLeases: gate.activeLeases,
3663
+ waitedMs: gate.waitedMs,
3664
+ });
3665
+ }
3666
+ }
3667
+
3584
3668
  const generation = preparation.nextAttempt;
3585
3669
  const leaseToken = randomUUID();
3586
3670
  const initialRuntimeResource = isManagedSandboxRuntimeBackend(
@@ -3618,6 +3702,29 @@ async function prepareAbsurdAttempt(input: {
3618
3702
  );
3619
3703
  }
3620
3704
 
3705
+ /**
3706
+ * Whether a fresh attempt for this run should first pass the pre-claim
3707
+ * sandbox-capacity gate. Only a queued run on a managed sandbox backend under
3708
+ * enforced capacity takes it. A trigger with a finite capacity wait keeps the
3709
+ * in-attempt rejection that terminalizes it.
3710
+ */
3711
+ export function shouldGateSandboxCapacityBeforeClaim(
3712
+ launch: Pick<
3713
+ PlaySchedulerSubmitInput,
3714
+ 'orgId' | 'runtimeBackend' | 'triggerSource'
3715
+ >,
3716
+ runStatus: string | null | undefined,
3717
+ ): boolean {
3718
+ return (
3719
+ runStatus === 'queued' &&
3720
+ Boolean(launch.orgId?.trim()) &&
3721
+ isManagedSandboxRuntimeBackend(launch.runtimeBackend) &&
3722
+ runtimeSandboxCapacityAdmissionMode() === 'enforce' &&
3723
+ resolvePlayLaunchQueuePolicy(launch.triggerSource)
3724
+ .sandboxCapacityMaxWaitSeconds === null
3725
+ );
3726
+ }
3727
+
3621
3728
  function isRetryableAttemptPreparationError(error: unknown): boolean {
3622
3729
  return (
3623
3730
  isConnectionCategoryError(error) ||
@@ -3641,6 +3748,7 @@ async function prepareAbsurdAttemptForTask(input: {
3641
3748
  options: Pick<PostgresSchedulerOptions, 'schema'>;
3642
3749
  runId: string;
3643
3750
  queueName: string;
3751
+ retireSandboxCapacityWaitSeq?: number;
3644
3752
  }) {
3645
3753
  try {
3646
3754
  return await prepareAbsurdAttempt(input);
@@ -3767,6 +3875,62 @@ async function executeAbsurdAttemptAdapter(
3767
3875
  throw error;
3768
3876
  }
3769
3877
  }
3878
+ // The org's sandbox slots are full. No attempt exists and none is
3879
+ // allocated: park on this wait's own event, which a lease release (or an
3880
+ // admitted waiter seeing spare slots) emits, with a long fallback timer.
3881
+ const awaitedSandboxCapacityWaits = new Set<number>();
3882
+ while (prepared.kind === 'sandbox_capacity_wait') {
3883
+ const { seq, delaySeconds } = prepared;
3884
+ if (seq === null || awaitedSandboxCapacityWaits.has(seq)) {
3885
+ // A raced wait start, or a wake that did not advance the wait. Neither
3886
+ // can suspend on a fresh event, so retry through the engine's timer.
3887
+ throw new DeferTask(
3888
+ `Run ${runId} is waiting for a sandbox slot in its workspace.`,
3889
+ seq === null ? 5 : delaySeconds,
3890
+ );
3891
+ }
3892
+ awaitedSandboxCapacityWaits.add(seq);
3893
+ let retireSandboxCapacityWaitSeq: number | undefined;
3894
+ try {
3895
+ await ctx.awaitEvent(sandboxCapacityWakeEventName(runId, seq), {
3896
+ stepName: `sandbox-capacity-wait:${seq}`,
3897
+ timeout: delaySeconds,
3898
+ });
3899
+ } catch (error) {
3900
+ // Absurd's own timeout first: the retryable check below also matches
3901
+ // any error named TimeoutError.
3902
+ if (error instanceof TimeoutError) {
3903
+ retireSandboxCapacityWaitSeq = seq;
3904
+ } else if (isRetryableAttemptPreparationError(error)) {
3905
+ // No attempt exists yet: a database blip must not spend an engine
3906
+ // attempt (the last one settles the run).
3907
+ throw new DeferTask(
3908
+ `Run ${runId} sandbox-capacity wait deferred: ${error instanceof Error ? error.message : String(error)}`,
3909
+ 30,
3910
+ );
3911
+ } else {
3912
+ throw error;
3913
+ }
3914
+ }
3915
+ prepared = await prepareAbsurdAttemptForTask({
3916
+ ctx,
3917
+ deps,
3918
+ options,
3919
+ runId,
3920
+ queueName,
3921
+ ...(retireSandboxCapacityWaitSeq !== undefined
3922
+ ? { retireSandboxCapacityWaitSeq }
3923
+ : {}),
3924
+ });
3925
+ }
3926
+ if (prepared.kind === 'created_projection_pending') {
3927
+ // Preparation checks the projection before capacity, so this is a
3928
+ // projection lost after it was delivered; retry through the engine.
3929
+ throw new DeferTask(
3930
+ `Run ${runId} lost its run-created projection while waiting for a sandbox slot.`,
3931
+ prepared.delaySeconds,
3932
+ );
3933
+ }
3770
3934
  if (prepared.kind === 'missing') {
3771
3935
  throw new Error(
3772
3936
  `absurd runtime worker: no launch row for run ${runId} (schema=${
@@ -3872,10 +4036,7 @@ async function executeAbsurdAttemptAdapter(
3872
4036
  // only spares a doomed attempt that work, and throws the same capacity
3873
4037
  // error, so deferral and terminalization are unchanged. A failed read
3874
4038
  // falls through to the ordinary path.
3875
- if (
3876
- isManagedSandboxRuntimeBackend(launch.runtimeBackend) &&
3877
- launch.orgId
3878
- ) {
4039
+ if (isManagedSandboxRuntimeBackend(launch.runtimeBackend) && launch.orgId) {
3879
4040
  const capacityMode = runtimeSandboxCapacityAdmissionMode();
3880
4041
  let precheck: Awaited<
3881
4042
  ReturnType<typeof precheckRuntimeSandboxCapacity>
@@ -3897,11 +4058,14 @@ async function executeAbsurdAttemptAdapter(
3897
4058
  { runId, phase: 'sandbox_capacity_precheck' },
3898
4059
  );
3899
4060
  } catch (error) {
3900
- console.warn('[absurd-runtime.worker] sandbox_capacity_precheck_failed', {
3901
- runId,
3902
- attempt: generation,
3903
- error: error instanceof Error ? error.message : String(error),
3904
- });
4061
+ console.warn(
4062
+ '[absurd-runtime.worker] sandbox_capacity_precheck_failed',
4063
+ {
4064
+ runId,
4065
+ attempt: generation,
4066
+ error: error instanceof Error ? error.message : String(error),
4067
+ },
4068
+ );
3905
4069
  }
3906
4070
  }
3907
4071
  if (precheck?.full) {
@@ -4203,6 +4367,13 @@ async function executeAbsurdAttemptAdapter(
4203
4367
  sandboxCapacity: {
4204
4368
  limit: error.limit,
4205
4369
  nowMs: Date.now(),
4370
+ // The next execution parks at the pre-claim gate.
4371
+ ...(shouldGateSandboxCapacityBeforeClaim(
4372
+ executionLaunch,
4373
+ 'queued',
4374
+ )
4375
+ ? { waitQueueName: queueName }
4376
+ : {}),
4206
4377
  },
4207
4378
  }
4208
4379
  : {}),
@@ -2014,6 +2014,7 @@ async function collapsedGrantWithConcurrency(
2014
2014
  const opening = `BEGIN ISOLATION LEVEL READ COMMITTED;\n${RATE_STATE_BOUNDS_SQL}\n${lock};`;
2015
2015
  let open = false;
2016
2016
  let committed = false;
2017
+ const committedLeaseIds: string[] = [];
2017
2018
  const grantClient: PostgresSchedulerQueryClient = {
2018
2019
  query: async <Row extends Record<string, unknown>>(
2019
2020
  sql: string,
@@ -2030,13 +2031,23 @@ async function collapsedGrantWithConcurrency(
2030
2031
  return await client.query<Row>(sql, parameters);
2031
2032
  }
2032
2033
  open = true;
2033
- const result = await client.query<Row>(`${opening}\n${grant};\nCOMMIT;`);
2034
+ const result = oneRequestRows<Row>(
2035
+ await client.query<Row>(`${opening}\n${grant};\nCOMMIT;`),
2036
+ );
2034
2037
  committed = true;
2035
- return {
2036
- rows: result.rows.filter(
2037
- (row) => !Object.hasOwn(row, RATE_STATE_SCOPE_LOCK_MARKER),
2038
- ),
2039
- };
2038
+ const rows = result.rows.filter(
2039
+ (row) => !Object.hasOwn(row, RATE_STATE_SCOPE_LOCK_MARKER),
2040
+ );
2041
+ for (const row of rows) {
2042
+ const leaseIds = (row as { lease_ids?: unknown }).lease_ids;
2043
+ if (!Array.isArray(leaseIds)) continue;
2044
+ for (const leaseId of leaseIds) {
2045
+ if (typeof leaseId === 'string' && leaseId.length > 0) {
2046
+ committedLeaseIds.push(leaseId);
2047
+ }
2048
+ }
2049
+ }
2050
+ return { rows };
2040
2051
  },
2041
2052
  } as PostgresSchedulerQueryClient;
2042
2053
  try {
@@ -2052,10 +2063,32 @@ async function collapsedGrantWithConcurrency(
2052
2063
  return outcome;
2053
2064
  } catch (error) {
2054
2065
  // Same as the multi-trip path. After a committed request this only fails
2055
- // a post-statement invariant check (lease drift, grant shape) and the
2056
- // ROLLBACK is a no-op: unlike the multi-trip path, that grant has already
2057
- // committed and its leases expire by their TTL.
2058
- if (open) {
2066
+ // a post-statement invariant check (lease drift, grant shape): that grant
2067
+ // has already committed, so give its leases back instead of letting them
2068
+ // hold concurrency slots until their TTL, then fail as before.
2069
+ if (committed) {
2070
+ if (committedLeaseIds.length > 0) {
2071
+ try {
2072
+ await client.query(
2073
+ `DELETE FROM ${concurrencyLeaseTableName(input)}
2074
+ WHERE bucket_id = $1 AND lease_id = ANY($2::text[])`,
2075
+ [input.bucketId, committedLeaseIds],
2076
+ );
2077
+ } catch (releaseError) {
2078
+ console.error(
2079
+ '[rate-state] committed_grant_lease_release_failed',
2080
+ {
2081
+ bucketId: input.bucketId,
2082
+ leases: committedLeaseIds.length,
2083
+ error:
2084
+ releaseError instanceof Error
2085
+ ? releaseError.message
2086
+ : String(releaseError),
2087
+ },
2088
+ );
2089
+ }
2090
+ }
2091
+ } else if (open) {
2059
2092
  try {
2060
2093
  await client.query('ROLLBACK');
2061
2094
  } catch {
@@ -2082,9 +2115,18 @@ async function boundRateStateTransaction(
2082
2115
  );
2083
2116
  }
2084
2117
 
2085
- /** The same transaction-local bounds as {@link boundRateStateTransaction}. */
2118
+ /**
2119
+ * The same transaction-local bounds as {@link boundRateStateTransaction}, plus
2120
+ * a closed-socket check. A one-request transaction is already on the server
2121
+ * when it starts waiting for the scope lock, so a caller that aborts or drops
2122
+ * its connection would otherwise have its grant and COMMIT run anyway and
2123
+ * leave leases nobody holds. Checking the socket makes PostgreSQL abort the
2124
+ * transaction instead, as the multi-trip path does when it reads end-of-file.
2125
+ */
2126
+ const RATE_STATE_CLIENT_CONNECTION_CHECK_INTERVAL_MS = 100;
2086
2127
  const RATE_STATE_BOUNDS_SQL = `SET LOCAL lock_timeout = ${escapeLiteral(`${RATE_STATE_LOCK_TIMEOUT_MS}ms`)};
2087
- SET LOCAL statement_timeout = ${escapeLiteral(`${RATE_STATE_STATEMENT_TIMEOUT_MS}ms`)};`;
2128
+ SET LOCAL statement_timeout = ${escapeLiteral(`${RATE_STATE_STATEMENT_TIMEOUT_MS}ms`)};
2129
+ SET LOCAL client_connection_check_interval = ${escapeLiteral(`${RATE_STATE_CLIENT_CONNECTION_CHECK_INTERVAL_MS}ms`)};`;
2088
2130
 
2089
2131
  /**
2090
2132
  * The one request a bounded single-statement transaction becomes. If any
@@ -2227,14 +2269,21 @@ function rateStateSingleTripEnabled(): boolean {
2227
2269
  return enabled;
2228
2270
  }
2229
2271
 
2230
- /** Rows of the one statement in a single-trip request (BEGIN/SET/COMMIT return none). */
2231
- function singleTripRows<Row extends Record<string, unknown>>(
2272
+ /**
2273
+ * The rows of a one-request transaction. The scheduler pool flattens a
2274
+ * multi-statement result; a bare node-postgres client returns one result per
2275
+ * statement. BEGIN, SET LOCAL and COMMIT return no rows, so flattening yields
2276
+ * exactly the rows of the request's real statements whichever client ran it,
2277
+ * without depending on how many bound statements precede them.
2278
+ */
2279
+ function oneRequestRows<Row extends Record<string, unknown>>(
2232
2280
  result: unknown,
2233
- statementIndex: number,
2234
2281
  ): { rows: Row[] } {
2235
2282
  if (Array.isArray(result)) {
2236
2283
  return {
2237
- rows: ((result[statementIndex] as { rows?: Row[] })?.rows ?? []) as Row[],
2284
+ rows: result.flatMap(
2285
+ (entry) => ((entry as { rows?: Row[] } | null)?.rows ?? []) as Row[],
2286
+ ),
2238
2287
  };
2239
2288
  }
2240
2289
  return { rows: ((result as { rows?: Row[] }).rows ?? []) as Row[] };
@@ -2256,7 +2305,7 @@ async function queryBoundedRateState<
2256
2305
  // One request, still four commands in one transaction: BEGIN, the same
2257
2306
  // transaction-local bounds, the statement (its own snapshot), COMMIT.
2258
2307
  const result = await client.query(rateStateSingleTripRequest(singleTrip));
2259
- return singleTripRows<Row>(result, 3) as Awaited<
2308
+ return oneRequestRows<Row>(result) as Awaited<
2260
2309
  ReturnType<typeof client.query<Row>>
2261
2310
  >;
2262
2311
  } catch (error) {
@@ -3830,12 +3879,14 @@ async function collapsedApplyConcurrencyObservations(
3830
3879
  };
3831
3880
  let committed = false;
3832
3881
  try {
3833
- const result = await client.query<{
3882
+ const result = oneRequestRows<{
3834
3883
  accepted_rows: number;
3835
3884
  counted_rows: number;
3836
3885
  rule_rows: ConcurrencyCheckpointRow[] | string | null;
3837
3886
  }>(
3838
- `BEGIN;\n${RATE_STATE_BOUNDS_SQL}\n${fold};${checkpoint ? '' : '\nCOMMIT;'}`,
3887
+ await client.query(
3888
+ `BEGIN;\n${RATE_STATE_BOUNDS_SQL}\n${fold};${checkpoint ? '' : '\nCOMMIT;'}`,
3889
+ ),
3839
3890
  );
3840
3891
  committed = !checkpoint;
3841
3892
  const row = result.rows[0];