deepline 0.3.328 → 0.3.330

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 (124) hide show
  1. package/dist/bundling-sources/sdk/src/billing-idempotency.ts +24 -0
  2. package/dist/bundling-sources/sdk/src/client.ts +22 -22
  3. package/dist/bundling-sources/sdk/src/index.ts +1 -0
  4. package/dist/bundling-sources/sdk/src/play.ts +55 -45
  5. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  6. package/dist/bundling-sources/sdk/src/types.ts +16 -0
  7. package/dist/bundling-sources/shared_libs/observability/queue-health.ts +9 -0
  8. package/dist/bundling-sources/shared_libs/observability/queue-item-connectors.ts +1 -0
  9. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +31 -15
  10. package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-semantics.ts +22 -4
  11. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +29 -11
  12. package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +145 -19
  13. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +37 -10
  14. package/dist/bundling-sources/shared_libs/plays/dataset.ts +3 -0
  15. package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +59 -10
  16. package/dist/cli/{auth-ANHHABWT.mjs → auth-A4XQ3KMW.mjs} +4 -4
  17. package/dist/cli/auth-XJJYQESF.js +31 -0
  18. package/dist/cli/{billing-R6NYYO6G.mjs → billing-634WZLKG.mjs} +36 -14
  19. package/dist/cli/{billing-GGVKLFE6.js → billing-WLHXYC5Z.js} +101 -79
  20. package/dist/cli/{chunk-ZND34HL7.mjs → chunk-3QZ22IZO.mjs} +4 -4
  21. package/dist/cli/{chunk-UDIPEHNJ.js → chunk-46IVSO6O.js} +141 -11
  22. package/dist/cli/{chunk-GZV5F6CL.mjs → chunk-56RM5AQF.mjs} +79 -26
  23. package/dist/cli/{chunk-UM4ZE3P7.mjs → chunk-5W636CDP.mjs} +2 -2
  24. package/dist/cli/{chunk-W6WV6UME.js → chunk-63W4744F.js} +563 -555
  25. package/dist/cli/{chunk-OOLIEDIJ.mjs → chunk-6VBXS43D.mjs} +2 -2
  26. package/dist/cli/{chunk-B2R66UTW.mjs → chunk-7DGZCMXQ.mjs} +1 -1
  27. package/dist/cli/{chunk-7DDNACAQ.js → chunk-7FWHOKNS.js} +26 -26
  28. package/dist/cli/{chunk-YIY74KUF.mjs → chunk-EV4QJE4J.mjs} +1 -1
  29. package/dist/cli/{chunk-2HKPAZVJ.js → chunk-FKKNYKDY.js} +14 -3
  30. package/dist/cli/{chunk-DNYRAZSK.js → chunk-FLIABSY6.js} +48 -48
  31. package/dist/cli/{chunk-O5GPNPOC.js → chunk-GHHLLEZK.js} +4 -4
  32. package/dist/cli/{chunk-ZFKUVDOM.js → chunk-GKZZ32EV.js} +60 -60
  33. package/dist/cli/{chunk-LJWC5HSO.js → chunk-GS7GA7PI.js} +15 -15
  34. package/dist/cli/{chunk-7R6KQSFA.mjs → chunk-GTBS6LQH.mjs} +38 -22
  35. package/dist/cli/{chunk-2FPVWL4W.js → chunk-LNDGT7NV.js} +119 -66
  36. package/dist/cli/{chunk-SMGNDW7O.mjs → chunk-LQ5DD2UF.mjs} +2 -2
  37. package/dist/cli/{chunk-WWVE4HFN.mjs → chunk-MBI3BVSQ.mjs} +1 -1
  38. package/dist/cli/{chunk-KP7W5NO6.mjs → chunk-NTVTZAVZ.mjs} +13 -2
  39. package/dist/cli/{chunk-XVKQ6D4K.js → chunk-O2L46S3I.js} +2 -2
  40. package/dist/cli/{chunk-BC7FMQ2G.mjs → chunk-PH2N6GC7.mjs} +1 -1
  41. package/dist/cli/{chunk-6ENR652E.mjs → chunk-SDSS4OTO.mjs} +77 -69
  42. package/dist/cli/{chunk-YFCHBN3C.mjs → chunk-SZCUJ4AL.mjs} +1 -1
  43. package/dist/cli/{chunk-AGH6YP2T.js → chunk-UQV5M6HN.js} +3 -3
  44. package/dist/cli/{chunk-7MABE3ZK.mjs → chunk-VFC6CZLF.mjs} +135 -5
  45. package/dist/cli/{chunk-DNMV2L7Q.js → chunk-WHKTRZ3J.js} +6 -6
  46. package/dist/cli/{chunk-Y4LXIUHX.js → chunk-XUNMVZOW.js} +1 -1
  47. package/dist/cli/{chunk-LEEXRXQQ.js → chunk-YFP4UH2Y.js} +6 -6
  48. package/dist/cli/{chunk-ITFUZEHE.js → chunk-YGFQ7YSM.js} +51 -35
  49. package/dist/cli/{chunk-AKKQ26RX.mjs → chunk-ZYPFCBW5.mjs} +1 -1
  50. package/dist/cli/client-3CREIHGC.js +20 -0
  51. package/dist/cli/{client-ZABA5NMD.mjs → client-WYFGEJOX.mjs} +3 -3
  52. package/dist/cli/{csv-VECE3PWX.mjs → csv-BDZSDXLU.mjs} +3 -3
  53. package/dist/cli/{csv-4ZK5ZJAJ.js → csv-THMQDXCJ.js} +12 -12
  54. package/dist/cli/{db-UJPCDBV7.js → db-5BQJOZG7.js} +29 -29
  55. package/dist/cli/{db-6VE4OEWW.mjs → db-R2LTNLFM.mjs} +4 -4
  56. package/dist/cli/{describe-CFUZZ326.js → describe-F4G5H3SC.js} +17 -17
  57. package/dist/cli/{describe-W6X5G4JR.mjs → describe-WECII7FS.mjs} +10 -10
  58. package/dist/cli/{executions-AI4DTQQL.js → executions-HJRVD4M6.js} +6 -6
  59. package/dist/cli/{executions-ZZWB75DF.mjs → executions-HPRIRB73.mjs} +4 -4
  60. package/dist/cli/{feedback-IM5Z6T5K.mjs → feedback-5VVW5WW7.mjs} +3 -3
  61. package/dist/cli/{feedback-FYSNSYUU.js → feedback-GHGDH43D.js} +6 -6
  62. package/dist/cli/{git-YNYTK3YW.mjs → git-BBXML2UJ.mjs} +4 -4
  63. package/dist/cli/git-NNEBLRVP.js +23 -0
  64. package/dist/cli/index.js +79 -79
  65. package/dist/cli/index.mjs +31 -31
  66. package/dist/cli/{legacy-noops-4DTMYYUY.mjs → legacy-noops-IALOUAGL.mjs} +4 -4
  67. package/dist/cli/{legacy-noops-PHJE2XFK.js → legacy-noops-VNZZ3VVT.js} +7 -7
  68. package/dist/cli/{monitors-27JP76WE.js → monitors-MLP6IA2R.js} +85 -85
  69. package/dist/cli/{monitors-HUP4MVWJ.mjs → monitors-VDEB2FKS.mjs} +4 -4
  70. package/dist/cli/{org-RHVDMUKN.js → org-N6ADDGEV.js} +60 -60
  71. package/dist/cli/{org-L3B2RR4U.mjs → org-SDSSKY42.mjs} +4 -4
  72. package/dist/cli/play-UTIPBVDQ.js +153 -0
  73. package/dist/cli/{play-UXIJVYNF.mjs → play-VSTVY6PM.mjs} +9 -9
  74. package/dist/cli/{providers-VL6VY56M.js → providers-TJ42O6NN.js} +7 -7
  75. package/dist/cli/{providers-FABWTNKR.mjs → providers-UKC7KD3W.mjs} +4 -4
  76. package/dist/cli/{quickstart-IIPZ6DSY.js → quickstart-7S7NMCMX.js} +5 -5
  77. package/dist/cli/{quickstart-OA54A4IE.mjs → quickstart-WSKATNHJ.mjs} +3 -3
  78. package/dist/cli/{search-YDK4V2EW.mjs → search-6OS6VVCJ.mjs} +5 -5
  79. package/dist/cli/search-Y6UGKL5C.js +26 -0
  80. package/dist/cli/{secrets-JGU7ZRUW.js → secrets-GWLYB2KD.js} +13 -13
  81. package/dist/cli/{secrets-4MQF6RF6.mjs → secrets-QTTR5R5M.mjs} +4 -4
  82. package/dist/cli/{sessions-PTHOMSZ5.mjs → sessions-Q7MY5YYI.mjs} +4 -4
  83. package/dist/cli/{sessions-I7ZZYSYW.js → sessions-SUURWTVX.js} +5 -5
  84. package/dist/cli/{settings-X4ENSGNK.mjs → settings-3D5YDD2B.mjs} +7 -7
  85. package/dist/cli/{settings-ZUUBKIG6.js → settings-W4DYMYFA.js} +74 -74
  86. package/dist/cli/{setup-4UM6FCZL.mjs → setup-5F5OGYKW.mjs} +6 -6
  87. package/dist/cli/{setup-6L576TQE.js → setup-NIUADTDP.js} +41 -41
  88. package/dist/cli/skills-SHUL5UT7.js +28 -0
  89. package/dist/cli/{skills-U3BS5KUI.mjs → skills-TV3ORUIG.mjs} +4 -4
  90. package/dist/cli/tools-GNIVV4OF.js +40 -0
  91. package/dist/cli/{tools-O4PX6UVB.mjs → tools-YSZWAFKO.mjs} +7 -6
  92. package/dist/cli/{update-OHWSK2WN.mjs → update-FJAMLGLT.mjs} +6 -6
  93. package/dist/cli/update-U3XGY6IT.js +28 -0
  94. package/dist/cli/{workflow-QWTZBLT3.js → workflow-C6ZCM5S4.js} +15 -15
  95. package/dist/cli/{workflow-RVMGBMLX.mjs → workflow-HDHBYC7S.mjs} +5 -5
  96. package/dist/{client-wiWPZhnI.d.mts → client-D5XOQKsA.d.mts} +20 -1
  97. package/dist/{client-DHq8dJ56.d.ts → client-l-IoLh8Z.d.ts} +20 -1
  98. package/dist/{compiler-manifest-9TkZ_ykI.d.mts → compiler-manifest-82q4jtfQ.d.mts} +44 -17
  99. package/dist/{compiler-manifest-9TkZ_ykI.d.ts → compiler-manifest-82q4jtfQ.d.ts} +44 -17
  100. package/dist/{index-B-5_Xhud.d.mts → index-BPbW2XHF.d.mts} +1 -1
  101. package/dist/{index-ykksoEyR.d.ts → index-k0rquHIm.d.ts} +1 -1
  102. package/dist/index.d.mts +14 -8
  103. package/dist/index.d.ts +14 -8
  104. package/dist/index.js +194 -69
  105. package/dist/index.mjs +162 -37
  106. package/dist/install-integrity.json +85 -84
  107. package/dist/plays/bundle-play-file.d.mts +3 -3
  108. package/dist/plays/bundle-play-file.d.ts +3 -3
  109. package/dist/plays/bundle-play-file.mjs +2 -2
  110. package/dist/plays/run-request.d.mts +2 -2
  111. package/dist/plays/run-request.d.ts +2 -2
  112. package/dist/release.d.mts +1 -1
  113. package/dist/release.d.ts +1 -1
  114. package/dist/release.js +2 -2
  115. package/dist/release.mjs +1 -1
  116. package/package.json +2 -1
  117. package/dist/cli/auth-EKRB4GMP.js +0 -31
  118. package/dist/cli/client-55BDB4LE.js +0 -20
  119. package/dist/cli/git-VWXH6LCP.js +0 -23
  120. package/dist/cli/play-UKH4VFPF.js +0 -153
  121. package/dist/cli/search-JD2VTR4A.js +0 -26
  122. package/dist/cli/skills-TLPNCERR.js +0 -28
  123. package/dist/cli/tools-26JTFFU4.js +0 -39
  124. package/dist/cli/update-35RRCU2G.js +0 -28
@@ -15,7 +15,7 @@ import {
15
15
  RETAINED_PIPELINE_RECEIVERS_HEADER,
16
16
  RUNTIME_ENVIRONMENT_TOKEN_HEADER,
17
17
  resolveConfig
18
- } from "./chunk-WWVE4HFN.mjs";
18
+ } from "./chunk-MBI3BVSQ.mjs";
19
19
  import {
20
20
  PLAY_RUNTIME_BACKENDS,
21
21
  RAW_V2_TOOL_RESPONSE_CONTRACT,
@@ -82,6 +82,27 @@ function playInputExampleArgs(schema) {
82
82
  return " --input '@<input.json>'";
83
83
  }
84
84
 
85
+ // src/billing-idempotency.ts
86
+ function requireBillingIdempotencyKey(value) {
87
+ const normalized = value.trim();
88
+ let valid = normalized.length > 0 && normalized.length <= 200 && normalized === value;
89
+ if (valid) {
90
+ try {
91
+ valid = new Headers({ "Idempotency-Key": value }).get("Idempotency-Key") === value;
92
+ } catch {
93
+ valid = false;
94
+ }
95
+ }
96
+ if (!valid) {
97
+ throw new DeeplineError(
98
+ "Billing idempotencyKey must contain 1\u2013200 characters with no leading or trailing whitespace and be valid HTTP header text.",
99
+ void 0,
100
+ "INVALID_BILLING_IDEMPOTENCY_KEY"
101
+ );
102
+ }
103
+ return value;
104
+ }
105
+
85
106
  // src/db/query.ts
86
107
  function planCustomerDbQuery(input) {
87
108
  if (typeof input.sql !== "string" || !input.sql.trim())
@@ -3007,17 +3028,6 @@ var MONITOR_JOB_RECONCILIATION_STATES = [
3007
3028
  "partial",
3008
3029
  "mismatched"
3009
3030
  ];
3010
- function requireTargetBillingIdempotencyKey(value) {
3011
- const normalized = value.trim();
3012
- if (normalized.length === 0 || normalized.length > 200 || normalized !== value) {
3013
- throw new DeeplineError(
3014
- "Billing idempotencyKey must contain 1\u2013200 characters with no leading or trailing whitespace.",
3015
- void 0,
3016
- "INVALID_BILLING_IDEMPOTENCY_KEY"
3017
- );
3018
- }
3019
- return normalized;
3020
- }
3021
3031
  function isRecord2(value) {
3022
3032
  return Boolean(value && typeof value === "object" && !Array.isArray(value));
3023
3033
  }
@@ -3236,7 +3246,7 @@ var DeeplineClient = class _DeeplineClient {
3236
3246
  "/api/v2/billing/auto-recharge/trigger",
3237
3247
  {},
3238
3248
  {
3239
- "Idempotency-Key": requireTargetBillingIdempotencyKey(
3249
+ "Idempotency-Key": requireBillingIdempotencyKey(
3240
3250
  options2?.idempotencyKey ?? globalThis.crypto.randomUUID()
3241
3251
  )
3242
3252
  }
@@ -5671,13 +5681,14 @@ var DeeplineClient = class _DeeplineClient {
5671
5681
  * requires confirmation.
5672
5682
  */
5673
5683
  async topUpBillingBalance(options) {
5684
+ const idempotencyKey = options.idempotencyKey === void 0 ? void 0 : requireBillingIdempotencyKey(options.idempotencyKey);
5674
5685
  return this.http.post(
5675
5686
  "/api/v2/billing/top-up",
5676
5687
  {
5677
5688
  credits: options.credits,
5678
- ...options.idempotencyKey ? { idempotency_key: options.idempotencyKey } : {}
5689
+ ...idempotencyKey !== void 0 ? { idempotency_key: idempotencyKey } : {}
5679
5690
  },
5680
- void 0,
5691
+ idempotencyKey === void 0 ? void 0 : { "Idempotency-Key": idempotencyKey },
5681
5692
  // The idempotency key makes a retry at the product layer safe, but the
5682
5693
  // CLI should not hide ambiguous local delivery failures behind implicit
5683
5694
  // transport retries for a payment mutation.
@@ -5690,13 +5701,17 @@ var DeeplineClient = class _DeeplineClient {
5690
5701
  * `client.billing.topUpWithReceipt(...)`.
5691
5702
  */
5692
5703
  async topUpBillingBalanceWithReceipt(options) {
5704
+ const idempotencyKey = options.idempotencyKey === void 0 ? void 0 : requireBillingIdempotencyKey(options.idempotencyKey);
5693
5705
  return this.http.post(
5694
5706
  "/api/v2/billing/top-up",
5695
5707
  {
5696
5708
  credits: options.credits,
5697
- ...options.idempotencyKey ? { idempotency_key: options.idempotencyKey } : {}
5709
+ ...idempotencyKey !== void 0 ? { idempotency_key: idempotencyKey } : {}
5710
+ },
5711
+ {
5712
+ "x-deepline-top-up-receipt": "operation-v1",
5713
+ ...idempotencyKey !== void 0 ? { "Idempotency-Key": idempotencyKey } : {}
5698
5714
  },
5699
- { "x-deepline-top-up-receipt": "operation-v1" },
5700
5715
  { maxRetries: 0, exactUrlOnly: true }
5701
5716
  );
5702
5717
  }
@@ -5761,7 +5776,7 @@ var DeeplineClient = class _DeeplineClient {
5761
5776
  }
5762
5777
  /** Update automatic recharge and return the server-verified configuration. */
5763
5778
  async updateTargetAutoRecharge(options) {
5764
- const idempotencyKey = requireTargetBillingIdempotencyKey(
5779
+ const idempotencyKey = requireBillingIdempotencyKey(
5765
5780
  options.idempotencyKey
5766
5781
  );
5767
5782
  const response = await this.http.put(
@@ -5782,7 +5797,7 @@ var DeeplineClient = class _DeeplineClient {
5782
5797
  * flow. The caller supplies an idempotency key for safe retries.
5783
5798
  */
5784
5799
  async purchaseTargetBillingCredits(options) {
5785
- const idempotencyKey = requireTargetBillingIdempotencyKey(
5800
+ const idempotencyKey = requireBillingIdempotencyKey(
5786
5801
  options.idempotencyKey
5787
5802
  );
5788
5803
  return this.http.post(
@@ -5801,7 +5816,7 @@ var DeeplineClient = class _DeeplineClient {
5801
5816
  "INVALID_BILLING_IDEMPOTENCY_KEY"
5802
5817
  );
5803
5818
  }
5804
- const idempotencyKey = requireTargetBillingIdempotencyKey(
5819
+ const idempotencyKey = requireBillingIdempotencyKey(
5805
5820
  options.idempotencyKey
5806
5821
  );
5807
5822
  if (!Number.isSafeInteger(options.credits) || options.credits <= 0) {
@@ -5830,7 +5845,7 @@ var DeeplineClient = class _DeeplineClient {
5830
5845
  * commercial operation.
5831
5846
  */
5832
5847
  async transitionTargetBillingPlan(options) {
5833
- const idempotencyKey = requireTargetBillingIdempotencyKey(
5848
+ const idempotencyKey = requireBillingIdempotencyKey(
5834
5849
  options.idempotencyKey
5835
5850
  );
5836
5851
  return this.http.post(
@@ -5854,7 +5869,7 @@ var DeeplineClient = class _DeeplineClient {
5854
5869
  }
5855
5870
  /** Create an additional workspace through the durable PAYG workflow. */
5856
5871
  async createWorkspace(options) {
5857
- const idempotencyKey = requireTargetBillingIdempotencyKey(
5872
+ const idempotencyKey = requireBillingIdempotencyKey(
5858
5873
  options.idempotencyKey
5859
5874
  );
5860
5875
  const response = await this.http.post(
@@ -6472,6 +6487,7 @@ export {
6472
6487
  CSV_HEADER_MATCHING_NOTE,
6473
6488
  iterateCursorPages,
6474
6489
  playInputExampleArgs,
6490
+ requireBillingIdempotencyKey,
6475
6491
  planCustomerDbQuery,
6476
6492
  validateExecutionIdempotencyKey,
6477
6493
  PRODUCT_NOTIFICATION_EVENT_CATALOG,