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
@@ -2970,7 +2970,21 @@ export async function attachRuntimeEventSearchTriggers(
2970
2970
  'provider', CASE WHEN item->'observation'->'target'->>'kind' = 'provider'
2971
2971
  THEN left(item->'observation'->'target'->>'provider', 64) END,
2972
2972
  'operation', CASE WHEN item->'observation'->'target'->>'kind' = 'provider'
2973
- THEN left(item->'observation'->'target'->>'operation', 256) END
2973
+ THEN left(item->'observation'->'target'->>'operation', 256) END,
2974
+ 'context', CASE WHEN kind = ${RUN_EVENT_KIND_SQL_LITERAL.activityObserved}
2975
+ AND item->'observation'->>'activityId' = 'run:sandbox-capacity'
2976
+ AND item->'observation'->'target'->>'kind' = 'capacity'
2977
+ AND item->'observation'->'target'->>'pool' = 'runner'
2978
+ THEN jsonb_strip_nulls(jsonb_build_object(
2979
+ 'activityId', 'run:sandbox-capacity',
2980
+ 'capacityLimit', CASE WHEN jsonb_typeof(item#>'{observation,target,limit}') = 'number'
2981
+ THEN item#>'{observation,target,limit}' END,
2982
+ 'capacityLimitSource', CASE WHEN item#>>'{observation,target,limitSource}' IN ('admission', 'workspace')
2983
+ THEN item#>'{observation,target,limitSource}' END,
2984
+ 'capacityWaitMs', CASE WHEN jsonb_typeof(item#>'{observation,target,waitedMs}') = 'number'
2985
+ THEN CASE WHEN (item#>>'{observation,target,waitedMs}')::numeric >= 0
2986
+ THEN item#>'{observation,target,waitedMs}' END END
2987
+ )) END
2974
2988
  ));
2975
2989
  IF kind = ${RUN_EVENT_KIND_SQL_LITERAL.logAppended} AND jsonb_typeof(item->'lines') IS DISTINCT FROM 'array' THEN
2976
2990
  RAISE EXCEPTION 'Search projection requires log.appended lines';
@@ -1589,6 +1589,7 @@ export type RuntimeSandboxCapacityTestEvidence = {
1589
1589
  run: null | {
1590
1590
  runId: string;
1591
1591
  status: string;
1592
+ /** In-attempt capacity refusals plus pre-claim capacity waits. */
1592
1593
  capacityDeferrals: number;
1593
1594
  acquired: number;
1594
1595
  unresolvedOperations: number;
@@ -1637,7 +1638,7 @@ export async function readRuntimeSandboxCapacityTestEvidence(
1637
1638
  evidence: RuntimeSandboxCapacityTestEvidence;
1638
1639
  }>(
1639
1640
  `WITH owned_run AS (
1640
- SELECT run_id, status FROM ${runs}
1641
+ SELECT run_id, status, recovery_json FROM ${runs}
1641
1642
  WHERE org_id = $1 AND run_id = $2
1642
1643
  AND launch_json->>'absurdReleaseId' = $3
1643
1644
  ), owned_operations AS (
@@ -1668,9 +1669,12 @@ export async function readRuntimeSandboxCapacityTestEvidence(
1668
1669
  ),
1669
1670
  'run', (SELECT jsonb_build_object(
1670
1671
  'runId', run_id, 'status', status,
1672
+ -- In-attempt refusals plus pre-claim waits: each wait event the run
1673
+ -- parked on (sandboxCapacityWait.seq) allocated no attempt.
1671
1674
  'capacityDeferrals', (SELECT count(*)::integer FROM ${schema}."attempts" AS attempt
1672
1675
  WHERE attempt.run_id = owned_run.run_id AND attempt.error_json->>'kind' = 'scheduler_capacity'
1673
- AND starts_with(attempt.error_json->>'message', 'Runtime scheduler sandbox capacity is full for organization ')),
1676
+ AND starts_with(attempt.error_json->>'message', 'Runtime scheduler sandbox capacity is full for organization '))
1677
+ + coalesce((owned_run.recovery_json #>> '{sandboxCapacityWait,seq}')::integer, 0),
1674
1678
  'acquired', (SELECT count(*)::integer FROM owned_operations WHERE sandbox_id IS NOT NULL AND provider_created_at IS NOT NULL),
1675
1679
  'unresolvedOperations', (SELECT count(*)::integer FROM owned_operations WHERE state NOT IN ('deleted', 'abandoned')),
1676
1680
  'confirmedDeleted', (SELECT count(*)::integer FROM owned_operations WHERE state = 'deleted' AND delete_confirmed_at IS NOT NULL),
@@ -2048,8 +2048,7 @@ export function docflowToolResultPreviewProjection(value: unknown): unknown {
2048
2048
  let outputs: string[];
2049
2049
  try {
2050
2050
  if (!isToolExecuteResult(value)) return value;
2051
- const extractors = (value._metadata as { extractors?: unknown })
2052
- .extractors;
2051
+ const extractors = (value._metadata as { extractors?: unknown }).extractors;
2053
2052
  outputs = isRecord(extractors) ? Object.keys(extractors) : [];
2054
2053
  } catch {
2055
2054
  return value;
@@ -2460,10 +2459,11 @@ function rawWithSerializedListRows(input: {
2460
2459
 
2461
2460
  let root: unknown = { toolResponse: { raw: input.raw } };
2462
2461
  for (const [name, rows] of Object.entries(input.listRows)) {
2463
- const sourcePath =
2464
- input.listDatasets?.[name]?.sourceLabel ??
2465
- input.lists[name]?.path ??
2466
- name;
2462
+ const sourcePath = serializedListPath(
2463
+ root,
2464
+ [input.listDatasets?.[name]?.sourceLabel, input.lists[name]?.path],
2465
+ name,
2466
+ );
2467
2467
  const candidates = [...candidateResultPaths(sourcePath)].filter(
2468
2468
  (candidate, index, all) => all.indexOf(candidate) === index,
2469
2469
  );
@@ -2485,6 +2485,32 @@ function rawWithSerializedListRows(input: {
2485
2485
  : input.raw;
2486
2486
  }
2487
2487
 
2488
+ /**
2489
+ * A serialized dataset's sourceLabel is usually its list path, but query
2490
+ * datasets label themselves for display ('query result rows'). Use the first
2491
+ * candidate (then the list name) that addresses an array in the response, so
2492
+ * the complete rows land on the list path readList selects instead of leaving
2493
+ * its preview there.
2494
+ */
2495
+ function serializedListPath(
2496
+ root: unknown,
2497
+ paths: ReadonlyArray<string | null | undefined>,
2498
+ name: string,
2499
+ ): string {
2500
+ const named = paths.filter(
2501
+ (path): path is string => typeof path === 'string' && path.length > 0,
2502
+ );
2503
+ return (
2504
+ [...named, name].find((path) =>
2505
+ candidateResultPaths(path).some((candidate) =>
2506
+ Array.isArray(getAtPath(root, candidate)),
2507
+ ),
2508
+ ) ??
2509
+ named[0] ??
2510
+ name
2511
+ );
2512
+ }
2513
+
2488
2514
  function createDatasetFromSerializedToolList(
2489
2515
  serialized: SerializedPlayDataset<Record<string, unknown>>,
2490
2516
  rows?: Array<Record<string, unknown>>,
@@ -2578,7 +2604,11 @@ function applySerializedListDatasets(
2578
2604
  createDatasetFromSerializedToolList(serialized, listRows?.[name]);
2579
2605
  const existingMetadata = result._metadata.lists[name];
2580
2606
  result._metadata.lists[name] = {
2581
- path: serialized.sourceLabel ?? existingMetadata?.path ?? name,
2607
+ path: serializedListPath(
2608
+ { toolResponse: { raw: result.toolResponse.raw } },
2609
+ [serialized.sourceLabel, existingMetadata?.path],
2610
+ name,
2611
+ ),
2582
2612
  count: serialized.count,
2583
2613
  keys: existingMetadata?.keys ?? {},
2584
2614
  };
@@ -10,6 +10,7 @@ import {
10
10
  inputFieldFromStaticCsvArg,
11
11
  type PlayStaticColumnProducer,
12
12
  type PlayStaticPipeline,
13
+ type PlayStaticSourceRange,
13
14
  type PlayStaticSubstep,
14
15
  } from '../static-pipeline';
15
16
  import type {
@@ -533,6 +534,46 @@ function projectPublicPipeline(
533
534
  };
534
535
  }
535
536
 
537
+ /**
538
+ * A child-Play call's line extent, for the authenticated app graph only.
539
+ *
540
+ * A `type:"play"` card is joined to its `ctx.runPlay` call by its `out:`
541
+ * symbol, else by the line its annotation sits on
542
+ * (`resolveDocflowBoundChildPlay`). A card whose `out:` names the result
543
+ * (`assignment`) rather than the step key (`route_lead`) joins by line, so a
544
+ * graph without the call's lines drew it as a plain card: no preview, nothing
545
+ * to open. Line numbers only: never the file path, which may name the
546
+ * author's machine.
547
+ */
548
+ function appGraphLineRange(
549
+ range: PlayStaticSourceRange | undefined,
550
+ ): PlayStaticSourceRange | undefined {
551
+ if (!range) return undefined;
552
+ return {
553
+ startLine: range.startLine,
554
+ endLine: range.endLine,
555
+ startColumn: range.startColumn,
556
+ endColumn: range.endColumn,
557
+ };
558
+ }
559
+
560
+ function appGraphCallExtent(
561
+ substep: PlayStaticSubstep,
562
+ includeBindingPaths: boolean,
563
+ ): { sourceRange?: PlayStaticSourceRange; callSiteRange?: PlayStaticSourceRange } {
564
+ if (!includeBindingPaths) return {};
565
+ const ranges = substep as {
566
+ sourceRange?: PlayStaticSourceRange;
567
+ callSiteRange?: PlayStaticSourceRange;
568
+ };
569
+ const sourceRange = appGraphLineRange(ranges.sourceRange);
570
+ const callSiteRange = appGraphLineRange(ranges.callSiteRange);
571
+ return {
572
+ ...(sourceRange ? { sourceRange } : {}),
573
+ ...(callSiteRange ? { callSiteRange } : {}),
574
+ };
575
+ }
576
+
536
577
  function projectPublicSubstep(
537
578
  substep: PlayStaticSubstep,
538
579
  depth: number,
@@ -615,6 +656,7 @@ function projectPublicSubstep(
615
656
  if (substep.type === 'play_call') {
616
657
  return {
617
658
  ...base,
659
+ ...appGraphCallExtent(substep, includeBindingPaths),
618
660
  type: 'play_call',
619
661
  playId: substep.playId,
620
662
  field: substep.field,
@@ -632,6 +674,7 @@ function projectPublicSubstep(
632
674
  if (substep.type === 'play_launch') {
633
675
  return {
634
676
  ...base,
677
+ ...appGraphCallExtent(substep, includeBindingPaths),
635
678
  type: 'play_launch',
636
679
  playId: substep.playId,
637
680
  field: substep.field,
@@ -70,6 +70,7 @@ export const BILLING_SALES_RULE_KEYS: readonly string[] = [
70
70
  'internal.billing.usage_charge',
71
71
  'internal.billing.credit_purchase',
72
72
  'internal.billing.paid_plan',
73
+ 'internal.billing.plan_cancelled',
73
74
  'internal.billing.allowance_exhausted',
74
75
  ...BILLING_DELIVERY_LATE_RULE_KEYS,
75
76
  ];
@@ -375,11 +375,14 @@ function lateCreditDeliveryRegistration<Id extends string>(
375
375
  }),
376
376
  present: ({ payload }) => ({
377
377
  title: `${label} not completed after ${payload.thresholdSeconds} seconds`,
378
- summary: [
379
- `<!channel> ${label} fulfillment in `,
380
- { workspace: true },
381
- ' needs investigation. Verify payment and fulfillment independently.',
382
- ],
378
+ summary:
379
+ label === 'Purchase' && payload.thresholdSeconds === 30
380
+ ? 'Purchase is still pending; will alert again at 120 seconds if unresolved.'
381
+ : [
382
+ `<!channel> ${label} fulfillment in `,
383
+ { workspace: true },
384
+ ' needs investigation. Verify payment and fulfillment independently.',
385
+ ],
383
386
  details: [
384
387
  `${label === 'Purchase' ? 'Operation' : 'Stripe invoice'}: ${payload[identityField]}`,
385
388
  ],
@@ -1098,6 +1101,36 @@ const PRODUCT_NOTIFICATION_TYPE_REGISTRY = [
1098
1101
  }),
1099
1102
  },
1100
1103
  },
1104
+ {
1105
+ id: 'internal.billing.plan_cancelled',
1106
+ eventName: ProductNotificationEvent.BillingPlanCancelled,
1107
+ requiredFilter: {},
1108
+ allowedTriggers: ['each_match'],
1109
+ catalog: undefined,
1110
+ shadow: true,
1111
+ rule: {
1112
+ default: {
1113
+ ruleKey: 'internal.billing.plan_cancelled',
1114
+ groupKey: BILLING_SALES_GROUP_KEY,
1115
+ },
1116
+ create: (_input, base) => ({
1117
+ ...base,
1118
+ repeatMode: 'every_match',
1119
+ trigger: { kind: 'each_match' },
1120
+ }),
1121
+ present: ({ payload }) => ({
1122
+ title: 'Plan cancellation scheduled',
1123
+ summary: [
1124
+ { workspace: true },
1125
+ ` cancelled the ${payload.planName} plan.`,
1126
+ ],
1127
+ details: [`Effective at: ${payload.effectiveAt}`],
1128
+ targetUrl: String(payload.targetUrl),
1129
+ subjectKind: 'workspace',
1130
+ subjectId: String(payload.accountId),
1131
+ }),
1132
+ },
1133
+ },
1101
1134
  {
1102
1135
  id: 'internal.billing.usage_charge',
1103
1136
  eventName: ProductNotificationEvent.BillingUsageChargeObserved,
@@ -25,7 +25,7 @@ import {
25
25
  * they create sparse copy-on-write overrides.
26
26
  */
27
27
  export const CURRENT_PRODUCT_NOTIFICATION_DEFAULT_POLICY = {
28
- version: 15,
28
+ version: 16,
29
29
  groups: [
30
30
  {
31
31
  groupKey: 'default',
@@ -30,6 +30,7 @@ export const ProductNotificationEvent = {
30
30
  CreditsUsageRecorded: 'credits.usage.recorded',
31
31
  AutoTopupLimitObserved: 'billing.auto_topup.limit_observed',
32
32
  BillingPlanPurchased: 'billing.plan.purchased',
33
+ BillingPlanCancelled: 'billing.plan.cancelled',
33
34
  BillingPurchaseLate: 'billing.purchase.late',
34
35
  BillingRenewalLate: 'billing.renewal.late',
35
36
  BillingUsageChargeObserved: 'billing.usage.charge_observed',
@@ -77,6 +78,7 @@ export const PRODUCT_NOTIFICATION_EVENT_NAMES = [
77
78
  ProductNotificationEvent.AutoTopupLimitObserved,
78
79
  ProductNotificationEvent.CreditsPurchaseCompleted,
79
80
  ProductNotificationEvent.BillingPlanPurchased,
81
+ ProductNotificationEvent.BillingPlanCancelled,
80
82
  ProductNotificationEvent.BillingPurchaseLate,
81
83
  ProductNotificationEvent.BillingRenewalLate,
82
84
  ProductNotificationEvent.BillingUsageChargeObserved,
@@ -259,6 +261,20 @@ export const PRODUCT_NOTIFICATION_EVENT_DEFINITIONS: readonly ProductNotificatio
259
261
  orderingSubjectFact: 'accountId',
260
262
  allowedTriggers: ['each_match'],
261
263
  },
264
+ {
265
+ // A paid plan's cancellation was confirmed for the billing boundary.
266
+ eventName: ProductNotificationEvent.BillingPlanCancelled,
267
+ producerKey: ProductNotificationProducerKey.BillingPlans,
268
+ requiredFacts: {
269
+ accountId: 'string',
270
+ offerKey: 'string',
271
+ planName: 'string',
272
+ effectiveAt: 'string',
273
+ targetUrl: 'string',
274
+ },
275
+ orderingSubjectFact: 'accountId',
276
+ allowedTriggers: ['each_match'],
277
+ },
262
278
  {
263
279
  eventName: ProductNotificationEvent.BillingPurchaseLate,
264
280
  producerKey: ProductNotificationProducerKey.BillingPurchases,
@@ -14,14 +14,14 @@ import {
14
14
  reportSetupCompleted,
15
15
  resolvePendingAuthClaimForResume,
16
16
  statusBannerLine
17
- } from "./chunk-E4S7OE7B.mjs";
18
- import "./chunk-HCFH2V27.mjs";
19
- import "./chunk-72NXIFOT.mjs";
20
- import "./chunk-GVW5V562.mjs";
17
+ } from "./chunk-EOPEYCY7.mjs";
18
+ import "./chunk-6PRW5UBA.mjs";
19
+ import "./chunk-4TALT2M3.mjs";
20
+ import "./chunk-YLTMXJFC.mjs";
21
21
  import "./chunk-NURW5XH4.mjs";
22
22
  import "./chunk-DLIRSHV6.mjs";
23
23
  import "./chunk-JL2OTMSG.mjs";
24
- import "./chunk-IZCPOX7X.mjs";
24
+ import "./chunk-AQWQ2BFX.mjs";
25
25
  import "./chunk-WZYKRD7T.mjs";
26
26
  import "./chunk-KRD6H754.mjs";
27
27
  export {
@@ -0,0 +1,43 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+ var _chunkS46HWQKOjs = require('./chunk-S46HWQKO.js');
18
+ require('./chunk-VQALXEXO.js');
19
+ require('./chunk-7IKQKKNX.js');
20
+ require('./chunk-RBEUVDZF.js');
21
+ require('./chunk-EITMD3A5.js');
22
+ require('./chunk-XNYIZMNQ.js');
23
+ require('./chunk-BBTKAASQ.js');
24
+ require('./chunk-634ZDA3F.js');
25
+ require('./chunk-OG64RBAC.js');
26
+ require('./chunk-COGTRVWW.js');
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+ exports.EXIT_WORKSPACE_MISMATCH = _chunkS46HWQKOjs.EXIT_WORKSPACE_MISMATCH; exports.authStatusLine = _chunkS46HWQKOjs.authStatusLine; exports.clearPendingClaim = _chunkS46HWQKOjs.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunkS46HWQKOjs.clearSatisfiedPendingClaim; exports.handleRegister = _chunkS46HWQKOjs.handleRegister; exports.handleStatus = _chunkS46HWQKOjs.handleStatus; exports.handleWait = _chunkS46HWQKOjs.handleWait; exports.httpJson = _chunkS46HWQKOjs.httpJson; exports.readPendingAuthClaim = _chunkS46HWQKOjs.readPendingAuthClaim; exports.readStatusBanner = _chunkS46HWQKOjs.readStatusBanner; exports.registerAuthCommands = _chunkS46HWQKOjs.registerAuthCommands; exports.reportApprovalLinkShown = _chunkS46HWQKOjs.reportApprovalLinkShown; exports.reportSetupCompleted = _chunkS46HWQKOjs.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunkS46HWQKOjs.resolvePendingAuthClaimForResume; exports.statusBannerLine = _chunkS46HWQKOjs.statusBannerLine;
@@ -1,25 +1,25 @@
1
1
  import {
2
2
  concurrentRunsLine
3
- } from "./chunk-E2QVWDDW.mjs";
4
- import "./chunk-E4S7OE7B.mjs";
3
+ } from "./chunk-HYC4MKGK.mjs";
4
+ import "./chunk-EOPEYCY7.mjs";
5
5
  import {
6
6
  DeeplineClient
7
- } from "./chunk-CIBQVA6V.mjs";
7
+ } from "./chunk-QY3ZNU6Z.mjs";
8
8
  import {
9
9
  iterateCursorPages,
10
10
  requireBillingIdempotencyKey
11
- } from "./chunk-TL3WIXDH.mjs";
11
+ } from "./chunk-Z5TSLLOW.mjs";
12
12
  import "./chunk-FZHMNK6F.mjs";
13
13
  import "./chunk-LX35AXTN.mjs";
14
14
  import "./chunk-PSX3WHIH.mjs";
15
15
  import "./chunk-UBKA33KY.mjs";
16
16
  import {
17
17
  PLAY_RUNTIME_PRICING_NOTE
18
- } from "./chunk-MAE3AKDR.mjs";
18
+ } from "./chunk-QX7LFGJR.mjs";
19
19
  import {
20
20
  PRICING_PAGE_NOTE
21
- } from "./chunk-NIPLY25A.mjs";
22
- import "./chunk-5LUF4LAR.mjs";
21
+ } from "./chunk-2RIKOPIM.mjs";
22
+ import "./chunk-6ZORHRKB.mjs";
23
23
  import {
24
24
  PLAY_SANDBOX_SIZE_INPUTS
25
25
  } from "./chunk-7I4B6V2S.mjs";
@@ -29,9 +29,9 @@ import {
29
29
  openInBrowser,
30
30
  printCommandEnvelope,
31
31
  shouldEmitJson
32
- } from "./chunk-HCFH2V27.mjs";
33
- import "./chunk-72NXIFOT.mjs";
34
- import "./chunk-GVW5V562.mjs";
32
+ } from "./chunk-6PRW5UBA.mjs";
33
+ import "./chunk-4TALT2M3.mjs";
34
+ import "./chunk-YLTMXJFC.mjs";
35
35
  import {
36
36
  AuthError,
37
37
  ConfigError
@@ -40,7 +40,7 @@ import "./chunk-DLIRSHV6.mjs";
40
40
  import {
41
41
  DeeplineError
42
42
  } from "./chunk-JL2OTMSG.mjs";
43
- import "./chunk-IZCPOX7X.mjs";
43
+ import "./chunk-AQWQ2BFX.mjs";
44
44
  import "./chunk-WZYKRD7T.mjs";
45
45
  import "./chunk-KRD6H754.mjs";
46
46
 
@@ -798,7 +798,8 @@ function planPriceText(priceUsd, priceInterval) {
798
798
  function targetPlanLine(plan) {
799
799
  const firstMonth = plan.first_month_price_usd != null ? ` (first month $${plan.first_month_price_usd})` : "";
800
800
  const bonus = plan.bonus_credits != null ? ` (+${plan.bonus_credits} bonus credits once paid)` : "";
801
- return `${plan.display_name ?? plan.name} (${plan.sku}) | ${planPriceText(plan.recurring_price_usd, plan.interval)}${firstMonth}${bonus} | ${plan.included_credits} included credits/month | $${plan.purchased_credit_price_usd}/purchased credit | ${plan.acquisition_enabled ? "available" : "unavailable"}`;
801
+ const annual = plan.annual_price_usd != null ? ` (or $${plan.annual_price_usd}/year with --annual${plan.annual_offer_label ? `, ${plan.annual_offer_label}` : ""})` : "";
802
+ return `${plan.display_name ?? plan.name} (${plan.sku}) | ${planPriceText(plan.recurring_price_usd, plan.interval)}${firstMonth}${bonus}${annual} | ${plan.included_credits} included credits/month | $${plan.purchased_credit_price_usd}/purchased credit | ${plan.acquisition_enabled ? "available" : "unavailable"}`;
802
803
  }
803
804
  async function handlePlans(options) {
804
805
  const client = new DeeplineClient();
@@ -1674,6 +1675,7 @@ async function handleTargetPlan(planSku, options) {
1674
1675
  targetPlanSku: planSku,
1675
1676
  ...options.billingEmail ? { billingEmail: options.billingEmail } : {},
1676
1677
  ...options.promoCode ? { promoCode: options.promoCode } : {},
1678
+ ...options.annual ? { billingInterval: "year" } : {},
1677
1679
  idempotencyKey
1678
1680
  });
1679
1681
  printCommandEnvelope(
@@ -2091,6 +2093,9 @@ Examples:
2091
2093
  ).option(
2092
2094
  "--promo-code <code>",
2093
2095
  "Plan promo code; an unknown, expired, or used code refuses the change"
2096
+ ).option(
2097
+ "--annual",
2098
+ "Pay for a year up front where `billing plans` shows an annual price; credits stay monthly and a cancellation takes effect at the end of the paid year"
2094
2099
  ).option("--idempotency-key <key>", "Stable retry key").option("--json", "Emit JSON output").action(handleTargetPlan);
2095
2100
  billing.command("cancel-plan").description("Cancel a target subscription at period end, or undo it.").option("--undo", "Undo a pending period-end cancellation").option("--idempotency-key <key>", "Stable retry key").option("--json", "Emit JSON output").action(handleTargetPlanCancellation);
2096
2101
  billing.command("portal").description("Open the Stripe-hosted billing recovery portal.").option("--billing-address", "Open the billing address editor directly").option("--no-open", "Print the URL without opening a browser").option("--json", "Emit JSON output").action(handleTargetPortal);
@@ -2103,7 +2108,9 @@ Notes:
2103
2108
  and current acquisition availability. All amounts are Deepline credits and
2104
2109
  Deepline-facing USD, never raw provider spend. Change to an available plan
2105
2110
  with: deepline billing change-plan <plan_sku>. A first-month price or bonus
2106
- credits appear on a plan when the workspace is offered them. With
2111
+ credits appear on a plan when the workspace is offered them. An annual
2112
+ price appears when the workspace may pay for a year up front; buy it with
2113
+ change-plan <plan_sku> --annual. With
2107
2114
  --promo-code, prices are quoted with that code and its outcome is shown;
2108
2115
  pass the same code to change-plan.
2109
2116