deepline 0.3.473 → 0.3.475

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 (177) hide show
  1. package/dist/bundling-sources/sdk/src/client-core.ts +4 -1
  2. package/dist/bundling-sources/sdk/src/play.ts +7 -2
  3. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  4. package/dist/bundling-sources/shared_libs/integration-contracts/billing-entitlements.ts +3 -1
  5. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +18 -0
  6. package/dist/bundling-sources/shared_libs/play-runtime/deployment/fly-machines.ts +101 -2
  7. package/dist/bundling-sources/shared_libs/play-runtime/modal-runtime-config.ts +62 -20
  8. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-launch-transport.ts +2 -2
  9. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +24 -8
  10. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +19 -7
  11. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-runtime-watchdog.ts +196 -10
  12. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +40 -17
  13. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/local-process.ts +4 -1
  14. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal-resource-usage.ts +222 -0
  15. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +46 -14
  16. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/types.ts +2 -0
  17. package/dist/bundling-sources/shared_libs/play-runtime/runtime-incident-drills.ts +9 -5
  18. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-compute-usage.ts +8 -0
  19. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/contract.ts +2 -0
  20. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/runner-backend-adapter.ts +2 -0
  21. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-scope.ts +39 -15
  22. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +18 -8
  23. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +64 -35
  24. package/dist/bundling-sources/shared_libs/play-runtime/worker-api-types.ts +36 -0
  25. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +18 -8
  26. package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +1 -1
  27. package/dist/bundling-sources/shared_libs/plays/sandbox-runtime-limits.ts +64 -16
  28. package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +1 -1
  29. package/dist/bundling-sources/shared_libs/product-notifications/billing-sales.ts +14 -1
  30. package/dist/bundling-sources/shared_libs/product-notifications/catalog.ts +40 -0
  31. package/dist/bundling-sources/shared_libs/product-notifications/default-policy.ts +23 -1
  32. package/dist/bundling-sources/shared_libs/product-notifications/events.ts +18 -0
  33. package/dist/bundling-sources/shared_libs/product-notifications/slack-delivery.ts +2 -1
  34. package/dist/cli/auth-7GVCW24N.js +41 -0
  35. package/dist/cli/{auth-KLJOQ4DZ.mjs → auth-CFDYJ7FZ.mjs} +5 -5
  36. package/dist/cli/{billing-DNDYNBQ7.mjs → billing-PEXWWLRT.mjs} +12 -10
  37. package/dist/cli/{billing-IQNJXKH5.js → billing-XLIL3FLK.js} +85 -83
  38. package/dist/cli/{chunk-4U3RNA3J.js → chunk-3MQJJ6YX.js} +51 -51
  39. package/dist/cli/{chunk-EUHTZV2E.mjs → chunk-3QSFSHCJ.mjs} +1 -1
  40. package/dist/cli/{chunk-CNCK2D6B.mjs → chunk-3WVA7E7O.mjs} +2 -2
  41. package/dist/cli/{chunk-NTFM7JQW.mjs → chunk-42F6LTBJ.mjs} +3 -3
  42. package/dist/cli/{chunk-V25CXRQ7.mjs → chunk-4QHAP3MR.mjs} +5 -5
  43. package/dist/cli/{chunk-3LFSIUFI.js → chunk-4QHQ3WYW.js} +21 -21
  44. package/dist/cli/{chunk-6ZTSHKJF.js → chunk-5QS4T4KR.js} +10 -3
  45. package/dist/cli/{chunk-VS7JKS22.mjs → chunk-6PRYHABU.mjs} +1 -1
  46. package/dist/cli/{chunk-63OOFT6B.js → chunk-7SWRXZ4A.js} +93 -93
  47. package/dist/cli/{chunk-6YOGOXOJ.mjs → chunk-7U3L2S7X.mjs} +10 -10
  48. package/dist/cli/{chunk-D4B3EV55.js → chunk-7XTBEYLS.js} +36 -36
  49. package/dist/cli/{chunk-QD6IW2HP.mjs → chunk-AD7KL6AI.mjs} +4 -4
  50. package/dist/cli/{chunk-YH5SFKHJ.js → chunk-B7NJ5JQ2.js} +4 -4
  51. package/dist/cli/{chunk-F4PUDYBY.js → chunk-BLW2K6YH.js} +3 -3
  52. package/dist/cli/{chunk-N4ZCMQ54.js → chunk-BSK2TGB4.js} +8 -8
  53. package/dist/cli/{chunk-QG3THSTN.mjs → chunk-BVAYLXMH.mjs} +2 -2
  54. package/dist/cli/{chunk-IC6AHOYS.js → chunk-CKSRTD45.js} +1 -1
  55. package/dist/cli/{chunk-RVRG57OB.js → chunk-D3Q4FUFS.js} +8 -8
  56. package/dist/cli/{chunk-ABLEU3QI.mjs → chunk-D6SXN34W.mjs} +4 -4
  57. package/dist/cli/{chunk-GTH7JORC.mjs → chunk-DIMKSDF6.mjs} +2 -2
  58. package/dist/cli/{chunk-Z52WEIBR.js → chunk-DKR7QPEO.js} +11 -7
  59. package/dist/cli/{chunk-YUNPYX5T.mjs → chunk-DUGZKPRK.mjs} +10 -3
  60. package/dist/cli/{chunk-6QS7522K.mjs → chunk-EA45HSEC.mjs} +2 -2
  61. package/dist/cli/{chunk-TUFQFTOC.js → chunk-F4FNMXI3.js} +53 -53
  62. package/dist/cli/{chunk-3OPQLFUK.mjs → chunk-FC4C7MZM.mjs} +4 -4
  63. package/dist/cli/{chunk-WGQKOLXH.js → chunk-G4SGYWKV.js} +6 -6
  64. package/dist/cli/{chunk-GISBRE2H.mjs → chunk-HALAYT3Y.mjs} +3 -3
  65. package/dist/cli/{chunk-GQBAJTQU.mjs → chunk-HMHH7JQD.mjs} +2 -2
  66. package/dist/cli/{chunk-PMJAGTSQ.js → chunk-KTWXY73Q.js} +5 -5
  67. package/dist/cli/{chunk-GAWP2YF5.mjs → chunk-M27SSAQ7.mjs} +1 -1
  68. package/dist/cli/{chunk-UON3WCBD.js → chunk-M4QO3GRD.js} +3 -3
  69. package/dist/cli/{chunk-36KEQFWZ.js → chunk-M7K5BCWP.js} +10 -10
  70. package/dist/cli/{chunk-SWAYZST7.mjs → chunk-MUDOASYL.mjs} +2 -2
  71. package/dist/cli/{chunk-D22QIUE3.js → chunk-NBVYS6VG.js} +9 -9
  72. package/dist/cli/{chunk-GE5GPLNM.mjs → chunk-NGOKBSBH.mjs} +1 -1
  73. package/dist/cli/{chunk-VGVSHQN5.mjs → chunk-NHQP4UPJ.mjs} +5 -5
  74. package/dist/cli/{chunk-3J2N7YF5.js → chunk-QKMWQTMI.js} +3 -3
  75. package/dist/cli/{chunk-B3BM3PAI.js → chunk-TLPW2SHS.js} +6 -6
  76. package/dist/cli/{chunk-QI73EL5C.js → chunk-TZRTT7EI.js} +26 -26
  77. package/dist/cli/{chunk-DD7E4ZVH.js → chunk-U3F63UWD.js} +7 -7
  78. package/dist/cli/{chunk-RZHUHL53.mjs → chunk-V4ILQ2DS.mjs} +11 -7
  79. package/dist/cli/{chunk-YHB6MASP.js → chunk-VBGPRRJ6.js} +2 -2
  80. package/dist/cli/{chunk-HQCTPAXP.mjs → chunk-VD3E3QMI.mjs} +1 -1
  81. package/dist/cli/{chunk-X6R5UNDZ.mjs → chunk-VFP3MFLD.mjs} +1 -1
  82. package/dist/cli/{chunk-EVLUSXQG.mjs → chunk-VTCXSICG.mjs} +2 -2
  83. package/dist/cli/{chunk-TBLBYIKO.mjs → chunk-YAAQNDP6.mjs} +1 -1
  84. package/dist/cli/{chunk-IFZ76E5H.mjs → chunk-YMS7VYFA.mjs} +1 -1
  85. package/dist/cli/{chunk-OHUGXZ7N.js → chunk-Z5VSBCFV.js} +16 -16
  86. package/dist/cli/{chunk-ZVLYUKJU.js → chunk-ZANUM4XV.js} +5 -5
  87. package/dist/cli/{chunk-MREO5LZD.js → chunk-ZQYBKDPA.js} +2 -2
  88. package/dist/cli/command-docs.js +2 -2
  89. package/dist/cli/command-docs.mjs +1 -1
  90. package/dist/cli/{csv-OVV3HWN4.js → csv-4YHSYV2C.js} +13 -13
  91. package/dist/cli/{csv-NCY5MWS2.mjs → csv-WC7ILC7P.mjs} +4 -4
  92. package/dist/cli/{db-BOELNDS4.js → db-APZNM2GI.js} +27 -27
  93. package/dist/cli/{db-VPH6JHUD.mjs → db-I5PV6NTC.mjs} +6 -6
  94. package/dist/cli/describe-OR7FZBCD.js +48 -0
  95. package/dist/cli/{describe-FFDCPYZH.mjs → describe-XH5F3X5W.mjs} +17 -17
  96. package/dist/cli/describe-core.d.mts +3 -3
  97. package/dist/cli/describe-core.d.ts +3 -3
  98. package/dist/cli/{executions-5GCCDENS.mjs → executions-PIY4XM7T.mjs} +6 -6
  99. package/dist/cli/{executions-RF44ANF5.js → executions-VIXFKZYU.js} +8 -8
  100. package/dist/cli/{feedback-OI2A5L6F.mjs → feedback-IGDHBWGT.mjs} +4 -4
  101. package/dist/cli/{feedback-NJM3V7QV.js → feedback-WCLIFQTR.js} +8 -8
  102. package/dist/cli/git-CKN2F32Y.js +25 -0
  103. package/dist/cli/{git-EOGSZ3T2.mjs → git-FRICPPTA.mjs} +5 -5
  104. package/dist/cli/index.js +139 -139
  105. package/dist/cli/index.mjs +41 -41
  106. package/dist/cli/{legacy-noops-5QM7XGGX.js → legacy-noops-DSFOPYDY.js} +8 -8
  107. package/dist/cli/{legacy-noops-UYKK7AAB.mjs → legacy-noops-ROAXEG6D.mjs} +5 -5
  108. package/dist/cli/{monitors-N3ITC5MP.mjs → monitors-FZ5PRLW6.mjs} +7 -7
  109. package/dist/cli/{monitors-52GW2V4V.js → monitors-KUCYQLU5.js} +91 -91
  110. package/dist/cli/{org-KUZUG33W.mjs → org-DRNND5XU.mjs} +6 -6
  111. package/dist/cli/{org-ADF47NPV.js → org-SRHMWKQR.js} +72 -72
  112. package/dist/cli/{pages-H3H7ODBN.js → pages-TEJQIHTU.js} +17 -17
  113. package/dist/cli/{pages-C3S5WU3S.mjs → pages-XNGA356T.mjs} +6 -6
  114. package/dist/cli/{play-YWZWBG32.js → play-GCGFQSFP.js} +662 -601
  115. package/dist/cli/{play-SZETTQPV.mjs → play-NE45ROIZ.mjs} +110 -49
  116. package/dist/cli/{providers-FSCD35HB.mjs → providers-57TJOSMV.mjs} +6 -6
  117. package/dist/cli/{providers-V3BP7ZB2.js → providers-VHMUR63R.js} +9 -9
  118. package/dist/cli/{quickstart-ICULVGAR.js → quickstart-BPXWO4UD.js} +6 -6
  119. package/dist/cli/{quickstart-SYZCT2WI.mjs → quickstart-K3SH4NXP.mjs} +4 -4
  120. package/dist/cli/{run-WUJSKGUM.js → run-553AAXDU.js} +36 -36
  121. package/dist/cli/{run-HA5B3AYQ.mjs → run-ZRWJUEN2.mjs} +22 -22
  122. package/dist/cli/{search-A27AGYDV.mjs → search-BW6XRS4I.mjs} +7 -7
  123. package/dist/cli/search-WF26AUDJ.js +32 -0
  124. package/dist/cli/{secrets-ODX56QBF.js → secrets-AMYQYUL5.js} +15 -15
  125. package/dist/cli/{secrets-2L4VRJ2F.mjs → secrets-OYYCFGZE.mjs} +6 -6
  126. package/dist/cli/{sessions-PRF36DHO.mjs → sessions-O4SVVOMO.mjs} +5 -5
  127. package/dist/cli/{sessions-DVZ4FECP.js → sessions-RYCJUMJ2.js} +6 -6
  128. package/dist/cli/{settings-RJT5DBWG.js → settings-7R5FQKII.js} +78 -78
  129. package/dist/cli/{settings-LUATIKJE.mjs → settings-QK7DHDU7.mjs} +11 -11
  130. package/dist/cli/{setup-FJSBKCLU.js → setup-OTQDQHDN.js} +44 -44
  131. package/dist/cli/{setup-IQXTYLRH.mjs → setup-VDAAVCKK.mjs} +9 -9
  132. package/dist/cli/{skills-XJH4ZC5Y.mjs → skills-HRK5O5JO.mjs} +7 -7
  133. package/dist/cli/skills-VNLMEOXW.js +31 -0
  134. package/dist/cli/tools-C3MUHL7G.js +55 -0
  135. package/dist/cli/{tools-IGXLZCKZ.mjs → tools-O7BM62QV.mjs} +16 -16
  136. package/dist/cli/update-TCKTU6QJ.js +33 -0
  137. package/dist/cli/{update-AH7G5VSL.mjs → update-UHKHCSTY.mjs} +9 -9
  138. package/dist/cli/{workflow-IQ2J7LWM.js → workflow-7Z5NCTGG.js} +17 -17
  139. package/dist/cli/{workflow-WOYSCWVD.mjs → workflow-T2EDR7L4.mjs} +7 -7
  140. package/dist/{client-C9bJ0QXu.d.mts → client-Bgl0_zXi.d.mts} +1 -1
  141. package/dist/{client-CuNH54w3.d.ts → client-_ah6IuhK.d.ts} +1 -1
  142. package/dist/{client-core-CSiXbe2n.d.mts → client-core-Bfsedm0_.d.mts} +44 -3
  143. package/dist/{client-core-C8Q6DKga.d.ts → client-core-C-ZF5vh9.d.ts} +44 -3
  144. package/dist/{compiler-manifest-Zwm9yqOA.d.mts → compiler-manifest-CCOqDGjU.d.mts} +12 -10
  145. package/dist/{compiler-manifest-Zwm9yqOA.d.ts → compiler-manifest-CCOqDGjU.d.ts} +12 -10
  146. package/dist/{errors-nEsqNLL8.d.mts → errors-BLccD7tG.d.mts} +1 -1
  147. package/dist/{errors-CsYwlpn4.d.ts → errors-Cy3kPnsi.d.ts} +1 -1
  148. package/dist/{index-CXF2jtza.d.mts → index-4-j44HuT.d.mts} +1 -1
  149. package/dist/{index-9pUZqkPH.d.ts → index-D5e4h1-H.d.ts} +1 -1
  150. package/dist/index.d.mts +14 -9
  151. package/dist/index.d.ts +14 -9
  152. package/dist/index.js +9 -9
  153. package/dist/index.mjs +6 -6
  154. package/dist/install-integrity.json +111 -110
  155. package/dist/plays/bundle-play-file.d.mts +3 -3
  156. package/dist/plays/bundle-play-file.d.ts +3 -3
  157. package/dist/plays/bundle-play-file.mjs +1 -1
  158. package/dist/plays/play-description.d.mts +2 -2
  159. package/dist/plays/play-description.d.ts +2 -2
  160. package/dist/plays/run-request.d.mts +2 -2
  161. package/dist/plays/run-request.d.ts +2 -2
  162. package/dist/release.d.mts +1 -1
  163. package/dist/release.d.ts +1 -1
  164. package/dist/release.js +2 -2
  165. package/dist/release.mjs +1 -1
  166. package/dist/server.d.mts +4 -4
  167. package/dist/server.d.ts +4 -4
  168. package/dist/server.js +5 -5
  169. package/dist/server.mjs +3 -3
  170. package/package.json +1 -1
  171. package/dist/cli/auth-IJOWKNSB.js +0 -41
  172. package/dist/cli/describe-7SFESEFL.js +0 -48
  173. package/dist/cli/git-4V5ZS5SE.js +0 -25
  174. package/dist/cli/search-XATDPNEM.js +0 -32
  175. package/dist/cli/skills-N6CPBF6T.js +0 -31
  176. package/dist/cli/tools-YMVEVRCE.js +0 -55
  177. package/dist/cli/update-MUCWGTXH.js +0 -33
@@ -3,7 +3,10 @@ export type { BillingEntitlements } from '../integration-contracts/billing-entit
3
3
  import { Type, type Static, type TSchema } from '@sinclair/typebox';
4
4
  import { Value } from '@sinclair/typebox/value';
5
5
  import type { PreviousCell } from './cell-staleness';
6
- import type { PlaySandboxRuntimeLimits } from './sandbox-runtime-limits';
6
+ import type {
7
+ PlaySandboxRuntimeLimits,
8
+ PlaySandboxSize,
9
+ } from './sandbox-runtime-limits';
7
10
  import type {
8
11
  BasicToolExecuteResult,
9
12
  ToolExecuteResult,
@@ -207,6 +210,7 @@ export const PLAY_AUTHORING_CONTRACT_ISSUE_CODES = [
207
210
  'play_authoring_row_sleep_unsupported',
208
211
  'play_authoring_hitl_retry_loop_unsafe',
209
212
  'play_authoring_binding_invalid',
213
+ 'play_runtime_size_preview_only',
210
214
  'play_authoring_input_schema_unresolved',
211
215
  'tool_response_raw_access',
212
216
  'check_error',
@@ -863,7 +867,7 @@ export type PlayAuthoringBindings<TInput = Record<string, unknown>> = {
863
867
  */
864
868
  runtime?: {
865
869
  timeout?: string;
866
- size?: 'standard';
870
+ size?: PlaySandboxSize;
867
871
  };
868
872
  /**
869
873
  * Start at most one run of this Play per window, whatever started it.
@@ -2967,20 +2971,26 @@ export const PLAY_AUTHORING_FIELD_REGISTRY = {
2967
2971
  'rateLimit.every must be a static duration from "10s" to "24h", such as "5m".',
2968
2972
  },
2969
2973
  'runtime.size': {
2970
- schema: Type.Literal('standard'),
2974
+ schema: Type.Union([
2975
+ Type.Literal('standard'),
2976
+ Type.Literal('large'),
2977
+ Type.Literal('xlarge'),
2978
+ ]),
2971
2979
  fixtures: {
2972
- valid: 'standard',
2973
- invalid: 'large',
2980
+ valid: 'large',
2981
+ invalid: 'xxlarge',
2974
2982
  absent: undefined,
2975
2983
  unresolved: { expression: 'size' },
2976
2984
  edition1: 'standard',
2977
2985
  },
2978
- referenceType: "'standard'",
2986
+ referenceType: "'standard' | 'large' | 'xlarge'",
2979
2987
  required: false,
2980
2988
  resolution: 'static-required',
2981
2989
  issueCode: 'play_authoring_binding_invalid',
2982
- description: 'Deepline-managed sandbox size. Only standard is supported.',
2983
- errorMessage: 'runtime.size must be the static literal "standard".',
2990
+ description:
2991
+ 'Deepline-managed sandbox size. Standard is 1 GiB memory. Large (4 GiB) and xlarge (8 GiB) are available only on branch Preview deployments. Production supports standard.',
2992
+ errorMessage:
2993
+ 'runtime.size must be the static literal "standard", "large", or "xlarge".',
2984
2994
  },
2985
2995
  'ctx.customerDb.query.statement': {
2986
2996
  schema: Type.Union([
@@ -1125,7 +1125,7 @@ function sandboxRuntimeDeclarationFromOptions(
1125
1125
  if (unsupportedProperties.length > 0) {
1126
1126
  throw new Error(
1127
1127
  `Unsupported runtime sandbox option${unsupportedProperties.length === 1 ? '' : 's'} "${unsupportedProperties.join('", "')}". ` +
1128
- 'Use runtime.size with a Deepline prebuilt sandbox. Supported sizes: "standard".',
1128
+ 'Use runtime.size with a Deepline prebuilt sandbox. Supported sizes: "standard", "large", or "xlarge".',
1129
1129
  );
1130
1130
  }
1131
1131
  const timeout = resolveStaticProperty(runtime.value, 'timeout', context);
@@ -5,7 +5,7 @@ export type PlaySandboxRuntimeLimits = {
5
5
  diskGiB: number;
6
6
  };
7
7
 
8
- export type PlaySandboxSize = 'standard';
8
+ export type PlaySandboxSize = 'standard' | 'large' | 'xlarge';
9
9
 
10
10
  export const PLAY_SANDBOX_SIZE_LIMITS = {
11
11
  standard: {
@@ -13,6 +13,16 @@ export const PLAY_SANDBOX_SIZE_LIMITS = {
13
13
  cpu: 1,
14
14
  diskGiB: 3,
15
15
  },
16
+ large: {
17
+ memoryGiB: 4,
18
+ cpu: 2,
19
+ diskGiB: 8,
20
+ },
21
+ xlarge: {
22
+ memoryGiB: 8,
23
+ cpu: 4,
24
+ diskGiB: 10,
25
+ },
16
26
  } as const satisfies Record<
17
27
  PlaySandboxSize,
18
28
  Omit<PlaySandboxRuntimeLimits, 'timeoutSeconds'>
@@ -27,11 +37,50 @@ export const STANDARD_PLAY_SANDBOX_RUNTIME_LIMITS: PlaySandboxRuntimeLimits = {
27
37
  // customer-authored Play can never ask Daytona for an unbounded resource.
28
38
  export const MAX_PLAY_SANDBOX_RUNTIME_LIMITS: PlaySandboxRuntimeLimits = {
29
39
  timeoutSeconds: 4 * 60 * 60,
30
- memoryGiB: STANDARD_PLAY_SANDBOX_RUNTIME_LIMITS.memoryGiB,
31
- cpu: STANDARD_PLAY_SANDBOX_RUNTIME_LIMITS.cpu,
32
- diskGiB: STANDARD_PLAY_SANDBOX_RUNTIME_LIMITS.diskGiB,
40
+ ...PLAY_SANDBOX_SIZE_LIMITS.xlarge,
33
41
  };
34
42
 
43
+ /** Bounded Modal burst headroom; resource reservation remains the chosen profile. */
44
+ export function modalSandboxMemoryLimitGiBForPlay(
45
+ input: Pick<PlaySandboxRuntimeLimits, 'memoryGiB'>,
46
+ ): number {
47
+ if (
48
+ !Object.values(PLAY_SANDBOX_SIZE_LIMITS).some(
49
+ (profile) => profile.memoryGiB === input.memoryGiB,
50
+ )
51
+ ) {
52
+ throw new Error(
53
+ `Unsupported Modal memory reservation: ${input.memoryGiB} GiB.`,
54
+ );
55
+ }
56
+ return Math.min(
57
+ Math.max(4, input.memoryGiB * 2),
58
+ MAX_PLAY_SANDBOX_RUNTIME_LIMITS.memoryGiB,
59
+ );
60
+ }
61
+
62
+ export function playSandboxSizeForLimits(
63
+ limits: Pick<PlaySandboxRuntimeLimits, 'memoryGiB' | 'cpu' | 'diskGiB'>,
64
+ ): PlaySandboxSize | null {
65
+ return (
66
+ (
67
+ Object.entries(PLAY_SANDBOX_SIZE_LIMITS) as [
68
+ PlaySandboxSize,
69
+ (typeof PLAY_SANDBOX_SIZE_LIMITS)[PlaySandboxSize],
70
+ ][]
71
+ ).find(
72
+ ([, profile]) =>
73
+ profile.memoryGiB === limits.memoryGiB &&
74
+ profile.cpu === limits.cpu &&
75
+ profile.diskGiB === limits.diskGiB,
76
+ )?.[0] ?? null
77
+ );
78
+ }
79
+
80
+ const supportedPlaySandboxSizes = Object.keys(PLAY_SANDBOX_SIZE_LIMITS).join(
81
+ ', ',
82
+ );
83
+
35
84
  export type PlaySandboxRuntimeDeclaration = {
36
85
  timeout?: string;
37
86
  size?: PlaySandboxSize;
@@ -48,15 +97,11 @@ function parseTimeout(value: string): number | null {
48
97
  export function validatePlaySandboxRuntimeLimits(
49
98
  value: PlaySandboxRuntimeLimits,
50
99
  ): PlaySandboxRuntimeLimits {
51
- const base = STANDARD_PLAY_SANDBOX_RUNTIME_LIMITS;
52
- for (const key of ['memoryGiB', 'cpu', 'diskGiB'] as const) {
53
- if (value[key] !== base[key]) {
54
- throw new Error(
55
- `Unsupported runtime sandbox resources: ${key}=${value[key]}. ` +
56
- `Use runtime.size with a Deepline prebuilt sandbox. Supported sizes: "standard" ` +
57
- `(${base.cpu} CPU, ${base.memoryGiB}GiB memory, ${base.diskGiB}GiB disk).`,
58
- );
59
- }
100
+ if (!playSandboxSizeForLimits(value)) {
101
+ throw new Error(
102
+ `Unsupported runtime sandbox resources: cpu=${value.cpu} memoryGiB=${value.memoryGiB} diskGiB=${value.diskGiB}. ` +
103
+ `Use runtime.size with a Deepline prebuilt sandbox. Supported sizes: ${supportedPlaySandboxSizes}.`,
104
+ );
60
105
  }
61
106
  if (
62
107
  !Number.isSafeInteger(value.timeoutSeconds) ||
@@ -85,12 +130,15 @@ export function resolvePlaySandboxRuntimeLimits(
85
130
  if (unsupportedProperties.length > 0) {
86
131
  throw new Error(
87
132
  `Unsupported runtime sandbox option${unsupportedProperties.length === 1 ? '' : 's'}: ${unsupportedProperties.join(', ')}. ` +
88
- 'Use runtime.size with a Deepline prebuilt sandbox. Supported sizes: "standard".',
133
+ `Use runtime.size with a Deepline prebuilt sandbox. Supported sizes: ${supportedPlaySandboxSizes}.`,
89
134
  );
90
135
  }
91
- if (declaration.size !== undefined && declaration.size !== 'standard') {
136
+ if (
137
+ declaration.size !== undefined &&
138
+ !Object.hasOwn(PLAY_SANDBOX_SIZE_LIMITS, declaration.size)
139
+ ) {
92
140
  throw new Error(
93
- `Unsupported runtime sandbox size "${String(declaration.size)}". Supported sizes: "standard".`,
141
+ `Unsupported runtime sandbox size "${String(declaration.size)}". Supported sizes: ${supportedPlaySandboxSizes}.`,
94
142
  );
95
143
  }
96
144
  const timeoutSeconds = declaration.timeout
@@ -413,7 +413,7 @@ export type ToolExecuteResultAccessors<
413
413
  * incomplete lists throw: use readList(result, path) for explicit dataset access.
414
414
  * Provider pagination requires a separate request; getters never fetch it.
415
415
  * Historical editions 1–9 retain PlayDataset getters and async materialize/peek;
416
- * missing getters never mean empty results. Inspect rawV2 for debugging: parsed,
416
+ * missing getters never mean empty results. Inspect toolResponse.rawV2 for debugging: parsed,
417
417
  * scrubbed envelopes, pagination and siblings, not HTTP bytes or headers.
418
418
  *
419
419
  * @sdkReference runtime 200
@@ -21,6 +21,14 @@ export function isBillingSalesGroupKey(key: unknown): boolean {
21
21
  );
22
22
  }
23
23
 
24
+ export const BILLING_ALERTS_SLACK_CHANNEL_ID = 'C0CEBRS6PHS';
25
+ export const BILLING_USAGE_GROUP_KEY = 'shadow.billing-usage';
26
+ export const BILLING_USAGE_DESTINATION_KEY = 'shadow.billing-usage.slack';
27
+ export function isPlatformBillingDestination(key: unknown): boolean {
28
+ return (
29
+ key === BILLING_USAGE_DESTINATION_KEY || isBillingSalesDestinationKey(key)
30
+ );
31
+ }
24
32
  export const BILLING_SALES_GROUP_KEY = 'shadow.billing-sales';
25
33
  export const BILLING_SALES_DESTINATION_KEY = 'shadow.billing-sales.slack';
26
34
  export const BILLING_SALES_SLACK_CHANNEL_ID = 'C0AGWVD2TNK';
@@ -33,13 +41,18 @@ export const BILLING_DELIVERY_LATE_RULE_KEYS: readonly string[] = [
33
41
  BILLING_RENEWAL_LATE_RULE_KEY,
34
42
  ];
35
43
  export const BILLING_SALES_RULE_KEYS: readonly string[] = [
44
+ 'internal.billing.usage_charge',
36
45
  'internal.billing.credit_purchase',
37
46
  'internal.billing.paid_plan',
38
47
  ...BILLING_DELIVERY_LATE_RULE_KEYS,
39
48
  ];
40
49
 
41
50
  export function isPlatformNotificationGroup(groupKey: string): boolean {
42
- return groupKey === 'shadow' || isBillingSalesGroupKey(groupKey);
51
+ return (
52
+ groupKey === 'shadow' ||
53
+ isBillingSalesGroupKey(groupKey) ||
54
+ groupKey === BILLING_USAGE_GROUP_KEY
55
+ );
43
56
  }
44
57
 
45
58
  /** Permit only the code-owned purchase-rule move while old deliveries drain. */
@@ -20,6 +20,7 @@ import {
20
20
  BILLING_SALES_CREDIT_PURCHASE_MINIMUM_CENTS,
21
21
  BILLING_CREDIT_PURCHASE_GROUP_KEY,
22
22
  BILLING_SALES_GROUP_KEY,
23
+ BILLING_USAGE_GROUP_KEY,
23
24
  } from './billing-sales';
24
25
 
25
26
  export const DEFAULT_PLAY_FAILURE_SETTINGS = {
@@ -995,6 +996,45 @@ const PRODUCT_NOTIFICATION_TYPE_REGISTRY = [
995
996
  }),
996
997
  },
997
998
  },
999
+ {
1000
+ id: 'internal.billing.usage_charge',
1001
+ eventName: ProductNotificationEvent.BillingUsageChargeObserved,
1002
+ requiredFilter: {},
1003
+ allowedTriggers: ['each_match'],
1004
+ catalog: undefined,
1005
+ shadow: true,
1006
+ rule: {
1007
+ default: {
1008
+ ruleKey: 'internal.billing.usage_charge',
1009
+ groupKey: BILLING_USAGE_GROUP_KEY,
1010
+ },
1011
+ create: (_input, base) => ({
1012
+ ...base,
1013
+ repeatMode: 'every_match',
1014
+ trigger: { kind: 'each_match' },
1015
+ }),
1016
+ present: ({ payload }) => ({
1017
+ title: payload.paging
1018
+ ? 'Large individual usage charge'
1019
+ : 'Individual usage charge over $10',
1020
+ summary: [
1021
+ { workspace: true },
1022
+ ` charged ${payload.amount} for ${payload.tool}.`,
1023
+ ],
1024
+ details: [
1025
+ `Tool: ${payload.tool}`,
1026
+ `Charge record time (UTC): ${payload.chargeTime}`,
1027
+ `Charge: ${payload.chargeId}`,
1028
+ `Paging threshold: ${payload.threshold}`,
1029
+ 'Investigate settlement and performed work. For verified legitimate large batches, raise monitoring.largeUsageChargeThresholds for this exact tool in its provider registry and publish the catalog. Keep over-$10 messages enabled. Runbook: https://github.com/getaero-io/deepline-api/blob/main/docs/billing-observability.md#individual-charge-slack-messages-and-response',
1030
+ ],
1031
+ targetUrl: String(payload.targetUrl),
1032
+ subjectKind: 'usage_charge',
1033
+ subjectId: String(payload.chargeId),
1034
+ ...(payload.paging ? { severity: 'error' as const } : {}),
1035
+ }),
1036
+ },
1037
+ },
998
1038
  lateCreditDeliveryRegistration(
999
1039
  BILLING_PURCHASE_LATE_RULE_KEY,
1000
1040
  ProductNotificationEvent.BillingPurchaseLate,
@@ -9,8 +9,11 @@ import {
9
9
  type ProductNotificationDefaultPolicy,
10
10
  } from './configuration';
11
11
  import {
12
+ BILLING_ALERTS_SLACK_CHANNEL_ID,
12
13
  BILLING_CREDIT_PURCHASE_GROUP_KEY,
13
14
  BILLING_CREDIT_PURCHASE_DESTINATION_KEY,
15
+ BILLING_USAGE_GROUP_KEY,
16
+ BILLING_USAGE_DESTINATION_KEY,
14
17
  BILLING_SALES_CONNECTION_ID,
15
18
  BILLING_SALES_DESTINATION_KEY,
16
19
  BILLING_SALES_GROUP_KEY,
@@ -22,7 +25,7 @@ import {
22
25
  * they create sparse copy-on-write overrides.
23
26
  */
24
27
  export const CURRENT_PRODUCT_NOTIFICATION_DEFAULT_POLICY = {
25
- version: 14,
28
+ version: 15,
26
29
  groups: [
27
30
  {
28
31
  groupKey: 'default',
@@ -44,6 +47,12 @@ export const CURRENT_PRODUCT_NOTIFICATION_DEFAULT_POLICY = {
44
47
  enabled: true,
45
48
  deliveryTiming: { mode: 'immediate' },
46
49
  },
50
+ {
51
+ groupKey: BILLING_USAGE_GROUP_KEY,
52
+ name: 'Individual usage charges',
53
+ enabled: true,
54
+ deliveryTiming: { mode: 'immediate' },
55
+ },
47
56
  {
48
57
  groupKey: BILLING_CREDIT_PURCHASE_GROUP_KEY,
49
58
  name: 'Credit purchase alerts',
@@ -79,6 +88,19 @@ export const CURRENT_PRODUCT_NOTIFICATION_DEFAULT_POLICY = {
79
88
  oauthConnectionId: BILLING_SALES_CONNECTION_ID,
80
89
  },
81
90
  },
91
+ {
92
+ destinationKey: BILLING_USAGE_DESTINATION_KEY,
93
+ groupKey: BILLING_USAGE_GROUP_KEY,
94
+ name: 'Deepline billing alerts',
95
+ enabled: true,
96
+ settings: {
97
+ kind: 'slack',
98
+ targetKind: 'channel',
99
+ targetId: BILLING_ALERTS_SLACK_CHANNEL_ID,
100
+ targetName: 'Deepline billing alerts',
101
+ oauthConnectionId: BILLING_SALES_CONNECTION_ID,
102
+ },
103
+ },
82
104
  {
83
105
  destinationKey: BILLING_CREDIT_PURCHASE_DESTINATION_KEY,
84
106
  groupKey: BILLING_CREDIT_PURCHASE_GROUP_KEY,
@@ -32,6 +32,7 @@ export const ProductNotificationEvent = {
32
32
  BillingPlanPurchased: 'billing.plan.purchased',
33
33
  BillingPurchaseLate: 'billing.purchase.late',
34
34
  BillingRenewalLate: 'billing.renewal.late',
35
+ BillingUsageChargeObserved: 'billing.usage.charge_observed',
35
36
  MonitorLifecycleChanged: 'monitor.lifecycle.changed',
36
37
  PlayLifecycleChanged: 'play.lifecycle.changed',
37
38
  PlayRunCompleted: 'play.run.completed',
@@ -76,6 +77,7 @@ export const PRODUCT_NOTIFICATION_EVENT_NAMES = [
76
77
  ProductNotificationEvent.BillingPlanPurchased,
77
78
  ProductNotificationEvent.BillingPurchaseLate,
78
79
  ProductNotificationEvent.BillingRenewalLate,
80
+ ProductNotificationEvent.BillingUsageChargeObserved,
79
81
  ] as const;
80
82
 
81
83
  export const PRODUCT_NOTIFICATION_COMPATIBILITY_EVENT_NAMES = [
@@ -265,6 +267,22 @@ export const PRODUCT_NOTIFICATION_EVENT_DEFINITIONS: readonly ProductNotificatio
265
267
  orderingSubjectFact: 'operationId',
266
268
  allowedTriggers: ['each_match'],
267
269
  },
270
+ {
271
+ eventName: ProductNotificationEvent.BillingUsageChargeObserved,
272
+ producerKey: ProductNotificationProducerKey.BillingUsage,
273
+ requiredFacts: {
274
+ accountId: 'string',
275
+ chargeId: 'string',
276
+ amount: 'string',
277
+ tool: 'string',
278
+ chargeTime: 'string',
279
+ threshold: 'string',
280
+ paging: 'boolean',
281
+ targetUrl: 'string',
282
+ },
283
+ orderingSubjectFact: 'chargeId',
284
+ allowedTriggers: ['each_match'],
285
+ },
268
286
  {
269
287
  eventName: ProductNotificationEvent.BillingRenewalLate,
270
288
  producerKey: ProductNotificationProducerKey.BillingPurchases,
@@ -1,3 +1,4 @@
1
+ import { BILLING_ALERTS_SLACK_CHANNEL_ID } from './billing-sales';
1
2
  import { isSyntheticActorEmail } from '@deepline/auth/synthetic-identity';
2
3
  import { getCurrentRequestMetadata } from '../observability/log-metadata';
3
4
  import { getRuntimeEnv } from '../play-runtime/runtime-env';
@@ -89,7 +90,7 @@ const DEFAULT_MONITOR_ERROR_ACTIVITY_CHANNEL_ID = 'C0CD0JQTU20';
89
90
  export const MONITOR_CRON_FAILURES_SLACK_CHANNEL_ID = 'C0CCZCKETEV';
90
91
 
91
92
  // #deepline-billing-alerts: charge, ledger and payment notices needing review.
92
- export const BILLING_ALERTS_SLACK_CHANNEL_ID = 'C0CEBRS6PHS';
93
+ export { BILLING_ALERTS_SLACK_CHANNEL_ID } from './billing-sales';
93
94
  // #internal-reports-deepline-api.
94
95
  export const DAILY_ACTIVITY_SUMMARY_SLACK_CHANNEL_ID = 'C0APQ088CKX';
95
96
 
@@ -0,0 +1,41 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+ var _chunk3MQJJ6YXjs = require('./chunk-3MQJJ6YX.js');
17
+ require('./chunk-U3F63UWD.js');
18
+ require('./chunk-BLW2K6YH.js');
19
+ require('./chunk-B7NJ5JQ2.js');
20
+ require('./chunk-ALJJRZNJ.js');
21
+ require('./chunk-XNYIZMNQ.js');
22
+ require('./chunk-DIAWYWT5.js');
23
+ require('./chunk-CKSRTD45.js');
24
+ require('./chunk-OG64RBAC.js');
25
+ require('./chunk-COGTRVWW.js');
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+ exports.EXIT_WORKSPACE_MISMATCH = _chunk3MQJJ6YXjs.EXIT_WORKSPACE_MISMATCH; exports.authStatusLine = _chunk3MQJJ6YXjs.authStatusLine; exports.clearPendingClaim = _chunk3MQJJ6YXjs.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunk3MQJJ6YXjs.clearSatisfiedPendingClaim; exports.handleRegister = _chunk3MQJJ6YXjs.handleRegister; exports.handleStatus = _chunk3MQJJ6YXjs.handleStatus; exports.handleWait = _chunk3MQJJ6YXjs.handleWait; exports.httpJson = _chunk3MQJJ6YXjs.httpJson; exports.readPendingAuthClaim = _chunk3MQJJ6YXjs.readPendingAuthClaim; exports.readStatusBanner = _chunk3MQJJ6YXjs.readStatusBanner; exports.registerAuthCommands = _chunk3MQJJ6YXjs.registerAuthCommands; exports.reportSetupCompleted = _chunk3MQJJ6YXjs.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunk3MQJJ6YXjs.resolvePendingAuthClaimForResume; exports.statusBannerLine = _chunk3MQJJ6YXjs.statusBannerLine;
@@ -13,14 +13,14 @@ import {
13
13
  reportSetupCompleted,
14
14
  resolvePendingAuthClaimForResume,
15
15
  statusBannerLine
16
- } from "./chunk-NTFM7JQW.mjs";
17
- import "./chunk-QG3THSTN.mjs";
18
- import "./chunk-GE5GPLNM.mjs";
19
- import "./chunk-EUHTZV2E.mjs";
16
+ } from "./chunk-42F6LTBJ.mjs";
17
+ import "./chunk-BVAYLXMH.mjs";
18
+ import "./chunk-NGOKBSBH.mjs";
19
+ import "./chunk-3QSFSHCJ.mjs";
20
20
  import "./chunk-4QF2K7TM.mjs";
21
21
  import "./chunk-DLIRSHV6.mjs";
22
22
  import "./chunk-HBL4PM5Q.mjs";
23
- import "./chunk-TBLBYIKO.mjs";
23
+ import "./chunk-YAAQNDP6.mjs";
24
24
  import "./chunk-WZYKRD7T.mjs";
25
25
  import "./chunk-KRD6H754.mjs";
26
26
  export {
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  DeeplineClient
3
- } from "./chunk-GTH7JORC.mjs";
3
+ } from "./chunk-DIMKSDF6.mjs";
4
4
  import {
5
5
  iterateCursorPages,
6
6
  requireBillingIdempotencyKey
7
- } from "./chunk-X6R5UNDZ.mjs";
7
+ } from "./chunk-VFP3MFLD.mjs";
8
8
  import "./chunk-L2VKAASU.mjs";
9
9
  import "./chunk-NELMCOWK.mjs";
10
10
  import "./chunk-S3A4IXBQ.mjs";
@@ -15,9 +15,9 @@ import {
15
15
  openInBrowser,
16
16
  printCommandEnvelope,
17
17
  shouldEmitJson
18
- } from "./chunk-QG3THSTN.mjs";
19
- import "./chunk-GE5GPLNM.mjs";
20
- import "./chunk-EUHTZV2E.mjs";
18
+ } from "./chunk-BVAYLXMH.mjs";
19
+ import "./chunk-NGOKBSBH.mjs";
20
+ import "./chunk-3QSFSHCJ.mjs";
21
21
  import {
22
22
  AuthError,
23
23
  ConfigError
@@ -26,7 +26,7 @@ import "./chunk-DLIRSHV6.mjs";
26
26
  import {
27
27
  DeeplineError
28
28
  } from "./chunk-HBL4PM5Q.mjs";
29
- import "./chunk-TBLBYIKO.mjs";
29
+ import "./chunk-YAAQNDP6.mjs";
30
30
  import "./chunk-WZYKRD7T.mjs";
31
31
  import "./chunk-KRD6H754.mjs";
32
32
 
@@ -1230,7 +1230,7 @@ function formatComputeMinutes(minutes) {
1230
1230
  async function handleIncludedCompute(options) {
1231
1231
  const client = new DeeplineClient();
1232
1232
  const payload = options.enable ? await client.billing.enableIncludedCompute() : await client.billing.includedCompute();
1233
- const plan = `${formatComputeMinutes(payload.plan.included_minutes)} included per month, then ${Math.round(payload.plan.credits_per_minute * 60)} credits/hour`;
1233
+ const plan = `${formatComputeMinutes(payload.plan.included_minutes)} standard-equivalent compute included per month, then ${Math.round(payload.plan.credits_per_minute * 60)} credits/standard hour`;
1234
1234
  printCommandEnvelope(
1235
1235
  {
1236
1236
  ok: true,
@@ -1240,8 +1240,8 @@ async function handleIncludedCompute(options) {
1240
1240
  {
1241
1241
  title: "billing compute",
1242
1242
  lines: payload.status === "on" ? [
1243
- `Included compute: on, ${formatComputeMinutes(payload.included_minutes)} per month, then ${Math.round((payload.credits_per_minute ?? 0) * 60)} credits/hour`,
1244
- `Used: ${formatComputeMinutes(payload.included_minutes_used)} included, ${formatComputeMinutes(payload.minutes_used)} total since ${payload.period_start_at.slice(0, 10)}`
1243
+ `Included compute: on, ${formatComputeMinutes(payload.included_minutes)} standard-equivalent per month, then ${Math.round((payload.credits_per_minute ?? 0) * 60)} credits/standard hour`,
1244
+ `Used: ${formatComputeMinutes(payload.included_minutes_used)} standard-equivalent included, ${formatComputeMinutes(payload.minutes_used)} elapsed since ${payload.period_start_at.slice(0, 10)}`
1245
1245
  ] : payload.status === "off" ? [
1246
1246
  "Included compute: off; Play compute is billed at provider cost.",
1247
1247
  `Used: ${formatComputeMinutes(payload.minutes_used)} since ${payload.period_start_at.slice(0, 10)}`,
@@ -1594,6 +1594,8 @@ Examples:
1594
1594
  ).requiredOption(
1595
1595
  "--sandbox-timeout <duration>",
1596
1596
  "Runtime timeout, such as 30m or 2h"
1597
+ ).addOption(
1598
+ new Option("--sandbox-size <size>", "Runtime memory profile").choices(["standard", "large", "xlarge"]).default("standard")
1597
1599
  ).option("--quantity <sessions>", "Number of sandbox sessions", "1").option("--json", "Emit the bounded component quotation as JSON").action(
1598
1600
  async (options) => {
1599
1601
  const quantity = Number(options.quantity);
@@ -1604,7 +1606,7 @@ Examples:
1604
1606
  quantity,
1605
1607
  sandbox_runtime: {
1606
1608
  timeout: options.sandboxTimeout,
1607
- size: "standard"
1609
+ size: options.sandboxSize
1608
1610
  }
1609
1611
  });
1610
1612
  printCommandEnvelope(quote, {